diff --git a/include/libavcodec/a64colors.h b/include/libavcodec/a64colors.h new file mode 100644 index 0000000..a9cdb6f --- /dev/null +++ b/include/libavcodec/a64colors.h @@ -0,0 +1,52 @@ +/* + * a64 video encoder - c64 colors in rgb (Pepto) + * Copyright (c) 2009 Tobias Bindhammer + * + * 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 + */ + +/** + * @file + * a64 video encoder - c64 colors in rgb + */ + +#ifndef AVCODEC_A64COLORS_H +#define AVCODEC_A64COLORS_H + +#include + +/* c64 palette in RGB */ +static const uint8_t a64_palette[16][3] = { + {0x00, 0x00, 0x00}, + {0xff, 0xff, 0xff}, + {0x68, 0x37, 0x2b}, + {0x70, 0xa4, 0xb2}, + {0x6f, 0x3d, 0x86}, + {0x58, 0x8d, 0x43}, + {0x35, 0x28, 0x79}, + {0xb8, 0xc7, 0x6f}, + {0x6f, 0x4f, 0x25}, + {0x43, 0x39, 0x00}, + {0x9a, 0x67, 0x59}, + {0x44, 0x44, 0x44}, + {0x6c, 0x6c, 0x6c}, + {0x9a, 0xd2, 0x84}, + {0x6c, 0x5e, 0xb5}, + {0x95, 0x95, 0x95}, +}; + +#endif /* AVCODEC_A64COLORS_H */ diff --git a/include/libavcodec/a64tables.h b/include/libavcodec/a64tables.h new file mode 100644 index 0000000..a955ef4 --- /dev/null +++ b/include/libavcodec/a64tables.h @@ -0,0 +1,150 @@ +/* + * a64 video encoder - tables used by a64 encoders + * Copyright (c) 2009 Tobias Bindhammer + * + * 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 + */ + +/** + * @file + * a64 video encoder - tables used by a64 encoders + */ + +#ifndef AVCODEC_A64TABLES_H +#define AVCODEC_A64TABLES_H + +#include + +/** + * dither patterns used vor rendering the multicolor charset + */ + +static const uint8_t multi_dither_patterns[9][4][4] = { + { + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0} + }, + { + {1, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 1, 0}, + {0, 0, 0, 0} + }, + { + {1, 0, 0, 0}, + {0, 0, 1, 0}, + {0, 1, 0, 0}, + {0, 0, 0, 1} + }, + { + {1, 0, 0, 0}, + {0, 1, 0, 1}, + {0, 0, 1, 0}, + {0, 1, 0, 1} + }, + { + {1, 0, 1, 0}, + {0, 1, 0, 1}, + {1, 0, 1, 0}, + {0, 1, 0, 1} + }, + { + {1, 1, 1, 0}, + {0, 1, 0, 1}, + {1, 0, 1, 1}, + {0, 1, 0, 1} + }, + { + {0, 1, 1, 1}, + {1, 1, 0, 1}, + {1, 0, 1, 1}, + {1, 1, 1, 0} + }, + { + {0, 1, 1, 1}, + {1, 1, 1, 1}, + {1, 1, 0, 1}, + {1, 1, 1, 1} + }, + { + {1, 1, 1, 1}, + {1, 1, 1, 1}, + {1, 1, 1, 1}, + {1, 1, 1, 1} + }, +}; + +static const uint8_t interlaced_dither_patterns[9][8][4] = { + { + {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, 0, 1, 0}, {0, 0, 0, 0}, + {0, 0, 0, 0}, {0, 0, 0, 0}, + {1, 0, 1, 0}, {0, 0, 0, 0}, + {0, 0, 0, 0}, {0, 0, 0, 0}, + }, + { + {1, 0, 1, 0}, {0, 0, 0, 0}, + {0, 0, 0, 0}, {0, 1, 0, 1}, + {1, 0, 1, 0}, {0, 0, 0, 0}, + {0, 0, 0, 0}, {0, 1, 0, 1}, + }, + { + {1, 0, 1, 0}, {0, 1, 0, 1}, + {0, 1, 0, 1}, {0, 0, 0, 0}, + {1, 0, 1, 0}, {0, 1, 0, 1}, + {0, 1, 0, 1}, {0, 0, 0, 0}, + }, + { + {1, 0, 1, 0}, {0, 1, 0, 1}, + {0, 1, 0, 1}, {1, 0, 1, 0}, + {1, 0, 1, 0}, {0, 1, 0, 1}, + {0, 1, 0, 1}, {1, 0, 1, 0}, + }, + { + {1, 0, 1, 0}, {0, 1, 0, 1}, + {1, 1, 1, 1}, {1, 0, 1, 0}, + {1, 0, 1, 0}, {0, 1, 0, 1}, + {1, 1, 1, 1}, {1, 0, 1, 0}, + }, + { + {1, 0, 1, 0}, {1, 1, 1, 1}, + {1, 1, 1, 1}, {0, 1, 0, 1}, + {1, 0, 1, 0}, {1, 1, 1, 1}, + {1, 1, 1, 1}, {0, 1, 0, 1}, + }, + { + {1, 1, 1, 1}, {1, 1, 1, 1}, + {1, 1, 1, 1}, {0, 1, 0, 1}, + {1, 1, 1, 1}, {1, 1, 1, 1}, + {1, 1, 1, 1}, {0, 1, 0, 1}, + }, + { + {1, 1, 1, 1}, {1, 1, 1, 1}, + {1, 1, 1, 1}, {1, 1, 1, 1}, + {1, 1, 1, 1}, {1, 1, 1, 1}, + {1, 1, 1, 1}, {1, 1, 1, 1}, + } +}; + +#endif /* AVCODEC_A64TABLES_H */ diff --git a/include/libavcodec/aac.h b/include/libavcodec/aac.h new file mode 100644 index 0000000..78026a5 --- /dev/null +++ b/include/libavcodec/aac.h @@ -0,0 +1,122 @@ +/* + * AAC definitions and structures + * Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org ) + * Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com ) + * + * 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 + */ + +/** + * @file + * AAC definitions and structures + * @author Oded Shimon ( ods15 ods15 dyndns org ) + * @author Maxim Gavrilov ( maxim.gavrilov gmail com ) + */ + +#ifndef AVCODEC_AAC_H +#define AVCODEC_AAC_H + +#define MAX_CHANNELS 64 +#define MAX_ELEM_ID 64 + +#define TNS_MAX_ORDER 20 +#define MAX_LTP_LONG_SFB 40 + +enum RawDataBlockType { + TYPE_SCE, + TYPE_CPE, + TYPE_CCE, + TYPE_LFE, + TYPE_DSE, + TYPE_PCE, + TYPE_FIL, + TYPE_END, +}; + +enum ExtensionPayloadID { + EXT_FILL, + EXT_FILL_DATA, + EXT_DATA_ELEMENT, + EXT_DYNAMIC_RANGE = 0xb, + EXT_SBR_DATA = 0xd, + EXT_SBR_DATA_CRC = 0xe, +}; + +enum WindowSequence { + ONLY_LONG_SEQUENCE, + LONG_START_SEQUENCE, + EIGHT_SHORT_SEQUENCE, + LONG_STOP_SEQUENCE, +}; + +enum BandType { + ZERO_BT = 0, ///< Scalefactors and spectral data are all zero. + FIRST_PAIR_BT = 5, ///< This and later band types encode two values (rather than four) with one code word. + ESC_BT = 11, ///< Spectral data are coded with an escape sequence. + RESERVED_BT = 12, ///< Band types following are encoded differently from others. + NOISE_BT = 13, ///< Spectral data are scaled white noise not coded in the bitstream. + INTENSITY_BT2 = 14, ///< Scalefactor data are intensity stereo positions (out of phase). + INTENSITY_BT = 15, ///< Scalefactor data are intensity stereo positions (in phase). +}; + +enum ChannelPosition { + AAC_CHANNEL_OFF = 0, + AAC_CHANNEL_FRONT = 1, + AAC_CHANNEL_SIDE = 2, + AAC_CHANNEL_BACK = 3, + AAC_CHANNEL_LFE = 4, + AAC_CHANNEL_CC = 5, +}; + +#define MAX_PREDICTORS 672 + +#define SCALE_DIV_512 36 ///< scalefactor difference that corresponds to scale difference in 512 times +#define SCALE_ONE_POS 140 ///< scalefactor index that corresponds to scale=1.0 +#define SCALE_MAX_POS 255 ///< scalefactor index maximum value +#define SCALE_MAX_DIFF 60 ///< maximum scalefactor difference allowed by standard +#define SCALE_DIFF_ZERO 60 ///< codebook index corresponding to zero scalefactor indices difference + +#define POW_SF2_ZERO 200 ///< ff_aac_pow2sf_tab index corresponding to pow(2, 0); + +#define NOISE_PRE 256 ///< preamble for NOISE_BT, put in bitstream with the first noise band +#define NOISE_PRE_BITS 9 ///< length of preamble +#define NOISE_OFFSET 90 ///< subtracted from global gain, used as offset for the preamble + +typedef struct Pulse { + int num_pulse; + int start; + int pos[4]; + int amp[4]; +} Pulse; + +static inline int ff_aac_sample_rate_idx(int rate) +{ + if (92017 <= rate) return 0; + else if (75132 <= rate) return 1; + else if (55426 <= rate) return 2; + else if (46009 <= rate) return 3; + else if (37566 <= rate) return 4; + else if (27713 <= rate) return 5; + else if (23004 <= rate) return 6; + else if (18783 <= rate) return 7; + else if (13856 <= rate) return 8; + else if (11502 <= rate) return 9; + else if (9391 <= rate) return 10; + else return 11; +} + +#endif /* AVCODEC_AAC_H */ diff --git a/include/libavcodec/aac_ac3_parser.h b/include/libavcodec/aac_ac3_parser.h new file mode 100644 index 0000000..e3259d1 --- /dev/null +++ b/include/libavcodec/aac_ac3_parser.h @@ -0,0 +1,49 @@ +/* + * Common AAC and AC-3 parser prototypes + * Copyright (c) 2003 Fabrice Bellard + * Copyright (c) 2003 Michael Niedermayer + * + * 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_AAC_AC3_PARSER_H +#define AVCODEC_AAC_AC3_PARSER_H + +#include +#include "libavutil/crc.h" +#include "avcodec.h" +#include "parser.h" + +typedef struct AACAC3ParseContext { + ParseContext pc; + int header_size; + int (*sync)(uint64_t state, int *need_next_header, int *new_frame_start); + + const AVCRC *crc_ctx; + int remaining_size; + uint64_t state; + + int need_next_header; + int frame_number; +} AACAC3ParseContext; + +int ff_aac_ac3_parse(AVCodecParserContext *s1, + AVCodecContext *avctx, + const uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size); + +#endif /* AVCODEC_AAC_AC3_PARSER_H */ diff --git a/include/libavcodec/aac_defines.h b/include/libavcodec/aac_defines.h new file mode 100644 index 0000000..a3b6621 --- /dev/null +++ b/include/libavcodec/aac_defines.h @@ -0,0 +1,143 @@ +/* + * AAC defines + * + * 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_AAC_DEFINES_H +#define AVCODEC_AAC_DEFINES_H + +#ifndef USE_FIXED +#define USE_FIXED 0 +#endif + +#if USE_FIXED + +#include "libavutil/softfloat.h" + +#define AAC_RENAME(x) x ## _fixed +#define AAC_RENAME2(x) 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; +typedef int16_t SHORTFLOAT; +typedef SoftFloat AAC_FLOAT; +typedef int AAC_SIGNE; +#define FIXR(a) ((int)((a) * 1 + 0.5)) +#define FIXR10(a) ((int)((a) * 1024.0 + 0.5)) +#define Q23(a) (int)((a) * 8388608.0 + 0.5) +#define Q30(x) (int)((x)*1073741824.0 + 0.5) +#define Q31(x) (int)((x)*2147483648.0 + 0.5) +#define GET_GAIN(x, y) (-(y) * (1 << (x))) + 1024 +#define AAC_MUL16(x, y) (int)(((int64_t)(x) * (y) + 0x8000) >> 16) +#define AAC_MUL26(x, y) (int)(((int64_t)(x) * (y) + 0x2000000) >> 26) +#define AAC_MUL30(x, y) (int)(((int64_t)(x) * (y) + 0x20000000) >> 30) +#define AAC_MUL31(x, y) (int)(((int64_t)(x) * (y) + 0x40000000) >> 31) +#define AAC_MADD28(x, y, a, b) (int)((((int64_t)(x) * (y)) + \ + ((int64_t)(a) * (b)) + \ + 0x8000000) >> 28) +#define AAC_MADD30(x, y, a, b) (int)((((int64_t)(x) * (y)) + \ + ((int64_t)(a) * (b)) + \ + 0x20000000) >> 30) +#define AAC_MADD30_V8(x, y, a, b, c, d, e, f) (int)((((int64_t)(x) * (y)) + \ + ((int64_t)(a) * (b)) + \ + ((int64_t)(c) * (d)) + \ + ((int64_t)(e) * (f)) + \ + 0x20000000) >> 30) +#define AAC_MSUB30(x, y, a, b) (int)((((int64_t)(x) * (y)) - \ + ((int64_t)(a) * (b)) + \ + 0x20000000) >> 30) +#define AAC_MSUB30_V8(x, y, a, b, c, d, e, f) (int)((((int64_t)(x) * (y)) + \ + ((int64_t)(a) * (b)) - \ + ((int64_t)(c) * (d)) - \ + ((int64_t)(e) * (f)) + \ + 0x20000000) >> 30) +#define AAC_MSUB31_V3(x, y, z) (int)((((int64_t)(x) * (z)) - \ + ((int64_t)(y) * (z)) + \ + 0x40000000) >> 31) +#define AAC_HALF_SUM(x, y) (((x) >> 1) + ((y) >> 1)) + +/** + * Predictor State + */ +typedef struct PredictorStateFixed { + SoftFloat cor0; + SoftFloat cor1; + SoftFloat var0; + SoftFloat var1; + SoftFloat r0; + SoftFloat r1; + SoftFloat k1; + SoftFloat x_est; +} PredictorState; + +#ifdef LPC_USE_FIXED +#error aac_defines.h must be included before lpc_functions.h for fixed point decoder +#endif + +#define LPC_USE_FIXED 1 +#define LPC_MUL26(x, y) AAC_MUL26((x), (y)) +#define LPC_FIXR(x) FIXR(x) +#define LPC_SRA_R(x, y) (int)(((x) + (1 << ((y) - 1))) >> (y)) + +#else + +#define AAC_RENAME(x) x +#define AAC_RENAME2(x) ff_ ## x +typedef float INTFLOAT; +typedef float UINTFLOAT; +typedef float INT64FLOAT; +typedef float SHORTFLOAT; +typedef float AAC_FLOAT; +typedef unsigned AAC_SIGNE; +#define FIXR(x) ((float)(x)) +#define FIXR10(x) ((float)(x)) +#define Q23(x) ((float)(x)) +#define Q30(x) ((float)(x)) +#define Q31(x) ((float)(x)) +#define GET_GAIN(x, y) powf((x), -(y)) +#define AAC_MUL16(x, y) ((x) * (y)) +#define AAC_MUL26(x, y) ((x) * (y)) +#define AAC_MUL30(x, y) ((x) * (y)) +#define AAC_MUL31(x, y) ((x) * (y)) +#define AAC_MADD28(x, y, a, b) ((x) * (y) + (a) * (b)) +#define AAC_MADD30(x, y, a, b) ((x) * (y) + (a) * (b)) +#define AAC_MADD30_V8(x, y, a, b, c, d, e, f) ((x) * (y) + (a) * (b) + \ + (c) * (d) + (e) * (f)) +#define AAC_MSUB30(x, y, a, b) ((x) * (y) - (a) * (b)) +#define AAC_MSUB30_V8(x, y, a, b, c, d, e, f) ((x) * (y) + (a) * (b) - \ + (c) * (d) - (e) * (f)) +#define AAC_MSUB31_V3(x, y, z) ((x) - (y)) * (z) +#define AAC_HALF_SUM(x, y) ((x) + (y)) * 0.5f + +/** + * Predictor State + */ +typedef struct PredictorState { + float cor0; + float cor1; + float var0; + float var1; + float r0; + float r1; + float k1; + float x_est; +} PredictorState; + +#endif /* USE_FIXED */ + +#endif /* AVCODEC_AAC_DEFINES_H */ diff --git a/include/libavcodec/aaccoder_trellis.h b/include/libavcodec/aaccoder_trellis.h new file mode 100644 index 0000000..245aa1c --- /dev/null +++ b/include/libavcodec/aaccoder_trellis.h @@ -0,0 +1,192 @@ +/* + * AAC encoder trellis codebook selector + * Copyright (C) 2008-2009 Konstantin Shishkov + * + * 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 + */ + +/** + * @file + * AAC encoder trellis codebook selector + * @author Konstantin Shishkov + */ + +/** + * This file contains a template for the codebook_trellis_rate selector function. + * It needs to be provided, externally, as an already included declaration, + * the following functions from aacenc_quantization/util.h. They're not included + * explicitly here to make it possible to provide alternative implementations: + * - quantize_band_cost_bits + * - abs_pow34_v + */ + +#ifndef AVCODEC_AACCODER_TRELLIS_H +#define AVCODEC_AACCODER_TRELLIS_H + +#include +#include "libavutil/mathematics.h" +#include "avcodec.h" +#include "put_bits.h" +#include "aac.h" +#include "aacenc.h" +#include "aactab.h" +#include "aacenctab.h" + +/** + * structure used in optimal codebook search + */ +typedef struct TrellisBandCodingPath { + int prev_idx; ///< pointer to the previous path point + float cost; ///< path cost + int run; +} TrellisBandCodingPath; + + +static void codebook_trellis_rate(AACEncContext *s, SingleChannelElement *sce, + int win, int group_len, const float lambda) +{ + TrellisBandCodingPath path[120][CB_TOT_ALL]; + int w, swb, cb, start, size; + int i, j; + const int max_sfb = sce->ics.max_sfb; + const int run_bits = sce->ics.num_windows == 1 ? 5 : 3; + const int run_esc = (1 << run_bits) - 1; + int idx, ppos, count; + int stackrun[120], stackcb[120], stack_len; + float next_minbits = INFINITY; + int next_mincb = 0; + + s->aacdsp.abs_pow34(s->scoefs, sce->coeffs, 1024); + start = win*128; + for (cb = 0; cb < CB_TOT_ALL; cb++) { + path[0][cb].cost = run_bits+4; + path[0][cb].prev_idx = -1; + path[0][cb].run = 0; + } + for (swb = 0; swb < max_sfb; swb++) { + size = sce->ics.swb_sizes[swb]; + if (sce->zeroes[win*16 + swb]) { + float cost_stay_here = path[swb][0].cost; + float cost_get_here = next_minbits + run_bits + 4; + if ( run_value_bits[sce->ics.num_windows == 8][path[swb][0].run] + != run_value_bits[sce->ics.num_windows == 8][path[swb][0].run+1]) + cost_stay_here += run_bits; + if (cost_get_here < cost_stay_here) { + path[swb+1][0].prev_idx = next_mincb; + path[swb+1][0].cost = cost_get_here; + path[swb+1][0].run = 1; + } else { + path[swb+1][0].prev_idx = 0; + path[swb+1][0].cost = cost_stay_here; + path[swb+1][0].run = path[swb][0].run + 1; + } + next_minbits = path[swb+1][0].cost; + next_mincb = 0; + for (cb = 1; cb < CB_TOT_ALL; cb++) { + path[swb+1][cb].cost = 61450; + path[swb+1][cb].prev_idx = -1; + path[swb+1][cb].run = 0; + } + } else { + float minbits = next_minbits; + int mincb = next_mincb; + int startcb = sce->band_type[win*16+swb]; + startcb = aac_cb_in_map[startcb]; + next_minbits = INFINITY; + next_mincb = 0; + for (cb = 0; cb < startcb; cb++) { + path[swb+1][cb].cost = 61450; + path[swb+1][cb].prev_idx = -1; + path[swb+1][cb].run = 0; + } + for (cb = startcb; cb < CB_TOT_ALL; cb++) { + float cost_stay_here, cost_get_here; + float bits = 0.0f; + if (cb >= 12 && sce->band_type[win*16+swb] != aac_cb_out_map[cb]) { + path[swb+1][cb].cost = 61450; + path[swb+1][cb].prev_idx = -1; + path[swb+1][cb].run = 0; + continue; + } + for (w = 0; w < group_len; w++) { + bits += quantize_band_cost_bits(s, &sce->coeffs[start + w*128], + &s->scoefs[start + w*128], size, + sce->sf_idx[win*16+swb], + aac_cb_out_map[cb], + 0, INFINITY, NULL, NULL); + } + cost_stay_here = path[swb][cb].cost + bits; + cost_get_here = minbits + bits + run_bits + 4; + if ( run_value_bits[sce->ics.num_windows == 8][path[swb][cb].run] + != run_value_bits[sce->ics.num_windows == 8][path[swb][cb].run+1]) + cost_stay_here += run_bits; + if (cost_get_here < cost_stay_here) { + path[swb+1][cb].prev_idx = mincb; + path[swb+1][cb].cost = cost_get_here; + path[swb+1][cb].run = 1; + } else { + path[swb+1][cb].prev_idx = cb; + path[swb+1][cb].cost = cost_stay_here; + path[swb+1][cb].run = path[swb][cb].run + 1; + } + if (path[swb+1][cb].cost < next_minbits) { + next_minbits = path[swb+1][cb].cost; + next_mincb = cb; + } + } + } + start += sce->ics.swb_sizes[swb]; + } + + //convert resulting path from backward-linked list + stack_len = 0; + idx = 0; + for (cb = 1; cb < CB_TOT_ALL; cb++) + if (path[max_sfb][cb].cost < path[max_sfb][idx].cost) + idx = cb; + ppos = max_sfb; + while (ppos > 0) { + av_assert1(idx >= 0); + cb = idx; + stackrun[stack_len] = path[ppos][cb].run; + stackcb [stack_len] = cb; + idx = path[ppos-path[ppos][cb].run+1][cb].prev_idx; + ppos -= path[ppos][cb].run; + stack_len++; + } + //perform actual band info encoding + start = 0; + for (i = stack_len - 1; i >= 0; i--) { + cb = aac_cb_out_map[stackcb[i]]; + put_bits(&s->pb, 4, cb); + count = stackrun[i]; + memset(sce->zeroes + win*16 + start, !cb, count); + //XXX: memset when band_type is also uint8_t + for (j = 0; j < count; j++) { + sce->band_type[win*16 + start] = cb; + start++; + } + while (count >= run_esc) { + put_bits(&s->pb, run_bits, run_esc); + count -= run_esc; + } + put_bits(&s->pb, run_bits, count); + } +} + + +#endif /* AVCODEC_AACCODER_TRELLIS_H */ diff --git a/include/libavcodec/aaccoder_twoloop.h b/include/libavcodec/aaccoder_twoloop.h new file mode 100644 index 0000000..c56abc6 --- /dev/null +++ b/include/libavcodec/aaccoder_twoloop.h @@ -0,0 +1,759 @@ +/* + * AAC encoder twoloop coder + * Copyright (C) 2008-2009 Konstantin Shishkov + * + * 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 + */ + +/** + * @file + * AAC encoder twoloop coder + * @author Konstantin Shishkov, Claudio Freire + */ + +/** + * This file contains a template for the twoloop coder function. + * It needs to be provided, externally, as an already included declaration, + * the following functions from aacenc_quantization/util.h. They're not included + * explicitly here to make it possible to provide alternative implementations: + * - quantize_band_cost + * - abs_pow34_v + * - find_max_val + * - find_min_book + * - find_form_factor + */ + +#ifndef AVCODEC_AACCODER_TWOLOOP_H +#define AVCODEC_AACCODER_TWOLOOP_H + +#include +#include "libavutil/mathematics.h" +#include "mathops.h" +#include "avcodec.h" +#include "put_bits.h" +#include "aac.h" +#include "aacenc.h" +#include "aactab.h" +#include "aacenctab.h" + +/** Frequency in Hz for lower limit of noise substitution **/ +#define NOISE_LOW_LIMIT 4000 + +/* Reflects the cost to change codebooks */ +static inline int ff_pns_bits(SingleChannelElement *sce, int w, int g) +{ + return (!g || !sce->zeroes[w*16+g-1] || !sce->can_pns[w*16+g-1]) ? 9 : 5; +} + +/** + * two-loop quantizers search taken from ISO 13818-7 Appendix C + */ +static void search_for_quantizers_twoloop(AVCodecContext *avctx, + AACEncContext *s, + SingleChannelElement *sce, + const float lambda) +{ + int start = 0, i, w, w2, g, recomprd; + int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate + / ((avctx->flags & AV_CODEC_FLAG_QSCALE) ? 2.0f : avctx->ch_layout.nb_channels) + * (lambda / 120.f); + int refbits = destbits; + int toomanybits, toofewbits; + char nzs[128]; + uint8_t nextband[128]; + int maxsf[128], minsf[128]; + float dists[128] = { 0 }, qenergies[128] = { 0 }, uplims[128], euplims[128], energies[128]; + float maxvals[128], spread_thr_r[128]; + float min_spread_thr_r, max_spread_thr_r; + + /** + * rdlambda controls the maximum tolerated distortion. Twoloop + * will keep iterating until it fails to lower it or it reaches + * ulimit * rdlambda. Keeping it low increases quality on difficult + * signals, but lower it too much, and bits will be taken from weak + * signals, creating "holes". A balance is necessary. + * rdmax and rdmin specify the relative deviation from rdlambda + * allowed for tonality compensation + */ + float rdlambda = av_clipf(2.0f * 120.f / lambda, 0.0625f, 16.0f); + const float nzslope = 1.5f; + float rdmin = 0.03125f; + float rdmax = 1.0f; + + /** + * sfoffs controls an offset of optmium allocation that will be + * applied based on lambda. Keep it real and modest, the loop + * will take care of the rest, this just accelerates convergence + */ + float sfoffs = av_clipf(log2f(120.0f / lambda) * 4.0f, -5, 10); + + int fflag, minscaler, nminscaler; + int its = 0; + int maxits = 30; + int allz = 0; + int tbits; + int cutoff = 1024; + int pns_start_pos; + int prev; + + /** + * zeroscale controls a multiplier of the threshold, if band energy + * is below this, a zero is forced. Keep it lower than 1, unless + * low lambda is used, because energy < threshold doesn't mean there's + * no audible signal outright, it's just energy. Also make it rise + * slower than rdlambda, as rdscale has due compensation with + * noisy band depriorization below, whereas zeroing logic is rather dumb + */ + float zeroscale; + if (lambda > 120.f) { + zeroscale = av_clipf(powf(120.f / lambda, 0.25f), 0.0625f, 1.0f); + } else { + zeroscale = 1.f; + } + + if (s->psy.bitres.alloc >= 0) { + /** + * Psy granted us extra bits to use, from the reservoire + * adjust for lambda except what psy already did + */ + destbits = s->psy.bitres.alloc + * (lambda / (avctx->global_quality ? avctx->global_quality : 120)); + } + + if (avctx->flags & AV_CODEC_FLAG_QSCALE) { + /** + * Constant Q-scale doesn't compensate MS coding on its own + * No need to be overly precise, this only controls RD + * adjustment CB limits when going overboard + */ + if (s->options.mid_side && s->cur_type == TYPE_CPE) + destbits *= 2; + + /** + * When using a constant Q-scale, don't adjust bits, just use RD + * Don't let it go overboard, though... 8x psy target is enough + */ + toomanybits = 5800; + toofewbits = destbits / 16; + + /** Don't offset scalers, just RD */ + sfoffs = sce->ics.num_windows - 1; + rdlambda = sqrtf(rdlambda); + + /** search further */ + maxits *= 2; + } else { + /* When using ABR, be strict, but a reasonable leeway is + * critical to allow RC to smoothly track desired bitrate + * without sudden quality drops that cause audible artifacts. + * Symmetry is also desirable, to avoid systematic bias. + */ + toomanybits = destbits + destbits/8; + toofewbits = destbits - destbits/8; + + sfoffs = 0; + rdlambda = sqrtf(rdlambda); + } + + /** and zero out above cutoff frequency */ + { + int wlen = 1024 / sce->ics.num_windows; + int bandwidth; + + /** + * Scale, psy gives us constant quality, this LP only scales + * bitrate by lambda, so we save bits on subjectively unimportant HF + * rather than increase quantization noise. Adjust nominal bitrate + * to effective bitrate according to encoding parameters, + * AAC_CUTOFF_FROM_BITRATE is calibrated for effective bitrate. + */ + float rate_bandwidth_multiplier = 1.5f; + int frame_bit_rate = (avctx->flags & AV_CODEC_FLAG_QSCALE) + ? (refbits * rate_bandwidth_multiplier * avctx->sample_rate / 1024) + : (avctx->bit_rate / avctx->ch_layout.nb_channels); + + /** Compensate for extensions that increase efficiency */ + if (s->options.pns || s->options.intensity_stereo) + frame_bit_rate *= 1.15f; + + if (avctx->cutoff > 0) { + bandwidth = avctx->cutoff; + } else { + bandwidth = FFMAX(3000, AAC_CUTOFF_FROM_BITRATE(frame_bit_rate, 1, avctx->sample_rate)); + s->psy.cutoff = bandwidth; + } + + cutoff = bandwidth * 2 * wlen / avctx->sample_rate; + pns_start_pos = NOISE_LOW_LIMIT * 2 * wlen / avctx->sample_rate; + } + + /** + * for values above this the decoder might end up in an endless loop + * due to always having more bits than what can be encoded. + */ + destbits = FFMIN(destbits, 5800); + toomanybits = FFMIN(toomanybits, 5800); + toofewbits = FFMIN(toofewbits, 5800); + /** + * XXX: some heuristic to determine initial quantizers will reduce search time + * determine zero bands and upper distortion limits + */ + min_spread_thr_r = -1; + max_spread_thr_r = -1; + for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { + for (g = start = 0; g < sce->ics.num_swb; start += sce->ics.swb_sizes[g++]) { + int nz = 0; + float uplim = 0.0f, energy = 0.0f, spread = 0.0f; + for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { + FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g]; + if (start >= cutoff || band->energy <= (band->threshold * zeroscale) || band->threshold == 0.0f) { + sce->zeroes[(w+w2)*16+g] = 1; + continue; + } + nz = 1; + } + if (!nz) { + uplim = 0.0f; + } else { + nz = 0; + for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { + FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[(w+w2)*16+g]; + if (band->energy <= (band->threshold * zeroscale) || band->threshold == 0.0f) + continue; + uplim += band->threshold; + energy += band->energy; + spread += band->spread; + nz++; + } + } + uplims[w*16+g] = uplim; + energies[w*16+g] = energy; + nzs[w*16+g] = nz; + sce->zeroes[w*16+g] = !nz; + allz |= nz; + if (nz && sce->can_pns[w*16+g]) { + spread_thr_r[w*16+g] = energy * nz / (uplim * spread); + if (min_spread_thr_r < 0) { + min_spread_thr_r = max_spread_thr_r = spread_thr_r[w*16+g]; + } else { + min_spread_thr_r = FFMIN(min_spread_thr_r, spread_thr_r[w*16+g]); + max_spread_thr_r = FFMAX(max_spread_thr_r, spread_thr_r[w*16+g]); + } + } + } + } + + /** Compute initial scalers */ + minscaler = 65535; + for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { + for (g = 0; g < sce->ics.num_swb; g++) { + if (sce->zeroes[w*16+g]) { + sce->sf_idx[w*16+g] = SCALE_ONE_POS; + continue; + } + /** + * log2f-to-distortion ratio is, technically, 2 (1.5db = 4, but it's power vs level so it's 2). + * But, as offsets are applied, low-frequency signals are too sensitive to the induced distortion, + * so we make scaling more conservative by choosing a lower log2f-to-distortion ratio, and thus + * more robust. + */ + sce->sf_idx[w*16+g] = av_clip( + SCALE_ONE_POS + + 1.75*log2f(FFMAX(0.00125f,uplims[w*16+g]) / sce->ics.swb_sizes[g]) + + sfoffs, + 60, SCALE_MAX_POS); + minscaler = FFMIN(minscaler, sce->sf_idx[w*16+g]); + } + } + + /** Clip */ + minscaler = av_clip(minscaler, SCALE_ONE_POS - SCALE_DIV_512, SCALE_MAX_POS - SCALE_DIV_512); + for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) + for (g = 0; g < sce->ics.num_swb; g++) + if (!sce->zeroes[w*16+g]) + sce->sf_idx[w*16+g] = av_clip(sce->sf_idx[w*16+g], minscaler, minscaler + SCALE_MAX_DIFF - 1); + + if (!allz) + return; + s->aacdsp.abs_pow34(s->scoefs, sce->coeffs, 1024); + ff_quantize_band_cost_cache_init(s); + + for (i = 0; i < sizeof(minsf) / sizeof(minsf[0]); ++i) + minsf[i] = 0; + for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { + start = w*128; + for (g = 0; g < sce->ics.num_swb; g++) { + const float *scaled = s->scoefs + start; + int minsfidx; + maxvals[w*16+g] = find_max_val(sce->ics.group_len[w], sce->ics.swb_sizes[g], scaled); + if (maxvals[w*16+g] > 0) { + minsfidx = coef2minsf(maxvals[w*16+g]); + for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) + minsf[(w+w2)*16+g] = minsfidx; + } + start += sce->ics.swb_sizes[g]; + } + } + + /** + * Scale uplims to match rate distortion to quality + * bu applying noisy band depriorization and tonal band priorization. + * Maxval-energy ratio gives us an idea of how noisy/tonal the band is. + * If maxval^2 ~ energy, then that band is mostly noise, and we can relax + * rate distortion requirements. + */ + memcpy(euplims, uplims, sizeof(euplims)); + for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { + /** psy already priorizes transients to some extent */ + float de_psy_factor = (sce->ics.num_windows > 1) ? 8.0f / sce->ics.group_len[w] : 1.0f; + start = w*128; + for (g = 0; g < sce->ics.num_swb; g++) { + if (nzs[g] > 0) { + float cleanup_factor = ff_sqrf(av_clipf(start / (cutoff * 0.75f), 1.0f, 2.0f)); + float energy2uplim = find_form_factor( + sce->ics.group_len[w], sce->ics.swb_sizes[g], + uplims[w*16+g] / (nzs[g] * sce->ics.swb_sizes[w]), + sce->coeffs + start, + nzslope * cleanup_factor); + energy2uplim *= de_psy_factor; + if (!(avctx->flags & AV_CODEC_FLAG_QSCALE)) { + /** In ABR, we need to priorize less and let rate control do its thing */ + energy2uplim = sqrtf(energy2uplim); + } + energy2uplim = FFMAX(0.015625f, FFMIN(1.0f, energy2uplim)); + uplims[w*16+g] *= av_clipf(rdlambda * energy2uplim, rdmin, rdmax) + * sce->ics.group_len[w]; + + energy2uplim = find_form_factor( + sce->ics.group_len[w], sce->ics.swb_sizes[g], + uplims[w*16+g] / (nzs[g] * sce->ics.swb_sizes[w]), + sce->coeffs + start, + 2.0f); + energy2uplim *= de_psy_factor; + if (!(avctx->flags & AV_CODEC_FLAG_QSCALE)) { + /** In ABR, we need to priorize less and let rate control do its thing */ + energy2uplim = sqrtf(energy2uplim); + } + energy2uplim = FFMAX(0.015625f, FFMIN(1.0f, energy2uplim)); + euplims[w*16+g] *= av_clipf(rdlambda * energy2uplim * sce->ics.group_len[w], + 0.5f, 1.0f); + } + start += sce->ics.swb_sizes[g]; + } + } + + for (i = 0; i < sizeof(maxsf) / sizeof(maxsf[0]); ++i) + maxsf[i] = SCALE_MAX_POS; + + //perform two-loop search + //outer loop - improve quality + do { + //inner loop - quantize spectrum to fit into given number of bits + int overdist; + int qstep = its ? 1 : 32; + do { + int changed = 0; + prev = -1; + recomprd = 0; + tbits = 0; + for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { + start = w*128; + for (g = 0; g < sce->ics.num_swb; g++) { + const float *coefs = &sce->coeffs[start]; + const float *scaled = &s->scoefs[start]; + int bits = 0; + int cb; + float dist = 0.0f; + float qenergy = 0.0f; + + if (sce->zeroes[w*16+g] || sce->sf_idx[w*16+g] >= 218) { + start += sce->ics.swb_sizes[g]; + if (sce->can_pns[w*16+g]) { + /** PNS isn't free */ + tbits += ff_pns_bits(sce, w, g); + } + continue; + } + cb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]); + for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { + int b; + float sqenergy; + dist += quantize_band_cost_cached(s, w + w2, g, coefs + w2*128, + scaled + w2*128, + sce->ics.swb_sizes[g], + sce->sf_idx[w*16+g], + cb, + 1.0f, + INFINITY, + &b, &sqenergy, + 0); + bits += b; + qenergy += sqenergy; + } + dists[w*16+g] = dist - bits; + qenergies[w*16+g] = qenergy; + if (prev != -1) { + int sfdiff = av_clip(sce->sf_idx[w*16+g] - prev + SCALE_DIFF_ZERO, 0, 2*SCALE_MAX_DIFF); + bits += ff_aac_scalefactor_bits[sfdiff]; + } + tbits += bits; + start += sce->ics.swb_sizes[g]; + prev = sce->sf_idx[w*16+g]; + } + } + if (tbits > toomanybits) { + recomprd = 1; + for (i = 0; i < 128; i++) { + if (sce->sf_idx[i] < (SCALE_MAX_POS - SCALE_DIV_512)) { + int maxsf_i = (tbits > 5800) ? SCALE_MAX_POS : maxsf[i]; + int new_sf = FFMIN(maxsf_i, sce->sf_idx[i] + qstep); + if (new_sf != sce->sf_idx[i]) { + sce->sf_idx[i] = new_sf; + changed = 1; + } + } + } + } else if (tbits < toofewbits) { + recomprd = 1; + for (i = 0; i < 128; i++) { + if (sce->sf_idx[i] > SCALE_ONE_POS) { + int new_sf = FFMAX3(minsf[i], SCALE_ONE_POS, sce->sf_idx[i] - qstep); + if (new_sf != sce->sf_idx[i]) { + sce->sf_idx[i] = new_sf; + changed = 1; + } + } + } + } + qstep >>= 1; + if (!qstep && tbits > toomanybits && sce->sf_idx[0] < 217 && changed) + qstep = 1; + } while (qstep); + + overdist = 1; + fflag = tbits < toofewbits; + for (i = 0; i < 2 && (overdist || recomprd); ++i) { + if (recomprd) { + /** Must recompute distortion */ + prev = -1; + tbits = 0; + for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { + start = w*128; + for (g = 0; g < sce->ics.num_swb; g++) { + const float *coefs = sce->coeffs + start; + const float *scaled = s->scoefs + start; + int bits = 0; + int cb; + float dist = 0.0f; + float qenergy = 0.0f; + + if (sce->zeroes[w*16+g] || sce->sf_idx[w*16+g] >= 218) { + start += sce->ics.swb_sizes[g]; + if (sce->can_pns[w*16+g]) { + /** PNS isn't free */ + tbits += ff_pns_bits(sce, w, g); + } + continue; + } + cb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]); + for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { + int b; + float sqenergy; + dist += quantize_band_cost_cached(s, w + w2, g, coefs + w2*128, + scaled + w2*128, + sce->ics.swb_sizes[g], + sce->sf_idx[w*16+g], + cb, + 1.0f, + INFINITY, + &b, &sqenergy, + 0); + bits += b; + qenergy += sqenergy; + } + dists[w*16+g] = dist - bits; + qenergies[w*16+g] = qenergy; + if (prev != -1) { + int sfdiff = av_clip(sce->sf_idx[w*16+g] - prev + SCALE_DIFF_ZERO, 0, 2*SCALE_MAX_DIFF); + bits += ff_aac_scalefactor_bits[sfdiff]; + } + tbits += bits; + start += sce->ics.swb_sizes[g]; + prev = sce->sf_idx[w*16+g]; + } + } + } + if (!i && s->options.pns && its > maxits/2 && tbits > toofewbits) { + float maxoverdist = 0.0f; + float ovrfactor = 1.f+(maxits-its)*16.f/maxits; + overdist = recomprd = 0; + for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { + for (g = start = 0; g < sce->ics.num_swb; start += sce->ics.swb_sizes[g++]) { + if (!sce->zeroes[w*16+g] && sce->sf_idx[w*16+g] > SCALE_ONE_POS && dists[w*16+g] > uplims[w*16+g]*ovrfactor) { + float ovrdist = dists[w*16+g] / FFMAX(uplims[w*16+g],euplims[w*16+g]); + maxoverdist = FFMAX(maxoverdist, ovrdist); + overdist++; + } + } + } + if (overdist) { + /* We have overdistorted bands, trade for zeroes (that can be noise) + * Zero the bands in the lowest 1.25% spread-energy-threshold ranking + */ + float minspread = max_spread_thr_r; + float maxspread = min_spread_thr_r; + float zspread; + int zeroable = 0; + int zeroed = 0; + int maxzeroed, zloop; + for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { + for (g = start = 0; g < sce->ics.num_swb; start += sce->ics.swb_sizes[g++]) { + if (start >= pns_start_pos && !sce->zeroes[w*16+g] && sce->can_pns[w*16+g]) { + minspread = FFMIN(minspread, spread_thr_r[w*16+g]); + maxspread = FFMAX(maxspread, spread_thr_r[w*16+g]); + zeroable++; + } + } + } + zspread = (maxspread-minspread) * 0.0125f + minspread; + /* Don't PNS everything even if allowed. It suppresses bit starvation signals from RC, + * and forced the hand of the later search_for_pns step. + * Instead, PNS a fraction of the spread_thr_r range depending on how starved for bits we are, + * and leave further PNSing to search_for_pns if worthwhile. + */ + zspread = FFMIN3(min_spread_thr_r * 8.f, zspread, + ((toomanybits - tbits) * min_spread_thr_r + (tbits - toofewbits) * max_spread_thr_r) / (toomanybits - toofewbits + 1)); + maxzeroed = FFMIN(zeroable, FFMAX(1, (zeroable * its + maxits - 1) / (2 * maxits))); + for (zloop = 0; zloop < 2; zloop++) { + /* Two passes: first distorted stuff - two birds in one shot and all that, + * then anything viable. Viable means not zero, but either CB=zero-able + * (too high SF), not SF <= 1 (that means we'd be operating at very high + * quality, we don't want PNS when doing VHQ), PNS allowed, and within + * the lowest ranking percentile. + */ + float loopovrfactor = (zloop) ? 1.0f : ovrfactor; + int loopminsf = (zloop) ? (SCALE_ONE_POS - SCALE_DIV_512) : SCALE_ONE_POS; + int mcb; + for (g = sce->ics.num_swb-1; g > 0 && zeroed < maxzeroed; g--) { + if (sce->ics.swb_offset[g] < pns_start_pos) + continue; + for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { + if (!sce->zeroes[w*16+g] && sce->can_pns[w*16+g] && spread_thr_r[w*16+g] <= zspread + && sce->sf_idx[w*16+g] > loopminsf + && (dists[w*16+g] > loopovrfactor*uplims[w*16+g] || !(mcb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g])) + || (mcb <= 1 && dists[w*16+g] > FFMIN(uplims[w*16+g], euplims[w*16+g]))) ) { + sce->zeroes[w*16+g] = 1; + sce->band_type[w*16+g] = 0; + zeroed++; + } + } + } + } + if (zeroed) + recomprd = fflag = 1; + } else { + overdist = 0; + } + } + } + + minscaler = SCALE_MAX_POS; + for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { + for (g = 0; g < sce->ics.num_swb; g++) { + if (!sce->zeroes[w*16+g]) { + minscaler = FFMIN(minscaler, sce->sf_idx[w*16+g]); + } + } + } + + minscaler = nminscaler = av_clip(minscaler, SCALE_ONE_POS - SCALE_DIV_512, SCALE_MAX_POS - SCALE_DIV_512); + prev = -1; + for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { + /** Start with big steps, end up fine-tunning */ + int depth = (its > maxits/2) ? ((its > maxits*2/3) ? 1 : 3) : 10; + int edepth = depth+2; + float uplmax = its / (maxits*0.25f) + 1.0f; + uplmax *= (tbits > destbits) ? FFMIN(2.0f, tbits / (float)FFMAX(1,destbits)) : 1.0f; + start = w * 128; + for (g = 0; g < sce->ics.num_swb; g++) { + int prevsc = sce->sf_idx[w*16+g]; + if (prev < 0 && !sce->zeroes[w*16+g]) + prev = sce->sf_idx[0]; + if (!sce->zeroes[w*16+g]) { + const float *coefs = sce->coeffs + start; + const float *scaled = s->scoefs + start; + int cmb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]); + int mindeltasf = FFMAX(0, prev - SCALE_MAX_DIFF); + int maxdeltasf = FFMIN(SCALE_MAX_POS - SCALE_DIV_512, prev + SCALE_MAX_DIFF); + if ((!cmb || dists[w*16+g] > uplims[w*16+g]) && sce->sf_idx[w*16+g] > FFMAX(mindeltasf, minsf[w*16+g])) { + /* Try to make sure there is some energy in every nonzero band + * NOTE: This algorithm must be forcibly imbalanced, pushing harder + * on holes or more distorted bands at first, otherwise there's + * no net gain (since the next iteration will offset all bands + * on the opposite direction to compensate for extra bits) + */ + for (i = 0; i < edepth && sce->sf_idx[w*16+g] > mindeltasf; ++i) { + int cb, bits; + float dist, qenergy; + int mb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]-1); + cb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]); + dist = qenergy = 0.f; + bits = 0; + if (!cb) { + maxsf[w*16+g] = FFMIN(sce->sf_idx[w*16+g]-1, maxsf[w*16+g]); + } else if (i >= depth && dists[w*16+g] < euplims[w*16+g]) { + break; + } + /* !g is the DC band, it's important, since quantization error here + * applies to less than a cycle, it creates horrible intermodulation + * distortion if it doesn't stick to what psy requests + */ + if (!g && sce->ics.num_windows > 1 && dists[w*16+g] >= euplims[w*16+g]) + maxsf[w*16+g] = FFMIN(sce->sf_idx[w*16+g], maxsf[w*16+g]); + for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { + int b; + float sqenergy; + dist += quantize_band_cost_cached(s, w + w2, g, coefs + w2*128, + scaled + w2*128, + sce->ics.swb_sizes[g], + sce->sf_idx[w*16+g]-1, + cb, + 1.0f, + INFINITY, + &b, &sqenergy, + 0); + bits += b; + qenergy += sqenergy; + } + sce->sf_idx[w*16+g]--; + dists[w*16+g] = dist - bits; + qenergies[w*16+g] = qenergy; + if (mb && (sce->sf_idx[w*16+g] < mindeltasf || ( + (dists[w*16+g] < FFMIN(uplmax*uplims[w*16+g], euplims[w*16+g])) + && (fabsf(qenergies[w*16+g]-energies[w*16+g]) < euplims[w*16+g]) + ) )) { + break; + } + } + } else if (tbits > toofewbits && sce->sf_idx[w*16+g] < FFMIN(maxdeltasf, maxsf[w*16+g]) + && (dists[w*16+g] < FFMIN(euplims[w*16+g], uplims[w*16+g])) + && (fabsf(qenergies[w*16+g]-energies[w*16+g]) < euplims[w*16+g]) + ) { + /** Um... over target. Save bits for more important stuff. */ + for (i = 0; i < depth && sce->sf_idx[w*16+g] < maxdeltasf; ++i) { + int cb, bits; + float dist, qenergy; + cb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]+1); + if (cb > 0) { + dist = qenergy = 0.f; + bits = 0; + for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { + int b; + float sqenergy; + dist += quantize_band_cost_cached(s, w + w2, g, coefs + w2*128, + scaled + w2*128, + sce->ics.swb_sizes[g], + sce->sf_idx[w*16+g]+1, + cb, + 1.0f, + INFINITY, + &b, &sqenergy, + 0); + bits += b; + qenergy += sqenergy; + } + dist -= bits; + if (dist < FFMIN(euplims[w*16+g], uplims[w*16+g])) { + sce->sf_idx[w*16+g]++; + dists[w*16+g] = dist; + qenergies[w*16+g] = qenergy; + } else { + break; + } + } else { + maxsf[w*16+g] = FFMIN(sce->sf_idx[w*16+g], maxsf[w*16+g]); + break; + } + } + } + prev = sce->sf_idx[w*16+g] = av_clip(sce->sf_idx[w*16+g], mindeltasf, maxdeltasf); + if (sce->sf_idx[w*16+g] != prevsc) + fflag = 1; + nminscaler = FFMIN(nminscaler, sce->sf_idx[w*16+g]); + sce->band_type[w*16+g] = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]); + } + start += sce->ics.swb_sizes[g]; + } + } + + /** SF difference limit violation risk. Must re-clamp. */ + prev = -1; + for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { + for (g = 0; g < sce->ics.num_swb; g++) { + if (!sce->zeroes[w*16+g]) { + int prevsf = sce->sf_idx[w*16+g]; + if (prev < 0) + prev = prevsf; + sce->sf_idx[w*16+g] = av_clip(sce->sf_idx[w*16+g], prev - SCALE_MAX_DIFF, prev + SCALE_MAX_DIFF); + sce->band_type[w*16+g] = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]); + prev = sce->sf_idx[w*16+g]; + if (!fflag && prevsf != sce->sf_idx[w*16+g]) + fflag = 1; + } + } + } + + its++; + } while (fflag && its < maxits); + + /** Scout out next nonzero bands */ + ff_init_nextband_map(sce, nextband); + + prev = -1; + for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { + /** Make sure proper codebooks are set */ + for (g = 0; g < sce->ics.num_swb; g++) { + if (!sce->zeroes[w*16+g]) { + sce->band_type[w*16+g] = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]); + if (sce->band_type[w*16+g] <= 0) { + if (!ff_sfdelta_can_remove_band(sce, nextband, prev, w*16+g)) { + /** Cannot zero out, make sure it's not attempted */ + sce->band_type[w*16+g] = 1; + } else { + sce->zeroes[w*16+g] = 1; + sce->band_type[w*16+g] = 0; + } + } + } else { + sce->band_type[w*16+g] = 0; + } + /** Check that there's no SF delta range violations */ + if (!sce->zeroes[w*16+g]) { + if (prev != -1) { + av_unused int sfdiff = sce->sf_idx[w*16+g] - prev + SCALE_DIFF_ZERO; + av_assert1(sfdiff >= 0 && sfdiff <= 2*SCALE_MAX_DIFF); + } else if (sce->zeroes[0]) { + /** Set global gain to something useful */ + sce->sf_idx[0] = sce->sf_idx[w*16+g]; + } + prev = sce->sf_idx[w*16+g]; + } + } + } +} + +#endif /* AVCODEC_AACCODER_TWOLOOP_H */ diff --git a/include/libavcodec/aacenc.h b/include/libavcodec/aacenc.h new file mode 100644 index 0000000..ae15f91 --- /dev/null +++ b/include/libavcodec/aacenc.h @@ -0,0 +1,261 @@ +/* + * AAC encoder + * Copyright (C) 2008 Konstantin Shishkov + * + * 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_AACENC_H +#define AVCODEC_AACENC_H + +#include + +#include "libavutil/channel_layout.h" +#include "libavutil/float_dsp.h" +#include "libavutil/mem_internal.h" +#include "libavutil/tx.h" + +#include "avcodec.h" +#include "put_bits.h" + +#include "aac.h" +#include "aacencdsp.h" +#include "audio_frame_queue.h" +#include "psymodel.h" + +#include "lpc.h" + +#define CLIP_AVOIDANCE_FACTOR 0.95f + +typedef enum AACCoder { + AAC_CODER_ANMR = 0, + AAC_CODER_TWOLOOP, + AAC_CODER_FAST, + + AAC_CODER_NB, +}AACCoder; + +/** + * Predictor State + */ +typedef struct PredictorState { + float cor0; + float cor1; + float var0; + float var1; + float r0; + float r1; + float k1; + float x_est; +} PredictorState; + +typedef struct AACEncOptions { + int coder; + int pns; + int tns; + int ltp; + int pce; + int pred; + int mid_side; + int intensity_stereo; +} AACEncOptions; + +/** + * Long Term Prediction + */ +typedef struct LongTermPrediction { + int8_t present; + int16_t lag; + int coef_idx; + float coef; + int8_t used[MAX_LTP_LONG_SFB]; +} LongTermPrediction; + +/** + * Individual Channel Stream + */ +typedef struct IndividualChannelStream { + uint8_t max_sfb; ///< number of scalefactor bands per group + enum WindowSequence window_sequence[2]; + uint8_t use_kb_window[2]; ///< If set, use Kaiser-Bessel window, otherwise use a sine window. + uint8_t group_len[8]; + LongTermPrediction ltp; + const uint16_t *swb_offset; ///< table of offsets to the lowest spectral coefficient of a scalefactor band, sfb, for a particular window + const uint8_t *swb_sizes; ///< table of scalefactor band sizes for a particular window + int num_swb; ///< number of scalefactor window bands + int num_windows; + int tns_max_bands; + int predictor_present; + int predictor_initialized; + int predictor_reset_group; + int predictor_reset_count[31]; ///< used to count prediction resets + uint8_t prediction_used[41]; + uint8_t window_clipping[8]; ///< set if a certain window is near clipping + float clip_avoidance_factor; ///< set if any window is near clipping to the necessary atennuation factor to avoid it +} IndividualChannelStream; + +/** + * Temporal Noise Shaping + */ +typedef struct TemporalNoiseShaping { + int present; + int n_filt[8]; + int length[8][4]; + int direction[8][4]; + int order[8][4]; + int coef_idx[8][4][TNS_MAX_ORDER]; + float coef[8][4][TNS_MAX_ORDER]; +} TemporalNoiseShaping; + +/** + * Single Channel Element - used for both SCE and LFE elements. + */ +typedef struct SingleChannelElement { + IndividualChannelStream ics; + TemporalNoiseShaping tns; + Pulse pulse; + enum BandType band_type[128]; ///< band types + enum BandType band_alt[128]; ///< alternative band type + int sf_idx[128]; ///< scalefactor indices + uint8_t zeroes[128]; ///< band is not coded + uint8_t can_pns[128]; ///< band is allowed to PNS (informative) + float is_ener[128]; ///< Intensity stereo pos + float pns_ener[128]; ///< Noise energy values + DECLARE_ALIGNED(32, float, pcoeffs)[1024]; ///< coefficients for IMDCT, pristine + DECLARE_ALIGNED(32, float, coeffs)[1024]; ///< coefficients for IMDCT, maybe processed + DECLARE_ALIGNED(32, float, ret_buf)[2048]; ///< PCM output buffer + DECLARE_ALIGNED(16, float, ltp_state)[3072]; ///< time signal for LTP + DECLARE_ALIGNED(32, float, lcoeffs)[1024]; ///< MDCT of LTP coefficients + DECLARE_ALIGNED(32, float, prcoeffs)[1024]; ///< Main prediction coefs + PredictorState predictor_state[MAX_PREDICTORS]; +} SingleChannelElement; + +/** + * channel element - generic struct for SCE/CPE/CCE/LFE + */ +typedef struct ChannelElement { + // CPE specific + int common_window; ///< Set if channels share a common 'IndividualChannelStream' in bitstream. + int ms_mode; ///< Signals mid/side stereo flags coding mode + uint8_t is_mode; ///< Set if any bands have been encoded using intensity stereo + uint8_t ms_mask[128]; ///< Set if mid/side stereo is used for each scalefactor window band + uint8_t is_mask[128]; ///< Set if intensity stereo is used + // shared + SingleChannelElement ch[2]; +} ChannelElement; + +struct AACEncContext; + +typedef struct AACCoefficientsEncoder { + void (*search_for_quantizers)(AVCodecContext *avctx, struct AACEncContext *s, + SingleChannelElement *sce, const float lambda); + void (*encode_window_bands_info)(struct AACEncContext *s, SingleChannelElement *sce, + int win, int group_len, const float lambda); + void (*quantize_and_encode_band)(struct AACEncContext *s, PutBitContext *pb, const float *in, float *out, int size, + int scale_idx, int cb, const float lambda, int rtz); + void (*encode_tns_info)(struct AACEncContext *s, SingleChannelElement *sce); + void (*encode_ltp_info)(struct AACEncContext *s, SingleChannelElement *sce, int common_window); + void (*encode_main_pred)(struct AACEncContext *s, SingleChannelElement *sce); + void (*adjust_common_pred)(struct AACEncContext *s, ChannelElement *cpe); + void (*adjust_common_ltp)(struct AACEncContext *s, ChannelElement *cpe); + void (*apply_main_pred)(struct AACEncContext *s, SingleChannelElement *sce); + void (*apply_tns_filt)(struct AACEncContext *s, SingleChannelElement *sce); + void (*update_ltp)(struct AACEncContext *s, SingleChannelElement *sce); + void (*ltp_insert_new_frame)(struct AACEncContext *s); + void (*set_special_band_scalefactors)(struct AACEncContext *s, SingleChannelElement *sce); + void (*search_for_pns)(struct AACEncContext *s, AVCodecContext *avctx, SingleChannelElement *sce); + void (*mark_pns)(struct AACEncContext *s, AVCodecContext *avctx, SingleChannelElement *sce); + void (*search_for_tns)(struct AACEncContext *s, SingleChannelElement *sce); + void (*search_for_ltp)(struct AACEncContext *s, SingleChannelElement *sce, int common_window); + void (*search_for_ms)(struct AACEncContext *s, ChannelElement *cpe); + void (*search_for_is)(struct AACEncContext *s, AVCodecContext *avctx, ChannelElement *cpe); + void (*search_for_pred)(struct AACEncContext *s, SingleChannelElement *sce); +} AACCoefficientsEncoder; + +extern const AACCoefficientsEncoder ff_aac_coders[]; + +typedef struct AACQuantizeBandCostCacheEntry { + float rd; + float energy; + int bits; + char cb; + char rtz; + uint16_t generation; +} AACQuantizeBandCostCacheEntry; + +typedef struct AACPCEInfo { + AVChannelLayout layout; + int num_ele[4]; ///< front, side, back, lfe + int pairing[3][8]; ///< front, side, back + int index[4][8]; ///< front, side, back, lfe + uint8_t config_map[16]; ///< configs the encoder's channel specific settings + uint8_t reorder_map[16]; ///< maps channels from lavc to aac order +} AACPCEInfo; + +/** + * AAC encoder context + */ +typedef struct AACEncContext { + AVClass *av_class; + AACEncOptions options; ///< encoding options + PutBitContext pb; + AVTXContext *mdct1024; ///< long (1024 samples) frame transform context + av_tx_fn mdct1024_fn; + AVTXContext *mdct128; ///< short (128 samples) frame transform context + av_tx_fn mdct128_fn; + AVFloatDSPContext *fdsp; + AACPCEInfo pce; ///< PCE data, if needed + float *planar_samples[16]; ///< saved preprocessed input + + int profile; ///< copied from avctx + int needs_pce; ///< flag for non-standard layout + LPCContext lpc; ///< used by TNS + int samplerate_index; ///< MPEG-4 samplerate index + int channels; ///< channel count + const uint8_t *reorder_map; ///< lavc to aac reorder map + const uint8_t *chan_map; ///< channel configuration map + + ChannelElement *cpe; ///< channel elements + FFPsyContext psy; + struct FFPsyPreprocessContext* psypp; + const AACCoefficientsEncoder *coder; + int cur_channel; ///< current channel for coder context + int random_state; + float lambda; + int last_frame_pb_count; ///< number of bits for the previous frame + float lambda_sum; ///< sum(lambda), for Qvg reporting + int lambda_count; ///< count(lambda), for Qvg reporting + enum RawDataBlockType cur_type; ///< channel group type cur_channel belongs to + + AudioFrameQueue afq; + DECLARE_ALIGNED(32, int, qcoefs)[96]; ///< quantized coefficients + DECLARE_ALIGNED(32, float, scoefs)[1024]; ///< scaled coefficients + + uint16_t quantize_band_cost_cache_generation; + AACQuantizeBandCostCacheEntry quantize_band_cost_cache[256][128]; ///< memoization area for quantize_band_cost + + AACEncDSPContext aacdsp; + + struct { + float *samples; + } buffer; +} AACEncContext; + +void ff_quantize_band_cost_cache_init(struct AACEncContext *s); + + +#endif /* AVCODEC_AACENC_H */ diff --git a/include/libavcodec/aacenc_is.h b/include/libavcodec/aacenc_is.h new file mode 100644 index 0000000..269fd1a --- /dev/null +++ b/include/libavcodec/aacenc_is.h @@ -0,0 +1,51 @@ +/* + * AAC encoder intensity stereo + * Copyright (C) 2015 Rostislav Pehlivanov + * + * 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 + */ + +/** + * @file + * AAC encoder Intensity Stereo + * @author Rostislav Pehlivanov ( atomnuker gmail com ) + */ + +#ifndef AVCODEC_AACENC_IS_H +#define AVCODEC_AACENC_IS_H + +#include "aacenc.h" + +/** Frequency in Hz for lower limit of intensity stereo **/ +#define INT_STEREO_LOW_LIMIT 6100 + +struct AACISError { + int pass; /* 1 if dist2 <= dist1 */ + int phase; /* -1 or +1 */ + float error; /* fabs(dist1 - dist2) */ + float dist1; /* From original coeffs */ + float dist2; /* From IS'd coeffs */ + float ener01; +}; + +struct AACISError ff_aac_is_encoding_err(AACEncContext *s, ChannelElement *cpe, + int start, int w, int g, float ener0, + float ener1, float ener01, + int use_pcoeffs, int phase); +void ff_aac_search_for_is(AACEncContext *s, AVCodecContext *avctx, ChannelElement *cpe); + +#endif /* AVCODEC_AACENC_IS_H */ diff --git a/include/libavcodec/aacenc_ltp.h b/include/libavcodec/aacenc_ltp.h new file mode 100644 index 0000000..7276878 --- /dev/null +++ b/include/libavcodec/aacenc_ltp.h @@ -0,0 +1,41 @@ +/* + * AAC encoder long term prediction extension + * Copyright (C) 2015 Rostislav Pehlivanov + * + * 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 + */ + +/** + * @file + * AAC encoder long term prediction extension + * @author Rostislav Pehlivanov ( atomnuker gmail com ) + */ + +#ifndef AVCODEC_AACENC_LTP_H +#define AVCODEC_AACENC_LTP_H + +#include "aacenc.h" + +void ff_aac_encode_ltp_info(AACEncContext *s, SingleChannelElement *sce, + int common_window); +void ff_aac_update_ltp(AACEncContext *s, SingleChannelElement *sce); +void ff_aac_adjust_common_ltp(AACEncContext *s, ChannelElement *cpe); +void ff_aac_ltp_insert_new_frame(AACEncContext *s); +void ff_aac_search_for_ltp(AACEncContext *s, SingleChannelElement *sce, + int common_window); + +#endif /* AVCODEC_AACENC_LTP_H */ diff --git a/include/libavcodec/aacenc_pred.h b/include/libavcodec/aacenc_pred.h new file mode 100644 index 0000000..aa305f4 --- /dev/null +++ b/include/libavcodec/aacenc_pred.h @@ -0,0 +1,47 @@ +/* + * AAC encoder main-type prediction + * Copyright (C) 2015 Rostislav Pehlivanov + * + * 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 + */ + +/** + * @file + * AAC encoder main-type prediction + * @author Rostislav Pehlivanov ( atomnuker gmail com ) + */ + +#ifndef AVCODEC_AACENC_PRED_H +#define AVCODEC_AACENC_PRED_H + +#include "aacenc.h" + +/* Every predictor group needs to get reset at least once in this many frames */ +#define PRED_RESET_FRAME_MIN 240 + +/* Any frame with less than this amount of frames since last reset is ok */ +#define PRED_RESET_MIN 64 + +/* Raise to filter any low frequency artifacts due to prediction */ +#define PRED_SFB_START 10 + +void ff_aac_apply_main_pred(AACEncContext *s, SingleChannelElement *sce); +void ff_aac_adjust_common_pred(AACEncContext *s, ChannelElement *cpe); +void ff_aac_search_for_pred(AACEncContext *s, SingleChannelElement *sce); +void ff_aac_encode_main_pred(AACEncContext *s, SingleChannelElement *sce); + +#endif /* AVCODEC_AACENC_PRED_H */ diff --git a/include/libavcodec/aacenc_quantization.h b/include/libavcodec/aacenc_quantization.h new file mode 100644 index 0000000..185430b --- /dev/null +++ b/include/libavcodec/aacenc_quantization.h @@ -0,0 +1,68 @@ +/* + * AAC encoder quantizer + * Copyright (C) 2015 Rostislav Pehlivanov + * + * 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 + */ + +/** + * @file + * AAC encoder quantizer + * @author Rostislav Pehlivanov ( atomnuker gmail com ) + */ + +#ifndef AVCODEC_AACENC_QUANTIZATION_H +#define AVCODEC_AACENC_QUANTIZATION_H + +#include + +#include "aacenc.h" +#include "put_bits.h" + + +float ff_quantize_and_encode_band_cost(AACEncContext *s, PutBitContext *pb, + const float *in, float *quant, const float *scaled, + int size, int scale_idx, int cb, + const float lambda, const float uplim, + int *bits, float *energy); + +static inline float quantize_band_cost(struct AACEncContext *s, const float *in, + const float *scaled, int size, int scale_idx, + int cb, const float lambda, const float uplim, + int *bits, float *energy) +{ + return ff_quantize_and_encode_band_cost(s, NULL, in, NULL, scaled, size, scale_idx, + cb, lambda, uplim, bits, energy); +} + +static inline int quantize_band_cost_bits(struct AACEncContext *s, const float *in, + const float *scaled, int size, int scale_idx, + int cb, const float lambda, const float uplim, + int *bits, float *energy) +{ + int auxbits; + ff_quantize_and_encode_band_cost(s, NULL, in, NULL, scaled, size, scale_idx, + cb, 0.0f, uplim, &auxbits, energy); + if (bits) { + *bits = auxbits; + } + return auxbits; +} + +#include "aacenc_quantization_misc.h" + +#endif /* AVCODEC_AACENC_QUANTIZATION_H */ diff --git a/include/libavcodec/aacenc_quantization_misc.h b/include/libavcodec/aacenc_quantization_misc.h new file mode 100644 index 0000000..c789754 --- /dev/null +++ b/include/libavcodec/aacenc_quantization_misc.h @@ -0,0 +1,53 @@ +/* + * AAC encoder quantization + * Copyright (C) 2015 Claudio Freire + * + * 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 + */ + +/** + * @file + * AAC encoder quantization misc reusable function templates + * @author Claudio Freire ( klaussfreire gmail com ) + */ + +#ifndef AVCODEC_AACENC_QUANTIZATION_MISC_H +#define AVCODEC_AACENC_QUANTIZATION_MISC_H + +static inline float quantize_band_cost_cached(struct AACEncContext *s, int w, int g, const float *in, + const float *scaled, int size, int scale_idx, + int cb, const float lambda, const float uplim, + int *bits, float *energy, int rtz) +{ + AACQuantizeBandCostCacheEntry *entry; + av_assert1(scale_idx >= 0 && scale_idx < 256); + entry = &s->quantize_band_cost_cache[scale_idx][w*16+g]; + if (entry->generation != s->quantize_band_cost_cache_generation || entry->cb != cb || entry->rtz != rtz) { + entry->rd = quantize_band_cost(s, in, scaled, size, scale_idx, + cb, lambda, uplim, &entry->bits, &entry->energy); + entry->cb = cb; + entry->rtz = rtz; + entry->generation = s->quantize_band_cost_cache_generation; + } + if (bits) + *bits = entry->bits; + if (energy) + *energy = entry->energy; + return entry->rd; +} + +#endif /* AVCODEC_AACENC_QUANTIZATION_MISC_H */ diff --git a/include/libavcodec/aacenc_tns.h b/include/libavcodec/aacenc_tns.h new file mode 100644 index 0000000..466738d --- /dev/null +++ b/include/libavcodec/aacenc_tns.h @@ -0,0 +1,37 @@ +/* + * AAC encoder TNS + * Copyright (C) 2015 Rostislav Pehlivanov + * + * 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 + */ + +/** + * @file + * AAC encoder temporal noise shaping + * @author Rostislav Pehlivanov ( atomnuker gmail com ) + */ + +#ifndef AVCODEC_AACENC_TNS_H +#define AVCODEC_AACENC_TNS_H + +#include "aacenc.h" + +void ff_aac_encode_tns_info(AACEncContext *s, SingleChannelElement *sce); +void ff_aac_apply_tns(AACEncContext *s, SingleChannelElement *sce); +void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce); + +#endif /* AVCODEC_AACENC_TNS_H */ diff --git a/include/libavcodec/aacenc_utils.h b/include/libavcodec/aacenc_utils.h new file mode 100644 index 0000000..cc747c3 --- /dev/null +++ b/include/libavcodec/aacenc_utils.h @@ -0,0 +1,255 @@ +/* + * AAC encoder utilities + * Copyright (C) 2015 Rostislav Pehlivanov + * + * 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 + */ + +/** + * @file + * AAC encoder utilities + * @author Rostislav Pehlivanov ( atomnuker gmail com ) + */ + +#ifndef AVCODEC_AACENC_UTILS_H +#define AVCODEC_AACENC_UTILS_H + +#include "libavutil/ffmath.h" +#include "aacenc.h" +#include "aacenctab.h" +#include "aactab.h" + +#define ROUND_STANDARD 0.4054f +#define ROUND_TO_ZERO 0.1054f +#define C_QUANT 0.4054f + +static inline float pos_pow34(float a) +{ + return sqrtf(a * sqrtf(a)); +} + +/** + * Quantize one coefficient. + * @return absolute value of the quantized coefficient + * @see 3GPP TS26.403 5.6.2 "Scalefactor determination" + */ +static inline int quant(float coef, const float Q, const float rounding) +{ + float a = coef * Q; + return sqrtf(a * sqrtf(a)) + rounding; +} + +static inline float find_max_val(int group_len, int swb_size, const float *scaled) +{ + float maxval = 0.0f; + int w2, i; + for (w2 = 0; w2 < group_len; w2++) { + for (i = 0; i < swb_size; i++) { + maxval = FFMAX(maxval, scaled[w2*128+i]); + } + } + return maxval; +} + +static inline int find_min_book(float maxval, int sf) +{ + float Q34 = ff_aac_pow34sf_tab[POW_SF2_ZERO - sf + SCALE_ONE_POS - SCALE_DIV_512]; + int qmaxval, cb; + qmaxval = maxval * Q34 + C_QUANT; + if (qmaxval >= (FF_ARRAY_ELEMS(aac_maxval_cb))) + cb = 11; + else + cb = aac_maxval_cb[qmaxval]; + return cb; +} + +static inline float find_form_factor(int group_len, int swb_size, float thresh, + const float *scaled, float nzslope) { + const float iswb_size = 1.0f / swb_size; + const float iswb_sizem1 = 1.0f / (swb_size - 1); + const float ethresh = thresh; + float form = 0.0f, weight = 0.0f; + int w2, i; + for (w2 = 0; w2 < group_len; w2++) { + float e = 0.0f, e2 = 0.0f, var = 0.0f, maxval = 0.0f; + float nzl = 0; + for (i = 0; i < swb_size; i++) { + float s = fabsf(scaled[w2*128+i]); + maxval = FFMAX(maxval, s); + e += s; + e2 += s *= s; + /* We really don't want a hard non-zero-line count, since + * even below-threshold lines do add up towards band spectral power. + * So, fall steeply towards zero, but smoothly + */ + if (s >= ethresh) { + nzl += 1.0f; + } else { + if (nzslope == 2.f) + nzl += (s / ethresh) * (s / ethresh); + else + nzl += ff_fast_powf(s / ethresh, nzslope); + } + } + if (e2 > thresh) { + float frm; + e *= iswb_size; + + /** compute variance */ + for (i = 0; i < swb_size; i++) { + float d = fabsf(scaled[w2*128+i]) - e; + var += d*d; + } + var = sqrtf(var * iswb_sizem1); + + e2 *= iswb_size; + frm = e / FFMIN(e+4*var,maxval); + form += e2 * sqrtf(frm) / FFMAX(0.5f,nzl); + weight += e2; + } + } + if (weight > 0) { + return form / weight; + } else { + return 1.0f; + } +} + +/** Return the minimum scalefactor where the quantized coef does not clip. */ +static inline uint8_t coef2minsf(float coef) +{ + return av_clip_uint8(log2f(coef)*4 - 69 + SCALE_ONE_POS - SCALE_DIV_512); +} + +/** Return the maximum scalefactor where the quantized coef is not zero. */ +static inline uint8_t coef2maxsf(float coef) +{ + return av_clip_uint8(log2f(coef)*4 + 6 + SCALE_ONE_POS - SCALE_DIV_512); +} + +/* + * Returns the closest possible index to an array of float values, given a value. + */ +static inline int quant_array_idx(const float val, const float *arr, const int num) +{ + int i, index = 0; + float quant_min_err = INFINITY; + for (i = 0; i < num; i++) { + float error = (val - arr[i])*(val - arr[i]); + if (error < quant_min_err) { + quant_min_err = error; + index = i; + } + } + return index; +} + +/** + * approximates exp10f(-3.0f*(0.5f + 0.5f * cosf(FFMIN(b,15.5f) / 15.5f))) + */ +static av_always_inline float bval2bmax(float b) +{ + return 0.001f + 0.0035f * (b*b*b) / (15.5f*15.5f*15.5f); +} + +/* + * Compute a nextband map to be used with SF delta constraint utilities. + * The nextband array should contain 128 elements, and positions that don't + * map to valid, nonzero bands of the form w*16+g (with w being the initial + * window of the window group, only) are left indetermined. + */ +static inline void ff_init_nextband_map(const SingleChannelElement *sce, uint8_t *nextband) +{ + unsigned char prevband = 0; + int w, g; + /** Just a safe default */ + for (g = 0; g < 128; g++) + nextband[g] = g; + + /** Now really navigate the nonzero band chain */ + for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { + for (g = 0; g < sce->ics.num_swb; g++) { + if (!sce->zeroes[w*16+g] && sce->band_type[w*16+g] < RESERVED_BT) + prevband = nextband[prevband] = w*16+g; + } + } + nextband[prevband] = prevband; /* terminate */ +} + +/* + * Updates nextband to reflect a removed band (equivalent to + * calling ff_init_nextband_map after marking a band as zero) + */ +static inline void ff_nextband_remove(uint8_t *nextband, int prevband, int band) +{ + nextband[prevband] = nextband[band]; +} + +/* + * Checks whether the specified band could be removed without inducing + * scalefactor delta that violates SF delta encoding constraints. + * prev_sf has to be the scalefactor of the previous nonzero, nonspecial + * band, in encoding order, or negative if there was no such band. + */ +static inline int ff_sfdelta_can_remove_band(const SingleChannelElement *sce, + const uint8_t *nextband, int prev_sf, int band) +{ + return prev_sf >= 0 + && sce->sf_idx[nextband[band]] >= (prev_sf - SCALE_MAX_DIFF) + && sce->sf_idx[nextband[band]] <= (prev_sf + SCALE_MAX_DIFF); +} + +/* + * Checks whether the specified band's scalefactor could be replaced + * with another one without violating SF delta encoding constraints. + * prev_sf has to be the scalefactor of the previous nonzero, nonsepcial + * band, in encoding order, or negative if there was no such band. + */ +static inline int ff_sfdelta_can_replace(const SingleChannelElement *sce, + const uint8_t *nextband, int prev_sf, int new_sf, int band) +{ + return new_sf >= (prev_sf - SCALE_MAX_DIFF) + && new_sf <= (prev_sf + SCALE_MAX_DIFF) + && sce->sf_idx[nextband[band]] >= (new_sf - SCALE_MAX_DIFF) + && sce->sf_idx[nextband[band]] <= (new_sf + SCALE_MAX_DIFF); +} + +/** + * linear congruential pseudorandom number generator + * + * @param previous_val pointer to the current state of the generator + * + * @return Returns a 32-bit pseudorandom integer + */ +static av_always_inline int lcg_random(unsigned previous_val) +{ + union { unsigned u; int s; } v = { previous_val * 1664525u + 1013904223 }; + return v.s; +} + +#define ERROR_IF(cond, ...) \ + if (cond) { \ + av_log(avctx, AV_LOG_ERROR, __VA_ARGS__); \ + return AVERROR(EINVAL); \ + } + +#define WARN_IF(cond, ...) \ + if (cond) { \ + av_log(avctx, AV_LOG_WARNING, __VA_ARGS__); \ + } + +#endif /* AVCODEC_AACENC_UTILS_H */ diff --git a/include/libavcodec/aacencdsp.h b/include/libavcodec/aacencdsp.h new file mode 100644 index 0000000..67836d8 --- /dev/null +++ b/include/libavcodec/aacencdsp.h @@ -0,0 +1,72 @@ +/* + * 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_AACENCDSP_H +#define AVCODEC_AACENCDSP_H + +#include + +#include "config.h" + +#include "libavutil/macros.h" + +typedef struct AACEncDSPContext { + void (*abs_pow34)(float *out, const float *in, const int size); + void (*quant_bands)(int *out, const float *in, const float *scaled, + int size, int is_signed, int maxval, const float Q34, + const float rounding); +} AACEncDSPContext; + +void ff_aacenc_dsp_init_riscv(AACEncDSPContext *s); +void ff_aacenc_dsp_init_x86(AACEncDSPContext *s); + +static inline void abs_pow34_v(float *out, const float *in, const int size) +{ + for (int i = 0; i < size; i++) { + float a = fabsf(in[i]); + out[i] = sqrtf(a * sqrtf(a)); + } +} + +static inline void quantize_bands(int *out, const float *in, const float *scaled, + int size, int is_signed, int maxval, const float Q34, + const float rounding) +{ + for (int i = 0; i < size; i++) { + float qc = scaled[i] * Q34; + int tmp = (int)FFMIN(qc + rounding, (float)maxval); + if (is_signed && in[i] < 0.0f) { + tmp = -tmp; + } + out[i] = tmp; + } +} + +static inline void ff_aacenc_dsp_init(AACEncDSPContext *s) +{ + s->abs_pow34 = abs_pow34_v; + s->quant_bands = quantize_bands; + +#if ARCH_RISCV + ff_aacenc_dsp_init_riscv(s); +#elif ARCH_X86 + ff_aacenc_dsp_init_x86(s); +#endif +} + +#endif diff --git a/include/libavcodec/aacenctab.h b/include/libavcodec/aacenctab.h new file mode 100644 index 0000000..f2d6f59 --- /dev/null +++ b/include/libavcodec/aacenctab.h @@ -0,0 +1,134 @@ +/* + * AAC encoder data + * Copyright (c) 2015 Rostislav Pehlivanov ( atomnuker gmail com ) + * + * 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 + */ + +/** + * @file + * AAC encoder data + * @author Rostislav Pehlivanov ( atomnuker gmail com ) + */ + +#ifndef AVCODEC_AACENCTAB_H +#define AVCODEC_AACENCTAB_H + +#include "libavutil/channel_layout.h" +#include "aac.h" +#include "defs.h" + +/** Total number of usable codebooks **/ +#define CB_TOT 12 + +/** Total number of codebooks, including special ones **/ +#define CB_TOT_ALL 15 + +#define AAC_MAX_CHANNELS 16 + +extern const uint8_t *const ff_aac_swb_size_1024[]; +extern const int ff_aac_swb_size_1024_len; +extern const uint8_t *const ff_aac_swb_size_128[]; +extern const int ff_aac_swb_size_128_len; + +/* Supported layouts without using a PCE */ +static const AVChannelLayout aac_normal_chan_layouts[7] = { + AV_CHANNEL_LAYOUT_MONO, + AV_CHANNEL_LAYOUT_STEREO, + AV_CHANNEL_LAYOUT_SURROUND, + AV_CHANNEL_LAYOUT_4POINT0, + AV_CHANNEL_LAYOUT_5POINT0_BACK, + AV_CHANNEL_LAYOUT_5POINT1_BACK, + AV_CHANNEL_LAYOUT_7POINT1, +}; + +/** default channel configurations */ +static const uint8_t aac_chan_configs[AAC_MAX_CHANNELS][6] = { + {1, TYPE_SCE}, // 1 channel - single channel element + {1, TYPE_CPE}, // 2 channels - channel pair + {2, TYPE_SCE, TYPE_CPE}, // 3 channels - center + stereo + {3, TYPE_SCE, TYPE_CPE, TYPE_SCE}, // 4 channels - front center + stereo + back center + {3, TYPE_SCE, TYPE_CPE, TYPE_CPE}, // 5 channels - front center + stereo + back stereo + {4, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_LFE}, // 6 channels - front center + stereo + back stereo + LFE + {0}, // 7 channels - invalid without PCE + {5, TYPE_SCE, TYPE_CPE, TYPE_CPE, TYPE_CPE, TYPE_LFE}, // 8 channels - front center + front stereo + side stereo + back stereo + LFE +}; + +/** + * Table to remap channels from libavcodec's default order to AAC order. + */ +static const uint8_t aac_chan_maps[AAC_MAX_CHANNELS][AAC_MAX_CHANNELS] = { + { 0 }, + { 0, 1 }, + { 2, 0, 1 }, + { 2, 0, 1, 3 }, + { 2, 0, 1, 3, 4 }, + { 2, 0, 1, 4, 5, 3 }, + { 0 }, + { 2, 0, 1, 6, 7, 4, 5, 3 }, +}; + +/** bits needed to code codebook run value for long windows */ +static const uint8_t run_value_bits_long[64] = { + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 15 +}; + +/** bits needed to code codebook run value for short windows */ +static const uint8_t run_value_bits_short[16] = { + 3, 3, 3, 3, 3, 3, 3, 6, 6, 6, 6, 6, 6, 6, 6, 9 +}; + +/* TNS starting SFBs for long and short windows */ +static const uint8_t tns_min_sfb_short[16] = { + 2, 2, 2, 3, 3, 4, 6, 6, 8, 10, 10, 12, 12, 12, 12, 12 +}; + +static const uint8_t tns_min_sfb_long[16] = { + 12, 13, 15, 16, 17, 20, 25, 26, 24, 28, 30, 31, 31, 31, 31, 31 +}; + +static const uint8_t * const tns_min_sfb[2] = { + tns_min_sfb_long, tns_min_sfb_short +}; + +static const uint8_t * const run_value_bits[2] = { + run_value_bits_long, run_value_bits_short +}; + +/** Map to convert values from BandCodingPath index to a codebook index **/ +static const uint8_t aac_cb_out_map[CB_TOT_ALL] = {0,1,2,3,4,5,6,7,8,9,10,11,13,14,15}; +/** Inverse map to convert from codebooks to BandCodingPath indices **/ +static const uint8_t aac_cb_in_map[CB_TOT_ALL+1] = {0,1,2,3,4,5,6,7,8,9,10,11,0,12,13,14}; + +static const uint8_t aac_cb_range [12] = {0, 3, 3, 3, 3, 9, 9, 8, 8, 13, 13, 17}; +static const uint8_t aac_cb_maxval[12] = {0, 1, 1, 2, 2, 4, 4, 7, 7, 12, 12, 16}; + +static const unsigned char aac_maxval_cb[] = { + 0, 1, 3, 5, 5, 7, 7, 7, 9, 9, 9, 9, 9, 11 +}; + +static const int aacenc_profiles[] = { + AV_PROFILE_AAC_MAIN, + AV_PROFILE_AAC_LOW, + AV_PROFILE_AAC_LTP, + AV_PROFILE_MPEG2_AAC_LOW, +}; + +#endif /* AVCODEC_AACENCTAB_H */ diff --git a/include/libavcodec/aacps.h b/include/libavcodec/aacps.h new file mode 100644 index 0000000..08c92dc --- /dev/null +++ b/include/libavcodec/aacps.h @@ -0,0 +1,106 @@ +/* + * MPEG-4 Parametric Stereo definitions and declarations + * Copyright (c) 2010 Alex Converse + * + * 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_AACPS_H +#define AVCODEC_AACPS_H + +#include + +#include "libavutil/mem_internal.h" + +#include "aacpsdsp.h" +#include "get_bits.h" + +#define PS_MAX_NUM_ENV 5 +#define PS_MAX_NR_IIDICC 34 +#define PS_MAX_NR_IPDOPD 17 +#define PS_MAX_SSB 91 +#define PS_MAX_AP_BANDS 50 +#define PS_QMF_TIME_SLOTS 32 +#define PS_MAX_DELAY 14 +#define PS_AP_LINKS 3 +#define PS_MAX_AP_DELAY 5 +#define PS_BASELINE 0 ///< Operate in Baseline PS mode + ///< Baseline implies 10 or 20 stereo bands, + ///< mixing mode A, and no ipd/opd + +#define numQMFSlots 32 //numTimeSlots * RATE + +typedef struct PSCommonContext { + int start; + int enable_iid; + int iid_quant; + int nr_iid_par; + int nr_ipdopd_par; + int enable_icc; + int icc_mode; + int nr_icc_par; + int enable_ext; + int frame_class; + int num_env_old; + int num_env; + int enable_ipdopd; + int border_position[PS_MAX_NUM_ENV+1]; + int8_t iid_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; ///< Inter-channel Intensity Difference Parameters + int8_t icc_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; ///< Inter-Channel Coherence Parameters + /* ipd/opd is iid/icc sized so that the same functions can handle both */ + int8_t ipd_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; ///< Inter-channel Phase Difference Parameters + int8_t opd_par[PS_MAX_NUM_ENV][PS_MAX_NR_IIDICC]; ///< Overall Phase Difference Parameters + int is34bands; + int is34bands_old; +} PSCommonContext; + +typedef struct PSContext { + PSCommonContext common; + + DECLARE_ALIGNED(16, INTFLOAT, in_buf)[5][44][2]; + DECLARE_ALIGNED(16, INTFLOAT, delay)[PS_MAX_SSB][PS_QMF_TIME_SLOTS + PS_MAX_DELAY][2]; + DECLARE_ALIGNED(16, INTFLOAT, ap_delay)[PS_MAX_AP_BANDS][PS_AP_LINKS][PS_QMF_TIME_SLOTS + PS_MAX_AP_DELAY][2]; + DECLARE_ALIGNED(16, INTFLOAT, peak_decay_nrg)[34]; + DECLARE_ALIGNED(16, INTFLOAT, power_smooth)[34]; + DECLARE_ALIGNED(16, INTFLOAT, peak_decay_diff_smooth)[34]; + DECLARE_ALIGNED(16, INTFLOAT, H11)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC]; + DECLARE_ALIGNED(16, INTFLOAT, H12)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC]; + DECLARE_ALIGNED(16, INTFLOAT, H21)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC]; + DECLARE_ALIGNED(16, INTFLOAT, H22)[2][PS_MAX_NUM_ENV+1][PS_MAX_NR_IIDICC]; + DECLARE_ALIGNED(16, INTFLOAT, Lbuf)[91][32][2]; + DECLARE_ALIGNED(16, INTFLOAT, Rbuf)[91][32][2]; + int8_t opd_hist[PS_MAX_NR_IIDICC]; + int8_t ipd_hist[PS_MAX_NR_IIDICC]; + PSDSPContext dsp; +} PSContext; + +extern const int8_t ff_k_to_i_20[]; +extern const int8_t ff_k_to_i_34[]; + +void ff_ps_init_common(void); +void AAC_RENAME(ff_ps_init)(void); + +static inline void AAC_RENAME(ff_ps_ctx_init)(PSContext *ps) +{ + AAC_RENAME(ff_psdsp_init)(&ps->dsp); +} + +int ff_ps_read_data(void *logctx, GetBitContext *gb, + PSCommonContext *ps, int bits_left); +int AAC_RENAME(ff_ps_apply)(PSContext *ps, INTFLOAT L[2][38][64], INTFLOAT R[2][38][64], int top); + +#endif /* AVCODEC_AACPS_H */ diff --git a/include/libavcodec/aacps_fixed_tablegen.h b/include/libavcodec/aacps_fixed_tablegen.h new file mode 100644 index 0000000..8fb1da5 --- /dev/null +++ b/include/libavcodec/aacps_fixed_tablegen.h @@ -0,0 +1,408 @@ +/* + * Header file for hardcoded Parametric Stereo tables + * + * Copyright (c) 2010 Alex Converse + * + * 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 + * + * Note: Rounding-to-nearest used unless otherwise stated + * + */ + +#ifndef AVCODEC_AACPS_FIXED_TABLEGEN_H +#define AVCODEC_AACPS_FIXED_TABLEGEN_H + +#include +#include + +#if CONFIG_HARDCODED_TABLES +#define ps_tableinit() +#define TABLE_CONST const +#include "libavcodec/aacps_fixed_tables.h" +#else +#include "libavutil/common.h" +#include "libavutil/mathematics.h" +#ifdef BUILD_TABLES +#undef DECLARE_ALIGNED +#define DECLARE_ALIGNED(align, type, variable) type variable +#else +#include "libavutil/mem_internal.h" +#endif + +#include "aac_defines.h" +#include "libavutil/softfloat.h" +#define NR_ALLPASS_BANDS20 30 +#define NR_ALLPASS_BANDS34 50 +#define PS_AP_LINKS 3 +#define TABLE_CONST +static int pd_re_smooth[8*8*8]; +static int pd_im_smooth[8*8*8]; +static int HA[46][8][4]; +static int HB[46][8][4]; +static DECLARE_ALIGNED(16, int, f20_0_8) [ 8][8][2]; +static DECLARE_ALIGNED(16, int, f34_0_12)[12][8][2]; +static DECLARE_ALIGNED(16, int, f34_1_8) [ 8][8][2]; +static DECLARE_ALIGNED(16, int, f34_2_4) [ 4][8][2]; +static TABLE_CONST DECLARE_ALIGNED(16, int, Q_fract_allpass)[2][50][3][2]; +static DECLARE_ALIGNED(16, int, phi_fract)[2][50][2]; + +static const int g0_Q8[] = { + Q31(0.00746082949812f), Q31(0.02270420949825f), Q31(0.04546865930473f), Q31(0.07266113929591f), + Q31(0.09885108575264f), Q31(0.11793710567217f), Q31(0.125f) +}; + +static const int g0_Q12[] = { + Q31(0.04081179924692f), Q31(0.03812810994926f), Q31(0.05144908135699f), Q31(0.06399831151592f), + Q31(0.07428313801106f), Q31(0.08100347892914f), Q31(0.08333333333333f) +}; + +static const int g1_Q8[] = { + Q31(0.01565675600122f), Q31(0.03752716391991f), Q31(0.05417891378782f), Q31(0.08417044116767f), + Q31(0.10307344158036f), Q31(0.12222452249753f), Q31(0.125f) +}; + +static const int g2_Q4[] = { + Q31(-0.05908211155639f), Q31(-0.04871498374946f), Q31(0.0f), Q31(0.07778723915851f), + Q31( 0.16486303567403f), Q31( 0.23279856662996f), Q31(0.25f) +}; + +static const int sintbl_4[4] = { 0, 1073741824, 0, -1073741824 }; +static const int costbl_4[4] = { 1073741824, 0, -1073741824, 0 }; +static const int sintbl_8[8] = { 0, 759250125, 1073741824, 759250125, + 0, -759250125, -1073741824, -759250125 }; +static const int costbl_8[8] = { 1073741824, 759250125, 0, -759250125, + -1073741824, -759250125, 0, 759250125 }; +static const int sintbl_12[12] = { 0, 536870912, 929887697, 1073741824, + 929887697, 536870912, 0, -536870912, + -929887697, -1073741824, -929887697, -536870912 }; +static const int costbl_12[12] = { 1073741824, 929887697, 536870912, 0, + -536870912, -929887697, -1073741824, -929887697, + -536870912, 0, 536870912, 929887697 }; + +static void make_filters_from_proto(int (*filter)[8][2], const int *proto, int bands) +{ + + const int *sinptr, *cosptr; + int s, c, sinhalf, coshalf; + int q, n; + + if (bands == 4) { + sinptr = sintbl_4; + cosptr = costbl_4; + sinhalf = 759250125; + coshalf = 759250125; + } else if (bands == 8) { + sinptr = sintbl_8; + cosptr = costbl_8; + sinhalf = 410903207; + coshalf = 992008094; + } else { + sinptr = sintbl_12; + cosptr = costbl_12; + sinhalf = 277904834; + coshalf = 1037154959; + } + + for (q = 0; q < bands; q++) { + for (n = 0; n < 7; n++) { + int theta = (q*(n-6) + (n>>1) - 3) % bands; + + if (theta < 0) + theta += bands; + s = sinptr[theta]; + c = cosptr[theta]; + + if (n & 1) { + theta = (int)(((int64_t)c * coshalf - (int64_t)s * sinhalf + 0x20000000) >> 30); + s = (int)(((int64_t)s * coshalf + (int64_t)c * sinhalf + 0x20000000) >> 30); + c = theta; + } + filter[q][n][0] = (int)(((int64_t)proto[n] * c + 0x20000000) >> 30); + filter[q][n][1] = -(int)(((int64_t)proto[n] * s + 0x20000000) >> 30); + } + } +} + +static void ps_tableinit(void) +{ + static const int ipdopd_sin[] = { Q30(0), Q30(M_SQRT1_2), Q30(1), Q30( M_SQRT1_2), Q30( 0), Q30(-M_SQRT1_2), Q30(-1), Q30(-M_SQRT1_2) }; + static const int ipdopd_cos[] = { Q30(1), Q30(M_SQRT1_2), Q30(0), Q30(-M_SQRT1_2), Q30(-1), Q30(-M_SQRT1_2), Q30( 0), Q30( M_SQRT1_2) }; + int pd0, pd1, pd2; + int idx; + + static const int alpha_tab[] = + { + Q30(1.5146213770f/M_PI), Q30(1.5181334019f/M_PI), Q30(1.5234849453f/M_PI), Q30(1.5369486809f/M_PI), Q30(1.5500687361f/M_PI), Q30(1.5679757595f/M_PI), + Q30(1.4455626011f/M_PI), Q30(1.4531552792f/M_PI), Q30(1.4648091793f/M_PI), Q30(1.4945238829f/M_PI), Q30(1.5239057541f/M_PI), Q30(1.5644006729f/M_PI), + Q30(1.3738563061f/M_PI), Q30(1.3851221800f/M_PI), Q30(1.4026404619f/M_PI), Q30(1.4484288692f/M_PI), Q30(1.4949874878f/M_PI), Q30(1.5604078770f/M_PI), + Q30(1.2645189762f/M_PI), Q30(1.2796478271f/M_PI), Q30(1.3038636446f/M_PI), Q30(1.3710125685f/M_PI), Q30(1.4443849325f/M_PI), Q30(1.5532352924f/M_PI), + Q30(1.1507037878f/M_PI), Q30(1.1669205427f/M_PI), Q30(1.1938756704f/M_PI), Q30(1.2754167318f/M_PI), Q30(1.3761177063f/M_PI), Q30(1.5429240465f/M_PI), + Q30(1.0079245567f/M_PI), Q30(1.0208238363f/M_PI), Q30(1.0433073044f/M_PI), Q30(1.1208510399f/M_PI), Q30(1.2424604893f/M_PI), Q30(1.5185726881f/M_PI), + Q30(0.8995233774f/M_PI), Q30(0.9069069624f/M_PI), Q30(0.9201194048f/M_PI), Q30(0.9698365927f/M_PI), Q30(1.0671583414f/M_PI), Q30(1.4647934437f/M_PI), + Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), + Q30(0.6712729335f/M_PI), Q30(0.6638893485f/M_PI), Q30(0.6506769061f/M_PI), Q30(0.6009597182f/M_PI), Q30(0.5036380291f/M_PI), Q30(0.1060028747f/M_PI), + Q30(0.5628717542f/M_PI), Q30(0.5499725342f/M_PI), Q30(0.5274890065f/M_PI), Q30(0.4499453008f/M_PI), Q30(0.3283358216f/M_PI), Q30(0.0522236861f/M_PI), + Q30(0.4200925827f/M_PI), Q30(0.4038758278f/M_PI), Q30(0.3769206405f/M_PI), Q30(0.2953795493f/M_PI), Q30(0.1946786791f/M_PI), Q30(0.0278722942f/M_PI), + Q30(0.3062773645f/M_PI), Q30(0.2911485136f/M_PI), Q30(0.2669326365f/M_PI), Q30(0.1997837722f/M_PI), Q30(0.1264114529f/M_PI), Q30(0.0175609849f/M_PI), + Q30(0.1969399750f/M_PI), Q30(0.1856741160f/M_PI), Q30(0.1681558639f/M_PI), Q30(0.1223674342f/M_PI), Q30(0.0758088827f/M_PI), Q30(0.0103884479f/M_PI), + Q30(0.1252337098f/M_PI), Q30(0.1176410317f/M_PI), Q30(0.1059871912f/M_PI), Q30(0.0762724727f/M_PI), Q30(0.0468905345f/M_PI), Q30(0.0063956482f/M_PI), + Q30(0.0561749674f/M_PI), Q30(0.0526629239f/M_PI), Q30(0.0473113805f/M_PI), Q30(0.0338476151f/M_PI), Q30(0.0207276177f/M_PI), Q30(0.0028205961f/M_PI), + Q30(1.5676341057f/M_PI), Q30(1.5678333044f/M_PI), Q30(1.5681363344f/M_PI), Q30(1.5688960552f/M_PI), Q30(1.5696337223f/M_PI), Q30(1.5706381798f/M_PI), + Q30(1.5651730299f/M_PI), Q30(1.5655272007f/M_PI), Q30(1.5660660267f/M_PI), Q30(1.5674170256f/M_PI), Q30(1.5687289238f/M_PI), Q30(1.5705151558f/M_PI), + Q30(1.5607966185f/M_PI), Q30(1.5614265203f/M_PI), Q30(1.5623844862f/M_PI), Q30(1.5647867918f/M_PI), Q30(1.5671195984f/M_PI), Q30(1.5702962875f/M_PI), + Q30(1.5530153513f/M_PI), Q30(1.5541347265f/M_PI), Q30(1.5558375120f/M_PI), Q30(1.5601085424f/M_PI), Q30(1.5642569065f/M_PI), Q30(1.5699069500f/M_PI), + Q30(1.5391840935f/M_PI), Q30(1.5411708355f/M_PI), Q30(1.5441943407f/M_PI), Q30(1.5517836809f/M_PI), Q30(1.5591609478f/M_PI), Q30(1.5692136288f/M_PI), + Q30(1.5146213770f/M_PI), Q30(1.5181334019f/M_PI), Q30(1.5234849453f/M_PI), Q30(1.5369486809f/M_PI), Q30(1.5500687361f/M_PI), Q30(1.5679757595f/M_PI), + Q30(1.4915299416f/M_PI), Q30(1.4964480400f/M_PI), Q30(1.5039558411f/M_PI), Q30(1.5229074955f/M_PI), Q30(1.5414420366f/M_PI), Q30(1.5667995214f/M_PI), + Q30(1.4590617418f/M_PI), Q30(1.4658898115f/M_PI), Q30(1.4763505459f/M_PI), Q30(1.5029321909f/M_PI), Q30(1.5291173458f/M_PI), Q30(1.5651149750f/M_PI), + Q30(1.4136143923f/M_PI), Q30(1.4229322672f/M_PI), Q30(1.4373078346f/M_PI), Q30(1.4743183851f/M_PI), Q30(1.5113102198f/M_PI), Q30(1.5626684427f/M_PI), + Q30(1.3505556583f/M_PI), Q30(1.3628427982f/M_PI), Q30(1.3820509911f/M_PI), Q30(1.4327841997f/M_PI), Q30(1.4850014448f/M_PI), Q30(1.5590143204f/M_PI), + Q30(1.2645189762f/M_PI), Q30(1.2796478271f/M_PI), Q30(1.3038636446f/M_PI), Q30(1.3710125685f/M_PI), Q30(1.4443849325f/M_PI), Q30(1.5532352924f/M_PI), + Q30(1.1919227839f/M_PI), Q30(1.2081253529f/M_PI), Q30(1.2346779108f/M_PI), Q30(1.3123005629f/M_PI), Q30(1.4034168720f/M_PI), Q30(1.5471596718f/M_PI), + Q30(1.1061993837f/M_PI), Q30(1.1219338179f/M_PI), Q30(1.1484941244f/M_PI), Q30(1.2320860624f/M_PI), Q30(1.3421301842f/M_PI), Q30(1.5373806953f/M_PI), + Q30(1.0079245567f/M_PI), Q30(1.0208238363f/M_PI), Q30(1.0433073044f/M_PI), Q30(1.1208510399f/M_PI), Q30(1.2424604893f/M_PI), Q30(1.5185726881f/M_PI), + Q30(0.8995233774f/M_PI), Q30(0.9069069624f/M_PI), Q30(0.9201194048f/M_PI), Q30(0.9698365927f/M_PI), Q30(1.0671583414f/M_PI), Q30(1.4647934437f/M_PI), + Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), Q30(0.7853981853f/M_PI), + Q30(0.6712729335f/M_PI), Q30(0.6638893485f/M_PI), Q30(0.6506769061f/M_PI), Q30(0.6009597182f/M_PI), Q30(0.5036380291f/M_PI), Q30(0.1060028747f/M_PI), + Q30(0.5628717542f/M_PI), Q30(0.5499725342f/M_PI), Q30(0.5274890065f/M_PI), Q30(0.4499453008f/M_PI), Q30(0.3283358216f/M_PI), Q30(0.0522236861f/M_PI), + Q30(0.4645969570f/M_PI), Q30(0.4488625824f/M_PI), Q30(0.4223022461f/M_PI), Q30(0.3387103081f/M_PI), Q30(0.2286661267f/M_PI), Q30(0.0334156826f/M_PI), + Q30(0.3788735867f/M_PI), Q30(0.3626709878f/M_PI), Q30(0.3361184299f/M_PI), Q30(0.2584958076f/M_PI), Q30(0.1673794836f/M_PI), Q30(0.0236366931f/M_PI), + Q30(0.3062773645f/M_PI), Q30(0.2911485136f/M_PI), Q30(0.2669326365f/M_PI), Q30(0.1997837722f/M_PI), Q30(0.1264114529f/M_PI), Q30(0.0175609849f/M_PI), + Q30(0.2202406377f/M_PI), Q30(0.2079535723f/M_PI), Q30(0.1887452900f/M_PI), Q30(0.1380121708f/M_PI), Q30(0.0857949182f/M_PI), Q30(0.0117820343f/M_PI), + Q30(0.1571819335f/M_PI), Q30(0.1478640437f/M_PI), Q30(0.1334884763f/M_PI), Q30(0.0964778885f/M_PI), Q30(0.0594860613f/M_PI), Q30(0.0081279324f/M_PI), + Q30(0.1117345318f/M_PI), Q30(0.1049065739f/M_PI), Q30(0.0944457650f/M_PI), Q30(0.0678641573f/M_PI), Q30(0.0416790098f/M_PI), Q30(0.0056813755f/M_PI), + Q30(0.0792663917f/M_PI), Q30(0.0743482932f/M_PI), Q30(0.0668405443f/M_PI), Q30(0.0478888862f/M_PI), Q30(0.0293543357f/M_PI), Q30(0.0039967746f/M_PI), + Q30(0.0561749674f/M_PI), Q30(0.0526629239f/M_PI), Q30(0.0473113805f/M_PI), Q30(0.0338476151f/M_PI), Q30(0.0207276177f/M_PI), Q30(0.0028205961f/M_PI), + Q30(0.0316122435f/M_PI), Q30(0.0296254847f/M_PI), Q30(0.0266019460f/M_PI), Q30(0.0190126132f/M_PI), Q30(0.0116353342f/M_PI), Q30(0.0015827164f/M_PI), + Q30(0.0177809205f/M_PI), Q30(0.0166615788f/M_PI), Q30(0.0149587989f/M_PI), Q30(0.0106877899f/M_PI), Q30(0.0065393616f/M_PI), Q30(0.0008894200f/M_PI), + Q30(0.0099996664f/M_PI), Q30(0.0093698399f/M_PI), Q30(0.0084118480f/M_PI), Q30(0.0060095116f/M_PI), Q30(0.0036767013f/M_PI), Q30(0.0005000498f/M_PI), + Q30(0.0056233541f/M_PI), Q30(0.0052691097f/M_PI), Q30(0.0047303112f/M_PI), Q30(0.0033792770f/M_PI), Q30(0.0020674451f/M_PI), Q30(0.0002811795f/M_PI), + Q30(0.0031622672f/M_PI), Q30(0.0029630491f/M_PI), Q30(0.0026600463f/M_PI), Q30(0.0019002859f/M_PI), Q30(0.0011625893f/M_PI), Q30(0.0001581155f/M_PI) + }; + + static const int gamma_tab[] = + { + Q30(0.0000000000f/M_PI), Q30(0.0195873566f/M_PI), Q30(0.0303316917f/M_PI), Q30(0.0448668823f/M_PI), Q30(0.0522258915f/M_PI), Q30(0.0561044961f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0433459543f/M_PI), Q30(0.0672172382f/M_PI), Q30(0.0997167900f/M_PI), Q30(0.1162951663f/M_PI), Q30(0.1250736862f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0672341362f/M_PI), Q30(0.1045235619f/M_PI), Q30(0.1558904350f/M_PI), Q30(0.1824723780f/M_PI), Q30(0.1966800541f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.1011129096f/M_PI), Q30(0.1580764502f/M_PI), Q30(0.2387557179f/M_PI), Q30(0.2820728719f/M_PI), Q30(0.3058380187f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.1315985769f/M_PI), Q30(0.2072522491f/M_PI), Q30(0.3188187480f/M_PI), Q30(0.3825501204f/M_PI), Q30(0.4193951190f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.1603866369f/M_PI), Q30(0.2549437582f/M_PI), Q30(0.4029446840f/M_PI), Q30(0.4980689585f/M_PI), Q30(0.5615641475f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.1736015975f/M_PI), Q30(0.2773745656f/M_PI), Q30(0.4461984038f/M_PI), Q30(0.5666890144f/M_PI), Q30(0.6686112881f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.1784276664f/M_PI), Q30(0.2856673002f/M_PI), Q30(0.4630723596f/M_PI), Q30(0.5971632004f/M_PI), Q30(0.7603877187f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.1736015975f/M_PI), Q30(0.2773745656f/M_PI), Q30(0.4461984038f/M_PI), Q30(0.5666890144f/M_PI), Q30(0.6686112881f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.1603866369f/M_PI), Q30(0.2549437582f/M_PI), Q30(0.4029446840f/M_PI), Q30(0.4980689585f/M_PI), Q30(0.5615641475f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.1315985769f/M_PI), Q30(0.2072522491f/M_PI), Q30(0.3188187480f/M_PI), Q30(0.3825501204f/M_PI), Q30(0.4193951190f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.1011129096f/M_PI), Q30(0.1580764502f/M_PI), Q30(0.2387557179f/M_PI), Q30(0.2820728719f/M_PI), Q30(0.3058380187f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0672341362f/M_PI), Q30(0.1045235619f/M_PI), Q30(0.1558904350f/M_PI), Q30(0.1824723780f/M_PI), Q30(0.1966800541f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0433459543f/M_PI), Q30(0.0672172382f/M_PI), Q30(0.0997167900f/M_PI), Q30(0.1162951663f/M_PI), Q30(0.1250736862f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0195873566f/M_PI), Q30(0.0303316917f/M_PI), Q30(0.0448668823f/M_PI), Q30(0.0522258915f/M_PI), Q30(0.0561044961f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0011053939f/M_PI), Q30(0.0017089852f/M_PI), Q30(0.0025254129f/M_PI), Q30(0.0029398468f/M_PI), Q30(0.0031597170f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0019607407f/M_PI), Q30(0.0030395309f/M_PI), Q30(0.0044951206f/M_PI), Q30(0.0052305623f/M_PI), Q30(0.0056152637f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0034913034f/M_PI), Q30(0.0054070661f/M_PI), Q30(0.0079917293f/M_PI), Q30(0.0092999367f/M_PI), Q30(0.0099875759f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0062100487f/M_PI), Q30(0.0096135242f/M_PI), Q30(0.0142110568f/M_PI), Q30(0.0165348612f/M_PI), Q30(0.0177587029f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0110366223f/M_PI), Q30(0.0170863140f/M_PI), Q30(0.0252620988f/M_PI), Q30(0.0293955617f/M_PI), Q30(0.0315726399f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0195873566f/M_PI), Q30(0.0303316917f/M_PI), Q30(0.0448668823f/M_PI), Q30(0.0522258915f/M_PI), Q30(0.0561044961f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0275881495f/M_PI), Q30(0.0427365713f/M_PI), Q30(0.0632618815f/M_PI), Q30(0.0736731067f/M_PI), Q30(0.0791663304f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0387469754f/M_PI), Q30(0.0600636788f/M_PI), Q30(0.0890387669f/M_PI), Q30(0.1037906483f/M_PI), Q30(0.1115923747f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0541138873f/M_PI), Q30(0.0839984417f/M_PI), Q30(0.1248718798f/M_PI), Q30(0.1458375156f/M_PI), Q30(0.1569785923f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0747506917f/M_PI), Q30(0.1163287833f/M_PI), Q30(0.1738867164f/M_PI), Q30(0.2038587779f/M_PI), Q30(0.2199459076f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.1011129096f/M_PI), Q30(0.1580764502f/M_PI), Q30(0.2387557179f/M_PI), Q30(0.2820728719f/M_PI), Q30(0.3058380187f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.1212290376f/M_PI), Q30(0.1903949380f/M_PI), Q30(0.2907958031f/M_PI), Q30(0.3466993868f/M_PI), Q30(0.3782821596f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.1418247074f/M_PI), Q30(0.2240308374f/M_PI), Q30(0.3474813402f/M_PI), Q30(0.4202919006f/M_PI), Q30(0.4637607038f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.1603866369f/M_PI), Q30(0.2549437582f/M_PI), Q30(0.4029446840f/M_PI), Q30(0.4980689585f/M_PI), Q30(0.5615641475f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.1736015975f/M_PI), Q30(0.2773745656f/M_PI), Q30(0.4461984038f/M_PI), Q30(0.5666890144f/M_PI), Q30(0.6686112881f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.1784276664f/M_PI), Q30(0.2856673002f/M_PI), Q30(0.4630723596f/M_PI), Q30(0.5971632004f/M_PI), Q30(0.7603877187f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.1736015975f/M_PI), Q30(0.2773745656f/M_PI), Q30(0.4461984038f/M_PI), Q30(0.5666890144f/M_PI), Q30(0.6686112881f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.1603866369f/M_PI), Q30(0.2549437582f/M_PI), Q30(0.4029446840f/M_PI), Q30(0.4980689585f/M_PI), Q30(0.5615641475f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.1418247074f/M_PI), Q30(0.2240308374f/M_PI), Q30(0.3474813402f/M_PI), Q30(0.4202919006f/M_PI), Q30(0.4637607038f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.1212290376f/M_PI), Q30(0.1903949380f/M_PI), Q30(0.2907958031f/M_PI), Q30(0.3466993868f/M_PI), Q30(0.3782821596f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.1011129096f/M_PI), Q30(0.1580764502f/M_PI), Q30(0.2387557179f/M_PI), Q30(0.2820728719f/M_PI), Q30(0.3058380187f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0747506917f/M_PI), Q30(0.1163287833f/M_PI), Q30(0.1738867164f/M_PI), Q30(0.2038587779f/M_PI), Q30(0.2199459076f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0541138873f/M_PI), Q30(0.0839984417f/M_PI), Q30(0.1248718798f/M_PI), Q30(0.1458375156f/M_PI), Q30(0.1569785923f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0387469754f/M_PI), Q30(0.0600636788f/M_PI), Q30(0.0890387669f/M_PI), Q30(0.1037906483f/M_PI), Q30(0.1115923747f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0275881495f/M_PI), Q30(0.0427365713f/M_PI), Q30(0.0632618815f/M_PI), Q30(0.0736731067f/M_PI), Q30(0.0791663304f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0195873566f/M_PI), Q30(0.0303316917f/M_PI), Q30(0.0448668823f/M_PI), Q30(0.0522258915f/M_PI), Q30(0.0561044961f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0110366223f/M_PI), Q30(0.0170863140f/M_PI), Q30(0.0252620988f/M_PI), Q30(0.0293955617f/M_PI), Q30(0.0315726399f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0062100487f/M_PI), Q30(0.0096135242f/M_PI), Q30(0.0142110568f/M_PI), Q30(0.0165348612f/M_PI), Q30(0.0177587029f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0034913034f/M_PI), Q30(0.0054070661f/M_PI), Q30(0.0079917293f/M_PI), Q30(0.0092999367f/M_PI), Q30(0.0099875759f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0019607407f/M_PI), Q30(0.0030395309f/M_PI), Q30(0.0044951206f/M_PI), Q30(0.0052305623f/M_PI), Q30(0.0056152637f/M_PI), + Q30(0.0000000000f/M_PI), Q30(0.0011053939f/M_PI), Q30(0.0017089852f/M_PI), Q30(0.0025254129f/M_PI), Q30(0.0029398468f/M_PI), Q30(0.0031597170f/M_PI) + }; + + static const int iid_par_dequant_c1[] = { + //iid_par_dequant_default + Q30(1.41198278375959f), Q30(1.40313815268360f), Q30(1.38687670404960f), Q30(1.34839972492648f), + Q30(1.29124937110028f), Q30(1.19603741667993f), Q30(1.10737240362323f), Q30(1), + Q30(0.87961716655242f), Q30(0.75464859232732f), Q30(0.57677990744575f), Q30(0.42640143271122f), + Q30(0.27671828230984f), Q30(0.17664462766713f), Q30(0.07940162697653f), + //iid_par_dequant_fine + Q30(1.41420649135832f), Q30(1.41419120222364f), Q30(1.41414285699784f), Q30(1.41399000859438f), + Q30(1.41350698548044f), Q30(1.41198278375959f), Q30(1.40977302262355f), Q30(1.40539479488545f), + Q30(1.39677960498402f), Q30(1.38005309967827f), Q30(1.34839972492648f), Q30(1.31392017367631f), + Q30(1.26431008149654f), Q30(1.19603741667993f), Q30(1.10737240362323f), Q30(1), + Q30(0.87961716655242f), Q30(0.75464859232732f), Q30(0.63365607219232f), Q30(0.52308104267543f), + Q30(0.42640143271122f), Q30(0.30895540465965f), Q30(0.22137464873077f), Q30(0.15768788954414f), + Q30(0.11198225164225f), Q30(0.07940162697653f), Q30(0.04469901562677f), Q30(0.02514469318284f), + Q30(0.01414142856998f), Q30(0.00795258154731f), Q30(0.00447211359449f), + }; + + static const int acos_icc_invq[] = { + Q31(0), Q31(0.178427635f/M_PI), Q31(0.28566733f/M_PI), Q31(0.46307236f/M_PI), Q31(0.59716315f/M_PI), Q31(0.78539816f/M_PI), Q31(1.10030855f/M_PI), Q31(1.57079633f/M_PI) + }; + int iid, icc; + + int k, m; + static const int8_t f_center_20[] = { + -3, -1, 1, 3, 5, 7, 10, 14, 18, 22, + }; + static const int32_t f_center_34[] = { + Q31( 2/768.0),Q31( 6/768.0),Q31(10/768.0),Q31(14/768.0),Q31( 18/768.0),Q31( 22/768.0),Q31( 26/768.0),Q31(30/768.0), + Q31( 34/768.0),Q31(-10/768.0),Q31(-6/768.0),Q31(-2/768.0),Q31( 51/768.0),Q31( 57/768.0),Q31( 15/768.0),Q31(21/768.0), + Q31( 27/768.0),Q31( 33/768.0),Q31(39/768.0),Q31(45/768.0),Q31( 54/768.0),Q31( 66/768.0),Q31( 78/768.0),Q31(42/768.0), + Q31(102/768.0),Q31( 66/768.0),Q31(78/768.0),Q31(90/768.0),Q31(102/768.0),Q31(114/768.0),Q31(126/768.0),Q31(90/768.0) + }; + static const int fractional_delay_links[] = { Q31(0.43f), Q31(0.75f), Q31(0.347f) }; + const int fractional_delay_gain = Q31(0.39f); + + for (pd0 = 0; pd0 < 8; pd0++) { + int pd0_re = (ipdopd_cos[pd0]+2)>>2; + int pd0_im = (ipdopd_sin[pd0]+2)>>2; + for (pd1 = 0; pd1 < 8; pd1++) { + int pd1_re = ipdopd_cos[pd1] >> 1; + int pd1_im = ipdopd_sin[pd1] >> 1; + for (pd2 = 0; pd2 < 8; pd2++) { + int shift, round; + int pd2_re = ipdopd_cos[pd2]; + int pd2_im = ipdopd_sin[pd2]; + int re_smooth = pd0_re + pd1_re + pd2_re; + int im_smooth = pd0_im + pd1_im + pd2_im; + + SoftFloat pd_mag = av_int2sf(((ipdopd_cos[(pd0-pd1)&7]+8)>>4) + ((ipdopd_cos[(pd0-pd2)&7]+4)>>3) + + ((ipdopd_cos[(pd1-pd2)&7]+2)>>2) + 0x15000000, 28); + pd_mag = av_div_sf(FLOAT_1, av_sqrt_sf(pd_mag)); + shift = 30 - pd_mag.exp; + round = 1 << (shift-1); + pd_re_smooth[pd0*64+pd1*8+pd2] = (int)(((int64_t)re_smooth * pd_mag.mant + round) >> shift); + pd_im_smooth[pd0*64+pd1*8+pd2] = (int)(((int64_t)im_smooth * pd_mag.mant + round) >> shift); + } + } + } + + idx = 0; + for (iid = 0; iid < 46; iid++) { + int c1, c2; + + c1 = iid_par_dequant_c1[iid]; + if (iid < 15) + c2 = iid_par_dequant_c1[14-iid]; + else + c2 = iid_par_dequant_c1[60-iid]; + + for (icc = 0; icc < 8; icc++) { + /*if (PS_BASELINE || ps->icc_mode < 3)*/{ + int alpha, beta; + int ca, sa, cb, sb; + + alpha = acos_icc_invq[icc]; + beta = (int)(((int64_t)alpha * 1518500250 + 0x40000000) >> 31); + alpha >>= 1; + beta = (int)(((int64_t)beta * (c1 - c2) + 0x40000000) >> 31); + av_sincos_sf(beta + alpha, &sa, &ca); + av_sincos_sf(beta - alpha, &sb, &cb); + + HA[iid][icc][0] = (int)(((int64_t)c2 * ca + 0x20000000) >> 30); + HA[iid][icc][1] = (int)(((int64_t)c1 * cb + 0x20000000) >> 30); + HA[iid][icc][2] = (int)(((int64_t)c2 * sa + 0x20000000) >> 30); + HA[iid][icc][3] = (int)(((int64_t)c1 * sb + 0x20000000) >> 30); + } /* else */ { + int alpha_int, gamma_int; + int alpha_c_int, alpha_s_int, gamma_c_int, gamma_s_int; + + alpha_int = alpha_tab[idx]; + gamma_int = gamma_tab[idx]; + + av_sincos_sf(alpha_int, &alpha_s_int, &alpha_c_int); + av_sincos_sf(gamma_int, &gamma_s_int, &gamma_c_int); + + alpha_c_int = (int)(((int64_t)alpha_c_int * 1518500250 + 0x20000000) >> 30); + alpha_s_int = (int)(((int64_t)alpha_s_int * 1518500250 + 0x20000000) >> 30); + + HB[iid][icc][0] = (int)(((int64_t)alpha_c_int * gamma_c_int + 0x20000000) >> 30); + HB[iid][icc][1] = (int)(((int64_t)alpha_s_int * gamma_c_int + 0x20000000) >> 30); + HB[iid][icc][2] = -(int)(((int64_t)alpha_s_int * gamma_s_int + 0x20000000) >> 30); + HB[iid][icc][3] = (int)(((int64_t)alpha_c_int * gamma_s_int + 0x20000000) >> 30); + } + + if (icc < 5 || icc > 6) + idx++; + } + } + + for (k = 0; k < NR_ALLPASS_BANDS20; k++) { + int theta; + int64_t f_center; + int c, s; + + if (k < FF_ARRAY_ELEMS(f_center_20)) + f_center = f_center_20[k]; + else + f_center = (k << 3) - 52; + + for (m = 0; m < PS_AP_LINKS; m++) { + theta = (int)(((int64_t)fractional_delay_links[m] * f_center + 8) >> 4); + av_sincos_sf(-theta, &s, &c); + Q_fract_allpass[0][k][m][0] = c; + Q_fract_allpass[0][k][m][1] = s; + } + + theta = (int)(((int64_t)fractional_delay_gain * f_center + 8) >> 4); + av_sincos_sf(-theta, &s, &c); + phi_fract[0][k][0] = c; + phi_fract[0][k][1] = s; + } + + for (k = 0; k < NR_ALLPASS_BANDS34; k++) { + int theta, f_center; + int c, s; + + if (k < FF_ARRAY_ELEMS(f_center_34)) + f_center = f_center_34[k]; + else + f_center = ((int64_t)k << 26) - (53 << 25); + + for (m = 0; m < PS_AP_LINKS; m++) { + theta = (int)(((int64_t)fractional_delay_links[m] * f_center + 0x10000000) >> 27); + av_sincos_sf(-theta, &s, &c); + Q_fract_allpass[1][k][m][0] = c; + Q_fract_allpass[1][k][m][1] = s; + } + + theta = (int)(((int64_t)fractional_delay_gain * f_center + 0x10000000) >> 27); + av_sincos_sf(-theta, &s, &c); + phi_fract[1][k][0] = c; + phi_fract[1][k][1] = s; + } + + make_filters_from_proto(f20_0_8, g0_Q8, 8); + make_filters_from_proto(f34_0_12, g0_Q12, 12); + make_filters_from_proto(f34_1_8, g1_Q8, 8); + make_filters_from_proto(f34_2_4, g2_Q4, 4); +} +#endif /* CONFIG_HARDCODED_TABLES */ + +#endif /* AVCODEC_AACPS_FIXED_TABLEGEN_H */ diff --git a/include/libavcodec/aacps_tablegen.h b/include/libavcodec/aacps_tablegen.h new file mode 100644 index 0000000..5fdd7f0 --- /dev/null +++ b/include/libavcodec/aacps_tablegen.h @@ -0,0 +1,217 @@ +/* + * Header file for hardcoded Parametric Stereo tables + * + * Copyright (c) 2010 Alex Converse + * + * 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_AACPS_TABLEGEN_H +#define AVCODEC_AACPS_TABLEGEN_H + +#include +#include + +#if CONFIG_HARDCODED_TABLES +#define ps_tableinit() +#define TABLE_CONST const +#include "libavcodec/aacps_tables.h" +#else +#include "libavutil/common.h" +#include "libavutil/libm.h" +#include "libavutil/mathematics.h" +#include "libavutil/mem_internal.h" +#define NR_ALLPASS_BANDS20 30 +#define NR_ALLPASS_BANDS34 50 +#define PS_AP_LINKS 3 +#define TABLE_CONST +static float pd_re_smooth[8*8*8]; +static float pd_im_smooth[8*8*8]; +static float HA[46][8][4]; +static float HB[46][8][4]; +static DECLARE_ALIGNED(16, float, f20_0_8) [ 8][8][2]; +static DECLARE_ALIGNED(16, float, f34_0_12)[12][8][2]; +static DECLARE_ALIGNED(16, float, f34_1_8) [ 8][8][2]; +static DECLARE_ALIGNED(16, float, f34_2_4) [ 4][8][2]; +static TABLE_CONST DECLARE_ALIGNED(16, float, Q_fract_allpass)[2][50][3][2]; +static DECLARE_ALIGNED(16, float, phi_fract)[2][50][2]; + +static const float g0_Q8[] = { + 0.00746082949812f, 0.02270420949825f, 0.04546865930473f, 0.07266113929591f, + 0.09885108575264f, 0.11793710567217f, 0.125f +}; + +static const float g0_Q12[] = { + 0.04081179924692f, 0.03812810994926f, 0.05144908135699f, 0.06399831151592f, + 0.07428313801106f, 0.08100347892914f, 0.08333333333333f +}; + +static const float g1_Q8[] = { + 0.01565675600122f, 0.03752716391991f, 0.05417891378782f, 0.08417044116767f, + 0.10307344158036f, 0.12222452249753f, 0.125f +}; + +static const float g2_Q4[] = { + -0.05908211155639f, -0.04871498374946f, 0.0f, 0.07778723915851f, + 0.16486303567403f, 0.23279856662996f, 0.25f +}; + +static av_cold void make_filters_from_proto(float (*filter)[8][2], const float *proto, int bands) +{ + int q, n; + for (q = 0; q < bands; q++) { + for (n = 0; n < 7; n++) { + double theta = 2 * M_PI * (q + 0.5) * (n - 6) / bands; + filter[q][n][0] = proto[n] * cos(theta); + filter[q][n][1] = proto[n] * -sin(theta); + } + } +} + +static av_cold void ps_tableinit(void) +{ + static const float ipdopd_sin[] = { 0, M_SQRT1_2, 1, M_SQRT1_2, 0, -M_SQRT1_2, -1, -M_SQRT1_2 }; + static const float ipdopd_cos[] = { 1, M_SQRT1_2, 0, -M_SQRT1_2, -1, -M_SQRT1_2, 0, M_SQRT1_2 }; + int pd0, pd1, pd2; + + static const float iid_par_dequant[] = { + //iid_par_dequant_default + 0.05623413251903, 0.12589254117942, 0.19952623149689, 0.31622776601684, + 0.44668359215096, 0.63095734448019, 0.79432823472428, 1, + 1.25892541179417, 1.58489319246111, 2.23872113856834, 3.16227766016838, + 5.01187233627272, 7.94328234724282, 17.7827941003892, + //iid_par_dequant_fine + 0.00316227766017, 0.00562341325190, 0.01, 0.01778279410039, + 0.03162277660168, 0.05623413251903, 0.07943282347243, 0.11220184543020, + 0.15848931924611, 0.22387211385683, 0.31622776601684, 0.39810717055350, + 0.50118723362727, 0.63095734448019, 0.79432823472428, 1, + 1.25892541179417, 1.58489319246111, 1.99526231496888, 2.51188643150958, + 3.16227766016838, 4.46683592150963, 6.30957344480193, 8.91250938133745, + 12.5892541179417, 17.7827941003892, 31.6227766016838, 56.2341325190349, + 100, 177.827941003892, 316.227766016837, + }; + static const float icc_invq[] = { + 1, 0.937, 0.84118, 0.60092, 0.36764, 0, -0.589, -1 + }; + static const float acos_icc_invq[] = { + 0, 0.35685527, 0.57133466, 0.92614472, 1.1943263, M_PI/2, 2.2006171, M_PI + }; + int iid, icc; + + int k, m; + static const int8_t f_center_20[] = { + -3, -1, 1, 3, 5, 7, 10, 14, 18, 22, + }; + static const int8_t f_center_34[] = { + 2, 6, 10, 14, 18, 22, 26, 30, + 34,-10, -6, -2, 51, 57, 15, 21, + 27, 33, 39, 45, 54, 66, 78, 42, + 102, 66, 78, 90,102,114,126, 90, + }; + static const float fractional_delay_links[] = { 0.43f, 0.75f, 0.347f }; + const float fractional_delay_gain = 0.39f; + + for (pd0 = 0; pd0 < 8; pd0++) { + float pd0_re = ipdopd_cos[pd0]; + float pd0_im = ipdopd_sin[pd0]; + for (pd1 = 0; pd1 < 8; pd1++) { + float pd1_re = ipdopd_cos[pd1]; + float pd1_im = ipdopd_sin[pd1]; + for (pd2 = 0; pd2 < 8; pd2++) { + float pd2_re = ipdopd_cos[pd2]; + float pd2_im = ipdopd_sin[pd2]; + float re_smooth = 0.25f * pd0_re + 0.5f * pd1_re + pd2_re; + float im_smooth = 0.25f * pd0_im + 0.5f * pd1_im + pd2_im; + float pd_mag = 1 / hypot(im_smooth, re_smooth); + pd_re_smooth[pd0*64+pd1*8+pd2] = re_smooth * pd_mag; + pd_im_smooth[pd0*64+pd1*8+pd2] = im_smooth * pd_mag; + } + } + } + + for (iid = 0; iid < 46; iid++) { + float c = iid_par_dequant[iid]; ///< Linear Inter-channel Intensity Difference + float c1 = (float)M_SQRT2 / sqrtf(1.0f + c*c); + float c2 = c * c1; + for (icc = 0; icc < 8; icc++) { + /*if (PS_BASELINE || ps->icc_mode < 3)*/ { + float alpha = 0.5f * acos_icc_invq[icc]; + float beta = alpha * (c1 - c2) * (float)M_SQRT1_2; + HA[iid][icc][0] = c2 * cosf(beta + alpha); + HA[iid][icc][1] = c1 * cosf(beta - alpha); + HA[iid][icc][2] = c2 * sinf(beta + alpha); + HA[iid][icc][3] = c1 * sinf(beta - alpha); + } /* else */ { + float alpha, gamma, mu, rho; + float alpha_c, alpha_s, gamma_c, gamma_s; + rho = FFMAX(icc_invq[icc], 0.05f); + alpha = 0.5f * atan2f(2.0f * c * rho, c*c - 1.0f); + mu = c + 1.0f / c; + mu = sqrtf(1 + (4 * rho * rho - 4)/(mu * mu)); + gamma = atanf(sqrtf((1.0f - mu)/(1.0f + mu))); + if (alpha < 0) alpha += M_PI/2; + alpha_c = cosf(alpha); + alpha_s = sinf(alpha); + gamma_c = cosf(gamma); + gamma_s = sinf(gamma); + HB[iid][icc][0] = M_SQRT2 * alpha_c * gamma_c; + HB[iid][icc][1] = M_SQRT2 * alpha_s * gamma_c; + HB[iid][icc][2] = -M_SQRT2 * alpha_s * gamma_s; + HB[iid][icc][3] = M_SQRT2 * alpha_c * gamma_s; + } + } + } + + for (k = 0; k < NR_ALLPASS_BANDS20; k++) { + double f_center, theta; + if (k < FF_ARRAY_ELEMS(f_center_20)) + f_center = f_center_20[k] * 0.125; + else + f_center = k - 6.5f; + for (m = 0; m < PS_AP_LINKS; m++) { + theta = -M_PI * fractional_delay_links[m] * f_center; + Q_fract_allpass[0][k][m][0] = cos(theta); + Q_fract_allpass[0][k][m][1] = sin(theta); + } + theta = -M_PI*fractional_delay_gain*f_center; + phi_fract[0][k][0] = cos(theta); + phi_fract[0][k][1] = sin(theta); + } + for (k = 0; k < NR_ALLPASS_BANDS34; k++) { + double f_center, theta; + if (k < FF_ARRAY_ELEMS(f_center_34)) + f_center = f_center_34[k] / 24.0; + else + f_center = k - 26.5f; + for (m = 0; m < PS_AP_LINKS; m++) { + theta = -M_PI * fractional_delay_links[m] * f_center; + Q_fract_allpass[1][k][m][0] = cos(theta); + Q_fract_allpass[1][k][m][1] = sin(theta); + } + theta = -M_PI*fractional_delay_gain*f_center; + phi_fract[1][k][0] = cos(theta); + phi_fract[1][k][1] = sin(theta); + } + + make_filters_from_proto(f20_0_8, g0_Q8, 8); + make_filters_from_proto(f34_0_12, g0_Q12, 12); + make_filters_from_proto(f34_1_8, g1_Q8, 8); + make_filters_from_proto(f34_2_4, g2_Q4, 4); +} +#endif /* CONFIG_HARDCODED_TABLES */ + +#endif /* AVCODEC_AACPS_TABLEGEN_H */ diff --git a/include/libavcodec/aacpsdsp.h b/include/libavcodec/aacpsdsp.h new file mode 100644 index 0000000..1491212 --- /dev/null +++ b/include/libavcodec/aacpsdsp.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2012 Mans Rullgard + * + * 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_AACPSDSP_H +#define AVCODEC_AACPSDSP_H + +#include + +#include "aac_defines.h" + +#define PS_QMF_TIME_SLOTS 32 +#define PS_AP_LINKS 3 +#define PS_MAX_AP_DELAY 5 + +typedef struct PSDSPContext { + void (*add_squares)(INTFLOAT *dst, const INTFLOAT (*src)[2], int n); + void (*mul_pair_single)(INTFLOAT (*dst)[2], INTFLOAT (*src0)[2], INTFLOAT *src1, + int n); + void (*hybrid_analysis)(INTFLOAT (*out)[2], INTFLOAT (*in)[2], + const INTFLOAT (*filter)[8][2], + ptrdiff_t stride, int n); + void (*hybrid_analysis_ileave)(INTFLOAT (*out)[32][2], INTFLOAT L[2][38][64], + int i, int len); + void (*hybrid_synthesis_deint)(INTFLOAT out[2][38][64], INTFLOAT (*in)[32][2], + int i, int len); + void (*decorrelate)(INTFLOAT (*out)[2], INTFLOAT (*delay)[2], + INTFLOAT (*ap_delay)[PS_QMF_TIME_SLOTS+PS_MAX_AP_DELAY][2], + const INTFLOAT phi_fract[2], const INTFLOAT (*Q_fract)[2], + const INTFLOAT *transient_gain, + INTFLOAT g_decay_slope, + int len); + void (*stereo_interpolate[2])(INTFLOAT (*l)[2], INTFLOAT (*r)[2], + INTFLOAT h[2][4], INTFLOAT h_step[2][4], + int len); +} PSDSPContext; + +void AAC_RENAME(ff_psdsp_init)(PSDSPContext *s); +void ff_psdsp_init_arm(PSDSPContext *s); +void ff_psdsp_init_aarch64(PSDSPContext *s); +void ff_psdsp_init_riscv(PSDSPContext *s); +void ff_psdsp_init_x86(PSDSPContext *s); + +#endif /* AVCODEC_AACPSDSP_H */ diff --git a/include/libavcodec/aacsbr.h b/include/libavcodec/aacsbr.h new file mode 100644 index 0000000..3958b43 --- /dev/null +++ b/include/libavcodec/aacsbr.h @@ -0,0 +1,110 @@ +/* + * AAC Spectral Band Replication function declarations + * Copyright (c) 2008-2009 Robert Swain ( rob opendot cl ) + * Copyright (c) 2010 Alex Converse + * + * 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 + */ + +/** + * @file + * AAC Spectral Band Replication function declarations + * @author Robert Swain ( rob opendot cl ) + */ + +#ifndef AVCODEC_AACSBR_H +#define AVCODEC_AACSBR_H + +#include "get_bits.h" +#include "aac/aacdec.h" + +#include "libavutil/attributes_internal.h" + +#define ENVELOPE_ADJUSTMENT_OFFSET 2 +#define NOISE_FLOOR_OFFSET 6 + +/** + * SBR VLC tables + */ +enum { + T_HUFFMAN_ENV_1_5DB, + F_HUFFMAN_ENV_1_5DB, + T_HUFFMAN_ENV_BAL_1_5DB, + F_HUFFMAN_ENV_BAL_1_5DB, + T_HUFFMAN_ENV_3_0DB, + F_HUFFMAN_ENV_3_0DB, + T_HUFFMAN_ENV_BAL_3_0DB, + F_HUFFMAN_ENV_BAL_3_0DB, + T_HUFFMAN_NOISE_3_0DB, + T_HUFFMAN_NOISE_BAL_3_0DB, +}; + +/** + * bs_frame_class - frame class of current SBR frame (14496-3 sp04 p98) + */ +enum { + FIXFIX, + FIXVAR, + VARFIX, + VARVAR, +}; + +enum { + EXTENSION_ID_PS = 2, +}; + +FF_VISIBILITY_PUSH_HIDDEN +/** Initialize SBR. */ +void ff_aac_sbr_init(void); +void ff_aac_sbr_init_fixed(void); +/** + * Allocate an ExtChannelElement (if necessary) and + * initialize the SBR context contained in it. + */ +int ff_aac_sbr_ctx_alloc_init(AACDecContext *ac, ChannelElement **che, int id_aac); +int ff_aac_sbr_ctx_alloc_init_fixed(AACDecContext *ac, ChannelElement **che, int id_aac); + +/** Close the SBR context implicitly contained in a ChannelElement. */ +void ff_aac_sbr_ctx_close(ChannelElement *che); +void ff_aac_sbr_ctx_close_fixed(ChannelElement *che); + +/** Decode one SBR element. */ +int ff_aac_sbr_decode_extension(AACDecContext *ac, ChannelElement *che, + GetBitContext *gb, int crc, int cnt, int id_aac); +int ff_aac_sbr_decode_extension_fixed(AACDecContext *ac, ChannelElement *che, + GetBitContext *gb, int crc, int cnt, int id_aac); + +/** Due to channel allocation not being known upon SBR parameter transmission, + * supply the parameters separately. + * Functionally identical to ff_aac_sbr_decode_extension() */ +int ff_aac_sbr_config_usac(AACDecContext *ac, ChannelElement *che, + AACUsacElemConfig *ue); + +/** Decode frame SBR data, USAC. */ +int ff_aac_sbr_decode_usac_data(AACDecContext *ac, ChannelElement *che, + AACUsacElemConfig *ue, GetBitContext *gb, + int sbr_ch, int indep_flag); + +/** Apply one SBR element to one AAC element. */ +void ff_aac_sbr_apply(AACDecContext *ac, ChannelElement *che, + int id_aac, void /* float */ *L, void /* float */ *R); +void ff_aac_sbr_apply_fixed(AACDecContext *ac, ChannelElement *che, + int id_aac, void /* int */ *L, void /* int */ *R); + +FF_VISIBILITY_POP_HIDDEN + +#endif /* AVCODEC_AACSBR_H */ diff --git a/include/libavcodec/aacsbrdata.h b/include/libavcodec/aacsbrdata.h new file mode 100644 index 0000000..9c25098 --- /dev/null +++ b/include/libavcodec/aacsbrdata.h @@ -0,0 +1,373 @@ +/* + * AAC Spectral Band Replication decoding data + * Copyright (c) 2008-2009 Robert Swain ( rob opendot cl ) + * + * 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 + */ + +/** + * @file + * AAC Spectral Band Replication decoding data + * @author Robert Swain ( rob opendot cl ) + */ + +#ifndef AVCODEC_AACSBRDATA_H +#define AVCODEC_AACSBRDATA_H + +#include +#include "libavutil/mem_internal.h" +#include "aac_defines.h" + +static const int8_t sbr_offset[6][16] = { + {-8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7}, // fs_sbr = 16000 Hz + {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13}, // fs_sbr = 22050 Hz + {-5, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16}, // fs_sbr = 24000 Hz + {-6, -4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16}, // fs_sbr = 32000 Hz + {-4, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20}, // 44100 Hz <= fs_sbr <= 64000 Hz + {-2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 13, 16, 20, 24}, // 64000 Hz < fs_sbr +}; + +///< window coefficients for analysis/synthesis QMF banks +static const DECLARE_ALIGNED(32, INTFLOAT, sbr_qmf_window_ds)[320] = { + Q31( 0.0000000000f), Q31(-0.0005617692f), + Q31(-0.0004875227f), Q31(-0.0005040714f), + Q31(-0.0005466565f), Q31(-0.0005870930f), + Q31(-0.0006312493f), Q31(-0.0006777690f), + Q31(-0.0007157736f), Q31(-0.0007440941f), + Q31(-0.0007681371f), Q31(-0.0007834332f), + Q31(-0.0007803664f), Q31(-0.0007757977f), + Q31(-0.0007530001f), Q31(-0.0007215391f), + Q31(-0.0006650415f), Q31(-0.0005946118f), + Q31(-0.0005145572f), Q31(-0.0004095121f), + Q31(-0.0002896981f), Q31(-0.0001446380f), + Q31( 0.0000134949f), Q31( 0.0002043017f), + Q31( 0.0004026540f), Q31( 0.0006239376f), + Q31( 0.0008608443f), Q31( 0.0011250155f), + Q31( 0.0013902494f), Q31( 0.0016868083f), + Q31( 0.0019841140f), Q31( 0.0023017254f), + Q31( 0.0026201758f), Q31( 0.0029469447f), + Q31( 0.0032739613f), Q31( 0.0036008268f), + Q31( 0.0039207432f), Q31( 0.0042264269f), + Q31( 0.0045209852f), Q31( 0.0047932560f), + Q31( 0.0050393022f), Q31( 0.0052461166f), + Q31( 0.0054196775f), Q31( 0.0055475714f), + Q31( 0.0056220643f), Q31( 0.0056389199f), + Q31( 0.0055917128f), Q31( 0.0054753783f), + Q31( 0.0052715758f), Q31( 0.0049839687f), + Q31( 0.0046039530f), Q31( 0.0041251642f), + Q31( 0.0035401246f), Q31( 0.0028446757f), + Q31( 0.0020274176f), Q31( 0.0010902329f), + Q31( 0.0000276045f), Q31(-0.0011568135f), + Q31(-0.0024826723f), Q31(-0.0039401124f), + Q31(-0.0055337211f), Q31(-0.0072615816f), + Q31(-0.0091325329f), Q31(-0.0111315548f), + Q31( 0.0132718220f), Q31( 0.0155405553f), + Q31( 0.0179433381f), Q31( 0.0204531793f), + Q31( 0.0230680169f), Q31( 0.0257875847f), + Q31( 0.0286072173f), Q31( 0.0315017608f), + Q31( 0.0344620948f), Q31( 0.0374812850f), + Q31( 0.0405349170f), Q31( 0.0436097542f), + Q31( 0.0466843027f), Q31( 0.0497385755f), + Q31( 0.0527630746f), Q31( 0.0557173648f), + Q31( 0.0585915683f), Q31( 0.0613455171f), + Q31( 0.0639715898f), Q31( 0.0664367512f), + Q31( 0.0687043828f), Q31( 0.0707628710f), + Q31( 0.0725682583f), Q31( 0.0741003642f), + Q31( 0.0753137336f), Q31( 0.0761992479f), + Q31( 0.0767093490f), Q31( 0.0768230011f), + Q31( 0.0765050718f), Q31( 0.0757305756f), + Q31( 0.0744664394f), Q31( 0.0726774642f), + Q31( 0.0703533073f), Q31( 0.0674525021f), + Q31( 0.0639444805f), Q31( 0.0598166570f), + Q31( 0.0550460034f), Q31( 0.0495978676f), + Q31( 0.0434768782f), Q31( 0.0366418116f), + Q31( 0.0290824006f), Q31( 0.0207997072f), + Q31( 0.0117623832f), Q31( 0.0019765601f), + Q31(-0.0085711749f), Q31(-0.0198834129f), + Q31(-0.0319531274f), Q31(-0.0447806821f), + Q31(-0.0583705326f), Q31(-0.0726943300f), + Q31(-0.0877547536f), Q31(-0.1035329531f), + Q31(-0.1200077984f), Q31(-0.1371551761f), + Q31(-0.1549607071f), Q31(-0.1733808172f), + Q31(-0.1923966745f), Q31(-0.2119735853f), + Q31(-0.2320690870f), Q31(-0.2526480309f), + Q31(-0.2736634040f), Q31(-0.2950716717f), + Q31(-0.3168278913f), Q31(-0.3388722693f), + Q31( 0.3611589903f), Q31( 0.3836350013f), + Q31( 0.4062317676f), Q31( 0.4289119920f), + Q31( 0.4515996535f), Q31( 0.4742453214f), + Q31( 0.4967708254f), Q31( 0.5191234970f), + Q31( 0.5412553448f), Q31( 0.5630789140f), + Q31( 0.5845403235f), Q31( 0.6055783538f), + Q31( 0.6261242695f), Q31( 0.6461269695f), + Q31( 0.6655139880f), Q31( 0.6842353293f), + Q31( 0.7022388719f), Q31( 0.7194462634f), + Q31( 0.7358211758f), Q31( 0.7513137456f), + Q31( 0.7658674865f), Q31( 0.7794287519f), + Q31( 0.7919735841f), Q31( 0.8034485751f), + Q31( 0.8138191270f), Q31( 0.8230419890f), + Q31( 0.8311038457f), Q31( 0.8379717337f), + Q31( 0.8436238281f), Q31( 0.8480315777f), + Q31( 0.8511971524f), Q31( 0.8531020949f), + Q31( 0.8537385600f), Q31( 0.8531020949f), + Q31( 0.8511971524f), Q31( 0.8480315777f), + Q31( 0.8436238281f), Q31( 0.8379717337f), + Q31( 0.8311038457f), Q31( 0.8230419890f), + Q31( 0.8138191270f), Q31( 0.8034485751f), + Q31( 0.7919735841f), Q31( 0.7794287519f), + Q31( 0.7658674865f), Q31( 0.7513137456f), + Q31( 0.7358211758f), Q31( 0.7194462634f), + Q31( 0.7022388719f), Q31( 0.6842353293f), + Q31( 0.6655139880f), Q31( 0.6461269695f), + Q31( 0.6261242695f), Q31( 0.6055783538f), + Q31( 0.5845403235f), Q31( 0.5630789140f), + Q31( 0.5412553448f), Q31( 0.5191234970f), + Q31( 0.4967708254f), Q31( 0.4742453214f), + Q31( 0.4515996535f), Q31( 0.4289119920f), + Q31( 0.4062317676f), Q31( 0.3836350013f), + -Q31( 0.3611589903f), Q31(-0.3388722693f), + Q31(-0.3168278913f), Q31(-0.2950716717f), + Q31(-0.2736634040f), Q31(-0.2526480309f), + Q31(-0.2320690870f), Q31(-0.2119735853f), + Q31(-0.1923966745f), Q31(-0.1733808172f), + Q31(-0.1549607071f), Q31(-0.1371551761f), + Q31(-0.1200077984f), Q31(-0.1035329531f), + Q31(-0.0877547536f), Q31(-0.0726943300f), + Q31(-0.0583705326f), Q31(-0.0447806821f), + Q31(-0.0319531274f), Q31(-0.0198834129f), + Q31(-0.0085711749f), Q31( 0.0019765601f), + Q31( 0.0117623832f), Q31( 0.0207997072f), + Q31( 0.0290824006f), Q31( 0.0366418116f), + Q31( 0.0434768782f), Q31( 0.0495978676f), + Q31( 0.0550460034f), Q31( 0.0598166570f), + Q31( 0.0639444805f), Q31( 0.0674525021f), + Q31( 0.0703533073f), Q31( 0.0726774642f), + Q31( 0.0744664394f), Q31( 0.0757305756f), + Q31( 0.0765050718f), Q31( 0.0768230011f), + Q31( 0.0767093490f), Q31( 0.0761992479f), + Q31( 0.0753137336f), Q31( 0.0741003642f), + Q31( 0.0725682583f), Q31( 0.0707628710f), + Q31( 0.0687043828f), Q31( 0.0664367512f), + Q31( 0.0639715898f), Q31( 0.0613455171f), + Q31( 0.0585915683f), Q31( 0.0557173648f), + Q31( 0.0527630746f), Q31( 0.0497385755f), + Q31( 0.0466843027f), Q31( 0.0436097542f), + Q31( 0.0405349170f), Q31( 0.0374812850f), + Q31( 0.0344620948f), Q31( 0.0315017608f), + Q31( 0.0286072173f), Q31( 0.0257875847f), + Q31( 0.0230680169f), Q31( 0.0204531793f), + Q31( 0.0179433381f), Q31( 0.0155405553f), + -Q31( 0.0132718220f), Q31(-0.0111315548f), + Q31(-0.0091325329f), Q31(-0.0072615816f), + Q31(-0.0055337211f), Q31(-0.0039401124f), + Q31(-0.0024826723f), Q31(-0.0011568135f), + Q31( 0.0000276045f), Q31( 0.0010902329f), + Q31( 0.0020274176f), Q31( 0.0028446757f), + Q31( 0.0035401246f), Q31( 0.0041251642f), + Q31( 0.0046039530f), Q31( 0.0049839687f), + Q31( 0.0052715758f), Q31( 0.0054753783f), + Q31( 0.0055917128f), Q31( 0.0056389199f), + Q31( 0.0056220643f), Q31( 0.0055475714f), + Q31( 0.0054196775f), Q31( 0.0052461166f), + Q31( 0.0050393022f), Q31( 0.0047932560f), + Q31( 0.0045209852f), Q31( 0.0042264269f), + Q31( 0.0039207432f), Q31( 0.0036008268f), + Q31( 0.0032739613f), Q31( 0.0029469447f), + Q31( 0.0026201758f), Q31( 0.0023017254f), + Q31( 0.0019841140f), Q31( 0.0016868083f), + Q31( 0.0013902494f), Q31( 0.0011250155f), + Q31( 0.0008608443f), Q31( 0.0006239376f), + Q31( 0.0004026540f), Q31( 0.0002043017f), + Q31( 0.0000134949f), Q31(-0.0001446380f), + Q31(-0.0002896981f), Q31(-0.0004095121f), + Q31(-0.0005145572f), Q31(-0.0005946118f), + Q31(-0.0006650415f), Q31(-0.0007215391f), + Q31(-0.0007530001f), Q31(-0.0007757977f), + Q31(-0.0007803664f), Q31(-0.0007834332f), + Q31(-0.0007681371f), Q31(-0.0007440941f), + Q31(-0.0007157736f), Q31(-0.0006777690f), + Q31(-0.0006312493f), Q31(-0.0005870930f), + Q31(-0.0005466565f), Q31(-0.0005040714f), + Q31(-0.0004875227f), Q31(-0.0005617692f), +}; + +/* This table contains redundancy: It is symmetric about the entry #320 + * with the exception of entries 384 and 512 which are negated. */ +static const DECLARE_ALIGNED(32, INTFLOAT, sbr_qmf_window_us)[640] = { + Q31( 0.0000000000f), Q31(-0.0005525286f), Q31(-0.0005617692f), Q31(-0.0004947518f), + Q31(-0.0004875227f), Q31(-0.0004893791f), Q31(-0.0005040714f), Q31(-0.0005226564f), + Q31(-0.0005466565f), Q31(-0.0005677802f), Q31(-0.0005870930f), Q31(-0.0006132747f), + Q31(-0.0006312493f), Q31(-0.0006540333f), Q31(-0.0006777690f), Q31(-0.0006941614f), + Q31(-0.0007157736f), Q31(-0.0007255043f), Q31(-0.0007440941f), Q31(-0.0007490598f), + Q31(-0.0007681371f), Q31(-0.0007724848f), Q31(-0.0007834332f), Q31(-0.0007779869f), + Q31(-0.0007803664f), Q31(-0.0007801449f), Q31(-0.0007757977f), Q31(-0.0007630793f), + Q31(-0.0007530001f), Q31(-0.0007319357f), Q31(-0.0007215391f), Q31(-0.0006917937f), + Q31(-0.0006650415f), Q31(-0.0006341594f), Q31(-0.0005946118f), Q31(-0.0005564576f), + Q31(-0.0005145572f), Q31(-0.0004606325f), Q31(-0.0004095121f), Q31(-0.0003501175f), + Q31(-0.0002896981f), Q31(-0.0002098337f), Q31(-0.0001446380f), Q31(-0.0000617334f), + Q31( 0.0000134949f), Q31( 0.0001094383f), Q31( 0.0002043017f), Q31( 0.0002949531f), + Q31( 0.0004026540f), Q31( 0.0005107388f), Q31( 0.0006239376f), Q31( 0.0007458025f), + Q31( 0.0008608443f), Q31( 0.0009885988f), Q31( 0.0011250155f), Q31( 0.0012577884f), + Q31( 0.0013902494f), Q31( 0.0015443219f), Q31( 0.0016868083f), Q31( 0.0018348265f), + Q31( 0.0019841140f), Q31( 0.0021461583f), Q31( 0.0023017254f), Q31( 0.0024625616f), + Q31( 0.0026201758f), Q31( 0.0027870464f), Q31( 0.0029469447f), Q31( 0.0031125420f), + Q31( 0.0032739613f), Q31( 0.0034418874f), Q31( 0.0036008268f), Q31( 0.0037603922f), + Q31( 0.0039207432f), Q31( 0.0040819753f), Q31( 0.0042264269f), Q31( 0.0043730719f), + Q31( 0.0045209852f), Q31( 0.0046606460f), Q31( 0.0047932560f), Q31( 0.0049137603f), + Q31( 0.0050393022f), Q31( 0.0051407353f), Q31( 0.0052461166f), Q31( 0.0053471681f), + Q31( 0.0054196775f), Q31( 0.0054876040f), Q31( 0.0055475714f), Q31( 0.0055938023f), + Q31( 0.0056220643f), Q31( 0.0056455196f), Q31( 0.0056389199f), Q31( 0.0056266114f), + Q31( 0.0055917128f), Q31( 0.0055404363f), Q31( 0.0054753783f), Q31( 0.0053838975f), + Q31( 0.0052715758f), Q31( 0.0051382275f), Q31( 0.0049839687f), Q31( 0.0048109469f), + Q31( 0.0046039530f), Q31( 0.0043801861f), Q31( 0.0041251642f), Q31( 0.0038456408f), + Q31( 0.0035401246f), Q31( 0.0032091885f), Q31( 0.0028446757f), Q31( 0.0024508540f), + Q31( 0.0020274176f), Q31( 0.0015784682f), Q31( 0.0010902329f), Q31( 0.0005832264f), + Q31( 0.0000276045f), Q31(-0.0005464280f), Q31(-0.0011568135f), Q31(-0.0018039472f), + Q31(-0.0024826723f), Q31(-0.0031933778f), Q31(-0.0039401124f), Q31(-0.0047222596f), + Q31(-0.0055337211f), Q31(-0.0063792293f), Q31(-0.0072615816f), Q31(-0.0081798233f), + Q31(-0.0091325329f), Q31(-0.0101150215f), Q31(-0.0111315548f), Q31(-0.0121849995f), + Q31( 0.0132718220f), Q31( 0.0143904666f), Q31( 0.0155405553f), Q31( 0.0167324712f), + Q31( 0.0179433381f), Q31( 0.0191872431f), Q31( 0.0204531793f), Q31( 0.0217467550f), + Q31( 0.0230680169f), Q31( 0.0244160992f), Q31( 0.0257875847f), Q31( 0.0271859429f), + Q31( 0.0286072173f), Q31( 0.0300502657f), Q31( 0.0315017608f), Q31( 0.0329754081f), + Q31( 0.0344620948f), Q31( 0.0359697560f), Q31( 0.0374812850f), Q31( 0.0390053679f), + Q31( 0.0405349170f), Q31( 0.0420649094f), Q31( 0.0436097542f), Q31( 0.0451488405f), + Q31( 0.0466843027f), Q31( 0.0482165720f), Q31( 0.0497385755f), Q31( 0.0512556155f), + Q31( 0.0527630746f), Q31( 0.0542452768f), Q31( 0.0557173648f), Q31( 0.0571616450f), + Q31( 0.0585915683f), Q31( 0.0599837480f), Q31( 0.0613455171f), Q31( 0.0626857808f), + Q31( 0.0639715898f), Q31( 0.0652247106f), Q31( 0.0664367512f), Q31( 0.0676075985f), + Q31( 0.0687043828f), Q31( 0.0697630244f), Q31( 0.0707628710f), Q31( 0.0717002673f), + Q31( 0.0725682583f), Q31( 0.0733620255f), Q31( 0.0741003642f), Q31( 0.0747452558f), + Q31( 0.0753137336f), Q31( 0.0758008358f), Q31( 0.0761992479f), Q31( 0.0764992170f), + Q31( 0.0767093490f), Q31( 0.0768173975f), Q31( 0.0768230011f), Q31( 0.0767204924f), + Q31( 0.0765050718f), Q31( 0.0761748321f), Q31( 0.0757305756f), Q31( 0.0751576255f), + Q31( 0.0744664394f), Q31( 0.0736406005f), Q31( 0.0726774642f), Q31( 0.0715826364f), + Q31( 0.0703533073f), Q31( 0.0689664013f), Q31( 0.0674525021f), Q31( 0.0657690668f), + Q31( 0.0639444805f), Q31( 0.0619602779f), Q31( 0.0598166570f), Q31( 0.0575152691f), + Q31( 0.0550460034f), Q31( 0.0524093821f), Q31( 0.0495978676f), Q31( 0.0466303305f), + Q31( 0.0434768782f), Q31( 0.0401458278f), Q31( 0.0366418116f), Q31( 0.0329583930f), + Q31( 0.0290824006f), Q31( 0.0250307561f), Q31( 0.0207997072f), Q31( 0.0163701258f), + Q31( 0.0117623832f), Q31( 0.0069636862f), Q31( 0.0019765601f), Q31(-0.0032086896f), + Q31(-0.0085711749f), Q31(-0.0141288827f), Q31(-0.0198834129f), Q31(-0.0258227288f), + Q31(-0.0319531274f), Q31(-0.0382776572f), Q31(-0.0447806821f), Q31(-0.0514804176f), + Q31(-0.0583705326f), Q31(-0.0654409853f), Q31(-0.0726943300f), Q31(-0.0801372934f), + Q31(-0.0877547536f), Q31(-0.0955533352f), Q31(-0.1035329531f), Q31(-0.1116826931f), + Q31(-0.1200077984f), Q31(-0.1285002850f), Q31(-0.1371551761f), Q31(-0.1459766491f), + Q31(-0.1549607071f), Q31(-0.1640958855f), Q31(-0.1733808172f), Q31(-0.1828172548f), + Q31(-0.1923966745f), Q31(-0.2021250176f), Q31(-0.2119735853f), Q31(-0.2219652696f), + Q31(-0.2320690870f), Q31(-0.2423016884f), Q31(-0.2526480309f), Q31(-0.2631053299f), + Q31(-0.2736634040f), Q31(-0.2843214189f), Q31(-0.2950716717f), Q31(-0.3059098575f), + Q31(-0.3168278913f), Q31(-0.3278113727f), Q31(-0.3388722693f), Q31(-0.3499914122f), + Q31( 0.3611589903f), Q31( 0.3723795546f), Q31( 0.3836350013f), Q31( 0.3949211761f), + Q31( 0.4062317676f), Q31( 0.4175696896f), Q31( 0.4289119920f), Q31( 0.4402553754f), + Q31( 0.4515996535f), Q31( 0.4629308085f), Q31( 0.4742453214f), Q31( 0.4855253091f), + Q31( 0.4967708254f), Q31( 0.5079817500f), Q31( 0.5191234970f), Q31( 0.5302240895f), + Q31( 0.5412553448f), Q31( 0.5522051258f), Q31( 0.5630789140f), Q31( 0.5738524131f), + Q31( 0.5845403235f), Q31( 0.5951123086f), Q31( 0.6055783538f), Q31( 0.6159109932f), + Q31( 0.6261242695f), Q31( 0.6361980107f), Q31( 0.6461269695f), Q31( 0.6559016302f), + Q31( 0.6655139880f), Q31( 0.6749663190f), Q31( 0.6842353293f), Q31( 0.6933282376f), + Q31( 0.7022388719f), Q31( 0.7109410426f), Q31( 0.7194462634f), Q31( 0.7277448900f), + Q31( 0.7358211758f), Q31( 0.7436827863f), Q31( 0.7513137456f), Q31( 0.7587080760f), + Q31( 0.7658674865f), Q31( 0.7727780881f), Q31( 0.7794287519f), Q31( 0.7858353120f), + Q31( 0.7919735841f), Q31( 0.7978466413f), Q31( 0.8034485751f), Q31( 0.8087695004f), + Q31( 0.8138191270f), Q31( 0.8185776004f), Q31( 0.8230419890f), Q31( 0.8272275347f), + Q31( 0.8311038457f), Q31( 0.8346937361f), Q31( 0.8379717337f), Q31( 0.8409541392f), + Q31( 0.8436238281f), Q31( 0.8459818469f), Q31( 0.8480315777f), Q31( 0.8497805198f), + Q31( 0.8511971524f), Q31( 0.8523047035f), Q31( 0.8531020949f), Q31( 0.8535720573f), + Q31( 0.8537385600f), Q31( 0.8535720573f), Q31( 0.8531020949f), Q31( 0.8523047035f), + Q31( 0.8511971524f), Q31( 0.8497805198f), Q31( 0.8480315777f), Q31( 0.8459818469f), + Q31( 0.8436238281f), Q31( 0.8409541392f), Q31( 0.8379717337f), Q31( 0.8346937361f), + Q31( 0.8311038457f), Q31( 0.8272275347f), Q31( 0.8230419890f), Q31( 0.8185776004f), + Q31( 0.8138191270f), Q31( 0.8087695004f), Q31( 0.8034485751f), Q31( 0.7978466413f), + Q31( 0.7919735841f), Q31( 0.7858353120f), Q31( 0.7794287519f), Q31( 0.7727780881f), + Q31( 0.7658674865f), Q31( 0.7587080760f), Q31( 0.7513137456f), Q31( 0.7436827863f), + Q31( 0.7358211758f), Q31( 0.7277448900f), Q31( 0.7194462634f), Q31( 0.7109410426f), + Q31( 0.7022388719f), Q31( 0.6933282376f), Q31( 0.6842353293f), Q31( 0.6749663190f), + Q31( 0.6655139880f), Q31( 0.6559016302f), Q31( 0.6461269695f), Q31( 0.6361980107f), + Q31( 0.6261242695f), Q31( 0.6159109932f), Q31( 0.6055783538f), Q31( 0.5951123086f), + Q31( 0.5845403235f), Q31( 0.5738524131f), Q31( 0.5630789140f), Q31( 0.5522051258f), + Q31( 0.5412553448f), Q31( 0.5302240895f), Q31( 0.5191234970f), Q31( 0.5079817500f), + Q31( 0.4967708254f), Q31( 0.4855253091f), Q31( 0.4742453214f), Q31( 0.4629308085f), + Q31( 0.4515996535f), Q31( 0.4402553754f), Q31( 0.4289119920f), Q31( 0.4175696896f), + Q31( 0.4062317676f), Q31( 0.3949211761f), Q31( 0.3836350013f), Q31( 0.3723795546f), + -Q31( 0.3611589903f), Q31(-0.3499914122f), Q31(-0.3388722693f), Q31(-0.3278113727f), + Q31(-0.3168278913f), Q31(-0.3059098575f), Q31(-0.2950716717f), Q31(-0.2843214189f), + Q31(-0.2736634040f), Q31(-0.2631053299f), Q31(-0.2526480309f), Q31(-0.2423016884f), + Q31(-0.2320690870f), Q31(-0.2219652696f), Q31(-0.2119735853f), Q31(-0.2021250176f), + Q31(-0.1923966745f), Q31(-0.1828172548f), Q31(-0.1733808172f), Q31(-0.1640958855f), + Q31(-0.1549607071f), Q31(-0.1459766491f), Q31(-0.1371551761f), Q31(-0.1285002850f), + Q31(-0.1200077984f), Q31(-0.1116826931f), Q31(-0.1035329531f), Q31(-0.0955533352f), + Q31(-0.0877547536f), Q31(-0.0801372934f), Q31(-0.0726943300f), Q31(-0.0654409853f), + Q31(-0.0583705326f), Q31(-0.0514804176f), Q31(-0.0447806821f), Q31(-0.0382776572f), + Q31(-0.0319531274f), Q31(-0.0258227288f), Q31(-0.0198834129f), Q31(-0.0141288827f), + Q31(-0.0085711749f), Q31(-0.0032086896f), Q31( 0.0019765601f), Q31( 0.0069636862f), + Q31( 0.0117623832f), Q31( 0.0163701258f), Q31( 0.0207997072f), Q31( 0.0250307561f), + Q31( 0.0290824006f), Q31( 0.0329583930f), Q31( 0.0366418116f), Q31( 0.0401458278f), + Q31( 0.0434768782f), Q31( 0.0466303305f), Q31( 0.0495978676f), Q31( 0.0524093821f), + Q31( 0.0550460034f), Q31( 0.0575152691f), Q31( 0.0598166570f), Q31( 0.0619602779f), + Q31( 0.0639444805f), Q31( 0.0657690668f), Q31( 0.0674525021f), Q31( 0.0689664013f), + Q31( 0.0703533073f), Q31( 0.0715826364f), Q31( 0.0726774642f), Q31( 0.0736406005f), + Q31( 0.0744664394f), Q31( 0.0751576255f), Q31( 0.0757305756f), Q31( 0.0761748321f), + Q31( 0.0765050718f), Q31( 0.0767204924f), Q31( 0.0768230011f), Q31( 0.0768173975f), + Q31( 0.0767093490f), Q31( 0.0764992170f), Q31( 0.0761992479f), Q31( 0.0758008358f), + Q31( 0.0753137336f), Q31( 0.0747452558f), Q31( 0.0741003642f), Q31( 0.0733620255f), + Q31( 0.0725682583f), Q31( 0.0717002673f), Q31( 0.0707628710f), Q31( 0.0697630244f), + Q31( 0.0687043828f), Q31( 0.0676075985f), Q31( 0.0664367512f), Q31( 0.0652247106f), + Q31( 0.0639715898f), Q31( 0.0626857808f), Q31( 0.0613455171f), Q31( 0.0599837480f), + Q31( 0.0585915683f), Q31( 0.0571616450f), Q31( 0.0557173648f), Q31( 0.0542452768f), + Q31( 0.0527630746f), Q31( 0.0512556155f), Q31( 0.0497385755f), Q31( 0.0482165720f), + Q31( 0.0466843027f), Q31( 0.0451488405f), Q31( 0.0436097542f), Q31( 0.0420649094f), + Q31( 0.0405349170f), Q31( 0.0390053679f), Q31( 0.0374812850f), Q31( 0.0359697560f), + Q31( 0.0344620948f), Q31( 0.0329754081f), Q31( 0.0315017608f), Q31( 0.0300502657f), + Q31( 0.0286072173f), Q31( 0.0271859429f), Q31( 0.0257875847f), Q31( 0.0244160992f), + Q31( 0.0230680169f), Q31( 0.0217467550f), Q31( 0.0204531793f), Q31( 0.0191872431f), + Q31( 0.0179433381f), Q31( 0.0167324712f), Q31( 0.0155405553f), Q31( 0.0143904666f), + -Q31( 0.0132718220f), Q31(-0.0121849995f), Q31(-0.0111315548f), Q31(-0.0101150215f), + Q31(-0.0091325329f), Q31(-0.0081798233f), Q31(-0.0072615816f), Q31(-0.0063792293f), + Q31(-0.0055337211f), Q31(-0.0047222596f), Q31(-0.0039401124f), Q31(-0.0031933778f), + Q31(-0.0024826723f), Q31(-0.0018039472f), Q31(-0.0011568135f), Q31(-0.0005464280f), + Q31( 0.0000276045f), Q31( 0.0005832264f), Q31( 0.0010902329f), Q31( 0.0015784682f), + Q31( 0.0020274176f), Q31( 0.0024508540f), Q31( 0.0028446757f), Q31( 0.0032091885f), + Q31( 0.0035401246f), Q31( 0.0038456408f), Q31( 0.0041251642f), Q31( 0.0043801861f), + Q31( 0.0046039530f), Q31( 0.0048109469f), Q31( 0.0049839687f), Q31( 0.0051382275f), + Q31( 0.0052715758f), Q31( 0.0053838975f), Q31( 0.0054753783f), Q31( 0.0055404363f), + Q31( 0.0055917128f), Q31( 0.0056266114f), Q31( 0.0056389199f), Q31( 0.0056455196f), + Q31( 0.0056220643f), Q31( 0.0055938023f), Q31( 0.0055475714f), Q31( 0.0054876040f), + Q31( 0.0054196775f), Q31( 0.0053471681f), Q31( 0.0052461166f), Q31( 0.0051407353f), + Q31( 0.0050393022f), Q31( 0.0049137603f), Q31( 0.0047932560f), Q31( 0.0046606460f), + Q31( 0.0045209852f), Q31( 0.0043730719f), Q31( 0.0042264269f), Q31( 0.0040819753f), + Q31( 0.0039207432f), Q31( 0.0037603922f), Q31( 0.0036008268f), Q31( 0.0034418874f), + Q31( 0.0032739613f), Q31( 0.0031125420f), Q31( 0.0029469447f), Q31( 0.0027870464f), + Q31( 0.0026201758f), Q31( 0.0024625616f), Q31( 0.0023017254f), Q31( 0.0021461583f), + Q31( 0.0019841140f), Q31( 0.0018348265f), Q31( 0.0016868083f), Q31( 0.0015443219f), + Q31( 0.0013902494f), Q31( 0.0012577884f), Q31( 0.0011250155f), Q31( 0.0009885988f), + Q31( 0.0008608443f), Q31( 0.0007458025f), Q31( 0.0006239376f), Q31( 0.0005107388f), + Q31( 0.0004026540f), Q31( 0.0002949531f), Q31( 0.0002043017f), Q31( 0.0001094383f), + Q31( 0.0000134949f), Q31(-0.0000617334f), Q31(-0.0001446380f), Q31(-0.0002098337f), + Q31(-0.0002896981f), Q31(-0.0003501175f), Q31(-0.0004095121f), Q31(-0.0004606325f), + Q31(-0.0005145572f), Q31(-0.0005564576f), Q31(-0.0005946118f), Q31(-0.0006341594f), + Q31(-0.0006650415f), Q31(-0.0006917937f), Q31(-0.0007215391f), Q31(-0.0007319357f), + Q31(-0.0007530001f), Q31(-0.0007630793f), Q31(-0.0007757977f), Q31(-0.0007801449f), + Q31(-0.0007803664f), Q31(-0.0007779869f), Q31(-0.0007834332f), Q31(-0.0007724848f), + Q31(-0.0007681371f), Q31(-0.0007490598f), Q31(-0.0007440941f), Q31(-0.0007255043f), + Q31(-0.0007157736f), Q31(-0.0006941614f), Q31(-0.0006777690f), Q31(-0.0006540333f), + Q31(-0.0006312493f), Q31(-0.0006132747f), Q31(-0.0005870930f), Q31(-0.0005677802f), + Q31(-0.0005466565f), Q31(-0.0005226564f), Q31(-0.0005040714f), Q31(-0.0004893791f), + Q31(-0.0004875227f), Q31(-0.0004947518f), Q31(-0.0005617692f), Q31(-0.0005525286f), +}; + +#endif /* AVCODEC_AACSBRDATA_H */ diff --git a/include/libavcodec/aactab.h b/include/libavcodec/aactab.h new file mode 100644 index 0000000..84879aa --- /dev/null +++ b/include/libavcodec/aactab.h @@ -0,0 +1,131 @@ +/* + * AAC data declarations + * Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org ) + * Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com ) + * + * 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 + */ + +/** + * @file + * AAC data declarations + * @author Oded Shimon ( ods15 ods15 dyndns org ) + * @author Maxim Gavrilov ( maxim.gavrilov gmail com ) + */ + +#ifndef AVCODEC_AACTAB_H +#define AVCODEC_AACTAB_H + +#include "libavutil/mem_internal.h" + +#include + +/* NOTE: + * Tables in this file are shared by the AAC decoders and encoder + */ + +extern float ff_aac_pow2sf_tab[428]; +extern float ff_aac_pow34sf_tab[428]; + +/* @name ltp_coef + * Table of the LTP coefficients + */ +extern const float ff_ltp_coef[8]; + +/* @name tns_tmp2_map + * Tables of the tmp2[] arrays of LPC coefficients used for TNS. + * @{ + */ +extern const float *const ff_tns_tmp2_map[4]; +// @} + +/* @name window coefficients + * @{ + */ +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 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]; +DECLARE_ALIGNED(32, extern const int, ff_aac_eld_window_480_fixed)[1800]; +// @} + +extern const float ff_aac_deemph_weights[16]; + +/* 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 + * @{ + */ +extern const uint8_t ff_aac_num_swb_1024[]; +extern const uint8_t ff_aac_num_swb_960 []; +extern const uint8_t ff_aac_num_swb_768 []; +extern const uint8_t ff_aac_num_swb_512 []; +extern const uint8_t ff_aac_num_swb_480 []; +extern const uint8_t ff_aac_num_swb_128 []; +extern const uint8_t ff_aac_num_swb_120 []; +extern const uint8_t ff_aac_num_swb_96 []; +// @} + +extern const uint8_t ff_aac_pred_sfb_max []; + +extern const uint32_t ff_aac_scalefactor_code[121]; +extern const uint8_t ff_aac_scalefactor_bits[121]; + +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 *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 ff_aac_ac_msb_cdfs[64][17]; +extern const uint16_t ff_aac_ac_lsb_cdfs[3][4]; +extern const uint8_t ff_aac_ac_lookup_m[742]; +extern const uint32_t ff_aac_ac_hash_m[742]; +extern const uint16_t ff_aac_ac_cf_m[64][17]; + +extern const uint16_t * const ff_swb_offset_1024[13]; +extern const uint16_t * const ff_swb_offset_960 [13]; +extern const uint16_t * const ff_swb_offset_768 [13]; +extern const uint16_t * const ff_swb_offset_512 [13]; +extern const uint16_t * const ff_swb_offset_480 [13]; +extern const uint16_t * const ff_swb_offset_128 [13]; +extern const uint16_t * const ff_swb_offset_120 [13]; +extern const uint16_t * const ff_swb_offset_96 [13]; + +extern const uint8_t ff_tns_max_bands_1024[13]; +extern const uint8_t ff_tns_max_bands_512 [13]; +extern const uint8_t ff_tns_max_bands_480 [13]; +extern const uint8_t ff_tns_max_bands_128 [13]; + +extern const uint8_t ff_tns_max_bands_usac_1024[13]; +extern const uint8_t ff_tns_max_bands_usac_128[13]; + +/* [x][y], x == 1 -> frame len is 768 frames, y == 1 -> is eight_short */ +extern const uint8_t ff_usac_noise_fill_start_offset[2][2]; + +extern const int ff_aac_usac_samplerate[32]; + +/* Window type (only long+eight, start/stop/stopstart), sine+sine, kbd+kbd, sine+kbd, kbd+sine */ +extern const float ff_aac_usac_mdst_filt_cur[4 /* Window */][4 /* Shape */][7]; +/* Window type (everything/longstop+stopstart), sine or kbd */ +extern const float ff_aac_usac_mdst_filt_prev[2 /* Window */][2 /* sine/kbd */][7]; + +#endif /* AVCODEC_AACTAB_H */ diff --git a/include/libavcodec/aandcttab.h b/include/libavcodec/aandcttab.h new file mode 100644 index 0000000..b0a2f44 --- /dev/null +++ b/include/libavcodec/aandcttab.h @@ -0,0 +1,32 @@ +/* + * 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 + */ + +/** + * @file + * AAN (Arai, Agui and Nakajima) (I)DCT tables + */ + +#ifndef AVCODEC_AANDCTTAB_H +#define AVCODEC_AANDCTTAB_H + +#include + +extern const uint16_t ff_aanscales[64]; +extern const uint16_t ff_inv_aanscales[64]; + +#endif /* AVCODEC_AANDCTTAB_H */ diff --git a/include/libavcodec/ac3.h b/include/libavcodec/ac3.h new file mode 100644 index 0000000..2386c15 --- /dev/null +++ b/include/libavcodec/ac3.h @@ -0,0 +1,147 @@ +/* + * Common code between the AC-3 encoder and decoder + * Copyright (c) 2000, 2001, 2002 Fabrice Bellard + * + * 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 + */ + +/** + * @file + * Common code between the AC-3 encoder and decoder. + */ + +#ifndef AVCODEC_AC3_H +#define AVCODEC_AC3_H + +#include +#include + +#include "ac3tab.h" + +#ifndef USE_FIXED +#define USE_FIXED 0 +#endif + +#if USE_FIXED + +#define FIXR(a) ((int)((a) * 0 + 0.5)) +#define FIXR12(a) ((int)((a) * 4096 + 0.5)) +#define FIXR15(a) ((int)((a) * 32768 + 0.5)) +#define ROUND15(x) ((x) + 16384) >> 15 + +#define AC3_RENAME(x) x ## _fixed +#define AC3_NORM(norm) (1<<24)/(norm) +#define AC3_MUL(a,b) ((((int64_t) (a)) * (b))>>12) +#define AC3_RANGE(x) ((x)|(((x)&128)<<1)) +#define AC3_HEAVY_RANGE(x) ((x)<<1) +#define AC3_DYNAMIC_RANGE(x) (x) +#define AC3_SPX_BLEND(x) (x) +#define AC3_DYNAMIC_RANGE1 0 + +typedef int INTFLOAT; +typedef unsigned int UINTFLOAT; +typedef int16_t SHORTFLOAT; + +#else /* USE_FIXED */ +#include "libavutil/libm.h" + +#define FIXR(x) ((float)(x)) +#define FIXR12(x) ((float)(x)) +#define FIXR15(x) ((float)(x)) +#define ROUND15(x) (x) + +#define AC3_RENAME(x) x +#define AC3_NORM(norm) (1.0f/(norm)) +#define AC3_MUL(a,b) ((a) * (b)) +#define AC3_RANGE(x) (dynamic_range_tab[(x)]) +#define AC3_HEAVY_RANGE(x) (ff_ac3_heavy_dynamic_range_tab[(x)]) +#define AC3_DYNAMIC_RANGE(x) (powf(x, s->drc_scale)) +#define AC3_SPX_BLEND(x) (x)* (1.0f/32) +#define AC3_DYNAMIC_RANGE1 1.0f + +typedef float INTFLOAT; +typedef float UINTFLOAT; +typedef float SHORTFLOAT; + +#endif /* USE_FIXED */ + +#define AC3_LEVEL(x) ROUND15((x) * FIXR15(M_SQRT1_2)) + +/* pre-defined gain values */ +#define LEVEL_PLUS_3DB M_SQRT2 +#define LEVEL_PLUS_1POINT5DB 1.1892071150027209 +#define LEVEL_MINUS_1POINT5DB 0.8408964152537145 +#define LEVEL_MINUS_3DB M_SQRT1_2 +#define LEVEL_MINUS_4POINT5DB 0.5946035575013605 +#define LEVEL_MINUS_6DB 0.5000000000000000 +#define LEVEL_MINUS_9DB 0.3535533905932738 +#define LEVEL_ZERO 0.0000000000000000 +#define LEVEL_ONE 1.0000000000000000 + +typedef struct AC3BitAllocParameters { + int sr_code; + int sr_shift; + int slow_gain, slow_decay, fast_decay, db_per_bit, floor; + int cpl_fast_leak, cpl_slow_leak; +} AC3BitAllocParameters; + +/** + * Calculate the log power-spectral density of the input signal. + * This gives a rough estimate of signal power in the frequency domain by using + * the spectral envelope (exponents). The psd is also separately grouped + * into critical bands for use in the calculating the masking curve. + * 128 units in psd = -6 dB. The dbknee parameter in AC3BitAllocParameters + * determines the reference level. + * + * @param[in] exp frequency coefficient exponents + * @param[in] start starting bin location + * @param[in] end ending bin location + * @param[out] psd signal power for each frequency bin + * @param[out] band_psd signal power for each critical band + */ +void ff_ac3_bit_alloc_calc_psd(int8_t *exp, int start, int end, int16_t *psd, + int16_t *band_psd); + +/** + * Calculate the masking curve. + * First, the excitation is calculated using parameters in s and the signal + * power in each critical band. The excitation is compared with a predefined + * hearing threshold table to produce the masking curve. If delta bit + * allocation information is provided, it is used for adjusting the masking + * curve, usually to give a closer match to a better psychoacoustic model. + * + * @param[in] s adjustable bit allocation parameters + * @param[in] band_psd signal power for each critical band + * @param[in] start starting bin location + * @param[in] end ending bin location + * @param[in] fast_gain fast gain (estimated signal-to-mask ratio) + * @param[in] is_lfe whether or not the channel being processed is the LFE + * @param[in] dba_mode delta bit allocation mode (none, reuse, or new) + * @param[in] dba_nsegs number of delta segments + * @param[in] dba_offsets location offsets for each segment + * @param[in] dba_lengths length of each segment + * @param[in] dba_values delta bit allocation for each segment + * @param[out] mask calculated masking curve + * @return returns 0 for success, non-zero for error + */ +int ff_ac3_bit_alloc_calc_mask(AC3BitAllocParameters *s, int16_t *band_psd, + int start, int end, int fast_gain, int is_lfe, + int dba_mode, int dba_nsegs, uint8_t *dba_offsets, + uint8_t *dba_lengths, uint8_t *dba_values, + int16_t *mask); + +#endif /* AVCODEC_AC3_H */ diff --git a/include/libavcodec/ac3_channel_layout_tab.h b/include/libavcodec/ac3_channel_layout_tab.h new file mode 100644 index 0000000..46fa9ec --- /dev/null +++ b/include/libavcodec/ac3_channel_layout_tab.h @@ -0,0 +1,41 @@ +/* + * AC-3 channel layout table + * copyright (c) 2001 Fabrice Bellard + * + * 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_AC3_CHANNEL_LAYOUT_TAB_H +#define AVCODEC_AC3_CHANNEL_LAYOUT_TAB_H + +#include +#include "libavutil/channel_layout.h" + +/** + * Map audio coding mode (acmod) to channel layout mask. + */ +const uint16_t ff_ac3_channel_layout_tab[8] = { + AV_CH_LAYOUT_STEREO, + AV_CH_LAYOUT_MONO, + AV_CH_LAYOUT_STEREO, + AV_CH_LAYOUT_SURROUND, + AV_CH_LAYOUT_2_1, + AV_CH_LAYOUT_4POINT0, + AV_CH_LAYOUT_2_2, + AV_CH_LAYOUT_5POINT0 +}; +#endif diff --git a/include/libavcodec/ac3_parser_internal.h b/include/libavcodec/ac3_parser_internal.h new file mode 100644 index 0000000..46814bf --- /dev/null +++ b/include/libavcodec/ac3_parser_internal.h @@ -0,0 +1,91 @@ +/* + * AC-3 parser internal code + * + * 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_AC3_PARSER_INTERNAL_H +#define AVCODEC_AC3_PARSER_INTERNAL_H + +#include +#include + +#include "ac3defs.h" +#include "get_bits.h" + +/** + * @struct AC3HeaderInfo + * Coded AC-3 header values up to the lfeon element, plus derived values. + */ +typedef struct AC3HeaderInfo { + /** @name Coded elements + * @{ + */ + uint16_t sync_word; + uint16_t crc1; + uint8_t sr_code; + uint8_t bitstream_id; + uint8_t bitstream_mode; + uint8_t channel_mode; + uint8_t lfe_on; + uint8_t frame_type; + int substreamid; ///< substream identification + int center_mix_level; ///< Center mix level index + int surround_mix_level; ///< Surround mix level index + uint16_t channel_map; + int num_blocks; ///< number of audio blocks + int dolby_surround_mode; + /** @} */ + + /** @name Derived values + * @{ + */ + uint8_t sr_shift; + uint16_t sample_rate; + uint32_t bit_rate; + uint8_t channels; + uint16_t frame_size; + uint64_t channel_layout; + int8_t ac3_bit_rate_code; + /** @} */ +} AC3HeaderInfo; + +typedef enum { + AC3_PARSE_ERROR_SYNC = -0x1030c0a, + AC3_PARSE_ERROR_BSID = -0x2030c0a, + AC3_PARSE_ERROR_SAMPLE_RATE = -0x3030c0a, + AC3_PARSE_ERROR_FRAME_SIZE = -0x4030c0a, + AC3_PARSE_ERROR_FRAME_TYPE = -0x5030c0a, + AC3_PARSE_ERROR_CRC = -0x6030c0a, +} AC3ParseError; + +/** + * Parse AC-3 frame header. + * Parse the header up to the lfeon element, which is the first 52 or 54 bits + * depending on the audio coding mode. + * @param[in] gbc BitContext containing the first 54 bits of the frame. + * @param[out] hdr Pointer to struct where header info is written. + * @return 0 on success and AC3_PARSE_ERROR_* values otherwise. + */ +int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr); + +int avpriv_ac3_parse_header(AC3HeaderInfo **hdr, const uint8_t *buf, + size_t size); + +int ff_ac3_find_syncword(const uint8_t *buf, int buf_size); + +#endif /* AVCODEC_AC3_PARSER_INTERNAL_H */ diff --git a/include/libavcodec/ac3dec.h b/include/libavcodec/ac3dec.h new file mode 100644 index 0000000..98de7b5 --- /dev/null +++ b/include/libavcodec/ac3dec.h @@ -0,0 +1,281 @@ +/* + * Common code between the AC-3 and E-AC-3 decoders + * Copyright (c) 2007 Bartlomiej Wolowiec + * + * 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 + */ + +/** + * @file + * Common code between the AC-3 and E-AC-3 decoders. + * + * Summary of MDCT Coefficient Grouping: + * The individual MDCT coefficient indices are often referred to in the + * (E-)AC-3 specification as frequency bins. These bins are grouped together + * into subbands of 12 coefficients each. The subbands are grouped together + * into bands as defined in the bitstream by the band structures, which + * determine the number of bands and the size of each band. The full spectrum + * of 256 frequency bins is divided into 1 DC bin + 21 subbands = 253 bins. + * This system of grouping coefficients is used for channel bandwidth, stereo + * rematrixing, channel coupling, enhanced coupling, and spectral extension. + * + * +-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-+ + * |1| |12| | [12|12|12|12] | | | | | | | | | | | | |3| + * +-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-+ + * ~~~ ~~~~ ~~~~~~~~~~~~~ ~~~ + * | | | | + * | | | 3 unused frequency bins--+ + * | | | + * | | +--1 band containing 4 subbands + * | | + * | +--1 subband of 12 frequency bins + * | + * +--DC frequency bin + */ + +#ifndef AVCODEC_AC3DEC_H +#define AVCODEC_AC3DEC_H + +#include "libavutil/tx.h" +#include "libavutil/float_dsp.h" +#include "libavutil/fixed_dsp.h" +#include "libavutil/lfg.h" +#include "libavutil/mem_internal.h" + +#include "ac3.h" +#include "ac3dsp.h" +#include "avcodec.h" +#include "bswapdsp.h" +#include "get_bits.h" +#include "fmtconvert.h" + +#define AC3_OUTPUT_LFEON 8 + +#define SPX_MAX_BANDS 17 + +/** Large enough for maximum possible frame size when the specification limit is ignored */ +#define AC3_FRAME_BUFFER_SIZE 32768 + +typedef struct AC3DecodeContext { + AVClass *class; ///< class for AVOptions + AVCodecContext *avctx; ///< parent context + GetBitContext gbc; ///< bitstream reader + +///@name Bit stream information +///@{ + int frame_type; ///< frame type (strmtyp) + int substreamid; ///< substream identification + int superframe_size; ///< current superframe size, in bytes + int frame_size; ///< current frame size, in bytes + int bit_rate; ///< stream bit rate, in bits-per-second + int sample_rate; ///< sample frequency, in Hz + int num_blocks; ///< number of audio blocks + int bitstream_id; ///< bitstream id (bsid) + int bitstream_mode; ///< bitstream mode (bsmod) + int channel_mode; ///< channel mode (acmod) + int lfe_on; ///< lfe channel in use + int dialog_normalization[2]; ///< dialog level in dBFS (dialnorm) + int compression_exists[2]; ///< compression field is valid for frame (compre) + int channel_map; ///< custom channel map (chanmap) + int preferred_downmix; ///< Preferred 2-channel downmix mode (dmixmod) + int center_mix_level; ///< Center mix level index + int center_mix_level_ltrt; ///< Center mix level index for Lt/Rt (ltrtcmixlev) + int surround_mix_level; ///< Surround mix level index + int surround_mix_level_ltrt; ///< Surround mix level index for Lt/Rt (ltrtsurmixlev) + int lfe_mix_level_exists; ///< indicates if lfemixlevcod is specified (lfemixlevcode) + int lfe_mix_level; ///< LFE mix level index (lfemixlevcod) + int eac3; ///< indicates if current frame is E-AC-3 + int eac3_subsbtreamid_found; ///< bitstream has E-AC-3 additional substream(s) + int eac3_extension_type_a; ///< bitstream has E-AC-3 extension type A enabled frame(s) + int dolby_surround_mode; ///< dolby surround mode (dsurmod) + int dolby_surround_ex_mode; ///< dolby surround ex mode (dsurexmod) + int dolby_headphone_mode; ///< dolby headphone mode (dheadphonmod) +///@} + + int preferred_stereo_downmix; + float ltrt_center_mix_level; + float ltrt_surround_mix_level; + float loro_center_mix_level; + float loro_surround_mix_level; + int target_level; ///< target level in dBFS + float level_gain[2]; + +///@name Frame syntax parameters + int snr_offset_strategy; ///< SNR offset strategy (snroffststr) + int block_switch_syntax; ///< block switch syntax enabled (blkswe) + int dither_flag_syntax; ///< dither flag syntax enabled (dithflage) + int bit_allocation_syntax; ///< bit allocation model syntax enabled (bamode) + int fast_gain_syntax; ///< fast gain codes enabled (frmfgaincode) + int dba_syntax; ///< delta bit allocation syntax enabled (dbaflde) + int skip_syntax; ///< skip field syntax enabled (skipflde) + ///@} + +///@name Standard coupling + int cpl_in_use[AC3_MAX_BLOCKS]; ///< coupling in use (cplinu) + int cpl_strategy_exists[AC3_MAX_BLOCKS];///< coupling strategy exists (cplstre) + int channel_in_cpl[AC3_MAX_CHANNELS]; ///< channel in coupling (chincpl) + int phase_flags_in_use; ///< phase flags in use (phsflginu) + int phase_flags[AC3_MAX_CPL_BANDS]; ///< phase flags (phsflg) + int num_cpl_bands; ///< number of coupling bands (ncplbnd) + uint8_t cpl_band_struct[AC3_MAX_CPL_BANDS]; + uint8_t cpl_band_sizes[AC3_MAX_CPL_BANDS]; ///< number of coeffs in each coupling band + int firstchincpl; ///< first channel in coupling + int first_cpl_coords[AC3_MAX_CHANNELS]; ///< first coupling coordinates states (firstcplcos) + int cpl_coords[AC3_MAX_CHANNELS][AC3_MAX_CPL_BANDS]; ///< coupling coordinates (cplco) +///@} + +///@name Spectral extension +///@{ + int spx_in_use; ///< spectral extension in use (spxinu) + uint8_t channel_uses_spx[AC3_MAX_CHANNELS]; ///< channel uses spectral extension (chinspx) + int8_t spx_atten_code[AC3_MAX_CHANNELS]; ///< spx attenuation code (spxattencod) + int spx_src_start_freq; ///< spx start frequency bin + int spx_dst_end_freq; ///< spx end frequency bin + int spx_dst_start_freq; ///< spx starting frequency bin for copying (copystartmant) + ///< the copy region ends at the start of the spx region. + int num_spx_bands; ///< number of spx bands (nspxbnds) + uint8_t spx_band_struct[SPX_MAX_BANDS]; + uint8_t spx_band_sizes[SPX_MAX_BANDS]; ///< number of bins in each spx band + uint8_t first_spx_coords[AC3_MAX_CHANNELS]; ///< first spx coordinates states (firstspxcos) + INTFLOAT spx_noise_blend[AC3_MAX_CHANNELS][SPX_MAX_BANDS]; ///< spx noise blending factor (nblendfact) + INTFLOAT spx_signal_blend[AC3_MAX_CHANNELS][SPX_MAX_BANDS];///< spx signal blending factor (sblendfact) +///@} + +///@name Adaptive hybrid transform + int channel_uses_aht[AC3_MAX_CHANNELS]; ///< channel AHT in use (chahtinu) + int pre_mantissa[AC3_MAX_CHANNELS][AC3_MAX_COEFS][AC3_MAX_BLOCKS]; ///< pre-IDCT mantissas +///@} + +///@name Channel + int fbw_channels; ///< number of full-bandwidth channels + int channels; ///< number of total channels + int lfe_ch; ///< index of LFE channel + SHORTFLOAT *downmix_coeffs[2]; ///< stereo downmix coefficients + int downmixed; ///< indicates if coeffs are currently downmixed + int output_mode; ///< output channel configuration + int prev_output_mode; ///< output channel configuration for previous frame + int out_channels; ///< number of output channels + int prev_bit_rate; ///< stream bit rate, in bits-per-second for previous frame +///@} + +///@name Dynamic range + INTFLOAT dynamic_range[2]; ///< dynamic range + INTFLOAT drc_scale; ///< percentage of dynamic range compression to be applied + int heavy_compression; ///< apply heavy compression + INTFLOAT heavy_dynamic_range[2]; ///< heavy dynamic range compression +///@} + +///@name Bandwidth + int start_freq[AC3_MAX_CHANNELS]; ///< start frequency bin (strtmant) + int end_freq[AC3_MAX_CHANNELS]; ///< end frequency bin (endmant) +///@} + +///@name Consistent noise generation + int consistent_noise_generation; ///< seed noise generation with AC-3 frame on decode +///@} + +///@name Rematrixing + int num_rematrixing_bands; ///< number of rematrixing bands (nrematbnd) + int rematrixing_flags[4]; ///< rematrixing flags (rematflg) +///@} + +///@name Exponents + int num_exp_groups[AC3_MAX_CHANNELS]; ///< Number of exponent groups (nexpgrp) + int8_t dexps[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< decoded exponents + int exp_strategy[AC3_MAX_BLOCKS][AC3_MAX_CHANNELS]; ///< exponent strategies (expstr) +///@} + +///@name Bit allocation + AC3BitAllocParameters bit_alloc_params; ///< bit allocation parameters + int first_cpl_leak; ///< first coupling leak state (firstcplleak) + int snr_offset[AC3_MAX_CHANNELS]; ///< signal-to-noise ratio offsets (snroffst) + int fast_gain[AC3_MAX_CHANNELS]; ///< fast gain values/SMR's (fgain) + uint8_t bap[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< bit allocation pointers + int16_t psd[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< scaled exponents + int16_t band_psd[AC3_MAX_CHANNELS][AC3_CRITICAL_BANDS]; ///< interpolated exponents + int16_t mask[AC3_MAX_CHANNELS][AC3_CRITICAL_BANDS]; ///< masking curve values + int dba_mode[AC3_MAX_CHANNELS]; ///< delta bit allocation mode + int dba_nsegs[AC3_MAX_CHANNELS]; ///< number of delta segments + uint8_t dba_offsets[AC3_MAX_CHANNELS][8]; ///< delta segment offsets + uint8_t dba_lengths[AC3_MAX_CHANNELS][8]; ///< delta segment lengths + uint8_t dba_values[AC3_MAX_CHANNELS][8]; ///< delta values for each segment +///@} + +///@name Zero-mantissa dithering + int dither_flag[AC3_MAX_CHANNELS]; ///< dither flags (dithflg) + AVLFG dith_state; ///< for dither generation +///@} + +///@name IMDCT + int block_switch[AC3_MAX_CHANNELS]; ///< block switch flags (blksw) + AVTXContext *tx_128, *tx_256; + av_tx_fn tx_fn_128, tx_fn_256; +///@} + +///@name Optimization + BswapDSPContext bdsp; +#if USE_FIXED + AVFixedDSPContext *fdsp; +#else + AVFloatDSPContext *fdsp; +#endif + AC3DSPContext ac3dsp; + FmtConvertContext fmt_conv; ///< optimized conversion functions +///@} + + SHORTFLOAT *outptr[AC3_MAX_CHANNELS]; + INTFLOAT *xcfptr[AC3_MAX_CHANNELS]; + INTFLOAT *dlyptr[AC3_MAX_CHANNELS]; + +///@name Aligned arrays + DECLARE_ALIGNED(16, int, fixed_coeffs)[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< fixed-point transform coefficients + DECLARE_ALIGNED(32, INTFLOAT, transform_coeffs)[AC3_MAX_CHANNELS][AC3_MAX_COEFS]; ///< transform coefficients + DECLARE_ALIGNED(32, INTFLOAT, delay)[EAC3_MAX_CHANNELS][AC3_BLOCK_SIZE]; ///< delay - added to the next block + DECLARE_ALIGNED(32, INTFLOAT, window)[AC3_BLOCK_SIZE]; ///< window coefficients + DECLARE_ALIGNED(32, INTFLOAT, tmp_output)[AC3_BLOCK_SIZE]; ///< temporary storage for output before windowing + DECLARE_ALIGNED(32, SHORTFLOAT, output)[EAC3_MAX_CHANNELS][AC3_BLOCK_SIZE]; ///< output after imdct transform and windowing + DECLARE_ALIGNED(32, uint8_t, input_buffer)[AC3_FRAME_BUFFER_SIZE + AV_INPUT_BUFFER_PADDING_SIZE]; ///< temp buffer to prevent overread + DECLARE_ALIGNED(32, SHORTFLOAT, output_buffer)[EAC3_MAX_CHANNELS][AC3_BLOCK_SIZE * 6]; ///< final output buffer +///@} + + AVChannelLayout downmix_layout; +} AC3DecodeContext; + +/** + * Parse the E-AC-3 frame header. + * This parses both the bit stream info and audio frame header. + */ +static int ff_eac3_parse_header(AC3DecodeContext *s); + +/** + * Decode mantissas in a single channel for the entire frame. + * This is used when AHT mode is enabled. + */ +static void ff_eac3_decode_transform_coeffs_aht_ch(AC3DecodeContext *s, int ch); + +/** + * Apply spectral extension to each channel by copying lower frequency + * coefficients to higher frequency bins and applying side information to + * approximate the original high frequency signal. + */ +static void ff_eac3_apply_spectral_extension(AC3DecodeContext *s); + +#if (!USE_FIXED) +extern float ff_ac3_heavy_dynamic_range_tab[256]; +#endif + +#endif /* AVCODEC_AC3DEC_H */ diff --git a/include/libavcodec/ac3dec_data.h b/include/libavcodec/ac3dec_data.h new file mode 100644 index 0000000..975b52e --- /dev/null +++ b/include/libavcodec/ac3dec_data.h @@ -0,0 +1,32 @@ +/* + * AC-3 and E-AC-3 decoder tables + * Copyright (c) 2007 Bartlomiej Wolowiec + * + * 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_AC3DEC_DATA_H +#define AVCODEC_AC3DEC_DATA_H + +#include + +extern const uint8_t ff_ac3_ungroup_3_in_5_bits_tab[32][3]; + +extern const uint8_t ff_eac3_hebap_tab[64]; +extern const uint8_t ff_eac3_default_spx_band_struct[17]; + +#endif /* AVCODEC_AC3DEC_DATA_H */ diff --git a/include/libavcodec/ac3defs.h b/include/libavcodec/ac3defs.h new file mode 100644 index 0000000..ff92f0a --- /dev/null +++ b/include/libavcodec/ac3defs.h @@ -0,0 +1,104 @@ +/* + * Common AC-3 definitions + * Copyright (c) 2000, 2001, 2002 Fabrice Bellard + * + * 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_AC3DEFS_H +#define AVCODEC_AC3DEFS_H + +#define EAC3_MAX_CHANNELS 16 /**< maximum number of channels in EAC3 */ +#define AC3_MAX_CHANNELS 7 /**< maximum number of channels, including coupling channel */ +#define CPL_CH 0 /**< coupling channel index */ + +#define AC3_MAX_COEFS 256 +#define AC3_BLOCK_SIZE 256 +#define AC3_MAX_BLOCKS 6 +#define AC3_FRAME_SIZE (AC3_MAX_BLOCKS * 256) +#define AC3_WINDOW_SIZE (AC3_BLOCK_SIZE * 2) +#define AC3_CRITICAL_BANDS 50 +#define AC3_MAX_CPL_BANDS 18 + +/* exponent encoding strategy */ +#define EXP_REUSE 0 +#define EXP_NEW 1 + +#define EXP_D15 1 +#define EXP_D25 2 +#define EXP_D45 3 + +/** Delta bit allocation strategy */ +typedef enum { + DBA_REUSE = 0, + DBA_NEW, + DBA_NONE, + DBA_RESERVED +} AC3DeltaStrategy; + +/** Channel mode (audio coding mode) */ +typedef enum { + AC3_CHMODE_DUALMONO = 0, + AC3_CHMODE_MONO, + AC3_CHMODE_STEREO, + AC3_CHMODE_3F, + AC3_CHMODE_2F1R, + AC3_CHMODE_3F1R, + AC3_CHMODE_2F2R, + AC3_CHMODE_3F2R +} AC3ChannelMode; + +/** Dolby Surround mode */ +typedef enum AC3DolbySurroundMode { + AC3_DSURMOD_NOTINDICATED = 0, + AC3_DSURMOD_OFF, + AC3_DSURMOD_ON, + AC3_DSURMOD_RESERVED +} AC3DolbySurroundMode; + +/** Dolby Surround EX mode */ +typedef enum AC3DolbySurroundEXMode { + AC3_DSUREXMOD_NOTINDICATED = 0, + AC3_DSUREXMOD_OFF, + AC3_DSUREXMOD_ON, + AC3_DSUREXMOD_PLIIZ +} AC3DolbySurroundEXMode; + +/** Dolby Headphone mode */ +typedef enum AC3DolbyHeadphoneMode { + AC3_DHEADPHONMOD_NOTINDICATED = 0, + AC3_DHEADPHONMOD_OFF, + AC3_DHEADPHONMOD_ON, + AC3_DHEADPHONMOD_RESERVED +} AC3DolbyHeadphoneMode; + +/** Preferred Stereo Downmix mode */ +typedef enum AC3PreferredStereoDownmixMode { + AC3_DMIXMOD_NOTINDICATED = 0, + AC3_DMIXMOD_LTRT, + AC3_DMIXMOD_LORO, + AC3_DMIXMOD_DPLII // reserved value in A/52, but used by encoders to indicate DPL2 +} AC3PreferredStereoDownmixMode; + +typedef enum { + EAC3_FRAME_TYPE_INDEPENDENT = 0, + EAC3_FRAME_TYPE_DEPENDENT, + EAC3_FRAME_TYPE_AC3_CONVERT, + EAC3_FRAME_TYPE_RESERVED +} EAC3FrameType; + +#endif /* AVCODEC_AC3DEFS_H */ diff --git a/include/libavcodec/ac3dsp.h b/include/libavcodec/ac3dsp.h new file mode 100644 index 0000000..b1b2bce --- /dev/null +++ b/include/libavcodec/ac3dsp.h @@ -0,0 +1,123 @@ +/* + * AC-3 DSP functions + * Copyright (c) 2011 Justin Ruggles + * + * 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_AC3DSP_H +#define AVCODEC_AC3DSP_H + +#include +#include + +/** + * Number of mantissa bits written for each bap value. + * bap values with fractional bits are set to 0 and are calculated separately. + */ +extern const uint16_t ff_ac3_bap_bits[16]; + +typedef struct AC3DSPContext { + /** + * Set each encoded exponent in a block to the minimum of itself and the + * exponents in the same frequency bin of up to 5 following blocks. + * @param exp pointer to the start of the current block of exponents. + * constraints: align 16 + * @param num_reuse_blocks number of blocks that will reuse exponents from the current block. + * constraints: range 0 to 5 + * @param nb_coefs number of frequency coefficients. + */ + void (*ac3_exponent_min)(uint8_t *exp, int num_reuse_blocks, int nb_coefs); + + /** + * Convert an array of float in range [-1.0,1.0] to int32_t with range + * [-(1<<24),(1<<24)] + * + * @param dst destination array of int32_t. + * constraints: 32-byte aligned + * @param src source array of float. + * constraints: 32-byte aligned + * @param len number of elements to convert. + * constraints: multiple of 32 greater than zero + */ + void (*float_to_fixed24)(int32_t *dst, const float *src, size_t len); + + /** + * Calculate bit allocation pointers. + * The SNR is the difference between the masking curve and the signal. AC-3 + * uses this value for each frequency bin to allocate bits. The snroffset + * parameter is a global adjustment to the SNR for all bins. + * + * @param[in] mask masking curve + * @param[in] psd signal power for each frequency bin + * @param[in] start starting bin location + * @param[in] end ending bin location + * @param[in] snr_offset SNR adjustment + * @param[in] floor noise floor + * @param[in] bap_tab look-up table for bit allocation pointers + * @param[out] bap bit allocation pointers + */ + void (*bit_alloc_calc_bap)(int16_t *mask, int16_t *psd, int start, int end, + int snr_offset, int floor, + const uint8_t *bap_tab, uint8_t *bap); + + /** + * Update bap counts using the supplied array of bap. + * + * @param[out] mant_cnt bap counts for 1 block + * @param[in] bap array of bap, pointing to start coef bin + * @param[in] len number of elements to process + */ + void (*update_bap_counts)(uint16_t mant_cnt[16], uint8_t *bap, int len); + + /** + * Calculate the number of bits needed to encode a set of mantissas. + * + * @param[in] mant_cnt bap counts for all blocks + * @return mantissa bit count + */ + int (*compute_mantissa_size)(uint16_t mant_cnt[6][16]); + + void (*extract_exponents)(uint8_t *exp, int32_t *coef, int nb_coefs); + + void (*sum_square_butterfly_int32)(int64_t sum[4], const int32_t *coef0, + const int32_t *coef1, int len); + + void (*sum_square_butterfly_float)(float sum[4], const float *coef0, + const float *coef1, int len); + + int out_channels; + int in_channels; + void (*downmix)(float **samples, float **matrix, int len); + void (*downmix_fixed)(int32_t **samples, int16_t **matrix, int len); +} AC3DSPContext; + +void ff_ac3dsp_init(AC3DSPContext *c); +void ff_ac3dsp_init_aarch64(AC3DSPContext *c); +void ff_ac3dsp_init_arm(AC3DSPContext *c); +void ff_ac3dsp_init_x86(AC3DSPContext *c); +void ff_ac3dsp_init_mips(AC3DSPContext *c); +void ff_ac3dsp_init_riscv(AC3DSPContext *c); + +void ff_ac3dsp_downmix(AC3DSPContext *c, float **samples, float **matrix, + int out_ch, int in_ch, int len); +void ff_ac3dsp_downmix_fixed(AC3DSPContext *c, int32_t **samples, int16_t **matrix, + int out_ch, int in_ch, int len); + +void ff_ac3dsp_set_downmix_x86(AC3DSPContext *c); + +#endif /* AVCODEC_AC3DSP_H */ diff --git a/include/libavcodec/ac3enc.h b/include/libavcodec/ac3enc.h new file mode 100644 index 0000000..5e98ad1 --- /dev/null +++ b/include/libavcodec/ac3enc.h @@ -0,0 +1,287 @@ +/* + * AC-3 encoder & E-AC-3 encoder common header + * Copyright (c) 2000 Fabrice Bellard + * Copyright (c) 2006-2010 Justin Ruggles + * + * 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 + */ + +/** + * @file + * AC-3 encoder & E-AC-3 encoder common header + */ + +#ifndef AVCODEC_AC3ENC_H +#define AVCODEC_AC3ENC_H + +#include + +#include "libavutil/mem_internal.h" +#include "libavutil/opt.h" +#include "libavutil/tx.h" + +#include "ac3.h" +#include "ac3defs.h" +#include "ac3dsp.h" +#include "avcodec.h" +#include "codec_internal.h" +#include "mathops.h" +#include "me_cmp.h" +#include "audiodsp.h" + +#ifndef AC3ENC_FLOAT +#define AC3ENC_FLOAT 0 +#endif + +#if AC3ENC_FLOAT +#include "libavutil/float_dsp.h" +#define MAC_COEF(d,a,b) ((d)+=(a)*(b)) +#define COEF_MIN (-16777215.0/16777216.0) +#define COEF_MAX ( 16777215.0/16777216.0) +#define NEW_CPL_COORD_THRESHOLD 0.03 +typedef float SampleType; +typedef float CoefType; +typedef float CoefSumType; +#else +#include "libavutil/fixed_dsp.h" +#define MAC_COEF(d,a,b) MAC64(d,a,b) +#define COEF_MIN -16777215 +#define COEF_MAX 16777215 +#define NEW_CPL_COORD_THRESHOLD 503317 +typedef int32_t SampleType; +typedef int32_t CoefType; +typedef int64_t CoefSumType; +#endif + +/* common option values */ +#define AC3ENC_OPT_NONE -1 +#define AC3ENC_OPT_AUTO -1 +#define AC3ENC_OPT_OFF 0 +#define AC3ENC_OPT_ON 1 +#define AC3ENC_OPT_NOT_INDICATED 0 +#define AC3ENC_OPT_MODE_ON 2 +#define AC3ENC_OPT_MODE_OFF 1 +#define AC3ENC_OPT_DSUREX_DPLIIZ 3 + +/* specific option values */ +#define AC3ENC_OPT_LARGE_ROOM 1 +#define AC3ENC_OPT_SMALL_ROOM 2 +#define AC3ENC_OPT_DOWNMIX_LTRT 1 +#define AC3ENC_OPT_DOWNMIX_LORO 2 +#define AC3ENC_OPT_DOWNMIX_DPLII 3 // reserved value in A/52, but used by encoders to indicate DPL2 +#define AC3ENC_OPT_ADCONV_STANDARD 0 +#define AC3ENC_OPT_ADCONV_HDCD 1 + + +/** + * Encoding Options used by AVOption. + */ +typedef struct AC3EncOptions { + /* AC-3 metadata options*/ + int dialogue_level; + int bitstream_mode; + float center_mix_level; + float surround_mix_level; + int dolby_surround_mode; + int audio_production_info; + int mixing_level; + int room_type; + int copyright; + int original; + int extended_bsi_1; + int preferred_stereo_downmix; + float ltrt_center_mix_level; + float ltrt_surround_mix_level; + float loro_center_mix_level; + float loro_surround_mix_level; + int extended_bsi_2; + int dolby_surround_ex_mode; + int dolby_headphone_mode; + int ad_converter_type; + int eac3_mixing_metadata; + int eac3_info_metadata; + + /* other encoding options */ + int allow_per_frame_metadata; + int stereo_rematrixing; + int channel_coupling; + int cpl_start; +} AC3EncOptions; + +/** + * Data for a single audio block. + */ +typedef struct AC3Block { + CoefType *mdct_coef[AC3_MAX_CHANNELS]; ///< MDCT coefficients + int32_t *fixed_coef[AC3_MAX_CHANNELS]; ///< fixed-point MDCT coefficients + uint8_t *exp[AC3_MAX_CHANNELS]; ///< original exponents + uint8_t *grouped_exp[AC3_MAX_CHANNELS]; ///< grouped exponents + int16_t *psd[AC3_MAX_CHANNELS]; ///< psd per frequency bin + int16_t *band_psd[AC3_MAX_CHANNELS]; ///< psd per critical band + int16_t *mask[AC3_MAX_CHANNELS]; ///< masking curve + uint16_t *qmant[AC3_MAX_CHANNELS]; ///< quantized mantissas + uint8_t *cpl_coord_exp[AC3_MAX_CHANNELS]; ///< coupling coord exponents (cplcoexp) + uint8_t *cpl_coord_mant[AC3_MAX_CHANNELS]; ///< coupling coord mantissas (cplcomant) + uint8_t new_rematrixing_strategy; ///< send new rematrixing flags in this block + int num_rematrixing_bands; ///< number of rematrixing bands + uint8_t rematrixing_flags[4]; ///< rematrixing flags + int new_cpl_strategy; ///< send new coupling strategy + int cpl_in_use; ///< coupling in use for this block (cplinu) + uint8_t channel_in_cpl[AC3_MAX_CHANNELS]; ///< channel in coupling (chincpl) + int num_cpl_channels; ///< number of channels in coupling + uint8_t new_cpl_coords[AC3_MAX_CHANNELS]; ///< send new coupling coordinates (cplcoe) + uint8_t cpl_master_exp[AC3_MAX_CHANNELS]; ///< coupling coord master exponents (mstrcplco) + int new_snr_offsets; ///< send new SNR offsets + int new_cpl_leak; ///< send new coupling leak info + int end_freq[AC3_MAX_CHANNELS]; ///< end frequency bin (endmant) +} AC3Block; + +struct PutBitContext; + +/** + * AC-3 encoder private context. + */ +typedef struct AC3EncodeContext { + AVClass *av_class; ///< AVClass used for AVOption + AC3EncOptions options; ///< encoding options + AVCodecContext *avctx; ///< parent AVCodecContext + AudioDSPContext adsp; +#if AC3ENC_FLOAT + AVFloatDSPContext *fdsp; +#else + AVFixedDSPContext *fdsp; +#endif + MECmpContext mecc; + AC3DSPContext ac3dsp; ///< AC-3 optimized functions + AVTXContext *tx; ///< FFT context for MDCT calculation + av_tx_fn tx_fn; + + AC3Block blocks[AC3_MAX_BLOCKS]; ///< per-block info + + int fixed_point; ///< indicates if fixed-point encoder is being used + int eac3; ///< indicates if this is E-AC-3 vs. AC-3 + int bitstream_id; ///< bitstream id (bsid) + int bitstream_mode; ///< bitstream mode (bsmod) + + int bit_rate; ///< target bit rate, in bits-per-second + int sample_rate; ///< sampling frequency, in Hz + + int num_blks_code; ///< number of blocks code (numblkscod) + int num_blocks; ///< number of blocks per frame + int frame_size_min; ///< minimum frame size in case rounding is necessary + int frame_size; ///< current frame size in bytes + int frame_size_code; ///< frame size code (frmsizecod) + uint16_t crc_inv[2]; + int64_t bits_written; ///< bit count (used to avg. bitrate) + int64_t samples_written; ///< sample count (used to avg. bitrate) + + int fbw_channels; ///< number of full-bandwidth channels (nfchans) + int channels; ///< total number of channels (nchans) + int lfe_on; ///< indicates if there is an LFE channel (lfeon) + int lfe_channel; ///< channel index of the LFE channel + int has_center; ///< indicates if there is a center channel + int has_surround; ///< indicates if there are one or more surround channels + int channel_mode; ///< channel mode (acmod) + const uint8_t *channel_map; ///< channel map used to reorder channels + + int center_mix_level; ///< center mix level code + int surround_mix_level; ///< surround mix level code + int ltrt_center_mix_level; ///< Lt/Rt center mix level code + int ltrt_surround_mix_level; ///< Lt/Rt surround mix level code + int loro_center_mix_level; ///< Lo/Ro center mix level code + int loro_surround_mix_level; ///< Lo/Ro surround mix level code + + int cutoff; ///< user-specified cutoff frequency, in Hz + int bandwidth_code; ///< bandwidth code (0 to 60) (chbwcod) + int start_freq[AC3_MAX_CHANNELS]; ///< start frequency bin (strtmant) + int cpl_end_freq; ///< coupling channel end frequency bin + + int cpl_on; ///< coupling turned on for this frame + int cpl_enabled; ///< coupling enabled for all frames + int num_cpl_subbands; ///< number of coupling subbands (ncplsubnd) + int num_cpl_bands; ///< number of coupling bands (ncplbnd) + uint8_t cpl_band_sizes[AC3_MAX_CPL_BANDS]; ///< number of coeffs in each coupling band + + int rematrixing_enabled; ///< stereo rematrixing enabled + + /* bitrate allocation control */ + int slow_gain_code; ///< slow gain code (sgaincod) + int slow_decay_code; ///< slow decay code (sdcycod) + int fast_decay_code; ///< fast decay code (fdcycod) + int db_per_bit_code; ///< dB/bit code (dbpbcod) + int floor_code; ///< floor code (floorcod) + AC3BitAllocParameters bit_alloc; ///< bit allocation parameters + int coarse_snr_offset; ///< coarse SNR offsets (csnroffst) + int fast_gain_code[AC3_MAX_CHANNELS]; ///< fast gain codes (signal-to-mask ratio) (fgaincod) + int fine_snr_offset[AC3_MAX_CHANNELS]; ///< fine SNR offsets (fsnroffst) + int frame_bits_fixed; ///< number of non-coefficient bits for fixed parameters + int frame_bits; ///< all frame bits except exponents and mantissas + int exponent_bits; ///< number of bits used for exponents + + uint8_t *planar_samples[AC3_MAX_CHANNELS - 1]; + uint8_t *bap_buffer; + uint8_t *bap1_buffer; + CoefType *mdct_coef_buffer; + int32_t *fixed_coef_buffer; + uint8_t *exp_buffer; + uint8_t *grouped_exp_buffer; + int16_t *psd_buffer; + int16_t *band_psd_buffer; + int16_t *mask_buffer; + int16_t *qmant_buffer; + uint8_t *cpl_coord_buffer; + + uint8_t exp_strategy[AC3_MAX_CHANNELS][AC3_MAX_BLOCKS]; ///< exponent strategies + uint8_t frame_exp_strategy[AC3_MAX_CHANNELS]; ///< frame exp strategy index + int use_frame_exp_strategy; ///< indicates use of frame exp strategy + uint8_t exp_ref_block[AC3_MAX_CHANNELS][AC3_MAX_BLOCKS]; ///< reference blocks for EXP_REUSE + uint8_t *ref_bap [AC3_MAX_CHANNELS][AC3_MAX_BLOCKS]; ///< bit allocation pointers (bap) + int ref_bap_set; ///< indicates if ref_bap pointers have been set + + /** fixed vs. float function pointers */ + void (*encode_frame)(struct AC3EncodeContext *s, uint8_t * const *samples); + + /* AC-3 vs. E-AC-3 function pointers */ + void (*output_frame_header)(struct AC3EncodeContext *s, struct PutBitContext *pb); + + union { + DECLARE_ALIGNED(32, float, mdct_window_float)[AC3_BLOCK_SIZE]; + DECLARE_ALIGNED(32, int32_t, mdct_window_fixed)[AC3_BLOCK_SIZE]; + }; + union { + DECLARE_ALIGNED(32, float, windowed_samples_float)[AC3_WINDOW_SIZE]; + DECLARE_ALIGNED(32, int32_t, windowed_samples_fixed)[AC3_WINDOW_SIZE]; + }; +} AC3EncodeContext; + +extern const AVChannelLayout ff_ac3_ch_layouts[19]; +extern const AVOption ff_ac3_enc_options[]; +extern const AVClass ff_ac3enc_class; +extern const FFCodecDefault ff_ac3_enc_defaults[]; + +int ff_ac3_encode_init(AVCodecContext *avctx); +int ff_ac3_float_encode_init(AVCodecContext *avctx); + +int ff_ac3_encode_close(AVCodecContext *avctx); + + +void ff_ac3_compute_coupling_strategy(AC3EncodeContext *s); + +int ff_ac3_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, + const AVFrame *frame, int *got_packet_ptr); + +#endif /* AVCODEC_AC3ENC_H */ diff --git a/include/libavcodec/ac3tab.h b/include/libavcodec/ac3tab.h new file mode 100644 index 0000000..dcef643 --- /dev/null +++ b/include/libavcodec/ac3tab.h @@ -0,0 +1,56 @@ +/* + * AC-3 tables + * Copyright (c) 2000, 2001, 2002 Fabrice Bellard + * + * 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_AC3TAB_H +#define AVCODEC_AC3TAB_H + +#include + +#include "ac3defs.h" + +extern const uint16_t ff_ac3_frame_size_tab[38][3]; +extern const uint8_t ff_ac3_channels_tab[8]; +extern const uint16_t ff_ac3_channel_layout_tab[8]; +extern const uint8_t ff_ac3_dec_channel_map[8][2][6]; +extern const int ff_ac3_sample_rate_tab[]; +extern const uint16_t ff_ac3_bitrate_tab[19]; +extern const uint8_t ff_ac3_rematrix_band_tab[5]; +extern const uint8_t ff_eac3_default_cpl_band_struct[18]; +extern const uint8_t ff_ac3_bap_tab[64]; +extern const uint8_t ff_ac3_slow_decay_tab[4]; +extern const uint8_t ff_ac3_fast_decay_tab[4]; +extern const uint16_t ff_ac3_slow_gain_tab[4]; +extern const uint16_t ff_ac3_db_per_bit_tab[4]; +extern const int16_t ff_ac3_floor_tab[8]; +extern const uint16_t ff_ac3_fast_gain_tab[8]; +extern const uint8_t ff_ac3_band_start_tab[AC3_CRITICAL_BANDS+1]; +extern const uint8_t ff_ac3_bin_to_band_tab[253]; +extern const uint64_t ff_eac3_custom_channel_map_locations[16][2]; + +#define COMMON_CHANNEL_MAP \ + { { 0, 1, }, { 0, 1, 2, } },\ + { { 0, }, { 0, 1, } },\ + { { 0, 1, }, { 0, 1, 2, } },\ + { { 0, 2, 1, }, { 0, 2, 1, 3, } },\ + { { 0, 1, 2, }, { 0, 1, 3, 2, } },\ + { { 0, 2, 1, 3, }, { 0, 2, 1, 4, 3, } }, + +#endif /* AVCODEC_AC3TAB_H */ diff --git a/include/libavcodec/acelp_filters.h b/include/libavcodec/acelp_filters.h new file mode 100644 index 0000000..fe86cb2 --- /dev/null +++ b/include/libavcodec/acelp_filters.h @@ -0,0 +1,152 @@ +/* + * various filters for ACELP-based codecs + * + * Copyright (c) 2008 Vladimir Voroshilov + * + * 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_ACELP_FILTERS_H +#define AVCODEC_ACELP_FILTERS_H + +#include + +typedef struct ACELPFContext { + /** + * Floating point version of ff_acelp_interpolate() + */ + void (*acelp_interpolatef)(float *out, const float *in, + const float *filter_coeffs, int precision, + int frac_pos, int filter_length, int length); + + /** + * Apply an order 2 rational transfer function in-place. + * + * @param out output buffer for filtered speech samples + * @param in input buffer containing speech data (may be the same as out) + * @param zero_coeffs z^-1 and z^-2 coefficients of the numerator + * @param pole_coeffs z^-1 and z^-2 coefficients of the denominator + * @param gain scale factor for final output + * @param mem intermediate values used by filter (should be 0 initially) + * @param n number of samples (should be a multiple of eight) + */ + void (*acelp_apply_order_2_transfer_function)(float *out, const float *in, + const float zero_coeffs[2], + const float pole_coeffs[2], + float gain, + float mem[2], int n); + +}ACELPFContext; + +/** + * Initialize ACELPFContext. + */ +void ff_acelp_filter_init(ACELPFContext *c); +void ff_acelp_filter_init_mips(ACELPFContext *c); + +/** + * low-pass Finite Impulse Response filter coefficients. + * + * Hamming windowed sinc filter with cutoff freq 3/40 of the sampling freq, + * the coefficients are scaled by 2^15. + * This array only contains the right half of the filter. + * This filter is likely identical to the one used in G.729, though this + * could not be determined from the original comments with certainty. + */ +extern const int16_t ff_acelp_interp_filter[61]; + +/** + * Generic FIR interpolation routine. + * @param[out] out buffer for interpolated data + * @param in input data + * @param filter_coeffs interpolation filter coefficients (0.15) + * @param precision sub sample factor, that is the precision of the position + * @param frac_pos fractional part of position [0..precision-1] + * @param filter_length filter length + * @param length length of output + * + * filter_coeffs contains coefficients of the right half of the symmetric + * interpolation filter. filter_coeffs[0] should the central (unpaired) coefficient. + * See ff_acelp_interp_filter for an example. + */ +void ff_acelp_interpolate(int16_t* out, const int16_t* in, + const int16_t* filter_coeffs, int precision, + int frac_pos, int filter_length, int length); + +/** + * Floating point version of ff_acelp_interpolate() + */ +void ff_acelp_interpolatef(float *out, const float *in, + const float *filter_coeffs, int precision, + int frac_pos, int filter_length, int length); + + +/** + * high-pass filtering and upscaling (4.2.5 of G.729). + * @param[out] out output buffer for filtered speech data + * @param[in,out] hpf_f past filtered data from previous (2 items long) + * frames (-0x20000000 <= (14.13) < 0x20000000) + * @param in speech data to process + * @param length input data size + * + * out[i] = 0.93980581 * in[i] - 1.8795834 * in[i-1] + 0.93980581 * in[i-2] + + * 1.9330735 * out[i-1] - 0.93589199 * out[i-2] + * + * The filter has a cut-off frequency of 1/80 of the sampling freq + * + * @note Two items before the top of the in buffer must contain two items from the + * tail of the previous subframe. + * + * @remark It is safe to pass the same array in in and out parameters. + * + * @remark AMR uses mostly the same filter (cut-off frequency 60Hz, same formula, + * but constants differs in 5th sign after comma). Fortunately in + * fixed-point all coefficients are the same as in G.729. Thus this + * routine can be used for the fixed-point AMR decoder, too. + */ +void ff_acelp_high_pass_filter(int16_t* out, int hpf_f[2], + const int16_t* in, int length); + +/** + * Apply an order 2 rational transfer function in-place. + * + * @param out output buffer for filtered speech samples + * @param in input buffer containing speech data (may be the same as out) + * @param zero_coeffs z^-1 and z^-2 coefficients of the numerator + * @param pole_coeffs z^-1 and z^-2 coefficients of the denominator + * @param gain scale factor for final output + * @param mem intermediate values used by filter (should be 0 initially) + * @param n number of samples + */ +void ff_acelp_apply_order_2_transfer_function(float *out, const float *in, + const float zero_coeffs[2], + const float pole_coeffs[2], + float gain, + float mem[2], int n); + +/** + * Apply tilt compensation filter, 1 - tilt * z-1. + * + * @param mem pointer to the filter's state (one single float) + * @param tilt tilt factor + * @param samples array where the filter is applied + * @param size the size of the samples array + */ +void ff_tilt_compensation(float *mem, float tilt, float *samples, int size); + + +#endif /* AVCODEC_ACELP_FILTERS_H */ diff --git a/include/libavcodec/acelp_pitch_delay.h b/include/libavcodec/acelp_pitch_delay.h new file mode 100644 index 0000000..73fa3c3 --- /dev/null +++ b/include/libavcodec/acelp_pitch_delay.h @@ -0,0 +1,276 @@ +/* + * gain code, gain pitch and pitch delay decoding + * + * Copyright (c) 2008 Vladimir Voroshilov + * + * 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_ACELP_PITCH_DELAY_H +#define AVCODEC_ACELP_PITCH_DELAY_H + +#include + +#include "audiodsp.h" + +#define PITCH_DELAY_MIN 20 +#define PITCH_DELAY_MAX 143 + +/** + * @brief Decode pitch delay of the first subframe encoded by 8 bits with 1/3 + * resolution. + * @param ac_index adaptive codebook index (8 bits) + * + * @return pitch delay in 1/3 units + * + * Pitch delay is coded: + * with 1/3 resolution, 19 < pitch_delay < 85 + * integers only, 85 <= pitch_delay <= 143 + */ +static inline int ff_acelp_decode_8bit_to_1st_delay3(int ac_index) +{ + ac_index += 58; + if (ac_index > 254) + ac_index = 3 * ac_index - 510; + return ac_index; +} + +/** + * @brief Decode pitch delay of the second subframe encoded by 5 or 6 bits + * with 1/3 precision. + * @param ac_index adaptive codebook index (5 or 6 bits) + * @param pitch_delay_min lower bound (integer) of pitch delay interval + * for second subframe + * + * @return pitch delay in 1/3 units + * + * Pitch delay is coded: + * with 1/3 resolution, -6 < pitch_delay - int(prev_pitch_delay) < 5 + * + * @remark The routine is used in G.729 @@8k, AMR @@10.2k, AMR @@7.95k, + * AMR @@7.4k for the second subframe. + */ +static inline int ff_acelp_decode_5_6_bit_to_2nd_delay3(int ac_index, + int pitch_delay_min) +{ + return 3 * pitch_delay_min + ac_index - 2; +} + +/** + * @brief Decode pitch delay with 1/3 precision. + * @param ac_index adaptive codebook index (4 bits) + * @param pitch_delay_min lower bound (integer) of pitch delay interval for + * second subframe + * + * @return pitch delay in 1/3 units + * + * Pitch delay is coded: + * integers only, -6 < pitch_delay - int(prev_pitch_delay) <= -2 + * with 1/3 resolution, -2 < pitch_delay - int(prev_pitch_delay) < 1 + * integers only, 1 <= pitch_delay - int(prev_pitch_delay) < 5 + * + * @remark The routine is used in G.729 @@6.4k, AMR @@6.7k, AMR @@5.9k, + * AMR @@5.15k, AMR @@4.75k for the second subframe. + */ +static inline int ff_acelp_decode_4bit_to_2nd_delay3(int ac_index, + int pitch_delay_min) +{ + if (ac_index < 4) + return 3 * (ac_index + pitch_delay_min); + else if (ac_index < 12) + return 3 * pitch_delay_min + ac_index + 6; + else + return 3 * (ac_index + pitch_delay_min) - 18; +} + +/** + * @brief Decode pitch delay of the first subframe encoded by 9 bits + * with 1/6 precision. + * @param ac_index adaptive codebook index (9 bits) + * + * @return pitch delay in 1/6 units + * + * Pitch delay is coded: + * with 1/6 resolution, 17 < pitch_delay < 95 + * integers only, 95 <= pitch_delay <= 143 + * + * @remark The routine is used in AMR @@12.2k for the first and third subframes. + */ +static inline int ff_acelp_decode_9bit_to_1st_delay6(int ac_index) +{ + if (ac_index < 463) + return ac_index + 105; + else + return 6 * (ac_index - 368); +} + +/** + * @brief Decode pitch delay of the second subframe encoded by 6 bits + * with 1/6 precision. + * @param ac_index adaptive codebook index (6 bits) + * @param pitch_delay_min lower bound (integer) of pitch delay interval for + * second subframe + * + * @return pitch delay in 1/6 units + * + * Pitch delay is coded: + * with 1/6 resolution, -6 < pitch_delay - int(prev_pitch_delay) < 5 + * + * @remark The routine is used in AMR @@12.2k for the second and fourth subframes. + */ +static inline int ff_acelp_decode_6bit_to_2nd_delay6(int ac_index, + int pitch_delay_min) +{ + return 6 * pitch_delay_min + ac_index - 3; +} + +/** + * @brief Update past quantized energies + * @param[in,out] quant_energy past quantized energies (5.10) + * @param gain_corr_factor gain correction factor + * @param log2_ma_pred_order log2() of MA prediction order + * @param erasure frame erasure flag + * + * If frame erasure flag is not equal to zero, memory is updated with + * averaged energy, attenuated by 4dB: + * max(avg(quant_energy[i])-4, -14), i=0,ma_pred_order + * + * In normal mode memory is updated with + * Er - Ep = 20 * log10(gain_corr_factor) + * + * @remark The routine is used in G.729 and AMR (all modes). + */ +void ff_acelp_update_past_gain( + int16_t* quant_energy, + int gain_corr_factor, + int log2_ma_pred_order, + int erasure); + +/** + * @brief Decode the adaptive codebook gain and add + * correction (4.1.5 and 3.9.1 of G.729). + * @param adsp initialized audio DSP context + * @param gain_corr_factor gain correction factor (2.13) + * @param fc_v fixed-codebook vector (2.13) + * @param mr_energy mean innovation energy and fixed-point correction (7.13) + * @param[in,out] quant_energy past quantized energies (5.10) + * @param subframe_size length of subframe + * + * @return quantized fixed-codebook gain (14.1) + * + * The routine implements equations 69, 66 and 71 of the G.729 specification (3.9.1) + * + * Em - mean innovation energy (dB, constant, depends on decoding algorithm) + * Ep - mean-removed predicted energy (dB) + * Er - mean-removed innovation energy (dB) + * Ei - mean energy of the fixed-codebook contribution (dB) + * N - subframe_size + * M - MA (Moving Average) prediction order + * gc - fixed-codebook gain + * gc_p - predicted fixed-codebook gain + * + * Fixed codebook gain is computed using predicted gain gc_p and + * correction factor gain_corr_factor as shown below: + * + * gc = gc_p * gain_corr_factor + * + * The predicted fixed codebook gain gc_p is found by predicting + * the energy of the fixed-codebook contribution from the energy + * of previous fixed-codebook contributions. + * + * mean = 1/N * sum(i,0,N){ fc_v[i] * fc_v[i] } + * + * Ei = 10log(mean) + * + * Er = 10log(1/N * gc^2 * mean) - Em = 20log(gc) + Ei - Em + * + * Replacing Er with Ep and gc with gc_p we will receive: + * + * Ep = 10log(1/N * gc_p^2 * mean) - Em = 20log(gc_p) + Ei - Em + * + * and from above: + * + * gc_p = 10^((Ep - Ei + Em) / 20) + * + * Ep is predicted using past energies and prediction coefficients: + * + * Ep = sum(i,0,M){ ma_prediction_coeff[i] * quant_energy[i] } + * + * gc_p in fixed-point arithmetic is calculated as following: + * + * mean = 1/N * sum(i,0,N){ (fc_v[i] / 2^13) * (fc_v[i] / 2^13) } = + * = 1/N * sum(i,0,N) { fc_v[i] * fc_v[i] } / 2^26 + * + * Ei = 10log(mean) = -10log(N) - 10log(2^26) + + * + 10log(sum(i,0,N) { fc_v[i] * fc_v[i] }) + * + * Ep - Ei + Em = Ep + Em + 10log(N) + 10log(2^26) - + * - 10log(sum(i,0,N) { fc_v[i] * fc_v[i] }) = + * = Ep + mr_energy - 10log(sum(i,0,N) { fc_v[i] * fc_v[i] }) + * + * gc_p = 10 ^ ((Ep - Ei + Em) / 20) = + * = 2 ^ (3.3219 * (Ep - Ei + Em) / 20) = 2 ^ (0.166 * (Ep - Ei + Em)) + * + * where + * + * mr_energy = Em + 10log(N) + 10log(2^26) + * + * @remark The routine is used in G.729 and AMR (all modes). + */ +int16_t ff_acelp_decode_gain_code( + AudioDSPContext *adsp, + int gain_corr_factor, + const int16_t* fc_v, + int mr_energy, + const int16_t* quant_energy, + const int16_t* ma_prediction_coeff, + int subframe_size, + int max_pred_order); + +/** + * Calculate fixed gain (part of section 6.1.3 of AMR spec) + * + * @param fixed_gain_factor gain correction factor + * @param fixed_mean_energy mean decoded algebraic codebook vector energy + * @param prediction_error vector of the quantified predictor errors of + * the four previous subframes. It is updated by this function. + * @param energy_mean desired mean innovation energy + * @param pred_table table of four moving average coefficients + */ +float ff_amr_set_fixed_gain(float fixed_gain_factor, float fixed_mean_energy, + float *prediction_error, float energy_mean, + const float *pred_table); + + +/** + * Decode the adaptive codebook index to the integer and fractional parts + * of the pitch lag for one subframe at 1/3 fractional precision. + * + * The choice of pitch lag is described in 3GPP TS 26.090 section 5.6.1. + * + * @param lag_int integer part of pitch lag of the current subframe + * @param lag_frac fractional part of pitch lag of the current subframe + * @param pitch_index parsed adaptive codebook (pitch) index + * @param prev_lag_int integer part of pitch lag for the previous subframe + * @param subframe current subframe number + * @param third_as_first treat the third frame the same way as the first + */ +void ff_decode_pitch_lag(int *lag_int, int *lag_frac, int pitch_index, + const int prev_lag_int, const int subframe, + int third_as_first, int resolution); + +#endif /* AVCODEC_ACELP_PITCH_DELAY_H */ diff --git a/include/libavcodec/acelp_vectors.h b/include/libavcodec/acelp_vectors.h new file mode 100644 index 0000000..c2587c5 --- /dev/null +++ b/include/libavcodec/acelp_vectors.h @@ -0,0 +1,287 @@ +/* + * adaptive and fixed codebook vector operations for ACELP-based codecs + * + * Copyright (c) 2008 Vladimir Voroshilov + * + * 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_ACELP_VECTORS_H +#define AVCODEC_ACELP_VECTORS_H + +#include + +typedef struct ACELPVContext { + /** + * float implementation of weighted sum of two vectors. + * @param[out] out result of addition + * @param in_a first vector + * @param in_b second vector + * @param weight_coeff_a first vector weight coefficient + * @param weight_coeff_a second vector weight coefficient + * @param length vectors length (should be a multiple of two) + * + * @note It is safe to pass the same buffer for out and in_a or in_b. + */ + void (*weighted_vector_sumf)(float *out, const float *in_a, const float *in_b, + float weight_coeff_a, float weight_coeff_b, + int length); + +}ACELPVContext; + +/** + * Initialize ACELPVContext. + */ +void ff_acelp_vectors_init(ACELPVContext *c); +void ff_acelp_vectors_init_mips(ACELPVContext *c); + +/** Sparse representation for the algebraic codebook (fixed) vector */ +typedef struct AMRFixed { + int n; + int x[10]; + float y[10]; + int no_repeat_mask; + int pitch_lag; + float pitch_fac; +} AMRFixed; + +/** + * Track|Pulse| Positions + * ------------------------------------------------------------------------- + * 1 | 0 | 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75 + * ------------------------------------------------------------------------- + * 2 | 1 | 1, 6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, 61, 66, 71, 76 + * ------------------------------------------------------------------------- + * 3 | 2 | 2, 7, 12, 17, 22, 27, 32, 37, 42, 47, 52, 57, 62, 67, 72, 77 + * ------------------------------------------------------------------------- + * + * Table contains only first the pulse indexes. + * + * Used in G.729 @@8k, G.729 @@4.4k, AMR @@7.95k, AMR @@7.40k + */ +extern const uint8_t ff_fc_4pulses_8bits_tracks_13[16]; + +/** + * Track|Pulse| Positions + * ------------------------------------------------------------------------- + * 4 | 3 | 3, 8, 13, 18, 23, 28, 33, 38, 43, 48, 53, 58, 63, 68, 73, 78 + * | | 4, 9, 14, 19, 24, 29, 34, 39, 44, 49, 54, 59, 64, 69, 74, 79 + * ------------------------------------------------------------------------- + * + * @remark Track in the table should be read top-to-bottom, left-to-right. + * + * Used in G.729 @@8k, G.729 @@4.4k, AMR @@7.95k, AMR @@7.40k + */ +extern const uint8_t ff_fc_4pulses_8bits_track_4[32]; + +/** + * Track|Pulse| Positions + * ----------------------------------------- + * 1 | 0 | 1, 6, 11, 16, 21, 26, 31, 36 + * | | 3, 8, 13, 18, 23, 28, 33, 38 + * ----------------------------------------- + * + * @remark Track in the table should be read top-to-bottom, left-to-right. + * + * @note (EE) Reference G.729D code also uses gray decoding for each + * pulse index before looking up the value in the table. + * + * Used in G.729 @@6.4k (with gray coding), AMR @@5.9k (without gray coding) + */ +extern const uint8_t ff_fc_2pulses_9bits_track1_gray[16]; + +/** + * Track|Pulse| Positions + * ----------------------------------------- + * 2 | 1 | 0, 7, 14, 20, 27, 34, 1, 21 + * | | 2, 9, 15, 22, 29, 35, 6, 26 + * | | 4,10, 17, 24, 30, 37, 11, 31 + * | | 5,12, 19, 25, 32, 39, 16, 36 + * ----------------------------------------- + * + * @remark Track in the table should be read top-to-bottom, left-to-right. + * + * @note (EE.1) This table (from the reference code) does not comply with + * the specification. + * The specification contains the following table: + * + * Track|Pulse| Positions + * ----------------------------------------- + * 2 | 1 | 0, 5, 10, 15, 20, 25, 30, 35 + * | | 1, 6, 11, 16, 21, 26, 31, 36 + * | | 2, 7, 12, 17, 22, 27, 32, 37 + * | | 4, 9, 14, 19, 24, 29, 34, 39 + * + * ----------------------------------------- + * + * @note (EE.2) Reference G.729D code also uses gray decoding for each + * pulse index before looking up the value in the table. + * + * Used in G.729 @@6.4k (with gray coding) + */ +extern const uint8_t ff_fc_2pulses_9bits_track2_gray[32]; + +/** + * b60 hamming windowed sinc function coefficients + */ +extern const float ff_b60_sinc[61]; + +/** + * Table of pow(0.7,n) + */ +extern const float ff_pow_0_7[10]; + +/** + * Table of pow(0.75,n) + */ +extern const float ff_pow_0_75[10]; + +/** + * Table of pow(0.55,n) + */ +extern const float ff_pow_0_55[10]; + +/** + * Decode fixed-codebook vector (3.8 and D.5.8 of G.729, 5.7.1 of AMR). + * @param[out] fc_v decoded fixed codebook vector (2.13) + * @param tab1 table used for first pulse_count pulses + * @param tab2 table used for last pulse + * @param pulse_indexes fixed codebook indexes + * @param pulse_signs signs of the excitation pulses (0 bit value + * means negative sign) + * @param bits number of bits per one pulse index + * @param pulse_count number of pulses decoded using first table + * @param bits length of one pulse index in bits + * + * Used in G.729 @@8k, G.729 @@4.4k, G.729 @@6.4k, AMR @@7.95k, AMR @@7.40k + */ +void ff_acelp_fc_pulse_per_track(int16_t* fc_v, + const uint8_t *tab1, + const uint8_t *tab2, + int pulse_indexes, + int pulse_signs, + int pulse_count, + int bits); + +/** + * Decode the algebraic codebook index to pulse positions and signs and + * construct the algebraic codebook vector for MODE_12k2. + * + * @note: The positions and signs are explicitly coded in MODE_12k2. + * + * @param fixed_index positions of the ten pulses + * @param fixed_sparse pointer to the algebraic codebook vector + * @param gray_decode gray decoding table + * @param half_pulse_count number of couples of pulses + * @param bits length of one pulse index in bits + */ +void ff_decode_10_pulses_35bits(const int16_t *fixed_index, + AMRFixed *fixed_sparse, + const uint8_t *gray_decode, + int half_pulse_count, int bits); + + +/** + * weighted sum of two vectors with rounding. + * @param[out] out result of addition + * @param in_a first vector + * @param in_b second vector + * @param weight_coeff_a first vector weight coefficient + * @param weight_coeff_a second vector weight coefficient + * @param rounder this value will be added to the sum of the two vectors + * @param shift result will be shifted to right by this value + * @param length vectors length + * + * @note It is safe to pass the same buffer for out and in_a or in_b. + * + * out[i] = (in_a[i]*weight_a + in_b[i]*weight_b + rounder) >> shift + */ +void ff_acelp_weighted_vector_sum(int16_t* out, + const int16_t *in_a, + const int16_t *in_b, + int16_t weight_coeff_a, + int16_t weight_coeff_b, + int16_t rounder, + int shift, + int length); + +/** + * float implementation of weighted sum of two vectors. + * @param[out] out result of addition + * @param in_a first vector + * @param in_b second vector + * @param weight_coeff_a first vector weight coefficient + * @param weight_coeff_a second vector weight coefficient + * @param length vectors length + * + * @note It is safe to pass the same buffer for out and in_a or in_b. + */ +void ff_weighted_vector_sumf(float *out, const float *in_a, const float *in_b, + float weight_coeff_a, float weight_coeff_b, + int length); + +/** + * Adaptive gain control (as used in AMR postfiltering) + * + * @param out output buffer for filtered speech data + * @param in the input speech buffer (may be the same as out) + * @param speech_energ input energy + * @param size the input buffer size + * @param alpha exponential filter factor + * @param gain_mem a pointer to the filter memory (single float of size) + */ +void ff_adaptive_gain_control(float *out, const float *in, float speech_energ, + int size, float alpha, float *gain_mem); + +/** + * Set the sum of squares of a signal by scaling + * + * @param out output samples + * @param in input samples + * @param sum_of_squares new sum of squares + * @param n number of samples + * + * @note If the input is zero (or its energy underflows), the output is zero. + * This is the behavior of AGC in the AMR reference decoder. The QCELP + * reference decoder seems to have undefined behavior. + * + * TIA/EIA/IS-733 2.4.8.3-2/3/4/5, 2.4.8.6 + * 3GPP TS 26.090 6.1 (6) + */ +void ff_scale_vector_to_given_sum_of_squares(float *out, const float *in, + float sum_of_squares, const int n); + +/** + * Add fixed vector to an array from a sparse representation + * + * @param out fixed vector with pitch sharpening + * @param in sparse fixed vector + * @param scale number to multiply the fixed vector by + * @param size the output vector size + */ +void ff_set_fixed_vector(float *out, const AMRFixed *in, float scale, int size); + +/** + * Clear array values set by set_fixed_vector + * + * @param out fixed vector to be cleared + * @param in sparse fixed vector + * @param size the output vector size + */ +void ff_clear_fixed_vector(float *out, const AMRFixed *in, int size); + +#endif /* AVCODEC_ACELP_VECTORS_H */ diff --git a/include/libavcodec/adpcm.h b/include/libavcodec/adpcm.h new file mode 100644 index 0000000..0ffc3da --- /dev/null +++ b/include/libavcodec/adpcm.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2001-2003 The FFmpeg project + * + * 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 + */ + +/** + * @file + * ADPCM encoder/decoder common header. + */ + +#ifndef AVCODEC_ADPCM_H +#define AVCODEC_ADPCM_H + +#include + +typedef struct ADPCMChannelStatus { + int predictor; + int16_t step_index; + int step; + /* for encoding */ + int prev_sample; + + /* MS version */ + int sample1; + int sample2; + int coeff1; + int coeff2; + int idelta; +} ADPCMChannelStatus; + +int16_t ff_adpcm_argo_expand_nibble(ADPCMChannelStatus *cs, int nibble, int shift, int flag); + +#endif /* AVCODEC_ADPCM_H */ diff --git a/include/libavcodec/adpcm_data.h b/include/libavcodec/adpcm_data.h new file mode 100644 index 0000000..7dec649 --- /dev/null +++ b/include/libavcodec/adpcm_data.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2001-2003 The FFmpeg project + * + * 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 + */ + +/** + * @file + * ADPCM tables + */ + +#ifndef AVCODEC_ADPCM_DATA_H +#define AVCODEC_ADPCM_DATA_H + +#include + +static const uint8_t ff_adpcm_ima_block_sizes[4] = { 4, 12, 4, 20 }; +static const uint8_t ff_adpcm_ima_block_samples[4] = { 16, 32, 8, 32 }; + +extern const int8_t ff_adpcm_index_table[16]; +extern const int16_t ff_adpcm_step_table[89]; +extern const int16_t ff_adpcm_AdaptationTable[]; +extern const uint8_t ff_adpcm_AdaptCoeff1[]; +extern const int8_t ff_adpcm_AdaptCoeff2[]; +extern const int16_t ff_adpcm_yamaha_indexscale[]; +extern const int8_t ff_adpcm_yamaha_difflookup[]; + +#endif /* AVCODEC_ADPCM_DATA_H */ diff --git a/include/libavcodec/adts_header.h b/include/libavcodec/adts_header.h new file mode 100644 index 0000000..49bb74e --- /dev/null +++ b/include/libavcodec/adts_header.h @@ -0,0 +1,79 @@ +/* + * AAC ADTS header decoding prototypes and structures + * Copyright (c) 2003 Fabrice Bellard + * Copyright (c) 2003 Michael Niedermayer + * + * 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_ADTS_HEADER_H +#define AVCODEC_ADTS_HEADER_H + +#include "adts_parser.h" +#include "defs.h" + +typedef enum { + AAC_PARSE_ERROR_SYNC = -0x1030c0a, + AAC_PARSE_ERROR_SAMPLE_RATE = -0x3030c0a, + AAC_PARSE_ERROR_FRAME_SIZE = -0x4030c0a, +} AACParseError; + +typedef struct AACADTSHeaderInfo { + uint32_t sample_rate; + uint32_t samples; + uint32_t bit_rate; + uint8_t crc_absent; + uint8_t object_type; + uint8_t sampling_index; + uint8_t chan_config; + uint8_t num_aac_frames; + uint32_t frame_length; +} AACADTSHeaderInfo; + +struct GetBitContext; + +/** + * Parse the ADTS frame header to the end of the variable header, which is + * the first 54 bits. + * @param[in] gbc BitContext containing the first 54 bits of the frame. + * @param[out] hdr Pointer to struct where header info is written. + * @return the size in bytes of the header parsed on success and + * AAC_PARSE_ERROR_* values otherwise. + */ +int ff_adts_header_parse(struct GetBitContext *gbc, AACADTSHeaderInfo *hdr); + +/** + * Wrapper around ff_adts_header_parse() for users that don't already have + * a suitable GetBitContext. + */ +int ff_adts_header_parse_buf(const uint8_t buf[AV_AAC_ADTS_HEADER_SIZE + AV_INPUT_BUFFER_PADDING_SIZE], + AACADTSHeaderInfo *hdr); + +/** + * Parse the ADTS frame header contained in the buffer, which is + * the first 54 bits. + * @param[in] buf Pointer to buffer containing the first 54 bits of the frame. + * @param[in] size Size of buffer containing the first 54 bits of the frame. + * @param[out] phdr Pointer to pointer to struct AACADTSHeaderInfo for which + * memory is allocated and header info is written into it. After using the header + * information, the allocated memory must be freed by using av_free. + * @return 0 on success, AAC_PARSE_ERROR_* values on invalid input and + * ordinary AVERROR codes otherwise. + */ +int avpriv_adts_header_parse(AACADTSHeaderInfo **phdr, const uint8_t *buf, size_t size); + +#endif /* AVCODEC_ADTS_HEADER_H */ diff --git a/include/libavcodec/adx.h b/include/libavcodec/adx.h new file mode 100644 index 0000000..60ce07a --- /dev/null +++ b/include/libavcodec/adx.h @@ -0,0 +1,64 @@ +/* + * ADX ADPCM codecs + * Copyright (c) 2001,2003 BERO + * + * 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 + */ + +/** + * @file + * SEGA CRI adx codecs. + * + * Reference documents: + * http://ku-www.ss.titech.ac.jp/~yatsushi/adx.html + * adx2wav & wav2adx http://www.geocities.co.jp/Playtown/2004/ + */ + +#ifndef AVCODEC_ADX_H +#define AVCODEC_ADX_H + +typedef struct ADXChannelState { + int s1,s2; +} ADXChannelState; + +#define MAX_CHANNELS 6 + +typedef struct ADXContext { + int channels; + ADXChannelState prev[MAX_CHANNELS]; + int header_parsed; + int eof; + int cutoff; + int coeff[2]; +} ADXContext; + +#define COEFF_BITS 12 + +#define BLOCK_SIZE 18 +#define BLOCK_SAMPLES 32 + +/** + * Calculate LPC coefficients based on cutoff frequency and sample rate. + * + * @param cutoff cutoff frequency + * @param sample_rate sample rate + * @param bits number of bits used to quantize coefficients + * @param[out] coeff 2 quantized LPC coefficients + */ +void ff_adx_calculate_coeffs(int cutoff, int sample_rate, int bits, int *coeff); + +#endif /* AVCODEC_ADX_H */ diff --git a/include/libavcodec/alac_data.h b/include/libavcodec/alac_data.h new file mode 100644 index 0000000..8020746 --- /dev/null +++ b/include/libavcodec/alac_data.h @@ -0,0 +1,48 @@ +/* + * ALAC encoder and decoder common data + * + * 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_ALAC_DATA_H +#define AVCODEC_ALAC_DATA_H + +#include + +#include "libavutil/channel_layout.h" + +enum AlacRawDataBlockType { + /* At the moment, only SCE, CPE, LFE, and END are recognized. */ + TYPE_SCE, + TYPE_CPE, + TYPE_CCE, + TYPE_LFE, + TYPE_DSE, + TYPE_PCE, + TYPE_FIL, + TYPE_END +}; + +#define ALAC_MAX_CHANNELS 8 + +extern const uint8_t ff_alac_channel_layout_offsets[ALAC_MAX_CHANNELS][ALAC_MAX_CHANNELS]; + +extern const AVChannelLayout ff_alac_ch_layouts[ALAC_MAX_CHANNELS + 1]; + +extern const enum AlacRawDataBlockType ff_alac_channel_elements[ALAC_MAX_CHANNELS][5]; + +#endif /* AVCODEC_ALAC_DATA_H */ diff --git a/include/libavcodec/alacdsp.h b/include/libavcodec/alacdsp.h new file mode 100644 index 0000000..489ebc6 --- /dev/null +++ b/include/libavcodec/alacdsp.h @@ -0,0 +1,35 @@ +/* + * 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_ALACDSP_H +#define AVCODEC_ALACDSP_H + +#include + +typedef struct ALACDSPContext { + void (*decorrelate_stereo)(int32_t *buffer[2], int nb_samples, + int decorr_shift, int decorr_left_weight); + void (*append_extra_bits[2])(int32_t *buffer[2], int32_t *extra_bits_buffer[2], + int extra_bits, int channels, int nb_samples); +} ALACDSPContext; + +void ff_alacdsp_init(ALACDSPContext *c); +void ff_alacdsp_init_riscv(ALACDSPContext *c); +void ff_alacdsp_init_x86(ALACDSPContext *c); + +#endif /* AVCODEC_ALACDSP_H */ diff --git a/include/libavcodec/amfenc.h b/include/libavcodec/amfenc.h new file mode 100644 index 0000000..d985d01 --- /dev/null +++ b/include/libavcodec/amfenc.h @@ -0,0 +1,187 @@ +/* +* 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_AMFENC_H +#define AVCODEC_AMFENC_H + +#include + +#include +#include +#include +#include + +#include "libavutil/fifo.h" + +#include "avcodec.h" +#include "hwconfig.h" + +#define MAX_LOOKAHEAD_DEPTH 41 + +/** +* AMF trace writer callback class +* Used to capture all AMF logging +*/ + +typedef struct AmfTraceWriter { + AMFTraceWriterVtbl *vtbl; + AVCodecContext *avctx; +} AmfTraceWriter; + +/** +* AMF encoder context +*/ + +typedef struct AmfContext { + AVClass *avclass; + // access to AMF runtime + amf_handle library; ///< handle to DLL library + AMFFactory *factory; ///< pointer to AMF factory + AMFDebug *debug; ///< pointer to AMF debug interface + AMFTrace *trace; ///< pointer to AMF trace interface + + amf_uint64 version; ///< version of AMF runtime + AmfTraceWriter tracer; ///< AMF writer registered with AMF + AMFContext *context; ///< AMF context + //encoder + AMFComponent *encoder; ///< AMF encoder object + amf_bool eof; ///< flag indicating EOF happened + AMF_SURFACE_FORMAT format; ///< AMF surface format + + AVBufferRef *hw_device_ctx; ///< pointer to HW accelerator (decoder) + AVBufferRef *hw_frames_ctx; ///< pointer to HW accelerator (frame allocator) + + int hwsurfaces_in_queue; + int hwsurfaces_in_queue_max; + + // helpers to handle async calls + int delayed_drain; + AMFSurface *delayed_surface; + AVFrame *delayed_frame; + + // shift dts back by max_b_frames in timing + AVFifo *timestamp_list; + int64_t dts_delay; + + // common encoder option options + + int log_to_dbg; + + // Static options, have to be set before Init() call + int usage; + int profile; + int level; + int latency; + int preencode; + int quality; + int b_frame_delta_qp; + int ref_b_frame_delta_qp; + + // Dynamic options, can be set after Init() call + + int rate_control_mode; + int enforce_hrd; + int filler_data; + int enable_vbaq; + int skip_frame; + int qp_i; + int qp_p; + int qp_b; + int max_au_size; + int header_spacing; + int b_frame_ref; + int intra_refresh_mb; + int coding_mode; + int me_half_pel; + int me_quarter_pel; + int aud; + int max_consecutive_b_frames; + int max_b_frames; + int qvbr_quality_level; + int hw_high_motion_quality_boost; + + // HEVC - specific options + + int gops_per_idr; + int header_insertion_mode; + int min_qp_i; + int max_qp_i; + int min_qp_p; + int max_qp_p; + int tier; + + // AV1 - specific options + + enum AMF_VIDEO_ENCODER_AV1_ALIGNMENT_MODE_ENUM align; + enum AMF_VIDEO_ENCODER_AV1_AQ_MODE_ENUM aq_mode; + + // Preanalysis - specific options + + int preanalysis; + int pa_activity_type; + int pa_scene_change_detection; + int pa_scene_change_detection_sensitivity; + int pa_static_scene_detection; + int pa_static_scene_detection_sensitivity; + int pa_initial_qp; + int pa_max_qp; + int pa_caq_strength; + int pa_frame_sad; + int pa_ltr; + int pa_lookahead_buffer_depth; + int pa_paq_mode; + int pa_taq_mode; + int pa_high_motion_quality_boost_mode; + int pa_adaptive_mini_gop; + + +} AmfContext; + +extern const AVCodecHWConfigInternal *const ff_amfenc_hw_configs[]; + +/** +* Common encoder initization function +*/ +int ff_amf_encode_init(AVCodecContext *avctx); +/** +* Common encoder termination function +*/ +int ff_amf_encode_close(AVCodecContext *avctx); + +/** +* Ecoding one frame - common function for all AMF encoders +*/ +int ff_amf_receive_packet(AVCodecContext *avctx, AVPacket *avpkt); + +/** +* Supported formats +*/ +extern const enum AVPixelFormat ff_amf_pix_fmts[]; + +int ff_amf_get_color_profile(AVCodecContext *avctx); + +/** +* Error handling helper +*/ +#define AMF_RETURN_IF_FALSE(avctx, exp, ret_value, /*message,*/ ...) \ + if (!(exp)) { \ + av_log(avctx, AV_LOG_ERROR, __VA_ARGS__); \ + return ret_value; \ + } + +#endif //AVCODEC_AMFENC_H diff --git a/include/libavcodec/amr.h b/include/libavcodec/amr.h new file mode 100644 index 0000000..727f8c3 --- /dev/null +++ b/include/libavcodec/amr.h @@ -0,0 +1,70 @@ +/* + * Shared functions between AMR codecs + * + * Copyright (c) 2010 Marcelo Galvao Povoa + * + * 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_AMR_H +#define AVCODEC_AMR_H + +#include + +#include "avcodec.h" + +#ifdef AMR_USE_16BIT_TABLES +typedef uint16_t R_TABLE_TYPE; +#else +typedef uint8_t R_TABLE_TYPE; +#endif + +/** + * Fill the frame structure variables from bitstream by parsing the + * given reordering table that uses the following format: + * + * Each field (16 bits) in the AMR Frame is stored as: + * - one byte for the number of bits in the field + * - one byte for the field index + * - then, one byte for each bit of the field (from most-significant to least) + * of the position of that bit in the AMR frame. + * + * @param out pointer to the frame struct + * @param size the size in bytes of the frame struct + * @param data input bitstream after the frame header + * @param ord_table the reordering table as above + */ +static inline void ff_amr_bit_reorder(uint16_t *out, int size, + const uint8_t *data, + const R_TABLE_TYPE *ord_table) +{ + int field_size; + + memset(out, 0, size); + while ((field_size = *ord_table++)) { + int field = 0; + int field_offset = *ord_table++; + while (field_size--) { + int bit = *ord_table++; + field <<= 1; + field |= data[bit >> 3] >> (bit & 7) & 1; + } + out[field_offset >> 1] = field; + } +} + +#endif /* AVCODEC_AMR_H */ diff --git a/include/libavcodec/amrnbdata.h b/include/libavcodec/amrnbdata.h new file mode 100644 index 0000000..20b7a64 --- /dev/null +++ b/include/libavcodec/amrnbdata.h @@ -0,0 +1,1666 @@ +/* + * AMR narrowband data and definitions + * Copyright (c) 2006-2007 Robert Swain + * Copyright (c) 2009 Colin McQuillan + * + * 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 + */ + + +/** + * @file + * AMR narrowband data and definitions + */ + +#ifndef AVCODEC_AMRNBDATA_H +#define AVCODEC_AMRNBDATA_H + +#include + +#include "libavutil/common.h" /* offsetof */ + +#define AMR_SUBFRAME_SIZE 40 ///< samples per subframe + +/** Frame type (Table 1a in 3GPP TS 26.101) */ +enum Mode { + MODE_4k75 = 0, ///< 4.75 kbit/s + MODE_5k15, ///< 5.15 kbit/s + MODE_5k9, ///< 5.90 kbit/s + MODE_6k7, ///< 6.70 kbit/s + MODE_7k4, ///< 7.40 kbit/s + MODE_7k95, ///< 7.95 kbit/s + MODE_10k2, ///< 10.2 kbit/s + MODE_12k2, ///< 12.2 kbit/s + MODE_DTX, ///< silent frame + N_MODES, ///< number of modes + NO_DATA = 15 ///< no transmission +}; + +#define LP_FILTER_ORDER 10 ///< linear predictive coding filter order + +/** + * AMRNB unpacked data subframe + */ +typedef struct AMRNBSubframe { + uint16_t p_lag; ///< index to decode the pitch lag + uint16_t p_gain; ///< index to decode the pitch gain + uint16_t fixed_gain; ///< index to decode the fixed gain factor, for MODE_12k2 and MODE_7k95 + uint16_t pulses[10]; ///< pulses: 10 for MODE_12k2, 7 for MODE_10k2, and index and sign for others +} AMRNBSubframe; + +/** + * AMRNB unpacked data frame + */ +typedef struct AMRNBFrame { + uint16_t lsf[5]; ///< lsf parameters: 5 parameters for MODE_12k2, only 3 for other modes + AMRNBSubframe subframe[4]; ///< unpacked data for each subframe +} AMRNBFrame; + +/** The index of a frame parameter */ +#define AMR_BIT(field) (offsetof(AMRNBFrame, field)) +/** The index of a subframe-specific parameter */ +#define AMR_OF(frame_num, variable) AMR_BIT(subframe[frame_num].variable) + +// The following order* tables are used to convert AMR frame parameters to and +// from a bitstream. See 3GPP TS 26.101 for more information. +// Each field in AMRNBFrame is stored as: +// * one byte for the number of bits in the field +// * one byte for the field index +// * then, one byte for each bit of the field (from most-significant to least) +// of the position of that bit in the AMR frame. +static const uint8_t order_MODE_4k75[] = { + 8, AMR_BIT(lsf[0]), 7, 6, 5, 4, 3, 2, 1, 0, + 8, AMR_BIT(lsf[1]), 15, 14, 13, 12, 11, 10, 9, 8, + 7, AMR_BIT(lsf[2]), 51, 35, 34, 50, 33, 49, 32, + 8, AMR_OF(0,p_lag), 23, 22, 21, 20, 19, 18, 43, 42, + 8, AMR_OF(0,p_gain), 54, 55, 40, 41, 24, 25, 26, 27, + 7, AMR_OF(0,pulses[0]), 92, 68, 67, 84, 66, 65, 80, + 2, AMR_OF(0,pulses[1]), 53, 52, + 4, AMR_OF(1,p_lag), 17, 16, 48, 63, + 7, AMR_OF(1,pulses[0]), 91, 64, 79, 83, 78, 77, 95, + 2, AMR_OF(1,pulses[1]), 62, 61, + 4, AMR_OF(2,p_lag), 31, 30, 60, 59, + 8, AMR_OF(2,p_gain), 44, 45, 46, 47, 36, 37, 38, 39, + 7, AMR_OF(2,pulses[0]), 90, 76, 75, 82, 74, 73, 94, + 2, AMR_OF(2,pulses[1]), 58, 57, + 4, AMR_OF(3,p_lag), 29, 28, 56, 71, + 7, AMR_OF(3,pulses[0]), 89, 72, 87, 81, 86, 85, 93, + 2, AMR_OF(3,pulses[1]), 70, 69, + 0 +}; + +static const uint8_t order_MODE_5k15[] = { + 8, AMR_BIT(lsf[0]), 0, 1, 2, 3, 4, 5, 6, 7, + 8, AMR_BIT(lsf[1]), 8, 9, 10, 11, 12, 13, 14, 15, + 7, AMR_BIT(lsf[2]), 70, 51, 43, 71, 50, 60, 49, + 8, AMR_OF(0,p_lag), 23, 22, 21, 20, 19, 47, 54, 59, + 6, AMR_OF(0,p_gain), 48, 42, 35, 29, 30, 31, + 7, AMR_OF(0,pulses[0]), 92, 84, 82, 100, 79, 72, 88, + 2, AMR_OF(0,pulses[1]), 67, 68, + 4, AMR_OF(1,p_lag), 18, 46, 53, 58, + 6, AMR_OF(1,p_gain), 63, 41, 34, 26, 27, 28, + 7, AMR_OF(1,pulses[0]), 91, 83, 81, 99, 78, 87, 103, + 2, AMR_OF(1,pulses[1]), 65, 66, + 4, AMR_OF(2,p_lag), 17, 45, 52, 57, + 6, AMR_OF(2,p_gain), 62, 40, 33, 39, 24, 25, + 7, AMR_OF(2,pulses[0]), 90, 80, 95, 98, 77, 86, 102, + 2, AMR_OF(2,pulses[1]), 75, 64, + 4, AMR_OF(3,p_lag), 16, 44, 56, 69, + 6, AMR_OF(3,p_gain), 61, 55, 32, 36, 37, 38, + 7, AMR_OF(3,pulses[0]), 89, 94, 93, 97, 76, 85, 101, + 2, AMR_OF(3,pulses[1]), 73, 74, + 0 +}; + +static const uint8_t order_MODE_5k9[] = { + 8, AMR_BIT(lsf[0]), 7, 6, 0, 3, 5, 4, 2, 1, + 9, AMR_BIT(lsf[1]), 13, 12, 8, 11, 10, 15, 9, 14, 23, + 9, AMR_BIT(lsf[2]), 71, 56, 60, 70, 59, 57, 58, 69, 76, + 8, AMR_OF(0,p_lag), 16, 18, 22, 20, 30, 38, 44, 42, + 6, AMR_OF(0,p_gain), 75, 48, 52, 40, 34, 26, + 9, AMR_OF(0,pulses[0]), 101, 89, 93, 117, 105, 81, 85, 109, 97, + 2, AMR_OF(0,pulses[1]), 67, 78, + 4, AMR_OF(1,p_lag), 28, 36, 46, 87, + 6, AMR_OF(1,p_gain), 74, 63, 51, 55, 33, 25, + 9, AMR_OF(1,pulses[0]), 100, 88, 92, 116, 104, 80, 84, 108, 96, + 2, AMR_OF(1,pulses[1]), 64, 79, + 8, AMR_OF(2,p_lag), 31, 17, 21, 19, 29, 37, 43, 41, + 6, AMR_OF(2,p_gain), 73, 62, 50, 54, 32, 24, + 9, AMR_OF(2,pulses[0]), 99, 103, 91, 115, 119, 95, 83, 107, 111, + 2, AMR_OF(2,pulses[1]), 66, 77, + 4, AMR_OF(3,p_lag), 27, 35, 45, 86, + 6, AMR_OF(3,p_gain), 72, 61, 49, 53, 47, 39, + 9, AMR_OF(3,pulses[0]), 98, 102, 90, 114, 118, 94, 82, 106, 110, + 2, AMR_OF(3,pulses[1]), 65, 68, + 0 +}; + +static const uint8_t order_MODE_6k7[] = { + 8, AMR_BIT(lsf[0]), 7, 6, 15, 4, 5, 3, 2, 0, + 9, AMR_BIT(lsf[1]), 14, 13, 8, 12, 10, 1, 9, 11, 29, + 9, AMR_BIT(lsf[2]), 57, 58, 50, 56, 60, 59, 49, 71, 70, + 8, AMR_OF(0,p_lag), 17, 19, 23, 21, 31, 24, 32, 52, + 7, AMR_OF(0,p_gain), 36, 82, 69, 46, 42, 48, 77, + 11, AMR_OF(0,pulses[0]), 109, 97, 133, 121, 101, 89, 125, 113, 93, 117, + 105, + 3, AMR_OF(0,pulses[1]), 81, 73, 65, + 4, AMR_OF(1,p_lag), 28, 26, 38, 54, + 7, AMR_OF(1,p_gain), 35, 83, 68, 45, 41, 63, 76, + 11, AMR_OF(1,pulses[0]), 108, 96, 132, 120, 100, 88, 124, 112, 92, 116, + 104, + 3, AMR_OF(1,pulses[1]), 80, 72, 64, + 8, AMR_OF(2,p_lag), 16, 18, 22, 20, 30, 39, 47, 51, + 7, AMR_OF(2,p_gain), 34, 84, 67, 44, 40, 62, 75, + 11, AMR_OF(2,pulses[0]), 107, 111, 131, 135, 99, 103, 123, 127, 91, 115, + 119, + 3, AMR_OF(2,pulses[1]), 95, 87, 79, + 4, AMR_OF(3,p_lag), 27, 25, 37, 53, + 7, AMR_OF(3,p_gain), 33, 85, 66, 43, 55, 61, 74, + 11, AMR_OF(3,pulses[0]), 106, 110, 130, 134, 98, 102, 122, 126, 90, 114, + 118, + 3, AMR_OF(3,pulses[1]), 94, 86, 78, + 0 +}; + +static const uint8_t order_MODE_7k4[] = { + 8, AMR_BIT(lsf[0]), 7, 6, 5, 4, 3, 2, 1, 0, + 9, AMR_BIT(lsf[1]), 15, 14, 13, 12, 11, 10, 9, 8, 23, + 9, AMR_BIT(lsf[2]), 53, 52, 51, 58, 40, 55, 54, 57, 56, + 8, AMR_OF(0,p_lag), 22, 20, 18, 16, 30, 50, 95, 94, + 7, AMR_OF(0,p_gain), 28, 24, 73, 36, 32, 62, 67, + 13, AMR_OF(0,pulses[0]), 127, 123, 135, 131, 143, 139, 151, 103, 102, 101, + 100, 99, 98, + 4, AMR_OF(0,pulses[1]), 83, 75, 79, 71, + 5, AMR_OF(1,p_lag), 44, 42, 49, 93, 92, + 7, AMR_OF(1,p_gain), 27, 39, 72, 35, 47, 61, 66, + 13, AMR_OF(1,pulses[0]), 126, 122, 134, 130, 142, 138, 150, 97, 96, 111, + 110, 109, 108, + 4, AMR_OF(1,pulses[1]), 82, 74, 78, 70, + 8, AMR_OF(2,p_lag), 21, 19, 17, 31, 29, 48, 91, 90, + 7, AMR_OF(2,p_gain), 26, 38, 87, 34, 46, 60, 65, + 13, AMR_OF(2,pulses[0]), 125, 121, 133, 129, 141, 137, 149, 107, 106, 105, + 104, 119, 118, + 4, AMR_OF(2,pulses[1]), 81, 85, 77, 69, + 5, AMR_OF(3,p_lag), 43, 41, 63, 89, 88, + 7, AMR_OF(3,p_gain), 25, 37, 86, 33, 45, 59, 64, + 13, AMR_OF(3,pulses[0]), 124, 120, 132, 128, 140, 136, 148, 117, 116, 115, + 114, 113, 112, + 4, AMR_OF(3,pulses[1]), 80, 84, 76, 68, + 0 +}; + +static const uint8_t order_MODE_7k95[] = { + 9, AMR_BIT(lsf[0]), 67, 68, 1, 2, 3, 4, 5, 6, 7, + 9, AMR_BIT(lsf[1]), 14, 13, 9, 12, 11, 0, 10, 15, 8, + 9, AMR_BIT(lsf[2]), 18, 19, 23, 17, 22, 20, 21, 66, 65, + 8, AMR_OF(0,p_lag), 44, 42, 40, 54, 52, 56, 64, 78, + 4, AMR_OF(0,p_gain), 36, 32, 72, 80, + 5, AMR_OF(0,fixed_gain), 16, 28, 24, 60, 84, + 13, AMR_OF(0,pulses[0]), 135, 109, 144, 156, 120, 97, 148, 121, 101, 122, + 123, 89, 124, + 4, AMR_OF(0,pulses[1]), 125, 126, 127, 112, + 6, AMR_OF(1,p_lag), 50, 48, 62, 70, 76, 74, + 4, AMR_OF(1,p_gain), 35, 47, 87, 95, + 5, AMR_OF(1,fixed_gain), 31, 27, 39, 59, 83, + 13, AMR_OF(1,pulses[0]), 129, 108, 159, 155, 130, 96, 147, 131, 100, 132, + 133, 88, 134, + 4, AMR_OF(1,pulses[1]), 113, 114, 115, 116, + 8, AMR_OF(2,p_lag), 43, 41, 55, 53, 51, 71, 79, 77, + 4, AMR_OF(2,p_gain), 34, 46, 86, 94, + 5, AMR_OF(2,fixed_gain), 30, 26, 38, 58, 82, + 13, AMR_OF(2,pulses[0]), 139, 107, 158, 154, 140, 111, 146, 141, 99, 142, + 143, 103, 128, + 4, AMR_OF(2,pulses[1]), 105, 90, 91, 92, + 6, AMR_OF(3,p_lag), 49, 63, 61, 69, 75, 73, + 4, AMR_OF(3,p_gain), 33, 45, 85, 93, + 5, AMR_OF(3,fixed_gain), 29, 25, 37, 57, 81, + 13, AMR_OF(3,pulses[0]), 149, 106, 157, 153, 150, 110, 145, 151, 98, 136, + 137, 102, 138, + 4, AMR_OF(3,pulses[1]), 117, 118, 119, 104, + 0 +}; + +static const uint8_t order_MODE_10k2[] = { + 8, AMR_BIT(lsf[0]), 0, 1, 2, 3, 4, 5, 6, 7, + 9, AMR_BIT(lsf[1]), 23, 8, 9, 10, 11, 12, 13, 14, 15, + 9, AMR_BIT(lsf[2]), 57, 58, 62, 56, 60, 59, 61, 71, 70, + 8, AMR_OF(0,p_lag), 22, 21, 20, 19, 18, 17, 42, 41, + 7, AMR_OF(0,p_gain), 38, 50, 84, 37, 36, 85, 83, + 1, AMR_OF(0,pulses[0]), 66, + 1, AMR_OF(0,pulses[1]), 67, + 1, AMR_OF(0,pulses[2]), 68, + 1, AMR_OF(0,pulses[3]), 69, + 10, AMR_OF(0,pulses[4]), 145, 144, 156, 153, 154, 163, 161, 192, 206, 195, + 10, AMR_OF(0,pulses[5]), 158, 159, 157, 152, 155, 165, 160, 205, 204, 194, + 7, AMR_OF(0,pulses[6]), 167, 166, 162, 164, 196, 207, 193, + 5, AMR_OF(1,p_lag), 26, 25, 54, 53, 89, + 7, AMR_OF(1,p_gain), 35, 49, 81, 34, 33, 82, 80, + 1, AMR_OF(1,pulses[0]), 78, + 1, AMR_OF(1,pulses[1]), 79, + 1, AMR_OF(1,pulses[2]), 64, + 1, AMR_OF(1,pulses[3]), 65, + 10, AMR_OF(1,pulses[4]), 103, 102, 98, 111, 96, 105, 119, 185, 199, 188, + 10, AMR_OF(1,pulses[5]), 100, 101, 99, 110, 97, 107, 118, 198, 197, 187, + 7, AMR_OF(1,pulses[6]), 109, 108, 104, 106, 189, 184, 186, + 8, AMR_OF(2,p_lag), 16, 31, 30, 29, 28, 27, 40, 55, + 7, AMR_OF(2,p_gain), 32, 48, 94, 47, 46, 95, 93, + 1, AMR_OF(2,pulses[0]), 74, + 1, AMR_OF(2,pulses[1]), 75, + 1, AMR_OF(2,pulses[2]), 76, + 1, AMR_OF(2,pulses[3]), 77, + 10, AMR_OF(2,pulses[4]), 117, 116, 112, 125, 126, 135, 133, 178, 176, 181, + 10, AMR_OF(2,pulses[5]), 114, 115, 113, 124, 127, 121, 132, 191, 190, 180, + 7, AMR_OF(2,pulses[6]), 123, 122, 134, 120, 182, 177, 179, + 5, AMR_OF(3,p_lag), 24, 39, 52, 51, 88, + 7, AMR_OF(3,p_gain), 45, 63, 91, 44, 43, 92, 90, + 1, AMR_OF(3,pulses[0]), 86, + 1, AMR_OF(3,pulses[1]), 87, + 1, AMR_OF(3,pulses[2]), 72, + 1, AMR_OF(3,pulses[3]), 73, + 10, AMR_OF(3,pulses[4]), 131, 130, 142, 139, 140, 149, 147, 171, 169, 174, + 10, AMR_OF(3,pulses[5]), 128, 129, 143, 138, 141, 151, 146, 168, 183, 173, + 7, AMR_OF(3,pulses[6]), 137, 136, 148, 150, 175, 170, 172, + 0 +}; + +static const uint8_t order_MODE_12k2[] = { + 7, AMR_BIT(lsf[0]), 7, 6, 5, 4, 3, 2, 1, + 8, AMR_BIT(lsf[1]), 0, 15, 14, 13, 12, 11, 10, 9, + 9, AMR_BIT(lsf[2]), 23, 22, 21, 20, 19, 18, 17, 16, 8, + 8, AMR_BIT(lsf[3]), 31, 30, 29, 28, 27, 86, 85, 84, + 6, AMR_BIT(lsf[4]), 83, 82, 81, 80, 127, 126, + 9, AMR_OF(0,p_lag), 26, 24, 38, 36, 34, 32, 46, 44, 42, + 4, AMR_OF(0,p_gain), 40, 52, 48, 95, + 5, AMR_OF(0,fixed_gain), 60, 56, 68, 91, 111, + 3, AMR_OF(0,pulses[0]), 191, 176, 177, + 4, AMR_OF(0,pulses[1]), 103, 123, 124, 125, + 3, AMR_OF(0,pulses[2]), 188, 189, 190, + 4, AMR_OF(0,pulses[3]), 99, 120, 121, 122, + 3, AMR_OF(0,pulses[4]), 185, 186, 187, + 4, AMR_OF(0,pulses[5]), 107, 133, 134, 135, + 3, AMR_OF(0,pulses[6]), 198, 199, 184, + 4, AMR_OF(0,pulses[7]), 119, 130, 131, 132, + 3, AMR_OF(0,pulses[8]), 195, 196, 197, + 4, AMR_OF(0,pulses[9]), 115, 143, 128, 129, + 6, AMR_OF(1,p_lag), 64, 78, 76, 74, 72, 245, + 4, AMR_OF(1,p_gain), 55, 51, 63, 94, + 5, AMR_OF(1,fixed_gain), 59, 71, 67, 90, 110, + 3, AMR_OF(1,pulses[0]), 192, 193, 194, + 4, AMR_OF(1,pulses[1]), 102, 140, 141, 142, + 3, AMR_OF(1,pulses[2]), 205, 206, 207, + 4, AMR_OF(1,pulses[3]), 98, 137, 138, 139, + 3, AMR_OF(1,pulses[4]), 202, 203, 204, + 4, AMR_OF(1,pulses[5]), 106, 150, 151, 136, + 3, AMR_OF(1,pulses[6]), 215, 200, 201, + 4, AMR_OF(1,pulses[7]), 118, 147, 148, 149, + 3, AMR_OF(1,pulses[8]), 212, 213, 214, + 4, AMR_OF(1,pulses[9]), 114, 144, 145, 146, + 9, AMR_OF(2,p_lag), 25, 39, 37, 35, 33, 47, 45, 43, 41, + 4, AMR_OF(2,p_gain), 54, 50, 62, 93, + 5, AMR_OF(2,fixed_gain), 58, 70, 66, 89, 109, + 3, AMR_OF(2,pulses[0]), 209, 210, 211, + 4, AMR_OF(2,pulses[1]), 101, 157, 158, 159, + 3, AMR_OF(2,pulses[2]), 222, 223, 208, + 4, AMR_OF(2,pulses[3]), 97, 154, 155, 156, + 3, AMR_OF(2,pulses[4]), 219, 220, 221, + 4, AMR_OF(2,pulses[5]), 105, 167, 152, 153, + 3, AMR_OF(2,pulses[6]), 216, 217, 218, + 4, AMR_OF(2,pulses[7]), 117, 164, 165, 166, + 3, AMR_OF(2,pulses[8]), 229, 230, 231, + 4, AMR_OF(2,pulses[9]), 113, 161, 162, 163, + 6, AMR_OF(3,p_lag), 79, 77, 75, 73, 87, 244, + 4, AMR_OF(3,p_gain), 53, 49, 61, 92, + 5, AMR_OF(3,fixed_gain), 57, 69, 65, 88, 108, + 3, AMR_OF(3,pulses[0]), 226, 227, 228, + 4, AMR_OF(3,pulses[1]), 100, 174, 175, 160, + 3, AMR_OF(3,pulses[2]), 239, 224, 225, + 4, AMR_OF(3,pulses[3]), 96, 171, 172, 173, + 3, AMR_OF(3,pulses[4]), 236, 237, 238, + 4, AMR_OF(3,pulses[5]), 104, 168, 169, 170, + 3, AMR_OF(3,pulses[6]), 233, 234, 235, + 4, AMR_OF(3,pulses[7]), 116, 181, 182, 183, + 3, AMR_OF(3,pulses[8]), 246, 247, 232, + 4, AMR_OF(3,pulses[9]), 112, 178, 179, 180, + 0 +}; + +/** + * position of the bitmapping data for each packet type in + * the AMRNBFrame + */ +static const uint8_t * const amr_unpacking_bitmaps_per_mode[N_MODES] = { + order_MODE_4k75, + order_MODE_5k15, + order_MODE_5k9, + order_MODE_6k7, + order_MODE_7k4, + order_MODE_7k95, + order_MODE_10k2, + order_MODE_12k2, +}; + +/** number of bytes for each mode */ +static const uint8_t frame_sizes_nb[N_MODES] = { + 12, 13, 15, 17, 19, 20, 26, 31, 5 +}; + +/** + * Base-5 representation for values 0-124 + * + * This is useful for decoding pulse positions in 10.2 kbit/s frames. + * Safe values are provided for out of range positions 125-127. + */ +static const uint8_t base_five_table[128][3] = { + {0, 0, 0}, {0, 0, 1}, {0, 0, 2}, {0, 0, 3}, {0, 0, 4}, {0, 1, 0}, {0, 1, 1}, + {0, 1, 2}, {0, 1, 3}, {0, 1, 4}, {0, 2, 0}, {0, 2, 1}, {0, 2, 2}, {0, 2, 3}, + {0, 2, 4}, {0, 3, 0}, {0, 3, 1}, {0, 3, 2}, {0, 3, 3}, {0, 3, 4}, {0, 4, 0}, + {0, 4, 1}, {0, 4, 2}, {0, 4, 3}, {0, 4, 4}, {1, 0, 0}, {1, 0, 1}, {1, 0, 2}, + {1, 0, 3}, {1, 0, 4}, {1, 1, 0}, {1, 1, 1}, {1, 1, 2}, {1, 1, 3}, {1, 1, 4}, + {1, 2, 0}, {1, 2, 1}, {1, 2, 2}, {1, 2, 3}, {1, 2, 4}, {1, 3, 0}, {1, 3, 1}, + {1, 3, 2}, {1, 3, 3}, {1, 3, 4}, {1, 4, 0}, {1, 4, 1}, {1, 4, 2}, {1, 4, 3}, + {1, 4, 4}, {2, 0, 0}, {2, 0, 1}, {2, 0, 2}, {2, 0, 3}, {2, 0, 4}, {2, 1, 0}, + {2, 1, 1}, {2, 1, 2}, {2, 1, 3}, {2, 1, 4}, {2, 2, 0}, {2, 2, 1}, {2, 2, 2}, + {2, 2, 3}, {2, 2, 4}, {2, 3, 0}, {2, 3, 1}, {2, 3, 2}, {2, 3, 3}, {2, 3, 4}, + {2, 4, 0}, {2, 4, 1}, {2, 4, 2}, {2, 4, 3}, {2, 4, 4}, {3, 0, 0}, {3, 0, 1}, + {3, 0, 2}, {3, 0, 3}, {3, 0, 4}, {3, 1, 0}, {3, 1, 1}, {3, 1, 2}, {3, 1, 3}, + {3, 1, 4}, {3, 2, 0}, {3, 2, 1}, {3, 2, 2}, {3, 2, 3}, {3, 2, 4}, {3, 3, 0}, + {3, 3, 1}, {3, 3, 2}, {3, 3, 3}, {3, 3, 4}, {3, 4, 0}, {3, 4, 1}, {3, 4, 2}, + {3, 4, 3}, {3, 4, 4}, {4, 0, 0}, {4, 0, 1}, {4, 0, 2}, {4, 0, 3}, {4, 0, 4}, + {4, 1, 0}, {4, 1, 1}, {4, 1, 2}, {4, 1, 3}, {4, 1, 4}, {4, 2, 0}, {4, 2, 1}, + {4, 2, 2}, {4, 2, 3}, {4, 2, 4}, {4, 3, 0}, {4, 3, 1}, {4, 3, 2}, {4, 3, 3}, + {4, 3, 4}, {4, 4, 0}, {4, 4, 1}, {4, 4, 2}, {4, 4, 3}, {4, 4, 4}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0} +}; + +/** + * Values for the lsp vector from the 4th subframe of the + * previous subframe values. + * + * @note: Taken from Decoder_amr_reset in Q15 using val/1000 + */ +static const int8_t lsp_sub4_init[LP_FILTER_ORDER] = { + 30, 26, 21, 15, 8, 0, -8, -15, -21, -26 +}; + +/** + * Mean lsp values. + * + * @note: Taken from Decoder_amr_reset in Q15 + */ +static const int16_t lsp_avg_init[LP_FILTER_ORDER] = { + 1384, 2077, 3420, 5108, 6742, 8122, 9863, 11092, 12714, 13701 +}; + +// LSF tables + +// These are stored as integers to save space. The values are taken from +// q_plsf_3.tab and q_plsf_5.tab in 3GPP TS 26.090. + +static const int16_t lsf_3_3_MODE_5k15[128][4] = { +{ 419, 163, -30, -262}, { -455, -789,-1430, -721}, { 1006, 664, 269, 25}, +{ 619, 260, 183, 96}, { -968,-1358, -388, 135}, { -693, 835, 456, 154}, +{ 1105, 703, 569, 363}, { 1625, 1326, 985, 748}, { -220, 219, 76, -208}, +{-1455,-1662, 49, 149}, { -964, -172, -752, -336}, { 625, 209, -250, -66}, +{-1017, -838, -2, 317}, {-2168,-1485, -138, 123}, {-1876,-2099, -521, 85}, +{ -967, -366, -695, -881}, { -921,-1011, -763, -949}, { -124, -256, -352, -660}, +{ 178, 463, 354, 304}, {-1744, -591, -282, 79}, {-2249, 175, 867, 499}, +{ -138, -180, -181, -21}, {-2291,-1241, -460, -520}, { -771, 451, -10, -308}, +{ 271, -65, 4, 214}, { -279, -435, -43, -348}, { -670, 35, -65, -211}, +{ 806, 535, 85, 297}, { 57, 239, 722, 493}, { 225, 661, 840, 547}, +{ -540, -376, 14, 349}, { 469, 721, 331, 162}, { -544, -752, -62, -10}, +{ 398, -88, 724, 701}, { -19, -533, -94, 601}, { 136, -71, -681, -747}, +{ -166, -344, 261, -50}, { 161, -52, 485, 337}, {-1675, 50, 190, -93}, +{-2282, -231, -194, -82}, { -95, -595, -154, 128}, { 894, 501, 588, 457}, +{ -345, 206, 122, 110}, { -631, -227, -569, 3}, { 408, 239, 397, 226}, +{ -197, -2, 128, 491}, { 1281, 904, 292, 215}, { 538, 306, 259, 509}, +{ -677,-1047, 13, 321}, { -679, -588, -358, -212}, { -558, 243, 646, 479}, +{ 486, 342, 634, 532}, { 107, 802, 331, 136}, { -112, -398,-1031, -286}, +{ -326, -705, 288, 272}, { 1299, 1144, 1178, 860}, { -423, 121, -385, -148}, +{ -295, -302, -834, -819}, { 16, -24, -201, -476}, { 555, 91, -245, 294}, +{ -38, -379, -962,-1221}, {-1191,-1518, -273, -395}, { -390,-1013, -645, 573}, +{-1843,-1030, 505, 468}, { 744, 947, 609, 493}, { -689,-1172, -628, -135}, +{-1026, 195, 411, 196}, { 1582, 1147, 575, 337}, {-1239, -777, -648, -142}, +{ 595, 825, 967, 735}, {-1206, -970, -81, -342}, { -745, 13, -72, 375}, +{ 454, 19, 1407, 921}, {-1647, -172, 861, 562}, { 928, 1537, 1063, 740}, +{-2472, -952, 264, 82}, { -502, -965,-1334, 123}, { 867, 1236, 534, 171}, +{-2320, -460, 780, 363}, {-1190, -617, 252, -61}, { -174, 34, 1011, 788}, +{-2333, 247, 423, 153}, { -16, -355, 262, 449}, {-1576,-1073, -544, -371}, +{ -615, -305, 1051, 805}, { 687, 528, 6, -182}, { 935, 875, 1002, 809}, +{ 199, 257, 126, 76}, { -584,-1138, 599, 556}, {-1105,-1391,-1591, -519}, +{ -977,-1325, 108, 347}, { -722, -975, 365, 101}, { -145, 681, 249, -153}, +{ 0, -334, -570, 159}, { 412, 285, -336, -617}, { -953, -966, 887, 689}, +{-1251, 84, -185, -398}, { -592, 433, 1044, 653}, { 85, 329, -40, 361}, +{ -433, -705, 466, 574}, { -154, 654, 592, 290}, { -167, 72, 349, 175}, +{ 674, 297, 977, 720}, { 1235, 1204, 757, 488}, { -400, -269, 538, 372}, +{-1350,-1387,-1194, -91}, { 1262, 876, 775, 700}, { -599, -38, -430, -722}, +{ 1976, 1630, 991, 608}, { 111, 276, -226, -96}, { -947, -388, -11, -7}, +{ -303, -531, -839, 338}, { 1734, 1710, 1405, 1013}, { -516, -855, -645, 210}, +{ -688, -416, 513, 230}, { -822, -637,-1146, -320}, { -952, -658, -694, 183}, +{ -114, -623, 818, 674}, { -191, -204, 731, 635}, { 51, 1221, 883, 576}, +{ -954, -431, 826, 598}, { -342, -755, -900, -407}, {-1126, -354, -206, -512}, +{ -547, -810, -357, -620}, { 66, 515, -73, -410}, { -872, -945,-1444,-1227}, +{ 191, -17, -544, -231}, {-1540, -544, -901, -886} +}; + +static const int16_t lsf_3_1_MODE_7k95[512][3] = { +{ -890,-1550,-2541}, { -819, -970, 175}, { -826,-1234, -762}, +{ -599, -22, 634}, { -811, -987, -902}, { -323, 203, 26}, +{ -383, -235, -781}, { -399, 1262, 906}, { -932,-1399,-1380}, +{ -624, 93, 87}, { -414, -539, -691}, { 37, 633, 510}, +{ -387, -476,-1330}, { 399, 66, 263}, { -407, -49, -335}, +{ -417, 1041, 1865}, { -779,-1089,-1440}, { -746, -858, 832}, +{ -581, -759, -371}, { -673, -506, 2088}, { -560, -634,-1179}, +{ 271, 241, 14}, { -438, -244, -397}, { 463, 1202, 1047}, +{ -606, -797,-1438}, { -51, -323, 481}, { -224, -584, -527}, +{ 494, 881, 682}, { -433, -306,-1002}, { 554, 659, 222}, +{ 171, -160, -353}, { 681, 1798, 1565}, { -852,-1181,-1695}, +{ -336, -666, 114}, { -581, -756, -744}, { -195, 375, 497}, +{ -465, -804,-1098}, { 154, 282, -131}, { -50, -191, -719}, +{ 323, 732, 1542}, { -722, -819,-1404}, { 105, -250, 185}, +{ -178, -502, -742}, { 321, 510, 1111}, { -323, -567, -966}, +{ 127, 484, 338}, { -160, 52, -338}, { 732, 1367, 1554}, +{ -626, -802,-1696}, { -286, -586, 676}, { -695, -343, -370}, +{ -490, 295, 1893}, { -630, -574,-1014}, { -80, 645, -69}, +{ -6, -318, -364}, { 782, 1450, 1038}, { -313, -733,-1395}, +{ 120, 60, 477}, { -264, -585, -123}, { 711, 1245, 633}, +{ -91, -355,-1016}, { 771, 758, 261}, { 253, 81, -474}, +{ 930, 2215, 1720}, { -808,-1099,-1925}, { -560, -782, 169}, +{ -804,-1074, -188}, { -626, -55, 1405}, { -694, -716,-1194}, +{ -660, 354, 329}, { -514, -55, -543}, { 366, 1033, 1182}, +{ -658, -959,-1357}, { -55, -184, 93}, { -605, -286, -662}, +{ 404, 449, 827}, { -286, -350,-1263}, { 628, 306, 227}, +{ -16, 147, -623}, { 186, 923, 2146}, { -674, -890,-1606}, +{ -443, -228, 339}, { -369, -790, -409}, { 231, 86, 1469}, +{ -448, -581,-1061}, { 594, 450, -177}, { -124, -170, -447}, +{ 671, 1159, 1404}, { -476, -667,-1511}, { -77, -138, 716}, +{ -177, -372, -381}, { 451, 934, 915}, { -250, -432, -822}, +{ 272, 828, 446}, { 26, 19, -31}, { 698, 1692, 2168}, +{ -646, -977,-1924}, { -179, -473, 268}, { -379, -745, -691}, +{ 11, 127, 1033}, { -488, -917, -825}, { 61, 323, 135}, +{ 147, -145, -686}, { 685, 786, 1682}, { -506, -848,-1297}, +{ 35, 90, 222}, { -23, -346, -670}, { 455, 591, 1287}, +{ -203, -593,-1086}, { 652, 352, 437}, { 39, 63, -457}, +{ 841, 1265, 2105}, { -520, -882,-1584}, { -328, -711, 1421}, +{ -596, -342, -70}, { 209, 173, 1928}, { -423, -598, -921}, +{ 421, 605, -38}, { -2, -245, -127}, { 896, 1969, 1135}, +{ -379, -518,-1579}, { 173, 118, 753}, { -55, -381, -52}, +{ 985, 1021, 753}, { -2, -291, -891}, { 753, 992, 423}, +{ 264, 131, -196}, { 895, 2274, 2543}, { -635,-1088,-2499}, +{ -529, -982, 526}, { -764, -830, -548}, { -436, 316, 599}, +{ -675, -940, -746}, { -57, 236, -11}, { -201, -81, -798}, +{ 16, 845, 1558}, { -737, -985,-1212}, { -468, 17, 290}, +{ -279, -584, -700}, { 183, 822, 705}, { -265, -492,-1187}, +{ 421, 152, 468}, { -390, 166, -268}, { 39, 1550, 1868}, +{ -635, -966,-1571}, { -453, -492, 910}, { -284,-1027, -75}, +{ -181, -133, 1852}, { -445, -624,-1174}, { 420, 367, -49}, +{ -389, -212, -169}, { 707, 1073, 1208}, { -539, -710,-1449}, +{ 83, -163, 484}, { -236, -543, -355}, { 338, 1175, 814}, +{ -246, -309, -958}, { 606, 760, 60}, { 166, -8, -163}, +{ -306, 1849, 2563}, { -747,-1025,-1783}, { -419, -446, 209}, +{ -718, -566, -534}, { -506, 693, 857}, { -463, -697,-1082}, +{ 325, 431, -206}, { -15, -8, -763}, { 545, 919, 1518}, +{ -611, -783,-1313}, { 256, -55, 208}, { -165, -348, -662}, +{ 321, 680, 930}, { -326, -429, -951}, { 484, 446, 570}, +{ -197, 72, -73}, { 909, 1455, 1741}, { -563, -737,-1974}, +{ -124, -416, 718}, { -478, -404, -314}, { -16, 446, 1636}, +{ -551, -537, -750}, { -58, 638, 214}, { 55, -185, -271}, +{ 1148, 1301, 1212}, { -483, -671,-1264}, { 117, 285, 543}, +{ -204, -391, -111}, { 513, 1538, 854}, { -114, -190, -978}, +{ 877, 595, 464}, { 260, 260, -311}, { 748, 2283, 2216}, +{ -517, -945,-2171}, { -326, -708, 378}, { -812, -691, -232}, +{ -560, 687, 1409}, { -732, -690, -836}, { -359, 645, 386}, +{ -265, 62, -678}, { 145, 1644, 1208}, { -555, -988,-1233}, +{ -78, 14, 114}, { -327, -358, -489}, { 392, 677, 697}, +{ -201, -236,-1140}, { 693, 449, 178}, { -243, 256, -433}, +{ 611, 1385, 2456}, { -612, -901,-1464}, { -307, -17, 499}, +{ -315, -667, -254}, { 256, 428, 1463}, { -486, -422,-1056}, +{ 655, 370, 18}, { -102, -185, -276}, { 755, 1578, 1335}, +{ -488, -603,-1418}, { 182, -93, 870}, { -73, -458, -348}, +{ 835, 862, 957}, { -282, -333, -746}, { 547, 839, 428}, +{ 273, -89, 13}, { 940, 1708, 2576}, { -418,-1084,-1758}, +{ -44, -358, 259}, { -497, -643, -560}, { 99, 557, 961}, +{ -421, -766, -917}, { 295, 326, 184}, { 175, 15, -626}, +{ 532, 878, 1981}, { -443, -768,-1275}, { 221, 156, 268}, +{ 39, -363, -505}, { 695, 772, 1140}, { -162, -459, -912}, +{ 709, 444, 658}, { 25, 303, -312}, { 1268, 1410, 1715}, +{ -297, -766,-1836}, { -263, -108, 1070}, { -406, -13, -129}, +{ 57, 438, 2734}, { -374, -487, -835}, { 304, 696, 164}, +{ 104, -235, 5}, { 1611, 1900, 1399}, { -229, -582,-1325}, +{ 405, 192, 817}, { -87, -438, 111}, { 1028, 1199, 993}, +{ 68, -175, -934}, { 1033, 1117, 451}, { 478, 200, -248}, +{ 2127, 2696, 2042}, { -835,-1323,-2131}, { -799, -692, 466}, +{ -812,-1032, -469}, { -622, 288, 920}, { -701, -841,-1070}, +{ -411, 512, 8}, { -390, -91, -744}, { -30, 1043, 1161}, +{ -822,-1148,-1156}, { -294, -46, 110}, { -411, -374, -678}, +{ 214, 531, 668}, { -406, -420,-1194}, { 487, 232, 303}, +{ -318, 91, -472}, { 123, 1232, 2445}, { -722, -952,-1495}, +{ -738, -675, 1332}, { -543, -606, -211}, { -95, -98, 1508}, +{ -549, -514,-1193}, { 473, 211, 73}, { -288, -112, -389}, +{ 537, 1332, 1258}, { -567, -755,-1545}, { 71, -283, 632}, +{ -170, -481, -493}, { 681, 1002, 817}, { -356, -331, -877}, +{ 419, 706, 346}, { 241, -34, -326}, { 377, 1950, 1883}, +{ -727,-1075,-1625}, { -233, -543, 116}, { -524, -806, -585}, +{ -73, 478, 729}, { -288, -925,-1143}, { 173, 447, -52}, +{ 68, -229, -606}, { 449, 529, 1797}, { -591, -875,-1363}, +{ 183, -144, 324}, { -103, -452, -666}, { 623, 488, 1176}, +{ -238, -511,-1004}, { 326, 552, 458}, { 136, 108, -319}, +{ 626, 1343, 1883}, { -490, -646,-1730}, { -186, -449, 984}, +{ -738, -76, -170}, { -550, 755, 2560}, { -496, -510, -947}, +{ 210, 694, -52}, { 84, -322, -199}, { 1090, 1625, 1224}, +{ -376, -603,-1396}, { 343, 74, 632}, { -175, -502, -32}, +{ 972, 1332, 734}, { 52, -295,-1113}, { 1065, 918, 160}, +{ 393, 107, -397}, { 1214, 2649, 1741}, { -632,-1201,-1891}, +{ -719, -277, 353}, { -651, -880, -122}, { -211, 209, 1338}, +{ -562, -714,-1059}, { -208, 388, 159}, { -320, -61, -551}, +{ 293, 1092, 1443}, { -648, -865,-1253}, { -49, -143, 305}, +{ -401, -227, -585}, { 561, 532, 927}, { -117, -443,-1188}, +{ 507, 436, 292}, { -79, 233, -458}, { 671, 1025, 2396}, +{ -633, -842,-1525}, { -308, -286, 640}, { -373, -621, -407}, +{ 418, 253, 1305}, { -315, -581,-1137}, { 572, 685, -281}, +{ 61, -68, -371}, { 991, 1101, 1498}, { -493, -683,-1362}, +{ -47, 164, 704}, { -256, -314, -268}, { 631, 949, 1052}, +{ -118, -348, -833}, { 68, 1180, 568}, { 152, 117, 34}, +{ 1113, 1902, 2239}, { -601, -959,-1706}, { -143, -489, 480}, +{ -332, -655, -574}, { 54, 353, 1192}, { -462, -652, -796}, +{ 150, 549, 112}, { 195, -111, -515}, { 679, 1108, 1647}, +{ -558, -749,-1217}, { -9, 272, 341}, { -53, -265, -535}, +{ 489, 843, 1298}, { -120, -482,-1032}, { 632, 543, 408}, +{ 179, 306, -526}, { 1124, 1464, 2244}, { -417, -786,-1562}, +{ -224, -384, 1364}, { -377, -459, -25}, { 385, 489, 2174}, +{ -332, -651, -829}, { 544, 553, 61}, { 22, -113, -89}, +{ 1128, 1725, 1524}, { -216, -373,-1653}, { 161, 316, 908}, +{ -165, -222, -67}, { 1362, 1175, 789}, { 73, -252, -767}, +{ 738, 932, 616}, { 362, 246, -126}, { 787, 2654, 3027}, +{ -691,-1106,-2190}, { -565, -588, 524}, { -590, -979, -490}, +{ -263, 397, 982}, { -577, -837, -945}, { -22, 435, -49}, +{ -190, -118, -629}, { -88, 1240, 1513}, { -636,-1051,-1019}, +{ -291, 189, 259}, { -257, -470, -629}, { 145, 945, 894}, +{ -326, -364,-1094}, { 543, 260, 630}, { -202, 189, -209}, +{ 357, 1379, 2091}, { -569,-1075,-1449}, { -714, -239, 919}, +{ -420, -705, -84}, { -109, -114, 2407}, { -413, -529,-1177}, +{ 482, 368, 131}, { -186, -72, -131}, { 861, 1255, 1220}, +{ -611, -658,-1341}, { 227, -121, 631}, { -176, -489, -218}, +{ 745, 1175, 957}, { -321, -148, -936}, { 671, 966, 216}, +{ 340, -3, -143}, { 469, 1848, 2437}, { -729, -961,-1683}, +{ -213, -254, 321}, { -511, -438, -521}, { -126, 725, 903}, +{ -340, -685,-1032}, { 316, 480, 20}, { 23, -89, -551}, +{ 353, 1051, 1789}, { -544, -757,-1364}, { 298, -25, 436}, +{ -100, -392, -519}, { 467, 754, 1078}, { -210, -398,-1078}, +{ 620, 658, 630}, { 33, 147, -178}, { 921, 1687, 1921}, +{ -325, -528,-1978}, { 2, -285, 910}, { -371, -490, -230}, +{ 0, 597, 2010}, { -496, -395, -834}, { 37, 945, 245}, +{ 181, -160, -144}, { 1481, 1373, 1357}, { -355, -601,-1270}, +{ 298, 322, 672}, { -193, -336, 77}, { 1089, 1533, 922}, +{ 177, -39,-1125}, { 996, 781, 536}, { 456, 366, -432}, +{ 1415, 2440, 2279}, { -466, -758,-2325}, { -303, -509, 387}, +{ -727, -557, 66}, { -145, 643, 1248}, { -544, -676, -916}, +{ -225, 862, 588}, { -152, 40, -533}, { 423, 1423, 1558}, +{ -572, -843,-1145}, { -128, 85, 461}, { -238, -257, -584}, +{ 605, 748, 861}, { 24, -202,-1409}, { 797, 487, 303}, +{ -181, 364, -182}, { 616, 1378, 2942}, { -494, -852,-1441}, +{ -292, 61, 812}, { -84, -723, -182}, { 555, 532, 1506}, +{ -365, -493,-1057}, { 822, 588, 11}, { -14, -18, -230}, +{ 1001, 1401, 1451}, { -474, -569,-1292}, { 302, 62, 1062}, +{ -70, -376, -222}, { 982, 974, 1149}, { -196, -234, -795}, +{ 479, 1098, 499}, { 362, 58, 70}, { 1147, 2069, 2857}, +{ -487, -878,-1824}, { 73, -288, 348}, { -358, -500, -508}, +{ 199, 721, 1242}, { -78, -697, -795}, { 361, 536, 196}, +{ 374, 110, -735}, { 847, 1051, 1896}, { -366, -713,-1182}, +{ 315, 320, 429}, { 72, -215, -450}, { 759, 886, 1363}, +{ -30, -428, -834}, { 861, 627, 796}, { 118, 468, -279}, +{ 1355, 1883, 1893}, { -188, -642,-1612}, { 63, -175, 1198}, +{ -418, -211, 51}, { 414, 587, 2601}, { -234, -557, -858}, +{ 424, 889, 222}, { 136, -101, 83}, { 1413, 2278, 1383}, +{ -84, -445,-1389}, { 414, 313, 1045}, { 29, -343, 65}, +{ 1552, 1647, 980}, { 183, -91, -829}, { 1273, 1413, 360}, +{ 553, 272, -107}, { 1587, 3149, 2603} +}; + +static const int16_t lsf_3_1[256][3] = { +{ 6, 82, -131}, { 154, -56, -735}, { 183, -65, -265}, +{ 9, -210, -361}, { 113, 718, 1817}, { 1010, 1214, 1573}, +{ 857, 1333, 2276}, { 827, 1568, 1933}, { 717, 1989, 2206}, +{ 838, 1172, 1823}, { 721, 1000, 2154}, { 286, 476, 1509}, +{ -247, -531, 230}, { 147, -82, 569}, { 26, -177, -944}, +{ -27, -273, 692}, { -164, -264, -183}, { 224, 790, 1039}, +{ 899, 946, 601}, { 485, 771, 1150}, { 524, 677, 903}, +{ -140, 375, 778}, { 410, 676, 429}, { 301, 530, 1009}, +{ 719, 646, 38}, { 226, 367, 40}, { 145, -45, -505}, +{ 290, 121, -121}, { 302, 127, 166}, { -124, -383, -956}, +{ -358, -455, -977}, { 715, 878, 894}, { 978, 923, 211}, +{ 477, 272, 64}, { 188, -78, 17}, { -143, -65, 38}, +{ 643, 586, 621}, { -134, -426, -651}, { 347, 545, 2820}, +{ 1188, 2726, 2442}, { 142, -80, 1735}, { 283, 130, 461}, +{ -262, -399,-1145}, { -411, 155, 430}, { 329, 375, 779}, +{ 53, -226, -139}, { -129, -236, 1682}, { 285, 744, 1327}, +{ 738, 697, 1664}, { 312, 409, 266}, { 325, 720, 135}, +{ 1, 221, 453}, { 8, 203, 145}, { 299, 640, 760}, +{ 29, 468, 638}, { 103, 429, 379}, { 420, 954, 932}, +{ 1326, 1210, 1258}, { 704, 1012, 1152}, { -166, -444, -266}, +{ -316, -130, -376}, { 191, 1151, 1904}, { -240, -543,-1260}, +{ -112, 268, 1207}, { 70, 1062, 1583}, { 278, 1360, 1574}, +{ -258, -272, -768}, { 19, 563, 2240}, { -3, -265, 135}, +{ -295, -591, -388}, { 140, 354, -206}, { -260, -504, -795}, +{ -433, -718,-1319}, { 109, 331, 962}, { -429, -87, 652}, +{ -296, 426, 1019}, { -239, 775, 851}, { 489, 1334, 1073}, +{ -334, -332, 25}, { 543, 1206, 1807}, { 326, 61, 727}, +{ 578, 849, 1405}, { -208, -277, 329}, { -152, 64, 669}, +{ -434, -678, -727}, { -454, -71, 251}, { 605, 480, 254}, +{ -482, 11, 996}, { -289, 395, 486}, { 722, 1049, 1440}, +{ -30, -316, -786}, { -106, -115, -619}, { 861, 1474, 1412}, +{ 1055, 1366, 1184}, { 812, 1237, 925}, { 42, -251, -576}, +{ 342, 141, -454}, { -168, -80, 1359}, { -342, -656,-1763}, +{ 100, 821, 725}, { 990, 747, 800}, { 332, 440, 568}, +{ 663, 379, 852}, { 112, 165, -369}, { 597, 910, 282}, +{ -8, 834, 1281}, { -352, 572, 695}, { 462, 2246, 1806}, +{ 345, 190, 1374}, { 416, 915, 2166}, { 168, -82, 280}, +{ -516, -446, 840}, { 47, 533, 44}, { -362, -711,-1143}, +{ 22, 193, 1472}, { -85, 233, 1813}, { -62, 579, 1504}, +{ 550, 944, 1749}, { 723, 650, 1148}, { 972, 884, 1395}, +{ -425, 643, 0}, { 1000, 952, 1098}, { 249, 1446, 672}, +{ -334, -87, 2172}, { -554, 1882, 2672}, { 140, 1826, 1853}, +{ 920, 1749, 2590}, { 1076, 1933, 2038}, { -137, -443,-1555}, +{ 1269, 1174, 468}, { -493, -122, 1521}, { -451, 1033, 1214}, +{ 482, 1695, 1118}, { 815, 649, 384}, { -446, -692, 107}, +{ -319, -605, -118}, { -207, -505, 525}, { -468, -12, 2736}, +{ 75, 1934, 1305}, { 880, 2358, 2267}, { 1285, 1575, 2004}, +{ -48, -304,-1186}, { -435, -461, -251}, { -366, -404, -547}, +{ -289, -605, -597}, { -538, -810, -165}, { -120, 3, 356}, +{ 639, 1241, 1502}, { 96, 177, 750}, { -435, -585,-1174}, +{ -356, 109, -79}, { -485, 288, 2005}, { 9, 1116, 731}, +{ 880, 2134, 946}, { -265, 1585, 1065}, { 1157, 1210, 843}, +{ -498, -668, 431}, { 374, 321, -229}, { 1440, 2101, 1381}, +{ 449, 461, 1155}, { -105, 39, -384}, { -263, 367, 182}, +{ -371, -660, 773}, { -188, 1151, 971}, { 1333, 1632, 1435}, +{ 774, 1267, 1221}, { -482, -832,-1489}, { -237, -210, 860}, +{ 890, 1615, 1064}, { 472, 1062, 1192}, { 185, 1077, 989}, +{ -568, -992,-1704}, { -449, -902,-2043}, { -142, -377, -458}, +{ -210, -554,-1029}, { -11, 1133, 2265}, { -329, -675, -893}, +{ -250, 657, 1187}, { 519, 1510, 1779}, { 520, 539, 1403}, +{ 527, 1421, 1302}, { -563, -871,-1248}, { -147, -463, 879}, +{ -76, 2334, 2840}, { 563, 2573, 2385}, { 632, 1926, 2920}, +{ 719, 2023, 1840}, { -545, -723, 1108}, { 129, -125, 884}, +{ 1417, 1632, 925}, { -94, 1566, 1751}, { -341, 1533, 1551}, +{ 591, 395, -274}, { -76, 981, 2831}, { 153, 2985, 1844}, +{ 1032, 2565, 2749}, { 1508, 2832, 1879}, { 791, 1199, 538}, +{ -190, -453, 1489}, { -278, -548, 1158}, { -245, 1941, 2044}, +{ 1024, 1560, 1650}, { 512, 253, 466}, { -62, -323, 1151}, +{ -473, -376, 507}, { -433, 1380, 2162}, { 899, 1943, 1445}, +{ 134, 704, 440}, { 460, 525, -28}, { -450, 279, 1338}, +{ 0, 971, 252}, { -445, -627, -991}, { -348, -602,-1424}, +{ 398, 712, 1656}, { -107, 314, -178}, { 93, 2226, 2238}, +{ 518, 849, 656}, { -462, -711, -447}, { 174, -34, 1191}, +{ -119, 42, 1005}, { -372, 274, 758}, { 1036, 2352, 1838}, +{ 675, 1724, 1498}, { 430, 1286, 2133}, { -129, -439, 0}, +{ -373, 800, 2144}, { 6, 1587, 2478}, { 478, 596, 2128}, +{ -428, -736, 1505}, { 385, 178, 980}, { 139, 449, 1225}, +{ -526, -842, -982}, { 145, 1554, 1242}, { 623, 1448, 656}, +{ 349, 1016, 1482}, { 31, -280, 415}, { -316, 724, 1641}, +{ 360, 1058, 556}, { -436, -358, 1201}, { -355, 1123, 1939}, +{ 401, 1584, 2248}, { -527,-1012, 355}, { 233, 238, 2233}, +{ -550, -897, -639}, { -365, -501, 1957}, { 389, 1860, 1621}, +{ 162, 1132, 1264}, { -237, 1174, 1390}, { -640, -411, 116}, +{ -228, 1694, 2298}, { 1639, 2186, 2267}, { 562, 1273, 2658}, +{ 323, 338, 1774}, { 578, 1107, 852}, { 22, 594, 934}, +{ -143, 718, 446} +}; + + +static const int16_t lsf_3_2[512][3] = { +{ 50, 71, -9}, { -338, -698,-1407}, { 102, -138, -820}, +{ -310, -469,-1147}, { 414, 67, -267}, { 1060, 814, 1441}, +{ 1548, 1360, 1272}, { 1754, 1895, 1661}, { 2019, 2133, 1820}, +{ 1808, 2318, 1845}, { 644, -93, 454}, { 858, 329, -136}, +{ 489, -258, -128}, { -198, -745, -41}, { -52, -265, -985}, +{ 346, 137, 479}, {-1741, -748, -684}, {-1163,-1725, -367}, +{ -895,-1145, -784}, { -488, -946, -968}, { -85, -390, -725}, +{ 215, -340, -171}, { 1020, 916, 1969}, { 564, 179, 746}, +{ 662, 977, 1734}, { 887, 622, 914}, { 939, 856, 1165}, +{ 309, 688, 803}, { 917, 161, 570}, { 118, -20, -283}, +{ -816, -42, 204}, {-1228, -325, -462}, { -963, -202, -143}, +{ -988, -484, -361}, { -702, -978, -477}, { -302, -790,-1188}, +{ -100, -786,-1088}, {-1054, -947,-1684}, { -202, -843, -782}, +{-1039,-1378, -901}, { -624, -110, -85}, { 356, 213, -10}, +{ -493, 364, 774}, { 425, 822, 479}, { -83, 557, 520}, +{ -992,-1560, -572}, { -603, -741, -26}, { -502, -638, -903}, +{ 209, 306, 147}, { -316, -593, -596}, { -85, -211, -225}, +{ -918, -529, 117}, { 233, -439, -738}, { 1101, 751, 633}, +{ 1457, 1716, 1511}, { 1765, 1457, 910}, { 1122, 1156, 849}, +{ 1354, 868, 470}, { -871,-1150,-1796}, { -871, -861, -992}, +{ -118, 155, 212}, {-1051, -849, -606}, {-1117,-1849,-2750}, +{-1019,-1427,-1869}, { 370, -184, -414}, { 959, 493, 104}, +{ 958, 1039, 543}, { 154, 653, 201}, { 1249, 507, 150}, +{ 663, 503, 230}, { 623, 777, 675}, { 659, 88, -110}, +{ 843, 244, 224}, { 382, 541, 302}, { 724, 433, 666}, +{ 1166, 734, 341}, { -138, 20, -397}, {-1183, -424, -46}, +{ -321, -352, -124}, { 1333, 1021, 1080}, { 262, 366, 723}, +{ 922, 283, -551}, { 31, -636, -611}, { -689, -697, -415}, +{ -952, -779, -201}, {-1329, -598, -359}, { -953,-1285, 166}, +{ 493, 305, 221}, { 846, 703, 610}, { 840, 936, 774}, +{ -723,-1324,-1261}, { -357,-1025,-1388}, {-1096,-1376, -365}, +{-1416,-1881, -608}, {-1798,-1727, -674}, { -545,-1173, -703}, +{ 678, 786, 148}, { -123, 696, 1288}, { 644, 350, -10}, +{ 414, 614, 15}, { 137, 344, -211}, { -814,-1512, -819}, +{ -391, -930, -588}, { 47, -591, -898}, { -909,-1097, -163}, +{-1272,-1167, -157}, {-1464,-1525, -389}, {-1274,-1188, -624}, +{ 671, 213, 454}, { 124, -274, -525}, { -729, -496, -152}, +{-1344, 122, 135}, {-2905, -589, -394}, {-1728, 441, -50}, +{ 1476, 904, 787}, { 316, 236, -440}, { -347, 217, 413}, +{ -911, -917, 121}, { -455, -932, 202}, { -92, -465, -375}, +{ 488, 390, 474}, { 876, 729, 316}, {-1815,-1312, -669}, +{ 87, 962, 432}, { 563, -249,-1058}, { 250, 285, 1105}, +{ 1141, 427, 696}, {-1038,-1664,-1582}, { -948, 346, 160}, +{ -309, -272, -858}, { 670, 624, 1250}, { -944, -408, -666}, +{ -606, -320, -384}, { -492, 230, 65}, { 334, -50, -16}, +{ -16, -690,-1397}, { 1791, 1716, 1399}, { 2478, 2063, 1404}, +{ 1245, 1471, 1426}, { -382,-1037, -2}, { 173, -398, 1145}, +{ 1491, 2024, 1801}, { 772, 1274, 1506}, { 1429, 1735, 2001}, +{ 1079, 1218, 1273}, {-1154,-1851,-1329}, { -808,-1133,-1096}, +{ -451,-1033,-1722}, { 65, 578, -84}, {-1476,-2434,-1778}, +{ -765,-1366, -494}, { -218, -594, -931}, { 337, -236, 562}, +{ 2357, 2662, 1938}, { 1489, 1276, 874}, { 189, 358, 374}, +{-1519,-2281,-2346}, { -967,-1271,-2095}, { -628,-1188,-1542}, +{ 1661, 1043, 546}, { 565, 1061, 732}, { -64, -836, -434}, +{ -436, -96, 203}, { 1078, 1216, 1636}, { 907, 1534, 986}, +{ 326, 965, 845}, { 142, -84, 197}, { 470, 2379, 1570}, +{ 1133, 470, 1214}, { 395, 1376, 1200}, { 1125, 1042, 348}, +{ -543,-1234, -376}, { -215, -181, 481}, {-1947,-1621, -210}, +{ -750,-1185, 390}, { 29, -399, 27}, { 820, 1236, 755}, +{ 695, 979, 409}, { -174, 1197, 1035}, { 912, 1356, 1846}, +{ -992,-1437, 484}, {-1485,-1700, 208}, { -412, 1204, 1432}, +{ -271, 896, 1144}, { -416, 1777, 1434}, {-1696,-2644, -204}, +{-1789,-1551, 1033}, {-1656,-1559, 1303}, {-1253,-1589, 1081}, +{ -669,-1095, -66}, { -682, 320, -345}, { 659, 305, 1069}, +{-1292, -804, -19}, {-1635,-1291, 29}, {-1683, -497, 71}, +{ -287, -7, -100}, { -494, -962, -237}, { 852, 1881, 1740}, +{-1217,-1387, 227}, { -660, 302, 373}, { 96, 1087, 1257}, +{-1074,-1669, 160}, { 485, 2076, 1798}, { -934, -220, 552}, +{ -596, -612, 237}, { 336, 1720, 879}, { 643, 629, 434}, +{ 1267, 522, 1633}, { 15, 244, -441}, { 1475, 717, 184}, +{ 1819, 1590, 1709}, { 988, 261, 937}, { 2093, 2345, 1520}, +{ 2139, 1858, 1606}, { -577, -579,-1203}, { -956, 135, -488}, +{ -464, 51, -338}, { -629, -348, -723}, { 1146, 2073, 1442}, +{ 2192, 1466, 911}, {-1444,-1572,-2278}, { 1400, 710, 1297}, +{ 1335, 633, 928}, { 1434, 2194, 2594}, { 2422, 2204, 1881}, +{ 982, 2242, 1854}, { 380, 792, 1145}, { -63, -539, 414}, +{ -252, -964, -314}, {-1261, -683, -780}, { -831, -526,-1005}, +{-1666,-1135, -424}, {-1611, -452, -299}, { 1268, 1048, 642}, +{ 1147, 853, 856}, { -675, -336, 139}, { 2268, 1343, 1418}, +{ 29, 768, 797}, {-1224, 423, 564}, {-1318,-1082, 245}, +{-1302, -812, 573}, {-1298,-1617, 646}, { -968, 834, 723}, +{ 993, 1652, 2027}, { -191, -817, 432}, { 662, 60, 198}, +{ 626, 997, 1330}, { 1648, 1963, 1289}, {-1597, -93, -45}, +{-1088, 37, -84}, { 1653, 2607, 2337}, { 1065, 2040, 2377}, +{ 1139, 2326, 2118}, { 859, 357, 1510}, { 664, 1227, 1099}, +{ 479, 1360, 912}, { 1897, 1754, 2019}, { 1168, 1909, 1784}, +{ 399, 34, 256}, { -593, -304,-1053}, { 547, 1694, 1407}, +{ 647, -99, -341}, { 1492, 1647, 1190}, { 38, -644, -212}, +{ 395, 846, 222}, { -704, -765, -716}, { -724,-1964,-2804}, +{ -150, 291, -82}, { 1233, 1459, 1007}, { -140, -155, 153}, +{ 439, 297, 1568}, {-1529, -410, -636}, { 1536, 455, -237}, +{-1328, -139, -260}, { 531, 554, 868}, { 269, 1264, 606}, +{ -233, 883, 463}, { 742, 600, -120}, { -73, 421, 212}, +{ -439, -58, 804}, {-1286,-1241, 728}, { 294, -490, 50}, +{ -591, -905,-1254}, { 42, -687, 147}, { -25, 273, 596}, +{ -311, 1213, 601}, { -754, 849, 584}, { 429, 607, 587}, +{ -602, -166, 461}, { -796, -823, 777}, { 1380, 910, 1755}, +{ 119, 1417, 972}, { -219, -880,-1596}, {-1049,-1010, 438}, +{ -713,-1379, 78}, { 0, -447,-1179}, {-1136,-1319,-1573}, +{ 2248, 1767, 1309}, { 946, 1583, 1432}, { 1150, 482, 436}, +{ -469,-1108, 618}, { -447, -966, 1088}, {-1252,-1515, -114}, +{-1104,-2008, -579}, { 210, 613, 497}, {-1975,-1437, 642}, +{-1269, -856, 1011}, {-1646,-1185, 1063}, {-1555, -672, 1204}, +{-1692,-1114, 623}, { -979,-1326,-1277}, { 539, -147, 894}, +{-1354, -897, -434}, { 888, 475, 428}, { 153, -384, 338}, +{-1492, -511, 359}, { -974,-1115, -470}, { 105, -550, 677}, +{ -937,-1145, 877}, { 380, -260, 210}, { 1685, 924, 1256}, +{ 1775, 1190, 1095}, { 1419, 631, 533}, { 627, 299, -347}, +{ -411, -534, 647}, { -650, 29, -595}, { -378,-1367, 1563}, +{ 1402, 1121, 1465}, { 1089, 1410, 648}, {-2096,-1090, -6}, +{ 311, -194, -869}, { -639, -831, 416}, {-1162,-1224, 1349}, +{-1247, -941, 1813}, {-2193,-1987, 453}, { -619,-1367, -956}, +{-1606,-1972,-1507}, {-1175,-1057,-1104}, { -377, 601, 201}, +{ 1876, 825, 374}, { -430,-1323, 29}, {-1397,-1249,-1331}, +{-1007,-1504, 960}, {-1401,-2009, 197}, {-1379,-1949, -236}, +{-1077, 123, 422}, { 615, 1269, 546}, { -306, 1526, 904}, +{ 1194, 1788, 1177}, { -626, -884,-1526}, { 199, 766, 1504}, +{-1065, 862, 197}, {-1034,-1773, -887}, { -800, 145, 599}, +{-1134, -519, 626}, {-1205,-1926, 500}, { -910,-1041,-1395}, +{-1476,-1567, -969}, { -523, 842, 34}, { 1794, 646, 862}, +{-1207,-1888,-1002}, { -78, -9, -672}, { 1044, 759, 80}, +{ -600, 1139, 1019}, { 57, 2000, 1422}, { -833, 1414, 1121}, +{-1202, 1630, 1260}, { -461, 1420, 1244}, { 1537, 975, 253}, +{ -283, 324, -359}, { 599, -195, 106}, { 588, 62, -587}, +{ -757, 645, 205}, { 51, 1201, 758}, {-1209, 673, -390}, +{ -624, 1581, 941}, { -151, 1023, 735}, { 2820, 1301, 690}, +{ -302, 524, -99}, { -900,-1588,-1189}, { 1084, 251, 238}, +{ 2014, 1792, 1010}, { 1245, 1633, 1741}, {-1227,-1540,-1208}, +{ -621, 456, -109}, { 40, -65, 788}, { -805, -699,-1350}, +{ -583, 904, 832}, { -801, 532, 594}, { 1972, 1408, 1351}, +{-1177,-1880,-2114}, { -773, 568, 948}, {-1015, 1079, 1260}, +{-1111, 482, -130}, { 1778, 1044, 780}, {-1491, 245, 912}, +{ -316,-1141, -917}, { -536,-1442,-2346}, { -785,-1546,-1988}, +{-2003, 257, 909}, {-1849, -633,-1209}, {-1538,-1918,-1054}, +{ 1606, 2239, 1576}, { -567,-1500,-1544}, {-1279, 195, 1369}, +{ -817, 293, 1219}, { -525, 630, 1197}, {-1698,-2425,-1840}, +{ -303, 731, 747}, {-1169, -251, 269}, { -950, -75, 1684}, +{-1182, -453, 1005}, {-1599, 585, 378}, {-2075, -571, -427}, +{ -529,-1159,-1171}, { -283, -205, -564}, { -796, 1246, 717}, +{ 2277, 927, 539}, { -454, 559, 440}, { -717, 1460, 1615}, +{-1030, 1052, 1610}, {-1169, -138, 847}, { 226, 39, -612}, +{-1251, -106, -729}, { -651, 968, 1302}, { -714, -636, 1727}, +{ 353, 1069, 410}, { -798, -156, 1099}, { -574, 918, 446}, +{-1310, 1012, 466}, { 1408, 1591, 765}, { 1429, 1380, 1757}, +{ 1949, 1956, 2378}, { 1578, 2047, 2148}, { 916, 98, -7}, +{ 1893, 1418, 2141}, { 348, 1405, 1579}, { 152, 1134, 1801}, +{ -267, 154, 1395}, {-1166, 469, 1054}, {-1142, -405,-1073}, +{-1341,-2264,-1581}, { -364, 869, 1706}, {-1162, 549, 1550}, +{-1225,-1932,-1666}, {-1485,-1977,-2055}, {-1727, -906, -98}, +{-1897, 233, 1492}, { 892, 108, -331}, {-1728,-1170,-1700}, +{-1060, 1980, 1790}, {-1070,-1741,-1909}, { -11, 1539, 1317}, +{-1600, 94, 497}, { 421, 443, -197}, {-1578, -349, -994}, +{ -599, -539, 1140}, { -965,-1419, -129}, {-1341, 175, -447}, +{ -375, 1311, 2055}, { -371, -650, -307}, {-1073, 605, 365}, +{-2057, -113, 430}, { 652, 914, 967}, {-1012,-1586,-2323}, +{ 1505, 1248, 559}, { 262, -486, -401}, {-1727, 1342, 1546}, +{ 50, 56, 432}, { -330, 119, -604}, {-1517,-1080, -810}, +{ 946, 1127, 1055}, {-1400,-1703,-1712}, {-1270, -704,-1317}, +{ 807, 1821, 1143}, { 2760, 1606, 2171}, { 1120, 409, -150}, +{ -147, 404, 959}, { 2439, 1911, 2189}, { -906, -141, -866}, +{ -904, -142, -458}, { -557, -708,-1679}, { -830,-1431,-1583}, +{-1842,-1346,-1086}, {-1604, -272, 915}, {-1196, 772, 1056}, +{ -638,-1234,-1897}, { -500, -81, -822}, {-1289,-1613, -735}, +{ -117, 785, 168}, {-1090, 1133, 922}, {-1096, -746, 1384}, +{ 287, -547,-1063}, {-1376,-2201,-1204}, {-2176,-1570,-1757}, +{-1511,-2241, -771}, {-1737, 1099, 830}, {-1588, 724, 1243}, +{-1542, 693, 805}, {-1690, -240, 1665}, {-1700, -4, -668}, +{ 2149, 816, 1042}, { -818,-1841, 22}, { -764, -507, 449}, +{-1151, -617, 289}, { -843,-1596, -240}, { 498, -234, -657}, +{ -752, 480, 1678}, { -319, -481, 193}, { -811, 171, -119}, +{-2128, -202, -848}, { 1717, 1140, 1700} +}; + +static const int16_t lsf_3_3[512][4] = { +{ 67, -17, 66, -12}, {-1690, -581, -104, -272}, {-1076,-1186,-1845, -376}, +{-1140, -926, -420, -58}, { -259, -656,-1134, -553}, { 1788, 1227, 455, 129}, +{ 462, 441, -240, -528}, { 840, 514, 130, -75}, { 1114, 623, 153, 216}, +{ 1068, 564, -6, -276}, { 1119, 727, 190, -68}, { 704, 306, 119, -264}, +{ 329, 61, -100, 156}, { 364, 123, 183, -208}, { -171, -123, 220, -65}, +{ -306, -62, 402, 17}, { -660, -938, -266, 0}, { 385, 235, 276, 285}, +{ 320, 268, -336, -200}, { -724, 17, -84, 381}, { -544, 429, 494, 519}, +{ -117, 288, 304, 329}, { 643, 157, 701, 508}, { 1200, 625, 796, 608}, +{ 998, 421, 492, 632}, { 1204, 780, 446, 132}, { 1257, 844, 547, 449}, +{ 829, 658, 541, 470}, { 1132, 1258, 918, 639}, { 547, 51, 423, 279}, +{ 9, 392, 83, 94}, { 542, 543, 229, -147}, { -198, 129, 194, -185}, +{ -863,-1321, -302, 30}, { -597, -629, -19, 114}, { -900,-1081, 466, 353}, +{-1483,-1573, 15, -143}, {-1708,-2059, -751, 196}, {-1876,-2067, -642, -258}, +{-2335,-1470, -450, -564}, { -584, -186, -872, -414}, {-1805, -988,-1125,-1310}, +{ -726,-1129, 28, 169}, {-1039, -864, -718, -246}, { 484, 36, -233, -49}, +{ 265, 67, 289, 467}, { 178, 543, 810, 540}, { 84, 282, 672, 703}, +{ -975, -777, 129, 287}, { -938, -227, 955, 595}, {-1617, -289, 836, 649}, +{-1847, -215, 1106, 718}, {-2034,-1085, 650, 440}, {-2101, -529, 907, 575}, +{-2011, -336, 670, 204}, {-2389, -692, 360, 137}, {-2156,-2204, -9, 280}, +{ -266, 119, 39, 193}, { 78, -59, -120, 226}, { -975, -858, -781,-1095}, +{ -619, -413, -451, -842}, {-1216,-1321, -813, -883}, {-1376,-1615, -394, -428}, +{ -737,-1113, -549, -790}, { -880, -975, -967, -642}, { -985, -886,-1273,-1361}, +{ -473, -804,-1401,-1407}, { 160, -265, -919, -275}, { -248, -250, -718, -380}, +{ 97, -103, -375, -229}, { -415, -193, -135, -555}, { 628, 361, 119, 216}, +{ 579, 364, 391, 209}, { 634, 522, -154, -148}, { 526, 389, 170, 33}, +{ 105, 267, 64, 380}, {-1503,-1000, -30, -369}, {-1070, 58, 647, 223}, +{-1520, -291, 621, 307}, {-1531, 156, 762, 404}, {-2029, 141, 734, 499}, +{-1849, -650, 306, 512}, { -187, -104, -59, 438}, { 134, -230, 156, -186}, +{ -61, -260, -16, 10}, { -569, -3, -421, -297}, {-1725, -521, -346, 178}, +{-1362, -59, -44, 157}, {-2146, -461, -470, -349}, {-2170, -1, -369, -121}, +{-1579, -373, -900,-1015}, {-1117, -591, -613, -784}, { -561, 122, -75, -449}, +{ -4, -171, -123, -372}, { 192, 168, -76, -132}, { 252, -107, 340, 210}, +{ 392, 509, 272, 181}, { -109, 145, 218, 119}, { -416, -263, 485, 265}, +{ -181, -8, -286, 226}, { -244, -218, 69, -290}, { -158, 191, -1, -64}, +{ -592, -90, 213, -96}, { 255, 435, 178, -80}, { -369, -18, -33, -80}, +{ -42, 415, 140, -222}, { 1143, 651, 649, 329}, { 767, 556, 249, 235}, +{ 948, 413, 442, 279}, { 141, 339, 356, 557}, { -470, -170, 99, 237}, +{ -569, -800, 352, 565}, { 282, 473, 470, 332}, { -199, -690,-1284, -917}, +{ -193, -426, -800,-1122}, { -26, -371, -490, -193}, { 637, 595, 519, 330}, +{ 408, -115, 79, 12}, { 477, 87, -103, -376}, { -666, -347, -277, -291}, +{ -510, -481, 169, 297}, { -829, -738, -205, -171}, { -320, -540, 328, 283}, +{ -859, -958, 442, -2}, { 556, 686, 130, 56}, { 1383, 1012, 755, 427}, +{ 612, 741, 628, 553}, { -339, -796, 134, 277}, { -633,-1085, -2, -246}, +{ -880,-1035,-1607,-1064}, { -994, -474,-1138, -488}, { -414, -795, 73, -206}, +{ -8, -139, 439, 204}, { -176, -578, 23, 131}, { -269, -757, -191, 245}, +{ -109, -338, 112, 316}, { 120, -406, -118, 611}, { -180, -186, -645, 115}, +{ -173, 34, -518, -489}, { -151, 61, -583, -844}, { 220, -138, -681,-1020}, +{ 391, -17, -598, -321}, { 157, -295, 129, 155}, { -926, -875, -987, 285}, +{ 241, -83, -125, -125}, { 620, 597, 432, 92}, { 393, 78, 409, 61}, +{ -393, -739, -413, -748}, { 83, 54, 361, 27}, {-1084, 130, -337, -694}, +{-1565, 297, 318, -19}, {-1873, 36, 51, -317}, {-2323, -246, 231, -84}, +{-2306, -783, 40, -179}, {-2233, -930, -474, -462}, { -754, -86, -288, -626}, +{-2411, -455, -63, 171}, {-1099,-1094, -26, -143}, {-1193, -455, -406, -381}, +{ -605, -210, -96, -51}, { -580, -476, -276, -15}, {-1195, -634,-1203, -881}, +{ -378, -221, -669, -952}, { 594, 178, -403, -676}, { 763, 327, 601, 290}, +{ 172, 300, 203, 157}, { -56, -336, 356, 24}, { -228, -296, -259, -29}, +{ -186, 263, 416, 14}, { -353, 373, -12, -216}, { 257, 96, 174, 57}, +{-1526, -616, -954, -499}, { -497, -152, -333, 125}, { 105, 200, 179, -97}, +{ -331, -224, 765, 697}, { 760, 256, 301, 59}, { 455, -85, 204, 288}, +{ -514, 240, 251, -109}, { 256, 417, -34, -413}, { 101, 430, 384, 156}, +{ -31, -10, 206, 426}, { 589, 145, 143, 71}, { 808, 906, 333, 349}, +{ 986, 938, 589, 331}, { 1300, 824, 187, 509}, { 1062, 653, 379, 466}, +{ 1462, 937, 401, 274}, { 787, 861, 265, 2}, { 609, 553, 28, 305}, +{ 926, 340, 106, 386}, { 241, -267, -147, 225}, { -178, -534, 347, 502}, +{ -643, -381, 397, 30}, { -651, -733, -435, 398}, { -407, -726, -484, -248}, +{ -789, -914, -438, -476}, { -498, -390, 75, -295}, { -964, -590, -606, 150}, +{ -121, -49, -155, -78}, { 935, 550, 389, 38}, { -321, 127, 424, 315}, +{ -285, -113, 283, 259}, { 658, 203, 322, 486}, { 903, 505, 748, 417}, +{ 611, 423, 555, 512}, { 239, -83, -578, -19}, { -339, -731, 349, 13}, +{ -934,-1399, -114, -360}, { 107, 692, 182, 90}, {-1243,-1538,-1551, -725}, +{ -568, -903,-1363, -525}, { -517, -853, -861,-1004}, { -168, -690, -835, 63}, +{ -137, -556, -547, 144}, { -286, -817, 485, 319}, { -147, -408, 526, 246}, +{ -347, -434, 297, -28}, { -290, -471,-1110,-1285}, { -460, -359, -988, -794}, +{ 1347, 1299, 690, 523}, { 1216, 1068, 1094, 757}, { 825, 1140, 752, 494}, +{ 1252, 1365, 1195, 898}, { 521, 1053, 532, 432}, { -334, -216, -313, -263}, +{ -160, 52, -472, -155}, { 127, 136, -380, 44}, { 851, 410, -162, -489}, +{ 123, -255, -796, -667}, { 1090, 917, 789, 493}, { 1397, 1197, 558, 202}, +{ -51, -118, -342, -701}, { 83, 108, -42, -441}, { 61, 95, 287, 256}, +{ -27, 89, 524, 531}, { 351, 227, 592, 545}, { 697, 155, -164, 307}, +{ 638, 274, -489, -50}, { 754, 240, -166, -124}, { -116, -579,-1212, -63}, +{ 190, -295,-1040,-1296}, { 147, -376, -177, -113}, { 841, 1241, 1051, 668}, +{ 2, 293, 551, 304}, {-1096, -953, -248, 376}, { -750, -965, 87, 516}, +{ -275, -516, 689, 391}, { -379, -643, 876, 594}, { -390,-1013, -645, 573}, +{ -107, -568, -689, -826}, {-1025, -27, -328, -203}, { 861, 749, 548, 233}, +{-1660,-1043, 451, 108}, { -660, -620, 430, 236}, { 21, -396,-1158, -631}, +{ 1372, 1298, 967, 577}, { 1125, 1125, 589, 454}, { -323, -865, -467, 153}, +{ -468, -699, -804, -509}, { -392, -718, -204, -35}, { -603,-1093, -567, -162}, +{ -505,-1004, -102, 350}, { 219, 224, 423, 252}, { 395, 591, 608, 363}, +{ -746, -96, 373, 172}, { 171, 295, 714, 339}, { 233, 77, 107, 277}, +{ 157, 153, -499, -356}, { 1547, 1073, 576, 494}, { -292, -339, -504, -592}, +{ -903, -72, -619, -481}, {-1594,-1117, -567, -254}, { -793, -507, -564, -291}, +{ -492, -532, 502, 560}, { -382, 427, 600, 230}, { -227, 477, 251, 75}, +{ 285, 842, 813, 476}, {-1310,-1333, 186, 377}, { -587, -917, 643, 381}, +{-1186, -553, 411, 82}, {-1127, -820, -174, -540}, { -604, 119, 543, 205}, +{ -380, 657, 909, 567}, { 112, -298, -374, 114}, { -857, -251, 56, 159}, +{ 401, 345, -34, -140}, { -111, -607, 41, 614}, { 355, -114, -77, 474}, +{ 578, 56, 1450, 924}, { 1098, 1420, 741, 400}, { 246, 22, 588, 313}, +{ -121, 327, 831, 472}, {-1138, -608, 856, 552}, {-1241,-1072, 638, 600}, +{ -358, 254, -333, -303}, { -646, 739, 358, 74}, { 1226, 1671, 1221, 849}, +{ 2241, 1624, 983, 636}, { 1841, 1477, 749, 384}, { 350, 263, 87, 128}, +{-1902, -941, -144, -64}, {-1734, -255, 288, -31}, {-2644,-1238, 366, 235}, +{-1643,-1092,-1344, -304}, { -541,-1075,-1116, 123}, {-1178, -252, -816, -180}, +{-1016, 533, 565, 233}, { -487, -430, -188, 334}, { 867, 1236, 534, 171}, +{-1590,-1607, 635, 630}, {-2196, 310, 924, 412}, {-2358, -328, 956, 529}, +{-2639, -377, 630, 278}, {-2602, 317, 799, 299}, {-2406, 133, 340, 31}, +{-2156,-1468, 131, 125}, {-1184, -490, -139, 46}, { -744, 447, 891, 564}, +{ 67, -451, 646, 604}, { -553, -429, -876, 396}, { 162, -66, 1305, 915}, +{ 479, 579, 1088, 794}, { 450, 278, 566, 324}, {-1057, -154, 148, -177}, +{-2545, 168, 1070, 592}, {-2351, -42, 819, 345}, {-2344, -707, 721, 250}, +{-2175,-1497, -309, 122}, { -78, -73, 120, 173}, { -4, 262, -263, -261}, +{ -431, -64, -405, -732}, {-2609, 116, -83, -193}, {-1525, -944, -477, -725}, +{ -508, 307, 170, 172}, { 832, 417, 832, 686}, { -225, 177, 894, 818}, +{ -482, -389, 1279, 1039}, { -383, 201, -350, 40}, { 730, 635, 226, 526}, +{ 503, 462, 338, 398}, { 535, 714, 40, -282}, { 1482, 1471, 1085, 731}, +{ 1561, 1072, 909, 693}, { 1419, 1282, 889, 879}, { 1153, 728, 1186, 840}, +{ -226, 1130, 949, 689}, { -494, -986,-1556, -128}, { -568, -721, -713, -26}, +{ 317, 524, 70, 135}, { -405, -865,-1766, -652}, { -174, -801, 885, 773}, +{ -153, -91, 1099, 751}, { -506,-1149, 853, 646}, { 241, 782, 519, 539}, +{ 1853, 1700, 1101, 684}, {-1249,-1486, -464, 188}, { -893,-1409,-1312, -341}, +{ -135, 438, -175, 18}, { 1111, 976, 319, 208}, {-1430,-1768, 83, 458}, +{ -530,-1000, 307, 129}, { -840, -15, -29, -356}, { -911, -924,-1147, -242}, +{ -119, -528, 127, -133}, { -761, -765, 190, -83}, { -315, 895, 522, 231}, +{ -222, 102, -63, -428}, { 316, 699, 379, 70}, { 25, 716, 314, -108}, +{ 507, 874, 566, 238}, { 108, 941, 519, 195}, { 425, -60, -427, 257}, +{ 139, -103, -630, 446}, { 334, 370, 412, 48}, { -172, -690, -283, 557}, +{ 187, -286, 158, 483}, { 140, 270, -344, -631}, { 924, 579, -116, 132}, +{ 142, 466, -68, -64}, { 230, -145, -302, -542}, { -803, -912, 1018, 737}, +{ -773, 1015, 630, 297}, {-2596, 95, 445, 336}, {-2122, 491, 510, 191}, +{-1253, 161, -2, -324}, {-1450, -633, -712, -105}, { -842, -254, -411, 100}, +{ -640, -290, 1010, 763}, { -650, 313, 1169, 730}, { 140, 505, 1030, 766}, +{ 772, 287, 1067, 823}, { 495, 749, 305, 323}, { -164, 462, 78, 399}, +{ -342, -874, 69, 597}, { -16, 620, 621, 337}, { -138, -444, -265, 218}, +{ 84, -450, 953, 666}, { -222, -803, 541, 604}, { -921,-1376, 244, 116}, +{ -841, -723, 630, 588}, { 140, 663, 294, 368}, { 935, 1046, 881, 759}, +{ 1746, 1464, 916, 628}, { 436, 963, 281, 1}, { -119, 74, 542, 213}, +{ 1, -567, 301, 241}, { 260, 435, 222, 396}, { 936, 957, 1108, 703}, +{ 510, 506, 808, 478}, { 601, 694, 960, 620}, { 972, 741, 980, 600}, +{ 834, 717, 767, 684}, { 643, 972, 935, 638}, { 501, 661, 720, 851}, +{ -105, -632, -303, -117}, { -429, 130, 789, 442}, { -522, -188, 704, 373}, +{ -759, 42, 814, 523}, { -531,-1137, 373, 578}, { -682,-1203, -455, 285}, +{-1163,-1577,-1098, 44}, { 81, -82, 712, 363}, { 477, 246, 954, 622}, +{ 1604, 1622, 1277, 891}, { 1409, 859, 924, 892}, { 774, 1041, 947, 1142}, +{ 40, -546, -75, 288}, { -616, -106, -697, -26}, { -169, -160, -891, -739}, +{ -279, -384,-1029, -350}, { 1781, 1308, 1046, 816}, { 1580, 1533, 1472, 1178}, +{ 1505, 1076, 1216, 899}, { 890, 904, 564, 654}, { 920, 692, 1021, 856}, +{ -493, 132, 177, 505}, { 71, 195, -28, 97}, { 456, 351, -164, 88}, +{ 439, 278, -40, 350}, { 1395, 949, 234, -95}, { -805, -472, 38, -163}, +{ 367, -98, 489, 523}, { 1025, 1178, 1212, 906}, { 319, 1314, 814, 461}, +{ -123, -543, -804, 447}, { -748, -324, -897,-1127}, { -737, -501, -789, -713}, +{ 715, 777, 1239, 922}, { 1949, 1939, 1368, 865}, { 730, 880, 758, 388}, +{ -871, 454, 17, -251}, { -381, -810,-1583, 239}, { -521, -966, -792, 259}, +{ -890,-1358, -770, -73}, { 166, 349, -212, 323}, { -840, -301, 473, 435}, +{ -679, -464, 728, 351}, { -156, -199, 667, 432}, { 29, -252, 415, 480}, +{ -731, -379, 145, 559}, { -528, -631,-1158, -159}, { 445, 273, 123, 639}, +{ 373, -126, 800, 568}, { 84, -162, 720, 712}, { -830, -536, -185, 222}, +{ 408, 452, 501, 771}, { -897,-1355, -67, 442}, { -792,-1406, 566, 602}, +{ 167, -326, 509, 330}, { -95, -626, -730, -344}, { 1668, 1217, 779, 455}, +{ 1316, 828, 584, 719}, { 404, -31, 1013, 789}, { 89, 107, 891, 549}, +{ 871, 1581, 917, 671}, { 866, 1479, 1289, 854}, { 391, 1068, 1122, 812}, +{ 78, -562, 345, 563}, { 429, -103, 417, 787}, { -122, -437, 411, 788}, +{ -913, -417, 602, 754}, { -226, -16, 151, 760}, { -700, 118, -104, -14}, +{-1128, 48, 284, 393}, { -390, -419, -639, -116}, { -910, 306, 316, -13}, +{ 1207, 984, 821, 669}, {-1195, -693, 140, -213}, { -884, -416, -199, -558}, +{ -616, 245, -404, -664}, { 262, 56, -617, -724}, { -85, -491, -320, -656}, +{ -570, -831, -129, -528}, {-1506, -63, -367, -385}, { -358, -321, 4, 51}, +{ -366, -214, 319, 511}, { 146, 671, -17, -291}, { -110, 464, -139, -496}, +{ -202, 220, -312, -631}, { -660, -73, -655, -820}, { -662, -653,-1288, -857}, +{ -430, -953, -959, -264}, { -49, -468, -72, -381}, { -350, -563, -193, -407}, +{ 55, -408, -803, 11}, { -309, 649, 188, -198}, { -512, 461, -79, -458}, +{-1318, -263, -134, -523}, {-1657, -435, -495, -765}, { 57, -347, -414, 434}, +{-1141, -242, -664, -857}, { 34, -68, -707, -338} +}; + +static const int16_t lsf_5_1[128][4] = { +{ -451,-1065, -529,-1305}, { -450, -756, -497, -863}, { -384, -619, -413, -669}, +{ -317, -538, -331, -556}, { -414, -508, -424, -378}, { -274, -324, -434, -614}, +{ -226, -500, -232, -514}, { -263, -377, -298, -410}, { -151, -710, -174, -818}, +{ -149, -412, -156, -429}, { -288, -462, -186, -203}, { -170, -302, -191, -321}, +{ -131, -147, -297, -395}, { -228, -214, -245, -192}, { -67, -316, -71, -327}, +{ -104, -205, -94, -183}, { -143, -38, -193, -95}, { 16, -76, -124, -248}, +{ 23, -237, 24, -244}, { 18, -136, 44, -111}, { -33, -24, -25, 0}, +{ 149, 19, 23, -143}, { 158, -169, 174, -181}, { 133, -55, 165, -26}, +{ 111, 84, 98, 75}, { 87, 183, -115, -11}, { -8, 130, 11, 170}, +{ 254, 77, 205, 17}, { 183, 112, 262, 194}, { 202, 287, 95, 189}, +{ -42, -105, 234, 179}, { 39, 186, 163, 345}, { 332, 199, 299, 161}, +{ -54, 285, -78, 281}, { -133, 141, -182, 111}, { 249, 341, 271, 364}, +{ 93, 403, 75, 391}, { 92, 510, -138, 220}, { -185, -29, -34, 361}, +{ -115, 320, 3, 554}, { 99, 286, 218, 591}, { -245, 406, -268, 453}, +{ 0, 580, 25, 606}, { 275, 532, 148, 450}, { -73, 739, -285, 518}, +{ -288, 94, -203, 674}, { -140, -74, 205, 714}, { -114, 299, 176, 923}, +{ 182, 557, 240, 705}, { -16, 513, 485, 593}, { 293, 384, 451, 617}, +{ -38, 50, 563, 529}, { 303, 209, 459, 363}, { 433, 452, 450, 454}, +{ 367, 606, 477, 741}, { 432, 353, 368, 267}, { 361, 716, 273, 583}, +{ 453, 166, 510, 172}, { 201, 629, 274, 191}, { 568, 639, 302, 298}, +{ 634, 387, 643, 350}, { 587, 560, 612, 565}, { 600, 788, 487, 672}, +{ 512, 1015, 321, 333}, { 357, 854, -125, 413}, { 474, 712, 17, -151}, +{ 564, 285, 270, -241}, { 971, 889, 489, 220}, { 510, 896, 549, 924}, +{ 327, 825, 290, 911}, { 540, 1108, 158, 805}, { 199, 957, 511, 730}, +{ 100, 874, 13, 791}, { 435, 632, 676, 972}, { 249, 900, 467, 1218}, +{ 781, 1074, 585, 785}, { -23, 669, 267, 1043}, { 619, 1084, 615, 1145}, +{ 622, 905, 916, 1049}, { 80, 331, 584, 1075}, { 89, 639, 988, 961}, +{ 770, 720, 798, 699}, { 492, 447, 899, 627}, { 271, 1188, 725, 1333}, +{ 87, 603, 832, 1603}, { 616, 1127, 890, 1505}, { 1000, 1156, 866, 1009}, +{ 995, 827, 1149, 858}, { 817, 1450, 773, 1320}, { 500, 1389, 312, 1153}, +{ -20, 1084, 64, 1283}, { 2, 1172, 399, 1869}, { 514, 1706, 502, 1636}, +{ 886, 1522, 416, 600}, { 1131, 1350, 1275, 1390}, { 889, 1795, 914, 1766}, +{ 227, 1183, 1250, 1826}, { 505, 1854, 919, 2353}, { -199, 431, 152, 1735}, +{ -213, -28, 392, 1334}, { -153, -52, 978, 1151}, { -323, -400, 813, 1703}, +{ -136, 84, 1449, 2015}, { -331, -143, -137, 1192}, { -256, 534, -157, 1031}, +{ -307, -439, 542, 731}, { -329, -420, -97, 616}, { -362, -168, -322, 366}, +{ -247, -110, -211, 89}, { -196, -309, 20, 59}, { -364, -463, -286, 89}, +{ -336, 175, -432, 141}, { -379, -190, -434, -196}, { -79, 150, -278, -227}, +{ -280, 166, -555, -422}, { -155, 541, -366, 54}, { -29, -83, -301, -774}, +{ 186, 628, -397, -264}, { 242, 293, -197, -585}, { 124, 410, 53, -133}, +{ 10, 340, -570,-1065}, { 65, -446, 68, -493}, { 383, 937, -357, -711}, +{ -359, -250, -677,-1068}, { 292, -26, 363, 6}, { 607, 1313, -127, -10}, +{ 1513, 1886, 713, 972}, { 1469, 2181, 1443, 2016} +}; + +static const int16_t lsf_5_2[256][4] = { +{-1631,-1600,-1796,-2290}, {-1027,-1770,-1100,-2025}, {-1277,-1388,-1367,-1534}, +{ -947,-1461, -972,-1524}, { -999,-1222,-1020,-1172}, { -815, -987, -992,-1371}, +{-1216,-1006,-1289,-1094}, { -744,-1268, -755,-1293}, { -862, -923, -905, -984}, +{ -678,-1051, -685,-1050}, {-1087, -985,-1062, -679}, { -989, -641,-1127, -976}, +{ -762, -654, -890, -806}, { -833,-1091, -706, -629}, { -621, -806, -640, -812}, +{ -775, -634, -779, -543}, { -996, -565,-1075, -580}, { -546, -611, -572, -619}, +{ -760, -290, -879, -526}, { -823, -462, -795, -253}, { -553, -415, -589, -439}, +{ -533, -340, -692, -935}, { -505, -772, -702,-1131}, { -263, -306, -971, -483}, +{ -445, -74, -555, -548}, { -614, -129, -693, -234}, { -396, -246, -475, -250}, +{ -265, -404, -376, -514}, { -417, -510, -300, -313}, { -334, -664, -463, -814}, +{ -386, -704, -337, -615}, { -234, -201, -233, -239}, { -167, -567, -203, -619}, +{ -147, -415, -115, -352}, { -166, -750, -171, -761}, { -270, -879, -264, -903}, +{ -367, -744, 43, -475}, { 14, -653, 43, -670}, { 11, -448, -59, -521}, +{ -126, -119, -155, -613}, { -42, -863, -27, -931}, { 136, -483, 183, -468}, +{ 55, -298, 55, -304}, { 313, -609, 313, -720}, { 322, -167, 100, -541}, +{ -3, -119, -111, -187}, { 233, -236, 260, -234}, { 26, -165, 134, -45}, +{ -40, -549, 360, -203}, { 378, -388, 450, -383}, { 275, 20, 182, -103}, +{ 246, -111, 431, 37}, { 462, -146, 487, -157}, { -284, -59, 503, -184}, +{ 24, 53, -3, 54}, { 122, 259, 333, 66}, { 484, 104, 436, 68}, +{ 195, 116, 190, 206}, { 269, -9, 482, 352}, { 382, 285, 399, 277}, +{ 452, 256, 69, 186}, { 13, 297, -13, 259}, { -95, 30, 56, 394}, +{ 196, 425, 205, 456}, { 281, 577, 15, 191}, { 375, 290, 407, 576}, +{ -56, 227, 544, 405}, { 0, 549, -92, 528}, { -229, 351, -245, 338}, +{ -362, 435, 167, 527}, { -75, 302, 91, 824}, { 129, 599, 496, 679}, +{ 186, 749, 153, 737}, { -281, 600, -348, 615}, { -236, 769, 41, 881}, +{ 38, 890, -220, 841}, { -357, 883, -393, 903}, { -634, 474, -444, 850}, +{ -175, 678, -493, 242}, { -519, 785, -714, 582}, { -541, 366, -543, 434}, +{ -597, 500, -765, 222}, { -702, 917, -743, 962}, { -869, 501, -899, 548}, +{ -379, 200, -435, 157}, { -819, 214, -861, 157}, { -614, 40, -632, 94}, +{ -883, -54, -741, 516}, { -501, 298, -614, -171}, { -870, -161, -865, -23}, +{ -818, 93,-1015, -267}, { -662, -359, -549, 2}, { -442, -121, -377, 0}, +{ -227, 33, -414, -126}, { -129, 212, -934, 34}, {-1082, -282,-1119, -268}, +{ -710, -825, -420, -191}, {-1076, -928, -917, -93}, { -628, -358, 97, 7}, +{ -206, -393, -101, 24}, { -203, 38, -168, 83}, { -599, -423, -279, 426}, +{ -700, 118, -75, 206}, { -981, -673, -680, 417}, { -367, 37, -279, 474}, +{ -129, -318, 319, 296}, { -626, -39, 343, 602}, { -696, -39, -303, 940}, +{ 104, 233, -380, 137}, { -36, 269, -75, -214}, { 120, 43, -529, -477}, +{ 459, 164, -202, -229}, { -49, -167, 609, 792}, { 98, -220, 915, 148}, +{ 293, 283, 869, 91}, { 575, 394, 326, -78}, { 717, 67, 365, -323}, +{ 616, -36, 731, 27}, { 619, 238, 632, 273}, { 448, 99, 801, 476}, +{ 869, 273, 685, 64}, { 789, 72, 1021, 217}, { 793, 459, 734, 360}, +{ 646, 480, 360, 322}, { 429, 464, 638, 430}, { 756, 363, 1000, 404}, +{ 683, 528, 602, 615}, { 655, 413, 946, 687}, { 937, 602, 904, 604}, +{ 555, 737, 786, 662}, { 467, 654, 362, 589}, { 929, 710, 498, 478}, +{ 415, 420, 693, 883}, { 813, 683, 781, 925}, { 913, 939, 726, 732}, +{ 491, 853, 531, 948}, { 734, 963, 315, 808}, { 761, 755, 1144, 760}, +{ 655, 1076, 826, 1057}, { 1091, 838, 1003, 808}, { 1047, 1133, 659, 1101}, +{ 992, 1050, 1074, 1075}, { 971, 694, 1226, 1054}, { 571, 841, 884, 1404}, +{ 1379, 1096, 1080, 861}, { 1231, 735, 1284, 760}, { 1272, 991, 1367, 1053}, +{ 1257, 700, 1050, 534}, { 988, 453, 1264, 599}, { 1140, 679, 1621, 815}, +{ 1384, 521, 1317, 393}, { 1564, 805, 1448, 686}, { 1068, 648, 875, 307}, +{ 1083, 361, 1047, 317}, { 1417, 964, 675, 571}, { 1152, 79, 1114, -47}, +{ 1530, 311, 1721, 314}, { 1166, 689, 514, -94}, { 349, 282, 1412, 328}, +{ 1025, 487, -65, 57}, { 805, 970, 36, 62}, { 769, -263, 791, -346}, +{ 637, 699, -137, 620}, { 534, 541, -735, 194}, { 711, 300, -268, -863}, +{ 926, 769, -708, -428}, { 506, 174, -892, -630}, { 435, 547,-1435, -258}, +{ 621, 471,-1018,-1368}, { -393, 521, -920, -686}, { -25, 20, -982,-1156}, +{ 340, 9,-1558,-1135}, { -352, 48,-1579, -402}, { -887, 6,-1156, -888}, +{ -548, -352,-1643,-1168}, { -159, 610,-2024, -963}, { -225, 193,-1656,-1960}, +{ -245, -493, -964,-1680}, { -936, -635,-1299,-1744}, {-1388, -604,-1540, -835}, +{-1397, -135,-1588, -290}, {-1670, -712,-2011,-1632}, {-1663, -27,-2258, -811}, +{-1157, 184,-1265, 189}, {-1367, 586,-2011, 201}, { -790, 712,-1210, 3}, +{-1033, 808,-1251, 830}, { -111, 635,-1636, 447}, { -463, -949, -445, -928}, +{ -504,-1162, -501,-1211}, { 144, -351, -372,-1052}, { -283,-1059, -279,-1123}, +{ -575,-1438, -587,-1614}, { -935, -984, 229, 690}, { -921, -719, -403, 1362}, +{ -685, -465, 874, 397}, { -509, -46, 317, 1334}, { -485, 456, 813, 439}, +{ -411, 339, 898, 1067}, { -425, 46, 1441, 497}, { -909, -800, 1465, 1046}, +{ -254, -321, 1430, 1165}, { 68, 350, 1034, 666}, { 370, 11, 1311, 790}, +{ 143, 232, 1041, 1562}, { -114, 663, 1616, 1078}, { 454, 579, 1275, 1040}, +{ -76, 909, 752, 1067}, { 153, 512, 348, 1214}, { 614, 385, 1843, 808}, +{ 269, 1034, 203, 1086}, { 652, 1017, 1783, 1130}, { 429, 1327, 387, 1384}, +{ -49, 1183, -72, 1215}, { -416, 1001, 544, 1749}, { -352, 1223, -502, 1199}, +{ -589, 569, -227, 1630}, { -142, 1578, -230, 1715}, { -714, 1288, -838, 1398}, +{ 1131, 1357, -208, 1232}, { 437, 965, -929, 818}, { 811, 1410, 859, 1507}, +{ 164, 1212, 1387, 1793}, { 484, 1874, 456, 2063}, { 996, 1170, 1326, 1402}, +{ 1316, 1360, 1135, 1262}, { 1234, 1618, 1361, 1768}, { 1421, 1227, 1584, 1347}, +{ 854, 672, 1685, 1566}, { 1139, 1270, 2016, 1825}, { 1773, 1581, 1532, 1460}, +{ 1487, 946, 1659, 1021}, { 1744, 1212, 1392, 977}, { 1772, 1161, 1826, 1164}, +{ 1718, 1429, 1973, 1591}, { 1185, 864, 2132, 1061}, { 1799, 814, 1838, 757}, +{ 2104, 1315, 2054, 1258}, { 2113, 915, 2331, 930}, { 1467, 1147, 2590, 1439}, +{ 2245, 1744, 2090, 1620}, { 2358, 1454, 2666, 1506}, { 1876, 1837, 2070, 1975}, +{ 1739, 1577, 682, 1289}, { 1584, 2045, 1454, 2098}, { 2498, 2004, 2711, 2066}, +{ 726, 1588, 2756, 2336}, { 228, 847, 2456, 1659}, { 36, 301, 1942, 1957}, +{ -446, -96, 2154, 1396}, { 1533, 1101, 14, 608}, { -923, -732, 1383, 1982}, +{ 1345, 952, -680, 321}, { 1281, 1268,-1594, 365}, { 941, 946,-1737, -822}, +{ 2374, 2787, 1821, 2788} +}; + +static const int16_t lsf_5_3[256][4] = { +{-1812,-2275,-1879,-2537}, {-1640,-1848,-1695,-2004}, {-1220,-1912,-1221,-2106}, +{-1559,-1588,-1573,-1556}, {-1195,-1615,-1224,-1727}, {-1359,-1151,-1616,-1948}, +{-1274,-1391,-1305,-1403}, {-1607,-1179,-1676,-1311}, {-1443,-1478,-1367, -898}, +{-1256,-1059,-1331,-1134}, { -982,-1133,-1149,-1504}, {-1080,-1308,-1020,-1183}, +{ -980,-1486, -967,-1495}, { -988, -922,-1047,-1077}, { -838,-1179, -858,-1222}, +{-1131,-1041,-1064, -767}, { -872,-1157, -701, -880}, { -706, -906, -774,-1016}, +{ -578,-1080, -801,-1478}, { -591,-1111, -592,-1146}, { -713,-1388, -640,-1376}, +{ -597,-1059, -416, -903}, { -686, -832, -661, -708}, { -444, -868, -490, -921}, +{ -374, -776, -619,-1170}, { -585, -549, -769, -795}, { -435, -659, -530, -741}, +{ -498, -837, -357, -597}, { -279, -871, -243, -887}, { -282, -665, -280, -667}, +{ -165, -560, -394, -903}, { -362, -410, -448, -583}, { -409, -574, -313, -357}, +{ -637, -548, -570, -436}, { -896, -504, -382, -757}, { -58, -481, -165, -618}, +{ -191, -374, -234, -382}, { -222, -683, -25, -480}, { -418, -359, -730, -353}, +{ -324, -157, -432, -322}, { -394, -303, -284, -104}, { -601, -289, -556, -196}, +{ -588, -150, -659, -608}, { -473, -24, -68, -448}, { -474, -8, -506, -45}, +{ -748, -184, -844, -252}, { -901, -91, -584, -97}, { -652, 138, -764, -131}, +{ -678, -12, -670, 165}, { -259, -3, -840, -107}, { -909, 37, -992, 44}, +{ -854, -415, -839, 13}, {-1001, -271,-1026, -309}, { -798, -478, -832, -488}, +{ -943, 168,-1112, -387}, {-1185, -101,-1183, -40}, { -941, -316,-1030, -770}, +{-1044, -625,-1081, -538}, {-1224, -299,-1312, -436}, {-1197, -663,-1167, -161}, +{-1216, -690,-1237, -831}, {-1432, -720,-1403, -493}, { -898, -740, -922, -801}, +{-1102, -402,-1579, -964}, {-1061, -638,-1269,-1438}, {-1499, -934,-1502, -895}, +{-1598, -564,-1723, -717}, { -606, -597,-1166,-1085}, {-1369, -468,-1946,-1493}, +{-1838, -953,-1932, -931}, {-1499, -188,-1635, -421}, {-1457, -338,-1448, -22}, +{-1942, -422,-2006, -249}, { -496, -114,-1910, -755}, {-1289, 174,-1451, -109}, +{ -482, -257,-1221, -508}, {-1617, 151,-1694, 208}, { -654, 107,-1651, 29}, +{-1141, 279,-1215, 306}, {-1228, -506, -730, -175}, {-1236, -101, -969, 551}, +{ -870, 278, -823, 315}, { -563, 376,-1051, 228}, { -507, 280, -599, 281}, +{ -758, 253, -305, 379}, { -755, -134, -611, 660}, { -824, 536, -817, 646}, +{ -413, 49, -341, 177}, { -453, 526, -482, 589}, { -71, 339, -657, 264}, +{ -244, 295, -237, 315}, { -387, 569, -506, -9}, { -377, 14, -160, 661}, +{ -216, 40, -308, -46}, { 95, 214, -242, 167}, { -86, 192, -56, 27}, +{ -76, 31, 36, 309}, { -106, -182, -113, 74}, { -441, -22, 23, 139}, +{ 81, -11, 44, 15}, { -87, -137, -118, -207}, { -158, -58, 272, -92}, +{ -156, -441, 8, -136}, { 128, -221, 101, -218}, { 40, -197, -76, -456}, +{ 9, -445, 33, -423}, { 226, 60, 73, -222}, { 156, -399, 280, -318}, +{ 245, -341, 166, -499}, { 339, -190, 327, -219}, { 325, -137, -89, -596}, +{ 100, -627, 144, -677}, { 487, 28, 252, -391}, { 214, -41, 282, -28}, +{ 99, -286, 331, 49}, { 459, -388, 565, -369}, { 436, 28, 336, -9}, +{ 397, -167, 618, 34}, { 596, -17, 561, -140}, { 299, 79, 522, 125}, +{ 203, 2, 244, 288}, { 255, 211, 175, 82}, { 596, 187, 517, 108}, +{ 381, 255, 365, 297}, { 497, 352, 327, -82}, { 25, 210, 371, 245}, +{ 261, 3, 545, 449}, { 140, 294, 44, 295}, { 212, 347, 244, 494}, +{ 331, 528, 201, 307}, { 349, 411, 613, 284}, { 614, 413, 464, 322}, +{ 624, 397, 97, 200}, { -160, 384, 149, 362}, { 495, 525, 269, 585}, +{ 33, 491, -121, 433}, { 427, 611, 498, 516}, { 171, 443, 497, 666}, +{ 440, 275, 566, 575}, { 146, 639, 155, 670}, { -33, 173, 212, 696}, +{ -166, 601, -191, 695}, { -489, 503, 175, 742}, { 214, 476, 372, 1083}, +{ 578, 530, 586, 777}, { 425, 874, 315, 841}, { 374, 848, -165, 565}, +{ 35, 991, -39, 1062}, { 329, 712, 786, 840}, { 645, 795, 661, 676}, +{ 571, 918, 632, 1079}, { 673, 817, 318, 388}, { 874, 1012, 564, 848}, +{ 880, 620, 557, 479}, { 671, 453, 692, 468}, { 840, 642, 844, 645}, +{ 506, 428, 897, 567}, { 837, 387, 962, 499}, { 691, 561, 939, 926}, +{ 783, 296, 790, 268}, { 1028, 530, 874, 329}, { 548, 143, 675, 291}, +{ 503, 66, 1041, 359}, { 786, 97, 805, 33}, { 837, 470, 511, 49}, +{ 1092, 327, 1174, 323}, { 3, 242, 872, 474}, { 689, 429, 1329, 678}, +{ 1042, 620, 1109, 664}, { 321, 193, 889, 950}, { 1153, 874, 893, 635}, +{ 877, 862, 948, 913}, { 1293, 665, 1320, 639}, { 997, 793, 1402, 1030}, +{ 1176, 1012, 1110, 959}, { 1410, 925, 1403, 915}, { 543, 862, 1116, 1222}, +{ 835, 1190, 835, 1190}, { 959, 1148, 1147, 1376}, { 1300, 1193, 1415, 1231}, +{ 1335, 1341, 746, 1092}, { 1711, 1283, 1389, 1073}, { 1334, 1566, 1153, 1475}, +{ 1645, 1137, 1825, 1220}, { 1056, 1382, 1521, 1730}, { 1632, 1545, 1620, 1542}, +{ 855, 1596, 865, 1667}, { 693, 885, 1716, 1519}, { 1167, 1296, 2209, 1760}, +{ 1952, 1493, 2020, 1482}, { 1534, 1866, 1694, 2008}, { 1566, 748, 1761, 825}, +{ 294, 1392, 1084, 2058}, { 621, 1315, 365, 1287}, { 198, 1028, 488, 1408}, +{ 249, 403, 1014, 1561}, { 324, 363, 1645, 1044}, { 193, 367, 2034, 1859}, +{ -251, 579, 750, 994}, { -243, 30, 1325, 879}, { -28, -169, 624, 917}, +{ -453, 159, 186, 1370}, { -614, 6, 537, 392}, { -94, -291, 781, 229}, +{ -128, -298, 245, 491}, { -701, -648, 972, 789}, { -501, -640, 178, 255}, +{ -365, -390, -255, 317}, { -958, -294, -191, 228}, { -775, -447, 157, -237}, +{ -657, -720, -407, 92}, { -117, -611, 334, -230}, { -679,-1084, -144, -317}, +{ -901, -861, -738, -360}, { -85, -727, -90, -787}, { 100, -22, -391, -263}, +{ -56, -73, -337, -754}, { 5, -189, -706, -624}, { 89, -344, -135,-1113}, +{ -353, -237, -684,-1135}, { -275,-1102, -269,-1203}, { 152, 145, -722,-1232}, +{ 49, 80,-1248, -776}, { -248, 391, -732, -547}, { 469, 218, -255, -864}, +{ 69, 366, -166, -485}, { -688, 191,-1212,-1196}, { -170, -169,-1308,-1631}, +{ 321, 470,-1419,-1243}, { -64, 272,-1361, -248}, { 492, 565, -721, -609}, +{ 195, 485, -573, -133}, { 427, 202, -171, -118}, { 199, 575, 2, -31}, +{ 694, 755,-1366, -39}, { 552, 557, -489, 271}, { 680, 537, 13, -453}, +{ 855, 954, -133, -52}, { -81, 738,-1169, 637}, { 1055, 1059, -95, 676}, +{ 1259, 1081, 489, 305}, { -449, 954, -534, 996}, { -969, 866,-1058, 1059}, +{-1294, 618,-1416, 617}, { -458, 1366, -159, 1821}, { -774, -528, -14, 1110}, +{-1202, -901, -772, 433}, {-1256,-1255,-1011, -302}, { -602, -585, -759,-1618}, +{ -760,-1549, -840,-1921}, { -816, -539,-1769,-2235}, { -227, -36,-2034,-1831}, +{-2107,-1126,-2471,-1816}, {-1470, 252,-2701, -415}, { -571, -467, 1509, 1554}, +{ 2180, 1975, 2326, 2020} +}; + +static const int16_t lsf_5_4[256][4] = { +{-1857,-1681,-1857,-1755}, {-2056,-1150,-2134,-1654}, {-1619,-1099,-1704,-1131}, +{-1345,-1608,-1359,-1638}, {-1338,-1293,-1325,-1265}, {-1664,-1649,-1487, -851}, +{-1346,-1832,-1413,-2188}, {-1282, -681,-1785,-1649}, { -966,-1082,-1183,-1676}, +{-1054,-1073,-1142,-1158}, {-1207, -744,-1274, -997}, { -934,-1383, -927,-1416}, +{-1010,-1305, -783, -955}, {-1049, -900, -993, -817}, { -737, -823, -972,-1189}, +{ -738,-1094, -738,-1154}, { -784, -801, -810, -786}, { -892, -520,-1000, -818}, +{ -644, -965, -577, -882}, { -541, -694, -671, -917}, { -595, -642, -646, -615}, +{ -956, -621, -925, -515}, { -727, -483, -815, -485}, { -840, -578, -440, -713}, +{ -578, -325, -657, -670}, { -386, -570, -441, -666}, { -514, -787, -392, -529}, +{ -522, -453, -487, -423}, { -616, -585, -617, -157}, { -662, -268, -680, -348}, +{ -322, -323, -632, -444}, { -304, -430, -332, -458}, { -277, -468, -659, -793}, +{ -319, -636, -227, -554}, { -373, -347, -334, -210}, { -456, -192, -530, -242}, +{ -216, -198, -366, -370}, { -338, -161, -409, -748}, { -107, -380, -294, -643}, +{ -223, -665, -234, -741}, { -141, -496, -130, -510}, { -139, -327, -172, -305}, +{ -306, -580, -164, -263}, { -262, -172, -67, -402}, { 31, -366, -10, -436}, +{ -86, -527, 71, -377}, { -22, -609, -12, -678}, { -67, -319, 63, -191}, +{ 35, -181, -39, -242}, { 126, -167, -140, -544}, { 155, -297, 174, -297}, +{ 38, -8, 117, -380}, { 197, -452, 240, -522}, { 223, -103, 110, -187}, +{ 87, -155, 169, -47}, { 157, 26, -83, -100}, { 128, 80, 209, -62}, +{ 6, 7, 22, 5}, { 318, -20, 248, -45}, { -200, -63, 156, -69}, +{ 250, -183, 369, -126}, { -113, -76, -142, -122}, { -64, -254, -31, 35}, +{ -177, -71, -7, 171}, { 93, 27, 108, 212}, { -330, -209, -123, -70}, +{ -279, 95, -96, 20}, { -188, -61, -314, 87}, { -300, -78, -354, -134}, +{ 11, 122, -140, 122}, { -275, 152, -293, 140}, { -82, 138, -321, -111}, +{ -480, -156, -359, 76}, { -254, -40, -635, -96}, { -522, 79, -507, 8}, +{ -268, 303, -539, 68}, { -446, 61, -522, 306}, { 111, 189, -435, 122}, +{ -379, 166, -571, -398}, { -632, -74, -747, -95}, { -455, 194, -952, 83}, +{ -798, 192, -755, 192}, { -781, -162, -619, 234}, { -663, -297, -488, -109}, +{ -964, -132, -838, -68}, { -843, 58,-1112, -86}, { -805, -299, -944, -253}, +{ -778, -50, -965, -549}, { -352, -98, -992, -343}, {-1117, -315,-1117, -307}, +{-1155, -374, -637, -230}, {-1166, -43,-1299, -100}, { -925, -393,-1274, -600}, +{ -689, -130,-1479, -312}, {-1321, -254,-1464, -442}, {-1292, -613,-1261, -503}, +{-1501, -368,-1322, 26}, {-1432, -66,-1743, -161}, {-1644, -467,-1760, -548}, +{-1393, -568,-1556, -871}, {-1495,-1034,-1387, -571}, {-1917, -528,-1783, -123}, +{-1897, -231,-2054, -323}, {-2052, -906,-1976, -567}, {-1917, -620,-2047, -989}, +{-1077, -370,-2031, -704}, {-2355, -749,-2740,-1089}, {-1909, 159,-2012, 248}, +{ -626, -123,-2339, -962}, { -669, -408,-1379,-1174}, { -452, -364,-1044, -735}, +{ -132, 183,-1620, -752}, { -547, -307, -777,-1261}, { -98, 41, -880,-1091}, +{ -257, 97,-1602,-1833}, { 31, -26, -644, -561}, { -180, -546, -385,-1095}, +{ -410, -802, -414, -827}, { -457, -970, -490,-1109}, { -215, -916, -144, -937}, +{ -493,-1269, -517,-1507}, { 181, 101, -332, -889}, { -836, -937, -559, -429}, +{ -629, -547, -183, -337}, { -545, -82, -250, -286}, { 5, -132, -348, -252}, +{ -293, -472, -158, 100}, { -29, 197, -236, -424}, { -861, -213, -140, -7}, +{ -427, -443, 187, -97}, { -684, -736, -293, 258}, { -368, -152, -150, 392}, +{ -609, 175, -142, 299}, { -138, 152, -119, 329}, { -486, -52, 293, 198}, +{ -183, 117, 175, 331}, { -58, -274, 231, 300}, { -288, 330, -305, 372}, +{ -111, 409, -9, 423}, { 83, 256, 67, 367}, { -19, 248, 91, 113}, +{ -35, 406, -191, 154}, { 238, 296, 5, 197}, { 141, 221, 313, 198}, +{ 211, 421, 244, 334}, { 88, 426, -243, 454}, { 202, 552, -5, 403}, +{ 291, 185, 219, 301}, { 251, 138, 128, 69}, { 197, 288, -140, -61}, +{ 188, 361, 197, 598}, { 442, 273, 290, 143}, { 472, 482, 157, 370}, +{ 415, 321, 372, 385}, { 402, 552, 155, 24}, { 550, 263, -11, 21}, +{ 360, 227, 147, -254}, { 424, 97, 366, -13}, { 375, 141, 449, 232}, +{ 396, 507, 474, 272}, { 701, 324, 362, -47}, { 587, 148, 543, 69}, +{ 400, -51, 561, 59}, { 220, -10, 352, 147}, { 206, 211, 653, 185}, +{ 563, 297, 565, 284}, { 594, 121, 766, 192}, { 398, 118, 642, 434}, +{ 233, 264, 481, 467}, { 129, -165, 699, 239}, { 90, 26, 342, 474}, +{ -55, 27, 388, 94}, { -172, 0, 725, 379}, { -60, 337, 370, 465}, +{ 95, 319, 806, 595}, { 78, 260, 497, 851}, { 210, 560, 458, 574}, +{ -464, 202, 497, 625}, { -202, 152, 48, 712}, { -20, 566, 100, 715}, +{ 455, 468, 411, 605}, { 319, 646, 195, 615}, { 401, 538, 680, 739}, +{ 201, 667, 434, 954}, { 454, 425, 646, 491}, { 606, 681, 416, 508}, +{ 497, 822, 426, 815}, { 660, 647, 628, 716}, { 697, 466, 618, 457}, +{ 685, 460, 365, 309}, { 721, 567, 836, 601}, { 609, 300, 825, 459}, +{ 943, 687, 681, 533}, { 915, 598, 591, 243}, { 876, 451, 874, 420}, +{ 786, 317, 732, 220}, { 922, 317, 1108, 367}, { 531, 466, 1028, 649}, +{ 1053, 615, 1034, 553}, { 829, 602, 1021, 799}, { 927, 803, 878, 763}, +{ 799, 496, 1373, 773}, { 585, 770, 803, 930}, { 1099, 793, 1222, 862}, +{ 1209, 895, 1025, 727}, { 772, 845, 1172, 1115}, { 867, 1021, 830, 1013}, +{ 841, 910, 506, 703}, { 1239, 1077, 620, 819}, { 1196, 1083, 1155, 1081}, +{ 1142, 907, 1547, 1121}, { 1309, 648, 1343, 612}, { 1484, 988, 1479, 937}, +{ 985, 1328, 955, 1341}, { 429, 910, 841, 1338}, { 564, 1179, 412, 1156}, +{ 1427, 1320, 1434, 1330}, { 640, 760, 1726, 1410}, { 190, 555, 1073, 1005}, +{ 426, 257, 839, 980}, { 235, 231, 1520, 1167}, { 109, 293, 1014, 1569}, +{ 305, 142, 1148, 539}, { -291, -108, 1213, 972}, { 22, -216, 667, 828}, +{ -482, 438, 453, 1431}, { -581, -422, 789, 387}, { -358, -454, 174, 780}, +{ -36, -372, 390, -134}, { -629, 160, -306, 751}, {-1258, -331, 177, 522}, +{ -248, 574, -251, 639}, { -531, 407, -596, 394}, { -419, 789, -617, 801}, +{ -986, 399, -857, 727}, { -7, 518, -703, 310}, {-1143, -24,-1002, 287}, +{ -960, 363,-1299, 312}, {-1534, 245,-1557, 305}, { 28, 153, -859, -175}, +{ -33, 332,-1398, -154}, { 212, 410, -593, -197}, {-1092, -704, -904, -65}, +{ 282, 367, -918, -686}, { 345, 93, -258, -357}, { 696, 644, -693, -28}, +{ 448, 493, -273, 193}, { 527, 546, -243, -513}, { 384, -136, 273, -353}, +{ 512, -142, 537, -198}, { 941, 750, 83, 248}, { 578, 861, -56, 592}, +{ 842, 44, 892, 24}, { 33, 890, -16, 982}, { 831, 1398, 1535, 1898}, +{ 1716, 1376, 1948, 1465} +}; + +static const int16_t lsf_5_5[64][4] = { +{-1002, -929,-1096,-1203}, { -641, -931, -604, -961}, { -779, -673, -835, -788}, +{ -416, -664, -458, -766}, { -652, -521, -662, -495}, {-1023, -509,-1023, -428}, +{ -444, -552, -368, -449}, { -479, -211,-1054, -903}, { -316, -249, -569, -591}, +{ -569, -275, -541, -191}, { -716, -188, -842, -264}, { -333, -248, -318, -228}, +{ -275, 1, -567, -228}, { -115, -221, -238, -374}, { -197, -507, -222, -579}, +{ -258, -432, -61, -244}, { -345, 2, -338, 39}, { -215, -169, -58, 0}, +{ -56, -6, -203, -131}, { 1, -186, -5, -211}, { 6, -380, 11, -418}, +{ -116, 131, -134, 113}, { 89, -4, 71, -2}, { -19, -192, 262, 24}, +{ 189, 151, -133, -109}, { 186, -153, 166, -219}, { 37, 139, 193, 171}, +{ 337, 124, 158, -61}, { 141, 226, -13, 190}, { 231, 34, 354, 109}, +{ 316, 201, 244, 164}, { 330, -85, 390, -84}, { 254, 327, 257, 335}, +{ 491, 147, 476, 105}, { 54, 77, 437, 370}, { 421, 314, 449, 342}, +{ 329, 126, 673, 292}, { 571, 388, 243, 193}, { 653, 320, 621, 280}, +{ 194, 380, 517, 581}, { 45, 323, 111, 422}, { 489, 395, 734, 534}, +{ 622, 546, 486, 502}, { 318, 572, 189, 550}, { 385, 422, -157, 153}, +{ -125, 382, -197, 386}, { -263, 334, 228, 697}, { -188, 1, 51, 297}, +{ -507, 213, -376, 397}, { -24, 255, -547, 89}, { -502, -94, 387, 179}, +{ -620, 68, -684, 112}, { -642, -350, -260, 172}, { -438, -324, 264, 648}, +{ -964, -4,-1121, 7}, { -134, 134,-1133, -306}, { 143, 96, -420, -497}, +{-1221, -350,-1527, -685}, { -161, 72, 873, 691}, { 732, 283, 921, 353}, +{ 334, 475, 1095, 821}, { 864, 524, 843, 497}, { 714, 711, 788, 750}, +{ 1076, 714, 1204, 753} +}; + +static const float lsf_3_mean[LP_FILTER_ORDER] = { + 377.441, 554.688, 922.363, 1339.84, 1702.15, + 2046.390, 2452.880, 2741.460, 3116.70, 3348.14 +}; + +static const float lsf_5_mean[LP_FILTER_ORDER] = { + 337.891, 507.080, 834.961, 1247.07, 1646.00, + 1982.910, 2407.960, 2708.010, 3104.00, 3344.97 +}; + +/** Prediction factor table for modes other than 12.2kbit/s */ +static const float pred_fac[LP_FILTER_ORDER] = { + 0.291626, 0.328644, 0.383636, 0.405640, 0.438873, + 0.355560, 0.323120, 0.298065, 0.262238, 0.197876, +}; + +// fixed tables + +/** track start positions for algebraic code book routines */ +static const uint8_t track_position[16] = { + 0, 2, 0, 3, 0, 2, 0, 3, 1, 3, 2, 4, 1, 4, 1, 4 +}; + +/** 3-bit Gray code to binary lookup table */ +static const uint8_t gray_decode[8] = { 0, 5, 15, 10, 25, 30, 20, 35 }; + + +// gain tables + +/** scalar quantized pitch gain table for 7.95 and 12.2 kbps modes */ +static const uint16_t qua_gain_pit[16] = { + 0, 3277, 6556, 8192, 9830, 11469, 12288, 13107, + 13926, 14746, 15565, 16384, 17203, 18022, 18842, 19661 +}; + +/** scalar quantized fixed gain table for 7.95 and 12.2 kbps modes */ +static const uint16_t qua_gain_code[32] = { + 159, 206, 268, 349, 419, 482, 554, 637, + 733, 842, 969, 1114, 1281, 1473, 1694, 1948, + 2241, 2577, 2963, 3408, 3919, 4507, 5183, 5960, + 6855, 7883, 9065, 10425, 12510, 16263, 21142, 27485 +}; + +/** desired mean innovation energy, indexed by active mode */ +static const float energy_mean[8] = { + 33.0, 33.0, 33.0, 28.75, 30.0, 36.0, 33.0, 36.0 +}; + +/** 4-tap moving average prediction coefficients in reverse order */ +static const float energy_pred_fac[4] = { 0.19, 0.34, 0.58, 0.68 }; + +/** gain table for 4.75 kbps mode + * + * first index has even/odd indexes for subframes 0,2/1,3 + * second index is {pitch_gain, fixed_gain_factor} */ +static const uint16_t gains_MODE_4k75[512][2] = { +{ 812, 128}, { 542, 140}, { 2873, 1135}, { 2266, 3402}, { 2067, 563}, +{12677, 647}, { 4132, 1798}, { 5601, 5285}, { 7689, 374}, { 3735, 441}, +{10912, 2638}, {11807, 2494}, {20490, 797}, { 5218, 675}, { 6724, 8354}, +{ 5282, 1696}, { 1488, 428}, { 5882, 452}, { 5332, 4072}, { 3583, 1268}, +{ 2469, 901}, {15894, 1005}, {14982, 3271}, {10331, 4858}, { 3635, 2021}, +{ 2596, 835}, {12360, 4892}, {12206, 1704}, {13432, 1604}, { 9118, 2341}, +{ 3968, 1538}, { 5479, 9936}, { 3795, 417}, { 1359, 414}, { 3640, 1569}, +{ 7995, 3541}, {11405, 645}, { 8552, 635}, { 4056, 1377}, {16608, 6124}, +{11420, 700}, { 2007, 607}, {12415, 1578}, {11119, 4654}, {13680, 1708}, +{11990, 1229}, { 7996, 7297}, {13231, 5715}, { 2428, 1159}, { 2073, 1941}, +{ 6218, 6121}, { 3546, 1804}, { 8925, 1802}, { 8679, 1580}, {13935, 3576}, +{13313, 6237}, { 6142, 1130}, { 5994, 1734}, {14141, 4662}, {11271, 3321}, +{12226, 1551}, {13931, 3015}, { 5081,10464}, { 9444, 6706}, { 1689, 683}, +{ 1436, 1306}, { 7212, 3933}, { 4082, 2713}, { 7793, 704}, {15070, 802}, +{ 6299, 5212}, { 4337, 5357}, { 6676, 541}, { 6062, 626}, {13651, 3700}, +{11498, 2408}, {16156, 716}, {12177, 751}, { 8065,11489}, { 6314, 2256}, +{ 4466, 496}, { 7293, 523}, {10213, 3833}, { 8394, 3037}, { 8403, 966}, +{14228, 1880}, { 8703, 5409}, {16395, 4863}, { 7420, 1979}, { 6089, 1230}, +{ 9371, 4398}, {14558, 3363}, {13559, 2873}, {13163, 1465}, { 5534, 1678}, +{13138,14771}, { 7338, 600}, { 1318, 548}, { 4252, 3539}, {10044, 2364}, +{10587, 622}, {13088, 669}, {14126, 3526}, { 5039, 9784}, {15338, 619}, +{ 3115, 590}, {16442, 3013}, {15542, 4168}, {15537, 1611}, {15405, 1228}, +{16023, 9299}, { 7534, 4976}, { 1990, 1213}, {11447, 1157}, {12512, 5519}, +{ 9475, 2644}, { 7716, 2034}, {13280, 2239}, {16011, 5093}, { 8066, 6761}, +{10083, 1413}, { 5002, 2347}, {12523, 5975}, {15126, 2899}, {18264, 2289}, +{15827, 2527}, {16265,10254}, {14651,11319}, { 1797, 337}, { 3115, 397}, +{ 3510, 2928}, { 4592, 2670}, { 7519, 628}, {11415, 656}, { 5946, 2435}, +{ 6544, 7367}, { 8238, 829}, { 4000, 863}, {10032, 2492}, {16057, 3551}, +{18204, 1054}, { 6103, 1454}, { 5884, 7900}, {18752, 3468}, { 1864, 544}, +{ 9198, 683}, {11623, 4160}, { 4594, 1644}, { 3158, 1157}, {15953, 2560}, +{12349, 3733}, {17420, 5260}, { 6106, 2004}, { 2917, 1742}, {16467, 5257}, +{16787, 1680}, {17205, 1759}, { 4773, 3231}, { 7386, 6035}, {14342,10012}, +{ 4035, 442}, { 4194, 458}, { 9214, 2242}, { 7427, 4217}, {12860, 801}, +{11186, 825}, {12648, 2084}, {12956, 6554}, { 9505, 996}, { 6629, 985}, +{10537, 2502}, {15289, 5006}, {12602, 2055}, {15484, 1653}, {16194, 6921}, +{14231, 5790}, { 2626, 828}, { 5615, 1686}, {13663, 5778}, { 3668, 1554}, +{11313, 2633}, { 9770, 1459}, {14003, 4733}, {15897, 6291}, { 6278, 1870}, +{ 7910, 2285}, {16978, 4571}, {16576, 3849}, {15248, 2311}, {16023, 3244}, +{14459,17808}, {11847, 2763}, { 1981, 1407}, { 1400, 876}, { 4335, 3547}, +{ 4391, 4210}, { 5405, 680}, {17461, 781}, { 6501, 5118}, { 8091, 7677}, +{ 7355, 794}, { 8333, 1182}, {15041, 3160}, {14928, 3039}, {20421, 880}, +{14545, 852}, {12337,14708}, { 6904, 1920}, { 4225, 933}, { 8218, 1087}, +{10659, 4084}, {10082, 4533}, { 2735, 840}, {20657, 1081}, {16711, 5966}, +{15873, 4578}, {10871, 2574}, { 3773, 1166}, {14519, 4044}, {20699, 2627}, +{15219, 2734}, {15274, 2186}, { 6257, 3226}, {13125,19480}, { 7196, 930}, +{ 2462, 1618}, { 4515, 3092}, {13852, 4277}, {10460, 833}, {17339, 810}, +{16891, 2289}, {15546, 8217}, {13603, 1684}, { 3197, 1834}, {15948, 2820}, +{15812, 5327}, {17006, 2438}, {16788, 1326}, {15671, 8156}, {11726, 8556}, +{ 3762, 2053}, { 9563, 1317}, {13561, 6790}, {12227, 1936}, { 8180, 3550}, +{13287, 1778}, {16299, 6599}, {16291, 7758}, { 8521, 2551}, { 7225, 2645}, +{18269, 7489}, {16885, 2248}, {17882, 2884}, {17265, 3328}, { 9417,20162}, +{11042, 8320}, { 1286, 620}, { 1431, 583}, { 5993, 2289}, { 3978, 3626}, +{ 5144, 752}, {13409, 830}, { 5553, 2860}, {11764, 5908}, {10737, 560}, +{ 5446, 564}, {13321, 3008}, {11946, 3683}, {19887, 798}, { 9825, 728}, +{13663, 8748}, { 7391, 3053}, { 2515, 778}, { 6050, 833}, { 6469, 5074}, +{ 8305, 2463}, { 6141, 1865}, {15308, 1262}, {14408, 4547}, {13663, 4515}, +{ 3137, 2983}, { 2479, 1259}, {15088, 4647}, {15382, 2607}, {14492, 2392}, +{12462, 2537}, { 7539, 2949}, {12909,12060}, { 5468, 684}, { 3141, 722}, +{ 5081, 1274}, {12732, 4200}, {15302, 681}, { 7819, 592}, { 6534, 2021}, +{16478, 8737}, {13364, 882}, { 5397, 899}, {14656, 2178}, {14741, 4227}, +{14270, 1298}, {13929, 2029}, {15477, 7482}, {15815, 4572}, { 2521, 2013}, +{ 5062, 1804}, { 5159, 6582}, { 7130, 3597}, {10920, 1611}, {11729, 1708}, +{16903, 3455}, {16268, 6640}, { 9306, 1007}, { 9369, 2106}, {19182, 5037}, +{12441, 4269}, {15919, 1332}, {15357, 3512}, {11898,14141}, {16101, 6854}, +{ 2010, 737}, { 3779, 861}, {11454, 2880}, { 3564, 3540}, { 9057, 1241}, +{12391, 896}, { 8546, 4629}, {11561, 5776}, { 8129, 589}, { 8218, 588}, +{18728, 3755}, {12973, 3149}, {15729, 758}, {16634, 754}, {15222,11138}, +{15871, 2208}, { 4673, 610}, {10218, 678}, {15257, 4146}, { 5729, 3327}, +{ 8377, 1670}, {19862, 2321}, {15450, 5511}, {14054, 5481}, { 5728, 2888}, +{ 7580, 1346}, {14384, 5325}, {16236, 3950}, {15118, 3744}, {15306, 1435}, +{14597, 4070}, {12301,15696}, { 7617, 1699}, { 2170, 884}, { 4459, 4567}, +{18094, 3306}, {12742, 815}, {14926, 907}, {15016, 4281}, {15518, 8368}, +{17994, 1087}, { 2358, 865}, {16281, 3787}, {15679, 4596}, {16356, 1534}, +{16584, 2210}, {16833, 9697}, {15929, 4513}, { 3277, 1085}, { 9643, 2187}, +{11973, 6068}, { 9199, 4462}, { 8955, 1629}, {10289, 3062}, {16481, 5155}, +{15466, 7066}, {13678, 2543}, { 5273, 2277}, {16746, 6213}, {16655, 3408}, +{20304, 3363}, {18688, 1985}, {14172,12867}, {15154,15703}, { 4473, 1020}, +{ 1681, 886}, { 4311, 4301}, { 8952, 3657}, { 5893, 1147}, {11647, 1452}, +{15886, 2227}, { 4582, 6644}, { 6929, 1205}, { 6220, 799}, {12415, 3409}, +{15968, 3877}, {19859, 2109}, { 9689, 2141}, {14742, 8830}, {14480, 2599}, +{ 1817, 1238}, { 7771, 813}, {19079, 4410}, { 5554, 2064}, { 3687, 2844}, +{17435, 2256}, {16697, 4486}, {16199, 5388}, { 8028, 2763}, { 3405, 2119}, +{17426, 5477}, {13698, 2786}, {19879, 2720}, { 9098, 3880}, {18172, 4833}, +{17336,12207}, { 5116, 996}, { 4935, 988}, { 9888, 3081}, { 6014, 5371}, +{15881, 1667}, { 8405, 1183}, {15087, 2366}, {19777, 7002}, {11963, 1562}, +{ 7279, 1128}, {16859, 1532}, {15762, 5381}, {14708, 2065}, {20105, 2155}, +{17158, 8245}, {17911, 6318}, { 5467, 1504}, { 4100, 2574}, {17421, 6810}, +{ 5673, 2888}, {16636, 3382}, { 8975, 1831}, {20159, 4737}, {19550, 7294}, +{ 6658, 2781}, {11472, 3321}, {19397, 5054}, {18878, 4722}, {16439, 2373}, +{20430, 4386}, {11353,26526}, {11593, 3068}, { 2866, 1566}, { 5108, 1070}, +{ 9614, 4915}, { 4939, 3536}, { 7541, 878}, {20717, 851}, { 6938, 4395}, +{16799, 7733}, {10137, 1019}, { 9845, 964}, {15494, 3955}, {15459, 3430}, +{18863, 982}, {20120, 963}, {16876,12887}, {14334, 4200}, { 6599, 1220}, +{ 9222, 814}, {16942, 5134}, { 5661, 4898}, { 5488, 1798}, {20258, 3962}, +{17005, 6178}, {17929, 5929}, { 9365, 3420}, { 7474, 1971}, {19537, 5177}, +{19003, 3006}, {16454, 3788}, {16070, 2367}, { 8664, 2743}, { 9445,26358}, +{10856, 1287}, { 3555, 1009}, { 5606, 3622}, {19453, 5512}, {12453, 797}, +{20634, 911}, {15427, 3066}, {17037,10275}, {18883, 2633}, { 3913, 1268}, +{19519, 3371}, {18052, 5230}, {19291, 1678}, {19508, 3172}, {18072,10754}, +{16625, 6845}, { 3134, 2298}, {10869, 2437}, {15580, 6913}, {12597, 3381}, +{11116, 3297}, {16762, 2424}, {18853, 6715}, {17171, 9887}, {12743, 2605}, +{ 8937, 3140}, {19033, 7764}, {18347, 3880}, {20475, 3682}, {19602, 3380}, +{13044,19373}, {10526,23124} +}; + +/** gain table for 6.70, 7.40 and 10.2 kbps modes + * + * second index is {pitch_gain, fixed_gain_factor} */ +static const uint16_t gains_high[128][2] = { +{ 577, 662}, { 806, 1836}, { 3109, 1052}, { 4181, 1387}, { 2373, 1425}, +{ 3248, 1985}, { 1827, 2320}, { 941, 3314}, { 2351, 2977}, { 3616, 2420}, +{ 3451, 3096}, { 2955, 4301}, { 1848, 4500}, { 3884, 5416}, { 1187, 7210}, +{ 3083, 9000}, { 7384, 883}, { 5962, 1506}, { 5155, 2134}, { 7944, 2009}, +{ 6507, 2250}, { 7670, 2752}, { 5952, 3016}, { 4898, 3764}, { 6989, 3588}, +{ 8174, 3978}, { 6064, 4404}, { 7709, 5087}, { 5523, 6021}, { 7769, 7126}, +{ 6060, 7938}, { 5594,11487}, {10581, 1356}, { 9049, 1597}, { 9794, 2035}, +{ 8946, 2415}, {10296, 2584}, { 9407, 2734}, { 8700, 3218}, { 9757, 3395}, +{10177, 3892}, { 9170, 4528}, {10152, 5004}, { 9114, 5735}, {10500, 6266}, +{10110, 7631}, { 8844, 8727}, { 8956,12496}, {12924, 976}, {11435, 1755}, +{12138, 2328}, {11388, 2368}, {10700, 3064}, {12332, 2861}, {11722, 3327}, +{11270, 3700}, {10861, 4413}, {12082, 4533}, {11283, 5205}, {11960, 6305}, +{11167, 7534}, {12128, 8329}, {10969,10777}, {10300,17376}, {13899, 1681}, +{12580, 2045}, {13265, 2439}, {14033, 2989}, {13452, 3098}, {12396, 3658}, +{13510, 3780}, {12880, 4272}, {13533, 4861}, {12667, 5457}, {13854, 6106}, +{13031, 6483}, {13557, 7721}, {12957, 9311}, {13714,11551}, {12591,15206}, +{15113, 1540}, {15072, 2333}, {14527, 2511}, {14692, 3199}, {15382, 3560}, +{14133, 3960}, {15102, 4236}, {14332, 4824}, {14846, 5451}, {15306, 6083}, +{14329, 6888}, {15060, 7689}, {14406, 9426}, {15387, 9741}, {14824,14271}, +{13600,24939}, {16396, 1969}, {16817, 2832}, {15713, 2843}, {16104, 3336}, +{16384, 3963}, {16940, 4579}, {15711, 4599}, {16222, 5448}, {16832, 6382}, +{15745, 7141}, {16326, 7469}, {16611, 8624}, {17028,10418}, {15905,11817}, +{16878,14690}, {16515,20870}, {18142, 2083}, {19401, 3178}, {17508, 3426}, +{20054, 4027}, {18069, 4249}, {18952, 5066}, {17711, 5402}, {19835, 6192}, +{17950, 7014}, {21318, 7877}, {17910, 9289}, {19144, 9290}, {20517,11381}, +{18075,14485}, {19999,17882}, {18842,32764} +}; + +/** gain table for 5.15 and 5.90 kbps modes + * + * second index is {pitch_gain, fixed_gain_factor} */ +static const uint16_t gains_low[64][2] = { +{10813,28753}, {20480, 2785}, {18841, 6594}, { 6225, 7413}, {17203,10444}, +{21626, 1269}, {21135, 4423}, {11304, 1556}, {19005,12820}, {17367, 2498}, +{17858, 4833}, { 9994, 2498}, {17530, 7864}, {14254, 1884}, {15892, 3153}, +{ 6717, 1802}, {18186,20193}, {18022, 3031}, {16711, 5857}, { 8847, 4014}, +{15892, 8970}, {18022, 1392}, {16711, 4096}, { 8192, 655}, {15237,13926}, +{14254, 3112}, {14090, 4669}, { 5406, 2703}, {13434, 6553}, {12451, 901}, +{12451, 2662}, { 3768, 655}, {14745,23511}, {19169, 2457}, {20152, 5079}, +{ 6881, 4096}, {20480, 8560}, {19660, 737}, {19005, 4259}, { 7864, 2088}, +{11468,12288}, {15892, 1474}, {15728, 4628}, { 9175, 1433}, {16056, 7004}, +{14827, 737}, {15073, 2252}, { 5079, 1228}, {13271,17326}, {16547, 2334}, +{15073, 5816}, { 3932, 3686}, {14254, 8601}, {16875, 778}, {15073, 3809}, +{ 6062, 614}, { 9338, 9256}, {13271, 1761}, {13271, 3522}, { 2457, 1966}, +{11468, 5529}, {10485, 737}, {11632, 3194}, { 1474, 778} +}; + + +// pre-processing tables + +/** impulse response filter tables converted to float from Q15 int32_t + * used for anti-sparseness processing */ +static const float ir_filter_strong_MODE_7k95[AMR_SUBFRAME_SIZE] = { + 0.817169, 0.024445, 0.076447, -0.020844, -0.042175, 0.017761, 0.018433, +-0.038879, 0.107147, -0.179871, 0.138367, -0.015228, -0.059204, 0.091888, +-0.154358, 0.171326, -0.060730, -0.032379, -0.044525, 0.135559, -0.021362, +-0.162811, 0.140656, 0.013794, -0.017975, -0.102295, 0.090118, 0.038666, +-0.036987, -0.079041, 0.052826, 0.112000, -0.136566, -0.029755, 0.134003, +-0.077423, 0.028961, -0.041595, -0.029877, 0.174988, +}; + +static const float ir_filter_strong[AMR_SUBFRAME_SIZE] = { + 0.448303, 0.351501, 0.038696, -0.084259, -0.173065, 0.229309, -0.001068, +-0.085663, -0.092773, 0.147186, 0.090088, -0.257080, 0.115509, 0.044403, + 0.066498, -0.263580, 0.245697, -0.064178, -0.044373, 0.023712, 0.033813, +-0.072784, 0.068787, -0.011078, -0.020569, -0.064178, 0.184509, -0.173370, + 0.032715, 0.095306, -0.154358, 0.162109, -0.071075, -0.113770, 0.211304, +-0.118683, 0.020599, -0.054169, 0.000885, 0.309601, +}; + +static const float ir_filter_medium[AMR_SUBFRAME_SIZE] = { + 0.923889, 0.116913, -0.123169, 0.090698, -0.031982, -0.030579, 0.075592, +-0.092865, 0.085907, -0.068085, 0.053497, -0.049164, 0.052307, -0.054169, + 0.047089, -0.030762, 0.013092, -0.005157, 0.014404, -0.038574, 0.066406, +-0.082581, 0.076996, -0.049469, 0.010498, 0.025208, -0.046661, 0.052612, +-0.050568, 0.051910, -0.062958, 0.080688, -0.093384, 0.088409, -0.060364, + 0.016998, 0.023804, -0.041779, 0.025696, 0.019989, +}; + +static const float * const ir_filters_lookup[2] = { + ir_filter_strong, ir_filter_medium +}; +static const float * const ir_filters_lookup_MODE_7k95[2] = { + ir_filter_strong_MODE_7k95, ir_filter_medium +}; + +// High-pass coefficients + +static const float highpass_zeros[2] = { -2.0, 1.0 }; +static const float highpass_poles[2] = { -1.933105469, 0.935913085 }; +static const float highpass_gain = 0.939819335; + +#endif /* AVCODEC_AMRNBDATA_H */ diff --git a/include/libavcodec/amrwbdata.h b/include/libavcodec/amrwbdata.h new file mode 100644 index 0000000..95c0aaa --- /dev/null +++ b/include/libavcodec/amrwbdata.h @@ -0,0 +1,1890 @@ +/* + * AMR wideband data and definitions + * Copyright (c) 2010 Marcelo Galvao Povoa + * + * 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 + */ + +/** + * @file + * AMR wideband data and definitions + */ + +#ifndef AVCODEC_AMRWBDATA_H +#define AVCODEC_AMRWBDATA_H + +#include +#include + +#define LP_ORDER 16 ///< linear predictive coding filter order +#define LP_ORDER_16k 20 ///< lpc filter order at 16kHz +#define HB_FIR_SIZE 30 ///< amount of past data needed by HB filters +#define UPS_FIR_SIZE 12 ///< upsampling filter size +#define UPS_MEM_SIZE (2 * UPS_FIR_SIZE) + +#define MIN_ISF_SPACING (128.0 / 32768.0) ///< minimum isf gap +#define PRED_FACTOR (1.0 / 3.0) +#define MIN_ENERGY -14.0 ///< initial innovation energy (dB) +#define ENERGY_MEAN 30.0 ///< mean innovation energy (dB) in all modes +#define PREEMPH_FAC 0.68 ///< factor used to de-emphasize synthesis + +#define AMRWB_SFR_SIZE 64 ///< samples per subframe at 12.8 kHz +#define AMRWB_SFR_SIZE_16k 80 ///< samples per subframe at 16 kHz +#define AMRWB_P_DELAY_MAX 231 ///< maximum pitch delay value +#define AMRWB_P_DELAY_MIN 34 + +/* Relative mode ordering is sensitive */ +enum Mode { + MODE_6k60 = 0, ///< 6.60 kbit/s + MODE_8k85, ///< 8.85 kbit/s + MODE_12k65, ///< 12.65 kbit/s + MODE_14k25, ///< 14.25 kbit/s + MODE_15k85, ///< 15.85 kbit/s + MODE_18k25, ///< 18.25 kbit/s + MODE_19k85, ///< 19.85 kbit/s + MODE_23k05, ///< 23.05 kbit/s + MODE_23k85, ///< 23.85 kbit/s + MODE_SID, ///< comfort noise frame + /* 10-13: Future use */ + SP_LOST = 14, ///< speech lost + NO_DATA ///< no transmission +}; + +/* All decoded parameters in these structs must be 2 bytes long + * because of the direct indexing at the frame parsing */ +typedef struct AMRWBSubFrame { + uint16_t adap; ///< adaptive codebook index + uint16_t ltp; ///< ltp-filtering flag + uint16_t vq_gain; ///< VQ adaptive and innovative gains + uint16_t hb_gain; ///< high-band energy index (mode 23k85 only) + uint16_t pul_ih[4]; ///< MSBs part of codebook index (high modes only) + uint16_t pul_il[4]; ///< LSBs part of codebook index +} AMRWBSubFrame; + +typedef struct AMRWBFrame { + uint16_t vad; ///< voice activity detection flag + uint16_t isp_id[7]; ///< index of ISP subvectors + AMRWBSubFrame subframe[4]; ///< data for subframes +} AMRWBFrame; + +/** The index of a frame parameter */ +#define AMR_BIT(field) (offsetof(AMRWBFrame, field)) +/** The index of a subframe-specific parameter */ +#define AMR_OF(frame_num, variable) AMR_BIT(subframe[frame_num].variable) + +//As defined in 3GPP TS 26.201 V9.0.0 +//Tables for bit parsing in Core Frame speech frames +//The reordered bits are in order of decreasing importance and +//may be contiguously separated in Class A, B and C bits. + +// Each field in AMRWBFrame is stored as: +// * one byte for the number of bits in the field +// * one byte for the field index +// * then, one byte for each bit of the field (from most-significant to least) +// of the position of that bit in the AMR frame. +static const uint16_t order_MODE_6k60[] = { + 1, AMR_BIT(vad), 7, + 8, AMR_BIT(isp_id[0]), 24, 33, 39, 12, 6, 5, 4, 13, + 8, AMR_BIT(isp_id[1]), 65, 79, 64, 78, 51, 61, 71, 70, + 7, AMR_BIT(isp_id[2]), 52, 55, 44, 54, 53, 43, 42, + 7, AMR_BIT(isp_id[3]), 60, 59, 58, 57, 56, 75, 74, + 6, AMR_BIT(isp_id[4]), 73, 72, 86, 87, 85, 84, + 8, AMR_OF(0, adap), 11, 10, 9, 8, 28, 27, 49, 69, + 6, AMR_OF(0, pul_il[0]), 83, 91, 99, 107, 115, 123, + 6, AMR_OF(0, pul_il[1]), 82, 103, 111, 119, 127, 135, + 6, AMR_OF(0, vq_gain), 38, 23, 34, 19, 3, 15, + 5, AMR_OF(1, adap), 32, 41, 63, 67, 77, + 6, AMR_OF(1, pul_il[0]), 81, 90, 98, 106, 114, 122, + 6, AMR_OF(1, pul_il[1]), 80, 102, 110, 118, 126, 134, + 6, AMR_OF(1, vq_gain), 26, 22, 36, 18, 2, 14, + 5, AMR_OF(2, adap), 45, 40, 50, 48, 68, + 6, AMR_OF(2, pul_il[0]), 95, 89, 97, 105, 113, 121, + 6, AMR_OF(2, pul_il[1]), 94, 101, 109, 117, 125, 133, + 6, AMR_OF(2, vq_gain), 37, 21, 35, 17, 1, 31, + 5, AMR_OF(3, adap), 47, 46, 62, 66, 76, + 6, AMR_OF(3, pul_il[0]), 93, 88, 96, 104, 112, 120, + 6, AMR_OF(3, pul_il[1]), 92, 100, 108, 116, 124, 132, + 6, AMR_OF(3, vq_gain), 25, 20, 29, 16, 0, 30, + 0 +}; + +static const uint16_t order_MODE_8k85[] = { + 1, AMR_BIT(vad), 7, + 8, AMR_BIT(isp_id[0]), 47, 32, 2, 6, 3, 5, 4, 60, + 8, AMR_BIT(isp_id[1]), 69, 50, 67, 41, 51, 49, 59, 53, + 6, AMR_BIT(isp_id[2]), 40, 55, 43, 54, 42, 62, + 7, AMR_BIT(isp_id[3]), 63, 48, 52, 61, 77, 78, 72, + 7, AMR_BIT(isp_id[4]), 85, 56, 86, 68, 74, 73, 81, + 5, AMR_BIT(isp_id[5]), 82, 95, 80, 94, 91, + 5, AMR_BIT(isp_id[6]), 90, 89, 88, 103, 87, + 8, AMR_OF(0, adap), 1, 0, 15, 35, 33, 58, 64, 84, + 5, AMR_OF(0, pul_il[0]), 102, 118, 134, 150, 166, + 5, AMR_OF(0, pul_il[1]), 101, 114, 130, 146, 162, + 5, AMR_OF(0, pul_il[2]), 100, 126, 142, 158, 174, + 5, AMR_OF(0, pul_il[3]), 99, 122, 138, 154, 170, + 6, AMR_OF(0, vq_gain), 11, 39, 19, 31, 27, 23, + 5, AMR_OF(1, adap), 46, 71, 66, 76, 93, + 5, AMR_OF(1, pul_il[0]), 98, 117, 133, 149, 165, + 5, AMR_OF(1, pul_il[1]), 97, 113, 129, 145, 161, + 5, AMR_OF(1, pul_il[2]), 96, 125, 141, 157, 173, + 5, AMR_OF(1, pul_il[3]), 111, 121, 137, 153, 169, + 6, AMR_OF(1, vq_gain), 10, 38, 18, 30, 26, 22, + 8, AMR_OF(2, adap), 14, 13, 12, 34, 45, 57, 79, 83, + 5, AMR_OF(2, pul_il[0]), 110, 116, 132, 148, 164, + 5, AMR_OF(2, pul_il[1]), 109, 112, 128, 144, 160, + 5, AMR_OF(2, pul_il[2]), 108, 124, 140, 156, 172, + 5, AMR_OF(2, pul_il[3]), 107, 120, 136, 152, 168, + 6, AMR_OF(2, vq_gain), 9, 37, 17, 29, 25, 21, + 5, AMR_OF(3, adap), 44, 70, 65, 75, 92, + 5, AMR_OF(3, pul_il[0]), 106, 115, 131, 147, 163, + 5, AMR_OF(3, pul_il[1]), 105, 127, 143, 159, 175, + 5, AMR_OF(3, pul_il[2]), 104, 123, 139, 155, 171, + 5, AMR_OF(3, pul_il[3]), 119, 135, 151, 167, 183, + 6, AMR_OF(3, vq_gain), 8, 36, 16, 28, 24, 20, + 0 +}; + +static const uint16_t order_MODE_12k65[] = { + 1, AMR_BIT(vad), 7, + 8, AMR_BIT(isp_id[0]), 55, 40, 14, 6, 15, 5, 0, 68, + 8, AMR_BIT(isp_id[1]), 77, 58, 75, 49, 59, 57, 67, 61, + 6, AMR_BIT(isp_id[2]), 48, 63, 51, 62, 50, 70, + 7, AMR_BIT(isp_id[3]), 71, 56, 60, 69, 85, 86, 80, + 7, AMR_BIT(isp_id[4]), 93, 64, 94, 76, 82, 81, 89, + 5, AMR_BIT(isp_id[5]), 90, 103, 88, 102, 99, + 5, AMR_BIT(isp_id[6]), 98, 97, 96, 111, 95, + 9, AMR_OF(0, adap), 13, 12, 11, 10, 9, 41, 66, 72, + 92, + 1, AMR_OF(0, ltp), 110, + 9, AMR_OF(0, pul_il[0]), 106, 122, 154, 186, 218, 134, 166, 198, + 230, + 9, AMR_OF(0, pul_il[1]), 105, 130, 162, 194, 226, 142, 174, 206, + 238, + 9, AMR_OF(0, pul_il[2]), 104, 138, 170, 202, 234, 150, 182, 214, + 246, + 9, AMR_OF(0, pul_il[3]), 119, 146, 178, 210, 242, 158, 190, 222, + 254, + 7, AMR_OF(0, vq_gain), 4, 19, 45, 27, 39, 33, 31, + 6, AMR_OF(1, adap), 35, 54, 79, 74, 84, 101, + 1, AMR_OF(1, ltp), 109, + 9, AMR_OF(1, pul_il[0]), 118, 121, 153, 185, 217, 133, 165, 197, + 229, + 9, AMR_OF(1, pul_il[1]), 117, 129, 161, 193, 225, 141, 173, 205, + 237, + 9, AMR_OF(1, pul_il[2]), 116, 137, 169, 201, 233, 149, 181, 213, + 245, + 9, AMR_OF(1, pul_il[3]), 115, 145, 177, 209, 241, 157, 189, 221, + 253, + 7, AMR_OF(1, vq_gain), 3, 18, 44, 26, 38, 32, 30, + 9, AMR_OF(2, adap), 8, 23, 22, 21, 20, 52, 65, 87, + 91, + 1, AMR_OF(2, ltp), 108, + 9, AMR_OF(2, pul_il[0]), 114, 120, 152, 184, 216, 132, 164, 196, + 228, + 9, AMR_OF(2, pul_il[1]), 113, 128, 160, 192, 224, 140, 172, 204, + 236, + 9, AMR_OF(2, pul_il[2]), 112, 136, 168, 200, 232, 148, 180, 212, + 244, + 9, AMR_OF(2, pul_il[3]), 127, 144, 176, 208, 240, 156, 188, 220, + 252, + 7, AMR_OF(2, vq_gain), 2, 17, 43, 25, 37, 47, 29, + 6, AMR_OF(3, adap), 34, 53, 78, 73, 83, 100, + 1, AMR_OF(3, ltp), 107, + 9, AMR_OF(3, pul_il[0]), 126, 135, 167, 199, 231, 131, 163, 195, + 227, + 9, AMR_OF(3, pul_il[1]), 125, 143, 175, 207, 239, 139, 171, 203, + 235, + 9, AMR_OF(3, pul_il[2]), 124, 151, 183, 215, 247, 147, 179, 211, + 243, + 9, AMR_OF(3, pul_il[3]), 123, 159, 191, 223, 255, 155, 187, 219, + 251, + 7, AMR_OF(3, vq_gain), 1, 16, 42, 24, 36, 46, 28, + 0 +}; + +static const uint16_t order_MODE_14k25[] = { + 1, AMR_BIT(vad), 7, + 8, AMR_BIT(isp_id[0]), 55, 40, 14, 6, 15, 5, 0, 68, + 8, AMR_BIT(isp_id[1]), 77, 58, 75, 49, 59, 57, 67, 61, + 6, AMR_BIT(isp_id[2]), 48, 63, 51, 62, 50, 70, + 7, AMR_BIT(isp_id[3]), 71, 56, 60, 69, 85, 86, 80, + 7, AMR_BIT(isp_id[4]), 93, 64, 94, 76, 82, 81, 89, + 5, AMR_BIT(isp_id[5]), 90, 103, 88, 102, 99, + 5, AMR_BIT(isp_id[6]), 98, 97, 96, 111, 95, + 9, AMR_OF(0, adap), 13, 12, 11, 10, 9, 41, 66, 72, + 92, + 1, AMR_OF(0, ltp), 110, + 13, AMR_OF(0, pul_il[0]), 114, 186, 210, 234, 258, 106, 126, 162, + 170, 198, 222, 246, 270, + 13, AMR_OF(0, pul_il[1]), 122, 194, 218, 242, 266, 118, 134, 174, + 182, 206, 230, 254, 278, + 9, AMR_OF(0, pul_il[2]), 130, 138, 146, 154, 178, 202, 226, 250, + 274, + 9, AMR_OF(0, pul_il[3]), 142, 150, 158, 166, 190, 214, 238, 262, + 286, + 7, AMR_OF(0, vq_gain), 4, 19, 45, 27, 39, 33, 31, + 6, AMR_OF(1, adap), 35, 54, 79, 74, 84, 101, + 1, AMR_OF(1, ltp), 109, + 13, AMR_OF(1, pul_il[0]), 113, 185, 209, 233, 257, 105, 125, 161, + 169, 197, 221, 245, 269, + 13, AMR_OF(1, pul_il[1]), 121, 193, 217, 241, 265, 117, 133, 173, + 181, 205, 229, 253, 277, + 9, AMR_OF(1, pul_il[2]), 129, 137, 145, 153, 177, 201, 225, 249, + 273, + 9, AMR_OF(1, pul_il[3]), 141, 149, 157, 165, 189, 213, 237, 261, + 285, + 7, AMR_OF(1, vq_gain), 3, 18, 44, 26, 38, 32, 30, + 9, AMR_OF(2, adap), 8, 23, 22, 21, 20, 52, 65, 87, + 91, + 1, AMR_OF(2, ltp), 108, + 13, AMR_OF(2, pul_il[0]), 112, 184, 208, 232, 256, 104, 124, 160, + 168, 196, 220, 244, 268, + 13, AMR_OF(2, pul_il[1]), 120, 192, 216, 240, 264, 116, 132, 172, + 180, 204, 228, 252, 276, + 9, AMR_OF(2, pul_il[2]), 128, 136, 144, 152, 176, 200, 224, 248, + 272, + 9, AMR_OF(2, pul_il[3]), 140, 148, 156, 164, 188, 212, 236, 260, + 284, + 7, AMR_OF(2, vq_gain), 2, 17, 43, 25, 37, 47, 29, + 6, AMR_OF(3, adap), 34, 53, 78, 73, 83, 100, + 1, AMR_OF(3, ltp), 107, + 13, AMR_OF(3, pul_il[0]), 127, 199, 223, 247, 271, 119, 123, 175, + 183, 195, 219, 243, 267, + 13, AMR_OF(3, pul_il[1]), 135, 207, 231, 255, 279, 115, 131, 171, + 179, 203, 227, 251, 275, + 9, AMR_OF(3, pul_il[2]), 143, 151, 159, 167, 191, 215, 239, 263, + 287, + 9, AMR_OF(3, pul_il[3]), 139, 147, 155, 163, 187, 211, 235, 259, + 283, + 7, AMR_OF(3, vq_gain), 1, 16, 42, 24, 36, 46, 28, + 0 +}; + +static const uint16_t order_MODE_15k85[] = { + 1, AMR_BIT(vad), 7, + 8, AMR_BIT(isp_id[0]), 55, 40, 14, 6, 15, 5, 0, 68, + 8, AMR_BIT(isp_id[1]), 77, 58, 75, 49, 59, 57, 67, 61, + 6, AMR_BIT(isp_id[2]), 48, 63, 51, 62, 50, 70, + 7, AMR_BIT(isp_id[3]), 71, 56, 60, 69, 85, 86, 80, + 7, AMR_BIT(isp_id[4]), 93, 64, 94, 76, 82, 81, 89, + 5, AMR_BIT(isp_id[5]), 90, 103, 88, 102, 99, + 5, AMR_BIT(isp_id[6]), 98, 97, 96, 111, 95, + 9, AMR_OF(0, adap), 13, 12, 11, 10, 9, 41, 66, 72, + 92, + 1, AMR_OF(0, ltp), 110, + 13, AMR_OF(0, pul_il[0]), 122, 154, 170, 218, 266, 138, 106, 182, + 230, 278, 178, 226, 274, + 13, AMR_OF(0, pul_il[1]), 134, 166, 190, 238, 286, 150, 118, 186, + 234, 282, 198, 246, 294, + 13, AMR_OF(0, pul_il[2]), 130, 162, 194, 242, 290, 146, 114, 206, + 254, 302, 202, 250, 298, + 13, AMR_OF(0, pul_il[3]), 142, 174, 214, 262, 310, 158, 126, 210, + 258, 306, 222, 270, 318, + 7, AMR_OF(0, vq_gain), 4, 19, 45, 27, 39, 33, 31, + 6, AMR_OF(1, adap), 35, 54, 79, 74, 84, 101, + 1, AMR_OF(1, ltp), 109, + 13, AMR_OF(1, pul_il[0]), 121, 153, 169, 217, 265, 137, 105, 181, + 229, 277, 177, 225, 273, + 13, AMR_OF(1, pul_il[1]), 133, 165, 189, 237, 285, 149, 117, 185, + 233, 281, 197, 245, 293, + 13, AMR_OF(1, pul_il[2]), 129, 161, 193, 241, 289, 145, 113, 205, + 253, 301, 201, 249, 297, + 13, AMR_OF(1, pul_il[3]), 141, 173, 213, 261, 309, 157, 125, 209, + 257, 305, 221, 269, 317, + 7, AMR_OF(1, vq_gain), 3, 18, 44, 26, 38, 32, 30, + 9, AMR_OF(2, adap), 8, 23, 22, 21, 20, 52, 65, 87, + 91, + 1, AMR_OF(2, ltp), 108, + 13, AMR_OF(2, pul_il[0]), 120, 152, 168, 216, 264, 136, 104, 180, + 228, 276, 176, 224, 272, + 13, AMR_OF(2, pul_il[1]), 132, 164, 188, 236, 284, 148, 116, 184, + 232, 280, 196, 244, 292, + 13, AMR_OF(2, pul_il[2]), 128, 160, 192, 240, 288, 144, 112, 204, + 252, 300, 200, 248, 296, + 13, AMR_OF(2, pul_il[3]), 140, 172, 212, 260, 308, 156, 124, 208, + 256, 304, 220, 268, 316, + 7, AMR_OF(2, vq_gain), 2, 17, 43, 25, 37, 47, 29, + 6, AMR_OF(3, adap), 34, 53, 78, 73, 83, 100, + 1, AMR_OF(3, ltp), 107, + 13, AMR_OF(3, pul_il[0]), 135, 167, 183, 231, 279, 151, 119, 179, + 227, 275, 191, 239, 287, + 13, AMR_OF(3, pul_il[1]), 131, 163, 187, 235, 283, 147, 115, 199, + 247, 295, 195, 243, 291, + 13, AMR_OF(3, pul_il[2]), 143, 175, 207, 255, 303, 159, 127, 203, + 251, 299, 215, 263, 311, + 13, AMR_OF(3, pul_il[3]), 139, 171, 211, 259, 307, 155, 123, 223, + 271, 319, 219, 267, 315, + 7, AMR_OF(3, vq_gain), 1, 16, 42, 24, 36, 46, 28, + 0 +}; + +static const uint16_t order_MODE_18k25[] = { + 1, AMR_BIT(vad), 7, + 8, AMR_BIT(isp_id[0]), 55, 40, 14, 6, 15, 5, 0, 68, + 8, AMR_BIT(isp_id[1]), 77, 58, 75, 49, 59, 57, 67, 61, + 6, AMR_BIT(isp_id[2]), 48, 63, 51, 62, 50, 70, + 7, AMR_BIT(isp_id[3]), 71, 56, 60, 69, 85, 86, 80, + 7, AMR_BIT(isp_id[4]), 93, 64, 94, 76, 82, 81, 89, + 5, AMR_BIT(isp_id[5]), 90, 103, 88, 102, 99, + 5, AMR_BIT(isp_id[6]), 98, 97, 96, 111, 95, + 9, AMR_OF(0, adap), 13, 12, 11, 10, 9, 41, 66, 72, + 92, + 1, AMR_OF(0, ltp), 110, + 2, AMR_OF(0, pul_ih[0]), 124, 115, + 2, AMR_OF(0, pul_ih[1]), 150, 117, + 2, AMR_OF(0, pul_ih[2]), 129, 114, + 2, AMR_OF(0, pul_ih[3]), 121, 131, + 14, AMR_OF(0, pul_il[0]), 161, 257, 343, 199, 177, 303, 204, 173, + 168, 260, 277, 307, 338, 128, + 14, AMR_OF(0, pul_il[1]), 194, 286, 347, 222, 214, 316, 236, 152, + 166, 242, 284, 308, 344, 142, + 14, AMR_OF(0, pul_il[2]), 169, 273, 353, 202, 189, 311, 240, 200, + 171, 261, 309, 296, 345, 130, + 14, AMR_OF(0, pul_il[3]), 198, 275, 349, 187, 163, 282, 193, 195, + 175, 234, 265, 289, 328, 119, + 7, AMR_OF(0, vq_gain), 4, 19, 45, 27, 39, 33, 31, + 6, AMR_OF(1, adap), 35, 54, 79, 74, 84, 101, + 1, AMR_OF(1, ltp), 109, + 2, AMR_OF(1, pul_ih[0]), 139, 104, + 2, AMR_OF(1, pul_ih[1]), 135, 118, + 2, AMR_OF(1, pul_ih[2]), 112, 127, + 2, AMR_OF(1, pul_ih[3]), 140, 141, + 14, AMR_OF(1, pul_il[0]), 179, 276, 340, 225, 223, 321, 235, 190, + 182, 271, 310, 315, 352, 125, + 14, AMR_OF(1, pul_il[1]), 153, 264, 329, 232, 209, 323, 231, 165, + 191, 279, 290, 312, 367, 134, + 14, AMR_OF(1, pul_il[2]), 167, 269, 341, 205, 197, 298, 224, 160, + 170, 259, 280, 317, 357, 148, + 14, AMR_OF(1, pul_il[3]), 203, 272, 342, 227, 192, 299, 233, 172, + 183, 256, 283, 326, 355, 106, + 7, AMR_OF(1, vq_gain), 3, 18, 44, 26, 38, 32, 30, + 9, AMR_OF(2, adap), 8, 23, 22, 21, 20, 52, 65, 87, + 91, + 1, AMR_OF(2, ltp), 108, + 2, AMR_OF(2, pul_ih[0]), 144, 120, + 2, AMR_OF(2, pul_ih[1]), 157, 123, + 2, AMR_OF(2, pul_ih[2]), 145, 138, + 2, AMR_OF(2, pul_ih[3]), 132, 154, + 14, AMR_OF(2, pul_il[0]), 241, 319, 365, 252, 253, 331, 254, 230, + 220, 263, 285, 314, 364, 156, + 14, AMR_OF(2, pul_il[1]), 247, 291, 339, 249, 250, 332, 267, 196, + 207, 268, 304, 324, 356, 158, + 14, AMR_OF(2, pul_il[2]), 210, 300, 348, 243, 237, 333, 246, 206, + 219, 266, 318, 335, 363, 159, + 14, AMR_OF(2, pul_il[3]), 239, 306, 366, 221, 226, 297, 251, 184, + 178, 258, 292, 305, 346, 116, + 7, AMR_OF(2, vq_gain), 2, 17, 43, 25, 37, 47, 29, + 6, AMR_OF(3, adap), 34, 53, 78, 73, 83, 100, + 1, AMR_OF(3, ltp), 107, + 2, AMR_OF(3, pul_ih[0]), 143, 126, + 2, AMR_OF(3, pul_ih[1]), 137, 122, + 2, AMR_OF(3, pul_ih[2]), 149, 105, + 2, AMR_OF(3, pul_ih[3]), 133, 136, + 14, AMR_OF(3, pul_il[0]), 162, 287, 337, 244, 229, 322, 218, 180, + 186, 262, 274, 288, 351, 146, + 14, AMR_OF(3, pul_il[1]), 212, 294, 358, 248, 228, 334, 215, 174, + 176, 270, 293, 301, 354, 147, + 14, AMR_OF(3, pul_il[2]), 185, 327, 336, 211, 213, 313, 245, 181, + 188, 255, 281, 325, 350, 151, + 14, AMR_OF(3, pul_il[3]), 201, 295, 359, 216, 208, 320, 238, 164, + 155, 217, 278, 302, 330, 113, + 7, AMR_OF(3, vq_gain), 1, 16, 42, 24, 36, 46, 28, + 0 +}; + +static const uint16_t order_MODE_19k85[] = { + 1, AMR_BIT(vad), 7, + 8, AMR_BIT(isp_id[0]), 55, 40, 14, 6, 15, 5, 0, 68, + 8, AMR_BIT(isp_id[1]), 77, 58, 75, 49, 59, 57, 67, 61, + 6, AMR_BIT(isp_id[2]), 48, 63, 51, 62, 50, 70, + 7, AMR_BIT(isp_id[3]), 71, 56, 60, 69, 85, 86, 80, + 7, AMR_BIT(isp_id[4]), 93, 64, 94, 76, 82, 81, 89, + 5, AMR_BIT(isp_id[5]), 90, 103, 88, 102, 99, + 5, AMR_BIT(isp_id[6]), 98, 97, 96, 111, 95, + 9, AMR_OF(0, adap), 13, 12, 11, 10, 9, 41, 66, 72, + 92, + 1, AMR_OF(0, ltp), 110, + 10, AMR_OF(0, pul_ih[0]), 134, 153, 263, 342, 399, 154, 106, 177, + 317, 265, + 10, AMR_OF(0, pul_ih[1]), 128, 167, 270, 351, 385, 160, 105, 213, + 329, 259, + 2, AMR_OF(0, pul_ih[2]), 123, 147, + 2, AMR_OF(0, pul_ih[3]), 131, 143, + 10, AMR_OF(0, pul_il[0]), 346, 118, 170, 201, 296, 368, 250, 284, + 341, 391, + 10, AMR_OF(0, pul_il[1]), 345, 104, 166, 196, 281, 374, 242, 269, + 327, 390, + 14, AMR_OF(0, pul_il[2]), 141, 171, 291, 364, 229, 210, 308, 228, + 206, 200, 258, 295, 313, 361, + 14, AMR_OF(0, pul_il[3]), 144, 188, 282, 366, 217, 216, 309, 218, + 193, 182, 245, 287, 300, 367, + 7, AMR_OF(0, vq_gain), 4, 19, 45, 27, 39, 33, 31, + 6, AMR_OF(1, adap), 35, 54, 79, 74, 84, 101, + 1, AMR_OF(1, ltp), 109, + 10, AMR_OF(1, pul_ih[0]), 139, 169, 267, 348, 389, 163, 116, 189, + 343, 268, + 10, AMR_OF(1, pul_ih[1]), 120, 161, 249, 339, 397, 152, 114, 230, + 334, 303, + 2, AMR_OF(1, pul_ih[2]), 125, 138, + 2, AMR_OF(1, pul_ih[3]), 112, 129, + 10, AMR_OF(1, pul_il[0]), 349, 122, 162, 203, 288, 372, 278, 274, + 312, 377, + 10, AMR_OF(1, pul_il[1]), 357, 126, 165, 214, 298, 362, 252, 260, + 321, 378, + 14, AMR_OF(1, pul_il[2]), 150, 199, 266, 355, 211, 180, 285, 241, + 195, 198, 243, 275, 323, 375, + 14, AMR_OF(1, pul_il[3]), 142, 191, 256, 353, 208, 220, 314, 237, + 190, 212, 255, 304, 318, 371, + 7, AMR_OF(1, vq_gain), 3, 18, 44, 26, 38, 32, 30, + 9, AMR_OF(2, adap), 8, 23, 22, 21, 20, 52, 65, 87, + 91, + 1, AMR_OF(2, ltp), 108, + 10, AMR_OF(2, pul_ih[0]), 159, 168, 302, 356, 395, 178, 132, 185, + 330, 286, + 10, AMR_OF(2, pul_ih[1]), 158, 181, 292, 358, 396, 176, 133, 235, + 331, 276, + 2, AMR_OF(2, pul_ih[2]), 130, 157, + 2, AMR_OF(2, pul_ih[3]), 124, 136, + 10, AMR_OF(2, pul_il[0]), 354, 121, 194, 246, 322, 379, 272, 273, + 332, 398, + 10, AMR_OF(2, pul_il[1]), 359, 140, 186, 236, 333, 376, 290, 301, + 338, 387, + 14, AMR_OF(2, pul_il[2]), 155, 227, 319, 369, 253, 254, 350, 248, + 224, 239, 240, 293, 315, 383, + 14, AMR_OF(2, pul_il[3]), 156, 209, 297, 373, 225, 215, 326, 247, + 197, 184, 232, 289, 310, 365, + 7, AMR_OF(2, vq_gain), 2, 17, 43, 25, 37, 47, 29, + 6, AMR_OF(3, adap), 34, 53, 78, 73, 83, 100, + 1, AMR_OF(3, ltp), 107, + 10, AMR_OF(3, pul_ih[0]), 148, 164, 264, 340, 388, 183, 117, 205, + 336, 261, + 10, AMR_OF(3, pul_ih[1]), 146, 174, 257, 335, 384, 173, 113, 187, + 320, 279, + 2, AMR_OF(3, pul_ih[2]), 127, 151, + 2, AMR_OF(3, pul_ih[3]), 119, 137, + 10, AMR_OF(3, pul_il[0]), 352, 135, 172, 238, 306, 381, 262, 271, + 328, 382, + 10, AMR_OF(3, pul_il[1]), 347, 115, 179, 219, 305, 380, 277, 294, + 337, 386, + 14, AMR_OF(3, pul_il[2]), 145, 192, 307, 370, 234, 223, 324, 244, + 202, 204, 251, 299, 325, 360, + 14, AMR_OF(3, pul_il[3]), 149, 221, 311, 363, 226, 222, 316, 231, + 207, 175, 233, 280, 283, 344, + 7, AMR_OF(3, vq_gain), 1, 16, 42, 24, 36, 46, 28, + 0 +}; + +static const uint16_t order_MODE_23k05[] = { + 1, AMR_BIT(vad), 7, + 8, AMR_BIT(isp_id[0]), 55, 40, 14, 6, 15, 5, 0, 68, + 8, AMR_BIT(isp_id[1]), 77, 58, 75, 49, 59, 57, 67, 61, + 6, AMR_BIT(isp_id[2]), 48, 63, 51, 62, 50, 70, + 7, AMR_BIT(isp_id[3]), 71, 56, 60, 69, 85, 86, 80, + 7, AMR_BIT(isp_id[4]), 93, 64, 94, 76, 82, 81, 89, + 5, AMR_BIT(isp_id[5]), 90, 103, 88, 102, 99, + 5, AMR_BIT(isp_id[6]), 98, 97, 96, 111, 95, + 9, AMR_OF(0, adap), 13, 12, 11, 10, 9, 41, 66, 72, + 92, + 1, AMR_OF(0, ltp), 110, + 11, AMR_OF(0, pul_ih[0]), 118, 129, 131, 153, 170, 282, 298, 210, + 191, 357, 317, + 11, AMR_OF(0, pul_ih[1]), 126, 146, 135, 165, 187, 273, 345, 295, + 172, 338, 340, + 11, AMR_OF(0, pul_ih[2]), 119, 137, 141, 167, 208, 304, 366, 256, + 177, 339, 328, + 11, AMR_OF(0, pul_ih[3]), 116, 130, 120, 166, 190, 252, 311, 239, + 173, 343, 318, + 11, AMR_OF(0, pul_il[0]), 245, 180, 342, 424, 259, 277, 266, 380, + 398, 423, 440, + 11, AMR_OF(0, pul_il[1]), 218, 207, 367, 434, 201, 240, 275, 363, + 399, 419, 452, + 11, AMR_OF(0, pul_il[2]), 274, 188, 348, 425, 242, 204, 262, 365, + 402, 431, 463, + 11, AMR_OF(0, pul_il[3]), 221, 183, 337, 439, 243, 216, 251, 354, + 390, 411, 462, + 7, AMR_OF(0, vq_gain), 4, 19, 45, 27, 39, 33, 31, + 6, AMR_OF(1, adap), 35, 54, 79, 74, 84, 101, + 1, AMR_OF(1, ltp), 109, + 11, AMR_OF(1, pul_ih[0]), 115, 140, 142, 161, 230, 291, 351, 235, + 181, 293, 310, + 11, AMR_OF(1, pul_ih[1]), 104, 138, 132, 162, 211, 315, 347, 233, + 176, 320, 329, + 11, AMR_OF(1, pul_ih[2]), 106, 134, 125, 154, 205, 267, 306, 220, + 185, 330, 297, + 11, AMR_OF(1, pul_ih[3]), 105, 148, 122, 152, 215, 302, 350, 254, + 178, 319, 313, + 11, AMR_OF(1, pul_il[0]), 269, 189, 382, 432, 272, 228, 263, 383, + 406, 422, 453, + 11, AMR_OF(1, pul_il[1]), 286, 206, 377, 446, 226, 222, 265, 368, + 404, 416, 454, + 11, AMR_OF(1, pul_il[2]), 247, 195, 358, 445, 224, 236, 309, 341, + 375, 408, 449, + 11, AMR_OF(1, pul_il[3]), 225, 192, 359, 436, 250, 258, 290, 389, + 400, 420, 448, + 7, AMR_OF(1, vq_gain), 3, 18, 44, 26, 38, 32, 30, + 9, AMR_OF(2, adap), 8, 23, 22, 21, 20, 52, 65, 87, + 91, + 1, AMR_OF(2, ltp), 108, + 11, AMR_OF(2, pul_ih[0]), 139, 144, 145, 169, 234, 327, 395, 299, + 244, 356, 379, + 11, AMR_OF(2, pul_ih[1]), 127, 156, 158, 171, 231, 308, 397, 355, + 261, 371, 335, + 11, AMR_OF(2, pul_ih[2]), 123, 155, 157, 193, 241, 362, 384, 323, + 238, 392, 361, + 11, AMR_OF(2, pul_ih[3]), 114, 147, 121, 175, 196, 333, 373, 303, + 184, 353, 322, + 11, AMR_OF(2, pul_il[0]), 271, 203, 385, 442, 307, 276, 334, 405, + 412, 427, 459, + 11, AMR_OF(2, pul_il[1]), 278, 200, 388, 447, 292, 288, 296, 403, + 415, 429, 460, + 11, AMR_OF(2, pul_il[2]), 312, 214, 393, 433, 279, 301, 314, 391, + 410, 426, 450, + 11, AMR_OF(2, pul_il[3]), 280, 186, 376, 437, 268, 260, 255, 364, + 414, 417, 441, + 7, AMR_OF(2, vq_gain), 2, 17, 43, 25, 37, 47, 29, + 6, AMR_OF(3, adap), 34, 53, 78, 73, 83, 100, + 1, AMR_OF(3, ltp), 107, + 11, AMR_OF(3, pul_ih[0]), 112, 159, 143, 164, 213, 281, 332, 284, + 168, 344, 325, + 11, AMR_OF(3, pul_ih[1]), 113, 150, 149, 179, 199, 316, 324, 285, + 237, 360, 336, + 11, AMR_OF(3, pul_ih[2]), 124, 136, 151, 174, 209, 326, 349, 248, + 198, 374, 331, + 11, AMR_OF(3, pul_ih[3]), 117, 128, 133, 163, 202, 300, 372, 305, + 194, 387, 321, + 11, AMR_OF(3, pul_il[0]), 249, 182, 352, 428, 253, 264, 289, 413, + 407, 418, 461, + 11, AMR_OF(3, pul_il[1]), 287, 212, 369, 444, 223, 246, 217, 346, + 394, 401, 451, + 11, AMR_OF(3, pul_il[2]), 219, 197, 378, 435, 229, 257, 283, 396, + 409, 430, 455, + 11, AMR_OF(3, pul_il[3]), 232, 160, 370, 438, 227, 270, 294, 381, + 386, 421, 443, + 7, AMR_OF(3, vq_gain), 1, 16, 42, 24, 36, 46, 28, + 0 +}; + +static const uint16_t order_MODE_23k85[] = { + 1, AMR_BIT(vad), 7, + 8, AMR_BIT(isp_id[0]), 55, 40, 14, 6, 15, 5, 0, 68, + 8, AMR_BIT(isp_id[1]), 93, 58, 91, 49, 59, 57, 67, 61, + 6, AMR_BIT(isp_id[2]), 48, 63, 51, 62, 50, 70, + 7, AMR_BIT(isp_id[3]), 71, 56, 60, 69, 101, 102, 96, + 7, AMR_BIT(isp_id[4]), 109, 64, 110, 92, 98, 97, 105, + 5, AMR_BIT(isp_id[5]), 106, 119, 104, 118, 115, + 5, AMR_BIT(isp_id[6]), 114, 113, 112, 127, 111, + 9, AMR_OF(0, adap), 13, 12, 11, 10, 9, 41, 66, 88, + 108, + 1, AMR_OF(0, ltp), 126, + 11, AMR_OF(0, pul_ih[0]), 134, 145, 147, 169, 186, 298, 314, 226, + 207, 373, 333, + 11, AMR_OF(0, pul_ih[1]), 142, 162, 151, 181, 203, 289, 361, 311, + 188, 354, 356, + 11, AMR_OF(0, pul_ih[2]), 135, 153, 157, 183, 224, 320, 382, 272, + 193, 355, 344, + 11, AMR_OF(0, pul_ih[3]), 132, 146, 136, 182, 206, 268, 327, 255, + 189, 359, 334, + 11, AMR_OF(0, pul_il[0]), 261, 196, 358, 440, 275, 293, 282, 396, + 414, 439, 456, + 11, AMR_OF(0, pul_il[1]), 234, 223, 383, 450, 217, 256, 291, 379, + 415, 435, 468, + 11, AMR_OF(0, pul_il[2]), 290, 204, 364, 441, 258, 220, 278, 381, + 418, 447, 479, + 11, AMR_OF(0, pul_il[3]), 237, 199, 353, 455, 259, 232, 267, 370, + 406, 427, 478, + 7, AMR_OF(0, vq_gain), 4, 19, 45, 27, 39, 33, 31, + 4, AMR_OF(0, hb_gain), 79, 78, 77, 76, + 6, AMR_OF(1, adap), 35, 54, 95, 90, 100, 117, + 1, AMR_OF(1, ltp), 125, + 11, AMR_OF(1, pul_ih[0]), 131, 156, 158, 177, 246, 307, 367, 251, + 197, 309, 326, + 11, AMR_OF(1, pul_ih[1]), 120, 154, 148, 178, 227, 331, 363, 249, + 192, 336, 345, + 11, AMR_OF(1, pul_ih[2]), 122, 150, 141, 170, 221, 283, 322, 236, + 201, 346, 313, + 11, AMR_OF(1, pul_ih[3]), 121, 164, 138, 168, 231, 318, 366, 270, + 194, 335, 329, + 11, AMR_OF(1, pul_il[0]), 285, 205, 398, 448, 288, 244, 279, 399, + 422, 438, 469, + 11, AMR_OF(1, pul_il[1]), 302, 222, 393, 462, 242, 238, 281, 384, + 420, 432, 470, + 11, AMR_OF(1, pul_il[2]), 263, 211, 374, 461, 240, 252, 325, 357, + 391, 424, 465, + 11, AMR_OF(1, pul_il[3]), 241, 208, 375, 452, 266, 274, 306, 405, + 416, 436, 464, + 7, AMR_OF(1, vq_gain), 3, 18, 44, 26, 38, 32, 30, + 4, AMR_OF(1, hb_gain), 75, 74, 73, 72, + 9, AMR_OF(2, adap), 8, 23, 22, 21, 20, 52, 65, 103, + 107, + 1, AMR_OF(2, ltp), 124, + 11, AMR_OF(2, pul_ih[0]), 155, 160, 161, 185, 250, 343, 411, 315, + 260, 372, 395, + 11, AMR_OF(2, pul_ih[1]), 143, 172, 174, 187, 247, 324, 413, 371, + 277, 387, 351, + 11, AMR_OF(2, pul_ih[2]), 139, 171, 173, 209, 257, 378, 400, 339, + 254, 408, 377, + 11, AMR_OF(2, pul_ih[3]), 130, 163, 137, 191, 212, 349, 389, 319, + 200, 369, 338, + 11, AMR_OF(2, pul_il[0]), 287, 219, 401, 458, 323, 292, 350, 421, + 428, 443, 475, + 11, AMR_OF(2, pul_il[1]), 294, 216, 404, 463, 308, 304, 312, 419, + 431, 445, 476, + 11, AMR_OF(2, pul_il[2]), 328, 230, 409, 449, 295, 317, 330, 407, + 426, 442, 466, + 11, AMR_OF(2, pul_il[3]), 296, 202, 392, 453, 284, 276, 271, 380, + 430, 433, 457, + 7, AMR_OF(2, vq_gain), 2, 17, 43, 25, 37, 47, 29, + 4, AMR_OF(2, hb_gain), 87, 86, 85, 84, + 6, AMR_OF(3, adap), 34, 53, 94, 89, 99, 116, + 1, AMR_OF(3, ltp), 123, + 11, AMR_OF(3, pul_ih[0]), 128, 175, 159, 180, 229, 297, 348, 300, + 184, 360, 341, + 11, AMR_OF(3, pul_ih[1]), 129, 166, 165, 195, 215, 332, 340, 301, + 253, 376, 352, + 11, AMR_OF(3, pul_ih[2]), 140, 152, 167, 190, 225, 342, 365, 264, + 214, 390, 347, + 11, AMR_OF(3, pul_ih[3]), 133, 144, 149, 179, 218, 316, 388, 321, + 210, 403, 337, + 11, AMR_OF(3, pul_il[0]), 265, 198, 368, 444, 269, 280, 305, 429, + 423, 434, 477, + 11, AMR_OF(3, pul_il[1]), 303, 228, 385, 460, 239, 262, 233, 362, + 410, 417, 467, + 11, AMR_OF(3, pul_il[2]), 235, 213, 394, 451, 245, 273, 299, 412, + 425, 446, 471, + 11, AMR_OF(3, pul_il[3]), 248, 176, 386, 454, 243, 286, 310, 397, + 402, 437, 459, + 7, AMR_OF(3, vq_gain), 1, 16, 42, 24, 36, 46, 28, + 4, AMR_OF(3, hb_gain), 83, 82, 81, 80, + 0 +}; + +/** Reordering array addresses for each mode */ +static const uint16_t * const amr_bit_orderings_by_mode[] = { + order_MODE_6k60, + order_MODE_8k85, + order_MODE_12k65, + order_MODE_14k25, + order_MODE_15k85, + order_MODE_18k25, + order_MODE_19k85, + order_MODE_23k05, + order_MODE_23k85 +}; + +// Extracted from 3GPP TS 26.173 V9.0.0 (qpisf_2s.tab) +// The *_36b tables are used in 6k60 mode +// Stored in fixed-point to save some space +/** Indexed tables for retrieval of quantized ISF vectors in Q15 */ +static const int16_t dico1_isf[256][9] = { + { 579, 1081, 1035, 390, 3, -263, -198, -82, 38}, + { 18, -68, -12, 313, 761, 405, 249, 111, -76}, + { 740, 1263, 1292, 1006, 997, 1019, 1017, 976, 923}, + { -91, 827, 948, 648, 613, 535, 522, 490, 421}, + { 41, -44, -281, -472, 652, 534, 193, 135, -90}, + { 41, -121, -356, -60, 663, 307, 61, -48, -344}, + { 557, 946, 1049, 867, 846, 990, 1112, 1262, 1241}, + { -118, -204, 328, 512, 870, 793, 610, 402, 186}, + { 156, 293, 74, -338, -475, -897, -594, -161, -497}, + { 226, 131, -138, 307, 169, -271, -164, -387, -624}, + { 62, -32, -61, -252, -541, -828, -1027, -523, -662}, + { 102, -61, 141, 112, -270, -251, -541, 25, -150}, + { 6, -132, -356, -686, -96, -322, -522, -31, -326}, + { -36, -209, -521, -229, 307, -132, -5, -99, -384}, + { 60, -51, -237, -668, -973, -407, -708, -75, -172}, + { 26, -138, -266, 111, -302, 43, -278, -356, -359}, + { 570, 822, 496, -154, -312, -92, 137, 279, 371}, + { -146, 368, 409, 68, 6, 77, 167, 202, 162}, + { 633, 898, 996, 756, 662, 683, 783, 909, 996}, + { -103, 294, 607, 415, 483, 462, 480, 431, 408}, + { -120, -338, -612, -524, 584, 331, 92, 433, 276}, + { -178, -293, -154, -41, 269, 100, -9, 213, 160}, + { 830, 736, 278, 820, 1254, 686, 712, 1039, 473}, + { -218, -304, 463, 454, 397, 273, 202, 286, 273}, + { -232, 7, 6, -388, -472, -427, -378, -167, -100}, + { -294, -183, 134, -47, 101, -88, -84, -117, -3}, + { 57, 17, -202, -634, -989, -1119, -533, 176, -36}, + { 120, -28, 23, 111, -319, 318, -22, -77, 266}, + { -271, -464, -434, -658, -640, -385, -385, -99, -69}, + { -198, -259, -266, -44, -39, -139, -137, 171, 66}, + { 9, -145, -377, -846, -1000, -111, -325, 342, 135}, + { -81, -286, -380, 192, -57, 307, 76, -24, -140}, + { 677, 702, 247, 56, 249, 141, -105, -236, -99}, + { 36, -39, -69, 348, 198, -93, 322, 91, -72}, + { 503, 885, 1508, 1307, 1282, 1172, 1119, 1209, 1061}, + { 416, 719, 989, 1227, 1001, 1052, 954, 741, 1044}, + { -127, -376, -657, 139, 623, 223, 501, 306, 220}, + { -113, -384, -796, 504, 438, 85, 213, -83, -194}, + { 585, 1132, 1233, 1091, 1247, 1433, 1512, 1448, 1314}, + { -174, -422, 7, 1155, 1089, 1182, 1003, 945, 806}, + { 8, -126, -317, -103, -351, -695, -98, -268, -537}, + { 33, -103, -290, 167, -39, -407, 44, -208, -375}, + { 104, -23, -64, -291, -637, -851, -1084, -61, -112}, + { -75, -306, -434, 218, -148, -354, -680, -133, -216}, + { -121, -377, -718, -97, -130, -361, -156, -379, -599}, + { -56, -254, -586, 235, 157, -214, 11, -260, -149}, + { -124, -267, -397, -580, -593, -527, -805, -385, 346}, + { -193, -440, -708, -351, -141, -255, -499, -147, -185}, + { 448, 660, 494, 208, 509, 461, 338, 291, 149}, + { -223, 88, 335, 159, 212, 191, 286, 308, 205}, + { -31, 469, 803, 659, 619, 658, 843, 987, 1113}, + { -171, -242, 514, 362, 295, 524, 552, 694, 585}, + { -64, -308, -448, -21, 284, 786, 446, 289, 92}, + { -218, -390, -7, 169, 206, 330, 352, 408, 358}, + { -36, 702, 959, 859, 861, 1115, 1269, 1357, 1305}, + { -133, -341, -65, 678, 417, 440, 486, 518, 780}, + { 33, -44, -191, -344, -461, -755, -201, 217, -31}, + { -353, -547, -44, 123, -61, -68, -79, 29, 60}, + { 73, -57, -406, -766, -1243, -1203, 240, 400, 165}, + { -73, -282, -601, -213, -171, -375, 332, 35, -103}, + { -29, -207, -553, -476, -638, -908, 172, -22, -135}, + { -192, -239, -164, -103, -111, -47, 153, 125, 110}, + { -1, -203, -570, -1030, -1424, -535, 155, 1, 147}, + { -333, -653, -865, -197, -158, -21, -44, 95, 108}, + { 389, 588, 490, 33, -237, -524, -628, -136, -260}, + { 40, -177, -462, 453, 862, 380, 131, -130, -405}, + { 842, 1678, 1841, 1549, 1474, 1256, 1082, 905, 742}, + { 370, 1216, 1768, 1633, 1212, 636, 22, -330, 71}, + { -76, -281, -741, -742, 898, 619, 277, 71, -222}, + { -32, -265, -556, -25, 994, 682, 305, 126, -165}, + { 73, 738, 893, 968, 993, 1768, 2273, 1840, 1391}, + { -69, -349, -585, 234, 1158, 903, 626, 510, 251}, + { -1, -99, -272, -210, -603, -351, -540, -811, -383}, + { -16, -230, -504, 410, 149, -205, -343, -651, -639}, + { 103, -9, -227, -205, -562, -781, -1079, -1208, -156}, + { 143, 63, -135, -67, -317, -602, -784, -1154, -640}, + { -144, -391, -674, -622, -200, -254, -660, -947, -395}, + { -40, -250, -625, 27, 543, 94, -131, -386, -673}, + { -123, -371, -757, -451, -564, -614, -415, -711, -35}, + { -116, -309, -593, -268, 239, -33, -338, -650, -135}, + { 94, 251, 554, 57, -312, -423, -154, -57, 235}, + { -268, -71, 381, 114, -44, -87, 125, 173, 133}, + { 1513, 1714, 1238, 534, 276, 315, 461, 459, 508}, + { -131, -19, 1149, 670, 486, 356, 309, 369, 296}, + { -223, -501, -899, -722, -70, 6, 131, 310, 394}, + { -99, -303, -517, 249, 64, -53, 135, -11, 453}, + { -147, -399, -730, -401, 817, 738, 802, 749, 575}, + { -154, -435, -739, 800, 593, 366, 529, 318, 326}, + { -224, 45, -39, -387, -515, -518, -608, -384, -321}, + { -315, -377, 143, -101, -113, -377, -177, -144, -12}, + { 117, 40, -239, -651, -1051, -581, -737, -990, -328}, + { 26, -50, -157, -23, -453, -283, -531, -546, 192}, + { -252, -501, -743, -589, -627, -499, -328, -118, -72}, + { -324, -494, -244, -306, -144, -177, -262, -135, -78}, + { -36, -234, -519, -961, -1290, -314, -479, -371, -45}, + { -95, -292, -535, -8, -300, 112, -164, -277, 198}, + { -99, -128, 880, 836, 579, 351, 23, -95, -217}, + { -27, -258, 124, 1011, 597, 425, 144, 7, -73}, + { 421, 1293, 1640, 1623, 1742, 1617, 1499, 1284, 1006}, + { -95, 752, 1680, 1569, 1618, 1436, 1200, 980, 712}, + { -69, -300, -683, -435, 1132, 899, 504, 332, 109}, + { -74, -323, -637, 563, 1074, 608, 371, 105, -49}, + { -78, 831, 1194, 1110, 1378, 1481, 1492, 1365, 1217}, + { -259, -121, 1440, 1334, 1628, 1490, 1438, 1223, 933}, + { -82, -306, -613, -222, -378, -675, -545, -671, -845}, + { 53, -124, -347, 422, 52, -125, -270, -529, 9}, + { 79, -89, -320, -662, -999, -1199, -1243, -676, -297}, + { -68, -273, -611, 137, -146, -397, -627, -845, -220}, + { -112, -346, -797, -826, 234, -132, -188, -278, -522}, + { -159, -405, -734, -419, 293, 74, -167, -167, 184}, + { -153, -437, -833, -1080, -336, -472, -561, -340, -253}, + { -169, -423, -820, -904, -131, -19, -346, -604, 31}, + { 33, -31, 312, 62, -148, 49, -59, 564, 486}, + { -306, -333, 194, -44, 67, 72, 147, 205, 243}, + { -207, -49, 1360, 983, 969, 991, 1014, 1110, 973}, + { -211, -172, 883, 627, 711, 674, 705, 798, 746}, + { -88, -325, -763, -974, 687, 908, 514, 382, 172}, + { -292, -612, -805, 63, 131, 270, 259, 352, 348}, + { -235, -84, 955, 818, 1120, 1289, 1559, 1480, 1285}, + { -180, -461, -614, 657, 691, 745, 854, 783, 713}, + { -97, -309, -477, -614, -777, -734, -768, -526, -472}, + { -344, -476, -35, -169, 49, -77, -150, -240, -141}, + { -52, -268, -639, -919, -1278, -1113, -342, -333, -151}, + { -68, -242, -585, -73, -209, -478, -159, -429, 133}, + { -197, -499, -1005, -1268, -272, -224, -105, -67, 17}, + { -363, -618, -414, -116, -62, 20, 10, 116, 108}, + { -195, -475, -906, -1260, -891, -441, -277, -142, -28}, + { -226, -519, -950, -700, -275, -266, -116, -105, 82}, + { 404, 511, 520, 327, 17, -194, -333, -536, -586}, + { -114, -130, 276, 237, 204, 342, 135, -16, -111}, + { 670, 1208, 1168, 860, 742, 601, 528, 403, 309}, + { 397, 621, 966, 752, 579, 398, 400, 329, 252}, + { 191, 180, -137, -467, 272, 106, -95, 17, -192}, + { -80, -290, -626, 194, 598, 196, 21, -281, 77}, + { 510, 864, 1108, 807, 939, 902, 925, 717, 481}, + { 137, 367, 534, 764, 670, 382, 296, 153, 84}, + { 303, 497, 144, -85, -125, -539, -482, -464, -764}, + { 233, 347, 68, -147, 169, -210, -242, -226, -482}, + { 307, 422, 154, -175, -386, -722, -724, -904, -1015}, + { 309, 308, 160, -60, -470, -420, -598, -791, -219}, + { 68, 121, -137, -560, -146, -446, -515, -494, -729}, + { 130, 53, -227, 46, 474, 32, -161, -192, -490}, + { 213, 164, -71, -465, -876, -161, -456, -587, -48}, + { 218, 117, 39, 177, -194, -88, -226, -418, 50}, + { 210, 547, 569, 279, 121, -44, -50, 10, -84}, + { 58, 140, 182, -5, 267, 117, 106, 211, 198}, + { 539, 835, 913, 719, 617, 544, 591, 565, 642}, + { 153, 559, 872, 460, 222, 108, 188, 180, 183}, + { 158, 119, 284, -153, -271, 229, 87, 110, -57}, + { -183, 82, 118, 21, 13, 40, 118, 191, 185}, + { 162, 889, 654, 108, -34, 244, 488, 561, 532}, + { 163, 56, 609, 341, 50, 329, 68, 266, 218}, + { 100, 206, 18, -304, -107, -436, -487, -65, -306}, + { -86, 154, 134, -30, -45, -73, -104, -80, -96}, + { 245, 330, 10, -440, -849, -1082, 79, 40, -265}, + { 196, 372, 272, -181, -493, -389, 275, 80, -59}, + { 2, -12, -246, -505, -100, -436, 21, -187, -431}, + { -221, -48, 36, -271, -186, -147, -109, 26, 71}, + { 213, 140, 72, -351, -620, -84, -363, 69, 46}, + { 91, 167, -3, -95, -99, -105, -48, 114, 147}, + { 259, 249, 172, 607, 406, 52, 59, -189, -320}, + { 115, -85, -54, 574, 128, 226, -59, -253, 130}, + { -62, 1033, 1308, 1035, 1127, 1098, 1029, 961, 823}, + { 39, 364, 757, 940, 728, 660, 659, 583, 770}, + { -115, -338, -760, -471, 394, 37, 441, 178, 6}, + { -57, -305, -525, 796, 453, 188, -4, -114, 248}, + { 71, 444, 797, 731, 1096, 1157, 1222, 1029, 811}, + { 135, 359, 551, 425, 749, 815, 874, 704, 502}, + { 132, 247, 0, -206, -449, -750, -258, -514, -633}, + { 248, 249, 91, 121, -195, -499, -90, -282, -435}, + { 78, 20, -277, -623, -983, -1224, -415, -458, -639}, + { 347, 509, 208, -179, -464, -728, -76, -237, -486}, + { -103, -343, -756, -713, -265, -609, -191, -398, -636}, + { -121, -383, -749, 567, 252, -36, -354, -417, -50}, + { 204, 100, -149, -650, -1081, -47, -7, -263, 111}, + { -46, -180, -267, -324, -562, -394, -692, 398, 292}, + { 482, 670, 683, 624, 442, 165, 116, 36, -149}, + { 108, 247, 291, 247, 355, 122, 109, 224, 296}, + { -14, 945, 990, 801, 755, 815, 847, 913, 892}, + { 292, 349, 725, 482, 388, 329, 429, 620, 667}, + { -34, 197, 213, -127, 84, 494, 620, 575, 375}, + { 126, 207, 172, 167, 362, 202, 296, 395, 455}, + { -6, 250, 539, 467, 636, 801, 1149, 1287, 1118}, + { 27, 240, 369, 280, 440, 411, 634, 892, 953}, + { 159, 170, -58, -395, -797, -690, 77, -211, -334}, + { -5, -28, -13, -74, -335, -603, 300, 88, -205}, + { 82, -33, -364, -698, -1203, -1153, 110, -146, -289}, + { 113, 1, -243, -588, -994, -496, 414, 160, 42}, + { -56, -247, -440, -693, -996, -479, 11, -178, -357}, + { -151, -353, -327, -211, -340, 141, 65, 425, 453}, + { 34, -169, -455, -932, -1215, 138, 499, 256, 324}, + { 68, 139, -15, -547, -478, 17, 306, 502, 481}, + { -32, -134, 445, 129, -143, -244, -503, -507, -599}, + { 61, -140, -345, 496, 458, -2, 20, -227, -514}, + { 394, 1765, 1666, 1339, 1117, 806, 642, 479, 380}, + { 215, 519, 920, 1053, 1090, 791, 528, 290, 155}, + { -54, -233, -647, -602, 639, 294, -2, -167, -442}, + { -78, -315, -791, -113, 820, 403, 158, -116, -356}, + { 529, 1851, 2003, 1228, 622, -41, -416, 344, 819}, + { -105, -379, -236, 1224, 893, 749, 568, 356, 214}, + { -17, -199, -144, 50, -283, -247, -578, -846, -1087}, + { 69, -11, -381, -206, 209, -284, -387, -416, -716}, + { 39, -5, -145, -374, -682, -909, -1074, -1169, -1066}, + { 287, 226, 67, -221, -662, -171, -421, -642, -707}, + { -132, -348, -538, -448, -20, -4, -354, -748, -933}, + { 4, -75, -289, -598, 317, 52, -208, -297, -559}, + { -88, -264, -358, -589, -631, -248, -523, -822, -1071}, + { 70, -8, 54, -314, -515, 92, -146, -274, -493}, + { 199, 62, 391, 158, -141, 71, -219, -203, -207}, + { 152, 40, 329, 162, -29, 48, -149, 108, 127}, + { 635, 1058, 883, 492, 372, 312, 317, 274, 241}, + { 267, 722, 1256, 882, 625, 248, 8, -81, -60}, + { -58, -138, -291, -600, -12, -2, -39, 147, 117}, + { -107, -345, -513, 459, 76, 92, -272, 388, 262}, + { 362, 516, 203, -409, -716, -831, -331, 185, 209}, + { -117, -391, -298, 671, 292, 538, 257, 166, -38}, + { -102, -319, -194, -283, -573, -262, -579, -219, -444}, + { -235, 78, 11, -168, -101, -229, -263, -321, -123}, + { 70, 50, -170, -599, -996, -588, -263, -516, -455}, + { 394, 363, 229, -136, -538, 21, -183, -348, -201}, + { -124, -368, -640, -879, -847, -209, -409, -494, -515}, + { -127, -341, -541, -425, -510, -10, -252, -473, -291}, + { 84, -69, -201, -676, -868, 103, -311, -132, -320}, + { 5, -173, -188, -297, -628, 197, -57, 7, -11}, + { 49, -160, 56, 558, 111, 33, -311, -440, -463}, + { -1, -246, -307, 862, 453, 139, -170, -355, -232}, + { 279, 966, 1642, 1478, 1463, 1123, 795, 525, 339}, + { -197, -38, 1702, 1331, 1252, 950, 692, 504, 426}, + { -108, -344, -861, -1172, 444, 354, 88, -46, -220}, + { -53, -321, -494, 1113, 744, 364, 198, -34, -75}, + { 457, 955, 1177, 1214, 1427, 1457, 1345, 917, 539}, + { -69, 199, 897, 1140, 1343, 1183, 977, 742, 522}, + { 122, 44, -269, 27, -155, -562, -307, -590, -773}, + { 154, 42, -160, 252, -129, -305, -471, -733, -371}, + { 135, 185, -82, -416, -722, -913, -504, -743, -880}, + { 149, 214, -84, -329, -680, -835, -426, -661, -81}, + { -128, -380, -735, -998, -337, 17, -182, -467, -697}, + { -84, -290, -510, -592, 13, 440, 154, -38, -279}, + { 70, -61, -246, -727, -1047, -80, -381, -535, -704}, + { 178, -2, -146, -670, -938, 482, 138, 63, 65}, + { -11, 15, 772, 443, 142, -20, -209, -126, -161}, + { -32, -249, 95, 552, 124, 30, -343, 82, -86}, + { 148, 751, 1515, 1105, 867, 606, 474, 448, 399}, + { -163, -257, 899, 1097, 906, 751, 502, 390, 294}, + { -51, -258, -447, -806, -368, 763, 464, 364, 183}, + { -166, -374, -367, 87, 35, 399, 418, 856, 833}, + { -205, -310, 588, 778, 785, 1065, 1118, 1245, 1157}, + { -173, -312, 107, 345, 400, 790, 870, 1113, 1001}, + { -7, -120, -387, -410, -614, -943, -226, -384, -491}, + { -203, -288, -51, -331, -90, -178, -408, -573, -338}, + { 56, -29, -273, -627, -1041, -798, -247, -467, 148}, + { 66, -2, -205, -205, -575, -349, -57, -352, -58}, + { -45, -225, -471, -924, -497, 77, -32, 44, -135}, + { -277, -491, -497, -502, -424, -202, -137, 77, 96}, + { 26, -179, -469, -1008, -1260, 262, -35, -132, -259}, + { -66, -232, -447, -533, -789, -191, -100, -267, 364} +}; + +static const int16_t dico2_isf[256][7] = { + { 1357, 1313, 1136, 784, 438, 181, 145}, + { 636, 648, 667, 568, 442, 217, 362}, + { 427, 440, 674, 524, 332, 117, -417}, + { 121, 295, 468, 465, 230, 44, -221}, + { -147, -240, 149, 80, 390, 278, 106}, + { -418, -556, 552, 511, 235, 144, -95}, + { 43, 193, 274, 150, 67, 34, -273}, + { -43, -126, 171, 416, 282, 63, -354}, + { -372, -86, -344, -108, -94, -182, -89}, + { -600, -840, -200, 465, 258, -11, -253}, + { -48, 329, 97, -290, -543, -795, -354}, + { -570, -117, 187, 10, -133, -416, -76}, + { -618, -129, -247, -371, 45, -76, 277}, + { -1022, -1079, 126, 474, 254, 127, 52}, + { -281, 76, -167, -361, -283, -551, -283}, + { -119, -52, -1, 134, -32, -204, -415}, + { 1064, 827, 637, 684, 464, 209, 12}, + { 482, 416, 449, 371, 335, 294, 194}, + { 719, 576, 365, 135, 113, 91, -199}, + { 298, 176, 493, 366, 194, 163, 36}, + { -35, -236, -259, -36, -4, 99, 152}, + { -98, -306, -27, 228, 90, 111, -86}, + { 91, 13, -211, -258, -106, 86, -64}, + { 73, -35, -57, -31, 162, 35, -192}, + { -109, -335, -629, -66, -61, -128, 322}, + { -495, -669, -728, 193, 31, -220, 122}, + { 324, 95, -89, -91, -409, -710, -154}, + { 0, -234, 92, 33, -343, -609, -220}, + { -343, -408, -476, -655, -153, 82, 222}, + { -490, -745, -255, 49, -48, 135, -127}, + { 119, -67, -328, -390, -272, -545, -56}, + { -57, -130, -10, -7, -164, -47, -22}, + { 984, 1064, 961, 568, 210, -27, 16}, + { 811, 691, 754, 514, 224, -35, 166}, + { 662, 704, 618, 386, 57, -211, -257}, + { 510, 359, 418, 393, 91, -144, -18}, + { -193, -31, -27, 223, 89, -143, 24}, + { -112, -98, 471, 319, 185, 3, 175}, + { 252, 146, -47, 272, 48, -211, -234}, + { 146, 69, 203, 364, 68, -52, 51}, + { -259, -478, -697, -349, -758, -501, 63}, + { -501, -769, -289, 79, -311, -497, -106}, + { 251, 53, -235, -469, -895, -884, 145}, + { -416, -551, 140, -133, -523, -775, 44}, + { -326, -423, -713, -497, -86, -431, 99}, + { -757, -772, -160, -76, -46, -32, 379}, + { 85, -35, -200, -401, -663, -1040, -247}, + { -180, -330, -92, -376, 27, -183, -110}, + { 1279, 1086, 781, 502, 324, 164, 157}, + { 682, 466, 449, 277, 146, 28, 409}, + { 635, 472, 390, 107, -232, -538, -139}, + { 196, 396, 332, 213, 209, -29, -81}, + { 150, -95, -312, 76, -77, -320, -50}, + { 46, 9, 47, 175, 139, 30, 384}, + { 218, 206, -24, -250, -96, -276, -183}, + { 26, 119, 38, 14, -4, -133, -52}, + { -477, -614, -987, -715, -631, -813, 200}, + { -744, -1009, -1065, -745, -631, -171, 18}, + { -137, -251, -483, -613, -980, -1203, 12}, + { -605, -767, -562, -686, -1088, -515, 58}, + { -202, -428, -782, -1072, -96, -234, -179}, + { -480, -709, -1070, -897, -131, -92, 321}, + { -145, -193, -512, -729, -572, -765, -210}, + { -331, -585, -525, -631, -281, -208, -303}, + { 1165, 1104, 939, 828, 716, 426, 155}, + { 6, -109, 820, 778, 415, 113, -27}, + { 381, 339, 314, 265, 121, -9, -474}, + { -373, 47, 584, 442, 99, -231, -113}, + { -496, -38, -285, 262, 305, 170, 4}, + { -587, -556, 69, 66, 471, 354, 13}, + { -138, 70, -18, 106, 67, 167, -302}, + { -445, -141, 185, 191, 151, 83, -133}, + { -257, -521, -720, -198, 134, -46, -182}, + { -819, -1168, -777, 512, 359, 95, -113}, + { 137, -2, -74, -138, -401, -114, -371}, + { -242, -466, 204, 223, -31, -212, -192}, + { -532, -637, -466, -686, 256, 277, -139}, + { -1141, -1244, -381, -75, -54, 14, 88}, + { -311, 115, -143, -499, -343, 124, -416}, + { -616, -147, -135, 43, -4, 121, -369}, + { 835, 783, 641, 390, 355, 350, 64}, + { 72, 194, 443, 467, 436, 219, 372}, + { 464, 369, 192, 4, -156, -72, -226}, + { 57, 206, 303, 205, 188, 101, 265}, + { -40, -205, -488, -184, 276, 64, -26}, + { -217, -433, -297, 137, 328, 308, -289}, + { 378, 81, -308, -465, 57, -37, 227}, + { -100, 24, -36, -151, 199, 8, 143}, + { -426, -697, -1059, -133, 388, 161, 321}, + { -644, -1023, -1271, 39, 66, -123, 70}, + { 372, 177, -173, -556, -553, -304, -189}, + { -117, -369, -425, -122, -462, -152, -73}, + { -649, -850, -1189, -767, 497, 360, 222}, + { -798, -1139, -1455, -190, 430, 234, 179}, + { 42, -94, -405, -692, 38, -202, -246}, + { -169, -366, -290, -88, -64, 32, -292}, + { 1010, 923, 938, 710, 465, 230, 342}, + { 217, 300, 1054, 675, 68, -458, -179}, + { 78, 453, 316, 18, -237, -496, -243}, + { 167, 21, 424, 215, -91, -303, -170}, + { -290, -81, -70, -67, 40, 54, -59}, + { -353, -427, -90, 53, 94, 9, 54}, + { -28, 318, 283, 15, -240, -58, 79}, + { -75, -121, 229, 35, 58, 6, -133}, + { -351, -514, -744, -834, -705, -137, 164}, + { -1124, -1388, -1055, -230, -73, 40, 36}, + { -163, -233, -532, -785, -1170, -697, 96}, + { -788, -959, -246, -430, -624, -165, -8}, + { -856, -540, -630, -907, -337, -70, 76}, + { -937, -1042, -659, -733, -208, 199, -26}, + { -523, 78, -98, -501, -869, -890, -81}, + { -624, -703, -45, -348, -25, 87, -186}, + { 1005, 823, 546, 249, 90, -22, 207}, + { 298, 397, 381, 319, 200, 62, 303}, + { 473, 379, 133, -247, -632, -441, 75}, + { 284, 208, 391, 115, -25, 44, 95}, + { -72, 79, -95, -63, -129, -293, 203}, + { -164, -349, 115, 122, 69, -1, 378}, + { 348, 170, 99, 58, -179, -302, 188}, + { -190, -2, 150, 23, -51, -11, 216}, + { -615, -863, -1090, -1427, -802, -48, -6}, + { -961, -1276, -1548, -727, -58, 56, 223}, + { -124, -255, -561, -988, -1277, -148, -82}, + { -480, -660, -891, -1191, -1339, -325, 20}, + { -621, -917, -1296, -1350, 264, 289, 50}, + { -844, -1022, -1345, -1329, -293, 46, 278}, + { -260, -468, -829, -1176, -533, -560, -78}, + { -215, -484, -822, -1233, -791, 15, -138}, + { 1301, 1317, 1262, 1048, 716, 357, -64}, + { 578, 824, 925, 802, 630, 362, 102}, + { 470, 925, 767, 514, 327, 190, -112}, + { 225, 492, 495, 437, 598, 384, -45}, + { 43, 82, -42, 175, 519, 342, -64}, + { -304, -154, 159, 576, 403, 221, 327}, + { 214, 244, 122, -62, 312, 92, -160}, + { 218, 208, 310, 268, 306, 323, -199}, + { -285, -269, -79, -124, -143, -153, 236}, + { -205, -384, -426, 344, 59, -185, -184}, + { -272, 247, 126, -210, -518, -468, 78}, + { -99, -120, 502, 160, -280, -557, 304}, + { -423, -17, -283, -443, 215, 212, -140}, + { -564, -684, -228, 510, 361, 130, 323}, + { -428, 335, 98, -65, 36, -215, -246}, + { -362, 51, 364, -16, -234, 150, -165}, + { 914, 883, 751, 653, 676, 464, -153}, + { 631, 545, 535, 720, 596, 360, -81}, + { 783, 712, 512, 439, 341, 251, -391}, + { 497, 417, 249, 372, 295, 173, -193}, + { 128, -110, -385, 93, 39, 173, -231}, + { 216, -59, -253, 462, 389, 154, 69}, + { 455, 270, -4, -337, -49, 233, -322}, + { 307, 143, 53, 218, 128, 236, -156}, + { -37, -186, -240, -411, -110, 9, 399}, + { -140, -365, -628, 258, 380, 214, 277}, + { 131, 454, 177, -285, -520, 108, -214}, + { 77, -141, 201, -123, -490, -131, 60}, + { -14, -194, -521, -741, 273, 362, -33}, + { -362, -566, -287, -228, 161, 237, 317}, + { -269, 195, -75, -375, -204, 11, 77}, + { -128, -264, -156, -223, -475, 265, 27}, + { 1238, 1147, 916, 689, 432, 210, -280}, + { 800, 664, 879, 726, 411, 160, -164}, + { 454, 686, 536, 275, 147, 46, 111}, + { 303, 486, 512, 355, 241, 181, -69}, + { 79, 92, 29, 147, 233, 52, 17}, + { -171, 289, 131, 439, 271, 3, -10}, + { 413, 241, 144, 174, 155, -2, 14}, + { 58, 217, 247, 219, 149, 175, -18}, + { 228, -8, -240, -206, -513, -191, 202}, + { -96, -272, -454, 33, -300, -575, 46}, + { -10, -108, -246, -347, -770, -535, 9}, + { -326, -430, -61, -321, -704, -299, 201}, + { -1, -280, -603, -419, -185, 18, -36}, + { -516, -522, -379, -291, -181, -97, 27}, + { -159, -313, -525, -224, -510, -831, -197}, + { -292, -459, -59, -310, -562, -143, -351}, + { 1066, 912, 631, 389, 207, 86, -224}, + { 596, 512, 596, 505, 314, 122, -48}, + { 787, 861, 441, -93, -303, 33, -190}, + { 257, 469, 337, 51, 15, 298, -93}, + { 295, 73, -119, 25, 36, 23, 108}, + { -28, -3, -32, 114, 21, 185, 107}, + { 482, 305, 15, -279, -319, 52, 96}, + { 226, 46, 115, 72, -136, 133, -125}, + { 18, -207, -559, -590, -503, -482, 321}, + { -571, -789, -951, -172, -441, -538, 113}, + { 181, 14, -310, -641, -1001, -202, 159}, + { -136, -393, -433, -513, -911, -144, -22}, + { 72, -265, -706, -954, -159, 53, 332}, + { -338, -591, -852, -383, -395, 56, 44}, + { 43, -158, -464, -897, -631, -157, -294}, + { -161, -128, -328, -573, -483, -125, 11}, + { 1017, 906, 1051, 1005, 679, 341, -102}, + { 359, 334, 1567, 1314, 723, 105, 10}, + { -65, 726, 529, 301, 220, 43, -273}, + { -510, 436, 719, 566, 358, 179, 114}, + { -560, 298, 133, -120, 342, 225, 14}, + { -899, -101, 217, 617, 400, 146, -58}, + { -41, 352, 82, -196, 39, 121, -167}, + { -212, 59, 447, 284, 423, 250, -169}, + { -371, -484, -596, 30, -41, 249, 22}, + { -372, -650, -794, 477, 445, 216, -79}, + { -352, 275, 17, -443, -929, 92, 19}, + { -699, -696, 431, 264, -49, -310, 182}, + { -978, -217, -430, -400, 101, 261, 72}, + { -929, -889, -357, -13, 463, 378, 236}, + { -826, 56, 30, -299, -360, -128, -51}, + { -878, -299, -111, 75, 65, 36, 3}, + { 817, 368, -25, 354, 697, 591, -173}, + { 309, 212, 222, 751, 484, 140, -56}, + { 593, 379, 70, -8, 258, 180, 110}, + { 165, -46, 255, 297, 219, 273, 105}, + { 160, -70, -358, -181, 379, 330, 319}, + { -238, -369, -198, 740, 580, 319, -143}, + { 201, 109, -202, -456, 328, 276, -141}, + { 203, 170, 111, 42, 207, 360, 188}, + { -345, -399, -513, -233, 650, 422, 81}, + { -635, -961, -1220, 463, 539, 204, 209}, + { 202, -25, -194, -498, -787, 193, -143}, + { -449, -538, 195, -106, -331, 68, 62}, + { -228, -477, -840, -576, 317, 128, 283}, + { -671, -937, -807, -114, 391, 335, -62}, + { 246, 2, -314, -679, -303, 180, -88}, + { -107, -272, 90, -198, -28, 290, -112}, + { 885, 1149, 1021, 712, 496, 281, -83}, + { 269, 492, 787, 643, 347, 70, 124}, + { 336, 636, 499, 92, -229, -179, 191}, + { 26, 402, 564, 340, 149, -11, 135}, + { -440, 561, 470, 204, -72, -186, 140}, + { -720, 14, 355, 229, 68, -133, 465}, + { 110, 310, 103, 12, 106, 29, 158}, + { -178, 113, 161, 142, 121, 115, 27}, + { -651, -414, -645, -152, -164, -13, -429}, + { -639, -944, -681, -104, -81, 52, -189}, + { -663, -164, -316, -683, -954, -205, -83}, + { -609, -669, -172, -517, -694, 283, -80}, + { -646, -152, -383, -678, -246, -40, -143}, + { -747, -796, -745, -390, -98, 43, 275}, + { -599, -199, -398, -433, -436, -538, 31}, + { -1107, -568, -376, -265, -126, -21, 1}, + { 847, 573, 308, 392, 305, 101, 55}, + { 273, 293, 201, 267, 346, 201, 123}, + { 727, 480, 226, 2, -65, -138, 164}, + { 273, 208, 173, 292, 12, 253, 174}, + { 340, 207, 180, 88, 116, 46, 475}, + { -460, -166, -30, 13, 110, 173, 396}, + { 137, 88, 43, -137, -94, 34, 284}, + { 96, -14, 226, 40, 63, 70, 130}, + { -467, -735, -1012, -1174, -307, 305, -67}, + { -612, -920, -1146, -567, -8, 92, -25}, + { -182, -271, -492, -754, -857, 287, -75}, + { -494, -787, -689, -683, -709, 137, -326}, + { -288, -550, -903, -1105, 334, 321, -62}, + { -354, -653, -834, -445, 1, 377, -152}, + { -162, -306, -608, -937, -297, 247, -192}, + { -234, -477, -244, -488, -266, 342, -332} +}; + +static const int16_t dico21_isf[64][3] = { + { 329, 409, 249}, { -33, 505, 160}, + { -29, -14, 582}, { -262, 127, 354}, + { 145, 237, 175}, { -152, 245, 122}, + { 27, 42, 340}, { -84, -93, 311}, + { 285, 222, -156}, { 47, -43, -504}, + { 234, 121, 385}, { 104, -317, 45}, + { 176, 195, 8}, { 104, -59, -94}, + { 177, 53, 192}, { -34, -127, 152}, + { 570, 277, -34}, { -67, -329, -639}, + { -157, -272, 462}, { -177, -462, 198}, + { 322, 179, 115}, { -386, 171, 19}, + { 19, -12, 195}, { -120, -252, 201}, + { 304, 36, -336}, { -128, -221, -380}, + { 171, -185, 296}, { -242, -312, 23}, + { 198, 39, 16}, { -3, -177, -111}, + { 111, -93, 76}, { -92, -223, 4}, + { 177, 406, -44}, { -168, 380, -149}, + { -4, 273, 331}, { -420, 513, 277}, + { 21, 247, 47}, { -58, 131, -2}, + { -3, 134, 180}, { -145, 40, 175}, + { 189, 74, -145}, { -27, -45, -325}, + { 370, -114, -21}, { -83, -415, -173}, + { 77, 95, -51}, { -40, -30, -67}, + { 71, 88, 86}, { -35, -98, 14}, + { 69, 197, -334}, { -196, 79, -231}, + { -348, -137, 218}, { -352, -89, -85}, + { 47, 201, -130}, { -165, 37, -15}, + { -43, 3, 86}, { -161, -108, 79}, + { 83, 21, -237}, { -81, -149, -238}, + { 150, -186, -251}, { -186, -249, -162}, + { -19, 66, -139}, { -26, -50, -181}, + { 24, 11, 0}, { -130, -105, -98} +}; + +static const int16_t dico22_isf[128][3] = { + { -127, 310, 42}, { -242, 197, 5}, + { -151, 84, -17}, { -214, 127, -149}, + { -247, -131, 159}, { -268, -267, -95}, + { -217, 1, -79}, { -271, -80, -185}, + { -45, 436, 159}, { 165, 199, 391}, + { -33, 81, 187}, { -66, -42, 355}, + { -298, -57, 343}, { -108, -537, 226}, + { -144, -23, 193}, { 176, -402, 87}, + { 53, 296, 25}, { -84, 253, -104}, + { -58, 105, -126}, { -169, 174, -314}, + { -48, 44, -294}, { -164, -417, -242}, + { -139, 3, -194}, { -155, -207, -211}, + { 119, 322, 213}, { 333, 50, 380}, + { 237, 247, -2}, { 466, -16, 201}, + { 238, -255, -107}, { 67, -440, -149}, + { 122, -88, -139}, { 88, -247, -73}, + { -41, 231, 167}, { -62, 155, 16}, + { -65, 16, 77}, { -68, -2, -63}, + { -151, -300, 160}, { -18, -333, 54}, + { -56, -94, 5}, { 2, -190, 14}, + { 92, 148, 209}, { 108, 9, 272}, + { 108, 35, 110}, { 142, -85, 145}, + { 47, -157, 279}, { 3, -320, 246}, + { 43, -72, 68}, { 86, -217, 135}, + { 36, 140, 79}, { 56, 175, -49}, + { 26, 45, 3}, { 73, 55, -101}, + { 109, -183, -242}, { -4, -283, -242}, + { 48, -68, -48}, { -6, -153, -122}, + { 161, 196, 96}, { 232, 80, 190}, + { 165, 97, 11}, { 258, -31, 71}, + { 267, -77, -91}, { 311, -209, 87}, + { 152, -14, -22}, { 150, -149, 9}, + { -324, 557, 187}, { -384, 307, 46}, + { -251, 27, 77}, { -365, 77, -52}, + { -482, -84, 160}, { -424, -515, -64}, + { -294, -120, -4}, { -476, -116, -109}, + { -97, 318, 365}, { 106, 627, 445}, + { -190, 120, 287}, { -146, 65, 619}, + { -427, 242, 363}, { -361, -371, 432}, + { -347, 102, 168}, { -629, 195, -14}, + { -65, 476, -47}, { -297, 320, -168}, + { -55, 356, -264}, { -391, 82, -286}, + { -51, -31, -556}, { -178, -399, -586}, + { -205, -49, -360}, { -343, -238, -337}, + { 220, 457, 58}, { 561, 467, 259}, + { 340, 270, -168}, { 450, 77, -280}, + { 60, 167, -413}, { 133, -252, -492}, + { 216, 157, -290}, { 282, 0, -495}, + { -226, 293, 183}, { -157, 135, 122}, + { -158, -59, 39}, { -133, -118, -97}, + { -332, -309, 113}, { -160, -425, -6}, + { -149, -211, 24}, { -80, -277, -90}, + { -11, 125, 338}, { 130, -71, 465}, + { 5, -45, 184}, { 237, -95, 253}, + { -139, -197, 297}, { -19, -300, 511}, + { -63, -152, 139}, { 250, -289, 336}, + { 124, 339, -150}, { 34, 176, -208}, + { 171, 166, -116}, { 94, 38, -229}, + { 75, -65, -339}, { -78, -205, -385}, + { 0, -30, -163}, { -56, -110, -242}, + { 321, 244, 194}, { 505, 238, -1}, + { 317, 116, 65}, { 309, 88, -74}, + { 452, -51, -50}, { 334, -217, -290}, + { 211, 41, -152}, { 238, -55, -260} +}; + +static const int16_t dico23_isf[128][3] = { + { -10, 151, 359}, { 136, 298, 223}, + { 255, -104, 290}, { 423, 6, 183}, + { -270, -269, -98}, { -52, -82, 13}, + { -82, -274, -97}, { 90, -246, -72}, + { -299, -70, 421}, { -88, 365, 430}, + { 187, -318, 381}, { 380, 37, 488}, + { -373, -316, 79}, { -308, -101, 5}, + { -135, -451, 8}, { 72, -421, -154}, + { 180, 170, -121}, { 62, 177, -40}, + { 326, 80, -105}, { 248, 263, -5}, + { -168, -181, -221}, { -2, -23, -158}, + { -14, -149, -121}, { 119, -91, -147}, + { 119, 332, -153}, { 49, 303, 34}, + { 442, -55, -69}, { 217, 454, 58}, + { -359, -187, -375}, { -42, 50, -274}, + { -8, -267, -249}, { 85, -86, -346}, + { -77, -40, 345}, { 89, 134, 219}, + { 156, -80, 160}, { 108, 40, 116}, + { -158, -206, 29}, { 5, -32, 175}, + { -65, -158, 146}, { 55, -78, 73}, + { -114, -222, 353}, { -47, 81, 211}, + { 49, -151, 268}, { 105, 4, 302}, + { -263, -132, 183}, { -151, -28, 201}, + { -177, -307, 166}, { 101, -221, 130}, + { 74, 58, -98}, { 32, 44, 13}, + { 194, 30, -142}, { 170, 96, 8}, + { -136, -119, -91}, { -65, 8, -55}, + { 3, -188, 12}, { 45, -63, -49}, + { 149, -21, -19}, { 24, 144, 95}, + { 254, -22, 60}, { 161, 196, 96}, + { -158, -61, 48}, { -70, 33, 82}, + { -23, -321, 58}, { 155, -147, 5}, + { -364, 328, 77}, { -21, 453, 173}, + { -108, 82, 630}, { 367, 263, 208}, + { -300, -62, -176}, { -205, 143, -158}, + { -169, -410, -264}, { 257, -269, -100}, + { -636, 289, -2}, { -292, 627, 173}, + { -382, -363, 387}, { 248, 524, 447}, + { -521, -111, -107}, { -395, 118, -274}, + { -343, -680, -125}, { -172, -447, -663}, + { 75, 148, -367}, { -79, 263, -94}, + { 249, 148, -286}, { 380, 271, -162}, + { -142, -4, -186}, { -57, 111, -125}, + { -35, -108, -254}, { 100, 29, -242}, + { -80, 303, -264}, { -78, 464, -57}, + { 248, -22, -494}, { 661, 662, 44}, + { -193, -40, -330}, { -178, 145, -337}, + { -90, -199, -400}, { -40, -23, -498}, + { -192, 114, 315}, { -41, 244, 190}, + { 88, -97, 485}, { 241, 80, 212}, + { -246, 40, 87}, { -156, 147, 134}, + { -2, -334, 239}, { 308, -203, 110}, + { -459, 251, 422}, { -218, 310, 228}, + { -86, -346, 654}, { 184, 175, 425}, + { -481, -63, 169}, { -349, 117, 188}, + { -125, -560, 310}, { 158, -416, 94}, + { 46, 171, -192}, { -63, 157, 14}, + { 256, -35, -271}, { 322, 123, 53}, + { -214, 4, -76}, { -156, 86, -18}, + { 128, -197, -232}, { 265, -90, -98}, + { -308, 332, -145}, { -131, 308, 58}, + { 509, 59, -339}, { 562, 196, -14}, + { -378, 100, -47}, { -234, 202, 1}, + { 104, -270, -493}, { 319, -210, -325} +}; + +static const int16_t dico24_isf[32][3] = { + { -79, -89, -4}, { -171, 77, -211}, + { 160, -193, 98}, { 120, -103, 323}, + { 32, -22, -129}, { 72, 78, -268}, + { 182, -76, -66}, { 309, 99, -145}, + { -229, -157, -84}, { -383, 98, -71}, + { -90, -352, 12}, { -284, -178, 178}, + { -65, -125, -166}, { -87, -175, -351}, + { 42, -198, -48}, { 154, -140, -243}, + { -77, 18, 108}, { -39, 355, 91}, + { 87, 8, 155}, { -4, 158, 239}, + { 128, 95, -54}, { 7, 246, -124}, + { 258, 15, 89}, { 206, 216, 98}, + { -201, 9, 18}, { -312, 233, 204}, + { -39, -174, 155}, { -144, -9, 284}, + { -57, 70, -69}, { -157, 187, 18}, + { 54, -30, 23}, { 24, 135, 55} +}; + +static const int16_t dico25_isf[32][4] = { + { 169, 142, -119, 115}, { 206, -20, 94, 226}, + { -106, 313, -21, 16}, { -62, 161, 71, 255}, + { -89, 101, -185, 125}, { 72, -30, -201, 344}, + { -258, 33, -8, 81}, { -104, -154, 72, 296}, + { 144, -68, -268, -25}, { 81, -78, -87, 106}, + { 22, 155, -186, -119}, { -46, -28, 27, 91}, + { -114, -37, -175, -33}, { -94, -222, -189, 122}, + { -132, -119, -191, -270}, { -172, -173, 18, -43}, + { 279, 135, -42, -128}, { 187, -86, 229, -138}, + { 159, 240, 140, 46}, { 69, 25, 227, 77}, + { 21, 115, 13, 8}, { 68, -248, 126, 81}, + { -150, 137, 207, -9}, { -154, -133, 289, 67}, + { 143, -37, -86, -326}, { 180, -32, 19, -23}, + { 26, 168, 116, -233}, { -32, -26, 118, -78}, + { 3, -8, -45, -115}, { 57, -215, -54, -83}, + { -209, 112, -22, -167}, { -91, -151, 168, -262} +}; + +static const int16_t dico21_isf_36b[128][5] = { + { -52, -96, 212, 315, -73}, { 82, -204, 363, 136, -197}, + { -126, -331, 183, 218, 143}, { -49, -41, 557, 230, 72}, + { 2, -73, 163, 377, 221}, { 133, 111, 278, 215, -110}, + { -102, -20, 284, 113, 273}, { 84, 319, 290, 18, 85}, + { -25, -5, 125, 132, -204}, { -38, -5, 286, -9, -356}, + { -140, -256, 92, 117, -189}, { -144, 191, 313, 51, -98}, + { 167, -10, 44, 247, 36}, { 381, 197, 238, 74, 6}, + { 38, -408, 29, -3, -85}, { 92, 266, 157, -25, -200}, + { 161, -121, 70, 84, -140}, { -16, -86, 112, -94, -189}, + { -269, -270, 351, 107, -24}, { -68, -67, 492, -103, -155}, + { -53, -131, 62, 122, 10}, { 135, 84, 283, -55, -120}, + { -12, -219, 331, -81, 167}, { 220, -136, 147, -172, -42}, + { 140, -95, -109, -88, -194}, { 0, -2, -4, -33, -381}, + { -66, -217, 152, -186, -402}, { 244, 108, 156, -140, -395}, + { 113, -136, -196, 110, -24}, { 214, 118, 11, -64, -131}, + { -110, -286, -6, -332, 16}, { 94, 97, 79, -291, -205}, + { -5, -39, -20, 252, -96}, { 76, 174, 101, 163, 61}, + { -69, -239, -55, 399, 6}, { -115, 319, 164, 275, 196}, + { -15, 36, -47, 331, 121}, { 226, 209, 271, 325, 184}, + { 13, -80, -218, 471, 353}, { 288, 378, 16, -51, 251}, + { 174, 116, 52, 149, -279}, { 235, 276, 39, 120, -48}, + { 0, -108, -108, 241, -339}, { -93, 534, 45, 33, -87}, + { 194, 149, -71, 405, -44}, { 409, 370, 81, -186, -154}, + { 25, -102, -448, 124, -173}, { 22, 408, -110, -310, -214}, + { -26, 23, -83, 114, 14}, { -110, 164, 52, 223, -82}, + { 37, -25, -263, 306, -15}, { -466, 415, 292, 165, -18}, + { 29, -19, -171, 155, 182}, { 179, 144, -27, 231, 258}, + { -103, -247, -396, 238, 113}, { 375, -154, -109, -4, 156}, + { 98, 85, -292, -5, -124}, { 116, 139, -116, -98, -294}, + { -14, -83, -278, -117, -378}, { 106, 33, -106, -344, -484}, + { 119, 17, -412, 138, 166}, { 384, 101, -204, 88, -156}, + { -121, -284, -300, -1, -166}, { 280, 33, -152, -313, -81}, + { -37, 22, 229, 153, 37}, { -60, -83, 236, -8, -41}, + { -169, -228, 126, -20, 363}, { -235, 17, 364, -156, 156}, + { -25, -30, 72, 144, 156}, { 153, -26, 256, 97, 144}, + { -21, -37, 48, -65, 250}, { 63, 77, 273, -128, 124}, + { -129, -26, 40, 9, -115}, { -6, 82, 38, -90, -182}, + { -336, -13, 28, 158, 91}, { -30, 241, 137, -170, -17}, + { 146, 14, -11, 33, 61}, { 192, 197, 54, -84, 85}, + { 23, -200, -78, -29, 140}, { 122, 237, 106, -341, 136}, + { -57, -142, -85, -16, -74}, { -59, -90, -8, -187, -20}, + { -211, -267, 216, -179, -110}, { -50, -7, 220, -267, -70}, + { -57, -42, -17, -15, 71}, { 32, 21, 63, -137, 33}, + { -137, -175, 104, -68, 97}, { -67, -43, 133, -301, 221}, + { -116, -200, -81, -92, -272}, { -64, -41, -54, -244, -220}, + { -287, -242, -50, -87, -89}, { -245, 236, 102, -166, -295}, + { 66, 24, -162, -71, 95}, { 66, 136, -90, -220, -36}, + { -98, -161, -222, -188, 29}, { -18, 18, -19, -415, 9}, + { 49, 61, 100, 39, -56}, { -111, 82, 135, -31, 52}, + { -90, -153, -93, 189, 182}, { -214, 295, 119, -74, 284}, + { 2, 137, 37, 47, 182}, { 92, 117, 184, -53, 373}, + { -21, -14, -35, 136, 391}, { 146, 129, -164, -28, 333}, + { 92, 80, -84, 100, -134}, { -8, 217, -32, 3, -47}, + { -151, 251, -215, 142, 92}, { -224, 310, -172, -275, 98}, + { 159, 155, -177, 112, 53}, { 205, 27, 8, -240, 192}, + { 169, 120, -319, -201, 106}, { 11, 36, -86, -237, 455}, + { -109, -154, -163, 174, -55}, { -38, 32, -101, -78, -59}, + { -205, -321, -97, 69, 79}, { -310, 44, 18, -185, 34}, + { -115, -20, -148, -39, 203}, { -29, 154, -30, -158, 166}, + { -45, -131, -317, -24, 363}, { -165, -205, -112, -222, 265}, + { -32, -44, -150, 54, -193}, { -6, -38, -255, -169, -115}, + { -266, 87, -189, -36, -169}, { -60, -87, -266, -436, -170}, + { -68, -81, -278, 24, 38}, { -23, -19, -155, -256, 141}, + { -61, -226, -565, -175, 71}, { 9, -29, -237, -515, 263} +}; + +static const int16_t dico22_isf_36b[128][4] = { + { -298, -6, 95, 31}, { -213, -87, -122, 261}, + { 4, -49, 208, 14}, { -129, -110, 30, 118}, + { -214, 258, 110, -235}, { -41, -18, -126, 120}, + { 103, 65, 127, -37}, { 126, -36, -24, 25}, + { -138, -67, -278, -186}, { -164, -194, -201, 78}, + { -211, -87, -51, -221}, { -174, -79, -94, -39}, + { 23, -6, -157, -240}, { 22, -110, -153, -68}, + { 148, -5, -2, -149}, { -1, -135, -39, -179}, + { 68, 360, -117, -15}, { 137, 47, -278, 146}, + { 136, 260, 135, 65}, { 61, 116, -45, 97}, + { 231, 379, 87, -120}, { 338, 177, -272, 3}, + { 266, 156, 28, -69}, { 260, 84, -85, 86}, + { -266, 154, -256, -182}, { -17, -65, -304, -6}, + { -40, 175, -151, -180}, { -27, 27, -87, -63}, + { 121, 114, -166, -469}, { 159, -66, -323, -231}, + { 214, 152, -141, -212}, { 137, 36, -184, -51}, + { -282, -237, 40, 10}, { -48, -235, -37, 251}, + { -54, -323, 136, 29}, { -88, -174, 213, 198}, + { -390, 99, -63, -375}, { 107, -169, -164, 424}, + { 69, -111, 141, -167}, { 74, -129, 65, 144}, + { -353, -207, -205, -109}, { -160, -386, -355, 98}, + { -176, -493, -20, -143}, { -252, -432, -2, 216}, + { -90, -174, -168, -411}, { 13, -284, -229, -160}, + { -87, -279, 34, -251}, { -75, -263, -58, -42}, + { 420, 53, -211, -358}, { 384, -35, -374, 396}, + { 68, -228, 323, -2}, { 167, -307, 192, 194}, + { 459, 329, -5, -332}, { 375, 79, -7, 313}, + { 282, -124, 200, -92}, { 271, -162, -70, 180}, + { -157, -298, -514, -309}, { 58, -163, -546, 18}, + { 124, -364, 167, -238}, { 83, -411, -117, 96}, + { 140, -112, -388, -624}, { 259, -133, -317, 41}, + { 163, -130, -64, -334}, { 226, -165, -124, -110}, + { -466, -61, 6, 229}, { -153, 205, -145, 242}, + { -159, 48, 195, 148}, { -58, 28, 31, 279}, + { -303, 185, 279, -4}, { -61, 197, 59, 86}, + { -114, 123, 168, -52}, { 35, 36, 100, 126}, + { -407, 102, -77, -40}, { -338, -1, -342, 156}, + { -179, 105, -34, -97}, { -185, 84, -35, 108}, + { -133, 107, -91, -357}, { -180, 54, -229, 24}, + { -44, 47, 47, -182}, { -66, 13, 45, 4}, + { -339, 251, 64, 226}, { -42, 101, -350, 275}, + { -99, 398, 142, 121}, { 111, 12, -102, 260}, + { 0, 505, 260, -94}, { 161, 285, -96, 224}, + { -4, 206, 314, 33}, { 167, 139, 88, 204}, + { -235, 316, -60, -25}, { -8, -150, -312, 201}, + { -36, 292, 61, -104}, { -40, 174, -162, 42}, + { -21, 402, -29, -351}, { 21, 152, -360, -93}, + { 57, 191, 212, -196}, { 76, 158, -21, -69}, + { -328, -185, 331, 119}, { -53, 285, 56, 337}, + { -107, -24, 405, 29}, { -18, 137, 272, 277}, + { -255, 22, 173, -191}, { 295, 322, 325, 302}, + { 21, -27, 332, -178}, { 119, 13, 271, 129}, + { -455, -180, 116, -191}, { -227, 62, -148, 524}, + { -176, -287, 282, -157}, { -243, 13, 199, 430}, + { -59, -49, 115, -365}, { 72, -172, -137, 93}, + { -138, -126, 141, -84}, { 5, -124, 38, -20}, + { -258, 311, 601, 213}, { 94, 130, -61, 502}, + { -1, -157, 485, 313}, { 146, -74, 158, 345}, + { 276, 135, 280, -57}, { 490, 252, 99, 43}, + { 267, -74, 429, 105}, { 278, -23, 119, 94}, + { -542, 488, 257, -115}, { -84, -244, -438, 478}, + { -113, -545, 387, 101}, { -95, -306, 111, 498}, + { 95, 166, 22, -301}, { 420, -15, -58, -78}, + { 270, 29, 122, -282}, { 160, -240, 50, -38} +}; + +static const int16_t dico23_isf_36b[64][7] = { + { 81, -18, 68, -27, -122, -280, -4}, + { 45, -177, 209, -30, -136, -74, 131}, + { -44, 101, -75, -88, -48, -137, -54}, + { -245, -28, 63, -18, -112, -103, 58}, + { -79, -6, 220, -65, 114, -35, -50}, + { 109, -65, 143, -114, 129, 76, 125}, + { 166, 90, -61, -242, 186, -74, -43}, + { -46, -92, 49, -227, 24, -155, 39}, + { 67, 85, 99, -42, 53, -184, -281}, + { 142, -122, 0, 21, -142, -15, -17}, + { 223, 92, -21, -48, -82, -14, -167}, + { 51, -37, -243, -30, -90, 18, -56}, + { 54, 105, 74, 86, 69, 13, -101}, + { 196, 72, -89, 43, 65, 19, 39}, + { 121, 34, 131, -82, 25, 213, -156}, + { 101, -102, -136, -21, 57, 214, 22}, + { 36, -124, 205, 204, 58, -156, -83}, + { 83, -117, 137, 137, 85, 116, 44}, + { -92, -148, -68, 11, -102, -197, -220}, + { -76, -185, -58, 132, -26, -183, 85}, + { -7, -31, -2, 23, 205, -151, 10}, + { -27, -37, -5, -18, 292, 131, 1}, + { 117, -168, 9, -93, 80, -59, -125}, + { -182, -244, 98, -24, 135, -22, 94}, + { 221, 97, 106, 42, 43, -160, 83}, + { 25, -64, -21, 6, 14, -15, 154}, + { 126, 15, -140, 150, -10, -207, -114}, + { 79, -63, -211, -70, -28, -217, 165}, + { 46, 38, -22, 281, 132, -62, 109}, + { 112, 54, -112, -93, 208, 27, 296}, + { 115, 10, -147, 41, 216, 42, -276}, + { 50, -115, -254, 167, 117, -2, 61}, + { 17, 144, 34, -72, -186, -150, 272}, + { -29, -66, -89, -95, -149, 129, 251}, + { 122, 0, -50, -234, -91, 36, 26}, + { -105, -102, -88, -121, -236, -7, -11}, + { -204, 109, 5, -191, 105, -15, 163}, + { -80, 32, -24, -209, 41, 294, 70}, + { -106, -94, -204, -118, 120, -50, -37}, + { -82, -241, 46, -131, -29, 150, -55}, + { 33, 155, 120, -89, -8, 7, 62}, + { 213, 82, 61, 18, -161, 144, 152}, + { 30, 131, 65, -87, -255, -17, -107}, + { -8, 85, -64, 51, -162, 223, -53}, + { -134, 261, 69, -56, 218, 72, -111}, + { 2, 155, -113, -87, 49, 85, -28}, + { -163, 42, -1, -196, 7, 39, -245}, + { 14, -137, -79, 11, -160, 202, -293}, + { -94, 33, 208, 100, 56, -44, 326}, + { -78, -41, 232, 13, -142, 227, 80}, + { -16, -87, 201, 33, -133, 15, -183}, + { -58, -192, -47, 184, -128, 133, 99}, + { -205, 11, -155, 78, 52, 72, 141}, + { -246, 26, 99, 151, 59, 115, -64}, + { -79, -47, -16, -14, 6, 47, -43}, + { -72, -178, -27, 162, 112, 43, -174}, + { -175, 238, 186, 71, -54, -188, -76}, + { -225, 233, 39, -39, -158, 122, 44}, + { -26, 43, 84, 130, -93, -51, 22}, + { 3, 92, -150, 136, -182, -57, 97}, + { -131, 179, -78, 80, 91, -165, 90}, + { -2, 148, 15, 130, 65, 175, 117}, + { -138, 114, -137, 132, 3, -10, -186}, + { 140, -4, -37, 254, -62, 92, -109} +}; + +/** Means of ISF vectors in Q15 */ +static const int16_t isf_mean[LP_ORDER] = { + 738, 1326, 2336, 3578, 4596, 5662, 6711, 7730, + 8750, 9753, 10705, 11728, 12833, 13971, 15043, 4037 +}; + +/** Initialization tables for the processed ISF vector in Q15 */ +static const int16_t isf_init[LP_ORDER] = { + 1024, 2048, 3072, 4096, 5120, 6144, 7168, 8192, + 9216, 10240, 11264, 12288, 13312, 14336, 15360, 3840 +}; + +/** ISF/ISP interpolation coefficients for each subframe */ +static const float isfp_inter[4] = { 0.45, 0.8, 0.96, 1.0 }; + +/** Coefficients for FIR interpolation of excitation vector + * at pitch lag resulting the adaptive codebook vector */ +static const float ac_inter[65] = { + 9.400024e-01, + 8.563843e-01, 6.322632e-01, 3.375854e-01, 5.908203e-02, + -1.310425e-01, -1.994019e-01, -1.585693e-01, -5.633545e-02, + 4.760742e-02, 1.067505e-01, 1.036987e-01, 5.206299e-02, + -1.519775e-02, -6.372070e-02, -7.366943e-02, -4.650879e-02, + -9.765625e-04, 3.820801e-02, 5.316162e-02, 4.003906e-02, + 9.338379e-03, -2.166748e-02, -3.778076e-02, -3.320312e-02, + -1.300049e-02, 1.068115e-02, 2.587891e-02, 2.630615e-02, + 1.379395e-02, -3.662109e-03, -1.678467e-02, -1.983643e-02, + -1.275635e-02, -5.493164e-04, 1.007080e-02, 1.409912e-02, + 1.068115e-02, 2.624512e-03, -5.371094e-03, -9.338379e-03, + -8.117676e-03, -3.173828e-03, 2.319336e-03, 5.615234e-03, + 5.554199e-03, 2.868652e-03, -6.103516e-04, -2.990723e-03, + -3.356934e-03, -2.014160e-03, -1.220703e-04, 1.342773e-03, + 1.708984e-03, 1.159668e-03, 2.441406e-04, -4.272461e-04, + -6.103516e-04, -4.272461e-04, -1.220703e-04, 6.103516e-05, + 1.220703e-04, 6.103516e-05, 0.000000e+00, 0.000000e+00 +}; + +/** [i][j] is the number of pulses present in track j at mode i */ +static const uint8_t pulses_nb_per_mode_tr[][4] = { + {1, 1, 0, 0}, {1, 1, 1, 1}, {2, 2, 2, 2}, + {3, 3, 2, 2}, {3, 3, 3, 3}, {4, 4, 4, 4}, + {5, 5, 4, 4}, {6, 6, 6, 6}, {6, 6, 6, 6} +}; + +/** Tables for decoding quantized gains { pitch (Q14), fixed factor (Q11) } */ +static const int16_t qua_gain_6b[64][2] = { + { 1566, 1332}, { 1577, 3557}, + { 3071, 6490}, { 4193, 10163}, + { 4496, 2534}, { 5019, 4488}, + { 5586, 15614}, { 5725, 1422}, + { 6453, 580}, { 6724, 6831}, + { 7657, 3527}, { 8072, 2099}, + { 8232, 5319}, { 8827, 8775}, + { 9740, 2868}, { 9856, 1465}, + { 10087, 12488}, { 10241, 4453}, + { 10859, 6618}, { 11321, 3587}, + { 11417, 1800}, { 11643, 2428}, + { 11718, 988}, { 12312, 5093}, + { 12523, 8413}, { 12574, 26214}, + { 12601, 3396}, { 13172, 1623}, + { 13285, 2423}, { 13418, 6087}, + { 13459, 12810}, { 13656, 3607}, + { 14111, 4521}, { 14144, 1229}, + { 14425, 1871}, { 14431, 7234}, + { 14445, 2834}, { 14628, 10036}, + { 14860, 17496}, { 15161, 3629}, + { 15209, 5819}, { 15299, 2256}, + { 15518, 4722}, { 15663, 1060}, + { 15759, 7972}, { 15939, 11964}, + { 16020, 2996}, { 16086, 1707}, + { 16521, 4254}, { 16576, 6224}, + { 16894, 2380}, { 16906, 681}, + { 17213, 8406}, { 17610, 3418}, + { 17895, 5269}, { 18168, 11748}, + { 18230, 1575}, { 18607, 32767}, + { 18728, 21684}, { 19137, 2543}, + { 19422, 6577}, { 19446, 4097}, + { 19450, 9056}, { 20371, 14885} +}; + +static const int16_t qua_gain_7b[128][2] = { + { 204, 441}, { 464, 1977}, + { 869, 1077}, { 1072, 3062}, + { 1281, 4759}, { 1647, 1539}, + { 1845, 7020}, { 1853, 634}, + { 1995, 2336}, { 2351, 15400}, + { 2661, 1165}, { 2702, 3900}, + { 2710, 10133}, { 3195, 1752}, + { 3498, 2624}, { 3663, 849}, + { 3984, 5697}, { 4214, 3399}, + { 4415, 1304}, { 4695, 2056}, + { 5376, 4558}, { 5386, 676}, + { 5518, 23554}, { 5567, 7794}, + { 5644, 3061}, { 5672, 1513}, + { 5957, 2338}, { 6533, 1060}, + { 6804, 5998}, { 6820, 1767}, + { 6937, 3837}, { 7277, 414}, + { 7305, 2665}, { 7466, 11304}, + { 7942, 794}, { 8007, 1982}, + { 8007, 1366}, { 8326, 3105}, + { 8336, 4810}, { 8708, 7954}, + { 8989, 2279}, { 9031, 1055}, + { 9247, 3568}, { 9283, 1631}, + { 9654, 6311}, { 9811, 2605}, + { 10120, 683}, { 10143, 4179}, + { 10245, 1946}, { 10335, 1218}, + { 10468, 9960}, { 10651, 3000}, + { 10951, 1530}, { 10969, 5290}, + { 11203, 2305}, { 11325, 3562}, + { 11771, 6754}, { 11839, 1849}, + { 11941, 4495}, { 11954, 1298}, + { 11975, 15223}, { 11977, 883}, + { 11986, 2842}, { 12438, 2141}, + { 12593, 3665}, { 12636, 8367}, + { 12658, 1594}, { 12886, 2628}, + { 12984, 4942}, { 13146, 1115}, + { 13224, 524}, { 13341, 3163}, + { 13399, 1923}, { 13549, 5961}, + { 13606, 1401}, { 13655, 2399}, + { 13782, 3909}, { 13868, 10923}, + { 14226, 1723}, { 14232, 2939}, + { 14278, 7528}, { 14439, 4598}, + { 14451, 984}, { 14458, 2265}, + { 14792, 1403}, { 14818, 3445}, + { 14899, 5709}, { 15017, 15362}, + { 15048, 1946}, { 15069, 2655}, + { 15405, 9591}, { 15405, 4079}, + { 15570, 7183}, { 15687, 2286}, + { 15691, 1624}, { 15699, 3068}, + { 15772, 5149}, { 15868, 1205}, + { 15970, 696}, { 16249, 3584}, + { 16338, 1917}, { 16424, 2560}, + { 16483, 4438}, { 16529, 6410}, + { 16620, 11966}, { 16839, 8780}, + { 17030, 3050}, { 17033, 18325}, + { 17092, 1568}, { 17123, 5197}, + { 17351, 2113}, { 17374, 980}, + { 17566, 26214}, { 17609, 3912}, + { 17639, 32767}, { 18151, 7871}, + { 18197, 2516}, { 18202, 5649}, + { 18679, 3283}, { 18930, 1370}, + { 19271, 13757}, { 19317, 4120}, + { 19460, 1973}, { 19654, 10018}, + { 19764, 6792}, { 19912, 5135}, + { 20040, 2841}, { 21234, 19833} +}; + +/** 4-tap moving average prediction coefficients in reverse order */ +static const float energy_pred_fac[4] = { 0.2, 0.3, 0.4, 0.5 }; + +/** impulse response filter tables converted to float from Q15 + * used for anti-sparseness processing */ +static const float ir_filter_str[64] = { + 6.159058e-01, 2.958069e-01, 9.979248e-02, -1.048889e-01, + 8.740234e-02, -1.599121e-01, 4.849243e-02, -4.141235e-02, + 1.831055e-02, 1.188049e-01, -4.568481e-02, -2.130127e-02, + 3.671265e-02, -1.601868e-01, 3.659058e-02, 1.639099e-01, + -4.541016e-02, -2.151489e-02, -8.810425e-02, 6.030273e-02, + 2.740479e-02, 2.200317e-02, -1.182861e-01, 1.289978e-01, + -1.560059e-01, 1.953125e-01, -3.149414e-02, -1.441956e-01, + 1.249084e-01, -1.328125e-01, 9.780884e-02, 6.500244e-02, + -6.091309e-02, -5.599976e-02, 8.081055e-02, -5.450439e-02, + -1.239014e-02, 1.748657e-02, 7.580566e-02, -1.101074e-01, + 9.579468e-02, -4.159546e-02, -7.830811e-02, 1.162109e-01, + -1.950073e-02, -6.259155e-02, -1.651001e-02, 7.250977e-02, + 1.199951e-01, -1.911011e-01, 4.370117e-02, -1.098938e-01, + 1.492004e-01, 1.129150e-02, 1.730347e-02, -3.549194e-02, + -8.709717e-02, 5.841064e-02, 1.190186e-03, -7.379150e-02, + 1.054077e-01, 9.078979e-02, -1.227112e-01, 1.047058e-01 +}; + +static const float ir_filter_mid[64] = { + 7.354126e-01, 3.192139e-01, -1.606140e-01, -2.328491e-02, + 6.250000e-02, -2.828979e-02, 5.349731e-02, -1.014099e-01, + 6.750488e-02, 1.989746e-02, -6.549072e-02, 7.589722e-02, + -1.080017e-01, 1.253967e-01, -6.430054e-02, -1.141357e-02, + -1.910400e-02, 1.303101e-01, -1.673889e-01, 6.820679e-02, + 5.670166e-02, -8.450317e-02, 2.270508e-02, 3.479004e-02, + -2.328491e-02, -4.928589e-02, 1.239014e-01, -1.395874e-01, + 9.100342e-02, -3.549194e-02, 2.230835e-02, -3.350830e-02, + 2.450562e-02, 5.096436e-03, -2.178955e-02, 1.849365e-02, + -1.708984e-02, 1.950073e-02, 1.312256e-03, -5.389404e-02, + 9.851074e-02, -8.489990e-02, 2.029419e-02, 2.328491e-02, + 7.110596e-03, -6.109619e-02, 3.939819e-02, 5.709839e-02, + -1.058960e-01, 3.149414e-02, 8.270264e-02, -1.232910e-01, + 1.105957e-01, -1.286011e-01, 1.614990e-01, -1.303101e-01, + 4.769897e-02, 3.295898e-03, -1.770020e-02, 5.010986e-02, + -7.501221e-02, 2.920532e-02, 1.660156e-02, 7.751465e-02 +}; + +static const float * const ir_filters_lookup[2] = { + ir_filter_str, ir_filter_mid +}; + +/** High-pass filters coefficients for 31 Hz and 400 Hz cutoff */ +static const float hpf_zeros[2] = { -2.0, 1.0 }; +static const float hpf_31_poles[2] = { -1.978881836, 0.979125977 }; +static const float hpf_31_gain = 0.989501953; + +static const float hpf_400_poles[2] = { -1.787109375, 0.864257812 }; +static const float hpf_400_gain = 0.893554687; + +/** Interpolation coefficients for 5/4 signal upsampling + * Table from the reference source was reordered for efficiency */ +static const float upsample_fir[4][24] = { + { -6.103516e-05, 7.324219e-04, -2.014160e-03, 4.150391e-03, + -7.263184e-03, 1.165771e-02, -1.776123e-02, 2.624512e-02, + -3.869629e-02, 5.877686e-02, -9.863281e-02, 2.314453e-01, + 9.348755e-01, -1.523438e-01, 7.861328e-02, -4.937744e-02, + 3.308105e-02, -2.252197e-02, 1.507568e-02, -9.765625e-03, + 5.859375e-03, -3.173828e-03, 1.403809e-03, -3.662109e-04 }, + { -2.441406e-04, 1.464844e-03, -3.784180e-03, 7.568359e-03, + -1.300049e-02, 2.062988e-02, -3.112793e-02, 4.589844e-02, + -6.781006e-02, 1.042480e-01, -1.815186e-01, 5.016479e-01, + 7.548828e-01, -2.094727e-01, 1.148071e-01, -7.348633e-02, + 4.956055e-02, -3.369141e-02, 2.246094e-02, -1.434326e-02, + 8.483887e-03, -4.455566e-03, 1.831055e-03, -4.272461e-04 }, + { -4.272461e-04, 1.831055e-03, -4.455566e-03, 8.483887e-03, + -1.434326e-02, 2.246094e-02, -3.369141e-02, 4.956055e-02, + -7.348633e-02, 1.148071e-01, -2.094727e-01, 7.548828e-01, + 5.016479e-01, -1.815186e-01, 1.042480e-01, -6.781006e-02, + 4.589844e-02, -3.112793e-02, 2.062988e-02, -1.300049e-02, + 7.568359e-03, -3.784180e-03, 1.464844e-03, -2.441406e-04 }, + { -3.662109e-04, 1.403809e-03, -3.173828e-03, 5.859375e-03, + -9.765625e-03, 1.507568e-02, -2.252197e-02, 3.308105e-02, + -4.937744e-02, 7.861328e-02, -1.523438e-01, 9.348755e-01, + 2.314453e-01, -9.863281e-02, 5.877686e-02, -3.869629e-02, + 2.624512e-02, -1.776123e-02, 1.165771e-02, -7.263184e-03, + 4.150391e-03, -2.014160e-03, 7.324219e-04, -6.103516e-05 } +}; + +/** High band quantized gains for 23k85 in Q14 */ +static const uint16_t qua_hb_gain[16] = { + 3624, 4673, 5597, 6479, 7425, 8378, 9324, 10264, + 11210, 12206, 13391, 14844, 16770, 19655, 24289, 32728 +}; + +/** High-band post-processing FIR filters coefficients from Q15 */ +static const float bpf_6_7_coef[31] = { // band pass, 6kHz and 7kHz cutoffs + -2.441406e-04, 3.585815e-04, 2.441406e-04, + -2.059937e-04, -2.815248e-03, 8.560180e-03, + -1.084137e-02, 0.000000e+00, 2.897645e-02, + -6.774902e-02, 9.421540e-02, -8.380128e-02, + 2.706910e-02, 5.924987e-02, -1.373367e-01, + 1.687469e-01, + -1.373367e-01, 5.924987e-02, 2.706910e-02, + -8.380128e-02, 9.421540e-02, -6.774902e-02, + 2.897645e-02, 0.000000e+00, -1.084137e-02, + 8.560180e-03, -2.815248e-03, -2.059937e-04, + 2.441406e-04, 3.585815e-04, -2.441406e-04 +}; + +static const float lpf_7_coef[31] = { // low pass, 7kHz cutoff + -6.408691e-04, 1.434326e-03, -2.716064e-03, + 4.455566e-03, -6.195068e-03, 6.988525e-03, + -5.401611e-03, 0.000000e+00, 1.022339e-02, + -2.560425e-02, 4.531860e-02, -6.747437e-02, + 8.944702e-02, -1.080933e-01, 1.206360e-01, + 8.753052e-01, + 1.206360e-01, -1.080933e-01, 8.944702e-02, + -6.747437e-02, 4.531860e-02, -2.560425e-02, + 1.022339e-02, 0.000000e+00, -5.401611e-03, + 6.988525e-03, -6.195068e-03, 4.455566e-03, + -2.716064e-03, 1.434326e-03, -6.408691e-04 +}; + +/** Core frame sizes in each mode */ +static const uint16_t cf_sizes_wb[] = { + 132, 177, 253, 285, 317, 365, 397, 461, 477, + 40, 0, 0, 0, 0, 0, 0 +}; + +#endif /* AVCODEC_AMRWBDATA_H */ diff --git a/include/libavcodec/aom_film_grain.h b/include/libavcodec/aom_film_grain.h new file mode 100644 index 0000000..97c33de --- /dev/null +++ b/include/libavcodec/aom_film_grain.h @@ -0,0 +1,55 @@ +/* + * AOM film grain synthesis + * Copyright (c) 2021 Niklas Haas + * + * 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 + */ + +/** + * @file + * AOM film grain synthesis. + * @author Niklas Haas + */ + +#ifndef AVCODEC_AOM_FILM_GRAIN_H +#define AVCODEC_AOM_FILM_GRAIN_H + +#include "libavutil/buffer.h" +#include "libavutil/film_grain_params.h" + +typedef struct AVFilmGrainAFGS1Params { + int enable; + AVBufferRef *sets[8]; +} AVFilmGrainAFGS1Params; + +// Synthesizes film grain on top of `in` and stores the result to `out`. `out` +// must already have been allocated and set to the same size and format as `in`. +int ff_aom_apply_film_grain(AVFrame *out, const AVFrame *in, + const AVFilmGrainParams *params); + +// Parse AFGS1 parameter sets from an ITU-T T.35 payload. Returns 0 on success, +// or a negative error code. +int ff_aom_parse_film_grain_sets(AVFilmGrainAFGS1Params *s, + const uint8_t *payload, int payload_size); + +// Attach all valid film grain param sets to `frame`. +int ff_aom_attach_film_grain_sets(const AVFilmGrainAFGS1Params *s, AVFrame *frame); + +// Free all allocations in `s` and zero the entire struct. +void ff_aom_uninit_film_grain_params(AVFilmGrainAFGS1Params *s); + +#endif /* AVCODEC_AOM_FILM_GRAIN_H */ diff --git a/include/libavcodec/apng.h b/include/libavcodec/apng.h new file mode 100644 index 0000000..abd8795 --- /dev/null +++ b/include/libavcodec/apng.h @@ -0,0 +1,44 @@ +/* + * APNG common header + * Copyright (c) 2014 Benoit Fouet + * + * 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 + */ + +/** + * @file + * APNG common header + */ + +#ifndef AVCODEC_APNG_H +#define AVCODEC_APNG_H + +enum { + APNG_DISPOSE_OP_NONE = 0, + APNG_DISPOSE_OP_BACKGROUND = 1, + APNG_DISPOSE_OP_PREVIOUS = 2, +}; + +enum { + APNG_BLEND_OP_SOURCE = 0, + APNG_BLEND_OP_OVER = 1, +}; + +/* Only the payload data, not including length, fourcc and CRC-32. */ +#define APNG_FCTL_CHUNK_SIZE 26 + +#endif /* AVCODEC_APNG_H */ diff --git a/include/libavcodec/aptx.h b/include/libavcodec/aptx.h new file mode 100644 index 0000000..da0697e --- /dev/null +++ b/include/libavcodec/aptx.h @@ -0,0 +1,217 @@ +/* + * Audio Processing Technology codec for Bluetooth (aptX) + * + * Copyright (C) 2017 Aurelien Jacobs + * + * 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_APTX_H +#define AVCODEC_APTX_H + +#include "libavutil/intreadwrite.h" +#include "avcodec.h" +#include "mathops.h" + + +enum channels { + LEFT, + RIGHT, + NB_CHANNELS +}; + +enum subbands { + LF, // Low Frequency (0-5.5 kHz) + MLF, // Medium-Low Frequency (5.5-11kHz) + MHF, // Medium-High Frequency (11-16.5kHz) + HF, // High Frequency (16.5-22kHz) + NB_SUBBANDS +}; + +#define NB_FILTERS 2 +#define FILTER_TAPS 16 + +typedef struct { + int pos; + int32_t buffer[2*FILTER_TAPS]; +} FilterSignal; + +typedef struct { + FilterSignal outer_filter_signal[NB_FILTERS]; + FilterSignal inner_filter_signal[NB_FILTERS][NB_FILTERS]; +} QMFAnalysis; + +typedef struct { + int32_t quantized_sample; + int32_t quantized_sample_parity_change; + int32_t error; +} Quantize; + +typedef struct { + int32_t quantization_factor; + int32_t factor_select; + int32_t reconstructed_difference; +} InvertQuantize; + +typedef struct { + int32_t prev_sign[2]; + int32_t s_weight[2]; + int32_t d_weight[24]; + int32_t pos; + int32_t reconstructed_differences[48]; + int32_t previous_reconstructed_sample; + int32_t predicted_difference; + int32_t predicted_sample; +} Prediction; + +typedef struct { + int32_t codeword_history; + int32_t dither_parity; + int32_t dither[NB_SUBBANDS]; + + QMFAnalysis qmf; + Quantize quantize[NB_SUBBANDS]; + InvertQuantize invert_quantize[NB_SUBBANDS]; + Prediction prediction[NB_SUBBANDS]; +} Channel; + +typedef struct { + int hd; + int block_size; + int32_t sync_idx; + Channel channels[NB_CHANNELS]; +} AptXContext; + +typedef const struct { + const int32_t *quantize_intervals; + const int32_t *invert_quantize_dither_factors; + const int32_t *quantize_dither_factors; + const int16_t *quantize_factor_select_offset; + int tables_size; + int32_t factor_max; + int32_t prediction_order; +} ConstTables; + +extern ConstTables ff_aptx_quant_tables[2][NB_SUBBANDS]; + +/* Rounded right shift with optionnal clipping */ +#define RSHIFT_SIZE(size) \ +av_always_inline \ +static int##size##_t rshift##size(int##size##_t value, int shift) \ +{ \ + int##size##_t rounding = (int##size##_t)1 << (shift - 1); \ + int##size##_t mask = ((int##size##_t)1 << (shift + 1)) - 1; \ + return ((value + rounding) >> shift) - ((value & mask) == rounding); \ +} \ +av_always_inline \ +static int##size##_t rshift##size##_clip24(int##size##_t value, int shift) \ +{ \ + return av_clip_intp2(rshift##size(value, shift), 23); \ +} +RSHIFT_SIZE(32) +RSHIFT_SIZE(64) + +/* + * Convolution filter coefficients for the outer QMF of the QMF tree. + * The 2 sets are a mirror of each other. + */ +static const int32_t aptx_qmf_outer_coeffs[NB_FILTERS][FILTER_TAPS] = { + { + 730, -413, -9611, 43626, -121026, 269973, -585547, 2801966, + 697128, -160481, 27611, 8478, -10043, 3511, 688, -897, + }, + { + -897, 688, 3511, -10043, 8478, 27611, -160481, 697128, + 2801966, -585547, 269973, -121026, 43626, -9611, -413, 730, + }, +}; + +/* + * Convolution filter coefficients for the inner QMF of the QMF tree. + * The 2 sets are a mirror of each other. + */ +static const int32_t aptx_qmf_inner_coeffs[NB_FILTERS][FILTER_TAPS] = { + { + 1033, -584, -13592, 61697, -171156, 381799, -828088, 3962579, + 985888, -226954, 39048, 11990, -14203, 4966, 973, -1268, + }, + { + -1268, 973, 4966, -14203, 11990, 39048, -226954, 985888, + 3962579, -828088, 381799, -171156, 61697, -13592, -584, 1033, + }, +}; + +/* + * Push one sample into a circular signal buffer. + */ +av_always_inline +static void aptx_qmf_filter_signal_push(FilterSignal *signal, int32_t sample) +{ + signal->buffer[signal->pos ] = sample; + signal->buffer[signal->pos+FILTER_TAPS] = sample; + signal->pos = (signal->pos + 1) & (FILTER_TAPS - 1); +} + +/* + * Compute the convolution of the signal with the coefficients, and reduce + * to 24 bits by applying the specified right shifting. + */ +av_always_inline +static int32_t aptx_qmf_convolution(FilterSignal *signal, + const int32_t coeffs[FILTER_TAPS], + int shift) +{ + int32_t *sig = &signal->buffer[signal->pos]; + int64_t e = 0; + int i; + + for (i = 0; i < FILTER_TAPS; i++) + e += MUL64(sig[i], coeffs[i]); + + return rshift64_clip24(e, shift); +} + +static inline int32_t aptx_quantized_parity(Channel *channel) +{ + int32_t parity = channel->dither_parity; + int subband; + + for (subband = 0; subband < NB_SUBBANDS; subband++) + parity ^= channel->quantize[subband].quantized_sample; + + return parity & 1; +} + +/* For each sample, ensure that the parity of all subbands of all channels + * is 0 except once every 8 samples where the parity is forced to 1. */ +static inline int aptx_check_parity(Channel channels[NB_CHANNELS], int32_t *idx) +{ + int32_t parity = aptx_quantized_parity(&channels[LEFT]) + ^ aptx_quantized_parity(&channels[RIGHT]); + + int eighth = *idx == 7; + *idx = (*idx + 1) & 7; + + return parity ^ eighth; +} + +void ff_aptx_invert_quantize_and_prediction(Channel *channel, int hd); +void ff_aptx_generate_dither(Channel *channel); + +int ff_aptx_init(AVCodecContext *avctx); + +#endif /* AVCODEC_APTX_H */ diff --git a/include/libavcodec/ass.h b/include/libavcodec/ass.h new file mode 100644 index 0000000..4dffe92 --- /dev/null +++ b/include/libavcodec/ass.h @@ -0,0 +1,146 @@ +/* + * SSA/ASS common functions + * Copyright (c) 2010 Aurelien Jacobs + * + * 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_ASS_H +#define AVCODEC_ASS_H + +#include "avcodec.h" +#include "libavutil/bprint.h" + +#define ASS_DEFAULT_PLAYRESX 384 +#define ASS_DEFAULT_PLAYRESY 288 + +/** + * @name Default values for ASS style + * @{ + */ +#define ASS_DEFAULT_FONT "Arial" +#define ASS_DEFAULT_FONT_SIZE 16 +#define ASS_DEFAULT_COLOR 0xffffff +#define ASS_DEFAULT_BACK_COLOR 0 +#define ASS_DEFAULT_BOLD 0 +#define ASS_DEFAULT_ITALIC 0 +#define ASS_DEFAULT_UNDERLINE 0 +#define ASS_DEFAULT_ALIGNMENT 2 +#define ASS_DEFAULT_BORDERSTYLE 1 +/** @} */ + +typedef struct FFASSDecoderContext { + int readorder; +} FFASSDecoderContext; + +/** + * Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS. + * Can specify all fields explicitly + * + * @param avctx pointer to the AVCodecContext + * @param play_res_x subtitle frame width + * @param play_res_y subtitle frame height + * @param font name of the default font face to use + * @param font_size default font size to use + * @param primary_color default text color to use (ABGR) + * @param secondary_color default secondary text color to use (ABGR) + * @param outline_color default outline color to use (ABGR) + * @param back_color default background color to use (ABGR) + * @param bold 1 for bold text, 0 for normal text + * @param italic 1 for italic text, 0 for normal text + * @param underline 1 for underline text, 0 for normal text + * @param border_style 1 for outline, 3 for opaque box + * @param alignment position of the text (left, center, top...), defined after + * the layout of the numpad (1-3 sub, 4-6 mid, 7-9 top) + * @return >= 0 on success otherwise an error code <0 + */ +int ff_ass_subtitle_header_full(AVCodecContext *avctx, + int play_res_x, int play_res_y, + const char *font, int font_size, + int primary_color, int secondary_color, + int outline_color, int back_color, + int bold, int italic, int underline, + int border_style, int alignment); +/** + * Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS. + * + * @param avctx pointer to the AVCodecContext + * @param font name of the default font face to use + * @param font_size default font size to use + * @param color default text color to use (ABGR) + * @param back_color default background color to use (ABGR) + * @param bold 1 for bold text, 0 for normal text + * @param italic 1 for italic text, 0 for normal text + * @param underline 1 for underline text, 0 for normal text + * @param alignment position of the text (left, center, top...), defined after + * the layout of the numpad (1-3 sub, 4-6 mid, 7-9 top) + * @return >= 0 on success otherwise an error code <0 + */ +int ff_ass_subtitle_header(AVCodecContext *avctx, + const char *font, int font_size, + int color, int back_color, + int bold, int italic, int underline, + int border_style, int alignment); + +/** + * Generate a suitable AVCodecContext.subtitle_header for SUBTITLE_ASS + * with default style. + * + * @param avctx pointer to the AVCodecContext + * @return >= 0 on success otherwise an error code <0 + */ +int ff_ass_subtitle_header_default(AVCodecContext *avctx); + +/** + * Craft an ASS dialog string. + */ +char *ff_ass_get_dialog(int readorder, int layer, const char *style, + const char *speaker, const char *text); + +/** + * Add an ASS dialog to a subtitle. + */ +int ff_ass_add_rect(AVSubtitle *sub, const char *dialog, + int readorder, int layer, const char *style, + const char *speaker); + +/** + * Add an ASS dialog to a subtitle. + */ +int ff_ass_add_rect2(AVSubtitle *sub, const char *dialog, + int readorder, int layer, const char *style, + const char *speaker, unsigned *nb_rect_allocated); + +/** + * Helper to flush a text subtitles decoder making use of the + * FFASSDecoderContext. + */ +void ff_ass_decoder_flush(AVCodecContext *avctx); + +/** + * Escape a text subtitle using ASS syntax into an AVBPrint buffer. + * Newline characters will be escaped to \N. + * + * @param buf pointer to an initialized AVBPrint buffer + * @param p source text + * @param size size of the source text + * @param linebreaks additional newline chars, which will be escaped to \N + * @param keep_ass_markup braces and backslash will not be escaped if set + */ +void ff_ass_bprint_text_event(AVBPrint *buf, const char *p, int size, + const char *linebreaks, int keep_ass_markup); +#endif /* AVCODEC_ASS_H */ diff --git a/include/libavcodec/ass_split.h b/include/libavcodec/ass_split.h new file mode 100644 index 0000000..a45fb9b --- /dev/null +++ b/include/libavcodec/ass_split.h @@ -0,0 +1,191 @@ +/* + * SSA/ASS spliting functions + * Copyright (c) 2010 Aurelien Jacobs + * + * 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_ASS_SPLIT_H +#define AVCODEC_ASS_SPLIT_H + +/** + * fields extracted from the [Script Info] section + */ +typedef struct { + char *script_type; /**< SSA script format version (eg. v4.00) */ + char *collisions; /**< how subtitles are moved to prevent collisions */ + int play_res_x; /**< video width that ASS coords are referring to */ + int play_res_y; /**< video height that ASS coords are referring to */ + float timer; /**< time multiplier to apply to SSA clock (in %) */ +} ASSScriptInfo; + +/** + * fields extracted from the [V4(+) Styles] section + */ +typedef struct { + char *name; /**< name of the tyle (case sensitive) */ + char *font_name; /**< font face (case sensitive) */ + int font_size; /**< font height */ + int primary_color; /**< color that a subtitle will normally appear in */ + int secondary_color; + int outline_color; /**< color for outline in ASS, called tertiary in SSA */ + int back_color; /**< color of the subtitle outline or shadow */ + int bold; /**< whether text is bold (1) or not (0) */ + int italic; /**< whether text is italic (1) or not (0) */ + int underline; /**< whether text is underlined (1) or not (0) */ + int strikeout; + float scalex; + float scaley; + float spacing; + float angle; + int border_style; + float outline; + float shadow; + int alignment; /**< position of the text (left, center, top...), + defined after the layout of the numpad + (1-3 sub, 4-6 mid, 7-9 top) */ + int margin_l; + int margin_r; + int margin_v; + int alpha_level; + int encoding; +} ASSStyle; + +/** + * fields extracted from the [Events] section + */ +typedef struct { + int readorder; + int layer; /**< higher numbered layers are drawn over lower numbered */ + int start; /**< start time of the dialog in centiseconds */ + int end; /**< end time of the dialog in centiseconds */ + char *style; /**< name of the ASSStyle to use with this dialog */ + char *name; + int margin_l; + int margin_r; + int margin_v; + char *effect; + char *text; /**< actual text which will be displayed as a subtitle, + can include style override control codes (see + ff_ass_split_override_codes()) */ +} ASSDialog; + +/** + * structure containing the whole split ASS data + */ +typedef struct { + ASSScriptInfo script_info; /**< general information about the SSA script*/ + ASSStyle *styles; /**< array of split out styles */ + int styles_count; /**< number of ASSStyle in the styles array */ + ASSDialog *dialogs; /**< array of split out dialogs */ + int dialogs_count; /**< number of ASSDialog in the dialogs array*/ +} ASS; + +/** + * This struct can be casted to ASS to access to the split data. + */ +typedef struct ASSSplitContext ASSSplitContext; + +/** + * Split a full ASS file or a ASS header from a string buffer and store + * the split structure in a newly allocated context. + * + * @param buf String containing the ASS formatted data. + * @return Newly allocated struct containing split data. + */ +ASSSplitContext *ff_ass_split(const char *buf); + +/** + * Free a dialogue obtained from ff_ass_split_dialog(). + */ +void ff_ass_free_dialog(ASSDialog **dialogp); + +/** + * Split one ASS Dialogue line from a string buffer. + * + * @param ctx Context previously initialized by ff_ass_split(). + * @param buf String containing the ASS "Dialogue" line. + * @return Pointer to the split ASSDialog. Must be freed with ff_ass_free_dialog() + */ +ASSDialog *ff_ass_split_dialog(ASSSplitContext *ctx, const char *buf); + +/** + * Free all the memory allocated for an ASSSplitContext. + * + * @param ctx Context previously initialized by ff_ass_split(). + */ +void ff_ass_split_free(ASSSplitContext *ctx); + + +/** + * Set of callback functions corresponding to each override codes that can + * be encountered in a "Dialogue" Text field. + */ +typedef struct { + /** + * @defgroup ass_styles ASS styles + * @{ + */ + void (*text)(void *priv, const char *text, int len); + void (*new_line)(void *priv, int forced); + void (*style)(void *priv, char style, int close); + void (*color)(void *priv, unsigned int /* color */, unsigned int color_id); + void (*alpha)(void *priv, int alpha, int alpha_id); + void (*font_name)(void *priv, const char *name); + void (*font_size)(void *priv, int size); + void (*alignment)(void *priv, int alignment); + void (*cancel_overrides)(void *priv, const char *style); + /** @} */ + + /** + * @defgroup ass_functions ASS functions + * @{ + */ + void (*move)(void *priv, int x1, int y1, int x2, int y2, int t1, int t2); + void (*origin)(void *priv, int x, int y); + /** @} */ + + /** + * @defgroup ass_end end of Dialogue Event + * @{ + */ + void (*end)(void *priv); + /** @} */ +} ASSCodesCallbacks; + +/** + * Split override codes out of a ASS "Dialogue" Text field. + * + * @param callbacks Set of callback functions called for each override code + * encountered. + * @param priv Opaque pointer passed to the callback functions. + * @param buf The ASS "Dialogue" Text field to split. + * @return >= 0 on success otherwise an error code <0 + */ +int ff_ass_split_override_codes(const ASSCodesCallbacks *callbacks, void *priv, + const char *buf); + +/** + * Find an ASSStyle structure by its name. + * + * @param ctx Context previously initialized by ff_ass_split(). + * @param style name of the style to search for. + * @return the ASSStyle corresponding to style, or NULL if style can't be found + */ +ASSStyle *ff_ass_style_get(ASSSplitContext *ctx, const char *style); + +#endif /* AVCODEC_ASS_SPLIT_H */ diff --git a/include/libavcodec/asv.h b/include/libavcodec/asv.h new file mode 100644 index 0000000..7c0983a --- /dev/null +++ b/include/libavcodec/asv.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2003 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * ASUS V1/V2 encoder/decoder common data. + */ + +#ifndef AVCODEC_ASV_H +#define AVCODEC_ASV_H + +#include + +#include "avcodec.h" +#include "bswapdsp.h" + +typedef struct ASVCommonContext { + AVCodecContext *avctx; + BswapDSPContext bbdsp; + int mb_width; + int mb_height; + int mb_width2; + int mb_height2; +} ASVCommonContext; + +extern const uint8_t ff_asv_scantab[64]; +extern const uint8_t ff_asv_ccp_tab[17][2]; +extern const uint8_t ff_asv_level_tab[7][2]; +extern const uint8_t ff_asv_dc_ccp_tab[8][2]; +extern const uint8_t ff_asv_ac_ccp_tab[16][2]; +extern const uint16_t ff_asv2_level_tab[63][2]; + +void ff_asv_common_init(AVCodecContext *avctx); + +#endif /* AVCODEC_ASV_H */ diff --git a/include/libavcodec/atrac.h b/include/libavcodec/atrac.h new file mode 100644 index 0000000..05208bb --- /dev/null +++ b/include/libavcodec/atrac.h @@ -0,0 +1,97 @@ +/* + * common functions for the ATRAC family of decoders + * + * Copyright (c) 2009-2013 Maxim Poliakovski + * Copyright (c) 2009 Benjamin Larsson + * + * 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 + */ + +/** + * @file + * ATRAC common header + */ + +#ifndef AVCODEC_ATRAC_H +#define AVCODEC_ATRAC_H + +/** + * Gain control parameters for one subband. + */ +typedef struct AtracGainInfo { + int num_points; ///< number of gain control points + int lev_code[7]; ///< level at corresponding control point + int loc_code[7]; ///< location of gain control points +} AtracGainInfo; + +/** + * Gain compensation context structure. + */ +typedef struct AtracGCContext { + float gain_tab1[16]; ///< gain compensation level table + float gain_tab2[31]; ///< gain compensation interpolation table + int id2exp_offset; ///< offset for converting level index into level exponent + int loc_scale; ///< scale of location code = 2^loc_scale samples + int loc_size; ///< size of location code in samples +} AtracGCContext; + +extern float ff_atrac_sf_table[64]; + +/** + * Generate common tables. + */ +void ff_atrac_generate_tables(void); + +/** + * Initialize gain compensation context. + * + * @param gctx pointer to gain compensation context to initialize + * @param id2exp_offset offset for converting level index into level exponent + * @param loc_scale location size factor + */ +void ff_atrac_init_gain_compensation(AtracGCContext *gctx, int id2exp_offset, + int loc_scale); + +/** + * Apply gain compensation and perform the MDCT overlapping part. + * + * @param gctx pointer to gain compensation context + * @param in input buffer + * @param prev previous buffer to perform overlap against + * @param gc_now gain control information for current frame + * @param gc_next gain control information for next frame + * @param num_samples number of samples to process + * @param out output data goes here + */ +void ff_atrac_gain_compensation(AtracGCContext *gctx, float *in, float *prev, + AtracGainInfo *gc_now, AtracGainInfo *gc_next, + int num_samples, float *out); + +/** + * Quadrature mirror synthesis filter. + * + * @param inlo lower part of spectrum + * @param inhi higher part of spectrum + * @param nIn size of spectrum buffer + * @param pOut out buffer + * @param delayBuf delayBuf buffer + * @param temp temp buffer + */ +void ff_atrac_iqmf(float *inlo, float *inhi, unsigned int nIn, float *pOut, + float *delayBuf, float *temp); + +#endif /* AVCODEC_ATRAC_H */ diff --git a/include/libavcodec/atrac1data.h b/include/libavcodec/atrac1data.h new file mode 100644 index 0000000..62c218b --- /dev/null +++ b/include/libavcodec/atrac1data.h @@ -0,0 +1,64 @@ +/* + * ATRAC 1 compatible decoder data + * Copyright (c) 2009 Maxim Poliakovski + * Copyright (c) 2009 Benjamin Larsson + * + * 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 + */ + +/** + * @file + * ATRAC1 compatible decoder data + */ + +#ifndef AVCODEC_ATRAC1DATA_H +#define AVCODEC_ATRAC1DATA_H + +#include + +static const uint8_t bfu_amount_tab1[8] = {20, 28, 32, 36, 40, 44, 48, 52}; +static const uint8_t bfu_amount_tab2[4] = { 0, 112, 176, 208}; +static const uint8_t bfu_amount_tab3[8] = { 0, 24, 36, 48, 72, 108, 132, 156}; + +/** number of BFUs in each QMF band */ +static const uint8_t bfu_bands_t[4] = {0, 20, 36, 52}; + +/** number of spectral lines in each BFU + * block floating unit = group of spectral frequencies having the + * same quantization parameters like word length and scale factor + */ +static const uint8_t specs_per_bfu[52] = { + 8, 8, 8, 8, 4, 4, 4, 4, 8, 8, 8, 8, 6, 6, 6, 6, 6, 6, 6, 6, // low band + 6, 6, 6, 6, 7, 7, 7, 7, 9, 9, 9, 9, 10, 10, 10, 10, // middle band + 12, 12, 12, 12, 12, 12, 12, 12, 20, 20, 20, 20, 20, 20, 20, 20 // high band +}; + +/** start position of each BFU in the MDCT spectrum for the long mode */ +static const uint16_t bfu_start_long[52] = { + 0, 8, 16, 24, 32, 36, 40, 44, 48, 56, 64, 72, 80, 86, 92, 98, 104, 110, 116, 122, + 128, 134, 140, 146, 152, 159, 166, 173, 180, 189, 198, 207, 216, 226, 236, 246, + 256, 268, 280, 292, 304, 316, 328, 340, 352, 372, 392, 412, 432, 452, 472, 492, +}; + +/** start position of each BFU in the MDCT spectrum for the short mode */ +static const uint16_t bfu_start_short[52] = { + 0, 32, 64, 96, 8, 40, 72, 104, 12, 44, 76, 108, 20, 52, 84, 116, 26, 58, 90, 122, + 128, 160, 192, 224, 134, 166, 198, 230, 141, 173, 205, 237, 150, 182, 214, 246, + 256, 288, 320, 352, 384, 416, 448, 480, 268, 300, 332, 364, 396, 428, 460, 492 +}; + +#endif /* AVCODEC_ATRAC1DATA_H */ diff --git a/include/libavcodec/atrac3data.h b/include/libavcodec/atrac3data.h new file mode 100644 index 0000000..d050c0f --- /dev/null +++ b/include/libavcodec/atrac3data.h @@ -0,0 +1,107 @@ +/* + * ATRAC3 compatible decoder data + * Copyright (c) 2006-2007 Maxim Poliakovski + * Copyright (c) 2006-2007 Benjamin Larsson + * + * 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 + */ + +/** + * @file + * ATRAC3 AKA RealAudio 8 compatible decoder data + */ + +#ifndef AVCODEC_ATRAC3DATA_H +#define AVCODEC_ATRAC3DATA_H + +#include + +/* VLC tables */ + +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, +}; + +/* selector tables */ + +static const uint8_t clc_length_tab[8] = { 0, 4, 3, 3, 4, 4, 5, 6 }; + +static const int8_t mantissa_clc_tab[4] = { 0, 1, -2, -1 }; + +static const int8_t mantissa_vlc_tab[18] = { + 0, 0, 0, 1, 0, -1, 1, 0, -1, 0, 1, 1, 1, -1, -1, 1, -1, -1 +}; + + +/* tables for the scalefactor decoding */ + +static const float inv_max_quant[8] = { + 0.0, 1.0 / 1.5, 1.0 / 2.5, 1.0 / 3.5, + 1.0 / 4.5, 1.0 / 7.5, 1.0 / 15.5, 1.0 / 31.5 +}; + +static const uint16_t subband_tab[33] = { + 0, 8, 16, 24, 32, 40, 48, 56, + 64, 80, 96, 112, 128, 144, 160, 176, + 192, 224, 256, 288, 320, 352, 384, 416, + 448, 480, 512, 576, 640, 704, 768, 896, + 1024 +}; + +/* joint stereo related tables */ +static const float matrix_coeffs[8] = { + 0.0, 2.0, 2.0, 2.0, 0.0, 0.0, 1.0, 1.0 +}; + +#endif /* AVCODEC_ATRAC3DATA_H */ diff --git a/include/libavcodec/atrac3plus.h b/include/libavcodec/atrac3plus.h new file mode 100644 index 0000000..aa949a7 --- /dev/null +++ b/include/libavcodec/atrac3plus.h @@ -0,0 +1,236 @@ +/* + * ATRAC3+ compatible decoder + * + * Copyright (c) 2010-2013 Maxim Poliakovski + * + * 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 + */ + +/** + * @file + * Global structures, constants and data for ATRAC3+ decoder. + */ + +#ifndef AVCODEC_ATRAC3PLUS_H +#define AVCODEC_ATRAC3PLUS_H + +#include + +#include "libavutil/float_dsp.h" +#include "libavutil/mem_internal.h" +#include "libavutil/tx.h" + +#include "atrac.h" +#include "avcodec.h" +#include "get_bits.h" + +/** Global unit sizes */ +#define ATRAC3P_SUBBANDS 16 ///< number of PQF subbands +#define ATRAC3P_SUBBAND_SAMPLES 128 ///< number of samples per subband +#define ATRAC3P_FRAME_SAMPLES (ATRAC3P_SUBBAND_SAMPLES * ATRAC3P_SUBBANDS) + +#define ATRAC3P_PQF_FIR_LEN 12 ///< length of the prototype FIR of the PQF + +/** Global constants */ +#define ATRAC3P_POWER_COMP_OFF 15 ///< disable power compensation + +/** ATRAC3+ channel unit types */ +enum Atrac3pChannelUnitTypes { + CH_UNIT_MONO = 0, ///< unit containing one coded channel + CH_UNIT_STEREO = 1, ///< unit containing two jointly-coded channels + CH_UNIT_EXTENSION = 2, ///< unit containing extension information + CH_UNIT_TERMINATOR = 3 ///< unit sequence terminator +}; + +/** Per-channel IPQF history */ +typedef struct Atrac3pIPQFChannelCtx { + DECLARE_ALIGNED(32, float, buf1)[ATRAC3P_PQF_FIR_LEN * 2][8]; + DECLARE_ALIGNED(32, float, buf2)[ATRAC3P_PQF_FIR_LEN * 2][8]; + int pos; +} Atrac3pIPQFChannelCtx; + +/** Amplitude envelope of a group of sine waves */ +typedef struct Atrac3pWaveEnvelope { + int has_start_point; ///< indicates start point within the GHA window + int has_stop_point; ///< indicates stop point within the GHA window + int start_pos; ///< start position expressed in n*4 samples + int stop_pos; ///< stop position expressed in n*4 samples +} Atrac3pWaveEnvelope; + +/** Parameters of a group of sine waves */ +typedef struct Atrac3pWavesData { + Atrac3pWaveEnvelope pend_env; ///< pending envelope from the previous frame + Atrac3pWaveEnvelope curr_env; ///< group envelope from the current frame + int num_wavs; ///< number of sine waves in the group + int start_index; ///< start index into global tones table for that subband +} Atrac3pWavesData; + +/** Parameters of a single sine wave */ +typedef struct Atrac3pWaveParam { + int freq_index; ///< wave frequency index + int amp_sf; ///< quantized amplitude scale factor + int amp_index; ///< quantized amplitude index + int phase_index; ///< quantized phase index +} Atrac3pWaveParam; + +/** Sound channel parameters */ +typedef struct Atrac3pChanParams { + int ch_num; + int num_coded_vals; ///< number of transmitted quant unit values + int fill_mode; + int split_point; + int table_type; ///< table type: 0 - tone?, 1- noise? + int qu_wordlen[32]; ///< array of word lengths for each quant unit + int qu_sf_idx[32]; ///< array of scale factor indexes for each quant unit + int qu_tab_idx[32]; ///< array of code table indexes for each quant unit + int16_t spectrum[2048]; ///< decoded IMDCT spectrum + uint8_t power_levs[5]; ///< power compensation levels + + /* imdct window shape history (2 frames) for overlapping. */ + uint8_t wnd_shape_hist[2][ATRAC3P_SUBBANDS]; ///< IMDCT window shape, 0=sine/1=steep + uint8_t *wnd_shape; ///< IMDCT window shape for current frame + uint8_t *wnd_shape_prev; ///< IMDCT window shape for previous frame + + /* gain control data history (2 frames) for overlapping. */ + AtracGainInfo gain_data_hist[2][ATRAC3P_SUBBANDS]; ///< gain control data for all subbands + AtracGainInfo *gain_data; ///< gain control data for next frame + AtracGainInfo *gain_data_prev; ///< gain control data for previous frame + int num_gain_subbands; ///< number of subbands with gain control data + + /* tones data history (2 frames) for overlapping. */ + Atrac3pWavesData tones_info_hist[2][ATRAC3P_SUBBANDS]; + Atrac3pWavesData *tones_info; + Atrac3pWavesData *tones_info_prev; +} Atrac3pChanParams; + +/* Per-unit sine wave parameters */ +typedef struct Atrac3pWaveSynthParams { + int tones_present; ///< 1 - tones info present + int amplitude_mode; ///< 1 - low range, 0 - high range + int num_tone_bands; ///< number of PQF bands with tones + uint8_t tone_sharing[ATRAC3P_SUBBANDS]; ///< 1 - subband-wise tone sharing flags + uint8_t tone_master[ATRAC3P_SUBBANDS]; ///< 1 - subband-wise tone channel swapping + uint8_t invert_phase[ATRAC3P_SUBBANDS]; ///< 1 - subband-wise phase inversion + int tones_index; ///< total sum of tones in this unit + Atrac3pWaveParam waves[48]; +} Atrac3pWaveSynthParams; + +/** Channel unit parameters */ +typedef struct Atrac3pChanUnitCtx { + /* channel unit variables */ + int unit_type; ///< unit type (mono/stereo) + int num_quant_units; + int num_subbands; + int used_quant_units; ///< number of quant units with coded spectrum + int num_coded_subbands; ///< number of subbands with coded spectrum + int mute_flag; ///< mute flag + int use_full_table; ///< 1 - full table list, 0 - restricted one + int noise_present; ///< 1 - global noise info present + int noise_level_index; ///< global noise level index + int noise_table_index; ///< global noise RNG table index + uint8_t swap_channels[ATRAC3P_SUBBANDS]; ///< 1 - perform subband-wise channel swapping + uint8_t negate_coeffs[ATRAC3P_SUBBANDS]; ///< 1 - subband-wise IMDCT coefficients negation + Atrac3pChanParams channels[2]; + + /* Variables related to GHA tones */ + Atrac3pWaveSynthParams wave_synth_hist[2]; ///< waves synth history for two frames + Atrac3pWaveSynthParams *waves_info; + Atrac3pWaveSynthParams *waves_info_prev; + + Atrac3pIPQFChannelCtx ipqf_ctx[2]; + DECLARE_ALIGNED(32, float, prev_buf)[2][ATRAC3P_FRAME_SAMPLES]; ///< overlapping buffer +} Atrac3pChanUnitCtx; + +/** + * Initialize VLC tables for bitstream parsing. + */ +void ff_atrac3p_init_vlcs(void); + +/** + * Decode bitstream data of a channel unit. + * + * @param[in] gb the GetBit context + * @param[in,out] ctx ptr to the channel unit context + * @param[in] num_channels number of channels to process + * @param[in] avctx ptr to the AVCodecContext + * @return result code: 0 = OK, otherwise - error code + */ +int ff_atrac3p_decode_channel_unit(GetBitContext *gb, Atrac3pChanUnitCtx *ctx, + int num_channels, AVCodecContext *avctx); + +/** + * Initialize sine waves synthesizer and ff_sine_* tables. + */ +void ff_atrac3p_init_dsp_static(void); + +/** + * Synthesize sine waves for a particular subband. + * + * @param[in] ch_unit pointer to the channel unit context + * @param[in] fdsp pointer to float DSP context + * @param[in] ch_num which channel to process + * @param[in] sb which subband to process + * @param[out] out receives processed data + */ +void ff_atrac3p_generate_tones(Atrac3pChanUnitCtx *ch_unit, AVFloatDSPContext *fdsp, + int ch_num, int sb, float *out); + +/** + * Perform power compensation aka noise dithering. + * + * @param[in] ctx ptr to the channel context + * @param[in] fdsp pointer to float DSP context + * @param[in] ch_index which channel to process + * @param[in,out] sp ptr to channel spectrum to process + * @param[in] rng_index indicates which RNG table to use + * @param[in] sb_num which subband to process + */ +void ff_atrac3p_power_compensation(Atrac3pChanUnitCtx *ctx, AVFloatDSPContext *fdsp, + int ch_index, float *sp, int rng_index, int sb_num); + +/** + * Regular IMDCT and windowing without overlapping, + * with spectrum reversal in the odd subbands. + * + * @param[in] fdsp pointer to float DSP context + * @param[in] mdct_ctx pointer to MDCT transform context + * @param[in] pIn float input + * @param[out] pOut float output + * @param[in] wind_id which MDCT window to apply + * @param[in] sb subband number + */ +void ff_atrac3p_imdct(AVFloatDSPContext *fdsp, AVTXContext *mdct_ctx, + av_tx_fn mdct_fn, float *pIn, float *pOut, + int wind_id, int sb); + +/** + * Subband synthesis filter based on the polyphase quadrature (pseudo-QMF) + * filter bank. + * + * @param[in] dct_ctx ptr to the pre-initialized IDCT context + * @param[in,out] hist ptr to the filter history + * @param[in] in input data to process + * @param[out] out receives processed data + */ +void ff_atrac3p_ipqf(AVTXContext *dct_ctx, av_tx_fn dct_fn, + Atrac3pIPQFChannelCtx *hist, const float *in, float *out); + +extern const uint16_t ff_atrac3p_qu_to_spec_pos[33]; +extern const float ff_atrac3p_sf_tab[64]; +extern const float ff_atrac3p_mant_tab[8]; + +#endif /* AVCODEC_ATRAC3PLUS_H */ diff --git a/include/libavcodec/atrac3plus_data.h b/include/libavcodec/atrac3plus_data.h new file mode 100644 index 0000000..05ae2b7 --- /dev/null +++ b/include/libavcodec/atrac3plus_data.h @@ -0,0 +1,1659 @@ +/* + * ATRAC3+ compatible decoder + * + * Copyright (c) 2010-2013 Maxim Poliakovski + * + * 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_ATRAC3PLUS_DATA_H +#define AVCODEC_ATRAC3PLUS_DATA_H + +#include +#include + +/** VLC tables for wordlen */ +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 }, +}; + +/** 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 }, +}; +/* 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_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_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, +}; + +/* 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, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 1, 1, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 6, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 2, 2, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 }, + { 5, 5, 4, 4, 3, 3, 2, 2, 1, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 5, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 1, 1, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 6, 5, 5, 5, 5, 5, 5, 5, 3, 3, 3, 3, 2, 2, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; + +/* weights for quantized scale factors + * sf_weights[i] = i / (tab_idx + 1) + * where tab_idx = [1,2] */ +static const int8_t atrac3p_sf_weights[2][32] = { + { 0, 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 }, + { 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, + 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10 } +}; + +/** Ungroup table for word length segments. + * Numbers in this table tell which coeff belongs to which segment. */ +static const uint8_t atrac3p_qu_num_to_seg[32] = { + 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, + 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9 +}; + +/** Map quant unit number to subband number */ +static const uint8_t atrac3p_qu_to_subband[32] = { + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 +}; + +/** Map subband number to number of power compensation groups */ +static const int atrac3p_subband_to_num_powgrps[16] = { + 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5 +}; + +/** 3D base shape tables. The values are grouped together as follows: + * [num_start_values = 8][num_shape_tables = 16][num_seg_coeffs = 9] + * For each of the 8 start values there are 16 different shapes each + * 9 coefficients long. */ +static const int8_t atrac3p_wl_shapes[8][16][9] = { + { { 0, 0, 0, 0, 0, 0, 0, -2, -1 }, + { 0, 0, 0, 0, 0, 0, 0, -5, -1 }, + { 0, 0, 0, -7, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, -7, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, -5, 0, 0 }, + { 0, 0, 0, 0, -5, 0, 0, 0, 0 }, + { -7, -7, 0, 0, 0, 0, 0, 0, 0 }, + { 0, -7, 0, 0, 0, 0, 0, 0, 0 }, + { -2, -2, -5, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, -2, -5, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, -2, -5, 0, 0 }, + { 0, 0, 0, -5, 0, 0, 0, 0, 0 }, + { 0, -2, -7, -2, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, -2, -5, 0, 0, 0 }, + { 0, 0, 0, -5, -5, 0, 0, 0, 0 }, + { 0, 0, 0, -5, -2, 0, 0, 0, 0 } }, + { { -1, -5, -3, -2, -1, -1, 0, 0, 0 }, + { -2, -5, -3, -3, -2, -1, -1, 0, 0 }, + { 0, -1, -1, -1, 0, 0, 0, 0, 0 }, + { -1, -3, 0, 0, 0, 0, 0, 0, 0 }, + { -1, -2, 0, 0, 0, 0, 0, 0, 0 }, + { -1, -3, -1, 0, 0, 0, 0, 1, 1 }, + { -1, -5, -3, -3, -2, -1, 0, 0, 0 }, + { -1, -1, -4, -2, -2, -1, -1, 0, 0 }, + { -1, -1, -3, -2, -3, -1, -1, -1, 0 }, + { -1, -4, -2, -3, -1, 0, 0, 0, 0 }, + { 0, -1, -2, -2, -1, -1, 0, 0, 0 }, + { 0, -2, -1, 0, 0, 0, 0, 0, 0 }, + { -1, -1, 0, 0, 0, 0, 0, 0, 0 }, + { -1, -1, -3, -2, -2, -1, -1, -1, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, -1, -3, -2, -2, -1, -1, -1, 0 }, }, + { { -1, -2, 0, 1, 1, 1, 1, 1, 1 }, + { 0, -1, 1, 1, 1, 1, 1, 1, 1 }, + { 0, -2, 1, 1, 1, 1, 1, 1, 1 }, + { 0, -2, 0, 1, 1, 1, 1, 1, 1 }, + { -1, -1, 0, 1, 1, 1, 1, 1, 1 }, + { 0, 0, -1, 0, 1, 1, 1, 1, 1 }, + { -1, -1, 1, 1, 1, 1, 1, 1, 1 }, + { 0, 0, -1, 1, 1, 1, 1, 1, 1 }, + { 0, -1, 0, 1, 1, 1, 1, 1, 1 }, + { -1, -1, -1, 1, 1, 1, 1, 1, 1 }, + { 0, 0, 0, 0, 1, 1, 1, 1, 1 }, + { 0, 0, 0, 1, 1, 1, 1, 1, 1 }, + { 0, -1, -1, 1, 1, 1, 1, 1, 1 }, + { 0, 1, 0, 1, 1, 1, 1, 1, 1 }, + { 0, -3, -2, 1, 1, 1, 1, 2, 2 }, + { -3, -5, -3, 2, 2, 2, 2, 2, 2 }, }, + { { -1, -2, 0, 2, 2, 2, 2, 2, 2 }, + { -1, -2, 0, 1, 2, 2, 2, 2, 2 }, + { 0, -2, 0, 2, 2, 2, 2, 2, 2 }, + { -1, 0, 1, 2, 2, 2, 2, 2, 2 }, + { 0, 0, 1, 2, 2, 2, 2, 2, 2 }, + { 0, -2, 0, 1, 2, 2, 2, 2, 2 }, + { 0, -1, 1, 2, 2, 2, 2, 2, 2 }, + { -1, -1, 0, 2, 2, 2, 2, 2, 2 }, + { -1, -1, 0, 1, 2, 2, 2, 2, 2 }, + { -1, -2, -1, 2, 2, 2, 2, 2, 2 }, + { 0, -1, 0, 2, 2, 2, 2, 2, 2 }, + { 1, 1, 0, 1, 2, 2, 2, 2, 2 }, + { 0, 1, 2, 2, 2, 2, 2, 2, 2 }, + { 1, 0, 0, 1, 2, 2, 2, 2, 2 }, + { 0, 0, 0, 1, 2, 2, 2, 2, 2 }, + { -1, -1, -1, 1, 2, 2, 2, 2, 2 }, }, + { { 0, 1, 2, 3, 3, 3, 3, 3, 3 }, + { 1, 1, 2, 3, 3, 3, 3, 3, 3 }, + { -1, 0, 1, 2, 3, 3, 3, 3, 3 }, + { 0, 0, 2, 3, 3, 3, 3, 3, 3 }, + { -1, 0, 1, 3, 3, 3, 3, 3, 3 }, + { 0, 0, 1, 3, 3, 3, 3, 3, 3 }, + { 1, 2, 3, 3, 3, 3, 3, 3, 3 }, + { 1, 2, 2, 3, 3, 3, 3, 3, 3 }, + { 0, 1, 1, 3, 3, 3, 3, 3, 3 }, + { 0, 0, 1, 2, 3, 3, 3, 3, 3 }, + { -1, 1, 2, 3, 3, 3, 3, 3, 3 }, + { -1, 0, 2, 3, 3, 3, 3, 3, 3 }, + { 2, 2, 3, 3, 3, 3, 3, 3, 3 }, + { 1, 1, 3, 3, 3, 3, 3, 3, 3 }, + { 0, 2, 3, 3, 3, 3, 3, 3, 3 }, + { 0, 1, 1, 2, 3, 3, 3, 3, 3 }, }, + { { 0, 1, 2, 3, 4, 4, 4, 4, 4 }, + { 1, 2, 3, 4, 4, 4, 4, 4, 4 }, + { 0, 0, 2, 3, 4, 4, 4, 4, 4 }, + { 1, 1, 2, 4, 4, 4, 4, 4, 4 }, + { 0, 1, 2, 4, 4, 4, 4, 4, 4 }, + { -1, 0, 1, 3, 4, 4, 4, 4, 4 }, + { 0, 0, 1, 3, 4, 4, 4, 4, 4 }, + { 1, 1, 2, 3, 4, 4, 4, 4, 4 }, + { 0, 1, 1, 3, 4, 4, 4, 4, 4 }, + { 2, 2, 3, 4, 4, 4, 4, 4, 4 }, + { 1, 1, 3, 4, 4, 4, 4, 4, 4 }, + { 1, 2, 2, 4, 4, 4, 4, 4, 4 }, + { -1, 0, 2, 3, 4, 4, 4, 4, 4 }, + { 0, 1, 3, 4, 4, 4, 4, 4, 4 }, + { 1, 2, 2, 3, 4, 4, 4, 4, 4 }, + { 0, 2, 3, 4, 4, 4, 4, 4, 4 }, }, + { { 1, 2, 3, 4, 5, 5, 5, 5, 5 }, + { 0, 1, 2, 3, 4, 5, 5, 5, 5 }, + { 0, 1, 2, 3, 5, 5, 5, 5, 5 }, + { 1, 1, 3, 4, 5, 5, 5, 5, 5 }, + { 1, 1, 2, 4, 5, 5, 5, 5, 5 }, + { 1, 2, 2, 4, 5, 5, 5, 5, 5 }, + { 1, 1, 2, 3, 5, 5, 5, 5, 5 }, + { 2, 2, 3, 4, 5, 5, 5, 5, 5 }, + { 0, 1, 2, 4, 5, 5, 5, 5, 5 }, + { 2, 2, 3, 5, 5, 5, 5, 5, 5 }, + { 1, 2, 3, 5, 5, 5, 5, 5, 5 }, + { 0, 1, 3, 4, 5, 5, 5, 5, 5 }, + { 1, 2, 2, 3, 5, 5, 5, 5, 5 }, + { 2, 3, 4, 5, 5, 5, 5, 5, 5 }, + { 0, 2, 3, 4, 5, 5, 5, 5, 5 }, + { 1, 1, 1, 3, 4, 5, 5, 5, 5 }, }, + { { 1, 2, 3, 4, 5, 5, 5, 6, 6 }, + { 1, 2, 3, 4, 5, 6, 6, 6, 6 }, + { 2, 3, 4, 5, 6, 6, 6, 6, 6 }, + { 1, 2, 3, 4, 6, 6, 6, 6, 6 }, + { 2, 2, 3, 4, 5, 5, 5, 6, 6 }, + { 1, 2, 3, 4, 5, 5, 6, 6, 6 }, + { 2, 2, 3, 4, 6, 6, 6, 6, 6 }, + { 2, 2, 3, 4, 5, 6, 6, 6, 6 }, + { 2, 2, 4, 5, 6, 6, 6, 6, 6 }, + { 2, 2, 3, 5, 6, 6, 6, 6, 6 }, + { 1, 2, 3, 5, 6, 6, 6, 6, 6 }, + { 2, 3, 3, 5, 6, 6, 6, 6, 6 }, + { 1, 2, 4, 5, 6, 6, 6, 6, 6 }, + { 2, 2, 3, 4, 5, 5, 6, 6, 6 }, + { 2, 3, 3, 4, 6, 6, 6, 6, 6 }, + { 1, 3, 4, 5, 6, 6, 6, 6, 6 } } +}; + +/** 2D base shape tables for scale factor coding. + * The values are grouped together as follows: + * [num_shape_tables = 64][num_seg_coeffs = 9] */ +static const int8_t atrac3p_sf_shapes[64][9] = { + { -3, -2, -1, 0, 3, 5, 6, 8, 40 }, + { -3, -2, 0, 1, 7, 9, 11, 13, 20 }, + { -1, 0, 0, 1, 6, 8, 10, 13, 41 }, + { 0, 0, 0, 2, 5, 5, 6, 8, 14 }, + { 0, 0, 0, 2, 6, 7, 8, 11, 47 }, + { 0, 0, 1, 2, 5, 7, 8, 10, 32 }, + { 0, 0, 1, 3, 8, 10, 12, 14, 47 }, + { 0, 0, 2, 4, 9, 10, 12, 14, 40 }, + { 0, 0, 3, 5, 9, 10, 12, 14, 22 }, + { 0, 1, 3, 5, 10, 14, 18, 22, 31 }, + { 0, 2, 5, 6, 10, 10, 10, 12, 46 }, + { 0, 2, 5, 7, 12, 14, 15, 18, 44 }, + { 1, 1, 4, 5, 7, 7, 8, 9, 15 }, + { 1, 2, 2, 2, 4, 5, 7, 9, 26 }, + { 1, 2, 2, 3, 6, 7, 7, 8, 47 }, + { 1, 2, 2, 3, 6, 8, 10, 13, 22 }, + { 1, 3, 4, 7, 13, 17, 21, 24, 41 }, + { 1, 4, 0, 4, 10, 12, 13, 14, 17 }, + { 2, 3, 3, 3, 6, 8, 10, 13, 48 }, + { 2, 3, 3, 4, 9, 12, 14, 17, 47 }, + { 2, 3, 3, 5, 10, 12, 14, 17, 25 }, + { 2, 3, 5, 7, 8, 9, 9, 9, 13 }, + { 2, 3, 5, 9, 16, 21, 25, 28, 33 }, + { 2, 4, 5, 8, 12, 14, 17, 19, 26 }, + { 2, 4, 6, 8, 12, 13, 13, 15, 20 }, + { 2, 4, 7, 12, 20, 26, 30, 32, 35 }, + { 3, 3, 5, 6, 12, 14, 16, 19, 34 }, + { 3, 4, 4, 5, 7, 9, 10, 11, 48 }, + { 3, 4, 5, 6, 8, 9, 10, 11, 16 }, + { 3, 5, 5, 5, 7, 9, 10, 13, 35 }, + { 3, 5, 5, 7, 10, 12, 13, 15, 49 }, + { 3, 5, 7, 7, 8, 7, 9, 12, 21 }, + { 3, 5, 7, 8, 12, 14, 15, 15, 24 }, + { 3, 5, 7, 10, 16, 21, 24, 27, 44 }, + { 3, 5, 8, 14, 21, 26, 28, 29, 42 }, + { 3, 6, 10, 13, 18, 19, 20, 22, 27 }, + { 3, 6, 11, 16, 24, 27, 28, 29, 31 }, + { 4, 5, 4, 3, 4, 6, 8, 11, 18 }, + { 4, 6, 5, 6, 9, 10, 12, 14, 20 }, + { 4, 6, 7, 6, 6, 6, 7, 8, 46 }, + { 4, 6, 7, 9, 13, 16, 18, 20, 48 }, + { 4, 6, 7, 9, 14, 17, 20, 23, 31 }, + { 4, 6, 9, 11, 14, 15, 15, 17, 21 }, + { 4, 8, 13, 20, 27, 32, 35, 36, 38 }, + { 5, 6, 6, 4, 5, 6, 7, 6, 6 }, + { 5, 7, 7, 8, 9, 9, 10, 12, 49 }, + { 5, 8, 9, 9, 10, 11, 12, 13, 42 }, + { 5, 8, 10, 12, 15, 16, 17, 19, 42 }, + { 5, 8, 12, 17, 26, 31, 32, 33, 44 }, + { 5, 9, 13, 16, 20, 22, 23, 23, 35 }, + { 6, 8, 8, 7, 6, 5, 6, 8, 15 }, + { 6, 8, 8, 8, 9, 10, 12, 16, 24 }, + { 6, 8, 8, 9, 10, 10, 11, 11, 13 }, + { 6, 8, 10, 13, 19, 21, 24, 26, 32 }, + { 6, 9, 10, 11, 13, 13, 14, 16, 49 }, + { 7, 9, 9, 10, 13, 14, 16, 19, 27 }, + { 7, 10, 12, 13, 16, 16, 17, 17, 27 }, + { 7, 10, 12, 14, 17, 19, 20, 22, 48 }, + { 8, 9, 10, 9, 10, 11, 11, 11, 19 }, + { 8, 11, 12, 12, 13, 13, 13, 13, 17 }, + { 8, 11, 13, 14, 16, 17, 19, 20, 27 }, + { 8, 12, 17, 22, 26, 28, 29, 30, 33 }, + { 10, 14, 16, 19, 21, 22, 22, 24, 28 }, + { 10, 15, 17, 18, 21, 22, 23, 25, 43 } +}; + +static const uint8_t atrac3p_ct_restricted_to_full[2][7][4] = { + { { 0, 5, 4, 1 }, + { 0, 1, 2, 3 }, + { 3, 0, 4, 2 }, + { 4, 0, 1, 2 }, + { 1, 0, 4, 3 }, + { 3, 0, 2, 1 }, + { 0, 3, 1, 2 } }, + { { 4, 0, 1, 2 }, + { 0, 3, 2, 1 }, + { 0, 1, 2, 3 }, + { 0, 1, 2, 4 }, + { 0, 1, 2, 3 }, + { 1, 4, 2, 0 }, + { 0, 1, 2, 3 } } +}; + +/** Tables for spectrum coding */ + +/* If the first entry of a subtable is negative, it means + * that another VLC is to be reused. */ +static const 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[] = { + /* 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, + /* 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, + /* 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, + /* 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, + 0x13, 0x23, 0xE3, 0xF3, 0x04, 0xF4, 0x0C, 0x1C, 0x1D, 0x2D, 0xED, 0xFD, + 0x3E, 0xDE, 0x3F, 0xDF, 0x50, 0x60, 0x70, 0x90, 0xA0, 0xB0, 0x41, 0x51, + 0x61, 0x71, 0x91, 0xA1, 0xB1, 0x42, 0x62, 0x92, 0xA2, 0xC2, 0x33, 0xC3, + 0xD3, 0x14, 0x24, 0x34, 0xD4, 0xE4, 0x05, 0x15, 0xF5, 0x06, 0x16, 0x26, + 0xE6, 0xF6, 0x07, 0x17, 0xE7, 0xF7, 0x09, 0x19, 0x29, 0xF9, 0x0A, 0x1A, + 0x2A, 0xEA, 0xFA, 0x0B, 0x1B, 0xFB, 0x2C, 0x3C, 0xDC, 0xEC, 0xFC, 0x3D, + 0x4D, 0xCD, 0xDD, 0x4E, 0x6E, 0x7E, 0xAE, 0xCE, 0x4F, 0x5F, 0x6F, 0x7F, + 0x9F, 0xAF, 0xBF, 0xCF, 0x52, 0x72, 0xB2, 0x43, 0x53, 0x63, 0x73, 0x93, + 0xA3, 0xB3, 0x44, 0x64, 0x74, 0x94, 0xA4, 0xB4, 0xC4, 0x25, 0x35, 0xA5, + 0xC5, 0xD5, 0xE5, 0x36, 0x46, 0xB6, 0xC6, 0xD6, 0x27, 0x37, 0x47, 0xB7, + 0xC7, 0xD7, 0x39, 0x49, 0x59, 0xC9, 0xD9, 0xE9, 0x3A, 0x4A, 0x5A, 0xCA, + 0xDA, 0x2B, 0x3B, 0x4B, 0x6B, 0x7B, 0xDB, 0xEB, 0x4C, 0x5C, 0x6C, 0x7C, + 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, + /* 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, + /* 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, + /* 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, + /* 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, + 0x22, 0x52, 0xE2, 0x13, 0xF3, 0x04, 0x15, 0xF5, 0x1B, 0xEB, 0xFB, 0x0C, + 0x1D, 0xFD, 0x2E, 0x5E, 0xEE, 0x3F, 0x5F, 0xBF, 0xDF, 0x41, 0x32, 0x42, + 0xB2, 0xD2, 0x23, 0x53, 0xB3, 0xE3, 0x14, 0x24, 0xE4, 0xF4, 0x25, 0x35, + 0xD5, 0xE5, 0x2B, 0x3B, 0xDB, 0x1C, 0x2C, 0xBC, 0xEC, 0xFC, 0x2D, 0xBD, + 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, + /* 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, + 0xDF, 0x40, 0x60, 0x70, 0x90, 0xA0, 0xC0, 0x41, 0xC1, 0x32, 0x42, 0xC2, + 0xD2, 0x23, 0x33, 0xD3, 0xE3, 0x04, 0x14, 0x24, 0xE4, 0xF4, 0x06, 0x16, + 0xF6, 0x07, 0x09, 0x0A, 0x1A, 0xFA, 0x0C, 0x1C, 0x2C, 0xEC, 0xFC, 0x2D, + 0x3D, 0xDD, 0xED, 0x3E, 0x4E, 0xCE, 0xDE, 0x4F, 0xCF, 0x50, 0xB0, 0x51, + 0x61, 0x71, 0x91, 0xA1, 0xB1, 0x52, 0x62, 0x72, 0x92, 0xA2, 0xB2, 0x43, + 0x53, 0x63, 0x73, 0x93, 0xA3, 0xC3, 0x34, 0x44, 0x64, 0xA4, 0xC4, 0xD4, + 0x05, 0x15, 0x25, 0x35, 0xD5, 0xE5, 0xF5, 0x26, 0x36, 0x46, 0xC6, 0xD6, + 0xE6, 0x17, 0x27, 0x37, 0xC7, 0xD7, 0xE7, 0xF7, 0x19, 0x29, 0x39, 0xC9, + 0xD9, 0xE9, 0xF9, 0x2A, 0x3A, 0x4A, 0x5A, 0xCA, 0xDA, 0xEA, 0x0B, 0x1B, + 0x2B, 0x3B, 0xCB, 0xDB, 0xEB, 0xFB, 0x3C, 0x4C, 0x6C, 0x7C, 0x9C, 0xAC, + 0xBC, 0xCC, 0xDC, 0x4D, 0x5D, 0x6D, 0x7D, 0x9D, 0xAD, 0xBD, 0xCD, 0x5E, + 0x6E, 0x7E, 0x9E, 0xAE, 0xBE, 0x5F, 0x6F, 0x7F, 0x9F, 0xAF, 0xBF, 0xB3, + 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, + /* 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, + 0x2D, 0x1E, 0x2E, 0x50, 0x60, 0xD0, 0xE0, 0xF0, 0x71, 0x81, 0xF1, 0x62, + 0x72, 0xE2, 0xF2, 0x53, 0x63, 0xE3, 0xF3, 0x44, 0x54, 0xD4, 0xE4, 0xF4, + 0x35, 0x45, 0x55, 0xD5, 0xE5, 0xF5, 0x06, 0x26, 0x36, 0xD6, 0x07, 0x17, + 0x27, 0x37, 0xD7, 0x18, 0x28, 0x1C, 0x0D, 0x3D, 0x4D, 0x5D, 0x6D, 0x8D, + 0x0E, 0x3E, 0x4E, 0x5E, 0x0F, 0x1F, 0x2F, 0x3F, 0x5F, 0x70, 0x80, 0x90, + 0xC0, 0x91, 0xA1, 0xB1, 0xC1, 0x82, 0x92, 0xA2, 0xC2, 0x73, 0x83, 0x93, + 0xA3, 0xC3, 0x64, 0x74, 0x84, 0x94, 0xA4, 0xC4, 0x65, 0x75, 0x85, 0x46, + 0x56, 0x66, 0xC6, 0xE6, 0xF6, 0x47, 0x57, 0xE7, 0xF7, 0x08, 0x38, 0x48, + 0x58, 0x68, 0xD8, 0xE8, 0xF8, 0x09, 0x19, 0x29, 0x39, 0x59, 0xD9, 0xE9, + 0xF9, 0x1A, 0x2A, 0x3A, 0xDA, 0xEA, 0xFA, 0x1B, 0x2B, 0xDB, 0xEB, 0xFB, + 0x0C, 0x2C, 0x3C, 0xDC, 0xEC, 0x7D, 0x9D, 0xAD, 0xBD, 0xCD, 0x6E, 0x7E, + 0x8E, 0x9E, 0xAE, 0xBE, 0xCE, 0x4F, 0x6F, 0x7F, 0x8F, 0xAF, 0xA0, 0xB2, + 0xB3, 0xB4, 0x95, 0xA5, 0xB5, 0xC5, 0x76, 0x86, 0x96, 0xA6, 0xB6, 0x67, + 0x77, 0x87, 0x97, 0xC7, 0x78, 0x88, 0x98, 0xC8, 0x49, 0x69, 0x79, 0x89, + 0x99, 0xC9, 0x0A, 0x4A, 0x5A, 0x6A, 0x7A, 0xCA, 0x0B, 0x3B, 0x4B, 0x5B, + 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, + /* 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, + /* 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, + /* 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, + /* 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, + 0x71, 0x81, 0xD1, 0x62, 0x72, 0x82, 0xD2, 0x63, 0x73, 0xD3, 0x54, 0x64, + 0x05, 0x45, 0x55, 0x65, 0x06, 0x36, 0x46, 0x56, 0x17, 0x27, 0x37, 0x47, + 0x18, 0x28, 0x38, 0x19, 0x1D, 0x2D, 0x3D, 0x1E, 0x70, 0x80, 0x90, 0xD0, + 0xE0, 0x91, 0xA1, 0xB1, 0xC1, 0xE1, 0xF1, 0x92, 0xA2, 0xC2, 0xE2, 0xF2, + 0x83, 0x93, 0xA3, 0xC3, 0xE3, 0xF3, 0x74, 0x84, 0x94, 0xA4, 0xC4, 0xD4, + 0xE4, 0xF4, 0x75, 0x85, 0x95, 0xD5, 0xE5, 0x66, 0x76, 0x86, 0xD6, 0xE6, + 0x07, 0x57, 0x67, 0x77, 0xD7, 0x08, 0x48, 0x58, 0x68, 0xD8, 0x09, 0x29, + 0x39, 0x49, 0x59, 0x69, 0x1A, 0x2A, 0x3A, 0x4A, 0x1B, 0x2B, 0x1C, 0x2C, + 0x3C, 0x4C, 0x0D, 0x4D, 0x5D, 0x6D, 0x7D, 0x8D, 0x0E, 0x2E, 0x3E, 0x4E, + 0x5E, 0x6E, 0x1F, 0x2F, 0x3F, 0x4F, 0x5F, 0xA0, 0xB0, 0xC0, 0xF0, 0xB2, + 0xB3, 0xB4, 0xA5, 0xB5, 0xC5, 0xF5, 0x96, 0xA6, 0xB6, 0xC6, 0xF6, 0x87, + 0x97, 0xA7, 0xB7, 0xC7, 0xE7, 0xF7, 0x78, 0x88, 0x98, 0xA8, 0xC8, 0xE8, + 0xF8, 0x79, 0x89, 0x99, 0xC9, 0xD9, 0xE9, 0xF9, 0x0A, 0x5A, 0x6A, 0x7A, + 0x8A, 0xDA, 0xEA, 0xFA, 0x0B, 0x3B, 0x4B, 0x5B, 0x6B, 0x7B, 0x8B, 0xDB, + 0x0C, 0x5C, 0x6C, 0x7C, 0x8C, 0x9C, 0xDC, 0x9D, 0xAD, 0xBD, 0xCD, 0x7E, + 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, + /* 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, + /* 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, + 0x48, 0x58, 0x68, 0x81, 0x91, 0x61, 0x85, 0x25, 0x65, 0xA5, 0x09, 0x49, + 0x59, 0x29, 0x42, 0x12, 0x56, 0x96, 0xA6, 0x0A, 0x17, 0x1B, 0xD0, 0xC4, + 0x74, 0xF4, 0x88, 0xC8, 0x28, 0xA1, 0x71, 0xC5, 0xD5, 0x75, 0x99, 0xB9, + 0x4D, 0x1D, 0x2D, 0x6D, 0x22, 0x62, 0x66, 0x4A, 0x1A, 0x9A, 0x6A, 0x8E, + 0x5E, 0x43, 0x23, 0x07, 0x47, 0x57, 0x6B, 0xC0, 0xA0, 0xE0, 0x70, 0xB0, + 0xA4, 0xE4, 0x34, 0xB4, 0x98, 0xD8, 0xA8, 0x38, 0x78, 0x0C, 0x4C, 0x1C, + 0x5C, 0x9C, 0x6C, 0x7C, 0xC1, 0xD1, 0xE1, 0x31, 0xE5, 0x35, 0xB5, 0xF5, + 0x89, 0xA9, 0x79, 0xF9, 0x0D, 0xCD, 0x9D, 0xDD, 0xAD, 0x3D, 0x7D, 0x82, + 0xC2, 0x92, 0xD2, 0xE2, 0x72, 0xF2, 0x86, 0xD6, 0xE6, 0x76, 0xB6, 0x8A, + 0x5A, 0xDA, 0xEA, 0xFA, 0x4E, 0x1E, 0x9E, 0xEE, 0x03, 0x13, 0x53, 0x97, + 0xB7, 0x0B, 0x4B, 0x8B, 0x5B, 0x9B, 0xEB, 0x7B, 0x0F, 0x4F, 0x1F, 0x5F, + 0x9F, 0x2F, 0x3F, 0xBF, 0xE8, 0xB8, 0xF8, 0x8C, 0x2C, 0x3C, 0xFC, 0xB1, + 0xC9, 0xD9, 0xE9, 0x39, 0x5D, 0xED, 0xBD, 0xA2, 0x32, 0x26, 0x36, 0x2A, + 0xAA, 0xBA, 0x0E, 0x2E, 0x6E, 0x83, 0xC3, 0x93, 0x63, 0xB3, 0xA7, 0x37, + 0x30, 0xF0, 0xCC, 0xDC, 0xAC, 0xEC, 0xBC, 0xF1, 0x8D, 0xFD, 0xB2, 0xC6, + 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, + /* 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, + 0x2D, 0x3D, 0x3F, 0xDF, 0x50, 0x60, 0x70, 0x90, 0xB0, 0x31, 0x41, 0x91, + 0xA1, 0xC1, 0xD1, 0x42, 0xA2, 0xC2, 0x23, 0x33, 0xE3, 0x24, 0x34, 0xB4, + 0xD4, 0xF4, 0x05, 0x15, 0x45, 0xE5, 0x16, 0x36, 0x56, 0xA6, 0xC6, 0xD6, + 0xF6, 0x57, 0xC7, 0xF7, 0x09, 0x29, 0x49, 0x59, 0x69, 0xF9, 0x0A, 0x2A, + 0x3A, 0x4A, 0xDA, 0xEA, 0xFA, 0x0B, 0x2B, 0xAB, 0xEB, 0xFB, 0x0C, 0x1C, + 0x2C, 0x3C, 0x4C, 0x5C, 0xCC, 0xDC, 0xFC, 0x1D, 0x4D, 0x6D, 0xBD, 0xCD, + 0xED, 0xFD, 0x4E, 0x6E, 0xCE, 0xDE, 0x7F, 0xA0, 0xC0, 0x51, 0x61, 0x71, + 0xB1, 0x32, 0x52, 0x62, 0x72, 0x92, 0xB2, 0x53, 0x63, 0x73, 0x93, 0xA3, + 0xB3, 0xC3, 0xD3, 0x14, 0x44, 0x54, 0x64, 0x74, 0x94, 0xA4, 0xC4, 0xE4, + 0x25, 0x35, 0x55, 0x65, 0x75, 0x95, 0xA5, 0xB5, 0xC5, 0xD5, 0xF5, 0x06, + 0x26, 0x46, 0x66, 0x76, 0x96, 0xB6, 0xE6, 0x07, 0x17, 0x27, 0x37, 0x47, + 0x67, 0x77, 0x97, 0xA7, 0xB7, 0xD7, 0xE7, 0x19, 0x39, 0x79, 0x99, 0xA9, + 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, + /* 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, + 0x63, 0xD3, 0x44, 0x54, 0x64, 0x05, 0x35, 0x45, 0x55, 0x16, 0x26, 0x36, + 0x46, 0x17, 0x27, 0x1D, 0x2D, 0x3D, 0x60, 0x70, 0xD0, 0x81, 0x91, 0xA1, + 0xC1, 0xE1, 0xF1, 0x82, 0x92, 0xC2, 0xE2, 0xF2, 0x73, 0x83, 0xE3, 0xF3, + 0x74, 0x84, 0xC4, 0xD4, 0xE4, 0xF4, 0x65, 0x75, 0x85, 0xD5, 0xE5, 0x06, + 0x56, 0x66, 0xD6, 0xE6, 0x07, 0x37, 0x47, 0x57, 0x67, 0xD7, 0xE7, 0x18, + 0x28, 0x38, 0x48, 0x58, 0xD8, 0x19, 0x29, 0x2A, 0x1C, 0x2C, 0x0D, 0x4D, + 0x5D, 0x6D, 0x7D, 0x8D, 0x9D, 0x1E, 0x2E, 0x3E, 0x4E, 0x5E, 0x6E, 0x7E, + 0x1F, 0x2F, 0x3F, 0x80, 0x90, 0xA0, 0xC0, 0xE0, 0xF0, 0xB1, 0xA2, 0xB2, + 0x93, 0xA3, 0xB3, 0xC3, 0x94, 0xA4, 0xB4, 0x95, 0xA5, 0xB5, 0xC5, 0xF5, + 0x76, 0x86, 0x96, 0xA6, 0xC6, 0xF6, 0x77, 0x87, 0x97, 0xA7, 0xC7, 0xF7, + 0x08, 0x68, 0x78, 0x88, 0x98, 0xC8, 0xE8, 0xF8, 0x09, 0x39, 0x49, 0x59, + 0x69, 0x79, 0x89, 0xD9, 0xE9, 0xF9, 0x0A, 0x1A, 0x3A, 0x4A, 0x5A, 0x6A, + 0xDA, 0xEA, 0xFA, 0x1B, 0x2B, 0x3B, 0x4B, 0x5B, 0xDB, 0xEB, 0xFB, 0x0C, + 0x3C, 0x4C, 0x5C, 0x6C, 0x7C, 0x8C, 0x9C, 0xDC, 0xEC, 0xAD, 0xBD, 0xCD, + 0xDD, 0xED, 0x0E, 0x8E, 0x9E, 0xAE, 0xBE, 0x0F, 0x4F, 0x5F, 0x6F, 0x7F, + 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, + /* 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, + /* 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, + /* 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, + 0x3F, 0xDF, 0x40, 0xB0, 0xC0, 0x31, 0x41, 0x51, 0xB1, 0xC1, 0x32, 0xB2, + 0xC2, 0xD2, 0x23, 0xB3, 0xD3, 0xE3, 0x04, 0x14, 0xE4, 0xF4, 0x05, 0x15, + 0xD5, 0xE5, 0xF5, 0x0B, 0x1B, 0x2B, 0x3B, 0xEB, 0xFB, 0x0C, 0x1C, 0x2C, + 0xFC, 0x3D, 0x5D, 0xED, 0x3E, 0x4E, 0x5E, 0xBE, 0xDE, 0x4F, 0x5F, 0xBF, + 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, + /* 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, + 0x05, 0x15, 0x25, 0x35, 0x55, 0x65, 0x06, 0x46, 0x56, 0x57, 0x67, 0x88, + 0x20, 0x51, 0x91, 0xD1, 0xF2, 0x23, 0x83, 0x93, 0x04, 0x44, 0x84, 0x94, + 0x75, 0x85, 0xC5, 0x36, 0x66, 0x96, 0xB6, 0x07, 0x37, 0x97, 0x08, 0x28, + 0x38, 0x48, 0x68, 0x09, 0x69, 0x79, 0x0A, 0x2A, 0x1B, 0x9B, 0x2C, 0x4D, + 0x50, 0x60, 0x70, 0x80, 0x90, 0xA0, 0xC0, 0xD0, 0xE0, 0xF0, 0x71, 0xA1, + 0xB1, 0xC1, 0xE1, 0xF1, 0x82, 0xA2, 0xB2, 0xC2, 0xD2, 0xE2, 0x73, 0xA3, + 0xB3, 0xC3, 0xD3, 0xE3, 0xF3, 0xA4, 0xB4, 0xC4, 0xD4, 0xE4, 0xF4, 0x95, + 0xA5, 0xB5, 0xD5, 0xE5, 0xF5, 0x16, 0x76, 0x86, 0xA6, 0xC6, 0xD6, 0xE6, + 0xF6, 0x17, 0x47, 0x77, 0x87, 0xA7, 0xB7, 0xC7, 0xD7, 0xE7, 0xF7, 0x18, + 0x58, 0x78, 0x98, 0xA8, 0xB8, 0xC8, 0xD8, 0xE8, 0xF8, 0x19, 0x29, 0x39, + 0x49, 0x59, 0x89, 0x99, 0xA9, 0xB9, 0xC9, 0xD9, 0xE9, 0xF9, 0x1A, 0x3A, + 0x4A, 0x5A, 0x6A, 0x7A, 0x8A, 0x9A, 0xAA, 0xBA, 0xCA, 0xDA, 0xEA, 0xFA, + 0x0B, 0x2B, 0x3B, 0x4B, 0x5B, 0x6B, 0x7B, 0x8B, 0xAB, 0xBB, 0xCB, 0xDB, + 0xEB, 0xFB, 0x0C, 0x1C, 0x3C, 0x4C, 0x5C, 0x6C, 0x7C, 0x8C, 0x9C, 0xAC, + 0xBC, 0xCC, 0xDC, 0xEC, 0xFC, 0x0D, 0x1D, 0x2D, 0x3D, 0x5D, 0x6D, 0x7D, + 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, + /* 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, + /* 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, + 0x2D, 0xFD, 0x1E, 0x3E, 0x5E, 0xEF, 0xC0, 0x52, 0xB2, 0xD2, 0x43, 0xC3, + 0xD3, 0x24, 0x45, 0xF5, 0x4B, 0x5B, 0xFB, 0x1C, 0x3D, 0xBD, 0xDD, 0xEE, + 0xBF, 0xCF, 0xDF, 0x50, 0xB0, 0x31, 0x41, 0x51, 0xB1, 0x32, 0x42, 0xE2, + 0x13, 0x23, 0x53, 0xB3, 0x04, 0x14, 0x34, 0x44, 0x54, 0xB4, 0xC4, 0xD4, + 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, + /* 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, + /* 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, + /* 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, + 0x58, 0x81, 0x91, 0x85, 0x65, 0x09, 0x49, 0x19, 0x59, 0x99, 0x29, 0x69, + 0x79, 0x5D, 0x12, 0x62, 0x06, 0x46, 0x86, 0x66, 0x1A, 0x5A, 0x6A, 0x47, + 0x17, 0xC0, 0xA0, 0xE0, 0xC4, 0xD4, 0x74, 0x08, 0x78, 0x0C, 0x4C, 0x1C, + 0x5C, 0xD1, 0x21, 0xE1, 0x71, 0xC5, 0xE5, 0x75, 0xB5, 0x89, 0xBD, 0x92, + 0x22, 0x96, 0xA6, 0x36, 0x0A, 0x4A, 0x8A, 0x9A, 0x2A, 0x7A, 0xDE, 0x6E, + 0x43, 0x13, 0x53, 0x23, 0x07, 0x77, 0x4B, 0x1B, 0x9B, 0x6B, 0x2F, 0xD0, + 0x30, 0x70, 0xE4, 0x34, 0xF4, 0xC8, 0x98, 0x28, 0x68, 0xA8, 0xE8, 0x38, + 0xB8, 0xF8, 0x9C, 0x2C, 0x6C, 0x7C, 0xA1, 0xB1, 0xD5, 0x35, 0xC9, 0xD9, + 0xA9, 0xE9, 0x39, 0xB9, 0xF9, 0xCD, 0x1D, 0x2D, 0xAD, 0x7D, 0xC2, 0xD2, + 0xA2, 0xB2, 0xF2, 0xC6, 0x26, 0x76, 0xB6, 0xDA, 0xAA, 0xEA, 0x3A, 0xFA, + 0x0E, 0x4E, 0x2E, 0x7E, 0xBE, 0xFE, 0x03, 0x83, 0x63, 0xA3, 0xB3, 0x87, + 0x57, 0x97, 0xD7, 0x27, 0x0B, 0x8B, 0x5B, 0x2B, 0xAB, 0xCF, 0x1F, 0x9F, + 0x7F, 0xBF, 0xB0, 0xF0, 0xB4, 0x88, 0xD8, 0x8C, 0xCC, 0xDC, 0xAC, 0xEC, + 0x3C, 0xBC, 0xFC, 0xC1, 0x31, 0xF1, 0xF5, 0x0D, 0x4D, 0x8D, 0x9D, 0xDD, + 0x6D, 0xED, 0x3D, 0xFD, 0x82, 0xE2, 0x32, 0x72, 0xD6, 0xE6, 0xF6, 0xCA, + 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, + /* 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, + 0xF3, 0xE4, 0x05, 0xF5, 0x2B, 0x0C, 0xFC, 0x1D, 0x2D, 0xBD, 0xDD, 0xFD, + 0x2E, 0x4E, 0xDE, 0xFE, 0x0F, 0x1F, 0x2F, 0x3F, 0x50, 0xB0, 0x41, 0x51, + 0xB1, 0xC1, 0x52, 0xB2, 0xC2, 0x33, 0x43, 0x53, 0xD3, 0x04, 0x14, 0x24, + 0x34, 0x44, 0x54, 0xB4, 0xC4, 0xD4, 0xF4, 0x15, 0x25, 0x35, 0x45, 0x55, + 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, + /* 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, + /* 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, + /* 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, + 0xF3, 0xF4, 0x05, 0xE5, 0xF5, 0x0B, 0x1B, 0x0C, 0x0D, 0x1D, 0x2D, 0xFD, + 0x3E, 0xEE, 0x3F, 0x5F, 0xDF, 0x40, 0x41, 0x51, 0xC1, 0x32, 0x42, 0x52, + 0xB2, 0xC2, 0x23, 0x33, 0xB3, 0xC3, 0xD3, 0x04, 0x14, 0x24, 0xD4, 0xE4, + 0x15, 0x25, 0xC5, 0xD5, 0x2B, 0x3B, 0xEB, 0xFB, 0x1C, 0x2C, 0x3C, 0x5C, + 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, + /* 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, + 0x72, 0xD2, 0x43, 0x53, 0x63, 0xD3, 0x34, 0x44, 0x54, 0x05, 0x25, 0x35, + 0x45, 0x06, 0x26, 0x36, 0x17, 0x27, 0x18, 0x0D, 0x1D, 0x2D, 0x3D, 0x1E, + 0x2E, 0x1F, 0x70, 0x80, 0xE0, 0xF0, 0x91, 0xA1, 0xC1, 0x82, 0x92, 0xC2, + 0xE2, 0xF2, 0x73, 0x83, 0x93, 0xE3, 0xF3, 0x64, 0x74, 0x84, 0xD4, 0xE4, + 0xF4, 0x55, 0x65, 0xD5, 0xE5, 0xF5, 0x46, 0x56, 0x66, 0xD6, 0x07, 0x37, + 0x47, 0x57, 0x08, 0x28, 0x38, 0x48, 0x19, 0x29, 0x39, 0x1A, 0x2A, 0x1B, + 0x1C, 0x2C, 0x3C, 0x4D, 0x5D, 0x6D, 0x0E, 0x3E, 0x4E, 0x5E, 0x0F, 0x2F, + 0x3F, 0x4F, 0x90, 0xA0, 0xB0, 0xC0, 0xB1, 0xA2, 0xB2, 0xA3, 0xB3, 0xC3, + 0x94, 0xA4, 0xB4, 0xC4, 0x75, 0x85, 0x95, 0xA5, 0xC5, 0x76, 0x86, 0x96, + 0xE6, 0xF6, 0x67, 0x77, 0x87, 0xD7, 0xE7, 0xF7, 0x58, 0x68, 0x78, 0x88, + 0xD8, 0xE8, 0xF8, 0x09, 0x49, 0x59, 0x69, 0xD9, 0xE9, 0xF9, 0x0A, 0x3A, + 0x4A, 0x5A, 0xDA, 0xEA, 0x0B, 0x2B, 0x3B, 0x4B, 0xDB, 0x0C, 0x4C, 0x5C, + 0x6C, 0xDC, 0x7D, 0x8D, 0x9D, 0xAD, 0xBD, 0xCD, 0x6E, 0x7E, 0x8E, 0x9E, + 0xAE, 0xBE, 0x5F, 0x6F, 0x7F, 0x8F, 0x9F, 0xAF, 0xB5, 0xA6, 0xB6, 0xC6, + 0x97, 0xA7, 0xC7, 0x98, 0xA8, 0xB8, 0xC8, 0x79, 0x89, 0x99, 0xA9, 0xB9, + 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, + /* 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, + /* 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, + /* 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, + /* 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, + 0xF3, 0xF4, 0x05, 0xE5, 0xF5, 0x0B, 0x1B, 0x0C, 0x0D, 0x1D, 0x2D, 0xFD, + 0x3E, 0xEE, 0x3F, 0x5F, 0xDF, 0x40, 0x41, 0x51, 0xC1, 0x32, 0x42, 0x52, + 0xB2, 0xC2, 0x23, 0x33, 0xB3, 0xC3, 0xD3, 0x04, 0x14, 0x24, 0xD4, 0xE4, + 0x15, 0x25, 0xC5, 0xD5, 0x2B, 0x3B, 0xEB, 0xFB, 0x1C, 0x2C, 0x3C, 0x5C, + 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, + /* 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, + 0xE2, 0x13, 0x23, 0xE3, 0xF3, 0x04, 0x06, 0x07, 0x09, 0x0A, 0x0C, 0x1D, + 0x2D, 0xFD, 0x2E, 0x3E, 0xEE, 0x3F, 0xDF, 0x50, 0xB0, 0x41, 0x51, 0x61, + 0x71, 0x91, 0xA1, 0xB1, 0xC1, 0x42, 0x62, 0x72, 0x92, 0xA2, 0xC2, 0x33, + 0x93, 0xA3, 0xD3, 0x14, 0x24, 0xE4, 0xF4, 0x05, 0x15, 0xF5, 0x16, 0x26, + 0xD6, 0xE6, 0xF6, 0x17, 0x27, 0xD7, 0xE7, 0xF7, 0x19, 0x29, 0x39, 0xE9, + 0xF9, 0x1A, 0x2A, 0xEA, 0xFA, 0x0B, 0x1B, 0xFB, 0x1C, 0x2C, 0xEC, 0xFC, + 0x3D, 0x7D, 0x9D, 0xDD, 0xED, 0x4E, 0x6E, 0x7E, 0x9E, 0xAE, 0xCE, 0xDE, + 0x4F, 0x5F, 0x6F, 0x7F, 0x9F, 0xAF, 0xBF, 0xCF, 0x52, 0xB2, 0x43, 0x53, + 0x63, 0x73, 0xB3, 0xC3, 0x34, 0x44, 0x64, 0x74, 0x94, 0xA4, 0xB4, 0xC4, + 0xD4, 0x25, 0x35, 0x65, 0x75, 0x95, 0xA5, 0xD5, 0xE5, 0x36, 0x46, 0x56, + 0x66, 0xA6, 0xB6, 0xC6, 0x37, 0x47, 0x57, 0xB7, 0xC7, 0x49, 0x59, 0x69, + 0xB9, 0xC9, 0xD9, 0x3A, 0x4A, 0x5A, 0x6A, 0xAA, 0xBA, 0xCA, 0xDA, 0x2B, + 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, + /* 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, + /* 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, + 0x22, 0x52, 0xE2, 0x13, 0xF3, 0x04, 0x15, 0xF5, 0x1B, 0xEB, 0xFB, 0x0C, + 0x1D, 0xFD, 0x2E, 0x5E, 0xEE, 0x3F, 0x5F, 0xBF, 0xDF, 0x41, 0x32, 0x42, + 0xB2, 0xD2, 0x23, 0x53, 0xB3, 0xE3, 0x14, 0x24, 0xE4, 0xF4, 0x25, 0x35, + 0xD5, 0xE5, 0x2B, 0x3B, 0xDB, 0x1C, 0x2C, 0xBC, 0xEC, 0xFC, 0x2D, 0xBD, + 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, + /* 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, + 0xE1, 0x62, 0x72, 0x82, 0xD2, 0x53, 0x63, 0x73, 0xD3, 0x44, 0x54, 0x05, + 0x35, 0x45, 0x55, 0x06, 0x26, 0x36, 0x07, 0x17, 0x27, 0x37, 0x18, 0x28, + 0x19, 0x1D, 0x2D, 0x3D, 0x1E, 0x2E, 0x1F, 0x80, 0x90, 0xD0, 0xE0, 0xF0, + 0x91, 0xA1, 0xB1, 0xC1, 0xF1, 0x92, 0xA2, 0xB2, 0xC2, 0xE2, 0xF2, 0x83, + 0x93, 0xA3, 0xC3, 0xE3, 0xF3, 0x64, 0x74, 0x84, 0x94, 0xD4, 0xE4, 0xF4, + 0x65, 0x75, 0x85, 0xD5, 0xE5, 0x46, 0x56, 0x66, 0x76, 0xD6, 0xE6, 0x47, + 0x57, 0x67, 0xD7, 0x08, 0x38, 0x48, 0x58, 0x09, 0x29, 0x39, 0x49, 0x0A, + 0x1A, 0x2A, 0x3A, 0x1B, 0x2B, 0x0C, 0x1C, 0x2C, 0x3C, 0x0D, 0x4D, 0x5D, + 0x6D, 0x7D, 0x0E, 0x3E, 0x4E, 0x5E, 0x6E, 0x0F, 0x2F, 0x3F, 0x4F, 0xA0, + 0xB0, 0xC0, 0xB3, 0xA4, 0xB4, 0xC4, 0x95, 0xA5, 0xB5, 0xC5, 0xF5, 0x86, + 0x96, 0xA6, 0xB6, 0xC6, 0xF6, 0x77, 0x87, 0x97, 0xA7, 0xC7, 0xE7, 0xF7, + 0x68, 0x78, 0x88, 0x98, 0xD8, 0xE8, 0xF8, 0x59, 0x69, 0x79, 0x89, 0xD9, + 0xE9, 0xF9, 0x4A, 0x5A, 0x6A, 0x7A, 0xDA, 0xEA, 0x0B, 0x3B, 0x4B, 0x5B, + 0xDB, 0xEB, 0x4C, 0x5C, 0x6C, 0x7C, 0x8C, 0xDC, 0x8D, 0x9D, 0xAD, 0xBD, + 0xCD, 0x7E, 0x8E, 0x9E, 0xAE, 0xBE, 0x5F, 0x6F, 0x7F, 0x8F, 0x9F, 0xB7, + 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, + /* 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, + 0x44, 0x05, 0x25, 0x35, 0x06, 0x16, 0x26, 0x17, 0x18, 0x1D, 0x2D, 0x3D, + 0x1E, 0x2E, 0x60, 0x70, 0x80, 0xD0, 0xE0, 0xF0, 0x81, 0x91, 0xA1, 0xC1, + 0xF1, 0x72, 0x82, 0x92, 0xC2, 0xE2, 0xF2, 0x63, 0x73, 0xE3, 0xF3, 0x54, + 0x64, 0x74, 0xD4, 0xE4, 0xF4, 0x45, 0x55, 0x65, 0xD5, 0xE5, 0xF5, 0x36, + 0x46, 0x56, 0xD6, 0xE6, 0x07, 0x27, 0x37, 0x47, 0xD7, 0x08, 0x28, 0x38, + 0x19, 0x29, 0x1A, 0x1B, 0x1C, 0x2C, 0x0D, 0x4D, 0x5D, 0x6D, 0x7D, 0x0E, + 0x3E, 0x4E, 0x5E, 0x6E, 0x0F, 0x1F, 0x2F, 0x3F, 0x4F, 0x90, 0xA0, 0xC0, + 0xB1, 0xA2, 0xB2, 0x83, 0x93, 0xA3, 0xB3, 0xC3, 0x84, 0x94, 0xA4, 0xC4, + 0x75, 0x85, 0x95, 0xC5, 0x66, 0x76, 0x86, 0x96, 0xC6, 0xF6, 0x57, 0x67, + 0x77, 0xE7, 0xF7, 0x48, 0x58, 0x68, 0x78, 0xD8, 0xE8, 0xF8, 0x09, 0x39, + 0x49, 0x59, 0xD9, 0xE9, 0xF9, 0x0A, 0x2A, 0x3A, 0x4A, 0xDA, 0xEA, 0x0B, + 0x2B, 0x3B, 0xDB, 0xEB, 0x0C, 0x3C, 0x4C, 0x5C, 0x6C, 0xDC, 0x8D, 0x9D, + 0xAD, 0xBD, 0xCD, 0x7E, 0x8E, 0x9E, 0xAE, 0xBE, 0xCE, 0x5F, 0x6F, 0x7F, + 0x8F, 0x9F, 0xAF, 0xB0, 0xB4, 0xA5, 0xB5, 0xA6, 0xB6, 0x87, 0x97, 0xA7, + 0xB7, 0xC7, 0x88, 0x98, 0xA8, 0xC8, 0x69, 0x79, 0x89, 0x99, 0xA9, 0xC9, + 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, + /* 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, + /* 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, + 0x81, 0x91, 0x21, 0x61, 0x85, 0x25, 0x09, 0x19, 0x69, 0x02, 0x42, 0x12, + 0x06, 0x56, 0x5A, 0x57, 0xD0, 0x74, 0x68, 0x5C, 0xC1, 0xD5, 0xA5, 0xE5, + 0x75, 0xB5, 0xF5, 0x99, 0xD9, 0xA9, 0xE9, 0x79, 0xB9, 0xF9, 0x1D, 0x5D, + 0x9D, 0xDD, 0x6D, 0xAD, 0xED, 0x7D, 0xBD, 0xFD, 0x82, 0x92, 0xD2, 0x62, + 0x96, 0xD6, 0x26, 0x66, 0xA6, 0xE6, 0x76, 0xB6, 0xF6, 0x0A, 0x4A, 0x1A, + 0x9A, 0xDA, 0x2A, 0x6A, 0xAA, 0xEA, 0x7A, 0xBA, 0xFA, 0x5E, 0x9E, 0xDE, + 0x6E, 0xAE, 0xEE, 0x7E, 0xBE, 0xFE, 0x03, 0x13, 0x53, 0x17, 0x97, 0xD7, + 0x67, 0xA7, 0xE7, 0x77, 0xB7, 0xF7, 0x5B, 0x9B, 0xDB, 0x6B, 0xAB, 0xEB, + 0x7B, 0xBB, 0xFB, 0x5F, 0x9F, 0xDF, 0x6F, 0xAF, 0xEF, 0x7F, 0xBF, 0xFF, + 0xC0, 0xA0, 0xE0, 0x30, 0xC4, 0xD4, 0xE4, 0x34, 0xB4, 0xF4, 0x88, 0xC8, + 0x98, 0xD8, 0x28, 0xA8, 0xE8, 0x38, 0x78, 0xB8, 0xF8, 0x0C, 0x4C, 0x1C, + 0x9C, 0xDC, 0x6C, 0xAC, 0xEC, 0x7C, 0xBC, 0xFC, 0xD1, 0xA1, 0xE1, 0x31, + 0x71, 0xB1, 0xF1, 0xC5, 0x35, 0x89, 0xC9, 0x29, 0x39, 0x0D, 0x4D, 0x8D, + 0xCD, 0x2D, 0x3D, 0x22, 0xA2, 0xE2, 0x72, 0xB2, 0xF2, 0x86, 0xC6, 0x36, + 0x8A, 0xCA, 0x3A, 0x0E, 0x4E, 0x8E, 0xCE, 0x1E, 0x2E, 0x3E, 0x43, 0x83, + 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, + /* 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, + 0xB0, 0xC0, 0x31, 0x71, 0x91, 0xC1, 0xD1, 0x32, 0xD2, 0x13, 0xE3, 0xF3, + 0x04, 0x05, 0x06, 0x07, 0x17, 0xF7, 0x09, 0x19, 0x0A, 0x1A, 0xFA, 0x0C, + 0x1C, 0x2D, 0xED, 0xFD, 0x3E, 0x7E, 0xDE, 0x3F, 0x6F, 0x7F, 0x9F, 0xAF, + 0xCF, 0x50, 0x41, 0x51, 0x61, 0xA1, 0xB1, 0x62, 0x72, 0x92, 0xA2, 0xC2, + 0x23, 0x33, 0x63, 0x73, 0x93, 0xA3, 0xD3, 0x14, 0x24, 0x34, 0xD4, 0xE4, + 0xF4, 0x15, 0xF5, 0x16, 0x26, 0xD6, 0xE6, 0xF6, 0x27, 0x37, 0x47, 0xE7, + 0x29, 0x39, 0xC9, 0xD9, 0xE9, 0xF9, 0x2A, 0xEA, 0x0B, 0x1B, 0xFB, 0x2C, + 0x7C, 0xEC, 0xFC, 0x3D, 0x4D, 0x6D, 0x7D, 0xDD, 0x4E, 0x5E, 0x6E, 0x9E, + 0xAE, 0xCE, 0x4F, 0x5F, 0x42, 0x52, 0xB2, 0x43, 0xB3, 0xC3, 0x44, 0x64, + 0x74, 0x94, 0xA4, 0x25, 0x35, 0x65, 0x75, 0x95, 0xA5, 0xE5, 0x36, 0x46, + 0x66, 0x76, 0x96, 0xA6, 0xB6, 0xC6, 0x57, 0xA7, 0xB7, 0xC7, 0xD7, 0x59, + 0xA9, 0xB9, 0x3A, 0x4A, 0x6A, 0xCA, 0xDA, 0x2B, 0x3B, 0x6B, 0x9B, 0xAB, + 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, + /* 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, + /* 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, + /* 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, + /* 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, + /* 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, + /* 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, + 0xE2, 0x03, 0x13, 0x63, 0x04, 0x06, 0xE6, 0xE7, 0xF7, 0x09, 0x19, 0x39, + 0xFA, 0x0C, 0x1C, 0xDD, 0xED, 0xFD, 0x2E, 0x7E, 0x9E, 0x3F, 0x9F, 0x40, + 0x50, 0x60, 0xB0, 0x31, 0x41, 0x61, 0xA1, 0xB1, 0x22, 0x42, 0x72, 0xA2, + 0xB2, 0xC2, 0xD2, 0x23, 0x33, 0x73, 0xA3, 0xC3, 0xD3, 0xE3, 0xF3, 0x14, + 0x24, 0x34, 0x44, 0x74, 0xD4, 0xE4, 0x05, 0x25, 0x45, 0x65, 0x95, 0xA5, + 0x16, 0x26, 0x46, 0x76, 0xA6, 0xB6, 0xC6, 0xD6, 0xF6, 0x17, 0x27, 0x37, + 0x47, 0x67, 0xA7, 0xD7, 0x29, 0x69, 0xB9, 0xD9, 0xE9, 0xF9, 0x1A, 0x2A, + 0x3A, 0x9A, 0xCA, 0xDA, 0xEA, 0x0B, 0x1B, 0x3B, 0x6B, 0xEB, 0xFB, 0x2C, + 0x6C, 0xEC, 0xFC, 0x1D, 0x2D, 0x4D, 0x6D, 0x9D, 0xAD, 0x3E, 0x4E, 0x6E, + 0xAE, 0xCE, 0xEE, 0x4F, 0x5F, 0x6F, 0xDF, 0x51, 0x52, 0x62, 0x43, 0x93, + 0xB3, 0x54, 0x94, 0xA4, 0xF4, 0x15, 0x75, 0xB5, 0xE5, 0xF5, 0x36, 0x56, + 0x66, 0x96, 0x57, 0x77, 0x49, 0x59, 0xA9, 0xC9, 0x4A, 0x5A, 0x6A, 0x7A, + 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, + /* 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, + 0xC3, 0xD3, 0xE3, 0x04, 0x14, 0xD4, 0xF4, 0x25, 0x35, 0x16, 0x17, 0xF7, + 0xD8, 0x1C, 0x3C, 0x0D, 0x1D, 0x3D, 0x5D, 0x0E, 0x1E, 0x2E, 0x7E, 0x2F, + 0xC0, 0xF0, 0x71, 0x81, 0x91, 0xC1, 0x72, 0x82, 0x92, 0xB2, 0xC2, 0x53, + 0x63, 0x73, 0x93, 0xA3, 0xF3, 0x24, 0x44, 0x64, 0x84, 0xA4, 0xB4, 0x05, + 0x15, 0x95, 0xD5, 0x06, 0x26, 0x36, 0x46, 0x96, 0xD6, 0xE6, 0xF6, 0x07, + 0x27, 0x37, 0xD7, 0xE7, 0x08, 0x18, 0x28, 0x38, 0xE8, 0xF8, 0x09, 0x19, + 0x29, 0xE9, 0xF9, 0x0A, 0x1A, 0xCA, 0xDA, 0xEA, 0x0B, 0x1B, 0xDB, 0xEB, + 0xFB, 0x2C, 0x4C, 0x5C, 0x7C, 0x8C, 0x4D, 0x6D, 0x8D, 0x9D, 0xFD, 0x3E, + 0x5E, 0x6E, 0x8E, 0x9E, 0xEE, 0x0F, 0x1F, 0x3F, 0x4F, 0x5F, 0x6F, 0x7F, + 0xCF, 0x70, 0xA1, 0xA2, 0x83, 0xB3, 0x34, 0x74, 0xC4, 0xE4, 0x55, 0x65, + 0x85, 0xA5, 0xC5, 0xE5, 0xF5, 0x56, 0x66, 0x76, 0x86, 0xA6, 0xC6, 0x57, + 0x67, 0x77, 0x97, 0xA7, 0x48, 0x88, 0x98, 0x49, 0x59, 0x79, 0x99, 0x3A, + 0x4A, 0x8A, 0xBA, 0xFA, 0x2B, 0x7B, 0x0C, 0xAC, 0xBC, 0xCC, 0xEC, 0x7D, + 0xAD, 0xBD, 0xDD, 0x4E, 0xBE, 0xCE, 0xFE, 0x8F, 0x9F, 0xAF, 0xBF, 0xDF, + 0xEF, 0xFF, 0x90, 0xA0, 0xB0, 0xB1, 0x54, 0x94, 0x45, 0x75, 0xB5, 0xB6, + 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, + /* 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, + /* 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, + 0x75, 0xB5, 0xF5, 0x19, 0x59, 0x99, 0xD9, 0x69, 0xA9, 0xE9, 0x79, 0xB9, + 0xF9, 0x4D, 0x5D, 0x9D, 0xDD, 0x6D, 0xAD, 0xED, 0x7D, 0xBD, 0xFD, 0x02, + 0x42, 0x52, 0x06, 0x46, 0x16, 0x56, 0x96, 0xD6, 0x26, 0x66, 0xA6, 0xE6, + 0x76, 0xB6, 0xF6, 0x1A, 0x5A, 0x9A, 0xDA, 0xAA, 0xEA, 0x7A, 0xBA, 0xFA, + 0x5E, 0x9E, 0xDE, 0x6E, 0xAE, 0xEE, 0x7E, 0xBE, 0xFE, 0x07, 0x47, 0x57, + 0x97, 0xD7, 0x67, 0xA7, 0xE7, 0x77, 0xB7, 0xF7, 0x5B, 0x9B, 0xDB, 0x6B, + 0xAB, 0xEB, 0x7B, 0xBB, 0xFB, 0x5F, 0x9F, 0xDF, 0x6F, 0xAF, 0xEF, 0x7F, + 0xBF, 0xFF, 0x20, 0x60, 0x70, 0xB0, 0xF0, 0x84, 0xC4, 0xA4, 0xE4, 0x74, + 0xB4, 0xF4, 0x08, 0x88, 0x18, 0x98, 0xD8, 0x68, 0xA8, 0xE8, 0x78, 0xB8, + 0xF8, 0x1C, 0x5C, 0x9C, 0xDC, 0x6C, 0xAC, 0xEC, 0x3C, 0x7C, 0xBC, 0xFC, + 0x81, 0xD1, 0x21, 0x61, 0xE1, 0x71, 0xB1, 0xF1, 0xC5, 0x35, 0x09, 0x49, + 0x89, 0xC9, 0x29, 0x39, 0x0D, 0x8D, 0xCD, 0x1D, 0x2D, 0x3D, 0x92, 0xD2, + 0x22, 0x62, 0xA2, 0xE2, 0x72, 0xB2, 0xF2, 0x86, 0xC6, 0x36, 0x0A, 0x4A, + 0x8A, 0xCA, 0x2A, 0x3A, 0x0E, 0x4E, 0x8E, 0xCE, 0x1E, 0x2E, 0x3E, 0x13, + 0x53, 0x93, 0xD3, 0x63, 0xA3, 0xE3, 0x73, 0xB3, 0xF3, 0x87, 0xC7, 0x17, + 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, + /* 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, + 0xF3, 0x04, 0x06, 0x07, 0x09, 0x0C, 0x1D, 0xFD, 0x2E, 0xEE, 0x3F, 0xDF, + 0x50, 0xB0, 0x41, 0x61, 0x71, 0x91, 0xA1, 0xC1, 0x32, 0x62, 0x72, 0x92, + 0xA2, 0xD2, 0x23, 0xD3, 0xE3, 0x14, 0xF4, 0x05, 0x16, 0x26, 0xE6, 0xF6, + 0x17, 0x27, 0xE7, 0xF7, 0x19, 0x29, 0xF9, 0x0A, 0x1A, 0x2A, 0xFA, 0x0B, + 0x1C, 0x2C, 0xFC, 0x2D, 0x3D, 0xED, 0x3E, 0x4E, 0x7E, 0x9E, 0xDE, 0x4F, + 0x6F, 0x7F, 0x9F, 0xAF, 0xCF, 0x51, 0xB1, 0x42, 0x52, 0xB2, 0xC2, 0x33, + 0x63, 0x73, 0x93, 0xA3, 0xB3, 0xC3, 0x24, 0x34, 0x74, 0xA4, 0xD4, 0xE4, + 0x15, 0x25, 0x65, 0x95, 0xE5, 0xF5, 0x36, 0xD6, 0x37, 0x47, 0xC7, 0xD7, + 0x39, 0x59, 0xB9, 0xC9, 0xD9, 0xE9, 0x3A, 0x6A, 0xDA, 0xEA, 0x1B, 0x2B, + 0x9B, 0xAB, 0xEB, 0xFB, 0x6C, 0x7C, 0x9C, 0xAC, 0xEC, 0x4D, 0x6D, 0x7D, + 0x9D, 0xAD, 0xBD, 0xDD, 0x5E, 0x6E, 0xAE, 0xCE, 0x5F, 0x43, 0x53, 0x44, + 0x54, 0x64, 0x94, 0xB4, 0xC4, 0x35, 0x45, 0x55, 0x75, 0xA5, 0xB5, 0xC5, + 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, + /* 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. */ +typedef struct Atrac3pSpecCodeTab { + uint8_t group_size; ///< number of coefficients grouped together + 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 +} Atrac3pSpecCodeTab; + +static const Atrac3pSpecCodeTab atrac3p_spectra_tabs[112] = { + /* table set = A */ + /* code table = 0 */ + { 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 }, // 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 }, // 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 }, // 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 }, // 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 }, // 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 }, // 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 }, // 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 }, // 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 }, // 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 }, // 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 }, // 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 }, // 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 }, // 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 }, // 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 }, // 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_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_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_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[] = { + /* 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 */ diff --git a/include/libavcodec/atrac9tab.h b/include/libavcodec/atrac9tab.h new file mode 100644 index 0000000..bdd0512 --- /dev/null +++ b/include/libavcodec/atrac9tab.h @@ -0,0 +1,1376 @@ +/* + * ATRAC9 decoder + * Copyright (c) 2018 Rostislav Pehlivanov + * + * 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_ATRAC9TAB_H +#define AVCODEC_ATRAC9TAB_H + +#include + +#include "libavutil/channel_layout.h" + +enum ATRAC9BlockType { + ATRAC9_BLOCK_TYPE_SCE, /* Single channel */ + ATRAC9_BLOCK_TYPE_CPE, /* 2 coupled channels */ + ATRAC9_BLOCK_TYPE_LFE, /* Single LFE channel */ +}; + +typedef struct ATRAC9BlockConfig { + AVChannelLayout channel_layout; + enum ATRAC9BlockType type[5]; + int plane_map[5][2]; + int count; +} ATRAC9BlockConfig; + +static const ATRAC9BlockConfig at9_block_layout[] = { + { /* Mono */ + .channel_layout = AV_CHANNEL_LAYOUT_MONO, + .type = { ATRAC9_BLOCK_TYPE_SCE, }, + .count = 1, + }, + { /* Dual Mono */ + .channel_layout = AV_CHANNEL_LAYOUT_STEREO, + .type = { ATRAC9_BLOCK_TYPE_SCE, + ATRAC9_BLOCK_TYPE_SCE, }, + .plane_map = { { 0 }, { 1 }, }, + .count = 2, + }, + { /* Stereo */ + .channel_layout = AV_CHANNEL_LAYOUT_STEREO, + .type = { ATRAC9_BLOCK_TYPE_CPE, }, + .plane_map = { { 0, 1 }, }, + .count = 1, + }, + { /* 5.1 */ + .channel_layout = AV_CHANNEL_LAYOUT_5POINT1, + .type = { ATRAC9_BLOCK_TYPE_CPE, + ATRAC9_BLOCK_TYPE_SCE, + ATRAC9_BLOCK_TYPE_LFE, + ATRAC9_BLOCK_TYPE_CPE, }, + .plane_map = { { 0, 1 }, { 2 }, { 3 }, { 4, 5 }, }, + .count = 4, + }, + { /* 7.1 */ + .channel_layout = AV_CHANNEL_LAYOUT_7POINT1, + .type = { ATRAC9_BLOCK_TYPE_CPE, + ATRAC9_BLOCK_TYPE_SCE, + ATRAC9_BLOCK_TYPE_LFE, + ATRAC9_BLOCK_TYPE_CPE, + ATRAC9_BLOCK_TYPE_CPE, }, + .plane_map = { { 0, 1 }, { 2 }, { 3 }, { 4, 5 }, { 6, 7 }, }, + .count = 5, + }, + { /* Quad */ + .channel_layout = AV_CHANNEL_LAYOUT_QUAD, + .type = { ATRAC9_BLOCK_TYPE_CPE, + ATRAC9_BLOCK_TYPE_CPE, }, + .plane_map = { { 0, 1 }, { 2, 3 }, }, + .count = 2, + }, +}; + +static const uint8_t at9_tab_sri_frame_log2[] = { + 6, 6, 7, 7, 7, 8, 8, 8, 6, 6, 7, 7, 7, 8, 8, 8, +}; + +static const uint8_t at9_tab_band_q_unit_map[] = { + 0, 4, 8, 10, 12, 13, 14, 15, 16, 18, 20, 21, 22, 23, 24, 25, 26, 28, 30, +}; + +static const uint8_t at9_q_unit_to_coeff_cnt[] = { + 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 8, 8, 8, + 8, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, +}; + +static const int at9_q_unit_to_coeff_idx[] = { + 0, 2, 4, 6, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, 64, + 72, 80, 88, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240, 256 +}; + +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, +}; + +static const uint8_t at9_tab_sri_max_bands[] = { + 8, 8, 12, 12, 12, 18, 18, 18, 8, 8, 12, 12, 12, 16, 16, 16, +}; + +static const int at9_tab_samplerates[] = { + 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 44100, 48000, + 64000, 88200, 96000, 128000, 176400, 192000, +}; + +static const uint8_t at9_tab_band_ext_cnt[][6] = { + { 0, 0, 0, 4, 4, 2 }, + { 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 2, 2, 1 }, + { 0, 0, 0, 2, 2, 2 }, + { 1, 1, 1, 0, 0, 0 }, +}; + +/* B unit, C unit, Band count */ +static const uint8_t at9_tab_band_ext_group[][3] = { + { 16, 21, 0 }, + { 18, 22, 1 }, + { 20, 22, 2 }, + { 21, 22, 3 }, + { 21, 22, 3 }, + { 23, 24, 4 }, + { 23, 24, 4 }, + { 24, 24, 5 }, +}; + +static const uint8_t at9_tab_band_ext_lengths[][6][4] = { + { + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 5, 4, 3, 3 }, + { 4, 4, 3, 4 }, + { 4, 5, 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 }, + { 6, 6, 0, 0 }, + { 6, 6, 0, 0 }, + { 6, 0, 0, 0 }, + }, + { + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 4, 4, 0, 0 }, + { 4, 4, 0, 0 }, + { 4, 4, 0, 0 }, + }, + { + { 3, 0, 0, 0 }, + { 3, 0, 0, 0 }, + { 3, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + { 0, 0, 0, 0 }, + }, +}; + +static const float at9_band_ext_scales_m0[][5][32] = { + { + { + 0.000000e+0f, 1.988220e-1f, 2.514343e-1f, 2.960510e-1f, + 3.263550e-1f, 3.771362e-1f, 3.786926e-1f, 4.540405e-1f, + 4.877625e-1f, 5.262451e-1f, 5.447083e-1f, 5.737000e-1f, + 6.212158e-1f, 6.222839e-1f, 6.560974e-1f, 6.896667e-1f, + 7.555542e-1f, 7.677917e-1f, 7.918091e-1f, 7.971497e-1f, + 8.188171e-1f, 8.446045e-1f, 9.790649e-1f, 9.822083e-1f, + 9.846191e-1f, 9.859314e-1f, 9.863586e-1f, 9.863892e-1f, + 9.873352e-1f, 9.881287e-1f, 9.898682e-1f, 9.913330e-1f, + }, { + 0.000000e+0f, 9.982910e-1f, 7.592773e-2f, 7.179565e-1f, + 9.851379e-1f, 5.340271e-1f, 9.013672e-1f, 6.349182e-1f, + 7.226257e-1f, 1.948547e-1f, 7.628174e-1f, 9.873657e-1f, + 8.112183e-1f, 2.715454e-1f, 9.734192e-1f, 1.443787e-1f, + 4.640198e-1f, 3.249207e-1f, 3.790894e-1f, 8.276367e-2f, + 5.954590e-1f, 2.864380e-1f, 9.806824e-1f, 7.929077e-1f, + 6.292114e-1f, 4.887085e-1f, 2.905273e-1f, 1.301880e-1f, + 3.140869e-1f, 5.482483e-1f, 4.210815e-1f, 1.182861e-1f, + }, { + 0.000000e+0f, 3.155518e-2f, 8.581543e-2f, 1.364746e-1f, + 1.858826e-1f, 2.368469e-1f, 2.888184e-1f, 3.432617e-1f, + 4.012451e-1f, 4.623108e-1f, 5.271301e-1f, 5.954895e-1f, + 6.681213e-1f, 7.448425e-1f, 8.245239e-1f, 9.097290e-1f, + }, { + 0.000000e+0f, 4.418945e-2f, 1.303711e-1f, 2.273560e-1f, + 3.395996e-1f, 4.735718e-1f, 6.267090e-1f, 8.003845e-1f, + }, { + 0.000000e+0f, 2.804565e-2f, 9.683228e-2f, 1.849976e-1f, + 3.005981e-1f, 4.470520e-1f, 6.168518e-1f, 8.007813e-1f, + }, + }, + { + { + 0.000000e+0f, 2.708740e-1f, 3.479614e-1f, 3.578186e-1f, + 5.083618e-1f, 5.299072e-1f, 5.819092e-1f, 6.381836e-1f, + 7.276917e-1f, 7.595520e-1f, 7.878723e-1f, 9.707336e-1f, + 9.713135e-1f, 9.736023e-1f, 9.759827e-1f, 9.832458e-1f, + }, { + 0.000000e+0f, 2.330627e-1f, 5.891418e-1f, 7.170410e-1f, + 2.036438e-1f, 1.613464e-1f, 6.668701e-1f, 9.481201e-1f, + 9.769897e-1f, 5.111694e-1f, 3.522644e-1f, 8.209534e-1f, + 2.933960e-1f, 9.757690e-1f, 5.289917e-1f, 4.372253e-1f, + }, { + 0.000000e+0f, 4.360962e-2f, 1.056519e-1f, 1.590576e-1f, + 2.078857e-1f, 2.572937e-1f, 3.082581e-1f, 3.616028e-1f, + 4.191589e-1f, 4.792175e-1f, 5.438538e-1f, 6.125183e-1f, + 6.841125e-1f, 7.589417e-1f, 8.365173e-1f, 9.148254e-1f, + }, { + 0.000000e+0f, 4.074097e-2f, 1.164551e-1f, 2.077026e-1f, + 3.184509e-1f, 4.532166e-1f, 6.124268e-1f, 7.932129e-1f, + }, { + 0.000000e+0f, 8.880615e-3f, 2.932739e-2f, 5.593872e-2f, + 8.825684e-2f, 1.259155e-1f, 1.721497e-1f, 2.270813e-1f, + 2.901611e-1f, 3.579712e-1f, 4.334106e-1f, 5.147095e-1f, + 6.023254e-1f, 6.956177e-1f, 7.952881e-1f, 8.977356e-1f, + }, + }, + { + { + 0.000000e+0f, 7.379150e-2f, 1.806335e-1f, 2.687073e-1f, + 3.407898e-1f, 4.047546e-1f, 4.621887e-1f, 5.168762e-1f, + 5.703125e-1f, 6.237488e-1f, 6.763611e-1f, 7.288208e-1f, + 7.808533e-1f, 8.337708e-1f, 8.874512e-1f, 9.418030e-1f, + }, { + 0.000000e+0f, 7.980347e-2f, 1.615295e-1f, 1.665649e-1f, + 1.822205e-1f, 2.185669e-1f, 2.292175e-1f, 2.456665e-1f, + 2.666321e-1f, 3.306580e-1f, 3.330688e-1f, 3.765259e-1f, + 4.085083e-1f, 4.400024e-1f, 4.407654e-1f, 4.817505e-1f, + 4.924011e-1f, 5.320740e-1f, 5.893860e-1f, 6.131287e-1f, + 6.212463e-1f, 6.278076e-1f, 6.308899e-1f, 7.660828e-1f, + 7.850647e-1f, 7.910461e-1f, 7.929382e-1f, 8.038330e-1f, + 9.834900e-1f, 9.846191e-1f, 9.852295e-1f, 9.862671e-1f, + }, { + 0.000000e+0f, 6.084290e-1f, 3.672791e-1f, 3.151855e-1f, + 1.488953e-1f, 2.571716e-1f, 5.103455e-1f, 3.311157e-1f, + 5.426025e-2f, 4.254456e-1f, 7.998352e-1f, 7.873230e-1f, + 5.418701e-1f, 2.925110e-1f, 8.468628e-2f, 1.410522e-1f, + 9.819641e-1f, 9.609070e-1f, 3.530884e-2f, 9.729004e-2f, + 5.758362e-1f, 9.941711e-1f, 7.215576e-1f, 7.183228e-1f, + 2.028809e-1f, 9.588623e-2f, 2.032166e-1f, 1.338806e-1f, + 5.003357e-1f, 1.874390e-1f, 9.804993e-1f, 1.107788e-1f, + }, + }, +}; + +static const float at9_band_ext_scales_m2[] = { + 4.272461e-4f, 1.312256e-3f, 2.441406e-3f, 3.692627e-3f, + 4.913330e-3f, 6.134033e-3f, 7.507324e-3f, 8.972168e-3f, + 1.049805e-2f, 1.223755e-2f, 1.406860e-2f, 1.599121e-2f, + 1.800537e-2f, 2.026367e-2f, 2.264404e-2f, 2.517700e-2f, + 2.792358e-2f, 3.073120e-2f, 3.344727e-2f, 3.631592e-2f, + 3.952026e-2f, 4.275513e-2f, 4.608154e-2f, 4.968262e-2f, + 5.355835e-2f, 5.783081e-2f, 6.195068e-2f, 6.677246e-2f, + 7.196045e-2f, 7.745361e-2f, 8.319092e-2f, 8.993530e-2f, + 9.759521e-2f, 1.056213e-1f, 1.138916e-1f, 1.236267e-1f, + 1.348267e-1f, 1.470337e-1f, 1.603394e-1f, 1.755676e-1f, + 1.905823e-1f, 2.071228e-1f, 2.245178e-1f, 2.444153e-1f, + 2.658997e-1f, 2.897644e-1f, 3.146057e-1f, 3.450012e-1f, + 3.766174e-1f, 4.122620e-1f, 4.505615e-1f, 4.893799e-1f, + 5.305481e-1f, 5.731201e-1f, 6.157837e-1f, 6.580811e-1f, + 6.985168e-1f, 7.435303e-1f, 7.865906e-1f, 8.302612e-1f, + 8.718567e-1f, 9.125671e-1f, 9.575806e-1f, 9.996643e-1f, +}; + +static const float at9_band_ext_scales_m3[][2] = { + { 3.491211e-1f, -2.913818e-1f, }, { 5.371094e-1f, -2.541504e-1f, }, + { 6.782227e-1f, -1.664429e-1f, }, { 7.910156e-1f, -1.476440e-1f, }, + { 9.057617e-1f, -1.342163e-1f, }, { 1.024902e+0f, -1.220703e-1f, }, + { 1.156250e+0f, -1.117554e-1f, }, { 1.290527e+0f, -1.026611e-1f, }, + { 1.458984e+0f, -9.436035e-2f, }, { 1.664551e+0f, -8.483887e-2f, }, + { 1.929688e+0f, -7.476807e-2f, }, { 2.278320e+0f, -6.304932e-2f, }, + { 2.831543e+0f, -4.492188e-2f, }, { 3.659180e+0f, -2.447510e-2f, }, + { 5.257813e+0f, +1.831055e-4f, }, { 8.373047e+0f, +4.174805e-2f, }, +}; + +static const float at9_band_ext_scales_m4[] = { + 3.610229e-2f, 1.260681e-1f, 2.227478e-1f, 3.338318e-1f, + 4.662170e-1f, 6.221313e-1f, 7.989197e-1f, 9.939575e-1f, +}; + +static const float at9_quant_step_coarse[] = { + 2.0000000000000000e+0f, 6.6666666666666663e-1f, 2.8571428571428570e-1f, + 1.3333333333333333e-1f, 6.4516129032258063e-2f, 3.1746031746031744e-2f, + 1.5748031496062992e-2f, 7.8431372549019607e-3f, 3.9138943248532287e-3f, + 1.9550342130987292e-3f, 9.7703957010258913e-4f, 4.8840048840048840e-4f, + 2.4417043096081065e-4f, 1.2207776353537203e-4f, 6.1037018951994385e-5f, + 3.0518043793392844e-5f, +}; + +static const float at9_quant_step_fine[] = { + 3.0518043793392844e-05f, 1.0172681264464281e-05f, 4.3597205419132631e-06f, + 2.0345362528928561e-06f, 9.8445302559331759e-07f, 4.8441339354591809e-07f, + 2.4029955742829012e-07f, 1.1967860311134448e-07f, 5.9722199204291275e-08f, + 2.9831909866464167e-08f, 1.4908668194134265e-08f, 7.4525137468602791e-09f, + 3.7258019525568114e-09f, 1.8627872668859698e-09f, 9.3136520869755679e-10f, + 4.6567549848772173e-10f, +}; + +static const float at9_scalefactor_c[] = { + 3.0517578125e-5f, 6.1035156250e-5f, 1.2207031250e-4f, 2.4414062500e-4f, + 4.8828125000e-4f, 9.7656250000e-4f, 1.9531250000e-3f, 3.9062500000e-3f, + 7.8125000000e-3f, 1.5625000000e-2f, 3.1250000000e-2f, 6.2500000000e-2f, + 1.2500000000e-1f, 2.5000000000e-1f, 5.0000000000e-1f, 1.0000000000e+0f, + 2.0000000000e+0f, 4.0000000000e+0f, 8.0000000000e+0f, 1.6000000000e+1f, + 3.2000000000e+1f, 6.4000000000e+1f, 1.2800000000e+2f, 2.5600000000e+2f, + 5.1200000000e+2f, 1.0240000000e+3f, 2.0480000000e+3f, 4.0960000000e+3f, + 8.1920000000e+3f, 1.6384000000e+4f, 3.2768000000e+4f, 6.5536000000e+4f, +}; + +static const uint8_t at9_tab_sf_weights[][32] = { + { + 0, 0, 0, 1, 1, 2, 2, 2, 2, 2, 2, 3, 2, 3, 3, 4, 4, 4, + 4, 4, 4, 5, 5, 6, 6, 7, 7, 8, 10, 12, 12, 12, + }, + { + 3, 2, 2, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, + 1, 1, 1, 1, 1, 2, 3, 3, 4, 5, 7, 10, 10, 10, + }, + { + 0, 2, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 7, 7, 7, 7, 8, 9, 12, 12, 12, + }, + { + 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, + 6, 6, 6, 7, 8, 8, 10, 11, 11, 12, 13, 13, 13, 13, + }, + { + 0, 2, 2, 3, 3, 4, 4, 5, 4, 5, 5, 5, 5, 6, 7, 8, 8, 8, + 8, 9, 9, 9, 10, 10, 11, 12, 12, 13, 13, 14, 14, 14, + }, + { + 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, + 2, 3, 3, 3, 4, 4, 5, 6, 7, 7, 9, 11, 11, 11, + }, + { + 0, 5, 8, 10, 11, 11, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 13, 15, 15, 15, + }, + { + 0, 2, 3, 4, 5, 6, 6, 7, 7, 8, 8, 8, 9, 9, 10, 10, 10, 11, + 11, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 15, 15, 15, + }, +}; + +static const uint8_t at9_tab_b_dist[] = { + 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 15, 6, 18, 19, 20, 21, 22, 23, 24, 25, 26, 26, 27, + 27, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, +}; + +static const uint8_t at9_sfb_a_tab[][2] = { + /* Unsigned scalefactor table 1 - 2 entries */ + { 0, 1 }, { 1, 1 }, + /* Unsigned scalefactor table 2 - 4 entries */ + { 0, 1 }, { 3, 2 }, { 1, 3 }, { 2, 3 }, + /* Unsigned scalefactor table 3 - 8 entries */ + { 0, 2 }, { 1, 2 }, { 7, 2 }, { 6, 3 }, { 2, 4 }, { 5, 5 }, { 3, 6 }, + { 4, 6 }, + /* 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 }, + /* 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 }, + /* 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 }, + { 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 at9_sfb_b_tab[][2] = { + /* Signed scalefactor table 2 - 3 entries */ + { 16, 1 }, { 15, 2 }, { 17, 2 }, + /* Signed scalefactor table 3 - 7 entries */ + { 17, 3 }, { 18, 5 }, { 13, 6 }, { 19, 6 }, { 14, 4 }, { 15, 2 }, { 16, 1 }, + /* 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 }, + /* 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 }, + { 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 int size; + const int value_cnt; + const int value_cnt_pow; + const int value_bits; +} HuffmanCodebook; + +static const HuffmanCodebook at9_huffman_sf_unsigned[] = { + { 0 }, + { 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 }, + { 3, 1, 0, 2 }, + { 7, 1, 0, 3 }, + { 15, 1, 0, 4 }, + { 32, 1, 0, 5 }, +}; + +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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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 }, + /* 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 }, + { 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] = { + { + { { 0 } }, + { { 0 } }, + { + { 8, 2, 1, 2 }, + { 80, 4, 2, 2 }, + { 81, 4, 2, 2 }, + { 81, 4, 2, 2 }, + }, + { + { 40, 2, 1, 3 }, + { 49, 2, 1, 3 }, + { 49, 2, 1, 3 }, + { 49, 2, 1, 3 }, + }, + { + { 176, 2, 1, 4 }, + { 225, 2, 1, 4 }, + { 225, 2, 1, 4 }, + { 225, 2, 1, 4 }, + }, + { + { 31, 1, 0, 5 }, + { 31, 1, 0, 5 }, + { 31, 1, 0, 5 }, + { 31, 1, 0, 5 }, + }, + { + { 63, 1, 0, 6 }, + { 63, 1, 0, 6 }, + { 63, 1, 0, 6 }, + { 63, 1, 0, 6 }, + }, + { + { 127, 1, 0, 7 }, + { 127, 1, 0, 7 }, + { 127, 1, 0, 7 }, + { 127, 1, 0, 7 }, + }, + }, + { + { { 0 } }, + { { 0 } }, + { + { 0 }, + { 80, 4, 2, 2 }, + { 81, 4, 2, 2 }, + { 81, 4, 2, 2 }, + }, + { + { 0 }, + { 49, 2, 1, 3 }, + { 49, 2, 1, 3 }, + { 49, 2, 1, 3 }, + }, + { + { 0 }, + { 225, 2, 1, 4 }, + { 225, 2, 1, 4 }, + { 225, 2, 1, 4 }, + }, + { + { 0 }, + { 31, 1, 0, 5 }, + { 31, 1, 0, 5 }, + { 31, 1, 0, 5 }, + }, + { + { 0 }, + { 63, 1, 0, 6 }, + { 63, 1, 0, 6 }, + { 63, 1, 0, 6 }, + }, + { + { 0 }, + { 127, 1, 0, 7 }, + { 127, 1, 0, 7 }, + { 127, 1, 0, 7 }, + }, + }, +}; + +#endif /* AVCODEC_ATRAC9TAB_H */ diff --git a/include/libavcodec/atsc_a53.h b/include/libavcodec/atsc_a53.h new file mode 100644 index 0000000..0622a55 --- /dev/null +++ b/include/libavcodec/atsc_a53.h @@ -0,0 +1,56 @@ +/* + * 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_ATSC_A53_H +#define AVCODEC_ATSC_A53_H + +#include +#include + +#include "libavutil/buffer.h" +#include "libavutil/frame.h" + +/** + * Check AVFrame for A53 side data and allocate and fill SEI message with A53 info + * + * @param frame Raw frame to get A53 side data from + * @param prefix_len Number of bytes to allocate before SEI message + * @param data Pointer to a variable to store allocated memory + * Upon return the variable will hold NULL on error or if frame has no A53 info. + * Otherwise it will point to prefix_len uninitialized bytes followed by + * *sei_size SEI message + * @param sei_size Pointer to a variable to store generated SEI message length + * @return Zero on success, negative error code on failure + */ +int ff_alloc_a53_sei(const AVFrame *frame, size_t prefix_len, + void **data, size_t *sei_size); + +/** + * Parse a data array for ATSC A53 Part 4 Closed Captions and store them in an AVBufferRef. + * + * @param pbuf Pointer to an AVBufferRef to append the closed captions. *pbuf may be NULL, in + * which case a new buffer will be allocated and put in it. + * @param data The data array containing the raw A53 data. + * @param size Size of the data array in bytes. + * + * @return Number of closed captions parsed on success, negative error code on failure. + * If no Closed Captions are parsed, *pbuf is untouched. + */ +int ff_parse_a53_cc(AVBufferRef **pbuf, const uint8_t *data, int size); + +#endif /* AVCODEC_ATSC_A53_H */ diff --git a/include/libavcodec/audio_frame_queue.h b/include/libavcodec/audio_frame_queue.h new file mode 100644 index 0000000..d8076ea --- /dev/null +++ b/include/libavcodec/audio_frame_queue.h @@ -0,0 +1,83 @@ +/* + * Audio Frame Queue + * Copyright (c) 2012 Justin Ruggles + * + * 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_AUDIO_FRAME_QUEUE_H +#define AVCODEC_AUDIO_FRAME_QUEUE_H + +#include "avcodec.h" + +typedef struct AudioFrame { + int64_t pts; + int duration; +} AudioFrame; + +typedef struct AudioFrameQueue { + AVCodecContext *avctx; + int remaining_delay; + int remaining_samples; + AudioFrame *frames; + unsigned frame_count; + unsigned frame_alloc; +} AudioFrameQueue; + +/** + * Initialize AudioFrameQueue. + * + * @param avctx context to use for time_base and av_log + * @param afq queue context + */ +void ff_af_queue_init(AVCodecContext *avctx, AudioFrameQueue *afq); + +/** + * Close AudioFrameQueue. + * + * Frees memory if needed. + * + * @param afq queue context + */ +void ff_af_queue_close(AudioFrameQueue *afq); + +/** + * Add a frame to the queue. + * + * @param afq queue context + * @param f frame to add to the queue + */ +int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f); + +/** + * Remove frame(s) from the queue. + * + * Retrieves the pts of the next available frame, or a generated pts based on + * the last frame duration if there are no frames left in the queue. The number + * of requested samples should be the full number of samples represented by the + * packet that will be output by the encoder. If fewer samples are available + * in the queue, a smaller value will be used for the output duration. + * + * @param afq queue context + * @param nb_samples number of samples to remove from the queue + * @param[out] pts output packet pts + * @param[out] duration output packet duration + */ +void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts, + int64_t *duration); + +#endif /* AVCODEC_AUDIO_FRAME_QUEUE_H */ diff --git a/include/libavcodec/audiodsp.h b/include/libavcodec/audiodsp.h new file mode 100644 index 0000000..485b512 --- /dev/null +++ b/include/libavcodec/audiodsp.h @@ -0,0 +1,61 @@ +/* + * 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_AUDIODSP_H +#define AVCODEC_AUDIODSP_H + +#include + +typedef struct AudioDSPContext { + /** + * Calculate scalar product of two vectors. + * @param len length of vectors, should be multiple of 16 + */ + int32_t (*scalarproduct_int16)(const int16_t *v1, + const int16_t *v2 /* align 16 */, int len); + + /** + * Clip each element in an array of int32_t to a given minimum and + * maximum value. + * @param dst destination array + * constraints: 16-byte aligned + * @param src source array + * constraints: 16-byte aligned + * @param min minimum value + * constraints: must be in the range [-(1 << 24), 1 << 24] + * @param max maximum value + * constraints: must be in the range [-(1 << 24), 1 << 24] + * @param len number of elements in the array + * constraints: multiple of 32 greater than zero + */ + void (*vector_clip_int32)(int32_t *dst, const int32_t *src, int32_t min, + int32_t max, unsigned int len); + /* assume len is a multiple of 16, and arrays are 16-byte aligned */ + void (*vector_clipf)(float *dst /* align 16 */, + const float *src /* align 16 */, + int len /* align 16 */, + float min, float max); +} AudioDSPContext; + +void ff_audiodsp_init(AudioDSPContext *c); +void ff_audiodsp_init_arm(AudioDSPContext *c); +void ff_audiodsp_init_ppc(AudioDSPContext *c); +void ff_audiodsp_init_riscv(AudioDSPContext *c); +void ff_audiodsp_init_x86(AudioDSPContext *c); + +#endif /* AVCODEC_AUDIODSP_H */ diff --git a/include/libavcodec/av1.h b/include/libavcodec/av1.h new file mode 100644 index 0000000..94e88f8 --- /dev/null +++ b/include/libavcodec/av1.h @@ -0,0 +1,192 @@ +/* + * 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 + */ + +/** + * @file + * AV1 common definitions + */ + +#ifndef AVCODEC_AV1_H +#define AVCODEC_AV1_H + +// OBU types (section 6.2.2). +typedef enum { + // 0 reserved. + AV1_OBU_SEQUENCE_HEADER = 1, + AV1_OBU_TEMPORAL_DELIMITER = 2, + AV1_OBU_FRAME_HEADER = 3, + AV1_OBU_TILE_GROUP = 4, + AV1_OBU_METADATA = 5, + AV1_OBU_FRAME = 6, + AV1_OBU_REDUNDANT_FRAME_HEADER = 7, + AV1_OBU_TILE_LIST = 8, + // 9-14 reserved. + AV1_OBU_PADDING = 15, +} AV1_OBU_Type; + +// Metadata types (section 6.7.1). +enum { + AV1_METADATA_TYPE_HDR_CLL = 1, + AV1_METADATA_TYPE_HDR_MDCV = 2, + AV1_METADATA_TYPE_SCALABILITY = 3, + AV1_METADATA_TYPE_ITUT_T35 = 4, + AV1_METADATA_TYPE_TIMECODE = 5, +}; + +// Frame types (section 6.8.2). +enum { + AV1_FRAME_KEY = 0, + AV1_FRAME_INTER = 1, + AV1_FRAME_INTRA_ONLY = 2, + AV1_FRAME_SWITCH = 3, +}; + +// Reference frames (section 6.10.24). +enum { + AV1_REF_FRAME_NONE = -1, + AV1_REF_FRAME_INTRA = 0, + AV1_REF_FRAME_LAST = 1, + AV1_REF_FRAME_LAST2 = 2, + AV1_REF_FRAME_LAST3 = 3, + AV1_REF_FRAME_GOLDEN = 4, + AV1_REF_FRAME_BWDREF = 5, + AV1_REF_FRAME_ALTREF2 = 6, + AV1_REF_FRAME_ALTREF = 7, +}; + +// Constants (section 3). +enum { + AV1_MAX_OPERATING_POINTS = 32, + + AV1_MAX_SB_SIZE = 128, + AV1_MI_SIZE = 4, + + AV1_MAX_TILE_WIDTH = 4096, + AV1_MAX_TILE_AREA = 4096 * 2304, + AV1_MAX_TILE_ROWS = 64, + AV1_MAX_TILE_COLS = 64, + + AV1_NUM_REF_FRAMES = 8, + AV1_REFS_PER_FRAME = 7, + AV1_TOTAL_REFS_PER_FRAME = 8, + AV1_PRIMARY_REF_NONE = 7, + + AV1_MAX_SEGMENTS = 8, + AV1_SEG_LVL_MAX = 8, + + AV1_SEG_LVL_ALT_Q = 0, + AV1_SEG_LVL_ALT_LF_Y_V = 1, + AV1_SEG_LVL_REF_FRAME = 5, + AV1_SEG_LVL_SKIP = 6, + AV1_SEG_LVL_GLOBAL_MV = 7, + + AV1_SELECT_SCREEN_CONTENT_TOOLS = 2, + AV1_SELECT_INTEGER_MV = 2, + + AV1_SUPERRES_NUM = 8, + AV1_SUPERRES_DENOM_MIN = 9, + + AV1_INTERPOLATION_FILTER_SWITCHABLE = 4, + + AV1_GM_ABS_ALPHA_BITS = 12, + AV1_GM_ALPHA_PREC_BITS = 15, + AV1_GM_ABS_TRANS_ONLY_BITS = 9, + AV1_GM_TRANS_ONLY_PREC_BITS = 3, + AV1_GM_ABS_TRANS_BITS = 12, + AV1_GM_TRANS_PREC_BITS = 6, + AV1_WARPEDMODEL_PREC_BITS = 16, + + AV1_WARP_MODEL_IDENTITY = 0, + AV1_WARP_MODEL_TRANSLATION = 1, + AV1_WARP_MODEL_ROTZOOM = 2, + AV1_WARP_MODEL_AFFINE = 3, + AV1_WARP_PARAM_REDUCE_BITS = 6, + + AV1_DIV_LUT_BITS = 8, + AV1_DIV_LUT_PREC_BITS = 14, + AV1_DIV_LUT_NUM = 257, + + AV1_MAX_LOOP_FILTER = 63, +}; + + +// The main colour configuration information uses the same ISO/IEC 23001-8 +// (H.273) enums as FFmpeg does, so separate definitions are not required. + +// Chroma sample position. +enum { + AV1_CSP_UNKNOWN = 0, + AV1_CSP_VERTICAL = 1, // -> AVCHROMA_LOC_LEFT. + AV1_CSP_COLOCATED = 2, // -> AVCHROMA_LOC_TOPLEFT. +}; + +// Scalability modes (section 6.7.5) +enum { + AV1_SCALABILITY_L1T2 = 0, + AV1_SCALABILITY_L1T3 = 1, + AV1_SCALABILITY_L2T1 = 2, + AV1_SCALABILITY_L2T2 = 3, + AV1_SCALABILITY_L2T3 = 4, + AV1_SCALABILITY_S2T1 = 5, + AV1_SCALABILITY_S2T2 = 6, + AV1_SCALABILITY_S2T3 = 7, + AV1_SCALABILITY_L2T1h = 8, + AV1_SCALABILITY_L2T2h = 9, + AV1_SCALABILITY_L2T3h = 10, + AV1_SCALABILITY_S2T1h = 11, + AV1_SCALABILITY_S2T2h = 12, + AV1_SCALABILITY_S2T3h = 13, + AV1_SCALABILITY_SS = 14, + AV1_SCALABILITY_L3T1 = 15, + AV1_SCALABILITY_L3T2 = 16, + AV1_SCALABILITY_L3T3 = 17, + AV1_SCALABILITY_S3T1 = 18, + AV1_SCALABILITY_S3T2 = 19, + AV1_SCALABILITY_S3T3 = 20, + AV1_SCALABILITY_L3T2_KEY = 21, + AV1_SCALABILITY_L3T3_KEY = 22, + AV1_SCALABILITY_L4T5_KEY = 23, + AV1_SCALABILITY_L4T7_KEY = 24, + AV1_SCALABILITY_L3T2_KEY_SHIFT = 25, + AV1_SCALABILITY_L3T3_KEY_SHIFT = 26, + AV1_SCALABILITY_L4T5_KEY_SHIFT = 27, + AV1_SCALABILITY_L4T7_KEY_SHIFT = 28, +}; + +// Frame Restoration types (section 6.10.15) +enum { + AV1_RESTORE_NONE = 0, + AV1_RESTORE_WIENER = 1, + AV1_RESTORE_SGRPROJ = 2, + AV1_RESTORE_SWITCHABLE = 3, +}; + +// TX mode (section 6.8.21) +enum { + AV1_ONLY_4X4 = 0, + AV1_TX_MODE_LARGEST = 1, + AV1_TX_MODE_SELECT = 2, +}; + +// Sequence Headers are actually unbounded because one can use +// an arbitrary number of leading zeroes when encoding via uvlc. +// The following estimate is based around using the lowest number +// of bits for uvlc encoding. +#define AV1_SANE_SEQUENCE_HEADER_MAX_BITS 3138 + +#endif /* AVCODEC_AV1_H */ diff --git a/include/libavcodec/av1_levels.h b/include/libavcodec/av1_levels.h new file mode 100644 index 0000000..164cb87 --- /dev/null +++ b/include/libavcodec/av1_levels.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2023 Intel Corporation + * + * 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_AV1_LEVELS_H +#define AVCODEC_AV1_LEVELS_H + +#include + +typedef struct AV1LevelDescriptor { + char name[4]; + uint8_t level_idx; + + uint32_t max_pic_size; + uint32_t max_h_size; + uint32_t max_v_size; + uint64_t max_display_rate; + uint64_t max_decode_rate; + + uint32_t max_header_rate; + float main_mbps; + float high_mbps; + uint32_t main_cr; + uint32_t high_cr; + uint32_t max_tiles; + uint32_t max_tile_cols; +} AV1LevelDescriptor; + +/** + * Guess the level of a stream from some parameters. + * + * Unknown parameters may be zero, in which case they will be ignored. + */ +const AV1LevelDescriptor *ff_av1_guess_level(int64_t bitrate, + int tier, + int width, + int height, + int tile_rows, + int tile_cols, + float fps); + +#endif /* AVCODEC_AV1_LEVELS_H */ diff --git a/include/libavcodec/av1_parse.h b/include/libavcodec/av1_parse.h new file mode 100644 index 0000000..2b8cce4 --- /dev/null +++ b/include/libavcodec/av1_parse.h @@ -0,0 +1,172 @@ +/* + * AV1 common parsing code + * + * 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_AV1_PARSE_H +#define AVCODEC_AV1_PARSE_H + +#include +#include + +#include "libavutil/error.h" +#include "libavutil/intmath.h" +#include "libavutil/macros.h" + +#include "av1.h" +#include "get_bits.h" +#include "leb.h" + +// OBU header fields + max leb128 length +#define MAX_OBU_HEADER_SIZE (2 + 8) + +typedef struct AV1OBU { + /** Size of payload */ + int size; + const uint8_t *data; + + /** + * Size, in bits, of just the data, excluding the trailing_one_bit and + * any trailing padding. + */ + int size_bits; + + /** Size of entire OBU, including header */ + int raw_size; + const uint8_t *raw_data; + + int type; + + int temporal_id; + int spatial_id; +} AV1OBU; + +/** An input packet split into OBUs */ +typedef struct AV1Packet { + AV1OBU *obus; + int nb_obus; + int obus_allocated; + unsigned obus_allocated_size; +} AV1Packet; + +/** + * Extract an OBU from a raw bitstream. + * + * @note This function does not copy or store any bitstream data. All + * the pointers in the AV1OBU structure will be valid as long + * as the input buffer also is. + */ +int ff_av1_extract_obu(AV1OBU *obu, const uint8_t *buf, int length, + void *logctx); + +/** + * Split an input packet into OBUs. + * + * @note This function does not copy or store any bitstream data. All + * the pointers in the AV1Packet structure will be valid as + * long as the input buffer also is. + */ +int ff_av1_packet_split(AV1Packet *pkt, const uint8_t *buf, int length, + void *logctx); + +/** + * Free all the allocated memory in the packet. + */ +void ff_av1_packet_uninit(AV1Packet *pkt); + +static inline int parse_obu_header(const uint8_t *buf, int buf_size, + int64_t *obu_size, int *start_pos, int *type, + int *temporal_id, int *spatial_id) +{ + GetBitContext gb; + int ret, extension_flag, has_size_flag; + int64_t size; + + ret = init_get_bits8(&gb, buf, FFMIN(buf_size, MAX_OBU_HEADER_SIZE)); + if (ret < 0) + return ret; + + if (get_bits1(&gb) != 0) // obu_forbidden_bit + return AVERROR_INVALIDDATA; + + *type = get_bits(&gb, 4); + extension_flag = get_bits1(&gb); + has_size_flag = get_bits1(&gb); + skip_bits1(&gb); // obu_reserved_1bit + + if (extension_flag) { + *temporal_id = get_bits(&gb, 3); + *spatial_id = get_bits(&gb, 2); + skip_bits(&gb, 3); // extension_header_reserved_3bits + } else { + *temporal_id = *spatial_id = 0; + } + + *obu_size = has_size_flag ? get_leb128(&gb) + : buf_size - 1 - extension_flag; + + if (get_bits_left(&gb) < 0) + return AVERROR_INVALIDDATA; + + *start_pos = get_bits_count(&gb) / 8; + + size = *obu_size + *start_pos; + + if (size > buf_size) + return AVERROR_INVALIDDATA; + + return size; +} + +static inline int get_obu_bit_length(const uint8_t *buf, int size, int type) +{ + int v; + + /* There are no trailing bits on these */ + if (type == AV1_OBU_TILE_GROUP || + type == AV1_OBU_TILE_LIST || + type == AV1_OBU_FRAME) { + if (size > INT_MAX / 8) + return AVERROR(ERANGE); + else + return size * 8; + } + + while (size > 0 && buf[size - 1] == 0) + size--; + + if (!size) + return 0; + + v = buf[size - 1]; + + if (size > INT_MAX / 8) + return AVERROR(ERANGE); + size *= 8; + + /* Remove the trailing_one_bit and following trailing zeros */ + if (v) + size -= ff_ctz(v) + 1; + + return size; +} + +AVRational ff_av1_framerate(int64_t ticks_per_frame, int64_t units_per_tick, + int64_t time_scale); + +#endif /* AVCODEC_AV1_PARSE_H */ diff --git a/include/libavcodec/av1dec.h b/include/libavcodec/av1dec.h new file mode 100644 index 0000000..8b2a7b0 --- /dev/null +++ b/include/libavcodec/av1dec.h @@ -0,0 +1,123 @@ +/* + * AV1 video decoder + * * + * 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_AV1DEC_H +#define AVCODEC_AV1DEC_H + +#include + +#include "libavutil/buffer.h" +#include "libavutil/fifo.h" +#include "libavutil/frame.h" +#include "libavutil/pixfmt.h" +#include "avcodec.h" +#include "packet.h" +#include "cbs.h" +#include "cbs_av1.h" +#include "dovi_rpu.h" +#include "progressframe.h" + +typedef struct AV1Frame { + union { + struct { + struct AVFrame *f; + }; + ProgressFrame pf; + }; + + void *hwaccel_picture_private; ///< RefStruct reference + + AV1RawOBU *header_ref; ///< RefStruct reference backing raw_frame_header. + AV1RawFrameHeader *raw_frame_header; + + int temporal_id; + int spatial_id; + + uint8_t gm_invalid[AV1_NUM_REF_FRAMES]; + uint8_t gm_type[AV1_NUM_REF_FRAMES]; + int32_t gm_params[AV1_NUM_REF_FRAMES][6]; + + uint8_t skip_mode_frame_idx[2]; + + AV1RawFilmGrainParams film_grain; + + uint8_t coded_lossless; + + // OrderHint for this frame. + uint8_t order_hint; + // RefFrameSignBias[] used when decoding this frame. + uint8_t ref_frame_sign_bias[AV1_TOTAL_REFS_PER_FRAME]; + // OrderHints[] when this is the current frame, otherwise + // SavedOrderHints[s][] when is the reference frame in slot s. + uint8_t order_hints[AV1_TOTAL_REFS_PER_FRAME]; + + // force_integer_mv value at the end of the frame header parsing. + // This is not the same as the syntax element value in + // raw_frame_header because the specification parsing tables + // override the value on intra frames. + uint8_t force_integer_mv; +} AV1Frame; + +typedef struct TileGroupInfo { + uint32_t tile_offset; + uint32_t tile_size; + uint16_t tile_row; + uint16_t tile_column; +} TileGroupInfo; + +typedef struct AV1DecContext { + const AVClass *class; + AVCodecContext *avctx; + + enum AVPixelFormat pix_fmt; + CodedBitstreamContext *cbc; + CodedBitstreamFragment current_obu; + AVPacket *pkt; + + AVBufferRef *seq_data_ref; + AV1RawOBU *seq_ref; ///< RefStruct reference backing raw_seq + AV1RawSequenceHeader *raw_seq; + AV1RawOBU *header_ref; ///< RefStruct reference backing raw_frame_header + AV1RawFrameHeader *raw_frame_header; + TileGroupInfo *tile_group_info; + + AV1RawOBU *cll_ref; ///< RefStruct reference backing cll + AV1RawMetadataHDRCLL *cll; + AV1RawOBU *mdcv_ref; ///< RefStruct reference backing mdcv + AV1RawMetadataHDRMDCV *mdcv; + DOVIContext dovi; + AVFifo *itut_t35_fifo; + + uint16_t tile_num; + uint16_t tg_start; + uint16_t tg_end; + + int operating_point_idc; + + AV1Frame ref[AV1_NUM_REF_FRAMES]; + AV1Frame cur_frame; + + int nb_unit; + + // AVOptions + int operating_point; +} AV1DecContext; + +#endif /* AVCODEC_AV1DEC_H */ diff --git a/include/libavcodec/avcodec.h b/include/libavcodec/avcodec.h index cb5c25b..77ca8de 100755 --- a/include/libavcodec/avcodec.h +++ b/include/libavcodec/avcodec.h @@ -31,6 +31,7 @@ #include "libavutil/attributes.h" #include "libavutil/avutil.h" #include "libavutil/buffer.h" +#include "libavutil/channel_layout.h" #include "libavutil/dict.h" #include "libavutil/frame.h" #include "libavutil/log.h" @@ -38,8 +39,6 @@ #include "libavutil/rational.h" #include "codec.h" -#include "codec_desc.h" -#include "codec_par.h" #include "codec_id.h" #include "defs.h" #include "packet.h" @@ -49,8 +48,13 @@ * to avoid unnecessary rebuilds. When included externally, keep including * the full version information. */ #include "version.h" + +#include "codec_desc.h" +#include "codec_par.h" #endif +struct AVCodecParameters; + /** * @defgroup libavc libavcodec * Encoding/Decoding Library @@ -183,12 +187,16 @@ * @{ */ +#if FF_API_BUFFER_MIN_SIZE /** * @ingroup lavc_encoding * minimum encoding buffer size * Used to avoid some checks during header writing. + * @deprecated Unused: avcodec_receive_packet() does not work + * with preallocated packet buffers. */ #define AV_INPUT_BUFFER_MIN_SIZE 16384 +#endif /** * @ingroup lavc_encoding @@ -226,11 +234,76 @@ typedef struct RcOverride{ * Use qpel MC. */ #define AV_CODEC_FLAG_QPEL (1 << 4) +#if FF_API_DROPCHANGED /** * Don't output frames whose parameters differ from first * decoded frame in stream. + * + * @deprecated callers should implement this functionality in their own code */ #define AV_CODEC_FLAG_DROPCHANGED (1 << 5) +#endif +/** + * Request the encoder to output reconstructed frames, i.e.\ frames that would + * be produced by decoding the encoded bistream. These frames may be retrieved + * by calling avcodec_receive_frame() immediately after a successful call to + * avcodec_receive_packet(). + * + * Should only be used with encoders flagged with the + * @ref AV_CODEC_CAP_ENCODER_RECON_FRAME capability. + * + * @note + * Each reconstructed frame returned by the encoder corresponds to the last + * encoded packet, i.e. the frames are returned in coded order rather than + * presentation order. + * + * @note + * Frame parameters (like pixel format or dimensions) do not have to match the + * AVCodecContext values. Make sure to use the values from the returned frame. + */ +#define AV_CODEC_FLAG_RECON_FRAME (1 << 6) +/** + * @par decoding + * Request the decoder to propagate each packet's AVPacket.opaque and + * AVPacket.opaque_ref to its corresponding output AVFrame. + * + * @par encoding: + * Request the encoder to propagate each frame's AVFrame.opaque and + * AVFrame.opaque_ref values to its corresponding output AVPacket. + * + * @par + * May only be set on encoders that have the + * @ref AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE capability flag. + * + * @note + * While in typical cases one input frame produces exactly one output packet + * (perhaps after a delay), in general the mapping of frames to packets is + * M-to-N, so + * - Any number of input frames may be associated with any given output packet. + * This includes zero - e.g. some encoders may output packets that carry only + * metadata about the whole stream. + * - A given input frame may be associated with any number of output packets. + * Again this includes zero - e.g. some encoders may drop frames under certain + * conditions. + * . + * This implies that when using this flag, the caller must NOT assume that + * - a given input frame's opaques will necessarily appear on some output packet; + * - every output packet will have some non-NULL opaque value. + * . + * When an output packet contains multiple frames, the opaque values will be + * taken from the first of those. + * + * @note + * The converse holds for decoders, with frames and packets switched. + */ +#define AV_CODEC_FLAG_COPY_OPAQUE (1 << 7) +/** + * Signal to the encoder that the values of AVFrame.duration are valid and + * should be used (typically for transferring them to output packets). + * + * If this flag is not set, frame durations are ignored. + */ +#define AV_CODEC_FLAG_FRAME_DURATION (1 << 8) /** * Use internal 2pass ratecontrol in first pass mode. */ @@ -251,15 +324,6 @@ typedef struct RcOverride{ * error[?] variables will be set during encoding. */ #define AV_CODEC_FLAG_PSNR (1 << 15) -#if FF_API_FLAG_TRUNCATED -/** - * Input bitstream might be truncated at a random location - * instead of only at frame boundaries. - * - * @deprecated use codec parsers for packetizing input - */ -#define AV_CODEC_FLAG_TRUNCATED (1 << 16) -#endif /** * Use interlaced DCT. */ @@ -300,11 +364,6 @@ typedef struct RcOverride{ */ #define AV_CODEC_FLAG2_LOCAL_HEADER (1 << 3) -/** - * timecode is in drop frame format. DEPRECATED!!!! - */ -#define AV_CODEC_FLAG2_DROP_FRAME_TIMECODE (1 << 13) - /** * Input bitstream might be truncated at a packet boundaries * instead of only at frame boundaries. @@ -331,13 +390,12 @@ typedef struct RcOverride{ * Do not reset ASS ReadOrder field on flush (subtitles decoding) */ #define AV_CODEC_FLAG2_RO_FLUSH_NOOP (1 << 30) - -/* Unsupported options : - * Syntax Arithmetic coding (SAC) - * Reference Picture Selection - * Independent Segment Decoding */ -/* /Fx */ -/* codec capabilities */ +/** + * Generate/parse ICC profiles on encode/decode, as appropriate for the type of + * file. No effect on codecs which cannot contain embedded ICC profiles, or + * when compiled without support for lcms2. + */ +#define AV_CODEC_FLAG2_ICC_PROFILES (1U << 31) /* Exported side data. These flags can be passed in AVCodecContext.export_side_data before initialization. @@ -361,6 +419,12 @@ typedef struct RcOverride{ */ #define AV_CODEC_EXPORT_DATA_FILM_GRAIN (1 << 3) +/** + * Decoding only. + * Do not apply picture enhancement layers, export them instead. + */ +#define AV_CODEC_EXPORT_DATA_ENHANCEMENTS (1 << 4) + /** * The decoder will keep a reference to the frame and may reuse it later. */ @@ -371,8 +435,6 @@ typedef struct RcOverride{ */ #define AV_GET_ENCODE_BUFFER_FLAG_REF (1 << 0) -struct AVCodecInternal; - /** * main external API structure. * New fields can be added to the end with minor version bumps. @@ -438,29 +500,6 @@ typedef struct AVCodecContext { */ int64_t bit_rate; - /** - * number of bits the bitstream is allowed to diverge from the reference. - * the reference can be CBR (for CBR pass1) or VBR (for pass2) - * - encoding: Set by user; unused for constant quantizer encoding. - * - decoding: unused - */ - int bit_rate_tolerance; - - /** - * Global quality for codecs which cannot change it per frame. - * This should be proportional to MPEG-1/2/4 qscale. - * - encoding: Set by user. - * - decoding: unused - */ - int global_quality; - - /** - * - encoding: Set by user. - * - decoding: unused - */ - int compression_level; -#define FF_COMPRESSION_DEFAULT -1 - /** * AV_CODEC_FLAG_*. * - encoding: Set by user. @@ -506,19 +545,42 @@ typedef struct AVCodecContext { * (fixed_vop_rate == 0 implies that it is different from the framerate) * * - encoding: MUST be set by user. - * - decoding: the use of this field for decoding is deprecated. - * Use framerate instead. + * - decoding: unused. */ AVRational time_base; + /** + * Timebase in which pkt_dts/pts and AVPacket.dts/pts are expressed. + * - encoding: unused. + * - decoding: set by user. + */ + AVRational pkt_timebase; + + /** + * - decoding: For codecs that store a framerate value in the compressed + * bitstream, the decoder may export it here. { 0, 1} when + * unknown. + * - encoding: May be used to signal the framerate of CFR content to an + * encoder. + */ + AVRational framerate; + +#if FF_API_TICKS_PER_FRAME /** * For some codecs, the time base is closer to the field rate than the frame rate. * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration * if no telecine is used ... * * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. + * + * @deprecated + * - decoding: Use AVCodecDescriptor.props & AV_CODEC_PROP_FIELDS + * - encoding: Set AVCodecContext.framerate instead + * */ + attribute_deprecated int ticks_per_frame; +#endif /** * Codec delay. @@ -577,11 +639,13 @@ typedef struct AVCodecContext { int coded_width, coded_height; /** - * the number of pictures in a group of pictures, or 0 for intra_only + * sample aspect ratio (0 if unknown) + * That is the width of a pixel divided by the height of the pixel. + * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. * - encoding: Set by user. - * - decoding: unused + * - decoding: Set by libavcodec. */ - int gop_size; + AVRational sample_aspect_ratio; /** * Pixel format, see AV_PIX_FMT_xxx. @@ -598,6 +662,82 @@ typedef struct AVCodecContext { */ enum AVPixelFormat pix_fmt; + /** + * Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx. + * - encoding: unused. + * - decoding: Set by libavcodec before calling get_format() + */ + enum AVPixelFormat sw_pix_fmt; + + /** + * Chromaticity coordinates of the source primaries. + * - encoding: Set by user + * - decoding: Set by libavcodec + */ + enum AVColorPrimaries color_primaries; + + /** + * Color Transfer Characteristic. + * - encoding: Set by user + * - decoding: Set by libavcodec + */ + enum AVColorTransferCharacteristic color_trc; + + /** + * YUV colorspace type. + * - encoding: Set by user + * - decoding: Set by libavcodec + */ + enum AVColorSpace colorspace; + + /** + * MPEG vs JPEG YUV range. + * - encoding: Set by user to override the default output color range value, + * If not specified, libavcodec sets the color range depending on the + * output format. + * - decoding: Set by libavcodec, can be set by the user to propagate the + * color range to components reading from the decoder context. + */ + enum AVColorRange color_range; + + /** + * This defines the location of chroma samples. + * - encoding: Set by user + * - decoding: Set by libavcodec + */ + enum AVChromaLocation chroma_sample_location; + + /** Field order + * - encoding: set by libavcodec + * - decoding: Set by user. + */ + enum AVFieldOrder field_order; + + /** + * number of reference frames + * - encoding: Set by user. + * - decoding: Set by lavc. + */ + int refs; + + /** + * Size of the frame reordering buffer in the decoder. + * For MPEG-2 it is 1 IPB or 0 low delay IP. + * - encoding: Set by libavcodec. + * - decoding: Set by libavcodec. + */ + int has_b_frames; + + /** + * slice flags + * - encoding: unused + * - decoding: Set by user. + */ + int slice_flags; +#define SLICE_FLAG_CODED_ORDER 0x0001 ///< draw_horiz_band() is called in coded order instead of display +#define SLICE_FLAG_ALLOW_FIELD 0x0002 ///< allow draw_horiz_band() with field slices (MPEG-2 field pics) +#define SLICE_FLAG_ALLOW_PLANE 0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1) + /** * If non NULL, 'draw_horiz_band' is called by the libavcodec * decoder to draw a horizontal band. It improves cache usage. Not @@ -676,14 +816,6 @@ typedef struct AVCodecContext { */ float b_quant_offset; - /** - * Size of the frame reordering buffer in the decoder. - * For MPEG-2 it is 1 IPB or 0 low delay IP. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - */ - int has_b_frames; - /** * qscale factor between P- and I-frames * If > 0 then the last P-frame quantizer will be used (q = lastp_q * factor + offset). @@ -736,27 +868,11 @@ typedef struct AVCodecContext { float dark_masking; /** - * slice count - * - encoding: Set by libavcodec. - * - decoding: Set by user (or 0). - */ - int slice_count; - - /** - * slice offsets in the frame in bytes - * - encoding: Set/allocated by libavcodec. - * - decoding: Set/allocated by user (or NULL). - */ - int *slice_offset; - - /** - * sample aspect ratio (0 if unknown) - * That is the width of a pixel divided by the height of the pixel. - * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. + * noise vs. sse weight for the nsse comparison function * - encoding: Set by user. - * - decoding: Set by libavcodec. + * - decoding: unused */ - AVRational sample_aspect_ratio; + int nsse_weight; /** * motion estimation comparison function @@ -844,16 +960,6 @@ typedef struct AVCodecContext { */ int me_range; - /** - * slice flags - * - encoding: unused - * - decoding: Set by user. - */ - int slice_flags; -#define SLICE_FLAG_CODED_ORDER 0x0001 ///< draw_horiz_band() is called in coded order instead of display -#define SLICE_FLAG_ALLOW_FIELD 0x0002 ///< allow draw_horiz_band() with field slices (MPEG-2 field pics) -#define SLICE_FLAG_ALLOW_PLANE 0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1) - /** * macroblock decision mode * - encoding: Set by user. @@ -882,6 +988,13 @@ typedef struct AVCodecContext { */ uint16_t *inter_matrix; + /** + * custom intra quantization matrix + * - encoding: Set by user, can be NULL. + * - decoding: unused. + */ + uint16_t *chroma_intra_matrix; + /** * precision of the intra DC coefficient - 8 * - encoding: Set by user. @@ -889,20 +1002,6 @@ typedef struct AVCodecContext { */ int intra_dc_precision; - /** - * Number of macroblock rows at the top which are skipped. - * - encoding: unused - * - decoding: Set by user. - */ - int skip_top; - - /** - * Number of macroblock rows at the bottom which are skipped. - * - encoding: unused - * - decoding: Set by user. - */ - int skip_bottom; - /** * minimum MB Lagrange multiplier * - encoding: Set by user. @@ -931,11 +1030,11 @@ typedef struct AVCodecContext { int keyint_min; /** - * number of reference frames + * the number of pictures in a group of pictures, or 0 for intra_only * - encoding: Set by user. - * - decoding: Set by lavc. + * - decoding: unused */ - int refs; + int gop_size; /** * Note: Value depends upon the compare function used for fullpel ME. @@ -944,41 +1043,6 @@ typedef struct AVCodecContext { */ int mv0_threshold; - /** - * Chromaticity coordinates of the source primaries. - * - encoding: Set by user - * - decoding: Set by libavcodec - */ - enum AVColorPrimaries color_primaries; - - /** - * Color Transfer Characteristic. - * - encoding: Set by user - * - decoding: Set by libavcodec - */ - enum AVColorTransferCharacteristic color_trc; - - /** - * YUV colorspace type. - * - encoding: Set by user - * - decoding: Set by libavcodec - */ - enum AVColorSpace colorspace; - - /** - * MPEG vs JPEG YUV range. - * - encoding: Set by user - * - decoding: Set by libavcodec - */ - enum AVColorRange color_range; - - /** - * This defines the location of chroma samples. - * - encoding: Set by user - * - decoding: Set by libavcodec - */ - enum AVChromaLocation chroma_sample_location; - /** * Number of slices. * Indicates number of picture subdivisions. Used for parallelized @@ -988,24 +1052,9 @@ typedef struct AVCodecContext { */ int slices; - /** Field order - * - encoding: set by libavcodec - * - decoding: Set by user. - */ - enum AVFieldOrder field_order; - /* audio only */ int sample_rate; ///< samples per second -#if FF_API_OLD_CHANNEL_LAYOUT - /** - * number of audio channels - * @deprecated use ch_layout.nb_channels - */ - attribute_deprecated - int channels; -#endif - /** * audio sample format * - encoding: Set by user. @@ -1013,6 +1062,14 @@ typedef struct AVCodecContext { */ enum AVSampleFormat sample_fmt; ///< sample format + /** + * Audio channel layout. + * - encoding: must be set by the caller, to one of AVCodec.ch_layouts. + * - decoding: may be set by the caller if known e.g. from the container. + * The decoder can then override during decoding as needed. + */ + AVChannelLayout ch_layout; + /* The following data should not be initialized. */ /** * Number of samples per channel in an audio frame. @@ -1025,17 +1082,6 @@ typedef struct AVCodecContext { */ int frame_size; - /** - * Frame counter, set by libavcodec. - * - * - decoding: total number of frames returned from the decoder so far. - * - encoding: total number of frames passed to the encoder so far. - * - * @note the counter is not incremented if encoding/decoding resulted in - * an error. - */ - int frame_number; - /** * number of bytes per packet if constant and known or 0 * Used by some WAV based audio codecs. @@ -1049,26 +1095,6 @@ typedef struct AVCodecContext { */ int cutoff; -#if FF_API_OLD_CHANNEL_LAYOUT - /** - * Audio channel layout. - * - encoding: set by user. - * - decoding: set by user, may be overwritten by libavcodec. - * @deprecated use ch_layout - */ - attribute_deprecated - uint64_t channel_layout; - - /** - * Request decoder to use this channel layout if it can (0 for default) - * - encoding: unused - * - decoding: Set by user. - * @deprecated use "downmix" codec private option - */ - attribute_deprecated - uint64_t request_channel_layout; -#endif - /** * Type of service that the audio stream conveys. * - encoding: Set by user. @@ -1084,6 +1110,41 @@ typedef struct AVCodecContext { */ enum AVSampleFormat request_sample_fmt; + /** + * Audio only. The number of "priming" samples (padding) inserted by the + * encoder at the beginning of the audio. I.e. this number of leading + * decoded samples must be discarded by the caller to get the original audio + * without leading padding. + * + * - decoding: unused + * - encoding: Set by libavcodec. The timestamps on the output packets are + * adjusted by the encoder so that they always refer to the + * first sample of the data actually contained in the packet, + * including any added padding. E.g. if the timebase is + * 1/samplerate and the timestamp of the first input sample is + * 0, the timestamp of the first output packet will be + * -initial_padding. + */ + int initial_padding; + + /** + * Audio only. The amount of padding (in samples) appended by the encoder to + * the end of the audio. I.e. this number of decoded samples must be + * discarded by the caller from the end of the stream to get the original + * audio without any trailing padding. + * + * - decoding: unused + * - encoding: unused + */ + int trailing_padding; + + /** + * Number of samples to skip after a discontinuity + * - decoding: unused + * - encoding: set by libavcodec + */ + int seek_preroll; + /** * This callback is called at the beginning of each frame to get data * buffer(s) for it. There may be one contiguous buffer for all the data or @@ -1120,6 +1181,10 @@ typedef struct AVCodecContext { * this callback and filled with the extra buffers if there are more * buffers than buf[] can hold. extended_buf will be freed in * av_frame_unref(). + * Decoders will generally initialize the whole buffer before it is output + * but it can in rare error conditions happen that uninitialized data is passed + * through. \important The buffers returned by get_buffer* should thus not contain sensitive + * data. * * If AV_CODEC_CAP_DR1 is not set then get_buffer2() must call * avcodec_default_get_buffer2() instead of providing buffers allocated by @@ -1167,6 +1232,29 @@ typedef struct AVCodecContext { int (*get_buffer2)(struct AVCodecContext *s, AVFrame *frame, int flags); /* - encoding parameters */ + /** + * number of bits the bitstream is allowed to diverge from the reference. + * the reference can be CBR (for CBR pass1) or VBR (for pass2) + * - encoding: Set by user; unused for constant quantizer encoding. + * - decoding: unused + */ + int bit_rate_tolerance; + + /** + * Global quality for codecs which cannot change it per frame. + * This should be proportional to MPEG-1/2/4 qscale. + * - encoding: Set by user. + * - decoding: unused + */ + int global_quality; + + /** + * - encoding: Set by user. + * - decoding: unused + */ + int compression_level; +#define FF_COMPRESSION_DEFAULT -1 + float qcompress; ///< amount of qscale change between easy & hard scenes (0.0-1.0) float qblur; ///< amount of qscale smoothing over time (0.0-1.0) @@ -1194,7 +1282,7 @@ typedef struct AVCodecContext { /** * decoder bitstream buffer size * - encoding: Set by user. - * - decoding: unused + * - decoding: May be set by libavcodec. */ int rc_buffer_size; @@ -1296,13 +1384,9 @@ typedef struct AVCodecContext { * unofficial and experimental (that is, they always try to decode things * when they can) unless they are explicitly asked to behave stupidly * (=strictly conform to the specs) + * This may only be set to one of the FF_COMPLIANCE_* values in defs.h. */ int strict_std_compliance; -#define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to an older more strict version of the spec or reference software. -#define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences. -#define FF_COMPLIANCE_NORMAL 0 -#define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions -#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things. /** * error concealment flags @@ -1338,39 +1422,13 @@ typedef struct AVCodecContext { /** * Error recognition; may misdetect some more or less valid parts as errors. + * This is a bitfield of the AV_EF_* values defined in defs.h. + * * - encoding: Set by user. * - decoding: Set by user. */ int err_recognition; -/** - * Verify checksums embedded in the bitstream (could be of either encoded or - * decoded data, depending on the codec) and print an error message on mismatch. - * If AV_EF_EXPLODE is also set, a mismatching checksum will result in the - * decoder returning an error. - */ -#define AV_EF_CRCCHECK (1<<0) -#define AV_EF_BITSTREAM (1<<1) ///< detect bitstream specification deviations -#define AV_EF_BUFFER (1<<2) ///< detect improper bitstream length -#define AV_EF_EXPLODE (1<<3) ///< abort decoding on minor error detection - -#define AV_EF_IGNORE_ERR (1<<15) ///< ignore errors and continue -#define AV_EF_CAREFUL (1<<16) ///< consider things that violate the spec, are fast to calculate and have not been seen in the wild as errors -#define AV_EF_COMPLIANT (1<<17) ///< consider all spec non compliances as errors -#define AV_EF_AGGRESSIVE (1<<18) ///< consider things that a sane encoder should not do as an error - - - /** - * opaque 64-bit number (generally a PTS) that will be reordered and - * output in AVFrame.reordered_opaque - * - encoding: Set by libavcodec to the reordered_opaque of the input - * frame corresponding to the last returned packet. Only - * supported by encoders with the - * AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE capability. - * - decoding: Set by user. - */ - int64_t reordered_opaque; - /** * Hardware accelerator in use * - encoding: unused. @@ -1379,16 +1437,98 @@ typedef struct AVCodecContext { const struct AVHWAccel *hwaccel; /** - * Hardware accelerator context. - * For some hardware accelerators, a global context needs to be - * provided by the user. In that case, this holds display-dependent - * data FFmpeg cannot instantiate itself. Please refer to the - * FFmpeg HW accelerator documentation to know how to fill this. - * - encoding: unused - * - decoding: Set by user + * Legacy hardware accelerator context. + * + * For some hardware acceleration methods, the caller may use this field to + * signal hwaccel-specific data to the codec. The struct pointed to by this + * pointer is hwaccel-dependent and defined in the respective header. Please + * refer to the FFmpeg HW accelerator documentation to know how to fill + * this. + * + * In most cases this field is optional - the necessary information may also + * be provided to libavcodec through @ref hw_frames_ctx or @ref + * hw_device_ctx (see avcodec_get_hw_config()). However, in some cases it + * may be the only method of signalling some (optional) information. + * + * The struct and its contents are owned by the caller. + * + * - encoding: May be set by the caller before avcodec_open2(). Must remain + * valid until avcodec_free_context(). + * - decoding: May be set by the caller in the get_format() callback. + * Must remain valid until the next get_format() call, + * or avcodec_free_context() (whichever comes first). */ void *hwaccel_context; + /** + * A reference to the AVHWFramesContext describing the input (for encoding) + * or output (decoding) frames. The reference is set by the caller and + * afterwards owned (and freed) by libavcodec - it should never be read by + * the caller after being set. + * + * - decoding: This field should be set by the caller from the get_format() + * callback. The previous reference (if any) will always be + * unreffed by libavcodec before the get_format() call. + * + * If the default get_buffer2() is used with a hwaccel pixel + * format, then this AVHWFramesContext will be used for + * allocating the frame buffers. + * + * - encoding: For hardware encoders configured to use a hwaccel pixel + * format, this field should be set by the caller to a reference + * to the AVHWFramesContext describing input frames. + * AVHWFramesContext.format must be equal to + * AVCodecContext.pix_fmt. + * + * This field should be set before avcodec_open2() is called. + */ + AVBufferRef *hw_frames_ctx; + + /** + * A reference to the AVHWDeviceContext describing the device which will + * be used by a hardware encoder/decoder. The reference is set by the + * caller and afterwards owned (and freed) by libavcodec. + * + * This should be used if either the codec device does not require + * hardware frames or any that are used are to be allocated internally by + * libavcodec. If the user wishes to supply any of the frames used as + * encoder input or decoder output then hw_frames_ctx should be used + * instead. When hw_frames_ctx is set in get_format() for a decoder, this + * field will be ignored while decoding the associated stream segment, but + * may again be used on a following one after another get_format() call. + * + * For both encoders and decoders this field should be set before + * avcodec_open2() is called and must not be written to thereafter. + * + * Note that some decoders may require this field to be set initially in + * order to support hw_frames_ctx at all - in that case, all frames + * contexts used must be created on the same device. + */ + AVBufferRef *hw_device_ctx; + + /** + * Bit set of AV_HWACCEL_FLAG_* flags, which affect hardware accelerated + * decoding (if active). + * - encoding: unused + * - decoding: Set by user (either before avcodec_open2(), or in the + * AVCodecContext.get_format callback) + */ + int hwaccel_flags; + + /** + * Video decoding only. Sets the number of extra hardware frames which + * the decoder will allocate for use by the caller. This must be set + * before avcodec_open2() is called. + * + * Some hardware decoders require all frames that they will use for + * output to be defined in advance before decoding starts. For such + * decoders, the hardware frame pool must therefore be of a fixed size. + * The extra frames set here are on top of any number that the decoder + * needs internally in order to operate normally (for example, frames + * used as reference pictures). + */ + int extra_hw_frames; + /** * error * - encoding: Set by libavcodec if flags & AV_CODEC_FLAG_PSNR. @@ -1408,6 +1548,7 @@ typedef struct AVCodecContext { #define FF_DCT_MMX 3 #define FF_DCT_ALTIVEC 5 #define FF_DCT_FAAN 6 +#define FF_DCT_NEON 7 /** * IDCT algorithm, see FF_IDCT_* below. @@ -1427,10 +1568,6 @@ typedef struct AVCodecContext { #define FF_IDCT_SIMPLEARMV6 17 #define FF_IDCT_FAAN 20 #define FF_IDCT_SIMPLENEON 22 -#if FF_API_IDCT_NONE -// formerly used by xvmc -#define FF_IDCT_NONE 24 -#endif #define FF_IDCT_SIMPLEAUTO 128 /** @@ -1447,13 +1584,6 @@ typedef struct AVCodecContext { */ int bits_per_raw_sample; - /** - * low resolution decoding, 1-> 1/2 size, 2->1/4 size - * - encoding: unused - * - decoding: Set by user. - */ - int lowres; - /** * thread count * is used to decide how many independent tasks should be passed to execute() @@ -1481,27 +1611,6 @@ typedef struct AVCodecContext { */ int active_thread_type; -#if FF_API_THREAD_SAFE_CALLBACKS - /** - * Set by the client if its custom get_buffer() callback can be called - * synchronously from another thread, which allows faster multithreaded decoding. - * draw_horiz_band() will be called from other threads regardless of this setting. - * Ignored if the default get_buffer() is used. - * - encoding: Set by user. - * - decoding: Set by user. - * - * @deprecated the custom get_buffer2() callback should always be - * thread-safe. Thread-unsafe get_buffer2() implementations will be - * invalid starting with LIBAVCODEC_VERSION_MAJOR=60; in other words, - * libavcodec will behave as if this field was always set to 1. - * Callers that want to be forward compatible with future libavcodec - * versions should wrap access to this field in - * #if LIBAVCODEC_VERSION_MAJOR < 60 - */ - attribute_deprecated - int thread_safe_callbacks; -#endif - /** * The codec may call this to execute several independent things. * It will return only after finishing all tasks. @@ -1532,19 +1641,16 @@ typedef struct AVCodecContext { */ int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count); - /** - * noise vs. sse weight for the nsse comparison function - * - encoding: Set by user. - * - decoding: unused - */ - int nsse_weight; - /** * profile * - encoding: Set by user. * - decoding: Set by libavcodec. + * See the AV_PROFILE_* defines in defs.h. */ int profile; +#if FF_API_FF_PROFILE_LEVEL + /** @deprecated The following defines are deprecated; use AV_PROFILE_* + * in defs.h instead. */ #define FF_PROFILE_UNKNOWN -99 #define FF_PROFILE_RESERVED -100 @@ -1566,12 +1672,19 @@ typedef struct AVCodecContext { #define FF_PROFILE_DNXHR_HQX 4 #define FF_PROFILE_DNXHR_444 5 -#define FF_PROFILE_DTS 20 -#define FF_PROFILE_DTS_ES 30 -#define FF_PROFILE_DTS_96_24 40 -#define FF_PROFILE_DTS_HD_HRA 50 -#define FF_PROFILE_DTS_HD_MA 60 -#define FF_PROFILE_DTS_EXPRESS 70 +#define FF_PROFILE_DTS 20 +#define FF_PROFILE_DTS_ES 30 +#define FF_PROFILE_DTS_96_24 40 +#define FF_PROFILE_DTS_HD_HRA 50 +#define FF_PROFILE_DTS_HD_MA 60 +#define FF_PROFILE_DTS_EXPRESS 70 +#define FF_PROFILE_DTS_HD_MA_X 61 +#define FF_PROFILE_DTS_HD_MA_X_IMAX 62 + + +#define FF_PROFILE_EAC3_DDP_ATMOS 30 + +#define FF_PROFILE_TRUEHD_ATMOS 30 #define FF_PROFILE_MPEG2_422 0 #define FF_PROFILE_MPEG2_HIGH 1 @@ -1636,6 +1749,7 @@ typedef struct AVCodecContext { #define FF_PROFILE_HEVC_MAIN_10 2 #define FF_PROFILE_HEVC_MAIN_STILL_PICTURE 3 #define FF_PROFILE_HEVC_REXT 4 +#define FF_PROFILE_HEVC_SCC 9 #define FF_PROFILE_VVC_MAIN_10 1 #define FF_PROFILE_VVC_MAIN_10_444 33 @@ -1665,13 +1779,34 @@ typedef struct AVCodecContext { #define FF_PROFILE_KLVA_SYNC 0 #define FF_PROFILE_KLVA_ASYNC 1 +#define FF_PROFILE_EVC_BASELINE 0 +#define FF_PROFILE_EVC_MAIN 1 +#endif + /** - * level - * - encoding: Set by user. + * Encoding level descriptor. + * - encoding: Set by user, corresponds to a specific level defined by the + * codec, usually corresponding to the profile level, if not specified it + * is set to FF_LEVEL_UNKNOWN. * - decoding: Set by libavcodec. + * See AV_LEVEL_* in defs.h. */ int level; +#if FF_API_FF_PROFILE_LEVEL + /** @deprecated The following define is deprecated; use AV_LEVEL_UNKOWN + * in defs.h instead. */ #define FF_LEVEL_UNKNOWN -99 +#endif + + /** + * Properties of the stream that gets decoded + * - encoding: unused + * - decoding: set by libavcodec + */ + unsigned properties; +#define FF_CODEC_PROPERTY_LOSSLESS 0x00000001 +#define FF_CODEC_PROPERTY_CLOSED_CAPTIONS 0x00000002 +#define FF_CODEC_PROPERTY_FILM_GRAIN 0x00000004 /** * Skip loop filtering for selected frames. @@ -1695,72 +1830,46 @@ typedef struct AVCodecContext { enum AVDiscard skip_frame; /** - * Header containing style information for text subtitles. - * For SUBTITLE_ASS subtitle type, it should contain the whole ASS - * [Script Info] and [V4+ Styles] section, plus the [Events] line and - * the Format line following. It shouldn't include any Dialogue line. - * - encoding: Set/allocated/freed by user (before avcodec_open2()) - * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) - */ - uint8_t *subtitle_header; - int subtitle_header_size; - - /** - * Audio only. The number of "priming" samples (padding) inserted by the - * encoder at the beginning of the audio. I.e. this number of leading - * decoded samples must be discarded by the caller to get the original audio - * without leading padding. + * Skip processing alpha if supported by codec. + * Note that if the format uses pre-multiplied alpha (common with VP6, + * and recommended due to better video quality/compression) + * the image will look as if alpha-blended onto a black background. + * However for formats that do not use pre-multiplied alpha + * there might be serious artefacts (though e.g. libswscale currently + * assumes pre-multiplied alpha anyway). * - * - decoding: unused - * - encoding: Set by libavcodec. The timestamps on the output packets are - * adjusted by the encoder so that they always refer to the - * first sample of the data actually contained in the packet, - * including any added padding. E.g. if the timebase is - * 1/samplerate and the timestamp of the first input sample is - * 0, the timestamp of the first output packet will be - * -initial_padding. + * - decoding: set by user + * - encoding: unused */ - int initial_padding; + int skip_alpha; /** - * - decoding: For codecs that store a framerate value in the compressed - * bitstream, the decoder may export it here. { 0, 1} when - * unknown. - * - encoding: May be used to signal the framerate of CFR content to an - * encoder. + * Number of macroblock rows at the top which are skipped. + * - encoding: unused + * - decoding: Set by user. */ - AVRational framerate; + int skip_top; /** - * Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx. - * - encoding: unused. - * - decoding: Set by libavcodec before calling get_format() + * Number of macroblock rows at the bottom which are skipped. + * - encoding: unused + * - decoding: Set by user. */ - enum AVPixelFormat sw_pix_fmt; + int skip_bottom; /** - * Timebase in which pkt_dts/pts and AVPacket.dts/pts are. - * - encoding unused. - * - decoding set by user. + * low resolution decoding, 1-> 1/2 size, 2->1/4 size + * - encoding: unused + * - decoding: Set by user. */ - AVRational pkt_timebase; + int lowres; /** * AVCodecDescriptor * - encoding: unused. * - decoding: set by libavcodec. */ - const AVCodecDescriptor *codec_descriptor; - - /** - * Current statistics for PTS correction. - * - decoding: maintained and used by libavcodec, not intended to be used by user apps - * - encoding: unused - */ - int64_t pts_correction_num_faulty_pts; /// Number of incorrect PTS values so far - int64_t pts_correction_num_faulty_dts; /// Number of incorrect DTS values so far - int64_t pts_correction_last_pts; /// PTS of the last frame - int64_t pts_correction_last_dts; /// DTS of the last frame + const struct AVCodecDescriptor *codec_descriptor; /** * Character encoding of the input subtitles file. @@ -1782,43 +1891,15 @@ typedef struct AVCodecContext { #define FF_SUB_CHARENC_MODE_IGNORE 2 ///< neither convert the subtitles, nor check them for valid UTF-8 /** - * Skip processing alpha if supported by codec. - * Note that if the format uses pre-multiplied alpha (common with VP6, - * and recommended due to better video quality/compression) - * the image will look as if alpha-blended onto a black background. - * However for formats that do not use pre-multiplied alpha - * there might be serious artefacts (though e.g. libswscale currently - * assumes pre-multiplied alpha anyway). - * - * - decoding: set by user - * - encoding: unused + * Header containing style information for text subtitles. + * For SUBTITLE_ASS subtitle type, it should contain the whole ASS + * [Script Info] and [V4+ Styles] section, plus the [Events] line and + * the Format line following. It shouldn't include any Dialogue line. + * - encoding: Set/allocated/freed by user (before avcodec_open2()) + * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2()) */ - int skip_alpha; - - /** - * Number of samples to skip after a discontinuity - * - decoding: unused - * - encoding: set by libavcodec - */ - int seek_preroll; - -#if FF_API_DEBUG_MV - /** - * @deprecated unused - */ - attribute_deprecated - int debug_mv; -#define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames -#define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames -#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames -#endif - - /** - * custom intra quantization matrix - * - encoding: Set by user, can be NULL. - * - decoding: unused. - */ - uint16_t *chroma_intra_matrix; + int subtitle_header_size; + uint8_t *subtitle_header; /** * dump format separator. @@ -1836,68 +1917,24 @@ typedef struct AVCodecContext { */ char *codec_whitelist; - /** - * Properties of the stream that gets decoded - * - encoding: unused - * - decoding: set by libavcodec - */ - unsigned properties; -#define FF_CODEC_PROPERTY_LOSSLESS 0x00000001 -#define FF_CODEC_PROPERTY_CLOSED_CAPTIONS 0x00000002 -#define FF_CODEC_PROPERTY_FILM_GRAIN 0x00000004 - /** * Additional data associated with the entire coded stream. * - * - decoding: unused + * - decoding: may be set by user before calling avcodec_open2(). * - encoding: may be set by libavcodec after avcodec_open2(). */ AVPacketSideData *coded_side_data; int nb_coded_side_data; /** - * A reference to the AVHWFramesContext describing the input (for encoding) - * or output (decoding) frames. The reference is set by the caller and - * afterwards owned (and freed) by libavcodec - it should never be read by - * the caller after being set. + * Bit set of AV_CODEC_EXPORT_DATA_* flags, which affects the kind of + * metadata exported in frame, packet, or coded stream side data by + * decoders and encoders. * - * - decoding: This field should be set by the caller from the get_format() - * callback. The previous reference (if any) will always be - * unreffed by libavcodec before the get_format() call. - * - * If the default get_buffer2() is used with a hwaccel pixel - * format, then this AVHWFramesContext will be used for - * allocating the frame buffers. - * - * - encoding: For hardware encoders configured to use a hwaccel pixel - * format, this field should be set by the caller to a reference - * to the AVHWFramesContext describing input frames. - * AVHWFramesContext.format must be equal to - * AVCodecContext.pix_fmt. - * - * This field should be set before avcodec_open2() is called. + * - decoding: set by user + * - encoding: set by user */ - AVBufferRef *hw_frames_ctx; - -#if FF_API_SUB_TEXT_FORMAT - /** - * @deprecated unused - */ - attribute_deprecated - int sub_text_format; -#define FF_SUB_TEXT_FMT_ASS 0 -#endif - - /** - * Audio only. The amount of padding (in samples) appended by the encoder to - * the end of the audio. I.e. this number of decoded samples must be - * discarded by the caller from the end of the stream to get the original - * audio without any trailing padding. - * - * - decoding: unused - * - encoding: unused - */ - int trailing_padding; + int export_side_data; /** * The number of pixels per image to maximally accept. @@ -1907,37 +1944,6 @@ typedef struct AVCodecContext { */ int64_t max_pixels; - /** - * A reference to the AVHWDeviceContext describing the device which will - * be used by a hardware encoder/decoder. The reference is set by the - * caller and afterwards owned (and freed) by libavcodec. - * - * This should be used if either the codec device does not require - * hardware frames or any that are used are to be allocated internally by - * libavcodec. If the user wishes to supply any of the frames used as - * encoder input or decoder output then hw_frames_ctx should be used - * instead. When hw_frames_ctx is set in get_format() for a decoder, this - * field will be ignored while decoding the associated stream segment, but - * may again be used on a following one after another get_format() call. - * - * For both encoders and decoders this field should be set before - * avcodec_open2() is called and must not be written to thereafter. - * - * Note that some decoders may require this field to be set initially in - * order to support hw_frames_ctx at all - in that case, all frames - * contexts used must be created on the same device. - */ - AVBufferRef *hw_device_ctx; - - /** - * Bit set of AV_HWACCEL_FLAG_* flags, which affect hardware accelerated - * decoding (if active). - * - encoding: unused - * - decoding: Set by user (either before avcodec_open2(), or in the - * AVCodecContext.get_format callback) - */ - int hwaccel_flags; - /** * Video decoding only. Certain video codecs support cropping, meaning that * only a sub-rectangle of the decoded frame is intended for display. This @@ -1965,20 +1971,6 @@ typedef struct AVCodecContext { */ int apply_cropping; - /* - * Video decoding only. Sets the number of extra hardware frames which - * the decoder will allocate for use by the caller. This must be set - * before avcodec_open2() is called. - * - * Some hardware decoders require all frames that they will use for - * output to be defined in advance before decoding starts. For such - * decoders, the hardware frame pool must therefore be of a fixed size. - * The extra frames set here are on top of any number that the decoder - * needs internally in order to operate normally (for example, frames - * used as reference pictures). - */ - int extra_hw_frames; - /** * The percentage of damaged samples to discard a frame. * @@ -1995,16 +1987,6 @@ typedef struct AVCodecContext { */ int64_t max_samples; - /** - * Bit set of AV_CODEC_EXPORT_DATA_* flags, which affects the kind of - * metadata exported in frame, packet, or coded stream side data by - * decoders and encoders. - * - * - decoding: set by user - * - encoding: set by user - */ - int export_side_data; - /** * This callback is called at the beginning of each packet to get a data * buffer for it. @@ -2048,12 +2030,62 @@ typedef struct AVCodecContext { int (*get_encode_buffer)(struct AVCodecContext *s, AVPacket *pkt, int flags); /** - * Audio channel layout. - * - encoding: must be set by the caller, to one of AVCodec.ch_layouts. - * - decoding: may be set by the caller if known e.g. from the container. - * The decoder can then override during decoding as needed. + * Frame counter, set by libavcodec. + * + * - decoding: total number of frames returned from the decoder so far. + * - encoding: total number of frames passed to the encoder so far. + * + * @note the counter is not incremented if encoding/decoding resulted in + * an error. */ - AVChannelLayout ch_layout; + int64_t frame_num; + + /** + * Decoding only. May be set by the caller before avcodec_open2() to an + * av_malloc()'ed array (or via AVOptions). Owned and freed by the decoder + * afterwards. + * + * Side data attached to decoded frames may come from several sources: + * 1. coded_side_data, which the decoder will for certain types translate + * from packet-type to frame-type and attach to frames; + * 2. side data attached to an AVPacket sent for decoding (same + * considerations as above); + * 3. extracted from the coded bytestream. + * The first two cases are supplied by the caller and typically come from a + * container. + * + * This array configures decoder behaviour in cases when side data of the + * same type is present both in the coded bytestream and in the + * user-supplied side data (items 1. and 2. above). In all cases, at most + * one instance of each side data type will be attached to output frames. By + * default it will be the bytestream side data. Adding an + * AVPacketSideDataType value to this array will flip the preference for + * this type, thus making the decoder prefer user-supplied side data over + * bytestream. In case side data of the same type is present both in + * coded_data and attacked to a packet, the packet instance always has + * priority. + * + * The array may also contain a single -1, in which case the preference is + * switched for all side data types. + */ + int *side_data_prefer_packet; + /** + * Number of entries in side_data_prefer_packet. + */ + unsigned nb_side_data_prefer_packet; + + /** + * Array containing static side data, such as HDR10 CLL / MDCV structures. + * Side data entries should be allocated by usage of helpers defined in + * libavutil/frame.h. + * + * - encoding: may be set by user before calling avcodec_open2() for + * encoder configuration. Afterwards owned and freed by the + * encoder. + * - decoding: may be set by libavcodec in avcodec_open2(). + */ + AVFrameSideData **decoded_side_data; + int nb_decoded_side_data; } AVCodecContext; /** @@ -2098,120 +2130,6 @@ typedef struct AVHWAccel { * see AV_HWACCEL_CODEC_CAP_* */ int capabilities; - - /***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavcodec and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - */ - - /** - * Allocate a custom buffer - */ - int (*alloc_frame)(AVCodecContext *avctx, AVFrame *frame); - - /** - * Called at the beginning of each frame or field picture. - * - * Meaningful frame information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * Note that buf can be NULL along with buf_size set to 0. - * Otherwise, this means the whole frame is available at this point. - * - * @param avctx the codec context - * @param buf the frame data buffer base - * @param buf_size the size of the frame in bytes - * @return zero if successful, a negative value otherwise - */ - int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); - - /** - * Callback for parameter data (SPS/PPS/VPS etc). - * - * Useful for hardware decoders which keep persistent state about the - * video parameters, and need to receive any changes to update that state. - * - * @param avctx the codec context - * @param type the nal unit type - * @param buf the nal unit data buffer - * @param buf_size the size of the nal unit in bytes - * @return zero if successful, a negative value otherwise - */ - int (*decode_params)(AVCodecContext *avctx, int type, const uint8_t *buf, uint32_t buf_size); - - /** - * Callback for each slice. - * - * Meaningful slice information (codec specific) is guaranteed to - * be parsed at this point. This function is mandatory. - * - * @param avctx the codec context - * @param buf the slice data buffer base - * @param buf_size the size of the slice in bytes - * @return zero if successful, a negative value otherwise - */ - int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); - - /** - * Called at the end of each frame or field picture. - * - * The whole picture is parsed at this point and can now be sent - * to the hardware accelerator. This function is mandatory. - * - * @param avctx the codec context - * @return zero if successful, a negative value otherwise - */ - int (*end_frame)(AVCodecContext *avctx); - - /** - * Size of per-frame hardware accelerator private data. - * - * Private data is allocated with av_mallocz() before - * AVCodecContext.get_buffer() and deallocated after - * AVCodecContext.release_buffer(). - */ - int frame_priv_data_size; - - /** - * Initialize the hwaccel private data. - * - * This will be called from ff_get_format(), after hwaccel and - * hwaccel_context are set and the hwaccel private data in AVCodecInternal - * is allocated. - */ - int (*init)(AVCodecContext *avctx); - - /** - * Uninitialize the hwaccel private data. - * - * This will be called from get_format() or avcodec_close(), after hwaccel - * and hwaccel_context are already uninitialized. - */ - int (*uninit)(AVCodecContext *avctx); - - /** - * Size of the private data to allocate in - * AVCodecInternal.hwaccel_priv_data. - */ - int priv_data_size; - - /** - * Internal hwaccel capabilities. - */ - int caps_internal; - - /** - * Fill the given hw_frames context with current codec parameters. Called - * from get_format. Refer to avcodec_get_hw_frames_parameters() for - * details. - * - * This CAN be called before AVHWAccel.init is called, and you must assume - * that avctx->hwaccel_priv_data is invalid. - */ - int (*frame_params)(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx); } AVHWAccel; /** @@ -2250,6 +2168,22 @@ typedef struct AVHWAccel { */ #define AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH (1 << 2) +/** + * Some hardware decoders (namely nvdec) can either output direct decoder + * surfaces, or make an on-device copy and return said copy. + * There is a hard limit on how many decoder surfaces there can be, and it + * cannot be accurately guessed ahead of time. + * For some processing chains, this can be okay, but others will run into the + * limit and in turn produce very confusing errors that require fine tuning of + * more or less obscure options by the user, or in extreme cases cannot be + * resolved at all without inserting an avfilter that forces a copy. + * + * Thus, the hwaccel will by default make a copy for safety and resilience. + * If a users really wants to minimize the amount of copies, they can set this + * flag and ensure their processing chain does not exhaust the surface pool. + */ +#define AV_HWACCEL_FLAG_UNSAFE_OUTPUT (1 << 3) + /** * @} */ @@ -2288,6 +2222,7 @@ typedef struct AVSubtitleRect { uint8_t *data[4]; int linesize[4]; + int flags; enum AVSubtitleType type; char *text; ///< 0 terminated plain UTF-8 text @@ -2298,8 +2233,6 @@ typedef struct AVSubtitleRect { * struct. */ char *ass; - - int flags; } AVSubtitleRect; typedef struct AVSubtitle { @@ -2355,14 +2288,6 @@ void avcodec_free_context(AVCodecContext **avctx); */ const AVClass *avcodec_get_class(void); -#if FF_API_GET_FRAME_CLASS -/** - * @deprecated This function should not be used. - */ -attribute_deprecated -const AVClass *avcodec_get_frame_class(void); -#endif - /** * Get the AVClass for AVSubtitleRect. It can be used in combination with * AV_OPT_SEARCH_FAKE_OBJ for examining options. @@ -2378,7 +2303,7 @@ const AVClass *avcodec_get_subtitle_rect_class(void); * * @return >= 0 on success, a negative AVERROR code on failure */ -int avcodec_parameters_from_context(AVCodecParameters *par, +int avcodec_parameters_from_context(struct AVCodecParameters *par, const AVCodecContext *codec); /** @@ -2390,7 +2315,7 @@ int avcodec_parameters_from_context(AVCodecParameters *par, * @return >= 0 on success, a negative AVERROR code on failure. */ int avcodec_parameters_to_context(AVCodecContext *codec, - const AVCodecParameters *par); + const struct AVCodecParameters *par); /** * Initialize the AVCodecContext to use the given AVCodec. Prior to using this @@ -2400,9 +2325,16 @@ int avcodec_parameters_to_context(AVCodecContext *codec, * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for * retrieving a codec. * - * @note Always call this function before using decoding routines (such as - * @ref avcodec_receive_frame()). + * Depending on the codec, you might need to set options in the codec context + * also for decoding (e.g. width, height, or the pixel or audio sample format in + * the case the information is not available in the bitstream, as when decoding + * raw audio or video). * + * Options in the codec context can be set either by setting them in the options + * AVDictionary, or by setting the values in the context itself, directly or by + * using the av_opt_set() API before calling this function. + * + * Example: * @code * av_dict_set(&opts, "b", "2.5M", 0); * codec = avcodec_find_decoder(AV_CODEC_ID_H264); @@ -2415,20 +2347,40 @@ int avcodec_parameters_to_context(AVCodecContext *codec, * exit(1); * @endcode * + * In the case AVCodecParameters are available (e.g. when demuxing a stream + * using libavformat, and accessing the AVStream contained in the demuxer), the + * codec parameters can be copied to the codec context using + * avcodec_parameters_to_context(), as in the following example: + * + * @code + * AVStream *stream = ...; + * context = avcodec_alloc_context3(codec); + * if (avcodec_parameters_to_context(context, stream->codecpar) < 0) + * exit(1); + * if (avcodec_open2(context, codec, NULL) < 0) + * exit(1); + * @endcode + * + * @note Always call this function before using decoding routines (such as + * @ref avcodec_receive_frame()). + * * @param avctx The context to initialize. * @param codec The codec to open this context for. If a non-NULL codec has been * previously passed to avcodec_alloc_context3() or * for this context, then this parameter MUST be either NULL or * equal to the previously passed codec. - * @param options A dictionary filled with AVCodecContext and codec-private options. - * On return this object will be filled with options that were not found. + * @param options A dictionary filled with AVCodecContext and codec-private + * options, which are set on top of the options already set in + * avctx, can be NULL. On return this object will be filled with + * options that were not found in the avctx codec context. * * @return zero on success, a negative value on error * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_find(). + * av_dict_set(), av_opt_set(), av_opt_find(), avcodec_parameters_to_context() */ int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options); +#if FF_API_AVCODEC_CLOSE /** * Close a given AVCodecContext and free all the data associated with it * (but not the AVCodecContext itself). @@ -2437,12 +2389,14 @@ int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **op * the codec-specific data allocated in avcodec_alloc_context3() with a non-NULL * codec. Subsequent calls will do nothing. * - * @note Do not use this function. Use avcodec_free_context() to destroy a + * @deprecated Do not use this function. Use avcodec_free_context() to destroy a * codec context (either open or closed). Opening and closing a codec context * multiple times is not supported anymore -- use multiple codec contexts * instead. */ +attribute_deprecated int avcodec_close(AVCodecContext *avctx); +#endif /** * Free all allocated data in the given subtitle struct. @@ -2493,28 +2447,6 @@ void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height); void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int linesize_align[AV_NUM_DATA_POINTERS]); -/** - * Converts AVChromaLocation to swscale x/y chroma position. - * - * The positions represent the chroma (0,0) position in a coordinates system - * with luma (0,0) representing the origin and luma(1,1) representing 256,256 - * - * @param xpos horizontal chroma sample position - * @param ypos vertical chroma sample position - */ -int avcodec_enum_to_chroma_pos(int *xpos, int *ypos, enum AVChromaLocation pos); - -/** - * Converts swscale x/y chroma position to AVChromaLocation. - * - * The positions represent the chroma (0,0) position in a coordinates system - * with luma (0,0) representing the origin and luma(1,1) representing 256,256 - * - * @param xpos horizontal chroma sample position - * @param ypos vertical chroma sample position - */ -enum AVChromaLocation avcodec_chroma_pos_to_enum(int xpos, int ypos); - /** * Decode a subtitle message. * Return a negative value on error, otherwise return the number of bytes used. @@ -2543,8 +2475,7 @@ enum AVChromaLocation avcodec_chroma_pos_to_enum(int xpos, int ypos); * @param[in] avpkt The input AVPacket containing the input buffer. */ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, - int *got_sub_ptr, - AVPacket *avpkt); + int *got_sub_ptr, const AVPacket *avpkt); /** * Supply raw packet data as input to a decoder. @@ -2580,40 +2511,38 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, * still has frames buffered, it will return them after sending * a flush packet. * - * @return 0 on success, otherwise negative error code: - * AVERROR(EAGAIN): input is not accepted in the current state - user - * must read output with avcodec_receive_frame() (once - * all output is read, the packet should be resent, and - * the call will not fail with EAGAIN). - * AVERROR_EOF: the decoder has been flushed, and no new packets can - * be sent to it (also returned if more than 1 flush - * packet is sent) - * AVERROR(EINVAL): codec not opened, it is an encoder, or requires flush - * AVERROR(ENOMEM): failed to add packet to internal queue, or similar - * other errors: legitimate decoding errors + * @retval 0 success + * @retval AVERROR(EAGAIN) input is not accepted in the current state - user + * must read output with avcodec_receive_frame() (once + * all output is read, the packet should be resent, + * and the call will not fail with EAGAIN). + * @retval AVERROR_EOF the decoder has been flushed, and no new packets can be + * sent to it (also returned if more than 1 flush + * packet is sent) + * @retval AVERROR(EINVAL) codec not opened, it is an encoder, or requires flush + * @retval AVERROR(ENOMEM) failed to add packet to internal queue, or similar + * @retval "another negative error code" legitimate decoding errors */ int avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt); /** - * Return decoded output data from a decoder. + * Return decoded output data from a decoder or encoder (when the + * @ref AV_CODEC_FLAG_RECON_FRAME flag is used). * * @param avctx codec context * @param frame This will be set to a reference-counted video or audio * frame (depending on the decoder type) allocated by the - * decoder. Note that the function will always call + * codec. Note that the function will always call * av_frame_unref(frame) before doing anything else. * - * @return - * 0: success, a frame was returned - * AVERROR(EAGAIN): output is not available in this state - user must try - * to send new input - * AVERROR_EOF: the decoder has been fully flushed, and there will be - * no more output frames - * AVERROR(EINVAL): codec not opened, or it is an encoder - * AVERROR_INPUT_CHANGED: current decoded frame has changed parameters - * with respect to first decoded frame. Applicable - * when flag AV_CODEC_FLAG_DROPCHANGED is set. - * other negative values: legitimate decoding errors + * @retval 0 success, a frame was returned + * @retval AVERROR(EAGAIN) output is not available in this state - user must + * try to send new input + * @retval AVERROR_EOF the codec has been fully flushed, and there will be + * no more output frames + * @retval AVERROR(EINVAL) codec not opened, or it is an encoder without the + * @ref AV_CODEC_FLAG_RECON_FRAME flag enabled + * @retval "other negative error code" legitimate decoding errors */ int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame); @@ -2640,16 +2569,16 @@ int avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame); * If it is not set, frame->nb_samples must be equal to * avctx->frame_size for all frames except the last. * The final frame may be smaller than avctx->frame_size. - * @return 0 on success, otherwise negative error code: - * AVERROR(EAGAIN): input is not accepted in the current state - user - * must read output with avcodec_receive_packet() (once - * all output is read, the packet should be resent, and - * the call will not fail with EAGAIN). - * AVERROR_EOF: the encoder has been flushed, and no new frames can - * be sent to it - * AVERROR(EINVAL): codec not opened, it is a decoder, or requires flush - * AVERROR(ENOMEM): failed to add packet to internal queue, or similar - * other errors: legitimate encoding errors + * @retval 0 success + * @retval AVERROR(EAGAIN) input is not accepted in the current state - user must + * read output with avcodec_receive_packet() (once all + * output is read, the packet should be resent, and the + * call will not fail with EAGAIN). + * @retval AVERROR_EOF the encoder has been flushed, and no new frames can + * be sent to it + * @retval AVERROR(EINVAL) codec not opened, it is a decoder, or requires flush + * @retval AVERROR(ENOMEM) failed to add packet to internal queue, or similar + * @retval "another negative error code" legitimate encoding errors */ int avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame); @@ -2660,13 +2589,13 @@ int avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame); * @param avpkt This will be set to a reference-counted packet allocated by the * encoder. Note that the function will always call * av_packet_unref(avpkt) before doing anything else. - * @return 0 on success, otherwise negative error code: - * AVERROR(EAGAIN): output is not available in the current state - user - * must try to send input - * AVERROR_EOF: the encoder has been fully flushed, and there will be - * no more output packets - * AVERROR(EINVAL): codec not opened, or it is a decoder - * other errors: legitimate encoding errors + * @retval 0 success + * @retval AVERROR(EAGAIN) output is not available in the current state - user must + * try to send input + * @retval AVERROR_EOF the encoder has been fully flushed, and there will be no + * more output packets + * @retval AVERROR(EINVAL) codec not opened, or it is a decoder + * @retval "another negative error code" legitimate encoding errors */ int avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt); @@ -2772,6 +2701,36 @@ int avcodec_get_hw_frames_parameters(AVCodecContext *avctx, enum AVPixelFormat hw_pix_fmt, AVBufferRef **out_frames_ref); +enum AVCodecConfig { + AV_CODEC_CONFIG_PIX_FORMAT, ///< AVPixelFormat, terminated by AV_PIX_FMT_NONE + AV_CODEC_CONFIG_FRAME_RATE, ///< AVRational, terminated by {0, 0} + AV_CODEC_CONFIG_SAMPLE_RATE, ///< int, terminated by 0 + AV_CODEC_CONFIG_SAMPLE_FORMAT, ///< AVSampleFormat, terminated by AV_SAMPLE_FMT_NONE + AV_CODEC_CONFIG_CHANNEL_LAYOUT, ///< AVChannelLayout, terminated by {0} + AV_CODEC_CONFIG_COLOR_RANGE, ///< AVColorRange, terminated by AVCOL_RANGE_UNSPECIFIED + AV_CODEC_CONFIG_COLOR_SPACE, ///< AVColorSpace, terminated by AVCOL_SPC_UNSPECIFIED +}; + +/** + * Retrieve a list of all supported values for a given configuration type. + * + * @param avctx An optional context to use. Values such as + * `strict_std_compliance` may affect the result. If NULL, + * default values are used. + * @param codec The codec to query, or NULL to use avctx->codec. + * @param config The configuration to query. + * @param flags Currently unused; should be set to zero. + * @param out_configs On success, set to a list of configurations, terminated + * by a config-specific terminator, or NULL if all + * possible values are supported. + * @param out_num_configs On success, set to the number of elements in + *out_configs, excluding the terminator. Optional. + */ +int avcodec_get_supported_config(const AVCodecContext *avctx, + const AVCodec *codec, enum AVCodecConfig config, + unsigned flags, const void **out_configs, + int *out_num_configs); + /** @@ -2780,10 +2739,10 @@ int avcodec_get_hw_frames_parameters(AVCodecContext *avctx, */ enum AVPictureStructure { - AV_PICTURE_STRUCTURE_UNKNOWN, //< unknown - AV_PICTURE_STRUCTURE_TOP_FIELD, //< coded as top field - AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field - AV_PICTURE_STRUCTURE_FRAME, //< coded as frame + AV_PICTURE_STRUCTURE_UNKNOWN, ///< unknown + AV_PICTURE_STRUCTURE_TOP_FIELD, ///< coded as top field + AV_PICTURE_STRUCTURE_BOTTOM_FIELD, ///< coded as bottom field + AV_PICTURE_STRUCTURE_FRAME, ///< coded as frame }; typedef struct AVCodecParserContext { diff --git a/include/libavcodec/avcodec_internal.h b/include/libavcodec/avcodec_internal.h new file mode 100644 index 0000000..184d7b5 --- /dev/null +++ b/include/libavcodec/avcodec_internal.h @@ -0,0 +1,110 @@ +/* + * 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 + */ + +/* + * APIs internal to the generic codec layer. + * + * MUST NOT be included by individual encoders or decoders. + */ + +#ifndef AVCODEC_AVCODEC_INTERNAL_H +#define AVCODEC_AVCODEC_INTERNAL_H + +#include "libavutil/frame.h" + +#include "packet.h" + +struct AVCodecContext; + +typedef struct SideDataMap { + enum AVPacketSideDataType packet; + enum AVFrameSideDataType frame; +} SideDataMap; + +/** + * A map between packet and frame side data types. + * Terminated with an entry where packet=AV_PKT_DATA_NB. + */ +extern const SideDataMap ff_sd_global_map[]; + +/** + * avcodec_receive_frame() implementation for decoders. + */ +int ff_decode_receive_frame(struct AVCodecContext *avctx, struct AVFrame *frame); + +/** + * avcodec_receive_frame() implementation for encoders. + */ +int ff_encode_receive_frame(struct AVCodecContext *avctx, struct AVFrame *frame); + +/* + * Perform encoder initialization and validation. + * Called when opening the encoder, before the FFCodec.init() call. + */ +int ff_encode_preinit(struct AVCodecContext *avctx); + +/** + * Perform decoder initialization and validation. + * Called when opening the decoder, before the FFCodec.init() call. + */ +int ff_decode_preinit(struct AVCodecContext *avctx); + +void ff_decode_flush_buffers(struct AVCodecContext *avctx); +void ff_encode_flush_buffers(struct AVCodecContext *avctx); + +struct AVCodecInternal *ff_decode_internal_alloc(void); +void ff_decode_internal_sync(struct AVCodecContext *dst, + const struct AVCodecContext *src); +void ff_decode_internal_uninit(struct AVCodecContext *avctx); + +struct AVCodecInternal *ff_encode_internal_alloc(void); + +void ff_codec_close(struct AVCodecContext *avctx); + +int ff_thread_init(struct AVCodecContext *s); +void ff_thread_free(struct AVCodecContext *s); + +/** + * Wait for decoding threads to finish and reset internal state. + * Called by avcodec_flush_buffers(). + * + * @param avctx The context. + */ +void ff_thread_flush(struct AVCodecContext *avctx); + +/** + * Submit available packets for decoding to worker threads, return a + * decoded frame if available. Returns AVERROR(EAGAIN) if none is available. + * + * Parameters are the same as FFCodec.receive_frame. + */ +int ff_thread_receive_frame(struct AVCodecContext *avctx, AVFrame *frame); + +/** + * Do the actual decoding and obtain a decoded frame from the decoder, if + * available. When frame threading is used, this is invoked by the worker + * threads, otherwise by the top layer directly. + */ +int ff_decode_receive_frame_internal(struct AVCodecContext *avctx, AVFrame *frame); + +/** + * Get a packet for decoding. This gets invoked by the worker threads. + */ +int ff_thread_get_packet(struct AVCodecContext *avctx, AVPacket *pkt); + +#endif // AVCODEC_AVCODEC_INTERNAL_H diff --git a/include/libavcodec/avfft.h b/include/libavcodec/avfft.h index 0c0f9b8..e3a0da1 100755 --- a/include/libavcodec/avfft.h +++ b/include/libavcodec/avfft.h @@ -19,6 +19,10 @@ #ifndef AVCODEC_AVFFT_H #define AVCODEC_AVFFT_H +#include "libavutil/attributes.h" +#include "version_major.h" +#if FF_API_AVFFT + /** * @file * @ingroup lavc_fft @@ -44,26 +48,42 @@ typedef struct FFTContext FFTContext; * Set up a complex FFT. * @param nbits log2 of the length of the input array * @param inverse if 0 perform the forward transform, if 1 perform the inverse + * @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_FFT */ +attribute_deprecated FFTContext *av_fft_init(int nbits, int inverse); /** * Do the permutation needed BEFORE calling ff_fft_calc(). + * @deprecated without replacement */ +attribute_deprecated void av_fft_permute(FFTContext *s, FFTComplex *z); /** * Do a complex FFT with the parameters defined in av_fft_init(). The * input data must be permuted before. No 1.0/sqrt(n) normalization is done. + * @deprecated use the av_tx_fn value returned by av_tx_init, which also does permutation */ +attribute_deprecated void av_fft_calc(FFTContext *s, FFTComplex *z); +attribute_deprecated void av_fft_end(FFTContext *s); +/** + * @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_MDCT, + * with a flag of AV_TX_FULL_IMDCT for a replacement to av_imdct_calc. + */ +attribute_deprecated FFTContext *av_mdct_init(int nbits, int inverse, double scale); +attribute_deprecated void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); +attribute_deprecated void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input); +attribute_deprecated void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); +attribute_deprecated void av_mdct_end(FFTContext *s); /* Real Discrete Fourier Transform */ @@ -81,9 +101,14 @@ typedef struct RDFTContext RDFTContext; * Set up a real FFT. * @param nbits log2 of the length of the input array * @param trans the type of transform + * + * @deprecated use av_tx_init from libavutil/tx.h with a type of AV_TX_FLOAT_RDFT */ +attribute_deprecated RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans); +attribute_deprecated void av_rdft_calc(RDFTContext *s, FFTSample *data); +attribute_deprecated void av_rdft_end(RDFTContext *s); /* Discrete Cosine Transform */ @@ -106,13 +131,19 @@ enum DCTTransformType { * @param type the type of transform * * @note the first element of the input of DST-I is ignored + * + * @deprecated use av_tx_init from libavutil/tx.h with an appropriate type of AV_TX_FLOAT_DCT */ +attribute_deprecated DCTContext *av_dct_init(int nbits, enum DCTTransformType type); +attribute_deprecated void av_dct_calc(DCTContext *s, FFTSample *data); +attribute_deprecated void av_dct_end (DCTContext *s); /** * @} */ +#endif /* FF_API_AVFFT */ #endif /* AVCODEC_AVFFT_H */ diff --git a/include/libavcodec/avs2.h b/include/libavcodec/avs2.h new file mode 100644 index 0000000..544cf50 --- /dev/null +++ b/include/libavcodec/avs2.h @@ -0,0 +1,51 @@ +/* + * AVS2 related definitions + * + * Copyright (C) 2022 Zhao Zhili, + * + * 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_AVS2_H +#define AVCODEC_AVS2_H + +#include "libavutil/rational.h" + +#define AVS2_SLICE_MAX_START_CODE 0x000001AF + +enum { + AVS2_SEQ_START_CODE = 0xB0, + AVS2_SEQ_END_CODE = 0xB1, + AVS2_USER_DATA_START_CODE = 0xB2, + AVS2_INTRA_PIC_START_CODE = 0xB3, + // reserved = 0xB4, + AVS2_EXTENSION_START_CODE = 0xB5, + AVS2_INTER_PIC_START_CODE = 0xB6, +}; + +#define AVS2_ISPIC(x) ((x) == AVS2_INTRA_PIC_START_CODE || (x) == AVS2_INTER_PIC_START_CODE) +#define AVS2_ISUNIT(x) ((x) == AVS2_SEQ_START_CODE || AVS2_ISPIC(x)) + +enum AVS2Profile { + AVS2_PROFILE_MAIN_PIC = 0x12, + AVS2_PROFILE_MAIN = 0x20, + AVS2_PROFILE_MAIN10 = 0x22, +}; + +extern const AVRational ff_avs2_frame_rate_tab[16]; + +#endif diff --git a/include/libavcodec/avs3.h b/include/libavcodec/avs3.h new file mode 100644 index 0000000..4189d9b --- /dev/null +++ b/include/libavcodec/avs3.h @@ -0,0 +1,118 @@ +/* + * AVS3 related definitions + * + * Copyright (C) 2020 Huiwen Ren, + * + * 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_AVS3_H +#define AVCODEC_AVS3_H + +#define AVS3_NAL_START_CODE 0x010000 +#define AVS3_SEQ_START_CODE 0xB0 +#define AVS3_SEQ_END_CODE 0xB1 +#define AVS3_USER_DATA_START_CODE 0xB2 +#define AVS3_INTRA_PIC_START_CODE 0xB3 +#define AVS3_UNDEF_START_CODE 0xB4 +#define AVS3_EXTENSION_START_CODE 0xB5 +#define AVS3_INTER_PIC_START_CODE 0xB6 +#define AVS3_VIDEO_EDIT_CODE 0xB7 +#define AVS3_FIRST_SLICE_START_CODE 0x00 +#define AVS3_PROFILE_BASELINE_MAIN 0x20 +#define AVS3_PROFILE_BASELINE_MAIN10 0x22 + +#define AVS3_ISPIC(x) ((x) == AVS3_INTRA_PIC_START_CODE || (x) == AVS3_INTER_PIC_START_CODE) +#define AVS3_ISUNIT(x) ((x) == AVS3_SEQ_START_CODE || AVS3_ISPIC(x)) + +#include "libavutil/avutil.h" +#include "libavutil/pixfmt.h" +#include "libavutil/rational.h" + +static const AVRational ff_avs3_frame_rate_tab[16] = { + { 0 , 0 }, // forbid + { 24000, 1001}, + { 24 , 1 }, + { 25 , 1 }, + { 30000, 1001}, + { 30 , 1 }, + { 50 , 1 }, + { 60000, 1001}, + { 60 , 1 }, + { 100 , 1 }, + { 120 , 1 }, + { 200 , 1 }, + { 240 , 1 }, + { 300 , 1 }, + { 0 , 0 }, // reserved + { 0 , 0 } // reserved +}; + +static const int ff_avs3_color_primaries_tab[10] = { + AVCOL_PRI_RESERVED0 , // 0 + AVCOL_PRI_BT709 , // 1 + AVCOL_PRI_UNSPECIFIED , // 2 + AVCOL_PRI_RESERVED , // 3 + AVCOL_PRI_BT470M , // 4 + AVCOL_PRI_BT470BG , // 5 + AVCOL_PRI_SMPTE170M , // 6 + AVCOL_PRI_SMPTE240M , // 7 + AVCOL_PRI_FILM , // 8 + AVCOL_PRI_BT2020 // 9 +}; + +static const int ff_avs3_color_transfer_tab[15] = { + AVCOL_TRC_RESERVED0 , // 0 + AVCOL_TRC_BT709 , // 1 + AVCOL_TRC_UNSPECIFIED , // 2 + AVCOL_TRC_RESERVED , // 3 + AVCOL_TRC_GAMMA22 , // 4 + AVCOL_TRC_GAMMA28 , // 5 + AVCOL_TRC_SMPTE170M , // 6 + AVCOL_TRC_SMPTE240M , // 7 + AVCOL_TRC_LINEAR , // 8 + AVCOL_TRC_LOG , // 9 + AVCOL_TRC_LOG_SQRT , // 10 + AVCOL_TRC_BT2020_12 , // 11 + AVCOL_TRC_SMPTE2084 , // 12 + AVCOL_TRC_UNSPECIFIED , // 13 + AVCOL_TRC_ARIB_STD_B67 // 14 +}; + +static const int ff_avs3_color_matrix_tab[12] = { + AVCOL_SPC_RESERVED , // 0 + AVCOL_SPC_BT709 , // 1 + AVCOL_SPC_UNSPECIFIED , // 2 + AVCOL_SPC_RESERVED , // 3 + AVCOL_SPC_FCC , // 4 + AVCOL_SPC_BT470BG , // 5 + AVCOL_SPC_SMPTE170M , // 6 + AVCOL_SPC_SMPTE240M , // 7 + AVCOL_SPC_BT2020_NCL , // 8 + AVCOL_SPC_BT2020_CL , // 9 + AVCOL_SPC_UNSPECIFIED , // 10 + AVCOL_SPC_UNSPECIFIED // 11 +}; + +static const enum AVPictureType ff_avs3_image_type[4] = { + AV_PICTURE_TYPE_NONE, + AV_PICTURE_TYPE_I, + AV_PICTURE_TYPE_P, + AV_PICTURE_TYPE_B +}; + +#endif /* AVCODEC_AVS3_H */ diff --git a/include/libavcodec/bethsoftvideo.h b/include/libavcodec/bethsoftvideo.h new file mode 100644 index 0000000..d5b5d0a --- /dev/null +++ b/include/libavcodec/bethsoftvideo.h @@ -0,0 +1,36 @@ +/* + * Bethesda VID video decoder + * Copyright (C) 2007 Nicholas Tung + * + * 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_BETHSOFTVIDEO_H +#define AVCODEC_BETHSOFTVIDEO_H + +enum BethsoftVidBlockType +{ + PALETTE_BLOCK = 0x02, + FIRST_AUDIO_BLOCK = 0x7c, + AUDIO_BLOCK = 0x7d, + VIDEO_I_FRAME = 0x03, + VIDEO_P_FRAME = 0x01, + VIDEO_YOFF_P_FRAME = 0x04, + EOF_BLOCK = 0x14, +}; + +#endif /* AVCODEC_BETHSOFTVIDEO_H */ diff --git a/include/libavcodec/bgmc.h b/include/libavcodec/bgmc.h new file mode 100644 index 0000000..81771d4 --- /dev/null +++ b/include/libavcodec/bgmc.h @@ -0,0 +1,55 @@ +/* + * Block Gilbert-Moore decoder + * Copyright (c) 2010 Thilo Borgmann + * + * 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 + */ + +/** + * @file + * Block Gilbert-Moore decoder header + * @author Thilo Borgmann + */ + + +#ifndef AVCODEC_BGMC_H +#define AVCODEC_BGMC_H + + +#include "get_bits.h" + + +int ff_bgmc_init(void *logctx, uint8_t **cf_lut, int **cf_lut_status); + + +void ff_bgmc_end(uint8_t **cf_lut, int **cf_lut_status); + + +int ff_bgmc_decode_init(GetBitContext *gb, + unsigned int *h, unsigned int *l, unsigned int *v); + + +void ff_bgmc_decode_end(GetBitContext *gb); + + +void ff_bgmc_decode(GetBitContext *gb, unsigned int num, int32_t *dst, + int delta, unsigned int sx, + unsigned int *h, unsigned int *l, unsigned int *v, + uint8_t *cf_lut, int *cf_lut_status); + + +#endif /* AVCODEC_BGMC_H */ diff --git a/include/libavcodec/binkdata.h b/include/libavcodec/binkdata.h new file mode 100644 index 0000000..57619be --- /dev/null +++ b/include/libavcodec/binkdata.h @@ -0,0 +1,655 @@ +/* + * Bink video decoder + * Copyright (C) 2009 Konstantin Shishkov + * + * 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_BINKDATA_H +#define AVCODEC_BINKDATA_H + +#include + +/** Bink DCT and residue 8x8 block scan order */ +static const uint8_t bink_scan[64] = { + 0, 1, 8, 9, 2, 3, 10, 11, + 4, 5, 12, 13, 6, 7, 14, 15, + 20, 21, 28, 29, 22, 23, 30, 31, + 16, 17, 24, 25, 32, 33, 40, 41, + 34, 35, 42, 43, 48, 49, 56, 57, + 50, 51, 58, 59, 18, 19, 26, 27, + 36, 37, 44, 45, 38, 39, 46, 47, + 52, 53, 60, 61, 54, 55, 62, 63 +}; + +static const uint8_t bink_tree_bits[16][16] = { + { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, + }, + { + 0x00, 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, + 0x0F, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F, + }, + { + 0x00, 0x02, 0x01, 0x09, 0x05, 0x15, 0x0D, 0x1D, + 0x03, 0x13, 0x0B, 0x1B, 0x07, 0x17, 0x0F, 0x1F, + }, + { + 0x00, 0x02, 0x06, 0x01, 0x09, 0x05, 0x0D, 0x1D, + 0x03, 0x13, 0x0B, 0x1B, 0x07, 0x17, 0x0F, 0x1F, + }, + { + 0x00, 0x04, 0x02, 0x06, 0x01, 0x09, 0x05, 0x0D, + 0x03, 0x13, 0x0B, 0x1B, 0x07, 0x17, 0x0F, 0x1F, + }, + { + 0x00, 0x04, 0x02, 0x0A, 0x06, 0x0E, 0x01, 0x09, + 0x05, 0x0D, 0x03, 0x0B, 0x07, 0x17, 0x0F, 0x1F, + }, + { + 0x00, 0x02, 0x0A, 0x06, 0x0E, 0x01, 0x09, 0x05, + 0x0D, 0x03, 0x0B, 0x1B, 0x07, 0x17, 0x0F, 0x1F, + }, + { + 0x00, 0x01, 0x05, 0x03, 0x13, 0x0B, 0x1B, 0x3B, + 0x07, 0x27, 0x17, 0x37, 0x0F, 0x2F, 0x1F, 0x3F, + }, + { + 0x00, 0x01, 0x03, 0x13, 0x0B, 0x2B, 0x1B, 0x3B, + 0x07, 0x27, 0x17, 0x37, 0x0F, 0x2F, 0x1F, 0x3F, + }, + { + 0x00, 0x01, 0x05, 0x0D, 0x03, 0x13, 0x0B, 0x1B, + 0x07, 0x27, 0x17, 0x37, 0x0F, 0x2F, 0x1F, 0x3F, + }, + { + 0x00, 0x02, 0x01, 0x05, 0x0D, 0x03, 0x13, 0x0B, + 0x1B, 0x07, 0x17, 0x37, 0x0F, 0x2F, 0x1F, 0x3F, + }, + { + 0x00, 0x01, 0x09, 0x05, 0x0D, 0x03, 0x13, 0x0B, + 0x1B, 0x07, 0x17, 0x37, 0x0F, 0x2F, 0x1F, 0x3F, + }, + { + 0x00, 0x02, 0x01, 0x03, 0x13, 0x0B, 0x1B, 0x3B, + 0x07, 0x27, 0x17, 0x37, 0x0F, 0x2F, 0x1F, 0x3F, + }, + { + 0x00, 0x01, 0x05, 0x03, 0x07, 0x27, 0x17, 0x37, + 0x0F, 0x4F, 0x2F, 0x6F, 0x1F, 0x5F, 0x3F, 0x7F, + }, + { + 0x00, 0x01, 0x05, 0x03, 0x07, 0x17, 0x37, 0x77, + 0x0F, 0x4F, 0x2F, 0x6F, 0x1F, 0x5F, 0x3F, 0x7F, + }, + { + 0x00, 0x02, 0x01, 0x05, 0x03, 0x07, 0x27, 0x17, + 0x37, 0x0F, 0x2F, 0x6F, 0x1F, 0x5F, 0x3F, 0x7F, + }, +}; + +static const uint8_t bink_tree_lens[16][16] = { + { 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 }, + { 1, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, + { 2, 2, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, + { 2, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 }, + { 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5 }, + { 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5 }, + { 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5 }, + { 1, 3, 3, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }, + { 1, 2, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }, + { 1, 3, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6 }, + { 2, 2, 3, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6 }, + { 1, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6 }, + { 2, 2, 2, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }, + { 1, 3, 3, 3, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7 }, + { 1, 3, 3, 3, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 }, + { 2, 2, 3, 3, 3, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7 }, +}; + +static const uint8_t bink_patterns[16][64] = { + { + 0x00, 0x08, 0x10, 0x18, 0x20, 0x28, 0x30, 0x38, + 0x39, 0x31, 0x29, 0x21, 0x19, 0x11, 0x09, 0x01, + 0x02, 0x0A, 0x12, 0x1A, 0x22, 0x2A, 0x32, 0x3A, + 0x3B, 0x33, 0x2B, 0x23, 0x1B, 0x13, 0x0B, 0x03, + 0x04, 0x0C, 0x14, 0x1C, 0x24, 0x2C, 0x34, 0x3C, + 0x3D, 0x35, 0x2D, 0x25, 0x1D, 0x15, 0x0D, 0x05, + 0x06, 0x0E, 0x16, 0x1E, 0x26, 0x2E, 0x36, 0x3E, + 0x3F, 0x37, 0x2F, 0x27, 0x1F, 0x17, 0x0F, 0x07, + }, + { + 0x3B, 0x3A, 0x39, 0x38, 0x30, 0x31, 0x32, 0x33, + 0x2B, 0x2A, 0x29, 0x28, 0x20, 0x21, 0x22, 0x23, + 0x1B, 0x1A, 0x19, 0x18, 0x10, 0x11, 0x12, 0x13, + 0x0B, 0x0A, 0x09, 0x08, 0x00, 0x01, 0x02, 0x03, + 0x04, 0x05, 0x06, 0x07, 0x0F, 0x0E, 0x0D, 0x0C, + 0x14, 0x15, 0x16, 0x17, 0x1F, 0x1E, 0x1D, 0x1C, + 0x24, 0x25, 0x26, 0x27, 0x2F, 0x2E, 0x2D, 0x2C, + 0x34, 0x35, 0x36, 0x37, 0x3F, 0x3E, 0x3D, 0x3C, + }, + { + 0x19, 0x11, 0x12, 0x1A, 0x1B, 0x13, 0x0B, 0x03, + 0x02, 0x0A, 0x09, 0x01, 0x00, 0x08, 0x10, 0x18, + 0x20, 0x28, 0x30, 0x38, 0x39, 0x31, 0x29, 0x2A, + 0x32, 0x3A, 0x3B, 0x33, 0x2B, 0x23, 0x22, 0x21, + 0x1D, 0x15, 0x16, 0x1E, 0x1F, 0x17, 0x0F, 0x07, + 0x06, 0x0E, 0x0D, 0x05, 0x04, 0x0C, 0x14, 0x1C, + 0x24, 0x2C, 0x34, 0x3C, 0x3D, 0x35, 0x2D, 0x2E, + 0x36, 0x3E, 0x3F, 0x37, 0x2F, 0x27, 0x26, 0x25, + }, + { + 0x03, 0x0B, 0x02, 0x0A, 0x01, 0x09, 0x00, 0x08, + 0x10, 0x18, 0x11, 0x19, 0x12, 0x1A, 0x13, 0x1B, + 0x23, 0x2B, 0x22, 0x2A, 0x21, 0x29, 0x20, 0x28, + 0x30, 0x38, 0x31, 0x39, 0x32, 0x3A, 0x33, 0x3B, + 0x3C, 0x34, 0x3D, 0x35, 0x3E, 0x36, 0x3F, 0x37, + 0x2F, 0x27, 0x2E, 0x26, 0x2D, 0x25, 0x2C, 0x24, + 0x1C, 0x14, 0x1D, 0x15, 0x1E, 0x16, 0x1F, 0x17, + 0x0F, 0x07, 0x0E, 0x06, 0x0D, 0x05, 0x0C, 0x04, + }, + { + 0x18, 0x19, 0x10, 0x11, 0x08, 0x09, 0x00, 0x01, + 0x02, 0x03, 0x0A, 0x0B, 0x12, 0x13, 0x1A, 0x1B, + 0x1C, 0x1D, 0x14, 0x15, 0x0C, 0x0D, 0x04, 0x05, + 0x06, 0x07, 0x0E, 0x0F, 0x16, 0x17, 0x1E, 0x1F, + 0x27, 0x26, 0x2F, 0x2E, 0x37, 0x36, 0x3F, 0x3E, + 0x3D, 0x3C, 0x35, 0x34, 0x2D, 0x2C, 0x25, 0x24, + 0x23, 0x22, 0x2B, 0x2A, 0x33, 0x32, 0x3B, 0x3A, + 0x39, 0x38, 0x31, 0x30, 0x29, 0x28, 0x21, 0x20, + }, + { + 0x00, 0x01, 0x02, 0x03, 0x08, 0x09, 0x0A, 0x0B, + 0x10, 0x11, 0x12, 0x13, 0x18, 0x19, 0x1A, 0x1B, + 0x20, 0x21, 0x22, 0x23, 0x28, 0x29, 0x2A, 0x2B, + 0x30, 0x31, 0x32, 0x33, 0x38, 0x39, 0x3A, 0x3B, + 0x04, 0x05, 0x06, 0x07, 0x0C, 0x0D, 0x0E, 0x0F, + 0x14, 0x15, 0x16, 0x17, 0x1C, 0x1D, 0x1E, 0x1F, + 0x24, 0x25, 0x26, 0x27, 0x2C, 0x2D, 0x2E, 0x2F, + 0x34, 0x35, 0x36, 0x37, 0x3C, 0x3D, 0x3E, 0x3F, + }, + { + 0x06, 0x07, 0x0F, 0x0E, 0x0D, 0x05, 0x0C, 0x04, + 0x03, 0x0B, 0x02, 0x0A, 0x09, 0x01, 0x00, 0x08, + 0x10, 0x18, 0x11, 0x19, 0x12, 0x1A, 0x13, 0x1B, + 0x14, 0x1C, 0x15, 0x1D, 0x16, 0x1E, 0x17, 0x1F, + 0x27, 0x2F, 0x26, 0x2E, 0x25, 0x2D, 0x24, 0x2C, + 0x23, 0x2B, 0x22, 0x2A, 0x21, 0x29, 0x20, 0x28, + 0x31, 0x30, 0x38, 0x39, 0x3A, 0x32, 0x3B, 0x33, + 0x3C, 0x34, 0x3D, 0x35, 0x36, 0x37, 0x3F, 0x3E, + }, + { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x1F, 0x1E, 0x1D, 0x1C, 0x1B, 0x1A, 0x19, 0x18, + 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, + 0x2F, 0x2E, 0x2D, 0x2C, 0x2B, 0x2A, 0x29, 0x28, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x3F, 0x3E, 0x3D, 0x3C, 0x3B, 0x3A, 0x39, 0x38, + }, + { + 0x00, 0x08, 0x09, 0x01, 0x02, 0x03, 0x0B, 0x0A, + 0x12, 0x13, 0x1B, 0x1A, 0x19, 0x11, 0x10, 0x18, + 0x20, 0x28, 0x29, 0x21, 0x22, 0x23, 0x2B, 0x2A, + 0x32, 0x31, 0x30, 0x38, 0x39, 0x3A, 0x3B, 0x33, + 0x34, 0x3C, 0x3D, 0x3E, 0x3F, 0x37, 0x36, 0x35, + 0x2D, 0x2C, 0x24, 0x25, 0x26, 0x2E, 0x2F, 0x27, + 0x1F, 0x17, 0x16, 0x1E, 0x1D, 0x1C, 0x14, 0x15, + 0x0D, 0x0C, 0x04, 0x05, 0x06, 0x0E, 0x0F, 0x07, + }, + { + 0x18, 0x19, 0x10, 0x11, 0x08, 0x09, 0x00, 0x01, + 0x02, 0x03, 0x0A, 0x0B, 0x12, 0x13, 0x1A, 0x1B, + 0x1C, 0x1D, 0x14, 0x15, 0x0C, 0x0D, 0x04, 0x05, + 0x06, 0x07, 0x0E, 0x0F, 0x16, 0x17, 0x1E, 0x1F, + 0x26, 0x27, 0x2E, 0x2F, 0x36, 0x37, 0x3E, 0x3F, + 0x3C, 0x3D, 0x34, 0x35, 0x2C, 0x2D, 0x24, 0x25, + 0x22, 0x23, 0x2A, 0x2B, 0x32, 0x33, 0x3A, 0x3B, + 0x38, 0x39, 0x30, 0x31, 0x28, 0x29, 0x20, 0x21, + }, + { + 0x00, 0x08, 0x01, 0x09, 0x02, 0x0A, 0x03, 0x0B, + 0x13, 0x1B, 0x12, 0x1A, 0x11, 0x19, 0x10, 0x18, + 0x20, 0x28, 0x21, 0x29, 0x22, 0x2A, 0x23, 0x2B, + 0x33, 0x3B, 0x32, 0x3A, 0x31, 0x39, 0x30, 0x38, + 0x3C, 0x34, 0x3D, 0x35, 0x3E, 0x36, 0x3F, 0x37, + 0x2F, 0x27, 0x2E, 0x26, 0x2D, 0x25, 0x2C, 0x24, + 0x1F, 0x17, 0x1E, 0x16, 0x1D, 0x15, 0x1C, 0x14, + 0x0C, 0x04, 0x0D, 0x05, 0x0E, 0x06, 0x0F, 0x07, + }, + { + 0x00, 0x08, 0x10, 0x18, 0x19, 0x1A, 0x1B, 0x13, + 0x0B, 0x03, 0x02, 0x01, 0x09, 0x11, 0x12, 0x0A, + 0x04, 0x0C, 0x14, 0x1C, 0x1D, 0x1E, 0x1F, 0x17, + 0x0F, 0x07, 0x06, 0x05, 0x0D, 0x15, 0x16, 0x0E, + 0x24, 0x2C, 0x34, 0x3C, 0x3D, 0x3E, 0x3F, 0x37, + 0x2F, 0x27, 0x26, 0x25, 0x2D, 0x35, 0x36, 0x2E, + 0x20, 0x28, 0x30, 0x38, 0x39, 0x3A, 0x3B, 0x33, + 0x2B, 0x23, 0x22, 0x21, 0x29, 0x31, 0x32, 0x2A, + }, + { + 0x00, 0x08, 0x09, 0x01, 0x02, 0x03, 0x0B, 0x0A, + 0x13, 0x1B, 0x1A, 0x12, 0x11, 0x10, 0x18, 0x19, + 0x21, 0x20, 0x28, 0x29, 0x2A, 0x22, 0x23, 0x2B, + 0x33, 0x3B, 0x3A, 0x32, 0x31, 0x39, 0x38, 0x30, + 0x34, 0x3C, 0x3D, 0x35, 0x36, 0x3E, 0x3F, 0x37, + 0x2F, 0x27, 0x26, 0x2E, 0x2D, 0x2C, 0x24, 0x25, + 0x1D, 0x1C, 0x14, 0x15, 0x16, 0x1E, 0x1F, 0x17, + 0x0E, 0x0F, 0x07, 0x06, 0x05, 0x0D, 0x0C, 0x04, + }, + { + 0x18, 0x10, 0x08, 0x00, 0x01, 0x02, 0x03, 0x0B, + 0x13, 0x1B, 0x1A, 0x19, 0x11, 0x0A, 0x09, 0x12, + 0x1C, 0x14, 0x0C, 0x04, 0x05, 0x06, 0x07, 0x0F, + 0x17, 0x1F, 0x1E, 0x1D, 0x15, 0x0E, 0x0D, 0x16, + 0x3C, 0x34, 0x2C, 0x24, 0x25, 0x26, 0x27, 0x2F, + 0x37, 0x3F, 0x3E, 0x3D, 0x35, 0x2E, 0x2D, 0x36, + 0x38, 0x30, 0x28, 0x20, 0x21, 0x22, 0x23, 0x2B, + 0x33, 0x3B, 0x3A, 0x39, 0x31, 0x2A, 0x29, 0x32, + }, + { + 0x00, 0x08, 0x09, 0x01, 0x02, 0x0A, 0x12, 0x11, + 0x10, 0x18, 0x19, 0x1A, 0x1B, 0x13, 0x0B, 0x03, + 0x07, 0x06, 0x0E, 0x0F, 0x17, 0x16, 0x15, 0x0D, + 0x05, 0x04, 0x0C, 0x14, 0x1C, 0x1D, 0x1E, 0x1F, + 0x3F, 0x3E, 0x36, 0x37, 0x2F, 0x2E, 0x2D, 0x35, + 0x3D, 0x3C, 0x34, 0x2C, 0x24, 0x25, 0x26, 0x27, + 0x38, 0x30, 0x31, 0x39, 0x3A, 0x32, 0x2A, 0x29, + 0x28, 0x20, 0x21, 0x22, 0x23, 0x2B, 0x33, 0x3B, + }, + { + 0x00, 0x01, 0x08, 0x09, 0x10, 0x11, 0x18, 0x19, + 0x20, 0x21, 0x28, 0x29, 0x30, 0x31, 0x38, 0x39, + 0x3A, 0x3B, 0x32, 0x33, 0x2A, 0x2B, 0x22, 0x23, + 0x1A, 0x1B, 0x12, 0x13, 0x0A, 0x0B, 0x02, 0x03, + 0x04, 0x05, 0x0C, 0x0D, 0x14, 0x15, 0x1C, 0x1D, + 0x24, 0x25, 0x2C, 0x2D, 0x34, 0x35, 0x3C, 0x3D, + 0x3E, 0x3F, 0x36, 0x37, 0x2E, 0x2F, 0x26, 0x27, + 0x1E, 0x1F, 0x16, 0x17, 0x0E, 0x0F, 0x06, 0x07, + } +}; + +static const int32_t bink_intra_quant[16][64] = { +{ + 0x010000, 0x016315, 0x01E83D, 0x02A535, 0x014E7B, 0x016577, 0x02F1E6, 0x02724C, + 0x010000, 0x00EEDA, 0x024102, 0x017F9B, 0x00BE80, 0x00611E, 0x01083C, 0x00A552, + 0x021F88, 0x01DC53, 0x027FAD, 0x01F697, 0x014819, 0x00A743, 0x015A31, 0x009688, + 0x02346F, 0x030EE5, 0x01FBFA, 0x02C096, 0x01D000, 0x028396, 0x019247, 0x01F9AA, + 0x02346F, 0x01FBFA, 0x01DC53, 0x0231B8, 0x012F12, 0x01E06C, 0x00CB10, 0x0119A8, + 0x01C48C, 0x019748, 0x014E86, 0x0122AF, 0x02C628, 0x027F20, 0x0297B5, 0x023F32, + 0x025000, 0x01AB6B, 0x01D122, 0x0159B3, 0x012669, 0x008D43, 0x00EE1F, 0x0075ED, + 0x01490C, 0x010288, 0x00F735, 0x00EF51, 0x00E0F1, 0x0072AD, 0x00A4D8, 0x006517, +}, +{ + 0x015555, 0x01D971, 0x028AFC, 0x0386F1, 0x01BDF9, 0x01DC9F, 0x03ED33, 0x034311, + 0x015555, 0x013E78, 0x030158, 0x01FF7A, 0x00FE00, 0x00817D, 0x01604F, 0x00DC6D, + 0x02D4B5, 0x027B19, 0x0354E7, 0x029E1F, 0x01B577, 0x00DF04, 0x01CD96, 0x00C8B6, + 0x02F095, 0x0413DC, 0x02A54E, 0x03AB73, 0x026AAB, 0x035A1E, 0x02185E, 0x02A238, + 0x02F095, 0x02A54E, 0x027B19, 0x02ECF5, 0x019418, 0x028090, 0x010EC0, 0x01778A, + 0x025B66, 0x021F0B, 0x01BE09, 0x018394, 0x03B2E0, 0x03542A, 0x0374F1, 0x02FEEE, + 0x031555, 0x0239E4, 0x026C2D, 0x01CCEE, 0x01888C, 0x00BC59, 0x013D7E, 0x009D3C, + 0x01B6BB, 0x0158B5, 0x01499C, 0x013F17, 0x012BEC, 0x0098E6, 0x00DBCB, 0x0086C9, +}, +{ + 0x01AAAB, 0x024FCE, 0x032DBB, 0x0468AD, 0x022D78, 0x0253C7, 0x04E87F, 0x0413D5, + 0x01AAAB, 0x018E16, 0x03C1AE, 0x027F58, 0x013D80, 0x00A1DC, 0x01B863, 0x011388, + 0x0389E2, 0x0319DF, 0x042A21, 0x0345A7, 0x0222D4, 0x0116C5, 0x0240FC, 0x00FAE3, + 0x03ACBA, 0x0518D3, 0x034EA1, 0x04964F, 0x030555, 0x0430A5, 0x029E76, 0x034AC5, + 0x03ACBA, 0x034EA1, 0x0319DF, 0x03A833, 0x01F91E, 0x0320B4, 0x015270, 0x01D56D, + 0x02F23F, 0x02A6CE, 0x022D8B, 0x01E479, 0x049F98, 0x042935, 0x04522D, 0x03BEA9, + 0x03DAAB, 0x02C85D, 0x030738, 0x02402A, 0x01EAAF, 0x00EB6F, 0x018CDE, 0x00C48A, + 0x022469, 0x01AEE2, 0x019C02, 0x018EDD, 0x0176E7, 0x00BF20, 0x0112BE, 0x00A87B, +}, +{ + 0x020000, 0x02C62A, 0x03D07A, 0x054A69, 0x029CF6, 0x02CAEF, 0x05E3CC, 0x04E499, + 0x020000, 0x01DDB4, 0x048204, 0x02FF36, 0x017D01, 0x00C23C, 0x021077, 0x014AA3, + 0x043F0F, 0x03B8A6, 0x04FF5A, 0x03ED2E, 0x029032, 0x014E86, 0x02B461, 0x012D11, + 0x0468DF, 0x061DCA, 0x03F7F5, 0x05812C, 0x03A000, 0x05072C, 0x03248D, 0x03F353, + 0x0468DF, 0x03F7F5, 0x03B8A6, 0x046370, 0x025E24, 0x03C0D8, 0x019620, 0x02334F, + 0x038919, 0x032E91, 0x029D0D, 0x02455E, 0x058C50, 0x04FE3F, 0x052F69, 0x047E65, + 0x04A000, 0x0356D6, 0x03A243, 0x02B365, 0x024CD2, 0x011A85, 0x01DC3E, 0x00EBD9, + 0x029218, 0x020510, 0x01EE69, 0x01DEA2, 0x01C1E2, 0x00E559, 0x0149B0, 0x00CA2D, +}, +{ + 0x02AAAB, 0x03B2E3, 0x0515F8, 0x070DE2, 0x037BF2, 0x03B93E, 0x07DA65, 0x068621, + 0x02AAAB, 0x027CF0, 0x0602B1, 0x03FEF3, 0x01FC01, 0x0102FA, 0x02C09F, 0x01B8DA, + 0x05A96A, 0x04F632, 0x06A9CE, 0x053C3E, 0x036AED, 0x01BE09, 0x039B2D, 0x01916B, + 0x05E129, 0x0827B8, 0x054A9C, 0x0756E5, 0x04D555, 0x06B43B, 0x0430BC, 0x05446F, + 0x05E129, 0x054A9C, 0x04F632, 0x05D9EB, 0x032830, 0x050121, 0x021D80, 0x02EF14, + 0x04B6CC, 0x043E16, 0x037C11, 0x030728, 0x0765C0, 0x06A855, 0x06E9E2, 0x05FDDB, + 0x062AAB, 0x0473C8, 0x04D85A, 0x0399DC, 0x031118, 0x0178B2, 0x027AFD, 0x013A77, + 0x036D76, 0x02B16A, 0x029337, 0x027E2E, 0x0257D8, 0x0131CC, 0x01B796, 0x010D91, +}, +{ + 0x038000, 0x04DACA, 0x06ACD5, 0x094238, 0x0492AE, 0x04E322, 0x0A4EA5, 0x08900C, + 0x038000, 0x0343FB, 0x07E388, 0x053E9F, 0x029AC1, 0x0153E8, 0x039CD0, 0x02429E, + 0x076E5B, 0x068322, 0x08BEDE, 0x06DF11, 0x047C57, 0x02496B, 0x04BBAB, 0x020EDD, + 0x07B786, 0x0AB421, 0x06F1ED, 0x09A20D, 0x065800, 0x08CC8E, 0x057FF7, 0x06E9D2, + 0x07B786, 0x06F1ED, 0x068322, 0x07AE04, 0x0424BF, 0x06917B, 0x02C6B8, 0x03D9CB, + 0x062FEB, 0x05917D, 0x0492D7, 0x03F964, 0x09B58C, 0x08BCEF, 0x0912F8, 0x07DD30, + 0x081800, 0x05D7F7, 0x065BF6, 0x04B9F1, 0x040670, 0x01EE69, 0x03416C, 0x019CBC, + 0x047FAA, 0x0388DC, 0x036138, 0x03459C, 0x03134C, 0x01915C, 0x0240F5, 0x0161CF, +}, +{ + 0x040000, 0x058C54, 0x07A0F4, 0x0A94D3, 0x0539EC, 0x0595DD, 0x0BC798, 0x09C932, + 0x040000, 0x03BB68, 0x090409, 0x05FE6D, 0x02FA01, 0x018477, 0x0420EE, 0x029547, + 0x087E1F, 0x07714C, 0x09FEB5, 0x07DA5D, 0x052064, 0x029D0D, 0x0568C3, 0x025A21, + 0x08D1BE, 0x0C3B94, 0x07EFEA, 0x0B0258, 0x074000, 0x0A0E59, 0x06491A, 0x07E6A7, + 0x08D1BE, 0x07EFEA, 0x07714C, 0x08C6E0, 0x04BC48, 0x0781B1, 0x032C3F, 0x04669F, + 0x071232, 0x065D22, 0x053A1A, 0x048ABC, 0x0B18A0, 0x09FC7F, 0x0A5ED3, 0x08FCC9, + 0x094000, 0x06ADAC, 0x074487, 0x0566CA, 0x0499A5, 0x02350B, 0x03B87B, 0x01D7B3, + 0x052430, 0x040A20, 0x03DCD3, 0x03BD45, 0x0383C5, 0x01CAB3, 0x029361, 0x01945A, +}, +{ + 0x050000, 0x06EF69, 0x098931, 0x0D3A07, 0x068867, 0x06FB55, 0x0EB97E, 0x0C3B7E, + 0x050000, 0x04AA42, 0x0B450B, 0x077E08, 0x03B881, 0x01E595, 0x05292A, 0x033A99, + 0x0A9DA7, 0x094D9F, 0x0C7E62, 0x09D0F4, 0x06687D, 0x034450, 0x06C2F4, 0x02F0AA, + 0x0B062D, 0x0F4A78, 0x09EBE4, 0x0DC2EE, 0x091000, 0x0C91EF, 0x07DB61, 0x09E050, + 0x0B062D, 0x09EBE4, 0x094D9F, 0x0AF898, 0x05EB59, 0x09621D, 0x03F74F, 0x058046, + 0x08D6BE, 0x07F46A, 0x0688A0, 0x05AD6B, 0x0DDEC8, 0x0C7B9F, 0x0CF687, 0x0B3BFB, + 0x0B9000, 0x085917, 0x0915A8, 0x06C07D, 0x05C00E, 0x02C24D, 0x04A69A, 0x024D9F, + 0x066D3C, 0x050CA7, 0x04D407, 0x04AC96, 0x0464B6, 0x023D5F, 0x033839, 0x01F971, +}, +{ + 0x060000, 0x08527E, 0x0B716E, 0x0FDF3C, 0x07D6E1, 0x0860CC, 0x11AB63, 0x0EADCB, + 0x060000, 0x05991C, 0x0D860D, 0x08FDA3, 0x047702, 0x0246B3, 0x063165, 0x03DFEA, + 0x0CBD2E, 0x0B29F1, 0x0EFE0F, 0x0BC78B, 0x07B096, 0x03EB93, 0x081D24, 0x038732, + 0x0D3A9C, 0x12595D, 0x0BE7DF, 0x108384, 0x0AE000, 0x0F1585, 0x096DA8, 0x0BD9FA, + 0x0D3A9C, 0x0BE7DF, 0x0B29F1, 0x0D2A50, 0x071A6B, 0x0B4289, 0x04C25F, 0x0699EE, + 0x0A9B4A, 0x098BB2, 0x07D727, 0x06D01A, 0x10A4F0, 0x0EFABE, 0x0F8E3C, 0x0D7B2E, + 0x0DE000, 0x0A0482, 0x0AE6CA, 0x081A2F, 0x06E677, 0x034F90, 0x0594B9, 0x02C38C, + 0x07B649, 0x060F2F, 0x05CB3C, 0x059BE7, 0x0545A7, 0x02B00C, 0x03DD11, 0x025E87, +}, +{ + 0x080000, 0x0B18A8, 0x0F41E8, 0x1529A5, 0x0A73D7, 0x0B2BBB, 0x178F2F, 0x139264, + 0x080000, 0x0776CF, 0x120812, 0x0BFCD9, 0x05F402, 0x0308EF, 0x0841DC, 0x052A8E, + 0x10FC3E, 0x0EE297, 0x13FD69, 0x0FB4B9, 0x0A40C8, 0x053A1A, 0x0AD186, 0x04B442, + 0x11A37B, 0x187727, 0x0FDFD4, 0x1604B0, 0x0E8000, 0x141CB1, 0x0C9235, 0x0FCD4D, + 0x11A37B, 0x0FDFD4, 0x0EE297, 0x118DC0, 0x09788F, 0x0F0362, 0x06587F, 0x08CD3D, + 0x0E2463, 0x0CBA43, 0x0A7434, 0x091577, 0x163140, 0x13F8FE, 0x14BDA5, 0x11F992, + 0x128000, 0x0D5B58, 0x0E890D, 0x0ACD94, 0x093349, 0x046A15, 0x0770F7, 0x03AF65, + 0x0A4861, 0x08143F, 0x07B9A6, 0x077A89, 0x070789, 0x039565, 0x0526C2, 0x0328B4, +}, +{ + 0x0C0000, 0x10A4FD, 0x16E2DB, 0x1FBE78, 0x0FADC3, 0x10C198, 0x2356C7, 0x1D5B96, + 0x0C0000, 0x0B3237, 0x1B0C1A, 0x11FB46, 0x08EE03, 0x048D66, 0x0C62CA, 0x07BFD5, + 0x197A5D, 0x1653E3, 0x1DFC1E, 0x178F16, 0x0F612C, 0x07D727, 0x103A49, 0x070E64, + 0x1A7539, 0x24B2BB, 0x17CFBD, 0x210709, 0x15C000, 0x1E2B0A, 0x12DB4F, 0x17B3F4, + 0x1A7539, 0x17CFBD, 0x1653E3, 0x1A54A0, 0x0E34D7, 0x168513, 0x0984BE, 0x0D33DC, + 0x153695, 0x131765, 0x0FAE4E, 0x0DA033, 0x2149E1, 0x1DF57D, 0x1F1C78, 0x1AF65B, + 0x1BC000, 0x140904, 0x15CD94, 0x10345E, 0x0DCCEE, 0x069F20, 0x0B2972, 0x058718, + 0x0F6C91, 0x0C1E5E, 0x0B9678, 0x0B37CE, 0x0A8B4E, 0x056018, 0x07BA22, 0x04BD0E, +}, +{ + 0x110000, 0x179466, 0x206C0C, 0x2CF87F, 0x16362A, 0x17BCED, 0x321044, 0x299714, + 0x110000, 0x0FDC79, 0x265125, 0x19794E, 0x0CA685, 0x0672FB, 0x118BF4, 0x0AFA6D, + 0x241804, 0x1FA181, 0x2A7A80, 0x21600A, 0x15C9A9, 0x0B1B77, 0x16FD3C, 0x09FF0D, + 0x257B66, 0x33FD33, 0x21BBA2, 0x2EC9F7, 0x1ED000, 0x2ABCF9, 0x1AB6B0, 0x219444, + 0x257B66, 0x21BBA2, 0x1FA181, 0x254D38, 0x142030, 0x1FE730, 0x0D7C0E, 0x12B423, + 0x1E0D52, 0x1B0BCF, 0x1636EE, 0x134D9E, 0x2F28A9, 0x2A711B, 0x2C12FF, 0x263256, + 0x275000, 0x1C621B, 0x1EE33C, 0x16F4DB, 0x138CFB, 0x09616E, 0x0FD00C, 0x07D4B7, + 0x15D9CE, 0x112B06, 0x106A80, 0x0FE464, 0x0EF004, 0x079D77, 0x0AF25B, 0x06B67F, +}, +{ + 0x160000, 0x1E83CF, 0x29F53D, 0x3A3286, 0x1CBE90, 0x1EB842, 0x40C9C2, 0x35D293, + 0x160000, 0x1486BA, 0x319630, 0x20F756, 0x105F06, 0x085891, 0x16B51E, 0x0E3506, + 0x2EB5AA, 0x28EF20, 0x36F8E1, 0x2B30FE, 0x1C3225, 0x0E5FC7, 0x1DC030, 0x0CEFB7, + 0x308193, 0x4347AC, 0x2BA786, 0x3C8CE5, 0x27E000, 0x374EE7, 0x229212, 0x2B7494, + 0x308193, 0x2BA786, 0x28EF20, 0x3045D0, 0x1A0B89, 0x29494D, 0x11735D, 0x183469, + 0x26E410, 0x230039, 0x1CBF8F, 0x18FB09, 0x3D0771, 0x36ECBA, 0x390986, 0x316E52, + 0x32E000, 0x24BB33, 0x27F8E4, 0x1DB557, 0x194D09, 0x0C23BB, 0x1476A6, 0x0A2256, + 0x1C470A, 0x1637AD, 0x153E87, 0x1490FA, 0x1354B9, 0x09DAD6, 0x0E2A94, 0x08AFF0, +}, +{ + 0x1C0000, 0x26D64D, 0x3566AA, 0x4A11C2, 0x249572, 0x27190E, 0x527525, 0x44805E, + 0x1C0000, 0x1A1FD6, 0x3F1C3E, 0x29F4F9, 0x14D607, 0x0A9F44, 0x1CE683, 0x1214F0, + 0x3B72D9, 0x341911, 0x45F6F0, 0x36F889, 0x23E2BB, 0x124B5B, 0x25DD54, 0x1076E9, + 0x3DBC30, 0x55A109, 0x378F64, 0x4D1069, 0x32C000, 0x46646C, 0x2BFFB9, 0x374E8E, + 0x3DBC30, 0x378F64, 0x341911, 0x3D7020, 0x2125F5, 0x348BD6, 0x1635BC, 0x1ECE57, + 0x317F5B, 0x2C8BEB, 0x2496B6, 0x1FCB22, 0x4DAC61, 0x45E778, 0x4897C2, 0x3EE97F, + 0x40C000, 0x2EBFB5, 0x32DFAE, 0x25CF86, 0x203380, 0x0F734B, 0x1A0B5F, 0x0CE5E2, + 0x23FD53, 0x1C46DC, 0x1B09C4, 0x1A2CE1, 0x189A60, 0x0C8AE2, 0x1207A5, 0x0B0E77, +}, +{ + 0x220000, 0x2F28CC, 0x40D818, 0x59F0FE, 0x2C6C53, 0x2F79DA, 0x642089, 0x532E29, + 0x220000, 0x1FB8F1, 0x4CA24B, 0x32F29C, 0x194D09, 0x0CE5F7, 0x2317E8, 0x15F4DB, + 0x483007, 0x3F4303, 0x54F4FF, 0x42C014, 0x2B9351, 0x1636EE, 0x2DFA79, 0x13FE1A, + 0x4AF6CC, 0x67FA67, 0x437743, 0x5D93EE, 0x3DA000, 0x5579F1, 0x356D61, 0x432888, + 0x4AF6CC, 0x437743, 0x3F4303, 0x4A9A70, 0x284060, 0x3FCE60, 0x1AF81B, 0x256845, + 0x3C1AA5, 0x36179D, 0x2C6DDD, 0x269B3C, 0x5E5152, 0x54E237, 0x5825FE, 0x4C64AD, + 0x4EA000, 0x38C437, 0x3DC678, 0x2DE9B5, 0x2719F7, 0x12C2DB, 0x1FA018, 0x0FA96E, + 0x2BB39B, 0x22560C, 0x20D500, 0x1FC8C8, 0x1DE007, 0x0F3AEE, 0x15E4B7, 0x0D6CFE, +}, +{ + 0x2C0000, 0x3D079E, 0x53EA79, 0x74650C, 0x397D20, 0x3D7083, 0x819383, 0x6BA525, + 0x2C0000, 0x290D75, 0x632C61, 0x41EEAC, 0x20BE0C, 0x10B121, 0x2D6A3B, 0x1C6A0C, + 0x5D6B54, 0x51DE40, 0x6DF1C2, 0x5661FB, 0x38644B, 0x1CBF8F, 0x3B8060, 0x19DF6D, + 0x610326, 0x868F57, 0x574F0B, 0x7919CA, 0x4FC000, 0x6E9DCE, 0x452423, 0x56E928, + 0x610326, 0x574F0B, 0x51DE40, 0x608BA0, 0x341713, 0x52929A, 0x22E6BA, 0x3068D2, + 0x4DC821, 0x460071, 0x397F1E, 0x31F611, 0x7A0EE2, 0x6DD974, 0x72130C, 0x62DCA3, + 0x65C000, 0x497665, 0x4FF1C9, 0x3B6AAE, 0x329A12, 0x184776, 0x28ED4D, 0x1444AC, + 0x388E14, 0x2C6F5A, 0x2A7D0F, 0x2921F4, 0x26A973, 0x13B5AD, 0x1C5528, 0x115FDF, +}, +}; + +static const int32_t bink_inter_quant[16][64] = { +{ + 0x010000, 0x017946, 0x01A5A9, 0x0248DC, 0x016363, 0x0152A7, 0x0243EC, 0x0209EA, + 0x012000, 0x00E248, 0x01BBDA, 0x015CBC, 0x00A486, 0x0053E0, 0x00F036, 0x008095, + 0x01B701, 0x016959, 0x01B0B9, 0x0153FD, 0x00F8E7, 0x007EE4, 0x00EA30, 0x007763, + 0x01B701, 0x0260EB, 0x019DE9, 0x023E1B, 0x017000, 0x01FE6E, 0x012DB5, 0x01A27B, + 0x01E0D1, 0x01B0B9, 0x018A33, 0x01718D, 0x00D87A, 0x014449, 0x007B9A, 0x00AB71, + 0x013178, 0x0112EA, 0x00AD08, 0x009BB9, 0x023D97, 0x020437, 0x021CCC, 0x01E6B4, + 0x018000, 0x012DB5, 0x0146D9, 0x0100CE, 0x00CFD2, 0x006E5C, 0x00B0E4, 0x005A2D, + 0x00E9CC, 0x00B7B1, 0x00846F, 0x006B85, 0x008337, 0x0042E5, 0x004A10, 0x002831, +}, +{ + 0x015555, 0x01F708, 0x023237, 0x030BD0, 0x01D9D9, 0x01C389, 0x03053B, 0x02B7E3, + 0x018000, 0x012DB5, 0x024FCE, 0x01D0FA, 0x00DB5D, 0x006FD5, 0x014048, 0x00AB71, + 0x024957, 0x01E1CC, 0x0240F7, 0x01C551, 0x014BDE, 0x00A92F, 0x013840, 0x009F2F, + 0x024957, 0x032BE4, 0x0227E1, 0x02FD7A, 0x01EAAB, 0x02A893, 0x019247, 0x022DF9, + 0x028116, 0x0240F7, 0x020D99, 0x01ECBC, 0x0120A3, 0x01B061, 0x00A4CE, 0x00E497, + 0x01974B, 0x016E8E, 0x00E6B5, 0x00CFA2, 0x02FCC9, 0x02B04A, 0x02D110, 0x0288F1, + 0x020000, 0x019247, 0x01B3CC, 0x015668, 0x011518, 0x009325, 0x00EBDA, 0x00783D, + 0x0137BB, 0x00F4ED, 0x00B093, 0x008F5C, 0x00AEF4, 0x005931, 0x0062BF, 0x003597, +}, +{ + 0x01AAAB, 0x0274CB, 0x02BEC4, 0x03CEC4, 0x02504F, 0x02346C, 0x03C689, 0x0365DC, + 0x01E000, 0x017922, 0x02E3C1, 0x024539, 0x011235, 0x008BCA, 0x01905A, 0x00D64D, + 0x02DBAD, 0x025A40, 0x02D134, 0x0236A5, 0x019ED6, 0x00D37B, 0x018650, 0x00C6FB, + 0x02DBAD, 0x03F6DD, 0x02B1D9, 0x03BCD8, 0x026555, 0x0352B8, 0x01F6D8, 0x02B977, + 0x03215C, 0x02D134, 0x029100, 0x0267EB, 0x0168CC, 0x021C7A, 0x00CE01, 0x011DBD, + 0x01FD1E, 0x01CA31, 0x012062, 0x01038A, 0x03BBFB, 0x035C5C, 0x038554, 0x032B2D, + 0x028000, 0x01F6D8, 0x0220C0, 0x01AC02, 0x015A5E, 0x00B7EF, 0x0126D1, 0x00964C, + 0x0185A9, 0x013228, 0x00DCB8, 0x00B333, 0x00DAB2, 0x006F7D, 0x007B6F, 0x0042FC, +}, +{ + 0x020000, 0x02F28D, 0x034B52, 0x0491B8, 0x02C6C5, 0x02A54E, 0x0487D8, 0x0413D5, + 0x024000, 0x01C48F, 0x0377B5, 0x02B977, 0x01490C, 0x00A7BF, 0x01E06C, 0x01012A, + 0x036E03, 0x02D2B3, 0x036172, 0x02A7FA, 0x01F1CE, 0x00FDC7, 0x01D460, 0x00EEC7, + 0x036E03, 0x04C1D6, 0x033BD1, 0x047C37, 0x02E000, 0x03FCDD, 0x025B6A, 0x0344F5, + 0x03C1A1, 0x036172, 0x031466, 0x02E31B, 0x01B0F5, 0x028892, 0x00F735, 0x0156E2, + 0x0262F1, 0x0225D5, 0x015A10, 0x013772, 0x047B2D, 0x04086E, 0x043998, 0x03CD69, + 0x030000, 0x025B6A, 0x028DB3, 0x02019B, 0x019FA3, 0x00DCB8, 0x0161C7, 0x00B45B, + 0x01D398, 0x016F63, 0x0108DD, 0x00D70A, 0x01066F, 0x0085C9, 0x00941F, 0x005062, +}, +{ + 0x02AAAB, 0x03EE11, 0x04646D, 0x0617A0, 0x03B3B2, 0x038713, 0x060A75, 0x056FC6, + 0x030000, 0x025B6A, 0x049F9B, 0x03A1F4, 0x01B6BB, 0x00DFAA, 0x028090, 0x0156E2, + 0x0492AE, 0x03C399, 0x0481ED, 0x038AA2, 0x0297BD, 0x01525F, 0x027080, 0x013E5E, + 0x0492AE, 0x0657C8, 0x044FC1, 0x05FAF4, 0x03D555, 0x055126, 0x03248D, 0x045BF2, + 0x05022D, 0x0481ED, 0x041B33, 0x03D979, 0x024147, 0x0360C3, 0x01499C, 0x01C92E, + 0x032E96, 0x02DD1C, 0x01CD6A, 0x019F43, 0x05F991, 0x056093, 0x05A220, 0x0511E1, + 0x040000, 0x03248D, 0x036799, 0x02ACCF, 0x022A2F, 0x01264B, 0x01D7B5, 0x00F079, + 0x026F75, 0x01E9D9, 0x016127, 0x011EB8, 0x015DE9, 0x00B262, 0x00C57F, 0x006B2D, +}, +{ + 0x038000, 0x052876, 0x05C3CF, 0x07FF02, 0x04DBD9, 0x04A148, 0x07EDBA, 0x0722B4, + 0x03F000, 0x0317FB, 0x06117C, 0x04C491, 0x023FD5, 0x01258F, 0x0348BD, 0x01C209, + 0x060085, 0x04F0B9, 0x05EA87, 0x04A5F5, 0x036728, 0x01BC1C, 0x0333A8, 0x01A1DB, + 0x060085, 0x085336, 0x05A8AE, 0x07D960, 0x050800, 0x06FA82, 0x041FF9, 0x05B8AE, + 0x0692DA, 0x05EA87, 0x0563B2, 0x050D6E, 0x02F5AD, 0x046F00, 0x01B09C, 0x02580C, + 0x042D25, 0x03C235, 0x025D9B, 0x022108, 0x07D78F, 0x070EC1, 0x0764CA, 0x06A777, + 0x054000, 0x041FF9, 0x0477F9, 0x0382D0, 0x02D75E, 0x018242, 0x026B1D, 0x013B9F, + 0x03324A, 0x0282ED, 0x01CF83, 0x017851, 0x01CB42, 0x00EA21, 0x010336, 0x008CAC, +}, +{ + 0x040000, 0x05E519, 0x0696A4, 0x092370, 0x058D8A, 0x054A9C, 0x090FB0, 0x0827AA, + 0x048000, 0x03891F, 0x06EF69, 0x0572EE, 0x029218, 0x014F7E, 0x03C0D8, 0x020254, + 0x06DC05, 0x05A565, 0x06C2E4, 0x054FF3, 0x03E39B, 0x01FB8E, 0x03A8C0, 0x01DD8D, + 0x06DC05, 0x0983AC, 0x0677A2, 0x08F86E, 0x05C000, 0x07F9B9, 0x04B6D4, 0x0689EB, + 0x078343, 0x06C2E4, 0x0628CC, 0x05C635, 0x0361EA, 0x051124, 0x01EE69, 0x02ADC5, + 0x04C5E1, 0x044BAA, 0x02B41F, 0x026EE5, 0x08F65A, 0x0810DD, 0x087330, 0x079AD1, + 0x060000, 0x04B6D4, 0x051B65, 0x040337, 0x033F47, 0x01B970, 0x02C38F, 0x0168B6, + 0x03A730, 0x02DEC6, 0x0211BA, 0x01AE14, 0x020CDD, 0x010B93, 0x01283E, 0x00A0C4, +}, +{ + 0x050000, 0x075E60, 0x083C4D, 0x0B6C4C, 0x06F0ED, 0x069D43, 0x0B539C, 0x0A3194, + 0x05A000, 0x046B67, 0x08AB44, 0x06CFAA, 0x03369E, 0x01A35E, 0x04B10F, 0x0282E8, + 0x089307, 0x070EBF, 0x08739C, 0x06A3F0, 0x04DC82, 0x027A72, 0x0492F0, 0x0254F0, + 0x089307, 0x0BE497, 0x08158B, 0x0B3689, 0x073000, 0x09F827, 0x05E489, 0x082C66, + 0x096413, 0x08739C, 0x07B2FF, 0x0737C2, 0x043A64, 0x06556D, 0x026A04, 0x035936, + 0x05F75A, 0x055E94, 0x036127, 0x030A9E, 0x0B33F1, 0x0A1514, 0x0A8FFC, 0x098186, + 0x078000, 0x05E489, 0x06623F, 0x050405, 0x040F19, 0x0227CC, 0x037473, 0x01C2E3, + 0x0490FC, 0x039677, 0x029629, 0x021999, 0x029015, 0x014E78, 0x01724E, 0x00C8F5, +}, +{ + 0x060000, 0x08D7A6, 0x09E1F6, 0x0DB528, 0x085450, 0x07EFEA, 0x0D9788, 0x0C3B7E, + 0x06C000, 0x054DAE, 0x0A671E, 0x082C66, 0x03DB24, 0x01F73E, 0x05A145, 0x03037D, + 0x0A4A08, 0x087818, 0x0A2455, 0x07F7ED, 0x05D569, 0x02F955, 0x057D20, 0x02CC54, + 0x0A4A08, 0x0E4582, 0x09B373, 0x0D74A5, 0x08A000, 0x0BF696, 0x07123E, 0x09CEE0, + 0x0B44E4, 0x0A2455, 0x093D32, 0x08A950, 0x0512DF, 0x0799B6, 0x02E59E, 0x0404A7, + 0x0728D2, 0x06717F, 0x040E2F, 0x03A657, 0x0D7187, 0x0C194B, 0x0CACC8, 0x0B683A, + 0x090000, 0x07123E, 0x07A918, 0x0604D2, 0x04DEEA, 0x029629, 0x042556, 0x021D11, + 0x057AC8, 0x044E28, 0x031A97, 0x02851E, 0x03134C, 0x01915C, 0x01BC5D, 0x00F126, +}, +{ + 0x080000, 0x0BCA33, 0x0D2D48, 0x1246E0, 0x0B1B15, 0x0A9538, 0x121F5F, 0x104F53, + 0x090000, 0x07123E, 0x0DDED2, 0x0AE5DD, 0x052430, 0x029EFD, 0x0781B1, 0x0404A7, + 0x0DB80B, 0x0B4ACB, 0x0D85C7, 0x0A9FE7, 0x07C736, 0x03F71D, 0x075180, 0x03BB1A, + 0x0DB80B, 0x130757, 0x0CEF44, 0x11F0DC, 0x0B8000, 0x0FF372, 0x096DA8, 0x0D13D6, + 0x0F0686, 0x0D85C7, 0x0C5198, 0x0B8C6A, 0x06C3D4, 0x0A2248, 0x03DCD3, 0x055B8A, + 0x098BC3, 0x089754, 0x05683E, 0x04DDC9, 0x11ECB4, 0x1021B9, 0x10E661, 0x0F35A3, + 0x0C0000, 0x096DA8, 0x0A36CB, 0x08066E, 0x067E8E, 0x0372E1, 0x05871E, 0x02D16B, + 0x074E60, 0x05BD8B, 0x042374, 0x035C28, 0x0419BB, 0x021726, 0x02507C, 0x014188, +}, +{ + 0x0C0000, 0x11AF4C, 0x13C3EC, 0x1B6A50, 0x10A89F, 0x0FDFD4, 0x1B2F0F, 0x1876FD, + 0x0D8000, 0x0A9B5D, 0x14CE3C, 0x1058CB, 0x07B649, 0x03EE7B, 0x0B4289, 0x0606FB, + 0x149410, 0x10F030, 0x1448AB, 0x0FEFDA, 0x0BAAD2, 0x05F2AB, 0x0AFA40, 0x0598A7, + 0x149410, 0x1C8B03, 0x1366E6, 0x1AE949, 0x114000, 0x17ED2B, 0x0E247C, 0x139DC1, + 0x1689C8, 0x1448AB, 0x127A63, 0x11529F, 0x0A25BE, 0x0F336D, 0x05CB3C, 0x08094E, + 0x0E51A4, 0x0CE2FE, 0x081C5D, 0x074CAE, 0x1AE30E, 0x183296, 0x195991, 0x16D074, + 0x120000, 0x0E247C, 0x0F5230, 0x0C09A5, 0x09BDD5, 0x052C51, 0x084AAC, 0x043A21, + 0x0AF590, 0x089C51, 0x06352E, 0x050A3B, 0x062698, 0x0322B9, 0x0378BA, 0x01E24D, +}, +{ + 0x110000, 0x190DAC, 0x1C0039, 0x26D69C, 0x17998C, 0x167D16, 0x2682AB, 0x22A891, + 0x132000, 0x0F06C3, 0x1D797F, 0x172876, 0x0AECE7, 0x0591D9, 0x0FF398, 0x0889E3, + 0x1D2717, 0x17FEEF, 0x1CBC47, 0x1693CA, 0x108754, 0x086D1D, 0x0F8D30, 0x07ED98, + 0x1D2717, 0x286F9A, 0x1B7C71, 0x261FD3, 0x187000, 0x21E552, 0x140904, 0x1BCA27, + 0x1FEDDC, 0x1CBC47, 0x1A2D62, 0x188A62, 0x0E6022, 0x1588DA, 0x083540, 0x0B6284, + 0x1448FE, 0x124192, 0x0B7D84, 0x0A574B, 0x2616FF, 0x2247AA, 0x23E98D, 0x2051FA, + 0x198000, 0x140904, 0x15B46F, 0x110DAA, 0x0DCCEE, 0x07541E, 0x0BBF1F, 0x05FD04, + 0x0F868B, 0x0C32C8, 0x08CB57, 0x0723D4, 0x08B6AD, 0x047130, 0x04EB08, 0x02AB42, +}, +{ + 0x160000, 0x206C0C, 0x243C86, 0x3242E8, 0x1E8A79, 0x1D1A59, 0x31D646, 0x2CDA25, + 0x18C000, 0x13722A, 0x2624C3, 0x1DF820, 0x0E2385, 0x073537, 0x14A4A7, 0x0B0CCC, + 0x25BA1D, 0x1F0DAE, 0x252FE4, 0x1D37BB, 0x1563D6, 0x0AE78E, 0x142021, 0x0A4288, + 0x25BA1D, 0x345430, 0x2391FB, 0x31565C, 0x1FA000, 0x2BDD7A, 0x19ED8D, 0x23F68C, + 0x2951EF, 0x252FE4, 0x21E061, 0x1FC224, 0x129A87, 0x1BDE47, 0x0A9F44, 0x0EBBBA, + 0x1A4058, 0x17A026, 0x0EDEAB, 0x0D61E9, 0x314AEF, 0x2C5CBE, 0x2E798A, 0x29D380, + 0x210000, 0x19ED8D, 0x1C16AE, 0x1611AE, 0x11DC06, 0x097BEA, 0x0F3391, 0x07BFE7, + 0x141787, 0x0FC93E, 0x0B617F, 0x093D6D, 0x0B46C1, 0x05BFA8, 0x065D55, 0x037437, +}, +{ + 0x1C0000, 0x2943B2, 0x2E1E7C, 0x3FF810, 0x26DEC9, 0x250A43, 0x3F6DCE, 0x3915A3, + 0x1F8000, 0x18BFD8, 0x308BE1, 0x262485, 0x11FEA9, 0x092C75, 0x1A45EB, 0x0E1049, + 0x300425, 0x2785C6, 0x2F5439, 0x252FA8, 0x1B393F, 0x0DE0E4, 0x199D41, 0x0D0EDC, + 0x300425, 0x4299B2, 0x2D456E, 0x3ECB00, 0x284000, 0x37D40F, 0x20FFCB, 0x2DC56D, + 0x3496D3, 0x2F5439, 0x2B1D93, 0x286B74, 0x17AD66, 0x2377FE, 0x0D84E2, 0x12C062, + 0x21692A, 0x1E11A5, 0x12ECDA, 0x110840, 0x3EBC76, 0x387608, 0x3B2652, 0x353BBA, + 0x2A0000, 0x20FFCB, 0x23BFC6, 0x1C1681, 0x16BAF1, 0x0C1213, 0x1358E8, 0x09DCF8, + 0x19924F, 0x141767, 0x0E7C16, 0x0BC28A, 0x0E5A0D, 0x075104, 0x0819B2, 0x04655D, +}, +{ + 0x220000, 0x321B58, 0x380072, 0x4DAD38, 0x2F3318, 0x2CFA2D, 0x4D0556, 0x455122, + 0x264000, 0x1E0D86, 0x3AF2FE, 0x2E50EB, 0x15D9CE, 0x0B23B2, 0x1FE730, 0x1113C7, + 0x3A4E2D, 0x2FFDDF, 0x39788E, 0x2D2795, 0x210EA8, 0x10DA39, 0x1F1A61, 0x0FDB2F, + 0x3A4E2D, 0x50DF33, 0x36F8E1, 0x4C3FA5, 0x30E000, 0x43CAA5, 0x281209, 0x37944D, + 0x3FDBB7, 0x39788E, 0x345AC4, 0x3114C3, 0x1CC044, 0x2B11B4, 0x106A80, 0x16C509, + 0x2891FC, 0x248324, 0x16FB08, 0x14AE97, 0x4C2DFD, 0x448F54, 0x47D31B, 0x40A3F5, + 0x330000, 0x281209, 0x2B68DF, 0x221B53, 0x1B99DB, 0x0EA83B, 0x177E3E, 0x0BFA09, + 0x1F0D17, 0x18658F, 0x1196AE, 0x0E47A8, 0x116D5A, 0x08E260, 0x09D60F, 0x055684, +}, +{ + 0x2C0000, 0x40D818, 0x48790C, 0x6485D0, 0x3D14F2, 0x3A34B2, 0x63AC8D, 0x59B44A, + 0x318000, 0x26E454, 0x4C4986, 0x3BF03F, 0x1C470A, 0x0E6A6E, 0x29494D, 0x161998, + 0x4B743A, 0x3E1B5C, 0x4A5FC7, 0x3A6F75, 0x2AC7AC, 0x15CF1D, 0x284041, 0x148510, + 0x4B743A, 0x68A861, 0x4723F6, 0x62ACB8, 0x3F4000, 0x57BAF3, 0x33DB1A, 0x47ED19, + 0x52A3DE, 0x4A5FC7, 0x43C0C2, 0x3F8448, 0x25350D, 0x37BC8E, 0x153E87, 0x1D7775, + 0x3480B0, 0x2F404C, 0x1DBD56, 0x1AC3D2, 0x6295DE, 0x58B97B, 0x5CF313, 0x53A701, + 0x420000, 0x33DB1A, 0x382D5C, 0x2C235D, 0x23B80D, 0x12F7D4, 0x1E6723, 0x0F7FCF, + 0x282F0E, 0x1F927D, 0x16C2FF, 0x127AD9, 0x168D83, 0x0B7F50, 0x0CBAAA, 0x06E86E, +}, +}; + +static const uint8_t binkb_runbits[64] = { + 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, 6, 6, 6, 6, 6, 6, + 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, + 4, 4, 4, 4, 4, 4, 4, 4, + 3, 3, 3, 3, 2, 2, 1, 0, +}; + +static const uint8_t binkb_intra_seed[64] = { + 16, 16, 16, 19, 16, 19, 22, 22, + 22, 22, 26, 24, 26, 22, 22, 27, + 27, 27, 26, 26, 26, 29, 29, 29, + 27, 27, 27, 26, 34, 34, 34, 29, + 29, 29, 27, 27, 37, 34, 34, 32, + 32, 29, 29, 38, 37, 35, 35, 34, + 35, 40, 40, 40, 38, 38, 48, 48, + 46, 46, 58, 56, 56, 69, 69, 83, +}; + +static const uint8_t binkb_inter_seed[64] = { + 16, 17, 17, 18, 18, 18, 19, 19, + 19, 19, 20, 20, 20, 20, 20, 21, + 21, 21, 21, 21, 21, 22, 22, 22, + 22, 22, 22, 22, 23, 23, 23, 23, + 23, 23, 23, 23, 24, 24, 24, 25, + 24, 24, 24, 25, 26, 26, 26, 26, + 25, 27, 27, 27, 27, 27, 28, 28, + 28, 28, 30, 30, 30, 31, 31, 33, +}; + +static const uint8_t binkb_num[16] = { + 1, 4, 5, 2, 7, 8, 3, 7, 4, 9, 5, 6, 7, 8, 9, 10 +}; + +static const uint8_t binkb_den[16] = { + 1, 3, 3, 1, 3, 3, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1 +}; + +#endif /* AVCODEC_BINKDATA_H */ diff --git a/include/libavcodec/binkdsp.h b/include/libavcodec/binkdsp.h new file mode 100644 index 0000000..8f084ec --- /dev/null +++ b/include/libavcodec/binkdsp.h @@ -0,0 +1,41 @@ +/* + * Bink DSP routines + * Copyright (c) 2009 Konstantin Shishkov + * + * 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 + */ + +/** + * @file + * Bink DSP routines + */ + +#ifndef AVCODEC_BINKDSP_H +#define AVCODEC_BINKDSP_H + +#include + +typedef struct BinkDSPContext { + void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, int32_t *block/*align 16*/); + void (*idct_add)(uint8_t *dest/*align 8*/, int line_size, int32_t *block/*align 16*/); + void (*scale_block)(const uint8_t src[64]/*align 8*/, uint8_t *dst/*align 8*/, int linesize); + void (*add_pixels8)(uint8_t *restrict pixels, int16_t *block, int line_size); +} BinkDSPContext; + +void ff_binkdsp_init(BinkDSPContext *c); + +#endif /* AVCODEC_BINKDSP_H */ diff --git a/include/libavcodec/bintext.h b/include/libavcodec/bintext.h new file mode 100644 index 0000000..21428ba --- /dev/null +++ b/include/libavcodec/bintext.h @@ -0,0 +1,37 @@ +/* + * Binary text decoder + * Copyright (c) 2010 Peter Ross (pross@xvid.org) + * + * 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 + */ + +/** + * @file + * Binary text decoder + */ + +#ifndef AVCODEC_BINTEXT_H +#define AVCODEC_BINTEXT_H + +/* flag values passed between avformat and avcodec; + * while these are identical to the XBIN flags, they are also used + * for the BINTEXT and IDF decoders. + */ +#define BINTEXT_PALETTE 0x1 +#define BINTEXT_FONT 0x2 + +#endif /* AVCODEC_BINTEXT_H */ diff --git a/include/libavcodec/bitstream.h b/include/libavcodec/bitstream.h new file mode 100644 index 0000000..35b7873 --- /dev/null +++ b/include/libavcodec/bitstream.h @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2016 Alexandra Hájková + * + * 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 + */ + +/** + * @file + * bitstream reader API header. + */ + +/* + * Bit order (endianness) is controlled by #defining BITSTREAM_BE and/or + * BITSTREAM_LE before #including this header. The corresponding bitreading + * functions are provided as bits_*_be()/bits_*_le() respectively. + * + * If neither or only BITSTREAM_BE is defined, then the default (unsuffixed) + * bits_*() will resolve to the big-endian implementation. If only BITSTREAM_LE + * is defined, little-endian will be the default. + * + * If both are defined, then the default can be controlled by defining at most + * one of BITSTREAM_DEFAULT_LE/BE. When BITSTREAM_DEFAULT_* is not defined, no + * default is provided and you must always explicitly use the _be() or _le() + * variants. + */ + +#ifndef AVCODEC_BITSTREAM_H +#define AVCODEC_BITSTREAM_H + +#include + +#include "config.h" + +#include "libavutil/avassert.h" +#include "libavutil/common.h" +#include "libavutil/intreadwrite.h" +#include "libavutil/log.h" + +#include "mathops.h" +#include "vlc.h" + +#ifndef UNCHECKED_BITSTREAM_READER +#define UNCHECKED_BITSTREAM_READER !CONFIG_SAFE_BITSTREAM_READER +#endif + +// select the default endianness, if any +#if defined(BITSTREAM_LE) && defined(BITSTREAM_BE) + +# if defined(BITSTREAM_DEFAULT_BE) && defined(BITSTREAM_DEFAULT_LE) +# error "At most one of BITSTREAM_DEFAULT_BE/LE must be defined" +# elif defined(BITSTREAM_DEFAULT_BE) +# define BITS_DEFAULT_BE +# elif defined(BITSTREAM_DEFAULT_LE) +# define BITS_DEFAULT_LE +# endif + +#elif defined(BITSTREAM_LE) +# define BITS_DEFAULT_LE +#else // select BE if nothing is requested explicitly +# define BITS_DEFAULT_BE +# define BITSTREAM_WANT_BE +#endif + +#if defined(BITS_DEFAULT_LE) + +# define BitstreamContext BitstreamContextLE +# define bits_init bits_init_le +# define bits_init8 bits_init8_le +# define bits_tell bits_tell_le +# define bits_size bits_size_le +# define bits_left bits_left_le +# define bits_read_bit bits_read_bit_le +# define bits_read_nz bits_read_nz_le +# define bits_read bits_read_le +# define bits_read_63 bits_read_63_le +# define bits_read_64 bits_read_64_le +# define bits_read_signed bits_read_signed_le +# define bits_read_signed_nz bits_read_signed_nz_le +# define bits_peek_nz bits_peek_nz_le +# define bits_peek bits_peek_le +# define bits_peek_signed bits_peek_signed_le +# define bits_peek_signed_nz bits_peek_signed_nz_le +# define bits_skip bits_skip_le +# define bits_seek bits_seek_le +# define bits_align bits_align_le +# define bits_read_xbits bits_read_xbits_le +# define bits_decode012 bits_decode012_le +# define bits_decode210 bits_decode210_le +# define bits_apply_sign bits_apply_sign_le +# define bits_read_vlc bits_read_vlc_le +# define bits_read_vlc_multi bits_read_vlc_multi_le + +#elif defined(BITS_DEFAULT_BE) + +# define BitstreamContext BitstreamContextBE +# define bits_init bits_init_be +# define bits_init8 bits_init8_be +# define bits_tell bits_tell_be +# define bits_size bits_size_be +# define bits_left bits_left_be +# define bits_read_bit bits_read_bit_be +# define bits_read_nz bits_read_nz_be +# define bits_read bits_read_be +# define bits_read_63 bits_read_63_be +# define bits_read_64 bits_read_64_be +# define bits_read_signed bits_read_signed_be +# define bits_read_signed_nz bits_read_signed_nz_be +# define bits_peek_nz bits_peek_nz_be +# define bits_peek bits_peek_be +# define bits_peek_signed bits_peek_signed_be +# define bits_peek_signed_nz bits_peek_signed_nz_be +# define bits_skip bits_skip_be +# define bits_seek bits_seek_be +# define bits_align bits_align_be +# define bits_read_xbits bits_read_xbits_be +# define bits_decode012 bits_decode012_be +# define bits_decode210 bits_decode210_be +# define bits_apply_sign bits_apply_sign_be +# define bits_read_vlc bits_read_vlc_be +# define bits_read_vlc_multi bits_read_vlc_multi_be + +#endif + +#undef BITS_DEFAULT_LE +#undef BITS_DEFAULT_BE + +#define BITS_RL_VLC(level, run, bc, table, bits, max_depth) \ + do { \ + int n, nb_bits; \ + unsigned int index = bits_peek(bc, bits); \ + level = table[index].level; \ + n = table[index].len; \ + \ + if (max_depth > 1 && n < 0) { \ + bits_skip(bc, bits); \ + \ + nb_bits = -n; \ + \ + index = bits_peek(bc, nb_bits) + level; \ + level = table[index].level; \ + n = table[index].len; \ + if (max_depth > 2 && n < 0) { \ + bits_skip(bc, nb_bits); \ + nb_bits = -n; \ + \ + index = bits_peek(bc, nb_bits) + level; \ + level = table[index].level; \ + n = table[index].len; \ + } \ + } \ + run = table[index].run; \ + bits_skip(bc, n); \ + } while (0) + +#endif /* AVCODEC_BITSTREAM_H */ + +// the following is deliberately outside of the standard #include guards + +#if defined(BITSTREAM_LE) && !defined(BITSTREAM_WANT_LE) +# define BITSTREAM_WANT_LE +#endif + +#if defined(BITSTREAM_BE) && !defined(BITSTREAM_WANT_BE) +# define BITSTREAM_WANT_BE +#endif + +#if defined(BITSTREAM_WANT_LE) && !defined(AVCODEC_BITSTREAM_LE) +#define AVCODEC_BITSTREAM_LE + +#define BITSTREAM_TEMPLATE_LE +#include "bitstream_template.h" +#undef BITSTREAM_TEMPLATE_LE + +#endif + +#if defined(BITSTREAM_WANT_BE) && !defined(AVCODEC_BITSTREAM_BE) +#define AVCODEC_BITSTREAM_BE + +#include "bitstream_template.h" + +#endif + +#undef BITSTREAM_WANT_LE +#undef BITSTREAM_WANT_BE diff --git a/include/libavcodec/bitstream_template.h b/include/libavcodec/bitstream_template.h new file mode 100644 index 0000000..bbb8dfa --- /dev/null +++ b/include/libavcodec/bitstream_template.h @@ -0,0 +1,574 @@ +/* + * Copyright (c) 2016 Alexandra Hájková + * + * 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 + */ + +#ifdef BITSTREAM_TEMPLATE_LE +# define BS_SUFFIX_LOWER _le +# define BS_SUFFIX_UPPER LE +#else +# define BS_SUFFIX_LOWER _be +# define BS_SUFFIX_UPPER BE +#endif + +#define BS_JOIN(x, y, z) x ## y ## z +#define BS_JOIN3(x, y, z) BS_JOIN(x, y, z) +#define BS_FUNC(x) BS_JOIN3(bits_, x, BS_SUFFIX_LOWER) + +#define BSCTX BS_JOIN3(Bitstream, Context, BS_SUFFIX_UPPER) + +typedef struct BSCTX { + uint64_t bits; // stores bits read from the buffer + const uint8_t *buffer, *buffer_end; + const uint8_t *ptr; // pointer to the position inside a buffer + unsigned bits_valid; // number of bits left in bits field + unsigned size_in_bits; +} BSCTX; + +/** + * @return + * - 0 on successful refill + * - a negative number when bitstream end is hit + * + * Always succeeds when UNCHECKED_BITSTREAM_READER is enabled. + */ +static inline int BS_FUNC(priv_refill_64)(BSCTX *bc) +{ +#if !UNCHECKED_BITSTREAM_READER + if (bc->ptr >= bc->buffer_end) + return -1; +#endif + +#ifdef BITSTREAM_TEMPLATE_LE + bc->bits = AV_RL64(bc->ptr); +#else + bc->bits = AV_RB64(bc->ptr); +#endif + bc->ptr += 8; + bc->bits_valid = 64; + + return 0; +} + +/** + * @return + * - 0 on successful refill + * - a negative number when bitstream end is hit + * + * Always succeeds when UNCHECKED_BITSTREAM_READER is enabled. + */ +static inline int BS_FUNC(priv_refill_32)(BSCTX *bc) +{ +#if !UNCHECKED_BITSTREAM_READER + if (bc->ptr >= bc->buffer_end) + return -1; +#endif + +#ifdef BITSTREAM_TEMPLATE_LE + bc->bits |= (uint64_t)AV_RL32(bc->ptr) << bc->bits_valid; +#else + bc->bits |= (uint64_t)AV_RB32(bc->ptr) << (32 - bc->bits_valid); +#endif + bc->ptr += 4; + bc->bits_valid += 32; + + return 0; +} + +/** + * Initialize BitstreamContext. + * @param buffer bitstream buffer, must be AV_INPUT_BUFFER_PADDING_SIZE bytes + * larger than the actual read bits because some optimized bitstream + * readers read 32 or 64 bits at once and could read over the end + * @param bit_size the size of the buffer in bits + * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow. + */ +static inline int BS_FUNC(init)(BSCTX *bc, const uint8_t *buffer, + unsigned int bit_size) +{ + unsigned int buffer_size; + + if (bit_size > INT_MAX - 7 || !buffer) { + bc->buffer = NULL; + bc->ptr = NULL; + bc->bits_valid = 0; + return AVERROR_INVALIDDATA; + } + + buffer_size = (bit_size + 7) >> 3; + + bc->buffer = buffer; + bc->buffer_end = buffer + buffer_size; + bc->ptr = bc->buffer; + bc->size_in_bits = bit_size; + bc->bits_valid = 0; + bc->bits = 0; + + BS_FUNC(priv_refill_64)(bc); + + return 0; +} + +/** + * Initialize BitstreamContext. + * @param buffer bitstream buffer, must be AV_INPUT_BUFFER_PADDING_SIZE bytes + * larger than the actual read bits because some optimized bitstream + * readers read 32 or 64 bits at once and could read over the end + * @param byte_size the size of the buffer in bytes + * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow + */ +static inline int BS_FUNC(init8)(BSCTX *bc, const uint8_t *buffer, + unsigned int byte_size) +{ + if (byte_size > INT_MAX / 8) + return AVERROR_INVALIDDATA; + return BS_FUNC(init)(bc, buffer, byte_size * 8); +} + +/** + * Return number of bits already read. + */ +static inline int BS_FUNC(tell)(const BSCTX *bc) +{ + return (bc->ptr - bc->buffer) * 8 - bc->bits_valid; +} + +/** + * Return buffer size in bits. + */ +static inline int BS_FUNC(size)(const BSCTX *bc) +{ + return bc->size_in_bits; +} + +/** + * Return the number of the bits left in a buffer. + */ +static inline int BS_FUNC(left)(const BSCTX *bc) +{ + return (bc->buffer - bc->ptr) * 8 + bc->size_in_bits + bc->bits_valid; +} + +static inline uint64_t BS_FUNC(priv_val_show)(BSCTX *bc, unsigned int n) +{ + av_assert2(n > 0 && n <= 64); + +#ifdef BITSTREAM_TEMPLATE_LE + return bc->bits & (UINT64_MAX >> (64 - n)); +#else + return bc->bits >> (64 - n); +#endif +} + +static inline void BS_FUNC(priv_skip_remaining)(BSCTX *bc, unsigned int n) +{ +#ifdef BITSTREAM_TEMPLATE_LE + bc->bits >>= n; +#else + bc->bits <<= n; +#endif + bc->bits_valid -= n; +} + +static inline uint64_t BS_FUNC(priv_val_get)(BSCTX *bc, unsigned int n) +{ + uint64_t ret; + + av_assert2(n > 0 && n < 64); + + ret = BS_FUNC(priv_val_show)(bc, n); + BS_FUNC(priv_skip_remaining)(bc, n); + + return ret; +} + +/** + * Return one bit from the buffer. + */ +static inline unsigned int BS_FUNC(read_bit)(BSCTX *bc) +{ + if (!bc->bits_valid && BS_FUNC(priv_refill_64)(bc) < 0) + return 0; + + return BS_FUNC(priv_val_get)(bc, 1); +} + +/** + * Return n bits from the buffer, n has to be in the 1-32 range. + * May be faster than bits_read() when n is not a compile-time constant and is + * known to be non-zero; + */ +static inline uint32_t BS_FUNC(read_nz)(BSCTX *bc, unsigned int n) +{ + av_assert2(n > 0 && n <= 32); + + if (n > bc->bits_valid) { + if (BS_FUNC(priv_refill_32)(bc) < 0) + bc->bits_valid = n; + } + + return BS_FUNC(priv_val_get)(bc, n); +} + +/** + * Return n bits from the buffer, n has to be in the 0-32 range. + */ +static inline uint32_t BS_FUNC(read)(BSCTX *bc, unsigned int n) +{ + av_assert2(n <= 32); + + if (!n) + return 0; + + return BS_FUNC(read_nz)(bc, n); +} + +/** + * Return n bits from the buffer, n has to be in the 0-63 range. + */ +static inline uint64_t BS_FUNC(read_63)(BSCTX *bc, unsigned int n) +{ + uint64_t ret = 0; + unsigned left = 0; + + av_assert2(n <= 63); + + if (!n) + return 0; + + if (n > bc->bits_valid) { + left = bc->bits_valid; + n -= left; + + if (left) + ret = BS_FUNC(priv_val_get)(bc, left); + + if (BS_FUNC(priv_refill_64)(bc) < 0) + bc->bits_valid = n; + + } + +#ifdef BITSTREAM_TEMPLATE_LE + ret = BS_FUNC(priv_val_get)(bc, n) << left | ret; +#else + ret = BS_FUNC(priv_val_get)(bc, n) | ret << n; +#endif + + return ret; +} + +/** + * Return n bits from the buffer, n has to be in the 0-64 range. + */ +static inline uint64_t BS_FUNC(read_64)(BSCTX *bc, unsigned int n) +{ + av_assert2(n <= 64); + + if (n == 64) { + uint64_t ret = BS_FUNC(read_63)(bc, 63); +#ifdef BITSTREAM_TEMPLATE_LE + return ret | ((uint64_t)BS_FUNC(read_bit)(bc) << 63); +#else + return (ret << 1) | (uint64_t)BS_FUNC(read_bit)(bc); +#endif + } + return BS_FUNC(read_63)(bc, n); +} + +/** + * Return n bits from the buffer as a signed integer, n has to be in the 1-32 + * range. May be faster than bits_read_signed() when n is not a compile-time + * constant and is known to be non-zero; + */ +static inline int32_t BS_FUNC(read_signed_nz)(BSCTX *bc, unsigned int n) +{ + av_assert2(n > 0 && n <= 32); + return sign_extend(BS_FUNC(read_nz)(bc, n), n); +} + +/** + * Return n bits from the buffer as a signed integer. + * n has to be in the 0-32 range. + */ +static inline int32_t BS_FUNC(read_signed)(BSCTX *bc, unsigned int n) +{ + av_assert2(n <= 32); + + if (!n) + return 0; + + return BS_FUNC(read_signed_nz)(bc, n); +} + +/** + * Return n bits from the buffer but do not change the buffer state. + * n has to be in the 1-32 range. May + */ +static inline uint32_t BS_FUNC(peek_nz)(BSCTX *bc, unsigned int n) +{ + av_assert2(n > 0 && n <= 32); + + if (n > bc->bits_valid) + BS_FUNC(priv_refill_32)(bc); + + return BS_FUNC(priv_val_show)(bc, n); +} + +/** + * Return n bits from the buffer but do not change the buffer state. + * n has to be in the 0-32 range. + */ +static inline uint32_t BS_FUNC(peek)(BSCTX *bc, unsigned int n) +{ + av_assert2(n <= 32); + + if (!n) + return 0; + + return BS_FUNC(peek_nz)(bc, n); +} + +/** + * Return n bits from the buffer as a signed integer, do not change the buffer + * state. n has to be in the 1-32 range. May be faster than bits_peek_signed() + * when n is not a compile-time constant and is known to be non-zero; + */ +static inline int BS_FUNC(peek_signed_nz)(BSCTX *bc, unsigned int n) +{ + av_assert2(n > 0 && n <= 32); + return sign_extend(BS_FUNC(peek_nz)(bc, n), n); +} + +/** + * Return n bits from the buffer as a signed integer, + * do not change the buffer state. + * n has to be in the 0-32 range. + */ +static inline int BS_FUNC(peek_signed)(BSCTX *bc, unsigned int n) +{ + av_assert2(n <= 32); + + if (!n) + return 0; + + return BS_FUNC(peek_signed_nz)(bc, n); +} + +/** + * Skip n bits in the buffer. + */ +static inline void BS_FUNC(skip)(BSCTX *bc, unsigned int n) +{ + if (n < bc->bits_valid) + BS_FUNC(priv_skip_remaining)(bc, n); + else { + n -= bc->bits_valid; + bc->bits = 0; + bc->bits_valid = 0; + + if (n >= 64) { + unsigned int skip = n / 8; + + n -= skip * 8; + bc->ptr += skip; + } + BS_FUNC(priv_refill_64)(bc); + if (n) + BS_FUNC(priv_skip_remaining)(bc, n); + } +} + +/** + * Seek to the given bit position. + */ +static inline void BS_FUNC(seek)(BSCTX *bc, unsigned pos) +{ + bc->ptr = bc->buffer; + bc->bits = 0; + bc->bits_valid = 0; + + BS_FUNC(skip)(bc, pos); +} + +/** + * Skip bits to a byte boundary. + */ +static inline const uint8_t *BS_FUNC(align)(BSCTX *bc) +{ + unsigned int n = -BS_FUNC(tell)(bc) & 7; + if (n) + BS_FUNC(skip)(bc, n); + return bc->buffer + (BS_FUNC(tell)(bc) >> 3); +} + +/** + * Read MPEG-1 dc-style VLC (sign bit + mantissa with no MSB). + * If MSB not set it is negative. + * @param n length in bits + */ +static inline int BS_FUNC(read_xbits)(BSCTX *bc, unsigned int n) +{ + int32_t cache = BS_FUNC(peek)(bc, 32); + int sign = ~cache >> 31; + BS_FUNC(priv_skip_remaining)(bc, n); + + return ((((uint32_t)(sign ^ cache)) >> (32 - n)) ^ sign) - sign; +} + +/** + * Return decoded truncated unary code for the values 0, 1, 2. + */ +static inline int BS_FUNC(decode012)(BSCTX *bc) +{ + if (!BS_FUNC(read_bit)(bc)) + return 0; + else + return BS_FUNC(read_bit)(bc) + 1; +} + +/** + * Return decoded truncated unary code for the values 2, 1, 0. + */ +static inline int BS_FUNC(decode210)(BSCTX *bc) +{ + if (BS_FUNC(read_bit)(bc)) + return 0; + else + return 2 - BS_FUNC(read_bit)(bc); +} + +/* Read sign bit and flip the sign of the provided value accordingly. */ +static inline int BS_FUNC(apply_sign)(BSCTX *bc, int val) +{ + int sign = BS_FUNC(read_signed)(bc, 1); + return (val ^ sign) - sign; +} + +static inline int BS_FUNC(skip_1stop_8data)(BSCTX *s) +{ + if (BS_FUNC(left)(s) <= 0) + return AVERROR_INVALIDDATA; + + while (BS_FUNC(read_bit)(s)) { + BS_FUNC(skip)(s, 8); + if (BS_FUNC(left)(s) <= 0) + return AVERROR_INVALIDDATA; + } + + return 0; +} + +/** + * Return the LUT element for the given bitstream configuration. + */ +static inline int BS_FUNC(priv_set_idx)(BSCTX *bc, int code, int *n, + int *nb_bits, const VLCElem *table) +{ + unsigned idx; + + *nb_bits = -*n; + idx = BS_FUNC(peek)(bc, *nb_bits) + code; + *n = table[idx].len; + + return table[idx].sym; +} + +/** + * Parse a vlc code. + * @param bits is the number of bits which will be read at once, must be + * identical to nb_bits in vlc_init() + * @param max_depth is the number of times bits bits must be read to completely + * read the longest vlc code + * = (max_vlc_length + bits - 1) / bits + * If the vlc code is invalid and max_depth=1, then no bits will be removed. + * If the vlc code is invalid and max_depth>1, then the number of bits removed + * is undefined. + */ +static inline int BS_FUNC(read_vlc)(BSCTX *bc, const VLCElem *table, + int bits, int max_depth) +{ + int nb_bits; + unsigned idx = BS_FUNC(peek)(bc, bits); + int code = table[idx].sym; + int n = table[idx].len; + + if (max_depth > 1 && n < 0) { + BS_FUNC(priv_skip_remaining)(bc, bits); + code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); + if (max_depth > 2 && n < 0) { + BS_FUNC(priv_skip_remaining)(bc, nb_bits); + code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); + } + } + BS_FUNC(priv_skip_remaining)(bc, n); + + return code; +} + +/** + * Parse a vlc / vlc_multi code. + * @param bits is the number of bits which will be read at once, must be + * identical to nb_bits in vlc_init() + * @param max_depth is the number of times bits bits must be read to completely + * read the longest vlc code + * = (max_vlc_length + bits - 1) / bits + * @param dst the parsed symbol(s) will be stored here. Up to 8 bytes are written + * @returns number of symbols parsed + * If the vlc code is invalid and max_depth=1, then no bits will be removed. + * If the vlc code is invalid and max_depth>1, then the number of bits removed + * is undefined. + */ +static inline int BS_FUNC(read_vlc_multi)(BSCTX *bc, uint8_t dst[8], + const VLC_MULTI_ELEM *const Jtable, + const VLCElem *const table, + const int bits, const int max_depth, + const int symbols_size) +{ + unsigned idx = BS_FUNC(peek)(bc, bits); + int ret, nb_bits, code, n = Jtable[idx].len; + if (Jtable[idx].num) { + AV_COPY64U(dst, Jtable[idx].val8); + ret = Jtable[idx].num; + } else { + code = table[idx].sym; + n = table[idx].len; + if (max_depth > 1 && n < 0) { + BS_FUNC(priv_skip_remaining)(bc, bits); + code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); + if (max_depth > 2 && n < 0) { + BS_FUNC(priv_skip_remaining)(bc, nb_bits); + code = BS_FUNC(priv_set_idx)(bc, code, &n, &nb_bits, table); + } + } + if (symbols_size == 1) + *dst = code; + else + AV_WN16(dst, code); + ret = n > 0; + } + BS_FUNC(priv_skip_remaining)(bc, n); + + return ret; +} + +#undef BSCTX +#undef BS_FUNC +#undef BS_JOIN3 +#undef BS_JOIN +#undef BS_SUFFIX_UPPER +#undef BS_SUFFIX_LOWER diff --git a/include/libavcodec/blockdsp.h b/include/libavcodec/blockdsp.h new file mode 100644 index 0000000..6d751d7 --- /dev/null +++ b/include/libavcodec/blockdsp.h @@ -0,0 +1,48 @@ +/* + * 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_BLOCKDSP_H +#define AVCODEC_BLOCKDSP_H + +#include +#include + +/* add and put pixel (decoding) + * Block sizes for op_pixels_func are 8x4,8x8 16x8 16x16. + * h for op_pixels_func is limited to { width / 2, width }, + * but never larger than 16 and never smaller than 4. */ +typedef void (*op_fill_func)(uint8_t *block /* align width (8 or 16) */, + uint8_t value, ptrdiff_t line_size, int h); + +typedef struct BlockDSPContext { + void (*clear_block)(int16_t *block /* align 32 */); + void (*clear_blocks)(int16_t *blocks /* align 32 */); + + op_fill_func fill_block_tab[2]; +} BlockDSPContext; + +void ff_blockdsp_init(BlockDSPContext *c); + +void ff_blockdsp_init_alpha(BlockDSPContext *c); +void ff_blockdsp_init_arm(BlockDSPContext *c); +void ff_blockdsp_init_ppc(BlockDSPContext *c); +void ff_blockdsp_init_riscv(BlockDSPContext *c); +void ff_blockdsp_init_x86(BlockDSPContext *c); +void ff_blockdsp_init_mips(BlockDSPContext *c); + +#endif /* AVCODEC_BLOCKDSP_H */ diff --git a/include/libavcodec/bmp.h b/include/libavcodec/bmp.h new file mode 100644 index 0000000..6b8dcb4 --- /dev/null +++ b/include/libavcodec/bmp.h @@ -0,0 +1,32 @@ +/* + * internals for BMP codecs + * Copyright (c) 2005 Mans Rullgard + * + * 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_BMP_H +#define AVCODEC_BMP_H + +typedef enum { + BMP_RGB =0, + BMP_RLE8 =1, + BMP_RLE4 =2, + BMP_BITFIELDS =3, +} BiCompression; + +#endif /* AVCODEC_BMP_H */ diff --git a/include/libavcodec/bsf.h b/include/libavcodec/bsf.h index 69d91a1..a09c69f 100644 --- a/include/libavcodec/bsf.h +++ b/include/libavcodec/bsf.h @@ -164,6 +164,8 @@ int av_bsf_alloc(const AVBitStreamFilter *filter, AVBSFContext **ctx); /** * Prepare the filter for use, after all the parameters and options have been * set. + * + * @param ctx a AVBSFContext previously allocated with av_bsf_alloc() */ int av_bsf_init(AVBSFContext *ctx); @@ -174,6 +176,7 @@ int av_bsf_init(AVBSFContext *ctx); * av_bsf_receive_packet() repeatedly until it returns AVERROR(EAGAIN) or * AVERROR_EOF. * + * @param ctx an initialized AVBSFContext * @param pkt the packet to filter. The bitstream filter will take ownership of * the packet and reset the contents of pkt. pkt is not touched if an error occurs. * If pkt is empty (i.e. NULL, or pkt->data is NULL and pkt->side_data_elems zero), @@ -192,6 +195,7 @@ int av_bsf_send_packet(AVBSFContext *ctx, AVPacket *pkt); /** * Retrieve a filtered packet. * + * @param ctx an initialized AVBSFContext * @param[out] pkt this struct will be filled with the contents of the filtered * packet. It is owned by the caller and must be freed using * av_packet_unref() when it is no longer needed. diff --git a/include/libavcodec/bsf_internal.h b/include/libavcodec/bsf_internal.h new file mode 100644 index 0000000..922b03c --- /dev/null +++ b/include/libavcodec/bsf_internal.h @@ -0,0 +1,60 @@ +/* + * 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_BSF_INTERNAL_H +#define AVCODEC_BSF_INTERNAL_H + +#include "libavutil/log.h" + +#include "bsf.h" +#include "packet.h" + +typedef struct FFBitStreamFilter { + /** + * The public AVBitStreamFilter. See bsf.h for it. + */ + AVBitStreamFilter p; + + int priv_data_size; + int (*init)(AVBSFContext *ctx); + int (*filter)(AVBSFContext *ctx, AVPacket *pkt); + void (*close)(AVBSFContext *ctx); + void (*flush)(AVBSFContext *ctx); +} FFBitStreamFilter; + +/** + * Called by the bitstream filters to get the next packet for filtering. + * The filter is responsible for either freeing the packet or passing it to the + * caller. + */ +int ff_bsf_get_packet(AVBSFContext *ctx, AVPacket **pkt); + +/** + * Called by bitstream filters to get packet for filtering. + * The reference to packet is moved to provided packet structure. + * + * @param ctx pointer to AVBSFContext of filter + * @param pkt pointer to packet to move reference to + * + * @return 0 on success, negative AVERROR in case of failure + */ +int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt); + +const AVClass *ff_bsf_child_class_iterate(void **opaque); + +#endif /* AVCODEC_BSF_INTERNAL_H */ diff --git a/include/libavcodec/bswapdsp.h b/include/libavcodec/bswapdsp.h new file mode 100644 index 0000000..6f4db66 --- /dev/null +++ b/include/libavcodec/bswapdsp.h @@ -0,0 +1,33 @@ +/* + * 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_BSWAPDSP_H +#define AVCODEC_BSWAPDSP_H + +#include + +typedef struct BswapDSPContext { + void (*bswap_buf)(uint32_t *dst, const uint32_t *src, int w); + void (*bswap16_buf)(uint16_t *dst, const uint16_t *src, int len); +} BswapDSPContext; + +void ff_bswapdsp_init(BswapDSPContext *c); +void ff_bswapdsp_init_riscv(BswapDSPContext *c); +void ff_bswapdsp_init_x86(BswapDSPContext *c); + +#endif /* AVCODEC_BSWAPDSP_H */ diff --git a/include/libavcodec/bytestream.h b/include/libavcodec/bytestream.h new file mode 100644 index 0000000..6708060 --- /dev/null +++ b/include/libavcodec/bytestream.h @@ -0,0 +1,380 @@ +/* + * Bytestream functions + * copyright (c) 2006 Baptiste Coudurier + * Copyright (c) 2012 Aneesh Dogra (lionaneesh) + * + * 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_BYTESTREAM_H +#define AVCODEC_BYTESTREAM_H + +#include +#include + +#include "libavutil/avassert.h" +#include "libavutil/common.h" +#include "libavutil/intreadwrite.h" + +typedef struct GetByteContext { + const uint8_t *buffer, *buffer_end, *buffer_start; +} GetByteContext; + +typedef struct PutByteContext { + uint8_t *buffer, *buffer_end, *buffer_start; + int eof; +} PutByteContext; + +#define DEF(type, name, bytes, read, write) \ +static av_always_inline type bytestream_get_ ## name(const uint8_t **b) \ +{ \ + (*b) += bytes; \ + return read(*b - bytes); \ +} \ +static av_always_inline void bytestream_put_ ## name(uint8_t **b, \ + const type value) \ +{ \ + write(*b, value); \ + (*b) += bytes; \ +} \ +static av_always_inline void bytestream2_put_ ## name ## u(PutByteContext *p, \ + const type value) \ +{ \ + bytestream_put_ ## name(&p->buffer, value); \ +} \ +static av_always_inline void bytestream2_put_ ## name(PutByteContext *p, \ + const type value) \ +{ \ + if (!p->eof && (p->buffer_end - p->buffer >= bytes)) { \ + write(p->buffer, value); \ + p->buffer += bytes; \ + } else \ + p->eof = 1; \ +} \ +static av_always_inline type bytestream2_get_ ## name ## u(GetByteContext *g) \ +{ \ + return bytestream_get_ ## name(&g->buffer); \ +} \ +static av_always_inline type bytestream2_get_ ## name(GetByteContext *g) \ +{ \ + if (g->buffer_end - g->buffer < bytes) { \ + g->buffer = g->buffer_end; \ + return 0; \ + } \ + return bytestream2_get_ ## name ## u(g); \ +} \ +static av_always_inline type bytestream2_peek_ ## name ## u(GetByteContext *g) \ +{ \ + return read(g->buffer); \ +} \ +static av_always_inline type bytestream2_peek_ ## name(GetByteContext *g) \ +{ \ + if (g->buffer_end - g->buffer < bytes) \ + return 0; \ + return bytestream2_peek_ ## name ## u(g); \ +} + +DEF(uint64_t, le64, 8, AV_RL64, AV_WL64) +DEF(unsigned int, le32, 4, AV_RL32, AV_WL32) +DEF(unsigned int, le24, 3, AV_RL24, AV_WL24) +DEF(unsigned int, le16, 2, AV_RL16, AV_WL16) +DEF(uint64_t, be64, 8, AV_RB64, AV_WB64) +DEF(unsigned int, be32, 4, AV_RB32, AV_WB32) +DEF(unsigned int, be24, 3, AV_RB24, AV_WB24) +DEF(unsigned int, be16, 2, AV_RB16, AV_WB16) +DEF(unsigned int, byte, 1, AV_RB8 , AV_WB8) + +#if AV_HAVE_BIGENDIAN +# define bytestream2_get_ne16 bytestream2_get_be16 +# define bytestream2_get_ne24 bytestream2_get_be24 +# define bytestream2_get_ne32 bytestream2_get_be32 +# define bytestream2_get_ne64 bytestream2_get_be64 +# define bytestream2_get_ne16u bytestream2_get_be16u +# define bytestream2_get_ne24u bytestream2_get_be24u +# define bytestream2_get_ne32u bytestream2_get_be32u +# define bytestream2_get_ne64u bytestream2_get_be64u +# define bytestream2_put_ne16 bytestream2_put_be16 +# define bytestream2_put_ne24 bytestream2_put_be24 +# define bytestream2_put_ne32 bytestream2_put_be32 +# define bytestream2_put_ne64 bytestream2_put_be64 +# define bytestream2_peek_ne16 bytestream2_peek_be16 +# define bytestream2_peek_ne24 bytestream2_peek_be24 +# define bytestream2_peek_ne32 bytestream2_peek_be32 +# define bytestream2_peek_ne64 bytestream2_peek_be64 +#else +# define bytestream2_get_ne16 bytestream2_get_le16 +# define bytestream2_get_ne24 bytestream2_get_le24 +# define bytestream2_get_ne32 bytestream2_get_le32 +# define bytestream2_get_ne64 bytestream2_get_le64 +# define bytestream2_get_ne16u bytestream2_get_le16u +# define bytestream2_get_ne24u bytestream2_get_le24u +# define bytestream2_get_ne32u bytestream2_get_le32u +# define bytestream2_get_ne64u bytestream2_get_le64u +# define bytestream2_put_ne16 bytestream2_put_le16 +# define bytestream2_put_ne24 bytestream2_put_le24 +# define bytestream2_put_ne32 bytestream2_put_le32 +# define bytestream2_put_ne64 bytestream2_put_le64 +# define bytestream2_peek_ne16 bytestream2_peek_le16 +# define bytestream2_peek_ne24 bytestream2_peek_le24 +# define bytestream2_peek_ne32 bytestream2_peek_le32 +# define bytestream2_peek_ne64 bytestream2_peek_le64 +#endif + +static av_always_inline void bytestream2_init(GetByteContext *g, + const uint8_t *buf, + int buf_size) +{ + av_assert0(buf_size >= 0); + g->buffer = buf; + g->buffer_start = buf; + g->buffer_end = buf + buf_size; +} + +static av_always_inline void bytestream2_init_writer(PutByteContext *p, + uint8_t *buf, + int buf_size) +{ + av_assert0(buf_size >= 0); + p->buffer = buf; + p->buffer_start = buf; + p->buffer_end = buf + buf_size; + p->eof = 0; +} + +static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g) +{ + return g->buffer_end - g->buffer; +} + +static av_always_inline int bytestream2_get_bytes_left_p(PutByteContext *p) +{ + return p->buffer_end - p->buffer; +} + +static av_always_inline void bytestream2_skip(GetByteContext *g, + unsigned int size) +{ + g->buffer += FFMIN(g->buffer_end - g->buffer, size); +} + +static av_always_inline void bytestream2_skipu(GetByteContext *g, + unsigned int size) +{ + g->buffer += size; +} + +static av_always_inline void bytestream2_skip_p(PutByteContext *p, + unsigned int size) +{ + unsigned int size2; + if (p->eof) + return; + size2 = FFMIN(p->buffer_end - p->buffer, size); + if (size2 != size) + p->eof = 1; + p->buffer += size2; +} + +static av_always_inline int bytestream2_tell(GetByteContext *g) +{ + return (int)(g->buffer - g->buffer_start); +} + +static av_always_inline int bytestream2_tell_p(PutByteContext *p) +{ + return (int)(p->buffer - p->buffer_start); +} + +static av_always_inline int bytestream2_size(GetByteContext *g) +{ + return (int)(g->buffer_end - g->buffer_start); +} + +static av_always_inline int bytestream2_size_p(PutByteContext *p) +{ + return (int)(p->buffer_end - p->buffer_start); +} + +static av_always_inline int bytestream2_seek(GetByteContext *g, + int offset, + int whence) +{ + switch (whence) { + case SEEK_CUR: + offset = av_clip(offset, -(g->buffer - g->buffer_start), + g->buffer_end - g->buffer); + g->buffer += offset; + break; + case SEEK_END: + offset = av_clip(offset, -(g->buffer_end - g->buffer_start), 0); + g->buffer = g->buffer_end + offset; + break; + case SEEK_SET: + offset = av_clip(offset, 0, g->buffer_end - g->buffer_start); + g->buffer = g->buffer_start + offset; + break; + default: + return AVERROR(EINVAL); + } + return bytestream2_tell(g); +} + +static av_always_inline int bytestream2_seek_p(PutByteContext *p, + int offset, + int whence) +{ + p->eof = 0; + switch (whence) { + case SEEK_CUR: + if (p->buffer_end - p->buffer < offset) + p->eof = 1; + offset = av_clip(offset, -(p->buffer - p->buffer_start), + p->buffer_end - p->buffer); + p->buffer += offset; + break; + case SEEK_END: + if (offset > 0) + p->eof = 1; + offset = av_clip(offset, -(p->buffer_end - p->buffer_start), 0); + p->buffer = p->buffer_end + offset; + break; + case SEEK_SET: + if (p->buffer_end - p->buffer_start < offset) + p->eof = 1; + offset = av_clip(offset, 0, p->buffer_end - p->buffer_start); + p->buffer = p->buffer_start + offset; + break; + default: + return AVERROR(EINVAL); + } + return bytestream2_tell_p(p); +} + +static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, + uint8_t *dst, + unsigned int size) +{ + unsigned int size2 = FFMIN(g->buffer_end - g->buffer, size); + memcpy(dst, g->buffer, size2); + g->buffer += size2; + return size2; +} + +static av_always_inline unsigned int bytestream2_get_bufferu(GetByteContext *g, + uint8_t *dst, + unsigned int size) +{ + memcpy(dst, g->buffer, size); + g->buffer += size; + return size; +} + +static av_always_inline unsigned int bytestream2_put_buffer(PutByteContext *p, + const uint8_t *src, + unsigned int size) +{ + unsigned int size2; + if (p->eof) + return 0; + size2 = FFMIN(p->buffer_end - p->buffer, size); + if (size2 != size) + p->eof = 1; + memcpy(p->buffer, src, size2); + p->buffer += size2; + return size2; +} + +static av_always_inline unsigned int bytestream2_put_bufferu(PutByteContext *p, + const uint8_t *src, + unsigned int size) +{ + memcpy(p->buffer, src, size); + p->buffer += size; + return size; +} + +static av_always_inline void bytestream2_set_buffer(PutByteContext *p, + const uint8_t c, + unsigned int size) +{ + unsigned int size2; + if (p->eof) + return; + size2 = FFMIN(p->buffer_end - p->buffer, size); + if (size2 != size) + p->eof = 1; + memset(p->buffer, c, size2); + p->buffer += size2; +} + +static av_always_inline void bytestream2_set_bufferu(PutByteContext *p, + const uint8_t c, + unsigned int size) +{ + memset(p->buffer, c, size); + p->buffer += size; +} + +static av_always_inline unsigned int bytestream2_get_eof(PutByteContext *p) +{ + return p->eof; +} + +static av_always_inline unsigned int bytestream2_copy_bufferu(PutByteContext *p, + GetByteContext *g, + unsigned int size) +{ + memcpy(p->buffer, g->buffer, size); + p->buffer += size; + g->buffer += size; + return size; +} + +static av_always_inline unsigned int bytestream2_copy_buffer(PutByteContext *p, + GetByteContext *g, + unsigned int size) +{ + unsigned int size2; + + if (p->eof) + return 0; + size = FFMIN(g->buffer_end - g->buffer, size); + size2 = FFMIN(p->buffer_end - p->buffer, size); + if (size2 != size) + p->eof = 1; + + return bytestream2_copy_bufferu(p, g, size2); +} + +static av_always_inline unsigned int bytestream_get_buffer(const uint8_t **b, + uint8_t *dst, + unsigned int size) +{ + memcpy(dst, *b, size); + (*b) += size; + return size; +} + +static av_always_inline void bytestream_put_buffer(uint8_t **b, + const uint8_t *src, + unsigned int size) +{ + memcpy(*b, src, size); + (*b) += size; +} + +#endif /* AVCODEC_BYTESTREAM_H */ diff --git a/include/libavcodec/cabac.h b/include/libavcodec/cabac.h new file mode 100644 index 0000000..38d06b2 --- /dev/null +++ b/include/libavcodec/cabac.h @@ -0,0 +1,51 @@ +/* + * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder + * Copyright (c) 2003 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * Context Adaptive Binary Arithmetic Coder. + */ + +#ifndef AVCODEC_CABAC_H +#define AVCODEC_CABAC_H + +#include + +extern const uint8_t ff_h264_cabac_tables[512 + 4*2*64 + 4*64 + 63]; +#define H264_NORM_SHIFT_OFFSET 0 +#define H264_LPS_RANGE_OFFSET 512 +#define H264_MLPS_STATE_OFFSET 1024 +#define H264_LAST_COEFF_FLAG_OFFSET_8x8_OFFSET 1280 + +#define CABAC_BITS 16 +#define CABAC_MASK ((1< + * + * 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 + */ + +/** + * @file + * Context Adaptive Binary Arithmetic Coder inline functions + */ + +#ifndef AVCODEC_CABAC_FUNCTIONS_H +#define AVCODEC_CABAC_FUNCTIONS_H + +#include +#include + +#include "libavutil/attributes.h" +#include "libavutil/intmath.h" +#include "cabac.h" +#include "config.h" + +#ifndef UNCHECKED_BITSTREAM_READER +#define UNCHECKED_BITSTREAM_READER !CONFIG_SAFE_BITSTREAM_READER +#endif + +#if ARCH_AARCH64 +# include "aarch64/cabac.h" +#endif +#if ARCH_ARM +# include "arm/cabac.h" +#endif +#if ARCH_X86 +# include "x86/cabac.h" +#endif +#if ARCH_MIPS +# include "mips/cabac.h" +#endif +#if ARCH_LOONGARCH64 +# include "loongarch/cabac.h" +#endif + +static const uint8_t * const ff_h264_norm_shift = ff_h264_cabac_tables + H264_NORM_SHIFT_OFFSET; +static const uint8_t * const ff_h264_lps_range = ff_h264_cabac_tables + H264_LPS_RANGE_OFFSET; +static const uint8_t * const ff_h264_mlps_state = ff_h264_cabac_tables + H264_MLPS_STATE_OFFSET; +static const uint8_t * const ff_h264_last_coeff_flag_offset_8x8 = ff_h264_cabac_tables + H264_LAST_COEFF_FLAG_OFFSET_8x8_OFFSET; + +#if !defined(get_cabac_bypass) || !defined(get_cabac_terminate) +static void refill(CABACContext *c){ +#if CABAC_BITS == 16 + c->low+= (c->bytestream[0]<<9) + (c->bytestream[1]<<1); +#else + c->low+= c->bytestream[0]<<1; +#endif + c->low -= CABAC_MASK; +#if !UNCHECKED_BITSTREAM_READER + if (c->bytestream < c->bytestream_end) +#endif + c->bytestream += CABAC_BITS / 8; +} +#endif + +#ifndef get_cabac_terminate +static inline void renorm_cabac_decoder_once(CABACContext *c){ + int shift= (uint32_t)(c->range - 0x100)>>31; + c->range<<= shift; + c->low <<= shift; + if(!(c->low & CABAC_MASK)) + refill(c); +} +#endif + +#ifndef get_cabac_inline +static void refill2(CABACContext *c){ + int i; + unsigned x; +#if !HAVE_FAST_CLZ + x= c->low ^ (c->low-1); + i= 7 - ff_h264_norm_shift[x>>(CABAC_BITS-1)]; +#else + i = ff_ctz(c->low) - CABAC_BITS; +#endif + + x= -CABAC_MASK; + +#if CABAC_BITS == 16 + x+= (c->bytestream[0]<<9) + (c->bytestream[1]<<1); +#else + x+= c->bytestream[0]<<1; +#endif + + c->low += x<bytestream < c->bytestream_end) +#endif + c->bytestream += CABAC_BITS/8; +} +#endif + +#ifndef get_cabac_inline +static av_always_inline int get_cabac_inline(CABACContext *c, uint8_t * const state){ + int s = *state; + int RangeLPS= ff_h264_lps_range[2*(c->range&0xC0) + s]; + int bit, lps_mask; + + c->range -= RangeLPS; + lps_mask= ((c->range<<(CABAC_BITS+1)) - c->low)>>31; + + c->low -= (c->range<<(CABAC_BITS+1)) & lps_mask; + c->range += (RangeLPS - c->range) & lps_mask; + + s^=lps_mask; + *state= (ff_h264_mlps_state+128)[s]; + bit= s&1; + + lps_mask= ff_h264_norm_shift[c->range]; + c->range<<= lps_mask; + c->low <<= lps_mask; + if(!(c->low & CABAC_MASK)) + refill2(c); + return bit; +} +#endif + +static int av_noinline av_unused get_cabac_noinline(CABACContext *c, uint8_t * const state){ + return get_cabac_inline(c,state); +} + +static int av_unused get_cabac(CABACContext *c, uint8_t * const state){ + return get_cabac_inline(c,state); +} + +#ifndef get_cabac_bypass +static int av_unused get_cabac_bypass(CABACContext *c){ + int range; + c->low += c->low; + + if(!(c->low & CABAC_MASK)) + refill(c); + + range= c->range<<(CABAC_BITS+1); + if(c->low < range){ + return 0; + }else{ + c->low -= range; + return 1; + } +} +#endif + +#ifndef get_cabac_bypass_sign +static av_always_inline int get_cabac_bypass_sign(CABACContext *c, int val){ + int range, mask; + c->low += c->low; + + if(!(c->low & CABAC_MASK)) + refill(c); + + range= c->range<<(CABAC_BITS+1); + c->low -= range; + mask= c->low >> 31; + range &= mask; + c->low += range; + return (val^mask)-mask; +} +#endif + +/** + * @return the number of bytes read or 0 if no end + */ +#ifndef get_cabac_terminate +static int av_unused get_cabac_terminate(CABACContext *c){ + c->range -= 2; + if(c->low < c->range<<(CABAC_BITS+1)){ + renorm_cabac_decoder_once(c); + return 0; + }else{ + return c->bytestream - c->bytestream_start; + } +} +#endif + +/** + * Skip @p n bytes and reset the decoder. + * @return the address of the first skipped byte or NULL if there's less than @p n bytes left + */ +#ifndef skip_bytes +static av_unused const uint8_t* skip_bytes(CABACContext *c, int n) { + const uint8_t *ptr = c->bytestream; + + if (c->low & 0x1) + ptr--; +#if CABAC_BITS == 16 + if (c->low & 0x1FF) + ptr--; +#endif + if ((int) (c->bytestream_end - ptr) < n) + return NULL; + if (ff_init_cabac_decoder(c, ptr + n, c->bytestream_end - ptr - n) < 0) + return NULL; + + return ptr; +} +#endif + +#endif /* AVCODEC_CABAC_FUNCTIONS_H */ diff --git a/include/libavcodec/canopus.h b/include/libavcodec/canopus.h new file mode 100644 index 0000000..faa1e8d --- /dev/null +++ b/include/libavcodec/canopus.h @@ -0,0 +1,32 @@ +/* + * Canopus common routines + * Copyright (c) 2015 Vittorio Giovara + * + * 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_CANOPUS_H +#define AVCODEC_CANOPUS_H + +#include + +#include "avcodec.h" + +int ff_canopus_parse_info_tag(AVCodecContext *avctx, + const uint8_t *src, size_t size); + +#endif /* AVCODEC_CANOPUS_H */ diff --git a/include/libavcodec/cavs.h b/include/libavcodec/cavs.h new file mode 100644 index 0000000..244c322 --- /dev/null +++ b/include/libavcodec/cavs.h @@ -0,0 +1,284 @@ +/* + * Chinese AVS video (AVS1-P2, JiZhun profile) decoder. + * Copyright (c) 2006 Stefan Gehrer + * + * 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_CAVS_H +#define AVCODEC_CAVS_H + +#include +#include + +#include "libavutil/frame.h" +#include "libavutil/mem_internal.h" + +#include "avcodec.h" +#include "cavsdsp.h" +#include "blockdsp.h" +#include "h264chroma.h" +#include "get_bits.h" +#include "videodsp.h" + +#define SLICE_MAX_START_CODE 0x000001af +#define EXT_START_CODE 0x000001b5 +#define USER_START_CODE 0x000001b2 +#define CAVS_START_CODE 0x000001b0 +#define PIC_I_START_CODE 0x000001b3 +#define PIC_PB_START_CODE 0x000001b6 + +#define A_AVAIL 1 +#define B_AVAIL 2 +#define C_AVAIL 4 +#define D_AVAIL 8 +#define NOT_AVAIL -1 +#define REF_INTRA -2 +#define REF_DIR -3 + +#define ESCAPE_CODE 59 + +#define FWD0 0x01 +#define FWD1 0x02 +#define BWD0 0x04 +#define BWD1 0x08 +#define SYM0 0x10 +#define SYM1 0x20 +#define SPLITH 0x40 +#define SPLITV 0x80 + +#define MV_BWD_OFFS 12 +#define MV_STRIDE 4 + +enum cavs_mb { + I_8X8 = 0, + P_SKIP, + P_16X16, + P_16X8, + P_8X16, + P_8X8, + B_SKIP, + B_DIRECT, + B_FWD_16X16, + B_BWD_16X16, + B_SYM_16X16, + B_8X8 = 29 +}; + +enum cavs_sub_mb { + B_SUB_DIRECT, + B_SUB_FWD, + B_SUB_BWD, + B_SUB_SYM +}; + +enum cavs_intra_luma { + INTRA_L_VERT, + INTRA_L_HORIZ, + INTRA_L_LP, + INTRA_L_DOWN_LEFT, + INTRA_L_DOWN_RIGHT, + INTRA_L_LP_LEFT, + INTRA_L_LP_TOP, + INTRA_L_DC_128 +}; + +enum cavs_intra_chroma { + INTRA_C_LP, + INTRA_C_HORIZ, + INTRA_C_VERT, + INTRA_C_PLANE, + INTRA_C_LP_LEFT, + INTRA_C_LP_TOP, + INTRA_C_DC_128, +}; + +enum cavs_mv_pred { + MV_PRED_MEDIAN, + MV_PRED_LEFT, + MV_PRED_TOP, + MV_PRED_TOPRIGHT, + MV_PRED_PSKIP, + MV_PRED_BSKIP +}; + +enum cavs_block { + BLK_16X16, + BLK_16X8, + BLK_8X16, + BLK_8X8 +}; + +enum cavs_mv_loc { + MV_FWD_D3 = 0, + MV_FWD_B2, + MV_FWD_B3, + MV_FWD_C2, + MV_FWD_A1, + MV_FWD_X0, + MV_FWD_X1, + MV_FWD_A3 = 8, + MV_FWD_X2, + MV_FWD_X3, + MV_BWD_D3 = MV_BWD_OFFS, + MV_BWD_B2, + MV_BWD_B3, + MV_BWD_C2, + MV_BWD_A1, + MV_BWD_X0, + MV_BWD_X1, + MV_BWD_A3 = MV_BWD_OFFS+8, + MV_BWD_X2, + MV_BWD_X3 +}; + +DECLARE_ALIGNED(8, typedef, struct) { + int16_t x; + int16_t y; + int16_t dist; + int16_t ref; +} cavs_vector; + +struct dec_2dvlc { + int8_t rltab[59][3]; + int8_t level_add[27]; + int8_t golomb_order; + int inc_limit; + int8_t max_run; +}; + +typedef struct AVSFrame { + AVFrame *f; + int poc; +} AVSFrame; + +typedef struct AVSContext { + AVCodecContext *avctx; + BlockDSPContext bdsp; + H264ChromaContext h264chroma; + VideoDSPContext vdsp; + CAVSDSPContext cdsp; + GetBitContext gb; + AVSFrame cur; ///< currently decoded frame + AVSFrame DPB[2]; ///< reference frames + int dist[2]; ///< temporal distances from current frame to ref frames + int low_delay; + int profile, level; + int aspect_ratio; + int mb_width, mb_height; + int width, height; + int stream_revision; ///<0 for samples from 2006, 1 for rm52j encoder + int progressive; + int pic_structure; + int skip_mode_flag; ///< select between skip_count or one skip_flag per MB + int loop_filter_disable; + int alpha_offset, beta_offset; + int ref_flag; + int mbx, mby, mbidx; ///< macroblock coordinates + int flags; ///< availability flags of neighbouring macroblocks + int stc; ///< last start code + uint8_t *cy, *cu, *cv; ///< current MB sample pointers + int left_qp; + uint8_t *top_qp; + + /** mv motion vector cache + 0: D3 B2 B3 C2 + 4: A1 X0 X1 - + 8: A3 X2 X3 - + + X are the vectors in the current macroblock (5,6,9,10) + A is the macroblock to the left (4,8) + B is the macroblock to the top (1,2) + C is the macroblock to the top-right (3) + D is the macroblock to the top-left (0) + + the same is repeated for backward motion vectors */ + cavs_vector mv[2*4*3]; + cavs_vector *top_mv[2]; + cavs_vector *col_mv; + + /** luma pred mode cache + 0: -- B2 B3 + 3: A1 X0 X1 + 6: A3 X2 X3 */ + int pred_mode_Y[3*3]; + int *top_pred_Y; + ptrdiff_t l_stride, c_stride; + int luma_scan[4]; + int qp; + int qp_fixed; + int pic_qp_fixed; + int cbp; + uint8_t permutated_scantable[64]; + + /** intra prediction is done with un-deblocked samples + they are saved here before deblocking the MB */ + uint8_t *top_border_y, *top_border_u, *top_border_v; + uint8_t left_border_y[26], left_border_u[10], left_border_v[10]; + uint8_t intern_border_y[26]; + uint8_t topleft_border_y, topleft_border_u, topleft_border_v; + + void (*intra_pred_l[8])(uint8_t *d, uint8_t *top, uint8_t *left, ptrdiff_t stride); + void (*intra_pred_c[7])(uint8_t *d, uint8_t *top, uint8_t *left, ptrdiff_t stride); + uint8_t *col_type_base; + + /* scaling factors for MV prediction */ + int sym_factor; ///< for scaling in symmetrical B block + int direct_den[2]; ///< for scaling in direct B block + int scale_den[2]; ///< for scaling neighbouring MVs + + uint8_t *edge_emu_buffer; + + int got_keyframe; + int16_t *block; +} AVSContext; + +extern const uint8_t ff_cavs_chroma_qp[64]; +extern const uint8_t ff_cavs_partition_flags[30]; +extern const cavs_vector ff_cavs_intra_mv; +extern const cavs_vector ff_cavs_dir_mv; + +static inline void set_mvs(cavs_vector *mv, enum cavs_block size) { + switch(size) { + case BLK_16X16: + mv[MV_STRIDE ] = mv[0]; + mv[MV_STRIDE+1] = mv[0]; + case BLK_16X8: + mv[1] = mv[0]; + break; + case BLK_8X16: + mv[MV_STRIDE] = mv[0]; + break; + } +} + +void ff_cavs_filter(AVSContext *h, enum cavs_mb mb_type); +void ff_cavs_load_intra_pred_luma(AVSContext *h, uint8_t *top, uint8_t **left, + int block); +void ff_cavs_load_intra_pred_chroma(AVSContext *h); +void ff_cavs_modify_mb_i(AVSContext *h, int *pred_mode_uv); +void ff_cavs_inter(AVSContext *h, enum cavs_mb mb_type); +void ff_cavs_mv(AVSContext *h, enum cavs_mv_loc nP, enum cavs_mv_loc nC, + enum cavs_mv_pred mode, enum cavs_block size, int ref); +void ff_cavs_init_mb(AVSContext *h); +int ff_cavs_next_mb(AVSContext *h); +int ff_cavs_init_pic(AVSContext *h); +int ff_cavs_init_top_lines(AVSContext *h); +int ff_cavs_init(AVCodecContext *avctx); +int ff_cavs_end (AVCodecContext *avctx); + +#endif /* AVCODEC_CAVS_H */ diff --git a/include/libavcodec/cavsdsp.h b/include/libavcodec/cavsdsp.h new file mode 100644 index 0000000..2cd9298 --- /dev/null +++ b/include/libavcodec/cavsdsp.h @@ -0,0 +1,44 @@ +/* + * Chinese AVS video (AVS1-P2, JiZhun profile) decoder. + * Copyright (c) 2006 Stefan Gehrer + * + * 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_CAVSDSP_H +#define AVCODEC_CAVSDSP_H + +#include +#include + +#include "qpeldsp.h" + +typedef struct CAVSDSPContext { + qpel_mc_func put_cavs_qpel_pixels_tab[2][16]; + qpel_mc_func avg_cavs_qpel_pixels_tab[2][16]; + void (*cavs_filter_lv)(uint8_t *pix, ptrdiff_t stride, int alpha, int beta, int tc, int bs1, int bs2); + void (*cavs_filter_lh)(uint8_t *pix, ptrdiff_t stride, int alpha, int beta, int tc, int bs1, int bs2); + void (*cavs_filter_cv)(uint8_t *pix, ptrdiff_t stride, int alpha, int beta, int tc, int bs1, int bs2); + void (*cavs_filter_ch)(uint8_t *pix, ptrdiff_t stride, int alpha, int beta, int tc, int bs1, int bs2); + void (*cavs_idct8_add)(uint8_t *dst, int16_t *block, ptrdiff_t stride); + int idct_perm; +} CAVSDSPContext; + +void ff_cavsdsp_init(CAVSDSPContext* c); +void ff_cavsdsp_init_x86(CAVSDSPContext* c); + +#endif /* AVCODEC_CAVSDSP_H */ diff --git a/include/libavcodec/cbrt_data.h b/include/libavcodec/cbrt_data.h new file mode 100644 index 0000000..89117f8 --- /dev/null +++ b/include/libavcodec/cbrt_data.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2016 Reimar Döffinger + * + * 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_CBRT_DATA_H +#define AVCODEC_CBRT_DATA_H + +#include + +#include "config.h" + +#if CONFIG_HARDCODED_TABLES +#define ff_cbrt_tableinit_fixed() +#define ff_cbrt_tableinit() +extern const uint32_t ff_cbrt_tab[1 << 13]; +extern const uint32_t ff_cbrt_tab_fixed[1 << 13]; +#else +void ff_cbrt_tableinit(void); +void ff_cbrt_tableinit_fixed(void); +extern uint32_t ff_cbrt_tab[1 << 13]; +extern uint32_t ff_cbrt_tab_fixed[1 << 13]; +#endif + +#endif diff --git a/include/libavcodec/cbrt_tablegen.h b/include/libavcodec/cbrt_tablegen.h new file mode 100644 index 0000000..9af18d8 --- /dev/null +++ b/include/libavcodec/cbrt_tablegen.h @@ -0,0 +1,73 @@ +/* + * Header file for hardcoded AAC cube-root table + * + * Copyright (c) 2010 Reimar Döffinger + * + * 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_CBRT_TABLEGEN_H +#define AVCODEC_CBRT_TABLEGEN_H + +#include +#include +#include "libavutil/attributes.h" +#include "libavutil/intfloat.h" +#include "libavcodec/aac_defines.h" + +#if USE_FIXED +#define CBRT(x) lrint((x) * 8192) +#else +#define CBRT(x) av_float2int((float)(x)) +#endif + +uint32_t AAC_RENAME(ff_cbrt_tab)[1 << 13]; + +av_cold void AAC_RENAME(ff_cbrt_tableinit)(void) +{ + static double cbrt_tab_dbl[1 << 13]; + if (!AAC_RENAME(ff_cbrt_tab)[(1<<13) - 1]) { + int i, j, k; + double cbrt_val; + + for (i = 1; i < 1<<13; i++) + cbrt_tab_dbl[i] = 1; + + /* have to take care of non-squarefree numbers */ + for (i = 2; i < 90; i++) { + if (cbrt_tab_dbl[i] == 1) { + cbrt_val = i * cbrt(i); + for (k = i; k < 1<<13; k *= i) + for (j = k; j < 1<<13; j += k) + cbrt_tab_dbl[j] *= cbrt_val; + } + } + + for (i = 91; i <= 8191; i+= 2) { + if (cbrt_tab_dbl[i] == 1) { + cbrt_val = i * cbrt(i); + for (j = i; j < 1<<13; j += i) + cbrt_tab_dbl[j] *= cbrt_val; + } + } + + for (i = 0; i < 1<<13; i++) + AAC_RENAME(ff_cbrt_tab)[i] = CBRT(cbrt_tab_dbl[i]); + } +} + +#endif /* AVCODEC_CBRT_TABLEGEN_H */ diff --git a/include/libavcodec/cbs.h b/include/libavcodec/cbs.h new file mode 100644 index 0000000..d479b1a --- /dev/null +++ b/include/libavcodec/cbs.h @@ -0,0 +1,541 @@ +/* + * 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_CBS_H +#define AVCODEC_CBS_H + +#include +#include + +#include "libavutil/buffer.h" + +#include "codec_id.h" +#include "codec_par.h" +#include "defs.h" +#include "packet.h" + + +/* + * This defines a framework for converting between a coded bitstream + * and structures defining all individual syntax elements found in + * such a stream. + * + * Conversion in both directions is possible. Given a coded bitstream + * (any meaningful fragment), it can be parsed and decomposed into + * syntax elements stored in a set of codec-specific structures. + * Similarly, given a set of those same codec-specific structures the + * syntax elements can be serialised and combined to create a coded + * bitstream. + */ + +struct AVCodecContext; +struct CodedBitstreamType; + +/** + * The codec-specific type of a bitstream unit. + * + * AV1: obu_type + * H.264 / AVC: nal_unit_type + * H.265 / HEVC: nal_unit_type + * JPEG: marker value (without 0xff prefix) + * MPEG-2: start code value (without prefix) + * VP9: unused, set to zero (every unit is a frame) + */ +typedef uint32_t CodedBitstreamUnitType; + +/** + * Coded bitstream unit structure. + * + * A bitstream unit the smallest element of a bitstream which + * is meaningful on its own. For example, an H.264 NAL unit. + * + * See the codec-specific header for the meaning of this for any + * particular codec. + */ +typedef struct CodedBitstreamUnit { + /** + * Codec-specific type of this unit. + */ + CodedBitstreamUnitType type; + + /** + * Pointer to the directly-parsable bitstream form of this unit. + * + * May be NULL if the unit currently only exists in decomposed form. + */ + uint8_t *data; + /** + * The number of bytes in the bitstream (including any padding bits + * in the final byte). + */ + size_t data_size; + /** + * The number of bits which should be ignored in the final byte. + * + * This supports non-byte-aligned bitstreams. + */ + size_t data_bit_padding; + /** + * A reference to the buffer containing data. + * + * Must be set if data is not NULL. + */ + AVBufferRef *data_ref; + + /** + * Pointer to the decomposed form of this unit. + * + * The type of this structure depends on both the codec and the + * type of this unit. May be NULL if the unit only exists in + * bitstream form. + */ + void *content; + /** + * If content is reference counted, a RefStruct reference backing content. + * NULL if content is not reference counted. + */ + void *content_ref; +} CodedBitstreamUnit; + +/** + * Coded bitstream fragment structure, combining one or more units. + * + * This is any sequence of units. It need not form some greater whole, + * though in many cases it will. For example, an H.264 access unit, + * which is composed of a sequence of H.264 NAL units. + */ +typedef struct CodedBitstreamFragment { + /** + * Pointer to the bitstream form of this fragment. + * + * May be NULL if the fragment only exists as component units. + */ + uint8_t *data; + /** + * The number of bytes in the bitstream. + * + * The number of bytes in the bitstream (including any padding bits + * in the final byte). + */ + size_t data_size; + /** + * The number of bits which should be ignored in the final byte. + */ + size_t data_bit_padding; + /** + * A reference to the buffer containing data. + * + * Must be set if data is not NULL. + */ + AVBufferRef *data_ref; + + /** + * Number of units in this fragment. + * + * This may be zero if the fragment only exists in bitstream form + * and has not been decomposed. + */ + int nb_units; + + /** + * Number of allocated units. + * + * Must always be >= nb_units; designed for internal use by cbs. + */ + int nb_units_allocated; + + /** + * Pointer to an array of units of length nb_units_allocated. + * Only the first nb_units are valid. + * + * Must be NULL if nb_units_allocated is zero. + */ + CodedBitstreamUnit *units; +} CodedBitstreamFragment; + + +struct CodedBitstreamContext; +struct GetBitContext; +struct PutBitContext; + +/** + * Callback type for read tracing. + * + * @param ctx User-set trace context. + * @param gbc A GetBitContext set at the start of the syntax + * element. This is a copy, the callee does not + * need to preserve it. + * @param length Length in bits of the syntax element. + * @param name String name of the syntax elements. + * @param subscripts If the syntax element is an array, a pointer to + * an array of subscripts into the array. + * @param value Parsed value of the syntax element. + */ +typedef void (*CBSTraceReadCallback)(void *trace_context, + struct GetBitContext *gbc, + int start_position, + const char *name, + const int *subscripts, + int64_t value); + +/** + * Callback type for write tracing. + * + * @param ctx User-set trace context. + * @param pbc A PutBitContext set at the end of the syntax + * element. The user must not modify this, but may + * inspect it to determine state. + * @param length Length in bits of the syntax element. + * @param name String name of the syntax elements. + * @param subscripts If the syntax element is an array, a pointer to + * an array of subscripts into the array. + * @param value Written value of the syntax element. + */ +typedef void (*CBSTraceWriteCallback)(void *trace_context, + struct PutBitContext *pbc, + int start_position, + const char *name, + const int *subscripts, + int64_t value); + +/** + * Context structure for coded bitstream operations. + */ +typedef struct CodedBitstreamContext { + /** + * Logging context to be passed to all av_log() calls associated + * with this context. + */ + void *log_ctx; + + /** + * Internal codec-specific hooks. + */ + const struct CodedBitstreamType *codec; + + /** + * Internal codec-specific data. + * + * This contains any information needed when reading/writing + * bitsteams which will not necessarily be present in a fragment. + * For example, for H.264 it contains all currently visible + * parameter sets - they are required to determine the bitstream + * syntax but need not be present in every access unit. + */ + void *priv_data; + + /** + * Array of unit types which should be decomposed when reading. + * + * Types not in this list will be available in bitstream form only. + * If NULL, all supported types will be decomposed. + */ + const CodedBitstreamUnitType *decompose_unit_types; + /** + * Length of the decompose_unit_types array. + */ + int nb_decompose_unit_types; + + /** + * Enable trace output during read/write operations. + */ + int trace_enable; + /** + * Log level to use for default trace output. + * + * From AV_LOG_*; defaults to AV_LOG_TRACE. + */ + int trace_level; + /** + * User context pointer to pass to trace callbacks. + */ + void *trace_context; + /** + * Callback for read tracing. + * + * If tracing is enabled then this is called once for each syntax + * element parsed. + */ + CBSTraceReadCallback trace_read_callback; + /** + * Callback for write tracing. + * + * If tracing is enabled then this is called once for each syntax + * element written. + */ + CBSTraceWriteCallback trace_write_callback; + + /** + * Write buffer. Used as intermediate buffer when writing units. + * For internal use of cbs only. + */ + uint8_t *write_buffer; + size_t write_buffer_size; +} CodedBitstreamContext; + + +/** + * Table of all supported codec IDs. + * + * Terminated by AV_CODEC_ID_NONE. + */ +extern const enum AVCodecID ff_cbs_all_codec_ids[]; + + +/** + * Create and initialise a new context for the given codec. + */ +int ff_cbs_init(CodedBitstreamContext **ctx, + enum AVCodecID codec_id, void *log_ctx); + +/** + * Reset all internal state in a context. + */ +void ff_cbs_flush(CodedBitstreamContext *ctx); + +/** + * Close a context and free all internal state. + */ +void ff_cbs_close(CodedBitstreamContext **ctx); + + +/** + * Read the extradata bitstream found in codec parameters into a + * fragment, then split into units and decompose. + * + * This also updates the internal state, so will need to be called for + * codecs with extradata to read parameter sets necessary for further + * parsing even if the fragment itself is not desired. + * + * The fragment must have been zeroed or reset via ff_cbs_fragment_reset + * before use. + */ +int ff_cbs_read_extradata(CodedBitstreamContext *ctx, + CodedBitstreamFragment *frag, + const AVCodecParameters *par); + +/** + * Read the extradata bitstream found in a codec context into a + * fragment, then split into units and decompose. + * + * This acts identical to ff_cbs_read_extradata() for the case where + * you already have a codec context. + */ +int ff_cbs_read_extradata_from_codec(CodedBitstreamContext *ctx, + CodedBitstreamFragment *frag, + const struct AVCodecContext *avctx); + +int ff_cbs_read_packet_side_data(CodedBitstreamContext *ctx, + CodedBitstreamFragment *frag, + const AVPacket *pkt); + +/** + * Read the data bitstream from a packet into a fragment, then + * split into units and decompose. + * + * This also updates the internal state of the coded bitstream context + * with any persistent data from the fragment which may be required to + * read following fragments (e.g. parameter sets). + * + * The fragment must have been zeroed or reset via ff_cbs_fragment_reset + * before use. + */ +int ff_cbs_read_packet(CodedBitstreamContext *ctx, + CodedBitstreamFragment *frag, + const AVPacket *pkt); + +/** + * Read a bitstream from a memory region into a fragment, then + * split into units and decompose. + * + * This also updates the internal state of the coded bitstream context + * with any persistent data from the fragment which may be required to + * read following fragments (e.g. parameter sets). + * + * The fragment must have been zeroed or reset via ff_cbs_fragment_reset + * before use. + */ +int ff_cbs_read(CodedBitstreamContext *ctx, + CodedBitstreamFragment *frag, + const uint8_t *data, size_t size); + + +/** + * Write the content of the fragment to its own internal buffer. + * + * Writes the content of all units and then assembles them into a new + * data buffer. When modifying the content of decomposed units, this + * can be used to regenerate the bitstream form of units or the whole + * fragment so that it can be extracted for other use. + * + * This also updates the internal state of the coded bitstream context + * with any persistent data from the fragment which may be required to + * write following fragments (e.g. parameter sets). + */ +int ff_cbs_write_fragment_data(CodedBitstreamContext *ctx, + CodedBitstreamFragment *frag); + +/** + * Write the bitstream of a fragment to the extradata in codec parameters. + * + * Modifies context and fragment as ff_cbs_write_fragment_data does and + * replaces any existing extradata in the structure. + */ +int ff_cbs_write_extradata(CodedBitstreamContext *ctx, + AVCodecParameters *par, + CodedBitstreamFragment *frag); + +/** + * Write the bitstream of a fragment to a packet. + * + * Modifies context and fragment as ff_cbs_write_fragment_data does. + * + * On success, the packet's buf is unreferenced and its buf, data and + * size fields are set to the corresponding values from the newly updated + * fragment; other fields are not touched. On failure, the packet is not + * touched at all. + */ +int ff_cbs_write_packet(CodedBitstreamContext *ctx, + AVPacket *pkt, + CodedBitstreamFragment *frag); + + +/** + * Free the units contained in a fragment as well as the fragment's + * own data buffer, but not the units array itself. + */ +void ff_cbs_fragment_reset(CodedBitstreamFragment *frag); + +/** + * Free the units array of a fragment in addition to what + * ff_cbs_fragment_reset does. + */ +void ff_cbs_fragment_free(CodedBitstreamFragment *frag); + +/** + * Allocate a new internal content buffer matching the type of the unit. + * + * The content will be zeroed. + */ +int ff_cbs_alloc_unit_content(CodedBitstreamContext *ctx, + CodedBitstreamUnit *unit); + +/** + * Insert a new unit into a fragment with the given content. + * + * If content_ref is supplied, it has to be a RefStruct reference + * backing content; the user keeps ownership of the supplied reference. + * The content structure continues to be owned by the caller if + * content_ref is not supplied. + */ +int ff_cbs_insert_unit_content(CodedBitstreamFragment *frag, + int position, + CodedBitstreamUnitType type, + void *content, + void *content_ref); + +/** + * Add a new unit to a fragment with the given data bitstream. + * + * If data_buf is not supplied then data must have been allocated with + * av_malloc() and will on success become owned by the unit after this + * call or freed on error. + */ +int ff_cbs_append_unit_data(CodedBitstreamFragment *frag, + CodedBitstreamUnitType type, + uint8_t *data, size_t data_size, + AVBufferRef *data_buf); + +/** + * Delete a unit from a fragment and free all memory it uses. + * + * Requires position to be >= 0 and < frag->nb_units. + */ +void ff_cbs_delete_unit(CodedBitstreamFragment *frag, + int position); + + +/** + * Make the content of a unit refcounted. + * + * If the unit is not refcounted, this will do a deep copy of the unit + * content to new refcounted buffers. + * + * It is not valid to call this function on a unit which does not have + * decomposed content. + */ +int ff_cbs_make_unit_refcounted(CodedBitstreamContext *ctx, + CodedBitstreamUnit *unit); + +/** + * Make the content of a unit writable so that internal fields can be + * modified. + * + * If it is known that there are no other references to the content of + * the unit, does nothing and returns success. Otherwise (including the + * case where the unit content is not refcounted), it does a full clone + * of the content (including any internal buffers) to make a new copy, + * and replaces the existing references inside the unit with that. + * + * It is not valid to call this function on a unit which does not have + * decomposed content. + */ +int ff_cbs_make_unit_writable(CodedBitstreamContext *ctx, + CodedBitstreamUnit *unit); + +enum CbsDiscardFlags { + DISCARD_FLAG_NONE = 0, + + /** + * keep non-vcl units even if the picture has been dropped. + */ + DISCARD_FLAG_KEEP_NON_VCL = 0x01, +}; + +/** + * Discard units accroding to 'skip'. + */ +void ff_cbs_discard_units(CodedBitstreamContext *ctx, + CodedBitstreamFragment *frag, + enum AVDiscard skip, + int flags); + + +/** + * Helper function for read tracing which formats the syntax element + * and logs the result. + * + * Trace context should be set to the CodedBitstreamContext. + */ +void ff_cbs_trace_read_log(void *trace_context, + struct GetBitContext *gbc, int length, + const char *str, const int *subscripts, + int64_t value); + +/** + * Helper function for write tracing which formats the syntax element + * and logs the result. + * + * Trace context should be set to the CodedBitstreamContext. + */ +void ff_cbs_trace_write_log(void *trace_context, + struct PutBitContext *pbc, int length, + const char *str, const int *subscripts, + int64_t value); + +#endif /* AVCODEC_CBS_H */ diff --git a/include/libavcodec/cbs_av1.h b/include/libavcodec/cbs_av1.h new file mode 100644 index 0000000..8586f2b --- /dev/null +++ b/include/libavcodec/cbs_av1.h @@ -0,0 +1,488 @@ +/* + * 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_CBS_AV1_H +#define AVCODEC_CBS_AV1_H + +#include +#include + +#include "av1.h" +#include "cbs.h" + + +typedef struct AV1RawOBUHeader { + uint8_t obu_forbidden_bit; + uint8_t obu_type; + uint8_t obu_extension_flag; + uint8_t obu_has_size_field; + uint8_t obu_reserved_1bit; + + uint8_t temporal_id; + uint8_t spatial_id; + uint8_t extension_header_reserved_3bits; +} AV1RawOBUHeader; + +typedef struct AV1RawColorConfig { + uint8_t high_bitdepth; + uint8_t twelve_bit; + uint8_t mono_chrome; + + uint8_t color_description_present_flag; + uint8_t color_primaries; + uint8_t transfer_characteristics; + uint8_t matrix_coefficients; + + uint8_t color_range; + uint8_t subsampling_x; + uint8_t subsampling_y; + uint8_t chroma_sample_position; + uint8_t separate_uv_delta_q; +} AV1RawColorConfig; + +typedef struct AV1RawTimingInfo { + uint32_t num_units_in_display_tick; + uint32_t time_scale; + + uint8_t equal_picture_interval; + uint32_t num_ticks_per_picture_minus_1; +} AV1RawTimingInfo; + +typedef struct AV1RawDecoderModelInfo { + uint8_t buffer_delay_length_minus_1; + uint32_t num_units_in_decoding_tick; + uint8_t buffer_removal_time_length_minus_1; + uint8_t frame_presentation_time_length_minus_1; +} AV1RawDecoderModelInfo; + +typedef struct AV1RawSequenceHeader { + uint8_t seq_profile; + uint8_t still_picture; + uint8_t reduced_still_picture_header; + + uint8_t timing_info_present_flag; + uint8_t decoder_model_info_present_flag; + uint8_t initial_display_delay_present_flag; + uint8_t operating_points_cnt_minus_1; + + AV1RawTimingInfo timing_info; + AV1RawDecoderModelInfo decoder_model_info; + + uint16_t operating_point_idc[AV1_MAX_OPERATING_POINTS]; + uint8_t seq_level_idx[AV1_MAX_OPERATING_POINTS]; + uint8_t seq_tier[AV1_MAX_OPERATING_POINTS]; + uint8_t decoder_model_present_for_this_op[AV1_MAX_OPERATING_POINTS]; + uint32_t decoder_buffer_delay[AV1_MAX_OPERATING_POINTS]; + uint32_t encoder_buffer_delay[AV1_MAX_OPERATING_POINTS]; + uint8_t low_delay_mode_flag[AV1_MAX_OPERATING_POINTS]; + uint8_t initial_display_delay_present_for_this_op[AV1_MAX_OPERATING_POINTS]; + uint8_t initial_display_delay_minus_1[AV1_MAX_OPERATING_POINTS]; + + uint8_t frame_width_bits_minus_1; + uint8_t frame_height_bits_minus_1; + uint16_t max_frame_width_minus_1; + uint16_t max_frame_height_minus_1; + + uint8_t frame_id_numbers_present_flag; + uint8_t delta_frame_id_length_minus_2; + uint8_t additional_frame_id_length_minus_1; + + uint8_t use_128x128_superblock; + uint8_t enable_filter_intra; + uint8_t enable_intra_edge_filter; + uint8_t enable_interintra_compound; + uint8_t enable_masked_compound; + uint8_t enable_warped_motion; + uint8_t enable_dual_filter; + + uint8_t enable_order_hint; + uint8_t enable_jnt_comp; + uint8_t enable_ref_frame_mvs; + + uint8_t seq_choose_screen_content_tools; + uint8_t seq_force_screen_content_tools; + uint8_t seq_choose_integer_mv; + uint8_t seq_force_integer_mv; + + uint8_t order_hint_bits_minus_1; + + uint8_t enable_superres; + uint8_t enable_cdef; + uint8_t enable_restoration; + + AV1RawColorConfig color_config; + + uint8_t film_grain_params_present; +} AV1RawSequenceHeader; + +typedef struct AV1RawFilmGrainParams { + uint8_t apply_grain; + uint16_t grain_seed; + uint8_t update_grain; + uint8_t film_grain_params_ref_idx; + uint8_t num_y_points; + uint8_t point_y_value[14]; + uint8_t point_y_scaling[14]; + uint8_t chroma_scaling_from_luma; + uint8_t num_cb_points; + uint8_t point_cb_value[10]; + uint8_t point_cb_scaling[10]; + uint8_t num_cr_points; + uint8_t point_cr_value[10]; + uint8_t point_cr_scaling[10]; + uint8_t grain_scaling_minus_8; + uint8_t ar_coeff_lag; + uint8_t ar_coeffs_y_plus_128[24]; + uint8_t ar_coeffs_cb_plus_128[25]; + uint8_t ar_coeffs_cr_plus_128[25]; + uint8_t ar_coeff_shift_minus_6; + uint8_t grain_scale_shift; + uint8_t cb_mult; + uint8_t cb_luma_mult; + uint16_t cb_offset; + uint8_t cr_mult; + uint8_t cr_luma_mult; + uint16_t cr_offset; + uint8_t overlap_flag; + uint8_t clip_to_restricted_range; +} AV1RawFilmGrainParams; + +typedef struct AV1RawFrameHeader { + uint8_t show_existing_frame; + uint8_t frame_to_show_map_idx; + uint32_t frame_presentation_time; + uint32_t display_frame_id; + + uint8_t frame_type; + uint8_t show_frame; + uint8_t showable_frame; + + uint8_t error_resilient_mode; + uint8_t disable_cdf_update; + uint8_t allow_screen_content_tools; + uint8_t force_integer_mv; + + uint32_t current_frame_id; + uint8_t frame_size_override_flag; + uint8_t order_hint; + + uint8_t buffer_removal_time_present_flag; + uint32_t buffer_removal_time[AV1_MAX_OPERATING_POINTS]; + + uint8_t primary_ref_frame; + uint16_t frame_width_minus_1; + uint16_t frame_height_minus_1; + uint8_t use_superres; + uint8_t coded_denom; + uint8_t render_and_frame_size_different; + uint16_t render_width_minus_1; + uint16_t render_height_minus_1; + + uint8_t found_ref[AV1_REFS_PER_FRAME]; + + uint8_t refresh_frame_flags; + uint8_t allow_intrabc; + uint8_t ref_order_hint[AV1_NUM_REF_FRAMES]; + uint8_t frame_refs_short_signaling; + uint8_t last_frame_idx; + uint8_t golden_frame_idx; + int8_t ref_frame_idx[AV1_REFS_PER_FRAME]; + uint32_t delta_frame_id_minus1[AV1_REFS_PER_FRAME]; + + uint8_t allow_high_precision_mv; + uint8_t is_filter_switchable; + uint8_t interpolation_filter; + uint8_t is_motion_mode_switchable; + uint8_t use_ref_frame_mvs; + + uint8_t disable_frame_end_update_cdf; + + uint8_t uniform_tile_spacing_flag; + uint8_t tile_cols_log2; + uint8_t tile_rows_log2; + uint8_t tile_start_col_sb[AV1_MAX_TILE_COLS]; + uint8_t tile_start_row_sb[AV1_MAX_TILE_COLS]; + uint8_t width_in_sbs_minus_1[AV1_MAX_TILE_COLS]; + uint8_t height_in_sbs_minus_1[AV1_MAX_TILE_ROWS]; + uint16_t context_update_tile_id; + uint8_t tile_size_bytes_minus1; + + // These are derived values, but it's very unhelpful to have to + // recalculate them all the time so we store them here. + uint16_t tile_cols; + uint16_t tile_rows; + + uint8_t base_q_idx; + int8_t delta_q_y_dc; + uint8_t diff_uv_delta; + int8_t delta_q_u_dc; + int8_t delta_q_u_ac; + int8_t delta_q_v_dc; + int8_t delta_q_v_ac; + uint8_t using_qmatrix; + uint8_t qm_y; + uint8_t qm_u; + uint8_t qm_v; + + uint8_t segmentation_enabled; + uint8_t segmentation_update_map; + uint8_t segmentation_temporal_update; + uint8_t segmentation_update_data; + uint8_t feature_enabled[AV1_MAX_SEGMENTS][AV1_SEG_LVL_MAX]; + int16_t feature_value[AV1_MAX_SEGMENTS][AV1_SEG_LVL_MAX]; + + uint8_t delta_q_present; + uint8_t delta_q_res; + uint8_t delta_lf_present; + uint8_t delta_lf_res; + uint8_t delta_lf_multi; + + uint8_t loop_filter_level[4]; + uint8_t loop_filter_sharpness; + uint8_t loop_filter_delta_enabled; + uint8_t loop_filter_delta_update; + uint8_t update_ref_delta[AV1_TOTAL_REFS_PER_FRAME]; + int8_t loop_filter_ref_deltas[AV1_TOTAL_REFS_PER_FRAME]; + uint8_t update_mode_delta[2]; + int8_t loop_filter_mode_deltas[2]; + + uint8_t cdef_damping_minus_3; + uint8_t cdef_bits; + uint8_t cdef_y_pri_strength[8]; + uint8_t cdef_y_sec_strength[8]; + uint8_t cdef_uv_pri_strength[8]; + uint8_t cdef_uv_sec_strength[8]; + + uint8_t lr_type[3]; + uint8_t lr_unit_shift; + uint8_t lr_uv_shift; + + uint8_t tx_mode; + uint8_t reference_select; + uint8_t skip_mode_present; + + uint8_t allow_warped_motion; + uint8_t reduced_tx_set; + + uint8_t is_global[AV1_TOTAL_REFS_PER_FRAME]; + uint8_t is_rot_zoom[AV1_TOTAL_REFS_PER_FRAME]; + uint8_t is_translation[AV1_TOTAL_REFS_PER_FRAME]; + //AV1RawSubexp gm_params[AV1_TOTAL_REFS_PER_FRAME][6]; + uint32_t gm_params[AV1_TOTAL_REFS_PER_FRAME][6]; + + AV1RawFilmGrainParams film_grain; +} AV1RawFrameHeader; + +typedef struct AV1RawTileData { + uint8_t *data; + AVBufferRef *data_ref; + size_t data_size; +} AV1RawTileData; + +typedef struct AV1RawTileGroup { + uint8_t tile_start_and_end_present_flag; + uint16_t tg_start; + uint16_t tg_end; + + AV1RawTileData tile_data; +} AV1RawTileGroup; + +typedef struct AV1RawFrame { + AV1RawFrameHeader header; + AV1RawTileGroup tile_group; +} AV1RawFrame; + +typedef struct AV1RawTileList { + uint8_t output_frame_width_in_tiles_minus_1; + uint8_t output_frame_height_in_tiles_minus_1; + uint16_t tile_count_minus_1; + + AV1RawTileData tile_data; +} AV1RawTileList; + +typedef struct AV1RawMetadataHDRCLL { + uint16_t max_cll; + uint16_t max_fall; +} AV1RawMetadataHDRCLL; + +typedef struct AV1RawMetadataHDRMDCV { + uint16_t primary_chromaticity_x[3]; + uint16_t primary_chromaticity_y[3]; + uint16_t white_point_chromaticity_x; + uint16_t white_point_chromaticity_y; + uint32_t luminance_max; + uint32_t luminance_min; +} AV1RawMetadataHDRMDCV; + +typedef struct AV1RawMetadataScalability { + uint8_t scalability_mode_idc; + uint8_t spatial_layers_cnt_minus_1; + uint8_t spatial_layer_dimensions_present_flag; + uint8_t spatial_layer_description_present_flag; + uint8_t temporal_group_description_present_flag; + uint8_t scalability_structure_reserved_3bits; + uint16_t spatial_layer_max_width[4]; + uint16_t spatial_layer_max_height[4]; + uint8_t spatial_layer_ref_id[4]; + uint8_t temporal_group_size; + uint8_t temporal_group_temporal_id[255]; + uint8_t temporal_group_temporal_switching_up_point_flag[255]; + uint8_t temporal_group_spatial_switching_up_point_flag[255]; + uint8_t temporal_group_ref_cnt[255]; + uint8_t temporal_group_ref_pic_diff[255][7]; +} AV1RawMetadataScalability; + +typedef struct AV1RawMetadataITUTT35 { + uint8_t itu_t_t35_country_code; + uint8_t itu_t_t35_country_code_extension_byte; + + uint8_t *payload; + AVBufferRef *payload_ref; + size_t payload_size; +} AV1RawMetadataITUTT35; + +typedef struct AV1RawMetadataTimecode { + uint8_t counting_type; + uint8_t full_timestamp_flag; + uint8_t discontinuity_flag; + uint8_t cnt_dropped_flag; + uint16_t n_frames; + uint8_t seconds_value; + uint8_t minutes_value; + uint8_t hours_value; + uint8_t seconds_flag; + uint8_t minutes_flag; + uint8_t hours_flag; + uint8_t time_offset_length; + uint32_t time_offset_value; +} AV1RawMetadataTimecode; + +typedef struct AV1RawMetadataUnknown { + uint8_t *payload; + AVBufferRef *payload_ref; + size_t payload_size; +} AV1RawMetadataUnknown; + +typedef struct AV1RawMetadata { + uint64_t metadata_type; + union { + AV1RawMetadataHDRCLL hdr_cll; + AV1RawMetadataHDRMDCV hdr_mdcv; + AV1RawMetadataScalability scalability; + AV1RawMetadataITUTT35 itut_t35; + AV1RawMetadataTimecode timecode; + AV1RawMetadataUnknown unknown; + } metadata; +} AV1RawMetadata; + +typedef struct AV1RawPadding { + uint8_t *payload; + AVBufferRef *payload_ref; + size_t payload_size; +} AV1RawPadding; + + +typedef struct AV1RawOBU { + AV1RawOBUHeader header; + + size_t obu_size; + + union { + AV1RawSequenceHeader sequence_header; + AV1RawFrameHeader frame_header; + AV1RawFrame frame; + AV1RawTileGroup tile_group; + AV1RawTileList tile_list; + AV1RawMetadata metadata; + AV1RawPadding padding; + } obu; +} AV1RawOBU; + +typedef struct AV1ReferenceFrameState { + int valid; // RefValid + int frame_id; // RefFrameId + int upscaled_width; // RefUpscaledWidth + int frame_width; // RefFrameWidth + int frame_height; // RefFrameHeight + int render_width; // RefRenderWidth + int render_height; // RefRenderHeight + int frame_type; // RefFrameType + int subsampling_x; // RefSubsamplingX + int subsampling_y; // RefSubsamplingY + int bit_depth; // RefBitDepth + int order_hint; // RefOrderHint + + int saved_order_hints[AV1_TOTAL_REFS_PER_FRAME]; // SavedOrderHints[ref] + + int8_t loop_filter_ref_deltas[AV1_TOTAL_REFS_PER_FRAME]; + int8_t loop_filter_mode_deltas[2]; + uint8_t feature_enabled[AV1_MAX_SEGMENTS][AV1_SEG_LVL_MAX]; + int16_t feature_value[AV1_MAX_SEGMENTS][AV1_SEG_LVL_MAX]; +} AV1ReferenceFrameState; + +typedef struct CodedBitstreamAV1Context { + const AVClass *class; + + AV1RawSequenceHeader *sequence_header; + /** A RefStruct reference backing sequence_header. */ + AV1RawOBU *sequence_header_ref; + + int seen_frame_header; + AVBufferRef *frame_header_ref; + uint8_t *frame_header; + size_t frame_header_size; + + int temporal_id; + int spatial_id; + int operating_point_idc; + + int bit_depth; + int order_hint; + int frame_width; + int frame_height; + int upscaled_width; + int render_width; + int render_height; + + int num_planes; + int coded_lossless; + int all_lossless; + int tile_cols; + int tile_rows; + int tile_num; + + int order_hints[AV1_TOTAL_REFS_PER_FRAME]; // OrderHints + int ref_frame_sign_bias[AV1_TOTAL_REFS_PER_FRAME]; // RefFrameSignBias + + AV1ReferenceFrameState ref[AV1_NUM_REF_FRAMES]; + + // AVOptions + int operating_point; + // When writing, fix the length in bytes of the obu_size field. + // Writing will fail with an error if an OBU larger than can be + // represented by the fixed size is encountered. + int fixed_obu_size_length; + + int8_t loop_filter_ref_deltas[AV1_TOTAL_REFS_PER_FRAME]; + int8_t loop_filter_mode_deltas[2]; + uint8_t feature_enabled[AV1_MAX_SEGMENTS][AV1_SEG_LVL_MAX]; + int16_t feature_value[AV1_MAX_SEGMENTS][AV1_SEG_LVL_MAX]; +} CodedBitstreamAV1Context; + + +#endif /* AVCODEC_CBS_AV1_H */ diff --git a/include/libavcodec/cbs_bsf.h b/include/libavcodec/cbs_bsf.h new file mode 100644 index 0000000..26bd448 --- /dev/null +++ b/include/libavcodec/cbs_bsf.h @@ -0,0 +1,137 @@ +/* + * 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_CBS_BSF_H +#define AVCODEC_CBS_BSF_H + +#include "libavutil/log.h" +#include "libavutil/opt.h" + +#include "bsf.h" +#include "codec_id.h" +#include "cbs.h" +#include "packet.h" + + +typedef struct CBSBSFType { + enum AVCodecID codec_id; + + // Name of a frame fragment in this codec (e.g. "access unit", + // "temporal unit"). + const char *fragment_name; + + // Name of a unit for this BSF, for use in error messages (e.g. + // "NAL unit", "OBU"). + const char *unit_name; + + // Update the content of a fragment with whatever metadata changes + // are desired. The associated AVPacket is provided so that any side + // data associated with the fragment can be inspected or edited. If + // pkt is NULL, then an extradata header fragment is being updated. + int (*update_fragment)(AVBSFContext *bsf, AVPacket *pkt, + CodedBitstreamFragment *frag); +} CBSBSFType; + +// Common structure for all generic CBS BSF users. An instance of this +// structure must be the first member of the BSF private context (to be +// pointed to by AVBSFContext.priv_data). +typedef struct CBSBSFContext { + const AVClass *class; + const CBSBSFType *type; + + CodedBitstreamContext *input; + CodedBitstreamContext *output; + CodedBitstreamFragment fragment; +} CBSBSFContext; + +/** + * Initialise generic CBS BSF setup. + * + * Creates the input and output CBS instances, and applies the filter to + * the extradata on the input codecpar if any is present. + * + * Since it calls the update_fragment() function immediately to deal with + * extradata, this should be called after any codec-specific setup is done + * (probably at the end of the FFBitStreamFilter.init function). + */ +int ff_cbs_bsf_generic_init(AVBSFContext *bsf, const CBSBSFType *type); + +/** + * Close a generic CBS BSF instance. + * + * If no other deinitialisation is required then this function can be used + * directly as FFBitStreamFilter.close. + */ +void ff_cbs_bsf_generic_close(AVBSFContext *bsf); + +/** + * Filter operation for CBS BSF. + * + * Reads the input packet into a CBS fragment, calls update_fragment() on + * it, then writes the result to an output packet. If the input packet + * has AV_PKT_DATA_NEW_EXTRADATA side-data associated with it then it does + * the same thing to that new extradata to form the output side-data first. + * + * If the BSF does not do anything else then this function can be used + * directly as FFBitStreamFilter.filter. + */ +int ff_cbs_bsf_generic_filter(AVBSFContext *bsf, AVPacket *pkt); + + +// Options for element manipulation. +enum { + // Pass this element through unchanged. + BSF_ELEMENT_PASS, + // Insert this element, replacing any existing instances of it. + // Associated values may be provided explicitly (as additional options) + // or implicitly (either as side data or deduced from other parts of + // the stream). + BSF_ELEMENT_INSERT, + // Remove this element if it appears in the stream. + BSF_ELEMENT_REMOVE, + // Extract this element to side data, so that further manipulation + // can happen elsewhere. + BSF_ELEMENT_EXTRACT, +}; + +#define BSF_ELEMENT_OPTIONS_PIR(name, help, field, opt_flags) \ + { name, help, OFFSET(field), AV_OPT_TYPE_INT, \ + { .i64 = BSF_ELEMENT_PASS }, \ + BSF_ELEMENT_PASS, BSF_ELEMENT_REMOVE, opt_flags, .unit = name }, \ + { "pass", NULL, 0, AV_OPT_TYPE_CONST, \ + { .i64 = BSF_ELEMENT_PASS }, .flags = opt_flags, .unit = name }, \ + { "insert", NULL, 0, AV_OPT_TYPE_CONST, \ + { .i64 = BSF_ELEMENT_INSERT }, .flags = opt_flags, .unit = name }, \ + { "remove", NULL, 0, AV_OPT_TYPE_CONST, \ + { .i64 = BSF_ELEMENT_REMOVE }, .flags = opt_flags, .unit = name } + +#define BSF_ELEMENT_OPTIONS_PIRE(name, help, field, opt_flags) \ + { name, help, OFFSET(field), AV_OPT_TYPE_INT, \ + { .i64 = BSF_ELEMENT_PASS }, \ + BSF_ELEMENT_PASS, BSF_ELEMENT_EXTRACT, opt_flags, .unit = name }, \ + { "pass", NULL, 0, AV_OPT_TYPE_CONST, \ + { .i64 = BSF_ELEMENT_PASS }, .flags = opt_flags, .unit = name }, \ + { "insert", NULL, 0, AV_OPT_TYPE_CONST, \ + { .i64 = BSF_ELEMENT_INSERT }, .flags = opt_flags, .unit = name }, \ + { "remove", NULL, 0, AV_OPT_TYPE_CONST, \ + { .i64 = BSF_ELEMENT_REMOVE }, .flags = opt_flags, .unit = name }, \ + { "extract", NULL, 0, AV_OPT_TYPE_CONST, \ + { .i64 = BSF_ELEMENT_EXTRACT }, .flags = opt_flags, .unit = name } \ + + +#endif /* AVCODEC_CBS_BSF_H */ diff --git a/include/libavcodec/cbs_h264.h b/include/libavcodec/cbs_h264.h new file mode 100644 index 0000000..3763f24 --- /dev/null +++ b/include/libavcodec/cbs_h264.h @@ -0,0 +1,445 @@ +/* + * 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_CBS_H264_H +#define AVCODEC_CBS_H264_H + +#include +#include + +#include "cbs.h" +#include "cbs_h2645.h" +#include "cbs_sei.h" +#include "h264.h" + + +typedef struct H264RawNALUnitHeader { + uint8_t nal_ref_idc; + uint8_t nal_unit_type; + + uint8_t svc_extension_flag; + uint8_t avc_3d_extension_flag; +} H264RawNALUnitHeader; + +typedef struct H264RawScalingList { + int8_t delta_scale[64]; +} H264RawScalingList; + +typedef struct H264RawHRD { + uint8_t cpb_cnt_minus1; + uint8_t bit_rate_scale; + uint8_t cpb_size_scale; + + uint32_t bit_rate_value_minus1[H264_MAX_CPB_CNT]; + uint32_t cpb_size_value_minus1[H264_MAX_CPB_CNT]; + uint8_t cbr_flag[H264_MAX_CPB_CNT]; + + uint8_t initial_cpb_removal_delay_length_minus1; + uint8_t cpb_removal_delay_length_minus1; + uint8_t dpb_output_delay_length_minus1; + uint8_t time_offset_length; +} H264RawHRD; + +typedef struct H264RawVUI { + uint8_t aspect_ratio_info_present_flag; + uint8_t aspect_ratio_idc; + uint16_t sar_width; + uint16_t sar_height; + + uint8_t overscan_info_present_flag; + uint8_t overscan_appropriate_flag; + + uint8_t video_signal_type_present_flag; + uint8_t video_format; + uint8_t video_full_range_flag; + uint8_t colour_description_present_flag; + uint8_t colour_primaries; + uint8_t transfer_characteristics; + uint8_t matrix_coefficients; + + uint8_t chroma_loc_info_present_flag; + uint8_t chroma_sample_loc_type_top_field; + uint8_t chroma_sample_loc_type_bottom_field; + + uint8_t timing_info_present_flag; + uint32_t num_units_in_tick; + uint32_t time_scale; + uint8_t fixed_frame_rate_flag; + + uint8_t nal_hrd_parameters_present_flag; + H264RawHRD nal_hrd_parameters; + uint8_t vcl_hrd_parameters_present_flag; + H264RawHRD vcl_hrd_parameters; + uint8_t low_delay_hrd_flag; + + uint8_t pic_struct_present_flag; + + uint8_t bitstream_restriction_flag; + uint8_t motion_vectors_over_pic_boundaries_flag; + uint8_t max_bytes_per_pic_denom; + uint8_t max_bits_per_mb_denom; + uint8_t log2_max_mv_length_horizontal; + uint8_t log2_max_mv_length_vertical; + uint8_t max_num_reorder_frames; + uint8_t max_dec_frame_buffering; +} H264RawVUI; + +typedef struct H264RawSPS { + H264RawNALUnitHeader nal_unit_header; + + uint8_t profile_idc; + uint8_t constraint_set0_flag; + uint8_t constraint_set1_flag; + uint8_t constraint_set2_flag; + uint8_t constraint_set3_flag; + uint8_t constraint_set4_flag; + uint8_t constraint_set5_flag; + uint8_t reserved_zero_2bits; + uint8_t level_idc; + + uint8_t seq_parameter_set_id; + + uint8_t chroma_format_idc; + uint8_t separate_colour_plane_flag; + uint8_t bit_depth_luma_minus8; + uint8_t bit_depth_chroma_minus8; + uint8_t qpprime_y_zero_transform_bypass_flag; + + uint8_t seq_scaling_matrix_present_flag; + uint8_t seq_scaling_list_present_flag[12]; + H264RawScalingList scaling_list_4x4[6]; + H264RawScalingList scaling_list_8x8[6]; + + uint8_t log2_max_frame_num_minus4; + uint8_t pic_order_cnt_type; + uint8_t log2_max_pic_order_cnt_lsb_minus4; + uint8_t delta_pic_order_always_zero_flag; + int32_t offset_for_non_ref_pic; + int32_t offset_for_top_to_bottom_field; + uint8_t num_ref_frames_in_pic_order_cnt_cycle; + int32_t offset_for_ref_frame[256]; + + uint8_t max_num_ref_frames; + uint8_t gaps_in_frame_num_allowed_flag; + + uint16_t pic_width_in_mbs_minus1; + uint16_t pic_height_in_map_units_minus1; + + uint8_t frame_mbs_only_flag; + uint8_t mb_adaptive_frame_field_flag; + uint8_t direct_8x8_inference_flag; + + uint8_t frame_cropping_flag; + uint16_t frame_crop_left_offset; + uint16_t frame_crop_right_offset; + uint16_t frame_crop_top_offset; + uint16_t frame_crop_bottom_offset; + + uint8_t vui_parameters_present_flag; + H264RawVUI vui; +} H264RawSPS; + +typedef struct H264RawSPSExtension { + H264RawNALUnitHeader nal_unit_header; + + uint8_t seq_parameter_set_id; + + uint8_t aux_format_idc; + uint8_t bit_depth_aux_minus8; + uint8_t alpha_incr_flag; + uint16_t alpha_opaque_value; + uint16_t alpha_transparent_value; + + uint8_t additional_extension_flag; +} H264RawSPSExtension; + +typedef struct H264RawPPS { + H264RawNALUnitHeader nal_unit_header; + + uint8_t pic_parameter_set_id; + uint8_t seq_parameter_set_id; + + uint8_t entropy_coding_mode_flag; + uint8_t bottom_field_pic_order_in_frame_present_flag; + + uint8_t num_slice_groups_minus1; + uint8_t slice_group_map_type; + uint16_t run_length_minus1[H264_MAX_SLICE_GROUPS]; + uint16_t top_left[H264_MAX_SLICE_GROUPS]; + uint16_t bottom_right[H264_MAX_SLICE_GROUPS]; + uint8_t slice_group_change_direction_flag; + uint16_t slice_group_change_rate_minus1; + uint16_t pic_size_in_map_units_minus1; + + uint8_t *slice_group_id; + AVBufferRef *slice_group_id_ref; + + uint8_t num_ref_idx_l0_default_active_minus1; + uint8_t num_ref_idx_l1_default_active_minus1; + + uint8_t weighted_pred_flag; + uint8_t weighted_bipred_idc; + + int8_t pic_init_qp_minus26; + int8_t pic_init_qs_minus26; + int8_t chroma_qp_index_offset; + + uint8_t deblocking_filter_control_present_flag; + uint8_t constrained_intra_pred_flag; + + uint8_t more_rbsp_data; + + uint8_t redundant_pic_cnt_present_flag; + uint8_t transform_8x8_mode_flag; + + uint8_t pic_scaling_matrix_present_flag; + uint8_t pic_scaling_list_present_flag[12]; + H264RawScalingList scaling_list_4x4[6]; + H264RawScalingList scaling_list_8x8[6]; + + int8_t second_chroma_qp_index_offset; +} H264RawPPS; + +typedef struct H264RawAUD { + H264RawNALUnitHeader nal_unit_header; + + uint8_t primary_pic_type; +} H264RawAUD; + +typedef struct H264RawSEIBufferingPeriod { + uint8_t seq_parameter_set_id; + struct { + uint32_t initial_cpb_removal_delay[H264_MAX_CPB_CNT]; + uint32_t initial_cpb_removal_delay_offset[H264_MAX_CPB_CNT]; + } nal, vcl; +} H264RawSEIBufferingPeriod; + +typedef struct H264RawSEIPicTimestamp { + uint8_t ct_type; + uint8_t nuit_field_based_flag; + uint8_t counting_type; + uint8_t full_timestamp_flag; + uint8_t discontinuity_flag; + uint8_t cnt_dropped_flag; + uint8_t n_frames; + uint8_t seconds_flag; + uint8_t seconds_value; + uint8_t minutes_flag; + uint8_t minutes_value; + uint8_t hours_flag; + uint8_t hours_value; + int32_t time_offset; +} H264RawSEIPicTimestamp; + +typedef struct H264RawSEIPicTiming { + uint32_t cpb_removal_delay; + uint32_t dpb_output_delay; + uint8_t pic_struct; + uint8_t clock_timestamp_flag[3]; + H264RawSEIPicTimestamp timestamp[3]; +} H264RawSEIPicTiming; + +typedef struct H264RawSEIPanScanRect { + uint32_t pan_scan_rect_id; + uint8_t pan_scan_rect_cancel_flag; + uint8_t pan_scan_cnt_minus1; + int32_t pan_scan_rect_left_offset[3]; + int32_t pan_scan_rect_right_offset[3]; + int32_t pan_scan_rect_top_offset[3]; + int32_t pan_scan_rect_bottom_offset[3]; + uint16_t pan_scan_rect_repetition_period; +} H264RawSEIPanScanRect; + +typedef struct H264RawSEIRecoveryPoint { + uint16_t recovery_frame_cnt; + uint8_t exact_match_flag; + uint8_t broken_link_flag; + uint8_t changing_slice_group_idc; +} H264RawSEIRecoveryPoint; + +typedef struct H264RawFilmGrainCharacteristics { + uint8_t film_grain_characteristics_cancel_flag; + uint8_t film_grain_model_id; + uint8_t separate_colour_description_present_flag; + uint8_t film_grain_bit_depth_luma_minus8; + uint8_t film_grain_bit_depth_chroma_minus8; + uint8_t film_grain_full_range_flag; + uint8_t film_grain_colour_primaries; + uint8_t film_grain_transfer_characteristics; + uint8_t film_grain_matrix_coefficients; + uint8_t blending_mode_id; + uint8_t log2_scale_factor; + uint8_t comp_model_present_flag[3]; + uint8_t num_intensity_intervals_minus1[3]; + uint8_t num_model_values_minus1[3]; + uint8_t intensity_interval_lower_bound[3][256]; + uint8_t intensity_interval_upper_bound[3][256]; + int16_t comp_model_value[3][256][6]; + uint8_t film_grain_characteristics_repetition_period; +} H264RawFilmGrainCharacteristics; + +typedef struct H264RawSEIFramePackingArrangement { + uint32_t frame_packing_arrangement_id; + uint8_t frame_packing_arrangement_cancel_flag; + uint8_t frame_packing_arrangement_type; + uint8_t quincunx_sampling_flag; + uint8_t content_interpretation_type; + uint8_t spatial_flipping_flag; + uint8_t frame0_flipped_flag; + uint8_t field_views_flag; + uint8_t current_frame_is_frame0_flag; + uint8_t frame0_self_contained_flag; + uint8_t frame1_self_contained_flag; + uint8_t frame0_grid_position_x; + uint8_t frame0_grid_position_y; + uint8_t frame1_grid_position_x; + uint8_t frame1_grid_position_y; + uint16_t frame_packing_arrangement_repetition_period; + uint8_t frame_packing_arrangement_extension_flag; +} H264RawSEIFramePackingArrangement; + +typedef struct H264RawSEIDisplayOrientation { + uint8_t display_orientation_cancel_flag; + uint8_t hor_flip; + uint8_t ver_flip; + uint16_t anticlockwise_rotation; + uint16_t display_orientation_repetition_period; + uint8_t display_orientation_extension_flag; +} H264RawSEIDisplayOrientation; + +typedef struct H264RawSEI { + H264RawNALUnitHeader nal_unit_header; + SEIRawMessageList message_list; +} H264RawSEI; + +typedef struct H264RawSliceHeader { + H264RawNALUnitHeader nal_unit_header; + + uint32_t first_mb_in_slice; + uint8_t slice_type; + + uint8_t pic_parameter_set_id; + + uint8_t colour_plane_id; + + uint16_t frame_num; + uint8_t field_pic_flag; + uint8_t bottom_field_flag; + + uint16_t idr_pic_id; + + uint16_t pic_order_cnt_lsb; + int32_t delta_pic_order_cnt_bottom; + int32_t delta_pic_order_cnt[2]; + + uint8_t redundant_pic_cnt; + uint8_t direct_spatial_mv_pred_flag; + + uint8_t num_ref_idx_active_override_flag; + uint8_t num_ref_idx_l0_active_minus1; + uint8_t num_ref_idx_l1_active_minus1; + + uint8_t ref_pic_list_modification_flag_l0; + uint8_t ref_pic_list_modification_flag_l1; + struct { + uint8_t modification_of_pic_nums_idc; + int32_t abs_diff_pic_num_minus1; + uint8_t long_term_pic_num; + } rplm_l0[H264_MAX_RPLM_COUNT], rplm_l1[H264_MAX_RPLM_COUNT]; + + uint8_t luma_log2_weight_denom; + uint8_t chroma_log2_weight_denom; + + uint8_t luma_weight_l0_flag[H264_MAX_REFS]; + int8_t luma_weight_l0[H264_MAX_REFS]; + int8_t luma_offset_l0[H264_MAX_REFS]; + uint8_t chroma_weight_l0_flag[H264_MAX_REFS]; + int8_t chroma_weight_l0[H264_MAX_REFS][2]; + int8_t chroma_offset_l0[H264_MAX_REFS][2]; + + uint8_t luma_weight_l1_flag[H264_MAX_REFS]; + int8_t luma_weight_l1[H264_MAX_REFS]; + int8_t luma_offset_l1[H264_MAX_REFS]; + uint8_t chroma_weight_l1_flag[H264_MAX_REFS]; + int8_t chroma_weight_l1[H264_MAX_REFS][2]; + int8_t chroma_offset_l1[H264_MAX_REFS][2]; + + uint8_t no_output_of_prior_pics_flag; + uint8_t long_term_reference_flag; + + uint8_t adaptive_ref_pic_marking_mode_flag; + struct { + uint8_t memory_management_control_operation; + int32_t difference_of_pic_nums_minus1; + uint8_t long_term_pic_num; + uint8_t long_term_frame_idx; + uint8_t max_long_term_frame_idx_plus1; + } mmco[H264_MAX_MMCO_COUNT]; + + uint8_t cabac_init_idc; + + int8_t slice_qp_delta; + + uint8_t sp_for_switch_flag; + int8_t slice_qs_delta; + + uint8_t disable_deblocking_filter_idc; + int8_t slice_alpha_c0_offset_div2; + int8_t slice_beta_offset_div2; + + uint16_t slice_group_change_cycle; +} H264RawSliceHeader; + +typedef struct H264RawSlice { + H264RawSliceHeader header; + + uint8_t *data; + AVBufferRef *data_ref; + size_t data_size; + int data_bit_start; +} H264RawSlice; + +typedef struct H264RawFiller { + H264RawNALUnitHeader nal_unit_header; + + uint32_t filler_size; +} H264RawFiller; + + +typedef struct CodedBitstreamH264Context { + // Reader/writer context in common with the H.265 implementation. + CodedBitstreamH2645Context common; + + // All currently available parameter sets. These are updated when + // any parameter set NAL unit is read/written with this context. + H264RawSPS *sps[H264_MAX_SPS_COUNT]; ///< RefStruct references + H264RawPPS *pps[H264_MAX_PPS_COUNT]; ///< RefStruct references + + // The currently active parameter sets. These are updated when any + // NAL unit refers to the relevant parameter set. These pointers + // must also be present in the arrays above. + const H264RawSPS *active_sps; + const H264RawPPS *active_pps; + + // The NAL unit type of the most recent normal slice. This is required + // to be able to read/write auxiliary slices, because IdrPicFlag is + // otherwise unknown. + uint8_t last_slice_nal_unit_type; +} CodedBitstreamH264Context; + +#endif /* AVCODEC_CBS_H264_H */ diff --git a/include/libavcodec/cbs_h2645.h b/include/libavcodec/cbs_h2645.h new file mode 100644 index 0000000..f4c987a --- /dev/null +++ b/include/libavcodec/cbs_h2645.h @@ -0,0 +1,36 @@ +/* + * 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_CBS_H2645_H +#define AVCODEC_CBS_H2645_H + +#include "h2645_parse.h" + + +typedef struct CodedBitstreamH2645Context { + // If set, the stream being read is in MP4 (AVCC/HVCC) format. If not + // set, the stream is assumed to be in annex B format. + int mp4; + // Size in bytes of the NAL length field for MP4 format. + int nal_length_size; + // Packet reader. + H2645Packet read_packet; +} CodedBitstreamH2645Context; + + +#endif /* AVCODEC_CBS_H2645_H */ diff --git a/include/libavcodec/cbs_h265.h b/include/libavcodec/cbs_h265.h new file mode 100644 index 0000000..bb7a29c --- /dev/null +++ b/include/libavcodec/cbs_h265.h @@ -0,0 +1,769 @@ +/* + * 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_CBS_H265_H +#define AVCODEC_CBS_H265_H + +#include +#include + +#include "cbs_h2645.h" +#include "cbs_sei.h" + +#include "hevc/hevc.h" + +typedef struct H265RawNALUnitHeader { + uint8_t nal_unit_type; + uint8_t nuh_layer_id; + uint8_t nuh_temporal_id_plus1; +} H265RawNALUnitHeader; + +typedef struct H265RawProfileTierLevel { + uint8_t general_profile_space; + uint8_t general_tier_flag; + uint8_t general_profile_idc; + + uint8_t general_profile_compatibility_flag[32]; + + uint8_t general_progressive_source_flag; + uint8_t general_interlaced_source_flag; + uint8_t general_non_packed_constraint_flag; + uint8_t general_frame_only_constraint_flag; + + uint8_t general_max_12bit_constraint_flag; + uint8_t general_max_10bit_constraint_flag; + uint8_t general_max_8bit_constraint_flag; + uint8_t general_max_422chroma_constraint_flag; + uint8_t general_max_420chroma_constraint_flag; + uint8_t general_max_monochrome_constraint_flag; + uint8_t general_intra_constraint_flag; + uint8_t general_one_picture_only_constraint_flag; + uint8_t general_lower_bit_rate_constraint_flag; + uint8_t general_max_14bit_constraint_flag; + + uint8_t general_inbld_flag; + + uint8_t general_level_idc; + + uint8_t sub_layer_profile_present_flag[HEVC_MAX_SUB_LAYERS]; + uint8_t sub_layer_level_present_flag[HEVC_MAX_SUB_LAYERS]; + + uint8_t sub_layer_profile_space[HEVC_MAX_SUB_LAYERS]; + uint8_t sub_layer_tier_flag[HEVC_MAX_SUB_LAYERS]; + uint8_t sub_layer_profile_idc[HEVC_MAX_SUB_LAYERS]; + + uint8_t sub_layer_profile_compatibility_flag[HEVC_MAX_SUB_LAYERS][32]; + + uint8_t sub_layer_progressive_source_flag[HEVC_MAX_SUB_LAYERS]; + uint8_t sub_layer_interlaced_source_flag[HEVC_MAX_SUB_LAYERS]; + uint8_t sub_layer_non_packed_constraint_flag[HEVC_MAX_SUB_LAYERS]; + uint8_t sub_layer_frame_only_constraint_flag[HEVC_MAX_SUB_LAYERS]; + + uint8_t sub_layer_max_12bit_constraint_flag[HEVC_MAX_SUB_LAYERS]; + uint8_t sub_layer_max_10bit_constraint_flag[HEVC_MAX_SUB_LAYERS]; + uint8_t sub_layer_max_8bit_constraint_flag[HEVC_MAX_SUB_LAYERS]; + uint8_t sub_layer_max_422chroma_constraint_flag[HEVC_MAX_SUB_LAYERS]; + uint8_t sub_layer_max_420chroma_constraint_flag[HEVC_MAX_SUB_LAYERS]; + uint8_t sub_layer_max_monochrome_constraint_flag[HEVC_MAX_SUB_LAYERS]; + uint8_t sub_layer_intra_constraint_flag[HEVC_MAX_SUB_LAYERS]; + uint8_t sub_layer_one_picture_only_constraint_flag[HEVC_MAX_SUB_LAYERS]; + uint8_t sub_layer_lower_bit_rate_constraint_flag[HEVC_MAX_SUB_LAYERS]; + uint8_t sub_layer_max_14bit_constraint_flag[HEVC_MAX_SUB_LAYERS]; + + uint8_t sub_layer_inbld_flag[HEVC_MAX_SUB_LAYERS]; + + uint8_t sub_layer_level_idc[HEVC_MAX_SUB_LAYERS]; +} H265RawProfileTierLevel; + +typedef struct H265RawSubLayerHRDParameters { + uint32_t bit_rate_value_minus1[HEVC_MAX_CPB_CNT]; + uint32_t cpb_size_value_minus1[HEVC_MAX_CPB_CNT]; + uint32_t cpb_size_du_value_minus1[HEVC_MAX_CPB_CNT]; + uint32_t bit_rate_du_value_minus1[HEVC_MAX_CPB_CNT]; + uint8_t cbr_flag[HEVC_MAX_CPB_CNT]; +} H265RawSubLayerHRDParameters; + +typedef struct H265RawHRDParameters { + uint8_t nal_hrd_parameters_present_flag; + uint8_t vcl_hrd_parameters_present_flag; + + uint8_t sub_pic_hrd_params_present_flag; + uint8_t tick_divisor_minus2; + uint8_t du_cpb_removal_delay_increment_length_minus1; + uint8_t sub_pic_cpb_params_in_pic_timing_sei_flag; + uint8_t dpb_output_delay_du_length_minus1; + + uint8_t bit_rate_scale; + uint8_t cpb_size_scale; + uint8_t cpb_size_du_scale; + + uint8_t initial_cpb_removal_delay_length_minus1; + uint8_t au_cpb_removal_delay_length_minus1; + uint8_t dpb_output_delay_length_minus1; + + uint8_t fixed_pic_rate_general_flag[HEVC_MAX_SUB_LAYERS]; + uint8_t fixed_pic_rate_within_cvs_flag[HEVC_MAX_SUB_LAYERS]; + uint16_t elemental_duration_in_tc_minus1[HEVC_MAX_SUB_LAYERS]; + uint8_t low_delay_hrd_flag[HEVC_MAX_SUB_LAYERS]; + uint8_t cpb_cnt_minus1[HEVC_MAX_SUB_LAYERS]; + H265RawSubLayerHRDParameters nal_sub_layer_hrd_parameters[HEVC_MAX_SUB_LAYERS]; + H265RawSubLayerHRDParameters vcl_sub_layer_hrd_parameters[HEVC_MAX_SUB_LAYERS]; +} H265RawHRDParameters; + +typedef struct H265RawVUI { + uint8_t aspect_ratio_info_present_flag; + uint8_t aspect_ratio_idc; + uint16_t sar_width; + uint16_t sar_height; + + uint8_t overscan_info_present_flag; + uint8_t overscan_appropriate_flag; + + uint8_t video_signal_type_present_flag; + uint8_t video_format; + uint8_t video_full_range_flag; + uint8_t colour_description_present_flag; + uint8_t colour_primaries; + uint8_t transfer_characteristics; + uint8_t matrix_coefficients; + + uint8_t chroma_loc_info_present_flag; + uint8_t chroma_sample_loc_type_top_field; + uint8_t chroma_sample_loc_type_bottom_field; + + uint8_t neutral_chroma_indication_flag; + uint8_t field_seq_flag; + uint8_t frame_field_info_present_flag; + + uint8_t default_display_window_flag; + uint16_t def_disp_win_left_offset; + uint16_t def_disp_win_right_offset; + uint16_t def_disp_win_top_offset; + uint16_t def_disp_win_bottom_offset; + + uint8_t vui_timing_info_present_flag; + uint32_t vui_num_units_in_tick; + uint32_t vui_time_scale; + uint8_t vui_poc_proportional_to_timing_flag; + uint32_t vui_num_ticks_poc_diff_one_minus1; + uint8_t vui_hrd_parameters_present_flag; + H265RawHRDParameters hrd_parameters; + + uint8_t bitstream_restriction_flag; + uint8_t tiles_fixed_structure_flag; + uint8_t motion_vectors_over_pic_boundaries_flag; + uint8_t restricted_ref_pic_lists_flag; + uint16_t min_spatial_segmentation_idc; + uint8_t max_bytes_per_pic_denom; + uint8_t max_bits_per_min_cu_denom; + uint8_t log2_max_mv_length_horizontal; + uint8_t log2_max_mv_length_vertical; +} H265RawVUI; + +typedef struct H265RawExtensionData { + uint8_t *data; + AVBufferRef *data_ref; + size_t bit_length; +} H265RawExtensionData; + +typedef struct H265RawVPS { + H265RawNALUnitHeader nal_unit_header; + + uint8_t vps_video_parameter_set_id; + + uint8_t vps_base_layer_internal_flag; + uint8_t vps_base_layer_available_flag; + uint8_t vps_max_layers_minus1; + uint8_t vps_max_sub_layers_minus1; + uint8_t vps_temporal_id_nesting_flag; + + H265RawProfileTierLevel profile_tier_level; + + uint8_t vps_sub_layer_ordering_info_present_flag; + uint8_t vps_max_dec_pic_buffering_minus1[HEVC_MAX_SUB_LAYERS]; + uint8_t vps_max_num_reorder_pics[HEVC_MAX_SUB_LAYERS]; + uint32_t vps_max_latency_increase_plus1[HEVC_MAX_SUB_LAYERS]; + + uint8_t vps_max_layer_id; + uint16_t vps_num_layer_sets_minus1; + uint8_t layer_id_included_flag[HEVC_MAX_LAYER_SETS][HEVC_MAX_LAYERS]; + + uint8_t vps_timing_info_present_flag; + uint32_t vps_num_units_in_tick; + uint32_t vps_time_scale; + uint8_t vps_poc_proportional_to_timing_flag; + uint32_t vps_num_ticks_poc_diff_one_minus1; + uint16_t vps_num_hrd_parameters; + uint16_t hrd_layer_set_idx[HEVC_MAX_LAYER_SETS]; + uint8_t cprms_present_flag[HEVC_MAX_LAYER_SETS]; + H265RawHRDParameters hrd_parameters[HEVC_MAX_LAYER_SETS]; + + uint8_t vps_extension_flag; + H265RawExtensionData extension_data; +} H265RawVPS; + +typedef struct H265RawSTRefPicSet { + uint8_t inter_ref_pic_set_prediction_flag; + + uint8_t delta_idx_minus1; + uint8_t delta_rps_sign; + uint16_t abs_delta_rps_minus1; + + uint8_t used_by_curr_pic_flag[HEVC_MAX_REFS]; + uint8_t use_delta_flag[HEVC_MAX_REFS]; + + uint8_t num_negative_pics; + uint8_t num_positive_pics; + uint16_t delta_poc_s0_minus1[HEVC_MAX_REFS]; + uint8_t used_by_curr_pic_s0_flag[HEVC_MAX_REFS]; + uint16_t delta_poc_s1_minus1[HEVC_MAX_REFS]; + uint8_t used_by_curr_pic_s1_flag[HEVC_MAX_REFS]; +} H265RawSTRefPicSet; + +typedef struct H265RawScalingList { + uint8_t scaling_list_pred_mode_flag[4][6]; + uint8_t scaling_list_pred_matrix_id_delta[4][6]; + int16_t scaling_list_dc_coef_minus8[4][6]; + int8_t scaling_list_delta_coeff[4][6][64]; +} H265RawScalingList; + +typedef struct H265RawSPS { + H265RawNALUnitHeader nal_unit_header; + + uint8_t sps_video_parameter_set_id; + + uint8_t sps_max_sub_layers_minus1; + uint8_t sps_ext_or_max_sub_layers_minus1; + uint8_t sps_temporal_id_nesting_flag; + + H265RawProfileTierLevel profile_tier_level; + + uint8_t sps_seq_parameter_set_id; + + uint8_t update_rep_format_flag; + uint8_t sps_rep_format_idx; + + uint8_t chroma_format_idc; + uint8_t separate_colour_plane_flag; + + uint16_t pic_width_in_luma_samples; + uint16_t pic_height_in_luma_samples; + + uint8_t conformance_window_flag; + uint16_t conf_win_left_offset; + uint16_t conf_win_right_offset; + uint16_t conf_win_top_offset; + uint16_t conf_win_bottom_offset; + + uint8_t bit_depth_luma_minus8; + uint8_t bit_depth_chroma_minus8; + + uint8_t log2_max_pic_order_cnt_lsb_minus4; + + uint8_t sps_sub_layer_ordering_info_present_flag; + uint8_t sps_max_dec_pic_buffering_minus1[HEVC_MAX_SUB_LAYERS]; + uint8_t sps_max_num_reorder_pics[HEVC_MAX_SUB_LAYERS]; + uint32_t sps_max_latency_increase_plus1[HEVC_MAX_SUB_LAYERS]; + + uint8_t log2_min_luma_coding_block_size_minus3; + uint8_t log2_diff_max_min_luma_coding_block_size; + uint8_t log2_min_luma_transform_block_size_minus2; + uint8_t log2_diff_max_min_luma_transform_block_size; + uint8_t max_transform_hierarchy_depth_inter; + uint8_t max_transform_hierarchy_depth_intra; + + uint8_t scaling_list_enabled_flag; + uint8_t sps_infer_scaling_list_flag; + uint8_t sps_scaling_list_ref_layer_id; + uint8_t sps_scaling_list_data_present_flag; + H265RawScalingList scaling_list; + + uint8_t amp_enabled_flag; + uint8_t sample_adaptive_offset_enabled_flag; + + uint8_t pcm_enabled_flag; + uint8_t pcm_sample_bit_depth_luma_minus1; + uint8_t pcm_sample_bit_depth_chroma_minus1; + uint8_t log2_min_pcm_luma_coding_block_size_minus3; + uint8_t log2_diff_max_min_pcm_luma_coding_block_size; + uint8_t pcm_loop_filter_disabled_flag; + + uint8_t num_short_term_ref_pic_sets; + H265RawSTRefPicSet st_ref_pic_set[HEVC_MAX_SHORT_TERM_REF_PIC_SETS]; + + uint8_t long_term_ref_pics_present_flag; + uint8_t num_long_term_ref_pics_sps; + uint16_t lt_ref_pic_poc_lsb_sps[HEVC_MAX_LONG_TERM_REF_PICS]; + uint8_t used_by_curr_pic_lt_sps_flag[HEVC_MAX_LONG_TERM_REF_PICS]; + + uint8_t sps_temporal_mvp_enabled_flag; + uint8_t strong_intra_smoothing_enabled_flag; + + uint8_t vui_parameters_present_flag; + H265RawVUI vui; + + uint8_t sps_extension_present_flag; + uint8_t sps_range_extension_flag; + uint8_t sps_multilayer_extension_flag; + uint8_t sps_3d_extension_flag; + uint8_t sps_scc_extension_flag; + uint8_t sps_extension_4bits; + + H265RawExtensionData extension_data; + + // Range extension. + uint8_t transform_skip_rotation_enabled_flag; + uint8_t transform_skip_context_enabled_flag; + uint8_t implicit_rdpcm_enabled_flag; + uint8_t explicit_rdpcm_enabled_flag; + uint8_t extended_precision_processing_flag; + uint8_t intra_smoothing_disabled_flag; + uint8_t high_precision_offsets_enabled_flag; + uint8_t persistent_rice_adaptation_enabled_flag; + uint8_t cabac_bypass_alignment_enabled_flag; + + // Screen content coding extension. + uint8_t sps_curr_pic_ref_enabled_flag; + uint8_t palette_mode_enabled_flag; + uint8_t palette_max_size; + uint8_t delta_palette_max_predictor_size; + uint8_t sps_palette_predictor_initializer_present_flag; + uint8_t sps_num_palette_predictor_initializer_minus1; + uint16_t sps_palette_predictor_initializers[3][128]; + + uint8_t motion_vector_resolution_control_idc; + uint8_t intra_boundary_filtering_disable_flag; + + // Multilayer extension. + uint8_t inter_view_mv_vert_constraint_flag; +} H265RawSPS; + +typedef struct H265RawPPS { + H265RawNALUnitHeader nal_unit_header; + + uint8_t pps_pic_parameter_set_id; + uint8_t pps_seq_parameter_set_id; + + uint8_t dependent_slice_segments_enabled_flag; + uint8_t output_flag_present_flag; + uint8_t num_extra_slice_header_bits; + uint8_t sign_data_hiding_enabled_flag; + uint8_t cabac_init_present_flag; + + uint8_t num_ref_idx_l0_default_active_minus1; + uint8_t num_ref_idx_l1_default_active_minus1; + + int8_t init_qp_minus26; + + uint8_t constrained_intra_pred_flag; + uint8_t transform_skip_enabled_flag; + uint8_t cu_qp_delta_enabled_flag; + uint8_t diff_cu_qp_delta_depth; + + int8_t pps_cb_qp_offset; + int8_t pps_cr_qp_offset; + uint8_t pps_slice_chroma_qp_offsets_present_flag; + + uint8_t weighted_pred_flag; + uint8_t weighted_bipred_flag; + + uint8_t transquant_bypass_enabled_flag; + uint8_t tiles_enabled_flag; + uint8_t entropy_coding_sync_enabled_flag; + + uint8_t num_tile_columns_minus1; + uint8_t num_tile_rows_minus1; + uint8_t uniform_spacing_flag; + uint16_t column_width_minus1[HEVC_MAX_TILE_COLUMNS]; + uint16_t row_height_minus1[HEVC_MAX_TILE_ROWS]; + uint8_t loop_filter_across_tiles_enabled_flag; + + uint8_t pps_loop_filter_across_slices_enabled_flag; + uint8_t deblocking_filter_control_present_flag; + uint8_t deblocking_filter_override_enabled_flag; + uint8_t pps_deblocking_filter_disabled_flag; + int8_t pps_beta_offset_div2; + int8_t pps_tc_offset_div2; + + uint8_t pps_scaling_list_data_present_flag; + H265RawScalingList scaling_list; + + uint8_t lists_modification_present_flag; + uint8_t log2_parallel_merge_level_minus2; + + uint8_t slice_segment_header_extension_present_flag; + + uint8_t pps_extension_present_flag; + uint8_t pps_range_extension_flag; + uint8_t pps_multilayer_extension_flag; + uint8_t pps_3d_extension_flag; + uint8_t pps_scc_extension_flag; + uint8_t pps_extension_4bits; + + H265RawExtensionData extension_data; + + // Range extension. + uint8_t log2_max_transform_skip_block_size_minus2; + uint8_t cross_component_prediction_enabled_flag; + uint8_t chroma_qp_offset_list_enabled_flag; + uint8_t diff_cu_chroma_qp_offset_depth; + uint8_t chroma_qp_offset_list_len_minus1; + int8_t cb_qp_offset_list[6]; + int8_t cr_qp_offset_list[6]; + uint8_t log2_sao_offset_scale_luma; + uint8_t log2_sao_offset_scale_chroma; + + // Screen content coding extension. + uint8_t pps_curr_pic_ref_enabled_flag; + uint8_t residual_adaptive_colour_transform_enabled_flag; + uint8_t pps_slice_act_qp_offsets_present_flag; + int8_t pps_act_y_qp_offset_plus5; + int8_t pps_act_cb_qp_offset_plus5; + int8_t pps_act_cr_qp_offset_plus3; + + uint8_t pps_palette_predictor_initializer_present_flag; + uint8_t pps_num_palette_predictor_initializer; + uint8_t monochrome_palette_flag; + uint8_t luma_bit_depth_entry_minus8; + uint8_t chroma_bit_depth_entry_minus8; + uint16_t pps_palette_predictor_initializers[3][128]; + + // Multilayer extension. + uint8_t poc_reset_info_present_flag; + uint8_t pps_infer_scaling_list_flag; + uint8_t pps_scaling_list_ref_layer_id; + uint8_t num_ref_loc_offsets; + uint8_t ref_loc_offset_layer_id[64]; + uint8_t scaled_ref_layer_offset_present_flag[64]; + int16_t scaled_ref_layer_left_offset[64]; + int16_t scaled_ref_layer_top_offset[64]; + int16_t scaled_ref_layer_right_offset[64]; + int16_t scaled_ref_layer_bottom_offset[64]; + uint8_t ref_region_offset_present_flag[64]; + int16_t ref_region_left_offset[64]; + int16_t ref_region_top_offset[64]; + int16_t ref_region_right_offset[64]; + int16_t ref_region_bottom_offset[64]; + uint8_t resample_phase_set_present_flag[64]; + uint8_t phase_hor_luma[64]; + uint8_t phase_ver_luma[64]; + uint8_t phase_hor_chroma_plus8[64]; + uint8_t phase_ver_chroma_plus8[64]; + uint8_t colour_mapping_enabled_flag; + uint8_t num_cm_ref_layers_minus1; + uint8_t cm_ref_layer_id[62]; + uint8_t cm_octant_depth; + uint8_t cm_y_part_num_log2; + uint8_t luma_bit_depth_cm_input_minus8; + uint8_t chroma_bit_depth_cm_input_minus8; + uint8_t luma_bit_depth_cm_output_minus8; + uint8_t chroma_bit_depth_cm_output_minus8; + uint8_t cm_res_quant_bits; + uint8_t cm_delta_flc_bits_minus1; + int16_t cm_adapt_threshold_u_delta; + int16_t cm_adapt_threshold_v_delta; + uint8_t split_octant_flag[2]; + uint8_t coded_res_flag[12][2][2][4]; + uint8_t res_coeff_q[12][2][2][4][3]; + uint32_t res_coeff_s[12][2][2][4][3]; + uint8_t res_coeff_r[12][2][2][4][3]; +} H265RawPPS; + +typedef struct H265RawAUD { + H265RawNALUnitHeader nal_unit_header; + + uint8_t pic_type; +} H265RawAUD; + +typedef struct H265RawSliceHeader { + H265RawNALUnitHeader nal_unit_header; + + uint8_t first_slice_segment_in_pic_flag; + uint8_t no_output_of_prior_pics_flag; + uint8_t slice_pic_parameter_set_id; + + uint8_t dependent_slice_segment_flag; + uint16_t slice_segment_address; + + uint8_t slice_reserved_flag[8]; + uint8_t slice_type; + + uint8_t pic_output_flag; + uint8_t colour_plane_id; + + uint16_t slice_pic_order_cnt_lsb; + + uint8_t short_term_ref_pic_set_sps_flag; + H265RawSTRefPicSet short_term_ref_pic_set; + uint8_t short_term_ref_pic_set_idx; + + uint8_t num_long_term_sps; + uint8_t num_long_term_pics; + uint8_t lt_idx_sps[HEVC_MAX_REFS]; + uint8_t poc_lsb_lt[HEVC_MAX_REFS]; + uint8_t used_by_curr_pic_lt_flag[HEVC_MAX_REFS]; + uint8_t delta_poc_msb_present_flag[HEVC_MAX_REFS]; + uint32_t delta_poc_msb_cycle_lt[HEVC_MAX_REFS]; + + uint8_t slice_temporal_mvp_enabled_flag; + + uint8_t slice_sao_luma_flag; + uint8_t slice_sao_chroma_flag; + + uint8_t num_ref_idx_active_override_flag; + uint8_t num_ref_idx_l0_active_minus1; + uint8_t num_ref_idx_l1_active_minus1; + + uint8_t ref_pic_list_modification_flag_l0; + uint8_t list_entry_l0[HEVC_MAX_REFS]; + uint8_t ref_pic_list_modification_flag_l1; + uint8_t list_entry_l1[HEVC_MAX_REFS]; + + uint8_t mvd_l1_zero_flag; + uint8_t cabac_init_flag; + uint8_t collocated_from_l0_flag; + uint8_t collocated_ref_idx; + + uint8_t luma_log2_weight_denom; + int8_t delta_chroma_log2_weight_denom; + uint8_t luma_weight_l0_flag[HEVC_MAX_REFS]; + uint8_t chroma_weight_l0_flag[HEVC_MAX_REFS]; + int8_t delta_luma_weight_l0[HEVC_MAX_REFS]; + int16_t luma_offset_l0[HEVC_MAX_REFS]; + int8_t delta_chroma_weight_l0[HEVC_MAX_REFS][2]; + int16_t chroma_offset_l0[HEVC_MAX_REFS][2]; + uint8_t luma_weight_l1_flag[HEVC_MAX_REFS]; + uint8_t chroma_weight_l1_flag[HEVC_MAX_REFS]; + int8_t delta_luma_weight_l1[HEVC_MAX_REFS]; + int16_t luma_offset_l1[HEVC_MAX_REFS]; + int8_t delta_chroma_weight_l1[HEVC_MAX_REFS][2]; + int16_t chroma_offset_l1[HEVC_MAX_REFS][2]; + + uint8_t five_minus_max_num_merge_cand; + uint8_t use_integer_mv_flag; + + int8_t slice_qp_delta; + int8_t slice_cb_qp_offset; + int8_t slice_cr_qp_offset; + int8_t slice_act_y_qp_offset; + int8_t slice_act_cb_qp_offset; + int8_t slice_act_cr_qp_offset; + uint8_t cu_chroma_qp_offset_enabled_flag; + + uint8_t deblocking_filter_override_flag; + uint8_t slice_deblocking_filter_disabled_flag; + int8_t slice_beta_offset_div2; + int8_t slice_tc_offset_div2; + uint8_t slice_loop_filter_across_slices_enabled_flag; + + uint16_t num_entry_point_offsets; + uint8_t offset_len_minus1; + uint32_t entry_point_offset_minus1[HEVC_MAX_ENTRY_POINT_OFFSETS]; + + uint16_t slice_segment_header_extension_length; + uint8_t slice_segment_header_extension_data_byte[256]; +} H265RawSliceHeader; + + +typedef struct H265RawSlice { + H265RawSliceHeader header; + + uint8_t *data; + AVBufferRef *data_ref; + size_t data_size; + int data_bit_start; +} H265RawSlice; + + +typedef struct H265RawSEIBufferingPeriod { + uint8_t bp_seq_parameter_set_id; + uint8_t irap_cpb_params_present_flag; + uint32_t cpb_delay_offset; + uint32_t dpb_delay_offset; + uint8_t concatenation_flag; + uint32_t au_cpb_removal_delay_delta_minus1; + + uint32_t nal_initial_cpb_removal_delay[HEVC_MAX_CPB_CNT]; + uint32_t nal_initial_cpb_removal_offset[HEVC_MAX_CPB_CNT]; + uint32_t nal_initial_alt_cpb_removal_delay[HEVC_MAX_CPB_CNT]; + uint32_t nal_initial_alt_cpb_removal_offset[HEVC_MAX_CPB_CNT]; + + uint32_t vcl_initial_cpb_removal_delay[HEVC_MAX_CPB_CNT]; + uint32_t vcl_initial_cpb_removal_offset[HEVC_MAX_CPB_CNT]; + uint32_t vcl_initial_alt_cpb_removal_delay[HEVC_MAX_CPB_CNT]; + uint32_t vcl_initial_alt_cpb_removal_offset[HEVC_MAX_CPB_CNT]; + + uint8_t use_alt_cpb_params_flag; +} H265RawSEIBufferingPeriod; + +typedef struct H265RawSEIPicTiming { + uint8_t pic_struct; + uint8_t source_scan_type; + uint8_t duplicate_flag; + + uint32_t au_cpb_removal_delay_minus1; + uint32_t pic_dpb_output_delay; + uint32_t pic_dpb_output_du_delay; + + uint16_t num_decoding_units_minus1; + uint8_t du_common_cpb_removal_delay_flag; + uint32_t du_common_cpb_removal_delay_increment_minus1; + uint16_t num_nalus_in_du_minus1[HEVC_MAX_SLICE_SEGMENTS]; + uint32_t du_cpb_removal_delay_increment_minus1[HEVC_MAX_SLICE_SEGMENTS]; +} H265RawSEIPicTiming; + +typedef struct H265RawSEIPanScanRect { + uint32_t pan_scan_rect_id; + uint8_t pan_scan_rect_cancel_flag; + uint8_t pan_scan_cnt_minus1; + int32_t pan_scan_rect_left_offset[3]; + int32_t pan_scan_rect_right_offset[3]; + int32_t pan_scan_rect_top_offset[3]; + int32_t pan_scan_rect_bottom_offset[3]; + uint16_t pan_scan_rect_persistence_flag; +} H265RawSEIPanScanRect; + +typedef struct H265RawSEIRecoveryPoint { + int16_t recovery_poc_cnt; + uint8_t exact_match_flag; + uint8_t broken_link_flag; +} H265RawSEIRecoveryPoint; + +typedef struct H265RawFilmGrainCharacteristics { + uint8_t film_grain_characteristics_cancel_flag; + uint8_t film_grain_model_id; + uint8_t separate_colour_description_present_flag; + uint8_t film_grain_bit_depth_luma_minus8; + uint8_t film_grain_bit_depth_chroma_minus8; + uint8_t film_grain_full_range_flag; + uint8_t film_grain_colour_primaries; + uint8_t film_grain_transfer_characteristics; + uint8_t film_grain_matrix_coeffs; + uint8_t blending_mode_id; + uint8_t log2_scale_factor; + uint8_t comp_model_present_flag[3]; + uint8_t num_intensity_intervals_minus1[3]; + uint8_t num_model_values_minus1[3]; + uint8_t intensity_interval_lower_bound[3][256]; + uint8_t intensity_interval_upper_bound[3][256]; + int16_t comp_model_value[3][256][6]; + uint8_t film_grain_characteristics_persistence_flag; +} H265RawFilmGrainCharacteristics; + +typedef struct H265RawSEIDisplayOrientation { + uint8_t display_orientation_cancel_flag; + uint8_t hor_flip; + uint8_t ver_flip; + uint16_t anticlockwise_rotation; + uint16_t display_orientation_repetition_period; + uint8_t display_orientation_persistence_flag; +} H265RawSEIDisplayOrientation; + +typedef struct H265RawSEIActiveParameterSets { + uint8_t active_video_parameter_set_id; + uint8_t self_contained_cvs_flag; + uint8_t no_parameter_set_update_flag; + uint8_t num_sps_ids_minus1; + uint8_t active_seq_parameter_set_id[HEVC_MAX_SPS_COUNT]; + uint8_t layer_sps_idx[HEVC_MAX_LAYERS]; +} H265RawSEIActiveParameterSets; + +typedef struct H265RawSEIDecodedPictureHash { + uint8_t hash_type; + uint8_t picture_md5[3][16]; + uint16_t picture_crc[3]; + uint32_t picture_checksum[3]; +} H265RawSEIDecodedPictureHash; + +typedef struct H265RawSEITimeCode { + uint8_t num_clock_ts; + uint8_t clock_timestamp_flag[3]; + uint8_t units_field_based_flag[3]; + uint8_t counting_type[3]; + uint8_t full_timestamp_flag[3]; + uint8_t discontinuity_flag[3]; + uint8_t cnt_dropped_flag[3]; + uint16_t n_frames[3]; + uint8_t seconds_value[3]; + uint8_t minutes_value[3]; + uint8_t hours_value[3]; + uint8_t seconds_flag[3]; + uint8_t minutes_flag[3]; + uint8_t hours_flag[3]; + uint8_t time_offset_length[3]; + int32_t time_offset_value[3]; +} H265RawSEITimeCode; + +typedef struct H265RawSEIAlphaChannelInfo { + uint8_t alpha_channel_cancel_flag; + uint8_t alpha_channel_use_idc; + uint8_t alpha_channel_bit_depth_minus8; + uint16_t alpha_transparent_value; + uint16_t alpha_opaque_value; + uint8_t alpha_channel_incr_flag; + uint8_t alpha_channel_clip_flag; + uint8_t alpha_channel_clip_type_flag; +} H265RawSEIAlphaChannelInfo; + +typedef struct H265RawSEI3DReferenceDisplaysInfo { + uint8_t prec_ref_display_width; + uint8_t ref_viewing_distance_flag; + uint8_t prec_ref_viewing_dist; + uint8_t num_ref_displays_minus1; + uint16_t left_view_id[32]; + uint16_t right_view_id[32]; + uint8_t exponent_ref_display_width[32]; + uint8_t mantissa_ref_display_width[32]; + uint8_t exponent_ref_viewing_distance[32]; + uint8_t mantissa_ref_viewing_distance[32]; + uint8_t additional_shift_present_flag[32]; + uint16_t num_sample_shift_plus512[32]; + uint8_t three_dimensional_reference_displays_extension_flag; +} H265RawSEI3DReferenceDisplaysInfo; + +typedef struct H265RawSEI { + H265RawNALUnitHeader nal_unit_header; + SEIRawMessageList message_list; +} H265RawSEI; + +typedef struct H265RawFiller { + H265RawNALUnitHeader nal_unit_header; + + uint32_t filler_size; +} H265RawFiller; + +typedef struct CodedBitstreamH265Context { + // Reader/writer context in common with the H.264 implementation. + CodedBitstreamH2645Context common; + + // All currently available parameter sets. These are updated when + // any parameter set NAL unit is read/written with this context. + H265RawVPS *vps[HEVC_MAX_VPS_COUNT]; ///< RefStruct references + H265RawSPS *sps[HEVC_MAX_SPS_COUNT]; ///< RefStruct references + H265RawPPS *pps[HEVC_MAX_PPS_COUNT]; ///< RefStruct references + + // The currently active parameter sets. These are updated when any + // NAL unit refers to the relevant parameter set. These pointers + // must also be present in the arrays above. + const H265RawVPS *active_vps; + const H265RawSPS *active_sps; + const H265RawPPS *active_pps; +} CodedBitstreamH265Context; + + +#endif /* AVCODEC_CBS_H265_H */ diff --git a/include/libavcodec/cbs_h266.h b/include/libavcodec/cbs_h266.h new file mode 100644 index 0000000..d24a8e9 --- /dev/null +++ b/include/libavcodec/cbs_h266.h @@ -0,0 +1,869 @@ +/* + * 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_CBS_H266_H +#define AVCODEC_CBS_H266_H + +#include +#include + +#include "cbs_h2645.h" +#include "cbs_sei.h" +#include "vvc.h" + +typedef struct H266RawNALUnitHeader { + uint8_t nuh_layer_id; + uint8_t nal_unit_type; + uint8_t nuh_temporal_id_plus1; + uint8_t nuh_reserved_zero_bit; +} H266RawNALUnitHeader; + +typedef struct H266GeneralConstraintsInfo { + uint8_t gci_present_flag; + /* general */ + uint8_t gci_intra_only_constraint_flag; + uint8_t gci_all_layers_independent_constraint_flag; + uint8_t gci_one_au_only_constraint_flag; + + /* picture format */ + uint8_t gci_sixteen_minus_max_bitdepth_constraint_idc; + uint8_t gci_three_minus_max_chroma_format_constraint_idc; + + /* NAL unit type related */ + uint8_t gci_no_mixed_nalu_types_in_pic_constraint_flag; + uint8_t gci_no_trail_constraint_flag; + uint8_t gci_no_stsa_constraint_flag; + uint8_t gci_no_rasl_constraint_flag; + uint8_t gci_no_radl_constraint_flag; + uint8_t gci_no_idr_constraint_flag; + uint8_t gci_no_cra_constraint_flag; + uint8_t gci_no_gdr_constraint_flag; + uint8_t gci_no_aps_constraint_flag; + uint8_t gci_no_idr_rpl_constraint_flag; + + /* tile, slice, subpicture partitioning */ + uint8_t gci_one_tile_per_pic_constraint_flag; + uint8_t gci_pic_header_in_slice_header_constraint_flag; + uint8_t gci_one_slice_per_pic_constraint_flag; + uint8_t gci_no_rectangular_slice_constraint_flag; + uint8_t gci_one_slice_per_subpic_constraint_flag; + uint8_t gci_no_subpic_info_constraint_flag; + + /* CTU and block partitioning */ + uint8_t gci_three_minus_max_log2_ctu_size_constraint_idc; + uint8_t gci_no_partition_constraints_override_constraint_flag; + uint8_t gci_no_mtt_constraint_flag; + uint8_t gci_no_qtbtt_dual_tree_intra_constraint_flag; + + /* intra */ + uint8_t gci_no_palette_constraint_flag; + uint8_t gci_no_ibc_constraint_flag; + uint8_t gci_no_isp_constraint_flag; + uint8_t gci_no_mrl_constraint_flag; + uint8_t gci_no_mip_constraint_flag; + uint8_t gci_no_cclm_constraint_flag; + + /* inter */ + uint8_t gci_no_ref_pic_resampling_constraint_flag; + uint8_t gci_no_res_change_in_clvs_constraint_flag; + uint8_t gci_no_weighted_prediction_constraint_flag; + uint8_t gci_no_ref_wraparound_constraint_flag; + uint8_t gci_no_temporal_mvp_constraint_flag; + uint8_t gci_no_sbtmvp_constraint_flag; + uint8_t gci_no_amvr_constraint_flag; + uint8_t gci_no_bdof_constraint_flag; + uint8_t gci_no_smvd_constraint_flag; + uint8_t gci_no_dmvr_constraint_flag; + uint8_t gci_no_mmvd_constraint_flag; + uint8_t gci_no_affine_motion_constraint_flag; + uint8_t gci_no_prof_constraint_flag; + uint8_t gci_no_bcw_constraint_flag; + uint8_t gci_no_ciip_constraint_flag; + uint8_t gci_no_gpm_constraint_flag; + + /* transform, quantization, residual */ + uint8_t gci_no_luma_transform_size_64_constraint_flag; + uint8_t gci_no_transform_skip_constraint_flag; + uint8_t gci_no_bdpcm_constraint_flag; + uint8_t gci_no_mts_constraint_flag; + uint8_t gci_no_lfnst_constraint_flag; + uint8_t gci_no_joint_cbcr_constraint_flag; + uint8_t gci_no_sbt_constraint_flag; + uint8_t gci_no_act_constraint_flag; + uint8_t gci_no_explicit_scaling_list_constraint_flag; + uint8_t gci_no_dep_quant_constraint_flag; + uint8_t gci_no_sign_data_hiding_constraint_flag; + uint8_t gci_no_cu_qp_delta_constraint_flag; + uint8_t gci_no_chroma_qp_offset_constraint_flag; + + /* loop filter */ + uint8_t gci_no_sao_constraint_flag; + uint8_t gci_no_alf_constraint_flag; + uint8_t gci_no_ccalf_constraint_flag; + uint8_t gci_no_lmcs_constraint_flag; + uint8_t gci_no_ladf_constraint_flag; + uint8_t gci_no_virtual_boundaries_constraint_flag; + + uint8_t gci_num_additional_bits; + uint8_t gci_reserved_bit[255]; + + uint8_t gci_all_rap_pictures_constraint_flag; + uint8_t gci_no_extended_precision_processing_constraint_flag; + uint8_t gci_no_ts_residual_coding_rice_constraint_flag; + uint8_t gci_no_rrc_rice_extension_constraint_flag; + uint8_t gci_no_persistent_rice_adaptation_constraint_flag; + uint8_t gci_no_reverse_last_sig_coeff_constraint_flag; +} H266GeneralConstraintsInfo; + +typedef struct H266RawProfileTierLevel { + uint8_t general_profile_idc; + uint8_t general_tier_flag; + uint8_t general_level_idc; + uint8_t ptl_frame_only_constraint_flag; + uint8_t ptl_multilayer_enabled_flag; + H266GeneralConstraintsInfo general_constraints_info; + uint8_t ptl_sublayer_level_present_flag[VVC_MAX_SUBLAYERS - 1]; + uint8_t sublayer_level_idc[VVC_MAX_SUBLAYERS - 1]; + uint8_t ptl_num_sub_profiles; + uint32_t general_sub_profile_idc[VVC_MAX_SUB_PROFILES]; + + uint8_t ptl_reserved_zero_bit; +} H266RawProfileTierLevel; + +typedef struct H266RawExtensionData { + uint8_t *data; + AVBufferRef *data_ref; + size_t bit_length; +} H266RawExtensionData; + +typedef struct H266DpbParameters { + uint8_t dpb_max_dec_pic_buffering_minus1[VVC_MAX_SUBLAYERS]; + uint8_t dpb_max_num_reorder_pics[VVC_MAX_SUBLAYERS]; + uint8_t dpb_max_latency_increase_plus1[VVC_MAX_SUBLAYERS]; +} H266DpbParameters; + +typedef struct H266RefPicListStruct { + uint8_t num_ref_entries; + uint8_t ltrp_in_header_flag; + uint8_t inter_layer_ref_pic_flag[VVC_MAX_REF_ENTRIES]; + uint8_t st_ref_pic_flag[VVC_MAX_REF_ENTRIES]; + uint8_t abs_delta_poc_st[VVC_MAX_REF_ENTRIES]; + uint8_t strp_entry_sign_flag[VVC_MAX_REF_ENTRIES]; + uint8_t rpls_poc_lsb_lt[VVC_MAX_REF_ENTRIES]; + uint8_t ilrp_idx[VVC_MAX_REF_ENTRIES]; +} H266RefPicListStruct; + +typedef struct H266RefPicLists { + uint8_t rpl_sps_flag[2]; + uint8_t rpl_idx[2]; + H266RefPicListStruct rpl_ref_list[2]; + uint16_t poc_lsb_lt[2][VVC_MAX_REF_ENTRIES]; + uint8_t delta_poc_msb_cycle_present_flag[2][VVC_MAX_REF_ENTRIES]; + uint16_t delta_poc_msb_cycle_lt[2][VVC_MAX_REF_ENTRIES]; +} H266RefPicLists; + +typedef struct H266RawGeneralTimingHrdParameters { + uint32_t num_units_in_tick; + uint32_t time_scale; + uint8_t general_nal_hrd_params_present_flag; + uint8_t general_vcl_hrd_params_present_flag; + uint8_t general_same_pic_timing_in_all_ols_flag; + uint8_t general_du_hrd_params_present_flag; + uint8_t tick_divisor_minus2; + uint8_t bit_rate_scale; + uint8_t cpb_size_scale; + uint8_t cpb_size_du_scale; + uint8_t hrd_cpb_cnt_minus1; +} H266RawGeneralTimingHrdParameters; + +typedef struct H266RawSubLayerHRDParameters { + uint32_t bit_rate_value_minus1[VVC_MAX_SUBLAYERS][VVC_MAX_CPB_CNT]; + uint32_t cpb_size_value_minus1[VVC_MAX_SUBLAYERS][VVC_MAX_CPB_CNT]; + uint32_t cpb_size_du_value_minus1[VVC_MAX_SUBLAYERS][VVC_MAX_CPB_CNT]; + uint32_t bit_rate_du_value_minus1[VVC_MAX_SUBLAYERS][VVC_MAX_CPB_CNT]; + uint8_t cbr_flag[VVC_MAX_SUBLAYERS][VVC_MAX_CPB_CNT]; +} H266RawSubLayerHRDParameters; + +typedef struct H266RawOlsTimingHrdParameters { + uint8_t fixed_pic_rate_general_flag[VVC_MAX_SUBLAYERS]; + uint8_t fixed_pic_rate_within_cvs_flag[VVC_MAX_SUBLAYERS]; + uint16_t elemental_duration_in_tc_minus1[VVC_MAX_SUBLAYERS]; + uint8_t low_delay_hrd_flag[VVC_MAX_SUBLAYERS]; + H266RawSubLayerHRDParameters nal_sub_layer_hrd_parameters; + H266RawSubLayerHRDParameters vcl_sub_layer_hrd_parameters; +} H266RawOlsTimingHrdParameters; + +typedef struct H266RawVUI { + uint8_t vui_progressive_source_flag; + uint8_t vui_interlaced_source_flag; + uint8_t vui_non_packed_constraint_flag; + uint8_t vui_non_projected_constraint_flag; + + uint8_t vui_aspect_ratio_info_present_flag; + uint8_t vui_aspect_ratio_constant_flag; + uint8_t vui_aspect_ratio_idc; + + uint16_t vui_sar_width; + uint16_t vui_sar_height; + + uint8_t vui_overscan_info_present_flag; + uint8_t vui_overscan_appropriate_flag; + + uint8_t vui_colour_description_present_flag; + uint8_t vui_colour_primaries; + + uint8_t vui_transfer_characteristics; + uint8_t vui_matrix_coeffs; + uint8_t vui_full_range_flag; + + uint8_t vui_chroma_loc_info_present_flag; + uint8_t vui_chroma_sample_loc_type_frame; + uint8_t vui_chroma_sample_loc_type_top_field; + uint8_t vui_chroma_sample_loc_type_bottom_field; + H266RawExtensionData extension_data; +} H266RawVUI; + +typedef struct H266RawOPI { + H266RawNALUnitHeader nal_unit_header; + + uint8_t opi_ols_info_present_flag; + uint8_t opi_htid_info_present_flag; + uint16_t opi_ols_idx; + uint8_t opi_htid_plus1; + uint8_t opi_extension_flag; + H266RawExtensionData extension_data; +} H266RawOPI; + +typedef struct H266RawDCI { + H266RawNALUnitHeader nal_unit_header; + + uint8_t dci_reserved_zero_4bits; + uint8_t dci_num_ptls_minus1; + H266RawProfileTierLevel dci_profile_tier_level[VVC_MAX_DCI_PTLS]; + uint8_t dci_extension_flag; + H266RawExtensionData extension_data; +} H266RawDCI; + +typedef struct H266RawVPS { + H266RawNALUnitHeader nal_unit_header; + + uint8_t vps_video_parameter_set_id; + uint8_t vps_max_layers_minus1; + uint8_t vps_max_sublayers_minus1; + uint8_t vps_default_ptl_dpb_hrd_max_tid_flag; + uint8_t vps_all_independent_layers_flag; + uint8_t vps_layer_id[VVC_MAX_LAYERS]; + uint8_t vps_independent_layer_flag[VVC_MAX_LAYERS]; + uint8_t vps_max_tid_ref_present_flag[VVC_MAX_LAYERS]; + uint8_t vps_direct_ref_layer_flag[VVC_MAX_LAYERS][VVC_MAX_LAYERS - 1]; + uint8_t vps_max_tid_il_ref_pics_plus1[VVC_MAX_LAYERS][VVC_MAX_LAYERS - 1]; + uint8_t vps_each_layer_is_an_ols_flag; + uint8_t vps_ols_mode_idc; + uint8_t vps_num_output_layer_sets_minus2; + uint8_t vps_ols_output_layer_flag[VVC_MAX_TOTAL_NUM_OLSS][VVC_MAX_LAYERS]; + + uint8_t vps_num_ptls_minus1; + uint8_t vps_pt_present_flag[VVC_MAX_PTLS]; + uint8_t vps_ptl_max_tid[VVC_MAX_PTLS]; + H266RawProfileTierLevel vps_profile_tier_level[VVC_MAX_PTLS]; + uint8_t vps_ols_ptl_idx[VVC_MAX_TOTAL_NUM_OLSS]; + + uint16_t vps_num_dpb_params_minus1; + uint8_t vps_sublayer_dpb_params_present_flag; + uint8_t vps_dpb_max_tid[VVC_MAX_TOTAL_NUM_OLSS]; + H266DpbParameters vps_dpb_params[VVC_MAX_TOTAL_NUM_OLSS]; + uint16_t vps_ols_dpb_pic_width[VVC_MAX_TOTAL_NUM_OLSS]; + uint16_t vps_ols_dpb_pic_height[VVC_MAX_TOTAL_NUM_OLSS]; + uint8_t vps_ols_dpb_chroma_format[VVC_MAX_TOTAL_NUM_OLSS]; + uint8_t vps_ols_dpb_bitdepth_minus8[VVC_MAX_TOTAL_NUM_OLSS]; + uint16_t vps_ols_dpb_params_idx[VVC_MAX_TOTAL_NUM_OLSS]; + + uint8_t vps_timing_hrd_params_present_flag; + H266RawGeneralTimingHrdParameters vps_general_timing_hrd_parameters; + uint8_t vps_sublayer_cpb_params_present_flag; + uint16_t vps_num_ols_timing_hrd_params_minus1; + uint8_t vps_hrd_max_tid[VVC_MAX_TOTAL_NUM_OLSS]; + H266RawOlsTimingHrdParameters vps_ols_timing_hrd_parameters; + uint8_t vps_ols_timing_hrd_idx[VVC_MAX_TOTAL_NUM_OLSS]; + + uint8_t vps_extension_flag; + H266RawExtensionData extension_data; +} H266RawVPS; + +typedef struct H266RawSPS { + H266RawNALUnitHeader nal_unit_header; + + uint8_t sps_seq_parameter_set_id; + uint8_t sps_video_parameter_set_id; + uint8_t sps_max_sublayers_minus1; + uint8_t sps_chroma_format_idc; + uint8_t sps_log2_ctu_size_minus5; + uint8_t sps_ptl_dpb_hrd_params_present_flag; + H266RawProfileTierLevel profile_tier_level; + uint8_t sps_gdr_enabled_flag; + uint8_t sps_ref_pic_resampling_enabled_flag; + uint8_t sps_res_change_in_clvs_allowed_flag; + + uint16_t sps_pic_width_max_in_luma_samples; + uint16_t sps_pic_height_max_in_luma_samples; + + uint8_t sps_conformance_window_flag; + uint16_t sps_conf_win_left_offset; + uint16_t sps_conf_win_right_offset; + uint16_t sps_conf_win_top_offset; + uint16_t sps_conf_win_bottom_offset; + + uint8_t sps_subpic_info_present_flag; + uint16_t sps_num_subpics_minus1; + uint8_t sps_independent_subpics_flag; + uint8_t sps_subpic_same_size_flag; + uint16_t sps_subpic_ctu_top_left_x[VVC_MAX_SLICES]; + uint16_t sps_subpic_ctu_top_left_y[VVC_MAX_SLICES]; + uint16_t sps_subpic_width_minus1[VVC_MAX_SLICES]; + uint16_t sps_subpic_height_minus1[VVC_MAX_SLICES]; + uint8_t sps_subpic_treated_as_pic_flag[VVC_MAX_SLICES]; + uint8_t sps_loop_filter_across_subpic_enabled_flag[VVC_MAX_SLICES]; + uint8_t sps_subpic_id_len_minus1; + uint8_t sps_subpic_id_mapping_explicitly_signalled_flag; + uint8_t sps_subpic_id_mapping_present_flag; + uint32_t sps_subpic_id[VVC_MAX_SLICES]; + + + uint8_t sps_bitdepth_minus8; + uint8_t sps_entropy_coding_sync_enabled_flag; + uint8_t sps_entry_point_offsets_present_flag; + + uint8_t sps_log2_max_pic_order_cnt_lsb_minus4; + uint8_t sps_poc_msb_cycle_flag; + uint8_t sps_poc_msb_cycle_len_minus1; + + uint8_t sps_num_extra_ph_bytes; + uint8_t sps_extra_ph_bit_present_flag[16]; + + uint8_t sps_num_extra_sh_bytes; + uint8_t sps_extra_sh_bit_present_flag[16]; + + uint8_t sps_sublayer_dpb_params_flag; + H266DpbParameters sps_dpb_params; + + uint8_t sps_log2_min_luma_coding_block_size_minus2; + uint8_t sps_partition_constraints_override_enabled_flag; + uint8_t sps_log2_diff_min_qt_min_cb_intra_slice_luma; + uint8_t sps_max_mtt_hierarchy_depth_intra_slice_luma; + uint8_t sps_log2_diff_max_bt_min_qt_intra_slice_luma; + uint8_t sps_log2_diff_max_tt_min_qt_intra_slice_luma; + + uint8_t sps_qtbtt_dual_tree_intra_flag; + uint8_t sps_log2_diff_min_qt_min_cb_intra_slice_chroma; + uint8_t sps_max_mtt_hierarchy_depth_intra_slice_chroma; + uint8_t sps_log2_diff_max_bt_min_qt_intra_slice_chroma; + uint8_t sps_log2_diff_max_tt_min_qt_intra_slice_chroma; + + uint8_t sps_log2_diff_min_qt_min_cb_inter_slice; + uint8_t sps_max_mtt_hierarchy_depth_inter_slice; + uint8_t sps_log2_diff_max_bt_min_qt_inter_slice; + uint8_t sps_log2_diff_max_tt_min_qt_inter_slice; + + uint8_t sps_max_luma_transform_size_64_flag; + + uint8_t sps_transform_skip_enabled_flag; + uint8_t sps_log2_transform_skip_max_size_minus2; + uint8_t sps_bdpcm_enabled_flag; + + uint8_t sps_mts_enabled_flag; + uint8_t sps_explicit_mts_intra_enabled_flag; + uint8_t sps_explicit_mts_inter_enabled_flag; + + uint8_t sps_lfnst_enabled_flag; + + uint8_t sps_joint_cbcr_enabled_flag; + uint8_t sps_same_qp_table_for_chroma_flag; + + int8_t sps_qp_table_start_minus26[VVC_MAX_SAMPLE_ARRAYS]; + uint8_t sps_num_points_in_qp_table_minus1[VVC_MAX_SAMPLE_ARRAYS]; + uint8_t sps_delta_qp_in_val_minus1[VVC_MAX_SAMPLE_ARRAYS][VVC_MAX_POINTS_IN_QP_TABLE]; + uint8_t sps_delta_qp_diff_val[VVC_MAX_SAMPLE_ARRAYS][VVC_MAX_POINTS_IN_QP_TABLE]; + + uint8_t sps_sao_enabled_flag; + uint8_t sps_alf_enabled_flag; + uint8_t sps_ccalf_enabled_flag; + uint8_t sps_lmcs_enabled_flag; + uint8_t sps_weighted_pred_flag; + uint8_t sps_weighted_bipred_flag; + uint8_t sps_long_term_ref_pics_flag; + uint8_t sps_inter_layer_prediction_enabled_flag; + uint8_t sps_idr_rpl_present_flag; + uint8_t sps_rpl1_same_as_rpl0_flag; + + uint8_t sps_num_ref_pic_lists[2]; + H266RefPicListStruct sps_ref_pic_list_struct[2][VVC_MAX_REF_PIC_LISTS]; + + uint8_t sps_ref_wraparound_enabled_flag; + uint8_t sps_temporal_mvp_enabled_flag; + uint8_t sps_sbtmvp_enabled_flag; + uint8_t sps_amvr_enabled_flag; + uint8_t sps_bdof_enabled_flag; + uint8_t sps_bdof_control_present_in_ph_flag; + uint8_t sps_smvd_enabled_flag; + uint8_t sps_dmvr_enabled_flag; + uint8_t sps_dmvr_control_present_in_ph_flag; + uint8_t sps_mmvd_enabled_flag; + uint8_t sps_mmvd_fullpel_only_enabled_flag; + uint8_t sps_six_minus_max_num_merge_cand; + uint8_t sps_sbt_enabled_flag; + uint8_t sps_affine_enabled_flag; + uint8_t sps_five_minus_max_num_subblock_merge_cand; + uint8_t sps_6param_affine_enabled_flag; + uint8_t sps_affine_amvr_enabled_flag; + uint8_t sps_affine_prof_enabled_flag; + uint8_t sps_prof_control_present_in_ph_flag; + uint8_t sps_bcw_enabled_flag; + uint8_t sps_ciip_enabled_flag; + uint8_t sps_gpm_enabled_flag; + uint8_t sps_max_num_merge_cand_minus_max_num_gpm_cand; + uint8_t sps_log2_parallel_merge_level_minus2; + uint8_t sps_isp_enabled_flag; + uint8_t sps_mrl_enabled_flag; + uint8_t sps_mip_enabled_flag; + uint8_t sps_cclm_enabled_flag; + uint8_t sps_chroma_horizontal_collocated_flag; + uint8_t sps_chroma_vertical_collocated_flag; + uint8_t sps_palette_enabled_flag; + uint8_t sps_act_enabled_flag; + uint8_t sps_min_qp_prime_ts; + uint8_t sps_ibc_enabled_flag; + uint8_t sps_six_minus_max_num_ibc_merge_cand; + uint8_t sps_ladf_enabled_flag; + uint8_t sps_num_ladf_intervals_minus2; + int8_t sps_ladf_lowest_interval_qp_offset; + int8_t sps_ladf_qp_offset[4]; + uint16_t sps_ladf_delta_threshold_minus1[4]; + + uint8_t sps_explicit_scaling_list_enabled_flag; + uint8_t sps_scaling_matrix_for_lfnst_disabled_flag; + uint8_t sps_scaling_matrix_for_alternative_colour_space_disabled_flag; + uint8_t sps_scaling_matrix_designated_colour_space_flag; + uint8_t sps_dep_quant_enabled_flag; + uint8_t sps_sign_data_hiding_enabled_flag; + + uint8_t sps_virtual_boundaries_enabled_flag; + uint8_t sps_virtual_boundaries_present_flag; + uint8_t sps_num_ver_virtual_boundaries; + uint16_t sps_virtual_boundary_pos_x_minus1[VVC_MAX_VBS]; + uint8_t sps_num_hor_virtual_boundaries; + uint16_t sps_virtual_boundary_pos_y_minus1[VVC_MAX_VBS]; + + uint8_t sps_timing_hrd_params_present_flag; + uint8_t sps_sublayer_cpb_params_present_flag; + H266RawGeneralTimingHrdParameters sps_general_timing_hrd_parameters; + H266RawOlsTimingHrdParameters sps_ols_timing_hrd_parameters; + + uint8_t sps_field_seq_flag; + uint8_t sps_vui_parameters_present_flag; + uint16_t sps_vui_payload_size_minus1; + H266RawVUI vui; + + uint8_t sps_extension_flag; + + uint8_t sps_range_extension_flag; + uint8_t sps_extension_7bits; + + uint8_t sps_extended_precision_flag; + uint8_t sps_ts_residual_coding_rice_present_in_sh_flag; + uint8_t sps_rrc_rice_extension_flag; + uint8_t sps_persistent_rice_adaptation_enabled_flag; + uint8_t sps_reverse_last_sig_coeff_enabled_flag; + + H266RawExtensionData extension_data; + +} H266RawSPS; + +typedef struct H266RawPPS { + H266RawNALUnitHeader nal_unit_header; + + uint8_t pps_pic_parameter_set_id; + uint8_t pps_seq_parameter_set_id; + uint8_t pps_mixed_nalu_types_in_pic_flag; + uint16_t pps_pic_width_in_luma_samples; + uint16_t pps_pic_height_in_luma_samples; + + uint8_t pps_conformance_window_flag; + uint16_t pps_conf_win_left_offset; + uint16_t pps_conf_win_right_offset; + uint16_t pps_conf_win_top_offset; + uint16_t pps_conf_win_bottom_offset; + + uint8_t pps_scaling_window_explicit_signalling_flag; + int16_t pps_scaling_win_left_offset; + int16_t pps_scaling_win_right_offset; + int16_t pps_scaling_win_top_offset; + int16_t pps_scaling_win_bottom_offset; + + uint8_t pps_output_flag_present_flag; + uint8_t pps_no_pic_partition_flag; + + uint8_t pps_subpic_id_mapping_present_flag; + uint16_t pps_num_subpics_minus1; + uint8_t pps_subpic_id_len_minus1; + uint16_t pps_subpic_id[VVC_MAX_SLICES]; + + uint8_t pps_log2_ctu_size_minus5; + uint8_t pps_num_exp_tile_columns_minus1; + uint8_t pps_num_exp_tile_rows_minus1; + uint16_t pps_tile_column_width_minus1[VVC_MAX_TILE_COLUMNS]; + uint16_t pps_tile_row_height_minus1[VVC_MAX_TILE_ROWS]; + + uint8_t pps_loop_filter_across_tiles_enabled_flag; + uint8_t pps_rect_slice_flag; + uint8_t pps_single_slice_per_subpic_flag; + + uint16_t pps_num_slices_in_pic_minus1; + uint8_t pps_tile_idx_delta_present_flag; + uint16_t pps_slice_width_in_tiles_minus1[VVC_MAX_SLICES]; + uint16_t pps_slice_height_in_tiles_minus1[VVC_MAX_SLICES]; + uint16_t pps_num_exp_slices_in_tile[VVC_MAX_SLICES]; + uint16_t pps_exp_slice_height_in_ctus_minus1[VVC_MAX_SLICES][VVC_MAX_TILE_ROWS]; + int16_t pps_tile_idx_delta_val[VVC_MAX_SLICES]; + + uint8_t pps_loop_filter_across_slices_enabled_flag; + uint8_t pps_cabac_init_present_flag; + uint8_t pps_num_ref_idx_default_active_minus1[2]; + uint8_t pps_rpl1_idx_present_flag; + uint8_t pps_weighted_pred_flag; + uint8_t pps_weighted_bipred_flag; + uint8_t pps_ref_wraparound_enabled_flag; + uint16_t pps_pic_width_minus_wraparound_offset; + int8_t pps_init_qp_minus26; + uint8_t pps_cu_qp_delta_enabled_flag; + uint8_t pps_chroma_tool_offsets_present_flag; + int8_t pps_cb_qp_offset; + int8_t pps_cr_qp_offset; + uint8_t pps_joint_cbcr_qp_offset_present_flag; + int8_t pps_joint_cbcr_qp_offset_value; + uint8_t pps_slice_chroma_qp_offsets_present_flag; + uint8_t pps_cu_chroma_qp_offset_list_enabled_flag; + uint8_t pps_chroma_qp_offset_list_len_minus1; + int8_t pps_cb_qp_offset_list[6]; + int8_t pps_cr_qp_offset_list[6]; + int8_t pps_joint_cbcr_qp_offset_list[6]; + uint8_t pps_deblocking_filter_control_present_flag; + uint8_t pps_deblocking_filter_override_enabled_flag; + uint8_t pps_deblocking_filter_disabled_flag; + uint8_t pps_dbf_info_in_ph_flag; + + int8_t pps_luma_beta_offset_div2; + int8_t pps_luma_tc_offset_div2; + int8_t pps_cb_beta_offset_div2; + int8_t pps_cb_tc_offset_div2; + int8_t pps_cr_beta_offset_div2; + int8_t pps_cr_tc_offset_div2; + + uint8_t pps_rpl_info_in_ph_flag; + uint8_t pps_sao_info_in_ph_flag; + uint8_t pps_alf_info_in_ph_flag; + uint8_t pps_wp_info_in_ph_flag; + uint8_t pps_qp_delta_info_in_ph_flag; + + uint8_t pps_picture_header_extension_present_flag; + uint8_t pps_slice_header_extension_present_flag; + uint8_t pps_extension_flag; + H266RawExtensionData extension_data; + + //calculated value; + uint16_t num_tile_columns; + uint16_t num_tile_rows; + uint16_t num_tiles_in_pic; + uint16_t slice_height_in_ctus[VVC_MAX_SLICES]; ///< sliceHeightInCtus + uint16_t num_slices_in_subpic[VVC_MAX_SLICES]; ///< NumSlicesInSubpic + uint16_t sub_pic_id_val[VVC_MAX_SLICES]; ///< SubpicIdVal + uint16_t col_width_val[VVC_MAX_TILE_COLUMNS]; ///< ColWidthVal + uint16_t row_height_val[VVC_MAX_TILE_ROWS]; ///< RowHeightVal +} H266RawPPS; + +typedef struct H266RawAPS { + H266RawNALUnitHeader nal_unit_header; + uint8_t aps_params_type; + uint8_t aps_adaptation_parameter_set_id; + uint8_t aps_chroma_present_flag; + + uint8_t alf_luma_filter_signal_flag; + uint8_t alf_chroma_filter_signal_flag; + uint8_t alf_cc_cb_filter_signal_flag; + uint8_t alf_cc_cr_filter_signal_flag; + uint8_t alf_luma_clip_flag; + uint8_t alf_luma_num_filters_signalled_minus1; + uint8_t alf_luma_coeff_delta_idx[VVC_NUM_ALF_FILTERS]; + uint8_t alf_luma_coeff_abs[VVC_NUM_ALF_FILTERS][12]; + uint8_t alf_luma_coeff_sign[VVC_NUM_ALF_FILTERS][12]; + uint8_t alf_luma_clip_idx[VVC_NUM_ALF_FILTERS][12]; + uint8_t alf_chroma_clip_flag; + uint8_t alf_chroma_num_alt_filters_minus1; + uint8_t alf_chroma_coeff_abs[8][6]; + uint8_t alf_chroma_coeff_sign[8][6]; + uint8_t alf_chroma_clip_idx[8][6]; + uint8_t alf_cc_cb_filters_signalled_minus1; + uint8_t alf_cc_cb_mapped_coeff_abs[4][7]; + uint8_t alf_cc_cb_coeff_sign[4][7]; + uint8_t alf_cc_cr_filters_signalled_minus1; + uint8_t alf_cc_cr_mapped_coeff_abs[4][7]; + uint8_t alf_cc_cr_coeff_sign[4][7]; + + uint8_t scaling_list_copy_mode_flag[28]; + uint8_t scaling_list_pred_mode_flag[28]; + uint8_t scaling_list_pred_id_delta[28]; + int8_t scaling_list_dc_coef[14]; + int8_t scaling_list_delta_coef[28][64]; + + uint8_t lmcs_min_bin_idx; + uint8_t lmcs_delta_max_bin_idx; + uint8_t lmcs_delta_cw_prec_minus1; + uint16_t lmcs_delta_abs_cw[16]; + uint8_t lmcs_delta_sign_cw_flag[16]; + uint8_t lmcs_delta_abs_crs; + uint8_t lmcs_delta_sign_crs_flag; + + uint8_t aps_extension_flag; + H266RawExtensionData extension_data; +} H266RawAPS; + +typedef struct H266RawAUD { + H266RawNALUnitHeader nal_unit_header; + uint8_t aud_irap_or_gdr_flag; + uint8_t aud_pic_type; +} H266RawAUD; + +typedef struct H266RawPredWeightTable { + uint8_t luma_log2_weight_denom; + int8_t delta_chroma_log2_weight_denom; + + uint8_t num_l0_weights; + uint8_t luma_weight_l0_flag[15]; + uint8_t chroma_weight_l0_flag[15]; + int8_t delta_luma_weight_l0[15]; + int8_t luma_offset_l0[15]; + int8_t delta_chroma_weight_l0[15][2]; + int16_t delta_chroma_offset_l0[15][2]; + + uint8_t num_l1_weights; + uint8_t luma_weight_l1_flag[15]; + uint8_t chroma_weight_l1_flag[15]; + int8_t delta_luma_weight_l1[15]; + int8_t luma_offset_l1[15]; + int8_t delta_chroma_weight_l1[15][2]; + int16_t delta_chroma_offset_l1[15][2]; + + uint8_t num_weights_l0; ///< NumWeightsL0 + uint8_t num_weights_l1; ///< NumWeightsL1 +} H266RawPredWeightTable; + +typedef struct H266RawPictureHeader { + uint8_t ph_gdr_or_irap_pic_flag; + uint8_t ph_non_ref_pic_flag; + uint8_t ph_gdr_pic_flag; + uint8_t ph_inter_slice_allowed_flag; + uint8_t ph_intra_slice_allowed_flag; + uint8_t ph_pic_parameter_set_id; + uint16_t ph_pic_order_cnt_lsb; + uint8_t ph_recovery_poc_cnt; + uint8_t ph_extra_bit[16]; + uint8_t ph_poc_msb_cycle_present_flag; + uint8_t ph_poc_msb_cycle_val; + + uint8_t ph_alf_enabled_flag; + uint8_t ph_num_alf_aps_ids_luma; + uint8_t ph_alf_aps_id_luma[8]; + uint8_t ph_alf_cb_enabled_flag; + uint8_t ph_alf_cr_enabled_flag; + uint8_t ph_alf_aps_id_chroma; + uint8_t ph_alf_cc_cb_enabled_flag; + uint8_t ph_alf_cc_cb_aps_id; + uint8_t ph_alf_cc_cr_enabled_flag; + uint8_t ph_alf_cc_cr_aps_id; + + uint8_t ph_lmcs_enabled_flag; + uint8_t ph_lmcs_aps_id; + uint8_t ph_chroma_residual_scale_flag; + uint8_t ph_explicit_scaling_list_enabled_flag; + uint8_t ph_scaling_list_aps_id; + + uint8_t ph_virtual_boundaries_present_flag; + uint8_t ph_num_ver_virtual_boundaries; + uint16_t ph_virtual_boundary_pos_x_minus1[VVC_MAX_VBS]; + uint8_t ph_num_hor_virtual_boundaries; + uint16_t ph_virtual_boundary_pos_y_minus1[VVC_MAX_VBS]; + + uint8_t ph_pic_output_flag; + H266RefPicLists ph_ref_pic_lists; + + uint8_t ph_partition_constraints_override_flag; + + uint8_t ph_log2_diff_min_qt_min_cb_intra_slice_luma; + uint8_t ph_max_mtt_hierarchy_depth_intra_slice_luma; + uint8_t ph_log2_diff_max_bt_min_qt_intra_slice_luma; + uint8_t ph_log2_diff_max_tt_min_qt_intra_slice_luma; + uint8_t ph_log2_diff_min_qt_min_cb_intra_slice_chroma; + + uint8_t ph_max_mtt_hierarchy_depth_intra_slice_chroma; + uint8_t ph_log2_diff_max_bt_min_qt_intra_slice_chroma; + uint8_t ph_log2_diff_max_tt_min_qt_intra_slice_chroma; + + uint8_t ph_cu_qp_delta_subdiv_intra_slice; + uint8_t ph_cu_chroma_qp_offset_subdiv_intra_slice; + + uint8_t ph_log2_diff_min_qt_min_cb_inter_slice; + uint8_t ph_max_mtt_hierarchy_depth_inter_slice; + uint8_t ph_log2_diff_max_bt_min_qt_inter_slice; + uint8_t ph_log2_diff_max_tt_min_qt_inter_slice; + uint8_t ph_cu_qp_delta_subdiv_inter_slice; + uint8_t ph_cu_chroma_qp_offset_subdiv_inter_slice; + + uint8_t ph_temporal_mvp_enabled_flag; + uint8_t ph_collocated_from_l0_flag; + uint8_t ph_collocated_ref_idx; + uint8_t ph_mmvd_fullpel_only_flag; + uint8_t ph_mvd_l1_zero_flag; + uint8_t ph_bdof_disabled_flag; + uint8_t ph_dmvr_disabled_flag; + uint8_t ph_prof_disabled_flag; + + H266RawPredWeightTable ph_pred_weight_table; + + int8_t ph_qp_delta; + uint8_t ph_joint_cbcr_sign_flag; + uint8_t ph_sao_luma_enabled_flag; + uint8_t ph_sao_chroma_enabled_flag; + + uint8_t ph_deblocking_params_present_flag; + uint8_t ph_deblocking_filter_disabled_flag; + int8_t ph_luma_beta_offset_div2; + int8_t ph_luma_tc_offset_div2; + int8_t ph_cb_beta_offset_div2; + int8_t ph_cb_tc_offset_div2; + int8_t ph_cr_beta_offset_div2; + int8_t ph_cr_tc_offset_div2; + + uint8_t ph_extension_length; + uint8_t ph_extension_data_byte[256]; +} H266RawPictureHeader; + +typedef struct H266RawPH { + H266RawNALUnitHeader nal_unit_header; + H266RawPictureHeader ph_picture_header; +} H266RawPH; + +typedef struct H266RawSliceHeader { + H266RawNALUnitHeader nal_unit_header; + uint8_t sh_picture_header_in_slice_header_flag; + H266RawPictureHeader sh_picture_header; + + uint16_t sh_subpic_id; + uint16_t sh_slice_address; + uint8_t sh_extra_bit[16]; + uint8_t sh_num_tiles_in_slice_minus1; + uint8_t sh_slice_type; + uint8_t sh_no_output_of_prior_pics_flag; + + uint8_t sh_alf_enabled_flag; + uint8_t sh_num_alf_aps_ids_luma; + uint8_t sh_alf_aps_id_luma[8]; + uint8_t sh_alf_cb_enabled_flag; + uint8_t sh_alf_cr_enabled_flag; + uint8_t sh_alf_aps_id_chroma; + uint8_t sh_alf_cc_cb_enabled_flag; + uint8_t sh_alf_cc_cb_aps_id; + uint8_t sh_alf_cc_cr_enabled_flag; + uint8_t sh_alf_cc_cr_aps_id; + + uint8_t sh_lmcs_used_flag; + uint8_t sh_explicit_scaling_list_used_flag; + + H266RefPicLists sh_ref_pic_lists; + + uint8_t sh_num_ref_idx_active_override_flag; + uint8_t sh_num_ref_idx_active_minus1[2]; + uint8_t sh_cabac_init_flag; + uint8_t sh_collocated_from_l0_flag; + uint8_t sh_collocated_ref_idx; + + H266RawPredWeightTable sh_pred_weight_table; + + int8_t sh_qp_delta; + int8_t sh_cb_qp_offset; + int8_t sh_cr_qp_offset; + int8_t sh_joint_cbcr_qp_offset; + uint8_t sh_cu_chroma_qp_offset_enabled_flag; + + uint8_t sh_sao_luma_used_flag; + uint8_t sh_sao_chroma_used_flag; + + uint8_t sh_deblocking_params_present_flag; + uint8_t sh_deblocking_filter_disabled_flag; + int8_t sh_luma_beta_offset_div2; + int8_t sh_luma_tc_offset_div2; + int8_t sh_cb_beta_offset_div2; + int8_t sh_cb_tc_offset_div2; + int8_t sh_cr_beta_offset_div2; + int8_t sh_cr_tc_offset_div2; + uint8_t sh_dep_quant_used_flag; + + uint8_t sh_sign_data_hiding_used_flag; + uint8_t sh_ts_residual_coding_disabled_flag; + uint8_t sh_ts_residual_coding_rice_idx_minus1; + uint8_t sh_reverse_last_sig_coeff_flag; + uint16_t sh_slice_header_extension_length; + uint8_t sh_slice_header_extension_data_byte[256]; + + uint8_t sh_entry_offset_len_minus1; + uint32_t sh_entry_point_offset_minus1[VVC_MAX_ENTRY_POINTS]; + + // derived values + uint16_t curr_subpic_idx; ///< CurrSubpicIdx + uint32_t num_entry_points; ///< NumEntryPoints + uint8_t num_ref_idx_active[2]; ///< NumRefIdxActive[] + +} H266RawSliceHeader; + +typedef struct H266RawSlice { + H266RawSliceHeader header; + + uint8_t *data; + AVBufferRef *data_ref; + size_t header_size; + size_t data_size; + int data_bit_start; +} H266RawSlice; + +typedef struct H266RawSEI { + H266RawNALUnitHeader nal_unit_header; + SEIRawMessageList message_list; +} H266RawSEI; + +typedef struct CodedBitstreamH266Context { + // Reader/writer context in common with the H.264 implementation. + CodedBitstreamH2645Context common; + + // All currently available parameter sets. These are updated when + // any parameter set NAL unit is read/written with this context. + H266RawVPS *vps[VVC_MAX_VPS_COUNT]; ///< RefStruct references + H266RawSPS *sps[VVC_MAX_SPS_COUNT]; ///< RefStruct references + H266RawPPS *pps[VVC_MAX_PPS_COUNT]; ///< RefStruct references + H266RawPictureHeader *ph; + void *ph_ref; ///< RefStruct reference backing ph above +} CodedBitstreamH266Context; + +#endif /* AVCODEC_CBS_H266_H */ diff --git a/include/libavcodec/cbs_internal.h b/include/libavcodec/cbs_internal.h new file mode 100644 index 0000000..d982262 --- /dev/null +++ b/include/libavcodec/cbs_internal.h @@ -0,0 +1,348 @@ +/* + * 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_CBS_INTERNAL_H +#define AVCODEC_CBS_INTERNAL_H + +#include +#include + +#include "libavutil/log.h" + +#include "cbs.h" +#include "codec_id.h" +#include "get_bits.h" +#include "put_bits.h" +#include "refstruct.h" + + +enum CBSContentType { + // Unit content may contain some references to other structures, but all + // managed via buffer reference counting. The descriptor defines the + // structure offsets of every buffer reference. + CBS_CONTENT_TYPE_INTERNAL_REFS, + // Unit content is something more complex. The descriptor defines + // special functions to manage the content. + CBS_CONTENT_TYPE_COMPLEX, +}; + +enum { + // Maximum number of unit types described by the same non-range + // unit type descriptor. + CBS_MAX_LIST_UNIT_TYPES = 3, + // Maximum number of reference buffer offsets in any one unit. + CBS_MAX_REF_OFFSETS = 2, + // Special value used in a unit type descriptor to indicate that it + // applies to a large range of types rather than a set of discrete + // values. + CBS_UNIT_TYPE_RANGE = -1, +}; + +typedef const struct CodedBitstreamUnitTypeDescriptor { + // Number of entries in the unit_types array, or the special value + // CBS_UNIT_TYPE_RANGE to indicate that the range fields should be + // used instead. + int nb_unit_types; + + union { + // Array of unit types that this entry describes. + CodedBitstreamUnitType list[CBS_MAX_LIST_UNIT_TYPES]; + // Start and end of unit type range, used if nb_unit_types is + // CBS_UNIT_TYPE_RANGE. + struct { + CodedBitstreamUnitType start; + CodedBitstreamUnitType end; + } range; + } unit_type; + + // The type of content described. + enum CBSContentType content_type; + // The size of the structure which should be allocated to contain + // the decomposed content of this type of unit. + size_t content_size; + + union { + // This union's state is determined by content_type: + // ref for CBS_CONTENT_TYPE_INTERNAL_REFS, + // complex for CBS_CONTENT_TYPE_COMPLEX. + struct { + // Number of entries in the ref_offsets array. + // May be zero, then the structure is POD-like. + int nb_offsets; + // The structure must contain two adjacent elements: + // type *field; + // AVBufferRef *field_ref; + // where field points to something in the buffer referred to by + // field_ref. This offset is then set to offsetof(struct, field). + size_t offsets[CBS_MAX_REF_OFFSETS]; + } ref; + + struct { + void (*content_free)(FFRefStructOpaque opaque, void *content); + int (*content_clone)(void **new_content, CodedBitstreamUnit *unit); + } complex; + } type; +} CodedBitstreamUnitTypeDescriptor; + +typedef struct CodedBitstreamType { + enum AVCodecID codec_id; + + // A class for the private data, used to declare private AVOptions. + // This field is NULL for types that do not declare any options. + // If this field is non-NULL, the first member of the filter private data + // must be a pointer to AVClass. + const AVClass *priv_class; + + size_t priv_data_size; + + // List of unit type descriptors for this codec. + // Terminated by a descriptor with nb_unit_types equal to zero. + const CodedBitstreamUnitTypeDescriptor *unit_types; + + // Split frag->data into coded bitstream units, creating the + // frag->units array. Fill data but not content on each unit. + // The header argument should be set if the fragment came from + // a header block, which may require different parsing for some + // codecs (e.g. the AVCC header in H.264). + int (*split_fragment)(CodedBitstreamContext *ctx, + CodedBitstreamFragment *frag, + int header); + + // Read the unit->data bitstream and decompose it, creating + // unit->content. + int (*read_unit)(CodedBitstreamContext *ctx, + CodedBitstreamUnit *unit); + + // Write the data bitstream from unit->content into pbc. + // Return value AVERROR(ENOSPC) indicates that pbc was too small. + int (*write_unit)(CodedBitstreamContext *ctx, + CodedBitstreamUnit *unit, + PutBitContext *pbc); + + // Return 1 when the unit should be dropped according to 'skip', + // 0 otherwise. + int (*discarded_unit)(CodedBitstreamContext *ctx, + const CodedBitstreamUnit *unit, + enum AVDiscard skip); + + // Read the data from all of frag->units and assemble it into + // a bitstream for the whole fragment. + int (*assemble_fragment)(CodedBitstreamContext *ctx, + CodedBitstreamFragment *frag); + + // Reset the codec internal state. + void (*flush)(CodedBitstreamContext *ctx); + + // Free the codec internal state. + void (*close)(CodedBitstreamContext *ctx); +} CodedBitstreamType; + + +// Helper functions for trace output. + +void ff_cbs_trace_header(CodedBitstreamContext *ctx, + const char *name); + + +// Helper functions for read/write of common bitstream elements, including +// generation of trace output. The simple functions are equivalent to +// their non-simple counterparts except that their range is unrestricted +// (i.e. only limited by the amount of bits used) and they lack +// the ability to use subscripts. + +int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, + int width, const char *name, + const int *subscripts, uint32_t *write_to, + uint32_t range_min, uint32_t range_max); + +int ff_cbs_read_simple_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, + int width, const char *name, uint32_t *write_to); + +int ff_cbs_write_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, + int width, const char *name, + const int *subscripts, uint32_t value, + uint32_t range_min, uint32_t range_max); + +int ff_cbs_write_simple_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, + int width, const char *name, uint32_t value); + +int ff_cbs_read_signed(CodedBitstreamContext *ctx, GetBitContext *gbc, + int width, const char *name, + const int *subscripts, int32_t *write_to, + int32_t range_min, int32_t range_max); + +int ff_cbs_write_signed(CodedBitstreamContext *ctx, PutBitContext *pbc, + int width, const char *name, + const int *subscripts, int32_t value, + int32_t range_min, int32_t range_max); + +// The largest unsigned value representable in N bits, suitable for use as +// range_max in the above functions. +#define MAX_UINT_BITS(length) ((UINT64_C(1) << (length)) - 1) + +// The largest signed value representable in N bits, suitable for use as +// range_max in the above functions. +#define MAX_INT_BITS(length) ((INT64_C(1) << ((length) - 1)) - 1) + +// The smallest signed value representable in N bits, suitable for use as +// range_min in the above functions. +#define MIN_INT_BITS(length) (-(INT64_C(1) << ((length) - 1))) + + +// Start of a syntax element during read tracing. +#define CBS_TRACE_READ_START() \ + GetBitContext trace_start; \ + do { \ + if (ctx->trace_enable) \ + trace_start = *gbc; \ + } while (0) + +// End of a syntax element for tracing, make callback. +#define CBS_TRACE_READ_END() \ + do { \ + if (ctx->trace_enable) { \ + int start_position = get_bits_count(&trace_start); \ + int end_position = get_bits_count(gbc); \ + av_assert0(start_position <= end_position); \ + ctx->trace_read_callback(ctx->trace_context, &trace_start, \ + end_position - start_position, \ + name, subscripts, value); \ + } \ + } while (0) + +// End of a syntax element with no subscript entries. +#define CBS_TRACE_READ_END_NO_SUBSCRIPTS() \ + do { \ + const int *subscripts = NULL; \ + CBS_TRACE_READ_END(); \ + } while (0) + +// End of a syntax element which is made up of subelements which +// are aleady traced, so we are only showing the value. +#define CBS_TRACE_READ_END_VALUE_ONLY() \ + do { \ + if (ctx->trace_enable) { \ + ctx->trace_read_callback(ctx->trace_context, &trace_start, 0, \ + name, subscripts, value); \ + } \ + } while (0) + +// Start of a syntax element during write tracing. +#define CBS_TRACE_WRITE_START() \ + int start_position; \ + do { \ + if (ctx->trace_enable) \ + start_position = put_bits_count(pbc);; \ + } while (0) + +// End of a syntax element for tracing, make callback. +#define CBS_TRACE_WRITE_END() \ + do { \ + if (ctx->trace_enable) { \ + int end_position = put_bits_count(pbc); \ + av_assert0(start_position <= end_position); \ + ctx->trace_write_callback(ctx->trace_context, pbc, \ + end_position - start_position, \ + name, subscripts, value); \ + } \ + } while (0) + +// End of a syntax element with no subscript entries. +#define CBS_TRACE_WRITE_END_NO_SUBSCRIPTS() \ + do { \ + const int *subscripts = NULL; \ + CBS_TRACE_WRITE_END(); \ + } while (0) + +// End of a syntax element which is made up of subelements which are +// aleady traced, so we are only showing the value. This forges a +// PutBitContext to point to the position of the start of the syntax +// element, but the other state doesn't matter because length is zero. +#define CBS_TRACE_WRITE_END_VALUE_ONLY() \ + do { \ + if (ctx->trace_enable) { \ + PutBitContext tmp; \ + init_put_bits(&tmp, pbc->buf, start_position); \ + skip_put_bits(&tmp, start_position); \ + ctx->trace_write_callback(ctx->trace_context, &tmp, 0, \ + name, subscripts, value); \ + } \ + } while (0) + +#define TYPE_LIST(...) { __VA_ARGS__ } +#define CBS_UNIT_TYPE_POD(type_, structure) { \ + .nb_unit_types = 1, \ + .unit_type.list = { type_ }, \ + .content_type = CBS_CONTENT_TYPE_INTERNAL_REFS, \ + .content_size = sizeof(structure), \ + .type.ref = { .nb_offsets = 0 }, \ + } +#define CBS_UNIT_RANGE_POD(range_start, range_end, structure) { \ + .nb_unit_types = CBS_UNIT_TYPE_RANGE, \ + .unit_type.range.start = range_start, \ + .unit_type.range.end = range_end, \ + .content_type = CBS_CONTENT_TYPE_INTERNAL_REFS, \ + .content_size = sizeof(structure), \ + .type.ref = { .nb_offsets = 0 }, \ + } + +#define CBS_UNIT_TYPES_INTERNAL_REF(types, structure, ref_field) { \ + .nb_unit_types = FF_ARRAY_ELEMS((CodedBitstreamUnitType[])TYPE_LIST types), \ + .unit_type.list = TYPE_LIST types, \ + .content_type = CBS_CONTENT_TYPE_INTERNAL_REFS, \ + .content_size = sizeof(structure), \ + .type.ref = { .nb_offsets = 1, \ + .offsets = { offsetof(structure, ref_field) } }, \ + } +#define CBS_UNIT_TYPE_INTERNAL_REF(type, structure, ref_field) \ + CBS_UNIT_TYPES_INTERNAL_REF((type), structure, ref_field) + +#define CBS_UNIT_RANGE_INTERNAL_REF(range_start, range_end, structure, ref_field) { \ + .nb_unit_types = CBS_UNIT_TYPE_RANGE, \ + .unit_type.range.start = range_start, \ + .unit_type.range.end = range_end, \ + .content_type = CBS_CONTENT_TYPE_INTERNAL_REFS, \ + .content_size = sizeof(structure), \ + .type.ref = { .nb_offsets = 1, \ + .offsets = { offsetof(structure, ref_field) } }, \ + } + +#define CBS_UNIT_TYPES_COMPLEX(types, structure, free_func) { \ + .nb_unit_types = FF_ARRAY_ELEMS((CodedBitstreamUnitType[])TYPE_LIST types), \ + .unit_type.list = TYPE_LIST types, \ + .content_type = CBS_CONTENT_TYPE_COMPLEX, \ + .content_size = sizeof(structure), \ + .type.complex = { .content_free = free_func }, \ + } +#define CBS_UNIT_TYPE_COMPLEX(type, structure, free_func) \ + CBS_UNIT_TYPES_COMPLEX((type), structure, free_func) + +#define CBS_UNIT_TYPE_END_OF_LIST { .nb_unit_types = 0 } + + +extern const CodedBitstreamType ff_cbs_type_av1; +extern const CodedBitstreamType ff_cbs_type_h264; +extern const CodedBitstreamType ff_cbs_type_h265; +extern const CodedBitstreamType ff_cbs_type_h266; +extern const CodedBitstreamType ff_cbs_type_jpeg; +extern const CodedBitstreamType ff_cbs_type_mpeg2; +extern const CodedBitstreamType ff_cbs_type_vp8; +extern const CodedBitstreamType ff_cbs_type_vp9; + + +#endif /* AVCODEC_CBS_INTERNAL_H */ diff --git a/include/libavcodec/cbs_jpeg.h b/include/libavcodec/cbs_jpeg.h new file mode 100644 index 0000000..9dbebd2 --- /dev/null +++ b/include/libavcodec/cbs_jpeg.h @@ -0,0 +1,123 @@ +/* + * 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_CBS_JPEG_H +#define AVCODEC_CBS_JPEG_H + +#include +#include + +#include "libavutil/buffer.h" + + +enum { + JPEG_MARKER_SOF0 = 0xc0, + JPEG_MARKER_SOF1 = 0xc1, + JPEG_MARKER_SOF2 = 0xc2, + JPEG_MARKER_SOF3 = 0xc3, + + JPEG_MARKER_DHT = 0xc4, + JPEG_MARKER_SOI = 0xd8, + JPEG_MARKER_EOI = 0xd9, + JPEG_MARKER_SOS = 0xda, + JPEG_MARKER_DQT = 0xdb, + + JPEG_MARKER_APPN = 0xe0, + JPEG_MARKER_JPGN = 0xf0, + JPEG_MARKER_COM = 0xfe, +}; + +enum { + JPEG_MAX_COMPONENTS = 255, + + JPEG_MAX_HEIGHT = 65535, + JPEG_MAX_WIDTH = 65535, +}; + + +typedef struct JPEGRawFrameHeader { + uint16_t Lf; + uint8_t P; + uint16_t Y; + uint16_t X; + uint16_t Nf; + + uint8_t C [JPEG_MAX_COMPONENTS]; + uint8_t H [JPEG_MAX_COMPONENTS]; + uint8_t V [JPEG_MAX_COMPONENTS]; + uint8_t Tq[JPEG_MAX_COMPONENTS]; +} JPEGRawFrameHeader; + +typedef struct JPEGRawScanHeader { + uint16_t Ls; + uint8_t Ns; + + uint8_t Cs[JPEG_MAX_COMPONENTS]; + uint8_t Td[JPEG_MAX_COMPONENTS]; + uint8_t Ta[JPEG_MAX_COMPONENTS]; + + uint8_t Ss; + uint8_t Se; + uint8_t Ah; + uint8_t Al; +} JPEGRawScanHeader; + +typedef struct JPEGRawScan { + JPEGRawScanHeader header; + uint8_t *data; + AVBufferRef *data_ref; + size_t data_size; +} JPEGRawScan; + +typedef struct JPEGRawQuantisationTable { + uint8_t Pq; + uint8_t Tq; + uint16_t Q[64]; +} JPEGRawQuantisationTable; + +typedef struct JPEGRawQuantisationTableSpecification { + uint16_t Lq; + JPEGRawQuantisationTable table[4]; +} JPEGRawQuantisationTableSpecification; + +typedef struct JPEGRawHuffmanTable { + uint8_t Tc; + uint8_t Th; + uint8_t L[16]; + uint8_t V[256]; +} JPEGRawHuffmanTable; + +typedef struct JPEGRawHuffmanTableSpecification { + uint16_t Lh; + JPEGRawHuffmanTable table[8]; +} JPEGRawHuffmanTableSpecification; + +typedef struct JPEGRawApplicationData { + uint16_t Lp; + uint8_t *Ap; + AVBufferRef *Ap_ref; +} JPEGRawApplicationData; + +typedef struct JPEGRawComment { + uint16_t Lc; + uint8_t *Cm; + AVBufferRef *Cm_ref; +} JPEGRawComment; + + +#endif /* AVCODEC_CBS_JPEG_H */ diff --git a/include/libavcodec/cbs_mpeg2.h b/include/libavcodec/cbs_mpeg2.h new file mode 100644 index 0000000..f7075a4 --- /dev/null +++ b/include/libavcodec/cbs_mpeg2.h @@ -0,0 +1,231 @@ +/* + * 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_CBS_MPEG2_H +#define AVCODEC_CBS_MPEG2_H + +#include +#include + +#include "libavutil/buffer.h" + + +enum { + MPEG2_START_PICTURE = 0x00, + MPEG2_START_SLICE_MIN = 0x01, + MPEG2_START_SLICE_MAX = 0xaf, + MPEG2_START_USER_DATA = 0xb2, + MPEG2_START_SEQUENCE_HEADER = 0xb3, + MPEG2_START_SEQUENCE_ERROR = 0xb4, + MPEG2_START_EXTENSION = 0xb5, + MPEG2_START_SEQUENCE_END = 0xb7, + MPEG2_START_GROUP = 0xb8, +}; + +#define MPEG2_START_IS_SLICE(type) \ + ((type) >= MPEG2_START_SLICE_MIN && \ + (type) <= MPEG2_START_SLICE_MAX) + +enum { + MPEG2_EXTENSION_SEQUENCE = 0x1, + MPEG2_EXTENSION_SEQUENCE_DISPLAY = 0x2, + MPEG2_EXTENSION_QUANT_MATRIX = 0x3, + MPEG2_EXTENSION_COPYRIGHT = 0x4, + MPEG2_EXTENSION_SEQUENCE_SCALABLE = 0x5, + MPEG2_EXTENSION_PICTURE_DISPLAY = 0x7, + MPEG2_EXTENSION_PICTURE_CODING = 0x8, + MPEG2_EXTENSION_PICTURE_SPATIAL_SCALABLE = 0x9, + MPEG2_EXTENSION_PICTURE_TEMPORAL_SCALABLE = 0xa, + MPEG2_EXTENSION_CAMERA_PARAMETERS = 0xb, + MPEG2_EXTENSION_ITU_T = 0xc, +}; + + +typedef struct MPEG2RawSequenceHeader { + uint8_t sequence_header_code; + + uint16_t horizontal_size_value; + uint16_t vertical_size_value; + uint8_t aspect_ratio_information; + uint8_t frame_rate_code; + uint32_t bit_rate_value; + uint16_t vbv_buffer_size_value; + uint8_t constrained_parameters_flag; + + uint8_t load_intra_quantiser_matrix; + uint8_t intra_quantiser_matrix[64]; + uint8_t load_non_intra_quantiser_matrix; + uint8_t non_intra_quantiser_matrix[64]; +} MPEG2RawSequenceHeader; + +typedef struct MPEG2RawUserData { + uint8_t user_data_start_code; + + uint8_t *user_data; + AVBufferRef *user_data_ref; + size_t user_data_length; +} MPEG2RawUserData; + +typedef struct MPEG2RawSequenceExtension { + uint8_t profile_and_level_indication; + uint8_t progressive_sequence; + uint8_t chroma_format; + uint8_t horizontal_size_extension; + uint8_t vertical_size_extension; + uint16_t bit_rate_extension; + uint8_t vbv_buffer_size_extension; + uint8_t low_delay; + uint8_t frame_rate_extension_n; + uint8_t frame_rate_extension_d; +} MPEG2RawSequenceExtension; + +typedef struct MPEG2RawSequenceDisplayExtension { + uint8_t video_format; + + uint8_t colour_description; + uint8_t colour_primaries; + uint8_t transfer_characteristics; + uint8_t matrix_coefficients; + + uint16_t display_horizontal_size; + uint16_t display_vertical_size; +} MPEG2RawSequenceDisplayExtension; + +typedef struct MPEG2RawGroupOfPicturesHeader { + uint8_t group_start_code; + + uint32_t time_code; + uint8_t closed_gop; + uint8_t broken_link; +} MPEG2RawGroupOfPicturesHeader; + +typedef struct MPEG2RawExtraInformation { + uint8_t *extra_information; + AVBufferRef *extra_information_ref; + size_t extra_information_length; +} MPEG2RawExtraInformation; + +typedef struct MPEG2RawPictureHeader { + uint8_t picture_start_code; + + uint16_t temporal_reference; + uint8_t picture_coding_type; + uint16_t vbv_delay; + + uint8_t full_pel_forward_vector; + uint8_t forward_f_code; + uint8_t full_pel_backward_vector; + uint8_t backward_f_code; + + MPEG2RawExtraInformation extra_information_picture; +} MPEG2RawPictureHeader; + +typedef struct MPEG2RawPictureCodingExtension { + uint8_t f_code[2][2]; + + uint8_t intra_dc_precision; + uint8_t picture_structure; + uint8_t top_field_first; + uint8_t frame_pred_frame_dct; + uint8_t concealment_motion_vectors; + uint8_t q_scale_type; + uint8_t intra_vlc_format; + uint8_t alternate_scan; + uint8_t repeat_first_field; + uint8_t chroma_420_type; + uint8_t progressive_frame; + + uint8_t composite_display_flag; + uint8_t v_axis; + uint8_t field_sequence; + uint8_t sub_carrier; + uint8_t burst_amplitude; + uint8_t sub_carrier_phase; +} MPEG2RawPictureCodingExtension; + +typedef struct MPEG2RawQuantMatrixExtension { + uint8_t load_intra_quantiser_matrix; + uint8_t intra_quantiser_matrix[64]; + uint8_t load_non_intra_quantiser_matrix; + uint8_t non_intra_quantiser_matrix[64]; + uint8_t load_chroma_intra_quantiser_matrix; + uint8_t chroma_intra_quantiser_matrix[64]; + uint8_t load_chroma_non_intra_quantiser_matrix; + uint8_t chroma_non_intra_quantiser_matrix[64]; +} MPEG2RawQuantMatrixExtension; + +typedef struct MPEG2RawPictureDisplayExtension { + int16_t frame_centre_horizontal_offset[3]; + int16_t frame_centre_vertical_offset[3]; +} MPEG2RawPictureDisplayExtension; + +typedef struct MPEG2RawExtensionData { + uint8_t extension_start_code; + uint8_t extension_start_code_identifier; + + union { + MPEG2RawSequenceExtension sequence; + MPEG2RawSequenceDisplayExtension sequence_display; + MPEG2RawQuantMatrixExtension quant_matrix; + MPEG2RawPictureCodingExtension picture_coding; + MPEG2RawPictureDisplayExtension picture_display; + } data; +} MPEG2RawExtensionData; + +typedef struct MPEG2RawSliceHeader { + uint8_t slice_vertical_position; + + uint8_t slice_vertical_position_extension; + uint8_t priority_breakpoint; + + uint8_t quantiser_scale_code; + + uint8_t slice_extension_flag; + uint8_t intra_slice; + uint8_t slice_picture_id_enable; + uint8_t slice_picture_id; + + MPEG2RawExtraInformation extra_information_slice; +} MPEG2RawSliceHeader; + +typedef struct MPEG2RawSlice { + MPEG2RawSliceHeader header; + + uint8_t *data; + AVBufferRef *data_ref; + size_t data_size; + int data_bit_start; +} MPEG2RawSlice; + +typedef struct MPEG2RawSequenceEnd { + uint8_t sequence_end_code; +} MPEG2RawSequenceEnd; + + +typedef struct CodedBitstreamMPEG2Context { + // Elements stored in headers which are required for other decoding. + uint16_t horizontal_size; + uint16_t vertical_size; + uint8_t scalable; + uint8_t scalable_mode; + uint8_t progressive_sequence; + uint8_t number_of_frame_centre_offsets; +} CodedBitstreamMPEG2Context; + + +#endif /* AVCODEC_CBS_MPEG2_H */ diff --git a/include/libavcodec/cbs_sei.h b/include/libavcodec/cbs_sei.h new file mode 100644 index 0000000..15ef341 --- /dev/null +++ b/include/libavcodec/cbs_sei.h @@ -0,0 +1,224 @@ +/* + * 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_CBS_SEI_H +#define AVCODEC_CBS_SEI_H + +#include +#include + +#include "cbs.h" +#include "sei.h" + + +typedef struct SEIRawFillerPayload { + uint32_t payload_size; +} SEIRawFillerPayload; + +typedef struct SEIRawUserDataRegistered { + uint8_t itu_t_t35_country_code; + uint8_t itu_t_t35_country_code_extension_byte; + uint8_t *data; ///< RefStruct reference + size_t data_length; +} SEIRawUserDataRegistered; + +typedef struct SEIRawUserDataUnregistered { + uint8_t uuid_iso_iec_11578[16]; + uint8_t *data; ///< RefStruct reference + size_t data_length; +} SEIRawUserDataUnregistered; + +typedef struct SEIRawFramePackingArrangement { + uint32_t fp_arrangement_id; + uint8_t fp_arrangement_cancel_flag; + uint8_t fp_arrangement_type; + uint8_t fp_quincunx_sampling_flag; + uint8_t fp_content_interpretation_type; + uint8_t fp_spatial_flipping_flag; + uint8_t fp_frame0_flipped_flag; + uint8_t fp_field_views_flag; + uint8_t fp_current_frame_is_frame0_flag; + uint8_t fp_frame0_self_contained_flag; + uint8_t fp_frame1_self_contained_flag; + uint8_t fp_frame0_grid_position_x; + uint8_t fp_frame0_grid_position_y; + uint8_t fp_frame1_grid_position_x; + uint8_t fp_frame1_grid_position_y; + uint8_t fp_arrangement_persistence_flag; + uint8_t fp_upsampled_aspect_ratio_flag; +} SEIRawFramePackingArrangement; + +typedef struct SEIRawDecodedPictureHash { + uint8_t dph_sei_hash_type; + uint8_t dph_sei_single_component_flag; + uint8_t dph_sei_picture_md5[3][16]; + uint16_t dph_sei_picture_crc[3]; + uint32_t dph_sei_picture_checksum[3]; + + uint8_t dph_sei_reserved_zero_7bits; +} SEIRawDecodedPictureHash; + +typedef struct SEIRawMasteringDisplayColourVolume { + uint16_t display_primaries_x[3]; + uint16_t display_primaries_y[3]; + uint16_t white_point_x; + uint16_t white_point_y; + uint32_t max_display_mastering_luminance; + uint32_t min_display_mastering_luminance; +} SEIRawMasteringDisplayColourVolume; + +typedef struct SEIRawContentLightLevelInfo { + uint16_t max_content_light_level; + uint16_t max_pic_average_light_level; +} SEIRawContentLightLevelInfo; + +typedef struct SEIRawAlternativeTransferCharacteristics { + uint8_t preferred_transfer_characteristics; +} SEIRawAlternativeTransferCharacteristics; + +typedef struct SEIRawAmbientViewingEnvironment { + uint32_t ambient_illuminance; + uint16_t ambient_light_x; + uint16_t ambient_light_y; +} SEIRawAmbientViewingEnvironment; + +typedef struct SEIRawMessage { + uint32_t payload_type; + uint32_t payload_size; + void *payload; + void *payload_ref; ///< RefStruct reference + uint8_t *extension_data; ///< RefStruct reference + size_t extension_bit_length; +} SEIRawMessage; + +typedef struct SEIRawMessageList { + SEIRawMessage *messages; + int nb_messages; + int nb_messages_allocated; +} SEIRawMessageList; + + +typedef struct SEIMessageState { + // The type of the payload being written. + uint32_t payload_type; + // When reading, contains the size of the payload to allow finding the + // end of variable-length fields (such as user_data_payload_byte[]). + // (When writing, the size will be derived from the total number of + // bytes actually written.) + uint32_t payload_size; + // When writing, indicates that payload extension data is present so + // all extended fields must be written. May be updated by the writer + // to indicate that extended fields have been written, so the extension + // end bits must be written too. + uint8_t extension_present; +} SEIMessageState; + +struct GetBitContext; +struct PutBitContext; + +typedef int (*SEIMessageReadFunction)(CodedBitstreamContext *ctx, + struct GetBitContext *rw, + void *current, + SEIMessageState *sei); + +typedef int (*SEIMessageWriteFunction)(CodedBitstreamContext *ctx, + struct PutBitContext *rw, + void *current, + SEIMessageState *sei); + +typedef struct SEIMessageTypeDescriptor { + // Payload type for the message. (-1 in this field ends a list.) + int type; + // Valid in a prefix SEI NAL unit (always for H.264). + uint8_t prefix; + // Valid in a suffix SEI NAL unit (never for H.264). + uint8_t suffix; + // Size of the decomposed structure. + size_t size; + // Read bitstream into SEI message. + SEIMessageReadFunction read; + // Write bitstream from SEI message. + SEIMessageWriteFunction write; +} SEIMessageTypeDescriptor; + +// End-of-list sentinel element. +#define SEI_MESSAGE_TYPE_END { .type = -1 } + + +/** + * Find the type descriptor for the given payload type. + * + * Returns NULL if the payload type is not known. + */ +const SEIMessageTypeDescriptor *ff_cbs_sei_find_type(CodedBitstreamContext *ctx, + int payload_type); + +/** + * Allocate a new payload for the given SEI message. + */ +int ff_cbs_sei_alloc_message_payload(SEIRawMessage *message, + const SEIMessageTypeDescriptor *desc); + +/** + * Allocate a new empty SEI message in a message list. + * + * The new message is in place nb_messages - 1. + */ +int ff_cbs_sei_list_add(SEIRawMessageList *list); + +/** + * Free all SEI messages in a message list. + */ +void ff_cbs_sei_free_message_list(SEIRawMessageList *list); + +/** + * Add an SEI message to an access unit. + * + * Will add to an existing SEI NAL unit, or create a new one for the + * message if there is no suitable existing one. + * + * If set, payload_ref must be a RefStruct reference backing payload_data. + * This function creates a new reference to payload_ref in this case. + * If payload_ref is NULL, the new message will not be reference counted. + */ +int ff_cbs_sei_add_message(CodedBitstreamContext *ctx, + CodedBitstreamFragment *au, + int prefix, + uint32_t payload_type, + void *payload_data, + void *payload_ref); + +/** + * Iterate over messages with the given payload type in an access unit. + * + * Set message to NULL in the first call. Returns 0 while more messages + * are available, AVERROR(ENOENT) when all messages have been found. + */ +int ff_cbs_sei_find_message(CodedBitstreamContext *ctx, + CodedBitstreamFragment *au, + uint32_t payload_type, + SEIRawMessage **message); + +/** + * Delete all messages with the given payload type from an access unit. + */ +void ff_cbs_sei_delete_message_type(CodedBitstreamContext *ctx, + CodedBitstreamFragment *au, + uint32_t payload_type); + +#endif /* AVCODEC_CBS_SEI_H */ diff --git a/include/libavcodec/cbs_vp8.h b/include/libavcodec/cbs_vp8.h new file mode 100644 index 0000000..9c09e21 --- /dev/null +++ b/include/libavcodec/cbs_vp8.h @@ -0,0 +1,133 @@ +/* + * 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_CBS_VP8_H +#define AVCODEC_CBS_VP8_H + +#include +#include + +#include "cbs.h" + +enum { + VP8_START_CODE_0 = 0x9D, + VP8_START_CODE_1 = 0x01, + VP8_START_CODE_2 = 0x2A, +}; + +enum { + VP8_KEY_FRAME = 0, + VP8_NON_KEY_FRAME = 1, +}; + +typedef struct VP8RawFrameHeader { + // frame tag + uint8_t frame_type; + uint8_t profile; + uint8_t show_frame; + uint32_t first_partition_length_in_bytes; + + uint16_t width; + uint8_t horizontal_scale; + uint16_t height; + uint8_t vertical_scale; + + // frame header + uint8_t color_space; + uint8_t clamping_type; + + // segmentation + uint8_t segmentation_enable; + uint8_t update_segment_map; + uint8_t update_segment_feature_data; + uint8_t segment_feature_mode; + uint8_t segment_qp_update[4]; + int8_t segment_qp[4]; + uint8_t segment_loop_filter_level_update[4]; + int8_t segment_loop_filter_level[4]; + uint8_t segment_probs_update[3]; + uint8_t segment_probs[3]; + + // loop filter + uint8_t loop_filter_type; + uint8_t loop_filter_level; + uint8_t loop_filter_sharpness; + uint8_t mode_ref_lf_delta_enable; + uint8_t mode_ref_lf_delta_update; + uint8_t ref_lf_deltas_update[4]; + int8_t ref_lf_deltas[4]; + uint8_t mode_lf_deltas_update[4]; + int8_t mode_lf_deltas[4]; + + uint8_t log2_token_partitions; + + // qp + uint8_t base_qindex; + uint8_t y1dc_delta_q_present; + int8_t y1dc_delta_q; + uint8_t y2dc_delta_q_present; + int8_t y2dc_delta_q; + uint8_t y2ac_delta_q_present; + int8_t y2ac_delta_q; + uint8_t uvdc_delta_q_present; + int8_t uvdc_delta_q; + uint8_t uvac_delta_q_present; + int8_t uvac_delta_q; + + // ref + uint8_t refresh_golden_frame; + uint8_t refresh_alternate_frame; + uint8_t copy_buffer_to_golden; + uint8_t copy_buffer_to_alternate; + uint8_t ref_frame_sign_bias_golden; + uint8_t ref_frame_sign_bias_alternate; + uint8_t refresh_last_frame; + + uint8_t refresh_entropy_probs; + + // token probs + uint8_t coeff_prob_update[4][8][3][11]; + uint8_t coeff_prob[4][8][3][11]; + + uint8_t mb_no_skip_coeff; + uint8_t prob_skip_false; + + uint8_t prob_intra; + uint8_t prob_last; + uint8_t prob_golden; + + uint8_t intra_16x16_prob_update; + uint8_t intra_16x16_prob[4]; + + uint8_t intra_chrome_prob_update; + uint8_t intra_chrome_prob[3]; + + // mv probs + uint8_t mv_prob_update[2][19]; + uint8_t mv_prob[2][19]; +} VP8RawFrameHeader; + +typedef struct VP8RawFrame { + VP8RawFrameHeader header; + + uint8_t *data; + AVBufferRef *data_ref; + size_t data_size; +} VP8RawFrame; + +#endif /* AVCODEC_CBS_VP8_H */ diff --git a/include/libavcodec/cbs_vp9.h b/include/libavcodec/cbs_vp9.h new file mode 100644 index 0000000..af15eb4 --- /dev/null +++ b/include/libavcodec/cbs_vp9.h @@ -0,0 +1,213 @@ +/* + * 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_CBS_VP9_H +#define AVCODEC_CBS_VP9_H + +#include +#include + +#include "cbs.h" + + +// Miscellaneous constants (section 3). +enum { + VP9_REFS_PER_FRAME = 3, + + VP9_MIN_TILE_WIDTH_B64 = 4, + VP9_MAX_TILE_WIDTH_B64 = 64, + + VP9_NUM_REF_FRAMES = 8, + VP9_MAX_REF_FRAMES = 4, + + VP9_MAX_SEGMENTS = 8, + VP9_SEG_LVL_MAX = 4, +}; + +// Frame types (section 7.2). +enum { + VP9_KEY_FRAME = 0, + VP9_NON_KEY_FRAME = 1, +}; + +// Frame sync bytes (section 7.2.1). +enum { + VP9_FRAME_SYNC_0 = 0x49, + VP9_FRAME_SYNC_1 = 0x83, + VP9_FRAME_SYNC_2 = 0x42, +}; + +// Color space values (section 7.2.2). +enum { + VP9_CS_UNKNOWN = 0, + VP9_CS_BT_601 = 1, + VP9_CS_BT_709 = 2, + VP9_CS_SMPTE_170 = 3, + VP9_CS_SMPTE_240 = 4, + VP9_CS_BT_2020 = 5, + VP9_CS_RESERVED = 6, + VP9_CS_RGB = 7, +}; + +// Reference frame types (section 7.4.12). +enum { + VP9_INTRA_FRAME = 0, + VP9_LAST_FRAME = 1, + VP9_GOLDEN_FRAME = 2, + VP9_ALTREF_FRAME = 3, +}; + +// Superframe properties (section B.3). +enum { + VP9_MAX_FRAMES_IN_SUPERFRAME = 8, + + VP9_SUPERFRAME_MARKER = 6, +}; + + +typedef struct VP9RawFrameHeader { + uint8_t frame_marker; + uint8_t profile_low_bit; + uint8_t profile_high_bit; + + uint8_t show_existing_frame; + uint8_t frame_to_show_map_idx; + + uint8_t frame_type; + uint8_t show_frame; + uint8_t error_resilient_mode; + + // Color config. + uint8_t ten_or_twelve_bit; + uint8_t color_space; + uint8_t color_range; + uint8_t subsampling_x; + uint8_t subsampling_y; + + uint8_t refresh_frame_flags; + + uint8_t intra_only; + uint8_t reset_frame_context; + + uint8_t ref_frame_idx[VP9_REFS_PER_FRAME]; + uint8_t ref_frame_sign_bias[VP9_MAX_REF_FRAMES]; + + uint8_t allow_high_precision_mv; + + uint8_t refresh_frame_context; + uint8_t frame_parallel_decoding_mode; + + uint8_t frame_context_idx; + + // Frame/render size. + uint8_t found_ref[VP9_REFS_PER_FRAME]; + uint16_t frame_width_minus_1; + uint16_t frame_height_minus_1; + uint8_t render_and_frame_size_different; + uint16_t render_width_minus_1; + uint16_t render_height_minus_1; + + // Interpolation filter. + uint8_t is_filter_switchable; + uint8_t raw_interpolation_filter_type; + + // Loop filter params. + uint8_t loop_filter_level; + uint8_t loop_filter_sharpness; + uint8_t loop_filter_delta_enabled; + uint8_t loop_filter_delta_update; + uint8_t update_ref_delta[VP9_MAX_REF_FRAMES]; + int8_t loop_filter_ref_deltas[VP9_MAX_REF_FRAMES]; + uint8_t update_mode_delta[2]; + int8_t loop_filter_mode_deltas[2]; + + // Quantization params. + uint8_t base_q_idx; + int8_t delta_q_y_dc; + int8_t delta_q_uv_dc; + int8_t delta_q_uv_ac; + + // Segmentation params. + uint8_t segmentation_enabled; + uint8_t segmentation_update_map; + uint8_t segmentation_tree_probs[7]; + uint8_t segmentation_temporal_update; + uint8_t segmentation_pred_prob[3]; + uint8_t segmentation_update_data; + uint8_t segmentation_abs_or_delta_update; + uint8_t feature_enabled[VP9_MAX_SEGMENTS][VP9_SEG_LVL_MAX]; + uint8_t feature_value[VP9_MAX_SEGMENTS][VP9_SEG_LVL_MAX]; + uint8_t feature_sign[VP9_MAX_SEGMENTS][VP9_SEG_LVL_MAX]; + + // Tile info. + uint8_t tile_cols_log2; + uint8_t tile_rows_log2; + + uint16_t header_size_in_bytes; +} VP9RawFrameHeader; + +typedef struct VP9RawFrame { + VP9RawFrameHeader header; + + uint8_t *data; + AVBufferRef *data_ref; + size_t data_size; +} VP9RawFrame; + +typedef struct VP9RawSuperframeIndex { + uint8_t superframe_marker; + uint8_t bytes_per_framesize_minus_1; + uint8_t frames_in_superframe_minus_1; + uint32_t frame_sizes[VP9_MAX_FRAMES_IN_SUPERFRAME]; +} VP9RawSuperframeIndex; + +typedef struct VP9RawSuperframe { + VP9RawFrame frames[VP9_MAX_FRAMES_IN_SUPERFRAME]; + VP9RawSuperframeIndex index; +} VP9RawSuperframe; + +typedef struct VP9ReferenceFrameState { + int frame_width; // RefFrameWidth + int frame_height; // RefFrameHeight + int subsampling_x; // RefSubsamplingX + int subsampling_y; // RefSubsamplingY + int bit_depth; // RefBitDepth +} VP9ReferenceFrameState; + +typedef struct CodedBitstreamVP9Context { + int profile; + + // Frame dimensions in 8x8 mode info blocks. + uint16_t mi_cols; + uint16_t mi_rows; + // Frame dimensions in 64x64 superblocks. + uint16_t sb64_cols; + uint16_t sb64_rows; + + int frame_width; + int frame_height; + + uint8_t subsampling_x; + uint8_t subsampling_y; + int bit_depth; + + VP9ReferenceFrameState ref[VP9_NUM_REF_FRAMES]; +} CodedBitstreamVP9Context; + + +#endif /* AVCODEC_CBS_VP9_H */ diff --git a/include/libavcodec/celp_filters.h b/include/libavcodec/celp_filters.h new file mode 100644 index 0000000..f644ec3 --- /dev/null +++ b/include/libavcodec/celp_filters.h @@ -0,0 +1,169 @@ +/* + * various filters for CELP-based codecs + * + * Copyright (c) 2008 Vladimir Voroshilov + * + * 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_CELP_FILTERS_H +#define AVCODEC_CELP_FILTERS_H + +#include + +typedef struct CELPFContext { + /** + * LP synthesis filter. + * @param[out] out pointer to output buffer + * - the array out[-filter_length, -1] must + * contain the previous result of this filter + * @param filter_coeffs filter coefficients. + * @param in input signal + * @param buffer_length amount of data to process + * @param filter_length filter length (10 for 10th order LP filter). Must be + * greater than 4 and even. + * + * @note Output buffer must contain filter_length samples of past + * speech data before pointer. + * + * Routine applies 1/A(z) filter to given speech data. + */ + void (*celp_lp_synthesis_filterf)(float *out, const float *filter_coeffs, + const float *in, int buffer_length, + int filter_length); + + /** + * LP zero synthesis filter. + * @param[out] out pointer to output buffer + * @param filter_coeffs filter coefficients. + * @param in input signal + * - the array in[-filter_length, -1] must + * contain the previous input of this filter + * @param buffer_length amount of data to process (should be a multiple of eight) + * @param filter_length filter length (10 for 10th order LP filter; + * should be a multiple of two) + * + * @note Output buffer must contain filter_length samples of past + * speech data before pointer. + * + * Routine applies A(z) filter to given speech data. + */ + void (*celp_lp_zero_synthesis_filterf)(float *out, const float *filter_coeffs, + const float *in, int buffer_length, + int filter_length); + +}CELPFContext; + +/** + * Initialize CELPFContext. + */ +void ff_celp_filter_init(CELPFContext *c); +void ff_celp_filter_init_mips(CELPFContext *c); + +/** + * Circularly convolve fixed vector with a phase dispersion impulse + * response filter (D.6.2 of G.729 and 6.1.5 of AMR). + * @param fc_out vector with filter applied + * @param fc_in source vector + * @param filter phase filter coefficients + * + * fc_out[n] = sum(i,0,len-1){ fc_in[i] * filter[(len + n - i)%len] } + * + * @note fc_in and fc_out should not overlap! + */ +void ff_celp_convolve_circ(int16_t *fc_out, const int16_t *fc_in, + const int16_t *filter, int len); + +/** + * Add an array to a rotated array. + * + * out[k] = in[k] + fac * lagged[k-lag] with wrap-around + * + * @param out result vector + * @param in samples to be added unfiltered + * @param lagged samples to be rotated, multiplied and added + * @param lag lagged vector delay in the range [0, n] + * @param fac scalefactor for lagged samples + * @param n number of samples + */ +void ff_celp_circ_addf(float *out, const float *in, + const float *lagged, int lag, float fac, int n); + +/** + * LP synthesis filter. + * @param[out] out pointer to output buffer + * @param filter_coeffs filter coefficients (-0x8000 <= (3.12) < 0x8000) + * @param in input signal + * @param buffer_length amount of data to process + * @param filter_length filter length (10 for 10th order LP filter) + * @param stop_on_overflow 1 - return immediately if overflow occurs + * 0 - ignore overflows + * @param shift the result is shifted right by this value + * @param rounder the amount to add for rounding (usually 0x800 or 0xfff) + * + * @return 1 if overflow occurred, 0 - otherwise + * + * @note Output buffer must contain filter_length samples of past + * speech data before pointer. + * + * Routine applies 1/A(z) filter to given speech data. + */ +int ff_celp_lp_synthesis_filter(int16_t *out, const int16_t *filter_coeffs, + const int16_t *in, int buffer_length, + int filter_length, int stop_on_overflow, + int shift, int rounder); + +/** + * LP synthesis filter. + * @param[out] out pointer to output buffer + * - the array out[-filter_length, -1] must + * contain the previous result of this filter + * @param filter_coeffs filter coefficients. + * @param in input signal + * @param buffer_length amount of data to process + * @param filter_length filter length (10 for 10th order LP filter). Must be + * greater than 4 and even. + * + * @note Output buffer must contain filter_length samples of past + * speech data before pointer. + * + * Routine applies 1/A(z) filter to given speech data. + */ +void ff_celp_lp_synthesis_filterf(float *out, const float *filter_coeffs, + const float *in, int buffer_length, + int filter_length); + +/** + * LP zero synthesis filter. + * @param[out] out pointer to output buffer + * @param filter_coeffs filter coefficients. + * @param in input signal + * - the array in[-filter_length, -1] must + * contain the previous input of this filter + * @param buffer_length amount of data to process + * @param filter_length filter length (10 for 10th order LP filter) + * + * @note Output buffer must contain filter_length samples of past + * speech data before pointer. + * + * Routine applies A(z) filter to given speech data. + */ +void ff_celp_lp_zero_synthesis_filterf(float *out, const float *filter_coeffs, + const float *in, int buffer_length, + int filter_length); + +#endif /* AVCODEC_CELP_FILTERS_H */ diff --git a/include/libavcodec/celp_math.h b/include/libavcodec/celp_math.h new file mode 100644 index 0000000..99a0470 --- /dev/null +++ b/include/libavcodec/celp_math.h @@ -0,0 +1,97 @@ +/* + * Various fixed-point math operations + * + * Copyright (c) 2008 Vladimir Voroshilov + * + * 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_CELP_MATH_H +#define AVCODEC_CELP_MATH_H + +#include + +typedef struct CELPMContext { + /** + * Return the dot product. + * @param a input data array + * @param b input data array + * @param length number of elements + * + * @return dot product = sum of elementwise products + */ + float (*dot_productf)(const float* a, const float* b, int length); + +}CELPMContext; + +/** + * Initialize CELPMContext. + */ +void ff_celp_math_init(CELPMContext *c); +void ff_celp_math_init_mips(CELPMContext *c); + +/** + * fixed-point implementation of exp2(x) in [0; 1] domain. + * @param power argument to exp2, 0 <= power <= 0x7fff + * + * @return value of (1<<20) * exp2(power / (1<<15)) + * 0x8000c <= result <= 0xfffea + */ +int ff_exp2(uint16_t power); + +/** + * Calculate log2(x). + * @param value function argument, 0 < value <= 7fff ffff + * + * @return value of (1<<15) * log2(value) + */ +int ff_log2_q15(uint32_t value); + +/** + * Calculate the dot product of 2 int16_t vectors. + * @param a input data array + * @param b input data array + * @param length number of elements + * + * @return dot product = sum of elementwise products + */ +int64_t ff_dot_product(const int16_t *a, const int16_t *b, int length); + +/** + * Shift value left or right depending on sign of offset parameter. + * @param value value to shift + * @param offset shift offset + * + * @return value << offset, if offset>=0; value >> -offset - otherwise + */ +static inline unsigned bidir_sal(unsigned value, int offset) +{ + if(offset < 0) return value >> -offset; + else return value << offset; +} + +/** + * Return the dot product. + * @param a input data array + * @param b input data array + * @param length number of elements + * + * @return dot product = sum of elementwise products + */ +float ff_dot_productf(const float* a, const float* b, int length); + +#endif /* AVCODEC_CELP_MATH_H */ diff --git a/include/libavcodec/cfhd.h b/include/libavcodec/cfhd.h new file mode 100644 index 0000000..9b09c91 --- /dev/null +++ b/include/libavcodec/cfhd.h @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2015 Kieran Kunhya + * + * 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_CFHD_H +#define AVCODEC_CFHD_H + +#include + +#include "avcodec.h" +#include "bytestream.h" +#include "get_bits.h" +#include "cfhddsp.h" + +enum CFHDParam { + SampleType = 1, + SampleIndexTable = 2, + BitstreamMarker = 4, + VersionMajor = 5, + VersionMinor = 6, + VersionRevision = 7, + VersionEdit = 8, + TransformType = 10, + NumFrames = 11, + ChannelCount = 12, + WaveletCount = 13, + SubbandCount = 14, + NumSpatial = 15, + FirstWavelet = 16, + GroupTrailer = 18, + FrameType = 19, + ImageWidth = 20, + ImageHeight = 21, + FrameIndex = 23, + LowpassSubband = 25, + NumLevels = 26, + LowpassWidth = 27, + LowpassHeight = 28, + PixelOffset = 33, + LowpassQuantization=34, + LowpassPrecision = 35, + WaveletType = 37, + WaveletNumber = 38, + WaveletLevel = 39, + NumBands = 40, + HighpassWidth = 41, + HighpassHeight = 42, + LowpassBorder = 43, + HighpassBorder = 44, + LowpassScale = 45, + LowpassDivisor = 46, + SubbandNumber = 48, + BandWidth = 49, + BandHeight = 50, + SubbandBand = 51, + BandEncoding = 52, + Quantization = 53, + BandScale = 54, + BandHeader = 55, + BandTrailer = 56, + ChannelNumber = 62, + SampleFlags = 68, + FrameNumber = 69, + Precision = 70, + InputFormat = 71, + BandCodingFlags = 72, + PeakLevel = 74, + PeakOffsetLow = 75, + PeakOffsetHigh = 76, + Version = 79, + BandSecondPass = 82, + PrescaleTable = 83, + EncodedFormat = 84, + DisplayHeight = 85, + ChannelWidth = 104, + ChannelHeight = 105, +}; + +#define VLC_BITS 9 +#define SUBBAND_COUNT 10 +#define SUBBAND_COUNT_3D 17 + +typedef struct CFHD_RL_VLC_ELEM { + int16_t level; + int8_t len; + uint16_t run; +} CFHD_RL_VLC_ELEM; + +#define DWT_LEVELS 3 +#define DWT_LEVELS_3D 6 + +typedef struct SubBand { + ptrdiff_t stride; + int a_width; + int width; + int a_height; + int height; + int8_t read_ok; +} SubBand; + +typedef struct Plane { + int width; + int height; + ptrdiff_t stride; + + int16_t *idwt_buf; + int16_t *idwt_tmp; + int idwt_size; + + /* TODO: merge this into SubBand structure */ + int16_t *subband[SUBBAND_COUNT_3D]; + int16_t *l_h[10]; + + SubBand band[DWT_LEVELS_3D][4]; +} Plane; + +typedef struct Peak { + int level; + int offset; + GetByteContext base; +} Peak; + +typedef struct CFHDContext { + AVCodecContext *avctx; + + CFHD_RL_VLC_ELEM table_9_rl_vlc[2088]; + CFHD_RL_VLC_ELEM table_18_rl_vlc[4572]; + + int lut[2][256]; + + GetBitContext gb; + + int planes; + int frame_type; + int frame_index; + int sample_type; + int transform_type; + int coded_width; + int coded_height; + int cropped_height; + enum AVPixelFormat coded_format; + int progressive; + + int a_width; + int a_height; + int a_format; + int a_transform_type; + + int bpc; // bits per channel/component + int channel_cnt; + int subband_cnt; + int band_encoding; + int channel_num; + uint8_t lowpass_precision; + uint16_t quantisation; + + int codebook; + int difference_coding; + int subband_num; + int level; + int subband_num_actual; + + uint8_t prescale_table[8]; + Plane plane[4]; + Peak peak; + + CFHDDSPContext dsp; +} CFHDContext; + +int ff_cfhd_init_vlcs(CFHDContext *s); + +#endif /* AVCODEC_CFHD_H */ diff --git a/include/libavcodec/cfhddsp.h b/include/libavcodec/cfhddsp.h new file mode 100644 index 0000000..8737eb3 --- /dev/null +++ b/include/libavcodec/cfhddsp.h @@ -0,0 +1,44 @@ +/* + * 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_CFHDDSP_H +#define AVCODEC_CFHDDSP_H + +#include +#include + +typedef struct CFHDDSPContext { + void (*horiz_filter)(int16_t *output, ptrdiff_t out_stride, + const int16_t *low, ptrdiff_t low_stride, + const int16_t *high, ptrdiff_t high_stride, + int width, int height); + + void (*vert_filter)(int16_t *output, ptrdiff_t out_stride, + const int16_t *low, ptrdiff_t low_stride, + const int16_t *high, ptrdiff_t high_stride, + int width, int height); + + void (*horiz_filter_clip)(int16_t *output, const int16_t *low, const int16_t *high, + int width, int bpc); +} CFHDDSPContext; + +void ff_cfhddsp_init(CFHDDSPContext *c, int format, int bayer); + +void ff_cfhddsp_init_x86(CFHDDSPContext *c, int format, int bayer); + +#endif /* AVCODEC_CFHDDSP_H */ diff --git a/include/libavcodec/cfhdencdsp.h b/include/libavcodec/cfhdencdsp.h new file mode 100644 index 0000000..d234b93 --- /dev/null +++ b/include/libavcodec/cfhdencdsp.h @@ -0,0 +1,41 @@ +/* + * 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_CFHDENCDSP_H +#define AVCODEC_CFHDENCDSP_H + +#include +#include + +typedef struct CFHDEncDSPContext { + void (*horiz_filter)(const int16_t *input, int16_t *low, int16_t *high, + ptrdiff_t in_stride, ptrdiff_t low_stride, + ptrdiff_t high_stride, + int width, int height); + + void (*vert_filter)(const int16_t *input, int16_t *low, int16_t *high, + ptrdiff_t in_stride, ptrdiff_t low_stride, + ptrdiff_t high_stride, + int width, int height); +} CFHDEncDSPContext; + +void ff_cfhdencdsp_init(CFHDEncDSPContext *c); + +void ff_cfhdencdsp_init_x86(CFHDEncDSPContext *c); + +#endif /* AVCODEC_CFHDENCDSP_H */ diff --git a/include/libavcodec/cga_data.h b/include/libavcodec/cga_data.h new file mode 100644 index 0000000..3f5281a --- /dev/null +++ b/include/libavcodec/cga_data.h @@ -0,0 +1,47 @@ +/* + * CGA/EGA/VGA ROM data + * + * 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 + */ + +/** + * @file + * CGA/EGA/VGA ROM data + * @note fonts are in libavutil/xga_font_data.[ch] + */ + +#ifndef AVCODEC_CGA_DATA_H +#define AVCODEC_CGA_DATA_H + +#include + +extern const uint32_t ff_cga_palette[16]; +extern const uint32_t ff_ega_palette[64]; + +/** + * Draw CGA/EGA/VGA font to 8-bit pixel buffer + * + * @param dst Destination pixel buffer + * @param linesize Linesize (pixels) + * @param font Font table. We assume font width is always 8 pixels wide. + * @param font_height Font height (pixels) + * @param fg,bg Foreground and background palette index + * @param ch Character to draw + */ +void ff_draw_pc_font(uint8_t *dst, int linesize, const uint8_t *font, int font_height, int ch, int fg, int bg); + +#endif /* AVCODEC_CGA_DATA_H */ diff --git a/include/libavcodec/clearvideodata.h b/include/libavcodec/clearvideodata.h new file mode 100644 index 0000000..37d5eb3 --- /dev/null +++ b/include/libavcodec/clearvideodata.h @@ -0,0 +1,682 @@ +/* + * ClearVideo decoder + * Copyright (c) 2012-2018 Konstantin Shishkov + * + * 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_CLEARVIDEODATA_H +#define AVCODEC_CLEARVIDEODATA_H + +#include "libavutil/common.h" + +#define MAX_VLC_ENTRIES 1370 +#define NUM_DC_CODES 127 +#define NUM_AC_CODES 104 + +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_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] = { + 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] = { + -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_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_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_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 }, +}; + +#define MV_ESC 0x13 +static const uint16_t clv_mv_syms[] = { + /* Y_0 motion vectors - 290 entries */ + 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, + 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, + /* Y_1 motion vectors - 362 entries */ + 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, + 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, + /* Y_2 motion vectors - 962 entries */ + 0x0000, 0x0001, 0x00FF, 0xFF00, 0x0100, 0x0002, 0x00FE, 0x0101, 0xFFFF, + 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, + 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, + /* 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, 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, + 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, + /* 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, 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, + 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, + /* U_2 motion vectors - 442 entries */ + 0x0000, 0xFF00, 0x0100, 0x00FF, 0x0001, 0xFFFF, 0x01FF, 0xFF01, 0x0101, + 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, + 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, + /* 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, 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, + 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, + /* V_2 motion vectors - 442 elements */ + 0x0000, 0x00FF, 0x0001, 0xFF00, 0x0100, 0xFFFF, 0x01FF, 0xFF01, 0x0101, + 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, + 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_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 }, +}; + +#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, 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, + 0xFF84, 0xFF80, 0x0080, 0x0088, 0xFF78, 0xFF7C, 0x0084, 0x008C, 0xFF74, + 0x0090, 0xFF70, 0x0094, 0xFF6C, 0xFF68, 0x0098, + /* 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, + 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, 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, + /* 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, + 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, 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, 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, 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, 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, BIAS_ESC, 0xFFB0, 0x0054, 0xFFAC, 0x0050 +}; + +#endif /* AVCODEC_CLEARVIDEODATA_H */ diff --git a/include/libavcodec/codec.h b/include/libavcodec/codec.h index 03e8be9..f7541ff 100644 --- a/include/libavcodec/codec.h +++ b/include/libavcodec/codec.h @@ -50,12 +50,6 @@ * avcodec_default_get_buffer2 or avcodec_default_get_encode_buffer. */ #define AV_CODEC_CAP_DR1 (1 << 1) -#if FF_API_FLAG_TRUNCATED -/** - * @deprecated Use parsers to always send proper frames. - */ -#define AV_CODEC_CAP_TRUNCATED (1 << 3) -#endif /** * Encoder or decoder requires flushing with NULL input at the end in order to * give the complete and correct output. @@ -86,6 +80,7 @@ */ #define AV_CODEC_CAP_SMALL_LAST_FRAME (1 << 6) +#if FF_API_SUBFRAMES /** * Codec can output multiple frames per AVPacket * Normally demuxers return one frame at a time, demuxers which do not do @@ -98,6 +93,8 @@ * as a last resort. */ #define AV_CODEC_CAP_SUBFRAMES (1 << 8) +#endif + /** * Codec is experimental and is thus avoided in favor of non experimental * encoders @@ -125,9 +122,6 @@ * multithreading-capable external libraries. */ #define AV_CODEC_CAP_OTHER_THREADS (1 << 15) -#if FF_API_AUTO_THREADS -#define AV_CODEC_CAP_AUTO_THREADS AV_CODEC_CAP_OTHER_THREADS -#endif /** * Audio encoder supports receiving a different number of samples in each call. */ @@ -143,17 +137,6 @@ */ #define AV_CODEC_CAP_AVOID_PROBING (1 << 17) -#if FF_API_UNUSED_CODEC_CAPS -/** - * Deprecated and unused. Use AVCodecDescriptor.props instead - */ -#define AV_CODEC_CAP_INTRA_ONLY 0x40000000 -/** - * Deprecated and unused. Use AVCodecDescriptor.props instead - */ -#define AV_CODEC_CAP_LOSSLESS 0x80000000 -#endif - /** * Codec is backed by a hardware implementation. Typically used to * identify a non-hwaccel hardware decoder. For information about hwaccels, use @@ -169,9 +152,9 @@ #define AV_CODEC_CAP_HYBRID (1 << 19) /** - * This codec takes the reordered_opaque field from input AVFrames - * and returns it in the corresponding field in AVCodecContext after - * encoding. + * This encoder can reorder user opaque values from input AVFrames and return + * them with corresponding output packets. + * @see AV_CODEC_FLAG_COPY_OPAQUE */ #define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE (1 << 20) @@ -182,6 +165,14 @@ */ #define AV_CODEC_CAP_ENCODER_FLUSH (1 << 21) +/** + * The encoder is able to output reconstructed frame data, i.e. raw frames that + * would be produced by decoding the encoded bitstream. + * + * Reconstructed frame output is enabled by the AV_CODEC_FLAG_RECON_FRAME flag. + */ +#define AV_CODEC_CAP_ENCODER_RECON_FRAME (1 << 22) + /** * AVProfile. */ @@ -214,19 +205,21 @@ typedef struct AVCodec { */ int capabilities; uint8_t max_lowres; ///< maximum value for lowres supported by the decoder - const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - const enum AVPixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 - const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 - const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 -#if FF_API_OLD_CHANNEL_LAYOUT + /** - * @deprecated use ch_layouts instead + * Deprecated codec capabilities. */ attribute_deprecated - const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 -#endif + const AVRational *supported_framerates; ///< @deprecated use avcodec_get_supported_config() + attribute_deprecated + const enum AVPixelFormat *pix_fmts; ///< @deprecated use avcodec_get_supported_config() + attribute_deprecated + const int *supported_samplerates; ///< @deprecated use avcodec_get_supported_config() + attribute_deprecated + const enum AVSampleFormat *sample_fmts; ///< @deprecated use avcodec_get_supported_config() + const AVClass *priv_class; ///< AVClass for the private context - const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} + const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {AV_PROFILE_UNKNOWN} /** * Group name of the codec implementation. @@ -242,7 +235,9 @@ typedef struct AVCodec { /** * Array of supported channel layouts, terminated with a zeroed layout. + * @deprecated use avcodec_get_supported_config() */ + attribute_deprecated const AVChannelLayout *ch_layouts; } AVCodec; diff --git a/include/libavcodec/codec2utils.h b/include/libavcodec/codec2utils.h new file mode 100644 index 0000000..6812ae8 --- /dev/null +++ b/include/libavcodec/codec2utils.h @@ -0,0 +1,63 @@ +/* + * codec2 utility functions + * Copyright (c) 2017 Tomas Härdin + * + * 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_CODEC2UTILS_H +#define AVCODEC_CODEC2UTILS_H + +#include + +//Highest mode we're willing to use. +//Don't want to let users accidentally produce files that can't be decoded in the future. +//CODEC2_MODE_WB (9) is experimental/unstable as of 2017-11-23. +#define CODEC2_MODE_MAX 8 //CODEC2_MODE_700C + +//Used by both codec2raw demuxer and libcodec2 encoder. +//The integers match the values in codec2.h, so "3200" -> CODEC2_MODE_3000 = 0 and so on. +//It is possible that we're linked to a version of libcodec2 that lacks some of these modes. +//For example Debian stretch ships with libcodec2.so.0.4 which lacks CODEC2_MODE_700C. +#define CODEC2_AVOPTIONS(desc, classname, min_val, default_val, option_flags) \ + { "mode", desc, offsetof(classname, mode), AV_OPT_TYPE_INT, {.i64 = default_val}, min_val, CODEC2_MODE_MAX, .flags=option_flags, .unit="codec2_mode"},\ + { "3200", "3200", 0, AV_OPT_TYPE_CONST, {.i64 = 0}, .flags=option_flags, .unit="codec2_mode"},\ + { "2400", "2400", 0, AV_OPT_TYPE_CONST, {.i64 = 1}, .flags=option_flags, .unit="codec2_mode"},\ + { "1600", "1600", 0, AV_OPT_TYPE_CONST, {.i64 = 2}, .flags=option_flags, .unit="codec2_mode"},\ + { "1400", "1400", 0, AV_OPT_TYPE_CONST, {.i64 = 3}, .flags=option_flags, .unit="codec2_mode"},\ + { "1300", "1300", 0, AV_OPT_TYPE_CONST, {.i64 = 4}, .flags=option_flags, .unit="codec2_mode"},\ + { "1200", "1200", 0, AV_OPT_TYPE_CONST, {.i64 = 5}, .flags=option_flags, .unit="codec2_mode"},\ + { "700", "700", 0, AV_OPT_TYPE_CONST, {.i64 = 6}, .flags=option_flags, .unit="codec2_mode"},\ + { "700B", "700B", 0, AV_OPT_TYPE_CONST, {.i64 = 7}, .flags=option_flags, .unit="codec2_mode"},\ + { "700C", "700C", 0, AV_OPT_TYPE_CONST, {.i64 = 8}, .flags=option_flags, .unit="codec2_mode"} + +#define CODEC2_EXTRADATA_SIZE 4 + +//Used in codec2raw demuxer and libcodec2 encoder +static inline void codec2_make_extradata(uint8_t *ptr, int mode) { + //version 0.8 as of 2017-12-23 (r3386) + ptr[0] = 0; //major + ptr[1] = 8; //minor + ptr[2] = mode; //mode + ptr[3] = 0; //flags +} + +static inline uint8_t codec2_mode_from_extradata(uint8_t *ptr) { + return ptr[2]; +} + +#endif /* AVCODEC_CODEC2UTILS_H */ diff --git a/include/libavcodec/codec_desc.h b/include/libavcodec/codec_desc.h index 126b52d..96afd20 100644 --- a/include/libavcodec/codec_desc.h +++ b/include/libavcodec/codec_desc.h @@ -60,7 +60,7 @@ typedef struct AVCodecDescriptor { const char *const *mime_types; /** * If non-NULL, an array of profiles recognized for this codec. - * Terminated with FF_PROFILE_UNKNOWN. + * Terminated with AV_PROFILE_UNKNOWN. */ const struct AVProfile *profiles; } AVCodecDescriptor; @@ -90,6 +90,12 @@ typedef struct AVCodecDescriptor { * equal. */ #define AV_CODEC_PROP_REORDER (1 << 3) + +/** + * Video codec supports separate coding of fields in interlaced frames. + */ +#define AV_CODEC_PROP_FIELDS (1 << 4) + /** * Subtitle codec is bitmap based * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field. diff --git a/include/libavcodec/codec_id.h b/include/libavcodec/codec_id.h index 81fb316..0a8d3be 100644 --- a/include/libavcodec/codec_id.h +++ b/include/libavcodec/codec_id.h @@ -24,6 +24,8 @@ #include "libavutil/avutil.h" #include "libavutil/samplefmt.h" +#include "version_major.h" + /** * @addtogroup lavc_core * @{ @@ -251,7 +253,6 @@ enum AVCodecID { AV_CODEC_ID_AVRP, AV_CODEC_ID_012V, AV_CODEC_ID_AVUI, - AV_CODEC_ID_AYUV, AV_CODEC_ID_TARGA_Y216, AV_CODEC_ID_V308, AV_CODEC_ID_V408, @@ -312,6 +313,15 @@ enum AVCodecID { AV_CODEC_ID_JPEGXL, AV_CODEC_ID_QOI, AV_CODEC_ID_PHM, + AV_CODEC_ID_RADIANCE_HDR, + AV_CODEC_ID_WBMP, + AV_CODEC_ID_MEDIA100, + AV_CODEC_ID_VQC, + AV_CODEC_ID_PDV, + AV_CODEC_ID_EVC, + AV_CODEC_ID_RTV1, + AV_CODEC_ID_VMIX, + AV_CODEC_ID_LEAD, /* various PCM "codecs" */ AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs @@ -405,6 +415,7 @@ enum AVCodecID { AV_CODEC_ID_ADPCM_IMA_CUNNING, AV_CODEC_ID_ADPCM_IMA_MOFLEX, AV_CODEC_ID_ADPCM_IMA_ACORN, + AV_CODEC_ID_ADPCM_XMD, /* AMR */ AV_CODEC_ID_AMR_NB = 0x12000, @@ -422,6 +433,8 @@ enum AVCodecID { AV_CODEC_ID_SDX2_DPCM, AV_CODEC_ID_GREMLIN_DPCM, AV_CODEC_ID_DERF_DPCM, + AV_CODEC_ID_WADY_DPCM, + AV_CODEC_ID_CBD2_DPCM, /* audio codecs */ AV_CODEC_ID_MP2 = 0x15000, @@ -521,6 +534,16 @@ enum AVCodecID { AV_CODEC_ID_FASTAUDIO, AV_CODEC_ID_MSNSIREN, AV_CODEC_ID_DFPWM, + AV_CODEC_ID_BONK, + AV_CODEC_ID_MISC4, + AV_CODEC_ID_APAC, + AV_CODEC_ID_FTR, + AV_CODEC_ID_WAVARC, + AV_CODEC_ID_RKA, + AV_CODEC_ID_AC4, + AV_CODEC_ID_OSQ, + AV_CODEC_ID_QOA, + AV_CODEC_ID_LC3, /* subtitle codecs */ AV_CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. @@ -565,6 +588,8 @@ enum AVCodecID { AV_CODEC_ID_DVD_NAV, AV_CODEC_ID_TIMED_ID3, AV_CODEC_ID_BIN_DATA, + AV_CODEC_ID_SMPTE_2038, + AV_CODEC_ID_LCEVC, AV_CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it @@ -575,6 +600,16 @@ enum AVCodecID { * stream (only used by libavformat) */ AV_CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information. AV_CODEC_ID_WRAPPED_AVFRAME = 0x21001, ///< Passthrough codec, AVFrames wrapped in AVPacket + /** + * Dummy null video codec, useful mainly for development and debugging. + * Null encoder/decoder discard all input and never return any output. + */ + AV_CODEC_ID_VNULL, + /** + * Dummy null audio codec, useful mainly for development and debugging. + * Null encoder/decoder discard all input and never return any output. + */ + AV_CODEC_ID_ANULL, }; /** diff --git a/include/libavcodec/codec_internal.h b/include/libavcodec/codec_internal.h index 08d928e..5b2db74 100644 --- a/include/libavcodec/codec_internal.h +++ b/include/libavcodec/codec_internal.h @@ -21,14 +21,18 @@ #include -#include "libavcodec/codec.h" #include "libavutil/attributes.h" +#include "avcodec.h" +#include "codec.h" +#include "config.h" /** - * The codec does not modify any global variables in the init function, - * allowing to call the init function without locking any global mutexes. + * The codec is not known to be init-threadsafe (i.e. it might be unsafe + * to initialize this codec and another codec concurrently, typically because + * the codec calls external APIs that are not known to be thread-safe). + * Therefore calling the codec's init function needs to be guarded with a lock. */ -#define FF_CODEC_CAP_INIT_THREADSAFE (1 << 0) +#define FF_CODEC_CAP_NOT_INIT_THREADSAFE (1 << 0) /** * The codec allows calling the close function for deallocation even if * the init function returned a failure. Without this capability flag, a @@ -36,43 +40,54 @@ * init function and does not expect the close function to be called at * all. */ -#define FF_CODEC_CAP_INIT_CLEANUP (1 << 1) +#define FF_CODEC_CAP_INIT_CLEANUP (1 << 1) /** * Decoders marked with FF_CODEC_CAP_SETS_PKT_DTS want to set * AVFrame.pkt_dts manually. If the flag is set, decode.c won't overwrite * this field. If it's unset, decode.c tries to guess the pkt_dts field * from the input AVPacket. */ -#define FF_CODEC_CAP_SETS_PKT_DTS (1 << 2) +#define FF_CODEC_CAP_SETS_PKT_DTS (1 << 2) /** * The decoder extracts and fills its parameters even if the frame is * skipped due to the skip_frame setting. */ -#define FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM (1 << 3) +#define FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM (1 << 3) /** * The decoder sets the cropping fields in the output frames manually. * If this cap is set, the generic code will initialize output frame * dimensions to coded rather than display values. */ -#define FF_CODEC_CAP_EXPORTS_CROPPING (1 << 4) +#define FF_CODEC_CAP_EXPORTS_CROPPING (1 << 4) /** * Codec initializes slice-based threading with a main function */ -#define FF_CODEC_CAP_SLICE_THREAD_HAS_MF (1 << 5) -/* - * The codec supports frame threading and has inter-frame dependencies, so it - * uses ff_thread_report/await_progress(). +#define FF_CODEC_CAP_SLICE_THREAD_HAS_MF (1 << 5) +/** + * The decoder might make use of the ProgressFrame API. */ -#define FF_CODEC_CAP_ALLOCATE_PROGRESS (1 << 6) +#define FF_CODEC_CAP_USES_PROGRESSFRAMES (1 << 6) /** * Codec handles avctx->thread_count == 0 (auto) internally. */ -#define FF_CODEC_CAP_AUTO_THREADS (1 << 7) +#define FF_CODEC_CAP_AUTO_THREADS (1 << 7) /** * Codec handles output frame properties internally instead of letting the * internal logic derive them from AVCodecInternal.last_pkt_props. */ -#define FF_CODEC_CAP_SETS_FRAME_PROPS (1 << 8) +#define FF_CODEC_CAP_SETS_FRAME_PROPS (1 << 8) +/** + * Codec supports embedded ICC profiles (AV_FRAME_DATA_ICC_PROFILE). + */ +#define FF_CODEC_CAP_ICC_PROFILES (1 << 9) +/** + * The encoder has AV_CODEC_CAP_DELAY set, but does not actually have delay - it + * only wants to be flushed at the end to update some context variables (e.g. + * 2pass stats) or produce a trailing packet. Besides that it immediately + * produces exactly one output packet per each input frame, just as no-delay + * encoders do. + */ +#define FF_CODEC_CAP_EOF_FLUSH (1 << 10) /** * FFCodec.codec_tags termination value @@ -118,14 +133,20 @@ typedef struct FFCodec { /** * Internal codec capabilities FF_CODEC_CAP_*. */ - unsigned caps_internal : 29; + unsigned caps_internal:27; + + /** + * This field determines the video color ranges supported by an encoder. + * Should be set to a bitmask of AVCOL_RANGE_MPEG and AVCOL_RANGE_JPEG. + */ + unsigned color_ranges:2; /** * This field determines the type of the codec (decoder/encoder) * and also the exact callback cb implemented by the codec. * cb_type uses enum FFCodecType values. */ - unsigned cb_type : 3; + unsigned cb_type:3; int priv_data_size; /** @@ -152,14 +173,6 @@ typedef struct FFCodec { */ const FFCodecDefault *defaults; - /** - * Initialize codec static data, called from av_codec_iterate(). - * - * This is not intended for time consuming operations as it is - * run for every codec regardless of that codec being used. - */ - void (*init_static_data)(struct FFCodec *codec); - int (*init)(struct AVCodecContext *); union { @@ -176,7 +189,7 @@ typedef struct FFCodec { * negative error code on failure */ int (*decode)(struct AVCodecContext *avctx, struct AVFrame *frame, - int *got_frame_ptr, struct AVPacket *avpkt); + int *got_frame_ptr, struct AVPacket *avpkt); /** * Decode subtitle data to an AVSubtitle. * cb is in this state if cb_type is FF_CODEC_CB_TYPE_DECODE_SUB. @@ -184,7 +197,7 @@ typedef struct FFCodec { * Apart from that this is like the decode callback. */ int (*decode_sub)(struct AVCodecContext *avctx, struct AVSubtitle *sub, - int *got_frame_ptr, const struct AVPacket *avpkt); + int *got_frame_ptr, const struct AVPacket *avpkt); /** * Decode API with decoupled packet/frame dataflow. * cb is in this state if cb_type is FF_CODEC_CB_TYPE_RECEIVE_FRAME. @@ -205,13 +218,13 @@ typedef struct FFCodec { * @return 0 on success, negative error code on failure */ int (*encode)(struct AVCodecContext *avctx, struct AVPacket *avpkt, - const struct AVFrame *frame, int *got_packet_ptr); + const struct AVFrame *frame, int *got_packet_ptr); /** * Encode subtitles to a raw buffer. * cb is in this state if cb_type is FF_CODEC_CB_TYPE_ENCODE_SUB. */ int (*encode_sub)(struct AVCodecContext *avctx, uint8_t *buf, - int buf_size, const struct AVSubtitle *sub); + int buf_size, const struct AVSubtitle *sub); /** * Encode API with decoupled frame/packet dataflow. * cb is in this state if cb_type is FF_CODEC_CB_TYPE_RECEIVE_PACKET. @@ -249,29 +262,74 @@ typedef struct FFCodec { * List of supported codec_tags, terminated by FF_CODEC_TAGS_END. */ const uint32_t *codec_tags; + + /** + * Custom callback for avcodec_get_supported_config(). If absent, + * ff_default_get_supported_config() will be used. `out_num_configs` will + * always be set to a valid pointer. + */ + int (*get_supported_config)(const AVCodecContext *avctx, + const AVCodec *codec, + enum AVCodecConfig config, + unsigned flags, + const void **out_configs, + int *out_num_configs); } FFCodec; -#define FF_CODEC_DECODE_CB(func) \ - .cb_type = FF_CODEC_CB_TYPE_DECODE, \ - .cb.decode = (func) -#define FF_CODEC_DECODE_SUB_CB(func) \ - .cb_type = FF_CODEC_CB_TYPE_DECODE_SUB, \ - .cb.decode_sub = (func) -#define FF_CODEC_RECEIVE_FRAME_CB(func) \ - .cb_type = FF_CODEC_CB_TYPE_RECEIVE_FRAME, \ - .cb.receive_frame = (func) -#define FF_CODEC_ENCODE_CB(func) \ - .cb_type = FF_CODEC_CB_TYPE_ENCODE, \ - .cb.encode = (func) -#define FF_CODEC_ENCODE_SUB_CB(func) \ - .cb_type = FF_CODEC_CB_TYPE_ENCODE_SUB, \ - .cb.encode_sub = (func) -#define FF_CODEC_RECEIVE_PACKET_CB(func) \ - .cb_type = FF_CODEC_CB_TYPE_RECEIVE_PACKET, \ +/** + * Default implementation for avcodec_get_supported_config(). Will return the + * relevant fields from AVCodec if present, or NULL otherwise. + * + * For AVCODEC_CONFIG_COLOR_RANGE, the output will depend on the bitmask in + * FFCodec.color_ranges, with a value of 0 returning NULL. + */ +int ff_default_get_supported_config(const AVCodecContext *avctx, + const AVCodec *codec, + enum AVCodecConfig config, + unsigned flags, + const void **out_configs, + int *out_num_configs); + +#if CONFIG_SMALL +#define CODEC_LONG_NAME(str) .p.long_name = NULL +#else +#define CODEC_LONG_NAME(str) .p.long_name = str +#endif + +#if HAVE_THREADS +#define UPDATE_THREAD_CONTEXT(func) \ + .update_thread_context = (func) +#define UPDATE_THREAD_CONTEXT_FOR_USER(func) \ + .update_thread_context_for_user = (func) +#else +#define UPDATE_THREAD_CONTEXT(func) \ + .update_thread_context = NULL +#define UPDATE_THREAD_CONTEXT_FOR_USER(func) \ + .update_thread_context_for_user = NULL +#endif + +#define FF_CODEC_DECODE_CB(func) \ + .cb_type = FF_CODEC_CB_TYPE_DECODE, \ + .cb.decode = (func) +#define FF_CODEC_DECODE_SUB_CB(func) \ + .cb_type = FF_CODEC_CB_TYPE_DECODE_SUB, \ + .cb.decode_sub = (func) +#define FF_CODEC_RECEIVE_FRAME_CB(func) \ + .cb_type = FF_CODEC_CB_TYPE_RECEIVE_FRAME, \ + .cb.receive_frame = (func) +#define FF_CODEC_ENCODE_CB(func) \ + .cb_type = FF_CODEC_CB_TYPE_ENCODE, \ + .cb.encode = (func) +#define FF_CODEC_ENCODE_SUB_CB(func) \ + .cb_type = FF_CODEC_CB_TYPE_ENCODE_SUB, \ + .cb.encode_sub = (func) +#define FF_CODEC_RECEIVE_PACKET_CB(func) \ + .cb_type = FF_CODEC_CB_TYPE_RECEIVE_PACKET, \ .cb.receive_packet = (func) -static av_always_inline const FFCodec *ffcodec(const AVCodec *codec) { - return (const FFCodec *)codec; +static av_always_inline const FFCodec *ffcodec(const AVCodec *codec) +{ + return (const FFCodec*)codec; } #endif /* AVCODEC_CODEC_INTERNAL_H */ diff --git a/include/libavcodec/codec_par.h b/include/libavcodec/codec_par.h index 7660791..f4b9bb5 100644 --- a/include/libavcodec/codec_par.h +++ b/include/libavcodec/codec_par.h @@ -29,20 +29,14 @@ #include "libavutil/pixfmt.h" #include "codec_id.h" +#include "defs.h" +#include "packet.h" /** * @addtogroup lavc_core + * @{ */ -enum AVFieldOrder { - AV_FIELD_UNKNOWN, - AV_FIELD_PROGRESSIVE, - AV_FIELD_TT, //< Top coded_first, top displayed first - AV_FIELD_BB, //< Bottom coded first, bottom displayed first - AV_FIELD_TB, //< Top coded first, bottom displayed first - AV_FIELD_BT, //< Bottom coded first, top displayed first -}; - /** * This struct describes the properties of an encoded stream. * @@ -78,6 +72,19 @@ typedef struct AVCodecParameters { */ int extradata_size; + /** + * Additional data associated with the entire stream. + * + * Should be allocated with av_packet_side_data_new() or + * av_packet_side_data_add(), and will be freed by avcodec_parameters_free(). + */ + AVPacketSideData *coded_side_data; + + /** + * Amount of entries in @ref coded_side_data. + */ + int nb_coded_side_data; + /** * - video: the pixel format, the value corresponds to enum AVPixelFormat. * - audio: the sample format, the value corresponds to enum AVSampleFormat. @@ -136,6 +143,18 @@ typedef struct AVCodecParameters { */ AVRational sample_aspect_ratio; + /** + * Video only. Number of frames per second, for streams with constant frame + * durations. Should be set to { 0, 1 } when some frames have differing + * durations or if the value is not known. + * + * @note This field correponds to values that are stored in codec-level + * headers and is typically overridden by container/transport-layer + * timestamps, when available. It should thus be used only as a last resort, + * when no higher-level timing information is available. + */ + AVRational framerate; + /** * Video only. The order of the fields in interlaced video. */ @@ -155,22 +174,10 @@ typedef struct AVCodecParameters { */ int video_delay; -#if FF_API_OLD_CHANNEL_LAYOUT /** - * Audio only. The channel layout bitmask. May be 0 if the channel layout is - * unknown or unspecified, otherwise the number of bits set must be equal to - * the channels field. - * @deprecated use ch_layout + * Audio only. The channel layout and number of channels. */ - attribute_deprecated - uint64_t channel_layout; - /** - * Audio only. The number of audio channels. - * @deprecated use ch_layout.nb_channels - */ - attribute_deprecated - int channels; -#endif + AVChannelLayout ch_layout; /** * Audio only. The number of audio samples per second. */ @@ -205,11 +212,6 @@ typedef struct AVCodecParameters { * Audio only. Number of samples to skip after a discontinuity. */ int seek_preroll; - - /** - * Audio only. The channel layout and number of channels. - */ - AVChannelLayout ch_layout; } AVCodecParameters; /** diff --git a/include/libavcodec/container_fifo.h b/include/libavcodec/container_fifo.h new file mode 100644 index 0000000..dd8b1d3 --- /dev/null +++ b/include/libavcodec/container_fifo.h @@ -0,0 +1,89 @@ +/* + * 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_CONTAINER_FIFO_H +#define AVCODEC_CONTAINER_FIFO_H + +#include + +/** + * ContainerFifo is a FIFO for "containers" - dynamically allocated reusable + * structs (e.g. AVFrame or AVPacket). ContainerFifo uses an internal pool of + * such containers to avoid allocating and freeing them repeatedly. + */ +typedef struct ContainerFifo ContainerFifo; + +/** + * Allocate a new ContainerFifo for the container type defined by provided + * callbacks. + * + * @param container_alloc allocate a new container instance and return a pointer + * to it, or NULL on failure + * @param container_reset reset the provided container instance to a clean state + * @param container_free free the provided container instance + * @param fifo_write transfer the contents of src to dst, where src is a + * container instance provided to ff_container_fifo_write() + * @param fifo_read transfer the contents of src to dst in other cases + * + * @note fifo_read() and fifo_write() are different parameters in order to allow + * fifo_write() implementations that make a new reference in dst, leaving + * src untouched (see e.g. ff_container_fifo_alloc_avframe()) + */ +ContainerFifo* +ff_container_fifo_alloc(void* (*container_alloc)(void), + void (*container_reset)(void *obj), + void (*container_free) (void *obj), + int (*fifo_write) (void *dst, void *src), + int (*fifo_read) (void *dst, void *src)); + +/** + * Allocate a ContainerFifo instance for AVFrames. + * Note that ff_container_fifo_write() will call av_frame_ref() on src, making a + * new reference in dst and leaving src untouched. + * + * @param flags unused currently + */ +ContainerFifo *ff_container_fifo_alloc_avframe(unsigned flags); + +/** + * Free a ContainerFifo and everything in it. + */ +void ff_container_fifo_free(ContainerFifo **pf); + +/** + * Write the contents of obj to the FIFO. + * + * The fifo_write() callback previously provided to ff_container_fifo_alloc() + * will be called with obj as src in order to perform the actual transfer. + */ +int ff_container_fifo_write(ContainerFifo *pf, void *obj); + +/** + * Read the next available object from the FIFO into obj. + * + * The fifo_read() callback previously provided to ff_container_fifo_alloc() + * will be called with obj as dst in order to perform the actual transfer. + */ +int ff_container_fifo_read(ContainerFifo *pf, void *obj); + +/** + * @return number of objects available for reading + */ +size_t ff_container_fifo_can_read(ContainerFifo *pf); + +#endif // AVCODEC_CONTAINER_FIFO_H diff --git a/include/libavcodec/cookdata.h b/include/libavcodec/cookdata.h new file mode 100644 index 0000000..a4ca120 --- /dev/null +++ b/include/libavcodec/cookdata.h @@ -0,0 +1,361 @@ +/* + * COOK compatible decoder data + * Copyright (c) 2003 Sascha Sommer + * Copyright (c) 2005 Benjamin Larsson + * + * 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 + */ + +/** + * @file + * Cook AKA RealAudio G2 compatible decoder data + */ + +#ifndef AVCODEC_COOKDATA_H +#define AVCODEC_COOKDATA_H + +#include + +/* various data tables */ + +static const int expbits_tab[8] = { + 52,47,43,37,29,22,16,0, +}; + +static const float dither_tab[9] = { + 0.0, 0.0, 0.0, 0.0, 0.0, 0.176777, 0.25, 0.707107, 1.0 +}; + +static const float quant_centroid_tab[7][14] = { + { 0.000, 0.392, 0.761, 1.120, 1.477, 1.832, 2.183, 2.541, 2.893, 3.245, 3.598, 3.942, 4.288, 4.724 }, + { 0.000, 0.544, 1.060, 1.563, 2.068, 2.571, 3.072, 3.562, 4.070, 4.620, 0.000, 0.000, 0.000, 0.000 }, + { 0.000, 0.746, 1.464, 2.180, 2.882, 3.584, 4.316, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 }, + { 0.000, 1.006, 2.000, 2.993, 3.985, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 }, + { 0.000, 1.321, 2.703, 3.983, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 }, + { 0.000, 1.657, 3.491, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 }, + { 0.000, 1.964, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 } +}; + +static const int invradix_tab[7] = { + 74899, 104858, 149797, 209716, 262144, 349526, 524288, +}; + +static const int kmax_tab[7] = { + 13, 9, 6, 4, 3, 2, 1, +}; + +static const int vd_tab[7] = { + 2, 2, 2, 4, 4, 5, 5, +}; + +static const int vpr_tab[7] = { + 10, 10, 10, 5, 5, 4, 4, +}; + + + +/* VLC data */ + +#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_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] = { + { 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_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] = { + 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 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_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 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_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_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_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 void* const cvh_huffsyms[7] = { + cvh_huffsyms0, cvh_huffsyms1, cvh_huffsyms2, cvh_huffsyms3, + cvh_huffsyms4, cvh_huffsyms5, cvh_huffsyms6, +}; + +static const uint8_t ccpl_huffsyms2[3] = { + 1, 0, 2, +}; + +static const uint8_t ccpl_huffsyms3[7] = { + 3, 2, 4, 5, 1, 0, 6, +}; + +static const uint8_t ccpl_huffsyms4[15] = { + 7, 6, 8, 5, 9, 4, 10, 3, 11, 2, 12, 0, 1, 13, 14, +}; + +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 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_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] = { + ccpl_huffsyms2, ccpl_huffsyms3, + ccpl_huffsyms4, ccpl_huffsyms5, ccpl_huffsyms6 +}; + +//Coupling tables + +static const int cplband[51] = { + 0,1,2,3,4,5,6,7,8,9, + 10,11,11,12,12,13,13,14,14,14, + 15,15,15,15,16,16,16,16,16,17, + 17,17,17,17,17,18,18,18,18,18, + 18,18,19,19,19,19,19,19,19,19, + 19, +}; + +// The 1 and 0 at the beginning/end are to prevent overflows with +// bitstream-read indexes. E.g. if n_bits=5, we can access any +// index from [1, (1< +#include + +#include "libavutil/intreadwrite.h" + +static inline void copy_block2(uint8_t *dst, const uint8_t *src, ptrdiff_t dstStride, ptrdiff_t srcStride, int h) +{ + int i; + for (i = 0; i < h; i++) { + AV_COPY16U(dst, src); + dst += dstStride; + src += srcStride; + } +} + +static inline void copy_block4(uint8_t *dst, const uint8_t *src, ptrdiff_t dstStride, ptrdiff_t srcStride, int h) +{ + int i; + for (i = 0; i < h; i++) { + AV_COPY32U(dst, src); + dst += dstStride; + src += srcStride; + } +} + +static inline void copy_block8(uint8_t *dst, const uint8_t *src, ptrdiff_t dstStride, ptrdiff_t srcStride, int h) +{ + int i; + for (i = 0; i < h; i++) { + AV_COPY64U(dst, src); + dst += dstStride; + src += srcStride; + } +} + +static inline void copy_block9(uint8_t *dst, const uint8_t *src, ptrdiff_t dstStride, ptrdiff_t srcStride, int h) +{ + int i; + for (i = 0; i < h; i++) { + AV_COPY64U(dst, src); + dst[8] = src[8]; + dst += dstStride; + src += srcStride; + } +} + +static inline void copy_block16(uint8_t *dst, const uint8_t *src, ptrdiff_t dstStride, ptrdiff_t srcStride, int h) +{ + int i; + for (i = 0; i < h; i++) { + AV_COPY128U(dst, src); + dst += dstStride; + src += srcStride; + } +} + +static inline void copy_block17(uint8_t *dst, const uint8_t *src, ptrdiff_t dstStride, ptrdiff_t srcStride, int h) +{ + int i; + for (i = 0; i < h; i++) { + AV_COPY128U(dst, src); + dst[16] = src[16]; + dst += dstStride; + src += srcStride; + } +} + +#endif /* AVCODEC_COPY_BLOCK_H */ diff --git a/include/libavcodec/d3d11va.h b/include/libavcodec/d3d11va.h index 6816b6c..27f40e5 100755 --- a/include/libavcodec/d3d11va.h +++ b/include/libavcodec/d3d11va.h @@ -45,9 +45,6 @@ * @{ */ -#define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for Direct3D11 and old UVD/UVD+ ATI video cards -#define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO 2 ///< Work around for Direct3D11 and old Intel GPUs with ClearVideo interface - /** * This structure is used to provides the necessary configurations and data * to the Direct3D11 FFmpeg HWAccel implementation. diff --git a/include/libavcodec/d3d12va_decode.h b/include/libavcodec/d3d12va_decode.h new file mode 100644 index 0000000..b649947 --- /dev/null +++ b/include/libavcodec/d3d12va_decode.h @@ -0,0 +1,179 @@ +/* + * Direct3D 12 HW acceleration video decoder + * + * copyright (c) 2022-2023 Wu Jianhua + * + * 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_D3D12VA_DECODE_H +#define AVCODEC_D3D12VA_DECODE_H + +#include "libavutil/fifo.h" +#include "libavutil/hwcontext.h" +#include "libavutil/hwcontext_d3d12va.h" +#include "avcodec.h" +#include "internal.h" +#include "hwaccel_internal.h" + +/** + * @brief This structure is used to provide the necessary configurations and data + * to the FFmpeg Direct3D 12 HWAccel implementation for video decoder. + */ +typedef struct D3D12VADecodeContext { + AVBufferRef *decoder_ref; + + /** + * D3D12 video decoder + */ + ID3D12VideoDecoder *decoder; + + /** + * D3D12 video decoder heap + */ + ID3D12VideoDecoderHeap *decoder_heap; + + /** + * D3D12 configuration used to create the decoder + * + * Specified by decoders + */ + D3D12_VIDEO_DECODE_CONFIGURATION cfg; + + /** + * A cached queue for reusing the D3D12 command allocators and upload buffers + * + * @see https://learn.microsoft.com/en-us/windows/win32/direct3d12/recording-command-lists-and-bundles#id3d12commandallocator + */ + AVFifo *objects_queue; + + /** + * D3D12 command queue + */ + ID3D12CommandQueue *command_queue; + + /** + * D3D12 video decode command list + */ + ID3D12VideoDecodeCommandList *command_list; + + /** + * The array of resources used for reference frames + * + * The ref_resources.length is the same as D3D12VADecodeContext.max_num_ref + */ + ID3D12Resource **ref_resources; + + /** + * The array of subresources used for reference frames + * + * The ref_subresources.length is the same as D3D12VADecodeContext.max_num_ref + */ + UINT *ref_subresources; + + /** + * Maximum number of reference frames + */ + UINT max_num_ref; + + /** + * Used mask used to record reference frames indices + */ + UINT used_mask; + + /** + * Bitstream size for each frame + */ + UINT bitstream_size; + + /** + * The sync context used to sync command queue + */ + AVD3D12VASyncContext sync_ctx; + + /** + * A pointer to AVD3D12VADeviceContext used to create D3D12 objects + */ + AVD3D12VADeviceContext *device_ctx; + + /** + * Pixel format + */ + enum AVPixelFormat pix_fmt; + + /** + * Private to the FFmpeg AVHWAccel implementation + */ + unsigned report_id; +} D3D12VADecodeContext; + +/** + * @} + */ +#define D3D12VA_VIDEO_DEC_ASYNC_DEPTH 36 +#define D3D12VA_DECODE_CONTEXT(avctx) ((D3D12VADecodeContext *)((avctx)->internal->hwaccel_priv_data)) +#define D3D12VA_FRAMES_CONTEXT(avctx) ((AVHWFramesContext *)(avctx)->hw_frames_ctx->data) + +/** + * @brief Get a suitable maximum bitstream size + * + * Creating and destroying a resource on d3d12 needs sync and reallocation, so use this function + * to help allocate a big enough bitstream buffer to avoid recreating resources when decoding. + * + * @return the suitable size + */ +int ff_d3d12va_get_suitable_max_bitstream_size(AVCodecContext *avctx); + +/** + * @brief init D3D12VADecodeContext + * + * @return Error code (ret < 0 if failed) + */ +int ff_d3d12va_decode_init(AVCodecContext *avctx); + +/** + * @brief uninit D3D12VADecodeContext + * + * @return Error code (ret < 0 if failed) + */ +int ff_d3d12va_decode_uninit(AVCodecContext *avctx); + +/** + * @brief d3d12va common frame params + * + * @return Error code (ret < 0 if failed) + */ +int ff_d3d12va_common_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx); + +/** + * @brief d3d12va common end frame + * + * @param avctx codec context + * @param frame current output frame + * @param pp picture parameters + * @param pp_size the size of the picture parameters + * @param qm quantization matrix + * @param qm_size the size of the quantization matrix + * @param callback update decoder-specified input stream arguments + * @return Error code (ret < 0 if failed) + */ +int ff_d3d12va_common_end_frame(AVCodecContext *avctx, AVFrame *frame, + const void *pp, unsigned pp_size, + const void *qm, unsigned qm_size, + int(*)(AVCodecContext *, D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *, ID3D12Resource *)); + +#endif /* AVCODEC_D3D12VA_DEC_H */ diff --git a/include/libavcodec/d3d12va_encode.h b/include/libavcodec/d3d12va_encode.h new file mode 100644 index 0000000..3b0b815 --- /dev/null +++ b/include/libavcodec/d3d12va_encode.h @@ -0,0 +1,335 @@ +/* + * Direct3D 12 HW acceleration video encoder + * + * Copyright (c) 2024 Intel Corporation + * + * 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_D3D12VA_ENCODE_H +#define AVCODEC_D3D12VA_ENCODE_H + +#include "libavutil/fifo.h" +#include "libavutil/hwcontext.h" +#include "libavutil/hwcontext_d3d12va_internal.h" +#include "libavutil/hwcontext_d3d12va.h" +#include "avcodec.h" +#include "internal.h" +#include "hwconfig.h" +#include "hw_base_encode.h" + +struct D3D12VAEncodeType; + +extern const AVCodecHWConfigInternal *const ff_d3d12va_encode_hw_configs[]; + +#define MAX_PARAM_BUFFER_SIZE 4096 +#define D3D12VA_VIDEO_ENC_ASYNC_DEPTH 8 + +typedef struct D3D12VAEncodePicture { + int header_size; + int aligned_header_size; + + AVD3D12VAFrame *input_surface; + AVD3D12VAFrame *recon_surface; + + AVBufferRef *output_buffer_ref; + ID3D12Resource *output_buffer; + + ID3D12Resource *encoded_metadata; + ID3D12Resource *resolved_metadata; + + D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA pic_ctl; + + int fence_value; +} D3D12VAEncodePicture; + +typedef struct D3D12VAEncodeProfile { + /** + * lavc profile value (AV_PROFILE_*). + */ + int av_profile; + + /** + * Supported bit depth. + */ + int depth; + + /** + * Number of components. + */ + int nb_components; + + /** + * Chroma subsampling in width dimension. + */ + int log2_chroma_w; + + /** + * Chroma subsampling in height dimension. + */ + int log2_chroma_h; + + /** + * D3D12 profile value. + */ + D3D12_VIDEO_ENCODER_PROFILE_DESC d3d12_profile; +} D3D12VAEncodeProfile; + +enum { + RC_MODE_AUTO, + RC_MODE_CQP, + RC_MODE_CBR, + RC_MODE_VBR, + RC_MODE_QVBR, + RC_MODE_MAX = RC_MODE_QVBR, +}; + + +typedef struct D3D12VAEncodeRCMode { + /** + * Mode from above enum (RC_MODE_*). + */ + int mode; + + /** + * Name. + * + */ + const char *name; + + /** + * Uses bitrate parameters. + * + */ + int bitrate; + + /** + * Supports maxrate distinct from bitrate. + * + */ + int maxrate; + + /** + * Uses quality value. + * + */ + int quality; + + /** + * Supports HRD/VBV parameters. + * + */ + int hrd; + + /** + * D3D12 mode value. + */ + D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE d3d12_mode; +} D3D12VAEncodeRCMode; + +typedef struct D3D12VAEncodeContext { + FFHWBaseEncodeContext base; + + /** + * Codec-specific hooks. + */ + const struct D3D12VAEncodeType *codec; + + /** + * Explicitly set RC mode (otherwise attempt to pick from + * available modes). + */ + int explicit_rc_mode; + + /** + * Explicitly-set QP, for use with the "qp" options. + * (Forces CQP mode when set, overriding everything else.) + */ + int explicit_qp; + + /** + * RC quality level - meaning depends on codec and RC mode. + * In CQP mode this sets the fixed quantiser value. + */ + int rc_quality; + + /** + * Chosen encoding profile details. + */ + const D3D12VAEncodeProfile *profile; + + AVD3D12VADeviceContext *hwctx; + + /** + * ID3D12Device3 interface. + */ + ID3D12Device3 *device3; + + /** + * ID3D12VideoDevice3 interface. + */ + ID3D12VideoDevice3 *video_device3; + + /** + * Pool of (reusable) bitstream output buffers. + */ + AVBufferPool *output_buffer_pool; + + /** + * D3D12 video encoder. + */ + AVBufferRef *encoder_ref; + + ID3D12VideoEncoder *encoder; + + /** + * D3D12 video encoder heap. + */ + ID3D12VideoEncoderHeap *encoder_heap; + + /** + * A cached queue for reusing the D3D12 command allocators. + * + * @see https://learn.microsoft.com/en-us/windows/win32/direct3d12/recording-command-lists-and-bundles#id3d12commandallocator + */ + AVFifo *allocator_queue; + + /** + * D3D12 command queue. + */ + ID3D12CommandQueue *command_queue; + + /** + * D3D12 video encode command list. + */ + ID3D12VideoEncodeCommandList2 *command_list; + + /** + * The sync context used to sync command queue. + */ + AVD3D12VASyncContext sync_ctx; + + /** + * The bi_not_empty feature. + */ + int bi_not_empty; + + /** + * D3D12_FEATURE structures. + */ + D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOURCE_REQUIREMENTS req; + + D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS res_limits; + + /** + * D3D12_VIDEO_ENCODER structures. + */ + D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC resolution; + + D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION codec_conf; + + D3D12_VIDEO_ENCODER_RATE_CONTROL rc; + + D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE gop; + + D3D12_VIDEO_ENCODER_LEVEL_SETTING level; +} D3D12VAEncodeContext; + +typedef struct D3D12VAEncodeType { + /** + * List of supported profiles. + */ + const D3D12VAEncodeProfile *profiles; + + /** + * D3D12 codec name. + */ + D3D12_VIDEO_ENCODER_CODEC d3d12_codec; + + /** + * Codec feature flags. + */ + int flags; + + /** + * Default quality for this codec - used as quantiser or RC quality + * factor depending on RC mode. + */ + int default_quality; + + /** + * Query codec configuration and determine encode parameters like + * block sizes for surface alignment and slices. If not set, assume + * that all blocks are 16x16 and that surfaces should be aligned to match + * this. + */ + int (*get_encoder_caps)(AVCodecContext *avctx); + + /** + * Perform any extra codec-specific configuration. + */ + int (*configure)(AVCodecContext *avctx); + + /** + * Set codec-specific level setting. + */ + int (*set_level)(AVCodecContext *avctx); + + /** + * The size of any private data structure associated with each + * picture (can be zero if not required). + */ + size_t picture_priv_data_size; + + /** + * Fill the corresponding parameters. + */ + int (*init_sequence_params)(AVCodecContext *avctx); + + int (*init_picture_params)(AVCodecContext *avctx, + FFHWBaseEncodePicture *base_pic); + + void (*free_picture_params)(D3D12VAEncodePicture *pic); + + /** + * Write the packed header data to the provided buffer. + */ + int (*write_sequence_header)(AVCodecContext *avctx, + char *data, size_t *data_len); +} D3D12VAEncodeType; + +int ff_d3d12va_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt); + +int ff_d3d12va_encode_init(AVCodecContext *avctx); +int ff_d3d12va_encode_close(AVCodecContext *avctx); + +#define D3D12VA_ENCODE_RC_MODE(name, desc) \ + { #name, desc, 0, AV_OPT_TYPE_CONST, { .i64 = RC_MODE_ ## name }, \ + 0, 0, FLAGS, .unit = "rc_mode" } +#define D3D12VA_ENCODE_RC_OPTIONS \ + { "rc_mode",\ + "Set rate control mode", \ + OFFSET(common.explicit_rc_mode), AV_OPT_TYPE_INT, \ + { .i64 = RC_MODE_AUTO }, RC_MODE_AUTO, RC_MODE_MAX, FLAGS, .unit = "rc_mode" }, \ + { "auto", "Choose mode automatically based on other parameters", \ + 0, AV_OPT_TYPE_CONST, { .i64 = RC_MODE_AUTO }, 0, 0, FLAGS, .unit = "rc_mode" }, \ + D3D12VA_ENCODE_RC_MODE(CQP, "Constant-quality"), \ + D3D12VA_ENCODE_RC_MODE(CBR, "Constant-bitrate"), \ + D3D12VA_ENCODE_RC_MODE(VBR, "Variable-bitrate"), \ + D3D12VA_ENCODE_RC_MODE(QVBR, "Quality-defined variable-bitrate") + +#endif /* AVCODEC_D3D12VA_ENCODE_H */ diff --git a/include/libavcodec/dca.h b/include/libavcodec/dca.h new file mode 100644 index 0000000..6be975f --- /dev/null +++ b/include/libavcodec/dca.h @@ -0,0 +1,226 @@ +/* + * DCA compatible decoder + * Copyright (C) 2004 Gildas Bazin + * Copyright (C) 2004 Benjamin Zores + * Copyright (C) 2006 Benjamin Larsson + * Copyright (C) 2007 Konstantin Shishkov + * Copyright (C) 2016 foo86 + * + * 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_DCA_H +#define AVCODEC_DCA_H + +#include + +#include "libavutil/common.h" +#include "libavutil/intreadwrite.h" + +#include "get_bits.h" + +#define DCA_CORE_FRAME_HEADER_SIZE 18 + +enum DCAParseError { + DCA_PARSE_ERROR_SYNC_WORD = -1, + DCA_PARSE_ERROR_DEFICIT_SAMPLES = -2, + DCA_PARSE_ERROR_PCM_BLOCKS = -3, + DCA_PARSE_ERROR_FRAME_SIZE = -4, + DCA_PARSE_ERROR_AMODE = -5, + DCA_PARSE_ERROR_SAMPLE_RATE = -6, + DCA_PARSE_ERROR_RESERVED_BIT = -7, + DCA_PARSE_ERROR_LFE_FLAG = -8, + DCA_PARSE_ERROR_PCM_RES = -9, +}; + +typedef struct DCACoreFrameHeader { + uint8_t normal_frame; ///< Frame type + uint8_t deficit_samples; ///< Deficit sample count + uint8_t crc_present; ///< CRC present flag + uint8_t npcmblocks; ///< Number of PCM sample blocks + uint16_t frame_size; ///< Primary frame byte size + uint8_t audio_mode; ///< Audio channel arrangement + uint8_t sr_code; ///< Core audio sampling frequency + uint8_t br_code; ///< Transmission bit rate + uint8_t drc_present; ///< Embedded dynamic range flag + uint8_t ts_present; ///< Embedded time stamp flag + uint8_t aux_present; ///< Auxiliary data flag + uint8_t hdcd_master; ///< HDCD mastering flag + uint8_t ext_audio_type; ///< Extension audio descriptor flag + uint8_t ext_audio_present; ///< Extended coding flag + uint8_t sync_ssf; ///< Audio sync word insertion flag + uint8_t lfe_present; ///< Low frequency effects flag + uint8_t predictor_history; ///< Predictor history flag switch + uint8_t filter_perfect; ///< Multirate interpolator switch + uint8_t encoder_rev; ///< Encoder software revision + uint8_t copy_hist; ///< Copy history + uint8_t pcmr_code; ///< Source PCM resolution + uint8_t sumdiff_front; ///< Front sum/difference flag + uint8_t sumdiff_surround; ///< Surround sum/difference flag + uint8_t dn_code; ///< Dialog normalization / unspecified +} DCACoreFrameHeader; + +enum DCASpeaker { + DCA_SPEAKER_C, DCA_SPEAKER_L, DCA_SPEAKER_R, DCA_SPEAKER_Ls, + DCA_SPEAKER_Rs, DCA_SPEAKER_LFE1, DCA_SPEAKER_Cs, DCA_SPEAKER_Lsr, + DCA_SPEAKER_Rsr, DCA_SPEAKER_Lss, DCA_SPEAKER_Rss, DCA_SPEAKER_Lc, + DCA_SPEAKER_Rc, DCA_SPEAKER_Lh, DCA_SPEAKER_Ch, DCA_SPEAKER_Rh, + DCA_SPEAKER_LFE2, DCA_SPEAKER_Lw, DCA_SPEAKER_Rw, DCA_SPEAKER_Oh, + DCA_SPEAKER_Lhs, DCA_SPEAKER_Rhs, DCA_SPEAKER_Chr, DCA_SPEAKER_Lhr, + DCA_SPEAKER_Rhr, DCA_SPEAKER_Cl, DCA_SPEAKER_Ll, DCA_SPEAKER_Rl, + DCA_SPEAKER_RSV1, DCA_SPEAKER_RSV2, DCA_SPEAKER_RSV3, DCA_SPEAKER_RSV4, + + DCA_SPEAKER_COUNT +}; + +enum DCASpeakerMask { + DCA_SPEAKER_MASK_C = 0x00000001, + DCA_SPEAKER_MASK_L = 0x00000002, + DCA_SPEAKER_MASK_R = 0x00000004, + DCA_SPEAKER_MASK_Ls = 0x00000008, + DCA_SPEAKER_MASK_Rs = 0x00000010, + DCA_SPEAKER_MASK_LFE1 = 0x00000020, + DCA_SPEAKER_MASK_Cs = 0x00000040, + DCA_SPEAKER_MASK_Lsr = 0x00000080, + DCA_SPEAKER_MASK_Rsr = 0x00000100, + DCA_SPEAKER_MASK_Lss = 0x00000200, + DCA_SPEAKER_MASK_Rss = 0x00000400, + DCA_SPEAKER_MASK_Lc = 0x00000800, + DCA_SPEAKER_MASK_Rc = 0x00001000, + DCA_SPEAKER_MASK_Lh = 0x00002000, + DCA_SPEAKER_MASK_Ch = 0x00004000, + DCA_SPEAKER_MASK_Rh = 0x00008000, + DCA_SPEAKER_MASK_LFE2 = 0x00010000, + DCA_SPEAKER_MASK_Lw = 0x00020000, + DCA_SPEAKER_MASK_Rw = 0x00040000, + DCA_SPEAKER_MASK_Oh = 0x00080000, + DCA_SPEAKER_MASK_Lhs = 0x00100000, + DCA_SPEAKER_MASK_Rhs = 0x00200000, + DCA_SPEAKER_MASK_Chr = 0x00400000, + DCA_SPEAKER_MASK_Lhr = 0x00800000, + DCA_SPEAKER_MASK_Rhr = 0x01000000, + DCA_SPEAKER_MASK_Cl = 0x02000000, + DCA_SPEAKER_MASK_Ll = 0x04000000, + DCA_SPEAKER_MASK_Rl = 0x08000000, +}; + +#define DCA_SPEAKER_LAYOUT_MONO (DCA_SPEAKER_MASK_C) +#define DCA_SPEAKER_LAYOUT_STEREO (DCA_SPEAKER_MASK_L | DCA_SPEAKER_MASK_R) +#define DCA_SPEAKER_LAYOUT_2POINT1 (DCA_SPEAKER_LAYOUT_STEREO | DCA_SPEAKER_MASK_LFE1) +#define DCA_SPEAKER_LAYOUT_3_0 (DCA_SPEAKER_LAYOUT_STEREO | DCA_SPEAKER_MASK_C) +#define DCA_SPEAKER_LAYOUT_2_1 (DCA_SPEAKER_LAYOUT_STEREO | DCA_SPEAKER_MASK_Cs) +#define DCA_SPEAKER_LAYOUT_3_1 (DCA_SPEAKER_LAYOUT_3_0 | DCA_SPEAKER_MASK_Cs) +#define DCA_SPEAKER_LAYOUT_2_2 (DCA_SPEAKER_LAYOUT_STEREO | DCA_SPEAKER_MASK_Ls | DCA_SPEAKER_MASK_Rs) +#define DCA_SPEAKER_LAYOUT_5POINT0 (DCA_SPEAKER_LAYOUT_3_0 | DCA_SPEAKER_MASK_Ls | DCA_SPEAKER_MASK_Rs) +#define DCA_SPEAKER_LAYOUT_5POINT1 (DCA_SPEAKER_LAYOUT_5POINT0 | DCA_SPEAKER_MASK_LFE1) +#define DCA_SPEAKER_LAYOUT_7POINT0_WIDE (DCA_SPEAKER_LAYOUT_5POINT0 | DCA_SPEAKER_MASK_Lw | DCA_SPEAKER_MASK_Rw) +#define DCA_SPEAKER_LAYOUT_7POINT1_WIDE (DCA_SPEAKER_LAYOUT_7POINT0_WIDE | DCA_SPEAKER_MASK_LFE1) + +#define DCA_HAS_STEREO(mask) \ + ((mask & DCA_SPEAKER_LAYOUT_STEREO) == DCA_SPEAKER_LAYOUT_STEREO) + +enum DCASpeakerPair { + DCA_SPEAKER_PAIR_C = 0x0001, + DCA_SPEAKER_PAIR_LR = 0x0002, + DCA_SPEAKER_PAIR_LsRs = 0x0004, + DCA_SPEAKER_PAIR_LFE1 = 0x0008, + DCA_SPEAKER_PAIR_Cs = 0x0010, + DCA_SPEAKER_PAIR_LhRh = 0x0020, + DCA_SPEAKER_PAIR_LsrRsr = 0x0040, + DCA_SPEAKER_PAIR_Ch = 0x0080, + DCA_SPEAKER_PAIR_Oh = 0x0100, + DCA_SPEAKER_PAIR_LcRc = 0x0200, + DCA_SPEAKER_PAIR_LwRw = 0x0400, + DCA_SPEAKER_PAIR_LssRss = 0x0800, + DCA_SPEAKER_PAIR_LFE2 = 0x1000, + DCA_SPEAKER_PAIR_LhsRhs = 0x2000, + DCA_SPEAKER_PAIR_Chr = 0x4000, + DCA_SPEAKER_PAIR_LhrRhr = 0x8000 +}; + +/** + * Return number of individual channels in DCASpeakerPair mask + */ +static inline int ff_dca_count_chs_for_mask(unsigned int mask) +{ + return av_popcount((mask & 0xffff) | ((mask & 0xae66) << 16)); +} + +enum DCARepresentationType { + DCA_REPR_TYPE_LtRt = 2, + DCA_REPR_TYPE_LhRh = 3 +}; + +enum DCAExtensionMask { + DCA_CSS_CORE = 0x001, + DCA_CSS_XXCH = 0x002, + DCA_CSS_X96 = 0x004, + DCA_CSS_XCH = 0x008, + DCA_CSS_MASK = 0x00f, + DCA_EXSS_CORE = 0x010, + DCA_EXSS_XBR = 0x020, + DCA_EXSS_XXCH = 0x040, + DCA_EXSS_X96 = 0x080, + DCA_EXSS_LBR = 0x100, + DCA_EXSS_XLL = 0x200, + DCA_EXSS_RSV1 = 0x400, + DCA_EXSS_RSV2 = 0x800, + DCA_EXSS_MASK = 0xff0, +}; + +enum DCADownMixType { + DCA_DMIX_TYPE_1_0, + DCA_DMIX_TYPE_LoRo, + DCA_DMIX_TYPE_LtRt, + DCA_DMIX_TYPE_3_0, + DCA_DMIX_TYPE_2_1, + DCA_DMIX_TYPE_2_2, + DCA_DMIX_TYPE_3_1, + + DCA_DMIX_TYPE_COUNT +}; + +extern const uint32_t ff_dca_sample_rates[16]; +extern const uint32_t ff_dca_sampling_freqs[16]; +extern const uint8_t ff_dca_freq_ranges[16]; +extern const uint8_t ff_dca_bits_per_sample[8]; + + +/** + * Convert bitstream to one representation based on sync marker + */ +int avpriv_dca_convert_bitstream(const uint8_t *src, int src_size, uint8_t *dst, + int max_size); + +/** + * Parse and validate core frame header + * @param[out] h Pointer to struct where header info is written. + * @param[in] buf Pointer to the data buffer + * @param[in] size Size of the data buffer + * @return 0 on success, negative AVERROR code on failure + */ +int avpriv_dca_parse_core_frame_header(DCACoreFrameHeader *h, const uint8_t *buf, int size); + +/** + * Parse and validate core frame header + * @param[out] h Pointer to struct where header info is written. + * @param[in] gbc BitContext containing the first 120 bits of the frame. + * @return 0 on success, negative DCA_PARSE_ERROR_ code on failure + */ +int ff_dca_parse_core_frame_header(DCACoreFrameHeader *h, GetBitContext *gb); + +#endif /* AVCODEC_DCA_H */ diff --git a/include/libavcodec/dca_core.h b/include/libavcodec/dca_core.h new file mode 100644 index 0000000..347566d --- /dev/null +++ b/include/libavcodec/dca_core.h @@ -0,0 +1,257 @@ +/* + * Copyright (C) 2016 foo86 + * + * 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_DCA_CORE_H +#define AVCODEC_DCA_CORE_H + +#include "libavutil/float_dsp.h" +#include "libavutil/fixed_dsp.h" +#include "libavutil/mem_internal.h" +#include "libavutil/tx.h" + +#include "avcodec.h" +#include "get_bits.h" +#include "dca.h" +#include "dca_exss.h" +#include "dcadsp.h" +#include "dcadct.h" +#include "dcamath.h" +#include "dcahuff.h" +#include "synth_filter.h" + +#define DCA_CHANNELS 7 +#define DCA_SUBBANDS 32 +#define DCA_SUBBANDS_X96 64 +#define DCA_SUBFRAMES 16 +#define DCA_SUBBAND_SAMPLES 8 +#define DCA_PCMBLOCK_SAMPLES 32 +#define DCA_LFE_HISTORY 8 +#define DCA_ABITS_MAX 26 + +#define DCA_CORE_CHANNELS_MAX 6 +#define DCA_DMIX_CHANNELS_MAX 4 +#define DCA_XXCH_CHANNELS_MAX 2 +#define DCA_EXSS_CHANNELS_MAX 8 +#define DCA_EXSS_CHSETS_MAX 4 + +#define DCA_FILTER_MODE_X96 0x01 +#define DCA_FILTER_MODE_FIXED 0x02 + +enum DCACoreAudioMode { + DCA_AMODE_MONO, // Mode 0: A (mono) + DCA_AMODE_MONO_DUAL, // Mode 1: A + B (dual mono) + DCA_AMODE_STEREO, // Mode 2: L + R (stereo) + DCA_AMODE_STEREO_SUMDIFF, // Mode 3: (L+R) + (L-R) (sum-diff) + DCA_AMODE_STEREO_TOTAL, // Mode 4: LT + RT (left and right total) + DCA_AMODE_3F, // Mode 5: C + L + R + DCA_AMODE_2F1R, // Mode 6: L + R + S + DCA_AMODE_3F1R, // Mode 7: C + L + R + S + DCA_AMODE_2F2R, // Mode 8: L + R + SL + SR + DCA_AMODE_3F2R, // Mode 9: C + L + R + SL + SR + + DCA_AMODE_COUNT +}; + +enum DCACoreExtAudioType { + DCA_EXT_AUDIO_XCH = 0, + DCA_EXT_AUDIO_X96 = 2, + DCA_EXT_AUDIO_XXCH = 6 +}; + +enum DCACoreLFEFlag { + DCA_LFE_FLAG_NONE, + DCA_LFE_FLAG_128, + DCA_LFE_FLAG_64, + DCA_LFE_FLAG_INVALID +}; + +typedef struct DCADSPData { + union { + struct { + DECLARE_ALIGNED(32, float, hist1)[1024]; + DECLARE_ALIGNED(32, float, hist2)[64]; + } flt; + struct { + DECLARE_ALIGNED(32, int32_t, hist1)[1024]; + DECLARE_ALIGNED(32, int32_t, hist2)[64]; + } fix; + } u; + int offset; +} DCADSPData; + +typedef struct DCACoreDecoder { + AVCodecContext *avctx; + GetBitContext gb; + GetBitContext gb_in; + + // Bit stream header + int crc_present; ///< CRC present flag + int npcmblocks; ///< Number of PCM sample blocks + int frame_size; ///< Primary frame byte size + int audio_mode; ///< Audio channel arrangement + int sample_rate; ///< Core audio sampling frequency + int bit_rate; ///< Transmission bit rate + int drc_present; ///< Embedded dynamic range flag + int ts_present; ///< Embedded time stamp flag + int aux_present; ///< Auxiliary data flag + int ext_audio_type; ///< Extension audio descriptor flag + int ext_audio_present; ///< Extended coding flag + int sync_ssf; ///< Audio sync word insertion flag + int lfe_present; ///< Low frequency effects flag + int predictor_history; ///< Predictor history flag switch + int filter_perfect; ///< Multirate interpolator switch + int source_pcm_res; ///< Source PCM resolution + int es_format; ///< Extended surround (ES) mastering flag + int sumdiff_front; ///< Front sum/difference flag + int sumdiff_surround; ///< Surround sum/difference flag + + // Primary audio coding header + int nsubframes; ///< Number of subframes + int nchannels; ///< Number of primary audio channels (incl. extension channels) + int ch_mask; ///< Speaker layout mask (incl. LFE and extension channels) + int8_t nsubbands[DCA_CHANNELS]; ///< Subband activity count + int8_t subband_vq_start[DCA_CHANNELS]; ///< High frequency VQ start subband + int8_t joint_intensity_index[DCA_CHANNELS]; ///< Joint intensity coding index + int8_t transition_mode_sel[DCA_CHANNELS]; ///< Transient mode code book + int8_t scale_factor_sel[DCA_CHANNELS]; ///< Scale factor code book + int8_t bit_allocation_sel[DCA_CHANNELS]; ///< Bit allocation quantizer select + int8_t quant_index_sel[DCA_CHANNELS][DCA_CODE_BOOKS]; ///< Quantization index codebook select + int32_t scale_factor_adj[DCA_CHANNELS][DCA_CODE_BOOKS]; ///< Scale factor adjustment + + // Primary audio coding side information + int8_t nsubsubframes[DCA_SUBFRAMES]; ///< Subsubframe count for each subframe + int8_t prediction_mode[DCA_CHANNELS][DCA_SUBBANDS_X96]; ///< Prediction mode + int16_t prediction_vq_index[DCA_CHANNELS][DCA_SUBBANDS_X96]; ///< Prediction coefficients VQ address + int8_t bit_allocation[DCA_CHANNELS][DCA_SUBBANDS_X96]; ///< Bit allocation index + int8_t transition_mode[DCA_SUBFRAMES][DCA_CHANNELS][DCA_SUBBANDS]; ///< Transition mode + int32_t scale_factors[DCA_CHANNELS][DCA_SUBBANDS][2]; ///< Scale factors (2x for transients and X96) + int8_t joint_scale_sel[DCA_CHANNELS]; ///< Joint subband codebook select + int32_t joint_scale_factors[DCA_CHANNELS][DCA_SUBBANDS_X96]; ///< Scale factors for joint subband coding + + // Auxiliary data + int prim_dmix_embedded; ///< Auxiliary dynamic downmix flag + int prim_dmix_type; ///< Auxiliary primary channel downmix type + int prim_dmix_coeff[DCA_DMIX_CHANNELS_MAX * DCA_CORE_CHANNELS_MAX]; ///< Dynamic downmix code coefficients + + // Core extensions + int ext_audio_mask; ///< Bit mask of fully decoded core extensions + + // XCH extension data + int xch_pos; ///< Bit position of XCH frame in core substream + + // XXCH extension data + int xxch_crc_present; ///< CRC presence flag for XXCH channel set header + int xxch_mask_nbits; ///< Number of bits for loudspeaker mask + int xxch_core_mask; ///< Core loudspeaker activity mask + int xxch_spkr_mask; ///< Loudspeaker layout mask + int xxch_dmix_embedded; ///< Downmix already performed by encoder + int xxch_dmix_scale_inv; ///< Downmix scale factor + int xxch_dmix_mask[DCA_XXCH_CHANNELS_MAX]; ///< Downmix channel mapping mask + int xxch_dmix_coeff[DCA_XXCH_CHANNELS_MAX * DCA_CORE_CHANNELS_MAX]; ///< Downmix coefficients + int xxch_pos; ///< Bit position of XXCH frame in core substream + + // X96 extension data + int x96_rev_no; ///< X96 revision number + int x96_crc_present; ///< CRC presence flag for X96 channel set header + int x96_nchannels; ///< Number of primary channels in X96 extension + int x96_high_res; ///< X96 high resolution flag + int x96_subband_start; ///< First encoded subband in X96 extension + int x96_rand; ///< Random seed for generating samples for unallocated X96 subbands + int x96_pos; ///< Bit position of X96 frame in core substream + + // Sample buffers + unsigned int x96_subband_size; + int32_t *x96_subband_buffer; ///< X96 subband sample buffer base + int32_t *x96_subband_samples[DCA_CHANNELS][DCA_SUBBANDS_X96]; ///< X96 subband samples + + unsigned int subband_size; + int32_t *subband_buffer; ///< Subband sample buffer base + int32_t *subband_samples[DCA_CHANNELS][DCA_SUBBANDS]; ///< Subband samples + int32_t *lfe_samples; ///< Decimated LFE samples + + // DSP contexts + DCADSPData dcadsp_data[DCA_CHANNELS]; ///< FIR history buffers + DCADSPContext *dcadsp; + DCADCTContext dcadct; + AVTXContext *imdct[2]; + av_tx_fn imdct_fn[2]; + SynthFilterContext synth; + AVFloatDSPContext *float_dsp; + AVFixedDSPContext *fixed_dsp; + + // PCM output data + unsigned int output_size; + void *output_buffer; ///< PCM output buffer base + int32_t *output_samples[DCA_SPEAKER_COUNT]; ///< PCM output for fixed point mode + int32_t output_history_lfe_fixed; ///< LFE PCM history for X96 filter + float output_history_lfe_float; ///< LFE PCM history for X96 filter + + int ch_remap[DCA_SPEAKER_COUNT]; ///< Channel to speaker map + int request_mask; ///< Requested channel layout (for stereo downmix) + + int npcmsamples; ///< Number of PCM samples per channel + int output_rate; ///< Output sample rate (1x or 2x header rate) + + int filter_mode; ///< Previous filtering mode for detecting changes +} DCACoreDecoder; + +static inline int ff_dca_core_map_spkr(DCACoreDecoder *core, int spkr) +{ + if (core->ch_mask & (1U << spkr)) + return spkr; + if (spkr == DCA_SPEAKER_Lss && (core->ch_mask & DCA_SPEAKER_MASK_Ls)) + return DCA_SPEAKER_Ls; + if (spkr == DCA_SPEAKER_Rss && (core->ch_mask & DCA_SPEAKER_MASK_Rs)) + return DCA_SPEAKER_Rs; + return -1; +} + +static inline void ff_dca_core_dequantize(int32_t *output, const int32_t *input, + int32_t step_size, int32_t scale, int residual, int len) +{ + // Account for quantizer step size + int64_t step_scale = (int64_t)step_size * scale; + int n, shift = 0; + + // Limit scale factor resolution to 22 bits + if (step_scale > (1 << 23)) { + shift = av_log2(step_scale >> 23) + 1; + step_scale >>= shift; + } + + // Scale the samples + if (residual) { + for (n = 0; n < len; n++) + output[n] += clip23(norm__(input[n] * step_scale, 22 - shift)); + } else { + for (n = 0; n < len; n++) + output[n] = clip23(norm__(input[n] * step_scale, 22 - shift)); + } +} + +int ff_dca_core_parse(DCACoreDecoder *s, const uint8_t *data, int size); +int ff_dca_core_parse_exss(DCACoreDecoder *s, const uint8_t *data, DCAExssAsset *asset); +int ff_dca_core_filter_fixed(DCACoreDecoder *s, int x96_synth); +int ff_dca_core_filter_frame(DCACoreDecoder *s, AVFrame *frame); +av_cold void ff_dca_core_flush(DCACoreDecoder *s); +av_cold int ff_dca_core_init(DCACoreDecoder *s); +av_cold void ff_dca_core_close(DCACoreDecoder *s); + +#endif diff --git a/include/libavcodec/dca_exss.h b/include/libavcodec/dca_exss.h new file mode 100644 index 0000000..9e91b00 --- /dev/null +++ b/include/libavcodec/dca_exss.h @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2016 foo86 + * + * 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_DCA_EXSS_H +#define AVCODEC_DCA_EXSS_H + +#include + +#include "avcodec.h" +#include "get_bits.h" + +typedef struct DCAExssAsset { + int asset_offset; ///< Offset to asset data from start of substream + int asset_size; ///< Size of encoded asset data + int asset_index; ///< Audio asset identifier + + int pcm_bit_res; ///< PCM bit resolution + int max_sample_rate; ///< Maximum sample rate + int nchannels_total; ///< Total number of channels + int one_to_one_map_ch_to_spkr; ///< One to one channel to speaker mapping flag + int embedded_stereo; ///< Embedded stereo flag + int embedded_6ch; ///< Embedded 6 channels flag + int spkr_mask_enabled; ///< Speaker mask enabled flag + int spkr_mask; ///< Loudspeaker activity mask + int representation_type; ///< Representation type + + int coding_mode; ///< Coding mode for the asset + int extension_mask; ///< Coding components used in asset + + int core_offset; ///< Offset to core component from start of substream + int core_size; ///< Size of core component in extension substream + + int xbr_offset; ///< Offset to XBR extension from start of substream + int xbr_size; ///< Size of XBR extension in extension substream + + int xxch_offset; ///< Offset to XXCH extension from start of substream + int xxch_size; ///< Size of XXCH extension in extension substream + + int x96_offset; ///< Offset to X96 extension from start of substream + int x96_size; ///< Size of X96 extension in extension substream + + int lbr_offset; ///< Offset to LBR component from start of substream + int lbr_size; ///< Size of LBR component in extension substream + + int xll_offset; ///< Offset to XLL data from start of substream + int xll_size; ///< Size of XLL data in extension substream + int xll_sync_present; ///< XLL sync word present flag + int xll_delay_nframes; ///< Initial XLL decoding delay in frames + int xll_sync_offset; ///< Number of bytes offset to XLL sync + + int hd_stream_id; ///< DTS-HD stream ID +} DCAExssAsset; + +typedef struct DCAExssParser { + AVCodecContext *avctx; + GetBitContext gb; + + int exss_index; ///< Extension substream index + int exss_size_nbits; ///< Number of bits for extension substream size + int exss_size; ///< Number of bytes of extension substream + + int static_fields_present; ///< Per stream static fields presence flag + int npresents; ///< Number of defined audio presentations + int nassets; ///< Number of audio assets in extension substream + + int mix_metadata_enabled; ///< Mixing metadata enable flag + int nmixoutconfigs; ///< Number of mixing configurations + int nmixoutchs[4]; ///< Speaker layout mask for mixer output channels + + DCAExssAsset assets[1]; ///< Audio asset descriptors +} DCAExssParser; + +int ff_dca_exss_parse(DCAExssParser *s, const uint8_t *data, int size); + +#endif diff --git a/include/libavcodec/dca_lbr.h b/include/libavcodec/dca_lbr.h new file mode 100644 index 0000000..8ff66af --- /dev/null +++ b/include/libavcodec/dca_lbr.h @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2016 foo86 + * + * 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_DCA_LBR_H +#define AVCODEC_DCA_LBR_H + +#include "libavutil/float_dsp.h" +#include "libavutil/mem_internal.h" +#include "libavutil/tx.h" + +#include "avcodec.h" +#include "get_bits.h" +#include "dca.h" +#include "dca_exss.h" +#include "dcadsp.h" + +#define DCA_LBR_CHANNELS 6 +#define DCA_LBR_CHANNELS_TOTAL 32 +#define DCA_LBR_SUBBANDS 32 +#define DCA_LBR_TONES 512 + +#define DCA_LBR_TIME_SAMPLES 128 +#define DCA_LBR_TIME_HISTORY 8 + +enum DCALBRHeader { + DCA_LBR_HEADER_SYNC_ONLY = 1, + DCA_LBR_HEADER_DECODER_INIT = 2 +}; + +typedef struct DCALbrTone { + uint8_t x_freq; ///< Spectral line offset + uint8_t f_delt; ///< Difference between original and center frequency + uint8_t ph_rot; ///< Phase rotation + uint8_t pad; ///< Padding field + uint8_t amp[DCA_LBR_CHANNELS]; ///< Per-channel amplitude + uint8_t phs[DCA_LBR_CHANNELS]; ///< Per-channel phase +} DCALbrTone; + +typedef struct DCALbrDecoder { + AVCodecContext *avctx; + GetBitContext gb; + + int sample_rate; ///< Sample rate of LBR audio + int ch_mask; ///< LBR speaker mask + int flags; ///< Flags for LBR decoder initialization + int bit_rate_orig; ///< Original bit rate + int bit_rate_scaled; ///< Scaled bit rate + + int nchannels; ///< Number of fullband channels to decode + int nchannels_total; ///< Total number of fullband channels + int freq_range; ///< Frequency range of LBR audio + int band_limit; ///< Band limit factor + int limited_rate; ///< Band limited sample rate + int limited_range; ///< Band limited frequency range + int res_profile; ///< Resolution profile + int nsubbands; ///< Number of encoded subbands + int g3_avg_only_start_sb; ///< Subband index where grid 3 scale factors end + int min_mono_subband; ///< Subband index where mono encoding starts + int max_mono_subband; ///< Subband index where mono encoding ends + + int framenum; ///< Lower 5 bits of current frame number + int lbr_rand; ///< Seed for subband randomization + int warned; ///< Flags for warning suppression + + uint8_t quant_levels[DCA_LBR_CHANNELS / 2][DCA_LBR_SUBBANDS]; ///< Quantization levels + uint8_t sb_indices[DCA_LBR_SUBBANDS]; ///< Subband reordering indices + + uint8_t sec_ch_sbms[DCA_LBR_CHANNELS / 2][DCA_LBR_SUBBANDS]; ///< Right channel inversion or mid/side decoding flags + uint8_t sec_ch_lrms[DCA_LBR_CHANNELS / 2][DCA_LBR_SUBBANDS]; ///< Flags indicating if left/right channel are swapped + uint32_t ch_pres[DCA_LBR_CHANNELS]; ///< Subband allocation flags + + uint8_t grid_1_scf[DCA_LBR_CHANNELS][12][8]; ///< Grid 1 scale factors + uint8_t grid_2_scf[DCA_LBR_CHANNELS][3][64]; ///< Grid 2 scale factors + + int8_t grid_3_avg[DCA_LBR_CHANNELS][DCA_LBR_SUBBANDS - 4]; ///< Grid 3 average values + int8_t grid_3_scf[DCA_LBR_CHANNELS][DCA_LBR_SUBBANDS - 4][8]; ///< Grid 3 scale factors + uint32_t grid_3_pres[DCA_LBR_CHANNELS]; ///< Grid 3 scale factors presence flags + + uint8_t high_res_scf[DCA_LBR_CHANNELS][DCA_LBR_SUBBANDS][8]; ///< High-frequency resolution scale factors + + uint8_t part_stereo[DCA_LBR_CHANNELS][DCA_LBR_SUBBANDS / 4][5]; ///< Partial stereo coefficients + uint8_t part_stereo_pres; ///< Partial stereo coefficients presence flags + + float lpc_coeff[2][DCA_LBR_CHANNELS][3][2][8]; ///< Predictor coefficients + + float sb_scf[DCA_LBR_SUBBANDS]; ///< Subband randomization scale factors + + float *time_samples[DCA_LBR_CHANNELS][DCA_LBR_SUBBANDS]; ///< Time samples + + float *ts_buffer; ///< Time sample buffer base + unsigned int ts_size; ///< Time sample buffer size + + DECLARE_ALIGNED(32, float, history)[DCA_LBR_CHANNELS][DCA_LBR_SUBBANDS * 4]; ///< IMDCT history + DECLARE_ALIGNED(32, float, window)[DCA_LBR_SUBBANDS * 4]; ///< Long window for IMDCT + + DECLARE_ALIGNED(32, float, lfe_data)[64]; ///< Decimated LFE samples + DECLARE_ALIGNED(32, float, lfe_history)[5][2]; ///< LFE IIR filter history + float lfe_scale; ///< Scale factor of LFE samples before IIR filter + + uint8_t tonal_scf[6]; ///< Tonal scale factors + uint16_t tonal_bounds[5][32][2]; ///< Per-group per-subframe start/end positions of tones + DCALbrTone tones[DCA_LBR_TONES]; ///< Circular buffer of tones + int ntones; ///< Circular buffer head position + + AVTXContext *imdct; + av_tx_fn imdct_fn; + AVFloatDSPContext *fdsp; + DCADSPContext *dcadsp; +} DCALbrDecoder; + +int ff_dca_lbr_parse(DCALbrDecoder *s, const uint8_t *data, DCAExssAsset *asset); +int ff_dca_lbr_filter_frame(DCALbrDecoder *s, AVFrame *frame); +av_cold void ff_dca_lbr_flush(DCALbrDecoder *s); +av_cold void ff_dca_lbr_init_tables(void); +av_cold int ff_dca_lbr_init(DCALbrDecoder *s); +av_cold void ff_dca_lbr_close(DCALbrDecoder *s); + +#endif diff --git a/include/libavcodec/dca_sample_rate_tab.h b/include/libavcodec/dca_sample_rate_tab.h new file mode 100644 index 0000000..93d9a13 --- /dev/null +++ b/include/libavcodec/dca_sample_rate_tab.h @@ -0,0 +1,33 @@ +/* + * DCA sample rates + * Copyright (C) 2004 Gildas Bazin + * Copyright (C) 2004 Benjamin Zores + * Copyright (C) 2006 Benjamin Larssonb + * Copyright (C) 2007 Konstantin Shishkov + * + * 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_DCA_SAMPLE_RATE_TAB_H +#define AVCODEC_DCA_SAMPLE_RATE_TAB_H +#include + +const uint32_t ff_dca_sample_rates[16] = { + 0, 8000, 16000, 32000, 0, 0, 11025, 22050, 44100, 0, 0, + 12000, 24000, 48000, 96000, 192000 +}; +#endif diff --git a/include/libavcodec/dca_syncwords.h b/include/libavcodec/dca_syncwords.h new file mode 100644 index 0000000..649bbd9 --- /dev/null +++ b/include/libavcodec/dca_syncwords.h @@ -0,0 +1,39 @@ +/* + * 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_DCA_SYNCWORDS_H +#define AVCODEC_DCA_SYNCWORDS_H + +#define DCA_SYNCWORD_CORE_BE 0x7FFE8001U +#define DCA_SYNCWORD_CORE_LE 0xFE7F0180U +#define DCA_SYNCWORD_CORE_14B_BE 0x1FFFE800U +#define DCA_SYNCWORD_CORE_14B_LE 0xFF1F00E8U +#define DCA_SYNCWORD_XCH 0x5A5A5A5AU +#define DCA_SYNCWORD_XXCH 0x47004A03U +#define DCA_SYNCWORD_X96 0x1D95F262U +#define DCA_SYNCWORD_XBR 0x655E315EU +#define DCA_SYNCWORD_LBR 0x0A801921U +#define DCA_SYNCWORD_XLL 0x41A29547U +#define DCA_SYNCWORD_SUBSTREAM 0x64582025U +#define DCA_SYNCWORD_SUBSTREAM_CORE 0x02B09261U +#define DCA_SYNCWORD_REV1AUX 0x9A1105A0U + +#define DCA_SYNCWORD_XLL_X 0x02000850U +#define DCA_SYNCWORD_XLL_X_IMAX 0xF14000D0U + +#endif /* AVCODEC_DCA_SYNCWORDS_H */ diff --git a/include/libavcodec/dca_xll.h b/include/libavcodec/dca_xll.h new file mode 100644 index 0000000..a22bbb8 --- /dev/null +++ b/include/libavcodec/dca_xll.h @@ -0,0 +1,150 @@ +/* + * Copyright (C) 2016 foo86 + * + * 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_DCA_XLL_H +#define AVCODEC_DCA_XLL_H + +#include "libavutil/mem_internal.h" + +#include "avcodec.h" +#include "get_bits.h" +#include "dca.h" +#include "dcadsp.h" +#include "dca_exss.h" + +#define DCA_XLL_CHSETS_MAX 3 +#define DCA_XLL_CHANNELS_MAX 8 +#define DCA_XLL_BANDS_MAX 2 +#define DCA_XLL_ADAPT_PRED_ORDER_MAX 16 +#define DCA_XLL_DECI_HISTORY_MAX 8 +#define DCA_XLL_DMIX_SCALES_MAX ((DCA_XLL_CHSETS_MAX - 1) * DCA_XLL_CHANNELS_MAX) +#define DCA_XLL_DMIX_COEFFS_MAX (DCA_XLL_DMIX_SCALES_MAX * DCA_XLL_CHANNELS_MAX) +#define DCA_XLL_PBR_BUFFER_MAX (240 << 10) +#define DCA_XLL_SAMPLE_BUFFERS_MAX 3 + +typedef struct DCAXllBand { + int decor_enabled; ///< Pairwise channel decorrelation flag + int orig_order[DCA_XLL_CHANNELS_MAX]; ///< Original channel order + int decor_coeff[DCA_XLL_CHANNELS_MAX / 2]; ///< Pairwise channel coefficients + + int adapt_pred_order[DCA_XLL_CHANNELS_MAX]; ///< Adaptive predictor order + int highest_pred_order; ///< Highest adaptive predictor order + int fixed_pred_order[DCA_XLL_CHANNELS_MAX]; ///< Fixed predictor order + int adapt_refl_coeff[DCA_XLL_CHANNELS_MAX][DCA_XLL_ADAPT_PRED_ORDER_MAX]; ///< Adaptive predictor reflection coefficients + + int dmix_embedded; ///< Downmix performed by encoder in frequency band + + int lsb_section_size; ///< Size of LSB section in any segment + int nscalablelsbs[DCA_XLL_CHANNELS_MAX]; ///< Number of bits to represent the samples in LSB part + int bit_width_adjust[DCA_XLL_CHANNELS_MAX]; ///< Number of bits discarded by authoring + + int32_t *msb_sample_buffer[DCA_XLL_CHANNELS_MAX]; ///< MSB sample buffer pointers + int32_t *lsb_sample_buffer[DCA_XLL_CHANNELS_MAX]; ///< LSB sample buffer pointers or NULL +} DCAXllBand; + +typedef struct DCAXllChSet { + // Channel set header + int nchannels; ///< Number of channels in the channel set (N) + int residual_encode; ///< Residual encoding mask (0 - residual, 1 - full channel) + int pcm_bit_res; ///< PCM bit resolution (variable) + int storage_bit_res; ///< Storage bit resolution (16 or 24) + int freq; ///< Original sampling frequency (max. 96000 Hz) + + int primary_chset; ///< Primary channel set flag + int dmix_coeffs_present; ///< Downmix coefficients present in stream + int dmix_embedded; ///< Downmix already performed by encoder + int dmix_type; ///< Primary channel set downmix type + int hier_chset; ///< Whether the channel set is part of a hierarchy + int hier_ofs; ///< Number of preceding channels in a hierarchy (M) + int dmix_coeff[DCA_XLL_DMIX_COEFFS_MAX]; ///< Downmixing coefficients + int dmix_scale[DCA_XLL_DMIX_SCALES_MAX]; ///< Downmixing scales + int dmix_scale_inv[DCA_XLL_DMIX_SCALES_MAX]; ///< Inverse downmixing scales + int ch_mask; ///< Channel mask for set + int ch_remap[DCA_XLL_CHANNELS_MAX]; ///< Channel to speaker map + + int nfreqbands; ///< Number of frequency bands (1 or 2) + int nabits; ///< Number of bits to read bit allocation coding parameter + + DCAXllBand bands[DCA_XLL_BANDS_MAX]; ///< Frequency bands + + // Frequency band coding parameters + int seg_common; ///< Segment type + int rice_code_flag[DCA_XLL_CHANNELS_MAX]; ///< Rice coding flag + int bitalloc_hybrid_linear[DCA_XLL_CHANNELS_MAX]; ///< Binary code length for isolated samples + int bitalloc_part_a[DCA_XLL_CHANNELS_MAX]; ///< Coding parameter for part A of segment + int bitalloc_part_b[DCA_XLL_CHANNELS_MAX]; ///< Coding parameter for part B of segment + int nsamples_part_a[DCA_XLL_CHANNELS_MAX]; ///< Number of samples in part A of segment + + // Decimator history + DECLARE_ALIGNED(32, int32_t, deci_history)[DCA_XLL_CHANNELS_MAX][DCA_XLL_DECI_HISTORY_MAX]; ///< Decimator history for frequency band 1 + + // Sample buffers + unsigned int sample_size[DCA_XLL_SAMPLE_BUFFERS_MAX]; + int32_t *sample_buffer[DCA_XLL_SAMPLE_BUFFERS_MAX]; +} DCAXllChSet; + +typedef struct DCAXllDecoder { + AVCodecContext *avctx; + GetBitContext gb; + + int frame_size; ///< Number of bytes in a lossless frame + int nchsets; ///< Number of channels sets per frame + int nframesegs; ///< Number of segments per frame + int nsegsamples_log2; ///< log2(nsegsamples) + int nsegsamples; ///< Samples in segment per one frequency band + int nframesamples_log2; ///< log2(nframesamples) + int nframesamples; ///< Samples in frame per one frequency band + int seg_size_nbits; ///< Number of bits used to read segment size + int band_crc_present; ///< Presence of CRC16 within each frequency band + int scalable_lsbs; ///< MSB/LSB split flag + int ch_mask_nbits; ///< Number of bits used to read channel mask + int fixed_lsb_width; ///< Fixed LSB width + + DCAXllChSet chset[DCA_XLL_CHSETS_MAX]; ///< Channel sets + + int *navi; ///< NAVI table + unsigned int navi_size; + + int nfreqbands; ///< Highest number of frequency bands + int nchannels; ///< Total number of channels in a hierarchy + int nreschsets; ///< Number of channel sets that have residual encoded channels + int nactivechsets; ///< Number of active channel sets to decode + + int hd_stream_id; ///< Previous DTS-HD stream ID for detecting changes + + uint8_t *pbr_buffer; ///< Peak bit rate (PBR) smoothing buffer + int pbr_length; ///< Length in bytes of data currently buffered + int pbr_delay; ///< Delay in frames before decoding buffered data + + DCADSPContext *dcadsp; + + int x_syncword_present; ///< Syncword for extension data at end of frame (DTS:X) is present + int x_imax_syncword_present; ///< Syncword for extension data at end of frame (DTS:X IMAX) is present + + int output_mask; + int32_t *output_samples[DCA_SPEAKER_COUNT]; +} DCAXllDecoder; + +int ff_dca_xll_parse(DCAXllDecoder *s, const uint8_t *data, DCAExssAsset *asset); +int ff_dca_xll_filter_frame(DCAXllDecoder *s, AVFrame *frame); +av_cold void ff_dca_xll_flush(DCAXllDecoder *s); +av_cold void ff_dca_xll_close(DCAXllDecoder *s); + +#endif diff --git a/include/libavcodec/dcaadpcm.h b/include/libavcodec/dcaadpcm.h new file mode 100644 index 0000000..23bfa79 --- /dev/null +++ b/include/libavcodec/dcaadpcm.h @@ -0,0 +1,54 @@ +/* + * DCA ADPCM engine + * Copyright (C) 2017 Daniil Cherednik + * + * 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_DCAADPCM_H +#define AVCODEC_DCAADPCM_H + +#include "dcamath.h" +#include "dcadata.h" +#include "dcaenc.h" + +typedef struct DCAADPCMEncContext { + void *private_data; +} DCAADPCMEncContext; + +static inline int64_t ff_dcaadpcm_predict(int pred_vq_index, const int32_t *input) +{ + int i; + const int16_t *coeff = ff_dca_adpcm_vb[pred_vq_index]; + int64_t pred = 0; + for (i = 0; i < DCA_ADPCM_COEFFS; i++) + pred += (int64_t)input[DCA_ADPCM_COEFFS - 1 - i] * coeff[i]; + + return clip23(norm13(pred)); +} + +int ff_dcaadpcm_subband_analysis(const DCAADPCMEncContext *s, const int32_t *input, int len, int *diff); + +int ff_dcaadpcm_do_real(int pred_vq_index, + softfloat quant, int32_t scale_factor, int32_t step_size, + const int32_t *prev_hist, const int32_t *in, int32_t *next_hist, int32_t *out, + int len, int32_t peak); + +av_cold int ff_dcaadpcm_init(DCAADPCMEncContext *s); +av_cold void ff_dcaadpcm_free(DCAADPCMEncContext *s); + +#endif /* AVCODEC_DCAADPCM_H */ diff --git a/include/libavcodec/dcadata.h b/include/libavcodec/dcadata.h new file mode 100644 index 0000000..5aa85b3 --- /dev/null +++ b/include/libavcodec/dcadata.h @@ -0,0 +1,127 @@ +/* + * DCA compatible decoder data + * + * 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_DCADATA_H +#define AVCODEC_DCADATA_H + +#include + +#include "dcahuff.h" + +#define DCA_ADPCM_COEFFS 4 +#define DCA_ADPCM_VQCODEBOOK_SZ 4096 + +extern const uint32_t ff_dca_bit_rates[32]; + +extern const uint8_t ff_dca_channels[16]; + +extern const uint8_t ff_dca_dmix_primary_nch[8]; + +extern const uint8_t ff_dca_quant_index_sel_nbits[DCA_CODE_BOOKS]; +extern const uint8_t ff_dca_quant_index_group_size[DCA_CODE_BOOKS]; + +extern const int16_t ff_dca_adpcm_vb[DCA_ADPCM_VQCODEBOOK_SZ][DCA_ADPCM_COEFFS]; + +extern const uint32_t ff_dca_scale_factor_quant6[64]; +extern const uint32_t ff_dca_scale_factor_quant7[128]; + +extern const uint32_t ff_dca_joint_scale_factors[129]; + +extern const uint32_t ff_dca_scale_factor_adj[4]; + +extern const uint32_t ff_dca_quant_levels[32]; + +extern const uint32_t ff_dca_lossy_quant[32]; + +extern const uint32_t ff_dca_lossless_quant[32]; + +extern const int8_t ff_dca_high_freq_vq[1024][32]; + +extern const float ff_dca_fir_32bands_perfect[512]; +extern const float ff_dca_fir_32bands_nonperfect[512]; + +extern const float ff_dca_lfe_fir_64[256]; +extern const float ff_dca_lfe_fir_128[256]; +extern const float ff_dca_fir_64bands[1024]; + +extern const int32_t ff_dca_fir_32bands_perfect_fixed[512]; +extern const int32_t ff_dca_fir_32bands_nonperfect_fixed[512]; +extern const int32_t ff_dca_lfe_fir_64_fixed[256]; +extern const int32_t ff_dca_fir_64bands_fixed[1024]; + +#define FF_DCA_DMIXTABLE_SIZE 242U +#define FF_DCA_INV_DMIXTABLE_SIZE 201U +#define FF_DCA_DMIXTABLE_OFFSET (FF_DCA_DMIXTABLE_SIZE - FF_DCA_INV_DMIXTABLE_SIZE) + +extern const uint16_t ff_dca_dmixtable[FF_DCA_DMIXTABLE_SIZE]; +extern const uint32_t ff_dca_inv_dmixtable[FF_DCA_INV_DMIXTABLE_SIZE]; + +extern const uint16_t ff_dca_xll_refl_coeff[128]; + +extern const int32_t ff_dca_xll_band_coeff[20]; + +extern const uint16_t ff_dca_avg_g3_freqs[3]; + +extern const uint16_t ff_dca_fst_amp[44]; + +extern const uint8_t ff_dca_freq_to_sb[32]; + +extern const int8_t ff_dca_ph0_shift[8]; + +extern const uint8_t ff_dca_grid_1_to_scf[11]; +extern const uint8_t ff_dca_grid_2_to_scf[3]; + +extern const uint8_t ff_dca_scf_to_grid_1[32]; +extern const uint8_t ff_dca_scf_to_grid_2[32]; + +extern const uint8_t ff_dca_grid_1_weights[12][32]; + +extern const uint8_t ff_dca_sb_reorder[8][8]; + +extern const int8_t ff_dca_lfe_delta_index_16[8]; +extern const int8_t ff_dca_lfe_delta_index_24[32]; + +extern const uint16_t ff_dca_rsd_pack_5_in_8[256]; +extern const uint8_t ff_dca_rsd_pack_3_in_7[128][3]; + +extern const float ff_dca_rsd_level_2a[2]; +extern const float ff_dca_rsd_level_2b[2]; +extern const float ff_dca_rsd_level_3[3]; +extern const float ff_dca_rsd_level_5[5]; +extern const float ff_dca_rsd_level_8[8]; +extern const float ff_dca_rsd_level_16[16]; + +extern const float ff_dca_synth_env[32]; + +extern const float ff_dca_corr_cf[32][11]; + +extern const float ff_dca_quant_amp[57]; + +extern const float ff_dca_st_coeff[34]; + +extern const float ff_dca_long_window[128]; + +extern const float ff_dca_lfe_step_size_16[101]; +extern const float ff_dca_lfe_step_size_24[144]; + +extern const float ff_dca_bank_coeff[10]; +extern const float ff_dca_lfe_iir[5][4]; + +#endif /* AVCODEC_DCADATA_H */ diff --git a/include/libavcodec/dcadct.h b/include/libavcodec/dcadct.h new file mode 100644 index 0000000..2ef60c1 --- /dev/null +++ b/include/libavcodec/dcadct.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2016 foo86 + * + * 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_DCADCT_H +#define AVCODEC_DCADCT_H + +#include +#include "libavutil/attributes.h" + +typedef struct DCADCTContext { + void (*imdct_half[2])(int32_t *output, const int32_t *input); +} DCADCTContext; + +av_cold void ff_dcadct_init(DCADCTContext *c); + +#endif diff --git a/include/libavcodec/dcadec.h b/include/libavcodec/dcadec.h new file mode 100644 index 0000000..0ff28dd --- /dev/null +++ b/include/libavcodec/dcadec.h @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2016 foo86 + * + * 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_DCADEC_H +#define AVCODEC_DCADEC_H + +#include + +#include "libavutil/crc.h" +#include "libavutil/float_dsp.h" +#include "libavutil/log.h" + +#include "avcodec.h" +#include "get_bits.h" +#include "dca.h" +#include "dcadsp.h" +#include "dca_core.h" +#include "dca_exss.h" +#include "dca_xll.h" +#include "dca_lbr.h" + +#define DCA_PACKET_CORE 0x01 +#define DCA_PACKET_EXSS 0x02 +#define DCA_PACKET_XLL 0x04 +#define DCA_PACKET_LBR 0x08 +#define DCA_PACKET_MASK 0x0f + +#define DCA_PACKET_RECOVERY 0x10 ///< Sync error recovery flag +#define DCA_PACKET_RESIDUAL 0x20 ///< Core valid for residual decoding + +enum DCAOutputChannelOrder { + CHANNEL_ORDER_DEFAULT, + CHANNEL_ORDER_CODED, +}; + +typedef struct DCAContext { + const AVClass *class; ///< class for AVOptions + AVCodecContext *avctx; + + DCACoreDecoder core; ///< Core decoder context + DCAExssParser exss; ///< EXSS parser context + DCAXllDecoder xll; ///< XLL decoder context + DCALbrDecoder lbr; ///< LBR decoder context + + DCADSPContext dcadsp; + + const AVCRC *crctab; + + uint8_t *buffer; ///< Packet buffer + unsigned int buffer_size; + + int packet; ///< Packet flags + + int request_channel_layout; ///< Converted from avctx.request_channel_layout + int core_only; ///< Core only decoding flag + int output_channel_order; + AVChannelLayout downmix_layout; +} DCAContext; + +int ff_dca_set_channel_layout(AVCodecContext *avctx, int *ch_remap, int dca_mask); + +void ff_dca_downmix_to_stereo_fixed(DCADSPContext *dcadsp, int32_t **samples, + int *coeff_l, int nsamples, int ch_mask); +void ff_dca_downmix_to_stereo_float(AVFloatDSPContext *fdsp, float **samples, + int *coeff_l, int nsamples, int ch_mask); + +static inline int ff_dca_check_crc(AVCodecContext *avctx, GetBitContext *s, + int p1, int p2) +{ + DCAContext *dca = avctx->priv_data; + + if (!(avctx->err_recognition & (AV_EF_CRCCHECK | AV_EF_CAREFUL))) + return 0; + if (((p1 | p2) & 7) || p1 < 0 || p2 > s->size_in_bits || p2 - p1 < 16) + return -1; + if (av_crc(dca->crctab, 0xffff, s->buffer + p1 / 8, (p2 - p1) / 8)) + return -1; + return 0; +} + +static inline int ff_dca_seek_bits(GetBitContext *s, int p) +{ + if (p < get_bits_count(s) || p > s->size_in_bits) + return -1; + skip_bits_long(s, p - get_bits_count(s)); + return 0; +} + +#endif diff --git a/include/libavcodec/dcadsp.h b/include/libavcodec/dcadsp.h new file mode 100644 index 0000000..c297552 --- /dev/null +++ b/include/libavcodec/dcadsp.h @@ -0,0 +1,100 @@ +/* + * Copyright (C) 2016 foo86 + * + * 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_DCADSP_H +#define AVCODEC_DCADSP_H + +#include "libavutil/common.h" +#include "libavutil/tx.h" + +#include "dcadct.h" +#include "synth_filter.h" + +typedef struct DCADSPContext { + void (*decode_hf)(int32_t **dst, + const int32_t *vq_index, + const int8_t hf_vq[1024][32], + int32_t scale_factors[32][2], + ptrdiff_t sb_start, ptrdiff_t sb_end, + ptrdiff_t ofs, ptrdiff_t len); + + void (*decode_joint)(int32_t **dst, int32_t **src, + const int32_t *scale_factors, + ptrdiff_t sb_start, ptrdiff_t sb_end, + ptrdiff_t ofs, ptrdiff_t len); + + void (*lfe_fir_float[2])(float *pcm_samples, int32_t *lfe_samples, + const float *filter_coeff, ptrdiff_t npcmblocks); + + void (*lfe_x96_float)(float *dst, const float *src, + float *hist, ptrdiff_t len); + + void (*sub_qmf_float[2])(SynthFilterContext *synth, + AVTXContext *imdct, + av_tx_fn imdct_fn, + float *pcm_samples, + int32_t **subband_samples_lo, + int32_t **subband_samples_hi, + float *hist1, int *offset, float *hist2, + const float *filter_coeff, ptrdiff_t npcmblocks, + float scale); + + void (*lfe_fir_fixed)(int32_t *pcm_samples, int32_t *lfe_samples, + const int32_t *filter_coeff, ptrdiff_t npcmblocks); + + void (*lfe_x96_fixed)(int32_t *dst, const int32_t *src, + int32_t *hist, ptrdiff_t len); + + void (*sub_qmf_fixed[2])(SynthFilterContext *synth, + DCADCTContext *imdct, + int32_t *pcm_samples, + int32_t **subband_samples_lo, + int32_t **subband_samples_hi, + int32_t *hist1, int *offset, int32_t *hist2, + const int32_t *filter_coeff, ptrdiff_t npcmblocks); + + void (*decor)(int32_t *dst, const int32_t *src, int coeff, ptrdiff_t len); + + void (*dmix_sub_xch)(int32_t *dst1, int32_t *dst2, + const int32_t *src, ptrdiff_t len); + + void (*dmix_sub)(int32_t *dst, const int32_t *src, int coeff, ptrdiff_t len); + + void (*dmix_add)(int32_t *dst, const int32_t *src, int coeff, ptrdiff_t len); + + void (*dmix_scale)(int32_t *dst, int scale, ptrdiff_t len); + + void (*dmix_scale_inv)(int32_t *dst, int scale_inv, ptrdiff_t len); + + void (*assemble_freq_bands)(int32_t *dst, int32_t *src0, int32_t *src1, + const int32_t *coeff, ptrdiff_t len); + + void (*lbr_bank)(float output[32][4], float **input, + const float *coeff, ptrdiff_t ofs, ptrdiff_t len); + + void (*lfe_iir)(float *output, const float *input, + const float iir[5][4], float hist[5][2], + ptrdiff_t factor); +} DCADSPContext; + +av_cold void ff_dcadsp_init(DCADSPContext *s); +av_cold void ff_dcadsp_init_x86(DCADSPContext *s); + +#endif diff --git a/include/libavcodec/dcaenc.h b/include/libavcodec/dcaenc.h new file mode 100644 index 0000000..63fdaf0 --- /dev/null +++ b/include/libavcodec/dcaenc.h @@ -0,0 +1,158 @@ +/* + * DCA encoder tables + * Copyright (C) 2008-2012 Alexander E. Patrakov + * + * 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_DCAENC_H +#define AVCODEC_DCAENC_H + +#include + +#include "dcamath.h" + +typedef struct { + int32_t m; + int32_t e; +} softfloat; + +static const int sample_rates[] = { + 8000, 16000, 32000, 11025, 22050, 44100, 12000, 24000, 48000, 0, +}; + +static const uint8_t bitstream_sfreq[] = { 1, 2, 3, 6, 7, 8, 11, 12, 13 }; + +/* Auditory filter center frequencies and bandwidths, in Hz. + * The last two are made up, because there is no scientific data. + */ +static const uint16_t fc[] = { + 50, 150, 250, 350, 450, 570, 700, 840, 1000, 1170, 1370, 1600, 1850, 2150, + 2500, 2900, 3400, 4000, 4800, 5800, 7000, 8500, 10500, 13500, 17000 +}; + +static const uint16_t erb[] = { + 80, 100, 100, 100, 110, 120, 140, 150, 160, 190, 210, 240, 280, + 320, 380, 450, 550, 700, 900, 1100, 1300, 1800, 2500, 3500, 4500 +}; + +static const softfloat stepsize_inv[27] = { + {0, 0}, {1342177360, 21}, {2147483647, 21}, {1342177360, 20}, + {1819901661, 20}, {2147483647, 20}, {1278263843, 19}, {1579032492, 19}, + {1412817763, 18}, {1220162327, 17}, {1118482133, 16}, {1917391412, 16}, + {1766017772, 15}, {1525212826, 14}, {1290553940, 13}, {2097179000, 13}, + {1677683200, 12}, {1497972244, 11}, {1310893147, 10}, {1165354136, 9}, + {1748031204, 9}, {1542092044, 8}, {1636178017, 7}, {1636178017, 6}, + {1636178017, 5}, {1636178017, 4}, {1636178017, 3}, +}; + +static const softfloat scalefactor_inv[128] = { + {2147483647, 1}, {2147483647, 1}, {2147483647, 2}, {2147483647, 2}, + {2147483647, 2}, {2147483647, 2}, {1431655765, 2}, {1431655765, 2}, + {1431655765, 2}, {2147483647, 3}, {2147483647, 3}, {1717986918, 3}, + {1431655765, 3}, {1227133513, 3}, {1227133513, 3}, {2147483647, 4}, + {1717986918, 4}, {1561806289, 4}, {1431655765, 4}, {1227133513, 4}, + {2147483647, 5}, {1908874353, 5}, {1717986918, 5}, {1493901668, 5}, + {1321528398, 5}, {1145324612, 5}, {2021161080, 6}, {1808407282, 6}, + {1561806289, 6}, {1374389534, 6}, {1227133513, 6}, {2147483647, 7}, + {1908874353, 7}, {1676084798, 7}, {1477838209, 7}, {1296593900, 7}, + {1145324612, 7}, {2021161080, 8}, {1773405851, 8}, {1561806289, 8}, + {1374389534, 8}, {1216273924, 8}, {2139127680, 9}, {1882725390, 9}, + {1660893697, 9}, {1462116526, 9}, {1287484341, 9}, {1135859119, 9}, + {1999112050, 10}, {1762037865, 10}, {1552982525, 10}, {1367551775, 10}, + {1205604855, 10}, {2124660150, 11}, {1871509153, 11}, {1648443220, 11}, + {1452459217, 11}, {1279990253, 11}, {1127704233, 11}, {1987368509, 12}, + {1750814693, 12}, {1542632939, 12}, {1359099663, 12}, {1197398995, 12}, + {2109880792, 13}, {1858853132, 13}, {1638006149, 13}, {1443165385, 13}, + {1271479187, 13}, {1120235993, 13}, {1973767086, 14}, {1739045674, 14}, + {1532153461, 14}, {1349922194, 14}, {1189384493, 14}, {2095804865, 15}, + {1846464029, 15}, {1626872524, 15}, {1433347133, 15}, {1262853884, 15}, + {1112619678, 15}, {1960569045, 16}, {1727349015, 16}, {1521881227, 16}, + {1340842289, 16}, {1181357555, 16}, {2081669156, 17}, {1834047752, 17}, + {1615889229, 17}, {1423675973, 17}, {1254322457, 17}, {1105123583, 17}, + {1947330755, 18}, {1715693602, 18}, {1511607799, 18}, {1331801790, 18}, + {1173384427, 18}, {2067616532, 19}, {1821667648, 19}, {1604980024, 19}, + {1414066955, 19}, {1245861410, 19}, {1097665748, 19}, {1934193616, 20}, + {1704119624, 20}, {1501412075, 20}, {1322817107, 20}, {1165466323, 20}, + {2053666205, 21}, {1809379407, 21}, {1594151671, 21}, {1404526328, 21}, + {1237455941, 21}, {1090259329, 21}, {1921143210, 22}, {1692621231, 22}, + {1491281857, 22}, {1313892269, 22}, {1157603482, 22}, {2039810470, 23}, + {1797172644, 23}, {1583396912, 23}, {1395050052, 23}, {1229107276, 23}, + {1082903494, 23}, {1082903494, 23}, {1082903494, 23}, {1082903494, 23}, +}; + +/* manually derived from + * Table B.5: Selection of quantization levels and codebooks + */ +static const int bit_consumption[27] = { + -8, 28, 40, 48, 52, 60, 68, 76, 80, 96, + 112, 128, 144, 160, 176, 192, 208, 224, 240, 256, + 272, 288, 304, 320, 336, 352, 368, +}; + +static const int8_t lfe_index[16] = { + 1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 2, 3, 1, 3, 2, 3 +}; + +static const int8_t channel_reorder_lfe[16][9] = { + { 0, -1, -1, -1, -1, -1, -1, -1, -1 }, + { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, + { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, + { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, + { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, + { 2, 0, 1, -1, -1, -1, -1, -1, -1 }, + { 0, 1, 3, -1, -1, -1, -1, -1, -1 }, + { 2, 0, 1, 4, -1, -1, -1, -1, -1 }, + { 0, 1, 3, 4, -1, -1, -1, -1, -1 }, + { 2, 0, 1, 4, 5, -1, -1, -1, -1 }, + { 3, 4, 0, 1, 5, 6, -1, -1, -1 }, + { 2, 0, 1, 4, 5, 6, -1, -1, -1 }, + { 0, 6, 4, 5, 2, 3, -1, -1, -1 }, + { 4, 2, 5, 0, 1, 6, 7, -1, -1 }, + { 5, 6, 0, 1, 7, 3, 8, 4, -1 }, + { 4, 2, 5, 0, 1, 6, 8, 7, -1 }, +}; + +static const int8_t channel_reorder_nolfe[16][9] = { + { 0, -1, -1, -1, -1, -1, -1, -1, -1 }, + { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, + { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, + { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, + { 0, 1, -1, -1, -1, -1, -1, -1, -1 }, + { 2, 0, 1, -1, -1, -1, -1, -1, -1 }, + { 0, 1, 2, -1, -1, -1, -1, -1, -1 }, + { 2, 0, 1, 3, -1, -1, -1, -1, -1 }, + { 0, 1, 2, 3, -1, -1, -1, -1, -1 }, + { 2, 0, 1, 3, 4, -1, -1, -1, -1 }, + { 2, 3, 0, 1, 4, 5, -1, -1, -1 }, + { 2, 0, 1, 3, 4, 5, -1, -1, -1 }, + { 0, 5, 3, 4, 1, 2, -1, -1, -1 }, + { 3, 2, 4, 0, 1, 5, 6, -1, -1 }, + { 4, 5, 0, 1, 6, 2, 7, 3, -1 }, + { 3, 2, 4, 0, 1, 5, 7, 6, -1 }, +}; + +static inline int32_t quantize_value(int32_t value, softfloat quant) +{ + int32_t offset = 1 << (quant.e - 1); + + value = mul32(value, quant.m) + offset; + value = value >> quant.e; + return value; +} + +#endif /* AVCODEC_DCAENC_H */ diff --git a/include/libavcodec/dcahuff.h b/include/libavcodec/dcahuff.h new file mode 100644 index 0000000..fdfe7e9 --- /dev/null +++ b/include/libavcodec/dcahuff.h @@ -0,0 +1,75 @@ +/* + * DCA compatible decoder - huffman tables + * Copyright (C) 2004 Gildas Bazin + * Copyright (C) 2007 Konstantin Shishkov + * + * 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_DCAHUFF_H +#define AVCODEC_DCAHUFF_H + +#include + +#include "libavutil/attributes.h" + +#include "vlc.h" + +#define DCA_CODE_BOOKS 10 +#define DCA_BITALLOC_12_COUNT 5 +#define DCA_NUM_BITALLOC_CODES (1 * 3 + \ + 3 * (5 + 7 + 9 + 13) \ + + 7 * (17 + 25 + 33 + 65 + 129)) + +extern VLC ff_dca_vlc_bit_allocation[5]; +#define DCA_TMODE_VLC_BITS 3 +extern VLC ff_dca_vlc_transition_mode[4]; +#define DCA_SCALES_VLC_BITS 9 +extern VLC ff_dca_vlc_scale_factor[5]; +extern VLC ff_dca_vlc_quant_index[DCA_CODE_BOOKS][7]; + +#define DCA_TNL_GRP_VLC_BITS 9 +extern VLC ff_dca_vlc_tnl_grp[5]; +#define DCA_TNL_SCF_VLC_BITS 9 +extern VLC ff_dca_vlc_tnl_scf; +#define DCA_DAMP_VLC_BITS 6 +extern VLC ff_dca_vlc_damp; +#define DCA_DPH_VLC_BITS 6 +extern VLC ff_dca_vlc_dph; +#define DCA_FST_RSD_VLC_BITS 9 +extern VLC ff_dca_vlc_fst_rsd_amp; +#define DCA_RSD_APPRX_VLC_BITS 5 +extern VLC ff_dca_vlc_rsd_apprx; +#define DCA_RSD_AMP_VLC_BITS 9 +extern VLC ff_dca_vlc_rsd_amp; +#define DCA_AVG_G3_VLC_BITS 9 +extern VLC ff_dca_vlc_avg_g3; +#define DCA_ST_GRID_VLC_BITS 9 +extern VLC ff_dca_vlc_st_grid; +#define DCA_GRID_VLC_BITS 9 +extern VLC ff_dca_vlc_grid_2; +extern VLC ff_dca_vlc_grid_3; +#define DCA_RSD_VLC_BITS 6 +extern VLC ff_dca_vlc_rsd; + +extern const int8_t ff_dca_bitalloc_offsets[DCA_CODE_BOOKS]; +extern const uint8_t ff_dca_bitalloc_sizes[DCA_CODE_BOOKS]; +extern const uint8_t ff_dca_vlc_src_tables[][2]; + +av_cold void ff_dca_init_vlcs(void); + +#endif /* AVCODEC_DCAHUFF_H */ diff --git a/include/libavcodec/dcamath.h b/include/libavcodec/dcamath.h new file mode 100644 index 0000000..38fa9a6 --- /dev/null +++ b/include/libavcodec/dcamath.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2016 foo86 + * + * 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_DCAMATH_H +#define AVCODEC_DCAMATH_H + +#include "libavutil/common.h" +#include "libavutil/intmath.h" + +static inline int32_t norm__(int64_t a, int bits) +{ + if (bits > 0) + return (int32_t)((a + (INT64_C(1) << (bits - 1))) >> bits); + else + return (int32_t)a; +} + +static inline int32_t mul__(int32_t a, int32_t b, int bits) +{ + return norm__((int64_t)a * b, bits); +} + +static inline int32_t norm13(int64_t a) { return norm__(a, 13); } +static inline int32_t norm16(int64_t a) { return norm__(a, 16); } +static inline int32_t norm20(int64_t a) { return norm__(a, 20); } +static inline int32_t norm21(int64_t a) { return norm__(a, 21); } +static inline int32_t norm23(int64_t a) { return norm__(a, 23); } + +static inline int32_t mul15(int32_t a, int32_t b) { return mul__(a, b, 15); } +static inline int32_t mul16(int32_t a, int32_t b) { return mul__(a, b, 16); } +static inline int32_t mul17(int32_t a, int32_t b) { return mul__(a, b, 17); } +static inline int32_t mul22(int32_t a, int32_t b) { return mul__(a, b, 22); } +static inline int32_t mul23(int32_t a, int32_t b) { return mul__(a, b, 23); } +static inline int32_t mul31(int32_t a, int32_t b) { return mul__(a, b, 31); } +static inline int32_t mul32(int32_t a, int32_t b) { return mul__(a, b, 32); } + +static inline int32_t clip23(int32_t a) { return av_clip_intp2(a, 23); } + +#endif diff --git a/include/libavcodec/dct.h b/include/libavcodec/dct.h new file mode 100644 index 0000000..17c881a --- /dev/null +++ b/include/libavcodec/dct.h @@ -0,0 +1,37 @@ +/* + * (I)DCT Transforms + * Copyright (c) 2009 Peter Ross + * Copyright (c) 2010 Alex Converse + * Copyright (c) 2010 Vitor Sessak + * + * 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 St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_DCT_H +#define AVCODEC_DCT_H + +#include +#include + +void ff_j_rev_dct(int16_t *data); +void ff_j_rev_dct4(int16_t *data); +void ff_j_rev_dct2(int16_t *data); +void ff_j_rev_dct1(int16_t *data); +void ff_jref_idct_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_jref_idct_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block); + +#endif /* AVCODEC_DCT_H */ diff --git a/include/libavcodec/dct32.h b/include/libavcodec/dct32.h new file mode 100644 index 0000000..61bf223 --- /dev/null +++ b/include/libavcodec/dct32.h @@ -0,0 +1,25 @@ +/* + * 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_DCT32_H +#define AVCODEC_DCT32_H + +void ff_dct32_float(float *dst, const float *src); +void ff_dct32_fixed(int *dst, const int *src); + +#endif /* AVCODEC_DCT32_H */ diff --git a/include/libavcodec/dctref.h b/include/libavcodec/dctref.h new file mode 100644 index 0000000..f6fde88 --- /dev/null +++ b/include/libavcodec/dctref.h @@ -0,0 +1,29 @@ +/* + * reference discrete cosine transform (double precision) + * Copyright (C) 2009 Dylan Yudaken + * + * 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_DCTREF_H +#define AVCODEC_DCTREF_H + +void ff_ref_fdct(short *block); +void ff_ref_idct(short *block); +void ff_ref_dct_init(void); + +#endif /* AVCODEC_DCTREF_H */ diff --git a/include/libavcodec/decode.h b/include/libavcodec/decode.h new file mode 100644 index 0000000..2c3719a --- /dev/null +++ b/include/libavcodec/decode.h @@ -0,0 +1,223 @@ +/* + * generic decoding-related code + * + * 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_DECODE_H +#define AVCODEC_DECODE_H + +#include "libavutil/frame.h" +#include "libavutil/hwcontext.h" + +#include "avcodec.h" + +/** + * This struct stores per-frame lavc-internal data and is attached to it via + * private_ref. + */ +typedef struct FrameDecodeData { + /** + * The callback to perform some delayed processing on the frame right + * before it is returned to the caller. + * + * @note This code is called at some unspecified point after the frame is + * returned from the decoder's decode/receive_frame call. Therefore it cannot rely + * on AVCodecContext being in any specific state, so it does not get to + * access AVCodecContext directly at all. All the state it needs must be + * stored in the post_process_opaque object. + */ + int (*post_process)(void *logctx, AVFrame *frame); + void *post_process_opaque; + void (*post_process_opaque_free)(void *opaque); + + /** + * Per-frame private data for hwaccels. + */ + void *hwaccel_priv; + void (*hwaccel_priv_free)(void *priv); +} FrameDecodeData; + +/** + * Called by decoders to get the next packet for decoding. + * + * @param pkt An empty packet to be filled with data. + * @return 0 if a new reference has been successfully written to pkt + * AVERROR(EAGAIN) if no data is currently available + * AVERROR_EOF if and end of stream has been reached, so no more data + * will be available + */ +int ff_decode_get_packet(AVCodecContext *avctx, AVPacket *pkt); + +/** + * Set various frame properties from the provided packet. + */ +int ff_decode_frame_props_from_pkt(const AVCodecContext *avctx, + AVFrame *frame, const AVPacket *pkt); + +/** + * Set various frame properties from the codec context / packet data. + */ +int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame); + +/** + * Make sure avctx.hw_frames_ctx is set. If it's not set, the function will + * try to allocate it from hw_device_ctx. If that is not possible, an error + * message is printed, and an error code is returned. + */ +int ff_decode_get_hw_frames_ctx(AVCodecContext *avctx, + enum AVHWDeviceType dev_type); + +int ff_attach_decode_data(AVFrame *frame); + +/** + * Check whether the side-data of src contains a palette of + * size AVPALETTE_SIZE; if so, copy it to dst and return 1; + * else return 0. + * Also emit an error message upon encountering a palette + * with invalid size. + */ +int ff_copy_palette(void *dst, const AVPacket *src, void *logctx); + +/** + * Check that the provided frame dimensions are valid and set them on the codec + * context. + */ +int ff_set_dimensions(AVCodecContext *s, int width, int height); + +/** + * Check that the provided sample aspect ratio is valid and set it on the codec + * context. + */ +int ff_set_sar(AVCodecContext *avctx, AVRational sar); + +/** + * Select the (possibly hardware accelerated) pixel format. + * This is a wrapper around AVCodecContext.get_format() and should be used + * instead of calling get_format() directly. + * + * The list of pixel formats must contain at least one valid entry, and is + * terminated with AV_PIX_FMT_NONE. If it is possible to decode to software, + * the last entry in the list must be the most accurate software format. + * If it is not possible to decode to software, AVCodecContext.sw_pix_fmt + * must be set before calling this function. + */ +int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt); + +/** + * Get a buffer for a frame. This is a wrapper around + * AVCodecContext.get_buffer() and should be used instead calling get_buffer() + * directly. + */ +int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags); + +#define FF_REGET_BUFFER_FLAG_READONLY 1 ///< the returned buffer does not need to be writable +/** + * Identical in function to ff_get_buffer(), except it reuses the existing buffer + * if available. + */ +int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame, int flags); + +/** + * Add or update AV_FRAME_DATA_MATRIXENCODING side data. + */ +int ff_side_data_update_matrix_encoding(AVFrame *frame, + enum AVMatrixEncoding matrix_encoding); + +/** + * Allocate a hwaccel frame private data if the provided avctx + * uses a hwaccel method that needs it. The returned data is + * a RefStruct reference (if allocated). + * + * @param avctx The codec context + * @param hwaccel_picture_private Pointer to return hwaccel_picture_private + * @return 0 on success, < 0 on error + */ +int ff_hwaccel_frame_priv_alloc(AVCodecContext *avctx, void **hwaccel_picture_private); + +/** + * Get side data of the given type from a decoding context. + */ +const AVPacketSideData *ff_get_coded_side_data(const AVCodecContext *avctx, + enum AVPacketSideDataType type); + +/** + * Wrapper around av_frame_new_side_data, which rejects side data overridden by + * the demuxer. Returns 0 on success, and a negative error code otherwise. + * If successful and sd is not NULL, *sd may either contain a pointer to the new + * side data, or NULL in case the side data was already present. + */ +int ff_frame_new_side_data(const AVCodecContext *avctx, AVFrame *frame, + enum AVFrameSideDataType type, size_t size, + AVFrameSideData **sd); + +/** + * Similar to `ff_frame_new_side_data`, but using an existing buffer ref. + * + * *buf is ALWAYS consumed by this function and NULL written in its place, even + * on failure. + */ +int ff_frame_new_side_data_from_buf(const AVCodecContext *avctx, + AVFrame *frame, enum AVFrameSideDataType type, + AVBufferRef **buf); + +/** + * Same as `ff_frame_new_side_data_from_buf`, but taking a AVFrameSideData + * array directly instead of an AVFrame. + */ +int ff_frame_new_side_data_from_buf_ext(const AVCodecContext *avctx, + AVFrameSideData ***sd, int *nb_sd, + enum AVFrameSideDataType type, + AVBufferRef **buf); + +struct AVMasteringDisplayMetadata; +struct AVContentLightMetadata; + +/** + * Wrapper around av_mastering_display_metadata_create_side_data(), which + * rejects side data overridden by the demuxer. Returns 0 on success, and a + * negative error code otherwise. If successful, *mdm may either be a pointer to + * the new side data, or NULL in case the side data was already present. + */ +int ff_decode_mastering_display_new(const AVCodecContext *avctx, AVFrame *frame, + struct AVMasteringDisplayMetadata **mdm); + +/** + * Same as `ff_decode_mastering_display_new`, but taking a AVFrameSideData + * array directly instead of an AVFrame. + */ +int ff_decode_mastering_display_new_ext(const AVCodecContext *avctx, + AVFrameSideData ***sd, int *nb_sd, + struct AVMasteringDisplayMetadata **mdm); + +/** + * Wrapper around av_content_light_metadata_create_side_data(), which + * rejects side data overridden by the demuxer. Returns 0 on success, and a + * negative error code otherwise. If successful, *clm may either be a pointer to + * the new side data, or NULL in case the side data was already present. + */ +int ff_decode_content_light_new(const AVCodecContext *avctx, AVFrame *frame, + struct AVContentLightMetadata **clm); + +/** + * Same as `ff_decode_content_light_new`, but taking a AVFrameSideData + * array directly instead of an AVFrame. + */ +int ff_decode_content_light_new_ext(const AVCodecContext *avctx, + AVFrameSideData ***sd, int *nb_sd, + struct AVContentLightMetadata **clm); +#endif /* AVCODEC_DECODE_H */ diff --git a/include/libavcodec/defs.h b/include/libavcodec/defs.h index 420a042..24250f8 100644 --- a/include/libavcodec/defs.h +++ b/include/libavcodec/defs.h @@ -39,6 +39,173 @@ */ #define AV_INPUT_BUFFER_PADDING_SIZE 64 +/** + * Verify checksums embedded in the bitstream (could be of either encoded or + * decoded data, depending on the format) and print an error message on mismatch. + * If AV_EF_EXPLODE is also set, a mismatching checksum will result in the + * decoder/demuxer returning an error. + */ +#define AV_EF_CRCCHECK (1<<0) +#define AV_EF_BITSTREAM (1<<1) ///< detect bitstream specification deviations +#define AV_EF_BUFFER (1<<2) ///< detect improper bitstream length +#define AV_EF_EXPLODE (1<<3) ///< abort decoding on minor error detection + +#define AV_EF_IGNORE_ERR (1<<15) ///< ignore errors and continue +#define AV_EF_CAREFUL (1<<16) ///< consider things that violate the spec, are fast to calculate and have not been seen in the wild as errors +#define AV_EF_COMPLIANT (1<<17) ///< consider all spec non compliances as errors +#define AV_EF_AGGRESSIVE (1<<18) ///< consider things that a sane encoder/muxer should not do as an error + +#define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to an older more strict version of the spec or reference software. +#define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences. +#define FF_COMPLIANCE_NORMAL 0 +#define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions +#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things. + + +#define AV_PROFILE_UNKNOWN -99 +#define AV_PROFILE_RESERVED -100 + +#define AV_PROFILE_AAC_MAIN 0 +#define AV_PROFILE_AAC_LOW 1 +#define AV_PROFILE_AAC_SSR 2 +#define AV_PROFILE_AAC_LTP 3 +#define AV_PROFILE_AAC_HE 4 +#define AV_PROFILE_AAC_HE_V2 28 +#define AV_PROFILE_AAC_LD 22 +#define AV_PROFILE_AAC_ELD 38 +#define AV_PROFILE_AAC_USAC 41 +#define AV_PROFILE_MPEG2_AAC_LOW 128 +#define AV_PROFILE_MPEG2_AAC_HE 131 + +#define AV_PROFILE_DNXHD 0 +#define AV_PROFILE_DNXHR_LB 1 +#define AV_PROFILE_DNXHR_SQ 2 +#define AV_PROFILE_DNXHR_HQ 3 +#define AV_PROFILE_DNXHR_HQX 4 +#define AV_PROFILE_DNXHR_444 5 + +#define AV_PROFILE_DTS 20 +#define AV_PROFILE_DTS_ES 30 +#define AV_PROFILE_DTS_96_24 40 +#define AV_PROFILE_DTS_HD_HRA 50 +#define AV_PROFILE_DTS_HD_MA 60 +#define AV_PROFILE_DTS_EXPRESS 70 +#define AV_PROFILE_DTS_HD_MA_X 61 +#define AV_PROFILE_DTS_HD_MA_X_IMAX 62 + +#define AV_PROFILE_EAC3_DDP_ATMOS 30 + +#define AV_PROFILE_TRUEHD_ATMOS 30 + +#define AV_PROFILE_MPEG2_422 0 +#define AV_PROFILE_MPEG2_HIGH 1 +#define AV_PROFILE_MPEG2_SS 2 +#define AV_PROFILE_MPEG2_SNR_SCALABLE 3 +#define AV_PROFILE_MPEG2_MAIN 4 +#define AV_PROFILE_MPEG2_SIMPLE 5 + +#define AV_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag +#define AV_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag + +#define AV_PROFILE_H264_BASELINE 66 +#define AV_PROFILE_H264_CONSTRAINED_BASELINE (66|AV_PROFILE_H264_CONSTRAINED) +#define AV_PROFILE_H264_MAIN 77 +#define AV_PROFILE_H264_EXTENDED 88 +#define AV_PROFILE_H264_HIGH 100 +#define AV_PROFILE_H264_HIGH_10 110 +#define AV_PROFILE_H264_HIGH_10_INTRA (110|AV_PROFILE_H264_INTRA) +#define AV_PROFILE_H264_MULTIVIEW_HIGH 118 +#define AV_PROFILE_H264_HIGH_422 122 +#define AV_PROFILE_H264_HIGH_422_INTRA (122|AV_PROFILE_H264_INTRA) +#define AV_PROFILE_H264_STEREO_HIGH 128 +#define AV_PROFILE_H264_HIGH_444 144 +#define AV_PROFILE_H264_HIGH_444_PREDICTIVE 244 +#define AV_PROFILE_H264_HIGH_444_INTRA (244|AV_PROFILE_H264_INTRA) +#define AV_PROFILE_H264_CAVLC_444 44 + +#define AV_PROFILE_VC1_SIMPLE 0 +#define AV_PROFILE_VC1_MAIN 1 +#define AV_PROFILE_VC1_COMPLEX 2 +#define AV_PROFILE_VC1_ADVANCED 3 + +#define AV_PROFILE_MPEG4_SIMPLE 0 +#define AV_PROFILE_MPEG4_SIMPLE_SCALABLE 1 +#define AV_PROFILE_MPEG4_CORE 2 +#define AV_PROFILE_MPEG4_MAIN 3 +#define AV_PROFILE_MPEG4_N_BIT 4 +#define AV_PROFILE_MPEG4_SCALABLE_TEXTURE 5 +#define AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6 +#define AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7 +#define AV_PROFILE_MPEG4_HYBRID 8 +#define AV_PROFILE_MPEG4_ADVANCED_REAL_TIME 9 +#define AV_PROFILE_MPEG4_CORE_SCALABLE 10 +#define AV_PROFILE_MPEG4_ADVANCED_CODING 11 +#define AV_PROFILE_MPEG4_ADVANCED_CORE 12 +#define AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13 +#define AV_PROFILE_MPEG4_SIMPLE_STUDIO 14 +#define AV_PROFILE_MPEG4_ADVANCED_SIMPLE 15 + +#define AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 1 +#define AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 2 +#define AV_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 32768 +#define AV_PROFILE_JPEG2000_DCINEMA_2K 3 +#define AV_PROFILE_JPEG2000_DCINEMA_4K 4 + +#define AV_PROFILE_VP9_0 0 +#define AV_PROFILE_VP9_1 1 +#define AV_PROFILE_VP9_2 2 +#define AV_PROFILE_VP9_3 3 + +#define AV_PROFILE_HEVC_MAIN 1 +#define AV_PROFILE_HEVC_MAIN_10 2 +#define AV_PROFILE_HEVC_MAIN_STILL_PICTURE 3 +#define AV_PROFILE_HEVC_REXT 4 +#define AV_PROFILE_HEVC_MULTIVIEW_MAIN 6 +#define AV_PROFILE_HEVC_SCC 9 + +#define AV_PROFILE_VVC_MAIN_10 1 +#define AV_PROFILE_VVC_MAIN_10_444 33 + +#define AV_PROFILE_AV1_MAIN 0 +#define AV_PROFILE_AV1_HIGH 1 +#define AV_PROFILE_AV1_PROFESSIONAL 2 + +#define AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT 0xc0 +#define AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT 0xc1 +#define AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT 0xc2 +#define AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS 0xc3 +#define AV_PROFILE_MJPEG_JPEG_LS 0xf7 + +#define AV_PROFILE_SBC_MSBC 1 + +#define AV_PROFILE_PRORES_PROXY 0 +#define AV_PROFILE_PRORES_LT 1 +#define AV_PROFILE_PRORES_STANDARD 2 +#define AV_PROFILE_PRORES_HQ 3 +#define AV_PROFILE_PRORES_4444 4 +#define AV_PROFILE_PRORES_XQ 5 + +#define AV_PROFILE_ARIB_PROFILE_A 0 +#define AV_PROFILE_ARIB_PROFILE_C 1 + +#define AV_PROFILE_KLVA_SYNC 0 +#define AV_PROFILE_KLVA_ASYNC 1 + +#define AV_PROFILE_EVC_BASELINE 0 +#define AV_PROFILE_EVC_MAIN 1 + + +#define AV_LEVEL_UNKNOWN -99 + +enum AVFieldOrder { + AV_FIELD_UNKNOWN, + AV_FIELD_PROGRESSIVE, + AV_FIELD_TT, ///< Top coded_first, top displayed first + AV_FIELD_BB, ///< Bottom coded first, bottom displayed first + AV_FIELD_TB, ///< Top coded first, bottom displayed first + AV_FIELD_BT, ///< Bottom coded first, top displayed first +}; + /** * @ingroup lavc_decoding */ diff --git a/include/libavcodec/dirac.h b/include/libavcodec/dirac.h index e6d9d34..8c348cd 100755 --- a/include/libavcodec/dirac.h +++ b/include/libavcodec/dirac.h @@ -31,7 +31,11 @@ * @author Jordi Ortiz */ -#include "avcodec.h" +#include +#include + +#include "libavutil/pixfmt.h" +#include "libavutil/rational.h" /** * The spec limits the number of wavelet decompositions to 4 for both diff --git a/include/libavcodec/dirac_arith.h b/include/libavcodec/dirac_arith.h new file mode 100644 index 0000000..203d481 --- /dev/null +++ b/include/libavcodec/dirac_arith.h @@ -0,0 +1,205 @@ +/* + * Copyright (C) 2007 Marco Gerards + * Copyright (C) 2009 David Conrad + * + * 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 + */ + +/** + * @file + * Arithmetic decoder for Dirac + * @author Marco Gerards + */ + +#ifndef AVCODEC_DIRAC_ARITH_H +#define AVCODEC_DIRAC_ARITH_H + +#include "config.h" + +#if ARCH_X86 +#include "libavutil/x86/asm.h" +#endif +#include "bytestream.h" +#include "get_bits.h" + +enum dirac_arith_contexts { + CTX_ZPZN_F1, + CTX_ZPNN_F1, + CTX_NPZN_F1, + CTX_NPNN_F1, + CTX_ZP_F2, + CTX_ZP_F3, + CTX_ZP_F4, + CTX_ZP_F5, + CTX_ZP_F6, + CTX_NP_F2, + CTX_NP_F3, + CTX_NP_F4, + CTX_NP_F5, + CTX_NP_F6, + CTX_COEFF_DATA, + CTX_SIGN_NEG, + CTX_SIGN_ZERO, + CTX_SIGN_POS, + CTX_ZERO_BLOCK, + CTX_DELTA_Q_F, + CTX_DELTA_Q_DATA, + CTX_DELTA_Q_SIGN, + + DIRAC_CTX_COUNT +}; + +// Dirac resets the arith decoder between decoding various types of data, +// so many contexts are never used simultaneously. Thus, we can reduce +// the number of contexts needed by reusing them. +#define CTX_SB_F1 CTX_ZP_F5 +#define CTX_SB_DATA 0 +#define CTX_PMODE_REF1 0 +#define CTX_PMODE_REF2 1 +#define CTX_GLOBAL_BLOCK 2 +#define CTX_MV_F1 CTX_ZP_F2 +#define CTX_MV_DATA 0 +#define CTX_DC_F1 CTX_ZP_F5 +#define CTX_DC_DATA 0 + +typedef struct { + unsigned low; + uint16_t range; + int16_t counter; + + const uint8_t *bytestream; + const uint8_t *bytestream_end; + + uint16_t contexts[DIRAC_CTX_COUNT]; + int error; + int overread; +} DiracArith; + +extern const uint8_t ff_dirac_next_ctx[DIRAC_CTX_COUNT]; +extern int16_t ff_dirac_prob_branchless[256][2]; + +static inline void renorm(DiracArith *c) +{ +#if HAVE_FAST_CLZ + int shift = 14 - av_log2_16bit(c->range-1) + ((c->range-1)>>15); + + c->low <<= shift; + c->range <<= shift; + c->counter += shift; +#else + while (c->range <= 0x4000) { + c->low <<= 1; + c->range <<= 1; + c->counter++; + } +#endif +} + +static inline void refill(DiracArith *c) +{ + int counter = c->counter; + + if (counter >= 0) { + int new = bytestream_get_be16(&c->bytestream); + + // the spec defines overread bits to be 1, and streams rely on this + if (c->bytestream > c->bytestream_end) { + new |= 0xff; + if (c->bytestream > c->bytestream_end+1) + new |= 0xff00; + + c->bytestream = c->bytestream_end; + c->overread ++; + if (c->overread > 4) + c->error = AVERROR_INVALIDDATA; + } + + c->low += new << counter; + counter -= 16; + } + c->counter = counter; +} + +static inline int dirac_get_arith_bit(DiracArith *c, int ctx) +{ + int prob_zero = c->contexts[ctx]; + int range_times_prob, bit; + unsigned low = c->low; + int range = c->range; + + range_times_prob = (c->range * prob_zero) >> 16; + +#if ARCH_X86 && HAVE_FAST_CMOV && HAVE_INLINE_ASM && HAVE_6REGS + low -= range_times_prob << 16; + range -= range_times_prob; + bit = 0; + __asm__( + "cmpl %5, %4 \n\t" + "setae %b0 \n\t" + "cmovb %3, %2 \n\t" + "cmovb %5, %1 \n\t" + : "+q"(bit), "+r"(range), "+r"(low) + : "r"(c->low), "r"(c->low>>16), + "r"(range_times_prob) + ); +#else + bit = (low >> 16) >= range_times_prob; + if (bit) { + low -= range_times_prob << 16; + range -= range_times_prob; + } else { + range = range_times_prob; + } +#endif + + c->contexts[ctx] += ff_dirac_prob_branchless[prob_zero>>8][bit]; + c->low = low; + c->range = range; + + renorm(c); + refill(c); + return bit; +} + +static inline int dirac_get_arith_uint(DiracArith *c, int follow_ctx, int data_ctx) +{ + int ret = 1; + while (!dirac_get_arith_bit(c, follow_ctx)) { + if (ret >= 0x40000000) { + av_log(NULL, AV_LOG_ERROR, "dirac_get_arith_uint overflow\n"); + c->error = AVERROR_INVALIDDATA; + return -1; + } + ret <<= 1; + ret += dirac_get_arith_bit(c, data_ctx); + follow_ctx = ff_dirac_next_ctx[follow_ctx]; + } + return ret-1; +} + +static inline int dirac_get_arith_int(DiracArith *c, int follow_ctx, int data_ctx) +{ + int ret = dirac_get_arith_uint(c, follow_ctx, data_ctx); + if (ret && dirac_get_arith_bit(c, data_ctx+1)) + ret = -ret; + return ret; +} + +void ff_dirac_init_arith_tables(void); +void ff_dirac_init_arith_decoder(DiracArith *c, GetBitContext *gb, int length); + +#endif /* AVCODEC_DIRAC_ARITH_H */ diff --git a/include/libavcodec/dirac_dwt.h b/include/libavcodec/dirac_dwt.h new file mode 100644 index 0000000..84f71d9 --- /dev/null +++ b/include/libavcodec/dirac_dwt.h @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2004-2010 Michael Niedermayer + * + * 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_DIRAC_DWT_H +#define AVCODEC_DIRAC_DWT_H + +#include + +typedef int DWTELEM; +typedef short IDWTELEM; + +#define MAX_DWT_SUPPORT 8 +#define MAX_DECOMPOSITIONS 8 + +typedef struct DWTCompose { + uint8_t *b[MAX_DWT_SUPPORT]; + int y; +} DWTCompose; + +typedef struct DWTPlane { + int width; + int height; + int stride; + uint8_t *buf; + uint8_t *buf_base; + uint8_t *tmp; +} DWTPlane; + +struct DWTContext; + +// Possible prototypes for vertical_compose functions +typedef void (*vertical_compose_2tap)(uint8_t *b0, uint8_t *b1, int width); +typedef void (*vertical_compose_3tap)(uint8_t *b0, uint8_t *b1, uint8_t *b2, int width); +typedef void (*vertical_compose_5tap)(uint8_t *b0, uint8_t *b1, uint8_t *b2, uint8_t *b3, uint8_t *b4, int width); +typedef void (*vertical_compose_9tap)(uint8_t *dst, uint8_t *b[8], int width); + +typedef struct DWTContext { + uint8_t *buffer; + uint8_t *temp; + int width; + int height; + int stride; + int decomposition_count; + int support; + + void (*spatial_compose)(struct DWTContext *cs, int level, int width, int height, int stride); + union { + vertical_compose_3tap tap3; + vertical_compose_5tap tap5; + vertical_compose_9tap tap9; + } vertical_compose_l0, vertical_compose_h0; + vertical_compose_3tap vertical_compose_l1; + vertical_compose_3tap vertical_compose_h1; + vertical_compose_2tap vertical_compose; ///< one set of lowpass and highpass combined + void (*horizontal_compose)(uint8_t *b, uint8_t *tmp, int width); + + DWTCompose cs[MAX_DECOMPOSITIONS]; +} DWTContext; + +enum dwt_type { + DWT_SNOW_DAUB9_7, + DWT_SNOW_LEGALL5_3, + DWT_DIRAC_DD9_7, + DWT_DIRAC_LEGALL5_3, + DWT_DIRAC_DD13_7, + DWT_DIRAC_HAAR0, + DWT_DIRAC_HAAR1, + DWT_DIRAC_FIDELITY, + DWT_DIRAC_DAUB9_7, + DWT_NUM_TYPES +}; + +// -1 if an error occurred, e.g. the dwt_type isn't recognized +int ff_spatial_idwt_init(DWTContext *d, DWTPlane *p, enum dwt_type type, + int decomposition_count, int bit_depth); +void ff_spatial_idwt_init_x86(DWTContext *d, enum dwt_type type); + +void ff_spatial_idwt_slice2(DWTContext *d, int y); + +// shared stuff for simd optimizations +#define COMPOSE_53iL0(b0, b1, b2)\ + (b1 - (unsigned)((int)(b0 + (unsigned)(b2) + 2) >> 2)) + +#define COMPOSE_DIRAC53iH0(b0, b1, b2)\ + (b1 + (unsigned)((int)(b0 + (unsigned)(b2) + 1) >> 1)) + +#define COMPOSE_DD97iH0(b0, b1, b2, b3, b4)\ + (int)(((unsigned)(b2) + ((int)(9U*b1 + 9U*b3 - b4 - b0 + 8) >> 4))) + +#define COMPOSE_DD137iL0(b0, b1, b2, b3, b4)\ + (int)(((unsigned)(b2) - ((int)(9U*b1 + 9U*b3 - b4 - b0 + 16) >> 5))) + +#define COMPOSE_HAARiL0(b0, b1)\ + ((int)(b0 - (unsigned)((int)(b1 + 1U) >> 1))) + +#define COMPOSE_HAARiH0(b0, b1)\ + ((int)(b0 + (unsigned)(b1))) + +#define COMPOSE_FIDELITYiL0(b0, b1, b2, b3, b4, b5, b6, b7, b8)\ + ((unsigned)b4 - ((int)(-8*(b0+(unsigned)b8) + 21*(b1+(unsigned)b7) - 46*(b2+(unsigned)b6) + 161*(b3+(unsigned)b5) + 128) >> 8)) + +#define COMPOSE_FIDELITYiH0(b0, b1, b2, b3, b4, b5, b6, b7, b8)\ + ((unsigned)b4 + ((int)(-2*(b0+(unsigned)b8) + 10*(b1+(unsigned)b7) - 25*(b2+(unsigned)b6) + 81*(b3+(unsigned)b5) + 128) >> 8)) + +#define COMPOSE_DAUB97iL1(b0, b1, b2)\ + ((unsigned)(b1) - ((int)(1817*(b0 + (unsigned)b2) + 2048) >> 12)) + +#define COMPOSE_DAUB97iH1(b0, b1, b2)\ + ((unsigned)(b1) - ((int)( 113*(b0 + (unsigned)b2) + 64) >> 7)) + +#define COMPOSE_DAUB97iL0(b0, b1, b2)\ + ((unsigned)(b1) + ((int)( 217*(b0 + (unsigned)b2) + 2048) >> 12)) + +#define COMPOSE_DAUB97iH0(b0, b1, b2)\ + ((unsigned)(b1) + ((int)(6497*(b0 + (unsigned)b2) + 2048) >> 12)) + + +#endif /* AVCODEC_DWT_H */ diff --git a/include/libavcodec/dirac_vlc.h b/include/libavcodec/dirac_vlc.h new file mode 100644 index 0000000..5adb9ef --- /dev/null +++ b/include/libavcodec/dirac_vlc.h @@ -0,0 +1,29 @@ +/* + * 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_DIRAC_VLC_H +#define AVCODEC_DIRAC_VLC_H + +#include + +int ff_dirac_golomb_read_16bit(const uint8_t *buf, int bytes, + uint8_t *_dst, int coeffs); +int ff_dirac_golomb_read_32bit(const uint8_t *buf, int bytes, + uint8_t *_dst, int coeffs); + +#endif /* AVCODEC_DIRAC_VLC_H */ diff --git a/include/libavcodec/diracdsp.h b/include/libavcodec/diracdsp.h new file mode 100644 index 0000000..224828d --- /dev/null +++ b/include/libavcodec/diracdsp.h @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2010 David Conrad + * + * 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_DIRACDSP_H +#define AVCODEC_DIRACDSP_H + +#include +#include + +typedef void (*dirac_weight_func)(uint8_t *block, int stride, int log2_denom, int weight, int h); +typedef void (*dirac_biweight_func)(uint8_t *dst, const uint8_t *src, int stride, int log2_denom, int weightd, int weights, int h); + +typedef struct { + void (*dirac_hpel_filter)(uint8_t *dsth, uint8_t *dstv, uint8_t *dstc, const uint8_t *src, int stride, int width, int height); + /** + * dirac_pixels_tab[width][subpel] + * width is 2 for 32, 1 for 16, 0 for 8 + * subpel is 0 for fpel and hpel (only need to copy from the first plane in src) + * 1 if an average of the first 2 planes is needed (TODO: worth it?) + * 2 for general qpel (avg of 4) + * 3 for general epel (biweight of 4 using the weights in src[4]) + * src[0-3] is each of the hpel planes + * src[4] is the 1/8 pel weights if needed + */ + void (*put_dirac_pixels_tab[3][4])(uint8_t *dst, const uint8_t *src[5], int stride, int h); + void (*avg_dirac_pixels_tab[3][4])(uint8_t *dst, const uint8_t *src[5], int stride, int h); + + void (*put_signed_rect_clamped[3])(uint8_t *dst/*align 16*/, int dst_stride, const uint8_t *src/*align 16*/, int src_stride, int width, int height/*mod 2*/); + void (*put_rect_clamped)(uint8_t *dst/*align 16*/, int dst_stride, const uint8_t *src/*align 16*/, int src_stride, int width, int height/*mod 2*/); + void (*add_rect_clamped)(uint8_t *dst/*align 16*/, const uint16_t *src/*align 16*/, int stride, const int16_t *idwt/*align 16*/, int idwt_stride, int width, int height/*mod 2*/); + void (*add_dirac_obmc[3])(uint16_t *dst, const uint8_t *src, int stride, const uint8_t *obmc_weight, int yblen); + + /* 0-1: int16_t and int32_t asm/c, 2-3: int16 and int32_t, C only */ + void (*dequant_subband[4])(uint8_t *src, uint8_t *dst, ptrdiff_t stride, const int qf, const int qs, int tot_v, int tot_h); + + dirac_weight_func weight_dirac_pixels_tab[3]; + dirac_biweight_func biweight_dirac_pixels_tab[3]; +} DiracDSPContext; + +#define DECL_DIRAC_PIXOP(PFX, EXT) \ + void ff_ ## PFX ## _dirac_pixels8_ ## EXT(uint8_t *dst, const uint8_t *src[5], int stride, int h); \ + void ff_ ## PFX ## _dirac_pixels16_ ## EXT(uint8_t *dst, const uint8_t *src[5], int stride, int h); \ + void ff_ ## PFX ## _dirac_pixels32_ ## EXT(uint8_t *dst, const uint8_t *src[5], int stride, int h) + +DECL_DIRAC_PIXOP(put, c); +DECL_DIRAC_PIXOP(avg, c); +DECL_DIRAC_PIXOP(put, l2_c); +DECL_DIRAC_PIXOP(avg, l2_c); +DECL_DIRAC_PIXOP(put, l4_c); +DECL_DIRAC_PIXOP(avg, l4_c); + +void ff_diracdsp_init(DiracDSPContext *c); +void ff_diracdsp_init_x86(DiracDSPContext* c); + +#endif /* AVCODEC_DIRACDSP_H */ diff --git a/include/libavcodec/diractab.h b/include/libavcodec/diractab.h new file mode 100644 index 0000000..2423b07 --- /dev/null +++ b/include/libavcodec/diractab.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2016 Open Broadcast Systems Ltd. + * Author (C) 2016 Rostislav Pehlivanov + * + * 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_DIRACTAB_H +#define AVCODEC_DIRACTAB_H + +#include + +/* Tables here are shared between the Dirac/VC-2 decoder and the VC-2 encoder */ + +/* Default quantization tables for each wavelet transform */ +extern const uint8_t ff_dirac_default_qmat[7][4][4]; + +/* Scaling factors needed for quantization/dequantization */ +extern const int32_t ff_dirac_qscale_tab[116]; + +/* Scaling offsets needed for quantization/dequantization, for intra frames */ +extern const int32_t ff_dirac_qoffset_intra_tab[120]; + +/* Scaling offsets needed for quantization/dequantization, for inter frames */ +extern const int ff_dirac_qoffset_inter_tab[122]; + +#define DIRAC_MAX_QUANT_INDEX (FF_ARRAY_ELEMS(ff_dirac_qscale_tab)) + +#endif /* AVCODEC_DIRACTAB_H */ diff --git a/include/libavcodec/dnxhddata.h b/include/libavcodec/dnxhddata.h new file mode 100644 index 0000000..ea36feb --- /dev/null +++ b/include/libavcodec/dnxhddata.h @@ -0,0 +1,95 @@ +/* + * VC3/DNxHD decoder. + * Copyright (c) 2007 SmartJog S.A., Baptiste Coudurier + * + * 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_DNXHDDATA_H +#define AVCODEC_DNXHDDATA_H + +#include +#include "avcodec.h" +#include "libavutil/attributes.h" +#include "libavutil/intreadwrite.h" +#include "libavutil/rational.h" + +/** Additional profile info flags */ +#define DNXHD_INTERLACED (1<<0) +#define DNXHD_MBAFF (1<<1) +#define DNXHD_444 (1<<2) + +/** Frame headers, extra 0x00 added to end for parser */ +#define DNXHD_HEADER_INITIAL 0x000002800100 +#define DNXHD_HEADER_444 0x000002800200 + +/** Indicate that a CIDEntry value must be read in the bitstream */ +#define DNXHD_VARIABLE 0 + +typedef struct CIDEntry { + int cid; + unsigned int width, height; + unsigned int frame_size; + unsigned int coding_unit_size; + uint16_t flags; + int index_bits; + int bit_depth; + int eob_index; + const uint8_t *luma_weight, *chroma_weight; + const uint8_t *dc_codes, *dc_bits; + const uint16_t *ac_codes; + const uint8_t *ac_bits, *ac_info; + const uint16_t *run_codes; + const uint8_t *run_bits, *run; + int bit_rates[5]; ///< Helper to choose variants, rounded to nearest 5Mb/s + AVRational packet_scale; +} CIDEntry; + +const CIDEntry *ff_dnxhd_get_cid_table(int cid); +int ff_dnxhd_find_cid(AVCodecContext *avctx, int bit_depth); +void ff_dnxhd_print_profiles(AVCodecContext *avctx, int loglevel); + +static av_always_inline uint64_t ff_dnxhd_check_header_prefix_hr(uint64_t prefix) +{ + uint64_t data_offset = prefix >> 16; + if ((prefix & 0xFFFF0000FFFFLL) == 0x0300 && + data_offset >= 0x0280 && data_offset <= 0x2170 && + (data_offset & 3) == 0) + return prefix; + return 0; +} + +static av_always_inline uint64_t ff_dnxhd_check_header_prefix(uint64_t prefix) +{ + if (prefix == DNXHD_HEADER_INITIAL || + prefix == DNXHD_HEADER_444 || + ff_dnxhd_check_header_prefix_hr(prefix)) + return prefix; + return 0; +} + +static av_always_inline uint64_t ff_dnxhd_parse_header_prefix(const uint8_t *buf) +{ + uint64_t prefix = AV_RB32(buf); + prefix = (prefix << 16) | buf[4] << 8; + return ff_dnxhd_check_header_prefix(prefix); +} + +int ff_dnxhd_get_frame_size(int cid); +int ff_dnxhd_get_hr_frame_size(int cid, int w, int h); + +#endif /* AVCODEC_DNXHDDATA_H */ diff --git a/include/libavcodec/dnxhdenc.h b/include/libavcodec/dnxhdenc.h new file mode 100644 index 0000000..00d486b --- /dev/null +++ b/include/libavcodec/dnxhdenc.h @@ -0,0 +1,114 @@ +/* + * VC3/DNxHD encoder structure definitions and prototypes + * Copyright (c) 2007 Baptiste Coudurier + * + * VC-3 encoder funded by the British Broadcasting Corporation + * + * 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_DNXHDENC_H +#define AVCODEC_DNXHDENC_H + +#include + +#include "libavutil/mem_internal.h" + +#include "mpegvideo.h" +#include "dnxhddata.h" + +typedef struct RCCMPEntry { + uint32_t mb; + int value; +} RCCMPEntry; + +typedef struct RCEntry { + int ssd; + int bits; +} RCEntry; + +typedef struct DNXHDEncContext { + AVClass *class; + MpegEncContext m; ///< Used for quantization dsp functions + + int cid; + int profile; + int bit_depth; + int is_444; + const CIDEntry *cid_table; + uint8_t *msip; ///< Macroblock Scan Indexes Payload + uint32_t *slice_size; + uint32_t *slice_offs; + + struct DNXHDEncContext *thread[MAX_THREADS]; + + // Because our samples are either 8 or 16 bits for 8-bit and 10-bit + // encoding respectively, these refer either to bytes or to two-byte words. + unsigned dct_y_offset; + unsigned dct_uv_offset; + unsigned block_width_l2; + + int frame_size; + int coding_unit_size; + int data_offset; + + int interlaced; + int cur_field; + + int nitris_compat; + unsigned min_padding; + int intra_quant_bias; + + DECLARE_ALIGNED(32, int16_t, blocks)[12][64]; + DECLARE_ALIGNED(16, uint8_t, edge_buf_y)[512]; // has to hold 16x16 uint16 when depth=10 + DECLARE_ALIGNED(16, uint8_t, edge_buf_uv)[2][512]; // has to hold 16x16 uint16_t when depth=10 + + int (*qmatrix_c) [64]; + int (*qmatrix_l) [64]; + uint16_t (*qmatrix_l16)[2][64]; + uint16_t (*qmatrix_c16)[2][64]; + + unsigned frame_bits; + const uint8_t *src[3]; + + uint32_t *orig_vlc_codes; + uint8_t *orig_vlc_bits; + uint32_t *vlc_codes; + uint8_t *vlc_bits; + uint16_t *run_codes; + uint8_t *run_bits; + + /** Rate control */ + unsigned slice_bits; + unsigned qscale; + unsigned lambda; + + uint32_t *mb_bits; + uint8_t *mb_qscale; + + RCCMPEntry *mb_cmp; + RCCMPEntry *mb_cmp_tmp; + RCEntry *mb_rc; + + void (*get_pixels_8x4_sym)(int16_t *restrict /* align 16 */ block, + const uint8_t *pixels, ptrdiff_t line_size); +} DNXHDEncContext; + +void ff_dnxhdenc_init(DNXHDEncContext *ctx); +void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx); + +#endif /* AVCODEC_DNXHDENC_H */ diff --git a/include/libavcodec/dolby_e.h b/include/libavcodec/dolby_e.h new file mode 100644 index 0000000..b2eadfe --- /dev/null +++ b/include/libavcodec/dolby_e.h @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2017 foo86 + * + * 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_DOLBY_E_H +#define AVCODEC_DOLBY_E_H + +#include +#include "get_bits.h" + +#define FRAME_SAMPLES 1792 + +#define MAX_PROG_CONF 23 +#define MAX_PROGRAMS 8 +#define MAX_CHANNELS 8 + +/** + * @struct DolbyEHeaderInfo + * Coded Dolby E header values up to end_gain element, plus derived values. + */ +typedef struct DolbyEHeaderInfo { + /** @name Coded elements + * @{ + */ + int prog_conf; + int nb_channels; + int nb_programs; + + int fr_code; + int fr_code_orig; + + int ch_size[MAX_CHANNELS]; + int mtd_ext_size; + int meter_size; + + int rev_id[MAX_CHANNELS]; + int begin_gain[MAX_CHANNELS]; + int end_gain[MAX_CHANNELS]; + /** @} */ + + /** @name Derived values + * @{ + */ + int multi_prog_warned; + + int output_channel_order; + + int sample_rate; + /** @} */ +} DolbyEHeaderInfo; + +/** + * @struct DBEContext + * Dolby E reading context used by decoder and parser. + */ +typedef struct DBEContext { + void *avctx; + GetBitContext gb; + + const uint8_t *input; + int input_size; + + int word_bits; + int word_bytes; + int key_present; + + DolbyEHeaderInfo metadata; + + uint8_t buffer[1024 * 3 + AV_INPUT_BUFFER_PADDING_SIZE]; +} DBEContext; + +/** + * Use the provided key to transform the input into data (put into s->buffer) + * suitable for further processing and initialize s->gb to read said data. + */ +int ff_dolby_e_convert_input(DBEContext *s, int nb_words, int key); + +/** + * Initialize DBEContext and parse Dolby E metadata. + * Set word_bits/word_bytes, input, input_size, key_present + * and parse the header up to the end_gain element. + * @param[out] s DBEContext. + * @param[in] buf raw input buffer. + * @param[in] buf_size must be 3 bytes at least. + * @return Returns 0 on success, AVERROR_INVALIDDATA on error + */ +int ff_dolby_e_parse_header(DBEContext *s, const uint8_t *buf, int buf_size); + +#endif diff --git a/include/libavcodec/dovi_rpu.h b/include/libavcodec/dovi_rpu.h new file mode 100644 index 0000000..f3ccc27 --- /dev/null +++ b/include/libavcodec/dovi_rpu.h @@ -0,0 +1,210 @@ +/* + * Dolby Vision RPU decoder + * + * Copyright (C) 2021 Jan Ekström + * Copyright (C) 2021 Niklas Haas + * + * 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_DOVI_RPU_H +#define AVCODEC_DOVI_RPU_H + +#include "libavutil/dovi_meta.h" +#include "libavutil/frame.h" + +#include "avcodec.h" +#include "codec_par.h" + +#define DOVI_MAX_DM_ID 15 + +typedef struct DOVIExt { + AVDOVIDmData dm_static[7]; ///< static extension blocks + AVDOVIDmData dm_dynamic[25]; ///< dynamic extension blocks + int num_static; + int num_dynamic; +} DOVIExt; + +typedef struct DOVIContext { + void *logctx; + + /** + * Enable tri-state. For encoding only. FF_DOVI_AUTOMATIC enables Dolby + * Vision only if avctx->decoded_side_data contains an AVDOVIMetadata. + */ +#define FF_DOVI_AUTOMATIC -1 + int enable; + + /** + * Currently active dolby vision configuration, or {0} for none. + * Set by the user when decoding. Generated by ff_dovi_configure() + * when encoding. + * + * Note: sizeof(cfg) is not part of the libavutil ABI, so users should + * never pass &cfg to any other library calls. This is included merely as + * a way to look up the values of fields known at compile time. + */ + AVDOVIDecoderConfigurationRecord cfg; + + /** + * Currently active RPU data header, updates on every ff_dovi_rpu_parse() + * or ff_dovi_rpu_generate(). + */ + AVDOVIRpuDataHeader header; + + /** + * Currently active data mappings, or NULL. Points into memory owned by the + * corresponding rpu/vdr_ref, which becomes invalid on the next call to + * ff_dovi_rpu_parse() or ff_dovi_rpu_generate(). + */ + const AVDOVIDataMapping *mapping; + const AVDOVIColorMetadata *color; + + /** + * Currently active extension blocks, updates on every ff_dovi_rpu_parse() + * or ff_dovi_rpu_generate(). + */ + DOVIExt *ext_blocks; ///< RefStruct, or NULL if no extension blocks + + /** + * Private fields internal to dovi_rpu.c + */ + AVDOVIColorMetadata *dm; ///< RefStruct + AVDOVIDataMapping *vdr[DOVI_MAX_DM_ID+1]; ///< RefStruct references + uint8_t *rpu_buf; ///< temporary buffer + unsigned rpu_buf_sz; + +} DOVIContext; + +void ff_dovi_ctx_replace(DOVIContext *s, const DOVIContext *s0); + +/** + * Completely reset a DOVIContext, preserving only logctx. + */ +void ff_dovi_ctx_unref(DOVIContext *s); + +/** + * Partially reset the internal state. Resets per-frame state, but preserves + * the stream-wide configuration record. + */ +void ff_dovi_ctx_flush(DOVIContext *s); + +/** + * Parse the contents of a Dolby Vision RPU and update the parsed values in the + * DOVIContext struct. This function should receive the decoded unit payload, + * without any T.35 or NAL unit headers. + * + * Returns 0 or an error code. + * + * Note: `DOVIContext.cfg` should be initialized before calling into this + * function. If not done, the profile will be guessed according to HEVC + * semantics. + */ +int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, size_t rpu_size, + int err_recognition); + +/** + * Get the decoded AVDOVIMetadata. Ownership passes to the caller. + * + * Returns the size of *out_metadata, a negative error code, or 0 if no + * metadata is available to return. + */ +int ff_dovi_get_metadata(DOVIContext *s, AVDOVIMetadata **out_metadata); + +/** + * Attach the decoded AVDOVIMetadata as side data to an AVFrame. + * Returns 0 or a negative error code. + */ +int ff_dovi_attach_side_data(DOVIContext *s, AVFrame *frame); + +/** + * Configure the encoder for Dolby Vision encoding. Generates a configuration + * record in s->cfg, and attaches it to avctx->coded_side_data. Sets the correct + * profile and compatibility ID based on the tagged AVCodecParameters colorspace + * metadata, and the correct level based on the resolution and tagged framerate. + * + * `metadata` should point to the first frame's RPU, if available. If absent, + * auto-detection will be performed, but this can sometimes lead to inaccurate + * results (in particular for HEVC streams with enhancement layers). + * + * Returns 0 or a negative error code. + */ +int ff_dovi_configure_ext(DOVIContext *s, AVCodecParameters *codecpar, + const AVDOVIMetadata *metadata, + enum AVDOVICompression compression, + int strict_std_compliance); + +/** + * Helper wrapper around `ff_dovi_configure_ext` which infers the codec + * parameters from an AVCodecContext. + */ +int ff_dovi_configure(DOVIContext *s, AVCodecContext *avctx); + +enum { + FF_DOVI_WRAP_NAL = 1 << 0, ///< wrap inside NAL RBSP + FF_DOVI_WRAP_T35 = 1 << 1, ///< wrap inside T.35+EMDF + FF_DOVI_COMPRESS_RPU = 1 << 2, ///< enable compression for this RPU +}; + +/** + * Synthesize a Dolby Vision RPU reflecting the current state. By default, the + * RPU is not encapsulated (see `flags` for more options). Note that this + * assumes all previous calls to `ff_dovi_rpu_generate` have been + * appropriately signalled, i.e. it will not re-send already transmitted + * redundant data. + * + * Mutates the internal state of DOVIContext to reflect the change. + * Returns 0 or a negative error code. + */ +int ff_dovi_rpu_generate(DOVIContext *s, const AVDOVIMetadata *metadata, + int flags, uint8_t **out_rpu, int *out_size); + + +/*************************************************** + * The following section is for internal use only. * + ***************************************************/ + +enum { + RPU_COEFF_FIXED = 0, + RPU_COEFF_FLOAT = 1, +}; + +/** + * Internal helper function to guess the correct DV profile for HEVC. + * + * Returns the profile number or 0 if unknown. + */ +int ff_dovi_guess_profile_hevc(const AVDOVIRpuDataHeader *hdr); + +/* Default values for AVDOVIColorMetadata */ +extern const AVDOVIColorMetadata ff_dovi_color_default; + +static inline int ff_dovi_rpu_extension_is_static(int level) +{ + switch (level) { + case 6: + case 10: + case 32: /* reserved as static by spec */ + case 254: + case 255: + return 1; + default: + return 0; + } +} + +#endif /* AVCODEC_DOVI_RPU_H */ diff --git a/include/libavcodec/dsd.h b/include/libavcodec/dsd.h new file mode 100644 index 0000000..74da74f --- /dev/null +++ b/include/libavcodec/dsd.h @@ -0,0 +1,51 @@ +/* + * Direct Stream Digital (DSD) decoder + * based on BSD licensed dsd2pcm by Sebastian Gesemann + * Copyright (c) 2009, 2011 Sebastian Gesemann. All rights reserved. + * Copyright (c) 2014 Peter Ross + * + * 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_DSD_H +#define AVCODEC_DSD_H + +#include +#include + +#define HTAPS 48 /** number of FIR constants */ +#define FIFOSIZE 16 /** must be a power of two */ +#define FIFOMASK (FIFOSIZE - 1) /** bit mask for FIFO offsets */ + +#if FIFOSIZE * 8 < HTAPS * 2 +#error "FIFOSIZE too small" +#endif + +/** + * Per-channel buffer + */ +typedef struct DSDContext { + uint8_t buf[FIFOSIZE]; + unsigned pos; +} DSDContext; + +void ff_init_dsd_data(void); + +void ff_dsd2pcm_translate(DSDContext* s, size_t samples, int lsbf, + const uint8_t *src, ptrdiff_t src_stride, + float *dst, ptrdiff_t dst_stride); +#endif /* AVCODEC_DSD_H */ diff --git a/include/libavcodec/dv.h b/include/libavcodec/dv.h new file mode 100644 index 0000000..abff9f1 --- /dev/null +++ b/include/libavcodec/dv.h @@ -0,0 +1,74 @@ +/* + * Constants for DV codec + * Copyright (c) 2002 Fabrice Bellard + * + * 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 + */ + +/** + * @file + * Constants for DV codec. + */ + +#ifndef AVCODEC_DV_H +#define AVCODEC_DV_H + +enum DVSectionType { + DV_SECT_HEADER = 0x1f, + DV_SECT_SUBCODE = 0x3f, + DV_SECT_VAUX = 0x56, + DV_SECT_AUDIO = 0x76, + DV_SECT_VIDEO = 0x96, +}; + +enum DVPackType { + DV_HEADER525 = 0x3f, /* see dv_write_pack for important details on */ + DV_HEADER625 = 0xbf, /* these two packs */ + DV_TIMECODE = 0x13, + DV_AUDIO_SOURCE = 0x50, + DV_AUDIO_CONTROL = 0x51, + DV_AUDIO_RECDATE = 0x52, + DV_AUDIO_RECTIME = 0x53, + DV_VIDEO_SOURCE = 0x60, + DV_VIDEO_CONTROL = 0x61, + DV_VIDEO_RECDATE = 0x62, + DV_VIDEO_RECTIME = 0x63, + DV_UNKNOWN_PACK = 0xff, +}; + +#define DV_PROFILE_IS_HD(p) ((p)->video_stype & 0x10) +#define DV_PROFILE_IS_1080i50(p) (((p)->video_stype == 0x14) && ((p)->dsf == 1)) +#define DV_PROFILE_IS_1080i60(p) (((p)->video_stype == 0x14) && ((p)->dsf == 0)) +#define DV_PROFILE_IS_720p50(p) (((p)->video_stype == 0x18) && ((p)->dsf == 1)) + +/** + * largest possible DV frame, in bytes (1080i50) + */ +#define DV_MAX_FRAME_SIZE 576000 + +// LCM of video framerate numerators +#define DV_TIMESCALE_VIDEO 60000 + +// LCM of audio sample rates +#define DV_TIMESCALE_AUDIO 14112000 + +/** + * maximum number of blocks per macroblock in any DV format + */ +#define DV_MAX_BPM 8 + +#endif /* AVCODEC_DV_H */ diff --git a/include/libavcodec/dv_internal.h b/include/libavcodec/dv_internal.h new file mode 100644 index 0000000..05e26a8 --- /dev/null +++ b/include/libavcodec/dv_internal.h @@ -0,0 +1,62 @@ +/* + * DV encoder/decoder shared code + * Copyright (c) 2002 Fabrice Bellard + * + * 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_DV_INTERNAL_H +#define AVCODEC_DV_INTERNAL_H + +#include + +#include "dv.h" +#include "dv_profile.h" + +typedef struct DVwork_chunk { + uint16_t buf_offset; + uint16_t mb_coordinates[5]; +} DVwork_chunk; + +void ff_dv_init_dynamic_tables(DVwork_chunk *work_chunks, const AVDVProfile *d); + +static inline int dv_work_pool_size(const AVDVProfile *d) +{ + int size = d->n_difchan * d->difseg_size * 27; + if (DV_PROFILE_IS_1080i50(d)) + size -= 3 * 27; + if (DV_PROFILE_IS_720p50(d)) + size -= 4 * 27; + return size; +} + +static inline void dv_calculate_mb_xy(const AVDVProfile *sys, + const uint8_t *buf, + const DVwork_chunk *work_chunk, + int m, int *mb_x, int *mb_y) +{ + *mb_x = work_chunk->mb_coordinates[m] & 0xff; + *mb_y = work_chunk->mb_coordinates[m] >> 8; + + /* We work with 720p frames split in half. + * The odd half-frame (chan == 2,3) is displaced :-( */ + if (sys->height == 720 && !(buf[1] & 0x0C)) + /* shifting the Y coordinate down by 72/2 macro blocks */ + *mb_y -= (*mb_y > 17) ? 18 : -72; +} + +#endif // AVCODEC_DV_INTERNAL_H diff --git a/include/libavcodec/dv_profile_internal.h b/include/libavcodec/dv_profile_internal.h new file mode 100644 index 0000000..0ec3697 --- /dev/null +++ b/include/libavcodec/dv_profile_internal.h @@ -0,0 +1,36 @@ +/* + * 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_DV_PROFILE_INTERNAL_H +#define AVCODEC_DV_PROFILE_INTERNAL_H + +#include "avcodec.h" +#include "dv_profile.h" + +/** + * Print all allowed DV profiles into logctx at specified logging level. + */ +void ff_dv_print_profiles(void *logctx, int loglevel); + +/** + * Get a DV profile for the provided compressed frame. + */ +const AVDVProfile* ff_dv_frame_profile(AVCodecContext* codec, const AVDVProfile *sys, + const uint8_t *frame, unsigned buf_size); + +#endif /* AVCODEC_DV_PROFILE_INTERNAL_H */ diff --git a/include/libavcodec/dv_tablegen.h b/include/libavcodec/dv_tablegen.h new file mode 100644 index 0000000..7f0ab53 --- /dev/null +++ b/include/libavcodec/dv_tablegen.h @@ -0,0 +1,101 @@ +/* + * Header file for hardcoded DV tables + * + * Copyright (c) 2010 Reimar Döffinger + * + * 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_DV_TABLEGEN_H +#define AVCODEC_DV_TABLEGEN_H + +#include +#include "libavutil/attributes.h" + +#include "dvdata.h" + +#if CONFIG_SMALL +#define DV_VLC_MAP_RUN_SIZE 15 +#define DV_VLC_MAP_LEV_SIZE 23 +#else +#define DV_VLC_MAP_RUN_SIZE 64 +#define DV_VLC_MAP_LEV_SIZE 512 // FIXME sign was removed so this should be /2 but needs check +#endif + +/* VLC encoding lookup table */ +typedef struct dv_vlc_pair { + uint32_t vlc; + uint32_t size; +} dv_vlc_pair; + +#if CONFIG_HARDCODED_TABLES +#define dv_vlc_map_tableinit() +#include "libavcodec/dv_tables.h" +#else +static struct dv_vlc_pair dv_vlc_map[DV_VLC_MAP_RUN_SIZE][DV_VLC_MAP_LEV_SIZE]; + +static av_cold void dv_vlc_map_tableinit(void) +{ + uint32_t code = 0; + int i, j; + for (int i = 0; i < NB_DV_VLC; i++) { + uint32_t cur_code = code >> (32 - ff_dv_vlc_len[i]); + code += 1U << (32 - ff_dv_vlc_len[i]); + if (ff_dv_vlc_run[i] >= DV_VLC_MAP_RUN_SIZE) + continue; +#if CONFIG_SMALL + if (ff_dv_vlc_level[i] >= DV_VLC_MAP_LEV_SIZE) + continue; +#endif + + if (dv_vlc_map[ff_dv_vlc_run[i]][ff_dv_vlc_level[i]].size != 0) + continue; + + dv_vlc_map[ff_dv_vlc_run[i]][ff_dv_vlc_level[i]].vlc = + cur_code << (!!ff_dv_vlc_level[i]); + dv_vlc_map[ff_dv_vlc_run[i]][ff_dv_vlc_level[i]].size = + ff_dv_vlc_len[i] + (!!ff_dv_vlc_level[i]); + } + for (i = 0; i < DV_VLC_MAP_RUN_SIZE; i++) { +#if CONFIG_SMALL + for (j = 1; j < DV_VLC_MAP_LEV_SIZE; j++) { + if (dv_vlc_map[i][j].size == 0) { + dv_vlc_map[i][j].vlc = dv_vlc_map[0][j].vlc | + (dv_vlc_map[i - 1][0].vlc << + dv_vlc_map[0][j].size); + dv_vlc_map[i][j].size = dv_vlc_map[i - 1][0].size + + dv_vlc_map[0][j].size; + } + } +#else + for (j = 1; j < DV_VLC_MAP_LEV_SIZE / 2; j++) { + if (dv_vlc_map[i][j].size == 0) { + dv_vlc_map[i][j].vlc = dv_vlc_map[0][j].vlc | + (dv_vlc_map[i - 1][0].vlc << + dv_vlc_map[0][j].size); + dv_vlc_map[i][j].size = dv_vlc_map[i - 1][0].size + + dv_vlc_map[0][j].size; + } + dv_vlc_map[i][((uint16_t) (-j)) & 0x1ff].vlc = dv_vlc_map[i][j].vlc | 1; + dv_vlc_map[i][((uint16_t) (-j)) & 0x1ff].size = dv_vlc_map[i][j].size; + } +#endif + } +} +#endif /* CONFIG_HARDCODED_TABLES */ + +#endif /* AVCODEC_DV_TABLEGEN_H */ diff --git a/include/libavcodec/dvaudio.h b/include/libavcodec/dvaudio.h new file mode 100644 index 0000000..e7f70c5 --- /dev/null +++ b/include/libavcodec/dvaudio.h @@ -0,0 +1,39 @@ +/* + * 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_DVAUDIO_H +#define AVCODEC_DVAUDIO_H + +#include + +static inline int dv_get_audio_sample_count(const uint8_t *buffer, int dsf) +{ + int samples = buffer[0] & 0x3f; /* samples in this frame - min samples */ + + switch ((buffer[3] >> 3) & 0x07) { + case 0: + return samples + (dsf ? 1896 : 1580); + case 1: + return samples + (dsf ? 1742 : 1452); + case 2: + default: + return samples + (dsf ? 1264 : 1053); + } +} + +#endif /* AVCODEC_DVAUDIO_H */ diff --git a/include/libavcodec/dvbtxt.h b/include/libavcodec/dvbtxt.h new file mode 100644 index 0000000..ff88fcf --- /dev/null +++ b/include/libavcodec/dvbtxt.h @@ -0,0 +1,41 @@ +/* + * DVB teletext common functions. + * + * 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_DVBTXT_H +#define AVCODEC_DVBTXT_H + +#include "libavutil/attributes.h" + +/* Returns true if data identifier matches a teletext stream according to EN + * 301 775 section 4.4.2 */ +static av_always_inline int ff_data_identifier_is_teletext(int data_identifier) +{ + return (data_identifier >= 0x10 && data_identifier <= 0x1F || + data_identifier >= 0x99 && data_identifier <= 0x9B); +} + +/* Returns true if data unit id matches EBU teletext data according to + * EN 301 775 section 4.4.2 */ +static av_always_inline int ff_data_unit_id_is_teletext(int data_unit_id) +{ + return (data_unit_id == 0x02 || data_unit_id == 0x03); +} + +#endif /* AVCODEC_DVBTXT_H */ diff --git a/include/libavcodec/dvdata.h b/include/libavcodec/dvdata.h new file mode 100644 index 0000000..31191a8 --- /dev/null +++ b/include/libavcodec/dvdata.h @@ -0,0 +1,37 @@ +/* + * 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_DVDATA_H +#define AVCODEC_DVDATA_H + +#include + +extern const uint8_t ff_dv_zigzag248_direct[64]; + +extern const uint8_t ff_dv_quant_shifts[22][4]; +extern const uint8_t ff_dv_quant_offset[4]; + +#define NB_DV_VLC 409 +/* The number of entries with value zero in ff_dv_vlc_level. */ +#define NB_DV_ZERO_LEVEL_ENTRIES 72 + +extern const uint8_t ff_dv_vlc_len[NB_DV_VLC]; +extern const uint8_t ff_dv_vlc_run[NB_DV_VLC]; +extern const uint8_t ff_dv_vlc_level[NB_DV_VLC]; + +#endif /* AVCODEC_DVDATA_H */ diff --git a/include/libavcodec/dvdsub.h b/include/libavcodec/dvdsub.h new file mode 100644 index 0000000..3f51c3f --- /dev/null +++ b/include/libavcodec/dvdsub.h @@ -0,0 +1,26 @@ +/* + * 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_DVDSUB_H +#define AVCODEC_DVDSUB_H + +#include + +void ff_dvdsub_parse_palette(uint32_t *palette, const char *p); + +#endif /* AVCODEC_DVDSUB_H */ diff --git a/include/libavcodec/dxv.h b/include/libavcodec/dxv.h new file mode 100644 index 0000000..71cfdde --- /dev/null +++ b/include/libavcodec/dxv.h @@ -0,0 +1,34 @@ +/* + * Resolume DXV common + * Copyright (C) 2024 Connor Worley + * + * 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_DXV_H +#define AVCODEC_DXV_H + +#include "libavutil/macros.h" + +typedef enum DXVTextureFormat { + DXV_FMT_DXT1 = MKBETAG('D', 'X', 'T', '1'), + DXV_FMT_DXT5 = MKBETAG('D', 'X', 'T', '5'), + DXV_FMT_YCG6 = MKBETAG('Y', 'C', 'G', '6'), + DXV_FMT_YG10 = MKBETAG('Y', 'G', '1', '0'), +} DXVTextureFormat; + +#endif /* AVCODEC_DXV_H */ diff --git a/include/libavcodec/dxva2.h b/include/libavcodec/dxva2.h index 22c9399..bdec611 100755 --- a/include/libavcodec/dxva2.h +++ b/include/libavcodec/dxva2.h @@ -45,9 +45,6 @@ * @{ */ -#define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards -#define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO 2 ///< Work around for DXVA2 and old Intel GPUs with ClearVideo interface - /** * This structure is used to provides the necessary configurations and data * to the DXVA2 FFmpeg HWAccel implementation. diff --git a/include/libavcodec/dxva2_internal.h b/include/libavcodec/dxva2_internal.h new file mode 100644 index 0000000..224a867 --- /dev/null +++ b/include/libavcodec/dxva2_internal.h @@ -0,0 +1,194 @@ +/* + * DXVA2 HW acceleration + * + * copyright (c) 2010 Laurent Aimar + * + * 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_DXVA2_INTERNAL_H +#define AVCODEC_DXVA2_INTERNAL_H + +#define COBJMACROS + +#include "config.h" +#include "config_components.h" + +/* define the proper COM entries before forcing desktop APIs */ +#include + +#define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2/Direct3D11 and old UVD/UVD+ ATI video cards +#define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO 2 ///< Work around for DXVA2/Direct3D11 and old Intel GPUs with ClearVideo interface + +#if CONFIG_DXVA2 +#include "dxva2.h" +#include "libavutil/hwcontext_dxva2.h" +#define DXVA2_VAR(ctx, var) ctx->dxva2.var +#else +#define DXVA2_VAR(ctx, var) 0 +#endif + +#if CONFIG_D3D11VA +#include "d3d11va.h" +#include "libavutil/hwcontext_d3d11va.h" +#define D3D11VA_VAR(ctx, var) ctx->d3d11va.var +#else +#define D3D11VA_VAR(ctx, var) 0 +#endif + +#if CONFIG_D3D12VA +#include "d3d12va_decode.h" +#endif + +#if HAVE_DXVA_H +/* When targeting WINAPI_FAMILY_PHONE_APP or WINAPI_FAMILY_APP, dxva.h + * defines nothing. Force the struct definitions to be visible. */ +#undef WINAPI_FAMILY +#define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP +#undef _CRT_BUILD_DESKTOP_APP +#define _CRT_BUILD_DESKTOP_APP 0 +#include +#endif + +#include "libavutil/hwcontext.h" + +#include "avcodec.h" +#include "internal.h" + +typedef void DECODER_BUFFER_DESC; + +typedef union { +#if CONFIG_D3D11VA + struct AVD3D11VAContext d3d11va; +#endif +#if CONFIG_DXVA2 + struct dxva_context dxva2; +#endif +#if CONFIG_D3D12VA + struct D3D12VADecodeContext d3d12va; +#endif +} AVDXVAContext; + +typedef struct FFDXVASharedContext { + AVBufferRef *decoder_ref; + + // FF_DXVA2_WORKAROUND_* flags + uint64_t workaround; + + // E.g. AV_PIX_FMT_D3D11 (same as AVCodecContext.pix_fmt, except during init) + enum AVPixelFormat pix_fmt; + + AVHWDeviceContext *device_ctx; + +#if CONFIG_D3D11VA + ID3D11VideoDecoder *d3d11_decoder; + D3D11_VIDEO_DECODER_CONFIG d3d11_config; + ID3D11VideoDecoderOutputView **d3d11_views; + int nb_d3d11_views; + ID3D11Texture2D *d3d11_texture; +#endif + +#if CONFIG_DXVA2 + IDirectXVideoDecoder *dxva2_decoder; + IDirectXVideoDecoderService *dxva2_service; + DXVA2_ConfigPictureDecode dxva2_config; +#endif + + // Legacy (but used by code outside of setup) + // In generic mode, DXVA_CONTEXT() will return a pointer to this. + AVDXVAContext ctx; +} FFDXVASharedContext; + +#define DXVA_SHARED_CONTEXT(avctx) ((FFDXVASharedContext *)((avctx)->internal->hwaccel_priv_data)) + +#define DXVA_CONTEXT(avctx) (AVDXVAContext *)((avctx)->hwaccel_context ? (avctx)->hwaccel_context : (&(DXVA_SHARED_CONTEXT(avctx)->ctx))) + +#define D3D11VA_CONTEXT(ctx) (&ctx->d3d11va) +#define DXVA2_CONTEXT(ctx) (&ctx->dxva2) + +#define DXVA2_CONTEXT_VAR(avctx, ctx, var) (avctx->pix_fmt == AV_PIX_FMT_D3D12 ? 0 : (ff_dxva2_is_d3d11(avctx) ? D3D11VA_VAR(ctx, var) : DXVA2_VAR(ctx, var))) + +#define DXVA_CONTEXT_REPORT_ID(avctx, ctx) (*ff_dxva2_get_report_id(avctx, ctx)) +#define DXVA_CONTEXT_WORKAROUND(avctx, ctx) DXVA2_CONTEXT_VAR(avctx, ctx, workaround) +#define DXVA_CONTEXT_COUNT(avctx, ctx) DXVA2_CONTEXT_VAR(avctx, ctx, surface_count) +#define DXVA_CONTEXT_DECODER(avctx, ctx) (avctx->pix_fmt == AV_PIX_FMT_D3D12 ? 0 : (ff_dxva2_is_d3d11(avctx) ? (void *)D3D11VA_VAR(ctx, decoder) : (void *)DXVA2_VAR(ctx, decoder))) +#define DXVA_CONTEXT_CFG(avctx, ctx) (avctx->pix_fmt == AV_PIX_FMT_D3D12 ? 0 : (ff_dxva2_is_d3d11(avctx) ? (void *)D3D11VA_VAR(ctx, cfg) : (void *)DXVA2_VAR(ctx, cfg))) +#define DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) DXVA2_CONTEXT_VAR(avctx, ctx, cfg->ConfigBitstreamRaw) +#define DXVA_CONTEXT_CFG_INTRARESID(avctx, ctx) DXVA2_CONTEXT_VAR(avctx, ctx, cfg->ConfigIntraResidUnsigned) +#define DXVA_CONTEXT_CFG_RESIDACCEL(avctx, ctx) DXVA2_CONTEXT_VAR(avctx, ctx, cfg->ConfigResidDiffAccelerator) +#define DXVA_CONTEXT_VALID(avctx, ctx) (DXVA_CONTEXT_DECODER(avctx, ctx) && \ + DXVA_CONTEXT_CFG(avctx, ctx) && \ + (ff_dxva2_is_d3d11(avctx) || DXVA2_VAR(ctx, surface_count))) + +#if CONFIG_D3D12VA +unsigned ff_d3d12va_get_surface_index(const AVCodecContext *avctx, + D3D12VADecodeContext *ctx, const AVFrame *frame, + int curr); +#endif + +unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx, + AVDXVAContext *, const AVFrame *frame, int curr); + +int ff_dxva2_commit_buffer(AVCodecContext *, AVDXVAContext *, + DECODER_BUFFER_DESC *, + unsigned type, const void *data, unsigned size, + unsigned mb_count); + + +int ff_dxva2_common_end_frame(AVCodecContext *, AVFrame *, + const void *pp, unsigned pp_size, + const void *qm, unsigned qm_size, + int (*commit_bs_si)(AVCodecContext *, + DECODER_BUFFER_DESC *bs, + DECODER_BUFFER_DESC *slice)); + +int ff_dxva2_decode_init(AVCodecContext *avctx); + +int ff_dxva2_decode_uninit(AVCodecContext *avctx); + +int ff_dxva2_common_frame_params(AVCodecContext *avctx, + AVBufferRef *hw_frames_ctx); + +int ff_dxva2_is_d3d11(const AVCodecContext *avctx); + +unsigned *ff_dxva2_get_report_id(const AVCodecContext *avctx, AVDXVAContext *ctx); + +void ff_dxva2_h264_fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_PicParams_H264 *pp); + +void ff_dxva2_h264_fill_scaling_lists(const AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_Qmatrix_H264 *qm); + +void ff_dxva2_hevc_fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_PicParams_HEVC *pp); + +void ff_dxva2_hevc_fill_scaling_lists(const AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_Qmatrix_HEVC *qm); + +int ff_dxva2_vp9_fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_PicParams_VP9 *pp); + +#if CONFIG_AV1_D3D12VA_HWACCEL || CONFIG_AV1_D3D11VA_HWACCEL || CONFIG_AV1_D3D11VA2_HWACCEL || CONFIG_AV1_DXVA2_HWACCEL +int ff_dxva2_av1_fill_picture_parameters(const AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_PicParams_AV1 *pp); +#endif + +void ff_dxva2_mpeg2_fill_picture_parameters(AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_PictureParameters *pp); + +void ff_dxva2_mpeg2_fill_quantization_matrices(AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_QmatrixData *qm); + +void ff_dxva2_mpeg2_fill_slice(AVCodecContext *avctx, DXVA_SliceInfo *slice, unsigned position, const uint8_t *buffer, unsigned size); + +void ff_dxva2_vc1_fill_picture_parameters(AVCodecContext *avctx, AVDXVAContext *ctx, DXVA_PictureParameters *pp); + +void ff_dxva2_vc1_fill_slice(AVCodecContext *avctx, DXVA_SliceInfo *slice, unsigned position, unsigned size); + +#endif /* AVCODEC_DXVA2_INTERNAL_H */ diff --git a/include/libavcodec/dynamic_hdr_vivid.h b/include/libavcodec/dynamic_hdr_vivid.h new file mode 100644 index 0000000..d521b3d --- /dev/null +++ b/include/libavcodec/dynamic_hdr_vivid.h @@ -0,0 +1,35 @@ +/* + * 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_DYNAMIC_HDR_VIVID_H +#define AVCODEC_DYNAMIC_HDR_VIVID_H + +#include "libavutil/hdr_dynamic_vivid_metadata.h" + +/** + * Parse the user data registered ITU-T T.35 to AVbuffer (AVDynamicHDRVivid). + * @param s A pointer containing the decoded AVDynamicHDRVivid structure. + * @param data The byte array containing the raw ITU-T T.35 data. + * @param size Size of the data array in bytes. + * + * @return 0 if succeed. Otherwise, returns the appropriate AVERROR. + */ +int ff_parse_itu_t_t35_to_dynamic_hdr_vivid(AVDynamicHDRVivid *s, const uint8_t *data, + int size); + +#endif /* AVCODEC_DYNAMIC_HDR_VIVID_H */ diff --git a/include/libavcodec/eac3_data.h b/include/libavcodec/eac3_data.h new file mode 100644 index 0000000..10a67f1 --- /dev/null +++ b/include/libavcodec/eac3_data.h @@ -0,0 +1,36 @@ +/* + * E-AC-3 tables + * Copyright (c) 2007 Bartlomiej Wolowiec + * + * 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_EAC3_DATA_H +#define AVCODEC_EAC3_DATA_H + +#include + +extern const uint8_t ff_eac3_bits_vs_hebap[20]; +extern const int16_t ff_eac3_gaq_remap_1[12]; +extern const int16_t ff_eac3_gaq_remap_2_4_a[9][2]; +extern const int16_t ff_eac3_gaq_remap_2_4_b[9][2]; + +extern const int16_t (* const ff_eac3_mantissa_vq[8])[6]; +extern const uint8_t ff_eac3_frm_expstr[32][6]; +extern const float ff_eac3_spx_atten_tab[32][3]; + +#endif /* AVCODEC_EAC3_DATA_H */ diff --git a/include/libavcodec/eac3enc.h b/include/libavcodec/eac3enc.h new file mode 100644 index 0000000..0523de4 --- /dev/null +++ b/include/libavcodec/eac3enc.h @@ -0,0 +1,44 @@ +/* + * E-AC-3 encoder + * Copyright (c) 2011 Justin Ruggles + * + * 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 + */ + +/** + * @file + * E-AC-3 encoder + */ + +#ifndef AVCODEC_EAC3ENC_H +#define AVCODEC_EAC3ENC_H + +#include "ac3enc.h" + +/** + * Determine frame exponent strategy use and indices. + */ +void ff_eac3_get_frame_exp_strategy(AC3EncodeContext *s); + +/** + * Set coupling states. + * This determines whether certain flags must be written to the bitstream or + * whether they will be implicitly already known by the decoder. + */ +void ff_eac3_set_cpl_states(AC3EncodeContext *s); + +#endif /* AVCODEC_EAC3ENC_H */ diff --git a/include/libavcodec/eaidct.h b/include/libavcodec/eaidct.h new file mode 100644 index 0000000..a46dae9 --- /dev/null +++ b/include/libavcodec/eaidct.h @@ -0,0 +1,27 @@ +/* + * 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_EAIDCT_H +#define AVCODEC_EAIDCT_H + +#include +#include + +void ff_ea_idct_put_c(uint8_t *dest, ptrdiff_t linesize, int16_t *block); + +#endif /* AVCODEC_EAIDCT_H */ diff --git a/include/libavcodec/elbg.h b/include/libavcodec/elbg.h new file mode 100644 index 0000000..34d9684 --- /dev/null +++ b/include/libavcodec/elbg.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2007 Vitor Sessak + * + * 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_ELBG_H +#define AVCODEC_ELBG_H + +#include +#include "libavutil/lfg.h" + +struct ELBGContext; + +/** + * Implementation of the Enhanced LBG Algorithm + * Based on the paper "Neural Networks 14:1219-1237" that can be found in + * http://citeseer.ist.psu.edu/patan01enhanced.html . + * + * @param ctx A pointer to a pointer to an already allocated ELBGContext + * or a pointer to NULL. In the latter case, this function + * will allocate an ELBGContext and put a pointer to it in `*ctx`. + * @param points Input points. + * @param dim Dimension of the points. + * @param numpoints Num of points in **points. + * @param codebook Pointer to the output codebook. Must be allocated. + * @param num_cb Number of points in the codebook. + * @param num_steps The maximum number of steps. One step is already a good compromise between time and quality. + * @param closest_cb Return the closest codebook to each point. Must be allocated. + * @param rand_state A random number generator state. Should be already initialized by av_lfg_init(). + * @param flags Currently unused; must be set to 0. + * @return < 0 in case of error, 0 otherwise + */ +int avpriv_elbg_do(struct ELBGContext **ctx, int *points, int dim, + int numpoints, int *codebook, int num_cb, int num_steps, + int *closest_cb, AVLFG *rand_state, uintptr_t flags); + +/** + * Free an ELBGContext and reset the pointer to it. + */ +void avpriv_elbg_free(struct ELBGContext **ctx); + +#endif /* AVCODEC_ELBG_H */ diff --git a/include/libavcodec/elsdec.h b/include/libavcodec/elsdec.h new file mode 100644 index 0000000..139a24a --- /dev/null +++ b/include/libavcodec/elsdec.h @@ -0,0 +1,60 @@ +/* + * ELS (Entropy Logarithmic-Scale) decoder + * + * Copyright (c) 2013 Maxim Poliakovski + * + * 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 + */ + +/** + * @file + * Entropy Logarithmic-Scale binary arithmetic coder + */ + +#ifndef AVCODEC_ELSDEC_H +#define AVCODEC_ELSDEC_H + +#include +#include + +#define ELS_EXPGOLOMB_LEN 10 + +typedef struct ElsDecCtx { + const uint8_t *in_buf; + unsigned x; + size_t data_size; + int j, t, diff, err; +} ElsDecCtx; + +typedef struct ElsRungNode { + uint8_t rung; + uint16_t next_index; +} ElsRungNode; + +typedef struct ElsUnsignedRung { + uint8_t prefix_rung[ELS_EXPGOLOMB_LEN + 1]; + ElsRungNode *rem_rung_list; + size_t rung_list_size; + uint16_t avail_index; +} ElsUnsignedRung; + +void ff_els_decoder_init(ElsDecCtx *ctx, const uint8_t *in, size_t data_size); +void ff_els_decoder_uninit(ElsUnsignedRung *rung); +int ff_els_decode_bit(ElsDecCtx *ctx, unsigned char *rung); +unsigned ff_els_decode_unsigned(ElsDecCtx *ctx, ElsUnsignedRung *ur); + +#endif /* AVCODEC_ELSDEC_H */ diff --git a/include/libavcodec/encode.h b/include/libavcodec/encode.h new file mode 100644 index 0000000..85331e0 --- /dev/null +++ b/include/libavcodec/encode.h @@ -0,0 +1,99 @@ +/* + * generic encoding-related code + * + * 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_ENCODE_H +#define AVCODEC_ENCODE_H + +#include "libavutil/frame.h" + +#include "avcodec.h" +#include "packet.h" + +/** + * Used by some encoders as upper bound for the length of headers. + * TODO: Use proper codec-specific upper bounds. + */ +#define FF_INPUT_BUFFER_MIN_SIZE 16384 + +/** + * Called by encoders to get the next frame for encoding. + * + * @param frame An empty frame to be filled with data. + * @return 0 if a new reference has been successfully written to frame + * AVERROR(EAGAIN) if no data is currently available + * AVERROR_EOF if end of stream has been reached, so no more data + * will be available + */ +int ff_encode_get_frame(AVCodecContext *avctx, AVFrame *frame); + +/** + * Get a buffer for a packet. This is a wrapper around + * AVCodecContext.get_encode_buffer() and should be used instead calling get_encode_buffer() + * directly. + */ +int ff_get_encode_buffer(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int flags); + +/** + * Allocate buffers for a frame. Encoder equivalent to ff_get_buffer(). + */ +int ff_encode_alloc_frame(AVCodecContext *avctx, AVFrame *frame); + +/** + * Check AVPacket size and allocate data. + * + * Encoders of type FF_CODEC_CB_TYPE_ENCODE can use this as a convenience to + * obtain a big enough buffer for the encoded bitstream. + * + * @param avctx the AVCodecContext of the encoder + * @param avpkt The AVPacket: on success, avpkt->data will point to a buffer + * of size at least `size`; the packet will not be refcounted. + * This packet must be initially blank. + * @param size an upper bound of the size of the packet to encode + * @return non negative on success, negative error code on failure + */ +int ff_alloc_packet(AVCodecContext *avctx, AVPacket *avpkt, int64_t size); + +/** + * Propagate user opaque values from the frame to avctx/pkt as needed. + */ +int ff_encode_reordered_opaque(AVCodecContext *avctx, + AVPacket *pkt, const AVFrame *frame); + +int ff_encode_encode_cb(AVCodecContext *avctx, AVPacket *avpkt, + AVFrame *frame, int *got_packet); + +/** + * Add a CPB properties side data to an encoding context. + */ +AVCPBProperties *ff_encode_add_cpb_side_data(AVCodecContext *avctx); + +/** + * Rescale from sample rate to AVCodecContext.time_base. + */ +static av_always_inline int64_t ff_samples_to_time_base(const AVCodecContext *avctx, + int64_t samples) +{ + if (samples == AV_NOPTS_VALUE) + return AV_NOPTS_VALUE; + return av_rescale_q(samples, (AVRational){ 1, avctx->sample_rate }, + avctx->time_base); +} + +#endif /* AVCODEC_ENCODE_H */ diff --git a/include/libavcodec/error_resilience.h b/include/libavcodec/error_resilience.h new file mode 100644 index 0000000..a1b9b9e --- /dev/null +++ b/include/libavcodec/error_resilience.h @@ -0,0 +1,107 @@ +/* + * 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_ERROR_RESILIENCE_H +#define AVCODEC_ERROR_RESILIENCE_H + +#include +#include + +#include "avcodec.h" +#include "me_cmp.h" + +///< current MB is the first after a resync marker +#define VP_START 1 +#define ER_AC_ERROR 2 +#define ER_DC_ERROR 4 +#define ER_MV_ERROR 8 +#define ER_AC_END 16 +#define ER_DC_END 32 +#define ER_MV_END 64 + +#define ER_MB_ERROR (ER_AC_ERROR|ER_DC_ERROR|ER_MV_ERROR) +#define ER_MB_END (ER_AC_END|ER_DC_END|ER_MV_END) + +typedef struct ERPicture { + AVFrame *f; + const struct ThreadFrame *tf; + const struct ThreadProgress *progress; + + // it is the caller's responsibility to allocate these buffers + int16_t (*motion_val[2])[2]; + int8_t *ref_index[2]; + + uint32_t *mb_type; + int field_picture; +} ERPicture; + +typedef struct ERContext { + AVCodecContext *avctx; + + me_cmp_func sad; + int mecc_inited; + + int *mb_index2xy; + int mb_num; + int mb_width, mb_height; + ptrdiff_t mb_stride; + ptrdiff_t b8_stride; + + atomic_int error_count; + int error_occurred; + uint8_t *error_status_table; + uint8_t *er_temp_buffer; + int16_t *dc_val[3]; + uint8_t *mbskip_table; + uint8_t *mbintra_table; + int mv[2][4][2]; + + ERPicture cur_pic; + ERPicture last_pic; + ERPicture next_pic; + + int8_t *ref_index[2]; + int16_t (*motion_val_base[2])[2]; + + uint16_t pp_time; + uint16_t pb_time; + int quarter_sample; + int partitioned_frame; + + void (*decode_mb)(void *opaque, int ref, int mv_dir, int mv_type, + int (*mv)[2][4][2], + int mb_x, int mb_y, int mb_intra, int mb_skipped); + void *opaque; +} ERContext; + +void ff_er_frame_start(ERContext *s); + +/** + * Indicate that a frame has finished decoding and perform error concealment + * in case it has been enabled and is necessary and supported. + * + * @param s ERContext in use + * @param decode_error_flags pointer where updated decode_error_flags are written + * if supplied; if not, the new flags are directly + * applied to the AVFrame whose errors are concealed + */ +void ff_er_frame_end(ERContext *s, int *decode_error_flags); +void ff_er_add_slice(ERContext *s, int startx, int starty, int endx, int endy, + int status); + +#endif /* AVCODEC_ERROR_RESILIENCE_H */ diff --git a/include/libavcodec/evc.h b/include/libavcodec/evc.h new file mode 100644 index 0000000..d68dc74 --- /dev/null +++ b/include/libavcodec/evc.h @@ -0,0 +1,146 @@ +/* + * EVC definitions and enums + * Copyright (c) 2022 Dawid Kozinski + * + * 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_EVC_H +#define AVCODEC_EVC_H + +// The length field that indicates the length in bytes of the following NAL unit is configured to be of 4 bytes +#define EVC_NALU_LENGTH_PREFIX_SIZE (4) /* byte */ +#define EVC_NALU_HEADER_SIZE (2) /* byte */ + +/** + * @see ISO_IEC_23094-1_2020, 7.4.2.2 NAL unit header semantic + * Table 4 - NAL unit type codes and NAL unit type classes + */ +enum EVCNALUnitType { + EVC_NOIDR_NUT = 0, /* Coded slice of a non-IDR picture */ + EVC_IDR_NUT = 1, /* Coded slice of an IDR picture */ + EVC_RSV_VCL_NUT02 = 2, + EVC_RSV_VCL_NUT03 = 3, + EVC_RSV_VCL_NUT04 = 4, + EVC_RSV_VCL_NUT05 = 5, + EVC_RSV_VCL_NUT06 = 6, + EVC_RSV_VCL_NUT07 = 7, + EVC_RSV_VCL_NUT08 = 8, + EVC_RSV_VCL_NUT09 = 9, + EVC_RSV_VCL_NUT10 = 10, + EVC_RSV_VCL_NUT11 = 11, + EVC_RSV_VCL_NUT12 = 12, + EVC_RSV_VCL_NUT13 = 13, + EVC_RSV_VCL_NUT14 = 14, + EVC_RSV_VCL_NUT15 = 15, + EVC_RSV_VCL_NUT16 = 16, + EVC_RSV_VCL_NUT17 = 17, + EVC_RSV_VCL_NUT18 = 18, + EVC_RSV_VCL_NUT19 = 19, + EVC_RSV_VCL_NUT20 = 20, + EVC_RSV_VCL_NUT21 = 21, + EVC_RSV_VCL_NUT22 = 22, + EVC_RSV_VCL_NUT23 = 23, + EVC_SPS_NUT = 24, /* Sequence parameter set */ + EVC_PPS_NUT = 25, /* Picture paremeter set */ + EVC_APS_NUT = 26, /* Adaptation parameter set */ + EVC_FD_NUT = 27, /* Filler data */ + EVC_SEI_NUT = 28, /* Supplemental enhancement information */ + EVC_RSV_NONVCL29 = 29, + EVC_RSV_NONVCL30 = 30, + EVC_RSV_NONVCL31 = 31, + EVC_RSV_NONVCL32 = 32, + EVC_RSV_NONVCL33 = 33, + EVC_RSV_NONVCL34 = 34, + EVC_RSV_NONVCL35 = 35, + EVC_RSV_NONVCL36 = 36, + EVC_RSV_NONVCL37 = 37, + EVC_RSV_NONVCL38 = 38, + EVC_RSV_NONVCL39 = 39, + EVC_RSV_NONVCL40 = 40, + EVC_RSV_NONVCL41 = 41, + EVC_RSV_NONVCL42 = 42, + EVC_RSV_NONVCL43 = 43, + EVC_RSV_NONVCL44 = 44, + EVC_RSV_NONVCL45 = 45, + EVC_RSV_NONVCL46 = 46, + EVC_RSV_NONVCL47 = 47, + EVC_RSV_NONVCL48 = 48, + EVC_RSV_NONVCL49 = 49, + EVC_RSV_NONVCL50 = 50, + EVC_RSV_NONVCL51 = 51, + EVC_RSV_NONVCL52 = 52, + EVC_RSV_NONVCL53 = 53, + EVC_RSV_NONVCL54 = 54, + EVC_RSV_NONVCL55 = 55, + EVC_UNSPEC_NUT56 = 56, + EVC_UNSPEC_NUT57 = 57, + EVC_UNSPEC_NUT58 = 58, + EVC_UNSPEC_NUT59 = 59, + EVC_UNSPEC_NUT60 = 60, + EVC_UNSPEC_NUT61 = 61, + EVC_UNSPEC_NUT62 = 62 +}; + +// slice type +// @see ISO_IEC_23094-1_2020 7.4.5 Slice header semantics +// +enum EVCSliceType { + EVC_SLICE_TYPE_B = 0, + EVC_SLICE_TYPE_P = 1, + EVC_SLICE_TYPE_I = 2 +}; + +enum { + // 7.4.3.1: sps_seq_parameter_set_id is in [0, 15]. + EVC_MAX_SPS_COUNT = 16, + + // 7.4.3.2: pps_pic_parameter_set_id is in [0, 63]. + EVC_MAX_PPS_COUNT = 64, + + // 7.4.3.3: adaptional_parameter_set_id is in [0, 31]. + EVC_MAX_APS_COUNT = 32, + + // 7.4.5: slice header slice_pic_parameter_set_id in [0, 63] + EVC_MAX_SH_COUNT = 64, + + // E.3.2: cpb_cnt_minus1[i] is in [0, 31]. + EVC_MAX_CPB_CNT = 32, + + // A.4.1: in table A.1 the highest level allows a MaxLumaPs of 35 651 584. + EVC_MAX_LUMA_PS = 35651584, + + EVC_MAX_NUM_REF_PICS = 21, + + EVC_MAX_NUM_RPLS = 64, + + // A.4.1: pic_width_in_luma_samples and pic_height_in_luma_samples are + // constrained to be not greater than sqrt(MaxLumaPs * 8). Hence height/ + // width are bounded above by sqrt(8 * 35651584) = 16888.2 samples. + EVC_MAX_WIDTH = 16888, + EVC_MAX_HEIGHT = 16888, + + // A.4.1: table A.1 allows at most 22 tile rows for any level. + EVC_MAX_TILE_ROWS = 22, + // A.4.1: table A.1 allows at most 20 tile columns for any level. + EVC_MAX_TILE_COLUMNS = 20, + + // A.4.1: table A.1 allows at most 600 slice segments for any level. + EVC_MAX_SLICE_SEGMENTS = 600, +}; + +#endif // AVCODEC_EVC_H diff --git a/include/libavcodec/evc_parse.h b/include/libavcodec/evc_parse.h new file mode 100644 index 0000000..4712310 --- /dev/null +++ b/include/libavcodec/evc_parse.h @@ -0,0 +1,105 @@ +/* + * 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 + */ + +/** + * @file + * EVC decoder/parser shared code + */ + +#ifndef AVCODEC_EVC_PARSE_H +#define AVCODEC_EVC_PARSE_H + +#include + +#include "libavutil/intreadwrite.h" +#include "libavutil/log.h" +#include "evc.h" +#include "evc_ps.h" + +// The sturcture reflects Slice Header RBSP(raw byte sequence payload) layout +// @see ISO_IEC_23094-1 section 7.3.2.6 +// +// The following descriptors specify the parsing process of each element +// u(n) - unsigned integer using n bits +// ue(v) - unsigned integer 0-th order Exp_Golomb-coded syntax element with the left bit first +// u(n) - unsigned integer using n bits. +// When n is "v" in the syntax table, the number of bits varies in a manner dependent on the value of other syntax elements. +typedef struct EVCParserSliceHeader { + uint8_t slice_pic_parameter_set_id; // ue(v) + uint8_t single_tile_in_slice_flag; // u(1) + uint8_t first_tile_id; // u(v) + uint8_t arbitrary_slice_flag; // u(1) + uint8_t last_tile_id; // u(v) + uint32_t num_remaining_tiles_in_slice_minus1; // ue(v) + uint16_t delta_tile_id_minus1[EVC_MAX_TILE_ROWS * EVC_MAX_TILE_COLUMNS]; // ue(v) + + uint8_t slice_type; // ue(v) + uint8_t no_output_of_prior_pics_flag; // u(1) + uint8_t mmvd_group_enable_flag; // u(1) + uint8_t slice_alf_enabled_flag; // u(1) + + uint8_t slice_alf_luma_aps_id; // u(5) + uint8_t slice_alf_map_flag; // u(1) + uint8_t slice_alf_chroma_idc; // u(2) + uint8_t slice_alf_chroma_aps_id; // u(5) + uint8_t slice_alf_chroma_map_flag; // u(1) + uint8_t slice_alf_chroma2_aps_id; // u(5) + uint8_t slice_alf_chroma2_map_flag; // u(1) + uint16_t slice_pic_order_cnt_lsb; // u(v) + + // @note + // Currently the structure does not reflect the entire Slice Header RBSP layout. + // It contains only the fields that are necessary to read from the NAL unit all the values + // necessary for the correct initialization of the AVCodecContext structure. + + // @note + // If necessary, add the missing fields to the structure to reflect + // the contents of the entire NAL unit of the SPS type + +} EVCParserSliceHeader; + +// picture order count of the current picture +typedef struct EVCParserPoc { + int PicOrderCntVal; // current picture order count value + int prevPicOrderCntVal; // the picture order count of the previous Tid0 picture + int DocOffset; // the decoding order count of the previous picture +} EVCParserPoc; + +static inline uint32_t evc_read_nal_unit_length(const uint8_t *bits, int bits_size, void *logctx) +{ + uint32_t nalu_len = 0; + + if (bits_size < EVC_NALU_LENGTH_PREFIX_SIZE) { + av_log(logctx, AV_LOG_ERROR, "Can't read NAL unit length\n"); + return 0; + } + + nalu_len = AV_RB32(bits); + + return nalu_len; +} + +int ff_evc_parse_slice_header(GetBitContext *gb, EVCParserSliceHeader *sh, + const EVCParamSets *ps, enum EVCNALUnitType nalu_type); + +// POC (picture order count of the current picture) derivation +// @see ISO/IEC 23094-1:2020(E) 8.3.1 Decoding process for picture order count +int ff_evc_derive_poc(const EVCParamSets *ps, const EVCParserSliceHeader *sh, + EVCParserPoc *poc, enum EVCNALUnitType nalu_type, int tid); + +#endif /* AVCODEC_EVC_PARSE_H */ diff --git a/include/libavcodec/evc_ps.h b/include/libavcodec/evc_ps.h new file mode 100644 index 0000000..336953b --- /dev/null +++ b/include/libavcodec/evc_ps.h @@ -0,0 +1,224 @@ +/* + * 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 + */ + +/** + * @file + * EVC decoder/parser shared code + */ + +#ifndef AVCODEC_EVC_PS_H +#define AVCODEC_EVC_PS_H + +#include + +#include "evc.h" +#include "get_bits.h" + +#define EVC_MAX_QP_TABLE_SIZE 58 +#define NUM_CPB 32 + +// rpl structure +typedef struct RefPicListStruct { + uint32_t ref_pic_num; + uint32_t ref_pics[EVC_MAX_NUM_REF_PICS]; +} RefPicListStruct; + +// chromaQP table structure to be signalled in SPS +typedef struct ChromaQpTable { + uint8_t chroma_qp_table_present_flag; // u(1) + uint8_t same_qp_table_for_chroma; // u(1) + uint8_t global_offset_flag; // u(1) + uint8_t num_points_in_qp_table_minus1[2]; // ue(v) + uint8_t delta_qp_in_val_minus1[2][EVC_MAX_QP_TABLE_SIZE]; // u(6) + int delta_qp_out_val[2][EVC_MAX_QP_TABLE_SIZE]; // se(v) +} ChromaQpTable; + +// Hypothetical Reference Decoder (HRD) parameters, part of VUI +typedef struct HRDParameters { + uint8_t cpb_cnt_minus1; // ue(v) + uint8_t bit_rate_scale; // u(4) + uint8_t cpb_size_scale; // u(4) + uint32_t bit_rate_value_minus1[NUM_CPB]; // ue(v) + uint32_t cpb_size_value_minus1[NUM_CPB]; // ue(v) + uint8_t cbr_flag[NUM_CPB]; // u(1) + uint8_t initial_cpb_removal_delay_length_minus1; // u(5) + uint8_t cpb_removal_delay_length_minus1; // u(5) + uint8_t dpb_output_delay_length_minus1; // u(5) + uint8_t time_offset_length; // u(5) +} HRDParameters; + +// video usability information (VUI) part of SPS +typedef struct VUIParameters { + uint8_t aspect_ratio_info_present_flag; // u(1) + uint8_t aspect_ratio_idc; // u(8) + uint16_t sar_width; // u(16) + uint16_t sar_height; // u(16) + uint8_t overscan_info_present_flag; // u(1) + uint8_t overscan_appropriate_flag; // u(1) + uint8_t video_signal_type_present_flag; // u(1) + uint8_t video_format; // u(3) + uint8_t video_full_range_flag; // u(1) + uint8_t colour_description_present_flag; // u(1) + uint8_t colour_primaries; // u(8) + uint8_t transfer_characteristics; // u(8) + uint8_t matrix_coefficients; // u(8) + uint8_t chroma_loc_info_present_flag; // u(1) + uint8_t chroma_sample_loc_type_top_field; // ue(v) + uint8_t chroma_sample_loc_type_bottom_field; // ue(v) + uint8_t neutral_chroma_indication_flag; // u(1) + uint8_t field_seq_flag; // u(1) + uint8_t timing_info_present_flag; // u(1) + uint32_t num_units_in_tick; // u(32) + uint32_t time_scale; // u(32) + uint8_t fixed_pic_rate_flag; // u(1) + uint8_t nal_hrd_parameters_present_flag; // u(1) + uint8_t vcl_hrd_parameters_present_flag; // u(1) + uint8_t low_delay_hrd_flag; // u(1) + uint8_t pic_struct_present_flag; // u(1) + uint8_t bitstream_restriction_flag; // u(1) + uint8_t motion_vectors_over_pic_boundaries_flag; // u(1) + uint8_t max_bytes_per_pic_denom; // ue(v) + uint8_t max_bits_per_mb_denom; // ue(v) + uint8_t log2_max_mv_length_horizontal; // ue(v) + uint8_t log2_max_mv_length_vertical; // ue(v) + uint32_t num_reorder_pics; // ue(v) + uint32_t max_dec_pic_buffering; // ue(v) + + HRDParameters hrd_parameters; +} VUIParameters; + +// The sturcture reflects SPS RBSP(raw byte sequence payload) layout +// @see ISO_IEC_23094-1 section 7.3.2.1 +// +// The following descriptors specify the parsing process of each element +// u(n) - unsigned integer using n bits +// ue(v) - unsigned integer 0-th order Exp_Golomb-coded syntax element with the left bit first +typedef struct EVCParserSPS { + uint8_t sps_seq_parameter_set_id; // ue(v) + uint8_t profile_idc; // u(8) + uint8_t level_idc; // u(8) + uint32_t toolset_idc_h; // u(32) + uint32_t toolset_idc_l; // u(32) + uint8_t chroma_format_idc; // ue(v) + uint32_t pic_width_in_luma_samples; // ue(v) + uint32_t pic_height_in_luma_samples; // ue(v) + uint8_t bit_depth_luma_minus8; // ue(v) + uint8_t bit_depth_chroma_minus8; // ue(v) + + uint8_t sps_btt_flag; // u(1) + uint32_t log2_ctu_size_minus2; // ue(v) + uint32_t log2_min_cb_size_minus2; // ue(v) + uint32_t log2_diff_ctu_max_14_cb_size; // ue(v) + uint32_t log2_diff_ctu_max_tt_cb_size; // ue(v) + uint32_t log2_diff_min_cb_min_tt_cb_size_minus2; // ue(v) + + uint8_t sps_suco_flag; // u(1) + uint32_t log2_diff_ctu_size_max_suco_cb_size; // ue(v) + uint32_t log2_diff_max_suco_min_suco_cb_size; // ue(v) + + uint8_t sps_admvp_flag; // u(1) + uint8_t sps_affine_flag; // u(1) + uint8_t sps_amvr_flag; // u(1) + uint8_t sps_dmvr_flag; // u(1) + uint8_t sps_mmvd_flag; // u(1) + uint8_t sps_hmvp_flag; // u(1) + + uint8_t sps_eipd_flag; // u(1) + uint8_t sps_ibc_flag; // u(1) + uint32_t log2_max_ibc_cand_size_minus2; // ue(v) + + uint8_t sps_cm_init_flag; // u(1) + uint8_t sps_adcc_flag; // u(1) + + uint8_t sps_iqt_flag; // u(1) + uint8_t sps_ats_flag; // u(1) + + uint8_t sps_addb_flag; // u(1) + uint8_t sps_alf_flag; // u(1) + uint8_t sps_htdf_flag; // u(1) + uint8_t sps_rpl_flag; // u(1) + uint8_t sps_pocs_flag; // u(1) + uint8_t sps_dquant_flag; // u(1) + uint8_t sps_dra_flag; // u(1) + + uint32_t log2_max_pic_order_cnt_lsb_minus4; // ue(v) + uint32_t log2_sub_gop_length; // ue(v) + uint32_t log2_ref_pic_gap_length; // ue(v) + + uint8_t max_num_tid0_ref_pics; // ue(v) + + uint32_t sps_max_dec_pic_buffering_minus1; // ue(v) + uint8_t long_term_ref_pic_flag; // u(1) + uint8_t rpl1_same_as_rpl0_flag; // u(1) + uint8_t num_ref_pic_list_in_sps[2]; // ue(v) + struct RefPicListStruct rpls[2][EVC_MAX_NUM_RPLS]; + + uint8_t picture_cropping_flag; // u(1) + uint32_t picture_crop_left_offset; // ue(v) + uint32_t picture_crop_right_offset; // ue(v) + uint32_t picture_crop_top_offset; // ue(v) + uint32_t picture_crop_bottom_offset; // ue(v) + + struct ChromaQpTable chroma_qp_table_struct; + + uint8_t vui_parameters_present_flag; // u(1) + + struct VUIParameters vui_parameters; + +} EVCParserSPS; + +typedef struct EVCParserPPS { + uint8_t pps_pic_parameter_set_id; // ue(v) + uint8_t pps_seq_parameter_set_id; // ue(v) + uint8_t num_ref_idx_default_active_minus1[2]; // ue(v) + uint8_t additional_lt_poc_lsb_len; // ue(v) + uint8_t rpl1_idx_present_flag; // u(1) + uint8_t single_tile_in_pic_flag; // u(1) + uint32_t num_tile_columns_minus1; // ue(v) + uint32_t num_tile_rows_minus1; // ue(v) + uint8_t uniform_tile_spacing_flag; // u(1) + uint32_t tile_column_width_minus1[EVC_MAX_TILE_COLUMNS]; // ue(v) + uint32_t tile_row_height_minus1[EVC_MAX_TILE_ROWS]; // ue(v) + uint8_t loop_filter_across_tiles_enabled_flag; // u(1) + uint32_t tile_offset_len_minus1; // ue(v) + uint8_t tile_id_len_minus1; // ue(v) + uint8_t explicit_tile_id_flag; // u(1) + uint32_t tile_id_val[EVC_MAX_TILE_ROWS][EVC_MAX_TILE_COLUMNS]; // u(v) + uint8_t pic_dra_enabled_flag; // u(1) + uint8_t pic_dra_aps_id; // u(5) + uint8_t arbitrary_slice_present_flag; // u(1) + uint8_t constrained_intra_pred_flag; // u(1) + uint8_t cu_qp_delta_enabled_flag; // u(1) + uint32_t log2_cu_qp_delta_area_minus6; // ue(v) + +} EVCParserPPS; + +typedef struct EVCParamSets { + EVCParserSPS *sps[EVC_MAX_SPS_COUNT]; + EVCParserPPS *pps[EVC_MAX_PPS_COUNT]; +} EVCParamSets; + +// @see ISO_IEC_23094-1 (7.3.2.1 SPS RBSP syntax) +int ff_evc_parse_sps(GetBitContext *gb, EVCParamSets *ps); + +// @see ISO_IEC_23094-1 (7.3.2.2 SPS RBSP syntax) +int ff_evc_parse_pps(GetBitContext *gb, EVCParamSets *ps); + +void ff_evc_ps_free(EVCParamSets *ps); + +#endif /* AVCODEC_EVC_PS_H */ diff --git a/include/libavcodec/evrcdata.h b/include/libavcodec/evrcdata.h new file mode 100644 index 0000000..8cfc202 --- /dev/null +++ b/include/libavcodec/evrcdata.h @@ -0,0 +1,1499 @@ +/* + * Enhanced Variable Rate Codec, Service Option 3 decoder + * Copyright (c) 2013 Paul B Mahol + * + * 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_EVRCDATA_H +#define AVCODEC_EVRCDATA_H + +/** + * @file + * Data tables for the EVRC decoder + * @author Paul B Mahol + */ + +#include "libavutil/common.h" + +/** + * Rate 1/8 frame energy quantization + * + * TIA/IS-127 table 8-18 + */ +static const float evrc_energy_quant[][3] = { +{-0.2464E-01,-0.4005E-02,-0.1107E+00 }, { 0.8734E+00, 0.1004E+01, 0.9930E+00 }, +{ 0.4222E+00, 0.3894E+00, 0.5020E+00 }, { 0.1450E+01, 0.1328E+01, 0.1278E+01 }, +{ 0.1957E+00, 0.2169E+00, 0.2735E+00 }, { 0.1142E+01, 0.1240E+01, 0.1157E+01 }, +{ 0.7881E+00, 0.6778E+00, 0.4185E+00 }, { 0.1504E+01, 0.1468E+01, 0.1534E+01 }, +{ 0.3173E+00, 0.2693E+00,-0.9526E-01 }, { 0.1141E+01, 0.1154E+01, 0.1044E+01 }, +{ 0.5147E+00, 0.5784E+00, 0.8802E+00 }, { 0.1502E+01, 0.1407E+01, 0.1409E+01 }, +{ 0.3163E+00, 0.3592E+00, 0.2830E+00 }, { 0.1217E+01, 0.1213E+01, 0.1216E+01 }, +{ 0.1023E+01, 0.1139E+01,-0.9526E-01 }, { 0.1619E+01, 0.1655E+01, 0.1642E+01 }, +{ 0.1437E+00, 0.1505E+00, 0.6838E-01 }, { 0.9794E+00, 0.1021E+01, 0.1117E+01 }, +{ 0.4701E+00, 0.6426E+00, 0.5519E+00 }, { 0.1366E+01, 0.1397E+01, 0.1406E+01 }, +{ 0.2918E+00, 0.3022E+00, 0.2420E+00 }, { 0.1309E+01, 0.1241E+01, 0.1220E+01 }, +{ 0.7989E+00, 0.7654E+00, 0.7391E+00 }, { 0.1612E+01, 0.1502E+01, 0.1447E+01 }, +{ 0.2594E+00, 0.1948E+00, 0.2555E+00 }, { 0.1091E+01, 0.1150E+01, 0.1272E+01 }, +{ 0.3423E+00, 0.4150E+00, 0.1294E+01 }, { 0.1729E+01, 0.1377E+01, 0.1065E+01 }, +{ 0.4103E+00, 0.3287E+00, 0.3228E+00 }, { 0.1144E+01, 0.1281E+01, 0.1416E+01 }, +{ 0.1047E+01, 0.1117E+01, 0.6188E+00 }, { 0.1914E+01, 0.1777E+01, 0.1516E+01 }, +{-0.2117E-01, 0.2159E+00, 0.2351E+00 }, { 0.1093E+01, 0.1088E+01, 0.1026E+01 }, +{ 0.5567E+00, 0.5092E+00, 0.4654E+00 }, { 0.1510E+01, 0.1449E+01, 0.1201E+01 }, +{ 0.2362E+00, 0.3426E+00, 0.2549E+00 }, { 0.1340E+01, 0.1225E+01, 0.1117E+01 }, +{ 0.1203E+01, 0.3819E+00, 0.2269E+00 }, { 0.1373E+01, 0.1404E+01, 0.1830E+01 }, +{ 0.2570E+00, 0.2668E+00, 0.1636E+00 }, { 0.1219E+01, 0.1098E+01, 0.1122E+01 }, +{ 0.6985E+00, 0.8456E+00, 0.1069E+01 }, { 0.1550E+01, 0.1501E+01, 0.1388E+01 }, +{ 0.2870E+00, 0.3060E+00, 0.3599E+00 }, { 0.1178E+01, 0.1345E+01, 0.1302E+01 }, +{ 0.1270E+01, 0.1215E+01, 0.1812E+00 }, { 0.1725E+01, 0.1777E+01, 0.1693E+01 }, +{ 0.2074E+00, 0.2104E+00, 0.1539E+00 }, { 0.1105E+01, 0.1034E+01, 0.1104E+01 }, +{ 0.6683E+00, 0.6646E+00, 0.6639E+00 }, { 0.1403E+01, 0.1462E+01, 0.1435E+01 }, +{ 0.3389E+00, 0.3754E+00, 0.2150E+00 }, { 0.1288E+01, 0.1325E+01, 0.1257E+01 }, +{ 0.8933E+00, 0.8253E+00, 0.8133E+00 }, { 0.1555E+01, 0.1579E+01, 0.1565E+01 }, +{ 0.3264E+00, 0.2434E+00, 0.2852E+00 }, { 0.1242E+01, 0.1180E+01, 0.1202E+01 }, +{ 0.1314E+00, 0.1698E+00, 0.1646E+01 }, { 0.1797E+01, 0.1597E+01, 0.1241E+01 }, +{ 0.4721E+00, 0.5346E+00, 0.3066E+00 }, { 0.1274E+01, 0.1401E+01, 0.1351E+01 }, +{ 0.1455E+01, 0.1386E+01, 0.6430E+00 }, { 0.1828E+01, 0.1867E+01, 0.1825E+01 }, +{-0.3265E+00,-0.2956E+00,-0.2462E+00 }, { 0.1035E+01, 0.1020E+01, 0.1003E+01 }, +{ 0.3702E+00, 0.4307E+00, 0.7072E+00 }, { 0.1424E+01, 0.1345E+01, 0.1352E+01 }, +{ 0.2267E+00, 0.2680E+00, 0.3037E+00 }, { 0.1235E+01, 0.1249E+01, 0.1146E+01 }, +{ 0.9944E+00, 0.6485E+00, 0.5248E+00 }, { 0.1539E+01, 0.1492E+01, 0.1612E+01 }, +{ 0.3815E+00, 0.3360E+00,-0.9526E-01 }, { 0.1163E+01, 0.1144E+01, 0.1117E+01 }, +{ 0.6734E+00, 0.7656E+00, 0.1014E+01 }, { 0.1568E+01, 0.1438E+01, 0.1455E+01 }, +{ 0.3409E+00, 0.3317E+00, 0.3856E+00 }, { 0.1180E+01, 0.1284E+01, 0.1284E+01 }, +{ 0.1244E+01, 0.1214E+01,-0.9526E-01 }, { 0.1753E+01, 0.1598E+01, 0.1744E+01 }, +{ 0.1548E+00, 0.1388E+00, 0.2020E+00 }, { 0.1027E+01, 0.1133E+01, 0.1093E+01 }, +{ 0.3906E+00, 0.7505E+00, 0.5705E+00 }, { 0.1420E+01, 0.1357E+01, 0.1543E+01 }, +{ 0.3252E+00, 0.3136E+00, 0.2804E+00 }, { 0.1351E+01, 0.1309E+01, 0.1224E+01 }, +{ 0.8781E+00, 0.8095E+00, 0.7109E+00 }, { 0.1614E+01, 0.1580E+01, 0.1433E+01 }, +{ 0.3222E+00, 0.2298E+00, 0.2157E+00 }, { 0.1216E+01, 0.1077E+01, 0.1247E+01 }, +{ 0.1363E+01, 0.1280E+01, 0.1317E+01 }, { 0.1751E+01, 0.1457E+01, 0.1182E+01 }, +{ 0.4428E+00, 0.4082E+00, 0.3181E+00 }, { 0.1157E+01, 0.1227E+01, 0.1604E+01 }, +{ 0.1286E+01, 0.1268E+01, 0.8167E+00 }, { 0.1994E+01, 0.2018E+01, 0.1307E+01 }, +{ 0.2671E-01, 0.2594E+00, 0.3397E+00 }, { 0.1164E+01, 0.1080E+01, 0.9321E+00 }, +{ 0.5998E+00, 0.6076E+00, 0.5081E+00 }, { 0.1442E+01, 0.1442E+01, 0.1375E+01 }, +{ 0.2390E+00, 0.3554E+00, 0.3426E+00 }, { 0.1287E+01, 0.1307E+01, 0.1144E+01 }, +{ 0.1200E+01, 0.7495E+00, 0.3967E+00 }, { 0.1561E+01, 0.1517E+01, 0.1898E+01 }, +{ 0.3598E+00, 0.3463E+00, 0.1200E+00 }, { 0.1298E+01, 0.1125E+01, 0.1062E+01 }, +{ 0.7577E+00, 0.1013E+01, 0.1194E+01 }, { 0.1537E+01, 0.1513E+01, 0.1464E+01 }, +{ 0.4041E+00, 0.4038E+00, 0.3897E+00 }, { 0.1293E+01, 0.1219E+01, 0.1378E+01 }, +{ 0.1250E+01, 0.1391E+01, 0.2451E+00 }, { 0.1558E+01, 0.1764E+01, 0.1728E+01 }, +{ 0.2700E+00, 0.1894E+00, 0.1924E+00 }, { 0.1111E+01, 0.1112E+01, 0.1173E+01 }, +{ 0.7579E+00, 0.8342E+00, 0.4781E+00 }, { 0.1464E+01, 0.1477E+01, 0.1469E+01 }, +{ 0.4001E+00, 0.3104E+00, 0.2217E+00 }, { 0.1346E+01, 0.1421E+01, 0.1312E+01 }, +{ 0.1071E+01, 0.8967E+00, 0.7511E+00 }, { 0.1616E+01, 0.1551E+01, 0.1574E+01 }, +{ 0.3329E+00, 0.2785E+00, 0.3140E+00 }, { 0.1281E+01, 0.1209E+01, 0.1239E+01 }, +{ 0.2805E+00, 0.2687E+00, 0.1646E+01 }, { 0.1814E+01, 0.1514E+01, 0.1510E+01 }, +{ 0.6231E+00, 0.4200E+00, 0.3701E+00 }, { 0.1255E+01, 0.1429E+01, 0.1454E+01 }, +{ 0.1642E+01, 0.1581E+01, 0.7112E+00 }, { 0.1844E+01, 0.1963E+01, 0.1895E+01 }, +{-0.4208E-01,-0.1491E+00,-0.7639E-01 }, { 0.1046E+01, 0.9598E+00, 0.9176E+00 }, +{ 0.4478E+00, 0.4605E+00, 0.5111E+00 }, { 0.1521E+01, 0.1292E+01, 0.1342E+01 }, +{ 0.2220E+00, 0.2549E+00, 0.2510E+00 }, { 0.1186E+01, 0.1254E+01, 0.1171E+01 }, +{ 0.8999E+00, 0.4960E+00, 0.4943E+00 }, { 0.1423E+01, 0.1484E+01, 0.1620E+01 }, +{ 0.2796E+00, 0.2778E+00,-0.2820E+00 }, { 0.1170E+01, 0.1181E+01, 0.1076E+01 }, +{ 0.4068E+00, 0.8541E+00, 0.9352E+00 }, { 0.1584E+01, 0.1416E+01, 0.1387E+01 }, +{ 0.3325E+00, 0.3655E+00, 0.3340E+00 }, { 0.1224E+01, 0.1257E+01, 0.1245E+01 }, +{ 0.1061E+01, 0.1138E+01,-0.9526E-01 }, { 0.1681E+01, 0.1704E+01, 0.1673E+01 }, +{ 0.1932E+00, 0.1489E+00, 0.1258E+00 }, { 0.1023E+01, 0.1088E+01, 0.1145E+01 }, +{ 0.5190E+00, 0.6873E+00, 0.5172E+00 }, { 0.1380E+01, 0.1405E+01, 0.1474E+01 }, +{ 0.3393E+00, 0.3100E+00, 0.2231E+00 }, { 0.1354E+01, 0.1249E+01, 0.1270E+01 }, +{ 0.7363E+00, 0.8508E+00, 0.8247E+00 }, { 0.1612E+01, 0.1537E+01, 0.1509E+01 }, +{ 0.2952E+00, 0.2053E+00, 0.2590E+00 }, { 0.1138E+01, 0.1219E+01, 0.1262E+01 }, +{ 0.1345E+01, 0.1289E+01, 0.1338E+01 }, { 0.1437E+01, 0.1360E+01, 0.1442E+01 }, +{ 0.4826E+00, 0.3298E+00, 0.3842E+00 }, { 0.1219E+01, 0.1311E+01, 0.1413E+01 }, +{ 0.1212E+01, 0.1186E+01, 0.6357E+00 }, { 0.1873E+01, 0.1939E+01, 0.1674E+01 }, +{ 0.1260E+01, 0.1306E+01, 0.1368E+01 }, { 0.1146E+01, 0.1077E+01, 0.1025E+01 }, +{ 0.6029E+00, 0.5039E+00, 0.5781E+00 }, { 0.1514E+01, 0.1420E+01, 0.1324E+01 }, +{ 0.2652E+00, 0.3192E+00, 0.3042E+00 }, { 0.1368E+01, 0.1198E+01, 0.1200E+01 }, +{ 0.1234E+01, 0.4910E+00, 0.3464E-01 }, { 0.1347E+01, 0.1560E+01, 0.1861E+01 }, +{ 0.2766E+00, 0.2887E+00, 0.2029E+00 }, { 0.1257E+01, 0.1105E+01, 0.1145E+01 }, +{ 0.1351E+01, 0.1353E+01, 0.1406E+01 }, { 0.1506E+01, 0.1580E+01, 0.1362E+01 }, +{ 0.2794E+00, 0.3868E+00, 0.4277E+00 }, { 0.1234E+01, 0.1334E+01, 0.1336E+01 }, +{ 0.1280E+01, 0.1252E+01, 0.1805E+00 }, { 0.1387E+01, 0.1396E+01, 0.1434E+01 }, +{ 0.2902E+00, 0.1170E+00, 0.1698E+00 }, { 0.1134E+01, 0.1077E+01, 0.1117E+01 }, +{ 0.6986E+00, 0.7177E+00, 0.7366E+00 }, { 0.1370E+01, 0.1491E+01, 0.1495E+01 }, +{ 0.4031E+00, 0.5144E+00, 0.1751E+00 }, { 0.1333E+01, 0.1377E+01, 0.1257E+01 }, +{ 0.9212E+00, 0.8934E+00, 0.8897E+00 }, { 0.1589E+01, 0.1614E+01, 0.1523E+01 }, +{ 0.3152E+00, 0.2164E+00, 0.3230E+00 }, { 0.1300E+01, 0.1145E+01, 0.1212E+01 }, +{ 0.1269E+01, 0.1245E+01, 0.1497E+01 }, { 0.1763E+01, 0.1716E+01, 0.1311E+01 }, +{ 0.4702E+00, 0.5422E+00, 0.4306E+00 }, { 0.1342E+01, 0.1433E+01, 0.1423E+01 }, +{ 0.1472E+01, 0.1404E+01, 0.8371E+00 }, { 0.1936E+01, 0.1883E+01, 0.1838E+01 }, +{ 0.1266E+01, 0.1295E+01, 0.1302E+01 }, { 0.1074E+01, 0.1002E+01, 0.1023E+01 }, +{ 0.5206E+00, 0.4045E+00, 0.6549E+00 }, { 0.1457E+01, 0.1378E+01, 0.1363E+01 }, +{ 0.2715E+00, 0.2629E+00, 0.2841E+00 }, { 0.1264E+01, 0.1271E+01, 0.1175E+01 }, +{ 0.1337E+01, 0.1305E+01, 0.1306E+01 }, { 0.1555E+01, 0.1571E+01, 0.1657E+01 }, +{ 0.3341E+00, 0.4147E+00,-0.3648E+00 }, { 0.1188E+01, 0.1185E+01, 0.1161E+01 }, +{ 0.6198E+00, 0.7208E+00, 0.1157E+01 }, { 0.1582E+01, 0.1465E+01, 0.1513E+01 }, +{ 0.3839E+00, 0.3651E+00, 0.3814E+00 }, { 0.1214E+01, 0.1256E+01, 0.1292E+01 }, +{ 0.1361E+01, 0.1363E+01, 0.1312E+01 }, { 0.1793E+01, 0.1693E+01, 0.1669E+01 }, +{ 0.1889E+00, 0.1275E+00, 0.2534E+00 }, { 0.1066E+01, 0.1174E+01, 0.1133E+01 }, +{ 0.4999E+00, 0.8207E+00, 0.5813E+00 }, { 0.1478E+01, 0.1416E+01, 0.1497E+01 }, +{ 0.3814E+00, 0.3138E+00, 0.2889E+00 }, { 0.1396E+01, 0.1265E+01, 0.1233E+01 }, +{ 0.9458E+00, 0.9161E+00, 0.5875E+00 }, { 0.1672E+01, 0.1632E+01, 0.1553E+01 }, +{ 0.3505E+00, 0.2525E+00, 0.2364E+00 }, { 0.1211E+01, 0.1138E+01, 0.1235E+01 }, +{ 0.1391E+01, 0.1231E+01, 0.1355E+01 }, { 0.1783E+01, 0.1510E+01, 0.1199E+01 }, +{ 0.4227E+00, 0.4548E+00, 0.3671E+00 }, { 0.1281E+01, 0.1254E+01, 0.1661E+01 }, +{ 0.1338E+01, 0.1379E+01, 0.9531E+00 }, { 0.2148E+01, 0.1965E+01, 0.1584E+01 }, +{ 0.9324E-01, 0.3575E+00, 0.3522E+00 }, { 0.1212E+01, 0.1086E+01, 0.1044E+01 }, +{ 0.6128E+00, 0.6136E+00, 0.6060E+00 }, { 0.1484E+01, 0.1507E+01, 0.1396E+01 }, +{ 0.2820E+00, 0.3848E+00, 0.3156E+00 }, { 0.1368E+01, 0.1287E+01, 0.1128E+01 }, +{ 0.1369E+01, 0.1352E+01, 0.1358E+01 }, { 0.1381E+01, 0.1765E+01, 0.2113E+01 }, +{ 0.1314E+01, 0.1345E+01, 0.1334E+01 }, { 0.1290E+01, 0.1172E+01, 0.1119E+01 }, +{ 0.1304E+01, 0.1377E+01, 0.1427E+01 }, { 0.1490E+01, 0.1540E+01, 0.1536E+01 }, +{ 0.3994E+00, 0.4402E+00, 0.4173E+00 }, { 0.1323E+01, 0.1307E+01, 0.1392E+01 }, +{ 0.1400E+01, 0.1388E+01, 0.1369E+01 }, { 0.1669E+01, 0.1818E+01, 0.1834E+01 }, +{ 0.2742E+00, 0.2235E+00, 0.1986E+00 }, { 0.1137E+01, 0.1139E+01, 0.1201E+01 }, +{ 0.1324E+01, 0.1385E+01, 0.1349E+01 }, { 0.1455E+01, 0.1574E+01, 0.1454E+01 }, +{ 0.5019E+00, 0.3255E+00, 0.2555E+00 }, { 0.1388E+01, 0.1438E+01, 0.1300E+01 }, +{ 0.1394E+01, 0.1349E+01, 0.1411E+01 }, { 0.1639E+01, 0.1580E+01, 0.1681E+01 }, +{ 0.3920E+00, 0.2498E+00, 0.3523E+00 }, { 0.1301E+01, 0.1221E+01, 0.1285E+01 }, +{ 0.1318E+01, 0.1342E+01, 0.1494E+01 }, { 0.1910E+01, 0.1680E+01, 0.1470E+01 }, +{ 0.6082E+00, 0.5270E+00, 0.4173E+00 }, { 0.1255E+01, 0.1477E+01, 0.1503E+01 }, +{ 0.1807E+01, 0.1742E+01, 0.6553E+00 }, { 0.2000E+01, 0.2072E+01, 0.2051E+01 }}; + +/** + * LSP vector quantization tables + * + * TIA/IS-127 tables 8-1 through 8-9 + */ + +static const float evrc_lspq_full_codebook1[64][2] = { +{1.42016308E-2, 1.93881616E-2}, {2.91667543E-2, 6.51749149E-2}, +{2.06693150E-2, 4.97564934E-2}, {3.94719802E-2, 9.55850929E-2}, +{2.27012448E-2, 3.96625809E-2}, {5.38789518E-2, 6.28347769E-2}, +{2.90525518E-2, 5.73435798E-2}, {4.48280610E-2, 1.15364626E-1}, +{1.94110647E-2, 3.46889682E-2}, {4.37502973E-2, 6.75228462E-2}, +{3.55497338E-2, 4.94086780E-2}, {6.99219853E-2, 8.67279768E-2}, +{2.77880151E-2, 4.65748496E-2}, {5.79111017E-2, 6.74542487E-2}, +{4.74664383E-2, 5.50271496E-2}, {7.88898915E-2, 1.22443043E-1}, +{2.21715886E-2, 3.02628800E-2}, {3.39134485E-2, 7.17703998E-2}, +{3.17989141E-2, 4.98996116E-2}, {6.11555986E-2, 8.73361230E-2}, +{2.67506503E-2, 3.96735854E-2}, {4.44100983E-2, 8.26731324E-2}, +{3.89172547E-2, 5.65788932E-2}, {6.04800619E-2, 1.04536951E-1}, +{2.69156620E-2, 3.57168876E-2}, {4.11117189E-2, 7.33322948E-2}, +{4.12660725E-2, 4.85165231E-2}, {7.18049556E-2, 1.06202349E-1}, +{3.38037871E-2, 4.24300395E-2}, {5.91818243E-2, 7.97467977E-2}, +{4.70107906E-2, 6.28563762E-2}, {9.42011923E-2, 1.30053163E-1}, +{1.94244273E-2, 2.72732340E-2}, {3.70831676E-2, 6.64898157E-2}, +{2.80136354E-2, 5.15984930E-2}, {5.34461029E-2, 9.25904214E-2}, +{2.54959203E-2, 4.32844795E-2}, {5.51860742E-2, 7.36182332E-2}, +{3.39851119E-2, 6.05329126E-2}, {6.18182123E-2, 1.34581268E-1}, +{2.35669166E-2, 3.55242006E-2}, {5.10804243E-2, 6.79562539E-2}, +{3.83464955E-2, 5.23469411E-2}, {7.44275749E-2, 9.66108292E-2}, +{3.18591148E-2, 4.62123118E-2}, {6.18909821E-2, 7.33231753E-2}, +{4.41718437E-2, 5.79240918E-2}, {7.93596208E-2, 1.41177371E-1}, +{2.47412287E-2, 3.23629379E-2}, {3.36563922E-2, 8.04650635E-2}, +{3.37943695E-2, 5.44977151E-2}, {6.53648973E-2, 9.52775925E-2}, +{2.93364152E-2, 4.28411029E-2}, {5.27870469E-2, 8.16159397E-2}, +{4.00724895E-2, 6.18144684E-2}, {6.75848573E-2, 1.17196076E-1}, +{3.03064957E-2, 3.86914052E-2}, {4.83106263E-2, 7.42383003E-2}, +{4.37548272E-2, 5.22842295E-2}, {8.32310021E-2, 1.09881967E-1}, +{3.75600643E-2, 4.53217216E-2}, {6.60113171E-2, 7.97580183E-2}, +{5.03225066E-2, 5.90176322E-2}, {8.77133310E-2, 1.63187444E-1}}; + +static const float evrc_lspq_full_codebook2[64][2] = { +{5.21959551E-2, 8.38445649E-2}, {1.05874076E-1, 1.28694162E-1}, +{5.48323877E-2, 1.33842856E-1}, {1.17768474E-1, 1.94037274E-1}, +{5.36086522E-2, 1.11398734E-1}, {1.19989693E-1, 1.47474691E-1}, +{8.00373554E-2, 1.42999724E-1}, {1.64086595E-1, 2.09821835E-1}, +{5.21059223E-2, 9.95229408E-2}, {8.67567956E-2, 1.85966507E-1}, +{7.77341127E-2, 1.31506845E-1}, {1.60545513E-1, 1.81930289E-1}, +{7.42243677E-2, 1.10437103E-1}, {1.18635088E-1, 1.75306752E-1}, +{6.61557764E-2, 1.64441928E-1}, {1.96810856E-1, 2.16682002E-1}, +{6.05317838E-2, 9.45408568E-2}, {1.06271386E-1, 1.48013934E-1}, +{5.87486550E-2, 1.47724584E-1}, {1.34816468E-1, 2.01517954E-1}, +{6.59698322E-2, 1.16447397E-1}, {1.32297173E-1, 1.53267249E-1}, +{9.26660746E-2, 1.46725491E-1}, {1.79285541E-1, 2.19705954E-1}, +{7.06458464E-2, 9.99924466E-2}, {1.06500491E-1, 1.79443434E-1}, +{8.79249722E-2, 1.25287697E-1}, {1.53640196E-1, 1.97852716E-1}, +{8.88430104E-2, 1.12465657E-1}, {1.48286715E-1, 1.67517021E-1}, +{8.16568136E-2, 1.69274017E-1}, {2.07810536E-1, 2.31033549E-1}, +{6.14927970E-2, 8.36263224E-2}, {1.14473253E-1, 1.36779979E-1}, +{6.87129870E-2, 1.38099059E-1}, {1.10511415E-1, 2.15352878E-1}, +{5.55652268E-2, 1.22242786E-1}, {1.20557591E-1, 1.61072448E-1}, +{8.32249671E-2, 1.55475482E-1}, {1.61638483E-1, 2.28268847E-1}, +{6.29152283E-2, 1.06229566E-1}, {8.29186887E-2, 2.06774518E-1}, +{8.84756893E-2, 1.35799959E-1}, {1.69772223E-1, 1.93773940E-1}, +{7.77297840E-2, 1.20287232E-1}, {1.30648017E-1, 1.84331819E-1}, +{6.91939592E-2, 1.84218004E-1}, {2.03904077E-1, 2.49715164E-1}, +{7.07671717E-2, 9.03186128E-2}, {1.08471557E-1, 1.61966518E-1}, +{7.16886371E-2, 1.51093170E-1}, {1.38779536E-1, 2.18801782E-1}, +{6.75907061E-2, 1.26740307E-1}, {1.33412346E-1, 1.68838874E-1}, +{9.61822569E-2, 1.58728704E-1}, {1.86485633E-1, 2.36560926E-1}, +{8.23447108E-2, 1.02126025E-1}, {1.00336641E-1, 1.94918498E-1}, +{9.95981991E-2, 1.36425093E-1}, {1.82448462E-1, 2.03655198E-1}, +{9.78890732E-2, 1.21145472E-1}, {1.45453140E-1, 1.83604524E-1}, +{9.58395451E-2, 1.72194853E-1}, {2.23295853E-1, 2.46418610E-1}}; + +static const float evrc_lspq_full_codebook3[512][3] = { +{1.36425778E-1, 1.68651849E-1, 2.04688221E-1}, +{1.85717627E-1, 2.28756160E-1, 2.51958042E-1}, +{1.22760192E-1, 1.85950696E-1, 2.79446691E-1}, +{1.96468458E-1, 2.64484435E-1, 2.89318889E-1}, +{1.25653744E-1, 1.50529265E-1, 2.76144296E-1}, +{1.96301565E-1, 2.41699994E-1, 2.88230687E-1}, +{1.40099391E-1, 2.22365588E-1, 2.74666578E-1}, +{2.59952307E-1, 2.75394946E-1, 3.10975939E-1}, +{1.58452198E-1, 1.88591003E-1, 2.07339197E-1}, +{1.95616230E-1, 2.21379519E-1, 2.87022918E-1}, +{1.69424579E-1, 2.01614648E-1, 2.75669187E-1}, +{2.12393746E-1, 2.64250666E-1, 3.17967504E-1}, +{1.82965085E-1, 1.99547559E-1, 2.29538843E-1}, +{2.15200707E-1, 2.62409419E-1, 2.82432705E-1}, +{1.46404549E-1, 2.36966729E-1, 2.90067106E-1}, +{2.45338634E-1, 3.03358108E-1, 3.42260152E-1}, +{1.37478963E-1, 1.58276558E-1, 2.39217222E-1}, +{2.01999024E-1, 2.20102608E-1, 2.69546896E-1}, +{1.18350029E-1, 2.30206400E-1, 2.83554822E-1}, +{2.25519255E-1, 2.72272140E-1, 3.06072980E-1}, +{1.35661438E-1, 1.91633970E-1, 2.65912026E-1}, +{1.95733085E-1, 2.31926173E-1, 3.14376086E-1}, +{1.67998984E-1, 2.27706313E-1, 2.76947826E-1}, +{2.50170559E-1, 3.01627070E-1, 3.21084231E-1}, +{1.33492306E-1, 2.01223105E-1, 2.33893991E-1}, +{2.06442133E-1, 2.38704175E-1, 2.77560145E-1}, +{1.79048792E-1, 1.95776582E-1, 2.80656606E-1}, +{2.06193641E-1, 2.64055401E-1, 3.33098441E-1}, +{1.75185278E-1, 1.91166341E-1, 2.57540315E-1}, +{2.28398636E-1, 2.45296657E-1, 3.08980793E-1}, +{1.80859819E-1, 2.43579060E-1, 2.96631068E-1}, +{2.76152968E-1, 3.08256060E-1, 3.46822590E-1}, +{1.37115732E-1, 1.80057764E-1, 2.20953465E-1}, +{1.81370094E-1, 2.26770103E-1, 2.70392686E-1}, +{1.25246510E-1, 1.79606944E-1, 3.10376436E-1}, +{1.90708354E-1, 2.87734240E-1, 3.13476235E-1}, +{1.30486086E-1, 1.60435289E-1, 3.00243706E-1}, +{1.97318628E-1, 2.56378502E-1, 2.78474301E-1}, +{1.58597067E-1, 2.37381399E-1, 2.62910336E-1}, +{2.61825919E-1, 2.77717203E-1, 3.31382245E-1}, +{1.64160743E-1, 1.85841531E-1, 2.35615849E-1}, +{2.09486142E-1, 2.21452802E-1, 2.92153865E-1}, +{1.66807845E-1, 2.13641763E-1, 2.70675927E-1}, +{2.29834273E-1, 2.88374633E-1, 3.06238323E-1}, +{1.82154253E-1, 2.00822473E-1, 2.40169376E-1}, +{2.24944726E-1, 2.69813925E-1, 2.91401237E-1}, +{1.63940564E-1, 2.50341147E-1, 2.78307766E-1}, +{2.56727993E-1, 2.95103759E-1, 3.53297085E-1}, +{1.40218839E-1, 1.76687688E-1, 2.46773273E-1}, +{2.15291306E-1, 2.29216009E-1, 2.64283627E-1}, +{1.21002659E-1, 2.18333840E-1, 3.22341293E-1}, +{2.54243195E-1, 2.73986191E-1, 2.96262473E-1}, +{1.60385415E-1, 1.83762908E-1, 2.81598717E-1}, +{1.87832162E-1, 2.37420350E-1, 3.29777509E-1}, +{1.77788362E-1, 2.26703495E-1, 3.02322537E-1}, +{2.75108218E-1, 2.93730587E-1, 3.12373787E-1}, +{1.70116410E-1, 1.85232103E-1, 2.46125028E-1}, +{2.21754774E-1, 2.39912242E-1, 2.86891907E-1}, +{1.95083722E-1, 2.08337873E-1, 2.88349718E-1}, +{2.37536535E-1, 2.75004476E-1, 3.39786023E-1}, +{1.88369319E-1, 2.04371840E-1, 2.57375032E-1}, +{2.47250155E-1, 2.60551840E-1, 3.02137524E-1}, +{1.66944191E-1, 2.46912360E-1, 3.18894416E-1}, +{2.78118610E-1, 3.13011140E-1, 3.65329295E-1}, +{1.45213529E-1, 1.63051456E-1, 2.24912614E-1}, +{2.05692515E-1, 2.20831484E-1, 2.52817810E-1}, +{1.21125661E-1, 1.96374118E-1, 3.00122708E-1}, +{2.15566799E-1, 2.65657336E-1, 2.99202889E-1}, +{1.09134212E-1, 1.78472102E-1, 2.88323194E-1}, +{2.03508541E-1, 2.40347922E-1, 2.96309739E-1}, +{1.53101787E-1, 2.25415319E-1, 2.84843713E-1}, +{2.50233442E-1, 2.77736932E-1, 3.24840695E-1}, +{1.66308925E-1, 1.94173396E-1, 2.11635381E-1}, +{2.01289460E-1, 2.26062179E-1, 2.93246478E-1}, +{1.49518773E-1, 2.14201719E-1, 2.83894747E-1}, +{2.21836135E-1, 2.85231501E-1, 3.20082635E-1}, +{1.89573213E-1, 2.06577629E-1, 2.30332345E-1}, +{2.31247649E-1, 2.46864259E-1, 2.89846569E-1}, +{1.39116928E-1, 2.59189934E-1, 2.98019558E-1}, +{2.44512573E-1, 2.82671362E-1, 3.61258298E-1}, +{1.22530967E-1, 1.68514788E-1, 2.70879298E-1}, +{2.04372838E-1, 2.30398357E-1, 2.71792918E-1}, +{1.42643943E-1, 2.22405583E-1, 2.92057186E-1}, +{2.42643669E-1, 2.77429372E-1, 2.97135502E-1}, +{1.52048603E-1, 1.96921080E-1, 2.61013240E-1}, +{2.17875019E-1, 2.45840371E-1, 3.08138579E-1}, +{1.90109268E-1, 2.31099129E-1, 2.80178159E-1}, +{2.54314184E-1, 2.94079810E-1, 3.39649171E-1}, +{1.56698599E-1, 2.08597451E-1, 2.28010774E-1}, +{2.25088730E-1, 2.50014484E-1, 2.76250154E-1}, +{1.78219035E-1, 1.98228240E-1, 3.04198891E-1}, +{2.08567217E-1, 2.92395383E-1, 3.46786886E-1}, +{1.71052113E-1, 2.03438759E-1, 2.62644321E-1}, +{2.30275467E-1, 2.58817524E-1, 3.11986536E-1}, +{1.85333565E-1, 2.45760202E-1, 3.10553998E-1}, +{2.89413869E-1, 3.11095625E-1, 3.46476167E-1}, +{1.50332406E-1, 1.67538226E-1, 2.40182847E-1}, +{1.79971650E-1, 2.37168610E-1, 2.60899693E-1}, +{1.49866179E-1, 1.97890073E-1, 3.07916552E-1}, +{2.10799649E-1, 2.88180083E-1, 3.29747230E-1}, +{1.31711140E-1, 1.65906459E-1, 3.22898000E-1}, +{2.14832023E-1, 2.52822131E-1, 2.97547072E-1}, +{1.83760419E-1, 2.37523615E-1, 2.74610013E-1}, +{2.55575180E-1, 2.75439233E-1, 3.46021861E-1}, +{1.82662204E-1, 1.99470907E-1, 2.16051653E-1}, +{2.09240332E-1, 2.22406715E-1, 3.02382857E-1}, +{1.84088245E-1, 2.11327791E-1, 2.82538086E-1}, +{2.41171077E-1, 2.97036022E-1, 3.15979272E-1}, +{1.96804658E-1, 2.11815894E-1, 2.41647676E-1}, +{2.42761984E-1, 2.58586556E-1, 2.93204397E-1}, +{1.58905461E-1, 2.65077025E-1, 2.89881319E-1}, +{2.58060575E-1, 3.18903178E-1, 3.47846836E-1}, +{1.48766384E-1, 1.66853935E-1, 2.66827434E-1}, +{2.15942249E-1, 2.29938298E-1, 2.76041597E-1}, +{1.38410494E-1, 2.39283442E-1, 3.27972382E-1}, +{2.43765280E-1, 2.88408488E-1, 3.06048721E-1}, +{1.70157120E-1, 1.89986289E-1, 2.81219155E-1}, +{2.19117031E-1, 2.58005291E-1, 3.26571971E-1}, +{1.92163572E-1, 2.23614186E-1, 2.98683077E-1}, +{2.73545444E-1, 3.12078089E-1, 3.30766588E-1}, +{1.62452087E-1, 2.04930902E-1, 2.53337711E-1}, +{2.23855302E-1, 2.37671077E-1, 3.03202003E-1}, +{1.93955287E-1, 2.12335557E-1, 3.07566851E-1}, +{2.29912683E-1, 2.97581047E-1, 3.37499231E-1}, +{1.89335391E-1, 2.04148144E-1, 2.78609782E-1}, +{2.42303565E-1, 2.73163110E-1, 3.15361649E-1}, +{1.55009672E-1, 2.88095146E-1, 3.35996419E-1}, +{2.73716152E-1, 3.31215471E-1, 3.62539083E-1}, +{1.52389362E-1, 1.72619134E-1, 1.90585673E-1}, +{1.96988270E-1, 2.26309747E-1, 2.46197492E-1}, +{1.20555148E-1, 2.06369758E-1, 2.81199783E-1}, +{1.93709418E-1, 2.71900505E-1, 3.01332921E-1}, +{1.36701152E-1, 1.54093146E-1, 2.82258362E-1}, +{1.97299168E-1, 2.53656298E-1, 2.90315062E-1}, +{1.43463776E-1, 2.43872911E-1, 2.75533706E-1}, +{2.58477271E-1, 2.73279876E-1, 3.21119100E-1}, +{1.54406175E-1, 1.93793535E-1, 2.15884149E-1}, +{2.05979452E-1, 2.24277020E-1, 2.85732359E-1}, +{1.74535319E-1, 2.08482355E-1, 2.79668540E-1}, +{2.18844578E-1, 2.72486299E-1, 3.27095598E-1}, +{1.77609727E-1, 2.12990195E-1, 2.39119649E-1}, +{2.29163751E-1, 2.59165913E-1, 2.83514649E-1}, +{1.57353148E-1, 2.39961296E-1, 3.04263145E-1}, +{2.45613828E-1, 3.16824526E-1, 3.42909366E-1}, +{1.42953232E-1, 1.61905348E-1, 2.53710240E-1}, +{2.10192814E-1, 2.22847700E-1, 2.71103770E-1}, +{1.26843944E-1, 2.16709048E-1, 2.97734648E-1}, +{2.31000140E-1, 2.80109137E-1, 2.99707443E-1}, +{1.52980462E-1, 1.93996876E-1, 2.72895664E-1}, +{2.12860718E-1, 2.41545349E-1, 3.16518754E-1}, +{1.71154693E-1, 2.22469687E-1, 2.93786496E-1}, +{2.51988232E-1, 3.04254979E-1, 3.31269950E-1}, +{1.33188918E-1, 2.07924992E-1, 2.55362093E-1}, +{2.12044910E-1, 2.42189646E-1, 2.88903743E-1}, +{1.84612468E-1, 2.01143622E-1, 2.86360770E-1}, +{2.18286708E-1, 2.76752442E-1, 3.44581515E-1}, +{1.83562174E-1, 1.99478507E-1, 2.62156576E-1}, +{2.33130530E-1, 2.49596909E-1, 3.15842837E-1}, +{1.89898983E-1, 2.46874869E-1, 2.97132462E-1}, +{2.75022447E-1, 3.22490305E-1, 3.46977681E-1}, +{1.42305329E-1, 1.92689180E-1, 2.16155857E-1}, +{1.95676163E-1, 2.22268641E-1, 2.76587397E-1}, +{1.33241490E-1, 1.97791785E-1, 3.22897941E-1}, +{1.84865132E-1, 2.97106177E-1, 3.26105148E-1}, +{1.50203660E-1, 1.76781267E-1, 2.91536182E-1}, +{2.03144446E-1, 2.59616166E-1, 2.99156040E-1}, +{1.65488973E-1, 2.38342047E-1, 2.87493914E-1}, +{2.71071255E-1, 2.89544493E-1, 3.19521040E-1}, +{1.68598369E-1, 1.98825568E-1, 2.30347604E-1}, +{2.13811651E-1, 2.34471768E-1, 2.90959626E-1}, +{1.74605444E-1, 2.17256010E-1, 2.85688072E-1}, +{2.28503481E-1, 2.96190292E-1, 3.16534668E-1}, +{1.87172607E-1, 2.20547438E-1, 2.39688724E-1}, +{2.28884771E-1, 2.63583153E-1, 3.01329464E-1}, +{1.77897051E-1, 2.58131474E-1, 2.81487674E-1}, +{2.59513617E-1, 3.07204396E-1, 3.48793596E-1}, +{1.45224437E-1, 1.78715974E-1, 2.59186983E-1}, +{2.19062313E-1, 2.38223523E-1, 2.60461539E-1}, +{1.43650874E-1, 2.09760785E-1, 3.15830201E-1}, +{2.50127465E-1, 2.79182345E-1, 3.05153579E-1}, +{1.48986444E-1, 2.01226771E-1, 2.82543689E-1}, +{2.08387777E-1, 2.35603899E-1, 3.45363885E-1}, +{1.85830340E-1, 2.21607298E-1, 3.10773641E-1}, +{2.80904710E-1, 2.95469791E-1, 3.25499445E-1}, +{1.72967300E-1, 1.97078109E-1, 2.45801106E-1}, +{2.19495699E-1, 2.44767100E-1, 2.93587774E-1}, +{1.83909580E-1, 2.15004295E-1, 3.00334543E-1}, +{2.45338634E-1, 2.68595248E-1, 3.48330349E-1}, +{1.92957386E-1, 2.06625074E-1, 2.67336398E-1}, +{2.54845560E-1, 2.68642277E-1, 3.03547889E-1}, +{1.76853105E-1, 2.59330958E-1, 3.16200763E-1}, +{2.90929139E-1, 3.15634757E-1, 3.68723541E-1}, +{1.57116994E-1, 1.73552901E-1, 2.28736520E-1}, +{2.12509260E-1, 2.30501205E-1, 2.52217978E-1}, +{1.42521843E-1, 2.01979935E-1, 2.93012232E-1}, +{2.14919671E-1, 2.78065056E-1, 3.14176053E-1}, +{1.35947272E-1, 1.81055903E-1, 2.75475413E-1}, +{1.98416695E-1, 2.41673797E-1, 3.05173427E-1}, +{1.59517333E-1, 2.31580108E-1, 2.95412451E-1}, +{2.58203626E-1, 2.87348121E-1, 3.20351988E-1}, +{1.74840674E-1, 1.92883253E-1, 2.11250007E-1}, +{2.02168509E-1, 2.27025688E-1, 3.04884046E-1}, +{1.69532105E-1, 2.11826235E-1, 2.97355384E-1}, +{2.30033740E-1, 2.91504353E-1, 3.26589435E-1}, +{1.95046112E-1, 2.11709172E-1, 2.27705747E-1}, +{2.37926885E-1, 2.52411634E-1, 2.97752172E-1}, +{1.53762922E-1, 2.46541560E-1, 3.14768940E-1}, +{2.36075714E-1, 3.03568929E-1, 3.70624453E-1}, +{1.38660327E-1, 1.67949975E-1, 2.73515254E-1}, +{2.13806167E-1, 2.27267206E-1, 2.86276251E-1}, +{1.25080630E-1, 2.44098395E-1, 3.02548796E-1}, +{2.35714868E-1, 2.81208843E-1, 3.08903724E-1}, +{1.51691392E-1, 2.10877746E-1, 2.63812989E-1}, +{2.20730439E-1, 2.52777904E-1, 3.16413730E-1}, +{1.84924737E-1, 2.39424765E-1, 2.85120815E-1}, +{2.59548545E-1, 3.09809893E-1, 3.26423734E-1}, +{1.62930742E-1, 2.19900876E-1, 2.36148626E-1}, +{2.34194234E-1, 2.49944329E-1, 2.77549058E-1}, +{1.70870200E-1, 1.98291600E-1, 3.21412593E-1}, +{2.31566861E-1, 2.75015086E-1, 3.69710356E-1}, +{1.80002406E-1, 2.06701040E-1, 2.71204919E-1}, +{2.38075271E-1, 2.54006237E-1, 3.23827595E-1}, +{1.99148253E-1, 2.54273921E-1, 3.07479709E-1}, +{2.87428617E-1, 3.25045079E-1, 3.48634571E-1}, +{1.45285025E-1, 1.91359162E-1, 2.49691397E-1}, +{1.94659308E-1, 2.40821242E-1, 2.77302653E-1}, +{1.53150991E-1, 1.94375664E-1, 3.27550441E-1}, +{2.04085842E-1, 2.98595697E-1, 3.21480066E-1}, +{1.56009689E-1, 1.81012720E-1, 3.00931662E-1}, +{2.10962430E-1, 2.55770296E-1, 3.08086127E-1}, +{1.85444072E-1, 2.49021322E-1, 2.74029821E-1}, +{2.74493456E-1, 2.89441973E-1, 3.38794917E-1}, +{1.76941887E-1, 1.94476932E-1, 2.22077265E-1}, +{2.16377512E-1, 2.30735779E-1, 3.03689271E-1}, +{1.89683452E-1, 2.14660764E-1, 2.88445383E-1}, +{2.40827337E-1, 2.98141748E-1, 3.27378422E-1}, +{2.01787844E-1, 2.19441772E-1, 2.39327446E-1}, +{2.48812512E-1, 2.65865892E-1, 2.93382376E-1}, +{1.82027832E-1, 2.68279046E-1, 2.93991417E-1}, +{2.56498635E-1, 3.19984466E-1, 3.62663239E-1}, +{1.58799276E-1, 1.75433666E-1, 2.67389864E-1}, +{2.24259302E-1, 2.36668259E-1, 2.77639121E-1}, +{1.49203405E-1, 2.26585329E-1, 3.45255584E-1}, +{2.50655770E-1, 2.92264849E-1, 3.13574284E-1}, +{1.58096299E-1, 2.02193201E-1, 2.98711687E-1}, +{2.28820905E-1, 2.48557344E-1, 3.44726473E-1}, +{1.87972054E-1, 2.34109432E-1, 3.04235607E-1}, +{2.85657108E-1, 3.14878136E-1, 3.36931497E-1}, +{1.62680015E-1, 2.17820048E-1, 2.57436782E-1}, +{2.24049792E-1, 2.46739820E-1, 3.00795883E-1}, +{2.01354548E-1, 2.18286663E-1, 3.13036293E-1}, +{2.38028511E-1, 2.98103482E-1, 3.53503793E-1}, +{1.98829994E-1, 2.12877125E-1, 2.72980839E-1}, +{2.50616491E-1, 2.67659992E-1, 3.20611864E-1}, +{1.70901820E-1, 2.69330353E-1, 3.34428221E-1}, +{3.04988861E-1, 3.36196691E-1, 3.65235358E-1}, +{1.47624031E-1, 1.81272805E-1, 2.04707921E-1}, +{1.93751350E-1, 2.20973969E-1, 2.61775166E-1}, +{1.32089809E-1, 1.94851607E-1, 2.83547610E-1}, +{2.07739428E-1, 2.70596832E-1, 2.92264789E-1}, +{1.27733424E-1, 1.66896015E-1, 2.83891350E-1}, +{2.05309406E-1, 2.47807533E-1, 2.83632785E-1}, +{1.54211894E-1, 2.25014091E-1, 2.70082027E-1}, +{2.67574131E-1, 2.84426898E-1, 3.09334785E-1}, +{1.68846920E-1, 1.87004536E-1, 2.02433169E-1}, +{2.02441111E-1, 2.16733068E-1, 2.93079227E-1}, +{1.63621262E-1, 2.15616465E-1, 2.82792896E-1}, +{2.25509301E-1, 2.66283005E-1, 3.17886561E-1}, +{1.89110294E-1, 2.05609441E-1, 2.22113580E-1}, +{2.21240178E-1, 2.60288864E-1, 2.92541057E-1}, +{1.55563369E-1, 2.46850818E-1, 2.89648801E-1}, +{2.48406157E-1, 3.05291861E-1, 3.55316669E-1}, +{1.27122149E-1, 1.58053726E-1, 2.54164368E-1}, +{2.04998836E-1, 2.19476849E-1, 2.78342038E-1}, +{1.33302316E-1, 2.29614019E-1, 2.86947161E-1}, +{2.36777052E-1, 2.67918199E-1, 3.08230907E-1}, +{1.40853569E-1, 2.03414679E-1, 2.73257107E-1}, +{2.07684264E-1, 2.34520018E-1, 3.24583262E-1}, +{1.77181646E-1, 2.29595393E-1, 2.83539146E-1}, +{2.61378348E-1, 3.01160187E-1, 3.21707100E-1}, +{1.48595735E-1, 2.07772017E-1, 2.46946126E-1}, +{2.14334831E-1, 2.48061299E-1, 2.72259146E-1}, +{1.76380262E-1, 1.96897894E-1, 2.92286903E-1}, +{1.98193476E-1, 2.75483340E-1, 3.49037558E-1}, +{1.76153168E-1, 1.93248957E-1, 2.69548506E-1}, +{2.36968622E-1, 2.50065804E-1, 3.06820840E-1}, +{1.76060721E-1, 2.54037619E-1, 3.03566784E-1}, +{2.82952905E-1, 3.01765054E-1, 3.53956312E-1}, +{1.45353720E-1, 1.83678836E-1, 2.34750062E-1}, +{1.93842635E-1, 2.30635554E-1, 2.67817765E-1}, +{1.38958976E-1, 1.86760783E-1, 3.13113242E-1}, +{1.99944481E-1, 2.77624756E-1, 3.25046331E-1}, +{1.42966077E-1, 1.71310842E-1, 3.03013414E-1}, +{2.07741663E-1, 2.58691758E-1, 2.88766950E-1}, +{1.71776935E-1, 2.40246087E-1, 2.73284525E-1}, +{2.71046638E-1, 2.85170943E-1, 3.27401131E-1}, +{1.69854626E-1, 1.87545776E-1, 2.24484712E-1}, +{2.15221986E-1, 2.27339745E-1, 2.95008808E-1}, +{1.75596640E-1, 2.17936546E-1, 2.74879605E-1}, +{2.34665439E-1, 2.89530903E-1, 3.16494375E-1}, +{1.89946994E-1, 2.04953820E-1, 2.46955171E-1}, +{2.37297818E-1, 2.68316716E-1, 2.90684313E-1}, +{1.69963166E-1, 2.53367484E-1, 2.92533010E-1}, +{2.70659864E-1, 2.97146112E-1, 3.56183976E-1}, +{1.52539685E-1, 1.70138955E-1, 2.52703935E-1}, +{2.19119206E-1, 2.35900700E-1, 2.69739121E-1}, +{1.42245665E-1, 2.18184620E-1, 3.28218073E-1}, +{2.61472821E-1, 2.78025657E-1, 3.02375883E-1}, +{1.53526023E-1, 1.90727741E-1, 2.92820841E-1}, +{2.09240988E-1, 2.49808684E-1, 3.24709088E-1}, +{1.75176397E-1, 2.38646746E-1, 3.06392699E-1}, +{2.73218870E-1, 3.03954989E-1, 3.20513874E-1}, +{1.63911596E-1, 1.89611584E-1, 2.56272525E-1}, +{2.26953760E-1, 2.40120232E-1, 2.92728513E-1}, +{1.95565715E-1, 2.11956203E-1, 2.97374696E-1}, +{2.41045550E-1, 2.88497001E-1, 3.36352319E-1}, +{1.94948331E-1, 2.09475279E-1, 2.56309658E-1}, +{2.47884631E-1, 2.63356417E-1, 3.11270863E-1}, +{1.69189706E-1, 2.35864580E-1, 3.36249381E-1}, +{2.86001563E-1, 3.25423747E-1, 3.59607369E-1}, +{1.56258598E-1, 1.76704943E-1, 2.14393437E-1}, +{2.08996847E-1, 2.23968685E-1, 2.60886759E-1}, +{1.35765389E-1, 2.03580052E-1, 3.05503219E-1}, +{2.18961373E-1, 2.79463500E-1, 2.99450845E-1}, +{1.34064749E-1, 1.78332120E-1, 2.90169626E-1}, +{2.13298395E-1, 2.40031511E-1, 3.00345927E-1}, +{1.64373413E-1, 2.26438701E-1, 2.87171155E-1}, +{2.50739604E-1, 2.80812472E-1, 3.35349351E-1}, +{1.63649514E-1, 1.97108001E-1, 2.21165180E-1}, +{2.08139613E-1, 2.30869800E-1, 2.96137065E-1}, +{1.59113124E-1, 2.18189180E-1, 2.95531958E-1}, +{2.39883497E-1, 2.81831235E-1, 3.26045603E-1}, +{1.89394727E-1, 2.08127141E-1, 2.38446414E-1}, +{2.32995704E-1, 2.59603471E-1, 2.93427974E-1}, +{1.60558835E-1, 2.55164832E-1, 3.02872926E-1}, +{2.53509283E-1, 2.96028465E-1, 3.67721587E-1}, +{1.30124375E-1, 1.74838990E-1, 2.60486037E-1}, +{2.10203990E-1, 2.33570784E-1, 2.83061892E-1}, +{1.52365491E-1, 2.25338757E-1, 3.03720981E-1}, +{2.40558609E-1, 2.77192205E-1, 3.05891901E-1}, +{1.63728818E-1, 1.94779396E-1, 2.69253582E-1}, +{2.25709423E-1, 2.40902692E-1, 3.18060607E-1}, +{1.92055091E-1, 2.29857832E-1, 2.89826721E-1}, +{2.62759686E-1, 3.04292172E-1, 3.35680574E-1}, +{1.66071162E-1, 2.06819177E-1, 2.39712462E-1}, +{2.23915562E-1, 2.50106871E-1, 2.85296232E-1}, +{1.88402340E-1, 2.03793734E-1, 3.03041130E-1}, +{2.30698988E-1, 2.87044138E-1, 3.49802762E-1}, +{1.82025358E-1, 2.14073509E-1, 2.63470024E-1}, +{2.37297758E-1, 2.65025407E-1, 3.17815512E-1}, +{1.89278707E-1, 2.58802205E-1, 3.04866165E-1}, +{2.97243059E-1, 3.17153066E-1, 3.56583923E-1}, +{1.58607468E-1, 1.78659767E-1, 2.41919369E-1}, +{1.94887385E-1, 2.41695851E-1, 2.62176663E-1}, +{1.58124432E-1, 2.11753070E-1, 3.11352164E-1}, +{2.16902718E-1, 2.98796803E-1, 3.20994049E-1}, +{1.49272785E-1, 1.74964130E-1, 3.15334409E-1}, +{2.21622273E-1, 2.56179065E-1, 3.03902954E-1}, +{1.75979599E-1, 2.43505448E-1, 2.85801739E-1}, +{2.64590383E-1, 2.85541564E-1, 3.45107764E-1}, +{1.80137083E-1, 2.05279350E-1, 2.22255990E-1}, +{2.10796222E-1, 2.26315439E-1, 3.14426929E-1}, +{1.79151163E-1, 2.09439725E-1, 2.93280870E-1}, +{2.49719024E-1, 2.91257650E-1, 3.27162296E-1}, +{1.98700234E-1, 2.15896755E-1, 2.49960214E-1}, +{2.40726396E-1, 2.64857739E-1, 2.99639553E-1}, +{1.71249732E-1, 2.68166155E-1, 3.03572744E-1}, +{2.69555569E-1, 3.16100627E-1, 3.56570691E-1}, +{1.50564745E-1, 1.84190869E-1, 2.68674821E-1}, +{2.16941193E-1, 2.40813971E-1, 2.78942198E-1}, +{1.35399476E-1, 2.60586530E-1, 3.32604855E-1}, +{2.56150961E-1, 2.87822872E-1, 3.06156367E-1}, +{1.66398838E-1, 1.88721806E-1, 2.93023735E-1}, +{2.29214087E-1, 2.61565417E-1, 3.27494055E-1}, +{1.98266640E-1, 2.32970506E-1, 2.99134284E-1}, +{2.87046254E-1, 3.07103783E-1, 3.27298075E-1}, +{1.75898686E-1, 2.11898595E-1, 2.51332909E-1}, +{2.32067421E-1, 2.44622201E-1, 2.99443692E-1}, +{1.90780059E-1, 2.12090015E-1, 3.25059265E-1}, +{2.31531218E-1, 3.14166099E-1, 3.42735857E-1}, +{1.95099846E-1, 2.09554315E-1, 2.79483467E-1}, +{2.40416065E-1, 2.69604772E-1, 3.28015476E-1}, +{1.71800867E-1, 2.82233089E-1, 3.14749271E-1}, +{2.69243777E-1, 3.38462502E-1, 3.79935652E-1}, +{1.59934625E-1, 1.77966774E-1, 2.00818628E-1}, +{2.01979712E-1, 2.30668545E-1, 2.56773323E-1}, +{1.34024277E-1, 2.10961610E-1, 2.84687728E-1}, +{2.03712896E-1, 2.83053070E-1, 3.03309411E-1}, +{1.44528881E-1, 1.64728075E-1, 2.85079390E-1}, +{2.06285611E-1, 2.48649031E-1, 2.96383053E-1}, +{1.58138171E-1, 2.34317720E-1, 2.79650003E-1}, +{2.64995635E-1, 2.79900700E-1, 3.18619400E-1}, +{1.66537479E-1, 1.84279412E-1, 2.14547485E-1}, +{2.03051880E-1, 2.35110492E-1, 2.88755983E-1}, +{1.68422714E-1, 2.03946173E-1, 2.87478894E-1}, +{2.31727019E-1, 2.74086386E-1, 3.24755162E-1}, +{1.85356215E-1, 2.14113116E-1, 2.29030401E-1}, +{2.42482558E-1, 2.60655493E-1, 2.83030301E-1}, +{1.67562261E-1, 2.42027491E-1, 2.99461991E-1}, +{2.38809898E-1, 3.19003850E-1, 3.58415872E-1}, +{1.37908265E-1, 1.54787809E-1, 2.65611202E-1}, +{2.11019263E-1, 2.24607319E-1, 2.79954702E-1}, +{1.37569889E-1, 2.25128531E-1, 3.09312850E-1}, +{2.29239866E-1, 2.76150972E-1, 3.15241843E-1}, +{1.60487458E-1, 1.95461214E-1, 2.83169478E-1}, +{2.18505666E-1, 2.38197207E-1, 3.30340117E-1}, +{1.81991324E-1, 2.33026952E-1, 2.93276042E-1}, +{2.54552305E-1, 3.14394146E-1, 3.36392254E-1}, +{1.44095764E-1, 2.26640165E-1, 2.50595063E-1}, +{2.15188012E-1, 2.51417249E-1, 2.85043985E-1}, +{1.87674388E-1, 2.04458863E-1, 2.94168979E-1}, +{2.30494842E-1, 2.68452436E-1, 3.52370054E-1}, +{1.85022101E-1, 1.99075252E-1, 2.71930546E-1}, +{2.42569372E-1, 2.55389154E-1, 3.11399311E-1}, +{1.95166096E-1, 2.49102056E-1, 2.98998445E-1}, +{2.83654153E-1, 3.14600259E-1, 3.55619401E-1}, +{1.51490018E-1, 1.97729796E-1, 2.32467473E-1}, +{2.00029895E-1, 2.30101258E-1, 2.81933933E-1}, +{1.38711318E-1, 1.91816628E-1, 3.45780402E-1}, +{1.96580395E-1, 3.04714769E-1, 3.40553433E-1}, +{1.38154253E-1, 1.88543141E-1, 2.99461216E-1}, +{2.05666468E-1, 2.68904895E-1, 3.05537194E-1}, +{1.72447845E-1, 2.33558387E-1, 2.93625206E-1}, +{2.70145416E-1, 2.98654765E-1, 3.28556389E-1}, +{1.75489411E-1, 1.91361547E-1, 2.35585332E-1}, +{2.20548794E-1, 2.34773993E-1, 2.95397669E-1}, +{1.85652360E-1, 2.22349137E-1, 2.79883891E-1}, +{2.29456946E-1, 3.04546326E-1, 3.24684292E-1}, +{1.86900780E-1, 2.15469390E-1, 2.51856804E-1}, +{2.34910533E-1, 2.71217376E-1, 2.99894661E-1}, +{1.85142443E-1, 2.56071001E-1, 2.93291301E-1}, +{2.63883710E-1, 3.07127446E-1, 3.62546653E-1}, +{1.60997644E-1, 1.78937852E-1, 2.55808324E-1}, +{2.25671068E-1, 2.43735075E-1, 2.68624991E-1}, +{1.55076161E-1, 2.30396181E-1, 3.21005553E-1}, +{2.51760483E-1, 2.79653400E-1, 3.14202160E-1}, +{1.56988814E-1, 2.07466930E-1, 2.89933950E-1}, +{2.17479482E-1, 2.59626418E-1, 3.40659052E-1}, +{1.76811531E-1, 2.31087089E-1, 3.17562491E-1}, +{2.82952607E-1, 2.99844354E-1, 3.36822897E-1}, +{1.82060316E-1, 1.98734730E-1, 2.51980305E-1}, +{2.25874200E-1, 2.52469152E-1, 2.93356389E-1}, +{2.00799957E-1, 2.17786849E-1, 3.02210063E-1}, +{2.47423753E-1, 2.86882848E-1, 3.47820610E-1}, +{2.01128140E-1, 2.14746892E-1, 2.62269646E-1}, +{2.53963351E-1, 2.69477993E-1, 3.12133819E-1}, +{1.91034868E-1, 2.55738169E-1, 3.32559615E-1}, +{2.91053712E-1, 3.31458420E-1, 3.68588477E-1}, +{1.57229915E-1, 1.85374141E-1, 2.25361317E-1}, +{2.08051339E-1, 2.38350868E-1, 2.64212936E-1}, +{1.46848336E-1, 2.13000089E-1, 3.00192565E-1}, +{2.18630567E-1, 2.90263802E-1, 3.09045762E-1}, +{1.43699184E-1, 1.87815160E-1, 2.83769876E-1}, +{2.07328036E-1, 2.45088696E-1, 3.08956414E-1}, +{1.64228097E-1, 2.27826655E-1, 3.08907896E-1}, +{2.61919737E-1, 2.91333705E-1, 3.31527978E-1}, +{1.70648888E-1, 2.02157527E-1, 2.17827827E-1}, +{2.07796112E-1, 2.34704822E-1, 3.06783766E-1}, +{1.72118798E-1, 2.14057386E-1, 3.10151786E-1}, +{2.29116157E-1, 2.80949861E-1, 3.33774298E-1}, +{1.96622208E-1, 2.16653049E-1, 2.33279720E-1}, +{2.37789229E-1, 2.58971304E-1, 3.04609209E-1}, +{1.55182019E-1, 2.63032585E-1, 3.18943053E-1}, +{2.49388829E-1, 3.16970855E-1, 3.77762467E-1}, +{1.51363596E-1, 1.75010651E-1, 2.78245836E-1}, +{2.19810233E-1, 2.32360214E-1, 2.85034925E-1}, +{1.42630622E-1, 2.40602851E-1, 3.04125100E-1}, +{2.42764875E-1, 2.83762127E-1, 3.15481216E-1}, +{1.57467470E-1, 2.07524061E-1, 2.75674909E-1}, +{2.28758618E-1, 2.49092206E-1, 3.28139395E-1}, +{1.90872714E-1, 2.38125205E-1, 2.94894546E-1}, +{2.66389251E-1, 3.14321429E-1, 3.38669509E-1}, +{1.70644209E-1, 2.25980043E-1, 2.47372389E-1}, +{2.36442789E-1, 2.53003448E-1, 2.88220435E-1}, +{1.85423777E-1, 2.04888850E-1, 3.14608842E-1}, +{2.17379019E-1, 2.94553548E-1, 3.67831022E-1}, +{1.88563988E-1, 2.15174288E-1, 2.72999734E-1}, +{2.45102122E-1, 2.59770364E-1, 3.21885556E-1}, +{1.98444173E-1, 2.61160702E-1, 3.17097872E-1}, +{2.99013853E-1, 3.28965336E-1, 3.56681198E-1}, +{1.58248767E-1, 1.92205697E-1, 2.46059090E-1}, +{2.02385351E-1, 2.47965842E-1, 2.71749645E-1}, +{1.61710784E-1, 2.13708103E-1, 3.27384740E-1}, +{2.14419708E-1, 3.05552453E-1, 3.33721548E-1}, +{1.61819980E-1, 1.89897299E-1, 3.10501546E-1}, +{2.19436333E-1, 2.65029579E-1, 3.09288830E-1}, +{1.88303933E-1, 2.49633163E-1, 2.85499543E-1}, +{2.69325376E-1, 2.99807042E-1, 3.41722459E-1}, +{1.72406003E-1, 2.10977256E-1, 2.27773219E-1}, +{2.20281526E-1, 2.34015763E-1, 3.12846094E-1}, +{1.83257267E-1, 2.22061962E-1, 2.91052371E-1}, +{2.42531225E-1, 3.09527606E-1, 3.30389649E-1}, +{2.07546696E-1, 2.24662632E-1, 2.44420141E-1}, +{2.45858207E-1, 2.70285994E-1, 3.05132121E-1}, +{1.84840545E-1, 2.72096783E-1, 3.12531084E-1}, +{2.74252594E-1, 3.21252435E-1, 3.74658197E-1}, +{1.66425839E-1, 1.84491634E-1, 2.68278092E-1}, +{2.28423670E-1, 2.43025422E-1, 2.81184882E-1}, +{1.60091296E-1, 2.52953321E-1, 3.35822314E-1}, +{2.62109995E-1, 2.95581907E-1, 3.13354105E-1}, +{1.67702749E-1, 2.01536924E-1, 3.01801592E-1}, +{2.37822965E-1, 2.59894758E-1, 3.38231117E-1}, +{1.97206214E-1, 2.45490909E-1, 3.17895442E-1}, +{2.98455298E-1, 3.19209784E-1, 3.40971738E-1}, +{1.71195343E-1, 2.24327832E-1, 2.62736112E-1}, +{2.30626896E-1, 2.53310233E-1, 3.01206797E-1}, +{2.04814211E-1, 2.21881568E-1, 3.25966567E-1}, +{2.22987518E-1, 3.06339115E-1, 3.50717157E-1}, +{2.00855389E-1, 2.15359926E-1, 2.84143478E-1}, +{2.50951648E-1, 2.66189247E-1, 3.33360583E-1}, +{1.75610259E-1, 2.93791324E-1, 3.40326935E-1}, +{2.91745067E-1, 3.40602487E-1, 3.81397158E-1}}; + +static const float evrc_lspq_full_codebook4[128][3] = { +{2.77461529E-1, 3.16972077E-1, 3.95498335E-1}, +{3.36560428E-1, 3.60156953E-1, 3.81473005E-1}, +{3.10509324E-1, 3.31732392E-1, 3.66864383E-1}, +{3.37470949E-1, 3.96795273E-1, 4.12356317E-1}, +{2.79660404E-1, 3.66520107E-1, 3.85313451E-1}, +{3.16038966E-1, 3.85609329E-1, 4.01304781E-1}, +{3.09960425E-1, 3.43410730E-1, 4.24745500E-1}, +{3.54243636E-1, 4.08699274E-1, 4.22167957E-1}, +{2.95587242E-1, 3.33741128E-1, 3.87421668E-1}, +{3.33446383E-1, 3.86974752E-1, 4.01353061E-1}, +{3.23412836E-1, 3.65269661E-1, 3.85193288E-1}, +{3.42731953E-1, 4.03192520E-1, 4.19920385E-1}, +{2.77681828E-1, 3.82494986E-1, 4.04274166E-1}, +{3.18247974E-1, 3.95985305E-1, 4.31353152E-1}, +{3.03711414E-1, 3.80319715E-1, 4.37173545E-1}, +{3.78288805E-1, 4.07077312E-1, 4.22679126E-1}, +{2.38116503E-1, 3.42454314E-1, 4.24624741E-1}, +{3.45615685E-1, 3.68681073E-1, 4.00817335E-1}, +{3.17688107E-1, 3.41902673E-1, 4.05601799E-1}, +{3.66368949E-1, 3.89039934E-1, 4.06154454E-1}, +{2.99398005E-1, 3.52021694E-1, 3.99955690E-1}, +{3.24991941E-1, 3.90028834E-1, 4.19478714E-1}, +{3.23025763E-1, 3.68114293E-1, 4.02087748E-1}, +{3.62326264E-1, 4.16927993E-1, 4.32773650E-1}, +{2.72696435E-1, 3.59205008E-1, 4.26880658E-1}, +{3.46539855E-1, 3.69616628E-1, 4.15621221E-1}, +{3.34109128E-1, 3.55736315E-1, 3.96749556E-1}, +{3.37468982E-1, 4.10392702E-1, 4.25986826E-1}, +{2.99468994E-1, 3.80648255E-1, 4.18284118E-1}, +{3.21378171E-1, 4.11198020E-1, 4.28792536E-1}, +{3.27841163E-1, 3.69345129E-1, 4.34395611E-1}, +{3.80669057E-1, 4.26086366E-1, 4.42754567E-1}, +{2.68943667E-1, 3.42942953E-1, 3.98681462E-1}, +{3.38102877E-1, 3.76338840E-1, 3.92043173E-1}, +{3.23593497E-1, 3.48742068E-1, 3.72551978E-1}, +{3.47550809E-1, 3.92885387E-1, 4.21169937E-1}, +{3.04182827E-1, 3.59816670E-1, 3.81633341E-1}, +{3.14221382E-1, 4.02108550E-1, 4.20085251E-1}, +{3.01306546E-1, 3.62662733E-1, 4.29262817E-1}, +{3.71770263E-1, 3.98696363E-1, 4.31438982E-1}, +{2.74591267E-1, 3.35595489E-1, 4.20079648E-1}, +{3.44540834E-1, 3.90451789E-1, 4.06412065E-1}, +{3.25239837E-1, 3.78344476E-1, 3.94673288E-1}, +{3.56683493E-1, 3.90574157E-1, 4.33851063E-1}, +{2.63501287E-1, 3.95260096E-1, 4.23116386E-1}, +{3.37520659E-1, 3.92563462E-1, 4.43415821E-1}, +{3.14522266E-1, 3.80968630E-1, 4.22676384E-1}, +{3.76235068E-1, 4.17298734E-1, 4.31451261E-1}, +{2.61855006E-1, 3.68646085E-1, 4.04260576E-1}, +{3.55580151E-1, 3.77994478E-1, 3.95868242E-1}, +{3.27742815E-1, 3.53872776E-1, 4.11040604E-1}, +{3.62960637E-1, 3.99466991E-1, 4.14690197E-1}, +{3.09410870E-1, 3.73796046E-1, 3.92672479E-1}, +{3.31016302E-1, 4.00801599E-1, 4.31759298E-1}, +{3.23573053E-1, 3.68619561E-1, 4.17455137E-1}, +{3.49115849E-1, 4.26840067E-1, 4.43913996E-1}, +{2.89738595E-1, 3.63759339E-1, 4.10511792E-1}, +{3.55286479E-1, 3.89331281E-1, 4.13432419E-1}, +{3.36565912E-1, 3.60222459E-1, 4.24179018E-1}, +{3.39932680E-1, 4.09228802E-1, 4.40184891E-1}, +{3.00889730E-1, 4.00081098E-1, 4.17955697E-1}, +{3.17052066E-1, 4.22288120E-1, 4.42229569E-1}, +{3.27336788E-1, 3.84311676E-1, 4.30288613E-1}, +{3.98990929E-1, 4.29498434E-1, 4.43475187E-1}, +{2.49110118E-1, 3.25696886E-1, 4.11728263E-1}, +{3.45929205E-1, 3.68577540E-1, 3.88473272E-1}, +{3.13219666E-1, 3.39229465E-1, 3.87597919E-1}, +{3.51453960E-1, 3.98730278E-1, 4.12656188E-1}, +{2.93487132E-1, 3.75763118E-1, 3.94488096E-1}, +{3.24470758E-1, 3.94202888E-1, 4.08882737E-1}, +{3.12710822E-1, 3.57720256E-1, 4.14061189E-1}, +{3.66507173E-1, 4.08171296E-1, 4.23891425E-1}, +{2.99965680E-1, 3.31993401E-1, 4.07860160E-1}, +{3.34925175E-1, 3.86143029E-1, 4.11538124E-1}, +{3.34788024E-1, 3.66196156E-1, 3.93347144E-1}, +{3.47847939E-1, 4.05926466E-1, 4.30507302E-1}, +{2.85952926E-1, 3.95283282E-1, 4.16119337E-1}, +{3.23867381E-1, 4.06476676E-1, 4.42482829E-1}, +{3.16716671E-1, 3.84451628E-1, 4.39411044E-1}, +{3.86772931E-1, 4.11824584E-1, 4.27831531E-1}, +{2.38072395E-1, 3.62342358E-1, 4.30931687E-1}, +{3.46450031E-1, 3.79082918E-1, 4.06567812E-1}, +{3.16576600E-1, 3.56468618E-1, 3.96218300E-1}, +{3.66539180E-1, 3.89590919E-1, 4.21055555E-1}, +{3.08291376E-1, 3.71324301E-1, 4.07867432E-1}, +{3.36435199E-1, 3.91514421E-1, 4.22977090E-1}, +{3.23035538E-1, 3.80447328E-1, 4.09550190E-1}, +{3.65228057E-1, 4.27910388E-1, 4.43691254E-1}, +{2.72038043E-1, 3.76596808E-1, 4.33685899E-1}, +{3.57665777E-1, 3.77761602E-1, 4.09178972E-1}, +{3.36498559E-1, 3.64215910E-1, 4.09255505E-1}, +{3.48082423E-1, 4.17631805E-1, 4.33284521E-1}, +{3.02754521E-1, 3.95974755E-1, 4.33717251E-1}, +{3.31676304E-1, 4.17587161E-1, 4.36239839E-1}, +{3.33287597E-1, 3.80799115E-1, 4.39620733E-1}, +{3.88112009E-1, 4.36933577E-1, 4.50829268E-1}, +{2.56026626E-1, 3.48015189E-1, 4.22922611E-1}, +{3.45773995E-1, 3.81725788E-1, 3.96794081E-1}, +{3.25623751E-1, 3.50391924E-1, 3.87330651E-1}, +{3.56868088E-1, 3.98574769E-1, 4.23177242E-1}, +{3.01226199E-1, 3.86906981E-1, 4.03335571E-1}, +{3.28178406E-1, 4.02090192E-1, 4.19389248E-1}, +{3.14385355E-1, 3.69043887E-1, 4.34375286E-1}, +{3.72321129E-1, 4.11672413E-1, 4.40518737E-1}, +{2.90479720E-1, 3.48121881E-1, 4.26216483E-1}, +{3.44438791E-1, 3.82666349E-1, 4.17321086E-1}, +{3.34866822E-1, 3.76235664E-1, 4.04475212E-1}, +{3.59025359E-1, 4.04721916E-1, 4.34838414E-1}, +{2.79127955E-1, 4.11106586E-1, 4.35360551E-1}, +{3.48125517E-1, 3.98732066E-1, 4.46927428E-1}, +{3.27018857E-1, 3.90107334E-1, 4.41707492E-1}, +{3.90858352E-1, 4.19813931E-1, 4.35153484E-1}, +{2.55319297E-1, 3.70405972E-1, 4.32188630E-1}, +{3.54651988E-1, 3.88332665E-1, 4.02956128E-1}, +{3.21608186E-1, 3.54489803E-1, 4.28299785E-1}, +{3.75163496E-1, 3.98833990E-1, 4.14177418E-1}, +{3.11953604E-1, 3.91430676E-1, 4.12552476E-1}, +{3.42528820E-1, 3.96365345E-1, 4.32497382E-1}, +{3.33744347E-1, 3.76422405E-1, 4.20536995E-1}, +{3.53529096E-1, 4.29231048E-1, 4.59699273E-1}, +{2.88017929E-1, 3.77999961E-1, 4.34011698E-1}, +{3.55683446E-1, 3.80780041E-1, 4.23145533E-1}, +{3.44358265E-1, 3.72184873E-1, 4.31265354E-1}, +{3.53966117E-1, 4.14166689E-1, 4.42941308E-1}, +{3.04770231E-1, 4.12517488E-1, 4.34183121E-1}, +{3.35913360E-1, 4.24590766E-1, 4.46378469E-1}, +{3.43738198E-1, 3.84766221E-1, 4.35271382E-1}, +{4.10941303E-1, 4.40662980E-1, 4.52113390E-1}}; + +static const float evrc_lspq_half_codebook1[128][3] = { +{1.35226343E-2, 1.82081293E-2, 3.93940695E-2}, +{2.29392890E-2, 3.57831158E-2, 1.05352886E-1}, +{2.09106486E-2, 3.04159056E-2, 8.93941075E-2}, +{1.88909005E-2, 3.82722206E-2, 1.37820408E-1}, +{2.05143820E-2, 2.85481159E-2, 7.39762187E-2}, +{4.69510332E-2, 6.84031919E-2, 1.09123811E-1}, +{3.15557197E-2, 5.69139980E-2, 8.57057571E-2}, +{3.81181911E-2, 7.77784660E-2, 1.92532852E-1}, +{2.16297153E-2, 2.92908940E-2, 6.25042021E-2}, +{3.11414022E-2, 5.99079318E-2, 1.02860682E-1}, +{3.02799307E-2, 5.35012372E-2, 7.80925751E-2}, +{6.50846213E-2, 9.06624720E-2, 1.42850950E-1}, +{3.27340364E-2, 5.04027791E-2, 6.26492277E-2}, +{5.27439862E-2, 6.22574277E-2, 1.22198336E-1}, +{3.48840356E-2, 6.42222390E-2, 9.16024595E-2}, +{4.88984436E-2, 1.05058022E-1, 1.68813452E-1}, +{2.35791076E-2, 3.21034677E-2, 5.60899563E-2}, +{2.77252812E-2, 4.87281792E-2, 1.01224191E-1}, +{2.74348017E-2, 4.04965915E-2, 9.34926122E-2}, +{4.38360050E-2, 6.03261292E-2, 1.52400866E-1}, +{2.68994924E-2, 4.52906378E-2, 6.49800375E-2}, +{5.16058952E-2, 6.08312152E-2, 1.08799636E-1}, +{4.20064926E-2, 6.11845106E-2, 8.54474008E-2}, +{7.13502690E-2, 1.01972111E-1, 1.74640998E-1}, +{2.88906675E-2, 4.13964354E-2, 5.25928028E-2}, +{3.16364467E-2, 6.63532093E-2, 1.24950245E-1}, +{4.30289507E-2, 5.14023267E-2, 7.96877742E-2}, +{5.70970774E-2, 1.08444504E-1, 1.44075617E-1}, +{3.38840261E-2, 5.04746847E-2, 7.29765445E-2}, +{6.54265657E-2, 7.90987685E-2, 1.15570590E-1}, +{3.85423526E-2, 7.33125433E-2, 1.02307513E-1}, +{6.57824501E-2, 1.02909811E-1, 2.11874440E-1}, +{1.54727865E-2, 2.04559695E-2, 5.46121262E-2}, +{2.27950197E-2, 3.90954204E-2, 1.19443826E-1}, +{3.06889173E-2, 4.54540215E-2, 8.20418894E-2}, +{2.25957241E-2, 4.79101725E-2, 1.71844408E-1}, +{2.71088015E-2, 4.01739590E-2, 7.01922849E-2}, +{4.95789349E-2, 7.92963281E-2, 1.04862511E-1}, +{3.06095853E-2, 5.64059429E-2, 9.49584097E-2}, +{6.34224564E-2, 9.11655501E-2, 1.84724405E-1}, +{2.43342388E-2, 3.91998328E-2, 6.31406233E-2}, +{3.38011980E-2, 6.60846457E-2, 1.11031540E-1}, +{3.51784080E-2, 5.79397269E-2, 7.20702857E-2}, +{6.49054050E-2, 8.65831897E-2, 1.54648736E-1}, +{2.91934665E-2, 5.16204573E-2, 6.94437325E-2}, +{5.94522804E-2, 7.19829276E-2, 1.27434507E-1}, +{5.31888530E-2, 6.38182089E-2, 9.88218486E-2}, +{8.68290961E-2, 1.41135350E-1, 1.91728458E-1}, +{2.49991138E-2, 3.62556018E-2, 5.03724031E-2}, +{2.82246377E-2, 5.44572286E-2, 1.12663500E-1}, +{3.62618119E-2, 4.59073223E-2, 9.43343639E-2}, +{5.70455343E-2, 7.46300444E-2, 1.59157172E-1}, +{2.72987466E-2, 4.56625856E-2, 7.52529651E-2}, +{5.12860194E-2, 8.51126984E-2, 1.23587973E-1}, +{4.91451994E-2, 5.93483113E-2, 9.22686011E-2}, +{7.06961900E-2, 1.05451979E-1, 1.92602143E-1}, +{2.80733760E-2, 4.18509208E-2, 5.87159805E-2}, +{4.64449003E-2, 7.06698820E-2, 1.26038432E-1}, +{4.18453738E-2, 6.30445331E-2, 7.66169876E-2}, +{8.42416435E-2, 1.13282882E-1, 1.43687114E-1}, +{4.17615622E-2, 5.59472926E-2, 7.09872842E-2}, +{5.55161387E-2, 9.50126722E-2, 1.27727196E-1}, +{5.90935498E-2, 7.36730024E-2, 9.65935886E-2}, +{7.84136653E-2, 1.41432360E-1, 2.17428640E-1}, +{2.10490543E-2, 2.91891042E-2, 4.60035764E-2}, +{3.64863276E-2, 4.62387018E-2, 1.07044168E-1}, +{2.68652122E-2, 3.92937548E-2, 8.41179937E-2}, +{2.72903945E-2, 5.53805046E-2, 1.41586170E-1}, +{2.48476695E-2, 3.63277681E-2, 7.62430876E-2}, +{5.25430813E-2, 7.75778666E-2, 1.14567965E-1}, +{4.07741442E-2, 5.39923795E-2, 9.07640457E-2}, +{5.73043302E-2, 7.65803084E-2, 1.79578975E-1}, +{2.46032421E-2, 3.41408364E-2, 6.78990781E-2}, +{4.08220068E-2, 6.29783794E-2, 9.95191261E-2}, +{3.83025035E-2, 5.52857481E-2, 7.90019333E-2}, +{7.24111274E-2, 1.01903863E-1, 1.46979645E-1}, +{3.73902172E-2, 4.70463894E-2, 6.54684529E-2}, +{5.27397543E-2, 6.72770366E-2, 1.39680430E-1}, +{4.05365378E-2, 7.05081299E-2, 9.25668627E-2}, +{4.43425253E-2, 1.10367171E-1, 1.99636266E-1}, +{2.54920740E-2, 3.47603969E-2, 6.05902039E-2}, +{4.35465500E-2, 5.32369502E-2, 1.08325966E-1}, +{2.79599819E-2, 4.91324775E-2, 8.84284526E-2}, +{4.98051867E-2, 8.81728902E-2, 1.52597323E-1}, +{3.19346264E-2, 4.62169312E-2, 6.85206428E-2}, +{5.80246300E-2, 6.84268698E-2, 1.15085281E-1}, +{4.33904678E-2, 6.90575615E-2, 8.44984353E-2}, +{7.39691556E-2, 1.19240515E-1, 1.77340195E-1}, +{3.18767503E-2, 4.59697433E-2, 5.72372638E-2}, +{4.50873822E-2, 5.66509366E-2, 1.32005826E-1}, +{4.59097028E-2, 5.45580424E-2, 8.61423314E-2}, +{7.44685754E-2, 1.13815404E-1, 1.61570594E-1}, +{3.97509560E-2, 4.95359488E-2, 7.22542256E-2}, +{6.76257759E-2, 8.31029043E-2, 1.27990112E-1}, +{5.76258078E-2, 6.95326403E-2, 1.05012968E-1}, +{6.85313493E-2, 1.21758826E-1, 2.20626548E-1}, +{2.18480472E-2, 2.99130920E-2, 5.16208000E-2}, +{3.64343151E-2, 4.91795056E-2, 1.23277210E-1}, +{3.89611274E-2, 4.76634987E-2, 8.61716568E-2}, +{4.14635167E-2, 6.88006952E-2, 1.69356152E-1}, +{3.35514620E-2, 4.17815186E-2, 7.37159401E-2}, +{5.80224693E-2, 8.70314166E-2, 1.12917498E-1}, +{4.80243117E-2, 5.69486506E-2, 1.00755706E-1}, +{5.98873124E-2, 8.57942328E-2, 2.01388851E-1}, +{2.99309995E-2, 3.94828431E-2, 6.46376088E-2}, +{3.88626605E-2, 8.07443634E-2, 1.15519784E-1}, +{3.49444002E-2, 6.28911033E-2, 8.04982036E-2}, +{6.88817874E-2, 9.92431119E-2, 1.60393253E-1}, +{3.64237651E-2, 5.34016453E-2, 6.70152009E-2}, +{5.83492741E-2, 7.85285756E-2, 1.41746715E-1}, +{4.86469641E-2, 7.26736858E-2, 9.48315859E-2}, +{5.85533604E-2, 1.36289746E-1, 1.98639736E-1}, +{2.60888506E-2, 3.73406820E-2, 5.57853170E-2}, +{4.58504409E-2, 5.60512505E-2, 1.17927872E-1}, +{4.28801328E-2, 5.14739119E-2, 9.75309014E-2}, +{6.37611598E-2, 8.73552933E-2, 1.68334916E-1}, +{3.76709923E-2, 4.58216034E-2, 7.86528140E-2}, +{6.75194561E-2, 8.98697898E-2, 1.19418114E-1}, +{5.46374246E-2, 6.66805878E-2, 8.93813819E-2}, +{7.73086548E-2, 1.21754415E-1, 1.99579224E-1}, +{3.15621309E-2, 4.51702215E-2, 6.25768527E-2}, +{3.78782675E-2, 8.03486481E-2, 1.38961688E-1}, +{5.08303270E-2, 6.18740581E-2, 8.31153840E-2}, +{8.96311402E-2, 1.28753766E-1, 1.64891586E-1}, +{4.73503470E-2, 5.75724356E-2, 7.65264630E-2}, +{7.16898590E-2, 9.89895687E-2, 1.30078360E-1}, +{6.29082546E-2, 7.90778771E-2, 1.05111063E-1}, +{8.80649835E-2, 1.65206164E-1, 2.13214174E-1}}; + +static const float evrc_lspq_half_codebook2[128][3] = { +{9.75915268E-2, 1.23701490E-1, 1.69437975E-1}, +{9.49536338E-2, 2.01081768E-1, 2.26855248E-1}, +{9.00496617E-2, 1.49164870E-1, 2.26532787E-1}, +{1.70302704E-1, 1.97222874E-1, 2.49974832E-1}, +{1.08773641E-1, 1.51972428E-1, 1.75123364E-1}, +{1.30278930E-1, 2.13229164E-1, 2.29646355E-1}, +{1.24917991E-1, 1.87347755E-1, 2.04712003E-1}, +{2.00670198E-1, 2.28963569E-1, 2.69420803E-1}, +{8.98375586E-2, 1.25332758E-1, 2.10539430E-1}, +{9.62376669E-2, 2.07185850E-1, 2.54174471E-1}, +{1.05694629E-1, 1.78856418E-1, 2.00121015E-1}, +{1.56048968E-1, 2.19573721E-1, 2.91079402E-1}, +{1.37392268E-1, 1.59993336E-1, 1.94698542E-1}, +{1.07262500E-1, 2.37790957E-1, 2.70740807E-1}, +{1.42976448E-1, 2.01550499E-1, 2.18468934E-1}, +{2.14270487E-1, 2.71881402E-1, 3.01200211E-1}, +{1.10729210E-1, 1.33688226E-1, 1.54877156E-1}, +{1.06667660E-1, 1.76678821E-1, 2.62798905E-1}, +{9.16352943E-2, 1.74592838E-1, 2.19329327E-1}, +{1.84038624E-1, 2.27964059E-1, 2.47762203E-1}, +{1.10572360E-1, 1.58207163E-1, 1.96013063E-1}, +{1.33543387E-1, 2.32269660E-1, 2.51828164E-1}, +{1.55922309E-1, 1.77941337E-1, 2.18096644E-1}, +{1.92260072E-1, 2.49512479E-1, 2.89911509E-1}, +{1.13708906E-1, 1.37872443E-1, 2.02929884E-1}, +{1.02557532E-1, 1.84820071E-1, 2.92164624E-1}, +{1.36595622E-1, 1.58687428E-1, 2.41399556E-1}, +{1.72813818E-1, 2.49303415E-1, 3.00458610E-1}, +{1.36871174E-1, 1.57249823E-1, 2.10913152E-1}, +{1.28974810E-1, 2.45167866E-1, 2.67653584E-1}, +{1.66812256E-1, 1.88998029E-1, 2.31345922E-1}, +{2.32248470E-1, 2.63196051E-1, 3.16754937E-1}, +{9.24560949E-2, 1.19977452E-1, 1.91262275E-1}, +{1.13085262E-1, 2.08461538E-1, 2.29368120E-1}, +{1.00716405E-1, 1.40670076E-1, 2.58062959E-1}, +{1.67010382E-1, 2.18105540E-1, 2.62592494E-1}, +{1.25487238E-1, 1.62686959E-1, 1.84409231E-1}, +{1.52406558E-1, 2.07131729E-1, 2.47582436E-1}, +{1.37441203E-1, 1.80262372E-1, 2.17698842E-1}, +{2.07853511E-1, 2.49209508E-1, 2.69830108E-1}, +{9.35257301E-2, 1.49197355E-1, 2.04652041E-1}, +{1.11997180E-1, 2.25233063E-1, 2.47003049E-1}, +{1.09315015E-1, 1.93811879E-1, 2.13802189E-1}, +{1.75118580E-1, 2.52520263E-1, 2.75082767E-1}, +{1.36918738E-1, 1.77440569E-1, 1.97931141E-1}, +{1.36811242E-1, 2.37426177E-1, 2.84737825E-1}, +{1.60759792E-1, 2.00833157E-1, 2.18084484E-1}, +{2.33710244E-1, 2.66372561E-1, 2.91802049E-1}, +{1.19171090E-1, 1.39703169E-1, 1.87723249E-1}, +{1.31049946E-1, 1.93696663E-1, 2.60426998E-1}, +{1.08267047E-1, 1.65194795E-1, 2.39523023E-1}, +{2.03195021E-1, 2.25942209E-1, 2.49403238E-1}, +{1.23842932E-1, 1.45794615E-1, 2.15635628E-1}, +{1.71226338E-1, 2.38054529E-1, 2.57975638E-1}, +{1.66923836E-1, 1.88604668E-1, 2.11124212E-1}, +{2.10620746E-1, 2.62442708E-1, 2.83127964E-1}, +{1.05748810E-1, 1.36286482E-1, 2.20050186E-1}, +{9.72945765E-2, 2.33471528E-1, 2.96113968E-1}, +{1.34298369E-1, 1.93955436E-1, 2.39148825E-1}, +{1.64229318E-1, 2.70067751E-1, 2.94142485E-1}, +{1.42760262E-1, 1.65033355E-1, 2.24100381E-1}, +{1.46414533E-1, 2.47942328E-1, 3.00708115E-1}, +{1.74778774E-1, 2.19349250E-1, 2.38162965E-1}, +{2.36311123E-1, 2.90669680E-1, 3.28010976E-1}, +{1.14076428E-1, 1.33071408E-1, 1.73181504E-1}, +{1.13575839E-1, 1.90307274E-1, 2.41681188E-1}, +{8.59165266E-2, 1.63920239E-1, 2.37934500E-1}, +{1.92916945E-1, 2.15082392E-1, 2.39128128E-1}, +{1.37291834E-1, 1.59423307E-1, 1.79722220E-1}, +{1.40435383E-1, 2.22092256E-1, 2.40960747E-1}, +{1.40387163E-1, 1.89601168E-1, 2.05635697E-1}, +{2.11695507E-1, 2.36578360E-1, 2.81248927E-1}, +{9.03010592E-2, 1.27157405E-1, 2.33567923E-1}, +{1.10118054E-1, 2.09328398E-1, 2.72836268E-1}, +{1.16710417E-1, 1.77853987E-1, 2.22808748E-1}, +{1.81691542E-1, 2.32265159E-1, 2.74991214E-1}, +{1.46553472E-1, 1.69474706E-1, 1.90245956E-1}, +{1.09213792E-1, 2.63291955E-1, 2.88490772E-1}, +{1.49815127E-1, 2.11342707E-1, 2.28899449E-1}, +{1.97645500E-1, 2.83229947E-1, 3.14882278E-1}, +{1.24495603E-1, 1.46097973E-1, 1.66125208E-1}, +{1.34878591E-1, 1.83030054E-1, 2.89288282E-1}, +{9.33032110E-2, 1.83962211E-1, 2.38543004E-1}, +{1.92844257E-1, 2.39588335E-1, 2.58421540E-1}, +{1.23796798E-1, 1.65556595E-1, 2.08408386E-1}, +{1.51144341E-1, 2.35801116E-1, 2.59280622E-1}, +{1.50657728E-1, 1.90052524E-1, 2.28362590E-1}, +{1.98180959E-1, 2.56794214E-1, 3.08975637E-1}, +{1.28490031E-1, 1.49084017E-1, 1.98376507E-1}, +{9.20595750E-2, 2.12231293E-1, 2.92948842E-1}, +{1.41698137E-1, 1.72356680E-1, 2.58454144E-1}, +{1.96733460E-1, 2.29709730E-1, 2.95780182E-1}, +{1.47062227E-1, 1.68918088E-1, 2.07363635E-1}, +{1.36309877E-1, 2.60373056E-1, 2.82607377E-1}, +{1.81041077E-1, 2.01826140E-1, 2.38867551E-1}, +{2.45326266E-1, 2.80183077E-1, 3.11954319E-1}, +{1.04131766E-1, 1.33040652E-1, 1.89834684E-1}, +{1.23298146E-1, 2.09621087E-1, 2.47813210E-1}, +{1.24040775E-1, 1.59827366E-1, 2.58856058E-1}, +{1.87048867E-1, 2.12488100E-1, 2.59629130E-1}, +{1.24255307E-1, 1.73768952E-1, 1.92850024E-1}, +{1.58917829E-1, 2.25389823E-1, 2.43284762E-1}, +{1.53421149E-1, 1.91807315E-1, 2.09249526E-1}, +{2.27154449E-1, 2.51181155E-1, 2.72600353E-1}, +{1.09922059E-1, 1.57100275E-1, 2.20024973E-1}, +{1.32782355E-1, 2.19485506E-1, 2.67028928E-1}, +{1.26857504E-1, 1.98836312E-1, 2.17928499E-1}, +{1.91415027E-1, 2.52424240E-1, 2.72652745E-1}, +{1.55277625E-1, 1.79573521E-1, 2.00773627E-1}, +{1.17547743E-1, 2.47869864E-1, 3.08279335E-1}, +{1.65706977E-1, 2.10339502E-1, 2.29199320E-1}, +{2.25694910E-1, 2.84438193E-1, 3.12106073E-1}, +{1.29503176E-1, 1.48420051E-1, 1.80180401E-1}, +{1.54752508E-1, 1.97748467E-1, 2.67275035E-1}, +{1.28590241E-1, 1.76178381E-1, 2.39905864E-1}, +{2.14926764E-1, 2.37634435E-1, 2.58794010E-1}, +{1.28322318E-1, 1.59338519E-1, 2.26626605E-1}, +{1.55747548E-1, 2.47740522E-1, 2.73726821E-1}, +{1.75741687E-1, 1.97952345E-1, 2.19115943E-1}, +{2.18626365E-1, 2.45809183E-1, 3.00479650E-1}, +{1.17709018E-1, 1.45512864E-1, 2.38044471E-1}, +{1.18006893E-1, 2.23775521E-1, 2.94175088E-1}, +{1.51349202E-1, 1.88157812E-1, 2.48743281E-1}, +{1.89312205E-1, 2.69580543E-1, 2.93785989E-1}, +{1.49895594E-1, 1.74537256E-1, 2.37430006E-1}, +{1.39775530E-1, 2.71709383E-1, 3.07839513E-1}, +{1.83945730E-1, 2.07717165E-1, 2.26722151E-1}, +{2.54552156E-1, 2.96640933E-1, 3.24801445E-1}}; + +static const float evrc_lspq_half_codebook3[256][4] = { +{2.36904725E-1, 2.56104350E-1, 3.16955745E-1, 4.07520533E-1}, +{2.97596931E-1, 3.23482454E-1, 3.47667515E-1, 3.74551237E-1}, +{2.73721159E-1, 2.98297524E-1, 3.29923928E-1, 3.83599102E-1}, +{3.07849586E-1, 3.32836270E-1, 3.89340341E-1, 4.05575991E-1}, +{2.33803615E-1, 2.60296524E-1, 3.67351949E-1, 4.04388249E-1}, +{2.97513664E-1, 3.15356553E-1, 3.85135233E-1, 4.02197123E-1}, +{2.85618782E-1, 3.10872793E-1, 3.65022361E-1, 3.84816766E-1}, +{3.35271597E-1, 3.55222225E-1, 3.81921113E-1, 3.98685753E-1}, +{2.00265601E-1, 2.50502288E-1, 3.70398223E-1, 4.32012677E-1}, +{3.07982087E-1, 3.33767712E-1, 3.58199060E-1, 3.78386796E-1}, +{2.60086119E-1, 3.25520277E-1, 3.56873333E-1, 3.84737790E-1}, +{3.01356375E-1, 3.41369390E-1, 4.00296748E-1, 4.17337179E-1}, +{2.67080963E-1, 2.97674358E-1, 3.69702041E-1, 3.89139235E-1}, +{2.72669852E-1, 3.49704087E-1, 3.91925275E-1, 4.06383276E-1}, +{2.52825916E-1, 3.49636555E-1, 3.84550989E-1, 4.05930996E-1}, +{3.42927098E-1, 3.74274015E-1, 4.05468166E-1, 4.20351923E-1}, +{2.52408743E-1, 2.80375838E-1, 3.21436584E-1, 3.88436913E-1}, +{2.96970189E-1, 3.17173600E-1, 3.65342557E-1, 4.02736843E-1}, +{2.81905174E-1, 3.01479161E-1, 3.34335625E-1, 4.07633483E-1}, +{3.26872945E-1, 3.47177684E-1, 3.75017703E-1, 4.05372381E-1}, +{2.36371145E-1, 3.16441059E-1, 3.48707020E-1, 3.82030427E-1}, +{2.87817597E-1, 3.13627005E-1, 4.05129731E-1, 4.23379660E-1}, +{2.77502477E-1, 3.01843822E-1, 3.72250855E-1, 4.19212818E-1}, +{3.28988850E-1, 3.61901104E-1, 4.02015507E-1, 4.19229805E-1}, +{2.24960461E-1, 2.74636388E-1, 3.77016127E-1, 3.94726515E-1}, +{3.01045477E-1, 3.40486169E-1, 3.74888122E-1, 4.02532160E-1}, +{2.59897947E-1, 3.30334961E-1, 3.57493818E-1, 4.08657968E-1}, +{3.00961852E-1, 3.56449068E-1, 4.04779494E-1, 4.22508955E-1}, +{2.20979586E-1, 3.16477656E-1, 4.01744068E-1, 4.20735776E-1}, +{2.79754996E-1, 3.30776095E-1, 4.11152899E-1, 4.32687044E-1}, +{2.64246881E-1, 3.16610634E-1, 3.83876741E-1, 4.36683774E-1}, +{3.44381154E-1, 3.85365665E-1, 4.24949467E-1, 4.41560209E-1}, +{2.19488308E-1, 2.36459881E-1, 3.42465997E-1, 4.24989998E-1}, +{2.91465104E-1, 3.22282016E-1, 3.72852802E-1, 3.91635895E-1}, +{2.74792433E-1, 3.16536307E-1, 3.45392585E-1, 3.74555230E-1}, +{3.10583472E-1, 3.35264921E-1, 3.87527227E-1, 4.23076212E-1}, +{2.23211512E-1, 2.98497617E-1, 3.68426204E-1, 3.90213728E-1}, +{2.89078832E-1, 3.26512754E-1, 3.76308680E-1, 4.09553707E-1}, +{2.63830125E-1, 3.08977246E-1, 3.81453037E-1, 4.04660761E-1}, +{3.47073615E-1, 3.64797831E-1, 3.86763453E-1, 4.04511690E-1}, +{2.18452707E-1, 2.75614083E-1, 3.62711072E-1, 4.18278992E-1}, +{3.15042794E-1, 3.40813220E-1, 3.78627181E-1, 3.96316767E-1}, +{2.79727697E-1, 3.31259727E-1, 3.60061288E-1, 3.81175518E-1}, +{3.18602443E-1, 3.38044286E-1, 4.09010768E-1, 4.30300415E-1}, +{2.64196932E-1, 2.90672481E-1, 3.68595004E-1, 4.31856751E-1}, +{2.72645593E-1, 3.63514841E-1, 3.96518826E-1, 4.20091212E-1}, +{2.26540968E-1, 3.50055099E-1, 3.93851519E-1, 4.12597001E-1}, +{3.53053868E-1, 3.69929552E-1, 4.09656048E-1, 4.26387310E-1}, +{2.60788381E-1, 2.85172462E-1, 3.45943332E-1, 3.97500694E-1}, +{3.01113129E-1, 3.28201890E-1, 3.56068015E-1, 4.10803795E-1}, +{2.88101614E-1, 3.09559643E-1, 3.43756795E-1, 4.24872875E-1}, +{3.10489357E-1, 3.51421893E-1, 3.93717408E-1, 4.15550530E-1}, +{2.22308263E-1, 3.26798201E-1, 3.77981663E-1, 3.98635030E-1}, +{3.02915514E-1, 3.22781920E-1, 3.98558855E-1, 4.25489604E-1}, +{2.77136803E-1, 3.19992602E-1, 3.77490878E-1, 4.29177463E-1}, +{3.38731766E-1, 3.58164370E-1, 4.08386350E-1, 4.25495386E-1}, +{2.18726233E-1, 2.84384966E-1, 3.94053698E-1, 4.16346967E-1}, +{3.01005960E-1, 3.44093680E-1, 3.69013667E-1, 4.15091276E-1}, +{2.80783713E-1, 3.33053648E-1, 3.76726151E-1, 3.97526860E-1}, +{3.14394057E-1, 3.62678826E-1, 4.23668981E-1, 4.41899240E-1}, +{2.66453624E-1, 3.08513761E-1, 3.97407174E-1, 4.17450190E-1}, +{2.94222653E-1, 3.41904402E-1, 4.12726879E-1, 4.34888899E-1}, +{2.87300706E-1, 3.32434595E-1, 3.78856659E-1, 4.38234031E-1}, +{3.57146621E-1, 3.98147047E-1, 4.29875731E-1, 4.44243908E-1}, +{2.29671344E-1, 2.51018614E-1, 3.41046572E-1, 4.04376328E-1}, +{2.94472575E-1, 3.34944606E-1, 3.60409737E-1, 3.83682847E-1}, +{2.88250983E-1, 3.11722696E-1, 3.31680059E-1, 3.65104675E-1}, +{3.24881613E-1, 3.45656693E-1, 3.88306379E-1, 4.05954897E-1}, +{2.50829220E-1, 2.77623534E-1, 3.70799541E-1, 3.90479207E-1}, +{2.93523371E-1, 3.28319192E-1, 3.92112255E-1, 4.09464061E-1}, +{2.83608794E-1, 3.03885639E-1, 3.78504395E-1, 3.97310555E-1}, +{3.34039807E-1, 3.52837384E-1, 3.97272944E-1, 4.14322019E-1}, +{2.21891895E-1, 2.51877457E-1, 3.71723533E-1, 4.31791008E-1}, +{3.13201427E-1, 3.41175437E-1, 3.65503550E-1, 3.88567209E-1}, +{2.71330535E-1, 3.39163721E-1, 3.62616420E-1, 3.95735979E-1}, +{3.07550132E-1, 3.47777665E-1, 4.01049614E-1, 4.32767451E-1}, +{2.59387434E-1, 2.87243843E-1, 3.86817336E-1, 4.06042695E-1}, +{2.85485208E-1, 3.44094992E-1, 4.02050495E-1, 4.19413745E-1}, +{2.65781403E-1, 3.40084374E-1, 3.69407654E-1, 4.27031696E-1}, +{3.53740931E-1, 3.84463251E-1, 4.11747813E-1, 4.26181793E-1}, +{2.43866488E-1, 2.68350184E-1, 3.42201948E-1, 3.98457229E-1}, +{2.93145239E-1, 3.34754169E-1, 3.61702800E-1, 3.98416638E-1}, +{2.91342974E-1, 3.13155174E-1, 3.36525917E-1, 3.87748599E-1}, +{3.05656791E-1, 3.62904549E-1, 3.88153434E-1, 4.05543149E-1}, +{2.17492327E-1, 3.11723530E-1, 3.75984788E-1, 4.28997755E-1}, +{2.91149259E-1, 3.29380929E-1, 4.03900385E-1, 4.22333181E-1}, +{2.90362060E-1, 3.09530973E-1, 3.78994226E-1, 4.13688362E-1}, +{3.29564869E-1, 3.77404690E-1, 4.06584859E-1, 4.24739718E-1}, +{2.46461585E-1, 2.71593273E-1, 3.66338253E-1, 4.30753767E-1}, +{3.14107716E-1, 3.37011874E-1, 3.80409718E-1, 4.11099434E-1}, +{2.76568413E-1, 3.27320695E-1, 3.58844280E-1, 4.28949475E-1}, +{3.17179084E-1, 3.58972430E-1, 4.04765844E-1, 4.40376341E-1}, +{2.42777750E-1, 3.34954798E-1, 3.96943450E-1, 4.13318396E-1}, +{2.88895488E-1, 3.25691164E-1, 4.22859550E-1, 4.43758667E-1}, +{2.77583301E-1, 3.25479031E-1, 3.89144659E-1, 4.41075861E-1}, +{3.59125674E-1, 3.90694141E-1, 4.21009541E-1, 4.35708523E-1}, +{2.20172390E-1, 2.47719273E-1, 3.54381859E-1, 4.25398111E-1}, +{3.06046784E-1, 3.27924728E-1, 3.66992772E-1, 3.93192589E-1}, +{2.70805597E-1, 3.16826642E-1, 3.45648706E-1, 4.11717594E-1}, +{3.23188901E-1, 3.45463097E-1, 3.89778793E-1, 4.21570778E-1}, +{2.46136114E-1, 3.12391996E-1, 3.72188628E-1, 3.95842731E-1}, +{3.03856730E-1, 3.24354768E-1, 3.85747254E-1, 4.14155006E-1}, +{2.81075418E-1, 3.18608463E-1, 3.85646880E-1, 4.02703643E-1}, +{3.53517115E-1, 3.72702539E-1, 3.96264613E-1, 4.13074911E-1}, +{2.09221140E-1, 2.95262218E-1, 3.80314291E-1, 4.31278229E-1}, +{3.25313628E-1, 3.46735477E-1, 3.70724022E-1, 3.91045630E-1}, +{2.86396503E-1, 3.43560040E-1, 3.69713604E-1, 3.89867842E-1}, +{3.27794671E-1, 3.47367823E-1, 4.05465066E-1, 4.24566150E-1}, +{2.53054976E-1, 3.02656293E-1, 3.82165134E-1, 4.29898322E-1}, +{2.94418454E-1, 3.70745420E-1, 3.95443261E-1, 4.19514775E-1}, +{2.62873113E-1, 3.45069230E-1, 4.04140890E-1, 4.21902061E-1}, +{3.65063488E-1, 3.82435143E-1, 4.13424790E-1, 4.31241691E-1}, +{2.48788506E-1, 2.82372773E-1, 3.65772307E-1, 4.10981059E-1}, +{3.07288766E-1, 3.27828944E-1, 3.77664983E-1, 4.36220944E-1}, +{2.98542321E-1, 3.20627332E-1, 3.50569665E-1, 4.27620232E-1}, +{3.16258013E-1, 3.62903833E-1, 3.88225138E-1, 4.25608873E-1}, +{2.39077866E-1, 3.31310451E-1, 3.70317876E-1, 4.15995896E-1}, +{3.03735793E-1, 3.32806051E-1, 4.10232842E-1, 4.27751064E-1}, +{2.96002507E-1, 3.19014788E-1, 3.81062448E-1, 4.26954985E-1}, +{3.32508922E-1, 3.62516999E-1, 4.23315108E-1, 4.40995157E-1}, +{2.35128701E-1, 2.74731100E-1, 4.12070572E-1, 4.35478806E-1}, +{2.98073769E-1, 3.55338752E-1, 3.79087746E-1, 4.15318787E-1}, +{2.83429801E-1, 3.45264912E-1, 3.70376289E-1, 4.09900844E-1}, +{3.23593080E-1, 3.65412831E-1, 4.12813127E-1, 4.31023479E-1}, +{2.76626348E-1, 3.00508440E-1, 4.02236879E-1, 4.26638782E-1}, +{2.94512928E-1, 3.61443222E-1, 4.19635236E-1, 4.36999202E-1}, +{2.90807247E-1, 3.41689348E-1, 3.92779291E-1, 4.43490267E-1}, +{3.59391451E-1, 4.03985143E-1, 4.40843761E-1, 4.53028619E-1}, +{2.23295465E-1, 2.39192486E-1, 3.23768020E-1, 4.21689451E-1}, +{2.94778049E-1, 3.18798721E-1, 3.53217840E-1, 3.91906381E-1}, +{2.59032130E-1, 3.10240507E-1, 3.43569040E-1, 3.95064235E-1}, +{3.16474676E-1, 3.38544369E-1, 3.93329024E-1, 4.12235558E-1}, +{2.40108207E-1, 2.84631193E-1, 3.60280991E-1, 3.79973769E-1}, +{2.96909094E-1, 3.15798342E-1, 3.94964337E-1, 4.15127575E-1}, +{2.85434067E-1, 3.04921508E-1, 3.61974716E-1, 4.05767262E-1}, +{3.37407053E-1, 3.56672168E-1, 3.85155082E-1, 4.11186695E-1}, +{2.24014923E-1, 2.60116160E-1, 3.94772530E-1, 4.19585884E-1}, +{3.00647914E-1, 3.41640651E-1, 3.70223522E-1, 3.89520049E-1}, +{2.65946031E-1, 3.25039148E-1, 3.74339938E-1, 3.92346144E-1}, +{3.16029310E-1, 3.40491295E-1, 4.02355313E-1, 4.20484245E-1}, +{2.69841492E-1, 2.94562399E-1, 3.62341762E-1, 4.06415462E-1}, +{2.78897285E-1, 3.59831035E-1, 3.82025838E-1, 4.10577476E-1}, +{2.60760844E-1, 3.31088543E-1, 3.88826251E-1, 4.05486643E-1}, +{3.43372285E-1, 3.82647038E-1, 4.14716601E-1, 4.31592941E-1}, +{2.47998103E-1, 2.73393154E-1, 3.31160426E-1, 4.18943226E-1}, +{3.03579569E-1, 3.25202465E-1, 3.70984435E-1, 4.14420485E-1}, +{2.76896894E-1, 3.00499499E-1, 3.54178190E-1, 4.28807020E-1}, +{3.23655546E-1, 3.59816968E-1, 3.89525414E-1, 4.09288704E-1}, +{2.38927796E-1, 3.09919238E-1, 3.53915572E-1, 4.16634321E-1}, +{2.81171739E-1, 3.07520270E-1, 4.16264892E-1, 4.38523829E-1}, +{2.88858652E-1, 3.09810817E-1, 3.67845178E-1, 4.36035573E-1}, +{3.38423491E-1, 3.70634377E-1, 4.15449977E-1, 4.31534529E-1}, +{2.41260394E-1, 2.73617864E-1, 3.89554620E-1, 4.12539542E-1}, +{2.98046708E-1, 3.40122104E-1, 3.86183739E-1, 4.13826346E-1}, +{2.82436430E-1, 3.31597507E-1, 3.57941389E-1, 4.12115216E-1}, +{3.03820193E-1, 3.70588601E-1, 4.05774951E-1, 4.31517065E-1}, +{2.39077732E-1, 3.11638474E-1, 4.13935781E-1, 4.35304046E-1}, +{2.67116845E-1, 3.41937900E-1, 4.17409420E-1, 4.39184844E-1}, +{2.67946839E-1, 3.33343923E-1, 3.86481404E-1, 4.37462509E-1}, +{3.40510964E-1, 3.90878022E-1, 4.35485125E-1, 4.49101925E-1}, +{2.10069850E-1, 2.32524484E-1, 3.61781418E-1, 4.31357861E-1}, +{2.94509888E-1, 3.33709776E-1, 3.82278621E-1, 3.98638904E-1}, +{2.80525148E-1, 3.25905204E-1, 3.50647032E-1, 3.92873943E-1}, +{3.19999635E-1, 3.43674660E-1, 3.91070545E-1, 4.37501073E-1}, +{2.20581010E-1, 3.03151906E-1, 3.81765544E-1, 4.04488146E-1}, +{2.86122739E-1, 3.29746544E-1, 3.88102829E-1, 4.24247742E-1}, +{2.69807100E-1, 3.25332284E-1, 3.79154503E-1, 4.15138245E-1}, +{3.34858894E-1, 3.69258404E-1, 3.94743145E-1, 4.11922157E-1}, +{2.07109794E-1, 2.72779524E-1, 3.78566444E-1, 4.34579968E-1}, +{3.06466222E-1, 3.46695721E-1, 3.87138307E-1, 4.03558314E-1}, +{2.70148575E-1, 3.46654534E-1, 3.77696693E-1, 3.96434486E-1}, +{3.18745911E-1, 3.40225697E-1, 4.14991558E-1, 4.41578746E-1}, +{2.58592844E-1, 3.14370096E-1, 3.65083754E-1, 4.21615183E-1}, +{2.82712996E-1, 3.54137123E-1, 4.06745970E-1, 4.29267883E-1}, +{2.52021760E-1, 3.59105110E-1, 3.95102918E-1, 4.18148398E-1}, +{3.54906201E-1, 3.74952912E-1, 4.18965995E-1, 4.36144412E-1}, +{2.64841139E-1, 2.92941809E-1, 3.27751458E-1, 4.08790469E-1}, +{3.07774246E-1, 3.35586190E-1, 3.62209618E-1, 4.25394237E-1}, +{2.88466334E-1, 3.16075742E-1, 3.60989630E-1, 4.19551432E-1}, +{3.17128420E-1, 3.55772197E-1, 4.05808747E-1, 4.23972964E-1}, +{2.47089684E-1, 3.38184595E-1, 3.71859610E-1, 3.95971477E-1}, +{3.07981730E-1, 3.32691789E-1, 4.00534213E-1, 4.38273668E-1}, +{2.79484808E-1, 3.16183507E-1, 3.97237718E-1, 4.34746623E-1}, +{3.44490469E-1, 3.66153181E-1, 4.10959423E-1, 4.41727102E-1}, +{2.35741779E-1, 2.94587255E-1, 3.98072541E-1, 4.16833401E-1}, +{3.14038455E-1, 3.52272034E-1, 3.79138887E-1, 4.10969079E-1}, +{2.83002496E-1, 3.38136256E-1, 3.88641894E-1, 4.06193316E-1}, +{3.23625326E-1, 3.50243390E-1, 4.28089559E-1, 4.46630359E-1}, +{2.61252105E-1, 3.24970961E-1, 4.00214493E-1, 4.25321758E-1}, +{3.05284500E-1, 3.42164159E-1, 4.24475133E-1, 4.43830967E-1}, +{2.87374794E-1, 3.32500637E-1, 3.94308269E-1, 4.42538500E-1}, +{3.74075353E-1, 4.02026355E-1, 4.30933535E-1, 4.44160044E-1}, +{2.34503999E-1, 2.56218612E-1, 3.41238797E-1, 4.23045278E-1}, +{3.05492580E-1, 3.29156995E-1, 3.52709830E-1, 3.92439067E-1}, +{2.81323552E-1, 3.03292334E-1, 3.48925412E-1, 3.93163860E-1}, +{3.21893454E-1, 3.50419939E-1, 3.97317469E-1, 4.14560318E-1}, +{2.39684582E-1, 2.92451501E-1, 3.78937423E-1, 3.96535456E-1}, +{3.07307243E-1, 3.29127908E-1, 3.98455560E-1, 4.16143298E-1}, +{2.85274565E-1, 3.08774531E-1, 3.92916501E-1, 4.14437652E-1}, +{3.44446361E-1, 3.62201869E-1, 3.97619784E-1, 4.17743623E-1}, +{2.32083067E-1, 2.67807961E-1, 3.78075659E-1, 4.34560895E-1}, +{3.04738700E-1, 3.51865292E-1, 3.75973165E-1, 3.95293653E-1}, +{2.61990905E-1, 3.46207321E-1, 3.71296942E-1, 4.12438929E-1}, +{3.11080933E-1, 3.51040900E-1, 4.16082799E-1, 4.34340119E-1}, +{2.74980426E-1, 2.96631455E-1, 3.87520492E-1, 4.09243762E-1}, +{2.90939093E-1, 3.54455590E-1, 3.93426955E-1, 4.08220291E-1}, +{2.71871865E-1, 3.45510781E-1, 3.87125313E-1, 4.22590613E-1}, +{3.63245904E-1, 3.81932199E-1, 4.04114902E-1, 4.18370664E-1}, +{2.45770738E-1, 2.72909343E-1, 3.48317921E-1, 4.25161839E-1}, +{3.14139009E-1, 3.37872326E-1, 3.65195215E-1, 4.04423416E-1}, +{2.94075787E-1, 3.16935539E-1, 3.43047202E-1, 4.06130373E-1}, +{3.14627469E-1, 3.72413397E-1, 4.00660694E-1, 4.17930841E-1}, +{2.34014243E-1, 3.14007223E-1, 3.83003533E-1, 4.34829175E-1}, +{2.93635666E-1, 3.20529997E-1, 4.10837352E-1, 4.36393142E-1}, +{2.89505839E-1, 3.11828852E-1, 3.86311471E-1, 4.38771248E-1}, +{3.26317430E-1, 3.80858183E-1, 4.19721425E-1, 4.38795507E-1}, +{2.50809520E-1, 2.83018053E-1, 3.82247388E-1, 4.34244394E-1}, +{3.18994045E-1, 3.44855130E-1, 3.72690141E-1, 4.23067033E-1}, +{2.88380086E-1, 3.36622238E-1, 3.69742334E-1, 4.25057590E-1}, +{3.06107700E-1, 3.81856918E-1, 4.18206155E-1, 4.32868361E-1}, +{2.33898312E-1, 3.44861805E-1, 4.12176549E-1, 4.29216206E-1}, +{2.85980880E-1, 3.42903793E-1, 4.25112903E-1, 4.44299698E-1}, +{2.79858828E-1, 3.38789344E-1, 3.92085373E-1, 4.40541029E-1}, +{3.64509344E-1, 3.82202744E-1, 4.29830611E-1, 4.45818365E-1}, +{2.34392300E-1, 2.57377386E-1, 3.59567046E-1, 4.30088580E-1}, +{3.05031896E-1, 3.27589393E-1, 3.78305554E-1, 4.01026130E-1}, +{2.77522624E-1, 3.18130314E-1, 3.67794275E-1, 4.01543021E-1}, +{3.33035767E-1, 3.55820954E-1, 3.87548923E-1, 4.24628675E-1}, +{2.45021001E-1, 3.12560678E-1, 3.91147614E-1, 4.08762813E-1}, +{2.97059119E-1, 3.40246916E-1, 3.92919302E-1, 4.28899705E-1}, +{2.77839303E-1, 3.25019777E-1, 3.97436380E-1, 4.15920913E-1}, +{3.49465251E-1, 3.70362461E-1, 3.95482540E-1, 4.31923389E-1}, +{2.31485590E-1, 2.91023374E-1, 3.77909541E-1, 4.32259738E-1}, +{3.19283485E-1, 3.53671074E-1, 3.80982876E-1, 3.97843361E-1}, +{2.89689243E-1, 3.50265682E-1, 3.80729675E-1, 3.97969365E-1}, +{3.28987300E-1, 3.52005422E-1, 4.12557244E-1, 4.37597930E-1}, +{2.76273251E-1, 3.02267194E-1, 3.81723404E-1, 4.34989095E-1}, +{2.79627264E-1, 3.73727322E-1, 4.12374616E-1, 4.30626333E-1}, +{2.53442764E-1, 3.65940034E-1, 4.14937019E-1, 4.32743609E-1}, +{3.76107216E-1, 3.95142019E-1, 4.16787744E-1, 4.33023572E-1}, +{2.62815833E-1, 2.88270533E-1, 3.47397208E-1, 4.24182594E-1}, +{3.01931322E-1, 3.43652546E-1, 3.77031326E-1, 4.34204459E-1}, +{2.97834277E-1, 3.23495388E-1, 3.64492416E-1, 4.33550835E-1}, +{3.31774473E-1, 3.64324927E-1, 3.98243546E-1, 4.35078323E-1}, +{2.49049723E-1, 3.27870786E-1, 3.83587003E-1, 4.35558081E-1}, +{3.04653406E-1, 3.27671230E-1, 4.18484688E-1, 4.41378772E-1}, +{2.96960890E-1, 3.23898911E-1, 3.90463710E-1, 4.39915955E-1}, +{3.43923748E-1, 3.67100477E-1, 4.29523230E-1, 4.45214987E-1}, +{2.59399652E-1, 2.91602671E-1, 4.04372454E-1, 4.31413233E-1}, +{2.97537506E-1, 3.57573807E-1, 3.88991833E-1, 4.30006981E-1}, +{2.84068942E-1, 3.49574566E-1, 3.81042838E-1, 4.29712772E-1}, +{3.25716257E-1, 3.74875903E-1, 4.31959271E-1, 4.47290838E-1}, +{2.65302956E-1, 3.14745963E-1, 4.16703463E-1, 4.37294722E-1}, +{3.00398588E-1, 3.54147255E-1, 4.28538084E-1, 4.60336387E-1}, +{2.98077166E-1, 3.49304914E-1, 4.00429249E-1, 4.48213518E-1}, +{3.75576198E-1, 4.16657329E-1, 4.42136765E-1, 4.52728629E-1}}; + +static const float evrc_lspq_quant_codebook1[16][5] = { +{0.42091064E-1, 0.69474973E-1, 0.11168948E+0, 0.14571965E+0, 0.20893581E+0}, +{0.54944664E-1, 0.98242261E-1, 0.11007882E+0, 0.15890779E+0, 0.20548241E+0}, +{0.45188572E-1, 0.75199433E-1, 0.11423391E+0, 0.15469728E+0, 0.19746706E+0}, +{0.49474996E-1, 0.79667501E-1, 0.12571351E+0, 0.16944779E+0, 0.20775315E+0}, +{0.41789379E-1, 0.63459560E-1, 0.12068028E+0, 0.15850765E+0, 0.20406815E+0}, +{0.47159236E-1, 0.79129547E-1, 0.12183110E+0, 0.15650047E+0, 0.22309226E+0}, +{0.54539919E-1, 0.80343045E-1, 0.12947764E+0, 0.15186153E+0, 0.20171718E+0}, +{0.55852082E-1, 0.94114847E-1, 0.14016025E+0, 0.17807084E+0, 0.22955489E+0}, +{0.45443531E-1, 0.73541410E-1, 0.11937657E+0, 0.15442030E+0, 0.21010752E+0}, +{0.63178010E-1, 0.95231488E-1, 0.12364983E+0, 0.17672543E+0, 0.21743731E+0}, +{0.52765369E-1, 0.84351443E-1, 0.11589085E+0, 0.15790924E+0, 0.20732352E+0}, +{0.51865745E-1, 0.81328541E-1, 0.13756232E+0, 0.18322878E+0, 0.21640070E+0}, +{0.44419531E-1, 0.68874463E-1, 0.13115251E+0, 0.16263582E+0, 0.21659100E+0}, +{0.49378436E-1, 0.81882551E-1, 0.13067168E+0, 0.16821896E+0, 0.23136081E+0}, +{0.55909779E-1, 0.90783298E-1, 0.13348848E+0, 0.16298474E+0, 0.20961523E+0}, +{0.61378211E-1, 0.98602772E-1, 0.14793332E+0, 0.19283190E+0, 0.23156509E+0}}; + +static const float evrc_lspq_quant_codebook2[16][5] = { +{0.26822963, 0.30585295, 0.31110349, 0.36823335, 0.40774474}, +{0.24418014, 0.28970167, 0.32573757, 0.39021483, 0.41345838}, +{0.23341830, 0.30078292, 0.32893899, 0.38557330, 0.41068462}, +{0.25905868, 0.29756859, 0.34196618, 0.38531172, 0.41295227}, +{0.24290450, 0.29223618, 0.32718554, 0.37788135, 0.40332928}, +{0.24674191, 0.29749370, 0.33631226, 0.39426059, 0.42258954}, +{0.21377595, 0.33140418, 0.34067687, 0.38222077, 0.40939021}, +{0.26673481, 0.30791649, 0.34419721, 0.39611506, 0.42387524}, +{0.26121426, 0.30492544, 0.32997236, 0.38486803, 0.42023736}, +{0.24954870, 0.29372856, 0.33382735, 0.37850669, 0.41714057}, +{0.24158891, 0.30173415, 0.34128246, 0.38428575, 0.41619650}, +{0.25818908, 0.31736413, 0.34904337, 0.38769925, 0.41551358}, +{0.24450587, 0.30673453, 0.33579323, 0.37844428, 0.40557048}, +{0.25164026, 0.31225079, 0.33847794, 0.39554194, 0.42396802}, +{0.22787990, 0.31779197, 0.33831909, 0.40044111, 0.41185561}, +{0.27896860, 0.32261974, 0.35658112, 0.40206763, 0.42370448}}; + +static const float * const evrc_lspq_full_codebooks[] = { + evrc_lspq_full_codebook1[0], evrc_lspq_full_codebook2[0], + evrc_lspq_full_codebook3[0], evrc_lspq_full_codebook4[0], +}; + +static const float * const evrc_lspq_half_codebooks[] = { + evrc_lspq_half_codebook1[0], evrc_lspq_half_codebook2[0], + evrc_lspq_half_codebook3[0], +}; + +static const float * const evrc_lspq_quant_codebooks[] = { + evrc_lspq_quant_codebook1[0], evrc_lspq_quant_codebook2[0], +}; + +static const float * const * const evrc_lspq_codebooks[] = { + 0, + evrc_lspq_quant_codebooks, + 0, + evrc_lspq_half_codebooks, + evrc_lspq_full_codebooks, +}; + +static const uint8_t evrc_lspq_nb_codebooks[] = { + 0, + FF_ARRAY_ELEMS(evrc_lspq_quant_codebooks), + 0, + FF_ARRAY_ELEMS(evrc_lspq_half_codebooks), + FF_ARRAY_ELEMS(evrc_lspq_full_codebooks), +}; + +static const uint8_t evrc_lspq_full_codebooks_row_sizes[] = { + FF_ARRAY_ELEMS(evrc_lspq_full_codebook1[0]), + FF_ARRAY_ELEMS(evrc_lspq_full_codebook2[0]), + FF_ARRAY_ELEMS(evrc_lspq_full_codebook3[0]), + FF_ARRAY_ELEMS(evrc_lspq_full_codebook4[0]), +}; + +static const uint8_t evrc_lspq_half_codebooks_row_sizes[] = { + FF_ARRAY_ELEMS(evrc_lspq_half_codebook1[0]), + FF_ARRAY_ELEMS(evrc_lspq_half_codebook2[0]), + FF_ARRAY_ELEMS(evrc_lspq_half_codebook3[0]), +}; + +static const uint8_t evrc_lspq_quant_codebooks_row_sizes[] = { + FF_ARRAY_ELEMS(evrc_lspq_quant_codebook1[0]), + FF_ARRAY_ELEMS(evrc_lspq_quant_codebook2[0]), +}; + +static const uint8_t* const evrc_lspq_codebooks_row_sizes[] = { + NULL, + evrc_lspq_quant_codebooks_row_sizes, + NULL, + evrc_lspq_half_codebooks_row_sizes, + evrc_lspq_full_codebooks_row_sizes, +}; + +static const float pitch_gain_vq[] = { 0, 0.3, 0.55, 0.7, 0.8, 0.9, 1, 1.2 }; +static const float estimation_delay[] = { 55.0, 80.0, 39.0, 71.0, 33.0 }; // 5.2.3.4 +static const uint8_t subframe_sizes[] = { 53, 53, 54 }; +#endif /* AVCODEC_EVRCDATA_H */ diff --git a/include/libavcodec/exif.h b/include/libavcodec/exif.h new file mode 100644 index 0000000..f70d213 --- /dev/null +++ b/include/libavcodec/exif.h @@ -0,0 +1,43 @@ +/* + * EXIF metadata parser + * Copyright (c) 2013 Thilo Borgmann + * + * 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 + */ + +/** + * @file + * EXIF metadata parser + * @author Thilo Borgmann + */ + +#ifndef AVCODEC_EXIF_H +#define AVCODEC_EXIF_H + +#include +#include "libavutil/dict.h" +#include "bytestream.h" + +/** Recursively decodes all IFD's and + * adds included TAGS into the metadata dictionary. */ +int avpriv_exif_decode_ifd(void *logctx, const uint8_t *buf, int size, + int le, int depth, AVDictionary **metadata); + +int ff_exif_decode_ifd(void *logctx, GetByteContext *gbytes, int le, + int depth, AVDictionary **metadata); + +#endif /* AVCODEC_EXIF_H */ diff --git a/include/libavcodec/exrdsp.h b/include/libavcodec/exrdsp.h new file mode 100644 index 0000000..ea37c8b --- /dev/null +++ b/include/libavcodec/exrdsp.h @@ -0,0 +1,34 @@ +/* + * 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_EXRDSP_H +#define AVCODEC_EXRDSP_H + +#include +#include + +typedef struct ExrDSPContext { + void (*reorder_pixels)(uint8_t *dst, const uint8_t *src, ptrdiff_t size); + void (*predictor)(uint8_t *src, ptrdiff_t size); +} ExrDSPContext; + +void ff_exrdsp_init(ExrDSPContext *c); +void ff_exrdsp_init_riscv(ExrDSPContext *c); +void ff_exrdsp_init_x86(ExrDSPContext *c); + +#endif /* AVCODEC_EXRDSP_H */ diff --git a/include/libavcodec/faandct.h b/include/libavcodec/faandct.h new file mode 100644 index 0000000..c5ef96d --- /dev/null +++ b/include/libavcodec/faandct.h @@ -0,0 +1,37 @@ +/* + * Floating point AAN DCT + * Copyright (c) 2003 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * @brief + * Floating point AAN DCT + * @author Michael Niedermayer + */ + +#ifndef AVCODEC_FAANDCT_H +#define AVCODEC_FAANDCT_H + +#include + +void ff_faandct(int16_t *data); +void ff_faandct248(int16_t *data); + +#endif /* AVCODEC_FAANDCT_H */ diff --git a/include/libavcodec/faanidct.h b/include/libavcodec/faanidct.h new file mode 100644 index 0000000..6f4da67 --- /dev/null +++ b/include/libavcodec/faanidct.h @@ -0,0 +1,32 @@ +/* + * Floating point AAN IDCT + * Copyright (c) 2008 Michael Niedermayer + * + * 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_FAANIDCT_H +#define AVCODEC_FAANIDCT_H + +#include +#include + +void ff_faanidct(int16_t block[64]); +void ff_faanidct_add(uint8_t *dest, ptrdiff_t line_size, int16_t block[64]); +void ff_faanidct_put(uint8_t *dest, ptrdiff_t line_size, int16_t block[64]); + +#endif /* AVCODEC_FAANIDCT_H */ diff --git a/include/libavcodec/faxcompr.h b/include/libavcodec/faxcompr.h new file mode 100644 index 0000000..aa29a7b --- /dev/null +++ b/include/libavcodec/faxcompr.h @@ -0,0 +1,46 @@ +/* + * CCITT Fax Group 3 and 4 decompression + * Copyright (c) 2008 Konstantin Shishkov + * + * 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 + */ + +/** + * @file + * CCITT Fax Group 3 and 4 decompression + * @author Konstantin Shishkov + */ +#ifndef AVCODEC_FAXCOMPR_H +#define AVCODEC_FAXCOMPR_H + +#include "avcodec.h" +#include "tiff.h" + +/** + * initialize unpacker code + */ +void ff_ccitt_unpack_init(void); + +/** + * unpack data compressed with CCITT Group 3 1/2-D or Group 4 method + */ +int ff_ccitt_unpack(AVCodecContext *avctx, + const uint8_t *src, int srcsize, + uint8_t *dst, int height, int stride, + enum TiffCompr compr, int opts); + +#endif /* AVCODEC_FAXCOMPR_H */ diff --git a/include/libavcodec/fdctdsp.h b/include/libavcodec/fdctdsp.h new file mode 100644 index 0000000..cad99ed --- /dev/null +++ b/include/libavcodec/fdctdsp.h @@ -0,0 +1,50 @@ +/* + * 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_FDCTDSP_H +#define AVCODEC_FDCTDSP_H + +#include + +#include "libavutil/attributes_internal.h" + +struct AVCodecContext; + +typedef struct FDCTDSPContext { + void (*fdct)(int16_t *block /* align 16 */); + void (*fdct248)(int16_t *block /* align 16 */); +} FDCTDSPContext; + +FF_VISIBILITY_PUSH_HIDDEN +void ff_fdctdsp_init(FDCTDSPContext *c, struct AVCodecContext *avctx); +void ff_fdctdsp_init_aarch64(FDCTDSPContext *c, struct AVCodecContext *avctx, + unsigned high_bit_depth); +void ff_fdctdsp_init_ppc(FDCTDSPContext *c, struct AVCodecContext *avctx, + unsigned high_bit_depth); +void ff_fdctdsp_init_x86(FDCTDSPContext *c, struct AVCodecContext *avctx, + unsigned high_bit_depth); + +void ff_fdct_ifast(int16_t *data); +void ff_fdct_ifast248(int16_t *data); +void ff_jpeg_fdct_islow_8(int16_t *data); +void ff_jpeg_fdct_islow_10(int16_t *data); +void ff_fdct248_islow_8(int16_t *data); +void ff_fdct248_islow_10(int16_t *data); +FF_VISIBILITY_POP_HIDDEN + +#endif /* AVCODEC_FDCTDSP_H */ diff --git a/include/libavcodec/ffjni.h b/include/libavcodec/ffjni.h new file mode 100644 index 0000000..d1e86f8 --- /dev/null +++ b/include/libavcodec/ffjni.h @@ -0,0 +1,146 @@ +/* + * JNI utility functions + * + * Copyright (c) 2015-2016 Matthieu Bouron + * + * 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_FFJNI_H +#define AVCODEC_FFJNI_H + +#include +#include + +/* + * Attach permanently a JNI environment to the current thread and retrieve it. + * + * If successfully attached, the JNI environment will automatically be detached + * at thread destruction. + * + * @param attached pointer to an integer that will be set to 1 if the + * environment has been attached to the current thread or 0 if it is + * already attached. + * @param log_ctx context used for logging, can be NULL + * @return the JNI environment on success, NULL otherwise + */ +JNIEnv *ff_jni_get_env(void *log_ctx); + +/* + * Convert a jstring to its utf characters equivalent. + * + * @param env JNI environment + * @param string Java string to convert + * @param log_ctx context used for logging, can be NULL + * @return a pointer to an array of unicode characters on success, NULL + * otherwise + */ +char *ff_jni_jstring_to_utf_chars(JNIEnv *env, jstring string, void *log_ctx); + +/* + * Convert utf chars to its jstring equivalent. + * + * @param env JNI environment + * @param utf_chars a pointer to an array of unicode characters + * @param log_ctx context used for logging, can be NULL + * @return a Java string object on success, NULL otherwise + */ +jstring ff_jni_utf_chars_to_jstring(JNIEnv *env, const char *utf_chars, void *log_ctx); + +/* + * Extract the error summary from a jthrowable in the form of "className: errorMessage" + * + * @param env JNI environment + * @param exception exception to get the summary from + * @param error address pointing to the error, the value is updated if a + * summary can be extracted + * @param log_ctx context used for logging, can be NULL + * @return 0 on success, < 0 otherwise + */ +int ff_jni_exception_get_summary(JNIEnv *env, jthrowable exception, char **error, void *log_ctx); + +/* + * Check if an exception has occurred,log it using av_log and clear it. + * + * @param env JNI environment + * @param log value used to enable logging if an exception has occurred, + * 0 disables logging, != 0 enables logging + * @param log_ctx context used for logging, can be NULL + */ +int ff_jni_exception_check(JNIEnv *env, int log, void *log_ctx); + +/* + * Jni field type. + */ +enum FFJniFieldType { + + FF_JNI_CLASS, + FF_JNI_FIELD, + FF_JNI_STATIC_FIELD, + FF_JNI_METHOD, + FF_JNI_STATIC_METHOD + +}; + +/* + * Jni field describing a class, a field or a method to be retrieved using + * the ff_jni_init_jfields method. + */ +struct FFJniField { + + const char *name; + const char *method; + const char *signature; + enum FFJniFieldType type; + size_t offset; + int mandatory; + +}; + +/* + * Retrieve class references, field ids and method ids to an arbitrary structure. + * + * @param env JNI environment + * @param jfields a pointer to an arbitrary structure where the different + * fields are declared and where the FFJNIField mapping table offsets are + * pointing to + * @param jfields_mapping null terminated array of FFJNIFields describing + * the class/field/method to be retrieved + * @param global make the classes references global. It is the caller + * responsibility to properly release global references. + * @param log_ctx context used for logging, can be NULL + * @return 0 on success, < 0 otherwise + */ +int ff_jni_init_jfields(JNIEnv *env, void *jfields, const struct FFJniField *jfields_mapping, int global, void *log_ctx); + +/* + * Delete class references, field ids and method ids of an arbitrary structure. + * + * @param env JNI environment + * @param jfields a pointer to an arbitrary structure where the different + * fields are declared and where the FFJNIField mapping table offsets are + * pointing to + * @param jfields_mapping null terminated array of FFJNIFields describing + * the class/field/method to be deleted + * @param global threat the classes references as global and delete them + * accordingly + * @param log_ctx context used for logging, can be NULL + * @return 0 on success, < 0 otherwise + */ +int ff_jni_reset_jfields(JNIEnv *env, void *jfields, const struct FFJniField *jfields_mapping, int global, void *log_ctx); + +#endif /* AVCODEC_FFJNI_H */ diff --git a/include/libavcodec/fflcms2.h b/include/libavcodec/fflcms2.h new file mode 100644 index 0000000..b54173e --- /dev/null +++ b/include/libavcodec/fflcms2.h @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2022 Niklas Haas + * 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 + */ + +/** + * @file + * Various functions for dealing with ICC profiles + */ + +#ifndef AVCODEC_FFLCMS2_H +#define AVCODEC_FFLCMS2_H + +#include "libavutil/csp.h" +#include "libavutil/frame.h" +#include "libavutil/pixfmt.h" + +#include + +typedef struct FFIccContext { + void *avctx; + cmsContext ctx; + cmsToneCurve *curves[AVCOL_TRC_NB]; /* tone curve cache */ +} FFIccContext; + +/** + * Initializes an FFIccContext. This must be done prior to using it. + * + * Returns 0 on success, or a negative error code. + */ +int ff_icc_context_init(FFIccContext *s, void *avctx); +void ff_icc_context_uninit(FFIccContext *s); + +/** + * Generate an ICC profile for a given combination of color primaries and + * transfer function. Both values must be set to valid entries (not + * "undefined") for this function to work. + * + * Returns 0 on success, or a negative error code. + */ +int ff_icc_profile_generate(FFIccContext *s, + enum AVColorPrimaries color_prim, + enum AVColorTransferCharacteristic color_trc, + cmsHPROFILE *out_profile); + +/** + * Attach an ICC profile to a frame. Helper wrapper around cmsSaveProfileToMem + * and av_frame_new_side_data_from_buf. + * + * Returns 0 on success, or a negative error code. + */ +int ff_icc_profile_attach(FFIccContext *s, cmsHPROFILE profile, AVFrame *frame); + +/** + * Sanitize an ICC profile to try and fix badly broken values. + * + * Returns 0 on success, or a negative error code. + */ +int ff_icc_profile_sanitize(FFIccContext *s, cmsHPROFILE profile); + +/** + * Read the color primaries and white point coefficients encoded by an ICC + * profile, and return the raw values in `out_primaries`. + * + * Returns 0 on success, or a negative error code. + */ +int ff_icc_profile_read_primaries(FFIccContext *s, cmsHPROFILE profile, + AVColorPrimariesDesc *out_primaries); + +/** + * Attempt detecting the transfer characteristic that best approximates the + * transfer function encoded by an ICC profile. Sets `out_trc` to + * AVCOL_TRC_UNSPECIFIED if no clear match can be identified. + * + * Returns 0 on success (including no match), or a negative error code. + */ +int ff_icc_profile_detect_transfer(FFIccContext *s, cmsHPROFILE profile, + enum AVColorTransferCharacteristic *out_trc); + +#endif /* AVCODEC_FFLCMS2_H */ diff --git a/include/libavcodec/ffv1.h b/include/libavcodec/ffv1.h new file mode 100644 index 0000000..5c14907 --- /dev/null +++ b/include/libavcodec/ffv1.h @@ -0,0 +1,217 @@ +/* + * FFV1 codec for libavcodec + * + * Copyright (c) 2003-2012 Michael Niedermayer + * + * 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_FFV1_H +#define AVCODEC_FFV1_H + +/** + * @file + * FF Video Codec 1 (a lossless codec) + */ + +#include "avcodec.h" +#include "get_bits.h" +#include "mathops.h" +#include "progressframe.h" +#include "put_bits.h" +#include "rangecoder.h" + +#ifdef __INTEL_COMPILER +#undef av_flatten +#define av_flatten +#endif + +#define MAX_PLANES 4 +#define CONTEXT_SIZE 32 + +#define MAX_QUANT_TABLES 8 +#define MAX_QUANT_TABLE_SIZE 256 +#define MAX_QUANT_TABLE_MASK (MAX_QUANT_TABLE_SIZE - 1) +#define MAX_CONTEXT_INPUTS 5 + +#define AC_GOLOMB_RICE 0 +#define AC_RANGE_DEFAULT_TAB 1 +#define AC_RANGE_CUSTOM_TAB 2 +#define AC_RANGE_DEFAULT_TAB_FORCE -2 + +typedef struct VlcState { + int16_t drift; + uint16_t error_sum; + int8_t bias; + uint8_t count; +} VlcState; + +typedef struct PlaneContext { + int quant_table_index; + int context_count; + uint8_t (*state)[CONTEXT_SIZE]; + VlcState *vlc_state; +} PlaneContext; + +#define MAX_SLICES 1024 + +typedef struct FFV1SliceContext { + int16_t *sample_buffer; + int32_t *sample_buffer32; + + int slice_width; + int slice_height; + int slice_x; + int slice_y; + int sx, sy; + + int run_index; + int slice_coding_mode; + int slice_rct_by_coef; + int slice_rct_ry_coef; + + // RefStruct reference, array of MAX_PLANES elements + PlaneContext *plane; + PutBitContext pb; + RangeCoder c; + + int ac_byte_count; ///< number of bytes used for AC coding + + union { + // decoder-only + struct { + int slice_reset_contexts; + int slice_damaged; + }; + + // encoder-only + struct { + uint64_t rc_stat[256][2]; + uint64_t (*rc_stat2[MAX_QUANT_TABLES])[32][2]; + }; + }; +} FFV1SliceContext; + +typedef struct FFV1Context { + AVClass *class; + AVCodecContext *avctx; + uint64_t rc_stat[256][2]; + uint64_t (*rc_stat2[MAX_QUANT_TABLES])[32][2]; + int version; + int micro_version; + int width, height; + int chroma_planes; + int chroma_h_shift, chroma_v_shift; + int transparency; + int flags; + int64_t picture_number; + int key_frame; + ProgressFrame picture, last_picture; + + const AVFrame *cur_enc_frame; + int plane_count; + int ac; ///< 1=range coder <-> 0=golomb rice + int16_t quant_tables[MAX_QUANT_TABLES][MAX_CONTEXT_INPUTS][MAX_QUANT_TABLE_SIZE]; + int context_count[MAX_QUANT_TABLES]; + uint8_t state_transition[256]; + uint8_t (*initial_states[MAX_QUANT_TABLES])[32]; + int colorspace; + + int use32bit; + + int ec; + int intra; + int key_frame_ok; + int context_model; + + int bits_per_raw_sample; + int packed_at_lsb; + + int gob_count; + int quant_table_count; + + int slice_count; + int max_slice_count; + int num_v_slices; + int num_h_slices; + + FFV1SliceContext *slices; + /* RefStruct object, per-slice damage flags shared between frame threads. + * + * After a frame thread marks some slice as finished with + * ff_progress_frame_report(), the corresponding array element must not be + * accessed by this thread anymore, as from then on it is owned by the next + * thread. + */ + uint8_t *slice_damaged; + /* Frame damage flag, used to delay announcing progress, since ER is + * applied after all the slices are decoded. + * NOT shared between frame threads. + */ + uint8_t frame_damaged; +} FFV1Context; + +int ff_ffv1_common_init(AVCodecContext *avctx); +int ff_ffv1_init_slice_state(const FFV1Context *f, FFV1SliceContext *sc); +int ff_ffv1_init_slices_state(FFV1Context *f); +int ff_ffv1_init_slice_contexts(FFV1Context *f); +PlaneContext *ff_ffv1_planes_alloc(void); +int ff_ffv1_allocate_initial_states(FFV1Context *f); +void ff_ffv1_clear_slice_state(const FFV1Context *f, FFV1SliceContext *sc); +int ff_ffv1_close(AVCodecContext *avctx); +int ff_need_new_slices(int width, int num_h_slices, int chroma_shift); + +static av_always_inline int fold(int diff, int bits) +{ + if (bits == 8) + diff = (int8_t)diff; + else { + diff = sign_extend(diff, bits); + } + + return diff; +} + +static inline void update_vlc_state(VlcState *const state, const int v) +{ + int drift = state->drift; + int count = state->count; + state->error_sum += FFABS(v); + drift += v; + + if (count == 128) { // FIXME: variable + count >>= 1; + drift >>= 1; + state->error_sum >>= 1; + } + count++; + + if (drift <= -count) { + state->bias = FFMAX(state->bias - 1, -128); + + drift = FFMAX(drift + count, -count + 1); + } else if (drift > 0) { + state->bias = FFMIN(state->bias + 1, 127); + + drift = FFMIN(drift - count, 0); + } + + state->drift = drift; + state->count = count; +} + +#endif /* AVCODEC_FFV1_H */ diff --git a/include/libavcodec/fits.h b/include/libavcodec/fits.h new file mode 100644 index 0000000..ebae85c --- /dev/null +++ b/include/libavcodec/fits.h @@ -0,0 +1,83 @@ +/* + * FITS image format common prototypes and structures + * Copyright (c) 2017 Paras Chadha + * + * 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_FITS_H +#define AVCODEC_FITS_H + +#include + +#include "libavutil/dict.h" + +typedef enum FITSHeaderState { + STATE_SIMPLE, + STATE_XTENSION, + STATE_BITPIX, + STATE_NAXIS, + STATE_NAXIS_N, + STATE_PCOUNT, + STATE_GCOUNT, + STATE_REST, +} FITSHeaderState; + +/** + * Structure to store the header keywords in FITS file + */ +typedef struct FITSHeader { + FITSHeaderState state; + unsigned naxis_index; + int bitpix; + int64_t blank; + int blank_found; + int naxis; + int naxisn[999]; + int pcount; + int gcount; + int groups; + int rgb; /**< 1 if file contains RGB image, 0 otherwise */ + int image_extension; + double bscale; + double bzero; + int data_min_found; + double data_min; + int data_max_found; + double data_max; +} FITSHeader; + + +/** + * Initialize a single header line + * @param header pointer to the header + * @param state current state of parsing the header + * @return 0 if successful otherwise AVERROR_INVALIDDATA + */ +int avpriv_fits_header_init(FITSHeader *header, FITSHeaderState state); + +/** + * Parse a single header line + * @param avcl used in av_log + * @param header pointer to the header + * @param line one header line + * @param metadata used to store metadata while decoding + * @return 0 if successful otherwise AVERROR_INVALIDDATA + */ +int avpriv_fits_header_parse_line(void *avcl, FITSHeader *header, const uint8_t line[80], AVDictionary ***metadata); + +#endif /* AVCODEC_FITS_H */ diff --git a/include/libavcodec/flac.h b/include/libavcodec/flac.h new file mode 100644 index 0000000..00e631e --- /dev/null +++ b/include/libavcodec/flac.h @@ -0,0 +1,75 @@ +/* + * FLAC (Free Lossless Audio Codec) common stuff + * Copyright (c) 2008 Justin Ruggles + * + * 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 + */ + +/** + * @file + * FLAC (Free Lossless Audio Codec) common stuff + */ + +#ifndef AVCODEC_FLAC_H +#define AVCODEC_FLAC_H + +#include "libavutil/intreadwrite.h" + +#define FLAC_STREAMINFO_SIZE 34 +#define FLAC_MAX_CHANNELS 8 +#define FLAC_MIN_BLOCKSIZE 16 +#define FLAC_MAX_BLOCKSIZE 65535 +#define FLAC_MIN_FRAME_SIZE 10 + +enum { + FLAC_CHMODE_INDEPENDENT = 0, + FLAC_CHMODE_LEFT_SIDE = 1, + FLAC_CHMODE_RIGHT_SIDE = 2, + FLAC_CHMODE_MID_SIDE = 3, +}; + +enum { + FLAC_METADATA_TYPE_STREAMINFO = 0, + FLAC_METADATA_TYPE_PADDING, + FLAC_METADATA_TYPE_APPLICATION, + FLAC_METADATA_TYPE_SEEKTABLE, + FLAC_METADATA_TYPE_VORBIS_COMMENT, + FLAC_METADATA_TYPE_CUESHEET, + FLAC_METADATA_TYPE_PICTURE, + FLAC_METADATA_TYPE_INVALID = 127 +}; + +/** + * Parse the metadata block parameters from the header. + * @param[in] block_header header data, at least 4 bytes + * @param[out] last indicator for last metadata block + * @param[out] type metadata block type + * @param[out] size metadata block size + */ +static av_always_inline void flac_parse_block_header(const uint8_t *block_header, + int *last, int *type, int *size) +{ + int tmp = *block_header; + if (last) + *last = tmp & 0x80; + if (type) + *type = tmp & 0x7F; + if (size) + *size = AV_RB24(block_header + 1); +} + +#endif /* AVCODEC_FLAC_H */ diff --git a/include/libavcodec/flac_parse.h b/include/libavcodec/flac_parse.h new file mode 100644 index 0000000..b0cbad8 --- /dev/null +++ b/include/libavcodec/flac_parse.h @@ -0,0 +1,89 @@ +/* + * FLAC (Free Lossless Audio Codec) decoder/parser common functions + * Copyright (c) 2008 Justin Ruggles + * + * 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 + */ + +/** + * @file + * FLAC (Free Lossless Audio Codec) decoder/parser common functions + */ + +#ifndef AVCODEC_FLAC_PARSE_H +#define AVCODEC_FLAC_PARSE_H + +#include "avcodec.h" +#include "get_bits.h" + +typedef struct FLACStreaminfo { + int samplerate; /**< sample rate */ + int channels; /**< number of channels */ + int bps; /**< bits-per-sample */ + int max_blocksize; /**< maximum block size, in samples */ + int max_framesize; /**< maximum frame size, in bytes */ + int64_t samples; /**< total number of samples */ +} FLACStreaminfo; + +typedef struct FLACFrameInfo { + int samplerate; /**< sample rate */ + int channels; /**< number of channels */ + int bps; /**< bits-per-sample */ + int blocksize; /**< block size of the frame */ + int ch_mode; /**< channel decorrelation mode */ + int64_t frame_or_sample_num; /**< frame number or sample number */ + int is_var_size; /**< specifies if the stream uses variable + block sizes or a fixed block size; + also determines the meaning of + frame_or_sample_num */ +} FLACFrameInfo; + +/** + * Parse the Streaminfo metadata block + * @param[out] avctx codec context to set basic stream parameters + * @param[out] s where parsed information is stored + * @param[in] buffer pointer to start of 34-byte streaminfo data + * + * @return negative error code on faiure or >= 0 on success + */ +int ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s, + const uint8_t *buffer); + +/** + * Validate the FLAC extradata. + * @param[in] avctx codec context containing the extradata. + * @param[out] format extradata format. + * @param[out] streaminfo_start pointer to start of 34-byte STREAMINFO data. + * @return 1 if valid, 0 if not valid. + */ +int ff_flac_is_extradata_valid(AVCodecContext *avctx, + uint8_t **streaminfo_start); + +/** + * Validate and decode a frame header. + * @param logctx context for logging + * @param gb GetBitContext from which to read frame header + * @param[out] fi frame information + * @param log_level_offset log level offset. can be used to silence error messages. + * @return non-zero on error, 0 if ok + */ +int ff_flac_decode_frame_header(void *logctx, GetBitContext *gb, + FLACFrameInfo *fi, int log_level_offset); + +void ff_flac_set_channel_layout(AVCodecContext *avctx, int channels); + +#endif /* AVCODEC_FLAC_PARSE_H */ diff --git a/include/libavcodec/flacdata.h b/include/libavcodec/flacdata.h new file mode 100644 index 0000000..ef21840 --- /dev/null +++ b/include/libavcodec/flacdata.h @@ -0,0 +1,31 @@ +/* + * FLAC data header + * Copyright (c) 2003 Alex Beregszaszi + * + * 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_FLACDATA_H +#define AVCODEC_FLACDATA_H + +#include + +extern const int ff_flac_sample_rate_table[16]; + +extern const int32_t ff_flac_blocksize_table[16]; + +#endif /* AVCODEC_FLACDATA_H */ diff --git a/include/libavcodec/flacdsp.h b/include/libavcodec/flacdsp.h new file mode 100644 index 0000000..3b7b35a --- /dev/null +++ b/include/libavcodec/flacdsp.h @@ -0,0 +1,49 @@ +/* + * 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_FLACDSP_H +#define AVCODEC_FLACDSP_H + +#include + +#include "libavutil/samplefmt.h" + +typedef struct FLACDSPContext { + void (*decorrelate[4])(uint8_t **out, int32_t **in, int channels, + int len, int shift); + void (*lpc16)(int32_t *samples, const int coeffs[32], int order, + int qlevel, int len); + void (*lpc32)(int32_t *samples, const int coeffs[32], int order, + int qlevel, int len); + void (*lpc33)(int64_t *samples, const int32_t *residual, const int coeffs[32], + int pred_order, int qlevel, int len); + void (*wasted32)(int32_t *decoded, int wasted, int len); + void (*wasted33)(int64_t *decoded, const int32_t *residual, + int wasted, int len); + void (*lpc16_encode)(int32_t *res, const int32_t *smp, int len, int order, + const int32_t coefs[32], int shift); + void (*lpc32_encode)(int32_t *res, const int32_t *smp, int len, int order, + const int32_t coefs[32], int shift); +} FLACDSPContext; + +void ff_flacdsp_init(FLACDSPContext *c, enum AVSampleFormat fmt, int channels); +void ff_flacdsp_init_arm(FLACDSPContext *c, enum AVSampleFormat fmt, int channels); +void ff_flacdsp_init_riscv(FLACDSPContext *c, enum AVSampleFormat fmt, int channels); +void ff_flacdsp_init_x86(FLACDSPContext *c, enum AVSampleFormat fmt, int channels); + +#endif /* AVCODEC_FLACDSP_H */ diff --git a/include/libavcodec/flacencdsp.h b/include/libavcodec/flacencdsp.h new file mode 100644 index 0000000..39811e2 --- /dev/null +++ b/include/libavcodec/flacencdsp.h @@ -0,0 +1,34 @@ +/* + * 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_FLACENCDSP_H +#define AVCODEC_FLACENCDSP_H + +#include + +typedef struct FLACEncDSPContext { + void (*lpc16_encode)(int32_t *res, const int32_t *smp, int len, int order, + const int32_t coefs[32], int shift); + void (*lpc32_encode)(int32_t *res, const int32_t *smp, int len, int order, + const int32_t coefs[32], int shift); +} FLACEncDSPContext; + +void ff_flacencdsp_init(FLACEncDSPContext *c); +void ff_flacencdsp_init_x86(FLACEncDSPContext *c); + +#endif /* AVCODEC_FLACDSP_H */ diff --git a/include/libavcodec/flvdec.h b/include/libavcodec/flvdec.h new file mode 100644 index 0000000..d5aff74 --- /dev/null +++ b/include/libavcodec/flvdec.h @@ -0,0 +1,28 @@ +/* + * FLV decoder header. + * + * 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_FLVDEC_H +#define AVCODEC_FLVDEC_H + +#include "mpegvideo.h" + +int ff_flv_decode_picture_header(MpegEncContext *s); + +#endif /* AVCODEC_FLVDEC_H */ diff --git a/include/libavcodec/flvenc.h b/include/libavcodec/flvenc.h new file mode 100644 index 0000000..1ecbb46 --- /dev/null +++ b/include/libavcodec/flvenc.h @@ -0,0 +1,31 @@ +/* + * FLV encoder header. + * + * 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_FLVENC_H +#define AVCODEC_FLVENC_H + +#include "mpegvideo.h" +#include "put_bits.h" + +void ff_flv_encode_picture_header(MpegEncContext *s); +void ff_flv2_encode_ac_esc(PutBitContext *pb, int slevel, int level, int run, + int last); + +#endif /* AVCODEC_FLV_H */ diff --git a/include/libavcodec/fmtconvert.h b/include/libavcodec/fmtconvert.h new file mode 100644 index 0000000..1cb4628 --- /dev/null +++ b/include/libavcodec/fmtconvert.h @@ -0,0 +1,68 @@ +/* + * Format Conversion Utils + * Copyright (c) 2000, 2001 Fabrice Bellard + * Copyright (c) 2002-2004 Michael Niedermayer + * + * 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_FMTCONVERT_H +#define AVCODEC_FMTCONVERT_H + +#include + +typedef struct FmtConvertContext { + /** + * Convert an array of int32_t to float and multiply by a float value. + * @param dst destination array of float. + * constraints: 16-byte aligned + * @param src source array of int32_t. + * constraints: 16-byte aligned + * @param len number of elements to convert. + * constraints: multiple of 8 + */ + void (*int32_to_float_fmul_scalar)(float *dst, const int32_t *src, + float mul, int len); + + /** + * Convert an array of int32_t to float and multiply by a float value from another array, + * stepping along the float array once for each 8 integers. + * @param c pointer to FmtConvertContext. + * @param dst destination array of float. + * constraints: 16-byte aligned + * @param src source array of int32_t. + * constraints: 16-byte aligned + * @param mul source array of float multipliers. + * @param len number of elements to convert. + * constraints: multiple of 8 + */ + void (*int32_to_float_fmul_array8)(struct FmtConvertContext *c, + float *dst, const int32_t *src, + const float *mul, int len); + +} FmtConvertContext; + +void ff_fmt_convert_init(FmtConvertContext *c); + +void ff_fmt_convert_init_aarch64(FmtConvertContext *c); +void ff_fmt_convert_init_arm(FmtConvertContext *c); +void ff_fmt_convert_init_ppc(FmtConvertContext *c); +void ff_fmt_convert_init_riscv(FmtConvertContext *c); +void ff_fmt_convert_init_x86(FmtConvertContext *c); +void ff_fmt_convert_init_mips(FmtConvertContext *c); + +#endif /* AVCODEC_FMTCONVERT_H */ diff --git a/include/libavcodec/frame_thread_encoder.h b/include/libavcodec/frame_thread_encoder.h new file mode 100644 index 0000000..201cba2 --- /dev/null +++ b/include/libavcodec/frame_thread_encoder.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2012 Michael Niedermayer + * + * 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_FRAME_THREAD_ENCODER_H +#define AVCODEC_FRAME_THREAD_ENCODER_H + +#include "avcodec.h" + +/** + * Initialize frame thread encoder. + * @note hardware encoders are not supported + */ +int ff_frame_thread_encoder_init(AVCodecContext *avctx); +void ff_frame_thread_encoder_free(AVCodecContext *avctx); +int ff_thread_video_encode_frame(AVCodecContext *avctx, AVPacket *pkt, + AVFrame *frame, int *got_packet_ptr); + +#endif /* AVCODEC_FRAME_THREAD_ENCODER_H */ diff --git a/include/libavcodec/g722.h b/include/libavcodec/g722.h new file mode 100644 index 0000000..a2a9ae4 --- /dev/null +++ b/include/libavcodec/g722.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) CMU 1993 Computer Science, Speech Group + * Chengxiang Lu and Alex Hauptmann + * Copyright (c) 2005 Steve Underwood + * Copyright (c) 2009 Kenan Gillet + * Copyright (c) 2010 Martin Storsjo + * + * 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_G722_H +#define AVCODEC_G722_H + +#include +#include "libavutil/log.h" +#include "g722dsp.h" + +#define PREV_SAMPLES_BUF_SIZE 1024 + +typedef struct G722Context { + const AVClass *class; + int bits_per_codeword; + int16_t prev_samples[PREV_SAMPLES_BUF_SIZE]; ///< memory of past decoded samples + int prev_samples_pos; ///< the number of values in prev_samples + + /** + * The band[0] and band[1] correspond respectively to the lower band and higher band. + */ + struct G722Band { + int16_t s_predictor; ///< predictor output value + int32_t s_zero; ///< previous output signal from zero predictor + int8_t part_reconst_mem[2]; ///< signs of previous partially reconstructed signals + int16_t prev_qtzd_reconst; ///< previous quantized reconstructed signal (internal value, using low_inv_quant4) + int16_t pole_mem[2]; ///< second-order pole section coefficient buffer + int32_t diff_mem[6]; ///< quantizer difference signal memory + int16_t zero_mem[6]; ///< Seventh-order zero section coefficient buffer + int16_t log_factor; ///< delayed 2-logarithmic quantizer factor + int16_t scale_factor; ///< delayed quantizer scale factor + } band[2]; + + struct TrellisNode { + struct G722Band state; + uint32_t ssd; + int path; + } *node_buf[2], **nodep_buf[2]; + + struct TrellisPath { + int value; + int prev; + } *paths[2]; + + G722DSPContext dsp; +} G722Context; + +extern const int16_t ff_g722_high_inv_quant[4]; +extern const int16_t ff_g722_low_inv_quant4[16]; +extern const int16_t ff_g722_low_inv_quant6[64]; + +void ff_g722_update_low_predictor(struct G722Band *band, const int ilow); + +void ff_g722_update_high_predictor(struct G722Band *band, const int dhigh, + const int ihigh); + +#endif /* AVCODEC_G722_H */ diff --git a/include/libavcodec/g722dsp.h b/include/libavcodec/g722dsp.h new file mode 100644 index 0000000..1aa7078 --- /dev/null +++ b/include/libavcodec/g722dsp.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2015 Peter Meerwald + * + * 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_G722DSP_H +#define AVCODEC_G722DSP_H + +#include + +typedef struct G722DSPContext { + void (*apply_qmf)(const int16_t *prev_samples, int xout[2]); +} G722DSPContext; + +void ff_g722dsp_init(G722DSPContext *c); +void ff_g722dsp_init_arm(G722DSPContext *c); +void ff_g722dsp_init_riscv(G722DSPContext *c); +void ff_g722dsp_init_x86(G722DSPContext *c); + +#endif /* AVCODEC_G722DSP_H */ diff --git a/include/libavcodec/g723_1.h b/include/libavcodec/g723_1.h new file mode 100644 index 0000000..521f220 --- /dev/null +++ b/include/libavcodec/g723_1.h @@ -0,0 +1,267 @@ +/* + * G.723.1 common header and data tables + * Copyright (c) 2006 Benjamin Larsson + * Copyright (c) 2010 Mohamed Naufal Basheer + * + * 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 + */ + +/** + * @file + * G.723.1 types, functions and data tables + */ + +#ifndef AVCODEC_G723_1_H +#define AVCODEC_G723_1_H + +#include + +#include "libavutil/log.h" + +#define SUBFRAMES 4 +#define SUBFRAME_LEN 60 +#define FRAME_LEN (SUBFRAME_LEN << 2) +#define HALF_FRAME_LEN (FRAME_LEN / 2) +#define LPC_FRAME (HALF_FRAME_LEN + SUBFRAME_LEN) +#define LPC_ORDER 10 +#define LSP_BANDS 3 +#define LSP_CB_SIZE 256 +#define PITCH_MIN 18 +#define PITCH_MAX (PITCH_MIN + 127) +#define PITCH_ORDER 5 +#define GRID_SIZE 2 +#define PULSE_MAX 6 +#define GAIN_LEVELS 24 +#define COS_TBL_SIZE 512 + +/** + * Bitexact implementation of 2ab scaled by 1/2^16. + * + * @param a 32 bit multiplicand + * @param b 16 bit multiplier + */ +#define MULL2(a, b) \ + ((((a) >> 16) * (b) * 2) + (((a) & 0xffff) * (b) >> 15)) + +/** + * G723.1 frame types + */ +enum FrameType { + ACTIVE_FRAME, ///< Active speech + SID_FRAME, ///< Silence Insertion Descriptor frame + UNTRANSMITTED_FRAME +}; + +/** + * G723.1 rate values + */ +enum Rate { + RATE_6300, + RATE_5300 +}; + +/** + * G723.1 unpacked data subframe + */ +typedef struct G723_1_Subframe { + int ad_cb_lag; ///< adaptive codebook lag + int ad_cb_gain; + int dirac_train; + int pulse_sign; + int grid_index; + int amp_index; + int pulse_pos; +} G723_1_Subframe; + +/** + * Pitch postfilter parameters + */ +typedef struct PPFParam { + int index; ///< postfilter backward/forward lag + int16_t opt_gain; ///< optimal gain + int16_t sc_gain; ///< scaling gain +} PPFParam; + +/** + * Harmonic filter parameters + */ +typedef struct HFParam { + int index; + int gain; +} HFParam; + +/** + * Optimized fixed codebook excitation parameters + */ +typedef struct FCBParam { + int min_err; + int amp_index; + int grid_index; + int dirac_train; + int pulse_pos[PULSE_MAX]; + int pulse_sign[PULSE_MAX]; +} FCBParam; + +typedef struct G723_1_ChannelContext { + G723_1_Subframe subframe[4]; + enum FrameType cur_frame_type; + enum FrameType past_frame_type; + enum Rate cur_rate; + uint8_t lsp_index[LSP_BANDS]; + int pitch_lag[2]; + int erased_frames; + + int16_t prev_lsp[LPC_ORDER]; + int16_t sid_lsp[LPC_ORDER]; + int16_t prev_excitation[PITCH_MAX]; + int16_t excitation[PITCH_MAX + FRAME_LEN + 4]; + int16_t synth_mem[LPC_ORDER]; + int16_t fir_mem[LPC_ORDER]; + int iir_mem[LPC_ORDER]; + + int random_seed; + int cng_random_seed; + int interp_index; + int interp_gain; + int sid_gain; + int cur_gain; + int reflection_coef; + int pf_gain; ///< formant postfilter + ///< gain scaling unit memory + int16_t audio[FRAME_LEN + LPC_ORDER + PITCH_MAX + 4]; + + /* encoder */ + int16_t prev_data[HALF_FRAME_LEN]; + int16_t prev_weight_sig[PITCH_MAX]; + + int16_t hpf_fir_mem; ///< highpass filter fir + int hpf_iir_mem; ///< and iir memories + int16_t perf_fir_mem[LPC_ORDER]; ///< perceptual filter fir + int16_t perf_iir_mem[LPC_ORDER]; ///< and iir memories + + int16_t harmonic_mem[PITCH_MAX]; +} G723_1_ChannelContext; + +typedef struct G723_1_Context { + AVClass *class; + int postfilter; + + G723_1_ChannelContext ch[2]; +} G723_1_Context; + + +/** + * Scale vector contents based on the largest of their absolutes. + */ +int ff_g723_1_scale_vector(int16_t *dst, const int16_t *vector, int length); + +/** + * Calculate the number of left-shifts required for normalizing the input. + * + * @param num input number + * @param width width of the input, 16 bits(0) / 32 bits(1) + */ +int ff_g723_1_normalize_bits(int num, int width); + +int ff_g723_1_dot_product(const int16_t *a, const int16_t *b, int length); + +/** + * Get delayed contribution from the previous excitation vector. + */ +void ff_g723_1_get_residual(int16_t *residual, int16_t *prev_excitation, + int lag); + +/** + * Generate a train of dirac functions with period as pitch lag. + */ +void ff_g723_1_gen_dirac_train(int16_t *buf, int pitch_lag); + + +/** + * Generate adaptive codebook excitation. + */ +void ff_g723_1_gen_acb_excitation(int16_t *vector, int16_t *prev_excitation, + int pitch_lag, G723_1_Subframe *subfrm, + enum Rate cur_rate); +/** + * Quantize LSP frequencies by interpolation and convert them to + * the corresponding LPC coefficients. + * + * @param lpc buffer for LPC coefficients + * @param cur_lsp the current LSP vector + * @param prev_lsp the previous LSP vector + */ +void ff_g723_1_lsp_interpolate(int16_t *lpc, int16_t *cur_lsp, + int16_t *prev_lsp); + +/** + * Perform inverse quantization of LSP frequencies. + * + * @param cur_lsp the current LSP vector + * @param prev_lsp the previous LSP vector + * @param lsp_index VQ indices + * @param bad_frame bad frame flag + */ +void ff_g723_1_inverse_quant(int16_t *cur_lsp, int16_t *prev_lsp, + uint8_t *lsp_index, int bad_frame); + +static const uint8_t frame_size[4] = { 24, 20, 4, 1 }; + +/** + * LSP DC component + */ +static const int16_t dc_lsp[LPC_ORDER] = { + 0x0c3b, + 0x1271, + 0x1e0a, + 0x2a36, + 0x3630, + 0x406f, + 0x4d28, + 0x56f4, + 0x638c, + 0x6c46 +}; + +/* Cosine table scaled by 2^14 */ +extern const int16_t ff_g723_1_cos_tab[COS_TBL_SIZE + 1]; +#define G723_1_COS_TAB_FIRST_ELEMENT 16384 + +/** + * LSP VQ tables + */ +extern const int16_t ff_g723_1_lsp_band0[LSP_CB_SIZE][3]; +extern const int16_t ff_g723_1_lsp_band1[LSP_CB_SIZE][3]; +extern const int16_t ff_g723_1_lsp_band2[LSP_CB_SIZE][4]; + +/** + * Used for the coding/decoding of the pulses positions + * for the MP-MLQ codebook + */ +extern const int32_t ff_g723_1_combinatorial_table[PULSE_MAX][SUBFRAME_LEN/GRID_SIZE]; + +/** + * Number of non-zero pulses in the MP-MLQ excitation + */ +static const int8_t pulses[4] = {6, 5, 6, 5}; + +extern const int16_t ff_g723_1_fixed_cb_gain[GAIN_LEVELS]; + +extern const int16_t ff_g723_1_adaptive_cb_gain85 [ 85 * 20]; +extern const int16_t ff_g723_1_adaptive_cb_gain170[170 * 20]; + +#endif /* AVCODEC_G723_1_H */ diff --git a/include/libavcodec/g729.h b/include/libavcodec/g729.h new file mode 100644 index 0000000..7c5f693 --- /dev/null +++ b/include/libavcodec/g729.h @@ -0,0 +1,33 @@ +/* + * G.729, G729 Annex D decoders + * Copyright (c) 2008 Vladimir Voroshilov + * + * 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_G729_H +#define AVCODEC_G729_H + +/** + * subframe size + */ +#define SUBFRAME_SIZE 40 + +/* bytes per block */ +#define G729_8K_BLOCK_SIZE 10 +#define G729D_6K4_BLOCK_SIZE 8 + +#endif // AVCODEC_G729_H diff --git a/include/libavcodec/g729data.h b/include/libavcodec/g729data.h new file mode 100644 index 0000000..365ca47 --- /dev/null +++ b/include/libavcodec/g729data.h @@ -0,0 +1,382 @@ +/* + * data for G.729, G729 Annex D decoders + * Copyright (c) 2007 Vladimir Voroshilov + * + * 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_G729DATA_H +#define AVCODEC_G729DATA_H + +#include + +#define MA_NP 4 ///< Moving Average (MA) prediction order + +#define VQ_1ST_BITS 7 ///< first stage vector of quantizer (size in bits) +#define VQ_2ND_BITS 5 ///< second stage vector of quantizer (size in bits) + +#define GC_1ST_IDX_BITS_8K 3 ///< gain codebook (first stage) index, 8k mode (size in bits) +#define GC_2ND_IDX_BITS_8K 4 ///< gain codebook (second stage) index, 8k mode (size in bits) + +#define GC_1ST_IDX_BITS_6K4 3 ///< gain codebook (first stage) index, 6.4k mode (size in bits) +#define GC_2ND_IDX_BITS_6K4 3 ///< gain codebook (second stage) index, 6.4k mode (size in bits) + +/** + * first stage LSP codebook + * (10-dimensional, with 128 entries (3.24 of G.729) + */ +static const int16_t cb_lsp_1st[1< +#include "acelp_pitch_delay.h" +#include "audiodsp.h" + +/** + * tilt compensation factor (G.729, k1>0) + * 0.2 in Q15 + */ +#define G729_TILT_FACTOR_PLUS 6554 + +/** + * tilt compensation factor (G.729, k1<0) + * 0.9 in Q15 + */ +#define G729_TILT_FACTOR_MINUS 29491 + +/* 4.2.2 */ +#define FORMANT_PP_FACTOR_NUM 18022 //0.55 in Q15 +#define FORMANT_PP_FACTOR_DEN 22938 //0.70 in Q15 + +/** + * gain adjustment factor (G.729, 4.2.4) + * 0.9875 in Q15 + */ +#define G729_AGC_FACTOR 32358 +#define G729_AGC_FAC1 (32768-G729_AGC_FACTOR) + +/** + * 1.0 / (1.0 + 0.5) in Q15 + * where 0.5 is the minimum value of + * weight factor, controlling amount of long-term postfiltering + */ +#define MIN_LT_FILT_FACTOR_A 21845 + +/** + * Short interpolation filter length + */ +#define SHORT_INT_FILT_LEN 2 + +/** + * Long interpolation filter length + */ +#define LONG_INT_FILT_LEN 8 + +/** + * Number of analyzed fractional pitch delays in second stage of long-term + * postfilter + */ +#define ANALYZED_FRAC_DELAYS 7 + +/** + * Amount of past residual signal data stored in buffer + */ +#define RES_PREV_DATA_SIZE (PITCH_DELAY_MAX + LONG_INT_FILT_LEN + 1) + +/** + * \brief Signal postfiltering (4.2) + * \param dsp initialized DSP context + * \param[in,out] ht_prev_data (Q12) pointer to variable receiving tilt + * compensation filter data from previous subframe + * \param[in,out] voicing (Q0) pointer to variable receiving voicing decision + * \param lp_filter_coeffs (Q12) LP filter coefficients + * \param pitch_delay_int integer part of the pitch delay + * \param[in,out] residual (Q0) residual signal buffer (used in long-term postfilter) + * \param[in,out] res_filter_data (Q0) speech data of previous subframe + * \param[in,out] pos_filter_data (Q0) previous speech data for short-term postfilter + * \param[in,out] speech (Q0) signal buffer + * \param subframe_size size of subframe + * + * Filtering has the following stages: + * Long-term postfilter (4.2.1) + * Short-term postfilter (4.2.2). + * Tilt-compensation (4.2.3) + */ +void ff_g729_postfilter(AudioDSPContext *adsp, int16_t* ht_prev_data, int* voicing, + const int16_t *lp_filter_coeffs, int pitch_delay_int, + int16_t* residual, int16_t* res_filter_data, + int16_t* pos_filter_data, int16_t *speech, + int subframe_size); + +/** + * \brief Adaptive gain control (4.2.4) + * \param gain_before (Q0) gain of speech before applying postfilters + * \param gain_after (Q0) gain of speech after applying postfilters + * \param[in,out] speech (Q0) signal buffer + * \param subframe_size length of subframe + * \param gain_prev (Q12) previous value of gain coefficient + * + * \return (Q12) last value of gain coefficient + */ +int16_t ff_g729_adaptive_gain_control(int gain_before, int gain_after, int16_t *speech, + int subframe_size, int16_t gain_prev); + +#endif // AVCODEC_G729POSTFILTER_H diff --git a/include/libavcodec/get_bits.h b/include/libavcodec/get_bits.h new file mode 100644 index 0000000..fe2f637 --- /dev/null +++ b/include/libavcodec/get_bits.h @@ -0,0 +1,716 @@ +/* + * Copyright (c) 2004 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * bitstream reader API header. + */ + +#ifndef AVCODEC_GET_BITS_H +#define AVCODEC_GET_BITS_H + +#include + +#include "libavutil/common.h" +#include "libavutil/intreadwrite.h" +#include "libavutil/avassert.h" + +#include "defs.h" +#include "mathops.h" +#include "vlc.h" + +/* + * Safe bitstream reading: + * optionally, the get_bits API can check to ensure that we + * don't read past input buffer boundaries. This is protected + * with CONFIG_SAFE_BITSTREAM_READER at the global level, and + * then below that with UNCHECKED_BITSTREAM_READER at the per- + * decoder level. This means that decoders that check internally + * can "#define UNCHECKED_BITSTREAM_READER 1" to disable + * overread checks. + * Boundary checking causes a minor performance penalty so for + * applications that won't want/need this, it can be disabled + * globally using "#define CONFIG_SAFE_BITSTREAM_READER 0". + */ +#ifndef UNCHECKED_BITSTREAM_READER +#define UNCHECKED_BITSTREAM_READER !CONFIG_SAFE_BITSTREAM_READER +#endif + +#ifndef CACHED_BITSTREAM_READER +#define CACHED_BITSTREAM_READER 0 +#endif + +#if CACHED_BITSTREAM_READER + +// we always want the LE implementation, to provide get_bits_le() +#define BITSTREAM_LE + +#ifndef BITSTREAM_READER_LE +# define BITSTREAM_BE +# define BITSTREAM_DEFAULT_BE +#endif + +#include "bitstream.h" + +#undef BITSTREAM_LE +#undef BITSTREAM_BE +#undef BITSTREAM_DEFAULT_BE + +typedef BitstreamContext GetBitContext; + +#define get_bits_count bits_tell +#define get_bits_left bits_left +#define skip_bits_long bits_skip +#define skip_bits bits_skip +#define get_bits bits_read_nz +#define get_bitsz bits_read +#define get_bits_long bits_read +#define get_bits1 bits_read_bit +#define get_bits64 bits_read_64 +#define get_xbits bits_read_xbits +#define get_sbits bits_read_signed_nz +#define get_sbits_long bits_read_signed +#define show_bits bits_peek +#define show_bits_long bits_peek +#define init_get_bits bits_init +#define init_get_bits8 bits_init8 +#define align_get_bits bits_align +#define get_vlc2 bits_read_vlc +#define get_vlc_multi bits_read_vlc_multi + +#define init_get_bits8_le(s, buffer, byte_size) bits_init8_le((BitstreamContextLE*)s, buffer, byte_size) +#define get_bits_le(s, n) bits_read_le((BitstreamContextLE*)s, n) + +#define show_bits1(s) bits_peek(s, 1) +#define skip_bits1(s) bits_skip(s, 1) + +#define skip_1stop_8data_bits bits_skip_1stop_8data + +#else // CACHED_BITSTREAM_READER + +typedef struct GetBitContext { + const uint8_t *buffer, *buffer_end; + int index; + int size_in_bits; + int size_in_bits_plus8; +} GetBitContext; + +static inline unsigned int get_bits(GetBitContext *s, int n); +static inline void skip_bits(GetBitContext *s, int n); +static inline unsigned int show_bits(GetBitContext *s, int n); + +/* Bitstream reader API docs: + * name + * arbitrary name which is used as prefix for the internal variables + * + * gb + * getbitcontext + * + * OPEN_READER(name, gb) + * load gb into local variables + * + * CLOSE_READER(name, gb) + * store local vars in gb + * + * UPDATE_CACHE(name, gb) + * Refill the internal cache from the bitstream. + * After this call at least MIN_CACHE_BITS will be available. + * + * GET_CACHE(name, gb) + * Will output the contents of the internal cache, + * next bit is MSB of 32 or 64 bits (FIXME 64 bits). + * + * SHOW_UBITS(name, gb, num) + * Will return the next num bits. + * + * SHOW_SBITS(name, gb, num) + * Will return the next num bits and do sign extension. + * + * SKIP_BITS(name, gb, num) + * Will skip over the next num bits. + * Note, this is equivalent to SKIP_CACHE; SKIP_COUNTER. + * + * SKIP_CACHE(name, gb, num) + * Will remove the next num bits from the cache (note SKIP_COUNTER + * MUST be called before UPDATE_CACHE / CLOSE_READER). + * + * SKIP_COUNTER(name, gb, num) + * Will increment the internal bit counter (see SKIP_CACHE & SKIP_BITS). + * + * LAST_SKIP_BITS(name, gb, num) + * Like SKIP_BITS, to be used if next call is UPDATE_CACHE or CLOSE_READER. + * + * BITS_LEFT(name, gb) + * Return the number of bits left + * + * For examples see get_bits, show_bits, skip_bits, get_vlc. + */ + +#if defined LONG_BITSTREAM_READER +# define MIN_CACHE_BITS 32 +#else +# define MIN_CACHE_BITS 25 +#endif + +#define OPEN_READER_NOSIZE(name, gb) \ + unsigned int name ## _index = (gb)->index; \ + unsigned int av_unused name ## _cache + +#if UNCHECKED_BITSTREAM_READER +#define OPEN_READER(name, gb) OPEN_READER_NOSIZE(name, gb) + +#define BITS_AVAILABLE(name, gb) 1 +#else +#define OPEN_READER(name, gb) \ + OPEN_READER_NOSIZE(name, gb); \ + unsigned int name ## _size_plus8 = (gb)->size_in_bits_plus8 + +#define BITS_AVAILABLE(name, gb) name ## _index < name ## _size_plus8 +#endif + +#define CLOSE_READER(name, gb) (gb)->index = name ## _index + +#define UPDATE_CACHE_BE_EXT(name, gb, bits, dst_bits) name ## _cache = \ + AV_RB ## bits((gb)->buffer + (name ## _index >> 3)) << (name ## _index & 7) >> (bits - dst_bits) + +#define UPDATE_CACHE_LE_EXT(name, gb, bits, dst_bits) name ## _cache = \ + (uint ## dst_bits ## _t)(AV_RL ## bits((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7)) + +/* Using these two macros ensures that 32 bits are available. */ +# define UPDATE_CACHE_LE_32(name, gb) UPDATE_CACHE_LE_EXT(name, (gb), 64, 32) + +# define UPDATE_CACHE_BE_32(name, gb) UPDATE_CACHE_BE_EXT(name, (gb), 64, 32) + +# ifdef LONG_BITSTREAM_READER + +# define UPDATE_CACHE_LE(name, gb) UPDATE_CACHE_LE_32(name, (gb)) + +# define UPDATE_CACHE_BE(name, gb) UPDATE_CACHE_BE_32(name, (gb)) + +#else + +# define UPDATE_CACHE_LE(name, gb) UPDATE_CACHE_LE_EXT(name, (gb), 32, 32) + +# define UPDATE_CACHE_BE(name, gb) UPDATE_CACHE_BE_EXT(name, (gb), 32, 32) + +#endif + + +#ifdef BITSTREAM_READER_LE + +# define UPDATE_CACHE(name, gb) UPDATE_CACHE_LE(name, gb) +# define UPDATE_CACHE_32(name, gb) UPDATE_CACHE_LE_32(name, (gb)) + +# define SKIP_CACHE(name, gb, num) name ## _cache >>= (num) + +#else + +# define UPDATE_CACHE(name, gb) UPDATE_CACHE_BE(name, gb) +# define UPDATE_CACHE_32(name, gb) UPDATE_CACHE_BE_32(name, (gb)) + +# define SKIP_CACHE(name, gb, num) name ## _cache <<= (num) + +#endif + +#if UNCHECKED_BITSTREAM_READER +# define SKIP_COUNTER(name, gb, num) name ## _index += (num) +#else +# define SKIP_COUNTER(name, gb, num) \ + name ## _index = FFMIN(name ## _size_plus8, name ## _index + (num)) +#endif + +#define BITS_LEFT(name, gb) ((int)((gb)->size_in_bits - name ## _index)) + +#define SKIP_BITS(name, gb, num) \ + do { \ + SKIP_CACHE(name, gb, num); \ + SKIP_COUNTER(name, gb, num); \ + } while (0) + +#define LAST_SKIP_BITS(name, gb, num) SKIP_COUNTER(name, gb, num) + +#define SHOW_UBITS_LE(name, gb, num) zero_extend(name ## _cache, num) +#define SHOW_SBITS_LE(name, gb, num) sign_extend(name ## _cache, num) + +#define SHOW_UBITS_BE(name, gb, num) NEG_USR32(name ## _cache, num) +#define SHOW_SBITS_BE(name, gb, num) NEG_SSR32(name ## _cache, num) + +#ifdef BITSTREAM_READER_LE +# define SHOW_UBITS(name, gb, num) SHOW_UBITS_LE(name, gb, num) +# define SHOW_SBITS(name, gb, num) SHOW_SBITS_LE(name, gb, num) +#else +# define SHOW_UBITS(name, gb, num) SHOW_UBITS_BE(name, gb, num) +# define SHOW_SBITS(name, gb, num) SHOW_SBITS_BE(name, gb, num) +#endif + +#define GET_CACHE(name, gb) ((uint32_t) name ## _cache) + + +static inline int get_bits_count(const GetBitContext *s) +{ + return s->index; +} + +/** + * Skips the specified number of bits. + * @param n the number of bits to skip, + * For the UNCHECKED_BITSTREAM_READER this must not cause the distance + * from the start to overflow int32_t. Staying within the bitstream + padding + * is sufficient, too. + */ +static inline void skip_bits_long(GetBitContext *s, int n) +{ +#if UNCHECKED_BITSTREAM_READER + s->index += n; +#else + s->index += av_clip(n, -s->index, s->size_in_bits_plus8 - s->index); +#endif +} + +/** + * Read MPEG-1 dc-style VLC (sign bit + mantissa with no MSB). + * if MSB not set it is negative + * @param n length in bits + */ +static inline int get_xbits(GetBitContext *s, int n) +{ + register int sign; + register int32_t cache; + OPEN_READER(re, s); + av_assert2(n>0 && n<=25); + UPDATE_CACHE(re, s); + cache = GET_CACHE(re, s); + sign = ~cache >> 31; + LAST_SKIP_BITS(re, s, n); + CLOSE_READER(re, s); + return (NEG_USR32(sign ^ cache, n) ^ sign) - sign; +} + +static inline int get_xbits_le(GetBitContext *s, int n) +{ + register int sign; + register int32_t cache; + OPEN_READER(re, s); + av_assert2(n>0 && n<=25); + UPDATE_CACHE_LE(re, s); + cache = GET_CACHE(re, s); + sign = sign_extend(~cache, n) >> 31; + LAST_SKIP_BITS(re, s, n); + CLOSE_READER(re, s); + return (zero_extend(sign ^ cache, n) ^ sign) - sign; +} + +static inline int get_sbits(GetBitContext *s, int n) +{ + register int tmp; + OPEN_READER(re, s); + av_assert2(n>0 && n<=25); + UPDATE_CACHE(re, s); + tmp = SHOW_SBITS(re, s, n); + LAST_SKIP_BITS(re, s, n); + CLOSE_READER(re, s); + return tmp; +} + +/** + * Read 1-25 bits. + */ +static inline unsigned int get_bits(GetBitContext *s, int n) +{ + register unsigned int tmp; + OPEN_READER(re, s); + av_assert2(n>0 && n<=25); + UPDATE_CACHE(re, s); + tmp = SHOW_UBITS(re, s, n); + LAST_SKIP_BITS(re, s, n); + CLOSE_READER(re, s); + av_assert2(tmp < UINT64_C(1) << n); + return tmp; +} + +/** + * Read 0-25 bits. + */ +static av_always_inline int get_bitsz(GetBitContext *s, int n) +{ + return n ? get_bits(s, n) : 0; +} + +static inline unsigned int get_bits_le(GetBitContext *s, int n) +{ + register int tmp; + OPEN_READER(re, s); + av_assert2(n>0 && n<=25); + UPDATE_CACHE_LE(re, s); + tmp = SHOW_UBITS_LE(re, s, n); + LAST_SKIP_BITS(re, s, n); + CLOSE_READER(re, s); + return tmp; +} + +/** + * Show 1-25 bits. + */ +static inline unsigned int show_bits(GetBitContext *s, int n) +{ + register unsigned int tmp; + OPEN_READER_NOSIZE(re, s); + av_assert2(n>0 && n<=25); + UPDATE_CACHE(re, s); + tmp = SHOW_UBITS(re, s, n); + return tmp; +} + +static inline void skip_bits(GetBitContext *s, int n) +{ + OPEN_READER(re, s); + LAST_SKIP_BITS(re, s, n); + CLOSE_READER(re, s); +} + +static inline unsigned int get_bits1(GetBitContext *s) +{ + unsigned int index = s->index; + uint8_t result = s->buffer[index >> 3]; +#ifdef BITSTREAM_READER_LE + result >>= index & 7; + result &= 1; +#else + result <<= index & 7; + result >>= 8 - 1; +#endif +#if !UNCHECKED_BITSTREAM_READER + if (s->index < s->size_in_bits_plus8) +#endif + index++; + s->index = index; + + return result; +} + +static inline unsigned int show_bits1(GetBitContext *s) +{ + return show_bits(s, 1); +} + +static inline void skip_bits1(GetBitContext *s) +{ + skip_bits(s, 1); +} + +/** + * Read 0-32 bits. + */ +static inline unsigned int get_bits_long(GetBitContext *s, int n) +{ + av_assert2(n>=0 && n<=32); + if (!n) { + return 0; + } else if ((!HAVE_FAST_64BIT || av_builtin_constant_p(n <= MIN_CACHE_BITS)) + && n <= MIN_CACHE_BITS) { + return get_bits(s, n); + } else { +#if HAVE_FAST_64BIT + unsigned tmp; + OPEN_READER(re, s); + UPDATE_CACHE_32(re, s); + tmp = SHOW_UBITS(re, s, n); + LAST_SKIP_BITS(re, s, n); + CLOSE_READER(re, s); + return tmp; +#else +#ifdef BITSTREAM_READER_LE + unsigned ret = get_bits(s, 16); + return ret | (get_bits(s, n - 16) << 16); +#else + unsigned ret = get_bits(s, 16) << (n - 16); + return ret | get_bits(s, n - 16); +#endif +#endif + } +} + +/** + * Read 0-64 bits. + */ +static inline uint64_t get_bits64(GetBitContext *s, int n) +{ + if (n <= 32) { + return get_bits_long(s, n); + } else { +#ifdef BITSTREAM_READER_LE + uint64_t ret = get_bits_long(s, 32); + return ret | (uint64_t) get_bits_long(s, n - 32) << 32; +#else + uint64_t ret = (uint64_t) get_bits_long(s, n - 32) << 32; + return ret | get_bits_long(s, 32); +#endif + } +} + +/** + * Read 0-32 bits as a signed integer. + */ +static inline int get_sbits_long(GetBitContext *s, int n) +{ + // sign_extend(x, 0) is undefined + if (!n) + return 0; + + return sign_extend(get_bits_long(s, n), n); +} + +/** + * Read 0-64 bits as a signed integer. + */ +static inline int64_t get_sbits64(GetBitContext *s, int n) +{ + // sign_extend(x, 0) is undefined + if (!n) + return 0; + + return sign_extend64(get_bits64(s, n), n); +} + +/** + * Show 0-32 bits. + */ +static inline unsigned int show_bits_long(GetBitContext *s, int n) +{ + if (n <= MIN_CACHE_BITS) { + return show_bits(s, n); + } else { + GetBitContext gb = *s; + return get_bits_long(&gb, n); + } +} + + +/** + * Initialize GetBitContext. + * @param buffer bitstream buffer, must be AV_INPUT_BUFFER_PADDING_SIZE bytes + * larger than the actual read bits because some optimized bitstream + * readers read 32 or 64 bit at once and could read over the end + * @param bit_size the size of the buffer in bits + * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow. + */ +static inline int init_get_bits(GetBitContext *s, const uint8_t *buffer, + int bit_size) +{ + int buffer_size; + int ret = 0; + + if (bit_size >= INT_MAX - FFMAX(7, AV_INPUT_BUFFER_PADDING_SIZE*8) || bit_size < 0 || !buffer) { + bit_size = 0; + buffer = NULL; + ret = AVERROR_INVALIDDATA; + } + + buffer_size = (bit_size + 7) >> 3; + + s->buffer = buffer; + s->size_in_bits = bit_size; + s->size_in_bits_plus8 = bit_size + 8; + s->buffer_end = buffer + buffer_size; + s->index = 0; + + return ret; +} + +/** + * Initialize GetBitContext. + * @param buffer bitstream buffer, must be AV_INPUT_BUFFER_PADDING_SIZE bytes + * larger than the actual read bits because some optimized bitstream + * readers read 32 or 64 bit at once and could read over the end + * @param byte_size the size of the buffer in bytes + * @return 0 on success, AVERROR_INVALIDDATA if the buffer_size would overflow. + */ +static inline int init_get_bits8(GetBitContext *s, const uint8_t *buffer, + int byte_size) +{ + if (byte_size > INT_MAX / 8 || byte_size < 0) + byte_size = -1; + return init_get_bits(s, buffer, byte_size * 8); +} + +static inline int init_get_bits8_le(GetBitContext *s, const uint8_t *buffer, + int byte_size) +{ + if (byte_size > INT_MAX / 8 || byte_size < 0) + byte_size = -1; + return init_get_bits(s, buffer, byte_size * 8); +} + +static inline const uint8_t *align_get_bits(GetBitContext *s) +{ + int n = -get_bits_count(s) & 7; + if (n) + skip_bits(s, n); + return s->buffer + (s->index >> 3); +} + +/** + * If the vlc code is invalid and max_depth=1, then no bits will be removed. + * If the vlc code is invalid and max_depth>1, then the number of bits removed + * is undefined. + */ +#define GET_VLC(code, name, gb, table, bits, max_depth) \ + do { \ + int n, nb_bits; \ + unsigned int index; \ + \ + index = SHOW_UBITS(name, gb, bits); \ + code = table[index].sym; \ + n = table[index].len; \ + \ + if (max_depth > 1 && n < 0) { \ + LAST_SKIP_BITS(name, gb, bits); \ + UPDATE_CACHE(name, gb); \ + \ + nb_bits = -n; \ + \ + index = SHOW_UBITS(name, gb, nb_bits) + code; \ + code = table[index].sym; \ + n = table[index].len; \ + if (max_depth > 2 && n < 0) { \ + LAST_SKIP_BITS(name, gb, nb_bits); \ + UPDATE_CACHE(name, gb); \ + \ + nb_bits = -n; \ + \ + index = SHOW_UBITS(name, gb, nb_bits) + code; \ + code = table[index].sym; \ + n = table[index].len; \ + } \ + } \ + SKIP_BITS(name, gb, n); \ + } while (0) + +#define GET_RL_VLC(level, run, name, gb, table, bits, \ + max_depth, need_update) \ + do { \ + int n, nb_bits; \ + unsigned int index; \ + \ + index = SHOW_UBITS(name, gb, bits); \ + level = table[index].level; \ + n = table[index].len; \ + \ + if (max_depth > 1 && n < 0) { \ + SKIP_BITS(name, gb, bits); \ + if (need_update) { \ + UPDATE_CACHE(name, gb); \ + } \ + \ + nb_bits = -n; \ + \ + index = SHOW_UBITS(name, gb, nb_bits) + level; \ + level = table[index].level; \ + n = table[index].len; \ + if (max_depth > 2 && n < 0) { \ + LAST_SKIP_BITS(name, gb, nb_bits); \ + if (need_update) { \ + UPDATE_CACHE(name, gb); \ + } \ + nb_bits = -n; \ + \ + index = SHOW_UBITS(name, gb, nb_bits) + level; \ + level = table[index].level; \ + n = table[index].len; \ + } \ + } \ + run = table[index].run; \ + SKIP_BITS(name, gb, n); \ + } while (0) + +/** + * Parse a vlc code. + * @param bits is the number of bits which will be read at once, must be + * identical to nb_bits in vlc_init() + * @param max_depth is the number of times bits bits must be read to completely + * read the longest vlc code + * = (max_vlc_length + bits - 1) / bits + * @returns the code parsed or -1 if no vlc matches + */ +static av_always_inline int get_vlc2(GetBitContext *s, const VLCElem *table, + int bits, int max_depth) +{ + int code; + + OPEN_READER(re, s); + UPDATE_CACHE(re, s); + + GET_VLC(code, re, s, table, bits, max_depth); + + CLOSE_READER(re, s); + + return code; +} + +static inline int get_vlc_multi(GetBitContext *s, uint8_t *dst, + const VLC_MULTI_ELEM *const Jtable, + const VLCElem *const table, + const int bits, const int max_depth, + const int symbols_size) +{ + dst[0] = get_vlc2(s, table, bits, max_depth); + return 1; +} + +static inline int decode012(GetBitContext *gb) +{ + int n; + n = get_bits1(gb); + if (n == 0) + return 0; + else + return get_bits1(gb) + 1; +} + +static inline int decode210(GetBitContext *gb) +{ + if (get_bits1(gb)) + return 0; + else + return 2 - get_bits1(gb); +} + +static inline int get_bits_left(GetBitContext *gb) +{ + return gb->size_in_bits - get_bits_count(gb); +} + +static inline int skip_1stop_8data_bits(GetBitContext *gb) +{ + if (get_bits_left(gb) <= 0) + return AVERROR_INVALIDDATA; + + while (get_bits1(gb)) { + skip_bits(gb, 8); + if (get_bits_left(gb) <= 0) + return AVERROR_INVALIDDATA; + } + + return 0; +} + +#endif // CACHED_BITSTREAM_READER + +#endif /* AVCODEC_GET_BITS_H */ diff --git a/include/libavcodec/gif.h b/include/libavcodec/gif.h new file mode 100644 index 0000000..7fb6149 --- /dev/null +++ b/include/libavcodec/gif.h @@ -0,0 +1,50 @@ +/* + * GIF format definitions + * Copyright (c) 2003 Fabrice Bellard + * Copyright (c) 2006 Baptiste Coudurier + * Copyright (c) 2012 Vitaliy E Sugrobov + * + * 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 + */ + +/** + * @file + * GIF format definitions. + */ + +#ifndef AVCODEC_GIF_H +#define AVCODEC_GIF_H + +#include + +static const uint8_t gif87a_sig[6] = "GIF87a"; +static const uint8_t gif89a_sig[6] = "GIF89a"; + +#define GCE_DISPOSAL_NONE 0 +#define GCE_DISPOSAL_INPLACE 1 +#define GCE_DISPOSAL_BACKGROUND 2 +#define GCE_DISPOSAL_RESTORE 3 + +#define GIF_TRAILER 0x3b +#define GIF_EXTENSION_INTRODUCER 0x21 +#define GIF_IMAGE_SEPARATOR 0x2c +#define GIF_GCE_EXT_LABEL 0xf9 +#define GIF_COM_EXT_LABEL 0xfe +#define GIF_APP_EXT_LABEL 0xff +#define NETSCAPE_EXT_STR "NETSCAPE2.0" + +#endif /* AVCODEC_GIF_H */ diff --git a/include/libavcodec/golomb.h b/include/libavcodec/golomb.h new file mode 100644 index 0000000..7423349 --- /dev/null +++ b/include/libavcodec/golomb.h @@ -0,0 +1,621 @@ +/* + * exp golomb vlc stuff + * Copyright (c) 2003 Michael Niedermayer + * Copyright (c) 2004 Alex Beregszaszi + * + * 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 + */ + +/** + * @file + * @brief + * exp golomb vlc stuff + * @author Michael Niedermayer and Alex Beregszaszi + */ + +#ifndef AVCODEC_GOLOMB_H +#define AVCODEC_GOLOMB_H + +#include + +#include "get_bits.h" + +#define INVALID_VLC 0x80000000 + +extern const uint8_t ff_golomb_vlc_len[512]; +extern const uint8_t ff_ue_golomb_vlc_code[512]; +extern const int8_t ff_se_golomb_vlc_code[512]; + +extern const uint8_t ff_interleaved_golomb_vlc_len[256]; +extern const uint8_t ff_interleaved_ue_golomb_vlc_code[256]; +extern const int8_t ff_interleaved_se_golomb_vlc_code[256]; +extern const uint8_t ff_interleaved_dirac_golomb_vlc_code[256]; + +/** + * Read an unsigned Exp-Golomb code in the range 0 to 8190. + * + * @returns the read value or a negative error code. + */ +static inline int get_ue_golomb(GetBitContext *gb) +{ + unsigned int buf; + +#if CACHED_BITSTREAM_READER + buf = show_bits_long(gb, 32); + + if (buf >= (1 << 27)) { + buf >>= 32 - 9; + skip_bits_long(gb, ff_golomb_vlc_len[buf]); + + return ff_ue_golomb_vlc_code[buf]; + } else { + int log = 2 * av_log2(buf) - 31; + + skip_bits_long(gb, 32 - log); + if (log < 7) + return AVERROR_INVALIDDATA; + buf >>= log; + buf--; + + return buf; + } +#else + OPEN_READER(re, gb); + UPDATE_CACHE(re, gb); + buf = GET_CACHE(re, gb); + + if (buf >= (1 << 27)) { + buf >>= 32 - 9; + LAST_SKIP_BITS(re, gb, ff_golomb_vlc_len[buf]); + CLOSE_READER(re, gb); + + return ff_ue_golomb_vlc_code[buf]; + } else { + int log = 2 * av_log2(buf) - 31; + LAST_SKIP_BITS(re, gb, 32 - log); + CLOSE_READER(re, gb); + if (log < 7) + return AVERROR_INVALIDDATA; + buf >>= log; + buf--; + + return buf; + } +#endif +} + +/** + * Read an unsigned Exp-Golomb code in the range 0 to UINT32_MAX-1. + */ +static inline unsigned get_ue_golomb_long(GetBitContext *gb) +{ + unsigned buf, log; + + buf = show_bits_long(gb, 32); + log = 31 - av_log2(buf); + skip_bits_long(gb, log); + + return get_bits_long(gb, log + 1) - 1; +} + +/** + * read unsigned exp golomb code, constraint to a max of 31. + * If the value encountered is not in 0..31, the return value + * is outside the range 0..30. + */ +static inline int get_ue_golomb_31(GetBitContext *gb) +{ + unsigned int buf; + +#if CACHED_BITSTREAM_READER + buf = show_bits_long(gb, 32); + + buf >>= 32 - 9; + skip_bits_long(gb, ff_golomb_vlc_len[buf]); +#else + + OPEN_READER(re, gb); + UPDATE_CACHE(re, gb); + buf = GET_CACHE(re, gb); + + buf >>= 32 - 9; + LAST_SKIP_BITS(re, gb, ff_golomb_vlc_len[buf]); + CLOSE_READER(re, gb); +#endif + + return ff_ue_golomb_vlc_code[buf]; +} + +static inline unsigned get_interleaved_ue_golomb(GetBitContext *gb) +{ + uint32_t buf; + +#if CACHED_BITSTREAM_READER + buf = show_bits_long(gb, 32); + + if (buf & 0xAA800000) { + buf >>= 32 - 8; + skip_bits_long(gb, ff_interleaved_golomb_vlc_len[buf]); + + return ff_interleaved_ue_golomb_vlc_code[buf]; + } else { + unsigned ret = 1; + + do { + buf >>= 32 - 8; + skip_bits_long(gb, FFMIN(ff_interleaved_golomb_vlc_len[buf], 8)); + + if (ff_interleaved_golomb_vlc_len[buf] != 9) { + ret <<= (ff_interleaved_golomb_vlc_len[buf] - 1) >> 1; + ret |= ff_interleaved_dirac_golomb_vlc_code[buf]; + break; + } + ret = (ret << 4) | ff_interleaved_dirac_golomb_vlc_code[buf]; + buf = show_bits_long(gb, 32); + } while (get_bits_left(gb) > 0); + + return ret - 1; + } +#else + OPEN_READER(re, gb); + UPDATE_CACHE(re, gb); + buf = GET_CACHE(re, gb); + + if (buf & 0xAA800000) { + buf >>= 32 - 8; + LAST_SKIP_BITS(re, gb, ff_interleaved_golomb_vlc_len[buf]); + CLOSE_READER(re, gb); + + return ff_interleaved_ue_golomb_vlc_code[buf]; + } else { + unsigned ret = 1; + + do { + buf >>= 32 - 8; + LAST_SKIP_BITS(re, gb, + FFMIN(ff_interleaved_golomb_vlc_len[buf], 8)); + + if (ff_interleaved_golomb_vlc_len[buf] != 9) { + ret <<= (ff_interleaved_golomb_vlc_len[buf] - 1) >> 1; + ret |= ff_interleaved_dirac_golomb_vlc_code[buf]; + break; + } + ret = (ret << 4) | ff_interleaved_dirac_golomb_vlc_code[buf]; + UPDATE_CACHE(re, gb); + buf = GET_CACHE(re, gb); + } while (ret<0x8000000U && BITS_AVAILABLE(re, gb)); + + CLOSE_READER(re, gb); + return ret - 1; + } +#endif +} + +/** + * read unsigned truncated exp golomb code. + */ +static inline int get_te0_golomb(GetBitContext *gb, int range) +{ + av_assert2(range >= 1); + + if (range == 1) + return 0; + else if (range == 2) + return get_bits1(gb) ^ 1; + else + return get_ue_golomb(gb); +} + +/** + * read unsigned truncated exp golomb code. + */ +static inline int get_te_golomb(GetBitContext *gb, int range) +{ + av_assert2(range >= 1); + + if (range == 2) + return get_bits1(gb) ^ 1; + else + return get_ue_golomb(gb); +} + +/** + * read signed exp golomb code. + */ +static inline int get_se_golomb(GetBitContext *gb) +{ + unsigned int buf; + +#if CACHED_BITSTREAM_READER + buf = show_bits_long(gb, 32); + + if (buf >= (1 << 27)) { + buf >>= 32 - 9; + skip_bits_long(gb, ff_golomb_vlc_len[buf]); + + return ff_se_golomb_vlc_code[buf]; + } else { + int log = 2 * av_log2(buf) - 31; + buf >>= log; + + skip_bits_long(gb, 32 - log); + + if (buf & 1) + buf = -(buf >> 1); + else + buf = (buf >> 1); + + return buf; + } +#else + OPEN_READER(re, gb); + UPDATE_CACHE(re, gb); + buf = GET_CACHE(re, gb); + + if (buf >= (1 << 27)) { + buf >>= 32 - 9; + LAST_SKIP_BITS(re, gb, ff_golomb_vlc_len[buf]); + CLOSE_READER(re, gb); + + return ff_se_golomb_vlc_code[buf]; + } else { + int log = av_log2(buf), sign; + LAST_SKIP_BITS(re, gb, 31 - log); + UPDATE_CACHE(re, gb); + buf = GET_CACHE(re, gb); + + buf >>= log; + + LAST_SKIP_BITS(re, gb, 32 - log); + CLOSE_READER(re, gb); + + sign = -(buf & 1); + buf = ((buf >> 1) ^ sign) - sign; + + return buf; + } +#endif +} + +static inline int get_se_golomb_long(GetBitContext *gb) +{ + unsigned int buf = get_ue_golomb_long(gb); + int sign = (buf & 1) - 1; + return ((buf >> 1) ^ sign) + 1; +} + +static inline int get_interleaved_se_golomb(GetBitContext *gb) +{ + unsigned int buf; + +#if CACHED_BITSTREAM_READER + buf = show_bits_long(gb, 32); + + if (buf & 0xAA800000) { + buf >>= 32 - 8; + skip_bits_long(gb, ff_interleaved_golomb_vlc_len[buf]); + + return ff_interleaved_se_golomb_vlc_code[buf]; + } else { + int log; + skip_bits(gb, 8); + buf |= 1 | show_bits(gb, 24); + + if ((buf & 0xAAAAAAAA) == 0) + return INVALID_VLC; + + for (log = 31; (buf & 0x80000000) == 0; log--) + buf = (buf << 2) - ((buf << log) >> (log - 1)) + (buf >> 30); + + skip_bits_long(gb, 63 - 2 * log - 8); + + return (signed) (((((buf << log) >> log) - 1) ^ -(buf & 0x1)) + 1) >> 1; + } +#else + OPEN_READER(re, gb); + UPDATE_CACHE(re, gb); + buf = GET_CACHE(re, gb); + + if (buf & 0xAA800000) { + buf >>= 32 - 8; + LAST_SKIP_BITS(re, gb, ff_interleaved_golomb_vlc_len[buf]); + CLOSE_READER(re, gb); + + return ff_interleaved_se_golomb_vlc_code[buf]; + } else { + int log; + LAST_SKIP_BITS(re, gb, 8); + UPDATE_CACHE(re, gb); + buf |= 1 | (GET_CACHE(re, gb) >> 8); + + if ((buf & 0xAAAAAAAA) == 0) + return INVALID_VLC; + + for (log = 31; (buf & 0x80000000) == 0; log--) + buf = (buf << 2) - ((buf << log) >> (log - 1)) + (buf >> 30); + + LAST_SKIP_BITS(re, gb, 63 - 2 * log - 8); + CLOSE_READER(re, gb); + + return (signed) (((((buf << log) >> log) - 1) ^ -(buf & 0x1)) + 1) >> 1; + } +#endif +} + +static inline int dirac_get_se_golomb(GetBitContext *gb) +{ + uint32_t ret = get_interleaved_ue_golomb(gb); + + if (ret) { + int sign = -get_bits1(gb); + ret = (ret ^ sign) - sign; + } + + return ret; +} + +/** + * read unsigned golomb rice code (ffv1). + */ +static inline int get_ur_golomb(GetBitContext *gb, int k, int limit, + int esc_len) +{ + unsigned int buf; + int log; + +#if CACHED_BITSTREAM_READER + buf = show_bits_long(gb, 32); + + log = av_log2(buf); + + if (log > 31 - limit) { + buf >>= log - k; + buf += (30 - log) << k; + skip_bits_long(gb, 32 + k - log); + + return buf; + } else { + skip_bits_long(gb, limit); + buf = get_bits_long(gb, esc_len); + + return buf + limit - 1; + } +#else + OPEN_READER(re, gb); + UPDATE_CACHE(re, gb); + buf = GET_CACHE(re, gb); + + log = av_log2(buf); + + if (log > 31 - limit) { + av_assert2(log >= k); + buf >>= log - k; + buf += (30U - log) << k; + LAST_SKIP_BITS(re, gb, 32 + k - log); + CLOSE_READER(re, gb); + + return buf; + } else { + LAST_SKIP_BITS(re, gb, limit); + UPDATE_CACHE(re, gb); + + buf = SHOW_UBITS(re, gb, esc_len); + + LAST_SKIP_BITS(re, gb, esc_len); + CLOSE_READER(re, gb); + + return buf + limit - 1; + } +#endif +} + +/** + * read unsigned golomb rice code (jpegls). + * + * @returns -1 on error + */ +static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit, + int esc_len) +{ + unsigned int buf; + int log; + +#if CACHED_BITSTREAM_READER + buf = show_bits_long(gb, 32); + + log = av_log2(buf); + + if (log - k >= 1 && 32 - log < limit) { + buf >>= log - k; + buf += (30 - log) << k; + skip_bits_long(gb, 32 + k - log); + + return buf; + } else { + int i; + for (i = 0; + i < limit && get_bits1(gb) == 0 && get_bits_left(gb) > 0; + i++); + + if (i < limit - 1) { + buf = get_bits_long(gb, k); + + return buf + (i << k); + } else if (i == limit - 1) { + buf = get_bits_long(gb, esc_len); + + return buf + 1; + } else + return -1; + } +#else + OPEN_READER(re, gb); + UPDATE_CACHE(re, gb); + buf = GET_CACHE(re, gb); + + log = av_log2(buf); + + av_assert2(k <= 31); + + if (log - k >= 32 - MIN_CACHE_BITS + (MIN_CACHE_BITS == 32) && + 32 - log < limit) { + buf >>= log - k; + buf += (30U - log) << k; + LAST_SKIP_BITS(re, gb, 32 + k - log); + CLOSE_READER(re, gb); + + return buf; + } else { + int i; + for (i = 0; i + MIN_CACHE_BITS <= limit && SHOW_UBITS(re, gb, MIN_CACHE_BITS) == 0; i += MIN_CACHE_BITS) { + if (gb->size_in_bits <= re_index) { + CLOSE_READER(re, gb); + return -1; + } + LAST_SKIP_BITS(re, gb, MIN_CACHE_BITS); + UPDATE_CACHE(re, gb); + } + for (; i < limit && SHOW_UBITS(re, gb, 1) == 0; i++) { + SKIP_BITS(re, gb, 1); + } + LAST_SKIP_BITS(re, gb, 1); + UPDATE_CACHE(re, gb); + + if (i < limit - 1) { + if (k) { + if (k > MIN_CACHE_BITS - 1) { + buf = SHOW_UBITS(re, gb, 16) << (k-16); + LAST_SKIP_BITS(re, gb, 16); + UPDATE_CACHE(re, gb); + buf |= SHOW_UBITS(re, gb, k-16); + LAST_SKIP_BITS(re, gb, k-16); + } else { + buf = SHOW_UBITS(re, gb, k); + LAST_SKIP_BITS(re, gb, k); + } + } else { + buf = 0; + } + + buf += ((SUINT)i << k); + } else if (i == limit - 1) { + buf = SHOW_UBITS(re, gb, esc_len); + LAST_SKIP_BITS(re, gb, esc_len); + + buf ++; + } else { + buf = -1; + } + CLOSE_READER(re, gb); + return buf; + } +#endif +} + +/** + * read signed golomb rice code (ffv1). + */ +static inline int get_sr_golomb(GetBitContext *gb, int k, int limit, + int esc_len) +{ + unsigned v = get_ur_golomb(gb, k, limit, esc_len); + return (v >> 1) ^ -(v & 1); +} + +/** + * read signed golomb rice code (flac). + * + * @returns INT_MIN on error + */ +static inline int get_sr_golomb_flac(GetBitContext *gb, int k, int limit, + int esc_len) +{ + unsigned v = get_ur_golomb_jpegls(gb, k, limit, esc_len); + return (v >> 1) ^ -(v & 1); +} + +/** + * read unsigned golomb rice code (shorten). + */ +static inline unsigned int get_ur_golomb_shorten(GetBitContext *gb, int k) +{ + return get_ur_golomb_jpegls(gb, k, INT_MAX, 0); +} + +/** + * read signed golomb rice code (shorten). + */ +static inline int get_sr_golomb_shorten(GetBitContext *gb, int k) +{ + int uvar = get_ur_golomb_jpegls(gb, k + 1, INT_MAX, 0); + return (uvar >> 1) ^ -(uvar & 1); +} + +#ifdef TRACE + +static inline int get_ue(GetBitContext *s, const char *file, const char *func, + int line) +{ + int show = show_bits(s, 24); + int pos = get_bits_count(s); + int i = get_ue_golomb(s); + int len = get_bits_count(s) - pos; + int bits = show >> (24 - len); + + av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d ue @%5d in %s %s:%d\n", + bits, len, i, pos, file, func, line); + + return i; +} + +static inline int get_se(GetBitContext *s, const char *file, const char *func, + int line) +{ + int show = show_bits(s, 24); + int pos = get_bits_count(s); + int i = get_se_golomb(s); + int len = get_bits_count(s) - pos; + int bits = show >> (24 - len); + + av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d se @%5d in %s %s:%d\n", + bits, len, i, pos, file, func, line); + + return i; +} + +static inline int get_te(GetBitContext *s, int r, char *file, const char *func, + int line) +{ + int show = show_bits(s, 24); + int pos = get_bits_count(s); + int i = get_te0_golomb(s, r); + int len = get_bits_count(s) - pos; + int bits = show >> (24 - len); + + av_log(NULL, AV_LOG_DEBUG, "%5d %2d %3d te @%5d in %s %s:%d\n", + bits, len, i, pos, file, func, line); + + return i; +} + +#define get_ue_golomb(a) get_ue(a, __FILE__, __func__, __LINE__) +#define get_se_golomb(a) get_se(a, __FILE__, __func__, __LINE__) +#define get_te_golomb(a, r) get_te(a, r, __FILE__, __func__, __LINE__) +#define get_te0_golomb(a, r) get_te(a, r, __FILE__, __func__, __LINE__) + +#endif /* TRACE */ +#endif /* AVCODEC_GOLOMB_H */ diff --git a/include/libavcodec/gsm.h b/include/libavcodec/gsm.h new file mode 100644 index 0000000..53d65c4 --- /dev/null +++ b/include/libavcodec/gsm.h @@ -0,0 +1,45 @@ +/* + * GSM common header + * + * 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_GSM_H +#define AVCODEC_GSM_H + +/* bytes per block */ +#define GSM_BLOCK_SIZE 33 +#define GSM_MS_BLOCK_SIZE 65 +#define MSN_MIN_BLOCK_SIZE 41 + +/* samples per block */ +#define GSM_FRAME_SIZE 160 + +enum GSMModes { + GSM_13000 = 0, + MSN_12400, + MSN_11800, + MSN_11200, + MSN_10600, + MSN_10000, + MSN_9400, + MSN_8800, + MSN_8200, + NUM_GSM_MODES +}; + +#endif /* AVCODEC_GSM_H */ diff --git a/include/libavcodec/gsmdec_data.h b/include/libavcodec/gsmdec_data.h new file mode 100644 index 0000000..576bf07 --- /dev/null +++ b/include/libavcodec/gsmdec_data.h @@ -0,0 +1,45 @@ +/* + * gsm 06.10 decoder data + * Copyright (c) 2010 Reimar Döffinger + * + * 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_GSMDEC_DATA_H +#define AVCODEC_GSMDEC_DATA_H + +#include + +typedef struct GSMContext { + // Contains first 120 elements from the previous frame + // (used by long_term_synth according to the "lag"), + // then in the following 160 elements the current + // frame is constructed. + int16_t ref_buf[280]; + int v[9]; + int lar[2][8]; + int lar_idx; + int msr; +} GSMContext; + +extern const uint16_t ff_gsm_long_term_gain_tab[4]; +extern const uint8_t ff_gsm_requant_tab[4][8]; +extern const int16_t ff_gsm_dequant_tab[64][8]; + +extern const int* const ff_gsm_apcm_bits[][4]; + +#endif /* AVCODEC_GSMDEC_DATA_H */ diff --git a/include/libavcodec/h261.h b/include/libavcodec/h261.h new file mode 100644 index 0000000..4279a12 --- /dev/null +++ b/include/libavcodec/h261.h @@ -0,0 +1,59 @@ +/* + * H.261 codec + * Copyright (c) 2002-2004 Michael Niedermayer + * Copyright (c) 2004 Maarten Daniels + * + * 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 + */ + +/** + * @file + * H.261 codec. + */ + +#ifndef AVCODEC_H261_H +#define AVCODEC_H261_H + +#include "mpegutils.h" +#include "mpegvideo.h" +#include "rl.h" + +/** + * H261Context + */ +typedef struct H261Context { + int mtype; +} H261Context; + +#define MB_TYPE_H261_FIL MB_TYPE_CODEC_SPECIFIC + +extern const uint8_t ff_h261_mba_code[35]; +extern const uint8_t ff_h261_mba_bits[35]; +extern const uint8_t ff_h261_mtype_code[10]; +extern const uint8_t ff_h261_mtype_bits[10]; +extern const uint16_t ff_h261_mtype_map[10]; +extern const uint8_t ff_h261_mv_tab[17][2]; +extern const uint8_t ff_h261_cbp_tab[63][2]; +extern RLTable ff_h261_rl_tcoeff; + +extern const uint16_t ff_h261_tcoeff_vlc[65][2]; +extern const int8_t ff_h261_tcoeff_level[64]; +extern const int8_t ff_h261_tcoeff_run[64]; + +void ff_h261_loop_filter(MpegEncContext *s); + +#endif /* AVCODEC_H261_H */ diff --git a/include/libavcodec/h261enc.h b/include/libavcodec/h261enc.h new file mode 100644 index 0000000..d8fdcad --- /dev/null +++ b/include/libavcodec/h261enc.h @@ -0,0 +1,39 @@ +/* + * H.261 encoder + * Copyright (c) 2002-2004 Michael Niedermayer + * Copyright (c) 2004 Maarten Daniels + * + * 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 + */ + +/** + * @file + * H.261 encoder header. + */ + +#ifndef AVCODEC_H261ENC_H +#define AVCODEC_H261ENC_H + +#include "mpegvideo.h" + +void ff_h261_reorder_mb_index(MpegEncContext *s); +void ff_h261_encode_mb(MpegEncContext *s, int16_t block[6][64], + int motion_x, int motion_y); +void ff_h261_encode_picture_header(MpegEncContext *s); +int ff_h261_encode_init(MpegEncContext *s); + +#endif diff --git a/include/libavcodec/h263.h b/include/libavcodec/h263.h new file mode 100644 index 0000000..27a5f31 --- /dev/null +++ b/include/libavcodec/h263.h @@ -0,0 +1,37 @@ +/* + * H.263 internal header + * + * 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_H263_H +#define AVCODEC_H263_H + +#include "libavutil/rational.h" +#include "mpegvideo.h" + +#define FF_ASPECT_EXTENDED 15 + +#define H263_GOB_HEIGHT(h) ((h) <= 400 ? 1 : (h) <= 800 ? 2 : 4) + +av_const int ff_h263_aspect_to_info(AVRational aspect); +int16_t *ff_h263_pred_motion(MpegEncContext * s, int block, int dir, + int *px, int *py); +void ff_h263_init_rl_inter(void); +void ff_h263_update_motion_val(MpegEncContext * s); +void ff_h263_loop_filter(MpegEncContext * s); + +#endif /* AVCODEC_H263_H */ diff --git a/include/libavcodec/h263data.h b/include/libavcodec/h263data.h new file mode 100644 index 0000000..06554bd --- /dev/null +++ b/include/libavcodec/h263data.h @@ -0,0 +1,76 @@ +/* + * copyright (c) 2000,2001 Fabrice Bellard + * H.263+ support + * copyright (c) 2001 Juan J. Sierralta P + * copyright (c) 2002-2004 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * H.263 tables. + */ + +#ifndef AVCODEC_H263DATA_H +#define AVCODEC_H263DATA_H + +#include + +#include "libavutil/rational.h" + +#include "rl.h" + +extern const AVRational ff_h263_pixel_aspect[16]; + +/* intra MCBPC, mb_type = (intra), then (intraq) */ +extern const uint8_t ff_h263_intra_MCBPC_code[9]; +extern const uint8_t ff_h263_intra_MCBPC_bits[9]; + +/* inter MCBPC, mb_type = (inter), (intra), (interq), (intraq), (inter4v) */ +/* Changed the tables for interq and inter4v+q, following the standard ** Juanjo ** */ +extern const uint8_t ff_h263_inter_MCBPC_code[28]; +extern const uint8_t ff_h263_inter_MCBPC_bits[28]; + +extern const uint8_t ff_h263_mbtype_b_tab[15][2]; + +extern const uint8_t ff_cbpc_b_tab[4][2]; +extern const uint8_t ff_h263_cbpy_tab[16][2]; + +extern const uint8_t ff_mvtab[33][2]; + +/* third non intra table */ +extern const uint16_t ff_inter_vlc[103][2]; + +extern const int8_t ff_inter_level[102]; +extern const int8_t ff_inter_run[102]; + +extern RLTable ff_h263_rl_inter; +extern RLTable ff_rl_intra_aic; + +extern const uint16_t ff_h263_format[8][2]; + +extern const uint8_t ff_aic_dc_scale_table[32]; + +extern const uint8_t ff_modified_quant_tab[2][32]; + +extern const uint8_t ff_h263_chroma_qscale_table[32]; + +extern const uint16_t ff_mba_max[6]; +extern const uint8_t ff_mba_length[7]; + +#endif /* AVCODEC_H263DATA_H */ diff --git a/include/libavcodec/h263dec.h b/include/libavcodec/h263dec.h new file mode 100644 index 0000000..633d4aa --- /dev/null +++ b/include/libavcodec/h263dec.h @@ -0,0 +1,66 @@ +/* + * H.263 decoder internal header + * + * 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_H263DEC_H +#define AVCODEC_H263DEC_H + +#include "mpegvideo.h" +#include "vlc.h" + +/** + * Return value for header parsers if frame is not coded. + * */ +#define FRAME_SKIPPED 100 + +// The defines below define the number of bits that are read at once for +// reading vlc values. Changing these may improve speed and data cache needs +// be aware though that decreasing them may need the number of stages that is +// passed to get_vlc* to be increased. +#define H263_MV_VLC_BITS 9 +#define INTRA_MCBPC_VLC_BITS 6 +#define INTER_MCBPC_VLC_BITS 7 +#define CBPY_VLC_BITS 6 +#define TEX_VLC_BITS 9 + +extern VLCElem ff_h263_intra_MCBPC_vlc[]; +extern VLCElem ff_h263_inter_MCBPC_vlc[]; +extern VLCElem ff_h263_cbpy_vlc[]; +extern VLCElem ff_h263_mv_vlc[]; + +int ff_h263_decode_motion(MpegEncContext * s, int pred, int f_code); +int ff_h263_decode_init(AVCodecContext *avctx); +int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt); +void ff_h263_decode_init_vlc(void); +int ff_h263_decode_picture_header(MpegEncContext *s); +int ff_h263_decode_gob_header(MpegEncContext *s); +int ff_h263_decode_mba(MpegEncContext *s); + +/** + * Print picture info if FF_DEBUG_PICT_INFO is set. + */ +void ff_h263_show_pict_info(MpegEncContext *s); + +int ff_intel_h263_decode_picture_header(MpegEncContext *s); +int ff_h263_decode_mb(MpegEncContext *s, + int16_t block[6][64]); + +int ff_h263_resync(MpegEncContext *s); + +#endif diff --git a/include/libavcodec/h263dsp.h b/include/libavcodec/h263dsp.h new file mode 100644 index 0000000..2dccd23 --- /dev/null +++ b/include/libavcodec/h263dsp.h @@ -0,0 +1,36 @@ +/* + * 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_H263DSP_H +#define AVCODEC_H263DSP_H + +#include + +extern const uint8_t ff_h263_loop_filter_strength[32]; + +typedef struct H263DSPContext { + void (*h263_h_loop_filter)(uint8_t *src, int stride, int qscale); + void (*h263_v_loop_filter)(uint8_t *src, int stride, int qscale); +} H263DSPContext; + +void ff_h263dsp_init(H263DSPContext *ctx); +void ff_h263dsp_init_riscv(H263DSPContext *ctx); +void ff_h263dsp_init_x86(H263DSPContext *ctx); +void ff_h263dsp_init_mips(H263DSPContext *ctx); + +#endif /* AVCODEC_H263DSP_H */ diff --git a/include/libavcodec/h263enc.h b/include/libavcodec/h263enc.h new file mode 100644 index 0000000..784500c --- /dev/null +++ b/include/libavcodec/h263enc.h @@ -0,0 +1,104 @@ +/* + * H.263 encoder header + * + * 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_H263ENC_H +#define AVCODEC_H263ENC_H + +#include +#include "h263data.h" +#include "mpegvideoenc.h" + +void ff_h263_encode_init(MpegEncContext *s); +void ff_h263_encode_picture_header(MpegEncContext *s); +void ff_h263_encode_gob_header(MpegEncContext * s, int mb_line); +void ff_h263_encode_mb(MpegEncContext *s, + int16_t block[6][64], + int motion_x, int motion_y); +void ff_h263_encode_mba(MpegEncContext *s); + +void ff_clean_h263_qscales(MpegEncContext *s); + +void ff_h263_encode_motion(PutBitContext *pb, int val, int f_code); +void ff_h263_update_mb(MpegEncContext *s); + +static inline void ff_h263_encode_motion_vector(MpegEncContext * s, + int x, int y, int f_code) +{ + ff_h263_encode_motion(&s->pb, x, f_code); + ff_h263_encode_motion(&s->pb, y, f_code); +} + +static inline int get_p_cbp(MpegEncContext * s, + int16_t block[6][64], + int motion_x, int motion_y){ + int cbp; + + if (s->mpv_flags & FF_MPV_FLAG_CBP_RD) { + int best_cbpy_score = INT_MAX; + int best_cbpc_score = INT_MAX; + int cbpc = (-1), cbpy = (-1); + const int offset = (s->mv_type == MV_TYPE_16X16 ? 0 : 16) + (s->dquant ? 8 : 0); + const int lambda = s->lambda2 >> (FF_LAMBDA_SHIFT - 6); + + for (int i = 0; i < 4; i++) { + int score = ff_h263_inter_MCBPC_bits[i + offset] * lambda; + if (i & 1) score += s->coded_score[5]; + if (i & 2) score += s->coded_score[4]; + + if (score < best_cbpc_score) { + best_cbpc_score = score; + cbpc = i; + } + } + + for (int i = 0; i < 16; i++) { + int score= ff_h263_cbpy_tab[i ^ 0xF][1] * lambda; + if (i & 1) score += s->coded_score[3]; + if (i & 2) score += s->coded_score[2]; + if (i & 4) score += s->coded_score[1]; + if (i & 8) score += s->coded_score[0]; + + if (score < best_cbpy_score) { + best_cbpy_score = score; + cbpy = i; + } + } + cbp = cbpc + 4 * cbpy; + if (!(motion_x | motion_y | s->dquant) && s->mv_type == MV_TYPE_16X16) { + if (best_cbpy_score + best_cbpc_score + 2 * lambda >= 0) + cbp= 0; + } + + for (int i = 0; i < 6; i++) { + if (s->block_last_index[i] >= 0 && !((cbp >> (5 - i)) & 1)) { + s->block_last_index[i] = -1; + s->bdsp.clear_block(s->block[i]); + } + } + } else { + cbp = 0; + for (int i = 0; i < 6; i++) { + if (s->block_last_index[i] >= 0) + cbp |= 1 << (5 - i); + } + } + return cbp; +} + +#endif diff --git a/include/libavcodec/h264.h b/include/libavcodec/h264.h new file mode 100644 index 0000000..7a1fb6d --- /dev/null +++ b/include/libavcodec/h264.h @@ -0,0 +1,113 @@ +/* + * 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 + */ + +/** + * @file + * H.264 common definitions + */ + +#ifndef AVCODEC_H264_H +#define AVCODEC_H264_H + +#define QP_MAX_NUM (51 + 6*6) // The maximum supported qp + +/* + * Table 7-1 – NAL unit type codes, syntax element categories, and NAL unit type classes in + * T-REC-H.264-201704 + */ +enum { + H264_NAL_UNSPECIFIED = 0, + H264_NAL_SLICE = 1, + H264_NAL_DPA = 2, + H264_NAL_DPB = 3, + H264_NAL_DPC = 4, + H264_NAL_IDR_SLICE = 5, + H264_NAL_SEI = 6, + H264_NAL_SPS = 7, + H264_NAL_PPS = 8, + H264_NAL_AUD = 9, + H264_NAL_END_SEQUENCE = 10, + H264_NAL_END_STREAM = 11, + H264_NAL_FILLER_DATA = 12, + H264_NAL_SPS_EXT = 13, + H264_NAL_PREFIX = 14, + H264_NAL_SUB_SPS = 15, + H264_NAL_DPS = 16, + H264_NAL_RESERVED17 = 17, + H264_NAL_RESERVED18 = 18, + H264_NAL_AUXILIARY_SLICE = 19, + H264_NAL_EXTEN_SLICE = 20, + H264_NAL_DEPTH_EXTEN_SLICE = 21, + H264_NAL_RESERVED22 = 22, + H264_NAL_RESERVED23 = 23, + H264_NAL_UNSPECIFIED24 = 24, + H264_NAL_UNSPECIFIED25 = 25, + H264_NAL_UNSPECIFIED26 = 26, + H264_NAL_UNSPECIFIED27 = 27, + H264_NAL_UNSPECIFIED28 = 28, + H264_NAL_UNSPECIFIED29 = 29, + H264_NAL_UNSPECIFIED30 = 30, + H264_NAL_UNSPECIFIED31 = 31, +}; + + +enum { + // 7.4.2.1.1: seq_parameter_set_id is in [0, 31]. + H264_MAX_SPS_COUNT = 32, + // 7.4.2.2: pic_parameter_set_id is in [0, 255]. + H264_MAX_PPS_COUNT = 256, + + // A.3: MaxDpbFrames is bounded above by 16. + H264_MAX_DPB_FRAMES = 16, + // 7.4.2.1.1: max_num_ref_frames is in [0, MaxDpbFrames], and + // each reference frame can have two fields. + H264_MAX_REFS = 2 * H264_MAX_DPB_FRAMES, + + // 7.4.3.1: modification_of_pic_nums_idc is not equal to 3 at most + // num_ref_idx_lN_active_minus1 + 1 times (that is, once for each + // possible reference), then equal to 3 once. + H264_MAX_RPLM_COUNT = H264_MAX_REFS + 1, + + // 7.4.3.3: in the worst case, we begin with a full short-term + // reference picture list. Each picture in turn is moved to the + // long-term list (type 3) and then discarded from there (type 2). + // Then, we set the length of the long-term list (type 4), mark + // the current picture as long-term (type 6) and terminate the + // process (type 0). + H264_MAX_MMCO_COUNT = H264_MAX_REFS * 2 + 3, + + // A.2.1, A.2.3: profiles supporting FMO constrain + // num_slice_groups_minus1 to be in [0, 7]. + H264_MAX_SLICE_GROUPS = 8, + + // E.2.2: cpb_cnt_minus1 is in [0, 31]. + H264_MAX_CPB_CNT = 32, + + // A.3: in table A-1 the highest level allows a MaxFS of 139264. + H264_MAX_MB_PIC_SIZE = 139264, + // A.3.1, A.3.2: PicWidthInMbs and PicHeightInMbs are constrained + // to be not greater than sqrt(MaxFS * 8). Hence height/width are + // bounded above by sqrt(139264 * 8) = 1055.5 macroblocks. + H264_MAX_MB_WIDTH = 1055, + H264_MAX_MB_HEIGHT = 1055, + H264_MAX_WIDTH = H264_MAX_MB_WIDTH * 16, + H264_MAX_HEIGHT = H264_MAX_MB_HEIGHT * 16, +}; + + +#endif /* AVCODEC_H264_H */ diff --git a/include/libavcodec/h2645_parse.h b/include/libavcodec/h2645_parse.h new file mode 100644 index 0000000..e27ccf7 --- /dev/null +++ b/include/libavcodec/h2645_parse.h @@ -0,0 +1,146 @@ +/* + * H.264/HEVC common parsing code + * + * 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_H2645_PARSE_H +#define AVCODEC_H2645_PARSE_H + +#include + +#include "libavutil/buffer.h" +#include "libavutil/error.h" +#include "libavutil/log.h" +#include "codec_id.h" +#include "get_bits.h" + +#define MAX_MBPAIR_SIZE (256*1024) // a tighter bound could be calculated if someone cares about a few bytes + +typedef struct H2645NAL { + const uint8_t *data; + int size; + + /** + * Size, in bits, of just the data, excluding the stop bit and any trailing + * padding. I.e. what HEVC calls SODB. + */ + int size_bits; + + int raw_size; + const uint8_t *raw_data; + + GetBitContext gb; + + /** + * NAL unit type + */ + int type; + + /** + * H.264 only, nal_ref_idc + */ + int ref_idc; + + /** + * HEVC only, nuh_temporal_id_plus_1 - 1 + */ + int temporal_id; + + /* + * HEVC only, identifier of layer to which nal unit belongs + */ + int nuh_layer_id; + + int skipped_bytes; + int skipped_bytes_pos_size; + int *skipped_bytes_pos; +} H2645NAL; + +typedef struct H2645RBSP { + uint8_t *rbsp_buffer; + AVBufferRef *rbsp_buffer_ref; + int rbsp_buffer_alloc_size; + int rbsp_buffer_size; +} H2645RBSP; + +/* an input packet split into unescaped NAL units */ +typedef struct H2645Packet { + H2645NAL *nals; + H2645RBSP rbsp; + int nb_nals; + int nals_allocated; + unsigned nal_buffer_size; +} H2645Packet; + +/** + * Extract the raw (unescaped) bitstream. + */ +int ff_h2645_extract_rbsp(const uint8_t *src, int length, H2645RBSP *rbsp, + H2645NAL *nal, int small_padding); + +enum { + H2645_FLAG_IS_NALFF = (1 << 0), + H2645_FLAG_SMALL_PADDING = (1 << 1), + H2645_FLAG_USE_REF = (1 << 2), +}; + +/** + * Split an input packet into NAL units. + * + * If data == raw_data holds true for a NAL unit of the returned pkt, then + * said NAL unit does not contain any emulation_prevention_three_byte and + * the data is contained in the input buffer pointed to by buf. + * Otherwise, the unescaped data is part of the rbsp_buffer described by the + * packet's H2645RBSP. + * + * If the packet's rbsp_buffer_ref is not NULL, the underlying AVBuffer must + * own rbsp_buffer. If not and rbsp_buffer is not NULL, H2645_FLAG_USE_REF + * must not be set in flags. + * If H2645_FLAG_USE_REF is set in flags, rbsp_buffer will be reference-counted + * and owned by the underlying AVBuffer of rbsp_buffer_ref. + */ +int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length, + void *logctx, int nal_length_size, + enum AVCodecID codec_id, int flags); + +/** + * Free all the allocated memory in the packet. + */ +void ff_h2645_packet_uninit(H2645Packet *pkt); + +static inline int get_nalsize(int nal_length_size, const uint8_t *buf, + int buf_size, int *buf_index, void *logctx) +{ + int i, nalsize = 0; + + if (*buf_index >= buf_size - nal_length_size) { + // the end of the buffer is reached, refill it + return AVERROR_INVALIDDATA; + } + + for (i = 0; i < nal_length_size; i++) + nalsize = ((unsigned)nalsize << 8) | buf[(*buf_index)++]; + if (nalsize <= 0 || nalsize > buf_size - *buf_index) { + av_log(logctx, AV_LOG_ERROR, + "Invalid NAL unit size (%d > %d).\n", nalsize, buf_size - *buf_index); + return AVERROR_INVALIDDATA; + } + return nalsize; +} + +#endif /* AVCODEC_H2645_PARSE_H */ diff --git a/include/libavcodec/h2645_sei.h b/include/libavcodec/h2645_sei.h new file mode 100644 index 0000000..abc4976 --- /dev/null +++ b/include/libavcodec/h2645_sei.h @@ -0,0 +1,180 @@ +/* + * 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_H2645_SEI_H +#define AVCODEC_H2645_SEI_H + +#include + +#include "libavutil/buffer.h" +#include "libavutil/frame.h" +#include "libavutil/film_grain_params.h" + +#include "aom_film_grain.h" +#include "avcodec.h" +#include "bytestream.h" +#include "codec_id.h" +#include "get_bits.h" +#include "h2645_vui.h" +#include "sei.h" + +typedef struct H2645SEIA53Caption { + AVBufferRef *buf_ref; +} H2645SEIA53Caption; + +typedef struct H2645SEIAFD { + int present; + uint8_t active_format_description; +} H2645SEIAFD; + +typedef struct HEVCSEIDynamicHDRPlus { + AVBufferRef *info; +} HEVCSEIDynamicHDRPlus; + +typedef struct HEVCSEIDynamicHDRVivid { + AVBufferRef *info; +} HEVCSEIDynamicHDRVivid; + +typedef struct HEVCSEILCEVC { + AVBufferRef *info; +} HEVCSEILCEVC; + +typedef struct H2645SEIUnregistered { + AVBufferRef **buf_ref; + unsigned nb_buf_ref; + int x264_build; //< H.264 only +} H2645SEIUnregistered; + +typedef struct H2645SEIFramePacking { + int present; + int arrangement_id; + int arrangement_cancel_flag; ///< is previous arrangement canceled, -1 if never received (currently H.264 only) + SEIFpaType arrangement_type; + int arrangement_repetition_period; + int content_interpretation_type; + int quincunx_sampling_flag; + int current_frame_is_frame0_flag; +} H2645SEIFramePacking; + +typedef struct H2645SEIDisplayOrientation { + int present; + int anticlockwise_rotation; + int hflip, vflip; +} H2645SEIDisplayOrientation; + +typedef struct H2645SEIAlternativeTransfer { + int present; + int preferred_transfer_characteristics; +} H2645SEIAlternativeTransfer; + +typedef struct H2645SEIAmbientViewingEnvironment { + int present; + uint32_t ambient_illuminance; + uint16_t ambient_light_x; + uint16_t ambient_light_y; +} H2645SEIAmbientViewingEnvironment; + +typedef struct H2645SEIFilmGrainCharacteristics { + int present; + int model_id; + int separate_colour_description_present_flag; + int bit_depth_luma; + int bit_depth_chroma; + int full_range; + int color_primaries; + int transfer_characteristics; + int matrix_coeffs; + int blending_mode_id; + int log2_scale_factor; + int comp_model_present_flag[3]; + uint16_t num_intensity_intervals[3]; + uint8_t num_model_values[3]; + uint8_t intensity_interval_lower_bound[3][256]; + uint8_t intensity_interval_upper_bound[3][256]; + int16_t comp_model_value[3][256][6]; + int repetition_period; //< H.264 only + int persistence_flag; //< HEVC only +} H2645SEIFilmGrainCharacteristics; + +typedef struct H2645SEIMasteringDisplay { + int present; + uint16_t display_primaries[3][2]; + uint16_t white_point[2]; + uint32_t max_luminance; + uint32_t min_luminance; +} H2645SEIMasteringDisplay; + +typedef struct H2645SEIContentLight { + int present; + uint16_t max_content_light_level; + uint16_t max_pic_average_light_level; +} H2645SEIContentLight; + +typedef struct H2645SEI { + H2645SEIA53Caption a53_caption; + H2645SEIAFD afd; + HEVCSEIDynamicHDRPlus dynamic_hdr_plus; //< HEVC only + HEVCSEIDynamicHDRVivid dynamic_hdr_vivid; //< HEVC only + HEVCSEILCEVC lcevc; + H2645SEIUnregistered unregistered; + H2645SEIFramePacking frame_packing; + H2645SEIDisplayOrientation display_orientation; + H2645SEIAlternativeTransfer alternative_transfer; + H2645SEIAmbientViewingEnvironment ambient_viewing_environment; + H2645SEIMasteringDisplay mastering_display; + H2645SEIContentLight content_light; + AVFilmGrainAFGS1Params aom_film_grain; + + // Dynamic allocations due to large size. + H2645SEIFilmGrainCharacteristics *film_grain_characteristics; +} H2645SEI; + +enum { + FF_H2645_SEI_MESSAGE_HANDLED = 0, + FF_H2645_SEI_MESSAGE_UNHANDLED, +}; + +/** + * Decode a single SEI message. + * + * This function may either use gb or gbyte to decode the SEI message. + * + * @param[in, out] gb GetBitContext that needs to be at the start + * of the payload (i.e. after the payload_size bytes); + * it needs to be initially byte-aligned + * @param[in, out] gbyte a GetByteContext for the same data as gb + * @return < 0 on error, FF_H2645_SEI_MESSAGE_HANDLED if the SEI message + * has been handled or FF_H2645_SEI_MESSAGE_UNHANDLED if not. + */ +int ff_h2645_sei_message_decode(H2645SEI *h, enum SEIType type, + enum AVCodecID codec_id, GetBitContext *gb, + GetByteContext *gbyte, void *logctx); + +int ff_h2645_sei_ctx_replace(H2645SEI *dst, const H2645SEI *src); + +void ff_h2645_sei_reset(H2645SEI *s); + +int ff_h2645_sei_to_frame(AVFrame *frame, H2645SEI *sei, + enum AVCodecID codec_id, + AVCodecContext *avctx, const H2645VUI *vui, + unsigned bit_depth_luma, unsigned bit_depth_chroma, + int seed); + +int ff_h2645_sei_to_context(AVCodecContext *avctx, H2645SEI *sei); + +#endif /* AVCODEC_H2645_SEI_H */ diff --git a/include/libavcodec/h2645_vui.h b/include/libavcodec/h2645_vui.h new file mode 100644 index 0000000..2c839f4 --- /dev/null +++ b/include/libavcodec/h2645_vui.h @@ -0,0 +1,51 @@ +/* + * 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_H2645_VUI_H +#define AVCODEC_H2645_VUI_H + +#include "libavutil/pixfmt.h" +#include "libavutil/rational.h" + +#include "get_bits.h" + +typedef struct H2645VUI { + AVRational sar; + int aspect_ratio_idc; + int aspect_ratio_info_present_flag; + + int overscan_info_present_flag; + int overscan_appropriate_flag; + + int video_signal_type_present_flag; + int video_format; + int video_full_range_flag; + int colour_description_present_flag; + enum AVColorPrimaries colour_primaries; + enum AVColorTransferCharacteristic transfer_characteristics; + enum AVColorSpace matrix_coeffs; + + int chroma_loc_info_present_flag; + int chroma_sample_loc_type_top_field; + int chroma_sample_loc_type_bottom_field; + enum AVChromaLocation chroma_location; +} H2645VUI; + +void ff_h2645_decode_common_vui_params(GetBitContext *gb, H2645VUI *vui, void *logctx); + +#endif /* AVCODEC_H2645_VUI_H */ diff --git a/include/libavcodec/h2645data.h b/include/libavcodec/h2645data.h new file mode 100644 index 0000000..bc56d76 --- /dev/null +++ b/include/libavcodec/h2645data.h @@ -0,0 +1,26 @@ +/* + * 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_H2645DATA_H +#define AVCODEC_H2645DATA_H + +#include "libavutil/rational.h" + +extern const AVRational ff_h2645_pixel_aspect[17]; + +#endif /* AVCODEC_H2645DATA_H */ diff --git a/include/libavcodec/h264_levels.h b/include/libavcodec/h264_levels.h new file mode 100644 index 0000000..310d79e --- /dev/null +++ b/include/libavcodec/h264_levels.h @@ -0,0 +1,51 @@ +/* + * 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_H264_LEVELS_H +#define AVCODEC_H264_LEVELS_H + + +#include + +typedef struct H264LevelDescriptor { + char name[4]; // Large enough for all current levels like "4.1" + uint8_t level_idc; + uint8_t constraint_set3_flag; + uint32_t max_mbps; + uint32_t max_fs; + uint32_t max_dpb_mbs; + uint32_t max_br; + uint32_t max_cpb; + uint16_t max_v_mv_r; + uint8_t min_cr; + uint8_t max_mvs_per_2mb; +} H264LevelDescriptor; + +/** + * Guess the level of a stream from some parameters. + * + * Unknown parameters may be zero, in which case they are ignored. + */ +const H264LevelDescriptor *ff_h264_guess_level(int profile_idc, + int64_t bitrate, + int framerate, + int width, int height, + int max_dec_frame_buffering); + + +#endif /* AVCODEC_H264_LEVELS_H */ diff --git a/include/libavcodec/h264_mvpred.h b/include/libavcodec/h264_mvpred.h new file mode 100644 index 0000000..bc9fef5 --- /dev/null +++ b/include/libavcodec/h264_mvpred.h @@ -0,0 +1,967 @@ +/* + * H.26L/H.264/AVC/JVT/14496-10/... motion vector prediction + * Copyright (c) 2003 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * H.264 / AVC / MPEG-4 part10 motion vector prediction. + * @author Michael Niedermayer + */ + +#ifndef AVCODEC_H264_MVPRED_H +#define AVCODEC_H264_MVPRED_H + +#include "h264dec.h" +#include "mpegutils.h" +#include "rectangle.h" + +#include "libavutil/avassert.h" +#include "libavutil/mem_internal.h" + + +/** + * Get the predicted intra4x4 prediction mode. + */ +static av_always_inline int pred_intra_mode(const H264Context *h, + H264SliceContext *sl, int n) +{ + const int index8 = scan8[n]; + const int left = sl->intra4x4_pred_mode_cache[index8 - 1]; + const int top = sl->intra4x4_pred_mode_cache[index8 - 8]; + const int min = FFMIN(left, top); + + ff_tlog(h->avctx, "mode:%d %d min:%d\n", left, top, min); + + if (min < 0) + return DC_PRED; + else + return min; +} + +static av_always_inline void write_back_intra_pred_mode(const H264Context *h, + H264SliceContext *sl) +{ + int8_t *i4x4 = sl->intra4x4_pred_mode + h->mb2br_xy[sl->mb_xy]; + int8_t *i4x4_cache = sl->intra4x4_pred_mode_cache; + + AV_COPY32(i4x4, i4x4_cache + 4 + 8 * 4); + i4x4[4] = i4x4_cache[7 + 8 * 3]; + i4x4[5] = i4x4_cache[7 + 8 * 2]; + i4x4[6] = i4x4_cache[7 + 8 * 1]; +} + +static av_always_inline void write_back_non_zero_count(const H264Context *h, + H264SliceContext *sl) +{ + const int mb_xy = sl->mb_xy; + uint8_t *nnz = h->non_zero_count[mb_xy]; + uint8_t *nnz_cache = sl->non_zero_count_cache; + + AV_COPY32(&nnz[ 0], &nnz_cache[4 + 8 * 1]); + AV_COPY32(&nnz[ 4], &nnz_cache[4 + 8 * 2]); + AV_COPY32(&nnz[ 8], &nnz_cache[4 + 8 * 3]); + AV_COPY32(&nnz[12], &nnz_cache[4 + 8 * 4]); + AV_COPY32(&nnz[16], &nnz_cache[4 + 8 * 6]); + AV_COPY32(&nnz[20], &nnz_cache[4 + 8 * 7]); + AV_COPY32(&nnz[32], &nnz_cache[4 + 8 * 11]); + AV_COPY32(&nnz[36], &nnz_cache[4 + 8 * 12]); + + if (!h->chroma_y_shift) { + AV_COPY32(&nnz[24], &nnz_cache[4 + 8 * 8]); + AV_COPY32(&nnz[28], &nnz_cache[4 + 8 * 9]); + AV_COPY32(&nnz[40], &nnz_cache[4 + 8 * 13]); + AV_COPY32(&nnz[44], &nnz_cache[4 + 8 * 14]); + } +} + +static av_always_inline void write_back_motion_list(const H264Context *h, + H264SliceContext *sl, + int b_stride, + int b_xy, int b8_xy, + int mb_type, int list) +{ + int16_t(*mv_dst)[2] = &h->cur_pic.motion_val[list][b_xy]; + int16_t(*mv_src)[2] = &sl->mv_cache[list][scan8[0]]; + AV_COPY128(mv_dst + 0 * b_stride, mv_src + 8 * 0); + AV_COPY128(mv_dst + 1 * b_stride, mv_src + 8 * 1); + AV_COPY128(mv_dst + 2 * b_stride, mv_src + 8 * 2); + AV_COPY128(mv_dst + 3 * b_stride, mv_src + 8 * 3); + if (CABAC(h)) { + uint8_t (*mvd_dst)[2] = &sl->mvd_table[list][FMO ? 8 * sl->mb_xy + : h->mb2br_xy[sl->mb_xy]]; + uint8_t(*mvd_src)[2] = &sl->mvd_cache[list][scan8[0]]; + if (IS_SKIP(mb_type)) { + AV_ZERO128(mvd_dst); + } else { + AV_COPY64(mvd_dst, mvd_src + 8 * 3); + AV_COPY16(mvd_dst + 3 + 3, mvd_src + 3 + 8 * 0); + AV_COPY16(mvd_dst + 3 + 2, mvd_src + 3 + 8 * 1); + AV_COPY16(mvd_dst + 3 + 1, mvd_src + 3 + 8 * 2); + } + } + + { + int8_t *ref_index = &h->cur_pic.ref_index[list][b8_xy]; + int8_t *ref_cache = sl->ref_cache[list]; + ref_index[0 + 0 * 2] = ref_cache[scan8[0]]; + ref_index[1 + 0 * 2] = ref_cache[scan8[4]]; + ref_index[0 + 1 * 2] = ref_cache[scan8[8]]; + ref_index[1 + 1 * 2] = ref_cache[scan8[12]]; + } +} + +static av_always_inline void write_back_motion(const H264Context *h, + H264SliceContext *sl, + int mb_type) +{ + const int b_stride = h->b_stride; + const int b_xy = 4 * sl->mb_x + 4 * sl->mb_y * h->b_stride; // try mb2b(8)_xy + const int b8_xy = 4 * sl->mb_xy; + + if (USES_LIST(mb_type, 0)) { + write_back_motion_list(h, sl, b_stride, b_xy, b8_xy, mb_type, 0); + } else { + fill_rectangle(&h->cur_pic.ref_index[0][b8_xy], + 2, 2, 2, (uint8_t)LIST_NOT_USED, 1); + } + if (USES_LIST(mb_type, 1)) + write_back_motion_list(h, sl, b_stride, b_xy, b8_xy, mb_type, 1); + + if (sl->slice_type_nos == AV_PICTURE_TYPE_B && CABAC(h)) { + if (IS_8X8(mb_type)) { + uint8_t *direct_table = &h->direct_table[4 * sl->mb_xy]; + direct_table[1] = sl->sub_mb_type[1] >> 1; + direct_table[2] = sl->sub_mb_type[2] >> 1; + direct_table[3] = sl->sub_mb_type[3] >> 1; + } + } +} + +static av_always_inline int get_dct8x8_allowed(const H264Context *h, H264SliceContext *sl) +{ + if (h->ps.sps->direct_8x8_inference_flag) + return !(AV_RN64A(sl->sub_mb_type) & + ((MB_TYPE_16x8 | MB_TYPE_8x16 | MB_TYPE_8x8) * + 0x0001000100010001ULL)); + else + return !(AV_RN64A(sl->sub_mb_type) & + ((MB_TYPE_16x8 | MB_TYPE_8x16 | MB_TYPE_8x8 | MB_TYPE_DIRECT2) * + 0x0001000100010001ULL)); +} + +static av_always_inline int fetch_diagonal_mv(const H264Context *h, H264SliceContext *sl, + const int16_t **C, + int i, int list, int part_width) +{ + const int topright_ref = sl->ref_cache[list][i - 8 + part_width]; + + /* there is no consistent mapping of mvs to neighboring locations that will + * make mbaff happy, so we can't move all this logic to fill_caches */ + if (FRAME_MBAFF(h)) { +#define SET_DIAG_MV(MV_OP, REF_OP, XY, Y4) \ + const int xy = XY, y4 = Y4; \ + const int mb_type = mb_types[xy + (y4 >> 2) * h->mb_stride]; \ + if (!USES_LIST(mb_type, list)) \ + return LIST_NOT_USED; \ + mv = h->cur_pic_ptr->motion_val[list][h->mb2b_xy[xy] + 3 + y4 * h->b_stride]; \ + sl->mv_cache[list][scan8[0] - 2][0] = mv[0]; \ + sl->mv_cache[list][scan8[0] - 2][1] = mv[1] MV_OP; \ + return h->cur_pic_ptr->ref_index[list][4 * xy + 1 + (y4 & ~1)] REF_OP; + + if (topright_ref == PART_NOT_AVAILABLE + && i >= scan8[0] + 8 && (i & 7) == 4 + && sl->ref_cache[list][scan8[0] - 1] != PART_NOT_AVAILABLE) { + const uint32_t *mb_types = h->cur_pic_ptr->mb_type; + const int16_t *mv; + AV_ZERO32(sl->mv_cache[list][scan8[0] - 2]); + *C = sl->mv_cache[list][scan8[0] - 2]; + + if (!MB_FIELD(sl) && IS_INTERLACED(sl->left_type[0])) { + SET_DIAG_MV(* 2, >> 1, sl->left_mb_xy[0] + h->mb_stride, + (sl->mb_y & 1) * 2 + (i >> 5)); + } + if (MB_FIELD(sl) && !IS_INTERLACED(sl->left_type[0])) { + // left shift will turn LIST_NOT_USED into PART_NOT_AVAILABLE, but that's OK. + SET_DIAG_MV(/ 2, *2, sl->left_mb_xy[i >= 36], ((i >> 2)) & 3); + } + } +#undef SET_DIAG_MV + } + + if (topright_ref != PART_NOT_AVAILABLE) { + *C = sl->mv_cache[list][i - 8 + part_width]; + return topright_ref; + } else { + ff_tlog(h->avctx, "topright MV not available\n"); + + *C = sl->mv_cache[list][i - 8 - 1]; + return sl->ref_cache[list][i - 8 - 1]; + } +} + +/** + * Get the predicted MV. + * @param n the block index + * @param part_width the width of the partition (4, 8,16) -> (1, 2, 4) + * @param mx the x component of the predicted motion vector + * @param my the y component of the predicted motion vector + */ +static av_always_inline void pred_motion(const H264Context *const h, + H264SliceContext *sl, + int n, + int part_width, int list, int ref, + int *const mx, int *const my) +{ + const int index8 = scan8[n]; + const int top_ref = sl->ref_cache[list][index8 - 8]; + const int left_ref = sl->ref_cache[list][index8 - 1]; + const int16_t *const A = sl->mv_cache[list][index8 - 1]; + const int16_t *const B = sl->mv_cache[list][index8 - 8]; + const int16_t *C; + int diagonal_ref, match_count; + + av_assert2(part_width == 1 || part_width == 2 || part_width == 4); + +/* mv_cache + * B . . A T T T T + * U . . L . . , . + * U . . L . . . . + * U . . L . . , . + * . . . L . . . . + */ + + diagonal_ref = fetch_diagonal_mv(h, sl, &C, index8, list, part_width); + match_count = (diagonal_ref == ref) + (top_ref == ref) + (left_ref == ref); + ff_tlog(h->avctx, "pred_motion match_count=%d\n", match_count); + if (match_count > 1) { //most common + *mx = mid_pred(A[0], B[0], C[0]); + *my = mid_pred(A[1], B[1], C[1]); + } else if (match_count == 1) { + if (left_ref == ref) { + *mx = A[0]; + *my = A[1]; + } else if (top_ref == ref) { + *mx = B[0]; + *my = B[1]; + } else { + *mx = C[0]; + *my = C[1]; + } + } else { + if (top_ref == PART_NOT_AVAILABLE && + diagonal_ref == PART_NOT_AVAILABLE && + left_ref != PART_NOT_AVAILABLE) { + *mx = A[0]; + *my = A[1]; + } else { + *mx = mid_pred(A[0], B[0], C[0]); + *my = mid_pred(A[1], B[1], C[1]); + } + } + + ff_tlog(h->avctx, + "pred_motion (%2d %2d %2d) (%2d %2d %2d) (%2d %2d %2d) -> (%2d %2d %2d) at %2d %2d %d list %d\n", + top_ref, B[0], B[1], diagonal_ref, C[0], C[1], left_ref, + A[0], A[1], ref, *mx, *my, sl->mb_x, sl->mb_y, n, list); +} + +/** + * Get the directionally predicted 16x8 MV. + * @param n the block index + * @param mx the x component of the predicted motion vector + * @param my the y component of the predicted motion vector + */ +static av_always_inline void pred_16x8_motion(const H264Context *const h, + H264SliceContext *sl, + int n, int list, int ref, + int *const mx, int *const my) +{ + if (n == 0) { + const int top_ref = sl->ref_cache[list][scan8[0] - 8]; + const int16_t *const B = sl->mv_cache[list][scan8[0] - 8]; + + ff_tlog(h->avctx, "pred_16x8: (%2d %2d %2d) at %2d %2d %d list %d\n", + top_ref, B[0], B[1], sl->mb_x, sl->mb_y, n, list); + + if (top_ref == ref) { + *mx = B[0]; + *my = B[1]; + return; + } + } else { + const int left_ref = sl->ref_cache[list][scan8[8] - 1]; + const int16_t *const A = sl->mv_cache[list][scan8[8] - 1]; + + ff_tlog(h->avctx, "pred_16x8: (%2d %2d %2d) at %2d %2d %d list %d\n", + left_ref, A[0], A[1], sl->mb_x, sl->mb_y, n, list); + + if (left_ref == ref) { + *mx = A[0]; + *my = A[1]; + return; + } + } + + //RARE + pred_motion(h, sl, n, 4, list, ref, mx, my); +} + +/** + * Get the directionally predicted 8x16 MV. + * @param n the block index + * @param mx the x component of the predicted motion vector + * @param my the y component of the predicted motion vector + */ +static av_always_inline void pred_8x16_motion(const H264Context *const h, + H264SliceContext *sl, + int n, int list, int ref, + int *const mx, int *const my) +{ + if (n == 0) { + const int left_ref = sl->ref_cache[list][scan8[0] - 1]; + const int16_t *const A = sl->mv_cache[list][scan8[0] - 1]; + + ff_tlog(h->avctx, "pred_8x16: (%2d %2d %2d) at %2d %2d %d list %d\n", + left_ref, A[0], A[1], sl->mb_x, sl->mb_y, n, list); + + if (left_ref == ref) { + *mx = A[0]; + *my = A[1]; + return; + } + } else { + const int16_t *C; + int diagonal_ref; + + diagonal_ref = fetch_diagonal_mv(h, sl, &C, scan8[4], list, 2); + + ff_tlog(h->avctx, "pred_8x16: (%2d %2d %2d) at %2d %2d %d list %d\n", + diagonal_ref, C[0], C[1], sl->mb_x, sl->mb_y, n, list); + + if (diagonal_ref == ref) { + *mx = C[0]; + *my = C[1]; + return; + } + } + + //RARE + pred_motion(h, sl, n, 2, list, ref, mx, my); +} + +#define FIX_MV_MBAFF(type, refn, mvn, idx) \ + if (FRAME_MBAFF(h)) { \ + if (MB_FIELD(sl)) { \ + if (!IS_INTERLACED(type)) { \ + refn <<= 1; \ + AV_COPY32(mvbuf[idx], mvn); \ + mvbuf[idx][1] /= 2; \ + mvn = mvbuf[idx]; \ + } \ + } else { \ + if (IS_INTERLACED(type)) { \ + refn >>= 1; \ + AV_COPY32(mvbuf[idx], mvn); \ + mvbuf[idx][1] *= 2; \ + mvn = mvbuf[idx]; \ + } \ + } \ + } + +static av_always_inline void pred_pskip_motion(const H264Context *const h, + H264SliceContext *sl) +{ + DECLARE_ALIGNED(4, static const int16_t, zeromv)[2] = { 0 }; + DECLARE_ALIGNED(4, int16_t, mvbuf)[3][2]; + int8_t *ref = h->cur_pic.ref_index[0]; + int16_t(*mv)[2] = h->cur_pic.motion_val[0]; + int top_ref, left_ref, diagonal_ref, match_count, mx, my; + const int16_t *A, *B, *C; + int b_stride = h->b_stride; + + fill_rectangle(&sl->ref_cache[0][scan8[0]], 4, 4, 8, 0, 1); + + /* To avoid doing an entire fill_decode_caches, we inline the relevant + * parts here. + * FIXME: this is a partial duplicate of the logic in fill_decode_caches, + * but it's faster this way. Is there a way to avoid this duplication? + */ + if (USES_LIST(sl->left_type[LTOP], 0)) { + left_ref = ref[4 * sl->left_mb_xy[LTOP] + 1 + (sl->left_block[0] & ~1)]; + A = mv[h->mb2b_xy[sl->left_mb_xy[LTOP]] + 3 + b_stride * sl->left_block[0]]; + FIX_MV_MBAFF(sl->left_type[LTOP], left_ref, A, 0); + if (!(left_ref | AV_RN32A(A))) + goto zeromv; + } else if (sl->left_type[LTOP]) { + left_ref = LIST_NOT_USED; + A = zeromv; + } else { + goto zeromv; + } + + if (USES_LIST(sl->top_type, 0)) { + top_ref = ref[4 * sl->top_mb_xy + 2]; + B = mv[h->mb2b_xy[sl->top_mb_xy] + 3 * b_stride]; + FIX_MV_MBAFF(sl->top_type, top_ref, B, 1); + if (!(top_ref | AV_RN32A(B))) + goto zeromv; + } else if (sl->top_type) { + top_ref = LIST_NOT_USED; + B = zeromv; + } else { + goto zeromv; + } + + ff_tlog(h->avctx, "pred_pskip: (%d) (%d) at %2d %2d\n", + top_ref, left_ref, sl->mb_x, sl->mb_y); + + if (USES_LIST(sl->topright_type, 0)) { + diagonal_ref = ref[4 * sl->topright_mb_xy + 2]; + C = mv[h->mb2b_xy[sl->topright_mb_xy] + 3 * b_stride]; + FIX_MV_MBAFF(sl->topright_type, diagonal_ref, C, 2); + } else if (sl->topright_type) { + diagonal_ref = LIST_NOT_USED; + C = zeromv; + } else { + if (USES_LIST(sl->topleft_type, 0)) { + diagonal_ref = ref[4 * sl->topleft_mb_xy + 1 + + (sl->topleft_partition & 2)]; + C = mv[h->mb2b_xy[sl->topleft_mb_xy] + 3 + b_stride + + (sl->topleft_partition & 2 * b_stride)]; + FIX_MV_MBAFF(sl->topleft_type, diagonal_ref, C, 2); + } else if (sl->topleft_type) { + diagonal_ref = LIST_NOT_USED; + C = zeromv; + } else { + diagonal_ref = PART_NOT_AVAILABLE; + C = zeromv; + } + } + + match_count = !diagonal_ref + !top_ref + !left_ref; + ff_tlog(h->avctx, "pred_pskip_motion match_count=%d\n", match_count); + if (match_count > 1) { + mx = mid_pred(A[0], B[0], C[0]); + my = mid_pred(A[1], B[1], C[1]); + } else if (match_count == 1) { + if (!left_ref) { + mx = A[0]; + my = A[1]; + } else if (!top_ref) { + mx = B[0]; + my = B[1]; + } else { + mx = C[0]; + my = C[1]; + } + } else { + mx = mid_pred(A[0], B[0], C[0]); + my = mid_pred(A[1], B[1], C[1]); + } + + fill_rectangle(sl->mv_cache[0][scan8[0]], 4, 4, 8, pack16to32(mx, my), 4); + return; + +zeromv: + fill_rectangle(sl->mv_cache[0][scan8[0]], 4, 4, 8, 0, 4); + return; +} + +static void fill_decode_neighbors(const H264Context *h, H264SliceContext *sl, int mb_type) +{ + const int mb_xy = sl->mb_xy; + int topleft_xy, top_xy, topright_xy, left_xy[LEFT_MBS]; + static const uint8_t left_block_options[4][32] = { + { 0, 1, 2, 3, 7, 10, 8, 11, 3 + 0 * 4, 3 + 1 * 4, 3 + 2 * 4, 3 + 3 * 4, 1 + 4 * 4, 1 + 8 * 4, 1 + 5 * 4, 1 + 9 * 4 }, + { 2, 2, 3, 3, 8, 11, 8, 11, 3 + 2 * 4, 3 + 2 * 4, 3 + 3 * 4, 3 + 3 * 4, 1 + 5 * 4, 1 + 9 * 4, 1 + 5 * 4, 1 + 9 * 4 }, + { 0, 0, 1, 1, 7, 10, 7, 10, 3 + 0 * 4, 3 + 0 * 4, 3 + 1 * 4, 3 + 1 * 4, 1 + 4 * 4, 1 + 8 * 4, 1 + 4 * 4, 1 + 8 * 4 }, + { 0, 2, 0, 2, 7, 10, 7, 10, 3 + 0 * 4, 3 + 2 * 4, 3 + 0 * 4, 3 + 2 * 4, 1 + 4 * 4, 1 + 8 * 4, 1 + 4 * 4, 1 + 8 * 4 } + }; + + sl->topleft_partition = -1; + + top_xy = mb_xy - (h->mb_stride << MB_FIELD(sl)); + + /* Wow, what a mess, why didn't they simplify the interlacing & intra + * stuff, I can't imagine that these complex rules are worth it. */ + + topleft_xy = top_xy - 1; + topright_xy = top_xy + 1; + left_xy[LBOT] = left_xy[LTOP] = mb_xy - 1; + sl->left_block = left_block_options[0]; + if (FRAME_MBAFF(h)) { + const int left_mb_field_flag = IS_INTERLACED(h->cur_pic.mb_type[mb_xy - 1]); + const int curr_mb_field_flag = IS_INTERLACED(mb_type); + if (sl->mb_y & 1) { + if (left_mb_field_flag != curr_mb_field_flag) { + left_xy[LBOT] = left_xy[LTOP] = mb_xy - h->mb_stride - 1; + if (curr_mb_field_flag) { + left_xy[LBOT] += h->mb_stride; + sl->left_block = left_block_options[3]; + } else { + topleft_xy += h->mb_stride; + /* take top left mv from the middle of the mb, as opposed + * to all other modes which use the bottom right partition */ + sl->topleft_partition = 0; + sl->left_block = left_block_options[1]; + } + } + } else { + if (curr_mb_field_flag) { + topleft_xy += h->mb_stride & (((h->cur_pic.mb_type[top_xy - 1] >> 7) & 1) - 1); + topright_xy += h->mb_stride & (((h->cur_pic.mb_type[top_xy + 1] >> 7) & 1) - 1); + top_xy += h->mb_stride & (((h->cur_pic.mb_type[top_xy] >> 7) & 1) - 1); + } + if (left_mb_field_flag != curr_mb_field_flag) { + if (curr_mb_field_flag) { + left_xy[LBOT] += h->mb_stride; + sl->left_block = left_block_options[3]; + } else { + sl->left_block = left_block_options[2]; + } + } + } + } + + sl->topleft_mb_xy = topleft_xy; + sl->top_mb_xy = top_xy; + sl->topright_mb_xy = topright_xy; + sl->left_mb_xy[LTOP] = left_xy[LTOP]; + sl->left_mb_xy[LBOT] = left_xy[LBOT]; + //FIXME do we need all in the context? + + sl->topleft_type = h->cur_pic.mb_type[topleft_xy]; + sl->top_type = h->cur_pic.mb_type[top_xy]; + sl->topright_type = h->cur_pic.mb_type[topright_xy]; + sl->left_type[LTOP] = h->cur_pic.mb_type[left_xy[LTOP]]; + sl->left_type[LBOT] = h->cur_pic.mb_type[left_xy[LBOT]]; + + if (FMO) { + if (h->slice_table[topleft_xy] != sl->slice_num) + sl->topleft_type = 0; + if (h->slice_table[top_xy] != sl->slice_num) + sl->top_type = 0; + if (h->slice_table[left_xy[LTOP]] != sl->slice_num) + sl->left_type[LTOP] = sl->left_type[LBOT] = 0; + } else { + if (h->slice_table[topleft_xy] != sl->slice_num) { + sl->topleft_type = 0; + if (h->slice_table[top_xy] != sl->slice_num) + sl->top_type = 0; + if (h->slice_table[left_xy[LTOP]] != sl->slice_num) + sl->left_type[LTOP] = sl->left_type[LBOT] = 0; + } + } + if (h->slice_table[topright_xy] != sl->slice_num) + sl->topright_type = 0; +} + +static void fill_decode_caches(const H264Context *h, H264SliceContext *sl, int mb_type) +{ + int topleft_xy, top_xy, topright_xy, left_xy[LEFT_MBS]; + int topleft_type, top_type, topright_type, left_type[LEFT_MBS]; + const uint8_t *left_block = sl->left_block; + int i; + uint8_t *nnz; + uint8_t *nnz_cache; + + topleft_xy = sl->topleft_mb_xy; + top_xy = sl->top_mb_xy; + topright_xy = sl->topright_mb_xy; + left_xy[LTOP] = sl->left_mb_xy[LTOP]; + left_xy[LBOT] = sl->left_mb_xy[LBOT]; + topleft_type = sl->topleft_type; + top_type = sl->top_type; + topright_type = sl->topright_type; + left_type[LTOP] = sl->left_type[LTOP]; + left_type[LBOT] = sl->left_type[LBOT]; + + if (!IS_SKIP(mb_type)) { + if (IS_INTRA(mb_type)) { + int type_mask = h->ps.pps->constrained_intra_pred ? IS_INTRA(-1) : -1; + sl->topleft_samples_available = + sl->top_samples_available = + sl->left_samples_available = 0xFFFF; + sl->topright_samples_available = 0xEEEA; + + if (!(top_type & type_mask)) { + sl->topleft_samples_available = 0xB3FF; + sl->top_samples_available = 0x33FF; + sl->topright_samples_available = 0x26EA; + } + if (IS_INTERLACED(mb_type) != IS_INTERLACED(left_type[LTOP])) { + if (IS_INTERLACED(mb_type)) { + if (!(left_type[LTOP] & type_mask)) { + sl->topleft_samples_available &= 0xDFFF; + sl->left_samples_available &= 0x5FFF; + } + if (!(left_type[LBOT] & type_mask)) { + sl->topleft_samples_available &= 0xFF5F; + sl->left_samples_available &= 0xFF5F; + } + } else { + int left_typei = h->cur_pic.mb_type[left_xy[LTOP] + h->mb_stride]; + + av_assert2(left_xy[LTOP] == left_xy[LBOT]); + if (!((left_typei & type_mask) && (left_type[LTOP] & type_mask))) { + sl->topleft_samples_available &= 0xDF5F; + sl->left_samples_available &= 0x5F5F; + } + } + } else { + if (!(left_type[LTOP] & type_mask)) { + sl->topleft_samples_available &= 0xDF5F; + sl->left_samples_available &= 0x5F5F; + } + } + + if (!(topleft_type & type_mask)) + sl->topleft_samples_available &= 0x7FFF; + + if (!(topright_type & type_mask)) + sl->topright_samples_available &= 0xFBFF; + + if (IS_INTRA4x4(mb_type)) { + if (IS_INTRA4x4(top_type)) { + AV_COPY32(sl->intra4x4_pred_mode_cache + 4 + 8 * 0, sl->intra4x4_pred_mode + h->mb2br_xy[top_xy]); + } else { + sl->intra4x4_pred_mode_cache[4 + 8 * 0] = + sl->intra4x4_pred_mode_cache[5 + 8 * 0] = + sl->intra4x4_pred_mode_cache[6 + 8 * 0] = + sl->intra4x4_pred_mode_cache[7 + 8 * 0] = 2 - 3 * !(top_type & type_mask); + } + for (i = 0; i < 2; i++) { + if (IS_INTRA4x4(left_type[LEFT(i)])) { + int8_t *mode = sl->intra4x4_pred_mode + h->mb2br_xy[left_xy[LEFT(i)]]; + sl->intra4x4_pred_mode_cache[3 + 8 * 1 + 2 * 8 * i] = mode[6 - left_block[0 + 2 * i]]; + sl->intra4x4_pred_mode_cache[3 + 8 * 2 + 2 * 8 * i] = mode[6 - left_block[1 + 2 * i]]; + } else { + sl->intra4x4_pred_mode_cache[3 + 8 * 1 + 2 * 8 * i] = + sl->intra4x4_pred_mode_cache[3 + 8 * 2 + 2 * 8 * i] = 2 - 3 * !(left_type[LEFT(i)] & type_mask); + } + } + } + } + + /* + * 0 . T T. T T T T + * 1 L . .L . . . . + * 2 L . .L . . . . + * 3 . T TL . . . . + * 4 L . .L . . . . + * 5 L . .. . . . . + */ + /* FIXME: constraint_intra_pred & partitioning & nnz + * (let us hope this is just a typo in the spec) */ + nnz_cache = sl->non_zero_count_cache; + if (top_type) { + nnz = h->non_zero_count[top_xy]; + AV_COPY32(&nnz_cache[4 + 8 * 0], &nnz[4 * 3]); + if (!h->chroma_y_shift) { + AV_COPY32(&nnz_cache[4 + 8 * 5], &nnz[4 * 7]); + AV_COPY32(&nnz_cache[4 + 8 * 10], &nnz[4 * 11]); + } else { + AV_COPY32(&nnz_cache[4 + 8 * 5], &nnz[4 * 5]); + AV_COPY32(&nnz_cache[4 + 8 * 10], &nnz[4 * 9]); + } + } else { + uint32_t top_empty = CABAC(h) && !IS_INTRA(mb_type) ? 0 : 0x40404040; + AV_WN32A(&nnz_cache[4 + 8 * 0], top_empty); + AV_WN32A(&nnz_cache[4 + 8 * 5], top_empty); + AV_WN32A(&nnz_cache[4 + 8 * 10], top_empty); + } + + for (i = 0; i < 2; i++) { + if (left_type[LEFT(i)]) { + nnz = h->non_zero_count[left_xy[LEFT(i)]]; + nnz_cache[3 + 8 * 1 + 2 * 8 * i] = nnz[left_block[8 + 0 + 2 * i]]; + nnz_cache[3 + 8 * 2 + 2 * 8 * i] = nnz[left_block[8 + 1 + 2 * i]]; + if (CHROMA444(h)) { + nnz_cache[3 + 8 * 6 + 2 * 8 * i] = nnz[left_block[8 + 0 + 2 * i] + 4 * 4]; + nnz_cache[3 + 8 * 7 + 2 * 8 * i] = nnz[left_block[8 + 1 + 2 * i] + 4 * 4]; + nnz_cache[3 + 8 * 11 + 2 * 8 * i] = nnz[left_block[8 + 0 + 2 * i] + 8 * 4]; + nnz_cache[3 + 8 * 12 + 2 * 8 * i] = nnz[left_block[8 + 1 + 2 * i] + 8 * 4]; + } else if (CHROMA422(h)) { + nnz_cache[3 + 8 * 6 + 2 * 8 * i] = nnz[left_block[8 + 0 + 2 * i] - 2 + 4 * 4]; + nnz_cache[3 + 8 * 7 + 2 * 8 * i] = nnz[left_block[8 + 1 + 2 * i] - 2 + 4 * 4]; + nnz_cache[3 + 8 * 11 + 2 * 8 * i] = nnz[left_block[8 + 0 + 2 * i] - 2 + 8 * 4]; + nnz_cache[3 + 8 * 12 + 2 * 8 * i] = nnz[left_block[8 + 1 + 2 * i] - 2 + 8 * 4]; + } else { + nnz_cache[3 + 8 * 6 + 8 * i] = nnz[left_block[8 + 4 + 2 * i]]; + nnz_cache[3 + 8 * 11 + 8 * i] = nnz[left_block[8 + 5 + 2 * i]]; + } + } else { + nnz_cache[3 + 8 * 1 + 2 * 8 * i] = + nnz_cache[3 + 8 * 2 + 2 * 8 * i] = + nnz_cache[3 + 8 * 6 + 2 * 8 * i] = + nnz_cache[3 + 8 * 7 + 2 * 8 * i] = + nnz_cache[3 + 8 * 11 + 2 * 8 * i] = + nnz_cache[3 + 8 * 12 + 2 * 8 * i] = CABAC(h) && !IS_INTRA(mb_type) ? 0 : 64; + } + } + + if (CABAC(h)) { + // top_cbp + if (top_type) + sl->top_cbp = h->cbp_table[top_xy]; + else + sl->top_cbp = IS_INTRA(mb_type) ? 0x7CF : 0x00F; + // left_cbp + if (left_type[LTOP]) { + sl->left_cbp = (h->cbp_table[left_xy[LTOP]] & 0x7F0) | + ((h->cbp_table[left_xy[LTOP]] >> (left_block[0] & (~1))) & 2) | + (((h->cbp_table[left_xy[LBOT]] >> (left_block[2] & (~1))) & 2) << 2); + } else { + sl->left_cbp = IS_INTRA(mb_type) ? 0x7CF : 0x00F; + } + } + } + + if (IS_INTER(mb_type) || (IS_DIRECT(mb_type) && sl->direct_spatial_mv_pred)) { + int list; + int b_stride = h->b_stride; + for (list = 0; list < sl->list_count; list++) { + int8_t *ref_cache = &sl->ref_cache[list][scan8[0]]; + int8_t *ref = h->cur_pic.ref_index[list]; + int16_t(*mv_cache)[2] = &sl->mv_cache[list][scan8[0]]; + int16_t(*mv)[2] = h->cur_pic.motion_val[list]; + if (!USES_LIST(mb_type, list)) + continue; + av_assert2(!(IS_DIRECT(mb_type) && !sl->direct_spatial_mv_pred)); + + if (USES_LIST(top_type, list)) { + const int b_xy = h->mb2b_xy[top_xy] + 3 * b_stride; + AV_COPY128(mv_cache[0 - 1 * 8], mv[b_xy + 0]); + ref_cache[0 - 1 * 8] = + ref_cache[1 - 1 * 8] = ref[4 * top_xy + 2]; + ref_cache[2 - 1 * 8] = + ref_cache[3 - 1 * 8] = ref[4 * top_xy + 3]; + } else { + AV_ZERO128(mv_cache[0 - 1 * 8]); + AV_WN32A(&ref_cache[0 - 1 * 8], + ((top_type ? LIST_NOT_USED : PART_NOT_AVAILABLE) & 0xFF) * 0x01010101u); + } + + if (mb_type & (MB_TYPE_16x8 | MB_TYPE_8x8)) { + for (i = 0; i < 2; i++) { + int cache_idx = -1 + i * 2 * 8; + if (USES_LIST(left_type[LEFT(i)], list)) { + const int b_xy = h->mb2b_xy[left_xy[LEFT(i)]] + 3; + const int b8_xy = 4 * left_xy[LEFT(i)] + 1; + AV_COPY32(mv_cache[cache_idx], + mv[b_xy + b_stride * left_block[0 + i * 2]]); + AV_COPY32(mv_cache[cache_idx + 8], + mv[b_xy + b_stride * left_block[1 + i * 2]]); + ref_cache[cache_idx] = ref[b8_xy + (left_block[0 + i * 2] & ~1)]; + ref_cache[cache_idx + 8] = ref[b8_xy + (left_block[1 + i * 2] & ~1)]; + } else { + AV_ZERO32(mv_cache[cache_idx]); + AV_ZERO32(mv_cache[cache_idx + 8]); + ref_cache[cache_idx] = + ref_cache[cache_idx + 8] = (left_type[LEFT(i)]) ? LIST_NOT_USED + : PART_NOT_AVAILABLE; + } + } + } else { + if (USES_LIST(left_type[LTOP], list)) { + const int b_xy = h->mb2b_xy[left_xy[LTOP]] + 3; + const int b8_xy = 4 * left_xy[LTOP] + 1; + AV_COPY32(mv_cache[-1], mv[b_xy + b_stride * left_block[0]]); + ref_cache[-1] = ref[b8_xy + (left_block[0] & ~1)]; + } else { + AV_ZERO32(mv_cache[-1]); + ref_cache[-1] = left_type[LTOP] ? LIST_NOT_USED + : PART_NOT_AVAILABLE; + } + } + + if (USES_LIST(topright_type, list)) { + const int b_xy = h->mb2b_xy[topright_xy] + 3 * b_stride; + AV_COPY32(mv_cache[4 - 1 * 8], mv[b_xy]); + ref_cache[4 - 1 * 8] = ref[4 * topright_xy + 2]; + } else { + AV_ZERO32(mv_cache[4 - 1 * 8]); + ref_cache[4 - 1 * 8] = topright_type ? LIST_NOT_USED + : PART_NOT_AVAILABLE; + } + if(ref_cache[2 - 1*8] < 0 || ref_cache[4 - 1 * 8] < 0) { + if (USES_LIST(topleft_type, list)) { + const int b_xy = h->mb2b_xy[topleft_xy] + 3 + b_stride + + (sl->topleft_partition & 2 * b_stride); + const int b8_xy = 4 * topleft_xy + 1 + (sl->topleft_partition & 2); + AV_COPY32(mv_cache[-1 - 1 * 8], mv[b_xy]); + ref_cache[-1 - 1 * 8] = ref[b8_xy]; + } else { + AV_ZERO32(mv_cache[-1 - 1 * 8]); + ref_cache[-1 - 1 * 8] = topleft_type ? LIST_NOT_USED + : PART_NOT_AVAILABLE; + } + } + + if ((mb_type & (MB_TYPE_SKIP | MB_TYPE_DIRECT2)) && !FRAME_MBAFF(h)) + continue; + + if (!(mb_type & (MB_TYPE_SKIP | MB_TYPE_DIRECT2))) { + uint8_t(*mvd_cache)[2] = &sl->mvd_cache[list][scan8[0]]; + uint8_t(*mvd)[2] = sl->mvd_table[list]; + ref_cache[2 + 8 * 0] = + ref_cache[2 + 8 * 2] = PART_NOT_AVAILABLE; + AV_ZERO32(mv_cache[2 + 8 * 0]); + AV_ZERO32(mv_cache[2 + 8 * 2]); + + if (CABAC(h)) { + if (USES_LIST(top_type, list)) { + const int b_xy = h->mb2br_xy[top_xy]; + AV_COPY64(mvd_cache[0 - 1 * 8], mvd[b_xy + 0]); + } else { + AV_ZERO64(mvd_cache[0 - 1 * 8]); + } + if (USES_LIST(left_type[LTOP], list)) { + const int b_xy = h->mb2br_xy[left_xy[LTOP]] + 6; + AV_COPY16(mvd_cache[-1 + 0 * 8], mvd[b_xy - left_block[0]]); + AV_COPY16(mvd_cache[-1 + 1 * 8], mvd[b_xy - left_block[1]]); + } else { + AV_ZERO16(mvd_cache[-1 + 0 * 8]); + AV_ZERO16(mvd_cache[-1 + 1 * 8]); + } + if (USES_LIST(left_type[LBOT], list)) { + const int b_xy = h->mb2br_xy[left_xy[LBOT]] + 6; + AV_COPY16(mvd_cache[-1 + 2 * 8], mvd[b_xy - left_block[2]]); + AV_COPY16(mvd_cache[-1 + 3 * 8], mvd[b_xy - left_block[3]]); + } else { + AV_ZERO16(mvd_cache[-1 + 2 * 8]); + AV_ZERO16(mvd_cache[-1 + 3 * 8]); + } + AV_ZERO16(mvd_cache[2 + 8 * 0]); + AV_ZERO16(mvd_cache[2 + 8 * 2]); + if (sl->slice_type_nos == AV_PICTURE_TYPE_B) { + uint8_t *direct_cache = &sl->direct_cache[scan8[0]]; + uint8_t *direct_table = h->direct_table; + fill_rectangle(direct_cache, 4, 4, 8, MB_TYPE_16x16 >> 1, 1); + + if (IS_DIRECT(top_type)) { + AV_WN32A(&direct_cache[-1 * 8], + 0x01010101u * (MB_TYPE_DIRECT2 >> 1)); + } else if (IS_8X8(top_type)) { + int b8_xy = 4 * top_xy; + direct_cache[0 - 1 * 8] = direct_table[b8_xy + 2]; + direct_cache[2 - 1 * 8] = direct_table[b8_xy + 3]; + } else { + AV_WN32A(&direct_cache[-1 * 8], + 0x01010101 * (MB_TYPE_16x16 >> 1)); + } + + if (IS_DIRECT(left_type[LTOP])) + direct_cache[-1 + 0 * 8] = MB_TYPE_DIRECT2 >> 1; + else if (IS_8X8(left_type[LTOP])) + direct_cache[-1 + 0 * 8] = direct_table[4 * left_xy[LTOP] + 1 + (left_block[0] & ~1)]; + else + direct_cache[-1 + 0 * 8] = MB_TYPE_16x16 >> 1; + + if (IS_DIRECT(left_type[LBOT])) + direct_cache[-1 + 2 * 8] = MB_TYPE_DIRECT2 >> 1; + else if (IS_8X8(left_type[LBOT])) + direct_cache[-1 + 2 * 8] = direct_table[4 * left_xy[LBOT] + 1 + (left_block[2] & ~1)]; + else + direct_cache[-1 + 2 * 8] = MB_TYPE_16x16 >> 1; + } + } + } + +#define MAP_MVS \ + MAP_F2F(scan8[0] - 1 - 1 * 8, topleft_type) \ + MAP_F2F(scan8[0] + 0 - 1 * 8, top_type) \ + MAP_F2F(scan8[0] + 1 - 1 * 8, top_type) \ + MAP_F2F(scan8[0] + 2 - 1 * 8, top_type) \ + MAP_F2F(scan8[0] + 3 - 1 * 8, top_type) \ + MAP_F2F(scan8[0] + 4 - 1 * 8, topright_type) \ + MAP_F2F(scan8[0] - 1 + 0 * 8, left_type[LTOP]) \ + MAP_F2F(scan8[0] - 1 + 1 * 8, left_type[LTOP]) \ + MAP_F2F(scan8[0] - 1 + 2 * 8, left_type[LBOT]) \ + MAP_F2F(scan8[0] - 1 + 3 * 8, left_type[LBOT]) + + if (FRAME_MBAFF(h)) { + if (MB_FIELD(sl)) { + +#define MAP_F2F(idx, mb_type) \ + if (!IS_INTERLACED(mb_type) && sl->ref_cache[list][idx] >= 0) { \ + sl->ref_cache[list][idx] *= 2; \ + sl->mv_cache[list][idx][1] /= 2; \ + sl->mvd_cache[list][idx][1] >>= 1; \ + } + + MAP_MVS + } else { + +#undef MAP_F2F +#define MAP_F2F(idx, mb_type) \ + if (IS_INTERLACED(mb_type) && sl->ref_cache[list][idx] >= 0) { \ + sl->ref_cache[list][idx] >>= 1; \ + sl->mv_cache[list][idx][1] *= 2; \ + sl->mvd_cache[list][idx][1] <<= 1; \ + } + + MAP_MVS +#undef MAP_F2F + } + } + } + } + + sl->neighbor_transform_size = !!IS_8x8DCT(top_type) + !!IS_8x8DCT(left_type[LTOP]); +} + +/** + * decodes a P_SKIP or B_SKIP macroblock + */ +static void av_unused decode_mb_skip(const H264Context *h, H264SliceContext *sl) +{ + const int mb_xy = sl->mb_xy; + int mb_type = 0; + + memset(h->non_zero_count[mb_xy], 0, 48); + + if (MB_FIELD(sl)) + mb_type |= MB_TYPE_INTERLACED; + + if (sl->slice_type_nos == AV_PICTURE_TYPE_B) { + // just for fill_caches. pred_direct_motion will set the real mb_type + mb_type |= MB_TYPE_L0L1 | MB_TYPE_DIRECT2 | MB_TYPE_SKIP; + if (sl->direct_spatial_mv_pred) { + fill_decode_neighbors(h, sl, mb_type); + fill_decode_caches(h, sl, mb_type); //FIXME check what is needed and what not ... + } + ff_h264_pred_direct_motion(h, sl, &mb_type); + mb_type |= MB_TYPE_SKIP; + } else { + mb_type |= MB_TYPE_16x16 | MB_TYPE_P0L0 | MB_TYPE_P1L0 | MB_TYPE_SKIP; + + fill_decode_neighbors(h, sl, mb_type); + pred_pskip_motion(h, sl); + } + + write_back_motion(h, sl, mb_type); + h->cur_pic.mb_type[mb_xy] = mb_type; + h->cur_pic.qscale_table[mb_xy] = sl->qscale; + h->slice_table[mb_xy] = sl->slice_num; + sl->prev_mb_skipped = 1; +} + +#endif /* AVCODEC_H264_MVPRED_H */ diff --git a/include/libavcodec/h264_parse.h b/include/libavcodec/h264_parse.h new file mode 100644 index 0000000..3481451 --- /dev/null +++ b/include/libavcodec/h264_parse.h @@ -0,0 +1,136 @@ +/* + * 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 + */ + +/** + * @file + * H.264 decoder/parser shared code + */ + +#ifndef AVCODEC_H264_PARSE_H +#define AVCODEC_H264_PARSE_H + +#include "config.h" + +#include + +#include "libavutil/attributes.h" + +#include "get_bits.h" +#include "h264_ps.h" + +#define MB_TYPE_REF0 MB_TYPE_CODEC_SPECIFIC +#define MB_TYPE_8x8DCT 0x01000000 + +// This table must be here because scan8[constant] must be known at compiletime +static const uint8_t scan8[16 * 3 + 3] = { + 4 + 1 * 8, 5 + 1 * 8, 4 + 2 * 8, 5 + 2 * 8, + 6 + 1 * 8, 7 + 1 * 8, 6 + 2 * 8, 7 + 2 * 8, + 4 + 3 * 8, 5 + 3 * 8, 4 + 4 * 8, 5 + 4 * 8, + 6 + 3 * 8, 7 + 3 * 8, 6 + 4 * 8, 7 + 4 * 8, + 4 + 6 * 8, 5 + 6 * 8, 4 + 7 * 8, 5 + 7 * 8, + 6 + 6 * 8, 7 + 6 * 8, 6 + 7 * 8, 7 + 7 * 8, + 4 + 8 * 8, 5 + 8 * 8, 4 + 9 * 8, 5 + 9 * 8, + 6 + 8 * 8, 7 + 8 * 8, 6 + 9 * 8, 7 + 9 * 8, + 4 + 11 * 8, 5 + 11 * 8, 4 + 12 * 8, 5 + 12 * 8, + 6 + 11 * 8, 7 + 11 * 8, 6 + 12 * 8, 7 + 12 * 8, + 4 + 13 * 8, 5 + 13 * 8, 4 + 14 * 8, 5 + 14 * 8, + 6 + 13 * 8, 7 + 13 * 8, 6 + 14 * 8, 7 + 14 * 8, + 0 + 0 * 8, 0 + 5 * 8, 0 + 10 * 8 +}; + +/** + * Memory management control operation opcode. + */ +typedef enum MMCOOpcode { + MMCO_END = 0, + MMCO_SHORT2UNUSED, + MMCO_LONG2UNUSED, + MMCO_SHORT2LONG, + MMCO_SET_MAX_LONG, + MMCO_RESET, + MMCO_LONG, +} MMCOOpcode; + +typedef struct H264PredWeightTable { + int use_weight; + int use_weight_chroma; + int luma_log2_weight_denom; + int chroma_log2_weight_denom; + int luma_weight_flag[2]; ///< 7.4.3.2 luma_weight_lX_flag + int chroma_weight_flag[2]; ///< 7.4.3.2 chroma_weight_lX_flag + // The following 2 can be changed to int8_t but that causes a 10 CPU cycles speed loss + int luma_weight[48][2][2]; + int chroma_weight[48][2][2][2]; + int implicit_weight[48][48][2]; +} H264PredWeightTable; + +typedef struct H264POCContext { + int poc_lsb; + int poc_msb; + int delta_poc_bottom; + int delta_poc[2]; + int frame_num; + int prev_poc_msb; ///< poc_msb of the last reference pic for POC type 0 + int prev_poc_lsb; ///< poc_lsb of the last reference pic for POC type 0 + int frame_num_offset; ///< for POC type 2 + int prev_frame_num_offset; ///< for POC type 2 + int prev_frame_num; ///< frame_num of the last pic for POC type 1/2 +} H264POCContext; + +int ff_h264_pred_weight_table(GetBitContext *gb, const SPS *sps, + const int *ref_count, int slice_type_nos, + H264PredWeightTable *pwt, + int picture_structure, void *logctx); + +/** + * Check if the top & left blocks are available if needed & change the + * dc mode so it only uses the available blocks. + */ +int ff_h264_check_intra4x4_pred_mode(int8_t *pred_mode_cache, void *logctx, + int top_samples_available, int left_samples_available); + +/** + * Check if the top & left blocks are available if needed & change the + * dc mode so it only uses the available blocks. + */ +int ff_h264_check_intra_pred_mode(void *logctx, int top_samples_available, + int left_samples_available, + int mode, int is_chroma); + +int ff_h264_parse_ref_count(int *plist_count, int ref_count[2], + GetBitContext *gb, const PPS *pps, + int slice_type_nos, int picture_structure, void *logctx); + +int ff_h264_init_poc(int pic_field_poc[2], int *pic_poc, + const SPS *sps, H264POCContext *poc, + int picture_structure, int nal_ref_idc); + +int ff_h264_decode_extradata(const uint8_t *data, int size, H264ParamSets *ps, + int *is_avc, int *nal_length_size, + int err_recognition, void *logctx); + +static av_always_inline uint32_t pack16to32(unsigned a, unsigned b) +{ +#if HAVE_BIGENDIAN + return (b & 0xFFFF) + (a << 16); +#else + return (a & 0xFFFF) + (b << 16); +#endif +} + +#endif /* AVCODEC_H264_PARSE_H */ diff --git a/include/libavcodec/h264_ps.h b/include/libavcodec/h264_ps.h new file mode 100644 index 0000000..80af483 --- /dev/null +++ b/include/libavcodec/h264_ps.h @@ -0,0 +1,177 @@ +/* + * 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 + */ + +/** + * @file + * H.264 parameter set handling + */ + +#ifndef AVCODEC_H264_PS_H +#define AVCODEC_H264_PS_H + +#include + +#include "libavutil/pixfmt.h" +#include "libavutil/rational.h" + +#include "avcodec.h" +#include "get_bits.h" +#include "h264.h" +#include "h2645_vui.h" + +#define MAX_SPS_COUNT 32 +#define MAX_PPS_COUNT 256 +#define MAX_LOG2_MAX_FRAME_NUM (12 + 4) + +/** + * Sequence parameter set + */ +typedef struct SPS { + unsigned int sps_id; + int profile_idc; + int level_idc; + int chroma_format_idc; + int transform_bypass; ///< qpprime_y_zero_transform_bypass_flag + int log2_max_frame_num; ///< log2_max_frame_num_minus4 + 4 + int poc_type; ///< pic_order_cnt_type + int log2_max_poc_lsb; ///< log2_max_pic_order_cnt_lsb_minus4 + int delta_pic_order_always_zero_flag; + int offset_for_non_ref_pic; + int offset_for_top_to_bottom_field; + int poc_cycle_length; ///< num_ref_frames_in_pic_order_cnt_cycle + int ref_frame_count; ///< num_ref_frames + int gaps_in_frame_num_allowed_flag; + int mb_width; ///< pic_width_in_mbs_minus1 + 1 + ///< (pic_height_in_map_units_minus1 + 1) * (2 - frame_mbs_only_flag) + int mb_height; + int frame_mbs_only_flag; + int mb_aff; ///< mb_adaptive_frame_field_flag + int direct_8x8_inference_flag; + int crop; ///< frame_cropping_flag + + /* those 4 are already in luma samples */ + unsigned int crop_left; ///< frame_cropping_rect_left_offset + unsigned int crop_right; ///< frame_cropping_rect_right_offset + unsigned int crop_top; ///< frame_cropping_rect_top_offset + unsigned int crop_bottom; ///< frame_cropping_rect_bottom_offset + int vui_parameters_present_flag; + H2645VUI vui; + + int timing_info_present_flag; + uint32_t num_units_in_tick; + uint32_t time_scale; + int fixed_frame_rate_flag; + int32_t offset_for_ref_frame[256]; + int bitstream_restriction_flag; + int num_reorder_frames; + int max_dec_frame_buffering; + int scaling_matrix_present; + uint16_t scaling_matrix_present_mask; + uint8_t scaling_matrix4[6][16]; + uint8_t scaling_matrix8[6][64]; + int nal_hrd_parameters_present_flag; + int vcl_hrd_parameters_present_flag; + int pic_struct_present_flag; + int time_offset_length; + int cpb_cnt; ///< See H.264 E.1.2 + int bit_rate_scale; + uint32_t bit_rate_value[32]; ///< bit_rate_value_minus1 + 1 + uint32_t cpb_size_value[32]; ///< cpb_size_value_minus1 + 1 + uint32_t cpr_flag; + int initial_cpb_removal_delay_length; ///< initial_cpb_removal_delay_length_minus1 + 1 + int cpb_removal_delay_length; ///< cpb_removal_delay_length_minus1 + 1 + int dpb_output_delay_length; ///< dpb_output_delay_length_minus1 + 1 + int bit_depth_luma; ///< bit_depth_luma_minus8 + 8 + int bit_depth_chroma; ///< bit_depth_chroma_minus8 + 8 + int residual_color_transform_flag; ///< residual_colour_transform_flag + int constraint_set_flags; ///< constraint_set[0-3]_flag + uint8_t data[4096]; + size_t data_size; +} SPS; + +/** + * Picture parameter set + */ +typedef struct PPS { + unsigned int pps_id; + unsigned int sps_id; + int cabac; ///< entropy_coding_mode_flag + int pic_order_present; ///< bottom_field_pic_order_in_frame_present_flag + int slice_group_count; ///< num_slice_groups_minus1 + 1 + int mb_slice_group_map_type; + unsigned int ref_count[2]; ///< num_ref_idx_l0/1_active_minus1 + 1 + int weighted_pred; ///< weighted_pred_flag + int weighted_bipred_idc; + int init_qp; ///< pic_init_qp_minus26 + 26 + int init_qs; ///< pic_init_qs_minus26 + 26 + int chroma_qp_index_offset[2]; + int deblocking_filter_parameters_present; ///< deblocking_filter_parameters_present_flag + int constrained_intra_pred; ///< constrained_intra_pred_flag + int redundant_pic_cnt_present; ///< redundant_pic_cnt_present_flag + int transform_8x8_mode; ///< transform_8x8_mode_flag + int pic_scaling_matrix_present_flag; + uint16_t pic_scaling_matrix_present_mask; + uint8_t scaling_matrix4[6][16]; + uint8_t scaling_matrix8[6][64]; + uint8_t chroma_qp_table[2][QP_MAX_NUM+1]; ///< pre-scaled (with chroma_qp_index_offset) version of qp_table + int chroma_qp_diff; + uint8_t data[4096]; + size_t data_size; + + uint32_t dequant4_buffer[6][QP_MAX_NUM + 1][16]; + uint32_t dequant8_buffer[6][QP_MAX_NUM + 1][64]; + uint32_t(*dequant4_coeff[6])[16]; + uint32_t(*dequant8_coeff[6])[64]; + + const SPS *sps; ///< RefStruct reference +} PPS; + +typedef struct H264ParamSets { + const SPS *sps_list[MAX_SPS_COUNT]; ///< RefStruct references + const PPS *pps_list[MAX_PPS_COUNT]; ///< RefStruct references + + /* currently active parameters sets */ + const PPS *pps; ///< RefStruct reference + const SPS *sps; ///< ordinary pointer, no RefStruct reference + + int overread_warning_printed[2]; +} H264ParamSets; + +/** + * compute profile from sps + */ +int ff_h264_get_profile(const SPS *sps); + +/** + * Decode SPS + */ +int ff_h264_decode_seq_parameter_set(GetBitContext *gb, AVCodecContext *avctx, + H264ParamSets *ps, int ignore_truncation); + +/** + * Decode PPS + */ +int ff_h264_decode_picture_parameter_set(GetBitContext *gb, AVCodecContext *avctx, + H264ParamSets *ps, int bit_length); + +/** + * Uninit H264 param sets structure. + */ +void ff_h264_ps_uninit(H264ParamSets *ps); + +#endif /* AVCODEC_H264_PS_H */ diff --git a/include/libavcodec/h264_sei.h b/include/libavcodec/h264_sei.h new file mode 100644 index 0000000..bb9275e --- /dev/null +++ b/include/libavcodec/h264_sei.h @@ -0,0 +1,154 @@ +/* + * 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_H264_SEI_H +#define AVCODEC_H264_SEI_H + +#include "get_bits.h" +#include "h2645_sei.h" +#include "h264_ps.h" +#include "sei.h" + + +/** + * pic_struct in picture timing SEI message + */ +typedef enum { + H264_SEI_PIC_STRUCT_FRAME = 0, ///< 0: %frame + H264_SEI_PIC_STRUCT_TOP_FIELD = 1, ///< 1: top field + H264_SEI_PIC_STRUCT_BOTTOM_FIELD = 2, ///< 2: bottom field + H264_SEI_PIC_STRUCT_TOP_BOTTOM = 3, ///< 3: top field, bottom field, in that order + H264_SEI_PIC_STRUCT_BOTTOM_TOP = 4, ///< 4: bottom field, top field, in that order + H264_SEI_PIC_STRUCT_TOP_BOTTOM_TOP = 5, ///< 5: top field, bottom field, top field repeated, in that order + H264_SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM = 6, ///< 6: bottom field, top field, bottom field repeated, in that order + H264_SEI_PIC_STRUCT_FRAME_DOUBLING = 7, ///< 7: %frame doubling + H264_SEI_PIC_STRUCT_FRAME_TRIPLING = 8 ///< 8: %frame tripling +} H264_SEI_PicStructType; + +typedef struct H264SEITimeCode { + /* When not continuously receiving full timecodes, we have to reference + the previous timecode received */ + int full; + int frame; + int seconds; + int minutes; + int hours; + int dropframe; +} H264SEITimeCode; + +typedef struct H264SEIPictureTiming { + // maximum size of pic_timing according to the spec should be 274 bits + uint8_t payload[40]; + int payload_size_bytes; + + int present; + H264_SEI_PicStructType pic_struct; + + /** + * Bit set of clock types for fields/frames in picture timing SEI message. + * For each found ct_type, appropriate bit is set (e.g., bit 1 for + * interlaced). + */ + int ct_type; + + /** + * dpb_output_delay in picture timing SEI message, see H.264 C.2.2 + */ + int dpb_output_delay; + + /** + * cpb_removal_delay in picture timing SEI message, see H.264 C.1.2 + */ + int cpb_removal_delay; + + /** + * Maximum three timecodes in a pic_timing SEI. + */ + H264SEITimeCode timecode[3]; + + /** + * Number of timecode in use + */ + int timecode_cnt; +} H264SEIPictureTiming; + +typedef struct H264SEIRecoveryPoint { + /** + * recovery_frame_cnt + * + * Set to -1 if no recovery point SEI message found or to number of frames + * before playback synchronizes. Frames having recovery point are key + * frames. + */ + int recovery_frame_cnt; +} H264SEIRecoveryPoint; + +typedef struct H264SEIBufferingPeriod { + int present; ///< Buffering period SEI flag + int initial_cpb_removal_delay[32]; ///< Initial timestamps for CPBs +} H264SEIBufferingPeriod; + +typedef struct H264SEIGreenMetaData { + uint8_t green_metadata_type; + uint8_t period_type; + uint16_t num_seconds; + uint16_t num_pictures; + uint8_t percent_non_zero_macroblocks; + uint8_t percent_intra_coded_macroblocks; + uint8_t percent_six_tap_filtering; + uint8_t percent_alpha_point_deblocking_instance; + uint8_t xsd_metric_type; + uint16_t xsd_metric_value; +} H264SEIGreenMetaData; + +typedef struct H264SEIContext { + H2645SEI common; + H264SEIPictureTiming picture_timing; + H264SEIRecoveryPoint recovery_point; + H264SEIBufferingPeriod buffering_period; + H264SEIGreenMetaData green_metadata; +} H264SEIContext; + +struct H264ParamSets; + +int ff_h264_sei_decode(H264SEIContext *h, GetBitContext *gb, + const struct H264ParamSets *ps, void *logctx); + +static inline int ff_h264_sei_ctx_replace(H264SEIContext *dst, + const H264SEIContext *src) +{ + return ff_h2645_sei_ctx_replace(&dst->common, &src->common); +} + +/** + * Reset SEI values at the beginning of the frame. + */ +void ff_h264_sei_uninit(H264SEIContext *h); + +/** + * Get stereo_mode string from the h264 frame_packing_arrangement + */ +const char *ff_h264_sei_stereo_mode(const H2645SEIFramePacking *h); + +/** + * Parse the contents of a picture timing message given an active SPS. + */ +int ff_h264_sei_process_picture_timing(H264SEIPictureTiming *h, const SPS *sps, + void *logctx); + +#endif /* AVCODEC_H264_SEI_H */ diff --git a/include/libavcodec/h264chroma.h b/include/libavcodec/h264chroma.h new file mode 100644 index 0000000..9c81c18 --- /dev/null +++ b/include/libavcodec/h264chroma.h @@ -0,0 +1,42 @@ +/* + * 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_H264CHROMA_H +#define AVCODEC_H264CHROMA_H + +#include +#include + +typedef void (*h264_chroma_mc_func)(uint8_t *dst /*align 8*/, const uint8_t *src /*align 1*/, ptrdiff_t srcStride, int h, int x, int y); + +typedef struct H264ChromaContext { + h264_chroma_mc_func put_h264_chroma_pixels_tab[4]; + h264_chroma_mc_func avg_h264_chroma_pixels_tab[4]; +} H264ChromaContext; + +void ff_h264chroma_init(H264ChromaContext *c, int bit_depth); + +void ff_h264chroma_init_aarch64(H264ChromaContext *c, int bit_depth); +void ff_h264chroma_init_arm(H264ChromaContext *c, int bit_depth); +void ff_h264chroma_init_ppc(H264ChromaContext *c, int bit_depth); +void ff_h264chroma_init_x86(H264ChromaContext *c, int bit_depth); +void ff_h264chroma_init_mips(H264ChromaContext *c, int bit_depth); +void ff_h264chroma_init_loongarch(H264ChromaContext *c, int bit_depth); +void ff_h264chroma_init_riscv(H264ChromaContext *c, int bit_depth); + +#endif /* AVCODEC_H264CHROMA_H */ diff --git a/include/libavcodec/h264data.h b/include/libavcodec/h264data.h new file mode 100644 index 0000000..f809886 --- /dev/null +++ b/include/libavcodec/h264data.h @@ -0,0 +1,60 @@ +/* + * 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_H264DATA_H +#define AVCODEC_H264DATA_H + +#include + +#include "libavutil/rational.h" +#include "h264.h" + +extern const uint8_t ff_h264_golomb_to_pict_type[5]; +extern const uint8_t ff_h264_golomb_to_intra4x4_cbp[48]; +extern const uint8_t ff_h264_golomb_to_inter_cbp[48]; + +extern const uint8_t ff_h264_chroma_dc_scan[4]; +extern const uint8_t ff_h264_chroma422_dc_scan[8]; + +typedef struct IMbInfo { + uint16_t type; + uint8_t pred_mode; + uint8_t cbp; +} IMbInfo; + +extern const IMbInfo ff_h264_i_mb_type_info[26]; + +typedef struct PMbInfo { + uint16_t type; + uint8_t partition_count; +} PMbInfo; + +extern const PMbInfo ff_h264_p_mb_type_info[5]; +extern const PMbInfo ff_h264_p_sub_mb_type_info[4]; +extern const PMbInfo ff_h264_b_mb_type_info[23]; +extern const PMbInfo ff_h264_b_sub_mb_type_info[13]; + +extern const uint8_t ff_h264_dequant4_coeff_init[6][3]; +extern const uint8_t ff_h264_dequant8_coeff_init_scan[16]; +extern const uint8_t ff_h264_dequant8_coeff_init[6][6]; +extern const uint8_t ff_h264_quant_rem6[QP_MAX_NUM + 1]; +extern const uint8_t ff_h264_quant_div6[QP_MAX_NUM + 1]; + +extern const uint8_t ff_h264_chroma_qp[7][QP_MAX_NUM + 1]; + +#endif /* AVCODEC_H264DATA_H */ diff --git a/include/libavcodec/h264dec.h b/include/libavcodec/h264dec.h new file mode 100644 index 0000000..ccd7583 --- /dev/null +++ b/include/libavcodec/h264dec.h @@ -0,0 +1,709 @@ +/* + * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder + * Copyright (c) 2003 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * H.264 / AVC / MPEG-4 part10 codec. + * @author Michael Niedermayer + */ + +#ifndef AVCODEC_H264DEC_H +#define AVCODEC_H264DEC_H + +#include "libavutil/buffer.h" +#include "libavutil/mem_internal.h" + +#include "cabac.h" +#include "error_resilience.h" +#include "h264_parse.h" +#include "h264_ps.h" +#include "h264_sei.h" +#include "h2645_parse.h" +#include "h264chroma.h" +#include "h264dsp.h" +#include "h264pred.h" +#include "h264qpel.h" +#include "h274.h" +#include "mpegutils.h" +#include "threadframe.h" +#include "videodsp.h" + +#define H264_MAX_PICTURE_COUNT 36 + +/* Compiling in interlaced support reduces the speed + * of progressive decoding by about 2%. */ +#define ALLOW_INTERLACE + +#define FMO 0 + +/** + * The maximum number of slices supported by the decoder. + * must be a power of 2 + */ +#define MAX_SLICES 32 + +#ifdef ALLOW_INTERLACE +#define MB_MBAFF(h) (h)->mb_mbaff +#define MB_FIELD(sl) (sl)->mb_field_decoding_flag +#define FRAME_MBAFF(h) (h)->mb_aff_frame +#define FIELD_PICTURE(h) ((h)->picture_structure != PICT_FRAME) +#define LEFT_MBS 2 +#define LTOP 0 +#define LBOT 1 +#define LEFT(i) (i) +#else +#define MB_MBAFF(h) 0 +#define MB_FIELD(sl) 0 +#define FRAME_MBAFF(h) 0 +#define FIELD_PICTURE(h) 0 +#undef IS_INTERLACED +#define IS_INTERLACED(mb_type) 0 +#define LEFT_MBS 1 +#define LTOP 0 +#define LBOT 0 +#define LEFT(i) 0 +#endif +#define FIELD_OR_MBAFF_PICTURE(h) (FRAME_MBAFF(h) || FIELD_PICTURE(h)) + +#ifndef CABAC +#define CABAC(h) (h)->ps.pps->cabac +#endif + +#define CHROMA(h) ((h)->ps.sps->chroma_format_idc) +#define CHROMA422(h) ((h)->ps.sps->chroma_format_idc == 2) +#define CHROMA444(h) ((h)->ps.sps->chroma_format_idc == 3) + +#define IS_REF0(a) ((a) & MB_TYPE_REF0) +#define IS_8x8DCT(a) ((a) & MB_TYPE_8x8DCT) +#define IS_SUB_8X8(a) ((a) & MB_TYPE_16x16) // note reused +#define IS_SUB_8X4(a) ((a) & MB_TYPE_16x8) // note reused +#define IS_SUB_4X8(a) ((a) & MB_TYPE_8x16) // note reused +#define IS_SUB_4X4(a) ((a) & MB_TYPE_8x8) // note reused +#define IS_DIR(a, part, list) ((a) & (MB_TYPE_P0L0 << ((part) + 2 * (list)))) + +// does this mb use listX, note does not work if subMBs +#define USES_LIST(a, list) ((a) & ((MB_TYPE_P0L0 | MB_TYPE_P1L0) << (2 * (list)))) + +/** + * Memory management control operation. + */ +typedef struct MMCO { + MMCOOpcode opcode; + int short_pic_num; ///< pic_num without wrapping (pic_num & max_pic_num) + int long_arg; ///< index, pic_num, or num long refs depending on opcode +} MMCO; + +typedef struct H264Picture { + AVFrame *f; + ThreadFrame tf; + + AVFrame *f_grain; + + int8_t *qscale_table_base; ///< RefStruct reference + int8_t *qscale_table; + + int16_t (*motion_val_base[2])[2]; ///< RefStruct reference + int16_t (*motion_val[2])[2]; + + uint32_t *mb_type_base; ///< RefStruct reference + uint32_t *mb_type; + + /// RefStruct reference for hardware accelerator private data + void *hwaccel_picture_private; + + int8_t *ref_index[2]; ///< RefStruct reference + + int field_poc[2]; ///< top/bottom POC + int poc; ///< frame POC + int frame_num; ///< frame_num (raw frame_num from slice header) + int mmco_reset; /**< MMCO_RESET set this 1. Reordering code must + not mix pictures before and after MMCO_RESET. */ + int pic_id; /**< pic_num (short -> no wrap version of pic_num, + pic_num & max_pic_num; long -> long_pic_num) */ + int long_ref; ///< 1->long term reference 0->short term reference + int ref_poc[2][2][32]; ///< POCs of the frames/fields used as reference (FIXME need per slice) + int ref_count[2][2]; ///< number of entries in ref_poc (FIXME need per slice) + int mbaff; ///< 1 -> MBAFF frame 0-> not MBAFF + int field_picture; ///< whether or not picture was encoded in separate fields + +/** + * H264Picture.reference has this flag set, + * when the picture is held for delayed output. + */ +#define DELAYED_PIC_REF (1 << 2) + int reference; + int recovered; ///< picture at IDR or recovery point + recovery count + int invalid_gap; + int sei_recovery_frame_cnt; + int needs_fg; ///< whether picture needs film grain synthesis (see `f_grain`) + + const PPS *pps; + + int mb_width, mb_height; + int mb_stride; + + /// RefStruct reference; its pointee is shared between decoding threads. + atomic_int *decode_error_flags; + + int gray; +} H264Picture; + +typedef struct H264Ref { + uint8_t *data[3]; + int linesize[3]; + + int reference; + int poc; + int pic_id; + + const H264Picture *parent; +} H264Ref; + +typedef struct H264SliceContext { + const struct H264Context *h264; + GetBitContext gb; + ERContext *er; + + int slice_num; + int slice_type; + int slice_type_nos; ///< S free slice type (SI/SP are remapped to I/P) + int slice_type_fixed; + + int qscale; + int chroma_qp[2]; // QPc + int qp_thresh; ///< QP threshold to skip loopfilter + int last_qscale_diff; + + // deblock + int deblocking_filter; ///< disable_deblocking_filter_idc with 1 <-> 0 + int slice_alpha_c0_offset; + int slice_beta_offset; + + H264PredWeightTable pwt; + + int prev_mb_skipped; + int next_mb_skipped; + + int chroma_pred_mode; + int intra16x16_pred_mode; + + int8_t intra4x4_pred_mode_cache[5 * 8]; + int8_t(*intra4x4_pred_mode); + + int topleft_mb_xy; + int top_mb_xy; + int topright_mb_xy; + int left_mb_xy[LEFT_MBS]; + + int topleft_type; + int top_type; + int topright_type; + int left_type[LEFT_MBS]; + + const uint8_t *left_block; + int topleft_partition; + + unsigned int topleft_samples_available; + unsigned int top_samples_available; + unsigned int topright_samples_available; + unsigned int left_samples_available; + + ptrdiff_t linesize, uvlinesize; + ptrdiff_t mb_linesize; ///< may be equal to s->linesize or s->linesize * 2, for mbaff + ptrdiff_t mb_uvlinesize; + + int mb_x, mb_y; + int mb_xy; + int resync_mb_x; + int resync_mb_y; + unsigned int first_mb_addr; + // index of the first MB of the next slice + int next_slice_idx; + int mb_skip_run; + int is_complex; + + int picture_structure; + int mb_field_decoding_flag; + int mb_mbaff; ///< mb_aff_frame && mb_field_decoding_flag + + int redundant_pic_count; + + /** + * number of neighbors (top and/or left) that used 8x8 dct + */ + int neighbor_transform_size; + + int direct_spatial_mv_pred; + int col_parity; + int col_fieldoff; + + int cbp; + int top_cbp; + int left_cbp; + + int dist_scale_factor[32]; + int dist_scale_factor_field[2][32]; + int map_col_to_list0[2][16 + 32]; + int map_col_to_list0_field[2][2][16 + 32]; + + /** + * num_ref_idx_l0/1_active_minus1 + 1 + */ + unsigned int ref_count[2]; ///< counts frames or fields, depending on current mb mode + unsigned int list_count; + H264Ref ref_list[2][48]; /**< 0..15: frame refs, 16..47: mbaff field refs. + * Reordered version of default_ref_list + * according to picture reordering in slice header */ + struct { + uint8_t op; + uint32_t val; + } ref_modifications[2][32]; + int nb_ref_modifications[2]; + + unsigned int pps_id; + + const uint8_t *intra_pcm_ptr; + + uint8_t *bipred_scratchpad; + uint8_t *edge_emu_buffer; + uint8_t (*top_borders[2])[(16 * 3) * 2]; + int bipred_scratchpad_allocated; + int edge_emu_buffer_allocated; + int top_borders_allocated[2]; + + /** + * non zero coeff count cache. + * is 64 if not available. + */ + DECLARE_ALIGNED(8, uint8_t, non_zero_count_cache)[15 * 8]; + + /** + * Motion vector cache. + */ + DECLARE_ALIGNED(16, int16_t, mv_cache)[2][5 * 8][2]; + DECLARE_ALIGNED(8, int8_t, ref_cache)[2][5 * 8]; + DECLARE_ALIGNED(16, uint8_t, mvd_cache)[2][5 * 8][2]; + uint8_t direct_cache[5 * 8]; + + DECLARE_ALIGNED(8, uint16_t, sub_mb_type)[4]; + + ///< as a DCT coefficient is int32_t in high depth, we need to reserve twice the space. + DECLARE_ALIGNED(16, int16_t, mb)[16 * 48 * 2]; + DECLARE_ALIGNED(16, int16_t, mb_luma_dc)[3][16 * 2]; + ///< as mb is addressed by scantable[i] and scantable is uint8_t we can either + ///< check that i is not too large or ensure that there is some unused stuff after mb + int16_t mb_padding[256 * 2]; + + uint8_t (*mvd_table[2])[2]; + + /** + * Cabac + */ + CABACContext cabac; + uint8_t cabac_state[1024]; + int cabac_init_idc; + + MMCO mmco[H264_MAX_MMCO_COUNT]; + int nb_mmco; + int explicit_ref_marking; + + int frame_num; + int idr_pic_id; + int poc_lsb; + int delta_poc_bottom; + int delta_poc[2]; + int curr_pic_num; + int max_pic_num; +} H264SliceContext; + +/** + * H264Context + */ +typedef struct H264Context { + const AVClass *class; + AVCodecContext *avctx; + VideoDSPContext vdsp; + H264DSPContext h264dsp; + H264ChromaContext h264chroma; + H264QpelContext h264qpel; + H274FilmGrainDatabase h274db; + + H264Picture DPB[H264_MAX_PICTURE_COUNT]; + H264Picture *cur_pic_ptr; + H264Picture cur_pic; + H264Picture last_pic_for_ec; + + H264SliceContext *slice_ctx; + int nb_slice_ctx; + int nb_slice_ctx_queued; + + H2645Packet pkt; + + int pixel_shift; ///< 0 for 8-bit H.264, 1 for high-bit-depth H.264 + + /* coded dimensions -- 16 * mb w/h */ + int width, height; + int chroma_x_shift, chroma_y_shift; + + int droppable; + + int context_initialized; + int flags; + int workaround_bugs; + int x264_build; + /* Set when slice threading is used and at least one slice uses deblocking + * mode 1 (i.e. across slice boundaries). Then we disable the loop filter + * during normal MB decoding and execute it serially at the end. + */ + int postpone_filter; + + /* + * Set to 1 when the current picture is IDR, 0 otherwise. + */ + int picture_idr; + + /* + * Set to 1 when the current picture contains only I slices, 0 otherwise. + */ + int picture_intra_only; + + int crop_left; + int crop_right; + int crop_top; + int crop_bottom; + + int8_t(*intra4x4_pred_mode); + H264PredContext hpc; + + uint8_t (*non_zero_count)[48]; + +#define LIST_NOT_USED -1 // FIXME rename? + + /** + * block_offset[ 0..23] for frame macroblocks + * block_offset[24..47] for field macroblocks + */ + int block_offset[2 * (16 * 3)]; + + uint32_t *mb2b_xy; // FIXME are these 4 a good idea? + uint32_t *mb2br_xy; + int b_stride; // FIXME use s->b4_stride + + uint16_t *slice_table; ///< slice_table_base + 2*mb_stride + 1 + + // interlacing specific flags + int mb_aff_frame; + int picture_structure; + int first_field; + + uint8_t *list_counts; ///< Array of list_count per MB specifying the slice type + + /* 0x100 -> non null luma_dc, 0x80/0x40 -> non null chroma_dc (cb/cr), 0x?0 -> chroma_cbp(0, 1, 2), 0x0? luma_cbp */ + uint16_t *cbp_table; + + /* chroma_pred_mode for i4x4 or i16x16, else 0 */ + uint8_t *chroma_pred_mode_table; + uint8_t (*mvd_table[2])[2]; + uint8_t *direct_table; + + uint8_t scan_padding[16]; + uint8_t zigzag_scan[16]; + uint8_t zigzag_scan8x8[64]; + uint8_t zigzag_scan8x8_cavlc[64]; + uint8_t field_scan[16]; + uint8_t field_scan8x8[64]; + uint8_t field_scan8x8_cavlc[64]; + uint8_t zigzag_scan_q0[16]; + uint8_t zigzag_scan8x8_q0[64]; + uint8_t zigzag_scan8x8_cavlc_q0[64]; + uint8_t field_scan_q0[16]; + uint8_t field_scan8x8_q0[64]; + uint8_t field_scan8x8_cavlc_q0[64]; + + int mb_y; + int mb_height, mb_width; + int mb_stride; + int mb_num; + + // ============================================================= + // Things below are not used in the MB or more inner code + + int nal_ref_idc; + int nal_unit_type; + + int has_slice; ///< slice NAL is found in the packet, set by decode_nal_units, its state does not need to be preserved outside h264_decode_frame() + + /** + * Used to parse AVC variant of H.264 + */ + int is_avc; ///< this flag is != 0 if codec is avc1 + int nal_length_size; ///< Number of bytes used for nal length (1, 2 or 4) + + int bit_depth_luma; ///< luma bit depth from sps to detect changes + int chroma_format_idc; ///< chroma format from sps to detect changes + + H264ParamSets ps; + + uint16_t *slice_table_base; + + H264POCContext poc; + + H264Ref default_ref[2]; + H264Picture *short_ref[32]; + H264Picture *long_ref[32]; + H264Picture *delayed_pic[H264_MAX_DPB_FRAMES + 2]; // FIXME size? + int last_pocs[H264_MAX_DPB_FRAMES]; + H264Picture *next_output_pic; + int next_outputed_poc; + int poc_offset; ///< PicOrderCnt_offset from SMPTE RDD-2006 + + /** + * memory management control operations buffer. + */ + MMCO mmco[H264_MAX_MMCO_COUNT]; + int nb_mmco; + int mmco_reset; + int explicit_ref_marking; + + int long_ref_count; ///< number of actual long term references + int short_ref_count; ///< number of actual short term references + + /** + * @name Members for slice based multithreading + * @{ + */ + /** + * current slice number, used to initialize slice_num of each thread/context + */ + int current_slice; + + /** @} */ + + /** + * Complement sei_pic_struct + * SEI_PIC_STRUCT_TOP_BOTTOM and SEI_PIC_STRUCT_BOTTOM_TOP indicate interlaced frames. + * However, soft telecined frames may have these values. + * This is used in an attempt to flag soft telecine progressive. + */ + int prev_interlaced_frame; + + /** + * Are the SEI recovery points looking valid. + */ + int valid_recovery_point; + + /** + * recovery_frame is the frame_num at which the next frame should + * be fully constructed. + * + * Set to -1 when not expecting a recovery point. + */ + int recovery_frame; + +/** + * We have seen an IDR, so all the following frames in coded order are correctly + * decodable. + */ +#define FRAME_RECOVERED_IDR (1 << 0) +/** + * Sufficient number of frames have been decoded since a SEI recovery point, + * so all the following frames in presentation order are correct. + */ +#define FRAME_RECOVERED_SEI (1 << 1) +/** + * Recovery point detected by heuristic + */ +#define FRAME_RECOVERED_HEURISTIC (1 << 2) + + /** + * Initial frame has been completely recovered. + * + * Once this is set, all following decoded as well as displayed frames will be marked as recovered + * If a frame is marked as recovered frame_recovered will be set once this frame is output and thus + * all subsequently output fraames are also marked as recovered + * + * In effect, if you want all subsequent DECODED frames marked as recovered, set frame_recovered + * If you want all subsequent DISPAYED frames marked as recovered, set the frame->recovered + */ + int frame_recovered; + + int has_recovery_point; + + int missing_fields; + + /* for frame threading, this is set to 1 + * after finish_setup() has been called, so we cannot modify + * some context properties (which are supposed to stay constant between + * slices) anymore */ + int setup_finished; + + int cur_chroma_format_idc; + int cur_bit_depth_luma; + int16_t slice_row[MAX_SLICES]; ///< to detect when MAX_SLICES is too low + + /* original AVCodecContext dimensions, used to handle container + * cropping */ + int width_from_caller; + int height_from_caller; + + int enable_er; + ERContext er; + int16_t *dc_val_base; + + H264SEIContext sei; + + struct FFRefStructPool *qscale_table_pool; + struct FFRefStructPool *mb_type_pool; + struct FFRefStructPool *motion_val_pool; + struct FFRefStructPool *ref_index_pool; + struct FFRefStructPool *decode_error_flags_pool; + int ref2frm[MAX_SLICES][2][64]; ///< reference to frame number lists, used in the loop filter, the first 2 are for -2,-1 + + int non_gray; ///< Did we encounter a intra frame after a gray gap frame + int noref_gray; + int skip_gray; +} H264Context; + +extern const uint16_t ff_h264_mb_sizes[4]; + +/** + * Reconstruct bitstream slice_type. + */ +int ff_h264_get_slice_type(const H264SliceContext *sl); + +/** + * Allocate tables. + * needs width/height + */ +int ff_h264_alloc_tables(H264Context *h); + +int ff_h264_decode_ref_pic_list_reordering(H264SliceContext *sl, void *logctx); +int ff_h264_build_ref_list(H264Context *h, H264SliceContext *sl); +void ff_h264_remove_all_refs(H264Context *h); + +/** + * Execute the reference picture marking (memory management control operations). + */ +int ff_h264_execute_ref_pic_marking(H264Context *h); + +int ff_h264_decode_ref_pic_marking(H264SliceContext *sl, GetBitContext *gb, + const H2645NAL *nal, void *logctx); + +void ff_h264_hl_decode_mb(const H264Context *h, H264SliceContext *sl); +void ff_h264_decode_init_vlc(void); + +/** + * Decode a macroblock + * @return 0 if OK, ER_AC_ERROR / ER_DC_ERROR / ER_MV_ERROR on error + */ +int ff_h264_decode_mb_cavlc(const H264Context *h, H264SliceContext *sl); + +/** + * Decode a CABAC coded macroblock + * @return 0 if OK, ER_AC_ERROR / ER_DC_ERROR / ER_MV_ERROR on error + */ +int ff_h264_decode_mb_cabac(const H264Context *h, H264SliceContext *sl); + +void ff_h264_init_cabac_states(const H264Context *h, H264SliceContext *sl); + +void ff_h264_direct_dist_scale_factor(const H264Context *const h, H264SliceContext *sl); +void ff_h264_direct_ref_list_init(const H264Context *const h, H264SliceContext *sl); +void ff_h264_pred_direct_motion(const H264Context *const h, H264SliceContext *sl, + int *mb_type); + +void ff_h264_filter_mb_fast(const H264Context *h, H264SliceContext *sl, int mb_x, int mb_y, + uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, + unsigned int linesize, unsigned int uvlinesize); +void ff_h264_filter_mb(const H264Context *h, H264SliceContext *sl, int mb_x, int mb_y, + uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, + unsigned int linesize, unsigned int uvlinesize); + +/* + * o-o o-o + * / / / + * o-o o-o + * ,---' + * o-o o-o + * / / / + * o-o o-o + */ + +/* Scan8 organization: + * 0 1 2 3 4 5 6 7 + * 0 DY y y y y y + * 1 y Y Y Y Y + * 2 y Y Y Y Y + * 3 y Y Y Y Y + * 4 y Y Y Y Y + * 5 DU u u u u u + * 6 u U U U U + * 7 u U U U U + * 8 u U U U U + * 9 u U U U U + * 10 DV v v v v v + * 11 v V V V V + * 12 v V V V V + * 13 v V V V V + * 14 v V V V V + * DY/DU/DV are for luma/chroma DC. + */ + +#define LUMA_DC_BLOCK_INDEX 48 +#define CHROMA_DC_BLOCK_INDEX 49 + +/** + * Get the chroma qp. + */ +static av_always_inline int get_chroma_qp(const PPS *pps, int t, int qscale) +{ + return pps->chroma_qp_table[t][qscale]; +} + +int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup); + +int ff_h264_ref_picture(H264Picture *dst, const H264Picture *src); +int ff_h264_replace_picture(H264Picture *dst, const H264Picture *src); +void ff_h264_unref_picture(H264Picture *pic); + +void ff_h264_slice_context_init(H264Context *h, H264SliceContext *sl); + +void ff_h264_draw_horiz_band(const H264Context *h, H264SliceContext *sl, int y, int height); + +/** + * Submit a slice for decoding. + * + * Parse the slice header, starting a new field/frame if necessary. If any + * slices are queued for the previous field, they are decoded. + */ +int ff_h264_queue_decode_slice(H264Context *h, const H2645NAL *nal); +int ff_h264_execute_decode_slices(H264Context *h); +int ff_h264_update_thread_context(AVCodecContext *dst, + const AVCodecContext *src); +int ff_h264_update_thread_context_for_user(AVCodecContext *dst, + const AVCodecContext *src); + +void ff_h264_flush_change(H264Context *h); + +void ff_h264_free_tables(H264Context *h); + +void ff_h264_set_erpic(ERPicture *dst, const H264Picture *src); + +#endif /* AVCODEC_H264DEC_H */ diff --git a/include/libavcodec/h264dsp.h b/include/libavcodec/h264dsp.h new file mode 100644 index 0000000..4a9cb15 --- /dev/null +++ b/include/libavcodec/h264dsp.h @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2003-2010 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * H.264 DSP functions. + * @author Michael Niedermayer + */ + +#ifndef AVCODEC_H264DSP_H +#define AVCODEC_H264DSP_H + +#include +#include + +typedef void (*h264_weight_func)(uint8_t *block, ptrdiff_t stride, int height, + int log2_denom, int weight, int offset); +typedef void (*h264_biweight_func)(uint8_t *dst, uint8_t *src, + ptrdiff_t stride, int height, int log2_denom, + int weightd, int weights, int offset); + +/** + * Context for storing H.264 DSP functions + */ +typedef struct H264DSPContext { + /* weighted MC */ + h264_weight_func weight_h264_pixels_tab[4]; + h264_biweight_func biweight_h264_pixels_tab[4]; + + /* loop filter */ + void (*h264_v_loop_filter_luma)(uint8_t *pix /*align 16*/, ptrdiff_t stride, + int alpha, int beta, int8_t *tc0); + void (*h264_h_loop_filter_luma)(uint8_t *pix /*align 4 */, ptrdiff_t stride, + int alpha, int beta, int8_t *tc0); + void (*h264_h_loop_filter_luma_mbaff)(uint8_t *pix /*align 16*/, ptrdiff_t stride, + int alpha, int beta, int8_t *tc0); + /* v/h_loop_filter_luma_intra: align 16 */ + void (*h264_v_loop_filter_luma_intra)(uint8_t *pix, ptrdiff_t stride, + int alpha, int beta); + void (*h264_h_loop_filter_luma_intra)(uint8_t *pix, ptrdiff_t stride, + int alpha, int beta); + void (*h264_h_loop_filter_luma_mbaff_intra)(uint8_t *pix /*align 16*/, + ptrdiff_t stride, int alpha, int beta); + void (*h264_v_loop_filter_chroma)(uint8_t *pix /*align 8*/, ptrdiff_t stride, + int alpha, int beta, int8_t *tc0); + void (*h264_h_loop_filter_chroma)(uint8_t *pix /*align 4*/, ptrdiff_t stride, + int alpha, int beta, int8_t *tc0); + void (*h264_h_loop_filter_chroma_mbaff)(uint8_t *pix /*align 8*/, + ptrdiff_t stride, int alpha, int beta, + int8_t *tc0); + void (*h264_v_loop_filter_chroma_intra)(uint8_t *pix /*align 8*/, + ptrdiff_t stride, int alpha, int beta); + void (*h264_h_loop_filter_chroma_intra)(uint8_t *pix /*align 8*/, + ptrdiff_t stride, int alpha, int beta); + void (*h264_h_loop_filter_chroma_mbaff_intra)(uint8_t *pix /*align 8*/, + ptrdiff_t stride, int alpha, int beta); + // h264_loop_filter_strength: simd only. the C version is inlined in h264_loopfilter.c + void (*h264_loop_filter_strength)(int16_t bS[2][4][4], uint8_t nnz[40], + int8_t ref[2][40], int16_t mv[2][40][2], + int bidir, int edges, int step, + int mask_mv0, int mask_mv1, int field); + + /* IDCT */ + void (*h264_idct_add)(uint8_t *dst /*align 4*/, + int16_t *block /*align 16*/, int stride); + void (*h264_idct8_add)(uint8_t *dst /*align 8*/, + int16_t *block /*align 16*/, int stride); + void (*h264_idct_dc_add)(uint8_t *dst /*align 4*/, + int16_t *block /*align 16*/, int stride); + void (*h264_idct8_dc_add)(uint8_t *dst /*align 8*/, + int16_t *block /*align 16*/, int stride); + + void (*h264_idct_add16)(uint8_t *dst /*align 16*/, const int *blockoffset, + int16_t *block /*align 16*/, int stride, + const uint8_t nnzc[5 * 8]); + void (*h264_idct8_add4)(uint8_t *dst /*align 16*/, const int *blockoffset, + int16_t *block /*align 16*/, int stride, + const uint8_t nnzc[5 * 8]); + void (*h264_idct_add8)(uint8_t **dst /*align 16*/, const int *blockoffset, + int16_t *block /*align 16*/, int stride, + const uint8_t nnzc[15 * 8]); + void (*h264_idct_add16intra)(uint8_t *dst /*align 16*/, const int *blockoffset, + int16_t *block /*align 16*/, + int stride, const uint8_t nnzc[5 * 8]); + void (*h264_luma_dc_dequant_idct)(int16_t *output, + int16_t *input /*align 16*/, int qmul); + void (*h264_chroma_dc_dequant_idct)(int16_t *block, int qmul); + + /* bypass-transform */ + void (*h264_add_pixels8_clear)(uint8_t *dst, int16_t *block, int stride); + void (*h264_add_pixels4_clear)(uint8_t *dst, int16_t *block, int stride); + + /** + * Search buf from the start for up to size bytes. Return the index + * of a zero byte, or >= size if not found. Ideally, use lookahead + * to filter out any zero bytes that are known to not be followed by + * one or more further zero bytes and a one byte. Better still, filter + * out any bytes that form the trailing_zero_8bits syntax element too. + */ + int (*startcode_find_candidate)(const uint8_t *buf, int size); +} H264DSPContext; + +void ff_h264dsp_init(H264DSPContext *c, const int bit_depth, + const int chroma_format_idc); +void ff_h264dsp_init_aarch64(H264DSPContext *c, const int bit_depth, + const int chroma_format_idc); +void ff_h264dsp_init_arm(H264DSPContext *c, const int bit_depth, + const int chroma_format_idc); +void ff_h264dsp_init_ppc(H264DSPContext *c, const int bit_depth, + const int chroma_format_idc); +void ff_h264dsp_init_riscv(H264DSPContext *c, const int bit_depth, + const int chroma_format_idc); +void ff_h264dsp_init_x86(H264DSPContext *c, const int bit_depth, + const int chroma_format_idc); +void ff_h264dsp_init_mips(H264DSPContext *c, const int bit_depth, + const int chroma_format_idc); +void ff_h264dsp_init_loongarch(H264DSPContext *c, const int bit_depth, + const int chroma_format_idc); + +#endif /* AVCODEC_H264DSP_H */ diff --git a/include/libavcodec/h264idct.h b/include/libavcodec/h264idct.h new file mode 100644 index 0000000..6f18df9 --- /dev/null +++ b/include/libavcodec/h264idct.h @@ -0,0 +1,44 @@ +/* + * 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_H264IDCT_H +#define AVCODEC_H264IDCT_H + +#include + +#define H264_IDCT(depth) \ +void ff_h264_idct8_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\ +void ff_h264_idct_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\ +void ff_h264_idct8_dc_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\ +void ff_h264_idct_dc_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\ +void ff_h264_idct_add16_ ## depth ## _c(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[5 * 8]);\ +void ff_h264_idct_add16intra_ ## depth ## _c(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[5 * 8]);\ +void ff_h264_idct8_add4_ ## depth ## _c(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[5 * 8]);\ +void ff_h264_idct_add8_422_ ## depth ## _c(uint8_t **dest, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[15 * 8]);\ +void ff_h264_idct_add8_ ## depth ## _c(uint8_t **dest, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[15 * 8]);\ +void ff_h264_luma_dc_dequant_idct_ ## depth ## _c(int16_t *output, int16_t *input, int qmul);\ +void ff_h264_chroma422_dc_dequant_idct_ ## depth ## _c(int16_t *block, int qmul);\ +void ff_h264_chroma_dc_dequant_idct_ ## depth ## _c(int16_t *block, int qmul); + +H264_IDCT( 8) +H264_IDCT( 9) +H264_IDCT(10) +H264_IDCT(12) +H264_IDCT(14) + +#endif /* AVCODEC_H264IDCT_H */ diff --git a/include/libavcodec/h264pred.h b/include/libavcodec/h264pred.h new file mode 100644 index 0000000..cb00854 --- /dev/null +++ b/include/libavcodec/h264pred.h @@ -0,0 +1,130 @@ +/* + * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder + * Copyright (c) 2003 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * H.264 / AVC / MPEG-4 prediction functions. + * @author Michael Niedermayer + */ + +#ifndef AVCODEC_H264PRED_H +#define AVCODEC_H264PRED_H + +#include +#include + +/** + * Prediction types + */ +//@{ +#define VERT_PRED 0 +#define HOR_PRED 1 +#define DC_PRED 2 +#define DIAG_DOWN_LEFT_PRED 3 +#define DIAG_DOWN_RIGHT_PRED 4 +#define VERT_RIGHT_PRED 5 +#define HOR_DOWN_PRED 6 +#define VERT_LEFT_PRED 7 +#define HOR_UP_PRED 8 + +// DC edge (not for VP8) +#define LEFT_DC_PRED 9 +#define TOP_DC_PRED 10 +#define DC_128_PRED 11 + +// RV40 specific +#define DIAG_DOWN_LEFT_PRED_RV40_NODOWN 12 +#define HOR_UP_PRED_RV40_NODOWN 13 +#define VERT_LEFT_PRED_RV40_NODOWN 14 + +// VP8 specific +#define TM_VP8_PRED 9 ///< "True Motion", used instead of plane +#define VERT_VP8_PRED 10 ///< for VP8, #VERT_PRED is the average of + ///< (left col+cur col x2+right col) / 4; + ///< this is the "unaveraged" one +#define HOR_VP8_PRED 14 ///< unaveraged version of #HOR_PRED, see + ///< #VERT_VP8_PRED for details +#define DC_127_PRED 12 +#define DC_129_PRED 13 + +#define DC_PRED8x8 0 +#define HOR_PRED8x8 1 +#define VERT_PRED8x8 2 +#define PLANE_PRED8x8 3 + +// DC edge +#define LEFT_DC_PRED8x8 4 +#define TOP_DC_PRED8x8 5 +#define DC_128_PRED8x8 6 + +// H.264/SVQ3 (8x8) specific +#define ALZHEIMER_DC_L0T_PRED8x8 7 +#define ALZHEIMER_DC_0LT_PRED8x8 8 +#define ALZHEIMER_DC_L00_PRED8x8 9 +#define ALZHEIMER_DC_0L0_PRED8x8 10 + +// VP8 specific +#define DC_127_PRED8x8 7 +#define DC_129_PRED8x8 8 +//@} + +#define PART_NOT_AVAILABLE -2 + +/** + * Context for storing H.264 prediction functions + */ +typedef struct H264PredContext { + void(*pred4x4[9 + 3 + 3])(uint8_t *src, const uint8_t *topright, + ptrdiff_t stride); + void(*pred8x8l[9 + 3])(uint8_t *src, int topleft, int topright, + ptrdiff_t stride); + void(*pred8x8[4 + 3 + 4])(uint8_t *src, ptrdiff_t stride); + void(*pred16x16[4 + 3 + 2])(uint8_t *src, ptrdiff_t stride); + + void(*pred4x4_add[2])(uint8_t *pix /*align 4*/, + int16_t *block /*align 16*/, ptrdiff_t stride); + void(*pred8x8l_add[2])(uint8_t *pix /*align 8*/, + int16_t *block /*align 16*/, ptrdiff_t stride); + void(*pred8x8l_filter_add[2])(uint8_t *pix /*align 8*/, + int16_t *block /*align 16*/, int topleft, int topright, ptrdiff_t stride); + void(*pred8x8_add[3])(uint8_t *pix /*align 8*/, + const int *block_offset, + int16_t *block /*align 16*/, ptrdiff_t stride); + void(*pred16x16_add[3])(uint8_t *pix /*align 16*/, + const int *block_offset, + int16_t *block /*align 16*/, ptrdiff_t stride); +} H264PredContext; + +void ff_h264_pred_init(H264PredContext *h, int codec_id, + const int bit_depth, const int chroma_format_idc); +void ff_h264_pred_init_aarch64(H264PredContext *h, int codec_id, + const int bit_depth, + const int chroma_format_idc); +void ff_h264_pred_init_arm(H264PredContext *h, int codec_id, + const int bit_depth, const int chroma_format_idc); +void ff_h264_pred_init_x86(H264PredContext *h, int codec_id, + const int bit_depth, const int chroma_format_idc); +void ff_h264_pred_init_mips(H264PredContext *h, int codec_id, + const int bit_depth, const int chroma_format_idc); +void ff_h264_pred_init_loongarch(H264PredContext *h, int codec_id, + const int bit_depth, const int chroma_format_idc); + +#endif /* AVCODEC_H264PRED_H */ diff --git a/include/libavcodec/h264qpel.h b/include/libavcodec/h264qpel.h new file mode 100644 index 0000000..0259e8d --- /dev/null +++ b/include/libavcodec/h264qpel.h @@ -0,0 +1,41 @@ +/* + * H.26L/H.264/AVC/JVT/14496-10/... encoder/decoder + * Copyright (c) 2003-2010 Michael Niedermayer + * + * 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_H264QPEL_H +#define AVCODEC_H264QPEL_H + +#include "qpeldsp.h" + +typedef struct H264QpelContext { + qpel_mc_func put_h264_qpel_pixels_tab[4][16]; + qpel_mc_func avg_h264_qpel_pixels_tab[4][16]; +} H264QpelContext; + +void ff_h264qpel_init(H264QpelContext *c, int bit_depth); + +void ff_h264qpel_init_aarch64(H264QpelContext *c, int bit_depth); +void ff_h264qpel_init_arm(H264QpelContext *c, int bit_depth); +void ff_h264qpel_init_ppc(H264QpelContext *c, int bit_depth); +void ff_h264qpel_init_x86(H264QpelContext *c, int bit_depth); +void ff_h264qpel_init_mips(H264QpelContext *c, int bit_depth); +void ff_h264qpel_init_loongarch(H264QpelContext *c, int bit_depth); + +#endif /* AVCODEC_H264QPEL_H */ diff --git a/include/libavcodec/h265_profile_level.h b/include/libavcodec/h265_profile_level.h new file mode 100644 index 0000000..cd30ac5 --- /dev/null +++ b/include/libavcodec/h265_profile_level.h @@ -0,0 +1,88 @@ +/* + * 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_H265_PROFILE_LEVEL_H +#define AVCODEC_H265_PROFILE_LEVEL_H + +#include + +#include "cbs_h265.h" + + +typedef struct H265LevelDescriptor { + char name[4]; // Large enough for all current levels like "4.1" + uint8_t level_idc; + + // Table A.6. + uint32_t max_luma_ps; + uint32_t max_cpb_main; + uint32_t max_cpb_high; + uint16_t max_slice_segments_per_picture; + uint8_t max_tile_rows; + uint8_t max_tile_cols; + + // Table A.7. + uint32_t max_luma_sr; + uint32_t max_br_main; + uint32_t max_br_high; + uint8_t min_cr_base_main; + uint8_t min_cr_base_high; +} H265LevelDescriptor; + +typedef struct H265ProfileDescriptor { + const char *name; + uint8_t profile_idc; + uint8_t high_throughput; + + // Tables A.2, A.3 and A.5. + uint8_t max_14bit; + uint8_t max_12bit; + uint8_t max_10bit; + uint8_t max_8bit; + uint8_t max_422chroma; + uint8_t max_420chroma; + uint8_t max_monochrome; + uint8_t intra; + uint8_t one_picture_only; + uint8_t lower_bit_rate; + + // Table A.8. + uint16_t cpb_vcl_factor; + uint16_t cpb_nal_factor; + float format_capability_factor; + float min_cr_scale_factor; + uint8_t max_dpb_pic_buf; +} H265ProfileDescriptor; + + +const H265ProfileDescriptor *ff_h265_get_profile(const H265RawProfileTierLevel *ptl); + + +/** + * Guess the level of a stream from some parameters. + * + * Unknown parameters may be zero, in which case they are ignored. + */ +const H265LevelDescriptor *ff_h265_guess_level(const H265RawProfileTierLevel *ptl, + int64_t bitrate, + int width, int height, + int slice_segments, + int tile_rows, int tile_cols, + int max_dec_pic_buffering); + +#endif /* AVCODEC_H265_PROFILE_LEVEL_H */ diff --git a/include/libavcodec/h274.h b/include/libavcodec/h274.h new file mode 100644 index 0000000..cebc8be --- /dev/null +++ b/include/libavcodec/h274.h @@ -0,0 +1,67 @@ +/* + * H.274 film grain synthesis + * Copyright (c) 2021 Niklas Haas + * + * 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 + */ + +/** + * @file + * H.274 film grain synthesis. + * @author Niklas Haas + */ + +#ifndef AVCODEC_H274_H +#define AVCODEC_H274_H + +#include "libavutil/film_grain_params.h" + +// Must be initialized to {0} prior to first usage +typedef struct H274FilmGrainDatabase { + // Database of film grain patterns, lazily computed as-needed + int8_t db[13 /* h */][13 /* v */][64][64]; + uint16_t residency[13 /* h */]; // bit field of v + + // Temporary buffer for slice generation + int16_t slice_tmp[64][64]; +} H274FilmGrainDatabase; + +/** + * Check whether ff_h274_apply_film_grain() supports the given parameter combination. + * + * @param model_id model_id from AVFilmGrainParams to be supplied + * @param pix_fmt pixel format of the frames to be supplied + */ +static inline int ff_h274_film_grain_params_supported(int model_id, enum AVPixelFormat pix_fmt) +{ + return model_id == 0 && pix_fmt == AV_PIX_FMT_YUV420P; +} + +// Synthesizes film grain on top of `in` and stores the result to `out`. `out` +// must already have been allocated and set to the same size and format as +// `in`. +// +// Returns a negative error code on error, such as invalid params. +// If ff_h274_film_grain_params_supported() indicated that the parameters +// are supported, no error will be returned if the arguments given to +// ff_h274_film_grain_params_supported() coincide with actual values +// from the frames and params. +int ff_h274_apply_film_grain(AVFrame *out, const AVFrame *in, + H274FilmGrainDatabase *db, + const AVFilmGrainParams *params); + +#endif /* AVCODEC_H274_H */ diff --git a/include/libavcodec/hap.h b/include/libavcodec/hap.h new file mode 100644 index 0000000..1de6d45 --- /dev/null +++ b/include/libavcodec/hap.h @@ -0,0 +1,103 @@ +/* + * Vidvox Hap + * Copyright (C) 2015 Vittorio Giovara + * Copyright (C) 2015 Tom Butterworth + * + * 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_HAP_H +#define AVCODEC_HAP_H + +#include +#include + +#include "bytestream.h" +#include "texturedsp.h" + +enum HapTextureFormat { + HAP_FMT_RGBDXT1 = 0x0B, + HAP_FMT_RGBADXT5 = 0x0E, + HAP_FMT_YCOCGDXT5 = 0x0F, + HAP_FMT_RGTC1 = 0x01, +}; + +enum HapCompressor { + HAP_COMP_NONE = 0xA0, + HAP_COMP_SNAPPY = 0xB0, + HAP_COMP_COMPLEX = 0xC0, +}; + +enum HapSectionType { + HAP_ST_DECODE_INSTRUCTIONS = 0x01, + HAP_ST_COMPRESSOR_TABLE = 0x02, + HAP_ST_SIZE_TABLE = 0x03, + HAP_ST_OFFSET_TABLE = 0x04, +}; + +typedef struct HapChunk { + enum HapCompressor compressor; + uint32_t compressed_offset; + size_t compressed_size; + int uncompressed_offset; + size_t uncompressed_size; +} HapChunk; + +typedef struct HapContext { + const struct AVClass *class; + + GetByteContext gbc; + + enum HapTextureFormat opt_tex_fmt; /* Texture type (encoder only) */ + int opt_chunk_count; /* User-requested chunk count (encoder only) */ + int opt_compressor; /* User-requested compressor (encoder only) */ + + int chunk_count; + HapChunk *chunks; + int *chunk_results; /* Results from threaded operations */ + + uint8_t *tex_buf; /* Buffer for compressed texture */ + size_t tex_size; /* Size of the compressed texture */ + + size_t max_snappy; /* Maximum compressed size for snappy buffer */ + + int texture_count; /* 2 for HAQA, 1 for other version */ + int texture_section_size; /* size of the part of the texture section (for HAPQA) */ + + TextureDSPThreadContext enc; + TextureDSPThreadContext dec[2]; +} HapContext; + +/* + * Set the number of chunks in the frame. Returns 0 on success or an error if: + * - first_in_frame is 0 and the number of chunks has changed + * - any other error occurs + */ +int ff_hap_set_chunk_count(HapContext *ctx, int count, int first_in_frame); + +/* + * Free resources associated with the context + */ +av_cold void ff_hap_free_context(HapContext *ctx); + +/* The first three bytes are the size of the section past the header, or zero + * if the length is stored in the next long word. The fourth byte in the first + * long word indicates the type of the current section. */ +int ff_hap_parse_section_header(GetByteContext *gbc, int *section_size, + enum HapSectionType *section_type); + +#endif /* AVCODEC_HAP_H */ diff --git a/include/libavcodec/hca_data.h b/include/libavcodec/hca_data.h new file mode 100644 index 0000000..7093221 --- /dev/null +++ b/include/libavcodec/hca_data.h @@ -0,0 +1,176 @@ +/* + * 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_HCA_DATA_H +#define AVCODEC_HCA_DATA_H + +#include + +static const uint8_t max_bits_table[] = { + 0, 2, 3, 3, 4, 4, 4, 4, 5, 6, 7, 8, 9, 10, 11, 12, +}; + +static const uint8_t quant_spectrum_bits[] = +{ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 1,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0, + 2,2,2,2,2,2,3,3,0,0,0,0,0,0,0,0, + 2,2,3,3,3,3,3,3,0,0,0,0,0,0,0,0, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4, + 3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4, + 3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4, + 3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4, +}; + +static const int8_t quant_spectrum_value[] = +{ + +0,+0,+0,+0,+0,+0,+0,+0,+0,+0,+0,+0,+0,+0,+0,+0, + +0,+0,+1,-1,+0,+0,+0,+0,+0,+0,+0,+0,+0,+0,+0,+0, + +0,+0,+1,+1,-1,-1,+2,-2,+0,+0,+0,+0,+0,+0,+0,+0, + +0,+0,+1,-1,+2,-2,+3,-3,+0,+0,+0,+0,+0,+0,+0,+0, + +0,+0,+1,+1,-1,-1,+2,+2,-2,-2,+3,+3,-3,-3,+4,-4, + +0,+0,+1,+1,-1,-1,+2,+2,-2,-2,+3,-3,+4,-4,+5,-5, + +0,+0,+1,+1,-1,-1,+2,-2,+3,-3,+4,-4,+5,-5,+6,-6, + +0,+0,+1,-1,+2,-2,+3,-3,+4,-4,+5,-5,+6,-6,+7,-7, +}; + +static const uint8_t scale_table[] = +{ + 15, 14, 14, 14, 14, 14, 14, 13, 13, + 13, 13, 13, 13, 12, 12, 12, 12, + 12, 12, 11, 11, 11, 11, 11, 11, + 10, 10, 10, 10, 10, 10, 10, 9, + 9, 9, 9, 9, 9, 8, 8, 8, + 8, 8, 8, 7, 6, 6, 5, 4, + 4, 4, 3, 3, 3, 2, 2, 2, + 2, 1, +}; + +static const float window[128] = +{ + 0.000690534, 0.00197623, 0.00367386, 0.00572424, 0.0080967, 0.0107732, 0.0137425, 0.0169979, + 0.0205353, 0.0243529, 0.0284505, 0.0328291, 0.0374906, 0.0424379, 0.0476744, 0.0532043, + 0.0590321, 0.0651629, 0.071602, 0.0783552, 0.0854285, 0.092828, 0.10056, 0.108631, + 0.117048, 0.125817, 0.134944, 0.144437, 0.1543, 0.164539, 0.175161, 0.186169, + 0.197569, 0.209363, 0.221555, 0.234145, 0.247136, 0.260526, 0.274313, 0.288493, + 0.303062, 0.318012, 0.333333, 0.349015, 0.365044, 0.381403, 0.398073, 0.415034, + 0.43226, 0.449725, 0.4674, 0.485251, 0.503245, 0.521344, 0.539509, 0.557698, + 0.575869, 0.593978, 0.611981, 0.629831, 0.647486, 0.6649, 0.682031, 0.698838, + 0.71528, 0.731323, 0.746932, 0.762077, 0.776732, 0.790873, 0.804481, 0.817542, + 0.830044, 0.84198, 0.853347, 0.864144, 0.874375, 0.884046, 0.893167, 0.901749, + 0.909806, 0.917354, 0.924409, 0.93099, 0.937117, 0.942809, 0.948087, 0.952971, + 0.957482, 0.961641, 0.965467, 0.968981, 0.972202, 0.975148, 0.977838, 0.980289, + 0.982518, 0.98454, 0.986371, 0.988024, 0.989514, 0.990853, 0.992053, 0.993126, + 0.994082, 0.994931, 0.995682, 0.996344, 0.996926, 0.997433, 0.997875, 0.998256, + 0.998584, 0.998863, 0.999099, 0.999297, 0.999461, 0.999595, 0.999703, 0.999789, + 0.999856, 0.999906, 0.999942, 0.999967, 0.999984, 0.999993, 0.999998, 1.0, +}; + +static const float intensity_ratio_table[] = +{ + 2.0, 1.85714, 1.71429, 1.57143, 1.42857, 1.28571, 1.14286, 1.0, + 0.857143, 0.714286, 0.571429, 0.428571, 0.285714, 0.142857, 0.0, 0.0, +}; + +static const float scale_conversion_table[] = +{ + 0, 0, 1.87066e-08, 2.49253e-08, 3.32113e-08, 4.42518e-08, 5.89626e-08, 7.85637e-08, 1.04681e-07, + 1.3948e-07, 1.85848e-07, 2.4763e-07, 3.2995e-07, 4.39636e-07, 5.85785e-07, 7.80519e-07, 1.03999e-06, + 1.38572e-06, 1.84637e-06, 2.46017e-06, 3.27801e-06, 4.36772e-06, 5.8197e-06, 7.75435e-06, 1.03321e-05, + 1.37669e-05, 1.83435e-05, 2.44414e-05, 3.25665e-05, 4.33927e-05, 5.78179e-05, 7.70384e-05, 0.000102648, + 0.000136772, 0.00018224, 0.000242822, 0.000323544, 0.000431101, 0.000574413, 0.000765366, 0.0010198, + 0.00135881, 0.00181053, 0.0024124, 0.00321437, 0.00428293, 0.00570671, 0.00760381, 0.0101316, + 0.0134996, 0.0179873, 0.0239669, 0.0319343, 0.0425503, 0.0566954, 0.0755428, 0.100656, + 0.134117, 0.178702, 0.238108, 0.317263, 0.422731, 0.563261, 0.750507, + 1.0, 1.33243, 1.77538, 2.36557, 3.15196, 4.19978, 5.59592, 7.45618, + 9.93486, 13.2375, 17.6381, 23.5016, 31.3143, 41.7242, 55.5947, 74.0762, + 98.7015, 131.513, 175.232, 233.485, 311.103, 414.524, 552.326, 735.937, + 980.586, 1306.56, 1740.91, 2319.64, 3090.77, 4118.24, 5487.28, 7311.43, + 9741.98, 12980.5, 17295.7, 23045.3, 30706.4, 40914.2, 54515.4, 72638, + 96785.3, 128960, 171830, 228952, 305064, 406477, 541603, 721649, + 961548, 1.2812e+06, 1.70711e+06, 2.27461e+06, 3.03076e+06, 4.03829e+06, 5.38075e+06, 7.16948e+06, + 9.55285e+06, 1.27285e+07, 1.69599e+07, 2.25979e+07, 3.01102e+07, 4.01198e+07, 5.3457e+07, 0, +}; + +static const int scale_conv_bias = 64; + +static const float dequantizer_scaling_table[] = +{ + 1.58838e-07, 2.11641e-07, 2.81998e-07, 3.75743e-07, 5.00652e-07, 6.67085e-07, 8.88846e-07, 1.18433e-06, + 1.57804e-06, 2.10263e-06, 2.80161e-06, 3.73296e-06, 4.97391e-06, 6.6274e-06, 8.83057e-06, 1.17661e-05, + 1.56776e-05, 2.08893e-05, 2.78336e-05, 3.70864e-05, 4.94151e-05, 6.58423e-05, 8.77305e-05, 0.000116895, + 0.000155755, 0.000207533, 0.000276523, 0.000368448, 0.000490933, 0.000654135, 0.00087159, 0.00116134, + 0.0015474, 0.00206181, 0.00274722, 0.00366048, 0.00487735, 0.00649874, 0.00865913, 0.0115377, + 0.0153732, 0.0204838, 0.0272932, 0.0363664, 0.0484558, 0.0645641, 0.0860272, 0.114626, + 0.152731, 0.203503, 0.271155, 0.361295, 0.481401, 0.641435, 0.854669, 1.13879, + 1.51736, 2.02178, 2.69388, 3.58942, 4.78266, 6.37257, 8.49102, 11.3137, +}; + +static const float quant_step_size[] = +{ + 0.0, 0.666667, 0.4, 0.285714, 0.222222, 0.181818, 0.153846, 0.133333, 0.0645161, + 0.031746, 0.015748, 0.00784314, 0.00391389, 0.00195503, 0.00097704, 0.000488401, +}; + +static const uint8_t ath_base_curve[656] = +{ + 0x78,0x5F,0x56,0x51,0x4E,0x4C,0x4B,0x49,0x48,0x48,0x47,0x46,0x46,0x45,0x45,0x45, + 0x44,0x44,0x44,0x44,0x43,0x43,0x43,0x43,0x43,0x43,0x42,0x42,0x42,0x42,0x42,0x42, + 0x42,0x42,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x40,0x40,0x40,0x40, + 0x40,0x40,0x40,0x40,0x40,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F, + 0x3F,0x3F,0x3F,0x3E,0x3E,0x3E,0x3E,0x3E,0x3E,0x3D,0x3D,0x3D,0x3D,0x3D,0x3D,0x3D, + 0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B, + 0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B, + 0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3B,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C,0x3C, + 0x3D,0x3D,0x3D,0x3D,0x3D,0x3D,0x3D,0x3D,0x3E,0x3E,0x3E,0x3E,0x3E,0x3E,0x3E,0x3F, + 0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F, + 0x3F,0x3F,0x3F,0x3F,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40, + 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x41,0x41,0x41,0x41,0x41,0x41,0x41, + 0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x41, + 0x41,0x41,0x41,0x41,0x41,0x41,0x41,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42, + 0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x42,0x43,0x43,0x43, + 0x43,0x43,0x43,0x43,0x43,0x43,0x43,0x43,0x43,0x43,0x43,0x43,0x43,0x43,0x44,0x44, + 0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x45,0x45,0x45,0x45, + 0x45,0x45,0x45,0x45,0x45,0x45,0x45,0x45,0x46,0x46,0x46,0x46,0x46,0x46,0x46,0x46, + 0x46,0x46,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x47,0x48,0x48,0x48,0x48, + 0x48,0x48,0x48,0x48,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x49,0x4A,0x4A,0x4A,0x4A, + 0x4A,0x4A,0x4A,0x4A,0x4B,0x4B,0x4B,0x4B,0x4B,0x4B,0x4B,0x4C,0x4C,0x4C,0x4C,0x4C, + 0x4C,0x4D,0x4D,0x4D,0x4D,0x4D,0x4D,0x4E,0x4E,0x4E,0x4E,0x4E,0x4E,0x4F,0x4F,0x4F, + 0x4F,0x4F,0x4F,0x50,0x50,0x50,0x50,0x50,0x51,0x51,0x51,0x51,0x51,0x52,0x52,0x52, + 0x52,0x52,0x53,0x53,0x53,0x53,0x54,0x54,0x54,0x54,0x54,0x55,0x55,0x55,0x55,0x56, + 0x56,0x56,0x56,0x57,0x57,0x57,0x57,0x57,0x58,0x58,0x58,0x59,0x59,0x59,0x59,0x5A, + 0x5A,0x5A,0x5A,0x5B,0x5B,0x5B,0x5B,0x5C,0x5C,0x5C,0x5D,0x5D,0x5D,0x5D,0x5E,0x5E, + 0x5E,0x5F,0x5F,0x5F,0x60,0x60,0x60,0x61,0x61,0x61,0x61,0x62,0x62,0x62,0x63,0x63, + 0x63,0x64,0x64,0x64,0x65,0x65,0x66,0x66,0x66,0x67,0x67,0x67,0x68,0x68,0x68,0x69, + 0x69,0x6A,0x6A,0x6A,0x6B,0x6B,0x6B,0x6C,0x6C,0x6D,0x6D,0x6D,0x6E,0x6E,0x6F,0x6F, + 0x70,0x70,0x70,0x71,0x71,0x72,0x72,0x73,0x73,0x73,0x74,0x74,0x75,0x75,0x76,0x76, + 0x77,0x77,0x78,0x78,0x78,0x79,0x79,0x7A,0x7A,0x7B,0x7B,0x7C,0x7C,0x7D,0x7D,0x7E, + 0x7E,0x7F,0x7F,0x80,0x80,0x81,0x81,0x82,0x83,0x83,0x84,0x84,0x85,0x85,0x86,0x86, + 0x87,0x88,0x88,0x89,0x89,0x8A,0x8A,0x8B,0x8C,0x8C,0x8D,0x8D,0x8E,0x8F,0x8F,0x90, + 0x90,0x91,0x92,0x92,0x93,0x94,0x94,0x95,0x95,0x96,0x97,0x97,0x98,0x99,0x99,0x9A, + 0x9B,0x9B,0x9C,0x9D,0x9D,0x9E,0x9F,0xA0,0xA0,0xA1,0xA2,0xA2,0xA3,0xA4,0xA5,0xA5, + 0xA6,0xA7,0xA7,0xA8,0xA9,0xAA,0xAA,0xAB,0xAC,0xAD,0xAE,0xAE,0xAF,0xB0,0xB1,0xB1, + 0xB2,0xB3,0xB4,0xB5,0xB6,0xB6,0xB7,0xB8,0xB9,0xBA,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF, + 0xC0,0xC1,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,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,0xED,0xEE, + 0xEF,0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF7,0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFF,0xFF, +}; + +#endif /* AVCODEC_HCA_DATA_H */ diff --git a/include/libavcodec/hpeldsp.h b/include/libavcodec/hpeldsp.h new file mode 100644 index 0000000..45e81b1 --- /dev/null +++ b/include/libavcodec/hpeldsp.h @@ -0,0 +1,107 @@ +/* + * Half-pel DSP functions. + * Copyright (c) 2000, 2001, 2002 Fabrice Bellard + * Copyright (c) 2002-2004 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * Half-pel DSP functions. + */ + +#ifndef AVCODEC_HPELDSP_H +#define AVCODEC_HPELDSP_H + +#include +#include + +/* add and put pixel (decoding) */ +// blocksizes for hpel_pixels_func are 8x4,8x8 16x8 16x16 +// h for hpel_pixels_func is limited to {width/2, width} but never larger +// than 16 and never smaller than 4 +typedef void (*op_pixels_func)(uint8_t *block /*align width (8 or 16)*/, + const uint8_t *pixels /*align 1*/, + ptrdiff_t line_size, int h); + +/** + * Half-pel DSP context. + */ +typedef struct HpelDSPContext { + /** + * Halfpel motion compensation with rounding (a+b+1)>>1. + * this is an array[4][4] of motion compensation functions for 4 + * horizontal blocksizes (8,16) and the 4 halfpel positions
+ * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ] + * @param block destination where the result is stored + * @param pixels source + * @param line_size number of bytes in a horizontal line of block + * @param h height + */ + op_pixels_func put_pixels_tab[4][4]; + + /** + * Halfpel motion compensation with rounding (a+b+1)>>1. + * This is an array[4][4] of motion compensation functions for 4 + * horizontal blocksizes (8,16) and the 4 halfpel positions
+ * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ] + * @param block destination into which the result is averaged (a+b+1)>>1 + * @param pixels source + * @param line_size number of bytes in a horizontal line of block + * @param h height + */ + op_pixels_func avg_pixels_tab[4][4]; + + /** + * Halfpel motion compensation with no rounding (a+b)>>1. + * this is an array[4][4] of motion compensation functions for 2 + * horizontal blocksizes (8,16) and the 4 halfpel positions
+ * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ] + * @param block destination where the result is stored + * @param pixels source + * @param line_size number of bytes in a horizontal line of block + * @param h height + * @note The size is kept at [4][4] to match the above pixel_tabs and avoid + * out of bounds reads in the motion estimation code. + */ + op_pixels_func put_no_rnd_pixels_tab[4][4]; + + /** + * Halfpel motion compensation with no rounding (a+b)>>1. + * this is an array[4] of motion compensation functions for 1 + * horizontal blocksize (16) and the 4 halfpel positions
+ * *pixels_tab[0][ xhalfpel + 2*yhalfpel ] + * @param block destination into which the result is averaged (a+b)>>1 + * @param pixels source + * @param line_size number of bytes in a horizontal line of block + * @param h height + */ + op_pixels_func avg_no_rnd_pixels_tab[4]; +} HpelDSPContext; + +void ff_hpeldsp_init(HpelDSPContext *c, int flags); + +void ff_hpeldsp_init_aarch64(HpelDSPContext *c, int flags); +void ff_hpeldsp_init_alpha(HpelDSPContext *c, int flags); +void ff_hpeldsp_init_arm(HpelDSPContext *c, int flags); +void ff_hpeldsp_init_ppc(HpelDSPContext *c, int flags); +void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags); +void ff_hpeldsp_init_mips(HpelDSPContext *c, int flags); +void ff_hpeldsp_init_loongarch(HpelDSPContext *c, int flags); + +#endif /* AVCODEC_HPELDSP_H */ diff --git a/include/libavcodec/hq_hqadata.h b/include/libavcodec/hq_hqadata.h new file mode 100644 index 0000000..2faf47f --- /dev/null +++ b/include/libavcodec/hq_hqadata.h @@ -0,0 +1,8382 @@ +/* + * Canopus HQ/HQA data + * + * 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_HQ_HQADATA_H +#define AVCODEC_HQ_HQADATA_H + +#include + +#define NUM_HQ_AC_ENTRIES 746 +#define NUM_HQ_PROFILES 22 +#define NUM_HQ_QUANTS 16 + +typedef struct HQProfile { + const uint8_t *perm_tab; + int width, height; + int num_slices; + int tab_w, tab_h; +} HQProfile; + +#define MAT_SIZE 64 + +static const uint8_t cbp_vlc_bits[16] = { + 0x04, 0x1C, 0x1D, 0x09, 0x1E, 0x0B, 0x1B, 0x08, + 0x1F, 0x1A, 0x0C, 0x07, 0x0A, 0x06, 0x05, 0x00, +}; + +static const uint8_t cbp_vlc_lens[16] = { + 4, 5, 5, 4, 5, 4, 5, 4, 5, 5, 4, 4, 4, 4, 4, 2, +}; + +static const int32_t qmat00[MAT_SIZE] = { + 0x0040000, 0x000B18B, 0x00058C5, 0x000B1B1, 0x00082D3, 0x000B1B1, + 0x000A953, 0x000827B, 0x00104F7, 0x000A953, 0x0009000, 0x000EADD, + 0x001037B, 0x000756E, 0x0009000, 0x000776D, 0x000696A, 0x000E987, + 0x000E987, 0x000D2D4, 0x000776D, 0x0016BAF, 0x0014B4C, 0x001A21A, + 0x001BA75, 0x001A21A, 0x000A5A6, 0x000B5D8, 0x000611E, 0x000811D, + 0x00150B6, 0x00181B0, 0x00181B0, 0x00150B6, 0x0020474, 0x0018477, + 0x0022710, 0x001FD1E, 0x001366C, 0x0015000, 0x001366C, 0x000FE8F, + 0x00044E2, 0x0008A6D, 0x000EA30, 0x0010E47, 0x0010E47, 0x001D460, + 0x00229B2, 0x001FCB2, 0x0019FA3, 0x000D94C, 0x000CFD2, 0x0007F2D, + 0x000DEED, 0x0014D5E, 0x0029ABD, 0x0037BB5, 0x002D16B, 0x001FECE, + 0x000B45B, 0x0011521, 0x0022A42, 0x0012B9C, +}; + +static const int32_t qmat01[MAT_SIZE] = { + 0x0040000, 0x000B18B, 0x00058C5, 0x000B1B1, 0x00082D3, 0x000B1B1, + 0x000EB2D, 0x000B53A, 0x0016A73, 0x000EB2D, 0x000D000, 0x0014632, + 0x0016314, 0x000A319, 0x000D000, 0x000A36D, 0x0009041, 0x0014BDA, + 0x0014BDA, 0x0012081, 0x000A36D, 0x0016BAF, 0x0014B4C, 0x001A21A, + 0x001BA75, 0x001A21A, 0x000A5A6, 0x000B5D8, 0x000611E, 0x000811D, + 0x00150B6, 0x00181B0, 0x00181B0, 0x00150B6, 0x0020474, 0x0018477, + 0x0045A60, 0x004058C, 0x0026CD9, 0x002A000, 0x0026CD9, 0x00202C6, + 0x0008B4C, 0x00114D9, 0x001D977, 0x0021C8F, 0x0021C8F, 0x003B2EF, + 0x0045365, 0x007FD2A, 0x00675E5, 0x0036A1F, 0x0033AF3, 0x001FF4B, + 0x001C010, 0x0029E24, 0x0053C47, 0x007003E, 0x005A9C7, 0x004024C, + 0x0016A72, 0x0022A42, 0x0045485, 0x0025738, +}; + +static const int32_t qmat02[MAT_SIZE] = { + 0x0040000, 0x0016315, 0x000B18B, 0x0016363, 0x00105A6, 0x0016363, + 0x00152A7, 0x00104F7, 0x00209EE, 0x00152A7, 0x0012000, 0x001D5B9, + 0x00206F6, 0x000EADD, 0x0012000, 0x000EEDA, 0x000D2D4, 0x001D30D, + 0x001D30D, 0x001A5A9, 0x000EEDA, 0x002D75E, 0x0029698, 0x0034433, + 0x00374EB, 0x0034433, 0x0014B4C, 0x0016BAF, 0x000C23C, 0x001023A, + 0x002A16C, 0x0030360, 0x0030360, 0x002A16C, 0x00408E9, 0x00308EF, + 0x0044E21, 0x003FA3C, 0x0026CD9, 0x002A000, 0x0026CD9, 0x001FD1E, + 0x00089C4, 0x00114D9, 0x001D460, 0x0021C8F, 0x0021C8F, 0x003A8C0, + 0x0045365, 0x003F964, 0x0033F47, 0x001B297, 0x0019FA3, 0x000FE59, + 0x001BDDA, 0x0029ABD, 0x0053579, 0x006F76A, 0x005A2D7, 0x003FD9D, + 0x00168B6, 0x0022A42, 0x0045485, 0x0025738, +}; + +static const int32_t qmat03[MAT_SIZE] = { + 0x0040000, 0x0016315, 0x000B18B, 0x0016363, 0x00105A6, 0x0016363, + 0x001D65A, 0x0016A73, 0x002D4E7, 0x001D65A, 0x001A000, 0x0028C65, + 0x002C628, 0x0014632, 0x001A000, 0x00146D9, 0x0012081, 0x00297B5, + 0x00297B5, 0x0024102, 0x00146D9, 0x002D75E, 0x0029698, 0x0034433, + 0x00374EB, 0x0034433, 0x0014B4C, 0x0016BAF, 0x000C23C, 0x001023A, + 0x002A16C, 0x0030360, 0x0030360, 0x002A16C, 0x00408E9, 0x00308EF, + 0x008B4C0, 0x0080B18, 0x004D9B2, 0x0054000, 0x004D9B2, 0x004058C, + 0x0011698, 0x00229B2, 0x003B2EF, 0x004391E, 0x004391E, 0x00765DD, + 0x008A6CA, 0x00FFA54, 0x00CEBCA, 0x006D43E, 0x00675E5, 0x003FE95, + 0x003801F, 0x0053C47, 0x00A788E, 0x00E007C, 0x00B538D, 0x0080498, + 0x002D4E3, 0x0045485, 0x008A90A, 0x004AE71, +}; + +static const int32_t qmat04[MAT_SIZE] = { + 0x0040000, 0x00214A0, 0x0010A50, 0x0021514, 0x0018879, 0x0021514, + 0x001FBFA, 0x0018772, 0x0030EE5, 0x001FBFA, 0x001B000, 0x002C096, + 0x0030A71, 0x001604B, 0x001B000, 0x0016647, 0x0013C3F, 0x002BC94, + 0x002BC94, 0x002787D, 0x0016647, 0x004430D, 0x003E1E4, 0x004E64D, + 0x0052F60, 0x004E64D, 0x001F0F2, 0x0022187, 0x001235A, 0x0018357, + 0x003F223, 0x0048510, 0x0048510, 0x003F223, 0x0060D5D, 0x0048D66, + 0x0067531, 0x005F75A, 0x003A345, 0x003F000, 0x003A345, 0x002FBAD, + 0x000CEA6, 0x0019F46, 0x002BE90, 0x0032AD6, 0x0032AD6, 0x0057D20, + 0x0067D17, 0x005F616, 0x004DEEA, 0x0028BE3, 0x0026F75, 0x0017D86, + 0x0029CC8, 0x003E81B, 0x007D036, 0x00A731F, 0x0087442, 0x005FC6B, + 0x0021D11, 0x0033F64, 0x0067EC7, 0x00382D5, +}; + +static const int32_t qmat05[MAT_SIZE] = { + 0x0040000, 0x00214A0, 0x0010A50, 0x0021514, 0x0018879, 0x0021514, + 0x002C186, 0x0021FAD, 0x0043F5A, 0x002C186, 0x0027000, 0x003D297, + 0x004293C, 0x001E94C, 0x0027000, 0x001EA46, 0x001B0C2, 0x003E38F, + 0x003E38F, 0x0036183, 0x001EA46, 0x004430D, 0x003E1E4, 0x004E64D, + 0x0052F60, 0x004E64D, 0x001F0F2, 0x0022187, 0x001235A, 0x0018357, + 0x003F223, 0x0048510, 0x0048510, 0x003F223, 0x0060D5D, 0x0048D66, + 0x00D0F1F, 0x00C10A4, 0x007468B, 0x007E000, 0x007468B, 0x0060852, + 0x001A1E4, 0x0033E8C, 0x0058C66, 0x00655AD, 0x00655AD, 0x00B18CC, + 0x00CFA2F, 0x017F77F, 0x01361B0, 0x00A3E5C, 0x009B0D8, 0x005FDE0, + 0x005402F, 0x007DA6B, 0x00FB4D5, 0x01500BA, 0x010FD54, 0x00C06E5, + 0x0043F55, 0x0067EC7, 0x00CFD8F, 0x00705A9, +}; + +static const int32_t qmat06[MAT_SIZE] = { + 0x0040000, 0x002C62A, 0x0016315, 0x002C6C5, 0x0020B4C, 0x002C6C5, + 0x002A54E, 0x00209EE, 0x00413DC, 0x002A54E, 0x0024000, 0x003AB73, + 0x0040DEC, 0x001D5B9, 0x0024000, 0x001DDB4, 0x001A5A9, 0x003A61B, + 0x003A61B, 0x0034B52, 0x001DDB4, 0x005AEBC, 0x0052D2F, 0x0068867, + 0x006E9D6, 0x0068867, 0x0029698, 0x002D75E, 0x0018477, 0x0020474, + 0x00542D9, 0x00606C0, 0x00606C0, 0x00542D9, 0x00811D1, 0x00611DE, + 0x0089C42, 0x007F478, 0x004D9B2, 0x0054000, 0x004D9B2, 0x003FA3C, + 0x0011388, 0x00229B2, 0x003A8C0, 0x004391E, 0x004391E, 0x0075180, + 0x008A6CA, 0x007F2C9, 0x0067E8E, 0x003652F, 0x0033F47, 0x001FCB2, + 0x0037BB5, 0x0053579, 0x00A6AF3, 0x00DEED4, 0x00B45AE, 0x007FB39, + 0x002D16B, 0x0045485, 0x008A90A, 0x004AE71, +}; + +static const int32_t qmat07[MAT_SIZE] = { + 0x0040000, 0x002C62A, 0x0016315, 0x002C6C5, 0x0020B4C, 0x002C6C5, + 0x003ACB3, 0x002D4E7, 0x005A9CE, 0x003ACB3, 0x0034000, 0x00518CA, + 0x0058C50, 0x0028C65, 0x0034000, 0x0028DB3, 0x0024102, 0x0052F69, + 0x0052F69, 0x0048204, 0x0028DB3, 0x005AEBC, 0x0052D2F, 0x0068867, + 0x006E9D6, 0x0068867, 0x0029698, 0x002D75E, 0x0018477, 0x0020474, + 0x00542D9, 0x00606C0, 0x00606C0, 0x00542D9, 0x00811D1, 0x00611DE, + 0x011697F, 0x0101631, 0x009B363, 0x00A8000, 0x009B363, 0x0080B18, + 0x0022D30, 0x0045365, 0x00765DD, 0x008723C, 0x008723C, 0x00ECBBB, + 0x0114D94, 0x01FF4A9, 0x019D795, 0x00DA87B, 0x00CEBCA, 0x007FD2A, + 0x007003E, 0x00A788E, 0x014F11C, 0x01C00F8, 0x016A71B, 0x0100931, + 0x005A9C7, 0x008A90A, 0x0115214, 0x0095CE2, +}; + +static const int32_t qmat08[MAT_SIZE] = { + 0x0040000, 0x00377B5, 0x001BBDA, 0x0037876, 0x0028E1E, 0x0037876, + 0x0034EA1, 0x0028C69, 0x00518D3, 0x0034EA1, 0x002D000, 0x004964F, + 0x0051167, 0x0024B28, 0x002D000, 0x0025521, 0x0020F13, 0x0048FA1, + 0x0048FA1, 0x0041E26, 0x0025521, 0x0071A6B, 0x006787B, 0x0082A80, + 0x008A44B, 0x0082A80, 0x0033C3E, 0x0038D36, 0x001E595, 0x0028591, + 0x006938F, 0x0078870, 0x0078870, 0x006938F, 0x00A1646, 0x0079655, + 0x00AC352, 0x009F196, 0x006101E, 0x0069000, 0x006101E, 0x004F8CB, + 0x001586A, 0x002B41F, 0x00492F0, 0x0054765, 0x0054765, 0x00925E0, + 0x00AD07C, 0x009EF7B, 0x0081E31, 0x0043E7A, 0x0040F19, 0x0027BDF, + 0x0045AA2, 0x00682D8, 0x00D05B0, 0x0116A89, 0x00E1719, 0x009FA07, + 0x00385C6, 0x00569A6, 0x00AD34C, 0x005DA0D, +}; + +static const int32_t qmat09[MAT_SIZE] = { + 0x0040000, 0x00377B5, 0x001BBDA, 0x0037876, 0x0028E1E, 0x0037876, + 0x00497E0, 0x0038A21, 0x0071441, 0x00497E0, 0x0041000, 0x0065EFC, + 0x006EF64, 0x0032F7E, 0x0041000, 0x003311F, 0x002D143, 0x0067B44, + 0x0067B44, 0x005A285, 0x003311F, 0x0071A6B, 0x006787B, 0x0082A80, + 0x008A44B, 0x0082A80, 0x0033C3E, 0x0038D36, 0x001E595, 0x0028591, + 0x006938F, 0x0078870, 0x0078870, 0x006938F, 0x00A1646, 0x0079655, + 0x015C3DF, 0x0141BBD, 0x00C203C, 0x00D2000, 0x00C203C, 0x00A0DDE, + 0x002B87C, 0x005683E, 0x0093F55, 0x00A8ECA, 0x00A8ECA, 0x0127EA9, + 0x015A0F9, 0x027F1D3, 0x0204D7A, 0x011129A, 0x01026BD, 0x009FC75, + 0x008C04E, 0x00D16B2, 0x01A2D64, 0x0230136, 0x01C50E1, 0x0140B7D, + 0x0071438, 0x00AD34C, 0x015A699, 0x00BB41A, +}; + +static const int32_t qmat0A[MAT_SIZE] = { + 0x0040000, 0x004293F, 0x00214A0, 0x0042A28, 0x00310F1, 0x0042A28, + 0x003F7F5, 0x0030EE5, 0x0061DCA, 0x003F7F5, 0x0036000, 0x005812C, + 0x00614E2, 0x002C096, 0x0036000, 0x002CC8E, 0x002787D, 0x0057928, + 0x0057928, 0x004F0FB, 0x002CC8E, 0x008861A, 0x007C3C7, 0x009CC9A, + 0x00A5EC1, 0x009CC9A, 0x003E1E4, 0x004430D, 0x00246B3, 0x00306AF, + 0x007E445, 0x0090A20, 0x0090A20, 0x007E445, 0x00C1ABA, 0x0091ACC, + 0x00CEA63, 0x00BEEB4, 0x007468B, 0x007E000, 0x007468B, 0x005F75A, + 0x0019D4C, 0x0033E8C, 0x0057D20, 0x00655AD, 0x00655AD, 0x00AFA40, + 0x00CFA2F, 0x00BEC2D, 0x009BDD5, 0x00517C6, 0x004DEEA, 0x002FB0B, + 0x005398F, 0x007D036, 0x00FA06C, 0x014E63E, 0x010E885, 0x00BF8D6, + 0x0043A21, 0x0067EC7, 0x00CFD8F, 0x00705A9, +}; + +static const int32_t qmat0B[MAT_SIZE] = { + 0x0040000, 0x004293F, 0x00214A0, 0x0042A28, 0x00310F1, 0x0042A28, + 0x005830D, 0x0043F5A, 0x0087EB5, 0x005830D, 0x004E000, 0x007A52F, + 0x0085278, 0x003D297, 0x004E000, 0x003D48C, 0x0036183, 0x007C71E, + 0x007C71E, 0x006C307, 0x003D48C, 0x008861A, 0x007C3C7, 0x009CC9A, + 0x00A5EC1, 0x009CC9A, 0x003E1E4, 0x004430D, 0x00246B3, 0x00306AF, + 0x007E445, 0x0090A20, 0x0090A20, 0x007E445, 0x00C1ABA, 0x0091ACC, + 0x01A1E3F, 0x0182149, 0x00E8D15, 0x00FC000, 0x00E8D15, 0x00C10A4, + 0x00343C8, 0x0067D17, 0x00B18CC, 0x00CAB59, 0x00CAB59, 0x0163198, + 0x019F45E, 0x02FEEFD, 0x026C35F, 0x0147CB9, 0x01361B0, 0x00BFBBF, + 0x00A805D, 0x00FB4D5, 0x01F69AB, 0x02A0174, 0x021FAA8, 0x0180DC9, + 0x0087EAA, 0x00CFD8F, 0x019FB1E, 0x00E0B52, +}; + +static const int32_t qmat0C[MAT_SIZE] = { + 0x0040000, 0x004DACA, 0x0026D65, 0x004DBD9, 0x00393C4, 0x004DBD9, + 0x004A148, 0x0039160, 0x00722C1, 0x004A148, 0x003F000, 0x0066C09, + 0x007185D, 0x0033604, 0x003F000, 0x00343FB, 0x002E1E8, 0x00662AF, + 0x00662AF, 0x005C3CF, 0x00343FB, 0x009F1C9, 0x0090F13, 0x00B6EB3, + 0x00C1936, 0x00B6EB3, 0x0048789, 0x004F8E5, 0x002A7D1, 0x00387CC, + 0x00934FB, 0x00A8BCF, 0x00A8BCF, 0x00934FB, 0x00E1F2E, 0x00A9F44, + 0x00F1173, 0x00DEBD1, 0x0087CF7, 0x0093000, 0x0087CF7, 0x006F5E9, + 0x001E22E, 0x003C8F8, 0x0066750, 0x00763F4, 0x00763F4, 0x00CCEA0, + 0x00F23E1, 0x00DE8DF, 0x00B5D78, 0x005F111, 0x005AEBC, 0x0037A38, + 0x006187D, 0x0091D95, 0x0123B29, 0x01861F3, 0x013B9F0, 0x00DF7A4, + 0x004EE7C, 0x00793E9, 0x00F27D1, 0x0083145, +}; + +static const int32_t qmat0D[MAT_SIZE] = { + 0x0040000, 0x004DACA, 0x0026D65, 0x004DBD9, 0x00393C4, 0x004DBD9, + 0x0066E3A, 0x004F494, 0x009E928, 0x0066E3A, 0x005B000, 0x008EB61, + 0x009B58C, 0x00475B1, 0x005B000, 0x00477F9, 0x003F1C4, 0x00912F8, + 0x00912F8, 0x007E388, 0x00477F9, 0x009F1C9, 0x0090F13, 0x00B6EB3, + 0x00C1936, 0x00B6EB3, 0x0048789, 0x004F8E5, 0x002A7D1, 0x00387CC, + 0x00934FB, 0x00A8BCF, 0x00A8BCF, 0x00934FB, 0x00E1F2E, 0x00A9F44, + 0x01E789E, 0x01C26D5, 0x010F9EE, 0x0126000, 0x010F9EE, 0x00E136B, + 0x003CF14, 0x00791F1, 0x00CF243, 0x00EC7E8, 0x00EC7E8, 0x019E487, + 0x01E47C3, 0x037EC27, 0x02D3944, 0x017E6D8, 0x0169CA2, 0x00DFB0A, + 0x00C406D, 0x01252F9, 0x024A5F2, 0x03101B2, 0x027A46F, 0x01C1016, + 0x009E91C, 0x00F27D1, 0x01E4FA3, 0x010628B, +}; + +static const int32_t qmat0E[MAT_SIZE] = { + 0x0040000, 0x0058C54, 0x002C62A, 0x0058D8A, 0x0041697, 0x0058D8A, + 0x0054A9C, 0x00413DC, 0x00827B8, 0x0054A9C, 0x0048000, 0x00756E5, + 0x0081BD8, 0x003AB73, 0x0048000, 0x003BB68, 0x0034B52, 0x0074C35, + 0x0074C35, 0x00696A4, 0x003BB68, 0x00B5D78, 0x00A5A5F, 0x00D10CD, + 0x00DD3AB, 0x00D10CD, 0x0052D2F, 0x005AEBC, 0x00308EF, 0x00408E9, + 0x00A85B1, 0x00C0D7F, 0x00C0D7F, 0x00A85B1, 0x01023A3, 0x00C23BB, + 0x0113883, 0x00FE8EF, 0x009B363, 0x00A8000, 0x009B363, 0x007F478, + 0x0022710, 0x0045365, 0x0075180, 0x008723C, 0x008723C, 0x00EA300, + 0x0114D94, 0x00FE591, 0x00CFD1C, 0x006CA5D, 0x0067E8E, 0x003F964, + 0x006F76A, 0x00A6AF3, 0x014D5E6, 0x01BDDA8, 0x0168B5C, 0x00FF672, + 0x005A2D7, 0x008A90A, 0x0115214, 0x0095CE2, +}; + +static const int32_t qmat0F[MAT_SIZE] = { + 0x0040000, 0x0058C54, 0x002C62A, 0x0058D8A, 0x0041697, 0x0058D8A, + 0x0075967, 0x005A9CE, 0x00B539C, 0x0075967, 0x0068000, 0x00A3194, + 0x00B18A0, 0x00518CA, 0x0068000, 0x0051B65, 0x0048204, 0x00A5ED3, + 0x00A5ED3, 0x0090409, 0x0051B65, 0x00B5D78, 0x00A5A5F, 0x00D10CD, + 0x00DD3AB, 0x00D10CD, 0x0052D2F, 0x005AEBC, 0x00308EF, 0x00408E9, + 0x00A85B1, 0x00C0D7F, 0x00C0D7F, 0x00A85B1, 0x01023A3, 0x00C23BB, + 0x022D2FE, 0x0202C61, 0x01366C7, 0x0150000, 0x01366C7, 0x0101631, + 0x0045A60, 0x008A6CA, 0x00ECBBB, 0x010E477, 0x010E477, 0x01D9776, + 0x0229B27, 0x03FE951, 0x033AF2A, 0x01B50F6, 0x019D795, 0x00FFA54, + 0x00E007C, 0x014F11C, 0x029E239, 0x03801F0, 0x02D4E36, 0x0201262, + 0x00B538D, 0x0115214, 0x022A428, 0x012B9C3, +}; + +static const int32_t qmat10[MAT_SIZE] = { + 0x0040000, 0x006EF69, 0x00377B5, 0x006F0ED, 0x0051C3D, 0x006F0ED, + 0x0069D43, 0x00518D3, 0x00A31A6, 0x0069D43, 0x005A000, 0x0092C9F, + 0x00A22CD, 0x004964F, 0x005A000, 0x004AA42, 0x0041E26, 0x0091F43, + 0x0091F43, 0x0083C4D, 0x004AA42, 0x00E34D6, 0x00CF0F6, 0x0105500, + 0x0114896, 0x0105500, 0x006787B, 0x0071A6B, 0x003CB2A, 0x0050B23, + 0x00D271E, 0x00F10DF, 0x00F10DF, 0x00D271E, 0x0142C8B, 0x00F2CAA, + 0x01586A4, 0x013E32B, 0x00C203C, 0x00D2000, 0x00C203C, 0x009F196, + 0x002B0D5, 0x005683E, 0x00925E0, 0x00A8ECA, 0x00A8ECA, 0x0124BC0, + 0x015A0F9, 0x013DEF5, 0x0103C63, 0x0087CF4, 0x0081E31, 0x004F7BD, + 0x008B544, 0x00D05B0, 0x01A0B5F, 0x022D511, 0x01C2E32, 0x013F40F, + 0x0070B8D, 0x00AD34C, 0x015A699, 0x00BB41A, +}; + +static const int32_t qmat11[MAT_SIZE] = { + 0x0040000, 0x006EF69, 0x00377B5, 0x006F0ED, 0x0051C3D, 0x006F0ED, + 0x0092FC0, 0x0071441, 0x00E2883, 0x0092FC0, 0x0082000, 0x00CBDF9, + 0x00DDEC8, 0x0065EFC, 0x0082000, 0x006623F, 0x005A285, 0x00CF687, + 0x00CF687, 0x00B450B, 0x006623F, 0x00E34D6, 0x00CF0F6, 0x0105500, + 0x0114896, 0x0105500, 0x006787B, 0x0071A6B, 0x003CB2A, 0x0050B23, + 0x00D271E, 0x00F10DF, 0x00F10DF, 0x00D271E, 0x0142C8B, 0x00F2CAA, + 0x02B87BE, 0x028377A, 0x0184078, 0x01A4000, 0x0184078, 0x0141BBD, + 0x00570F8, 0x00AD07C, 0x0127EA9, 0x0151D95, 0x0151D95, 0x024FD53, + 0x02B41F1, 0x04FE3A6, 0x0409AF4, 0x0222534, 0x0204D7A, 0x013F8E9, + 0x011809B, 0x01A2D64, 0x0345AC7, 0x046026C, 0x038A1C3, 0x02816FA, + 0x00E2871, 0x015A699, 0x02B4D32, 0x0176834, +}; + +static const int32_t qmat12[MAT_SIZE] = { + 0x0040000, 0x008527E, 0x004293F, 0x0085450, 0x00621E3, 0x0085450, + 0x007EFEA, 0x0061DCA, 0x00C3B94, 0x007EFEA, 0x006C000, 0x00B0258, + 0x00C29C3, 0x005812C, 0x006C000, 0x005991C, 0x004F0FB, 0x00AF250, + 0x00AF250, 0x009E1F6, 0x005991C, 0x0110C35, 0x00F878E, 0x0139934, + 0x014BD81, 0x0139934, 0x007C3C7, 0x008861A, 0x0048D66, 0x0060D5D, + 0x00FC88A, 0x012143F, 0x012143F, 0x00FC88A, 0x0183574, 0x0123599, + 0x019D4C5, 0x017DD67, 0x00E8D15, 0x00FC000, 0x00E8D15, 0x00BEEB4, + 0x0033A99, 0x0067D17, 0x00AFA40, 0x00CAB59, 0x00CAB59, 0x015F480, + 0x019F45E, 0x017D85A, 0x0137BAA, 0x00A2F8C, 0x009BDD5, 0x005F616, + 0x00A731F, 0x00FA06C, 0x01F40D9, 0x029CC7B, 0x021D109, 0x017F1AB, + 0x0087442, 0x00CFD8F, 0x019FB1E, 0x00E0B52, +}; + +static const int32_t qmat13[MAT_SIZE] = { + 0x0040000, 0x008527E, 0x004293F, 0x0085450, 0x00621E3, 0x0085450, + 0x00B061A, 0x0087EB5, 0x010FD69, 0x00B061A, 0x009C000, 0x00F4A5E, + 0x010A4F0, 0x007A52F, 0x009C000, 0x007A918, 0x006C307, 0x00F8E3C, + 0x00F8E3C, 0x00D860D, 0x007A918, 0x0110C35, 0x00F878E, 0x0139934, + 0x014BD81, 0x0139934, 0x007C3C7, 0x008861A, 0x0048D66, 0x0060D5D, + 0x00FC88A, 0x012143F, 0x012143F, 0x00FC88A, 0x0183574, 0x0123599, + 0x0343C7D, 0x0304292, 0x01D1A2A, 0x01F8000, 0x01D1A2A, 0x0182149, + 0x0068790, 0x00CFA2F, 0x0163198, 0x01956B3, 0x01956B3, 0x02C6330, + 0x033E8BB, 0x05FDDFA, 0x04D86BE, 0x028F971, 0x026C35F, 0x017F77F, + 0x01500BA, 0x01F69AB, 0x03ED355, 0x05402E9, 0x043F550, 0x0301B93, + 0x010FD54, 0x019FB1E, 0x033F63C, 0x01C16A5, +}; + +static const int32_t qmat14[MAT_SIZE] = { + 0x0040000, 0x009B593, 0x004DACA, 0x009B7B2, 0x0072789, 0x009B7B2, + 0x0094291, 0x00722C1, 0x00E4582, 0x0094291, 0x007E000, 0x00CD812, + 0x00E30B9, 0x0066C09, 0x007E000, 0x00687F5, 0x005C3CF, 0x00CC55D, + 0x00CC55D, 0x00B879F, 0x00687F5, 0x013E393, 0x0121E26, 0x016DD67, + 0x018326C, 0x016DD67, 0x0090F13, 0x009F1C9, 0x0054FA2, 0x0070F97, + 0x01269F7, 0x015179F, 0x015179F, 0x01269F7, 0x01C3E5D, 0x0153E87, + 0x01E22E6, 0x01BD7A3, 0x010F9EE, 0x0126000, 0x010F9EE, 0x00DEBD1, + 0x003C45D, 0x00791F1, 0x00CCEA0, 0x00EC7E8, 0x00EC7E8, 0x0199D41, + 0x01E47C3, 0x01BD1BE, 0x016BAF1, 0x00BE223, 0x00B5D78, 0x006F46F, + 0x00C30F9, 0x0123B29, 0x0247652, 0x030C3E5, 0x02773E0, 0x01BEF48, + 0x009DCF8, 0x00F27D1, 0x01E4FA3, 0x010628B, +}; + +static const int32_t qmat15[MAT_SIZE] = { + 0x0040000, 0x009B593, 0x004DACA, 0x009B7B2, 0x0072789, 0x009B7B2, + 0x00CDC74, 0x009E928, 0x013D250, 0x00CDC74, 0x00B6000, 0x011D6C3, + 0x0136B18, 0x008EB61, 0x00B6000, 0x008EFF2, 0x007E388, 0x01225F0, + 0x01225F0, 0x00FC70F, 0x008EFF2, 0x013E393, 0x0121E26, 0x016DD67, + 0x018326C, 0x016DD67, 0x0090F13, 0x009F1C9, 0x0054FA2, 0x0070F97, + 0x01269F7, 0x015179F, 0x015179F, 0x01269F7, 0x01C3E5D, 0x0153E87, + 0x03CF13D, 0x0384DAA, 0x021F3DC, 0x024C000, 0x021F3DC, 0x01C26D5, + 0x0079E28, 0x00F23E1, 0x019E487, 0x01D8FD0, 0x01D8FD0, 0x033C90E, + 0x03C8F85, 0x06FD84F, 0x05A7289, 0x02FCDAF, 0x02D3944, 0x01BF614, + 0x01880D9, 0x024A5F2, 0x0494BE4, 0x0620365, 0x04F48DE, 0x038202B, + 0x013D237, 0x01E4FA3, 0x03C9F46, 0x020C516, +}; + +static const int32_t qmat16[MAT_SIZE] = { + 0x0040000, 0x00B18A8, 0x0058C54, 0x00B1B15, 0x0082D2E, 0x00B1B15, + 0x00A9538, 0x00827B8, 0x0104F6F, 0x00A9538, 0x0090000, 0x00EADCB, + 0x01037AF, 0x00756E5, 0x0090000, 0x00776CF, 0x00696A4, 0x00E986B, + 0x00E986B, 0x00D2D48, 0x00776CF, 0x016BAF1, 0x014B4BD, 0x01A219A, + 0x01BA757, 0x01A219A, 0x00A5A5F, 0x00B5D78, 0x00611DE, 0x00811D1, + 0x0150B63, 0x0181AFF, 0x0181AFF, 0x0150B63, 0x0204745, 0x0184776, + 0x0227107, 0x01FD1DF, 0x01366C7, 0x0150000, 0x01366C7, 0x00FE8EF, + 0x0044E21, 0x008A6CA, 0x00EA300, 0x010E477, 0x010E477, 0x01D4601, + 0x0229B27, 0x01FCB22, 0x019FA38, 0x00D94BA, 0x00CFD1C, 0x007F2C9, + 0x00DEED4, 0x014D5E6, 0x029ABCC, 0x037BB4F, 0x02D16B7, 0x01FECE4, + 0x00B45AE, 0x0115214, 0x022A428, 0x012B9C3, +}; + +static const int32_t qmat17[MAT_SIZE] = { + 0x0040000, 0x00B18A8, 0x0058C54, 0x00B1B15, 0x0082D2E, 0x00B1B15, + 0x00EB2CD, 0x00B539C, 0x016A737, 0x00EB2CD, 0x00D0000, 0x0146328, + 0x0163140, 0x00A3194, 0x00D0000, 0x00A36CB, 0x0090409, 0x014BDA5, + 0x014BDA5, 0x0120812, 0x00A36CB, 0x016BAF1, 0x014B4BD, 0x01A219A, + 0x01BA757, 0x01A219A, 0x00A5A5F, 0x00B5D78, 0x00611DE, 0x00811D1, + 0x0150B63, 0x0181AFF, 0x0181AFF, 0x0150B63, 0x0204745, 0x0184776, + 0x045A5FD, 0x04058C2, 0x026CD8D, 0x02A0000, 0x026CD8D, 0x0202C61, + 0x008B4C0, 0x0114D94, 0x01D9776, 0x021C8EE, 0x021C8EE, 0x03B2EEB, + 0x045364F, 0x07FD2A3, 0x0675E53, 0x036A1ED, 0x033AF2A, 0x01FF4A9, + 0x01C00F8, 0x029E239, 0x053C472, 0x07003E1, 0x05A9C6B, 0x04024C4, + 0x016A71B, 0x022A428, 0x0454850, 0x0257386, +}; + +static const int32_t qmat18[MAT_SIZE] = { + 0x0040000, 0x00C7BBD, 0x0063DDF, 0x00C7E77, 0x00932D4, 0x00C7E77, + 0x00BE7DF, 0x0092CAF, 0x012595D, 0x00BE7DF, 0x00A2000, 0x0108384, + 0x0123EA5, 0x00841C2, 0x00A2000, 0x00865A9, 0x0076978, 0x0106B78, + 0x0106B78, 0x00ED2F1, 0x00865A9, 0x019924F, 0x0174B55, 0x01D65CD, + 0x01F1C42, 0x01D65CD, 0x00BA5AB, 0x00CC927, 0x006D419, 0x009140C, + 0x017ACCF, 0x01B1E5F, 0x01B1E5F, 0x017ACCF, 0x024502E, 0x01B5065, + 0x026BF28, 0x023CC1B, 0x015D3A0, 0x017A000, 0x015D3A0, 0x011E60D, + 0x004D7E5, 0x009BBA3, 0x0107760, 0x0130106, 0x0130106, 0x020EEC1, + 0x026EE8C, 0x023C486, 0x01D397F, 0x00F4751, 0x00E9CBF, 0x008F122, + 0x00FACAE, 0x01770A2, 0x02EE145, 0x03EB2B9, 0x032B98E, 0x023EA81, + 0x00CAE64, 0x0137C56, 0x026F8AD, 0x01510FC, +}; + +static const int32_t qmat19[MAT_SIZE] = { + 0x0040000, 0x00C7BBD, 0x0063DDF, 0x00C7E77, 0x00932D4, 0x00C7E77, + 0x0108927, 0x00CBE0F, 0x0197C1E, 0x0108927, 0x00EA000, 0x016EF8D, + 0x018F768, 0x00B77C6, 0x00EA000, 0x00B7DA4, 0x00A248A, 0x017555A, + 0x017555A, 0x0144914, 0x00B7DA4, 0x019924F, 0x0174B55, 0x01D65CD, + 0x01F1C42, 0x01D65CD, 0x00BA5AB, 0x00CC927, 0x006D419, 0x009140C, + 0x017ACCF, 0x01B1E5F, 0x01B1E5F, 0x017ACCF, 0x024502E, 0x01B5065, + 0x04E5ABC, 0x04863DB, 0x02BA73F, 0x02F4000, 0x02BA73F, 0x02431ED, + 0x009CB58, 0x0137746, 0x0214A64, 0x026020C, 0x026020C, 0x04294C8, + 0x04DDD19, 0x08FCCF7, 0x0744A1D, 0x03D762A, 0x03A250F, 0x023F33E, + 0x01F8117, 0x02F1E80, 0x05E3D00, 0x07E045D, 0x065EFF9, 0x048295C, + 0x0197BFE, 0x026F8AD, 0x04DF15A, 0x02A21F7, +}; + +static const int32_t qmat1A[MAT_SIZE] = { + 0x0040000, 0x00DDED2, 0x006EF69, 0x00DE1DA, 0x00A387A, 0x00DE1DA, + 0x00D3A86, 0x00A31A6, 0x014634B, 0x00D3A86, 0x00B4000, 0x012593E, + 0x014459B, 0x0092C9F, 0x00B4000, 0x0095483, 0x0083C4D, 0x0123E85, + 0x0123E85, 0x010789A, 0x0095483, 0x01C69AD, 0x019E1ED, 0x020AA01, + 0x022912D, 0x020AA01, 0x00CF0F6, 0x00E34D6, 0x0079655, 0x00A1646, + 0x01A4E3C, 0x01E21BE, 0x01E21BE, 0x01A4E3C, 0x0285917, 0x01E5954, + 0x02B0D48, 0x027C656, 0x0184078, 0x01A4000, 0x0184078, 0x013E32B, + 0x00561A9, 0x00AD07C, 0x0124BC0, 0x0151D95, 0x0151D95, 0x0249781, + 0x02B41F1, 0x027BDEB, 0x02078C6, 0x010F9E9, 0x0103C63, 0x009EF7B, + 0x0116A89, 0x01A0B5F, 0x03416BE, 0x045AA23, 0x0385C65, 0x027E81E, + 0x00E1719, 0x015A699, 0x02B4D32, 0x0176834, +}; + +static const int32_t qmat1B[MAT_SIZE] = { + 0x0040000, 0x00DDED2, 0x006EF69, 0x00DE1DA, 0x00A387A, 0x00DE1DA, + 0x0125F81, 0x00E2883, 0x01C5105, 0x0125F81, 0x0104000, 0x0197BF2, + 0x01BBD90, 0x00CBDF9, 0x0104000, 0x00CC47E, 0x00B450B, 0x019ED0E, + 0x019ED0E, 0x0168A16, 0x00CC47E, 0x01C69AD, 0x019E1ED, 0x020AA01, + 0x022912D, 0x020AA01, 0x00CF0F6, 0x00E34D6, 0x0079655, 0x00A1646, + 0x01A4E3C, 0x01E21BE, 0x01E21BE, 0x01A4E3C, 0x0285917, 0x01E5954, + 0x0570F7C, 0x0506EF3, 0x03080F1, 0x0348000, 0x03080F1, 0x028377A, + 0x00AE1EF, 0x015A0F9, 0x024FD53, 0x02A3B2A, 0x02A3B2A, 0x049FAA6, + 0x05683E3, 0x09FC74C, 0x08135E8, 0x0444A68, 0x0409AF4, 0x027F1D3, + 0x0230136, 0x0345AC7, 0x068B58E, 0x08C04D9, 0x0714386, 0x0502DF5, + 0x01C50E1, 0x02B4D32, 0x0569A64, 0x02ED068, +}; + +static const int32_t qmat1C[MAT_SIZE] = { + 0x0040000, 0x00F41E7, 0x007A0F4, 0x00F453D, 0x00B3E20, 0x00F453D, + 0x00E8D2D, 0x00B369D, 0x0166D39, 0x00E8D2D, 0x00C6000, 0x0142EF7, + 0x0164C91, 0x00A177B, 0x00C6000, 0x00A435D, 0x0090F21, 0x0141193, + 0x0141193, 0x0121E43, 0x00A435D, 0x01F410B, 0x01C7884, 0x023EE34, + 0x0260617, 0x023EE34, 0x00E3C42, 0x00FA086, 0x0085891, 0x00B1880, + 0x01CEFA8, 0x021251E, 0x021251E, 0x01CEFA8, 0x02C6200, 0x0216242, + 0x02F5B69, 0x02BC092, 0x01AAD51, 0x01CE000, 0x01AAD51, 0x015E049, + 0x005EB6D, 0x00BE556, 0x0142020, 0x0173A24, 0x0173A24, 0x0284041, + 0x02F9556, 0x02BB74F, 0x023B80D, 0x012AC80, 0x011DC06, 0x00AEDD4, + 0x0132863, 0x01CA61C, 0x0394C38, 0x04CA18D, 0x03DFF3C, 0x02BE5BA, + 0x00F7FCF, 0x017D0DB, 0x02FA1B7, 0x019BF6C, +}; + +static const int32_t qmat1D[MAT_SIZE] = { + 0x0040000, 0x00F41E7, 0x007A0F4, 0x00F453D, 0x00B3E20, 0x00F453D, + 0x01435DA, 0x00F92F6, 0x01F25EC, 0x01435DA, 0x011E000, 0x01C0857, + 0x01E83B8, 0x00E042B, 0x011E000, 0x00E0B57, 0x00C658C, 0x01C84C3, + 0x01C84C3, 0x018CB18, 0x00E0B57, 0x01F410B, 0x01C7884, 0x023EE34, + 0x0260617, 0x023EE34, 0x00E3C42, 0x00FA086, 0x0085891, 0x00B1880, + 0x01CEFA8, 0x021251E, 0x021251E, 0x01CEFA8, 0x02C6200, 0x0216242, + 0x05FC43B, 0x0587A0B, 0x0355AA3, 0x039C000, 0x0355AA3, 0x02C3D06, + 0x00BF887, 0x017CAAB, 0x028B042, 0x02E7447, 0x02E7447, 0x0516083, + 0x05F2AAD, 0x0AFC1A0, 0x08E21B2, 0x04B1EA5, 0x04710D9, 0x02BF068, + 0x0268155, 0x039970E, 0x0732E1D, 0x09A0555, 0x07C9713, 0x058328D, + 0x01F25C5, 0x02FA1B7, 0x05F436E, 0x0337ED9, +}; + +static const int32_t qmat1E[MAT_SIZE] = { + 0x0040000, 0x010A4FD, 0x008527E, 0x010A89F, 0x00C43C5, 0x010A89F, + 0x00FDFD3, 0x00C3B94, 0x0187727, 0x00FDFD3, 0x00D8000, 0x01604B0, + 0x0185387, 0x00B0258, 0x00D8000, 0x00B3237, 0x009E1F6, 0x015E4A0, + 0x015E4A0, 0x013C3EC, 0x00B3237, 0x0221869, 0x01F0F1C, 0x0273267, + 0x0297B02, 0x0273267, 0x00F878E, 0x0110C35, 0x0091ACC, 0x00C1ABA, + 0x01F9114, 0x024287E, 0x024287E, 0x01F9114, 0x0306AE8, 0x0246B31, + 0x033A98A, 0x02FBACE, 0x01D1A2A, 0x01F8000, 0x01D1A2A, 0x017DD67, + 0x0067531, 0x00CFA2F, 0x015F480, 0x01956B3, 0x01956B3, 0x02BE901, + 0x033E8BB, 0x02FB0B3, 0x026F754, 0x0145F17, 0x0137BAA, 0x00BEC2D, + 0x014E63E, 0x01F40D9, 0x03E81B1, 0x05398F7, 0x043A213, 0x02FE357, + 0x010E885, 0x019FB1E, 0x033F63C, 0x01C16A5, +}; + +static const int32_t qmat1F[MAT_SIZE] = { + 0x0040000, 0x010A4FD, 0x008527E, 0x010A89F, 0x00C43C5, 0x010A89F, + 0x0160C34, 0x010FD69, 0x021FAD3, 0x0160C34, 0x0138000, 0x01E94BC, + 0x02149E1, 0x00F4A5E, 0x0138000, 0x00F5230, 0x00D860D, 0x01F1C78, + 0x01F1C78, 0x01B0C1A, 0x00F5230, 0x0221869, 0x01F0F1C, 0x0273267, + 0x0297B02, 0x0273267, 0x00F878E, 0x0110C35, 0x0091ACC, 0x00C1ABA, + 0x01F9114, 0x024287E, 0x024287E, 0x01F9114, 0x0306AE8, 0x0246B31, + 0x06878FB, 0x0608524, 0x03A3454, 0x03F0000, 0x03A3454, 0x0304292, + 0x00D0F1F, 0x019F45E, 0x02C6330, 0x032AD65, 0x032AD65, 0x058C661, + 0x067D176, 0x0BFBBF4, 0x09B0D7D, 0x051F2E3, 0x04D86BE, 0x02FEEFD, + 0x02A0174, 0x03ED355, 0x07DA6AB, 0x0A805D1, 0x087EAA1, 0x0603726, + 0x021FAA8, 0x033F63C, 0x067EC78, 0x0382D4A, +}; + +static const int32_t qmat20[MAT_SIZE] = { + 0x0040000, 0x0136B27, 0x009B593, 0x0136F64, 0x00E4F11, 0x0136F64, + 0x0128521, 0x00E4582, 0x01C8B03, 0x0128521, 0x00FC000, 0x019B023, + 0x01C6172, 0x00CD812, 0x00FC000, 0x00D0FEB, 0x00B879F, 0x0198ABB, + 0x0198ABB, 0x0170F3E, 0x00D0FEB, 0x027C725, 0x0243C4B, 0x02DBACE, + 0x03064D8, 0x02DBACE, 0x0121E26, 0x013E393, 0x00A9F44, 0x00E1F2E, + 0x024D3ED, 0x02A2F3E, 0x02A2F3E, 0x024D3ED, 0x0387CBA, 0x02A7D0F, + 0x03C45CC, 0x037AF46, 0x021F3DC, 0x024C000, 0x021F3DC, 0x01BD7A3, + 0x00788B9, 0x00F23E1, 0x0199D41, 0x01D8FD0, 0x01D8FD0, 0x0333A81, + 0x03C8F85, 0x037A37C, 0x02D75E2, 0x017C446, 0x016BAF1, 0x00DE8DF, + 0x01861F3, 0x0247652, 0x048ECA4, 0x06187CA, 0x04EE7C1, 0x037DE90, + 0x013B9F0, 0x01E4FA3, 0x03C9F46, 0x020C516, +}; + +static const int32_t qmat21[MAT_SIZE] = { + 0x0040000, 0x0136B27, 0x009B593, 0x0136F64, 0x00E4F11, 0x0136F64, + 0x019B8E7, 0x013D250, 0x027A4A1, 0x019B8E7, 0x016C000, 0x023AD86, + 0x026D631, 0x011D6C3, 0x016C000, 0x011DFE3, 0x00FC70F, 0x0244BE1, + 0x0244BE1, 0x01F8E1F, 0x011DFE3, 0x027C725, 0x0243C4B, 0x02DBACE, + 0x03064D8, 0x02DBACE, 0x0121E26, 0x013E393, 0x00A9F44, 0x00E1F2E, + 0x024D3ED, 0x02A2F3E, 0x02A2F3E, 0x024D3ED, 0x0387CBA, 0x02A7D0F, + 0x079E27A, 0x0709B54, 0x043E7B8, 0x0498000, 0x043E7B8, 0x0384DAA, + 0x00F3C4F, 0x01E47C3, 0x033C90E, 0x03B1FA1, 0x03B1FA1, 0x067921B, + 0x0791F0A, 0x0DFB09D, 0x0B4E511, 0x05F9B5E, 0x05A7289, 0x037EC27, + 0x03101B2, 0x0494BE4, 0x09297C7, 0x0C406C9, 0x09E91BC, 0x0704057, + 0x027A46F, 0x03C9F46, 0x0793E8C, 0x0418A2B, +}; + +static const int32_t qmat22[MAT_SIZE] = { + 0x0040000, 0x0163151, 0x00B18A8, 0x0163629, 0x0105A5D, 0x0163629, + 0x0152A6F, 0x0104F6F, 0x0209EDF, 0x0152A6F, 0x0120000, 0x01D5B96, + 0x0206F5E, 0x00EADCB, 0x0120000, 0x00EED9F, 0x00D2D48, 0x01D30D5, + 0x01D30D5, 0x01A5A90, 0x00EED9F, 0x02D75E2, 0x029697B, 0x0344334, + 0x0374EAE, 0x0344334, 0x014B4BD, 0x016BAF1, 0x00C23BB, 0x01023A3, + 0x02A16C6, 0x03035FE, 0x03035FE, 0x02A16C6, 0x0408E8B, 0x0308EEC, + 0x044E20D, 0x03FA3BE, 0x026CD8D, 0x02A0000, 0x026CD8D, 0x01FD1DF, + 0x0089C42, 0x0114D94, 0x01D4601, 0x021C8EE, 0x021C8EE, 0x03A8C01, + 0x045364F, 0x03F9644, 0x033F46F, 0x01B2974, 0x019FA38, 0x00FE591, + 0x01BDDA8, 0x029ABCC, 0x0535797, 0x06F769E, 0x05A2D6E, 0x03FD9C9, + 0x0168B5C, 0x022A428, 0x0454850, 0x0257386, +}; + +static const int32_t qmat23[MAT_SIZE] = { + 0x0040000, 0x0163151, 0x00B18A8, 0x0163629, 0x0105A5D, 0x0163629, + 0x01D659B, 0x016A737, 0x02D4E6E, 0x01D659B, 0x01A0000, 0x028C650, + 0x02C6281, 0x0146328, 0x01A0000, 0x0146D96, 0x0120812, 0x0297B4A, + 0x0297B4A, 0x0241023, 0x0146D96, 0x02D75E2, 0x029697B, 0x0344334, + 0x0374EAE, 0x0344334, 0x014B4BD, 0x016BAF1, 0x00C23BB, 0x01023A3, + 0x02A16C6, 0x03035FE, 0x03035FE, 0x02A16C6, 0x0408E8B, 0x0308EEC, + 0x08B4BF9, 0x080B185, 0x04D9B1B, 0x0540000, 0x04D9B1B, 0x04058C2, + 0x011697F, 0x0229B27, 0x03B2EEB, 0x04391DC, 0x04391DC, 0x0765DD6, + 0x08A6C9E, 0x0FFA546, 0x0CEBCA6, 0x06D43D9, 0x0675E53, 0x03FE951, + 0x03801F0, 0x053C472, 0x0A788E4, 0x0E007C1, 0x0B538D6, 0x0804988, + 0x02D4E36, 0x0454850, 0x08A90A0, 0x04AE70D, +}; + +static const int32_t qmat24[MAT_SIZE] = { + 0x0040000, 0x018F77B, 0x00C7BBD, 0x018FCEF, 0x01265A8, 0x018FCEF, + 0x017CFBD, 0x012595D, 0x024B2BB, 0x017CFBD, 0x0144000, 0x0210708, + 0x0247D4A, 0x0108384, 0x0144000, 0x010CB53, 0x00ED2F1, 0x020D6F0, + 0x020D6F0, 0x01DA5E2, 0x010CB53, 0x033249E, 0x02E96AA, 0x03ACB9B, + 0x03E3883, 0x03ACB9B, 0x0174B55, 0x019924F, 0x00DA832, 0x0122817, + 0x02F599F, 0x0363CBD, 0x0363CBD, 0x02F599F, 0x048A05C, 0x036A0CA, + 0x04D7E4F, 0x0479835, 0x02BA73F, 0x02F4000, 0x02BA73F, 0x023CC1B, + 0x009AFCA, 0x0137746, 0x020EEC1, 0x026020C, 0x026020C, 0x041DD81, + 0x04DDD19, 0x047890D, 0x03A72FD, 0x01E8EA3, 0x01D397F, 0x011E243, + 0x01F595C, 0x02EE145, 0x05DC28A, 0x07D6572, 0x065731C, 0x047D502, + 0x0195CC7, 0x026F8AD, 0x04DF15A, 0x02A21F7, +}; + +static const int32_t qmat25[MAT_SIZE] = { + 0x0040000, 0x018F77B, 0x00C7BBD, 0x018FCEF, 0x01265A8, 0x018FCEF, + 0x021124E, 0x0197C1E, 0x032F83C, 0x021124E, 0x01D4000, 0x02DDF1A, + 0x031EED1, 0x016EF8D, 0x01D4000, 0x016FB49, 0x0144914, 0x02EAAB3, + 0x02EAAB3, 0x0289228, 0x016FB49, 0x033249E, 0x02E96AA, 0x03ACB9B, + 0x03E3883, 0x03ACB9B, 0x0174B55, 0x019924F, 0x00DA832, 0x0122817, + 0x02F599F, 0x0363CBD, 0x0363CBD, 0x02F599F, 0x048A05C, 0x036A0CA, + 0x09CB578, 0x090C7B6, 0x0574E7E, 0x05E8000, 0x0574E7E, 0x04863DB, + 0x01396AF, 0x026EE8C, 0x04294C8, 0x04C0418, 0x04C0418, 0x0852991, + 0x09BBA32, 0x11F99EF, 0x0E8943B, 0x07AEC54, 0x0744A1D, 0x047E67C, + 0x03F022E, 0x05E3D00, 0x0BC7A00, 0x0FC08BA, 0x0CBDFF1, 0x09052B9, + 0x032F7FC, 0x04DF15A, 0x09BE2B4, 0x05443EE, +}; + +static const int32_t qmat26[MAT_SIZE] = { + 0x0040000, 0x01BBDA5, 0x00DDED2, 0x01BC3B4, 0x01470F4, 0x01BC3B4, + 0x01A750B, 0x014634B, 0x028C697, 0x01A750B, 0x0168000, 0x024B27B, + 0x0288B36, 0x012593E, 0x0168000, 0x012A906, 0x010789A, 0x0247D0B, + 0x0247D0B, 0x020F134, 0x012A906, 0x038D35A, 0x033C3D9, 0x0415402, + 0x0452259, 0x0415402, 0x019E1ED, 0x01C69AD, 0x00F2CAA, 0x0142C8B, + 0x0349C77, 0x03C437D, 0x03C437D, 0x0349C77, 0x050B22E, 0x03CB2A7, + 0x0561A91, 0x04F8CAD, 0x03080F1, 0x0348000, 0x03080F1, 0x027C656, + 0x00AC352, 0x015A0F9, 0x0249781, 0x02A3B2A, 0x02A3B2A, 0x0492F02, + 0x05683E3, 0x04F7BD5, 0x040F18B, 0x021F3D1, 0x02078C6, 0x013DEF5, + 0x022D511, 0x03416BE, 0x0682D7D, 0x08B5446, 0x070B8CA, 0x04FD03B, + 0x01C2E32, 0x02B4D32, 0x0569A64, 0x02ED068, +}; + +static const int32_t qmat27[MAT_SIZE] = { + 0x0040000, 0x01BBDA5, 0x00DDED2, 0x01BC3B4, 0x01470F4, 0x01BC3B4, + 0x024BF01, 0x01C5105, 0x038A20A, 0x024BF01, 0x0208000, 0x032F7E4, + 0x0377B21, 0x0197BF2, 0x0208000, 0x01988FB, 0x0168A16, 0x033DA1D, + 0x033DA1D, 0x02D142C, 0x01988FB, 0x038D35A, 0x033C3D9, 0x0415402, + 0x0452259, 0x0415402, 0x019E1ED, 0x01C69AD, 0x00F2CAA, 0x0142C8B, + 0x0349C77, 0x03C437D, 0x03C437D, 0x0349C77, 0x050B22E, 0x03CB2A7, + 0x0AE1EF7, 0x0A0DDE6, 0x06101E2, 0x0690000, 0x06101E2, 0x0506EF3, + 0x015C3DF, 0x02B41F1, 0x049FAA6, 0x0547653, 0x0547653, 0x093F54C, + 0x0AD07C5, 0x13F8E97, 0x1026BD0, 0x08894CF, 0x08135E8, 0x04FE3A6, + 0x046026C, 0x068B58E, 0x0D16B1D, 0x11809B2, 0x0E2870C, 0x0A05BEA, + 0x038A1C3, 0x0569A64, 0x0AD34C8, 0x05DA0D0, +}; + +static const int32_t qmat28[MAT_SIZE] = { + 0x0040000, 0x01E83CF, 0x00F41E7, 0x01E8A79, 0x0167C3F, 0x01E8A79, + 0x01D1A59, 0x0166D39, 0x02CDA72, 0x01D1A59, 0x018C000, 0x0285DEE, + 0x02C9921, 0x0142EF7, 0x018C000, 0x01486BA, 0x0121E43, 0x0282325, + 0x0282325, 0x0243C86, 0x01486BA, 0x03E8216, 0x038F109, 0x047DC68, + 0x04C0C2F, 0x047DC68, 0x01C7884, 0x01F410B, 0x010B121, 0x0163100, + 0x039DF50, 0x0424A3D, 0x0424A3D, 0x039DF50, 0x058C3FF, 0x042C485, + 0x05EB6D3, 0x0578125, 0x0355AA3, 0x039C000, 0x0355AA3, 0x02BC092, + 0x00BD6DA, 0x017CAAB, 0x0284041, 0x02E7447, 0x02E7447, 0x0508082, + 0x05F2AAD, 0x0576E9E, 0x0477019, 0x0255900, 0x023B80D, 0x015DBA7, + 0x02650C6, 0x0394C38, 0x0729870, 0x0994319, 0x07BFE78, 0x057CB74, + 0x01EFF9E, 0x02FA1B7, 0x05F436E, 0x0337ED9, +}; + +static const int32_t qmat29[MAT_SIZE] = { + 0x0040000, 0x01E83CF, 0x00F41E7, 0x01E8A79, 0x0167C3F, 0x01E8A79, + 0x0286BB5, 0x01F25EC, 0x03E4BD8, 0x0286BB5, 0x023C000, 0x03810AE, + 0x03D0771, 0x01C0857, 0x023C000, 0x01C16AE, 0x018CB18, 0x0390986, + 0x0390986, 0x0319630, 0x01C16AE, 0x03E8216, 0x038F109, 0x047DC68, + 0x04C0C2F, 0x047DC68, 0x01C7884, 0x01F410B, 0x010B121, 0x0163100, + 0x039DF50, 0x0424A3D, 0x0424A3D, 0x039DF50, 0x058C3FF, 0x042C485, + 0x0BF8876, 0x0B0F417, 0x06AB545, 0x0738000, 0x06AB545, 0x0587A0B, + 0x017F10F, 0x02F9556, 0x0516083, 0x05CE88F, 0x05CE88F, 0x0A2C106, + 0x0BE5559, 0x15F8340, 0x11C4364, 0x0963D4B, 0x08E21B2, 0x057E0D0, + 0x04D02AB, 0x0732E1D, 0x0E65C39, 0x1340AAA, 0x0F92E27, 0x0B0651B, + 0x03E4B8A, 0x05F436E, 0x0BE86DC, 0x066FDB2, +}; + +static const int32_t qmat2A[MAT_SIZE] = { + 0x0040000, 0x02149F9, 0x010A4FD, 0x021513E, 0x018878B, 0x021513E, + 0x01FBFA7, 0x0187727, 0x030EE4E, 0x01FBFA7, 0x01B0000, 0x02C0961, + 0x030A70D, 0x01604B0, 0x01B0000, 0x016646E, 0x013C3EC, 0x02BC940, + 0x02BC940, 0x02787D8, 0x016646E, 0x04430D2, 0x03E1E38, 0x04E64CF, + 0x052F604, 0x04E64CF, 0x01F0F1C, 0x0221869, 0x0123599, 0x0183574, + 0x03F2229, 0x04850FC, 0x04850FC, 0x03F2229, 0x060D5D0, 0x048D662, + 0x0675314, 0x05F759C, 0x03A3454, 0x03F0000, 0x03A3454, 0x02FBACE, + 0x00CEA63, 0x019F45E, 0x02BE901, 0x032AD65, 0x032AD65, 0x057D202, + 0x067D176, 0x05F6166, 0x04DEEA7, 0x028BE2E, 0x026F754, 0x017D85A, + 0x029CC7B, 0x03E81B1, 0x07D0363, 0x0A731ED, 0x0874425, 0x05FC6AD, + 0x021D109, 0x033F63C, 0x067EC78, 0x0382D4A, +}; + +static const int32_t qmat2B[MAT_SIZE] = { + 0x0040000, 0x02149F9, 0x010A4FD, 0x021513E, 0x018878B, 0x021513E, + 0x02C1868, 0x021FAD3, 0x043F5A6, 0x02C1868, 0x0270000, 0x03D2978, + 0x04293C1, 0x01E94BC, 0x0270000, 0x01EA461, 0x01B0C1A, 0x03E38EF, + 0x03E38EF, 0x0361835, 0x01EA461, 0x04430D2, 0x03E1E38, 0x04E64CF, + 0x052F604, 0x04E64CF, 0x01F0F1C, 0x0221869, 0x0123599, 0x0183574, + 0x03F2229, 0x04850FC, 0x04850FC, 0x03F2229, 0x060D5D0, 0x048D662, + 0x0D0F1F6, 0x0C10A47, 0x07468A8, 0x07E0000, 0x07468A8, 0x0608524, + 0x01A1E3F, 0x033E8BB, 0x058C661, 0x0655ACA, 0x0655ACA, 0x0B18CC1, + 0x0CFA2ED, 0x17F77E9, 0x1361AF9, 0x0A3E5C6, 0x09B0D7D, 0x05FDDFA, + 0x05402E9, 0x07DA6AB, 0x0FB4D56, 0x1500BA2, 0x10FD541, 0x0C06E4C, + 0x043F550, 0x067EC78, 0x0CFD8F0, 0x0705A93, +}; + +static const int32_t qmat2C[MAT_SIZE] = { + 0x0040000, 0x0241023, 0x0120812, 0x0241803, 0x01A92D7, 0x0241803, + 0x02264F5, 0x01A8115, 0x035022A, 0x02264F5, 0x01D4000, 0x02FB4D3, + 0x034B4F9, 0x017DA6A, 0x01D4000, 0x0184222, 0x0156995, 0x02F6F5B, + 0x02F6F5B, 0x02AD32A, 0x0184222, 0x049DF8E, 0x0434B67, 0x054ED35, + 0x059DFDA, 0x054ED35, 0x021A5B4, 0x024EFC7, 0x013BA10, 0x01A39E8, + 0x0446502, 0x04E57BC, 0x04E57BC, 0x0446502, 0x068E7A2, 0x04EE840, + 0x06FEF56, 0x0676A14, 0x03F0E06, 0x0444000, 0x03F0E06, 0x033B50A, + 0x00DFDEB, 0x01C1E10, 0x02F91C1, 0x036E683, 0x036E683, 0x05F2382, + 0x0707840, 0x067542F, 0x0546D35, 0x02C235D, 0x02A369B, 0x019D50C, + 0x02D4830, 0x043B72B, 0x0876E56, 0x0B520C1, 0x09289D3, 0x067C1E6, + 0x024A275, 0x0384AC1, 0x0709582, 0x03CDBBA, +}; + +static const int32_t qmat2D[MAT_SIZE] = { + 0x0040000, 0x0241023, 0x0120812, 0x0241803, 0x01A92D7, 0x0241803, + 0x02FC51B, 0x024CFBA, 0x0499F73, 0x02FC51B, 0x02A4000, 0x0424242, + 0x0482011, 0x0212121, 0x02A4000, 0x0213214, 0x01D4D1D, 0x0436858, + 0x0436858, 0x03A9A39, 0x0213214, 0x049DF8E, 0x0434B67, 0x054ED35, + 0x059DFDA, 0x054ED35, 0x021A5B4, 0x024EFC7, 0x013BA10, 0x01A39E8, + 0x0446502, 0x04E57BC, 0x04E57BC, 0x0446502, 0x068E7A2, 0x04EE840, + 0x0E25B75, 0x0D12078, 0x07E1C0C, 0x0888000, 0x07E1C0C, 0x068903C, + 0x01C4B6F, 0x0383C20, 0x0602C3E, 0x06DCD06, 0x06DCD06, 0x0C0587C, + 0x0E0F081, 0x19F6C92, 0x14FF28E, 0x0B18E41, 0x0A7F947, 0x067DB24, + 0x05B0327, 0x0881F39, 0x1103E72, 0x16C0C9A, 0x1267C5C, 0x0D0777D, + 0x0499F17, 0x0709582, 0x0E12B04, 0x079B775, +}; + +static const int32_t qmat2E[MAT_SIZE] = { + 0x0040000, 0x026D64D, 0x0136B27, 0x026DEC9, 0x01C9E22, 0x026DEC9, + 0x0250A43, 0x01C8B03, 0x0391606, 0x0250A43, 0x01F8000, 0x0336046, + 0x038C2E5, 0x019B023, 0x01F8000, 0x01A1FD6, 0x0170F3E, 0x0331575, + 0x0331575, 0x02E1E7C, 0x01A1FD6, 0x04F8E4B, 0x0487897, 0x05B759C, + 0x060C9B0, 0x05B759C, 0x0243C4B, 0x027C725, 0x0153E87, 0x01C3E5D, + 0x049A7DA, 0x0545E7C, 0x0545E7C, 0x049A7DA, 0x070F973, 0x054FA1D, + 0x0788B98, 0x06F5E8C, 0x043E7B8, 0x0498000, 0x043E7B8, 0x037AF46, + 0x00F1173, 0x01E47C3, 0x0333A81, 0x03B1FA1, 0x03B1FA1, 0x0667502, + 0x0791F0A, 0x06F46F7, 0x05AEBC3, 0x02F888B, 0x02D75E2, 0x01BD1BE, + 0x030C3E5, 0x048ECA4, 0x091D948, 0x0C30F95, 0x09DCF81, 0x06FBD20, + 0x02773E0, 0x03C9F46, 0x0793E8C, 0x0418A2B, +}; + +static const int32_t qmat2F[MAT_SIZE] = { + 0x0040000, 0x026D64D, 0x0136B27, 0x026DEC9, 0x01C9E22, 0x026DEC9, + 0x03371CF, 0x027A4A1, 0x04F4941, 0x03371CF, 0x02D8000, 0x0475B0C, + 0x04DAC61, 0x023AD86, 0x02D8000, 0x023BFC6, 0x01F8E1F, 0x04897C2, + 0x04897C2, 0x03F1C3D, 0x023BFC6, 0x04F8E4B, 0x0487897, 0x05B759C, + 0x060C9B0, 0x05B759C, 0x0243C4B, 0x027C725, 0x0153E87, 0x01C3E5D, + 0x049A7DA, 0x0545E7C, 0x0545E7C, 0x049A7DA, 0x070F973, 0x054FA1D, + 0x0F3C4F4, 0x0E136A9, 0x087CF6F, 0x0930000, 0x087CF6F, 0x0709B54, + 0x01E789E, 0x03C8F85, 0x067921B, 0x0763F41, 0x0763F41, 0x0CF2437, + 0x0F23E14, 0x1BF613A, 0x169CA23, 0x0BF36BC, 0x0B4E511, 0x06FD84F, + 0x0620365, 0x09297C7, 0x1252F8F, 0x1880D93, 0x13D2377, 0x0E080AE, + 0x04F48DE, 0x0793E8C, 0x0F27D18, 0x0831457, +}; + +static const int32_t qmat30[MAT_SIZE] = { + 0x0040000, 0x02C62A1, 0x0163151, 0x02C6C53, 0x020B4B9, 0x02C6C53, + 0x02A54DF, 0x0209EDF, 0x0413DBE, 0x02A54DF, 0x0240000, 0x03AB72B, + 0x040DEBC, 0x01D5B96, 0x0240000, 0x01DDB3E, 0x01A5A90, 0x03A61AB, + 0x03A61AB, 0x034B520, 0x01DDB3E, 0x05AEBC3, 0x052D2F5, 0x0688669, + 0x06E9D5B, 0x0688669, 0x029697B, 0x02D75E2, 0x0184776, 0x0204745, + 0x0542D8C, 0x0606BFB, 0x0606BFB, 0x0542D8C, 0x0811D16, 0x0611DD8, + 0x089C41B, 0x07F477B, 0x04D9B1B, 0x0540000, 0x04D9B1B, 0x03FA3BE, + 0x0113883, 0x0229B27, 0x03A8C01, 0x04391DC, 0x04391DC, 0x0751803, + 0x08A6C9E, 0x07F2C88, 0x067E8DF, 0x03652E8, 0x033F46F, 0x01FCB22, + 0x037BB4F, 0x0535797, 0x0A6AF2E, 0x0DEED3C, 0x0B45ADD, 0x07FB392, + 0x02D16B7, 0x0454850, 0x08A90A0, 0x04AE70D, +}; + +static const int32_t qmat31[MAT_SIZE] = { + 0x0040000, 0x02C62A1, 0x0163151, 0x02C6C53, 0x020B4B9, 0x02C6C53, + 0x03ACB35, 0x02D4E6E, 0x05A9CDD, 0x03ACB35, 0x0340000, 0x0518CA0, + 0x058C501, 0x028C650, 0x0340000, 0x028DB2C, 0x0241023, 0x052F694, + 0x052F694, 0x0482046, 0x028DB2C, 0x05AEBC3, 0x052D2F5, 0x0688669, + 0x06E9D5B, 0x0688669, 0x029697B, 0x02D75E2, 0x0184776, 0x0204745, + 0x0542D8C, 0x0606BFB, 0x0606BFB, 0x0542D8C, 0x0811D16, 0x0611DD8, + 0x11697F2, 0x101630A, 0x09B3636, 0x0A80000, 0x09B3636, 0x080B185, + 0x022D2FE, 0x045364F, 0x0765DD6, 0x08723B8, 0x08723B8, 0x0ECBBAC, + 0x114D93C, 0x1FF4A8C, 0x19D794C, 0x0DA87B2, 0x0CEBCA6, 0x07FD2A3, + 0x07003E1, 0x0A788E4, 0x14F11C8, 0x1C00F83, 0x16A71AD, 0x1009310, + 0x05A9C6B, 0x08A90A0, 0x1152140, 0x095CE1A, +}; + +static const int32_t qmat32[MAT_SIZE] = { + 0x0040000, 0x031EEF6, 0x018F77B, 0x031F9DD, 0x024CB50, 0x031F9DD, + 0x02F9F7A, 0x024B2BB, 0x0496575, 0x02F9F7A, 0x0288000, 0x0420E11, + 0x048FA94, 0x0210708, 0x0288000, 0x02196A5, 0x01DA5E2, 0x041ADE0, + 0x041ADE0, 0x03B4BC4, 0x02196A5, 0x066493B, 0x05D2D54, 0x0759736, + 0x07C7107, 0x0759736, 0x02E96AA, 0x033249E, 0x01B5065, 0x024502E, + 0x05EB33D, 0x06C797A, 0x06C797A, 0x05EB33D, 0x09140B9, 0x06D4193, + 0x09AFC9E, 0x08F306A, 0x0574E7E, 0x05E8000, 0x0574E7E, 0x0479835, + 0x0135F94, 0x026EE8C, 0x041DD81, 0x04C0418, 0x04C0418, 0x083BB03, + 0x09BBA32, 0x08F1219, 0x074E5FB, 0x03D1D45, 0x03A72FD, 0x023C486, + 0x03EB2B9, 0x05DC28A, 0x0BB8514, 0x0FACAE4, 0x0CAE638, 0x08FAA04, + 0x032B98E, 0x04DF15A, 0x09BE2B4, 0x05443EE, +}; + +static const int32_t qmat33[MAT_SIZE] = { + 0x0040000, 0x031EEF6, 0x018F77B, 0x031F9DD, 0x024CB50, 0x031F9DD, + 0x042249C, 0x032F83C, 0x065F078, 0x042249C, 0x03A8000, 0x05BBE34, + 0x063DDA2, 0x02DDF1A, 0x03A8000, 0x02DF691, 0x0289228, 0x05D5567, + 0x05D5567, 0x051244F, 0x02DF691, 0x066493B, 0x05D2D54, 0x0759736, + 0x07C7107, 0x0759736, 0x02E96AA, 0x033249E, 0x01B5065, 0x024502E, + 0x05EB33D, 0x06C797A, 0x06C797A, 0x05EB33D, 0x09140B9, 0x06D4193, + 0x1396AF0, 0x1218F6B, 0x0AE9CFD, 0x0BD0000, 0x0AE9CFD, 0x090C7B6, + 0x0272D5E, 0x04DDD19, 0x0852991, 0x098082F, 0x098082F, 0x10A5322, + 0x1377463, 0x23F33DD, 0x1D12876, 0x0F5D8A9, 0x0E8943B, 0x08FCCF7, + 0x07E045D, 0x0BC7A00, 0x178F401, 0x1F81173, 0x197BFE2, 0x120A572, + 0x065EFF9, 0x09BE2B4, 0x137C568, 0x0A887DD, +}; + +static const int32_t qmat34[MAT_SIZE] = { + 0x0040000, 0x0377B4A, 0x01BBDA5, 0x0378768, 0x028E1E8, 0x0378768, + 0x034EA16, 0x028C697, 0x0518D2D, 0x034EA16, 0x02D0000, 0x04964F6, + 0x051166B, 0x024B27B, 0x02D0000, 0x025520D, 0x020F134, 0x048FA15, + 0x048FA15, 0x041E268, 0x025520D, 0x071A6B4, 0x06787B3, 0x082A803, + 0x08A44B2, 0x082A803, 0x033C3D9, 0x038D35A, 0x01E5954, 0x0285917, + 0x06938EF, 0x07886FA, 0x07886FA, 0x06938EF, 0x0A1645B, 0x079654E, + 0x0AC3522, 0x09F195A, 0x06101E2, 0x0690000, 0x06101E2, 0x04F8CAD, + 0x01586A4, 0x02B41F1, 0x0492F02, 0x0547653, 0x0547653, 0x0925E03, + 0x0AD07C5, 0x09EF7AA, 0x081E317, 0x043E7A2, 0x040F18B, 0x027BDEB, + 0x045AA23, 0x0682D7D, 0x0D05AFA, 0x116A88B, 0x0E17194, 0x09FA076, + 0x0385C65, 0x0569A64, 0x0AD34C8, 0x05DA0D0, +}; + +static const int32_t qmat35[MAT_SIZE] = { + 0x0040000, 0x0377B4A, 0x01BBDA5, 0x0378768, 0x028E1E8, 0x0378768, + 0x0497E02, 0x038A20A, 0x0714414, 0x0497E02, 0x0410000, 0x065EFC8, + 0x06EF642, 0x032F7E4, 0x0410000, 0x03311F7, 0x02D142C, 0x067B439, + 0x067B439, 0x05A2858, 0x03311F7, 0x071A6B4, 0x06787B3, 0x082A803, + 0x08A44B2, 0x082A803, 0x033C3D9, 0x038D35A, 0x01E5954, 0x0285917, + 0x06938EF, 0x07886FA, 0x07886FA, 0x06938EF, 0x0A1645B, 0x079654E, + 0x15C3DEF, 0x141BBCC, 0x0C203C3, 0x0D20000, 0x0C203C3, 0x0A0DDE6, + 0x02B87BE, 0x05683E3, 0x093F54C, 0x0A8ECA7, 0x0A8ECA7, 0x127EA97, + 0x15A0F8B, 0x27F1D2F, 0x204D79F, 0x111299F, 0x1026BD0, 0x09FC74C, + 0x08C04D9, 0x0D16B1D, 0x1A2D63A, 0x2301364, 0x1C50E18, 0x140B7D4, + 0x0714386, 0x0AD34C8, 0x15A6990, 0x0BB41A0, +}; + +static const int32_t qmat36[MAT_SIZE] = { + 0x0040000, 0x03D079E, 0x01E83CF, 0x03D14F2, 0x02CF87F, 0x03D14F2, + 0x03A34B2, 0x02CDA72, 0x059B4E5, 0x03A34B2, 0x0318000, 0x050BBDC, + 0x0593243, 0x0285DEE, 0x0318000, 0x0290D75, 0x0243C86, 0x050464B, + 0x050464B, 0x048790C, 0x0290D75, 0x07D042C, 0x071E211, 0x08FB8D0, + 0x098185E, 0x08FB8D0, 0x038F109, 0x03E8216, 0x0216242, 0x02C6200, + 0x073BEA0, 0x0849479, 0x0849479, 0x073BEA0, 0x0B187FE, 0x0858909, + 0x0BD6DA5, 0x0AF0249, 0x06AB545, 0x0738000, 0x06AB545, 0x0578125, + 0x017ADB5, 0x02F9556, 0x0508082, 0x05CE88F, 0x05CE88F, 0x0A10104, + 0x0BE5559, 0x0AEDD3B, 0x08EE032, 0x04AB1FF, 0x0477019, 0x02BB74F, + 0x04CA18D, 0x0729870, 0x0E530E0, 0x1328633, 0x0F7FCEF, 0x0AF96E8, + 0x03DFF3C, 0x05F436E, 0x0BE86DC, 0x066FDB2, +}; + +static const int32_t qmat37[MAT_SIZE] = { + 0x0040000, 0x03D079E, 0x01E83CF, 0x03D14F2, 0x02CF87F, 0x03D14F2, + 0x050D769, 0x03E4BD8, 0x07C97B0, 0x050D769, 0x0478000, 0x070215C, + 0x07A0EE2, 0x03810AE, 0x0478000, 0x0382D5C, 0x0319630, 0x072130C, + 0x072130C, 0x0632C61, 0x0382D5C, 0x07D042C, 0x071E211, 0x08FB8D0, + 0x098185E, 0x08FB8D0, 0x038F109, 0x03E8216, 0x0216242, 0x02C6200, + 0x073BEA0, 0x0849479, 0x0849479, 0x073BEA0, 0x0B187FE, 0x0858909, + 0x17F10ED, 0x161E82D, 0x0D56A8A, 0x0E70000, 0x0D56A8A, 0x0B0F417, + 0x02FE21E, 0x05F2AAD, 0x0A2C106, 0x0B9D11E, 0x0B9D11E, 0x145820D, + 0x17CAAB2, 0x2BF0680, 0x23886C9, 0x12C7A95, 0x11C4364, 0x0AFC1A0, + 0x09A0555, 0x0E65C39, 0x1CCB873, 0x2681554, 0x1F25C4D, 0x160CA36, + 0x07C9713, 0x0BE86DC, 0x17D0DB8, 0x0CDFB63, +}; + +static const int32_t qmat38[MAT_SIZE] = { + 0x0040000, 0x04293F2, 0x02149F9, 0x042A27C, 0x0310F16, 0x042A27C, + 0x03F7F4E, 0x030EE4E, 0x061DC9D, 0x03F7F4E, 0x0360000, 0x05812C1, + 0x0614E1A, 0x02C0961, 0x0360000, 0x02CC8DC, 0x02787D8, 0x0579280, + 0x0579280, 0x04F0FAF, 0x02CC8DC, 0x08861A5, 0x07C3C70, 0x09CC99D, + 0x0A5EC09, 0x09CC99D, 0x03E1E38, 0x04430D2, 0x0246B31, 0x0306AE8, + 0x07E4452, 0x090A1F9, 0x090A1F9, 0x07E4452, 0x0C1ABA1, 0x091ACC4, + 0x0CEA628, 0x0BEEB39, 0x07468A8, 0x07E0000, 0x07468A8, 0x05F759C, + 0x019D4C5, 0x033E8BB, 0x057D202, 0x0655ACA, 0x0655ACA, 0x0AFA404, + 0x0CFA2ED, 0x0BEC2CC, 0x09BDD4E, 0x0517C5D, 0x04DEEA7, 0x02FB0B3, + 0x05398F7, 0x07D0363, 0x0FA06C5, 0x14E63DA, 0x10E884B, 0x0BF8D5B, + 0x043A213, 0x067EC78, 0x0CFD8F0, 0x0705A93, +}; + +static const int32_t qmat39[MAT_SIZE] = { + 0x0040000, 0x04293F2, 0x02149F9, 0x042A27C, 0x0310F16, 0x042A27C, + 0x05830D0, 0x043F5A6, 0x087EB4B, 0x05830D0, 0x04E0000, 0x07A52F0, + 0x0852782, 0x03D2978, 0x04E0000, 0x03D48C2, 0x0361835, 0x07C71DE, + 0x07C71DE, 0x06C3069, 0x03D48C2, 0x08861A5, 0x07C3C70, 0x09CC99D, + 0x0A5EC09, 0x09CC99D, 0x03E1E38, 0x04430D2, 0x0246B31, 0x0306AE8, + 0x07E4452, 0x090A1F9, 0x090A1F9, 0x07E4452, 0x0C1ABA1, 0x091ACC4, + 0x1A1E3EB, 0x182148F, 0x0E8D151, 0x0FC0000, 0x0E8D151, 0x0C10A47, + 0x0343C7D, 0x067D176, 0x0B18CC1, 0x0CAB595, 0x0CAB595, 0x1631982, + 0x19F45DA, 0x2FEEFD2, 0x26C35F2, 0x147CB8C, 0x1361AF9, 0x0BFBBF4, + 0x0A805D1, 0x0FB4D56, 0x1F69AAC, 0x2A01744, 0x21FAA83, 0x180DC98, + 0x087EAA1, 0x0CFD8F0, 0x19FB1E0, 0x0E0B527, +}; + +static const int32_t qmat3A[MAT_SIZE] = { + 0x0040000, 0x0482046, 0x0241023, 0x0483007, 0x03525AD, 0x0483007, + 0x044C9EA, 0x035022A, 0x06A0454, 0x044C9EA, 0x03A8000, 0x05F69A7, + 0x06969F2, 0x02FB4D3, 0x03A8000, 0x0308444, 0x02AD32A, 0x05EDEB5, + 0x05EDEB5, 0x055A653, 0x0308444, 0x093BF1D, 0x08696CF, 0x0A9DA6A, + 0x0B3BFB4, 0x0A9DA6A, 0x0434B67, 0x049DF8E, 0x0277420, 0x03473D1, + 0x088CA03, 0x09CAF78, 0x09CAF78, 0x088CA03, 0x0D1CF44, 0x09DD07F, + 0x0DFDEAC, 0x0CED428, 0x07E1C0C, 0x0888000, 0x07E1C0C, 0x0676A14, + 0x01BFBD5, 0x0383C20, 0x05F2382, 0x06DCD06, 0x06DCD06, 0x0BE4704, + 0x0E0F081, 0x0CEA85D, 0x0A8DA6A, 0x05846BA, 0x0546D35, 0x033AA17, + 0x05A9060, 0x0876E56, 0x10EDCAB, 0x16A4182, 0x12513A7, 0x0CF83CD, + 0x04944EA, 0x0709582, 0x0E12B04, 0x079B775, +}; + +static const int32_t qmat3B[MAT_SIZE] = { + 0x0040000, 0x0482046, 0x0241023, 0x0483007, 0x03525AD, 0x0483007, + 0x05F8A36, 0x0499F73, 0x0933EE7, 0x05F8A36, 0x0548000, 0x0848484, + 0x0904022, 0x0424242, 0x0548000, 0x0426427, 0x03A9A39, 0x086D0B1, + 0x086D0B1, 0x0753472, 0x0426427, 0x093BF1D, 0x08696CF, 0x0A9DA6A, + 0x0B3BFB4, 0x0A9DA6A, 0x0434B67, 0x049DF8E, 0x0277420, 0x03473D1, + 0x088CA03, 0x09CAF78, 0x09CAF78, 0x088CA03, 0x0D1CF44, 0x09DD07F, + 0x1C4B6EA, 0x1A240F0, 0x0FC3818, 0x1110000, 0x0FC3818, 0x0D12078, + 0x03896DD, 0x0707840, 0x0C0587C, 0x0DB9A0C, 0x0DB9A0C, 0x180B0F8, + 0x1C1E101, 0x33ED923, 0x29FE51C, 0x1631C82, 0x14FF28E, 0x0CFB649, + 0x0B6064D, 0x1103E72, 0x2207CE5, 0x2D81935, 0x24CF8B9, 0x1A0EEFA, + 0x0933E2E, 0x0E12B04, 0x1C25608, 0x0F36EEA, +}; + +static const int32_t qmat3C[MAT_SIZE] = { + 0x0040000, 0x04DAC9A, 0x026D64D, 0x04DBD91, 0x0393C44, 0x04DBD91, + 0x04A1486, 0x0391606, 0x0722C0C, 0x04A1486, 0x03F0000, 0x066C08C, + 0x07185C9, 0x0336046, 0x03F0000, 0x0343FAC, 0x02E1E7C, 0x0662AEB, + 0x0662AEB, 0x05C3CF7, 0x0343FAC, 0x09F1C95, 0x090F12D, 0x0B6EB37, + 0x0C19360, 0x0B6EB37, 0x0487897, 0x04F8E4B, 0x02A7D0F, 0x0387CBA, + 0x0934FB5, 0x0A8BCF7, 0x0A8BCF7, 0x0934FB5, 0x0E1F2E6, 0x0A9F43A, + 0x0F1172F, 0x0DEBD17, 0x087CF6F, 0x0930000, 0x087CF6F, 0x06F5E8C, + 0x01E22E6, 0x03C8F85, 0x0667502, 0x0763F41, 0x0763F41, 0x0CCEA05, + 0x0F23E14, 0x0DE8DEE, 0x0B5D786, 0x05F1117, 0x05AEBC3, 0x037A37C, + 0x06187CA, 0x091D948, 0x123B291, 0x1861F29, 0x13B9F02, 0x0DF7A3F, + 0x04EE7C1, 0x0793E8C, 0x0F27D18, 0x0831457, +}; + +static const int32_t qmat3D[MAT_SIZE] = { + 0x0040000, 0x04DAC9A, 0x026D64D, 0x04DBD91, 0x0393C44, 0x04DBD91, + 0x066E39D, 0x04F4941, 0x09E9282, 0x066E39D, 0x05B0000, 0x08EB618, + 0x09B58C2, 0x0475B0C, 0x05B0000, 0x0477F8D, 0x03F1C3D, 0x0912F83, + 0x0912F83, 0x07E387B, 0x0477F8D, 0x09F1C95, 0x090F12D, 0x0B6EB37, + 0x0C19360, 0x0B6EB37, 0x0487897, 0x04F8E4B, 0x02A7D0F, 0x0387CBA, + 0x0934FB5, 0x0A8BCF7, 0x0A8BCF7, 0x0934FB5, 0x0E1F2E6, 0x0A9F43A, + 0x1E789E8, 0x1C26D51, 0x10F9EDE, 0x1260000, 0x10F9EDE, 0x0E136A9, + 0x03CF13D, 0x0791F0A, 0x0CF2437, 0x0EC7E83, 0x0EC7E83, 0x19E486D, + 0x1E47C29, 0x37EC275, 0x2D39446, 0x17E6D78, 0x169CA23, 0x0DFB09D, + 0x0C406C9, 0x1252F8F, 0x24A5F1E, 0x3101B25, 0x27A46EE, 0x1C1015C, + 0x09E91BC, 0x0F27D18, 0x1E4FA30, 0x10628AD, +}; + +static const int32_t qmat3E[MAT_SIZE] = { + 0x0040000, 0x058C543, 0x02C62A1, 0x058D8A6, 0x0416973, 0x058D8A6, + 0x054A9BD, 0x0413DBE, 0x0827B7B, 0x054A9BD, 0x0480000, 0x0756E57, + 0x081BD78, 0x03AB72B, 0x0480000, 0x03BB67B, 0x034B520, 0x074C355, + 0x074C355, 0x0696A3F, 0x03BB67B, 0x0B5D786, 0x0A5A5EB, 0x0D10CD2, + 0x0DD3AB7, 0x0D10CD2, 0x052D2F5, 0x05AEBC3, 0x0308EEC, 0x0408E8B, + 0x0A85B18, 0x0C0D7F6, 0x0C0D7F6, 0x0A85B18, 0x1023A2C, 0x0C23BB1, + 0x1138836, 0x0FE8EF6, 0x09B3636, 0x0A80000, 0x09B3636, 0x07F477B, + 0x0227107, 0x045364F, 0x0751803, 0x08723B8, 0x08723B8, 0x0EA3005, + 0x114D93C, 0x0FE5910, 0x0CFD1BE, 0x06CA5D1, 0x067E8DF, 0x03F9644, + 0x06F769E, 0x0A6AF2E, 0x14D5E5C, 0x1BDDA78, 0x168B5B9, 0x0FF6724, + 0x05A2D6E, 0x08A90A0, 0x1152140, 0x095CE1A, +}; + +static const int32_t qmat3F[MAT_SIZE] = { + 0x0040000, 0x058C543, 0x02C62A1, 0x058D8A6, 0x0416973, 0x058D8A6, + 0x075966A, 0x05A9CDD, 0x0B539BA, 0x075966A, 0x0680000, 0x0A31940, + 0x0B18A03, 0x0518CA0, 0x0680000, 0x051B658, 0x0482046, 0x0A5ED28, + 0x0A5ED28, 0x090408D, 0x051B658, 0x0B5D786, 0x0A5A5EB, 0x0D10CD2, + 0x0DD3AB7, 0x0D10CD2, 0x052D2F5, 0x05AEBC3, 0x0308EEC, 0x0408E8B, + 0x0A85B18, 0x0C0D7F6, 0x0C0D7F6, 0x0A85B18, 0x1023A2C, 0x0C23BB1, + 0x22D2FE4, 0x202C614, 0x1366C6C, 0x1500000, 0x1366C6C, 0x101630A, + 0x045A5FD, 0x08A6C9E, 0x0ECBBAC, 0x10E4771, 0x10E4771, 0x1D97758, + 0x229B278, 0x3FE9518, 0x33AF299, 0x1B50F65, 0x19D794C, 0x0FFA546, + 0x0E007C1, 0x14F11C8, 0x29E2390, 0x3801F06, 0x2D4E359, 0x2012620, + 0x0B538D6, 0x1152140, 0x22A4280, 0x12B9C33, +}; + +static const int32_t qmat40[MAT_SIZE] = { + 0x0040000, 0x063DDEB, 0x031EEF6, 0x063F3BB, 0x04996A1, 0x063F3BB, + 0x05F3EF5, 0x0496575, 0x092CAEB, 0x05F3EF5, 0x0510000, 0x0841C22, + 0x091F527, 0x0420E11, 0x0510000, 0x0432D4B, 0x03B4BC4, 0x0835BC0, + 0x0835BC0, 0x0769787, 0x0432D4B, 0x0CC9277, 0x0BA5AA8, 0x0EB2E6C, + 0x0F8E20D, 0x0EB2E6C, 0x05D2D54, 0x066493B, 0x036A0CA, 0x048A05C, + 0x0BD667B, 0x0D8F2F5, 0x0D8F2F5, 0x0BD667B, 0x1228171, 0x0DA8327, + 0x135F93D, 0x11E60D5, 0x0AE9CFD, 0x0BD0000, 0x0AE9CFD, 0x08F306A, + 0x026BF28, 0x04DDD19, 0x083BB03, 0x098082F, 0x098082F, 0x1077606, + 0x1377463, 0x11E2432, 0x0E9CBF6, 0x07A3A8B, 0x074E5FB, 0x047890D, + 0x07D6572, 0x0BB8514, 0x1770A28, 0x1F595C7, 0x195CC70, 0x11F5408, + 0x065731C, 0x09BE2B4, 0x137C568, 0x0A887DD, +}; + +static const int32_t qmat41[MAT_SIZE] = { + 0x0040000, 0x063DDEB, 0x031EEF6, 0x063F3BB, 0x04996A1, 0x063F3BB, + 0x0844938, 0x065F078, 0x0CBE0F1, 0x0844938, 0x0750000, 0x0B77C68, + 0x0C7BB43, 0x05BBE34, 0x0750000, 0x05BED23, 0x051244F, 0x0BAAACD, + 0x0BAAACD, 0x0A2489E, 0x05BED23, 0x0CC9277, 0x0BA5AA8, 0x0EB2E6C, + 0x0F8E20D, 0x0EB2E6C, 0x05D2D54, 0x066493B, 0x036A0CA, 0x048A05C, + 0x0BD667B, 0x0D8F2F5, 0x0D8F2F5, 0x0BD667B, 0x1228171, 0x0DA8327, + 0x272D5E1, 0x2431ED6, 0x15D39F9, 0x17A0000, 0x15D39F9, 0x1218F6B, + 0x04E5ABC, 0x09BBA32, 0x10A5322, 0x130105F, 0x130105F, 0x214A643, + 0x26EE8C7, 0x47E67BB, 0x3A250EC, 0x1EBB151, 0x1D12876, 0x11F99EF, + 0x0FC08BA, 0x178F401, 0x2F1E802, 0x3F022E7, 0x32F7FC4, 0x2414AE4, + 0x0CBDFF1, 0x137C568, 0x26F8AD0, 0x1510FBA, +}; + +static const int32_t qmat42[MAT_SIZE] = { + 0x0040000, 0x06EF693, 0x0377B4A, 0x06F0ECF, 0x051C3CF, 0x06F0ECF, + 0x069D42D, 0x0518D2D, 0x0A31A5A, 0x069D42D, 0x05A0000, 0x092C9ED, + 0x0A22CD6, 0x04964F6, 0x05A0000, 0x04AA41A, 0x041E268, 0x091F42B, + 0x091F42B, 0x083C4CF, 0x04AA41A, 0x0E34D68, 0x0CF0F65, 0x1055006, + 0x1148964, 0x1055006, 0x06787B3, 0x071A6B4, 0x03CB2A7, 0x050B22E, + 0x0D271DE, 0x0F10DF4, 0x0F10DF4, 0x0D271DE, 0x142C8B7, 0x0F2CA9D, + 0x1586A43, 0x13E32B4, 0x0C203C3, 0x0D20000, 0x0C203C3, 0x09F195A, + 0x02B0D48, 0x05683E3, 0x0925E03, 0x0A8ECA7, 0x0A8ECA7, 0x124BC06, + 0x15A0F8B, 0x13DEF54, 0x103C62D, 0x087CF45, 0x081E317, 0x04F7BD5, + 0x08B5446, 0x0D05AFA, 0x1A0B5F3, 0x22D5116, 0x1C2E328, 0x13F40EC, + 0x070B8CA, 0x0AD34C8, 0x15A6990, 0x0BB41A0, +}; + +static const int32_t qmat43[MAT_SIZE] = { + 0x0040000, 0x06EF693, 0x0377B4A, 0x06F0ECF, 0x051C3CF, 0x06F0ECF, + 0x092FC05, 0x0714414, 0x0E28828, 0x092FC05, 0x0820000, 0x0CBDF90, + 0x0DDEC84, 0x065EFC8, 0x0820000, 0x06623EE, 0x05A2858, 0x0CF6872, + 0x0CF6872, 0x0B450B0, 0x06623EE, 0x0E34D68, 0x0CF0F65, 0x1055006, + 0x1148964, 0x1055006, 0x06787B3, 0x071A6B4, 0x03CB2A7, 0x050B22E, + 0x0D271DE, 0x0F10DF4, 0x0F10DF4, 0x0D271DE, 0x142C8B7, 0x0F2CA9D, + 0x2B87BDD, 0x2837799, 0x1840787, 0x1A40000, 0x1840787, 0x141BBCC, + 0x0570F7C, 0x0AD07C5, 0x127EA97, 0x151D94D, 0x151D94D, 0x24FD52E, + 0x2B41F16, 0x4FE3A5E, 0x409AF3F, 0x222533E, 0x204D79F, 0x13F8E97, + 0x11809B2, 0x1A2D63A, 0x345AC74, 0x46026C7, 0x38A1C30, 0x2816FA7, + 0x0E2870C, 0x15A6990, 0x2B4D320, 0x1768340, +}; + +static const int32_t qmat44[MAT_SIZE] = { + 0x0040000, 0x07A0F3C, 0x03D079E, 0x07A29E4, 0x059F0FE, 0x07A29E4, + 0x0746964, 0x059B4E5, 0x0B369CA, 0x0746964, 0x0630000, 0x0A177B8, + 0x0B26485, 0x050BBDC, 0x0630000, 0x0521AE9, 0x048790C, 0x0A08C95, + 0x0A08C95, 0x090F217, 0x0521AE9, 0x0FA0858, 0x0E3C423, 0x11F71A0, + 0x13030BB, 0x11F71A0, 0x071E211, 0x07D042C, 0x042C485, 0x058C3FF, + 0x0E77D40, 0x10928F2, 0x10928F2, 0x0E77D40, 0x1630FFC, 0x10B1213, + 0x17ADB4A, 0x15E0492, 0x0D56A8A, 0x0E70000, 0x0D56A8A, 0x0AF0249, + 0x02F5B69, 0x05F2AAD, 0x0A10104, 0x0B9D11E, 0x0B9D11E, 0x1420207, + 0x17CAAB2, 0x15DBA76, 0x11DC065, 0x09563FF, 0x08EE032, 0x0576E9E, + 0x0994319, 0x0E530E0, 0x1CA61BF, 0x2650C65, 0x1EFF9DF, 0x15F2DD1, + 0x07BFE78, 0x0BE86DC, 0x17D0DB8, 0x0CDFB63, +}; + +static const int32_t qmat45[MAT_SIZE] = { + 0x0040000, 0x07A0F3C, 0x03D079E, 0x07A29E4, 0x059F0FE, 0x07A29E4, + 0x0A1AED2, 0x07C97B0, 0x0F92F5F, 0x0A1AED2, 0x08F0000, 0x0E042B8, + 0x0F41DC4, 0x070215C, 0x08F0000, 0x0705AB9, 0x0632C61, 0x0E42617, + 0x0E42617, 0x0C658C1, 0x0705AB9, 0x0FA0858, 0x0E3C423, 0x11F71A0, + 0x13030BB, 0x11F71A0, 0x071E211, 0x07D042C, 0x042C485, 0x058C3FF, + 0x0E77D40, 0x10928F2, 0x10928F2, 0x0E77D40, 0x1630FFC, 0x10B1213, + 0x2FE21DA, 0x2C3D05B, 0x1AAD514, 0x1CE0000, 0x1AAD514, 0x161E82D, + 0x05FC43B, 0x0BE5559, 0x145820D, 0x173A23B, 0x173A23B, 0x28B0419, + 0x2F95565, 0x57E0D01, 0x4710D92, 0x258F52A, 0x23886C9, 0x15F8340, + 0x1340AAA, 0x1CCB873, 0x39970E6, 0x4D02AA8, 0x3E4B89B, 0x2C1946B, + 0x0F92E27, 0x17D0DB8, 0x2FA1B6F, 0x19BF6C7, +}; + +static const int32_t qmat46[MAT_SIZE] = { + 0x0040000, 0x08527E4, 0x04293F2, 0x08544F9, 0x0621E2C, 0x08544F9, + 0x07EFE9C, 0x061DC9D, 0x0C3B939, 0x07EFE9C, 0x06C0000, 0x0B02582, + 0x0C29C34, 0x05812C1, 0x06C0000, 0x05991B9, 0x04F0FAF, 0x0AF2500, + 0x0AF2500, 0x09E1F5F, 0x05991B9, 0x110C349, 0x0F878E0, 0x139933B, + 0x14BD812, 0x139933B, 0x07C3C70, 0x08861A5, 0x048D662, 0x060D5D0, + 0x0FC88A3, 0x12143F1, 0x12143F1, 0x0FC88A3, 0x1835742, 0x1235989, + 0x19D4C51, 0x17DD671, 0x0E8D151, 0x0FC0000, 0x0E8D151, 0x0BEEB39, + 0x033A98A, 0x067D176, 0x0AFA404, 0x0CAB595, 0x0CAB595, 0x15F4808, + 0x19F45DA, 0x17D8598, 0x137BA9D, 0x0A2F8B9, 0x09BDD4E, 0x05F6166, + 0x0A731ED, 0x0FA06C5, 0x1F40D8B, 0x29CC7B4, 0x21D1096, 0x17F1AB5, + 0x0874425, 0x0CFD8F0, 0x19FB1E0, 0x0E0B527, +}; + +static const int32_t qmat47[MAT_SIZE] = { + 0x0040000, 0x08527E4, 0x04293F2, 0x08544F9, 0x0621E2C, 0x08544F9, + 0x0B061A0, 0x087EB4B, 0x10FD696, 0x0B061A0, 0x09C0000, 0x0F4A5E0, + 0x10A4F04, 0x07A52F0, 0x09C0000, 0x07A9184, 0x06C3069, 0x0F8E3BC, + 0x0F8E3BC, 0x0D860D3, 0x07A9184, 0x110C349, 0x0F878E0, 0x139933B, + 0x14BD812, 0x139933B, 0x07C3C70, 0x08861A5, 0x048D662, 0x060D5D0, + 0x0FC88A3, 0x12143F1, 0x12143F1, 0x0FC88A3, 0x1835742, 0x1235989, + 0x343C7D6, 0x304291D, 0x1D1A2A2, 0x1F80000, 0x1D1A2A2, 0x182148F, + 0x06878FB, 0x0CFA2ED, 0x1631982, 0x1956B29, 0x1956B29, 0x2C63305, + 0x33E8BB4, 0x5FDDFA4, 0x4D86BE5, 0x28F9717, 0x26C35F2, 0x17F77E9, + 0x1500BA2, 0x1F69AAC, 0x3ED3558, 0x5402E89, 0x43F5506, 0x301B92F, + 0x10FD541, 0x19FB1E0, 0x33F63BF, 0x1C16A4D, +}; + +static const int32_t qmat48[MAT_SIZE] = { + 0x0040000, 0x090408D, 0x0482046, 0x090600E, 0x06A4B5A, 0x090600E, + 0x08993D3, 0x06A0454, 0x0D408A9, 0x08993D3, 0x0750000, 0x0BED34D, + 0x0D2D3E3, 0x05F69A7, 0x0750000, 0x0610888, 0x055A653, 0x0BDBD6A, + 0x0BDBD6A, 0x0AB4CA7, 0x0610888, 0x1277E3A, 0x10D2D9D, 0x153B4D5, + 0x1677F69, 0x153B4D5, 0x08696CF, 0x093BF1D, 0x04EE840, 0x068E7A2, + 0x1119406, 0x1395EF0, 0x1395EF0, 0x1119406, 0x1A39E87, 0x13BA0FF, + 0x1BFBD57, 0x19DA850, 0x0FC3818, 0x1110000, 0x0FC3818, 0x0CED428, + 0x037F7AB, 0x0707840, 0x0BE4704, 0x0DB9A0C, 0x0DB9A0C, 0x17C8E08, + 0x1C1E101, 0x19D50BB, 0x151B4D4, 0x0B08D73, 0x0A8DA6A, 0x067542F, + 0x0B520C1, 0x10EDCAB, 0x21DB956, 0x2D48303, 0x24A274D, 0x19F079A, + 0x09289D3, 0x0E12B04, 0x1C25608, 0x0F36EEA, +}; + +static const int32_t qmat49[MAT_SIZE] = { + 0x0040000, 0x090408D, 0x0482046, 0x090600E, 0x06A4B5A, 0x090600E, + 0x0BF146D, 0x0933EE7, 0x1267DCE, 0x0BF146D, 0x0A90000, 0x1090908, + 0x1208045, 0x0848484, 0x0A90000, 0x084C84F, 0x0753472, 0x10DA161, + 0x10DA161, 0x0EA68E4, 0x084C84F, 0x1277E3A, 0x10D2D9D, 0x153B4D5, + 0x1677F69, 0x153B4D5, 0x08696CF, 0x093BF1D, 0x04EE840, 0x068E7A2, + 0x1119406, 0x1395EF0, 0x1395EF0, 0x1119406, 0x1A39E87, 0x13BA0FF, + 0x3896DD3, 0x34481E0, 0x1F8702F, 0x2220000, 0x1F8702F, 0x1A240F0, + 0x0712DBA, 0x0E0F081, 0x180B0F8, 0x1B73417, 0x1B73417, 0x30161F0, + 0x383C203, 0x67DB247, 0x53FCA38, 0x2C63904, 0x29FE51C, 0x19F6C92, + 0x16C0C9A, 0x2207CE5, 0x440F9CA, 0x5B0326A, 0x499F171, 0x341DDF3, + 0x1267C5C, 0x1C25608, 0x384AC0F, 0x1E6DDD4, +}; + +static const int32_t qmat4A[MAT_SIZE] = { + 0x0040000, 0x09B5935, 0x04DAC9A, 0x09B7B22, 0x0727888, 0x09B7B22, + 0x094290B, 0x0722C0C, 0x0E45818, 0x094290B, 0x07E0000, 0x0CD8118, + 0x0E30B92, 0x066C08C, 0x07E0000, 0x0687F58, 0x05C3CF7, 0x0CC55D5, + 0x0CC55D5, 0x0B879EF, 0x0687F58, 0x13E392B, 0x121E25B, 0x16DD66F, + 0x18326C0, 0x16DD66F, 0x090F12D, 0x09F1C95, 0x054FA1D, 0x070F973, + 0x1269F69, 0x15179EF, 0x15179EF, 0x1269F69, 0x1C3E5CD, 0x153E875, + 0x1E22E5E, 0x1BD7A2F, 0x10F9EDE, 0x1260000, 0x10F9EDE, 0x0DEBD17, + 0x03C45CC, 0x0791F0A, 0x0CCEA05, 0x0EC7E83, 0x0EC7E83, 0x199D409, + 0x1E47C29, 0x1BD1BDD, 0x16BAF0C, 0x0BE222D, 0x0B5D786, 0x06F46F7, + 0x0C30F95, 0x123B291, 0x2476522, 0x30C3E52, 0x2773E04, 0x1BEF47E, + 0x09DCF81, 0x0F27D18, 0x1E4FA30, 0x10628AD, +}; + +static const int32_t qmat4B[MAT_SIZE] = { + 0x0040000, 0x09B5935, 0x04DAC9A, 0x09B7B22, 0x0727888, 0x09B7B22, + 0x0CDC73A, 0x09E9282, 0x13D2505, 0x0CDC73A, 0x0B60000, 0x11D6C30, + 0x136B185, 0x08EB618, 0x0B60000, 0x08EFF19, 0x07E387B, 0x1225F06, + 0x1225F06, 0x0FC70F6, 0x08EFF19, 0x13E392B, 0x121E25B, 0x16DD66F, + 0x18326C0, 0x16DD66F, 0x090F12D, 0x09F1C95, 0x054FA1D, 0x070F973, + 0x1269F69, 0x15179EF, 0x15179EF, 0x1269F69, 0x1C3E5CD, 0x153E875, + 0x3CF13D0, 0x384DAA2, 0x21F3DBD, 0x24C0000, 0x21F3DBD, 0x1C26D51, + 0x079E27A, 0x0F23E14, 0x19E486D, 0x1D8FD05, 0x1D8FD05, 0x33C90DB, + 0x3C8F852, 0x6FD84EA, 0x5A7288B, 0x2FCDAF0, 0x2D39446, 0x1BF613A, + 0x1880D93, 0x24A5F1E, 0x494BE3C, 0x620364A, 0x4F48DDC, 0x38202B7, + 0x13D2377, 0x1E4FA30, 0x3C9F45F, 0x20C515A, +}; + +static const int32_t qmat4C[MAT_SIZE] = { + 0x0040000, 0x1208119, 0x090408D, 0x120C01B, 0x0D496B4, 0x120C01B, + 0x11327A7, 0x0D408A9, 0x1A81151, 0x11327A7, 0x0EA0000, 0x17DA69B, + 0x1A5A7C7, 0x0BED34D, 0x0EA0000, 0x0C21110, 0x0AB4CA7, 0x17B7AD5, + 0x17B7AD5, 0x156994E, 0x0C21110, 0x24EFC74, 0x21A5B3B, 0x2A769A9, + 0x2CEFED2, 0x2A769A9, 0x10D2D9D, 0x1277E3A, 0x09DD07F, 0x0D1CF44, + 0x223280D, 0x272BDE0, 0x272BDE0, 0x223280D, 0x3473D0E, 0x27741FE, + 0x37F7AAF, 0x33B50A0, 0x1F8702F, 0x2220000, 0x1F8702F, 0x19DA850, + 0x06FEF56, 0x0E0F081, 0x17C8E08, 0x1B73417, 0x1B73417, 0x2F91C11, + 0x383C203, 0x33AA175, 0x2A369A9, 0x1611AE6, 0x151B4D4, 0x0CEA85D, + 0x16A4182, 0x21DB956, 0x43B72AC, 0x5A90607, 0x4944E9A, 0x33E0F34, + 0x12513A7, 0x1C25608, 0x384AC0F, 0x1E6DDD4, +}; + +static const int32_t qmat4D[MAT_SIZE] = { + 0x0040000, 0x1208119, 0x090408D, 0x120C01B, 0x0D496B4, 0x120C01B, + 0x17E28DA, 0x1267DCE, 0x24CFB9B, 0x17E28DA, 0x1520000, 0x2121210, + 0x2410089, 0x1090908, 0x1520000, 0x109909D, 0x0EA68E4, 0x21B42C3, + 0x21B42C3, 0x1D4D1C9, 0x109909D, 0x24EFC74, 0x21A5B3B, 0x2A769A9, + 0x2CEFED2, 0x2A769A9, 0x10D2D9D, 0x1277E3A, 0x09DD07F, 0x0D1CF44, + 0x223280D, 0x272BDE0, 0x272BDE0, 0x223280D, 0x3473D0E, 0x27741FE, + 0x712DBA6, 0x68903C0, 0x3F0E05F, 0x4440000, 0x3F0E05F, 0x34481E0, + 0x0E25B75, 0x1C1E101, 0x30161F0, 0x36E682F, 0x36E682F, 0x602C3DF, + 0x7078406, 0xCFB648E, 0xA7F9470, 0x58C7207, 0x53FCA38, 0x33ED923, + 0x2D81935, 0x440F9CA, 0x881F394, 0xB6064D3, 0x933E2E2, 0x683BBE7, + 0x24CF8B9, 0x384AC0F, 0x709581F, 0x3CDBBA7, +}; + +static const int32_t *const hq_quants[NUM_HQ_QUANTS][2][4] = { + { { qmat00, qmat02, qmat06, qmat0E }, { qmat01, qmat03, qmat07, qmat0F } }, + { { qmat02, qmat06, qmat0E, qmat16 }, { qmat03, qmat07, qmat0F, qmat17 } }, + { { qmat04, qmat0A, qmat12, qmat1E }, { qmat05, qmat0B, qmat13, qmat1F } }, + { { qmat06, qmat0E, qmat16, qmat22 }, { qmat07, qmat0F, qmat17, qmat23 } }, + { { qmat08, qmat10, qmat1A, qmat26 }, { qmat09, qmat11, qmat1B, qmat27 } }, + { { qmat0A, qmat12, qmat1E, qmat2A }, { qmat0B, qmat13, qmat1F, qmat2B } }, + { { qmat0C, qmat14, qmat20, qmat2E }, { qmat0D, qmat15, qmat21, qmat2F } }, + { { qmat0E, qmat16, qmat22, qmat30 }, { qmat0F, qmat17, qmat23, qmat31 } }, + { { qmat16, qmat22, qmat30, qmat3E }, { qmat17, qmat23, qmat31, qmat3F } }, + { { qmat18, qmat24, qmat32, qmat40 }, { qmat19, qmat25, qmat33, qmat41 } }, + { { qmat1A, qmat26, qmat34, qmat42 }, { qmat1B, qmat27, qmat35, qmat43 } }, + { { qmat1C, qmat28, qmat36, qmat44 }, { qmat1D, qmat29, qmat37, qmat45 } }, + { { qmat1E, qmat2A, qmat38, qmat46 }, { qmat1F, qmat2B, qmat39, qmat47 } }, + { { qmat20, qmat2E, qmat3C, qmat4A }, { qmat21, qmat2F, qmat3D, qmat4B } }, + { { qmat2C, qmat3A, qmat48, qmat4C }, { qmat2D, qmat3B, qmat49, qmat4D } }, + { { qmat3A, qmat48, qmat4C, qmat4C }, { qmat3B, qmat49, qmat4D, qmat4D } }, +}; + +static const uint8_t hq_ac_bits[NUM_HQ_AC_ENTRIES] = { + 3, 3, 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, 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, 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, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 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 hq_ac_codes[NUM_HQ_AC_ENTRIES] = { + 0x0000, 0x0001, 0x0004, 0x0005, 0x0006, 0x000E, 0x000F, 0x0010, + 0x0011, 0x0012, 0x0013, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, + 0x002D, 0x002E, 0x002F, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, + 0x0065, 0x0066, 0x0067, 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, + 0x00D5, 0x00D6, 0x00D7, 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, + 0x00DD, 0x00DE, 0x00DF, 0x01C0, 0x01C1, 0x01C2, 0x01C3, 0x01C4, + 0x01C5, 0x01C6, 0x01C7, 0x01C8, 0x01C9, 0x01CA, 0x01CB, 0x01CC, + 0x01CD, 0x01CE, 0x01CF, 0x01D0, 0x01D1, 0x01D2, 0x01D3, 0x01D4, + 0x01D5, 0x01D6, 0x01D7, 0x01D8, 0x01D9, 0x01DA, 0x01DB, 0x01DC, + 0x01DD, 0x01DE, 0x01DF, 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, + 0x03C5, 0x03C6, 0x03C7, 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, + 0x03CD, 0x03CE, 0x03CF, 0x03D0, 0x03D1, 0x03D2, 0x03D3, 0x03D4, + 0x03D5, 0x03D6, 0x03D7, 0x03D8, 0x03D9, 0x03DA, 0x03DB, 0x03DC, + 0x03DD, 0x03DE, 0x03DF, 0x07C0, 0x07C1, 0x07C2, 0x07C3, 0x07C4, + 0x07C5, 0x07C6, 0x07C7, 0x07C8, 0x07C9, 0x07CA, 0x07CB, 0x07CC, + 0x07CD, 0x07CE, 0x07CF, 0x0FA0, 0x0FA1, 0x0FA2, 0x0FA3, 0x0FA4, + 0x0FA5, 0x0FA6, 0x0FA7, 0x0FA8, 0x0FA9, 0x0FAA, 0x0FAB, 0x0FAC, + 0x0FAD, 0x0FAE, 0x0FAF, 0x1F60, 0x1F61, 0x1F62, 0x1F63, 0x1F64, + 0x1F65, 0x1F66, 0x1F67, 0x1F68, 0x1F69, 0x1F6A, 0x1F6B, 0x1F6C, + 0x1F6D, 0x1F6E, 0x1F6F, 0x1F70, 0x1F71, 0x1F72, 0x1F73, 0x1F74, + 0x1F75, 0x1F76, 0x1F77, 0x1F78, 0x1F79, 0x1F7A, 0x1F7B, 0x1F7C, + 0x1F7D, 0x1F7E, 0x1F7F, 0x1F80, 0x1F81, 0x1F82, 0x1F83, 0x1F84, + 0x1F85, 0x1F86, 0x1F87, 0x1F88, 0x1F89, 0x1F8A, 0x1F8B, 0x1F8C, + 0x1F8D, 0x1F8E, 0x1F8F, 0x1F90, 0x1F91, 0x1F92, 0x1F93, 0x1F94, + 0x1F95, 0x1F96, 0x1F97, 0x1F98, 0x1F99, 0x1F9A, 0x1F9B, 0x1F9C, + 0x1F9D, 0x1F9E, 0x1F9F, 0x1FA0, 0x1FA1, 0x1FA2, 0x1FA3, 0x1FA4, + 0x1FA5, 0x1FA6, 0x1FA7, 0x1FA8, 0x1FA9, 0x1FAA, 0x1FAB, 0x1FAC, + 0x1FAD, 0x1FAE, 0x1FAF, 0x1FB0, 0x1FB1, 0x1FB2, 0x1FB3, 0x1FB4, + 0x1FB5, 0x1FB6, 0x1FB7, 0x1FB8, 0x1FB9, 0x1FBA, 0x1FBB, 0x1FBC, + 0x1FBD, 0x1FBE, 0x1FBF, 0xFE00, 0xFE02, 0xFE03, 0xFE04, 0xFE05, + 0xFE06, 0xFE07, 0xFE08, 0xFE09, 0xFE0A, 0xFE0B, 0xFE0C, 0xFE0D, + 0xFE0E, 0xFE0F, 0xFE10, 0xFE11, 0xFE12, 0xFE13, 0xFE14, 0xFE15, + 0xFE16, 0xFE17, 0xFE18, 0xFE19, 0xFE1A, 0xFE1B, 0xFE1C, 0xFE1D, + 0xFE1E, 0xFE1F, 0xFE20, 0xFE21, 0xFE22, 0xFE23, 0xFE24, 0xFE25, + 0xFE26, 0xFE27, 0xFE28, 0xFE29, 0xFE2A, 0xFE2B, 0xFE2C, 0xFE2D, + 0xFE2E, 0xFE2F, 0xFE30, 0xFE31, 0xFE32, 0xFE33, 0xFE34, 0xFE35, + 0xFE36, 0xFE37, 0xFE38, 0xFE39, 0xFE3A, 0xFE3B, 0xFE3C, 0xFE3D, + 0xFE3E, 0xFE3F, 0xFE40, 0xFE41, 0xFE42, 0xFE43, 0xFE44, 0xFE45, + 0xFE46, 0xFE47, 0xFE48, 0xFE49, 0xFE4A, 0xFE4B, 0xFE4C, 0xFE4D, + 0xFE4E, 0xFE4F, 0xFE50, 0xFE51, 0xFE52, 0xFE53, 0xFE54, 0xFE55, + 0xFE56, 0xFE57, 0xFE58, 0xFE59, 0xFE5A, 0xFE5B, 0xFE5C, 0xFE5D, + 0xFE5E, 0xFE5F, 0xFE60, 0xFE61, 0xFE62, 0xFE63, 0xFE64, 0xFE65, + 0xFE66, 0xFE67, 0xFE68, 0xFE69, 0xFE6A, 0xFE6B, 0xFE6C, 0xFE6D, + 0xFE6E, 0xFE6F, 0xFE70, 0xFE71, 0xFE72, 0xFE73, 0xFE74, 0xFE75, + 0xFE76, 0xFE77, 0xFE78, 0xFE79, 0xFE7A, 0xFE7B, 0xFE7C, 0xFE7D, + 0xFE7E, 0xFE7F, 0xFE80, 0xFE81, 0xFE82, 0xFE83, 0xFE84, 0xFE85, + 0xFE86, 0xFE87, 0xFE88, 0xFE89, 0xFE8A, 0xFE8B, 0xFE8C, 0xFE8D, + 0xFE8E, 0xFE8F, 0xFE90, 0xFE91, 0xFE92, 0xFE93, 0xFE94, 0xFE95, + 0xFE96, 0xFE97, 0xFE98, 0xFE99, 0xFE9A, 0xFE9B, 0xFE9C, 0xFE9D, + 0xFE9E, 0xFE9F, 0xFEA0, 0xFEA1, 0xFEA2, 0xFEA3, 0xFEA4, 0xFEA5, + 0xFEA6, 0xFEA7, 0xFEA8, 0xFEA9, 0xFEAA, 0xFEAB, 0xFEAC, 0xFEAD, + 0xFEAE, 0xFEAF, 0xFEB0, 0xFEB1, 0xFEB2, 0xFEB3, 0xFEB4, 0xFEB5, + 0xFEB6, 0xFEB7, 0xFEB8, 0xFEB9, 0xFEBA, 0xFEBB, 0xFEBC, 0xFEBD, + 0xFEBE, 0xFEBF, 0xFEC0, 0xFEC1, 0xFEC2, 0xFEC3, 0xFEC4, 0xFEC5, + 0xFEC6, 0xFEC7, 0xFEC8, 0xFEC9, 0xFECA, 0xFECB, 0xFECC, 0xFECD, + 0xFECE, 0xFECF, 0xFED0, 0xFED1, 0xFED2, 0xFED3, 0xFED4, 0xFED5, + 0xFED6, 0xFED7, 0xFED8, 0xFED9, 0xFEDA, 0xFEDB, 0xFEDC, 0xFEDD, + 0xFEDE, 0xFEDF, 0xFEE0, 0xFEE1, 0xFEE2, 0xFEE3, 0xFEE4, 0xFEE5, + 0xFEE6, 0xFEE7, 0xFEE8, 0xFEE9, 0xFEEA, 0xFEEB, 0xFEEC, 0xFEED, + 0xFEEE, 0xFEEF, 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, 0xFF11, 0xFF12, 0xFF13, 0xFF14, 0xFF15, + 0xFF16, 0xFF17, 0xFF18, 0xFF19, 0xFF1A, 0xFF1B, 0xFF1C, 0xFF1D, + 0xFF1E, 0xFF1F, 0xFF20, 0xFF21, 0xFF22, 0xFF23, 0xFF24, 0xFF25, + 0xFF26, 0xFF27, 0xFF28, 0xFF29, 0xFF2A, 0xFF2B, 0xFF2C, 0xFF2D, + 0xFF2E, 0xFF2F, 0xFF30, 0xFF31, 0xFF32, 0xFF33, 0xFF34, 0xFF35, + 0xFF36, 0xFF37, 0xFF38, 0xFF39, 0xFF3A, 0xFF3B, 0xFF3C, 0xFF3D, + 0xFF3E, 0xFF3F, 0xFF40, 0xFF41, 0xFF42, 0xFF43, 0xFF44, 0xFF45, + 0xFF46, 0xFF47, 0xFF48, 0xFF49, 0xFF4A, 0xFF4B, 0xFF4C, 0xFF4D, + 0xFF4E, 0xFF4F, 0xFF50, 0xFF51, 0xFF52, 0xFF53, 0xFF54, 0xFF55, + 0xFF56, 0xFF57, 0xFF58, 0xFF59, 0xFF5A, 0xFF5B, 0xFF5C, 0xFF5D, + 0xFF5E, 0xFF5F, 0xFF60, 0xFF61, 0xFF62, 0xFF63, 0xFF64, 0xFF65, + 0xFF66, 0xFF67, 0xFF68, 0xFF69, 0xFF6A, 0xFF6B, 0xFF6C, 0xFF6D, + 0xFF6E, 0xFF6F, 0xFF70, 0xFF71, 0xFF72, 0xFF73, 0xFF74, 0xFF75, + 0xFF76, 0xFF77, 0xFF78, 0xFF79, 0xFF7A, 0xFF7B, 0xFF7C, 0xFF7D, + 0xFF7E, 0xFF7F, 0xFF80, 0xFF81, 0xFF82, 0xFF83, 0xFF84, 0xFF85, + 0xFF86, 0xFF87, 0xFF88, 0xFF89, 0xFF8A, 0xFF8B, 0xFF8C, 0xFF8D, + 0xFF8E, 0xFF8F, 0xFF90, 0xFF91, 0xFF92, 0xFF93, 0xFF94, 0xFF95, + 0xFF96, 0xFF97, 0xFF98, 0xFF99, 0xFF9A, 0xFF9B, 0xFF9C, 0xFF9D, + 0xFF9E, 0xFF9F, 0xFFA0, 0xFFA1, 0xFFA2, 0xFFA3, 0xFFA4, 0xFFA5, + 0xFFA6, 0xFFA7, 0xFFA8, 0xFFA9, 0xFFAA, 0xFFAB, 0xFFAC, 0xFFAD, + 0xFFAE, 0xFFAF, 0xFFB0, 0xFFB1, 0xFFB2, 0xFFB3, 0xFFB4, 0xFFB5, + 0xFFB6, 0xFFB7, 0xFFB8, 0xFFB9, 0xFFBA, 0xFFBB, 0xFFBC, 0xFFBD, + 0xFFBE, 0xFFBF, 0xFFC0, 0xFFC1, 0xFFC2, 0xFFC3, 0xFFC4, 0xFFC5, + 0xFFC6, 0xFFC7, 0xFFC8, 0xFFC9, 0xFFCA, 0xFFCB, 0xFFCC, 0xFFCD, + 0xFFCE, 0xFFCF, 0xFFD0, 0xFFD1, 0xFFD2, 0xFFD3, 0xFFD4, 0xFFD5, + 0xFFD6, 0xFFD7, 0xFFD8, 0xFFD9, 0xFFDA, 0xFFDB, 0xFFDC, 0xFFDD, + 0xFFDE, 0xFFDF, 0xFFE0, 0xFFE1, 0xFFE2, 0xFFE3, 0xFFE4, 0xFFE5, + 0xFFE6, 0xFFE7, 0xFFE8, 0xFFE9, 0xFFEA, 0xFFEB, 0xFFEC, 0xFFED, + 0xFFEE, 0xFFEF, 0xFFF0, 0xFFF1, 0xFFF2, 0xFFF3, 0xFFF4, 0xFFF5, + 0xFFF6, 0xFFF7, 0xFFF8, 0xFFF9, 0xFFFA, 0xFFFB, 0xFFFC, 0xFFFD, + 0xFFFE, 0xFFFF, +}; + +static const uint8_t hq_ac_skips[NUM_HQ_AC_ENTRIES] = { + 0, 0, 0, 0, 64, 1, 1, 0, 0, 0, 0, 2, 2, 1, 1, 0, + 0, 0, 0, 3, 3, 4, 4, 0, 0, 0, 0, 5, 5, 6, 6, 2, + 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 7, 7, 8, 8, 9, + 9, 10, 10, 3, 3, 4, 4, 2, 2, 1, 1, 1, 1, 1, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 11, 12, 12, 13, + 13, 14, 14, 5, 5, 6, 6, 3, 3, 4, 4, 2, 2, 2, 2, 1, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 3, 3, 3, + 3, 2, 2, 1, 1, 1, 1, 1, 1, 0, 1, 6, 6, 4, 4, 3, + 3, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5, 7, 7, 8, 8, 9, + 9, 10, 10, 7, 7, 8, 8, 4, 4, 3, 3, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 0, 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, 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, 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, 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, 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, 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, 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, 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, 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, +}; + +static const int16_t hq_ac_syms[NUM_HQ_AC_ENTRIES] = { + 1, -1, 2, -2, 0, 1, -1, 3, + -3, 4, -4, 1, -1, 2, -2, 5, + -5, 6, -6, 1, -1, 1, -1, 7, + -7, 8, -8, 1, -1, 1, -1, 2, + -2, 3, -3, 4, -4, 9, -9, 10, + -10, 11, -11, 1, -1, 1, -1, 1, + -1, 1, -1, 2, -2, 2, -2, 3, + -3, 5, -5, 6, -6, 7, -7, 12, + -12, 13, -13, 14, -14, 15, -15, 16, + -16, 17, -17, 1, -1, 1, -1, 1, + -1, 1, -1, 2, -2, 2, -2, 3, + -3, 3, -3, 4, -4, 5, -5, 8, + -8, 18, -18, 19, -19, 20, -20, 21, + -21, 22, -22, 3, -3, 4, -4, 5, + -5, 6, -6, 9, -9, 10, -10, 11, + -11, 0, 0, 3, -3, 4, -4, 6, + -6, 12, -12, 13, -13, 14, -14, 0, + 0, 0, 0, 2, -2, 2, -2, 2, + -2, 2, -2, 3, -3, 3, -3, 5, + -5, 7, -7, 7, -7, 8, -8, 9, + -9, 10, -10, 11, -11, 15, -15, 16, + -16, 17, -17, 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, 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, 32, -32, 33, -33, 34, -34, + 35, -35, 36, -36, 37, -37, 38, -38, + 39, -39, 40, -40, 41, -41, 42, -42, + 43, -43, 44, -44, 45, -45, 46, -46, + 47, -47, 48, -48, 49, -49, 50, -50, + 51, -51, 52, -52, 53, -53, 54, -54, + 55, -55, 56, -56, 57, -57, 58, -58, + 59, -59, 60, -60, 61, -61, 62, -62, + 63, -63, 64, -64, 65, -65, 66, -66, + 67, -67, 68, -68, 69, -69, 70, -70, + 71, -71, 72, -72, 73, -73, 74, -74, + 75, -75, 76, -76, 77, -77, 78, -78, + 79, -79, 80, -80, 81, -81, 82, -82, + 83, -83, 84, -84, 85, -85, 86, -86, + 87, -87, 88, -88, 89, -89, 90, -90, + 91, -91, 92, -92, 93, -93, 94, -94, + 95, -95, 96, -96, 97, -97, 98, -98, + 99, -99, 100, -100, 101, -101, 102, -102, + 103, -103, 104, -104, 105, -105, 106, -106, + 107, -107, 108, -108, 109, -109, 110, -110, + 111, -111, 112, -112, 113, -113, 114, -114, + 115, -115, 116, -116, 117, -117, 118, -118, + 119, -119, 120, -120, 121, -121, 122, -122, + 123, -123, 124, -124, 125, -125, 126, -126, + 127, -127, 128, -128, 129, -129, 130, -130, + 131, -131, 132, -132, 133, -133, 134, -134, + 135, -135, 136, -136, 137, -137, 138, -138, + 139, -139, 140, -140, 141, -141, 142, -142, + 143, -143, 144, -144, 145, -145, 146, -146, + 147, -147, 148, -148, 149, -149, 150, -150, + 151, -151, 152, -152, 153, -153, 154, -154, + 155, -155, 156, -156, 157, -157, 158, -158, + 159, -159, 160, -160, 161, -161, 162, -162, + 163, -163, 164, -164, 165, -165, 166, -166, + 167, -167, 168, -168, 169, -169, 170, -170, + 171, -171, 172, -172, 173, -173, 174, -174, + 175, -175, 176, -176, 177, -177, 178, -178, + 179, -179, 180, -180, 181, -181, 182, -182, + 183, -183, 184, -184, 185, -185, 186, -186, + 187, -187, 188, -188, 189, -189, 190, -190, + 191, -191, 192, -192, 193, -193, 194, -194, + 195, -195, 196, -196, 197, -197, 198, -198, + 199, -199, 200, -200, 201, -201, 202, -202, + 203, -203, 204, -204, 205, -205, 206, -206, + 207, -207, 208, -208, 209, -209, 210, -210, + 211, -211, 212, -212, 213, -213, 214, -214, + 215, -215, 216, -216, 217, -217, 218, -218, + 219, -219, 220, -220, 221, -221, 222, -222, + 223, -223, 224, -224, 225, -225, 226, -226, + 227, -227, 228, -228, 229, -229, 230, -230, + 231, -231, 232, -232, 233, -233, 234, -234, + 235, -235, 236, -236, 237, -237, 238, -238, + 239, -239, 240, -240, 241, -241, 242, -242, + 243, -243, 244, -244, 245, -245, 246, -246, + 247, -247, 248, -248, 249, -249, 250, -250, + 251, -251, 252, -252, 253, -253, 254, -254, + 255, -255, +}; + +/* tables section - one per supported profile */ +static const uint8_t hq_tab_01[] = { + 0, 0, 12, 3, 20, 0, 28, 3, 40, 0, 0, 10, 15, 6, 20, + 10, 35, 6, 40, 10, 7, 13, 15, 16, 23, 13, 35, 16, 39, 13, + 7, 23, 10, 19, 23, 23, 27, 20, 39, 23, 2, 26, 10, 29, 22, + 26, 27, 24, 42, 26, 1, 0, 11, 3, 21, 0, 27, 3, 41, 0, + 1, 10, 16, 6, 21, 10, 35, 7, 41, 10, 6, 13, 16, 16, 22, + 13, 35, 17, 38, 13, 6, 23, 9, 19, 22, 23, 28, 20, 38, 23, + 3, 26, 9, 29, 23, 26, 28, 24, 43, 26, 2, 0, 10, 3, 22, + 0, 27, 4, 42, 0, 2, 10, 17, 6, 22, 10, 34, 7, 42, 10, + 5, 13, 17, 16, 21, 13, 34, 17, 37, 13, 5, 23, 9, 20, 21, + 23, 29, 20, 37, 23, 4, 26, 9, 24, 24, 26, 29, 24, 44, 26, + 3, 0, 9, 3, 23, 0, 28, 4, 43, 0, 3, 10, 17, 7, 23, + 10, 33, 7, 43, 10, 4, 13, 17, 17, 20, 13, 33, 17, 36, 13, + 4, 23, 10, 20, 20, 23, 30, 20, 36, 23, 5, 26, 10, 24, 25, + 26, 30, 24, 44, 27, 4, 0, 9, 4, 24, 0, 29, 4, 44, 0, + 4, 10, 16, 7, 24, 10, 32, 7, 44, 10, 3, 13, 16, 17, 19, + 13, 32, 17, 36, 14, 3, 23, 11, 20, 19, 23, 31, 20, 36, 18, + 6, 26, 11, 24, 26, 26, 31, 24, 43, 27, 5, 0, 10, 4, 25, + 0, 30, 4, 44, 1, 5, 10, 15, 7, 25, 10, 31, 7, 44, 11, + 2, 13, 15, 17, 18, 13, 31, 17, 37, 14, 2, 23, 12, 20, 18, + 23, 32, 20, 37, 18, 7, 26, 12, 24, 26, 27, 32, 24, 42, 27, + 6, 0, 11, 4, 26, 0, 31, 4, 43, 1, 6, 10, 14, 7, 26, + 10, 30, 7, 43, 11, 1, 13, 14, 17, 18, 14, 30, 17, 38, 14, + 1, 23, 13, 20, 18, 18, 33, 20, 38, 18, 8, 26, 13, 24, 25, + 27, 33, 24, 41, 27, 7, 0, 12, 4, 26, 1, 32, 4, 42, 1, + 7, 10, 13, 7, 26, 11, 29, 7, 42, 11, 0, 13, 13, 17, 19, + 14, 29, 17, 39, 14, 0, 23, 14, 20, 19, 18, 34, 20, 39, 18, + 8, 27, 14, 24, 24, 27, 34, 24, 40, 27, 8, 0, 13, 4, 25, + 1, 33, 4, 41, 1, 8, 10, 12, 7, 25, 11, 28, 7, 41, 11, + 0, 14, 12, 17, 20, 14, 28, 17, 40, 14, 0, 18, 15, 20, 20, + 18, 35, 20, 40, 18, 7, 27, 15, 24, 23, 27, 35, 24, 39, 27, + 8, 1, 14, 4, 24, 1, 34, 4, 40, 1, 8, 11, 11, 7, 24, + 11, 27, 7, 40, 11, 1, 14, 11, 17, 21, 14, 27, 17, 41, 14, + 1, 18, 16, 20, 21, 18, 35, 21, 41, 18, 6, 27, 16, 24, 22, + 27, 35, 25, 38, 27, 7, 1, 15, 4, 23, 1, 35, 4, 39, 1, + 7, 11, 10, 7, 23, 11, 27, 8, 39, 11, 2, 14, 10, 17, 22, + 14, 27, 12, 42, 14, 2, 18, 17, 20, 22, 18, 34, 21, 42, 18, + 5, 27, 17, 24, 21, 27, 34, 25, 37, 27, 6, 1, 16, 4, 22, + 1, 35, 5, 38, 1, 6, 11, 9, 7, 22, 11, 28, 8, 38, 11, + 3, 14, 9, 17, 23, 14, 28, 12, 43, 14, 3, 18, 17, 21, 23, + 18, 33, 21, 43, 18, 4, 27, 17, 25, 20, 27, 33, 25, 36, 27, + 5, 1, 17, 4, 21, 1, 34, 5, 37, 1, 5, 11, 9, 8, 21, + 11, 29, 8, 37, 11, 4, 14, 9, 12, 24, 14, 29, 12, 44, 14, + 4, 18, 16, 21, 24, 18, 32, 21, 44, 18, 3, 27, 16, 25, 19, + 27, 32, 25, 36, 28, 4, 1, 17, 5, 20, 1, 33, 5, 36, 1, + 4, 11, 10, 8, 20, 11, 30, 8, 36, 11, 5, 14, 10, 12, 25, + 14, 30, 12, 44, 15, 5, 18, 15, 21, 25, 18, 31, 21, 44, 19, + 2, 27, 15, 25, 18, 27, 31, 25, 37, 28, 3, 1, 16, 5, 19, + 1, 32, 5, 36, 2, 3, 11, 11, 8, 19, 11, 31, 8, 36, 6, + 6, 14, 11, 12, 26, 14, 31, 12, 43, 15, 6, 18, 14, 21, 26, + 18, 30, 21, 43, 19, 1, 27, 14, 25, 18, 28, 30, 25, 38, 28, + 2, 1, 15, 5, 18, 1, 31, 5, 37, 2, 2, 11, 12, 8, 18, + 11, 32, 8, 37, 6, 7, 14, 12, 12, 26, 15, 32, 12, 42, 15, + 7, 18, 13, 21, 26, 19, 29, 21, 42, 19, 0, 27, 13, 25, 19, + 28, 29, 25, 39, 28, 1, 1, 14, 5, 18, 2, 30, 5, 38, 2, + 1, 11, 13, 8, 18, 6, 33, 8, 38, 6, 8, 14, 13, 12, 25, + 15, 33, 12, 41, 15, 8, 18, 12, 21, 25, 19, 28, 21, 41, 19, + 0, 28, 12, 25, 20, 28, 28, 25, 40, 28, 0, 1, 13, 5, 19, + 2, 29, 5, 39, 2, 0, 11, 14, 8, 19, 6, 34, 8, 39, 6, + 8, 15, 14, 12, 24, 15, 34, 12, 40, 15, 8, 19, 11, 21, 24, + 19, 27, 21, 40, 19, 1, 28, 11, 25, 21, 28, 27, 25, 41, 28, + 0, 2, 12, 5, 20, 2, 28, 5, 40, 2, 0, 6, 15, 8, 20, + 6, 35, 8, 40, 6, 7, 15, 15, 12, 23, 15, 35, 12, 39, 15, + 7, 19, 10, 21, 23, 19, 27, 22, 39, 19, 2, 28, 10, 25, 22, + 28, 27, 26, 42, 28, 1, 2, 11, 5, 21, 2, 27, 5, 41, 2, + 1, 6, 16, 8, 21, 6, 35, 9, 41, 6, 6, 15, 16, 12, 22, + 15, 35, 13, 38, 15, 6, 19, 9, 21, 22, 19, 28, 22, 38, 19, + 3, 28, 9, 25, 23, 28, 28, 26, 43, 28, 2, 2, 10, 5, 22, + 2, 27, 0, 42, 2, 2, 6, 17, 8, 22, 6, 34, 9, 42, 6, + 5, 15, 17, 12, 21, 15, 34, 13, 37, 15, 5, 19, 9, 22, 21, + 19, 29, 22, 37, 19, 4, 28, 9, 26, 24, 28, 29, 26, 44, 28, + 3, 2, 9, 5, 23, 2, 28, 0, 43, 2, 3, 6, 17, 9, 23, + 6, 33, 9, 43, 6, 4, 15, 17, 13, 20, 15, 33, 13, 36, 15, + 4, 19, 10, 22, 20, 19, 30, 22, 36, 19, 5, 28, 10, 26, 25, + 28, 30, 26, 44, 29, 4, 2, 9, 0, 24, 2, 29, 0, 44, 2, + 4, 6, 16, 9, 24, 6, 32, 9, 44, 6, 3, 15, 16, 13, 19, + 15, 32, 13, 36, 16, 3, 19, 11, 22, 19, 19, 31, 22, 36, 20, + 6, 28, 11, 26, 26, 28, 31, 26, 43, 29, 5, 2, 10, 0, 25, + 2, 30, 0, 44, 3, 5, 6, 15, 9, 25, 6, 31, 9, 44, 7, + 2, 15, 15, 13, 18, 15, 31, 13, 37, 16, 2, 19, 12, 22, 18, + 19, 32, 22, 37, 20, 7, 28, 12, 26, 26, 29, 32, 26, 42, 29, + 6, 2, 11, 0, 26, 2, 31, 0, 43, 3, 6, 6, 14, 9, 26, + 6, 30, 9, 43, 7, 1, 15, 14, 13, 18, 16, 30, 13, 38, 16, + 1, 19, 13, 22, 18, 20, 33, 22, 38, 20, 8, 28, 13, 26, 25, + 29, 33, 26, 41, 29, 7, 2, 12, 0, 26, 3, 32, 0, 42, 3, + 7, 6, 13, 9, 26, 7, 29, 9, 42, 7, 0, 15, 13, 13, 19, + 16, 29, 13, 39, 16, 0, 19, 14, 22, 19, 20, 34, 22, 39, 20, + 8, 29, 14, 26, 24, 29, 34, 26, 40, 29, 8, 2, 13, 0, 25, + 3, 33, 0, 41, 3, 8, 6, 12, 9, 25, 7, 28, 9, 41, 7, + 0, 16, 12, 13, 20, 16, 28, 13, 40, 16, 0, 20, 15, 22, 20, + 20, 35, 22, 40, 20, 7, 29, 15, 26, 23, 29, 35, 26, 39, 29, + 8, 3, 14, 0, 24, 3, 34, 0, 40, 3, 8, 7, 11, 9, 24, + 7, 27, 9, 40, 7, 1, 16, 11, 13, 21, 16, 27, 13, 41, 16, + 1, 20, 16, 22, 21, 20, 35, 23, 41, 20, 6, 29, 16, 26, 22, + 29, 35, 27, 38, 29, 7, 3, 15, 0, 23, 3, 35, 0, 39, 3, + 7, 7, 10, 9, 23, 7, 27, 10, 39, 7, 2, 16, 10, 13, 22, + 16, 27, 14, 42, 16, 2, 20, 17, 22, 22, 20, 34, 23, 42, 20, + 5, 29, 17, 26, 21, 29, 34, 27, 37, 29, 6, 3, 16, 0, 22, + 3, 35, 1, 38, 3, 6, 7, 9, 9, 22, 7, 28, 10, 38, 7, + 3, 16, 9, 13, 23, 16, 28, 14, 43, 16, 3, 20, 17, 23, 23, + 20, 33, 23, 43, 20, 4, 29, 17, 27, 20, 29, 33, 27, 36, 29, + 5, 3, 17, 0, 21, 3, 34, 1, 37, 3, 5, 7, 9, 10, 21, + 7, 29, 10, 37, 7, 4, 16, 9, 14, 24, 16, 29, 14, 44, 16, + 4, 20, 16, 23, 24, 20, 32, 23, 44, 20, 3, 29, 16, 27, 19, + 29, 32, 27, 36, 24, 4, 3, 17, 1, 20, 3, 33, 1, 36, 3, + 4, 7, 10, 10, 20, 7, 30, 10, 36, 7, 5, 16, 10, 14, 25, + 16, 30, 14, 44, 17, 5, 20, 15, 23, 25, 20, 31, 23, 44, 21, + 2, 29, 15, 27, 18, 29, 31, 27, 37, 24, 3, 3, 16, 1, 19, + 3, 32, 1, 36, 4, 3, 7, 11, 10, 19, 7, 31, 10, 36, 8, + 6, 16, 11, 14, 26, 16, 31, 14, 43, 17, 6, 20, 14, 23, 26, + 20, 30, 23, 43, 21, 1, 29, 14, 27, 18, 24, 30, 27, 38, 24, + 2, 3, 15, 1, 18, 3, 31, 1, 37, 4, 2, 7, 12, 10, 18, + 7, 32, 10, 37, 8, 7, 16, 12, 14, 26, 17, 32, 14, 42, 17, + 7, 20, 13, 23, 26, 21, 29, 23, 42, 21, 0, 29, 13, 27, 19, + 24, 29, 27, 39, 24, 1, 3, 14, 1, 18, 4, 30, 1, 38, 4, + 1, 7, 13, 10, 18, 8, 33, 10, 38, 8, 8, 16, 13, 14, 25, + 17, 33, 14, 41, 17, 8, 20, 12, 23, 25, 21, 28, 23, 41, 21, + 0, 24, 12, 27, 20, 24, 28, 27, 40, 24, 0, 3, 13, 1, 19, + 4, 29, 1, 39, 4, 0, 7, 14, 10, 19, 8, 34, 10, 39, 8, + 8, 17, 14, 14, 24, 17, 34, 14, 40, 17, 8, 21, 11, 23, 24, + 21, 27, 23, 40, 21, 1, 24, 11, 27, 21, 24, 27, 27, 41, 24, + 0, 4, 12, 1, 20, 4, 28, 1, 40, 4, 0, 8, 15, 10, 20, + 8, 35, 10, 40, 8, 7, 17, 15, 14, 23, 17, 35, 14, 39, 17, + 7, 21, 10, 23, 23, 21, 27, 18, 39, 21, 2, 24, 10, 27, 22, + 24, 27, 28, 42, 24, 1, 4, 11, 1, 21, 4, 27, 1, 41, 4, + 1, 8, 16, 10, 21, 8, 35, 11, 41, 8, 6, 17, 16, 14, 22, + 17, 35, 15, 38, 17, 6, 21, 9, 23, 22, 21, 28, 18, 38, 21, + 3, 24, 9, 27, 23, 24, 28, 28, 43, 24, 2, 4, 10, 1, 22, + 4, 27, 2, 42, 4, 2, 8, 17, 10, 22, 8, 34, 11, 42, 8, + 5, 17, 17, 14, 21, 17, 34, 15, 37, 17, 5, 21, 9, 18, 21, + 21, 29, 18, 37, 21, 4, 24, 9, 28, 24, 24, 29, 28, 44, 24, + 3, 4, 9, 1, 23, 4, 28, 2, 43, 4, 3, 8, 17, 11, 23, + 8, 33, 11, 43, 8, 4, 17, 17, 15, 20, 17, 33, 15, 36, 17, + 4, 21, 10, 18, 20, 21, 30, 18, 36, 21, 5, 24, 10, 28, 25, + 24, 30, 28, 44, 25, 4, 4, 9, 2, 24, 4, 29, 2, 44, 4, + 4, 8, 16, 11, 24, 8, 32, 11, 44, 8, 3, 17, 16, 15, 19, + 17, 32, 15, 36, 12, 3, 21, 11, 18, 19, 21, 31, 18, 36, 22, + 6, 24, 11, 28, 26, 24, 31, 28, 43, 25, 5, 4, 10, 2, 25, + 4, 30, 2, 44, 5, 5, 8, 15, 11, 25, 8, 31, 11, 44, 9, + 2, 17, 15, 15, 18, 17, 31, 15, 37, 12, 2, 21, 12, 18, 18, + 21, 32, 18, 37, 22, 7, 24, 12, 28, 26, 25, 32, 28, 42, 25, + 6, 4, 11, 2, 26, 4, 31, 2, 43, 5, 6, 8, 14, 11, 26, + 8, 30, 11, 43, 9, 1, 17, 14, 15, 18, 12, 30, 15, 38, 12, + 1, 21, 13, 18, 18, 22, 33, 18, 38, 22, 8, 24, 13, 28, 25, + 25, 33, 28, 41, 25, 7, 4, 12, 2, 26, 5, 32, 2, 42, 5, + 7, 8, 13, 11, 26, 9, 29, 11, 42, 9, 0, 17, 13, 15, 19, + 12, 29, 15, 39, 12, 0, 21, 14, 18, 19, 22, 34, 18, 39, 22, + 8, 25, 14, 28, 24, 25, 34, 28, 40, 25, 8, 4, 13, 2, 25, + 5, 33, 2, 41, 5, 8, 8, 12, 11, 25, 9, 28, 11, 41, 9, + 0, 12, 12, 15, 20, 12, 28, 15, 40, 12, 0, 22, 15, 18, 20, + 22, 35, 18, 40, 22, 7, 25, 15, 28, 23, 25, 35, 28, 39, 25, + 8, 5, 14, 2, 24, 5, 34, 2, 40, 5, 8, 9, 11, 11, 24, + 9, 27, 11, 40, 9, 1, 12, 11, 15, 21, 12, 27, 15, 41, 12, + 1, 22, 16, 18, 21, 22, 35, 19, 41, 22, 6, 25, 16, 28, 22, + 25, 35, 29, 38, 25, 7, 5, 15, 2, 23, 5, 35, 2, 39, 5, + 7, 9, 10, 11, 23, 9, 27, 6, 39, 9, 2, 12, 10, 15, 22, + 12, 27, 16, 42, 12, 2, 22, 17, 18, 22, 22, 34, 19, 42, 22, + 5, 25, 17, 28, 21, 25, 34, 29, 37, 25, 6, 5, 16, 2, 22, + 5, 35, 3, 38, 5, 6, 9, 9, 11, 22, 9, 28, 6, 38, 9, + 3, 12, 9, 15, 23, 12, 28, 16, 43, 12, 3, 22, 17, 19, 23, + 22, 33, 19, 43, 22, 4, 25, 17, 29, 20, 25, 33, 29, 36, 25, + 5, 5, 17, 2, 21, 5, 34, 3, 37, 5, 5, 9, 9, 6, 21, + 9, 29, 6, 37, 9, 4, 12, 9, 16, 24, 12, 29, 16, 44, 12, + 4, 22, 16, 19, 24, 22, 32, 19, 44, 22, 3, 25, 16, 29, 19, + 25, 32, 29, 36, 26, 4, 5, 17, 3, 20, 5, 33, 3, 36, 5, + 4, 9, 10, 6, 20, 9, 30, 6, 36, 9, 5, 12, 10, 16, 25, + 12, 30, 16, 44, 13, 5, 22, 15, 19, 25, 22, 31, 19, 44, 23, + 2, 25, 15, 29, 18, 25, 31, 29, 37, 26, 3, 5, 16, 3, 19, + 5, 32, 3, 36, 0, 3, 9, 11, 6, 19, 9, 31, 6, 36, 10, + 6, 12, 11, 16, 26, 12, 31, 16, 43, 13, 6, 22, 14, 19, 26, + 22, 30, 19, 43, 23, 1, 25, 14, 29, 18, 26, 30, 29, 38, 26, + 2, 5, 15, 3, 18, 5, 31, 3, 37, 0, 2, 9, 12, 6, 18, + 9, 32, 6, 37, 10, 7, 12, 12, 16, 26, 13, 32, 16, 42, 13, + 7, 22, 13, 19, 26, 23, 29, 19, 42, 23, 0, 25, 13, 29, 19, + 26, 29, 29, 39, 26, 1, 5, 14, 3, 18, 0, 30, 3, 38, 0, + 1, 9, 13, 6, 18, 10, 33, 6, 38, 10, 8, 12, 13, 16, 25, + 13, 33, 16, 41, 13, 8, 22, 12, 19, 25, 23, 28, 19, 41, 23, + 0, 26, 12, 29, 20, 26, 28, 29, 40, 26, 0, 5, 13, 3, 19, + 0, 29, 3, 39, 0, 0, 9, 14, 6, 19, 10, 34, 6, 39, 10, + 8, 13, 14, 16, 24, 13, 34, 16, 40, 13, 8, 23, 11, 19, 24, + 23, 27, 19, 40, 23, 1, 26, 11, 29, 21, 26, 27, 29, 41, 26, +}; + +static const uint8_t hq_tab_02[] = { + 0, 0, 12, 5, 20, 0, 28, 5, 40, 0, 3, 16, 17, 11, 23, + 16, 33, 11, 43, 16, 1, 21, 14, 27, 18, 22, 30, 27, 38, 22, + 1, 0, 11, 5, 21, 0, 27, 5, 41, 0, 4, 16, 16, 11, 24, + 16, 32, 11, 44, 16, 0, 21, 13, 27, 19, 22, 29, 27, 39, 22, + 2, 0, 10, 5, 22, 0, 27, 6, 42, 0, 5, 16, 15, 11, 25, + 16, 31, 11, 44, 17, 0, 22, 12, 27, 20, 22, 28, 27, 40, 22, + 3, 0, 9, 5, 23, 0, 28, 6, 43, 0, 6, 16, 14, 11, 26, + 16, 30, 11, 43, 17, 1, 22, 11, 27, 21, 22, 27, 27, 41, 22, + 4, 0, 9, 6, 24, 0, 29, 6, 44, 0, 7, 16, 13, 11, 26, + 17, 29, 11, 42, 17, 2, 22, 10, 27, 22, 22, 27, 28, 42, 22, + 5, 0, 10, 6, 25, 0, 30, 6, 44, 1, 8, 16, 12, 11, 25, + 17, 28, 11, 41, 17, 3, 22, 9, 27, 23, 22, 28, 28, 43, 22, + 6, 0, 11, 6, 26, 0, 31, 6, 43, 1, 8, 17, 11, 11, 24, + 17, 27, 11, 40, 17, 4, 22, 9, 28, 24, 22, 29, 28, 44, 22, + 7, 0, 12, 6, 26, 1, 32, 6, 42, 1, 7, 17, 10, 11, 23, + 17, 27, 12, 39, 17, 5, 22, 10, 28, 25, 22, 30, 28, 44, 23, + 8, 0, 13, 6, 25, 1, 33, 6, 41, 1, 6, 17, 9, 11, 22, + 17, 28, 12, 38, 17, 6, 22, 11, 28, 26, 22, 31, 28, 43, 23, + 8, 1, 14, 6, 24, 1, 34, 6, 40, 1, 5, 17, 9, 12, 21, + 17, 29, 12, 37, 17, 7, 22, 12, 28, 26, 23, 32, 28, 42, 23, + 7, 1, 15, 6, 23, 1, 35, 6, 39, 1, 4, 17, 10, 12, 20, + 17, 30, 12, 36, 17, 8, 22, 13, 28, 25, 23, 33, 28, 41, 23, + 6, 1, 16, 6, 22, 1, 35, 7, 38, 1, 3, 17, 11, 12, 19, + 17, 31, 12, 36, 18, 8, 23, 14, 28, 24, 23, 34, 28, 40, 23, + 5, 1, 17, 6, 21, 1, 34, 7, 37, 1, 2, 17, 12, 12, 18, + 17, 32, 12, 37, 18, 7, 23, 15, 28, 23, 23, 35, 28, 39, 23, + 4, 1, 17, 7, 20, 1, 33, 7, 36, 1, 1, 17, 13, 12, 18, + 18, 33, 12, 38, 18, 6, 23, 16, 28, 22, 23, 35, 29, 38, 23, + 3, 1, 16, 7, 19, 1, 32, 7, 36, 2, 0, 17, 14, 12, 19, + 18, 34, 12, 39, 18, 5, 23, 17, 28, 21, 23, 34, 29, 37, 23, + 2, 1, 15, 7, 18, 1, 31, 7, 37, 2, 0, 18, 15, 12, 20, + 18, 35, 12, 40, 18, 4, 23, 17, 29, 20, 23, 33, 29, 36, 23, + 1, 1, 14, 7, 18, 2, 30, 7, 38, 2, 1, 18, 16, 12, 21, + 18, 35, 13, 41, 18, 3, 23, 16, 29, 19, 23, 32, 29, 36, 24, + 0, 1, 13, 7, 19, 2, 29, 7, 39, 2, 2, 18, 17, 12, 22, + 18, 34, 13, 42, 18, 2, 23, 15, 29, 18, 23, 31, 29, 37, 24, + 0, 2, 12, 7, 20, 2, 28, 7, 40, 2, 3, 18, 17, 13, 23, + 18, 33, 13, 43, 18, 1, 23, 14, 29, 18, 24, 30, 29, 38, 24, + 1, 2, 11, 7, 21, 2, 27, 7, 41, 2, 4, 18, 16, 13, 24, + 18, 32, 13, 44, 18, 0, 23, 13, 29, 19, 24, 29, 29, 39, 24, + 2, 2, 10, 7, 22, 2, 27, 8, 42, 2, 5, 18, 15, 13, 25, + 18, 31, 13, 44, 19, 0, 24, 12, 29, 20, 24, 28, 29, 40, 24, + 3, 2, 9, 7, 23, 2, 28, 8, 43, 2, 6, 18, 14, 13, 26, + 18, 30, 13, 43, 19, 1, 24, 11, 29, 21, 24, 27, 29, 41, 24, + 4, 2, 9, 8, 24, 2, 29, 8, 44, 2, 7, 18, 13, 13, 26, + 19, 29, 13, 42, 19, 2, 24, 10, 29, 22, 24, 27, 30, 42, 24, + 5, 2, 10, 8, 25, 2, 30, 8, 44, 3, 8, 18, 12, 13, 25, + 19, 28, 13, 41, 19, 3, 24, 9, 29, 23, 24, 28, 30, 43, 24, + 6, 2, 11, 8, 26, 2, 31, 8, 43, 3, 8, 19, 11, 13, 24, + 19, 27, 13, 40, 19, 4, 24, 9, 30, 24, 24, 29, 30, 44, 24, + 7, 2, 12, 8, 26, 3, 32, 8, 42, 3, 7, 19, 10, 13, 23, + 19, 27, 14, 39, 19, 5, 24, 10, 30, 25, 24, 30, 30, 44, 25, + 8, 2, 13, 8, 25, 3, 33, 8, 41, 3, 6, 19, 9, 13, 22, + 19, 28, 14, 38, 19, 6, 24, 11, 30, 26, 24, 31, 30, 43, 25, + 8, 3, 14, 8, 24, 3, 34, 8, 40, 3, 5, 19, 9, 14, 21, + 19, 29, 14, 37, 19, 7, 24, 12, 30, 26, 25, 32, 30, 42, 25, + 7, 3, 15, 8, 23, 3, 35, 8, 39, 3, 4, 19, 10, 14, 20, + 19, 30, 14, 36, 19, 8, 24, 13, 30, 25, 25, 33, 30, 41, 25, + 6, 3, 16, 8, 22, 3, 35, 9, 38, 3, 3, 19, 11, 14, 19, + 19, 31, 14, 36, 20, 8, 25, 14, 30, 24, 25, 34, 30, 40, 25, + 5, 3, 17, 8, 21, 3, 34, 9, 37, 3, 2, 19, 12, 14, 18, + 19, 32, 14, 37, 20, 7, 25, 15, 30, 23, 25, 35, 30, 39, 25, + 4, 3, 17, 9, 20, 3, 33, 9, 36, 3, 1, 19, 13, 14, 18, + 20, 33, 14, 38, 20, 6, 25, 16, 30, 22, 25, 33, 20, 38, 25, + 3, 3, 16, 9, 19, 3, 32, 9, 36, 4, 0, 19, 14, 14, 19, + 20, 34, 14, 39, 20, 5, 25, 17, 30, 21, 25, 34, 20, 37, 25, + 2, 3, 15, 9, 18, 3, 31, 9, 37, 4, 0, 20, 15, 14, 20, + 20, 35, 14, 40, 20, 4, 25, 15, 20, 20, 25, 35, 20, 36, 25, + 1, 3, 14, 9, 18, 4, 30, 9, 38, 4, 1, 20, 16, 14, 21, + 20, 35, 15, 41, 20, 3, 25, 16, 20, 19, 25, 35, 21, 36, 26, + 0, 3, 13, 9, 19, 4, 29, 9, 39, 4, 2, 20, 17, 14, 22, + 20, 34, 15, 39, 10, 2, 25, 17, 20, 18, 25, 34, 21, 37, 26, + 0, 4, 12, 9, 20, 4, 28, 9, 40, 4, 3, 20, 17, 15, 23, + 20, 33, 15, 40, 10, 1, 25, 17, 21, 18, 26, 33, 21, 38, 26, + 1, 4, 11, 9, 21, 4, 27, 9, 41, 4, 4, 20, 16, 15, 21, + 10, 32, 15, 41, 10, 0, 25, 16, 21, 19, 26, 32, 21, 39, 26, + 2, 4, 10, 9, 22, 4, 27, 10, 42, 4, 5, 20, 15, 15, 22, + 10, 31, 15, 42, 10, 0, 26, 15, 21, 20, 26, 31, 21, 40, 26, + 3, 4, 9, 9, 23, 4, 28, 10, 43, 4, 3, 10, 14, 15, 23, + 10, 30, 15, 43, 10, 1, 26, 14, 21, 21, 26, 30, 21, 41, 26, + 4, 4, 9, 10, 24, 4, 29, 10, 44, 4, 4, 10, 13, 15, 24, + 10, 29, 15, 44, 10, 2, 26, 13, 21, 22, 26, 29, 21, 42, 26, + 5, 4, 10, 10, 25, 4, 27, 0, 44, 5, 5, 10, 12, 15, 25, + 10, 28, 15, 44, 11, 3, 26, 12, 21, 23, 26, 28, 21, 43, 26, + 6, 4, 11, 10, 26, 4, 28, 0, 43, 5, 6, 10, 11, 15, 26, + 10, 27, 15, 43, 11, 4, 26, 11, 21, 24, 26, 27, 21, 44, 26, + 7, 4, 9, 0, 26, 5, 29, 0, 42, 5, 7, 10, 10, 15, 26, + 11, 27, 16, 42, 11, 5, 26, 10, 21, 25, 26, 27, 22, 44, 27, + 8, 4, 10, 0, 25, 5, 30, 0, 41, 5, 8, 10, 9, 15, 25, + 11, 28, 16, 41, 11, 6, 26, 9, 21, 26, 26, 28, 22, 43, 27, + 8, 5, 11, 0, 24, 5, 31, 0, 40, 5, 8, 11, 9, 16, 24, + 11, 29, 16, 40, 11, 7, 26, 9, 22, 26, 27, 29, 22, 42, 27, + 7, 5, 12, 0, 23, 5, 32, 0, 39, 5, 7, 11, 10, 16, 23, + 11, 30, 16, 39, 11, 8, 26, 10, 22, 25, 27, 30, 22, 41, 27, + 6, 5, 13, 0, 22, 5, 33, 0, 38, 5, 6, 11, 11, 16, 22, + 11, 31, 16, 38, 11, 8, 27, 11, 22, 24, 27, 31, 22, 40, 27, + 5, 5, 14, 0, 21, 5, 34, 0, 37, 5, 5, 11, 12, 16, 21, + 11, 32, 16, 37, 11, 7, 27, 12, 22, 23, 27, 32, 22, 39, 27, + 4, 5, 15, 0, 20, 5, 35, 0, 36, 5, 4, 11, 13, 16, 20, + 11, 33, 16, 36, 11, 6, 27, 13, 22, 22, 27, 33, 22, 38, 27, + 3, 5, 16, 0, 19, 5, 35, 1, 36, 6, 3, 11, 14, 16, 19, + 11, 34, 16, 36, 12, 5, 27, 14, 22, 21, 27, 34, 22, 37, 27, + 2, 5, 17, 0, 18, 5, 34, 1, 37, 6, 2, 11, 15, 16, 18, + 11, 35, 16, 37, 12, 4, 27, 15, 22, 20, 27, 35, 22, 36, 27, + 1, 5, 17, 1, 18, 6, 33, 1, 38, 6, 1, 11, 16, 16, 18, + 12, 35, 17, 38, 12, 3, 27, 16, 22, 19, 27, 35, 23, 36, 28, + 0, 5, 16, 1, 19, 6, 32, 1, 39, 6, 0, 11, 17, 16, 19, + 12, 34, 17, 39, 12, 2, 27, 17, 22, 18, 27, 34, 23, 37, 28, + 0, 6, 15, 1, 20, 6, 31, 1, 40, 6, 0, 12, 17, 17, 20, + 12, 33, 17, 40, 12, 1, 27, 17, 23, 18, 28, 33, 23, 38, 28, + 1, 6, 14, 1, 21, 6, 30, 1, 41, 6, 1, 12, 16, 17, 21, + 12, 32, 17, 41, 12, 0, 27, 16, 23, 19, 28, 32, 23, 39, 28, + 2, 6, 13, 1, 22, 6, 29, 1, 42, 6, 2, 12, 15, 17, 22, + 12, 31, 17, 42, 12, 0, 28, 15, 23, 20, 28, 31, 23, 40, 28, + 3, 6, 12, 1, 23, 6, 28, 1, 43, 6, 3, 12, 14, 17, 23, + 12, 30, 17, 43, 12, 1, 28, 14, 23, 21, 28, 30, 23, 41, 28, + 4, 6, 11, 1, 24, 6, 27, 1, 44, 6, 4, 12, 13, 17, 24, + 12, 29, 17, 44, 12, 2, 28, 13, 23, 22, 28, 29, 23, 42, 28, + 5, 6, 10, 1, 25, 6, 27, 2, 44, 7, 5, 12, 12, 17, 25, + 12, 28, 17, 44, 13, 3, 28, 12, 23, 23, 28, 28, 23, 43, 28, + 6, 6, 9, 1, 26, 6, 28, 2, 43, 7, 6, 12, 11, 17, 26, + 12, 27, 17, 43, 13, 4, 28, 11, 23, 24, 28, 27, 23, 44, 28, + 7, 6, 9, 2, 26, 7, 29, 2, 42, 7, 7, 12, 10, 17, 26, + 13, 27, 18, 42, 13, 5, 28, 10, 23, 25, 28, 27, 24, 44, 29, + 8, 6, 10, 2, 25, 7, 30, 2, 41, 7, 8, 12, 9, 17, 25, + 13, 28, 18, 41, 13, 6, 28, 9, 23, 26, 28, 28, 24, 43, 29, + 8, 7, 11, 2, 24, 7, 31, 2, 40, 7, 8, 13, 9, 18, 24, + 13, 29, 18, 40, 13, 7, 28, 9, 24, 26, 29, 29, 24, 42, 29, + 7, 7, 12, 2, 23, 7, 32, 2, 39, 7, 7, 13, 10, 18, 23, + 13, 30, 18, 39, 13, 8, 28, 10, 24, 25, 29, 30, 24, 41, 29, + 6, 7, 13, 2, 22, 7, 33, 2, 38, 7, 6, 13, 11, 18, 22, + 13, 31, 18, 38, 13, 8, 29, 11, 24, 24, 29, 31, 24, 40, 29, + 5, 7, 14, 2, 21, 7, 34, 2, 37, 7, 5, 13, 12, 18, 21, + 13, 32, 18, 37, 13, 7, 29, 12, 24, 23, 29, 32, 24, 39, 29, + 4, 7, 15, 2, 20, 7, 35, 2, 36, 7, 4, 13, 13, 18, 20, + 13, 33, 18, 36, 13, 6, 29, 13, 24, 22, 29, 33, 24, 38, 29, + 3, 7, 16, 2, 19, 7, 35, 3, 36, 8, 3, 13, 14, 18, 19, + 13, 34, 18, 36, 14, 5, 29, 14, 24, 21, 29, 34, 24, 37, 29, + 2, 7, 17, 2, 18, 7, 34, 3, 37, 8, 2, 13, 15, 18, 18, + 13, 35, 18, 37, 14, 4, 29, 15, 24, 20, 29, 35, 24, 36, 29, + 1, 7, 17, 3, 18, 8, 33, 3, 38, 8, 1, 13, 16, 18, 18, + 14, 35, 19, 38, 14, 3, 29, 16, 24, 19, 29, 35, 25, 36, 30, + 0, 7, 16, 3, 19, 8, 32, 3, 39, 8, 0, 13, 17, 18, 19, + 14, 34, 19, 39, 14, 2, 29, 17, 24, 18, 29, 34, 25, 37, 30, + 0, 8, 15, 3, 20, 8, 31, 3, 40, 8, 0, 14, 17, 19, 20, + 14, 33, 19, 40, 14, 1, 29, 17, 25, 18, 30, 33, 25, 38, 30, + 1, 8, 14, 3, 21, 8, 30, 3, 41, 8, 1, 14, 16, 19, 21, + 14, 32, 19, 41, 14, 0, 29, 16, 25, 19, 30, 32, 25, 39, 30, + 2, 8, 13, 3, 22, 8, 29, 3, 42, 8, 2, 14, 15, 19, 22, + 14, 31, 19, 42, 14, 0, 30, 15, 25, 20, 30, 31, 25, 40, 30, + 3, 8, 12, 3, 23, 8, 28, 3, 43, 8, 3, 14, 14, 19, 23, + 14, 30, 19, 43, 14, 1, 30, 14, 25, 21, 30, 30, 25, 41, 30, + 4, 8, 11, 3, 24, 8, 27, 3, 44, 8, 4, 14, 13, 19, 24, + 14, 29, 19, 44, 14, 2, 30, 13, 25, 22, 30, 29, 25, 42, 30, + 5, 8, 10, 3, 25, 8, 27, 4, 44, 9, 5, 14, 12, 19, 25, + 14, 28, 19, 44, 15, 3, 30, 12, 25, 23, 30, 28, 25, 43, 30, + 6, 8, 9, 3, 26, 8, 28, 4, 43, 9, 6, 14, 11, 19, 26, + 14, 27, 19, 43, 15, 4, 30, 11, 25, 24, 30, 27, 25, 44, 30, + 7, 8, 9, 4, 26, 9, 29, 4, 42, 9, 7, 14, 10, 19, 26, + 15, 27, 20, 42, 15, 5, 30, 10, 25, 25, 30, 27, 26, 42, 20, + 8, 8, 10, 4, 25, 9, 30, 4, 41, 9, 8, 14, 9, 19, 25, + 15, 28, 20, 41, 15, 6, 30, 9, 25, 26, 30, 28, 26, 43, 20, + 8, 9, 11, 4, 24, 9, 31, 4, 40, 9, 8, 15, 9, 20, 24, + 15, 29, 20, 40, 15, 7, 30, 9, 26, 24, 20, 29, 26, 44, 20, + 7, 9, 12, 4, 23, 9, 32, 4, 39, 9, 7, 15, 10, 20, 23, + 15, 30, 20, 39, 15, 8, 30, 10, 26, 25, 20, 30, 26, 44, 21, + 6, 9, 13, 4, 22, 9, 33, 4, 38, 9, 6, 15, 11, 20, 22, + 15, 31, 20, 38, 15, 6, 20, 11, 26, 26, 20, 31, 26, 43, 21, + 5, 9, 14, 4, 21, 9, 34, 4, 37, 9, 5, 15, 12, 20, 21, + 15, 32, 20, 37, 15, 7, 20, 12, 26, 26, 21, 32, 26, 42, 21, + 4, 9, 15, 4, 20, 9, 35, 4, 36, 9, 4, 15, 13, 20, 20, + 15, 30, 10, 36, 15, 8, 20, 13, 26, 25, 21, 33, 26, 41, 21, + 3, 9, 16, 4, 19, 9, 35, 5, 36, 10, 3, 15, 14, 20, 19, + 15, 31, 10, 36, 16, 8, 21, 14, 26, 24, 21, 34, 26, 40, 21, + 2, 9, 17, 4, 18, 9, 34, 5, 37, 10, 2, 15, 12, 10, 18, + 15, 32, 10, 37, 16, 7, 21, 15, 26, 23, 21, 35, 26, 39, 21, + 1, 9, 17, 5, 18, 10, 33, 5, 38, 10, 1, 15, 13, 10, 18, + 16, 33, 10, 38, 16, 6, 21, 16, 26, 22, 21, 35, 27, 38, 21, + 0, 9, 16, 5, 19, 10, 32, 5, 36, 0, 0, 15, 14, 10, 19, + 16, 34, 10, 39, 16, 5, 21, 17, 26, 21, 21, 34, 27, 37, 21, + 0, 10, 15, 5, 20, 10, 31, 5, 37, 0, 0, 16, 15, 10, 20, + 16, 35, 10, 40, 16, 4, 21, 17, 27, 20, 21, 33, 27, 36, 21, + 1, 10, 14, 5, 18, 0, 30, 5, 38, 0, 1, 16, 16, 10, 21, + 16, 35, 11, 41, 16, 3, 21, 16, 27, 19, 21, 32, 27, 36, 22, + 2, 10, 13, 5, 19, 0, 29, 5, 39, 0, 2, 16, 17, 10, 22, + 16, 34, 11, 42, 16, 2, 21, 15, 27, 18, 21, 31, 27, 37, 22, + 0, 0, +}; + +static const uint8_t hq_tab_03[] = { + 0, 0, 14, 4, 20, 0, 34, 4, 40, 0, 8, 14, 15, 9, 24, + 14, 35, 9, 40, 14, 7, 19, 11, 23, 23, 19, 27, 23, 39, 19, + 1, 33, 10, 28, 21, 33, 27, 29, 41, 33, 1, 0, 15, 4, 21, + 0, 35, 4, 41, 0, 7, 14, 16, 9, 23, 14, 35, 10, 39, 14, + 6, 19, 10, 23, 22, 19, 27, 24, 38, 19, 2, 33, 9, 28, 22, + 33, 28, 29, 42, 33, 2, 0, 16, 4, 22, 0, 35, 5, 42, 0, + 6, 14, 17, 9, 22, 14, 34, 10, 38, 14, 5, 19, 9, 23, 21, + 19, 28, 24, 37, 19, 3, 33, 9, 29, 23, 33, 29, 29, 43, 33, + 3, 0, 17, 4, 23, 0, 34, 5, 43, 0, 5, 14, 17, 10, 21, + 14, 33, 10, 37, 14, 4, 19, 9, 24, 20, 19, 29, 24, 36, 19, + 4, 33, 10, 29, 24, 33, 30, 29, 44, 33, 4, 0, 17, 5, 24, + 0, 33, 5, 44, 0, 4, 14, 16, 10, 20, 14, 32, 10, 36, 14, + 3, 19, 10, 24, 19, 19, 30, 24, 36, 20, 5, 33, 11, 29, 25, + 33, 31, 29, 44, 34, 5, 0, 16, 5, 25, 0, 32, 5, 44, 1, + 3, 14, 15, 10, 19, 14, 31, 10, 36, 15, 2, 19, 11, 24, 18, + 19, 31, 24, 37, 20, 6, 33, 12, 29, 26, 33, 32, 29, 43, 34, + 6, 0, 15, 5, 26, 0, 31, 5, 43, 1, 2, 14, 14, 10, 18, + 14, 30, 10, 37, 15, 1, 19, 12, 24, 18, 20, 32, 24, 38, 20, + 7, 33, 13, 29, 26, 34, 33, 29, 42, 34, 7, 0, 14, 5, 26, + 1, 30, 5, 42, 1, 1, 14, 13, 10, 18, 15, 29, 10, 38, 15, + 0, 19, 13, 24, 19, 20, 33, 24, 39, 20, 8, 33, 14, 29, 25, + 34, 34, 29, 41, 34, 8, 0, 13, 5, 25, 1, 29, 5, 41, 1, + 0, 14, 12, 10, 19, 15, 28, 10, 39, 15, 0, 20, 14, 24, 20, + 20, 34, 24, 40, 20, 8, 34, 15, 29, 24, 34, 35, 29, 40, 34, + 8, 1, 12, 5, 24, 1, 28, 5, 40, 1, 0, 15, 11, 10, 20, + 15, 27, 10, 40, 15, 1, 20, 15, 24, 21, 20, 35, 24, 41, 20, + 7, 34, 16, 29, 23, 34, 35, 30, 39, 34, 7, 1, 11, 5, 23, + 1, 27, 5, 39, 1, 1, 15, 10, 10, 21, 15, 27, 11, 41, 15, + 2, 20, 16, 24, 22, 20, 35, 25, 42, 20, 6, 34, 17, 29, 22, + 34, 34, 30, 38, 34, 6, 1, 10, 5, 22, 1, 27, 6, 38, 1, + 2, 15, 9, 10, 22, 15, 28, 11, 42, 15, 3, 20, 17, 24, 23, + 20, 34, 25, 43, 20, 5, 34, 17, 30, 21, 34, 33, 30, 37, 34, + 5, 1, 9, 5, 21, 1, 28, 6, 37, 1, 3, 15, 9, 11, 23, + 15, 29, 11, 43, 15, 4, 20, 17, 25, 24, 20, 33, 25, 44, 20, + 4, 34, 16, 30, 20, 34, 32, 30, 36, 34, 4, 1, 9, 6, 20, + 1, 29, 6, 36, 1, 4, 15, 10, 11, 24, 15, 30, 11, 44, 15, + 5, 20, 16, 25, 25, 20, 32, 25, 44, 21, 3, 34, 15, 30, 19, + 34, 31, 30, 36, 35, 3, 1, 10, 6, 19, 1, 30, 6, 36, 2, + 5, 15, 11, 11, 25, 15, 31, 11, 44, 16, 6, 20, 15, 25, 26, + 20, 31, 25, 43, 21, 2, 34, 14, 30, 18, 34, 30, 30, 37, 35, + 2, 1, 11, 6, 18, 1, 31, 6, 37, 2, 6, 15, 12, 11, 26, + 15, 32, 11, 43, 16, 7, 20, 14, 25, 26, 21, 30, 25, 42, 21, + 1, 34, 13, 30, 18, 35, 29, 30, 38, 35, 1, 1, 12, 6, 18, + 2, 32, 6, 38, 2, 7, 15, 13, 11, 26, 16, 33, 11, 42, 16, + 8, 20, 13, 25, 25, 21, 29, 25, 41, 21, 0, 34, 12, 30, 19, + 35, 28, 30, 39, 35, 0, 1, 13, 6, 19, 2, 33, 6, 39, 2, + 8, 15, 14, 11, 25, 16, 34, 11, 41, 16, 8, 21, 12, 25, 24, + 21, 28, 25, 40, 21, 0, 35, 11, 30, 20, 35, 27, 30, 40, 35, + 0, 2, 14, 6, 20, 2, 34, 6, 40, 2, 8, 16, 15, 11, 24, + 16, 35, 11, 40, 16, 7, 21, 11, 25, 23, 21, 27, 25, 39, 21, + 1, 35, 10, 30, 21, 35, 27, 31, 41, 35, 1, 2, 15, 6, 21, + 2, 35, 6, 41, 2, 7, 16, 16, 11, 23, 16, 35, 12, 39, 16, + 6, 21, 10, 25, 22, 21, 27, 26, 38, 21, 2, 35, 9, 30, 22, + 35, 28, 31, 42, 35, 2, 2, 16, 6, 22, 2, 35, 7, 42, 2, + 6, 16, 17, 11, 22, 16, 34, 12, 38, 16, 5, 21, 9, 25, 21, + 21, 28, 26, 37, 21, 3, 35, 9, 31, 23, 35, 29, 31, 43, 35, + 3, 2, 17, 6, 23, 2, 34, 7, 43, 2, 5, 16, 17, 12, 21, + 16, 33, 12, 37, 16, 4, 21, 9, 26, 20, 21, 29, 26, 36, 21, + 4, 35, 10, 31, 24, 35, 30, 31, 44, 35, 4, 2, 17, 7, 24, + 2, 33, 7, 44, 2, 4, 16, 16, 12, 20, 16, 32, 12, 36, 16, + 3, 21, 10, 26, 19, 21, 30, 26, 36, 22, 5, 35, 11, 31, 25, + 35, 31, 31, 36, 27, 5, 2, 16, 7, 25, 2, 32, 7, 44, 3, + 3, 16, 15, 12, 19, 16, 31, 12, 36, 17, 2, 21, 11, 26, 18, + 21, 31, 26, 37, 22, 6, 35, 12, 31, 26, 35, 32, 31, 37, 27, + 6, 2, 15, 7, 26, 2, 31, 7, 43, 3, 2, 16, 14, 12, 18, + 16, 30, 12, 37, 17, 1, 21, 12, 26, 18, 22, 32, 26, 38, 22, + 7, 35, 13, 31, 18, 27, 33, 31, 38, 27, 7, 2, 14, 7, 26, + 3, 30, 7, 42, 3, 1, 16, 13, 12, 18, 17, 29, 12, 38, 17, + 0, 21, 13, 26, 19, 22, 33, 26, 39, 22, 8, 35, 14, 31, 19, + 27, 34, 31, 39, 27, 8, 2, 13, 7, 25, 3, 29, 7, 41, 3, + 0, 16, 12, 12, 19, 17, 28, 12, 39, 17, 0, 22, 14, 26, 20, + 22, 34, 26, 40, 22, 0, 27, 15, 31, 20, 27, 35, 31, 40, 27, + 8, 3, 12, 7, 24, 3, 28, 7, 40, 3, 0, 17, 11, 12, 20, + 17, 27, 12, 40, 17, 1, 22, 15, 26, 21, 22, 35, 26, 41, 22, + 1, 27, 16, 31, 21, 27, 35, 32, 41, 27, 7, 3, 11, 7, 23, + 3, 27, 7, 39, 3, 1, 17, 10, 12, 21, 17, 27, 13, 41, 17, + 2, 22, 16, 26, 22, 22, 27, 18, 42, 22, 2, 27, 17, 31, 22, + 27, 34, 32, 42, 27, 6, 3, 10, 7, 22, 3, 27, 8, 38, 3, + 2, 17, 9, 12, 22, 17, 28, 13, 42, 17, 3, 22, 17, 26, 23, + 22, 28, 18, 43, 22, 3, 27, 17, 32, 23, 27, 33, 32, 43, 27, + 5, 3, 9, 7, 21, 3, 28, 8, 37, 3, 3, 17, 9, 13, 23, + 17, 29, 13, 43, 17, 4, 22, 9, 18, 24, 22, 29, 18, 44, 22, + 4, 27, 16, 32, 24, 27, 32, 32, 44, 27, 4, 3, 9, 8, 20, + 3, 29, 8, 36, 3, 4, 17, 10, 13, 24, 17, 30, 13, 44, 17, + 5, 22, 10, 18, 25, 22, 30, 18, 44, 23, 5, 27, 15, 32, 25, + 27, 31, 32, 44, 28, 3, 3, 10, 8, 19, 3, 30, 8, 36, 4, + 5, 17, 11, 13, 25, 17, 31, 13, 36, 9, 6, 22, 11, 18, 26, + 22, 31, 18, 43, 23, 6, 27, 14, 32, 26, 27, 30, 32, 43, 28, + 2, 3, 11, 8, 18, 3, 31, 8, 37, 4, 6, 17, 12, 13, 26, + 17, 32, 13, 37, 9, 7, 22, 12, 18, 26, 23, 32, 18, 42, 23, + 7, 27, 13, 32, 26, 28, 29, 32, 42, 28, 1, 3, 12, 8, 18, + 4, 32, 8, 38, 4, 7, 17, 13, 13, 18, 9, 33, 13, 38, 9, + 8, 22, 13, 18, 25, 23, 33, 18, 41, 23, 8, 27, 12, 32, 25, + 28, 28, 32, 41, 28, 0, 3, 13, 8, 19, 4, 33, 8, 39, 4, + 8, 17, 14, 13, 19, 9, 34, 13, 39, 9, 8, 23, 14, 18, 24, + 23, 34, 18, 40, 23, 8, 28, 11, 32, 24, 28, 27, 32, 40, 28, + 0, 4, 14, 8, 20, 4, 34, 8, 40, 4, 0, 9, 15, 13, 20, + 9, 35, 13, 40, 9, 7, 23, 15, 18, 23, 23, 35, 18, 39, 23, + 7, 28, 10, 32, 23, 28, 27, 33, 39, 28, 1, 4, 15, 8, 21, + 4, 35, 8, 41, 4, 1, 9, 16, 13, 21, 9, 35, 14, 41, 9, + 6, 23, 16, 18, 22, 23, 35, 19, 38, 23, 6, 28, 9, 32, 22, + 28, 28, 33, 38, 28, 2, 4, 16, 8, 22, 4, 27, 0, 42, 4, + 2, 9, 17, 13, 22, 9, 34, 14, 42, 9, 5, 23, 17, 18, 21, + 23, 34, 19, 37, 23, 5, 28, 9, 33, 21, 28, 29, 33, 37, 28, + 3, 4, 17, 8, 23, 4, 28, 0, 43, 4, 3, 9, 17, 14, 23, + 9, 33, 14, 43, 9, 4, 23, 17, 19, 20, 23, 33, 19, 36, 23, + 4, 28, 10, 33, 20, 28, 30, 33, 36, 28, 4, 4, 9, 0, 24, + 4, 29, 0, 44, 4, 4, 9, 16, 14, 24, 9, 32, 14, 44, 9, + 3, 23, 16, 19, 19, 23, 32, 19, 36, 24, 3, 28, 11, 33, 19, + 28, 31, 33, 36, 29, 5, 4, 10, 0, 25, 4, 30, 0, 44, 5, + 5, 9, 15, 14, 25, 9, 31, 14, 44, 10, 2, 23, 15, 19, 18, + 23, 31, 19, 37, 24, 2, 28, 12, 33, 18, 28, 32, 33, 37, 29, + 6, 4, 11, 0, 26, 4, 31, 0, 43, 5, 6, 9, 14, 14, 26, + 9, 30, 14, 43, 10, 1, 23, 14, 19, 18, 24, 30, 19, 38, 24, + 1, 28, 13, 33, 18, 29, 33, 33, 38, 29, 7, 4, 12, 0, 26, + 5, 32, 0, 42, 5, 7, 9, 13, 14, 26, 10, 29, 14, 42, 10, + 0, 23, 13, 19, 19, 24, 29, 19, 39, 24, 0, 28, 14, 33, 19, + 29, 34, 33, 39, 29, 8, 4, 13, 0, 25, 5, 33, 0, 41, 5, + 8, 9, 12, 14, 25, 10, 28, 14, 41, 10, 0, 24, 12, 19, 20, + 24, 28, 19, 40, 24, 0, 29, 15, 33, 20, 29, 35, 33, 40, 29, + 8, 5, 14, 0, 24, 5, 34, 0, 40, 5, 8, 10, 11, 14, 24, + 10, 27, 14, 40, 10, 1, 24, 11, 19, 21, 24, 27, 19, 41, 24, + 1, 29, 16, 33, 21, 29, 35, 34, 41, 29, 7, 5, 15, 0, 23, + 5, 35, 0, 39, 5, 7, 10, 10, 14, 23, 10, 27, 15, 39, 10, + 2, 24, 10, 19, 22, 24, 27, 20, 42, 24, 2, 29, 17, 33, 22, + 29, 34, 34, 42, 29, 6, 5, 16, 0, 22, 5, 35, 1, 38, 5, + 6, 10, 9, 14, 22, 10, 28, 15, 38, 10, 3, 24, 9, 19, 23, + 24, 28, 20, 43, 24, 3, 29, 17, 34, 23, 29, 33, 34, 43, 29, + 5, 5, 17, 0, 21, 5, 34, 1, 37, 5, 5, 10, 9, 15, 21, + 10, 29, 15, 37, 10, 4, 24, 9, 20, 24, 24, 29, 20, 44, 24, + 4, 29, 16, 34, 24, 29, 32, 34, 44, 29, 4, 5, 17, 1, 20, + 5, 33, 1, 36, 5, 4, 10, 10, 15, 20, 10, 30, 15, 36, 10, + 5, 24, 10, 20, 25, 24, 30, 20, 44, 25, 5, 29, 15, 34, 25, + 29, 31, 34, 44, 30, 3, 5, 16, 1, 19, 5, 32, 1, 36, 6, + 3, 10, 11, 15, 19, 10, 31, 15, 36, 11, 6, 24, 11, 20, 26, + 24, 31, 20, 43, 25, 6, 29, 14, 34, 26, 29, 30, 34, 43, 30, + 2, 5, 15, 1, 18, 5, 31, 1, 37, 6, 2, 10, 12, 15, 18, + 10, 32, 15, 37, 11, 7, 24, 12, 20, 26, 25, 32, 20, 42, 25, + 7, 29, 13, 34, 26, 30, 29, 34, 42, 30, 1, 5, 14, 1, 18, + 6, 30, 1, 38, 6, 1, 10, 13, 15, 18, 11, 33, 15, 38, 11, + 8, 24, 13, 20, 25, 25, 33, 20, 41, 25, 8, 29, 12, 34, 25, + 30, 28, 34, 41, 30, 0, 5, 13, 1, 19, 6, 29, 1, 39, 6, + 0, 10, 14, 15, 19, 11, 34, 15, 39, 11, 8, 25, 14, 20, 24, + 25, 34, 20, 40, 25, 8, 30, 11, 34, 24, 30, 27, 34, 40, 30, + 0, 6, 12, 1, 20, 6, 28, 1, 40, 6, 0, 11, 15, 15, 20, + 11, 35, 15, 40, 11, 7, 25, 15, 20, 23, 25, 35, 20, 39, 25, + 7, 30, 10, 34, 23, 30, 27, 35, 39, 30, 1, 6, 11, 1, 21, + 6, 27, 1, 41, 6, 1, 11, 16, 15, 21, 11, 35, 16, 41, 11, + 6, 25, 16, 20, 22, 25, 35, 21, 38, 25, 6, 30, 9, 34, 22, + 30, 28, 35, 38, 30, 2, 6, 10, 1, 22, 6, 27, 2, 42, 6, + 2, 11, 17, 15, 22, 11, 34, 16, 42, 11, 5, 25, 17, 20, 21, + 25, 34, 21, 37, 25, 5, 30, 9, 35, 21, 30, 29, 35, 37, 30, + 3, 6, 9, 1, 23, 6, 28, 2, 43, 6, 3, 11, 17, 16, 23, + 11, 33, 16, 43, 11, 4, 25, 17, 21, 20, 25, 33, 21, 36, 25, + 4, 30, 10, 35, 20, 30, 30, 35, 36, 30, 4, 6, 9, 2, 24, + 6, 29, 2, 44, 6, 4, 11, 16, 16, 24, 11, 32, 16, 44, 11, + 3, 25, 16, 21, 19, 25, 32, 21, 36, 26, 3, 30, 11, 35, 19, + 30, 31, 35, 36, 31, 5, 6, 10, 2, 25, 6, 30, 2, 44, 7, + 5, 11, 15, 16, 25, 11, 31, 16, 44, 12, 2, 25, 15, 21, 18, + 25, 31, 21, 37, 26, 2, 30, 12, 35, 18, 30, 32, 35, 37, 31, + 6, 6, 11, 2, 26, 6, 31, 2, 43, 7, 6, 11, 14, 16, 26, + 11, 30, 16, 43, 12, 1, 25, 14, 21, 18, 26, 30, 21, 38, 26, + 1, 30, 13, 35, 18, 31, 33, 35, 38, 31, 7, 6, 12, 2, 26, + 7, 32, 2, 42, 7, 7, 11, 13, 16, 26, 12, 29, 16, 42, 12, + 0, 25, 13, 21, 19, 26, 29, 21, 39, 26, 0, 30, 14, 35, 19, + 31, 34, 35, 39, 31, 8, 6, 13, 2, 25, 7, 33, 2, 41, 7, + 8, 11, 12, 16, 25, 12, 28, 16, 41, 12, 0, 26, 12, 21, 20, + 26, 28, 21, 40, 26, 0, 31, 15, 35, 20, 31, 35, 35, 40, 31, + 8, 7, 14, 2, 24, 7, 34, 2, 40, 7, 8, 12, 11, 16, 24, + 12, 27, 16, 40, 12, 1, 26, 11, 21, 21, 26, 27, 21, 41, 26, + 1, 31, 16, 35, 21, 31, 27, 27, 41, 31, 7, 7, 15, 2, 23, + 7, 35, 2, 39, 7, 7, 12, 10, 16, 23, 12, 27, 17, 39, 12, + 2, 26, 10, 21, 22, 26, 27, 22, 42, 26, 2, 31, 17, 35, 22, + 31, 28, 27, 42, 31, 6, 7, 16, 2, 22, 7, 35, 3, 38, 7, + 6, 12, 9, 16, 22, 12, 28, 17, 38, 12, 3, 26, 9, 21, 23, + 26, 28, 22, 43, 26, 3, 31, 9, 27, 23, 31, 29, 27, 43, 31, + 5, 7, 17, 2, 21, 7, 34, 3, 37, 7, 5, 12, 9, 17, 21, + 12, 29, 17, 37, 12, 4, 26, 9, 22, 24, 26, 29, 22, 44, 26, + 4, 31, 10, 27, 24, 31, 30, 27, 44, 31, 4, 7, 17, 3, 20, + 7, 33, 3, 36, 7, 4, 12, 10, 17, 20, 12, 30, 17, 36, 12, + 5, 26, 10, 22, 25, 26, 30, 22, 36, 18, 5, 31, 11, 27, 25, + 31, 31, 27, 44, 32, 3, 7, 16, 3, 19, 7, 32, 3, 36, 8, + 3, 12, 11, 17, 19, 12, 31, 17, 36, 13, 6, 26, 11, 22, 26, + 26, 31, 22, 37, 18, 6, 31, 12, 27, 26, 31, 32, 27, 43, 32, + 2, 7, 15, 3, 18, 7, 31, 3, 37, 8, 2, 12, 12, 17, 18, + 12, 32, 17, 37, 13, 7, 26, 12, 22, 18, 18, 32, 22, 38, 18, + 7, 31, 13, 27, 26, 32, 33, 27, 42, 32, 1, 7, 14, 3, 18, + 8, 30, 3, 38, 8, 1, 12, 13, 17, 18, 13, 33, 17, 38, 13, + 8, 26, 13, 22, 19, 18, 33, 22, 39, 18, 8, 31, 14, 27, 25, + 32, 34, 27, 41, 32, 0, 7, 13, 3, 19, 8, 29, 3, 39, 8, + 0, 12, 14, 17, 19, 13, 34, 17, 39, 13, 0, 18, 14, 22, 20, + 18, 34, 22, 40, 18, 8, 32, 15, 27, 24, 32, 35, 27, 40, 32, + 0, 8, 12, 3, 20, 8, 28, 3, 40, 8, 0, 13, 15, 17, 20, + 13, 35, 17, 40, 13, 1, 18, 15, 22, 21, 18, 35, 22, 41, 18, + 7, 32, 16, 27, 23, 32, 35, 28, 39, 32, 1, 8, 11, 3, 21, + 8, 27, 3, 41, 8, 1, 13, 16, 17, 21, 13, 27, 9, 41, 13, + 2, 18, 16, 22, 22, 18, 35, 23, 42, 18, 6, 32, 17, 27, 22, + 32, 34, 28, 38, 32, 2, 8, 10, 3, 22, 8, 27, 4, 42, 8, + 2, 13, 17, 17, 22, 13, 28, 9, 42, 13, 3, 18, 17, 22, 23, + 18, 34, 23, 43, 18, 5, 32, 17, 28, 21, 32, 33, 28, 37, 32, + 3, 8, 9, 3, 23, 8, 28, 4, 43, 8, 3, 13, 9, 9, 23, + 13, 29, 9, 43, 13, 4, 18, 17, 23, 24, 18, 33, 23, 44, 18, + 4, 32, 16, 28, 20, 32, 32, 28, 36, 32, 4, 8, 9, 4, 24, + 8, 29, 4, 44, 8, 4, 13, 10, 9, 24, 13, 30, 9, 44, 13, + 5, 18, 16, 23, 25, 18, 32, 23, 44, 19, 3, 32, 15, 28, 19, + 32, 31, 28, 36, 33, 5, 8, 10, 4, 25, 8, 30, 4, 36, 0, + 5, 13, 11, 9, 25, 13, 31, 9, 44, 14, 6, 18, 15, 23, 26, + 18, 31, 23, 43, 19, 2, 32, 14, 28, 18, 32, 30, 28, 37, 33, + 6, 8, 11, 4, 26, 8, 31, 4, 37, 0, 6, 13, 12, 9, 26, + 13, 32, 9, 43, 14, 7, 18, 14, 23, 26, 19, 30, 23, 42, 19, + 1, 32, 13, 28, 18, 33, 29, 28, 38, 33, 7, 8, 12, 4, 18, + 0, 32, 4, 38, 0, 7, 13, 13, 9, 26, 14, 33, 9, 42, 14, + 8, 18, 13, 23, 25, 19, 29, 23, 41, 19, 0, 32, 12, 28, 19, + 33, 28, 28, 39, 33, 8, 8, 13, 4, 19, 0, 33, 4, 39, 0, + 8, 13, 14, 9, 25, 14, 34, 9, 41, 14, 8, 19, 12, 23, 24, + 19, 28, 23, 40, 19, 0, 33, 11, 28, 20, 33, 27, 28, 40, 33, +}; + +static const uint8_t hq_tab_04[] = { + 0, 0, 19, 4, 26, 0, 45, 4, 52, 0, 11, 13, 18, 9, 34, + 14, 44, 9, 56, 14, 10, 18, 18, 23, 35, 19, 40, 23, 57, 19, + 2, 32, 19, 28, 24, 32, 41, 28, 49, 33, 3, 37, 15, 42, 25, + 37, 41, 42, 48, 38, 1, 0, 20, 4, 27, 0, 46, 4, 53, 0, + 11, 14, 19, 9, 33, 14, 45, 9, 55, 14, 11, 18, 17, 23, 34, + 19, 39, 23, 56, 19, 1, 32, 18, 28, 24, 33, 40, 28, 50, 33, + 2, 37, 16, 42, 24, 37, 42, 42, 49, 38, 2, 0, 21, 4, 28, + 0, 47, 4, 54, 0, 10, 14, 20, 9, 32, 14, 46, 9, 54, 14, + 11, 19, 16, 23, 33, 19, 38, 23, 55, 19, 0, 32, 17, 28, 25, + 33, 39, 28, 51, 33, 1, 37, 17, 42, 24, 38, 43, 42, 50, 38, + 3, 0, 22, 4, 29, 0, 47, 5, 55, 0, 9, 14, 21, 9, 31, + 14, 47, 9, 53, 14, 10, 19, 15, 23, 32, 19, 37, 23, 54, 19, + 0, 33, 16, 28, 26, 33, 38, 28, 52, 33, 0, 37, 18, 42, 25, + 38, 44, 42, 51, 38, 4, 0, 23, 4, 30, 0, 46, 5, 56, 0, + 8, 14, 22, 9, 30, 14, 47, 10, 52, 14, 9, 19, 14, 23, 31, + 19, 36, 23, 53, 19, 1, 33, 15, 28, 27, 33, 37, 28, 53, 33, + 0, 38, 19, 42, 26, 38, 45, 42, 52, 38, 5, 0, 23, 5, 31, + 0, 45, 5, 57, 0, 7, 14, 23, 9, 29, 14, 46, 10, 51, 14, + 8, 19, 13, 23, 30, 19, 36, 24, 52, 19, 2, 33, 14, 28, 28, + 33, 36, 28, 54, 33, 1, 38, 20, 42, 27, 38, 46, 42, 53, 38, + 6, 0, 22, 5, 32, 0, 44, 5, 58, 0, 6, 14, 23, 10, 28, + 14, 45, 10, 50, 14, 7, 19, 12, 23, 29, 19, 37, 24, 51, 19, + 3, 33, 13, 28, 29, 33, 36, 29, 55, 33, 2, 38, 21, 42, 28, + 38, 47, 42, 54, 38, 7, 0, 21, 5, 33, 0, 43, 5, 59, 0, + 5, 14, 22, 10, 27, 14, 44, 10, 49, 14, 6, 19, 12, 24, 28, + 19, 38, 24, 50, 19, 4, 33, 12, 28, 30, 33, 37, 29, 56, 33, + 3, 38, 22, 42, 29, 38, 47, 43, 55, 38, 8, 0, 20, 5, 34, + 0, 42, 5, 59, 1, 4, 14, 21, 10, 26, 14, 43, 10, 48, 14, + 5, 19, 13, 24, 27, 19, 39, 24, 49, 19, 5, 33, 12, 29, 31, + 33, 38, 29, 57, 33, 4, 38, 23, 42, 30, 38, 46, 43, 56, 38, + 9, 0, 19, 5, 35, 0, 41, 5, 58, 1, 3, 14, 20, 10, 25, + 14, 42, 10, 48, 15, 4, 19, 14, 24, 26, 19, 40, 24, 48, 19, + 6, 33, 13, 29, 32, 33, 39, 29, 58, 33, 5, 38, 23, 43, 31, + 38, 45, 43, 57, 38, 10, 0, 18, 5, 35, 1, 40, 5, 57, 1, + 2, 14, 19, 10, 24, 14, 41, 10, 49, 15, 3, 19, 15, 24, 25, + 19, 41, 24, 48, 20, 7, 33, 14, 29, 33, 33, 40, 29, 59, 33, + 6, 38, 22, 43, 32, 38, 44, 43, 58, 38, 11, 0, 17, 5, 34, + 1, 39, 5, 56, 1, 1, 14, 18, 10, 24, 15, 40, 10, 50, 15, + 2, 19, 16, 24, 24, 19, 42, 24, 49, 20, 8, 33, 15, 29, 34, + 33, 41, 29, 59, 34, 7, 38, 21, 43, 33, 38, 43, 43, 59, 38, + 11, 1, 16, 5, 33, 1, 38, 5, 55, 1, 0, 14, 17, 10, 25, + 15, 39, 10, 51, 15, 1, 19, 17, 24, 24, 20, 43, 24, 50, 20, + 9, 33, 16, 29, 35, 33, 42, 29, 58, 34, 8, 38, 20, 43, 34, + 38, 42, 43, 59, 39, 10, 1, 15, 5, 32, 1, 37, 5, 54, 1, + 0, 15, 16, 10, 26, 15, 38, 10, 52, 15, 0, 19, 18, 24, 25, + 20, 44, 24, 51, 20, 10, 33, 17, 29, 35, 34, 43, 29, 57, 34, + 9, 38, 19, 43, 35, 38, 41, 43, 58, 39, 9, 1, 14, 5, 31, + 1, 36, 5, 53, 1, 1, 15, 15, 10, 27, 15, 37, 10, 53, 15, + 0, 20, 19, 24, 26, 20, 45, 24, 52, 20, 11, 33, 18, 29, 34, + 34, 44, 29, 56, 34, 10, 38, 18, 43, 35, 39, 40, 43, 57, 39, + 8, 1, 13, 5, 30, 1, 36, 6, 52, 1, 2, 15, 14, 10, 28, + 15, 36, 10, 54, 15, 1, 20, 20, 24, 27, 20, 46, 24, 53, 20, + 11, 34, 19, 29, 33, 34, 45, 29, 55, 34, 11, 38, 17, 43, 34, + 39, 39, 43, 56, 39, 7, 1, 12, 5, 29, 1, 37, 6, 51, 1, + 3, 15, 13, 10, 29, 15, 36, 11, 55, 15, 2, 20, 21, 24, 28, + 20, 47, 24, 54, 20, 10, 34, 20, 29, 32, 34, 46, 29, 54, 34, + 11, 39, 16, 43, 33, 39, 38, 43, 55, 39, 6, 1, 12, 6, 28, + 1, 38, 6, 50, 1, 4, 15, 12, 10, 30, 15, 37, 11, 56, 15, + 3, 20, 22, 24, 29, 20, 47, 25, 55, 20, 9, 34, 21, 29, 31, + 34, 47, 29, 53, 34, 10, 39, 15, 43, 32, 39, 37, 43, 54, 39, + 5, 1, 13, 6, 27, 1, 39, 6, 49, 1, 5, 15, 12, 11, 31, + 15, 38, 11, 57, 15, 4, 20, 23, 24, 30, 20, 46, 25, 56, 20, + 8, 34, 22, 29, 30, 34, 47, 30, 52, 34, 9, 39, 14, 43, 31, + 39, 36, 43, 53, 39, 4, 1, 14, 6, 26, 1, 40, 6, 48, 1, + 6, 15, 13, 11, 32, 15, 39, 11, 58, 15, 5, 20, 23, 25, 31, + 20, 45, 25, 57, 20, 7, 34, 23, 29, 29, 34, 46, 30, 51, 34, + 8, 39, 13, 43, 30, 39, 36, 44, 52, 39, 3, 1, 15, 6, 25, + 1, 41, 6, 48, 2, 7, 15, 14, 11, 33, 15, 40, 11, 59, 15, + 6, 20, 22, 25, 32, 20, 44, 25, 58, 20, 6, 34, 23, 30, 28, + 34, 45, 30, 50, 34, 7, 39, 12, 43, 29, 39, 37, 44, 51, 39, + 2, 1, 16, 6, 24, 1, 42, 6, 49, 2, 8, 15, 15, 11, 34, + 15, 41, 11, 59, 16, 7, 20, 21, 25, 33, 20, 43, 25, 59, 20, + 5, 34, 22, 30, 27, 34, 44, 30, 49, 34, 6, 39, 12, 44, 28, + 39, 38, 44, 50, 39, 1, 1, 17, 6, 24, 2, 43, 6, 50, 2, + 9, 15, 16, 11, 35, 15, 42, 11, 58, 16, 8, 20, 20, 25, 34, + 20, 42, 25, 59, 21, 4, 34, 21, 30, 26, 34, 43, 30, 48, 34, + 5, 39, 13, 44, 27, 39, 39, 44, 49, 39, 0, 1, 18, 6, 25, + 2, 44, 6, 51, 2, 10, 15, 17, 11, 35, 16, 43, 11, 57, 16, + 9, 20, 19, 25, 35, 20, 41, 25, 58, 21, 3, 34, 20, 30, 25, + 34, 42, 30, 48, 35, 4, 39, 14, 44, 26, 39, 40, 44, 48, 39, + 0, 2, 19, 6, 26, 2, 45, 6, 52, 2, 11, 15, 18, 11, 34, + 16, 44, 11, 56, 16, 10, 20, 18, 25, 35, 21, 40, 25, 57, 21, + 2, 34, 19, 30, 24, 34, 41, 30, 49, 35, 3, 39, 15, 44, 25, + 39, 41, 44, 48, 40, 1, 2, 20, 6, 27, 2, 46, 6, 53, 2, + 11, 16, 19, 11, 33, 16, 45, 11, 55, 16, 11, 20, 17, 25, 34, + 21, 39, 25, 56, 21, 1, 34, 18, 30, 24, 35, 40, 30, 50, 35, + 2, 39, 16, 44, 24, 39, 42, 44, 49, 40, 2, 2, 21, 6, 28, + 2, 47, 6, 54, 2, 10, 16, 20, 11, 32, 16, 46, 11, 54, 16, + 11, 21, 16, 25, 33, 21, 38, 25, 55, 21, 0, 34, 17, 30, 25, + 35, 39, 30, 51, 35, 1, 39, 17, 44, 24, 40, 43, 44, 50, 40, + 3, 2, 22, 6, 29, 2, 47, 7, 55, 2, 9, 16, 21, 11, 31, + 16, 47, 11, 53, 16, 10, 21, 15, 25, 32, 21, 37, 25, 54, 21, + 0, 35, 16, 30, 26, 35, 38, 30, 52, 35, 0, 39, 18, 44, 25, + 40, 44, 44, 51, 40, 4, 2, 23, 6, 30, 2, 46, 7, 56, 2, + 8, 16, 22, 11, 30, 16, 47, 12, 52, 16, 9, 21, 14, 25, 31, + 21, 36, 25, 53, 21, 1, 35, 15, 30, 27, 35, 37, 30, 53, 35, + 0, 40, 19, 44, 26, 40, 45, 44, 52, 40, 5, 2, 23, 7, 31, + 2, 45, 7, 57, 2, 7, 16, 23, 11, 29, 16, 46, 12, 51, 16, + 8, 21, 13, 25, 30, 21, 36, 26, 52, 21, 2, 35, 14, 30, 28, + 35, 36, 30, 54, 35, 1, 40, 20, 44, 27, 40, 46, 44, 53, 40, + 6, 2, 22, 7, 32, 2, 44, 7, 58, 2, 6, 16, 23, 12, 28, + 16, 45, 12, 50, 16, 7, 21, 12, 25, 29, 21, 37, 26, 51, 21, + 3, 35, 13, 30, 29, 35, 36, 31, 55, 35, 2, 40, 21, 44, 28, + 40, 47, 44, 54, 40, 7, 2, 21, 7, 33, 2, 43, 7, 59, 2, + 5, 16, 22, 12, 27, 16, 44, 12, 49, 16, 6, 21, 12, 26, 28, + 21, 38, 26, 50, 21, 4, 35, 12, 30, 30, 35, 37, 31, 56, 35, + 3, 40, 22, 44, 29, 40, 36, 36, 55, 40, 8, 2, 20, 7, 34, + 2, 42, 7, 59, 3, 4, 16, 21, 12, 26, 16, 43, 12, 48, 16, + 5, 21, 13, 26, 27, 21, 39, 26, 49, 21, 5, 35, 12, 31, 31, + 35, 38, 31, 57, 35, 4, 40, 23, 44, 30, 40, 37, 36, 56, 40, + 9, 2, 19, 7, 35, 2, 41, 7, 58, 3, 3, 16, 20, 12, 25, + 16, 42, 12, 48, 17, 4, 21, 14, 26, 26, 21, 40, 26, 48, 21, + 6, 35, 13, 31, 32, 35, 39, 31, 58, 35, 5, 40, 12, 36, 31, + 40, 38, 36, 57, 40, 10, 2, 18, 7, 35, 3, 40, 7, 57, 3, + 2, 16, 19, 12, 24, 16, 41, 12, 49, 17, 3, 21, 15, 26, 25, + 21, 41, 26, 48, 22, 7, 35, 14, 31, 33, 35, 40, 31, 59, 35, + 6, 40, 13, 36, 32, 40, 39, 36, 58, 40, 11, 2, 17, 7, 34, + 3, 39, 7, 56, 3, 1, 16, 18, 12, 24, 17, 40, 12, 50, 17, + 2, 21, 16, 26, 24, 21, 42, 26, 49, 22, 8, 35, 15, 31, 34, + 35, 41, 31, 48, 27, 7, 40, 14, 36, 33, 40, 40, 36, 59, 40, + 11, 3, 16, 7, 33, 3, 38, 7, 55, 3, 0, 16, 17, 12, 25, + 17, 39, 12, 51, 17, 1, 21, 17, 26, 24, 22, 43, 26, 50, 22, + 9, 35, 16, 31, 35, 35, 42, 31, 49, 27, 8, 40, 15, 36, 34, + 40, 41, 36, 59, 41, 10, 3, 15, 7, 32, 3, 37, 7, 54, 3, + 0, 17, 16, 12, 26, 17, 38, 12, 52, 17, 0, 21, 18, 26, 25, + 22, 44, 26, 51, 22, 10, 35, 17, 31, 24, 27, 43, 31, 50, 27, + 9, 40, 16, 36, 35, 40, 42, 36, 58, 41, 9, 3, 14, 7, 31, + 3, 36, 7, 53, 3, 1, 17, 15, 12, 27, 17, 37, 12, 53, 17, + 0, 22, 19, 26, 26, 22, 45, 26, 52, 22, 11, 35, 18, 31, 25, + 27, 44, 31, 51, 27, 10, 40, 17, 36, 35, 41, 43, 36, 57, 41, + 8, 3, 13, 7, 30, 3, 36, 8, 52, 3, 2, 17, 14, 12, 28, + 17, 36, 12, 54, 17, 1, 22, 20, 26, 27, 22, 46, 26, 53, 22, + 0, 27, 19, 31, 26, 27, 45, 31, 52, 27, 11, 40, 18, 36, 34, + 41, 44, 36, 56, 41, 7, 3, 12, 7, 29, 3, 37, 8, 51, 3, + 3, 17, 13, 12, 29, 17, 36, 13, 55, 17, 2, 22, 21, 26, 28, + 22, 47, 26, 54, 22, 1, 27, 20, 31, 27, 27, 46, 31, 53, 27, + 11, 41, 19, 36, 33, 41, 45, 36, 55, 41, 6, 3, 12, 8, 28, + 3, 38, 8, 50, 3, 4, 17, 12, 12, 30, 17, 37, 13, 56, 17, + 3, 22, 22, 26, 29, 22, 36, 18, 55, 22, 2, 27, 21, 31, 28, + 27, 47, 31, 54, 27, 10, 41, 20, 36, 32, 41, 46, 36, 54, 41, + 5, 3, 13, 8, 27, 3, 39, 8, 49, 3, 5, 17, 12, 13, 31, + 17, 38, 13, 57, 17, 4, 22, 23, 26, 30, 22, 37, 18, 56, 22, + 3, 27, 22, 31, 29, 27, 47, 32, 55, 27, 9, 41, 21, 36, 31, + 41, 47, 36, 53, 41, 4, 3, 14, 8, 26, 3, 40, 8, 48, 3, + 6, 17, 13, 13, 32, 17, 39, 13, 58, 17, 5, 22, 12, 18, 31, + 22, 38, 18, 57, 22, 4, 27, 23, 31, 30, 27, 46, 32, 56, 27, + 8, 41, 22, 36, 30, 41, 47, 37, 52, 41, 3, 3, 15, 8, 25, + 3, 41, 8, 48, 4, 7, 17, 14, 13, 33, 17, 40, 13, 59, 17, + 6, 22, 13, 18, 32, 22, 39, 18, 58, 22, 5, 27, 23, 32, 31, + 27, 45, 32, 57, 27, 7, 41, 23, 36, 29, 41, 46, 37, 51, 41, + 2, 3, 16, 8, 24, 3, 42, 8, 49, 4, 8, 17, 15, 13, 34, + 17, 41, 13, 48, 9, 7, 22, 14, 18, 33, 22, 40, 18, 59, 22, + 6, 27, 22, 32, 32, 27, 44, 32, 58, 27, 6, 41, 23, 37, 28, + 41, 45, 37, 50, 41, 1, 3, 17, 8, 24, 4, 43, 8, 50, 4, + 9, 17, 16, 13, 35, 17, 42, 13, 49, 9, 8, 22, 15, 18, 34, + 22, 41, 18, 59, 23, 7, 27, 21, 32, 33, 27, 43, 32, 59, 27, + 5, 41, 22, 37, 27, 41, 44, 37, 49, 41, 0, 3, 18, 8, 25, + 4, 44, 8, 51, 4, 10, 17, 17, 13, 24, 9, 43, 13, 50, 9, + 9, 22, 16, 18, 35, 22, 42, 18, 58, 23, 8, 27, 20, 32, 34, + 27, 42, 32, 59, 28, 4, 41, 21, 37, 26, 41, 43, 37, 48, 41, + 0, 4, 19, 8, 26, 4, 45, 8, 52, 4, 11, 17, 18, 13, 25, + 9, 44, 13, 51, 9, 10, 22, 17, 18, 35, 23, 43, 18, 57, 23, + 9, 27, 19, 32, 35, 27, 41, 32, 58, 28, 3, 41, 20, 37, 25, + 41, 42, 37, 48, 42, 1, 4, 20, 8, 27, 4, 46, 8, 53, 4, + 0, 9, 19, 13, 26, 9, 45, 13, 52, 9, 11, 22, 18, 18, 34, + 23, 44, 18, 56, 23, 10, 27, 18, 32, 35, 28, 40, 32, 57, 28, + 2, 41, 19, 37, 24, 41, 41, 37, 49, 42, 2, 4, 21, 8, 28, + 4, 47, 8, 54, 4, 1, 9, 20, 13, 27, 9, 46, 13, 53, 9, + 11, 23, 19, 18, 33, 23, 45, 18, 55, 23, 11, 27, 17, 32, 34, + 28, 39, 32, 56, 28, 1, 41, 18, 37, 24, 42, 40, 37, 50, 42, + 3, 4, 22, 8, 29, 4, 36, 0, 55, 4, 2, 9, 21, 13, 28, + 9, 47, 13, 54, 9, 10, 23, 20, 18, 32, 23, 46, 18, 54, 23, + 11, 28, 16, 32, 33, 28, 38, 32, 55, 28, 0, 41, 17, 37, 25, + 42, 39, 37, 51, 42, 4, 4, 23, 8, 30, 4, 37, 0, 56, 4, + 3, 9, 22, 13, 29, 9, 47, 14, 55, 9, 9, 23, 21, 18, 31, + 23, 47, 18, 53, 23, 10, 28, 15, 32, 32, 28, 37, 32, 54, 28, + 0, 42, 16, 37, 26, 42, 38, 37, 52, 42, 5, 4, 12, 0, 31, + 4, 38, 0, 57, 4, 4, 9, 23, 13, 30, 9, 46, 14, 56, 9, + 8, 23, 22, 18, 30, 23, 47, 19, 52, 23, 9, 28, 14, 32, 31, + 28, 36, 32, 53, 28, 1, 42, 15, 37, 27, 42, 37, 37, 53, 42, + 6, 4, 13, 0, 32, 4, 39, 0, 58, 4, 5, 9, 23, 14, 31, + 9, 45, 14, 57, 9, 7, 23, 23, 18, 29, 23, 46, 19, 51, 23, + 8, 28, 13, 32, 30, 28, 36, 33, 52, 28, 2, 42, 14, 37, 28, + 42, 36, 37, 54, 42, 7, 4, 14, 0, 33, 4, 40, 0, 59, 4, + 6, 9, 22, 14, 32, 9, 44, 14, 58, 9, 6, 23, 23, 19, 28, + 23, 45, 19, 50, 23, 7, 28, 12, 32, 29, 28, 37, 33, 51, 28, + 3, 42, 13, 37, 29, 42, 36, 38, 55, 42, 8, 4, 15, 0, 34, + 4, 41, 0, 59, 5, 7, 9, 21, 14, 33, 9, 43, 14, 59, 9, + 5, 23, 22, 19, 27, 23, 44, 19, 49, 23, 6, 28, 12, 33, 28, + 28, 38, 33, 50, 28, 4, 42, 12, 37, 30, 42, 37, 38, 56, 42, + 9, 4, 16, 0, 35, 4, 42, 0, 58, 5, 8, 9, 20, 14, 34, + 9, 42, 14, 59, 10, 4, 23, 21, 19, 26, 23, 43, 19, 48, 23, + 5, 28, 13, 33, 27, 28, 39, 33, 49, 28, 5, 42, 12, 38, 31, + 42, 38, 38, 57, 42, 10, 4, 17, 0, 35, 5, 43, 0, 57, 5, + 9, 9, 19, 14, 35, 9, 41, 14, 58, 10, 3, 23, 20, 19, 25, + 23, 42, 19, 48, 24, 4, 28, 14, 33, 26, 28, 40, 33, 48, 28, + 6, 42, 13, 38, 32, 42, 39, 38, 58, 42, 11, 4, 18, 0, 34, + 5, 44, 0, 56, 5, 10, 9, 18, 14, 35, 10, 40, 14, 57, 10, + 2, 23, 19, 19, 24, 23, 41, 19, 49, 24, 3, 28, 15, 33, 25, + 28, 41, 33, 48, 29, 7, 42, 14, 38, 33, 42, 40, 38, 59, 42, + 11, 5, 19, 0, 33, 5, 45, 0, 55, 5, 11, 9, 17, 14, 34, + 10, 39, 14, 56, 10, 1, 23, 18, 19, 24, 24, 40, 19, 50, 24, + 2, 28, 16, 33, 24, 28, 42, 33, 49, 29, 8, 42, 15, 38, 34, + 42, 41, 38, 59, 43, 10, 5, 20, 0, 32, 5, 46, 0, 54, 5, + 11, 10, 16, 14, 33, 10, 38, 14, 55, 10, 0, 23, 17, 19, 25, + 24, 39, 19, 51, 24, 1, 28, 17, 33, 24, 29, 43, 33, 50, 29, + 9, 42, 16, 38, 35, 42, 42, 38, 58, 43, 9, 5, 21, 0, 31, + 5, 47, 0, 53, 5, 10, 10, 15, 14, 32, 10, 37, 14, 54, 10, + 0, 24, 16, 19, 26, 24, 38, 19, 52, 24, 0, 28, 18, 33, 25, + 29, 44, 33, 51, 29, 10, 42, 17, 38, 35, 43, 43, 38, 57, 43, + 8, 5, 22, 0, 30, 5, 47, 1, 52, 5, 9, 10, 14, 14, 31, + 10, 36, 14, 53, 10, 1, 24, 15, 19, 27, 24, 37, 19, 53, 24, + 0, 29, 19, 33, 26, 29, 45, 33, 52, 29, 11, 42, 18, 38, 34, + 43, 44, 38, 56, 43, 7, 5, 23, 0, 29, 5, 46, 1, 51, 5, + 8, 10, 13, 14, 30, 10, 36, 15, 52, 10, 2, 24, 14, 19, 28, + 24, 36, 19, 54, 24, 1, 29, 20, 33, 27, 29, 46, 33, 53, 29, + 11, 43, 19, 38, 33, 43, 45, 38, 55, 43, 6, 5, 23, 1, 28, + 5, 45, 1, 50, 5, 7, 10, 12, 14, 29, 10, 37, 15, 51, 10, + 3, 24, 13, 19, 29, 24, 36, 20, 55, 24, 2, 29, 21, 33, 28, + 29, 47, 33, 54, 29, 10, 43, 20, 38, 32, 43, 46, 38, 54, 43, + 5, 5, 22, 1, 27, 5, 44, 1, 49, 5, 6, 10, 12, 15, 28, + 10, 38, 15, 50, 10, 4, 24, 12, 19, 30, 24, 37, 20, 56, 24, + 3, 29, 22, 33, 29, 29, 47, 34, 55, 29, 9, 43, 21, 38, 31, + 43, 47, 38, 53, 43, 4, 5, 21, 1, 26, 5, 43, 1, 48, 5, + 5, 10, 13, 15, 27, 10, 39, 15, 49, 10, 5, 24, 12, 20, 31, + 24, 38, 20, 57, 24, 4, 29, 23, 33, 30, 29, 46, 34, 56, 29, + 8, 43, 22, 38, 30, 43, 47, 39, 52, 43, 3, 5, 20, 1, 25, + 5, 42, 1, 48, 6, 4, 10, 14, 15, 26, 10, 40, 15, 48, 10, + 6, 24, 13, 20, 32, 24, 39, 20, 58, 24, 5, 29, 23, 34, 31, + 29, 45, 34, 57, 29, 7, 43, 23, 38, 29, 43, 46, 39, 51, 43, + 2, 5, 19, 1, 24, 5, 41, 1, 49, 6, 3, 10, 15, 15, 25, + 10, 41, 15, 48, 11, 7, 24, 14, 20, 33, 24, 40, 20, 59, 24, + 6, 29, 22, 34, 32, 29, 44, 34, 58, 29, 6, 43, 23, 39, 28, + 43, 45, 39, 50, 43, 1, 5, 18, 1, 24, 6, 40, 1, 50, 6, + 2, 10, 16, 15, 24, 10, 42, 15, 49, 11, 8, 24, 15, 20, 34, + 24, 41, 20, 59, 25, 7, 29, 21, 34, 33, 29, 43, 34, 59, 29, + 5, 43, 22, 39, 27, 43, 44, 39, 49, 43, 0, 5, 17, 1, 25, + 6, 39, 1, 51, 6, 1, 10, 17, 15, 24, 11, 43, 15, 50, 11, + 9, 24, 16, 20, 35, 24, 42, 20, 58, 25, 8, 29, 20, 34, 34, + 29, 42, 34, 59, 30, 4, 43, 21, 39, 26, 43, 43, 39, 48, 43, + 0, 6, 16, 1, 26, 6, 38, 1, 52, 6, 0, 10, 18, 15, 25, + 11, 44, 15, 51, 11, 10, 24, 17, 20, 35, 25, 43, 20, 57, 25, + 9, 29, 19, 34, 35, 29, 41, 34, 58, 30, 3, 43, 20, 39, 25, + 43, 42, 39, 48, 44, 1, 6, 15, 1, 27, 6, 37, 1, 53, 6, + 0, 11, 19, 15, 26, 11, 45, 15, 52, 11, 11, 24, 18, 20, 34, + 25, 44, 20, 56, 25, 10, 29, 18, 34, 35, 30, 40, 34, 57, 30, + 2, 43, 19, 39, 24, 43, 41, 39, 49, 44, 2, 6, 14, 1, 28, + 6, 36, 1, 54, 6, 1, 11, 20, 15, 27, 11, 46, 15, 53, 11, + 11, 25, 19, 20, 33, 25, 45, 20, 55, 25, 11, 29, 17, 34, 34, + 30, 39, 34, 56, 30, 1, 43, 18, 39, 24, 44, 40, 39, 50, 44, + 3, 6, 13, 1, 29, 6, 36, 2, 55, 6, 2, 11, 21, 15, 28, + 11, 47, 15, 54, 11, 10, 25, 20, 20, 32, 25, 46, 20, 54, 25, + 11, 30, 16, 34, 33, 30, 38, 34, 55, 30, 0, 43, 17, 39, 25, + 44, 39, 39, 51, 44, 4, 6, 12, 1, 30, 6, 37, 2, 56, 6, + 3, 11, 22, 15, 29, 11, 47, 16, 55, 11, 9, 25, 21, 20, 31, + 25, 47, 20, 53, 25, 10, 30, 15, 34, 32, 30, 37, 34, 54, 30, + 0, 44, 16, 39, 26, 44, 38, 39, 52, 44, 5, 6, 12, 2, 31, + 6, 38, 2, 57, 6, 4, 11, 23, 15, 30, 11, 46, 16, 56, 11, + 8, 25, 22, 20, 30, 25, 47, 21, 52, 25, 9, 30, 14, 34, 31, + 30, 36, 34, 53, 30, 1, 44, 15, 39, 27, 44, 37, 39, 53, 44, + 6, 6, 13, 2, 32, 6, 39, 2, 58, 6, 5, 11, 23, 16, 31, + 11, 45, 16, 57, 11, 7, 25, 23, 20, 29, 25, 46, 21, 51, 25, + 8, 30, 13, 34, 30, 30, 36, 35, 52, 30, 2, 44, 14, 39, 28, + 44, 36, 39, 54, 44, 7, 6, 14, 2, 33, 6, 40, 2, 59, 6, + 6, 11, 22, 16, 32, 11, 44, 16, 58, 11, 6, 25, 23, 21, 28, + 25, 45, 21, 50, 25, 7, 30, 12, 34, 29, 30, 37, 35, 51, 30, + 3, 44, 13, 39, 29, 44, 36, 40, 55, 44, 8, 6, 15, 2, 34, + 6, 41, 2, 59, 7, 7, 11, 21, 16, 33, 11, 43, 16, 59, 11, + 5, 25, 22, 21, 27, 25, 44, 21, 49, 25, 6, 30, 12, 35, 28, + 30, 38, 35, 50, 30, 4, 44, 12, 39, 30, 44, 37, 40, 56, 44, + 9, 6, 16, 2, 35, 6, 42, 2, 58, 7, 8, 11, 20, 16, 34, + 11, 42, 16, 59, 12, 4, 25, 21, 21, 26, 25, 43, 21, 48, 25, + 5, 30, 13, 35, 27, 30, 39, 35, 49, 30, 5, 44, 12, 40, 31, + 44, 38, 40, 57, 44, 10, 6, 17, 2, 35, 7, 43, 2, 57, 7, + 9, 11, 19, 16, 35, 11, 41, 16, 58, 12, 3, 25, 20, 21, 25, + 25, 42, 21, 48, 26, 4, 30, 14, 35, 26, 30, 40, 35, 48, 30, + 6, 44, 13, 40, 32, 44, 39, 40, 58, 44, 11, 6, 18, 2, 34, + 7, 44, 2, 56, 7, 10, 11, 18, 16, 35, 12, 40, 16, 57, 12, + 2, 25, 19, 21, 24, 25, 41, 21, 49, 26, 3, 30, 15, 35, 25, + 30, 41, 35, 48, 31, 7, 44, 14, 40, 33, 44, 40, 40, 59, 44, + 11, 7, 19, 2, 33, 7, 45, 2, 55, 7, 11, 11, 17, 16, 34, + 12, 39, 16, 56, 12, 1, 25, 18, 21, 24, 26, 40, 21, 50, 26, + 2, 30, 16, 35, 24, 30, 42, 35, 49, 31, 8, 44, 15, 40, 34, + 44, 41, 40, 48, 36, 10, 7, 20, 2, 32, 7, 46, 2, 54, 7, + 11, 12, 16, 16, 33, 12, 38, 16, 55, 12, 0, 25, 17, 21, 25, + 26, 39, 21, 51, 26, 1, 30, 17, 35, 24, 31, 43, 35, 50, 31, + 9, 44, 16, 40, 35, 44, 42, 40, 49, 36, 9, 7, 21, 2, 31, + 7, 47, 2, 53, 7, 10, 12, 15, 16, 32, 12, 37, 16, 54, 12, + 0, 26, 16, 21, 26, 26, 38, 21, 52, 26, 0, 30, 18, 35, 25, + 31, 44, 35, 51, 31, 10, 44, 17, 40, 24, 36, 43, 40, 50, 36, + 8, 7, 22, 2, 30, 7, 47, 3, 52, 7, 9, 12, 14, 16, 31, + 12, 36, 16, 53, 12, 1, 26, 15, 21, 27, 26, 37, 21, 53, 26, + 0, 31, 19, 35, 26, 31, 45, 35, 52, 31, 11, 44, 18, 40, 25, + 36, 44, 40, 51, 36, 7, 7, 23, 2, 29, 7, 46, 3, 51, 7, + 8, 12, 13, 16, 30, 12, 36, 17, 52, 12, 2, 26, 14, 21, 28, + 26, 36, 21, 54, 26, 1, 31, 20, 35, 27, 31, 46, 35, 53, 31, + 0, 36, 19, 40, 26, 36, 45, 40, 52, 36, 6, 7, 23, 3, 28, + 7, 45, 3, 50, 7, 7, 12, 12, 16, 29, 12, 37, 17, 51, 12, + 3, 26, 13, 21, 29, 26, 36, 22, 55, 26, 2, 31, 21, 35, 28, + 31, 47, 35, 54, 31, 1, 36, 20, 40, 27, 36, 46, 40, 53, 36, + 5, 7, 22, 3, 27, 7, 44, 3, 49, 7, 6, 12, 12, 17, 28, + 12, 38, 17, 50, 12, 4, 26, 12, 21, 30, 26, 37, 22, 56, 26, + 3, 31, 22, 35, 29, 31, 36, 27, 55, 31, 2, 36, 21, 40, 28, + 36, 47, 40, 54, 36, 4, 7, 21, 3, 26, 7, 43, 3, 48, 7, + 5, 12, 13, 17, 27, 12, 39, 17, 49, 12, 5, 26, 12, 22, 31, + 26, 38, 22, 57, 26, 4, 31, 23, 35, 30, 31, 37, 27, 56, 31, + 3, 36, 22, 40, 29, 36, 47, 41, 55, 36, 3, 7, 20, 3, 25, + 7, 42, 3, 48, 8, 4, 12, 14, 17, 26, 12, 40, 17, 48, 12, + 6, 26, 13, 22, 32, 26, 39, 22, 58, 26, 5, 31, 12, 27, 31, + 31, 38, 27, 57, 31, 4, 36, 23, 40, 30, 36, 46, 41, 56, 36, + 2, 7, 19, 3, 24, 7, 41, 3, 49, 8, 3, 12, 15, 17, 25, + 12, 41, 17, 48, 13, 7, 26, 14, 22, 33, 26, 40, 22, 59, 26, + 6, 31, 13, 27, 32, 31, 39, 27, 58, 31, 5, 36, 23, 41, 31, + 36, 45, 41, 57, 36, 1, 7, 18, 3, 24, 8, 40, 3, 50, 8, + 2, 12, 16, 17, 24, 12, 42, 17, 49, 13, 8, 26, 15, 22, 34, + 26, 41, 22, 48, 18, 7, 31, 14, 27, 33, 31, 40, 27, 59, 31, + 6, 36, 22, 41, 32, 36, 44, 41, 58, 36, 0, 7, 17, 3, 25, + 8, 39, 3, 51, 8, 1, 12, 17, 17, 24, 13, 43, 17, 50, 13, + 9, 26, 16, 22, 35, 26, 42, 22, 49, 18, 8, 31, 15, 27, 34, + 31, 41, 27, 59, 32, 7, 36, 21, 41, 33, 36, 43, 41, 59, 36, + 0, 8, 16, 3, 26, 8, 38, 3, 52, 8, 0, 12, 18, 17, 25, + 13, 44, 17, 51, 13, 10, 26, 17, 22, 24, 18, 43, 22, 50, 18, + 9, 31, 16, 27, 35, 31, 42, 27, 58, 32, 8, 36, 20, 41, 34, + 36, 42, 41, 59, 37, 1, 8, 15, 3, 27, 8, 37, 3, 53, 8, + 0, 13, 19, 17, 26, 13, 45, 17, 52, 13, 11, 26, 18, 22, 25, + 18, 44, 22, 51, 18, 10, 31, 17, 27, 35, 32, 43, 27, 57, 32, + 9, 36, 19, 41, 35, 36, 41, 41, 58, 37, 2, 8, 14, 3, 28, + 8, 36, 3, 54, 8, 1, 13, 20, 17, 27, 13, 46, 17, 53, 13, + 0, 18, 19, 22, 26, 18, 45, 22, 52, 18, 11, 31, 18, 27, 34, + 32, 44, 27, 56, 32, 10, 36, 18, 41, 35, 37, 40, 41, 57, 37, + 3, 8, 13, 3, 29, 8, 36, 4, 55, 8, 2, 13, 21, 17, 28, + 13, 47, 17, 54, 13, 1, 18, 20, 22, 27, 18, 46, 22, 53, 18, + 11, 32, 19, 27, 33, 32, 45, 27, 55, 32, 11, 36, 17, 41, 34, + 37, 39, 41, 56, 37, 4, 8, 12, 3, 30, 8, 37, 4, 56, 8, + 3, 13, 22, 17, 29, 13, 36, 9, 55, 13, 2, 18, 21, 22, 28, + 18, 47, 22, 54, 18, 10, 32, 20, 27, 32, 32, 46, 27, 54, 32, + 11, 37, 16, 41, 33, 37, 38, 41, 55, 37, 5, 8, 12, 4, 31, + 8, 38, 4, 57, 8, 4, 13, 23, 17, 30, 13, 37, 9, 56, 13, + 3, 18, 22, 22, 29, 18, 47, 23, 55, 18, 9, 32, 21, 27, 31, + 32, 47, 27, 53, 32, 10, 37, 15, 41, 32, 37, 37, 41, 54, 37, + 6, 8, 13, 4, 32, 8, 39, 4, 58, 8, 5, 13, 12, 9, 31, + 13, 38, 9, 57, 13, 4, 18, 23, 22, 30, 18, 46, 23, 56, 18, + 8, 32, 22, 27, 30, 32, 47, 28, 52, 32, 9, 37, 14, 41, 31, + 37, 36, 41, 53, 37, 7, 8, 14, 4, 33, 8, 40, 4, 59, 8, + 6, 13, 13, 9, 32, 13, 39, 9, 58, 13, 5, 18, 23, 23, 31, + 18, 45, 23, 57, 18, 7, 32, 23, 27, 29, 32, 46, 28, 51, 32, + 8, 37, 13, 41, 30, 37, 36, 42, 52, 37, 8, 8, 15, 4, 34, + 8, 41, 4, 48, 0, 7, 13, 14, 9, 33, 13, 40, 9, 59, 13, + 6, 18, 22, 23, 32, 18, 44, 23, 58, 18, 6, 32, 23, 28, 28, + 32, 45, 28, 50, 32, 7, 37, 12, 41, 29, 37, 37, 42, 51, 37, + 9, 8, 16, 4, 35, 8, 42, 4, 49, 0, 8, 13, 15, 9, 34, + 13, 41, 9, 59, 14, 7, 18, 21, 23, 33, 18, 43, 23, 59, 18, + 5, 32, 22, 28, 27, 32, 44, 28, 49, 32, 6, 37, 12, 42, 28, + 37, 38, 42, 50, 37, 10, 8, 17, 4, 24, 0, 43, 4, 50, 0, + 9, 13, 16, 9, 35, 13, 42, 9, 58, 14, 8, 18, 20, 23, 34, + 18, 42, 23, 59, 19, 4, 32, 21, 28, 26, 32, 43, 28, 48, 32, + 5, 37, 13, 42, 27, 37, 39, 42, 49, 37, 11, 8, 18, 4, 25, + 0, 44, 4, 51, 0, 10, 13, 17, 9, 35, 14, 43, 9, 57, 14, + 9, 18, 19, 23, 35, 18, 41, 23, 58, 19, 3, 32, 20, 28, 25, + 32, 42, 28, 48, 33, 4, 37, 14, 42, 26, 37, 40, 42, 48, 37, +}; + +static const uint8_t hq_tab_05[] = { + 0, 0, 25, 4, 34, 0, 59, 4, 68, 0, 13, 13, 22, 9, 47, + 13, 56, 9, 78, 14, 10, 18, 28, 23, 44, 18, 58, 23, 78, 18, + 8, 32, 31, 28, 38, 32, 61, 28, 68, 32, 11, 37, 18, 41, 41, + 37, 48, 41, 71, 37, 1, 0, 26, 4, 35, 0, 60, 4, 69, 0, + 14, 13, 23, 9, 47, 14, 57, 9, 77, 14, 11, 18, 27, 23, 45, + 18, 57, 23, 79, 18, 7, 32, 30, 28, 37, 32, 60, 28, 67, 32, + 10, 37, 17, 41, 40, 37, 48, 42, 70, 37, 2, 0, 27, 4, 36, + 0, 61, 4, 70, 0, 15, 13, 24, 9, 46, 14, 58, 9, 76, 14, + 12, 18, 26, 23, 46, 18, 56, 23, 79, 19, 6, 32, 29, 28, 36, + 32, 59, 28, 66, 32, 9, 37, 16, 41, 39, 37, 49, 42, 69, 37, + 3, 0, 28, 4, 37, 0, 62, 4, 71, 0, 15, 14, 25, 9, 45, + 14, 59, 9, 75, 14, 13, 18, 25, 23, 47, 18, 55, 23, 78, 19, + 5, 32, 28, 28, 35, 32, 58, 28, 65, 32, 8, 37, 16, 42, 38, + 37, 50, 42, 68, 37, 4, 0, 29, 4, 38, 0, 63, 4, 72, 0, + 14, 14, 26, 9, 44, 14, 60, 9, 74, 14, 14, 18, 24, 23, 47, + 19, 54, 23, 77, 19, 4, 32, 27, 28, 34, 32, 57, 28, 64, 32, + 7, 37, 17, 42, 37, 37, 51, 42, 67, 37, 5, 0, 30, 4, 39, + 0, 63, 5, 73, 0, 13, 14, 27, 9, 43, 14, 61, 9, 73, 14, + 15, 18, 23, 23, 46, 19, 53, 23, 76, 19, 3, 32, 26, 28, 33, + 32, 56, 28, 64, 33, 6, 37, 18, 42, 36, 37, 52, 42, 66, 37, + 6, 0, 31, 4, 40, 0, 62, 5, 74, 0, 12, 14, 28, 9, 42, + 14, 62, 9, 72, 14, 15, 19, 22, 23, 45, 19, 52, 23, 75, 19, + 2, 32, 25, 28, 32, 32, 55, 28, 65, 33, 5, 37, 19, 42, 35, + 37, 53, 42, 65, 37, 7, 0, 31, 5, 41, 0, 61, 5, 75, 0, + 11, 14, 29, 9, 41, 14, 63, 9, 71, 14, 14, 19, 21, 23, 44, + 19, 51, 23, 74, 19, 1, 32, 24, 28, 32, 33, 54, 28, 66, 33, + 4, 37, 20, 42, 34, 37, 54, 42, 64, 37, 8, 0, 30, 5, 42, + 0, 60, 5, 76, 0, 10, 14, 30, 9, 40, 14, 63, 10, 70, 14, + 13, 19, 20, 23, 43, 19, 50, 23, 73, 19, 0, 32, 23, 28, 33, + 33, 53, 28, 67, 33, 3, 37, 21, 42, 33, 37, 55, 42, 64, 38, + 9, 0, 29, 5, 43, 0, 59, 5, 77, 0, 9, 14, 31, 9, 39, + 14, 62, 10, 69, 14, 12, 19, 19, 23, 42, 19, 49, 23, 72, 19, + 0, 33, 22, 28, 34, 33, 52, 28, 68, 33, 2, 37, 22, 42, 32, + 37, 56, 42, 65, 38, 10, 0, 28, 5, 44, 0, 58, 5, 78, 0, + 8, 14, 31, 10, 38, 14, 61, 10, 68, 14, 11, 19, 18, 23, 41, + 19, 48, 23, 71, 19, 1, 33, 21, 28, 35, 33, 51, 28, 69, 33, + 1, 37, 23, 42, 32, 38, 57, 42, 66, 38, 11, 0, 27, 5, 45, + 0, 57, 5, 79, 0, 7, 14, 30, 10, 37, 14, 60, 10, 67, 14, + 10, 19, 17, 23, 40, 19, 48, 24, 70, 19, 2, 33, 20, 28, 36, + 33, 50, 28, 70, 33, 0, 37, 24, 42, 33, 38, 58, 42, 67, 38, + 12, 0, 26, 5, 46, 0, 56, 5, 79, 1, 6, 14, 29, 10, 36, + 14, 59, 10, 66, 14, 9, 19, 16, 23, 39, 19, 49, 24, 69, 19, + 3, 33, 19, 28, 37, 33, 49, 28, 71, 33, 0, 38, 25, 42, 34, + 38, 59, 42, 68, 38, 13, 0, 25, 5, 47, 0, 55, 5, 78, 1, + 5, 14, 28, 10, 35, 14, 58, 10, 65, 14, 8, 19, 16, 24, 38, + 19, 50, 24, 68, 19, 4, 33, 18, 28, 38, 33, 48, 28, 72, 33, + 1, 38, 26, 42, 35, 38, 60, 42, 69, 38, 14, 0, 24, 5, 47, + 1, 54, 5, 77, 1, 4, 14, 27, 10, 34, 14, 57, 10, 64, 14, + 7, 19, 17, 24, 37, 19, 51, 24, 67, 19, 5, 33, 17, 28, 39, + 33, 48, 29, 73, 33, 2, 38, 27, 42, 36, 38, 61, 42, 70, 38, + 15, 0, 23, 5, 46, 1, 53, 5, 76, 1, 3, 14, 26, 10, 33, + 14, 56, 10, 64, 15, 6, 19, 18, 24, 36, 19, 52, 24, 66, 19, + 6, 33, 16, 28, 40, 33, 49, 29, 74, 33, 3, 38, 28, 42, 37, + 38, 62, 42, 71, 38, 15, 1, 22, 5, 45, 1, 52, 5, 75, 1, + 2, 14, 25, 10, 32, 14, 55, 10, 65, 15, 5, 19, 19, 24, 35, + 19, 53, 24, 65, 19, 7, 33, 16, 29, 41, 33, 50, 29, 75, 33, + 4, 38, 29, 42, 38, 38, 63, 42, 72, 38, 14, 1, 21, 5, 44, + 1, 51, 5, 74, 1, 1, 14, 24, 10, 32, 15, 54, 10, 66, 15, + 4, 19, 20, 24, 34, 19, 54, 24, 64, 19, 8, 33, 17, 29, 42, + 33, 51, 29, 76, 33, 5, 38, 30, 42, 39, 38, 63, 43, 73, 38, + 13, 1, 20, 5, 43, 1, 50, 5, 73, 1, 0, 14, 23, 10, 33, + 15, 53, 10, 67, 15, 3, 19, 21, 24, 33, 19, 55, 24, 64, 20, + 9, 33, 18, 29, 43, 33, 52, 29, 77, 33, 6, 38, 31, 42, 40, + 38, 62, 43, 74, 38, 12, 1, 19, 5, 42, 1, 49, 5, 72, 1, + 0, 15, 22, 10, 34, 15, 52, 10, 68, 15, 2, 19, 22, 24, 32, + 19, 56, 24, 65, 20, 10, 33, 19, 29, 44, 33, 53, 29, 78, 33, + 7, 38, 31, 43, 41, 38, 61, 43, 75, 38, 11, 1, 18, 5, 41, + 1, 48, 5, 71, 1, 1, 15, 21, 10, 35, 15, 51, 10, 69, 15, + 1, 19, 23, 24, 32, 20, 57, 24, 66, 20, 11, 33, 20, 29, 45, + 33, 54, 29, 79, 33, 8, 38, 30, 43, 42, 38, 60, 43, 76, 38, + 10, 1, 17, 5, 40, 1, 48, 6, 70, 1, 2, 15, 20, 10, 36, + 15, 50, 10, 70, 15, 0, 19, 24, 24, 33, 20, 58, 24, 67, 20, + 12, 33, 21, 29, 46, 33, 55, 29, 79, 34, 9, 38, 29, 43, 43, + 38, 59, 43, 77, 38, 9, 1, 16, 5, 39, 1, 49, 6, 69, 1, + 3, 15, 19, 10, 37, 15, 49, 10, 71, 15, 0, 20, 25, 24, 34, + 20, 59, 24, 68, 20, 13, 33, 22, 29, 47, 33, 56, 29, 78, 34, + 10, 38, 28, 43, 44, 38, 58, 43, 78, 38, 8, 1, 16, 6, 38, + 1, 50, 6, 68, 1, 4, 15, 18, 10, 38, 15, 48, 10, 72, 15, + 1, 20, 26, 24, 35, 20, 60, 24, 69, 20, 14, 33, 23, 29, 47, + 34, 57, 29, 77, 34, 11, 38, 27, 43, 45, 38, 57, 43, 79, 38, + 7, 1, 17, 6, 37, 1, 51, 6, 67, 1, 5, 15, 17, 10, 39, + 15, 48, 11, 73, 15, 2, 20, 27, 24, 36, 20, 61, 24, 70, 20, + 15, 33, 24, 29, 46, 34, 58, 29, 76, 34, 12, 38, 26, 43, 46, + 38, 56, 43, 79, 39, 6, 1, 18, 6, 36, 1, 52, 6, 66, 1, + 6, 15, 16, 10, 40, 15, 49, 11, 74, 15, 3, 20, 28, 24, 37, + 20, 62, 24, 71, 20, 15, 34, 25, 29, 45, 34, 59, 29, 75, 34, + 13, 38, 25, 43, 47, 38, 55, 43, 78, 39, 5, 1, 19, 6, 35, + 1, 53, 6, 65, 1, 7, 15, 16, 11, 41, 15, 50, 11, 75, 15, + 4, 20, 29, 24, 38, 20, 63, 24, 72, 20, 14, 34, 26, 29, 44, + 34, 60, 29, 74, 34, 14, 38, 24, 43, 47, 39, 54, 43, 77, 39, + 4, 1, 20, 6, 34, 1, 54, 6, 64, 1, 8, 15, 17, 11, 42, + 15, 51, 11, 76, 15, 5, 20, 30, 24, 39, 20, 63, 25, 73, 20, + 13, 34, 27, 29, 43, 34, 61, 29, 73, 34, 15, 38, 23, 43, 46, + 39, 53, 43, 76, 39, 3, 1, 21, 6, 33, 1, 55, 6, 64, 2, + 9, 15, 18, 11, 43, 15, 52, 11, 77, 15, 6, 20, 31, 24, 40, + 20, 62, 25, 74, 20, 12, 34, 28, 29, 42, 34, 62, 29, 72, 34, + 15, 39, 22, 43, 45, 39, 52, 43, 75, 39, 2, 1, 22, 6, 32, + 1, 56, 6, 65, 2, 10, 15, 19, 11, 44, 15, 53, 11, 78, 15, + 7, 20, 31, 25, 41, 20, 61, 25, 75, 20, 11, 34, 29, 29, 41, + 34, 63, 29, 71, 34, 14, 39, 21, 43, 44, 39, 51, 43, 74, 39, + 1, 1, 23, 6, 32, 2, 57, 6, 66, 2, 11, 15, 20, 11, 45, + 15, 54, 11, 79, 15, 8, 20, 30, 25, 42, 20, 60, 25, 76, 20, + 10, 34, 30, 29, 40, 34, 63, 30, 70, 34, 13, 39, 20, 43, 43, + 39, 50, 43, 73, 39, 0, 1, 24, 6, 33, 2, 58, 6, 67, 2, + 12, 15, 21, 11, 46, 15, 55, 11, 79, 16, 9, 20, 29, 25, 43, + 20, 59, 25, 77, 20, 9, 34, 31, 29, 39, 34, 62, 30, 69, 34, + 12, 39, 19, 43, 42, 39, 49, 43, 72, 39, 0, 2, 25, 6, 34, + 2, 59, 6, 68, 2, 13, 15, 22, 11, 47, 15, 56, 11, 78, 16, + 10, 20, 28, 25, 44, 20, 58, 25, 78, 20, 8, 34, 31, 30, 38, + 34, 61, 30, 68, 34, 11, 39, 18, 43, 41, 39, 48, 43, 71, 39, + 1, 2, 26, 6, 35, 2, 60, 6, 69, 2, 14, 15, 23, 11, 47, + 16, 57, 11, 77, 16, 11, 20, 27, 25, 45, 20, 57, 25, 79, 20, + 7, 34, 30, 30, 37, 34, 60, 30, 67, 34, 10, 39, 17, 43, 40, + 39, 48, 44, 70, 39, 2, 2, 27, 6, 36, 2, 61, 6, 70, 2, + 15, 15, 24, 11, 46, 16, 58, 11, 76, 16, 12, 20, 26, 25, 46, + 20, 56, 25, 79, 21, 6, 34, 29, 30, 36, 34, 59, 30, 66, 34, + 9, 39, 16, 43, 39, 39, 49, 44, 69, 39, 3, 2, 28, 6, 37, + 2, 62, 6, 71, 2, 15, 16, 25, 11, 45, 16, 59, 11, 75, 16, + 13, 20, 25, 25, 47, 20, 55, 25, 78, 21, 5, 34, 28, 30, 35, + 34, 58, 30, 65, 34, 8, 39, 16, 44, 38, 39, 50, 44, 68, 39, + 4, 2, 29, 6, 38, 2, 63, 6, 72, 2, 14, 16, 26, 11, 44, + 16, 60, 11, 74, 16, 14, 20, 24, 25, 47, 21, 54, 25, 77, 21, + 4, 34, 27, 30, 34, 34, 57, 30, 64, 34, 7, 39, 17, 44, 37, + 39, 51, 44, 67, 39, 5, 2, 30, 6, 39, 2, 63, 7, 73, 2, + 13, 16, 27, 11, 43, 16, 61, 11, 73, 16, 15, 20, 23, 25, 46, + 21, 53, 25, 76, 21, 3, 34, 26, 30, 33, 34, 56, 30, 64, 35, + 6, 39, 18, 44, 36, 39, 52, 44, 66, 39, 6, 2, 31, 6, 40, + 2, 62, 7, 74, 2, 12, 16, 28, 11, 42, 16, 62, 11, 72, 16, + 15, 21, 22, 25, 45, 21, 52, 25, 75, 21, 2, 34, 25, 30, 32, + 34, 55, 30, 65, 35, 5, 39, 19, 44, 35, 39, 53, 44, 65, 39, + 7, 2, 31, 7, 41, 2, 61, 7, 75, 2, 11, 16, 29, 11, 41, + 16, 63, 11, 71, 16, 14, 21, 21, 25, 44, 21, 51, 25, 74, 21, + 1, 34, 24, 30, 32, 35, 54, 30, 66, 35, 4, 39, 20, 44, 34, + 39, 54, 44, 64, 39, 8, 2, 30, 7, 42, 2, 60, 7, 76, 2, + 10, 16, 30, 11, 40, 16, 63, 12, 70, 16, 13, 21, 20, 25, 43, + 21, 50, 25, 73, 21, 0, 34, 23, 30, 33, 35, 53, 30, 67, 35, + 3, 39, 21, 44, 33, 39, 55, 44, 64, 40, 9, 2, 29, 7, 43, + 2, 59, 7, 77, 2, 9, 16, 31, 11, 39, 16, 62, 12, 69, 16, + 12, 21, 19, 25, 42, 21, 49, 25, 72, 21, 0, 35, 22, 30, 34, + 35, 52, 30, 68, 35, 2, 39, 22, 44, 32, 39, 56, 44, 65, 40, + 10, 2, 28, 7, 44, 2, 58, 7, 78, 2, 8, 16, 31, 12, 38, + 16, 61, 12, 68, 16, 11, 21, 18, 25, 41, 21, 48, 25, 71, 21, + 1, 35, 21, 30, 35, 35, 51, 30, 69, 35, 1, 39, 23, 44, 32, + 40, 57, 44, 66, 40, 11, 2, 27, 7, 45, 2, 57, 7, 79, 2, + 7, 16, 30, 12, 37, 16, 60, 12, 67, 16, 10, 21, 17, 25, 40, + 21, 48, 26, 70, 21, 2, 35, 20, 30, 36, 35, 50, 30, 70, 35, + 0, 39, 24, 44, 33, 40, 58, 44, 67, 40, 12, 2, 26, 7, 46, + 2, 56, 7, 79, 3, 6, 16, 29, 12, 36, 16, 59, 12, 66, 16, + 9, 21, 16, 25, 39, 21, 49, 26, 69, 21, 3, 35, 19, 30, 37, + 35, 49, 30, 71, 35, 0, 40, 25, 44, 34, 40, 59, 44, 68, 40, + 13, 2, 25, 7, 47, 2, 55, 7, 78, 3, 5, 16, 28, 12, 35, + 16, 58, 12, 65, 16, 8, 21, 16, 26, 38, 21, 50, 26, 68, 21, + 4, 35, 18, 30, 38, 35, 48, 30, 72, 35, 1, 40, 26, 44, 35, + 40, 60, 44, 69, 40, 14, 2, 24, 7, 47, 3, 54, 7, 77, 3, + 4, 16, 27, 12, 34, 16, 57, 12, 64, 16, 7, 21, 17, 26, 37, + 21, 51, 26, 67, 21, 5, 35, 17, 30, 39, 35, 48, 31, 73, 35, + 2, 40, 27, 44, 36, 40, 61, 44, 70, 40, 15, 2, 23, 7, 46, + 3, 53, 7, 76, 3, 3, 16, 26, 12, 33, 16, 56, 12, 64, 17, + 6, 21, 18, 26, 36, 21, 52, 26, 66, 21, 6, 35, 16, 30, 40, + 35, 49, 31, 74, 35, 3, 40, 28, 44, 37, 40, 62, 44, 71, 40, + 15, 3, 22, 7, 45, 3, 52, 7, 75, 3, 2, 16, 25, 12, 32, + 16, 55, 12, 65, 17, 5, 21, 19, 26, 35, 21, 53, 26, 65, 21, + 7, 35, 16, 31, 41, 35, 50, 31, 75, 35, 4, 40, 29, 44, 38, + 40, 63, 44, 72, 40, 14, 3, 21, 7, 44, 3, 51, 7, 74, 3, + 1, 16, 24, 12, 32, 17, 54, 12, 66, 17, 4, 21, 20, 26, 34, + 21, 54, 26, 64, 21, 8, 35, 17, 31, 42, 35, 51, 31, 76, 35, + 5, 40, 30, 44, 39, 40, 48, 36, 73, 40, 13, 3, 20, 7, 43, + 3, 50, 7, 73, 3, 0, 16, 23, 12, 33, 17, 53, 12, 67, 17, + 3, 21, 21, 26, 33, 21, 55, 26, 64, 22, 9, 35, 18, 31, 43, + 35, 52, 31, 77, 35, 6, 40, 31, 44, 40, 40, 49, 36, 74, 40, + 12, 3, 19, 7, 42, 3, 49, 7, 72, 3, 0, 17, 22, 12, 34, + 17, 52, 12, 68, 17, 2, 21, 22, 26, 32, 21, 56, 26, 65, 22, + 10, 35, 19, 31, 44, 35, 53, 31, 78, 35, 7, 40, 16, 36, 41, + 40, 50, 36, 75, 40, 11, 3, 18, 7, 41, 3, 48, 7, 71, 3, + 1, 17, 21, 12, 35, 17, 51, 12, 69, 17, 1, 21, 23, 26, 32, + 22, 57, 26, 66, 22, 11, 35, 20, 31, 45, 35, 54, 31, 79, 35, + 8, 40, 17, 36, 42, 40, 51, 36, 76, 40, 10, 3, 17, 7, 40, + 3, 48, 8, 70, 3, 2, 17, 20, 12, 36, 17, 50, 12, 70, 17, + 0, 21, 24, 26, 33, 22, 58, 26, 67, 22, 12, 35, 21, 31, 46, + 35, 55, 31, 64, 27, 9, 40, 18, 36, 43, 40, 52, 36, 77, 40, + 9, 3, 16, 7, 39, 3, 49, 8, 69, 3, 3, 17, 19, 12, 37, + 17, 49, 12, 71, 17, 0, 22, 25, 26, 34, 22, 59, 26, 68, 22, + 13, 35, 22, 31, 47, 35, 56, 31, 65, 27, 10, 40, 19, 36, 44, + 40, 53, 36, 78, 40, 8, 3, 16, 8, 38, 3, 50, 8, 68, 3, + 4, 17, 18, 12, 38, 17, 48, 12, 72, 17, 1, 22, 26, 26, 35, + 22, 60, 26, 69, 22, 14, 35, 23, 31, 32, 27, 57, 31, 66, 27, + 11, 40, 20, 36, 45, 40, 54, 36, 79, 40, 7, 3, 17, 8, 37, + 3, 51, 8, 67, 3, 5, 17, 17, 12, 39, 17, 48, 13, 73, 17, + 2, 22, 27, 26, 36, 22, 61, 26, 70, 22, 15, 35, 24, 31, 33, + 27, 58, 31, 67, 27, 12, 40, 21, 36, 46, 40, 55, 36, 79, 41, + 6, 3, 18, 8, 36, 3, 52, 8, 66, 3, 6, 17, 16, 12, 40, + 17, 49, 13, 74, 17, 3, 22, 28, 26, 37, 22, 62, 26, 71, 22, + 0, 27, 25, 31, 34, 27, 59, 31, 68, 27, 13, 40, 22, 36, 47, + 40, 56, 36, 78, 41, 5, 3, 19, 8, 35, 3, 53, 8, 65, 3, + 7, 17, 16, 13, 41, 17, 50, 13, 75, 17, 4, 22, 29, 26, 38, + 22, 63, 26, 72, 22, 1, 27, 26, 31, 35, 27, 60, 31, 69, 27, + 14, 40, 23, 36, 47, 41, 57, 36, 77, 41, 4, 3, 20, 8, 34, + 3, 54, 8, 64, 3, 8, 17, 17, 13, 42, 17, 51, 13, 76, 17, + 5, 22, 30, 26, 39, 22, 48, 18, 73, 22, 2, 27, 27, 31, 36, + 27, 61, 31, 70, 27, 15, 40, 24, 36, 46, 41, 58, 36, 76, 41, + 3, 3, 21, 8, 33, 3, 55, 8, 64, 4, 9, 17, 18, 13, 43, + 17, 52, 13, 77, 17, 6, 22, 31, 26, 40, 22, 49, 18, 74, 22, + 3, 27, 28, 31, 37, 27, 62, 31, 71, 27, 15, 41, 25, 36, 45, + 41, 59, 36, 75, 41, 2, 3, 22, 8, 32, 3, 56, 8, 65, 4, + 10, 17, 19, 13, 44, 17, 53, 13, 78, 17, 7, 22, 16, 18, 41, + 22, 50, 18, 75, 22, 4, 27, 29, 31, 38, 27, 63, 31, 72, 27, + 14, 41, 26, 36, 44, 41, 60, 36, 74, 41, 1, 3, 23, 8, 32, + 4, 57, 8, 66, 4, 11, 17, 20, 13, 45, 17, 54, 13, 79, 17, + 8, 22, 17, 18, 42, 22, 51, 18, 76, 22, 5, 27, 30, 31, 39, + 27, 63, 32, 73, 27, 13, 41, 27, 36, 43, 41, 61, 36, 73, 41, + 0, 3, 24, 8, 33, 4, 58, 8, 67, 4, 12, 17, 21, 13, 46, + 17, 55, 13, 64, 9, 9, 22, 18, 18, 43, 22, 52, 18, 77, 22, + 6, 27, 31, 31, 40, 27, 62, 32, 74, 27, 12, 41, 28, 36, 42, + 41, 62, 36, 72, 41, 0, 4, 25, 8, 34, 4, 59, 8, 68, 4, + 13, 17, 22, 13, 47, 17, 56, 13, 65, 9, 10, 22, 19, 18, 44, + 22, 53, 18, 78, 22, 7, 27, 31, 32, 41, 27, 61, 32, 75, 27, + 11, 41, 29, 36, 41, 41, 63, 36, 71, 41, 1, 4, 26, 8, 35, + 4, 60, 8, 69, 4, 14, 17, 23, 13, 32, 9, 57, 13, 66, 9, + 11, 22, 20, 18, 45, 22, 54, 18, 79, 22, 8, 27, 30, 32, 42, + 27, 60, 32, 76, 27, 10, 41, 30, 36, 40, 41, 63, 37, 70, 41, + 2, 4, 27, 8, 36, 4, 61, 8, 70, 4, 15, 17, 24, 13, 33, + 9, 58, 13, 67, 9, 12, 22, 21, 18, 46, 22, 55, 18, 79, 23, + 9, 27, 29, 32, 43, 27, 59, 32, 77, 27, 9, 41, 31, 36, 39, + 41, 62, 37, 69, 41, 3, 4, 28, 8, 37, 4, 62, 8, 71, 4, + 0, 9, 25, 13, 34, 9, 59, 13, 68, 9, 13, 22, 22, 18, 47, + 22, 56, 18, 78, 23, 10, 27, 28, 32, 44, 27, 58, 32, 78, 27, + 8, 41, 31, 37, 38, 41, 61, 37, 68, 41, 4, 4, 29, 8, 38, + 4, 63, 8, 72, 4, 1, 9, 26, 13, 35, 9, 60, 13, 69, 9, + 14, 22, 23, 18, 47, 23, 57, 18, 77, 23, 11, 27, 27, 32, 45, + 27, 57, 32, 79, 27, 7, 41, 30, 37, 37, 41, 60, 37, 67, 41, + 5, 4, 30, 8, 39, 4, 48, 0, 73, 4, 2, 9, 27, 13, 36, + 9, 61, 13, 70, 9, 15, 22, 24, 18, 46, 23, 58, 18, 76, 23, + 12, 27, 26, 32, 46, 27, 56, 32, 79, 28, 6, 41, 29, 37, 36, + 41, 59, 37, 66, 41, 6, 4, 31, 8, 40, 4, 49, 0, 74, 4, + 3, 9, 28, 13, 37, 9, 62, 13, 71, 9, 15, 23, 25, 18, 45, + 23, 59, 18, 75, 23, 13, 27, 25, 32, 47, 27, 55, 32, 78, 28, + 5, 41, 28, 37, 35, 41, 58, 37, 65, 41, 7, 4, 16, 0, 41, + 4, 50, 0, 75, 4, 4, 9, 29, 13, 38, 9, 63, 13, 72, 9, + 14, 23, 26, 18, 44, 23, 60, 18, 74, 23, 14, 27, 24, 32, 47, + 28, 54, 32, 77, 28, 4, 41, 27, 37, 34, 41, 57, 37, 64, 41, + 8, 4, 17, 0, 42, 4, 51, 0, 76, 4, 5, 9, 30, 13, 39, + 9, 63, 14, 73, 9, 13, 23, 27, 18, 43, 23, 61, 18, 73, 23, + 15, 27, 23, 32, 46, 28, 53, 32, 76, 28, 3, 41, 26, 37, 33, + 41, 56, 37, 64, 42, 9, 4, 18, 0, 43, 4, 52, 0, 77, 4, + 6, 9, 31, 13, 40, 9, 62, 14, 74, 9, 12, 23, 28, 18, 42, + 23, 62, 18, 72, 23, 15, 28, 22, 32, 45, 28, 52, 32, 75, 28, + 2, 41, 25, 37, 32, 41, 55, 37, 65, 42, 10, 4, 19, 0, 44, + 4, 53, 0, 78, 4, 7, 9, 31, 14, 41, 9, 61, 14, 75, 9, + 11, 23, 29, 18, 41, 23, 63, 18, 71, 23, 14, 28, 21, 32, 44, + 28, 51, 32, 74, 28, 1, 41, 24, 37, 32, 42, 54, 37, 66, 42, + 11, 4, 20, 0, 45, 4, 54, 0, 79, 4, 8, 9, 30, 14, 42, + 9, 60, 14, 76, 9, 10, 23, 30, 18, 40, 23, 63, 19, 70, 23, + 13, 28, 20, 32, 43, 28, 50, 32, 73, 28, 0, 41, 23, 37, 33, + 42, 53, 37, 67, 42, 12, 4, 21, 0, 46, 4, 55, 0, 79, 5, + 9, 9, 29, 14, 43, 9, 59, 14, 77, 9, 9, 23, 31, 18, 39, + 23, 62, 19, 69, 23, 12, 28, 19, 32, 42, 28, 49, 32, 72, 28, + 0, 42, 22, 37, 34, 42, 52, 37, 68, 42, 13, 4, 22, 0, 47, + 4, 56, 0, 78, 5, 10, 9, 28, 14, 44, 9, 58, 14, 78, 9, + 8, 23, 31, 19, 38, 23, 61, 19, 68, 23, 11, 28, 18, 32, 41, + 28, 48, 32, 71, 28, 1, 42, 21, 37, 35, 42, 51, 37, 69, 42, + 14, 4, 23, 0, 47, 5, 57, 0, 77, 5, 11, 9, 27, 14, 45, + 9, 57, 14, 79, 9, 7, 23, 30, 19, 37, 23, 60, 19, 67, 23, + 10, 28, 17, 32, 40, 28, 48, 33, 70, 28, 2, 42, 20, 37, 36, + 42, 50, 37, 70, 42, 15, 4, 24, 0, 46, 5, 58, 0, 76, 5, + 12, 9, 26, 14, 46, 9, 56, 14, 79, 10, 6, 23, 29, 19, 36, + 23, 59, 19, 66, 23, 9, 28, 16, 32, 39, 28, 49, 33, 69, 28, + 3, 42, 19, 37, 37, 42, 49, 37, 71, 42, 15, 5, 25, 0, 45, + 5, 59, 0, 75, 5, 13, 9, 25, 14, 47, 9, 55, 14, 78, 10, + 5, 23, 28, 19, 35, 23, 58, 19, 65, 23, 8, 28, 16, 33, 38, + 28, 50, 33, 68, 28, 4, 42, 18, 37, 38, 42, 48, 37, 72, 42, + 14, 5, 26, 0, 44, 5, 60, 0, 74, 5, 14, 9, 24, 14, 47, + 10, 54, 14, 77, 10, 4, 23, 27, 19, 34, 23, 57, 19, 64, 23, + 7, 28, 17, 33, 37, 28, 51, 33, 67, 28, 5, 42, 17, 37, 39, + 42, 48, 38, 73, 42, 13, 5, 27, 0, 43, 5, 61, 0, 73, 5, + 15, 9, 23, 14, 46, 10, 53, 14, 76, 10, 3, 23, 26, 19, 33, + 23, 56, 19, 64, 24, 6, 28, 18, 33, 36, 28, 52, 33, 66, 28, + 6, 42, 16, 37, 40, 42, 49, 38, 74, 42, 12, 5, 28, 0, 42, + 5, 62, 0, 72, 5, 15, 10, 22, 14, 45, 10, 52, 14, 75, 10, + 2, 23, 25, 19, 32, 23, 55, 19, 65, 24, 5, 28, 19, 33, 35, + 28, 53, 33, 65, 28, 7, 42, 16, 38, 41, 42, 50, 38, 75, 42, + 11, 5, 29, 0, 41, 5, 63, 0, 71, 5, 14, 10, 21, 14, 44, + 10, 51, 14, 74, 10, 1, 23, 24, 19, 32, 24, 54, 19, 66, 24, + 4, 28, 20, 33, 34, 28, 54, 33, 64, 28, 8, 42, 17, 38, 42, + 42, 51, 38, 76, 42, 10, 5, 30, 0, 40, 5, 63, 1, 70, 5, + 13, 10, 20, 14, 43, 10, 50, 14, 73, 10, 0, 23, 23, 19, 33, + 24, 53, 19, 67, 24, 3, 28, 21, 33, 33, 28, 55, 33, 64, 29, + 9, 42, 18, 38, 43, 42, 52, 38, 77, 42, 9, 5, 31, 0, 39, + 5, 62, 1, 69, 5, 12, 10, 19, 14, 42, 10, 49, 14, 72, 10, + 0, 24, 22, 19, 34, 24, 52, 19, 68, 24, 2, 28, 22, 33, 32, + 28, 56, 33, 65, 29, 10, 42, 19, 38, 44, 42, 53, 38, 78, 42, + 8, 5, 31, 1, 38, 5, 61, 1, 68, 5, 11, 10, 18, 14, 41, + 10, 48, 14, 71, 10, 1, 24, 21, 19, 35, 24, 51, 19, 69, 24, + 1, 28, 23, 33, 32, 29, 57, 33, 66, 29, 11, 42, 20, 38, 45, + 42, 54, 38, 79, 42, 7, 5, 30, 1, 37, 5, 60, 1, 67, 5, + 10, 10, 17, 14, 40, 10, 48, 15, 70, 10, 2, 24, 20, 19, 36, + 24, 50, 19, 70, 24, 0, 28, 24, 33, 33, 29, 58, 33, 67, 29, + 12, 42, 21, 38, 46, 42, 55, 38, 79, 43, 6, 5, 29, 1, 36, + 5, 59, 1, 66, 5, 9, 10, 16, 14, 39, 10, 49, 15, 69, 10, + 3, 24, 19, 19, 37, 24, 49, 19, 71, 24, 0, 29, 25, 33, 34, + 29, 59, 33, 68, 29, 13, 42, 22, 38, 47, 42, 56, 38, 78, 43, + 5, 5, 28, 1, 35, 5, 58, 1, 65, 5, 8, 10, 16, 15, 38, + 10, 50, 15, 68, 10, 4, 24, 18, 19, 38, 24, 48, 19, 72, 24, + 1, 29, 26, 33, 35, 29, 60, 33, 69, 29, 14, 42, 23, 38, 47, + 43, 57, 38, 77, 43, 4, 5, 27, 1, 34, 5, 57, 1, 64, 5, + 7, 10, 17, 15, 37, 10, 51, 15, 67, 10, 5, 24, 17, 19, 39, + 24, 48, 20, 73, 24, 2, 29, 27, 33, 36, 29, 61, 33, 70, 29, + 15, 42, 24, 38, 46, 43, 58, 38, 76, 43, 3, 5, 26, 1, 33, + 5, 56, 1, 64, 6, 6, 10, 18, 15, 36, 10, 52, 15, 66, 10, + 6, 24, 16, 19, 40, 24, 49, 20, 74, 24, 3, 29, 28, 33, 37, + 29, 62, 33, 71, 29, 15, 43, 25, 38, 45, 43, 59, 38, 75, 43, + 2, 5, 25, 1, 32, 5, 55, 1, 65, 6, 5, 10, 19, 15, 35, + 10, 53, 15, 65, 10, 7, 24, 16, 20, 41, 24, 50, 20, 75, 24, + 4, 29, 29, 33, 38, 29, 63, 33, 72, 29, 14, 43, 26, 38, 44, + 43, 60, 38, 74, 43, 1, 5, 24, 1, 32, 6, 54, 1, 66, 6, + 4, 10, 20, 15, 34, 10, 54, 15, 64, 10, 8, 24, 17, 20, 42, + 24, 51, 20, 76, 24, 5, 29, 30, 33, 39, 29, 63, 34, 73, 29, + 13, 43, 27, 38, 43, 43, 61, 38, 73, 43, 0, 5, 23, 1, 33, + 6, 53, 1, 67, 6, 3, 10, 21, 15, 33, 10, 55, 15, 64, 11, + 9, 24, 18, 20, 43, 24, 52, 20, 77, 24, 6, 29, 31, 33, 40, + 29, 62, 34, 74, 29, 12, 43, 28, 38, 42, 43, 62, 38, 72, 43, + 0, 6, 22, 1, 34, 6, 52, 1, 68, 6, 2, 10, 22, 15, 32, + 10, 56, 15, 65, 11, 10, 24, 19, 20, 44, 24, 53, 20, 78, 24, + 7, 29, 31, 34, 41, 29, 61, 34, 75, 29, 11, 43, 29, 38, 41, + 43, 63, 38, 71, 43, 1, 6, 21, 1, 35, 6, 51, 1, 69, 6, + 1, 10, 23, 15, 32, 11, 57, 15, 66, 11, 11, 24, 20, 20, 45, + 24, 54, 20, 79, 24, 8, 29, 30, 34, 42, 29, 60, 34, 76, 29, + 10, 43, 30, 38, 40, 43, 63, 39, 70, 43, 2, 6, 20, 1, 36, + 6, 50, 1, 70, 6, 0, 10, 24, 15, 33, 11, 58, 15, 67, 11, + 12, 24, 21, 20, 46, 24, 55, 20, 79, 25, 9, 29, 29, 34, 43, + 29, 59, 34, 77, 29, 9, 43, 31, 38, 39, 43, 62, 39, 69, 43, + 3, 6, 19, 1, 37, 6, 49, 1, 71, 6, 0, 11, 25, 15, 34, + 11, 59, 15, 68, 11, 13, 24, 22, 20, 47, 24, 56, 20, 78, 25, + 10, 29, 28, 34, 44, 29, 58, 34, 78, 29, 8, 43, 31, 39, 38, + 43, 61, 39, 68, 43, 4, 6, 18, 1, 38, 6, 48, 1, 72, 6, + 1, 11, 26, 15, 35, 11, 60, 15, 69, 11, 14, 24, 23, 20, 47, + 25, 57, 20, 77, 25, 11, 29, 27, 34, 45, 29, 57, 34, 79, 29, + 7, 43, 30, 39, 37, 43, 60, 39, 67, 43, 5, 6, 17, 1, 39, + 6, 48, 2, 73, 6, 2, 11, 27, 15, 36, 11, 61, 15, 70, 11, + 15, 24, 24, 20, 46, 25, 58, 20, 76, 25, 12, 29, 26, 34, 46, + 29, 56, 34, 79, 30, 6, 43, 29, 39, 36, 43, 59, 39, 66, 43, + 6, 6, 16, 1, 40, 6, 49, 2, 74, 6, 3, 11, 28, 15, 37, + 11, 62, 15, 71, 11, 15, 25, 25, 20, 45, 25, 59, 20, 75, 25, + 13, 29, 25, 34, 47, 29, 55, 34, 78, 30, 5, 43, 28, 39, 35, + 43, 58, 39, 65, 43, 7, 6, 16, 2, 41, 6, 50, 2, 75, 6, + 4, 11, 29, 15, 38, 11, 63, 15, 72, 11, 14, 25, 26, 20, 44, + 25, 60, 20, 74, 25, 14, 29, 24, 34, 47, 30, 54, 34, 77, 30, + 4, 43, 27, 39, 34, 43, 57, 39, 64, 43, 8, 6, 17, 2, 42, + 6, 51, 2, 76, 6, 5, 11, 30, 15, 39, 11, 63, 16, 73, 11, + 13, 25, 27, 20, 43, 25, 61, 20, 73, 25, 15, 29, 23, 34, 46, + 30, 53, 34, 76, 30, 3, 43, 26, 39, 33, 43, 56, 39, 64, 44, + 9, 6, 18, 2, 43, 6, 52, 2, 77, 6, 6, 11, 31, 15, 40, + 11, 62, 16, 74, 11, 12, 25, 28, 20, 42, 25, 62, 20, 72, 25, + 15, 30, 22, 34, 45, 30, 52, 34, 75, 30, 2, 43, 25, 39, 32, + 43, 55, 39, 65, 44, 10, 6, 19, 2, 44, 6, 53, 2, 78, 6, + 7, 11, 31, 16, 41, 11, 61, 16, 75, 11, 11, 25, 29, 20, 41, + 25, 63, 20, 71, 25, 14, 30, 21, 34, 44, 30, 51, 34, 74, 30, + 1, 43, 24, 39, 32, 44, 54, 39, 66, 44, 11, 6, 20, 2, 45, + 6, 54, 2, 79, 6, 8, 11, 30, 16, 42, 11, 60, 16, 76, 11, + 10, 25, 30, 20, 40, 25, 63, 21, 70, 25, 13, 30, 20, 34, 43, + 30, 50, 34, 73, 30, 0, 43, 23, 39, 33, 44, 53, 39, 67, 44, + 12, 6, 21, 2, 46, 6, 55, 2, 79, 7, 9, 11, 29, 16, 43, + 11, 59, 16, 77, 11, 9, 25, 31, 20, 39, 25, 62, 21, 69, 25, + 12, 30, 19, 34, 42, 30, 49, 34, 72, 30, 0, 44, 22, 39, 34, + 44, 52, 39, 68, 44, 13, 6, 22, 2, 47, 6, 56, 2, 78, 7, + 10, 11, 28, 16, 44, 11, 58, 16, 78, 11, 8, 25, 31, 21, 38, + 25, 61, 21, 68, 25, 11, 30, 18, 34, 41, 30, 48, 34, 71, 30, + 1, 44, 21, 39, 35, 44, 51, 39, 69, 44, 14, 6, 23, 2, 47, + 7, 57, 2, 77, 7, 11, 11, 27, 16, 45, 11, 57, 16, 79, 11, + 7, 25, 30, 21, 37, 25, 60, 21, 67, 25, 10, 30, 17, 34, 40, + 30, 48, 35, 70, 30, 2, 44, 20, 39, 36, 44, 50, 39, 70, 44, + 15, 6, 24, 2, 46, 7, 58, 2, 76, 7, 12, 11, 26, 16, 46, + 11, 56, 16, 79, 12, 6, 25, 29, 21, 36, 25, 59, 21, 66, 25, + 9, 30, 16, 34, 39, 30, 49, 35, 69, 30, 3, 44, 19, 39, 37, + 44, 49, 39, 71, 44, 15, 7, 25, 2, 45, 7, 59, 2, 75, 7, + 13, 11, 25, 16, 47, 11, 55, 16, 78, 12, 5, 25, 28, 21, 35, + 25, 58, 21, 65, 25, 8, 30, 16, 35, 38, 30, 50, 35, 68, 30, + 4, 44, 18, 39, 38, 44, 48, 39, 72, 44, 14, 7, 26, 2, 44, + 7, 60, 2, 74, 7, 14, 11, 24, 16, 47, 12, 54, 16, 77, 12, + 4, 25, 27, 21, 34, 25, 57, 21, 64, 25, 7, 30, 17, 35, 37, + 30, 51, 35, 67, 30, 5, 44, 17, 39, 39, 44, 48, 40, 73, 44, + 13, 7, 27, 2, 43, 7, 61, 2, 73, 7, 15, 11, 23, 16, 46, + 12, 53, 16, 76, 12, 3, 25, 26, 21, 33, 25, 56, 21, 64, 26, + 6, 30, 18, 35, 36, 30, 52, 35, 66, 30, 6, 44, 16, 39, 40, + 44, 49, 40, 74, 44, 12, 7, 28, 2, 42, 7, 62, 2, 72, 7, + 15, 12, 22, 16, 45, 12, 52, 16, 75, 12, 2, 25, 25, 21, 32, + 25, 55, 21, 65, 26, 5, 30, 19, 35, 35, 30, 53, 35, 65, 30, + 7, 44, 16, 40, 41, 44, 50, 40, 75, 44, 11, 7, 29, 2, 41, + 7, 63, 2, 71, 7, 14, 12, 21, 16, 44, 12, 51, 16, 74, 12, + 1, 25, 24, 21, 32, 26, 54, 21, 66, 26, 4, 30, 20, 35, 34, + 30, 54, 35, 64, 30, 8, 44, 17, 40, 42, 44, 51, 40, 76, 44, + 10, 7, 30, 2, 40, 7, 63, 3, 70, 7, 13, 12, 20, 16, 43, + 12, 50, 16, 73, 12, 0, 25, 23, 21, 33, 26, 53, 21, 67, 26, + 3, 30, 21, 35, 33, 30, 55, 35, 64, 31, 9, 44, 18, 40, 43, + 44, 52, 40, 77, 44, 9, 7, 31, 2, 39, 7, 62, 3, 69, 7, + 12, 12, 19, 16, 42, 12, 49, 16, 72, 12, 0, 26, 22, 21, 34, + 26, 52, 21, 68, 26, 2, 30, 22, 35, 32, 30, 56, 35, 65, 31, + 10, 44, 19, 40, 44, 44, 53, 40, 78, 44, 8, 7, 31, 3, 38, + 7, 61, 3, 68, 7, 11, 12, 18, 16, 41, 12, 48, 16, 71, 12, + 1, 26, 21, 21, 35, 26, 51, 21, 69, 26, 1, 30, 23, 35, 32, + 31, 57, 35, 66, 31, 11, 44, 20, 40, 45, 44, 54, 40, 79, 44, + 7, 7, 30, 3, 37, 7, 60, 3, 67, 7, 10, 12, 17, 16, 40, + 12, 48, 17, 70, 12, 2, 26, 20, 21, 36, 26, 50, 21, 70, 26, + 0, 30, 24, 35, 33, 31, 58, 35, 67, 31, 12, 44, 21, 40, 46, + 44, 55, 40, 64, 36, 6, 7, 29, 3, 36, 7, 59, 3, 66, 7, + 9, 12, 16, 16, 39, 12, 49, 17, 69, 12, 3, 26, 19, 21, 37, + 26, 49, 21, 71, 26, 0, 31, 25, 35, 34, 31, 59, 35, 68, 31, + 13, 44, 22, 40, 47, 44, 56, 40, 65, 36, 5, 7, 28, 3, 35, + 7, 58, 3, 65, 7, 8, 12, 16, 17, 38, 12, 50, 17, 68, 12, + 4, 26, 18, 21, 38, 26, 48, 21, 72, 26, 1, 31, 26, 35, 35, + 31, 60, 35, 69, 31, 14, 44, 23, 40, 32, 36, 57, 40, 66, 36, + 4, 7, 27, 3, 34, 7, 57, 3, 64, 7, 7, 12, 17, 17, 37, + 12, 51, 17, 67, 12, 5, 26, 17, 21, 39, 26, 48, 22, 73, 26, + 2, 31, 27, 35, 36, 31, 61, 35, 70, 31, 15, 44, 24, 40, 33, + 36, 58, 40, 67, 36, 3, 7, 26, 3, 33, 7, 56, 3, 64, 8, + 6, 12, 18, 17, 36, 12, 52, 17, 66, 12, 6, 26, 16, 21, 40, + 26, 49, 22, 74, 26, 3, 31, 28, 35, 37, 31, 62, 35, 71, 31, + 0, 36, 25, 40, 34, 36, 59, 40, 68, 36, 2, 7, 25, 3, 32, + 7, 55, 3, 65, 8, 5, 12, 19, 17, 35, 12, 53, 17, 65, 12, + 7, 26, 16, 22, 41, 26, 50, 22, 75, 26, 4, 31, 29, 35, 38, + 31, 63, 35, 72, 31, 1, 36, 26, 40, 35, 36, 60, 40, 69, 36, + 1, 7, 24, 3, 32, 8, 54, 3, 66, 8, 4, 12, 20, 17, 34, + 12, 54, 17, 64, 12, 8, 26, 17, 22, 42, 26, 51, 22, 76, 26, + 5, 31, 30, 35, 39, 31, 48, 27, 73, 31, 2, 36, 27, 40, 36, + 36, 61, 40, 70, 36, 0, 7, 23, 3, 33, 8, 53, 3, 67, 8, + 3, 12, 21, 17, 33, 12, 55, 17, 64, 13, 9, 26, 18, 22, 43, + 26, 52, 22, 77, 26, 6, 31, 31, 35, 40, 31, 49, 27, 74, 31, + 3, 36, 28, 40, 37, 36, 62, 40, 71, 36, 0, 8, 22, 3, 34, + 8, 52, 3, 68, 8, 2, 12, 22, 17, 32, 12, 56, 17, 65, 13, + 10, 26, 19, 22, 44, 26, 53, 22, 78, 26, 7, 31, 16, 27, 41, + 31, 50, 27, 75, 31, 4, 36, 29, 40, 38, 36, 63, 40, 72, 36, + 1, 8, 21, 3, 35, 8, 51, 3, 69, 8, 1, 12, 23, 17, 32, + 13, 57, 17, 66, 13, 11, 26, 20, 22, 45, 26, 54, 22, 79, 26, + 8, 31, 17, 27, 42, 31, 51, 27, 76, 31, 5, 36, 30, 40, 39, + 36, 63, 41, 73, 36, 2, 8, 20, 3, 36, 8, 50, 3, 70, 8, + 0, 12, 24, 17, 33, 13, 58, 17, 67, 13, 12, 26, 21, 22, 46, + 26, 55, 22, 64, 18, 9, 31, 18, 27, 43, 31, 52, 27, 77, 31, + 6, 36, 31, 40, 40, 36, 62, 41, 74, 36, 3, 8, 19, 3, 37, + 8, 49, 3, 71, 8, 0, 13, 25, 17, 34, 13, 59, 17, 68, 13, + 13, 26, 22, 22, 47, 26, 56, 22, 65, 18, 10, 31, 19, 27, 44, + 31, 53, 27, 78, 31, 7, 36, 31, 41, 41, 36, 61, 41, 75, 36, + 4, 8, 18, 3, 38, 8, 48, 3, 72, 8, 1, 13, 26, 17, 35, + 13, 60, 17, 69, 13, 14, 26, 23, 22, 32, 18, 57, 22, 66, 18, + 11, 31, 20, 27, 45, 31, 54, 27, 79, 31, 8, 36, 30, 41, 42, + 36, 60, 41, 76, 36, 5, 8, 17, 3, 39, 8, 48, 4, 73, 8, + 2, 13, 27, 17, 36, 13, 61, 17, 70, 13, 15, 26, 24, 22, 33, + 18, 58, 22, 67, 18, 12, 31, 21, 27, 46, 31, 55, 27, 79, 32, + 9, 36, 29, 41, 43, 36, 59, 41, 77, 36, 6, 8, 16, 3, 40, + 8, 49, 4, 74, 8, 3, 13, 28, 17, 37, 13, 62, 17, 71, 13, + 0, 18, 25, 22, 34, 18, 59, 22, 68, 18, 13, 31, 22, 27, 47, + 31, 56, 27, 78, 32, 10, 36, 28, 41, 44, 36, 58, 41, 78, 36, + 7, 8, 16, 4, 41, 8, 50, 4, 75, 8, 4, 13, 29, 17, 38, + 13, 63, 17, 72, 13, 1, 18, 26, 22, 35, 18, 60, 22, 69, 18, + 14, 31, 23, 27, 47, 32, 57, 27, 77, 32, 11, 36, 27, 41, 45, + 36, 57, 41, 79, 36, 8, 8, 17, 4, 42, 8, 51, 4, 76, 8, + 5, 13, 30, 17, 39, 13, 48, 9, 73, 13, 2, 18, 27, 22, 36, + 18, 61, 22, 70, 18, 15, 31, 24, 27, 46, 32, 58, 27, 76, 32, + 12, 36, 26, 41, 46, 36, 56, 41, 79, 37, 9, 8, 18, 4, 43, + 8, 52, 4, 77, 8, 6, 13, 31, 17, 40, 13, 49, 9, 74, 13, + 3, 18, 28, 22, 37, 18, 62, 22, 71, 18, 15, 32, 25, 27, 45, + 32, 59, 27, 75, 32, 13, 36, 25, 41, 47, 36, 55, 41, 78, 37, + 10, 8, 19, 4, 44, 8, 53, 4, 78, 8, 7, 13, 16, 9, 41, + 13, 50, 9, 75, 13, 4, 18, 29, 22, 38, 18, 63, 22, 72, 18, + 14, 32, 26, 27, 44, 32, 60, 27, 74, 32, 14, 36, 24, 41, 47, + 37, 54, 41, 77, 37, 11, 8, 20, 4, 45, 8, 54, 4, 79, 8, + 8, 13, 17, 9, 42, 13, 51, 9, 76, 13, 5, 18, 30, 22, 39, + 18, 63, 23, 73, 18, 13, 32, 27, 27, 43, 32, 61, 27, 73, 32, + 15, 36, 23, 41, 46, 37, 53, 41, 76, 37, 12, 8, 21, 4, 46, + 8, 55, 4, 64, 0, 9, 13, 18, 9, 43, 13, 52, 9, 77, 13, + 6, 18, 31, 22, 40, 18, 62, 23, 74, 18, 12, 32, 28, 27, 42, + 32, 62, 27, 72, 32, 15, 37, 22, 41, 45, 37, 52, 41, 75, 37, + 13, 8, 22, 4, 47, 8, 56, 4, 65, 0, 10, 13, 19, 9, 44, + 13, 53, 9, 78, 13, 7, 18, 31, 23, 41, 18, 61, 23, 75, 18, + 11, 32, 29, 27, 41, 32, 63, 27, 71, 32, 14, 37, 21, 41, 44, + 37, 51, 41, 74, 37, 14, 8, 23, 4, 32, 0, 57, 4, 66, 0, + 11, 13, 20, 9, 45, 13, 54, 9, 79, 13, 8, 18, 30, 23, 42, + 18, 60, 23, 76, 18, 10, 32, 30, 27, 40, 32, 63, 28, 70, 32, + 13, 37, 20, 41, 43, 37, 50, 41, 73, 37, 15, 8, 24, 4, 33, + 0, 58, 4, 67, 0, 12, 13, 21, 9, 46, 13, 55, 9, 79, 14, + 9, 18, 29, 23, 43, 18, 59, 23, 77, 18, 9, 32, 31, 27, 39, + 32, 62, 28, 69, 32, 12, 37, 19, 41, 42, 37, 49, 41, 72, 37, +}; + +static const uint8_t hq_tab_06[] = { + 0, 0, 25, 8, 34, 0, 59, 8, 68, 0, 13, 25, 22, 17, 47, + 25, 56, 17, 78, 26, 10, 34, 28, 43, 44, 34, 58, 43, 78, 34, + 8, 60, 31, 52, 38, 60, 61, 52, 68, 60, 1, 0, 26, 8, 35, + 0, 60, 8, 69, 0, 14, 25, 23, 17, 47, 26, 57, 17, 77, 26, + 11, 34, 27, 43, 45, 34, 57, 43, 79, 34, 7, 60, 30, 52, 37, + 60, 60, 52, 67, 60, 2, 0, 27, 8, 36, 0, 61, 8, 70, 0, + 15, 25, 24, 17, 46, 26, 58, 17, 76, 26, 12, 34, 26, 43, 46, + 34, 56, 43, 79, 35, 6, 60, 29, 52, 36, 60, 59, 52, 66, 60, + 3, 0, 28, 8, 37, 0, 62, 8, 71, 0, 15, 26, 25, 17, 45, + 26, 59, 17, 75, 26, 13, 34, 25, 43, 47, 34, 55, 43, 78, 35, + 5, 60, 28, 52, 35, 60, 58, 52, 65, 60, 4, 0, 29, 8, 38, + 0, 63, 8, 72, 0, 14, 26, 26, 17, 44, 26, 60, 17, 74, 26, + 14, 34, 24, 43, 47, 35, 54, 43, 77, 35, 4, 60, 27, 52, 34, + 60, 57, 52, 64, 60, 5, 0, 30, 8, 39, 0, 63, 9, 73, 0, + 13, 26, 27, 17, 43, 26, 61, 17, 73, 26, 15, 34, 23, 43, 46, + 35, 53, 43, 76, 35, 3, 60, 26, 52, 33, 60, 56, 52, 64, 61, + 6, 0, 31, 8, 40, 0, 62, 9, 74, 0, 12, 26, 28, 17, 42, + 26, 62, 17, 72, 26, 15, 35, 22, 43, 45, 35, 52, 43, 75, 35, + 2, 60, 25, 52, 32, 60, 55, 52, 65, 61, 7, 0, 31, 9, 41, + 0, 61, 9, 75, 0, 11, 26, 29, 17, 41, 26, 63, 17, 71, 26, + 14, 35, 21, 43, 44, 35, 51, 43, 74, 35, 1, 60, 24, 52, 32, + 61, 54, 52, 66, 61, 8, 0, 30, 9, 42, 0, 60, 9, 76, 0, + 10, 26, 30, 17, 40, 26, 63, 18, 70, 26, 13, 35, 20, 43, 43, + 35, 50, 43, 73, 35, 0, 60, 23, 52, 33, 61, 53, 52, 67, 61, + 9, 0, 29, 9, 43, 0, 59, 9, 77, 0, 9, 26, 31, 17, 39, + 26, 62, 18, 69, 26, 12, 35, 19, 43, 42, 35, 49, 43, 72, 35, + 0, 61, 22, 52, 34, 61, 52, 52, 68, 61, 10, 0, 28, 9, 44, + 0, 58, 9, 78, 0, 8, 26, 31, 18, 38, 26, 61, 18, 68, 26, + 11, 35, 18, 43, 41, 35, 48, 43, 71, 35, 1, 61, 21, 52, 35, + 61, 51, 52, 69, 61, 11, 0, 27, 9, 45, 0, 57, 9, 79, 0, + 7, 26, 30, 18, 37, 26, 60, 18, 67, 26, 10, 35, 17, 43, 40, + 35, 48, 44, 70, 35, 2, 61, 20, 52, 36, 61, 50, 52, 70, 61, + 12, 0, 26, 9, 46, 0, 56, 9, 79, 1, 6, 26, 29, 18, 36, + 26, 59, 18, 66, 26, 9, 35, 16, 43, 39, 35, 49, 44, 69, 35, + 3, 61, 19, 52, 37, 61, 49, 52, 71, 61, 13, 0, 25, 9, 47, + 0, 55, 9, 78, 1, 5, 26, 28, 18, 35, 26, 58, 18, 65, 26, + 8, 35, 16, 44, 38, 35, 50, 44, 68, 35, 4, 61, 18, 52, 38, + 61, 48, 52, 72, 61, 14, 0, 24, 9, 47, 1, 54, 9, 77, 1, + 4, 26, 27, 18, 34, 26, 57, 18, 64, 26, 7, 35, 17, 44, 37, + 35, 51, 44, 67, 35, 5, 61, 17, 52, 39, 61, 48, 53, 73, 61, + 15, 0, 23, 9, 46, 1, 53, 9, 76, 1, 3, 26, 26, 18, 33, + 26, 56, 18, 64, 27, 6, 35, 18, 44, 36, 35, 52, 44, 66, 35, + 6, 61, 16, 52, 40, 61, 49, 53, 74, 61, 15, 1, 22, 9, 45, + 1, 52, 9, 75, 1, 2, 26, 25, 18, 32, 26, 55, 18, 65, 27, + 5, 35, 19, 44, 35, 35, 53, 44, 65, 35, 7, 61, 16, 53, 41, + 61, 50, 53, 75, 61, 14, 1, 21, 9, 44, 1, 51, 9, 74, 1, + 1, 26, 24, 18, 32, 27, 54, 18, 66, 27, 4, 35, 20, 44, 34, + 35, 54, 44, 64, 35, 8, 61, 17, 53, 42, 61, 51, 53, 76, 61, + 13, 1, 20, 9, 43, 1, 50, 9, 73, 1, 0, 26, 23, 18, 33, + 27, 53, 18, 67, 27, 3, 35, 21, 44, 33, 35, 55, 44, 64, 36, + 9, 61, 18, 53, 43, 61, 52, 53, 77, 61, 12, 1, 19, 9, 42, + 1, 49, 9, 72, 1, 0, 27, 22, 18, 34, 27, 52, 18, 68, 27, + 2, 35, 22, 44, 32, 35, 56, 44, 65, 36, 10, 61, 19, 53, 44, + 61, 53, 53, 78, 61, 11, 1, 18, 9, 41, 1, 48, 9, 71, 1, + 1, 27, 21, 18, 35, 27, 51, 18, 69, 27, 1, 35, 23, 44, 32, + 36, 57, 44, 66, 36, 11, 61, 20, 53, 45, 61, 54, 53, 79, 61, + 10, 1, 17, 9, 40, 1, 48, 10, 70, 1, 2, 27, 20, 18, 36, + 27, 50, 18, 70, 27, 0, 35, 24, 44, 33, 36, 58, 44, 67, 36, + 12, 61, 21, 53, 46, 61, 55, 53, 79, 62, 9, 1, 16, 9, 39, + 1, 49, 10, 69, 1, 3, 27, 19, 18, 37, 27, 49, 18, 71, 27, + 0, 36, 25, 44, 34, 36, 59, 44, 68, 36, 13, 61, 22, 53, 47, + 61, 56, 53, 78, 62, 8, 1, 16, 10, 38, 1, 50, 10, 68, 1, + 4, 27, 18, 18, 38, 27, 48, 18, 72, 27, 1, 36, 26, 44, 35, + 36, 60, 44, 69, 36, 14, 61, 23, 53, 47, 62, 57, 53, 77, 62, + 7, 1, 17, 10, 37, 1, 51, 10, 67, 1, 5, 27, 17, 18, 39, + 27, 48, 19, 73, 27, 2, 36, 27, 44, 36, 36, 61, 44, 70, 36, + 15, 61, 24, 53, 46, 62, 58, 53, 76, 62, 6, 1, 18, 10, 36, + 1, 52, 10, 66, 1, 6, 27, 16, 18, 40, 27, 49, 19, 74, 27, + 3, 36, 28, 44, 37, 36, 62, 44, 71, 36, 15, 62, 25, 53, 45, + 62, 59, 53, 75, 62, 5, 1, 19, 10, 35, 1, 53, 10, 65, 1, + 7, 27, 16, 19, 41, 27, 50, 19, 75, 27, 4, 36, 29, 44, 38, + 36, 63, 44, 72, 36, 14, 62, 26, 53, 44, 62, 60, 53, 74, 62, + 4, 1, 20, 10, 34, 1, 54, 10, 64, 1, 8, 27, 17, 19, 42, + 27, 51, 19, 76, 27, 5, 36, 30, 44, 39, 36, 63, 45, 73, 36, + 13, 62, 27, 53, 43, 62, 61, 53, 73, 62, 3, 1, 21, 10, 33, + 1, 55, 10, 64, 2, 9, 27, 18, 19, 43, 27, 52, 19, 77, 27, + 6, 36, 31, 44, 40, 36, 62, 45, 74, 36, 12, 62, 28, 53, 42, + 62, 62, 53, 72, 62, 2, 1, 22, 10, 32, 1, 56, 10, 65, 2, + 10, 27, 19, 19, 44, 27, 53, 19, 78, 27, 7, 36, 31, 45, 41, + 36, 61, 45, 75, 36, 11, 62, 29, 53, 41, 62, 63, 53, 71, 62, + 1, 1, 23, 10, 32, 2, 57, 10, 66, 2, 11, 27, 20, 19, 45, + 27, 54, 19, 79, 27, 8, 36, 30, 45, 42, 36, 60, 45, 76, 36, + 10, 62, 30, 53, 40, 62, 63, 54, 70, 62, 0, 1, 24, 10, 33, + 2, 58, 10, 67, 2, 12, 27, 21, 19, 46, 27, 55, 19, 79, 28, + 9, 36, 29, 45, 43, 36, 59, 45, 77, 36, 9, 62, 31, 53, 39, + 62, 62, 54, 69, 62, 0, 2, 25, 10, 34, 2, 59, 10, 68, 2, + 13, 27, 22, 19, 47, 27, 56, 19, 78, 28, 10, 36, 28, 45, 44, + 36, 58, 45, 78, 36, 8, 62, 31, 54, 38, 62, 61, 54, 68, 62, + 1, 2, 26, 10, 35, 2, 60, 10, 69, 2, 14, 27, 23, 19, 47, + 28, 57, 19, 77, 28, 11, 36, 27, 45, 45, 36, 57, 45, 79, 36, + 7, 62, 30, 54, 37, 62, 60, 54, 67, 62, 2, 2, 27, 10, 36, + 2, 61, 10, 70, 2, 15, 27, 24, 19, 46, 28, 58, 19, 76, 28, + 12, 36, 26, 45, 46, 36, 56, 45, 79, 37, 6, 62, 29, 54, 36, + 62, 59, 54, 66, 62, 3, 2, 28, 10, 37, 2, 62, 10, 71, 2, + 15, 28, 25, 19, 45, 28, 59, 19, 75, 28, 13, 36, 25, 45, 47, + 36, 55, 45, 78, 37, 5, 62, 28, 54, 35, 62, 58, 54, 65, 62, + 4, 2, 29, 10, 38, 2, 63, 10, 72, 2, 14, 28, 26, 19, 44, + 28, 60, 19, 74, 28, 14, 36, 24, 45, 47, 37, 54, 45, 77, 37, + 4, 62, 27, 54, 34, 62, 57, 54, 64, 62, 5, 2, 30, 10, 39, + 2, 63, 11, 73, 2, 13, 28, 27, 19, 43, 28, 61, 19, 73, 28, + 15, 36, 23, 45, 46, 37, 53, 45, 76, 37, 3, 62, 26, 54, 33, + 62, 56, 54, 64, 63, 6, 2, 31, 10, 40, 2, 62, 11, 74, 2, + 12, 28, 28, 19, 42, 28, 62, 19, 72, 28, 15, 37, 22, 45, 45, + 37, 52, 45, 75, 37, 2, 62, 25, 54, 32, 62, 55, 54, 65, 63, + 7, 2, 31, 11, 41, 2, 61, 11, 75, 2, 11, 28, 29, 19, 41, + 28, 63, 19, 71, 28, 14, 37, 21, 45, 44, 37, 51, 45, 74, 37, + 1, 62, 24, 54, 32, 63, 54, 54, 66, 63, 8, 2, 30, 11, 42, + 2, 60, 11, 76, 2, 10, 28, 30, 19, 40, 28, 63, 20, 70, 28, + 13, 37, 20, 45, 43, 37, 50, 45, 73, 37, 0, 62, 23, 54, 33, + 63, 53, 54, 67, 63, 9, 2, 29, 11, 43, 2, 59, 11, 77, 2, + 9, 28, 31, 19, 39, 28, 62, 20, 69, 28, 12, 37, 19, 45, 42, + 37, 49, 45, 72, 37, 0, 63, 22, 54, 34, 63, 52, 54, 68, 63, + 10, 2, 28, 11, 44, 2, 58, 11, 78, 2, 8, 28, 31, 20, 38, + 28, 61, 20, 68, 28, 11, 37, 18, 45, 41, 37, 48, 45, 71, 37, + 1, 63, 21, 54, 35, 63, 51, 54, 69, 63, 11, 2, 27, 11, 45, + 2, 57, 11, 79, 2, 7, 28, 30, 20, 37, 28, 60, 20, 67, 28, + 10, 37, 17, 45, 40, 37, 48, 46, 70, 37, 2, 63, 20, 54, 36, + 63, 50, 54, 70, 63, 12, 2, 26, 11, 46, 2, 56, 11, 79, 3, + 6, 28, 29, 20, 36, 28, 59, 20, 66, 28, 9, 37, 16, 45, 39, + 37, 49, 46, 69, 37, 3, 63, 19, 54, 37, 63, 49, 54, 71, 63, + 13, 2, 25, 11, 47, 2, 55, 11, 78, 3, 5, 28, 28, 20, 35, + 28, 58, 20, 65, 28, 8, 37, 16, 46, 38, 37, 50, 46, 68, 37, + 4, 63, 18, 54, 38, 63, 48, 54, 72, 63, 14, 2, 24, 11, 47, + 3, 54, 11, 77, 3, 4, 28, 27, 20, 34, 28, 57, 20, 64, 28, + 7, 37, 17, 46, 37, 37, 51, 46, 67, 37, 5, 63, 17, 54, 39, + 63, 48, 55, 73, 63, 15, 2, 23, 11, 46, 3, 53, 11, 76, 3, + 3, 28, 26, 20, 33, 28, 56, 20, 64, 29, 6, 37, 18, 46, 36, + 37, 52, 46, 66, 37, 6, 63, 16, 54, 40, 63, 49, 55, 74, 63, + 15, 3, 22, 11, 45, 3, 52, 11, 75, 3, 2, 28, 25, 20, 32, + 28, 55, 20, 65, 29, 5, 37, 19, 46, 35, 37, 53, 46, 65, 37, + 7, 63, 16, 55, 41, 63, 50, 55, 75, 63, 14, 3, 21, 11, 44, + 3, 51, 11, 74, 3, 1, 28, 24, 20, 32, 29, 54, 20, 66, 29, + 4, 37, 20, 46, 34, 37, 54, 46, 64, 37, 8, 63, 17, 55, 42, + 63, 51, 55, 76, 63, 13, 3, 20, 11, 43, 3, 50, 11, 73, 3, + 0, 28, 23, 20, 33, 29, 53, 20, 67, 29, 3, 37, 21, 46, 33, + 37, 55, 46, 64, 38, 9, 63, 18, 55, 43, 63, 52, 55, 77, 63, + 12, 3, 19, 11, 42, 3, 49, 11, 72, 3, 0, 29, 22, 20, 34, + 29, 52, 20, 68, 29, 2, 37, 22, 46, 32, 37, 56, 46, 65, 38, + 10, 63, 19, 55, 44, 63, 53, 55, 78, 63, 11, 3, 18, 11, 41, + 3, 48, 11, 71, 3, 1, 29, 21, 20, 35, 29, 51, 20, 69, 29, + 1, 37, 23, 46, 32, 38, 57, 46, 66, 38, 11, 63, 20, 55, 45, + 63, 54, 55, 79, 63, 10, 3, 17, 11, 40, 3, 48, 12, 70, 3, + 2, 29, 20, 20, 36, 29, 50, 20, 70, 29, 0, 37, 24, 46, 33, + 38, 58, 46, 67, 38, 12, 63, 21, 55, 46, 63, 55, 55, 79, 64, + 9, 3, 16, 11, 39, 3, 49, 12, 69, 3, 3, 29, 19, 20, 37, + 29, 49, 20, 71, 29, 0, 38, 25, 46, 34, 38, 59, 46, 68, 38, + 13, 63, 22, 55, 47, 63, 56, 55, 78, 64, 8, 3, 16, 12, 38, + 3, 50, 12, 68, 3, 4, 29, 18, 20, 38, 29, 48, 20, 72, 29, + 1, 38, 26, 46, 35, 38, 60, 46, 69, 38, 14, 63, 23, 55, 47, + 64, 57, 55, 77, 64, 7, 3, 17, 12, 37, 3, 51, 12, 67, 3, + 5, 29, 17, 20, 39, 29, 48, 21, 73, 29, 2, 38, 27, 46, 36, + 38, 61, 46, 70, 38, 15, 63, 24, 55, 46, 64, 58, 55, 76, 64, + 6, 3, 18, 12, 36, 3, 52, 12, 66, 3, 6, 29, 16, 20, 40, + 29, 49, 21, 74, 29, 3, 38, 28, 46, 37, 38, 62, 46, 71, 38, + 15, 64, 25, 55, 45, 64, 59, 55, 75, 64, 5, 3, 19, 12, 35, + 3, 53, 12, 65, 3, 7, 29, 16, 21, 41, 29, 50, 21, 75, 29, + 4, 38, 29, 46, 38, 38, 63, 46, 72, 38, 14, 64, 26, 55, 44, + 64, 60, 55, 74, 64, 4, 3, 20, 12, 34, 3, 54, 12, 64, 3, + 8, 29, 17, 21, 42, 29, 51, 21, 76, 29, 5, 38, 30, 46, 39, + 38, 63, 47, 73, 38, 13, 64, 27, 55, 43, 64, 61, 55, 73, 64, + 3, 3, 21, 12, 33, 3, 55, 12, 64, 4, 9, 29, 18, 21, 43, + 29, 52, 21, 77, 29, 6, 38, 31, 46, 40, 38, 62, 47, 74, 38, + 12, 64, 28, 55, 42, 64, 62, 55, 72, 64, 2, 3, 22, 12, 32, + 3, 56, 12, 65, 4, 10, 29, 19, 21, 44, 29, 53, 21, 78, 29, + 7, 38, 31, 47, 41, 38, 61, 47, 75, 38, 11, 64, 29, 55, 41, + 64, 63, 55, 71, 64, 1, 3, 23, 12, 32, 4, 57, 12, 66, 4, + 11, 29, 20, 21, 45, 29, 54, 21, 79, 29, 8, 38, 30, 47, 42, + 38, 60, 47, 76, 38, 10, 64, 30, 55, 40, 64, 63, 56, 70, 64, + 0, 3, 24, 12, 33, 4, 58, 12, 67, 4, 12, 29, 21, 21, 46, + 29, 55, 21, 79, 30, 9, 38, 29, 47, 43, 38, 59, 47, 77, 38, + 9, 64, 31, 55, 39, 64, 62, 56, 69, 64, 0, 4, 25, 12, 34, + 4, 59, 12, 68, 4, 13, 29, 22, 21, 47, 29, 56, 21, 78, 30, + 10, 38, 28, 47, 44, 38, 58, 47, 78, 38, 8, 64, 31, 56, 38, + 64, 61, 56, 68, 64, 1, 4, 26, 12, 35, 4, 60, 12, 69, 4, + 14, 29, 23, 21, 47, 30, 57, 21, 77, 30, 11, 38, 27, 47, 45, + 38, 57, 47, 79, 38, 7, 64, 30, 56, 37, 64, 60, 56, 67, 64, + 2, 4, 27, 12, 36, 4, 61, 12, 70, 4, 15, 29, 24, 21, 46, + 30, 58, 21, 76, 30, 12, 38, 26, 47, 46, 38, 56, 47, 79, 39, + 6, 64, 29, 56, 36, 64, 59, 56, 66, 64, 3, 4, 28, 12, 37, + 4, 62, 12, 71, 4, 15, 30, 25, 21, 45, 30, 59, 21, 75, 30, + 13, 38, 25, 47, 47, 38, 55, 47, 78, 39, 5, 64, 28, 56, 35, + 64, 58, 56, 65, 64, 4, 4, 29, 12, 38, 4, 63, 12, 72, 4, + 14, 30, 26, 21, 44, 30, 60, 21, 74, 30, 14, 38, 24, 47, 47, + 39, 54, 47, 77, 39, 4, 64, 27, 56, 34, 64, 57, 56, 64, 64, + 5, 4, 30, 12, 39, 4, 63, 13, 73, 4, 13, 30, 27, 21, 43, + 30, 61, 21, 73, 30, 15, 38, 23, 47, 46, 39, 53, 47, 76, 39, + 3, 64, 26, 56, 33, 64, 56, 56, 64, 65, 6, 4, 31, 12, 40, + 4, 62, 13, 74, 4, 12, 30, 28, 21, 42, 30, 62, 21, 72, 30, + 15, 39, 22, 47, 45, 39, 52, 47, 75, 39, 2, 64, 25, 56, 32, + 64, 55, 56, 65, 65, 7, 4, 31, 13, 41, 4, 61, 13, 75, 4, + 11, 30, 29, 21, 41, 30, 63, 21, 71, 30, 14, 39, 21, 47, 44, + 39, 51, 47, 74, 39, 1, 64, 24, 56, 32, 65, 54, 56, 66, 65, + 8, 4, 30, 13, 42, 4, 60, 13, 76, 4, 10, 30, 30, 21, 40, + 30, 63, 22, 70, 30, 13, 39, 20, 47, 43, 39, 50, 47, 73, 39, + 0, 64, 23, 56, 33, 65, 53, 56, 67, 65, 9, 4, 29, 13, 43, + 4, 59, 13, 77, 4, 9, 30, 31, 21, 39, 30, 62, 22, 69, 30, + 12, 39, 19, 47, 42, 39, 49, 47, 72, 39, 0, 65, 22, 56, 34, + 65, 52, 56, 68, 65, 10, 4, 28, 13, 44, 4, 58, 13, 78, 4, + 8, 30, 31, 22, 38, 30, 61, 22, 68, 30, 11, 39, 18, 47, 41, + 39, 48, 47, 71, 39, 1, 65, 21, 56, 35, 65, 51, 56, 69, 65, + 11, 4, 27, 13, 45, 4, 57, 13, 79, 4, 7, 30, 30, 22, 37, + 30, 60, 22, 67, 30, 10, 39, 17, 47, 40, 39, 48, 48, 70, 39, + 2, 65, 20, 56, 36, 65, 50, 56, 70, 65, 12, 4, 26, 13, 46, + 4, 56, 13, 79, 5, 6, 30, 29, 22, 36, 30, 59, 22, 66, 30, + 9, 39, 16, 47, 39, 39, 49, 48, 69, 39, 3, 65, 19, 56, 37, + 65, 49, 56, 71, 65, 13, 4, 25, 13, 47, 4, 55, 13, 78, 5, + 5, 30, 28, 22, 35, 30, 58, 22, 65, 30, 8, 39, 16, 48, 38, + 39, 50, 48, 68, 39, 4, 65, 18, 56, 38, 65, 48, 56, 72, 65, + 14, 4, 24, 13, 47, 5, 54, 13, 77, 5, 4, 30, 27, 22, 34, + 30, 57, 22, 64, 30, 7, 39, 17, 48, 37, 39, 51, 48, 67, 39, + 5, 65, 17, 56, 39, 65, 48, 57, 73, 65, 15, 4, 23, 13, 46, + 5, 53, 13, 76, 5, 3, 30, 26, 22, 33, 30, 56, 22, 64, 31, + 6, 39, 18, 48, 36, 39, 52, 48, 66, 39, 6, 65, 16, 56, 40, + 65, 49, 57, 74, 65, 15, 5, 22, 13, 45, 5, 52, 13, 75, 5, + 2, 30, 25, 22, 32, 30, 55, 22, 65, 31, 5, 39, 19, 48, 35, + 39, 53, 48, 65, 39, 7, 65, 16, 57, 41, 65, 50, 57, 75, 65, + 14, 5, 21, 13, 44, 5, 51, 13, 74, 5, 1, 30, 24, 22, 32, + 31, 54, 22, 66, 31, 4, 39, 20, 48, 34, 39, 54, 48, 64, 39, + 8, 65, 17, 57, 42, 65, 51, 57, 76, 65, 13, 5, 20, 13, 43, + 5, 50, 13, 73, 5, 0, 30, 23, 22, 33, 31, 53, 22, 67, 31, + 3, 39, 21, 48, 33, 39, 55, 48, 64, 40, 9, 65, 18, 57, 43, + 65, 52, 57, 77, 65, 12, 5, 19, 13, 42, 5, 49, 13, 72, 5, + 0, 31, 22, 22, 34, 31, 52, 22, 68, 31, 2, 39, 22, 48, 32, + 39, 56, 48, 65, 40, 10, 65, 19, 57, 44, 65, 53, 57, 78, 65, + 11, 5, 18, 13, 41, 5, 48, 13, 71, 5, 1, 31, 21, 22, 35, + 31, 51, 22, 69, 31, 1, 39, 23, 48, 32, 40, 57, 48, 66, 40, + 11, 65, 20, 57, 45, 65, 54, 57, 79, 65, 10, 5, 17, 13, 40, + 5, 48, 14, 70, 5, 2, 31, 20, 22, 36, 31, 50, 22, 70, 31, + 0, 39, 24, 48, 33, 40, 58, 48, 67, 40, 12, 65, 21, 57, 46, + 65, 55, 57, 79, 66, 9, 5, 16, 13, 39, 5, 49, 14, 69, 5, + 3, 31, 19, 22, 37, 31, 49, 22, 71, 31, 0, 40, 25, 48, 34, + 40, 59, 48, 68, 40, 13, 65, 22, 57, 47, 65, 56, 57, 78, 66, + 8, 5, 16, 14, 38, 5, 50, 14, 68, 5, 4, 31, 18, 22, 38, + 31, 48, 22, 72, 31, 1, 40, 26, 48, 35, 40, 60, 48, 69, 40, + 14, 65, 23, 57, 47, 66, 57, 57, 77, 66, 7, 5, 17, 14, 37, + 5, 51, 14, 67, 5, 5, 31, 17, 22, 39, 31, 48, 23, 73, 31, + 2, 40, 27, 48, 36, 40, 61, 48, 70, 40, 15, 65, 24, 57, 46, + 66, 58, 57, 76, 66, 6, 5, 18, 14, 36, 5, 52, 14, 66, 5, + 6, 31, 16, 22, 40, 31, 49, 23, 74, 31, 3, 40, 28, 48, 37, + 40, 62, 48, 71, 40, 15, 66, 25, 57, 45, 66, 59, 57, 75, 66, + 5, 5, 19, 14, 35, 5, 53, 14, 65, 5, 7, 31, 16, 23, 41, + 31, 50, 23, 75, 31, 4, 40, 29, 48, 38, 40, 63, 48, 72, 40, + 14, 66, 26, 57, 44, 66, 60, 57, 74, 66, 4, 5, 20, 14, 34, + 5, 54, 14, 64, 5, 8, 31, 17, 23, 42, 31, 51, 23, 76, 31, + 5, 40, 30, 48, 39, 40, 63, 49, 73, 40, 13, 66, 27, 57, 43, + 66, 61, 57, 73, 66, 3, 5, 21, 14, 33, 5, 55, 14, 64, 6, + 9, 31, 18, 23, 43, 31, 52, 23, 77, 31, 6, 40, 31, 48, 40, + 40, 62, 49, 74, 40, 12, 66, 28, 57, 42, 66, 62, 57, 72, 66, + 2, 5, 22, 14, 32, 5, 56, 14, 65, 6, 10, 31, 19, 23, 44, + 31, 53, 23, 78, 31, 7, 40, 31, 49, 41, 40, 61, 49, 75, 40, + 11, 66, 29, 57, 41, 66, 63, 57, 71, 66, 1, 5, 23, 14, 32, + 6, 57, 14, 66, 6, 11, 31, 20, 23, 45, 31, 54, 23, 79, 31, + 8, 40, 30, 49, 42, 40, 60, 49, 76, 40, 10, 66, 30, 57, 40, + 66, 63, 58, 70, 66, 0, 5, 24, 14, 33, 6, 58, 14, 67, 6, + 12, 31, 21, 23, 46, 31, 55, 23, 79, 32, 9, 40, 29, 49, 43, + 40, 59, 49, 77, 40, 9, 66, 31, 57, 39, 66, 62, 58, 69, 66, + 0, 6, 25, 14, 34, 6, 59, 14, 68, 6, 13, 31, 22, 23, 47, + 31, 56, 23, 78, 32, 10, 40, 28, 49, 44, 40, 58, 49, 78, 40, + 8, 66, 31, 58, 38, 66, 61, 58, 68, 66, 1, 6, 26, 14, 35, + 6, 60, 14, 69, 6, 14, 31, 23, 23, 47, 32, 57, 23, 77, 32, + 11, 40, 27, 49, 45, 40, 57, 49, 79, 40, 7, 66, 30, 58, 37, + 66, 60, 58, 67, 66, 2, 6, 27, 14, 36, 6, 61, 14, 70, 6, + 15, 31, 24, 23, 46, 32, 58, 23, 76, 32, 12, 40, 26, 49, 46, + 40, 56, 49, 79, 41, 6, 66, 29, 58, 36, 66, 59, 58, 66, 66, + 3, 6, 28, 14, 37, 6, 62, 14, 71, 6, 15, 32, 25, 23, 45, + 32, 59, 23, 75, 32, 13, 40, 25, 49, 47, 40, 55, 49, 78, 41, + 5, 66, 28, 58, 35, 66, 58, 58, 65, 66, 4, 6, 29, 14, 38, + 6, 63, 14, 72, 6, 14, 32, 26, 23, 44, 32, 60, 23, 74, 32, + 14, 40, 24, 49, 47, 41, 54, 49, 77, 41, 4, 66, 27, 58, 34, + 66, 57, 58, 64, 66, 5, 6, 30, 14, 39, 6, 63, 15, 73, 6, + 13, 32, 27, 23, 43, 32, 61, 23, 73, 32, 15, 40, 23, 49, 46, + 41, 53, 49, 76, 41, 3, 66, 26, 58, 33, 66, 56, 58, 64, 67, + 6, 6, 31, 14, 40, 6, 62, 15, 74, 6, 12, 32, 28, 23, 42, + 32, 62, 23, 72, 32, 15, 41, 22, 49, 45, 41, 52, 49, 75, 41, + 2, 66, 25, 58, 32, 66, 55, 58, 65, 67, 7, 6, 31, 15, 41, + 6, 61, 15, 75, 6, 11, 32, 29, 23, 41, 32, 63, 23, 71, 32, + 14, 41, 21, 49, 44, 41, 51, 49, 74, 41, 1, 66, 24, 58, 32, + 67, 54, 58, 66, 67, 8, 6, 30, 15, 42, 6, 60, 15, 76, 6, + 10, 32, 30, 23, 40, 32, 63, 24, 70, 32, 13, 41, 20, 49, 43, + 41, 50, 49, 73, 41, 0, 66, 23, 58, 33, 67, 53, 58, 67, 67, + 9, 6, 29, 15, 43, 6, 59, 15, 77, 6, 9, 32, 31, 23, 39, + 32, 62, 24, 69, 32, 12, 41, 19, 49, 42, 41, 49, 49, 72, 41, + 0, 67, 22, 58, 34, 67, 52, 58, 68, 67, 10, 6, 28, 15, 44, + 6, 58, 15, 78, 6, 8, 32, 31, 24, 38, 32, 61, 24, 68, 32, + 11, 41, 18, 49, 41, 41, 48, 49, 71, 41, 1, 67, 21, 58, 35, + 67, 51, 58, 69, 67, 11, 6, 27, 15, 45, 6, 57, 15, 79, 6, + 7, 32, 30, 24, 37, 32, 60, 24, 67, 32, 10, 41, 17, 49, 40, + 41, 48, 50, 70, 41, 2, 67, 20, 58, 36, 67, 50, 58, 70, 67, + 12, 6, 26, 15, 46, 6, 56, 15, 79, 7, 6, 32, 29, 24, 36, + 32, 59, 24, 66, 32, 9, 41, 16, 49, 39, 41, 49, 50, 69, 41, + 3, 67, 19, 58, 37, 67, 49, 58, 71, 67, 13, 6, 25, 15, 47, + 6, 55, 15, 78, 7, 5, 32, 28, 24, 35, 32, 58, 24, 65, 32, + 8, 41, 16, 50, 38, 41, 50, 50, 68, 41, 4, 67, 18, 58, 38, + 67, 48, 58, 72, 67, 14, 6, 24, 15, 47, 7, 54, 15, 77, 7, + 4, 32, 27, 24, 34, 32, 57, 24, 64, 32, 7, 41, 17, 50, 37, + 41, 51, 50, 67, 41, 5, 67, 17, 58, 39, 67, 48, 59, 73, 67, + 15, 6, 23, 15, 46, 7, 53, 15, 76, 7, 3, 32, 26, 24, 33, + 32, 56, 24, 64, 33, 6, 41, 18, 50, 36, 41, 52, 50, 66, 41, + 6, 67, 16, 58, 40, 67, 49, 59, 74, 67, 15, 7, 22, 15, 45, + 7, 52, 15, 75, 7, 2, 32, 25, 24, 32, 32, 55, 24, 65, 33, + 5, 41, 19, 50, 35, 41, 53, 50, 65, 41, 7, 67, 16, 59, 41, + 67, 50, 59, 75, 67, 14, 7, 21, 15, 44, 7, 51, 15, 74, 7, + 1, 32, 24, 24, 32, 33, 54, 24, 66, 33, 4, 41, 20, 50, 34, + 41, 54, 50, 64, 41, 8, 67, 17, 59, 42, 67, 51, 59, 76, 67, + 13, 7, 20, 15, 43, 7, 50, 15, 73, 7, 0, 32, 23, 24, 33, + 33, 53, 24, 67, 33, 3, 41, 21, 50, 33, 41, 55, 50, 64, 42, + 9, 67, 18, 59, 43, 67, 52, 59, 77, 67, 12, 7, 19, 15, 42, + 7, 49, 15, 72, 7, 0, 33, 22, 24, 34, 33, 52, 24, 68, 33, + 2, 41, 22, 50, 32, 41, 56, 50, 65, 42, 10, 67, 19, 59, 44, + 67, 53, 59, 78, 67, 11, 7, 18, 15, 41, 7, 48, 15, 71, 7, + 1, 33, 21, 24, 35, 33, 51, 24, 69, 33, 1, 41, 23, 50, 32, + 42, 57, 50, 66, 42, 11, 67, 20, 59, 45, 67, 54, 59, 79, 67, + 10, 7, 17, 15, 40, 7, 48, 16, 70, 7, 2, 33, 20, 24, 36, + 33, 50, 24, 70, 33, 0, 41, 24, 50, 33, 42, 58, 50, 67, 42, + 12, 67, 21, 59, 46, 67, 55, 59, 64, 51, 9, 7, 16, 15, 39, + 7, 49, 16, 69, 7, 3, 33, 19, 24, 37, 33, 49, 24, 71, 33, + 0, 42, 25, 50, 34, 42, 59, 50, 68, 42, 13, 67, 22, 59, 47, + 67, 56, 59, 65, 51, 8, 7, 16, 16, 38, 7, 50, 16, 68, 7, + 4, 33, 18, 24, 38, 33, 48, 24, 72, 33, 1, 42, 26, 50, 35, + 42, 60, 50, 69, 42, 14, 67, 23, 59, 32, 51, 57, 59, 66, 51, + 7, 7, 17, 16, 37, 7, 51, 16, 67, 7, 5, 33, 17, 24, 39, + 33, 48, 25, 73, 33, 2, 42, 27, 50, 36, 42, 61, 50, 70, 42, + 15, 67, 24, 59, 33, 51, 58, 59, 67, 51, 6, 7, 18, 16, 36, + 7, 52, 16, 66, 7, 6, 33, 16, 24, 40, 33, 49, 25, 74, 33, + 3, 42, 28, 50, 37, 42, 62, 50, 71, 42, 0, 51, 25, 59, 34, + 51, 59, 59, 68, 51, 5, 7, 19, 16, 35, 7, 53, 16, 65, 7, + 7, 33, 16, 25, 41, 33, 50, 25, 75, 33, 4, 42, 29, 50, 38, + 42, 63, 50, 72, 42, 1, 51, 26, 59, 35, 51, 60, 59, 69, 51, + 4, 7, 20, 16, 34, 7, 54, 16, 64, 7, 8, 33, 17, 25, 42, + 33, 51, 25, 76, 33, 5, 42, 30, 50, 39, 42, 48, 34, 73, 42, + 2, 51, 27, 59, 36, 51, 61, 59, 70, 51, 3, 7, 21, 16, 33, + 7, 55, 16, 64, 8, 9, 33, 18, 25, 43, 33, 52, 25, 77, 33, + 6, 42, 31, 50, 40, 42, 49, 34, 74, 42, 3, 51, 28, 59, 37, + 51, 62, 59, 71, 51, 2, 7, 22, 16, 32, 7, 56, 16, 65, 8, + 10, 33, 19, 25, 44, 33, 53, 25, 78, 33, 7, 42, 16, 34, 41, + 42, 50, 34, 75, 42, 4, 51, 29, 59, 38, 51, 63, 59, 72, 51, + 1, 7, 23, 16, 32, 8, 57, 16, 66, 8, 11, 33, 20, 25, 45, + 33, 54, 25, 79, 33, 8, 42, 17, 34, 42, 42, 51, 34, 76, 42, + 5, 51, 30, 59, 39, 51, 63, 60, 73, 51, 0, 7, 24, 16, 33, + 8, 58, 16, 67, 8, 12, 33, 21, 25, 46, 33, 55, 25, 64, 17, + 9, 42, 18, 34, 43, 42, 52, 34, 77, 42, 6, 51, 31, 59, 40, + 51, 62, 60, 74, 51, 0, 8, 25, 16, 34, 8, 59, 16, 68, 8, + 13, 33, 22, 25, 47, 33, 56, 25, 65, 17, 10, 42, 19, 34, 44, + 42, 53, 34, 78, 42, 7, 51, 31, 60, 41, 51, 61, 60, 75, 51, + 1, 8, 26, 16, 35, 8, 60, 16, 69, 8, 14, 33, 23, 25, 32, + 17, 57, 25, 66, 17, 11, 42, 20, 34, 45, 42, 54, 34, 79, 42, + 8, 51, 30, 60, 42, 51, 60, 60, 76, 51, 2, 8, 27, 16, 36, + 8, 61, 16, 70, 8, 15, 33, 24, 25, 33, 17, 58, 25, 67, 17, + 12, 42, 21, 34, 46, 42, 55, 34, 79, 43, 9, 51, 29, 60, 43, + 51, 59, 60, 77, 51, 3, 8, 28, 16, 37, 8, 62, 16, 71, 8, + 0, 17, 25, 25, 34, 17, 59, 25, 68, 17, 13, 42, 22, 34, 47, + 42, 56, 34, 78, 43, 10, 51, 28, 60, 44, 51, 58, 60, 78, 51, + 4, 8, 29, 16, 38, 8, 63, 16, 72, 8, 1, 17, 26, 25, 35, + 17, 60, 25, 69, 17, 14, 42, 23, 34, 47, 43, 57, 34, 77, 43, + 11, 51, 27, 60, 45, 51, 57, 60, 79, 51, 5, 8, 30, 16, 39, + 8, 48, 0, 73, 8, 2, 17, 27, 25, 36, 17, 61, 25, 70, 17, + 15, 42, 24, 34, 46, 43, 58, 34, 76, 43, 12, 51, 26, 60, 46, + 51, 56, 60, 79, 52, 6, 8, 31, 16, 40, 8, 49, 0, 74, 8, + 3, 17, 28, 25, 37, 17, 62, 25, 71, 17, 15, 43, 25, 34, 45, + 43, 59, 34, 75, 43, 13, 51, 25, 60, 47, 51, 55, 60, 78, 52, + 7, 8, 16, 0, 41, 8, 50, 0, 75, 8, 4, 17, 29, 25, 38, + 17, 63, 25, 72, 17, 14, 43, 26, 34, 44, 43, 60, 34, 74, 43, + 14, 51, 24, 60, 47, 52, 54, 60, 77, 52, 8, 8, 17, 0, 42, + 8, 51, 0, 76, 8, 5, 17, 30, 25, 39, 17, 63, 26, 73, 17, + 13, 43, 27, 34, 43, 43, 61, 34, 73, 43, 15, 51, 23, 60, 46, + 52, 53, 60, 76, 52, 9, 8, 18, 0, 43, 8, 52, 0, 77, 8, + 6, 17, 31, 25, 40, 17, 62, 26, 74, 17, 12, 43, 28, 34, 42, + 43, 62, 34, 72, 43, 15, 52, 22, 60, 45, 52, 52, 60, 75, 52, + 10, 8, 19, 0, 44, 8, 53, 0, 78, 8, 7, 17, 31, 26, 41, + 17, 61, 26, 75, 17, 11, 43, 29, 34, 41, 43, 63, 34, 71, 43, + 14, 52, 21, 60, 44, 52, 51, 60, 74, 52, 11, 8, 20, 0, 45, + 8, 54, 0, 79, 8, 8, 17, 30, 26, 42, 17, 60, 26, 76, 17, + 10, 43, 30, 34, 40, 43, 63, 35, 70, 43, 13, 52, 20, 60, 43, + 52, 50, 60, 73, 52, 12, 8, 21, 0, 46, 8, 55, 0, 79, 9, + 9, 17, 29, 26, 43, 17, 59, 26, 77, 17, 9, 43, 31, 34, 39, + 43, 62, 35, 69, 43, 12, 52, 19, 60, 42, 52, 49, 60, 72, 52, + 13, 8, 22, 0, 47, 8, 56, 0, 78, 9, 10, 17, 28, 26, 44, + 17, 58, 26, 78, 17, 8, 43, 31, 35, 38, 43, 61, 35, 68, 43, + 11, 52, 18, 60, 41, 52, 48, 60, 71, 52, 14, 8, 23, 0, 47, + 9, 57, 0, 77, 9, 11, 17, 27, 26, 45, 17, 57, 26, 79, 17, + 7, 43, 30, 35, 37, 43, 60, 35, 67, 43, 10, 52, 17, 60, 40, + 52, 48, 61, 70, 52, 15, 8, 24, 0, 46, 9, 58, 0, 76, 9, + 12, 17, 26, 26, 46, 17, 56, 26, 79, 18, 6, 43, 29, 35, 36, + 43, 59, 35, 66, 43, 9, 52, 16, 60, 39, 52, 49, 61, 69, 52, + 15, 9, 25, 0, 45, 9, 59, 0, 75, 9, 13, 17, 25, 26, 47, + 17, 55, 26, 78, 18, 5, 43, 28, 35, 35, 43, 58, 35, 65, 43, + 8, 52, 16, 61, 38, 52, 50, 61, 68, 52, 14, 9, 26, 0, 44, + 9, 60, 0, 74, 9, 14, 17, 24, 26, 47, 18, 54, 26, 77, 18, + 4, 43, 27, 35, 34, 43, 57, 35, 64, 43, 7, 52, 17, 61, 37, + 52, 51, 61, 67, 52, 13, 9, 27, 0, 43, 9, 61, 0, 73, 9, + 15, 17, 23, 26, 46, 18, 53, 26, 76, 18, 3, 43, 26, 35, 33, + 43, 56, 35, 64, 44, 6, 52, 18, 61, 36, 52, 52, 61, 66, 52, + 12, 9, 28, 0, 42, 9, 62, 0, 72, 9, 15, 18, 22, 26, 45, + 18, 52, 26, 75, 18, 2, 43, 25, 35, 32, 43, 55, 35, 65, 44, + 5, 52, 19, 61, 35, 52, 53, 61, 65, 52, 11, 9, 29, 0, 41, + 9, 63, 0, 71, 9, 14, 18, 21, 26, 44, 18, 51, 26, 74, 18, + 1, 43, 24, 35, 32, 44, 54, 35, 66, 44, 4, 52, 20, 61, 34, + 52, 54, 61, 64, 52, 10, 9, 30, 0, 40, 9, 63, 1, 70, 9, + 13, 18, 20, 26, 43, 18, 50, 26, 73, 18, 0, 43, 23, 35, 33, + 44, 53, 35, 67, 44, 3, 52, 21, 61, 33, 52, 55, 61, 64, 53, + 9, 9, 31, 0, 39, 9, 62, 1, 69, 9, 12, 18, 19, 26, 42, + 18, 49, 26, 72, 18, 0, 44, 22, 35, 34, 44, 52, 35, 68, 44, + 2, 52, 22, 61, 32, 52, 56, 61, 65, 53, 8, 9, 31, 1, 38, + 9, 61, 1, 68, 9, 11, 18, 18, 26, 41, 18, 48, 26, 71, 18, + 1, 44, 21, 35, 35, 44, 51, 35, 69, 44, 1, 52, 23, 61, 32, + 53, 57, 61, 66, 53, 7, 9, 30, 1, 37, 9, 60, 1, 67, 9, + 10, 18, 17, 26, 40, 18, 48, 27, 70, 18, 2, 44, 20, 35, 36, + 44, 50, 35, 70, 44, 0, 52, 24, 61, 33, 53, 58, 61, 67, 53, + 6, 9, 29, 1, 36, 9, 59, 1, 66, 9, 9, 18, 16, 26, 39, + 18, 49, 27, 69, 18, 3, 44, 19, 35, 37, 44, 49, 35, 71, 44, + 0, 53, 25, 61, 34, 53, 59, 61, 68, 53, 5, 9, 28, 1, 35, + 9, 58, 1, 65, 9, 8, 18, 16, 27, 38, 18, 50, 27, 68, 18, + 4, 44, 18, 35, 38, 44, 48, 35, 72, 44, 1, 53, 26, 61, 35, + 53, 60, 61, 69, 53, 4, 9, 27, 1, 34, 9, 57, 1, 64, 9, + 7, 18, 17, 27, 37, 18, 51, 27, 67, 18, 5, 44, 17, 35, 39, + 44, 48, 36, 73, 44, 2, 53, 27, 61, 36, 53, 61, 61, 70, 53, + 3, 9, 26, 1, 33, 9, 56, 1, 64, 10, 6, 18, 18, 27, 36, + 18, 52, 27, 66, 18, 6, 44, 16, 35, 40, 44, 49, 36, 74, 44, + 3, 53, 28, 61, 37, 53, 62, 61, 71, 53, 2, 9, 25, 1, 32, + 9, 55, 1, 65, 10, 5, 18, 19, 27, 35, 18, 53, 27, 65, 18, + 7, 44, 16, 36, 41, 44, 50, 36, 75, 44, 4, 53, 29, 61, 38, + 53, 63, 61, 72, 53, 1, 9, 24, 1, 32, 10, 54, 1, 66, 10, + 4, 18, 20, 27, 34, 18, 54, 27, 64, 18, 8, 44, 17, 36, 42, + 44, 51, 36, 76, 44, 5, 53, 30, 61, 39, 53, 63, 62, 73, 53, + 0, 9, 23, 1, 33, 10, 53, 1, 67, 10, 3, 18, 21, 27, 33, + 18, 55, 27, 64, 19, 9, 44, 18, 36, 43, 44, 52, 36, 77, 44, + 6, 53, 31, 61, 40, 53, 62, 62, 74, 53, 0, 10, 22, 1, 34, + 10, 52, 1, 68, 10, 2, 18, 22, 27, 32, 18, 56, 27, 65, 19, + 10, 44, 19, 36, 44, 44, 53, 36, 78, 44, 7, 53, 31, 62, 41, + 53, 61, 62, 75, 53, 1, 10, 21, 1, 35, 10, 51, 1, 69, 10, + 1, 18, 23, 27, 32, 19, 57, 27, 66, 19, 11, 44, 20, 36, 45, + 44, 54, 36, 79, 44, 8, 53, 30, 62, 42, 53, 60, 62, 76, 53, + 2, 10, 20, 1, 36, 10, 50, 1, 70, 10, 0, 18, 24, 27, 33, + 19, 58, 27, 67, 19, 12, 44, 21, 36, 46, 44, 55, 36, 79, 45, + 9, 53, 29, 62, 43, 53, 59, 62, 77, 53, 3, 10, 19, 1, 37, + 10, 49, 1, 71, 10, 0, 19, 25, 27, 34, 19, 59, 27, 68, 19, + 13, 44, 22, 36, 47, 44, 56, 36, 78, 45, 10, 53, 28, 62, 44, + 53, 58, 62, 78, 53, 4, 10, 18, 1, 38, 10, 48, 1, 72, 10, + 1, 19, 26, 27, 35, 19, 60, 27, 69, 19, 14, 44, 23, 36, 47, + 45, 57, 36, 77, 45, 11, 53, 27, 62, 45, 53, 57, 62, 79, 53, + 5, 10, 17, 1, 39, 10, 48, 2, 73, 10, 2, 19, 27, 27, 36, + 19, 61, 27, 70, 19, 15, 44, 24, 36, 46, 45, 58, 36, 76, 45, + 12, 53, 26, 62, 46, 53, 56, 62, 79, 54, 6, 10, 16, 1, 40, + 10, 49, 2, 74, 10, 3, 19, 28, 27, 37, 19, 62, 27, 71, 19, + 15, 45, 25, 36, 45, 45, 59, 36, 75, 45, 13, 53, 25, 62, 47, + 53, 55, 62, 78, 54, 7, 10, 16, 2, 41, 10, 50, 2, 75, 10, + 4, 19, 29, 27, 38, 19, 63, 27, 72, 19, 14, 45, 26, 36, 44, + 45, 60, 36, 74, 45, 14, 53, 24, 62, 47, 54, 54, 62, 77, 54, + 8, 10, 17, 2, 42, 10, 51, 2, 76, 10, 5, 19, 30, 27, 39, + 19, 63, 28, 73, 19, 13, 45, 27, 36, 43, 45, 61, 36, 73, 45, + 15, 53, 23, 62, 46, 54, 53, 62, 76, 54, 9, 10, 18, 2, 43, + 10, 52, 2, 77, 10, 6, 19, 31, 27, 40, 19, 62, 28, 74, 19, + 12, 45, 28, 36, 42, 45, 62, 36, 72, 45, 15, 54, 22, 62, 45, + 54, 52, 62, 75, 54, 10, 10, 19, 2, 44, 10, 53, 2, 78, 10, + 7, 19, 31, 28, 41, 19, 61, 28, 75, 19, 11, 45, 29, 36, 41, + 45, 63, 36, 71, 45, 14, 54, 21, 62, 44, 54, 51, 62, 74, 54, + 11, 10, 20, 2, 45, 10, 54, 2, 79, 10, 8, 19, 30, 28, 42, + 19, 60, 28, 76, 19, 10, 45, 30, 36, 40, 45, 63, 37, 70, 45, + 13, 54, 20, 62, 43, 54, 50, 62, 73, 54, 12, 10, 21, 2, 46, + 10, 55, 2, 79, 11, 9, 19, 29, 28, 43, 19, 59, 28, 77, 19, + 9, 45, 31, 36, 39, 45, 62, 37, 69, 45, 12, 54, 19, 62, 42, + 54, 49, 62, 72, 54, 13, 10, 22, 2, 47, 10, 56, 2, 78, 11, + 10, 19, 28, 28, 44, 19, 58, 28, 78, 19, 8, 45, 31, 37, 38, + 45, 61, 37, 68, 45, 11, 54, 18, 62, 41, 54, 48, 62, 71, 54, + 14, 10, 23, 2, 47, 11, 57, 2, 77, 11, 11, 19, 27, 28, 45, + 19, 57, 28, 79, 19, 7, 45, 30, 37, 37, 45, 60, 37, 67, 45, + 10, 54, 17, 62, 40, 54, 48, 63, 70, 54, 15, 10, 24, 2, 46, + 11, 58, 2, 76, 11, 12, 19, 26, 28, 46, 19, 56, 28, 79, 20, + 6, 45, 29, 37, 36, 45, 59, 37, 66, 45, 9, 54, 16, 62, 39, + 54, 49, 63, 69, 54, 15, 11, 25, 2, 45, 11, 59, 2, 75, 11, + 13, 19, 25, 28, 47, 19, 55, 28, 78, 20, 5, 45, 28, 37, 35, + 45, 58, 37, 65, 45, 8, 54, 16, 63, 38, 54, 50, 63, 68, 54, + 14, 11, 26, 2, 44, 11, 60, 2, 74, 11, 14, 19, 24, 28, 47, + 20, 54, 28, 77, 20, 4, 45, 27, 37, 34, 45, 57, 37, 64, 45, + 7, 54, 17, 63, 37, 54, 51, 63, 67, 54, 13, 11, 27, 2, 43, + 11, 61, 2, 73, 11, 15, 19, 23, 28, 46, 20, 53, 28, 76, 20, + 3, 45, 26, 37, 33, 45, 56, 37, 64, 46, 6, 54, 18, 63, 36, + 54, 52, 63, 66, 54, 12, 11, 28, 2, 42, 11, 62, 2, 72, 11, + 15, 20, 22, 28, 45, 20, 52, 28, 75, 20, 2, 45, 25, 37, 32, + 45, 55, 37, 65, 46, 5, 54, 19, 63, 35, 54, 53, 63, 65, 54, + 11, 11, 29, 2, 41, 11, 63, 2, 71, 11, 14, 20, 21, 28, 44, + 20, 51, 28, 74, 20, 1, 45, 24, 37, 32, 46, 54, 37, 66, 46, + 4, 54, 20, 63, 34, 54, 54, 63, 64, 54, 10, 11, 30, 2, 40, + 11, 63, 3, 70, 11, 13, 20, 20, 28, 43, 20, 50, 28, 73, 20, + 0, 45, 23, 37, 33, 46, 53, 37, 67, 46, 3, 54, 21, 63, 33, + 54, 55, 63, 64, 55, 9, 11, 31, 2, 39, 11, 62, 3, 69, 11, + 12, 20, 19, 28, 42, 20, 49, 28, 72, 20, 0, 46, 22, 37, 34, + 46, 52, 37, 68, 46, 2, 54, 22, 63, 32, 54, 56, 63, 65, 55, + 8, 11, 31, 3, 38, 11, 61, 3, 68, 11, 11, 20, 18, 28, 41, + 20, 48, 28, 71, 20, 1, 46, 21, 37, 35, 46, 51, 37, 69, 46, + 1, 54, 23, 63, 32, 55, 57, 63, 66, 55, 7, 11, 30, 3, 37, + 11, 60, 3, 67, 11, 10, 20, 17, 28, 40, 20, 48, 29, 70, 20, + 2, 46, 20, 37, 36, 46, 50, 37, 70, 46, 0, 54, 24, 63, 33, + 55, 58, 63, 67, 55, 6, 11, 29, 3, 36, 11, 59, 3, 66, 11, + 9, 20, 16, 28, 39, 20, 49, 29, 69, 20, 3, 46, 19, 37, 37, + 46, 49, 37, 71, 46, 0, 55, 25, 63, 34, 55, 59, 63, 68, 55, + 5, 11, 28, 3, 35, 11, 58, 3, 65, 11, 8, 20, 16, 29, 38, + 20, 50, 29, 68, 20, 4, 46, 18, 37, 38, 46, 48, 37, 72, 46, + 1, 55, 26, 63, 35, 55, 60, 63, 69, 55, 4, 11, 27, 3, 34, + 11, 57, 3, 64, 11, 7, 20, 17, 29, 37, 20, 51, 29, 67, 20, + 5, 46, 17, 37, 39, 46, 48, 38, 73, 46, 2, 55, 27, 63, 36, + 55, 61, 63, 70, 55, 3, 11, 26, 3, 33, 11, 56, 3, 64, 12, + 6, 20, 18, 29, 36, 20, 52, 29, 66, 20, 6, 46, 16, 37, 40, + 46, 49, 38, 74, 46, 3, 55, 28, 63, 37, 55, 62, 63, 71, 55, + 2, 11, 25, 3, 32, 11, 55, 3, 65, 12, 5, 20, 19, 29, 35, + 20, 53, 29, 65, 20, 7, 46, 16, 38, 41, 46, 50, 38, 75, 46, + 4, 55, 29, 63, 38, 55, 63, 63, 72, 55, 1, 11, 24, 3, 32, + 12, 54, 3, 66, 12, 4, 20, 20, 29, 34, 20, 54, 29, 64, 20, + 8, 46, 17, 38, 42, 46, 51, 38, 76, 46, 5, 55, 30, 63, 39, + 55, 63, 64, 73, 55, 0, 11, 23, 3, 33, 12, 53, 3, 67, 12, + 3, 20, 21, 29, 33, 20, 55, 29, 64, 21, 9, 46, 18, 38, 43, + 46, 52, 38, 77, 46, 6, 55, 31, 63, 40, 55, 62, 64, 74, 55, + 0, 12, 22, 3, 34, 12, 52, 3, 68, 12, 2, 20, 22, 29, 32, + 20, 56, 29, 65, 21, 10, 46, 19, 38, 44, 46, 53, 38, 78, 46, + 7, 55, 31, 64, 41, 55, 61, 64, 75, 55, 1, 12, 21, 3, 35, + 12, 51, 3, 69, 12, 1, 20, 23, 29, 32, 21, 57, 29, 66, 21, + 11, 46, 20, 38, 45, 46, 54, 38, 79, 46, 8, 55, 30, 64, 42, + 55, 60, 64, 76, 55, 2, 12, 20, 3, 36, 12, 50, 3, 70, 12, + 0, 20, 24, 29, 33, 21, 58, 29, 67, 21, 12, 46, 21, 38, 46, + 46, 55, 38, 79, 47, 9, 55, 29, 64, 43, 55, 59, 64, 77, 55, + 3, 12, 19, 3, 37, 12, 49, 3, 71, 12, 0, 21, 25, 29, 34, + 21, 59, 29, 68, 21, 13, 46, 22, 38, 47, 46, 56, 38, 78, 47, + 10, 55, 28, 64, 44, 55, 58, 64, 78, 55, 4, 12, 18, 3, 38, + 12, 48, 3, 72, 12, 1, 21, 26, 29, 35, 21, 60, 29, 69, 21, + 14, 46, 23, 38, 47, 47, 57, 38, 77, 47, 11, 55, 27, 64, 45, + 55, 57, 64, 79, 55, 5, 12, 17, 3, 39, 12, 48, 4, 73, 12, + 2, 21, 27, 29, 36, 21, 61, 29, 70, 21, 15, 46, 24, 38, 46, + 47, 58, 38, 76, 47, 12, 55, 26, 64, 46, 55, 56, 64, 79, 56, + 6, 12, 16, 3, 40, 12, 49, 4, 74, 12, 3, 21, 28, 29, 37, + 21, 62, 29, 71, 21, 15, 47, 25, 38, 45, 47, 59, 38, 75, 47, + 13, 55, 25, 64, 47, 55, 55, 64, 78, 56, 7, 12, 16, 4, 41, + 12, 50, 4, 75, 12, 4, 21, 29, 29, 38, 21, 63, 29, 72, 21, + 14, 47, 26, 38, 44, 47, 60, 38, 74, 47, 14, 55, 24, 64, 47, + 56, 54, 64, 77, 56, 8, 12, 17, 4, 42, 12, 51, 4, 76, 12, + 5, 21, 30, 29, 39, 21, 63, 30, 73, 21, 13, 47, 27, 38, 43, + 47, 61, 38, 73, 47, 15, 55, 23, 64, 46, 56, 53, 64, 76, 56, + 9, 12, 18, 4, 43, 12, 52, 4, 77, 12, 6, 21, 31, 29, 40, + 21, 62, 30, 74, 21, 12, 47, 28, 38, 42, 47, 62, 38, 72, 47, + 15, 56, 22, 64, 45, 56, 52, 64, 75, 56, 10, 12, 19, 4, 44, + 12, 53, 4, 78, 12, 7, 21, 31, 30, 41, 21, 61, 30, 75, 21, + 11, 47, 29, 38, 41, 47, 63, 38, 71, 47, 14, 56, 21, 64, 44, + 56, 51, 64, 74, 56, 11, 12, 20, 4, 45, 12, 54, 4, 79, 12, + 8, 21, 30, 30, 42, 21, 60, 30, 76, 21, 10, 47, 30, 38, 40, + 47, 63, 39, 70, 47, 13, 56, 20, 64, 43, 56, 50, 64, 73, 56, + 12, 12, 21, 4, 46, 12, 55, 4, 79, 13, 9, 21, 29, 30, 43, + 21, 59, 30, 77, 21, 9, 47, 31, 38, 39, 47, 62, 39, 69, 47, + 12, 56, 19, 64, 42, 56, 49, 64, 72, 56, 13, 12, 22, 4, 47, + 12, 56, 4, 78, 13, 10, 21, 28, 30, 44, 21, 58, 30, 78, 21, + 8, 47, 31, 39, 38, 47, 61, 39, 68, 47, 11, 56, 18, 64, 41, + 56, 48, 64, 71, 56, 14, 12, 23, 4, 47, 13, 57, 4, 77, 13, + 11, 21, 27, 30, 45, 21, 57, 30, 79, 21, 7, 47, 30, 39, 37, + 47, 60, 39, 67, 47, 10, 56, 17, 64, 40, 56, 48, 65, 70, 56, + 15, 12, 24, 4, 46, 13, 58, 4, 76, 13, 12, 21, 26, 30, 46, + 21, 56, 30, 79, 22, 6, 47, 29, 39, 36, 47, 59, 39, 66, 47, + 9, 56, 16, 64, 39, 56, 49, 65, 69, 56, 15, 13, 25, 4, 45, + 13, 59, 4, 75, 13, 13, 21, 25, 30, 47, 21, 55, 30, 78, 22, + 5, 47, 28, 39, 35, 47, 58, 39, 65, 47, 8, 56, 16, 65, 38, + 56, 50, 65, 68, 56, 14, 13, 26, 4, 44, 13, 60, 4, 74, 13, + 14, 21, 24, 30, 47, 22, 54, 30, 77, 22, 4, 47, 27, 39, 34, + 47, 57, 39, 64, 47, 7, 56, 17, 65, 37, 56, 51, 65, 67, 56, + 13, 13, 27, 4, 43, 13, 61, 4, 73, 13, 15, 21, 23, 30, 46, + 22, 53, 30, 76, 22, 3, 47, 26, 39, 33, 47, 56, 39, 64, 48, + 6, 56, 18, 65, 36, 56, 52, 65, 66, 56, 12, 13, 28, 4, 42, + 13, 62, 4, 72, 13, 15, 22, 22, 30, 45, 22, 52, 30, 75, 22, + 2, 47, 25, 39, 32, 47, 55, 39, 65, 48, 5, 56, 19, 65, 35, + 56, 53, 65, 65, 56, 11, 13, 29, 4, 41, 13, 63, 4, 71, 13, + 14, 22, 21, 30, 44, 22, 51, 30, 74, 22, 1, 47, 24, 39, 32, + 48, 54, 39, 66, 48, 4, 56, 20, 65, 34, 56, 54, 65, 64, 56, + 10, 13, 30, 4, 40, 13, 63, 5, 70, 13, 13, 22, 20, 30, 43, + 22, 50, 30, 73, 22, 0, 47, 23, 39, 33, 48, 53, 39, 67, 48, + 3, 56, 21, 65, 33, 56, 55, 65, 64, 57, 9, 13, 31, 4, 39, + 13, 62, 5, 69, 13, 12, 22, 19, 30, 42, 22, 49, 30, 72, 22, + 0, 48, 22, 39, 34, 48, 52, 39, 68, 48, 2, 56, 22, 65, 32, + 56, 56, 65, 65, 57, 8, 13, 31, 5, 38, 13, 61, 5, 68, 13, + 11, 22, 18, 30, 41, 22, 48, 30, 71, 22, 1, 48, 21, 39, 35, + 48, 51, 39, 69, 48, 1, 56, 23, 65, 32, 57, 57, 65, 66, 57, + 7, 13, 30, 5, 37, 13, 60, 5, 67, 13, 10, 22, 17, 30, 40, + 22, 48, 31, 70, 22, 2, 48, 20, 39, 36, 48, 50, 39, 70, 48, + 0, 56, 24, 65, 33, 57, 58, 65, 67, 57, 6, 13, 29, 5, 36, + 13, 59, 5, 66, 13, 9, 22, 16, 30, 39, 22, 49, 31, 69, 22, + 3, 48, 19, 39, 37, 48, 49, 39, 71, 48, 0, 57, 25, 65, 34, + 57, 59, 65, 68, 57, 5, 13, 28, 5, 35, 13, 58, 5, 65, 13, + 8, 22, 16, 31, 38, 22, 50, 31, 68, 22, 4, 48, 18, 39, 38, + 48, 48, 39, 72, 48, 1, 57, 26, 65, 35, 57, 60, 65, 69, 57, + 4, 13, 27, 5, 34, 13, 57, 5, 64, 13, 7, 22, 17, 31, 37, + 22, 51, 31, 67, 22, 5, 48, 17, 39, 39, 48, 48, 40, 73, 48, + 2, 57, 27, 65, 36, 57, 61, 65, 70, 57, 3, 13, 26, 5, 33, + 13, 56, 5, 64, 14, 6, 22, 18, 31, 36, 22, 52, 31, 66, 22, + 6, 48, 16, 39, 40, 48, 49, 40, 74, 48, 3, 57, 28, 65, 37, + 57, 62, 65, 71, 57, 2, 13, 25, 5, 32, 13, 55, 5, 65, 14, + 5, 22, 19, 31, 35, 22, 53, 31, 65, 22, 7, 48, 16, 40, 41, + 48, 50, 40, 75, 48, 4, 57, 29, 65, 38, 57, 63, 65, 72, 57, + 1, 13, 24, 5, 32, 14, 54, 5, 66, 14, 4, 22, 20, 31, 34, + 22, 54, 31, 64, 22, 8, 48, 17, 40, 42, 48, 51, 40, 76, 48, + 5, 57, 30, 65, 39, 57, 63, 66, 73, 57, 0, 13, 23, 5, 33, + 14, 53, 5, 67, 14, 3, 22, 21, 31, 33, 22, 55, 31, 64, 23, + 9, 48, 18, 40, 43, 48, 52, 40, 77, 48, 6, 57, 31, 65, 40, + 57, 62, 66, 74, 57, 0, 14, 22, 5, 34, 14, 52, 5, 68, 14, + 2, 22, 22, 31, 32, 22, 56, 31, 65, 23, 10, 48, 19, 40, 44, + 48, 53, 40, 78, 48, 7, 57, 31, 66, 41, 57, 61, 66, 75, 57, + 1, 14, 21, 5, 35, 14, 51, 5, 69, 14, 1, 22, 23, 31, 32, + 23, 57, 31, 66, 23, 11, 48, 20, 40, 45, 48, 54, 40, 79, 48, + 8, 57, 30, 66, 42, 57, 60, 66, 76, 57, 2, 14, 20, 5, 36, + 14, 50, 5, 70, 14, 0, 22, 24, 31, 33, 23, 58, 31, 67, 23, + 12, 48, 21, 40, 46, 48, 55, 40, 79, 49, 9, 57, 29, 66, 43, + 57, 59, 66, 77, 57, 3, 14, 19, 5, 37, 14, 49, 5, 71, 14, + 0, 23, 25, 31, 34, 23, 59, 31, 68, 23, 13, 48, 22, 40, 47, + 48, 56, 40, 78, 49, 10, 57, 28, 66, 44, 57, 58, 66, 78, 57, + 4, 14, 18, 5, 38, 14, 48, 5, 72, 14, 1, 23, 26, 31, 35, + 23, 60, 31, 69, 23, 14, 48, 23, 40, 47, 49, 57, 40, 77, 49, + 11, 57, 27, 66, 45, 57, 57, 66, 79, 57, 5, 14, 17, 5, 39, + 14, 48, 6, 73, 14, 2, 23, 27, 31, 36, 23, 61, 31, 70, 23, + 15, 48, 24, 40, 46, 49, 58, 40, 76, 49, 12, 57, 26, 66, 46, + 57, 56, 66, 79, 58, 6, 14, 16, 5, 40, 14, 49, 6, 74, 14, + 3, 23, 28, 31, 37, 23, 62, 31, 71, 23, 15, 49, 25, 40, 45, + 49, 59, 40, 75, 49, 13, 57, 25, 66, 47, 57, 55, 66, 78, 58, + 7, 14, 16, 6, 41, 14, 50, 6, 75, 14, 4, 23, 29, 31, 38, + 23, 63, 31, 72, 23, 14, 49, 26, 40, 44, 49, 60, 40, 74, 49, + 14, 57, 24, 66, 47, 58, 54, 66, 77, 58, 8, 14, 17, 6, 42, + 14, 51, 6, 76, 14, 5, 23, 30, 31, 39, 23, 63, 32, 73, 23, + 13, 49, 27, 40, 43, 49, 61, 40, 73, 49, 15, 57, 23, 66, 46, + 58, 53, 66, 76, 58, 9, 14, 18, 6, 43, 14, 52, 6, 77, 14, + 6, 23, 31, 31, 40, 23, 62, 32, 74, 23, 12, 49, 28, 40, 42, + 49, 62, 40, 72, 49, 15, 58, 22, 66, 45, 58, 52, 66, 75, 58, + 10, 14, 19, 6, 44, 14, 53, 6, 78, 14, 7, 23, 31, 32, 41, + 23, 61, 32, 75, 23, 11, 49, 29, 40, 41, 49, 63, 40, 71, 49, + 14, 58, 21, 66, 44, 58, 51, 66, 74, 58, 11, 14, 20, 6, 45, + 14, 54, 6, 79, 14, 8, 23, 30, 32, 42, 23, 60, 32, 76, 23, + 10, 49, 30, 40, 40, 49, 63, 41, 70, 49, 13, 58, 20, 66, 43, + 58, 50, 66, 73, 58, 12, 14, 21, 6, 46, 14, 55, 6, 79, 15, + 9, 23, 29, 32, 43, 23, 59, 32, 77, 23, 9, 49, 31, 40, 39, + 49, 62, 41, 69, 49, 12, 58, 19, 66, 42, 58, 49, 66, 72, 58, + 13, 14, 22, 6, 47, 14, 56, 6, 78, 15, 10, 23, 28, 32, 44, + 23, 58, 32, 78, 23, 8, 49, 31, 41, 38, 49, 61, 41, 68, 49, + 11, 58, 18, 66, 41, 58, 48, 66, 71, 58, 14, 14, 23, 6, 47, + 15, 57, 6, 77, 15, 11, 23, 27, 32, 45, 23, 57, 32, 79, 23, + 7, 49, 30, 41, 37, 49, 60, 41, 67, 49, 10, 58, 17, 66, 40, + 58, 48, 67, 70, 58, 15, 14, 24, 6, 46, 15, 58, 6, 76, 15, + 12, 23, 26, 32, 46, 23, 56, 32, 79, 24, 6, 49, 29, 41, 36, + 49, 59, 41, 66, 49, 9, 58, 16, 66, 39, 58, 49, 67, 69, 58, + 15, 15, 25, 6, 45, 15, 59, 6, 75, 15, 13, 23, 25, 32, 47, + 23, 55, 32, 78, 24, 5, 49, 28, 41, 35, 49, 58, 41, 65, 49, + 8, 58, 16, 67, 38, 58, 50, 67, 68, 58, 14, 15, 26, 6, 44, + 15, 60, 6, 74, 15, 14, 23, 24, 32, 47, 24, 54, 32, 77, 24, + 4, 49, 27, 41, 34, 49, 57, 41, 64, 49, 7, 58, 17, 67, 37, + 58, 51, 67, 67, 58, 13, 15, 27, 6, 43, 15, 61, 6, 73, 15, + 15, 23, 23, 32, 46, 24, 53, 32, 76, 24, 3, 49, 26, 41, 33, + 49, 56, 41, 64, 50, 6, 58, 18, 67, 36, 58, 52, 67, 66, 58, + 12, 15, 28, 6, 42, 15, 62, 6, 72, 15, 15, 24, 22, 32, 45, + 24, 52, 32, 75, 24, 2, 49, 25, 41, 32, 49, 55, 41, 65, 50, + 5, 58, 19, 67, 35, 58, 53, 67, 65, 58, 11, 15, 29, 6, 41, + 15, 63, 6, 71, 15, 14, 24, 21, 32, 44, 24, 51, 32, 74, 24, + 1, 49, 24, 41, 32, 50, 54, 41, 66, 50, 4, 58, 20, 67, 34, + 58, 54, 67, 64, 58, 10, 15, 30, 6, 40, 15, 63, 7, 70, 15, + 13, 24, 20, 32, 43, 24, 50, 32, 73, 24, 0, 49, 23, 41, 33, + 50, 53, 41, 67, 50, 3, 58, 21, 67, 33, 58, 55, 67, 64, 59, + 9, 15, 31, 6, 39, 15, 62, 7, 69, 15, 12, 24, 19, 32, 42, + 24, 49, 32, 72, 24, 0, 50, 22, 41, 34, 50, 52, 41, 68, 50, + 2, 58, 22, 67, 32, 58, 56, 67, 65, 59, 8, 15, 31, 7, 38, + 15, 61, 7, 68, 15, 11, 24, 18, 32, 41, 24, 48, 32, 71, 24, + 1, 50, 21, 41, 35, 50, 51, 41, 69, 50, 1, 58, 23, 67, 32, + 59, 57, 67, 66, 59, 7, 15, 30, 7, 37, 15, 60, 7, 67, 15, + 10, 24, 17, 32, 40, 24, 48, 33, 70, 24, 2, 50, 20, 41, 36, + 50, 50, 41, 70, 50, 0, 58, 24, 67, 33, 59, 58, 67, 67, 59, + 6, 15, 29, 7, 36, 15, 59, 7, 66, 15, 9, 24, 16, 32, 39, + 24, 49, 33, 69, 24, 3, 50, 19, 41, 37, 50, 49, 41, 71, 50, + 0, 59, 25, 67, 34, 59, 59, 67, 68, 59, 5, 15, 28, 7, 35, + 15, 58, 7, 65, 15, 8, 24, 16, 33, 38, 24, 50, 33, 68, 24, + 4, 50, 18, 41, 38, 50, 48, 41, 72, 50, 1, 59, 26, 67, 35, + 59, 60, 67, 69, 59, 4, 15, 27, 7, 34, 15, 57, 7, 64, 15, + 7, 24, 17, 33, 37, 24, 51, 33, 67, 24, 5, 50, 17, 41, 39, + 50, 48, 42, 73, 50, 2, 59, 27, 67, 36, 59, 61, 67, 70, 59, + 3, 15, 26, 7, 33, 15, 56, 7, 64, 16, 6, 24, 18, 33, 36, + 24, 52, 33, 66, 24, 6, 50, 16, 41, 40, 50, 49, 42, 74, 50, + 3, 59, 28, 67, 37, 59, 62, 67, 71, 59, 2, 15, 25, 7, 32, + 15, 55, 7, 65, 16, 5, 24, 19, 33, 35, 24, 53, 33, 65, 24, + 7, 50, 16, 42, 41, 50, 50, 42, 75, 50, 4, 59, 29, 67, 38, + 59, 63, 67, 72, 59, 1, 15, 24, 7, 32, 16, 54, 7, 66, 16, + 4, 24, 20, 33, 34, 24, 54, 33, 64, 24, 8, 50, 17, 42, 42, + 50, 51, 42, 76, 50, 5, 59, 30, 67, 39, 59, 48, 51, 73, 59, + 0, 15, 23, 7, 33, 16, 53, 7, 67, 16, 3, 24, 21, 33, 33, + 24, 55, 33, 64, 25, 9, 50, 18, 42, 43, 50, 52, 42, 77, 50, + 6, 59, 31, 67, 40, 59, 49, 51, 74, 59, 0, 16, 22, 7, 34, + 16, 52, 7, 68, 16, 2, 24, 22, 33, 32, 24, 56, 33, 65, 25, + 10, 50, 19, 42, 44, 50, 53, 42, 78, 50, 7, 59, 16, 51, 41, + 59, 50, 51, 75, 59, 1, 16, 21, 7, 35, 16, 51, 7, 69, 16, + 1, 24, 23, 33, 32, 25, 57, 33, 66, 25, 11, 50, 20, 42, 45, + 50, 54, 42, 79, 50, 8, 59, 17, 51, 42, 59, 51, 51, 76, 59, + 2, 16, 20, 7, 36, 16, 50, 7, 70, 16, 0, 24, 24, 33, 33, + 25, 58, 33, 67, 25, 12, 50, 21, 42, 46, 50, 55, 42, 64, 34, + 9, 59, 18, 51, 43, 59, 52, 51, 77, 59, 3, 16, 19, 7, 37, + 16, 49, 7, 71, 16, 0, 25, 25, 33, 34, 25, 59, 33, 68, 25, + 13, 50, 22, 42, 47, 50, 56, 42, 65, 34, 10, 59, 19, 51, 44, + 59, 53, 51, 78, 59, 4, 16, 18, 7, 38, 16, 48, 7, 72, 16, + 1, 25, 26, 33, 35, 25, 60, 33, 69, 25, 14, 50, 23, 42, 32, + 34, 57, 42, 66, 34, 11, 59, 20, 51, 45, 59, 54, 51, 79, 59, + 5, 16, 17, 7, 39, 16, 48, 8, 73, 16, 2, 25, 27, 33, 36, + 25, 61, 33, 70, 25, 15, 50, 24, 42, 33, 34, 58, 42, 67, 34, + 12, 59, 21, 51, 46, 59, 55, 51, 79, 60, 6, 16, 16, 7, 40, + 16, 49, 8, 74, 16, 3, 25, 28, 33, 37, 25, 62, 33, 71, 25, + 0, 34, 25, 42, 34, 34, 59, 42, 68, 34, 13, 59, 22, 51, 47, + 59, 56, 51, 78, 60, 7, 16, 16, 8, 41, 16, 50, 8, 75, 16, + 4, 25, 29, 33, 38, 25, 63, 33, 72, 25, 1, 34, 26, 42, 35, + 34, 60, 42, 69, 34, 14, 59, 23, 51, 47, 60, 57, 51, 77, 60, + 8, 16, 17, 8, 42, 16, 51, 8, 76, 16, 5, 25, 30, 33, 39, + 25, 48, 17, 73, 25, 2, 34, 27, 42, 36, 34, 61, 42, 70, 34, + 15, 59, 24, 51, 46, 60, 58, 51, 76, 60, 9, 16, 18, 8, 43, + 16, 52, 8, 77, 16, 6, 25, 31, 33, 40, 25, 49, 17, 74, 25, + 3, 34, 28, 42, 37, 34, 62, 42, 71, 34, 15, 60, 25, 51, 45, + 60, 59, 51, 75, 60, 10, 16, 19, 8, 44, 16, 53, 8, 78, 16, + 7, 25, 16, 17, 41, 25, 50, 17, 75, 25, 4, 34, 29, 42, 38, + 34, 63, 42, 72, 34, 14, 60, 26, 51, 44, 60, 60, 51, 74, 60, + 11, 16, 20, 8, 45, 16, 54, 8, 79, 16, 8, 25, 17, 17, 42, + 25, 51, 17, 76, 25, 5, 34, 30, 42, 39, 34, 63, 43, 73, 34, + 13, 60, 27, 51, 43, 60, 61, 51, 73, 60, 12, 16, 21, 8, 46, + 16, 55, 8, 64, 0, 9, 25, 18, 17, 43, 25, 52, 17, 77, 25, + 6, 34, 31, 42, 40, 34, 62, 43, 74, 34, 12, 60, 28, 51, 42, + 60, 62, 51, 72, 60, 13, 16, 22, 8, 47, 16, 56, 8, 65, 0, + 10, 25, 19, 17, 44, 25, 53, 17, 78, 25, 7, 34, 31, 43, 41, + 34, 61, 43, 75, 34, 11, 60, 29, 51, 41, 60, 63, 51, 71, 60, + 14, 16, 23, 8, 32, 0, 57, 8, 66, 0, 11, 25, 20, 17, 45, + 25, 54, 17, 79, 25, 8, 34, 30, 43, 42, 34, 60, 43, 76, 34, + 10, 60, 30, 51, 40, 60, 63, 52, 70, 60, 15, 16, 24, 8, 33, + 0, 58, 8, 67, 0, 12, 25, 21, 17, 46, 25, 55, 17, 79, 26, + 9, 34, 29, 43, 43, 34, 59, 43, 77, 34, 9, 60, 31, 51, 39, + 60, 62, 52, 69, 60, +}; + +static const uint8_t hq_tab_07[] = { + 0, 0, 23, 8, 32, 0, 55, 8, 64, 0, 87, 8, 13, 25, 22, + 17, 44, 26, 54, 17, 72, 26, 86, 17, 12, 34, 24, 43, 44, 34, + 52, 43, 73, 35, 80, 43, 4, 60, 25, 52, 32, 60, 53, 52, 60, + 60, 81, 52, 1, 0, 24, 8, 33, 0, 56, 8, 65, 0, 88, 8, + 14, 25, 23, 17, 43, 26, 55, 17, 71, 26, 87, 17, 13, 34, 23, + 43, 44, 35, 51, 43, 72, 35, 79, 43, 3, 60, 24, 52, 31, 60, + 52, 52, 60, 61, 80, 52, 2, 0, 25, 8, 34, 0, 57, 8, 66, + 0, 89, 8, 14, 26, 24, 17, 42, 26, 56, 17, 70, 26, 88, 17, + 14, 34, 22, 43, 43, 35, 50, 43, 71, 35, 78, 43, 2, 60, 23, + 52, 30, 60, 51, 52, 61, 61, 79, 52, 3, 0, 26, 8, 35, 0, + 58, 8, 67, 0, 89, 9, 13, 26, 25, 17, 41, 26, 57, 17, 69, + 26, 89, 17, 14, 35, 21, 43, 42, 35, 49, 43, 70, 35, 77, 43, + 1, 60, 22, 52, 30, 61, 50, 52, 62, 61, 78, 52, 4, 0, 27, + 8, 36, 0, 59, 8, 68, 0, 88, 9, 12, 26, 26, 17, 40, 26, + 58, 17, 68, 26, 89, 18, 13, 35, 20, 43, 41, 35, 48, 43, 69, + 35, 76, 43, 0, 60, 21, 52, 31, 61, 49, 52, 63, 61, 77, 52, + 5, 0, 28, 8, 37, 0, 59, 9, 69, 0, 87, 9, 11, 26, 27, + 17, 39, 26, 59, 17, 67, 26, 88, 18, 12, 35, 19, 43, 40, 35, + 47, 43, 68, 35, 75, 43, 0, 61, 20, 52, 32, 61, 48, 52, 64, + 61, 76, 52, 6, 0, 29, 8, 38, 0, 58, 9, 70, 0, 86, 9, + 10, 26, 28, 17, 38, 26, 59, 18, 66, 26, 87, 18, 11, 35, 18, + 43, 39, 35, 46, 43, 67, 35, 75, 44, 1, 61, 19, 52, 33, 61, + 47, 52, 65, 61, 75, 52, 7, 0, 29, 9, 39, 0, 57, 9, 71, + 0, 85, 9, 9, 26, 29, 17, 37, 26, 58, 18, 65, 26, 86, 18, + 10, 35, 17, 43, 38, 35, 45, 43, 66, 35, 76, 44, 2, 61, 18, + 52, 34, 61, 46, 52, 66, 61, 75, 53, 8, 0, 28, 9, 40, 0, + 56, 9, 72, 0, 84, 9, 8, 26, 29, 18, 36, 26, 57, 18, 64, + 26, 85, 18, 9, 35, 16, 43, 37, 35, 45, 44, 65, 35, 77, 44, + 3, 61, 17, 52, 35, 61, 45, 52, 67, 61, 76, 53, 9, 0, 27, + 9, 41, 0, 55, 9, 73, 0, 83, 9, 7, 26, 28, 18, 35, 26, + 56, 18, 63, 26, 84, 18, 8, 35, 15, 43, 36, 35, 46, 44, 64, + 35, 78, 44, 4, 61, 16, 52, 36, 61, 45, 53, 68, 61, 77, 53, + 10, 0, 26, 9, 42, 0, 54, 9, 74, 0, 82, 9, 6, 26, 27, + 18, 34, 26, 55, 18, 62, 26, 83, 18, 7, 35, 15, 44, 35, 35, + 47, 44, 63, 35, 79, 44, 5, 61, 15, 52, 37, 61, 46, 53, 69, + 61, 78, 53, 11, 0, 25, 9, 43, 0, 53, 9, 74, 1, 81, 9, + 5, 26, 26, 18, 33, 26, 54, 18, 61, 26, 82, 18, 6, 35, 16, + 44, 34, 35, 48, 44, 62, 35, 80, 44, 6, 61, 15, 53, 38, 61, + 47, 53, 70, 61, 79, 53, 12, 0, 24, 9, 44, 0, 52, 9, 73, + 1, 80, 9, 4, 26, 25, 18, 32, 26, 53, 18, 60, 26, 81, 18, + 5, 35, 17, 44, 33, 35, 49, 44, 61, 35, 81, 44, 7, 61, 16, + 53, 39, 61, 48, 53, 71, 61, 80, 53, 13, 0, 23, 9, 44, 1, + 51, 9, 72, 1, 79, 9, 3, 26, 24, 18, 31, 26, 52, 18, 60, + 27, 80, 18, 4, 35, 18, 44, 32, 35, 50, 44, 60, 35, 82, 44, + 8, 61, 17, 53, 40, 61, 49, 53, 72, 61, 81, 53, 14, 0, 22, + 9, 43, 1, 50, 9, 71, 1, 78, 9, 2, 26, 23, 18, 30, 26, + 51, 18, 61, 27, 79, 18, 3, 35, 19, 44, 31, 35, 51, 44, 60, + 36, 83, 44, 9, 61, 18, 53, 41, 61, 50, 53, 73, 61, 82, 53, + 14, 1, 21, 9, 42, 1, 49, 9, 70, 1, 77, 9, 1, 26, 22, + 18, 30, 27, 50, 18, 62, 27, 78, 18, 2, 35, 20, 44, 30, 35, + 52, 44, 61, 36, 84, 44, 10, 61, 19, 53, 42, 61, 51, 53, 74, + 61, 83, 53, 13, 1, 20, 9, 41, 1, 48, 9, 69, 1, 76, 9, + 0, 26, 21, 18, 31, 27, 49, 18, 63, 27, 77, 18, 1, 35, 21, + 44, 30, 36, 53, 44, 62, 36, 85, 44, 11, 61, 20, 53, 43, 61, + 52, 53, 74, 62, 84, 53, 12, 1, 19, 9, 40, 1, 47, 9, 68, + 1, 75, 9, 0, 27, 20, 18, 32, 27, 48, 18, 64, 27, 76, 18, + 0, 35, 22, 44, 31, 36, 54, 44, 63, 36, 86, 44, 12, 61, 21, + 53, 44, 61, 53, 53, 73, 62, 85, 53, 11, 1, 18, 9, 39, 1, + 46, 9, 67, 1, 75, 10, 1, 27, 19, 18, 33, 27, 47, 18, 65, + 27, 75, 18, 0, 36, 23, 44, 32, 36, 55, 44, 64, 36, 87, 44, + 13, 61, 22, 53, 44, 62, 54, 53, 72, 62, 86, 53, 10, 1, 17, + 9, 38, 1, 45, 9, 66, 1, 76, 10, 2, 27, 18, 18, 34, 27, + 46, 18, 66, 27, 75, 19, 1, 36, 24, 44, 33, 36, 56, 44, 65, + 36, 88, 44, 14, 61, 23, 53, 43, 62, 55, 53, 71, 62, 87, 53, + 9, 1, 16, 9, 37, 1, 45, 10, 65, 1, 77, 10, 3, 27, 17, + 18, 35, 27, 45, 18, 67, 27, 76, 19, 2, 36, 25, 44, 34, 36, + 57, 44, 66, 36, 89, 44, 14, 62, 24, 53, 42, 62, 56, 53, 70, + 62, 88, 53, 8, 1, 15, 9, 36, 1, 46, 10, 64, 1, 78, 10, + 4, 27, 16, 18, 36, 27, 45, 19, 68, 27, 77, 19, 3, 36, 26, + 44, 35, 36, 58, 44, 67, 36, 89, 45, 13, 62, 25, 53, 41, 62, + 57, 53, 69, 62, 89, 53, 7, 1, 15, 10, 35, 1, 47, 10, 63, + 1, 79, 10, 5, 27, 15, 18, 37, 27, 46, 19, 69, 27, 78, 19, + 4, 36, 27, 44, 36, 36, 59, 44, 68, 36, 88, 45, 12, 62, 26, + 53, 40, 62, 58, 53, 68, 62, 89, 54, 6, 1, 16, 10, 34, 1, + 48, 10, 62, 1, 80, 10, 6, 27, 15, 19, 38, 27, 47, 19, 70, + 27, 79, 19, 5, 36, 28, 44, 37, 36, 59, 45, 69, 36, 87, 45, + 11, 62, 27, 53, 39, 62, 59, 53, 67, 62, 88, 54, 5, 1, 17, + 10, 33, 1, 49, 10, 61, 1, 81, 10, 7, 27, 16, 19, 39, 27, + 48, 19, 71, 27, 80, 19, 6, 36, 29, 44, 38, 36, 58, 45, 70, + 36, 86, 45, 10, 62, 28, 53, 38, 62, 59, 54, 66, 62, 87, 54, + 4, 1, 18, 10, 32, 1, 50, 10, 60, 1, 82, 10, 8, 27, 17, + 19, 40, 27, 49, 19, 72, 27, 81, 19, 7, 36, 29, 45, 39, 36, + 57, 45, 71, 36, 85, 45, 9, 62, 29, 53, 37, 62, 58, 54, 65, + 62, 86, 54, 3, 1, 19, 10, 31, 1, 51, 10, 60, 2, 83, 10, + 9, 27, 18, 19, 41, 27, 50, 19, 73, 27, 82, 19, 8, 36, 28, + 45, 40, 36, 56, 45, 72, 36, 84, 45, 8, 62, 29, 54, 36, 62, + 57, 54, 64, 62, 85, 54, 2, 1, 20, 10, 30, 1, 52, 10, 61, + 2, 84, 10, 10, 27, 19, 19, 42, 27, 51, 19, 74, 27, 83, 19, + 9, 36, 27, 45, 41, 36, 55, 45, 73, 36, 83, 45, 7, 62, 28, + 54, 35, 62, 56, 54, 63, 62, 84, 54, 1, 1, 21, 10, 30, 2, + 53, 10, 62, 2, 85, 10, 11, 27, 20, 19, 43, 27, 52, 19, 74, + 28, 84, 19, 10, 36, 26, 45, 42, 36, 54, 45, 74, 36, 82, 45, + 6, 62, 27, 54, 34, 62, 55, 54, 62, 62, 83, 54, 0, 1, 22, + 10, 31, 2, 54, 10, 63, 2, 86, 10, 12, 27, 21, 19, 44, 27, + 53, 19, 73, 28, 85, 19, 11, 36, 25, 45, 43, 36, 53, 45, 74, + 37, 81, 45, 5, 62, 26, 54, 33, 62, 54, 54, 61, 62, 82, 54, + 0, 2, 23, 10, 32, 2, 55, 10, 64, 2, 87, 10, 13, 27, 22, + 19, 44, 28, 54, 19, 72, 28, 86, 19, 12, 36, 24, 45, 44, 36, + 52, 45, 73, 37, 80, 45, 4, 62, 25, 54, 32, 62, 53, 54, 60, + 62, 81, 54, 1, 2, 24, 10, 33, 2, 56, 10, 65, 2, 88, 10, + 14, 27, 23, 19, 43, 28, 55, 19, 71, 28, 87, 19, 13, 36, 23, + 45, 44, 37, 51, 45, 72, 37, 79, 45, 3, 62, 24, 54, 31, 62, + 52, 54, 60, 63, 80, 54, 2, 2, 25, 10, 34, 2, 57, 10, 66, + 2, 89, 10, 14, 28, 24, 19, 42, 28, 56, 19, 70, 28, 88, 19, + 14, 36, 22, 45, 43, 37, 50, 45, 71, 37, 78, 45, 2, 62, 23, + 54, 30, 62, 51, 54, 61, 63, 79, 54, 3, 2, 26, 10, 35, 2, + 58, 10, 67, 2, 89, 11, 13, 28, 25, 19, 41, 28, 57, 19, 69, + 28, 89, 19, 14, 37, 21, 45, 42, 37, 49, 45, 70, 37, 77, 45, + 1, 62, 22, 54, 30, 63, 50, 54, 62, 63, 78, 54, 4, 2, 27, + 10, 36, 2, 59, 10, 68, 2, 88, 11, 12, 28, 26, 19, 40, 28, + 58, 19, 68, 28, 89, 20, 13, 37, 20, 45, 41, 37, 48, 45, 69, + 37, 76, 45, 0, 62, 21, 54, 31, 63, 49, 54, 63, 63, 77, 54, + 5, 2, 28, 10, 37, 2, 59, 11, 69, 2, 87, 11, 11, 28, 27, + 19, 39, 28, 59, 19, 67, 28, 88, 20, 12, 37, 19, 45, 40, 37, + 47, 45, 68, 37, 75, 45, 0, 63, 20, 54, 32, 63, 48, 54, 64, + 63, 76, 54, 6, 2, 29, 10, 38, 2, 58, 11, 70, 2, 86, 11, + 10, 28, 28, 19, 38, 28, 59, 20, 66, 28, 87, 20, 11, 37, 18, + 45, 39, 37, 46, 45, 67, 37, 75, 46, 1, 63, 19, 54, 33, 63, + 47, 54, 65, 63, 75, 54, 7, 2, 29, 11, 39, 2, 57, 11, 71, + 2, 85, 11, 9, 28, 29, 19, 37, 28, 58, 20, 65, 28, 86, 20, + 10, 37, 17, 45, 38, 37, 45, 45, 66, 37, 76, 46, 2, 63, 18, + 54, 34, 63, 46, 54, 66, 63, 75, 55, 8, 2, 28, 11, 40, 2, + 56, 11, 72, 2, 84, 11, 8, 28, 29, 20, 36, 28, 57, 20, 64, + 28, 85, 20, 9, 37, 16, 45, 37, 37, 45, 46, 65, 37, 77, 46, + 3, 63, 17, 54, 35, 63, 45, 54, 67, 63, 76, 55, 9, 2, 27, + 11, 41, 2, 55, 11, 73, 2, 83, 11, 7, 28, 28, 20, 35, 28, + 56, 20, 63, 28, 84, 20, 8, 37, 15, 45, 36, 37, 46, 46, 64, + 37, 78, 46, 4, 63, 16, 54, 36, 63, 45, 55, 68, 63, 77, 55, + 10, 2, 26, 11, 42, 2, 54, 11, 74, 2, 82, 11, 6, 28, 27, + 20, 34, 28, 55, 20, 62, 28, 83, 20, 7, 37, 15, 46, 35, 37, + 47, 46, 63, 37, 79, 46, 5, 63, 15, 54, 37, 63, 46, 55, 69, + 63, 78, 55, 11, 2, 25, 11, 43, 2, 53, 11, 74, 3, 81, 11, + 5, 28, 26, 20, 33, 28, 54, 20, 61, 28, 82, 20, 6, 37, 16, + 46, 34, 37, 48, 46, 62, 37, 80, 46, 6, 63, 15, 55, 38, 63, + 47, 55, 70, 63, 79, 55, 12, 2, 24, 11, 44, 2, 52, 11, 73, + 3, 80, 11, 4, 28, 25, 20, 32, 28, 53, 20, 60, 28, 81, 20, + 5, 37, 17, 46, 33, 37, 49, 46, 61, 37, 81, 46, 7, 63, 16, + 55, 39, 63, 48, 55, 71, 63, 80, 55, 13, 2, 23, 11, 44, 3, + 51, 11, 72, 3, 79, 11, 3, 28, 24, 20, 31, 28, 52, 20, 60, + 29, 80, 20, 4, 37, 18, 46, 32, 37, 50, 46, 60, 37, 82, 46, + 8, 63, 17, 55, 40, 63, 49, 55, 72, 63, 81, 55, 14, 2, 22, + 11, 43, 3, 50, 11, 71, 3, 78, 11, 2, 28, 23, 20, 30, 28, + 51, 20, 61, 29, 79, 20, 3, 37, 19, 46, 31, 37, 51, 46, 60, + 38, 83, 46, 9, 63, 18, 55, 41, 63, 50, 55, 73, 63, 82, 55, + 14, 3, 21, 11, 42, 3, 49, 11, 70, 3, 77, 11, 1, 28, 22, + 20, 30, 29, 50, 20, 62, 29, 78, 20, 2, 37, 20, 46, 30, 37, + 52, 46, 61, 38, 84, 46, 10, 63, 19, 55, 42, 63, 51, 55, 74, + 63, 83, 55, 13, 3, 20, 11, 41, 3, 48, 11, 69, 3, 76, 11, + 0, 28, 21, 20, 31, 29, 49, 20, 63, 29, 77, 20, 1, 37, 21, + 46, 30, 38, 53, 46, 62, 38, 85, 46, 11, 63, 20, 55, 43, 63, + 52, 55, 74, 64, 84, 55, 12, 3, 19, 11, 40, 3, 47, 11, 68, + 3, 75, 11, 0, 29, 20, 20, 32, 29, 48, 20, 64, 29, 76, 20, + 0, 37, 22, 46, 31, 38, 54, 46, 63, 38, 86, 46, 12, 63, 21, + 55, 44, 63, 53, 55, 73, 64, 85, 55, 11, 3, 18, 11, 39, 3, + 46, 11, 67, 3, 75, 12, 1, 29, 19, 20, 33, 29, 47, 20, 65, + 29, 75, 20, 0, 38, 23, 46, 32, 38, 55, 46, 64, 38, 87, 46, + 13, 63, 22, 55, 44, 64, 54, 55, 72, 64, 86, 55, 10, 3, 17, + 11, 38, 3, 45, 11, 66, 3, 76, 12, 2, 29, 18, 20, 34, 29, + 46, 20, 66, 29, 75, 21, 1, 38, 24, 46, 33, 38, 56, 46, 65, + 38, 88, 46, 14, 63, 23, 55, 43, 64, 55, 55, 71, 64, 87, 55, + 9, 3, 16, 11, 37, 3, 45, 12, 65, 3, 77, 12, 3, 29, 17, + 20, 35, 29, 45, 20, 67, 29, 76, 21, 2, 38, 25, 46, 34, 38, + 57, 46, 66, 38, 89, 46, 14, 64, 24, 55, 42, 64, 56, 55, 70, + 64, 88, 55, 8, 3, 15, 11, 36, 3, 46, 12, 64, 3, 78, 12, + 4, 29, 16, 20, 36, 29, 45, 21, 68, 29, 77, 21, 3, 38, 26, + 46, 35, 38, 58, 46, 67, 38, 89, 47, 13, 64, 25, 55, 41, 64, + 57, 55, 69, 64, 89, 55, 7, 3, 15, 12, 35, 3, 47, 12, 63, + 3, 79, 12, 5, 29, 15, 20, 37, 29, 46, 21, 69, 29, 78, 21, + 4, 38, 27, 46, 36, 38, 59, 46, 68, 38, 88, 47, 12, 64, 26, + 55, 40, 64, 58, 55, 68, 64, 89, 56, 6, 3, 16, 12, 34, 3, + 48, 12, 62, 3, 80, 12, 6, 29, 15, 21, 38, 29, 47, 21, 70, + 29, 79, 21, 5, 38, 28, 46, 37, 38, 59, 47, 69, 38, 87, 47, + 11, 64, 27, 55, 39, 64, 59, 55, 67, 64, 88, 56, 5, 3, 17, + 12, 33, 3, 49, 12, 61, 3, 81, 12, 7, 29, 16, 21, 39, 29, + 48, 21, 71, 29, 80, 21, 6, 38, 29, 46, 38, 38, 58, 47, 70, + 38, 86, 47, 10, 64, 28, 55, 38, 64, 59, 56, 66, 64, 87, 56, + 4, 3, 18, 12, 32, 3, 50, 12, 60, 3, 82, 12, 8, 29, 17, + 21, 40, 29, 49, 21, 72, 29, 81, 21, 7, 38, 29, 47, 39, 38, + 57, 47, 71, 38, 85, 47, 9, 64, 29, 55, 37, 64, 58, 56, 65, + 64, 86, 56, 3, 3, 19, 12, 31, 3, 51, 12, 60, 4, 83, 12, + 9, 29, 18, 21, 41, 29, 50, 21, 73, 29, 82, 21, 8, 38, 28, + 47, 40, 38, 56, 47, 72, 38, 84, 47, 8, 64, 29, 56, 36, 64, + 57, 56, 64, 64, 85, 56, 2, 3, 20, 12, 30, 3, 52, 12, 61, + 4, 84, 12, 10, 29, 19, 21, 42, 29, 51, 21, 74, 29, 83, 21, + 9, 38, 27, 47, 41, 38, 55, 47, 73, 38, 83, 47, 7, 64, 28, + 56, 35, 64, 56, 56, 63, 64, 84, 56, 1, 3, 21, 12, 30, 4, + 53, 12, 62, 4, 85, 12, 11, 29, 20, 21, 43, 29, 52, 21, 74, + 30, 84, 21, 10, 38, 26, 47, 42, 38, 54, 47, 74, 38, 82, 47, + 6, 64, 27, 56, 34, 64, 55, 56, 62, 64, 83, 56, 0, 3, 22, + 12, 31, 4, 54, 12, 63, 4, 86, 12, 12, 29, 21, 21, 44, 29, + 53, 21, 73, 30, 85, 21, 11, 38, 25, 47, 43, 38, 53, 47, 74, + 39, 81, 47, 5, 64, 26, 56, 33, 64, 54, 56, 61, 64, 82, 56, + 0, 4, 23, 12, 32, 4, 55, 12, 64, 4, 87, 12, 13, 29, 22, + 21, 44, 30, 54, 21, 72, 30, 86, 21, 12, 38, 24, 47, 44, 38, + 52, 47, 73, 39, 80, 47, 4, 64, 25, 56, 32, 64, 53, 56, 60, + 64, 81, 56, 1, 4, 24, 12, 33, 4, 56, 12, 65, 4, 88, 12, + 14, 29, 23, 21, 43, 30, 55, 21, 71, 30, 87, 21, 13, 38, 23, + 47, 44, 39, 51, 47, 72, 39, 79, 47, 3, 64, 24, 56, 31, 64, + 52, 56, 60, 65, 80, 56, 2, 4, 25, 12, 34, 4, 57, 12, 66, + 4, 89, 12, 14, 30, 24, 21, 42, 30, 56, 21, 70, 30, 88, 21, + 14, 38, 22, 47, 43, 39, 50, 47, 71, 39, 78, 47, 2, 64, 23, + 56, 30, 64, 51, 56, 61, 65, 79, 56, 3, 4, 26, 12, 35, 4, + 58, 12, 67, 4, 89, 13, 13, 30, 25, 21, 41, 30, 57, 21, 69, + 30, 89, 21, 14, 39, 21, 47, 42, 39, 49, 47, 70, 39, 77, 47, + 1, 64, 22, 56, 30, 65, 50, 56, 62, 65, 78, 56, 4, 4, 27, + 12, 36, 4, 59, 12, 68, 4, 88, 13, 12, 30, 26, 21, 40, 30, + 58, 21, 68, 30, 89, 22, 13, 39, 20, 47, 41, 39, 48, 47, 69, + 39, 76, 47, 0, 64, 21, 56, 31, 65, 49, 56, 63, 65, 77, 56, + 5, 4, 28, 12, 37, 4, 59, 13, 69, 4, 87, 13, 11, 30, 27, + 21, 39, 30, 59, 21, 67, 30, 88, 22, 12, 39, 19, 47, 40, 39, + 47, 47, 68, 39, 75, 47, 0, 65, 20, 56, 32, 65, 48, 56, 64, + 65, 76, 56, 6, 4, 29, 12, 38, 4, 58, 13, 70, 4, 86, 13, + 10, 30, 28, 21, 38, 30, 59, 22, 66, 30, 87, 22, 11, 39, 18, + 47, 39, 39, 46, 47, 67, 39, 75, 48, 1, 65, 19, 56, 33, 65, + 47, 56, 65, 65, 75, 56, 7, 4, 29, 13, 39, 4, 57, 13, 71, + 4, 85, 13, 9, 30, 29, 21, 37, 30, 58, 22, 65, 30, 86, 22, + 10, 39, 17, 47, 38, 39, 45, 47, 66, 39, 76, 48, 2, 65, 18, + 56, 34, 65, 46, 56, 66, 65, 75, 57, 8, 4, 28, 13, 40, 4, + 56, 13, 72, 4, 84, 13, 8, 30, 29, 22, 36, 30, 57, 22, 64, + 30, 85, 22, 9, 39, 16, 47, 37, 39, 45, 48, 65, 39, 77, 48, + 3, 65, 17, 56, 35, 65, 45, 56, 67, 65, 76, 57, 9, 4, 27, + 13, 41, 4, 55, 13, 73, 4, 83, 13, 7, 30, 28, 22, 35, 30, + 56, 22, 63, 30, 84, 22, 8, 39, 15, 47, 36, 39, 46, 48, 64, + 39, 78, 48, 4, 65, 16, 56, 36, 65, 45, 57, 68, 65, 77, 57, + 10, 4, 26, 13, 42, 4, 54, 13, 74, 4, 82, 13, 6, 30, 27, + 22, 34, 30, 55, 22, 62, 30, 83, 22, 7, 39, 15, 48, 35, 39, + 47, 48, 63, 39, 79, 48, 5, 65, 15, 56, 37, 65, 46, 57, 69, + 65, 78, 57, 11, 4, 25, 13, 43, 4, 53, 13, 74, 5, 81, 13, + 5, 30, 26, 22, 33, 30, 54, 22, 61, 30, 82, 22, 6, 39, 16, + 48, 34, 39, 48, 48, 62, 39, 80, 48, 6, 65, 15, 57, 38, 65, + 47, 57, 70, 65, 79, 57, 12, 4, 24, 13, 44, 4, 52, 13, 73, + 5, 80, 13, 4, 30, 25, 22, 32, 30, 53, 22, 60, 30, 81, 22, + 5, 39, 17, 48, 33, 39, 49, 48, 61, 39, 81, 48, 7, 65, 16, + 57, 39, 65, 48, 57, 71, 65, 80, 57, 13, 4, 23, 13, 44, 5, + 51, 13, 72, 5, 79, 13, 3, 30, 24, 22, 31, 30, 52, 22, 60, + 31, 80, 22, 4, 39, 18, 48, 32, 39, 50, 48, 60, 39, 82, 48, + 8, 65, 17, 57, 40, 65, 49, 57, 72, 65, 81, 57, 14, 4, 22, + 13, 43, 5, 50, 13, 71, 5, 78, 13, 2, 30, 23, 22, 30, 30, + 51, 22, 61, 31, 79, 22, 3, 39, 19, 48, 31, 39, 51, 48, 60, + 40, 83, 48, 9, 65, 18, 57, 41, 65, 50, 57, 73, 65, 82, 57, + 14, 5, 21, 13, 42, 5, 49, 13, 70, 5, 77, 13, 1, 30, 22, + 22, 30, 31, 50, 22, 62, 31, 78, 22, 2, 39, 20, 48, 30, 39, + 52, 48, 61, 40, 84, 48, 10, 65, 19, 57, 42, 65, 51, 57, 74, + 65, 83, 57, 13, 5, 20, 13, 41, 5, 48, 13, 69, 5, 76, 13, + 0, 30, 21, 22, 31, 31, 49, 22, 63, 31, 77, 22, 1, 39, 21, + 48, 30, 40, 53, 48, 62, 40, 85, 48, 11, 65, 20, 57, 43, 65, + 52, 57, 74, 66, 84, 57, 12, 5, 19, 13, 40, 5, 47, 13, 68, + 5, 75, 13, 0, 31, 20, 22, 32, 31, 48, 22, 64, 31, 76, 22, + 0, 39, 22, 48, 31, 40, 54, 48, 63, 40, 86, 48, 12, 65, 21, + 57, 44, 65, 53, 57, 73, 66, 85, 57, 11, 5, 18, 13, 39, 5, + 46, 13, 67, 5, 75, 14, 1, 31, 19, 22, 33, 31, 47, 22, 65, + 31, 75, 22, 0, 40, 23, 48, 32, 40, 55, 48, 64, 40, 87, 48, + 13, 65, 22, 57, 44, 66, 54, 57, 72, 66, 86, 57, 10, 5, 17, + 13, 38, 5, 45, 13, 66, 5, 76, 14, 2, 31, 18, 22, 34, 31, + 46, 22, 66, 31, 75, 23, 1, 40, 24, 48, 33, 40, 56, 48, 65, + 40, 88, 48, 14, 65, 23, 57, 43, 66, 55, 57, 71, 66, 87, 57, + 9, 5, 16, 13, 37, 5, 45, 14, 65, 5, 77, 14, 3, 31, 17, + 22, 35, 31, 45, 22, 67, 31, 76, 23, 2, 40, 25, 48, 34, 40, + 57, 48, 66, 40, 89, 48, 14, 66, 24, 57, 42, 66, 56, 57, 70, + 66, 88, 57, 8, 5, 15, 13, 36, 5, 46, 14, 64, 5, 78, 14, + 4, 31, 16, 22, 36, 31, 45, 23, 68, 31, 77, 23, 3, 40, 26, + 48, 35, 40, 58, 48, 67, 40, 89, 49, 13, 66, 25, 57, 41, 66, + 57, 57, 69, 66, 89, 57, 7, 5, 15, 14, 35, 5, 47, 14, 63, + 5, 79, 14, 5, 31, 15, 22, 37, 31, 46, 23, 69, 31, 78, 23, + 4, 40, 27, 48, 36, 40, 59, 48, 68, 40, 88, 49, 12, 66, 26, + 57, 40, 66, 58, 57, 68, 66, 89, 58, 6, 5, 16, 14, 34, 5, + 48, 14, 62, 5, 80, 14, 6, 31, 15, 23, 38, 31, 47, 23, 70, + 31, 79, 23, 5, 40, 28, 48, 37, 40, 59, 49, 69, 40, 87, 49, + 11, 66, 27, 57, 39, 66, 59, 57, 67, 66, 88, 58, 5, 5, 17, + 14, 33, 5, 49, 14, 61, 5, 81, 14, 7, 31, 16, 23, 39, 31, + 48, 23, 71, 31, 80, 23, 6, 40, 29, 48, 38, 40, 58, 49, 70, + 40, 86, 49, 10, 66, 28, 57, 38, 66, 59, 58, 66, 66, 87, 58, + 4, 5, 18, 14, 32, 5, 50, 14, 60, 5, 82, 14, 8, 31, 17, + 23, 40, 31, 49, 23, 72, 31, 81, 23, 7, 40, 29, 49, 39, 40, + 57, 49, 71, 40, 85, 49, 9, 66, 29, 57, 37, 66, 58, 58, 65, + 66, 86, 58, 3, 5, 19, 14, 31, 5, 51, 14, 60, 6, 83, 14, + 9, 31, 18, 23, 41, 31, 50, 23, 73, 31, 82, 23, 8, 40, 28, + 49, 40, 40, 56, 49, 72, 40, 84, 49, 8, 66, 29, 58, 36, 66, + 57, 58, 64, 66, 85, 58, 2, 5, 20, 14, 30, 5, 52, 14, 61, + 6, 84, 14, 10, 31, 19, 23, 42, 31, 51, 23, 74, 31, 83, 23, + 9, 40, 27, 49, 41, 40, 55, 49, 73, 40, 83, 49, 7, 66, 28, + 58, 35, 66, 56, 58, 63, 66, 84, 58, 1, 5, 21, 14, 30, 6, + 53, 14, 62, 6, 85, 14, 11, 31, 20, 23, 43, 31, 52, 23, 74, + 32, 84, 23, 10, 40, 26, 49, 42, 40, 54, 49, 74, 40, 82, 49, + 6, 66, 27, 58, 34, 66, 55, 58, 62, 66, 83, 58, 0, 5, 22, + 14, 31, 6, 54, 14, 63, 6, 86, 14, 12, 31, 21, 23, 44, 31, + 53, 23, 73, 32, 85, 23, 11, 40, 25, 49, 43, 40, 53, 49, 74, + 41, 81, 49, 5, 66, 26, 58, 33, 66, 54, 58, 61, 66, 82, 58, + 0, 6, 23, 14, 32, 6, 55, 14, 64, 6, 87, 14, 13, 31, 22, + 23, 44, 32, 54, 23, 72, 32, 86, 23, 12, 40, 24, 49, 44, 40, + 52, 49, 73, 41, 80, 49, 4, 66, 25, 58, 32, 66, 53, 58, 60, + 66, 81, 58, 1, 6, 24, 14, 33, 6, 56, 14, 65, 6, 88, 14, + 14, 31, 23, 23, 43, 32, 55, 23, 71, 32, 87, 23, 13, 40, 23, + 49, 44, 41, 51, 49, 72, 41, 79, 49, 3, 66, 24, 58, 31, 66, + 52, 58, 60, 67, 80, 58, 2, 6, 25, 14, 34, 6, 57, 14, 66, + 6, 89, 14, 14, 32, 24, 23, 42, 32, 56, 23, 70, 32, 88, 23, + 14, 40, 22, 49, 43, 41, 50, 49, 71, 41, 78, 49, 2, 66, 23, + 58, 30, 66, 51, 58, 61, 67, 79, 58, 3, 6, 26, 14, 35, 6, + 58, 14, 67, 6, 89, 15, 13, 32, 25, 23, 41, 32, 57, 23, 69, + 32, 89, 23, 14, 41, 21, 49, 42, 41, 49, 49, 70, 41, 77, 49, + 1, 66, 22, 58, 30, 67, 50, 58, 62, 67, 78, 58, 4, 6, 27, + 14, 36, 6, 59, 14, 68, 6, 88, 15, 12, 32, 26, 23, 40, 32, + 58, 23, 68, 32, 89, 24, 13, 41, 20, 49, 41, 41, 48, 49, 69, + 41, 76, 49, 0, 66, 21, 58, 31, 67, 49, 58, 63, 67, 77, 58, + 5, 6, 28, 14, 37, 6, 59, 15, 69, 6, 87, 15, 11, 32, 27, + 23, 39, 32, 59, 23, 67, 32, 88, 24, 12, 41, 19, 49, 40, 41, + 47, 49, 68, 41, 75, 49, 0, 67, 20, 58, 32, 67, 48, 58, 64, + 67, 76, 58, 6, 6, 29, 14, 38, 6, 58, 15, 70, 6, 86, 15, + 10, 32, 28, 23, 38, 32, 59, 24, 66, 32, 87, 24, 11, 41, 18, + 49, 39, 41, 46, 49, 67, 41, 75, 50, 1, 67, 19, 58, 33, 67, + 47, 58, 65, 67, 75, 58, 7, 6, 29, 15, 39, 6, 57, 15, 71, + 6, 85, 15, 9, 32, 29, 23, 37, 32, 58, 24, 65, 32, 86, 24, + 10, 41, 17, 49, 38, 41, 45, 49, 66, 41, 76, 50, 2, 67, 18, + 58, 34, 67, 46, 58, 66, 67, 75, 59, 8, 6, 28, 15, 40, 6, + 56, 15, 72, 6, 84, 15, 8, 32, 29, 24, 36, 32, 57, 24, 64, + 32, 85, 24, 9, 41, 16, 49, 37, 41, 45, 50, 65, 41, 77, 50, + 3, 67, 17, 58, 35, 67, 45, 58, 67, 67, 76, 59, 9, 6, 27, + 15, 41, 6, 55, 15, 73, 6, 83, 15, 7, 32, 28, 24, 35, 32, + 56, 24, 63, 32, 84, 24, 8, 41, 15, 49, 36, 41, 46, 50, 64, + 41, 78, 50, 4, 67, 16, 58, 36, 67, 45, 59, 68, 67, 77, 59, + 10, 6, 26, 15, 42, 6, 54, 15, 74, 6, 82, 15, 6, 32, 27, + 24, 34, 32, 55, 24, 62, 32, 83, 24, 7, 41, 15, 50, 35, 41, + 47, 50, 63, 41, 79, 50, 5, 67, 15, 58, 37, 67, 46, 59, 69, + 67, 78, 59, 11, 6, 25, 15, 43, 6, 53, 15, 74, 7, 81, 15, + 5, 32, 26, 24, 33, 32, 54, 24, 61, 32, 82, 24, 6, 41, 16, + 50, 34, 41, 48, 50, 62, 41, 80, 50, 6, 67, 15, 59, 38, 67, + 47, 59, 70, 67, 79, 59, 12, 6, 24, 15, 44, 6, 52, 15, 73, + 7, 80, 15, 4, 32, 25, 24, 32, 32, 53, 24, 60, 32, 81, 24, + 5, 41, 17, 50, 33, 41, 49, 50, 61, 41, 81, 50, 7, 67, 16, + 59, 39, 67, 48, 59, 71, 67, 80, 59, 13, 6, 23, 15, 44, 7, + 51, 15, 72, 7, 79, 15, 3, 32, 24, 24, 31, 32, 52, 24, 60, + 33, 80, 24, 4, 41, 18, 50, 32, 41, 50, 50, 60, 41, 82, 50, + 8, 67, 17, 59, 40, 67, 49, 59, 72, 67, 81, 59, 14, 6, 22, + 15, 43, 7, 50, 15, 71, 7, 78, 15, 2, 32, 23, 24, 30, 32, + 51, 24, 61, 33, 79, 24, 3, 41, 19, 50, 31, 41, 51, 50, 60, + 42, 83, 50, 9, 67, 18, 59, 41, 67, 50, 59, 73, 67, 82, 59, + 14, 7, 21, 15, 42, 7, 49, 15, 70, 7, 77, 15, 1, 32, 22, + 24, 30, 33, 50, 24, 62, 33, 78, 24, 2, 41, 20, 50, 30, 41, + 52, 50, 61, 42, 84, 50, 10, 67, 19, 59, 42, 67, 51, 59, 74, + 67, 83, 59, 13, 7, 20, 15, 41, 7, 48, 15, 69, 7, 76, 15, + 0, 32, 21, 24, 31, 33, 49, 24, 63, 33, 77, 24, 1, 41, 21, + 50, 30, 42, 53, 50, 62, 42, 85, 50, 11, 67, 20, 59, 43, 67, + 52, 59, 60, 51, 84, 59, 12, 7, 19, 15, 40, 7, 47, 15, 68, + 7, 75, 15, 0, 33, 20, 24, 32, 33, 48, 24, 64, 33, 76, 24, + 0, 41, 22, 50, 31, 42, 54, 50, 63, 42, 86, 50, 12, 67, 21, + 59, 44, 67, 53, 59, 61, 51, 85, 59, 11, 7, 18, 15, 39, 7, + 46, 15, 67, 7, 75, 16, 1, 33, 19, 24, 33, 33, 47, 24, 65, + 33, 75, 24, 0, 42, 23, 50, 32, 42, 55, 50, 64, 42, 87, 50, + 13, 67, 22, 59, 30, 51, 54, 59, 62, 51, 86, 59, 10, 7, 17, + 15, 38, 7, 45, 15, 66, 7, 76, 16, 2, 33, 18, 24, 34, 33, + 46, 24, 66, 33, 75, 25, 1, 42, 24, 50, 33, 42, 56, 50, 65, + 42, 88, 50, 14, 67, 23, 59, 31, 51, 55, 59, 63, 51, 87, 59, + 9, 7, 16, 15, 37, 7, 45, 16, 65, 7, 77, 16, 3, 33, 17, + 24, 35, 33, 45, 24, 67, 33, 76, 25, 2, 42, 25, 50, 34, 42, + 57, 50, 66, 42, 89, 50, 0, 51, 24, 59, 32, 51, 56, 59, 64, + 51, 88, 59, 8, 7, 15, 15, 36, 7, 46, 16, 64, 7, 78, 16, + 4, 33, 16, 24, 36, 33, 45, 25, 68, 33, 77, 25, 3, 42, 26, + 50, 35, 42, 58, 50, 67, 42, 75, 34, 1, 51, 25, 59, 33, 51, + 57, 59, 65, 51, 89, 59, 7, 7, 15, 16, 35, 7, 47, 16, 63, + 7, 79, 16, 5, 33, 15, 24, 37, 33, 46, 25, 69, 33, 78, 25, + 4, 42, 27, 50, 36, 42, 59, 50, 68, 42, 76, 34, 2, 51, 26, + 59, 34, 51, 58, 59, 66, 51, 89, 60, 6, 7, 16, 16, 34, 7, + 48, 16, 62, 7, 80, 16, 6, 33, 15, 25, 38, 33, 47, 25, 70, + 33, 79, 25, 5, 42, 28, 50, 37, 42, 45, 34, 69, 42, 77, 34, + 3, 51, 27, 59, 35, 51, 59, 59, 67, 51, 88, 60, 5, 7, 17, + 16, 33, 7, 49, 16, 61, 7, 81, 16, 7, 33, 16, 25, 39, 33, + 48, 25, 71, 33, 80, 25, 6, 42, 29, 50, 38, 42, 46, 34, 70, + 42, 78, 34, 4, 51, 28, 59, 36, 51, 59, 60, 68, 51, 87, 60, + 4, 7, 18, 16, 32, 7, 50, 16, 60, 7, 82, 16, 8, 33, 17, + 25, 40, 33, 49, 25, 72, 33, 81, 25, 7, 42, 15, 34, 39, 42, + 47, 34, 71, 42, 79, 34, 5, 51, 29, 59, 37, 51, 58, 60, 69, + 51, 86, 60, 3, 7, 19, 16, 31, 7, 51, 16, 60, 8, 83, 16, + 9, 33, 18, 25, 41, 33, 50, 25, 73, 33, 82, 25, 8, 42, 16, + 34, 40, 42, 48, 34, 72, 42, 80, 34, 6, 51, 29, 60, 38, 51, + 57, 60, 70, 51, 85, 60, 2, 7, 20, 16, 30, 7, 52, 16, 61, + 8, 84, 16, 10, 33, 19, 25, 42, 33, 51, 25, 74, 33, 83, 25, + 9, 42, 17, 34, 41, 42, 49, 34, 73, 42, 81, 34, 7, 51, 28, + 60, 39, 51, 56, 60, 71, 51, 84, 60, 1, 7, 21, 16, 30, 8, + 53, 16, 62, 8, 85, 16, 11, 33, 20, 25, 43, 33, 52, 25, 60, + 17, 84, 25, 10, 42, 18, 34, 42, 42, 50, 34, 74, 42, 82, 34, + 8, 51, 27, 60, 40, 51, 55, 60, 72, 51, 83, 60, 0, 7, 22, + 16, 31, 8, 54, 16, 63, 8, 86, 16, 12, 33, 21, 25, 44, 33, + 53, 25, 61, 17, 85, 25, 11, 42, 19, 34, 43, 42, 51, 34, 74, + 43, 83, 34, 9, 51, 26, 60, 41, 51, 54, 60, 73, 51, 82, 60, + 0, 8, 23, 16, 32, 8, 55, 16, 64, 8, 87, 16, 13, 33, 22, + 25, 30, 17, 54, 25, 62, 17, 86, 25, 12, 42, 20, 34, 44, 42, + 52, 34, 73, 43, 84, 34, 10, 51, 25, 60, 42, 51, 53, 60, 74, + 51, 81, 60, 1, 8, 24, 16, 33, 8, 56, 16, 65, 8, 88, 16, + 14, 33, 23, 25, 31, 17, 55, 25, 63, 17, 87, 25, 13, 42, 21, + 34, 44, 43, 53, 34, 72, 43, 85, 34, 11, 51, 24, 60, 43, 51, + 52, 60, 74, 52, 80, 60, 2, 8, 25, 16, 34, 8, 57, 16, 66, + 8, 89, 16, 0, 17, 24, 25, 32, 17, 56, 25, 64, 17, 88, 25, + 14, 42, 22, 34, 43, 43, 54, 34, 71, 43, 86, 34, 12, 51, 23, + 60, 44, 51, 51, 60, 73, 52, 79, 60, 3, 8, 26, 16, 35, 8, + 58, 16, 67, 8, 75, 0, 1, 17, 25, 25, 33, 17, 57, 25, 65, + 17, 89, 25, 14, 43, 23, 34, 42, 43, 55, 34, 70, 43, 87, 34, + 13, 51, 22, 60, 44, 52, 50, 60, 72, 52, 78, 60, 4, 8, 27, + 16, 36, 8, 59, 16, 68, 8, 76, 0, 2, 17, 26, 25, 34, 17, + 58, 25, 66, 17, 89, 26, 13, 43, 24, 34, 41, 43, 56, 34, 69, + 43, 88, 34, 14, 51, 21, 60, 43, 52, 49, 60, 71, 52, 77, 60, + 5, 8, 28, 16, 37, 8, 45, 0, 69, 8, 77, 0, 3, 17, 27, + 25, 35, 17, 59, 25, 67, 17, 88, 26, 12, 43, 25, 34, 40, 43, + 57, 34, 68, 43, 89, 34, 14, 52, 20, 60, 42, 52, 48, 60, 70, + 52, 76, 60, 6, 8, 29, 16, 38, 8, 46, 0, 70, 8, 78, 0, + 4, 17, 28, 25, 36, 17, 59, 26, 68, 17, 87, 26, 11, 43, 26, + 34, 39, 43, 58, 34, 67, 43, 89, 35, 13, 52, 19, 60, 41, 52, + 47, 60, 69, 52, 75, 60, 7, 8, 15, 0, 39, 8, 47, 0, 71, + 8, 79, 0, 5, 17, 29, 25, 37, 17, 58, 26, 69, 17, 86, 26, + 10, 43, 27, 34, 38, 43, 59, 34, 66, 43, 88, 35, 12, 52, 18, + 60, 40, 52, 46, 60, 68, 52, 75, 61, 8, 8, 16, 0, 40, 8, + 48, 0, 72, 8, 80, 0, 6, 17, 29, 26, 38, 17, 57, 26, 70, + 17, 85, 26, 9, 43, 28, 34, 37, 43, 59, 35, 65, 43, 87, 35, + 11, 52, 17, 60, 39, 52, 45, 60, 67, 52, 76, 61, 9, 8, 17, + 0, 41, 8, 49, 0, 73, 8, 81, 0, 7, 17, 28, 26, 39, 17, + 56, 26, 71, 17, 84, 26, 8, 43, 29, 34, 36, 43, 58, 35, 64, + 43, 86, 35, 10, 52, 16, 60, 38, 52, 45, 61, 66, 52, 77, 61, + 10, 8, 18, 0, 42, 8, 50, 0, 74, 8, 82, 0, 8, 17, 27, + 26, 40, 17, 55, 26, 72, 17, 83, 26, 7, 43, 29, 35, 35, 43, + 57, 35, 63, 43, 85, 35, 9, 52, 15, 60, 37, 52, 46, 61, 65, + 52, 78, 61, 11, 8, 19, 0, 43, 8, 51, 0, 74, 9, 83, 0, + 9, 17, 26, 26, 41, 17, 54, 26, 73, 17, 82, 26, 6, 43, 28, + 35, 34, 43, 56, 35, 62, 43, 84, 35, 8, 52, 15, 61, 36, 52, + 47, 61, 64, 52, 79, 61, 12, 8, 20, 0, 44, 8, 52, 0, 73, + 9, 84, 0, 10, 17, 25, 26, 42, 17, 53, 26, 74, 17, 81, 26, + 5, 43, 27, 35, 33, 43, 55, 35, 61, 43, 83, 35, 7, 52, 16, + 61, 35, 52, 48, 61, 63, 52, 80, 61, 13, 8, 21, 0, 44, 9, + 53, 0, 72, 9, 85, 0, 11, 17, 24, 26, 43, 17, 52, 26, 74, + 18, 80, 26, 4, 43, 26, 35, 32, 43, 54, 35, 60, 43, 82, 35, + 6, 52, 17, 61, 34, 52, 49, 61, 62, 52, 81, 61, 14, 8, 22, + 0, 43, 9, 54, 0, 71, 9, 86, 0, 12, 17, 23, 26, 44, 17, + 51, 26, 73, 18, 79, 26, 3, 43, 25, 35, 31, 43, 53, 35, 60, + 44, 81, 35, 5, 52, 18, 61, 33, 52, 50, 61, 61, 52, 82, 61, + 14, 9, 23, 0, 42, 9, 55, 0, 70, 9, 87, 0, 13, 17, 22, + 26, 44, 18, 50, 26, 72, 18, 78, 26, 2, 43, 24, 35, 30, 43, + 52, 35, 61, 44, 80, 35, 4, 52, 19, 61, 32, 52, 51, 61, 60, + 52, 83, 61, 13, 9, 24, 0, 41, 9, 56, 0, 69, 9, 88, 0, + 14, 17, 21, 26, 43, 18, 49, 26, 71, 18, 77, 26, 1, 43, 23, + 35, 30, 44, 51, 35, 62, 44, 79, 35, 3, 52, 20, 61, 31, 52, + 52, 61, 60, 53, 84, 61, 12, 9, 25, 0, 40, 9, 57, 0, 68, + 9, 89, 0, 14, 18, 20, 26, 42, 18, 48, 26, 70, 18, 76, 26, + 0, 43, 22, 35, 31, 44, 50, 35, 63, 44, 78, 35, 2, 52, 21, + 61, 30, 52, 53, 61, 61, 53, 85, 61, 11, 9, 26, 0, 39, 9, + 58, 0, 67, 9, 89, 1, 13, 18, 19, 26, 41, 18, 47, 26, 69, + 18, 75, 26, 0, 44, 21, 35, 32, 44, 49, 35, 64, 44, 77, 35, + 1, 52, 22, 61, 30, 53, 54, 61, 62, 53, 86, 61, 10, 9, 27, + 0, 38, 9, 59, 0, 66, 9, 88, 1, 12, 18, 18, 26, 40, 18, + 46, 26, 68, 18, 75, 27, 1, 44, 20, 35, 33, 44, 48, 35, 65, + 44, 76, 35, 0, 52, 23, 61, 31, 53, 55, 61, 63, 53, 87, 61, + 9, 9, 28, 0, 37, 9, 59, 1, 65, 9, 87, 1, 11, 18, 17, + 26, 39, 18, 45, 26, 67, 18, 76, 27, 2, 44, 19, 35, 34, 44, + 47, 35, 66, 44, 75, 35, 0, 53, 24, 61, 32, 53, 56, 61, 64, + 53, 88, 61, 8, 9, 29, 0, 36, 9, 58, 1, 64, 9, 86, 1, + 10, 18, 16, 26, 38, 18, 45, 27, 66, 18, 77, 27, 3, 44, 18, + 35, 35, 44, 46, 35, 67, 44, 75, 36, 1, 53, 25, 61, 33, 53, + 57, 61, 65, 53, 89, 61, 7, 9, 29, 1, 35, 9, 57, 1, 63, + 9, 85, 1, 9, 18, 15, 26, 37, 18, 46, 27, 65, 18, 78, 27, + 4, 44, 17, 35, 36, 44, 45, 35, 68, 44, 76, 36, 2, 53, 26, + 61, 34, 53, 58, 61, 66, 53, 89, 62, 6, 9, 28, 1, 34, 9, + 56, 1, 62, 9, 84, 1, 8, 18, 15, 27, 36, 18, 47, 27, 64, + 18, 79, 27, 5, 44, 16, 35, 37, 44, 45, 36, 69, 44, 77, 36, + 3, 53, 27, 61, 35, 53, 59, 61, 67, 53, 88, 62, 5, 9, 27, + 1, 33, 9, 55, 1, 61, 9, 83, 1, 7, 18, 16, 27, 35, 18, + 48, 27, 63, 18, 80, 27, 6, 44, 15, 35, 38, 44, 46, 36, 70, + 44, 78, 36, 4, 53, 28, 61, 36, 53, 59, 62, 68, 53, 87, 62, + 4, 9, 26, 1, 32, 9, 54, 1, 60, 9, 82, 1, 6, 18, 17, + 27, 34, 18, 49, 27, 62, 18, 81, 27, 7, 44, 15, 36, 39, 44, + 47, 36, 71, 44, 79, 36, 5, 53, 29, 61, 37, 53, 58, 62, 69, + 53, 86, 62, 3, 9, 25, 1, 31, 9, 53, 1, 60, 10, 81, 1, + 5, 18, 18, 27, 33, 18, 50, 27, 61, 18, 82, 27, 8, 44, 16, + 36, 40, 44, 48, 36, 72, 44, 80, 36, 6, 53, 29, 62, 38, 53, + 57, 62, 70, 53, 85, 62, 2, 9, 24, 1, 30, 9, 52, 1, 61, + 10, 80, 1, 4, 18, 19, 27, 32, 18, 51, 27, 60, 18, 83, 27, + 9, 44, 17, 36, 41, 44, 49, 36, 73, 44, 81, 36, 7, 53, 28, + 62, 39, 53, 56, 62, 71, 53, 84, 62, 1, 9, 23, 1, 30, 10, + 51, 1, 62, 10, 79, 1, 3, 18, 20, 27, 31, 18, 52, 27, 60, + 19, 84, 27, 10, 44, 18, 36, 42, 44, 50, 36, 74, 44, 82, 36, + 8, 53, 27, 62, 40, 53, 55, 62, 72, 53, 83, 62, 0, 9, 22, + 1, 31, 10, 50, 1, 63, 10, 78, 1, 2, 18, 21, 27, 30, 18, + 53, 27, 61, 19, 85, 27, 11, 44, 19, 36, 43, 44, 51, 36, 74, + 45, 83, 36, 9, 53, 26, 62, 41, 53, 54, 62, 73, 53, 82, 62, + 0, 10, 21, 1, 32, 10, 49, 1, 64, 10, 77, 1, 1, 18, 22, + 27, 30, 19, 54, 27, 62, 19, 86, 27, 12, 44, 20, 36, 44, 44, + 52, 36, 73, 45, 84, 36, 10, 53, 25, 62, 42, 53, 53, 62, 74, + 53, 81, 62, 1, 10, 20, 1, 33, 10, 48, 1, 65, 10, 76, 1, + 0, 18, 23, 27, 31, 19, 55, 27, 63, 19, 87, 27, 13, 44, 21, + 36, 44, 45, 53, 36, 72, 45, 85, 36, 11, 53, 24, 62, 43, 53, + 52, 62, 74, 54, 80, 62, 2, 10, 19, 1, 34, 10, 47, 1, 66, + 10, 75, 1, 0, 19, 24, 27, 32, 19, 56, 27, 64, 19, 88, 27, + 14, 44, 22, 36, 43, 45, 54, 36, 71, 45, 86, 36, 12, 53, 23, + 62, 44, 53, 51, 62, 73, 54, 79, 62, 3, 10, 18, 1, 35, 10, + 46, 1, 67, 10, 75, 2, 1, 19, 25, 27, 33, 19, 57, 27, 65, + 19, 89, 27, 14, 45, 23, 36, 42, 45, 55, 36, 70, 45, 87, 36, + 13, 53, 22, 62, 44, 54, 50, 62, 72, 54, 78, 62, 4, 10, 17, + 1, 36, 10, 45, 1, 68, 10, 76, 2, 2, 19, 26, 27, 34, 19, + 58, 27, 66, 19, 89, 28, 13, 45, 24, 36, 41, 45, 56, 36, 69, + 45, 88, 36, 14, 53, 21, 62, 43, 54, 49, 62, 71, 54, 77, 62, + 5, 10, 16, 1, 37, 10, 45, 2, 69, 10, 77, 2, 3, 19, 27, + 27, 35, 19, 59, 27, 67, 19, 88, 28, 12, 45, 25, 36, 40, 45, + 57, 36, 68, 45, 89, 36, 14, 54, 20, 62, 42, 54, 48, 62, 70, + 54, 76, 62, 6, 10, 15, 1, 38, 10, 46, 2, 70, 10, 78, 2, + 4, 19, 28, 27, 36, 19, 59, 28, 68, 19, 87, 28, 11, 45, 26, + 36, 39, 45, 58, 36, 67, 45, 89, 37, 13, 54, 19, 62, 41, 54, + 47, 62, 69, 54, 75, 62, 7, 10, 15, 2, 39, 10, 47, 2, 71, + 10, 79, 2, 5, 19, 29, 27, 37, 19, 58, 28, 69, 19, 86, 28, + 10, 45, 27, 36, 38, 45, 59, 36, 66, 45, 88, 37, 12, 54, 18, + 62, 40, 54, 46, 62, 68, 54, 75, 63, 8, 10, 16, 2, 40, 10, + 48, 2, 72, 10, 80, 2, 6, 19, 29, 28, 38, 19, 57, 28, 70, + 19, 85, 28, 9, 45, 28, 36, 37, 45, 59, 37, 65, 45, 87, 37, + 11, 54, 17, 62, 39, 54, 45, 62, 67, 54, 76, 63, 9, 10, 17, + 2, 41, 10, 49, 2, 73, 10, 81, 2, 7, 19, 28, 28, 39, 19, + 56, 28, 71, 19, 84, 28, 8, 45, 29, 36, 36, 45, 58, 37, 64, + 45, 86, 37, 10, 54, 16, 62, 38, 54, 45, 63, 66, 54, 77, 63, + 10, 10, 18, 2, 42, 10, 50, 2, 74, 10, 82, 2, 8, 19, 27, + 28, 40, 19, 55, 28, 72, 19, 83, 28, 7, 45, 29, 37, 35, 45, + 57, 37, 63, 45, 85, 37, 9, 54, 15, 62, 37, 54, 46, 63, 65, + 54, 78, 63, 11, 10, 19, 2, 43, 10, 51, 2, 74, 11, 83, 2, + 9, 19, 26, 28, 41, 19, 54, 28, 73, 19, 82, 28, 6, 45, 28, + 37, 34, 45, 56, 37, 62, 45, 84, 37, 8, 54, 15, 63, 36, 54, + 47, 63, 64, 54, 79, 63, 12, 10, 20, 2, 44, 10, 52, 2, 73, + 11, 84, 2, 10, 19, 25, 28, 42, 19, 53, 28, 74, 19, 81, 28, + 5, 45, 27, 37, 33, 45, 55, 37, 61, 45, 83, 37, 7, 54, 16, + 63, 35, 54, 48, 63, 63, 54, 80, 63, 13, 10, 21, 2, 44, 11, + 53, 2, 72, 11, 85, 2, 11, 19, 24, 28, 43, 19, 52, 28, 74, + 20, 80, 28, 4, 45, 26, 37, 32, 45, 54, 37, 60, 45, 82, 37, + 6, 54, 17, 63, 34, 54, 49, 63, 62, 54, 81, 63, 14, 10, 22, + 2, 43, 11, 54, 2, 71, 11, 86, 2, 12, 19, 23, 28, 44, 19, + 51, 28, 73, 20, 79, 28, 3, 45, 25, 37, 31, 45, 53, 37, 60, + 46, 81, 37, 5, 54, 18, 63, 33, 54, 50, 63, 61, 54, 82, 63, + 14, 11, 23, 2, 42, 11, 55, 2, 70, 11, 87, 2, 13, 19, 22, + 28, 44, 20, 50, 28, 72, 20, 78, 28, 2, 45, 24, 37, 30, 45, + 52, 37, 61, 46, 80, 37, 4, 54, 19, 63, 32, 54, 51, 63, 60, + 54, 83, 63, 13, 11, 24, 2, 41, 11, 56, 2, 69, 11, 88, 2, + 14, 19, 21, 28, 43, 20, 49, 28, 71, 20, 77, 28, 1, 45, 23, + 37, 30, 46, 51, 37, 62, 46, 79, 37, 3, 54, 20, 63, 31, 54, + 52, 63, 60, 55, 84, 63, 12, 11, 25, 2, 40, 11, 57, 2, 68, + 11, 89, 2, 14, 20, 20, 28, 42, 20, 48, 28, 70, 20, 76, 28, + 0, 45, 22, 37, 31, 46, 50, 37, 63, 46, 78, 37, 2, 54, 21, + 63, 30, 54, 53, 63, 61, 55, 85, 63, 11, 11, 26, 2, 39, 11, + 58, 2, 67, 11, 89, 3, 13, 20, 19, 28, 41, 20, 47, 28, 69, + 20, 75, 28, 0, 46, 21, 37, 32, 46, 49, 37, 64, 46, 77, 37, + 1, 54, 22, 63, 30, 55, 54, 63, 62, 55, 86, 63, 10, 11, 27, + 2, 38, 11, 59, 2, 66, 11, 88, 3, 12, 20, 18, 28, 40, 20, + 46, 28, 68, 20, 75, 29, 1, 46, 20, 37, 33, 46, 48, 37, 65, + 46, 76, 37, 0, 54, 23, 63, 31, 55, 55, 63, 63, 55, 87, 63, + 9, 11, 28, 2, 37, 11, 59, 3, 65, 11, 87, 3, 11, 20, 17, + 28, 39, 20, 45, 28, 67, 20, 76, 29, 2, 46, 19, 37, 34, 46, + 47, 37, 66, 46, 75, 37, 0, 55, 24, 63, 32, 55, 56, 63, 64, + 55, 88, 63, 8, 11, 29, 2, 36, 11, 58, 3, 64, 11, 86, 3, + 10, 20, 16, 28, 38, 20, 45, 29, 66, 20, 77, 29, 3, 46, 18, + 37, 35, 46, 46, 37, 67, 46, 75, 38, 1, 55, 25, 63, 33, 55, + 57, 63, 65, 55, 89, 63, 7, 11, 29, 3, 35, 11, 57, 3, 63, + 11, 85, 3, 9, 20, 15, 28, 37, 20, 46, 29, 65, 20, 78, 29, + 4, 46, 17, 37, 36, 46, 45, 37, 68, 46, 76, 38, 2, 55, 26, + 63, 34, 55, 58, 63, 66, 55, 89, 64, 6, 11, 28, 3, 34, 11, + 56, 3, 62, 11, 84, 3, 8, 20, 15, 29, 36, 20, 47, 29, 64, + 20, 79, 29, 5, 46, 16, 37, 37, 46, 45, 38, 69, 46, 77, 38, + 3, 55, 27, 63, 35, 55, 59, 63, 67, 55, 88, 64, 5, 11, 27, + 3, 33, 11, 55, 3, 61, 11, 83, 3, 7, 20, 16, 29, 35, 20, + 48, 29, 63, 20, 80, 29, 6, 46, 15, 37, 38, 46, 46, 38, 70, + 46, 78, 38, 4, 55, 28, 63, 36, 55, 59, 64, 68, 55, 87, 64, + 4, 11, 26, 3, 32, 11, 54, 3, 60, 11, 82, 3, 6, 20, 17, + 29, 34, 20, 49, 29, 62, 20, 81, 29, 7, 46, 15, 38, 39, 46, + 47, 38, 71, 46, 79, 38, 5, 55, 29, 63, 37, 55, 58, 64, 69, + 55, 86, 64, 3, 11, 25, 3, 31, 11, 53, 3, 60, 12, 81, 3, + 5, 20, 18, 29, 33, 20, 50, 29, 61, 20, 82, 29, 8, 46, 16, + 38, 40, 46, 48, 38, 72, 46, 80, 38, 6, 55, 29, 64, 38, 55, + 57, 64, 70, 55, 85, 64, 2, 11, 24, 3, 30, 11, 52, 3, 61, + 12, 80, 3, 4, 20, 19, 29, 32, 20, 51, 29, 60, 20, 83, 29, + 9, 46, 17, 38, 41, 46, 49, 38, 73, 46, 81, 38, 7, 55, 28, + 64, 39, 55, 56, 64, 71, 55, 84, 64, 1, 11, 23, 3, 30, 12, + 51, 3, 62, 12, 79, 3, 3, 20, 20, 29, 31, 20, 52, 29, 60, + 21, 84, 29, 10, 46, 18, 38, 42, 46, 50, 38, 74, 46, 82, 38, + 8, 55, 27, 64, 40, 55, 55, 64, 72, 55, 83, 64, 0, 11, 22, + 3, 31, 12, 50, 3, 63, 12, 78, 3, 2, 20, 21, 29, 30, 20, + 53, 29, 61, 21, 85, 29, 11, 46, 19, 38, 43, 46, 51, 38, 74, + 47, 83, 38, 9, 55, 26, 64, 41, 55, 54, 64, 73, 55, 82, 64, + 0, 12, 21, 3, 32, 12, 49, 3, 64, 12, 77, 3, 1, 20, 22, + 29, 30, 21, 54, 29, 62, 21, 86, 29, 12, 46, 20, 38, 44, 46, + 52, 38, 73, 47, 84, 38, 10, 55, 25, 64, 42, 55, 53, 64, 74, + 55, 81, 64, 1, 12, 20, 3, 33, 12, 48, 3, 65, 12, 76, 3, + 0, 20, 23, 29, 31, 21, 55, 29, 63, 21, 87, 29, 13, 46, 21, + 38, 44, 47, 53, 38, 72, 47, 85, 38, 11, 55, 24, 64, 43, 55, + 52, 64, 74, 56, 80, 64, 2, 12, 19, 3, 34, 12, 47, 3, 66, + 12, 75, 3, 0, 21, 24, 29, 32, 21, 56, 29, 64, 21, 88, 29, + 14, 46, 22, 38, 43, 47, 54, 38, 71, 47, 86, 38, 12, 55, 23, + 64, 44, 55, 51, 64, 73, 56, 79, 64, 3, 12, 18, 3, 35, 12, + 46, 3, 67, 12, 75, 4, 1, 21, 25, 29, 33, 21, 57, 29, 65, + 21, 89, 29, 14, 47, 23, 38, 42, 47, 55, 38, 70, 47, 87, 38, + 13, 55, 22, 64, 44, 56, 50, 64, 72, 56, 78, 64, 4, 12, 17, + 3, 36, 12, 45, 3, 68, 12, 76, 4, 2, 21, 26, 29, 34, 21, + 58, 29, 66, 21, 89, 30, 13, 47, 24, 38, 41, 47, 56, 38, 69, + 47, 88, 38, 14, 55, 21, 64, 43, 56, 49, 64, 71, 56, 77, 64, + 5, 12, 16, 3, 37, 12, 45, 4, 69, 12, 77, 4, 3, 21, 27, + 29, 35, 21, 59, 29, 67, 21, 88, 30, 12, 47, 25, 38, 40, 47, + 57, 38, 68, 47, 89, 38, 14, 56, 20, 64, 42, 56, 48, 64, 70, + 56, 76, 64, 6, 12, 15, 3, 38, 12, 46, 4, 70, 12, 78, 4, + 4, 21, 28, 29, 36, 21, 59, 30, 68, 21, 87, 30, 11, 47, 26, + 38, 39, 47, 58, 38, 67, 47, 89, 39, 13, 56, 19, 64, 41, 56, + 47, 64, 69, 56, 75, 64, 7, 12, 15, 4, 39, 12, 47, 4, 71, + 12, 79, 4, 5, 21, 29, 29, 37, 21, 58, 30, 69, 21, 86, 30, + 10, 47, 27, 38, 38, 47, 59, 38, 66, 47, 88, 39, 12, 56, 18, + 64, 40, 56, 46, 64, 68, 56, 75, 65, 8, 12, 16, 4, 40, 12, + 48, 4, 72, 12, 80, 4, 6, 21, 29, 30, 38, 21, 57, 30, 70, + 21, 85, 30, 9, 47, 28, 38, 37, 47, 59, 39, 65, 47, 87, 39, + 11, 56, 17, 64, 39, 56, 45, 64, 67, 56, 76, 65, 9, 12, 17, + 4, 41, 12, 49, 4, 73, 12, 81, 4, 7, 21, 28, 30, 39, 21, + 56, 30, 71, 21, 84, 30, 8, 47, 29, 38, 36, 47, 58, 39, 64, + 47, 86, 39, 10, 56, 16, 64, 38, 56, 45, 65, 66, 56, 77, 65, + 10, 12, 18, 4, 42, 12, 50, 4, 74, 12, 82, 4, 8, 21, 27, + 30, 40, 21, 55, 30, 72, 21, 83, 30, 7, 47, 29, 39, 35, 47, + 57, 39, 63, 47, 85, 39, 9, 56, 15, 64, 37, 56, 46, 65, 65, + 56, 78, 65, 11, 12, 19, 4, 43, 12, 51, 4, 74, 13, 83, 4, + 9, 21, 26, 30, 41, 21, 54, 30, 73, 21, 82, 30, 6, 47, 28, + 39, 34, 47, 56, 39, 62, 47, 84, 39, 8, 56, 15, 65, 36, 56, + 47, 65, 64, 56, 79, 65, 12, 12, 20, 4, 44, 12, 52, 4, 73, + 13, 84, 4, 10, 21, 25, 30, 42, 21, 53, 30, 74, 21, 81, 30, + 5, 47, 27, 39, 33, 47, 55, 39, 61, 47, 83, 39, 7, 56, 16, + 65, 35, 56, 48, 65, 63, 56, 80, 65, 13, 12, 21, 4, 44, 13, + 53, 4, 72, 13, 85, 4, 11, 21, 24, 30, 43, 21, 52, 30, 74, + 22, 80, 30, 4, 47, 26, 39, 32, 47, 54, 39, 60, 47, 82, 39, + 6, 56, 17, 65, 34, 56, 49, 65, 62, 56, 81, 65, 14, 12, 22, + 4, 43, 13, 54, 4, 71, 13, 86, 4, 12, 21, 23, 30, 44, 21, + 51, 30, 73, 22, 79, 30, 3, 47, 25, 39, 31, 47, 53, 39, 60, + 48, 81, 39, 5, 56, 18, 65, 33, 56, 50, 65, 61, 56, 82, 65, + 14, 13, 23, 4, 42, 13, 55, 4, 70, 13, 87, 4, 13, 21, 22, + 30, 44, 22, 50, 30, 72, 22, 78, 30, 2, 47, 24, 39, 30, 47, + 52, 39, 61, 48, 80, 39, 4, 56, 19, 65, 32, 56, 51, 65, 60, + 56, 83, 65, 13, 13, 24, 4, 41, 13, 56, 4, 69, 13, 88, 4, + 14, 21, 21, 30, 43, 22, 49, 30, 71, 22, 77, 30, 1, 47, 23, + 39, 30, 48, 51, 39, 62, 48, 79, 39, 3, 56, 20, 65, 31, 56, + 52, 65, 60, 57, 84, 65, 12, 13, 25, 4, 40, 13, 57, 4, 68, + 13, 89, 4, 14, 22, 20, 30, 42, 22, 48, 30, 70, 22, 76, 30, + 0, 47, 22, 39, 31, 48, 50, 39, 63, 48, 78, 39, 2, 56, 21, + 65, 30, 56, 53, 65, 61, 57, 85, 65, 11, 13, 26, 4, 39, 13, + 58, 4, 67, 13, 89, 5, 13, 22, 19, 30, 41, 22, 47, 30, 69, + 22, 75, 30, 0, 48, 21, 39, 32, 48, 49, 39, 64, 48, 77, 39, + 1, 56, 22, 65, 30, 57, 54, 65, 62, 57, 86, 65, 10, 13, 27, + 4, 38, 13, 59, 4, 66, 13, 88, 5, 12, 22, 18, 30, 40, 22, + 46, 30, 68, 22, 75, 31, 1, 48, 20, 39, 33, 48, 48, 39, 65, + 48, 76, 39, 0, 56, 23, 65, 31, 57, 55, 65, 63, 57, 87, 65, + 9, 13, 28, 4, 37, 13, 59, 5, 65, 13, 87, 5, 11, 22, 17, + 30, 39, 22, 45, 30, 67, 22, 76, 31, 2, 48, 19, 39, 34, 48, + 47, 39, 66, 48, 75, 39, 0, 57, 24, 65, 32, 57, 56, 65, 64, + 57, 88, 65, 8, 13, 29, 4, 36, 13, 58, 5, 64, 13, 86, 5, + 10, 22, 16, 30, 38, 22, 45, 31, 66, 22, 77, 31, 3, 48, 18, + 39, 35, 48, 46, 39, 67, 48, 75, 40, 1, 57, 25, 65, 33, 57, + 57, 65, 65, 57, 89, 65, 7, 13, 29, 5, 35, 13, 57, 5, 63, + 13, 85, 5, 9, 22, 15, 30, 37, 22, 46, 31, 65, 22, 78, 31, + 4, 48, 17, 39, 36, 48, 45, 39, 68, 48, 76, 40, 2, 57, 26, + 65, 34, 57, 58, 65, 66, 57, 89, 66, 6, 13, 28, 5, 34, 13, + 56, 5, 62, 13, 84, 5, 8, 22, 15, 31, 36, 22, 47, 31, 64, + 22, 79, 31, 5, 48, 16, 39, 37, 48, 45, 40, 69, 48, 77, 40, + 3, 57, 27, 65, 35, 57, 59, 65, 67, 57, 88, 66, 5, 13, 27, + 5, 33, 13, 55, 5, 61, 13, 83, 5, 7, 22, 16, 31, 35, 22, + 48, 31, 63, 22, 80, 31, 6, 48, 15, 39, 38, 48, 46, 40, 70, + 48, 78, 40, 4, 57, 28, 65, 36, 57, 59, 66, 68, 57, 87, 66, + 4, 13, 26, 5, 32, 13, 54, 5, 60, 13, 82, 5, 6, 22, 17, + 31, 34, 22, 49, 31, 62, 22, 81, 31, 7, 48, 15, 40, 39, 48, + 47, 40, 71, 48, 79, 40, 5, 57, 29, 65, 37, 57, 58, 66, 69, + 57, 86, 66, 3, 13, 25, 5, 31, 13, 53, 5, 60, 14, 81, 5, + 5, 22, 18, 31, 33, 22, 50, 31, 61, 22, 82, 31, 8, 48, 16, + 40, 40, 48, 48, 40, 72, 48, 80, 40, 6, 57, 29, 66, 38, 57, + 57, 66, 70, 57, 85, 66, 2, 13, 24, 5, 30, 13, 52, 5, 61, + 14, 80, 5, 4, 22, 19, 31, 32, 22, 51, 31, 60, 22, 83, 31, + 9, 48, 17, 40, 41, 48, 49, 40, 73, 48, 81, 40, 7, 57, 28, + 66, 39, 57, 56, 66, 71, 57, 84, 66, 1, 13, 23, 5, 30, 14, + 51, 5, 62, 14, 79, 5, 3, 22, 20, 31, 31, 22, 52, 31, 60, + 23, 84, 31, 10, 48, 18, 40, 42, 48, 50, 40, 74, 48, 82, 40, + 8, 57, 27, 66, 40, 57, 55, 66, 72, 57, 83, 66, 0, 13, 22, + 5, 31, 14, 50, 5, 63, 14, 78, 5, 2, 22, 21, 31, 30, 22, + 53, 31, 61, 23, 85, 31, 11, 48, 19, 40, 43, 48, 51, 40, 74, + 49, 83, 40, 9, 57, 26, 66, 41, 57, 54, 66, 73, 57, 82, 66, + 0, 14, 21, 5, 32, 14, 49, 5, 64, 14, 77, 5, 1, 22, 22, + 31, 30, 23, 54, 31, 62, 23, 86, 31, 12, 48, 20, 40, 44, 48, + 52, 40, 73, 49, 84, 40, 10, 57, 25, 66, 42, 57, 53, 66, 74, + 57, 81, 66, 1, 14, 20, 5, 33, 14, 48, 5, 65, 14, 76, 5, + 0, 22, 23, 31, 31, 23, 55, 31, 63, 23, 87, 31, 13, 48, 21, + 40, 44, 49, 53, 40, 72, 49, 85, 40, 11, 57, 24, 66, 43, 57, + 52, 66, 74, 58, 80, 66, 2, 14, 19, 5, 34, 14, 47, 5, 66, + 14, 75, 5, 0, 23, 24, 31, 32, 23, 56, 31, 64, 23, 88, 31, + 14, 48, 22, 40, 43, 49, 54, 40, 71, 49, 86, 40, 12, 57, 23, + 66, 44, 57, 51, 66, 73, 58, 79, 66, 3, 14, 18, 5, 35, 14, + 46, 5, 67, 14, 75, 6, 1, 23, 25, 31, 33, 23, 57, 31, 65, + 23, 89, 31, 14, 49, 23, 40, 42, 49, 55, 40, 70, 49, 87, 40, + 13, 57, 22, 66, 44, 58, 50, 66, 72, 58, 78, 66, 4, 14, 17, + 5, 36, 14, 45, 5, 68, 14, 76, 6, 2, 23, 26, 31, 34, 23, + 58, 31, 66, 23, 89, 32, 13, 49, 24, 40, 41, 49, 56, 40, 69, + 49, 88, 40, 14, 57, 21, 66, 43, 58, 49, 66, 71, 58, 77, 66, + 5, 14, 16, 5, 37, 14, 45, 6, 69, 14, 77, 6, 3, 23, 27, + 31, 35, 23, 59, 31, 67, 23, 88, 32, 12, 49, 25, 40, 40, 49, + 57, 40, 68, 49, 89, 40, 14, 58, 20, 66, 42, 58, 48, 66, 70, + 58, 76, 66, 6, 14, 15, 5, 38, 14, 46, 6, 70, 14, 78, 6, + 4, 23, 28, 31, 36, 23, 59, 32, 68, 23, 87, 32, 11, 49, 26, + 40, 39, 49, 58, 40, 67, 49, 89, 41, 13, 58, 19, 66, 41, 58, + 47, 66, 69, 58, 75, 66, 7, 14, 15, 6, 39, 14, 47, 6, 71, + 14, 79, 6, 5, 23, 29, 31, 37, 23, 58, 32, 69, 23, 86, 32, + 10, 49, 27, 40, 38, 49, 59, 40, 66, 49, 88, 41, 12, 58, 18, + 66, 40, 58, 46, 66, 68, 58, 75, 67, 8, 14, 16, 6, 40, 14, + 48, 6, 72, 14, 80, 6, 6, 23, 29, 32, 38, 23, 57, 32, 70, + 23, 85, 32, 9, 49, 28, 40, 37, 49, 59, 41, 65, 49, 87, 41, + 11, 58, 17, 66, 39, 58, 45, 66, 67, 58, 76, 67, 9, 14, 17, + 6, 41, 14, 49, 6, 73, 14, 81, 6, 7, 23, 28, 32, 39, 23, + 56, 32, 71, 23, 84, 32, 8, 49, 29, 40, 36, 49, 58, 41, 64, + 49, 86, 41, 10, 58, 16, 66, 38, 58, 45, 67, 66, 58, 77, 67, + 10, 14, 18, 6, 42, 14, 50, 6, 74, 14, 82, 6, 8, 23, 27, + 32, 40, 23, 55, 32, 72, 23, 83, 32, 7, 49, 29, 41, 35, 49, + 57, 41, 63, 49, 85, 41, 9, 58, 15, 66, 37, 58, 46, 67, 65, + 58, 78, 67, 11, 14, 19, 6, 43, 14, 51, 6, 74, 15, 83, 6, + 9, 23, 26, 32, 41, 23, 54, 32, 73, 23, 82, 32, 6, 49, 28, + 41, 34, 49, 56, 41, 62, 49, 84, 41, 8, 58, 15, 67, 36, 58, + 47, 67, 64, 58, 79, 67, 12, 14, 20, 6, 44, 14, 52, 6, 73, + 15, 84, 6, 10, 23, 25, 32, 42, 23, 53, 32, 74, 23, 81, 32, + 5, 49, 27, 41, 33, 49, 55, 41, 61, 49, 83, 41, 7, 58, 16, + 67, 35, 58, 48, 67, 63, 58, 80, 67, 13, 14, 21, 6, 44, 15, + 53, 6, 72, 15, 85, 6, 11, 23, 24, 32, 43, 23, 52, 32, 74, + 24, 80, 32, 4, 49, 26, 41, 32, 49, 54, 41, 60, 49, 82, 41, + 6, 58, 17, 67, 34, 58, 49, 67, 62, 58, 81, 67, 14, 14, 22, + 6, 43, 15, 54, 6, 71, 15, 86, 6, 12, 23, 23, 32, 44, 23, + 51, 32, 73, 24, 79, 32, 3, 49, 25, 41, 31, 49, 53, 41, 60, + 50, 81, 41, 5, 58, 18, 67, 33, 58, 50, 67, 61, 58, 82, 67, + 14, 15, 23, 6, 42, 15, 55, 6, 70, 15, 87, 6, 13, 23, 22, + 32, 44, 24, 50, 32, 72, 24, 78, 32, 2, 49, 24, 41, 30, 49, + 52, 41, 61, 50, 80, 41, 4, 58, 19, 67, 32, 58, 51, 67, 60, + 58, 83, 67, 13, 15, 24, 6, 41, 15, 56, 6, 69, 15, 88, 6, + 14, 23, 21, 32, 43, 24, 49, 32, 71, 24, 77, 32, 1, 49, 23, + 41, 30, 50, 51, 41, 62, 50, 79, 41, 3, 58, 20, 67, 31, 58, + 52, 67, 60, 59, 84, 67, 12, 15, 25, 6, 40, 15, 57, 6, 68, + 15, 89, 6, 14, 24, 20, 32, 42, 24, 48, 32, 70, 24, 76, 32, + 0, 49, 22, 41, 31, 50, 50, 41, 63, 50, 78, 41, 2, 58, 21, + 67, 30, 58, 53, 67, 61, 59, 85, 67, 11, 15, 26, 6, 39, 15, + 58, 6, 67, 15, 89, 7, 13, 24, 19, 32, 41, 24, 47, 32, 69, + 24, 75, 32, 0, 50, 21, 41, 32, 50, 49, 41, 64, 50, 77, 41, + 1, 58, 22, 67, 30, 59, 54, 67, 62, 59, 86, 67, 10, 15, 27, + 6, 38, 15, 59, 6, 66, 15, 88, 7, 12, 24, 18, 32, 40, 24, + 46, 32, 68, 24, 75, 33, 1, 50, 20, 41, 33, 50, 48, 41, 65, + 50, 76, 41, 0, 58, 23, 67, 31, 59, 55, 67, 63, 59, 87, 67, + 9, 15, 28, 6, 37, 15, 59, 7, 65, 15, 87, 7, 11, 24, 17, + 32, 39, 24, 45, 32, 67, 24, 76, 33, 2, 50, 19, 41, 34, 50, + 47, 41, 66, 50, 75, 41, 0, 59, 24, 67, 32, 59, 56, 67, 64, + 59, 88, 67, 8, 15, 29, 6, 36, 15, 58, 7, 64, 15, 86, 7, + 10, 24, 16, 32, 38, 24, 45, 33, 66, 24, 77, 33, 3, 50, 18, + 41, 35, 50, 46, 41, 67, 50, 75, 42, 1, 59, 25, 67, 33, 59, + 57, 67, 65, 59, 89, 67, 7, 15, 29, 7, 35, 15, 57, 7, 63, + 15, 85, 7, 9, 24, 15, 32, 37, 24, 46, 33, 65, 24, 78, 33, + 4, 50, 17, 41, 36, 50, 45, 41, 68, 50, 76, 42, 2, 59, 26, + 67, 34, 59, 58, 67, 66, 59, 75, 51, 6, 15, 28, 7, 34, 15, + 56, 7, 62, 15, 84, 7, 8, 24, 15, 33, 36, 24, 47, 33, 64, + 24, 79, 33, 5, 50, 16, 41, 37, 50, 45, 42, 69, 50, 77, 42, + 3, 59, 27, 67, 35, 59, 59, 67, 67, 59, 76, 51, 5, 15, 27, + 7, 33, 15, 55, 7, 61, 15, 83, 7, 7, 24, 16, 33, 35, 24, + 48, 33, 63, 24, 80, 33, 6, 50, 15, 41, 38, 50, 46, 42, 70, + 50, 78, 42, 4, 59, 28, 67, 36, 59, 45, 51, 68, 59, 77, 51, + 4, 15, 26, 7, 32, 15, 54, 7, 60, 15, 82, 7, 6, 24, 17, + 33, 34, 24, 49, 33, 62, 24, 81, 33, 7, 50, 15, 42, 39, 50, + 47, 42, 71, 50, 79, 42, 5, 59, 29, 67, 37, 59, 46, 51, 69, + 59, 78, 51, 3, 15, 25, 7, 31, 15, 53, 7, 60, 16, 81, 7, + 5, 24, 18, 33, 33, 24, 50, 33, 61, 24, 82, 33, 8, 50, 16, + 42, 40, 50, 48, 42, 72, 50, 80, 42, 6, 59, 15, 51, 38, 59, + 47, 51, 70, 59, 79, 51, 2, 15, 24, 7, 30, 15, 52, 7, 61, + 16, 80, 7, 4, 24, 19, 33, 32, 24, 51, 33, 60, 24, 83, 33, + 9, 50, 17, 42, 41, 50, 49, 42, 73, 50, 81, 42, 7, 59, 16, + 51, 39, 59, 48, 51, 71, 59, 80, 51, 1, 15, 23, 7, 30, 16, + 51, 7, 62, 16, 79, 7, 3, 24, 20, 33, 31, 24, 52, 33, 60, + 25, 84, 33, 10, 50, 18, 42, 42, 50, 50, 42, 74, 50, 82, 42, + 8, 59, 17, 51, 40, 59, 49, 51, 72, 59, 81, 51, 0, 15, 22, + 7, 31, 16, 50, 7, 63, 16, 78, 7, 2, 24, 21, 33, 30, 24, + 53, 33, 61, 25, 85, 33, 11, 50, 19, 42, 43, 50, 51, 42, 60, + 34, 83, 42, 9, 59, 18, 51, 41, 59, 50, 51, 73, 59, 82, 51, + 0, 16, 21, 7, 32, 16, 49, 7, 64, 16, 77, 7, 1, 24, 22, + 33, 30, 25, 54, 33, 62, 25, 86, 33, 12, 50, 20, 42, 44, 50, + 52, 42, 61, 34, 84, 42, 10, 59, 19, 51, 42, 59, 51, 51, 74, + 59, 83, 51, 1, 16, 20, 7, 33, 16, 48, 7, 65, 16, 76, 7, + 0, 24, 23, 33, 31, 25, 55, 33, 63, 25, 87, 33, 13, 50, 21, + 42, 30, 34, 53, 42, 62, 34, 85, 42, 11, 59, 20, 51, 43, 59, + 52, 51, 74, 60, 84, 51, 2, 16, 19, 7, 34, 16, 47, 7, 66, + 16, 75, 7, 0, 25, 24, 33, 32, 25, 56, 33, 64, 25, 88, 33, + 14, 50, 22, 42, 31, 34, 54, 42, 63, 34, 86, 42, 12, 59, 21, + 51, 44, 59, 53, 51, 73, 60, 85, 51, 3, 16, 18, 7, 35, 16, + 46, 7, 67, 16, 75, 8, 1, 25, 25, 33, 33, 25, 57, 33, 65, + 25, 89, 33, 0, 34, 23, 42, 32, 34, 55, 42, 64, 34, 87, 42, + 13, 59, 22, 51, 44, 60, 54, 51, 72, 60, 86, 51, 4, 16, 17, + 7, 36, 16, 45, 7, 68, 16, 76, 8, 2, 25, 26, 33, 34, 25, + 58, 33, 66, 25, 75, 17, 1, 34, 24, 42, 33, 34, 56, 42, 65, + 34, 88, 42, 14, 59, 23, 51, 43, 60, 55, 51, 71, 60, 87, 51, + 5, 16, 16, 7, 37, 16, 45, 8, 69, 16, 77, 8, 3, 25, 27, + 33, 35, 25, 59, 33, 67, 25, 76, 17, 2, 34, 25, 42, 34, 34, + 57, 42, 66, 34, 89, 42, 14, 60, 24, 51, 42, 60, 56, 51, 70, + 60, 88, 51, 6, 16, 15, 7, 38, 16, 46, 8, 70, 16, 78, 8, + 4, 25, 28, 33, 36, 25, 45, 17, 68, 25, 77, 17, 3, 34, 26, + 42, 35, 34, 58, 42, 67, 34, 89, 43, 13, 60, 25, 51, 41, 60, + 57, 51, 69, 60, 89, 51, 7, 16, 15, 8, 39, 16, 47, 8, 71, + 16, 79, 8, 5, 25, 29, 33, 37, 25, 46, 17, 69, 25, 78, 17, + 4, 34, 27, 42, 36, 34, 59, 42, 68, 34, 88, 43, 12, 60, 26, + 51, 40, 60, 58, 51, 68, 60, 89, 52, 8, 16, 16, 8, 40, 16, + 48, 8, 72, 16, 80, 8, 6, 25, 15, 17, 38, 25, 47, 17, 70, + 25, 79, 17, 5, 34, 28, 42, 37, 34, 59, 43, 69, 34, 87, 43, + 11, 60, 27, 51, 39, 60, 59, 51, 67, 60, 88, 52, 9, 16, 17, + 8, 41, 16, 49, 8, 73, 16, 81, 8, 7, 25, 16, 17, 39, 25, + 48, 17, 71, 25, 80, 17, 6, 34, 29, 42, 38, 34, 58, 43, 70, + 34, 86, 43, 10, 60, 28, 51, 38, 60, 59, 52, 66, 60, 87, 52, + 10, 16, 18, 8, 42, 16, 50, 8, 74, 16, 82, 8, 8, 25, 17, + 17, 40, 25, 49, 17, 72, 25, 81, 17, 7, 34, 29, 43, 39, 34, + 57, 43, 71, 34, 85, 43, 9, 60, 29, 51, 37, 60, 58, 52, 65, + 60, 86, 52, 11, 16, 19, 8, 43, 16, 51, 8, 60, 0, 83, 8, + 9, 25, 18, 17, 41, 25, 50, 17, 73, 25, 82, 17, 8, 34, 28, + 43, 40, 34, 56, 43, 72, 34, 84, 43, 8, 60, 29, 52, 36, 60, + 57, 52, 64, 60, 85, 52, 12, 16, 20, 8, 44, 16, 52, 8, 61, + 0, 84, 8, 10, 25, 19, 17, 42, 25, 51, 17, 74, 25, 83, 17, + 9, 34, 27, 43, 41, 34, 55, 43, 73, 34, 83, 43, 7, 60, 28, + 52, 35, 60, 56, 52, 63, 60, 84, 52, 13, 16, 21, 8, 30, 0, + 53, 8, 62, 0, 85, 8, 11, 25, 20, 17, 43, 25, 52, 17, 74, + 26, 84, 17, 10, 34, 26, 43, 42, 34, 54, 43, 74, 34, 82, 43, + 6, 60, 27, 52, 34, 60, 55, 52, 62, 60, 83, 52, 14, 16, 22, + 8, 31, 0, 54, 8, 63, 0, 86, 8, 12, 25, 21, 17, 44, 25, + 53, 17, 73, 26, 85, 17, 11, 34, 25, 43, 43, 34, 53, 43, 74, + 35, 81, 43, 5, 60, 26, 52, 33, 60, 54, 52, 61, 60, 82, 52, +}; + +static const uint8_t hq_tab_08[] = { + 0, 0, 31, 8, 42, 0, 73, 8, 84, 0, 115, 8, 16, 25, 27, + 17, 58, 25, 69, 17, 99, 26, 111, 17, 12, 34, 36, 43, 54, 34, + 74, 43, 96, 34, 112, 43, 11, 60, 39, 51, 49, 60, 78, 52, 87, + 60, 116, 52, 1, 0, 32, 8, 43, 0, 74, 8, 85, 0, 116, 8, + 17, 25, 28, 17, 59, 25, 70, 17, 98, 26, 112, 17, 13, 34, 35, + 43, 55, 34, 73, 43, 97, 34, 111, 43, 10, 60, 39, 52, 48, 60, + 77, 52, 86, 60, 115, 52, 2, 0, 33, 8, 44, 0, 75, 8, 86, + 0, 117, 8, 18, 25, 29, 17, 59, 26, 71, 17, 97, 26, 113, 17, + 14, 34, 34, 43, 56, 34, 72, 43, 98, 34, 110, 43, 9, 60, 38, + 52, 47, 60, 76, 52, 85, 60, 114, 52, 3, 0, 34, 8, 45, 0, + 76, 8, 87, 0, 118, 8, 19, 25, 30, 17, 58, 26, 72, 17, 96, + 26, 114, 17, 15, 34, 33, 43, 57, 34, 71, 43, 99, 34, 109, 43, + 8, 60, 37, 52, 46, 60, 75, 52, 84, 60, 113, 52, 4, 0, 35, + 8, 46, 0, 77, 8, 88, 0, 119, 8, 19, 26, 31, 17, 57, 26, + 73, 17, 95, 26, 115, 17, 16, 34, 32, 43, 58, 34, 70, 43, 99, + 35, 108, 43, 7, 60, 36, 52, 45, 60, 74, 52, 83, 60, 112, 52, + 5, 0, 36, 8, 47, 0, 78, 8, 89, 0, 119, 9, 18, 26, 32, + 17, 56, 26, 74, 17, 94, 26, 116, 17, 17, 34, 31, 43, 59, 34, + 69, 43, 98, 35, 107, 43, 6, 60, 35, 52, 44, 60, 73, 52, 82, + 60, 111, 52, 6, 0, 37, 8, 48, 0, 79, 8, 90, 0, 118, 9, + 17, 26, 33, 17, 55, 26, 75, 17, 93, 26, 117, 17, 18, 34, 30, + 43, 59, 35, 68, 43, 97, 35, 106, 43, 5, 60, 34, 52, 43, 60, + 72, 52, 81, 60, 110, 52, 7, 0, 38, 8, 49, 0, 79, 9, 91, + 0, 117, 9, 16, 26, 34, 17, 54, 26, 76, 17, 92, 26, 118, 17, + 19, 34, 29, 43, 58, 35, 67, 43, 96, 35, 105, 43, 4, 60, 33, + 52, 42, 60, 71, 52, 80, 60, 109, 52, 8, 0, 39, 8, 50, 0, + 78, 9, 92, 0, 116, 9, 15, 26, 35, 17, 53, 26, 77, 17, 91, + 26, 119, 17, 19, 35, 28, 43, 57, 35, 66, 43, 95, 35, 104, 43, + 3, 60, 32, 52, 41, 60, 70, 52, 80, 61, 108, 52, 9, 0, 39, + 9, 51, 0, 77, 9, 93, 0, 115, 9, 14, 26, 36, 17, 52, 26, + 78, 17, 90, 26, 119, 18, 18, 35, 27, 43, 56, 35, 65, 43, 94, + 35, 103, 43, 2, 60, 31, 52, 40, 60, 69, 52, 81, 61, 107, 52, + 10, 0, 38, 9, 52, 0, 76, 9, 94, 0, 114, 9, 13, 26, 37, + 17, 51, 26, 79, 17, 89, 26, 118, 18, 17, 35, 26, 43, 55, 35, + 64, 43, 93, 35, 102, 43, 1, 60, 30, 52, 40, 61, 68, 52, 82, + 61, 106, 52, 11, 0, 37, 9, 53, 0, 75, 9, 95, 0, 113, 9, + 12, 26, 38, 17, 50, 26, 79, 18, 88, 26, 117, 18, 16, 35, 25, + 43, 54, 35, 63, 43, 92, 35, 101, 43, 0, 60, 29, 52, 41, 61, + 67, 52, 83, 61, 105, 52, 12, 0, 36, 9, 54, 0, 74, 9, 96, + 0, 112, 9, 11, 26, 39, 17, 49, 26, 78, 18, 87, 26, 116, 18, + 15, 35, 24, 43, 53, 35, 62, 43, 91, 35, 100, 43, 0, 61, 28, + 52, 42, 61, 66, 52, 84, 61, 104, 52, 13, 0, 35, 9, 55, 0, + 73, 9, 97, 0, 111, 9, 10, 26, 39, 18, 48, 26, 77, 18, 86, + 26, 115, 18, 14, 35, 23, 43, 52, 35, 61, 43, 90, 35, 100, 44, + 1, 61, 27, 52, 43, 61, 65, 52, 85, 61, 103, 52, 14, 0, 34, + 9, 56, 0, 72, 9, 98, 0, 110, 9, 9, 26, 38, 18, 47, 26, + 76, 18, 85, 26, 114, 18, 13, 35, 22, 43, 51, 35, 60, 43, 89, + 35, 101, 44, 2, 61, 26, 52, 44, 61, 64, 52, 86, 61, 102, 52, + 15, 0, 33, 9, 57, 0, 71, 9, 99, 0, 109, 9, 8, 26, 37, + 18, 46, 26, 75, 18, 84, 26, 113, 18, 12, 35, 21, 43, 50, 35, + 60, 44, 88, 35, 102, 44, 3, 61, 25, 52, 45, 61, 63, 52, 87, + 61, 101, 52, 16, 0, 32, 9, 58, 0, 70, 9, 99, 1, 108, 9, + 7, 26, 36, 18, 45, 26, 74, 18, 83, 26, 112, 18, 11, 35, 20, + 43, 49, 35, 61, 44, 87, 35, 103, 44, 4, 61, 24, 52, 46, 61, + 62, 52, 88, 61, 100, 52, 17, 0, 31, 9, 59, 0, 69, 9, 98, + 1, 107, 9, 6, 26, 35, 18, 44, 26, 73, 18, 82, 26, 111, 18, + 10, 35, 20, 44, 48, 35, 62, 44, 86, 35, 104, 44, 5, 61, 23, + 52, 47, 61, 61, 52, 89, 61, 100, 53, 18, 0, 30, 9, 59, 1, + 68, 9, 97, 1, 106, 9, 5, 26, 34, 18, 43, 26, 72, 18, 81, + 26, 110, 18, 9, 35, 21, 44, 47, 35, 63, 44, 85, 35, 105, 44, + 6, 61, 22, 52, 48, 61, 60, 52, 90, 61, 101, 53, 19, 0, 29, + 9, 58, 1, 67, 9, 96, 1, 105, 9, 4, 26, 33, 18, 42, 26, + 71, 18, 80, 26, 109, 18, 8, 35, 22, 44, 46, 35, 64, 44, 84, + 35, 106, 44, 7, 61, 21, 52, 49, 61, 60, 53, 91, 61, 102, 53, + 19, 1, 28, 9, 57, 1, 66, 9, 95, 1, 104, 9, 3, 26, 32, + 18, 41, 26, 70, 18, 80, 27, 108, 18, 7, 35, 23, 44, 45, 35, + 65, 44, 83, 35, 107, 44, 8, 61, 20, 52, 50, 61, 61, 53, 92, + 61, 103, 53, 18, 1, 27, 9, 56, 1, 65, 9, 94, 1, 103, 9, + 2, 26, 31, 18, 40, 26, 69, 18, 81, 27, 107, 18, 6, 35, 24, + 44, 44, 35, 66, 44, 82, 35, 108, 44, 9, 61, 20, 53, 51, 61, + 62, 53, 93, 61, 104, 53, 17, 1, 26, 9, 55, 1, 64, 9, 93, + 1, 102, 9, 1, 26, 30, 18, 40, 27, 68, 18, 82, 27, 106, 18, + 5, 35, 25, 44, 43, 35, 67, 44, 81, 35, 109, 44, 10, 61, 21, + 53, 52, 61, 63, 53, 94, 61, 105, 53, 16, 1, 25, 9, 54, 1, + 63, 9, 92, 1, 101, 9, 0, 26, 29, 18, 41, 27, 67, 18, 83, + 27, 105, 18, 4, 35, 26, 44, 42, 35, 68, 44, 80, 35, 110, 44, + 11, 61, 22, 53, 53, 61, 64, 53, 95, 61, 106, 53, 15, 1, 24, + 9, 53, 1, 62, 9, 91, 1, 100, 9, 0, 27, 28, 18, 42, 27, + 66, 18, 84, 27, 104, 18, 3, 35, 27, 44, 41, 35, 69, 44, 80, + 36, 111, 44, 12, 61, 23, 53, 54, 61, 65, 53, 96, 61, 107, 53, + 14, 1, 23, 9, 52, 1, 61, 9, 90, 1, 100, 10, 1, 27, 27, + 18, 43, 27, 65, 18, 85, 27, 103, 18, 2, 35, 28, 44, 40, 35, + 70, 44, 81, 36, 112, 44, 13, 61, 24, 53, 55, 61, 66, 53, 97, + 61, 108, 53, 13, 1, 22, 9, 51, 1, 60, 9, 89, 1, 101, 10, + 2, 27, 26, 18, 44, 27, 64, 18, 86, 27, 102, 18, 1, 35, 29, + 44, 40, 36, 71, 44, 82, 36, 113, 44, 14, 61, 25, 53, 56, 61, + 67, 53, 98, 61, 109, 53, 12, 1, 21, 9, 50, 1, 60, 10, 88, + 1, 102, 10, 3, 27, 25, 18, 45, 27, 63, 18, 87, 27, 101, 18, + 0, 35, 30, 44, 41, 36, 72, 44, 83, 36, 114, 44, 15, 61, 26, + 53, 57, 61, 68, 53, 99, 61, 110, 53, 11, 1, 20, 9, 49, 1, + 61, 10, 87, 1, 103, 10, 4, 27, 24, 18, 46, 27, 62, 18, 88, + 27, 100, 18, 0, 36, 31, 44, 42, 36, 73, 44, 84, 36, 115, 44, + 16, 61, 27, 53, 58, 61, 69, 53, 99, 62, 111, 53, 10, 1, 20, + 10, 48, 1, 62, 10, 86, 1, 104, 10, 5, 27, 23, 18, 47, 27, + 61, 18, 89, 27, 100, 19, 1, 36, 32, 44, 43, 36, 74, 44, 85, + 36, 116, 44, 17, 61, 28, 53, 59, 61, 70, 53, 98, 62, 112, 53, + 9, 1, 21, 10, 47, 1, 63, 10, 85, 1, 105, 10, 6, 27, 22, + 18, 48, 27, 60, 18, 90, 27, 101, 19, 2, 36, 33, 44, 44, 36, + 75, 44, 86, 36, 117, 44, 18, 61, 29, 53, 59, 62, 71, 53, 97, + 62, 113, 53, 8, 1, 22, 10, 46, 1, 64, 10, 84, 1, 106, 10, + 7, 27, 21, 18, 49, 27, 60, 19, 91, 27, 102, 19, 3, 36, 34, + 44, 45, 36, 76, 44, 87, 36, 118, 44, 19, 61, 30, 53, 58, 62, + 72, 53, 96, 62, 114, 53, 7, 1, 23, 10, 45, 1, 65, 10, 83, + 1, 107, 10, 8, 27, 20, 18, 50, 27, 61, 19, 92, 27, 103, 19, + 4, 36, 35, 44, 46, 36, 77, 44, 88, 36, 119, 44, 19, 62, 31, + 53, 57, 62, 73, 53, 95, 62, 115, 53, 6, 1, 24, 10, 44, 1, + 66, 10, 82, 1, 108, 10, 9, 27, 20, 19, 51, 27, 62, 19, 93, + 27, 104, 19, 5, 36, 36, 44, 47, 36, 78, 44, 89, 36, 119, 45, + 18, 62, 32, 53, 56, 62, 74, 53, 94, 62, 116, 53, 5, 1, 25, + 10, 43, 1, 67, 10, 81, 1, 109, 10, 10, 27, 21, 19, 52, 27, + 63, 19, 94, 27, 105, 19, 6, 36, 37, 44, 48, 36, 79, 44, 90, + 36, 118, 45, 17, 62, 33, 53, 55, 62, 75, 53, 93, 62, 117, 53, + 4, 1, 26, 10, 42, 1, 68, 10, 80, 1, 110, 10, 11, 27, 22, + 19, 53, 27, 64, 19, 95, 27, 106, 19, 7, 36, 38, 44, 49, 36, + 79, 45, 91, 36, 117, 45, 16, 62, 34, 53, 54, 62, 76, 53, 92, + 62, 118, 53, 3, 1, 27, 10, 41, 1, 69, 10, 80, 2, 111, 10, + 12, 27, 23, 19, 54, 27, 65, 19, 96, 27, 107, 19, 8, 36, 39, + 44, 50, 36, 78, 45, 92, 36, 116, 45, 15, 62, 35, 53, 53, 62, + 77, 53, 91, 62, 119, 53, 2, 1, 28, 10, 40, 1, 70, 10, 81, + 2, 112, 10, 13, 27, 24, 19, 55, 27, 66, 19, 97, 27, 108, 19, + 9, 36, 39, 45, 51, 36, 77, 45, 93, 36, 115, 45, 14, 62, 36, + 53, 52, 62, 78, 53, 90, 62, 119, 54, 1, 1, 29, 10, 40, 2, + 71, 10, 82, 2, 113, 10, 14, 27, 25, 19, 56, 27, 67, 19, 98, + 27, 109, 19, 10, 36, 38, 45, 52, 36, 76, 45, 94, 36, 114, 45, + 13, 62, 37, 53, 51, 62, 79, 53, 89, 62, 118, 54, 0, 1, 30, + 10, 41, 2, 72, 10, 83, 2, 114, 10, 15, 27, 26, 19, 57, 27, + 68, 19, 99, 27, 110, 19, 11, 36, 37, 45, 53, 36, 75, 45, 95, + 36, 113, 45, 12, 62, 38, 53, 50, 62, 79, 54, 88, 62, 117, 54, + 0, 2, 31, 10, 42, 2, 73, 10, 84, 2, 115, 10, 16, 27, 27, + 19, 58, 27, 69, 19, 99, 28, 111, 19, 12, 36, 36, 45, 54, 36, + 74, 45, 96, 36, 112, 45, 11, 62, 39, 53, 49, 62, 78, 54, 87, + 62, 116, 54, 1, 2, 32, 10, 43, 2, 74, 10, 85, 2, 116, 10, + 17, 27, 28, 19, 59, 27, 70, 19, 98, 28, 112, 19, 13, 36, 35, + 45, 55, 36, 73, 45, 97, 36, 111, 45, 10, 62, 39, 54, 48, 62, + 77, 54, 86, 62, 115, 54, 2, 2, 33, 10, 44, 2, 75, 10, 86, + 2, 117, 10, 18, 27, 29, 19, 59, 28, 71, 19, 97, 28, 113, 19, + 14, 36, 34, 45, 56, 36, 72, 45, 98, 36, 110, 45, 9, 62, 38, + 54, 47, 62, 76, 54, 85, 62, 114, 54, 3, 2, 34, 10, 45, 2, + 76, 10, 87, 2, 118, 10, 19, 27, 30, 19, 58, 28, 72, 19, 96, + 28, 114, 19, 15, 36, 33, 45, 57, 36, 71, 45, 99, 36, 109, 45, + 8, 62, 37, 54, 46, 62, 75, 54, 84, 62, 113, 54, 4, 2, 35, + 10, 46, 2, 77, 10, 88, 2, 119, 10, 19, 28, 31, 19, 57, 28, + 73, 19, 95, 28, 115, 19, 16, 36, 32, 45, 58, 36, 70, 45, 99, + 37, 108, 45, 7, 62, 36, 54, 45, 62, 74, 54, 83, 62, 112, 54, + 5, 2, 36, 10, 47, 2, 78, 10, 89, 2, 119, 11, 18, 28, 32, + 19, 56, 28, 74, 19, 94, 28, 116, 19, 17, 36, 31, 45, 59, 36, + 69, 45, 98, 37, 107, 45, 6, 62, 35, 54, 44, 62, 73, 54, 82, + 62, 111, 54, 6, 2, 37, 10, 48, 2, 79, 10, 90, 2, 118, 11, + 17, 28, 33, 19, 55, 28, 75, 19, 93, 28, 117, 19, 18, 36, 30, + 45, 59, 37, 68, 45, 97, 37, 106, 45, 5, 62, 34, 54, 43, 62, + 72, 54, 81, 62, 110, 54, 7, 2, 38, 10, 49, 2, 79, 11, 91, + 2, 117, 11, 16, 28, 34, 19, 54, 28, 76, 19, 92, 28, 118, 19, + 19, 36, 29, 45, 58, 37, 67, 45, 96, 37, 105, 45, 4, 62, 33, + 54, 42, 62, 71, 54, 80, 62, 109, 54, 8, 2, 39, 10, 50, 2, + 78, 11, 92, 2, 116, 11, 15, 28, 35, 19, 53, 28, 77, 19, 91, + 28, 119, 19, 19, 37, 28, 45, 57, 37, 66, 45, 95, 37, 104, 45, + 3, 62, 32, 54, 41, 62, 70, 54, 80, 63, 108, 54, 9, 2, 39, + 11, 51, 2, 77, 11, 93, 2, 115, 11, 14, 28, 36, 19, 52, 28, + 78, 19, 90, 28, 119, 20, 18, 37, 27, 45, 56, 37, 65, 45, 94, + 37, 103, 45, 2, 62, 31, 54, 40, 62, 69, 54, 81, 63, 107, 54, + 10, 2, 38, 11, 52, 2, 76, 11, 94, 2, 114, 11, 13, 28, 37, + 19, 51, 28, 79, 19, 89, 28, 118, 20, 17, 37, 26, 45, 55, 37, + 64, 45, 93, 37, 102, 45, 1, 62, 30, 54, 40, 63, 68, 54, 82, + 63, 106, 54, 11, 2, 37, 11, 53, 2, 75, 11, 95, 2, 113, 11, + 12, 28, 38, 19, 50, 28, 79, 20, 88, 28, 117, 20, 16, 37, 25, + 45, 54, 37, 63, 45, 92, 37, 101, 45, 0, 62, 29, 54, 41, 63, + 67, 54, 83, 63, 105, 54, 12, 2, 36, 11, 54, 2, 74, 11, 96, + 2, 112, 11, 11, 28, 39, 19, 49, 28, 78, 20, 87, 28, 116, 20, + 15, 37, 24, 45, 53, 37, 62, 45, 91, 37, 100, 45, 0, 63, 28, + 54, 42, 63, 66, 54, 84, 63, 104, 54, 13, 2, 35, 11, 55, 2, + 73, 11, 97, 2, 111, 11, 10, 28, 39, 20, 48, 28, 77, 20, 86, + 28, 115, 20, 14, 37, 23, 45, 52, 37, 61, 45, 90, 37, 100, 46, + 1, 63, 27, 54, 43, 63, 65, 54, 85, 63, 103, 54, 14, 2, 34, + 11, 56, 2, 72, 11, 98, 2, 110, 11, 9, 28, 38, 20, 47, 28, + 76, 20, 85, 28, 114, 20, 13, 37, 22, 45, 51, 37, 60, 45, 89, + 37, 101, 46, 2, 63, 26, 54, 44, 63, 64, 54, 86, 63, 102, 54, + 15, 2, 33, 11, 57, 2, 71, 11, 99, 2, 109, 11, 8, 28, 37, + 20, 46, 28, 75, 20, 84, 28, 113, 20, 12, 37, 21, 45, 50, 37, + 60, 46, 88, 37, 102, 46, 3, 63, 25, 54, 45, 63, 63, 54, 87, + 63, 101, 54, 16, 2, 32, 11, 58, 2, 70, 11, 99, 3, 108, 11, + 7, 28, 36, 20, 45, 28, 74, 20, 83, 28, 112, 20, 11, 37, 20, + 45, 49, 37, 61, 46, 87, 37, 103, 46, 4, 63, 24, 54, 46, 63, + 62, 54, 88, 63, 100, 54, 17, 2, 31, 11, 59, 2, 69, 11, 98, + 3, 107, 11, 6, 28, 35, 20, 44, 28, 73, 20, 82, 28, 111, 20, + 10, 37, 20, 46, 48, 37, 62, 46, 86, 37, 104, 46, 5, 63, 23, + 54, 47, 63, 61, 54, 89, 63, 100, 55, 18, 2, 30, 11, 59, 3, + 68, 11, 97, 3, 106, 11, 5, 28, 34, 20, 43, 28, 72, 20, 81, + 28, 110, 20, 9, 37, 21, 46, 47, 37, 63, 46, 85, 37, 105, 46, + 6, 63, 22, 54, 48, 63, 60, 54, 90, 63, 101, 55, 19, 2, 29, + 11, 58, 3, 67, 11, 96, 3, 105, 11, 4, 28, 33, 20, 42, 28, + 71, 20, 80, 28, 109, 20, 8, 37, 22, 46, 46, 37, 64, 46, 84, + 37, 106, 46, 7, 63, 21, 54, 49, 63, 60, 55, 91, 63, 102, 55, + 19, 3, 28, 11, 57, 3, 66, 11, 95, 3, 104, 11, 3, 28, 32, + 20, 41, 28, 70, 20, 80, 29, 108, 20, 7, 37, 23, 46, 45, 37, + 65, 46, 83, 37, 107, 46, 8, 63, 20, 54, 50, 63, 61, 55, 92, + 63, 103, 55, 18, 3, 27, 11, 56, 3, 65, 11, 94, 3, 103, 11, + 2, 28, 31, 20, 40, 28, 69, 20, 81, 29, 107, 20, 6, 37, 24, + 46, 44, 37, 66, 46, 82, 37, 108, 46, 9, 63, 20, 55, 51, 63, + 62, 55, 93, 63, 104, 55, 17, 3, 26, 11, 55, 3, 64, 11, 93, + 3, 102, 11, 1, 28, 30, 20, 40, 29, 68, 20, 82, 29, 106, 20, + 5, 37, 25, 46, 43, 37, 67, 46, 81, 37, 109, 46, 10, 63, 21, + 55, 52, 63, 63, 55, 94, 63, 105, 55, 16, 3, 25, 11, 54, 3, + 63, 11, 92, 3, 101, 11, 0, 28, 29, 20, 41, 29, 67, 20, 83, + 29, 105, 20, 4, 37, 26, 46, 42, 37, 68, 46, 80, 37, 110, 46, + 11, 63, 22, 55, 53, 63, 64, 55, 95, 63, 106, 55, 15, 3, 24, + 11, 53, 3, 62, 11, 91, 3, 100, 11, 0, 29, 28, 20, 42, 29, + 66, 20, 84, 29, 104, 20, 3, 37, 27, 46, 41, 37, 69, 46, 80, + 38, 111, 46, 12, 63, 23, 55, 54, 63, 65, 55, 96, 63, 107, 55, + 14, 3, 23, 11, 52, 3, 61, 11, 90, 3, 100, 12, 1, 29, 27, + 20, 43, 29, 65, 20, 85, 29, 103, 20, 2, 37, 28, 46, 40, 37, + 70, 46, 81, 38, 112, 46, 13, 63, 24, 55, 55, 63, 66, 55, 97, + 63, 108, 55, 13, 3, 22, 11, 51, 3, 60, 11, 89, 3, 101, 12, + 2, 29, 26, 20, 44, 29, 64, 20, 86, 29, 102, 20, 1, 37, 29, + 46, 40, 38, 71, 46, 82, 38, 113, 46, 14, 63, 25, 55, 56, 63, + 67, 55, 98, 63, 109, 55, 12, 3, 21, 11, 50, 3, 60, 12, 88, + 3, 102, 12, 3, 29, 25, 20, 45, 29, 63, 20, 87, 29, 101, 20, + 0, 37, 30, 46, 41, 38, 72, 46, 83, 38, 114, 46, 15, 63, 26, + 55, 57, 63, 68, 55, 99, 63, 110, 55, 11, 3, 20, 11, 49, 3, + 61, 12, 87, 3, 103, 12, 4, 29, 24, 20, 46, 29, 62, 20, 88, + 29, 100, 20, 0, 38, 31, 46, 42, 38, 73, 46, 84, 38, 115, 46, + 16, 63, 27, 55, 58, 63, 69, 55, 99, 64, 111, 55, 10, 3, 20, + 12, 48, 3, 62, 12, 86, 3, 104, 12, 5, 29, 23, 20, 47, 29, + 61, 20, 89, 29, 100, 21, 1, 38, 32, 46, 43, 38, 74, 46, 85, + 38, 116, 46, 17, 63, 28, 55, 59, 63, 70, 55, 98, 64, 112, 55, + 9, 3, 21, 12, 47, 3, 63, 12, 85, 3, 105, 12, 6, 29, 22, + 20, 48, 29, 60, 20, 90, 29, 101, 21, 2, 38, 33, 46, 44, 38, + 75, 46, 86, 38, 117, 46, 18, 63, 29, 55, 59, 64, 71, 55, 97, + 64, 113, 55, 8, 3, 22, 12, 46, 3, 64, 12, 84, 3, 106, 12, + 7, 29, 21, 20, 49, 29, 60, 21, 91, 29, 102, 21, 3, 38, 34, + 46, 45, 38, 76, 46, 87, 38, 118, 46, 19, 63, 30, 55, 58, 64, + 72, 55, 96, 64, 114, 55, 7, 3, 23, 12, 45, 3, 65, 12, 83, + 3, 107, 12, 8, 29, 20, 20, 50, 29, 61, 21, 92, 29, 103, 21, + 4, 38, 35, 46, 46, 38, 77, 46, 88, 38, 119, 46, 19, 64, 31, + 55, 57, 64, 73, 55, 95, 64, 115, 55, 6, 3, 24, 12, 44, 3, + 66, 12, 82, 3, 108, 12, 9, 29, 20, 21, 51, 29, 62, 21, 93, + 29, 104, 21, 5, 38, 36, 46, 47, 38, 78, 46, 89, 38, 119, 47, + 18, 64, 32, 55, 56, 64, 74, 55, 94, 64, 116, 55, 5, 3, 25, + 12, 43, 3, 67, 12, 81, 3, 109, 12, 10, 29, 21, 21, 52, 29, + 63, 21, 94, 29, 105, 21, 6, 38, 37, 46, 48, 38, 79, 46, 90, + 38, 118, 47, 17, 64, 33, 55, 55, 64, 75, 55, 93, 64, 117, 55, + 4, 3, 26, 12, 42, 3, 68, 12, 80, 3, 110, 12, 11, 29, 22, + 21, 53, 29, 64, 21, 95, 29, 106, 21, 7, 38, 38, 46, 49, 38, + 79, 47, 91, 38, 117, 47, 16, 64, 34, 55, 54, 64, 76, 55, 92, + 64, 118, 55, 3, 3, 27, 12, 41, 3, 69, 12, 80, 4, 111, 12, + 12, 29, 23, 21, 54, 29, 65, 21, 96, 29, 107, 21, 8, 38, 39, + 46, 50, 38, 78, 47, 92, 38, 116, 47, 15, 64, 35, 55, 53, 64, + 77, 55, 91, 64, 119, 55, 2, 3, 28, 12, 40, 3, 70, 12, 81, + 4, 112, 12, 13, 29, 24, 21, 55, 29, 66, 21, 97, 29, 108, 21, + 9, 38, 39, 47, 51, 38, 77, 47, 93, 38, 115, 47, 14, 64, 36, + 55, 52, 64, 78, 55, 90, 64, 119, 56, 1, 3, 29, 12, 40, 4, + 71, 12, 82, 4, 113, 12, 14, 29, 25, 21, 56, 29, 67, 21, 98, + 29, 109, 21, 10, 38, 38, 47, 52, 38, 76, 47, 94, 38, 114, 47, + 13, 64, 37, 55, 51, 64, 79, 55, 89, 64, 118, 56, 0, 3, 30, + 12, 41, 4, 72, 12, 83, 4, 114, 12, 15, 29, 26, 21, 57, 29, + 68, 21, 99, 29, 110, 21, 11, 38, 37, 47, 53, 38, 75, 47, 95, + 38, 113, 47, 12, 64, 38, 55, 50, 64, 79, 56, 88, 64, 117, 56, + 0, 4, 31, 12, 42, 4, 73, 12, 84, 4, 115, 12, 16, 29, 27, + 21, 58, 29, 69, 21, 99, 30, 111, 21, 12, 38, 36, 47, 54, 38, + 74, 47, 96, 38, 112, 47, 11, 64, 39, 55, 49, 64, 78, 56, 87, + 64, 116, 56, 1, 4, 32, 12, 43, 4, 74, 12, 85, 4, 116, 12, + 17, 29, 28, 21, 59, 29, 70, 21, 98, 30, 112, 21, 13, 38, 35, + 47, 55, 38, 73, 47, 97, 38, 111, 47, 10, 64, 39, 56, 48, 64, + 77, 56, 86, 64, 115, 56, 2, 4, 33, 12, 44, 4, 75, 12, 86, + 4, 117, 12, 18, 29, 29, 21, 59, 30, 71, 21, 97, 30, 113, 21, + 14, 38, 34, 47, 56, 38, 72, 47, 98, 38, 110, 47, 9, 64, 38, + 56, 47, 64, 76, 56, 85, 64, 114, 56, 3, 4, 34, 12, 45, 4, + 76, 12, 87, 4, 118, 12, 19, 29, 30, 21, 58, 30, 72, 21, 96, + 30, 114, 21, 15, 38, 33, 47, 57, 38, 71, 47, 99, 38, 109, 47, + 8, 64, 37, 56, 46, 64, 75, 56, 84, 64, 113, 56, 4, 4, 35, + 12, 46, 4, 77, 12, 88, 4, 119, 12, 19, 30, 31, 21, 57, 30, + 73, 21, 95, 30, 115, 21, 16, 38, 32, 47, 58, 38, 70, 47, 99, + 39, 108, 47, 7, 64, 36, 56, 45, 64, 74, 56, 83, 64, 112, 56, + 5, 4, 36, 12, 47, 4, 78, 12, 89, 4, 119, 13, 18, 30, 32, + 21, 56, 30, 74, 21, 94, 30, 116, 21, 17, 38, 31, 47, 59, 38, + 69, 47, 98, 39, 107, 47, 6, 64, 35, 56, 44, 64, 73, 56, 82, + 64, 111, 56, 6, 4, 37, 12, 48, 4, 79, 12, 90, 4, 118, 13, + 17, 30, 33, 21, 55, 30, 75, 21, 93, 30, 117, 21, 18, 38, 30, + 47, 59, 39, 68, 47, 97, 39, 106, 47, 5, 64, 34, 56, 43, 64, + 72, 56, 81, 64, 110, 56, 7, 4, 38, 12, 49, 4, 79, 13, 91, + 4, 117, 13, 16, 30, 34, 21, 54, 30, 76, 21, 92, 30, 118, 21, + 19, 38, 29, 47, 58, 39, 67, 47, 96, 39, 105, 47, 4, 64, 33, + 56, 42, 64, 71, 56, 80, 64, 109, 56, 8, 4, 39, 12, 50, 4, + 78, 13, 92, 4, 116, 13, 15, 30, 35, 21, 53, 30, 77, 21, 91, + 30, 119, 21, 19, 39, 28, 47, 57, 39, 66, 47, 95, 39, 104, 47, + 3, 64, 32, 56, 41, 64, 70, 56, 80, 65, 108, 56, 9, 4, 39, + 13, 51, 4, 77, 13, 93, 4, 115, 13, 14, 30, 36, 21, 52, 30, + 78, 21, 90, 30, 119, 22, 18, 39, 27, 47, 56, 39, 65, 47, 94, + 39, 103, 47, 2, 64, 31, 56, 40, 64, 69, 56, 81, 65, 107, 56, + 10, 4, 38, 13, 52, 4, 76, 13, 94, 4, 114, 13, 13, 30, 37, + 21, 51, 30, 79, 21, 89, 30, 118, 22, 17, 39, 26, 47, 55, 39, + 64, 47, 93, 39, 102, 47, 1, 64, 30, 56, 40, 65, 68, 56, 82, + 65, 106, 56, 11, 4, 37, 13, 53, 4, 75, 13, 95, 4, 113, 13, + 12, 30, 38, 21, 50, 30, 79, 22, 88, 30, 117, 22, 16, 39, 25, + 47, 54, 39, 63, 47, 92, 39, 101, 47, 0, 64, 29, 56, 41, 65, + 67, 56, 83, 65, 105, 56, 12, 4, 36, 13, 54, 4, 74, 13, 96, + 4, 112, 13, 11, 30, 39, 21, 49, 30, 78, 22, 87, 30, 116, 22, + 15, 39, 24, 47, 53, 39, 62, 47, 91, 39, 100, 47, 0, 65, 28, + 56, 42, 65, 66, 56, 84, 65, 104, 56, 13, 4, 35, 13, 55, 4, + 73, 13, 97, 4, 111, 13, 10, 30, 39, 22, 48, 30, 77, 22, 86, + 30, 115, 22, 14, 39, 23, 47, 52, 39, 61, 47, 90, 39, 100, 48, + 1, 65, 27, 56, 43, 65, 65, 56, 85, 65, 103, 56, 14, 4, 34, + 13, 56, 4, 72, 13, 98, 4, 110, 13, 9, 30, 38, 22, 47, 30, + 76, 22, 85, 30, 114, 22, 13, 39, 22, 47, 51, 39, 60, 47, 89, + 39, 101, 48, 2, 65, 26, 56, 44, 65, 64, 56, 86, 65, 102, 56, + 15, 4, 33, 13, 57, 4, 71, 13, 99, 4, 109, 13, 8, 30, 37, + 22, 46, 30, 75, 22, 84, 30, 113, 22, 12, 39, 21, 47, 50, 39, + 60, 48, 88, 39, 102, 48, 3, 65, 25, 56, 45, 65, 63, 56, 87, + 65, 101, 56, 16, 4, 32, 13, 58, 4, 70, 13, 99, 5, 108, 13, + 7, 30, 36, 22, 45, 30, 74, 22, 83, 30, 112, 22, 11, 39, 20, + 47, 49, 39, 61, 48, 87, 39, 103, 48, 4, 65, 24, 56, 46, 65, + 62, 56, 88, 65, 100, 56, 17, 4, 31, 13, 59, 4, 69, 13, 98, + 5, 107, 13, 6, 30, 35, 22, 44, 30, 73, 22, 82, 30, 111, 22, + 10, 39, 20, 48, 48, 39, 62, 48, 86, 39, 104, 48, 5, 65, 23, + 56, 47, 65, 61, 56, 89, 65, 100, 57, 18, 4, 30, 13, 59, 5, + 68, 13, 97, 5, 106, 13, 5, 30, 34, 22, 43, 30, 72, 22, 81, + 30, 110, 22, 9, 39, 21, 48, 47, 39, 63, 48, 85, 39, 105, 48, + 6, 65, 22, 56, 48, 65, 60, 56, 90, 65, 101, 57, 19, 4, 29, + 13, 58, 5, 67, 13, 96, 5, 105, 13, 4, 30, 33, 22, 42, 30, + 71, 22, 80, 30, 109, 22, 8, 39, 22, 48, 46, 39, 64, 48, 84, + 39, 106, 48, 7, 65, 21, 56, 49, 65, 60, 57, 91, 65, 102, 57, + 19, 5, 28, 13, 57, 5, 66, 13, 95, 5, 104, 13, 3, 30, 32, + 22, 41, 30, 70, 22, 80, 31, 108, 22, 7, 39, 23, 48, 45, 39, + 65, 48, 83, 39, 107, 48, 8, 65, 20, 56, 50, 65, 61, 57, 92, + 65, 103, 57, 18, 5, 27, 13, 56, 5, 65, 13, 94, 5, 103, 13, + 2, 30, 31, 22, 40, 30, 69, 22, 81, 31, 107, 22, 6, 39, 24, + 48, 44, 39, 66, 48, 82, 39, 108, 48, 9, 65, 20, 57, 51, 65, + 62, 57, 93, 65, 104, 57, 17, 5, 26, 13, 55, 5, 64, 13, 93, + 5, 102, 13, 1, 30, 30, 22, 40, 31, 68, 22, 82, 31, 106, 22, + 5, 39, 25, 48, 43, 39, 67, 48, 81, 39, 109, 48, 10, 65, 21, + 57, 52, 65, 63, 57, 94, 65, 105, 57, 16, 5, 25, 13, 54, 5, + 63, 13, 92, 5, 101, 13, 0, 30, 29, 22, 41, 31, 67, 22, 83, + 31, 105, 22, 4, 39, 26, 48, 42, 39, 68, 48, 80, 39, 110, 48, + 11, 65, 22, 57, 53, 65, 64, 57, 95, 65, 106, 57, 15, 5, 24, + 13, 53, 5, 62, 13, 91, 5, 100, 13, 0, 31, 28, 22, 42, 31, + 66, 22, 84, 31, 104, 22, 3, 39, 27, 48, 41, 39, 69, 48, 80, + 40, 111, 48, 12, 65, 23, 57, 54, 65, 65, 57, 96, 65, 107, 57, + 14, 5, 23, 13, 52, 5, 61, 13, 90, 5, 100, 14, 1, 31, 27, + 22, 43, 31, 65, 22, 85, 31, 103, 22, 2, 39, 28, 48, 40, 39, + 70, 48, 81, 40, 112, 48, 13, 65, 24, 57, 55, 65, 66, 57, 97, + 65, 108, 57, 13, 5, 22, 13, 51, 5, 60, 13, 89, 5, 101, 14, + 2, 31, 26, 22, 44, 31, 64, 22, 86, 31, 102, 22, 1, 39, 29, + 48, 40, 40, 71, 48, 82, 40, 113, 48, 14, 65, 25, 57, 56, 65, + 67, 57, 98, 65, 109, 57, 12, 5, 21, 13, 50, 5, 60, 14, 88, + 5, 102, 14, 3, 31, 25, 22, 45, 31, 63, 22, 87, 31, 101, 22, + 0, 39, 30, 48, 41, 40, 72, 48, 83, 40, 114, 48, 15, 65, 26, + 57, 57, 65, 68, 57, 99, 65, 110, 57, 11, 5, 20, 13, 49, 5, + 61, 14, 87, 5, 103, 14, 4, 31, 24, 22, 46, 31, 62, 22, 88, + 31, 100, 22, 0, 40, 31, 48, 42, 40, 73, 48, 84, 40, 115, 48, + 16, 65, 27, 57, 58, 65, 69, 57, 99, 66, 111, 57, 10, 5, 20, + 14, 48, 5, 62, 14, 86, 5, 104, 14, 5, 31, 23, 22, 47, 31, + 61, 22, 89, 31, 100, 23, 1, 40, 32, 48, 43, 40, 74, 48, 85, + 40, 116, 48, 17, 65, 28, 57, 59, 65, 70, 57, 98, 66, 112, 57, + 9, 5, 21, 14, 47, 5, 63, 14, 85, 5, 105, 14, 6, 31, 22, + 22, 48, 31, 60, 22, 90, 31, 101, 23, 2, 40, 33, 48, 44, 40, + 75, 48, 86, 40, 117, 48, 18, 65, 29, 57, 59, 66, 71, 57, 97, + 66, 113, 57, 8, 5, 22, 14, 46, 5, 64, 14, 84, 5, 106, 14, + 7, 31, 21, 22, 49, 31, 60, 23, 91, 31, 102, 23, 3, 40, 34, + 48, 45, 40, 76, 48, 87, 40, 118, 48, 19, 65, 30, 57, 58, 66, + 72, 57, 96, 66, 114, 57, 7, 5, 23, 14, 45, 5, 65, 14, 83, + 5, 107, 14, 8, 31, 20, 22, 50, 31, 61, 23, 92, 31, 103, 23, + 4, 40, 35, 48, 46, 40, 77, 48, 88, 40, 119, 48, 19, 66, 31, + 57, 57, 66, 73, 57, 95, 66, 115, 57, 6, 5, 24, 14, 44, 5, + 66, 14, 82, 5, 108, 14, 9, 31, 20, 23, 51, 31, 62, 23, 93, + 31, 104, 23, 5, 40, 36, 48, 47, 40, 78, 48, 89, 40, 119, 49, + 18, 66, 32, 57, 56, 66, 74, 57, 94, 66, 116, 57, 5, 5, 25, + 14, 43, 5, 67, 14, 81, 5, 109, 14, 10, 31, 21, 23, 52, 31, + 63, 23, 94, 31, 105, 23, 6, 40, 37, 48, 48, 40, 79, 48, 90, + 40, 118, 49, 17, 66, 33, 57, 55, 66, 75, 57, 93, 66, 117, 57, + 4, 5, 26, 14, 42, 5, 68, 14, 80, 5, 110, 14, 11, 31, 22, + 23, 53, 31, 64, 23, 95, 31, 106, 23, 7, 40, 38, 48, 49, 40, + 79, 49, 91, 40, 117, 49, 16, 66, 34, 57, 54, 66, 76, 57, 92, + 66, 118, 57, 3, 5, 27, 14, 41, 5, 69, 14, 80, 6, 111, 14, + 12, 31, 23, 23, 54, 31, 65, 23, 96, 31, 107, 23, 8, 40, 39, + 48, 50, 40, 78, 49, 92, 40, 116, 49, 15, 66, 35, 57, 53, 66, + 77, 57, 91, 66, 119, 57, 2, 5, 28, 14, 40, 5, 70, 14, 81, + 6, 112, 14, 13, 31, 24, 23, 55, 31, 66, 23, 97, 31, 108, 23, + 9, 40, 39, 49, 51, 40, 77, 49, 93, 40, 115, 49, 14, 66, 36, + 57, 52, 66, 78, 57, 90, 66, 119, 58, 1, 5, 29, 14, 40, 6, + 71, 14, 82, 6, 113, 14, 14, 31, 25, 23, 56, 31, 67, 23, 98, + 31, 109, 23, 10, 40, 38, 49, 52, 40, 76, 49, 94, 40, 114, 49, + 13, 66, 37, 57, 51, 66, 79, 57, 89, 66, 118, 58, 0, 5, 30, + 14, 41, 6, 72, 14, 83, 6, 114, 14, 15, 31, 26, 23, 57, 31, + 68, 23, 99, 31, 110, 23, 11, 40, 37, 49, 53, 40, 75, 49, 95, + 40, 113, 49, 12, 66, 38, 57, 50, 66, 79, 58, 88, 66, 117, 58, + 0, 6, 31, 14, 42, 6, 73, 14, 84, 6, 115, 14, 16, 31, 27, + 23, 58, 31, 69, 23, 99, 32, 111, 23, 12, 40, 36, 49, 54, 40, + 74, 49, 96, 40, 112, 49, 11, 66, 39, 57, 49, 66, 78, 58, 87, + 66, 116, 58, 1, 6, 32, 14, 43, 6, 74, 14, 85, 6, 116, 14, + 17, 31, 28, 23, 59, 31, 70, 23, 98, 32, 112, 23, 13, 40, 35, + 49, 55, 40, 73, 49, 97, 40, 111, 49, 10, 66, 39, 58, 48, 66, + 77, 58, 86, 66, 115, 58, 2, 6, 33, 14, 44, 6, 75, 14, 86, + 6, 117, 14, 18, 31, 29, 23, 59, 32, 71, 23, 97, 32, 113, 23, + 14, 40, 34, 49, 56, 40, 72, 49, 98, 40, 110, 49, 9, 66, 38, + 58, 47, 66, 76, 58, 85, 66, 114, 58, 3, 6, 34, 14, 45, 6, + 76, 14, 87, 6, 118, 14, 19, 31, 30, 23, 58, 32, 72, 23, 96, + 32, 114, 23, 15, 40, 33, 49, 57, 40, 71, 49, 99, 40, 109, 49, + 8, 66, 37, 58, 46, 66, 75, 58, 84, 66, 113, 58, 4, 6, 35, + 14, 46, 6, 77, 14, 88, 6, 119, 14, 19, 32, 31, 23, 57, 32, + 73, 23, 95, 32, 115, 23, 16, 40, 32, 49, 58, 40, 70, 49, 99, + 41, 108, 49, 7, 66, 36, 58, 45, 66, 74, 58, 83, 66, 112, 58, + 5, 6, 36, 14, 47, 6, 78, 14, 89, 6, 119, 15, 18, 32, 32, + 23, 56, 32, 74, 23, 94, 32, 116, 23, 17, 40, 31, 49, 59, 40, + 69, 49, 98, 41, 107, 49, 6, 66, 35, 58, 44, 66, 73, 58, 82, + 66, 111, 58, 6, 6, 37, 14, 48, 6, 79, 14, 90, 6, 118, 15, + 17, 32, 33, 23, 55, 32, 75, 23, 93, 32, 117, 23, 18, 40, 30, + 49, 59, 41, 68, 49, 97, 41, 106, 49, 5, 66, 34, 58, 43, 66, + 72, 58, 81, 66, 110, 58, 7, 6, 38, 14, 49, 6, 79, 15, 91, + 6, 117, 15, 16, 32, 34, 23, 54, 32, 76, 23, 92, 32, 118, 23, + 19, 40, 29, 49, 58, 41, 67, 49, 96, 41, 105, 49, 4, 66, 33, + 58, 42, 66, 71, 58, 80, 66, 109, 58, 8, 6, 39, 14, 50, 6, + 78, 15, 92, 6, 116, 15, 15, 32, 35, 23, 53, 32, 77, 23, 91, + 32, 119, 23, 19, 41, 28, 49, 57, 41, 66, 49, 95, 41, 104, 49, + 3, 66, 32, 58, 41, 66, 70, 58, 80, 67, 108, 58, 9, 6, 39, + 15, 51, 6, 77, 15, 93, 6, 115, 15, 14, 32, 36, 23, 52, 32, + 78, 23, 90, 32, 119, 24, 18, 41, 27, 49, 56, 41, 65, 49, 94, + 41, 103, 49, 2, 66, 31, 58, 40, 66, 69, 58, 81, 67, 107, 58, + 10, 6, 38, 15, 52, 6, 76, 15, 94, 6, 114, 15, 13, 32, 37, + 23, 51, 32, 79, 23, 89, 32, 118, 24, 17, 41, 26, 49, 55, 41, + 64, 49, 93, 41, 102, 49, 1, 66, 30, 58, 40, 67, 68, 58, 82, + 67, 106, 58, 11, 6, 37, 15, 53, 6, 75, 15, 95, 6, 113, 15, + 12, 32, 38, 23, 50, 32, 79, 24, 88, 32, 117, 24, 16, 41, 25, + 49, 54, 41, 63, 49, 92, 41, 101, 49, 0, 66, 29, 58, 41, 67, + 67, 58, 83, 67, 105, 58, 12, 6, 36, 15, 54, 6, 74, 15, 96, + 6, 112, 15, 11, 32, 39, 23, 49, 32, 78, 24, 87, 32, 116, 24, + 15, 41, 24, 49, 53, 41, 62, 49, 91, 41, 100, 49, 0, 67, 28, + 58, 42, 67, 66, 58, 84, 67, 104, 58, 13, 6, 35, 15, 55, 6, + 73, 15, 97, 6, 111, 15, 10, 32, 39, 24, 48, 32, 77, 24, 86, + 32, 115, 24, 14, 41, 23, 49, 52, 41, 61, 49, 90, 41, 100, 50, + 1, 67, 27, 58, 43, 67, 65, 58, 85, 67, 103, 58, 14, 6, 34, + 15, 56, 6, 72, 15, 98, 6, 110, 15, 9, 32, 38, 24, 47, 32, + 76, 24, 85, 32, 114, 24, 13, 41, 22, 49, 51, 41, 60, 49, 89, + 41, 101, 50, 2, 67, 26, 58, 44, 67, 64, 58, 86, 67, 102, 58, + 15, 6, 33, 15, 57, 6, 71, 15, 99, 6, 109, 15, 8, 32, 37, + 24, 46, 32, 75, 24, 84, 32, 113, 24, 12, 41, 21, 49, 50, 41, + 60, 50, 88, 41, 102, 50, 3, 67, 25, 58, 45, 67, 63, 58, 87, + 67, 101, 58, 16, 6, 32, 15, 58, 6, 70, 15, 99, 7, 108, 15, + 7, 32, 36, 24, 45, 32, 74, 24, 83, 32, 112, 24, 11, 41, 20, + 49, 49, 41, 61, 50, 87, 41, 103, 50, 4, 67, 24, 58, 46, 67, + 62, 58, 88, 67, 100, 58, 17, 6, 31, 15, 59, 6, 69, 15, 98, + 7, 107, 15, 6, 32, 35, 24, 44, 32, 73, 24, 82, 32, 111, 24, + 10, 41, 20, 50, 48, 41, 62, 50, 86, 41, 104, 50, 5, 67, 23, + 58, 47, 67, 61, 58, 89, 67, 100, 59, 18, 6, 30, 15, 59, 7, + 68, 15, 97, 7, 106, 15, 5, 32, 34, 24, 43, 32, 72, 24, 81, + 32, 110, 24, 9, 41, 21, 50, 47, 41, 63, 50, 85, 41, 105, 50, + 6, 67, 22, 58, 48, 67, 60, 58, 90, 67, 101, 59, 19, 6, 29, + 15, 58, 7, 67, 15, 96, 7, 105, 15, 4, 32, 33, 24, 42, 32, + 71, 24, 80, 32, 109, 24, 8, 41, 22, 50, 46, 41, 64, 50, 84, + 41, 106, 50, 7, 67, 21, 58, 49, 67, 60, 59, 91, 67, 102, 59, + 19, 7, 28, 15, 57, 7, 66, 15, 95, 7, 104, 15, 3, 32, 32, + 24, 41, 32, 70, 24, 80, 33, 108, 24, 7, 41, 23, 50, 45, 41, + 65, 50, 83, 41, 107, 50, 8, 67, 20, 58, 50, 67, 61, 59, 92, + 67, 103, 59, 18, 7, 27, 15, 56, 7, 65, 15, 94, 7, 103, 15, + 2, 32, 31, 24, 40, 32, 69, 24, 81, 33, 107, 24, 6, 41, 24, + 50, 44, 41, 66, 50, 82, 41, 108, 50, 9, 67, 20, 59, 51, 67, + 62, 59, 93, 67, 104, 59, 17, 7, 26, 15, 55, 7, 64, 15, 93, + 7, 102, 15, 1, 32, 30, 24, 40, 33, 68, 24, 82, 33, 106, 24, + 5, 41, 25, 50, 43, 41, 67, 50, 81, 41, 109, 50, 10, 67, 21, + 59, 52, 67, 63, 59, 94, 67, 105, 59, 16, 7, 25, 15, 54, 7, + 63, 15, 92, 7, 101, 15, 0, 32, 29, 24, 41, 33, 67, 24, 83, + 33, 105, 24, 4, 41, 26, 50, 42, 41, 68, 50, 80, 41, 110, 50, + 11, 67, 22, 59, 53, 67, 64, 59, 95, 67, 106, 59, 15, 7, 24, + 15, 53, 7, 62, 15, 91, 7, 100, 15, 0, 33, 28, 24, 42, 33, + 66, 24, 84, 33, 104, 24, 3, 41, 27, 50, 41, 41, 69, 50, 80, + 42, 111, 50, 12, 67, 23, 59, 54, 67, 65, 59, 96, 67, 107, 59, + 14, 7, 23, 15, 52, 7, 61, 15, 90, 7, 100, 16, 1, 33, 27, + 24, 43, 33, 65, 24, 85, 33, 103, 24, 2, 41, 28, 50, 40, 41, + 70, 50, 81, 42, 112, 50, 13, 67, 24, 59, 55, 67, 66, 59, 97, + 67, 108, 59, 13, 7, 22, 15, 51, 7, 60, 15, 89, 7, 101, 16, + 2, 33, 26, 24, 44, 33, 64, 24, 86, 33, 102, 24, 1, 41, 29, + 50, 40, 42, 71, 50, 82, 42, 113, 50, 14, 67, 25, 59, 56, 67, + 67, 59, 98, 67, 109, 59, 12, 7, 21, 15, 50, 7, 60, 16, 88, + 7, 102, 16, 3, 33, 25, 24, 45, 33, 63, 24, 87, 33, 101, 24, + 0, 41, 30, 50, 41, 42, 72, 50, 83, 42, 114, 50, 15, 67, 26, + 59, 57, 67, 68, 59, 99, 67, 110, 59, 11, 7, 20, 15, 49, 7, + 61, 16, 87, 7, 103, 16, 4, 33, 24, 24, 46, 33, 62, 24, 88, + 33, 100, 24, 0, 42, 31, 50, 42, 42, 73, 50, 84, 42, 115, 50, + 16, 67, 27, 59, 58, 67, 69, 59, 80, 51, 111, 59, 10, 7, 20, + 16, 48, 7, 62, 16, 86, 7, 104, 16, 5, 33, 23, 24, 47, 33, + 61, 24, 89, 33, 100, 25, 1, 42, 32, 50, 43, 42, 74, 50, 85, + 42, 116, 50, 17, 67, 28, 59, 59, 67, 70, 59, 81, 51, 112, 59, + 9, 7, 21, 16, 47, 7, 63, 16, 85, 7, 105, 16, 6, 33, 22, + 24, 48, 33, 60, 24, 90, 33, 101, 25, 2, 42, 33, 50, 44, 42, + 75, 50, 86, 42, 117, 50, 18, 67, 29, 59, 40, 51, 71, 59, 82, + 51, 113, 59, 8, 7, 22, 16, 46, 7, 64, 16, 84, 7, 106, 16, + 7, 33, 21, 24, 49, 33, 60, 25, 91, 33, 102, 25, 3, 42, 34, + 50, 45, 42, 76, 50, 87, 42, 118, 50, 19, 67, 30, 59, 41, 51, + 72, 59, 83, 51, 114, 59, 7, 7, 23, 16, 45, 7, 65, 16, 83, + 7, 107, 16, 8, 33, 20, 24, 50, 33, 61, 25, 92, 33, 103, 25, + 4, 42, 35, 50, 46, 42, 77, 50, 88, 42, 119, 50, 0, 51, 31, + 59, 42, 51, 73, 59, 84, 51, 115, 59, 6, 7, 24, 16, 44, 7, + 66, 16, 82, 7, 108, 16, 9, 33, 20, 25, 51, 33, 62, 25, 93, + 33, 104, 25, 5, 42, 36, 50, 47, 42, 78, 50, 89, 42, 100, 34, + 1, 51, 32, 59, 43, 51, 74, 59, 85, 51, 116, 59, 5, 7, 25, + 16, 43, 7, 67, 16, 81, 7, 109, 16, 10, 33, 21, 25, 52, 33, + 63, 25, 94, 33, 105, 25, 6, 42, 37, 50, 48, 42, 79, 50, 90, + 42, 101, 34, 2, 51, 33, 59, 44, 51, 75, 59, 86, 51, 117, 59, + 4, 7, 26, 16, 42, 7, 68, 16, 80, 7, 110, 16, 11, 33, 22, + 25, 53, 33, 64, 25, 95, 33, 106, 25, 7, 42, 38, 50, 49, 42, + 60, 34, 91, 42, 102, 34, 3, 51, 34, 59, 45, 51, 76, 59, 87, + 51, 118, 59, 3, 7, 27, 16, 41, 7, 69, 16, 80, 8, 111, 16, + 12, 33, 23, 25, 54, 33, 65, 25, 96, 33, 107, 25, 8, 42, 39, + 50, 50, 42, 61, 34, 92, 42, 103, 34, 4, 51, 35, 59, 46, 51, + 77, 59, 88, 51, 119, 59, 2, 7, 28, 16, 40, 7, 70, 16, 81, + 8, 112, 16, 13, 33, 24, 25, 55, 33, 66, 25, 97, 33, 108, 25, + 9, 42, 20, 34, 51, 42, 62, 34, 93, 42, 104, 34, 5, 51, 36, + 59, 47, 51, 78, 59, 89, 51, 119, 60, 1, 7, 29, 16, 40, 8, + 71, 16, 82, 8, 113, 16, 14, 33, 25, 25, 56, 33, 67, 25, 98, + 33, 109, 25, 10, 42, 21, 34, 52, 42, 63, 34, 94, 42, 105, 34, + 6, 51, 37, 59, 48, 51, 79, 59, 90, 51, 118, 60, 0, 7, 30, + 16, 41, 8, 72, 16, 83, 8, 114, 16, 15, 33, 26, 25, 57, 33, + 68, 25, 99, 33, 110, 25, 11, 42, 22, 34, 53, 42, 64, 34, 95, + 42, 106, 34, 7, 51, 38, 59, 49, 51, 79, 60, 91, 51, 117, 60, + 0, 8, 31, 16, 42, 8, 73, 16, 84, 8, 115, 16, 16, 33, 27, + 25, 58, 33, 69, 25, 80, 17, 111, 25, 12, 42, 23, 34, 54, 42, + 65, 34, 96, 42, 107, 34, 8, 51, 39, 59, 50, 51, 78, 60, 92, + 51, 116, 60, 1, 8, 32, 16, 43, 8, 74, 16, 85, 8, 116, 16, + 17, 33, 28, 25, 59, 33, 70, 25, 81, 17, 112, 25, 13, 42, 24, + 34, 55, 42, 66, 34, 97, 42, 108, 34, 9, 51, 39, 60, 51, 51, + 77, 60, 93, 51, 115, 60, 2, 8, 33, 16, 44, 8, 75, 16, 86, + 8, 117, 16, 18, 33, 29, 25, 40, 17, 71, 25, 82, 17, 113, 25, + 14, 42, 25, 34, 56, 42, 67, 34, 98, 42, 109, 34, 10, 51, 38, + 60, 52, 51, 76, 60, 94, 51, 114, 60, 3, 8, 34, 16, 45, 8, + 76, 16, 87, 8, 118, 16, 19, 33, 30, 25, 41, 17, 72, 25, 83, + 17, 114, 25, 15, 42, 26, 34, 57, 42, 68, 34, 99, 42, 110, 34, + 11, 51, 37, 60, 53, 51, 75, 60, 95, 51, 113, 60, 4, 8, 35, + 16, 46, 8, 77, 16, 88, 8, 119, 16, 0, 17, 31, 25, 42, 17, + 73, 25, 84, 17, 115, 25, 16, 42, 27, 34, 58, 42, 69, 34, 99, + 43, 111, 34, 12, 51, 36, 60, 54, 51, 74, 60, 96, 51, 112, 60, + 5, 8, 36, 16, 47, 8, 78, 16, 89, 8, 100, 0, 1, 17, 32, + 25, 43, 17, 74, 25, 85, 17, 116, 25, 17, 42, 28, 34, 59, 42, + 70, 34, 98, 43, 112, 34, 13, 51, 35, 60, 55, 51, 73, 60, 97, + 51, 111, 60, 6, 8, 37, 16, 48, 8, 79, 16, 90, 8, 101, 0, + 2, 17, 33, 25, 44, 17, 75, 25, 86, 17, 117, 25, 18, 42, 29, + 34, 59, 43, 71, 34, 97, 43, 113, 34, 14, 51, 34, 60, 56, 51, + 72, 60, 98, 51, 110, 60, 7, 8, 38, 16, 49, 8, 60, 0, 91, + 8, 102, 0, 3, 17, 34, 25, 45, 17, 76, 25, 87, 17, 118, 25, + 19, 42, 30, 34, 58, 43, 72, 34, 96, 43, 114, 34, 15, 51, 33, + 60, 57, 51, 71, 60, 99, 51, 109, 60, 8, 8, 39, 16, 50, 8, + 61, 0, 92, 8, 103, 0, 4, 17, 35, 25, 46, 17, 77, 25, 88, + 17, 119, 25, 19, 43, 31, 34, 57, 43, 73, 34, 95, 43, 115, 34, + 16, 51, 32, 60, 58, 51, 70, 60, 99, 52, 108, 60, 9, 8, 20, + 0, 51, 8, 62, 0, 93, 8, 104, 0, 5, 17, 36, 25, 47, 17, + 78, 25, 89, 17, 119, 26, 18, 43, 32, 34, 56, 43, 74, 34, 94, + 43, 116, 34, 17, 51, 31, 60, 59, 51, 69, 60, 98, 52, 107, 60, + 10, 8, 21, 0, 52, 8, 63, 0, 94, 8, 105, 0, 6, 17, 37, + 25, 48, 17, 79, 25, 90, 17, 118, 26, 17, 43, 33, 34, 55, 43, + 75, 34, 93, 43, 117, 34, 18, 51, 30, 60, 59, 52, 68, 60, 97, + 52, 106, 60, 11, 8, 22, 0, 53, 8, 64, 0, 95, 8, 106, 0, + 7, 17, 38, 25, 49, 17, 79, 26, 91, 17, 117, 26, 16, 43, 34, + 34, 54, 43, 76, 34, 92, 43, 118, 34, 19, 51, 29, 60, 58, 52, + 67, 60, 96, 52, 105, 60, 12, 8, 23, 0, 54, 8, 65, 0, 96, + 8, 107, 0, 8, 17, 39, 25, 50, 17, 78, 26, 92, 17, 116, 26, + 15, 43, 35, 34, 53, 43, 77, 34, 91, 43, 119, 34, 19, 52, 28, + 60, 57, 52, 66, 60, 95, 52, 104, 60, 13, 8, 24, 0, 55, 8, + 66, 0, 97, 8, 108, 0, 9, 17, 39, 26, 51, 17, 77, 26, 93, + 17, 115, 26, 14, 43, 36, 34, 52, 43, 78, 34, 90, 43, 119, 35, + 18, 52, 27, 60, 56, 52, 65, 60, 94, 52, 103, 60, 14, 8, 25, + 0, 56, 8, 67, 0, 98, 8, 109, 0, 10, 17, 38, 26, 52, 17, + 76, 26, 94, 17, 114, 26, 13, 43, 37, 34, 51, 43, 79, 34, 89, + 43, 118, 35, 17, 52, 26, 60, 55, 52, 64, 60, 93, 52, 102, 60, + 15, 8, 26, 0, 57, 8, 68, 0, 99, 8, 110, 0, 11, 17, 37, + 26, 53, 17, 75, 26, 95, 17, 113, 26, 12, 43, 38, 34, 50, 43, + 79, 35, 88, 43, 117, 35, 16, 52, 25, 60, 54, 52, 63, 60, 92, + 52, 101, 60, 16, 8, 27, 0, 58, 8, 69, 0, 99, 9, 111, 0, + 12, 17, 36, 26, 54, 17, 74, 26, 96, 17, 112, 26, 11, 43, 39, + 34, 49, 43, 78, 35, 87, 43, 116, 35, 15, 52, 24, 60, 53, 52, + 62, 60, 91, 52, 100, 60, 17, 8, 28, 0, 59, 8, 70, 0, 98, + 9, 112, 0, 13, 17, 35, 26, 55, 17, 73, 26, 97, 17, 111, 26, + 10, 43, 39, 35, 48, 43, 77, 35, 86, 43, 115, 35, 14, 52, 23, + 60, 52, 52, 61, 60, 90, 52, 100, 61, 18, 8, 29, 0, 59, 9, + 71, 0, 97, 9, 113, 0, 14, 17, 34, 26, 56, 17, 72, 26, 98, + 17, 110, 26, 9, 43, 38, 35, 47, 43, 76, 35, 85, 43, 114, 35, + 13, 52, 22, 60, 51, 52, 60, 60, 89, 52, 101, 61, 19, 8, 30, + 0, 58, 9, 72, 0, 96, 9, 114, 0, 15, 17, 33, 26, 57, 17, + 71, 26, 99, 17, 109, 26, 8, 43, 37, 35, 46, 43, 75, 35, 84, + 43, 113, 35, 12, 52, 21, 60, 50, 52, 60, 61, 88, 52, 102, 61, + 19, 9, 31, 0, 57, 9, 73, 0, 95, 9, 115, 0, 16, 17, 32, + 26, 58, 17, 70, 26, 99, 18, 108, 26, 7, 43, 36, 35, 45, 43, + 74, 35, 83, 43, 112, 35, 11, 52, 20, 60, 49, 52, 61, 61, 87, + 52, 103, 61, 18, 9, 32, 0, 56, 9, 74, 0, 94, 9, 116, 0, + 17, 17, 31, 26, 59, 17, 69, 26, 98, 18, 107, 26, 6, 43, 35, + 35, 44, 43, 73, 35, 82, 43, 111, 35, 10, 52, 20, 61, 48, 52, + 62, 61, 86, 52, 104, 61, 17, 9, 33, 0, 55, 9, 75, 0, 93, + 9, 117, 0, 18, 17, 30, 26, 59, 18, 68, 26, 97, 18, 106, 26, + 5, 43, 34, 35, 43, 43, 72, 35, 81, 43, 110, 35, 9, 52, 21, + 61, 47, 52, 63, 61, 85, 52, 105, 61, 16, 9, 34, 0, 54, 9, + 76, 0, 92, 9, 118, 0, 19, 17, 29, 26, 58, 18, 67, 26, 96, + 18, 105, 26, 4, 43, 33, 35, 42, 43, 71, 35, 80, 43, 109, 35, + 8, 52, 22, 61, 46, 52, 64, 61, 84, 52, 106, 61, 15, 9, 35, + 0, 53, 9, 77, 0, 91, 9, 119, 0, 19, 18, 28, 26, 57, 18, + 66, 26, 95, 18, 104, 26, 3, 43, 32, 35, 41, 43, 70, 35, 80, + 44, 108, 35, 7, 52, 23, 61, 45, 52, 65, 61, 83, 52, 107, 61, + 14, 9, 36, 0, 52, 9, 78, 0, 90, 9, 119, 1, 18, 18, 27, + 26, 56, 18, 65, 26, 94, 18, 103, 26, 2, 43, 31, 35, 40, 43, + 69, 35, 81, 44, 107, 35, 6, 52, 24, 61, 44, 52, 66, 61, 82, + 52, 108, 61, 13, 9, 37, 0, 51, 9, 79, 0, 89, 9, 118, 1, + 17, 18, 26, 26, 55, 18, 64, 26, 93, 18, 102, 26, 1, 43, 30, + 35, 40, 44, 68, 35, 82, 44, 106, 35, 5, 52, 25, 61, 43, 52, + 67, 61, 81, 52, 109, 61, 12, 9, 38, 0, 50, 9, 79, 1, 88, + 9, 117, 1, 16, 18, 25, 26, 54, 18, 63, 26, 92, 18, 101, 26, + 0, 43, 29, 35, 41, 44, 67, 35, 83, 44, 105, 35, 4, 52, 26, + 61, 42, 52, 68, 61, 80, 52, 110, 61, 11, 9, 39, 0, 49, 9, + 78, 1, 87, 9, 116, 1, 15, 18, 24, 26, 53, 18, 62, 26, 91, + 18, 100, 26, 0, 44, 28, 35, 42, 44, 66, 35, 84, 44, 104, 35, + 3, 52, 27, 61, 41, 52, 69, 61, 80, 53, 111, 61, 10, 9, 39, + 1, 48, 9, 77, 1, 86, 9, 115, 1, 14, 18, 23, 26, 52, 18, + 61, 26, 90, 18, 100, 27, 1, 44, 27, 35, 43, 44, 65, 35, 85, + 44, 103, 35, 2, 52, 28, 61, 40, 52, 70, 61, 81, 53, 112, 61, + 9, 9, 38, 1, 47, 9, 76, 1, 85, 9, 114, 1, 13, 18, 22, + 26, 51, 18, 60, 26, 89, 18, 101, 27, 2, 44, 26, 35, 44, 44, + 64, 35, 86, 44, 102, 35, 1, 52, 29, 61, 40, 53, 71, 61, 82, + 53, 113, 61, 8, 9, 37, 1, 46, 9, 75, 1, 84, 9, 113, 1, + 12, 18, 21, 26, 50, 18, 60, 27, 88, 18, 102, 27, 3, 44, 25, + 35, 45, 44, 63, 35, 87, 44, 101, 35, 0, 52, 30, 61, 41, 53, + 72, 61, 83, 53, 114, 61, 7, 9, 36, 1, 45, 9, 74, 1, 83, + 9, 112, 1, 11, 18, 20, 26, 49, 18, 61, 27, 87, 18, 103, 27, + 4, 44, 24, 35, 46, 44, 62, 35, 88, 44, 100, 35, 0, 53, 31, + 61, 42, 53, 73, 61, 84, 53, 115, 61, 6, 9, 35, 1, 44, 9, + 73, 1, 82, 9, 111, 1, 10, 18, 20, 27, 48, 18, 62, 27, 86, + 18, 104, 27, 5, 44, 23, 35, 47, 44, 61, 35, 89, 44, 100, 36, + 1, 53, 32, 61, 43, 53, 74, 61, 85, 53, 116, 61, 5, 9, 34, + 1, 43, 9, 72, 1, 81, 9, 110, 1, 9, 18, 21, 27, 47, 18, + 63, 27, 85, 18, 105, 27, 6, 44, 22, 35, 48, 44, 60, 35, 90, + 44, 101, 36, 2, 53, 33, 61, 44, 53, 75, 61, 86, 53, 117, 61, + 4, 9, 33, 1, 42, 9, 71, 1, 80, 9, 109, 1, 8, 18, 22, + 27, 46, 18, 64, 27, 84, 18, 106, 27, 7, 44, 21, 35, 49, 44, + 60, 36, 91, 44, 102, 36, 3, 53, 34, 61, 45, 53, 76, 61, 87, + 53, 118, 61, 3, 9, 32, 1, 41, 9, 70, 1, 80, 10, 108, 1, + 7, 18, 23, 27, 45, 18, 65, 27, 83, 18, 107, 27, 8, 44, 20, + 35, 50, 44, 61, 36, 92, 44, 103, 36, 4, 53, 35, 61, 46, 53, + 77, 61, 88, 53, 119, 61, 2, 9, 31, 1, 40, 9, 69, 1, 81, + 10, 107, 1, 6, 18, 24, 27, 44, 18, 66, 27, 82, 18, 108, 27, + 9, 44, 20, 36, 51, 44, 62, 36, 93, 44, 104, 36, 5, 53, 36, + 61, 47, 53, 78, 61, 89, 53, 119, 62, 1, 9, 30, 1, 40, 10, + 68, 1, 82, 10, 106, 1, 5, 18, 25, 27, 43, 18, 67, 27, 81, + 18, 109, 27, 10, 44, 21, 36, 52, 44, 63, 36, 94, 44, 105, 36, + 6, 53, 37, 61, 48, 53, 79, 61, 90, 53, 118, 62, 0, 9, 29, + 1, 41, 10, 67, 1, 83, 10, 105, 1, 4, 18, 26, 27, 42, 18, + 68, 27, 80, 18, 110, 27, 11, 44, 22, 36, 53, 44, 64, 36, 95, + 44, 106, 36, 7, 53, 38, 61, 49, 53, 79, 62, 91, 53, 117, 62, + 0, 10, 28, 1, 42, 10, 66, 1, 84, 10, 104, 1, 3, 18, 27, + 27, 41, 18, 69, 27, 80, 19, 111, 27, 12, 44, 23, 36, 54, 44, + 65, 36, 96, 44, 107, 36, 8, 53, 39, 61, 50, 53, 78, 62, 92, + 53, 116, 62, 1, 10, 27, 1, 43, 10, 65, 1, 85, 10, 103, 1, + 2, 18, 28, 27, 40, 18, 70, 27, 81, 19, 112, 27, 13, 44, 24, + 36, 55, 44, 66, 36, 97, 44, 108, 36, 9, 53, 39, 62, 51, 53, + 77, 62, 93, 53, 115, 62, 2, 10, 26, 1, 44, 10, 64, 1, 86, + 10, 102, 1, 1, 18, 29, 27, 40, 19, 71, 27, 82, 19, 113, 27, + 14, 44, 25, 36, 56, 44, 67, 36, 98, 44, 109, 36, 10, 53, 38, + 62, 52, 53, 76, 62, 94, 53, 114, 62, 3, 10, 25, 1, 45, 10, + 63, 1, 87, 10, 101, 1, 0, 18, 30, 27, 41, 19, 72, 27, 83, + 19, 114, 27, 15, 44, 26, 36, 57, 44, 68, 36, 99, 44, 110, 36, + 11, 53, 37, 62, 53, 53, 75, 62, 95, 53, 113, 62, 4, 10, 24, + 1, 46, 10, 62, 1, 88, 10, 100, 1, 0, 19, 31, 27, 42, 19, + 73, 27, 84, 19, 115, 27, 16, 44, 27, 36, 58, 44, 69, 36, 99, + 45, 111, 36, 12, 53, 36, 62, 54, 53, 74, 62, 96, 53, 112, 62, + 5, 10, 23, 1, 47, 10, 61, 1, 89, 10, 100, 2, 1, 19, 32, + 27, 43, 19, 74, 27, 85, 19, 116, 27, 17, 44, 28, 36, 59, 44, + 70, 36, 98, 45, 112, 36, 13, 53, 35, 62, 55, 53, 73, 62, 97, + 53, 111, 62, 6, 10, 22, 1, 48, 10, 60, 1, 90, 10, 101, 2, + 2, 19, 33, 27, 44, 19, 75, 27, 86, 19, 117, 27, 18, 44, 29, + 36, 59, 45, 71, 36, 97, 45, 113, 36, 14, 53, 34, 62, 56, 53, + 72, 62, 98, 53, 110, 62, 7, 10, 21, 1, 49, 10, 60, 2, 91, + 10, 102, 2, 3, 19, 34, 27, 45, 19, 76, 27, 87, 19, 118, 27, + 19, 44, 30, 36, 58, 45, 72, 36, 96, 45, 114, 36, 15, 53, 33, + 62, 57, 53, 71, 62, 99, 53, 109, 62, 8, 10, 20, 1, 50, 10, + 61, 2, 92, 10, 103, 2, 4, 19, 35, 27, 46, 19, 77, 27, 88, + 19, 119, 27, 19, 45, 31, 36, 57, 45, 73, 36, 95, 45, 115, 36, + 16, 53, 32, 62, 58, 53, 70, 62, 99, 54, 108, 62, 9, 10, 20, + 2, 51, 10, 62, 2, 93, 10, 104, 2, 5, 19, 36, 27, 47, 19, + 78, 27, 89, 19, 119, 28, 18, 45, 32, 36, 56, 45, 74, 36, 94, + 45, 116, 36, 17, 53, 31, 62, 59, 53, 69, 62, 98, 54, 107, 62, + 10, 10, 21, 2, 52, 10, 63, 2, 94, 10, 105, 2, 6, 19, 37, + 27, 48, 19, 79, 27, 90, 19, 118, 28, 17, 45, 33, 36, 55, 45, + 75, 36, 93, 45, 117, 36, 18, 53, 30, 62, 59, 54, 68, 62, 97, + 54, 106, 62, 11, 10, 22, 2, 53, 10, 64, 2, 95, 10, 106, 2, + 7, 19, 38, 27, 49, 19, 79, 28, 91, 19, 117, 28, 16, 45, 34, + 36, 54, 45, 76, 36, 92, 45, 118, 36, 19, 53, 29, 62, 58, 54, + 67, 62, 96, 54, 105, 62, 12, 10, 23, 2, 54, 10, 65, 2, 96, + 10, 107, 2, 8, 19, 39, 27, 50, 19, 78, 28, 92, 19, 116, 28, + 15, 45, 35, 36, 53, 45, 77, 36, 91, 45, 119, 36, 19, 54, 28, + 62, 57, 54, 66, 62, 95, 54, 104, 62, 13, 10, 24, 2, 55, 10, + 66, 2, 97, 10, 108, 2, 9, 19, 39, 28, 51, 19, 77, 28, 93, + 19, 115, 28, 14, 45, 36, 36, 52, 45, 78, 36, 90, 45, 119, 37, + 18, 54, 27, 62, 56, 54, 65, 62, 94, 54, 103, 62, 14, 10, 25, + 2, 56, 10, 67, 2, 98, 10, 109, 2, 10, 19, 38, 28, 52, 19, + 76, 28, 94, 19, 114, 28, 13, 45, 37, 36, 51, 45, 79, 36, 89, + 45, 118, 37, 17, 54, 26, 62, 55, 54, 64, 62, 93, 54, 102, 62, + 15, 10, 26, 2, 57, 10, 68, 2, 99, 10, 110, 2, 11, 19, 37, + 28, 53, 19, 75, 28, 95, 19, 113, 28, 12, 45, 38, 36, 50, 45, + 79, 37, 88, 45, 117, 37, 16, 54, 25, 62, 54, 54, 63, 62, 92, + 54, 101, 62, 16, 10, 27, 2, 58, 10, 69, 2, 99, 11, 111, 2, + 12, 19, 36, 28, 54, 19, 74, 28, 96, 19, 112, 28, 11, 45, 39, + 36, 49, 45, 78, 37, 87, 45, 116, 37, 15, 54, 24, 62, 53, 54, + 62, 62, 91, 54, 100, 62, 17, 10, 28, 2, 59, 10, 70, 2, 98, + 11, 112, 2, 13, 19, 35, 28, 55, 19, 73, 28, 97, 19, 111, 28, + 10, 45, 39, 37, 48, 45, 77, 37, 86, 45, 115, 37, 14, 54, 23, + 62, 52, 54, 61, 62, 90, 54, 100, 63, 18, 10, 29, 2, 59, 11, + 71, 2, 97, 11, 113, 2, 14, 19, 34, 28, 56, 19, 72, 28, 98, + 19, 110, 28, 9, 45, 38, 37, 47, 45, 76, 37, 85, 45, 114, 37, + 13, 54, 22, 62, 51, 54, 60, 62, 89, 54, 101, 63, 19, 10, 30, + 2, 58, 11, 72, 2, 96, 11, 114, 2, 15, 19, 33, 28, 57, 19, + 71, 28, 99, 19, 109, 28, 8, 45, 37, 37, 46, 45, 75, 37, 84, + 45, 113, 37, 12, 54, 21, 62, 50, 54, 60, 63, 88, 54, 102, 63, + 19, 11, 31, 2, 57, 11, 73, 2, 95, 11, 115, 2, 16, 19, 32, + 28, 58, 19, 70, 28, 99, 20, 108, 28, 7, 45, 36, 37, 45, 45, + 74, 37, 83, 45, 112, 37, 11, 54, 20, 62, 49, 54, 61, 63, 87, + 54, 103, 63, 18, 11, 32, 2, 56, 11, 74, 2, 94, 11, 116, 2, + 17, 19, 31, 28, 59, 19, 69, 28, 98, 20, 107, 28, 6, 45, 35, + 37, 44, 45, 73, 37, 82, 45, 111, 37, 10, 54, 20, 63, 48, 54, + 62, 63, 86, 54, 104, 63, 17, 11, 33, 2, 55, 11, 75, 2, 93, + 11, 117, 2, 18, 19, 30, 28, 59, 20, 68, 28, 97, 20, 106, 28, + 5, 45, 34, 37, 43, 45, 72, 37, 81, 45, 110, 37, 9, 54, 21, + 63, 47, 54, 63, 63, 85, 54, 105, 63, 16, 11, 34, 2, 54, 11, + 76, 2, 92, 11, 118, 2, 19, 19, 29, 28, 58, 20, 67, 28, 96, + 20, 105, 28, 4, 45, 33, 37, 42, 45, 71, 37, 80, 45, 109, 37, + 8, 54, 22, 63, 46, 54, 64, 63, 84, 54, 106, 63, 15, 11, 35, + 2, 53, 11, 77, 2, 91, 11, 119, 2, 19, 20, 28, 28, 57, 20, + 66, 28, 95, 20, 104, 28, 3, 45, 32, 37, 41, 45, 70, 37, 80, + 46, 108, 37, 7, 54, 23, 63, 45, 54, 65, 63, 83, 54, 107, 63, + 14, 11, 36, 2, 52, 11, 78, 2, 90, 11, 119, 3, 18, 20, 27, + 28, 56, 20, 65, 28, 94, 20, 103, 28, 2, 45, 31, 37, 40, 45, + 69, 37, 81, 46, 107, 37, 6, 54, 24, 63, 44, 54, 66, 63, 82, + 54, 108, 63, 13, 11, 37, 2, 51, 11, 79, 2, 89, 11, 118, 3, + 17, 20, 26, 28, 55, 20, 64, 28, 93, 20, 102, 28, 1, 45, 30, + 37, 40, 46, 68, 37, 82, 46, 106, 37, 5, 54, 25, 63, 43, 54, + 67, 63, 81, 54, 109, 63, 12, 11, 38, 2, 50, 11, 79, 3, 88, + 11, 117, 3, 16, 20, 25, 28, 54, 20, 63, 28, 92, 20, 101, 28, + 0, 45, 29, 37, 41, 46, 67, 37, 83, 46, 105, 37, 4, 54, 26, + 63, 42, 54, 68, 63, 80, 54, 110, 63, 11, 11, 39, 2, 49, 11, + 78, 3, 87, 11, 116, 3, 15, 20, 24, 28, 53, 20, 62, 28, 91, + 20, 100, 28, 0, 46, 28, 37, 42, 46, 66, 37, 84, 46, 104, 37, + 3, 54, 27, 63, 41, 54, 69, 63, 80, 55, 111, 63, 10, 11, 39, + 3, 48, 11, 77, 3, 86, 11, 115, 3, 14, 20, 23, 28, 52, 20, + 61, 28, 90, 20, 100, 29, 1, 46, 27, 37, 43, 46, 65, 37, 85, + 46, 103, 37, 2, 54, 28, 63, 40, 54, 70, 63, 81, 55, 112, 63, + 9, 11, 38, 3, 47, 11, 76, 3, 85, 11, 114, 3, 13, 20, 22, + 28, 51, 20, 60, 28, 89, 20, 101, 29, 2, 46, 26, 37, 44, 46, + 64, 37, 86, 46, 102, 37, 1, 54, 29, 63, 40, 55, 71, 63, 82, + 55, 113, 63, 8, 11, 37, 3, 46, 11, 75, 3, 84, 11, 113, 3, + 12, 20, 21, 28, 50, 20, 60, 29, 88, 20, 102, 29, 3, 46, 25, + 37, 45, 46, 63, 37, 87, 46, 101, 37, 0, 54, 30, 63, 41, 55, + 72, 63, 83, 55, 114, 63, 7, 11, 36, 3, 45, 11, 74, 3, 83, + 11, 112, 3, 11, 20, 20, 28, 49, 20, 61, 29, 87, 20, 103, 29, + 4, 46, 24, 37, 46, 46, 62, 37, 88, 46, 100, 37, 0, 55, 31, + 63, 42, 55, 73, 63, 84, 55, 115, 63, 6, 11, 35, 3, 44, 11, + 73, 3, 82, 11, 111, 3, 10, 20, 20, 29, 48, 20, 62, 29, 86, + 20, 104, 29, 5, 46, 23, 37, 47, 46, 61, 37, 89, 46, 100, 38, + 1, 55, 32, 63, 43, 55, 74, 63, 85, 55, 116, 63, 5, 11, 34, + 3, 43, 11, 72, 3, 81, 11, 110, 3, 9, 20, 21, 29, 47, 20, + 63, 29, 85, 20, 105, 29, 6, 46, 22, 37, 48, 46, 60, 37, 90, + 46, 101, 38, 2, 55, 33, 63, 44, 55, 75, 63, 86, 55, 117, 63, + 4, 11, 33, 3, 42, 11, 71, 3, 80, 11, 109, 3, 8, 20, 22, + 29, 46, 20, 64, 29, 84, 20, 106, 29, 7, 46, 21, 37, 49, 46, + 60, 38, 91, 46, 102, 38, 3, 55, 34, 63, 45, 55, 76, 63, 87, + 55, 118, 63, 3, 11, 32, 3, 41, 11, 70, 3, 80, 12, 108, 3, + 7, 20, 23, 29, 45, 20, 65, 29, 83, 20, 107, 29, 8, 46, 20, + 37, 50, 46, 61, 38, 92, 46, 103, 38, 4, 55, 35, 63, 46, 55, + 77, 63, 88, 55, 119, 63, 2, 11, 31, 3, 40, 11, 69, 3, 81, + 12, 107, 3, 6, 20, 24, 29, 44, 20, 66, 29, 82, 20, 108, 29, + 9, 46, 20, 38, 51, 46, 62, 38, 93, 46, 104, 38, 5, 55, 36, + 63, 47, 55, 78, 63, 89, 55, 119, 64, 1, 11, 30, 3, 40, 12, + 68, 3, 82, 12, 106, 3, 5, 20, 25, 29, 43, 20, 67, 29, 81, + 20, 109, 29, 10, 46, 21, 38, 52, 46, 63, 38, 94, 46, 105, 38, + 6, 55, 37, 63, 48, 55, 79, 63, 90, 55, 118, 64, 0, 11, 29, + 3, 41, 12, 67, 3, 83, 12, 105, 3, 4, 20, 26, 29, 42, 20, + 68, 29, 80, 20, 110, 29, 11, 46, 22, 38, 53, 46, 64, 38, 95, + 46, 106, 38, 7, 55, 38, 63, 49, 55, 79, 64, 91, 55, 117, 64, + 0, 12, 28, 3, 42, 12, 66, 3, 84, 12, 104, 3, 3, 20, 27, + 29, 41, 20, 69, 29, 80, 21, 111, 29, 12, 46, 23, 38, 54, 46, + 65, 38, 96, 46, 107, 38, 8, 55, 39, 63, 50, 55, 78, 64, 92, + 55, 116, 64, 1, 12, 27, 3, 43, 12, 65, 3, 85, 12, 103, 3, + 2, 20, 28, 29, 40, 20, 70, 29, 81, 21, 112, 29, 13, 46, 24, + 38, 55, 46, 66, 38, 97, 46, 108, 38, 9, 55, 39, 64, 51, 55, + 77, 64, 93, 55, 115, 64, 2, 12, 26, 3, 44, 12, 64, 3, 86, + 12, 102, 3, 1, 20, 29, 29, 40, 21, 71, 29, 82, 21, 113, 29, + 14, 46, 25, 38, 56, 46, 67, 38, 98, 46, 109, 38, 10, 55, 38, + 64, 52, 55, 76, 64, 94, 55, 114, 64, 3, 12, 25, 3, 45, 12, + 63, 3, 87, 12, 101, 3, 0, 20, 30, 29, 41, 21, 72, 29, 83, + 21, 114, 29, 15, 46, 26, 38, 57, 46, 68, 38, 99, 46, 110, 38, + 11, 55, 37, 64, 53, 55, 75, 64, 95, 55, 113, 64, 4, 12, 24, + 3, 46, 12, 62, 3, 88, 12, 100, 3, 0, 21, 31, 29, 42, 21, + 73, 29, 84, 21, 115, 29, 16, 46, 27, 38, 58, 46, 69, 38, 99, + 47, 111, 38, 12, 55, 36, 64, 54, 55, 74, 64, 96, 55, 112, 64, + 5, 12, 23, 3, 47, 12, 61, 3, 89, 12, 100, 4, 1, 21, 32, + 29, 43, 21, 74, 29, 85, 21, 116, 29, 17, 46, 28, 38, 59, 46, + 70, 38, 98, 47, 112, 38, 13, 55, 35, 64, 55, 55, 73, 64, 97, + 55, 111, 64, 6, 12, 22, 3, 48, 12, 60, 3, 90, 12, 101, 4, + 2, 21, 33, 29, 44, 21, 75, 29, 86, 21, 117, 29, 18, 46, 29, + 38, 59, 47, 71, 38, 97, 47, 113, 38, 14, 55, 34, 64, 56, 55, + 72, 64, 98, 55, 110, 64, 7, 12, 21, 3, 49, 12, 60, 4, 91, + 12, 102, 4, 3, 21, 34, 29, 45, 21, 76, 29, 87, 21, 118, 29, + 19, 46, 30, 38, 58, 47, 72, 38, 96, 47, 114, 38, 15, 55, 33, + 64, 57, 55, 71, 64, 99, 55, 109, 64, 8, 12, 20, 3, 50, 12, + 61, 4, 92, 12, 103, 4, 4, 21, 35, 29, 46, 21, 77, 29, 88, + 21, 119, 29, 19, 47, 31, 38, 57, 47, 73, 38, 95, 47, 115, 38, + 16, 55, 32, 64, 58, 55, 70, 64, 99, 56, 108, 64, 9, 12, 20, + 4, 51, 12, 62, 4, 93, 12, 104, 4, 5, 21, 36, 29, 47, 21, + 78, 29, 89, 21, 119, 30, 18, 47, 32, 38, 56, 47, 74, 38, 94, + 47, 116, 38, 17, 55, 31, 64, 59, 55, 69, 64, 98, 56, 107, 64, + 10, 12, 21, 4, 52, 12, 63, 4, 94, 12, 105, 4, 6, 21, 37, + 29, 48, 21, 79, 29, 90, 21, 118, 30, 17, 47, 33, 38, 55, 47, + 75, 38, 93, 47, 117, 38, 18, 55, 30, 64, 59, 56, 68, 64, 97, + 56, 106, 64, 11, 12, 22, 4, 53, 12, 64, 4, 95, 12, 106, 4, + 7, 21, 38, 29, 49, 21, 79, 30, 91, 21, 117, 30, 16, 47, 34, + 38, 54, 47, 76, 38, 92, 47, 118, 38, 19, 55, 29, 64, 58, 56, + 67, 64, 96, 56, 105, 64, 12, 12, 23, 4, 54, 12, 65, 4, 96, + 12, 107, 4, 8, 21, 39, 29, 50, 21, 78, 30, 92, 21, 116, 30, + 15, 47, 35, 38, 53, 47, 77, 38, 91, 47, 119, 38, 19, 56, 28, + 64, 57, 56, 66, 64, 95, 56, 104, 64, 13, 12, 24, 4, 55, 12, + 66, 4, 97, 12, 108, 4, 9, 21, 39, 30, 51, 21, 77, 30, 93, + 21, 115, 30, 14, 47, 36, 38, 52, 47, 78, 38, 90, 47, 119, 39, + 18, 56, 27, 64, 56, 56, 65, 64, 94, 56, 103, 64, 14, 12, 25, + 4, 56, 12, 67, 4, 98, 12, 109, 4, 10, 21, 38, 30, 52, 21, + 76, 30, 94, 21, 114, 30, 13, 47, 37, 38, 51, 47, 79, 38, 89, + 47, 118, 39, 17, 56, 26, 64, 55, 56, 64, 64, 93, 56, 102, 64, + 15, 12, 26, 4, 57, 12, 68, 4, 99, 12, 110, 4, 11, 21, 37, + 30, 53, 21, 75, 30, 95, 21, 113, 30, 12, 47, 38, 38, 50, 47, + 79, 39, 88, 47, 117, 39, 16, 56, 25, 64, 54, 56, 63, 64, 92, + 56, 101, 64, 16, 12, 27, 4, 58, 12, 69, 4, 99, 13, 111, 4, + 12, 21, 36, 30, 54, 21, 74, 30, 96, 21, 112, 30, 11, 47, 39, + 38, 49, 47, 78, 39, 87, 47, 116, 39, 15, 56, 24, 64, 53, 56, + 62, 64, 91, 56, 100, 64, 17, 12, 28, 4, 59, 12, 70, 4, 98, + 13, 112, 4, 13, 21, 35, 30, 55, 21, 73, 30, 97, 21, 111, 30, + 10, 47, 39, 39, 48, 47, 77, 39, 86, 47, 115, 39, 14, 56, 23, + 64, 52, 56, 61, 64, 90, 56, 100, 65, 18, 12, 29, 4, 59, 13, + 71, 4, 97, 13, 113, 4, 14, 21, 34, 30, 56, 21, 72, 30, 98, + 21, 110, 30, 9, 47, 38, 39, 47, 47, 76, 39, 85, 47, 114, 39, + 13, 56, 22, 64, 51, 56, 60, 64, 89, 56, 101, 65, 19, 12, 30, + 4, 58, 13, 72, 4, 96, 13, 114, 4, 15, 21, 33, 30, 57, 21, + 71, 30, 99, 21, 109, 30, 8, 47, 37, 39, 46, 47, 75, 39, 84, + 47, 113, 39, 12, 56, 21, 64, 50, 56, 60, 65, 88, 56, 102, 65, + 19, 13, 31, 4, 57, 13, 73, 4, 95, 13, 115, 4, 16, 21, 32, + 30, 58, 21, 70, 30, 99, 22, 108, 30, 7, 47, 36, 39, 45, 47, + 74, 39, 83, 47, 112, 39, 11, 56, 20, 64, 49, 56, 61, 65, 87, + 56, 103, 65, 18, 13, 32, 4, 56, 13, 74, 4, 94, 13, 116, 4, + 17, 21, 31, 30, 59, 21, 69, 30, 98, 22, 107, 30, 6, 47, 35, + 39, 44, 47, 73, 39, 82, 47, 111, 39, 10, 56, 20, 65, 48, 56, + 62, 65, 86, 56, 104, 65, 17, 13, 33, 4, 55, 13, 75, 4, 93, + 13, 117, 4, 18, 21, 30, 30, 59, 22, 68, 30, 97, 22, 106, 30, + 5, 47, 34, 39, 43, 47, 72, 39, 81, 47, 110, 39, 9, 56, 21, + 65, 47, 56, 63, 65, 85, 56, 105, 65, 16, 13, 34, 4, 54, 13, + 76, 4, 92, 13, 118, 4, 19, 21, 29, 30, 58, 22, 67, 30, 96, + 22, 105, 30, 4, 47, 33, 39, 42, 47, 71, 39, 80, 47, 109, 39, + 8, 56, 22, 65, 46, 56, 64, 65, 84, 56, 106, 65, 15, 13, 35, + 4, 53, 13, 77, 4, 91, 13, 119, 4, 19, 22, 28, 30, 57, 22, + 66, 30, 95, 22, 104, 30, 3, 47, 32, 39, 41, 47, 70, 39, 80, + 48, 108, 39, 7, 56, 23, 65, 45, 56, 65, 65, 83, 56, 107, 65, + 14, 13, 36, 4, 52, 13, 78, 4, 90, 13, 119, 5, 18, 22, 27, + 30, 56, 22, 65, 30, 94, 22, 103, 30, 2, 47, 31, 39, 40, 47, + 69, 39, 81, 48, 107, 39, 6, 56, 24, 65, 44, 56, 66, 65, 82, + 56, 108, 65, 13, 13, 37, 4, 51, 13, 79, 4, 89, 13, 118, 5, + 17, 22, 26, 30, 55, 22, 64, 30, 93, 22, 102, 30, 1, 47, 30, + 39, 40, 48, 68, 39, 82, 48, 106, 39, 5, 56, 25, 65, 43, 56, + 67, 65, 81, 56, 109, 65, 12, 13, 38, 4, 50, 13, 79, 5, 88, + 13, 117, 5, 16, 22, 25, 30, 54, 22, 63, 30, 92, 22, 101, 30, + 0, 47, 29, 39, 41, 48, 67, 39, 83, 48, 105, 39, 4, 56, 26, + 65, 42, 56, 68, 65, 80, 56, 110, 65, 11, 13, 39, 4, 49, 13, + 78, 5, 87, 13, 116, 5, 15, 22, 24, 30, 53, 22, 62, 30, 91, + 22, 100, 30, 0, 48, 28, 39, 42, 48, 66, 39, 84, 48, 104, 39, + 3, 56, 27, 65, 41, 56, 69, 65, 80, 57, 111, 65, 10, 13, 39, + 5, 48, 13, 77, 5, 86, 13, 115, 5, 14, 22, 23, 30, 52, 22, + 61, 30, 90, 22, 100, 31, 1, 48, 27, 39, 43, 48, 65, 39, 85, + 48, 103, 39, 2, 56, 28, 65, 40, 56, 70, 65, 81, 57, 112, 65, + 9, 13, 38, 5, 47, 13, 76, 5, 85, 13, 114, 5, 13, 22, 22, + 30, 51, 22, 60, 30, 89, 22, 101, 31, 2, 48, 26, 39, 44, 48, + 64, 39, 86, 48, 102, 39, 1, 56, 29, 65, 40, 57, 71, 65, 82, + 57, 113, 65, 8, 13, 37, 5, 46, 13, 75, 5, 84, 13, 113, 5, + 12, 22, 21, 30, 50, 22, 60, 31, 88, 22, 102, 31, 3, 48, 25, + 39, 45, 48, 63, 39, 87, 48, 101, 39, 0, 56, 30, 65, 41, 57, + 72, 65, 83, 57, 114, 65, 7, 13, 36, 5, 45, 13, 74, 5, 83, + 13, 112, 5, 11, 22, 20, 30, 49, 22, 61, 31, 87, 22, 103, 31, + 4, 48, 24, 39, 46, 48, 62, 39, 88, 48, 100, 39, 0, 57, 31, + 65, 42, 57, 73, 65, 84, 57, 115, 65, 6, 13, 35, 5, 44, 13, + 73, 5, 82, 13, 111, 5, 10, 22, 20, 31, 48, 22, 62, 31, 86, + 22, 104, 31, 5, 48, 23, 39, 47, 48, 61, 39, 89, 48, 100, 40, + 1, 57, 32, 65, 43, 57, 74, 65, 85, 57, 116, 65, 5, 13, 34, + 5, 43, 13, 72, 5, 81, 13, 110, 5, 9, 22, 21, 31, 47, 22, + 63, 31, 85, 22, 105, 31, 6, 48, 22, 39, 48, 48, 60, 39, 90, + 48, 101, 40, 2, 57, 33, 65, 44, 57, 75, 65, 86, 57, 117, 65, + 4, 13, 33, 5, 42, 13, 71, 5, 80, 13, 109, 5, 8, 22, 22, + 31, 46, 22, 64, 31, 84, 22, 106, 31, 7, 48, 21, 39, 49, 48, + 60, 40, 91, 48, 102, 40, 3, 57, 34, 65, 45, 57, 76, 65, 87, + 57, 118, 65, 3, 13, 32, 5, 41, 13, 70, 5, 80, 14, 108, 5, + 7, 22, 23, 31, 45, 22, 65, 31, 83, 22, 107, 31, 8, 48, 20, + 39, 50, 48, 61, 40, 92, 48, 103, 40, 4, 57, 35, 65, 46, 57, + 77, 65, 88, 57, 119, 65, 2, 13, 31, 5, 40, 13, 69, 5, 81, + 14, 107, 5, 6, 22, 24, 31, 44, 22, 66, 31, 82, 22, 108, 31, + 9, 48, 20, 40, 51, 48, 62, 40, 93, 48, 104, 40, 5, 57, 36, + 65, 47, 57, 78, 65, 89, 57, 119, 66, 1, 13, 30, 5, 40, 14, + 68, 5, 82, 14, 106, 5, 5, 22, 25, 31, 43, 22, 67, 31, 81, + 22, 109, 31, 10, 48, 21, 40, 52, 48, 63, 40, 94, 48, 105, 40, + 6, 57, 37, 65, 48, 57, 79, 65, 90, 57, 118, 66, 0, 13, 29, + 5, 41, 14, 67, 5, 83, 14, 105, 5, 4, 22, 26, 31, 42, 22, + 68, 31, 80, 22, 110, 31, 11, 48, 22, 40, 53, 48, 64, 40, 95, + 48, 106, 40, 7, 57, 38, 65, 49, 57, 79, 66, 91, 57, 117, 66, + 0, 14, 28, 5, 42, 14, 66, 5, 84, 14, 104, 5, 3, 22, 27, + 31, 41, 22, 69, 31, 80, 23, 111, 31, 12, 48, 23, 40, 54, 48, + 65, 40, 96, 48, 107, 40, 8, 57, 39, 65, 50, 57, 78, 66, 92, + 57, 116, 66, 1, 14, 27, 5, 43, 14, 65, 5, 85, 14, 103, 5, + 2, 22, 28, 31, 40, 22, 70, 31, 81, 23, 112, 31, 13, 48, 24, + 40, 55, 48, 66, 40, 97, 48, 108, 40, 9, 57, 39, 66, 51, 57, + 77, 66, 93, 57, 115, 66, 2, 14, 26, 5, 44, 14, 64, 5, 86, + 14, 102, 5, 1, 22, 29, 31, 40, 23, 71, 31, 82, 23, 113, 31, + 14, 48, 25, 40, 56, 48, 67, 40, 98, 48, 109, 40, 10, 57, 38, + 66, 52, 57, 76, 66, 94, 57, 114, 66, 3, 14, 25, 5, 45, 14, + 63, 5, 87, 14, 101, 5, 0, 22, 30, 31, 41, 23, 72, 31, 83, + 23, 114, 31, 15, 48, 26, 40, 57, 48, 68, 40, 99, 48, 110, 40, + 11, 57, 37, 66, 53, 57, 75, 66, 95, 57, 113, 66, 4, 14, 24, + 5, 46, 14, 62, 5, 88, 14, 100, 5, 0, 23, 31, 31, 42, 23, + 73, 31, 84, 23, 115, 31, 16, 48, 27, 40, 58, 48, 69, 40, 99, + 49, 111, 40, 12, 57, 36, 66, 54, 57, 74, 66, 96, 57, 112, 66, + 5, 14, 23, 5, 47, 14, 61, 5, 89, 14, 100, 6, 1, 23, 32, + 31, 43, 23, 74, 31, 85, 23, 116, 31, 17, 48, 28, 40, 59, 48, + 70, 40, 98, 49, 112, 40, 13, 57, 35, 66, 55, 57, 73, 66, 97, + 57, 111, 66, 6, 14, 22, 5, 48, 14, 60, 5, 90, 14, 101, 6, + 2, 23, 33, 31, 44, 23, 75, 31, 86, 23, 117, 31, 18, 48, 29, + 40, 59, 49, 71, 40, 97, 49, 113, 40, 14, 57, 34, 66, 56, 57, + 72, 66, 98, 57, 110, 66, 7, 14, 21, 5, 49, 14, 60, 6, 91, + 14, 102, 6, 3, 23, 34, 31, 45, 23, 76, 31, 87, 23, 118, 31, + 19, 48, 30, 40, 58, 49, 72, 40, 96, 49, 114, 40, 15, 57, 33, + 66, 57, 57, 71, 66, 99, 57, 109, 66, 8, 14, 20, 5, 50, 14, + 61, 6, 92, 14, 103, 6, 4, 23, 35, 31, 46, 23, 77, 31, 88, + 23, 119, 31, 19, 49, 31, 40, 57, 49, 73, 40, 95, 49, 115, 40, + 16, 57, 32, 66, 58, 57, 70, 66, 99, 58, 108, 66, 9, 14, 20, + 6, 51, 14, 62, 6, 93, 14, 104, 6, 5, 23, 36, 31, 47, 23, + 78, 31, 89, 23, 119, 32, 18, 49, 32, 40, 56, 49, 74, 40, 94, + 49, 116, 40, 17, 57, 31, 66, 59, 57, 69, 66, 98, 58, 107, 66, + 10, 14, 21, 6, 52, 14, 63, 6, 94, 14, 105, 6, 6, 23, 37, + 31, 48, 23, 79, 31, 90, 23, 118, 32, 17, 49, 33, 40, 55, 49, + 75, 40, 93, 49, 117, 40, 18, 57, 30, 66, 59, 58, 68, 66, 97, + 58, 106, 66, 11, 14, 22, 6, 53, 14, 64, 6, 95, 14, 106, 6, + 7, 23, 38, 31, 49, 23, 79, 32, 91, 23, 117, 32, 16, 49, 34, + 40, 54, 49, 76, 40, 92, 49, 118, 40, 19, 57, 29, 66, 58, 58, + 67, 66, 96, 58, 105, 66, 12, 14, 23, 6, 54, 14, 65, 6, 96, + 14, 107, 6, 8, 23, 39, 31, 50, 23, 78, 32, 92, 23, 116, 32, + 15, 49, 35, 40, 53, 49, 77, 40, 91, 49, 119, 40, 19, 58, 28, + 66, 57, 58, 66, 66, 95, 58, 104, 66, 13, 14, 24, 6, 55, 14, + 66, 6, 97, 14, 108, 6, 9, 23, 39, 32, 51, 23, 77, 32, 93, + 23, 115, 32, 14, 49, 36, 40, 52, 49, 78, 40, 90, 49, 119, 41, + 18, 58, 27, 66, 56, 58, 65, 66, 94, 58, 103, 66, 14, 14, 25, + 6, 56, 14, 67, 6, 98, 14, 109, 6, 10, 23, 38, 32, 52, 23, + 76, 32, 94, 23, 114, 32, 13, 49, 37, 40, 51, 49, 79, 40, 89, + 49, 118, 41, 17, 58, 26, 66, 55, 58, 64, 66, 93, 58, 102, 66, + 15, 14, 26, 6, 57, 14, 68, 6, 99, 14, 110, 6, 11, 23, 37, + 32, 53, 23, 75, 32, 95, 23, 113, 32, 12, 49, 38, 40, 50, 49, + 79, 41, 88, 49, 117, 41, 16, 58, 25, 66, 54, 58, 63, 66, 92, + 58, 101, 66, 16, 14, 27, 6, 58, 14, 69, 6, 99, 15, 111, 6, + 12, 23, 36, 32, 54, 23, 74, 32, 96, 23, 112, 32, 11, 49, 39, + 40, 49, 49, 78, 41, 87, 49, 116, 41, 15, 58, 24, 66, 53, 58, + 62, 66, 91, 58, 100, 66, 17, 14, 28, 6, 59, 14, 70, 6, 98, + 15, 112, 6, 13, 23, 35, 32, 55, 23, 73, 32, 97, 23, 111, 32, + 10, 49, 39, 41, 48, 49, 77, 41, 86, 49, 115, 41, 14, 58, 23, + 66, 52, 58, 61, 66, 90, 58, 100, 67, 18, 14, 29, 6, 59, 15, + 71, 6, 97, 15, 113, 6, 14, 23, 34, 32, 56, 23, 72, 32, 98, + 23, 110, 32, 9, 49, 38, 41, 47, 49, 76, 41, 85, 49, 114, 41, + 13, 58, 22, 66, 51, 58, 60, 66, 89, 58, 101, 67, 19, 14, 30, + 6, 58, 15, 72, 6, 96, 15, 114, 6, 15, 23, 33, 32, 57, 23, + 71, 32, 99, 23, 109, 32, 8, 49, 37, 41, 46, 49, 75, 41, 84, + 49, 113, 41, 12, 58, 21, 66, 50, 58, 60, 67, 88, 58, 102, 67, + 19, 15, 31, 6, 57, 15, 73, 6, 95, 15, 115, 6, 16, 23, 32, + 32, 58, 23, 70, 32, 99, 24, 108, 32, 7, 49, 36, 41, 45, 49, + 74, 41, 83, 49, 112, 41, 11, 58, 20, 66, 49, 58, 61, 67, 87, + 58, 103, 67, 18, 15, 32, 6, 56, 15, 74, 6, 94, 15, 116, 6, + 17, 23, 31, 32, 59, 23, 69, 32, 98, 24, 107, 32, 6, 49, 35, + 41, 44, 49, 73, 41, 82, 49, 111, 41, 10, 58, 20, 67, 48, 58, + 62, 67, 86, 58, 104, 67, 17, 15, 33, 6, 55, 15, 75, 6, 93, + 15, 117, 6, 18, 23, 30, 32, 59, 24, 68, 32, 97, 24, 106, 32, + 5, 49, 34, 41, 43, 49, 72, 41, 81, 49, 110, 41, 9, 58, 21, + 67, 47, 58, 63, 67, 85, 58, 105, 67, 16, 15, 34, 6, 54, 15, + 76, 6, 92, 15, 118, 6, 19, 23, 29, 32, 58, 24, 67, 32, 96, + 24, 105, 32, 4, 49, 33, 41, 42, 49, 71, 41, 80, 49, 109, 41, + 8, 58, 22, 67, 46, 58, 64, 67, 84, 58, 106, 67, 15, 15, 35, + 6, 53, 15, 77, 6, 91, 15, 119, 6, 19, 24, 28, 32, 57, 24, + 66, 32, 95, 24, 104, 32, 3, 49, 32, 41, 41, 49, 70, 41, 80, + 50, 108, 41, 7, 58, 23, 67, 45, 58, 65, 67, 83, 58, 107, 67, + 14, 15, 36, 6, 52, 15, 78, 6, 90, 15, 119, 7, 18, 24, 27, + 32, 56, 24, 65, 32, 94, 24, 103, 32, 2, 49, 31, 41, 40, 49, + 69, 41, 81, 50, 107, 41, 6, 58, 24, 67, 44, 58, 66, 67, 82, + 58, 108, 67, 13, 15, 37, 6, 51, 15, 79, 6, 89, 15, 118, 7, + 17, 24, 26, 32, 55, 24, 64, 32, 93, 24, 102, 32, 1, 49, 30, + 41, 40, 50, 68, 41, 82, 50, 106, 41, 5, 58, 25, 67, 43, 58, + 67, 67, 81, 58, 109, 67, 12, 15, 38, 6, 50, 15, 79, 7, 88, + 15, 117, 7, 16, 24, 25, 32, 54, 24, 63, 32, 92, 24, 101, 32, + 0, 49, 29, 41, 41, 50, 67, 41, 83, 50, 105, 41, 4, 58, 26, + 67, 42, 58, 68, 67, 80, 58, 110, 67, 11, 15, 39, 6, 49, 15, + 78, 7, 87, 15, 116, 7, 15, 24, 24, 32, 53, 24, 62, 32, 91, + 24, 100, 32, 0, 50, 28, 41, 42, 50, 66, 41, 84, 50, 104, 41, + 3, 58, 27, 67, 41, 58, 69, 67, 80, 59, 111, 67, 10, 15, 39, + 7, 48, 15, 77, 7, 86, 15, 115, 7, 14, 24, 23, 32, 52, 24, + 61, 32, 90, 24, 100, 33, 1, 50, 27, 41, 43, 50, 65, 41, 85, + 50, 103, 41, 2, 58, 28, 67, 40, 58, 70, 67, 81, 59, 112, 67, + 9, 15, 38, 7, 47, 15, 76, 7, 85, 15, 114, 7, 13, 24, 22, + 32, 51, 24, 60, 32, 89, 24, 101, 33, 2, 50, 26, 41, 44, 50, + 64, 41, 86, 50, 102, 41, 1, 58, 29, 67, 40, 59, 71, 67, 82, + 59, 113, 67, 8, 15, 37, 7, 46, 15, 75, 7, 84, 15, 113, 7, + 12, 24, 21, 32, 50, 24, 60, 33, 88, 24, 102, 33, 3, 50, 25, + 41, 45, 50, 63, 41, 87, 50, 101, 41, 0, 58, 30, 67, 41, 59, + 72, 67, 83, 59, 114, 67, 7, 15, 36, 7, 45, 15, 74, 7, 83, + 15, 112, 7, 11, 24, 20, 32, 49, 24, 61, 33, 87, 24, 103, 33, + 4, 50, 24, 41, 46, 50, 62, 41, 88, 50, 100, 41, 0, 59, 31, + 67, 42, 59, 73, 67, 84, 59, 115, 67, 6, 15, 35, 7, 44, 15, + 73, 7, 82, 15, 111, 7, 10, 24, 20, 33, 48, 24, 62, 33, 86, + 24, 104, 33, 5, 50, 23, 41, 47, 50, 61, 41, 89, 50, 100, 42, + 1, 59, 32, 67, 43, 59, 74, 67, 85, 59, 116, 67, 5, 15, 34, + 7, 43, 15, 72, 7, 81, 15, 110, 7, 9, 24, 21, 33, 47, 24, + 63, 33, 85, 24, 105, 33, 6, 50, 22, 41, 48, 50, 60, 41, 90, + 50, 101, 42, 2, 59, 33, 67, 44, 59, 75, 67, 86, 59, 117, 67, + 4, 15, 33, 7, 42, 15, 71, 7, 80, 15, 109, 7, 8, 24, 22, + 33, 46, 24, 64, 33, 84, 24, 106, 33, 7, 50, 21, 41, 49, 50, + 60, 42, 91, 50, 102, 42, 3, 59, 34, 67, 45, 59, 76, 67, 87, + 59, 118, 67, 3, 15, 32, 7, 41, 15, 70, 7, 80, 16, 108, 7, + 7, 24, 23, 33, 45, 24, 65, 33, 83, 24, 107, 33, 8, 50, 20, + 41, 50, 50, 61, 42, 92, 50, 103, 42, 4, 59, 35, 67, 46, 59, + 77, 67, 88, 59, 119, 67, 2, 15, 31, 7, 40, 15, 69, 7, 81, + 16, 107, 7, 6, 24, 24, 33, 44, 24, 66, 33, 82, 24, 108, 33, + 9, 50, 20, 42, 51, 50, 62, 42, 93, 50, 104, 42, 5, 59, 36, + 67, 47, 59, 78, 67, 89, 59, 100, 51, 1, 15, 30, 7, 40, 16, + 68, 7, 82, 16, 106, 7, 5, 24, 25, 33, 43, 24, 67, 33, 81, + 24, 109, 33, 10, 50, 21, 42, 52, 50, 63, 42, 94, 50, 105, 42, + 6, 59, 37, 67, 48, 59, 79, 67, 90, 59, 101, 51, 0, 15, 29, + 7, 41, 16, 67, 7, 83, 16, 105, 7, 4, 24, 26, 33, 42, 24, + 68, 33, 80, 24, 110, 33, 11, 50, 22, 42, 53, 50, 64, 42, 95, + 50, 106, 42, 7, 59, 38, 67, 49, 59, 60, 51, 91, 59, 102, 51, + 0, 16, 28, 7, 42, 16, 66, 7, 84, 16, 104, 7, 3, 24, 27, + 33, 41, 24, 69, 33, 80, 25, 111, 33, 12, 50, 23, 42, 54, 50, + 65, 42, 96, 50, 107, 42, 8, 59, 39, 67, 50, 59, 61, 51, 92, + 59, 103, 51, 1, 16, 27, 7, 43, 16, 65, 7, 85, 16, 103, 7, + 2, 24, 28, 33, 40, 24, 70, 33, 81, 25, 112, 33, 13, 50, 24, + 42, 55, 50, 66, 42, 97, 50, 108, 42, 9, 59, 20, 51, 51, 59, + 62, 51, 93, 59, 104, 51, 2, 16, 26, 7, 44, 16, 64, 7, 86, + 16, 102, 7, 1, 24, 29, 33, 40, 25, 71, 33, 82, 25, 113, 33, + 14, 50, 25, 42, 56, 50, 67, 42, 98, 50, 109, 42, 10, 59, 21, + 51, 52, 59, 63, 51, 94, 59, 105, 51, 3, 16, 25, 7, 45, 16, + 63, 7, 87, 16, 101, 7, 0, 24, 30, 33, 41, 25, 72, 33, 83, + 25, 114, 33, 15, 50, 26, 42, 57, 50, 68, 42, 99, 50, 110, 42, + 11, 59, 22, 51, 53, 59, 64, 51, 95, 59, 106, 51, 4, 16, 24, + 7, 46, 16, 62, 7, 88, 16, 100, 7, 0, 25, 31, 33, 42, 25, + 73, 33, 84, 25, 115, 33, 16, 50, 27, 42, 58, 50, 69, 42, 80, + 34, 111, 42, 12, 59, 23, 51, 54, 59, 65, 51, 96, 59, 107, 51, + 5, 16, 23, 7, 47, 16, 61, 7, 89, 16, 100, 8, 1, 25, 32, + 33, 43, 25, 74, 33, 85, 25, 116, 33, 17, 50, 28, 42, 59, 50, + 70, 42, 81, 34, 112, 42, 13, 59, 24, 51, 55, 59, 66, 51, 97, + 59, 108, 51, 6, 16, 22, 7, 48, 16, 60, 7, 90, 16, 101, 8, + 2, 25, 33, 33, 44, 25, 75, 33, 86, 25, 117, 33, 18, 50, 29, + 42, 40, 34, 71, 42, 82, 34, 113, 42, 14, 59, 25, 51, 56, 59, + 67, 51, 98, 59, 109, 51, 7, 16, 21, 7, 49, 16, 60, 8, 91, + 16, 102, 8, 3, 25, 34, 33, 45, 25, 76, 33, 87, 25, 118, 33, + 19, 50, 30, 42, 41, 34, 72, 42, 83, 34, 114, 42, 15, 59, 26, + 51, 57, 59, 68, 51, 99, 59, 110, 51, 8, 16, 20, 7, 50, 16, + 61, 8, 92, 16, 103, 8, 4, 25, 35, 33, 46, 25, 77, 33, 88, + 25, 119, 33, 0, 34, 31, 42, 42, 34, 73, 42, 84, 34, 115, 42, + 16, 59, 27, 51, 58, 59, 69, 51, 99, 60, 111, 51, 9, 16, 20, + 8, 51, 16, 62, 8, 93, 16, 104, 8, 5, 25, 36, 33, 47, 25, + 78, 33, 89, 25, 100, 17, 1, 34, 32, 42, 43, 34, 74, 42, 85, + 34, 116, 42, 17, 59, 28, 51, 59, 59, 70, 51, 98, 60, 112, 51, + 10, 16, 21, 8, 52, 16, 63, 8, 94, 16, 105, 8, 6, 25, 37, + 33, 48, 25, 79, 33, 90, 25, 101, 17, 2, 34, 33, 42, 44, 34, + 75, 42, 86, 34, 117, 42, 18, 59, 29, 51, 59, 60, 71, 51, 97, + 60, 113, 51, 11, 16, 22, 8, 53, 16, 64, 8, 95, 16, 106, 8, + 7, 25, 38, 33, 49, 25, 60, 17, 91, 25, 102, 17, 3, 34, 34, + 42, 45, 34, 76, 42, 87, 34, 118, 42, 19, 59, 30, 51, 58, 60, + 72, 51, 96, 60, 114, 51, 12, 16, 23, 8, 54, 16, 65, 8, 96, + 16, 107, 8, 8, 25, 39, 33, 50, 25, 61, 17, 92, 25, 103, 17, + 4, 34, 35, 42, 46, 34, 77, 42, 88, 34, 119, 42, 19, 60, 31, + 51, 57, 60, 73, 51, 95, 60, 115, 51, 13, 16, 24, 8, 55, 16, + 66, 8, 97, 16, 108, 8, 9, 25, 20, 17, 51, 25, 62, 17, 93, + 25, 104, 17, 5, 34, 36, 42, 47, 34, 78, 42, 89, 34, 119, 43, + 18, 60, 32, 51, 56, 60, 74, 51, 94, 60, 116, 51, 14, 16, 25, + 8, 56, 16, 67, 8, 98, 16, 109, 8, 10, 25, 21, 17, 52, 25, + 63, 17, 94, 25, 105, 17, 6, 34, 37, 42, 48, 34, 79, 42, 90, + 34, 118, 43, 17, 60, 33, 51, 55, 60, 75, 51, 93, 60, 117, 51, + 15, 16, 26, 8, 57, 16, 68, 8, 99, 16, 110, 8, 11, 25, 22, + 17, 53, 25, 64, 17, 95, 25, 106, 17, 7, 34, 38, 42, 49, 34, + 79, 43, 91, 34, 117, 43, 16, 60, 34, 51, 54, 60, 76, 51, 92, + 60, 118, 51, 16, 16, 27, 8, 58, 16, 69, 8, 80, 0, 111, 8, + 12, 25, 23, 17, 54, 25, 65, 17, 96, 25, 107, 17, 8, 34, 39, + 42, 50, 34, 78, 43, 92, 34, 116, 43, 15, 60, 35, 51, 53, 60, + 77, 51, 91, 60, 119, 51, 17, 16, 28, 8, 59, 16, 70, 8, 81, + 0, 112, 8, 13, 25, 24, 17, 55, 25, 66, 17, 97, 25, 108, 17, + 9, 34, 39, 43, 51, 34, 77, 43, 93, 34, 115, 43, 14, 60, 36, + 51, 52, 60, 78, 51, 90, 60, 119, 52, 18, 16, 29, 8, 40, 0, + 71, 8, 82, 0, 113, 8, 14, 25, 25, 17, 56, 25, 67, 17, 98, + 25, 109, 17, 10, 34, 38, 43, 52, 34, 76, 43, 94, 34, 114, 43, + 13, 60, 37, 51, 51, 60, 79, 51, 89, 60, 118, 52, 19, 16, 30, + 8, 41, 0, 72, 8, 83, 0, 114, 8, 15, 25, 26, 17, 57, 25, + 68, 17, 99, 25, 110, 17, 11, 34, 37, 43, 53, 34, 75, 43, 95, + 34, 113, 43, 12, 60, 38, 51, 50, 60, 79, 52, 88, 60, 117, 52, + 0, 0, 0, 0, 0, 0, 0, 0, +}; + +static const uint8_t hq_tab_09[] = { + 0, 0, 10, 3, 18, 0, 24, 3, 36, 0, 1, 10, 14, 6, 19, + 10, 31, 7, 37, 10, 5, 13, 15, 16, 19, 13, 30, 17, 33, 13, + 4, 23, 8, 20, 18, 23, 26, 20, 32, 23, 4, 26, 9, 24, 22, + 26, 27, 24, 39, 27, 1, 0, 9, 3, 19, 0, 24, 4, 37, 0, + 2, 10, 15, 6, 20, 10, 30, 7, 38, 10, 4, 13, 15, 17, 18, + 13, 29, 17, 32, 13, 3, 23, 9, 20, 17, 23, 27, 20, 32, 18, + 5, 26, 10, 24, 23, 26, 28, 24, 38, 27, 2, 0, 8, 3, 20, + 0, 25, 4, 38, 0, 3, 10, 15, 7, 21, 10, 29, 7, 39, 10, + 3, 13, 14, 17, 17, 13, 28, 17, 32, 14, 2, 23, 10, 20, 16, + 23, 28, 20, 33, 18, 6, 26, 11, 24, 23, 27, 29, 24, 37, 27, + 3, 0, 8, 4, 21, 0, 26, 4, 39, 0, 4, 10, 14, 7, 22, + 10, 28, 7, 39, 11, 2, 13, 13, 17, 16, 13, 27, 17, 33, 14, + 1, 23, 11, 20, 16, 18, 29, 20, 34, 18, 7, 26, 12, 24, 22, + 27, 30, 24, 36, 27, 4, 0, 9, 4, 22, 0, 27, 4, 39, 1, + 5, 10, 13, 7, 23, 10, 27, 7, 38, 11, 1, 13, 12, 17, 16, + 14, 26, 17, 34, 14, 0, 23, 12, 20, 17, 18, 30, 20, 35, 18, + 7, 27, 13, 24, 21, 27, 31, 24, 35, 27, 5, 0, 10, 4, 23, + 0, 28, 4, 38, 1, 6, 10, 12, 7, 23, 11, 26, 7, 37, 11, + 0, 13, 11, 17, 17, 14, 25, 17, 35, 14, 0, 18, 13, 20, 18, + 18, 31, 20, 36, 18, 6, 27, 14, 24, 20, 27, 31, 25, 34, 27, + 6, 0, 11, 4, 23, 1, 29, 4, 37, 1, 7, 10, 11, 7, 22, + 11, 25, 7, 36, 11, 0, 14, 10, 17, 18, 14, 24, 17, 36, 14, + 1, 18, 14, 20, 19, 18, 31, 21, 37, 18, 5, 27, 15, 24, 19, + 27, 30, 25, 33, 27, 7, 0, 12, 4, 22, 1, 30, 4, 36, 1, + 7, 11, 10, 7, 21, 11, 24, 7, 35, 11, 1, 14, 9, 17, 19, + 14, 24, 12, 37, 14, 2, 18, 15, 20, 20, 18, 30, 21, 38, 18, + 4, 27, 15, 25, 18, 27, 29, 25, 32, 27, 7, 1, 13, 4, 21, + 1, 31, 4, 35, 1, 6, 11, 9, 7, 20, 11, 24, 8, 34, 11, + 2, 14, 8, 17, 20, 14, 25, 12, 38, 14, 3, 18, 15, 21, 21, + 18, 29, 21, 39, 18, 3, 27, 14, 25, 17, 27, 28, 25, 32, 28, + 6, 1, 14, 4, 20, 1, 31, 5, 34, 1, 5, 11, 8, 7, 19, + 11, 25, 8, 33, 11, 3, 14, 8, 12, 21, 14, 26, 12, 39, 14, + 4, 18, 14, 21, 22, 18, 28, 21, 39, 19, 2, 27, 13, 25, 16, + 27, 27, 25, 33, 28, 5, 1, 15, 4, 19, 1, 30, 5, 33, 1, + 4, 11, 8, 8, 18, 11, 26, 8, 32, 11, 4, 14, 9, 12, 22, + 14, 27, 12, 39, 15, 5, 18, 13, 21, 23, 18, 27, 21, 38, 19, + 1, 27, 12, 25, 16, 28, 26, 25, 34, 28, 4, 1, 15, 5, 18, + 1, 29, 5, 32, 1, 3, 11, 9, 8, 17, 11, 27, 8, 32, 6, + 5, 14, 10, 12, 23, 14, 28, 12, 38, 15, 6, 18, 12, 21, 23, + 19, 26, 21, 37, 19, 0, 27, 11, 25, 17, 28, 25, 25, 35, 28, + 3, 1, 14, 5, 17, 1, 28, 5, 32, 2, 2, 11, 10, 8, 16, + 11, 28, 8, 33, 6, 6, 14, 11, 12, 23, 15, 29, 12, 37, 15, + 7, 18, 11, 21, 22, 19, 25, 21, 36, 19, 0, 28, 10, 25, 18, + 28, 24, 25, 36, 28, 2, 1, 13, 5, 16, 1, 27, 5, 33, 2, + 1, 11, 11, 8, 16, 6, 29, 8, 34, 6, 7, 14, 12, 12, 22, + 15, 30, 12, 36, 15, 7, 19, 10, 21, 21, 19, 24, 21, 35, 19, + 1, 28, 9, 25, 19, 28, 24, 26, 37, 28, 1, 1, 12, 5, 16, + 2, 26, 5, 34, 2, 0, 11, 12, 8, 17, 6, 30, 8, 35, 6, + 7, 15, 13, 12, 21, 15, 31, 12, 35, 15, 6, 19, 9, 21, 20, + 19, 24, 22, 34, 19, 2, 28, 8, 25, 20, 28, 25, 26, 38, 28, + 0, 1, 11, 5, 17, 2, 25, 5, 35, 2, 0, 6, 13, 8, 18, + 6, 31, 8, 36, 6, 6, 15, 14, 12, 20, 15, 31, 13, 34, 15, + 5, 19, 8, 21, 19, 19, 25, 22, 33, 19, 3, 28, 8, 26, 21, + 28, 26, 26, 39, 28, 0, 2, 10, 5, 18, 2, 24, 5, 36, 2, + 1, 6, 14, 8, 19, 6, 31, 9, 37, 6, 5, 15, 15, 12, 19, + 15, 30, 13, 33, 15, 4, 19, 8, 22, 18, 19, 26, 22, 32, 19, + 4, 28, 9, 26, 22, 28, 27, 26, 39, 29, 1, 2, 9, 5, 19, + 2, 24, 0, 37, 2, 2, 6, 15, 8, 20, 6, 30, 9, 38, 6, + 4, 15, 15, 13, 18, 15, 29, 13, 32, 15, 3, 19, 9, 22, 17, + 19, 27, 22, 32, 20, 5, 28, 10, 26, 23, 28, 28, 26, 38, 29, + 2, 2, 8, 5, 20, 2, 25, 0, 38, 2, 3, 6, 15, 9, 21, + 6, 29, 9, 39, 6, 3, 15, 14, 13, 17, 15, 28, 13, 32, 16, + 2, 19, 10, 22, 16, 19, 28, 22, 33, 20, 6, 28, 11, 26, 23, + 29, 29, 26, 37, 29, 3, 2, 8, 0, 21, 2, 26, 0, 39, 2, + 4, 6, 14, 9, 22, 6, 28, 9, 39, 7, 2, 15, 13, 13, 16, + 15, 27, 13, 33, 16, 1, 19, 11, 22, 16, 20, 29, 22, 34, 20, + 7, 28, 12, 26, 22, 29, 30, 26, 36, 29, 4, 2, 9, 0, 22, + 2, 27, 0, 39, 3, 5, 6, 13, 9, 23, 6, 27, 9, 38, 7, + 1, 15, 12, 13, 16, 16, 26, 13, 34, 16, 0, 19, 12, 22, 17, + 20, 30, 22, 35, 20, 7, 29, 13, 26, 21, 29, 31, 26, 35, 29, + 5, 2, 10, 0, 23, 2, 28, 0, 38, 3, 6, 6, 12, 9, 23, + 7, 26, 9, 37, 7, 0, 15, 11, 13, 17, 16, 25, 13, 35, 16, + 0, 20, 13, 22, 18, 20, 31, 22, 36, 20, 6, 29, 14, 26, 20, + 29, 31, 27, 34, 29, 6, 2, 11, 0, 23, 3, 29, 0, 37, 3, + 7, 6, 11, 9, 22, 7, 25, 9, 36, 7, 0, 16, 10, 13, 18, + 16, 24, 13, 36, 16, 1, 20, 14, 22, 19, 20, 31, 23, 37, 20, + 5, 29, 15, 26, 19, 29, 30, 27, 33, 29, 7, 2, 12, 0, 22, + 3, 30, 0, 36, 3, 7, 7, 10, 9, 21, 7, 24, 9, 35, 7, + 1, 16, 9, 13, 19, 16, 24, 14, 37, 16, 2, 20, 15, 22, 20, + 20, 30, 23, 38, 20, 4, 29, 15, 27, 18, 29, 29, 27, 32, 29, + 7, 3, 13, 0, 21, 3, 31, 0, 35, 3, 6, 7, 9, 9, 20, + 7, 24, 10, 34, 7, 2, 16, 8, 13, 20, 16, 25, 14, 38, 16, + 3, 20, 15, 23, 21, 20, 29, 23, 39, 20, 3, 29, 14, 27, 17, + 29, 28, 27, 32, 24, 6, 3, 14, 0, 20, 3, 31, 1, 34, 3, + 5, 7, 8, 9, 19, 7, 25, 10, 33, 7, 3, 16, 8, 14, 21, + 16, 26, 14, 39, 16, 4, 20, 14, 23, 22, 20, 28, 23, 39, 21, + 2, 29, 13, 27, 16, 29, 27, 27, 33, 24, 5, 3, 15, 0, 19, + 3, 30, 1, 33, 3, 4, 7, 8, 10, 18, 7, 26, 10, 32, 7, + 4, 16, 9, 14, 22, 16, 27, 14, 39, 17, 5, 20, 13, 23, 23, + 20, 27, 23, 38, 21, 1, 29, 12, 27, 16, 24, 26, 27, 34, 24, + 4, 3, 15, 1, 18, 3, 29, 1, 32, 3, 3, 7, 9, 10, 17, + 7, 27, 10, 32, 8, 5, 16, 10, 14, 23, 16, 28, 14, 38, 17, + 6, 20, 12, 23, 23, 21, 26, 23, 37, 21, 0, 29, 11, 27, 17, + 24, 25, 27, 35, 24, 3, 3, 14, 1, 17, 3, 28, 1, 32, 4, + 2, 7, 10, 10, 16, 7, 28, 10, 33, 8, 6, 16, 11, 14, 23, + 17, 29, 14, 37, 17, 7, 20, 11, 23, 22, 21, 25, 23, 36, 21, + 0, 24, 10, 27, 18, 24, 24, 27, 36, 24, 2, 3, 13, 1, 16, + 3, 27, 1, 33, 4, 1, 7, 11, 10, 16, 8, 29, 10, 34, 8, + 7, 16, 12, 14, 22, 17, 30, 14, 36, 17, 7, 21, 10, 23, 21, + 21, 24, 23, 35, 21, 1, 24, 9, 27, 19, 24, 24, 28, 37, 24, + 1, 3, 12, 1, 16, 4, 26, 1, 34, 4, 0, 7, 12, 10, 17, + 8, 30, 10, 35, 8, 7, 17, 13, 14, 21, 17, 31, 14, 35, 17, + 6, 21, 9, 23, 20, 21, 24, 18, 34, 21, 2, 24, 8, 27, 20, + 24, 25, 28, 38, 24, 0, 3, 11, 1, 17, 4, 25, 1, 35, 4, + 0, 8, 13, 10, 18, 8, 31, 10, 36, 8, 6, 17, 14, 14, 20, + 17, 31, 15, 34, 17, 5, 21, 8, 23, 19, 21, 25, 18, 33, 21, + 3, 24, 8, 28, 21, 24, 26, 28, 39, 24, 0, 4, 10, 1, 18, + 4, 24, 1, 36, 4, 1, 8, 14, 10, 19, 8, 31, 11, 37, 8, + 5, 17, 15, 14, 19, 17, 30, 15, 33, 17, 4, 21, 8, 18, 18, + 21, 26, 18, 32, 21, 4, 24, 9, 28, 22, 24, 27, 28, 39, 25, + 1, 4, 9, 1, 19, 4, 24, 2, 37, 4, 2, 8, 15, 10, 20, + 8, 30, 11, 38, 8, 4, 17, 15, 15, 18, 17, 29, 15, 32, 17, + 3, 21, 9, 18, 17, 21, 27, 18, 32, 22, 5, 24, 10, 28, 23, + 24, 28, 28, 38, 25, 2, 4, 8, 1, 20, 4, 25, 2, 38, 4, + 3, 8, 15, 11, 21, 8, 29, 11, 39, 8, 3, 17, 14, 15, 17, + 17, 28, 15, 32, 12, 2, 21, 10, 18, 16, 21, 28, 18, 33, 22, + 6, 24, 11, 28, 23, 25, 29, 28, 37, 25, 3, 4, 8, 2, 21, + 4, 26, 2, 39, 4, 4, 8, 14, 11, 22, 8, 28, 11, 39, 9, + 2, 17, 13, 15, 16, 17, 27, 15, 33, 12, 1, 21, 11, 18, 16, + 22, 29, 18, 34, 22, 7, 24, 12, 28, 22, 25, 30, 28, 36, 25, + 4, 4, 9, 2, 22, 4, 27, 2, 39, 5, 5, 8, 13, 11, 23, + 8, 27, 11, 38, 9, 1, 17, 12, 15, 16, 12, 26, 15, 34, 12, + 0, 21, 12, 18, 17, 22, 30, 18, 35, 22, 7, 25, 13, 28, 21, + 25, 31, 28, 35, 25, 5, 4, 10, 2, 23, 4, 28, 2, 38, 5, + 6, 8, 12, 11, 23, 9, 26, 11, 37, 9, 0, 17, 11, 15, 17, + 12, 25, 15, 35, 12, 0, 22, 13, 18, 18, 22, 31, 18, 36, 22, + 6, 25, 14, 28, 20, 25, 31, 29, 34, 25, 6, 4, 11, 2, 23, + 5, 29, 2, 37, 5, 7, 8, 11, 11, 22, 9, 25, 11, 36, 9, + 0, 12, 10, 15, 18, 12, 24, 15, 36, 12, 1, 22, 14, 18, 19, + 22, 31, 19, 37, 22, 5, 25, 15, 28, 19, 25, 30, 29, 33, 25, + 7, 4, 12, 2, 22, 5, 30, 2, 36, 5, 7, 9, 10, 11, 21, + 9, 24, 11, 35, 9, 1, 12, 9, 15, 19, 12, 24, 16, 37, 12, + 2, 22, 15, 18, 20, 22, 30, 19, 38, 22, 4, 25, 15, 29, 18, + 25, 29, 29, 32, 25, 7, 5, 13, 2, 21, 5, 31, 2, 35, 5, + 6, 9, 9, 11, 20, 9, 24, 6, 34, 9, 2, 12, 8, 15, 20, + 12, 25, 16, 38, 12, 3, 22, 15, 19, 21, 22, 29, 19, 39, 22, + 3, 25, 14, 29, 17, 25, 28, 29, 32, 26, 6, 5, 14, 2, 20, + 5, 31, 3, 34, 5, 5, 9, 8, 11, 19, 9, 25, 6, 33, 9, + 3, 12, 8, 16, 21, 12, 26, 16, 39, 12, 4, 22, 14, 19, 22, + 22, 28, 19, 39, 23, 2, 25, 13, 29, 16, 25, 27, 29, 33, 26, + 5, 5, 15, 2, 19, 5, 30, 3, 33, 5, 4, 9, 8, 6, 18, + 9, 26, 6, 32, 9, 4, 12, 9, 16, 22, 12, 27, 16, 39, 13, + 5, 22, 13, 19, 23, 22, 27, 19, 38, 23, 1, 25, 12, 29, 16, + 26, 26, 29, 34, 26, 4, 5, 15, 3, 18, 5, 29, 3, 32, 5, + 3, 9, 9, 6, 17, 9, 27, 6, 32, 10, 5, 12, 10, 16, 23, + 12, 28, 16, 38, 13, 6, 22, 12, 19, 23, 23, 26, 19, 37, 23, + 0, 25, 11, 29, 17, 26, 25, 29, 35, 26, 3, 5, 14, 3, 17, + 5, 28, 3, 32, 0, 2, 9, 10, 6, 16, 9, 28, 6, 33, 10, + 6, 12, 11, 16, 23, 13, 29, 16, 37, 13, 7, 22, 11, 19, 22, + 23, 25, 19, 36, 23, 0, 26, 10, 29, 18, 26, 24, 29, 36, 26, + 2, 5, 13, 3, 16, 5, 27, 3, 33, 0, 1, 9, 11, 6, 16, + 10, 29, 6, 34, 10, 7, 12, 12, 16, 22, 13, 30, 16, 36, 13, + 7, 23, 10, 19, 21, 23, 24, 19, 35, 23, 1, 26, 9, 29, 19, + 26, 24, 24, 37, 26, 1, 5, 12, 3, 16, 0, 26, 3, 34, 0, + 0, 9, 12, 6, 17, 10, 30, 6, 35, 10, 7, 13, 13, 16, 21, + 13, 31, 16, 35, 13, 6, 23, 9, 19, 20, 23, 24, 20, 34, 23, + 2, 26, 8, 29, 20, 26, 25, 24, 38, 26, 0, 5, 11, 3, 17, + 0, 25, 3, 35, 0, 0, 10, 13, 6, 18, 10, 31, 6, 36, 10, + 6, 13, 14, 16, 20, 13, 31, 17, 34, 13, 5, 23, 8, 19, 19, + 23, 25, 20, 33, 23, 3, 26, 8, 24, 21, 26, 26, 24, 39, 26, +}; + +static const uint8_t hq_tab_10[] = { + 0, 0, 4, 1, 10, 0, 13, 2, 19, 1, 0, 5, 6, 4, 10, + 3, 15, 5, 16, 3, 2, 8, 6, 7, 8, 6, 12, 7, 18, 6, + 2, 11, 4, 10, 8, 11, 14, 10, 18, 9, 0, 14, 7, 12, 10, + 14, 14, 13, 16, 12, 1, 0, 4, 2, 11, 0, 14, 2, 18, 1, + 3, 3, 7, 4, 9, 3, 14, 5, 16, 4, 3, 8, 5, 7, 9, + 6, 12, 8, 19, 6, 1, 11, 5, 10, 11, 9, 15, 10, 17, 9, + 1, 14, 7, 13, 11, 14, 13, 13, 17, 12, 2, 0, 5, 2, 11, + 1, 15, 2, 17, 1, 2, 3, 7, 5, 8, 3, 13, 5, 17, 4, + 0, 6, 4, 7, 10, 6, 13, 8, 19, 7, 0, 11, 6, 10, 10, + 9, 15, 11, 16, 9, 2, 14, 6, 13, 8, 12, 12, 13, 18, 12, + 3, 0, 6, 2, 10, 1, 12, 0, 16, 1, 1, 3, 6, 5, 8, + 4, 12, 5, 18, 4, 1, 6, 4, 8, 11, 6, 14, 8, 18, 7, + 3, 9, 7, 10, 9, 9, 14, 11, 16, 10, 3, 14, 5, 13, 9, + 12, 12, 14, 19, 12, 3, 1, 7, 2, 9, 1, 13, 0, 16, 2, + 0, 3, 5, 5, 9, 4, 15, 3, 19, 4, 2, 6, 5, 8, 11, + 7, 15, 8, 17, 7, 2, 9, 7, 11, 8, 9, 13, 11, 17, 10, + 0, 12, 4, 13, 10, 12, 13, 14, 19, 13, 2, 1, 4, 0, 8, + 1, 14, 0, 17, 2, 0, 4, 4, 5, 10, 4, 14, 3, 19, 5, + 3, 6, 6, 8, 10, 7, 12, 6, 16, 7, 1, 9, 6, 11, 8, + 10, 12, 11, 18, 10, 1, 12, 4, 14, 11, 12, 14, 14, 18, 13, + 1, 1, 5, 0, 8, 2, 15, 0, 18, 2, 1, 4, 7, 3, 11, + 4, 13, 3, 18, 5, 3, 7, 7, 8, 9, 7, 13, 6, 16, 8, + 0, 9, 5, 11, 9, 10, 15, 9, 19, 10, 2, 12, 5, 14, 11, + 13, 15, 14, 17, 13, 0, 1, 6, 0, 9, 2, 15, 1, 19, 2, + 2, 4, 6, 3, 11, 5, 12, 3, 17, 5, 2, 7, 4, 6, 8, + 7, 14, 6, 17, 8, 0, 10, 4, 11, 10, 10, 14, 9, 19, 11, + 3, 12, 6, 14, 10, 13, 12, 12, 16, 13, 0, 2, 7, 0, 10, + 2, 14, 1, 16, 0, 3, 4, 5, 3, 10, 5, 12, 4, 16, 5, + 1, 7, 5, 6, 8, 8, 15, 6, 18, 8, 1, 10, 7, 9, 11, + 10, 13, 9, 18, 11, 3, 13, 7, 14, 9, 13, 13, 12, 16, 14, + 1, 2, 7, 1, 11, 2, 13, 1, 17, 0, 3, 5, 4, 3, 9, + 5, 13, 4, 19, 3, 0, 7, 6, 6, 9, 8, 15, 7, 19, 8, + 2, 10, 6, 9, 11, 11, 12, 9, 17, 11, 2, 13, 4, 12, 8, + 13, 14, 12, 17, 14, 2, 2, 6, 1, 8, 0, 12, 1, 18, 0, + 2, 5, 4, 4, 8, 5, 14, 4, 18, 3, 0, 8, 7, 6, 10, + 8, 14, 7, 16, 6, 3, 10, 5, 9, 10, 11, 12, 10, 16, 11, + 1, 13, 5, 12, 8, 14, 15, 12, 18, 14, 3, 2, 5, 1, 9, + 0, 12, 2, 19, 0, 1, 5, 5, 4, 11, 3, 15, 4, 17, 3, + 1, 8, 7, 7, 11, 8, 13, 7, 17, 6, 3, 11, 4, 9, 9, + 11, 13, 10, 19, 9, 0, 13, 6, 12, 9, 14, 15, 13, 19, 14, +}; + +static const uint8_t hq_tab_11[] = { + 0, 0, 3, 3, 5, 1, 6, 0, 8, 2, 1, 5, 3, 7, 4, + 6, 6, 4, 9, 7, 1, 0, 2, 3, 4, 1, 7, 0, 9, 2, + 0, 5, 2, 7, 5, 6, 7, 4, 8, 7, 1, 1, 2, 0, 4, + 2, 7, 1, 9, 3, 0, 6, 2, 4, 5, 7, 7, 5, 8, 4, + 0, 1, 3, 0, 5, 2, 6, 1, 8, 3, 1, 6, 3, 4, 4, + 7, 6, 5, 9, 4, 0, 2, 3, 1, 5, 3, 6, 2, 8, 0, + 1, 7, 3, 5, 4, 4, 6, 6, 9, 5, 1, 2, 2, 1, 4, + 3, 7, 2, 9, 0, 0, 7, 2, 5, 5, 4, 7, 6, 8, 5, + 1, 3, 2, 2, 4, 0, 7, 3, 9, 1, 0, 4, 2, 6, 5, + 5, 7, 7, 8, 6, 0, 3, 3, 2, 5, 0, 6, 3, 8, 1, + 1, 4, 3, 6, 4, 5, 6, 7, 9, 6, +}; + +static const uint8_t hq_tab_12[] = { + 0, 0, 13, 3, 22, 0, 31, 3, 44, 0, 3, 11, 12, 8, 21, + 11, 34, 8, 40, 12, 2, 16, 11, 19, 24, 16, 30, 20, 46, 16, + 1, 27, 14, 24, 20, 28, 36, 24, 42, 28, 4, 32, 10, 36, 26, + 32, 32, 36, 48, 32, 1, 0, 12, 3, 23, 0, 30, 3, 45, 0, + 2, 11, 13, 8, 20, 11, 35, 8, 41, 12, 3, 16, 10, 19, 25, + 16, 31, 20, 47, 16, 0, 27, 15, 24, 21, 28, 37, 24, 43, 28, + 5, 32, 11, 36, 27, 32, 33, 36, 49, 32, 2, 0, 11, 3, 24, + 0, 30, 4, 46, 0, 1, 11, 14, 8, 20, 12, 36, 8, 42, 12, + 4, 16, 10, 20, 26, 16, 32, 20, 48, 16, 0, 28, 16, 24, 22, + 28, 38, 24, 44, 28, 6, 32, 12, 36, 28, 32, 34, 36, 49, 33, + 3, 0, 10, 3, 25, 0, 31, 4, 47, 0, 0, 11, 15, 8, 21, + 12, 37, 8, 43, 12, 5, 16, 11, 20, 27, 16, 33, 20, 49, 16, + 1, 28, 17, 24, 23, 28, 39, 24, 45, 28, 7, 32, 13, 36, 29, + 32, 35, 36, 48, 33, 4, 0, 10, 4, 26, 0, 32, 4, 48, 0, + 0, 12, 16, 8, 22, 12, 38, 8, 44, 12, 6, 16, 12, 20, 28, + 16, 34, 20, 49, 17, 2, 28, 18, 24, 24, 28, 39, 25, 46, 28, + 8, 32, 14, 36, 29, 33, 36, 36, 47, 33, 5, 0, 11, 4, 27, + 0, 33, 4, 49, 0, 1, 12, 17, 8, 23, 12, 39, 8, 45, 12, + 7, 16, 13, 20, 29, 16, 35, 20, 48, 17, 3, 28, 19, 24, 25, + 28, 38, 25, 47, 28, 9, 32, 15, 36, 28, 33, 37, 36, 46, 33, + 6, 0, 12, 4, 28, 0, 34, 4, 49, 1, 2, 12, 18, 8, 24, + 12, 39, 9, 46, 12, 8, 16, 14, 20, 29, 17, 36, 20, 47, 17, + 4, 28, 19, 25, 26, 28, 37, 25, 48, 28, 9, 33, 16, 36, 27, + 33, 38, 36, 45, 33, 7, 0, 13, 4, 29, 0, 35, 4, 48, 1, + 3, 12, 19, 8, 25, 12, 38, 9, 47, 12, 9, 16, 15, 20, 28, + 17, 37, 20, 46, 17, 5, 28, 18, 25, 27, 28, 36, 25, 49, 28, + 8, 33, 17, 36, 26, 33, 39, 36, 44, 33, 8, 0, 14, 4, 29, + 1, 36, 4, 47, 1, 4, 12, 19, 9, 26, 12, 37, 9, 48, 12, + 9, 17, 16, 20, 27, 17, 38, 20, 45, 17, 6, 28, 17, 25, 28, + 28, 35, 25, 49, 29, 7, 33, 18, 36, 25, 33, 39, 37, 43, 33, + 9, 0, 15, 4, 28, 1, 37, 4, 46, 1, 5, 12, 18, 9, 27, + 12, 36, 9, 49, 12, 8, 17, 17, 20, 26, 17, 39, 20, 44, 17, + 7, 28, 16, 25, 29, 28, 34, 25, 48, 29, 6, 33, 19, 36, 24, + 33, 38, 37, 42, 33, 9, 1, 16, 4, 27, 1, 38, 4, 45, 1, + 6, 12, 17, 9, 28, 12, 35, 9, 49, 13, 7, 17, 18, 20, 25, + 17, 39, 21, 43, 17, 8, 28, 15, 25, 29, 29, 33, 25, 47, 29, + 5, 33, 19, 37, 23, 33, 37, 37, 41, 33, 8, 1, 17, 4, 26, + 1, 39, 4, 44, 1, 7, 12, 16, 9, 29, 12, 34, 9, 48, 13, + 6, 17, 19, 20, 24, 17, 38, 21, 42, 17, 9, 28, 14, 25, 28, + 29, 32, 25, 46, 29, 4, 33, 18, 37, 22, 33, 36, 37, 40, 33, + 7, 1, 18, 4, 25, 1, 39, 5, 43, 1, 8, 12, 15, 9, 29, + 13, 33, 9, 47, 13, 5, 17, 19, 21, 23, 17, 37, 21, 41, 17, + 9, 29, 13, 25, 27, 29, 31, 25, 45, 29, 3, 33, 17, 37, 21, + 33, 35, 37, 40, 34, 6, 1, 19, 4, 24, 1, 38, 5, 42, 1, + 9, 12, 14, 9, 28, 13, 32, 9, 46, 13, 4, 17, 18, 21, 22, + 17, 36, 21, 40, 17, 8, 29, 12, 25, 26, 29, 30, 25, 44, 29, + 2, 33, 16, 37, 20, 33, 34, 37, 41, 34, 5, 1, 19, 5, 23, + 1, 37, 5, 41, 1, 9, 13, 13, 9, 27, 13, 31, 9, 45, 13, + 3, 17, 17, 21, 21, 17, 35, 21, 40, 18, 7, 29, 11, 25, 25, + 29, 30, 26, 43, 29, 1, 33, 15, 37, 20, 34, 33, 37, 42, 34, + 4, 1, 18, 5, 22, 1, 36, 5, 40, 1, 8, 13, 12, 9, 26, + 13, 30, 9, 44, 13, 2, 17, 16, 21, 20, 17, 34, 21, 41, 18, + 6, 29, 10, 25, 24, 29, 31, 26, 42, 29, 0, 33, 14, 37, 21, + 34, 32, 37, 43, 34, 3, 1, 17, 5, 21, 1, 35, 5, 40, 2, + 7, 13, 11, 9, 25, 13, 30, 10, 43, 13, 1, 17, 15, 21, 20, + 18, 33, 21, 42, 18, 5, 29, 10, 26, 23, 29, 32, 26, 41, 29, + 0, 34, 13, 37, 22, 34, 31, 37, 44, 34, 2, 1, 16, 5, 20, + 1, 34, 5, 41, 2, 6, 13, 10, 9, 24, 13, 31, 10, 42, 13, + 0, 17, 14, 21, 21, 18, 32, 21, 43, 18, 4, 29, 11, 26, 22, + 29, 33, 26, 40, 29, 1, 34, 12, 37, 23, 34, 30, 37, 45, 34, + 1, 1, 15, 5, 20, 2, 33, 5, 42, 2, 5, 13, 10, 10, 23, + 13, 32, 10, 41, 13, 0, 18, 13, 21, 22, 18, 31, 21, 44, 18, + 3, 29, 12, 26, 21, 29, 34, 26, 40, 30, 2, 34, 11, 37, 24, + 34, 34, 30, 46, 34, 0, 1, 14, 5, 21, 2, 32, 5, 43, 2, + 4, 13, 11, 10, 22, 13, 33, 10, 40, 13, 1, 18, 12, 21, 23, + 18, 30, 21, 45, 18, 2, 29, 13, 26, 20, 29, 35, 26, 41, 30, + 3, 34, 10, 37, 25, 34, 35, 30, 47, 34, 0, 2, 13, 5, 22, + 2, 31, 5, 44, 2, 3, 13, 12, 10, 21, 13, 34, 10, 40, 14, + 2, 18, 11, 21, 24, 18, 30, 22, 46, 18, 1, 29, 14, 26, 20, + 30, 36, 26, 42, 30, 4, 34, 14, 30, 26, 34, 36, 30, 48, 34, + 1, 2, 12, 5, 23, 2, 30, 5, 45, 2, 2, 13, 13, 10, 20, + 13, 35, 10, 41, 14, 3, 18, 10, 21, 25, 18, 31, 22, 47, 18, + 0, 29, 15, 26, 21, 30, 37, 26, 43, 30, 5, 34, 15, 30, 27, + 34, 37, 30, 49, 34, 2, 2, 11, 5, 24, 2, 30, 6, 46, 2, + 1, 13, 14, 10, 20, 14, 36, 10, 42, 14, 4, 18, 10, 22, 26, + 18, 32, 22, 48, 18, 0, 30, 16, 26, 22, 30, 38, 26, 48, 22, + 6, 34, 16, 30, 28, 34, 38, 30, 49, 35, 3, 2, 10, 5, 25, + 2, 31, 6, 47, 2, 0, 13, 15, 10, 21, 14, 37, 10, 43, 14, + 5, 18, 11, 22, 27, 18, 33, 22, 49, 18, 1, 30, 17, 26, 23, + 30, 39, 26, 49, 22, 7, 34, 17, 30, 29, 34, 39, 30, 48, 35, + 4, 2, 10, 6, 26, 2, 32, 6, 48, 2, 0, 14, 16, 10, 22, + 14, 38, 10, 44, 14, 6, 18, 12, 22, 28, 18, 34, 22, 49, 19, + 2, 30, 18, 26, 28, 22, 39, 27, 49, 23, 8, 34, 18, 30, 29, + 35, 39, 31, 47, 35, 5, 2, 11, 6, 27, 2, 33, 6, 49, 2, + 1, 14, 17, 10, 23, 14, 39, 10, 45, 14, 7, 18, 13, 22, 29, + 18, 35, 22, 48, 19, 3, 30, 19, 26, 29, 22, 38, 27, 48, 23, + 9, 34, 19, 30, 28, 35, 38, 31, 46, 35, 6, 2, 12, 6, 28, + 2, 34, 6, 49, 3, 2, 14, 18, 10, 24, 14, 39, 11, 46, 14, + 8, 18, 14, 22, 29, 19, 36, 22, 47, 19, 8, 22, 19, 27, 29, + 23, 37, 27, 47, 23, 9, 35, 19, 31, 27, 35, 37, 31, 45, 35, + 7, 2, 13, 6, 29, 2, 35, 6, 48, 3, 3, 14, 19, 10, 25, + 14, 38, 11, 47, 14, 9, 18, 15, 22, 28, 19, 37, 22, 46, 19, + 9, 22, 18, 27, 28, 23, 36, 27, 46, 23, 8, 35, 18, 31, 26, + 35, 36, 31, 44, 35, 8, 2, 14, 6, 29, 3, 36, 6, 47, 3, + 4, 14, 19, 11, 26, 14, 37, 11, 48, 14, 9, 19, 16, 22, 27, + 19, 37, 15, 45, 19, 9, 23, 17, 27, 27, 23, 35, 27, 45, 23, + 7, 35, 17, 31, 25, 35, 35, 31, 43, 35, 9, 2, 15, 6, 28, + 3, 37, 6, 46, 3, 5, 14, 18, 11, 27, 14, 36, 11, 49, 14, + 8, 19, 17, 22, 26, 19, 36, 15, 44, 19, 8, 23, 16, 27, 26, + 23, 34, 27, 44, 23, 6, 35, 16, 31, 24, 35, 34, 31, 42, 35, + 9, 3, 16, 6, 27, 3, 38, 6, 45, 3, 6, 14, 17, 11, 28, + 14, 35, 11, 49, 15, 7, 19, 17, 15, 25, 19, 35, 15, 43, 19, + 7, 23, 15, 27, 25, 23, 33, 27, 43, 23, 5, 35, 15, 31, 23, + 35, 33, 31, 41, 35, 8, 3, 17, 6, 26, 3, 39, 6, 44, 3, + 7, 14, 16, 11, 29, 14, 34, 11, 48, 15, 6, 19, 16, 15, 24, + 19, 34, 15, 42, 19, 6, 23, 14, 27, 24, 23, 32, 27, 42, 23, + 4, 35, 14, 31, 22, 35, 32, 31, 40, 35, 7, 3, 18, 6, 25, + 3, 39, 7, 43, 3, 8, 14, 15, 11, 29, 15, 33, 11, 43, 7, + 5, 19, 15, 15, 23, 19, 33, 15, 41, 19, 5, 23, 13, 27, 23, + 23, 31, 27, 41, 23, 3, 35, 13, 31, 21, 35, 31, 31, 40, 36, + 6, 3, 19, 6, 24, 3, 38, 7, 42, 3, 9, 14, 14, 11, 28, + 15, 32, 11, 42, 7, 4, 19, 14, 15, 22, 19, 32, 15, 40, 19, + 4, 23, 12, 27, 22, 23, 30, 27, 40, 23, 2, 35, 12, 31, 20, + 35, 30, 31, 41, 36, 5, 3, 19, 7, 23, 3, 37, 7, 41, 3, + 9, 15, 13, 11, 23, 7, 31, 11, 41, 7, 3, 19, 13, 15, 21, + 19, 31, 15, 40, 20, 3, 23, 11, 27, 21, 23, 30, 28, 40, 24, + 1, 35, 11, 31, 20, 36, 30, 32, 42, 36, 4, 3, 18, 7, 22, + 3, 36, 7, 40, 3, 8, 15, 12, 11, 22, 7, 30, 11, 40, 7, + 2, 19, 12, 15, 20, 19, 30, 15, 41, 20, 2, 23, 10, 27, 20, + 23, 31, 28, 41, 24, 0, 35, 10, 31, 21, 36, 31, 32, 43, 36, + 3, 3, 17, 7, 21, 3, 35, 7, 40, 4, 3, 7, 11, 11, 21, + 7, 30, 12, 40, 8, 1, 19, 11, 15, 20, 20, 30, 16, 42, 20, + 1, 23, 10, 28, 20, 24, 32, 28, 42, 24, 0, 36, 10, 32, 22, + 36, 32, 32, 44, 36, 2, 3, 16, 7, 20, 3, 34, 7, 41, 4, + 2, 7, 10, 11, 20, 7, 31, 12, 41, 8, 0, 19, 10, 15, 21, + 20, 31, 16, 43, 20, 0, 23, 11, 28, 21, 24, 33, 28, 43, 24, + 1, 36, 11, 32, 23, 36, 33, 32, 45, 36, 1, 3, 15, 7, 20, + 4, 30, 0, 42, 4, 1, 7, 10, 12, 20, 8, 32, 12, 42, 8, + 0, 20, 10, 16, 22, 20, 32, 16, 44, 20, 0, 24, 12, 28, 22, + 24, 34, 28, 44, 24, 2, 36, 12, 32, 24, 36, 34, 32, 46, 36, + 0, 3, 14, 7, 21, 4, 31, 0, 43, 4, 0, 7, 11, 12, 21, + 8, 33, 12, 43, 8, 1, 20, 11, 16, 23, 20, 33, 16, 45, 20, + 1, 24, 13, 28, 23, 24, 35, 28, 45, 24, 3, 36, 13, 32, 25, + 36, 35, 32, 47, 36, 0, 4, 10, 0, 22, 4, 32, 0, 44, 4, + 0, 8, 12, 12, 22, 8, 34, 12, 44, 8, 2, 20, 12, 16, 24, + 20, 34, 16, 46, 20, 2, 24, 14, 28, 24, 24, 36, 28, 46, 24, + 4, 36, 14, 32, 26, 36, 36, 32, 48, 36, 1, 4, 11, 0, 23, + 4, 33, 0, 45, 4, 1, 8, 13, 12, 23, 8, 35, 12, 45, 8, + 3, 20, 13, 16, 25, 20, 35, 16, 47, 20, 3, 24, 15, 28, 25, + 24, 37, 28, 47, 24, 5, 36, 15, 32, 27, 36, 37, 32, 49, 36, + 2, 4, 12, 0, 24, 4, 34, 0, 46, 4, 2, 8, 14, 12, 24, + 8, 36, 12, 46, 8, 4, 20, 14, 16, 26, 20, 36, 16, 48, 20, + 4, 24, 16, 28, 26, 24, 38, 28, 48, 24, 6, 36, 16, 32, 28, + 36, 38, 32, 49, 37, 3, 4, 13, 0, 25, 4, 35, 0, 47, 4, + 3, 8, 15, 12, 25, 8, 37, 12, 47, 8, 5, 20, 15, 16, 27, + 20, 37, 16, 49, 20, 5, 24, 17, 28, 27, 24, 39, 28, 49, 24, + 7, 36, 17, 32, 29, 36, 39, 32, 48, 37, 4, 4, 14, 0, 26, + 4, 36, 0, 48, 4, 4, 8, 16, 12, 26, 8, 38, 12, 48, 8, + 6, 20, 16, 16, 28, 20, 38, 16, 49, 21, 6, 24, 18, 28, 28, + 24, 39, 29, 49, 25, 8, 36, 18, 32, 29, 37, 39, 33, 47, 37, + 5, 4, 15, 0, 27, 4, 37, 0, 49, 4, 5, 8, 17, 12, 27, + 8, 39, 12, 49, 8, 7, 20, 17, 16, 29, 20, 39, 16, 48, 21, + 7, 24, 19, 28, 29, 24, 38, 29, 48, 25, 9, 36, 19, 32, 28, + 37, 38, 33, 46, 37, 6, 4, 16, 0, 28, 4, 38, 0, 49, 5, + 6, 8, 18, 12, 28, 8, 39, 13, 49, 9, 8, 20, 18, 16, 29, + 21, 39, 17, 47, 21, 8, 24, 19, 29, 29, 25, 37, 29, 47, 25, + 9, 37, 19, 33, 27, 37, 37, 33, 45, 37, 7, 4, 17, 0, 29, + 4, 39, 0, 48, 5, 7, 8, 19, 12, 29, 8, 38, 13, 48, 9, + 9, 20, 19, 16, 28, 21, 38, 17, 46, 21, 9, 24, 18, 29, 28, + 25, 36, 29, 46, 25, 8, 37, 18, 33, 26, 37, 36, 33, 44, 37, + 8, 4, 18, 0, 29, 5, 39, 1, 47, 5, 8, 8, 19, 13, 29, + 9, 37, 13, 47, 9, 9, 21, 19, 17, 27, 21, 37, 17, 45, 21, + 9, 25, 17, 29, 27, 25, 35, 29, 45, 25, 7, 37, 17, 33, 25, + 37, 35, 33, 43, 37, 9, 4, 19, 0, 28, 5, 38, 1, 46, 5, + 9, 8, 18, 13, 28, 9, 36, 13, 46, 9, 8, 21, 18, 17, 26, + 21, 36, 17, 44, 21, 8, 25, 16, 29, 26, 25, 34, 29, 44, 25, + 6, 37, 16, 33, 24, 37, 34, 33, 42, 37, 9, 5, 19, 1, 27, + 5, 37, 1, 45, 5, 9, 9, 17, 13, 27, 9, 35, 13, 45, 9, + 7, 21, 17, 17, 25, 21, 35, 17, 43, 21, 7, 25, 15, 29, 25, + 25, 33, 29, 43, 25, 5, 37, 15, 33, 23, 37, 33, 33, 41, 37, + 8, 5, 18, 1, 26, 5, 36, 1, 44, 5, 8, 9, 16, 13, 26, + 9, 34, 13, 44, 9, 6, 21, 16, 17, 24, 21, 34, 17, 42, 21, + 6, 25, 14, 29, 24, 25, 32, 29, 42, 25, 4, 37, 14, 33, 22, + 37, 32, 33, 40, 37, 7, 5, 17, 1, 25, 5, 35, 1, 43, 5, + 7, 9, 15, 13, 25, 9, 33, 13, 43, 9, 5, 21, 15, 17, 23, + 21, 33, 17, 41, 21, 5, 25, 13, 29, 23, 25, 31, 29, 41, 25, + 3, 37, 13, 33, 21, 37, 31, 33, 44, 30, 6, 5, 16, 1, 24, + 5, 34, 1, 42, 5, 6, 9, 14, 13, 24, 9, 32, 13, 42, 9, + 4, 21, 14, 17, 22, 21, 32, 17, 40, 21, 4, 25, 12, 29, 22, + 25, 30, 29, 40, 25, 2, 37, 12, 33, 20, 37, 30, 33, 45, 30, + 5, 5, 15, 1, 23, 5, 33, 1, 41, 5, 5, 9, 13, 13, 23, + 9, 31, 13, 41, 9, 3, 21, 13, 17, 21, 21, 31, 17, 40, 22, + 3, 25, 11, 29, 21, 25, 30, 30, 40, 26, 1, 37, 11, 33, 24, + 30, 30, 34, 46, 30, 4, 5, 14, 1, 22, 5, 32, 1, 40, 5, + 4, 9, 12, 13, 22, 9, 30, 13, 40, 9, 2, 21, 12, 17, 20, + 21, 30, 17, 41, 22, 2, 25, 10, 29, 20, 25, 31, 30, 41, 26, + 0, 37, 10, 33, 25, 30, 31, 34, 47, 30, 3, 5, 13, 1, 21, + 5, 31, 1, 40, 6, 3, 9, 11, 13, 21, 9, 30, 14, 40, 10, + 1, 21, 11, 17, 20, 22, 30, 18, 42, 22, 1, 25, 10, 30, 20, + 26, 32, 30, 42, 26, 4, 30, 10, 34, 26, 30, 32, 34, 48, 30, + 2, 5, 12, 1, 20, 5, 30, 1, 41, 6, 2, 9, 10, 13, 20, + 9, 31, 14, 41, 10, 0, 21, 10, 17, 21, 22, 31, 18, 43, 22, + 0, 25, 11, 30, 21, 26, 33, 30, 43, 26, 5, 30, 11, 34, 27, + 30, 33, 34, 49, 30, 1, 5, 11, 1, 20, 6, 30, 2, 42, 6, + 1, 9, 10, 14, 20, 10, 32, 14, 42, 10, 0, 22, 10, 18, 22, + 22, 32, 18, 44, 22, 0, 26, 12, 30, 22, 26, 38, 22, 44, 26, + 6, 30, 12, 34, 28, 30, 34, 34, 49, 31, 0, 5, 10, 1, 21, + 6, 31, 2, 43, 6, 0, 9, 11, 14, 21, 10, 33, 14, 43, 10, + 1, 22, 11, 18, 23, 22, 33, 18, 45, 22, 1, 26, 13, 30, 23, + 26, 39, 22, 45, 26, 7, 30, 13, 34, 29, 30, 35, 34, 48, 31, + 0, 6, 10, 2, 22, 6, 32, 2, 44, 6, 0, 10, 12, 14, 22, + 10, 34, 14, 44, 10, 2, 22, 12, 18, 24, 22, 34, 18, 46, 22, + 2, 26, 18, 22, 24, 26, 39, 23, 46, 26, 8, 30, 14, 34, 29, + 31, 36, 34, 47, 31, 1, 6, 11, 2, 23, 6, 33, 2, 45, 6, + 1, 10, 13, 14, 23, 10, 35, 14, 45, 10, 3, 22, 13, 18, 25, + 22, 35, 18, 47, 22, 3, 26, 19, 22, 25, 26, 38, 23, 47, 26, + 9, 30, 15, 34, 28, 31, 37, 34, 46, 31, 2, 6, 12, 2, 24, + 6, 34, 2, 46, 6, 2, 10, 14, 14, 24, 10, 36, 14, 46, 10, + 4, 22, 14, 18, 26, 22, 36, 18, 47, 15, 4, 26, 19, 23, 26, + 26, 37, 23, 48, 26, 9, 31, 16, 34, 27, 31, 38, 34, 45, 31, + 3, 6, 13, 2, 25, 6, 35, 2, 47, 6, 3, 10, 15, 14, 25, + 10, 37, 14, 47, 10, 5, 22, 15, 18, 27, 22, 37, 18, 46, 15, + 5, 26, 18, 23, 27, 26, 36, 23, 49, 26, 8, 31, 17, 34, 26, + 31, 39, 34, 44, 31, 4, 6, 14, 2, 26, 6, 36, 2, 48, 6, + 4, 10, 16, 14, 26, 10, 38, 14, 48, 10, 6, 22, 16, 18, 27, + 15, 38, 18, 45, 15, 6, 26, 17, 23, 28, 26, 35, 23, 49, 27, + 7, 31, 18, 34, 25, 31, 39, 35, 43, 31, 5, 6, 15, 2, 27, + 6, 37, 2, 49, 6, 5, 10, 17, 14, 27, 10, 39, 14, 49, 10, + 7, 22, 17, 18, 26, 15, 39, 18, 44, 15, 7, 26, 16, 23, 29, + 26, 34, 23, 48, 27, 6, 31, 19, 34, 24, 31, 38, 35, 42, 31, + 6, 6, 16, 2, 28, 6, 38, 2, 49, 7, 6, 10, 18, 14, 28, + 10, 39, 15, 49, 11, 7, 15, 18, 18, 25, 15, 39, 19, 43, 15, + 8, 26, 15, 23, 29, 27, 33, 23, 47, 27, 5, 31, 19, 35, 23, + 31, 37, 35, 41, 31, 7, 6, 17, 2, 29, 6, 39, 2, 48, 7, + 7, 10, 19, 14, 29, 10, 38, 15, 48, 11, 6, 15, 19, 18, 24, + 15, 38, 19, 42, 15, 9, 26, 14, 23, 28, 27, 32, 23, 46, 27, + 4, 31, 18, 35, 22, 31, 36, 35, 40, 31, 8, 6, 18, 2, 29, + 7, 39, 3, 47, 7, 8, 10, 19, 15, 29, 11, 33, 7, 47, 11, + 5, 15, 19, 19, 23, 15, 37, 19, 41, 15, 9, 27, 13, 23, 27, + 27, 31, 23, 45, 27, 3, 31, 17, 35, 21, 31, 35, 35, 40, 32, + 9, 6, 19, 2, 28, 7, 38, 3, 46, 7, 9, 10, 18, 15, 28, + 11, 32, 7, 46, 11, 4, 15, 18, 19, 22, 15, 36, 19, 40, 15, + 8, 27, 12, 23, 26, 27, 30, 23, 44, 27, 2, 31, 16, 35, 20, + 31, 34, 35, 41, 32, 9, 7, 19, 3, 27, 7, 37, 3, 45, 7, + 9, 11, 13, 7, 27, 11, 31, 7, 45, 11, 3, 15, 17, 19, 21, + 15, 35, 19, 40, 16, 7, 27, 11, 23, 25, 27, 30, 24, 43, 27, + 1, 31, 15, 35, 20, 32, 33, 35, 42, 32, 8, 7, 18, 3, 26, + 7, 36, 3, 44, 7, 8, 11, 12, 7, 26, 11, 30, 7, 44, 11, + 2, 15, 16, 19, 20, 15, 34, 19, 41, 16, 6, 27, 10, 23, 24, + 27, 31, 24, 42, 27, 0, 31, 14, 35, 21, 32, 32, 35, 43, 32, + 7, 7, 17, 3, 25, 7, 35, 3, 40, 0, 7, 11, 11, 7, 25, + 11, 30, 8, 43, 11, 1, 15, 15, 19, 20, 16, 33, 19, 42, 16, + 5, 27, 10, 24, 23, 27, 32, 24, 41, 27, 0, 32, 13, 35, 22, + 32, 31, 35, 44, 32, 6, 7, 16, 3, 24, 7, 34, 3, 41, 0, + 6, 11, 10, 7, 24, 11, 31, 8, 42, 11, 0, 15, 14, 19, 21, + 16, 32, 19, 43, 16, 4, 27, 11, 24, 22, 27, 33, 24, 40, 27, + 1, 32, 12, 35, 23, 32, 30, 35, 45, 32, 5, 7, 15, 3, 20, + 0, 33, 3, 42, 0, 5, 11, 10, 8, 23, 11, 32, 8, 41, 11, + 0, 16, 13, 19, 22, 16, 31, 19, 44, 16, 3, 27, 12, 24, 21, + 27, 34, 24, 40, 28, 2, 32, 11, 35, 24, 32, 30, 36, 46, 32, + 4, 7, 14, 3, 21, 0, 32, 3, 43, 0, 4, 11, 11, 8, 22, + 11, 33, 8, 40, 11, 1, 16, 12, 19, 23, 16, 30, 19, 45, 16, + 2, 27, 13, 24, 20, 27, 35, 24, 41, 28, 3, 32, 10, 35, 25, + 32, 31, 36, 47, 32, +}; + +static const uint8_t hq_tab_13[] = { + 0, 0, 15, 1, 7, 4, 18, 3, 4, 6, 11, 7, 10, 11, 14, + 9, 8, 12, 14, 14, 6, 17, 11, 16, 9, 19, 18, 20, 2, 23, + 15, 22, 5, 25, 11, 24, 9, 27, 19, 28, 1, 0, 14, 1, 8, + 4, 17, 3, 5, 6, 11, 8, 9, 11, 13, 9, 9, 12, 15, 14, + 5, 17, 12, 16, 8, 19, 19, 20, 1, 23, 16, 22, 4, 25, 12, + 24, 8, 27, 20, 28, 2, 0, 13, 1, 9, 4, 16, 3, 6, 6, + 12, 8, 8, 11, 12, 9, 10, 12, 16, 14, 4, 17, 13, 16, 7, + 19, 20, 20, 0, 23, 17, 22, 3, 25, 13, 24, 7, 27, 21, 28, + 3, 0, 12, 1, 10, 4, 15, 3, 7, 6, 13, 8, 7, 11, 11, + 9, 10, 13, 17, 14, 3, 17, 14, 16, 6, 19, 21, 20, 10, 21, + 18, 22, 2, 25, 14, 24, 6, 27, 21, 29, 4, 0, 11, 1, 10, + 5, 14, 3, 8, 6, 14, 8, 6, 11, 11, 10, 9, 13, 18, 14, + 2, 17, 15, 16, 5, 19, 11, 18, 9, 21, 19, 22, 1, 25, 15, + 24, 5, 27, 20, 29, 5, 0, 11, 2, 9, 5, 13, 3, 9, 6, + 15, 8, 5, 11, 12, 10, 8, 13, 19, 14, 1, 17, 16, 16, 4, + 19, 12, 18, 8, 21, 20, 22, 0, 25, 16, 24, 4, 27, 19, 29, + 6, 0, 12, 2, 8, 5, 12, 3, 10, 6, 16, 8, 4, 11, 13, + 10, 7, 13, 20, 14, 0, 17, 17, 16, 3, 19, 13, 18, 7, 21, + 21, 22, 0, 26, 17, 24, 3, 27, 18, 29, 7, 0, 13, 2, 7, + 5, 11, 3, 10, 7, 17, 8, 3, 11, 14, 10, 6, 13, 21, 14, + 10, 15, 18, 16, 2, 19, 14, 18, 6, 21, 21, 23, 1, 26, 18, + 24, 2, 27, 17, 29, 8, 0, 14, 2, 6, 5, 11, 4, 9, 7, + 18, 8, 2, 11, 15, 10, 5, 13, 11, 12, 9, 15, 19, 16, 1, + 19, 15, 18, 5, 21, 20, 23, 2, 26, 19, 24, 1, 27, 16, 29, + 9, 0, 15, 2, 5, 5, 12, 4, 8, 7, 19, 8, 1, 11, 16, + 10, 4, 13, 12, 12, 8, 15, 20, 16, 0, 19, 16, 18, 4, 21, + 19, 23, 3, 26, 20, 24, 0, 27, 15, 29, 10, 0, 16, 2, 4, + 5, 13, 4, 7, 7, 20, 8, 0, 11, 17, 10, 3, 13, 13, 12, + 7, 15, 21, 16, 0, 20, 17, 18, 3, 21, 18, 23, 4, 26, 21, + 24, 0, 28, 14, 29, 10, 1, 17, 2, 3, 5, 14, 4, 6, 7, + 21, 8, 10, 9, 18, 10, 2, 13, 14, 12, 6, 15, 21, 17, 1, + 20, 18, 18, 2, 21, 17, 23, 5, 26, 21, 25, 1, 28, 13, 29, + 9, 1, 18, 2, 2, 5, 15, 4, 5, 7, 11, 6, 9, 9, 19, + 10, 1, 13, 15, 12, 5, 15, 20, 17, 2, 20, 19, 18, 1, 21, + 16, 23, 6, 26, 20, 25, 2, 28, 12, 29, 8, 1, 19, 2, 1, + 5, 16, 4, 4, 7, 12, 6, 8, 9, 20, 10, 0, 13, 16, 12, + 4, 15, 19, 17, 3, 20, 20, 18, 0, 21, 15, 23, 7, 26, 19, + 25, 3, 28, 11, 29, 7, 1, 20, 2, 0, 5, 17, 4, 3, 7, + 13, 6, 7, 9, 21, 10, 0, 14, 17, 12, 3, 15, 18, 17, 4, + 20, 21, 18, 0, 22, 14, 23, 8, 26, 18, 25, 4, 28, 21, 27, + 6, 1, 21, 2, 10, 3, 18, 4, 2, 7, 14, 6, 6, 9, 21, + 11, 1, 14, 18, 12, 2, 15, 17, 17, 5, 20, 21, 19, 1, 22, + 13, 23, 9, 26, 17, 25, 5, 28, 20, 27, 5, 1, 11, 0, 9, + 3, 19, 4, 1, 7, 15, 6, 5, 9, 20, 11, 2, 14, 19, 12, + 1, 15, 16, 17, 6, 20, 20, 19, 2, 22, 12, 23, 10, 26, 16, + 25, 6, 28, 19, 27, 4, 1, 12, 0, 8, 3, 20, 4, 0, 7, + 16, 6, 4, 9, 19, 11, 3, 14, 20, 12, 0, 15, 15, 17, 7, + 20, 19, 19, 3, 22, 11, 23, 0, 24, 15, 25, 7, 28, 18, 27, + 3, 1, 13, 0, 7, 3, 21, 4, 0, 8, 17, 6, 3, 9, 18, + 11, 4, 14, 21, 12, 0, 16, 14, 17, 8, 20, 18, 19, 4, 22, + 21, 21, 1, 24, 14, 25, 8, 28, 17, 27, 2, 1, 14, 0, 6, + 3, 21, 5, 1, 8, 18, 6, 2, 9, 17, 11, 5, 14, 21, 13, + 1, 16, 13, 17, 9, 20, 17, 19, 5, 22, 20, 21, 2, 24, 13, + 25, 9, 28, 16, 27, 1, 1, 15, 0, 5, 3, 20, 5, 2, 8, + 19, 6, 1, 9, 16, 11, 6, 14, 20, 13, 2, 16, 12, 17, 10, + 20, 16, 19, 6, 22, 19, 21, 3, 24, 12, 25, 10, 28, 15, 27, + 0, 1, 16, 0, 4, 3, 19, 5, 3, 8, 20, 6, 0, 9, 15, + 11, 7, 14, 19, 13, 3, 16, 11, 17, 0, 18, 15, 19, 7, 22, + 18, 21, 4, 24, 11, 25, 10, 29, 14, 27, 0, 2, 17, 0, 3, + 3, 18, 5, 4, 8, 21, 6, 0, 10, 14, 11, 8, 14, 18, 13, + 4, 16, 21, 15, 1, 18, 14, 19, 8, 22, 17, 21, 5, 24, 11, + 26, 9, 29, 13, 27, 1, 2, 18, 0, 2, 3, 17, 5, 5, 8, + 21, 7, 1, 10, 13, 11, 9, 14, 17, 13, 5, 16, 20, 15, 2, + 18, 13, 19, 9, 22, 16, 21, 6, 24, 12, 26, 8, 29, 12, 27, + 2, 2, 19, 0, 1, 3, 16, 5, 6, 8, 20, 7, 2, 10, 12, + 11, 10, 14, 16, 13, 6, 16, 19, 15, 3, 18, 12, 19, 10, 22, + 15, 21, 7, 24, 13, 26, 7, 29, 11, 27, 3, 2, 20, 0, 0, + 3, 15, 5, 7, 8, 19, 7, 3, 10, 11, 11, 0, 12, 15, 13, + 7, 16, 18, 15, 4, 18, 11, 19, 10, 23, 14, 21, 8, 24, 14, + 26, 6, 29, 11, 28, 4, 2, 21, 0, 0, 4, 14, 5, 8, 8, + 18, 7, 4, 10, 21, 9, 1, 12, 14, 13, 8, 16, 17, 15, 5, + 18, 11, 20, 9, 23, 13, 21, 9, 24, 15, 26, 5, 29, 12, 28, + 5, 2, 21, 1, 1, 4, 13, 5, 9, 8, 17, 7, 5, 10, 20, + 9, 2, 12, 13, 13, 9, 16, 16, 15, 6, 18, 12, 20, 8, 23, + 12, 21, 10, 24, 16, 26, 4, 29, 13, 28, 6, 2, 20, 1, 2, + 4, 12, 5, 10, 8, 16, 7, 6, 10, 19, 9, 3, 12, 12, 13, + 10, 16, 15, 15, 7, 18, 13, 20, 7, 23, 11, 21, 10, 25, 17, + 26, 3, 29, 14, 28, 7, 2, 19, 1, 3, 4, 11, 5, 0, 6, + 15, 7, 7, 10, 18, 9, 4, 12, 11, 13, 10, 17, 14, 15, 8, + 18, 14, 20, 6, 23, 11, 22, 9, 25, 18, 26, 2, 29, 15, 28, + 8, 2, 18, 1, 4, 4, 21, 3, 1, 6, 14, 7, 8, 10, 17, + 9, 5, 12, 11, 14, 9, 17, 13, 15, 9, 18, 15, 20, 5, 23, + 12, 22, 8, 25, 19, 26, 1, 29, 16, 28, 9, 2, 17, 1, 5, + 4, 20, 3, 2, 6, 13, 7, 9, 10, 16, 9, 6, 12, 12, 14, + 8, 17, 12, 15, 10, 18, 16, 20, 4, 23, 13, 22, 7, 25, 20, + 26, 0, 29, 17, 28, 10, 2, 16, 1, 6, 4, 19, 3, 3, 6, + 12, 7, 10, 10, 15, 9, 7, 12, 13, 14, 7, 17, 11, 15, 10, + 19, 17, 20, 3, 23, 14, 22, 6, 25, 21, 26, 10, 27, 18, 28, +}; + +static const uint8_t hq_tab_14[] = { + 0, 0, 17, 0, 0, 2, 14, 1, 9, 3, 14, 3, 9, 5, 19, + 4, 2, 6, 19, 6, 9, 6, 12, 7, 7, 9, 16, 8, 0, 9, + 15, 9, 10, 11, 15, 11, 10, 13, 18, 12, 1, 14, 18, 14, 1, + 0, 18, 0, 1, 2, 13, 1, 8, 3, 13, 3, 8, 5, 20, 4, + 3, 6, 16, 5, 10, 6, 11, 7, 6, 9, 17, 8, 0, 10, 14, + 9, 9, 11, 14, 11, 9, 13, 19, 12, 2, 14, 19, 14, 2, 0, + 19, 0, 2, 2, 12, 1, 7, 3, 12, 3, 7, 5, 21, 4, 4, + 6, 15, 5, 10, 7, 11, 8, 5, 9, 18, 8, 1, 10, 13, 9, + 8, 11, 13, 11, 8, 13, 20, 12, 3, 14, 20, 14, 3, 0, 20, + 0, 3, 2, 11, 1, 6, 3, 11, 3, 6, 5, 21, 5, 5, 6, + 14, 5, 9, 7, 12, 8, 2, 8, 19, 8, 2, 10, 12, 9, 7, + 11, 12, 11, 7, 13, 21, 12, 4, 14, 21, 14, 4, 0, 21, 0, + 4, 2, 11, 2, 5, 3, 11, 4, 1, 4, 20, 5, 6, 6, 13, + 5, 8, 7, 20, 6, 3, 8, 20, 8, 3, 10, 11, 9, 6, 11, + 11, 11, 6, 13, 21, 13, 5, 14, 14, 13, 5, 0, 21, 1, 5, + 2, 12, 2, 4, 3, 19, 2, 2, 4, 19, 5, 7, 6, 12, 5, + 7, 7, 21, 6, 4, 8, 21, 8, 4, 10, 11, 10, 5, 11, 11, + 12, 5, 13, 20, 13, 6, 14, 13, 13, 6, 0, 20, 1, 6, 2, + 13, 2, 3, 3, 20, 2, 3, 4, 18, 5, 8, 6, 11, 5, 6, + 7, 21, 7, 5, 8, 21, 9, 5, 10, 12, 10, 4, 11, 12, 12, + 4, 13, 19, 13, 7, 14, 12, 13, 7, 0, 19, 1, 7, 2, 14, + 2, 2, 3, 21, 2, 4, 4, 17, 5, 5, 5, 11, 6, 5, 7, + 20, 7, 6, 8, 20, 9, 6, 10, 13, 10, 3, 11, 13, 12, 3, + 12, 18, 13, 8, 14, 11, 13, 8, 0, 18, 1, 6, 1, 15, 2, + 1, 3, 21, 3, 5, 4, 12, 4, 4, 5, 12, 6, 4, 7, 19, + 7, 7, 8, 19, 9, 7, 10, 14, 10, 2, 11, 21, 10, 4, 12, + 17, 13, 9, 14, 11, 14, 9, 0, 11, 0, 5, 1, 16, 2, 0, + 3, 20, 3, 6, 4, 13, 4, 3, 5, 13, 6, 3, 7, 18, 7, + 8, 8, 18, 9, 8, 10, 15, 10, 1, 11, 21, 11, 5, 12, 16, + 13, 10, 14, 12, 14, 10, 0, 12, 0, 4, 1, 17, 2, 0, 4, + 19, 3, 7, 4, 14, 4, 2, 5, 14, 6, 2, 7, 17, 7, 9, + 8, 17, 9, 9, 10, 16, 10, 0, 11, 20, 11, 6, 12, 15, 13, + 3, 13, 13, 14, 10, 1, 13, 0, 3, 1, 18, 2, 8, 2, 18, + 3, 8, 4, 15, 4, 1, 5, 15, 6, 1, 7, 16, 7, 10, 8, + 16, 9, 4, 9, 17, 10, 0, 12, 19, 11, 7, 12, 14, 12, 2, + 13, 14, 14, 9, 1, 14, 0, 2, 1, 17, 1, 9, 2, 17, 3, + 9, 4, 16, 4, 0, 5, 16, 6, 0, 7, 15, 7, 10, 9, 13, + 8, 3, 9, 18, 10, 1, 12, 18, 11, 8, 12, 15, 12, 1, 13, + 15, 14, 8, 1, 15, 0, 1, 1, 16, 1, 10, 2, 16, 3, 10, + 4, 17, 4, 0, 6, 17, 6, 0, 8, 14, 7, 9, 9, 14, 8, + 2, 9, 19, 10, 2, 12, 17, 11, 9, 12, 16, 12, 0, 13, 16, + 14, 7, 1, 16, 0, 0, 1, 15, 1, 10, 3, 15, 3, 10, 5, + 18, 4, 1, 6, 18, 6, 1, 8, 13, 7, 8, 9, 15, 8, 1, + 9, 20, 10, 10, 10, 16, 11, 10, 12, 17, 12, 0, 14, 17, 14, +}; + +static const uint8_t hq_tab_15[] = { + 0, 0, 15, 1, 3, 3, 14, 2, 4, 4, 11, 5, 0, 6, 18, + 6, 8, 8, 14, 8, 4, 10, 21, 11, 9, 13, 18, 12, 8, 14, + 17, 15, 5, 17, 21, 17, 1, 0, 14, 1, 2, 3, 15, 2, 5, + 4, 11, 4, 1, 6, 19, 6, 9, 8, 15, 8, 5, 10, 20, 11, + 8, 13, 19, 12, 9, 14, 16, 15, 4, 17, 20, 17, 2, 0, 13, + 1, 1, 3, 16, 2, 6, 4, 12, 4, 2, 6, 20, 6, 10, 8, + 16, 8, 6, 10, 19, 11, 7, 13, 20, 12, 10, 14, 15, 15, 3, + 17, 19, 17, 3, 0, 12, 1, 0, 3, 17, 2, 7, 4, 13, 4, + 3, 6, 21, 6, 10, 9, 17, 8, 7, 10, 18, 11, 6, 13, 21, + 12, 10, 15, 14, 15, 2, 17, 18, 17, 4, 0, 11, 1, 0, 2, + 18, 2, 8, 4, 14, 4, 4, 6, 21, 7, 9, 9, 18, 8, 8, + 10, 17, 11, 5, 13, 21, 13, 9, 15, 13, 15, 1, 17, 17, 17, + 5, 0, 11, 0, 1, 2, 19, 2, 9, 4, 15, 4, 5, 6, 20, + 7, 8, 9, 19, 8, 9, 10, 16, 11, 4, 13, 20, 13, 8, 15, + 12, 15, 0, 17, 16, 17, 6, 0, 12, 0, 2, 2, 20, 2, 10, + 4, 16, 4, 6, 6, 19, 7, 7, 9, 20, 8, 10, 10, 15, 11, + 3, 13, 19, 13, 7, 15, 11, 15, 0, 16, 15, 17, 7, 0, 13, + 0, 3, 2, 21, 2, 10, 5, 17, 4, 7, 6, 18, 7, 6, 9, + 21, 8, 10, 11, 14, 11, 2, 13, 18, 13, 6, 15, 11, 14, 1, + 16, 14, 17, 8, 0, 14, 0, 4, 2, 21, 3, 9, 5, 18, 4, + 8, 6, 17, 7, 5, 9, 21, 9, 9, 11, 13, 11, 1, 13, 17, + 13, 5, 15, 12, 14, 2, 16, 13, 17, 9, 0, 15, 0, 5, 2, + 20, 3, 8, 5, 19, 4, 9, 6, 16, 7, 4, 9, 20, 9, 8, + 11, 12, 11, 0, 13, 16, 13, 4, 15, 13, 14, 3, 16, 12, 17, + 10, 0, 16, 0, 6, 2, 19, 3, 7, 5, 20, 4, 10, 6, 15, + 7, 3, 9, 19, 9, 7, 11, 11, 11, 0, 12, 15, 13, 3, 15, + 14, 14, 4, 16, 11, 17, 10, 1, 17, 0, 7, 2, 18, 3, 6, + 5, 21, 4, 10, 7, 14, 7, 2, 9, 18, 9, 6, 11, 11, 10, + 1, 12, 14, 13, 2, 15, 15, 14, 5, 16, 11, 16, 9, 1, 18, + 0, 8, 2, 17, 3, 5, 5, 21, 5, 9, 7, 13, 7, 1, 9, + 17, 9, 5, 11, 12, 10, 2, 12, 13, 13, 1, 15, 16, 14, 6, + 16, 12, 16, 8, 1, 19, 0, 9, 2, 16, 3, 4, 5, 20, 5, + 8, 7, 12, 7, 0, 9, 16, 9, 4, 11, 13, 10, 3, 12, 12, + 13, 0, 15, 17, 14, 7, 16, 13, 16, 7, 1, 20, 0, 10, 2, + 15, 3, 3, 5, 19, 5, 7, 7, 11, 7, 0, 8, 15, 9, 3, + 11, 14, 10, 4, 12, 11, 13, 0, 14, 18, 14, 8, 16, 14, 16, + 6, 1, 21, 0, 10, 3, 14, 3, 2, 5, 18, 5, 6, 7, 11, + 6, 1, 8, 14, 9, 2, 11, 15, 10, 5, 12, 11, 12, 1, 14, + 19, 14, 9, 16, 15, 16, 5, 1, 21, 1, 9, 3, 13, 3, 1, + 5, 17, 5, 5, 7, 12, 6, 2, 8, 13, 9, 1, 11, 16, 10, + 6, 12, 12, 12, 2, 14, 20, 14, 10, 16, 16, 16, 4, 1, 20, + 1, 8, 3, 12, 3, 0, 5, 16, 5, 4, 7, 13, 6, 3, 8, + 12, 9, 0, 11, 17, 10, 7, 12, 13, 12, 3, 14, 21, 14, 10, + 17, 17, 16, 3, 1, 19, 1, 7, 3, 11, 3, 0, 4, 15, 5, + 3, 7, 14, 6, 4, 8, 11, 9, 0, 10, 18, 10, 8, 12, 14, + 12, 4, 14, 21, 15, 9, 17, 18, 16, 2, 1, 18, 1, 6, 3, + 11, 2, 1, 4, 14, 5, 2, 7, 15, 6, 5, 8, 11, 8, 1, + 10, 19, 10, 9, 12, 15, 12, 5, 14, 20, 15, 8, 17, 19, 16, + 1, 1, 17, 1, 5, 3, 12, 2, 2, 4, 13, 5, 1, 7, 16, + 6, 6, 8, 12, 8, 2, 10, 20, 10, 10, 12, 16, 12, 6, 14, + 19, 15, 7, 17, 20, 16, 0, 1, 16, 1, 4, 3, 13, 2, 3, + 4, 12, 5, 0, 7, 17, 6, 7, 8, 13, 8, 3, 10, 21, 10, + 10, 13, 17, 12, 7, 14, 18, 15, 6, 17, 21, 16, +}; + +static const uint8_t hq_tab_16[] = { + 0, 0, 4, 1, 2, 2, 2, 3, 4, 4, 0, 5, 6, 6, 9, + 7, 8, 8, 1, 0, 3, 1, 3, 2, 1, 3, 5, 4, 10, 5, + 7, 6, 8, 7, 9, 8, 2, 0, 2, 1, 4, 2, 0, 3, 6, + 4, 9, 5, 8, 6, 7, 7, 10, 8, 3, 0, 1, 1, 5, 2, + 10, 3, 7, 4, 8, 5, 9, 6, 6, 7, 0, 8, 4, 0, 0, + 1, 6, 2, 9, 3, 8, 4, 7, 5, 10, 6, 5, 7, 1, 8, + 5, 0, 10, 1, 7, 2, 8, 3, 9, 4, 6, 5, 0, 6, 4, + 7, 2, 8, 6, 0, 9, 1, 8, 2, 7, 3, 10, 4, 5, 5, + 1, 6, 3, 7, 3, 8, 7, 0, 8, 1, 9, 2, 6, 3, 0, + 4, 4, 5, 2, 6, 2, 7, 4, 8, 8, 0, 7, 1, 10, 2, + 5, 3, 1, 4, 3, 5, 3, 6, 1, 7, 5, 8, 9, 0, 6, + 1, 0, 2, 4, 3, 2, 4, 2, 5, 4, 6, 0, 7, 6, 8, + 10, 0, 5, 1, 1, 2, 3, 3, 3, 4, 1, 5, 5, 6, 10, + 7, 7, 8, 0, 0, +}; + +static const uint8_t hq_tab_17[] = { + 0, 0, 25, 8, 34, 0, 59, 8, 68, 0, 13, 24, 22, 16, 47, + 24, 56, 16, 78, 25, 10, 32, 28, 41, 44, 32, 58, 41, 78, 32, + 8, 57, 31, 49, 38, 57, 61, 49, 68, 57, 1, 0, 26, 8, 35, + 0, 60, 8, 69, 0, 14, 24, 23, 16, 47, 25, 57, 16, 77, 25, + 11, 32, 27, 41, 45, 32, 57, 41, 79, 32, 7, 57, 30, 49, 37, + 57, 60, 49, 67, 57, 2, 0, 27, 8, 36, 0, 61, 8, 70, 0, + 15, 24, 24, 16, 46, 25, 58, 16, 76, 25, 12, 32, 26, 41, 46, + 32, 56, 41, 79, 33, 6, 57, 29, 49, 36, 57, 59, 49, 66, 57, + 3, 0, 28, 8, 37, 0, 62, 8, 71, 0, 15, 25, 25, 16, 45, + 25, 59, 16, 75, 25, 13, 32, 25, 41, 47, 32, 55, 41, 78, 33, + 5, 57, 28, 49, 35, 57, 58, 49, 65, 57, 4, 0, 29, 8, 38, + 0, 63, 8, 72, 0, 14, 25, 26, 16, 44, 25, 60, 16, 74, 25, + 14, 32, 24, 41, 47, 33, 54, 41, 77, 33, 4, 57, 27, 49, 34, + 57, 57, 49, 64, 57, 5, 0, 30, 8, 39, 0, 63, 9, 73, 0, + 13, 25, 27, 16, 43, 25, 61, 16, 73, 25, 15, 32, 23, 41, 46, + 33, 53, 41, 76, 33, 3, 57, 26, 49, 33, 57, 56, 49, 64, 58, + 6, 0, 31, 8, 40, 0, 62, 9, 74, 0, 12, 25, 28, 16, 42, + 25, 62, 16, 72, 25, 15, 33, 22, 41, 45, 33, 52, 41, 75, 33, + 2, 57, 25, 49, 32, 57, 55, 49, 65, 58, 7, 0, 31, 9, 41, + 0, 61, 9, 75, 0, 11, 25, 29, 16, 41, 25, 63, 16, 71, 25, + 14, 33, 21, 41, 44, 33, 51, 41, 74, 33, 1, 57, 24, 49, 32, + 58, 54, 49, 66, 58, 8, 0, 30, 9, 42, 0, 60, 9, 76, 0, + 10, 25, 30, 16, 40, 25, 63, 17, 70, 25, 13, 33, 20, 41, 43, + 33, 50, 41, 73, 33, 0, 57, 23, 49, 33, 58, 53, 49, 67, 58, + 9, 0, 29, 9, 43, 0, 59, 9, 77, 0, 9, 25, 31, 16, 39, + 25, 62, 17, 69, 25, 12, 33, 19, 41, 42, 33, 49, 41, 72, 33, + 0, 58, 22, 49, 34, 58, 52, 49, 68, 58, 10, 0, 28, 9, 44, + 0, 58, 9, 78, 0, 8, 25, 31, 17, 38, 25, 61, 17, 68, 25, + 11, 33, 18, 41, 41, 33, 48, 41, 71, 33, 1, 58, 21, 49, 35, + 58, 51, 49, 69, 58, 11, 0, 27, 9, 45, 0, 57, 9, 79, 0, + 7, 25, 30, 17, 37, 25, 60, 17, 67, 25, 10, 33, 17, 41, 40, + 33, 48, 42, 70, 33, 2, 58, 20, 49, 36, 58, 50, 49, 70, 58, + 12, 0, 26, 9, 46, 0, 56, 9, 79, 1, 6, 25, 29, 17, 36, + 25, 59, 17, 66, 25, 9, 33, 16, 41, 39, 33, 49, 42, 69, 33, + 3, 58, 19, 49, 37, 58, 49, 49, 71, 58, 13, 0, 25, 9, 47, + 0, 55, 9, 78, 1, 5, 25, 28, 17, 35, 25, 58, 17, 65, 25, + 8, 33, 16, 42, 38, 33, 50, 42, 68, 33, 4, 58, 18, 49, 38, + 58, 48, 49, 72, 58, 14, 0, 24, 9, 47, 1, 54, 9, 77, 1, + 4, 25, 27, 17, 34, 25, 57, 17, 64, 25, 7, 33, 17, 42, 37, + 33, 51, 42, 67, 33, 5, 58, 17, 49, 39, 58, 48, 50, 73, 58, + 15, 0, 23, 9, 46, 1, 53, 9, 76, 1, 3, 25, 26, 17, 33, + 25, 56, 17, 64, 26, 6, 33, 18, 42, 36, 33, 52, 42, 66, 33, + 6, 58, 16, 49, 40, 58, 49, 50, 74, 58, 15, 1, 22, 9, 45, + 1, 52, 9, 75, 1, 2, 25, 25, 17, 32, 25, 55, 17, 65, 26, + 5, 33, 19, 42, 35, 33, 53, 42, 65, 33, 7, 58, 16, 50, 41, + 58, 50, 50, 75, 58, 14, 1, 21, 9, 44, 1, 51, 9, 74, 1, + 1, 25, 24, 17, 32, 26, 54, 17, 66, 26, 4, 33, 20, 42, 34, + 33, 54, 42, 64, 33, 8, 58, 17, 50, 42, 58, 51, 50, 76, 58, + 13, 1, 20, 9, 43, 1, 50, 9, 73, 1, 0, 25, 23, 17, 33, + 26, 53, 17, 67, 26, 3, 33, 21, 42, 33, 33, 55, 42, 64, 34, + 9, 58, 18, 50, 43, 58, 52, 50, 77, 58, 12, 1, 19, 9, 42, + 1, 49, 9, 72, 1, 0, 26, 22, 17, 34, 26, 52, 17, 68, 26, + 2, 33, 22, 42, 32, 33, 56, 42, 65, 34, 10, 58, 19, 50, 44, + 58, 53, 50, 78, 58, 11, 1, 18, 9, 41, 1, 48, 9, 71, 1, + 1, 26, 21, 17, 35, 26, 51, 17, 69, 26, 1, 33, 23, 42, 32, + 34, 57, 42, 66, 34, 11, 58, 20, 50, 45, 58, 54, 50, 79, 58, + 10, 1, 17, 9, 40, 1, 48, 10, 70, 1, 2, 26, 20, 17, 36, + 26, 50, 17, 70, 26, 0, 33, 24, 42, 33, 34, 58, 42, 67, 34, + 12, 58, 21, 50, 46, 58, 55, 50, 79, 59, 9, 1, 16, 9, 39, + 1, 49, 10, 69, 1, 3, 26, 19, 17, 37, 26, 49, 17, 71, 26, + 0, 34, 25, 42, 34, 34, 59, 42, 68, 34, 13, 58, 22, 50, 47, + 58, 56, 50, 78, 59, 8, 1, 16, 10, 38, 1, 50, 10, 68, 1, + 4, 26, 18, 17, 38, 26, 48, 17, 72, 26, 1, 34, 26, 42, 35, + 34, 60, 42, 69, 34, 14, 58, 23, 50, 47, 59, 57, 50, 77, 59, + 7, 1, 17, 10, 37, 1, 51, 10, 67, 1, 5, 26, 17, 17, 39, + 26, 48, 18, 73, 26, 2, 34, 27, 42, 36, 34, 61, 42, 70, 34, + 15, 58, 24, 50, 46, 59, 58, 50, 76, 59, 6, 1, 18, 10, 36, + 1, 52, 10, 66, 1, 6, 26, 16, 17, 40, 26, 49, 18, 74, 26, + 3, 34, 28, 42, 37, 34, 62, 42, 71, 34, 15, 59, 25, 50, 45, + 59, 59, 50, 75, 59, 5, 1, 19, 10, 35, 1, 53, 10, 65, 1, + 7, 26, 16, 18, 41, 26, 50, 18, 75, 26, 4, 34, 29, 42, 38, + 34, 63, 42, 72, 34, 14, 59, 26, 50, 44, 59, 60, 50, 74, 59, + 4, 1, 20, 10, 34, 1, 54, 10, 64, 1, 8, 26, 17, 18, 42, + 26, 51, 18, 76, 26, 5, 34, 30, 42, 39, 34, 63, 43, 73, 34, + 13, 59, 27, 50, 43, 59, 61, 50, 73, 59, 3, 1, 21, 10, 33, + 1, 55, 10, 64, 2, 9, 26, 18, 18, 43, 26, 52, 18, 77, 26, + 6, 34, 31, 42, 40, 34, 62, 43, 74, 34, 12, 59, 28, 50, 42, + 59, 62, 50, 72, 59, 2, 1, 22, 10, 32, 1, 56, 10, 65, 2, + 10, 26, 19, 18, 44, 26, 53, 18, 78, 26, 7, 34, 31, 43, 41, + 34, 61, 43, 75, 34, 11, 59, 29, 50, 41, 59, 63, 50, 71, 59, + 1, 1, 23, 10, 32, 2, 57, 10, 66, 2, 11, 26, 20, 18, 45, + 26, 54, 18, 79, 26, 8, 34, 30, 43, 42, 34, 60, 43, 76, 34, + 10, 59, 30, 50, 40, 59, 63, 51, 70, 59, 0, 1, 24, 10, 33, + 2, 58, 10, 67, 2, 12, 26, 21, 18, 46, 26, 55, 18, 79, 27, + 9, 34, 29, 43, 43, 34, 59, 43, 77, 34, 9, 59, 31, 50, 39, + 59, 62, 51, 69, 59, 0, 2, 25, 10, 34, 2, 59, 10, 68, 2, + 13, 26, 22, 18, 47, 26, 56, 18, 78, 27, 10, 34, 28, 43, 44, + 34, 58, 43, 78, 34, 8, 59, 31, 51, 38, 59, 61, 51, 68, 59, + 1, 2, 26, 10, 35, 2, 60, 10, 69, 2, 14, 26, 23, 18, 47, + 27, 57, 18, 77, 27, 11, 34, 27, 43, 45, 34, 57, 43, 79, 34, + 7, 59, 30, 51, 37, 59, 60, 51, 67, 59, 2, 2, 27, 10, 36, + 2, 61, 10, 70, 2, 15, 26, 24, 18, 46, 27, 58, 18, 76, 27, + 12, 34, 26, 43, 46, 34, 56, 43, 79, 35, 6, 59, 29, 51, 36, + 59, 59, 51, 66, 59, 3, 2, 28, 10, 37, 2, 62, 10, 71, 2, + 15, 27, 25, 18, 45, 27, 59, 18, 75, 27, 13, 34, 25, 43, 47, + 34, 55, 43, 78, 35, 5, 59, 28, 51, 35, 59, 58, 51, 65, 59, + 4, 2, 29, 10, 38, 2, 63, 10, 72, 2, 14, 27, 26, 18, 44, + 27, 60, 18, 74, 27, 14, 34, 24, 43, 47, 35, 54, 43, 77, 35, + 4, 59, 27, 51, 34, 59, 57, 51, 64, 59, 5, 2, 30, 10, 39, + 2, 63, 11, 73, 2, 13, 27, 27, 18, 43, 27, 61, 18, 73, 27, + 15, 34, 23, 43, 46, 35, 53, 43, 76, 35, 3, 59, 26, 51, 33, + 59, 56, 51, 64, 60, 6, 2, 31, 10, 40, 2, 62, 11, 74, 2, + 12, 27, 28, 18, 42, 27, 62, 18, 72, 27, 15, 35, 22, 43, 45, + 35, 52, 43, 75, 35, 2, 59, 25, 51, 32, 59, 55, 51, 65, 60, + 7, 2, 31, 11, 41, 2, 61, 11, 75, 2, 11, 27, 29, 18, 41, + 27, 63, 18, 71, 27, 14, 35, 21, 43, 44, 35, 51, 43, 74, 35, + 1, 59, 24, 51, 32, 60, 54, 51, 66, 60, 8, 2, 30, 11, 42, + 2, 60, 11, 76, 2, 10, 27, 30, 18, 40, 27, 63, 19, 70, 27, + 13, 35, 20, 43, 43, 35, 50, 43, 73, 35, 0, 59, 23, 51, 33, + 60, 53, 51, 67, 60, 9, 2, 29, 11, 43, 2, 59, 11, 77, 2, + 9, 27, 31, 18, 39, 27, 62, 19, 69, 27, 12, 35, 19, 43, 42, + 35, 49, 43, 72, 35, 0, 60, 22, 51, 34, 60, 52, 51, 68, 60, + 10, 2, 28, 11, 44, 2, 58, 11, 78, 2, 8, 27, 31, 19, 38, + 27, 61, 19, 68, 27, 11, 35, 18, 43, 41, 35, 48, 43, 71, 35, + 1, 60, 21, 51, 35, 60, 51, 51, 69, 60, 11, 2, 27, 11, 45, + 2, 57, 11, 79, 2, 7, 27, 30, 19, 37, 27, 60, 19, 67, 27, + 10, 35, 17, 43, 40, 35, 48, 44, 70, 35, 2, 60, 20, 51, 36, + 60, 50, 51, 70, 60, 12, 2, 26, 11, 46, 2, 56, 11, 79, 3, + 6, 27, 29, 19, 36, 27, 59, 19, 66, 27, 9, 35, 16, 43, 39, + 35, 49, 44, 69, 35, 3, 60, 19, 51, 37, 60, 49, 51, 71, 60, + 13, 2, 25, 11, 47, 2, 55, 11, 78, 3, 5, 27, 28, 19, 35, + 27, 58, 19, 65, 27, 8, 35, 16, 44, 38, 35, 50, 44, 68, 35, + 4, 60, 18, 51, 38, 60, 48, 51, 72, 60, 14, 2, 24, 11, 47, + 3, 54, 11, 77, 3, 4, 27, 27, 19, 34, 27, 57, 19, 64, 27, + 7, 35, 17, 44, 37, 35, 51, 44, 67, 35, 5, 60, 17, 51, 39, + 60, 48, 52, 73, 60, 15, 2, 23, 11, 46, 3, 53, 11, 76, 3, + 3, 27, 26, 19, 33, 27, 56, 19, 64, 28, 6, 35, 18, 44, 36, + 35, 52, 44, 66, 35, 6, 60, 16, 51, 40, 60, 49, 52, 74, 60, + 15, 3, 22, 11, 45, 3, 52, 11, 75, 3, 2, 27, 25, 19, 32, + 27, 55, 19, 65, 28, 5, 35, 19, 44, 35, 35, 53, 44, 65, 35, + 7, 60, 16, 52, 41, 60, 50, 52, 75, 60, 14, 3, 21, 11, 44, + 3, 51, 11, 74, 3, 1, 27, 24, 19, 32, 28, 54, 19, 66, 28, + 4, 35, 20, 44, 34, 35, 54, 44, 64, 35, 8, 60, 17, 52, 42, + 60, 51, 52, 76, 60, 13, 3, 20, 11, 43, 3, 50, 11, 73, 3, + 0, 27, 23, 19, 33, 28, 53, 19, 67, 28, 3, 35, 21, 44, 33, + 35, 55, 44, 64, 36, 9, 60, 18, 52, 43, 60, 52, 52, 77, 60, + 12, 3, 19, 11, 42, 3, 49, 11, 72, 3, 0, 28, 22, 19, 34, + 28, 52, 19, 68, 28, 2, 35, 22, 44, 32, 35, 56, 44, 65, 36, + 10, 60, 19, 52, 44, 60, 53, 52, 78, 60, 11, 3, 18, 11, 41, + 3, 48, 11, 71, 3, 1, 28, 21, 19, 35, 28, 51, 19, 69, 28, + 1, 35, 23, 44, 32, 36, 57, 44, 66, 36, 11, 60, 20, 52, 45, + 60, 54, 52, 79, 60, 10, 3, 17, 11, 40, 3, 48, 12, 70, 3, + 2, 28, 20, 19, 36, 28, 50, 19, 70, 28, 0, 35, 24, 44, 33, + 36, 58, 44, 67, 36, 12, 60, 21, 52, 46, 60, 55, 52, 79, 61, + 9, 3, 16, 11, 39, 3, 49, 12, 69, 3, 3, 28, 19, 19, 37, + 28, 49, 19, 71, 28, 0, 36, 25, 44, 34, 36, 59, 44, 68, 36, + 13, 60, 22, 52, 47, 60, 56, 52, 78, 61, 8, 3, 16, 12, 38, + 3, 50, 12, 68, 3, 4, 28, 18, 19, 38, 28, 48, 19, 72, 28, + 1, 36, 26, 44, 35, 36, 60, 44, 69, 36, 14, 60, 23, 52, 47, + 61, 57, 52, 77, 61, 7, 3, 17, 12, 37, 3, 51, 12, 67, 3, + 5, 28, 17, 19, 39, 28, 48, 20, 73, 28, 2, 36, 27, 44, 36, + 36, 61, 44, 70, 36, 15, 60, 24, 52, 46, 61, 58, 52, 76, 61, + 6, 3, 18, 12, 36, 3, 52, 12, 66, 3, 6, 28, 16, 19, 40, + 28, 49, 20, 74, 28, 3, 36, 28, 44, 37, 36, 62, 44, 71, 36, + 15, 61, 25, 52, 45, 61, 59, 52, 75, 61, 5, 3, 19, 12, 35, + 3, 53, 12, 65, 3, 7, 28, 16, 20, 41, 28, 50, 20, 75, 28, + 4, 36, 29, 44, 38, 36, 63, 44, 72, 36, 14, 61, 26, 52, 44, + 61, 60, 52, 74, 61, 4, 3, 20, 12, 34, 3, 54, 12, 64, 3, + 8, 28, 17, 20, 42, 28, 51, 20, 76, 28, 5, 36, 30, 44, 39, + 36, 63, 45, 73, 36, 13, 61, 27, 52, 43, 61, 61, 52, 73, 61, + 3, 3, 21, 12, 33, 3, 55, 12, 64, 4, 9, 28, 18, 20, 43, + 28, 52, 20, 77, 28, 6, 36, 31, 44, 40, 36, 62, 45, 74, 36, + 12, 61, 28, 52, 42, 61, 62, 52, 72, 61, 2, 3, 22, 12, 32, + 3, 56, 12, 65, 4, 10, 28, 19, 20, 44, 28, 53, 20, 78, 28, + 7, 36, 31, 45, 41, 36, 61, 45, 75, 36, 11, 61, 29, 52, 41, + 61, 63, 52, 71, 61, 1, 3, 23, 12, 32, 4, 57, 12, 66, 4, + 11, 28, 20, 20, 45, 28, 54, 20, 79, 28, 8, 36, 30, 45, 42, + 36, 60, 45, 76, 36, 10, 61, 30, 52, 40, 61, 63, 53, 70, 61, + 0, 3, 24, 12, 33, 4, 58, 12, 67, 4, 12, 28, 21, 20, 46, + 28, 55, 20, 79, 29, 9, 36, 29, 45, 43, 36, 59, 45, 77, 36, + 9, 61, 31, 52, 39, 61, 62, 53, 69, 61, 0, 4, 25, 12, 34, + 4, 59, 12, 68, 4, 13, 28, 22, 20, 47, 28, 56, 20, 78, 29, + 10, 36, 28, 45, 44, 36, 58, 45, 78, 36, 8, 61, 31, 53, 38, + 61, 61, 53, 68, 61, 1, 4, 26, 12, 35, 4, 60, 12, 69, 4, + 14, 28, 23, 20, 47, 29, 57, 20, 77, 29, 11, 36, 27, 45, 45, + 36, 57, 45, 79, 36, 7, 61, 30, 53, 37, 61, 60, 53, 67, 61, + 2, 4, 27, 12, 36, 4, 61, 12, 70, 4, 15, 28, 24, 20, 46, + 29, 58, 20, 76, 29, 12, 36, 26, 45, 46, 36, 56, 45, 79, 37, + 6, 61, 29, 53, 36, 61, 59, 53, 66, 61, 3, 4, 28, 12, 37, + 4, 62, 12, 71, 4, 15, 29, 25, 20, 45, 29, 59, 20, 75, 29, + 13, 36, 25, 45, 47, 36, 55, 45, 78, 37, 5, 61, 28, 53, 35, + 61, 58, 53, 65, 61, 4, 4, 29, 12, 38, 4, 63, 12, 72, 4, + 14, 29, 26, 20, 44, 29, 60, 20, 74, 29, 14, 36, 24, 45, 47, + 37, 54, 45, 77, 37, 4, 61, 27, 53, 34, 61, 57, 53, 64, 61, + 5, 4, 30, 12, 39, 4, 63, 13, 73, 4, 13, 29, 27, 20, 43, + 29, 61, 20, 73, 29, 15, 36, 23, 45, 46, 37, 53, 45, 76, 37, + 3, 61, 26, 53, 33, 61, 56, 53, 64, 62, 6, 4, 31, 12, 40, + 4, 62, 13, 74, 4, 12, 29, 28, 20, 42, 29, 62, 20, 72, 29, + 15, 37, 22, 45, 45, 37, 52, 45, 75, 37, 2, 61, 25, 53, 32, + 61, 55, 53, 65, 62, 7, 4, 31, 13, 41, 4, 61, 13, 75, 4, + 11, 29, 29, 20, 41, 29, 63, 20, 71, 29, 14, 37, 21, 45, 44, + 37, 51, 45, 74, 37, 1, 61, 24, 53, 32, 62, 54, 53, 66, 62, + 8, 4, 30, 13, 42, 4, 60, 13, 76, 4, 10, 29, 30, 20, 40, + 29, 63, 21, 70, 29, 13, 37, 20, 45, 43, 37, 50, 45, 73, 37, + 0, 61, 23, 53, 33, 62, 53, 53, 67, 62, 9, 4, 29, 13, 43, + 4, 59, 13, 77, 4, 9, 29, 31, 20, 39, 29, 62, 21, 69, 29, + 12, 37, 19, 45, 42, 37, 49, 45, 72, 37, 0, 62, 22, 53, 34, + 62, 52, 53, 68, 62, 10, 4, 28, 13, 44, 4, 58, 13, 78, 4, + 8, 29, 31, 21, 38, 29, 61, 21, 68, 29, 11, 37, 18, 45, 41, + 37, 48, 45, 71, 37, 1, 62, 21, 53, 35, 62, 51, 53, 69, 62, + 11, 4, 27, 13, 45, 4, 57, 13, 79, 4, 7, 29, 30, 21, 37, + 29, 60, 21, 67, 29, 10, 37, 17, 45, 40, 37, 48, 46, 70, 37, + 2, 62, 20, 53, 36, 62, 50, 53, 70, 62, 12, 4, 26, 13, 46, + 4, 56, 13, 79, 5, 6, 29, 29, 21, 36, 29, 59, 21, 66, 29, + 9, 37, 16, 45, 39, 37, 49, 46, 69, 37, 3, 62, 19, 53, 37, + 62, 49, 53, 71, 62, 13, 4, 25, 13, 47, 4, 55, 13, 78, 5, + 5, 29, 28, 21, 35, 29, 58, 21, 65, 29, 8, 37, 16, 46, 38, + 37, 50, 46, 68, 37, 4, 62, 18, 53, 38, 62, 48, 53, 72, 62, + 14, 4, 24, 13, 47, 5, 54, 13, 77, 5, 4, 29, 27, 21, 34, + 29, 57, 21, 64, 29, 7, 37, 17, 46, 37, 37, 51, 46, 67, 37, + 5, 62, 17, 53, 39, 62, 48, 54, 73, 62, 15, 4, 23, 13, 46, + 5, 53, 13, 76, 5, 3, 29, 26, 21, 33, 29, 56, 21, 64, 30, + 6, 37, 18, 46, 36, 37, 52, 46, 66, 37, 6, 62, 16, 53, 40, + 62, 49, 54, 74, 62, 15, 5, 22, 13, 45, 5, 52, 13, 75, 5, + 2, 29, 25, 21, 32, 29, 55, 21, 65, 30, 5, 37, 19, 46, 35, + 37, 53, 46, 65, 37, 7, 62, 16, 54, 41, 62, 50, 54, 75, 62, + 14, 5, 21, 13, 44, 5, 51, 13, 74, 5, 1, 29, 24, 21, 32, + 30, 54, 21, 66, 30, 4, 37, 20, 46, 34, 37, 54, 46, 64, 37, + 8, 62, 17, 54, 42, 62, 51, 54, 76, 62, 13, 5, 20, 13, 43, + 5, 50, 13, 73, 5, 0, 29, 23, 21, 33, 30, 53, 21, 67, 30, + 3, 37, 21, 46, 33, 37, 55, 46, 64, 38, 9, 62, 18, 54, 43, + 62, 52, 54, 77, 62, 12, 5, 19, 13, 42, 5, 49, 13, 72, 5, + 0, 30, 22, 21, 34, 30, 52, 21, 68, 30, 2, 37, 22, 46, 32, + 37, 56, 46, 65, 38, 10, 62, 19, 54, 44, 62, 53, 54, 78, 62, + 11, 5, 18, 13, 41, 5, 48, 13, 71, 5, 1, 30, 21, 21, 35, + 30, 51, 21, 69, 30, 1, 37, 23, 46, 32, 38, 57, 46, 66, 38, + 11, 62, 20, 54, 45, 62, 54, 54, 79, 62, 10, 5, 17, 13, 40, + 5, 48, 14, 70, 5, 2, 30, 20, 21, 36, 30, 50, 21, 70, 30, + 0, 37, 24, 46, 33, 38, 58, 46, 67, 38, 12, 62, 21, 54, 46, + 62, 55, 54, 79, 63, 9, 5, 16, 13, 39, 5, 49, 14, 69, 5, + 3, 30, 19, 21, 37, 30, 49, 21, 71, 30, 0, 38, 25, 46, 34, + 38, 59, 46, 68, 38, 13, 62, 22, 54, 47, 62, 56, 54, 78, 63, + 8, 5, 16, 14, 38, 5, 50, 14, 68, 5, 4, 30, 18, 21, 38, + 30, 48, 21, 72, 30, 1, 38, 26, 46, 35, 38, 60, 46, 69, 38, + 14, 62, 23, 54, 47, 63, 57, 54, 77, 63, 7, 5, 17, 14, 37, + 5, 51, 14, 67, 5, 5, 30, 17, 21, 39, 30, 48, 22, 73, 30, + 2, 38, 27, 46, 36, 38, 61, 46, 70, 38, 15, 62, 24, 54, 46, + 63, 58, 54, 76, 63, 6, 5, 18, 14, 36, 5, 52, 14, 66, 5, + 6, 30, 16, 21, 40, 30, 49, 22, 74, 30, 3, 38, 28, 46, 37, + 38, 62, 46, 71, 38, 15, 63, 25, 54, 45, 63, 59, 54, 75, 63, + 5, 5, 19, 14, 35, 5, 53, 14, 65, 5, 7, 30, 16, 22, 41, + 30, 50, 22, 75, 30, 4, 38, 29, 46, 38, 38, 63, 46, 72, 38, + 14, 63, 26, 54, 44, 63, 60, 54, 74, 63, 4, 5, 20, 14, 34, + 5, 54, 14, 64, 5, 8, 30, 17, 22, 42, 30, 51, 22, 76, 30, + 5, 38, 30, 46, 39, 38, 63, 47, 73, 38, 13, 63, 27, 54, 43, + 63, 61, 54, 73, 63, 3, 5, 21, 14, 33, 5, 55, 14, 64, 6, + 9, 30, 18, 22, 43, 30, 52, 22, 77, 30, 6, 38, 31, 46, 40, + 38, 62, 47, 74, 38, 12, 63, 28, 54, 42, 63, 62, 54, 72, 63, + 2, 5, 22, 14, 32, 5, 56, 14, 65, 6, 10, 30, 19, 22, 44, + 30, 53, 22, 78, 30, 7, 38, 31, 47, 41, 38, 61, 47, 75, 38, + 11, 63, 29, 54, 41, 63, 63, 54, 71, 63, 1, 5, 23, 14, 32, + 6, 57, 14, 66, 6, 11, 30, 20, 22, 45, 30, 54, 22, 79, 30, + 8, 38, 30, 47, 42, 38, 60, 47, 76, 38, 10, 63, 30, 54, 40, + 63, 63, 55, 70, 63, 0, 5, 24, 14, 33, 6, 58, 14, 67, 6, + 12, 30, 21, 22, 46, 30, 55, 22, 79, 31, 9, 38, 29, 47, 43, + 38, 59, 47, 77, 38, 9, 63, 31, 54, 39, 63, 62, 55, 69, 63, + 0, 6, 25, 14, 34, 6, 59, 14, 68, 6, 13, 30, 22, 22, 47, + 30, 56, 22, 78, 31, 10, 38, 28, 47, 44, 38, 58, 47, 78, 38, + 8, 63, 31, 55, 38, 63, 61, 55, 68, 63, 1, 6, 26, 14, 35, + 6, 60, 14, 69, 6, 14, 30, 23, 22, 47, 31, 57, 22, 77, 31, + 11, 38, 27, 47, 45, 38, 57, 47, 79, 38, 7, 63, 30, 55, 37, + 63, 60, 55, 67, 63, 2, 6, 27, 14, 36, 6, 61, 14, 70, 6, + 15, 30, 24, 22, 46, 31, 58, 22, 76, 31, 12, 38, 26, 47, 46, + 38, 56, 47, 79, 39, 6, 63, 29, 55, 36, 63, 59, 55, 66, 63, + 3, 6, 28, 14, 37, 6, 62, 14, 71, 6, 15, 31, 25, 22, 45, + 31, 59, 22, 75, 31, 13, 38, 25, 47, 47, 38, 55, 47, 78, 39, + 5, 63, 28, 55, 35, 63, 58, 55, 65, 63, 4, 6, 29, 14, 38, + 6, 63, 14, 72, 6, 14, 31, 26, 22, 44, 31, 60, 22, 74, 31, + 14, 38, 24, 47, 47, 39, 54, 47, 77, 39, 4, 63, 27, 55, 34, + 63, 57, 55, 64, 63, 5, 6, 30, 14, 39, 6, 63, 15, 73, 6, + 13, 31, 27, 22, 43, 31, 61, 22, 73, 31, 15, 38, 23, 47, 46, + 39, 53, 47, 76, 39, 3, 63, 26, 55, 33, 63, 56, 55, 64, 48, + 6, 6, 31, 14, 40, 6, 62, 15, 74, 6, 12, 31, 28, 22, 42, + 31, 62, 22, 72, 31, 15, 39, 22, 47, 45, 39, 52, 47, 75, 39, + 2, 63, 25, 55, 32, 63, 55, 55, 65, 48, 7, 6, 31, 15, 41, + 6, 61, 15, 75, 6, 11, 31, 29, 22, 41, 31, 63, 22, 71, 31, + 14, 39, 21, 47, 44, 39, 51, 47, 74, 39, 1, 63, 24, 55, 32, + 48, 54, 55, 66, 48, 8, 6, 30, 15, 42, 6, 60, 15, 76, 6, + 10, 31, 30, 22, 40, 31, 63, 23, 70, 31, 13, 39, 20, 47, 43, + 39, 50, 47, 73, 39, 0, 63, 23, 55, 33, 48, 53, 55, 67, 48, + 9, 6, 29, 15, 43, 6, 59, 15, 77, 6, 9, 31, 31, 22, 39, + 31, 62, 23, 69, 31, 12, 39, 19, 47, 42, 39, 49, 47, 72, 39, + 0, 48, 22, 55, 34, 48, 52, 55, 68, 48, 10, 6, 28, 15, 44, + 6, 58, 15, 78, 6, 8, 31, 31, 23, 38, 31, 61, 23, 68, 31, + 11, 39, 18, 47, 41, 39, 48, 47, 71, 39, 1, 48, 21, 55, 35, + 48, 51, 55, 69, 48, 11, 6, 27, 15, 45, 6, 57, 15, 79, 6, + 7, 31, 30, 23, 37, 31, 60, 23, 67, 31, 10, 39, 17, 47, 40, + 39, 48, 32, 70, 39, 2, 48, 20, 55, 36, 48, 50, 55, 70, 48, + 12, 6, 26, 15, 46, 6, 56, 15, 79, 7, 6, 31, 29, 23, 36, + 31, 59, 23, 66, 31, 9, 39, 16, 47, 39, 39, 49, 32, 69, 39, + 3, 48, 19, 55, 37, 48, 49, 55, 71, 48, 13, 6, 25, 15, 47, + 6, 55, 15, 78, 7, 5, 31, 28, 23, 35, 31, 58, 23, 65, 31, + 8, 39, 16, 32, 38, 39, 50, 32, 68, 39, 4, 48, 18, 55, 38, + 48, 48, 55, 72, 48, 14, 6, 24, 15, 47, 7, 54, 15, 77, 7, + 4, 31, 27, 23, 34, 31, 57, 23, 64, 31, 7, 39, 17, 32, 37, + 39, 51, 32, 67, 39, 5, 48, 17, 55, 39, 48, 48, 56, 73, 48, + 15, 6, 23, 15, 46, 7, 53, 15, 76, 7, 3, 31, 26, 23, 33, + 31, 56, 23, 64, 16, 6, 39, 18, 32, 36, 39, 52, 32, 66, 39, + 6, 48, 16, 55, 40, 48, 49, 56, 74, 48, 15, 7, 22, 15, 45, + 7, 52, 15, 75, 7, 2, 31, 25, 23, 32, 31, 55, 23, 65, 16, + 5, 39, 19, 32, 35, 39, 53, 32, 65, 39, 7, 48, 16, 56, 41, + 48, 50, 56, 75, 48, 14, 7, 21, 15, 44, 7, 51, 15, 74, 7, + 1, 31, 24, 23, 32, 16, 54, 23, 66, 16, 4, 39, 20, 32, 34, + 39, 54, 32, 64, 39, 8, 48, 17, 56, 42, 48, 51, 56, 76, 48, + 13, 7, 20, 15, 43, 7, 50, 15, 73, 7, 0, 31, 23, 23, 33, + 16, 53, 23, 67, 16, 3, 39, 21, 32, 33, 39, 55, 32, 64, 40, + 9, 48, 18, 56, 43, 48, 52, 56, 77, 48, 12, 7, 19, 15, 42, + 7, 49, 15, 72, 7, 0, 16, 22, 23, 34, 16, 52, 23, 68, 16, + 2, 39, 22, 32, 32, 39, 56, 32, 65, 40, 10, 48, 19, 56, 44, + 48, 53, 56, 78, 48, 11, 7, 18, 15, 41, 7, 48, 15, 71, 7, + 1, 16, 21, 23, 35, 16, 51, 23, 69, 16, 1, 39, 23, 32, 32, + 40, 57, 32, 66, 40, 11, 48, 20, 56, 45, 48, 54, 56, 79, 48, + 10, 7, 17, 15, 40, 7, 48, 0, 70, 7, 2, 16, 20, 23, 36, + 16, 50, 23, 70, 16, 0, 39, 24, 32, 33, 40, 58, 32, 67, 40, + 12, 48, 21, 56, 46, 48, 55, 56, 79, 49, 9, 7, 16, 15, 39, + 7, 49, 0, 69, 7, 3, 16, 19, 23, 37, 16, 49, 23, 71, 16, + 0, 40, 25, 32, 34, 40, 59, 32, 68, 40, 13, 48, 22, 56, 47, + 48, 56, 56, 78, 49, 8, 7, 16, 0, 38, 7, 50, 0, 68, 7, + 4, 16, 18, 23, 38, 16, 48, 23, 72, 16, 1, 40, 26, 32, 35, + 40, 60, 32, 69, 40, 14, 48, 23, 56, 47, 49, 57, 56, 77, 49, + 7, 7, 17, 0, 37, 7, 51, 0, 67, 7, 5, 16, 17, 23, 39, + 16, 48, 24, 73, 16, 2, 40, 27, 32, 36, 40, 61, 32, 70, 40, + 15, 48, 24, 56, 46, 49, 58, 56, 76, 49, 6, 7, 18, 0, 36, + 7, 52, 0, 66, 7, 6, 16, 16, 23, 40, 16, 49, 24, 74, 16, + 3, 40, 28, 32, 37, 40, 62, 32, 71, 40, 15, 49, 25, 56, 45, + 49, 59, 56, 75, 49, 5, 7, 19, 0, 35, 7, 53, 0, 65, 7, + 7, 16, 16, 24, 41, 16, 50, 24, 75, 16, 4, 40, 29, 32, 38, + 40, 63, 32, 72, 40, 14, 49, 26, 56, 44, 49, 60, 56, 74, 49, + 4, 7, 20, 0, 34, 7, 54, 0, 64, 7, 8, 16, 17, 24, 42, + 16, 51, 24, 76, 16, 5, 40, 30, 32, 39, 40, 63, 33, 73, 40, + 13, 49, 27, 56, 43, 49, 61, 56, 73, 49, 3, 7, 21, 0, 33, + 7, 55, 0, 64, 8, 9, 16, 18, 24, 43, 16, 52, 24, 77, 16, + 6, 40, 31, 32, 40, 40, 62, 33, 74, 40, 12, 49, 28, 56, 42, + 49, 62, 56, 72, 49, 2, 7, 22, 0, 32, 7, 56, 0, 65, 8, + 10, 16, 19, 24, 44, 16, 53, 24, 78, 16, 7, 40, 31, 33, 41, + 40, 61, 33, 75, 40, 11, 49, 29, 56, 41, 49, 63, 56, 71, 49, + 1, 7, 23, 0, 32, 8, 57, 0, 66, 8, 11, 16, 20, 24, 45, + 16, 54, 24, 79, 16, 8, 40, 30, 33, 42, 40, 60, 33, 76, 40, + 10, 49, 30, 56, 40, 49, 63, 57, 70, 49, 0, 7, 24, 0, 33, + 8, 58, 0, 67, 8, 12, 16, 21, 24, 46, 16, 55, 24, 79, 17, + 9, 40, 29, 33, 43, 40, 59, 33, 77, 40, 9, 49, 31, 56, 39, + 49, 62, 57, 69, 49, 0, 8, 25, 0, 34, 8, 59, 0, 68, 8, + 13, 16, 22, 24, 47, 16, 56, 24, 78, 17, 10, 40, 28, 33, 44, + 40, 58, 33, 78, 40, 8, 49, 31, 57, 38, 49, 61, 57, 68, 49, + 1, 8, 26, 0, 35, 8, 60, 0, 69, 8, 14, 16, 23, 24, 47, + 17, 57, 24, 77, 17, 11, 40, 27, 33, 45, 40, 57, 33, 79, 40, + 7, 49, 30, 57, 37, 49, 60, 57, 67, 49, 2, 8, 27, 0, 36, + 8, 61, 0, 70, 8, 15, 16, 24, 24, 46, 17, 58, 24, 76, 17, + 12, 40, 26, 33, 46, 40, 56, 33, 79, 41, 6, 49, 29, 57, 36, + 49, 59, 57, 66, 49, 3, 8, 28, 0, 37, 8, 62, 0, 71, 8, + 15, 17, 25, 24, 45, 17, 59, 24, 75, 17, 13, 40, 25, 33, 47, + 40, 55, 33, 78, 41, 5, 49, 28, 57, 35, 49, 58, 57, 65, 49, + 4, 8, 29, 0, 38, 8, 63, 0, 72, 8, 14, 17, 26, 24, 44, + 17, 60, 24, 74, 17, 14, 40, 24, 33, 47, 41, 54, 33, 77, 41, + 4, 49, 27, 57, 34, 49, 57, 57, 64, 49, 5, 8, 30, 0, 39, + 8, 63, 1, 73, 8, 13, 17, 27, 24, 43, 17, 61, 24, 73, 17, + 15, 40, 23, 33, 46, 41, 53, 33, 76, 41, 3, 49, 26, 57, 33, + 49, 56, 57, 64, 50, 6, 8, 31, 0, 40, 8, 62, 1, 74, 8, + 12, 17, 28, 24, 42, 17, 62, 24, 72, 17, 15, 41, 22, 33, 45, + 41, 52, 33, 75, 41, 2, 49, 25, 57, 32, 49, 55, 57, 65, 50, + 7, 8, 31, 1, 41, 8, 61, 1, 75, 8, 11, 17, 29, 24, 41, + 17, 63, 24, 71, 17, 14, 41, 21, 33, 44, 41, 51, 33, 74, 41, + 1, 49, 24, 57, 32, 50, 54, 57, 66, 50, 8, 8, 30, 1, 42, + 8, 60, 1, 76, 8, 10, 17, 30, 24, 40, 17, 63, 25, 70, 17, + 13, 41, 20, 33, 43, 41, 50, 33, 73, 41, 0, 49, 23, 57, 33, + 50, 53, 57, 67, 50, 9, 8, 29, 1, 43, 8, 59, 1, 77, 8, + 9, 17, 31, 24, 39, 17, 62, 25, 69, 17, 12, 41, 19, 33, 42, + 41, 49, 33, 72, 41, 0, 50, 22, 57, 34, 50, 52, 57, 68, 50, + 10, 8, 28, 1, 44, 8, 58, 1, 78, 8, 8, 17, 31, 25, 38, + 17, 61, 25, 68, 17, 11, 41, 18, 33, 41, 41, 48, 33, 71, 41, + 1, 50, 21, 57, 35, 50, 51, 57, 69, 50, 11, 8, 27, 1, 45, + 8, 57, 1, 79, 8, 7, 17, 30, 25, 37, 17, 60, 25, 67, 17, + 10, 41, 17, 33, 40, 41, 48, 34, 70, 41, 2, 50, 20, 57, 36, + 50, 50, 57, 70, 50, 12, 8, 26, 1, 46, 8, 56, 1, 79, 9, + 6, 17, 29, 25, 36, 17, 59, 25, 66, 17, 9, 41, 16, 33, 39, + 41, 49, 34, 69, 41, 3, 50, 19, 57, 37, 50, 49, 57, 71, 50, + 13, 8, 25, 1, 47, 8, 55, 1, 78, 9, 5, 17, 28, 25, 35, + 17, 58, 25, 65, 17, 8, 41, 16, 34, 38, 41, 50, 34, 68, 41, + 4, 50, 18, 57, 38, 50, 48, 57, 72, 50, 14, 8, 24, 1, 47, + 9, 54, 1, 77, 9, 4, 17, 27, 25, 34, 17, 57, 25, 64, 17, + 7, 41, 17, 34, 37, 41, 51, 34, 67, 41, 5, 50, 17, 57, 39, + 50, 48, 58, 73, 50, 15, 8, 23, 1, 46, 9, 53, 1, 76, 9, + 3, 17, 26, 25, 33, 17, 56, 25, 64, 18, 6, 41, 18, 34, 36, + 41, 52, 34, 66, 41, 6, 50, 16, 57, 40, 50, 49, 58, 74, 50, + 15, 9, 22, 1, 45, 9, 52, 1, 75, 9, 2, 17, 25, 25, 32, + 17, 55, 25, 65, 18, 5, 41, 19, 34, 35, 41, 53, 34, 65, 41, + 7, 50, 16, 58, 41, 50, 50, 58, 75, 50, 14, 9, 21, 1, 44, + 9, 51, 1, 74, 9, 1, 17, 24, 25, 32, 18, 54, 25, 66, 18, + 4, 41, 20, 34, 34, 41, 54, 34, 64, 41, 8, 50, 17, 58, 42, + 50, 51, 58, 76, 50, 13, 9, 20, 1, 43, 9, 50, 1, 73, 9, + 0, 17, 23, 25, 33, 18, 53, 25, 67, 18, 3, 41, 21, 34, 33, + 41, 55, 34, 64, 42, 9, 50, 18, 58, 43, 50, 52, 58, 77, 50, + 12, 9, 19, 1, 42, 9, 49, 1, 72, 9, 0, 18, 22, 25, 34, + 18, 52, 25, 68, 18, 2, 41, 22, 34, 32, 41, 56, 34, 65, 42, + 10, 50, 19, 58, 44, 50, 53, 58, 78, 50, 11, 9, 18, 1, 41, + 9, 48, 1, 71, 9, 1, 18, 21, 25, 35, 18, 51, 25, 69, 18, + 1, 41, 23, 34, 32, 42, 57, 34, 66, 42, 11, 50, 20, 58, 45, + 50, 54, 58, 79, 50, 10, 9, 17, 1, 40, 9, 48, 2, 70, 9, + 2, 18, 20, 25, 36, 18, 50, 25, 70, 18, 0, 41, 24, 34, 33, + 42, 58, 34, 67, 42, 12, 50, 21, 58, 46, 50, 55, 58, 79, 51, + 9, 9, 16, 1, 39, 9, 49, 2, 69, 9, 3, 18, 19, 25, 37, + 18, 49, 25, 71, 18, 0, 42, 25, 34, 34, 42, 59, 34, 68, 42, + 13, 50, 22, 58, 47, 50, 56, 58, 78, 51, 8, 9, 16, 2, 38, + 9, 50, 2, 68, 9, 4, 18, 18, 25, 38, 18, 48, 25, 72, 18, + 1, 42, 26, 34, 35, 42, 60, 34, 69, 42, 14, 50, 23, 58, 47, + 51, 57, 58, 77, 51, 7, 9, 17, 2, 37, 9, 51, 2, 67, 9, + 5, 18, 17, 25, 39, 18, 48, 26, 73, 18, 2, 42, 27, 34, 36, + 42, 61, 34, 70, 42, 15, 50, 24, 58, 46, 51, 58, 58, 76, 51, + 6, 9, 18, 2, 36, 9, 52, 2, 66, 9, 6, 18, 16, 25, 40, + 18, 49, 26, 74, 18, 3, 42, 28, 34, 37, 42, 62, 34, 71, 42, + 15, 51, 25, 58, 45, 51, 59, 58, 75, 51, 5, 9, 19, 2, 35, + 9, 53, 2, 65, 9, 7, 18, 16, 26, 41, 18, 50, 26, 75, 18, + 4, 42, 29, 34, 38, 42, 63, 34, 72, 42, 14, 51, 26, 58, 44, + 51, 60, 58, 74, 51, 4, 9, 20, 2, 34, 9, 54, 2, 64, 9, + 8, 18, 17, 26, 42, 18, 51, 26, 76, 18, 5, 42, 30, 34, 39, + 42, 63, 35, 73, 42, 13, 51, 27, 58, 43, 51, 61, 58, 73, 51, + 3, 9, 21, 2, 33, 9, 55, 2, 64, 10, 9, 18, 18, 26, 43, + 18, 52, 26, 77, 18, 6, 42, 31, 34, 40, 42, 62, 35, 74, 42, + 12, 51, 28, 58, 42, 51, 62, 58, 72, 51, 2, 9, 22, 2, 32, + 9, 56, 2, 65, 10, 10, 18, 19, 26, 44, 18, 53, 26, 78, 18, + 7, 42, 31, 35, 41, 42, 61, 35, 75, 42, 11, 51, 29, 58, 41, + 51, 63, 58, 71, 51, 1, 9, 23, 2, 32, 10, 57, 2, 66, 10, + 11, 18, 20, 26, 45, 18, 54, 26, 79, 18, 8, 42, 30, 35, 42, + 42, 60, 35, 76, 42, 10, 51, 30, 58, 40, 51, 63, 59, 70, 51, + 0, 9, 24, 2, 33, 10, 58, 2, 67, 10, 12, 18, 21, 26, 46, + 18, 55, 26, 79, 19, 9, 42, 29, 35, 43, 42, 59, 35, 77, 42, + 9, 51, 31, 58, 39, 51, 62, 59, 69, 51, 0, 10, 25, 2, 34, + 10, 59, 2, 68, 10, 13, 18, 22, 26, 47, 18, 56, 26, 78, 19, + 10, 42, 28, 35, 44, 42, 58, 35, 78, 42, 8, 51, 31, 59, 38, + 51, 61, 59, 68, 51, 1, 10, 26, 2, 35, 10, 60, 2, 69, 10, + 14, 18, 23, 26, 47, 19, 57, 26, 77, 19, 11, 42, 27, 35, 45, + 42, 57, 35, 79, 42, 7, 51, 30, 59, 37, 51, 60, 59, 67, 51, + 2, 10, 27, 2, 36, 10, 61, 2, 70, 10, 15, 18, 24, 26, 46, + 19, 58, 26, 76, 19, 12, 42, 26, 35, 46, 42, 56, 35, 79, 43, + 6, 51, 29, 59, 36, 51, 59, 59, 66, 51, 3, 10, 28, 2, 37, + 10, 62, 2, 71, 10, 15, 19, 25, 26, 45, 19, 59, 26, 75, 19, + 13, 42, 25, 35, 47, 42, 55, 35, 78, 43, 5, 51, 28, 59, 35, + 51, 58, 59, 65, 51, 4, 10, 29, 2, 38, 10, 63, 2, 72, 10, + 14, 19, 26, 26, 44, 19, 60, 26, 74, 19, 14, 42, 24, 35, 47, + 43, 54, 35, 77, 43, 4, 51, 27, 59, 34, 51, 57, 59, 64, 51, + 5, 10, 30, 2, 39, 10, 63, 3, 73, 10, 13, 19, 27, 26, 43, + 19, 61, 26, 73, 19, 15, 42, 23, 35, 46, 43, 53, 35, 76, 43, + 3, 51, 26, 59, 33, 51, 56, 59, 64, 52, 6, 10, 31, 2, 40, + 10, 62, 3, 74, 10, 12, 19, 28, 26, 42, 19, 62, 26, 72, 19, + 15, 43, 22, 35, 45, 43, 52, 35, 75, 43, 2, 51, 25, 59, 32, + 51, 55, 59, 65, 52, 7, 10, 31, 3, 41, 10, 61, 3, 75, 10, + 11, 19, 29, 26, 41, 19, 63, 26, 71, 19, 14, 43, 21, 35, 44, + 43, 51, 35, 74, 43, 1, 51, 24, 59, 32, 52, 54, 59, 66, 52, + 8, 10, 30, 3, 42, 10, 60, 3, 76, 10, 10, 19, 30, 26, 40, + 19, 63, 27, 70, 19, 13, 43, 20, 35, 43, 43, 50, 35, 73, 43, + 0, 51, 23, 59, 33, 52, 53, 59, 67, 52, 9, 10, 29, 3, 43, + 10, 59, 3, 77, 10, 9, 19, 31, 26, 39, 19, 62, 27, 69, 19, + 12, 43, 19, 35, 42, 43, 49, 35, 72, 43, 0, 52, 22, 59, 34, + 52, 52, 59, 68, 52, 10, 10, 28, 3, 44, 10, 58, 3, 78, 10, + 8, 19, 31, 27, 38, 19, 61, 27, 68, 19, 11, 43, 18, 35, 41, + 43, 48, 35, 71, 43, 1, 52, 21, 59, 35, 52, 51, 59, 69, 52, + 11, 10, 27, 3, 45, 10, 57, 3, 79, 10, 7, 19, 30, 27, 37, + 19, 60, 27, 67, 19, 10, 43, 17, 35, 40, 43, 48, 36, 70, 43, + 2, 52, 20, 59, 36, 52, 50, 59, 70, 52, 12, 10, 26, 3, 46, + 10, 56, 3, 79, 11, 6, 19, 29, 27, 36, 19, 59, 27, 66, 19, + 9, 43, 16, 35, 39, 43, 49, 36, 69, 43, 3, 52, 19, 59, 37, + 52, 49, 59, 71, 52, 13, 10, 25, 3, 47, 10, 55, 3, 78, 11, + 5, 19, 28, 27, 35, 19, 58, 27, 65, 19, 8, 43, 16, 36, 38, + 43, 50, 36, 68, 43, 4, 52, 18, 59, 38, 52, 48, 59, 72, 52, + 14, 10, 24, 3, 47, 11, 54, 3, 77, 11, 4, 19, 27, 27, 34, + 19, 57, 27, 64, 19, 7, 43, 17, 36, 37, 43, 51, 36, 67, 43, + 5, 52, 17, 59, 39, 52, 48, 60, 73, 52, 15, 10, 23, 3, 46, + 11, 53, 3, 76, 11, 3, 19, 26, 27, 33, 19, 56, 27, 64, 20, + 6, 43, 18, 36, 36, 43, 52, 36, 66, 43, 6, 52, 16, 59, 40, + 52, 49, 60, 74, 52, 15, 11, 22, 3, 45, 11, 52, 3, 75, 11, + 2, 19, 25, 27, 32, 19, 55, 27, 65, 20, 5, 43, 19, 36, 35, + 43, 53, 36, 65, 43, 7, 52, 16, 60, 41, 52, 50, 60, 75, 52, + 14, 11, 21, 3, 44, 11, 51, 3, 74, 11, 1, 19, 24, 27, 32, + 20, 54, 27, 66, 20, 4, 43, 20, 36, 34, 43, 54, 36, 64, 43, + 8, 52, 17, 60, 42, 52, 51, 60, 76, 52, 13, 11, 20, 3, 43, + 11, 50, 3, 73, 11, 0, 19, 23, 27, 33, 20, 53, 27, 67, 20, + 3, 43, 21, 36, 33, 43, 55, 36, 64, 44, 9, 52, 18, 60, 43, + 52, 52, 60, 77, 52, 12, 11, 19, 3, 42, 11, 49, 3, 72, 11, + 0, 20, 22, 27, 34, 20, 52, 27, 68, 20, 2, 43, 22, 36, 32, + 43, 56, 36, 65, 44, 10, 52, 19, 60, 44, 52, 53, 60, 78, 52, + 11, 11, 18, 3, 41, 11, 48, 3, 71, 11, 1, 20, 21, 27, 35, + 20, 51, 27, 69, 20, 1, 43, 23, 36, 32, 44, 57, 36, 66, 44, + 11, 52, 20, 60, 45, 52, 54, 60, 79, 52, 10, 11, 17, 3, 40, + 11, 48, 4, 70, 11, 2, 20, 20, 27, 36, 20, 50, 27, 70, 20, + 0, 43, 24, 36, 33, 44, 58, 36, 67, 44, 12, 52, 21, 60, 46, + 52, 55, 60, 79, 53, 9, 11, 16, 3, 39, 11, 49, 4, 69, 11, + 3, 20, 19, 27, 37, 20, 49, 27, 71, 20, 0, 44, 25, 36, 34, + 44, 59, 36, 68, 44, 13, 52, 22, 60, 47, 52, 56, 60, 78, 53, + 8, 11, 16, 4, 38, 11, 50, 4, 68, 11, 4, 20, 18, 27, 38, + 20, 48, 27, 72, 20, 1, 44, 26, 36, 35, 44, 60, 36, 69, 44, + 14, 52, 23, 60, 47, 53, 57, 60, 77, 53, 7, 11, 17, 4, 37, + 11, 51, 4, 67, 11, 5, 20, 17, 27, 39, 20, 48, 28, 73, 20, + 2, 44, 27, 36, 36, 44, 61, 36, 70, 44, 15, 52, 24, 60, 46, + 53, 58, 60, 76, 53, 6, 11, 18, 4, 36, 11, 52, 4, 66, 11, + 6, 20, 16, 27, 40, 20, 49, 28, 74, 20, 3, 44, 28, 36, 37, + 44, 62, 36, 71, 44, 15, 53, 25, 60, 45, 53, 59, 60, 75, 53, + 5, 11, 19, 4, 35, 11, 53, 4, 65, 11, 7, 20, 16, 28, 41, + 20, 50, 28, 75, 20, 4, 44, 29, 36, 38, 44, 63, 36, 72, 44, + 14, 53, 26, 60, 44, 53, 60, 60, 74, 53, 4, 11, 20, 4, 34, + 11, 54, 4, 64, 11, 8, 20, 17, 28, 42, 20, 51, 28, 76, 20, + 5, 44, 30, 36, 39, 44, 63, 37, 73, 44, 13, 53, 27, 60, 43, + 53, 61, 60, 73, 53, 3, 11, 21, 4, 33, 11, 55, 4, 64, 12, + 9, 20, 18, 28, 43, 20, 52, 28, 77, 20, 6, 44, 31, 36, 40, + 44, 62, 37, 74, 44, 12, 53, 28, 60, 42, 53, 62, 60, 72, 53, + 2, 11, 22, 4, 32, 11, 56, 4, 65, 12, 10, 20, 19, 28, 44, + 20, 53, 28, 78, 20, 7, 44, 31, 37, 41, 44, 61, 37, 75, 44, + 11, 53, 29, 60, 41, 53, 63, 60, 71, 53, 1, 11, 23, 4, 32, + 12, 57, 4, 66, 12, 11, 20, 20, 28, 45, 20, 54, 28, 79, 20, + 8, 44, 30, 37, 42, 44, 60, 37, 76, 44, 10, 53, 30, 60, 40, + 53, 63, 61, 70, 53, 0, 11, 24, 4, 33, 12, 58, 4, 67, 12, + 12, 20, 21, 28, 46, 20, 55, 28, 79, 21, 9, 44, 29, 37, 43, + 44, 59, 37, 77, 44, 9, 53, 31, 60, 39, 53, 62, 61, 69, 53, + 0, 12, 25, 4, 34, 12, 59, 4, 68, 12, 13, 20, 22, 28, 47, + 20, 56, 28, 78, 21, 10, 44, 28, 37, 44, 44, 58, 37, 78, 44, + 8, 53, 31, 61, 38, 53, 61, 61, 68, 53, 1, 12, 26, 4, 35, + 12, 60, 4, 69, 12, 14, 20, 23, 28, 47, 21, 57, 28, 77, 21, + 11, 44, 27, 37, 45, 44, 57, 37, 79, 44, 7, 53, 30, 61, 37, + 53, 60, 61, 67, 53, 2, 12, 27, 4, 36, 12, 61, 4, 70, 12, + 15, 20, 24, 28, 46, 21, 58, 28, 76, 21, 12, 44, 26, 37, 46, + 44, 56, 37, 79, 45, 6, 53, 29, 61, 36, 53, 59, 61, 66, 53, + 3, 12, 28, 4, 37, 12, 62, 4, 71, 12, 15, 21, 25, 28, 45, + 21, 59, 28, 75, 21, 13, 44, 25, 37, 47, 44, 55, 37, 78, 45, + 5, 53, 28, 61, 35, 53, 58, 61, 65, 53, 4, 12, 29, 4, 38, + 12, 63, 4, 72, 12, 14, 21, 26, 28, 44, 21, 60, 28, 74, 21, + 14, 44, 24, 37, 47, 45, 54, 37, 77, 45, 4, 53, 27, 61, 34, + 53, 57, 61, 64, 53, 5, 12, 30, 4, 39, 12, 63, 5, 73, 12, + 13, 21, 27, 28, 43, 21, 61, 28, 73, 21, 15, 44, 23, 37, 46, + 45, 53, 37, 76, 45, 3, 53, 26, 61, 33, 53, 56, 61, 64, 54, + 6, 12, 31, 4, 40, 12, 62, 5, 74, 12, 12, 21, 28, 28, 42, + 21, 62, 28, 72, 21, 15, 45, 22, 37, 45, 45, 52, 37, 75, 45, + 2, 53, 25, 61, 32, 53, 55, 61, 65, 54, 7, 12, 31, 5, 41, + 12, 61, 5, 75, 12, 11, 21, 29, 28, 41, 21, 63, 28, 71, 21, + 14, 45, 21, 37, 44, 45, 51, 37, 74, 45, 1, 53, 24, 61, 32, + 54, 54, 61, 66, 54, 8, 12, 30, 5, 42, 12, 60, 5, 76, 12, + 10, 21, 30, 28, 40, 21, 63, 29, 70, 21, 13, 45, 20, 37, 43, + 45, 50, 37, 73, 45, 0, 53, 23, 61, 33, 54, 53, 61, 67, 54, + 9, 12, 29, 5, 43, 12, 59, 5, 77, 12, 9, 21, 31, 28, 39, + 21, 62, 29, 69, 21, 12, 45, 19, 37, 42, 45, 49, 37, 72, 45, + 0, 54, 22, 61, 34, 54, 52, 61, 68, 54, 10, 12, 28, 5, 44, + 12, 58, 5, 78, 12, 8, 21, 31, 29, 38, 21, 61, 29, 68, 21, + 11, 45, 18, 37, 41, 45, 48, 37, 71, 45, 1, 54, 21, 61, 35, + 54, 51, 61, 69, 54, 11, 12, 27, 5, 45, 12, 57, 5, 79, 12, + 7, 21, 30, 29, 37, 21, 60, 29, 67, 21, 10, 45, 17, 37, 40, + 45, 48, 38, 70, 45, 2, 54, 20, 61, 36, 54, 50, 61, 70, 54, + 12, 12, 26, 5, 46, 12, 56, 5, 79, 13, 6, 21, 29, 29, 36, + 21, 59, 29, 66, 21, 9, 45, 16, 37, 39, 45, 49, 38, 69, 45, + 3, 54, 19, 61, 37, 54, 49, 61, 71, 54, 13, 12, 25, 5, 47, + 12, 55, 5, 78, 13, 5, 21, 28, 29, 35, 21, 58, 29, 65, 21, + 8, 45, 16, 38, 38, 45, 50, 38, 68, 45, 4, 54, 18, 61, 38, + 54, 48, 61, 72, 54, 14, 12, 24, 5, 47, 13, 54, 5, 77, 13, + 4, 21, 27, 29, 34, 21, 57, 29, 64, 21, 7, 45, 17, 38, 37, + 45, 51, 38, 67, 45, 5, 54, 17, 61, 39, 54, 48, 62, 73, 54, + 15, 12, 23, 5, 46, 13, 53, 5, 76, 13, 3, 21, 26, 29, 33, + 21, 56, 29, 64, 22, 6, 45, 18, 38, 36, 45, 52, 38, 66, 45, + 6, 54, 16, 61, 40, 54, 49, 62, 74, 54, 15, 13, 22, 5, 45, + 13, 52, 5, 75, 13, 2, 21, 25, 29, 32, 21, 55, 29, 65, 22, + 5, 45, 19, 38, 35, 45, 53, 38, 65, 45, 7, 54, 16, 62, 41, + 54, 50, 62, 75, 54, 14, 13, 21, 5, 44, 13, 51, 5, 74, 13, + 1, 21, 24, 29, 32, 22, 54, 29, 66, 22, 4, 45, 20, 38, 34, + 45, 54, 38, 64, 45, 8, 54, 17, 62, 42, 54, 51, 62, 76, 54, + 13, 13, 20, 5, 43, 13, 50, 5, 73, 13, 0, 21, 23, 29, 33, + 22, 53, 29, 67, 22, 3, 45, 21, 38, 33, 45, 55, 38, 64, 46, + 9, 54, 18, 62, 43, 54, 52, 62, 77, 54, 12, 13, 19, 5, 42, + 13, 49, 5, 72, 13, 0, 22, 22, 29, 34, 22, 52, 29, 68, 22, + 2, 45, 22, 38, 32, 45, 56, 38, 65, 46, 10, 54, 19, 62, 44, + 54, 53, 62, 78, 54, 11, 13, 18, 5, 41, 13, 48, 5, 71, 13, + 1, 22, 21, 29, 35, 22, 51, 29, 69, 22, 1, 45, 23, 38, 32, + 46, 57, 38, 66, 46, 11, 54, 20, 62, 45, 54, 54, 62, 79, 54, + 10, 13, 17, 5, 40, 13, 48, 6, 70, 13, 2, 22, 20, 29, 36, + 22, 50, 29, 70, 22, 0, 45, 24, 38, 33, 46, 58, 38, 67, 46, + 12, 54, 21, 62, 46, 54, 55, 62, 79, 55, 9, 13, 16, 5, 39, + 13, 49, 6, 69, 13, 3, 22, 19, 29, 37, 22, 49, 29, 71, 22, + 0, 46, 25, 38, 34, 46, 59, 38, 68, 46, 13, 54, 22, 62, 47, + 54, 56, 62, 78, 55, 8, 13, 16, 6, 38, 13, 50, 6, 68, 13, + 4, 22, 18, 29, 38, 22, 48, 29, 72, 22, 1, 46, 26, 38, 35, + 46, 60, 38, 69, 46, 14, 54, 23, 62, 47, 55, 57, 62, 77, 55, + 7, 13, 17, 6, 37, 13, 51, 6, 67, 13, 5, 22, 17, 29, 39, + 22, 48, 30, 73, 22, 2, 46, 27, 38, 36, 46, 61, 38, 70, 46, + 15, 54, 24, 62, 46, 55, 58, 62, 76, 55, 6, 13, 18, 6, 36, + 13, 52, 6, 66, 13, 6, 22, 16, 29, 40, 22, 49, 30, 74, 22, + 3, 46, 28, 38, 37, 46, 62, 38, 71, 46, 15, 55, 25, 62, 45, + 55, 59, 62, 75, 55, 5, 13, 19, 6, 35, 13, 53, 6, 65, 13, + 7, 22, 16, 30, 41, 22, 50, 30, 75, 22, 4, 46, 29, 38, 38, + 46, 63, 38, 72, 46, 14, 55, 26, 62, 44, 55, 60, 62, 74, 55, + 4, 13, 20, 6, 34, 13, 54, 6, 64, 13, 8, 22, 17, 30, 42, + 22, 51, 30, 76, 22, 5, 46, 30, 38, 39, 46, 63, 39, 73, 46, + 13, 55, 27, 62, 43, 55, 61, 62, 73, 55, 3, 13, 21, 6, 33, + 13, 55, 6, 64, 14, 9, 22, 18, 30, 43, 22, 52, 30, 77, 22, + 6, 46, 31, 38, 40, 46, 62, 39, 74, 46, 12, 55, 28, 62, 42, + 55, 62, 62, 72, 55, 2, 13, 22, 6, 32, 13, 56, 6, 65, 14, + 10, 22, 19, 30, 44, 22, 53, 30, 78, 22, 7, 46, 31, 39, 41, + 46, 61, 39, 75, 46, 11, 55, 29, 62, 41, 55, 63, 62, 71, 55, + 1, 13, 23, 6, 32, 14, 57, 6, 66, 14, 11, 22, 20, 30, 45, + 22, 54, 30, 79, 22, 8, 46, 30, 39, 42, 46, 60, 39, 76, 46, + 10, 55, 30, 62, 40, 55, 63, 63, 70, 55, 0, 13, 24, 6, 33, + 14, 58, 6, 67, 14, 12, 22, 21, 30, 46, 22, 55, 30, 79, 23, + 9, 46, 29, 39, 43, 46, 59, 39, 77, 46, 9, 55, 31, 62, 39, + 55, 62, 63, 69, 55, 0, 14, 25, 6, 34, 14, 59, 6, 68, 14, + 13, 22, 22, 30, 47, 22, 56, 30, 78, 23, 10, 46, 28, 39, 44, + 46, 58, 39, 78, 46, 8, 55, 31, 63, 38, 55, 61, 63, 68, 55, + 1, 14, 26, 6, 35, 14, 60, 6, 69, 14, 14, 22, 23, 30, 47, + 23, 57, 30, 77, 23, 11, 46, 27, 39, 45, 46, 57, 39, 79, 46, + 7, 55, 30, 63, 37, 55, 60, 63, 67, 55, 2, 14, 27, 6, 36, + 14, 61, 6, 70, 14, 15, 22, 24, 30, 46, 23, 58, 30, 76, 23, + 12, 46, 26, 39, 46, 46, 56, 39, 79, 47, 6, 55, 29, 63, 36, + 55, 59, 63, 66, 55, 3, 14, 28, 6, 37, 14, 62, 6, 71, 14, + 15, 23, 25, 30, 45, 23, 59, 30, 75, 23, 13, 46, 25, 39, 47, + 46, 55, 39, 78, 47, 5, 55, 28, 63, 35, 55, 58, 63, 65, 55, + 4, 14, 29, 6, 38, 14, 63, 6, 72, 14, 14, 23, 26, 30, 44, + 23, 60, 30, 74, 23, 14, 46, 24, 39, 47, 47, 54, 39, 77, 47, + 4, 55, 27, 63, 34, 55, 57, 63, 64, 55, 5, 14, 30, 6, 39, + 14, 63, 7, 73, 14, 13, 23, 27, 30, 43, 23, 61, 30, 73, 23, + 15, 46, 23, 39, 46, 47, 53, 39, 76, 47, 3, 55, 26, 63, 33, + 55, 56, 63, 64, 56, 6, 14, 31, 6, 40, 14, 62, 7, 74, 14, + 12, 23, 28, 30, 42, 23, 62, 30, 72, 23, 15, 47, 22, 39, 45, + 47, 52, 39, 75, 47, 2, 55, 25, 63, 32, 55, 55, 63, 65, 56, + 7, 14, 31, 7, 41, 14, 61, 7, 75, 14, 11, 23, 29, 30, 41, + 23, 63, 30, 71, 23, 14, 47, 21, 39, 44, 47, 51, 39, 74, 47, + 1, 55, 24, 63, 32, 56, 54, 63, 66, 56, 8, 14, 30, 7, 42, + 14, 60, 7, 76, 14, 10, 23, 30, 30, 40, 23, 63, 31, 70, 23, + 13, 47, 20, 39, 43, 47, 50, 39, 73, 47, 0, 55, 23, 63, 33, + 56, 53, 63, 67, 56, 9, 14, 29, 7, 43, 14, 59, 7, 77, 14, + 9, 23, 31, 30, 39, 23, 62, 31, 69, 23, 12, 47, 19, 39, 42, + 47, 49, 39, 72, 47, 0, 56, 22, 63, 34, 56, 52, 63, 68, 56, + 10, 14, 28, 7, 44, 14, 58, 7, 78, 14, 8, 23, 31, 31, 38, + 23, 61, 31, 68, 23, 11, 47, 18, 39, 41, 47, 48, 39, 71, 47, + 1, 56, 21, 63, 35, 56, 51, 63, 69, 56, 11, 14, 27, 7, 45, + 14, 57, 7, 79, 14, 7, 23, 30, 31, 37, 23, 60, 31, 67, 23, + 10, 47, 17, 39, 40, 47, 48, 40, 70, 47, 2, 56, 20, 63, 36, + 56, 50, 63, 70, 56, 12, 14, 26, 7, 46, 14, 56, 7, 79, 15, + 6, 23, 29, 31, 36, 23, 59, 31, 66, 23, 9, 47, 16, 39, 39, + 47, 49, 40, 69, 47, 3, 56, 19, 63, 37, 56, 49, 63, 71, 56, + 13, 14, 25, 7, 47, 14, 55, 7, 78, 15, 5, 23, 28, 31, 35, + 23, 58, 31, 65, 23, 8, 47, 16, 40, 38, 47, 50, 40, 68, 47, + 4, 56, 18, 63, 38, 56, 48, 63, 72, 56, 14, 14, 24, 7, 47, + 15, 54, 7, 77, 15, 4, 23, 27, 31, 34, 23, 57, 31, 64, 23, + 7, 47, 17, 40, 37, 47, 51, 40, 67, 47, 5, 56, 17, 63, 39, + 56, 48, 48, 73, 56, 15, 14, 23, 7, 46, 15, 53, 7, 76, 15, + 3, 23, 26, 31, 33, 23, 56, 31, 64, 24, 6, 47, 18, 40, 36, + 47, 52, 40, 66, 47, 6, 56, 16, 63, 40, 56, 49, 48, 74, 56, + 15, 15, 22, 7, 45, 15, 52, 7, 75, 15, 2, 23, 25, 31, 32, + 23, 55, 31, 65, 24, 5, 47, 19, 40, 35, 47, 53, 40, 65, 47, + 7, 56, 16, 48, 41, 56, 50, 48, 75, 56, 14, 15, 21, 7, 44, + 15, 51, 7, 74, 15, 1, 23, 24, 31, 32, 24, 54, 31, 66, 24, + 4, 47, 20, 40, 34, 47, 54, 40, 64, 47, 8, 56, 17, 48, 42, + 56, 51, 48, 76, 56, 13, 15, 20, 7, 43, 15, 50, 7, 73, 15, + 0, 23, 23, 31, 33, 24, 53, 31, 67, 24, 3, 47, 21, 40, 33, + 47, 55, 40, 64, 32, 9, 56, 18, 48, 43, 56, 52, 48, 77, 56, + 12, 15, 19, 7, 42, 15, 49, 7, 72, 15, 0, 24, 22, 31, 34, + 24, 52, 31, 68, 24, 2, 47, 22, 40, 32, 47, 56, 40, 65, 32, + 10, 56, 19, 48, 44, 56, 53, 48, 78, 56, 11, 15, 18, 7, 41, + 15, 48, 7, 71, 15, 1, 24, 21, 31, 35, 24, 51, 31, 69, 24, + 1, 47, 23, 40, 32, 32, 57, 40, 66, 32, 11, 56, 20, 48, 45, + 56, 54, 48, 79, 56, 10, 15, 17, 7, 40, 15, 48, 8, 70, 15, + 2, 24, 20, 31, 36, 24, 50, 31, 70, 24, 0, 47, 24, 40, 33, + 32, 58, 40, 67, 32, 12, 56, 21, 48, 46, 56, 55, 48, 79, 57, + 9, 15, 16, 7, 39, 15, 49, 8, 69, 15, 3, 24, 19, 31, 37, + 24, 49, 31, 71, 24, 0, 32, 25, 40, 34, 32, 59, 40, 68, 32, + 13, 56, 22, 48, 47, 56, 56, 48, 78, 57, 8, 15, 16, 8, 38, + 15, 50, 8, 68, 15, 4, 24, 18, 31, 38, 24, 48, 31, 72, 24, + 1, 32, 26, 40, 35, 32, 60, 40, 69, 32, 14, 56, 23, 48, 47, + 57, 57, 48, 77, 57, 7, 15, 17, 8, 37, 15, 51, 8, 67, 15, + 5, 24, 17, 31, 39, 24, 48, 16, 73, 24, 2, 32, 27, 40, 36, + 32, 61, 40, 70, 32, 15, 56, 24, 48, 46, 57, 58, 48, 76, 57, + 6, 15, 18, 8, 36, 15, 52, 8, 66, 15, 6, 24, 16, 31, 40, + 24, 49, 16, 74, 24, 3, 32, 28, 40, 37, 32, 62, 40, 71, 32, + 15, 57, 25, 48, 45, 57, 59, 48, 75, 57, 5, 15, 19, 8, 35, + 15, 53, 8, 65, 15, 7, 24, 16, 16, 41, 24, 50, 16, 75, 24, + 4, 32, 29, 40, 38, 32, 63, 40, 72, 32, 14, 57, 26, 48, 44, + 57, 60, 48, 74, 57, 4, 15, 20, 8, 34, 15, 54, 8, 64, 15, + 8, 24, 17, 16, 42, 24, 51, 16, 76, 24, 5, 32, 30, 40, 39, + 32, 63, 41, 73, 32, 13, 57, 27, 48, 43, 57, 61, 48, 73, 57, + 3, 15, 21, 8, 33, 15, 55, 8, 64, 0, 9, 24, 18, 16, 43, + 24, 52, 16, 77, 24, 6, 32, 31, 40, 40, 32, 62, 41, 74, 32, + 12, 57, 28, 48, 42, 57, 62, 48, 72, 57, 2, 15, 22, 8, 32, + 15, 56, 8, 65, 0, 10, 24, 19, 16, 44, 24, 53, 16, 78, 24, + 7, 32, 31, 41, 41, 32, 61, 41, 75, 32, 11, 57, 29, 48, 41, + 57, 63, 48, 71, 57, 1, 15, 23, 8, 32, 0, 57, 8, 66, 0, + 11, 24, 20, 16, 45, 24, 54, 16, 79, 24, 8, 32, 30, 41, 42, + 32, 60, 41, 76, 32, 10, 57, 30, 48, 40, 57, 63, 49, 70, 57, + 0, 15, 24, 8, 33, 0, 58, 8, 67, 0, 12, 24, 21, 16, 46, + 24, 55, 16, 79, 25, 9, 32, 29, 41, 43, 32, 59, 41, 77, 32, + 9, 57, 31, 48, 39, 57, 62, 49, 69, 57, +}; + +static const uint8_t hq_tab_18[] = { + 0, 0, 25, 6, 34, 0, 59, 6, 68, 0, 13, 18, 22, 12, 47, + 18, 56, 12, 78, 19, 10, 24, 28, 31, 44, 24, 58, 31, 78, 24, + 8, 43, 31, 37, 38, 43, 61, 37, 68, 43, 11, 49, 18, 55, 41, + 49, 48, 55, 71, 49, 1, 0, 26, 6, 35, 0, 60, 6, 69, 0, + 14, 18, 23, 12, 47, 19, 57, 12, 77, 19, 11, 24, 27, 31, 45, + 24, 57, 31, 79, 24, 7, 43, 30, 37, 37, 43, 60, 37, 67, 43, + 10, 49, 17, 55, 40, 49, 48, 56, 70, 49, 2, 0, 27, 6, 36, + 0, 61, 6, 70, 0, 15, 18, 24, 12, 46, 19, 58, 12, 76, 19, + 12, 24, 26, 31, 46, 24, 56, 31, 79, 25, 6, 43, 29, 37, 36, + 43, 59, 37, 66, 43, 9, 49, 16, 55, 39, 49, 49, 56, 69, 49, + 3, 0, 28, 6, 37, 0, 62, 6, 71, 0, 15, 19, 25, 12, 45, + 19, 59, 12, 75, 19, 13, 24, 25, 31, 47, 24, 55, 31, 78, 25, + 5, 43, 28, 37, 35, 43, 58, 37, 65, 43, 8, 49, 16, 56, 38, + 49, 50, 56, 68, 49, 4, 0, 29, 6, 38, 0, 63, 6, 72, 0, + 14, 19, 26, 12, 44, 19, 60, 12, 74, 19, 14, 24, 24, 31, 47, + 25, 54, 31, 77, 25, 4, 43, 27, 37, 34, 43, 57, 37, 64, 43, + 7, 49, 17, 56, 37, 49, 51, 56, 67, 49, 5, 0, 30, 6, 39, + 0, 63, 7, 73, 0, 13, 19, 27, 12, 43, 19, 61, 12, 73, 19, + 15, 24, 23, 31, 46, 25, 53, 31, 76, 25, 3, 43, 26, 37, 33, + 43, 56, 37, 64, 44, 6, 49, 18, 56, 36, 49, 52, 56, 66, 49, + 6, 0, 31, 6, 40, 0, 62, 7, 74, 0, 12, 19, 28, 12, 42, + 19, 62, 12, 72, 19, 15, 25, 22, 31, 45, 25, 52, 31, 75, 25, + 2, 43, 25, 37, 32, 43, 55, 37, 65, 44, 5, 49, 19, 56, 35, + 49, 53, 56, 65, 49, 7, 0, 31, 7, 41, 0, 61, 7, 75, 0, + 11, 19, 29, 12, 41, 19, 63, 12, 71, 19, 14, 25, 21, 31, 44, + 25, 51, 31, 74, 25, 1, 43, 24, 37, 32, 44, 54, 37, 66, 44, + 4, 49, 20, 56, 34, 49, 54, 56, 64, 49, 8, 0, 30, 7, 42, + 0, 60, 7, 76, 0, 10, 19, 30, 12, 40, 19, 63, 13, 70, 19, + 13, 25, 20, 31, 43, 25, 50, 31, 73, 25, 0, 43, 23, 37, 33, + 44, 53, 37, 67, 44, 3, 49, 21, 56, 33, 49, 55, 56, 64, 50, + 9, 0, 29, 7, 43, 0, 59, 7, 77, 0, 9, 19, 31, 12, 39, + 19, 62, 13, 69, 19, 12, 25, 19, 31, 42, 25, 49, 31, 72, 25, + 0, 44, 22, 37, 34, 44, 52, 37, 68, 44, 2, 49, 22, 56, 32, + 49, 56, 56, 65, 50, 10, 0, 28, 7, 44, 0, 58, 7, 78, 0, + 8, 19, 31, 13, 38, 19, 61, 13, 68, 19, 11, 25, 18, 31, 41, + 25, 48, 31, 71, 25, 1, 44, 21, 37, 35, 44, 51, 37, 69, 44, + 1, 49, 23, 56, 32, 50, 57, 56, 66, 50, 11, 0, 27, 7, 45, + 0, 57, 7, 79, 0, 7, 19, 30, 13, 37, 19, 60, 13, 67, 19, + 10, 25, 17, 31, 40, 25, 48, 32, 70, 25, 2, 44, 20, 37, 36, + 44, 50, 37, 70, 44, 0, 49, 24, 56, 33, 50, 58, 56, 67, 50, + 12, 0, 26, 7, 46, 0, 56, 7, 79, 1, 6, 19, 29, 13, 36, + 19, 59, 13, 66, 19, 9, 25, 16, 31, 39, 25, 49, 32, 69, 25, + 3, 44, 19, 37, 37, 44, 49, 37, 71, 44, 0, 50, 25, 56, 34, + 50, 59, 56, 68, 50, 13, 0, 25, 7, 47, 0, 55, 7, 78, 1, + 5, 19, 28, 13, 35, 19, 58, 13, 65, 19, 8, 25, 16, 32, 38, + 25, 50, 32, 68, 25, 4, 44, 18, 37, 38, 44, 48, 37, 72, 44, + 1, 50, 26, 56, 35, 50, 60, 56, 69, 50, 14, 0, 24, 7, 47, + 1, 54, 7, 77, 1, 4, 19, 27, 13, 34, 19, 57, 13, 64, 19, + 7, 25, 17, 32, 37, 25, 51, 32, 67, 25, 5, 44, 17, 37, 39, + 44, 48, 38, 73, 44, 2, 50, 27, 56, 36, 50, 61, 56, 70, 50, + 15, 0, 23, 7, 46, 1, 53, 7, 76, 1, 3, 19, 26, 13, 33, + 19, 56, 13, 64, 20, 6, 25, 18, 32, 36, 25, 52, 32, 66, 25, + 6, 44, 16, 37, 40, 44, 49, 38, 74, 44, 3, 50, 28, 56, 37, + 50, 62, 56, 71, 50, 15, 1, 22, 7, 45, 1, 52, 7, 75, 1, + 2, 19, 25, 13, 32, 19, 55, 13, 65, 20, 5, 25, 19, 32, 35, + 25, 53, 32, 65, 25, 7, 44, 16, 38, 41, 44, 50, 38, 75, 44, + 4, 50, 29, 56, 38, 50, 63, 56, 72, 50, 14, 1, 21, 7, 44, + 1, 51, 7, 74, 1, 1, 19, 24, 13, 32, 20, 54, 13, 66, 20, + 4, 25, 20, 32, 34, 25, 54, 32, 64, 25, 8, 44, 17, 38, 42, + 44, 51, 38, 76, 44, 5, 50, 30, 56, 39, 50, 63, 57, 73, 50, + 13, 1, 20, 7, 43, 1, 50, 7, 73, 1, 0, 19, 23, 13, 33, + 20, 53, 13, 67, 20, 3, 25, 21, 32, 33, 25, 55, 32, 64, 26, + 9, 44, 18, 38, 43, 44, 52, 38, 77, 44, 6, 50, 31, 56, 40, + 50, 62, 57, 74, 50, 12, 1, 19, 7, 42, 1, 49, 7, 72, 1, + 0, 20, 22, 13, 34, 20, 52, 13, 68, 20, 2, 25, 22, 32, 32, + 25, 56, 32, 65, 26, 10, 44, 19, 38, 44, 44, 53, 38, 78, 44, + 7, 50, 31, 57, 41, 50, 61, 57, 75, 50, 11, 1, 18, 7, 41, + 1, 48, 7, 71, 1, 1, 20, 21, 13, 35, 20, 51, 13, 69, 20, + 1, 25, 23, 32, 32, 26, 57, 32, 66, 26, 11, 44, 20, 38, 45, + 44, 54, 38, 79, 44, 8, 50, 30, 57, 42, 50, 60, 57, 76, 50, + 10, 1, 17, 7, 40, 1, 48, 8, 70, 1, 2, 20, 20, 13, 36, + 20, 50, 13, 70, 20, 0, 25, 24, 32, 33, 26, 58, 32, 67, 26, + 12, 44, 21, 38, 46, 44, 55, 38, 79, 45, 9, 50, 29, 57, 43, + 50, 59, 57, 77, 50, 9, 1, 16, 7, 39, 1, 49, 8, 69, 1, + 3, 20, 19, 13, 37, 20, 49, 13, 71, 20, 0, 26, 25, 32, 34, + 26, 59, 32, 68, 26, 13, 44, 22, 38, 47, 44, 56, 38, 78, 45, + 10, 50, 28, 57, 44, 50, 58, 57, 78, 50, 8, 1, 16, 8, 38, + 1, 50, 8, 68, 1, 4, 20, 18, 13, 38, 20, 48, 13, 72, 20, + 1, 26, 26, 32, 35, 26, 60, 32, 69, 26, 14, 44, 23, 38, 47, + 45, 57, 38, 77, 45, 11, 50, 27, 57, 45, 50, 57, 57, 79, 50, + 7, 1, 17, 8, 37, 1, 51, 8, 67, 1, 5, 20, 17, 13, 39, + 20, 48, 14, 73, 20, 2, 26, 27, 32, 36, 26, 61, 32, 70, 26, + 15, 44, 24, 38, 46, 45, 58, 38, 76, 45, 12, 50, 26, 57, 46, + 50, 56, 57, 79, 51, 6, 1, 18, 8, 36, 1, 52, 8, 66, 1, + 6, 20, 16, 13, 40, 20, 49, 14, 74, 20, 3, 26, 28, 32, 37, + 26, 62, 32, 71, 26, 15, 45, 25, 38, 45, 45, 59, 38, 75, 45, + 13, 50, 25, 57, 47, 50, 55, 57, 78, 51, 5, 1, 19, 8, 35, + 1, 53, 8, 65, 1, 7, 20, 16, 14, 41, 20, 50, 14, 75, 20, + 4, 26, 29, 32, 38, 26, 63, 32, 72, 26, 14, 45, 26, 38, 44, + 45, 60, 38, 74, 45, 14, 50, 24, 57, 47, 51, 54, 57, 77, 51, + 4, 1, 20, 8, 34, 1, 54, 8, 64, 1, 8, 20, 17, 14, 42, + 20, 51, 14, 76, 20, 5, 26, 30, 32, 39, 26, 63, 33, 73, 26, + 13, 45, 27, 38, 43, 45, 61, 38, 73, 45, 15, 50, 23, 57, 46, + 51, 53, 57, 76, 51, 3, 1, 21, 8, 33, 1, 55, 8, 64, 2, + 9, 20, 18, 14, 43, 20, 52, 14, 77, 20, 6, 26, 31, 32, 40, + 26, 62, 33, 74, 26, 12, 45, 28, 38, 42, 45, 62, 38, 72, 45, + 15, 51, 22, 57, 45, 51, 52, 57, 75, 51, 2, 1, 22, 8, 32, + 1, 56, 8, 65, 2, 10, 20, 19, 14, 44, 20, 53, 14, 78, 20, + 7, 26, 31, 33, 41, 26, 61, 33, 75, 26, 11, 45, 29, 38, 41, + 45, 63, 38, 71, 45, 14, 51, 21, 57, 44, 51, 51, 57, 74, 51, + 1, 1, 23, 8, 32, 2, 57, 8, 66, 2, 11, 20, 20, 14, 45, + 20, 54, 14, 79, 20, 8, 26, 30, 33, 42, 26, 60, 33, 76, 26, + 10, 45, 30, 38, 40, 45, 63, 39, 70, 45, 13, 51, 20, 57, 43, + 51, 50, 57, 73, 51, 0, 1, 24, 8, 33, 2, 58, 8, 67, 2, + 12, 20, 21, 14, 46, 20, 55, 14, 79, 21, 9, 26, 29, 33, 43, + 26, 59, 33, 77, 26, 9, 45, 31, 38, 39, 45, 62, 39, 69, 45, + 12, 51, 19, 57, 42, 51, 49, 57, 72, 51, 0, 2, 25, 8, 34, + 2, 59, 8, 68, 2, 13, 20, 22, 14, 47, 20, 56, 14, 78, 21, + 10, 26, 28, 33, 44, 26, 58, 33, 78, 26, 8, 45, 31, 39, 38, + 45, 61, 39, 68, 45, 11, 51, 18, 57, 41, 51, 48, 57, 71, 51, + 1, 2, 26, 8, 35, 2, 60, 8, 69, 2, 14, 20, 23, 14, 47, + 21, 57, 14, 77, 21, 11, 26, 27, 33, 45, 26, 57, 33, 79, 26, + 7, 45, 30, 39, 37, 45, 60, 39, 67, 45, 10, 51, 17, 57, 40, + 51, 48, 58, 70, 51, 2, 2, 27, 8, 36, 2, 61, 8, 70, 2, + 15, 20, 24, 14, 46, 21, 58, 14, 76, 21, 12, 26, 26, 33, 46, + 26, 56, 33, 79, 27, 6, 45, 29, 39, 36, 45, 59, 39, 66, 45, + 9, 51, 16, 57, 39, 51, 49, 58, 69, 51, 3, 2, 28, 8, 37, + 2, 62, 8, 71, 2, 15, 21, 25, 14, 45, 21, 59, 14, 75, 21, + 13, 26, 25, 33, 47, 26, 55, 33, 78, 27, 5, 45, 28, 39, 35, + 45, 58, 39, 65, 45, 8, 51, 16, 58, 38, 51, 50, 58, 68, 51, + 4, 2, 29, 8, 38, 2, 63, 8, 72, 2, 14, 21, 26, 14, 44, + 21, 60, 14, 74, 21, 14, 26, 24, 33, 47, 27, 54, 33, 77, 27, + 4, 45, 27, 39, 34, 45, 57, 39, 64, 45, 7, 51, 17, 58, 37, + 51, 51, 58, 67, 51, 5, 2, 30, 8, 39, 2, 63, 9, 73, 2, + 13, 21, 27, 14, 43, 21, 61, 14, 73, 21, 15, 26, 23, 33, 46, + 27, 53, 33, 76, 27, 3, 45, 26, 39, 33, 45, 56, 39, 64, 46, + 6, 51, 18, 58, 36, 51, 52, 58, 66, 51, 6, 2, 31, 8, 40, + 2, 62, 9, 74, 2, 12, 21, 28, 14, 42, 21, 62, 14, 72, 21, + 15, 27, 22, 33, 45, 27, 52, 33, 75, 27, 2, 45, 25, 39, 32, + 45, 55, 39, 65, 46, 5, 51, 19, 58, 35, 51, 53, 58, 65, 51, + 7, 2, 31, 9, 41, 2, 61, 9, 75, 2, 11, 21, 29, 14, 41, + 21, 63, 14, 71, 21, 14, 27, 21, 33, 44, 27, 51, 33, 74, 27, + 1, 45, 24, 39, 32, 46, 54, 39, 66, 46, 4, 51, 20, 58, 34, + 51, 54, 58, 64, 51, 8, 2, 30, 9, 42, 2, 60, 9, 76, 2, + 10, 21, 30, 14, 40, 21, 63, 15, 70, 21, 13, 27, 20, 33, 43, + 27, 50, 33, 73, 27, 0, 45, 23, 39, 33, 46, 53, 39, 67, 46, + 3, 51, 21, 58, 33, 51, 55, 58, 64, 52, 9, 2, 29, 9, 43, + 2, 59, 9, 77, 2, 9, 21, 31, 14, 39, 21, 62, 15, 69, 21, + 12, 27, 19, 33, 42, 27, 49, 33, 72, 27, 0, 46, 22, 39, 34, + 46, 52, 39, 68, 46, 2, 51, 22, 58, 32, 51, 56, 58, 65, 52, + 10, 2, 28, 9, 44, 2, 58, 9, 78, 2, 8, 21, 31, 15, 38, + 21, 61, 15, 68, 21, 11, 27, 18, 33, 41, 27, 48, 33, 71, 27, + 1, 46, 21, 39, 35, 46, 51, 39, 69, 46, 1, 51, 23, 58, 32, + 52, 57, 58, 66, 52, 11, 2, 27, 9, 45, 2, 57, 9, 79, 2, + 7, 21, 30, 15, 37, 21, 60, 15, 67, 21, 10, 27, 17, 33, 40, + 27, 48, 34, 70, 27, 2, 46, 20, 39, 36, 46, 50, 39, 70, 46, + 0, 51, 24, 58, 33, 52, 58, 58, 67, 52, 12, 2, 26, 9, 46, + 2, 56, 9, 79, 3, 6, 21, 29, 15, 36, 21, 59, 15, 66, 21, + 9, 27, 16, 33, 39, 27, 49, 34, 69, 27, 3, 46, 19, 39, 37, + 46, 49, 39, 71, 46, 0, 52, 25, 58, 34, 52, 59, 58, 68, 52, + 13, 2, 25, 9, 47, 2, 55, 9, 78, 3, 5, 21, 28, 15, 35, + 21, 58, 15, 65, 21, 8, 27, 16, 34, 38, 27, 50, 34, 68, 27, + 4, 46, 18, 39, 38, 46, 48, 39, 72, 46, 1, 52, 26, 58, 35, + 52, 60, 58, 69, 52, 14, 2, 24, 9, 47, 3, 54, 9, 77, 3, + 4, 21, 27, 15, 34, 21, 57, 15, 64, 21, 7, 27, 17, 34, 37, + 27, 51, 34, 67, 27, 5, 46, 17, 39, 39, 46, 48, 40, 73, 46, + 2, 52, 27, 58, 36, 52, 61, 58, 70, 52, 15, 2, 23, 9, 46, + 3, 53, 9, 76, 3, 3, 21, 26, 15, 33, 21, 56, 15, 64, 22, + 6, 27, 18, 34, 36, 27, 52, 34, 66, 27, 6, 46, 16, 39, 40, + 46, 49, 40, 74, 46, 3, 52, 28, 58, 37, 52, 62, 58, 71, 52, + 15, 3, 22, 9, 45, 3, 52, 9, 75, 3, 2, 21, 25, 15, 32, + 21, 55, 15, 65, 22, 5, 27, 19, 34, 35, 27, 53, 34, 65, 27, + 7, 46, 16, 40, 41, 46, 50, 40, 75, 46, 4, 52, 29, 58, 38, + 52, 63, 58, 72, 52, 14, 3, 21, 9, 44, 3, 51, 9, 74, 3, + 1, 21, 24, 15, 32, 22, 54, 15, 66, 22, 4, 27, 20, 34, 34, + 27, 54, 34, 64, 27, 8, 46, 17, 40, 42, 46, 51, 40, 76, 46, + 5, 52, 30, 58, 39, 52, 63, 59, 73, 52, 13, 3, 20, 9, 43, + 3, 50, 9, 73, 3, 0, 21, 23, 15, 33, 22, 53, 15, 67, 22, + 3, 27, 21, 34, 33, 27, 55, 34, 64, 28, 9, 46, 18, 40, 43, + 46, 52, 40, 77, 46, 6, 52, 31, 58, 40, 52, 62, 59, 74, 52, + 12, 3, 19, 9, 42, 3, 49, 9, 72, 3, 0, 22, 22, 15, 34, + 22, 52, 15, 68, 22, 2, 27, 22, 34, 32, 27, 56, 34, 65, 28, + 10, 46, 19, 40, 44, 46, 53, 40, 78, 46, 7, 52, 31, 59, 41, + 52, 61, 59, 75, 52, 11, 3, 18, 9, 41, 3, 48, 9, 71, 3, + 1, 22, 21, 15, 35, 22, 51, 15, 69, 22, 1, 27, 23, 34, 32, + 28, 57, 34, 66, 28, 11, 46, 20, 40, 45, 46, 54, 40, 79, 46, + 8, 52, 30, 59, 42, 52, 60, 59, 76, 52, 10, 3, 17, 9, 40, + 3, 48, 10, 70, 3, 2, 22, 20, 15, 36, 22, 50, 15, 70, 22, + 0, 27, 24, 34, 33, 28, 58, 34, 67, 28, 12, 46, 21, 40, 46, + 46, 55, 40, 79, 47, 9, 52, 29, 59, 43, 52, 59, 59, 77, 52, + 9, 3, 16, 9, 39, 3, 49, 10, 69, 3, 3, 22, 19, 15, 37, + 22, 49, 15, 71, 22, 0, 28, 25, 34, 34, 28, 59, 34, 68, 28, + 13, 46, 22, 40, 47, 46, 56, 40, 78, 47, 10, 52, 28, 59, 44, + 52, 58, 59, 78, 52, 8, 3, 16, 10, 38, 3, 50, 10, 68, 3, + 4, 22, 18, 15, 38, 22, 48, 15, 72, 22, 1, 28, 26, 34, 35, + 28, 60, 34, 69, 28, 14, 46, 23, 40, 47, 47, 57, 40, 77, 47, + 11, 52, 27, 59, 45, 52, 57, 59, 79, 52, 7, 3, 17, 10, 37, + 3, 51, 10, 67, 3, 5, 22, 17, 15, 39, 22, 48, 16, 73, 22, + 2, 28, 27, 34, 36, 28, 61, 34, 70, 28, 15, 46, 24, 40, 46, + 47, 58, 40, 76, 47, 12, 52, 26, 59, 46, 52, 56, 59, 79, 53, + 6, 3, 18, 10, 36, 3, 52, 10, 66, 3, 6, 22, 16, 15, 40, + 22, 49, 16, 74, 22, 3, 28, 28, 34, 37, 28, 62, 34, 71, 28, + 15, 47, 25, 40, 45, 47, 59, 40, 75, 47, 13, 52, 25, 59, 47, + 52, 55, 59, 78, 53, 5, 3, 19, 10, 35, 3, 53, 10, 65, 3, + 7, 22, 16, 16, 41, 22, 50, 16, 75, 22, 4, 28, 29, 34, 38, + 28, 63, 34, 72, 28, 14, 47, 26, 40, 44, 47, 60, 40, 74, 47, + 14, 52, 24, 59, 47, 53, 54, 59, 77, 53, 4, 3, 20, 10, 34, + 3, 54, 10, 64, 3, 8, 22, 17, 16, 42, 22, 51, 16, 76, 22, + 5, 28, 30, 34, 39, 28, 63, 35, 73, 28, 13, 47, 27, 40, 43, + 47, 61, 40, 73, 47, 15, 52, 23, 59, 46, 53, 53, 59, 76, 53, + 3, 3, 21, 10, 33, 3, 55, 10, 64, 4, 9, 22, 18, 16, 43, + 22, 52, 16, 77, 22, 6, 28, 31, 34, 40, 28, 62, 35, 74, 28, + 12, 47, 28, 40, 42, 47, 62, 40, 72, 47, 15, 53, 22, 59, 45, + 53, 52, 59, 75, 53, 2, 3, 22, 10, 32, 3, 56, 10, 65, 4, + 10, 22, 19, 16, 44, 22, 53, 16, 78, 22, 7, 28, 31, 35, 41, + 28, 61, 35, 75, 28, 11, 47, 29, 40, 41, 47, 63, 40, 71, 47, + 14, 53, 21, 59, 44, 53, 51, 59, 74, 53, 1, 3, 23, 10, 32, + 4, 57, 10, 66, 4, 11, 22, 20, 16, 45, 22, 54, 16, 79, 22, + 8, 28, 30, 35, 42, 28, 60, 35, 76, 28, 10, 47, 30, 40, 40, + 47, 63, 41, 70, 47, 13, 53, 20, 59, 43, 53, 50, 59, 73, 53, + 0, 3, 24, 10, 33, 4, 58, 10, 67, 4, 12, 22, 21, 16, 46, + 22, 55, 16, 79, 23, 9, 28, 29, 35, 43, 28, 59, 35, 77, 28, + 9, 47, 31, 40, 39, 47, 62, 41, 69, 47, 12, 53, 19, 59, 42, + 53, 49, 59, 72, 53, 0, 4, 25, 10, 34, 4, 59, 10, 68, 4, + 13, 22, 22, 16, 47, 22, 56, 16, 78, 23, 10, 28, 28, 35, 44, + 28, 58, 35, 78, 28, 8, 47, 31, 41, 38, 47, 61, 41, 68, 47, + 11, 53, 18, 59, 41, 53, 48, 59, 71, 53, 1, 4, 26, 10, 35, + 4, 60, 10, 69, 4, 14, 22, 23, 16, 47, 23, 57, 16, 77, 23, + 11, 28, 27, 35, 45, 28, 57, 35, 79, 28, 7, 47, 30, 41, 37, + 47, 60, 41, 67, 47, 10, 53, 17, 59, 40, 53, 48, 48, 70, 53, + 2, 4, 27, 10, 36, 4, 61, 10, 70, 4, 15, 22, 24, 16, 46, + 23, 58, 16, 76, 23, 12, 28, 26, 35, 46, 28, 56, 35, 79, 29, + 6, 47, 29, 41, 36, 47, 59, 41, 66, 47, 9, 53, 16, 59, 39, + 53, 49, 48, 69, 53, 3, 4, 28, 10, 37, 4, 62, 10, 71, 4, + 15, 23, 25, 16, 45, 23, 59, 16, 75, 23, 13, 28, 25, 35, 47, + 28, 55, 35, 78, 29, 5, 47, 28, 41, 35, 47, 58, 41, 65, 47, + 8, 53, 16, 48, 38, 53, 50, 48, 68, 53, 4, 4, 29, 10, 38, + 4, 63, 10, 72, 4, 14, 23, 26, 16, 44, 23, 60, 16, 74, 23, + 14, 28, 24, 35, 47, 29, 54, 35, 77, 29, 4, 47, 27, 41, 34, + 47, 57, 41, 64, 47, 7, 53, 17, 48, 37, 53, 51, 48, 67, 53, + 5, 4, 30, 10, 39, 4, 63, 11, 73, 4, 13, 23, 27, 16, 43, + 23, 61, 16, 73, 23, 15, 28, 23, 35, 46, 29, 53, 35, 76, 29, + 3, 47, 26, 41, 33, 47, 56, 41, 64, 36, 6, 53, 18, 48, 36, + 53, 52, 48, 66, 53, 6, 4, 31, 10, 40, 4, 62, 11, 74, 4, + 12, 23, 28, 16, 42, 23, 62, 16, 72, 23, 15, 29, 22, 35, 45, + 29, 52, 35, 75, 29, 2, 47, 25, 41, 32, 47, 55, 41, 65, 36, + 5, 53, 19, 48, 35, 53, 53, 48, 65, 53, 7, 4, 31, 11, 41, + 4, 61, 11, 75, 4, 11, 23, 29, 16, 41, 23, 63, 16, 71, 23, + 14, 29, 21, 35, 44, 29, 51, 35, 74, 29, 1, 47, 24, 41, 32, + 36, 54, 41, 66, 36, 4, 53, 20, 48, 34, 53, 54, 48, 64, 53, + 8, 4, 30, 11, 42, 4, 60, 11, 76, 4, 10, 23, 30, 16, 40, + 23, 63, 17, 70, 23, 13, 29, 20, 35, 43, 29, 50, 35, 73, 29, + 0, 47, 23, 41, 33, 36, 53, 41, 67, 36, 3, 53, 21, 48, 33, + 53, 55, 48, 64, 54, 9, 4, 29, 11, 43, 4, 59, 11, 77, 4, + 9, 23, 31, 16, 39, 23, 62, 17, 69, 23, 12, 29, 19, 35, 42, + 29, 49, 35, 72, 29, 0, 36, 22, 41, 34, 36, 52, 41, 68, 36, + 2, 53, 22, 48, 32, 53, 56, 48, 65, 54, 10, 4, 28, 11, 44, + 4, 58, 11, 78, 4, 8, 23, 31, 17, 38, 23, 61, 17, 68, 23, + 11, 29, 18, 35, 41, 29, 48, 35, 71, 29, 1, 36, 21, 41, 35, + 36, 51, 41, 69, 36, 1, 53, 23, 48, 32, 54, 57, 48, 66, 54, + 11, 4, 27, 11, 45, 4, 57, 11, 79, 4, 7, 23, 30, 17, 37, + 23, 60, 17, 67, 23, 10, 29, 17, 35, 40, 29, 48, 24, 70, 29, + 2, 36, 20, 41, 36, 36, 50, 41, 70, 36, 0, 53, 24, 48, 33, + 54, 58, 48, 67, 54, 12, 4, 26, 11, 46, 4, 56, 11, 79, 5, + 6, 23, 29, 17, 36, 23, 59, 17, 66, 23, 9, 29, 16, 35, 39, + 29, 49, 24, 69, 29, 3, 36, 19, 41, 37, 36, 49, 41, 71, 36, + 0, 54, 25, 48, 34, 54, 59, 48, 68, 54, 13, 4, 25, 11, 47, + 4, 55, 11, 78, 5, 5, 23, 28, 17, 35, 23, 58, 17, 65, 23, + 8, 29, 16, 24, 38, 29, 50, 24, 68, 29, 4, 36, 18, 41, 38, + 36, 48, 41, 72, 36, 1, 54, 26, 48, 35, 54, 60, 48, 69, 54, + 14, 4, 24, 11, 47, 5, 54, 11, 77, 5, 4, 23, 27, 17, 34, + 23, 57, 17, 64, 23, 7, 29, 17, 24, 37, 29, 51, 24, 67, 29, + 5, 36, 17, 41, 39, 36, 48, 42, 73, 36, 2, 54, 27, 48, 36, + 54, 61, 48, 70, 54, 15, 4, 23, 11, 46, 5, 53, 11, 76, 5, + 3, 23, 26, 17, 33, 23, 56, 17, 64, 12, 6, 29, 18, 24, 36, + 29, 52, 24, 66, 29, 6, 36, 16, 41, 40, 36, 49, 42, 74, 36, + 3, 54, 28, 48, 37, 54, 62, 48, 71, 54, 15, 5, 22, 11, 45, + 5, 52, 11, 75, 5, 2, 23, 25, 17, 32, 23, 55, 17, 65, 12, + 5, 29, 19, 24, 35, 29, 53, 24, 65, 29, 7, 36, 16, 42, 41, + 36, 50, 42, 75, 36, 4, 54, 29, 48, 38, 54, 63, 48, 72, 54, + 14, 5, 21, 11, 44, 5, 51, 11, 74, 5, 1, 23, 24, 17, 32, + 12, 54, 17, 66, 12, 4, 29, 20, 24, 34, 29, 54, 24, 64, 29, + 8, 36, 17, 42, 42, 36, 51, 42, 76, 36, 5, 54, 30, 48, 39, + 54, 63, 49, 73, 54, 13, 5, 20, 11, 43, 5, 50, 11, 73, 5, + 0, 23, 23, 17, 33, 12, 53, 17, 67, 12, 3, 29, 21, 24, 33, + 29, 55, 24, 64, 30, 9, 36, 18, 42, 43, 36, 52, 42, 77, 36, + 6, 54, 31, 48, 40, 54, 62, 49, 74, 54, 12, 5, 19, 11, 42, + 5, 49, 11, 72, 5, 0, 12, 22, 17, 34, 12, 52, 17, 68, 12, + 2, 29, 22, 24, 32, 29, 56, 24, 65, 30, 10, 36, 19, 42, 44, + 36, 53, 42, 78, 36, 7, 54, 31, 49, 41, 54, 61, 49, 75, 54, + 11, 5, 18, 11, 41, 5, 48, 11, 71, 5, 1, 12, 21, 17, 35, + 12, 51, 17, 69, 12, 1, 29, 23, 24, 32, 30, 57, 24, 66, 30, + 11, 36, 20, 42, 45, 36, 54, 42, 79, 36, 8, 54, 30, 49, 42, + 54, 60, 49, 76, 54, 10, 5, 17, 11, 40, 5, 48, 0, 70, 5, + 2, 12, 20, 17, 36, 12, 50, 17, 70, 12, 0, 29, 24, 24, 33, + 30, 58, 24, 67, 30, 12, 36, 21, 42, 46, 36, 55, 42, 79, 37, + 9, 54, 29, 49, 43, 54, 59, 49, 77, 54, 9, 5, 16, 11, 39, + 5, 49, 0, 69, 5, 3, 12, 19, 17, 37, 12, 49, 17, 71, 12, + 0, 30, 25, 24, 34, 30, 59, 24, 68, 30, 13, 36, 22, 42, 47, + 36, 56, 42, 78, 37, 10, 54, 28, 49, 44, 54, 58, 49, 78, 54, + 8, 5, 16, 0, 38, 5, 50, 0, 68, 5, 4, 12, 18, 17, 38, + 12, 48, 17, 72, 12, 1, 30, 26, 24, 35, 30, 60, 24, 69, 30, + 14, 36, 23, 42, 47, 37, 57, 42, 77, 37, 11, 54, 27, 49, 45, + 54, 57, 49, 79, 54, 7, 5, 17, 0, 37, 5, 51, 0, 67, 5, + 5, 12, 17, 17, 39, 12, 48, 18, 73, 12, 2, 30, 27, 24, 36, + 30, 61, 24, 70, 30, 15, 36, 24, 42, 46, 37, 58, 42, 76, 37, + 12, 54, 26, 49, 46, 54, 56, 49, 79, 55, 6, 5, 18, 0, 36, + 5, 52, 0, 66, 5, 6, 12, 16, 17, 40, 12, 49, 18, 74, 12, + 3, 30, 28, 24, 37, 30, 62, 24, 71, 30, 15, 37, 25, 42, 45, + 37, 59, 42, 75, 37, 13, 54, 25, 49, 47, 54, 55, 49, 78, 55, + 5, 5, 19, 0, 35, 5, 53, 0, 65, 5, 7, 12, 16, 18, 41, + 12, 50, 18, 75, 12, 4, 30, 29, 24, 38, 30, 63, 24, 72, 30, + 14, 37, 26, 42, 44, 37, 60, 42, 74, 37, 14, 54, 24, 49, 47, + 55, 54, 49, 77, 55, 4, 5, 20, 0, 34, 5, 54, 0, 64, 5, + 8, 12, 17, 18, 42, 12, 51, 18, 76, 12, 5, 30, 30, 24, 39, + 30, 63, 25, 73, 30, 13, 37, 27, 42, 43, 37, 61, 42, 73, 37, + 15, 54, 23, 49, 46, 55, 53, 49, 76, 55, 3, 5, 21, 0, 33, + 5, 55, 0, 64, 6, 9, 12, 18, 18, 43, 12, 52, 18, 77, 12, + 6, 30, 31, 24, 40, 30, 62, 25, 74, 30, 12, 37, 28, 42, 42, + 37, 62, 42, 72, 37, 15, 55, 22, 49, 45, 55, 52, 49, 75, 55, + 2, 5, 22, 0, 32, 5, 56, 0, 65, 6, 10, 12, 19, 18, 44, + 12, 53, 18, 78, 12, 7, 30, 31, 25, 41, 30, 61, 25, 75, 30, + 11, 37, 29, 42, 41, 37, 63, 42, 71, 37, 14, 55, 21, 49, 44, + 55, 51, 49, 74, 55, 1, 5, 23, 0, 32, 6, 57, 0, 66, 6, + 11, 12, 20, 18, 45, 12, 54, 18, 79, 12, 8, 30, 30, 25, 42, + 30, 60, 25, 76, 30, 10, 37, 30, 42, 40, 37, 63, 43, 70, 37, + 13, 55, 20, 49, 43, 55, 50, 49, 73, 55, 0, 5, 24, 0, 33, + 6, 58, 0, 67, 6, 12, 12, 21, 18, 46, 12, 55, 18, 79, 13, + 9, 30, 29, 25, 43, 30, 59, 25, 77, 30, 9, 37, 31, 42, 39, + 37, 62, 43, 69, 37, 12, 55, 19, 49, 42, 55, 49, 49, 72, 55, + 0, 6, 25, 0, 34, 6, 59, 0, 68, 6, 13, 12, 22, 18, 47, + 12, 56, 18, 78, 13, 10, 30, 28, 25, 44, 30, 58, 25, 78, 30, + 8, 37, 31, 43, 38, 37, 61, 43, 68, 37, 11, 55, 18, 49, 41, + 55, 48, 49, 71, 55, 1, 6, 26, 0, 35, 6, 60, 0, 69, 6, + 14, 12, 23, 18, 47, 13, 57, 18, 77, 13, 11, 30, 27, 25, 45, + 30, 57, 25, 79, 30, 7, 37, 30, 43, 37, 37, 60, 43, 67, 37, + 10, 55, 17, 49, 40, 55, 48, 50, 70, 55, 2, 6, 27, 0, 36, + 6, 61, 0, 70, 6, 15, 12, 24, 18, 46, 13, 58, 18, 76, 13, + 12, 30, 26, 25, 46, 30, 56, 25, 79, 31, 6, 37, 29, 43, 36, + 37, 59, 43, 66, 37, 9, 55, 16, 49, 39, 55, 49, 50, 69, 55, + 3, 6, 28, 0, 37, 6, 62, 0, 71, 6, 15, 13, 25, 18, 45, + 13, 59, 18, 75, 13, 13, 30, 25, 25, 47, 30, 55, 25, 78, 31, + 5, 37, 28, 43, 35, 37, 58, 43, 65, 37, 8, 55, 16, 50, 38, + 55, 50, 50, 68, 55, 4, 6, 29, 0, 38, 6, 63, 0, 72, 6, + 14, 13, 26, 18, 44, 13, 60, 18, 74, 13, 14, 30, 24, 25, 47, + 31, 54, 25, 77, 31, 4, 37, 27, 43, 34, 37, 57, 43, 64, 37, + 7, 55, 17, 50, 37, 55, 51, 50, 67, 55, 5, 6, 30, 0, 39, + 6, 63, 1, 73, 6, 13, 13, 27, 18, 43, 13, 61, 18, 73, 13, + 15, 30, 23, 25, 46, 31, 53, 25, 76, 31, 3, 37, 26, 43, 33, + 37, 56, 43, 64, 38, 6, 55, 18, 50, 36, 55, 52, 50, 66, 55, + 6, 6, 31, 0, 40, 6, 62, 1, 74, 6, 12, 13, 28, 18, 42, + 13, 62, 18, 72, 13, 15, 31, 22, 25, 45, 31, 52, 25, 75, 31, + 2, 37, 25, 43, 32, 37, 55, 43, 65, 38, 5, 55, 19, 50, 35, + 55, 53, 50, 65, 55, 7, 6, 31, 1, 41, 6, 61, 1, 75, 6, + 11, 13, 29, 18, 41, 13, 63, 18, 71, 13, 14, 31, 21, 25, 44, + 31, 51, 25, 74, 31, 1, 37, 24, 43, 32, 38, 54, 43, 66, 38, + 4, 55, 20, 50, 34, 55, 54, 50, 64, 55, 8, 6, 30, 1, 42, + 6, 60, 1, 76, 6, 10, 13, 30, 18, 40, 13, 63, 19, 70, 13, + 13, 31, 20, 25, 43, 31, 50, 25, 73, 31, 0, 37, 23, 43, 33, + 38, 53, 43, 67, 38, 3, 55, 21, 50, 33, 55, 55, 50, 64, 56, + 9, 6, 29, 1, 43, 6, 59, 1, 77, 6, 9, 13, 31, 18, 39, + 13, 62, 19, 69, 13, 12, 31, 19, 25, 42, 31, 49, 25, 72, 31, + 0, 38, 22, 43, 34, 38, 52, 43, 68, 38, 2, 55, 22, 50, 32, + 55, 56, 50, 65, 56, 10, 6, 28, 1, 44, 6, 58, 1, 78, 6, + 8, 13, 31, 19, 38, 13, 61, 19, 68, 13, 11, 31, 18, 25, 41, + 31, 48, 25, 71, 31, 1, 38, 21, 43, 35, 38, 51, 43, 69, 38, + 1, 55, 23, 50, 32, 56, 57, 50, 66, 56, 11, 6, 27, 1, 45, + 6, 57, 1, 79, 6, 7, 13, 30, 19, 37, 13, 60, 19, 67, 13, + 10, 31, 17, 25, 40, 31, 48, 26, 70, 31, 2, 38, 20, 43, 36, + 38, 50, 43, 70, 38, 0, 55, 24, 50, 33, 56, 58, 50, 67, 56, + 12, 6, 26, 1, 46, 6, 56, 1, 79, 7, 6, 13, 29, 19, 36, + 13, 59, 19, 66, 13, 9, 31, 16, 25, 39, 31, 49, 26, 69, 31, + 3, 38, 19, 43, 37, 38, 49, 43, 71, 38, 0, 56, 25, 50, 34, + 56, 59, 50, 68, 56, 13, 6, 25, 1, 47, 6, 55, 1, 78, 7, + 5, 13, 28, 19, 35, 13, 58, 19, 65, 13, 8, 31, 16, 26, 38, + 31, 50, 26, 68, 31, 4, 38, 18, 43, 38, 38, 48, 43, 72, 38, + 1, 56, 26, 50, 35, 56, 60, 50, 69, 56, 14, 6, 24, 1, 47, + 7, 54, 1, 77, 7, 4, 13, 27, 19, 34, 13, 57, 19, 64, 13, + 7, 31, 17, 26, 37, 31, 51, 26, 67, 31, 5, 38, 17, 43, 39, + 38, 48, 44, 73, 38, 2, 56, 27, 50, 36, 56, 61, 50, 70, 56, + 15, 6, 23, 1, 46, 7, 53, 1, 76, 7, 3, 13, 26, 19, 33, + 13, 56, 19, 64, 14, 6, 31, 18, 26, 36, 31, 52, 26, 66, 31, + 6, 38, 16, 43, 40, 38, 49, 44, 74, 38, 3, 56, 28, 50, 37, + 56, 62, 50, 71, 56, 15, 7, 22, 1, 45, 7, 52, 1, 75, 7, + 2, 13, 25, 19, 32, 13, 55, 19, 65, 14, 5, 31, 19, 26, 35, + 31, 53, 26, 65, 31, 7, 38, 16, 44, 41, 38, 50, 44, 75, 38, + 4, 56, 29, 50, 38, 56, 63, 50, 72, 56, 14, 7, 21, 1, 44, + 7, 51, 1, 74, 7, 1, 13, 24, 19, 32, 14, 54, 19, 66, 14, + 4, 31, 20, 26, 34, 31, 54, 26, 64, 31, 8, 38, 17, 44, 42, + 38, 51, 44, 76, 38, 5, 56, 30, 50, 39, 56, 63, 51, 73, 56, + 13, 7, 20, 1, 43, 7, 50, 1, 73, 7, 0, 13, 23, 19, 33, + 14, 53, 19, 67, 14, 3, 31, 21, 26, 33, 31, 55, 26, 64, 32, + 9, 38, 18, 44, 43, 38, 52, 44, 77, 38, 6, 56, 31, 50, 40, + 56, 62, 51, 74, 56, 12, 7, 19, 1, 42, 7, 49, 1, 72, 7, + 0, 14, 22, 19, 34, 14, 52, 19, 68, 14, 2, 31, 22, 26, 32, + 31, 56, 26, 65, 32, 10, 38, 19, 44, 44, 38, 53, 44, 78, 38, + 7, 56, 31, 51, 41, 56, 61, 51, 75, 56, 11, 7, 18, 1, 41, + 7, 48, 1, 71, 7, 1, 14, 21, 19, 35, 14, 51, 19, 69, 14, + 1, 31, 23, 26, 32, 32, 57, 26, 66, 32, 11, 38, 20, 44, 45, + 38, 54, 44, 79, 38, 8, 56, 30, 51, 42, 56, 60, 51, 76, 56, + 10, 7, 17, 1, 40, 7, 48, 2, 70, 7, 2, 14, 20, 19, 36, + 14, 50, 19, 70, 14, 0, 31, 24, 26, 33, 32, 58, 26, 67, 32, + 12, 38, 21, 44, 46, 38, 55, 44, 79, 39, 9, 56, 29, 51, 43, + 56, 59, 51, 77, 56, 9, 7, 16, 1, 39, 7, 49, 2, 69, 7, + 3, 14, 19, 19, 37, 14, 49, 19, 71, 14, 0, 32, 25, 26, 34, + 32, 59, 26, 68, 32, 13, 38, 22, 44, 47, 38, 56, 44, 78, 39, + 10, 56, 28, 51, 44, 56, 58, 51, 78, 56, 8, 7, 16, 2, 38, + 7, 50, 2, 68, 7, 4, 14, 18, 19, 38, 14, 48, 19, 72, 14, + 1, 32, 26, 26, 35, 32, 60, 26, 69, 32, 14, 38, 23, 44, 47, + 39, 57, 44, 77, 39, 11, 56, 27, 51, 45, 56, 57, 51, 79, 56, + 7, 7, 17, 2, 37, 7, 51, 2, 67, 7, 5, 14, 17, 19, 39, + 14, 48, 20, 73, 14, 2, 32, 27, 26, 36, 32, 61, 26, 70, 32, + 15, 38, 24, 44, 46, 39, 58, 44, 76, 39, 12, 56, 26, 51, 46, + 56, 56, 51, 79, 57, 6, 7, 18, 2, 36, 7, 52, 2, 66, 7, + 6, 14, 16, 19, 40, 14, 49, 20, 74, 14, 3, 32, 28, 26, 37, + 32, 62, 26, 71, 32, 15, 39, 25, 44, 45, 39, 59, 44, 75, 39, + 13, 56, 25, 51, 47, 56, 55, 51, 78, 57, 5, 7, 19, 2, 35, + 7, 53, 2, 65, 7, 7, 14, 16, 20, 41, 14, 50, 20, 75, 14, + 4, 32, 29, 26, 38, 32, 63, 26, 72, 32, 14, 39, 26, 44, 44, + 39, 60, 44, 74, 39, 14, 56, 24, 51, 47, 57, 54, 51, 77, 57, + 4, 7, 20, 2, 34, 7, 54, 2, 64, 7, 8, 14, 17, 20, 42, + 14, 51, 20, 76, 14, 5, 32, 30, 26, 39, 32, 63, 27, 73, 32, + 13, 39, 27, 44, 43, 39, 61, 44, 73, 39, 15, 56, 23, 51, 46, + 57, 53, 51, 76, 57, 3, 7, 21, 2, 33, 7, 55, 2, 64, 8, + 9, 14, 18, 20, 43, 14, 52, 20, 77, 14, 6, 32, 31, 26, 40, + 32, 62, 27, 74, 32, 12, 39, 28, 44, 42, 39, 62, 44, 72, 39, + 15, 57, 22, 51, 45, 57, 52, 51, 75, 57, 2, 7, 22, 2, 32, + 7, 56, 2, 65, 8, 10, 14, 19, 20, 44, 14, 53, 20, 78, 14, + 7, 32, 31, 27, 41, 32, 61, 27, 75, 32, 11, 39, 29, 44, 41, + 39, 63, 44, 71, 39, 14, 57, 21, 51, 44, 57, 51, 51, 74, 57, + 1, 7, 23, 2, 32, 8, 57, 2, 66, 8, 11, 14, 20, 20, 45, + 14, 54, 20, 79, 14, 8, 32, 30, 27, 42, 32, 60, 27, 76, 32, + 10, 39, 30, 44, 40, 39, 63, 45, 70, 39, 13, 57, 20, 51, 43, + 57, 50, 51, 73, 57, 0, 7, 24, 2, 33, 8, 58, 2, 67, 8, + 12, 14, 21, 20, 46, 14, 55, 20, 79, 15, 9, 32, 29, 27, 43, + 32, 59, 27, 77, 32, 9, 39, 31, 44, 39, 39, 62, 45, 69, 39, + 12, 57, 19, 51, 42, 57, 49, 51, 72, 57, 0, 8, 25, 2, 34, + 8, 59, 2, 68, 8, 13, 14, 22, 20, 47, 14, 56, 20, 78, 15, + 10, 32, 28, 27, 44, 32, 58, 27, 78, 32, 8, 39, 31, 45, 38, + 39, 61, 45, 68, 39, 11, 57, 18, 51, 41, 57, 48, 51, 71, 57, + 1, 8, 26, 2, 35, 8, 60, 2, 69, 8, 14, 14, 23, 20, 47, + 15, 57, 20, 77, 15, 11, 32, 27, 27, 45, 32, 57, 27, 79, 32, + 7, 39, 30, 45, 37, 39, 60, 45, 67, 39, 10, 57, 17, 51, 40, + 57, 48, 52, 70, 57, 2, 8, 27, 2, 36, 8, 61, 2, 70, 8, + 15, 14, 24, 20, 46, 15, 58, 20, 76, 15, 12, 32, 26, 27, 46, + 32, 56, 27, 79, 33, 6, 39, 29, 45, 36, 39, 59, 45, 66, 39, + 9, 57, 16, 51, 39, 57, 49, 52, 69, 57, 3, 8, 28, 2, 37, + 8, 62, 2, 71, 8, 15, 15, 25, 20, 45, 15, 59, 20, 75, 15, + 13, 32, 25, 27, 47, 32, 55, 27, 78, 33, 5, 39, 28, 45, 35, + 39, 58, 45, 65, 39, 8, 57, 16, 52, 38, 57, 50, 52, 68, 57, + 4, 8, 29, 2, 38, 8, 63, 2, 72, 8, 14, 15, 26, 20, 44, + 15, 60, 20, 74, 15, 14, 32, 24, 27, 47, 33, 54, 27, 77, 33, + 4, 39, 27, 45, 34, 39, 57, 45, 64, 39, 7, 57, 17, 52, 37, + 57, 51, 52, 67, 57, 5, 8, 30, 2, 39, 8, 63, 3, 73, 8, + 13, 15, 27, 20, 43, 15, 61, 20, 73, 15, 15, 32, 23, 27, 46, + 33, 53, 27, 76, 33, 3, 39, 26, 45, 33, 39, 56, 45, 64, 40, + 6, 57, 18, 52, 36, 57, 52, 52, 66, 57, 6, 8, 31, 2, 40, + 8, 62, 3, 74, 8, 12, 15, 28, 20, 42, 15, 62, 20, 72, 15, + 15, 33, 22, 27, 45, 33, 52, 27, 75, 33, 2, 39, 25, 45, 32, + 39, 55, 45, 65, 40, 5, 57, 19, 52, 35, 57, 53, 52, 65, 57, + 7, 8, 31, 3, 41, 8, 61, 3, 75, 8, 11, 15, 29, 20, 41, + 15, 63, 20, 71, 15, 14, 33, 21, 27, 44, 33, 51, 27, 74, 33, + 1, 39, 24, 45, 32, 40, 54, 45, 66, 40, 4, 57, 20, 52, 34, + 57, 54, 52, 64, 57, 8, 8, 30, 3, 42, 8, 60, 3, 76, 8, + 10, 15, 30, 20, 40, 15, 63, 21, 70, 15, 13, 33, 20, 27, 43, + 33, 50, 27, 73, 33, 0, 39, 23, 45, 33, 40, 53, 45, 67, 40, + 3, 57, 21, 52, 33, 57, 55, 52, 64, 58, 9, 8, 29, 3, 43, + 8, 59, 3, 77, 8, 9, 15, 31, 20, 39, 15, 62, 21, 69, 15, + 12, 33, 19, 27, 42, 33, 49, 27, 72, 33, 0, 40, 22, 45, 34, + 40, 52, 45, 68, 40, 2, 57, 22, 52, 32, 57, 56, 52, 65, 58, + 10, 8, 28, 3, 44, 8, 58, 3, 78, 8, 8, 15, 31, 21, 38, + 15, 61, 21, 68, 15, 11, 33, 18, 27, 41, 33, 48, 27, 71, 33, + 1, 40, 21, 45, 35, 40, 51, 45, 69, 40, 1, 57, 23, 52, 32, + 58, 57, 52, 66, 58, 11, 8, 27, 3, 45, 8, 57, 3, 79, 8, + 7, 15, 30, 21, 37, 15, 60, 21, 67, 15, 10, 33, 17, 27, 40, + 33, 48, 28, 70, 33, 2, 40, 20, 45, 36, 40, 50, 45, 70, 40, + 0, 57, 24, 52, 33, 58, 58, 52, 67, 58, 12, 8, 26, 3, 46, + 8, 56, 3, 79, 9, 6, 15, 29, 21, 36, 15, 59, 21, 66, 15, + 9, 33, 16, 27, 39, 33, 49, 28, 69, 33, 3, 40, 19, 45, 37, + 40, 49, 45, 71, 40, 0, 58, 25, 52, 34, 58, 59, 52, 68, 58, + 13, 8, 25, 3, 47, 8, 55, 3, 78, 9, 5, 15, 28, 21, 35, + 15, 58, 21, 65, 15, 8, 33, 16, 28, 38, 33, 50, 28, 68, 33, + 4, 40, 18, 45, 38, 40, 48, 45, 72, 40, 1, 58, 26, 52, 35, + 58, 60, 52, 69, 58, 14, 8, 24, 3, 47, 9, 54, 3, 77, 9, + 4, 15, 27, 21, 34, 15, 57, 21, 64, 15, 7, 33, 17, 28, 37, + 33, 51, 28, 67, 33, 5, 40, 17, 45, 39, 40, 48, 46, 73, 40, + 2, 58, 27, 52, 36, 58, 61, 52, 70, 58, 15, 8, 23, 3, 46, + 9, 53, 3, 76, 9, 3, 15, 26, 21, 33, 15, 56, 21, 64, 16, + 6, 33, 18, 28, 36, 33, 52, 28, 66, 33, 6, 40, 16, 45, 40, + 40, 49, 46, 74, 40, 3, 58, 28, 52, 37, 58, 62, 52, 71, 58, + 15, 9, 22, 3, 45, 9, 52, 3, 75, 9, 2, 15, 25, 21, 32, + 15, 55, 21, 65, 16, 5, 33, 19, 28, 35, 33, 53, 28, 65, 33, + 7, 40, 16, 46, 41, 40, 50, 46, 75, 40, 4, 58, 29, 52, 38, + 58, 63, 52, 72, 58, 14, 9, 21, 3, 44, 9, 51, 3, 74, 9, + 1, 15, 24, 21, 32, 16, 54, 21, 66, 16, 4, 33, 20, 28, 34, + 33, 54, 28, 64, 33, 8, 40, 17, 46, 42, 40, 51, 46, 76, 40, + 5, 58, 30, 52, 39, 58, 63, 53, 73, 58, 13, 9, 20, 3, 43, + 9, 50, 3, 73, 9, 0, 15, 23, 21, 33, 16, 53, 21, 67, 16, + 3, 33, 21, 28, 33, 33, 55, 28, 64, 34, 9, 40, 18, 46, 43, + 40, 52, 46, 77, 40, 6, 58, 31, 52, 40, 58, 62, 53, 74, 58, + 12, 9, 19, 3, 42, 9, 49, 3, 72, 9, 0, 16, 22, 21, 34, + 16, 52, 21, 68, 16, 2, 33, 22, 28, 32, 33, 56, 28, 65, 34, + 10, 40, 19, 46, 44, 40, 53, 46, 78, 40, 7, 58, 31, 53, 41, + 58, 61, 53, 75, 58, 11, 9, 18, 3, 41, 9, 48, 3, 71, 9, + 1, 16, 21, 21, 35, 16, 51, 21, 69, 16, 1, 33, 23, 28, 32, + 34, 57, 28, 66, 34, 11, 40, 20, 46, 45, 40, 54, 46, 79, 40, + 8, 58, 30, 53, 42, 58, 60, 53, 76, 58, 10, 9, 17, 3, 40, + 9, 48, 4, 70, 9, 2, 16, 20, 21, 36, 16, 50, 21, 70, 16, + 0, 33, 24, 28, 33, 34, 58, 28, 67, 34, 12, 40, 21, 46, 46, + 40, 55, 46, 79, 41, 9, 58, 29, 53, 43, 58, 59, 53, 77, 58, + 9, 9, 16, 3, 39, 9, 49, 4, 69, 9, 3, 16, 19, 21, 37, + 16, 49, 21, 71, 16, 0, 34, 25, 28, 34, 34, 59, 28, 68, 34, + 13, 40, 22, 46, 47, 40, 56, 46, 78, 41, 10, 58, 28, 53, 44, + 58, 58, 53, 78, 58, 8, 9, 16, 4, 38, 9, 50, 4, 68, 9, + 4, 16, 18, 21, 38, 16, 48, 21, 72, 16, 1, 34, 26, 28, 35, + 34, 60, 28, 69, 34, 14, 40, 23, 46, 47, 41, 57, 46, 77, 41, + 11, 58, 27, 53, 45, 58, 57, 53, 79, 58, 7, 9, 17, 4, 37, + 9, 51, 4, 67, 9, 5, 16, 17, 21, 39, 16, 48, 22, 73, 16, + 2, 34, 27, 28, 36, 34, 61, 28, 70, 34, 15, 40, 24, 46, 46, + 41, 58, 46, 76, 41, 12, 58, 26, 53, 46, 58, 56, 53, 79, 59, + 6, 9, 18, 4, 36, 9, 52, 4, 66, 9, 6, 16, 16, 21, 40, + 16, 49, 22, 74, 16, 3, 34, 28, 28, 37, 34, 62, 28, 71, 34, + 15, 41, 25, 46, 45, 41, 59, 46, 75, 41, 13, 58, 25, 53, 47, + 58, 55, 53, 78, 59, 5, 9, 19, 4, 35, 9, 53, 4, 65, 9, + 7, 16, 16, 22, 41, 16, 50, 22, 75, 16, 4, 34, 29, 28, 38, + 34, 63, 28, 72, 34, 14, 41, 26, 46, 44, 41, 60, 46, 74, 41, + 14, 58, 24, 53, 47, 59, 54, 53, 77, 59, 4, 9, 20, 4, 34, + 9, 54, 4, 64, 9, 8, 16, 17, 22, 42, 16, 51, 22, 76, 16, + 5, 34, 30, 28, 39, 34, 63, 29, 73, 34, 13, 41, 27, 46, 43, + 41, 61, 46, 73, 41, 15, 58, 23, 53, 46, 59, 53, 53, 76, 59, + 3, 9, 21, 4, 33, 9, 55, 4, 64, 10, 9, 16, 18, 22, 43, + 16, 52, 22, 77, 16, 6, 34, 31, 28, 40, 34, 62, 29, 74, 34, + 12, 41, 28, 46, 42, 41, 62, 46, 72, 41, 15, 59, 22, 53, 45, + 59, 52, 53, 75, 59, 2, 9, 22, 4, 32, 9, 56, 4, 65, 10, + 10, 16, 19, 22, 44, 16, 53, 22, 78, 16, 7, 34, 31, 29, 41, + 34, 61, 29, 75, 34, 11, 41, 29, 46, 41, 41, 63, 46, 71, 41, + 14, 59, 21, 53, 44, 59, 51, 53, 74, 59, 1, 9, 23, 4, 32, + 10, 57, 4, 66, 10, 11, 16, 20, 22, 45, 16, 54, 22, 79, 16, + 8, 34, 30, 29, 42, 34, 60, 29, 76, 34, 10, 41, 30, 46, 40, + 41, 63, 47, 70, 41, 13, 59, 20, 53, 43, 59, 50, 53, 73, 59, + 0, 9, 24, 4, 33, 10, 58, 4, 67, 10, 12, 16, 21, 22, 46, + 16, 55, 22, 79, 17, 9, 34, 29, 29, 43, 34, 59, 29, 77, 34, + 9, 41, 31, 46, 39, 41, 62, 47, 69, 41, 12, 59, 19, 53, 42, + 59, 49, 53, 72, 59, 0, 10, 25, 4, 34, 10, 59, 4, 68, 10, + 13, 16, 22, 22, 47, 16, 56, 22, 78, 17, 10, 34, 28, 29, 44, + 34, 58, 29, 78, 34, 8, 41, 31, 47, 38, 41, 61, 47, 68, 41, + 11, 59, 18, 53, 41, 59, 48, 53, 71, 59, 1, 10, 26, 4, 35, + 10, 60, 4, 69, 10, 14, 16, 23, 22, 47, 17, 57, 22, 77, 17, + 11, 34, 27, 29, 45, 34, 57, 29, 79, 34, 7, 41, 30, 47, 37, + 41, 60, 47, 67, 41, 10, 59, 17, 53, 40, 59, 48, 54, 70, 59, + 2, 10, 27, 4, 36, 10, 61, 4, 70, 10, 15, 16, 24, 22, 46, + 17, 58, 22, 76, 17, 12, 34, 26, 29, 46, 34, 56, 29, 79, 35, + 6, 41, 29, 47, 36, 41, 59, 47, 66, 41, 9, 59, 16, 53, 39, + 59, 49, 54, 69, 59, 3, 10, 28, 4, 37, 10, 62, 4, 71, 10, + 15, 17, 25, 22, 45, 17, 59, 22, 75, 17, 13, 34, 25, 29, 47, + 34, 55, 29, 78, 35, 5, 41, 28, 47, 35, 41, 58, 47, 65, 41, + 8, 59, 16, 54, 38, 59, 50, 54, 68, 59, 4, 10, 29, 4, 38, + 10, 63, 4, 72, 10, 14, 17, 26, 22, 44, 17, 60, 22, 74, 17, + 14, 34, 24, 29, 47, 35, 54, 29, 77, 35, 4, 41, 27, 47, 34, + 41, 57, 47, 64, 41, 7, 59, 17, 54, 37, 59, 51, 54, 67, 59, + 5, 10, 30, 4, 39, 10, 63, 5, 73, 10, 13, 17, 27, 22, 43, + 17, 61, 22, 73, 17, 15, 34, 23, 29, 46, 35, 53, 29, 76, 35, + 3, 41, 26, 47, 33, 41, 56, 47, 64, 42, 6, 59, 18, 54, 36, + 59, 52, 54, 66, 59, 6, 10, 31, 4, 40, 10, 62, 5, 74, 10, + 12, 17, 28, 22, 42, 17, 62, 22, 72, 17, 15, 35, 22, 29, 45, + 35, 52, 29, 75, 35, 2, 41, 25, 47, 32, 41, 55, 47, 65, 42, + 5, 59, 19, 54, 35, 59, 53, 54, 65, 59, 7, 10, 31, 5, 41, + 10, 61, 5, 75, 10, 11, 17, 29, 22, 41, 17, 63, 22, 71, 17, + 14, 35, 21, 29, 44, 35, 51, 29, 74, 35, 1, 41, 24, 47, 32, + 42, 54, 47, 66, 42, 4, 59, 20, 54, 34, 59, 54, 54, 64, 59, + 8, 10, 30, 5, 42, 10, 60, 5, 76, 10, 10, 17, 30, 22, 40, + 17, 63, 23, 70, 17, 13, 35, 20, 29, 43, 35, 50, 29, 73, 35, + 0, 41, 23, 47, 33, 42, 53, 47, 67, 42, 3, 59, 21, 54, 33, + 59, 55, 54, 64, 48, 9, 10, 29, 5, 43, 10, 59, 5, 77, 10, + 9, 17, 31, 22, 39, 17, 62, 23, 69, 17, 12, 35, 19, 29, 42, + 35, 49, 29, 72, 35, 0, 42, 22, 47, 34, 42, 52, 47, 68, 42, + 2, 59, 22, 54, 32, 59, 56, 54, 65, 48, 10, 10, 28, 5, 44, + 10, 58, 5, 78, 10, 8, 17, 31, 23, 38, 17, 61, 23, 68, 17, + 11, 35, 18, 29, 41, 35, 48, 29, 71, 35, 1, 42, 21, 47, 35, + 42, 51, 47, 69, 42, 1, 59, 23, 54, 32, 48, 57, 54, 66, 48, + 11, 10, 27, 5, 45, 10, 57, 5, 79, 10, 7, 17, 30, 23, 37, + 17, 60, 23, 67, 17, 10, 35, 17, 29, 40, 35, 48, 30, 70, 35, + 2, 42, 20, 47, 36, 42, 50, 47, 70, 42, 0, 59, 24, 54, 33, + 48, 58, 54, 67, 48, 12, 10, 26, 5, 46, 10, 56, 5, 79, 11, + 6, 17, 29, 23, 36, 17, 59, 23, 66, 17, 9, 35, 16, 29, 39, + 35, 49, 30, 69, 35, 3, 42, 19, 47, 37, 42, 49, 47, 71, 42, + 0, 48, 25, 54, 34, 48, 59, 54, 68, 48, 13, 10, 25, 5, 47, + 10, 55, 5, 78, 11, 5, 17, 28, 23, 35, 17, 58, 23, 65, 17, + 8, 35, 16, 30, 38, 35, 50, 30, 68, 35, 4, 42, 18, 47, 38, + 42, 48, 47, 72, 42, 1, 48, 26, 54, 35, 48, 60, 54, 69, 48, + 14, 10, 24, 5, 47, 11, 54, 5, 77, 11, 4, 17, 27, 23, 34, + 17, 57, 23, 64, 17, 7, 35, 17, 30, 37, 35, 51, 30, 67, 35, + 5, 42, 17, 47, 39, 42, 48, 36, 73, 42, 2, 48, 27, 54, 36, + 48, 61, 54, 70, 48, 15, 10, 23, 5, 46, 11, 53, 5, 76, 11, + 3, 17, 26, 23, 33, 17, 56, 23, 64, 18, 6, 35, 18, 30, 36, + 35, 52, 30, 66, 35, 6, 42, 16, 47, 40, 42, 49, 36, 74, 42, + 3, 48, 28, 54, 37, 48, 62, 54, 71, 48, 15, 11, 22, 5, 45, + 11, 52, 5, 75, 11, 2, 17, 25, 23, 32, 17, 55, 23, 65, 18, + 5, 35, 19, 30, 35, 35, 53, 30, 65, 35, 7, 42, 16, 36, 41, + 42, 50, 36, 75, 42, 4, 48, 29, 54, 38, 48, 63, 54, 72, 48, + 14, 11, 21, 5, 44, 11, 51, 5, 74, 11, 1, 17, 24, 23, 32, + 18, 54, 23, 66, 18, 4, 35, 20, 30, 34, 35, 54, 30, 64, 35, + 8, 42, 17, 36, 42, 42, 51, 36, 76, 42, 5, 48, 30, 54, 39, + 48, 63, 55, 73, 48, 13, 11, 20, 5, 43, 11, 50, 5, 73, 11, + 0, 17, 23, 23, 33, 18, 53, 23, 67, 18, 3, 35, 21, 30, 33, + 35, 55, 30, 64, 24, 9, 42, 18, 36, 43, 42, 52, 36, 77, 42, + 6, 48, 31, 54, 40, 48, 62, 55, 74, 48, 12, 11, 19, 5, 42, + 11, 49, 5, 72, 11, 0, 18, 22, 23, 34, 18, 52, 23, 68, 18, + 2, 35, 22, 30, 32, 35, 56, 30, 65, 24, 10, 42, 19, 36, 44, + 42, 53, 36, 78, 42, 7, 48, 31, 55, 41, 48, 61, 55, 75, 48, + 11, 11, 18, 5, 41, 11, 48, 5, 71, 11, 1, 18, 21, 23, 35, + 18, 51, 23, 69, 18, 1, 35, 23, 30, 32, 24, 57, 30, 66, 24, + 11, 42, 20, 36, 45, 42, 54, 36, 79, 42, 8, 48, 30, 55, 42, + 48, 60, 55, 76, 48, 10, 11, 17, 5, 40, 11, 48, 6, 70, 11, + 2, 18, 20, 23, 36, 18, 50, 23, 70, 18, 0, 35, 24, 30, 33, + 24, 58, 30, 67, 24, 12, 42, 21, 36, 46, 42, 55, 36, 79, 43, + 9, 48, 29, 55, 43, 48, 59, 55, 77, 48, 9, 11, 16, 5, 39, + 11, 49, 6, 69, 11, 3, 18, 19, 23, 37, 18, 49, 23, 71, 18, + 0, 24, 25, 30, 34, 24, 59, 30, 68, 24, 13, 42, 22, 36, 47, + 42, 56, 36, 78, 43, 10, 48, 28, 55, 44, 48, 58, 55, 78, 48, + 8, 11, 16, 6, 38, 11, 50, 6, 68, 11, 4, 18, 18, 23, 38, + 18, 48, 23, 72, 18, 1, 24, 26, 30, 35, 24, 60, 30, 69, 24, + 14, 42, 23, 36, 47, 43, 57, 36, 77, 43, 11, 48, 27, 55, 45, + 48, 57, 55, 79, 48, 7, 11, 17, 6, 37, 11, 51, 6, 67, 11, + 5, 18, 17, 23, 39, 18, 48, 12, 73, 18, 2, 24, 27, 30, 36, + 24, 61, 30, 70, 24, 15, 42, 24, 36, 46, 43, 58, 36, 76, 43, + 12, 48, 26, 55, 46, 48, 56, 55, 79, 49, 6, 11, 18, 6, 36, + 11, 52, 6, 66, 11, 6, 18, 16, 23, 40, 18, 49, 12, 74, 18, + 3, 24, 28, 30, 37, 24, 62, 30, 71, 24, 15, 43, 25, 36, 45, + 43, 59, 36, 75, 43, 13, 48, 25, 55, 47, 48, 55, 55, 78, 49, + 5, 11, 19, 6, 35, 11, 53, 6, 65, 11, 7, 18, 16, 12, 41, + 18, 50, 12, 75, 18, 4, 24, 29, 30, 38, 24, 63, 30, 72, 24, + 14, 43, 26, 36, 44, 43, 60, 36, 74, 43, 14, 48, 24, 55, 47, + 49, 54, 55, 77, 49, 4, 11, 20, 6, 34, 11, 54, 6, 64, 11, + 8, 18, 17, 12, 42, 18, 51, 12, 76, 18, 5, 24, 30, 30, 39, + 24, 63, 31, 73, 24, 13, 43, 27, 36, 43, 43, 61, 36, 73, 43, + 15, 48, 23, 55, 46, 49, 53, 55, 76, 49, 3, 11, 21, 6, 33, + 11, 55, 6, 64, 0, 9, 18, 18, 12, 43, 18, 52, 12, 77, 18, + 6, 24, 31, 30, 40, 24, 62, 31, 74, 24, 12, 43, 28, 36, 42, + 43, 62, 36, 72, 43, 15, 49, 22, 55, 45, 49, 52, 55, 75, 49, + 2, 11, 22, 6, 32, 11, 56, 6, 65, 0, 10, 18, 19, 12, 44, + 18, 53, 12, 78, 18, 7, 24, 31, 31, 41, 24, 61, 31, 75, 24, + 11, 43, 29, 36, 41, 43, 63, 36, 71, 43, 14, 49, 21, 55, 44, + 49, 51, 55, 74, 49, 1, 11, 23, 6, 32, 0, 57, 6, 66, 0, + 11, 18, 20, 12, 45, 18, 54, 12, 79, 18, 8, 24, 30, 31, 42, + 24, 60, 31, 76, 24, 10, 43, 30, 36, 40, 43, 63, 37, 70, 43, + 13, 49, 20, 55, 43, 49, 50, 55, 73, 49, 0, 11, 24, 6, 33, + 0, 58, 6, 67, 0, 12, 18, 21, 12, 46, 18, 55, 12, 79, 19, + 9, 24, 29, 31, 43, 24, 59, 31, 77, 24, 9, 43, 31, 36, 39, + 43, 62, 37, 69, 43, 12, 49, 19, 55, 42, 49, 49, 55, 72, 49, +}; + +static const uint8_t hq_tab_19[] = { + 0, 0, 25, 4, 34, 0, 59, 4, 12, 12, 21, 8, 46, 12, 55, + 8, 8, 16, 30, 21, 42, 16, 60, 21, 11, 29, 29, 24, 41, 29, + 63, 24, 15, 33, 22, 37, 45, 33, 52, 37, 3, 45, 26, 41, 33, + 45, 56, 41, 1, 0, 26, 4, 35, 0, 60, 4, 13, 12, 22, 8, + 47, 12, 56, 8, 9, 16, 29, 21, 43, 16, 59, 21, 10, 29, 30, + 24, 40, 29, 63, 25, 14, 33, 21, 37, 44, 33, 51, 37, 2, 45, + 25, 41, 32, 45, 55, 41, 2, 0, 27, 4, 36, 0, 61, 4, 14, + 12, 23, 8, 47, 13, 57, 8, 10, 16, 28, 21, 44, 16, 58, 21, + 9, 29, 31, 24, 39, 29, 62, 25, 13, 33, 20, 37, 43, 33, 50, + 37, 1, 45, 24, 41, 32, 46, 54, 41, 3, 0, 28, 4, 37, 0, + 62, 4, 15, 12, 24, 8, 46, 13, 58, 8, 11, 16, 27, 21, 45, + 16, 57, 21, 8, 29, 31, 25, 38, 29, 61, 25, 12, 33, 19, 37, + 42, 33, 49, 37, 0, 45, 23, 41, 33, 46, 53, 41, 4, 0, 29, + 4, 38, 0, 63, 4, 15, 13, 25, 8, 45, 13, 59, 8, 12, 16, + 26, 21, 46, 16, 56, 21, 7, 29, 30, 25, 37, 29, 60, 25, 11, + 33, 18, 37, 41, 33, 48, 37, 0, 46, 22, 41, 34, 46, 52, 41, + 5, 0, 30, 4, 39, 0, 63, 5, 14, 13, 26, 8, 44, 13, 60, + 8, 13, 16, 25, 21, 47, 16, 55, 21, 6, 29, 29, 25, 36, 29, + 59, 25, 10, 33, 17, 37, 40, 33, 48, 38, 1, 46, 21, 41, 35, + 46, 51, 41, 6, 0, 31, 4, 40, 0, 62, 5, 13, 13, 27, 8, + 43, 13, 61, 8, 14, 16, 24, 21, 47, 17, 54, 21, 5, 29, 28, + 25, 35, 29, 58, 25, 9, 33, 16, 37, 39, 33, 49, 38, 2, 46, + 20, 41, 36, 46, 50, 41, 7, 0, 31, 5, 41, 0, 61, 5, 12, + 13, 28, 8, 42, 13, 62, 8, 15, 16, 23, 21, 46, 17, 53, 21, + 4, 29, 27, 25, 34, 29, 57, 25, 8, 33, 16, 38, 38, 33, 50, + 38, 3, 46, 19, 41, 37, 46, 49, 41, 8, 0, 30, 5, 42, 0, + 60, 5, 11, 13, 29, 8, 41, 13, 63, 8, 15, 17, 22, 21, 45, + 17, 52, 21, 3, 29, 26, 25, 33, 29, 56, 25, 7, 33, 17, 38, + 37, 33, 51, 38, 4, 46, 18, 41, 38, 46, 48, 41, 9, 0, 29, + 5, 43, 0, 59, 5, 10, 13, 30, 8, 40, 13, 63, 9, 14, 17, + 21, 21, 44, 17, 51, 21, 2, 29, 25, 25, 32, 29, 55, 25, 6, + 33, 18, 38, 36, 33, 52, 38, 5, 46, 17, 41, 39, 46, 48, 42, + 10, 0, 28, 5, 44, 0, 58, 5, 9, 13, 31, 8, 39, 13, 62, + 9, 13, 17, 20, 21, 43, 17, 50, 21, 1, 29, 24, 25, 32, 30, + 54, 25, 5, 33, 19, 38, 35, 33, 53, 38, 6, 46, 16, 41, 40, + 46, 49, 42, 11, 0, 27, 5, 45, 0, 57, 5, 8, 13, 31, 9, + 38, 13, 61, 9, 12, 17, 19, 21, 42, 17, 49, 21, 0, 29, 23, + 25, 33, 30, 53, 25, 4, 33, 20, 38, 34, 33, 54, 38, 7, 46, + 16, 42, 41, 46, 50, 42, 12, 0, 26, 5, 46, 0, 56, 5, 7, + 13, 30, 9, 37, 13, 60, 9, 11, 17, 18, 21, 41, 17, 48, 21, + 0, 30, 22, 25, 34, 30, 52, 25, 3, 33, 21, 38, 33, 33, 55, + 38, 8, 46, 17, 42, 42, 46, 51, 42, 13, 0, 25, 5, 47, 0, + 55, 5, 6, 13, 29, 9, 36, 13, 59, 9, 10, 17, 17, 21, 40, + 17, 48, 22, 1, 30, 21, 25, 35, 30, 51, 25, 2, 33, 22, 38, + 32, 33, 56, 38, 9, 46, 18, 42, 43, 46, 52, 42, 14, 0, 24, + 5, 47, 1, 54, 5, 5, 13, 28, 9, 35, 13, 58, 9, 9, 17, + 16, 21, 39, 17, 49, 22, 2, 30, 20, 25, 36, 30, 50, 25, 1, + 33, 23, 38, 32, 34, 57, 38, 10, 46, 19, 42, 44, 46, 53, 42, + 15, 0, 23, 5, 46, 1, 53, 5, 4, 13, 27, 9, 34, 13, 57, + 9, 8, 17, 16, 22, 38, 17, 50, 22, 3, 30, 19, 25, 37, 30, + 49, 25, 0, 33, 24, 38, 33, 34, 58, 38, 11, 46, 20, 42, 45, + 46, 54, 42, 15, 1, 22, 5, 45, 1, 52, 5, 3, 13, 26, 9, + 33, 13, 56, 9, 7, 17, 17, 22, 37, 17, 51, 22, 4, 30, 18, + 25, 38, 30, 48, 25, 0, 34, 25, 38, 34, 34, 59, 38, 12, 46, + 21, 42, 46, 46, 55, 42, 14, 1, 21, 5, 44, 1, 51, 5, 2, + 13, 25, 9, 32, 13, 55, 9, 6, 17, 18, 22, 36, 17, 52, 22, + 5, 30, 17, 25, 39, 30, 48, 26, 1, 34, 26, 38, 35, 34, 60, + 38, 13, 46, 22, 42, 47, 46, 56, 42, 13, 1, 20, 5, 43, 1, + 50, 5, 1, 13, 24, 9, 32, 14, 54, 9, 5, 17, 19, 22, 35, + 17, 53, 22, 6, 30, 16, 25, 40, 30, 49, 26, 2, 34, 27, 38, + 36, 34, 61, 38, 14, 46, 23, 42, 47, 47, 57, 42, 12, 1, 19, + 5, 42, 1, 49, 5, 0, 13, 23, 9, 33, 14, 53, 9, 4, 17, + 20, 22, 34, 17, 54, 22, 7, 30, 16, 26, 41, 30, 50, 26, 3, + 34, 28, 38, 37, 34, 62, 38, 15, 46, 24, 42, 46, 47, 58, 42, + 11, 1, 18, 5, 41, 1, 48, 5, 0, 14, 22, 9, 34, 14, 52, + 9, 3, 17, 21, 22, 33, 17, 55, 22, 8, 30, 17, 26, 42, 30, + 51, 26, 4, 34, 29, 38, 38, 34, 63, 38, 15, 47, 25, 42, 45, + 47, 59, 42, 10, 1, 17, 5, 40, 1, 48, 6, 1, 14, 21, 9, + 35, 14, 51, 9, 2, 17, 22, 22, 32, 17, 56, 22, 9, 30, 18, + 26, 43, 30, 52, 26, 5, 34, 30, 38, 39, 34, 63, 39, 14, 47, + 26, 42, 44, 47, 60, 42, 9, 1, 16, 5, 39, 1, 49, 6, 2, + 14, 20, 9, 36, 14, 50, 9, 1, 17, 23, 22, 32, 18, 57, 22, + 10, 30, 19, 26, 44, 30, 53, 26, 6, 34, 31, 38, 40, 34, 62, + 39, 13, 47, 27, 42, 43, 47, 61, 42, 8, 1, 16, 6, 38, 1, + 50, 6, 3, 14, 19, 9, 37, 14, 49, 9, 0, 17, 24, 22, 33, + 18, 58, 22, 11, 30, 20, 26, 45, 30, 54, 26, 7, 34, 31, 39, + 41, 34, 61, 39, 12, 47, 28, 42, 42, 47, 62, 42, 7, 1, 17, + 6, 37, 1, 51, 6, 4, 14, 18, 9, 38, 14, 48, 9, 0, 18, + 25, 22, 34, 18, 59, 22, 12, 30, 21, 26, 46, 30, 55, 26, 8, + 34, 30, 39, 42, 34, 60, 39, 11, 47, 29, 42, 41, 47, 63, 42, + 6, 1, 18, 6, 36, 1, 52, 6, 5, 14, 17, 9, 39, 14, 48, + 10, 1, 18, 26, 22, 35, 18, 60, 22, 13, 30, 22, 26, 47, 30, + 56, 26, 9, 34, 29, 39, 43, 34, 59, 39, 10, 47, 30, 42, 40, + 47, 63, 43, 5, 1, 19, 6, 35, 1, 53, 6, 6, 14, 16, 9, + 40, 14, 49, 10, 2, 18, 27, 22, 36, 18, 61, 22, 14, 30, 23, + 26, 47, 31, 57, 26, 10, 34, 28, 39, 44, 34, 58, 39, 9, 47, + 31, 42, 39, 47, 62, 43, 4, 1, 20, 6, 34, 1, 54, 6, 7, + 14, 16, 10, 41, 14, 50, 10, 3, 18, 28, 22, 37, 18, 62, 22, + 15, 30, 24, 26, 46, 31, 58, 26, 11, 34, 27, 39, 45, 34, 57, + 39, 8, 47, 31, 43, 38, 47, 61, 43, 3, 1, 21, 6, 33, 1, + 55, 6, 8, 14, 17, 10, 42, 14, 51, 10, 4, 18, 29, 22, 38, + 18, 63, 22, 15, 31, 25, 26, 45, 31, 59, 26, 12, 34, 26, 39, + 46, 34, 56, 39, 7, 47, 30, 43, 37, 47, 60, 43, 2, 1, 22, + 6, 32, 1, 56, 6, 9, 14, 18, 10, 43, 14, 52, 10, 5, 18, + 30, 22, 39, 18, 63, 23, 14, 31, 26, 26, 44, 31, 60, 26, 13, + 34, 25, 39, 47, 34, 55, 39, 6, 47, 29, 43, 36, 47, 59, 43, + 1, 1, 23, 6, 32, 2, 57, 6, 10, 14, 19, 10, 44, 14, 53, + 10, 6, 18, 31, 22, 40, 18, 62, 23, 13, 31, 27, 26, 43, 31, + 61, 26, 14, 34, 24, 39, 47, 35, 54, 39, 5, 47, 28, 43, 35, + 47, 58, 43, 0, 1, 24, 6, 33, 2, 58, 6, 11, 14, 20, 10, + 45, 14, 54, 10, 7, 18, 31, 23, 41, 18, 61, 23, 12, 31, 28, + 26, 42, 31, 62, 26, 15, 34, 23, 39, 46, 35, 53, 39, 4, 47, + 27, 43, 34, 47, 57, 43, 0, 2, 25, 6, 34, 2, 59, 6, 12, + 14, 21, 10, 46, 14, 55, 10, 8, 18, 30, 23, 42, 18, 60, 23, + 11, 31, 29, 26, 41, 31, 63, 26, 15, 35, 22, 39, 45, 35, 52, + 39, 3, 47, 26, 43, 33, 47, 56, 43, 1, 2, 26, 6, 35, 2, + 60, 6, 13, 14, 22, 10, 47, 14, 56, 10, 9, 18, 29, 23, 43, + 18, 59, 23, 10, 31, 30, 26, 40, 31, 63, 27, 14, 35, 21, 39, + 44, 35, 51, 39, 2, 47, 25, 43, 32, 47, 55, 43, 2, 2, 27, + 6, 36, 2, 61, 6, 14, 14, 23, 10, 47, 15, 57, 10, 10, 18, + 28, 23, 44, 18, 58, 23, 9, 31, 31, 26, 39, 31, 62, 27, 13, + 35, 20, 39, 43, 35, 50, 39, 1, 47, 24, 43, 32, 40, 54, 43, + 3, 2, 28, 6, 37, 2, 62, 6, 15, 14, 24, 10, 46, 15, 58, + 10, 11, 18, 27, 23, 45, 18, 57, 23, 8, 31, 31, 27, 38, 31, + 61, 27, 12, 35, 19, 39, 42, 35, 49, 39, 0, 47, 23, 43, 33, + 40, 53, 43, 4, 2, 29, 6, 38, 2, 63, 6, 15, 15, 25, 10, + 45, 15, 59, 10, 12, 18, 26, 23, 46, 18, 56, 23, 7, 31, 30, + 27, 37, 31, 60, 27, 11, 35, 18, 39, 41, 35, 48, 39, 0, 40, + 22, 43, 34, 40, 52, 43, 5, 2, 30, 6, 39, 2, 63, 7, 14, + 15, 26, 10, 44, 15, 60, 10, 13, 18, 25, 23, 47, 18, 55, 23, + 6, 31, 29, 27, 36, 31, 59, 27, 10, 35, 17, 39, 40, 35, 48, + 32, 1, 40, 21, 43, 35, 40, 51, 43, 6, 2, 31, 6, 40, 2, + 62, 7, 13, 15, 27, 10, 43, 15, 61, 10, 14, 18, 24, 23, 47, + 19, 54, 23, 5, 31, 28, 27, 35, 31, 58, 27, 9, 35, 16, 39, + 39, 35, 49, 32, 2, 40, 20, 43, 36, 40, 50, 43, 7, 2, 31, + 7, 41, 2, 61, 7, 12, 15, 28, 10, 42, 15, 62, 10, 15, 18, + 23, 23, 46, 19, 53, 23, 4, 31, 27, 27, 34, 31, 57, 27, 8, + 35, 16, 32, 38, 35, 50, 32, 3, 40, 19, 43, 37, 40, 49, 43, + 8, 2, 30, 7, 42, 2, 60, 7, 11, 15, 29, 10, 41, 15, 63, + 10, 15, 19, 22, 23, 45, 19, 52, 23, 3, 31, 26, 27, 33, 31, + 56, 27, 7, 35, 17, 32, 37, 35, 51, 32, 4, 40, 18, 43, 38, + 40, 48, 43, 9, 2, 29, 7, 43, 2, 59, 7, 10, 15, 30, 10, + 40, 15, 63, 11, 14, 19, 21, 23, 44, 19, 51, 23, 2, 31, 25, + 27, 32, 31, 55, 27, 6, 35, 18, 32, 36, 35, 52, 32, 5, 40, + 17, 43, 39, 40, 48, 44, 10, 2, 28, 7, 44, 2, 58, 7, 9, + 15, 31, 10, 39, 15, 62, 11, 13, 19, 20, 23, 43, 19, 50, 23, + 1, 31, 24, 27, 32, 24, 54, 27, 5, 35, 19, 32, 35, 35, 53, + 32, 6, 40, 16, 43, 40, 40, 49, 44, 11, 2, 27, 7, 45, 2, + 57, 7, 8, 15, 31, 11, 38, 15, 61, 11, 12, 19, 19, 23, 42, + 19, 49, 23, 0, 31, 23, 27, 33, 24, 53, 27, 4, 35, 20, 32, + 34, 35, 54, 32, 7, 40, 16, 44, 41, 40, 50, 44, 12, 2, 26, + 7, 46, 2, 56, 7, 7, 15, 30, 11, 37, 15, 60, 11, 11, 19, + 18, 23, 41, 19, 48, 23, 0, 24, 22, 27, 34, 24, 52, 27, 3, + 35, 21, 32, 33, 35, 55, 32, 8, 40, 17, 44, 42, 40, 51, 44, + 13, 2, 25, 7, 47, 2, 55, 7, 6, 15, 29, 11, 36, 15, 59, + 11, 10, 19, 17, 23, 40, 19, 48, 16, 1, 24, 21, 27, 35, 24, + 51, 27, 2, 35, 22, 32, 32, 35, 56, 32, 9, 40, 18, 44, 43, + 40, 52, 44, 14, 2, 24, 7, 47, 3, 54, 7, 5, 15, 28, 11, + 35, 15, 58, 11, 9, 19, 16, 23, 39, 19, 49, 16, 2, 24, 20, + 27, 36, 24, 50, 27, 1, 35, 23, 32, 32, 36, 57, 32, 10, 40, + 19, 44, 44, 40, 53, 44, 15, 2, 23, 7, 46, 3, 53, 7, 4, + 15, 27, 11, 34, 15, 57, 11, 8, 19, 16, 16, 38, 19, 50, 16, + 3, 24, 19, 27, 37, 24, 49, 27, 0, 35, 24, 32, 33, 36, 58, + 32, 11, 40, 20, 44, 45, 40, 54, 44, 15, 3, 22, 7, 45, 3, + 52, 7, 3, 15, 26, 11, 33, 15, 56, 11, 7, 19, 17, 16, 37, + 19, 51, 16, 4, 24, 18, 27, 38, 24, 48, 27, 0, 36, 25, 32, + 34, 36, 59, 32, 12, 40, 21, 44, 46, 40, 55, 44, 14, 3, 21, + 7, 44, 3, 51, 7, 2, 15, 25, 11, 32, 15, 55, 11, 6, 19, + 18, 16, 36, 19, 52, 16, 5, 24, 17, 27, 39, 24, 48, 28, 1, + 36, 26, 32, 35, 36, 60, 32, 13, 40, 22, 44, 47, 40, 56, 44, + 13, 3, 20, 7, 43, 3, 50, 7, 1, 15, 24, 11, 32, 8, 54, + 11, 5, 19, 19, 16, 35, 19, 53, 16, 6, 24, 16, 27, 40, 24, + 49, 28, 2, 36, 27, 32, 36, 36, 61, 32, 14, 40, 23, 44, 47, + 41, 57, 44, 12, 3, 19, 7, 42, 3, 49, 7, 0, 15, 23, 11, + 33, 8, 53, 11, 4, 19, 20, 16, 34, 19, 54, 16, 7, 24, 16, + 28, 41, 24, 50, 28, 3, 36, 28, 32, 37, 36, 62, 32, 15, 40, + 24, 44, 46, 41, 58, 44, 11, 3, 18, 7, 41, 3, 48, 7, 0, + 8, 22, 11, 34, 8, 52, 11, 3, 19, 21, 16, 33, 19, 55, 16, + 8, 24, 17, 28, 42, 24, 51, 28, 4, 36, 29, 32, 38, 36, 63, + 32, 15, 41, 25, 44, 45, 41, 59, 44, 10, 3, 17, 7, 40, 3, + 48, 0, 1, 8, 21, 11, 35, 8, 51, 11, 2, 19, 22, 16, 32, + 19, 56, 16, 9, 24, 18, 28, 43, 24, 52, 28, 5, 36, 30, 32, + 39, 36, 63, 33, 14, 41, 26, 44, 44, 41, 60, 44, 9, 3, 16, + 7, 39, 3, 49, 0, 2, 8, 20, 11, 36, 8, 50, 11, 1, 19, + 23, 16, 32, 20, 57, 16, 10, 24, 19, 28, 44, 24, 53, 28, 6, + 36, 31, 32, 40, 36, 62, 33, 13, 41, 27, 44, 43, 41, 61, 44, + 8, 3, 16, 0, 38, 3, 50, 0, 3, 8, 19, 11, 37, 8, 49, + 11, 0, 19, 24, 16, 33, 20, 58, 16, 11, 24, 20, 28, 45, 24, + 54, 28, 7, 36, 31, 33, 41, 36, 61, 33, 12, 41, 28, 44, 42, + 41, 62, 44, 7, 3, 17, 0, 37, 3, 51, 0, 4, 8, 18, 11, + 38, 8, 48, 11, 0, 20, 25, 16, 34, 20, 59, 16, 12, 24, 21, + 28, 46, 24, 55, 28, 8, 36, 30, 33, 42, 36, 60, 33, 11, 41, + 29, 44, 41, 41, 63, 44, 6, 3, 18, 0, 36, 3, 52, 0, 5, + 8, 17, 11, 39, 8, 48, 12, 1, 20, 26, 16, 35, 20, 60, 16, + 13, 24, 22, 28, 47, 24, 56, 28, 9, 36, 29, 33, 43, 36, 59, + 33, 10, 41, 30, 44, 40, 41, 63, 45, 5, 3, 19, 0, 35, 3, + 53, 0, 6, 8, 16, 11, 40, 8, 49, 12, 2, 20, 27, 16, 36, + 20, 61, 16, 14, 24, 23, 28, 47, 25, 57, 28, 10, 36, 28, 33, + 44, 36, 58, 33, 9, 41, 31, 44, 39, 41, 62, 45, 4, 3, 20, + 0, 34, 3, 54, 0, 7, 8, 16, 12, 41, 8, 50, 12, 3, 20, + 28, 16, 37, 20, 62, 16, 15, 24, 24, 28, 46, 25, 58, 28, 11, + 36, 27, 33, 45, 36, 57, 33, 8, 41, 31, 45, 38, 41, 61, 45, + 3, 3, 21, 0, 33, 3, 55, 0, 8, 8, 17, 12, 42, 8, 51, + 12, 4, 20, 29, 16, 38, 20, 63, 16, 15, 25, 25, 28, 45, 25, + 59, 28, 12, 36, 26, 33, 46, 36, 56, 33, 7, 41, 30, 45, 37, + 41, 60, 45, 2, 3, 22, 0, 32, 3, 56, 0, 9, 8, 18, 12, + 43, 8, 52, 12, 5, 20, 30, 16, 39, 20, 63, 17, 14, 25, 26, + 28, 44, 25, 60, 28, 13, 36, 25, 33, 47, 36, 55, 33, 6, 41, + 29, 45, 36, 41, 59, 45, 1, 3, 23, 0, 32, 4, 57, 0, 10, + 8, 19, 12, 44, 8, 53, 12, 6, 20, 31, 16, 40, 20, 62, 17, + 13, 25, 27, 28, 43, 25, 61, 28, 14, 36, 24, 33, 47, 37, 54, + 33, 5, 41, 28, 45, 35, 41, 58, 45, 0, 3, 24, 0, 33, 4, + 58, 0, 11, 8, 20, 12, 45, 8, 54, 12, 7, 20, 31, 17, 41, + 20, 61, 17, 12, 25, 28, 28, 42, 25, 62, 28, 15, 36, 23, 33, + 46, 37, 53, 33, 4, 41, 27, 45, 34, 41, 57, 45, 0, 4, 25, + 0, 34, 4, 59, 0, 12, 8, 21, 12, 46, 8, 55, 12, 8, 20, + 30, 17, 42, 20, 60, 17, 11, 25, 29, 28, 41, 25, 63, 28, 15, + 37, 22, 33, 45, 37, 52, 33, 3, 41, 26, 45, 33, 41, 56, 45, + 1, 4, 26, 0, 35, 4, 60, 0, 13, 8, 22, 12, 47, 8, 56, + 12, 9, 20, 29, 17, 43, 20, 59, 17, 10, 25, 30, 28, 40, 25, + 63, 29, 14, 37, 21, 33, 44, 37, 51, 33, 2, 41, 25, 45, 32, + 41, 55, 45, 2, 4, 27, 0, 36, 4, 61, 0, 14, 8, 23, 12, + 47, 9, 57, 12, 10, 20, 28, 17, 44, 20, 58, 17, 9, 25, 31, + 28, 39, 25, 62, 29, 13, 37, 20, 33, 43, 37, 50, 33, 1, 41, + 24, 45, 32, 42, 54, 45, 3, 4, 28, 0, 37, 4, 62, 0, 15, + 8, 24, 12, 46, 9, 58, 12, 11, 20, 27, 17, 45, 20, 57, 17, + 8, 25, 31, 29, 38, 25, 61, 29, 12, 37, 19, 33, 42, 37, 49, + 33, 0, 41, 23, 45, 33, 42, 53, 45, 4, 4, 29, 0, 38, 4, + 63, 0, 15, 9, 25, 12, 45, 9, 59, 12, 12, 20, 26, 17, 46, + 20, 56, 17, 7, 25, 30, 29, 37, 25, 60, 29, 11, 37, 18, 33, + 41, 37, 48, 33, 0, 42, 22, 45, 34, 42, 52, 45, 5, 4, 30, + 0, 39, 4, 63, 1, 14, 9, 26, 12, 44, 9, 60, 12, 13, 20, + 25, 17, 47, 20, 55, 17, 6, 25, 29, 29, 36, 25, 59, 29, 10, + 37, 17, 33, 40, 37, 48, 34, 1, 42, 21, 45, 35, 42, 51, 45, + 6, 4, 31, 0, 40, 4, 62, 1, 13, 9, 27, 12, 43, 9, 61, + 12, 14, 20, 24, 17, 47, 21, 54, 17, 5, 25, 28, 29, 35, 25, + 58, 29, 9, 37, 16, 33, 39, 37, 49, 34, 2, 42, 20, 45, 36, + 42, 50, 45, 7, 4, 31, 1, 41, 4, 61, 1, 12, 9, 28, 12, + 42, 9, 62, 12, 15, 20, 23, 17, 46, 21, 53, 17, 4, 25, 27, + 29, 34, 25, 57, 29, 8, 37, 16, 34, 38, 37, 50, 34, 3, 42, + 19, 45, 37, 42, 49, 45, 8, 4, 30, 1, 42, 4, 60, 1, 11, + 9, 29, 12, 41, 9, 63, 12, 15, 21, 22, 17, 45, 21, 52, 17, + 3, 25, 26, 29, 33, 25, 56, 29, 7, 37, 17, 34, 37, 37, 51, + 34, 4, 42, 18, 45, 38, 42, 48, 45, 9, 4, 29, 1, 43, 4, + 59, 1, 10, 9, 30, 12, 40, 9, 63, 13, 14, 21, 21, 17, 44, + 21, 51, 17, 2, 25, 25, 29, 32, 25, 55, 29, 6, 37, 18, 34, + 36, 37, 52, 34, 5, 42, 17, 45, 39, 42, 48, 46, 10, 4, 28, + 1, 44, 4, 58, 1, 9, 9, 31, 12, 39, 9, 62, 13, 13, 21, + 20, 17, 43, 21, 50, 17, 1, 25, 24, 29, 32, 26, 54, 29, 5, + 37, 19, 34, 35, 37, 53, 34, 6, 42, 16, 45, 40, 42, 49, 46, + 11, 4, 27, 1, 45, 4, 57, 1, 8, 9, 31, 13, 38, 9, 61, + 13, 12, 21, 19, 17, 42, 21, 49, 17, 0, 25, 23, 29, 33, 26, + 53, 29, 4, 37, 20, 34, 34, 37, 54, 34, 7, 42, 16, 46, 41, + 42, 50, 46, 12, 4, 26, 1, 46, 4, 56, 1, 7, 9, 30, 13, + 37, 9, 60, 13, 11, 21, 18, 17, 41, 21, 48, 17, 0, 26, 22, + 29, 34, 26, 52, 29, 3, 37, 21, 34, 33, 37, 55, 34, 8, 42, + 17, 46, 42, 42, 51, 46, 13, 4, 25, 1, 47, 4, 55, 1, 6, + 9, 29, 13, 36, 9, 59, 13, 10, 21, 17, 17, 40, 21, 48, 18, + 1, 26, 21, 29, 35, 26, 51, 29, 2, 37, 22, 34, 32, 37, 56, + 34, 9, 42, 18, 46, 43, 42, 52, 46, 14, 4, 24, 1, 47, 5, + 54, 1, 5, 9, 28, 13, 35, 9, 58, 13, 9, 21, 16, 17, 39, + 21, 49, 18, 2, 26, 20, 29, 36, 26, 50, 29, 1, 37, 23, 34, + 32, 38, 57, 34, 10, 42, 19, 46, 44, 42, 53, 46, 15, 4, 23, + 1, 46, 5, 53, 1, 4, 9, 27, 13, 34, 9, 57, 13, 8, 21, + 16, 18, 38, 21, 50, 18, 3, 26, 19, 29, 37, 26, 49, 29, 0, + 37, 24, 34, 33, 38, 58, 34, 11, 42, 20, 46, 45, 42, 54, 46, + 15, 5, 22, 1, 45, 5, 52, 1, 3, 9, 26, 13, 33, 9, 56, + 13, 7, 21, 17, 18, 37, 21, 51, 18, 4, 26, 18, 29, 38, 26, + 48, 29, 0, 38, 25, 34, 34, 38, 59, 34, 12, 42, 21, 46, 46, + 42, 55, 46, 14, 5, 21, 1, 44, 5, 51, 1, 2, 9, 25, 13, + 32, 9, 55, 13, 6, 21, 18, 18, 36, 21, 52, 18, 5, 26, 17, + 29, 39, 26, 48, 30, 1, 38, 26, 34, 35, 38, 60, 34, 13, 42, + 22, 46, 47, 42, 56, 46, 13, 5, 20, 1, 43, 5, 50, 1, 1, + 9, 24, 13, 32, 10, 54, 13, 5, 21, 19, 18, 35, 21, 53, 18, + 6, 26, 16, 29, 40, 26, 49, 30, 2, 38, 27, 34, 36, 38, 61, + 34, 14, 42, 23, 46, 47, 43, 57, 46, 12, 5, 19, 1, 42, 5, + 49, 1, 0, 9, 23, 13, 33, 10, 53, 13, 4, 21, 20, 18, 34, + 21, 54, 18, 7, 26, 16, 30, 41, 26, 50, 30, 3, 38, 28, 34, + 37, 38, 62, 34, 15, 42, 24, 46, 46, 43, 58, 46, 11, 5, 18, + 1, 41, 5, 48, 1, 0, 10, 22, 13, 34, 10, 52, 13, 3, 21, + 21, 18, 33, 21, 55, 18, 8, 26, 17, 30, 42, 26, 51, 30, 4, + 38, 29, 34, 38, 38, 63, 34, 15, 43, 25, 46, 45, 43, 59, 46, + 10, 5, 17, 1, 40, 5, 48, 2, 1, 10, 21, 13, 35, 10, 51, + 13, 2, 21, 22, 18, 32, 21, 56, 18, 9, 26, 18, 30, 43, 26, + 52, 30, 5, 38, 30, 34, 39, 38, 63, 35, 14, 43, 26, 46, 44, + 43, 60, 46, 9, 5, 16, 1, 39, 5, 49, 2, 2, 10, 20, 13, + 36, 10, 50, 13, 1, 21, 23, 18, 32, 22, 57, 18, 10, 26, 19, + 30, 44, 26, 53, 30, 6, 38, 31, 34, 40, 38, 62, 35, 13, 43, + 27, 46, 43, 43, 61, 46, 8, 5, 16, 2, 38, 5, 50, 2, 3, + 10, 19, 13, 37, 10, 49, 13, 0, 21, 24, 18, 33, 22, 58, 18, + 11, 26, 20, 30, 45, 26, 54, 30, 7, 38, 31, 35, 41, 38, 61, + 35, 12, 43, 28, 46, 42, 43, 62, 46, 7, 5, 17, 2, 37, 5, + 51, 2, 4, 10, 18, 13, 38, 10, 48, 13, 0, 22, 25, 18, 34, + 22, 59, 18, 12, 26, 21, 30, 46, 26, 55, 30, 8, 38, 30, 35, + 42, 38, 60, 35, 11, 43, 29, 46, 41, 43, 63, 46, 6, 5, 18, + 2, 36, 5, 52, 2, 5, 10, 17, 13, 39, 10, 48, 14, 1, 22, + 26, 18, 35, 22, 60, 18, 13, 26, 22, 30, 47, 26, 56, 30, 9, + 38, 29, 35, 43, 38, 59, 35, 10, 43, 30, 46, 40, 43, 63, 47, + 5, 5, 19, 2, 35, 5, 53, 2, 6, 10, 16, 13, 40, 10, 49, + 14, 2, 22, 27, 18, 36, 22, 61, 18, 14, 26, 23, 30, 47, 27, + 57, 30, 10, 38, 28, 35, 44, 38, 58, 35, 9, 43, 31, 46, 39, + 43, 62, 47, 4, 5, 20, 2, 34, 5, 54, 2, 7, 10, 16, 14, + 41, 10, 50, 14, 3, 22, 28, 18, 37, 22, 62, 18, 15, 26, 24, + 30, 46, 27, 58, 30, 11, 38, 27, 35, 45, 38, 57, 35, 8, 43, + 31, 47, 38, 43, 61, 47, 3, 5, 21, 2, 33, 5, 55, 2, 8, + 10, 17, 14, 42, 10, 51, 14, 4, 22, 29, 18, 38, 22, 63, 18, + 15, 27, 25, 30, 45, 27, 59, 30, 12, 38, 26, 35, 46, 38, 56, + 35, 7, 43, 30, 47, 37, 43, 60, 47, 2, 5, 22, 2, 32, 5, + 56, 2, 9, 10, 18, 14, 43, 10, 52, 14, 5, 22, 30, 18, 39, + 22, 63, 19, 14, 27, 26, 30, 44, 27, 60, 30, 13, 38, 25, 35, + 47, 38, 55, 35, 6, 43, 29, 47, 36, 43, 59, 47, 1, 5, 23, + 2, 32, 6, 57, 2, 10, 10, 19, 14, 44, 10, 53, 14, 6, 22, + 31, 18, 40, 22, 62, 19, 13, 27, 27, 30, 43, 27, 61, 30, 14, + 38, 24, 35, 47, 39, 54, 35, 5, 43, 28, 47, 35, 43, 58, 47, + 0, 5, 24, 2, 33, 6, 58, 2, 11, 10, 20, 14, 45, 10, 54, + 14, 7, 22, 31, 19, 41, 22, 61, 19, 12, 27, 28, 30, 42, 27, + 62, 30, 15, 38, 23, 35, 46, 39, 53, 35, 4, 43, 27, 47, 34, + 43, 57, 47, 0, 6, 25, 2, 34, 6, 59, 2, 12, 10, 21, 14, + 46, 10, 55, 14, 8, 22, 30, 19, 42, 22, 60, 19, 11, 27, 29, + 30, 41, 27, 63, 30, 15, 39, 22, 35, 45, 39, 52, 35, 3, 43, + 26, 47, 33, 43, 56, 47, 1, 6, 26, 2, 35, 6, 60, 2, 13, + 10, 22, 14, 47, 10, 56, 14, 9, 22, 29, 19, 43, 22, 59, 19, + 10, 27, 30, 30, 40, 27, 63, 31, 14, 39, 21, 35, 44, 39, 51, + 35, 2, 43, 25, 47, 32, 43, 55, 47, 2, 6, 27, 2, 36, 6, + 61, 2, 14, 10, 23, 14, 47, 11, 57, 14, 10, 22, 28, 19, 44, + 22, 58, 19, 9, 27, 31, 30, 39, 27, 62, 31, 13, 39, 20, 35, + 43, 39, 50, 35, 1, 43, 24, 47, 32, 44, 54, 47, 3, 6, 28, + 2, 37, 6, 62, 2, 15, 10, 24, 14, 46, 11, 58, 14, 11, 22, + 27, 19, 45, 22, 57, 19, 8, 27, 31, 31, 38, 27, 61, 31, 12, + 39, 19, 35, 42, 39, 49, 35, 0, 43, 23, 47, 33, 44, 53, 47, + 4, 6, 29, 2, 38, 6, 63, 2, 15, 11, 25, 14, 45, 11, 59, + 14, 12, 22, 26, 19, 46, 22, 56, 19, 7, 27, 30, 31, 37, 27, + 60, 31, 11, 39, 18, 35, 41, 39, 48, 35, 0, 44, 22, 47, 34, + 44, 52, 47, 5, 6, 30, 2, 39, 6, 63, 3, 14, 11, 26, 14, + 44, 11, 60, 14, 13, 22, 25, 19, 47, 22, 55, 19, 6, 27, 29, + 31, 36, 27, 59, 31, 10, 39, 17, 35, 40, 39, 48, 36, 1, 44, + 21, 47, 35, 44, 51, 47, 6, 6, 31, 2, 40, 6, 62, 3, 13, + 11, 27, 14, 43, 11, 61, 14, 14, 22, 24, 19, 47, 23, 54, 19, + 5, 27, 28, 31, 35, 27, 58, 31, 9, 39, 16, 35, 39, 39, 49, + 36, 2, 44, 20, 47, 36, 44, 50, 47, 7, 6, 31, 3, 41, 6, + 61, 3, 12, 11, 28, 14, 42, 11, 62, 14, 15, 22, 23, 19, 46, + 23, 53, 19, 4, 27, 27, 31, 34, 27, 57, 31, 8, 39, 16, 36, + 38, 39, 50, 36, 3, 44, 19, 47, 37, 44, 49, 47, 8, 6, 30, + 3, 42, 6, 60, 3, 11, 11, 29, 14, 41, 11, 63, 14, 15, 23, + 22, 19, 45, 23, 52, 19, 3, 27, 26, 31, 33, 27, 56, 31, 7, + 39, 17, 36, 37, 39, 51, 36, 4, 44, 18, 47, 38, 44, 48, 47, + 9, 6, 29, 3, 43, 6, 59, 3, 10, 11, 30, 14, 40, 11, 63, + 15, 14, 23, 21, 19, 44, 23, 51, 19, 2, 27, 25, 31, 32, 27, + 55, 31, 6, 39, 18, 36, 36, 39, 52, 36, 5, 44, 17, 47, 39, + 44, 48, 40, 10, 6, 28, 3, 44, 6, 58, 3, 9, 11, 31, 14, + 39, 11, 62, 15, 13, 23, 20, 19, 43, 23, 50, 19, 1, 27, 24, + 31, 32, 28, 54, 31, 5, 39, 19, 36, 35, 39, 53, 36, 6, 44, + 16, 47, 40, 44, 49, 40, 11, 6, 27, 3, 45, 6, 57, 3, 8, + 11, 31, 15, 38, 11, 61, 15, 12, 23, 19, 19, 42, 23, 49, 19, + 0, 27, 23, 31, 33, 28, 53, 31, 4, 39, 20, 36, 34, 39, 54, + 36, 7, 44, 16, 40, 41, 44, 50, 40, 12, 6, 26, 3, 46, 6, + 56, 3, 7, 11, 30, 15, 37, 11, 60, 15, 11, 23, 18, 19, 41, + 23, 48, 19, 0, 28, 22, 31, 34, 28, 52, 31, 3, 39, 21, 36, + 33, 39, 55, 36, 8, 44, 17, 40, 42, 44, 51, 40, 13, 6, 25, + 3, 47, 6, 55, 3, 6, 11, 29, 15, 36, 11, 59, 15, 10, 23, + 17, 19, 40, 23, 48, 20, 1, 28, 21, 31, 35, 28, 51, 31, 2, + 39, 22, 36, 32, 39, 56, 36, 9, 44, 18, 40, 43, 44, 52, 40, + 14, 6, 24, 3, 47, 7, 54, 3, 5, 11, 28, 15, 35, 11, 58, + 15, 9, 23, 16, 19, 39, 23, 49, 20, 2, 28, 20, 31, 36, 28, + 50, 31, 1, 39, 23, 36, 32, 32, 57, 36, 10, 44, 19, 40, 44, + 44, 53, 40, 15, 6, 23, 3, 46, 7, 53, 3, 4, 11, 27, 15, + 34, 11, 57, 15, 8, 23, 16, 20, 38, 23, 50, 20, 3, 28, 19, + 31, 37, 28, 49, 31, 0, 39, 24, 36, 33, 32, 58, 36, 11, 44, + 20, 40, 45, 44, 54, 40, 15, 7, 22, 3, 45, 7, 52, 3, 3, + 11, 26, 15, 33, 11, 56, 15, 7, 23, 17, 20, 37, 23, 51, 20, + 4, 28, 18, 31, 38, 28, 48, 31, 0, 32, 25, 36, 34, 32, 59, + 36, 12, 44, 21, 40, 46, 44, 55, 40, 14, 7, 21, 3, 44, 7, + 51, 3, 2, 11, 25, 15, 32, 11, 55, 15, 6, 23, 18, 20, 36, + 23, 52, 20, 5, 28, 17, 31, 39, 28, 48, 24, 1, 32, 26, 36, + 35, 32, 60, 36, 13, 44, 22, 40, 47, 44, 56, 40, 13, 7, 20, + 3, 43, 7, 50, 3, 1, 11, 24, 15, 32, 12, 54, 15, 5, 23, + 19, 20, 35, 23, 53, 20, 6, 28, 16, 31, 40, 28, 49, 24, 2, + 32, 27, 36, 36, 32, 61, 36, 14, 44, 23, 40, 47, 45, 57, 40, + 12, 7, 19, 3, 42, 7, 49, 3, 0, 11, 23, 15, 33, 12, 53, + 15, 4, 23, 20, 20, 34, 23, 54, 20, 7, 28, 16, 24, 41, 28, + 50, 24, 3, 32, 28, 36, 37, 32, 62, 36, 15, 44, 24, 40, 46, + 45, 58, 40, 11, 7, 18, 3, 41, 7, 48, 3, 0, 12, 22, 15, + 34, 12, 52, 15, 3, 23, 21, 20, 33, 23, 55, 20, 8, 28, 17, + 24, 42, 28, 51, 24, 4, 32, 29, 36, 38, 32, 63, 36, 15, 45, + 25, 40, 45, 45, 59, 40, 10, 7, 17, 3, 40, 7, 48, 4, 1, + 12, 21, 15, 35, 12, 51, 15, 2, 23, 22, 20, 32, 23, 56, 20, + 9, 28, 18, 24, 43, 28, 52, 24, 5, 32, 30, 36, 39, 32, 63, + 37, 14, 45, 26, 40, 44, 45, 60, 40, 9, 7, 16, 3, 39, 7, + 49, 4, 2, 12, 20, 15, 36, 12, 50, 15, 1, 23, 23, 20, 32, + 16, 57, 20, 10, 28, 19, 24, 44, 28, 53, 24, 6, 32, 31, 36, + 40, 32, 62, 37, 13, 45, 27, 40, 43, 45, 61, 40, 8, 7, 16, + 4, 38, 7, 50, 4, 3, 12, 19, 15, 37, 12, 49, 15, 0, 23, + 24, 20, 33, 16, 58, 20, 11, 28, 20, 24, 45, 28, 54, 24, 7, + 32, 31, 37, 41, 32, 61, 37, 12, 45, 28, 40, 42, 45, 62, 40, + 7, 7, 17, 4, 37, 7, 51, 4, 4, 12, 18, 15, 38, 12, 48, + 15, 0, 16, 25, 20, 34, 16, 59, 20, 12, 28, 21, 24, 46, 28, + 55, 24, 8, 32, 30, 37, 42, 32, 60, 37, 11, 45, 29, 40, 41, + 45, 63, 40, 6, 7, 18, 4, 36, 7, 52, 4, 5, 12, 17, 15, + 39, 12, 48, 8, 1, 16, 26, 20, 35, 16, 60, 20, 13, 28, 22, + 24, 47, 28, 56, 24, 9, 32, 29, 37, 43, 32, 59, 37, 10, 45, + 30, 40, 40, 45, 63, 41, 5, 7, 19, 4, 35, 7, 53, 4, 6, + 12, 16, 15, 40, 12, 49, 8, 2, 16, 27, 20, 36, 16, 61, 20, + 14, 28, 23, 24, 47, 29, 57, 24, 10, 32, 28, 37, 44, 32, 58, + 37, 9, 45, 31, 40, 39, 45, 62, 41, 4, 7, 20, 4, 34, 7, + 54, 4, 7, 12, 16, 8, 41, 12, 50, 8, 3, 16, 28, 20, 37, + 16, 62, 20, 15, 28, 24, 24, 46, 29, 58, 24, 11, 32, 27, 37, + 45, 32, 57, 37, 8, 45, 31, 41, 38, 45, 61, 41, 3, 7, 21, + 4, 33, 7, 55, 4, 8, 12, 17, 8, 42, 12, 51, 8, 4, 16, + 29, 20, 38, 16, 63, 20, 15, 29, 25, 24, 45, 29, 59, 24, 12, + 32, 26, 37, 46, 32, 56, 37, 7, 45, 30, 41, 37, 45, 60, 41, + 2, 7, 22, 4, 32, 7, 56, 4, 9, 12, 18, 8, 43, 12, 52, + 8, 5, 16, 30, 20, 39, 16, 63, 21, 14, 29, 26, 24, 44, 29, + 60, 24, 13, 32, 25, 37, 47, 32, 55, 37, 6, 45, 29, 41, 36, + 45, 59, 41, 1, 7, 23, 4, 32, 0, 57, 4, 10, 12, 19, 8, + 44, 12, 53, 8, 6, 16, 31, 20, 40, 16, 62, 21, 13, 29, 27, + 24, 43, 29, 61, 24, 14, 32, 24, 37, 47, 33, 54, 37, 5, 45, + 28, 41, 35, 45, 58, 41, 0, 7, 24, 4, 33, 0, 58, 4, 11, + 12, 20, 8, 45, 12, 54, 8, 7, 16, 31, 21, 41, 16, 61, 21, + 12, 29, 28, 24, 42, 29, 62, 24, 15, 32, 23, 37, 46, 33, 53, + 37, 4, 45, 27, 41, 34, 45, 57, 41, +}; + +static const uint8_t hq_tab_20[] = { + 0, 0, 15, 3, 24, 0, 35, 3, 1, 9, 16, 6, 22, 10, 40, + 6, 8, 12, 14, 16, 32, 12, 38, 16, 6, 22, 19, 19, 30, 22, + 39, 19, 5, 25, 21, 29, 25, 25, 41, 29, 1, 0, 14, 3, 25, + 0, 34, 3, 0, 9, 17, 6, 23, 10, 41, 6, 9, 12, 15, 16, + 32, 13, 39, 16, 7, 22, 18, 19, 31, 22, 38, 19, 4, 25, 20, + 29, 24, 25, 40, 29, 2, 0, 13, 3, 26, 0, 33, 3, 0, 10, + 18, 6, 24, 10, 42, 6, 10, 12, 16, 16, 31, 13, 40, 16, 8, + 22, 17, 19, 32, 22, 37, 19, 3, 25, 19, 29, 23, 25, 39, 29, + 3, 0, 12, 3, 27, 0, 33, 4, 1, 10, 19, 6, 25, 10, 43, + 6, 10, 13, 17, 16, 30, 13, 41, 16, 9, 22, 16, 19, 32, 23, + 36, 19, 2, 25, 18, 29, 22, 25, 38, 29, 4, 0, 11, 3, 28, + 0, 34, 4, 2, 10, 20, 6, 26, 10, 43, 7, 9, 13, 18, 16, + 29, 13, 42, 16, 10, 22, 15, 19, 31, 23, 35, 19, 1, 25, 17, + 29, 22, 26, 37, 29, 5, 0, 11, 4, 29, 0, 35, 4, 3, 10, + 21, 6, 27, 10, 42, 7, 8, 13, 19, 16, 28, 13, 43, 16, 10, + 23, 14, 19, 30, 23, 34, 19, 0, 25, 16, 29, 23, 26, 36, 29, + 6, 0, 12, 4, 30, 0, 36, 4, 4, 10, 21, 7, 28, 10, 41, + 7, 7, 13, 20, 16, 27, 13, 43, 17, 9, 23, 13, 19, 29, 23, + 33, 19, 0, 26, 15, 29, 24, 26, 35, 29, 7, 0, 13, 4, 31, + 0, 37, 4, 5, 10, 20, 7, 29, 10, 40, 7, 6, 13, 21, 16, + 26, 13, 42, 17, 8, 23, 12, 19, 28, 23, 33, 20, 1, 26, 14, + 29, 25, 26, 34, 29, 8, 0, 14, 4, 32, 0, 38, 4, 6, 10, + 19, 7, 30, 10, 39, 7, 5, 13, 21, 17, 25, 13, 41, 17, 7, + 23, 11, 19, 27, 23, 34, 20, 2, 26, 13, 29, 26, 26, 33, 29, + 9, 0, 15, 4, 32, 1, 39, 4, 7, 10, 18, 7, 31, 10, 38, + 7, 4, 13, 20, 17, 24, 13, 40, 17, 6, 23, 11, 20, 26, 23, + 35, 20, 3, 26, 12, 29, 27, 26, 33, 24, 10, 0, 16, 4, 31, + 1, 40, 4, 8, 10, 17, 7, 32, 10, 37, 7, 3, 13, 19, 17, + 23, 13, 39, 17, 5, 23, 12, 20, 25, 23, 36, 20, 4, 26, 11, + 29, 28, 26, 34, 24, 10, 1, 17, 4, 30, 1, 41, 4, 9, 10, + 16, 7, 32, 11, 36, 7, 2, 13, 18, 17, 22, 13, 38, 17, 4, + 23, 13, 20, 24, 23, 37, 20, 5, 26, 11, 24, 29, 26, 35, 24, + 9, 1, 18, 4, 29, 1, 42, 4, 10, 10, 15, 7, 31, 11, 35, + 7, 1, 13, 17, 17, 22, 14, 37, 17, 3, 23, 14, 20, 23, 23, + 38, 20, 6, 26, 12, 24, 30, 26, 36, 24, 8, 1, 19, 4, 28, + 1, 43, 4, 10, 11, 14, 7, 30, 11, 34, 7, 0, 13, 16, 17, + 23, 14, 36, 17, 2, 23, 15, 20, 22, 23, 39, 20, 7, 26, 13, + 24, 31, 26, 37, 24, 7, 1, 20, 4, 27, 1, 43, 5, 9, 11, + 13, 7, 29, 11, 33, 7, 0, 14, 15, 17, 24, 14, 35, 17, 1, + 23, 16, 20, 22, 18, 40, 20, 8, 26, 14, 24, 32, 26, 38, 24, + 6, 1, 21, 4, 26, 1, 42, 5, 8, 11, 12, 7, 28, 11, 33, + 8, 1, 14, 14, 17, 25, 14, 34, 17, 0, 23, 17, 20, 23, 18, + 41, 20, 9, 26, 15, 24, 32, 27, 39, 24, 5, 1, 21, 5, 25, + 1, 41, 5, 7, 11, 11, 7, 27, 11, 34, 8, 2, 14, 13, 17, + 26, 14, 33, 17, 0, 18, 18, 20, 24, 18, 42, 20, 10, 26, 16, + 24, 31, 27, 40, 24, 4, 1, 20, 5, 24, 1, 40, 5, 6, 11, + 11, 8, 26, 11, 35, 8, 3, 14, 12, 17, 27, 14, 33, 12, 1, + 18, 19, 20, 25, 18, 43, 20, 10, 27, 17, 24, 30, 27, 41, 24, + 3, 1, 19, 5, 23, 1, 39, 5, 5, 11, 12, 8, 25, 11, 36, + 8, 4, 14, 11, 17, 28, 14, 34, 12, 2, 18, 20, 20, 26, 18, + 43, 21, 9, 27, 18, 24, 29, 27, 42, 24, 2, 1, 18, 5, 22, + 1, 38, 5, 4, 11, 13, 8, 24, 11, 37, 8, 5, 14, 11, 12, + 29, 14, 35, 12, 3, 18, 21, 20, 27, 18, 42, 21, 8, 27, 19, + 24, 28, 27, 43, 24, 1, 1, 17, 5, 22, 2, 37, 5, 3, 11, + 14, 8, 23, 11, 38, 8, 6, 14, 12, 12, 30, 14, 36, 12, 4, + 18, 21, 21, 28, 18, 41, 21, 7, 27, 20, 24, 27, 27, 43, 25, + 0, 1, 16, 5, 23, 2, 36, 5, 2, 11, 15, 8, 22, 11, 39, + 8, 7, 14, 13, 12, 31, 14, 37, 12, 5, 18, 20, 21, 29, 18, + 40, 21, 6, 27, 21, 24, 26, 27, 42, 25, 0, 2, 15, 5, 24, + 2, 35, 5, 1, 11, 16, 8, 22, 6, 40, 8, 8, 14, 14, 12, + 32, 14, 38, 12, 6, 18, 19, 21, 30, 18, 39, 21, 5, 27, 21, + 25, 25, 27, 41, 25, 1, 2, 14, 5, 25, 2, 34, 5, 0, 11, + 17, 8, 23, 6, 41, 8, 9, 14, 15, 12, 32, 15, 39, 12, 7, + 18, 18, 21, 31, 18, 38, 21, 4, 27, 20, 25, 24, 27, 40, 25, + 2, 2, 13, 5, 26, 2, 33, 5, 0, 6, 18, 8, 24, 6, 42, + 8, 10, 14, 16, 12, 31, 15, 40, 12, 8, 18, 17, 21, 32, 18, + 37, 21, 3, 27, 19, 25, 23, 27, 39, 25, 3, 2, 12, 5, 27, + 2, 33, 0, 1, 6, 19, 8, 25, 6, 43, 8, 10, 15, 17, 12, + 30, 15, 41, 12, 9, 18, 16, 21, 32, 19, 36, 21, 2, 27, 18, + 25, 22, 27, 38, 25, 4, 2, 11, 5, 28, 2, 34, 0, 2, 6, + 20, 8, 26, 6, 43, 9, 9, 15, 18, 12, 29, 15, 42, 12, 10, + 18, 15, 21, 31, 19, 35, 21, 1, 27, 17, 25, 22, 28, 37, 25, + 5, 2, 11, 0, 29, 2, 35, 0, 3, 6, 21, 8, 27, 6, 42, + 9, 8, 15, 19, 12, 28, 15, 43, 12, 10, 19, 14, 21, 30, 19, + 34, 21, 0, 27, 16, 25, 23, 28, 36, 25, 6, 2, 12, 0, 30, + 2, 36, 0, 4, 6, 21, 9, 28, 6, 41, 9, 7, 15, 20, 12, + 27, 15, 43, 13, 9, 19, 13, 21, 29, 19, 33, 21, 0, 28, 15, + 25, 24, 28, 35, 25, 7, 2, 13, 0, 31, 2, 37, 0, 5, 6, + 20, 9, 29, 6, 40, 9, 6, 15, 21, 12, 26, 15, 42, 13, 8, + 19, 12, 21, 28, 19, 33, 22, 1, 28, 14, 25, 25, 28, 34, 25, + 8, 2, 14, 0, 32, 2, 38, 0, 6, 6, 19, 9, 30, 6, 39, + 9, 5, 15, 21, 13, 25, 15, 41, 13, 7, 19, 11, 21, 27, 19, + 34, 22, 2, 28, 13, 25, 26, 28, 33, 25, 9, 2, 15, 0, 32, + 3, 39, 0, 7, 6, 18, 9, 31, 6, 38, 9, 4, 15, 20, 13, + 24, 15, 40, 13, 6, 19, 11, 22, 26, 19, 35, 22, 3, 28, 12, + 25, 27, 28, 33, 26, 10, 2, 16, 0, 31, 3, 40, 0, 8, 6, + 17, 9, 32, 6, 37, 9, 3, 15, 19, 13, 23, 15, 39, 13, 5, + 19, 12, 22, 25, 19, 36, 22, 4, 28, 11, 25, 28, 28, 34, 26, + 10, 3, 17, 0, 30, 3, 41, 0, 9, 6, 16, 9, 32, 7, 36, + 9, 2, 15, 18, 13, 22, 15, 38, 13, 4, 19, 13, 22, 24, 19, + 37, 22, 5, 28, 11, 26, 29, 28, 35, 26, 9, 3, 18, 0, 29, + 3, 42, 0, 10, 6, 15, 9, 31, 7, 35, 9, 1, 15, 17, 13, + 22, 16, 37, 13, 3, 19, 14, 22, 23, 19, 38, 22, 6, 28, 12, + 26, 30, 28, 36, 26, 8, 3, 19, 0, 28, 3, 43, 0, 10, 7, + 14, 9, 30, 7, 34, 9, 0, 15, 16, 13, 23, 16, 36, 13, 2, + 19, 15, 22, 22, 19, 39, 22, 7, 28, 13, 26, 31, 28, 37, 26, + 7, 3, 20, 0, 27, 3, 43, 1, 9, 7, 13, 9, 29, 7, 33, + 9, 0, 16, 15, 13, 24, 16, 35, 13, 1, 19, 16, 22, 22, 20, + 40, 22, 8, 28, 14, 26, 32, 28, 38, 26, 6, 3, 21, 0, 26, + 3, 42, 1, 8, 7, 12, 9, 28, 7, 33, 10, 1, 16, 14, 13, + 25, 16, 34, 13, 0, 19, 17, 22, 23, 20, 41, 22, 9, 28, 15, + 26, 32, 29, 39, 26, 5, 3, 21, 1, 25, 3, 41, 1, 7, 7, + 11, 9, 27, 7, 34, 10, 2, 16, 13, 13, 26, 16, 33, 13, 0, + 20, 18, 22, 24, 20, 42, 22, 10, 28, 16, 26, 31, 29, 40, 26, + 4, 3, 20, 1, 24, 3, 40, 1, 6, 7, 11, 10, 26, 7, 35, + 10, 3, 16, 12, 13, 27, 16, 33, 14, 1, 20, 19, 22, 25, 20, + 43, 22, 10, 29, 17, 26, 30, 29, 41, 26, 3, 3, 19, 1, 23, + 3, 39, 1, 5, 7, 12, 10, 25, 7, 36, 10, 4, 16, 11, 13, + 28, 16, 34, 14, 2, 20, 20, 22, 26, 20, 43, 23, 9, 29, 18, + 26, 29, 29, 42, 26, 2, 3, 18, 1, 22, 3, 38, 1, 4, 7, + 13, 10, 24, 7, 37, 10, 5, 16, 11, 14, 29, 16, 35, 14, 3, + 20, 21, 22, 27, 20, 42, 23, 8, 29, 19, 26, 28, 29, 43, 26, + 1, 3, 17, 1, 22, 4, 37, 1, 3, 7, 14, 10, 23, 7, 38, + 10, 6, 16, 12, 14, 30, 16, 36, 14, 4, 20, 21, 23, 28, 20, + 41, 23, 7, 29, 20, 26, 27, 29, 43, 27, 0, 3, 16, 1, 23, + 4, 36, 1, 2, 7, 15, 10, 22, 7, 39, 10, 7, 16, 13, 14, + 31, 16, 37, 14, 5, 20, 20, 23, 29, 20, 40, 23, 6, 29, 21, + 26, 26, 29, 42, 27, 0, 4, 15, 1, 24, 4, 35, 1, 1, 7, + 16, 10, 22, 8, 40, 10, 8, 16, 14, 14, 32, 16, 38, 14, 6, + 20, 19, 23, 30, 20, 39, 23, 5, 29, 21, 27, 25, 29, 41, 27, + 1, 4, 14, 1, 25, 4, 34, 1, 0, 7, 17, 10, 23, 8, 41, + 10, 9, 16, 15, 14, 32, 17, 39, 14, 7, 20, 18, 23, 31, 20, + 38, 23, 4, 29, 20, 27, 24, 29, 40, 27, 2, 4, 13, 1, 26, + 4, 33, 1, 0, 8, 18, 10, 24, 8, 42, 10, 10, 16, 16, 14, + 31, 17, 40, 14, 8, 20, 17, 23, 32, 20, 37, 23, 3, 29, 19, + 27, 23, 29, 39, 27, 3, 4, 12, 1, 27, 4, 33, 2, 1, 8, + 19, 10, 25, 8, 43, 10, 10, 17, 17, 14, 30, 17, 41, 14, 9, + 20, 16, 23, 32, 21, 36, 23, 2, 29, 18, 27, 22, 29, 38, 27, + 4, 4, 11, 1, 28, 4, 34, 2, 2, 8, 20, 10, 26, 8, 43, + 11, 9, 17, 18, 14, 29, 17, 42, 14, 10, 20, 15, 23, 31, 21, + 35, 23, 1, 29, 17, 27, 22, 24, 37, 27, 5, 4, 11, 2, 29, + 4, 35, 2, 3, 8, 21, 10, 27, 8, 42, 11, 8, 17, 19, 14, + 28, 17, 43, 14, 10, 21, 14, 23, 30, 21, 34, 23, 0, 29, 16, + 27, 23, 24, 36, 27, 6, 4, 12, 2, 30, 4, 36, 2, 4, 8, + 21, 11, 28, 8, 41, 11, 7, 17, 20, 14, 27, 17, 43, 15, 9, + 21, 13, 23, 29, 21, 33, 23, 0, 24, 15, 27, 24, 24, 35, 27, + 7, 4, 13, 2, 31, 4, 37, 2, 5, 8, 20, 11, 29, 8, 40, + 11, 6, 17, 21, 14, 26, 17, 42, 15, 8, 21, 12, 23, 28, 21, + 33, 18, 1, 24, 14, 27, 25, 24, 34, 27, 8, 4, 14, 2, 32, + 4, 38, 2, 6, 8, 19, 11, 30, 8, 39, 11, 5, 17, 21, 15, + 25, 17, 41, 15, 7, 21, 11, 23, 27, 21, 34, 18, 2, 24, 13, + 27, 26, 24, 33, 27, 9, 4, 15, 2, 32, 5, 39, 2, 7, 8, + 18, 11, 31, 8, 38, 11, 4, 17, 20, 15, 24, 17, 40, 15, 6, + 21, 11, 18, 26, 21, 35, 18, 3, 24, 12, 27, 27, 24, 33, 28, + 10, 4, 16, 2, 31, 5, 40, 2, 8, 8, 17, 11, 32, 8, 37, + 11, 3, 17, 19, 15, 23, 17, 39, 15, 5, 21, 12, 18, 25, 21, + 36, 18, 4, 24, 11, 27, 28, 24, 34, 28, 10, 5, 17, 2, 30, + 5, 41, 2, 9, 8, 16, 11, 32, 9, 36, 11, 2, 17, 18, 15, + 22, 17, 38, 15, 4, 21, 13, 18, 24, 21, 37, 18, 5, 24, 11, + 28, 29, 24, 35, 28, 9, 5, 18, 2, 29, 5, 42, 2, 10, 8, + 15, 11, 31, 9, 35, 11, 1, 17, 17, 15, 22, 12, 37, 15, 3, + 21, 14, 18, 23, 21, 38, 18, 6, 24, 12, 28, 30, 24, 36, 28, + 8, 5, 19, 2, 28, 5, 43, 2, 10, 9, 14, 11, 30, 9, 34, + 11, 0, 17, 16, 15, 23, 12, 36, 15, 2, 21, 15, 18, 22, 21, + 39, 18, 7, 24, 13, 28, 31, 24, 37, 28, 7, 5, 20, 2, 27, + 5, 43, 3, 9, 9, 13, 11, 29, 9, 33, 11, 0, 12, 15, 15, + 24, 12, 35, 15, 1, 21, 16, 18, 22, 22, 40, 18, 8, 24, 14, + 28, 32, 24, 38, 28, 6, 5, 21, 2, 26, 5, 42, 3, 8, 9, + 12, 11, 28, 9, 33, 6, 1, 12, 14, 15, 25, 12, 34, 15, 0, + 21, 17, 18, 23, 22, 41, 18, 9, 24, 15, 28, 32, 25, 39, 28, + 5, 5, 21, 3, 25, 5, 41, 3, 7, 9, 11, 11, 27, 9, 34, + 6, 2, 12, 13, 15, 26, 12, 33, 15, 0, 22, 18, 18, 24, 22, + 42, 18, 10, 24, 16, 28, 31, 25, 40, 28, 4, 5, 20, 3, 24, + 5, 40, 3, 6, 9, 11, 6, 26, 9, 35, 6, 3, 12, 12, 15, + 27, 12, 33, 16, 1, 22, 19, 18, 25, 22, 43, 18, 10, 25, 17, + 28, 30, 25, 41, 28, 3, 5, 19, 3, 23, 5, 39, 3, 5, 9, + 12, 6, 25, 9, 36, 6, 4, 12, 11, 15, 28, 12, 34, 16, 2, + 22, 20, 18, 26, 22, 43, 19, 9, 25, 18, 28, 29, 25, 42, 28, + 2, 5, 18, 3, 22, 5, 38, 3, 4, 9, 13, 6, 24, 9, 37, + 6, 5, 12, 11, 16, 29, 12, 35, 16, 3, 22, 21, 18, 27, 22, + 42, 19, 8, 25, 19, 28, 28, 25, 43, 28, 1, 5, 17, 3, 22, + 0, 37, 3, 3, 9, 14, 6, 23, 9, 38, 6, 6, 12, 12, 16, + 30, 12, 36, 16, 4, 22, 21, 19, 28, 22, 41, 19, 7, 25, 20, + 28, 27, 25, 43, 29, 0, 5, 16, 3, 23, 0, 36, 3, 2, 9, + 15, 6, 22, 9, 39, 6, 7, 12, 13, 16, 31, 12, 37, 16, 5, + 22, 20, 19, 29, 22, 40, 19, 6, 25, 21, 28, 26, 25, 42, 29, +}; + +static const uint8_t hq_tab_21[] = { + 0, 0, 15, 3, 24, 0, 35, 3, 1, 9, 16, 6, 22, 10, 40, + 6, 8, 12, 14, 16, 32, 12, 38, 16, 6, 22, 19, 19, 30, 22, + 39, 19, 5, 25, 21, 29, 25, 25, 41, 29, 7, 35, 11, 31, 27, + 35, 34, 32, 1, 0, 14, 3, 25, 0, 34, 3, 0, 9, 17, 6, + 23, 10, 41, 6, 9, 12, 15, 16, 32, 13, 39, 16, 7, 22, 18, + 19, 31, 22, 38, 19, 4, 25, 20, 29, 24, 25, 40, 29, 6, 35, + 11, 32, 26, 35, 35, 32, 2, 0, 13, 3, 26, 0, 33, 3, 0, + 10, 18, 6, 24, 10, 42, 6, 10, 12, 16, 16, 31, 13, 40, 16, + 8, 22, 17, 19, 32, 22, 37, 19, 3, 25, 19, 29, 23, 25, 39, + 29, 5, 35, 12, 32, 25, 35, 36, 32, 3, 0, 12, 3, 27, 0, + 33, 4, 1, 10, 19, 6, 25, 10, 43, 6, 10, 13, 17, 16, 30, + 13, 41, 16, 9, 22, 16, 19, 32, 23, 36, 19, 2, 25, 18, 29, + 22, 25, 38, 29, 4, 35, 13, 32, 24, 35, 37, 32, 4, 0, 11, + 3, 28, 0, 34, 4, 2, 10, 20, 6, 26, 10, 43, 7, 9, 13, + 18, 16, 29, 13, 42, 16, 10, 22, 15, 19, 31, 23, 35, 19, 1, + 25, 17, 29, 22, 26, 37, 29, 3, 35, 14, 32, 23, 35, 38, 32, + 5, 0, 11, 4, 29, 0, 35, 4, 3, 10, 21, 6, 27, 10, 42, + 7, 8, 13, 19, 16, 28, 13, 43, 16, 10, 23, 14, 19, 30, 23, + 34, 19, 0, 25, 16, 29, 23, 26, 36, 29, 2, 35, 15, 32, 22, + 35, 39, 32, 6, 0, 12, 4, 30, 0, 36, 4, 4, 10, 21, 7, + 28, 10, 41, 7, 7, 13, 20, 16, 27, 13, 43, 17, 9, 23, 13, + 19, 29, 23, 33, 19, 0, 26, 15, 29, 24, 26, 35, 29, 1, 35, + 16, 32, 22, 30, 40, 32, 7, 0, 13, 4, 31, 0, 37, 4, 5, + 10, 20, 7, 29, 10, 40, 7, 6, 13, 21, 16, 26, 13, 42, 17, + 8, 23, 12, 19, 28, 23, 33, 20, 1, 26, 14, 29, 25, 26, 34, + 29, 0, 35, 17, 32, 23, 30, 41, 32, 8, 0, 14, 4, 32, 0, + 38, 4, 6, 10, 19, 7, 30, 10, 39, 7, 5, 13, 21, 17, 25, + 13, 41, 17, 7, 23, 11, 19, 27, 23, 34, 20, 2, 26, 13, 29, + 26, 26, 33, 29, 0, 30, 18, 32, 24, 30, 42, 32, 9, 0, 15, + 4, 32, 1, 39, 4, 7, 10, 18, 7, 31, 10, 38, 7, 4, 13, + 20, 17, 24, 13, 40, 17, 6, 23, 11, 20, 26, 23, 35, 20, 3, + 26, 12, 29, 27, 26, 33, 24, 1, 30, 19, 32, 25, 30, 43, 32, + 10, 0, 16, 4, 31, 1, 40, 4, 8, 10, 17, 7, 32, 10, 37, + 7, 3, 13, 19, 17, 23, 13, 39, 17, 5, 23, 12, 20, 25, 23, + 36, 20, 4, 26, 11, 29, 28, 26, 34, 24, 2, 30, 20, 32, 26, + 30, 43, 33, 10, 1, 17, 4, 30, 1, 41, 4, 9, 10, 16, 7, + 32, 11, 36, 7, 2, 13, 18, 17, 22, 13, 38, 17, 4, 23, 13, + 20, 24, 23, 37, 20, 5, 26, 11, 24, 29, 26, 35, 24, 3, 30, + 21, 32, 27, 30, 42, 33, 9, 1, 18, 4, 29, 1, 42, 4, 10, + 10, 15, 7, 31, 11, 35, 7, 1, 13, 17, 17, 22, 14, 37, 17, + 3, 23, 14, 20, 23, 23, 38, 20, 6, 26, 12, 24, 30, 26, 36, + 24, 4, 30, 21, 33, 28, 30, 41, 33, 8, 1, 19, 4, 28, 1, + 43, 4, 10, 11, 14, 7, 30, 11, 34, 7, 0, 13, 16, 17, 23, + 14, 36, 17, 2, 23, 15, 20, 22, 23, 39, 20, 7, 26, 13, 24, + 31, 26, 37, 24, 5, 30, 20, 33, 29, 30, 40, 33, 7, 1, 20, + 4, 27, 1, 43, 5, 9, 11, 13, 7, 29, 11, 33, 7, 0, 14, + 15, 17, 24, 14, 35, 17, 1, 23, 16, 20, 22, 18, 40, 20, 8, + 26, 14, 24, 32, 26, 38, 24, 6, 30, 19, 33, 30, 30, 39, 33, + 6, 1, 21, 4, 26, 1, 42, 5, 8, 11, 12, 7, 28, 11, 33, + 8, 1, 14, 14, 17, 25, 14, 34, 17, 0, 23, 17, 20, 23, 18, + 41, 20, 9, 26, 15, 24, 32, 27, 39, 24, 7, 30, 18, 33, 31, + 30, 38, 33, 5, 1, 21, 5, 25, 1, 41, 5, 7, 11, 11, 7, + 27, 11, 34, 8, 2, 14, 13, 17, 26, 14, 33, 17, 0, 18, 18, + 20, 24, 18, 42, 20, 10, 26, 16, 24, 31, 27, 40, 24, 8, 30, + 17, 33, 32, 30, 37, 33, 4, 1, 20, 5, 24, 1, 40, 5, 6, + 11, 11, 8, 26, 11, 35, 8, 3, 14, 12, 17, 27, 14, 33, 12, + 1, 18, 19, 20, 25, 18, 43, 20, 10, 27, 17, 24, 30, 27, 41, + 24, 9, 30, 16, 33, 32, 31, 36, 33, 3, 1, 19, 5, 23, 1, + 39, 5, 5, 11, 12, 8, 25, 11, 36, 8, 4, 14, 11, 17, 28, + 14, 34, 12, 2, 18, 20, 20, 26, 18, 43, 21, 9, 27, 18, 24, + 29, 27, 42, 24, 10, 30, 15, 33, 31, 31, 35, 33, 2, 1, 18, + 5, 22, 1, 38, 5, 4, 11, 13, 8, 24, 11, 37, 8, 5, 14, + 11, 12, 29, 14, 35, 12, 3, 18, 21, 20, 27, 18, 42, 21, 8, + 27, 19, 24, 28, 27, 43, 24, 10, 31, 14, 33, 30, 31, 34, 33, + 1, 1, 17, 5, 22, 2, 37, 5, 3, 11, 14, 8, 23, 11, 38, + 8, 6, 14, 12, 12, 30, 14, 36, 12, 4, 18, 21, 21, 28, 18, + 41, 21, 7, 27, 20, 24, 27, 27, 43, 25, 9, 31, 13, 33, 29, + 31, 33, 33, 0, 1, 16, 5, 23, 2, 36, 5, 2, 11, 15, 8, + 22, 11, 39, 8, 7, 14, 13, 12, 31, 14, 37, 12, 5, 18, 20, + 21, 29, 18, 40, 21, 6, 27, 21, 24, 26, 27, 42, 25, 8, 31, + 12, 33, 28, 31, 33, 34, 0, 2, 15, 5, 24, 2, 35, 5, 1, + 11, 16, 8, 22, 6, 40, 8, 8, 14, 14, 12, 32, 14, 38, 12, + 6, 18, 19, 21, 30, 18, 39, 21, 5, 27, 21, 25, 25, 27, 41, + 25, 7, 31, 11, 33, 27, 31, 34, 34, 1, 2, 14, 5, 25, 2, + 34, 5, 0, 11, 17, 8, 23, 6, 41, 8, 9, 14, 15, 12, 32, + 15, 39, 12, 7, 18, 18, 21, 31, 18, 38, 21, 4, 27, 20, 25, + 24, 27, 40, 25, 6, 31, 11, 34, 26, 31, 35, 34, 2, 2, 13, + 5, 26, 2, 33, 5, 0, 6, 18, 8, 24, 6, 42, 8, 10, 14, + 16, 12, 31, 15, 40, 12, 8, 18, 17, 21, 32, 18, 37, 21, 3, + 27, 19, 25, 23, 27, 39, 25, 5, 31, 12, 34, 25, 31, 36, 34, + 3, 2, 12, 5, 27, 2, 33, 0, 1, 6, 19, 8, 25, 6, 43, + 8, 10, 15, 17, 12, 30, 15, 41, 12, 9, 18, 16, 21, 32, 19, + 36, 21, 2, 27, 18, 25, 22, 27, 38, 25, 4, 31, 13, 34, 24, + 31, 37, 34, 4, 2, 11, 5, 28, 2, 34, 0, 2, 6, 20, 8, + 26, 6, 43, 9, 9, 15, 18, 12, 29, 15, 42, 12, 10, 18, 15, + 21, 31, 19, 35, 21, 1, 27, 17, 25, 22, 28, 37, 25, 3, 31, + 14, 34, 23, 31, 38, 34, 5, 2, 11, 0, 29, 2, 35, 0, 3, + 6, 21, 8, 27, 6, 42, 9, 8, 15, 19, 12, 28, 15, 43, 12, + 10, 19, 14, 21, 30, 19, 34, 21, 0, 27, 16, 25, 23, 28, 36, + 25, 2, 31, 15, 34, 22, 31, 39, 34, 6, 2, 12, 0, 30, 2, + 36, 0, 4, 6, 21, 9, 28, 6, 41, 9, 7, 15, 20, 12, 27, + 15, 43, 13, 9, 19, 13, 21, 29, 19, 33, 21, 0, 28, 15, 25, + 24, 28, 35, 25, 1, 31, 16, 34, 22, 32, 40, 34, 7, 2, 13, + 0, 31, 2, 37, 0, 5, 6, 20, 9, 29, 6, 40, 9, 6, 15, + 21, 12, 26, 15, 42, 13, 8, 19, 12, 21, 28, 19, 33, 22, 1, + 28, 14, 25, 25, 28, 34, 25, 0, 31, 17, 34, 23, 32, 41, 34, + 8, 2, 14, 0, 32, 2, 38, 0, 6, 6, 19, 9, 30, 6, 39, + 9, 5, 15, 21, 13, 25, 15, 41, 13, 7, 19, 11, 21, 27, 19, + 34, 22, 2, 28, 13, 25, 26, 28, 33, 25, 0, 32, 18, 34, 24, + 32, 42, 34, 9, 2, 15, 0, 32, 3, 39, 0, 7, 6, 18, 9, + 31, 6, 38, 9, 4, 15, 20, 13, 24, 15, 40, 13, 6, 19, 11, + 22, 26, 19, 35, 22, 3, 28, 12, 25, 27, 28, 33, 26, 1, 32, + 19, 34, 25, 32, 43, 34, 10, 2, 16, 0, 31, 3, 40, 0, 8, + 6, 17, 9, 32, 6, 37, 9, 3, 15, 19, 13, 23, 15, 39, 13, + 5, 19, 12, 22, 25, 19, 36, 22, 4, 28, 11, 25, 28, 28, 34, + 26, 2, 32, 20, 34, 26, 32, 43, 35, 10, 3, 17, 0, 30, 3, + 41, 0, 9, 6, 16, 9, 32, 7, 36, 9, 2, 15, 18, 13, 22, + 15, 38, 13, 4, 19, 13, 22, 24, 19, 37, 22, 5, 28, 11, 26, + 29, 28, 35, 26, 3, 32, 21, 34, 27, 32, 42, 35, 9, 3, 18, + 0, 29, 3, 42, 0, 10, 6, 15, 9, 31, 7, 35, 9, 1, 15, + 17, 13, 22, 16, 37, 13, 3, 19, 14, 22, 23, 19, 38, 22, 6, + 28, 12, 26, 30, 28, 36, 26, 4, 32, 21, 35, 28, 32, 41, 35, + 8, 3, 19, 0, 28, 3, 43, 0, 10, 7, 14, 9, 30, 7, 34, + 9, 0, 15, 16, 13, 23, 16, 36, 13, 2, 19, 15, 22, 22, 19, + 39, 22, 7, 28, 13, 26, 31, 28, 37, 26, 5, 32, 20, 35, 29, + 32, 40, 35, 7, 3, 20, 0, 27, 3, 43, 1, 9, 7, 13, 9, + 29, 7, 33, 9, 0, 16, 15, 13, 24, 16, 35, 13, 1, 19, 16, + 22, 22, 20, 40, 22, 8, 28, 14, 26, 32, 28, 38, 26, 6, 32, + 19, 35, 30, 32, 39, 35, 6, 3, 21, 0, 26, 3, 42, 1, 8, + 7, 12, 9, 28, 7, 33, 10, 1, 16, 14, 13, 25, 16, 34, 13, + 0, 19, 17, 22, 23, 20, 41, 22, 9, 28, 15, 26, 32, 29, 39, + 26, 7, 32, 18, 35, 31, 32, 38, 35, 5, 3, 21, 1, 25, 3, + 41, 1, 7, 7, 11, 9, 27, 7, 34, 10, 2, 16, 13, 13, 26, + 16, 33, 13, 0, 20, 18, 22, 24, 20, 42, 22, 10, 28, 16, 26, + 31, 29, 40, 26, 8, 32, 17, 35, 32, 32, 37, 35, 4, 3, 20, + 1, 24, 3, 40, 1, 6, 7, 11, 10, 26, 7, 35, 10, 3, 16, + 12, 13, 27, 16, 33, 14, 1, 20, 19, 22, 25, 20, 43, 22, 10, + 29, 17, 26, 30, 29, 41, 26, 9, 32, 16, 35, 32, 33, 36, 35, + 3, 3, 19, 1, 23, 3, 39, 1, 5, 7, 12, 10, 25, 7, 36, + 10, 4, 16, 11, 13, 28, 16, 34, 14, 2, 20, 20, 22, 26, 20, + 43, 23, 9, 29, 18, 26, 29, 29, 42, 26, 10, 32, 15, 35, 31, + 33, 35, 35, 2, 3, 18, 1, 22, 3, 38, 1, 4, 7, 13, 10, + 24, 7, 37, 10, 5, 16, 11, 14, 29, 16, 35, 14, 3, 20, 21, + 22, 27, 20, 42, 23, 8, 29, 19, 26, 28, 29, 43, 26, 10, 33, + 14, 35, 30, 33, 34, 35, 1, 3, 17, 1, 22, 4, 37, 1, 3, + 7, 14, 10, 23, 7, 38, 10, 6, 16, 12, 14, 30, 16, 36, 14, + 4, 20, 21, 23, 28, 20, 41, 23, 7, 29, 20, 26, 27, 29, 43, + 27, 9, 33, 13, 35, 29, 33, 33, 35, 0, 3, 16, 1, 23, 4, + 36, 1, 2, 7, 15, 10, 22, 7, 39, 10, 7, 16, 13, 14, 31, + 16, 37, 14, 5, 20, 20, 23, 29, 20, 40, 23, 6, 29, 21, 26, + 26, 29, 42, 27, 8, 33, 12, 35, 28, 33, 33, 30, 0, 4, 15, + 1, 24, 4, 35, 1, 1, 7, 16, 10, 22, 8, 40, 10, 8, 16, + 14, 14, 32, 16, 38, 14, 6, 20, 19, 23, 30, 20, 39, 23, 5, + 29, 21, 27, 25, 29, 41, 27, 7, 33, 11, 35, 27, 33, 34, 30, + 1, 4, 14, 1, 25, 4, 34, 1, 0, 7, 17, 10, 23, 8, 41, + 10, 9, 16, 15, 14, 32, 17, 39, 14, 7, 20, 18, 23, 31, 20, + 38, 23, 4, 29, 20, 27, 24, 29, 40, 27, 6, 33, 11, 30, 26, + 33, 35, 30, 2, 4, 13, 1, 26, 4, 33, 1, 0, 8, 18, 10, + 24, 8, 42, 10, 10, 16, 16, 14, 31, 17, 40, 14, 8, 20, 17, + 23, 32, 20, 37, 23, 3, 29, 19, 27, 23, 29, 39, 27, 5, 33, + 12, 30, 25, 33, 36, 30, 3, 4, 12, 1, 27, 4, 33, 2, 1, + 8, 19, 10, 25, 8, 43, 10, 10, 17, 17, 14, 30, 17, 41, 14, + 9, 20, 16, 23, 32, 21, 36, 23, 2, 29, 18, 27, 22, 29, 38, + 27, 4, 33, 13, 30, 24, 33, 37, 30, 4, 4, 11, 1, 28, 4, + 34, 2, 2, 8, 20, 10, 26, 8, 43, 11, 9, 17, 18, 14, 29, + 17, 42, 14, 10, 20, 15, 23, 31, 21, 35, 23, 1, 29, 17, 27, + 22, 24, 37, 27, 3, 33, 14, 30, 23, 33, 38, 30, 5, 4, 11, + 2, 29, 4, 35, 2, 3, 8, 21, 10, 27, 8, 42, 11, 8, 17, + 19, 14, 28, 17, 43, 14, 10, 21, 14, 23, 30, 21, 34, 23, 0, + 29, 16, 27, 23, 24, 36, 27, 2, 33, 15, 30, 22, 33, 39, 30, + 6, 4, 12, 2, 30, 4, 36, 2, 4, 8, 21, 11, 28, 8, 41, + 11, 7, 17, 20, 14, 27, 17, 43, 15, 9, 21, 13, 23, 29, 21, + 33, 23, 0, 24, 15, 27, 24, 24, 35, 27, 1, 33, 16, 30, 22, + 34, 40, 30, 7, 4, 13, 2, 31, 4, 37, 2, 5, 8, 20, 11, + 29, 8, 40, 11, 6, 17, 21, 14, 26, 17, 42, 15, 8, 21, 12, + 23, 28, 21, 33, 18, 1, 24, 14, 27, 25, 24, 34, 27, 0, 33, + 17, 30, 23, 34, 41, 30, 8, 4, 14, 2, 32, 4, 38, 2, 6, + 8, 19, 11, 30, 8, 39, 11, 5, 17, 21, 15, 25, 17, 41, 15, + 7, 21, 11, 23, 27, 21, 34, 18, 2, 24, 13, 27, 26, 24, 33, + 27, 0, 34, 18, 30, 24, 34, 42, 30, 9, 4, 15, 2, 32, 5, + 39, 2, 7, 8, 18, 11, 31, 8, 38, 11, 4, 17, 20, 15, 24, + 17, 40, 15, 6, 21, 11, 18, 26, 21, 35, 18, 3, 24, 12, 27, + 27, 24, 33, 28, 1, 34, 19, 30, 25, 34, 43, 30, 10, 4, 16, + 2, 31, 5, 40, 2, 8, 8, 17, 11, 32, 8, 37, 11, 3, 17, + 19, 15, 23, 17, 39, 15, 5, 21, 12, 18, 25, 21, 36, 18, 4, + 24, 11, 27, 28, 24, 34, 28, 2, 34, 20, 30, 26, 34, 43, 31, + 10, 5, 17, 2, 30, 5, 41, 2, 9, 8, 16, 11, 32, 9, 36, + 11, 2, 17, 18, 15, 22, 17, 38, 15, 4, 21, 13, 18, 24, 21, + 37, 18, 5, 24, 11, 28, 29, 24, 35, 28, 3, 34, 21, 30, 27, + 34, 42, 31, 9, 5, 18, 2, 29, 5, 42, 2, 10, 8, 15, 11, + 31, 9, 35, 11, 1, 17, 17, 15, 22, 12, 37, 15, 3, 21, 14, + 18, 23, 21, 38, 18, 6, 24, 12, 28, 30, 24, 36, 28, 4, 34, + 21, 31, 28, 34, 41, 31, 8, 5, 19, 2, 28, 5, 43, 2, 10, + 9, 14, 11, 30, 9, 34, 11, 0, 17, 16, 15, 23, 12, 36, 15, + 2, 21, 15, 18, 22, 21, 39, 18, 7, 24, 13, 28, 31, 24, 37, + 28, 5, 34, 20, 31, 29, 34, 40, 31, 7, 5, 20, 2, 27, 5, + 43, 3, 9, 9, 13, 11, 29, 9, 33, 11, 0, 12, 15, 15, 24, + 12, 35, 15, 1, 21, 16, 18, 22, 22, 40, 18, 8, 24, 14, 28, + 32, 24, 38, 28, 6, 34, 19, 31, 30, 34, 39, 31, 6, 5, 21, + 2, 26, 5, 42, 3, 8, 9, 12, 11, 28, 9, 33, 6, 1, 12, + 14, 15, 25, 12, 34, 15, 0, 21, 17, 18, 23, 22, 41, 18, 9, + 24, 15, 28, 32, 25, 39, 28, 7, 34, 18, 31, 31, 34, 38, 31, + 5, 5, 21, 3, 25, 5, 41, 3, 7, 9, 11, 11, 27, 9, 34, + 6, 2, 12, 13, 15, 26, 12, 33, 15, 0, 22, 18, 18, 24, 22, + 42, 18, 10, 24, 16, 28, 31, 25, 40, 28, 8, 34, 17, 31, 32, + 34, 37, 31, 4, 5, 20, 3, 24, 5, 40, 3, 6, 9, 11, 6, + 26, 9, 35, 6, 3, 12, 12, 15, 27, 12, 33, 16, 1, 22, 19, + 18, 25, 22, 43, 18, 10, 25, 17, 28, 30, 25, 41, 28, 9, 34, + 16, 31, 32, 35, 36, 31, 3, 5, 19, 3, 23, 5, 39, 3, 5, + 9, 12, 6, 25, 9, 36, 6, 4, 12, 11, 15, 28, 12, 34, 16, + 2, 22, 20, 18, 26, 22, 43, 19, 9, 25, 18, 28, 29, 25, 42, + 28, 10, 34, 15, 31, 31, 35, 35, 31, 2, 5, 18, 3, 22, 5, + 38, 3, 4, 9, 13, 6, 24, 9, 37, 6, 5, 12, 11, 16, 29, + 12, 35, 16, 3, 22, 21, 18, 27, 22, 42, 19, 8, 25, 19, 28, + 28, 25, 43, 28, 10, 35, 14, 31, 30, 35, 34, 31, 1, 5, 17, + 3, 22, 0, 37, 3, 3, 9, 14, 6, 23, 9, 38, 6, 6, 12, + 12, 16, 30, 12, 36, 16, 4, 22, 21, 19, 28, 22, 41, 19, 7, + 25, 20, 28, 27, 25, 43, 29, 9, 35, 13, 31, 29, 35, 33, 31, + 0, 5, 16, 3, 23, 0, 36, 3, 2, 9, 15, 6, 22, 9, 39, + 6, 7, 12, 13, 16, 31, 12, 37, 16, 5, 22, 20, 19, 29, 22, + 40, 19, 6, 25, 21, 28, 26, 25, 42, 29, 8, 35, 12, 31, 28, + 35, 33, 32, +}; + +/* List of profiles, order is important */ +static const HQProfile hq_profile[NUM_HQ_PROFILES] = { + { hq_tab_11, 160, 120, 8, 10, 8 }, // case 0 (default) = case 11 + { hq_tab_01, 720, 480, 8, 25, 54 }, + { hq_tab_02, 720, 486, 8, 15, 93 }, + { hq_tab_03, 720, 576, 8, 20, 81 }, + { hq_tab_04, 960, 720, 12, 25, 108 }, + { hq_tab_05, 1280, 720, 16, 25, 144 }, + { hq_tab_06, 1280, 1080, 16, 20, 272 }, + { hq_tab_07, 1440, 1080, 16, 24, 255 }, + { hq_tab_08, 1920, 1080, 20, 24, 340 }, + { hq_tab_09, 640, 480, 8, 25, 48 }, + { hq_tab_10, 320, 240, 8, 25, 12 }, + { hq_tab_11, 160, 120, 8, 10, 8 }, + { hq_tab_12, 800, 600, 8, 25, 76 }, + { hq_tab_13, 352, 480, 8, 20, 33 }, + { hq_tab_14, 352, 240, 8, 22, 15 }, + { hq_tab_15, 352, 288, 8, 18, 22 }, + { hq_tab_16, 176, 144, 8, 9, 11 }, + { hq_tab_17, 1280, 1024, 16, 20, 256 }, + { hq_tab_18, 1280, 960, 16, 25, 192 }, + { hq_tab_19, 1024, 768, 16, 24, 128 }, + { hq_tab_20, 704, 480, 8, 20, 66 }, + { hq_tab_21, 704, 576, 8, 24, 66 }, +}; + +#endif /* AVCODEC_HQ_HQADATA_H */ diff --git a/include/libavcodec/hq_hqadsp.h b/include/libavcodec/hq_hqadsp.h new file mode 100644 index 0000000..420ed92 --- /dev/null +++ b/include/libavcodec/hq_hqadsp.h @@ -0,0 +1,38 @@ +/* + * Canopus HQ/HQA decoder + * + * 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 + */ + +/** + * @file + * HQ/HQA variant of AAN IDCT + * It differs from the standard AAN IDCT in precision and in the second stage. + */ + +#ifndef AVCODEC_HQ_HQADSP_H +#define AVCODEC_HQ_HQADSP_H + +#include + +typedef struct HQDSPContext { + void (*idct_put)(uint8_t *dst, int stride, int16_t *block); +} HQDSPContext; + +void ff_hqdsp_init(HQDSPContext *c); + +#endif /* AVCODEC_HQ_HQADSP_H */ diff --git a/include/libavcodec/hqx.h b/include/libavcodec/hqx.h new file mode 100644 index 0000000..155ec7f --- /dev/null +++ b/include/libavcodec/hqx.h @@ -0,0 +1,88 @@ +/* + * Canopus HQX decoder + * + * 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_HQX_H +#define AVCODEC_HQX_H + +#include + +#include "libavutil/frame.h" +#include "libavutil/mem_internal.h" + +#include "get_bits.h" +#include "hqxdsp.h" + +enum HQXACMode { + HQX_AC_Q0 = 0, + HQX_AC_Q8, + HQX_AC_Q16, + HQX_AC_Q32, + HQX_AC_Q64, + HQX_AC_Q128, + NUM_HQX_AC +}; + +typedef struct HQXLUT { + int16_t lev; + uint8_t run; + int8_t bits; +} HQXLUT; + +typedef struct HQXAC { + int lut_bits, extra_bits; + const HQXLUT *lut; +} HQXAC; + +struct HQXContext; + +typedef int (*mb_decode_func)(struct HQXContext *ctx, + int slice_no, int x, int y); + +typedef struct HQXSlice { + GetBitContext gb; + DECLARE_ALIGNED(16, int16_t, block)[16][64]; +} HQXSlice; + +typedef struct HQXContext { + HQXDSPContext hqxdsp; + HQXSlice slice[16]; + + AVFrame *pic; + mb_decode_func decode_func; + + int format, dcb, width, height; + int interlaced; + + const uint8_t *src; + unsigned int data_size; + uint32_t slice_off[17]; + + VLC cbp_vlc; + 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]; + +int ff_hqx_init_vlcs(HQXContext *ctx); + +#endif /* AVCODEC_HQX_H */ diff --git a/include/libavcodec/hqxdsp.h b/include/libavcodec/hqxdsp.h new file mode 100644 index 0000000..39ab3e2 --- /dev/null +++ b/include/libavcodec/hqxdsp.h @@ -0,0 +1,39 @@ +/* + * HQX DSP routines + * + * 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 + */ + +/** + * @file + * HQX DSP routines + */ + +#ifndef AVCODEC_HQXDSP_H +#define AVCODEC_HQXDSP_H + +#include +#include + +typedef struct HQXDSPContext { + void (*idct_put)(uint16_t *dst, ptrdiff_t stride, + int16_t *block, const uint8_t *quant); +} HQXDSPContext; + +void ff_hqxdsp_init(HQXDSPContext *c); + +#endif /* AVCODEC_HQXDSP_H */ diff --git a/include/libavcodec/htmlsubtitles.h b/include/libavcodec/htmlsubtitles.h new file mode 100644 index 0000000..f3a8ef5 --- /dev/null +++ b/include/libavcodec/htmlsubtitles.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2010 Aurelien Jacobs + * + * 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_HTMLSUBTITLES_H +#define AVCODEC_HTMLSUBTITLES_H + +#include "libavutil/bprint.h" + +int ff_htmlmarkup_to_ass(void *log_ctx, AVBPrint *dst, const char *in); + +#endif /* AVCODEC_HTMLSUBTITLES_H */ diff --git a/include/libavcodec/huffman.h b/include/libavcodec/huffman.h new file mode 100644 index 0000000..1d5e140 --- /dev/null +++ b/include/libavcodec/huffman.h @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2007 Aurelien Jacobs + * + * 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 + */ + +/** + * @file + * huffman tree builder and VLC generator + */ + +#ifndef AVCODEC_HUFFMAN_H +#define AVCODEC_HUFFMAN_H + +#include + +#include "vlc.h" + +typedef struct Node { + int16_t sym; + int16_t n0; + uint32_t count; +} Node; + +#define FF_HUFFMAN_FLAG_HNODE_FIRST 0x01 +#define FF_HUFFMAN_FLAG_ZERO_COUNT 0x02 +#define FF_HUFFMAN_BITS 10 + +typedef int (*HuffCmp)(const void *va, const void *vb); +int ff_huff_build_tree(void *logctx, VLC *vlc, int nb_codes, int nb_bits, + Node *nodes, HuffCmp cmp, int flags); + +int ff_huff_gen_len_table(uint8_t *dst, const uint64_t *stats, int n, int skip0); + +#endif /* AVCODEC_HUFFMAN_H */ diff --git a/include/libavcodec/huffyuv.h b/include/libavcodec/huffyuv.h new file mode 100644 index 0000000..62866b7 --- /dev/null +++ b/include/libavcodec/huffyuv.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2002-2014 Michael Niedermayer + * + * see https://multimedia.cx/huffyuv.txt for a description of + * the algorithm used + * + * 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 + */ + +/** + * @file + * huffyuv codec for libavcodec. + */ + +#ifndef AVCODEC_HUFFYUV_H +#define AVCODEC_HUFFYUV_H + +#include + +#include "config.h" + +#if HAVE_BIGENDIAN +#define B 3 +#define G 2 +#define R 1 +#define A 0 +#else +#define B 0 +#define G 1 +#define R 2 +#define A 3 +#endif + +#define MAX_BITS 16 +#define MAX_N (1< +#include "libavutil/pixfmt.h" + +typedef struct HuffYUVDSPContext { + void (*add_int16)(uint16_t *dst/*align 16*/, const uint16_t *src/*align 16*/, + unsigned mask, int w); + + void (*add_hfyu_median_pred_int16)(uint16_t *dst, const uint16_t *top, + const uint16_t *diff, unsigned mask, + int w, int *left, int *left_top); + void (*add_hfyu_left_pred_bgr32)(uint8_t *dst, const uint8_t *src, + intptr_t w, uint8_t *left); +} HuffYUVDSPContext; + +void ff_huffyuvdsp_init(HuffYUVDSPContext *c, enum AVPixelFormat pix_fmt); +void ff_huffyuvdsp_init_riscv(HuffYUVDSPContext *c, + enum AVPixelFormat pix_fmt); +void ff_huffyuvdsp_init_x86(HuffYUVDSPContext *c, enum AVPixelFormat pix_fmt); + +#endif /* AVCODEC_HUFFYUVDSP_H */ diff --git a/include/libavcodec/huffyuvencdsp.h b/include/libavcodec/huffyuvencdsp.h new file mode 100644 index 0000000..779a51a --- /dev/null +++ b/include/libavcodec/huffyuvencdsp.h @@ -0,0 +1,40 @@ +/* + * 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_HUFFYUVENCDSP_H +#define AVCODEC_HUFFYUVENCDSP_H + +#include + +#include "libavutil/pixfmt.h" + +typedef struct HuffYUVEncDSPContext { + void (*diff_int16)(uint16_t *dst /* align 16 */, + const uint16_t *src1 /* align 16 */, + const uint16_t *src2 /* align 1 */, + unsigned mask, int w); + + void (*sub_hfyu_median_pred_int16)(uint16_t *dst, const uint16_t *src1, + const uint16_t *src2, unsigned mask, + int w, int *left, int *left_top); +} HuffYUVEncDSPContext; + +void ff_huffyuvencdsp_init(HuffYUVEncDSPContext *c, enum AVPixelFormat pix_fmt); +void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c, enum AVPixelFormat pix_fmt); + +#endif /* AVCODEC_HUFFYUVENCDSP_H */ diff --git a/include/libavcodec/hw_base_encode.h b/include/libavcodec/hw_base_encode.h new file mode 100644 index 0000000..e30b1e6 --- /dev/null +++ b/include/libavcodec/hw_base_encode.h @@ -0,0 +1,253 @@ +/* + * 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_HW_BASE_ENCODE_H +#define AVCODEC_HW_BASE_ENCODE_H + +#include "avcodec.h" +#include "libavutil/hwcontext.h" +#include "libavutil/fifo.h" + +#define MAX_DPB_SIZE 16 +#define MAX_PICTURE_REFERENCES 2 +#define MAX_REORDER_DELAY 16 +#define MAX_ASYNC_DEPTH 64 +#define MAX_REFERENCE_LIST_NUM 2 + +static inline const char *ff_hw_base_encode_get_pictype_name(const int type) +{ + const char * const picture_type_name[] = { "IDR", "I", "P", "B" }; + return picture_type_name[type]; +} + +enum { + FF_HW_PICTURE_TYPE_IDR = 0, + FF_HW_PICTURE_TYPE_I = 1, + FF_HW_PICTURE_TYPE_P = 2, + FF_HW_PICTURE_TYPE_B = 3, +}; + +enum { + // Codec supports controlling the subdivision of pictures into slices. + FF_HW_FLAG_SLICE_CONTROL = 1 << 0, + // Codec only supports constant quality (no rate control). + FF_HW_FLAG_CONSTANT_QUALITY_ONLY = 1 << 1, + // Codec is intra-only. + FF_HW_FLAG_INTRA_ONLY = 1 << 2, + // Codec supports B-pictures. + FF_HW_FLAG_B_PICTURES = 1 << 3, + // Codec supports referencing B-pictures. + FF_HW_FLAG_B_PICTURE_REFERENCES = 1 << 4, + // Codec supports non-IDR key pictures (that is, key pictures do + // not necessarily empty the DPB). + FF_HW_FLAG_NON_IDR_KEY_PICTURES = 1 << 5, +}; + +typedef struct FFHWBaseEncodePicture { + // API-specific private data + void *priv; + // Codec-specific private data + void *codec_priv; + + struct FFHWBaseEncodePicture *next; + + int64_t display_order; + int64_t encode_order; + int64_t pts; + int64_t duration; + int force_idr; + + void *opaque; + AVBufferRef *opaque_ref; + + int type; + int b_depth; + int encode_issued; + int encode_complete; + + AVFrame *input_image; + AVFrame *recon_image; + + // Whether this picture is a reference picture. + int is_reference; + + // The contents of the DPB after this picture has been decoded. + // This will contain the picture itself if it is a reference picture, + // but not if it isn't. + int nb_dpb_pics; + struct FFHWBaseEncodePicture *dpb[MAX_DPB_SIZE]; + // The reference pictures used in decoding this picture. If they are + // used by later pictures they will also appear in the DPB. ref[0][] for + // previous reference frames. ref[1][] for future reference frames. + int nb_refs[MAX_REFERENCE_LIST_NUM]; + struct FFHWBaseEncodePicture *refs[MAX_REFERENCE_LIST_NUM][MAX_PICTURE_REFERENCES]; + // The previous reference picture in encode order. Must be in at least + // one of the reference list and DPB list. + struct FFHWBaseEncodePicture *prev; + // Reference count for other pictures referring to this one through + // the above pointers, directly from incomplete pictures and indirectly + // through completed pictures. + int ref_count[2]; + int ref_removed[2]; +} FFHWBaseEncodePicture; + +typedef struct FFHWEncodePictureOperation { + // Size of API-specific internal picture data + size_t priv_size; + // Initialize API-specific internals + int (*init)(AVCodecContext *avctx, FFHWBaseEncodePicture *pic); + // Issue the picture structure, which will send the frame surface to HW Encode API. + int (*issue)(AVCodecContext *avctx, FFHWBaseEncodePicture *pic); + // Get the output AVPacket. + int (*output)(AVCodecContext *avctx, FFHWBaseEncodePicture *pic, AVPacket *pkt); + // Free the picture structure. + int (*free)(AVCodecContext *avctx, FFHWBaseEncodePicture *pic); +} FFHWEncodePictureOperation; + +typedef struct FFHWBaseEncodeContext { + const AVClass *class; + void *log_ctx; + + // Hardware-specific hooks. + const struct FFHWEncodePictureOperation *op; + + // Global options. + + // Number of I frames between IDR frames. + int idr_interval; + + // Desired B frame reference depth. + int desired_b_depth; + + // The required size of surfaces. This is probably the input + // size (AVCodecContext.width|height) aligned up to whatever + // block size is required by the codec. + int surface_width; + int surface_height; + + // The block size for slice calculations. + int slice_block_width; + int slice_block_height; + + // The hardware device context. + AVBufferRef *device_ref; + AVHWDeviceContext *device; + + // The hardware frame context containing the input frames. + AVBufferRef *input_frames_ref; + AVHWFramesContext *input_frames; + + // The hardware frame context containing the reconstructed frames. + AVBufferRef *recon_frames_ref; + AVHWFramesContext *recon_frames; + + // Current encoding window, in display (input) order. + FFHWBaseEncodePicture *pic_start, *pic_end; + // The next picture to use as the previous reference picture in + // encoding order. Order from small to large in encoding order. + FFHWBaseEncodePicture *next_prev[MAX_PICTURE_REFERENCES]; + int nb_next_prev; + + // Next input order index (display order). + int64_t input_order; + // Number of frames that output is behind input. + int64_t output_delay; + // Next encode order index. + int64_t encode_order; + // Number of frames decode output will need to be delayed. + int64_t decode_delay; + // Next output order index (in encode order). + int64_t output_order; + + // Timestamp handling. + int64_t first_pts; + int64_t dts_pts_diff; + int64_t ts_ring[MAX_REORDER_DELAY * 3 + + MAX_ASYNC_DEPTH]; + + // Frame type decision. + int gop_size; + int closed_gop; + int gop_per_idr; + int p_per_i; + int max_b_depth; + int b_per_p; + int force_idr; + int idr_counter; + int gop_counter; + int end_of_stream; + int p_to_gpb; + + // Whether the driver supports ROI at all. + int roi_allowed; + + // The encoder does not support cropping information, so warn about + // it the first time we encounter any nonzero crop fields. + int crop_warned; + // If the driver does not support ROI then warn the first time we + // encounter a frame with ROI side data. + int roi_warned; + + // The frame to be filled with data. + AVFrame *frame; + + // Whether the HW supports sync buffer function. + // If supported, encode_fifo/async_depth will be used together. + // Used for output buffer synchronization. + int async_encode; + + // Store buffered pic. + AVFifo *encode_fifo; + // Max number of frame buffered in encoder. + int async_depth; + + /** Tail data of a pic, now only used for av1 repeat frame header. */ + AVPacket *tail_pkt; +} FFHWBaseEncodeContext; + +int ff_hw_base_encode_set_output_property(FFHWBaseEncodeContext *ctx, AVCodecContext *avctx, + FFHWBaseEncodePicture *pic, AVPacket *pkt, int flag_no_delay); + +int ff_hw_base_encode_receive_packet(FFHWBaseEncodeContext *ctx, AVCodecContext *avctx, AVPacket *pkt); + +int ff_hw_base_init_gop_structure(FFHWBaseEncodeContext *ctx, AVCodecContext *avctx, + uint32_t ref_l0, uint32_t ref_l1, + int flags, int prediction_pre_only); + +int ff_hw_base_get_recon_format(FFHWBaseEncodeContext *ctx, const void *hwconfig, + enum AVPixelFormat *fmt); + +int ff_hw_base_encode_init(AVCodecContext *avctx, FFHWBaseEncodeContext *ctx); + +int ff_hw_base_encode_close(FFHWBaseEncodeContext *ctx); + +#define HW_BASE_ENCODE_COMMON_OPTIONS \ + { "idr_interval", \ + "Distance (in I-frames) between key frames", \ + OFFSET(common.base.idr_interval), AV_OPT_TYPE_INT, \ + { .i64 = 0 }, 0, INT_MAX, FLAGS }, \ + { "b_depth", \ + "Maximum B-frame reference depth", \ + OFFSET(common.base.desired_b_depth), AV_OPT_TYPE_INT, \ + { .i64 = 1 }, 1, INT_MAX, FLAGS }, \ + { "async_depth", "Maximum processing parallelism. " \ + "Increase this to improve single channel performance.", \ + OFFSET(common.base.async_depth), AV_OPT_TYPE_INT, \ + { .i64 = 2 }, 1, MAX_ASYNC_DEPTH, FLAGS } + +#endif /* AVCODEC_HW_BASE_ENCODE_H */ diff --git a/include/libavcodec/hw_base_encode_h264.h b/include/libavcodec/hw_base_encode_h264.h new file mode 100644 index 0000000..9bc6ad6 --- /dev/null +++ b/include/libavcodec/hw_base_encode_h264.h @@ -0,0 +1,52 @@ +/* + * 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_HW_BASE_ENCODE_H264_H +#define AVCODEC_HW_BASE_ENCODE_H264_H + +#include "hw_base_encode.h" +#include "cbs_h264.h" + +typedef struct FFHWBaseEncodeH264 { + H264RawSPS raw_sps; + H264RawPPS raw_pps; + + H264RawSEIBufferingPeriod sei_buffering_period; + + int dpb_frames; +} FFHWBaseEncodeH264; + +typedef struct FFHWBaseEncodeH264Opts { + int flags; +#define FF_HW_H264_SEI_TIMING (1 << 0) + + int mb_width; + int mb_height; + int64_t bit_rate; + int cabac; + int fixed_qp_idr; + uint64_t hrd_buffer_size; + uint64_t initial_buffer_fullness; +} FFHWBaseEncodeH264Opts; + +int ff_hw_base_encode_init_params_h264(FFHWBaseEncodeContext *base_ctx, + AVCodecContext *avctx, + FFHWBaseEncodeH264 *common, + FFHWBaseEncodeH264Opts *opts); + +#endif /* AVCODEC_HW_BASE_ENCODE_H264_H */ diff --git a/include/libavcodec/hw_base_encode_h265.h b/include/libavcodec/hw_base_encode_h265.h new file mode 100644 index 0000000..468f91c --- /dev/null +++ b/include/libavcodec/hw_base_encode_h265.h @@ -0,0 +1,56 @@ +/* + * 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_HW_BASE_ENCODE_H265_H +#define AVCODEC_HW_BASE_ENCODE_H265_H + +#include "hw_base_encode.h" +#include "cbs_h265.h" + +typedef struct FFHWBaseEncodeH265 { + H265RawVPS raw_vps; + H265RawSPS raw_sps; + H265RawPPS raw_pps; + + int dpb_frames; +} FFHWBaseEncodeH265; + +typedef struct FFHWBaseEncodeH265Opts { + int tier; + int fixed_qp_idr; + int cu_qp_delta_enabled_flag; + + int tile_rows; + int tile_cols; + + int nb_slices; + int slice_block_rows; + int slice_block_cols; + + // Tile width of the i-th column. + int col_width[22]; + // Tile height of i-th row. + int row_height[22]; +} FFHWBaseEncodeH265Opts; + +int ff_hw_base_encode_init_params_h265(FFHWBaseEncodeContext *base_ctx, + AVCodecContext *avctx, + FFHWBaseEncodeH265 *common, + FFHWBaseEncodeH265Opts *opts); + +#endif /* AVCODEC_HW_BASE_ENCODE_H265_H */ diff --git a/include/libavcodec/hwaccel_internal.h b/include/libavcodec/hwaccel_internal.h new file mode 100644 index 0000000..b0cc22b --- /dev/null +++ b/include/libavcodec/hwaccel_internal.h @@ -0,0 +1,180 @@ +/* + * 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 + */ + +/** + * Header providing the internals of AVHWAccel. + */ + +#ifndef AVCODEC_HWACCEL_INTERNAL_H +#define AVCODEC_HWACCEL_INTERNAL_H + +#include + +#include "avcodec.h" +#include "refstruct.h" + +#define HWACCEL_CAP_ASYNC_SAFE (1 << 0) +#define HWACCEL_CAP_THREAD_SAFE (1 << 1) + +typedef struct FFHWAccel { + /** + * The public AVHWAccel. See avcodec.h for it. + */ + AVHWAccel p; + + /** + * Allocate a custom buffer + */ + int (*alloc_frame)(AVCodecContext *avctx, AVFrame *frame); + + /** + * Called at the beginning of each frame or field picture. + * + * Meaningful frame information (codec specific) is guaranteed to + * be parsed at this point. This function is mandatory. + * + * Note that buf can be NULL along with buf_size set to 0. + * Otherwise, this means the whole frame is available at this point. + * + * @param avctx the codec context + * @param buf the frame data buffer base + * @param buf_size the size of the frame in bytes + * @return zero if successful, a negative value otherwise + */ + int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); + + /** + * Callback for parameter data (SPS/PPS/VPS etc). + * + * Useful for hardware decoders which keep persistent state about the + * video parameters, and need to receive any changes to update that state. + * + * @param avctx the codec context + * @param type the nal unit type + * @param buf the nal unit data buffer + * @param buf_size the size of the nal unit in bytes + * @return zero if successful, a negative value otherwise + */ + int (*decode_params)(AVCodecContext *avctx, int type, const uint8_t *buf, uint32_t buf_size); + + /** + * Callback for each slice. + * + * Meaningful slice information (codec specific) is guaranteed to + * be parsed at this point. This function is mandatory. + * + * @param avctx the codec context + * @param buf the slice data buffer base + * @param buf_size the size of the slice in bytes + * @return zero if successful, a negative value otherwise + */ + int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); + + /** + * Called at the end of each frame or field picture. + * + * The whole picture is parsed at this point and can now be sent + * to the hardware accelerator. This function is mandatory. + * + * @param avctx the codec context + * @return zero if successful, a negative value otherwise + */ + int (*end_frame)(AVCodecContext *avctx); + + /** + * Size of per-frame hardware accelerator private data. + * + * Private data is allocated with av_mallocz() before + * AVCodecContext.get_buffer() and deallocated after + * AVCodecContext.release_buffer(). + */ + int frame_priv_data_size; + + /** + * Size of the private data to allocate in + * AVCodecInternal.hwaccel_priv_data. + */ + int priv_data_size; + + /** + * Internal hwaccel capabilities. + */ + int caps_internal; + + /** + * Initialize the hwaccel private data. + * + * This will be called from ff_get_format(), after hwaccel and + * hwaccel_context are set and the hwaccel private data in AVCodecInternal + * is allocated. + */ + int (*init)(AVCodecContext *avctx); + + /** + * Uninitialize the hwaccel private data. + * + * This will be called from get_format() or ff_codec_close(), after hwaccel + * and hwaccel_context are already uninitialized. + */ + int (*uninit)(AVCodecContext *avctx); + + /** + * Fill the given hw_frames context with current codec parameters. Called + * from get_format. Refer to avcodec_get_hw_frames_parameters() for + * details. + * + * This CAN be called before AVHWAccel.init is called, and you must assume + * that avctx->hwaccel_priv_data is invalid. + */ + int (*frame_params)(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx); + + /** + * Copy necessary context variables from a previous thread context to the current one. + * For thread-safe hwaccels only. + */ + int (*update_thread_context)(AVCodecContext *dst, const AVCodecContext *src); + + /** + * Callback to free the hwaccel-specific frame data. + * + * @param hwctx a pointer to an AVHWDeviceContext. + * @param data the per-frame hardware accelerator private data to be freed. + */ + void (*free_frame_priv)(FFRefStructOpaque hwctx, void *data); + + /** + * Callback to flush the hwaccel state. + */ + void (*flush)(AVCodecContext *avctx); +} FFHWAccel; + +static inline const FFHWAccel *ffhwaccel(const AVHWAccel *codec) +{ + return (const FFHWAccel*)codec; +} + +#define FF_HW_CALL(avctx, function, ...) \ + (ffhwaccel((avctx)->hwaccel)->function((avctx), __VA_ARGS__)) + +#define FF_HW_SIMPLE_CALL(avctx, function) \ + (ffhwaccel((avctx)->hwaccel)->function(avctx)) + +#define FF_HW_HAS_CB(avctx, function) \ + ((avctx)->hwaccel && ffhwaccel((avctx)->hwaccel)->function) + +#endif /* AVCODEC_HWACCEL_INTERNAL */ diff --git a/include/libavcodec/hwaccels.h b/include/libavcodec/hwaccels.h new file mode 100644 index 0000000..5171e4c --- /dev/null +++ b/include/libavcodec/hwaccels.h @@ -0,0 +1,93 @@ +/* + * 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_HWACCELS_H +#define AVCODEC_HWACCELS_H + +extern const struct FFHWAccel ff_av1_d3d11va_hwaccel; +extern const struct FFHWAccel ff_av1_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_av1_d3d12va_hwaccel; +extern const struct FFHWAccel ff_av1_dxva2_hwaccel; +extern const struct FFHWAccel ff_av1_nvdec_hwaccel; +extern const struct FFHWAccel ff_av1_vaapi_hwaccel; +extern const struct FFHWAccel ff_av1_vdpau_hwaccel; +extern const struct FFHWAccel ff_av1_vulkan_hwaccel; +extern const struct FFHWAccel ff_h263_vaapi_hwaccel; +extern const struct FFHWAccel ff_h263_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_h264_d3d11va_hwaccel; +extern const struct FFHWAccel ff_h264_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_h264_d3d12va_hwaccel; +extern const struct FFHWAccel ff_h264_dxva2_hwaccel; +extern const struct FFHWAccel ff_h264_nvdec_hwaccel; +extern const struct FFHWAccel ff_h264_vaapi_hwaccel; +extern const struct FFHWAccel ff_h264_vdpau_hwaccel; +extern const struct FFHWAccel ff_h264_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_h264_vulkan_hwaccel; +extern const struct FFHWAccel ff_hevc_d3d11va_hwaccel; +extern const struct FFHWAccel ff_hevc_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_hevc_d3d12va_hwaccel; +extern const struct FFHWAccel ff_hevc_dxva2_hwaccel; +extern const struct FFHWAccel ff_hevc_nvdec_hwaccel; +extern const struct FFHWAccel ff_hevc_vaapi_hwaccel; +extern const struct FFHWAccel ff_hevc_vdpau_hwaccel; +extern const struct FFHWAccel ff_hevc_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_hevc_vulkan_hwaccel; +extern const struct FFHWAccel ff_mjpeg_nvdec_hwaccel; +extern const struct FFHWAccel ff_mjpeg_vaapi_hwaccel; +extern const struct FFHWAccel ff_mpeg1_nvdec_hwaccel; +extern const struct FFHWAccel ff_mpeg1_vdpau_hwaccel; +extern const struct FFHWAccel ff_mpeg1_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_mpeg2_d3d11va_hwaccel; +extern const struct FFHWAccel ff_mpeg2_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_mpeg2_d3d12va_hwaccel; +extern const struct FFHWAccel ff_mpeg2_dxva2_hwaccel; +extern const struct FFHWAccel ff_mpeg2_nvdec_hwaccel; +extern const struct FFHWAccel ff_mpeg2_vaapi_hwaccel; +extern const struct FFHWAccel ff_mpeg2_vdpau_hwaccel; +extern const struct FFHWAccel ff_mpeg2_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_mpeg4_nvdec_hwaccel; +extern const struct FFHWAccel ff_mpeg4_vaapi_hwaccel; +extern const struct FFHWAccel ff_mpeg4_vdpau_hwaccel; +extern const struct FFHWAccel ff_mpeg4_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_prores_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_vc1_d3d11va_hwaccel; +extern const struct FFHWAccel ff_vc1_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_vc1_d3d12va_hwaccel; +extern const struct FFHWAccel ff_vc1_dxva2_hwaccel; +extern const struct FFHWAccel ff_vc1_nvdec_hwaccel; +extern const struct FFHWAccel ff_vc1_vaapi_hwaccel; +extern const struct FFHWAccel ff_vc1_vdpau_hwaccel; +extern const struct FFHWAccel ff_vp8_nvdec_hwaccel; +extern const struct FFHWAccel ff_vp8_vaapi_hwaccel; +extern const struct FFHWAccel ff_vp9_d3d11va_hwaccel; +extern const struct FFHWAccel ff_vp9_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_vp9_d3d12va_hwaccel; +extern const struct FFHWAccel ff_vp9_dxva2_hwaccel; +extern const struct FFHWAccel ff_vp9_nvdec_hwaccel; +extern const struct FFHWAccel ff_vp9_vaapi_hwaccel; +extern const struct FFHWAccel ff_vp9_vdpau_hwaccel; +extern const struct FFHWAccel ff_vp9_videotoolbox_hwaccel; +extern const struct FFHWAccel ff_wmv3_d3d11va_hwaccel; +extern const struct FFHWAccel ff_wmv3_d3d11va2_hwaccel; +extern const struct FFHWAccel ff_wmv3_d3d12va_hwaccel; +extern const struct FFHWAccel ff_wmv3_dxva2_hwaccel; +extern const struct FFHWAccel ff_wmv3_nvdec_hwaccel; +extern const struct FFHWAccel ff_wmv3_vaapi_hwaccel; +extern const struct FFHWAccel ff_wmv3_vdpau_hwaccel; + +#endif /* AVCODEC_HWACCELS_H */ diff --git a/include/libavcodec/hwconfig.h b/include/libavcodec/hwconfig.h new file mode 100644 index 0000000..ee29ca6 --- /dev/null +++ b/include/libavcodec/hwconfig.h @@ -0,0 +1,101 @@ +/* + * 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_HWCONFIG_H +#define AVCODEC_HWCONFIG_H + +#include "avcodec.h" +#include "hwaccels.h" + +typedef struct AVCodecHWConfigInternal { + /** + * This is the structure which will be returned to the user by + * avcodec_get_hw_config(). + */ + AVCodecHWConfig public; + /** + * If this configuration uses a hwaccel, a pointer to it. + * If not, NULL. + */ + const struct FFHWAccel *hwaccel; +} AVCodecHWConfigInternal; + +void ff_hwaccel_uninit(AVCodecContext *avctx); + +// These macros are used to simplify AVCodecHWConfigInternal definitions. + +#define HW_CONFIG_HWACCEL(device, frames, ad_hoc, format, device_type_, name) \ + &(const AVCodecHWConfigInternal) { \ + .public = { \ + .pix_fmt = AV_PIX_FMT_ ## format, \ + .methods = (device ? AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX : 0) | \ + (frames ? AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX : 0) | \ + (ad_hoc ? AV_CODEC_HW_CONFIG_METHOD_AD_HOC : 0), \ + .device_type = AV_HWDEVICE_TYPE_ ## device_type_, \ + }, \ + .hwaccel = &name, \ + } + +#define HW_CONFIG_INTERNAL(format) \ + &(const AVCodecHWConfigInternal) { \ + .public = { \ + .pix_fmt = AV_PIX_FMT_ ## format, \ + .methods = AV_CODEC_HW_CONFIG_METHOD_INTERNAL, \ + .device_type = AV_HWDEVICE_TYPE_NONE, \ + }, \ + .hwaccel = NULL, \ + } + +#define HWACCEL_DXVA2(codec) \ + HW_CONFIG_HWACCEL(1, 1, 1, DXVA2_VLD, DXVA2, ff_ ## codec ## _dxva2_hwaccel) +#define HWACCEL_D3D11VA2(codec) \ + HW_CONFIG_HWACCEL(1, 1, 0, D3D11, D3D11VA, ff_ ## codec ## _d3d11va2_hwaccel) +#define HWACCEL_NVDEC(codec) \ + HW_CONFIG_HWACCEL(1, 1, 0, CUDA, CUDA, ff_ ## codec ## _nvdec_hwaccel) +#define HWACCEL_VAAPI(codec) \ + HW_CONFIG_HWACCEL(1, 1, 1, VAAPI, VAAPI, ff_ ## codec ## _vaapi_hwaccel) +#define HWACCEL_VDPAU(codec) \ + HW_CONFIG_HWACCEL(1, 1, 1, VDPAU, VDPAU, ff_ ## codec ## _vdpau_hwaccel) +#define HWACCEL_VIDEOTOOLBOX(codec) \ + HW_CONFIG_HWACCEL(1, 1, 1, VIDEOTOOLBOX, VIDEOTOOLBOX, ff_ ## codec ## _videotoolbox_hwaccel) +#define HWACCEL_VULKAN(codec) \ + HW_CONFIG_HWACCEL(1, 1, 1, VULKAN, VULKAN, ff_ ## codec ## _vulkan_hwaccel) +#define HWACCEL_D3D11VA(codec) \ + HW_CONFIG_HWACCEL(0, 0, 1, D3D11VA_VLD, NONE, ff_ ## codec ## _d3d11va_hwaccel) +#define HWACCEL_D3D12VA(codec) \ + HW_CONFIG_HWACCEL(1, 1, 0, D3D12, D3D12VA, ff_ ## codec ## _d3d12va_hwaccel) + +#define HW_CONFIG_ENCODER(device, frames, ad_hoc, format, device_type_) \ + &(const AVCodecHWConfigInternal) { \ + .public = { \ + .pix_fmt = AV_PIX_FMT_ ## format, \ + .methods = (device ? AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX : 0) | \ + (frames ? AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX : 0) | \ + (ad_hoc ? AV_CODEC_HW_CONFIG_METHOD_AD_HOC : 0), \ + .device_type = AV_HWDEVICE_TYPE_ ## device_type_, \ + }, \ + .hwaccel = NULL, \ + } + +#define HW_CONFIG_ENCODER_DEVICE(format, device_type_) \ + HW_CONFIG_ENCODER(1, 0, 0, format, device_type_) + +#define HW_CONFIG_ENCODER_FRAMES(format, device_type_) \ + HW_CONFIG_ENCODER(0, 1, 0, format, device_type_) + +#endif /* AVCODEC_HWCONFIG_H */ diff --git a/include/libavcodec/idctdsp.h b/include/libavcodec/idctdsp.h new file mode 100644 index 0000000..c082428 --- /dev/null +++ b/include/libavcodec/idctdsp.h @@ -0,0 +1,116 @@ +/* + * 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_IDCTDSP_H +#define AVCODEC_IDCTDSP_H + +#include +#include + +struct AVCodecContext; + +enum idct_permutation_type { + FF_IDCT_PERM_NONE, + FF_IDCT_PERM_LIBMPEG2, + FF_IDCT_PERM_SIMPLE, + FF_IDCT_PERM_TRANSPOSE, + FF_IDCT_PERM_PARTTRANS, + FF_IDCT_PERM_SSE2, +}; + +void ff_permute_scantable(uint8_t dst[64], const uint8_t src[64], + const uint8_t permutation[64]); +void ff_init_scantable_permutation(uint8_t *idct_permutation, + enum idct_permutation_type perm_type); +int ff_init_scantable_permutation_x86(uint8_t *idct_permutation, + enum idct_permutation_type perm_type); + +typedef struct IDCTDSPContext { + /* pixel ops : interface with DCT */ + void (*put_pixels_clamped)(const int16_t *block /* align 16 */, + uint8_t *restrict pixels /* align 8 */, + ptrdiff_t line_size); + void (*put_signed_pixels_clamped)(const int16_t *block /* align 16 */, + uint8_t *restrict pixels /* align 8 */, + ptrdiff_t line_size); + void (*add_pixels_clamped)(const int16_t *block /* align 16 */, + uint8_t *restrict pixels /* align 8 */, + ptrdiff_t line_size); + + void (*idct)(int16_t *block /* align 16 */); + + /** + * block -> idct -> clip to unsigned 8 bit -> dest. + * (-1392, 0, 0, ...) -> idct -> (-174, -174, ...) -> put -> (0, 0, ...) + * @param line_size size in bytes of a horizontal line of dest + */ + void (*idct_put)(uint8_t *dest /* align 8 */, + ptrdiff_t line_size, int16_t *block /* align 16 */); + + /** + * block -> idct -> add dest -> clip to unsigned 8 bit -> dest. + * @param line_size size in bytes of a horizontal line of dest + */ + void (*idct_add)(uint8_t *dest /* align 8 */, + ptrdiff_t line_size, int16_t *block /* align 16 */); + + /** + * IDCT input permutation. + * Several optimized IDCTs need a permutated input (relative to the + * normal order of the reference IDCT). + * This permutation must be performed before the idct_put/add. + * Note, normally this can be merged with the zigzag/alternate scan
+ * An example to avoid confusion: + * - (->decode coeffs -> zigzag reorder -> dequant -> reference IDCT -> ...) + * - (x -> reference DCT -> reference IDCT -> x) + * - (x -> reference DCT -> simple_mmx_perm = idct_permutation + * -> simple_idct_mmx -> x) + * - (-> decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant + * -> simple_idct_mmx -> ...) + */ + uint8_t idct_permutation[64]; + enum idct_permutation_type perm_type; + + int mpeg4_studio_profile; +} IDCTDSPContext; + +void ff_put_pixels_clamped_c(const int16_t *block, uint8_t *restrict pixels, + ptrdiff_t line_size); +void ff_add_pixels_clamped_c(const int16_t *block, uint8_t *restrict pixels, + ptrdiff_t line_size); + +void ff_idctdsp_init(IDCTDSPContext *c, struct AVCodecContext *avctx); + +void ff_idctdsp_init_aarch64(IDCTDSPContext *c, struct AVCodecContext *avctx, + unsigned high_bit_depth); +void ff_idctdsp_init_alpha(IDCTDSPContext *c, struct AVCodecContext *avctx, + unsigned high_bit_depth); +void ff_idctdsp_init_arm(IDCTDSPContext *c, struct AVCodecContext *avctx, + unsigned high_bit_depth); +void ff_idctdsp_init_ppc(IDCTDSPContext *c, struct AVCodecContext *avctx, + unsigned high_bit_depth); +void ff_idctdsp_init_riscv(IDCTDSPContext *c, struct AVCodecContext *avctx, + unsigned high_bit_depth); +void ff_idctdsp_init_x86(IDCTDSPContext *c, struct AVCodecContext *avctx, + unsigned high_bit_depth); +void ff_idctdsp_init_mips(IDCTDSPContext *c, struct AVCodecContext *avctx, + unsigned high_bit_depth); +void ff_idctdsp_init_loongarch(IDCTDSPContext *c, struct AVCodecContext *avctx, + unsigned high_bit_depth); + +#endif /* AVCODEC_IDCTDSP_H */ diff --git a/include/libavcodec/iirfilter.h b/include/libavcodec/iirfilter.h new file mode 100644 index 0000000..8ab8ae6 --- /dev/null +++ b/include/libavcodec/iirfilter.h @@ -0,0 +1,116 @@ +/* + * IIR filter + * Copyright (c) 2008 Konstantin Shishkov + * + * 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 + */ + +/** + * @file + * IIR filter interface + */ + +#ifndef AVCODEC_IIRFILTER_H +#define AVCODEC_IIRFILTER_H + +#include + +struct FFIIRFilterCoeffs; +struct FFIIRFilterState; + +enum IIRFilterType{ + FF_FILTER_TYPE_BESSEL, + FF_FILTER_TYPE_BIQUAD, + FF_FILTER_TYPE_BUTTERWORTH, + FF_FILTER_TYPE_CHEBYSHEV, + FF_FILTER_TYPE_ELLIPTIC, +}; + +enum IIRFilterMode{ + FF_FILTER_MODE_LOWPASS, + FF_FILTER_MODE_HIGHPASS, + FF_FILTER_MODE_BANDPASS, + FF_FILTER_MODE_BANDSTOP, +}; + +typedef struct FFIIRFilterContext { + /** + * Perform IIR filtering on floating-point input samples. + * + * @param coeffs pointer to filter coefficients + * @param state pointer to filter state + * @param size input length + * @param src source samples + * @param sstep source stride + * @param dst filtered samples (destination may be the same as input) + * @param dstep destination stride + */ + void (*filter_flt)(const struct FFIIRFilterCoeffs *coeffs, + struct FFIIRFilterState *state, int size, + const float *src, ptrdiff_t sstep, float *dst, ptrdiff_t dstep); +} FFIIRFilterContext; + +/** + * Initialize FFIIRFilterContext + */ +void ff_iir_filter_init(FFIIRFilterContext *f); +void ff_iir_filter_init_mips(FFIIRFilterContext *f); + +/** + * Initialize filter coefficients. + * + * @param avc a pointer to an arbitrary struct of which the first + * field is a pointer to an AVClass struct + * @param filt_type filter type (e.g. Butterworth) + * @param filt_mode filter mode (e.g. lowpass) + * @param order filter order + * @param cutoff_ratio cutoff to input frequency ratio + * @param stopband stopband to input frequency ratio (used by bandpass and bandstop filter modes) + * @param ripple ripple factor (used only in Chebyshev filters) + * + * @return pointer to filter coefficients structure or NULL if filter cannot be created + */ +struct FFIIRFilterCoeffs* ff_iir_filter_init_coeffs(void *avc, + enum IIRFilterType filt_type, + enum IIRFilterMode filt_mode, + int order, float cutoff_ratio, + float stopband, float ripple); + +/** + * Create new filter state. + * + * @param order filter order + * + * @return pointer to new filter state or NULL if state creation fails + */ +struct FFIIRFilterState* ff_iir_filter_init_state(int order); + +/** + * Free filter coefficients. + * + * @param coeffs pointer allocated with ff_iir_filter_init_coeffs() + */ +void ff_iir_filter_free_coeffsp(struct FFIIRFilterCoeffs **coeffs); + +/** + * Free and zero filter state. + * + * @param state pointer to pointer allocated with ff_iir_filter_init_state() + */ +void ff_iir_filter_free_statep(struct FFIIRFilterState **state); + +#endif /* AVCODEC_IIRFILTER_H */ diff --git a/include/libavcodec/ilbcdata.h b/include/libavcodec/ilbcdata.h new file mode 100644 index 0000000..b17e24d --- /dev/null +++ b/include/libavcodec/ilbcdata.h @@ -0,0 +1,239 @@ +/* + * Copyright (c) 2013, The WebRTC project authors. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * * Neither the name of Google nor the names of its contributors may + * be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef AVCODEC_ILBCDATA_H +#define AVCODEC_ILBCDATA_H + +#include "libavutil/common.h" + +static const uint8_t lsf_dim_codebook[] = { 3, 3, 4 }; +static const uint8_t lsf_size_codebook[] = { 64, 128, 128 }; +static const int16_t lsf_weight_20ms[] = { 12288, 8192, 4096, 0 }; +static const int16_t lsf_weight_30ms[] = { 8192, 16384, 10923, 5461, 0, 0 }; + +static const int16_t hp_out_coeffs[] = { 3849, -7699, 3849, 7918, -3833 }; + +static const int16_t kPlcPfSlope[] = { 26667, 18729, 13653, 10258, 7901, 6214 }; + +static const int16_t kPlcPitchFact[] = { 0, 5462, 10922, 16384, 21846, 27306 }; + +static const int16_t kCbFiltersRev[] = { + -140, 446, -755, 3302, 2922, -590, 343, -138 +}; + +static const int16_t kPlcPerSqr[] = { 839, 1343, 2048, 2998, 4247, 5849 }; + +static const int16_t alpha[] = { + 6554, 13107, 19661, 26214 +}; + +static const int16_t kLpcChirpSyntDenum[] = { + 32767, 29573, 26690, 24087, 21739, 19619, 17707, 15980, 14422, 13016, 11747 +}; + +static const int16_t cos_tbl[64] = { + 32767, 32729, 32610, 32413, 32138, 31786, 31357, 30853, + 30274, 29622, 28899, 28106, 27246, 26320, 25330, 24279, + 23170, 22006, 20788, 19520, 18205, 16846, 15447, 14010, + 12540, 11039, 9512, 7962, 6393, 4808, 3212, 1608, + 0, -1608, -3212, -4808, -6393, -7962, -9512, -11039, + -12540, -14010, -15447, -16846, -18205, -19520, -20788, -22006, + -23170, -24279, -25330, -26320, -27246, -28106, -28899, -29622, + -30274, -30853, -31357, -31786, -32138, -32413, -32610, -32729, +}; + +static const int16_t cos_derivative_tbl[64] = { + -632, -1893, -3150, -4399, -5638, -6863, -8072, -9261, + -10428, -11570, -12684, -13767, -14817, -15832, -16808, -17744, + -18637, -19486, -20287, -21039, -21741, -22390, -22986, -23526, + -24009, -24435, -24801, -25108, -25354, -25540, -25664, -25726, + -25726, -25664, -25540, -25354, -25108, -24801, -24435, -24009, + -23526, -22986, -22390, -21741, -21039, -20287, -19486, -18637, + -17744, -16808, -15832, -14817, -13767, -12684, -11570, -10428, + -9261, -8072, -6863, -5638, -4399, -3150, -1893, -632 +}; + +static const int16_t lsf_codebook[64 * 3 + 128 * 3 + 128 * 4] = { + 1273, 2238, 3696, 3199, 5309, 8209, 3606, 5671, 7829, + 2815, 5262, 8778, 2608, 4027, 5493, 1582, 3076, 5945, + 2983, 4181, 5396, 2437, 4322, 6902, 1861, 2998, 4613, + 2007, 3250, 5214, 1388, 2459, 4262, 2563, 3805, 5269, + 2036, 3522, 5129, 1935, 4025, 6694, 2744, 5121, 7338, + 2810, 4248, 5723, 3054, 5405, 7745, 1449, 2593, 4763, + 3411, 5128, 6596, 2484, 4659, 7496, 1668, 2879, 4818, + 1812, 3072, 5036, 1638, 2649, 3900, 2464, 3550, 4644, + 1853, 2900, 4158, 2458, 4163, 5830, 2556, 4036, 6254, + 2703, 4432, 6519, 3062, 4953, 7609, 1725, 3703, 6187, + 2221, 3877, 5427, 2339, 3579, 5197, 2021, 4633, 7037, + 2216, 3328, 4535, 2961, 4739, 6667, 2807, 3955, 5099, + 2788, 4501, 6088, 1642, 2755, 4431, 3341, 5282, 7333, + 2414, 3726, 5727, 1582, 2822, 5269, 2259, 3447, 4905, + 3117, 4986, 7054, 1825, 3491, 5542, 3338, 5736, 8627, + 1789, 3090, 5488, 2566, 3720, 4923, 2846, 4682, 7161, + 1950, 3321, 5976, 1834, 3383, 6734, 3238, 4769, 6094, + 2031, 3978, 5903, 1877, 4068, 7436, 2131, 4644, 8296, + 2764, 5010, 8013, 2194, 3667, 6302, 2053, 3127, 4342, + 3523, 6595, 10010, 3134, 4457, 5748, 3142, 5819, 9414, + 2223, 4334, 6353, 2022, 3224, 4822, 2186, 3458, 5544, + 2552, 4757, 6870, 10905, 12917, 14578, 9503, 11485, 14485, + 9518, 12494, 14052, 6222, 7487, 9174, 7759, 9186, 10506, + 8315, 12755, 14786, 9609, 11486, 13866, 8909, 12077, 13643, + 7369, 9054, 11520, 9408, 12163, 14715, 6436, 9911, 12843, + 7109, 9556, 11884, 7557, 10075, 11640, 6482, 9202, 11547, + 6463, 7914, 10980, 8611, 10427, 12752, 7101, 9676, 12606, + 7428, 11252, 13172, 10197, 12955, 15842, 7487, 10955, 12613, + 5575, 7858, 13621, 7268, 11719, 14752, 7476, 11744, 13795, + 7049, 8686, 11922, 8234, 11314, 13983, 6560, 11173, 14984, + 6405, 9211, 12337, 8222, 12054, 13801, 8039, 10728, 13255, + 10066, 12733, 14389, 6016, 7338, 10040, 6896, 8648, 10234, + 7538, 9170, 12175, 7327, 12608, 14983, 10516, 12643, 15223, + 5538, 7644, 12213, 6728, 12221, 14253, 7563, 9377, 12948, + 8661, 11023, 13401, 7280, 8806, 11085, 7723, 9793, 12333, + 12225, 14648, 16709, 8768, 13389, 15245, 10267, 12197, 13812, + 5301, 7078, 11484, 7100, 10280, 11906, 8716, 12555, 14183, + 9567, 12464, 15434, 7832, 12305, 14300, 7608, 10556, 12121, + 8913, 11311, 12868, 7414, 9722, 11239, 8666, 11641, 13250, + 9079, 10752, 12300, 8024, 11608, 13306, 10453, 13607, 16449, + 8135, 9573, 10909, 6375, 7741, 10125, 10025, 12217, 14874, + 6985, 11063, 14109, 9296, 13051, 14642, 8613, 10975, 12542, + 6583, 10414, 13534, 6191, 9368, 13430, 5742, 6859, 9260, + 7723, 9813, 13679, 8137, 11291, 12833, 6562, 8973, 10641, + 6062, 8462, 11335, 6928, 8784, 12647, 7501, 8784, 10031, + 8372, 10045, 12135, 8191, 9864, 12746, 5917, 7487, 10979, + 5516, 6848, 10318, 6819, 9899, 11421, 7882, 12912, 15670, + 9558, 11230, 12753, 7752, 9327, 11472, 8479, 9980, 11358, + 11418, 14072, 16386, 7968, 10330, 14423, 8423, 10555, 12162, + 6337, 10306, 14391, 8850, 10879, 14276, 6750, 11885, 15710, + 7037, 8328, 9764, 6914, 9266, 13476, 9746, 13949, 15519, + 11032, 14444, 16925, 8032, 10271, 11810, 10962, 13451, 15833, + 10021, 11667, 13324, 6273, 8226, 12936, 8543, 10397, 13496, + 7936, 10302, 12745, 6769, 8138, 10446, 6081, 7786, 11719, + 8637, 11795, 14975, 8790, 10336, 11812, 7040, 8490, 10771, + 7338, 10381, 13153, 6598, 7888, 9358, 6518, 8237, 12030, + 9055, 10763, 12983, 6490, 10009, 12007, 9589, 12023, 13632, + 6867, 9447, 10995, 7930, 9816, 11397, 10241, 13300, 14939, + 5830, 8670, 12387, 9870, 11915, 14247, 9318, 11647, 13272, + 6721, 10836, 12929, 6543, 8233, 9944, 8034, 10854, 12394, + 9112, 11787, 14218, 9302, 11114, 13400, 9022, 11366, 13816, + 6962, 10461, 12480, 11288, 13333, 15222, 7249, 8974, 10547, + 10566, 12336, 14390, 6697, 11339, 13521, 11851, 13944, 15826, + 6847, 8381, 11349, 7509, 9331, 10939, 8029, 9618, 11909, + 13973, 17644, 19647, 22474, 14722, 16522, 20035, 22134, 16305, 18179, 21106, 23048, + 15150, 17948, 21394, 23225, 13582, 15191, 17687, 22333, 11778, 15546, 18458, 21753, + 16619, 18410, 20827, 23559, 14229, 15746, 17907, 22474, 12465, 15327, 20700, 22831, + 15085, 16799, 20182, 23410, 13026, 16935, 19890, 22892, 14310, 16854, 19007, 22944, + 14210, 15897, 18891, 23154, 14633, 18059, 20132, 22899, 15246, 17781, 19780, 22640, + 16396, 18904, 20912, 23035, 14618, 17401, 19510, 21672, 15473, 17497, 19813, 23439, + 18851, 20736, 22323, 23864, 15055, 16804, 18530, 20916, 16490, 18196, 19990, 21939, + 11711, 15223, 21154, 23312, 13294, 15546, 19393, 21472, 12956, 16060, 20610, 22417, + 11628, 15843, 19617, 22501, 14106, 16872, 19839, 22689, 15655, 18192, 20161, 22452, + 12953, 15244, 20619, 23549, 15322, 17193, 19926, 21762, 16873, 18676, 20444, 22359, + 14874, 17871, 20083, 21959, 11534, 14486, 19194, 21857, 17766, 19617, 21338, 23178, + 13404, 15284, 19080, 23136, 15392, 17527, 19470, 21953, 14462, 16153, 17985, 21192, + 17734, 19750, 21903, 23783, 16973, 19096, 21675, 23815, 16597, 18936, 21257, 23461, + 15966, 17865, 20602, 22920, 15416, 17456, 20301, 22972, 18335, 20093, 21732, 23497, + 15548, 17217, 20679, 23594, 15208, 16995, 20816, 22870, 13890, 18015, 20531, 22468, + 13211, 15377, 19951, 22388, 12852, 14635, 17978, 22680, 16002, 17732, 20373, 23544, + 11373, 14134, 19534, 22707, 17329, 19151, 21241, 23462, 15612, 17296, 19362, 22850, + 15422, 19104, 21285, 23164, 13792, 17111, 19349, 21370, 15352, 17876, 20776, 22667, + 15253, 16961, 18921, 22123, 14108, 17264, 20294, 23246, 15785, 17897, 20010, 21822, + 17399, 19147, 20915, 22753, 13010, 15659, 18127, 20840, 16826, 19422, 22218, 24084, + 18108, 20641, 22695, 24237, 18018, 20273, 22268, 23920, 16057, 17821, 21365, 23665, + 16005, 17901, 19892, 23016, 13232, 16683, 21107, 23221, 13280, 16615, 19915, 21829, + 14950, 18575, 20599, 22511, 16337, 18261, 20277, 23216, 14306, 16477, 21203, 23158, + 12803, 17498, 20248, 22014, 14327, 17068, 20160, 22006, 14402, 17461, 21599, 23688, + 16968, 18834, 20896, 23055, 15070, 17157, 20451, 22315, 15419, 17107, 21601, 23946, + 16039, 17639, 19533, 21424, 16326, 19261, 21745, 23673, 16489, 18534, 21658, 23782, + 16594, 18471, 20549, 22807, 18973, 21212, 22890, 24278, 14264, 18674, 21123, 23071, + 15117, 16841, 19239, 23118, 13762, 15782, 20478, 23230, 14111, 15949, 20058, 22354, + 14990, 16738, 21139, 23492, 13735, 16971, 19026, 22158, 14676, 17314, 20232, 22807, + 16196, 18146, 20459, 22339, 14747, 17258, 19315, 22437, 14973, 17778, 20692, 23367, + 15715, 17472, 20385, 22349, 15702, 18228, 20829, 23410, 14428, 16188, 20541, 23630, + 16824, 19394, 21365, 23246, 13069, 16392, 18900, 21121, 12047, 16640, 19463, 21689, + 14757, 17433, 19659, 23125, 15185, 16930, 19900, 22540, 16026, 17725, 19618, 22399, + 16086, 18643, 21179, 23472, 15462, 17248, 19102, 21196, 17368, 20016, 22396, 24096, + 12340, 14475, 19665, 23362, 13636, 16229, 19462, 22728, 14096, 16211, 19591, 21635, + 12152, 14867, 19943, 22301, 14492, 17503, 21002, 22728, 14834, 16788, 19447, 21411, + 14650, 16433, 19326, 22308, 14624, 16328, 19659, 23204, 13888, 16572, 20665, 22488, + 12977, 16102, 18841, 22246, 15523, 18431, 21757, 23738, 14095, 16349, 18837, 20947, + 13266, 17809, 21088, 22839, 15427, 18190, 20270, 23143, 11859, 16753, 20935, 22486, + 12310, 17667, 21736, 23319, 14021, 15926, 18702, 22002, 12286, 15299, 19178, 21126, + 15703, 17491, 21039, 23151, 12272, 14018, 18213, 22570, 14817, 16364, 18485, 22598, + 17109, 19683, 21851, 23677, 12657, 14903, 19039, 22061, 14713, 16487, 20527, 22814, + 14635, 16726, 18763, 21715, 15878, 18550, 20718, 22906 +}; + +static const int16_t gain3[9]={ + -16384, -10813, -5407, 0, 4096, 8192, 12288, 16384, 32767 +}; + +static const int16_t gain4[17]={ + -17203, -14746, -12288, -9830, -7373, -4915, -2458, 0, 2458, 4915, 7373, 9830, + 12288, 14746, 17203, 19661, 32767 +}; + +static const int16_t gain5[33]={ + 614, 1229, 1843, 2458, 3072, 3686, + 4301, 4915, 5530, 6144, 6758, 7373, + 7987, 8602, 9216, 9830, 10445, 11059, + 11674, 12288, 12902, 13517, 14131, 14746, + 15360, 15974, 16589, 17203, 17818, 18432, + 19046, 19661, 32767 +}; + +static const int16_t *const ilbc_gain[] = { + gain5, gain4, gain3, +}; + +static const int16_t ilbc_state[8] = { + -30473, -17838, -9257, -2537, 3639, 10893, 19958, 32636 +}; + +static const int16_t frg_quant_mod[64] = { + /* First 37 values in Q8 */ + 569, 671, 786, 916, 1077, 1278, + 1529, 1802, 2109, 2481, 2898, 3440, + 3943, 4535, 5149, 5778, 6464, 7208, + 7904, 8682, 9397, 10285, 11240, 12246, + 13313, 14382, 15492, 16735, 18131, 19693, + 21280, 22912, 24624, 26544, 28432, 30488, + 32720, + /* 22 values in Q5 */ + 4383, 4684, 5012, 5363, 5739, 6146, + 6603, 7113, 7679, 8285, 9040, 9850, + 10838, 11882, 13103, 14467, 15950, 17669, + 19712, 22016, 24800, 28576, + /* 5 values in Q3 */ + 8240, 9792, 12040, 15440, 22472 +}; + +#endif /* AVCODEC_ILBCDATA_H */ diff --git a/include/libavcodec/imcdata.h b/include/libavcodec/imcdata.h new file mode 100644 index 0000000..46037bd --- /dev/null +++ b/include/libavcodec/imcdata.h @@ -0,0 +1,169 @@ +/* + * IMC compatible decoder + * Copyright (c) 2002-2004 Maxim Poliakovski + * Copyright (c) 2006 Benjamin Larsson + * Copyright (c) 2006 Konstantin Shishkov + * + * 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_IMCDATA_H +#define AVCODEC_IMCDATA_H + +#include + +static const uint16_t band_tab[33] = { + 0, 3, 6, 9, 12, 16, 20, 24, 29, 34, 40, + 46, 53, 60, 68, 76, 84, 93, 102, 111, 121, 131, + 141, 151, 162, 173, 184, 195, 207, 219, 231, 243, 256, +}; + + +static const int8_t cyclTab[32] = { + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 32, +}; + +static const int8_t cyclTab2[32] = { + -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 21, 22, +23, 24, 25, 26, 27, 28, 29}; + +static const float imc_weights1[31] = { + 0.119595, 0.123124, 0.129192, 9.97377e-2, 8.1923e-2, 9.61153e-2, 8.77885e-2, 8.61174e-2, + 9.00882e-2, 9.91658e-2, 0.112991, 0.131126, 0.152886, 0.177292, 0.221782, 0.244917, 0.267386, + 0.306816, 0.323046, 0.33729, 0.366773, 0.392557, 0.398076, 0.403302, 0.42451, 0.444777, + 0.449188, 0.455445, 0.477853, 0.500669, 0.510395}; + +static const float imc_weights2[31] = { + 3.23466e-3, 3.49886e-3, 3.98413e-3, 1.98116e-3, 1.16465e-3, 1.79283e-3, 1.40372e-3, 1.33274e-3, + 1.50523e-3, 1.95064e-3, 2.77472e-3, 4.14725e-3, 6.2776e-3, 9.36401e-3, 1.71397e-2, 2.24052e-2, + 2.83971e-2, 4.11689e-2, 4.73165e-2, 5.31631e-2, 6.66614e-2, 8.00824e-2, 8.31588e-2, 8.61397e-2, + 9.89229e-2, 0.112197, 0.115227, 0.119613, 0.136174, 0.15445, 0.162685}; + +static const float imc_quantizer1[4][8] = { + { 8.4431201e-1, 4.7358301e-1, 1.448354, 2.7073899e-1, 7.4449003e-1, 1.241991, 1.845484, 0.0}, + { 8.6876702e-1, 4.7659001e-1, 1.478224, 2.5672799e-1, 7.55777e-1, 1.3229851, 2.03438, 0.0}, + { 7.5891501e-1, 6.2272799e-1, 1.271322, 3.47904e-1, 7.5317699e-1, 1.150767, 1.628476, 0.0}, + { 7.65257e-1, 6.44647e-1, 1.263824, 3.4548101e-1, 7.6384902e-1, 1.214466, 1.7638789, 0.0}, +}; + +static const float imc_quantizer2[2][56] = { + { 1.39236e-1, 3.50548e-1, 5.9547901e-1, 8.5772401e-1, 1.121545, 1.3882281, 1.695882, 2.1270809, + 7.2221003e-2, 1.85177e-1, 2.9521701e-1, 4.12568e-1, 5.4068601e-1, 6.7679501e-1, 8.1196898e-1, 9.4765198e-1, + 1.0779999, 1.203415, 1.337265, 1.481871, 1.639982, 1.814766, 2.0701399, 2.449862, + 3.7533998e-2, 1.02722e-1, 1.6021401e-1, 2.16043e-1, 2.7231601e-1, 3.3025399e-1, 3.9022601e-1, 4.52849e-1, + 5.1794899e-1, 5.8529502e-1, 6.53956e-1, 7.2312802e-1, 7.9150802e-1, 8.5891002e-1, 9.28141e-1, 9.9706203e-1, + 1.062153, 1.12564, 1.189834, 1.256122, 1.324469, 1.3955311, 1.468906, 1.545084, + 1.6264729, 1.711524, 1.802705, 1.91023, 2.0533991, 2.22333, 2.4830019, 3.253329 }, + { 1.11654e-1, 3.54469e-1, 6.4232099e-1, 9.6128798e-1, 1.295053, 1.61777, 1.989839, 2.51107, + 5.7721999e-2, 1.69879e-1, 2.97589e-1, 4.3858799e-1, 5.9039903e-1, 7.4934798e-1, 9.1628098e-1, 1.087297, + 1.262751, 1.4288321, 1.6040879, 1.79067, 2.000668, 2.2394669, 2.649332, 5.2760072, + 2.9722e-2, 8.7316997e-2, 1.4445201e-1, 2.04247e-1, 2.6879501e-1, 3.3716801e-1, 4.08811e-1, 4.8306999e-1, + 5.6049401e-1, 6.3955498e-1, 7.2044599e-1, 8.0427998e-1, 8.8933599e-1, 9.7537601e-1, 1.062461, 1.1510431, + 1.240236, 1.326715, 1.412513, 1.500502, 1.591749, 1.686413, 1.785239, 1.891233, + 2.0051291, 2.127681, 2.2709141, 2.475826, 2.7219379, 3.101985, 4.686213, 6.2287788}, +}; + + +static const float xTab[14] = {7.6, 3.6, 4.4, 3.7, 6.1, 5.1, 2.3, 1.6, 6.2, 1.5, 1.8, 1.2, 0, 0}; //10014048 + +/* precomputed table for 10^(i/4), i=-15..16 */ +static const float imc_exp_tab[32] = { + 1.778280e-4, 3.162278e-4, 5.623413e-4, 1.000000e-3, + 1.778280e-3, 3.162278e-3, 5.623413e-3, 1.000000e-2, + 1.778280e-2, 3.162278e-2, 5.623413e-2, 1.000000e-1, + 1.778280e-1, 3.162278e-1, 5.623413e-1, 1.000000e00, + 1.778280e00, 3.162278e00, 5.623413e00, 1.000000e01, + 1.778280e01, 3.162278e01, 5.623413e01, 1.000000e02, + 1.778280e02, 3.162278e02, 5.623413e02, 1.000000e03, + 1.778280e03, 3.162278e03, 5.623413e03, 1.000000e04 +}; +static const float * const imc_exp_tab2 = imc_exp_tab + 8; + + +static const uint8_t imc_cb_select[4][32] = { + { 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2 }, + { 0, 2, 0, 3, 2, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, + { 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2 }, + { 0, 1, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; + +static const uint8_t imc_huffman_sizes[4] = { + 17, 17, 18, 18 +}; + +static const uint8_t imc_huffman_lens[4][4][18] = { + { + { 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 }, + }, + { + { 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 }, + }, + { + { 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 }, + }, + { + { 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 uint8_t imc_huffman_syms[4][4][18] = { + { + { 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 }, + }, + { + { 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 }, + }, + { + { 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 }, + }, + { + { 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 }, + } +}; + +#endif /* AVCODEC_IMCDATA_H */ diff --git a/include/libavcodec/indeo2data.h b/include/libavcodec/indeo2data.h new file mode 100644 index 0000000..9981a3b --- /dev/null +++ b/include/libavcodec/indeo2data.h @@ -0,0 +1,191 @@ +/* + * Intel Indeo 2 codec + * copyright (c) 2005 Konstantin Shishkov + * + * 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_INDEO2DATA_H +#define AVCODEC_INDEO2DATA_H + +#include + +#define IR2_CODES 143 +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] = { + { 0x80, 0x80, 0x84, 0x84, 0x7C, 0x7C, 0x7F, 0x85, + 0x81, 0x7B, 0x85, 0x7F, 0x7B, 0x81, 0x8C, 0x8C, + 0x74, 0x74, 0x83, 0x8D, 0x7D, 0x73, 0x8D, 0x83, + 0x73, 0x7D, 0x77, 0x89, 0x89, 0x77, 0x89, 0x77, + 0x77, 0x89, 0x8C, 0x95, 0x74, 0x6B, 0x95, 0x8C, + 0x6B, 0x74, 0x7C, 0x90, 0x84, 0x70, 0x90, 0x7C, + 0x70, 0x84, 0x96, 0x96, 0x6A, 0x6A, 0x82, 0x98, + 0x7E, 0x68, 0x98, 0x82, 0x68, 0x7E, 0x97, 0xA2, + 0x69, 0x5E, 0xA2, 0x97, 0x5E, 0x69, 0xA2, 0xA2, + 0x5E, 0x5E, 0x8B, 0xA3, 0x75, 0x5D, 0xA3, 0x8B, + 0x5D, 0x75, 0x71, 0x95, 0x8F, 0x6B, 0x95, 0x71, + 0x6B, 0x8F, 0x78, 0x9D, 0x88, 0x63, 0x9D, 0x78, + 0x63, 0x88, 0x7F, 0xA7, 0x81, 0x59, 0xA7, 0x7F, + 0x59, 0x81, 0xA4, 0xB1, 0x5C, 0x4F, 0xB1, 0xA4, + 0x4F, 0x5C, 0x96, 0xB1, 0x6A, 0x4F, 0xB1, 0x96, + 0x4F, 0x6A, 0xB2, 0xB2, 0x4E, 0x4E, 0x65, 0x9B, + 0x9B, 0x65, 0x9B, 0x65, 0x65, 0x9B, 0x89, 0xB4, + 0x77, 0x4C, 0xB4, 0x89, 0x4C, 0x77, 0x6A, 0xA3, + 0x96, 0x5D, 0xA3, 0x6A, 0x5D, 0x96, 0x73, 0xAC, + 0x8D, 0x54, 0xAC, 0x73, 0x54, 0x8D, 0xB4, 0xC3, + 0x4C, 0x3D, 0xC3, 0xB4, 0x3D, 0x4C, 0xA4, 0xC3, + 0x5C, 0x3D, 0xC3, 0xA4, 0x3D, 0x5C, 0xC4, 0xC4, + 0x3C, 0x3C, 0x96, 0xC6, 0x6A, 0x3A, 0xC6, 0x96, + 0x3A, 0x6A, 0x7C, 0xBA, 0x84, 0x46, 0xBA, 0x7C, + 0x46, 0x84, 0x5B, 0xAB, 0xA5, 0x55, 0xAB, 0x5B, + 0x55, 0xA5, 0x63, 0xB4, 0x9D, 0x4C, 0xB4, 0x63, + 0x4C, 0x9D, 0x86, 0xCA, 0x7A, 0x36, 0xCA, 0x86, + 0x36, 0x7A, 0xB6, 0xD7, 0x4A, 0x29, 0xD7, 0xB6, + 0x29, 0x4A, 0xC8, 0xD7, 0x38, 0x29, 0xD7, 0xC8, + 0x29, 0x38, 0xA4, 0xD8, 0x5C, 0x28, 0xD8, 0xA4, + 0x28, 0x5C, 0x6C, 0xC1, 0x94, 0x3F, 0xC1, 0x6C, + 0x3F, 0x94, 0xD9, 0xD9, 0x27, 0x27, 0x80, 0x80, }, + { 0x80, 0x80, 0x85, 0x85, 0x7B, 0x7B, 0x7E, 0x87, + 0x82, 0x79, 0x87, 0x7E, 0x79, 0x82, 0x8F, 0x8F, + 0x71, 0x71, 0x84, 0x8F, 0x7C, 0x71, 0x8F, 0x84, + 0x71, 0x7C, 0x75, 0x8B, 0x8B, 0x75, 0x8B, 0x75, + 0x75, 0x8B, 0x8E, 0x9A, 0x72, 0x66, 0x9A, 0x8E, + 0x66, 0x72, 0x7B, 0x93, 0x85, 0x6D, 0x93, 0x7B, + 0x6D, 0x85, 0x9B, 0x9B, 0x65, 0x65, 0x82, 0x9D, + 0x7E, 0x63, 0x9D, 0x82, 0x63, 0x7E, 0x9B, 0xA8, + 0x65, 0x58, 0xA8, 0x9B, 0x58, 0x65, 0xA9, 0xA9, + 0x57, 0x57, 0x8D, 0xAA, 0x73, 0x56, 0xAA, 0x8D, + 0x56, 0x73, 0x6E, 0x99, 0x92, 0x67, 0x99, 0x6E, + 0x67, 0x92, 0x76, 0xA2, 0x8A, 0x5E, 0xA2, 0x76, + 0x5E, 0x8A, 0x7F, 0xAF, 0x81, 0x51, 0xAF, 0x7F, + 0x51, 0x81, 0xAB, 0xBA, 0x55, 0x46, 0xBA, 0xAB, + 0x46, 0x55, 0x9A, 0xBB, 0x66, 0x45, 0xBB, 0x9A, + 0x45, 0x66, 0xBB, 0xBB, 0x45, 0x45, 0x60, 0xA0, + 0xA0, 0x60, 0xA0, 0x60, 0x60, 0xA0, 0x8B, 0xBE, + 0x75, 0x42, 0xBE, 0x8B, 0x42, 0x75, 0x66, 0xAA, + 0x9A, 0x56, 0xAA, 0x66, 0x56, 0x9A, 0x70, 0xB5, + 0x90, 0x4B, 0xB5, 0x70, 0x4B, 0x90, 0xBE, 0xCF, + 0x42, 0x31, 0xCF, 0xBE, 0x31, 0x42, 0xAB, 0xD0, + 0x55, 0x30, 0xD0, 0xAB, 0x30, 0x55, 0xD1, 0xD1, + 0x2F, 0x2F, 0x9A, 0xD3, 0x66, 0x2D, 0xD3, 0x9A, + 0x2D, 0x66, 0x7B, 0xC5, 0x85, 0x3B, 0xC5, 0x7B, + 0x3B, 0x85, 0x54, 0xB4, 0xAC, 0x4C, 0xB4, 0x54, + 0x4C, 0xAC, 0x5E, 0xBE, 0xA2, 0x42, 0xBE, 0x5E, + 0x42, 0xA2, 0x87, 0xD8, 0x79, 0x28, 0xD8, 0x87, + 0x28, 0x79, 0xC0, 0xE8, 0x40, 0x18, 0xE8, 0xC0, + 0x18, 0x40, 0xD5, 0xE8, 0x2B, 0x18, 0xE8, 0xD5, + 0x18, 0x2B, 0xAB, 0xE9, 0x55, 0x17, 0xE9, 0xAB, + 0x17, 0x55, 0x68, 0xCD, 0x98, 0x33, 0xCD, 0x68, + 0x33, 0x98, 0xEA, 0xEA, 0x16, 0x16, 0x80, 0x80, }, + { 0x80, 0x80, 0x86, 0x86, 0x7A, 0x7A, 0x7E, 0x88, + 0x82, 0x78, 0x88, 0x7E, 0x78, 0x82, 0x92, 0x92, + 0x6E, 0x6E, 0x85, 0x92, 0x7B, 0x6E, 0x92, 0x85, + 0x6E, 0x7B, 0x73, 0x8D, 0x8D, 0x73, 0x8D, 0x73, + 0x73, 0x8D, 0x91, 0x9E, 0x6F, 0x62, 0x9E, 0x91, + 0x62, 0x6F, 0x79, 0x97, 0x87, 0x69, 0x97, 0x79, + 0x69, 0x87, 0xA0, 0xA0, 0x60, 0x60, 0x83, 0xA2, + 0x7D, 0x5E, 0xA2, 0x83, 0x5E, 0x7D, 0xA0, 0xB0, + 0x60, 0x50, 0xB0, 0xA0, 0x50, 0x60, 0xB1, 0xB1, + 0x4F, 0x4F, 0x8F, 0xB2, 0x71, 0x4E, 0xB2, 0x8F, + 0x4E, 0x71, 0x6B, 0x9E, 0x95, 0x62, 0x9E, 0x6B, + 0x62, 0x95, 0x74, 0xA9, 0x8C, 0x57, 0xA9, 0x74, + 0x57, 0x8C, 0x7F, 0xB8, 0x81, 0x48, 0xB8, 0x7F, + 0x48, 0x81, 0xB4, 0xC5, 0x4C, 0x3B, 0xC5, 0xB4, + 0x3B, 0x4C, 0x9F, 0xC6, 0x61, 0x3A, 0xC6, 0x9F, + 0x3A, 0x61, 0xC6, 0xC6, 0x3A, 0x3A, 0x59, 0xA7, + 0xA7, 0x59, 0xA7, 0x59, 0x59, 0xA7, 0x8D, 0xCA, + 0x73, 0x36, 0xCA, 0x8D, 0x36, 0x73, 0x61, 0xB2, + 0x9F, 0x4E, 0xB2, 0x61, 0x4E, 0x9F, 0x6D, 0xBF, + 0x93, 0x41, 0xBF, 0x6D, 0x41, 0x93, 0xCA, 0xDF, + 0x36, 0x21, 0xDF, 0xCA, 0x21, 0x36, 0xB3, 0xDF, + 0x4D, 0x21, 0xDF, 0xB3, 0x21, 0x4D, 0xE1, 0xE1, + 0x1F, 0x1F, 0x9F, 0xE3, 0x61, 0x1D, 0xE3, 0x9F, + 0x1D, 0x61, 0x7A, 0xD3, 0x86, 0x2D, 0xD3, 0x7A, + 0x2D, 0x86, 0x4C, 0xBE, 0xB4, 0x42, 0xBE, 0x4C, + 0x42, 0xB4, 0x57, 0xCA, 0xA9, 0x36, 0xCA, 0x57, + 0x36, 0xA9, 0x88, 0xE9, 0x78, 0x17, 0xE9, 0x88, + 0x17, 0x78, 0xCC, 0xFB, 0x34, 0x05, 0xFB, 0xCC, + 0x05, 0x34, 0xE6, 0xFB, 0x1A, 0x05, 0xFB, 0xE6, + 0x05, 0x1A, 0xB4, 0xFD, 0x4C, 0x03, 0xFD, 0xB4, + 0x03, 0x4C, 0x63, 0xDC, 0x9D, 0x24, 0xDC, 0x63, + 0x24, 0x9D, 0xFE, 0xFE, 0x02, 0x02, 0x80, 0x80, }, + { 0x80, 0x80, 0x87, 0x87, 0x79, 0x79, 0x7E, 0x89, + 0x82, 0x77, 0x89, 0x7E, 0x77, 0x82, 0x95, 0x95, + 0x6B, 0x6B, 0x86, 0x96, 0x7A, 0x6A, 0x96, 0x86, + 0x6A, 0x7A, 0x70, 0x90, 0x90, 0x70, 0x90, 0x70, + 0x70, 0x90, 0x94, 0xA4, 0x6C, 0x5C, 0xA4, 0x94, + 0x5C, 0x6C, 0x78, 0x9B, 0x88, 0x65, 0x9B, 0x78, + 0x65, 0x88, 0xA6, 0xA6, 0x5A, 0x5A, 0x83, 0xA9, + 0x7D, 0x57, 0xA9, 0x83, 0x57, 0x7D, 0xA6, 0xB9, + 0x5A, 0x47, 0xB9, 0xA6, 0x47, 0x5A, 0xBA, 0xBA, + 0x46, 0x46, 0x92, 0xBC, 0x6E, 0x44, 0xBC, 0x92, + 0x44, 0x6E, 0x67, 0xA3, 0x99, 0x5D, 0xA3, 0x67, + 0x5D, 0x99, 0x72, 0xB0, 0x8E, 0x50, 0xB0, 0x72, + 0x50, 0x8E, 0x7F, 0xC3, 0x81, 0x3D, 0xC3, 0x7F, + 0x3D, 0x81, 0xBE, 0xD2, 0x42, 0x2E, 0xD2, 0xBE, + 0x2E, 0x42, 0xA5, 0xD4, 0x5B, 0x2C, 0xD4, 0xA5, + 0x2C, 0x5B, 0xD4, 0xD4, 0x2C, 0x2C, 0x52, 0xAE, + 0xAE, 0x52, 0xAE, 0x52, 0x52, 0xAE, 0x8F, 0xD8, + 0x71, 0x28, 0xD8, 0x8F, 0x28, 0x71, 0x5B, 0xBB, + 0xA5, 0x45, 0xBB, 0x5B, 0x45, 0xA5, 0x69, 0xCB, + 0x97, 0x35, 0xCB, 0x69, 0x35, 0x97, 0xD8, 0xF0, + 0x28, 0x10, 0xF0, 0xD8, 0x10, 0x28, 0xBD, 0xF1, + 0x43, 0x0F, 0xF1, 0xBD, 0x0F, 0x43, 0xF3, 0xF3, + 0x0D, 0x0D, 0xA5, 0xF6, 0x5B, 0x0A, 0xF6, 0xA5, + 0x0A, 0x5B, 0x78, 0xE2, 0x88, 0x1E, 0xE2, 0x78, + 0x1E, 0x88, 0x42, 0xC9, 0xBE, 0x37, 0xC9, 0x42, + 0x37, 0xBE, 0x4F, 0xD8, 0xB1, 0x28, 0xD8, 0x4F, + 0x28, 0xB1, 0x8A, 0xFD, 0x76, 0x03, 0xFD, 0x8A, + 0x03, 0x76, 0xDB, 0xFF, 0x25, 0x01, 0xFF, 0xDB, + 0x01, 0x25, 0xF9, 0xFF, 0x07, 0x01, 0xFF, 0xF9, + 0x01, 0x07, 0xBE, 0xFF, 0x42, 0x01, 0xFF, 0xBE, + 0x01, 0x42, 0x5E, 0xED, 0xA2, 0x13, 0xED, 0x5E, + 0x13, 0xA2, 0xFF, 0xFF, 0x01, 0x01, 0x80, 0x80, }, +}; + +#endif /* AVCODEC_INDEO2DATA_H */ diff --git a/include/libavcodec/indeo3data.h b/include/libavcodec/indeo3data.h new file mode 100644 index 0000000..fbe76af --- /dev/null +++ b/include/libavcodec/indeo3data.h @@ -0,0 +1,362 @@ +/* + * Indeo Video v3 compatible decoder + * Copyright (c) 2009 - 2011 Maxim Poliakovski + * + * 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_INDEO3DATA_H +#define AVCODEC_INDEO3DATA_H + +#include + +#include "config.h" + +/* + * Define compressed VQ tables. + */ + +#define TAB_1_1 \ + PD( 0, 0), E2( 2, 2), E4( -1, 3), E2( 4, 4), E4( 1, 5),\ + E2( -4, 4), E4( -2, 6), E4( 4, 9), E2( 9, 9), E4( 1, 10),\ + E4( -5, 8), E4( 9, 15), E4( -3, 12), E4( 4, 16), E2( 16, 16),\ + E4( 0, 18), E2( -12, 12), E4( -9, 16), E4( 11, 27), E4( 19, 28),\ + E4( -6, 22), E4( 4, 29), E2( 30, 30), E4( -2, 33), E4( -18, 23),\ + E4( -15, 30), E4( 22, 46), E4( 13, 47), E4( 35, 49), E4( -11, 41),\ + E4( 4, 51), E2( 54, 54), E2( -34, 34), E4( -29, 42), E4( -6, 60),\ + E4( 27, 76), E4( 43, 77), E4( -24, 55), E4( 14, 79), E4( 63, 83),\ + E4( -20, 74), E4( 2, 88), E2( 93, 93), E4( -52, 61), E4( 52, 120),\ + E4( -45, 75), E4( 75, 125), E4( 33, 122), E4( -13, 103), E4( -40, 96),\ + E4( -34, 127), E2( -89, 89), E4( -78, 105), E2( 12, 12), E2( 23, 23),\ + E2( 42, 42), E2( 73, 73) + +#define TAB_1_2 \ + PD( 0, 0), E2( 3, 3), E4( -1, 4), E2( 7, 7), E4( 2, 8),\ + E4( -2, 9), E2( -6, 6), E4( 6, 13), E2( 13, 13), E4( 1, 14),\ + E4( -8, 12), E4( 14, 23), E4( -5, 18), E4( 6, 24), E2( 24, 24),\ + E4( -1, 27), E2( -17, 17), E4( -13, 23), E4( 16, 40), E4( 28, 41),\ + E4( -9, 33), E4( 6, 43), E2( 46, 46), E4( -4, 50), E4( -27, 34),\ + E4( -22, 45), E4( 34, 69), E4( 19, 70), E4( 53, 73), E4( -17, 62),\ + E4( 5, 77), E2( 82, 82), E2( -51, 51), E4( -43, 64), E4( -10, 90),\ + E4( 41, 114), E4( 64, 116), E4( -37, 82), E4( 22, 119), E4( 95, 124),\ + E4( -30, 111), E4( -78, 92), E4( -68, 113), E2( 18, 18), E2( 34, 34),\ + E2( 63, 63), E2( 109, 109) + +#define TAB_1_3 \ + PD( 0, 0), E2( 4, 4), E4( -1, 5), E4( 3, 10), E2( 9, 9),\ + E2( -7, 7), E4( -3, 12), E4( 8, 17), E2( 17, 17), E4( 1, 19),\ + E4( -11, 16), E4( -6, 23), E4( 18, 31), E4( 8, 32), E2( 33, 33),\ + E4( -1, 36), E2( -23, 23), E4( -17, 31), E4( 21, 54), E4( 37, 55),\ + E4( -12, 44), E4( 8, 57), E2( 61, 61), E4( -5, 66), E4( -36, 45),\ + E4( -29, 60), E4( 45, 92), E4( 25, 93), E4( 71, 97), E4( -22, 83),\ + E4( 7, 102), E2( 109, 109), E2( -68, 68), E4( -57, 85), E4( -13, 120),\ + E4( -49, 110), E4(-104, 123), E2( 24, 24), E2( 46, 46), E2( 84, 84) + +#define TAB_1_4 \ + PD( 0, 0), E2( 5, 5), E4( -2, 7), E2( 11, 11), E4( 3, 13),\ + E2( -9, 9), E4( -4, 15), E4( 11, 22), E2( 21, 21), E4( 2, 24),\ + E4( -14, 20), E4( 23, 38), E4( -8, 29), E4( 11, 39), E2( 41, 41),\ + E4( -1, 45), E2( -29, 29), E4( -22, 39), E4( 27, 67), E4( 47, 69),\ + E4( -15, 56), E4( 11, 71), E2( 76, 76), E4( -6, 83), E4( -45, 57),\ + E4( -36, 75), E4( 56, 115), E4( 31, 117), E4( 88, 122), E4( -28, 104),\ + E2( -85, 85), E4( -72, 106), E2( 30, 30), E2( 58, 58), E2( 105, 105) + +#define TAB_1_5 \ + PD( 0, 0), E2( 6, 6), E4( -2, 8), E2( 13, 13), E4( 4, 15),\ + E2( -11, 11), E4( -5, 18), E4( 13, 26), E2( 26, 26), E4( 2, 29),\ + E4( -16, 24), E4( 28, 46), E4( -9, 35), E4( 13, 47), E2( 49, 49),\ + E4( -1, 54), E2( -35, 35), E4( -26, 47), E4( 32, 81), E4( 56, 83),\ + E4( -18, 67), E4( 13, 86), E2( 91, 91), E4( -7, 99), E4( -54, 68),\ + E4( -44, 90), E4( -33, 124), E2(-103, 103), E4( -86, 127), E2( 37, 37),\ + E2( 69, 69) + +#define TAB_1_6 \ + PD( 0, 0), E2( 7, 7), E4( -3, 10), E2( 16, 16), E4( 5, 18),\ + E2( -13, 13), E4( -6, 21), E4( 15, 30), E2( 30, 30), E4( 2, 34),\ + E4( -19, 28), E4( 32, 54), E4( -11, 41), E4( 15, 55), E2( 57, 57),\ + E4( -1, 63), E2( -40, 40), E4( -30, 55), E4( 37, 94), E4( 65, 96),\ + E4( -21, 78), E4( 15, 100), E2( 106, 106), E4( -8, 116), E4( -63, 79),\ + E4( -51, 105), E2(-120, 120), E2( 43, 43), E2( 80, 80) + +#define TAB_1_7 \ + PD( 0, 0), E2( 8, 8), E4( -3, 11), E2( 18, 18), E4( 5, 20),\ + E2( -15, 15), E4( -7, 24), E4( 17, 35), E2( 34, 34), E4( 3, 38),\ + E4( -22, 32), E4( 37, 61), E4( -13, 47), E4( 17, 63), E2( 65, 65),\ + E4( -1, 72), E2( -46, 46), E4( -35, 63), E4( 43, 107), E4( 75, 110),\ + E4( -24, 89), E4( 17, 114), E2( 121, 121), E4( -72, 91), E4( -58, 120),\ + E2( 49, 49), E2( 92, 92) + +#define TAB_1_8 \ + PD( 0, 0), E2( 9, 9), E4( -3, 12), E2( 20, 20), E4( 6, 23),\ + E2( -17, 17), E4( -7, 27), E4( 19, 39), E2( 39, 39), E4( 3, 43),\ + E4( -24, 36), E4( 42, 69), E4( -14, 53), E4( 19, 71), E2( 73, 73),\ + E4( -2, 80), E2( -52, 52), E4( -39, 70), E4( 48, 121), E4( 84, 124),\ + E4( -27, 100), E4( -81, 102), E2( 55, 55), E2( 104, 104) + +#define TAB_2_1 \ + PD( 0, 0), E2( 2, 2), E4( 0, 2), E2( 4, 4), E4( 0, 4),\ + E2( -4, 4), E4( -2, 6), E4( 4, 8), E2( 8, 8), E4( 0, 10),\ + E4( -4, 8), E4( 8, 14), E4( -2, 12), E4( 4, 16), E2( 16, 16),\ + E4( 0, 18), E2( -12, 12), E4( -8, 16), E4( 10, 26), E4( 18, 28),\ + E4( -6, 22), E4( 4, 28), E2( 30, 30), E4( -2, 32), E4( -18, 22),\ + E4( -14, 30), E4( 22, 46), E4( 12, 46), E4( 34, 48), E4( -10, 40),\ + E4( 4, 50), E2( 54, 54), E2( -34, 34), E4( -28, 42), E4( -6, 60),\ + E4( 26, 76), E4( 42, 76), E4( -24, 54), E4( 14, 78), E4( 62, 82),\ + E4( -20, 74), E4( 2, 88), E2( 92, 92), E4( -52, 60), E4( 52, 118),\ + E4( -44, 74), E4( 74, 118), E4( 32, 118), E4( -12, 102), E4( -40, 96),\ + E4( -34, 118), E2( -88, 88), E4( -78, 104), E2( 12, 12), E2( 22, 22),\ + E2( 42, 42), E2( 72, 72) + +#define TAB_2_2 \ + PD( 0, 0), E2( 3, 3), E4( 0, 3), E2( 6, 6), E4( 3, 9),\ + E4( -3, 9), E2( -6, 6), E4( 6, 12), E2( 12, 12), E4( 0, 15),\ + E4( -9, 12), E4( 15, 24), E4( -6, 18), E4( 6, 24), E2( 24, 24),\ + E4( 0, 27), E2( -18, 18), E4( -12, 24), E4( 15, 39), E4( 27, 42),\ + E4( -9, 33), E4( 6, 42), E2( 45, 45), E4( -3, 51), E4( -27, 33),\ + E4( -21, 45), E4( 33, 69), E4( 18, 69), E4( 54, 72), E4( -18, 63),\ + E4( 6, 78), E2( 81, 81), E2( -51, 51), E4( -42, 63), E4( -9, 90),\ + E4( 42, 114), E4( 63, 117), E4( -36, 81), E4( 21, 120), E4( 96, 123),\ + E4( -30, 111), E4( -78, 93), E4( -69, 114), E2( 18, 18), E2( 33, 33),\ + E2( 63, 63), E2( 108, 108) + +#define TAB_2_3 \ + PD( 0, 0), E2( 4, 4), E4( 0, 4), E4( 4, 8), E2( 8, 8),\ + E2( -8, 8), E4( -4, 12), E4( 8, 16), E2( 16, 16), E4( 0, 20),\ + E4( -12, 16), E4( -4, 24), E4( 16, 32), E4( 8, 32), E2( 32, 32),\ + E4( 0, 36), E2( -24, 24), E4( -16, 32), E4( 20, 52), E4( 36, 56),\ + E4( -12, 44), E4( 8, 56), E2( 60, 60), E4( -4, 64), E4( -36, 44),\ + E4( -28, 60), E4( 44, 92), E4( 24, 92), E4( 72, 96), E4( -20, 84),\ + E4( 8, 100), E2( 108, 108), E2( -68, 68), E4( -56, 84), E4( -12, 120),\ + E4( -48, 108), E4(-104, 124), E2( 24, 24), E2( 44, 44), E2( 84, 84) + +#define TAB_2_4 \ + PD( 0, 0), E2( 5, 5), E4( 0, 5), E2( 10, 10), E4( 5, 15),\ + E2( -10, 10), E4( -5, 15), E4( 10, 20), E2( 20, 20), E4( 0, 25),\ + E4( -15, 20), E4( 25, 40), E4( -10, 30), E4( 10, 40), E2( 40, 40),\ + E4( 0, 45), E2( -30, 30), E4( -20, 40), E4( 25, 65), E4( 45, 70),\ + E4( -15, 55), E4( 10, 70), E2( 75, 75), E4( -5, 85), E4( -45, 55),\ + E4( -35, 75), E4( 55, 115), E4( 30, 115), E4( 90, 120), E4( -30, 105),\ + E2( -85, 85), E4( -70, 105), E2( 30, 30), E2( 60, 60), E2( 105, 105) + +#define TAB_2_5 \ + PD( 0, 0), E2( 6, 6), E4( 0, 6), E2( 12, 12), E4( 6, 12),\ + E2( -12, 12), E4( -6, 18), E4( 12, 24), E2( 24, 24), E4( 0, 30),\ + E4( -18, 24), E4( 30, 48), E4( -6, 36), E4( 12, 48), E2( 48, 48),\ + E4( 0, 54), E2( -36, 36), E4( -24, 48), E4( 30, 78), E4( 54, 84),\ + E4( -18, 66), E4( 12, 84), E2( 90, 90), E4( -6, 96), E4( -54, 66),\ + E4( -42, 90), E4( -30, 126), E2(-102, 102), E4( -84, 126), E2( 36, 36),\ + E2( 66, 66) + +#define TAB_2_6 \ + PD( 0, 0), E2( 7, 7), E4( 0, 7), E2( 14, 14), E4( 7, 21),\ + E2( -14, 14), E4( -7, 21), E4( 14, 28), E2( 28, 28), E4( 0, 35),\ + E4( -21, 28), E4( 35, 56), E4( -14, 42), E4( 14, 56), E2( 56, 56),\ + E4( 0, 63), E2( -42, 42), E4( -28, 56), E4( 35, 91), E4( 63, 98),\ + E4( -21, 77), E4( 14, 98), E2( 105, 105), E4( -7, 119), E4( -63, 77),\ + E4( -49, 105), E2(-119, 119), E2( 42, 42), E2( 77, 77) + +#define TAB_2_7 \ + PD( 0, 0), E2( 8, 8), E4( 0, 8), E2( 16, 16), E4( 8, 16),\ + E2( -16, 16), E4( -8, 24), E4( 16, 32), E2( 32, 32), E4( 0, 40),\ + E4( -24, 32), E4( 40, 64), E4( -16, 48), E4( 16, 64), E2( 64, 64),\ + E4( 0, 72), E2( -48, 48), E4( -32, 64), E4( 40, 104), E4( 72, 112),\ + E4( -24, 88), E4( 16, 112), E2( 120, 120), E4( -72, 88), E4( -56, 120),\ + E2( 48, 48), E2( 88, 88) + +#define TAB_2_8 \ + PD( 0, 0), E2( 9, 9), E4( 0, 9), E2( 18, 18), E4( 9, 27),\ + E2( -18, 18), E4( -9, 27), E4( 18, 36), E2( 36, 36), E4( 0, 45),\ + E4( -27, 36), E4( 45, 72), E4( -18, 54), E4( 18, 72), E2( 72, 72),\ + E4( 0, 81), E2( -54, 54), E4( -36, 72), E4( 45, 117), E4( 81, 126),\ + E4( -27, 99), E4( -81, 99), E2( 54, 54), E2( 108, 108) + +#define TAB_3_1 \ + PD( 0, 0), E2( 2, 2), E4( 0, 3), E2( 6, 6), E4( 0, 7),\ + E2( -5, 5), E2( 5, -5), E4( 6, 11), E4( 0, 8), E2( 11, 11),\ + E4( 0, 12), E4( 12, 17), E2( 17, 17), E4( 6, 18), E4( -8, 11),\ + E4( 0, 15), E4( 0, 20), E4( 18, 25), E4( 11, 25), E2( 25, 25),\ + E2( -14, 14), E2( 14, -14), E4( 0, 26), E4( -11, 18), E4( -7, 22),\ + E4( 26, 34), E4( 18, 34), E2( 34, 34), E4( 11, 35), E4( 0, 29),\ + E4( -19, 22), E4( -15, 26), E4( 0, 37), E4( 27, 44), E4( 36, 44),\ + E4( 18, 44), E4( -10, 33), E2( 45, 45) + +#define TAB_3_2 \ + PD( 0, 0), E4( 0, 2), E2( 2, 2), E2( 6, 6), E4( 0, 6),\ + E2( -4, 4), E2( 10, -6), E2( 0, -12), PD( -6, -12), E2( 6, -12),\ + PD( 6, 12), E2( -14, 0), E2( 12, 12), E2( 0, -18), E2( 14, -12),\ + PD( -18, -6), E2( 18, -6), PD( 18, 6), PD( -10, -18), E2( 10, -18),\ + PD( 10, 18), E2( -22, 0), E2( 0, -24), PD( -22, -12), E2( 22, -12),\ + PD( 22, 12), PD( -8, -24), E2( 8, -24), PD( 8, 24), PD( -26, -6),\ + E2( 26, -6), PD( 26, 6), E2( -28, 0), E2( 20, 20), E2( -14, -26),\ + E2( -30, -12), E2( -10, -32), E2( -18, -32), E2( -26, -26), E2( -34, -20),\ + E2( -38, -12), E2( -32, -32), PD( 32, 32), PD( -22, -40), E2( -34, -34) + +#define TAB_3_3 \ + PD( 0, 0), E4( 0, 2), E2( 4, 4), E2( 10, 10), E4( 0, 10),\ + E2( -6, 6), E2( 14, -8), E2( -18, 0), E2( 10, -16), E2( 0, -24),\ + PD( -24, -8), E2( 24, -8), PD( 24, 8), E2( 18, 18), E2( 20, -16),\ + PD( -14, -26), E2( 14, -26), PD( 14, 26), E2( -30, 0), E2( 0, -34),\ + PD( -34, -8), E2( 34, -8), PD( 34, 8), PD( -30, -18), E2( 30, -18),\ + PD( 30, 18), PD( -10, -34), E2( 10, -34), PD( 10, 34), E2( -20, -34),\ + E2( -40, 0), E2( 30, 30), E2( -40, -18), E2( 0, -44), E2( -16, -44),\ + PD( -36, -36), E2( -36, -36), E2( -26, -44), E2( -46, -26), E2( -52, -18),\ + PD( -20, -54), E2( -44, -44), PD( -32, -54), PD( -46, -46), E2( -46, -46) + +#define TAB_3_4 \ + PD( 0, 0), E4( 0, 4), E2( 4, 4), E2( 12, 12), E4( 0, 12),\ + E2( -8, 8), E2( 8, -16), E2( 0, -24), PD( -24, -8), E2( 24, -8),\ + PD( 24, 8), E2( 20, -16), E2( -28, 0), PD( -16, -24), E2( 16, -24),\ + PD( 16, 24), E2( 0, -32), PD( -28, -16), E2( 28, -16), PD( 28, 16),\ + PD( -8, -32), PD( 8, -32), PD( -32, -8), E2( 32, -8), PD( 32, 8),\ + PD( -8, 32), PD( 8, 32), E2( 24, 24), E2( 24, -24), E2( -20, -32),\ + E2( -40, 0), E2( -40, -16), PD( 0, -44), PD( 0, -44), E2( -44, 0),\ + PD( 0, 44), PD( 0, 44), E2( -32, -32), E2( -16, -44), PD( -24, -44),\ + E2( -44, -24), PD( 24, 44), E2( -48, -16), PD( -36, -36), E2( -36, -36),\ + PD( 36, 36), PD( -20, -52), E2( 40, 40), PD( -32, -52) + +#define TAB_3_5 \ + PD( 0, 0), E2( 2, 2), E2( 6, 6), E2( 12, 12), E2( 20, 20),\ + E2( 32, 32), E2( 46, 46) + + +/** + * Pack two delta values (a,b) into one 16-bit word + * according with endianness of the host machine. + */ +#if HAVE_BIGENDIAN +#define PD(a,b) (((a) * (1 << 8)) + (b)) +#else +#define PD(a,b) (((b) * (1 << 8)) + (a)) +#endif + +/** + * Expand a pair of delta values (a,b) + * into two/four delta entries. + */ +#define E2(a, b) PD(a, b), PD(-(a), -(b)) +#define E4(a, b) PD(a, b), PD(-(a), -(b)), PD(b, a), PD(-(b), -(a)) + +/* + * VQ tables for 4x4 block modes. + * Let the compiler decompress and build the tables for us. + */ +static const int16_t delta_tab_1_1[195] = { TAB_1_1 }; +static const int16_t delta_tab_1_2[159] = { TAB_1_2 }; +static const int16_t delta_tab_1_3[133] = { TAB_1_3 }; +static const int16_t delta_tab_1_4[115] = { TAB_1_4 }; +static const int16_t delta_tab_1_5[101] = { TAB_1_5 }; +static const int16_t delta_tab_1_6[93] = { TAB_1_6 }; +static const int16_t delta_tab_1_7[87] = { TAB_1_7 }; +static const int16_t delta_tab_1_8[77] = { TAB_1_8 }; + +static const int16_t delta_tab_2_1[195] = { TAB_2_1 }; +static const int16_t delta_tab_2_2[159] = { TAB_2_2 }; +static const int16_t delta_tab_2_3[133] = { TAB_2_3 }; +static const int16_t delta_tab_2_4[115] = { TAB_2_4 }; +static const int16_t delta_tab_2_5[101] = { TAB_2_5 }; +static const int16_t delta_tab_2_6[93] = { TAB_2_6 }; +static const int16_t delta_tab_2_7[87] = { TAB_2_7 }; +static const int16_t delta_tab_2_8[77] = { TAB_2_8 }; + +static const int16_t delta_tab_3_1[128] = { TAB_3_1 }; +static const int16_t delta_tab_3_2[79] = { TAB_3_2 }; +static const int16_t delta_tab_3_3[79] = { TAB_3_3 }; +static const int16_t delta_tab_3_4[79] = { TAB_3_4 }; +static const int16_t delta_tab_3_5[79] = { TAB_3_5 }; + +#undef PD + +/** + * Pack four delta values (a,a,b,b) into one 32-bit word + * according with endianness of the host machine. + */ +#if HAVE_BIGENDIAN +#define PD(a,b) (((a) * (1 << 24)) + ((a) * (1 << 16)) + ((b) * (1 << 8)) + (b)) +#else +#define PD(a,b) (((b) * (1 << 24)) + ((b) * (1 << 16)) + ((a) * (1 << 8)) + (a)) +#endif + +/* + * VQ tables for 8x8 block modes. + * Those are based on the same delta tables by using + * each value twice: ABCD --> AABBCCDD. + */ +static const int32_t delta_tab_1_1_m10[195] = { TAB_1_1 }; +static const int32_t delta_tab_1_2_m10[159] = { TAB_1_2 }; +static const int32_t delta_tab_1_3_m10[133] = { TAB_1_3 }; +static const int32_t delta_tab_1_4_m10[115] = { TAB_1_4 }; +static const int32_t delta_tab_1_5_m10[101] = { TAB_1_5 }; +static const int32_t delta_tab_1_6_m10[93] = { TAB_1_6 }; +static const int32_t delta_tab_1_7_m10[87] = { TAB_1_7 }; +static const int32_t delta_tab_1_8_m10[77] = { TAB_1_8 }; + +static const int32_t delta_tab_2_1_m10[195] = { TAB_2_1 }; +static const int32_t delta_tab_2_2_m10[159] = { TAB_2_2 }; +static const int32_t delta_tab_2_3_m10[133] = { TAB_2_3 }; +static const int32_t delta_tab_2_4_m10[115] = { TAB_2_4 }; +static const int32_t delta_tab_2_5_m10[101] = { TAB_2_5 }; +static const int32_t delta_tab_2_6_m10[93] = { TAB_2_6 }; +static const int32_t delta_tab_2_7_m10[87] = { TAB_2_7 }; +static const int32_t delta_tab_2_8_m10[77] = { TAB_2_8 }; + +static const int32_t delta_tab_3_1_m10[128] = { TAB_3_1 }; +static const int32_t delta_tab_3_2_m10[79] = { TAB_3_2 }; +static const int32_t delta_tab_3_3_m10[79] = { TAB_3_3 }; +static const int32_t delta_tab_3_4_m10[79] = { TAB_3_4 }; +static const int32_t delta_tab_3_5_m10[79] = { TAB_3_5 }; + + +typedef struct vqEntry { + const int16_t *deltas; ///< delta tables for 4x4 block modes + const int32_t *deltas_m10; ///< delta tables for 8x8 block modes + uint8_t num_dyads; ///< number of two-pixel deltas + uint8_t quad_exp; ///< log2 of four-pixel deltas +} vqEntry; + +static const vqEntry vq_tab[24] = { + /* set 1 */ + { delta_tab_1_1, delta_tab_1_1_m10, 195, 7 }, + { delta_tab_1_2, delta_tab_1_2_m10, 159, 9 }, + { delta_tab_1_3, delta_tab_1_3_m10, 133, 10 }, + { delta_tab_1_4, delta_tab_1_4_m10, 115, 11 }, + { delta_tab_1_5, delta_tab_1_5_m10, 101, 12 }, + { delta_tab_1_6, delta_tab_1_6_m10, 93, 12 }, + { delta_tab_1_7, delta_tab_1_7_m10, 87, 12 }, + { delta_tab_1_8, delta_tab_1_8_m10, 77, 13 }, + + /* set 2 */ + { delta_tab_2_1, delta_tab_2_1_m10, 195, 7 }, + { delta_tab_2_2, delta_tab_2_2_m10, 159, 9 }, + { delta_tab_2_3, delta_tab_2_3_m10, 133, 10 }, + { delta_tab_2_4, delta_tab_2_4_m10, 115, 11 }, + { delta_tab_2_5, delta_tab_2_5_m10, 101, 12 }, + { delta_tab_2_6, delta_tab_2_6_m10, 93, 12 }, + { delta_tab_2_7, delta_tab_2_7_m10, 87, 12 }, + { delta_tab_2_8, delta_tab_2_8_m10, 77, 13 }, + + /* set 3 */ + { delta_tab_3_1, delta_tab_3_1_m10, 128, 11 }, + { delta_tab_3_2, delta_tab_3_2_m10, 79, 13 }, + { delta_tab_3_3, delta_tab_3_3_m10, 79, 13 }, + { delta_tab_3_4, delta_tab_3_4_m10, 79, 13 }, + { delta_tab_3_5, delta_tab_3_5_m10, 79, 13 }, + { delta_tab_3_5, delta_tab_3_5_m10, 79, 13 }, + { delta_tab_3_5, delta_tab_3_5_m10, 79, 13 }, + { delta_tab_3_5, delta_tab_3_5_m10, 79, 13 } +}; + +#endif /* AVCODEC_INDEO3DATA_H */ diff --git a/include/libavcodec/indeo4data.h b/include/libavcodec/indeo4data.h new file mode 100644 index 0000000..cc497c2 --- /dev/null +++ b/include/libavcodec/indeo4data.h @@ -0,0 +1,350 @@ +/* + * Indeo Video Interactive 4 compatible decoder + * Copyright (c) 2009-2010 Maxim Poliakovski + * + * 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 + */ + +/** + * @file + * This file contains data needed for the Indeo 4 decoder. + */ + +#ifndef AVCODEC_INDEO4DATA_H +#define AVCODEC_INDEO4DATA_H + +#include + +#include "ivi.h" + +/** + * standard picture dimensions + */ +static const uint16_t ivi4_common_pic_sizes[14] = { + 640, 480, 320, 240, 160, 120, 704, 480, 352, 240, 352, 288, 176, 144 +}; + +/** + * Indeo 4 8x8 scan (zigzag) patterns + */ +static const uint8_t ivi4_alternate_scan_8x8[64] = { + 0, 8, 1, 9, 16, 24, 2, 3, 17, 25, 10, 11, 32, 40, 48, 56, + 4, 5, 6, 7, 33, 41, 49, 57, 18, 19, 26, 27, 12, 13, 14, 15, + 34, 35, 43, 42, 50, 51, 59, 58, 20, 21, 22, 23, 31, 30, 29, 28, + 36, 37, 38, 39, 47, 46, 45, 44, 52, 53, 54, 55, 63, 62, 61, 60 +}; + +static const uint8_t ivi4_alternate_scan_4x4[16] = { + 0, 1, 4, 5, 8, 12, 2, 3, 9, 13, 6, 7, 10, 11, 14, 15 +}; + +static const uint8_t ivi4_vertical_scan_4x4[16] = { + 0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15 +}; + +static const uint8_t ivi4_horizontal_scan_4x4[16] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 +}; + +static const uint8_t * const scan_index_to_tab[15] = { + // for 8x8 transforms + ff_zigzag_direct, + ivi4_alternate_scan_8x8, + ff_ivi_horizontal_scan_8x8, + ff_ivi_vertical_scan_8x8, + ff_zigzag_direct, + + // for 4x4 transforms + ff_ivi_direct_scan_4x4, + ivi4_alternate_scan_4x4, + ivi4_vertical_scan_4x4, + ivi4_horizontal_scan_4x4, + ff_ivi_direct_scan_4x4, + + // TODO: check if those are needed + ff_ivi_horizontal_scan_8x8, + ff_ivi_horizontal_scan_8x8, + ff_ivi_horizontal_scan_8x8, + ff_ivi_horizontal_scan_8x8, + ff_ivi_horizontal_scan_8x8 +}; + +/** + * Indeo 4 dequant tables + */ +static const uint16_t ivi4_quant_8x8_intra[9][64] = { + { + 43, 342, 385, 470, 555, 555, 598, 726, + 342, 342, 470, 513, 555, 598, 726, 769, + 385, 470, 555, 555, 598, 726, 726, 811, + 470, 470, 555, 555, 598, 726, 769, 854, + 470, 555, 555, 598, 683, 726, 854, 1025, + 555, 555, 598, 683, 726, 854, 1025, 1153, + 555, 555, 598, 726, 811, 982, 1195, 1451, + 555, 598, 726, 811, 982, 1195, 1451, 1793 + }, + { + 86, 1195, 2390, 2390, 4865, 4865, 4865, 4865, + 1195, 1195, 2390, 2390, 4865, 4865, 4865, 4865, + 2390, 2390, 4865, 4865, 6827, 6827, 6827, 6827, + 2390, 2390, 4865, 4865, 6827, 6827, 6827, 6827, + 4865, 4865, 6827, 6827, 6827, 6827, 6827, 6827, + 4865, 4865, 6827, 6827, 6827, 6827, 6827, 6827, + 4865, 4865, 6827, 6827, 6827, 6827, 6827, 6827, + 4865, 4865, 6827, 6827, 6827, 6827, 6827, 6827 + }, + { + 235, 1067, 1195, 1323, 1451, 1579, 1707, 1835, + 235, 1067, 1195, 1323, 1451, 1579, 1707, 1835, + 235, 1067, 1195, 1323, 1451, 1579, 1707, 1835, + 235, 1067, 1195, 1323, 1451, 1579, 1707, 1835, + 235, 1067, 1195, 1323, 1451, 1579, 1707, 1835, + 235, 1067, 1195, 1323, 1451, 1579, 1707, 1835, + 235, 1067, 1195, 1323, 1451, 1579, 1707, 1835, + 235, 1067, 1195, 1323, 1451, 1579, 1707, 1835 + }, + { + 1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414, + 1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414, + 1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414, + 1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414, + 1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414, + 1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414, + 1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414, + 1707, 1707, 3414, 3414, 3414, 3414, 3414, 3414 + }, + { + 897, 897, 897, 897, 897, 897, 897, 897, + 1067, 1067, 1067, 1067, 1067, 1067, 1067, 1067, + 1238, 1238, 1238, 1238, 1238, 1238, 1238, 1238, + 1409, 1409, 1409, 1409, 1409, 1409, 1409, 1409, + 1579, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + 1750, 1750, 1750, 1750, 1750, 1750, 1750, 1750, + 1921, 1921, 1921, 1921, 1921, 1921, 1921, 1921, + 2091, 2091, 2091, 2091, 2091, 2091, 2091, 2091 + }, + { + 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, + 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, + 3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414, + 3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414, + 3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414, + 3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414, + 3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414, + 3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414 + }, + { + 2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390, + 2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390, + 2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390, + 2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390, + 2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390, + 2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390, + 2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390, + 2390, 2390, 2390, 2390, 2390, 2390, 2390, 2390 + }, + { + 22, 171, 214, 257, 257, 299, 299, 342, + 171, 171, 257, 257, 299, 299, 342, 385, + 214, 257, 257, 299, 299, 342, 342, 385, + 257, 257, 257, 299, 299, 342, 385, 427, + 257, 257, 299, 299, 342, 385, 427, 513, + 257, 299, 299, 342, 385, 427, 513, 598, + 299, 299, 299, 385, 385, 470, 598, 726, + 299, 299, 385, 385, 470, 598, 726, 897 + }, + { + 86, 598, 1195, 1195, 2390, 2390, 2390, 2390, + 598, 598, 1195, 1195, 2390, 2390, 2390, 2390, + 1195, 1195, 2390, 2390, 3414, 3414, 3414, 3414, + 1195, 1195, 2390, 2390, 3414, 3414, 3414, 3414, + 2390, 2390, 3414, 3414, 3414, 3414, 3414, 3414, + 2390, 2390, 3414, 3414, 3414, 3414, 3414, 3414, + 2390, 2390, 3414, 3414, 3414, 3414, 3414, 3414, + 2390, 2390, 3414, 3414, 3414, 3414, 3414, 3414 + } +}; + +static const uint16_t ivi4_quant_8x8_inter[9][64] = { + { + 427, 427, 470, 427, 427, 427, 470, 470, + 427, 427, 470, 427, 427, 427, 470, 470, + 470, 470, 470, 470, 470, 470, 470, 470, + 427, 427, 470, 470, 427, 427, 470, 470, + 427, 427, 470, 427, 427, 427, 470, 470, + 427, 427, 470, 427, 427, 427, 470, 470, + 470, 470, 470, 470, 470, 470, 470, 470, + 470, 470, 470, 470, 470, 470, 470, 470 + }, + { + 1707, 1707, 2433, 2433, 3414, 3414, 3414, 3414, + 1707, 1707, 2433, 2433, 3414, 3414, 3414, 3414, + 2433, 2433, 3414, 3414, 4822, 4822, 4822, 4822, + 2433, 2433, 3414, 3414, 4822, 4822, 4822, 4822, + 3414, 3414, 4822, 4822, 3414, 3414, 3414, 3414, + 3414, 3414, 4822, 4822, 3414, 3414, 3414, 3414, + 3414, 3414, 4822, 4822, 3414, 3414, 3414, 3414, + 3414, 3414, 4822, 4822, 3414, 3414, 3414, 3414 + }, + { + 1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281, + 1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281, + 1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281, + 1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281, + 1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281, + 1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281, + 1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281, + 1195, 1195, 1281, 1238, 1195, 1195, 1281, 1281 + }, + { + 2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433, + 2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433, + 2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433, + 2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433, + 2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433, + 2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433, + 2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433, + 2433, 2433, 3414, 3414, 2433, 2433, 2433, 2433 + }, + { + 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, + 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1238, 1238, 1238, 1238, 1238, 1238, 1238, 1238, + 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, + 1195, 1195, 1195, 1195, 1195, 1195, 1195, 1195, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281, + 1281, 1281, 1281, 1281, 1281, 1281, 1281, 1281 + }, + { + 2433, 2433, 2433, 2433, 2433, 2433, 2433, 2433, + 2433, 2433, 2433, 2433, 2433, 2433, 2433, 2433, + 3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414, + 3414, 3414, 3414, 3414, 3414, 3414, 3414, 3414, + 2433, 2433, 2433, 2433, 2433, 2433, 2433, 2433, + 2433, 2433, 2433, 2433, 2433, 2433, 2433, 2433, + 2433, 2433, 2433, 2433, 2433, 2433, 2433, 2433, + 2433, 2433, 2433, 2433, 2433, 2433, 2433, 2433 + }, + { + 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, + 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, + 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, + 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, + 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, + 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, + 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707, + 1707, 1707, 1707, 1707, 1707, 1707, 1707, 1707 + }, + { + 86, 171, 171, 214, 214, 214, 214, 257, + 171, 171, 214, 214, 214, 214, 257, 257, + 171, 214, 214, 214, 214, 257, 257, 257, + 214, 214, 214, 214, 257, 257, 257, 299, + 214, 214, 214, 257, 257, 257, 299, 299, + 214, 214, 257, 257, 257, 299, 299, 299, + 214, 257, 257, 257, 299, 299, 299, 342, + 257, 257, 257, 299, 299, 299, 342, 342 + }, + { + 854, 854, 1195, 1195, 1707, 1707, 1707, 1707, + 854, 854, 1195, 1195, 1707, 1707, 1707, 1707, + 1195, 1195, 1707, 1707, 2390, 2390, 2390, 2390, + 1195, 1195, 1707, 1707, 2390, 2390, 2390, 2390, + 1707, 1707, 2390, 2390, 1707, 1707, 1707, 1707, + 1707, 1707, 2390, 2390, 1707, 1707, 1707, 1707, + 1707, 1707, 2390, 2390, 1707, 1707, 1707, 1707, + 1707, 1707, 2390, 2390, 1707, 1707, 1707, 1707 + } +}; + +static const uint16_t ivi4_quant_4x4_intra[5][16] = { + { + 22, 214, 257, 299, + 214, 257, 299, 342, + 257, 299, 342, 427, + 299, 342, 427, 513 + }, + { + 129, 1025, 1451, 1451, + 1025, 1025, 1451, 1451, + 1451, 1451, 2049, 2049, + 1451, 1451, 2049, 2049 + }, + { + 43, 171, 171, 171, + 43, 171, 171, 171, + 43, 171, 171, 171, + 43, 171, 171, 171 + }, + { + 43, 43, 43, 43, + 171, 171, 171, 171, + 171, 171, 171, 171, + 171, 171, 171, 171 + }, + { + 43, 43, 43, 43, + 43, 43, 43, 43, + 43, 43, 43, 43, + 43, 43, 43, 43 + } +}; + +static const uint16_t ivi4_quant_4x4_inter[5][16] = { + { + 107, 214, 257, 299, + 214, 257, 299, 299, + 257, 299, 299, 342, + 299, 299, 342, 342 + }, + { + 513, 1025, 1238, 1238, + 1025, 1025, 1238, 1238, + 1238, 1238, 1451, 1451, + 1238, 1238, 1451, 1451 + }, + { + 43, 171, 171, 171, + 43, 171, 171, 171, + 43, 171, 171, 171, + 43, 171, 171, 171 + }, + { + 43, 43, 43, 43, + 171, 171, 171, 171, + 171, 171, 171, 171, + 171, 171, 171, 171 + }, + { + 43, 43, 43, 43, + 43, 43, 43, 43, + 43, 43, 43, 43, + 43, 43, 43, 43 + } +}; + +/** + * Table for mapping quant matrix index from the bitstream + * into internal quant table number. + */ +static const uint8_t quant_index_to_tab[22] = { + 0, 1, 0, 2, 1, 3, 0, 4, 1, 5, 0, 1, 6, 7, 8, // for 8x8 quant matrixes + 0, 1, 2, 2, 3, 3, 4 // for 4x4 quant matrixes +}; + +#endif /* AVCODEC_INDEO4DATA_H */ diff --git a/include/libavcodec/indeo5data.h b/include/libavcodec/indeo5data.h new file mode 100644 index 0000000..a6217d0 --- /dev/null +++ b/include/libavcodec/indeo5data.h @@ -0,0 +1,162 @@ +/* + * Indeo Video Interactive 5 compatible decoder + * Copyright (c) 2009 Maxim Poliakovski + * + * 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 + */ + +/** + * @file + * This file contains data needed for the Indeo5 decoder. + */ + +#ifndef AVCODEC_INDEO5DATA_H +#define AVCODEC_INDEO5DATA_H + +#include + +/** + * standard picture dimensions (width, height divided by 4) + */ +static const uint8_t ivi5_common_pic_sizes[30] = { + 160, 120, 80, 60, 40, 30, 176, 120, 88, 60, 88, 72, 44, 36, 60, 45, 160, 60, + 176, 60, 20, 15, 22, 18, 0, 0, 0, 0, 0, 0 +}; + + +/** + * Indeo5 dequantization matrixes consist of two tables: base table + * and scale table. The base table defines the dequantization matrix + * itself and the scale table tells how this matrix should be scaled + * for a particular quant level (0...24). + * + * ivi5_base_quant_bbb_ttt - base tables for block size 'bbb' of type 'ttt' + * ivi5_scale_quant_bbb_ttt - scale tables for block size 'bbb' of type 'ttt' + */ +static const uint16_t ivi5_base_quant_8x8_inter[5][64] = { + {0x26, 0x3a, 0x3e, 0x46, 0x4a, 0x4e, 0x52, 0x5a, 0x3a, 0x3e, 0x42, 0x46, 0x4a, 0x4e, 0x56, 0x5e, + 0x3e, 0x42, 0x46, 0x48, 0x4c, 0x52, 0x5a, 0x62, 0x46, 0x46, 0x48, 0x4a, 0x4e, 0x56, 0x5e, 0x66, + 0x4a, 0x4a, 0x4c, 0x4e, 0x52, 0x5a, 0x62, 0x6a, 0x4e, 0x4e, 0x52, 0x56, 0x5a, 0x5e, 0x66, 0x6e, + 0x52, 0x56, 0x5a, 0x5e, 0x62, 0x66, 0x6a, 0x72, 0x5a, 0x5e, 0x62, 0x66, 0x6a, 0x6e, 0x72, 0x76, + }, + {0x26, 0x3a, 0x3e, 0x46, 0x4a, 0x4e, 0x52, 0x5a, 0x3a, 0x3e, 0x42, 0x46, 0x4a, 0x4e, 0x56, 0x5e, + 0x3e, 0x42, 0x46, 0x48, 0x4c, 0x52, 0x5a, 0x62, 0x46, 0x46, 0x48, 0x4a, 0x4e, 0x56, 0x5e, 0x66, + 0x4a, 0x4a, 0x4c, 0x4e, 0x52, 0x5a, 0x62, 0x6a, 0x4e, 0x4e, 0x52, 0x56, 0x5a, 0x5e, 0x66, 0x6e, + 0x52, 0x56, 0x5a, 0x5e, 0x62, 0x66, 0x6a, 0x72, 0x5a, 0x5e, 0x62, 0x66, 0x6a, 0x6e, 0x72, 0x76, + }, + {0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, + 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, + 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, + 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, + }, + {0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, + 0xde, 0xde, 0xde, 0xde, 0xde, 0xde, 0xde, 0xde, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, + 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, + }, + {0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, + 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, + 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, + 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, + } +}; + +static const uint16_t ivi5_base_quant_8x8_intra[5][64] = { + {0x1a, 0x2e, 0x36, 0x42, 0x46, 0x4a, 0x4e, 0x5a, 0x2e, 0x32, 0x3e, 0x42, 0x46, 0x4e, 0x56, 0x6a, + 0x36, 0x3e, 0x3e, 0x44, 0x4a, 0x54, 0x66, 0x72, 0x42, 0x42, 0x44, 0x4a, 0x52, 0x62, 0x6c, 0x7a, + 0x46, 0x46, 0x4a, 0x52, 0x5e, 0x66, 0x72, 0x8e, 0x4a, 0x4e, 0x54, 0x62, 0x66, 0x6e, 0x86, 0xa6, + 0x4e, 0x56, 0x66, 0x6c, 0x72, 0x86, 0x9a, 0xca, 0x5a, 0x6a, 0x72, 0x7a, 0x8e, 0xa6, 0xca, 0xfe, + }, + {0x26, 0x3a, 0x3e, 0x46, 0x4a, 0x4e, 0x52, 0x5a, 0x3a, 0x3e, 0x42, 0x46, 0x4a, 0x4e, 0x56, 0x5e, + 0x3e, 0x42, 0x46, 0x48, 0x4c, 0x52, 0x5a, 0x62, 0x46, 0x46, 0x48, 0x4a, 0x4e, 0x56, 0x5e, 0x66, + 0x4a, 0x4a, 0x4c, 0x4e, 0x52, 0x5a, 0x62, 0x6a, 0x4e, 0x4e, 0x52, 0x56, 0x5a, 0x5e, 0x66, 0x6e, + 0x52, 0x56, 0x5a, 0x5e, 0x62, 0x66, 0x6a, 0x72, 0x5a, 0x5e, 0x62, 0x66, 0x6a, 0x6e, 0x72, 0x76, + }, + {0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, + 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, + 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, + 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, 0x4e, 0xaa, 0xf2, 0xd4, 0xde, 0xc2, 0xd6, 0xc2, + }, + {0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0x4e, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, + 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xf2, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, 0xd4, + 0xde, 0xde, 0xde, 0xde, 0xde, 0xde, 0xde, 0xde, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, + 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xd6, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, 0xc2, + }, + {0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, + 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, + 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, + 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, 0x5e, + } +}; + +static const uint16_t ivi5_base_quant_4x4_inter[16] = { + 0x1e, 0x3e, 0x4a, 0x52, 0x3e, 0x4a, 0x52, 0x56, 0x4a, 0x52, 0x56, 0x5e, 0x52, 0x56, 0x5e, 0x66 +}; + +static const uint16_t ivi5_base_quant_4x4_intra[16] = { + 0x1e, 0x3e, 0x4a, 0x52, 0x3e, 0x4a, 0x52, 0x5e, 0x4a, 0x52, 0x5e, 0x7a, 0x52, 0x5e, 0x7a, 0x92 +}; + + +static const uint8_t ivi5_scale_quant_8x8_inter[5][24] = { + {0x0b, 0x11, 0x13, 0x14, 0x15, 0x16, 0x18, 0x1a, 0x1b, 0x1d, 0x20, 0x22, + 0x23, 0x25, 0x28, 0x2a, 0x2e, 0x32, 0x35, 0x39, 0x3d, 0x41, 0x44, 0x4a, + }, + {0x07, 0x14, 0x16, 0x18, 0x1b, 0x1e, 0x22, 0x25, 0x29, 0x2d, 0x31, 0x35, + 0x3a, 0x3f, 0x44, 0x4a, 0x50, 0x56, 0x5c, 0x63, 0x6a, 0x71, 0x78, 0x7e, + }, + {0x15, 0x25, 0x28, 0x2d, 0x30, 0x34, 0x3a, 0x3d, 0x42, 0x48, 0x4c, 0x51, + 0x56, 0x5b, 0x60, 0x65, 0x6b, 0x70, 0x76, 0x7c, 0x82, 0x88, 0x8f, 0x97, + }, + {0x13, 0x1f, 0x20, 0x22, 0x25, 0x28, 0x2b, 0x2d, 0x30, 0x33, 0x36, 0x39, + 0x3c, 0x3f, 0x42, 0x45, 0x48, 0x4b, 0x4e, 0x52, 0x56, 0x5a, 0x5e, 0x62, + }, + {0x3c, 0x52, 0x58, 0x5d, 0x63, 0x68, 0x68, 0x6d, 0x73, 0x78, 0x7c, 0x80, + 0x84, 0x89, 0x8e, 0x93, 0x98, 0x9d, 0xa3, 0xa9, 0xad, 0xb1, 0xb5, 0xba, + }, +}; + +static const uint8_t ivi5_scale_quant_8x8_intra[5][24] = { + {0x0b, 0x0e, 0x10, 0x12, 0x14, 0x16, 0x17, 0x18, 0x1a, 0x1c, 0x1e, 0x20, + 0x22, 0x24, 0x27, 0x28, 0x2a, 0x2d, 0x2f, 0x31, 0x34, 0x37, 0x39, 0x3c, + }, + {0x01, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1b, 0x1e, 0x22, 0x25, 0x28, 0x2c, + 0x30, 0x34, 0x38, 0x3d, 0x42, 0x47, 0x4c, 0x52, 0x58, 0x5e, 0x65, 0x6c, + }, + {0x13, 0x22, 0x27, 0x2a, 0x2d, 0x33, 0x36, 0x3c, 0x41, 0x45, 0x49, 0x4e, + 0x53, 0x58, 0x5d, 0x63, 0x69, 0x6f, 0x75, 0x7c, 0x82, 0x88, 0x8e, 0x95, + }, + {0x13, 0x1f, 0x21, 0x24, 0x27, 0x29, 0x2d, 0x2f, 0x34, 0x37, 0x3a, 0x3d, + 0x40, 0x44, 0x48, 0x4c, 0x4f, 0x52, 0x56, 0x5a, 0x5e, 0x62, 0x66, 0x6b, + }, + {0x31, 0x42, 0x47, 0x47, 0x4d, 0x52, 0x58, 0x58, 0x5d, 0x63, 0x67, 0x6b, + 0x6f, 0x73, 0x78, 0x7c, 0x80, 0x84, 0x89, 0x8e, 0x93, 0x98, 0x9d, 0xa4, + } +}; + +static const uint8_t ivi5_scale_quant_4x4_inter[24] = { + 0x0b, 0x0d, 0x0d, 0x0e, 0x11, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, +}; + +static const uint8_t ivi5_scale_quant_4x4_intra[24] = { + 0x01, 0x0b, 0x0b, 0x0d, 0x0d, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x13, 0x14, + 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20 +}; + + +#endif /* AVCODEC_INDEO5DATA_H */ diff --git a/include/libavcodec/internal.h b/include/libavcodec/internal.h new file mode 100644 index 0000000..98ab279 --- /dev/null +++ b/include/libavcodec/internal.h @@ -0,0 +1,202 @@ +/* + * 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 + */ + +/** + * @file + * common internal api header. + */ + +#ifndef AVCODEC_INTERNAL_H +#define AVCODEC_INTERNAL_H + +#include + +#include "libavutil/channel_layout.h" +#include "avcodec.h" +#include "config.h" + +#if CONFIG_LCMS2 +# include "fflcms2.h" +#endif + +#define FF_SANE_NB_CHANNELS 512U + +#if HAVE_SIMD_ALIGN_64 +# define STRIDE_ALIGN 64 /* AVX-512 */ +#elif HAVE_SIMD_ALIGN_32 +# define STRIDE_ALIGN 32 +#elif HAVE_SIMD_ALIGN_16 +# define STRIDE_ALIGN 16 +#else +# define STRIDE_ALIGN 8 +#endif + +typedef struct AVCodecInternal { + /** + * When using frame-threaded decoding, this field is set for the first + * worker thread (e.g. to decode extradata just once). + */ + int is_copy; + + /** + * This field is set to 1 when frame threading is being used and the parent + * AVCodecContext of this AVCodecInternal is a worker-thread context (i.e. + * one of those actually doing the decoding), 0 otherwise. + */ + int is_frame_mt; + + /** + * Audio encoders can set this flag during init to indicate that they + * want the small last frame to be padded to a multiple of pad_samples. + */ + int pad_samples; + + struct FramePool *pool; + + struct FFRefStructPool *progress_frame_pool; + + void *thread_ctx; + + /** + * This packet is used to hold the packet given to decoders + * implementing the .decode API; it is unused by the generic + * code for decoders implementing the .receive_frame API and + * may be freely used (but not freed) by them with the caveat + * that the packet will be unreferenced generically in + * avcodec_flush_buffers(). + */ + AVPacket *in_pkt; + struct AVBSFContext *bsf; + + /** + * Properties (timestamps+side data) extracted from the last packet passed + * for decoding. + */ + AVPacket *last_pkt_props; + + /** + * temporary buffer used for encoders to store their bitstream + */ + uint8_t *byte_buffer; + unsigned int byte_buffer_size; + + void *frame_thread_encoder; + + /** + * The input frame is stored here for encoders implementing the simple + * encode API. + * + * Not allocated in other cases. + */ + AVFrame *in_frame; + + /** + * When the AV_CODEC_FLAG_RECON_FRAME flag is used. the encoder should store + * here the reconstructed frame corresponding to the last returned packet. + * + * Not allocated in other cases. + */ + AVFrame *recon_frame; + + /** + * If this is set, then FFCodec->close (if existing) needs to be called + * for the parent AVCodecContext. + */ + int needs_close; + + /** + * Number of audio samples to skip at the start of the next decoded frame + */ + int skip_samples; + + /** + * hwaccel-specific private data + */ + void *hwaccel_priv_data; + + /** + * decoding: AVERROR_EOF has been returned from ff_decode_get_packet(); must + * not be used by decoders that use the decode() callback, as they + * do not call ff_decode_get_packet() directly. + * + * encoding: a flush frame has been submitted to avcodec_send_frame(). + */ + int draining; + + /** + * Temporary buffers for newly received or not yet output packets/frames. + */ + AVPacket *buffer_pkt; + AVFrame *buffer_frame; + int draining_done; + +#if FF_API_DROPCHANGED + /* used when avctx flag AV_CODEC_FLAG_DROPCHANGED is set */ + int changed_frames_dropped; + int initial_format; + int initial_width, initial_height; + int initial_sample_rate; + AVChannelLayout initial_ch_layout; +#endif + +#if CONFIG_LCMS2 + FFIccContext icc; /* used to read and write embedded ICC profiles */ +#endif + + /** + * Set when the user has been warned about a failed allocation from + * a fixed frame pool. + */ + int warned_on_failed_allocation_from_fixed_pool; +} AVCodecInternal; + +/** + * Return the index into tab at which {a,b} match elements {[0],[1]} of tab. + * If there is no such matching pair then size is returned. + */ +int ff_match_2uint16(const uint16_t (*tab)[2], int size, int a, int b); + +unsigned int ff_toupper4(unsigned int x); + +int avpriv_h264_has_num_reorder_frames(AVCodecContext *avctx); + +int avpriv_codec_get_cap_skip_frame_fill_param(const AVCodec *codec); + +/** + * Check AVFrame for S12M timecode side data and allocate and fill TC SEI message with timecode info + * + * @param frame Raw frame to get S12M timecode side data from + * @param rate The frame rate + * @param prefix_len Number of bytes to allocate before SEI message + * @param data Pointer to a variable to store allocated memory + * Upon return the variable will hold NULL on error or if frame has no S12M timecode info. + * Otherwise it will point to prefix_len uninitialized bytes followed by + * *sei_size SEI message + * @param sei_size Pointer to a variable to store generated SEI message length + * @return Zero on success, negative error code on failure + */ +int ff_alloc_timecode_sei(const AVFrame *frame, AVRational rate, size_t prefix_len, + void **data, size_t *sei_size); + +/** + * Get an estimated video bitrate based on frame size, frame rate and coded + * bits per pixel. + */ +int64_t ff_guess_coded_bitrate(AVCodecContext *avctx); + +#endif /* AVCODEC_INTERNAL_H */ diff --git a/include/libavcodec/intrax8.h b/include/libavcodec/intrax8.h new file mode 100644 index 0000000..b9f8c42 --- /dev/null +++ b/include/libavcodec/intrax8.h @@ -0,0 +1,114 @@ +/* + * 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_INTRAX8_H +#define AVCODEC_INTRAX8_H + +#include "blockdsp.h" +#include "get_bits.h" +#include "intrax8dsp.h" +#include "wmv2dsp.h" +#include "mpegpicture.h" + +typedef struct IntraX8Context { + const VLCElem *j_ac_vlc_table[4]; // they point to the static j_mb_vlc.table + const VLCElem *j_orient_vlc_table; + const VLCElem *j_dc_vlc_table[3]; + + int use_quant_matrix; + + // set by ff_intrax8_common_init + uint8_t *prediction_table; // 2 * (mb_w * 2) + uint8_t permutated_scantable[3][64]; + WMV2DSPContext wdsp; + uint8_t idct_permutation[64]; + AVCodecContext *avctx; + int *block_last_index; ///< last nonzero coefficient in block + int16_t (*block)[64]; + + // set by the caller codec + IntraX8DSPContext dsp; + BlockDSPContext bdsp; + int quant; + int dquant; + int qsum; + int loopfilter; + AVFrame *frame; + GetBitContext *gb; + + // calculated per frame + int quant_dc_chroma; + int divide_quant_dc_luma; + int divide_quant_dc_chroma; + uint8_t *dest[3]; + uint8_t scratchpad[42]; // size of the block is fixed (8x8 plus padding) + + // changed per block + int edges; + int flat_dc; + int predicted_dc; + int raw_orient; + int chroma_orient; + int orient; + int est_run; + + // block props + int mb_x, mb_y; + int mb_width, mb_height; +} IntraX8Context; + +/** + * Initialize IntraX8 frame decoder. + * @param avctx pointer to AVCodecContext + * @param w pointer to IntraX8Context + * @param block pointer to block array + * @param block_last_index pointer to index array + * @param mb_width macroblock width + * @param mb_height macroblock height + * @return 0 on success, a negative AVERROR value on error + */ +int ff_intrax8_common_init(AVCodecContext *avctx, + IntraX8Context *w, + int16_t (*block)[64], + int block_last_index[12], + int mb_width, int mb_height); + +/** + * Destroy IntraX8 frame structure. + * @param w pointer to IntraX8Context + */ +void ff_intrax8_common_end(IntraX8Context *w); + +/** + * Decode single IntraX8 frame. + * lowres decoding is theoretically impossible. + * @param w pointer to IntraX8Context + * @param pict the output Picture containing an AVFrame + * @param gb open bitstream reader + * @param mb_x pointer to the x coordinate of the current macroblock + * @param mb_y pointer to the y coordinate of the current macroblock + * @param dquant doubled quantizer, it would be odd in case of VC-1 halfpq==1. + * @param quant_offset offset away from zero + * @param loopfilter enable filter after decoding a block + */ +int ff_intrax8_decode_picture(IntraX8Context *w, MPVPicture *pict, + GetBitContext *gb, int *mb_x, int *mb_y, + int quant, int halfpq, + int loopfilter, int lowdelay); + +#endif /* AVCODEC_INTRAX8_H */ diff --git a/include/libavcodec/intrax8dsp.h b/include/libavcodec/intrax8dsp.h new file mode 100644 index 0000000..bf42698 --- /dev/null +++ b/include/libavcodec/intrax8dsp.h @@ -0,0 +1,38 @@ +/* + * 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_INTRAX8DSP_H +#define AVCODEC_INTRAX8DSP_H + +#include +#include + +typedef struct IntraX8DSPContext { + void (*v_loop_filter)(uint8_t *src, ptrdiff_t stride, int qscale); + void (*h_loop_filter)(uint8_t *src, ptrdiff_t stride, int qscale); + + void (*spatial_compensation[12])(uint8_t *src, uint8_t *dst, + ptrdiff_t stride); + void (*setup_spatial_compensation)(uint8_t *src, uint8_t *dst, + ptrdiff_t stride, int *range, + int *sum, int edges); +} IntraX8DSPContext; + +void ff_intrax8dsp_init(IntraX8DSPContext *dsp); + +#endif /* AVCODEC_INTRAX8DSP_H */ diff --git a/include/libavcodec/intrax8huf.h b/include/libavcodec/intrax8huf.h new file mode 100644 index 0000000..f91b672 --- /dev/null +++ b/include/libavcodec/intrax8huf.h @@ -0,0 +1,799 @@ +/* + * 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_INTRAX8HUF_H +#define AVCODEC_INTRAX8HUF_H + +#include + +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 }, + }, + { /* 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 }, + }, + { /* 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 }, + }, + { /* 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 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 }, + }, + { /* 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 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 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 + +#endif /* AVCODEC_INTRAX8HUF_H */ diff --git a/include/libavcodec/itut35.h b/include/libavcodec/itut35.h new file mode 100644 index 0000000..a75ef37 --- /dev/null +++ b/include/libavcodec/itut35.h @@ -0,0 +1,32 @@ +/* + * 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_ITUT35_H +#define AVCODEC_ITUT35_H + +#define ITU_T_T35_COUNTRY_CODE_CN 0x26 +#define ITU_T_T35_COUNTRY_CODE_UK 0xB4 +#define ITU_T_T35_COUNTRY_CODE_US 0xB5 + +#define ITU_T_T35_PROVIDER_CODE_ATSC 0x31 +#define ITU_T_T35_PROVIDER_CODE_CUVA 0x04 +#define ITU_T_T35_PROVIDER_CODE_DOLBY 0x3B +#define ITU_T_T35_PROVIDER_CODE_LCEVC 0x50 +#define ITU_T_T35_PROVIDER_CODE_SMTPE 0x3C + +#endif /* AVCODEC_ITUT35_H */ diff --git a/include/libavcodec/ivi.h b/include/libavcodec/ivi.h new file mode 100644 index 0000000..afc3ec2 --- /dev/null +++ b/include/libavcodec/ivi.h @@ -0,0 +1,341 @@ +/* + * common functions for Indeo Video Interactive codecs (Indeo4 and Indeo5) + * + * Copyright (c) 2009 Maxim Poliakovski + * + * 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 + */ + +/** + * @file + * This file contains structures and macros shared by both Indeo4 and + * Indeo5 decoders. + */ + +#ifndef AVCODEC_IVI_H +#define AVCODEC_IVI_H + +#include "avcodec.h" +#include "get_bits.h" +#include + +/** + * Indeo 4 frame types. + */ +enum { + IVI4_FRAMETYPE_INTRA = 0, + IVI4_FRAMETYPE_INTRA1 = 1, ///< intra frame with slightly different bitstream coding + IVI4_FRAMETYPE_INTER = 2, ///< non-droppable P-frame + IVI4_FRAMETYPE_BIDIR = 3, ///< bidirectional frame + IVI4_FRAMETYPE_INTER_NOREF = 4, ///< droppable P-frame + IVI4_FRAMETYPE_NULL_FIRST = 5, ///< empty frame with no data + IVI4_FRAMETYPE_NULL_LAST = 6 ///< empty frame with no data +}; + +#define IVI_VLC_BITS 13 ///< max number of bits of the ivi's huffman codes +#define IVI5_IS_PROTECTED 0x20 + +/** + * huffman codebook descriptor + */ +typedef struct IVIHuffDesc { + int32_t num_rows; + uint8_t xbits[16]; +} IVIHuffDesc; + +/** + * macroblock/block huffman table descriptor + */ +typedef struct IVIHuffTab { + int32_t tab_sel; ///< index of one of the predefined tables, or "7" for custom one + VLC *tab; ///< pointer to the table associated with tab_sel + + // the following are used only when tab_sel == 7 + IVIHuffDesc cust_desc; ///< custom Huffman codebook descriptor + VLC cust_tab; ///< vlc table for custom codebook +} IVIHuffTab; + +enum { + IVI_MB_HUFF = 0, ///< Huffman table is used for coding macroblocks + IVI_BLK_HUFF = 1 ///< Huffman table is used for coding blocks +}; + + +/** + * Common scan patterns (defined in ivi_common.c) + */ +extern const uint8_t ff_ivi_vertical_scan_8x8[64]; +extern const uint8_t ff_ivi_horizontal_scan_8x8[64]; +extern const uint8_t ff_ivi_direct_scan_4x4[16]; + + +/** + * Declare inverse transform function types + */ +typedef void (InvTransformPtr)(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags); +typedef void (DCTransformPtr) (const int32_t *in, int16_t *out, ptrdiff_t pitch, int blk_size); + + +/** + * run-value (RLE) table descriptor + */ +typedef struct RVMapDesc { + uint8_t eob_sym; ///< end of block symbol + uint8_t esc_sym; ///< escape symbol + uint8_t runtab[256]; + int8_t valtab[256]; +} RVMapDesc; + +extern const RVMapDesc ff_ivi_rvmap_tabs[9]; + + +/** + * information for Indeo macroblock (16x16, 8x8 or 4x4) + */ +typedef struct IVIMbInfo { + int16_t xpos; + int16_t ypos; + uint32_t buf_offs; ///< address in the output buffer for this mb + uint8_t type; ///< macroblock type: 0 - INTRA, 1 - INTER + uint8_t cbp; ///< coded block pattern + int8_t q_delta; ///< quant delta + int8_t mv_x; ///< motion vector (x component) + int8_t mv_y; ///< motion vector (y component) + int8_t b_mv_x; ///< second motion vector (x component) + int8_t b_mv_y; ///< second motion vector (y component) +} IVIMbInfo; + + +/** + * information for Indeo tile + */ +typedef struct IVITile { + int xpos; + int ypos; + int width; + int height; + int mb_size; + int is_empty; ///< = 1 if this tile doesn't contain any data + int data_size; ///< size of the data in bytes + int num_MBs; ///< number of macroblocks in this tile + IVIMbInfo *mbs; ///< array of macroblock descriptors + IVIMbInfo *ref_mbs; ///< ptr to the macroblock descriptors of the reference tile +} IVITile; + + +/** + * information for Indeo wavelet band + */ +typedef struct IVIBandDesc { + int plane; ///< plane number this band belongs to + int band_num; ///< band number + int width; + int height; + int aheight; ///< aligned band height + const uint8_t *data_ptr; ///< ptr to the first byte of the band data + int data_size; ///< size of the band data + int16_t *buf; ///< pointer to the output buffer for this band + int16_t *ref_buf; ///< pointer to the reference frame buffer (for motion compensation) + int16_t *b_ref_buf; ///< pointer to the second reference frame buffer (for motion compensation) + int16_t *bufs[4]; ///< array of pointers to the band buffers + ptrdiff_t pitch; ///< pitch associated with the buffers above + int is_empty; ///< = 1 if this band doesn't contain any data + int mb_size; ///< macroblock size + int blk_size; ///< block size + int is_halfpel; ///< precision of the motion compensation: 0 - fullpel, 1 - halfpel + int inherit_mv; ///< tells if motion vector is inherited from reference macroblock + int inherit_qdelta; ///< tells if quantiser delta is inherited from reference macroblock + int qdelta_present; ///< tells if Qdelta signal is present in the bitstream (Indeo5 only) + int quant_mat; ///< dequant matrix index + int glob_quant; ///< quant base for this band + const uint8_t *scan; ///< ptr to the scan pattern + int scan_size; ///< size of the scantable + + IVIHuffTab blk_vlc; ///< vlc table for decoding block data + + int num_corr; ///< number of correction entries + uint8_t corr[61*2]; ///< rvmap correction pairs + int rvmap_sel; ///< rvmap table selector + RVMapDesc *rv_map; ///< ptr to the RLE table for this band + int num_tiles; ///< number of tiles in this band + IVITile *tiles; ///< array of tile descriptors + InvTransformPtr *inv_transform; + int transform_size; + DCTransformPtr *dc_transform; + int is_2d_trans; ///< 1 indicates that the two-dimensional inverse transform is used + int32_t checksum; ///< for debug purposes + int checksum_present; + int bufsize; ///< band buffer size in bytes + const uint16_t *intra_base; ///< quantization matrix for intra blocks + const uint16_t *inter_base; ///< quantization matrix for inter blocks + const uint8_t *intra_scale; ///< quantization coefficient for intra blocks + const uint8_t *inter_scale; ///< quantization coefficient for inter blocks +} IVIBandDesc; + + +/** + * color plane (luma or chroma) information + */ +typedef struct IVIPlaneDesc { + uint16_t width; + uint16_t height; + uint8_t num_bands; ///< number of bands this plane subdivided into + IVIBandDesc *bands; ///< array of band descriptors +} IVIPlaneDesc; + + +typedef struct IVIPicConfig { + uint16_t pic_width; + uint16_t pic_height; + uint16_t chroma_width; + uint16_t chroma_height; + uint16_t tile_width; + uint16_t tile_height; + uint8_t luma_bands; + uint8_t chroma_bands; +} IVIPicConfig; + +typedef struct IVI45DecContext { + GetBitContext gb; + RVMapDesc rvmap_tabs[9]; ///< local corrected copy of the static rvmap tables + + uint32_t frame_num; + int frame_type; + int prev_frame_type; ///< frame type of the previous frame + uint32_t data_size; ///< size of the frame data in bytes from picture header + int is_scalable; + const uint8_t *frame_data; ///< input frame data pointer + int inter_scal; ///< signals a sequence of scalable inter frames + uint32_t frame_size; ///< frame size in bytes + uint32_t pic_hdr_size; ///< picture header size in bytes + uint8_t frame_flags; + uint16_t checksum; ///< frame checksum + + IVIPicConfig pic_conf; + IVIPlaneDesc planes[3]; ///< color planes + + int buf_switch; ///< used to switch between three buffers + int dst_buf; ///< buffer index for the currently decoded frame + int ref_buf; ///< inter frame reference buffer index + int ref2_buf; ///< temporal storage for switching buffers + int b_ref_buf; ///< second reference frame buffer index + + IVIHuffTab mb_vlc; ///< current macroblock table descriptor + IVIHuffTab blk_vlc; ///< current block table descriptor + + uint8_t rvmap_sel; + uint8_t in_imf; + uint8_t in_q; ///< flag for explicitly stored quantiser delta + uint8_t pic_glob_quant; + uint8_t unknown1; + + uint16_t gop_hdr_size; + uint8_t gop_flags; + uint32_t lock_word; + + int show_indeo4_info; + uint8_t has_b_frames; + uint8_t has_transp; ///< transparency mode status: 1 - enabled + uint8_t uses_tiling; + uint8_t uses_haar; + uint8_t uses_fullpel; + + int (*decode_pic_hdr) (struct IVI45DecContext *ctx, AVCodecContext *avctx); + int (*decode_band_hdr) (struct IVI45DecContext *ctx, IVIBandDesc *band, AVCodecContext *avctx); + int (*decode_mb_info) (struct IVI45DecContext *ctx, IVIBandDesc *band, IVITile *tile, AVCodecContext *avctx); + void (*switch_buffers) (struct IVI45DecContext *ctx); + int (*is_nonnull_frame)(struct IVI45DecContext *ctx); + + int gop_invalid; + int buf_invalid[4]; + + int is_indeo4; + + AVFrame *p_frame; + int got_p_frame; +} IVI45DecContext; + +/** compare some properties of two pictures */ +static inline int ivi_pic_config_cmp(IVIPicConfig *str1, IVIPicConfig *str2) +{ + return str1->pic_width != str2->pic_width || str1->pic_height != str2->pic_height || + str1->chroma_width != str2->chroma_width || str1->chroma_height != str2->chroma_height || + str1->tile_width != str2->tile_width || str1->tile_height != str2->tile_height || + str1->luma_bands != str2->luma_bands || str1->chroma_bands != str2->chroma_bands; +} + +/** calculate number of tiles in a stride */ +#define IVI_NUM_TILES(stride, tile_size) (((stride) + (tile_size) - 1) / (tile_size)) + +/** calculate number of macroblocks in a tile */ +#define IVI_MBs_PER_TILE(tile_width, tile_height, mb_size) \ + ((((tile_width) + (mb_size) - 1) / (mb_size)) * (((tile_height) + (mb_size) - 1) / (mb_size))) + +/** convert unsigned values into signed ones (the sign is in the LSB) */ +#define IVI_TOSIGNED(val) (-(((val) >> 1) ^ -((val) & 1))) + +/** scale motion vector */ +static inline int ivi_scale_mv(int mv, int mv_scale) +{ + return (mv + (mv > 0) + (mv_scale - 1)) >> mv_scale; +} + +/** + * Initialize static codes used for macroblock and block decoding. + */ +void ff_ivi_init_static_vlc(void); + +/** + * Decode a huffman codebook descriptor from the bitstream + * and select specified huffman table. + * + * @param[in,out] gb the GetBit context + * @param[in] desc_coded flag signalling if table descriptor was coded + * @param[in] which_tab codebook purpose (IVI_MB_HUFF or IVI_BLK_HUFF) + * @param[out] huff_tab pointer to the descriptor of the selected table + * @param[in] avctx AVCodecContext pointer + * @return zero on success, negative value otherwise + */ +int ff_ivi_dec_huff_desc(GetBitContext *gb, int desc_coded, int which_tab, + IVIHuffTab *huff_tab, AVCodecContext *avctx); + +/** + * Initialize planes (prepares descriptors, allocates buffers etc). + * + * @param[in,out] planes pointer to the array of the plane descriptors + * @param[in] cfg pointer to the ivi_pic_config structure describing picture layout + * @param[in] is_indeo4 flag signalling if it is Indeo 4 or not + * @return result code: 0 - OK + */ +int ff_ivi_init_planes(AVCodecContext *avctx, IVIPlaneDesc *planes, + const IVIPicConfig *cfg, int is_indeo4); + +/** + * Initialize tile and macroblock descriptors. + * + * @param[in,out] planes pointer to the array of the plane descriptors + * @param[in] tile_width tile width + * @param[in] tile_height tile height + * @return result code: 0 - OK + */ +int ff_ivi_init_tiles(IVIPlaneDesc *planes, int tile_width, int tile_height); + +int ff_ivi_decode_frame(AVCodecContext *avctx, AVFrame *data, + int *got_frame, AVPacket *avpkt); +int ff_ivi_decode_close(AVCodecContext *avctx); + +#endif /* AVCODEC_IVI_H */ diff --git a/include/libavcodec/ivi_dsp.h b/include/libavcodec/ivi_dsp.h new file mode 100644 index 0000000..2704d2b --- /dev/null +++ b/include/libavcodec/ivi_dsp.h @@ -0,0 +1,348 @@ +/* + * DSP functions for Indeo Video Interactive codecs (Indeo4 and Indeo5) + * + * Copyright (c) 2009-2011 Maxim Poliakovski + * + * 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 + */ + +/** + * @file + * DSP functions (inverse transforms, motion compensations, wavelet recomposition) + * for Indeo Video Interactive codecs. + */ + +#ifndef AVCODEC_IVI_DSP_H +#define AVCODEC_IVI_DSP_H + +#include +#include + +#include "ivi.h" + +/** + * 5/3 wavelet recomposition filter for Indeo5 + * + * @param[in] plane pointer to the descriptor of the plane being processed + * @param[out] dst pointer to the destination buffer + * @param[in] dst_pitch pitch of the destination buffer + */ +void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst, + const ptrdiff_t dst_pitch); + +/** + * Haar wavelet recomposition filter for Indeo 4 + * + * @param[in] plane pointer to the descriptor of the plane being processed + * @param[out] dst pointer to the destination buffer + * @param[in] dst_pitch pitch of the destination buffer + */ +void ff_ivi_recompose_haar(const IVIPlaneDesc *plane, uint8_t *dst, + const ptrdiff_t dst_pitch); + +/** + * two-dimensional inverse Haar 8x8 transform for Indeo 4 + * + * @param[in] in pointer to the vector of transform coefficients + * @param[out] out pointer to the output buffer (frame) + * @param[in] pitch pitch to move to the next y line + * @param[in] flags pointer to the array of column flags: + * != 0 - non_empty column, 0 - empty one + * (this array must be filled by caller) + */ +void ff_ivi_inverse_haar_8x8(const int32_t *in, int16_t *out, ptrdiff_t pitch, + const uint8_t *flags); +void ff_ivi_inverse_haar_8x1(const int32_t *in, int16_t *out, uint32_t pitch, + const uint8_t *flags); +void ff_ivi_inverse_haar_1x8(const int32_t *in, int16_t *out, uint32_t pitch, + const uint8_t *flags); + +/** + * one-dimensional inverse 8-point Haar transform on rows for Indeo 4 + * + * @param[in] in pointer to the vector of transform coefficients + * @param[out] out pointer to the output buffer (frame) + * @param[in] pitch pitch to move to the next y line + * @param[in] flags pointer to the array of column flags: + * != 0 - non_empty column, 0 - empty one + * (this array must be filled by caller) + */ +void ff_ivi_row_haar8(const int32_t *in, int16_t *out, ptrdiff_t pitch, + const uint8_t *flags); + +/** + * one-dimensional inverse 8-point Haar transform on columns for Indeo 4 + * + * @param[in] in pointer to the vector of transform coefficients + * @param[out] out pointer to the output buffer (frame) + * @param[in] pitch pitch to move to the next y line + * @param[in] flags pointer to the array of column flags: + * != 0 - non_empty column, 0 - empty one + * (this array must be filled by caller) + */ +void ff_ivi_col_haar8(const int32_t *in, int16_t *out, ptrdiff_t pitch, + const uint8_t *flags); + +/** + * two-dimensional inverse Haar 4x4 transform for Indeo 4 + * + * @param[in] in pointer to the vector of transform coefficients + * @param[out] out pointer to the output buffer (frame) + * @param[in] pitch pitch to move to the next y line + * @param[in] flags pointer to the array of column flags: + * != 0 - non_empty column, 0 - empty one + * (this array must be filled by caller) + */ +void ff_ivi_inverse_haar_4x4(const int32_t *in, int16_t *out, ptrdiff_t pitch, + const uint8_t *flags); + +/** + * one-dimensional inverse 4-point Haar transform on rows for Indeo 4 + * + * @param[in] in pointer to the vector of transform coefficients + * @param[out] out pointer to the output buffer (frame) + * @param[in] pitch pitch to move to the next y line + * @param[in] flags pointer to the array of column flags: + * != 0 - non_empty column, 0 - empty one + * (this array must be filled by caller) + */ +void ff_ivi_row_haar4(const int32_t *in, int16_t *out, ptrdiff_t pitch, + const uint8_t *flags); + +/** + * one-dimensional inverse 4-point Haar transform on columns for Indeo 4 + * + * @param[in] in pointer to the vector of transform coefficients + * @param[out] out pointer to the output buffer (frame) + * @param[in] pitch pitch to move to the next y line + * @param[in] flags pointer to the array of column flags: + * != 0 - non_empty column, 0 - empty one + * (this array must be filled by caller) + */ +void ff_ivi_col_haar4(const int32_t *in, int16_t *out, ptrdiff_t pitch, + const uint8_t *flags); + +/** + * DC-only two-dimensional inverse Haar transform for Indeo 4. + * Performing the inverse transform in this case is equivalent to + * spreading DC_coeff >> 3 over the whole block. + * + * @param[in] in pointer to the dc coefficient + * @param[out] out pointer to the output buffer (frame) + * @param[in] pitch pitch to move to the next y line + * @param[in] blk_size transform block size + */ +void ff_ivi_dc_haar_2d(const int32_t *in, int16_t *out, ptrdiff_t pitch, + int blk_size); + +/** + * two-dimensional inverse slant 8x8 transform + * + * @param[in] in pointer to the vector of transform coefficients + * @param[out] out pointer to the output buffer (frame) + * @param[in] pitch pitch to move to the next y line + * @param[in] flags pointer to the array of column flags: + * != 0 - non_empty column, 0 - empty one + * (this array must be filled by caller) + */ +void ff_ivi_inverse_slant_8x8(const int32_t *in, int16_t *out, ptrdiff_t pitch, + const uint8_t *flags); + +/** + * two-dimensional inverse slant 4x4 transform + * + * @param[in] in pointer to the vector of transform coefficients + * @param[out] out pointer to the output buffer (frame) + * @param[in] pitch pitch to move to the next y line + * @param[in] flags pointer to the array of column flags: + * != 0 - non_empty column, 0 - empty one + * (this array must be filled by caller) + */ +void ff_ivi_inverse_slant_4x4(const int32_t *in, int16_t *out, ptrdiff_t pitch, + const uint8_t *flags); + +/** + * DC-only two-dimensional inverse slant transform. + * Performing the inverse slant transform in this case is equivalent to + * spreading (DC_coeff + 1)/2 over the whole block. + * It works much faster than performing the slant transform on a vector of zeroes. + * + * @param[in] in pointer to the dc coefficient + * @param[out] out pointer to the output buffer (frame) + * @param[in] pitch pitch to move to the next y line + * @param[in] blk_size transform block size + */ +void ff_ivi_dc_slant_2d(const int32_t *in, int16_t *out, ptrdiff_t pitch, int blk_size); + +/** + * inverse 1D row slant transform + * + * @param[in] in pointer to the vector of transform coefficients + * @param[out] out pointer to the output buffer (frame) + * @param[in] pitch pitch to move to the next y line + * @param[in] flags pointer to the array of column flags (unused here) + */ +void ff_ivi_row_slant8(const int32_t *in, int16_t *out, ptrdiff_t pitch, + const uint8_t *flags); + +/** + * inverse 1D column slant transform + * + * @param[in] in pointer to the vector of transform coefficients + * @param[out] out pointer to the output buffer (frame) + * @param[in] pitch pitch to move to the next y line + * @param[in] flags pointer to the array of column flags: + * != 0 - non_empty column, 0 - empty one + * (this array must be filled by caller) + */ +void ff_ivi_col_slant8(const int32_t *in, int16_t *out, ptrdiff_t pitch, + const uint8_t *flags); + +/** + * inverse 1D row slant transform + * + * @param[in] in pointer to the vector of transform coefficients + * @param[out] out pointer to the output buffer (frame) + * @param[in] pitch pitch to move to the next y line + * @param[in] flags pointer to the array of column flags (unused here) + */ +void ff_ivi_row_slant4(const int32_t *in, int16_t *out, ptrdiff_t pitch, + const uint8_t *flags); + +/** + * inverse 1D column slant transform + * + * @param[in] in pointer to the vector of transform coefficients + * @param[out] out pointer to the output buffer (frame) + * @param[in] pitch pitch to move to the next y line + * @param[in] flags pointer to the array of column flags: + * != 0 - non_empty column, 0 - empty one + * (this array must be filled by caller) + */ +void ff_ivi_col_slant4(const int32_t *in, int16_t *out, ptrdiff_t pitch, + const uint8_t *flags); + +/** + * DC-only inverse row slant transform + */ +void ff_ivi_dc_row_slant(const int32_t *in, int16_t *out, ptrdiff_t pitch, int blk_size); + +/** + * DC-only inverse column slant transform + */ +void ff_ivi_dc_col_slant(const int32_t *in, int16_t *out, ptrdiff_t pitch, int blk_size); + +/** + * Copy the pixels into the frame buffer. + */ +void ff_ivi_put_pixels_8x8(const int32_t *in, int16_t *out, ptrdiff_t pitch, const uint8_t *flags); + +/** + * Copy the DC coefficient into the first pixel of the block and + * zero all others. + */ +void ff_ivi_put_dc_pixel_8x8(const int32_t *in, int16_t *out, ptrdiff_t pitch, int blk_size); + +/** + * 8x8 block motion compensation with adding delta + * + * @param[in,out] buf pointer to the block in the current frame buffer containing delta + * @param[in] ref_buf pointer to the corresponding block in the reference frame + * @param[in] pitch pitch for moving to the next y line + * @param[in] mc_type interpolation type + */ +void ff_ivi_mc_8x8_delta(int16_t *buf, const int16_t *ref_buf, ptrdiff_t pitch, int mc_type); + +/** + * 4x4 block motion compensation with adding delta + * + * @param[in,out] buf pointer to the block in the current frame buffer containing delta + * @param[in] ref_buf pointer to the corresponding block in the reference frame + * @param[in] pitch pitch for moving to the next y line + * @param[in] mc_type interpolation type + */ +void ff_ivi_mc_4x4_delta(int16_t *buf, const int16_t *ref_buf, ptrdiff_t pitch, int mc_type); + +/** + * motion compensation without adding delta + * + * @param[in,out] buf pointer to the block in the current frame receiving the result + * @param[in] ref_buf pointer to the corresponding block in the reference frame + * @param[in] pitch pitch for moving to the next y line + * @param[in] mc_type interpolation type + */ +void ff_ivi_mc_8x8_no_delta(int16_t *buf, const int16_t *ref_buf, ptrdiff_t pitch, int mc_type); + +/** + * 4x4 block motion compensation without adding delta + * + * @param[in,out] buf pointer to the block in the current frame receiving the result + * @param[in] ref_buf pointer to the corresponding block in the reference frame + * @param[in] pitch pitch for moving to the next y line + * @param[in] mc_type interpolation type + */ +void ff_ivi_mc_4x4_no_delta(int16_t *buf, const int16_t *ref_buf, ptrdiff_t pitch, int mc_type); + +/** + * 8x8 block motion compensation with adding delta + * + * @param[in,out] buf pointer to the block in the current frame buffer containing delta + * @param[in] ref_buf pointer to the corresponding block in the backward reference frame + * @param[in] ref_buf2 pointer to the corresponding block in the forward reference frame + * @param[in] pitch pitch for moving to the next y line + * @param[in] mc_type interpolation type for backward reference + * @param[in] mc_type2 interpolation type for forward reference + */ +void ff_ivi_mc_avg_8x8_delta(int16_t *buf, const int16_t *ref_buf, const int16_t *ref_buf2, ptrdiff_t pitch, int mc_type, int mc_type2); + +/** + * 4x4 block motion compensation with adding delta + * + * @param[in,out] buf pointer to the block in the current frame buffer containing delta + * @param[in] ref_buf pointer to the corresponding block in the backward reference frame + * @param[in] ref_buf2 pointer to the corresponding block in the forward reference frame + * @param[in] pitch pitch for moving to the next y line + * @param[in] mc_type interpolation type for backward reference + * @param[in] mc_type2 interpolation type for forward reference + */ +void ff_ivi_mc_avg_4x4_delta(int16_t *buf, const int16_t *ref_buf, const int16_t *ref_buf2, ptrdiff_t pitch, int mc_type, int mc_type2); + +/** + * motion compensation without adding delta for B-frames + * + * @param[in,out] buf pointer to the block in the current frame receiving the result + * @param[in] ref_buf pointer to the corresponding block in the backward reference frame + * @param[in] ref_buf2 pointer to the corresponding block in the forward reference frame + * @param[in] pitch pitch for moving to the next y line + * @param[in] mc_type interpolation type for backward reference + * @param[in] mc_type2 interpolation type for forward reference + */ +void ff_ivi_mc_avg_8x8_no_delta(int16_t *buf, const int16_t *ref_buf, const int16_t *ref_buf2, ptrdiff_t pitch, int mc_type, int mc_type2); + +/** + * 4x4 block motion compensation without adding delta for B-frames + * + * @param[in,out] buf pointer to the block in the current frame receiving the result + * @param[in] ref_buf pointer to the corresponding block in the backward reference frame + * @param[in] ref_buf2 pointer to the corresponding block in the forward reference frame + * @param[in] pitch pitch for moving to the next y line + * @param[in] mc_type interpolation type for backward reference + * @param[in] mc_type2 interpolation type for forward reference + */ +void ff_ivi_mc_avg_4x4_no_delta(int16_t *buf, const int16_t *ref_buf, const int16_t *ref_buf2, ptrdiff_t pitch, int mc_type, int mc_type2); + +#endif /* AVCODEC_IVI_DSP_H */ diff --git a/include/libavcodec/jacosub.h b/include/libavcodec/jacosub.h new file mode 100644 index 0000000..c3665ae --- /dev/null +++ b/include/libavcodec/jacosub.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2012 Clément Bœsch + * + * 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 + */ + +/** + * @file + * JACOsub shared utils + */ + +#ifndef AVCODEC_JACOSUB_H +#define AVCODEC_JACOSUB_H + +#include "libavutil/common.h" + +#define JSS_MAX_LINESIZE 512 + +static av_always_inline int jss_whitespace(char c) +{ + return c == ' ' || (c >= '\t' && c <= '\r'); +} + +static av_always_inline const char *jss_skip_whitespace(const char *p) +{ + while (jss_whitespace(*p)) + p++; + return p; +} + +#endif /* AVCODEC_JACOSUB_H */ diff --git a/include/libavcodec/jni.h b/include/libavcodec/jni.h index dd99e92..955cd28 100644 --- a/include/libavcodec/jni.h +++ b/include/libavcodec/jni.h @@ -43,4 +43,25 @@ int av_jni_set_java_vm(void *vm, void *log_ctx); */ void *av_jni_get_java_vm(void *log_ctx); +/* + * Set the Android application context which will be used to retrieve the Android + * content resolver to handle content uris. + * + * This function is only available on Android. + * + * @param app_ctx global JNI reference to the Android application context + * @return 0 on success, < 0 otherwise + */ +int av_jni_set_android_app_ctx(void *app_ctx, void *log_ctx); + +/* + * Get the Android application context that has been set with + * av_jni_set_android_app_ctx. + * + * This function is only available on Android. + * + * @return a pointer the the Android application context + */ +void *av_jni_get_android_app_ctx(void); + #endif /* AVCODEC_JNI_H */ diff --git a/include/libavcodec/jpeg2000.h b/include/libavcodec/jpeg2000.h new file mode 100644 index 0000000..93221d9 --- /dev/null +++ b/include/libavcodec/jpeg2000.h @@ -0,0 +1,321 @@ +/* + * JPEG 2000 common defines, structures and functions + * Copyright (c) 2007 Kamil Nowosad + * Copyright (c) 2013 Nicolas Bertrand + * + * 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_JPEG2000_H +#define AVCODEC_JPEG2000_H + +/** + * @file + * JPEG 2000 structures and defines common + * to encoder and decoder + */ + +#include + +#include "avcodec.h" +#include "mqc.h" +#include "jpeg2000dwt.h" + +enum Jpeg2000Markers { + JPEG2000_SOC = 0xff4f, // start of codestream + JPEG2000_CAP = 0xff50, // extended capabilities + JPEG2000_SIZ = 0xff51, // image and tile size + JPEG2000_COD, // coding style default + JPEG2000_COC, // coding style component + JPEG2000_TLM = 0xff55, // tile-part length, main header + JPEG2000_PLM = 0xff57, // packet length, main header + JPEG2000_PLT, // packet length, tile-part header + JPEG2000_CPF, // corresponding profile + JPEG2000_QCD = 0xff5c, // quantization default + JPEG2000_QCC, // quantization component + JPEG2000_RGN, // region of interest + JPEG2000_POC, // progression order change + JPEG2000_PPM, // packed packet headers, main header + JPEG2000_PPT, // packed packet headers, tile-part header + JPEG2000_CRG = 0xff63, // component registration + JPEG2000_COM, // comment + JPEG2000_SOT = 0xff90, // start of tile-part + JPEG2000_SOP, // start of packet + JPEG2000_EPH, // end of packet header + JPEG2000_SOD, // start of data + JPEG2000_EOC = 0xffd9, // end of codestream +}; + +enum JPEG2000_Ccap15_b14_15_params { + HTJ2K_HTONLY = 0, // HTONLY, bit 14 and 15 are 0 + HTJ2K_HTDECLARED, // HTDECLARED, bit 14 = 1 and bit 15 = 0 + HTJ2K_MIXED = 3, // MIXED, bit 14 and 15 are 1 +}; + +#define JPEG2000_SOP_FIXED_BYTES 0xFF910004 +#define JPEG2000_SOP_BYTE_LENGTH 6 + +enum Jpeg2000Quantsty { // quantization style + JPEG2000_QSTY_NONE, // no quantization + JPEG2000_QSTY_SI, // scalar derived + JPEG2000_QSTY_SE // scalar expounded +}; + +#define JPEG2000_MAX_DECLEVELS 33 +#define JPEG2000_MAX_RESLEVELS (JPEG2000_MAX_DECLEVELS + 1) + +#define JPEG2000_MAX_PASSES 100 + +// T1 flags +// flags determining significance of neighbor coefficients +#define JPEG2000_T1_SIG_N 0x0001 +#define JPEG2000_T1_SIG_E 0x0002 +#define JPEG2000_T1_SIG_W 0x0004 +#define JPEG2000_T1_SIG_S 0x0008 +#define JPEG2000_T1_SIG_NE 0x0010 +#define JPEG2000_T1_SIG_NW 0x0020 +#define JPEG2000_T1_SIG_SE 0x0040 +#define JPEG2000_T1_SIG_SW 0x0080 +#define JPEG2000_T1_SIG_NB (JPEG2000_T1_SIG_N | JPEG2000_T1_SIG_E | \ + JPEG2000_T1_SIG_S | JPEG2000_T1_SIG_W | \ + JPEG2000_T1_SIG_NE | JPEG2000_T1_SIG_NW | \ + JPEG2000_T1_SIG_SE | JPEG2000_T1_SIG_SW) +// flags determining sign bit of neighbor coefficients +#define JPEG2000_T1_SGN_N 0x0100 +#define JPEG2000_T1_SGN_S 0x0200 +#define JPEG2000_T1_SGN_W 0x0400 +#define JPEG2000_T1_SGN_E 0x0800 + +#define JPEG2000_T1_VIS 0x1000 +#define JPEG2000_T1_SIG 0x2000 +#define JPEG2000_T1_REF 0x4000 + +#define JPEG2000_T1_SGN 0x8000 + +// Codeblock coding styles +#define JPEG2000_CBLK_BYPASS 0x01 // Selective arithmetic coding bypass +#define JPEG2000_CBLK_RESET 0x02 // Reset context probabilities +#define JPEG2000_CBLK_TERMALL 0x04 // Terminate after each coding pass +#define JPEG2000_CBLK_VSC 0x08 // Vertical stripe causal context formation +#define JPEG2000_CBLK_PREDTERM 0x10 // Predictable termination +#define JPEG2000_CBLK_SEGSYM 0x20 // Segmentation symbols present + +// Coding styles +#define JPEG2000_CSTY_PREC 0x01 // Precincts defined in coding style +#define JPEG2000_CSTY_SOP 0x02 // SOP marker present +#define JPEG2000_CSTY_EPH 0x04 // EPH marker present +#define JPEG2000_CTSY_HTJ2K_F 0x40 // Only HT code-blocks (Rec. ITU-T T.814 | ISO/IEC 15444-15) are present +#define JPEG2000_CTSY_HTJ2K_M 0xC0 // HT code-blocks (Rec. ITU-T T.814 | ISO/IEC 15444-15) can be present + +// Progression orders +#define JPEG2000_PGOD_LRCP 0x00 // Layer-resolution level-component-position progression +#define JPEG2000_PGOD_RLCP 0x01 // Resolution level-layer-component-position progression +#define JPEG2000_PGOD_RPCL 0x02 // Resolution level-position-component-layer progression +#define JPEG2000_PGOD_PCRL 0x03 // Position-component-resolution level-layer progression +#define JPEG2000_PGOD_CPRL 0x04 // Component-position-resolution level-layer progression + +typedef struct Jpeg2000T1Context { + int data[6144]; + uint16_t flags[6156]; + MqcState mqc; + int stride; +} Jpeg2000T1Context; + +typedef struct Jpeg2000TgtNode { + uint8_t val; + uint8_t temp_val; + uint8_t vis; + struct Jpeg2000TgtNode *parent; +} Jpeg2000TgtNode; + +typedef struct Jpeg2000CodingStyle { + int nreslevels; // number of resolution levels + int nreslevels2decode; // number of resolution levels to decode + uint8_t log2_cblk_width, + log2_cblk_height; // exponent of codeblock size + uint8_t transform; // DWT type + uint8_t csty; // coding style + uint8_t nlayers; // number of layers + uint8_t mct; // multiple component transformation + uint8_t cblk_style; // codeblock coding style + uint8_t prog_order; // progression order + uint8_t log2_prec_widths[JPEG2000_MAX_RESLEVELS]; // precincts size according resolution levels + uint8_t log2_prec_heights[JPEG2000_MAX_RESLEVELS]; // TODO: initialize prec_size array with 0? + uint8_t init; +} Jpeg2000CodingStyle; + +typedef struct Jpeg2000QuantStyle { + uint8_t expn[JPEG2000_MAX_DECLEVELS * 3]; // quantization exponent + uint16_t mant[JPEG2000_MAX_DECLEVELS * 3]; // quantization mantissa + uint8_t quantsty; // quantization style + uint8_t nguardbits; // number of guard bits +} Jpeg2000QuantStyle; + +typedef struct Jpeg2000Pass { + uint16_t rate; + int64_t disto; + uint8_t flushed[4]; + int flushed_len; +} Jpeg2000Pass; + +typedef struct Jpeg2000Layer { + uint8_t *data_start; + int data_len; + int npasses; + double disto; + int cum_passes; +} Jpeg2000Layer; + +typedef struct Jpeg2000Cblk { + uint8_t npasses; + uint8_t ninclpasses; // number coding of passes included in codestream + uint8_t nonzerobits; + uint8_t incl; + uint16_t length; + uint16_t *lengthinc; + uint8_t nb_lengthinc; + uint8_t lblock; + uint8_t *data; + size_t data_allocated; + int nb_terminations; + int nb_terminationsinc; + int *data_start; + Jpeg2000Pass *passes; + Jpeg2000Layer *layers; + int coord[2][2]; // border coordinates {{x0, x1}, {y0, y1}} + /* specific to HT code-blocks */ + int zbp; + int pass_lengths[2]; + uint8_t modes; // copy of SPcod/SPcoc field to parse HT-MIXED mode + uint8_t ht_plhd; // are we looking for HT placeholder passes? +} Jpeg2000Cblk; // code block + +typedef struct Jpeg2000Prec { + int nb_codeblocks_width; + int nb_codeblocks_height; + Jpeg2000TgtNode *zerobits; + Jpeg2000TgtNode *cblkincl; + Jpeg2000Cblk *cblk; + int decoded_layers; + int coord[2][2]; // border coordinates {{x0, x1}, {y0, y1}} +} Jpeg2000Prec; // precinct + +typedef struct Jpeg2000Band { + int coord[2][2]; // border coordinates {{x0, x1}, {y0, y1}} + uint16_t log2_cblk_width, log2_cblk_height; + int i_stepsize; // quantization stepsize + float f_stepsize; // quantization stepsize + Jpeg2000Prec *prec; +} Jpeg2000Band; // subband + +typedef struct Jpeg2000ResLevel { + uint8_t nbands; + int coord[2][2]; // border coordinates {{x0, x1}, {y0, y1}} + int num_precincts_x, num_precincts_y; // number of precincts in x/y direction + uint8_t log2_prec_width, log2_prec_height; // exponent of precinct size + Jpeg2000Band *band; +} Jpeg2000ResLevel; // resolution level + +typedef struct Jpeg2000Component { + Jpeg2000ResLevel *reslevel; + DWTContext dwt; + float *f_data; + int *i_data; + int coord[2][2]; // border coordinates {{x0, x1}, {y0, y1}} -- can be reduced with lowres option + int coord_o[2][2]; // border coordinates {{x0, x1}, {y0, y1}} -- original values from jpeg2000 headers + uint8_t roi_shift; // ROI scaling value for the component +} Jpeg2000Component; + +/* misc tools */ +static inline int ff_jpeg2000_ceildivpow2(int a, int b) +{ + return -((-(int64_t)a) >> b); +} + +static inline int ff_jpeg2000_ceildiv(int a, int64_t b) +{ + return (a + b - 1) / b; +} + +/* TIER-1 routines */ + +/* Set up lookup tables used in TIER-1. */ +void ff_jpeg2000_init_tier1_luts(void); + +/* Update significance of a coefficient at current position (x,y) and + * for neighbors. */ +void ff_jpeg2000_set_significance(Jpeg2000T1Context *t1, + int x, int y, int negative); + +extern uint8_t ff_jpeg2000_sigctxno_lut[256][4]; + +/* Get context label (number in range[0..8]) of a coefficient for significance + * propagation and cleanup coding passes. */ +static inline int ff_jpeg2000_getsigctxno(int flag, int bandno) +{ + return ff_jpeg2000_sigctxno_lut[flag & 255][bandno]; +} + +static const uint8_t refctxno_lut[2][2] = { { 14, 15 }, { 16, 16 } }; + +/* Get context label (number in range[14..16]) of a coefficient for magnitude + * refinement pass. */ +static inline int ff_jpeg2000_getrefctxno(int flag) +{ + return refctxno_lut[(flag >> 14) & 1][(flag & 255) != 0]; +} + +extern uint8_t ff_jpeg2000_sgnctxno_lut[16][16]; +extern uint8_t ff_jpeg2000_xorbit_lut[16][16]; + +/* Get context label (number in range[9..13]) for sign decoding. */ +static inline int ff_jpeg2000_getsgnctxno(int flag, int *xorbit) +{ + *xorbit = ff_jpeg2000_xorbit_lut[flag & 15][(flag >> 8) & 15]; + return ff_jpeg2000_sgnctxno_lut[flag & 15][(flag >> 8) & 15]; +} + +int ff_jpeg2000_init_component(Jpeg2000Component *comp, + Jpeg2000CodingStyle *codsty, + Jpeg2000QuantStyle *qntsty, + int cbps, int dx, int dy, + AVCodecContext *ctx); + +void ff_jpeg2000_reinit(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty); + +void ff_jpeg2000_cleanup(Jpeg2000Component *comp, Jpeg2000CodingStyle *codsty); + +static inline int needs_termination(int style, int passno) { + if (style & JPEG2000_CBLK_BYPASS) { + int type = passno % 3; + passno /= 3; + if (type == 0 && passno > 2) + return 2; + if (type == 2 && passno > 2) + return 1; + if (style & JPEG2000_CBLK_TERMALL) { + return passno > 2 ? 2 : 1; + } + } + if (style & JPEG2000_CBLK_TERMALL) + return 1; + return 0; +} + +void ff_tag_tree_zero(Jpeg2000TgtNode *t, int w, int h, int val); + +#endif /* AVCODEC_JPEG2000_H */ diff --git a/include/libavcodec/jpeg2000dec.h b/include/libavcodec/jpeg2000dec.h new file mode 100644 index 0000000..78eba27 --- /dev/null +++ b/include/libavcodec/jpeg2000dec.h @@ -0,0 +1,126 @@ +/* + * JPEG 2000 image decoder + * Copyright (c) 2007 Kamil Nowosad + * Copyright (c) 2013 Nicolas Bertrand + * Copyright (c) 2022 Caleb Etemesi + * + * 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_JPEG2000DEC_H +#define AVCODEC_JPEG2000DEC_H + +#include "bytestream.h" +#include "jpeg2000.h" +#include "jpeg2000dsp.h" + + +#define MAX_POCS 32 + +typedef struct Jpeg2000POCEntry { + uint16_t LYEpoc; + uint16_t CSpoc; + uint16_t CEpoc; + uint8_t RSpoc; + uint8_t REpoc; + uint8_t Ppoc; +} Jpeg2000POCEntry; + +typedef struct Jpeg2000POC { + Jpeg2000POCEntry poc[MAX_POCS]; + int nb_poc; + int is_default; +} Jpeg2000POC; + +typedef struct Jpeg2000TilePart { + uint8_t tile_index; // Tile index who refers the tile-part + const uint8_t *tp_end; + GetByteContext header_tpg; // bit stream of header if PPM header is used + GetByteContext tpg; // bit stream in tile-part +} Jpeg2000TilePart; + +/* RMK: For JPEG2000 DCINEMA 3 tile-parts in a tile + * one per component, so tile_part elements have a size of 3 */ +typedef struct Jpeg2000Tile { + Jpeg2000Component *comp; + uint8_t properties[4]; + Jpeg2000CodingStyle codsty[4]; + Jpeg2000QuantStyle qntsty[4]; + Jpeg2000POC poc; + Jpeg2000TilePart tile_part[32]; + uint8_t has_ppt; // whether this tile has a ppt marker + uint8_t *packed_headers; // contains packed headers. Used only along with PPT marker + int packed_headers_size; // size in bytes of the packed headers + GetByteContext packed_headers_stream; // byte context corresponding to packed headers + uint16_t tp_idx; // Tile-part index + int coord[2][2]; // border coordinates {{x0, x1}, {y0, y1}} +} Jpeg2000Tile; + +typedef struct Jpeg2000DecoderContext { + AVClass *class; + AVCodecContext *avctx; + GetByteContext g; + + int width, height; + int image_offset_x, image_offset_y; + int tile_offset_x, tile_offset_y; + uint8_t cbps[4]; // bits per sample in particular components + uint8_t sgnd[4]; // if a component is signed + uint8_t properties[4]; + + uint8_t has_ppm; + uint8_t *packed_headers; // contains packed headers. Used only along with PPM marker + int packed_headers_size; + GetByteContext packed_headers_stream; + uint8_t in_tile_headers; + + int cdx[4], cdy[4]; + int precision; + int ncomponents; + int colour_space; + uint32_t palette[256]; + int8_t pal8; + int cdef[4]; + int tile_width, tile_height; + unsigned numXtiles, numYtiles; + int maxtilelen; + AVRational sar; + + Jpeg2000CodingStyle codsty[4]; + Jpeg2000QuantStyle qntsty[4]; + Jpeg2000POC poc; + uint8_t roi_shift[4]; + + int bit_index; + + int curtileno; + + Jpeg2000Tile *tile; + Jpeg2000DSPContext dsp; + + uint8_t isHT; // HTJ2K? + uint8_t Ccap15_b14_15; // HTONLY(= 0) or HTDECLARED(= 1) or MIXED(= 3) ? + uint8_t Ccap15_b12; // RGNFREE(= 0) or RGN(= 1)? + uint8_t Ccap15_b11; // HOMOGENEOUS(= 0) or HETEROGENEOUS(= 1) ? + uint8_t Ccap15_b05; // HTREV(= 0) or HTIRV(= 1) ? + uint8_t HT_B; // The parameter B for MAGBp value (see Table 4 in the Rec. ITU-T T.814 | ISO/IEC 15444-15) + + /*options parameters*/ + int reduction_factor; +} Jpeg2000DecoderContext; + +#endif //AVCODEC_JPEG2000DEC_H diff --git a/include/libavcodec/jpeg2000dsp.h b/include/libavcodec/jpeg2000dsp.h new file mode 100644 index 0000000..6854c77 --- /dev/null +++ b/include/libavcodec/jpeg2000dsp.h @@ -0,0 +1,39 @@ +/* + * JPEG 2000 DSP functions + * Copyright (c) 2007 Kamil Nowosad + * Copyright (c) 2013 Nicolas Bertrand + * + * 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_JPEG2000DSP_H +#define AVCODEC_JPEG2000DSP_H + +#include +#include "jpeg2000dwt.h" + +typedef struct Jpeg2000DSPContext { + void (*mct_decode[FF_DWT_NB])(void *src0, void *src1, void *src2, int csize); +} Jpeg2000DSPContext; + +extern const float ff_jpeg2000_f_ict_params[4]; + +void ff_jpeg2000dsp_init(Jpeg2000DSPContext *c); +void ff_jpeg2000dsp_init_riscv(Jpeg2000DSPContext *c); +void ff_jpeg2000dsp_init_x86(Jpeg2000DSPContext *c); + +#endif /* AVCODEC_JPEG2000DSP_H */ diff --git a/include/libavcodec/jpeg2000dwt.h b/include/libavcodec/jpeg2000dwt.h new file mode 100644 index 0000000..718d183 --- /dev/null +++ b/include/libavcodec/jpeg2000dwt.h @@ -0,0 +1,68 @@ +/* + * Discrete wavelet transform + * Copyright (c) 2007 Kamil Nowosad + * + * 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_JPEG2000DWT_H +#define AVCODEC_JPEG2000DWT_H + +/** + * @file + * Discrete wavelet transform + */ + +#include + +#define FF_DWT_MAX_DECLVLS 32 ///< max number of decomposition levels +#define F_LFTG_K 1.230174104914001f +#define F_LFTG_X 0.812893066115961f + +enum DWTType { + FF_DWT97, + FF_DWT53, + FF_DWT97_INT, + FF_DWT_NB +}; + +typedef struct DWTContext { + /// line lengths { horizontal, vertical } in consecutive decomposition levels + int linelen[FF_DWT_MAX_DECLVLS][2]; + uint8_t mod[FF_DWT_MAX_DECLVLS][2]; ///< coordinates (x0, y0) of decomp. levels mod 2 + uint8_t ndeclevels; ///< number of decomposition levels + uint8_t type; ///< 0 for 9/7; 1 for 5/3 + int32_t *i_linebuf; ///< int buffer used by transform + float *f_linebuf; ///< float buffer used by transform +} DWTContext; + +/** + * Initialize DWT. + * @param s DWT context + * @param border coordinates of transformed region {{x0, x1}, {y0, y1}} + * @param decomp_levels number of decomposition levels + * @param type 0 for DWT 9/7; 1 for DWT 5/3 + */ +int ff_jpeg2000_dwt_init(DWTContext *s, int border[2][2], + int decomp_levels, int type); + +int ff_dwt_encode(DWTContext *s, void *t); +int ff_dwt_decode(DWTContext *s, void *t); + +void ff_dwt_destroy(DWTContext *s); + +#endif /* AVCODEC_JPEG2000DWT_H */ diff --git a/include/libavcodec/jpeg2000htdec.h b/include/libavcodec/jpeg2000htdec.h new file mode 100644 index 0000000..8d6919a --- /dev/null +++ b/include/libavcodec/jpeg2000htdec.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2022 Caleb Etemesi + * + * 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_JPEG2000HTDEC_H +#define AVCODEC_JPEG2000HTDEC_H + +#include "jpeg2000dec.h" + +/** + * HT Block decoder as specified in Rec. ITU-T T.814 | ISO/IEC 15444-15 + */ + +int ff_jpeg2000_decode_htj2k(const Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty, + Jpeg2000T1Context *t1, Jpeg2000Cblk *cblk, int width, + int height, int M_b, uint8_t roi_shift); + +#endif /* AVCODEC_JPEG2000HTDEC_H */ diff --git a/include/libavcodec/jpegls.h b/include/libavcodec/jpegls.h new file mode 100644 index 0000000..ebf9159 --- /dev/null +++ b/include/libavcodec/jpegls.h @@ -0,0 +1,121 @@ +/* + * JPEG-LS common code + * Copyright (c) 2003 Michael Niedermayer + * Copyright (c) 2006 Konstantin Shishkov + * + * 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 + */ + +/** + * @file + * JPEG-LS common code. + */ + +#ifndef AVCODEC_JPEGLS_H +#define AVCODEC_JPEGLS_H + +#include +#include "libavutil/common.h" + +#undef near /* This file uses struct member 'near' which in windows.h is defined as empty. */ + +typedef struct JLSState { + int T1, T2, T3; + int A[367], B[367], C[365], N[367]; + int limit, reset, bpp, qbpp, maxval, range; + int near, twonear; + int run_index[4]; +} JLSState; + +/** + * Calculate initial JPEG-LS parameters + */ +void ff_jpegls_init_state(JLSState *state); + +/** + * Calculate quantized gradient value, used for context determination + */ +static inline int ff_jpegls_quantize(JLSState *s, int v) +{ + if (v == 0) + return 0; + if (v < 0) { + if (v <= -s->T3) + return -4; + if (v <= -s->T2) + return -3; + if (v <= -s->T1) + return -2; + if (v < -s->near) + return -1; + return 0; + } else { + if (v <= s->near) + return 0; + if (v < s->T1) + return 1; + if (v < s->T2) + return 2; + if (v < s->T3) + return 3; + return 4; + } +} + +/** + * Calculate JPEG-LS codec values + */ +void ff_jpegls_reset_coding_parameters(JLSState *s, int reset_all); + +static inline void ff_jpegls_downscale_state(JLSState *state, int Q) +{ + if (state->N[Q] == state->reset) { + state->A[Q] >>= 1; + state->B[Q] >>= 1; + state->N[Q] >>= 1; + } + state->N[Q]++; +} + +static inline int ff_jpegls_update_state_regular(JLSState *state, + int Q, int err) +{ + if(FFABS(err) > 0xFFFF || FFABS(err) > INT_MAX - state->A[Q]) + return -0x10000; + state->A[Q] += FFABS(err); + err *= state->twonear; + state->B[Q] += err; + + ff_jpegls_downscale_state(state, Q); + + if (state->B[Q] <= -state->N[Q]) { + state->B[Q] = FFMAX(state->B[Q] + state->N[Q], 1 - state->N[Q]); + if (state->C[Q] > -128) + state->C[Q]--; + } else if (state->B[Q] > 0) { + state->B[Q] = FFMIN(state->B[Q] - state->N[Q], 0); + if (state->C[Q] < 127) + state->C[Q]++; + } + + return err; +} + +#define R(a, i) (bits == 8 ? ((uint8_t *)(a))[i] : ((uint16_t *)(a))[i]) +#define W(a, i, v) (bits == 8 ? (((uint8_t *)(a))[i] = v) : (((uint16_t *)(a))[i] = v)) + +#endif /* AVCODEC_JPEGLS_H */ diff --git a/include/libavcodec/jpeglsdec.h b/include/libavcodec/jpeglsdec.h new file mode 100644 index 0000000..0cafaba --- /dev/null +++ b/include/libavcodec/jpeglsdec.h @@ -0,0 +1,42 @@ +/* + * JPEG-LS decoder + * Copyright (c) 2003 Michael Niedermayer + * Copyright (c) 2006 Konstantin Shishkov + * + * 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 + */ + +/** + * @file + * JPEG-LS decoder. + */ + +#ifndef AVCODEC_JPEGLSDEC_H +#define AVCODEC_JPEGLSDEC_H + +#include "mjpeg.h" +#include "mjpegdec.h" + +/** + * Decode LSE block with initialization parameters + */ +int ff_jpegls_decode_lse(MJpegDecodeContext *s); + +int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, + int point_transform, int ilv); + +#endif /* AVCODEC_JPEGLSDEC_H */ diff --git a/include/libavcodec/jpegquanttables.h b/include/libavcodec/jpegquanttables.h new file mode 100644 index 0000000..48a3429 --- /dev/null +++ b/include/libavcodec/jpegquanttables.h @@ -0,0 +1,32 @@ +/* + * MJPEG quantization tables + * + * 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_JPEGQUANTTABLES_H +#define AVCODEC_JPEGQUANTTABLES_H + +#include +#include "libavutil/attributes_internal.h" + +FF_VISIBILITY_PUSH_HIDDEN +extern const uint8_t ff_mjpeg_std_luminance_quant_tbl[64]; +extern const uint8_t ff_mjpeg_std_chrominance_quant_tbl[64]; +FF_VISIBILITY_POP_HIDDEN + +#endif /* AVCODEC_JPEGQUANTTABLES_H */ diff --git a/include/libavcodec/jpegtables.h b/include/libavcodec/jpegtables.h new file mode 100644 index 0000000..39baec3 --- /dev/null +++ b/include/libavcodec/jpegtables.h @@ -0,0 +1,41 @@ +/* + * JPEG-related tables + * + * 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_JPEGTABLES_H +#define AVCODEC_JPEGTABLES_H + +#include + +#include "libavutil/attributes_internal.h" + +FF_VISIBILITY_PUSH_HIDDEN +extern const uint8_t ff_mjpeg_bits_dc_luminance[]; +extern const uint8_t ff_mjpeg_val_dc[]; + +extern const uint8_t ff_mjpeg_bits_dc_chrominance[]; + +extern const uint8_t ff_mjpeg_bits_ac_luminance[]; +extern const uint8_t ff_mjpeg_val_ac_luminance[]; + +extern const uint8_t ff_mjpeg_bits_ac_chrominance[]; +extern const uint8_t ff_mjpeg_val_ac_chrominance[]; +FF_VISIBILITY_POP_HIDDEN + +#endif /* AVCODEC_JPEGTABLES_H */ diff --git a/include/libavcodec/jpegtabs.h b/include/libavcodec/jpegtabs.h new file mode 100644 index 0000000..7106f66 --- /dev/null +++ b/include/libavcodec/jpegtabs.h @@ -0,0 +1,92 @@ +/* + * MJPEG tables + * Copyright (c) 2000, 2001 Fabrice Bellard + * Copyright (c) 2003 Alex Beregszaszi + * Copyright (c) 2003-2004 Michael Niedermayer + * + * 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_JPEGTABS_H +#define AVCODEC_JPEGTABS_H + +#include +#include "jpegtables.h" + +/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */ +/* IMPORTANT: these are only valid for 8-bit data precision! */ +const uint8_t ff_mjpeg_bits_dc_luminance[17] = +{ /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 }; +const uint8_t ff_mjpeg_val_dc[12] = +{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 }; + +const uint8_t ff_mjpeg_bits_dc_chrominance[17] = +{ /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 }; + +const uint8_t ff_mjpeg_bits_ac_luminance[17] = +{ /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d }; +const uint8_t ff_mjpeg_val_ac_luminance[] = +{ 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 +}; + +const uint8_t ff_mjpeg_bits_ac_chrominance[17] = +{ /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 }; + +const uint8_t ff_mjpeg_val_ac_chrominance[] = +{ 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 +}; +#endif diff --git a/include/libavcodec/jpegxl.h b/include/libavcodec/jpegxl.h new file mode 100644 index 0000000..66a6be3 --- /dev/null +++ b/include/libavcodec/jpegxl.h @@ -0,0 +1,94 @@ +/* + * JPEG XL Common Header Definitions + * Copyright (c) 2023 Leo Izen + * + * 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_JPEGXL_H +#define AVCODEC_JPEGXL_H + +#define FF_JPEGXL_CODESTREAM_SIGNATURE_LE 0x0aff +#define FF_JPEGXL_CONTAINER_SIGNATURE_LE 0x204c584a0c000000 +#define FF_JPEGXL_CODESTREAM_SIGNATURE_BE 0xff0a +#define FF_JPEGXL_CONTAINER_SIGNATURE_BE 0x0000000c4a584c20 + +typedef enum FFJXLFrameEncoding { + JPEGXL_ENC_VARDCT, + JPEGXL_ENC_MODULAR +} FFJXLFrameEncoding; + +typedef enum FFJXLFrameType { + JPEGXL_FRAME_REGULAR, + JPEGXL_FRAME_LF, + JPEGXL_FRAME_REFERENCE_ONLY, + JPEGXL_FRAME_SKIP_PROGRESSIVE +} FFJXLFrameType; + +typedef enum FFJXLBlendMode { + JPEGXL_BM_REPLACE, + JPEGXL_BM_ADD, + JPEGXL_BM_BLEND, + JPEGXL_BM_MULADD, + JPEGXL_BM_MUL +} FFJXLBlendMode; + +typedef enum FFJXLExtraChannelType { + JPEGXL_CT_ALPHA = 0, + JPEGXL_CT_DEPTH, + JPEGXL_CT_SPOT_COLOR, + JPEGXL_CT_SELECTION_MASK, + JPEGXL_CT_BLACK, + JPEGXL_CT_CFA, + JPEGXL_CT_THERMAL, + JPEGXL_CT_NON_OPTIONAL = 15, + JPEGXL_CT_OPTIONAL +} FFJXLExtraChannelType; + +typedef enum FFJXLColorSpace { + JPEGXL_CS_RGB = 0, + JPEGXL_CS_GRAY, + JPEGXL_CS_XYB, + JPEGXL_CS_UNKNOWN +} FFJXLColorSpace; + +typedef enum FFJXLWhitePoint { + JPEGXL_WP_D65 = 1, + JPEGXL_WP_CUSTOM, + JPEGXL_WP_E = 10, + JPEGXL_WP_DCI = 11 +} FFJXLWhitePoint; + +typedef enum FFJXLPrimaries { + JPEGXL_PR_SRGB = 1, + JPEGXL_PR_CUSTOM, + JPEGXL_PR_2100 = 9, + JPEGXL_PR_P3 = 11, +} FFJXLPrimaries; + +typedef enum FFJXLTransferCharacteristic { + JPEGXL_TR_BT709 = 1, + JPEGXL_TR_UNKNOWN, + JPEGXL_TR_LINEAR = 8, + JPEGXL_TR_SRGB = 13, + JPEGXL_TR_PQ = 16, + JPEGXL_TR_DCI, + JPEGXL_TR_HLG, + JPEGXL_TR_GAMMA = 1 << 24, +} FFJXLTransferCharacteristic; + +#endif /* AVCODEC_JPEGXL_H */ diff --git a/include/libavcodec/jpegxl_parse.h b/include/libavcodec/jpegxl_parse.h new file mode 100644 index 0000000..0602f4d --- /dev/null +++ b/include/libavcodec/jpegxl_parse.h @@ -0,0 +1,72 @@ +/* + * JPEG XL Header Parser + * Copyright (c) 2023 Leo Izen + * + * 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_JPEGXL_PARSE_H +#define AVCODEC_JPEGXL_PARSE_H + +#include + +#include "libavutil/rational.h" + +#include "jpegxl.h" + +typedef struct FFJXLMetadata { + uint32_t width; + uint32_t height; + uint32_t coded_width; + uint32_t coded_height; + int bit_depth; + int have_alpha; + /* + * offset, in bits, of the animation header + * zero if not animated + */ + int animation_offset; + AVRational timebase; + FFJXLColorSpace csp; + FFJXLWhitePoint wp; + FFJXLPrimaries primaries; + FFJXLTransferCharacteristic trc; + + /* used by the parser */ + int xyb_encoded; + int have_icc_profile; + int have_timecodes; + uint32_t num_extra_channels; +} FFJXLMetadata; + +/* + * copies as much of the codestream into the buffer as possible + * pass a shorter buflen to request less + * returns the number of bytes consumed from input, may be greater than input_len + * if the input doesn't end on an ISOBMFF-box boundary + */ +int ff_jpegxl_collect_codestream_header(const uint8_t *input_buffer, int input_len, + uint8_t *buffer, int buflen, int *copied); + +/* + * Parse the codestream header with the provided buffer. Returns negative upon failure, + * or the number of bits consumed upon success. + * The FFJXLMetadata parameter may be NULL, in which case it's ignored. + */ +int ff_jpegxl_parse_codestream_header(const uint8_t *buf, int buflen, FFJXLMetadata *meta, int validate); + +#endif /* AVCODEC_JPEGXL_PARSE_H */ diff --git a/include/libavcodec/kbdwin.h b/include/libavcodec/kbdwin.h new file mode 100644 index 0000000..4185c42 --- /dev/null +++ b/include/libavcodec/kbdwin.h @@ -0,0 +1,38 @@ +/* + * 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_KBDWIN_H +#define AVCODEC_KBDWIN_H + +#include + +/** + * Maximum window size for ff_kbd_window_init. + */ +#define FF_KBD_WINDOW_MAX 1024 + +/** + * Generate a Kaiser-Bessel Derived Window. + * @param window pointer to half window + * @param alpha determines window shape + * @param n size of half window, max FF_KBD_WINDOW_MAX + */ +void ff_kbd_window_init(float *window, float alpha, int n); +void ff_kbd_window_init_fixed(int32_t *window, float alpha, int n); + +#endif /* AVCODEC_KBDWIN_H */ diff --git a/include/libavcodec/lagarithrac.h b/include/libavcodec/lagarithrac.h new file mode 100644 index 0000000..2c8cb73 --- /dev/null +++ b/include/libavcodec/lagarithrac.h @@ -0,0 +1,112 @@ +/* + * Lagarith range decoder + * Copyright (c) 2009 Nathan Caldwell + * Copyright (c) 2009 David Conrad + * + * 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 + */ + +/** + * @file + * Lagarith range decoder + * @author Nathan Caldwell + * @author David Conrad + */ + +#ifndef AVCODEC_LAGARITHRAC_H +#define AVCODEC_LAGARITHRAC_H + +#include +#include "libavutil/intreadwrite.h" +#include "get_bits.h" + +typedef struct lag_rac { + void *logctx; + unsigned low; + unsigned range; + unsigned scale; /**< Number of bits of precision in range. */ + unsigned hash_shift; /**< Number of bits to shift to calculate hash for radix search. */ + + const uint8_t *bytestream_start; /**< Start of input bytestream. */ + const uint8_t *bytestream; /**< Current position in input bytestream. */ + const uint8_t *bytestream_end; /**< End position of input bytestream. */ + + int overread; +#define MAX_OVERREAD 4 + + uint32_t prob[258]; /**< Table of cumulative probability for each symbol. */ + uint8_t range_hash[1024]; /**< Hash table mapping upper byte to approximate symbol. */ +} lag_rac; + +void ff_lag_rac_init(lag_rac *l, GetBitContext *gb, int length); + +/* TODO: Optimize */ +static inline void lag_rac_refill(lag_rac *l) +{ + while (l->range <= 0x800000) { + l->low <<= 8; + l->range <<= 8; + l->low |= 0xff & (AV_RB16(l->bytestream) >> 1); + if (l->bytestream < l->bytestream_end) + l->bytestream++; + else + l->overread++; + } +} + +/** + * Decode a single byte from the compressed plane described by *l. + * @param l pointer to lag_rac for the current plane + * @return next byte of decoded data + */ +static inline uint8_t lag_get_rac(lag_rac *l) +{ + unsigned range_scaled, low_scaled; + int val; + + lag_rac_refill(l); + + range_scaled = l->range >> l->scale; + + if (l->low < range_scaled * l->prob[255]) { + /* val = 0 is frequent enough to deserve a shortcut */ + if (l->low < range_scaled * l->prob[1]) { + val = 0; + } else { + low_scaled = l->low / (range_scaled<<(l->hash_shift)); + + val = l->range_hash[low_scaled]; + while (l->low >= range_scaled * l->prob[val + 1]) + val++; + } + + l->range = range_scaled * (l->prob[val + 1] - l->prob[val]); + } else { + val = 255; + l->range -= range_scaled * l->prob[255]; + } + + if (!l->range) + l->range = 0x80; + + l->low -= range_scaled * l->prob[val]; + + return val; +} + + +#endif /* AVCODEC_LAGARITHRAC_H */ diff --git a/include/libavcodec/lcevcdec.h b/include/libavcodec/lcevcdec.h new file mode 100644 index 0000000..7334d3a --- /dev/null +++ b/include/libavcodec/lcevcdec.h @@ -0,0 +1,42 @@ +/* + * 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_LCEVCDEC_H +#define AVCODEC_LCEVCDEC_H + +#include "config_components.h" + +#include +#if CONFIG_LIBLCEVC_DEC +#include +#else +typedef uintptr_t LCEVC_DecoderHandle; +#endif +#include "refstruct.h" + +typedef struct FFLCEVCContext { + LCEVC_DecoderHandle decoder; + int initialized; +} FFLCEVCContext; + +struct AVFrame; + +int ff_lcevc_alloc(FFLCEVCContext **plcevc); +int ff_lcevc_process(void *logctx, struct AVFrame *frame); +void ff_lcevc_unref(void *opaque); +#endif /* AVCODEC_LCEVCDEC_H */ diff --git a/include/libavcodec/lcl.h b/include/libavcodec/lcl.h new file mode 100644 index 0000000..b60c0e9 --- /dev/null +++ b/include/libavcodec/lcl.h @@ -0,0 +1,49 @@ +/* + * LCL (LossLess Codec Library) Codec + * Copyright (c) 2002-2004 Roberto Togni + * + * 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_LCL_H +#define AVCODEC_LCL_H + +#define BMPTYPE_YUV 1 +#define BMPTYPE_RGB 2 + +#define IMGTYPE_YUV111 0 +#define IMGTYPE_YUV422 1 +#define IMGTYPE_RGB24 2 +#define IMGTYPE_YUV411 3 +#define IMGTYPE_YUV211 4 +#define IMGTYPE_YUV420 5 + +#define COMP_MSZH 0 +#define COMP_MSZH_NOCOMP 1 +#define COMP_ZLIB_HISPEED 1 +#define COMP_ZLIB_HICOMP 9 +#define COMP_ZLIB_NORMAL -1 + +#define FLAG_MULTITHREAD 1 +#define FLAG_NULLFRAME 2 +#define FLAG_PNGFILTER 4 +#define FLAGMASK_UNUSED 0xf8 + +#define CODEC_MSZH 1 +#define CODEC_ZLIB 3 + +#endif /* AVCODEC_LCL_H */ diff --git a/include/libavcodec/leaddata.h b/include/libavcodec/leaddata.h new file mode 100644 index 0000000..525b582 --- /dev/null +++ b/include/libavcodec/leaddata.h @@ -0,0 +1,62 @@ +/* + * LEAD MCMP decoder tables + * + * 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_LEADDATA_H +#define AVCODEC_LEADDATA_H + +#include + +static const uint8_t luma_dc_len[]={ + 2, 3, 3, 3, 3, 3, 4, 5, 6, 7, 8, 9 +}; + +static const uint8_t chroma_dc_len[]={ + 2, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 +}; + +static const uint8_t luma_ac_len[]={ + 2, 2, 3, 4, 4, 4, 5, 5, 5, 6, 6, 7, 7, 7, 7, 8, + 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, + 12, 12, 12, 12, 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 +}; + +static const uint8_t chroma_ac_len[]={ + 2, 2, 3, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, + 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, + 11, 11, 11, 11, 12, 12, 12, 12, 14, 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 +}; + +#endif /* AVCODEC_LEADDATA_H */ diff --git a/include/libavcodec/leb.h b/include/libavcodec/leb.h new file mode 100644 index 0000000..5159c43 --- /dev/null +++ b/include/libavcodec/leb.h @@ -0,0 +1,70 @@ +/* + * 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 + */ + +/** + * @file + * leb128 handling implementations + */ + +#ifndef AVCODEC_LEB_H +#define AVCODEC_LEB_H + +#include "get_bits.h" + +/** + * Read a unsigned integer coded as a variable number of up to eight + * little-endian bytes, where the MSB in a byte signals another byte + * must be read. + * All coded bits are read, but values > UINT_MAX are truncated. + */ +static inline unsigned get_leb(GetBitContext *s) { + int more, i = 0; + unsigned leb = 0; + + do { + int byte = get_bits(s, 8); + unsigned bits = byte & 0x7f; + more = byte & 0x80; + if (i <= 4) + leb |= bits << (i * 7); + if (++i == 8) + break; + } while (more); + + return leb; +} + +/** + * Read a unsigned integer coded as a variable number of up to eight + * little-endian bytes, where the MSB in a byte signals another byte + * must be read. + */ +static inline int64_t get_leb128(GetBitContext *gb) { + int64_t ret = 0; + + for (int i = 0; i < 8; i++) { + int byte = get_bits(gb, 8); + ret |= (int64_t)(byte & 0x7f) << (i * 7); + if (!(byte & 0x80)) + break; + } + + return ret; +} + +#endif /* AVCODEC_LEB_H */ diff --git a/include/libavcodec/libaom.h b/include/libavcodec/libaom.h new file mode 100644 index 0000000..bb495af --- /dev/null +++ b/include/libavcodec/libaom.h @@ -0,0 +1,33 @@ +/* + * 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 + */ + +/** + * @file + * AOM common functions + */ + +#ifndef AVCODEC_LIBAOM_H +#define AVCODEC_LIBAOM_H + +#include + +#include "libavutil/frame.h" + +void ff_aom_image_copy_16_to_8(AVFrame *pic, struct aom_image *img); + +#endif /* AVCODEC_LIBAOM_H */ diff --git a/include/libavcodec/libjxl.h b/include/libavcodec/libjxl.h new file mode 100644 index 0000000..0b983a1 --- /dev/null +++ b/include/libavcodec/libjxl.h @@ -0,0 +1,49 @@ +/* + * JPEG XL de/encoding via libjxl, common support header + * Copyright (c) 2021 Leo Izen + * + * 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 + */ + +/** + * @file + * JPEG XL via libjxl common support header + */ + +#ifndef AVCODEC_LIBJXL_H +#define AVCODEC_LIBJXL_H + +#include +#include + +/** + * Transform threadcount in ffmpeg to one used by libjxl. + * + * @param threads ffmpeg's threads AVOption + * @return thread count for libjxl's parallel runner + */ +size_t ff_libjxl_get_threadcount(int threads); + +/** + * Initialize and populate a JxlMemoryManager + * with av_malloc() and av_free() so libjxl will use these + * functions. + * @param manager a pointer to a JxlMemoryManager struct + */ +void ff_libjxl_init_memory_manager(JxlMemoryManager *manager); + +#endif /* AVCODEC_LIBJXL_H */ diff --git a/include/libavcodec/libopenh264.h b/include/libavcodec/libopenh264.h new file mode 100644 index 0000000..0b462d6 --- /dev/null +++ b/include/libavcodec/libopenh264.h @@ -0,0 +1,37 @@ +/* + * OpenH264 shared utils + * Copyright (C) 2014 Martin Storsjo + * + * 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_LIBOPENH264_H +#define AVCODEC_LIBOPENH264_H + +#define OPENH264_VER_AT_LEAST(maj, min) \ + ((OPENH264_MAJOR > (maj)) || \ + (OPENH264_MAJOR == (maj) && OPENH264_MINOR >= (min))) + +// This function will be provided to the libopenh264 library. The function will be called +// when libopenh264 wants to log a message (error, warning, info, etc.). The signature for +// this function (defined in .../codec/api/svc/codec_api.h) is: +// +// typedef void (*WelsTraceCallback) (void* ctx, int level, const char* string); + +void ff_libopenh264_trace_callback(void *ctx, int level, const char *msg); + +#endif /* AVCODEC_LIBOPENH264_H */ diff --git a/include/libavcodec/libopus.h b/include/libavcodec/libopus.h new file mode 100644 index 0000000..a8223d1 --- /dev/null +++ b/include/libavcodec/libopus.h @@ -0,0 +1,27 @@ +/* + * libopus encoder/decoder common code + * Copyright (c) 2012 Nicolas George + * + * 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_LIBOPUS_H +#define AVCODEC_LIBOPUS_H + +int ff_opus_error_to_averror(int err); + +#endif /* AVCODEC_LIBOPUS_H */ diff --git a/include/libavcodec/libvpx.h b/include/libavcodec/libvpx.h new file mode 100644 index 0000000..4671e0e --- /dev/null +++ b/include/libavcodec/libvpx.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2013 Guillaume Martres + * + * 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_LIBVPX_H +#define AVCODEC_LIBVPX_H + +#define MAX_VPX_THREADS 64 + +#endif /* AVCODEC_LIBVPX_H */ diff --git a/include/libavcodec/libwebpenc_common.h b/include/libavcodec/libwebpenc_common.h new file mode 100644 index 0000000..2735ccc --- /dev/null +++ b/include/libavcodec/libwebpenc_common.h @@ -0,0 +1,64 @@ +/* + * WebP encoding support via libwebp + * Copyright (c) 2013 Justin Ruggles + * + * 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 + */ + +/** + * @file + * WebP encoder using libwebp: common structs and methods. + */ + +#ifndef AVCODEC_LIBWEBPENC_COMMON_H +#define AVCODEC_LIBWEBPENC_COMMON_H + +#include + +#include "libavutil/attributes.h" +#include "libavutil/frame.h" +#include "libavutil/log.h" +#include "libavutil/pixfmt.h" +#include "avcodec.h" +#include "codec_internal.h" + +typedef struct LibWebPContextCommon { + AVClass *class; // class for AVOptions + float quality; // lossy quality 0 - 100 + int lossless; // use lossless encoding + int preset; // configuration preset + int chroma_warning; // chroma linesize mismatch warning has been printed + int conversion_warning; // pixel format conversion warning has been printed + WebPConfig config; // libwebp configuration + AVFrame *ref; + int cr_size; + int cr_threshold; +} LibWebPContextCommon; + +int ff_libwebp_error_to_averror(int err); + +av_cold int ff_libwebp_encode_init_common(AVCodecContext *avctx); + +int ff_libwebp_get_frame(AVCodecContext *avctx, LibWebPContextCommon *s, + const AVFrame *frame, AVFrame **alt_frame_ptr, + WebPPicture **pic_ptr); + +extern const enum AVPixelFormat ff_libwebpenc_pix_fmts[]; +extern const AVClass ff_libwebpenc_class; +extern const FFCodecDefault ff_libwebp_defaults[]; + +#endif /* AVCODEC_LIBWEBPENC_COMMON_H */ diff --git a/include/libavcodec/lossless_audiodsp.h b/include/libavcodec/lossless_audiodsp.h new file mode 100644 index 0000000..cf2d43d --- /dev/null +++ b/include/libavcodec/lossless_audiodsp.h @@ -0,0 +1,52 @@ +/* + * Monkey's Audio lossless audio decoder + * Copyright (c) 2007 Benjamin Zores + * based upon libdemac from Dave Chapman. + * + * 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_LOSSLESS_AUDIODSP_H +#define AVCODEC_LOSSLESS_AUDIODSP_H + +#include + +typedef struct LLAudDSPContext { + /** + * Calculate scalar product of v1 and v2, + * and v1[i] += v3[i] * mul + * @param len length of vectors, should be multiple of 16, + * or padd v3 and v1 or v2 with zeros. + */ + int32_t (*scalarproduct_and_madd_int16)(int16_t *v1 /* align 16 */, + const int16_t *v2, + const int16_t *v3, + int len, int mul); + + int32_t (*scalarproduct_and_madd_int32)(int16_t *v1 /* align 16 */, + const int32_t *v2, + const int16_t *v3, + int len, int mul); +} LLAudDSPContext; + +void ff_llauddsp_init(LLAudDSPContext *c); +void ff_llauddsp_init_arm(LLAudDSPContext *c); +void ff_llauddsp_init_ppc(LLAudDSPContext *c); +void ff_llauddsp_init_riscv(LLAudDSPContext *c); +void ff_llauddsp_init_x86(LLAudDSPContext *c); + +#endif /* AVCODEC_LOSSLESS_AUDIODSP_H */ diff --git a/include/libavcodec/lossless_videodsp.h b/include/libavcodec/lossless_videodsp.h new file mode 100644 index 0000000..5309ce4 --- /dev/null +++ b/include/libavcodec/lossless_videodsp.h @@ -0,0 +1,47 @@ +/* + * Lossless video DSP utils + * + * 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_LOSSLESS_VIDEODSP_H +#define AVCODEC_LOSSLESS_VIDEODSP_H + +#include +#include + +typedef struct LLVidDSPContext { + void (*add_bytes)(uint8_t *dst /* align 32 */, uint8_t *src /* align 32 */, + ptrdiff_t w); + void (*add_median_pred)(uint8_t *dst, const uint8_t *top, + const uint8_t *diff, ptrdiff_t w, + int *left, int *left_top); + int (*add_left_pred)(uint8_t *dst, const uint8_t *src, + ptrdiff_t w, int left); + + int (*add_left_pred_int16)(uint16_t *dst, const uint16_t *src, + unsigned mask, ptrdiff_t w, unsigned left); + void (*add_gradient_pred)(uint8_t *src /* align 32 */, const ptrdiff_t stride, const ptrdiff_t width); +} LLVidDSPContext; + +void ff_llviddsp_init(LLVidDSPContext *llviddsp); +void ff_llviddsp_init_riscv(LLVidDSPContext *llviddsp); +void ff_llviddsp_init_x86(LLVidDSPContext *llviddsp); +void ff_llviddsp_init_ppc(LLVidDSPContext *llviddsp); + +#endif //AVCODEC_LOSSLESS_VIDEODSP_H diff --git a/include/libavcodec/lossless_videoencdsp.h b/include/libavcodec/lossless_videoencdsp.h new file mode 100644 index 0000000..7fd0ad3 --- /dev/null +++ b/include/libavcodec/lossless_videoencdsp.h @@ -0,0 +1,46 @@ +/* + * 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_LOSSLESS_VIDEOENCDSP_H +#define AVCODEC_LOSSLESS_VIDEOENCDSP_H + +#include +#include + +typedef struct LLVidEncDSPContext { + void (*diff_bytes)(uint8_t *dst /* align 1 */, + const uint8_t *src1 /* align 1 */, + const uint8_t *src2 /* align 1 */, + intptr_t w); + /** + * Subtract HuffYUV's variant of median prediction. + * Note, this might read from src1[-1], src2[-1]. + */ + void (*sub_median_pred)(uint8_t *dst, const uint8_t *src1, + const uint8_t *src2, intptr_t w, + int *left, int *left_top); + + void (*sub_left_predict)(uint8_t *dst, const uint8_t *src, + ptrdiff_t stride, ptrdiff_t width, int height); +} LLVidEncDSPContext; + +void ff_llvidencdsp_init(LLVidEncDSPContext *c); +void ff_llvidencdsp_init_riscv(LLVidEncDSPContext *c); +void ff_llvidencdsp_init_x86(LLVidEncDSPContext *c); + +#endif /* AVCODEC_LOSSLESS_VIDEOENCDSP_H */ diff --git a/include/libavcodec/lpc.h b/include/libavcodec/lpc.h new file mode 100644 index 0000000..6d62707 --- /dev/null +++ b/include/libavcodec/lpc.h @@ -0,0 +1,118 @@ +/* + * LPC utility code + * Copyright (c) 2006 Justin Ruggles + * + * 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_LPC_H +#define AVCODEC_LPC_H + +#include +#include +#include "libavutil/lls.h" + +#define ORDER_METHOD_EST 0 +#define ORDER_METHOD_2LEVEL 1 +#define ORDER_METHOD_4LEVEL 2 +#define ORDER_METHOD_8LEVEL 3 +#define ORDER_METHOD_SEARCH 4 +#define ORDER_METHOD_LOG 5 + +#define MIN_LPC_ORDER 1 +#define MAX_LPC_ORDER 32 + +/** + * LPC analysis type + */ +enum FFLPCType { + FF_LPC_TYPE_DEFAULT = -1, ///< use the codec default LPC type + FF_LPC_TYPE_NONE = 0, ///< do not use LPC prediction or use all zero coefficients + FF_LPC_TYPE_FIXED = 1, ///< fixed LPC coefficients + FF_LPC_TYPE_LEVINSON = 2, ///< Levinson-Durbin recursion + FF_LPC_TYPE_CHOLESKY = 3, ///< Cholesky factorization + FF_LPC_TYPE_NB , ///< Not part of ABI +}; + +typedef struct LPCContext { + int blocksize; + int max_order; + enum FFLPCType lpc_type; + double *windowed_buffer; + double *windowed_samples; + + /** + * Apply a Welch window to an array of input samples. + * The output samples have the same scale as the input, but are in double + * sample format. + * @param data input samples + * @param len number of input samples + * @param w_data output samples + */ + void (*lpc_apply_welch_window)(const int32_t *data, ptrdiff_t len, + double *w_data); + /** + * Perform autocorrelation on input samples with delay of 0 to lag. + * @param data input samples. + * constraints: no alignment needed, but must have at + * least lag*sizeof(double) valid bytes preceding it, and + * size must be at least (len+1)*sizeof(double) if data is + * 16-byte aligned or (len+2)*sizeof(double) if data is + * unaligned. + * @param len number of input samples to process + * @param lag maximum delay to calculate + * @param autoc output autocorrelation coefficients. + * constraints: array size must be at least lag+1. + */ + void (*lpc_compute_autocorr)(const double *data, ptrdiff_t len, int lag, + double *autoc); + + // TODO: these should be allocated to reduce ABI compatibility issues + LLSModel lls_models[2]; +} LPCContext; + + +/** + * Calculate LPC coefficients for multiple orders + */ +int ff_lpc_calc_coefs(LPCContext *s, + const int32_t *samples, int blocksize, int min_order, + int max_order, int precision, + int32_t coefs[][MAX_LPC_ORDER], int *shift, + enum FFLPCType lpc_type, int lpc_passes, + int omethod, int min_shift, int max_shift, int zero_shift); + +int ff_lpc_calc_ref_coefs(LPCContext *s, + const int32_t *samples, int order, double *ref); + +double ff_lpc_calc_ref_coefs_f(LPCContext *s, const float *samples, int len, + int order, double *ref); + +/** + * Initialize LPCContext. + */ +int ff_lpc_init(LPCContext *s, int blocksize, int max_order, + enum FFLPCType lpc_type); +void ff_lpc_init_riscv(LPCContext *s); +void ff_lpc_init_x86(LPCContext *s); + +/** + * Uninitialize LPCContext. + */ +void ff_lpc_end(LPCContext *s); + +#endif /* AVCODEC_LPC_H */ diff --git a/include/libavcodec/lpc_functions.h b/include/libavcodec/lpc_functions.h new file mode 100644 index 0000000..57bcfab --- /dev/null +++ b/include/libavcodec/lpc_functions.h @@ -0,0 +1,100 @@ +/* + * LPC utility functions + * Copyright (c) 2006 Justin Ruggles + * + * 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_LPC_FUNCTIONS_H +#define AVCODEC_LPC_FUNCTIONS_H + +#include "libavutil/avassert.h" + +#ifndef LPC_USE_FIXED +#define LPC_USE_FIXED 0 +#endif + +#if LPC_USE_FIXED +typedef int LPC_TYPE; +typedef unsigned LPC_TYPE_U; +#else +#ifndef LPC_SRA_R +#define LPC_SRA_R(x, y) (x) +#define LPC_MUL26(x, y) ((x) * (y)) +#define LPC_FIXR(x) ((float)(x)) +#endif + +#ifdef LPC_USE_DOUBLE +typedef double LPC_TYPE; +typedef double LPC_TYPE_U; +#else +typedef float LPC_TYPE; +typedef float LPC_TYPE_U; +#endif +#endif // USE_FIXED + +/** + * Levinson-Durbin recursion. + * Produce LPC coefficients from autocorrelation data. + */ +static inline int compute_lpc_coefs(const LPC_TYPE *autoc, int max_order, + LPC_TYPE *lpc, int lpc_stride, int fail, + int normalize) +{ + LPC_TYPE err = 0; + LPC_TYPE *lpc_last = lpc; + + av_assert2(normalize || !fail); + + if (normalize) + err = *autoc++; + + if (fail && (autoc[max_order - 1] == 0 || err <= 0)) + return -1; + + for(int i = 0; i < max_order; i++) { + LPC_TYPE r = LPC_SRA_R(-autoc[i], 5); + + if (normalize) { + for(int j = 0; j < i; j++) + r -= lpc_last[j] * autoc[i-j-1]; + + if (err) + r /= err; + err *= LPC_FIXR(1.0) - (r * r); + } + + lpc[i] = r; + + for(int j = 0; j < (i + 1) >> 1; j++) { + LPC_TYPE f = lpc_last[ j]; + LPC_TYPE b = lpc_last[i-1-j]; + lpc[ j] = f + (LPC_TYPE_U)LPC_MUL26(r, b); + lpc[i-1-j] = b + (LPC_TYPE_U)LPC_MUL26(r, f); + } + + if (fail && err < 0) + return -1; + + lpc_last = lpc; + lpc += lpc_stride; + } + + return 0; +} + +#endif /* AVCODEC_LPC_FUNCTIONS_H */ diff --git a/include/libavcodec/lsp.h b/include/libavcodec/lsp.h new file mode 100644 index 0000000..26b1382 --- /dev/null +++ b/include/libavcodec/lsp.h @@ -0,0 +1,118 @@ +/* + * LSP computing for ACELP-based codecs + * + * Copyright (c) 2008 Vladimir Voroshilov + * + * 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_LSP_H +#define AVCODEC_LSP_H + +#include + +/** + (I.F) means fixed-point value with F fractional and I integer bits +*/ + +/** + * @brief ensure a minimum distance between LSFs + * @param[in,out] lsfq LSF to check and adjust + * @param lsfq_min_distance minimum distance between LSFs + * @param lsfq_min minimum allowed LSF value + * @param lsfq_max maximum allowed LSF value + * @param lp_order LP filter order + */ +void ff_acelp_reorder_lsf(int16_t* lsfq, int lsfq_min_distance, int lsfq_min, int lsfq_max, int lp_order); + +/** + * Adjust the quantized LSFs so they are increasing and not too close. + * + * This step is not mentioned in the AMR spec but is in the reference C decoder. + * Omitting this step creates audible distortion on the sinusoidal sweep + * test vectors in 3GPP TS 26.074. + * + * @param[in,out] lsf LSFs in Hertz + * @param min_spacing minimum distance between two consecutive lsf values + * @param size size of the lsf vector + */ +void ff_set_min_dist_lsf(float *lsf, double min_spacing, int size); + +/** + * @brief Convert LSF to LSP + * @param[out] lsp LSP coefficients (-0x8000 <= (0.15) < 0x8000) + * @param lsf normalized LSF coefficients (0 <= (2.13) < 0x2000 * PI) + * @param lp_order LP filter order + * + * @remark It is safe to pass the same array into the lsf and lsp parameters. + */ +void ff_acelp_lsf2lsp(int16_t *lsp, const int16_t *lsf, int lp_order); + +/** + * Floating point version of ff_acelp_lsf2lsp() + */ +void ff_acelp_lsf2lspd(double *lsp, const float *lsf, int lp_order); + +/** + * @brief LSP to LP conversion (3.2.6 of G.729) + * @param[out] lp decoded LP coefficients (-0x8000 <= (3.12) < 0x8000) + * @param lsp LSP coefficients (-0x8000 <= (0.15) < 0x8000) + * @param lp_half_order LP filter order, divided by 2 + */ +void ff_acelp_lsp2lpc(int16_t* lp, const int16_t* lsp, int lp_half_order); + +/** + * LSP to LP conversion (5.2.4 of AMR-WB) + */ +void ff_amrwb_lsp2lpc(const double *lsp, float *lp, int lp_order); + +/** + * @brief Interpolate LSP for the first subframe and convert LSP -> LP for both subframes (3.2.5 and 3.2.6 of G.729) + * @param[out] lp_1st decoded LP coefficients for first subframe (-0x8000 <= (3.12) < 0x8000) + * @param[out] lp_2nd decoded LP coefficients for second subframe (-0x8000 <= (3.12) < 0x8000) + * @param lsp_2nd LSP coefficients of the second subframe (-0x8000 <= (0.15) < 0x8000) + * @param lsp_prev LSP coefficients from the second subframe of the previous frame (-0x8000 <= (0.15) < 0x8000) + * @param lp_order LP filter order + */ +void ff_acelp_lp_decode(int16_t* lp_1st, int16_t* lp_2nd, const int16_t* lsp_2nd, const int16_t* lsp_prev, int lp_order); + + +#define MAX_LP_HALF_ORDER 10 +#define MAX_LP_ORDER (2*MAX_LP_HALF_ORDER) + +/** + * Reconstruct LPC coefficients from the line spectral pair frequencies. + * + * @param lsp line spectral pairs in cosine domain + * @param lpc linear predictive coding coefficients + * @param lp_half_order half the number of the amount of LPCs to be + * reconstructed, need to be smaller or equal to MAX_LP_HALF_ORDER + * + * @note buffers should have a minimum size of 2*lp_half_order elements. + * + * TIA/EIA/IS-733 2.4.3.3.5 + */ +void ff_acelp_lspd2lpc(const double *lsp, float *lpc, int lp_half_order); + +/** + * Sort values in ascending order. + * + * @note O(n) if data already sorted, O(n^2) - otherwise + */ +void ff_sort_nearly_sorted_floats(float *vals, int len); + +#endif /* AVCODEC_LSP_H */ diff --git a/include/libavcodec/lzf.h b/include/libavcodec/lzf.h new file mode 100644 index 0000000..0ad73d9 --- /dev/null +++ b/include/libavcodec/lzf.h @@ -0,0 +1,29 @@ +/* + * lzf decompression algorithm + * Copyright (c) 2015 Luca Barbato + * + * 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_LZF_H +#define AVCODEC_LZF_H + +#include "bytestream.h" + +int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, int64_t *size); + +#endif /* AVCODEC_LZF_H */ diff --git a/include/libavcodec/lzw.h b/include/libavcodec/lzw.h new file mode 100644 index 0000000..dae4d05 --- /dev/null +++ b/include/libavcodec/lzw.h @@ -0,0 +1,61 @@ +/* + * LZW decoder + * Copyright (c) 2003 Fabrice Bellard + * Copyright (c) 2006 Konstantin Shishkov + * + * 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 + */ + +/** + * @file + * @brief LZW decoding routines + * @author Fabrice Bellard + * @author modified for use in TIFF by Konstantin Shishkov + */ + +#ifndef AVCODEC_LZW_H +#define AVCODEC_LZW_H + +#include + +struct PutBitContext; + +enum FF_LZW_MODES{ + FF_LZW_GIF, + FF_LZW_TIFF +}; + +/* clients should not know what LZWState is */ +typedef void LZWState; + +/* first two functions de/allocate memory for LZWState */ +void ff_lzw_decode_open(LZWState **p); +void ff_lzw_decode_close(LZWState **p); +int ff_lzw_decode_init(LZWState *s, int csize, const uint8_t *buf, int buf_size, int mode); +int ff_lzw_decode(LZWState *s, uint8_t *buf, int len); +int ff_lzw_decode_tail(LZWState *lzw); + +/** LZW encode state */ +struct LZWEncodeState; +extern const int ff_lzw_encode_state_size; + +void ff_lzw_encode_init(struct LZWEncodeState *s, uint8_t *outbuf, int outsize, + int maxbits, enum FF_LZW_MODES mode, int little_endian); +int ff_lzw_encode(struct LZWEncodeState * s, const uint8_t * inbuf, int insize); +int ff_lzw_encode_flush(struct LZWEncodeState *s); + +#endif /* AVCODEC_LZW_H */ diff --git a/include/libavcodec/mathops.h b/include/libavcodec/mathops.h new file mode 100644 index 0000000..84a924f --- /dev/null +++ b/include/libavcodec/mathops.h @@ -0,0 +1,253 @@ +/* + * simple math operations + * Copyright (c) 2001, 2002 Fabrice Bellard + * Copyright (c) 2006 Michael Niedermayer et al + * + * 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_MATHOPS_H +#define AVCODEC_MATHOPS_H + +#include + +#include "libavutil/attributes_internal.h" +#include "libavutil/common.h" +#include "config.h" + +#define MAX_NEG_CROP 1024 + +extern const uint32_t ff_inverse[257]; +extern const uint8_t ff_log2_run[41]; +extern const uint8_t ff_sqrt_tab[256]; +extern const uint8_t attribute_visibility_hidden ff_crop_tab[256 + 2 * MAX_NEG_CROP]; +extern const uint8_t ff_zigzag_direct[64]; +extern const uint8_t ff_zigzag_scan[16+1]; + +#if ARCH_ARM +# include "arm/mathops.h" +#elif ARCH_MIPS +# include "mips/mathops.h" +#elif ARCH_PPC +# include "ppc/mathops.h" +#elif ARCH_X86 +# include "x86/mathops.h" +#endif + +/* generic implementation */ + +#ifndef MUL64 +# define MUL64(a,b) ((int64_t)(a) * (int64_t)(b)) +#endif + +#ifndef MULL +# define MULL(a,b,s) (MUL64(a, b) >> (s)) +#endif + +#ifndef MULH +static av_always_inline int MULH(int a, int b){ + return MUL64(a, b) >> 32; +} +#endif + +#ifndef UMULH +static av_always_inline unsigned UMULH(unsigned a, unsigned b){ + return ((uint64_t)(a) * (uint64_t)(b))>>32; +} +#endif + +#ifndef MAC64 +# define MAC64(d, a, b) ((d) += MUL64(a, b)) +#endif + +#ifndef MLS64 +# define MLS64(d, a, b) ((d) -= MUL64(a, b)) +#endif + +/* signed 16x16 -> 32 multiply add accumulate */ +#ifndef MAC16 +# define MAC16(rt, ra, rb) rt += (ra) * (rb) +#endif + +/* signed 16x16 -> 32 multiply */ +#ifndef MUL16 +# define MUL16(ra, rb) ((ra) * (rb)) +#endif + +#ifndef MLS16 +# define MLS16(rt, ra, rb) ((rt) -= (ra) * (rb)) +#endif + +/* median of 3 */ +#ifndef mid_pred +#define mid_pred mid_pred +static inline av_const int mid_pred(int a, int b, int c) +{ + if(a>b){ + if(c>b){ + if(c>a) b=a; + else b=c; + } + }else{ + if(b>c){ + if(c>a) b=c; + else b=a; + } + } + return b; +} +#endif + +#ifndef median4 +#define median4 median4 +static inline av_const int median4(int a, int b, int c, int d) +{ + if (a < b) { + if (c < d) return (FFMIN(b, d) + FFMAX(a, c)) / 2; + else return (FFMIN(b, c) + FFMAX(a, d)) / 2; + } else { + if (c < d) return (FFMIN(a, d) + FFMAX(b, c)) / 2; + else return (FFMIN(a, c) + FFMAX(b, d)) / 2; + } +} +#endif + +#define FF_SIGNBIT(x) ((x) >> CHAR_BIT * sizeof(x) - 1) + +#ifndef sign_extend +static inline av_const int sign_extend(int val, unsigned bits) +{ + unsigned shift = 8 * sizeof(int) - bits; + union { unsigned u; int s; } v = { (unsigned) val << shift }; + return v.s >> shift; +} +#endif + +#ifndef sign_extend64 +static inline av_const int64_t sign_extend64(int64_t val, unsigned bits) +{ + unsigned shift = 8 * sizeof(int64_t) - bits; + union { uint64_t u; int64_t s; } v = { (uint64_t) val << shift }; + return v.s >> shift; +} +#endif + +#ifndef zero_extend +static inline av_const unsigned zero_extend(unsigned val, unsigned bits) +{ + return (val << ((8 * sizeof(int)) - bits)) >> ((8 * sizeof(int)) - bits); +} +#endif + +#ifndef COPY3_IF_LT +#define COPY3_IF_LT(x, y, a, b, c, d)\ +if ((y) < (x)) {\ + (x) = (y);\ + (a) = (b);\ + (c) = (d);\ +} +#endif + +#ifndef MASK_ABS +#define MASK_ABS(mask, level) do { \ + mask = level >> 31; \ + level = (level ^ mask) - mask; \ + } while (0) +#endif + +#ifndef NEG_SSR32 +# define NEG_SSR32(a,s) ((( int32_t)(a))>>(32-(s))) +#endif + +#ifndef NEG_USR32 +# define NEG_USR32(a,s) (((uint32_t)(a))>>(32-(s))) +#endif + +#if HAVE_BIGENDIAN +# ifndef PACK_2U8 +# define PACK_2U8(a,b) (((a) << 8) | (b)) +# endif +# ifndef PACK_4U8 +# define PACK_4U8(a,b,c,d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d)) +# endif +# ifndef PACK_2U16 +# define PACK_2U16(a,b) (((a) << 16) | (b)) +# endif +#else +# ifndef PACK_2U8 +# define PACK_2U8(a,b) (((b) << 8) | (a)) +# endif +# ifndef PACK_4U2 +# define PACK_4U8(a,b,c,d) (((d) << 24) | ((c) << 16) | ((b) << 8) | (a)) +# endif +# ifndef PACK_2U16 +# define PACK_2U16(a,b) (((b) << 16) | (a)) +# endif +#endif + +#ifndef PACK_2S8 +# define PACK_2S8(a,b) PACK_2U8((a)&255, (b)&255) +#endif +#ifndef PACK_4S8 +# define PACK_4S8(a,b,c,d) PACK_4U8((a)&255, (b)&255, (c)&255, (d)&255) +#endif +#ifndef PACK_2S16 +# define PACK_2S16(a,b) PACK_2U16((a)&0xffff, (b)&0xffff) +#endif + +#ifndef FASTDIV +# define FASTDIV(a,b) ((uint32_t)((((uint64_t)a) * ff_inverse[b]) >> 32)) +#endif /* FASTDIV */ + +#ifndef ff_sqrt +#define ff_sqrt ff_sqrt +static inline av_const unsigned int ff_sqrt(unsigned int a) +{ + unsigned int b; + + if (a < 255) return (ff_sqrt_tab[a + 1] - 1) >> 4; + else if (a < (1 << 12)) b = ff_sqrt_tab[a >> 4] >> 2; +#if !CONFIG_SMALL + else if (a < (1 << 14)) b = ff_sqrt_tab[a >> 6] >> 1; + else if (a < (1 << 16)) b = ff_sqrt_tab[a >> 8] ; +#endif + else { + int s = av_log2_16bit(a >> 16) >> 1; + unsigned int c = a >> (s + 2); + b = ff_sqrt_tab[c >> (s + 8)]; + b = FASTDIV(c,b) + (b << s); + } + + return b - (a < b * b); +} +#endif + +static inline av_const float ff_sqrf(float a) +{ + return a*a; +} + +static inline int8_t ff_u8_to_s8(uint8_t a) +{ + union { + uint8_t u8; + int8_t s8; + } b; + b.u8 = a; + return b.s8; +} + +#endif /* AVCODEC_MATHOPS_H */ diff --git a/include/libavcodec/me_cmp.h b/include/libavcodec/me_cmp.h new file mode 100644 index 0000000..9053327 --- /dev/null +++ b/include/libavcodec/me_cmp.h @@ -0,0 +1,97 @@ +/* + * 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_ME_CMP_H +#define AVCODEC_ME_CMP_H + +#include + +#include "libavutil/attributes_internal.h" + +#include "avcodec.h" + +extern const uint32_t attribute_visibility_hidden ff_square_tab[512]; + + +/* minimum alignment rules ;) + * If you notice errors in the align stuff, need more alignment for some ASM code + * for some CPU or need to use a function with less aligned data then send a mail + * to the ffmpeg-devel mailing list, ... + * + * !warning These alignments might not match reality, (missing attribute((align)) + * stuff somewhere possible). + * I (Michael) did not check them, these are just the alignments which I think + * could be reached easily ... + * + * !future video codecs might need functions with less strict alignment + */ + +struct MpegEncContext; +/* Motion estimation: + * h is limited to { width / 2, width, 2 * width }, + * but never larger than 16 and never smaller than 2. + * Although currently h < 4 is not used as functions with + * width < 8 are neither used nor implemented. */ +typedef int (*me_cmp_func)(struct MpegEncContext *c, + const uint8_t *blk1 /* align width (8 or 16) */, + const uint8_t *blk2 /* align 1 */, ptrdiff_t stride, + int h); + +typedef struct MECmpContext { + int (*sum_abs_dctelem)(const int16_t *block /* align 16 */); + + me_cmp_func sad[6]; /* identical to pix_absAxA except additional void * */ + me_cmp_func sse[6]; + me_cmp_func hadamard8_diff[6]; + me_cmp_func dct_sad[6]; + me_cmp_func quant_psnr[6]; + me_cmp_func bit[6]; + me_cmp_func rd[6]; + me_cmp_func vsad[6]; + me_cmp_func vsse[6]; + me_cmp_func nsse[6]; + me_cmp_func w53[6]; + me_cmp_func w97[6]; + me_cmp_func dct_max[6]; + me_cmp_func dct264_sad[6]; + + me_cmp_func pix_abs[2][4]; + me_cmp_func median_sad[6]; +} MECmpContext; + +void ff_me_cmp_init(MECmpContext *c, AVCodecContext *avctx); +void ff_me_cmp_init_aarch64(MECmpContext *c, AVCodecContext *avctx); +void ff_me_cmp_init_alpha(MECmpContext *c, AVCodecContext *avctx); +void ff_me_cmp_init_arm(MECmpContext *c, AVCodecContext *avctx); +void ff_me_cmp_init_ppc(MECmpContext *c, AVCodecContext *avctx); +void ff_me_cmp_init_riscv(MECmpContext *c, AVCodecContext *avctx); +void ff_me_cmp_init_x86(MECmpContext *c, AVCodecContext *avctx); +void ff_me_cmp_init_mips(MECmpContext *c, AVCodecContext *avctx); + +/** + * Fill the function pointer array cmp[6] with me_cmp_funcs from + * c based upon type. If mpvenc is not set, an error is returned + * if the type of comparison functions requires an initialized + * MpegEncContext. + */ +int ff_set_cmp(const MECmpContext *c, me_cmp_func *cmp, + int type, int mpvenc); + +void ff_dsputil_init_dwt(MECmpContext *c); + +#endif /* AVCODEC_ME_CMP_H */ diff --git a/include/libavcodec/mediacodec.h b/include/libavcodec/mediacodec.h index 4c8545d..4e9b56a 100644 --- a/include/libavcodec/mediacodec.h +++ b/include/libavcodec/mediacodec.h @@ -88,13 +88,15 @@ int av_mediacodec_release_buffer(AVMediaCodecBuffer *buffer, int render); /** * Release a MediaCodec buffer and render it at the given time to the surface * that is associated with the decoder. The timestamp must be within one second - * of the current java/lang/System#nanoTime() (which is implemented using - * CLOCK_MONOTONIC on Android). See the Android MediaCodec documentation - * of android/media/MediaCodec#releaseOutputBuffer(int,long) for more details. + * of the current `java/lang/System#nanoTime()` (which is implemented using + * `CLOCK_MONOTONIC` on Android). See the Android MediaCodec documentation + * of [`android/media/MediaCodec#releaseOutputBuffer(int,long)`][0] for more details. * * @param buffer the buffer to render * @param time timestamp in nanoseconds of when to render the buffer * @return 0 on success, < 0 otherwise + * + * [0]: https://developer.android.com/reference/android/media/MediaCodec#releaseOutputBuffer(int,%20long) */ int av_mediacodec_render_buffer_at_time(AVMediaCodecBuffer *buffer, int64_t time); diff --git a/include/libavcodec/mediacodec_surface.h b/include/libavcodec/mediacodec_surface.h new file mode 100644 index 0000000..e2ac1c9 --- /dev/null +++ b/include/libavcodec/mediacodec_surface.h @@ -0,0 +1,36 @@ +/* + * Android MediaCodec Surface functions + * + * Copyright (c) 2016 Matthieu Bouron + * + * 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_MEDIACODEC_SURFACE_H +#define AVCODEC_MEDIACODEC_SURFACE_H + +#include "libavcodec/avcodec.h" + +typedef struct FFANativeWindow { + void *surface; + void *native_window; +} FFANativeWindow; + +FFANativeWindow *ff_mediacodec_surface_ref(void *surface, void *native_window, void *log_ctx); +int ff_mediacodec_surface_unref(FFANativeWindow *window, void *log_ctx); + +#endif /* AVCODEC_MEDIACODEC_SURFACE_H */ diff --git a/include/libavcodec/mediacodec_sw_buffer.h b/include/libavcodec/mediacodec_sw_buffer.h new file mode 100644 index 0000000..574fb52 --- /dev/null +++ b/include/libavcodec/mediacodec_sw_buffer.h @@ -0,0 +1,62 @@ +/* + * Android MediaCodec software buffer copy functions + * + * Copyright (c) 2015-2016 Matthieu Bouron + * + * 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_MEDIACODEC_SW_BUFFER_H +#define AVCODEC_MEDIACODEC_SW_BUFFER_H + +#include + +#include "libavutil/frame.h" + +#include "avcodec.h" +#include "mediacodec_wrapper.h" +#include "mediacodecdec_common.h" + +void ff_mediacodec_sw_buffer_copy_yuv420_planar(AVCodecContext *avctx, + MediaCodecDecContext *s, + uint8_t *data, + size_t size, + FFAMediaCodecBufferInfo *info, + AVFrame *frame); + +void ff_mediacodec_sw_buffer_copy_yuv420_semi_planar(AVCodecContext *avctx, + MediaCodecDecContext *s, + uint8_t *data, + size_t size, + FFAMediaCodecBufferInfo *info, + AVFrame *frame); + +void ff_mediacodec_sw_buffer_copy_yuv420_packed_semi_planar(AVCodecContext *avctx, + MediaCodecDecContext *s, + uint8_t *data, + size_t size, + FFAMediaCodecBufferInfo *info, + AVFrame *frame); + +void ff_mediacodec_sw_buffer_copy_yuv420_packed_semi_planar_64x32Tile2m8ka(AVCodecContext *avctx, + MediaCodecDecContext *s, + uint8_t *data, + size_t size, + FFAMediaCodecBufferInfo *info, + AVFrame *frame); + +#endif /* AVCODEC_MEDIACODEC_SW_BUFFER_H */ diff --git a/include/libavcodec/mediacodec_wrapper.h b/include/libavcodec/mediacodec_wrapper.h new file mode 100644 index 0000000..11a4260 --- /dev/null +++ b/include/libavcodec/mediacodec_wrapper.h @@ -0,0 +1,421 @@ +/* + * Android MediaCodec Wrapper + * + * Copyright (c) 2015-2016 Matthieu Bouron + * + * 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_MEDIACODEC_WRAPPER_H +#define AVCODEC_MEDIACODEC_WRAPPER_H + +#include +#include + +#include "avcodec.h" +#include "mediacodec_surface.h" + +/** + * The following API around MediaCodec and MediaFormat is based on the + * NDK one provided by Google since Android 5.0. + * + * Differences from the NDK API: + * + * Buffers returned by ff_AMediaFormat_toString and ff_AMediaFormat_getString + * are newly allocated buffer and must be freed by the user after use. + * + * The MediaCrypto API is not implemented. + * + * ff_AMediaCodec_infoTryAgainLater, ff_AMediaCodec_infoOutputBuffersChanged, + * ff_AMediaCodec_infoOutputFormatChanged, ff_AMediaCodec_cleanOutputBuffers + * ff_AMediaCodec_getName and ff_AMediaCodec_getBufferFlagEndOfStream are not + * part of the original NDK API and are convenience functions to hide JNI + * implementation. + * + * The API around MediaCodecList is not part of the NDK (and is lacking as + * we still need to retrieve the codec name to work around faulty decoders + * and encoders). + * + * For documentation, please refers to NdkMediaCodec.h NdkMediaFormat.h and + * http://developer.android.com/reference/android/media/MediaCodec.html. + * + */ + +int ff_AMediaCodecProfile_getProfileFromAVCodecContext(AVCodecContext *avctx); + +char *ff_AMediaCodecList_getCodecNameByType(const char *mime, int profile, int encoder, void *log_ctx); + +typedef struct FFAMediaFormat FFAMediaFormat; +struct FFAMediaFormat { + const AVClass *class; + + FFAMediaFormat *(*create)(void); + int (*delete)(FFAMediaFormat *); + + char* (*toString)(FFAMediaFormat* format); + + int (*getInt32)(FFAMediaFormat* format, const char *name, int32_t *out); + int (*getInt64)(FFAMediaFormat* format, const char *name, int64_t *out); + int (*getFloat)(FFAMediaFormat* format, const char *name, float *out); + int (*getBuffer)(FFAMediaFormat* format, const char *name, void** data, size_t *size); + int (*getString)(FFAMediaFormat* format, const char *name, const char **out); + // NDK only, introduced in API level 28 + int (*getRect)(FFAMediaFormat *, const char *name, + int32_t *left, int32_t *top, int32_t *right, int32_t *bottom); + + void (*setInt32)(FFAMediaFormat* format, const char* name, int32_t value); + void (*setInt64)(FFAMediaFormat* format, const char* name, int64_t value); + void (*setFloat)(FFAMediaFormat* format, const char* name, float value); + void (*setString)(FFAMediaFormat* format, const char* name, const char* value); + void (*setBuffer)(FFAMediaFormat* format, const char* name, void* data, size_t size); + // NDK only, introduced in API level 28 + void (*setRect)(FFAMediaFormat*, const char* name, + int32_t left, int32_t top, int32_t right, int32_t bottom); +}; + +FFAMediaFormat *ff_AMediaFormat_new(int ndk); + +static inline int ff_AMediaFormat_delete(FFAMediaFormat* format) +{ + return format->delete(format); +} + +static inline char* ff_AMediaFormat_toString(FFAMediaFormat* format) +{ + return format->toString(format); +} + +static inline int ff_AMediaFormat_getInt32(FFAMediaFormat* format, const char *name, int32_t *out) +{ + return format->getInt32(format, name, out); +} + +static inline int ff_AMediaFormat_getInt64(FFAMediaFormat* format, const char *name, int64_t *out) +{ + return format->getInt64(format, name, out); +} + +static inline int ff_AMediaFormat_getFloat(FFAMediaFormat* format, const char *name, float *out) +{ + return format->getFloat(format, name, out); +} + +static inline int ff_AMediaFormat_getBuffer(FFAMediaFormat* format, const char *name, void** data, size_t *size) +{ + return format->getBuffer(format, name, data, size); +} + +static inline int ff_AMediaFormat_getString(FFAMediaFormat* format, const char *name, const char **out) +{ + return format->getString(format, name, out); +} + +static inline int ff_AMediaFormat_getRect(FFAMediaFormat *format, const char *name, + int32_t *left, int32_t *top, int32_t *right, int32_t *bottom) +{ + if (!format->getRect) + return AVERROR_EXTERNAL; + return format->getRect(format, name, left, top, right, bottom); +} + +static inline void ff_AMediaFormat_setInt32(FFAMediaFormat* format, const char* name, int32_t value) +{ + format->setInt32(format, name, value); +} + +static inline void ff_AMediaFormat_setInt64(FFAMediaFormat* format, const char* name, int64_t value) +{ + format->setInt64(format, name, value); +} + +static inline void ff_AMediaFormat_setFloat(FFAMediaFormat* format, const char* name, float value) +{ + format->setFloat(format, name, value); +} + +static inline void ff_AMediaFormat_setString(FFAMediaFormat* format, const char* name, const char* value) +{ + format->setString(format, name, value); +} + +static inline void ff_AMediaFormat_setBuffer(FFAMediaFormat* format, const char* name, void* data, size_t size) +{ + format->setBuffer(format, name, data, size); +} + +static inline void ff_AMediaFormat_setRect(FFAMediaFormat* format, const char* name, + int32_t left, int32_t top, int32_t right, int32_t bottom) +{ + if (!format->setRect) { + av_log(format, AV_LOG_WARNING, "Doesn't support setRect\n"); + return; + } + format->setRect(format, name, left, top, right, bottom); +} + +typedef struct FFAMediaCodecCryptoInfo FFAMediaCodecCryptoInfo; + +struct FFAMediaCodecBufferInfo { + int32_t offset; + int32_t size; + int64_t presentationTimeUs; + uint32_t flags; +}; +typedef struct FFAMediaCodecBufferInfo FFAMediaCodecBufferInfo; + +typedef struct FFAMediaCodec FFAMediaCodec; +struct FFAMediaCodec { + const AVClass *class; + + char *(*getName)(FFAMediaCodec *codec); + + FFAMediaCodec* (*createCodecByName)(const char *name); + FFAMediaCodec* (*createDecoderByType)(const char *mime_type); + FFAMediaCodec* (*createEncoderByType)(const char *mime_type); + int (*delete)(FFAMediaCodec* codec); + + int (*configure)(FFAMediaCodec* codec, const FFAMediaFormat* format, FFANativeWindow* surface, void *crypto, uint32_t flags); + int (*start)(FFAMediaCodec* codec); + int (*stop)(FFAMediaCodec* codec); + int (*flush)(FFAMediaCodec* codec); + + uint8_t* (*getInputBuffer)(FFAMediaCodec* codec, size_t idx, size_t *out_size); + uint8_t* (*getOutputBuffer)(FFAMediaCodec* codec, size_t idx, size_t *out_size); + + ssize_t (*dequeueInputBuffer)(FFAMediaCodec* codec, int64_t timeoutUs); + int (*queueInputBuffer)(FFAMediaCodec* codec, size_t idx, off_t offset, size_t size, uint64_t time, uint32_t flags); + + ssize_t (*dequeueOutputBuffer)(FFAMediaCodec* codec, FFAMediaCodecBufferInfo *info, int64_t timeoutUs); + FFAMediaFormat* (*getOutputFormat)(FFAMediaCodec* codec); + + int (*releaseOutputBuffer)(FFAMediaCodec* codec, size_t idx, int render); + int (*releaseOutputBufferAtTime)(FFAMediaCodec *codec, size_t idx, int64_t timestampNs); + + int (*infoTryAgainLater)(FFAMediaCodec *codec, ssize_t idx); + int (*infoOutputBuffersChanged)(FFAMediaCodec *codec, ssize_t idx); + int (*infoOutputFormatChanged)(FFAMediaCodec *codec, ssize_t indx); + + int (*getBufferFlagCodecConfig)(FFAMediaCodec *codec); + int (*getBufferFlagEndOfStream)(FFAMediaCodec *codec); + int (*getBufferFlagKeyFrame)(FFAMediaCodec *codec); + + int (*getConfigureFlagEncode)(FFAMediaCodec *codec); + + int (*cleanOutputBuffers)(FFAMediaCodec *codec); + + // For encoder with FFANativeWindow as input. + int (*signalEndOfInputStream)(FFAMediaCodec *); +}; + +static inline char *ff_AMediaCodec_getName(FFAMediaCodec *codec) +{ + return codec->getName(codec); +} + +FFAMediaCodec* ff_AMediaCodec_createCodecByName(const char *name, int ndk); +FFAMediaCodec* ff_AMediaCodec_createDecoderByType(const char *mime_type, int ndk); +FFAMediaCodec* ff_AMediaCodec_createEncoderByType(const char *mime_type, int ndk); + +static inline int ff_AMediaCodec_configure(FFAMediaCodec *codec, + const FFAMediaFormat *format, + FFANativeWindow *surface, + void *crypto, uint32_t flags) +{ + return codec->configure(codec, format, surface, crypto, flags); +} + +static inline int ff_AMediaCodec_start(FFAMediaCodec* codec) +{ + return codec->start(codec); +} + +static inline int ff_AMediaCodec_stop(FFAMediaCodec* codec) +{ + return codec->stop(codec); +} + +static inline int ff_AMediaCodec_flush(FFAMediaCodec* codec) +{ + return codec->flush(codec); +} + +static inline int ff_AMediaCodec_delete(FFAMediaCodec* codec) +{ + return codec->delete(codec); +} + +static inline uint8_t* ff_AMediaCodec_getInputBuffer(FFAMediaCodec* codec, size_t idx, size_t *out_size) +{ + return codec->getInputBuffer(codec, idx, out_size); +} + +static inline uint8_t* ff_AMediaCodec_getOutputBuffer(FFAMediaCodec* codec, size_t idx, size_t *out_size) +{ + return codec->getOutputBuffer(codec, idx, out_size); +} + +static inline ssize_t ff_AMediaCodec_dequeueInputBuffer(FFAMediaCodec* codec, int64_t timeoutUs) +{ + return codec->dequeueInputBuffer(codec, timeoutUs); +} + +static inline int ff_AMediaCodec_queueInputBuffer(FFAMediaCodec *codec, size_t idx, off_t offset, size_t size, uint64_t time, uint32_t flags) +{ + return codec->queueInputBuffer(codec, idx, offset, size, time, flags); +} + +static inline ssize_t ff_AMediaCodec_dequeueOutputBuffer(FFAMediaCodec* codec, FFAMediaCodecBufferInfo *info, int64_t timeoutUs) +{ + return codec->dequeueOutputBuffer(codec, info, timeoutUs); +} + +static inline FFAMediaFormat* ff_AMediaCodec_getOutputFormat(FFAMediaCodec* codec) +{ + return codec->getOutputFormat(codec); +} + +static inline int ff_AMediaCodec_releaseOutputBuffer(FFAMediaCodec* codec, size_t idx, int render) +{ + return codec->releaseOutputBuffer(codec, idx, render); +} + +static inline int ff_AMediaCodec_releaseOutputBufferAtTime(FFAMediaCodec *codec, size_t idx, int64_t timestampNs) +{ + return codec->releaseOutputBufferAtTime(codec, idx, timestampNs); +} + +static inline int ff_AMediaCodec_infoTryAgainLater(FFAMediaCodec *codec, ssize_t idx) +{ + return codec->infoTryAgainLater(codec, idx); +} + +static inline int ff_AMediaCodec_infoOutputBuffersChanged(FFAMediaCodec *codec, ssize_t idx) +{ + return codec->infoOutputBuffersChanged(codec, idx); +} + +static inline int ff_AMediaCodec_infoOutputFormatChanged(FFAMediaCodec *codec, ssize_t idx) +{ + return codec->infoOutputFormatChanged(codec, idx); +} + +static inline int ff_AMediaCodec_getBufferFlagCodecConfig(FFAMediaCodec *codec) +{ + return codec->getBufferFlagCodecConfig(codec); +} + +static inline int ff_AMediaCodec_getBufferFlagEndOfStream(FFAMediaCodec *codec) +{ + return codec->getBufferFlagEndOfStream(codec); +} + +static inline int ff_AMediaCodec_getBufferFlagKeyFrame(FFAMediaCodec *codec) +{ + return codec->getBufferFlagKeyFrame(codec); +} + +static inline int ff_AMediaCodec_getConfigureFlagEncode(FFAMediaCodec *codec) +{ + return codec->getConfigureFlagEncode(codec); +} + +static inline int ff_AMediaCodec_cleanOutputBuffers(FFAMediaCodec *codec) +{ + return codec->cleanOutputBuffers(codec); +} + +static inline int ff_AMediaCodec_signalEndOfInputStream(FFAMediaCodec *codec) +{ + return codec->signalEndOfInputStream(codec); +} + +int ff_Build_SDK_INT(AVCodecContext *avctx); + +enum FFAMediaFormatColorRange { + COLOR_RANGE_UNSPECIFIED = 0x0, + COLOR_RANGE_FULL = 0x1, + COLOR_RANGE_LIMITED = 0x2, +}; + +enum FFAMediaFormatColorStandard { + COLOR_STANDARD_UNSPECIFIED = 0x0, + COLOR_STANDARD_BT709 = 0x1, + COLOR_STANDARD_BT601_PAL = 0x2, + COLOR_STANDARD_BT601_NTSC = 0x4, + COLOR_STANDARD_BT2020 = 0x6, +}; + +enum FFAMediaFormatColorTransfer { + COLOR_TRANSFER_UNSPECIFIED = 0x0, + COLOR_TRANSFER_LINEAR = 0x1, + COLOR_TRANSFER_SDR_VIDEO = 0x3, + COLOR_TRANSFER_ST2084 = 0x6, + COLOR_TRANSFER_HLG = 0x7, +}; + +/** + * Map MediaFormat color range to AVColorRange. + * + * return AVCOL_RANGE_UNSPECIFIED when failed. + */ +enum AVColorRange ff_AMediaFormatColorRange_to_AVColorRange(int color_range); + +/** + * Map AVColorRange to MediaFormat color range. + * + * return COLOR_RANGE_UNSPECIFIED when failed. + */ +int ff_AMediaFormatColorRange_from_AVColorRange(enum AVColorRange color_range); + +/** + * Map MediaFormat color standard to AVColorSpace. + * + * return AVCOL_SPC_UNSPECIFIED when failed. + */ +enum AVColorSpace ff_AMediaFormatColorStandard_to_AVColorSpace(int color_standard); + +/** + * Map AVColorSpace to MediaFormat color standard. + * + * return COLOR_STANDARD_UNSPECIFIED when failed. + */ +int ff_AMediaFormatColorStandard_from_AVColorSpace(enum AVColorSpace color_space); + +/** + * Map MediaFormat color standard to AVColorPrimaries. + * + * return AVCOL_PRI_UNSPECIFIED when failed. + */ +enum AVColorPrimaries ff_AMediaFormatColorStandard_to_AVColorPrimaries(int color_standard); + +/** + * Map MediaFormat color transfer to AVColorTransferCharacteristic. + * + * return AVCOL_TRC_UNSPECIFIED when failed. + */ +enum AVColorTransferCharacteristic +ff_AMediaFormatColorTransfer_to_AVColorTransfer(int color_transfer); + +/** + * Map AVColorTransferCharacteristic to MediaFormat color transfer. + * + * return COLOR_TRANSFER_UNSPECIFIED when failed. + */ +int ff_AMediaFormatColorTransfer_from_AVColorTransfer( + enum AVColorTransferCharacteristic color_transfer); + +#endif /* AVCODEC_MEDIACODEC_WRAPPER_H */ diff --git a/include/libavcodec/mediacodecdec_common.h b/include/libavcodec/mediacodecdec_common.h new file mode 100644 index 0000000..0ab2903 --- /dev/null +++ b/include/libavcodec/mediacodecdec_common.h @@ -0,0 +1,110 @@ +/* + * Android MediaCodec decoder + * + * Copyright (c) 2015-2016 Matthieu Bouron + * + * 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_MEDIACODECDEC_COMMON_H +#define AVCODEC_MEDIACODECDEC_COMMON_H + +#include +#include +#include +#include + +#include "libavutil/frame.h" +#include "libavutil/pixfmt.h" + +#include "avcodec.h" +#include "mediacodec_wrapper.h" + +typedef struct MediaCodecDecContext { + + AVCodecContext *avctx; + atomic_int refcount; + atomic_int hw_buffer_count; + + char *codec_name; + + FFAMediaCodec *codec; + FFAMediaFormat *format; + + void *surface; + + int started; + int draining; + int flushing; + int eos; + + int width; + int height; + int stride; + int slice_height; + int color_format; + int crop_top; + int crop_bottom; + int crop_left; + int crop_right; + int display_width; + int display_height; + + uint64_t output_buffer_count; + ssize_t current_input_buffer; + + bool delay_flush; + atomic_int serial; + + bool use_ndk_codec; +} MediaCodecDecContext; + +int ff_mediacodec_dec_init(AVCodecContext *avctx, + MediaCodecDecContext *s, + const char *mime, + FFAMediaFormat *format); + +int ff_mediacodec_dec_send(AVCodecContext *avctx, + MediaCodecDecContext *s, + AVPacket *pkt, + bool wait); + +int ff_mediacodec_dec_receive(AVCodecContext *avctx, + MediaCodecDecContext *s, + AVFrame *frame, + bool wait); + +int ff_mediacodec_dec_flush(AVCodecContext *avctx, + MediaCodecDecContext *s); + +int ff_mediacodec_dec_close(AVCodecContext *avctx, + MediaCodecDecContext *s); + +int ff_mediacodec_dec_is_flushing(AVCodecContext *avctx, + MediaCodecDecContext *s); + +typedef struct MediaCodecBuffer { + + MediaCodecDecContext *ctx; + ssize_t index; + int64_t pts; + atomic_int released; + int serial; + +} MediaCodecBuffer; + +#endif /* AVCODEC_MEDIACODECDEC_COMMON_H */ diff --git a/include/libavcodec/metasound_data.h b/include/libavcodec/metasound_data.h new file mode 100644 index 0000000..6ff84cf --- /dev/null +++ b/include/libavcodec/metasound_data.h @@ -0,0 +1,13942 @@ +/* + * MetaSound decoder + * Copyright (c) 2013 Konstantin Shishkov + * + * 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_METASOUND_DATA_H +#define AVCODEC_METASOUND_DATA_H + +#include "twinvq.h" + +static const int16_t cb0806sl0[] = { + -417, -225, -84, 16, -106, -34, -246, -164, + 112, 48, -47, 36, -65, -68, -172, -1655, + -36, 140, -3, -2, -2, 2, 0, 0, + 178, 7, -181, -177, 120, -64, -129, 80, + -6826, -38, -25, 147, 148, -13, -25, 110, + 21, 21, -1, 0, 0, 0, 0, 0, + 3319, 632, -734, -187, 40, -249, -155, -1, + -173, 95, 28, -2, 20, -44, 35, 120, + -47, -221, -5, 2, -7, 1, 0, 0, + 63, 268, -260, -419, 187, -75, -228, 296, + -470, 177, -515, 318, 124, 308, 92, 371, + 3046, 362, -1, -1, -10, 1, 0, 0, + -356, -16, -199, 117, -75, 46, -108, -14, + -124, -173, 4914, -75, -474, 105, 87, 190, + -183, -208, 0, 0, 1, 1, 0, -1, + 162, 89, 49, -314, -2788, 265, -263, -3, + -3156, 316, 112, 128, -333, -138, -114, -141, + -287, -234, -1, 0, 0, 0, 0, 1, + 733, 126, -424, -389, 642, 432, 134, -251, + 407, -51, -151, -491, -308, 91, 50, 3836, + 87, 100, -5, -6, 0, 1, 0, 0, + 304, 1727, 83, -8, 216, -81, -189, 152, + -67, 15, 310, -93, 6, -37, 54, -110, + -15, 78, 0, 0, 1, 12, 0, -1, + 129, -198, 1, -48, -66, -147, 30, 264, + -84, 102, 42, 126, 1, -6451, 225, -51, + 8, 123, 0, -1, 0, -1, 0, 0, + -374, 66, -256, -80, -1139, 303, 2002, -199, + -98, -98, -39, -76, 180, 15, -456, 148, + -183, 118, -2, 1, 0, 0, 0, 0, + 151, 13, -114, 65, 6156, 76, -82, -30, + -26, 163, 81, 167, -83, -101, 55, -40, + 161, -793, -8, 0, 0, -1, -1, 0, + -102, -33, 55, -131, 434, 108, 70, 68, + 62, 1913, -109, 235, 110, 124, -25, -58, + -76, 18, -1, -1, 0, 0, 0, 0, + -105, -7322, -9, 82, 53, -43, -5, 18, + 90, 91, 20, -34, 26, -93, -50, -46, + -77, 105, 0, 6, -12, -6, 1, 0, + -1334, 980, -163, -351, -514, 537, 62, -300, + 80, -318, 14, -3570, -52, -116, -280, 540, + 250, -775, -7, 0, 0, 0, 0, 0, + 507, 317, -417, -236, -2438, -72, -346, 2507, + 302, -185, 30, 1539, 205, 87, -112, -482, + -296, 132, -1, 0, -1, 1, 0, 0, + -64, -208, -159, 1, 336, -62, -14, 13, + 81, 101, 382, 32, 116, -5, -41, 25, + -175, -7829, 1, 0, 1, 0, 0, 0, + 7551, -7, 86, -165, -57, -17, 183, -207, + 69, 54, -99, -25, 167, -58, 107, -81, + 165, 172, 2, -2, 0, 1, 0, -9, + 26, 28, 86, -183, -320, -32, 116, -53, + -49, -15, 133, -283, -152, 576, 6630, 185, + 44, 25, 20, 1, -12, 1, -1, 0, + -145, -51, -114, -29, -228, 78, -409, 235, + 147, 45, -192, 177, -91, 68, -2572, -52, + 81, 181, -5, 13, -1, -1, -17, 0, + -65, -23, -28, 9, 242, 14, -35, 88, + 77, -20, 37, -7097, -58, 51, 137, 126, + -90, 136, 0, 4, -1, 0, 0, 0, + -266, -82, -205, 816, -309, 3267, 1053, 369, + -216, -302, 18, 168, 395, 273, 343, 243, + -98, -53, 1, 0, 0, 1, 0, 0, + -65, -76, 1850, -991, -454, -535, 2927, -145, + 101, 23, 20, 234, -74, 77, 114, 4, + -106, 527, -11, 4, 0, 1, -1, 0, + 573, -46, 207, 2640, -956, 47, 26, -10, + 317, -217, -5, -867, -3, 213, 52, 53, + -428, -175, 0, 0, -1, -1, 0, -1, + -223, -55, 135, 184, 313, 0, 2868, 245, + -3187, -721, -291, 9, -265, -120, -105, -36, + 454, 55, -1, 49, 0, 1, -1, 0, + -291, 41, 84, 557, -201, -2300, 429, 283, + 21, -2, 132, 286, -124, 149, -14, 146, + 320, -298, 0, -1, 1, -2, 0, 0, + -86, -3493, 131, -3581, 185, 26, -197, -65, + -96, 147, -53, -150, -35, -35, 179, 68, + -157, 0, 0, 2, 0, 1, 2, -1, + -22, -218, 13, -1447, -400, 288, -1295, 0, + -119, 69, -56, -139, 157, -26, -122, -61, + -38, -108, -1, 1, 0, 0, 0, 0, + -229, 3335, 103, -108, 10, 3008, -712, 50, + 27, 152, -307, -106, 148, -77, -178, -46, + 7, -114, 0, -9, 0, 0, 1, 0, + 932, -443, 311, -75, 62, -80, -179, 459, + -232, -160, 2, 169, 134, -260, 41, -149, + 23, 92, -2, 0, 11, 1, 0, 0, + 16, -90, -574, -171, 163, 261, -299, 2994, + 74, -3818, -396, -171, 13, -29, -45, -168, + -287, -390, 1, 0, 0, -4, 0, -1, + 89, -702, 2223, 101, -249, 2983, 36, -333, + -382, 410, -262, 185, -146, 98, -8, -317, + -279, -879, 0, 0, 0, 0, 4, 0, + -98, -325, 75, -229, -13, 112, -5743, -34, + -89, 263, -155, 80, 140, -50, 33, 143, + -60, -77, 1, -2, 0, -1, 1, 0, + 52, -576, -543, -1142, -947, -184, 449, -71, + -75, -156, -3412, -50, -487, 307, 663, -1000, + -415, -2348, -7, -1, -1, 0, 0, 0, + 64, 3, -35, 11, 14, -198, -2, -8042, + 140, -11, -93, 29, -65, 330, 34, 110, + -19, -137, 2, 0, 0, 0, 0, 0, + 1236, 303, 2681, 234, -217, -406, -395, -380, + 247, 349, -101, -33, 370, -39, 139, 59, + 18, 24, 0, 0, 0, 0, 0, 0, + 166, -21, -5392, -117, -296, 114, 230, -255, + 131, -53, 13, -45, 200, 7, -56, 87, + 46, 223, -59, 0, -1, 0, 0, -1, + 214, -511, 175, 204, -123, -47, -440, 6, + 23, 92, -355, 80, -4885, -238, -37, 78, + -218, 175, 0, 2, 0, 0, 0, 0, + -146, 74, -13, -4, 27, -45, 51, 81, + -80, 53, -18, 173, -146, -64, -8, 8192, + 79, 15, 0, -3, 0, 1, 0, 0, + -3, -16, -28, 288, -61, 4, -187, 6, + -5, -14, 77, -12, -53, 16, -41, -7, + -10, -2, 7, -1, -9, 1, 0, 0, + -285, -35, -8, 221, -68, 114, 135, -8, + -203, -181, -91, 2043, -58, 127, 201, 111, + 46, -344, -11, -49, 0, 1, 0, -1, + -160, -186, 58, 4761, 289, 51, -145, 51, + -32, 71, 62, 175, -13, 181, 203, 141, + -200, 106, -1, 4, -2, 0, 0, 0, + 803, -76, -96, -940, 300, 3429, -84, 3037, + 262, -9, -39, 120, -629, -309, 233, -374, + 398, 894, -12, 1, 1, 1, 0, 0, + -282, 2525, -31, -176, -2473, 53, 102, -610, + 180, -145, 42, -51, 223, 27, -69, 727, + -14, -51, 0, 0, 0, -3, 0, -40, + 214, 72, 41, 1, 190, 78, -228, -235, + 105, -4619, -140, -46, -7, 49, 9, -19, + 137, -2, 9, 1, 0, 0, 0, 0, + -142, -262, 29, -142, 39, -39, -92, 95, + 50, -282, 2, -106, 114, 8, 35, 78, + -121, 2589, 1, -4, -10, 1, 1, 0, + -192, 59, 287, 400, -67, -6989, -301, 446, + 115, 7, 33, -60, 111, 102, 8, 206, + 46, -31, -1, -1, -2, 0, 0, 0, + -104, 332, -223, 1066, -188, 1270, -222, 309, + -296, 259, 780, -460, -1914, 218, -556, 210, + 2962, 130, 1, -2, 2, 0, 1, 0, + -320, -365, -266, 822, -119, 824, -312, 58, + -1857, 235, 48, -3985, 118, -307, -703, -931, + -560, 105, -2, -3, 0, 0, 0, 1, + 156, -48, 187, 214, -212, 180, 342, 373, + 1973, 128, -5, 146, -40, -11, 71, -60, + 76, 17, 0, 0, -1, 2, 0, 7, + 214, 63, 274, 2876, -65, 314, 400, 344, + 140, 39, 193, -226, 124, -3177, 68, 46, + -60, -317, 2, 0, -1, 0, 7, 0, + -160, 118, 233, 239, -465, 96, 253, 3178, + -88, 299, 368, -220, 197, 397, -353, -463, + -202, -103, -4, 0, 0, 0, 0, 0, + 687, -448, -749, 87, -35, 112, 309, -33, + -16, 88, 141, 63, -51, 274, -113, -76, + 46, -273, -1, 1, 0, 1, 0, 1, + -298, -206, 670, 303, -451, -277, -493, 404, + -173, 284, 148, 626, -322, -296, -68, 3044, + -442, 1138, -7, 2, 0, 1, 0, 0, + -1338, 18, 2862, 223, 250, 260, 144, 259, + -38, -647, 602, -160, 75, -5, -8, 34, + 237, 50, 2, 0, 1, -1, -1, 0, + -412, 2153, 933, 478, 768, 186, -424, -657, + -3458, -443, 294, 224, -468, -58, -120, -1565, + 211, -420, 0, 0, 1, -1, 0, 0, + 198, 227, -112, 350, 297, -303, 108, -192, + 153, 32, -2717, -111, -1093, -200, 476, 326, + -271, 627, 0, -4, 0, 0, 0, -1, + 462, -616, 126, 316, -2413, 204, -350, -3549, + -263, -386, -112, 483, -1339, 636, 70, -531, + 96, 38, 8, -1, 0, -3, 0, 0, + -310, -1128, 616, -339, -168, -124, -905, -151, + -383, 76, 137, -44, 3689, -388, 184, 1799, + -102, -930, 6, -1, -1, -1, 0, 0, + -284, 280, 39, -728, 143, 15, 181, 798, + 382, 10, 2267, -12, -3582, -27, 357, 514, + -565, -121, 0, -1, 0, -9, -1, 0, + 429, -16, 2993, -2903, 47, -136, 30, 792, + -327, -347, -69, -50, -93, -223, -438, 158, + 203, -475, 0, -4, -1, 2, 0, 0, + -3465, 415, -963, 252, 397, -945, -448, -231, + -130, 673, 504, 55, -355, 221, 29, 167, + -19, 134, -1, -1, -4, 0, -14, -2, + 44, 433, -535, -216, 2485, 33, 19, -100, + -185, -171, 91, 336, -208, 140, -3, 46, + -67, -116, 32, 0, 5, 3, 0, 0, + 220, 91, -65, -15, -169, 217, -183, -169, + -47, 181, -272, 138, -166, 110, -9, 41, + -6957, 33, -5, -2, 1, 1, 0, -1, + 164, -4062, -109, 230, -220, 1748, -1338, -246, + -242, -98, 300, 217, -202, -130, 157, -3, + -19, -453, 0, 2, 0, 0, 0, 0, +}; + +static const int16_t cb0806sl1[] = { + 75, 87, -31, 607, -132, 5963, -262, 494, + 134, -4, 141, 19, 225, 229, 239, 93, + -20, -189, 2, 0, -3, -1, -1, 0, + 214, -206, 877, 83, -588, 83, 132, 78, + 5, -85, 66, -24, 47, -11, 25, 26, + -3, 46, 2, -5, 0, 1, -1, 0, + -113, 295, -81, 74, 223, -50, -93, -5671, + -28, 115, 256, -228, -31, -539, 300, -278, + -59, 426, -110, -1, 1, 1, 0, 0, + -95, -116, 266, 176, 761, -3, 90, -91, + 98, -209, -414, -27, -56, 26, -76, 6, + -32, 4634, 1, 0, -4, 0, 0, 0, + 177, 147, -236, -93, -7925, 11, -111, -74, + 36, 176, 352, 88, 112, 16, 144, -110, + 91, 329, -1, 2, 0, 1, 0, 1, + 119, 304, -94, -422, 113, 129, -70, 155, + 247, -116, -139, 327, -355, 77, 143, -5362, + 27, -377, -1, 7, 2, 1, 0, 0, + 179, 127, 1500, -324, -15, 673, 184, -1382, + 167, 1833, -3058, 200, -1203, 459, -1905, 1020, + -259, -120, 10, -4, 0, 1, 0, 0, + 995, -112, 37, -160, -21, -4011, 172, 228, + -210, 80, -131, 1, 20, -128, -252, -288, + -132, 337, -1, 0, -1, 0, 1, -1, + -60, 61, 197, -185, -40, -2951, -592, -57, + 210, -3248, -226, -44, 391, -167, -7, 219, + -15, 172, 0, -1, 1, 0, 0, 0, + 106, -70, -291, 192, 45, 162, 37, 143, + 91, 21, -7032, 12, -173, -30, 1, 259, + -286, 387, -36, 0, 0, 0, 0, 0, + -1593, -210, 83, 47, 194, 61, 85, -182, + -23, 40, -74, 22, 12, 216, 59, -165, + -163, -159, -8, 0, 0, 2, 0, 0, + -3, 182, -80, 2068, 702, 115, -164, -85, + 21, -124, -191, -113, 263, 138, 4235, 37, + 204, -436, 0, 24, 1, -1, 0, 0, + 147, 83, -177, -168, -609, -9, -16, -46, + 127, 120, -25, 3435, 51, 31, 49, 366, + 31, -129, 1, -32, 0, -1, 0, -2, + 295, 158, 116, 11, -280, 471, 169, 29, + -2589, 338, 32, 299, 172, -187, -32, 437, + -38, 359, -1, -1, 1, 0, 0, 0, + 243, 413, -29, -4774, 187, 12, -117, 168, + -114, -208, -55, 5, 0, -31, 436, 545, + -45, 272, 0, -4, 0, 0, 1, 0, + 127, 38, 6620, -33, -103, 34, 84, -35, + 30, -131, -8, -79, -126, -98, 17, -75, + -31, -176, 14, -1, 0, 0, -1, -1, + 273, -219, 176, -83, 187, -36, 1, 2639, + 158, 3812, 127, -233, 175, 310, 148, 387, + -14, 308, 0, -3, 0, 0, 0, 0, + 3321, -447, 153, -128, 254, -275, 79, -181, + 17, 146, 61, 46, -48, 253, 51, -17, + 1, 1, 0, 1, -1, -2, 0, -13, + 791, -130, 40, 78, -64, -179, 42, -455, + 422, 112, -19, -4499, -113, -341, 52, 69, + 67, 254, -6, -1, 4, 0, 0, 1, + -98, -976, 68, 1563, 228, 1018, 458, -1020, + 411, 249, -627, 2321, 738, -460, -1469, 362, + 884, -261, 0, -1, 1, 1, 0, 0, + -601, 378, -71, 61, -160, 800, -386, -773, + 303, -53, 248, -22, 59, -3809, -61, 102, + -45, 395, 0, 0, 28, 0, -12, 0, + 717, -424, 499, 296, -15, 11, 2732, -103, + -119, -116, 107, -50, 462, 73, -82, 75, + 41, 131, 0, 3, 1, -1, 0, 0, + -134, 109, 48, -1847, -205, -6, 20, -203, + 136, 197, 113, -77, -124, -50, 184, 225, + -175, -295, -1, -1, -6, -1, -1, 0, + -59, -2017, -193, -237, 226, 630, 1950, -2, + 179, -3666, -34, 140, 88, 157, 51, 81, + -263, -169, 1, 0, 0, 0, 0, 0, + 229, -14, -1590, -123, 162, 63, -224, -332, + 119, 2931, 21, -48, 406, 15, 320, -51, + 64, -228, -9, -1, 0, -1, 0, 0, + -453, 84, -320, -654, -4, -91, -61, 558, + -61, -233, 31, -224, -105, 63, 86, 3771, + 162, -1535, 3, -3, 1, 1, 0, 1, + -1992, -279, -59, -3048, -1696, 102, -168, 194, + 172, -142, 55, 134, 116, -146, -29, -287, + 102, 265, -3, 1, 0, 1, 0, 0, + -96, 46, -16, 2474, -58, -712, -25, -294, + 187, 22, -39, -102, 62, 2666, -237, -1, + 32, -41, 0, 0, 0, 0, 0, 0, + -282, -25, -198, -862, -127, -379, -210, -20, + 45, -79, -2805, -364, 575, 106, 215, -410, + -76, 511, 15, -44, -1, 1, 0, 0, + 329, 224, 130, 43, -1, -255, -51, -297, + 4529, 52, 186, 757, -68, -89, 46, 250, + 46, -79, 5, 1, 0, 1, 0, -19, + 79, 74, 65, 256, 260, 492, -106, -217, + -357, 20, 166, 233, 132, 165, 18, -1, + 4445, -22, 5, 3, -7, 0, 0, -6, + -922, 2156, 269, 1385, 235, -206, -94, 130, + 112, 145, -126, 166, 1, 45, 83, 36, + -153, -255, 0, -1, 0, 0, 1, 0, + 241, -237, -117, -510, 85, 7, -4418, 30, + 94, -92, 99, -71, 140, -265, 149, 69, + 286, 104, 0, -2, 1, 0, 0, 0, + -165, 22, -245, 29, 50, 145, -53, 1641, + -40, -128, -112, -190, 47, 53, -247, -50, + 88, 39, 1, -1, 0, 0, 0, 0, + -288, 130, 88, -132, 4055, -7, 55, -105, + 277, 81, 69, -66, -53, 52, -56, 90, + 160, 386, 1, -4, 0, -2, 0, 0, + 107, 124, -39, 40, 25, -6, -248, -81, + 70, -13, 46, 5, 20, 24, -5, -2, + -41, -34, 1, 1, -8, 0, -4, 0, + -61, 1, 457, 454, 768, 89, 640, 61, + 66, -360, -2727, -155, -370, -44, -292, 570, + 34, -3209, -5, -1, 1, 0, -1, 0, + 22, -82, -20, -125, -91, 98, 7843, 25, + -2, -31, 2, -52, -73, -25, 31, -35, + -6, -114, 1, -1, 2, 0, 0, 0, + 217, -5202, 86, -76, -76, 109, 389, -95, + -253, 124, 130, 58, 190, -44, -67, -142, + 54, 6, -1, 1, 1, 1, 0, 0, + -183, 547, -200, 348, 372, 437, 425, 547, + -457, 388, 87, 38, -522, -210, -556, 41, + -2979, -17, 7, -4, 6, 0, 0, 0, + 189, 196, 240, -75, 46, -50, 101, -160, + -16, -223, 92, 71, -7633, 78, 90, 69, + 190, -75, 2, 1, -2, -1, 0, 1, + 205, -433, -267, -175, 3068, -210, -514, 330, + -3099, -273, 155, 132, -306, 361, 316, -53, + -421, -125, -3, 0, -11, 0, 0, 0, + 179, -38, 151, -36, 215, -102, -145, 139, + 50, 200, 383, 37, 3102, -27, 9, -157, + -68, 367, 1, 1, 0, 0, 1, 0, + -50, 177, -24, 24, 119, 4, 76, 99, + -111, -7367, 26, 51, -11, -146, -125, -48, + 54, 50, 1, 0, 0, 0, -1, 0, + -71, -16, -184, -61, -36, -151, 79, -128, + -102, 135, -228, 190, -79, -10, -176, -113, + 1008, -856, -13, -4, 8, 28, 0, 1, + -4909, -93, -167, -141, 51, -203, 71, -199, + -49, 106, -142, -94, 126, -225, 158, 36, + 269, 159, 0, 1, 1, 0, 0, -5, + -61, -79, -20, 306, 67, -621, 1774, 346, + -442, 125, 305, -170, 55, -2537, -103, 118, + 87, 505, 16, -7, -2, 0, 20, 0, + 35, -154, -158, 224, -36, -344, 79, 4232, + 234, -219, -71, 204, -484, -131, 1153, 23, + 111, 499, 5, 0, -17, 0, 0, 1, + 1135, -3469, -489, 2572, -450, -432, -358, -34, + -78, -10, -775, 17, -131, -154, 218, 82, + -312, 279, 1, 0, 1, 0, 0, 0, + 96, 230, 18, 47, -5, -102, 646, -122, + 35, -81, 183, 171, -1479, 201, 84, -24, + 143, 302, 1, 5, 0, 0, 0, 0, + -34, -48, 89, 7789, -85, -27, -56, 46, + 39, 30, 98, -40, 138, -147, 104, -35, + -41, -151, 1, 9, 1, 0, 0, 0, + -140, -1970, -170, 273, 226, 33, -324, -38, + 11, 188, 603, 188, -183, 98, -58, -67, + -63, 7, 0, 0, 0, 0, 1, 0, + 384, 899, 493, 765, -1062, 646, 275, -2699, + 93, 796, 120, -25, 177, -85, 721, -189, + -295, -436, 0, -1, 0, 0, -1, 0, + -358, 117, -2435, 325, -3137, -158, 23, 97, + 6, 204, 288, -426, 156, 22, -101, 171, + -56, 235, 0, -1, 0, -1, 0, 0, + 656, 3878, -286, -383, 75, -50, 114, -377, + -105, 106, 154, -30, -204, -105, 171, -56, + 230, -587, 0, 1, 0, 8, 1, -1, + -58, 177, -7, 45, -159, 405, 45, 84, + -206, 77, 277, -259, 121, 3719, 140, 79, + -202, 843, -8, 0, -1, 1, -2, 0, + -248, 560, 2651, -49, -625, -147, -2416, 119, + -70, 87, 137, 18, -401, -147, -598, -150, + 239, -1004, 7, 3, 13, 1, 1, 1, + 276, 342, 97, 600, 230, 95, 213, 159, + -259, -25, -176, 3360, -283, -325, -37, -2626, + -151, 178, -1, -18, 0, 0, 0, 0, + -233, 237, -78, 290, -284, 141, -20, 146, + 58, -21, 73, -35, -101, -23, -4068, -116, + 49, -196, -5, -2, 0, 1, -1, 0, + -292, -195, 51, -714, 172, 44, -119, 134, + 168, 107, -74, -2379, 308, 173, -252, -3470, + -135, 641, -10, 0, 0, 1, 0, 0, + 146, 2060, -84, -164, -247, 26, -1724, 216, + 226, -2499, 312, -66, 850, 41, -1, 20, + -1339, 411, 0, 0, -1, -12, 0, 0, + 921, 17, -3510, -119, 325, 34, -97, -205, + 3, -188, 252, 91, 0, -135, -76, 208, + 199, -202, -1, 1, 1, 2, 0, -1, + -88, -461, 319, -963, 266, 1540, 643, -3424, + 76, -1058, 501, 342, 297, 268, -158, -103, + 26, -30, 0, -1, -1, 0, 0, 0, + 211, 245, 183, 1579, 106, 26, -3450, -22, + -1053, -266, -736, 113, 475, -241, 117, -85, + -492, 372, 0, 1, 1, 0, 0, 0, +}; + +static const int16_t cb0806ss0[] = { + -381, -1638, -8192, 5, 983, -1481, -20, -719, + -238, 767, 571, -200, 754, 460, 1678, 1376, + -155, -1998, 294, -455, 80, 2, 26, 3, + 10, 25, -931, -1098, -1166, -3221, -1995, 702, + 104, -2429, -2270, 1372, 2326, -37, -1492, 1692, + 644, -1283, 363, 624, -483, -15, 346, -6, + 2, 0, 1, 3, 2, -2429, -8192, -956, + 1190, 706, -955, 367, 959, -194, -723, -1104, + 375, 554, -962, -229, 66, 368, 18, -150, + 56, 968, -15, 0, -1, -5, 0, 9, + -250, -720, 1910, 827, 198, -645, 2021, 32, + -1972, -705, 441, 373, 800, -2293, 1747, 1504, + -537, -1731, -1192, 1597, -4031, 24, 0, -2, + 1, 1, 1, -131, 1594, -153, 1127, 2732, + 469, -558, -11, 1190, 115, -933, 1988, 1841, + -4530, 1385, 571, 2399, 1709, -63, -3663, -2681, + 57, -4, 11, -4, 0, -3, 426, -4257, + 2755, -76, -1667, 2450, -373, 3375, -91, -232, + 511, 648, 886, 1182, 1667, 65, -3029, -579, + 865, 2186, 2911, 537, 0, 2, -3, 0, + 7, 585, 8192, -2855, 8192, 5527, -5491, -1926, + -4231, -1204, 1953, -1193, 191, 3278, -1726, 259, + -2794, 4205, 4315, -6121, -606, -1922, 3666, -324, + -238, -313, -720, -1447, -539, -794, 3151, -1726, + 3444, 876, 584, -671, -497, 407, 909, -2183, + 2575, 246, -673, 270, 824, 1784, -201, 7329, + 589, -70, -1, 4, -5, -3, -8, -417, + 382, 2786, -972, 520, 1154, 886, 521, 6032, + -687, 3791, -522, -1226, 608, 428, 891, -1524, + -1015, 1147, 1278, 559, -6, 3, 0, 6, + 2, -3, 115, 3586, -2847, 95, 460, 2832, + 2326, -1665, 1720, 453, 965, 1154, 452, -1721, + -1375, -269, 2138, -2032, 55, -674, -870, -124, + 0, 5, 0, -5, -3, -283, 1077, 2604, + 1270, -1082, -1753, 6840, -2502, 988, -1790, 1378, + 1231, 438, -1188, 286, 540, -138, 1054, -111, + -2321, 74, 56, -3, -2, 0, -32, 5, + 1539, -1399, 7413, -903, -1698, 1781, -255, -466, + -1436, 3419, 1916, 852, 590, -1126, -1617, -1309, + -5560, -241, 3363, -1225, 2682, 620, -6, 58, + 2, -186, -17, -2959, 619, 2228, -2627, -3119, + 730, 3716, -538, -101, -1863, -516, 142, -2384, + -1514, -5506, -825, 514, 714, 746, -2790, 569, + -425, 4, -68, 70, 24, 12, 817, -276, + -3363, -2942, 103, -581, -925, 651, 561, 43, + 434, 712, -541, -2042, -1291, -453, -443, -4312, + -1344, 1277, 605, -4, 0, -1, -1, 1, + 2, -930, 276, 3219, -404, -944, -497, 840, + 278, -98, -1432, -1136, -1975, -1863, -1102, -1446, + 938, 693, -5186, -1, 1085, -2275, 1, 1, + -1, -1, -2, 3, -1194, -312, -1257, 1973, + 1570, -1703, -1637, 639, -855, 1925, 970, 604, + 1313, 780, -5170, -603, 220, -731, 2952, -872, + 166, 30, 0, -2, -1, 3, -1, -743, + 504, 1363, 1436, 1632, -634, -709, -2346, 87, + 1149, 3468, 2132, 3028, -1039, -92, 2087, -990, + -301, 966, -773, -1057, 42, 0, -2, 0, + 2, 2, 252, 217, 3625, -2323, 212, -381, + -1121, 1664, -307, 1680, 2193, -1854, -187, -3100, + 254, -673, 595, 1995, 669, -687, -509, 13, + 0, 8, -3, 11, -3, -552, -87, 6, + 2933, -267, -1392, 40, 644, 32, 2966, -1386, + -2480, -956, 1160, 1399, 1049, 3902, -2092, -525, + 1724, 69, -33, 0, -2, 0, 2, 2, + -452, -4739, -3237, -510, -598, -1397, 855, 1573, + 2143, -79, -1546, -17, -973, -2400, 1689, 133, + -1213, 784, 726, 916, -388, -390, 1, -1, + -3, -1, 0, 170, -205, -2905, 8192, -465, + 3119, 4407, -709, -403, 859, -373, -1301, -1397, + -750, -88, 277, -2097, -222, -134, -88, -1189, + 974, -56, -57, -83, -21, 102, 626, -114, + -2304, 979, -1836, -868, 1261, 2226, -261, 579, + 983, 655, -2578, 1803, 117, -1128, 365, 3971, + 3539, -21, -790, -62, 2, 3, 23, -3, + 31, 1273, 3212, -1617, 4116, -281, 725, -284, + 1079, 293, -3759, 2581, -1617, -259, -19, -1999, + 3040, -3077, -1522, 1056, -92, 897, 243, -1, + 36, -19, -10, -46, 231, 1129, 363, -1978, + -882, -1788, 319, 4807, -1707, -1379, -1465, 2327, + -827, -681, 410, -1816, -2507, 1036, 740, 730, + -687, 100, -1, -1, -1, 1, -4, -276, + 303, -2331, -2912, -1864, -3694, 412, -1218, 1642, + 4448, 658, -213, 872, 2867, 227, 868, -590, + 2293, 1759, -1666, -1585, -140, 1, -3, -1, + 26, -10, -287, 898, -2442, 3997, -1655, -1341, + -56, 689, -1869, 572, -2044, 616, -2603, -278, + 2987, 2397, -2055, 247, 128, 598, 1732, -146, + 0, 3, -1, -3, 5, 842, 597, 779, + -1529, -802, 2142, -1668, 2339, -3550, -2651, 1733, + -1531, -46, 600, 618, -867, -665, 1524, 392, + -1386, -3279, 45, 0, 9, -7, -3, -8, + -224, -2632, -147, -505, 2223, 1773, 1799, -1696, + 194, -1186, -543, 775, -1171, 5491, -2319, -3193, + -313, -355, -133, -1097, 125, -22, -2, 2, + 1, -3, -10, -354, -1447, -662, -313, -4302, + 3888, -121, -323, 1112, -801, -1513, -814, -1646, + -616, -1207, 347, 483, 670, 900, -35, -885, + 14, 1, 0, 1, -2, 7, -432, -486, + -1539, 785, 4853, 904, 925, 895, -1223, -2464, + 3395, -506, -808, 207, 197, 874, -928, 1347, + -107, 1512, 1063, -182, 1, -4, -1, -6, + 3, -1236, -1047, 774, 26, -630, 863, 1055, + -2632, -1187, -534, -619, -1079, -2574, -2037, 658, + 1229, -262, 2702, -3393, -2187, 1764, 66, 0, + 7, 0, 7, -3, 677, -444, -2111, -5256, + -4485, -1667, 2077, 1613, 1483, -1520, 1600, 1767, + 1148, 2054, 1676, 1866, 783, -2199, 765, 568, + 2779, -683, 4, 17, 0, -32, 15, 45, + 228, -2445, 752, 2510, -1657, -1039, 113, 1107, + -1054, -1765, -1245, -2527, 589, 455, 328, 640, + -579, 2370, 1313, -540, 31, 1, -1, -4, + 2, -3, -235, -560, 455, 3809, 102, 403, + -21, 1844, 402, 148, -32, 5573, -3765, -265, + -718, -399, -349, 366, -1105, 91, 1881, 34, + 1, 1, 5, 0, 9, 289, -1146, 795, + -2504, 412, 1156, -302, -946, 2063, -2569, -273, + -1434, 141, 642, -631, 4856, -1008, 169, -40, + 191, -2293, -86, 6, 1, -2, 0, 1, + 139, 1955, -1111, -944, 140, -1074, 1071, -1312, + -541, 664, 1801, -892, 1605, -1750, -654, -680, + -8102, 120, -24, 1014, -351, -120, 0, -2, + 1, -1, -1, 1038, 5199, 779, -1195, 128, + 462, 184, 3705, -1292, -2247, -2481, 2610, 4396, + 4161, 4039, 1111, 838, 188, -571, 2811, -1915, + -1909, 13, 99, -20, -2, 11, 395, 155, + 2667, -202, -2639, 1303, -912, -1734, 1097, -583, + 3532, -218, -1514, -3881, 378, -46, -1189, -957, + -3010, -743, -648, 15, 1, 3, 3, 4, + -4, 330, 198, -275, -677, -8192, -629, 1953, + -783, 592, 926, 1487, -39, -1002, 1134, 1560, + -27, -118, -1363, -360, 2163, 442, 92, 1, + 1, -2, 5, 1, -670, 326, 2773, 1346, + -26, 327, 184, -1091, -121, 576, -1324, 212, + -645, 860, -2111, -493, -2119, 316, -688, 475, + -652, -33, 0, 1, 2, 0, -3, 92, + 170, 6224, 2162, 761, -1994, 2176, 1692, -1773, + 561, -966, 3406, -20, -593, 574, -681, 1121, + -335, -412, -2651, -4712, -79, 1, 2, -1, + 4, -6, 932, -2579, 344, -2614, 1119, 6623, + -314, -1068, 338, 1977, -1375, -1338, -1996, 1310, + 118, -500, -393, 622, -1798, -1232, 3, -75, + 0, 17, 0, -2, -9, 715, 8135, 400, + 3748, 2156, 1882, 772, 2728, -403, -775, 2110, + 1603, -766, -2592, 767, -618, 4727, 668, 2280, + -1157, 1246, -794, -14, -2, 2, 5, 16, + -107, 642, -1806, -158, -2447, 309, -764, 2313, + -101, -766, 209, -691, 2001, 268, -273, 615, + 803, 6062, -434, 1287, -543, -3, 0, 0, + 1, 1, 0, 503, -598, -2043, -1160, 1074, + 1255, 3269, 1405, 1182, 197, 3098, -138, 2326, + -244, -772, 901, -225, 337, -65, -536, -331, + 15, 2, 13, 8, -3, 20, -32, -52, + -1012, 232, 1502, -17, -1574, -741, -57, 164, + -22, 74, -181, 1616, 296, -1483, 1387, -357, + -5380, -322, -1346, 6, -3, 2, -3, 1, + 0, -392, -811, -650, -485, 3038, 2750, -776, + -503, -1664, -323, 253, -280, -3459, -1313, 541, + 2182, 1287, -782, 1785, -695, -49, 72, -4, + 0, -15, 3, -21, -211, 1382, -149, 684, + 2210, 2654, -1440, -1209, 152, 1080, -3078, -694, + 4738, 985, -1337, 819, -518, 1799, -671, 3201, + 2636, 7, 1, -6, 14, -31, 0, -34, + 4296, -23, 194, 1976, -993, 1353, 709, -342, + -1142, -140, -271, 2291, -709, 1734, 818, -3571, + 1125, 912, -590, 784, -275, -2, -1, -5, + -1, 0, -381, 2754, 1545, -2270, 3608, 2308, + -1899, 178, 391, 1826, -127, -1417, -822, -712, + 1682, 2225, 2247, 446, 994, 56, 734, 196, + 7, 3, 8, 0, 7, 639, 833, -3313, + 675, -263, -648, 3016, -701, 235, -1304, -582, + -2930, -210, -1243, 374, -3095, -2013, 354, 599, + -1469, 140, -17, -1, -3, 2, 0, -2, + -183, 399, -603, 796, -1424, 2685, -3929, 416, + -2291, 1737, 1906, 1667, 810, -222, 3242, -3636, + 5196, -1542, 940, -124, 2047, -67, -4, 6, + -1, 13, 2, -161, 417, 4132, 492, -1068, + -817, 2732, -250, -1457, 1723, 2104, 1121, -1276, + 1147, 990, -523, -1533, 297, 1219, 3901, -2549, + -22, 0, 0, 0, 0, 2, -1632, 172, + 829, -747, -1229, -1990, -1070, 1134, 1623, 228, + 3689, 625, -757, 8192, -82, 738, 213, 1900, + -1200, 91, 892, -45, 15, -1, 5, -4, + 5, 392, -3067, -1903, 139, 661, 43, 2174, + -1919, -270, -1490, -569, 2, 85, -1091, 6740, + 886, 85, -1052, -647, -563, -2971, -145, -1, + 39, -5, -6, -7, -1023, -1104, -1774, -3154, + -1058, 3488, -2551, 3547, -253, -204, -235, -1544, + -73, -584, -302, -3118, -2314, -308, 1790, 916, + 152, -155, -11, 6, -26, -1, -31, 21, + 919, -1856, -456, -1050, 663, 1454, -1515, -2606, + -4287, 1553, 3564, 1334, 1797, 1540, -392, -701, + -971, -3442, 281, -271, 133, 1, 5, 4, + 32, 3, -521, -1530, -1368, 1787, -515, -913, + -2391, 93, 2690, -578, -576, -1656, 554, 649, + -1509, -258, -605, 1233, -2258, 640, 837, -43, + 1, -3, 0, 5, 3, 148, -4761, 1783, + 3244, -277, -1139, 1539, -2016, 1898, -1276, -776, + -1725, -1900, -51, 559, 311, 1737, -928, 3687, + -1087, 1329, 134, 2, -2, -7, 9, 5, + -77, -1116, 4986, -940, -905, -3229, -773, 3335, + -23, 578, -2376, 386, 122, 1253, 363, -2748, + -512, -4612, 1690, 848, -1116, 195, 5, 2, + 11, 1, 18, 659, -1282, 562, 1170, 4701, + 903, 490, -3508, 3468, -39, 654, -1196, -909, + -268, 980, 283, 3221, 348, 1121, -897, -1011, + -103, -11, -2, -9, 16, -8, -274, -4100, + -2312, -2379, 617, 1629, 2154, 3026, -1737, -603, + -803, -366, 977, 1035, -1835, -255, -275, -1245, + 1274, -161, -4476, -181, -4, 0, -2, 1, + 2, 156, 551, -832, -630, 3740, -2115, 344, + 229, 1295, 65, 290, -1462, -1794, 3297, -1049, + 2451, 322, -2642, -2810, -1246, 613, 90, -1, + -1, 0, 0, 0, -277, 854, 1259, 1542, + -433, 3601, -453, 1091, -113, 1438, 994, -2746, + -786, 867, 1422, 1093, -1723, -1167, -1389, -1062, + -436, -81, 2, 1, 11, 1, 26, -197, +}; + +static const int16_t cb0806ss1[] = { + 1760, -4335, 6384, -2036, 2874, -2504, -1529, 102, + 6995, -1267, -3141, 1050, -59, 1556, -1002, 1536, + 1024, 1867, 40, -1156, -2627, -213, -1034, -660, + 291, -963, -323, 462, -804, 2219, -859, 1709, + 550, -3390, 319, 24, 644, 3154, 4503, -1961, + 744, 194, -151, -1255, -1318, 3033, -899, -18, + 1, 0, 2, 0, 28, -1213, -3725, -2525, + -177, -1164, 361, -357, -649, -459, 1324, 2463, + -3108, -3323, -575, -2744, -108, -121, -508, -564, + -849, -773, -288, 0, 8, 0, -2, 5, + 691, -602, 2269, 2373, -2027, 786, 3011, 3234, + -1387, -310, 659, -358, 1058, -1554, 1031, 795, + 2254, -549, 334, 325, 599, -36, -1, -1, + -2, 3, 4, -450, -533, -1657, -1928, -1034, + -636, -1446, -320, 2695, 1184, 697, 1126, 1159, + 2970, 449, -30, -2058, -1171, -684, -66, 905, + -43, 1, 0, 3, 0, 3, 228, 272, + -79, -718, 1978, 667, -2760, 1507, -1893, -796, + 1164, 35, -4440, -4492, -1667, 4189, 6485, -495, + 1721, -1639, -526, 458, 0, 385, -183, 511, + -153, -2025, -376, 2948, -2606, -910, -741, -427, + -1080, 2128, 565, -483, 1791, -2222, -45, -1204, + 799, 512, -4790, 1462, 511, -1906, 15, 0, + 0, 1, 3, 8, -867, -685, -140, 5299, + 376, -891, 1657, 1843, -1465, -1297, 518, -4640, + 303, -277, -650, -97, 2308, -679, 720, -171, + -475, -269, 0, -5, 4, -1, 9, -1155, + -4954, 1684, -2045, 939, 819, -751, -165, -93, + -2327, 306, 965, 4999, 557, -55, -999, 30, + -36, 989, -1680, -1594, 318, -3, -8, -4, + 1, -9, -402, 8192, 475, 2080, -418, -1739, + -273, -55, -441, 794, -79, 272, -2039, 789, + 2266, 874, 2495, 627, 2203, 1212, -1052, 389, + 14, -24, -59, 10, 133, -535, -1160, -1139, + -146, 180, 1064, 3718, -1412, 1153, 1873, -549, + -1698, -1479, 209, 725, -940, 2152, 1848, 678, + 2493, 4608, -11, 0, -1, -3, -3, 2, + 334, 681, 673, -8192, 3958, -3111, 1641, 1500, + 1184, -268, -3147, 571, 958, -663, -1031, -870, + -674, -1098, -529, 78, 1212, 120, -8, -13, + -5, -42, -37, -498, 1304, -2541, 1730, -355, + 1462, 2315, 2017, -403, -2010, 555, 1391, 887, + 2039, 366, 135, 85, 371, 1291, -225, 335, + -45, 0, 1, 2, -1, 2, -1095, -261, + 3249, 3212, -1877, 934, -1671, -1289, 1398, -2287, + -205, 1659, 642, 1105, 751, 2864, 1171, -1001, + 318, -290, 60, -54, 5, 3, 5, 2, + 1, -105, 590, 36, -194, 1832, -639, 777, + 3243, 578, 2820, 428, 2020, 623, -2104, -52, + -331, -1015, 3064, -347, -303, -1100, 61, -1, + -1, 0, 2, -1, 592, 127, 887, -1094, + -2819, 2573, -2670, -1693, -2775, 48, -266, -961, + 1220, -472, 167, 3201, 1118, -173, 1304, -26, + -899, 76, 0, 3, 0, 1, -1, -718, + -746, 947, -524, 142, 958, -1609, -777, -1362, + 385, -578, -6947, 157, -290, 1357, -1703, 484, + 117, -2224, -3736, -838, -96, -1, 11, 5, + 4, 2, 475, -426, 500, -767, -2304, 1248, + 2200, -1829, -992, -225, -573, -1107, -832, 2555, + -2866, 3453, 4335, -88, -1160, -1666, -94, -33, + 0, 0, 1, -2, -7, -147, -8192, 1204, + -1181, -702, -604, -770, 1032, -173, 770, 861, + 611, -509, 802, -467, 839, 491, -785, 523, + -669, 73, -34, 0, 0, -2, -3, -3, + 286, -2183, -1238, 1743, 387, -2228, -1404, -3439, + -1701, -2371, -451, 2294, 2061, 3062, -1122, -1489, + -1274, 51, 5649, -170, 2197, 365, -1, -13, + 4, 3, -5, -15, -4099, 789, 4132, 4982, + -1996, 784, 748, 2123, 3535, -1493, -1454, -344, + -867, 40, 831, -1198, 66, 542, 1633, -2402, + 117, -119, -18, 49, 18, 40, -500, 808, + -726, 1192, 3623, 1526, -484, 1080, -2502, -579, + 1315, -1887, 84, 1771, -2902, 1387, -1098, 1559, + -1126, 652, -896, 32, -1, 3, 1, 3, + -2, 233, 782, 8192, 566, -701, -352, 1047, + 581, -1070, 3159, -1157, -1585, 1599, -978, -663, + -931, -2581, 5074, 781, -551, -590, -247, -63, + -54, -50, 253, -138, -313, 387, -3004, -1136, + 654, -1283, 1318, 434, 80, -1486, 694, -512, + 393, -238, -700, -232, 706, 1478, -8192, 377, + 601, 18, -1, -3, 0, -6, -3, 2221, + 3531, -862, 1792, -242, -3686, 420, 1891, 918, + 1324, 234, -819, -601, 2363, -1097, 2355, 754, + -125, 245, -615, 3285, 204, 0, 6, -4, + -3, -1, -637, 673, 1233, 2886, 265, -195, + -226, 2521, 281, -210, 1809, -2733, -3865, -2287, + 641, -2604, -4235, 107, 789, 1163, -2600, -463, + -5, 10, 2, -10, 39, 1380, 754, -5077, + 4061, -1633, -1738, -1604, 1937, 1815, 1039, 3696, + -593, 2218, -1061, 1081, -1217, 2062, -637, -1580, + 149, -626, -253, -3, -17, 2, 33, 1, + 118, 525, 158, 1213, 910, -105, -1437, -1311, + 2255, -419, -2394, 1542, -3830, -1167, -998, -1099, + 1635, 1678, -1112, -275, 122, -50, 0, 3, + 0, -1, -1, 998, -4020, -1913, -1083, -159, + 1853, -436, -683, 298, 211, 711, 4128, -1977, + -958, 1048, 642, -420, 329, -1150, 459, 2161, + 29, -4, 0, -1, -6, 1, 1365, 1053, + 1032, 952, 854, 2405, 5106, 1863, 3049, 981, + -863, -397, 508, -1283, -631, 17, 532, -1453, + -1056, 66, 501, -27, -1, 3, -1, -13, + -2, -273, -2924, 839, -433, -395, -252, 1945, + 195, -307, -1297, -1474, -985, 4412, -1017, 1074, + 2711, 996, 919, 183, -10, -605, 38, 1, + -1, -1, 2, 1, 2115, -422, 3655, -1972, + 1473, -2033, 2461, -1112, -1267, 179, -394, -906, + -1273, -432, 1082, 367, -720, 1746, -657, 595, + 701, 16, -1, 0, 0, 2, -3, -255, + 443, -1840, -2379, 296, 258, -675, -221, 406, + -216, -6295, -1041, 1062, 199, 1705, -1032, -1627, + -2399, 198, -1097, -271, -99, 0, 1, -2, + 2, -13, 343, -219, -1447, 1779, 630, -1944, + -1093, -1578, -62, -1334, 2811, -815, 1311, -3102, + -300, 67, 24, 98, 764, -1246, 203, 6, + 0, -4, 0, 1, 0, -18, -1704, -1427, + -352, -2665, -588, 287, 715, -454, 688, -424, + 1736, -1124, 1028, -7581, -752, -482, -363, -75, + -720, -619, 449, 0, 3, 0, 16, -3, + -1211, 2484, 3490, -547, -705, 1776, -286, -1580, + 2896, -2257, -214, -1784, -1266, -562, -1170, -542, + 785, 1606, 535, 51, -1405, -7, -1, -1, + 0, -1, 2, -428, -579, -1091, -2627, 2287, + -757, 1445, -411, -160, 567, 108, -1305, -4356, + -390, -917, 345, -2169, -896, 3772, 1224, 691, + -25, 1, 1, 1, -2, 1, 281, 1365, + -1628, -585, 3485, 169, 746, -395, 1072, 1569, + -1073, 744, 1274, -3472, 1035, -906, -3394, -1537, + -869, 2841, 401, 4, -1, -3, -3, -1, + -3, -37, -1628, -888, 785, 3328, 1105, 3551, + 6946, -1688, 2690, -2051, -2212, -3750, -1903, -497, + 1251, 1187, -6198, 3930, 85, -1077, 16, -23, + -80, -130, 43, 66, -974, 579, -2047, -3607, + -666, -2248, 4619, 6846, 88, -649, 1129, -255, + 3567, -124, 41, 58, 634, -1252, 696, 2536, + -1590, 209, 12, -102, -275, 27, 216, 1110, + 259, -2091, 1775, -3768, 598, 441, -1809, -431, + 22, -991, -621, 84, -1803, 1585, 559, -1101, + 42, 456, -392, -874, -4, 0, 0, 1, + -1, 0, -371, -211, -339, -1232, 438, -2683, + -1007, 1250, 5343, 861, -1305, -577, 2107, -2649, + -3227, 1020, -127, 562, 5495, -3136, -414, -529, + 12, -53, -34, 151, 106, -2946, -575, -1796, + 3095, -257, -591, 126, 967, -547, -271, 560, + 974, -3335, -2110, -1403, 5915, -1108, 388, -1266, + -522, 336, 167, 1, -3, -2, 2, -3, + -312, 19, 3356, 1123, -676, -247, 697, 548, + 1768, 1174, -525, -253, -423, 546, -2373, -2940, + -1055, -2304, 203, 1309, -574, -8, 0, -3, + 4, 0, 4, -215, 8192, -670, -1289, -1547, + -304, 1498, -967, -529, -582, -2205, 1752, 321, + 573, -1096, 64, 1152, -87, 574, -250, 539, + 62, 7, 2, -1, -3, 3, -465, 243, + -1179, 828, -2501, -223, 198, -883, -740, 1113, + -1821, -2068, -3234, 1715, 1989, 1817, 727, 1640, + 3386, -1538, -864, 45, 0, -4, 0, 0, + 2, 608, -1495, 1259, -132, 1311, 350, 537, + 2735, 1428, 151, 1324, 547, -3983, -1892, 104, + 2023, 1908, -1042, 1130, 1252, -701, 9, 0, + -2, -1, 1, 1, 602, -8192, -2776, -661, + 1640, 443, 3452, -738, 829, 637, 292, 232, + 1352, 4879, 1429, 912, 649, 1593, 308, -330, + 68, 63, -3, 4, -57, 26, 25, 1250, + 400, -4839, 211, -2748, -664, 996, 341, -1053, + 321, 2458, 764, 743, -729, 12, -283, -346, + 118, -249, -153, -2329, -37, 0, -1, 0, + 1, 1, 352, -878, 2336, -634, -2690, -3415, + -2949, -531, 1259, 394, 163, -994, 845, 1259, + 890, 1400, 279, 1908, 161, -2174, 1876, 76, + 1, -1, -1, 10, 0, 47, -1123, 1611, + 489, 618, -816, -7, 2001, -1190, 1857, -2749, + -311, -331, 733, 1412, 1390, -1525, 1262, -1393, + -263, 3124, -98, 0, 1, 0, 1, -2, + 514, -3533, -2394, 3623, 249, -1056, 515, 1279, + 2821, 477, 183, 689, 1182, 1378, 1287, -711, + 1264, -713, -278, 217, -664, -225, -1, 0, + 6, 2, 9, -1171, 3119, 1340, -1229, -1929, + 1984, -1333, 1018, 10, 1205, 63, 358, -1108, + -455, -413, 854, -1550, -423, -180, 2529, -8192, + -18, 0, -2, -1, 0, 0, -678, 3819, + -1316, 1159, 590, -231, 2203, -1533, 986, 4289, + 1114, 1135, -1162, -921, -58, 691, 11, -1718, + -270, -531, 530, 65, 0, -1, 1, 4, + 0, -1184, -1359, 7230, -533, -2077, -1188, 113, + -1472, 490, 1518, 1476, -1885, 934, 244, 1840, + -696, -480, -2476, 3324, -2433, 1102, 120, 1, + -11, -2, 18, -3, -1016, 189, -3835, -1659, + -46, -180, -2659, 1998, -1437, 1107, -2248, 165, + -657, -5079, -224, 1246, 469, 421, 1145, 1148, + 84, -18, 3, 0, 0, -6, 0, -66, + -206, 2279, -220, 1606, -421, -1482, -413, -1237, + 374, 3691, 491, -774, 410, 791, 380, 3385, + 615, -950, -620, -197, 65, -1, 3, -3, + 2, -1, -484, 1396, 273, -3591, 1317, -1013, + 1563, -134, 602, -1069, 733, -1167, 233, 319, + -262, 350, 780, -407, -496, -1285, 1326, -13, + 0, 2, -1, 0, -1, -328, -626, -848, + 745, -1047, 4048, -380, -456, -1894, 869, -1085, + -373, 2829, 622, 473, 394, 237, -2175, 1167, + -4942, 246, 100, -1, 1, -6, 1, -6, + -70, 35, 1613, 2597, 1307, 1756, -1184, 1082, + 971, -2004, -1459, -494, -40, 745, 2788, -830, + 76, 536, -2002, 401, -57, -20, 0, 0, + 0, 0, 0, -8, 244, 1927, 1162, -2416, + -1414, 463, -89, 1217, -798, 394, -1527, -719, + -666, 998, 1518, -2455, -3049, -1174, -2696, -3119, + 2, 0, -2, 2, 2, 3, 1093, -623, + 1660, -1635, 1457, 2560, 763, -2750, 931, 1798, + 2550, 1402, 914, -919, 1931, -383, -435, -583, + 439, 9, -1106, -12, -1, 0, 0, 0, + -2, -335, -730, -2102, -1414, 2576, -3869, 1025, + -1657, -2, 857, -336, -3011, 205, 1108, 364, + -789, -179, 171, 331, 2204, 527, -13, 1, + -3, 2, 1, -4, -565, -211, -139, 1799, + 195, -877, -632, 358, -244, -1459, 1398, 2271, + 550, 1987, 2206, -337, 199, -7036, 589, 195, + -466, 72, -1, 2, 1, 0, 0, -27, +}; + +static const int16_t cb0806sm0[] = { + -8192, 389, 245, -67, -42, 79, 503, -488, + -310, 107, -13, -431, -203, 96, 510, 151, + 270, 0, 0, 0, 0, 0, -463, -23, + -72, -322, 74, 1589, -152, -198, 81, 1120, + -125, -434, -3275, -2210, -348, -344, 91, 0, + 0, 0, 0, 0, -254, -224, 46, -154, + -131, -465, -57, 8192, 345, 112, -725, -49, + 183, -191, 246, 263, 370, 0, 0, 0, + 0, 0, 39, -739, -6603, -2454, -95, 312, + -53, -392, 63, -165, 31, -505, 111, 484, + -535, 179, 143, 0, 0, 0, 0, 0, + 1279, -139, -1769, 244, 59, -135, -429, 707, + 809, -4355, -354, 428, -300, 108, -799, -1421, + 599, 0, 0, 0, 0, 0, 4, -5, + 7, 75, 49, 8192, 276, 200, 191, -167, + -14, 82, 222, -277, -483, -216, -441, 0, + 0, 0, 0, 0, 171, -423, 174, 401, + -517, -377, -234, -644, -829, -350, -976, -146, + -928, 296, 3003, 3545, -30, 0, 0, 0, + 0, 0, 161, -6753, 1138, -855, -132, -242, + 559, -225, -346, -168, 10, -481, -6, -1208, + 252, -323, -191, 0, 0, 0, 0, 0, + -262, 574, 433, -145, 622, 329, -2634, -439, + -1178, 351, -433, -842, 4125, 296, 305, 359, + -22, 0, 0, 0, 0, 0, -34, -56, + -1019, -247, -163, 305, 574, -51, -179, 24, + -1097, 248, -166, -18, 303, 252, -555, 0, + 0, 0, 0, 0, -400, -254, -256, 2783, + -296, -1904, 552, 1284, -336, -2371, 3396, -1092, + 102, 176, 140, 640, -359, 0, 0, 0, + 0, 0, 373, 473, -2167, -774, -388, 405, + -1402, -1391, -1319, -155, 1104, -533, 382, 1561, + -2958, 406, 787, 0, 0, 0, 0, 0, + -3800, -58, 2098, -181, -570, 385, -4125, 759, + -1584, 9, -278, 201, -528, -527, -435, 436, + 681, 0, 0, 0, 0, 0, 30, -80, + -60, -4031, -70, -3367, 316, -861, 67, -169, + -144, 1598, 966, 32, -1263, -434, -738, 0, + 0, 0, 0, 0, 181, 12, 115, 91, + 253, 518, 517, 216, 830, 336, -568, -3125, + -796, -847, 1627, 58, -158, 0, 0, 0, + 0, 0, 48, -851, -286, 393, 390, 707, + 595, 427, -235, -116, 814, -198, 6145, -1590, + 647, 15, -259, 0, 0, 0, 0, 0, + -621, 152, 590, -16, 215, -633, -784, -140, + 1087, 723, -4191, 2701, 951, -972, 273, -554, + 387, 0, 0, 0, 0, 0, -124, -2939, + -38, 383, 234, 687, -2873, -466, 61, -472, + 854, -396, 305, -233, 82, -2677, -206, 0, + 0, 0, 0, 0, -120, -246, -614, -394, + 8192, 75, -450, 177, -251, 45, -142, 65, + -1248, -14, 389, 375, 114, 0, 0, 0, + 0, 0, 2870, 158, -473, -166, 928, -618, + -1909, 224, -931, 1898, -16, 427, 447, -1044, + 85, -333, 197, 0, 0, 0, 0, 0, + 78, 114, -167, 73, -1070, -80, 3512, -3004, + -1553, 769, 213, 851, -377, 978, 1097, 71, + 66, 0, 0, 0, 0, 0, -129, 248, + 455, -376, 344, 128, -60, 546, -321, -7898, + -719, -55, -941, 1242, 207, 215, 323, 0, + 0, 0, 0, 0, -24, -225, 136, 142, + -739, -117, 2, 242, -152, -20, -1775, -484, + -36, -408, -2767, -471, 251, 0, 0, 0, + 0, 0, 22, 111, -180, -7417, 365, 293, + -313, 1031, -191, 154, -210, -239, 121, -333, + -1504, 209, 146, 0, 0, 0, 0, 0, + 898, -643, 3080, 528, -91, -718, -512, 275, + -3564, 396, 160, -850, 346, -595, 1558, 684, + -310, 0, 0, 0, 0, 0, 234, -419, + -724, -433, 292, -1003, 682, -117, -1318, -914, + -5137, 128, 53, 291, 408, 1269, -284, 0, + 0, 0, 0, 0, -252, 190, -2911, 130, + 255, -172, -4331, 26, -267, 280, -133, -613, + -1063, -1135, 759, -1290, 216, 0, 0, 0, + 0, 0, 133, -177, 4069, -311, -197, 3260, + 341, 201, -117, -515, 105, -658, 975, 81, + -333, -333, 262, 0, 0, 0, 0, 0, + 273, -87, 321, 190, 1385, 274, 182, -2553, + -150, 164, -830, 89, -459, -5279, -624, -336, + 399, 0, 0, 0, 0, 0, -172, -232, + 11, 45, 121, -254, -457, 196, -3487, -838, + 512, -310, -2831, -85, 98, -145, -331, 0, + 0, 0, 0, 0, -55, -149, 2068, -61, + 3087, -143, 1574, -1381, 2853, 1899, -453, -580, + -137, 1211, -1413, 171, 125, 0, 0, 0, + 0, 0, -228, 30, -956, 5569, 209, -89, + 25, 573, -1669, 507, 182, -132, 697, -132, + -2964, -637, 139, 0, 0, 0, 0, 0, + -3078, -3278, -771, 928, -38, -463, 820, 1141, + -1234, 620, 652, -1710, -382, -1618, -409, 179, + 483, 0, 0, 0, 0, 0, -102, 4256, + -20, -162, 2021, 730, 1439, 2776, 459, 498, + -152, 482, 35, -271, 810, -1345, -249, 0, + 0, 0, 0, 0, 131, 5, -281, 431, + -2498, -1046, 482, 842, 297, -311, -1260, 148, + -906, -4217, -1411, -102, -361, 0, 0, 0, + 0, 0, 116, -3083, 235, -1195, -19, -646, + 42, 487, 309, 1654, 1051, -1643, 689, -823, + 2279, 1488, 571, 0, 0, 0, 0, 0, + 42, -95, -3, 36, -170, -114, 8104, 217, + 140, -217, 599, -774, -64, -675, -211, 166, + 204, 0, 0, 0, 0, 0, 99, 594, + -48, 224, 52, -1499, 271, 2224, -219, 3184, + -165, 828, -1345, -785, 181, 133, 124, 0, + 0, 0, 0, 0, -235, -286, 254, -171, + -4980, -453, -1432, 12, 734, -391, -640, 339, + 537, 313, -700, 1016, 148, 0, 0, 0, + 0, 0, -49, -19, 803, 935, 520, -90, + 641, 1053, -454, 2338, -6071, -478, 616, -559, + -339, 445, -1464, 0, 0, 0, 0, 0, + -175, 111, -132, 65, -264, 732, 221, 231, + -1972, -305, 325, -859, 583, 1272, -441, 2651, + 229, 0, 0, 0, 0, 0, -286, -4646, + -262, 593, 613, 936, 310, -615, 83, 223, + -816, 1910, 2041, 281, -190, -434, 114, 0, + 0, 0, 0, 0, -123, 684, -208, 524, + -606, -1223, 264, -983, -109, -1057, 696, 195, + -521, 945, -7503, 193, -120, 0, 0, 0, + 0, 0, 98, -358, -2165, 244, 277, 393, + 771, 3360, -258, -1218, -122, -1253, -2297, 806, + -198, 540, 7, 0, 0, 0, 0, 0, + 78, -281, -368, 2809, 159, 2611, 833, -120, + -3987, 933, 360, -49, -515, -106, -360, 650, + -125, 0, 0, 0, 0, 0, 203, 1369, + 749, -502, -2295, -326, 448, -309, 630, -84, + 345, -520, -4, -623, 1066, -3915, 373, 0, + 0, 0, 0, 0, -4603, -794, -625, -355, + 1071, -601, -553, 593, -296, 626, -328, 621, + 85, 1348, 92, -288, 204, 0, 0, 0, + 0, 0, -9, 602, -162, -749, -104, 464, + -372, -1375, -1905, 2200, 61, -3308, -897, 634, + 1036, -2112, -182, 0, 0, 0, 0, 0, + -76, 2341, -675, -72, -29, 704, -536, 1656, + -541, -736, -1420, -1539, 2458, -228, 674, -1258, + -3, 0, 0, 0, 0, 0, -133, 1111, + 63, 327, 470, 1226, 541, -276, -3042, -1594, + -3192, 357, -617, 658, -315, -978, 631, 0, + 0, 0, 0, 0, 111, -188, 619, 236, + 104, 54, 545, 424, 5912, -332, 711, -1249, + -533, 291, -1544, -216, 113, 0, 0, 0, + 0, 0, -199, 267, 152, -301, -172, 1294, + 2311, -482, -2451, -82, 1833, 214, 130, -1183, + -2212, 403, -625, 0, 0, 0, 0, 0, + -106, 662, -48, -131, 324, 2337, 445, 462, + -349, -189, 669, 4945, -1797, 16, 268, -602, + 2, 0, 0, 0, 0, 0, 55, 154, + 892, -35, -145, 357, 562, 42, -9, -284, + 177, 84, 422, -181, -358, 7618, 29, 0, + 0, 0, 0, 0, -353, 68, -41, -4096, + 177, -20, -267, 782, 954, -430, 1573, -696, + 1785, -3611, 89, -243, 683, 0, 0, 0, + 0, 0, -220, 1983, -891, 614, 226, -202, + 67, 761, 1904, 179, 226, 416, -657, -3409, + 1026, 2834, -438, 0, 0, 0, 0, 0, + -551, -229, -304, -462, -2277, -419, 451, -122, + -108, 258, 784, 1105, 382, 137, 5695, -241, + -491, 0, 0, 0, 0, 0, 34, -272, + -1687, 1769, -332, 365, 33, -2594, 3729, 325, + 85, -295, -290, -152, 2238, -611, -41, 0, + 0, 0, 0, 0, 102, 166, 241, 1098, + -107, 775, -414, 4256, -277, 935, -200, 495, + 255, 1144, 468, -184, -59, 0, 0, 0, + 0, 0, 94, -282, -57, 12, -390, 245, + 1872, -620, 1089, 3754, 432, 947, -509, -284, + -3836, 26, 482, 0, 0, 0, 0, 0, + 9, 971, -373, 1111, -480, 2342, -182, 528, + 802, 1196, -1017, -879, 499, 2800, -830, -230, + -4, 0, 0, 0, 0, 0, -382, -815, + -1669, -2437, -593, 193, -688, 632, 479, 2883, + 565, 540, 5, 1598, 1618, -640, -246, 0, + 0, 0, 0, 0, -421, -103, 1482, -3026, + -65, -101, 4, 3921, 688, -941, -234, 49, + 202, 1905, 935, -1155, -4, 0, 0, 0, + 0, 0, 210, -625, -118, -3215, 344, 978, + -10, 773, -126, -804, -1534, 182, -1146, -646, + -146, 2011, 463, 0, 0, 0, 0, 0, +}; + +static const int16_t cb0806sm1[] = { + 35, -237, 547, 705, -9, 1612, 382, 195, + -191, -250, -101, -357, 709, 153, 850, -5091, + -100, 0, 0, 0, 0, 0, -6406, -158, + -527, 137, -330, 580, -484, 63, 541, -1245, + -205, 138, 247, -489, -147, -132, -863, 0, + 0, 0, 0, 0, 53, -38, 283, -22, + -1506, -467, -418, 117, 133, -2152, -48, -991, + 808, -1047, 2402, 261, 423, 0, 0, 0, + 0, 0, -14, 500, 4697, -174, -544, 87, + -379, -243, 577, 682, 258, -1190, -1984, 599, + 607, -123, -290, 0, 0, 0, 0, 0, + 60, 4254, 194, 888, -81, -395, 422, -1786, + 916, 288, 1191, -658, 502, 2177, -977, -301, + 587, 0, 0, 0, 0, 0, 232, 204, + -452, -853, -4266, -219, 1164, 92, 91, 1561, + 950, -705, -1217, -734, 1617, 120, -324, 0, + 0, 0, 0, 0, -3442, -456, -667, 987, + -89, 1383, -704, -187, -280, -583, 341, -732, + 649, -2129, -3505, -175, -215, 0, 0, 0, + 0, 0, 200, -635, -471, -1221, 215, 2844, + 1633, 522, -720, 1722, -272, 473, 198, -604, + 480, -88, 169, 0, 0, 0, 0, 0, + -160, -268, 130, 284, -612, 95, 43, 42, + 641, -258, -6884, -167, -689, 123, 276, -592, + 717, 0, 0, 0, 0, 0, 313, -90, + -4310, 2706, -1708, 648, -796, 791, 998, -468, + 632, 1893, 43, 1937, -1279, -22, -64, 0, + 0, 0, 0, 0, -106, 135, -287, 335, + -7999, 51, -250, -388, 16, 285, -101, 685, + -944, 604, -624, -792, 209, 0, 0, 0, + 0, 0, 496, -205, 422, 49, 274, -229, + 220, 73, -734, 381, -394, -8192, -405, 755, + -9, 46, 116, 0, 0, 0, 0, 0, + -28, 332, 1152, -129, 244, 84, -2193, 632, + -1854, -384, 110, -302, -270, 435, -1689, -797, + 686, 0, 0, 0, 0, 0, -1660, 624, + -664, 2611, 30, -1155, -419, -3539, -568, 1719, + -1374, -676, -55, -1934, 863, 1391, 433, 0, + 0, 0, 0, 0, -1012, 290, 2302, -330, + -95, -2355, -55, -763, -1995, -298, -680, 715, + -85, 1615, 1011, -1989, -1028, 0, 0, 0, + 0, 0, 21, -5001, 507, -58, 229, -37, + -113, 632, 1809, -62, 334, -1201, -893, -344, + 98, 438, -65, 0, 0, 0, 0, 0, + 0, 143, 131, -18, -135, -306, 392, 232, + 265, 543, 376, -562, 362, 2458, 785, 3653, + -456, 0, 0, 0, 0, 0, 855, -4009, + -1207, 118, -86, -223, 266, 154, -1886, -1145, + 241, -397, 246, 244, -776, 808, -132, 0, + 0, 0, 0, 0, 2, -633, 113, -94, + -154, -173, -162, -168, 439, -6548, 778, -392, + -60, 99, -1901, 171, -130, 0, 0, 0, + 0, 0, -11, -324, 711, -903, 560, -1654, + 1473, -300, 1048, 137, -1140, -1115, -1302, -1008, + -792, -3264, -540, 0, 0, 0, 0, 0, + -347, 78, -103, -7, -3, 437, 6053, 299, + -435, 323, 664, 477, 1097, 158, 656, 273, + 200, 0, 0, 0, 0, 0, -101, 80, + -153, 144, -235, 492, -399, -3, 4958, 699, + -586, -162, 153, -860, 161, 665, 4, 0, + 0, 0, 0, 0, -87, -189, 1744, -350, + -1840, 325, -2354, 1193, 1386, -1589, 80, 1055, + -188, 273, 807, 2038, -419, 0, 0, 0, + 0, 0, 50, -185, 68, -59, -9, 78, + -585, -121, -7888, 771, -908, -284, 349, 158, + -1122, -139, -189, 0, 0, 0, 0, 0, + 310, -286, 235, -687, -919, -364, -697, -253, + 492, 300, -238, 272, 518, -525, -5863, -190, + -59, 0, 0, 0, 0, 0, 151, 616, + -4420, 227, 240, -252, 516, -250, 68, 411, + -192, -87, -607, 671, 1281, -317, -305, 0, + 0, 0, 0, 0, -9, 817, -451, -1079, + 86, 5060, -1157, -1159, -421, 302, 1636, -316, + -66, -518, 1010, 1068, 96, 0, 0, 0, + 0, 0, -576, -362, 107, 3516, 303, -364, + -402, 805, 574, 993, -554, 298, -925, 410, + 1898, 13, 138, 0, 0, 0, 0, 0, + -340, -150, 528, 142, -464, 1034, -397, 3944, + -697, 962, 902, 1393, 2212, -1021, -1034, -961, + -319, 0, 0, 0, 0, 0, 58, 38, + 382, 221, -212, 826, -1373, -4559, 1329, -123, + 216, -23, -736, 95, -300, -418, -4, 0, + 0, 0, 0, 0, -58, 7814, 218, 141, + -90, -124, 455, -27, 49, -311, -364, 80, + -136, -1257, 96, 332, -287, 0, 0, 0, + 0, 0, -8, 624, 127, 1857, -480, -869, + -575, -1461, -493, -261, 97, 32, -328, -467, + 173, -2588, 132, 0, 0, 0, 0, 0, + 5257, -1037, 191, -844, 247, 130, -571, -548, + -496, 216, -161, 336, 62, 990, 130, 517, + -65, 0, 0, 0, 0, 0, -89, 9, + -138, 405, -701, -479, 3605, 699, -629, -102, + 27, -1374, -1059, -18, -2707, -172, -557, 0, + 0, 0, 0, 0, -67, 209, 571, -93, + -405, -172, -260, -19, 86, 22, 659, -630, + 222, -8192, 106, -34, 60, 0, 0, 0, + 0, 0, -10, -3386, 336, 651, -1377, 681, + -16, -45, -382, 1102, -280, 169, -822, 522, + 434, -1111, -299, 0, 0, 0, 0, 0, + 194, -445, -231, -532, -438, -180, -591, -1680, + 179, 5921, -184, -685, -467, 875, -573, 282, + 235, 0, 0, 0, 0, 0, 339, 139, + -745, -68, -201, 467, -743, 477, -23, -1177, + 1384, -357, -1254, -3760, 454, 1175, 252, 0, + 0, 0, 0, 0, 109, -252, 8027, -765, + 136, 111, -86, -593, -84, -750, -121, 782, + 739, -296, 284, 213, -1196, 0, 0, 0, + 0, 0, -40, 69, 1992, 452, -75, -84, + 683, 1678, -1350, -1846, 3068, -749, -1410, -271, + 536, 1120, 117, 0, 0, 0, 0, 0, + 4053, 340, 108, -88, 411, 990, 217, 3675, + 755, 752, -206, 205, -297, -573, 188, 127, + -313, 0, 0, 0, 0, 0, 47, -2870, + -3417, 216, 1730, -83, 189, -1615, 1016, -44, + -502, 2151, 6, -1057, 550, 194, -498, 0, + 0, 0, 0, 0, -133, 1, -387, -497, + 586, 173, 923, -4078, -1232, 329, -2086, -185, + 592, 681, 3320, -914, -327, 0, 0, 0, + 0, 0, -132, 493, -179, 220, 142, -4345, + 422, -173, 357, 1317, 240, -525, 1613, -178, + -1584, -734, 549, 0, 0, 0, 0, 0, + -337, 111, -1238, 116, 302, 325, 189, 610, + -3180, -284, -817, 1383, 1559, -802, 422, 438, + 460, 0, 0, 0, 0, 0, -96, 372, + 335, -843, 3967, 221, 380, 227, 309, 447, + -199, -257, 372, -397, -534, 736, -152, 0, + 0, 0, 0, 0, -144, 463, -54, -288, + -83, 115, -574, -229, 485, -2643, 58, 4312, + -1155, 642, -647, 1122, 118, 0, 0, 0, + 0, 0, 157, 6, -1017, -1155, 687, -288, + 918, -212, -332, -2486, -197, -1025, -546, 4099, + 155, -731, -333, 0, 0, 0, 0, 0, + -43, -496, -546, -541, 283, -521, -47, -18, + 208, -552, 1899, 2107, 588, 818, -911, -1104, + -84, 0, 0, 0, 0, 0, -71, 40, + -326, 92, 216, -106, -255, 28, 120, -58, + -2720, -133, -288, -28, -1157, 1563, 400, 0, + 0, 0, 0, 0, 40, -4, 559, 1350, + 30, 3905, -675, -1092, -587, -1524, -1987, -1031, + 1892, -679, -623, 1051, -33, 0, 0, 0, + 0, 0, -98, 106, 105, -5887, -463, 424, + -42, -506, -589, 376, 840, 140, -640, 771, + 23, -441, -6, 0, 0, 0, 0, 0, + 22, 203, -3452, -635, -605, 1668, 422, 2973, + 394, -1605, -968, -739, 344, -1438, 820, -1318, + -26, 0, 0, 0, 0, 0, 258, -32, + 1061, 643, -152, 92, -454, -1305, 1621, 554, + 344, 82, -404, 5222, -344, 286, 177, 0, + 0, 0, 0, 0, 63, -360, -127, 814, + 3639, -3322, 390, 12, -515, -493, 1515, 1706, + -727, 394, 1164, 357, -208, 0, 0, 0, + 0, 0, -27, 648, -342, -125, -327, 194, + -3639, 598, 29, 244, 898, -493, 372, -635, + 567, 31, -237, 0, 0, 0, 0, 0, + -160, 2798, -1768, -2186, 493, 517, -82, -468, + -290, 2890, -460, 450, 414, -265, -1121, 219, + -1115, 0, 0, 0, 0, 0, 14, 76, + -2806, 338, -1429, -402, 253, -130, -235, -799, + 309, -525, 3823, 175, 36, 113, 247, 0, + 0, 0, 0, 0, 352, 521, 213, -107, + -71, -762, 790, -856, -252, -246, -729, -631, + 1258, -3276, 1534, -436, -635, 0, 0, 0, + 0, 0, -54, 118, -453, -124, -32, 539, + 356, -169, -202, -590, 721, -444, -6260, -275, + -239, -105, -52, 0, 0, 0, 0, 0, + -464, 507, -796, 1273, 2297, 790, 652, 392, + 3364, -1949, 2154, -701, -229, 99, 88, 471, + -524, 0, 0, 0, 0, 0, 71, -914, + 1835, -156, -242, -196, 513, 431, -481, -84, + -734, 4501, -510, 115, 461, -428, 83, 0, + 0, 0, 0, 0, -3987, 1063, -717, -2640, + -963, -667, -147, 536, -68, 422, 341, -1916, + -616, 996, 522, 568, 1174, 0, 0, 0, + 0, 0, 8, 112, 693, 392, 445, 5309, + 259, 121, 1670, 343, 176, 472, 197, 419, + -240, -1178, -107, 0, 0, 0, 0, 0, +}; + +static const int16_t cb0808l0[] = { + 164, -3637, -3563, -243, -123, -47, -87, -32, + 62, 129, -2, 131, -36, -202, -197, 37, + -35, -442, -139, -69, -59, 29, -62, -67, + -17, -42, 74, 10, 107, 74, -109, 40, + -10210, -33, -3210, -410, -106, 512, 40, -17, + 109, 67, 99, 170, 53, 34, -68, -16, + 3895, -71, -116, 1, 608, 66, -215, 34, + 77, 50, -45, -73, 3, 11, -33, 18, + -34, 58, 25, 4420, 96, 77, -67, 23, + -83, -6724, 226, -32, -150, -154, 30, -12, + -8, -7, 89, 42, 173, -51, 38, -1852, + 40, -48, -40, 81, 34, 81, 66, 16, + 20, 3, 99, 41, 123, 52, 154, 20, + -38, 6, 10889, -44, 22, -39, 55, -34, + 25, -45, -22, 139, 19, -20, -64, -2242, + -473, -113, 316, 127, -31, 128, -363, -124, + 196, 259, -60, -3792, -41, -103, 104, -80, + -389, 179, 110, 83, 3174, 60, -197, 101, + 66, -47, -107, 96, -27, 45, -21, 6, + 116, -51, -8, -594, 377, -279, 158, -159, + 4595, -163, -210, 19, 3, -292, -67, 14, + 115, -41, -125, -154, -263, -101, 4, -11, + -89, 130, 58, 32, 92, 16, 126, -93, + -99, -4239, -69, 88, 5, -113, -18, 35, + 31, -48, -16, 35, 62, -2839, 14, 121, + 19, 41, 125, -102, 26, -13144, 6, -30, + -7, 60, 4, 36, -40, -26, 54, -57, + -9, -30, 13, -1, 73, -131, 29, 256, + 39, -51, -12, 1788, 4, 10, -58, 17, + -36, -2, 13, 59, -20, -21, 173, 129, + -435, -107, -214, 33, 3078, 13, 31, 148, + -2975, -311, 38, 25, -247, -542, 34, 106, + -392, 85, -203, 182, -232, 423, 629, -183, + 800, -466, 3145, -2498, -305, 39, 22, 41, + 0, -14, 671, -181, 3197, 109, 2900, 72, + -64, 8, 414, 133, 244, -263, 53, -69, + 70, -13756, -13, 21, 50, 12, -14, -12, + -7, 97, -32, 24, 51, -24, -29, 53, + 34, -19, -2341, 976, 25, -58, 18, -48, + -2490, -55, -31, -165, -36, 28, -26, 92, + 60, 137, 69, -5341, -125, 1966, -154, -66, + -13, -84, -13, 81, -46, -96, 50, -50, + -114, 15, 30, -211, -147, -555, 3998, 88, + 358, -159, -105, -51, -109, -16, 70, 91, + 268, 125, -95, -62, 38, -3227, 3591, -15, + 92, -72, 115, 144, -40, 142, 172, 72, + -17, 23, 1, 28, -38, -135, 220, -80, + -179, 9, -32, -6, 37, -33, -3, -89, + 7314, 5, 194, -13, 23, 31, 42, 84, + 197, -163, -251, -273, 193, 206, -613, 394, + 3469, 2587, -701, 62, 301, -104, 200, 164, + -201, -473, 52, -473, 128, -381, 404, -69, + -230, -537, 157, 389, -7, 2783, 3058, 95, + -59, 1618, 1, 4, 53, -6, 28, 10, + 2, 82, 28, -8, -14, 25, 59, 10, + -4, 36, -777, -4984, 29, 8, 85, -43, + -137, -34, 53, -58, 1, -27, 91, 15, + 80, -19, -186, 467, 94, -382, 129, 327, + 3053, -221, 399, -2821, 1090, 278, -2, -163, + -398, 126, -266, 180, -235, 70, -18, -34, + -45, 159, -32, 66, 11, 3177, -188, 27, + 35, -52, 114, -28, -136, 186, 2146, 100, + 92, 6, 58, -70, 159, -14, -32, 9, + 6, -27, -73, 28, 23, -24, 101, 148, + 80, -52, -27, -53, -36, 4, -74, 47, + -30, -108, 34, 7213, 12, 31, -17, -185, + 3318, 199, 192, 3450, -87, 3, 47, 46, + -141, 49, 83, -82, -132, -82, 68, 138, + -1031, -236, 390, -37, 23, -94, -7, 9, + -2958, -1846, -43, 23, 25, -79, -193, -77, + -3332, -3355, -139, 56, 163, -3302, -82, -25, + 35, 96, 73, 166, -154, 174, -121, 14, + -89, 101, -3751, -344, -240, -35, 401, -14, + 47, -49, 24, -78, 24, 6, 68, 51, + -145, 20, 83, 57, 147, -100, 60, 33, + -53, 11, 37, -5793, -93, -67, -9, 117, + 112, -51, 60, 48, 49, 328, 293, 127, + -314, -3022, 374, 3283, -86, 588, -346, 436, + -7, -26, -88, 104, 205, 150, 147, 34, + 126, 85, 46, -125, -119, 75, 13, 144, + 3721, 275, -71, 43, 163, -73, -292, -381, + -79, 33, 79, -79, 34, -94, 18, 229, + 63, 28, -44, 97, -3606, 77, -95, -162, + 163, 62, 6180, 81, -51, -19, -5, 109, + 71, 7, -37, -100, -31, -94, 188, 169, + -14, 2606, -417, 18, -4371, -25, 180, 108, + 17, 33, 48, -46, -93, -77, 32, -37, + -71, -271, -48, -273, -14, 115, -59, -312, + -3334, -3046, 71, -166, 379, 209, -142, 22, + 89, -41, -40, -7, -50, 8, -15, 12, + -70, -27, -27, 25, -31, 38, -5, 2831, + -89, -8, -50, -110, 1368, -59, -2307, 6, + 179, 75, 189, 170, -55, 330, -70, 172, + 67, -492, -57, -3408, 9, -93, -11400, 14, + -1, -21, 65, -15, 45, -22, 40, -10, + -41, 23, -29, -96, -55, -66, -57, -61, + -29, -15, -101, -9831, 33, 42, -35, 42, + -44, -58, 11, -40, 27, 21, 715, -315, + -255, -115, 1736, 4, 41, -70, -51, -108, + 160, -9, 87, -6, 36, -20, -68, 10, + 82, -33, -42, 15, -57, -40, -31, 21, + 10023, 62, -41, -10, 85, -65, -12, -61, + -72, -610, 128, -76, 198, 367, -4564, 60, + 158, -13, -134, -45, -33, -11, -51, -72, + 111, -188, 232, -494, -27, 42, 46, -23, + 137, 3174, -3598, 211, 152, 155, -299, 56, + -23, -123, 132, 50, 28, -64, 28, 9, + -17, 31, 112, -19, 4, 45, -7175, 54, + -61, -7, 87, 164, 195, -29, -48, 28, + -60, 70, -69, 112, -295, 5, -89, 38, + 36, -11501, 17, -26, -64, -222, 91, -23, + -89, 0, -94, 2191, -74, -84, -61, -41, + 57, 24, -35, -28, -37, 486, 131, 3699, + -277, 64, -125, -243, 270, 313, -112, 145, + 47, -2862, -254, -110, -27, -69, -342, -120, + 216, 35, 24, 62, -39, -29, 2402, -7, + -3, 14, -47, -27, 4, 27, 20, 81, + 138, 75, 178, 421, -2943, -3080, -84, -40, + -58, -195, -182, 101, -187, 6, -83, 269, + -32, -99, 51, -38, 44, 82, -14, -35, + 0, 8, -23, 10754, -73, -57, 68, 107, + 85, 77, 101, 1, -28, 103, -10, 48, + 55, 33, -93, -18, 8, 28, -14, -575, + 28, -11712, 90, -186, 58, 38, -42, 2156, + -82, 28, -23, 43, 43, 8, 25, 65, + 0, -53, 28, -88, 388, -36, 363, 64, + 3068, 56, 320, -202, -3433, 73, -339, -157, + 373, -216, -43, 171, 140, -437, -143, -2820, + -101, 53, -111, 65, -39, 65, -30, 69, + -55, 49, 45, 126, 174, 220, 73, -101, + -60, -151, -13, -41, -48, -9, 25, -122, + -80, -2450, 19, 94, 14, -18, -19, 60, + -3252, -10, 3390, -15, -365, -15, -73, -222, + 307, 70, -95, 237, -142, -163, -44, -138, + -7, 6, -36, -67, 9, -22, 10235, -56, + -8, 44, -155, -117, -22, -32, -74, -14, +}; + +static const int16_t cb0808l1[] = { + -58, 222, -154, -74, -53, 4939, 421, 67, + 26, 132, 60, -97, -1, -43, 328, 2, + 460, -66, -11, -45, -56, -86, -10569, -129, + 58, -25, 39, 28, 26, 45, -61, -139, + -22, -135, -282, -517, -368, 55, -47, 30, + -110, 47, 75, -13, 65, -41, 104, 4745, + -149, -99, 28, 421, 517, -56, 81, -309, + 67, -42, -6, 17, -60, -151, 50, -84, + -9, 29, -72, -3019, 82, -195, 41, -14, + -206, -34, -58, -18, 30, 2154, -20, 2, + -1, 41, -10, 7, 86, 494, 123, 328, + 73, 213, -29, 17, 43, -92, -61, -9, + -130, -113, 33, -28, -6677, -198, -185, -236, + 183, -108, 739, 60, 98, -314, 66, 10, + -3161, -159, -2850, 118, 37, -41, -119, 3087, + 43, -36, 42, 106, -174, -3379, -92, -142, + -237, 94, -59, -123, -117, 144, -75, 146, + -268, 561, -1160, 336, 1477, 207, 89, 130, + 127, 3763, -372, 48, 99, 204, 84, 209, + 103, 118, 125, 326, -29, -206, 139, -61, + 94, 77, 6624, -163, 23, 27, -104, 150, + -76, -205, -186, -30, -227, -58, 17, 25, + -6536, -19, -66, -45, -72, 41, 49, -79, + 105, -4, -117, -37, -183, 216, -27, -23, + -31, -2720, 53, -23, -46, -9, -10, 50, + -12, -50, -56, 35, 5498, -110, -2, 44, + -1, 13, 52, -18, -61, -80, -29, 25, + 61, -37, 93, -19, 67, 75, -41, 254, + 161, 118, -3379, 398, -9, -208, -143, 207, + -135, -32, 171, 187, -194, 466, -55, 158, + 34, 105, 4986, 27, -41, 20, 87, -110, + 39, 80, -37, 8, -25, -44, -108, -171, + -366, 208, -225, 1, -124, 21, 81, -10349, + -51, 33, -51, 141, -36, 106, -100, 320, + 122, 3, 266, 72, -8, -112, 55, -107, + -4154, -69, 0, 71, -153, -80, -50, 20, + -112, 225, -1982, 273, -19, -127, 109, -25, + 47, 57, -98, -10, 42, -25, 10, 24, + 41, -73, 45, -3523, -370, 3213, 54, -87, + 67, -185, 100, -33, -41, 3, -38, 70, + -108, -120, -67, -144, -181, -33, -104, 429, + 89, 849, 3022, -2765, -341, 184, -248, 610, + 408, -222, 184, 84, -64, 479, -146, 47, + -100, 13, 17, -7, 58, -13, -36, -23, + -1, -25, 10, 2666, -113, -41, -140, 3064, + 105, 31, 3042, -75, -132, -113, 80, -100, + -39, 216, -4, 7, -43, 242, 19, -1031, + 731, -3659, -24, -20, 109, 126, 2980, 19, + -11, -48, 57, -138, -11, -211, -151, 540, + -113, -110, 0, -415, 150, -80, -80, 209, + -82, -5212, -125, 376, 8, 131, -138, 30, + -922, -320, 181, -75, 138, -112, 146, -72, + 64, -75, -262, 4872, -11, -61, 37, -205, + 48, -2257, 82, 106, 93, -66, 48, 71, + 29, 72, 32, 29, 17, 5, 34, 29, + -29, -72, 50, -7702, -114, -117, 47, 11, + 19, 100, 48, -28, -8, 53, 21, 80, + -43, 37, 164, 22, -15, -5258, -23, -32, + 108, 52, 7, -161, 11, 84, 141, -8, + -12, -25, 111, 146, -96, 66, 7388, 54, + 17, -54, 62, 44, -66, -13, 26, 13, + 85, -79, -21, 98, 156, 181, -103, -188, + -35, -179, 83, 117, -92, 49, -185, 3800, + -90, 14, 42, 94, -83, -178, -156, -8, + 33, 42, 204, 42, 1, -85, 47, 10, + 10804, 36, 8, 26, -47, -51, -189, 83, + -47, -23, 104, -7142, -67, 55, 21, 68, + 8, -84, -60, -43, 142, -41, 27, -72, + -70, -170, -141, 202, -198, -105, 41, -3553, + -34, -148, 34, -62, -161, -20, -73, 128, + 162, -8343, 4, -71, -46, 12, 27, 48, + -41, 50, -19, -88, 7, 79, 29, -19, + -31, -49, -147, -1886, -103, -213, 28, -183, + 4119, 87, 6, -6, 51, -190, -167, -116, + 23, -26, 7, -38, 5442, -1869, -81, 197, + 105, -122, 65, 220, 32, -57, -39, -15, + 4, 112, -55, -139, -825, 985, -109, 2558, + 218, 94, 65, -184, 3269, 101, -65, 42, + 372, -38, 58, 8, -143, -544, -268, 121, + 38, 61, -63, -10, -30, -52, -76, -74, + -6690, -5, -160, 76, -77, 74, 374, -917, + 239, -203, 550, -84, -305, 292, -51, 36, + 135, -79, 27, -69, -309, 4561, -67, 11, + -60, 43, 18, -2, 8, -15, 20, 22, + -2, -41, -2396, 37, -79, 67, 27, -84, + 353, -213, -2336, 58, 39, 126, -78, -98, + -90, -3, -9, -43, -2, -29, -5, -149, + 42, 98, -109, 137, 58, -83, -38, 51, + 6525, 50, 97, -31, 8, 132, -71, -55, + 11, 120, 2, -43, 136, -37, -85, 150, + 133, 67, -41, -452, -104, 4, 126, 100, + -2660, -108, -109, -64, 615, -75, 45, 10, + -57, -57, -108, 167, -218, -10, -331, -26, + -21, 6561, 73, -599, 126, -23, 250, -103, + -4, -28, -20, -35, -19, 51, 9, -25, + -40, -11220, -2, 28, -12, 23, 3481, 169, + 159, -217, -48, 114, -93, -34, -191, -63, + 31, 182, 79, 90, 55, 67, -145, 409, + 190, -7791, -26, 18, 71, -113, -80, 69, + -21, -27, -121, 51, -148, 103, 196, 2726, + -67, 3022, -28, 26, -99, 51, 24, 61, + 104, 89, -57, -23, -112, 43, 6, 13, + -184, -168, 117, -29, 1865, -3, 20, 8, + 30, 32, -81, 80, -20, -59, 37, 19, + -107, -3920, -259, 44, 23, -129, 24, -66, + -27, -3071, 116, 9, -76, 56, -83, 25, + 54, -20, 2, 230, 56, -41, 131, -15, + -62, 61, 56, 74, -34, 110, 4606, -4, + 18, -47, 331, -106, -78, 70, 53, 70, + -22, 77, -71, -60, -101, 70, 7, 104, + -7, 39, -27, 7210, 253, -15, 0, -96, + 32, 50, -10, 33, 2058, 11, -15, 42, + -14, 51, 4, -3, -11, -86, 10, 33, + 21, -18, -31, -7, 53, -7, 95, 7, + 75, -11314, 7, 17, -16, -83, -475, -887, + -1141, 1, -101, 5, -46, 110, -90, -47, + -15, 19, 66, -4078, 104, 43, 105, -126, + 181, 43, -1655, -81, -11, 33, -33, 33, + 28, -44, 35, -6, -38, 68, -40, 67, + 73, -29, 171, 11982, 42, -8, -66, -66, + 40, -19, 14, 33, -63, 24, 94, -94, + -106, 584, 330, -108, -3841, 782, -300, -11, + -303, -174, -217, -3, 24, 168, 187, -166, + 54, 238, -269, -27, 182, -4, -72, -47, + 32, 39, 7622, -46, -67, -53, 56, 123, + -50, 69, -36, -275, 628, -55, 195, -56, + -265, -132, -39, -4, 169, 113, -180, -19, + 88, -6427, 42, -257, 1180, 359, 335, 3821, + 116, 79, 3, -93, 67, -44, 58, -16, + 265, 172, -39, -44, 18, 92, 4, 218, + 122, -2993, 150, 138, 618, 66, -618, 402, + 2227, 10, 38, 308, 338, -70, 265, 1047, + -104, -182, 305, -162, -99, 510, -20, -114, + 529, -42, -3569, 52, -80, -314, 716, -31, + 259, 59, -73, -117, 38, -44, -16, -74, + -5060, 35, 10, -30, 54, 217, 36, -205, +}; + +static const int16_t cb0808s0[] = { + -2191, -865, -1906, -251, 274, 594, -1214, 677, + 482, -1176, 43, -1098, -203, -537, 1834, 1332, + 308, 432, -191, 3091, 1892, 926, -446, -1206, + -613, 198, 575, -38, 264, 375, 278, -691, + -107, 17, -239, 261, 848, -620, 183, 624, + 122, -358, -50, 1017, -1075, -705, -346, 337, + -121, 100, -218, -1051, -463, -4728, -513, -1151, + 737, 4356, 684, -1374, 1630, 521, -520, -52, + 90, 119, -43, -131, 24, -2, -184, -65, + 614, 371, -448, -414, 1415, -687, -224, 584, + -768, -1210, 2941, -3057, 132, 406, -952, 291, + 295, -798, 608, -1476, -516, 21, -302, 2085, + -1700, -2655, -355, 175, -409, 662, 46, -247, + -201, -580, 179, -54, 458, 836, 1543, 1829, + -282, -278, 412, 2422, 2077, 197, -897, 451, + 595, 1547, 538, 825, 563, 443, -576, -854, + -572, 241, -471, 201, -311, -529, 112, -5128, + -173, -233, -435, 340, 158, -41, 273, -224, + 919, -1570, 1075, 265, -282, 1256, 1007, 231, + 720, 417, -401, -4589, -747, -453, -1112, 54, + 156, -561, 2746, -422, -83, -91, -381, -270, + -1226, 987, -965, 625, -474, 565, 2890, -85, + 1291, -280, 626, -26, 840, 1122, -1915, 780, + -702, 792, -578, -122, -9, 1175, -194, -571, + 2940, 540, 31, 1817, -352, 264, 953, -2035, + 238, 3250, -1561, 653, -331, -393, 827, -382, + 323, 281, -1339, -819, 545, 207, 14, 338, + 432, 860, 1691, 142, 711, 381, -1151, 4164, + -867, -241, 111, -513, -863, 78, 1453, -363, + -128, -232, -1853, 2373, -1156, 210, 698, 1134, + -869, -177, -352, 1514, -1370, -789, -1193, 819, + 348, 80, 492, 179, -909, 591, -600, -377, + -1709, 59, -539, 557, -45, -362, 778, -4919, + -647, 203, 865, -313, -257, 173, -2415, 1005, + -1771, 843, -474, 1619, 1193, -186, 305, 636, + -662, 1976, 546, -82, -108, -751, 850, 521, + -1625, -3135, -388, 64, 249, -1189, -1552, 2629, + 2, -221, -105, 754, 251, 219, -270, -202, + 545, 147, 1019, 108, -1358, -1317, 1362, -1323, + -3322, -405, -371, -554, -334, 296, 493, 248, + -4, 1340, 123, -584, -804, -766, -164, -470, + 295, 218, -3, 62, -194, -657, 5016, 280, + -4, -69, -281, -994, 209, 307, 8648, -37, + -138, 45, -329, -101, -65, 98, 58, 714, + 56, -170, 60, -203, -248, 103, 107, -408, + 596, 170, 61, 584, 727, -434, -181, -5116, + -502, 494, 52, 83, -105, 325, 68, -561, + -274, 371, -1833, -78, -2990, 320, 141, -748, + 1764, 1157, -538, -276, -1594, -152, 838, -45, + 1137, 13, -803, -162, -838, -1199, 2003, 580, + 3687, -844, -552, -271, -462, -1034, -29, 273, + 862, 269, 95, 186, -222, -124, 79, -34, + -684, 808, -1061, -916, 610, 539, 1289, 782, + 1216, 3213, -38, -546, -1209, -398, 98, -39, + 58, -1271, -611, 573, 499, -2170, -157, -943, + -595, 436, 1203, 487, -1419, -570, 1468, 711, + -589, -101, 3299, -45, -1432, -453, 1820, 677, + 1052, -1793, 1071, -400, 268, -464, 443, 508, + -273, -736, -233, 270, -1187, -1931, -1208, -519, + -879, 325, 1032, 280, 565, 294, 2588, -303, + 640, -1398, 1070, 674, 57, -165, -46, 512, + 757, -3471, -812, -854, 45, 101, 3195, -786, + -61, 122, -1234, -74, 119, -389, 254, -84, + 829, 1465, -930, 171, -248, 201, 939, 1, + 52, -3517, -1854, 147, -843, 310, 502, 729, + 191, 525, 333, -669, -3358, 215, 552, 156, + -1771, 982, -746, 523, -187, -684, 456, 123, + -1544, -145, 58, -1083, -1646, -1309, 775, 1436, + 1409, -1114, -171, 26, -1775, 1103, -392, -2053, + -1221, 100, -1120, 25, -295, 306, -105, -514, + -4362, 156, -2172, -191, -90, 7, -62, 244, + -107, 521, 309, 22, -663, 239, -213, -226, + 100, 2228, -330, -197, -1247, -876, 1561, -1, + -354, 439, -163, -318, -61, -1184, -3022, 1434, + 65, 87, 806, -2093, 3016, 1022, -779, -391, + -18, -1371, -548, 910, -910, -438, 673, 48, + 1028, 548, 153, -337, 554, 353, 1686, 468, + -190, -113, -560, 542, 94, -140, -194, -58, + 165, -154, -311, 4744, -148, 49, -253, 180, + -65, -125, -139, -49, -115, -270, 439, 139, + 210, 202, -207, -65, -477, 168, -4720, -96, + -1091, -2071, -567, -1330, 237, 411, -123, 1197, + 2625, 1348, -230, 362, -147, -139, -699, 1210, + -299, 92, 2835, -36, -296, 287, 2426, -1171, + -218, 884, -320, 1130, -1085, 1177, -953, -776, + 609, 827, -90, 131, -2757, 567, 885, -2359, + 955, -200, -1883, 131, 282, -80, 141, -8, + -33, 333, 809, 357, -13, 499, 597, 923, + -1725, -1533, 465, -93, 2187, -841, 751, 74, + -2158, 99, -1078, -459, 648, -258, 349, -917, + 1200, 374, -1741, -1013, 724, -61, 182, 4032, + -581, 1123, -400, -459, -443, -316, 3, -271, + -248, -17, 595, 206, -1188, 2869, 1338, -253, + 316, -474, 1680, -856, -1487, 547, 679, 425, + -258, 92, -4, -24, 117, -157, 385, -257, + -332, -5597, -68, -329, -65, -108, -277, 202, + -400, 124, -51, 5, 71, 90, -927, 966, + 780, 305, 703, 802, -1661, -1415, -66, 437, + -610, 317, 795, 599, -189, 322, -519, -4010, + 729, -620, -2127, 351, 506, -68, 162, -983, + -288, 3167, -140, 991, -599, 128, 1868, 64, + -63, -1, 2047, 155, -871, -130, 226, 508, + 499, 882, 3762, -383, -23, 0, -345, -488, + 167, 648, 395, 114, 1121, 343, 232, -538, + 15, 342, -820, 38, 435, -468, -282, -415, + -5021, -293, 147, 533, -128, -70, 503, 844, + -86, 1836, -2103, -1143, -70, -510, 576, -689, + 410, -2101, 433, 339, -417, 820, 157, 173, + 454, -586, 1219, -73, -5123, 344, 397, 53, + 105, 501, -59, 515, 194, 356, 78, 706, + 303, 332, 4532, 739, 961, -521, -392, 20, + -697, 823, 607, -243, 332, 365, -330, 307, + 429, -865, -8, 545, -3, 6041, -310, 272, + 464, 22, -156, 142, -63, -87, 297, -24, + 562, -9, 147, 341, -21, 119, 1386, 947, + -1738, -500, -655, 95, 32, 32, 187, 518, + 1330, 95, -324, 3620, 737, -54, 55, 670, + -1252, 995, 484, 1347, -745, 244, 262, -83, + -122, 1194, -653, -1111, -327, -325, 3579, -214, + -37, -412, -267, -377, -62, 131, 360, 203, + -5713, -42, 94, 279, 406, -355, 34, -144, + 156, -256, -48, -98, -1392, 1273, 202, -1249, + -3457, -710, 1007, 37, -1788, 86, -570, 535, + 17, -369, 1640, 816, -117, 128, -969, -1381, + 224, 1519, -996, -833, 931, 185, 804, 465, + 82, 69, -247, 3312, -430, -23, 173, -223, + 3080, 1848, -1187, -1494, -485, -1131, 496, -517, + -596, 320, -853, -1303, 240, -298, 159, 527, + -257, 412, 839, -1020, 706, -3499, -175, -1089, + -717, -325, 261, 310, -1740, -1035, -403, -229, + -861, -970, -62, -192, 535, -2154, -364, -1133, + 979, -3299, 353, 982, -517, 1144, -563, 675, + 285, 63, 17, -1957, 82, 28, -513, 501, + -1183, 1476, -813, -254, -1584, -1181, -426, -56, + -916, 203, -2693, 209, -1066, -1174, 279, 439, + 201, 1179, 797, 407, 851, 927, 316, -640, + 1398, -128, 2741, 563, -1789, 989, 932, 247, + 6, -617, 268, -691, 1112, -569, 883, 298, + 37, -362, -661, -17, -154, -574, 721, 4578, + 205, 507, 77, -90, -433, -1613, 270, -500, + -1061, 1634, -388, -432, -648, -1985, 629, 2887, + -201, -32, 223, 621, 143, 446, 1384, 1109, + 299, 329, -1002, -356, 1504, -77, 49, 952, + 4166, -544, -85, -412, -249, 474, 27, -107, +}; + +static const int16_t cb0808s1[] = { + 2632, 1511, 944, -180, -2377, 54, -470, -187, + -710, -998, -516, -916, -440, -842, 285, 22, + -282, -459, -299, -2769, -2285, -380, -2194, 801, + -595, -252, 504, -69, -752, 972, 639, 277, + 502, 117, -1072, -145, 1462, -528, 2165, 880, + -182, -2953, 750, -1090, 596, 105, 187, 555, + -153, -113, 830, 161, 308, -44, -250, -58, + -507, -406, -626, 1453, 1357, 116, -456, 3242, + -607, 94, 390, 393, 114, 1069, -2, 2, + 2497, 1405, -755, 1353, 192, 1288, -187, 262, + 1722, 91, 885, -622, -321, 246, -1835, 17, + 213, -80, -658, -1940, 275, 845, -365, 276, + 2142, -216, -3402, -646, 549, -78, -176, -52, + 785, -1335, 44, 163, -409, 1273, 679, -377, + 788, -1355, -1721, 332, 223, 1409, -104, 165, + 354, 322, 2414, -1611, 216, -6, -232, -1770, + -1931, 2496, -530, 228, -924, -173, -329, -575, + -1709, -900, 199, 223, 690, -636, 73, -367, + 460, -823, -5105, 435, 957, 224, 246, 406, + -673, 752, 412, -158, -267, 4, 694, 10, + -45, 219, 1040, 778, -1910, 1886, -691, 674, + 1085, -537, 376, 1048, 858, -161, 613, 376, + 535, -1349, -1913, -518, -850, 665, 772, -2985, + -66, -42, 2142, -848, -1151, 237, -211, -161, + -2753, 603, 507, 39, -575, -61, -1053, -273, + 290, -258, -162, 139, 95, -12, -201, -236, + 709, -328, -314, -130, -5337, 100, -18, -97, + -206, 1827, 1722, 302, 924, -203, 761, -715, + -24, 372, -600, 2115, 1197, -1406, 676, -2068, + -167, -221, -936, 1419, 353, -317, 245, -2890, + 623, 265, -622, 204, 2549, 596, 239, -25, + -672, 583, 117, -13, -2251, -1325, 1984, 1431, + -1335, -1268, 735, 245, 105, 593, -193, -614, + 909, -339, -1033, 383, 102, 363, 732, 1439, + 1028, 1275, 442, 987, -3901, -257, -36, 224, + -116, -402, 200, -596, -125, 372, -572, 398, + -543, 1024, 1746, -736, -1056, -1736, 953, 1026, + -965, 442, -1565, -448, -96, 1498, 30, -231, + -483, 73, -3185, 1765, 1313, -100, 477, -198, + 782, 316, 364, -107, -431, -1795, -244, 122, + -423, -385, 457, -872, -535, -1098, 80, -110, + 1420, 646, 33, -3226, 648, 861, 328, -1269, + -558, 495, 881, 112, 479, 170, -309, 1904, + -1412, -768, -1220, -34, 995, -649, 162, 1, + 153, 985, 762, -263, -188, 77, 760, -2346, + 3430, -450, 1677, 1090, 1771, 2109, -14, -119, + -995, 268, 141, 33, 35, 31, 537, 65, + -345, 69, 192, 763, -18, 1078, 3829, 274, + 442, -173, -412, 434, -695, 924, 2, 1551, + 566, -85, 217, 976, 2196, -503, -1401, 759, + 922, -3024, -963, -3, 600, -452, -193, -787, + 7, 186, 828, 515, 148, -225, -1250, -985, + 443, -511, 2037, 1560, 3230, 647, 1418, -165, + -261, -369, 224, 450, -100, -271, -122, -511, + -691, -1444, 906, -144, 248, 452, 957, -70, + -517, 116, -3559, -877, -399, 418, -1300, -415, + -177, 770, -2566, -371, -1673, -1042, -500, -290, + -708, -631, 193, 2494, 319, 545, 767, 102, + 231, -43, -139, -97, -700, -1592, 282, 1325, + -1419, -647, 449, 1995, -737, 661, 1617, 725, + -1464, 615, 906, 202, -154, -228, -2194, -231, + 299, 110, 1318, 1053, -312, 843, -937, -1697, + -592, -1224, -633, -50, 792, 1600, -1187, -171, + 211, -744, -306, 186, 1914, -3119, -904, -159, + 178, -596, -654, 817, 94, -242, -2376, -218, + -421, -365, -699, 177, -427, -32, 265, -33, + 245, -34, 5309, -307, -262, -299, 86, 278, + 33, -200, -180, -56, 337, 1034, -229, 4952, + 306, -609, 189, -22, 280, -160, -507, 135, + -1265, -252, 434, -427, 158, -546, -130, -2500, + 597, 908, 918, 706, 1227, 3390, 995, 298, + -558, 1307, 765, -144, -37, -286, 122, 215, + -1251, 1090, 85, -914, 522, 316, 1829, -701, + -365, -3311, 312, 22, 680, -1351, 220, 243, + 166, -36, 780, 2395, -64, 836, 1037, 735, + 966, 173, 1114, 192, 510, -1054, 1341, -616, + 1559, 897, 338, -3, -194, -214, -573, -265, + 328, -365, 433, -505, -86, 33, -156, -129, + -137, 119, 143, 5773, -76, 68, 820, 1215, + 1315, 713, 12, 1590, 131, -193, -881, -227, + 736, 581, 736, -37, -434, -449, -348, 4189, + 2180, -1360, -1663, -74, 1215, 278, 2092, -66, + 313, 388, -1373, 25, 599, 888, -87, 293, + 30, 367, 1010, -883, 818, -910, -1918, 864, + 482, -968, -1249, 222, 1100, 23, -87, 2493, + -248, -622, 240, 151, 873, -2735, 1325, -700, + -411, 282, -2361, -1843, -631, -208, 103, -411, + 831, -446, -292, 450, 184, -158, 484, -1964, + 4663, 123, 18, 174, 621, 158, -788, 233, + 302, 441, -339, 200, -62, -197, -9, -236, + 984, 584, -521, -373, -205, 910, 392, 850, + -2968, 68, -727, 1330, 578, 36, -385, 754, + -538, -36, 271, 418, -548, 1775, -1045, -879, + -1407, 524, -1085, -1479, 371, 19, 873, 171, + 2932, -216, 42, 71, -1187, -570, -524, 344, + -770, -4086, -735, -515, 1055, -551, 945, -1408, + 913, -1005, -222, -443, 60, -194, -734, 1908, + -534, -1351, 72, -938, -66, -2756, 1313, -169, + -1550, 450, -610, 893, 1100, -583, 87, -145, + -210, 281, 1402, 674, 0, -38, 874, -363, + 2436, 2156, -1659, -481, -130, -63, -669, -316, + -761, -413, 108, 2362, 354, 76, -1725, -924, + -1443, 1251, 871, -2058, 518, 955, -283, 680, + -85, -560, -464, 127, -216, -1382, 1908, 238, + -182, 459, -1227, 1144, 2266, -96, 595, -750, + 912, -198, 1786, -1423, -618, -450, 185, -1212, + 706, -689, -154, -365, -681, -1378, 914, -1200, + -253, -532, 3244, 444, 1, -96, -404, -64, + -412, -1400, -2830, -785, 940, -217, 358, 618, + 208, -2974, -365, -32, -63, -233, -868, -413, + 358, -451, 1310, -751, -1329, -2480, 63, 458, + -273, 1270, 316, 93, -453, -463, -1258, -57, + -1073, -2037, 46, -160, 4609, -1193, 192, -355, + -963, -92, 752, 593, 102, -80, -121, 166, + -606, -274, 28, 258, 45, -45, 928, -949, + -134, -268, -77, 242, 1623, -1290, 739, 109, + 285, 175, -92, -4053, -482, 366, 217, -126, + -843, 950, -1068, 777, 1818, 550, -891, -34, + -995, 1976, 2677, -764, 45, -40, -1800, 569, + -323, -102, -1064, 4000, -109, -423, -289, 738, + -872, 808, -977, 504, -901, 41, -45, -287, + -140, -444, 477, -271, -876, 301, -2421, 1633, + -918, -660, -149, -2542, -503, -265, -107, -623, + -447, -782, -858, -535, -220, 442, 661, -209, + 878, -1601, 3610, 149, -331, 190, 102, 270, + 1451, 237, 13, -1026, 178, 1290, -281, -217, + 11, -1728, 1043, -2992, -718, -776, 357, -615, + -231, 813, -473, 1634, 539, -513, 240, 1158, + 144, 57, 1249, 1479, -481, -733, 1663, -757, + 641, 680, -468, -2697, -29, -62, 1253, 1142, + 292, 245, -96, 295, -664, -264, -308, -670, + -705, 155, -4024, 330, 191, -77, -1502, 326, + 9, 295, -567, 34, -104, -123, -320, -255, + 1124, 320, 98, 1299, -436, 1491, -341, 908, + 11, 8, 988, -1921, 5, -1391, 859, -1291, + -581, 546, -95, 272, -441, 185, -256, 313, + 466, -393, -50, 4430, -940, 87, -224, 390, + -539, -290, -1046, 531, -2329, 1275, -586, -1046, + -1682, 1159, 908, 2023, 951, -273, -68, 713, + -556, 770, 783, 223, 60, -881, -97, 760, + 556, -237, -263, -246, -240, 165, 526, 832, + -4761, 432, -339, 186, 492, 81, -136, -827, + -390, -1026, -371, -292, 937, -243, -136, 6, + 49, -223, -600, -355, 5306, 140, 34, -84, +}; + +static const int16_t cb0808m0[] = { + -3555, -106, -131, -53, -156, 196, -206, -104, + 18, -2948, 122, 146, -520, 2, 294, -419, + -1, -25, -257, 9334, 87, -55, -42, 30, + 92, 35, 195, 31, 59, 88, 47, 47, + -220, 564, -1686, 426, 106, 396, 97, 1315, + 2331, 167, -1261, 1003, 732, -300, -342, 418, + 87, 236, -245, 2235, 11, 725, -24, -169, + -480, 2845, 96, -34, 67, 857, 28, 50, + 92, 2100, -84, -600, -1990, -2208, -163, 299, + 431, -825, -283, 299, -98, 391, -65, -92, + -200, -689, 2236, -82, -81, -52, 127, 86, + -137, -319, -2561, -90, 547, -198, 10, 195, + -366, -2688, -77, -234, -112, -245, 270, 199, + 2674, -57, -673, -9, 1029, -31, 311, -50, + -160, -175, 2371, 2711, 409, -19, 22, -244, + 312, -158, 270, -125, -247, 118, -91, -602, + 86, 174, -216, 18, 3048, -1953, 171, -1985, + -297, 295, -38, -198, -229, 363, -13, 127, + 13, -202, -117, 65, 74, 63, 125, -62, + -2, -543, -680, -4269, -130, 325, -49, -245, + -50, -509, -151, -19, 3, 152, -980, -129, + -234, 399, 349, 171, -196, 4952, -2, 36, + 288, 771, 2313, 231, -39, 572, -3012, 77, + -501, -215, -228, -444, 830, 200, -188, -157, + 3248, 279, -3319, 0, 76, 10, 160, -80, + 135, 102, -349, 174, -30, -88, -145, -205, + 10, -185, 177, -34, 25, 31, 218, -4, + 191, 172, 228, -136, -178, 268, 638, 3559, + 55, 198, 145, 342, -25, -1940, 2866, -334, + -921, 1941, -464, 273, -181, -506, -21, -410, + 116, -179, -49, -273, -22, -36, -1298, 274, + -1831, 321, -382, 238, -3464, -68, -194, 32, + -95, -506, 72, 64, -329, 19, -39, 347, + -302, 204, 145, -72, 855, -112, -3596, 989, + -2801, 386, -2623, -471, 101, -155, 257, 291, + 30, -153, 185, 172, 511, 20, 166, 274, + 29, -3023, 129, 33, -219, -205, 6, 47, + -407, 137, 563, -106, -2065, 76, 201, -99, + -170, -77, 170, -4536, -440, -96, -940, -1066, + 81, 205, 358, 435, -78, -148, -201, -85, + -307, -306, 14, -47, -101, -187, -136, 380, + -4, -32, -34, -54, 528, -58, 6389, 302, + -79, 52, -28, -65, -77, -12, 9024, -100, + 262, 20, -67, -31, 50, -33, -30, -140, + 326, -1170, -304, -136, -233, 170, 60, 314, + -166, -208, -105, -245, -169, -72, 137, -7173, + -2, 375, 152, 226, -206, -341, 303, 47, + 1010, -188, 577, -292, -3581, -12, -195, 20, + 2165, -206, -88, -83, -132, -40, -443, 236, + -333, 179, -211, -56, 318, -409, 3106, 95, + 11636, 340, 204, -323, 167, 76, 61, 65, + -157, 71, -21, 38, 66, 391, -52, 20, + -17, 11, 259, 45, -194, 440, 3432, 122, + 468, -595, -1856, 94, -427, -133, 149, -273, + 61, -6622, 48, 97, -162, 93, 402, -104, + -207, 64, -278, 92, 387, 3, 96, -2, + -27, -30, 84, 64, 35, -65, 98, 85, + -16, -248, 7930, 74, 4, -104, 83, -48, + 40, -2104, -86, -89, 99, -142, 65, -2713, + 63, -431, 523, 687, 212, -1515, 3, 59, + 55, -6, 22, -8, -148, 180, 78, 7833, + -63, -83, 13, -187, -116, 156, -29, -186, + -160, 148, -82, -303, -166, 112, -103, -39, + -165, 2827, -54, -26, 24, -3055, 78, 21, + 128, -81, -25, -122, 51, -54, -19, 188, + -18, -1, -140, -18, -8085, 124, -46, 45, + -574, 12, -150, 147, 65, -209, -396, -444, + -3882, -291, -231, 296, 244, 76, 180, 36, + -2575, 659, -63, 3277, -85, 48, -518, -353, + 130, 50, 13, 338, -343, -276, -16, 353, + -6036, -77, 18, 139, 43, 335, 294, 99, + 219, 442, -25, -53, 40, 271, 175, -282, + -91, 430, -4428, -15, -2857, -62, -27, -170, + 33, -681, -110, -76, 153, 42, -134, -145, + 222, -177, -39, 314, 2270, 526, 500, 2417, + 339, 1808, -17, 464, -525, -97, 124, -32, + 370, 48, -1675, -62, -169, 2642, 2511, -43, + -1037, -184, 54, -569, -504, -247, -40, 327, + 7, 82, -197, 2774, -34, -2931, -204, -112, + 194, -362, 187, 65, -166, 115, -125, 14, + 210, 144, -75, 57, -255, -151, -3566, -153, + 182, 89, -2530, 98, -265, -173, -133, 260, + -25, -1292, 35, 131, -98, -85, -237, 82, + 1353, 47, 3842, 148, 171, 183, 234, 89, + -93, 47, 102, -4, 90, 2980, 289, -231, + 353, 497, -109, 190, -2869, 697, 136, 90, + -244, 298, -119, -519, -50, 207, -43, -1376, + 356, 1934, 701, -2323, 671, 71, -56, -167, + -3793, -3749, -103, 134, -228, -13, 27, -45, + -105, 172, -77, -23, 53, 110, -118, -80, + -164, -192, -563, 393, -58, -428, -360, 3696, + 162, -173, 1683, -430, 452, -92, 107, -41, + 28, -85, 421, -66, 354, -88, 723, 2751, + -2955, -481, -134, -231, -145, 3, 65, -88, + 189, 187, 151, 174, -36, 240, -253, -235, + -194, -5410, -47, -98, 338, -487, -81, -35, + -82, -440, 31, 109, 217, 276, -1805, 278, + 273, -369, 629, -293, -525, -3832, 73, -56, + -363, 1709, 177, -2813, 796, -162, -341, 1176, + -75, 533, 854, 719, 242, -194, 90, -147, + 203, -136, -138, -764, 6, -2787, -13, 1104, + 1497, 1097, 90, -867, -718, -317, 119, 180, + 160, 257, 2532, -557, -62, 14, 665, 1520, + 456, 826, 394, -605, 908, 222, -140, 121, + 121, 232, 124, 96, -87, 48, -51, 41, + -7821, -37, 130, -11, -33, -137, 16, 42, + 1509, -8, 119, -83, -18, 64, 41, -178, + -28, 182, 532, 678, -75, 277, -230, -70, + -71, -8, -150, 321, -6298, -20, -131, -65, + 139, -215, -155, -27, -110, -257, 32, 201, + 215, 184, 8932, -106, -50, 66, 15, -44, + 203, -38, 19, -78, 65, 135, -123, 166, + 117, 76, 4, 34, -90, 5984, 59, -72, + 356, -64, 6, -62, 43, -86, -175, -106, + 10, 25, 3812, -135, -3313, 142, 348, -101, + -35, 378, -250, -106, -299, 237, 40, -32, + 236, -521, 63, -143, 538, -256, 43, -45, + 1642, 726, -3225, 109, -997, 3, -256, -27, + -182, -78, -4092, -9, 231, 34, 9, -6, + 155, 2842, 53, -130, -390, -146, 168, -74, + -2023, -955, 576, -629, -76, 70, 140, -287, + -401, 966, 359, 1185, -226, 713, 753, -739, + -4238, 3364, 75, -213, 27, -172, -34, 171, + -118, -46, -164, -13, -54, -203, -154, -12, + 65, -3777, -3452, 297, -104, -93, -81, 69, + -179, -321, 51, 47, 242, -15, -144, -43, + 2827, 67, -305, 54, -3044, 57, -15, -427, + 311, -205, 226, -490, 37, 363, -88, -408, +}; + +static const int16_t cb0808m1[] = { + 3329, 59, 195, -91, -70, 3262, -132, 360, + 157, -410, 184, -99, -138, 337, 289, 317, + 156, -589, -127, -204, 37, -175, -5661, -52, + 942, 156, -1, -197, 353, 90, 57, -287, + -218, 438, -4, -262, 9, 322, -167, 2904, + -12, -2647, -248, -203, -267, -116, -135, 333, + -220, -200, 40, 228, 2677, -462, -183, -129, + 2898, -728, 793, 422, 541, -350, 28, 222, + 2790, -231, -195, -191, 3002, 182, -610, 145, + -226, -102, 285, 344, -357, 217, -146, -98, + 18, -255, 96, -151, 266, 208, -459, -132, + -345, 4059, -371, 79, 44, -63, -233, 334, + 44, 3884, 49, -3303, 88, -23, -287, -461, + 57, 94, -53, -129, 104, 167, -25, -79, + -125, -630, -2352, 150, -419, 40, -63, 603, + 67, 209, 321, -1765, -200, 68, 473, 622, + 5, -2883, 112, 188, -189, -2765, 169, 397, + -330, -642, -798, 129, -110, -164, -20, 176, + -213, -5415, 39, 31, 13, 270, -477, 166, + 167, 4, 216, -12, -528, -75, -291, 396, + -499, -2011, -172, -265, 96, 83, -279, 114, + -166, 833, 30, 2493, 94, 130, -183, -659, + 1, -227, 75, 349, -2757, 82, -116, 9, + 952, -112, -2444, -333, -206, -406, 201, 15, + -768, 88, 1390, -33, -558, 97, -201, 29, + 3470, 50, -40, -271, -171, -26, 47, 485, + -250, 3318, 112, 639, -2911, 123, -264, 3, + 8, 379, 73, 54, 88, 227, 73, 58, + -572, 782, -183, 305, 49, -23, -2968, -41, + 291, -25, 157, 295, -2118, 125, 5, -193, + -159, -543, -75, 1181, -191, -547, -93, 117, + -1831, 265, -607, -30, 194, -3929, -70, 159, + 79, -1519, 38, 201, 14, -24, -76, -366, + 14, -2748, 0, -372, 405, 39, -170, 320, + -257, 2153, -12, 158, 322, -4013, 22, -101, + 217, 637, 273, -430, 228, -428, 102, -356, + -266, 82, -31, 14, -223, -2595, -360, 2094, + -379, 624, -192, 245, 294, 1484, -117, 156, + -53, 3668, -3573, -118, -213, 257, -211, 66, + -62, -173, -166, -123, 163, -81, -39, -74, + -21, 126, 722, -136, 2050, -206, 86, 275, + 76, -249, 55, -2508, 95, -60, -34, -360, + -9, 187, 34, -87, -30, 137, 48, 4761, + 109, 511, -496, 104, 399, -361, 162, 78, + -29, 159, -112, 182, 246, 52, 255, 338, + -35, -1, -68, 5, 182, 7675, -119, -14, + -1901, -111, -106, 22, -16, 81, 159, -2423, + -71, -24, -153, -520, 126, 370, -186, 230, + -51, -401, 206, -32, 52, -71, -79, 503, + -239, -231, 55, -133, 5226, -45, -165, 57, + 2314, -209, 302, 78, 154, -3092, -605, -498, + 410, 159, 336, -147, -120, 143, 36, 587, + -182, -182, 1457, 1008, 2524, -446, 2333, -497, + -761, -162, 125, 420, 225, -117, -324, 437, + -50, 190, 129, 259, 33, -2, -9, 32, + -24, 91, 97, 201, 19, 169, 3535, 485, + -144, 330, -193, -2715, 603, 303, 1124, 107, + -1386, -1437, -203, 180, -81, 303, 209, -21, + -65, 26, 91, 98, -1349, 196, 2103, 917, + -732, 834, 1456, -92, -455, -130, -732, -288, + 39, -85, -557, -39, 3213, 297, 392, -378, + -520, 795, -2407, 6, 7, 406, 203, -73, + -247, 317, -3336, 3166, 206, -36, 159, -279, + 442, 54, -324, -18, 544, -250, 142, -440, + 100, -145, -3772, -199, 139, -156, -11, 34, + -178, -233, -370, 601, -58, 1679, -170, 76, + 684, -35, -73, -52, -33, -3, -89, -5, + -82, 73, -11, 51, -48, -12, -376, 4348, + -203, -432, 189, -35, 144, 31, 181, -106, + -5112, 552, 480, 0, 63, 31, 33, 504, + 1055, -3007, -214, 154, -100, 246, 269, -423, + 579, 63, 1668, -296, 390, 109, 21, -6, + 71, 3321, 246, 197, 355, -198, 472, 135, + 437, -1734, 1299, 227, -618, -48, -199, 217, + -230, 70, 99, 2632, -203, 3105, -87, 149, + 303, 124, 362, -322, -44, 38, 104, -28, + 48, -175, -468, -410, -4451, -152, 2157, 26, + -281, -581, 36, -205, 101, 230, 192, -129, + 319, 20, 65, 4879, 123, -236, -178, -128, + -387, -124, 528, 142, -775, -301, -88, -380, + 120, -42, -17, 64, -1074, -3350, 1335, -1078, + -14, -462, -113, 253, 450, 36, -8, -346, + -54, -7, 52, -100, 74, 8266, -193, -36, + -51, 12, 59, -68, 190, -36, 89, 38, + -59, 13, 269, 109, -15, -141, -64, -60, + 238, 6, -4338, 381, 1252, 354, -41, 41, + 191, -236, 122, -2712, 352, -117, -121, -284, + 1516, 473, -332, -277, -1792, -335, 84, 64, + 9595, -246, -278, 446, -95, -32, 60, -146, + 104, -84, -3, 107, -116, -377, 101, -149, + -45, 364, 104, -193, -254, 2929, -164, -93, + 324, 749, -928, 435, 2357, 350, -40, -153, + -48, -626, 390, -48, -4248, -458, -930, -218, + -486, 1769, 335, 152, 165, 111, 118, -407, + -87, -373, -333, -134, 86, -32, -144, -18, + -16, -7549, -146, 49, -184, 116, -28, -51, + 190, 115, 80, 68, 129, 206, 294, 331, + 179, -270, 174, 2444, 55, -3271, 70, -124, + 228, 330, -21, -419, 62, -140, -2388, 7, + -2683, -129, -1050, -548, 811, 189, 359, -385, + -82, 9031, 95, 77, -69, 164, 261, 61, + -73, 230, -163, 141, -38, -43, -150, 164, + 28, 164, 59, -58, -312, -134, 102, -67, + 166, -163, 63, -6795, -103, -147, 81, 273, + 133, 122, -162, -207, 127, -60, 4628, -1, + 1315, 518, -163, -246, 54, 239, 154, -154, + 265, 2000, 25, 227, 42, 179, 88, -3446, + -214, 182, 438, 90, 196, -69, 134, -56, + -451, 716, -1120, -287, 118, 230, -37, 145, + 284, -250, 139, -947, 203, -3176, -57, 151, + 3201, 818, -87, 347, -486, -201, 1176, -325, + -966, -263, -184, 238, -156, -396, 152, 959, + -59, -33, -159, -3, 9394, -119, -81, -50, + 67, 9, 27, -62, -121, -210, 48, -211, + 5, 396, 633, 34, -16, 67, -247, -77, + 128, 441, 3896, 251, 970, 119, -387, -35, + 124, -64, -664, -6550, 101, -52, 19, 44, + -132, 79, 731, -155, -262, -140, -31, -191, + -110, 276, -162, -49, 81, -117, 15, -570, + 420, -1232, -125, 3737, -95, 544, -149, 463, + -129, -345, 350, 183, 173, 197, 464, 180, + -249, -365, -785, -9, -3411, -235, -124, 225, + -4516, 196, -150, -89, -89, 54, -110, 137, + -431, 272, -12, -7, 114, -201, 166, 1570, + -74, -88, 6019, 350, -75, 68, -29, -81, + -50, 57, -62, 103, 61, 276, 22, -131, + -134, -3347, -60, -3397, -311, -105, 90, -159, + -222, 151, 224, -210, 264, 192, 29, -84, +}; + +static const int16_t cb0808sl0[] = { + 24, -3148, -3111, 106, 45, -114, -85, -211, + 154, 172, 246, 368, -130, 58, -135, 70, + 102, -150, -76, -7, 13, -1, -29, 20, + -7, 112, -234, -115, -138, -40, 106, 178, + -7276, -537, 25, 856, 460, 3107, 146, -520, + -631, -118, 393, 179, 144, -86, 47, 82, + 3031, 28, 164, -308, -411, 72, 138, 378, + 242, 253, 12, 158, -28, -60, -29, -46, + -5, -11, 84, 2753, -113, -65, 3, 5, + 13, -5110, -74, -126, -129, -82, -58, 116, + 15, 68, 243, -32, 126, -48, 11, -7, + 75, 10, 166, -153, 8, -43, -38, 81, + -41, 13, 100, 27, 46, -441, -56, 35, + 4, 51, 7528, 52, -141, -153, 39, -36, + -86, 80, -35, 50, -46, 23, 178, -3986, + -3350, 59, -278, 37, -2, 14, -157, -208, + -317, 218, 15, -296, -32, -51, 36, -27, + -2062, 28, -37, 322, 2286, 214, -196, -171, + -64, -163, 265, -50, 3, -177, -22, 68, + 124, 37, -15, -2202, 60, 133, 4, 371, + 2753, -111, 480, -446, 484, 43, 150, -331, + 1410, -791, 123, -136, -192, 267, 0, -89, + -105, 421, 68, -126, 79, 279, 202, -132, + -208, -3345, -105, 59, 118, -647, -48, -12, + 145, -403, 200, 7, -4, -3192, -223, 64, + 0, 415, 366, 136, 49, -7611, 79, -105, + 127, -69, -43, 103, -95, -93, -10, -30, + 94, 108, -109, 0, -87, -70, 300, -93, + 113, 25, -17, 2263, 41, 192, 18, 73, + 179, 129, 149, -81, -1, 0, 201, 184, + 651, 8, 18, 114, 2820, 383, -71, 376, + -2281, -1190, -143, 121, -45, -2157, -410, 81, + -14, 1537, -833, 29, 1150, -494, -8, -14, + 210, 188, 3073, -1775, -123, 80, -103, 227, + 296, 111, 1637, -197, 1349, 174, 3276, 49, + -98, 74, 660, 3, -252, -356, -9, 527, + -63, -7995, -16, 85, 249, 74, 26, 2, + 3, 26, -124, -61, -26, -144, 4, -52, + 6, -517, -95, 2566, -26, -190, -196, -509, + -2982, 4, -178, -9, -67, -25, 1, 193, + -68, -46, -82, -3734, -14, -339, -44, -151, + 55, 230, -3, 100, -47, -69, 35, 107, + 127, -175, -11, -10, -158, -140, 2934, -132, + 2571, -158, -217, 106, 137, -222, 74, -42, + 64, 559, 122, 73, -112, -2964, 2502, 13, + 301, -41, 203, -382, -151, -221, -147, -24, + 83, 37, -45, 56, 89, 71, 109, -14, + -43, -130, -108, -18, 74, -23, -34, 79, + 7662, -88, 70, 21, -110, 147, 26, 250, + 74, 165, 49, 43, 45, -22, -14, 293, + 5275, 57, -72, 93, 40, 115, -139, -332, + 95, 92, -26, 26, 169, -94, 332, 71, + -482, 137, 190, 114, 14, 151, 3125, 6, + 109, 6, 7, 1543, 282, -24, 24, 142, + 33, 123, 41, -72, -253, -33, 309, -107, + -64, -131, 56, -3528, 82, -17, 417, -47, + -588, 274, 155, 158, -245, 186, 147, -7, + -50, -218, 12, 118, -62, 652, 145, 64, + 2473, -146, 220, -2973, 97, 284, 29, 268, + 29, -208, -40, -251, -175, -16, -58, -65, + 28, 26, 55, 74, -12, 1911, 43, -82, + -150, -13, -119, 8, 119, 156, 1550, -88, + -102, 46, 226, -132, 95, 100, 87, 7, + -46, 8, -32, -16, -12, 317, -33, -27, + 291, -88, 169, 1, -101, -61, 161, 162, + -33, -1, 11, 5097, -34, 142, 31, 94, + 3619, -94, 67, 3379, -65, 28, 254, 189, + 110, 138, -41, 52, 32, -104, 154, 172, + -2365, -464, 281, 207, -66, -190, 399, -158, + 13, -155, -223, 92, -108, -25, 468, 189, + -4359, 42, -135, 138, 36, -1403, -264, -336, + -164, -49, 54, -125, -61, 62, 16, 172, + 182, 3134, -1373, 63, -227, -106, -133, -165, + -69, -57, -184, -46, 9, -57, 50, -3, + -62, -15, -123, 108, 111, 91, -161, 23, + -81, 7, 208, -5385, -244, 24, 95, 12, + -264, 62, -44, 21, -240, -299, -12, 117, + -61, -2551, 389, 2816, -179, 203, -421, 899, + -7, 174, -200, 98, 1036, -166, 11, -137, + 78, -7, -121, 245, -77, 124, 102, 51, + 3136, 74, -310, 40, 212, -239, -373, -154, + 398, 2967, 654, 488, 103, -230, -330, 831, + -63, -473, 152, -556, -2186, -371, 4, 86, + -12, -141, 5503, -87, -123, -17, -15, 154, + 192, -86, 97, 165, 352, 56, 154, 43, + -331, 1004, -52, -131, -3311, 3, 110, -153, + -70, 137, -168, -20, 115, 140, -25, -54, + -13, -300, 57, -131, 214, 261, -92, 618, + -2752, -3146, 61, -51, 210, -230, 87, -184, + 330, 22, -19, -107, -477, -39, 1, 127, + 178, -73, 425, 56, -25, -41, 135, 2423, + 59, -46, -10, 49, -116, -51, -2239, -228, + -75, 48, 3, 181, 161, -133, -355, 81, + 5, 84, -222, -83, 92, 33, -7558, -38, + -3, 159, 33, -58, -37, -107, 16, -61, + -94, 93, 97, 49, -275, 29, -198, -4, + -68, 87, 116, -7039, 46, 81, -25, 0, + -7, -46, 152, 64, -40, -143, -56, 147, + 403, 257, 2380, -538, -400, -132, -89, -29, + -2878, 457, -552, -12, -189, -370, -357, -3679, + 422, 63, 200, 116, -9, -229, -72, -100, + 3346, 88, -18, 28, -47, 159, 108, -160, + 253, 58, 2938, 55, 366, -33, -3209, 31, + -148, -10, -40, -443, 127, 120, 106, 9, + 4, -240, 200, 129, 328, -102, 187, 182, + 112, 2757, -3260, 314, -163, -3, -185, 354, + -97, -69, -199, 41, -143, 19, 108, -22, + -32, -18, -149, 35, 31, -5, -5083, 52, + 9, 5, -44, -52, 76, 7, -100, 7, + -79, 0, -33, 110, -208, 20, -159, -76, + 2, -8192, 156, 118, -306, -88, 136, -293, + -176, 163, 8, 1871, -112, 229, 311, -95, + -75, 17, 217, 152, 62, 17, -246, 3579, + 5, -87, -21, 92, 114, -185, 118, 8, + 196, -124, -220, 175, 104, 54, 104, -40, + -45, -152, 392, 216, -24, -28, 2024, -6, + 42, -91, -201, -9, -192, 35, -43, 1661, + -356, 1207, -1322, 340, -2937, -16, 163, -801, + -423, 197, -512, -70, 229, -412, 291, 511, + -36, -179, -98, -54, 93, 87, 263, -44, + 167, 77, -4, 7278, -101, -193, 91, -251, + -131, 269, 15, -168, -22, -26, 44, 24, + 154, 115, -11, -124, 28, 37, -14, -46, + -67, -8192, -51, -169, 41, -302, -81, 1991, + -11, 136, -175, 71, -104, 89, 60, 137, + 17, 106, 96, -238, -83, -52, -113, 53, + 2903, -47, 9, -227, -2784, -245, 146, -196, + -216, 41, -6, -128, -53, 1, -128, -145, + 149, 32, 25, -57, -14, 72, -135, 10, + -1946, -67, 74, -127, 141, -299, 55, 8, + 947, -2239, -271, 74, -227, -81, 31, 291, + -86, -2914, 22, -7, 293, 2, -25, 9, + -2997, 89, 3158, 192, -46, -246, -140, 46, + 287, 133, -110, 308, -114, -33, -106, 9, + -89, 105, 364, -172, 185, -61, 4464, -92, + -264, -66, -161, 102, -178, -264, -21, 114, +}; + +static const int16_t cb0808sl1[] = { + 246, -6, -180, 90, 127, 3322, 598, 182, + 81, 82, 67, -39, 87, -60, -8, -89, + 185, 99, -25, 27, 9, -59, -7421, 49, + -17, 116, -85, 6, -305, 88, -164, 99, + 61, -415, -114, -288, 1, -165, -12, 5, + -143, -142, -521, -245, -53, 38, -99, 3709, + -52, 0, -41, -135, 147, -217, 62, -2144, + 255, 132, 264, 65, -37, 204, -338, -280, + 192, -184, -158, -3685, -26, 203, 430, -29, + -16, 77, 230, -311, 597, 2553, -1126, -63, + 154, -431, -161, 315, 286, -147, 177, -3, + 93, 449, 253, -37, 101, -244, -77, 42, + -384, 22, 36, 235, -4973, 243, -120, -105, + -226, -114, -455, -404, 164, -505, 476, -124, + -2837, -82, -2920, -3, 0, 134, -94, 264, + -53, -53, 108, -3, -845, -2813, 228, -179, + -60, -2, 65, 33, -153, -16, -149, -2135, + 209, -929, -288, 227, 2656, -125, -42, 17, + 30, 3375, -367, 53, -262, -351, 108, -270, + 11, -57, -182, -51, -149, -287, -115, -24, + 99, -76, 6954, -75, -4, 38, -168, 138, + 109, -239, -45, 49, 28, -1376, 49, 66, + -83, -129, -61, -99, 135, 14, -93, 111, + 37, -16, 2, -76, 360, -77, 82, 161, + 149, -1660, 18, 98, -34, -12, -36, -65, + 126, -57, 28, 519, 2044, 297, 73, -218, + 51, 17, 21, -70, -32, -73, -39, -38, + -11, 60, 38, -129, -105, -173, 200, 7, + 124, -74, -2780, 2608, -57, -213, 54, -200, + 134, 208, -34, 236, 143, 101, 327, 558, + 75, 317, 3090, -188, 544, -186, 15, 116, + 237, 76, -105, 29, -300, -27, -211, 71, + -144, 183, -77, 38, -16, 39, 56, -7308, + -113, -116, -32, 222, 60, 76, -21, 59, + 52, 104, 383, 73, 149, 88, 127, 34, + -1819, -46, 50, 11, -159, -223, -163, -149, + 95, -163, -2168, -19, -937, -183, 66, -465, + -257, 341, -70, 111, 228, 52, 83, 63, + -52, -187, 16, -2539, -51, 3240, -81, 87, + -116, -183, -182, 96, -22, -191, -107, 217, + -10, -215, 9, -7, -97, -331, -55, 513, + -398, 1378, 2627, -2129, 563, 1462, -369, 498, + 1176, -469, 220, -953, -122, -236, -306, -276, + 31, 35, -167, 558, -134, 45, -54, 16, + 36, 18, 300, 2438, 62, -177, 77, 2638, + -108, -115, 3392, 274, -123, -66, 201, -400, + 170, 142, 151, 332, 53, -507, 81, -653, + -93, -3204, -5, 10, -43, 79, 3879, 77, + 191, 24, 23, -208, 6, -109, -97, 126, + -306, 629, 26, -516, 79, 21, 131, 43, + -253, -3463, 840, 653, -95, -48, 300, -1026, + -324, -909, -383, 195, 342, -136, -192, 422, + 262, -13, 534, 3125, 8, 1672, 176, -293, + 211, -1213, 537, 637, -10, -116, -149, 44, + 53, 105, 7, -97, 3, 17, 8, -21, + -7, -41, -38, -4959, -81, 1, 165, 196, + 98, 35, -35, 8, -28, 113, -20, 108, + -130, -65, 172, 2858, 41, -3295, 138, 10, + -95, -30, -173, 85, 42, 30, -119, 161, + 195, 125, -32, 136, 319, -33, 5142, 50, + 100, 128, -90, -53, -67, -203, 28, 19, + 37, -137, -124, -105, -25, -3405, -250, 294, + 409, -99, -1072, -383, -12, 212, -276, 3389, + -101, 171, -41, -554, -295, -437, 86, 158, + -242, 167, 135, 7, -149, 48, -4, -84, + 4911, 283, 5, -14, 105, -107, -384, 102, + 183, 47, 67, -5105, -5, 16, -155, 181, + 110, 24, -77, -32, 120, 1, 22, 167, + -90, -150, -5, 163, -44, -28, 54, -3058, + -174, 58, 152, -31, -179, -122, -57, 232, + -395, -4961, 61, -115, 31, 14, 82, -109, + -39, 59, -49, -133, 52, 17, 57, 52, + -63, 275, 146, 104, 53, 47, -55, 311, + 4871, -26, 48, -94, -11, -58, 63, 140, + -74, -94, -269, -77, 3372, -3116, 16, -47, + -74, -161, 115, 58, -247, -119, 399, 42, + -181, 154, -218, -24, -237, 58, -275, 2979, + 187, -124, 312, 301, 2767, -8, 40, -23, + -6, -38, -52, -363, -265, -78, -230, 286, + -135, -337, -81, 170, -13, -58, -117, 519, + -4784, 157, -193, 9, 62, -21, 180, 128, + 326, 213, 2440, 62, -601, -55, 2, -18, + -342, 142, 358, -632, -377, 3590, -248, -278, + -235, -28, 242, -133, 144, 26, -261, 113, + 45, -23, -1984, -77, 128, 249, -8, -266, + -38, -6, -1672, -45, -84, -377, 154, 17, + -83, -44, 156, -137, 43, 91, 253, 17, + -71, -92, 178, 12, 18, -8, -105, 101, + 7068, 71, -81, 84, -33, 79, 53, -7, + -85, -265, 117, 317, 114, 72, -482, -418, + -185, -97, 268, -1543, -79, -146, -48, -45, + -3259, -212, 1149, -165, 177, -158, -77, 100, + 86, -69, 107, 219, -512, -253, -418, -45, + 16, 5501, -184, 207, 67, 46, 109, -28, + -9, 33, 63, -16, 39, 92, 27, 23, + -10, -8192, 0, 50, -57, 68, -444, 1082, + 247, -138, 120, 472, -692, 212, -1576, 66, + 3061, 402, -160, 337, -685, -519, 227, -279, + 92, -4135, -393, -44, 6, -129, 59, 239, + 151, 153, -39, 116, 134, -40, 171, 118, + 207, 2615, 38, -167, -1671, 85, -135, -182, + -88, 246, 53, 29, -2, 16, 232, 544, + -46, -138, 122, -52, 1312, 9, 92, 13, + 4, 66, -35, -134, -56, 85, -43, -31, + 28, -3187, 100, -103, 70, -3, 186, -43, + 122, -3040, -27, -46, -121, 1, 37, 0, + -60, 2, -100, -152, -218, 175, -406, 175, + -193, 68, -208, -23, -230, 221, 3397, 45, + 48, 37, 337, 11, 15, -69, -4, -82, + 53, 33, -56, 75, -98, -69, -11, -19, + -12, 81, -52, 5428, 121, 82, 465, 10, + -229, 126, 32, 119, 439, 126, 1996, -85, + -81, -57, 88, 232, 108, -22, -24, 27, + -136, 91, -32, 18, 226, -33, 15, 117, + 145, -7737, 9, 58, -102, -113, 26, -2174, + 28, -421, -11, -70, -23, -70, -119, -96, + -133, 208, 20, -3750, -14, 23, 41, -180, + 2097, -103, -599, 146, 251, -77, -557, -76, + -96, 69, 266, 316, 74, -17, -227, 223, + 33, -261, 135, 8126, 250, -5, -57, 35, + 382, -44, 136, 81, 42, -80, 179, -73, + -75, -57, 274, -15, -3140, 3236, 196, 150, + -51, 222, -190, 13, 83, -313, -149, 89, + -281, -12, -42, 293, 567, 19, -43, 146, + 102, -39, 3666, 95, 76, -1, 12, 27, + 7, -5, 261, 132, -215, -295, -51, 496, + 77, 100, 16, -285, 649, -95, 280, 77, + 121, -2676, 25, -1148, 2912, -341, -91, 2380, + -80, -6, 269, -34, -686, -208, 19, 228, + 24, -5, -150, 11, 214, -316, 1187, 599, + -62, -2274, -240, 48, -86, 87, 86, 477, + 3832, 67, 135, 68, 747, 339, 385, -255, + -224, 184, 70, 171, -134, 2604, -231, 72, + 170, 51, -2785, -580, -86, -393, -63, -79, + -151, 334, 78, 329, -278, 102, -26, -55, + -3531, -378, -247, 176, -202, 147, 169, 87, +}; + +static const int16_t cb0808ss0[] = { + -1872, -332, -1311, -512, -934, -11, 112, 389, + -189, -1513, 1508, -1081, 185, -87, 3092, 529, + -166, -171, -1648, 2544, 2144, -259, -688, -1113, + -71, 387, 1194, -733, 175, 856, -976, 268, + 589, -1773, -426, -109, 1210, -486, 297, 195, + -991, -1543, -432, 1190, -1089, -531, -421, 80, + -225, 354, -231, -670, -299, -3694, -510, -882, + 31, 2804, 476, -478, 1897, 686, -1066, -1222, + -882, -374, -427, -1464, 957, 549, -1211, -204, + -218, -1412, -545, -968, 943, -342, 80, -281, + -249, -968, 3424, -2342, -212, 949, -167, -271, + 607, -838, -418, -891, -398, -877, 138, 1653, + -1034, -2515, -1363, -1535, -364, 432, -324, -1120, + 1531, 407, -698, 396, 325, 1432, 646, 2777, + 174, -836, -605, 2257, 1086, -888, 348, 36, + 513, 2229, 1543, 1293, 94, 2444, -574, -1030, + 933, -9, -668, 555, 346, 511, 715, -4033, + 409, -299, -166, 700, -560, 950, -1265, -245, + 1418, -1362, -20, 870, 152, 942, -331, -66, + 227, -186, 251, -3632, -1057, -989, -1798, 923, + 542, -630, 2889, -128, 1475, -97, -964, -860, + 534, -217, -746, 181, 321, -1007, 2595, -411, + 1298, 635, 310, 1955, -17, 846, -824, -11, + -952, 208, 328, -547, -1086, 1481, -264, -1574, + 3579, 500, 242, 1038, -1030, 353, -75, -2100, + -347, 2662, -2378, 261, 210, -1151, 525, 291, + 368, -200, -702, 105, -140, -81, 663, -716, + 334, 1220, 239, 21, 114, 301, -1898, 3647, + -302, 550, -489, -484, -853, -274, 1509, -419, + -330, -1121, -2666, 2507, -621, -818, 1188, -69, + -885, 231, 316, 1837, -740, -187, -102, 1148, + 1219, -123, 852, 1154, 27, 139, -344, -404, + -1133, 425, 353, 145, -123, 179, 49, -5836, + -571, 39, 274, -38, -457, 172, -80, 593, + -1977, -331, -421, 1965, 1768, -113, 64, 2272, + 475, 2165, 210, 873, -819, 757, -119, -530, + -1431, -2167, -1517, -864, 1060, -752, -1366, 2349, + -671, 1180, -179, 10, -450, 781, -799, -1303, + -393, -61, -113, 2053, -550, -843, 1028, -2044, + -2631, -1388, 1078, 171, 517, 496, -928, -1695, + 298, 708, -557, 122, -917, -197, -423, 1142, + 116, -528, -585, -470, 480, 400, 4605, 384, + -142, 57, -2340, -1507, -67, 907, 8192, 356, + -18, -704, 528, -32, -379, -611, 418, 703, + -396, 531, 155, 642, 678, -427, 85, 814, + 212, 845, -579, -590, -456, 103, -624, -4541, + -306, 638, -760, 36, -149, 1929, 1229, -717, + -543, 530, -694, 169, -2996, 423, -346, -897, + 1077, 255, -1054, -63, -1773, -479, 479, -701, + 1547, -1683, -342, -926, 112, -663, 1638, -9, + 2587, 311, -561, -932, -539, -335, 589, 779, + 2345, -432, 788, -967, 319, -4, 192, -588, + -103, 357, -3508, -257, 707, -473, 1521, -9, + 130, 3290, 274, -296, -802, -139, -814, -19, + 971, 849, 253, 486, 40, -1216, 1179, -1772, + -996, 1400, 838, 1955, -1432, -1925, 2324, 767, + 896, 1314, 3407, -1003, -552, -967, -166, -26, + 1099, -1965, 9, 239, -10, -243, 864, 1251, + 91, -2279, -691, -542, -473, -1908, -1208, -1447, + -891, -311, -1136, 1638, 1150, 586, 1656, 260, + 538, -1746, 1460, -478, -860, 297, -605, -139, + 822, -3718, -194, 307, 609, 30, 3418, 226, + -338, 161, -387, -344, -472, 354, -170, -421, + 433, 601, -1446, 821, -48, -31, 493, 916, + -347, -3740, -899, 1389, -355, 71, 382, -644, + 485, 218, 975, -542, -3191, 742, -102, -783, + -1607, 473, 196, 1692, -71, 258, 2446, 1507, + -968, -1025, -1087, 637, -921, -1405, 1192, -88, + 2044, -1813, 922, 156, -1096, 1007, -695, -485, + -1015, -468, -316, 1825, 190, 2132, -205, -218, + -3556, -286, -1350, -212, -634, 120, 417, -311, + -90, 219, 870, -334, -1304, 523, 999, -144, + 98, 2157, 205, 45, -247, 1401, 2423, 278, + -766, -66, 309, -121, 316, -543, -3418, 932, + -803, 637, 436, -2341, 2016, 928, -836, -1212, + 702, -1179, -544, 6, -1429, 1014, 464, 1166, + 581, -291, 136, 0, 983, -799, 693, -230, + -727, -186, -310, -76, 698, -6, -660, 762, + 814, 451, -328, 4469, -454, 14, -423, -116, + -134, -568, 1535, -562, -629, -269, 826, 380, + 68, 282, -409, 640, -384, 218, -5702, -280, + -638, -2586, -557, -877, 49, 648, 434, 1178, + 3442, 883, -78, 2024, -253, -210, -1090, 198, + -67, -52, 3226, -671, -1606, 49, 1775, -422, + -173, 309, -720, -667, -505, 2073, -678, -1152, + -231, -519, -719, 422, -2614, -394, 543, -993, + 1449, 437, -463, -1286, 1191, -1274, -710, -463, + 659, 1493, 45, -832, -414, 306, 94, 1284, + -669, -1312, 1082, -917, 2489, -494, 547, 738, + -1696, -174, 282, -1442, -1455, 1633, 912, -428, + 964, 12, -2404, -485, 631, -311, 1810, 2912, + -16, 576, 50, -927, -175, 37, 673, -201, + 995, 684, -244, -251, -1444, 3195, 1863, -88, + -1183, -966, 1769, 36, -825, 766, 489, -86, + -365, -106, -1477, -330, 125, -253, -250, -523, + -731, -5130, 653, 395, 99, -845, -721, 127, + -287, 850, 479, 25, -30, 36, -782, 611, + 448, 99, 933, -20, -853, -949, -286, -379, + -654, -385, 1298, 547, 235, 1242, -583, -4147, + 81, -547, -1142, 1280, -223, -1712, -1501, 458, + -142, 2065, 208, 855, -1115, -187, 861, 1090, + -760, -2551, 2326, -378, -1205, 488, -241, 893, + 113, 176, 4060, -225, -41, -717, -26, -442, + -445, -312, 813, 494, 314, -210, -98, -788, + 255, 632, -506, 166, -704, -334, -214, -860, + -5281, 60, -34, -238, -147, 643, 520, 2038, + 28, 2433, -1694, -1316, -615, 572, -150, -107, + 349, -1763, -307, 78, -1124, -631, 1162, -326, + -277, -591, 558, 1016, -4668, -324, -815, -251, + -1284, 52, 294, -1283, 598, 630, -345, 641, + -34, 1085, 4247, 637, 1695, -858, 212, -243, + -64, 327, 557, 426, -321, 363, -652, 372, + 777, -567, -749, -1704, 414, 5299, 389, 242, + 39, 31, -315, 179, -102, 11, 62, 248, + 557, 706, 359, -85, 303, -403, 1531, 409, + -2092, 144, -1354, 54, -48, 51, -1787, 1278, + 942, 1264, -1495, 1671, 92, -899, -1149, 1908, + -903, -596, 342, 1749, -825, -13, 509, -1163, + 1065, 2405, -253, -741, 1099, -528, 2971, -412, + -235, -869, -136, -352, -489, -384, 745, -398, + -4197, 84, 1152, -497, 955, -161, 461, -16, + -871, 801, -93, -15, -352, 1826, -490, -536, + -2853, -633, 128, -1537, -1670, 538, 788, 1276, + 554, -340, 565, 1216, -1758, 384, -1313, -628, + 24, 835, -862, -927, 1792, -1042, 209, -784, + 807, -383, -1399, 3531, 52, -537, 205, -271, + 3071, 1678, -694, -2313, -1279, -1656, -428, -1063, + -1576, -323, -342, -257, -227, -716, -458, 1161, + -180, -71, -40, -1276, 1778, -3123, -378, -1363, + -827, 880, 275, -274, -581, -186, -8, 661, + -1114, -199, -171, 379, 429, -1551, 1645, -857, + -163, -2623, 1217, 1458, -596, -68, 383, 973, + -485, -354, -597, -2875, -516, 234, -83, 340, + -396, 1365, -574, -816, -2086, -1059, -1589, -593, + -779, 334, -546, 49, -1065, -1959, 1736, 1134, + 187, 1833, 17, -82, 68, 803, -456, -89, + 1760, 836, 1570, 122, -985, 2549, 1616, 82, + 1102, 227, 222, -1236, -155, -1012, 633, 467, + 163, 445, 166, 766, -253, -347, 1041, 5121, + -21, 792, 81, -478, 128, -158, 316, -1180, + -372, 1692, -828, -31, 1122, -2583, 1346, 2483, + 195, 72, 549, 424, 947, -470, 1940, -75, + 505, 1377, 550, 58, 1785, 343, -817, 874, + 3483, -307, -576, 240, 35, 837, -717, -247, +}; + +static const int16_t cb0808ss1[] = { + 2328, 183, 1652, -907, -3005, 1329, -61, -465, + 0, -453, -1621, 223, 232, -59, 254, -312, + -117, -59, -477, -2648, -1176, -227, -1937, 962, + 141, -1489, 849, 93, -1284, 1000, 295, 192, + -139, -468, -736, -436, 2155, 371, 2475, -348, + 856, -1985, 38, 94, 496, 758, 954, -243, + 134, -1759, 491, -1406, 1114, -2554, -447, -692, + -2128, 44, -923, 1610, 787, 150, -500, 3442, + -698, 276, -517, -1555, 379, -72, 810, -1373, + 2897, 936, -586, -438, 925, 1881, -419, 211, + 1724, 721, 885, 614, 253, 613, -1440, 509, + 842, -2407, -216, -1765, 451, 1419, 599, 689, + 1473, -175, -2974, -1015, 1983, -68, 640, 21, + 140, -1295, -556, -89, -836, 718, -343, -1903, + 443, 502, -1064, 1328, 86, 2049, 1235, 130, + 892, 1105, 692, -2968, -755, 473, 423, -1371, + -2032, 1885, -29, -516, -1118, 285, 482, 164, + -1932, -685, -819, 695, 715, -1520, 1300, -1188, + -121, -197, -4233, -141, 1279, 299, 208, 1071, + 20, 772, 692, 531, 257, 428, 78, 202, + -399, -27, 793, 1150, -736, 388, -1922, 155, + -410, 85, 1135, 835, 133, -88, 65, 62, + -534, -136, -4590, -162, -968, 1378, -445, -2825, + -93, -519, 402, 12, -1110, -637, -765, 210, + -2305, 654, 447, 26, -265, -91, 71, -886, + 126, -109, 7, 346, 19, -713, -257, 774, + 1080, -579, 185, 200, -5691, 541, 228, 424, + 37, 512, -78, -201, 848, -369, 1099, -1001, + 214, -336, 266, 2502, 1583, -2131, -654, -2476, + -97, -787, -738, 1056, 1385, 124, 944, -3421, + 1172, -547, -226, 1249, 1552, 1194, -308, 489, + -1152, 751, -92, -168, -3112, -1451, 2038, 35, + 371, -1585, 535, 308, 5, -53, 523, -169, + 591, -175, -1028, 91, 743, -144, 230, 1831, + -177, 509, 1291, 1808, -3322, -815, -227, -475, + -1064, -647, 79, 1223, 174, -10, -412, 393, + -305, 1224, 1310, 12, -521, -1267, 1911, 2245, + 407, 724, -1232, -2017, 566, 506, -467, 813, + 660, -196, -3643, 2495, 870, -561, 289, 662, + 654, -508, -734, -325, 622, 220, -309, -307, + -181, -445, 131, -1655, -835, -631, 883, 211, + 737, 552, -881, -3103, -766, 595, 112, 151, + -1177, 601, 479, -14, 37, -926, -505, 1062, + -1755, -799, -178, -555, 2509, -694, -792, 662, + 737, 847, 1611, 397, -67, -134, 474, -2251, + 2698, -245, 2054, 1603, 1291, 1188, 40, 763, + -216, 1554, -297, -1769, 410, 1270, 1089, 440, + -967, 294, -37, 270, 471, 1287, 3773, -108, + -610, -275, -298, 270, -384, 2072, -675, 1002, + 174, 18, 171, 704, 3311, -105, -1774, 108, + 511, -3001, -69, 543, -227, -1196, 1431, -63, + 6, 1279, -1, 671, 239, -2127, -1924, -934, + 168, -300, 1075, 1071, 3088, -590, 1439, 329, + 1073, 127, 762, -131, 274, 837, -134, -610, + -399, -1415, 1047, -156, 415, 765, 698, 428, + -748, 241, -4226, 152, -829, 1040, -937, 145, + -852, -85, -2957, -130, -406, 726, 168, -37, + -1321, -1069, -1255, 1159, 1575, 552, 649, -1953, + -17, 1027, 1078, -385, -2761, -553, -201, 58, + -1900, -24, 283, 1248, -90, 419, 1122, 902, + -1548, -32, 34, -360, 707, 45, -3458, -246, + 287, 308, 397, 393, 822, 1323, -565, 505, + -1553, -1902, -677, 625, 1079, -135, -2132, -187, + -163, -1001, -1479, -932, 1131, -2588, -316, 53, + 1270, -747, -966, 980, 242, -266, -1575, -1146, + -605, -523, -221, 585, -787, 1365, -286, -183, + 411, 546, 4779, -286, -578, -101, 309, 896, + 34, 451, -1022, -699, 170, 935, 458, 4143, + 229, -572, -912, -397, -40, -132, -198, 98, + -1858, 612, 101, -98, -18, -349, 322, -1626, + 1304, 273, -235, 418, -509, 3961, -493, 1040, + -416, 1808, 161, 1443, 1052, -460, 55, -67, + 41, 514, 1305, -836, -1636, 1353, 379, 147, + 398, -3814, -679, 235, 327, -2293, -716, 1234, + -728, -323, 698, 1992, 4, -275, 944, 895, + 212, 334, 285, -710, -891, -1325, 3107, 3, + 367, -1779, 300, -868, -59, -644, -326, 111, + 267, -43, 421, 976, 57, 1461, -172, 245, + -188, 296, -215, 5269, -46, 177, 199, -539, + 92, -542, 251, 951, -231, 117, -580, -898, + 402, 847, 4, 384, -215, 161, -1991, 4422, + 2461, -1219, -751, 1843, 1483, 1072, 2621, -16, + -1157, 243, -557, 651, 953, 476, -417, -533, + 505, -590, 713, 153, 1268, -312, -217, -124, + 870, -484, -751, -161, 897, 755, -823, 4117, + -1311, -729, 447, -642, 929, -2408, -338, -967, + -104, -1048, -2216, -1722, -124, -204, -196, -1156, + 1460, 391, -543, 120, 70, 204, 1185, -2490, + 2950, -507, -615, 1243, -150, -363, -475, -531, + 783, 671, -205, -591, 217, -523, 263, -14, + 71, 958, -1185, -1029, -330, 327, -705, 1229, + -2925, 131, -495, 1756, 2101, 441, -11, 133, + 1274, 1253, -154, 772, 522, 1725, -277, -1012, + -726, 1339, -1200, -241, 1676, 974, 2256, 347, + 2743, 1482, -738, -241, -868, -1294, -664, 855, + -1329, -4174, -1647, -104, 101, 307, -647, -823, + 347, 4, -120, -1112, 334, 27, 265, 990, + 319, -1414, 313, -603, 52, -3138, 1552, -612, + -854, 626, 212, 773, 2334, 662, 614, 560, + 589, -533, 1337, 229, 557, -26, 1458, -626, + 1890, 2392, -1525, 1023, 667, -431, 72, 1691, + 1015, -97, -515, 1380, 796, 1192, -39, 162, + -2821, 2960, 1558, -1058, 1327, 793, 1231, -743, + -1190, -245, 29, 486, -494, -1371, 1633, -66, + -1806, 231, -664, -147, 2402, -584, 473, -527, + 1272, 464, 1991, -1007, -235, 357, 201, -1176, + -341, 223, -47, -2089, 815, 49, 192, -719, + -1041, -248, 3046, -40, -501, -346, -1347, -401, + 57, -1588, -1039, 443, 590, -1089, -182, -1365, + -1013, -3917, -382, -98, 1025, -51, 698, -197, + 848, -75, 1596, -408, -1796, -3191, 1155, 234, + -100, 698, 571, -1233, -315, -1502, -647, -571, + -322, 842, -1048, -1115, 8192, -784, -472, 17, + -718, 37, 1190, -393, 146, -547, 90, -433, + -321, -1143, -501, 468, 235, -486, -64, -2214, + -330, -837, 1214, -127, 709, -3, 623, -384, + 221, 297, -783, -3802, -408, -11, -707, 92, + -275, -268, -117, 1580, 1466, 710, -1300, 142, + -746, 1647, 2399, -1231, 114, 1220, -1112, 882, + 467, -973, -976, 3855, -647, -150, -1244, 973, + -364, -154, 473, -675, -817, -346, -266, -769, + -613, -476, 1181, -8, -1054, 405, -768, 1385, + -1598, -892, 672, -2185, 83, -27, 582, -434, + -944, 99, -888, -1658, -1516, 2392, 726, -222, + 284, 324, 4848, -67, -782, -45, 424, -203, + -194, -1229, -114, -189, -216, 275, -935, -93, + 117, -1725, 360, -2561, -1555, -1199, -769, -285, + 74, 1267, -387, 1368, 179, -113, 952, 1025, + 725, -542, -186, 1258, -1396, -747, 572, 603, + 1965, -668, -12, -2512, 1337, -255, 254, 2285, + 1136, 1397, 557, -671, -1149, -614, -462, -913, + -452, 1206, -2922, 485, -882, 270, -1309, -605, + -21, -580, -1284, -194, 169, -2314, -216, -229, + 1124, 103, -1205, 1500, 1118, 1456, -1149, 780, + -467, -385, 585, -1062, 289, -3356, 198, -309, + -310, 91, 44, -377, -632, -737, -516, 30, + -779, 73, -482, 4661, -275, 38, -632, 479, + -345, -406, 76, -208, -230, 80, -220, -313, + 203, -3, 1740, -131, 773, -30, 372, 767, + 1673, -770, 3326, 1586, 234, 408, -257, 474, + -584, -990, 1378, 696, 47, -612, -313, 189, + -3964, 795, -289, 202, -437, -1648, 373, -780, + -24, -952, 123, 438, 797, 539, -481, 191, + 291, 37, -790, -321, 4520, -49, -281, 211, +}; + +static const int16_t cb0808sm0[] = { + -4664, -115, 59, -280, -199, -25, 213, -937, + 344, -2137, -841, -370, 256, 512, 1098, -130, + 58, -121, -414, 8192, 489, -296, -33, 98, + 49, -217, 721, -42, -418, -227, -8, 205, + -276, 407, -1218, -146, -292, -143, 113, 978, + 2693, -9, -1032, 1781, 1777, -215, -978, -824, + 68, -162, 55, 2991, -844, 682, 497, 406, + -922, 2471, 599, 774, -129, 1292, -1004, 777, + 42, 314, -102, -963, -2794, -2620, 510, 355, + 372, -248, -391, -163, -298, 561, 117, 1183, + 38, 182, 1811, -4, 328, -13, -456, 305, + 368, -1691, -2818, -1074, 1029, 261, -1446, 343, + 12, -2757, 1021, -375, -3, -155, 116, 195, + 3420, 64, 139, 780, 187, -464, 261, -313, + -128, 185, 3703, 3160, 960, 706, 41, 405, + 10, 1191, 353, -549, 131, 164, 105, 1, + 23, 386, 73, -509, 2651, -1441, -834, -1657, + -645, 1005, -777, 695, 212, 1420, 65, 701, + 25, 335, 136, 359, -112, -150, 191, 392, + -258, -1140, 651, -4551, 411, 251, -169, 804, + -83, -208, -363, 81, 152, 75, -1194, -203, + -9, 157, 413, -62, -210, 5393, -22, -407, + 132, -288, 2360, 131, -1535, 553, -2524, -140, + 250, 1259, -30, -1, 1766, 99, -529, 91, + 3948, -262, -3752, -382, -339, -701, -140, -787, + 67, -11, 331, -828, -443, 596, 47, 1634, + 31, -318, 39, 147, -670, -776, 707, -921, + 172, 971, 1163, 48, -81, -1357, -181, 2872, + -152, 898, 1075, 529, 91, -2279, 2925, -848, + 589, 1910, 549, 1088, 743, -631, 42, -1528, + 23, 380, -5, 389, -1147, -209, -2041, 224, + -1998, 520, -776, 193, -2648, -78, -34, -131, + 22, -200, -28, 18, 328, 215, 67, 61, + 50, -72, 301, -207, 413, 720, -6194, 967, + -3275, 149, -2444, -521, -772, -278, 137, -159, + 932, -111, 1219, 525, 17, -684, -1229, -1776, + 66, -2307, -195, -527, 272, -470, -356, -7, + -338, 146, 1021, -893, -2980, 591, 129, -257, + 209, -58, 538, -3973, 576, -905, -642, -2092, + 153, 737, -596, 573, 236, -887, -1692, -370, + -189, -216, -58, 714, 10, -582, 517, -86, + 450, -147, -310, 162, 1747, -656, 3577, 700, + 190, -685, -170, 241, 91, -126, 5567, 441, + -50, -688, -73, 938, 320, -130, -839, 1154, + 149, -446, -10, -11, 12, -659, -138, 637, + -470, 933, -431, 235, -86, -2, -407, -5851, + -250, 1414, 525, 110, 421, 255, -149, 86, + 378, -321, 1380, 118, -2849, -1138, 180, 1175, + 1932, 32, -488, -121, -412, -441, 397, 249, + -172, -95, 420, 375, -132, -215, -167, -206, + 8192, -116, -61, -311, 269, 615, -353, -115, + -383, 366, -651, -196, -98, 85, 861, 543, + -231, 237, 493, 380, -766, -168, 3227, 659, + 701, 181, -3004, -7, 154, 298, 298, -257, + -32, -5713, 48, 102, -776, -148, -110, 316, + -645, 212, 213, 575, -69, 31, 553, -673, + -5, -48, -148, -133, 11, 143, 10, 159, + 319, 43, 7462, 162, 228, -90, 75, 151, + 103, -2542, -13, -338, 11, -442, 123, -3039, + -452, 7, 106, 502, 227, -2034, 90, 500, + -28, -646, -262, -62, -78, 40, 419, 6761, + -11, 40, 209, 61, -151, -68, -245, -401, + 26, -123, 189, -57, 611, 6, -1285, -99, + -890, 3609, -302, -808, 639, -3245, -226, 107, + 54, -108, -316, -61, -56, 228, -16, 195, + 275, 214, -60, 77, -7157, 130, 8, 244, + -2160, -760, 450, -186, -378, 32, -797, 214, + -3569, -450, 307, -17, -141, 16, 1024, 404, + -2063, -288, -160, 4056, 877, -346, -970, -87, + 336, 961, 666, 585, -465, -1329, 350, -338, + -5421, -173, -295, 72, -201, 533, 462, -133, + -937, 1891, 264, 71, -935, 640, 687, 852, + -386, -85, -5644, 306, 240, 640, 67, 94, + -902, -351, -417, -3, 284, 38, -156, 359, + 53, 139, 185, 274, 2613, 213, 1282, 2867, + 30, 1234, -911, 343, -93, -1671, 57, -814, + -19, 326, -256, -113, 72, 3177, 3393, -125, + 460, -261, -503, -1019, -681, -253, -957, -157, + -117, -231, -212, 1446, 225, -3009, 313, -435, + 387, -928, 696, -857, -452, 66, -2063, 782, + 14, -94, 51, 242, -422, 236, -3825, -666, + 348, 196, -2770, 429, -416, -266, -1215, -586, + 84, 328, -302, 219, -457, -532, -764, 85, + 2008, -806, 2906, -1405, 367, 835, 715, -986, + -217, 88, -328, 569, -586, 3096, 249, -615, + 453, 176, -540, 792, -2472, 2189, 876, -353, + 111, 212, -7, 597, -154, 818, -401, -1408, + 748, 2502, 1426, -2897, 1069, 326, -605, 120, + -4149, -3087, 729, 82, 224, 320, 353, -77, + -163, -322, 220, -1073, 10, 545, -518, -453, + 50, -386, -2002, 614, -705, -806, -928, 2941, + -520, -35, 1208, 413, 900, 138, -414, -289, + -15, -75, 185, -373, 649, -251, 666, 2708, + -2817, -749, -159, -112, 454, -385, 1037, -46, + -25, -14, 66, 552, 160, -40, -552, -156, + 151, -5287, 541, -242, -82, -1164, 849, -773, + -136, -162, -76, 23, -371, -222, -2245, 468, + 425, -356, 418, -3, -322, -3573, 148, 260, + -155, 3301, -165, -3186, -709, -458, 870, 386, + 59, -161, 533, -150, 598, 384, 900, -1233, + -74, -464, -519, -661, -55, -2562, 290, 1489, + 1739, 2277, 874, -1483, -447, 93, 309, 311, + -203, -19, 2271, -1280, -125, -443, -538, 2650, + -42, 290, 245, -149, 24, 38, -133, 1638, + 210, -239, -180, 516, -12, -719, -19, -517, + -6190, -181, -89, 318, 485, 631, 11, -205, + -57, 257, 573, -72, 273, -579, 107, -5, + 112, 425, 2449, 2741, 758, 656, -663, -282, + -48, -45, -294, -448, -5562, 61, -1, -464, + -263, -688, -115, -15, -108, -569, -448, -48, + -180, -105, 14, -180, 490, 274, 625, -588, + -120, -196, -305, -126, 435, -2490, -2693, -3414, + 31, 97, -167, -114, 247, 7695, -189, -580, + 219, 241, 188, 327, 179, -193, 135, -176, + 127, 479, 529, 234, 112, 234, -358, -286, + 1109, 2940, -610, -13, -2650, 495, 1355, -574, + -43, -1497, -292, -503, 564, -363, 24, -313, + 1387, 221, -3612, 783, 637, 43, 1351, 217, + -21, 149, -3104, 190, -259, -201, -342, -201, + 166, 2411, -1082, 283, -382, -725, 157, 155, + -1609, -592, 527, -2959, 9, 216, 526, 79, + 54, -132, 202, 785, 929, 1755, -663, 366, + -3735, 3282, 305, 572, -36, -111, -231, 119, + 603, 1357, -153, 553, 363, -760, -1188, 890, + 147, -3844, -3788, 150, 257, -588, -234, 497, + 361, -543, 255, -175, -377, 49, -616, -200, + 4115, -541, 130, 678, -3458, -506, -218, -1317, + 889, 29, -104, -2, 532, -393, 513, -792, +}; + +static const int16_t cb0808sm1[] = { + 4123, -74, 639, 326, -110, 1896, 826, -855, + -299, -452, 536, -323, 262, 79, 486, 144, + 270, -64, 277, 154, 399, 50, -7270, -61, + 14, -8, 19, -104, 333, 119, 374, 389, + -196, 77, -322, 261, 75, 386, 162, 2360, + 644, -2785, 355, 277, -121, -148, 156, 2136, + 112, -453, 429, 171, 2405, -1245, -775, -181, + 2110, -583, 127, 889, -290, -550, -165, 1027, + 2155, -351, -936, 432, 2689, 217, -20, 646, + -785, 908, 654, 970, -294, -41, 466, -245, + 138, 50, -108, -366, 177, 481, -2118, 968, + -594, 3892, 528, 188, -613, 18, 283, 733, + -35, 1598, 387, 1, 156, -206, -437, 203, + -244, -347, 325, 296, 100, 1171, 49, 920, + -418, -54, -2756, 24, 123, 1018, 303, -501, + 901, -447, 322, -2361, 1039, -1067, 877, 1329, + -143, -2773, 269, 1560, 398, -3193, 102, 990, + 279, 379, -204, -144, -174, 139, 411, -234, + 21, -5064, -188, 365, 278, 353, -189, 94, + 593, -402, -353, -257, -788, 383, -1036, 569, + -72, -1764, 571, 1003, 629, 670, -1400, 0, + -435, 64, 189, 2874, 239, 1128, 992, 1213, + 69, -128, 207, 713, -2436, -931, -387, -111, + 1064, -170, -2853, -1072, -367, -1048, -238, -60, + -49, 340, 2382, 370, -245, 351, 248, -64, + 2331, 458, -484, -34, 281, 689, 483, 636, + 199, 3153, 607, -124, -3296, 953, -407, 49, + 455, 1083, 690, -169, -725, 311, -493, -1761, + -3054, 376, -544, 479, 91, 159, -2837, -1257, + -830, -948, -254, 289, -1039, 856, 86, 1123, + 203, -768, 1089, 73, -866, 308, 437, 674, + -2067, -240, -1079, 33, -1069, -3502, 756, -676, + 45, -2544, 378, -365, -275, -293, -394, -649, + -507, -2850, 672, 370, 186, -417, 682, 185, + -15, 2863, 21, -165, 356, -3776, -103, 535, + -416, -345, -31, 24, -90, -205, 96, -966, + 94, 424, -5, -188, 149, -2193, -183, 2342, + 425, -647, -1697, -627, -444, 1248, -967, -702, + -48, 3616, -3484, 774, -299, 94, 421, 472, + 71, -144, -523, 114, -172, 349, -285, -106, + 101, 59, 429, 512, 3362, -38, -62, 50, + -225, -1408, 780, -2747, -404, 489, -975, 840, + 357, 982, 488, -275, -109, 393, 375, 4794, + 183, -110, 922, -760, 61, -1067, -8, 322, + 74, -101, 554, -350, -486, 66, 384, 748, + 14, 223, -45, -386, 69, 6231, 247, 325, + -320, -47, -50, -165, 153, -380, 589, -3243, + -173, -140, 341, -747, -1559, 639, -1658, 356, + 110, -150, -273, 76, -632, -425, -227, 640, + 211, 192, -747, -165, 4608, 290, -160, 1268, + 2754, -3, 578, 189, -485, -2747, -123, -1309, + 662, 601, 43, -136, 84, 1625, -1113, 1400, + 75, -126, 3581, -243, 2339, -514, 2203, -400, + -483, 521, 30, -246, -76, 359, 101, 663, + -40, 57, 52, 360, -447, -290, 254, 104, + 102, 113, 215, -163, -388, 299, 4570, 31, + 108, -41, 41, -2633, 2891, 1188, -505, 1061, + -349, -604, -449, -374, -320, 969, -304, -192, + 246, -152, 441, -46, -1416, 137, 1987, 495, + -63, 1087, 875, 699, 201, 211, -3157, -273, + -60, 195, -2813, -239, 2486, -55, 294, 315, + -133, 448, -1849, 363, 1063, 76, -928, -574, + -72, -57, 168, 5673, -156, -116, 400, -124, + 82, 218, -487, 37, 112, 53, -544, 178, + 99, 480, -7179, -196, 271, -160, 308, -62, + 393, 394, -220, -740, -14, 92, 408, -364, + 299, -305, 76, -239, 26, -312, -234, 34, + -189, 871, -297, 364, 282, -321, -927, 4511, + 2, 6, 308, -82, 87, -128, 518, 82, + -4509, 1145, 960, -109, -186, 83, -144, 752, + 84, -2876, -162, 877, -249, 317, 510, 338, + 298, 744, 2892, -791, 363, 1088, 630, -2506, + -1, 3150, 219, 130, 119, 313, -822, -668, + 1201, -2948, -237, -106, -711, 405, 276, -255, + 0, 440, 161, 2587, -734, 3376, 276, 154, + 287, -200, 594, -29, 198, -237, -608, -445, + -286, 202, -783, 112, -3879, 78, 2809, -337, + -606, -684, -434, 559, 273, 201, 331, 903, + -53, 346, 700, 2599, 302, -590, -2551, -498, + -26, -667, 576, -546, 457, -289, -1408, -1021, + -63, 78, 153, -83, -696, -3105, 2498, -1502, + -1249, -238, 254, -287, 215, 313, 279, -517, + 67, -58, -148, -1111, 58, 5151, 346, 283, + -367, -900, 542, 209, -438, -128, -135, 54, + 7, 869, 291, -1073, 775, -61, -145, 457, + 562, 1332, -4589, 99, 1366, 184, 980, -920, + 80, -266, -152, -1877, -266, 364, -1432, 272, + 2275, 567, 60, 50, -2504, -386, -700, 373, + 6775, -15, -434, 347, 215, -369, -20, -281, + -243, -325, 227, -283, -665, -74, 336, -674, + -112, -369, -53, -396, 328, 3588, -541, -557, + -164, 1305, -817, -462, 1986, 1249, -574, 130, + 152, -2375, -425, 442, -3827, 322, -728, 563, + -179, 534, 620, -937, 590, -1, -59, 584, + 175, -193, -168, -5, -150, 156, -175, -178, + -245, -7481, -273, 212, -35, 318, -178, 446, + -55, -26, 42, -46, -265, 767, 330, 295, + 910, -54, 490, 2952, 598, -2578, -644, 403, + 149, -88, 549, -510, 596, -225, -2341, -286, + -2724, 5, -1960, -262, 922, 537, 646, -62, + -18, 8192, 484, 112, -222, -211, -224, 317, + 112, 82, -853, 1, 176, -475, -162, 200, + -193, 166, -228, -214, 72, 417, -27, -16, + 4, 395, -515, -6832, 28, -47, 626, -173, + 63, 90, 141, 217, 1037, 335, 4520, -896, + 111, 91, -656, -103, -729, -29, 653, -599, + -11, 2734, -378, -291, 60, 228, 47, -3670, + -192, 653, 733, -597, 898, -420, 1572, -133, + -154, 329, -259, -225, 218, -82, 117, 300, + -479, 277, 787, -1719, 136, -3603, 702, 1357, + 3340, 362, -438, 131, -1463, 367, -467, 1722, + -2186, 343, -379, 1221, -562, -260, 1157, 2692, + 37, -89, -322, -322, 8192, -284, 235, -528, + 113, -359, 44, 74, 119, -917, 403, 410, + -150, 157, 514, 168, 407, -246, -31, 510, + 105, 449, 4612, 635, -90, -1260, 774, -284, + -80, 456, 7, -3000, -324, -212, -104, -374, + -440, 1268, 2736, 53, -1178, -403, -438, -534, + 121, 261, -497, -73, 10, -262, 17, -1870, + 178, -1339, 224, 3115, -436, -448, 385, 894, + -1, 105, -18, 268, 342, 270, 891, 367, + 121, -325, -1610, -75, -3233, -189, -1050, 961, + -2833, -304, -51, 400, -284, -810, 824, -71, + -135, 194, 297, -297, 1129, 660, 518, 2426, + -225, 251, 4677, -176, -464, 296, -1208, -423, + -875, -581, -707, -1150, 499, -778, 28, 29, + 101, -4213, -127, -3681, 425, 481, -529, -679, + 11, 266, 127, -445, 527, -577, 310, 1465, +}; + +static const int16_t cb1110l0[] = { + -3748, -3820, -105, 16, -22, -7, 112, -14, + 52, 28, -42, -113, 132, -81, -8, -112, + 19, 33, -251, 117, -33, -9, -13, -28, + 60, -30, 29, 27, -58, -7, 4, 43, + -10108, -38, -3, 48, 3, -23, 202, -175, + -202, 71, -2143, 3, -82, -38, -113, 141, + 38, -66, -118, -38, -14, 148, -264, 143, + -13, -56, -9, -21, -28, 8930, -23, 53, + -40, 30, 72, -46, 26, 66, 22, 32, + 44, 22, -50, -66, -115, -141, 24, -3013, + -3460, 492, 207, -62, -567, 134, -26, -64, + 287, 343, -213, 42, -274, -144, -144, -77, + -26, -39, 4, -4, 42, 43, 30, -16, + 34, 113, 9291, -171, -17, 24, -53, -27, + 45, 42, 533, 146, -65, 32, 156, -144, + 2821, 889, -7, 614, 11, 1, -473, 434, + 659, -323, -2448, 23, -138, -582, 436, -152, + -30, 29, -290, -302, 3127, 496, 14, -346, + -70, 457, -1976, -229, 53, -2077, -313, 58, + 33, -91, -175, 141, 2728, 3232, -2150, 245, + -142, 13, -318, 70, -152, -64, 132, -322, + 44, 30, -70, -184, 433, -25, -97, -2035, + 145, 47, 640, 179, -441, 48, -108, 1742, + -280, 33, -3259, 79, -147, 324, -80, 65, + 48, 90, -7, -21, 22, 3, 56, -30, + 14, -2, -111, 22, -8, -8252, -103, -36, + 57, -203, 287, -2761, -220, 143, 11, -3597, + 21, -81, 62, -99, 41, -172, 108, 29, + 351, -370, 15, -122, -207, 275, -93, -2760, + 400, -212, 225, 230, -239, -3530, -73, 211, + 288, 85, -6, -634, 57, -78, 361, -149, + -1843, -23, 17, -37, -71, -174, -237, 42, + -22, -243, 63, -101, 131, 35, 136, -4025, + 41, -262, -57, 197, -290, 307, 35, -16, + 3, -5, 45, -7, 1, -47, 41, -19, + 79, 78, 42, -85, 74, -414, 1696, 703, + 297, -3296, 108, -546, 1129, 44, 447, -433, + 315, -1012, 133, 141, 1051, 601, -18, -532, + -30, 712, -127, -210, 10, 2442, -95, -46, + -14, 77, 32, -11, 10, -103, -15, 637, + -60, 352, 694, -202, 284, -5524, 92, -82, + 5, 140, -54, -115, 45, 287, -14, -307, + -342, 10, -181, 50, -30, -6, 10144, 77, + 42, 13, 26, -20, 34, 10, 37, -37, + -47, 90, -5, -44, -85, -64, -51, -1, + 16, -152, -91, 212, 4, -25, -237, -6124, + 22, -120, -1, 171, -17, -43, 141, -13, + -57, -185, 80, 273, -493, 178, 45, 11, + -57, 16, -23, -30, -37, 82, 4, -13, + -130, 98, 272, -450, -161, 133, 5104, 14, + 4576, -193, 11, 55, -30, 1, 123, -265, + -84, -340, -18, 152, -24, -266, 33, -90, + -108, -639, 1662, 299, -14, -389, 4679, -226, + 21, 311, -294, 159, -209, 172, 184, 292, + -373, 169, 84, 55, -269, 1453, -50, 41, + 68, -9, -62, 35, 23, -132, 96, 58, + -122, -3956, -318, 210, -117, 678, -104, 378, + -842, 61, 2549, 37, 149, -512, 70, -2971, + 225, -411, 230, -214, 697, -58, -871, -281, + -128, -204, -37, -128, 51, -174, -405, 497, + -4455, -219, 124, -120, 63, 135, 201, -122, + -435, -677, 221, 138, 486, 535, 3153, 165, + 11, -275, 94, -100, 69, 52, -67, -742, + 212, 16, -93, -428, 863, -17, -2465, 767, + -35, -130, 97, 1387, 34, 72, -23, -17, + 2845, -90, -71, 213, 291, 87, 826, -63, + 189, 641, -256, 832, 2087, -199, -170, -193, + -62, -7, 37, -60, -4277, -43, 24, -69, + 574, -163, -113, 263, -86, 45, 171, 1075, + -154, -39, 121, 74, -132, 182, 34, 13, + -278, -41, 96, 716, -221, -626, 1205, 244, + -351, 3914, -78, -32, 2833, -150, -37, 95, + -227, -84, -3432, 57, 238, -143, -365, 39, + 27, -238, -307, -170, 124, 66, -133, 40, + 62, -19, 42, -66, 2, -80, -2, 60, + 7, 10, 263, -4987, -69, -389, 62, -53, + -66, 24, -87, 13, 34, -15, -25, -20, + 197, 9, 101, -83, -79, -156, -100, 2, + -108, 5687, -157, 878, -1728, 32, 72, -66, + 70, -2, -46, -163, 206, 17, 247, 2974, + -66, 1354, 335, 238, -249, -410, -553, 354, + -41, 132, -96, 68, 2174, -329, -58, -76, + 6, 3089, 284, -274, -398, 471, 283, 427, + -220, 81, 2676, 40, -23, -46, 251, 109, + -3059, 50, -25, -551, 124, -389, 228, 95, + 56, -1320, -79, 1027, -4938, -105, -82, 13, + -159, 52, -101, 23, -220, -77, -153, 113, + -282, 42, 185, -144, -402, 46, -144, -99, + -2862, -3432, -2, 16, -32, 23, -25, -145, + 181, 49, 6, -236, -226, -28, 234, -26, + -89, -14, -355, 146, 117, -50, 76, -10, + 441, -95, -2, 346, -242, -3745, 884, -305, + -184, 350, 18, -293, -328, 257, 109, 49, + 157, -44, -70, 35, 6, 89, -4085, -167, + -263, -59, 35, -13, 430, -212, 17, -618, + -5, -8968, 114, 41, 73, -85, 122, 5, + 38, 19, -60, 14, -36, -42, -89, 20, + 85, -17, 20, 282, -3396, -25, 3722, 151, + -183, 100, -150, 19, -221, 126, 34, -21, + 72, 28, 138, -90, 30, 162, 46, 40, + 27, 15, -55, -21, 38, 55, 32, 83, + 9675, 31, 26, -2, 4, 96, -51, 120, + -132, 213, 2106, 39, -251, 98, -2572, -429, + -331, 1436, 2078, 335, -381, 371, 299, 339, + 300, -141, -99, -303, 2952, 49, 93, 40, + -3949, -45, 50, -215, 73, -39, -165, -283, + 46, -123, -347, 23, -158, 41, 20, 41, + -46, 19, 34, 86, -8770, 40, 20, -32, + -30, -16, 77, 72, -4, 92, -34, 103, + -77, 128, -532, -314, 24, 728, 49, -36, + -178, 76, 22, -14, -164, -194, 69, 3133, + 1007, -130, -280, 2502, 482, -2, 45, -62, + -7, -94, 17, 23, -4, 9516, -27, 11, + 22, 54, -13, 2, -2, 6, -22, -63, + 67, -686, 130, -2180, -124, 57, -61, -158, + 3364, 518, 4, 315, -367, -103, -295, 259, + -597, 56, -6, 72, -86, -45, -13, -47, + -13, -27, -3, 48, -12, -52, -6, -14, + -26, -16, -34, 9554, 80, 91, -270, 1, + -121, 117, 33, 8, 40, -99, -79, 43, + -3451, -92, -70, -57, 43, 68, 64, 284, + -639, 458, 118, -54, -2755, 370, -66, 54, + 27, -198, 331, 115, -40, -209, -312, 82, + -16, 8, 230, 212, 1853, -94, 1957, -118, + 153, -13, -73, 71, 116, -72, -3285, 106, + 19, -121, 177, -300, 455, -29, 94, 190, + -21, -8, 201, 16, 2, 83, -6280, 32, + -18, 59, -18, -41, -132, 22, 1, -39, + -212, -198, 186, 3154, -102, 3463, -280, -118, + -132, -132, 63, -19, 353, -24, -77, 224, + 82, 143, -65, 165, -16, -3774, 3543, -28, + -44, 93, -45, -13, -24, -5, -40, 58, + 3, 89, 71, 113, 46, 62, 44, 160, + -77, -8, -59, -6505, 134, -42, -73, 0, + 85, 2, 16, 34, 157, -34, -60, 78, + 24, 64, 96, 478, 231, -125, -217, 13, + 21, 44, 83, 198, -69, 21, -167, -52, + 4085, -234, -393, 17, -446, -354, -28, 42, + 53, -37, 28, 15, -16, -10, -85, 9471, + -16, -89, -87, -56, 52, -97, 86, -7, + -103, -12, 71, -39, 17, -40, 23, 63, + 65, -19, -14, -106, 29, 9707, -1, -12, + 1, -86, 100, 7, 1097, 266, 252, 197, + -64, -214, -197, -28, 3843, -1577, 310, -117, + 594, 13, 90, -309, -384, 134, -90, -194, + -316, 2884, 156, -185, 196, -103, 75, 1009, + 69, 768, -75, -605, -1488, 389, 242, 368, + 278, -122, -2500, 121, 7, -303, 91, -10, + 3642, 23, -109, -13, 138, -405, 18, -43, + 3, 42, 194, -112, 237, -2241, 23, 296, + -83, -14, -58, -163, -8, -174, -239, 85, + -108, -82, -79, 344, 236, -427, 127, 52, +}; + +static const int16_t cb1110l1[] = { + -64, 11, -74, -96, 39, 6072, 16, 46, + -215, 137, 77, 128, -195, -192, -87, 96, + 379, -73, 367, 437, -366, 84, -155, -29, + -69, -61, -34, -129, 260, -177, 3738, 739, + -221, -14, -40, 2, -483, -269, 2664, 166, + 29, -256, 30, 92, 51, 111, -45, 3893, + 90, -30, -99, 12, 74, 201, -52, -96, + -196, -85, -36, 123, -44, -68, 2, 8666, + 33, -41, 24, -12, -52, 69, 59, -27, + 38, -148, -55, -20, -60, 50, 3363, 30, + 3749, -92, 228, 173, -239, -167, -75, -79, + -86, -217, 32, 34, -137, -13, 17, -128, + -1462, -170, -224, -393, -3383, -1243, -47, 24, + -223, 26, 311, -343, -47, 784, 459, -548, + 558, 983, 103, 269, 32, 13, 19, -84, + -37, -29, -47, -6286, 7, 48, -100, 13, + 11, -271, -86, 115, -17, 183, 3247, -3336, + 57, -67, -117, -87, 19, 74, -271, 237, + -24, 242, 49, -179, 298, 85, -69, 328, + -238, -34, 103, -50, 79, 2, -27, -16, + -103, -61, 5868, -105, -262, 74, -74, -158, + 263, -110, 154, 212, -3, -84, -126, 25, + -67, -2501, -12, -35, 139, 259, -95, -141, + 137, 90, 12, -244, -142, 314, 15, -124, + 1, -25, -27, -2, -6, 28, -48, -17, + -2, 43, 67, 42, 9023, -25, 19, -13, + -23, -43, 73, -30, 143, -1, 2884, -142, + -4, 3549, -49, -366, 110, 314, 19, -55, + 363, 204, 469, 189, 217, -181, 119, 41, + -133, 29, -55, -94, 71, -49, 41, 85, + -14, 6140, 71, -142, 10, 18, 169, 136, + 282, -49, 36, 446, -99, 263, 92, 2201, + -127, 43, -143, -350, 36, 389, -208, 15, + -3610, -275, 383, 1599, -179, -177, -1100, -4, + 67, -38, 2, 278, 39, 107, -120, 465, + 204, -397, 305, 416, 7, -262, 68, 2341, + 189, -75, -23, 25, -20, -74, 56, -43, + -125, 170, 509, 63, 26, 263, -741, -31, + 8, -296, 101, 20, -149, 2846, -218, 379, + -310, 151, 901, 84, -85, -83, -387, 161, + -3102, -158, -438, 38, 191, -58, -202, 127, + 126, -88, -430, -3077, -1829, -332, 61, -152, + -14, -32, -156, -5, -375, -1083, -5130, 110, + 77, -201, -15, 4, 13, 86, 119, 67, + 149, 80, 264, -253, -121, 63, 193, -103, + -129, 63, 120, -226, -100, 3196, 72, -11, + 8, -56, 279, -73, -192, 47, -87, 125, + -43, -108, 277, 188, -107, 289, 5966, -20, + -303, -78, -21, 40, -139, 44, 28, 6, + -254, -244, 47, -1, -151, 29, -344, -2318, + 30, -3767, 114, 84, -155, 85, -90, 155, + 111, -506, 6, 453, -241, 215, 131, -802, + 15, -343, 176, -430, 251, -74, 6, -41, + -44, -131, -105, -248, 346, 39, -4524, 93, + -120, -79, -777, -416, -570, -221, 21, 28, + -52, 56, 71, -187, 2949, -2531, 666, 799, + -137, 970, 243, -695, -148, -281, 326, 450, + -734, -99, -2078, 112, -83, -90, -78, 262, + -138, -31, -5, -74, -171, -99, 344, 143, + 4035, 56, -121, -921, -8, 46, 4576, 97, + -219, -34, 123, -44, -1, 85, -36, 399, + -260, -231, 132, -318, 55, -181, 156, -3093, + 142, -9, -3418, -31, 43, 126, 136, 309, + -50, -20, 170, -90, 188, -173, 175, 50, + 144, -244, 22, 64, -476, -22, -66, 272, + 3839, 715, -188, -82, -250, -587, 10, 368, + -507, 242, -40, -531, 451, 35, 560, -107, + 138, 15, 113, 56, 242, 33, -23, -27, + 81, -157, 301, -327, 359, 3648, 62, -1489, + -167, 136, -39, 183, 53, -151, -16, -60, + -65, -5182, -17, -257, -10, 56, -104, 713, + -2, 328, 72, 353, 43, -51, -5949, 40, + 32, -82, -36, -22, 57, 56, 55, 112, + -104, 76, 5, 80, -29, 173, -360, -113, + 42, -119, 180, -26, 120, 250, -3024, 198, + 115, -140, 22, 136, 275, 698, -149, 699, + 426, -220, 279, 63, 55, -63, -108, -51, + -70, -70, 419, -156, 5870, 33, -57, -114, + -388, -213, -164, 1543, 117, 165, 1944, 223, + -83, 46, 201, 12, -103, 228, 139, -207, + 136, -1218, -544, -723, 90, -652, 793, -1, + -100, -32, -236, 49, 164, 138, 16, 82, + -3221, -62, -168, 62, -313, 98, -652, -484, + 684, -91, 33, -2926, -3453, 566, 34, 35, + 104, 13, 189, 235, -49, -324, 126, 226, + -102, 123, -253, -403, 38, 160, -5, 100, + -30, 16, -19, -44, 2, -70, -30, 82, + 118, 6, 132, -15, -36, 59, -8835, -448, + 3707, 324, 87, 67, -110, 114, -76, 294, + 354, 7, 140, 11, 340, -117, -559, 67, + 129, 201, -314, 328, -209, 102, -121, 378, + -5010, 140, 53, 15, -253, -14, 414, -183, + -70, -25, -51, 34, -347, -171, 146, -98, + -101, -3, -99, 96, 66, 50, -5, -115, + -23, -45, -351, -4202, 143, 480, -46, 140, + 17, -6312, -110, -23, 150, 60, -39, -9, + -48, -60, -8, -20, 37, 57, -162, 60, + -137, 55, -101, 65, 100, -8952, 3, -49, + -3, -9, 28, 15, -89, -136, 59, 125, + -73, -35, -111, -69, -28, 111, -16, 48, + 27, 9272, 55, 34, -92, 66, 3, 3, + -38, 12, 59, 95, -100, 3, 51, 121, + 146, -200, 142, -254, 65, 3, -169, -8, + -65, 44, 10, 15, -99, 56, -6, -108, + -20, -5461, -89, 395, 2085, 486, -48, 324, + 422, -3703, 468, 198, 239, 0, -277, -115, + -227, 227, -29, 159, -128, -447, -291, -1953, + -110, 25, 2274, 141, 177, 204, 38, -258, + 90, -8, -131, -2636, 55, 561, -99, -220, + -33, 142, -334, -160, -117, -12, -33, 6, + 72, -3, -11, 50, 1, -45, 8, 23, + -15, -33, -15, 30, -32, 107, 145, 14, + 60, 114, 45, 24, 8811, -9, 61, 192, + 16, 124, 46, -54, -31, 89, -147, -112, + 3341, -395, 91, -323, 45, -156, 25, -18, + 34, -534, 118, 83, -187, -92, 180, 34, + 659, 135, 103, -2342, 54, 6, 179, 40, + 143, 232, -3858, -201, 179, 32, -56, 406, + -236, 541, -70, -88, -121, 447, 3028, -223, + 138, -557, 230, 3457, 96, -4, -22, -13, + -136, -45, -123, -8, 107, 270, 132, -64, + -32, 464, -33, -44, -2544, -251, -246, -71, + -4063, 40, 107, 384, -22, -197, 64, 166, + -137, -44, 98, -35, 193, 4, -2103, 57, + -109, 245, 3487, -55, -60, 21, 187, -267, + 279, 3, 166, -78, 108, -135, 126, -122, + 171, -133, -21, -134, 183, 25, -56, -6210, + 107, 109, 22, -93, 39, 95, 43, -11, + -44, -5, -82, 6, -54, -27, -116, -16, + 84, 44, 22, -68, -1, -57, 78, 35, + 83, 4664, 46, 1, -164, 3301, -358, -3757, + 236, 104, -81, -121, -278, -112, -20, 89, + -123, 35, 113, 17, -331, 273, -172, 125, + -73, 77, 2515, -3944, -170, -87, 174, 84, + 142, 138, 13, 227, 127, 146, 141, 196, + 38, -40, -112, 136, 2311, 328, 87, -22, + -77, -34, -195, 58, -333, 337, -159, 626, + -3008, 408, 523, -316, 539, -587, -81, -2824, + 98, 200, 613, -107, -170, -1190, 1121, 521, + 229, -217, 143, 144, -1248, -384, 1535, 470, + -655, 492, -429, -26, -132, -180, 52, 97, + 10, -35, -60, 7, -5422, -26, 154, -132, + -221, 124, 136, -17, -68, 25, 29, 4, + 5, -15, 9, 69, -16, -47, -76, 5, + 41, 6, -22, 63, -8, 9709, -33, 650, + -545, -159, 81, -75, 54, -92, -49, -80, + 14, -78, -145, -399, -3935, 186, -1144, 207, + 60, 286, 2642, 44, 117, 3758, -154, 426, + 331, -615, -216, 271, -121, -109, 495, 42, + 813, -19, 545, -149, 633, -2424, -2089, 265, + -136, -58, 4, -28, 147, 2, -123, -93, + 14, -50, 317, 131, -130, -152, 322, 1023, +}; + +static const int16_t cb1110s0[] = { + -6433, 495, -277, -630, 411, 1241, -326, -425, + 523, 114, -225, -53, -538, -702, -260, -417, + -401, -222, -263, -416, 163, -1256, 590, -1176, + 1865, 1483, -927, -65, -674, 1303, -147, -750, + -132, 407, -283, 852, 1788, -2257, 210, -450, + 303, -272, -2536, 94, 2010, 428, -921, -3, + -71, -875, 156, -681, 521, 49, 51, -523, + 1532, 1619, -690, 402, -923, 318, 865, 193, + -2187, -662, 553, -1104, -70, -1313, 462, -1045, + 320, 937, -1453, -514, 404, -231, -1748, -1592, + -2039, -217, -364, -1313, -428, 2419, 1257, -1292, + 19, 2867, -278, -1832, -239, -691, -383, 62, + 185, -455, -1589, 116, 419, -319, -418, 537, + -280, -1834, 2681, -857, -210, -156, -1143, -104, + -1774, 1702, 184, 1017, -135, -610, 525, 335, + -355, -494, -231, -154, 986, 434, 1134, 1213, + 914, 1457, -258, -1086, 477, -2247, 498, -1741, + -975, -262, 812, 108, 834, -412, 120, -1032, + -533, -456, 139, -301, -387, -690, 798, 3, + -1556, 1261, 745, -4486, 8, 213, 977, -151, + -269, -344, 13, 544, -270, -166, -706, 672, + 184, -943, -1714, 1510, -739, 1891, -477, 528, + 1847, -1572, 420, 103, -85, 508, 231, 2024, + -1343, 20, 238, -655, 668, -1561, -743, -651, + 709, -1136, -208, 979, 258, -693, -535, -1126, + -283, -944, -209, 603, -1797, -2998, 253, -296, + 842, 63, -203, -468, 675, 337, 1458, 114, + 259, 3202, 145, 419, 631, 352, 2309, 1337, + 815, -99, -824, -779, -1839, -1455, 166, -2092, + 1299, 162, -1026, -914, 128, 1321, 896, -209, + 255, -1144, 807, -2870, -632, -588, 866, 81, + 453, 154, -1258, -499, -452, -98, 2599, 3070, + 540, -834, -228, -1268, -313, 1269, -65, -56, + 1035, -499, -507, -657, 447, 26, 96, -175, + 133, -291, -538, -259, 7, -206, 411, 145, + 25, 215, 267, -4354, -442, 250, -814, -143, + -459, -182, -640, -1258, 169, 379, -1196, 429, + -128, -1971, 2681, -45, 1641, 152, -556, 909, + 365, -618, -417, -363, -434, 270, -1388, -473, + 62, 58, 509, -3909, 1327, 1571, 482, 1081, + -896, 459, 480, -557, -267, 390, -15, 484, + 248, 52, 49, 702, -10, 162, 245, -416, + 1397, 23, 183, 325, 591, -816, 4429, 674, + -332, -1243, 68, 285, 235, 759, -315, 799, + 313, -331, -182, -629, 394, -1079, 3879, -81, + 651, -774, -21, -297, 231, -1826, 47, 104, + 284, -171, -198, -110, -193, 881, -715, 294, + -490, 395, -1261, 2859, -3175, -1477, 668, -215, + 310, 10, 762, -837, 101, 142, 201, -940, + 453, -82, 493, -983, 23, -211, 990, 1327, + 4664, -27, 821, 809, 500, 243, 41, 568, + 44, -320, 105, 461, 306, -408, -793, -35, + -18, 229, -12, -416, 577, -301, 4870, -520, + 499, 57, -544, -21, 611, 226, -20, -412, + 440, -680, 448, 430, 226, -610, -310, -218, + 1161, 523, -400, -148, 783, 395, -126, 370, + 686, -497, -301, 161, -5, 238, 375, 357, + -126, 954, 5952, -53, 121, -405, 1571, 435, + 461, -1166, -1163, 1347, 1394, 170, 2035, -1580, + -958, 276, -680, -968, 275, -323, 524, 48, + -1896, 46, -495, 548, -929, -859, 224, 1079, + 863, 3080, -1594, -379, 302, -403, 710, 655, + -293, -719, -683, -944, 228, -341, 563, -495, + 920, 738, -614, 552, -249, -402, -164, -262, + -425, -4025, 164, -984, -518, 157, -1156, -729, + 1024, -768, 1003, 481, -116, 319, -918, 1563, + -662, 4852, 617, -250, 549, -265, -93, 680, + 470, 925, -293, 629, 142, 231, 44, 133, + 12, 40, -867, 269, -77, 445, -1132, -985, + -1304, 728, 424, 530, -258, -625, 377, -1400, + -2538, -470, -1711, 413, -1603, -81, -393, -1013, + 1130, 906, 287, 640, 3785, -463, -159, 43, + -165, -441, -513, -287, -554, 1547, 848, -275, + 936, 653, 769, -58, -1007, -698, -792, 2175, + 398, 1382, -122, 459, -7, 281, 2785, -637, + 632, -279, 293, -1078, -996, 96, -293, -1335, + -74, -587, -286, -565, -977, -228, 5080, 3, + 171, 111, -34, -177, -619, 577, 448, -280, + 189, 1033, -579, 134, -713, -947, -249, -1897, + 364, 1748, -2098, 21, 859, -73, -1881, 116, + 36, 1591, 1386, -1128, -346, -1015, -25, -90, + -691, -984, -120, 29, -635, -236, 26, -691, + -742, -203, 294, -472, -901, 2582, -171, -357, + 406, 162, 1561, -913, 308, -3319, 461, 779, + -305, -927, 290, -941, 615, -688, -508, 222, + -432, 387, 170, -115, -5338, 508, -212, 150, + 26, -38, 306, -15, 50, 2008, -1112, -187, + 44, 591, -280, 1187, 934, -228, 554, 65, + -1387, -1999, -805, 2555, -1225, -283, -435, -430, + -50, -655, -103, 248, -234, 32, -826, -708, + -704, -1006, 176, 784, 274, 626, -2353, 707, + 1852, -132, -196, -169, -463, -2117, 56, 413, + -141, -818, -365, 921, -816, -126, -135, 438, + -948, -145, -349, 700, 205, 1001, -3626, 314, + -493, -1182, 131, 733, 2404, -1244, 564, -960, + 328, -1137, -108, -755, -168, -995, 966, -1706, + -565, 806, -693, 1369, -269, -428, 675, 768, + 341, -794, 2265, -208, -1883, -801, -1889, 961, + 182, -504, -595, 871, -1280, 952, 1351, 665, + 474, 1032, 58, 451, -198, 345, 176, -853, + -2891, 2250, 624, -616, 183, 144, 736, 0, + -198, -138, -1218, -501, -658, -24, 1232, -286, + -233, -937, 2150, -1035, 449, -623, -2748, -2176, + 918, -170, 421, 1376, 93, 153, 627, 493, + 28, 549, -292, -175, 1066, 1037, -475, 413, + -2006, -2022, -334, 365, 901, 945, -663, 515, + -351, -597, 155, 1318, -153, 417, -425, 44, + 338, -1958, -355, -596, -2134, 360, 341, 2501, + 824, -2106, -282, -1723, -735, -550, -743, 113, + 1027, -479, -2114, -16, -631, -282, -1054, 1320, + -158, -234, 3479, 28, 1818, 627, 1464, -795, + -22, 897, -6, 392, -234, -170, 714, -382, + 1262, 67, -618, 145, 25, -710, -247, -545, + -1386, -1797, -995, 865, 465, -364, 830, -53, + -1108, -383, -538, 85, 731, -188, -813, 2, + -1667, 3379, 289, 425, 1319, -259, -592, -212, + 271, -268, -126, 1282, 306, 3859, -1423, 607, + 20, 755, 174, -782, 72, -234, 675, -1177, + 1101, -635, -1641, 2574, -978, -1390, -1743, 2183, + 53, 75, 650, -97, -456, -126, -719, -675, + 557, -375, 643, 853, -81, -192, -1174, -1288, + -954, -883, -806, -2182, -2111, -1426, 180, -266, + -301, 626, -443, 61, -149, -443, -935, -48, + 642, 250, 17, 596, 1342, -2127, 323, -1456, + 1995, 837, -1456, -1683, 945, -722, -1445, 452, + 178, -441, -250, -137, -128, -50, -311, -600, + 2237, 922, 139, -107, -637, 1770, -2503, 413, + -803, 496, 209, -391, 401, 412, -552, 605, + -37, -667, -1609, -19, -1073, 1522, -705, 670, + -992, 882, -1213, -854, 2150, -371, 73, -1167, + -592, -153, -509, -584, -495, -83, 2075, -1489, + 719, 1245, -1138, 72, 950, -950, 542, -590, + 988, 1646, -64, 562, -223, 73, 583, -151, + 215, 914, 1391, -2997, 161, 436, 49, 2225, + 271, -283, 3844, -578, 335, -90, -698, -162, + 1236, -117, 470, 383, -718, 520, 295, 29, + 292, -179, 774, 204, 372, -251, -824, -487, + -1822, -312, -731, 568, -1008, -255, 189, -1195, + 657, -227, 3422, 651, -220, -1204, -590, 713, + 365, -977, 204, 3118, 321, 922, -347, 1505, + 375, -77, -1520, -1411, -680, -507, 543, -492, + -1844, 135, 689, 384, -408, 140, 633, -1192, + 475, 220, -1711, -1318, 606, -103, -712, -1734, + -218, -855, -835, -3071, -109, 1391, 62, 21, + -75, -77, 369, 216, -1484, 2057, 661, 314, + 275, 1048, 175, 1842, 743, 808, -594, 338, + -1217, 1606, -531, -1360, -1073, 452, -531, -798, + -771, -1292, -918, 606, -1776, -509, 178, 1422, + 3424, 634, 722, -257, 525, 437, -197, -130, + 291, -411, -259, -890, -84, 368, 1117, -1321, + -324, -2122, 515, 1158, 1749, -963, 681, 39, + 268, 549, 324, -601, 151, -200, 829, 3881, + 797, 660, -572, -693, 633, 1023, -147, -581, + 102, -207, -163, -511, -30, -102, 379, 776, + 494, -510, 55, -1811, 1073, 4384, -318, 3277, + 1958, -209, -539, 1823, 1200, -182, -186, 213, + 123, 506, -471, -431, -698, -331, -1168, 88, + 276, -184, 733, -295, -1053, -717, 862, -1453, + -4235, 1063, 1049, -621, -429, 372, 1043, 599, + 271, -693, -689, 122, 466, -323, 332, -533, + 645, 516, -371, -207, -2046, 72, -1125, -229, + -2769, -330, 1387, -89, 342, 2786, -730, 152, + 629, 809, -459, -248, -266, 111, 380, 724, + -411, 640, -72, 323, 34, -277, 443, 289, + 151, -4816, 402, -171, -731, 635, -84, -133, + -310, 397, 904, 1193, -1512, -25, -1306, 587, + 322, -3762, 537, -306, -981, 917, 190, 787, + -613, 149, 301, -376, 366, 350, 18, 893, +}; + +static const int16_t cb1110s1[] = { + -332, 1306, 1626, 1555, -3510, -225, 418, 1520, + -969, -74, -286, 233, -313, -97, 375, 181, + -309, 1348, 969, -504, -141, 789, -1224, -137, + -704, 98, 1003, 466, 2259, 1485, -225, 61, + 272, -223, -347, -23, -368, 96, 2345, 112, + 363, -552, -6, -806, -1637, -1703, 1597, -2114, + -196, 293, -1173, -630, -863, -1224, 784, -722, + 744, 885, 798, -384, 92, 298, -873, 1808, + 1389, 488, -1569, -1541, -3064, -734, 3, 467, + -987, 346, 1915, -683, 205, -487, 341, -330, + 274, -25, 49, -83, 1246, -405, -777, 266, + 121, -250, 466, -1232, -3197, -871, -638, -332, + 1563, 1900, -470, 556, -465, -412, 901, -86, + -683, -577, -1033, 808, -863, 1212, -724, 2222, + 429, 2733, 413, 891, 1669, 515, -439, 187, + -359, 414, 176, -706, 679, -63, 1247, -1721, + 779, -2770, -484, -633, -993, -243, 1442, -312, + -324, -370, 392, -407, 229, 97, 1267, -18, + 46, -303, -684, 515, -166, 4212, -775, -23, + -53, 23, 1966, -465, 231, 1195, 252, -1036, + 16, -824, -116, -582, -286, 470, -159, 217, + -456, 549, 648, 60, -1119, 221, -747, 354, + -628, -486, 894, 1280, -2631, 247, 430, -1703, + 69, -236, 147, 1445, 540, -936, 181, -163, + 931, -1044, 669, 2457, 519, 597, -2031, 11, + -1319, -4, -1190, 85, 254, -1494, 230, 1583, + -547, 277, -2006, -103, 1195, -2522, 1301, -633, + -104, -511, 573, 1628, -451, -1022, 564, -692, + 255, 1029, -408, 757, 172, -395, -472, -1703, + -1856, -379, 289, 509, -628, -1349, -207, 404, + -399, 1671, 392, -935, -190, 952, -1267, 1150, + 1562, -609, 491, -346, -270, -483, 310, 1420, + -1017, 1714, -645, 897, -1327, 3154, -1046, -857, + -499, -496, -1348, 399, 63, -653, -315, 820, + 1645, 614, 2202, 779, 3001, 1382, 387, -843, + -1840, 422, -1017, 246, -219, -550, 105, -608, + 426, -346, -224, 375, 22, -448, -270, -1150, + -897, 4298, -882, 49, 633, -937, -694, 675, + -322, -793, -516, -360, -248, 1190, 575, -843, + -13, 50, -801, 1181, 452, -335, -495, -102, + -1057, 506, -206, 66, -647, 991, 259, 259, + -468, 197, 373, -4216, -750, 224, -182, 520, + -530, 1888, -2018, -1492, 656, -1447, 993, -790, + -785, 792, 1658, 373, 131, -460, -703, 1080, + -875, -212, -694, 747, -639, -2267, 1263, -415, + -749, -1278, 591, -745, -225, -1677, 69, 625, + -146, 212, 345, 728, -553, 1117, 471, 550, + -498, -729, -2070, 1006, -330, 939, 3636, 34, + 349, 761, -131, 372, 610, -399, 10, 86, + 110, 931, -1159, -175, 633, 568, 140, 712, + 2800, -1558, 2343, 3, -974, -673, 233, 1436, + -783, 599, -442, 852, 639, 447, -976, -564, + 1511, 36, 529, 433, 677, 1971, 2777, -820, + -655, -1463, -1392, -1142, -352, 432, 730, 439, + -273, 844, 108, 115, 408, -361, 504, 337, + 58, 1074, -1645, -1623, -493, -70, -1585, 2878, + -741, 636, -224, -974, 722, -147, 149, 135, + -107, -154, -1027, -18, -989, 282, 3173, 1123, + -778, 1389, -591, 337, 1660, -288, 1162, -65, + 660, 326, 141, 358, 679, -222, 460, 105, + 512, 36, -854, -477, -942, -2362, 265, 2252, + -164, -2059, 106, 666, -420, 521, -178, 396, + -1836, 475, 82, 356, 207, 433, -1005, 97, + 385, -304, -853, 1282, -239, -2134, 83, 84, + 201, -1894, -1603, 683, -1957, -113, 839, 1187, + -313, 774, -754, 941, -739, 748, 116, 716, + 1134, -530, -2178, 71, -611, 1544, 3527, -3, + 283, 527, 457, 399, 762, 17, -279, 196, + -518, -160, -1204, -289, -1354, 132, -315, -290, + -2179, 676, -1474, -1010, -1397, 363, -45, 783, + 1326, -33, -109, -617, -271, -967, -103, 1867, + 769, 740, -818, 1011, 1411, -693, -2458, 808, + 806, -213, 468, 31, -70, 166, 230, -405, + 163, 70, 652, 1077, -190, -622, 2343, -1328, + 601, 928, -1661, 174, 429, -2479, 501, 503, + -41, 1365, 671, 1006, -1968, 7, 103, -399, + -382, 573, -27, 554, -2263, -3174, 277, 177, + 807, -328, -816, 453, -1548, 828, -327, 187, + -393, -745, -76, -808, 575, -8, -326, -2062, + 601, 566, 755, 775, 595, 419, -3925, -226, + 272, 368, 395, 59, 1117, 548, -649, -429, + 321, 549, -744, 319, 82, 135, 73, 14, + 374, 93, -270, -453, 177, 4991, 569, 169, + 111, -246, -362, -88, -49, 583, -35, 60, + -759, 1327, 1768, 766, -350, -880, -106, -449, + -113, -683, -418, -999, 992, 559, -290, -147, + -324, 93, -947, -3932, -37, 307, 1087, -314, + -293, 432, 830, -130, -208, 59, 719, -348, + 4511, 224, 488, -174, 588, 795, -301, -246, + -447, 682, 917, -1207, -503, -450, 575, -116, + -126, 594, -22, -101, 5, -1188, -431, 1146, + -3869, -72, 402, -417, -390, 350, 1141, -138, + 697, 77, -3255, -268, -786, -106, -1386, 400, + -856, -691, -438, -1550, -228, 2162, 236, 64, + -382, 1, 1032, 153, -659, 1563, -410, 1280, + 1573, -3675, -1041, 240, 401, 215, -353, -1140, + 265, -103, -824, -93, -319, -849, 253, -477, + -463, 153, -1017, 538, 1233, -1041, 11, 998, + -437, -569, -970, 2118, -1577, 1, 321, 1784, + -298, 2315, 72, -20, 83, 905, -1289, -246, + 731, 4076, -1477, 602, -911, 978, 698, -239, + 391, -729, -276, 225, 143, -417, -500, -27, + -1220, 89, -403, -1453, -2546, 1015, 70, 78, + 2364, -159, -775, 29, 37, -231, 73, 433, + 426, -529, 420, -613, -100, -605, 1463, 1001, + 1159, -4082, -553, 348, -806, 624, -162, -1121, + -25, 919, -62, 90, -275, 233, 203, 32, + 745, -221, 458, 529, 901, 1088, 38, 1209, + 450, 451, 2250, -411, -205, 761, 249, -1226, + -266, -3195, -801, -31, 1015, -324, -596, -42, + 150, 207, 2597, 1041, -1045, -2254, -1428, 250, + 217, 69, -933, 1424, 280, 446, 524, 540, + 639, -1027, 23, 412, 36, -67, 475, -1126, + -739, 1160, 514, -157, -2832, -1432, 559, 77, + 740, -888, 134, 1304, -267, -267, 329, 8, + 1721, 1488, -29, -1760, -1904, -2634, -1342, -528, + 2233, -219, -194, -2919, 128, 1203, -623, -127, + 488, -386, -133, -329, 62, 85, 1271, -185, + -479, -588, -2964, 546, 1651, 1526, -830, 1046, + 347, 63, -1048, 239, 1402, -22, 307, -1606, + 768, 999, 304, -512, -175, -246, -373, 529, + 93, -521, 1310, -508, -4366, 27, -768, -358, + -575, -2, -593, -21, -838, 635, 197, 634, + 321, -263, -377, -549, 20, 739, 395, -9, + -392, 70, 5679, -133, -130, -240, -678, 421, + -101, 412, 143, 209, 194, 216, 200, -22, + -748, -399, 2863, 284, 231, 691, 571, -3460, + -200, 312, 480, -1338, -603, 435, -308, -615, + 520, 178, 68, -716, 45, -593, -32, -1393, + -554, -1000, -867, 613, 288, 507, 202, -113, + 17, 93, -141, -47, 665, 559, -808, -4091, + -575, -193, -873, -790, 673, -608, -941, 745, + 1562, -1060, 988, 1192, 29, -1207, 207, 653, + -622, -132, 370, 1435, 1977, -1878, -119, 101, + -100, -154, -869, -2375, 1254, 122, 188, 877, + 188, -838, -355, 667, 3813, 1076, 369, -771, + -712, -669, -14, 107, 1027, 112, 2306, 1418, + 133, 1055, 377, 249, 1023, -927, 12, -1983, + 1174, 223, 385, 827, 1425, -1694, -1178, -94, + -593, -286, 1263, -671, -425, 2002, 701, 1546, + 547, 182, 1013, 128, 351, -243, 407, 2349, + -376, 445, -93, 968, -337, -601, 1342, 987, + -1499, -644, 521, 327, -557, 1800, 12, 285, + 127, -269, -1989, -449, 87, -1042, 184, -499, + 1231, -1664, -352, 4, 1253, 403, -1064, 837, + -1702, 133, 1687, -1300, 2248, 179, -847, -617, + 460, 450, -260, 94, -780, -675, 1209, 38, + 453, 857, -631, 317, 535, 1086, -196, 638, + -288, -389, 688, -93, 1271, -4290, -96, 445, + 64, -211, 148, -74, 486, -1873, 1214, 1836, + -708, 1800, 1644, 576, -1088, -1212, 1147, -456, + 173, -911, 489, -443, 644, 534, 846, -1522, + -786, 497, -401, -1087, 1410, 1391, 837, -253, + 124, -598, -254, -3945, -1169, 103, -193, 50, + 846, -1014, 353, 455, 784, 1343, 3055, 178, + -628, -148, -266, -324, -96, -190, -930, 115, + 475, -651, -314, -82, -236, -88, -3753, -1048, + -283, -178, 351, -671, 325, 1054, 28, 540, + 113, -73, 763, 844, 543, -6, 799, 245, + 176, 124, 262, -112, 1010, 361, -843, 3290, + -3741, 914, -1835, -259, 2467, 297, -1205, 168, + -1917, 156, 87, 637, -677, -955, 312, 1246, + -219, 92, 1090, -292, -773, 343, -523, 299, + -513, 1321, -536, 586, -1324, 2345, 2384, -719, + -936, 1389, -27, 880, 338, -127, -666, -441, + 1603, 143, -218, 2167, -1335, 469, -1224, 2489, + 1365, 568, 19, -1322, -736, 208, -494, -454, + 990, -250, 305, -575, 206, -168, -1177, 282, +}; + +static const int16_t cb1110m0[] = { + 429, -104, -210, 216, 361, -2586, 253, -1350, + 145, 2795, -5, 663, -262, 37, -122, 205, + 270, 321, 2623, 256, 4, -42, -37, 112, + -346, 20, -51, 9, -90, -3342, 78, 52, + -239, -454, -207, 355, -136, -19, 394, -212, + -166, -73, -68, 1049, -2945, 385, -545, -211, + 116, -15, 687, -232, 1824, -66, 133, -403, + -63, 3, 46, -104, -101, 136, -61, 420, + 149, -24, -9, 4277, -149, -166, 96, -35, + 1786, -1044, 115, -1326, 3381, -520, 70, -134, + -433, -198, 146, -615, -143, 201, 342, 412, + -162, 22, 111, 16, -85, 14, -120, 79, + -30, -84, 56, -34, -52, -147, 19, 155, + 17, -120, 5853, 96, 767, 262, -194, 124, + -180, 13, 3081, 39, 402, 90, 292, 84, + 1999, -16, 866, 292, 416, -314, 177, -1, + 68, 3, -28, -56, -54, 10, -5, -63, + 89, -69, -251, 70, 7523, -83, 67, 62, + 178, -1723, -76, 101, 369, -139, 58, 135, + -32, 138, 3393, -575, 586, 292, -296, -505, + -634, 52, 280, 78, 14, 117, -39, 77, + 231, 136, 14, 51, 173, -96, 5, 378, + -52, -4340, -263, 61, 22, -2896, -20, 180, + 21, 3636, -138, 104, -279, 56, -407, -8, + -123, 134, -95, -500, 266, -64, -43, 1, + -170, 31, 110, 53, 56, -5938, 151, 49, + -76, -166, 34, -8, 193, 198, -118, -4, + -44, 249, -28, -102, -3614, 49, 464, -388, + -744, -500, 603, -88, -19, 1606, 325, -227, + -277, -142, 232, -1835, 150, -89, 29, 9, + 76, 425, -320, 179, 231, 1720, 424, -2730, + -298, 666, 72, -428, -1243, -299, 93, -12, + -20, -96, -123, 18, 188, -1, -235, -2, + 3328, 107, -1489, 199, 893, -63, 46, 3799, + 22, -118, -127, 283, 254, -2091, 293, 331, + 857, -92, 46, 13, -457, 169, 851, -19, + -231, -8735, -62, 69, -190, -103, -31, 108, + 66, 95, 53, -6, 12, 19, -73, 105, + -40, -29, 60, -263, -107, 2233, -246, 485, + 342, 1732, 76, 2489, 40, 44, -300, 280, + -109, -107, -990, -45, 1014, -5073, 1, -169, + 25, -55, -340, -427, 603, 206, 151, 360, + 312, -44, -106, 514, 683, 98, 3331, 19, + -106, 106, -3383, 85, -161, -88, 8, 12, + -163, 183, -393, 117, -243, -498, -60, 292, + -322, -2105, 920, 301, 41, -19, -142, -2485, + 631, -289, -849, 132, 800, -255, -390, 137, + -850, -411, 41, -93, -8653, 9, -25, 134, + -66, 222, 152, 59, 29, -193, -129, -105, + 39, -21, 188, 111, 25, -3, 0, -79, + 8907, -24, -18, 37, -33, -42, 87, -44, + 56, -79, -67, -52, 18, -132, 1925, 309, + 145, -443, 1279, 200, 1215, 281, 3343, 311, + 390, -154, -119, -523, 19, -529, 190, 272, + 541, -393, 278, 161, 13, 161, 891, -65, + -199, -1376, -350, -1409, 340, 2115, -209, 2459, + 30, -509, 141, 11, -557, -1560, -1912, -234, + 76, 787, 2781, 45, -158, 330, -623, 655, + -845, -463, -119, -252, -299, -1940, 145, 17, + -183, -71, 98, 67, 145, -134, -88, -5, + -3636, 3, 34, 231, 981, 33, -953, -403, + 129, 215, -11, 109, -188, 51, 5176, -89, + -113, 60, -138, -94, 142, 216, 322, -33, + 350, -285, 182, 92, -16, 12, 15, 126, + -27, 5, -5220, -154, 13, 109, 18, -326, + -257, 118, 313, 342, 2289, -35, -22, 115, + -256, -2908, 68, 1211, 203, -735, -380, -134, + 249, 522, 109, -48, -5114, 32, -42, 85, + -99, 265, -187, -93, 373, 341, -254, 16, + -121, -92, -260, -80, -2, -322, 234, -96, + -2834, 230, 146, -264, -3287, -153, 41, -349, + -149, -98, 140, -115, 628, -11, 292, 4, + -166, 82, -4548, 116, -23, -311, 612, -334, + 451, 259, 559, 320, -267, 517, -139, -166, + 126, 27, -89, -156, 14, 63, -3, 31, + 109, -43, 10, -7682, 36, -23, 73, 129, + 0, -116, 66, 5, 137, -17, 2523, 203, + 431, -2729, 175, 540, 454, -175, -297, -60, + 348, 53, 688, -49, 133, -72, 200, -348, + 136, -142, -2259, -3047, -60, -737, 48, -331, + 85, -134, 218, -962, -278, -148, -1077, -131, + 53, -127, -2265, 82, -31, -262, 226, -385, + 83, 756, -2715, -492, -115, 663, -312, 240, + -318, -819, 3040, -181, 148, 165, 376, 92, + -233, 188, -100, 902, -401, 1005, -52, 162, + 219, 1831, -68, -66, -10023, -90, -23, 39, + -91, -231, 23, 174, 42, 79, -57, -58, + 18, 175, 32, 122, -185, 266, 162, 300, + -3158, -3381, -3, -312, 178, -24, -234, 248, + 68, 293, 360, -146, -30, -2, 177, 113, + -1215, -538, -274, 79, -2, -17, 2791, 71, + -1300, 93, -818, -558, -331, 115, 215, -603, + -202, 113, -87, 39, -277, 3564, 75, -444, + 201, 111, -369, -1072, 212, -276, -322, -484, + -700, 37, -302, 177, 86, 10, -87, 56, + 76, -8941, -27, -73, -133, -51, -106, -28, + -52, 49, 68, 26, 16, -81, -423, 2834, + 7, -54, -107, 144, -3812, 17, -355, 3, + -32, -24, 14, 76, 169, -260, 349, -159, + 3691, -184, 4345, -46, 146, -14, 143, -384, + -75, 12, 144, 105, 47, 141, -32, -31, + 48, 187, 74, 139, 132, 86, -15, -317, + -267, 3112, 1821, -363, -125, -1152, -294, -449, + 277, 1151, -341, 12, -41, 210, -51, 6, + 18, 53, 11, 37, -36, -70, 65, 44, + -7302, 15, -133, 56, 150, 63, 515, 271, + -32, 47, 41, -130, 168, -158, -239, -60, + 226, 247, -593, -237, -3559, 65, 623, 16, + -212, 26, -181, 81, 83, 26, -25, -92, + -5, 36, -31, 277, -263, 135, 78, -173, + 220, -5260, 2239, -96, -19, -95, 75, -25, + -64, 244, -154, -2646, -446, 980, 512, 392, + -402, -1050, 276, -456, -1334, 1863, 636, -1512, + 234, 199, 237, 363, 66, 284, 198, -277, + -267, -540, -329, 856, -482, -645, 178, -240, + -178, 6633, -5, 127, -80, -167, 307, 7, + 248, 13, 53, 124, 215, -310, 255, -194, + -3066, -22, 3524, 51, 193, 165, 82, -80, + 54, -191, -278, -19, 379, 285, -58, -157, + -168, -183, 388, -198, 191, 107, 10, -2, + -6148, 45, -58, 48, -150, -72, 112, -124, + -41, -129, 36, -66, -3311, -4092, 15, -11, + 93, -54, 72, -105, 131, 66, 29, -54, + 201, -210, 221, 47, 55, -99, 31, -3626, + -3623, -175, 91, -53, 40, -98, -76, 224, + 15, 172, 85, 103, -147, -135, -214, -313, + 1304, 143, 190, 19, -2526, -91, -168, 875, + -27, 789, 791, -462, 912, -580, 70, 1523, + 787, -150, 567, 2717, -5, 2943, -107, 155, + 32, 65, 158, 133, -191, -44, 141, -149, + 199, 177, 270, -14, -57, -3669, 3891, -158, + 239, -17, 52, 244, -343, -118, 186, -54, + -134, 106, -133, -116, 186, -149, -894, -22, + -399, 1, 288, -3988, -260, 113, 66, -276, + 179, -226, 119, 420, 51, -483, 551, 129, + 245, 2013, 639, -87, 5058, 41, -53, -116, + -130, -223, -104, -760, 276, 117, 338, -137, + -233, -65, 119, 100, -3245, 2, 3877, 126, + 172, -2, -72, -153, 200, -109, -62, 135, + 194, -82, -150, 98, 550, -251, -274, 71, + 160, 121, -13, -365, 356, -212, -271, 5067, + -203, -251, 222, 75, -131, 17, 103, -911, + -348, -26, 6, 110, 120, -645, 355, -649, + -132, -3416, 65, -1478, 461, -109, 258, -15, +}; + +static const int16_t cb1110m1[] = { + -110, 2743, -31, 86, -11, 3705, 192, -89, + 57, -252, -11, -212, 163, 0, -137, 405, + -99, -124, -137, -407, 125, 106, -922, 1567, + 85, 165, 241, 110, 2918, 598, -443, 812, + 159, 518, 555, -1886, -65, -52, -3, -27, + 56, -30, -126, 126, 23, 74, 157, 6990, + -34, 56, -257, -172, 115, -23, -616, -243, + -441, 34, 159, 6, 78, -119, 49, 34, + -133, 988, -1007, 474, 77, -274, 354, 4907, + 222, -16, 69, -4, 924, -18, 3535, -299, + -38, -83, -111, 977, -138, -1075, -444, 540, + 199, 202, -502, -194, -198, 249, 101, 276, + -89, 96, -301, 6, -4023, -70, 174, 93, + 192, -120, 755, -560, -22, 78, 56, 29, + 28, -44, 65, -4, 0, 49, -250, 87, + 46, 44, -41, -7035, 14, 288, 632, -259, + -64, 20, -178, -343, -274, 106, 2842, 336, + -283, 245, -612, -5, 500, 77, 2492, -250, + 64, 171, -988, 4, -51, -34, -555, -171, + -2629, 272, 2852, -162, -98, -237, -278, -489, + 641, -96, 7815, -139, -116, -137, -121, -314, + -161, 211, 76, 136, -35, -124, -27, 76, + -98, 133, 85, 332, -4352, 507, -14, -275, + -212, 308, 258, 129, -165, -197, -104, -150, + -104, 60, 125, 568, -3, 1694, 62, -70, + 109, 122, -57, -18, 8642, 100, 50, 92, + 17, -86, -93, -68, -121, -61, -32, 27, + -188, 502, 123, -81, 37, 48, 187, 75, + -30, -22, -224, -292, 99, -49, 4273, 10, + 834, -25, 225, 2773, 78, -3281, -181, 234, + -130, -74, 101, 214, -26, -113, -268, -168, + -90, -435, -26, 38, -569, -4009, -1, 11, + 69, 3, 249, 98, 178, 131, 300, -826, + 48, 337, -828, -371, 96, 312, 712, -667, + -70, -2070, -242, 519, -676, 143, -613, 893, + -2193, 471, 1071, 213, -1231, -196, -580, 155, + 401, 78, -64, 27, -238, 22, -73, -19, + 194, 60, -87, -210, -155, 244, -123, -169, + -4442, 169, 3132, -181, 65, 3950, -396, 209, + 39, -52, -26, 166, 1, -164, 143, -66, + 169, 46, -16, -295, 39, 42, 40, 67, + 25, 17, -1, -8920, -82, -42, 49, 81, + -61, 1, 39, -40, 18, 74, 206, -131, + -71, 106, 7, 88, -13, 69, -113, -89, + 212, -4, 4373, -34, 283, 105, 252, 59, + -2578, -298, 1846, -110, -105, -310, -143, -127, + 274, 225, 861, 262, -815, -311, -26, -685, + 243, -620, -374, 2992, -112, -35, 2903, -94, + -56, -213, 65, 383, 41, 508, -258, -103, + -440, -237, 428, 132, 2793, -77, -113, -58, + -19, -3857, -25, 40, -167, -243, -233, -41, + -279, 213, -22, 8, 120, 126, 159, -212, + -244, 183, 1605, 62, -12, -244, 519, 780, + 116, -3197, -992, 341, 222, 681, -357, -669, + 55, 1213, 100, 441, 1, -57, 232, 10, + -114, 318, -147, 89, 188, 448, -327, 3735, + -292, 875, -216, 211, 111, 160, 172, 286, + -3513, -849, -185, -9, 31, 442, 747, -1045, + 187, 704, -219, 509, 48, 69, -25, -10, + 75, 23, 10, 23, -32, 89, 8628, -77, + -19, 27, 0, -232, 22, -50, -1904, -137, + -169, 128, 138, 78, -443, 243, 157, -3809, + 231, 277, -341, 73, -70, 596, 259, 157, + 2197, 575, 2445, 11, -53, 118, -115, 562, + 108, 30, -241, 30, -394, -155, -186, -344, + -237, -319, -2258, 343, -311, 14, 169, 59, + -15, 233, 732, 365, -692, -108, 1416, -463, + -279, -248, -1731, -406, -278, 298, 209, 5333, + -198, -167, 50, 439, 142, 91, -523, 226, + 262, -130, -15, 573, -4, 271, -2, -47, + 7, -9106, -69, -44, -144, -98, 199, -181, + 6, 45, 47, 37, -51, -68, -50, -116, + -105, 49, 376, -420, 187, 2894, 29, -471, + -221, 455, -1, -858, 55, -197, 359, -1972, + -188, 921, -134, 186, -843, -2542, 322, -1, + -158, -352, -307, -578, -60, 143, -1302, 333, + 681, 1373, -1021, 18, 284, -28, 8, -57, + -16, 15, 58, 31, 8389, -35, 18, 77, + -78, 15, 36, 17, -134, -17, 316, -680, + 491, 38, -217, -278, 276, -299, -75, -4030, + -293, -507, -62, -344, 64, -438, -344, -256, + 341, 199, -66, 28, -17, -17, 2, 142, + 6, -48, -169, -27, -117, 6739, 42, -61, + 140, 246, 3357, -3243, 48, -55, 49, 27, + 4, 172, -169, 6, 69, -265, 70, 25, + 223, 28, 129, 231, 57, -1608, 2640, -28, + -197, 29, -11, 138, 621, 427, 20, 514, + 663, 562, 447, -158, -909, 343, -321, -257, + 6641, -1, -20, -70, 62, 241, 51, -83, + -48, -156, -266, -335, -43, 421, 350, 306, + 165, -541, 47, 5, -40, 364, 21, 190, + -4584, -125, -441, 489, -571, -47, -10, 205, + 60, -73, -584, 417, 233, -34, -109, 85, + 41, 134, 485, -171, -183, -1522, 202, 390, + -3112, 144, 1675, 651, 402, 1953, 120, 93, + -276, -1930, -197, -61, 100, 81, -250, -155, + -19, 336, -178, -2340, 88, -543, 226, -2507, + -60, -62, 218, -9, 158, -3617, -66, 32, + 314, -192, -121, 372, 334, 516, 412, 247, + -609, -1237, 312, -120, -39, 47, 61, -63, + -90, 4500, -191, -353, 10, 54, -163, -345, + 121, -318, -235, 190, -99, 181, -3369, 4, + -188, -87, 128, 167, -507, -1132, -666, -354, + 121, 43, -546, 601, -409, 181, -47, -315, + 127, -2845, 487, 186, -2724, 343, 177, -837, + 387, -84, 259, 122, -159, 88, 117, 137, + 79, 126, 1584, -521, -2448, 2648, -246, -75, + 567, 114, 244, 653, -551, -196, -623, 205, + 816, 48, -326, 66, -94, -33, 133, 412, + -241, 491, -32, -712, -249, -3756, -185, -229, + 248, 268, 557, 73, 164, 24, -70, -27, + 54, -156, -51, -47, -26, 43, 187, 179, + -38, -137, 218, 1916, 4614, 435, -15, 21, + 145, 1868, 241, 240, 299, -204, 73, -24, + -118, -372, -89, 23, -298, 479, 2837, 959, + -76, -85, -2, 28, 94, -3245, 28, -130, + 159, 295, 264, -419, -98, -16, -159, 349, + 202, -158, -2680, -210, -390, -18, -8, 364, + 1367, -110, 932, -232, 1348, -80, 865, -291, + -408, 406, -118, 6462, -55, 10, -152, -161, + -132, 231, 258, 135, -13, -104, 247, 207, + -238, 212, -19, -31, -3303, -160, -24, 3402, + 50, 116, -191, 97, -139, -100, 71, -49, + -293, 133, -120, -10, 197, 196, -516, -686, + 79, -52, 6002, -47, 88, -201, 146, 136, + 54, 162, -180, 287, 67, 70, -55, 210, + -1938, 635, -162, 82, -120, -456, -75, -3753, + -83, 176, 137, 18, -6, -281, 232, 137, + -167, 373, 78, -2622, -38, -293, 89, 69, + -3476, 8, 152, 136, 32, -15, -140, 11, + 6, 13, 481, -175, -228, -254, 158, -3423, + 206, 22, 900, 2025, 266, -402, 132, -356, + 558, -592, -262, -419, 1002, 73, -246, -24, + -3145, 3220, -33, 283, 398, -31, -25, -7, + 103, -93, -143, 1, 32, -497, 206, -35, + 1424, 114, 140, 2393, 3245, -218, -163, 113, + 191, -164, -215, 504, -256, 140, -364, -226, + -340, 91, -464, 32, 188, 4, 15, -6068, + 69, 109, 219, 75, 196, -24, -84, -218, + 27, 57, -97, 8, -338, -4, 358, 23, + -52, -68, 552, 4023, -255, 684, 144, 188, + 100, -293, 462, 553, 9, 665, 12, -640, + -5099, -158, -245, -74, -168, 263, -355, -370, + -653, -163, -473, -394, -233, 750, 17, -31, +}; + +static const int16_t cb1110sl0[] = { + -3736, -3737, -18, -285, 383, -144, -155, -204, + 296, -399, -663, 356, -364, 329, -330, -5, + -52, -88, -41, 228, -21, -45, -136, -280, + -109, -86, 57, 91, -212, 158, -106, -90, + -8192, 70, -255, 78, -8, -89, -110, -58, + 104, -51, -2598, 411, -94, -567, 209, -464, + 139, -234, -336, 754, 863, 399, 345, 117, + -3435, -219, 369, 59, -325, 2439, -148, 6, + -48, 84, -14, 71, 94, 10, 6, 73, + 106, -490, -200, 186, 345, -8, 99, -3687, + -1571, 1836, -1593, 1111, -3700, 470, -6, 401, + -182, -119, 438, -263, 228, 785, -361, -56, + -492, 465, 333, 61, 53, 234, -23, -87, + 39, 105, 7282, 59, -47, -57, -77, -45, + -172, 12, 179, -134, 37, -157, -19, -206, + 9, 1186, -264, 600, 350, 374, 115, -55, + 727, -164, -3903, -735, 586, -24, 145, -786, + -118, 943, 514, 396, 3435, -35, 83, 294, + 107, 16, -3636, -93, 360, -307, -105, -172, + 204, 320, -148, 410, 175, 335, 0, -178, + 12, 94, -47, -91, -49, -159, -155, -65, + -17, -159, -316, 64, 155, -260, 81, -4766, + -150, -116, -332, 128, 675, -105, -479, 563, + -101, 101, -379, 33, 37, 1, 106, 151, + 69, 140, -6, -74, 157, -125, -120, -33, + -178, -286, 60, -158, 43, -7291, -295, -68, + -34, -68, -58, 8, 176, -42, -212, 176, + -533, -62, -27, 167, 291, 59, 311, -3050, + 552, -493, -207, 2576, -991, -375, -102, -980, + 1130, -565, -199, 559, -1390, -428, -618, 70, + -437, -245, -1132, -1302, -453, 83, 222, -1555, + -178, -1396, -1176, -228, 730, -3121, -1085, 84, + -326, 71, -185, -315, 889, 803, -2910, -3609, + -639, -199, 187, 137, -622, 473, 121, 181, + 85, 395, 523, 589, 71, 703, 123, 361, + 47, -675, 299, -446, 307, 591, 3341, 64, + 526, -1541, -50, -1369, 701, -144, 1720, -713, + 562, 297, 146, -34, 1315, 956, 761, -415, + -1311, 637, -1263, -1096, -385, 3228, -395, 317, + -354, -503, 255, -526, 245, 598, 853, -269, + -110, 1354, 333, 110, 855, -3346, 635, 636, + -917, -577, 260, 147, 1041, 1273, 385, -862, + 1751, -1099, 80, -148, 120, -118, 5565, -484, + -74, 326, 291, 234, -41, 212, 192, 207, + -108, 198, 118, -389, 178, -151, -252, -69, + -243, -800, 2640, -531, 84, -301, 157, -3428, + 3, -418, -173, -166, -722, 207, 448, -387, + -504, 202, 453, 210, -203, 304, 190, -264, + 101, -23, 36, 74, -146, 26, 29, -33, + 59, -127, 22, 213, -167, 103, 8192, 183, + 2709, -125, 324, -964, -259, -400, -41, -430, + 367, 127, 266, 369, 1081, -190, -220, -1083, + 641, -2733, 750, 525, -623, -18, 3159, 686, + -278, -2083, 1680, 587, 123, -6, -266, 376, + 522, -433, -499, 169, 106, 2041, 174, 571, + -108, 129, -116, -87, -252, 89, -14, 14, + 120, -7874, -204, 15, 19, -110, -82, -54, + 66, 31, 210, 55, 339, 61, -219, -3205, + 1292, 80, 344, -733, 3172, -21, -55, 712, + -192, 38, 408, 489, 388, -343, -763, 438, + -1812, -6, -129, -1392, -382, -28, 105, -284, + -168, -462, -284, 22, 113, 1203, 3253, -589, + -619, 348, 113, 847, 3, -557, 460, -636, + -601, -742, 46, -111, 51, -66, -2867, 551, + 455, 898, 17, 2205, 1004, -46, -1475, -367, + 2849, 766, -32, -119, 624, -722, 3371, 172, + -330, 93, -221, 457, -453, 84, -281, -360, + 108, 487, -301, 166, -2611, 577, 192, 34, + 1105, 705, 34, 29, -3041, -898, 172, 578, + 307, 483, -439, -327, 360, -935, -76, 387, + -2485, 800, 333, 601, -712, -973, -65, -442, + 220, 3577, -428, -210, 565, 757, -382, 289, + 726, -19, -182, 384, -32, 38, -810, -181, + -2978, 259, -213, -473, -187, -823, -279, 1518, + 26, -385, 1143, -409, 1310, 676, -2472, 64, + -391, -102, 455, -5751, 278, 30, 64, -177, + -113, -170, 94, -234, -167, 101, -2, -149, + -131, 351, -254, -138, 149, -42, 631, -21, + 237, 2893, -291, 2917, -1240, 211, -215, 22, + -827, -160, 140, -213, 156, -250, -1233, 691, + 498, -30, 350, -28, -12, 217, 34, -348, + -70, -140, 103, -60, 353, -200, -314, -74, + 112, 4435, -80, -287, 413, -99, 1407, 1519, + -2230, 114, 3179, -523, 39, 340, -379, 373, + -1552, -138, -446, -106, -762, -1017, -297, -183, + 498, -481, 374, 271, -5609, 297, 98, -378, + 187, -78, -125, 333, 114, -81, 62, -145, + 14, 362, 518, 134, 195, 130, -34, -72, + -3088, -2965, -114, 585, -78, 6, 552, -633, + -98, -224, 980, 338, -83, -1064, 42, 106, + -119, 644, -293, 496, 67, 128, -129, 620, + 20, 526, -177, 68, 351, -3703, 1465, 905, + -245, 86, 511, 39, -512, -150, 239, 86, + 60, 39, -79, -9, -65, 77, -7993, 57, + -19, 56, -38, 161, -221, -129, 8, 93, + 52, -5622, -114, 133, 26, 64, -194, -316, + -143, 225, -66, -81, -74, 240, 130, 137, + -549, 11, 352, -53, -4029, 513, 3164, -205, + 127, 80, -193, -197, -36, -885, 223, -858, + 5, -458, 290, 459, 247, -284, -176, -748, + 173, 191, 114, 406, 126, 3, 91, 84, + 8027, 379, -56, 47, 35, 246, -143, 65, + -36, 8, 59, 67, -69, -421, -3492, 312, + -252, 261, 3367, 319, -67, 77, -346, 386, + 34, 237, 18, 111, 348, -547, 186, -93, + -3558, -178, -3801, -133, -27, -561, -308, 112, + -224, 272, -195, -270, -179, -165, 199, -524, + 681, -117, -429, 37, -5891, 94, -55, -433, + -354, 122, -60, 67, -200, -80, 267, -136, + -42, 130, -324, -25, 156, 167, -47, 178, + 8, 289, 157, 88, -28, -39, -262, -11, + 9, -113, 76, 8192, 89, 115, -298, 137, + 34, 0, 261, -30, 49, 274, 130, 824, + -944, -56, 1074, -314, -76, 527, 75, -3321, + 733, -798, -352, -1038, 1049, 72, -233, 312, + 3363, 69, 104, -149, 22, 283, -20, -101, + -3350, 164, -328, -362, -993, 430, 78, 125, + 269, -29, 362, -73, -30, -1189, 1396, 59, + -1285, -216, -121, 3893, 84, -464, -38, -113, + -369, -181, -930, -1012, 394, 120, 274, -552, + -800, 105, -141, -12, 241, -667, 543, -416, + 28, -182, 51, 905, -3964, -1213, 12, -271, + 378, -234, 838, -113, 56, 567, 35, 48, + 490, -180, 1097, 170, 2596, -28, 3098, -220, + 424, 885, -42, 783, -30, 907, 63, 46, + -131, 28, -55, 54, -46, -25, 30, 58, + -15, -200, -6, 11, -70, 66, -8089, 86, + -136, 96, -56, -101, 300, -661, -41, -201, + 760, -252, 955, 189, 1459, 3562, -457, 35, + -54, -164, -329, -1245, -830, -365, -399, -23, + 616, -238, -1301, -198, 335, -3400, 149, 175, + -97, -279, -594, -92, -915, -830, 468, 628, + 728, 1024, -549, 1073, 222, -142, 296, -75, + -168, -5, -67, -7311, -50, -256, -321, 121, + 358, -272, 30, 258, 105, -161, -291, 462, + -7, -211, -227, -104, -151, -152, -72, -98, + -59, -23, -98, -203, 103, 89, 239, -484, + 7749, 110, 35, 345, 282, -578, 140, -51, + -62, -238, 102, 454, 64, -107, -223, -174, + 285, 110, -190, -16, 1624, 142, 3813, -849, + 43, 234, 84, 0, -132, 131, -135, -70, + -1, 125, -83, 171, 109, 8044, 97, -38, + 143, 64, 13, 4, -225, 181, 712, 626, + 20, 167, -467, 186, 3801, -2179, -647, -119, + -112, -183, -223, 295, -438, -407, -29, 36, + -34, 2536, -47, -402, -33, -62, -136, 2444, + -152, -717, -868, 86, -2323, 931, 659, -1281, + -98, 638, -162, 195, -5, -40, -88, 3019, + 3466, -323, 316, -784, -715, 5, 188, 42, + 155, -608, 500, 185, 475, 100, -51, 879, + -891, -158, 18, -453, 380, -207, -143, 401, + -153, 926, -184, 2775, 3176, -797, -198, -888, + 405, 460, 309, 304, -114, 2386, 2319, 658, + -2200, 216, 435, -1210, -655, 154, 81, 538, + 908, 220, -118, 482, -864, -526, -241, 857, + -473, 774, -288, -886, 46, 250, -96, 301, + 120, -488, -128, -233, 422, 38, -3416, -974, + -243, -226, 381, 2394, 652, 3124, -205, -1303, + 1484, -159, -152, -1037, -105, -121, -466, -76, + 605, 181, -55, -326, -527, -126, 1691, 1316, +}; + +static const int16_t cb1110sl1[] = { + -743, -300, -347, -441, 85, 5282, -250, 32, + 28, -306, -434, 78, -178, -112, -28, -162, + -188, -43, 17, 94, -242, -258, -2691, -471, + -556, -815, 120, -57, -36, -325, 3282, -765, + 355, 2, -162, -454, -72, 192, 86, 219, + -123, 237, 135, -42, 492, -471, -114, 5146, + -164, 28, 77, 70, 276, -148, 333, 64, + -89, -46, -135, 474, -218, -119, 351, 7619, + 93, -80, -84, -51, -110, -223, -13, -116, + -160, -102, -64, -140, -376, 156, -143, -421, + 105, 102, 519, 1256, 786, -284, -3029, -3021, + -365, -515, -1358, -273, 394, 489, -242, 31, + 239, -1328, 169, -488, -3069, -398, 303, -274, + 498, -2758, -748, -208, -324, -285, 78, -386, + -1063, 298, 5, 693, 160, -629, 1656, 186, + 457, 742, 422, -3723, 1997, 1025, -24, 291, + -588, 16, -327, 459, -521, 421, 1279, -408, + -2, -1320, 101, -372, -66, 100, -605, 3214, + -374, -660, -371, 207, 175, -553, -574, 2962, + 119, -551, -140, -62, 50, -608, -237, -100, + 108, 101, 3258, -31, -45, 375, -161, 132, + 2842, 1458, 235, 800, -113, 719, -291, -29, + -512, -267, 53, 780, -59, 3387, -175, 88, + -78, -475, -536, 584, -3025, -19, -105, 91, + 875, -55, -771, 143, 384, 810, -372, -253, + 160, -128, 232, 98, 7755, 181, -19, -177, + 46, -39, -30, -212, -289, 75, 127, -114, + 80, 79, 325, -128, -436, 2547, -73, -29, + 1046, 344, 3340, -335, 458, 637, -175, -695, + -366, 294, -322, 564, 542, 209, 524, -62, + 444, 2827, -53, 66, -959, 84, 484, -147, + 158, 259, -479, 3216, 232, -68, 583, -810, + 107, 93, 629, -168, 143, -552, 96, -71, + -3903, -438, 335, -133, -186, -278, 73, -575, + -253, -733, -91, -8, -1149, 350, 140, 12, + 3935, -236, 103, 469, 610, -536, -305, 3112, + 13, -182, -686, 637, 525, 327, 102, -49, + -450, -16, -480, 233, -82, -132, -3979, 426, + 757, 54, 152, -701, 513, 2330, 148, 242, + 1709, 162, -168, 146, 0, 891, -644, 109, + -549, 104, -50, 275, -193, -55, -144, -117, + 31, -234, 68, -5369, 72, 54, 54, 119, + -140, 192, 286, -42, -278, -3524, -3609, 692, + -366, -15, 343, -885, -267, 294, -387, -215, + -83, -469, 790, 85, 428, -613, 114, 634, + 279, -570, 616, -813, -117, 3073, 3121, -717, + -200, 285, -1061, -44, 945, 386, -166, 494, + 776, 36, -25, -444, -260, 407, 3885, 1049, + 1348, 185, 454, -136, -2275, 1064, -271, -316, + 645, -1050, 483, 430, 32, 569, -676, -335, + -328, -2982, -370, 50, 189, 155, 1058, -119, + -407, -310, 461, 3293, -604, 195, 48, 68, + 196, 194, 547, -210, 785, -383, -410, -268, + -149, 192, -88, -13, 20, -80, -5146, -86, + -111, 40, -36, -138, 12, 239, -36, -84, + -512, 149, -237, -672, 3477, -3446, 1198, 220, + 146, -747, 242, 48, -146, -196, -335, -777, + -405, 620, -340, -367, -389, -108, -27, -184, + -2024, 518, 241, -104, 417, -1356, -1961, 134, + 3221, -423, 286, -60, -110, -568, 14, 76, + -144, 159, 704, -410, 542, -43, 223, 105, + -154, -141, -84, -132, -271, -235, -285, -248, + 480, 430, -4711, -487, -86, 482, 80, 46, + -239, -93, -115, -54, -1, 7, 97, -12, + 151, -180, 159, -63, 65, -215, 54, 5712, + 2886, -115, -236, 113, -25, -301, -450, -276, + -78, 197, -55, -278, -511, 163, 3442, -910, + -74, -225, -103, 63, -204, -43, -126, -334, + 223, 192, -131, 202, -83, 5000, -66, 441, + 33, 0, -116, 237, -238, -37, 445, -48, + 7, -1855, -1154, -251, -117, -185, 125, 1877, + 375, 388, -904, 202, 649, 376, -3231, 897, + 101, -637, 376, 16, 1, 845, -550, -610, + -380, -1363, -955, 71, 1303, 296, -264, -584, + 247, 3247, 98, 1035, -670, 416, -2008, -448, + -56, -169, -1787, 3314, 408, 2541, -833, -2, + -169, -184, 193, -575, -81, 410, -293, -478, + 21, 194, 223, -111, 4648, 60, 354, -593, + -2429, -671, 150, -350, 151, -448, -5, 386, + -441, 131, -339, 87, 815, 279, 51, 131, + 56, -3194, -170, -3899, -297, 270, 21, -215, + 7, 205, -305, 141, 577, 83, -289, -502, + -66, -96, 433, -106, -685, -194, -82, 33, + 98, 315, 258, -2453, -2957, 608, 672, 152, + -681, 1804, -74, -459, -423, 114, -1183, -100, + -798, 357, -79, -3418, -676, 580, -1637, -506, + 306, 437, 1001, 731, -885, -1276, -583, -359, + 650, 15, -189, 190, 86, 39, -7987, -133, + 324, 174, 22, 86, -144, -125, -43, -81, + -49, 68, 39, -204, -159, -291, -217, -68, + 264, 193, 406, 247, 27, -272, -168, 536, + -5740, -141, 38, 18, -7, 258, -111, 125, + 476, -364, 5, 72, -2668, -197, -605, -671, + -82, 201, -752, 227, 240, 345, -11, -138, + 551, -351, -228, -2774, -132, 1115, -1038, -18, + 791, -3136, 81, 219, 357, 755, 579, 26, + -3129, -398, -719, 193, 495, 290, -1123, 854, + -381, -535, 33, 232, 2340, -4577, -94, 1023, + -117, 39, -54, 15, -161, -860, 64, -209, + -597, 415, -135, -407, 1068, 894, -784, 108, + 267, 7506, 140, 67, 198, 74, 52, -388, + -184, -24, -54, -24, 172, 172, -50, -184, + -113, 164, 128, -39, 252, 90, 356, -313, + -90, -313, -355, -73, 19, 139, 141, -122, + -231, -4548, -157, -227, 47, 231, -421, 60, + -80, -3619, 4252, -354, 69, 148, 336, 446, + -183, 86, 248, 35, 73, 120, 157, 156, + -291, -523, 35, -264, 3434, 189, 495, -59, + 533, -343, -554, -3014, -415, 17, 436, 552, + -240, -394, -761, 43, -766, 46, -1119, -254, + 1540, 195, -298, -833, 45, -93, 61, 40, + -171, 167, 82, 107, 16, 40, -166, -46, + 120, -185, 13, 151, 8151, -235, 92, -23, + 214, 206, 260, 93, 163, 78, 184, -60, + -12, -171, -499, -151, -219, 11, -221, 221, + 3253, -376, -1079, -481, 763, -257, -120, -10, + 34, -640, 341, -2953, 528, 567, -672, -335, + -175, -61, 581, -260, 1159, -802, 1070, 12, + 168, 2305, 291, 203, -15, -569, 3247, -179, + 620, 339, 224, 710, -416, 512, -86, 571, + 439, -167, 571, -72, -144, 236, -382, 11, + 268, -176, -136, -337, 220, 64, 341, 361, + -4474, 25, 385, 453, -153, 89, -572, 245, + -197, 33, 75, 588, 51, -199, -74, -149, + 224, 210, 4689, 282, 20, -47, 129, 221, + -72, 27, 76, 93, 331, 215, -5, -20, + 74, -80, 169, 126, -40, -137, -24, -8101, + -23, 165, 271, 403, -34, -19, 290, -199, + -14, 205, 657, 301, -885, 2457, -1965, -2266, + -1004, -224, -554, 182, -220, -467, -611, 1012, + -122, 3303, -73, -205, 93, 3549, 217, -223, + 55, -459, 541, 286, -46, 128, 354, 137, + 824, -313, 32, 301, 139, -492, 170, 136, + -35, -752, 4613, -830, -34, 41, 344, 279, + 643, -394, -461, 163, -330, 199, -215, 83, + 1096, 613, -473, 816, 3534, 210, -772, 935, + -275, -600, -341, 602, 104, -598, -217, -789, + -2428, 870, -351, 474, 50, 321, -148, -2929, + 25, -135, -46, 11, -566, -3057, -664, 700, + -300, 256, -960, 350, -480, 414, 431, 24, + -51, -228, 407, 142, -321, 316, -290, 149, + 56, -84, -359, -118, -4948, 138, 373, -49, + 142, 71, -163, -13, -279, 38, -121, 35, + -47, -70, -43, 116, 3, -159, -11, 97, + -116, -62, 156, 307, -173, 7294, -143, 288, + -34, 671, 613, 16, -240, -229, -414, -494, + -43, -169, -854, 336, -991, 719, -353, -163, + -750, 2685, 2837, -558, 129, 2076, -47, 641, + -37, -93, 226, -69, 598, -284, 127, 106, + -426, -555, -947, 485, 54, -3175, 622, -341, + -544, 278, -205, -689, 391, 238, 9, 152, + -233, -392, 28, 36, -394, -1059, 132, 3761, + -480, 87, -656, 1304, 478, -272, 65, -147, + 91, 520, -896, 166, 62, -30, -28, 194, + 542, 3, 625, 1795, 3613, 1097, 1030, 906, + 400, 133, -127, 219, 958, 93, -546, -702, + 2937, -524, -270, -767, -192, 725, -897, -643, + 2502, 141, -1147, 257, 279, 470, -3001, -104, + 79, 508, 450, 265, -21, -74, -437, 647, + -2755, -407, -816, 620, 24, 537, -668, 604, +}; + +static const int16_t cb1110ss0[] = { + -8187, 90, -694, -168, -452, -4, -259, -332, + 352, -554, 43, 389, 236, 508, -175, 461, + -277, 118, 651, -245, 696, -1423, 368, -1417, + 1782, 1650, -540, 27, -461, 516, -599, -185, + 422, -11, -181, 19, 1809, -3226, -839, -191, + 468, 180, -550, 198, 2487, -923, -1335, -1008, + 1029, 1716, 588, 371, 902, -1214, 179, 1026, + 1560, 1815, -1714, 1230, -712, 1675, 1867, -154, + -2860, -484, 2289, -1018, 33, -1494, 614, -2340, + -724, -1088, -1930, -775, -876, 642, -1358, -144, + -2518, 62, 543, -1049, -1081, 672, 1305, -1506, + -86, 2920, 518, -1836, -546, -132, -45, -642, + 381, -404, -2206, -1211, 698, -703, -667, -606, + -677, -2246, 526, -1157, 177, 510, -1420, -617, + -1819, 1710, 1631, 1049, -1697, -495, 961, -1250, + 39, 482, 445, -956, -71, 977, 426, 1826, + 286, 36, 295, 1786, 794, -3456, 1645, -766, + -1580, -2435, 1108, -286, 731, -659, 960, -1759, + -978, 316, -350, 91, -35, -222, -1417, -53, + -529, -679, 681, -4700, -524, -39, -350, 196, + 199, 191, 653, 1344, -942, -428, 156, 173, + 636, -1538, 1795, 1709, -190, 1265, 164, 650, + 2302, -1757, 1762, 413, -851, 44, -1371, 343, + -3845, -122, 1864, -489, 601, -748, -402, 590, + -124, -1988, -1536, -999, 399, -753, 295, -384, + -1316, 55, -669, 262, -1157, -3766, 992, -111, + -2928, -1424, -98, -62, -334, -1848, 377, 1560, + 947, 1568, 1554, 206, 664, 2014, 2098, -164, + -640, -2897, -647, -1675, -2307, -254, -555, -2426, + 1497, 465, -1525, -1148, 55, 632, 554, 2068, + 451, -1532, -715, -2065, -1177, -623, 478, -88, + -1140, -72, -450, -248, -1111, -250, 1356, 2717, + -1841, 420, -1299, -1715, 746, -101, 600, 1130, + -903, -473, 1225, -876, 193, 694, -193, -482, + -1838, 94, 157, 1131, 267, -242, 2021, -39, + 795, -285, 438, -4322, 1097, -621, -518, -338, + -289, -114, -671, 1700, -477, 449, -1664, -693, + 1403, -3629, 1480, -991, -234, -213, 354, -269, + -1140, -40, 1455, -758, 1273, 497, -686, -945, + 59, -66, -769, -2930, 2343, 2452, -1576, 995, + -734, 1009, 98, -350, -1116, 545, 189, 99, + 566, -916, 20, 117, -807, 986, -428, 177, + 1247, 485, -680, 1139, -1263, -256, 4828, 89, + 27, -1339, -1091, 149, -641, -703, -570, -112, + 346, -93, -641, -97, -991, -2247, 2284, 847, + 2110, -1393, -315, -1468, 514, -1493, -46, 1135, + -1231, 39, -913, -278, -762, 1775, -684, 735, + -1676, 386, -2030, 2534, -2371, -1661, 1204, -111, + -8, -607, 1233, -1532, -1263, 1530, -537, -1728, + -335, 269, -614, 12, -1187, -770, 471, 373, + 4743, 12, 197, 610, -101, 417, -350, 551, + 544, -898, 387, -682, -1216, 126, 96, 94, + -268, 535, 126, -778, 1595, -1379, 3366, 49, + 460, 1772, 198, -896, 75, 253, -1376, 68, + 838, -1121, -578, -630, -718, -975, -565, 1303, + 354, -769, -38, -246, -193, -408, 41, 165, + 374, -87, -155, -8, -746, -430, -869, -1842, + -385, 281, 5119, 432, 1119, -807, 1756, 816, + 131, -548, -528, 1347, 478, 1482, 2942, -290, + 650, 1012, 163, 840, -804, 94, 2507, 1514, + -953, -289, 23, 1128, -895, -1009, 1871, -370, + 699, 659, -3069, -695, -1559, 1435, 672, 94, + 1496, -637, -2208, 1083, 688, 485, 251, -828, + 1313, -21, -1948, 230, -603, 783, -829, 524, + -1142, -3845, -1383, 323, 1295, 732, 759, 591, + 68, -1869, -756, 1727, 339, -1565, -510, 2623, + 358, 3071, 281, -790, 1129, 243, -588, -431, + 492, 372, 96, 890, -935, -727, -236, -416, + 171, 226, -1090, 1257, -1063, -303, -817, -1506, + -947, 2282, -659, -406, 79, 772, -816, -2610, + -1802, -1019, -816, -1886, -1306, 1365, 624, -2314, + -57, 1012, 215, -130, 3404, -864, 959, 202, + -26, -1015, -1212, -34, -408, 3494, -284, 845, + 275, -1005, 458, 840, -2258, -13, -129, 2536, + 1269, 1216, 2071, -243, 624, 584, 2192, 720, + 604, -1397, 766, 984, -1050, 157, -246, 438, + 240, -587, 1251, -649, -22, 33, 5818, 608, + -996, 474, -523, -454, 1252, -791, 631, -465, + 663, 452, 1793, 853, 39, 3732, 758, -1329, + 11, 2217, -136, -540, 1335, 65, -2047, 943, + 701, 1886, 2085, -890, -16, -184, 325, -1077, + -271, -1246, 391, -1686, -651, -77, 319, 292, + -160, 1204, 1093, 776, -310, 1512, -1196, 149, + 46, 593, 1738, -566, 97, -3667, -485, -683, + -121, -216, -149, -344, 406, -989, -311, 383, + 979, -828, 394, -22, -5143, -1368, -18, -433, + 359, 607, 996, -1144, -229, 1365, -1243, 413, + -591, -621, 803, 1356, -625, 1149, -234, 182, + -1285, -2487, 359, 2640, -1426, -66, -688, 237, + 1307, -361, 108, 207, 1026, -500, -1156, -1043, + -2192, -2232, 1790, 1135, 1742, 1494, -1156, -698, + 2520, -2596, -620, 431, 748, 88, 912, 832, + 1122, -483, 1837, 1821, -826, 1112, -424, -306, + -750, 1085, 260, 152, -114, -1065, -4518, -300, + -976, 143, 1452, 1395, 1677, 59, -51, -1072, + 868, -171, -26, -914, -109, -2420, -48, 69, + -230, 630, -522, 2274, 1265, -1612, 2570, 836, + -2042, -1922, 2970, 775, -320, -2486, -2935, 553, + 178, 994, -1054, -1321, 699, 749, 1002, 513, + 586, 1550, 35, 654, -995, 1743, -1049, -405, + -3431, 1943, 700, 555, 111, -67, 1007, 111, + -57, 661, 404, -628, 425, 2185, 860, -516, + -523, 452, 238, -1778, -378, -721, -2197, 218, + 864, -1031, -832, 135, -2543, -447, 789, 1117, + -1491, 120, 1294, -702, 627, -412, -902, 404, + -1843, -786, -597, 900, 1963, 22, -843, 1168, + -1045, -797, 764, -423, 329, 2308, -1950, 331, + -1090, -2466, -483, 2023, -3363, 2126, 495, 2812, + 1922, -1488, -1041, -798, 135, 408, 33, 563, + 1333, -36, -2181, -787, 709, 287, -971, 93, + -459, -975, 2412, 280, 2555, 32, 2217, -1825, + 650, 313, 585, -947, 1170, 45, 1108, -435, + 1092, 220, -155, 512, 460, 211, -231, -627, + -836, -2205, -181, -113, 130, 226, -321, -765, + -1327, -1190, -676, -357, 691, 232, -365, -1818, + -3007, 2210, 997, 601, 2156, -782, 1626, -1081, + -49, -616, 685, -12, 40, 3480, 563, 515, + 245, 51, 290, 1227, 171, -1078, 520, -483, + 280, -1517, -1331, 2132, -1176, -1381, -1546, 1436, + -852, -505, 672, -807, 623, -244, -125, -1958, + 516, 798, 1185, 922, 441, 651, -610, -1430, + -1887, 114, -869, -2024, -1627, -2276, 2008, -1224, + 125, -609, 371, -1104, -506, -942, -624, -478, + 197, 141, -242, -1051, 1532, -1269, 666, -1055, + 1689, 444, 1720, 16, 301, -2311, 1196, 1108, + 1298, -564, -1197, -1858, 439, -198, 324, -1884, + 3193, 2281, 201, 587, -2028, 1969, -1087, -352, + -87, -632, 144, 165, 68, 1150, 173, 478, + -837, -470, -464, -195, -205, 2111, 15, 643, + -453, -339, -1128, -1368, 1182, 822, 654, -2331, + -1668, -215, -678, -2460, 1169, -664, 777, -348, + 2570, -767, -563, 254, 562, -557, 4, -97, + 1990, 373, -780, -677, 1996, -1527, -365, -416, + -325, 587, 910, -3780, -553, 104, 1705, 240, + -719, -1717, 2765, -582, -76, 399, -1152, 2379, + 3169, -1153, -725, -35, -1214, 362, 1600, -724, + 424, -722, 472, 872, 694, -126, -1649, -1314, + -1814, -95, -312, -34, 780, -884, 824, -864, + 526, -100, 3820, -56, -452, 43, 564, 487, + 177, 890, -1423, 894, -552, 1438, 204, 1015, + -4, 327, -3327, -433, -335, -869, 1312, -488, + -1287, -169, 2018, 435, 73, 508, 1160, -1060, + -134, -1304, -341, 623, 125, -15, -1120, 108, + -71, -1487, -189, -3640, 1424, 1740, 1116, 579, + 1603, -3294, 1241, -225, 1481, 2775, 1326, -242, + -632, -1560, 563, 559, 138, 115, -557, 2004, + -1771, 717, -1052, -1115, -1634, 889, -441, 1954, + -164, -1507, -1312, -407, 662, -867, -896, 225, + 2576, -224, -107, 237, -694, 859, 192, -1033, + 2255, -1225, -891, -1994, -90, 339, -382, -774, + 1460, -1553, 648, -521, 2370, 160, 714, 54, + -906, 1435, -1752, -274, -523, -36, 1208, 1553, + -339, 1000, -178, 209, -1001, 916, 495, 310, + 726, 127, -391, 107, -513, -1052, -376, 297, + -307, 933, -233, -253, 1196, 4619, -1278, 762, + -13, -387, -973, 2153, 68, 362, -887, -1922, + -106, 298, -1127, -2601, -2184, -111, 111, -1588, + 1002, -365, -2226, -290, -599, 610, 551, -1368, + -4344, 618, -172, 349, -914, -530, -192, 718, + 348, -675, -884, 913, -94, 215, -834, 353, + 753, -811, -84, -905, -128, -483, -1782, -1255, + -2333, -1110, 477, -566, 346, 2018, -1644, -325, + 1365, -1223, 158, -1786, 566, 203, 742, 281, + -555, 573, -978, -459, -1671, 378, -689, 349, + 606, -5961, 562, -13, -223, -419, -442, -447, + 125, -1052, 53, 2594, -1377, 209, -1549, 533, + -118, -2538, 1808, -364, -37, 1221, 607, 593, + 309, -240, 1574, 254, 434, -141, -220, -2018, +}; + +static const int16_t cb1110ss1[] = { + 631, 3041, 1215, 2376, -1843, -103, 750, 144, + -87, -249, 715, -201, 758, 202, -197, -135, + -523, 1243, 457, -717, -700, 1662, 918, -48, + -1008, 180, 411, 948, 2192, 2607, -826, -962, + -1130, -59, -1047, -305, -325, -1032, 2096, -287, + 395, -1543, -268, -1218, -2045, -1674, 951, -1846, + -636, 263, -138, -287, -327, -2208, -664, 496, + 2179, 1645, 340, -601, 473, 670, 950, 2774, + 364, 613, -1896, -1876, -3177, -105, 506, -164, + 281, 718, 2419, -1077, -50, 365, -1631, -134, + -384, 231, 767, -285, 1268, 321, -1408, 217, + -409, -725, 1225, -2551, -2622, -274, 473, 2752, + -11, 342, -495, 1627, 79, 240, 2, -1021, + 640, -508, -269, 648, -116, -1283, -217, 13, + -1674, 2402, -879, 1791, 2753, 2386, 1195, -700, + -282, -428, -671, -92, 1187, -672, 1037, -1913, + 246, -816, -69, -2284, -712, -996, 2498, 902, + 809, -149, 66, 775, -44, -566, 955, -1073, + -1438, -894, -978, 274, -390, 5528, 1153, 17, + -750, 63, 545, -725, -301, -323, 661, -813, + -347, 739, 335, 136, 203, 342, 802, -199, + -818, -679, -282, 2195, -1714, -757, -154, 182, + 132, -1737, 405, 2394, -3727, 1349, 213, -193, + -2495, -1354, -629, -1171, 1429, -16, 834, -1260, + 160, -1892, 874, 1754, -567, 344, -3499, 1612, + -987, -424, -997, -1640, 594, 1058, -783, 511, + -604, -1480, -1754, -424, 2262, -1991, 1297, -638, + 350, -588, -55, 1483, -456, -567, 146, -946, + 731, 1541, -759, 592, 1231, -270, 171, -1975, + -2707, -456, -227, 392, -891, 1008, -1066, -487, + 231, 1372, -51, -599, -227, 696, -820, 354, + 1928, -48, -1302, -570, 316, -283, -848, 2563, + -266, 2821, 540, 553, -1272, 1120, -1164, -451, + 384, -1058, -1018, 1735, 992, -1220, -83, 1490, + 2304, 122, 1630, 1108, 1997, 2346, -647, 301, + -1746, -218, 313, 462, 1486, -536, -508, -463, + 104, 930, 605, 2116, 793, 2881, -724, -1379, + -53, 4458, 793, 275, -180, -516, -489, -774, + -265, 704, 112, 175, 112, -121, 652, 310, + 564, -440, 773, 1885, 927, -672, -773, 1726, + -614, 818, 1589, -372, -207, 499, -894, 987, + 796, 652, -1228, -4010, -2208, 458, 645, 498, + -279, -852, -1897, -1820, -35, 674, 201, 474, + 77, 94, 2327, 723, -1081, 261, 209, 1179, + -1175, 623, -1293, 2154, -117, -3707, 940, 813, + -1059, -335, 1306, 525, -191, -2066, -425, 19, + -366, 529, -145, 822, -913, 254, 424, -354, + -167, -2437, -1433, 603, -318, -1517, 4250, 541, + -1360, 450, -531, 200, 534, 1200, -222, -535, + -162, -1211, -116, -144, -462, -139, -482, 511, + 2068, -2100, 971, -1487, -1050, -3150, -701, 119, + 16, 1535, 272, -1184, 2242, 488, -492, -915, + 1660, 212, -826, -444, 1003, 2705, 3591, -174, + -333, -431, -59, -903, 61, 751, 1087, -45, + -1031, 617, 686, -15, 848, -348, 947, 396, + 931, 1785, -552, -920, -669, -63, -1869, 2357, + -1549, 807, 889, -1581, -1071, 1587, -1108, 1300, + -658, -625, 300, -285, -977, 1656, 4183, 1487, + -191, 658, -300, 497, 1378, -300, 1031, 322, + 114, -449, 666, 1250, 264, 125, -109, 748, + -503, -40, 199, -1212, -1643, -2522, 151, 121, + -1128, -3200, 876, -446, 878, -989, 1510, 2261, + -1507, 1793, -402, 30, 228, -50, 985, -1568, + 755, 1559, -688, 1342, -423, -1507, 96, -501, + 474, -2926, -2493, -131, -656, 450, 1035, 812, + -14, -933, 941, 1396, -957, -621, -516, 379, + -225, -2063, -2048, 669, 287, 1688, 1727, 299, + -658, 852, 745, -260, 993, 158, -1236, -1422, + 33, 611, -112, -323, -194, 839, -1407, -1505, + -2010, 1267, -355, -675, -3779, 768, -228, -643, + 661, 1313, -529, 962, -948, -212, 1043, 1560, + -174, 1744, -938, 289, 1942, -2228, -1932, 1056, + -590, -940, 922, 601, -853, -791, -637, -2, + -52, -83, -209, 1422, 856, -1141, 2500, -1195, + 773, 1087, -1389, 409, 439, -3674, 453, 1637, + -15, 1013, 2635, 1530, -1104, 440, 895, -210, + 1118, -6, 45, 65, -1110, -3307, -331, 478, + -155, -410, -721, -1234, 129, -971, -1117, -27, + -1132, -1289, 1888, -1112, 203, -1091, 442, -2207, + 501, -343, 468, -52, 385, 269, -3102, -366, + -469, 391, 505, 176, 356, -69, -929, 1155, + -280, -1264, -897, 1006, -494, 155, 36, -627, + 924, -816, 154, -750, -837, 5263, -1099, 91, + -481, 71, -681, -574, 1229, 675, 1217, 1073, + -695, 274, -381, -140, 1372, -524, 1164, 341, + -149, -856, 793, -1294, 981, -961, 371, 1178, + 1463, 373, 1375, -4384, 239, 136, 67, -1196, + -126, -1001, -228, 150, 437, -1830, 477, 498, + 4246, 793, -661, 260, -1810, 1405, 76, 902, + -844, 908, 1830, 27, -124, 257, 765, -98, + 592, 487, -132, 202, 675, -669, -679, 1309, + -4002, -206, -66, -390, -253, -190, -921, -83, + 1411, -417, -2560, -646, 1853, -148, 548, -370, + -723, 959, -906, -3058, -276, 467, -1280, 970, + 687, 484, 506, 1143, -1509, 828, -2169, 2931, + 1322, -579, 1033, 209, -979, 217, -434, -1438, + 314, 2384, -906, -29, -1478, -31, 574, -373, + 1478, -124, -680, 330, 794, -753, -977, 1151, + -1190, -1479, -642, 1658, -2201, -1469, 1589, 587, + 52, 1298, 2092, -1483, 678, 1988, 918, -648, + 328, 2096, -1090, 2153, -1416, 295, 537, 261, + 398, -1389, -399, 1105, 10, -395, 1169, -431, + -423, -1617, 766, -1900, -3205, 131, -746, -852, + 2215, -317, -232, 1079, 293, -727, 50, -446, + -713, -897, 768, -896, -667, -281, 377, 115, + 1695, -4870, 713, -393, 251, 1268, 477, -497, + 294, 18, -359, 556, 308, -752, -863, -216, + 151, -163, 695, 587, 810, 2107, -107, 921, + 1203, -472, 1280, 372, 110, -581, -225, -714, + -58, -2587, -1980, -186, -372, -1410, -1504, -1020, + -745, -88, 2373, -568, -2841, -2041, -1841, 2065, + 389, -430, 1163, -208, 569, 375, 650, 317, + 1114, -1036, -959, -896, 1060, 1014, -599, -1743, + 1121, 808, 1556, 326, -2876, -1556, -1283, 384, + -1102, 378, 1433, 702, 1454, -1243, -725, 224, + -610, -455, 1413, -1747, -2516, -572, -1455, -313, + 231, 780, 1531, -2475, -34, 921, -1650, 269, + 818, 5, 835, -209, -911, -432, -1104, 165, + -1638, -46, -2031, -445, 1308, 1519, -1992, 1606, + 956, 757, 1139, 116, 829, -1376, 209, -893, + 963, -569, -466, -185, -1345, 1524, 1714, 269, + 219, -161, 482, -1178, -3621, -831, -668, 1871, + -529, -983, 558, -818, 81, 555, 33, -473, + -187, 113, 899, -577, -1093, 1408, 902, -258, + -111, -648, 4340, -780, -651, 789, -92, 2310, + -401, 669, -213, 369, -104, -820, -290, 48, + -917, 71, 1070, -239, -744, 891, 23, -5130, + -761, 312, 319, 842, 280, 78, -149, 352, + -594, -361, 354, -906, 42, -1610, 835, 157, + -631, 1100, -297, 1081, -96, 484, -825, -2132, + 549, 1305, 128, -314, -1733, -265, 1285, -4061, + -348, -136, -940, -507, -232, -1511, -876, 78, + 2120, 175, 2216, 1179, 497, 335, 350, -18, + -1307, -387, -2207, 587, 3209, -370, 1155, 1501, + -1687, -796, -1417, -733, -269, 801, 83, 1173, + 718, -2702, 19, -315, 4501, 1025, -365, 348, + -417, -510, -172, -1201, 1478, 671, 1933, 1759, + 676, 416, 30, 400, 531, 351, -1176, -2807, + 1969, -1398, 1159, -568, 754, -149, -1880, -274, + -1203, -43, 1391, 383, 702, 2116, 1299, 1952, + 646, -719, 1735, -986, 100, -956, 1040, 2287, + -1606, 612, 1760, 733, -2453, 531, -14, -1, + -3214, -1993, 371, 227, 45, 2011, -531, 1089, + -1029, 282, -2426, -525, 989, -469, 285, 1787, + 927, -335, 1127, -305, 1143, -412, -1626, 1759, + -2567, -82, 1170, -3051, 1266, 1522, -124, -1935, + 552, 1122, -51, 347, -674, -360, 1183, 223, + 3015, 955, -826, 1108, 2325, 868, 1152, 1079, + 223, 217, -428, 382, 642, -2849, -767, -70, + 407, 147, -392, -407, -55, -508, 1785, -683, + -885, 851, 3879, 471, -674, -231, 1493, 1621, + -1698, 528, 623, 300, 1367, -588, 816, -24, + 600, -182, -841, 854, 370, 715, 116, 714, + -1308, 1435, 1802, -2627, -814, 363, -318, -73, + 850, -1744, 2509, -303, 1077, 660, 2145, 2130, + -730, -88, -115, -517, -154, 160, -337, 27, + 1502, 509, -70, 502, 820, -309, -3740, -1294, + -610, 241, -662, -524, 1319, 456, 926, 958, + -111, -1004, 1795, -604, 1086, 462, -127, -125, + 264, -1093, 1427, 334, 838, 1979, -576, 3052, + -3590, 1607, 356, 728, 1619, -400, 279, 570, + -434, 777, -1448, -888, 156, -277, -1529, 1122, + 2235, -794, 3417, -830, -82, -664, -1837, 946, + -370, 1434, -50, 742, -2368, 1438, 1264, 1172, + -1338, -108, -226, -958, -2130, -2, 917, 896, + 1563, 2181, 2684, 2343, 237, -407, -2685, 1447, + 1028, -728, 109, -620, 478, 46, -542, -789, + -879, -438, 1244, 1075, -1730, 119, -694, 137, +}; + +static const int16_t cb1110sm0[] = { + 916, -269, -44, 343, 623, -2512, -171, -1904, + 1001, 2776, 226, 1487, 705, 763, -616, 288, + -212, -535, 3080, -352, -367, 512, -673, 620, + -874, 769, -956, 460, -601, -2793, -102, -765, + -431, -1369, 149, 481, -49, 109, -412, 670, + -615, 287, 150, 321, -3293, -237, -1627, 188, + 1867, 1481, 353, -134, 2706, 147, 74, -77, + -148, -224, 196, -60, 179, 125, -13, 1011, + -189, -172, 658, 4441, -540, 531, 239, -329, + 2782, 392, 97, -660, 3488, -78, 1308, -574, + -903, -170, -279, 173, -70, 601, -385, 123, + -423, -512, -193, -233, 106, 175, 210, 185, + 489, -236, 153, -670, 25, 61, -196, 213, + 67, 339, 5443, 116, -647, 149, -130, 197, + -11, 305, 2669, 1212, 298, 84, 219, -26, + 2661, 650, 1348, -65, 574, -1482, -268, -30, + 626, 328, 279, -245, 87, 94, -202, 2, + 366, -505, -592, 2, 5666, 384, 22, 227, + 208, -1221, 78, 155, 260, -1111, 165, 396, + -678, -739, 2503, -2395, 2025, 1424, -343, -759, + -837, 101, 55, 274, -481, 22, -568, 1044, + -271, -124, -609, -833, -206, 53, -591, 1150, + -1950, -2875, 1949, 59, -334, -3230, 176, 1133, + -372, 2937, -803, -663, 631, -659, -32, -82, + 851, 113, -60, -625, 556, 177, 112, -753, + -33, 313, -33, -208, -177, -5496, 55, -533, + -815, 123, -755, -215, 638, 223, -156, -917, + -166, -33, 504, 704, -3001, 124, -153, -1809, + -977, -717, 1718, 476, 212, 1661, 953, -1422, + -1014, -94, -524, -2562, -267, 371, 104, -63, + -546, 262, 193, -1714, 261, 1867, 738, -1878, + 400, 1754, -445, -405, -841, -439, 709, 44, + 675, 248, 640, -138, 1217, 393, -1402, 653, + 3110, -938, -2491, -688, 1214, -649, -1356, 2506, + 203, 172, 679, 1003, 772, -3010, 82, -998, + 1011, -980, -28, -138, -430, 614, 427, -341, + 201, -8082, -118, 224, -1167, 195, -920, -352, + -657, 5, 46, -39, -72, 698, -136, -40, + 391, 287, 157, -1197, -60, 2808, -123, 489, + 152, 2318, -805, 958, 98, -1496, -835, -846, + 589, 455, -868, 245, -10, -5047, 12, -50, + 1277, -95, 456, -49, 570, 608, -658, -352, + -277, -268, 214, 388, 1865, 2, 3033, -269, + 259, -75, -3437, 800, -190, 668, -263, -111, + 229, -43, -139, 659, -290, 782, -18, -854, + 271, -2223, 30, -162, 71, 47, 756, -1269, + 336, 863, -1998, -16, 1172, 236, 929, -477, + -2446, -92, -425, -193, -8192, 321, -102, 85, + -85, 108, 318, 149, -27, -182, 69, -237, + 35, 451, -263, -890, -348, -295, 64, 410, + 6427, 569, 604, 543, 38, 31, -15, 148, + 249, -83, -67, 457, -76, -560, 694, -797, + 190, -113, 2006, 136, 1705, -428, 3549, -550, + 70, -3, -147, -288, 1142, -919, 493, -1305, + -460, -151, 831, 623, -768, -211, 31, -296, + 167, -2721, -16, -654, 243, 2555, -311, 1845, + -531, -576, 143, -574, 490, -1089, -2302, 1080, + 701, 472, 2782, 320, -1455, -632, -218, 281, + -1492, -661, -1379, -538, -236, -1928, -502, -565, + -480, 525, -81, 38, 263, 3, 366, 163, + -3140, 882, 189, 1123, 382, -1748, -1210, 371, + -602, 696, -413, -207, 358, -616, 4725, -473, + -784, 249, 621, 764, -265, -1004, -570, 339, + -643, -123, 302, 284, 1, -159, -321, 250, + -297, -43, -3512, -1064, -493, 556, -1184, -263, + 1314, 2028, 1074, 9, 2941, -998, -271, 966, + -754, -2589, 88, 741, -307, 134, 152, -86, + 311, 904, -917, 1199, -5090, 118, 181, -311, + -412, 475, -647, -717, -637, -221, -291, -469, + 77, 946, -1196, -119, -175, 530, -465, 383, + -1253, 589, 826, 835, -3578, -319, -80, 488, + -238, -497, 360, 839, 1870, 762, -1669, -769, + 429, 778, -3121, -325, -55, -128, 2606, -874, + 1043, -902, 1746, -725, 115, 167, 142, 604, + -101, -725, -11, -458, -27, 450, 293, 2, + -383, 23, 172, -6725, 400, -205, 165, 45, + -38, 86, 372, 354, -68, 390, 2444, 521, + 4, -3586, 357, 129, 665, -328, 524, 113, + -446, -514, 1132, 289, -560, 239, 167, -349, + -724, 101, -3165, -3139, -163, -147, 865, -617, + 0, -789, 797, -1026, 432, 359, -460, -105, + 1119, 486, -233, -360, -175, -349, 837, 469, + -250, -521, -4470, -108, 1009, -575, 283, 22, + -555, -682, -234, -249, -33, -106, 521, 515, + -283, -78, 101, -135, -648, 506, 181, 392, + -517, 5405, 442, -106, -8168, 51, -310, -813, + 49, -314, 586, -479, 376, 113, 337, -151, + 245, 270, -1, 619, -312, -37, -215, -482, + -3055, -3261, -346, -493, -357, 306, -160, -21, + 258, 872, -577, -141, 18, -84, 693, 151, + 218, -533, -37, 540, 61, 40, 3150, 157, + -2549, -324, 267, -456, -1236, 798, 517, -224, + -196, 587, -495, 18, 258, 3147, -15, -568, + 957, -444, 637, -354, 828, 1182, -769, -137, + -2130, 408, -1667, 252, 282, 201, 239, 154, + 125, -7882, -332, 198, -47, 265, -289, 358, + -4, 103, -795, 207, 82, 229, 429, 361, + 263, -409, -451, -1036, -3419, 899, -568, -1480, + 898, 284, -53, 179, 975, -1283, 759, -150, + 3244, 408, 2579, -418, -117, 226, 583, 210, + -62, -1513, -148, -820, 1073, 1290, -263, -454, + 653, 555, 286, 218, -105, -135, 231, -892, + -284, 2513, 2715, -1530, -165, -1419, -223, -66, + 525, 1556, -18, -664, -19, 856, 179, 535, + -339, -245, 498, 193, 235, 328, -491, 231, + -5629, 65, -85, 313, -395, 6, 344, 267, + 672, -991, 178, -1335, -64, 9, -1508, -69, + 57, -310, -1793, -850, -3669, 427, -79, -720, + 219, 366, 131, 523, 141, -1055, -66, 13, + -843, -55, -794, 661, 112, -407, -496, 550, + 931, -3938, 1780, -509, -543, -157, -270, -1015, + 564, -231, -854, -3372, -327, 869, -196, -981, + -205, -215, 605, 746, -2188, 2250, 74, -2979, + -242, 832, -190, 365, -1327, 453, 95, 76, + 158, -683, 628, 297, -867, -542, -143, -568, + -414, 6018, -40, -35, -456, -632, -779, -226, + -442, -295, 310, -766, 578, -197, 84, -961, + -3346, -106, 3266, -3, -477, -8, 652, 122, + -606, 49, 34, 686, 385, -258, 214, -572, + -72, -193, 124, 440, 48, 45, 75, 9, + -7724, 200, -364, 578, 318, -461, 84, -233, + 46, -404, 185, 470, -3387, -3397, 374, -519, + -320, -378, 27, 921, -280, 188, -245, -69, + -322, 504, -72, 460, -80, -35, -220, -3098, + -3678, 477, 248, -801, 580, 187, 468, -636, + -364, -432, 183, -82, -79, 266, -787, -740, + 552, 228, 238, 482, -2229, 275, 149, -360, + -350, 2774, 871, -118, 55, -961, -165, 2429, + 982, 313, -502, 3094, -431, 3485, 473, -347, + 171, 544, 253, -324, -50, 464, 116, 650, + 1102, 495, 420, -404, -1, -2991, 4055, 207, + 374, -187, -121, 130, -451, -953, 822, 526, + 287, 120, -979, 376, 594, -79, -130, -362, + -979, 166, 693, -4108, 84, -135, -195, -703, + -1506, -1098, -611, 870, 935, -156, 974, 286, + -86, 83, 2975, -681, 3218, -286, -452, -70, + -113, -395, 137, -1295, -503, 853, 297, -352, + -1004, -117, 476, -431, -2848, -7, 3601, 402, + -534, 312, 86, 1524, -358, -164, -43, 913, + 1003, 239, -364, -88, -468, -672, 220, -211, + -326, -431, 438, -297, 380, 125, -146, 4550, + -271, -831, 768, -1360, -45, 266, -278, -246, + 625, -132, 153, 514, 115, -1311, 707, -361, + -601, -3224, 376, -2107, -259, -1155, 426, -646, +}; + +static const int16_t cb1110sm1[] = { + 360, 3106, -518, 185, -906, 3245, 508, -91, + 938, -1270, -492, 36, 168, -997, -208, 991, + 99, 1553, -294, 204, -22, -108, -2405, 2893, + 49, 72, -490, -529, -218, 1343, -786, 903, + 411, 207, 131, -636, -129, -134, 621, -253, + 319, 135, -234, -75, -293, 46, 207, 5985, + 280, -86, -78, 690, 984, -770, -565, -226, + -242, 374, 26, -696, 81, -277, -9, 639, + -730, 250, -232, -488, -284, 460, -398, 4336, + -303, -266, 546, -292, 2936, 70, 2077, 373, + -141, 292, 2102, 340, -312, -523, -341, 1017, + 457, 224, 315, 271, 1080, 152, 192, 568, + 1014, 155, 85, 329, -5235, 137, -503, 141, + 275, -7, 752, 282, -267, 321, -735, 746, + 489, 450, 478, 432, -152, 451, -1192, 1267, + -341, 1136, 100, -3538, -1551, 1547, -551, 294, + -473, -821, -51, 718, -655, -11, 2817, -26, + 73, -459, -1569, 181, 516, -151, 2846, -112, + 186, 714, -228, -210, -451, 920, -99, -132, + -2662, 589, 3040, 376, 662, -834, 782, 542, + 1485, 538, 3531, 107, 47, 62, 398, -11, + -15, -733, 471, -231, 668, -212, 38, -536, + -1905, 2769, -149, 1623, -3418, 237, 55, -328, + -770, 335, 2755, 340, 62, -466, 267, -946, + 427, 266, 80, 1134, 34, 949, 366, -339, + -112, 3, -105, 442, 5117, 545, -93, 611, + -186, 566, -39, -172, -59, -1120, 388, 703, + 619, -359, -117, -68, 569, 148, -214, -245, + 281, 617, -2337, -88, -255, 124, 3292, 443, + 434, -17, -1157, 3090, -205, -245, -983, 250, + -1086, 643, 1392, 831, 733, -59, -1199, 1747, + -415, 1073, 279, 428, -512, -3392, 0, -6, + 526, 275, -79, 477, 411, 85, 1485, 795, + -209, 495, -2628, 367, -1734, 900, 301, 239, + -53, -2068, 403, 1333, -1304, -566, -1420, -771, + -2300, -15, 842, 342, -2373, 61, -1379, 303, + 733, -108, -316, 94, -477, -254, -211, 807, + 273, -792, 159, -66, -857, 1092, -1001, -69, + -3770, 999, 2418, 854, 173, 2281, -681, 485, + 578, 145, -1245, 845, -375, 219, -259, 374, + 751, 226, -1347, -825, 66, 319, -173, 191, + 445, 284, 62, -8150, -71, 53, 637, -96, + 227, 75, 73, -88, 654, -24, -466, 477, + 671, -125, -942, 104, 248, -151, -383, 11, + 322, 332, 4160, 108, -301, 463, -402, 352, + -1799, 580, 1443, 396, 287, -158, -421, 340, + -349, 109, 61, 47, -2816, -298, -947, -817, + 673, 189, 36, 4069, -584, -335, 2608, 10, + -378, -630, -801, 228, 946, -405, -1186, 473, + 625, -2, -741, 523, 3747, 318, 733, 171, + 268, -2554, 402, -252, -205, 292, -351, 64, + 289, 801, 989, 435, -100, -163, -1215, -467, + 661, -714, 165, -228, -637, 1357, -498, -52, + 488, -3882, 130, -1053, 796, 1040, 381, -729, + 147, 803, 169, 46, -157, 167, -209, 126, + -1016, 88, -1018, -458, -527, 1259, 621, 3847, + -525, 1247, 18, 253, 642, 340, -705, 838, + -2769, -672, 153, 115, 453, 773, 9, -2285, + -291, 6, -219, 628, 284, -330, 568, -240, + -206, -127, 273, 373, 367, -494, 8192, -595, + -255, -158, -326, -60, 513, 334, -667, -549, + -110, 2, 573, 1086, -610, -368, 259, -3611, + -455, 1577, -524, 11, 904, 390, 313, 707, + 2670, -223, 2710, 593, -25, 228, 540, 663, + 740, -1108, 298, 1223, -531, -1978, 248, -661, + -341, -910, -2434, 111, 217, 748, 231, -305, + -419, 1873, 1094, -936, -1741, 1133, 1881, -671, + 41, 268, -1826, 466, 135, 37, -200, 4623, + -1212, -969, 541, 1278, 652, 1061, -759, -747, + -427, -107, -1329, -583, -255, -67, -311, -10, + -421, -8192, 322, -181, -442, 76, 176, -742, + -175, 147, 385, -275, -87, -704, -545, -315, + -414, 569, 81, -387, 628, 2954, -604, -1459, + -29, 1693, 840, -1024, -66, -317, 266, -2465, + -917, -14, 151, -369, 366, -2388, 1, -773, + 1333, -99, 223, -694, -1169, 917, -2496, -1290, + -286, -1007, -508, 734, 451, -256, 266, -105, + -143, 439, -120, -146, 7690, -183, 188, 68, + -385, 7, -278, -24, -66, 292, 137, 143, + 21, -495, -527, -284, 89, -1584, -64, -3664, + 286, -2258, 80, -932, -771, -338, -830, -1029, + -99, -32, -800, 351, -87, 600, -93, 133, + 389, -690, 269, 201, -328, 5489, 558, -702, + -487, 210, 3107, -3628, -96, -388, -169, -221, + 339, 403, -816, -24, 469, -112, 560, 844, + -441, 698, 169, -378, -283, -924, 2842, -479, + -694, -117, -94, 523, 974, 1356, -638, 590, + 820, 2164, 247, -532, 648, -243, -599, -67, + 5686, 174, 78, -608, 230, -172, 369, 342, + -113, 111, -345, -311, 594, 350, -260, -1423, + -425, -407, -1017, -298, -180, -738, -891, 66, + -3312, -1157, 1, 811, -1431, 612, 797, -1344, + -890, -959, 318, 392, -190, 735, 196, -347, + 61, -116, 344, 243, -411, -446, 62, -128, + -3386, 476, 2695, -193, -39, 1960, -7, 909, + -118, -2275, -28, -997, -210, 374, -586, -82, + 914, 323, -73, -2743, 858, -65, 43, -2444, + -246, 145, 78, -638, 844, -2079, 352, -332, + 615, -779, 270, 1799, 680, 500, 686, 1168, + -397, -2233, -31, -163, -18, 602, -232, -915, + -941, 3708, -337, -559, 315, -401, 42, 26, + 316, -100, -191, 36, 206, 214, -3336, -407, + 494, 749, -491, -162, -55, -2902, -1515, -198, + -311, -359, 439, 359, -935, 203, -214, -2401, + -607, -2843, 818, -579, -2066, 388, -514, -912, + 787, 564, 149, -103, -757, 389, 173, -303, + 154, 814, 1631, -393, -2264, 1664, -802, 904, + 541, 784, 1063, 1152, -2510, 297, 84, -154, + 160, -497, -78, 1503, -598, -543, 86, 1683, + -330, 46, -24, -892, 747, -3336, -393, -2268, + 107, 710, 1682, -277, -278, -276, 1253, 327, + -986, 802, 191, -732, 286, -761, 1008, 461, + 1615, -1041, 2127, 2456, 3927, -160, 187, 31, + -101, 3258, 202, -75, 330, 375, -301, -275, + -782, 949, 12, -621, -617, 572, 1007, 414, + -91, -428, -392, -985, -692, -3422, 199, 845, + 91, 418, 290, -983, 721, -1265, 208, 1200, + 91, -758, -2649, -451, -814, -623, -458, 272, + 2777, 809, 1282, 763, 1122, 21, 520, 50, + -1018, 428, 385, 6149, -255, 8, -12, 21, + 20, 293, -315, -446, -423, 549, 428, -56, + -497, 101, 653, -177, -3975, 56, -127, 3214, + 291, -384, -721, 478, -314, -231, -469, -362, + -682, 765, -308, 420, 456, 322, -54, -2, + 10, -239, 6916, -461, -482, -211, -286, -110, + -877, -711, -470, 159, 260, 59, 252, -97, + -2978, -646, -35, 156, -123, 360, 556, -3254, + -475, -313, -268, -1771, -538, 203, 967, 283, + -653, -565, 387, -3097, -255, 25, 295, 264, + -3716, 505, 1024, -315, -215, -222, -780, 660, + 431, -341, -521, 46, 127, -244, -772, -3741, + 190, -335, -17, 2135, 744, -35, 627, -1115, + 681, -343, 123, -1534, -86, -542, -297, -82, + -2772, 3914, -75, 526, 124, -523, -112, 500, + 863, 371, 190, 1036, 141, -1011, 373, 796, + 421, -682, 403, 2924, 3730, 6, 211, -691, + -167, -391, -655, 162, 348, 216, -227, -535, + -147, 367, -189, 331, -191, 159, 49, -4905, + -252, -290, 609, -452, 1042, 1027, -645, -159, + -633, -542, -925, -262, -91, 192, 1266, -2, + -164, 587, 188, 3434, -1014, 2, 1373, 1832, + -1224, -965, 831, -987, 1180, 1389, -925, 48, + -3239, 263, -329, -660, -733, 262, -988, 598, + -2421, 630, 720, -925, -455, 208, 1092, -294, +}; + +static const int16_t cb1616l0[] = { + -15, -7707, 115, 30, -36, -27, -22, -43, + 2, 5, 31, -1, 87, 2, 41, 21, + 270, 16, 3747, -773, 3027, 224, 92, -168, + -7, -62, -79, -44, -9, -4, -58, -78, + 1063, 203, -2, 76, 289, -36, 92, -29, + -78, -148, -5176, 137, 219, 299, 89, -233, + 62, -129, 33, 123, -30, 197, 4018, -37, + -38, 139, 41, 153, 71, -26, 27, 53, + 72, 3358, -68, -122, 293, -19, -355, 104, + 34, 3121, 16, 29, -344, 37, 174, -28, + -43, -102, -59, -1661, 14, 5, -62, -1, + 14, 15, -42, 4, -31, -2, 13, 23, + 957, -419, 20, 31, -14, 51, 24, -46, + 8, -16, 27, -75, -27, -33, -28, 18, + -67, -152, -48, 47, 90, 48, -74, -103, + -18, 4863, 3, 132, 414, -86, -60, 285, + 16, 32, -44, 0, 22, -163, 23, -3, + 23, -61, 13224, 52, -139, -13, 171, 215, + -51, -21, -48, 33, -10, -17, -21, -7662, + -57, -44, -51, 35, 35, 34, 105, 178, + -77, 77, 147, 67, -816, 2913, -3087, 516, + -112, -296, 21, 133, 211, 162, 87, -25, + -535, -830, -12, 46, -59, -10, -4, 42, + 0, -91, -9, 47, -90, -29, 74, 322, + -106, 83, 44, 4693, -788, -73, -85, -105, + -76, -1031, 34, 6, 78, -34, 160, -48, + -707, -12, -9, 39, 14, 23, 88, -2286, + 21, -25, 42, 130, 39, 251, 16, -50, + 397, -226, -2570, 88, -129, -347, 159, 92, + 0, -44, -49, 235, -196, -24, -36, 113, + 13387, 45, 22, 54, -20, 29, 27, -27, + 54, 38, -63, -12, -74, 45, -8, -115, + 591, 46, 5, -234, 57, 124, 86, -3794, + -51, 292, -160, -152, 96, -334, 348, 96, + -186, -3870, -3715, 54, 0, -29, -65, -68, + 6, 132, 47, -155, 62, 26, 66, -10, + -46, -3093, 66, 3633, 183, -171, -132, -24, + 154, 157, 129, -185, 12, -26, 96, -12, + 88, -34, 42, -15, 37, -6625, -27, 13, + 41, -30, 62, 142, -93, -168, 84, -22, + 139, -19, 18, 10590, -111, 36, 13, -44, + 4, -45, -3, -3, 28, -25, -4, 115, + 119, -49, 41, 33, 87, -85, 12444, 73, + 71, -111, 61, -15, 117, 23, -24, -5, + 131, -31, -1, -22, -57, -12, 50, 35, + -1555, -20, 38, 82, -52, 27, -128, -14106, + 808, 190, 89, 595, 63, -291, 282, -48, + 32, -706, -433, -673, 3285, 1311, 830, 3745, + -204, -1185, -584, -51, 952, 1005, -566, 1764, + 186, 1211, -495, -112, 1213, 192, 2320, -43, + -30, 24, -1152, 2, 2, 32, -55, -25, + -2, -17, -14, -6, 22, -54, 32, 45, + 10, -85, -26, -16, -66, -60, -210, -104, + 208, -248, 62, -28, -14552, -11, -44, 1601, + 47, -138, 46, -35, 2647, -81, -3, -38, + -66, -59, -33, -19, 43, -17, -79, 53, + 1821, -1572, 2582, 85, 48, -140, 78, -155, + -173, 96, -32, 121, -58, 201, -174, -54, + 74, -2442, -282, -771, 37, -2930, 15, 1762, + 154, 263, -15, -19, 139, 246, -243, -31, + 84, 145, 8, 152, 43, 128, 679, 1828, + 3476, 17, 92, 102, 258, -29, -275, -39, + -187, 88, 70, 28, 2, 2143, 274, 202, + -67, -13, -22, 68, -35, 135, 114, 108, + 27, 1, -11248, -100, 14, 26, 59, 10, + -24, 30, 1, -38, -9, 21, 18, -1, + 2029, -83, -342, 3443, -25, 7, 0, 54, + 78, 198, 45, 233, -6, 0, -109, -172, + -2250, 41, -79, 2820, 44, 216, 39, 59, + -41, 52, 79, -52, 12, 23, -72, -125, + 83, 17, -28, -32, 13, 2, 28, 0, + -26, 75, -81, 66, 25, -81, 6516, 9, + -93, 49, -4036, -2484, -42, -71, 178, 99, + -133, 79, -41, -112, 57, 66, -28, 13, + 39, 64, -123, 3174, 3061, 259, 55, 123, + -123, 246, -138, 139, 75, 31, -215, -154, + -218, 26, 16, 21, 126, 26, -33, -10, + -15, 16, -20, -53, 21, 15526, -35, -59, + -50, -11, -58, 67, -11, 107, -24, -37, + 8155, 31, -111, -62, 138, -60, -10, 84, + -128, 37, 24, -45, -10, 129, -68, -37, + 42, -80, -205, -79, 5994, -93, -270, -400, + 20, -89, -39, -200, 230, 197, 325, -305, + -294, 94, 3207, 128, 3119, 226, 28, -49, + 264, 186, 8, -29, -13, 27, 22, -63, + 43, 84, -19, 57, -2605, 316, 259, -43, + 50, -2241, 105, -12, -23, -36, 89, 41, + -15, 145, 10, -81, 7, -50, 70, 60, + -23, 55, -62, 0, 52, -77, 180, 74, + 79, -14297, 6, 24, 299, -107, 4, -29, + -3252, -51, 40, -143, 3550, -28, 102, 24, + 215, 147, -169, -60, -43, -486, 5, -1, + 62, -116, -2917, 430, 50, 2927, 139, 127, + 63, -53, 141, -255, -85, 95, -101, -176, + 195, 104, -3066, -56, 3239, -161, -214, 57, + 24, -375, -181, 0, -259, 130, -120, -2, + -6, 175, -147, -185, 68, 219, 425, 2685, + -3120, 266, 246, -270, -70, 273, 168, 121, + -143, 2641, -553, -547, 638, 113, 2965, -161, + 29, -374, 105, -869, 108, 70, 15, 230, + -54, -106, -21, -4, 86, 85, 155, -120, + -17, -21, -2534, 57, 149, -129, 21, -169, + -2289, -127, -19, -26, 3, 60, 35, 1, + -28, -7, 36, -180, -13, 87, -68, 56, + 80, 64, -8, -73, 6691, -32, 47, 48, + -6, 61, 36, -8, -41, -1, 13, 68, + 140, -51, 25, 12, 3, 57, -54, -33, + -19, 12, 28, -60, -56, -2399, -14, 127, + 1935, 84, 127, -193, -3, 3307, -56, 15, + 31, -116, -187, 236, -289, 261, 69, 144, + 1723, 79, -68, 102, 727, 69, 654, -60, + 21, 124, 3497, 248, -684, 1469, 368, -254, + -211, -2600, 771, -138, 368, 3089, 52, -206, + 147, 200, -15, -136, 194, -164, -352, -152, + -4870, 5, 191, -3, -97, 28, -41, 107, + 2, 11, 60, -76, -35, -42, 129, -77, + -2610, -295, -218, -369, 10, 253, 15, -125, + 74, -87, -70, 3366, 115, 240, -106, -93, + 121, 10, 36, 9, -18, -66, -77, 7, + 37, -76, -22, 2913, 242, 22, 172, 102, + 186, -231, 90, -11, -57, 45, -10, -44, + -84, 44, -117, -43, 49, 5585, 18, -166, + -43, 64, 28, -9, 26, -160, 31, -28, + 29, 56, 29, -57, 109, -25, 3140, -131, + 57, -20, 27, -27, -5, -42, -52, 18, + 23, -56, -38, -14, 213, -33, -86, -4741, + -151, -46, 1, -17, 46, 7, -13, 0, + 50, 28, -57, -7291, -20, 12, 66, 214, +}; + +static const int16_t cb1616l1[] = { + -81, 5, -16, 34, 19, 10938, 141, -21, + 27, -105, -110, 32, -67, -75, 19, -138, + 3, -14, -408, -302, 36, -4612, 23, -579, + -35, 19, -312, 35, 120, 97, 82, -109, + 41, -1745, -158, 299, -3069, 84, 18, -447, + -33, 65, -32, 45, -7, 144, 86, 100, + -1738, 250, -226, -137, 159, -45, 134, 438, + 102, 37, -15, -161, -23, 4221, 174, 47, + -264, -182, -182, 686, -248, 89, -41, 80, + -2687, -194, 2552, 407, -1106, -970, -181, -228, + 4395, 118, 1027, -255, 136, 100, -43, 246, + 80, 15, 34, 82, -54, -367, 698, 232, + -177, 45, -67, 49, 138, -158, 168, 202, + 43, -70, -101, 20, -97, -3465, -342, -255, + 127, 25, -52, -5, 7, 76, -3, 19, + -19, 42, 10, -63, 16, 121, 732, -3127, + -43, 116, 36, -2519, 23, 18, 181, 41, + -32, -11, 22, 51, 35, 16, -34, -62, + 1744, 94, 173, -1243, -262, 11, 3218, 239, + 149, -219, 29, 118, -382, -289, -42, 161, + 17, -1, 2551, -83, 90, -128, 138, 3238, + 43, -29, -112, 110, -268, 293, 23, -117, + -64, -137, 79, -70, -10747, -66, 73, 90, + 35, 90, -29, -78, -111, 75, 48, 8, + -169, 2944, 16, 89, 186, -34, 82, 241, + -46, 257, -243, 93, 2966, 178, -256, -18, + -33, 103, -320, -271, 3088, 2893, -250, 102, + 696, 124, -211, 18, -143, 97, 216, -99, + 195, 40, -35, 144, 26, 135, -152, -215, + 120, 25, -254, -1875, 657, 197, -3527, -332, + 310, -11, 1958, 102, -12, -45, 2, -127, + 4, 1, -19, 47, -20, -52, 97, -30, + -7738, 51, 26, 5, -21, 18, 15, 15, + 66, 30, -8, -7, -31, -1, -33, 38, + 164, 90, 6798, -33, -90, -17, -5, 14, + -42, 21, -20, -41, 48, -6, -36, 6, + -207, -4363, 5075, 31, 6, 100, 65, 86, + 19, -158, 28, -134, -91, -68, 9, -26, + -37, 2588, 307, 3467, -451, 101, -441, 323, + 62, 188, -132, -294, 98, -22, 152, -46, + 65, -39, -37, -82, -9, 18, 43, 17, + 8, 56, 97, -11564, 21, 15, 75, 85, + 155, 15, 32, 0, 20, -45, 7412, 48, + 3, 38, 72, 30, 23, 42, -20, -110, + -454, -233, 653, -325, -276, 504, -481, 583, + 270, -649, 481, -3166, 1619, 164, -90, 150, + 32, -96, -47, 49, -13, 115, -183, 75, + 62, -9026, 12, -93, -715, 6, 137, -338, + 810, -39, -277, -108, -20, 315, 572, -3, + -4570, 1053, -132, 13, 388, -223, -355, 31, + -47, 61, -113, 5, -38, 43, -47, -80, + 2550, 27, 247, 277, -86, 336, 139, 146, + -111, -73, 187, -312, 68, -276, 72, 638, + 73, 792, -170, 1383, 421, -703, -3813, 112, + 391, -195, -162, -28, -25, 317, 228, -83, + 4611, 654, 353, -380, -283, -627, -301, 161, + -156, -81, 5, -15, -13, -17, 53, -50, + 36, -66, -7921, -2, -54, -41, -26, 47, + -3, 22, -6, 11, 63, 2, 42, 71, + -50, -87, -39, 2, -56, -2, 11165, 44, + -119, -74, 131, 134, 5, 115, -39, 144, + -23, 0, 186, 4648, 351, 36, -70, -71, + 1706, 2131, -228, 42, 6, 8, 4, -43, + -12, -40, -44, -7, -14, 11, 83, -93, + -144, 186, -46, -9, 13, -87, -120, 70, + -209, 115, -3513, 139, -46, 133, 96, 25, + 215, -35, -437, 126, 403, -115, 145, 203, + -69, -334, 37, 934, -481, 3163, -2528, -49, + 57, 100, 76, 82, 251, 288, -114, 46, + -201, -161, -161, -716, -4080, 378, -830, -254, + 12, -2110, -300, 78, 288, 48, -90, -99, + -31, -110, 201, 66, 327, 119, -180, 148, + 633, 71, -4100, 33, 57, -9, -48, 151, + -20, 72, 71, -11, 39, -67, 176, 27, + 143, 198, 383, 155, 3182, -128, -152, -3209, + -172, -262, -13, 129, -167, -128, 55, 46, + -37, 70, 107, 7, -23, -2082, 241, 236, + -47, -85, 105, -47, -202, 208, 201, 30, + -106, -14, -38, 14, -45, 24, -24, 12083, + 22, 151, -58, -9, 59, 170, 113, -82, + 369, -155, 53, 97, -185, -57, 203, 311, + 236, 4789, -24, -591, -1463, 118, 94, -274, + 3188, -145, -406, 183, 0, -54, 17, -22, + 37, -55, -34, 63, -340, 175, -300, 106, + -190, -38, 67, -2, 19, -46, -42, 11, + -33, -33, -28, -10, -27, -9235, 29, 62, + -927, 1285, 49, 72, 65, 89, 57, -44, + -9, -15, 85, -1, 74, 81, -123, 160, + 69, -2803, -22, 47, -467, -74, 748, 168, + -9, 235, -3155, -154, 48, 483, -341, 74, + 2403, 97, 93, -106, 219, 136, -191, -50, + 7, 71, -103, 261, 3283, -124, -624, -2570, + 73, -31, 10, -73, 30, -15, -2256, -2, + -73, 55, 73, 14, -74, -81, 38, 352, + 108, -18, 25, 61, 54, 1, -5, 109, + 25, -2676, -25, -52, -316, 2, 36, -36, + -355, 40, -19, 120, 27, -4, -51, -8, + 42, -10, -28, -90, -143, 29, -10, -8442, + -22, -566, 59, -39, -1, 27, 29, -20, + 6, 19, 0, -36, 38, 68, -43, 35, + 22, -47, -146, 3567, 13, 12, 3230, -18, + -32, 75, -112, -8, -157, -23, 101, 165, + 198, 93, 383, 1236, 1077, -3592, -1401, 1135, + 844, -266, -74, -70, -280, -98, 67, -109, + 38, -5109, -66, -57, 89, -21, 6, 19, + -21, 70, 60, 76, 35, 18, 44, 51, + 45, 40, 54, -6685, -67, 9, 113, -29, + -10, -96, 80, 98, 103, -40, -8, -20, + -131, 15, 262, 47, -253, -116, -12, -4807, + 2, -81, 76, -46, 37, 353, -130, -191, + -127, -10, -35, 91, -122, 173, -165, -8, + -15179, 86, -186, 123, -295, -25, 21, 63, + -93, 730, 20, -120, -4624, 340, -253, -473, + 44, -18, -99, -37, -54, -317, 65, -52, + 2167, 68, -245, 224, 117, -180, -4695, -276, + 118, 142, -101, 202, -301, -33, -129, -303, + -90, -75, 50, 98, -56, -68, -153, -38, + 168, -278, -22, -64, 9757, -91, -23, 1284, + 53, 56, -11, -46, -1645, 11, 15, 12, + 8, -40, -2, 84, -56, 17, -7, -30, + -4010, -3557, -252, 56, -79, -87, -7, 8, + 79, 16, 21, 51, -63, -22, 118, 228, + -1525, -78, -22, -2, 16, -49, 17, -37, + -3, -14, 10, 31, 17, -111, 32, -144, + -3612, 3473, 79, 23, -89, 74, 33, -29, + 11, -42, -42, -129, -41, 155, 52, 31, + -162, 12609, 147, 17, 68, 2, 15, -12, + -39, 50, -108, -66, 121, 69, -27, 94, +}; + +static const int16_t cb1616s0[] = { + 1213, -1302, -1130, 90, -69, 22, -360, 360, + -55, 453, -705, 4416, 227, 173, -8, 149, + 210, -118, 51, -3759, 949, 2418, -238, 201, + -597, 94, -253, 24, 225, -497, -59, 273, + 576, 651, 608, -483, 335, -125, 256, -2873, + 318, -146, -650, -306, -2021, 1044, 41, -455, + -1120, 832, 978, 212, -463, -209, 12, -275, + -20, 118, 31, 639, 5933, -180, -121, -285, + 65, 212, 439, -135, 538, 116, -302, -245, + 2534, -623, 1549, -34, 727, -1750, 1477, 79, + 1669, -828, 618, -856, 773, -286, 343, -94, + 107, -320, -3144, -380, 694, -80, 843, 103, + -700, -269, 452, -6847, -12, -527, 97, -21, + -76, -246, 2, -104, -68, 98, 312, 117, + -342, 1025, 207, 838, -71, 2463, 60, -1294, + 1549, -1310, -202, -1585, 682, 327, 608, 649, + 664, -801, 588, 137, -468, 286, 234, -6726, + -107, 177, -147, 278, 118, -81, -242, 97, + -235, 1599, -877, 1985, 448, -319, -745, -504, + -433, -1859, -35, 286, -665, -1449, -124, -97, + 930, 2622, 682, 698, 1898, 1120, -323, -142, + -679, 294, -162, -539, -1649, 152, 23, -414, + 1493, 602, 913, 1428, -3212, -103, -330, 557, + 463, 92, 251, 339, 16, 936, -116, 229, + -827, -504, 2015, 1553, -503, -350, 214, 386, + 295, 2697, 429, 72, -705, -120, 427, -139, + -334, -318, -6613, -468, 10, -122, 59, -322, + -165, -144, 45, -427, -12, -79, -202, -266, + 981, -273, 240, -454, -30, -119, 340, 92, + -251, 247, 189, 71, 243, -5648, -601, -434, + -674, 867, -713, -428, -101, -231, 1144, -89, + -10, 57, 302, 154, 362, -425, 2014, 2577, + -8659, 389, -90, 76, 15, 147, 30, -202, + -99, -255, -242, -165, 257, 97, 41, -72, + 263, 613, 272, 400, 5020, -199, -196, -177, + -276, -25, 28, 97, -155, 119, 763, 33, + -3540, -1447, 16, -169, 148, -143, 707, -2483, + 178, 83, -83, 154, -75, -15, 153, 283, + -323, -139, -1390, 69, 725, -1744, 331, -3665, + 415, -514, -366, 124, 660, -295, 180, 77, + -228, 192, 684, -193, 4, 4409, 298, 427, + 591, 290, -159, -166, -372, -514, -1840, -562, + 795, -1765, -349, 1178, -1619, -391, 615, -784, + 1353, 746, -871, -994, 182, -464, -498, -96, + -306, -729, 743, 270, 223, -731, 73, 2692, + 1110, -2354, -328, -21, -172, -339, -528, 93, + -338, 548, 1498, 309, -134, 160, -247, -619, + 1127, 783, -1557, 400, 1035, -445, -155, -2443, + 590, -790, 137, 388, 1188, 844, -395, 1005, + 55, 1141, -122, -3174, 138, 155, -506, 306, + -3255, 2432, -116, -1289, -744, -350, 3, 192, + -156, 95, -552, -57, 329, -405, 737, 138, + -835, 4096, -1037, 797, -417, -418, -507, -694, + -256, 78, -94, -63, -93, 754, -555, -90, + -1518, -878, 167, -392, -100, -78, -80, -45, + 4774, 114, -284, -560, -21, 275, 15, -195, + -1692, -711, -1057, 167, -1555, -690, -263, -267, + 310, -229, -14, -880, 426, -2826, 320, -49, + -1223, -725, 3538, -270, -606, -1812, 481, -703, + 176, -284, -173, 271, 847, 711, 239, 314, + 1233, -61, 477, 429, -691, -156, 6712, 850, + 365, 229, -197, -355, 298, 250, 207, -437, + -1647, -261, 165, 114, 165, 1165, -58, -597, + -3290, -517, -478, -842, -187, -448, -302, -204, + 410, 544, 669, -2012, 476, 434, 214, 698, + 302, 100, 61, 63, -386, 918, 4434, -230, + 157, -1019, -1487, 2239, -774, -234, -378, 772, + -190, 270, -61, -19, 322, 488, 937, -3582, + -415, 2091, 1862, 81, -134, 1285, -2732, 221, + -235, 388, -216, -63, 664, -105, -37, 165, + 899, -373, 284, -375, 286, -263, -295, 276, + -246, 188, 5285, -303, 290, -60, -1, 95, + -703, -288, 74, -717, -127, -53, -422, -452, + 166, -54, -15, 268, 238, -31, -279, -5872, + 863, -907, -101, 885, 552, 442, -2336, -2142, + -804, -147, -791, 1000, 96, 250, -306, 134, + 743, -1648, -867, 673, 1594, 3725, 527, -676, + -661, 238, 262, 560, 277, -58, 444, 166, + -1039, -702, 558, -970, -1763, -1198, 580, 378, + -421, -972, 630, -279, -2456, -1222, -232, -749, + -3325, 174, 789, 729, -487, 583, -157, 1503, + -801, -38, -11, 556, 81, 1508, -140, 74, + 1373, 912, 1471, 4, -1080, -105, -58, -104, + -54, -544, -2392, 1550, 318, -506, -11, -180, + -1891, -230, -259, -1182, -154, 524, -568, 1972, + 546, 469, -720, 1089, -1530, -680, 1349, 429, + 82, -1524, 1894, -90, 188, -145, 15, -1113, + 15, 53, 282, 2212, -736, -941, -1148, -344, + 1473, 344, 392, -333, -556, -480, -3833, 35, + -160, -525, 151, -534, -782, 38, 520, -416, + -384, 7582, -158, -29, 74, -57, -23, 73, + -393, -245, -12, -260, -154, -319, 357, 247, + -306, 351, 273, 755, 227, 89, 283, -152, + 17, 5129, 191, -213, -531, 255, -468, -209, + 1128, 72, -807, 225, -319, 1638, 42, 20, + 935, -52, -326, 541, -1174, 130, 284, -112, + 444, 3959, 262, -631, -262, 275, 1025, 190, + 1125, -265, -95, 265, 35, 270, -92, -30, + -141, 325, -435, 45, -659, 149, 3648, 339, + -1701, -1338, -144, -989, -604, 84, -394, 168, + -302, -1294, -433, -921, 1271, 77, 374, -604, + -230, 97, 206, -138, 2909, 478, 707, 0, + 1242, -340, -1659, 349, 2751, -1175, -146, 1038, + 65, -775, -423, 14, 22, 41, -905, 287, + 280, -933, 195, -1817, 540, -2374, -661, -1102, + 879, 1232, 29, -1683, 286, -136, 658, -395, + -1782, -2823, -624, -223, -299, 2859, -103, -45, + 544, 82, -21, -263, -666, -362, -732, 249, + 1087, -242, 30, 663, -386, -350, 1240, -492, + -868, 69, -41, 35, 30, -1791, 3870, -455, + 1355, 1098, 2933, 347, 361, 79, 2855, -26, + -66, -598, -43, 21, -386, -802, -81, -436, + 846, -673, 377, -326, -1217, 1465, -480, -205, + -2168, -1689, 690, 355, 1192, 734, -113, 39, + -486, -644, 438, 1096, -723, -524, -1634, -621, + -394, 226, 167, -625, -709, 854, 3005, -910, + 13, -793, -1517, -1254, 18, -440, -836, 651, + -31, 229, -1081, -126, -191, -3612, 487, 451, + -292, 943, -2018, -618, -259, -649, -723, -447, + -238, 1096, -2228, 675, 563, -316, -1248, 32, + -28, 293, -1817, 226, 267, 1291, 624, -2279, + 143, 650, 5, -563, -504, -2124, -94, -1613, + -3050, 708, -3458, 442, 30, 65, -80, 89, + 204, -245, 94, 28, -2, -231, 623, -189, + -405, -2147, 1147, 3124, 806, 1048, 1145, 653, + 47, 86, -4, 46, 437, 229, -190, 310, + 1995, -48, -1015, -1806, -266, -941, 361, 179, + 172, 397, 182, 323, -516, 3435, 7, -5, +}; + +static const int16_t cb1616s1[] = { + -2521, -518, 1830, 985, -500, 109, -807, -197, + 543, -1036, 104, 1989, 428, 740, 1110, -366, + 1482, 899, -1828, 159, -3015, -311, -792, -42, + 3, -412, -157, -13, 863, -248, 261, -187, + -409, 156, 772, 271, 318, -262, 78, -571, + 28, 370, 119, 302, -4794, 106, -123, -153, + 1857, -702, 1090, -319, 415, -327, 2124, -170, + -411, 174, 62, -7, 921, -128, 735, -127, + 972, 1678, 166, -1471, -208, -224, 871, -900, + -223, -817, 288, -472, 10, 31, -401, -3201, + -1290, -3, -301, 183, 730, 473, 438, -81, + 882, -64, 2898, -242, 408, -211, -333, -254, + -820, 612, -1128, -60, -73, -2516, 45, 637, + -130, 459, -312, -223, -629, 1490, 1792, -199, + -21, -545, 1772, -1084, -173, 381, 380, 1289, + -117, 483, 138, -1200, -519, 598, -3453, 349, + -3102, 1260, -170, 238, -684, 48, -483, -883, + -879, 139, 298, -110, -203, -955, 195, 57, + -550, 1945, -711, -688, -1470, 1527, 58, 317, + 656, 310, 57, 162, 2006, 1387, 845, -127, + -398, 318, 2520, 2002, -906, -323, -194, 907, + 588, -228, -357, -316, 557, -596, -1559, -3, + 1614, 1317, -1701, 936, -89, -2270, 1327, 1046, + 400, -233, 18, -730, -23, -181, -593, 74, + -570, -969, 432, -261, -833, -90, -4675, 786, + -566, -183, -859, -554, 346, -493, -201, -220, + 241, -919, -1896, 265, -802, 1380, -718, -1103, + -574, 307, 138, -1260, 175, 2540, -82, 58, + 1046, -1381, 2486, 582, 455, 485, -824, -150, + 57, -45, -155, -490, -1108, -2191, 833, 423, + -2011, 267, 779, 140, -28, 57, 94, 6, + -301, 5, -833, -1226, -193, 1110, -63, 79, + -492, -1465, -2733, 444, 56, -1116, -601, 20, + -618, -1315, -695, 1146, -66, 336, -166, 158, + 530, -53, -371, -594, -685, 114, -146, 373, + 174, -1, 47, 119, -124, -121, -6697, -94, + -3544, 1506, 1221, -101, 2160, 558, -254, -728, + 511, 378, -383, 12, 626, 172, 183, 354, + 49, 1669, 1188, 3810, 409, 152, 694, -2520, + 342, 61, -85, -38, -170, 5, 305, 154, + -348, 699, 332, 2542, 673, -1130, -2601, 554, + 1483, 466, 271, 490, -644, 822, -96, 477, + 131, -2051, -111, 43, -31, -62, -767, -3257, + 663, 488, 1823, 522, -525, -249, 481, -7, + -1298, -941, -335, -566, 305, 534, -735, 207, + 709, -3170, 19, -20, -1888, 271, -1697, 117, + 1837, 2690, 305, -483, -463, 407, -706, 467, + 518, 1806, 244, -80, -453, -505, 882, 843, + 1328, -280, 175, 319, -842, 192, -680, -469, + 5440, -205, -187, 53, 332, 204, -184, 96, + 1026, -525, 20, 975, 125, -1562, -1873, -757, + -137, 133, -10, -340, -783, -1484, -2206, 1238, + -5212, -466, 129, -224, 17, 497, -41, 846, + 88, -41, 285, 284, -155, 21, -225, 150, + 223, -807, -444, -1141, -908, 292, -326, 559, + -446, -283, -41, -277, -3479, -667, 532, 83, + 257, 383, -2986, 1685, 697, 777, 1551, -142, + 1786, 579, -531, 787, 712, -984, 603, -174, + -459, 1303, -943, 741, 1103, -73, 600, -403, + -42, -169, -90, 220, 208, 105, -4083, -1069, + 981, -926, 124, 273, -145, -133, 307, 4720, + 209, 324, -79, 12, -41, -220, 211, -184, + 435, 307, -1544, 83, 1565, -445, -217, -648, + -379, -1270, -1590, -2337, -860, 348, 648, -157, + -785, 3318, -123, -138, -412, -876, 358, -173, + -280, -81, -149, -167, -160, -2113, 20, -40, + 1022, 432, -721, 55, -651, 17, -1135, -380, + -542, -1128, 2919, -475, -143, -53, 176, -152, + 7, -29, -172, 174, 195, -8005, 277, 105, + 35, 115, -314, 137, -253, 75, -278, 90, + -1508, 79, -153, -560, 1027, -349, -292, -466, + -1101, -324, -84, 4251, 822, -420, 55, 43, + 1886, 281, 964, 2408, 425, 1187, -27, -84, + -1277, 63, -978, -143, 506, 727, -155, -384, + 3434, 592, -262, -438, -30, 2849, -69, -58, + -181, -87, 20, 299, 412, -263, 702, 131, + -271, -10, 736, 121, -6299, -132, -116, 26, + -253, -586, 32, -145, -251, -12, 471, 135, + 585, 604, 29, 873, 363, -2, -1595, 41, + -1147, -142, 665, -2752, 1302, -358, -134, 29, + -691, -12, -702, -459, 100, 278, 9, 54, + 66, -458, 53, 213, 193, 14, -400, 4870, + -950, -209, 50, 470, 449, 3, -118, 2287, + -469, -58, 126, 1011, -826, 386, -1019, -2390, + -586, -1401, 137, 760, 141, -89, 117, -252, + 3106, -936, -198, 390, 463, -245, -509, -123, + 3057, 1200, 3451, 282, -332, -585, -662, -955, + 165, -276, 73, 373, 202, 506, 356, 125, + 141, -613, -670, 446, 2031, 1521, -446, 1339, + 198, -112, 214, 70, 265, -1310, 2492, -133, + -1880, -347, -961, 312, -3714, -475, 102, 391, + 64, 1091, -686, -101, 144, 447, 173, 66, + -374, 342, 69, -3379, -1331, 1160, -889, -858, + 982, -1613, -223, 57, 186, 428, 226, -477, + 449, -1052, -661, -382, 459, 277, -277, -250, + 12, 4077, -260, -161, -163, 38, 159, 243, + 131, 457, -2253, -301, -1626, 37, 806, 104, + 191, 1899, 346, 398, -1108, -623, -391, 1092, + 1252, 1126, 81, -116, 1192, 674, -1321, -32, + 1739, -708, -230, -844, -507, 415, 261, 211, + -619, -191, 5460, 8, 139, 197, 392, -556, + -215, 66, 64, -808, 0, -136, 151, 156, + 260, 94, 418, -1446, 1815, -540, -793, 451, + -477, 1788, -124, 330, 1638, 342, -503, -384, + -1201, -762, 929, -2886, 888, -63, 318, 598, + 42, -1226, -400, -462, -136, 321, 1872, 376, + 1260, 142, -79, 4377, 9, 294, -71, -190, + -21, -2612, -240, 26, -18, -227, 864, 79, + 2588, -882, 87, -2976, 9, 480, -1573, -170, + -429, 201, -124, 171, 632, -60, -447, 64, + -37, -1182, -86, -105, 2901, -3557, -134, 486, + 141, -259, 239, 465, 467, 1009, -409, 34, + 254, 2469, 1002, 834, 557, -845, 149, -747, + -504, 494, 1382, 1067, 353, 191, -1105, 1705, + -586, 1472, -444, -1303, 198, 602, 471, 468, + 4855, 127, -141, 487, -454, -138, -392, -118, + -491, -948, 58, -290, -7, -662, 229, -268, + -2, -537, -620, -4770, 1152, -173, 166, -69, + 32, -2555, 433, -583, -2219, 1107, 1082, -942, + -173, 399, -601, 250, 423, 125, -448, 352, + -571, -406, 0, 4735, -264, -174, -1020, 1105, + -1149, -171, -252, -130, -202, -74, 601, 601, + 570, -2742, -1403, 3129, -349, 194, 309, 130, + 261, 93, 154, -117, -418, -657, 270, -160, + 1660, -818, 613, -1458, -653, -3763, -232, 90, + -265, -99, -28, -13, -281, -553, 11, -142, + -1764, -4548, 936, -21, -683, -88, -806, -187, + 28, 78, -70, -99, -2, -493, -16, 48, +}; + +static const int16_t cb1616m0[] = { + -3821, -3397, 203, -25, -22, 68, 189, -13, + -286, 94, 18, 288, 29, -5, 3, -414, + 1483, -172, -1275, -180, -3792, 360, 145, -143, + 444, -139, -198, 70, -17, -353, -121, -6, + 76, -50, 2987, 173, -3070, -229, -16, 192, + 134, -55, -86, -200, 128, -2052, -59, -11, + -4, 309, 179, 494, -138, -363, -336, 119, + -127, 2497, -169, -316, -87, -538, 42, -534, + 315, 2364, 61, 269, -87, -94, 82, -2069, + 18, 1238, -7, 79, -9, 41, 70, 50, + 209, -158, -136, 28, -275, 62, 296, 77, + 6269, -184, 73, -19, -25, -57, 134, -52, + 8569, -176, -8, 17, 15, 79, 36, -137, + 12, 44, -270, 2335, 111, 517, -83, 207, + -276, 2577, -198, 83, 376, -75, -273, 62, + 109, 4, -48, 122, -41, 99, -87, 14, + -7696, -118, -66, 171, 96, -31, 123, -217, + -676, -439, 407, 97, -281, 1873, 626, -148, + -548, 1634, 704, 97, -2076, -336, 632, -371, + 113, 544, -88, 184, -2200, -420, -592, -168, + 759, 291, 2215, 704, -140, -145, -4088, 295, + 186, -270, 283, 294, -42, 76, 69, 41, + -140, 1635, -200, -682, 302, -192, 902, -540, + -843, -494, -529, 102, -759, -165, 3160, -180, + -1450, -424, -16, 6, -548, 296, -3056, 219, + -1883, -109, -566, -431, 95, -422, -532, -26, + 120, -46, 23, 174, 175, -369, 110, -2, + 25, 132, -1, -3338, -67, 2140, -25, 566, + -129, 35, 1187, 337, 1999, 2712, -71, 45, + -177, 94, -321, -197, -573, 98, 225, 46, + 53, 78, -40, 82, 23, 2718, 2534, 89, + -65, 77, 206, 343, 527, 102, -191, 94, + 463, 111, -4529, 97, 876, -205, -944, 181, + -132, 467, 366, 85, -302, -100, -33, -76, + -3087, -2546, 215, 277, -52, 352, 137, -45, + 162, 590, 406, 382, 85, -2824, 141, 219, + -3790, 40, 126, 32, 30, 100, 121, -210, + 196, -268, 178, 102, 1229, -80, -750, -11, + -57, 84, 238, 3571, 274, -254, 55, -1616, + -176, -755, 46, -1306, -201, -228, 101, 197, + -93, -156, 319, 82, -385, -17, -4660, 180, + 1278, -113, -215, 103, 832, -233, 412, 249, + -900, -132, -3427, 52, 416, 267, 317, -384, + 130, 78, 91, -360, 75, 386, 2219, -360, + -2975, 17, 286, -294, -213, 231, 131, 821, + -358, 222, -230, -44, -93, -1151, 294, -316, + -8, 129, 231, -993, -58, 3319, 48, -2546, + -213, -14, 3208, 162, -240, -176, 307, -165, + -20, 348, -113, -78, -91, -8, -261, 8033, + -179, 64, -7, -113, -59, -32, -170, 52, + 55, -80, 140, 64, -39, 915, 28, 416, + 38, -2328, 206, 115, 366, -92, 652, 110, + -2838, -59, 613, 23, 109, -151, -198, 185, + 3033, -122, 2863, -273, 86, 41, 114, -99, + 315, 372, 14, 2191, -171, 531, -18, -34, + -352, 130, -360, 117, -2896, 2, -564, 51, + 223, 57, -257, 3161, 3130, -384, 126, -40, + -160, -232, -138, 81, -34, -96, 82, 9, + 62, -161, 344, 100, 790, -243, -344, -393, + -531, 401, 90, 171, 144, -329, 7, -4639, + -135, -6, 351, -21, -195, 224, -25, 6027, + 224, -14, 344, 170, -169, -97, 252, -488, + -379, -73, 629, -9, 266, 152, -64, 330, + -8, 2080, -91, -3315, 229, 25, 45, -528, + -123, 2951, 40, -85, -4, -2695, -38, -112, + 84, -30, 79, 762, 151, -4089, -95, -151, + 9, 138, -206, -3, -2114, 99, -100, 116, + -403, -56, -8, -36, 115, -18, -195, -38, + -240, 8, -32, 122, 125, -7406, 45, -210, + 111, -152, -152, -35, -72, 28, -154, 303, + -3147, 459, -2881, -14, -13, -56, -126, -69, + -213, -97, 202, -88, -277, -557, 451, -376, + -91, 319, 141, 2728, 23, 2506, -101, 632, + 62, -314, 159, 44, 1231, -65, -37, 192, + 3118, -186, -396, -108, 71, 2111, 586, 95, + 15, -28, 176, 20, -67, 3, -265, 101, + -182, -21, -455, -15, -6225, -45, -353, -384, + -22, 113, -40, -47, 57, -73, -503, 134, + 736, -70, -125, -5, -250, 62, 165, 182, + 185, -132, 426, -276, 100, -497, -23, 81, + -112, -3528, -1997, -234, -154, -91, -125, -26, + 179, -611, 655, 767, -1064, 130, -264, 107, + 2811, -1391, 298, -20, 37, -74, -12, -157, + -270, -106, 2559, -89, -3107, 55, 187, -265, + 195, 140, 1, -484, 713, 171, -1123, -226, + 3666, -367, -516, -249, 38, 195, 236, -378, + -383, -205, -72, -7, 15, -9329, -6, -26, + 56, 141, 48, 6, -141, -95, -69, -40, + -99, -80, 73, -253, 456, -174, 51, -250, + -48, -2115, -63, -2555, -25, -2058, -58, 66, + 176, 14, -10053, -23, -39, -37, -15, 38, + 82, 11, 97, 169, 5, -67, 57, 61, + -2248, 108, -19, 256, -169, -122, -336, -431, + -77, -250, -156, -745, 184, 684, 10559, -199, + -34, -37, 96, -82, -17, 60, 65, 21, + -67, -337, 62, 35, 74, -214, 38, 47, + -129, 6139, -139, -57, -154, 261, 7, -127, + 109, 40, 179, -99, 198, -51, 48, -36, + -2377, -194, -334, -2826, 103, -220, -57, 41, + 979, -895, 68, -217, -1712, -430, -98, 91, + -107, -1755, 2615, 84, -500, 231, 480, -31, + 146, -157, -120, 152, 2342, -36, -1969, 57, + -109, 476, -243, 261, -58, 1998, 4, 1388, + -98, 45, -140, 400, -76, -321, -22, -9, + 210, 517, 5, -4708, 66, -330, -405, -19, + 2158, -65, -2163, 244, -16, -192, 494, -381, + -194, 413, 89, 220, 455, -54, 4, 206, + 221, -4998, 63, -365, 354, 364, 677, 207, + -66, -27, -477, -182, 841, 85, -40, 166, + -185, 321, -293, -181, -429, -231, 1401, -122, + 938, 67, -185, 51, 3188, -802, 421, -3230, + 1432, -432, -658, -587, -843, 421, 177, 446, + 510, -140, -90, -127, -78, 2, 1089, -185, + 301, -393, 4100, -152, 265, 224, 25, 95, + 534, 280, -254, -45, -5, -207, 49, -126, + 8922, 43, 9, 21, 28, 21, -42, -84, + 38, 90, -2014, 61, -149, 188, -3350, -120, + -43, 10, 14, 155, -225, -351, -114, 28, + -23, -4400, 367, -51, 76, -89, -113, 122, + 2007, 25, -348, -227, -370, -61, 135, -79, +}; + +static const int16_t cb1616m1[] = { + -321, -7, -6725, -36, 77, -20, -101, -529, + -166, 97, -76, -232, -70, 16, 13, 93, + -50, 222, -258, -4424, -125, 125, 83, 313, + -246, -325, 108, -331, 484, -188, 192, -964, + 2603, -38, -2236, 58, 337, -254, -17, -90, + -88, 40, -141, -1293, -56, -811, 247, -78, + -34, 144, 112, 43, 142, -137, -147, 56, + -406, 12, 210, 132, 3707, 109, -896, -268, + -2295, -509, 32, -219, 113, -104, 141, 273, + 18, -358, 16, -3354, 3474, -167, 220, 10, + 104, -175, -8, -71, -77, -48, 277, 82, + 86, 35, -712, -32, 36, -65, 213, 121, + -76, -742, 291, -4587, -169, -122, -77, -285, + 54, -120, 89, 71, 12, -133, 54, -215, + -1906, -115, 3220, -194, -391, 87, 415, -212, + -210, -138, 182, 590, 713, 944, 320, 142, + -1970, 197, -79, -548, 458, 2836, 33, -62, + -183, -149, -640, 147, -427, -113, -178, -1631, + -108, 2666, -58, 2210, -251, 288, 16, 382, + 2123, 636, -4, 1118, 232, 335, -33, -114, + 24, -68, 1309, -38, 2080, 534, 288, -162, + -630, -360, -643, 10, 62, -2229, 263, 19, + 310, -44, 419, 2846, -2579, -159, -246, 685, + -67, 394, 314, -356, -158, 19, 90, 116, + -2261, 163, 664, 163, -191, -49, -18, -308, + -15, 2508, -370, 693, -62, 818, -307, -658, + 133, 1858, -4900, 53, -2485, -48, -9, 126, + 159, 6, -71, 291, 102, -367, -62, 27, + 88, -6, 204, -65, -725, 31, -159, -1, + -5, 45, -133, -146, 261, -4481, -19, 694, + -261, -478, -177, 88, 214, -836, -14, -762, + -111, 501, 0, 254, 1971, -1024, 2678, -141, + -6064, 76, 430, 160, -195, -582, 280, 580, + 183, -315, -13, 665, -53, 315, -199, 438, + 220, 3267, 194, 2, 2808, -88, 42, 150, + -179, 237, -155, 143, 46, 99, 27, 30, + -6137, -51, -89, 201, 145, -179, 13, -358, + 55, 71, -3, 28, -9, -16, 125, 160, + 159, -21, -5407, -485, -4, -88, -89, 44, + 3, 166, 22, -413, 993, 80, 485, -107, + 446, -943, 1025, 261, -3, 2991, 547, -268, + -109, 536, -10, 187, 17, 388, -120, -71, + -343, -416, 162, 69, -9, 46, -477, 83, + 6134, 146, -236, -125, -94, -55, -274, -231, + 1120, 171, -139, -2714, 80, -111, 20, 2475, + -135, -1710, 317, -762, 155, 1222, 68, 1192, + -15, 1825, -36, -45, -120, -484, -131, -162, + -128, 163, -407, 72, -222, -46, -222, -5319, + 278, -373, -436, 284, 138, -243, -104, 28, + -77, 3022, 93, -15, -581, -498, 292, -165, + -1740, 121, 195, -1368, -134, -68, -20, -75, + -10, 113, 128, -381, -507, -237, -709, 13, + -22, 155, -5065, -95, 246, -226, 193, 687, + 1839, 246, -232, -359, 475, 106, 297, 205, + -2702, -378, -219, -20, 140, -3198, 192, -3077, + -135, -38, -23, 213, -72, 255, -90, -130, + -150, 62, -484, -94, -2625, -89, 344, -129, + 2655, 369, -35, 17, -697, 251, -343, 68, + 53, 176, 3104, 237, -75, -3020, 178, 45, + -86, 45, -115, 183, 49, 26, 140, 77, + 40, -2315, 249, 1791, 48, -755, -12, 201, + -455, -250, -62, 1729, -113, -959, 238, -114, + 289, -135, -2208, 2748, 65, 306, -83, 3, + -513, -481, -49, -163, -568, -88, 668, -51, + -2586, 106, -22, 584, -453, -350, 333, -177, + -236, -657, 536, -349, 394, -56, 14, 133, + -55, -84, 210, -19, -8647, 154, 80, 27, + -7, -76, -117, 100, -201, 1, 296, -101, + -6, 5642, 137, -59, -93, 95, -110, -280, + -61, -300, 25, 887, 43, -30, 2493, 76, + -22, -343, 489, 266, 308, 163, 132, -349, + 2021, 18, 15536, 61, 11, -41, -42, 41, + -4, -183, -40, -24, 26, 241, -102, -115, + -164, 2044, -35, -217, -226, 734, -228, -2546, + 218, 0, 122, -150, -528, -188, -1273, 155, + 107, -33, -37, -293, 6, 112, -155, -228, + 192, -2378, 153, -1045, 213, 2975, 39, -159, + -10, -41, 34, -125, 4, -30, 3907, -41, + 848, -346, 191, -195, -292, -126, 3421, -24, + -244, 92, 693, 64, -193, 192, 121, -33, + -141, 523, -162, 2754, 71, 59, 40, -63, + -142, -100, -338, 379, -136, -64, -196, 11, + 3198, 162, 2097, -132, -2359, -193, -398, -318, + 842, -635, -168, 425, 2001, -136, 290, 206, + 562, -96, -8, -214, -45, -11, 4, 52, + 177, -148, 229, 33, -48, -46, 6538, -106, + -27, -22, 6527, 20, -405, 157, 87, 208, + -117, -4, 30, 87, 28, -356, -76, -108, + -33, -568, -270, 177, 49, -457, -3210, 119, + 103, 256, -180, 211, -1209, -369, -256, 37, + -47, 4976, 84, 207, 225, 224, -425, 396, + 921, 58, -150, 104, 1509, 15, -58, 1724, + 47, -24, 21, 376, 353, 482, -236, 634, + 306, 3179, 73, -33, -54, -169, -214, 146, + 4322, -216, -644, 305, 305, -453, 53, 143, + -9, -1472, -141, 1314, 57, 40, -55, -80, + 67, 9264, 57, 86, 22, -147, 1, -6, + 0, 39, 7, 114, -51, -137, 155, -15, + -122, 5, 137, 125, 213, -6, 7158, 36, + -52, -54, 149, 901, 859, 703, 366, 673, + -13, 1186, 588, -202, -451, 18, -585, -250, + -2632, -134, 61, -3038, 1022, 78, -672, -276, + 96, 838, 533, -254, -525, -106, -378, 1627, + 12, 31, 317, -118, 81, 313, -186, 197, + 452, -2971, 83, 1326, 419, -2366, -328, -87, + -103, -243, -280, 25, -240, 590, -232, 105, + -2966, -2391, -326, 338, 80, -392, -243, 271, + -7, 1127, 1, 1901, -2279, -207, 32, -99, + 560, -193, 371, 494, 506, 255, 332, 10737, + 48, 8, -33, -33, 32, -33, 45, -104, + -259, -99, -37, -134, 72, -50, 138, 428, + -2258, 77, 744, 5, 96, 3020, -269, 49, + 112, -223, 186, 48, 224, 2571, 340, -129, + -39, -1900, -45, 1978, -261, 223, 294, 22, + -108, -58, 109, -31, -3252, -138, -2969, -19, + -133, 190, -36, 132, -136, 63, -175, 351, + -76, 232, -2708, -17, -24, -130, -474, 74, + -2978, 45, -139, -23, 227, -42, -141, 278, + 81, 8, -2491, -446, 315, -64, -167, -643, + -275, 100, 0, 2484, -482, -128, -144, -206, +}; + +static const int16_t cb1616sl0[] = { + -46, -5073, 119, -68, 8, -160, 201, -15, + 55, 44, 44, -197, -110, -83, -90, -66, + -29, -128, 2449, -182, 2226, 298, -69, 189, + -167, 199, -78, 60, -154, -169, -242, 189, + 214, 132, -41, 169, 222, -130, 209, 20, + -154, -327, -3458, 186, 1356, 672, 133, 100, + 375, -491, -52, -87, 153, 537, 2513, -349, + 47, -27, 118, -301, 250, 45, 191, -150, + 279, 2367, -70, 191, -301, -206, -5, -40, + -201, 3680, -67, 36, -341, -133, -197, -383, + -101, 21, -68, -1240, 69, -8, -7, -16, + 28, -47, -145, -169, 32, 170, 246, 149, + 3039, -2617, -42, -95, 184, -74, 71, -56, + -22, -85, -203, 129, 97, -105, -91, -304, + 4, 93, 89, 2724, 2809, -178, 52, -155, + -152, 149, 47, 182, 124, -75, 24, 256, + -38, 53, -135, 63, 70, 59, -59, 7, + 6, 46, 8192, -157, 142, 81, 121, 136, + -87, -147, -71, 59, 57, 119, 21, -1938, + 46, 186, 100, -158, -52, 34, 95, 22, + 20, 179, 112, 116, 234, 2551, -3012, -167, + -93, -379, -90, 24, 208, 257, 253, 23, + -1361, 209, 75, 191, -23, -115, 2024, 264, + 77, -159, 77, -219, -237, -154, 13, 273, + -3338, 122, -205, 3796, -96, 103, -136, -60, + 115, -81, 19, 69, 396, 225, -280, 86, + 329, 284, 505, 403, -37, 203, 310, -2587, + -2374, -241, -17, 492, -42, -32, 261, 112, + 123, -33, -1271, -112, -41, 12, 82, 67, + -71, 56, -10, -83, -28, 15, -12, 42, + 2292, 297, -235, -3, 528, -57, 159, -185, + -54, -84, -152, 775, 15, 54, 451, -294, + 53, -2, 141, 39, -65, 75, 149, -5460, + 17, -58, -126, -281, 264, 151, 362, -98, + 62, -2361, -2560, 173, 42, -290, -161, -96, + -52, 82, 130, -86, -150, 48, 20, -57, + 52, -2263, -96, 2662, -66, 21, 74, -37, + 22, 323, 64, 270, -141, -599, -300, -121, + -12, -128, -96, -3, -129, -4339, -293, -55, + 31, -82, 8, 82, -20, 58, 15, -238, + 140, -125, -98, 7632, -14, 96, -129, -12, + -39, 85, 0, -104, -225, 24, 3, 95, + -87, 115, 168, 19, 22, 95, 8056, 36, + -12, 106, -99, -15, -87, 112, -122, 55, + 14, 282, -31, 80, 42, -4, 81, -73, + 74, -10, 82, 35, 173, -20, -40, -8192, + -35, -386, 270, 263, -231, -142, 42, -445, + 204, 177, -330, -859, 715, 2731, 59, 2578, + 220, -478, 3, 410, -47, 61, -214, 2765, + -206, 174, 56, 427, 442, 118, 2708, -66, + -40, 41, 119, -65, -71, -21, 124, 106, + -18, -2586, -35, 106, -364, 286, -16, -178, + -146, -82, 157, 92, -4, -437, -131, -85, + -27, -90, 23, -58, -5332, 115, -69, -25, + -14, 13, 52, 14, -286, -13, -60, 16, + 19, 53, 35, 7, -21, 7, 231, 48, + 2495, -82, 2836, 44, -134, -76, 33, -394, + 47, -124, -175, 95, 103, 161, 57, -37, + 174, -499, 131, -394, 2007, -2596, -481, 294, + 152, 601, 144, -438, 109, -204, 317, 37, + 362, -153, 216, 269, -39, 1250, 505, 505, + 2571, -115, -595, -806, -998, 1226, -71, 26, + -67, 262, 51, -161, 183, 1622, -32, 233, + 3, -217, 19, -16, 209, 51, 40, -40, + -43, -27, -7227, 13, -128, -18, 82, 154, + 133, -121, 33, -66, 8, -102, 71, 8, + 2780, -43, 79, 3212, -282, -165, 125, 78, + -101, -59, 59, -136, 308, -61, -295, -241, + -29, 27, -326, 2932, -563, 308, -269, -34, + -158, -26, -64, -411, -75, 420, -294, -239, + -11, 429, 44, 36, 69, -200, -56, 279, + 80, -218, -294, -294, 252, 64, 7793, 7, + -155, -56, -3118, -2749, -178, 62, 441, 105, + -45, 23, 23, -101, -109, -26, -149, 566, + -29, -394, -850, 1699, 1986, 243, -665, 565, + 155, -1746, 96, -344, -651, 387, -363, 283, + 241, 101, 71, -18, -9, 43, 114, -22, + 9, -109, -119, -92, 117, 8192, -67, 87, + 174, -42, -195, 527, -155, -195, -167, -1619, + 2638, -824, 121, 44, 138, -808, 407, 584, + -217, -90, -278, 549, -118, -1278, 837, 220, + 142, -956, -294, 89, 2627, 269, -129, 253, + 10, 15, 167, 163, 87, -262, 89, 48, + 14, 24, 2967, -175, 2550, 51, 11, -152, + -111, 230, -267, -79, 321, -641, 507, -32, + -20, -238, 23, -322, -2506, 173, 2205, -91, + -21, -1594, 420, -157, 97, 64, 126, -38, + -84, 10, -85, 93, -21, 272, -427, 30, + -60, 61, -81, -40, 27, 18, -29, -208, + -70, -8192, 16, 15, 53, 34, 49, -26, + -2512, -152, 23, -77, 3015, 87, -164, 247, + 119, 91, 444, -43, -166, -26, 253, -93, + 50, 408, -3274, 913, 104, 119, 17, -54, + 42, 19, -294, -298, -416, -82, 38, -263, + 137, 132, -2609, -44, 2783, -34, -9, 266, + 8, 18, -183, 520, 515, -93, -159, -21, + 186, 27, -89, 137, 77, -60, -33, 34, + -5115, -44, -172, -122, -9, -104, 69, 16, + 94, 2813, -200, -142, -50, 375, 3276, -272, + -44, 47, -41, -188, 263, -237, -24, 312, + 120, -326, 823, 193, 410, -95, 356, 565, + 296, 1202, -2737, -968, 87, -204, -1329, -826, + -827, 584, 194, -31, -12, -109, -39, -7, + 73, 29, 24, -12, 256, -98, -46, 63, + 207, -8, 73, -342, 4578, -37, 60, -66, + 8, -39, -176, -125, -34, 57, -141, -52, + -39, -128, -50, -143, -85, -107, 19, -38, + 74, -40, -161, -54, -63, -3452, 176, 116, + 5274, 19, -42, 198, 3, 33, 80, -99, + -111, 11, -90, 97, -6, -3, -52, 301, + 2335, 148, -171, -88, 44, -404, 124, 4, + -80, 189, 2838, 62, -247, 394, -230, -91, + 92, -2587, 84, -139, -31, 3014, 25, 201, + -137, -64, 383, 2, -70, -115, -210, 43, + -1111, -403, -379, -9, 243, 77, -220, -60, + -38, -15, 7, 109, 41, 143, 56, -211, + -2492, -48, -218, -115, -321, -358, 388, -10, + -172, -52, 177, 2996, -96, 480, -23, -15, + 177, -225, 217, 10, 367, 129, -45, -114, + 23, 257, -48, 2497, 236, 12, 197, 245, + 19, -173, -321, 310, 406, -280, -72, -279, + 73, 3307, 245, 78, -186, 2928, 264, 263, + -227, 50, 172, 91, 293, 24, -148, -245, + -61, 219, -88, 169, 220, -99, 3222, 3, + 0, 103, 19, 116, 69, -180, -7, -49, + 26, -59, -93, -68, 123, 357, 241, -3308, + -297, 198, 40, -80, 285, 161, 90, -46, + -165, -32, 87, -5676, 254, -37, 7, -20, +}; + +static const int16_t cb1616sl1[] = { + 73, 78, -64, 76, 17, 6250, -4, -167, + 52, 4, -3, 11, -189, -19, -136, -220, + 15, 6, -420, -2205, 38, -2944, 16, 118, + -116, 61, 119, -390, 217, 548, 24, 161, + -24, -2342, -148, -159, -2783, 225, 401, -226, + 210, 643, -366, 240, 264, 167, 115, 827, + -39, -161, 30, -173, 42, 29, 98, 377, + -58, -163, -41, 27, 25, 4368, 87, -2836, + -175, -71, -62, -84, -476, 4, 2466, 113, + -2830, -916, 593, 276, -356, -427, -686, -215, + 2752, 395, -9, -345, 117, -122, -327, 92, + 107, -106, 32, 270, 271, 171, 3138, 198, + -46, -70, 46, 502, 91, 77, -19, 216, + 94, 122, -64, -392, -31, -2696, -364, -131, + -315, 129, -461, 229, 192, 236, 185, -263, + -173, 44, 24, -267, -40, -177, -149, -2471, + 26, 113, -183, -1693, -188, 48, 22, -73, + 50, -133, 58, -70, -173, -308, -442, -188, + 92, 389, -35, 167, 235, 66, 2593, 2435, + 244, 630, -22, 235, 112, -32, 533, -158, + 81, 71, 44, -59, -158, -23, 28, 8192, + -58, -181, 39, 220, -54, -124, -59, -277, + 71, 41, -82, -157, -6860, -4, 44, -84, + -48, 134, -193, 159, -45, 218, -47, -133, + 147, 1749, 765, -84, 184, -317, -286, -17, + -340, -262, -244, -21, 3122, 290, -127, -119, + 179, -128, -125, -439, 2766, 1917, 85, 57, + -32, 373, -16, 170, -74, 31, 425, 626, + 1, -511, 64, 387, 142, -621, 183, -224, + 220, 1195, 386, -3360, 332, 484, -1112, -96, + 187, 43, 1838, 39, -36, 13, -132, -8, + -1, -43, 29, -132, -19, 10, 10, -218, + -3659, 119, -103, -27, -29, -108, 13, 181, + 39, -117, 92, 37, -17, -198, 330, 538, + 17, 113, 4758, 1, 28, -10, 87, 22, + 96, -14, -99, -56, -130, 0, -55, 45, + -63, -2845, 2751, 464, -31, -62, 76, -154, + 88, 81, 125, 373, -348, 587, -314, -278, + -53, 2039, -516, 2437, 191, -212, 87, -2, + 181, -242, 117, 23, -63, 334, 145, 454, + 343, -235, 91, 69, -8, 2, -106, -108, + -5, 137, -168, -7818, -231, 25, 37, 75, + -138, 56, 142, -596, 130, -114, 3293, -366, + 290, 160, -2, -219, 83, 843, -18, 1289, + -177, 226, 667, 252, -683, 816, 26, 157, + 168, -487, -49, -3282, 432, 184, 1207, 23, + 164, 544, 965, -1, 61, -118, 92, 1359, + 89, -3234, 15, 496, 244, 177, -613, -160, + -23, -195, -111, -372, -115, 278, 96, 77, + -2567, 49, -423, -468, 13, -484, 1345, -298, + 194, -123, -248, -139, 738, 102, 1154, -335, + 2694, 1326, 213, 758, 17, 154, 609, -518, + -367, 201, -144, 61, 66, 2288, 50, 2688, + -87, 45, -13, -101, 127, -190, -40, -286, + 6, 121, 32, 31, 119, -85, 28, 93, + 8192, 273, 169, 44, 37, 255, -224, 219, + -34, -127, -134, 165, 169, 126, -188, -52, + 98, 15, -5820, -193, -331, -395, -1, 49, + -187, 55, -121, -196, 114, 10, 258, -145, + -14, -385, 105, -187, 59, 383, 5322, 147, + -110, -69, 378, 138, -352, -69, 15, -267, + 75, 162, -6, 3148, 515, 231, -74, -436, + 1288, 1234, -105, 68, -96, -166, -49, -64, + 144, -67, 135, 258, -71, -162, 156, -366, + -7, -67, -133, -20, -119, 71, -84, 31, + 26, 116, -2237, 212, 43, 380, -74, 13, + -7, 774, -1276, -103, -124, -48, -178, -319, + 26, 435, -111, 858, 295, 1601, -2727, -242, + 8, 36, -61, -20, -19, -19, 31, 258, + 21, -14, 381, -153, -8192, -99, 327, 72, + 175, -1181, -271, 104, -30, -135, -169, 21, + 29, -182, -25, 125, 165, -82, 73, -26, + 2311, -85, -2983, -125, 85, -206, -100, -100, + 36, -3, -77, -180, 35, 0, -170, 123, + 168, -302, 366, -334, 2936, -70, 404, -2870, + 13, 79, 226, -163, -242, -124, -40, -171, + -109, 189, 20, -52, 144, -1869, -88, 230, + -8, -27, 45, 131, -11, -188, 93, -227, + -452, -229, 158, 377, -9, -1736, 16, 3268, + -164, 41, 305, -414, -642, -111, -100, 118, + -155, -236, 936, -114, 51, 31, 60, 1299, + 5, 3048, 274, 273, -197, -289, -245, -288, + 1927, -7, 27, 307, 174, -243, -95, -134, + 14, 24, -119, -132, -2811, -254, 35, 95, + 22, 135, 21, -155, -80, -143, -60, -6, + 182, 77, 11, -197, -8, -6080, 28, 155, + 11, -27, 22, -48, -8, -50, -122, 11, + -34, 342, -1, 40, -208, 117, -35, -69, + 150, -3944, -425, 46, 456, 182, -451, -219, + 38, 15, -203, 766, -232, 243, -70, 179, + 2107, -222, 346, -166, 143, 239, 245, 59, + -137, 17, 475, -68, 2679, -423, 20, -313, + 74, 152, 171, -269, 68, 39, -4743, 94, + -3, 110, 134, -168, 73, 180, -116, 276, + -74, -203, 2, -83, 17, 170, 96, 169, + 75, -5541, 46, 20, -168, -22, 35, -74, + 104, -153, 264, 4, -57, 94, -192, 161, + 15, 7, 45, -186, 15, -125, 121, -4981, + -254, 179, 282, 72, 543, -97, 363, -5, + -67, -389, -66, 178, 427, -276, -2675, 447, + -2, -125, -223, 2869, -502, 117, 2017, -71, + 41, 9, 124, 19, 357, -562, 25, -385, + 80, -53, -175, 2532, -73, -2990, -164, 57, + -128, -254, 53, -150, -180, 16, -45, 322, + 266, -2418, -264, 317, 371, 5, 197, 7, + -2476, -93, 152, 90, -165, 11, -259, -24, + -55, -16, 98, -4904, -116, 53, 205, -45, + -57, 116, 75, 161, -55, 97, -292, 27, + -1396, 105, -127, 133, -265, -33, 5, -3622, + 25, -3, -104, 8, -283, -229, 236, -208, + 145, 627, -240, 118, 296, 108, -309, 48, + -3345, 582, 498, 259, 20, 785, -138, 421, + 97, 370, 161, 141, -2793, 106, -246, -140, + -172, 42, -194, -202, -319, -107, -24, 423, + 7293, -109, -13, -242, 55, 171, 13, -93, + 131, -141, 88, 132, 76, 176, 78, 153, + -63, -55, -410, -39, 6, 27, -223, -174, + 61, 645, 167, -35, 3079, -173, 950, 1, + -109, -118, -106, 15, -1345, -14, 50, -70, + -69, 24, 109, 182, 84, 31, -179, -93, + -3152, -3013, -60, 56, -60, 58, 166, -161, + 24, 129, 1, 181, 128, -12, 273, -43, + -1256, 134, 159, -36, 175, 43, -49, 41, + 48, -38, -45, 59, -36, -82, 48, -74, + -104, 2944, -124, -24, 98, 248, -146, -231, + -241, 72, -114, 776, -498, 242, -357, 250, + -102, 7121, 109, 11, 94, -53, 37, -37, + -133, 24, -157, 47, -46, -69, 62, -79, +}; + +static const int16_t cb1616ss0[] = { + 1401, 373, -516, 330, -711, -752, -475, -224, + 139, 492, -556, 4629, 1039, 333, 872, -542, + 474, -360, -378, -3459, 254, 1199, 113, -525, + -1705, 231, 46, 188, -50, -1038, 32, -198, + -109, 619, 1071, -1601, 1002, -411, -189, -3276, + 615, -468, -467, -275, -1286, 736, 541, -1107, + 423, 191, 439, -205, 17, -87, 500, 176, + 262, -341, -142, 268, 8164, -2, 112, -190, + 227, -50, -143, -326, 647, 601, 482, 443, + 2761, -497, 979, -298, 454, -2927, 746, -735, + 3921, 480, -167, -317, 1303, 111, 216, -961, + 110, -595, 244, 246, -222, -205, 46, 61, + -798, 258, 360, -7038, -654, -95, 75, 498, + -24, -250, 71, 138, 527, 240, -215, 250, + -408, 552, -325, 333, -989, 2648, -483, -1121, + 2344, -1647, -116, -901, 615, 327, 1, 497, + 411, -138, 332, 281, -145, 337, 163, -7379, + 70, 265, 365, 238, 604, 99, -149, 233, + 109, 827, -704, 1367, 1208, -717, -17, -223, + 15, -3259, 53, -485, -631, 285, 511, -8, + 242, 547, 129, 145, 2046, 520, 44, -177, + 382, 283, -169, -346, -2737, 294, -1311, 145, + 1873, 815, 1078, 677, -3419, -434, 484, 144, + -27, 669, 153, -242, -242, 814, 350, 361, + -462, -63, 2317, 1259, -373, -489, -534, 300, + 867, 2621, -117, -168, -414, -239, 812, 840, + 112, -463, -6286, -693, -830, 140, -168, 448, + 549, -149, 418, -105, 137, 31, -40, -43, + 422, -99, 297, 3, -220, -15, 81, 45, + -647, -535, -448, -731, 250, -6742, -320, -350, + -192, 1540, -1112, -1043, 1317, -1203, 1035, -506, + 673, 721, 854, -1487, 780, -294, 1173, 2142, + -8192, -170, -138, -54, -54, -233, -127, 145, + -233, -185, 87, 20, 530, -305, 141, -394, + 310, 40, 645, 809, 4801, -186, -432, -451, + 312, -144, -65, 65, 135, -64, -15, -357, + -3546, -1299, 216, 249, 261, -207, 117, -3138, + 527, 14, -142, 286, 100, 340, 581, 157, + 234, 739, -2521, -3, 639, -1440, 131, -3796, + 159, 39, 41, -659, 284, 165, 1100, -346, + -481, 295, 806, -227, -288, 4520, 253, 487, + -252, 88, -43, -1612, -5, -57, -66, 18, + 19, 557, -337, 1526, -2897, 144, 844, -404, + 1976, 787, 246, 264, -406, 778, -918, 51, + -113, -235, 518, 602, -307, -2046, -692, 2775, + 400, -2165, -184, 139, 403, -1855, -1317, 289, + 710, 1124, 1888, -517, 276, 190, 637, -441, + 717, 972, -370, 478, 626, -354, 241, -3651, + 145, 7, -738, 397, 991, -343, -826, 142, + 672, 2425, -616, -3278, 751, -193, -944, -35, + -1061, 1258, 631, -721, 145, -112, -69, 828, + -39, -196, -237, -73, 771, -195, 239, -533, + -1673, 3477, -559, 104, -647, -798, 167, -497, + -559, 591, 259, 300, -25, 422, 93, 39, + -63, 233, 144, -1170, 142, -456, 73, 411, + 6920, -338, -307, 436, 143, 420, 152, -9, + -1788, -1096, -2998, -727, -524, 128, 460, 782, + -102, -576, -138, -976, 1035, -3196, -436, -27, + -1047, -1389, 3244, -143, -883, -1012, 4, 327, + 16, 411, -497, 1444, 516, 1183, 252, 510, + -698, -676, 569, -70, -397, -227, 7829, 312, + -410, 20, 41, -65, -219, 175, 297, 40, + -1534, -498, 194, 871, 409, 280, 1098, -1471, + -2825, 931, -105, -545, -801, -795, -372, 73, + 331, 100, 488, -2101, 560, 44, 885, 1065, + 380, -195, 276, 124, -87, 193, 3979, 30, + 95, -509, -931, 2737, -457, 805, 10, 53, + -73, -203, -587, -177, 242, 238, 656, -3403, + -380, 2364, 2902, -226, 204, 1559, -2219, -40, + -442, 111, -703, -424, -252, -241, 461, 749, + 658, -481, 125, -366, 601, -246, -286, 132, + 297, -232, 5231, -141, 196, -121, -235, 406, + -199, -174, 87, -107, 363, 272, -563, -620, + 235, 223, -627, -339, -467, 349, -1596, -5496, + 644, -96, -81, 1938, 749, -160, -1976, -1436, + -1056, -1045, -1098, 2327, 976, -57, -124, 1139, + 275, -209, -636, 298, 2484, 2764, 962, -39, + 108, -718, -442, 9, 797, 1123, 1092, 1179, + -1170, -701, -381, -237, -1266, -1045, -337, -351, + -274, -981, -272, -111, -3409, -387, 421, -406, + -2123, 623, -18, 2473, 617, 176, 26, 1402, + -1351, 212, 23, -172, 296, 1572, -63, -402, + 837, -521, 2209, -613, -329, -309, -180, -1152, + -535, -1380, -2617, 475, 385, -672, 182, 92, + -2211, 320, 109, -633, -582, 1208, -1536, 1009, + 896, 1991, -374, 1750, -1259, -341, 1774, 1063, + 678, -2084, 987, -337, 48, -205, -82, -288, + 388, 217, 1263, 2427, -1472, -1073, -964, -836, + 2086, -161, 438, -449, -37, -926, -3706, 164, + -372, -616, 160, -572, -725, 727, 11, 53, + -84, 7494, -74, 523, -172, 464, 452, -426, + 803, 106, -262, 32, 298, -491, -181, -760, + -908, 303, 747, 1316, 272, 906, 767, 105, + 247, 6120, 948, -557, -928, -595, -342, -450, + 686, -815, -1243, -157, 572, 1414, 166, -229, + 3317, 1940, -283, 623, -781, 717, -212, -707, + 30, 3635, 1147, -696, -928, -637, 925, 797, + 843, -1359, 214, 1096, 1031, 852, -84, -228, + -34, 1067, -1109, 392, 292, -755, 3495, -40, + -1806, -637, -236, -602, -264, -147, -68, -233, + -55, -2005, -271, -647, 963, 309, -5, 56, + -275, -398, 34, -496, 2556, 1249, -87, -112, + 1663, -554, -1926, 627, 2515, -1128, -566, 1539, + 740, 38, -614, 272, -232, -152, -782, -420, + -304, -2313, -33, -944, -77, -3468, -69, -1730, + -21, 665, -314, -1640, 660, 661, 106, -21, + -1505, -2888, -427, -866, -666, 3128, 786, -55, + 739, 112, 8, 567, -602, -350, 165, 108, + 767, 64, -715, 980, 673, -186, 768, -545, + -298, -233, -524, -70, 511, -2051, 3816, -1104, + 529, 1012, 2577, 777, 342, -387, 2730, 247, + -20, -227, -432, -263, -885, -1192, -644, -259, + 2314, 38, 108, 614, -386, 470, -78, 681, + -3334, -1049, -300, 177, -174, -422, 110, -641, + -406, -472, 468, 885, -730, -877, -1972, -1372, + -410, 545, 543, -800, -1156, 279, 3290, -1305, + -213, -262, -832, -994, -1110, 718, -364, 1416, + -7, 963, 452, 680, 165, -3815, 903, 806, + 149, 11, -1332, -622, -451, 152, -618, -309, + 246, 435, -2098, 487, 469, -451, -1574, -204, + -187, 552, -333, 515, -331, 1452, 278, -2691, + -146, 1009, 353, -839, 6, -3206, -1080, -572, + -2698, 752, -1726, -318, 397, -152, -128, -77, + -36, -506, 456, 1094, 281, -158, -19, -149, + 48, -2831, 2042, 2545, -161, 619, 1129, 274, + 24, 1, 313, -164, 655, 157, 770, 182, + 1942, 241, -898, -1748, -589, 256, 322, 683, + -65, -73, 621, 74, -317, 2585, 185, -465, +}; + +static const int16_t cb1616ss1[] = { + -3218, -607, 1665, 1100, -563, 421, 377, 445, + -270, -3, -1503, 224, -593, -316, 31, 362, + 1186, 389, -1817, 589, -2842, 289, -1925, -356, + -228, -148, 618, 135, 358, 238, 1, -767, + -266, 1, 101, 245, 231, -167, 408, 1, + 162, -35, 241, 215, -4702, 486, 546, -339, + 349, -292, 1342, -881, 184, -675, 2639, -284, + -995, 346, -499, 1499, 1616, 578, 445, -78, + 844, 1800, -686, -414, -1425, 795, 754, -1418, + -178, -2226, 515, -143, 43, 569, 967, -2333, + -1991, 282, 528, 1410, -377, 736, 394, -230, + -365, -242, 2773, 136, -738, -36, -1171, -76, + -132, -300, -223, -680, -416, -2738, 93, 414, + 490, -346, 75, -1089, -1132, 2237, 1844, 395, + 325, -1514, 1913, -1850, 1162, -442, 689, -66, + -71, -83, 342, -197, -940, 206, -3381, -1275, + -423, -87, -455, 498, 865, 355, 1225, -115, + -3333, -404, -588, 1021, -2180, -1470, 1225, 728, + 59, 2592, -335, 194, -649, 3586, -951, -142, + -947, 898, -99, -269, 977, 1520, 488, -364, + -253, 127, 2524, 849, -1166, -191, 627, 372, + 772, 145, -21, 279, 402, -863, -2695, 1217, + 1543, 1005, -1419, 1712, 110, -2191, 969, 1563, + 183, 811, -218, -1078, -220, -1092, -322, 803, + -533, -359, 405, -70, -771, -267, -4730, 235, + -607, -387, -285, -68, 48, -60, -222, 229, + -1087, -1261, -2249, 1265, -1624, 864, -65, 223, + -322, 337, -262, -3170, -12, 4571, 19, 198, + 458, -1029, 2560, -3, -115, 619, -645, -836, + -399, 246, -81, -12, -1057, -2119, 2780, 25, + -1559, 291, 592, -513, 62, 157, 553, 570, + -657, 72, -118, -284, -454, 3853, 145, 259, + -1709, -2161, -3167, 189, -233, -1099, 141, 114, + -506, -1012, -775, 474, 331, 798, 469, 1915, + 96, -266, -385, -329, -658, 192, 16, 97, + -47, 284, -163, 200, 189, 18, -7453, 160, + -2988, 2725, 520, -132, 2593, 627, -694, -26, + -558, 44, -209, 40, 377, 491, -68, 384, + 271, 2117, 642, 3166, -569, 702, 513, -1858, + 108, 944, 248, 166, 681, 408, -908, 525, + -145, 1035, 189, 2812, 135, -356, -2551, 401, + 150, -508, -265, 244, 461, 958, -233, -204, + 744, -1603, 397, -229, -174, 539, -139, -4473, + 837, -310, 253, -635, 397, -80, 601, -371, + -2015, -261, -364, 50, 331, 89, -938, 709, + 1444, -2910, -228, -162, 419, 62, -319, -266, + 584, 3728, 57, 220, -543, 768, -630, 361, + 361, 642, -313, 182, -488, -48, 3001, -397, + 640, 179, 8, 1081, -1161, -58, -70, -64, + 4456, 323, 883, -191, -16, 61, 419, 429, + 627, -898, -883, 750, 499, -1335, -467, -1410, + -5, 283, -301, 276, -1636, 310, 114, -428, + -8192, 12, -114, 74, 215, 511, 317, -314, + -86, 198, 138, 315, -271, 246, -363, 426, + 608, -714, 367, -1356, -2217, 1178, -385, 1442, + 28, -642, -371, -87, -2895, -710, 303, -150, + -398, -868, -1727, 1548, 982, 1177, 332, -377, + 1580, 962, -1028, 1922, 1494, -824, 93, -1362, + -552, 1641, -1729, 228, 1054, 421, -185, -536, + 51, 87, -204, 88, -847, -754, -3761, -2706, + -138, -1242, 35, 64, 418, -460, 713, 3960, + 733, 468, -150, -823, -211, -674, 366, -269, + 180, -294, -384, 604, 1829, -121, 271, 241, + 192, -211, -2672, -1483, -1102, 960, 90, 49, + -1144, 2552, -887, -32, -301, 62, -183, 193, + 78, -781, 193, -606, -285, -3082, 240, 392, + 704, 20, -1103, -195, 166, 577, -105, -45, + -310, -106, 3035, 28, -369, 725, 53, 87, + -232, -191, 7, -282, -572, -8192, 325, 99, + 162, -113, -237, -209, 412, -573, 295, -389, + -1603, -66, -485, -867, 466, -882, 862, -216, + 221, 50, -51, 3927, 557, 441, 223, 234, + 4048, -173, 420, 1670, 436, 341, 175, -441, + -201, 75, -549, 315, 172, 418, -159, 7, + 2973, -3, -220, -1360, 26, 2781, 132, 295, + -15, 217, -166, 187, -282, 357, -121, 480, + -216, 294, 263, 95, -7367, 589, -63, -412, + -103, -201, 335, -96, -203, 240, 223, -435, + 366, -467, 118, 528, -472, -559, -417, -189, + -641, 339, 1546, -2741, 1413, -265, 637, -1556, + -49, 422, -195, 392, -21, 3, -2, 282, + -130, -272, -483, -860, -675, 762, -1455, 5212, + 178, 197, -468, 270, -310, 1038, 406, 2699, + -537, -33, 272, 225, -1986, 1295, -857, -2906, + -904, -1861, -206, 866, -145, -207, 252, -825, + 3051, -1361, -441, 85, -186, -127, 139, 285, + 3067, -332, 1163, 248, -483, -177, 268, 691, + 733, -104, -54, 2541, -1042, -226, 165, 250, + 7, -259, -383, 327, 2164, 2272, -750, 2482, + -930, -139, 1203, 766, 150, 320, 970, 28, + -1351, 467, 544, 521, -2908, -75, -902, 611, + 575, 1216, -209, -7, 541, 330, 528, 347, + -185, -306, -432, -3384, -1844, -380, 155, -1230, + 629, -1085, -413, 119, 114, 1093, 198, 806, + 491, -137, -518, 536, -64, 387, -1712, 608, + -24, 4961, 149, 299, -342, 505, 503, -387, + -944, -297, -2423, -98, -1027, -432, -259, 736, + 127, 3561, -473, -623, -751, 114, -438, 657, + 2448, 863, -413, -81, 2066, 988, -539, -528, + -111, 314, 390, -1228, -863, 19, 763, 2227, + -844, -24, 4164, 139, 130, -111, -630, -428, + 538, -606, 940, -877, 122, 526, 194, -104, + 127, 117, 907, -789, 2865, 526, -548, -253, + 289, 2329, 176, -70, 775, 681, 21, 38, + -1481, 766, 2093, -2974, -289, -571, -445, 1833, + 333, -84, -243, -413, 188, -492, -22, -867, + 605, -333, 904, 3192, -29, 491, -411, 370, + -556, -2671, -294, 132, -243, -233, 180, 181, + 383, -79, 26, -3539, 642, 1127, -2125, -170, + -386, -135, -703, -290, -157, -444, -885, -341, + -920, 460, -407, -176, 3153, -3084, -505, 543, + 7, 79, 1191, 1148, -401, -17, 289, -735, + 300, 1971, 626, -146, 110, -1281, -613, -649, + -206, 1850, 701, 1138, -803, 742, -1392, 147, + 554, 1861, -658, -1481, 108, 856, 1021, 574, + 3314, 518, -1156, -307, 42, -92, -132, 278, + -352, -37, 35, 146, -93, -662, 216, 125, + 823, -876, -170, -5027, 444, -182, 844, 189, + -490, -1441, -335, -907, -173, 1138, -472, -1505, + -1641, 648, 66, 627, 64, -1096, -620, 1588, + -506, 309, -100, 5702, -555, -157, -179, -85, + -299, -114, -20, 178, 415, 118, -581, -132, + 1025, -2631, -1154, 2623, -286, 201, 340, 949, + 235, 171, 649, 328, 397, -142, 1369, -7, + 2305, -373, 658, -1681, -744, -3574, 34, -183, + -504, 165, 81, 21, 635, -307, 428, -520, + 164, -4701, 744, 249, -844, -7, -334, 38, + 539, 267, -213, 73, 134, -251, -248, -923, +}; + +static const int16_t cb1616sm0[] = { + -4119, -2861, -76, -49, -192, -542, 0, 94, + -550, 6, 601, 236, -446, -202, 167, 238, + 2609, -688, -406, 265, -3078, 321, 59, -601, + 157, 200, -265, 78, -699, -679, 18, -54, + 203, -687, 2683, -111, -3037, -627, -493, 413, + -480, 54, 75, 276, 206, -1861, 17, -420, + -169, 312, 361, -277, -12, -363, -592, 758, + -123, 3267, 78, -862, 81, -356, 596, -536, + 729, 2239, -49, 553, 112, 444, 652, -2990, + -70, 1084, -436, 34, 53, -10, -23, 41, + -3, -126, 207, -130, -208, 63, 480, 191, + 6229, -45, -33, -82, 35, 56, 259, 1, + 8034, -97, 52, -159, -334, -41, 50, -57, + 56, -194, -567, 2050, 146, 987, -383, 416, + -258, 2846, 51, 8, 690, -126, -704, 316, + 16, -4, -90, 159, 34, 126, 65, 218, + -7037, -261, -87, -21, -185, 14, 112, 42, + -164, 274, -269, 1138, -208, 574, 589, -143, + -479, 2745, 782, -13, -2492, -132, 498, -406, + 260, 828, -580, 558, -2861, -600, -447, -313, + 1316, 800, 1772, 1131, 323, -48, -3972, 697, + 5, -403, 46, 95, 130, 84, -39, 219, + 117, 1629, -189, -1371, 25, -116, 2311, -681, + -411, -685, -1340, -409, 223, -462, 2530, -816, + -1118, 314, -893, -109, -262, 376, -2795, -48, + -2878, -6, 180, 53, -500, -181, 125, -291, + -265, -154, -23, -184, 185, -563, -1159, 675, + 24, -213, 273, -2905, -242, 2373, -6, -166, + 92, 276, 1375, -28, 1879, 2572, 205, -121, + 51, 356, -873, -308, -1060, 952, 719, 456, + 106, 116, -107, -211, -21, 3319, 2109, -172, + -172, 143, -718, -138, 1135, 232, -1361, 157, + -99, 522, -4367, 84, 605, 319, -937, -397, + 117, -434, 82, 633, 274, -1555, -221, -59, + -2419, -2486, -112, 136, -182, -480, 27, -548, + -237, 817, 530, 656, 252, -2685, -26, 703, + -3268, 381, -383, -323, 105, -500, 66, -299, + -1056, -363, -69, 21, 292, 398, -379, -106, + -356, 38, 169, 2866, 206, -523, -277, -2875, + -582, -69, 649, -3, 198, -30, 98, 145, + -125, -186, -19, -107, -102, -173, -7299, -62, + -503, -231, 24, 145, 1367, -355, -175, 373, + -953, -704, -3454, 170, 899, 386, 592, -754, + 620, 81, 86, -65, 84, 683, 3054, -280, + -2825, -757, 53, -10, 441, -145, 138, 1364, + -2, -92, -300, 225, -199, -2087, 1095, -363, + -75, 288, 765, -869, -7, 3261, 9, -2860, + -330, -382, 3309, 28, 629, 244, -143, -298, + -512, -409, -241, 104, -6, -271, -2, 8192, + -137, 139, -304, -14, 81, 262, -36, 51, + 380, 11, 101, 100, -153, 2167, -271, 267, + 306, -3008, 579, -277, 316, 327, 1168, 71, + -1401, 389, -25, -265, 101, -53, -170, -226, + 2861, 145, 3040, -159, 77, -16, 233, -570, + 490, 661, 452, 1986, -522, 212, -107, 196, + -247, 308, -353, 186, -2689, 486, -46, 813, + -24, 233, -166, 3305, 2832, -343, -82, 475, + 267, -385, 26, -35, -226, 27, 416, 231, + 12, 88, -209, -139, 404, -239, -109, -182, + -851, 260, 242, 109, 11, -1096, 85, -4226, + -124, 12, -139, -100, -604, -87, 89, 5820, + 59, -43, -84, 264, -543, 0, 428, -16, + -146, -556, -195, -159, 875, 27, 261, 207, + -182, 2367, -622, -3193, 481, -289, 52, 12, + 34, 3014, 10, -345, -94, -2883, -62, 400, + 249, 51, -178, 1190, -128, -3940, 41, -296, + -48, 13, -26, 223, -2392, 516, -384, 33, + -46, -161, -43, -224, -89, -4, -349, 135, + 540, -120, -276, -198, 129, -5113, 175, -45, + -34, -109, 419, -45, -104, -185, -393, 416, + -3514, 149, -3088, -115, -78, 431, -172, 21, + -290, -162, 216, 41, -56, -487, 705, -194, + -1003, 100, 172, 2793, -83, 2584, -189, 1198, + 551, -119, -73, -91, 2103, -619, 124, 128, + 2628, 192, 160, -110, 270, 1739, 1062, -568, + -73, -56, 328, 100, 384, -173, 83, 39, + -236, -25, -457, 53, -6413, 345, -459, -110, + 28, -127, -109, -593, 32, 141, -879, 254, + 2132, -410, -623, 1103, -2302, 528, 156, 28, + 81, 613, 602, 171, 500, -2356, 620, 17, + -523, -2961, -921, -107, -405, -230, -129, 18, + 363, -881, 1282, 1427, -363, 658, 205, -51, + 2835, -2003, 188, -26, 73, -231, 352, 74, + -490, -222, 2423, -341, -2762, -14, -56, -260, + -41, 33, 169, -190, 1248, -77, -2322, -607, + 3610, -104, -200, -90, -81, 719, -52, -359, + 394, -301, 66, -39, -56, -8192, 87, 56, + -291, 50, 231, 284, -211, -16, -86, -84, + -28, 52, 3, -51, 304, -224, 228, -374, + 458, -1958, -210, -2613, 401, -2128, -119, -12, + -60, -14, -8192, 53, 27, 113, 289, -7, + 22, 60, -192, 333, 72, -344, 238, 147, + -2235, 324, 124, 176, -415, 450, -476, -558, + -429, -246, -551, -287, 672, 2145, 8192, 161, + -165, -34, 193, -108, -137, -96, -68, 156, + 308, -182, 5, 438, -71, -27, -164, 187, + -110, 5786, -82, -130, -126, 197, -262, -182, + -118, -110, 121, -93, 235, -56, -99, -212, + -3013, -193, -10, -2944, 58, -135, -624, -170, + 84, 339, 115, -85, -1886, 250, 123, -104, + -374, -2241, 2454, -438, -168, 632, -136, -725, + -329, -394, -60, 19, 2795, 438, -796, 141, + -143, 132, 251, 37, 286, 1858, 39, 2381, + -9, -85, -110, 149, -415, 355, -172, -9, + -149, 554, -324, -4931, -537, -261, -585, -291, + 764, -92, -139, -8, -80, 65, -6, -26, + -81, 37, -14, 45, 115, 171, -321, 313, + 308, -4637, -128, -120, -174, 148, 768, 490, + 81, -175, -261, -136, 1501, 345, 25, -56, + -212, -324, -836, 207, -652, -752, 2406, -332, + 489, -275, -932, 284, 3103, -315, 614, -2711, + 1706, -1072, -163, -75, -1104, 163, -421, 1532, + -92, -163, -811, -118, -38, -754, 466, -314, + 232, -595, 3613, -30, 570, -62, 785, 1626, + 1080, 553, -407, 32, -105, 82, -156, -75, + 8063, -67, 114, -65, -65, -242, 98, -124, + 38, 441, -2645, -92, 69, 17, -3284, -278, + -278, 116, 567, -742, 182, -304, 432, 261, + 86, -4109, 389, 795, -138, 151, 111, -223, + 2392, 399, -135, -545, 182, -226, 61, 234, +}; + +static const int16_t cb1616sm1[] = { + -29, -13, -6217, -136, -196, 24, -228, -301, + -155, -37, -54, -91, -4, -130, -424, -89, + -181, 657, 110, -4526, -391, 762, 1033, -310, + -808, -282, -721, -690, 258, -259, 16, -555, + 2675, -379, -2580, 356, 198, -455, 95, -194, + -754, 383, -263, -873, 271, -107, -191, -28, + 11, -66, 91, 25, -215, 9, 152, 11, + -124, 66, 422, 521, 5401, 103, -179, -291, + -821, -1265, -396, 150, -69, -15, 154, 1504, + -445, 116, -136, -3528, 2819, -5, 174, 166, + 289, -60, 158, -701, 83, -636, -407, 194, + -240, -138, 124, -94, 132, -105, -106, 72, + 139, 101, 97, -7928, 6, 112, 164, -83, + -329, 41, 124, 389, -22, -194, 157, -378, + -2255, -431, 3176, -199, -310, 49, 483, -208, + -235, 11, 45, 637, 1220, 2309, 93, 514, + -1939, 136, 276, -165, 137, 2496, 56, 31, + 238, -538, -433, 690, -318, -44, 834, -1684, + -132, 2619, -157, 1959, -566, 119, 183, 227, + 2066, 401, -48, 1257, 604, 1306, 149, 273, + 586, -199, 2166, 257, 2047, -46, -377, -761, + -25, -454, -1592, -42, 432, -2312, 222, -528, + -87, -287, 532, 2906, -2011, 720, 554, 423, + -576, 425, 280, -894, -232, -179, 485, 628, + -2918, 405, 229, -2, -146, 127, -329, -243, + 194, 2443, -531, 592, -14, 1679, 292, -914, + -332, 2382, -3040, 297, -2856, -88, 236, -485, + 438, 241, -283, 448, 579, -660, 277, 233, + 201, 126, 15, -411, -560, -582, -389, -392, + -7, 238, 1, 344, -216, -4601, -457, 1027, + -114, 13, -301, 288, 172, -488, -124, -2721, + 100, -105, 434, -13, 2791, -827, 1600, -219, + -4992, -100, 411, 326, -608, -779, 94, 974, + 453, -1326, -236, 429, -189, 830, 32, 187, + 459, 2489, 476, 165, 3261, -445, 169, 179, + -113, 168, -393, 52, -383, -33, 73, 137, + -6021, -259, -121, -29, -46, -156, 68, -225, + 217, 152, -280, 7, 62, 3, 17, 295, + 221, -158, -5406, -335, 232, -454, -320, 467, + -45, 96, -170, -267, 1273, 287, 258, 536, + -695, -953, 1134, 428, 251, 3331, 717, -804, + 627, 1099, 120, 4, 42, 191, -9, 259, + -335, -337, -25, -56, 116, -228, -351, -463, + 5942, 193, -114, -64, -268, 300, 146, -15, + 657, 367, -2, -2911, 838, -251, -1, 2897, + -78, -609, -545, -588, 488, 1383, 486, 1820, + 126, 2971, -151, 11, 10, -349, -279, -260, + -265, 142, -683, -191, 172, 30, -293, -5103, + -61, -247, -38, 722, 275, -326, -34, 132, + 297, 3305, -46, 227, -1052, -1114, 562, 62, + -1618, 699, 362, -1624, -455, 150, -110, 61, + -266, -168, -168, -391, 136, -569, -772, -203, + 467, 20, -4747, -170, 142, -138, 129, 1719, + 1896, 210, -1008, 206, 585, -325, 295, 175, + -2542, -489, 121, -94, -38, -2766, -115, -3206, + -305, 320, -179, 503, 83, -72, -122, -52, + -181, 98, 39, -506, -2751, -93, -1, -59, + 2645, 248, -309, -203, 138, 324, -567, 696, + -493, 170, 2440, 919, -420, -3029, -335, -593, + -72, 536, -82, 202, 78, 510, 184, -2, + 227, -2830, 19, 1590, -281, 387, -46, 408, + -463, -536, 262, 2214, -115, -1614, -385, 203, + 32, -885, -2606, 2338, 97, 292, -449, 449, + -1038, -582, 0, -68, 211, -160, 62, -286, + -2466, -421, -48, 1903, -1037, -173, 1339, -591, + 152, -1231, 792, 524, 214, -92, 29, 181, + -225, -150, -1, 139, -8135, 238, -119, 189, + 34, -140, -188, 141, -112, 56, -176, 154, + 91, 5653, 298, -316, -23, 232, -74, -317, + -4, -630, -506, 105, -1655, -126, 2417, 113, + -95, -472, 134, 290, -755, 152, -1222, -58, + 981, -236, 8192, -154, 75, 218, -185, 107, + -10, 39, 265, -225, -87, 9, 123, -906, + -382, 2544, 44, -1985, -102, 407, -91, -1835, + -108, 122, 142, 169, 134, -721, -1530, -4, + -133, 45, 374, -1049, -76, 16, -357, 277, + 158, -2596, -4, -1484, -13, 2660, -198, 9, + -218, 408, -63, 177, -71, -195, 4293, -8, + 228, 34, -421, 695, -1409, 85, 2740, 350, + 44, 473, 141, -93, 144, -59, -220, -154, + -148, -168, -205, 3049, 229, 194, -107, 90, + -353, 508, -343, 473, -446, 457, -452, -116, + 3493, 504, 2152, -228, -1832, -463, -657, 555, + 657, 540, 546, 604, 2214, -68, 254, 563, + 267, 227, 92, -107, 143, 260, 23, 42, + 64, -67, 138, -167, 72, 457, 4958, 61, + -933, 1, 5341, -32, 89, 161, 504, 823, + 311, 11, -184, -574, -79, -1654, -74, -366, + 164, -363, 117, 53, 706, -701, -2966, 233, + 11, 165, 394, 462, -2632, 703, -291, -65, + -49, 4080, -862, -65, -19, -110, -872, 323, + 833, -154, 369, 475, 2211, 20, -212, 1711, + -24, -28, -58, 32, 1746, 41, -779, 614, + 508, 3050, 687, 423, -182, -484, -60, 242, + 3895, -565, -453, 110, 547, -961, 320, -34, + -347, -1963, -116, 730, -435, -34, 41, 26, + -51, 8192, -115, 312, 184, -148, -199, 157, + 153, 82, 99, 138, -32, -19, -64, -139, + 107, 43, 133, -87, 42, -148, 7080, -158, + -335, -249, -64, 81, 157, 813, -279, 2226, + -16, 1191, -705, 607, 205, -11, -1341, -548, + -2251, -326, -149, -2536, 139, -750, 73, -394, + -218, -35, 181, 925, -557, 226, -63, 2582, + -737, 164, 181, -167, -230, 413, 328, 406, + -287, -2992, 539, 1133, -85, -2162, -154, -357, + -245, -8, 162, -118, 111, 1275, 47, -314, + -2043, -2732, -1052, -28, 625, -810, -487, 40, + -131, 273, 105, 2605, -2974, 268, -19, -257, + 842, -662, 855, 505, 590, -243, 68, 6978, + 118, -101, 349, -232, -258, -318, 212, 55, + -686, -177, -173, -102, 480, 35, 149, 263, + -2838, -198, 942, 392, 135, 2980, 34, 92, + -237, -672, 224, -298, 298, 2128, 359, 254, + 150, -839, 1001, 3234, -169, 261, -302, 74, + -277, 498, 321, 194, -3275, -152, -2786, 33, + 70, 236, -222, 88, -393, 47, -636, 869, + -754, 842, -2326, -460, 133, 0, 264, 172, + -2955, -286, -243, 399, 882, -722, -382, 872, + -119, -65, -2403, -119, -246, -890, -185, 102, + -32, -573, 225, 3044, -484, -40, -809, 403, +}; + +static const int16_t cb2224l0[] = { + -3546, -433, -76, 46, 24, -641, 214, 114, + -779, -930, -57, -462, -569, -848, -413, 53, + 45, -3172, 2915, -734, 152, 487, -113, 246, + -196, -187, -136, 469, 475, 382, 213, -886, + -275, 313, 3148, -62, -773, 785, -24, -1499, + -65, -175, -1942, -325, 78, -15, -38, 2, + 6, -29, -16, 9690, -15, -49, -13, 12, + -21, 11, -45, -63, -528, 192, -137, 201, + 138, -154, 57, -88, -1695, 155, 105, 121, + 4249, -59, 467, -439, 4483, -130, -39, 262, + -21, -377, 441, -353, -768, 366, 23, 841, + 529, 195, 2722, 2892, -255, -67, 628, -498, + 33, 241, 212, -1020, -97, -723, 594, 35, + -31, 1459, 19, -75, -27, -1, 48, 28, + 267, -275, 3780, -515, -467, 36, -405, -272, + -1968, 60, 44, 449, -2877, -124, -1524, 1195, + 1042, 117, 115, -305, 225, 215, -357, 144, + 35, -23, 89, 2133, 2, 65, -27, -48, + -243, -216, -807, 700, 1258, 6, -140, 4, + -31, -21, 42, 67, 97, -2, 104, -10, + -7734, 134, -50, -95, -88, -269, 105, -18, + -229, 453, 1038, -2609, -2944, -57, 27, 372, + 59, -556, -87, -242, 114, 1083, -119, -139, + 175, 146, -55, 1689, 342, 501, 2722, -1273, + 1626, 868, -290, -145, 62, 194, -23, -179, + 1540, -85, 360, 254, 339, -681, 2081, 2730, + 838, -128, 31, -2133, -173, 483, -138, 2706, + 2007, 91, 293, -642, 35, 280, -132, 454, + -66, -6263, -24, 82, -31, -39, 5, 41, + 66, 239, 18, -57, 61, -117, 103, 16, + -1231, 1384, -164, 104, 370, -1891, 2237, -440, + -1399, -1394, 3, 274, 223, -30, -70, 579, + 361, 423, 355, -176, -164, -443, -306, -2382, + 713, -2987, -340, -691, 1407, -5, 439, -264, + -86, 1964, -17, 88, 175, 56, -119, 31, + 466, 1980, 176, 513, 1809, 17, 3000, 1861, + -71, 314, -255, 2041, 576, 203, 443, -392, + -539, -380, -685, -204, -161, 287, 378, -502, + 1898, 1540, 1073, 2282, 573, 867, 122, 1064, + -628, -564, 97, 280, -36, 1601, -90, -174, + -10, 45, -57, 159, -496, 641, -959, -91, + -90, 3057, 1680, -83, 80, 19, 63, -119, + 1, -72, 466, -335, 453, -177, 3930, -21, + 327, -199, -651, -38, -6, -13, 7, -77, + 1, 8, 40, -125, 36, -136, 272, 6266, + -3299, 3331, 24, 18, -71, 9, -79, -374, + -277, 128, -233, -175, -350, -216, 81, -693, + -49, 33, -44, -37, -4260, -70, 96, 177, + -319, 133, 178, -377, -45, 182, 156, -155, + -34, 10, 22, 53, -211, 4, 5740, 48, + -42, 114, 149, -30, 122, -106, -309, -148, + -82, 20, 130, 2734, -40, -596, 1309, 1163, + -1470, 396, -264, 884, 142, -1818, 67, -1, + 38, -52, -73, 1, 279, 143, 278, -45, + 1541, -886, -677, -2609, -88, -3766, -201, 237, + -40, 195, -50, -366, 88, 166, 403, 236, + -130, 205, -45, -8636, -13, -27, -50, 8, + 40, 21, 41, -36, -25, -40, -14, -14, + 42, 296, 2495, 372, -361, -501, 1951, -2141, + 220, -847, 98, 228, -250, 563, -1121, -29, + 2888, -196, 151, -19, -287, -2298, 65, -482, + -124, -186, 1215, 468, -781, -227, 621, 298, + -42, -44, -115, 0, 50, 179, 23, 9, + -65, -8, 10, -101, -4998, 77, 1181, -304, + 139, 250, -2257, -97, 847, 433, 385, -2411, + 800, -852, -528, 435, -953, -23, 4, 928, + -108, -634, -273, -879, 2566, -2609, 621, 807, + 295, -77, 627, -1114, -297, -109, 2103, -53, + -9, 44, 32, 339, 679, 77, -3186, -416, + 1234, -801, 472, 408, 153, 465, 1703, 879, + -2411, -553, 440, 2099, -899, -288, 310, 665, + -47, -148, 1457, 3932, -213, 243, -1763, -2, + 288, -425, -972, 478, -302, 552, -377, -352, + 179, -480, 1466, 2019, 2817, 5, 824, 13, + -384, -582, -297, -1165, 689, -120, 703, -118, + 663, 206, -49, -2853, -76, 32, 170, 11, + 42, -503, -1139, 1548, -287, -1112, 765, -455, + -35, 2452, 22, -134, 144, 1867, -149, 2771, + 19, 264, 700, -48, 286, -593, -2637, 408, + 2304, -14, 187, -135, -210, 745, 282, 724, + 861, 21, -414, 606, 836, -564, 212, 203, + 64, 4706, -30, -43, -85, -61, -90, 644, + -281, 287, -122, -340, -137, 36, -4, -22, + 8, 9486, -3, 4, 10, 4, 86, 58, + -8, 6, -105, -15, 15, -63, -58, -30, + 15, 0, -19, 78, -8267, -134, -8, -45, + 163, -19, 149, -298, -167, 34, 190, -39, + -2229, 2821, 126, 185, -791, -1229, 1003, -331, + 980, 659, -60, -60, -48, 20, 12, -167, + -60, -39, 66, 180, -22, -20, 84, -108, + 131, -10, -8493, -1, -18, -4, -53, 25, + -63, -14, 20, 25, -41, 40, -5, -2330, + -74, 59, -7, -154, -293, -64, -2702, 819, + 75, 977, -602, 1138, 160, 262, 26, -81, + 18, 5558, 118, -167, 98, 110, -5, -44, + -27, 72, 51, -189, 0, 1868, 743, -275, + 2530, 6, 180, -1019, -1307, 710, 303, -152, + -115, -1498, -501, -495, -103, -76, 78, -7, + -9337, -6, 31, -21, 16, -14, 57, 36, + -81, -67, -30, -535, 216, 313, 310, -157, + 2830, -914, 122, 1353, -1842, 298, -1165, -13, + -253, -100, -560, -61, 40, 24, 3, 56, + -18, 5709, 41, 13, -23, -55, -98, 214, + 109, -205, -45, 27, -26, 177, -290, 89, + 8, 1315, 3102, 1657, 210, -1032, 774, -211, + -581, -51, 896, 852, 331, 349, -474, -119, + -865, -145, 2270, 703, -1967, -2088, 610, -700, + 113, -231, 2062, -152, -599, -474, -38, -601, + 432, -983, -731, 744, -2880, 156, -240, -1903, + 2497, -89, -963, -2179, -1208, 189, 318, 150, + 204, 29, -167, -138, -93, 73, 292, -3225, + -310, -510, 173, -90, 154, 1831, 380, -1191, + -976, -1460, -514, 235, 13, -2950, 22, -95, + 228, 85, 10, 264, -3165, 46, -184, -782, + 143, -9, 37, 12, 108, -65, -64, 115, + 86, 5039, -55, -203, -163, -462, 77, -92, + 423, 139, 239, -5, 1887, 426, 729, 118, + -159, -2821, -124, 2147, -167, -1023, 92, -23, + 162, -159, -47, -3, 14, -34, 37, -29, + -97, 41, -92, -75, -6983, -224, 250, -80, +}; + +static const int16_t cb2224l1[] = { + -2888, -183, 3606, 0, 33, 99, -76, -264, + -351, -508, -546, -103, 252, -49, 46, -32, + 48, -245, 67, -2408, 340, 3153, -154, -280, + -440, 374, -224, -39, -720, -289, -136, -3095, + -98, -37, -86, 145, 51, 132, 773, -1158, + -330, -449, -141, -1831, 666, -2680, -110, -906, + -307, -3299, 287, 55, -521, -173, -431, -383, + 67, -28, 34, 247, 2814, 1479, 32, -2196, + -1625, 135, 72, 3, 634, 76, 502, -306, + -366, -120, -219, 1934, 372, -130, -113, 255, + -14, 30, -687, -576, 797, 306, -2360, -242, + 2062, 69, 2273, 26, -20, -21, -68, -69, + -4618, 60, -171, -235, -271, 175, -110, 147, + 100, 1628, -197, -2, -4002, 520, -1236, -21, + 62, -396, 513, -369, -168, 285, 561, 131, + 1347, 83, -101, 89, 206, 5, 4556, -23, + 1191, 39, 352, -158, 99, -195, -33, 481, + -446, -125, 181, 2678, 2860, -524, -239, 55, + -360, -358, -560, 93, 307, 285, 77, -295, + -90, 114, -45, 54, -328, 94, -222, -30, + -5004, -164, 100, 379, 208, 424, -11, 26, + 10, -26, -32, 114, 30, 18, -44, -221, + -184, -32, 0, -99, -9001, -7, -33, 1, + 41, -3, 13, 9, -46, -86, 47, 56, + 72, -7, 5, -1162, 101, 456, -217, 3440, + -220, 400, 100, 1503, 365, 655, -230, 42, + 1129, 767, 192, -16, -3440, -79, -236, 3, + -80, 51, -11, -984, -142, 29, 554, 339, + 1851, 105, -279, -2915, 116, 3090, -431, 233, + 337, 61, 927, 32, -174, 237, 255, -250, + 604, 115, 2036, 78, -79, -50, -349, 338, + 285, 169, 394, -49, 1194, -2966, 447, 57, + -2591, 415, -586, -2616, -197, -61, 596, -1159, + 130, -441, 356, 47, 1192, 496, -1801, -15, + -142, -23, 132, 21, 84, 234, -137, 23, + -147, -3254, 407, 107, 1132, 130, 74, 153, + 3148, 2184, -464, 1294, 222, 589, 457, -397, + -87, -605, -631, 311, -703, 110, 20, -23, + -75, 18, -43, -182, 8, -94, 151, 4989, + -619, 662, 82, 8, 69, -4, 126, -35, + -99, -277, -227, -2212, 3188, 1115, -467, -618, + -989, 681, 218, -25, -37, -9, 32, -46, + 97, 15, -23, -95, -6, 55, 19, 7904, + -14, -508, 3, 14, -12, -58, 28, 154, + 11, 271, -593, 344, -336, 3489, -41, -2998, + 622, -2739, 2796, 1536, 310, 176, -318, 399, + -70, -298, -509, 256, -381, -158, 322, -197, + 3, -53, 37, 98, -6136, -25, -54, 57, + 138, -74, 239, -46, -18, 29, -265, -2278, + 22, 110, -21, -147, 266, 85, -286, 137, + 3434, -485, 68, 475, -3, 159, -181, -237, + 1595, 759, 786, 1490, 926, -2841, -160, 1092, + -7, 130, 895, -345, -95, -31, -35, 139, + -98, 2106, 305, 672, -66, 349, 229, -1561, + -1694, -1786, -743, -76, -67, 1666, 76, 10, + -22, 60, -45, 5, 409, -458, 583, -405, + 2586, -264, 175, 633, 842, 3208, -1488, -802, + 40, -119, -197, -84, 1645, 328, 823, -175, + 342, 12, -217, 67, 124, -180, -106, -2877, + -336, 171, 185, 132, -2263, -75, -622, -631, + -2404, 176, -132, 35, 179, -1498, 182, 68, + 699, 597, -2728, 325, 52, 421, -863, 609, + 53, -159, 258, -307, 2919, 44, -826, -467, + 91, 542, 1883, 815, -682, 548, -419, 593, + 82, -2108, -158, -75, -524, 2440, -528, -469, + 723, -14, -1817, -487, 448, 4, -155, -70, + -1715, 34, -55, 134, 0, 19, 107, 419, + 334, 74, 446, 1241, -4288, 61, -65, 21, + 71, 133, 2, -88, -238, 322, -283, -6, + 404, 98, 78, -1951, 412, -1942, 418, 257, + -42, -2444, -97, 1491, 464, 346, 229, -154, + 96, 261, 29, 302, 39, -201, -40, -98, + -157, 335, -3624, -349, -573, 633, -116, -312, + -82, 263, -2, -101, -57, 1817, -424, 3, + -245, 386, 74, 609, 2171, -77, -2604, -1036, + -117, 1585, -2, 9, -23, 31, -12, 48, + 215, 84, 13, 219, 419, -275, 4373, -91, + -6, 18, 2228, -46, 157, -408, 2288, 654, + -725, -245, -10, -1182, 1726, 324, 367, 3013, + 3429, -140, 360, -122, -574, -165, 109, -330, + -82, 340, -133, 210, 355, -8, 47, -52, + 8064, 5, 60, -42, -95, -3, 91, -69, + -47, -42, 101, 118, -44, -16, -14, -9, + 27, 8, -33, -3, -9302, 27, 49, -6, + 61, 74, 204, 430, 252, -259, 73, 125, + 366, -458, -2846, 89, -2694, -106, -344, -702, + 809, 451, 69, 585, -1897, 608, -1138, 52, + 618, 106, 771, 2992, 266, 1007, 184, -486, + 36, 3317, -311, 38, 105, -89, 16, 97, + -88, 28, 183, -2834, -44, 387, -49, 467, + -2524, 77, -56, -3727, 81, -308, 63, -137, + 203, -77, 139, 254, -65, -264, -58, 631, + -2559, 739, -1343, 595, -117, -193, -2572, 322, + 267, 185, 669, -110, 641, 212, 45, -16, + 12, 14, -3, -12, 78, -48, -196, -128, + 179, 146, -7348, 177, -138, -48, 142, -33, + 34, -6037, 15, -105, 103, 136, -48, 217, + -169, 88, -31, 9, 24, 41, 1733, -2757, + -335, 1783, 988, -161, 1014, 633, -66, -1114, + 525, -266, 461, 1137, -26, -173, 89, 82, + -3365, 67, -198, -107, 44, 352, -793, 867, + -807, -166, 107, 4, 71, 61, 124, 27, + -2477, 178, -32, -172, 2895, 1301, 798, 707, + 267, -720, -403, 167, -157, 2572, -210, 527, + -312, -1664, -214, -1556, -332, 595, -1634, -58, + 203, -1777, -469, 24, 188, -59, -860, 879, + 15, 855, -1534, 2910, 534, -71, 276, 471, + 41, -25, 105, -37, -150, 110, 226, -277, + -4687, 574, 139, -152, -586, 67, -1082, 261, + -68, 25, -216, 110, 46, -3703, 281, 355, + -506, 80, -218, 164, -398, 75, -97, 5782, + 39, -68, 26, 76, 74, 38, -103, 105, + 44, 116, 187, 288, 90, 5847, -41, 28, + -19, 20, 129, -99, 258, 22, -28, -120, + -101, -121, 79, -180, -23, 22, -5, -60, + 63, 35, -8987, -11, 2, -15, -3, -28, + 47, 29, 241, 132, -166, -259, -48, 102, + 70, 2830, 3163, 285, -813, 0, 105, 176, + -455, 141, 1382, -481, -2282, 2971, -200, -473, + 37, -930, -1162, 930, 890, 412, 190, -160, +}; + +static const int16_t cb2224s0[] = { + -5789, 1229, -138, 1010, 823, -602, -987, -237, + 47, -29, 428, 210, 87, -11, -20, -261, + -3148, 1219, -2074, -132, -258, 707, -634, 878, + -486, 989, -276, -137, -263, 592, 1248, 474, + -293, -981, 2125, -653, -1451, -833, -1522, 387, + -269, 349, 698, 295, 870, 661, 1532, 202, + 654, 362, -1265, 3972, -651, 224, 213, -728, + -83, 575, -503, -766, 559, -657, 86, 941, + 1498, -72, 2297, 1413, -376, 697, -738, 384, + -807, -354, 1141, 374, 1186, -597, 222, 630, + -717, -1653, 106, -1377, -929, 982, -3469, -321, + -201, -1185, -147, -13, 268, 103, 2967, -2083, + -416, 702, 377, -1126, 92, 963, -494, -94, + -436, 1893, 1401, -40, -1464, -1608, 1980, 44, + 254, 676, 529, -891, -95, 9, -172, -129, + 158, -403, -1147, 1026, -410, 86, 2593, -1060, + -621, 480, 254, -780, 691, -1020, 79, -192, + -2264, -1219, -748, 602, 243, 338, 550, -444, + -130, 79, 24, 3396, 124, -572, 749, 976, + 33, -883, -368, -609, 694, -569, -560, 192, + 868, 644, 173, 86, -4302, 633, 7899, -360, + 478, 493, -306, 14, 244, 96, 71, -169, + 336, 346, 74, -52, 1779, 828, -252, 739, + -1005, -755, 31, -46, 200, 581, -11, 802, + 1104, 3252, -1053, 723, -491, -2492, -2330, -245, + 308, -1021, -312, 563, -85, 991, -16, 224, + -85, -957, 2262, -4585, -1475, 102, 310, 298, + -875, -6, -268, 8, -284, 324, -471, -224, + 133, 1502, -1714, -1095, -104, 809, 2584, -273, + -1014, -296, 130, 732, -259, -335, -745, -619, + -716, 247, 503, 862, -277, -137, -224, -4897, + 124, 277, 298, -40, 169, 678, 557, 4379, + 677, -2016, -506, -108, -47, 49, -115, -260, + -300, 206, 1196, -17, 202, 365, -808, -473, + -160, -609, 526, -1124, 1629, -2924, 713, -487, + -109, 540, -511, 221, -394, -1420, 1023, -460, + 424, -86, -875, -1557, -88, -244, -1597, -3015, + 355, 166, 330, -334, -325, 505, 3632, -1760, + 1626, -427, 573, 1197, -317, -566, -663, 460, + 338, -442, -597, 1565, -854, -534, -219, -128, + -2175, 739, 1064, 2050, -61, -349, 361, -375, + 1111, -122, -121, -164, -2573, 938, 1758, -15, + 884, 865, -630, -573, 994, 1112, -26, 9, + -30, 3893, -38, 1386, 605, 568, -680, 117, + 37, 572, 245, -53, -1030, -241, 397, 363, + -1632, -567, -26, -698, -2109, -1033, -1389, 1381, + -418, 402, -534, 9, 1143, 991, 693, 2557, + -1268, 1273, -192, 1225, 876, 472, 835, 509, + -452, -1519, 482, 1103, -626, -299, 1580, -1532, + 599, 2245, 503, -110, -1879, 978, -1158, -130, + -665, 448, -1247, 604, -528, -677, -711, 78, + -563, -349, -53, 261, 952, -338, -534, 43, + -2, -2555, 1976, 2393, 1715, 996, 5628, 1036, + 171, -28, -199, -83, -126, -35, -248, -393, + 36, 209, 77, -1793, 244, -108, -130, -41, + -578, -2347, -687, 1650, 131, -138, 407, -228, + -1348, -209, -841, 1332, -542, 220, -193, 843, + -103, 853, 261, -653, 217, -107, -113, -54, + -4151, -1303, -287, 4065, -376, -71, 43, -1481, + -359, -481, 78, 529, 689, -194, 178, 60, + -997, -1555, 1687, 345, 169, 266, 2894, 83, + -500, -425, -396, -245, 6, 517, 112, 129, + 725, -121, -404, 234, 47, -61, -122, 710, + -4283, 985, 56, -105, -45, 1043, 720, 73, + 321, 4452, -1614, 91, -620, -299, 506, 766, + -882, 650, -138, 123, -608, 210, -1582, -538, + -62, 246, 464, -332, -1560, 2271, 1559, -199, + -832, -1133, -797, 341, 1860, 1628, -1133, -607, + 637, -404, 437, -1148, 542, -474, -882, -610, + -1340, -159, 1524, 1424, 169, -6, 52, 447, + -5513, -592, 244, -294, 44, 164, -51, 147, + 202, -48, 139, 113, -399, -17, -173, -199, + 1, 17, -166, 15, -258, -7, 238, -5748, + -394, -852, -248, -46, 192, -32, -1033, -349, + 151, 483, 130, -1628, -3391, 1527, 694, -305, + 740, -357, -491, -186, -1649, -1394, -873, 213, + 652, -1975, 319, -1131, -103, -48, 673, 155, + -627, 1115, 469, -1122, 1901, -184, -237, -296, + -2887, -120, 211, 835, 57, -826, 1272, -255, + -937, 242, -525, 836, -334, 393, -624, 111, + -347, -178, -3441, 219, -352, 1831, -296, 587, + -357, -1099, 5, 313, -3806, -394, 814, -118, + -233, -23, -125, -21, -1414, 813, -403, 2482, + 442, -184, 934, 340, 472, 374, 1073, -283, + -2348, 477, -387, -713, 1071, -899, 252, -1299, + -502, -375, -410, -1785, 686, -605, -141, -871, + -1777, 2780, 53, -237, -237, 2701, 944, 44, + 595, 3, 1263, -1558, -2267, -998, 221, 355, + -319, -739, -1160, -594, 2977, 191, -41, -284, + 83, 484, 481, -73, -13, 138, -2761, -909, + -578, -139, -1056, 189, -645, -147, -61, -168, + 368, 130, 390, 4187, 101, 79, -45, 451, + -1374, -1941, -534, -301, -979, -668, -533, -2978, + 386, 574, -454, -4, 554, -120, 366, 83, + 1079, -351, 156, 389, 7724, 83, 102, -191, + -1059, -255, -86, 451, -211, 175, 774, 306, + -253, 2386, 1166, -2025, 223, 438, 1279, 1721, + -23, -91, 606, -1285, -775, -3228, -536, 543, + 877, 1140, -1616, -603, 550, -678, -462, 248, + 209, -515, -310, -2538, -2002, 231, -495, 319, + 538, 509, -113, -17, 143, -3062, -29, -52, + 299, 681, 595, 390, 530, -398, -969, 472, + -1145, 860, 4113, 329, -1183, -691, -605, 859, + 305, 986, -81, 2029, 408, 2, -2442, 59, + -85, -911, -285, -532, 28, 434, -2295, -76, + -2977, 51, 824, -1786, 2301, 622, -593, -9, + 643, 246, 427, 193, 51, 118, 4, 234, + 459, 31, -408, 710, -264, 144, -404, -476, + 278, -4836, -113, 382, -29, 177, 345, -33, + -17, -85, 6027, 72, -165, 544, -198, 75, + -278, -262, 155, 501, -305, -279, -439, 1506, + 827, -875, -2592, -1196, -1201, 149, 16, 547, + 1020, -616, 374, -193, -155, -3627, 231, 264, + -2143, 90, 419, 574, -795, 177, 328, 752, + -295, 210, -360, -1250, 2639, -3172, -13, -34, + 489, 484, -390, -159, -285, 27, 444, -252, + 265, 530, -2714, -340, -1543, 2330, -1152, -114, + 452, 304, -224, -451, -317, -579, 301, -567, + 1214, -594, -621, -2718, 59, 257, 410, -3, + 145, 70, 877, -3103, 244, -1134, 236, -1148, +}; + +static const int16_t cb2224s1[] = { + 8488, 277, 63, 173, 224, -30, -158, 64, + 133, -133, 234, 205, -65, 408, 249, -546, + -30, -1, -430, 80, 102, -450, -160, -5634, + 145, -406, -351, 37, 282, 232, -898, 430, + 3301, -1175, -559, 495, 2685, -21, -215, -87, + 728, -55, 235, 430, -250, -505, 506, -128, + -72, 3288, 1588, 291, 7, -39, -944, 478, + 1719, 168, -1085, 225, 330, 1480, -183, -597, + -6131, 668, -387, 672, -173, -55, 113, 40, + -113, -44, 341, -340, -594, -1001, 1757, 127, + -59, 537, -1834, 1401, 856, -1153, -234, 1232, + -562, 476, 110, 2188, 146, 119, 2119, -872, + 450, 597, -371, -1350, -996, -120, -495, 829, + 111, -897, -5445, -670, 390, -118, 4, 109, + 772, 495, 196, 410, -125, 812, 426, 900, + 436, 1155, -553, -1223, 275, 266, -891, 63, + -1267, 523, -548, -2445, 239, 1163, 72, -68, + -1576, 2212, -340, 1499, 494, -671, -73, -281, + 598, 1901, -1652, -845, 266, 795, -545, -574, + 19, -461, 371, 288, -3959, 421, 299, -121, + -2561, -65, 118, 181, -227, 719, -92, -2334, + -3178, -2497, -198, 58, 1279, -309, 152, -715, + 466, -316, 10, 98, 1568, -1015, -18, -435, + -42, 2606, 1971, -119, 705, 254, 443, 36, + 788, 1135, 1234, 2281, 942, 115, 581, -113, + -194, -694, 434, -30, 2835, -423, 436, 522, + 406, 1329, 1191, -2628, 421, -2601, 646, -202, + 637, 610, -584, 357, -1586, -499, -1230, 134, + -83, -1264, 2434, -58, -2924, 641, -285, 172, + -478, -402, 584, -1180, -137, -238, -151, -679, + -619, -495, 1044, 1281, -1180, -444, 376, 1969, + -693, -283, 618, 128, -2622, -90, -115, 672, + 1738, -459, 519, -924, 2582, 937, -555, 672, + 131, 31, 775, 307, -282, -527, -1299, -516, + 10, 239, -4069, 118, 10, -665, -15, -484, + 472, 262, 279, 677, -755, 1288, -1278, 403, + 666, -394, -1230, -2819, -221, 109, 603, 754, + 951, 488, -147, -107, -426, 1875, 2056, -129, + 239, -561, 81, -324, 243, 349, 197, -811, + -146, -929, 1193, 1433, -776, 3209, 434, -6, + 2465, -231, -57, 312, 899, -396, -170, -549, + 346, 135, 17, -596, 401, 269, 499, -64, + -321, -342, -132, -312, 5845, 276, -104, -9, + -50, -678, -478, -1125, -1477, 2058, 156, 538, + 451, 2572, 495, 101, 74, -753, 98, 685, + 2424, -1999, 1050, -280, -1030, 29, -178, -244, + -134, 130, -137, -103, -245, 2161, -446, -1016, + 464, 573, -473, 446, -3822, 942, -1261, -334, + 568, -528, -301, 415, -740, 661, -813, 849, + 1491, 774, -774, 1637, -977, -246, 647, -572, + -140, -2946, -654, -650, -311, 339, -165, 757, + 803, -958, 704, 171, 380, 763, 159, 2721, + -1599, 1006, -118, -597, 2985, 2699, 69, 395, + 523, 657, 438, 190, 72, 164, -268, -145, + 506, -550, 222, -3641, 5, -173, 60, -194, + 677, 686, 724, -107, 882, -339, 14, -54, + 555, 483, 1523, 119, -142, -394, -1683, -984, + 18, -108, -190, 141, 540, 281, -1238, -2195, + -341, -327, -1014, -990, 4694, 46, -1018, 360, + -671, -83, 218, 857, 144, -188, 463, -379, + -571, -865, -1345, -447, -18, -64, 5201, 132, + 90, -158, -132, 381, -85, -107, -103, 970, + -555, -1204, 1802, 1230, 253, 540, -372, -2347, + -386, 835, -705, -437, 941, 795, -182, -368, + 1088, 168, 256, 210, -667, 290, 1783, -636, + 165, -363, 638, -3527, 1872, 1997, 1503, -189, + -2587, -359, 384, 493, -384, -658, -1758, 993, + -306, 148, 198, 163, 430, -313, -149, -337, + 352, -354, 484, 358, -264, -4525, -560, -55, + 154, 374, -317, -426, 1446, -161, -285, -110, + 209, 299, 2329, 99, 1406, 1374, 993, 1178, + -413, -642, -103, 3678, -1829, -754, -1358, -349, + 648, -492, 755, 188, 114, -444, -930, -224, + 319, 212, 1223, -648, 593, 1293, -1289, 24, + -712, 2591, -494, 1503, -9, 534, 923, 1490, + 985, 491, 272, 988, 348, -503, -454, 893, + 409, -422, -1187, 3097, 602, -402, 462, 1598, + -219, 982, 319, 125, 558, -100, -261, 108, + -59, -3435, 76, -1065, -150, -1758, -1997, 1921, + 1239, 426, 507, 173, -856, -829, -538, 247, + -1203, 488, -1094, 453, -1104, 1021, 2185, -2855, + 427, 177, -778, -182, 641, -670, 91, 569, + 50, -90, 571, 108, -374, 174, 1997, 964, + 644, -428, -1868, 668, 171, 320, 676, 121, + -218, 1901, -857, -721, -194, -2433, -34, -1671, + 352, -644, 295, 571, 253, -288, -1786, 32, + 74, -73, -902, -1954, -1126, -3427, 168, -318, + 23, -755, -441, 201, -84, 499, 367, -153, + -426, 716, 650, -457, 80, -709, 859, -2098, + -723, -197, -1030, -253, 283, -1187, -899, 1403, + -117, -25, 7617, -63, -355, -283, -560, -85, + -358, -45, 63, 179, -193, 130, -294, -676, + -525, -907, -430, -627, -5267, -539, 257, 594, + -173, 890, 203, -33, -136, -803, 479, -56, + -634, 464, -919, -146, 306, 5, 198, -90, + -138, -337, 4826, -310, 259, 1651, -687, -1676, + 424, 2729, -966, -61, 386, 60, 769, -72, + -1652, 49, 106, 503, -1462, -1056, 892, 359, + 209, -129, 260, -130, -2081, 798, 488, 846, + -836, -366, 1786, -2237, -484, 72, -2680, -828, + -857, 920, 560, 930, -197, 56, -872, -34, + -355, 929, 35, -449, 514, 70, -1277, 208, + 353, 3654, -256, 134, -895, -184, 375, 402, + 1576, 1515, -100, -438, -679, 384, 1143, -24, + 100, -2818, 554, -219, 105, 652, -2778, -108, + 44, 306, 445, -470, -1151, -1170, 1305, -741, + 1223, -443, -838, 374, -3000, 72, -590, -587, + 3686, 76, -493, 246, 1348, -1215, 473, -244, + -304, 1937, -68, -626, 278, 392, 1167, -1899, + -309, 474, 226, -421, -95, -483, 105, -148, + 749, -430, -3057, -789, -1793, -1857, -158, -489, + -676, -204, 806, -930, -3192, -204, -106, -812, + 1159, 648, 119, -93, -205, -139, 280, -7786, + -388, -132, -12, -332, 32, -174, 100, 153, + -7, 289, -29, -984, -329, -592, 2568, 704, + 544, 66, 521, -661, -1632, -868, -310, 313, + -466, -347, -146, 197, 266, 765, -240, -201, + -265, -1129, -35, -563, -356, 172, 862, 3831, + 1547, -1618, -1445, -3726, 388, 548, -457, 143, + -38, 402, 255, 840, -703, -154, 776, -1038, +}; + +static const int16_t cb2224m0[] = { + -7078, 2846, 79, -111, -20, 330, 227, -36, + 305, 45, 81, 148, -13, 68, 364, -317, + -72, 2021, 28, 93, 328, -256, -181, 2547, + 235, -1102, 130, -577, -164, 1290, 1885, -171, + -147, -3247, 324, -72, -313, -62, 32, 284, + -138, -9, -146, 1709, -390, 1833, 289, 125, + 2369, 60, 223, -137, 642, -113, 204, 288, + -1516, -138, 228, 368, 219, -622, 273, 3211, + -215, -423, 139, 65, 85, -203, -953, 11, + 193, 294, 279, 3267, 246, -2377, -59, -324, + 136, -492, 23, -56, 79, 307, 115, -146, + 2229, 325, -1680, -597, -423, 2200, -44, 48, + 386, 396, -122, -36, 35, 9763, 33, -67, + 19, -34, 15, 41, -25, -30, -61, 20, + -121, 117, -155, -28, -65, -27, 40, 137, + 188, -211, -240, 71, -33, -4873, 1992, 56, + -2701, -1, 151, -96, 286, -398, -418, -221, + 295, -394, -119, -182, -124, 77, 7, -44, + 168, -34, -154, 257, 4, -114, 634, 131, + 4930, -118, -2364, 46, -204, -129, -3168, -138, + -489, 454, -96, 120, -447, 9, -230, 174, + 11359, 456, -261, -74, -249, -28, 149, -79, + -36, 211, -10, 213, -110, 337, -3800, 4, + -223, -18, 136, -290, -155, -235, 57, 447, + -495, -231, -15, -1036, -85, -154, -4421, -19, + -237, -1191, 12, -19, 2, -88, -84, 269, + -7, 431, -26, -2676, -100, 287, -31, -2916, + -160, -83, -198, 9, 183, -279, -68, -23, + -55, 2955, -121, -71, 183, -702, -323, 1689, + -132, 309, 136, -1217, 440, -125, -1671, 1569, + -161, -108, 232, 269, -516, 37, 21, -260, + -230, 564, -375, 224, 129, 4332, -120, 3306, + 153, -25, -260, -84, 123, 21, 5, -17, + -145, -44, 7, -1, 290, -2394, -182, 51, + 933, 1037, 26, 211, 187, -1783, 68, -749, + -52, 1428, -1571, -261, 34, -199, 722, -127, + -118, -114, -2385, 146, -1042, -71, -1475, -150, + -2195, 151, -29, 6, 96, -1213, 282, 219, + 466, 144, -300, 109, -74, 125, 2863, 2, + -2963, -218, 235, 3, 359, 319, 372, -500, + -271, 494, 2695, -65, -29, 47, 74, -34, + -95, -48, -76, -71, -2985, -30, -11, 26, + -176, 107, 96, 22, -60, 114, -70, -147, + -43, 6981, 110, -86, 33, 66, 8, -61, + 52, -169, 82, 233, 56, -115, -295, 241, + -1053, -3914, -79, 361, -869, -144, -144, -805, + 158, -278, 515, 4, -317, 917, -669, 3314, + 253, 1316, 259, 12, 8170, 15, 129, -200, + 120, -11, 34, -77, -13, 257, 79, 9, + 23, 54, 73, 0, -9972, 5, 7, 43, + 29, 4, -104, 43, -36, 76, -228, 1, + -77, -156, -69, -209, 84, -2826, 242, -1461, + -718, -14, 1784, 527, 226, 9852, 83, -15, + -389, 34, 51, -16, -46, -1, 232, 115, + 26, -42, -124, -78, 58, 3092, -2757, -111, + 223, -286, 23, -170, -166, -264, 331, -172, + -49, -26, 166, 2616, 128, 3118, 59, 844, + -121, -504, -193, -53, -95, 282, -21, -8, + -11, 58, -48, 9830, 25, -26, 53, 113, + 96, 125, 12, -64, 185, -31, 19, -251, + -307, -136, 1383, -37, -128, 56, 4303, -232, + -272, 44, -192, 531, -143, -697, -2291, 70, + 229, -432, -592, 1262, 906, -207, 1522, 261, + -7848, -39, -976, 150, 115, -139, 61, -26, + -211, 807, -25, 311, -98, -297, 133, 461, + -109, -6, -1031, 236, -2851, 86, 2184, -254, + -83, -119, 878, -107, -25, 1636, 1696, 1517, + 249, -41, -283, -66, 741, 704, -898, 302, + 470, 360, -7, -6002, 26, 268, -109, 150, + 202, 196, -262, -57, 160, 155, 7, 9, + -5770, 28, 127, 112, -76, -790, 45, -118, + 201, -831, 67, -81, 199, 296, 1692, -30, + -126, -121, 29, 387, 215, 269, -518, -232, + 155, 2735, -235, -82, -33, 3089, -3696, -39, + -51, 124, -220, 37, 51, -129, 194, -80, + 81, 0, -239, -1924, -244, 107, 372, 111, + 206, 418, 39, -118, -2059, -446, 1378, 661, + -2135, 122, -105, 60, 272, -91, -227, 48, + -3226, -88, -109, 199, 566, 158, 2412, -4380, + -177, 153, 252, 24, -323, 264, -116, -12, + -333, 99, -181, -124, 256, -131, -39, -45, + -88, 69, -26, -173, -4820, 286, -171, -82, + 431, 18, -827, -107, 142, 60, 300, 422, + 263, 61, 350, 85, 1088, -133, -1284, 70, + -4577, 5, 114, -23, 23, 2907, 174, 43, + 18, 33, -31, 320, -9, 290, 2, -7, + 39, -11, 52, 32, -4, 8454, 18, 10, + 67, 20, 22, -3, -209, -103, -212, -101, + -101, -420, -2837, -28, 398, 140, 1027, -187, + -2338, 406, -152, -288, 723, -412, -1851, 185, + 641, -190, 107, -7, -3194, -128, -382, 165, + -256, 85, 96, 155, -144, 431, -356, 342, + -2508, -2190, -265, -320, -1345, 27, -1981, -1949, + 95, -78, -456, -359, 382, -218, -102, 164, + 382, 907, 599, 665, 2843, 4275, 17, -156, + -264, 73, 104, -25, -120, 91, 84, 325, + 170, -65, -245, -23, 89, 52, 4651, 124, + 185, 30, 321, 145, 111, -1265, 128, -156, + 64, 24, -1934, 133, -84, -10, 34, 801, + -148, -88, 169, -1687, 419, 1739, -204, -70, + 185, 117, 379, -420, 145, -3650, -264, 1118, + 331, -818, -665, -420, 74, 32, -152, -226, + 6, 216, 4173, 23, 1230, 239, 2, -57, + -690, 516, 90, 58, -24, -61, 175, -2796, + -113, -270, 94, -2319, -158, -1075, -275, -647, + -3839, 37, 4267, 20, -49, -88, 72, -171, + -195, 45, -23, -159, -64, 110, -211, 42, + -211, 1591, 276, -3662, 213, 54, -180, 786, + -92, -329, 382, 344, 165, -63, 14, -7, + 66, 29, 8875, 43, -50, 65, 13, 15, + 48, -40, 114, 125, -27, 158, 3, 843, + 8, -646, 100, -3121, 1720, 88, 898, 346, +}; + +static const int16_t cb2224m1[] = { + 9581, -198, -100, -22, 237, -15, -101, -23, + 46, 129, 63, -143, 5, -307, -143, -9, + 27, 50, 40, 6048, 25, 58, -16, -161, + -109, -157, 137, 115, 121, 164, 4, -54, + 6477, -68, -120, -29, 45, -8, -13, 334, + -87, 105, -1460, 28, -334, -163, -64, -3629, + -71, 176, -195, 53, -1, -96, -560, -21, + 135, 178, -77, -4202, 20, 2544, -205, 85, + -332, 158, 61, -105, 398, -88, 14, 241, + -149, 62, -124, -136, -153, 27, 190, 2595, + 25, -2499, -530, 1809, -104, -2753, 298, 145, + -771, 139, 165, 2462, -502, 860, -174, 199, + 74, 163, -686, -25, 57, -103, -309, -360, + 39, -296, -2765, -319, -950, -678, -1159, -1743, + 1499, 1776, -176, 9, 44, -581, 69, 39, + 162, 326, -96, 329, -9, 1274, -2443, -105, + -50, 4212, -23, 146, -231, -22, -50, -128, + 11, 28, 116, -215, 46, 217, 204, 153, + -73, -156, -100, -31, 2632, -190, -2258, 199, + -1757, 194, 53, 38, -5723, 66, 169, 352, + -39, -150, -1, -462, 41, -98, -110, -40, + -5763, -190, -158, -1380, 205, -227, -402, 81, + -171, 407, -125, -320, -456, -317, 489, 698, + -308, 3989, -172, 402, 196, -457, -1238, -192, + -581, -63, -235, 153, -1094, -53, -45, -86, + 240, -192, -2660, 2356, 153, -60, 277, 33, + 198, -57, 1221, -2984, -327, -326, -48, 61, + 93, -34, -167, -311, 904, 348, 415, 57, + 2000, -77, 238, 40, -3072, -36, 283, -54, + -655, -250, -22, -569, -584, -18, 733, -251, + -72, -28, 80, -306, 211, 188, -149, 4596, + 305, 372, 351, -82, -184, -79, -65, 2688, + 2670, -54, -81, -170, 19, -88, 122, -117, + 33, 51, -29, -113, -2973, 46, -3294, 90, + 8, -180, -227, -62, 43, -25, 187, -380, + -29, -89, 138, -352, 231, 2632, 158, 1993, + -15, 350, 107, -982, -16, -1120, 136, -171, + -42, 2605, -186, 110, 167, 1673, 1140, -29, + -689, 81, 909, -455, 2979, 44, 1, -260, + 26, 28, -90, -568, -123, -175, 232, -38, + 2372, 111, 312, 529, -65, 331, 100, 488, + 12, -596, -497, 2311, -1097, 1242, -94, -2290, + -158, -2651, 16, -232, 3352, 24, -53, -83, + -5, -52, 205, -104, -294, 217, -196, -37, + -7, 0, -28, -45, 60, 13, 41, 111, + 142, -7331, -40, -200, 18, -166, -1266, -47, + -250, -592, -604, 33, 83, -204, -1131, -166, + 1348, -1337, 184, 50, -10066, 30, 24, -184, + 137, 53, 32, 87, -27, 151, 100, 10, + -47, 28, -138, 12, -2977, -376, 58, 168, + 1642, 144, 1039, -399, -807, 5, -1715, 12, + -142, -77, -306, 758, 674, -82, 3216, -369, + 60, 480, 276, -423, 5102, 3325, 169, 47, + 235, 37, 81, -86, -28, -56, -59, -205, + -126, 28, 279, -8433, 137, -26, -409, -19, + 106, -163, -76, -57, 235, 7, 131, -81, + -197, -318, 1281, 310, -2934, 972, -1335, 35, + -308, -93, -128, 433, 527, -193, -1303, 162, + -34, -87, -157, 262, 4999, 25, -311, -349, + 94, -262, 0, -219, 57, 12, -4, 10, + -17, 38, -320, 48, 156, 80, 5880, 48, + 45, 31, -1022, 31, 227, -727, -135, 261, + -21, -688, 307, 3196, 565, 627, -546, 237, + -2367, -33, 1622, -87, 1722, -201, 720, -539, + -288, -1012, 141, -388, -72, -20, -59, -2042, + -53, -101, 208, -233, -835, -16, 3092, 2, + 310, 94, -362, -163, -128, 30, -22, -145, + 420, -1, 322, -524, 2742, -276, 206, -2475, + 575, -653, -342, 1412, 1, 75, -14, 54, + 170, 66, 342, -261, 709, -75, 2240, -134, + 32, 665, 171, -134, 1822, 109, 569, 3129, + 168, -356, 53, 1259, -67, 43, 120, -124, + 2185, 2461, -17, -255, -349, -167, -158, -19, + 84, -732, -972, 286, 87, 4603, -160, 7, + 141, 1, 286, 310, -315, -99, 282, 384, + 68, 93, -1815, 63, -86, 121, -293, 210, + 115, 63, -174, 616, -1848, -124, 1275, 298, + 185, -267, 3516, -105, -162, -253, -434, -674, + -90, -2232, 38, 168, -261, 289, 70, 3714, + 4096, -81, 17, 56, 57, 68, -20, -146, + 28, -152, -17, -97, -131, 2648, 71, -3359, + 40, -277, 313, 85, -26, 41, -202, 76, + 8, -80, -160, -102, -17, 155, 189, 1552, + -3498, -446, -103, -232, -205, -574, -132, 169, + 206, 1689, 1043, -736, -178, -93, -2969, 26, + -251, -148, 139, 70, -325, 117, -3073, 9, + 43, -11, -380, -190, -314, -3012, 50, -330, + -26, 710, 153, 19, -2943, 58, -3052, -56, + 7, 40, 9, 321, -37, -461, -22, -374, + 57, -203, 16, -15, -25, -16, -37, -8, + -41, -116, 7964, 70, -59, 77, 200, 0, + -43, 118, -72, -67, 104, -6, 78, 171, + 13, -103, 793, 98, -4738, -204, 11, 30, + -72, 33, -62, 47, 157, 236, -147, -416, + -726, 578, 5, 4038, 162, -2, 2367, -138, + -185, 470, 3121, 70, 185, -22, -205, 37, + -63, -335, -397, 43, 10, -6557, -112, -254, + 106, -129, -236, 0, -250, 42, -128, 84, + -531, -27, 2259, -282, -21, -70, -408, 19, + -664, 945, -196, -1074, 1369, -40, -3233, 28, + 20, -2133, 125, 343, 113, 584, -14, 50, + -130, -464, 513, 807, -4474, -63, 57, 1120, + 64, -30, 346, 462, 129, 219, -30, 287, + 448, 384, 198, -359, 1097, -256, 828, -2635, + -314, 336, 506, -144, 194, 167, 1323, -273, + -4168, 2805, -118, -8, 136, -82, -212, 53, + -259, -61, 94, 214, 11, 29, -262, -69, + 24, 102, 45, -31, -186, 58, 641, 659, + -172, 3628, -192, -423, 34, 3, 45, 19, + 349, 117, -5, -4923, 99, -148, 180, 631, + 50, -204, 641, -92, 156, -1985, 1077, 201, + 56, -405, 710, -220, -1917, -273, -234, 100, +}; + +static const int16_t cb2224sl0[] = { + -3113, 97, 229, 309, -156, -226, -469, 582, + -3202, -336, 102, 20, 96, -960, 297, -227, + 592, -3352, 2798, -637, -133, 191, -407, 170, + -576, -203, -280, 808, 853, -502, -113, -1704, + -1025, 411, 2802, 233, -568, 360, -616, -1715, + 47, 391, -2117, -458, -291, -149, -82, 26, + -29, -88, -156, 7905, 32, -75, -154, -78, + -44, 155, -1, -338, -891, 170, -75, 155, + 226, -192, -328, -239, -574, -91, 95, -600, + 4271, 25, 990, -207, 4676, 59, -324, 884, + 363, 65, 423, -776, -906, -79, -4, 1475, + 549, -252, 3584, 3543, -409, 282, 278, 125, + -379, 125, -180, -123, -252, -316, -193, 347, + 53, 2009, 195, 152, -104, 233, -75, -546, + 564, -177, 3243, -865, -924, 518, -692, -381, + -1885, -110, -188, 1140, -2043, -438, -1721, 1019, + 1678, 13, 273, -751, 922, -291, -15, 75, + 232, -112, 60, 2702, 88, 175, -119, 43, + -549, -1094, -1879, 401, 1587, 1287, -41, 41, + -116, -23, 313, 168, 147, -101, -57, -115, + -6990, 54, -14, -240, -164, 127, 25, -703, + -361, 769, 1555, -2440, -2616, -192, 86, 769, + -29, -721, 554, -663, 327, 659, -31, -79, + 91, 365, -74, 1268, 115, 480, 3054, -1758, + 1704, 759, -657, -272, -329, 31, -145, -534, + 1265, 73, 435, -54, 480, -867, 2724, 2373, + 890, -314, -112, -2576, -598, 473, 121, 2764, + 1659, 105, 579, -416, -87, 158, 300, 447, + -281, -6109, 35, 217, 185, 56, -357, 151, + 108, -49, -282, -484, -220, -78, -141, 256, + -1095, 1812, -985, 1115, 555, -2116, 2317, -1141, + -792, -866, -119, 187, 615, -194, 73, -43, + 268, 437, 250, -52, 477, -249, -475, -2621, + 590, -2987, -603, -652, 971, -684, 337, -140, + -336, 2342, 390, -204, 295, 85, -44, 321, + 754, 2660, 61, 782, 1654, -76, 2727, 1590, + -1099, 354, 49, 2784, 443, -762, 828, -308, + -493, -755, -370, -336, -207, 388, 630, -127, + 1955, 1929, 1270, 2054, 525, 388, 562, 942, + -789, -453, 158, 995, -99, 2258, -317, -493, + 385, -90, -79, 199, -1187, 519, -254, 179, + 573, 2803, 2341, 407, 95, 515, 332, 1, + -6, -337, 142, -316, 418, 542, 3281, 10, + 604, -542, -1595, 43, 79, 10, 75, -122, + 100, -55, 212, -223, -353, -557, 490, 4870, + -3689, 3594, -145, -192, -47, -252, -380, -180, + -221, 656, 78, -188, 120, 135, -253, -437, + -208, -151, -504, 217, -3715, -150, 528, 121, + -1468, 383, 823, -55, -1167, -8, -198, -515, + -296, -24, 84, 129, -472, 7, 5071, -114, + -200, -16, -271, 59, -430, -142, -315, 90, + 273, -56, 370, 3342, -159, 235, 934, 1605, + -1499, 207, -1650, 1137, 396, -2250, 276, -320, + -317, -23, 276, -519, 163, 566, 366, -6, + 2262, -2035, -662, -3300, -133, -3811, -362, -348, + 113, 146, -79, -298, 238, 221, 99, 194, + 326, 325, -112, -8160, -59, -15, 8, -41, + -261, -20, -6, -68, -140, -41, 167, -125, + 129, 337, 2404, 281, -336, -475, 2085, -2646, + 572, -1308, 376, 114, -506, 1062, -575, -529, + 3347, -212, 520, 274, -163, -3058, -93, -203, + -932, -207, -36, 303, -117, 278, 287, 204, + 205, -228, -242, 227, 3, 611, -190, -458, + -44, -209, 122, -390, -4561, -139, 1378, -329, + 440, 989, -1782, -348, 1241, 967, -477, -2312, + 554, -970, -1103, 473, -771, -50, 150, 327, + 394, -267, -648, -680, 2376, -2543, 276, 1220, + 552, 10, 1399, -1498, -801, 9, 2351, -55, + 155, 327, 88, 864, 428, 179, -3234, 6, + 544, -647, -306, 132, 329, 1147, 1920, 1436, + -2107, -1122, 341, 2020, -432, -97, 117, 793, + 100, -693, 174, 3639, -570, 910, -2771, 231, + -148, -960, -1085, 57, 188, 744, -709, -441, + 533, -295, 1287, 2939, 2987, 885, 611, 700, + 364, -205, -855, -617, 48, -162, -244, -318, + 208, 772, -124, -2505, 454, 330, -220, 335, + -362, -899, -827, 2188, -40, -1638, 356, -160, + -127, 2886, -69, -41, 209, 1847, -236, 2752, + -24, 387, 354, -111, 526, -237, -2169, 1319, + 2211, 144, -348, -434, -319, 1373, 78, 906, + 701, 539, -134, 414, 496, -325, -36, 116, + 124, 4198, -35, -439, -208, -531, -100, 1453, + -175, 723, -908, -461, 87, 127, -91, -125, + -140, 8012, -186, 23, -93, 107, 176, 218, + 35, 193, 174, -27, -4, 77, -103, -199, + 116, -41, -80, 186, -6965, -188, 125, -54, + 43, 9, -49, -192, 69, -136, -24, -117, + -2244, 2289, 145, 226, -1161, -1950, 881, -152, + 1611, 1015, -174, -277, -158, 369, 49, -233, + 221, 275, 69, 108, 136, -124, 1, -470, + 376, 149, -7596, 55, 53, 213, -247, 80, + -217, -11, 189, 125, -17, -141, 165, -2890, + 14, 201, 106, 242, -254, -306, -3157, 459, + -10, 24, -271, 877, 437, -438, 18, -126, + -9, 5553, 63, 22, 55, 172, 21, -335, + 127, 160, 208, 121, 13, 1989, 676, -294, + 2208, -78, 634, -1518, -1037, 1309, 124, -39, + -322, -1420, -404, 377, -35, -14, 178, 110, + -8146, 26, -98, -153, -243, 145, 280, -8, + 29, -57, 85, -309, 281, 282, -47, -27, + 2827, -947, 141, 856, -2481, 406, -638, -362, + -1031, 230, -341, -119, -17, 1, 190, 41, + -15, 5111, 59, 74, 123, -282, -25, -300, + 4, -460, -216, 295, -217, 26, 227, 62, + 385, 748, 2923, 1946, 391, -1676, 599, 148, + -456, -96, 1066, 478, 117, 255, -169, -669, + -1939, -656, 2676, 677, -2020, -1314, 425, -525, + -89, -522, 2707, 153, 5, -207, 244, -1045, + 331, -1315, -82, 449, -2444, 326, -484, -2232, + 2380, -591, -999, -2552, -1581, 349, -440, 217, + 298, -729, -6, -396, -74, 110, -70, -3543, + -388, -51, 596, 126, 295, 2075, -123, -693, + -1072, -1779, -420, 127, 432, -3241, -231, -246, + 105, -437, -67, -119, -2941, -257, 47, -969, + 379, 618, -93, 7, 202, -425, -38, 140, + 458, 3599, 242, -24, -811, -624, -19, 524, + 2398, -300, 111, 376, 2015, 431, 125, 231, + -293, -2379, -634, 1842, -1, -1326, -610, -88, + 128, 80, 75, 30, 172, -235, 34, 206, + -79, 328, 128, -283, -6862, -101, 260, 68, +}; + +static const int16_t cb2224sl1[] = { + -3710, -340, 3183, 200, -124, 423, -417, -432, + 232, -808, 85, -145, 39, 196, -197, -60, + -154, -213, -320, -2941, 993, 3044, -508, 61, + -853, 75, 40, 873, -765, -365, -621, -2670, + 188, 57, -403, -230, -137, 40, 565, -1910, + -1120, -1019, -603, -1927, 150, -3089, 23, -416, + -199, -3265, 15, 128, -525, -531, 91, -39, + 578, -388, 315, 40, 2376, 1762, 2, -1475, + -1774, 111, 934, -459, 777, -582, 114, -218, + -82, -195, 165, 2171, 632, -67, 239, 345, + -257, 104, -34, -879, 488, -422, -2156, -823, + 1940, 699, 2911, -233, -125, -218, -111, -335, + -3475, -61, -71, -445, 249, -330, 102, 376, + -116, 2667, -453, 19, -4129, 90, -507, 236, + 418, 43, 79, 61, 296, 181, 190, 408, + 216, 198, 32, -81, 245, -157, 5555, -162, + 318, 179, 339, -463, -448, -254, -526, -192, + -427, 575, 588, 2792, 2683, -853, -566, 19, + -26, 106, -220, 518, 734, -233, 68, -604, + -231, 256, -187, -59, -405, 206, 331, -25, + -4837, -323, 146, 541, 723, 915, -144, 450, + 102, -371, 27, 88, -80, 276, 239, 101, + 157, -69, -14, 234, -8192, -18, -110, -52, + -8, 48, 79, -43, 153, 187, 211, -118, + -111, 238, 11, -2006, 680, 478, -695, 3078, + -30, 892, -23, 1512, -194, 423, -16, -318, + 895, 406, 634, 47, -3277, -205, -764, 297, + -357, -61, -188, -1547, -868, -174, 342, 261, + 1926, 88, -35, -3250, -20, 3168, -368, 778, + 376, 167, 598, 442, 134, 487, 164, -32, + 245, 436, 2067, 595, -578, 49, -163, 633, + 138, -279, -99, 118, 1141, -3168, 580, -90, + -3192, 551, -663, -2673, -55, 147, 1307, 9, + 15, 432, 307, 527, 1002, -469, -2380, -342, + -293, -73, -259, 410, 309, 76, -320, -161, + 282, -3300, -7, 160, 732, 484, -65, 147, + 2923, 2321, -840, 1933, 268, 684, 1172, -377, + -365, -568, -283, 492, -538, 409, -194, 17, + -297, -52, -123, -270, 161, -94, 92, 4495, + -396, 540, 229, -30, -108, 29, 1, 198, + 492, -572, -394, -2386, 2787, 885, -1175, -129, + -1137, 220, 148, 261, -65, -244, 1, 58, + 195, -49, -290, -94, -21, 105, 71, 6641, + -200, -407, -496, -75, 233, 222, 549, 363, + 188, 739, -869, 122, -355, 3326, 323, -2366, + 115, -3207, 2783, 2015, 148, 924, -153, -133, + -175, -287, 400, 73, -181, -174, 72, 45, + 219, -92, -11, 59, -5407, -362, -188, -120, + 239, 249, 133, -229, 158, 180, -575, -2386, + -354, 248, 532, -590, 615, -85, -69, 394, + 3052, -877, -320, 484, 218, -463, -202, -841, + 1729, 284, 1253, 2193, 526, -2444, -351, 1287, + -373, 387, 440, -203, 163, -153, 206, -57, + -96, 2616, -84, 552, 33, 705, -731, -843, + -2197, -2138, -570, 22, -264, 2143, 725, -132, + -392, 471, -245, 51, 739, -1057, 1049, -760, + 2701, 456, 20, 484, 595, 3248, -1415, -862, + 332, -417, 323, -431, 2082, 78, 684, -169, + 596, -228, -219, 172, 160, -180, -228, -3193, + -520, -100, -447, -629, -2178, -259, -246, -1788, + -2264, 223, 115, -74, 230, -2515, 212, -179, + 456, 209, -2379, -246, -345, -102, -559, 259, + -270, -426, 333, -358, 2866, -589, -1494, -418, + -160, -138, 2088, 683, -1313, 1061, -88, 916, + -148, -2329, -301, -271, -249, 2822, -525, -405, + 592, -322, -1328, -16, 135, -582, -676, -503, + -2162, -327, -237, 361, 166, 600, 1176, 1015, + 97, -5, 465, 2321, -4544, 202, -350, 313, + 149, 544, -420, 552, 183, 351, -1663, 688, + 238, 587, 907, -1719, 1267, -2325, 368, 236, + 296, -2608, 240, 997, 496, 105, 75, -179, + 235, 125, -40, 57, -22, -412, -464, -494, + -81, 576, -3461, -1037, -744, 1358, -856, -284, + -536, 387, -358, 184, -85, 2150, -1142, -124, + 119, 1242, 648, 711, 2161, -591, -1864, -672, + 62, 1879, -13, 55, 285, -167, 142, -130, + 322, 8, -35, -230, 632, -699, 4114, -500, + -189, -48, 2746, 47, 421, -1200, 2418, 460, + -306, 331, 164, -1358, 802, 453, 458, 3594, + 3065, -24, -134, -437, -892, -110, 241, -368, + 336, 673, -147, 130, 154, 89, 81, -341, + 7151, 175, 118, -227, -282, 262, 276, -118, + -118, -245, 7, 144, -87, -136, -146, -484, + 70, 221, -220, -13, -7638, 93, -38, -319, + -478, 26, -28, 281, -180, 182, -186, 90, + 192, 50, -2919, 153, -2651, 289, 47, -783, + 768, 384, 39, 194, -2358, 1242, -1679, 80, + 1292, 28, 682, 2807, 342, 466, 299, -380, + 376, 4466, 12, 553, 153, -447, 733, 99, + 8, -142, 606, -2364, 168, 167, -62, 404, + -3144, 352, 115, -3734, 360, -202, -462, -196, + 464, -412, 192, -363, -413, -405, 254, 357, + -2801, 1054, -1602, 642, -254, -430, -2259, -97, + 16, -311, 757, -64, 412, 339, -227, -216, + -29, 219, 67, 63, 26, -232, -138, -301, + 241, -52, -6118, 223, -379, -157, -221, -201, + -93, -5630, -286, -194, 133, 46, 151, 444, + -472, 103, -115, -259, -53, 673, 1744, -2374, + 359, 2541, 613, -393, 1235, 221, -117, -842, + 1166, 105, -142, 1426, 3, -423, 36, 398, + -2742, 723, -740, 985, 498, 431, -1312, 832, + -1644, 146, -69, -110, 420, -130, 335, 269, + -2865, -67, -88, 50, 2735, 1038, 973, 371, + 654, -169, -112, 579, -319, 2434, -760, 710, + 241, -1889, 39, -1807, -30, 1383, -1080, 449, + 639, -2478, -760, 559, 298, 56, -421, 818, + -442, 1558, -1610, 2136, -12, -11, 592, 73, + 77, -172, 77, 92, -113, 281, 581, -584, + -4448, 507, -195, 183, -508, 312, -724, 1043, + -18, -10, -776, -534, 249, -3178, 904, 1234, + -482, 382, -1040, -448, -579, 227, -82, 5628, + -165, 255, 109, -141, 7, -28, 63, 93, + -211, 0, 162, 581, -153, 5844, -66, 122, + -102, -90, -205, -181, 243, 312, 111, -435, + -105, -343, 272, -141, 6, -98, -16, -73, + -26, -125, -7627, -73, -66, 108, -175, 186, + -189, -102, -240, -37, -354, -260, -120, 30, + 87, 2560, 3157, 369, -662, 338, -503, -66, + -1405, 178, 1100, -683, -2618, 2459, -1291, -248, + -139, -683, -865, 1445, 165, 368, 507, -585, +}; + +static const int16_t cb2224ss0[] = { + -6880, 657, -621, 69, 219, -588, 681, 229, + 248, -302, -110, 734, 12, 253, -454, -890, + -3596, 778, -2600, -256, 529, 332, -69, 295, + -455, 982, -265, -70, -332, -367, 1494, 586, + -158, -1054, 2529, -313, -661, -1302, -2486, 476, + 5, 126, 581, 361, 1618, 650, 2033, 202, + 76, -265, -161, 3659, -800, 1069, -167, -1792, + 389, -580, 597, -268, 621, -1035, 710, 854, + 2004, -785, 2714, 1659, 785, 800, -80, 9, + -341, -1032, 789, 651, 1068, -609, 661, 747, + -928, -999, -1369, -1173, -416, 1596, -2800, 330, + 546, -1275, -746, -392, -529, -378, 3571, -2795, + -731, -183, -330, -1591, 371, 866, 323, -516, + -89, 2277, 1593, 960, -1726, -2229, 727, -415, + 189, 500, -145, -177, 550, 467, 240, 1131, + 474, -419, -1236, 674, -616, -519, 2439, -1213, + -650, 867, 974, -908, 1229, -512, 932, -495, + -2521, -865, -466, 8, -426, 912, -77, -236, + -407, 433, 128, 3653, 854, 243, 770, 191, + 224, -68, -453, -383, 279, -701, -691, 282, + -449, 1148, -783, 241, -5021, 643, 8113, -345, + 13, 90, -57, 475, 64, -268, -163, -100, + -95, 518, 577, 541, 2055, 358, -157, 360, + 280, -840, -1161, 500, 95, 302, -662, 1134, + 827, 3300, 695, 775, -798, -2651, -2891, -1123, + 555, -1125, 156, 328, 671, 751, -347, -972, + -392, -1216, 2725, -5152, -402, -15, 150, 31, + -182, -278, 245, 81, -3, -46, 310, -72, + -138, 1511, -1762, -1840, -364, 123, 2801, -16, + -543, -1312, 562, -262, 148, 521, -711, 61, + -863, 145, 329, 761, 76, -155, 101, -4986, + 192, 269, -364, -174, 640, -261, 629, 3638, + 397, -1757, -1177, 342, 388, 1089, 824, 115, + 150, 125, 806, 1271, -198, 800, -175, -897, + -649, -837, 690, -755, 1416, -2347, 1179, -781, + 826, 1567, -148, -156, -1036, -1572, 1248, -187, + 464, -260, -749, -1070, 85, -466, -2160, -2802, + 233, -181, 447, -482, 113, 548, 2957, -1600, + 1341, -559, 803, 2085, -807, -711, -1169, -456, + 657, -76, -147, 1932, -1054, -967, -1100, -49, + -2829, 1412, 929, 1207, 58, -146, 77, -458, + 538, -627, -12, 214, -2397, 692, 1284, 366, + 1286, 1997, -856, 267, 1866, 1236, 25, 254, + -1187, 3456, 283, 584, 2348, 604, -1130, 7, + 500, 232, -51, 120, -695, -930, 317, 67, + -1346, -500, 312, -1060, -2338, -1860, -1491, 1539, + -1707, 778, -653, -41, 401, 311, -13, 2155, + -1011, 1163, 712, 2090, 1336, -726, 574, 1200, + -1254, -1567, 723, 683, -877, -653, 1137, -1594, + 1127, 2641, 465, 259, -2095, 696, -405, 40, + -259, -808, -942, 395, -180, -1119, -966, -230, + -534, -114, 88, -661, 757, 75, -286, -119, + 924, -2925, 2483, 1662, 1823, 590, 4307, 810, + 447, 165, 243, -184, -162, 436, -126, -194, + 365, 601, -354, -1983, -211, -663, 276, 155, + -696, -2542, -830, 2374, -235, -585, -469, -478, + 21, 867, -1633, 1949, -949, -330, -546, 328, + -224, 1236, 266, -1117, 36, -61, 221, 153, + -3491, -1463, -237, 4676, -241, 273, 268, 347, + -393, -277, 168, 426, 155, -65, -605, -569, + -1416, -1303, 1248, 595, -148, 512, 3622, 291, + -444, -523, 616, 105, 101, 1357, 772, -337, + 494, 570, 15, 150, -400, 572, 590, 1674, + -4106, 940, 167, -327, -336, 696, 591, 362, + 279, 4489, -1325, 608, 294, -41, 549, 982, + -31, -184, 367, 77, -466, 398, -1928, -607, + 239, 55, 15, 1031, -486, 2788, 2151, -519, + -1197, -1144, 274, 671, 1620, 2079, -1555, -961, + 543, -11, 26, -627, 777, -581, -1060, -1177, + -808, 807, 2863, 607, 144, 195, -274, 18, + -5656, -355, -1026, 56, 116, -431, -493, 517, + 286, 353, 353, 199, -651, -863, -276, -556, + -562, -867, -143, -355, -323, -14, -54, -5354, + -43, -1592, 8, -543, 24, 94, -731, -545, + 705, -171, 504, -1078, -3367, 1349, 452, -148, + 1183, -1650, -1400, -246, -1032, -119, -309, -566, + 998, -3240, -444, -658, -605, -186, 491, 439, + -190, 688, -29, -965, 2562, -112, -329, -25, + -2593, 355, -53, 692, 12, -593, 1930, -804, + -82, 386, -632, 927, 1006, -229, -1147, -181, + -1075, -245, -3678, 904, -298, 2263, 50, 563, + 337, -1051, 173, 310, -3540, -615, -504, 749, + 192, -90, -113, -730, -1994, 802, -45, 2234, + 167, 289, 1722, -562, 682, 453, 1571, 171, + -2429, -441, -230, -1144, 985, -1602, 358, -685, + -23, -523, -529, -2438, 700, -624, 37, -1475, + -1318, 3292, 702, 394, -798, 2563, 1057, -335, + 614, 270, 3135, -1281, -2089, -250, -140, 45, + -517, -470, -1429, -172, 2637, 267, 55, -1037, + -174, 912, -865, -786, -406, 537, -2805, -642, + -1599, 888, -1044, -175, 312, 28, -1157, -240, + -181, 298, 521, 3802, -87, 93, 48, 1336, + -1071, -1870, 339, -1106, -944, -1036, 361, -3719, + -147, 625, 326, -122, 407, -217, 396, 273, + -2, -315, -262, 632, 6868, 228, -267, 207, + -29, -274, 192, 63, -353, 588, 550, -3, + 156, 2115, 1580, -2366, 306, 633, 1354, 2313, + -360, -345, 270, -499, -976, -3685, -1305, 907, + 1431, 1545, -1334, 18, 1159, 229, -124, 157, + 470, -105, 700, -1786, -1895, 795, -1052, -278, + 745, -111, -45, 694, 599, -3469, 552, -70, + -222, 45, 896, -251, 1, 250, -769, 301, + -1151, 1313, 4314, 710, 680, -169, -663, 40, + 399, 1171, 581, 775, 936, -488, -2918, 155, + -169, -1560, -862, -473, 783, -72, -1791, 567, + -2109, -156, 1250, -1486, 3253, 61, -50, -374, + -277, 942, 111, 607, -316, 197, -748, 871, + 612, -242, -296, 53, -193, 1233, 11, -962, + 505, -4492, 21, 754, -150, 451, 183, 881, + -652, -159, 6384, 170, 271, 1035, 401, 48, + -463, -240, -95, -625, 613, -91, -1138, 1172, + 542, -1483, -2638, -1396, -1173, 612, 512, 1355, + 977, -362, -22, -17, 124, -3178, -532, 352, + -2691, 610, 569, 740, -1603, -5, -492, 704, + -436, -96, -595, -1495, 2730, -3089, -164, 565, + 1300, -477, -569, 1069, 294, -233, -133, 708, + 150, 388, -2108, -1042, -1603, 2275, -1722, 561, + 140, 507, -899, -281, 162, -1297, 1504, -158, + 193, -730, -944, -2484, 615, -30, 32, -354, + -383, 86, 329, -3434, -382, -1604, -299, 208, +}; + +static const int16_t cb2224ss1[] = { + 8192, -187, -471, -201, 185, -465, 976, 257, + 83, -530, 310, 676, 341, 48, 265, -351, + 306, 280, 302, 48, 496, -339, 424, -5250, + -253, 604, -317, -289, 278, 573, -579, 79, + 3218, -574, -377, 276, 2831, -287, -254, 332, + -225, 42, 162, -457, -959, -1421, 683, -59, + -33, 3362, 393, 606, 249, -873, -930, 1224, + 1469, 37, -1592, 1665, -582, 1729, 284, 106, + -4753, -120, -475, 867, -444, -203, 431, -11, + -526, -324, 732, -1070, -160, -611, 1808, -297, + -536, -194, -822, 1224, 2220, -2330, 72, 1004, + -787, -149, 557, 2925, 29, 809, 2397, -1143, + 648, 904, -568, -707, -839, -274, -1322, 1177, + -467, -482, -5181, 234, 223, 354, 386, 737, + 1273, 234, -353, 31, -8, -392, 85, -234, + 1366, 1449, 120, -695, 838, -622, -96, 382, + -1421, 612, -173, -3199, -150, 474, -394, -561, + -1171, 2541, -271, 2513, 670, 285, 636, -452, + -202, 1319, -2182, -935, -586, 243, -813, -41, + -53, -1041, 212, 58, -3424, 111, 268, 964, + -3231, -500, 867, -191, 207, 543, 383, -1509, + -2712, -2752, 201, 428, 721, 498, 19, -747, + 67, 87, 500, 1200, 2244, -1158, 466, -1032, + -153, 1197, 2737, -324, 2002, -338, 89, -428, + 78, 575, 330, 2013, 175, 305, 567, -539, + 17, 384, 485, 860, 3330, 173, 586, 649, + 388, 963, 1820, -2610, 251, -2966, 1383, -153, + -146, 564, -718, 998, -1283, -566, -619, 394, + 459, -1233, 2566, -357, -2601, 98, -929, -367, + -501, 96, 1217, -1695, -324, 393, 261, 1745, + -1095, -751, 924, 1044, -337, -1243, 393, 2454, + -1499, -245, 902, 925, -2126, 167, 838, 638, + 2296, -294, 306, -715, 2794, 1522, -339, 21, + 318, -95, 1334, 75, -173, -91, -2012, -920, + -801, 334, -3363, -348, 550, -911, -261, -1073, + 185, -425, 431, 515, -339, 1817, -1589, 241, + 548, -337, -471, -3532, -1166, 888, 141, -277, + 1353, 310, -654, 198, -516, 2951, 2251, -534, + 701, 237, 20, -597, -301, 3, 410, -456, + -581, -1254, 1052, 1321, 165, 3108, 477, 196, + 2716, 85, 5, -34, 721, -562, 4, 84, + -793, 744, 243, 134, -385, -129, -122, -128, + -333, -483, -604, 269, 6209, 3, 515, -63, + -634, -551, -795, -1696, -2210, 2184, 348, 30, + 413, 2531, 214, 214, -186, -72, -552, 958, + 1727, -1639, 618, -61, -432, 365, -753, 15, + -14, 33, 976, -940, -355, 3318, 677, -1938, + 21, 881, -326, -83, -3355, 1483, -1211, -674, + 166, 139, -276, 158, -736, 1038, -1005, 1129, + 1219, 1115, -392, 558, 96, -188, 314, 536, + -423, -3262, 395, -130, 1099, 304, -181, 853, + -160, -1272, 428, -179, 634, 608, -173, 2690, + -2191, 1385, -518, -416, 3239, 3250, 313, -23, + 200, 643, -639, -17, -208, 27, -182, 262, + -203, -671, 157, -4131, 383, -404, 337, 51, + 431, 92, 138, -438, 29, 337, 488, -252, + 656, 509, 2037, -635, -1074, -1115, -2135, -772, + -386, -214, -654, -441, 1661, 542, -383, -1720, + 22, -103, -1474, -1288, 4361, 282, -1252, 734, + -858, -556, 294, 243, 293, 133, 848, 65, + -727, -887, -1314, 443, -96, -422, 4268, 672, + 142, 608, -442, 843, 365, -866, -157, 780, + 107, -888, 2089, 1769, 73, 739, -15, -1730, + -1235, 920, -1713, 163, 552, 1479, -692, -755, + 1430, -193, -276, -264, -690, 772, 1403, -40, + 679, -260, 642, -3562, 962, 2053, 1348, 36, + -2974, 155, 303, 821, -944, -179, -967, 632, + -725, 411, -447, -463, 694, -337, -146, 59, + -1, -416, 12, 524, -497, -4682, -745, 625, + 1011, 20, -462, -503, 2012, -475, -27, 85, + -1190, 534, 2250, 87, 2591, 1195, 1665, 423, + -813, -571, -372, 2601, -2013, -853, -734, -403, + 793, -549, 1243, 312, 722, -1013, -1434, -749, + -571, 494, -88, -129, 1331, 806, -1227, 326, + -1164, 2487, -59, 2346, 583, 519, 368, 793, + 1178, 661, 140, 1226, 378, -429, -1214, 1438, + -319, -77, -1495, 3598, 361, 21, 39, 1930, + 198, 1050, 531, 274, 32, -499, -349, -5, + -133, -3324, -379, -742, -250, -1618, -1536, 2084, + 1369, 765, -132, -324, 406, -2198, 314, 502, + -1431, 759, -729, 320, -2120, 1484, 2468, -3283, + 4, 272, -2, 492, 91, -803, 48, 691, + 375, 87, -508, -725, -632, 268, 2929, 1302, + -11, -628, -2225, 723, 533, 909, 934, 682, + 350, 1509, -707, -1142, 106, -2174, 342, -965, + 456, -655, 1137, -553, 415, -418, -2631, -121, + 237, 3, -1123, -1555, -1413, -3333, 717, 115, + -1030, -1007, -819, 130, -851, 281, -43, -473, + -1091, 326, 869, -377, 278, -148, 418, -2104, + -422, 623, -1777, 633, 1033, -2031, -1221, 4126, + -60, -16, 8025, 243, -340, -599, -501, -289, + -219, -104, -230, 464, 191, 18, 345, -65, + -68, -481, 625, -822, -4011, -516, 741, 734, + -316, 530, 122, 945, 371, -298, 1194, -250, + -167, 392, -95, -151, -1, -486, 189, 90, + -140, 30, 4485, 581, 54, 1905, -895, -2032, + -174, 2473, -688, -104, -315, -376, 830, 296, + -548, 754, 195, -901, -1548, -1931, 792, 510, + 294, 153, 619, -1034, -3038, 1134, 142, -29, + -806, -118, -29, -2314, -159, 770, -2899, 23, + -1045, 1037, 1496, 1104, -527, 135, -281, -310, + -59, 202, -346, -612, 206, 27, -456, 758, + 67, 3547, 867, 227, -3, 573, 1440, 421, + 170, 1491, -691, -43, -8, 784, 307, 557, + 618, -2387, 566, -396, 182, 877, -2666, -163, + 553, -155, 691, -188, -1584, -1085, 1033, -308, + 1356, -570, -721, -232, -3145, 104, 511, -964, + 2783, -685, -168, -51, 1554, -1816, 2431, 327, + -440, 1174, -265, -36, 120, -397, 1094, -1254, + -973, 574, 1085, -139, -751, -529, -240, 25, + 1137, -467, -3471, 338, -806, -2028, 94, -98, + -336, -537, 1189, -880, -3607, -168, -59, 100, + 309, 1097, 295, 262, 106, -8, 210, -7461, + 395, -248, 461, 490, -326, 264, 105, 13, + -160, 608, -443, -1331, 835, -1342, 3507, 763, + 966, 101, 1047, -469, -1455, -1080, 28, 99, + -44, 270, -752, 130, 2, 57, 358, -409, + 2, -658, -812, -899, 155, 141, 2101, 3616, + 40, -1957, -1028, -4137, 212, 1580, 578, 1019, + -512, 167, 366, -580, 448, 216, 79, -149, +}; + +static const int16_t cb2224sm0[] = { + -4334, 1434, -228, 1477, -1329, 230, 686, -558, + 486, -188, 424, -454, -568, -141, -326, -132, + -39, 2488, 9, 631, 513, 460, -417, 2656, + 633, -1404, -81, -283, -287, 480, 2558, -19, + -158, -2699, 405, 276, -639, -151, 529, 241, + -941, -796, -213, 1125, -391, 2515, 78, -177, + 2677, 217, 955, -687, 867, -485, -121, 1023, + -1572, -591, 139, 798, 1262, -467, 722, 2643, + -237, -1048, 386, -432, 180, -788, -178, 234, + 403, 267, 312, 2661, 585, -2775, -686, -88, + -16, -1243, -445, -259, 303, 298, 285, 277, + 2355, 163, -2399, -416, 115, 2277, -707, 194, + 283, 1183, 23, 119, 97, 8192, -40, 67, + -101, 151, 169, 21, -147, -160, 55, -207, + 550, -36, -500, -32, 225, 206, 72, 179, + 464, -406, 52, 696, -18, -4827, 1547, -516, + -2275, 855, 430, -523, 83, -1633, -1898, 285, + 202, -645, -167, 102, -124, 382, 24, 236, + 830, 324, -84, 491, -95, -154, 767, 25, + 4741, -574, -2576, -297, -250, -346, -2867, -64, + -1119, 1007, -883, 457, -328, -854, -981, -55, + 6922, 569, -307, 261, -100, -832, 129, 416, + -154, 681, -136, 1152, -144, -26, -2266, -320, + -141, -897, 544, -206, 845, -590, 88, 211, + -1761, -574, -653, -2788, 252, -266, -4252, 295, + 97, -2112, 209, -144, 655, -89, -369, 591, + 205, 1137, 30, -2907, 88, 92, -240, -3106, + -16, -398, -576, -720, 421, 427, -423, -195, + -18, 2503, -133, -918, 104, -512, -489, 2623, + -314, 215, -103, -1014, 761, 382, -1456, 1719, + -980, 248, 55, 644, -1945, 42, -162, -35, + -852, 1993, -189, 664, -149, 3132, -50, 3438, + 550, -234, -566, 434, 64, 379, -169, -291, + -718, -608, 31, -207, 651, -2567, -790, 906, + 518, 1740, 373, 1158, 114, -2044, 285, -1136, + -373, 932, -2185, -488, 148, 3, 724, 623, + -568, -359, -2748, 751, -1098, -858, -1140, -253, + -2377, -402, -312, -398, -47, -2618, 816, -568, + 1274, -158, 118, 107, 181, 394, 2758, 80, + -3057, 20, -279, 110, 482, 1010, -162, -1081, + -56, 685, 2207, -10, 82, 440, 593, 43, + 1010, -853, -624, 288, -3045, -426, 9, 132, + 104, 157, 466, -118, 116, 226, -214, -219, + 299, 6093, 122, 7, 174, 444, 200, -42, + -4, -313, 99, 218, 292, -159, -409, 523, + -1357, -4098, -96, 968, 8, -172, -444, -1040, + 755, -476, 967, 175, -100, 1689, -813, 3175, + 369, 1828, 248, -161, 6693, 631, 536, -125, + 274, -467, 259, -427, 130, -523, 361, 584, + 27, 60, -57, -30, -8192, 148, -64, 217, + -308, 163, -116, 89, 108, 191, -129, -149, + 128, 60, 575, 253, -385, -2937, 888, -1402, + -543, -607, 2639, 156, 251, 6966, -147, -382, + -388, 39, 476, 260, -1048, 575, 401, -245, + -441, 121, 389, -666, 95, 2919, -2212, -765, + 169, -161, 184, -320, -315, -497, 136, -470, + 479, -541, 712, 2966, 519, 2595, -77, 1089, + 18, -697, -616, 241, -54, 388, 461, 368, + 144, -149, 181, 7699, 11, 3, -368, 65, + 304, 358, -29, 255, -162, -169, -470, -16, + 198, 92, 2137, 233, 273, 255, 4078, -279, + -194, -274, 101, 45, -225, -716, -2522, -188, + 10, -590, -745, 894, 1976, -48, 2302, -4, + -4691, -67, -1325, -506, 605, -297, 317, -271, + -176, 1706, 541, 1, 31, -580, 103, 148, + -122, -141, -849, 76, -3094, -67, 2775, -38, + -598, -314, 793, 40, 324, 1474, 1986, 1505, + 832, -504, 739, -1233, 1201, 695, -1363, 670, + 805, 696, -137, -4977, -306, 137, -885, 455, + 1021, 600, -1711, 536, 235, -149, 31, -5, + -3747, -405, 394, 140, 102, -1576, 190, 408, + 663, -2075, -747, 466, 631, 807, 1867, -655, + 102, 341, 435, 551, 500, 426, -650, -88, + -26, 2672, -1791, 34, -86, 2963, -3330, -793, + -307, 277, -584, -240, -141, 258, 708, -242, + -499, 808, -104, -2061, -518, 684, 889, 406, + 259, 211, 462, 428, -2597, -1147, 1729, 683, + -2173, -167, 392, 440, 599, -815, -624, -368, + -2962, -172, 845, 423, 362, 711, 2131, -3899, + 84, 147, 826, -399, -637, 1132, 108, -480, + 230, 265, -423, 48, 11, 239, -599, -281, + 10, 541, -397, 142, -4322, 1172, -257, -101, + 292, -321, -401, 60, -309, 468, 267, 611, + 438, -638, 2194, 346, 1421, -1192, -3109, -170, + -3336, -49, -69, -75, 184, 3094, 591, 82, + -373, 140, -22, 848, 124, 589, 157, -4, + 260, -177, 147, 73, -284, 6253, 111, 302, + -74, 356, 381, -547, -16, -275, -500, 93, + 344, -346, -2837, 364, -43, -592, 1741, -702, + -2247, 848, -203, 168, 758, -849, -2454, 562, + 1104, -169, 463, -398, -2759, -299, -903, 647, + -62, -124, 301, 337, -201, 463, -86, -139, + -2189, -2424, -942, -376, -2043, -80, -1791, -1580, + 513, 29, -1115, -582, 1214, -642, 355, 240, + 285, 1759, 1209, 862, 1707, 3353, -223, 245, + -515, -928, 794, -190, -282, 1097, -32, 1675, + 857, -730, -15, 102, 356, -309, 3867, 24, + 93, 899, -608, -497, -215, -2244, 735, -194, + 102, -51, -1939, 846, 74, -116, 7, 1981, + 512, 233, 574, -2508, 83, 1966, -251, -96, + 532, 97, 897, -1120, 390, -3192, -652, 2045, + 193, -880, -398, -148, 548, -281, -19, -987, + 467, -326, 2777, 195, 1560, 1034, -828, 102, + -1531, 1292, -126, 539, -247, 36, 55, -2487, + -297, -362, 482, -2241, -1021, -1535, -244, 38, + -3416, 141, 3408, 35, -67, 95, 333, -427, + -235, -128, 304, -548, 337, -349, -330, 23, + -450, 1657, 327, -3087, 695, -273, -1090, 1262, + -111, -868, 1516, 269, 119, 192, 14, 200, + 141, -395, 7145, 48, 334, 143, -139, 154, + -102, -312, -2, 283, 238, -30, 626, 1328, + 242, -416, 442, -3050, 1388, -100, 1215, 817, +}; + +static const int16_t cb2224sm1[] = { + 8192, -13, 346, -52, 5, 131, -294, -167, + -65, -347, -438, -559, 57, -86, -223, -224, + -251, 629, -58, 5249, 127, -464, 644, 210, + -154, -480, 165, 211, 13, 318, 152, -173, + 5451, 235, 170, -100, -6, -460, -249, 390, + 54, 993, -1637, -288, -978, -197, 234, -2877, + -570, -151, -82, 772, 199, -385, -1899, 345, + -25, 527, -477, -2918, 385, 2784, 78, -524, + -759, 795, 433, 511, 856, -275, 511, 136, + -444, 151, 233, 208, -589, -375, 282, 2886, + 30, -2749, -930, 1079, 86, -2285, 980, -229, + -1369, 93, -80, 2314, -170, 1224, 397, 405, + 463, 1014, -377, -90, -269, -82, -376, -773, + 684, -94, -2893, -323, -644, -849, -1892, -2244, + 417, 2165, -164, 221, 454, -2337, 142, 99, + 418, 486, -49, 97, 138, 2221, -2301, -156, + -578, 3963, 196, 140, -374, 180, 451, 354, + -952, 946, -479, -874, -159, 145, 290, 240, + -240, -233, -418, 226, 2878, -571, -2491, 741, + -1438, 557, 197, -370, -4720, 379, 32, 821, + 39, -545, -141, -1507, 192, -1150, 905, -1095, + -5028, -169, 533, -23, 371, 162, -1198, 465, + -369, -14, -861, -656, -701, -296, 31, 450, + -387, 3060, -696, 597, 14, -1019, -2741, -208, + -1186, -338, 712, -64, -344, 41, 327, 9, + 576, -349, -2808, 2428, 433, -566, 908, -108, + -145, -1011, 201, -3042, -327, 210, -368, 230, + -310, -400, 12, -1034, 1734, 992, 1842, 1022, + 2162, 588, 366, 154, -3078, -587, 1096, 215, + -1072, -784, 472, -1089, 94, 487, 18, 72, + 34, -15, -374, -607, 316, 830, -146, 4377, + -301, 390, 838, 121, -110, -143, -93, 2988, + 2914, -352, -353, -744, -115, 99, 495, -343, + 309, 1261, -519, 101, -2662, -44, -3139, -491, + 1142, -323, -50, 776, 86, 187, 480, 271, + -167, 1, -267, -99, 991, 2492, -152, 2423, + -225, 34, 576, -1486, -236, -375, 160, -176, + -145, 2525, -131, 194, 317, 1215, 1553, 295, + -1408, 130, 2279, -1185, 2671, -137, -324, -23, + 26, -779, -431, -4, 488, -186, 174, -119, + 3062, -149, -168, 191, 169, 1124, 301, 1471, + -409, -999, -166, 2174, -1405, 992, -179, -2606, + -71, -3151, 92, -976, 3091, -322, 310, -374, + -779, 599, -55, 425, -697, 63, 27, -38, + 86, 170, -11, -616, -97, 525, 78, 14, + 684, -5556, -308, -444, 266, -396, -1665, 86, + -722, -1087, -921, -525, 3, -439, -1600, -37, + 2038, -2672, -187, 361, -8192, 425, 365, 54, + 343, -703, 253, 284, -57, -327, -154, 392, + 99, -181, 213, 395, -2412, -303, 182, 82, + 2311, 45, 1801, -209, -988, 42, -1430, 38, + -721, 118, -163, 1279, 2184, -18, 2851, 274, + -363, 297, 150, -220, 3653, 3135, -381, 335, + 254, 378, -52, 52, 328, -383, -61, -802, + -409, -49, 49, -8192, 362, -48, -430, -54, + 255, 243, -525, 14, 152, 10, -392, -301, + -594, -539, 1200, 626, -2979, 233, -1504, 664, + -728, -1293, -491, 394, 1317, 298, 169, 214, + -429, -1083, 42, 389, 4751, 510, 299, -542, + 456, -852, 30, 208, -63, -131, 72, -425, + 73, 213, -287, -277, 43, 128, 5528, 165, + -316, -135, -576, -583, 217, -1298, 47, 134, + 103, -1894, 148, 3406, 880, 964, -697, -94, + -1626, 223, 1256, -514, 2079, -529, 1917, -1452, + -616, -605, 385, -963, 395, 105, -154, -1627, + -214, 40, 969, -708, -1492, -824, 2457, 275, + 404, 876, -781, -1029, 34, 72, 229, -137, + 264, -387, 305, -57, 2908, -143, -249, -2473, + 202, -1467, -364, 2094, -521, -70, 260, 132, + 465, 71, 982, -36, 1792, 306, 2907, -55, + 254, 421, 231, 140, 1727, 474, 761, 3153, + -18, -356, 414, 2218, 564, -247, -510, 67, + 2390, 2531, 240, 117, -487, -310, 261, 222, + -286, -861, -2180, 480, -75, 4769, -407, 248, + 227, -224, 302, 901, -1200, -728, 1025, 734, + -336, 115, -1726, -179, 131, 43, -357, 364, + -681, 283, -189, 715, -2793, -692, 1367, 916, + 28, -500, 3094, -543, -627, -709, -506, -1094, + 34, -2464, 434, 257, 357, 10, -390, 3206, + 3483, 137, 147, 180, 231, -260, -707, -818, + 476, -528, 656, 824, -8, 3073, 362, -3034, + -199, 47, 694, -252, 819, -147, -479, -32, + 530, -141, -91, 251, -154, 376, -603, 2305, + -2853, -622, 316, -680, 402, -819, 323, 471, + -47, 1772, 1507, -1052, -685, 18, -2509, -418, + 377, -31, -412, 105, -906, -267, -2806, -189, + -97, 198, -802, -82, -658, -2980, 795, -447, + 646, 1037, 486, -689, -2654, 55, -3534, 540, + -68, 502, -90, 277, -87, -497, 24, -246, + 400, 392, 348, 76, -345, -231, -71, 155, + -7, -226, 6553, 371, 261, -290, 88, -44, + 311, 470, -5, 182, -105, 56, -324, 267, + 241, 327, 966, 218, -4695, -968, 27, -352, + -315, 202, -204, 435, 360, -539, -375, -527, + -1157, 1010, -241, 4171, -292, 66, 2343, 310, + -682, 595, 3040, 539, -118, -573, -128, 952, + -172, -547, -285, -1, 345, -5701, 345, -153, + 77, 349, -225, -364, -655, -270, -716, -825, + 27, 55, 2179, -154, -275, 359, -501, -992, + -665, 1538, -218, -1159, 2176, -845, -3018, 105, + -459, -3146, 67, -197, -293, 539, 115, -74, + 119, -158, -89, 1449, -3006, 104, 651, 886, + -310, -242, 1219, 1805, 176, 2235, 579, 294, + 634, 1345, -1, -454, 755, -1030, 1760, -2404, + -406, 894, 614, -74, 113, -1325, 1843, -392, + -3239, 2440, -54, 222, 1349, -695, -1009, 434, + -468, -509, -280, 462, 228, 573, 213, 55, + 325, 557, 100, -721, -674, 600, 795, 1567, + 407, 3273, -58, -1330, 349, -181, 417, -503, + 911, 350, -681, -4502, -127, -26, 330, 618, + 241, -147, 284, -226, -127, -2692, 484, -146, + -18, -416, 755, 85, -3119, -404, 0, -478, +}; + +static const int16_t cb4432l0[] = { + -3764, -227, 184, -258, -1713, 122, 410, -32, + -244, -1337, -328, -20, -236, -359, -13, -52, + -75, -260, 426, -96, -37, -38, 117, -938, + 487, 60, 286, 571, 368, -551, 198, -102, + 15, -11, 4535, -127, -241, 114, -77, -316, + 302, 195, -149, -73, 357, -128, -23, 34, + 319, -97, 189, 5918, -20, -134, -47, -249, + 7, 3, 116, 7, 48, 47, 92, 19, + 14, 31, -388, -329, -1878, -944, 958, 632, + 1973, 182, -130, -193, 2309, -868, 63, 260, + -12, -89, -88, -208, 127, -168, 237, 74, + 1153, 925, 2292, 2992, -35, 204, 766, -930, + -87, 341, -101, 501, 35, -182, 112, 91, + -28, 79, 193, -73, -71, 52, 82, -427, + -147, -69, 4722, 468, -187, 98, -295, 292, + -991, 43, 98, 225, -555, -595, -66, -181, + 91, -152, -3, 89, -219, 356, -375, -114, + -1546, -620, 648, 1946, 39, -608, -942, 103, + 179, 170, -2350, 157, 1132, -944, -283, 64, + -393, 15, -90, 761, -185, 644, -360, 5, + -5212, 106, -136, -40, -159, -40, -120, -43, + -8, -195, 208, -179, -295, -63, 19, 32, + -104, -23, 132, 660, -460, 237, 523, -676, + -378, -81, -184, 2718, 64, 531, 2119, -1564, + 614, 933, 6, 65, -50, 55, 243, -539, + 1168, 953, -283, 45, 476, -346, 2285, 1892, + 615, -521, 23, -2079, 57, -11, 208, 1029, + 371, 28, 170, -63, -167, 184, -217, 76, + -320, -2747, 542, -2098, -407, -10, -876, -1477, + -306, 565, 57, -49, -111, 185, -250, 120, + -186, 214, -520, 463, 792, -2420, 2760, -383, + -783, -1097, -441, -535, 1070, 78, 96, 122, + -193, 516, 114, 100, -413, 100, -23, -153, + 1267, -4210, -742, 228, 659, 399, -169, 412, + -81, 1056, 4, -254, 173, 109, -218, 196, + 64, 26, -113, -60, -8, 15, 5497, -76, + 169, -294, -394, 596, 379, 12, -64, -203, + -138, 41, -249, -53, -44, -19, 55, -34, + 99, 36, -70, 8, 46, 2787, 842, 1917, + -693, -424, 151, 464, -1162, 1027, 148, -1027, + -173, 328, 23, 792, -184, 395, -684, 229, + -139, -7, 2788, 404, 43, -1508, -590, 6, + -184, 904, 475, -37, 276, -361, 1924, -188, + -113, -1334, -176, 11, -34, -70, -68, 95, + -433, 225, 437, -451, 471, -272, -385, 2793, + -2685, 544, 881, 409, -789, 700, -5, -144, + 66, -17, 504, -397, 264, 74, -81, -1803, + 444, -573, 633, -391, -3339, 192, 484, 1126, + -306, 153, 303, 61, -253, -255, -57, -277, + -88, -100, 32, 79, -1320, -857, 3080, 1178, + 323, 353, -149, 1316, -399, 236, -129, 231, + 323, 696, 59, 1217, -567, -268, 642, 384, + -327, -47, 466, 1530, 1092, -1176, 612, 257, + -143, -270, 487, -62, 332, 1089, 961, -706, + 938, 78, 97, -2805, -1088, -871, -273, 87, + -345, 148, 113, 167, 97, 31, 68, -47, + -53, 53, 29, -5723, -53, -12, 241, 92, + 131, 139, 48, 102, -26, -47, 664, -580, + -7, 1287, 2531, 1061, -710, 24, 1389, -1742, + 254, -1147, 539, -150, -24, 495, -204, -171, + 955, 202, -111, 147, -1458, -3973, 421, -416, + -544, 392, 1419, -178, -168, -53, 50, -537, + -7, -346, -289, -52, -38, -259, -115, -136, + -138, -89, -205, -661, -4429, -110, 380, -721, + -180, 127, -1371, -78, 276, 319, 229, -934, + 267, -353, 44, 65, 449, -32, 159, -11, + -22, -571, 100, -676, 2892, -2740, 907, 511, + 248, 441, -62, -517, -347, -235, 319, -8, + -140, 309, 258, -106, 215, 1, -3252, 426, + 455, -2213, 1031, 430, 746, 367, 602, 187, + -147, -200, 97, 555, -107, -249, -71, 101, + 59, -94, -64, -33, 221, 184, -791, 671, + -191, 284, -1311, 402, -29, 250, -190, -503, + 38, 106, 586, 4767, 526, 147, -182, 249, + 146, 17, 293, -1095, 1079, -161, 141, -2, + 681, -275, -171, -4504, 61, -105, -306, -66, + 229, 20, -102, -93, 334, -189, 5, -6, + 417, 2551, -63, -852, 1608, 1820, 670, 1592, + 102, 203, 147, -767, -147, 310, -718, 175, + 551, -98, -202, 309, 70, 81, -55, 1518, + 222, 338, -356, 349, 97, 86, 495, -233, + -121, 2936, 200, 935, -381, 2474, 53, 494, + 248, -139, -45, 100, -1287, -181, -370, 311, + 287, 3016, -96, -128, 2146, 567, -383, -551, + -96, 144, 495, 428, -32, 137, 27, -272, + -149, 9, -61, 177, -5236, 91, -837, 611, + -279, -74, 652, 14, -178, -82, -89, 347, + -245, 647, -62, 49, -215, 29, -55, -27, + 178, 79, -19, -59, 177, -152, 0, 189, + -10, 128, -115, 33, 61, -106, 56, -13, + 135, 116, -5772, 157, 43, 26, -11, 102, + -4, -52, 208, -186, 198, 99, 81, -29, + -103, 193, -35, -84, -4, -111, -5251, 84, + 71, -85, -77, 55, 234, 38, 0, -35, + 60, 5875, 98, 36, -219, -17, -419, -136, + 47, 34, 55, -21, -17, -1, 72, 94, + 52, -3, -703, -1437, -518, 557, 121, 356, + -345, -717, -438, -279, 13, 70, -95, -2, + -4170, 40, 136, 17, -153, 8, -149, -27, + -559, 268, -237, -82, -220, -921, -588, -150, + 3481, -1906, 647, 675, -455, 598, -386, -52, + -7, 222, -201, 90, 54, 75, -283, 118, + -375, 5768, 20, -126, -141, -99, 64, 116, + 16, -58, 0, -31, -15, 250, -104, -30, + -144, 115, 12, 117, -482, -1709, -436, 122, + -246, -7, 271, 1961, 154, 149, -86, 147, + 258, 531, 1760, 914, -1196, -1800, 812, -621, + 125, -161, 1361, 50, -651, -1307, 360, -785, + 205, -156, 294, 21, -3484, -18, -79, -266, + 770, 307, 29, -765, -250, 183, 55, 131, + 1452, 260, 224, 221, -347, 360, -352, -2188, + -664, -503, 313, 406, -251, 3268, 210, -46, + 129, -276, 343, -143, 104, -55, 461, 17, + -576, -287, -289, 33, -2500, -85, -428, -1137, + 918, -245, -490, -260, -270, -133, -591, 199, + -294, 2784, 102, 19, -109, -745, 91, -524, + -44, 28, 252, -511, -80, -146, 271, 519, + -216, -2280, -411, 3699, -368, -538, 427, -158, + 114, -50, -589, -340, -180, 703, -186, 487, + -649, 668, -916, -436, -3684, -1016, 877, -65, + -153, -62, -148, -17, -106, 142, -73, -1, + -68, 567, -658, 815, 2270, -563, -519, -226, + -223, -282, 584, 240, -1522, -1935, 1169, 880, + 127, -1276, -127, 399, 63, 25, -1297, 2131, + 592, 1652, 2609, 69, -581, -179, 947, 597, + 150, 35, 0, -255, -232, -728, 239, 91, + 130, -234, 231, 56, -2181, 1774, -2196, 1633, + -1065, -662, 777, -175, -128, 267, -7, 51, + 27, -133, 95, -500, 188, -167, 94, -176, + -29, -65, -161, -141, -694, -968, 594, -269, + -422, -472, -731, 1210, -816, 2142, -1321, -1746, + -149, -983, 1310, -839, 762, 284, 99, -31, + -1169, -84, -1119, -55, -720, -944, -1115, -271, + -1032, 1064, 187, -1013, 2987, 26, -209, 516, + -8, 107, -24, 188, 278, -53, 624, 460, + -275, -1881, -2001, 851, -1740, -407, 1643, -352, + -17, -528, -538, -175, 179, 416, -297, 54, + 132, -491, -76, 34, -440, 175, 2065, -2006, + -164, 38, -403, 902, -129, 215, 1545, -414, + -1183, -532, 578, 248, -308, 189, -563, -345, + -949, -279, 1693, -959, 101, 783, 9, 1641, + 1494, 167, -294, -538, 951, 115, 590, 105, + -847, -1003, 464, -368, -1268, 641, 254, 243, + 488, 2636, -1209, -272, 437, 445, 781, -463, + -415, 538, -811, 588, 1083, 206, -547, 171, + -585, -744, 343, -604, 395, -76, 910, -523, + -108, -449, 625, -325, -1079, 273, -1473, -1096, + -137, -565, 2077, -623, 214, -342, -273, 769, + 1137, -879, -731, 56, -1098, 211, 822, 579, + -839, 164, -600, -80, 61, 316, 644, 1445, + 891, -1796, -1798, -162, -1631, -492, -626, 593, + 544, 66, 63, -857, -1273, 406, 1665, 899, + -467, 87, -117, -469, 126, 30, -931, 1446, + -190, 388, -1608, -316, -2199, -127, 484, -51, + 56, -524, 1524, -103, 1231, -740, 717, -861, + 823, -665, -1790, 411, -690, 303, -1615, 63, + -232, 19, 1090, -96, 137, 80, -1027, 581, + -61, 672, 133, 444, -767, 766, -42, -3174, + -270, -23, -126, -1111, 67, -1367, 4, 315, + -53, -90, -165, 48, -1657, -117, 392, 356, + 792, -610, -618, -219, 446, 102, 374, 207, + 1026, 2480, -461, -782, 1161, -1351, 1032, 486, + -308, 290, -272, 899, 1912, 36, -624, 286, + -428, -623, -665, 12, -621, -1985, -34, 468, + 318, -467, 127, -972, -39, -663, 2307, -26, + 406, -468, -657, -1404, -342, 2356, -395, -1422, + -1243, 465, 90, -665, -280, -290, -21, -1752, + 280, 271, 395, 240, -402, 55, 1077, 148, + -309, 1818, 483, -1293, 43, 261, 566, -131, + 947, -815, -872, -1021, -1001, -395, 263, -555, + 78, -2193, -360, -76, -1029, -493, -464, 1339, + -53, 750, -671, -1349, 133, -70, 114, 501, + 766, -816, 703, -992, -122, -520, -1323, -2539, + -365, -35, -555, -888, 1515, -191, 1322, 1633, + -674, 451, -1246, 270, -868, 703, -394, 106, + -779, 754, 650, 1066, -417, -1305, 149, -165, +}; + +static const int16_t cb4432l1[] = { + -3867, -448, 2202, 129, -100, 393, 37, -267, + -156, 23, -274, 222, 33, -191, 104, -140, + -50, -28, -148, -181, -22, 6, 489, 993, + -2764, 1191, -773, 781, -460, 843, -77, -1417, + 390, 124, -203, 205, 662, -16, 569, -963, + 609, -155, 64, -293, 2649, -2533, 70, -472, + -482, -1732, 235, -5, -485, 116, -177, -104, + 314, -355, 118, 25, 921, 285, 130, -94, + 77, 121, 1068, -435, 1407, 447, -427, -1096, + -757, 258, 19, 3236, 702, 362, -928, -348, + -150, -784, -687, -388, -176, -38, 16, -14, + 1017, 879, 935, 1280, 1014, -85, -256, -103, + -3384, -928, -200, -406, -175, 304, -54, 195, + -78, 676, -356, -167, -165, -56, -3133, 156, + -171, -684, -698, -135, 230, -30, 32, 542, + 1959, -124, -76, 162, 182, -174, 1011, -97, + 678, 10, 188, 30, 1086, -262, -157, 250, + 241, 233, -584, 3276, 2126, -50, -207, 637, + -440, 331, -434, 251, -267, 269, -392, 68, + -244, 8, 928, 827, -1096, -309, -356, -375, + -3204, 422, 695, 2, 240, 595, 641, 582, + 342, 42, 7, 539, -64, -116, 82, 16, + 26, -136, -122, -114, -5814, 22, -272, 10, + 113, 186, -422, -95, 309, 308, -118, -208, + 52, -175, 12, -106, -6, 20, 58, 6053, + -101, -20, 10, 70, 189, 57, -11, 210, + 83, 239, -6, -79, -233, -59, 31, -30, + -62, 64, -38, 25, -78, -202, -215, -115, + 1477, 255, 101, -2575, 186, 3140, -46, -45, + 53, -183, -89, -412, 183, -222, 50, -237, + 96, 35, 1684, -521, -169, -436, -295, 1390, + 261, 27, 163, 352, 68, -3677, 12, 310, + -599, 331, 138, -333, -269, -130, -44, -14, + 265, -626, 258, -59, 31, -17, 222, -10, + -364, 280, -183, -235, -217, 73, -67, 114, + 196, -5132, 269, 159, -6, -36, -248, 274, + -328, 2712, -393, 2763, 507, -110, -166, -84, + -72, -1111, -19, 370, 25, 5, 156, -32, + 237, -57, -106, -22, 370, -229, 1099, 4297, + 152, 72, -56, 347, 64, -501, -57, 178, + 175, -14, -84, -626, 555, 155, 20, -75, + 20, -33, -254, -125, -9, 150, 91, -7, + -45, 239, -109, 72, -66, -172, -211, 6063, + -205, 171, -75, 50, -75, 22, 109, 21, + -58, 58, -105, -432, 310, 3782, -18, -1071, + 19, 20, 1455, 337, -257, -288, -52, 519, + 43, 80, -175, -218, 9, 176, -28, -418, + 200, -514, 351, 119, -5920, -96, -33, -289, + 74, 26, 120, -37, 113, 47, -145, -17, + 334, 46, 47, 19, 274, 172, 159, -404, + 3151, -408, -559, 987, -178, 253, -90, -498, + 1454, 1183, 392, 762, 220, -1207, -220, -69, + -85, 22, 1644, 1858, 725, 1084, 0, -257, + 290, 1712, -151, -188, -390, 638, -327, -2185, + -322, -1116, -150, 120, -140, 198, 162, -83, + 1321, 232, 242, -52, -456, 778, -288, 65, + 2431, 37, 85, -489, 862, 2776, 260, -72, + 792, 100, 17, -210, 588, 49, 600, 246, + -258, 128, -51, -492, -395, -489, 50, -5308, + -67, 314, 124, 46, -188, -64, -101, 51, + -535, 108, 56, -4, -191, -923, 485, 578, + 1320, 228, -535, 310, 227, 395, -1441, 2660, + 226, -392, 221, -686, 1749, -175, -904, -571, + -129, 154, 2622, 609, -247, -240, -893, 98, + 291, -2277, 411, 260, -160, 2061, -203, -437, + 359, 21, -101, 19, 49, 15, -98, 82, + 3, -555, 164, -152, -58, 38, 175, -439, + -37, 68, -21, -181, -5556, -27, 8, 48, + 21, -151, 381, 3, -152, -74, 202, -29, + 1863, 1713, -922, -1976, 551, -1522, 525, -116, + 146, -1730, -238, -72, -183, 126, 234, -240, + 82, 138, -60, -131, -2226, 226, -702, 183, + -81, 462, -2851, -1419, -1005, 124, -81, -252, + -65, 147, -58, -179, 306, 154, 122, -69, + 69, 11, 115, 296, 3340, -501, -2580, -804, + 9, 591, -86, 88, 127, 588, 183, 48, + 79, -38, -199, 63, -140, 29, 88, -28, + 259, 69, 1743, -531, 110, -18, 776, -18, + -177, 112, 36, -243, -208, 528, -47, 4709, + 107, -125, 140, -1, 22, 15, 416, -194, + -267, -49, 43, -3, -308, 214, -128, 140, + 5372, -123, 70, 275, 210, 182, -147, -131, + -84, 69, 116, 29, -401, -162, -236, -173, + 378, 45, -12, -77, -6209, -103, 126, 54, + -19, -20, 43, 64, 92, -8, -12, 118, + -123, 58, -3628, -414, -2147, 76, 95, -99, + 357, -10, 278, 4, -608, 504, 105, -72, + -109, -92, -55, 367, -167, 40, -34, 76, + 220, 3434, -366, 191, 248, 29, 187, -177, + 155, -348, -341, -2466, 272, -136, 510, 139, + 81, 184, 33, -299, 92, -44, -402, -583, + -725, -400, -159, 751, -225, 377, -160, 1556, + -2652, 685, -1077, 1276, 332, -257, -1449, -282, + -231, -145, 58, 173, 421, 271, 401, -186, + 79, -258, 127, 252, 214, 96, 157, 195, + 205, 118, -4771, -95, -164, 217, 477, -51, + -4, 8, 1450, -51, -52, 952, 675, 929, + -273, 475, 9, 282, -249, 236, 746, -1407, + -272, 1845, 692, -105, 2690, 168, 1, -1, + 157, -599, 305, 255, -2252, 45, -199, 119, + -3489, -161, 6, -263, -259, 338, -251, 61, + 153, -124, 432, -7, 131, 5, 305, -322, + -3283, -32, -336, -273, 2243, 863, -1, 681, + -365, -246, -152, 375, -133, -15, -208, -104, + 89, 128, -135, 44, -255, 549, -2751, -48, + 270, -2584, -549, -631, 445, 182, -198, 743, + -215, -60, -400, 1383, 167, -65, 250, 146, + 185, 22, -484, -161, 86, 1758, 964, 404, + -2574, 1026, 6, -516, -724, 315, -1891, 311, + 2, 339, -39, 324, 299, -497, -12, 179, + -1242, 364, -185, -197, -1474, 232, -490, 4042, + -105, 887, 31, 539, 235, 75, -112, -200, + -31, 74, -76, -16, -20, 38, -159, -143, + 114, -77, -110, 28, -18, -84, -27, -53, + -82, -224, 75, 0, -46, -64, 44, -112, + 84, -85, -6030, -24, 661, -474, -178, 8, + -1023, -396, 199, -19, -50, -93, 385, 209, + -1227, 2492, 2163, 986, -1359, 399, 848, 681, + -829, 211, 696, -599, -1398, 1951, -113, 374, + -17, -1113, -1708, 1294, 666, 1774, 623, 259, + 105, 961, -87, 43, -463, 65, 155, -26, + -31, -1477, -508, 1091, -1463, -524, -1853, 1354, + 434, 86, 893, -871, 151, -1887, 205, 423, + 857, -55, -11, -39, 341, 61, 1158, 2650, + 899, -2491, -593, -843, -1399, -15, -713, -171, + -195, -523, -46, 243, 117, 241, -8, 140, + -149, -191, 70, 134, -1158, 1933, 1135, -2284, + -1049, 1717, 378, -155, -37, 171, -692, -280, + 918, -786, -123, 558, 571, 39, -315, 62, + 27, 59, 708, -134, -200, -168, -134, 148, + -142, 25, 164, -282, 284, -95, -35, 376, + 165, 367, -335, 271, 249, -4520, 176, -36, + -216, -1303, 375, 92, 602, -889, -390, 284, + 78, -1318, 1259, 1865, 1498, 2063, -234, -840, + -391, 88, 168, -235, -74, 31, -239, 1221, + 71, -1637, 1513, 68, 2201, 1513, -1099, -622, + 426, 343, -330, -648, 381, -156, 27, -31, + -92, 133, 210, 103, -155, 2061, -366, -1173, + -31, -274, -713, -471, 509, 1044, 208, 403, + 486, -66, -521, -1883, -180, -537, 1283, -98, + -1464, -456, 508, -619, -546, 685, 944, -85, + 311, 1172, -194, 1406, -99, -827, 1506, 396, + 196, -1534, -1181, 1588, 1250, 47, 1034, -171, + -1247, -98, -120, 1181, -2195, -384, 945, 627, + 26, -248, 1372, -671, 214, -649, -17, -44, + -500, -559, 577, -601, 32, 421, 531, 344, + -1233, 145, 348, 614, -560, -244, -357, -202, + 814, -494, -2320, 308, -2277, -481, -518, -431, + -851, 43, -204, -26, -742, 1083, -130, 2002, + 1642, -1156, 1746, -529, 937, -544, 416, -741, + 763, -232, 509, 243, -458, 78, -130, 143, + -123, 71, -666, -105, 31, -1061, 441, -48, + 411, -1547, 155, -730, 439, 1624, 873, -611, + -470, 2348, -157, 1184, 678, -174, 542, -95, + -12, -405, 237, 322, -1194, 1903, 1496, 357, + -34, -661, -1024, 2236, 860, -256, 617, 756, + -485, -273, -589, 536, 214, -286, 782, 418, + 346, -462, 443, 1056, -914, -304, -564, -332, + 1823, 2079, 93, -975, -891, -1089, -720, -1127, + 702, 300, 787, 374, -78, 1070, 691, 1339, + -797, 57, 482, 432, 748, 1538, 673, 1885, + -504, 1913, -190, -135, 881, -139, 84, 379, + -176, -129, -331, -34, -690, 282, -563, 51, + 71, -714, -103, 1074, -651, -582, 1388, -320, + -1115, 1547, -1088, -65, -2634, -201, -653, 116, + -238, -218, 476, 1417, 1671, 1135, -1025, 614, + -662, 127, 863, -117, 726, -971, 1382, -286, + 465, 1195, -715, 862, -1256, 105, 37, -1190, + -442, -1777, 50, 162, 1577, 580, 762, 253, + 92, -308, -1238, -161, 295, -150, 1733, 1831, + -527, -527, -28, 70, -359, -1590, 860, -221, + 47, -1201, -254, 39, 780, -326, 1097, -1019, + 834, 362, 357, 41, 693, -1099, -2687, 614, + 270, -128, -322, -1149, 631, -46, -343, 1495, + -896, -864, 1545, 200, -922, -1133, -637, -1231, + 484, -796, -743, -371, 999, 1300, 173, -19, +}; + +static const int16_t cb4432s0[] = { + -2558, 2751, -440, 1200, 1067, -725, -492, 588, + 234, -209, -108, -230, 223, -231, -235, -132, + -51, 88, -290, -214, -99, -60, 175, 2546, + -991, 907, 446, 635, 284, 707, 238, 220, + -308, 259, 8, -435, -2207, -1487, -1579, 46, + 285, -249, 154, -370, 37, 42, 1524, -1853, + 1393, 1204, 126, 1751, 82, 136, 363, -2411, + -782, -128, -818, -232, 765, -173, -127, 732, + 260, -101, 868, -249, 290, 32, 645, 55, + -1742, -1077, 392, -568, 629, -920, -243, 791, + -604, -363, 117, -1360, -15, -245, -3655, 54, + -297, 10, 124, 11, -1114, -567, 3882, -2042, + -1120, -42, -114, -914, 419, 307, 44, 277, + -101, 429, 170, 187, -528, -705, 348, -19, + 180, -76, 91, -1861, -181, -171, 804, -730, + 222, -184, 349, 191, -125, 14, 4270, -467, + -272, 29, -216, 212, 426, -222, 11, -16, + -852, 101, 576, 178, 351, 647, 90, 179, + -681, -187, 77, 4115, -976, -726, 711, 763, + 572, -1166, -46, -445, -103, 135, 294, 300, + 10, 737, 386, -399, -349, -52, 5393, -107, + -32, -229, -154, -181, 82, -68, -13, -77, + 48, 75, 117, -50, 254, 233, 98, 75, + -2218, -2214, 1491, 832, 225, -1057, 267, 539, + 1963, -245, -353, 454, -430, -54, -747, -58, + -438, -90, -64, 277, 214, -105, -47, -1301, + -404, -1179, 682, -4093, 764, -270, -342, -367, + -1378, 6, -83, 429, 398, 61, -149, 180, + 31, 169, -218, 152, -71, -38, 2605, 679, + -175, -533, 1787, 611, 484, -322, 158, -561, + 125, -35, -42, -190, 529, 449, 157, -3105, + 106, 168, -8, -66, -80, 1463, 1136, 4793, + -98, -432, 538, -145, 241, -158, 105, -372, + 39, -160, 92, -223, 81, 245, -142, -162, + -167, -297, -49, -98, 582, -5178, 1130, -271, + 567, -251, 55, 487, -303, 31, -25, 87, + -70, 154, -23, -221, 70, 208, 48, -137, + 46, 59, -9, -1397, -970, 224, 714, 161, + 24, -307, 1295, 1467, -155, -505, -521, -244, + 503, -25, -989, 3664, -148, 12, -135, 218, + -159, -156, -769, -421, 553, 715, 697, -181, + 1426, 425, -39, -103, -4558, 171, 347, 161, + 170, 128, -210, -35, 31, 125, -264, -135, + -100, 2685, -230, 2062, 1618, -99, -874, 926, + 757, 380, 404, -73, 30, 29, 462, 725, + -389, -246, 20, 150, -234, -58, -183, 10, + 156, 482, -232, 124, 115, 180, -615, -395, + 330, -85, -435, 3279, 1493, 686, 1157, 245, + -1067, -1953, 23, 796, -540, 175, 56, -1931, + 89, 705, -342, 551, -1999, 1951, -2305, -497, + -266, 275, -1503, 351, -355, -353, 236, -358, + -271, -40, 136, 217, -13, -45, -2091, 1141, + 730, -1888, 1131, 660, 1271, 439, 2597, 92, + 319, -91, 62, 316, 287, -260, 121, -33, + -117, -22, -79, -170, -164, 1486, 134, -62, + -36, -3367, -235, 1221, 1239, 78, -54, -489, + 268, -560, -774, 851, -973, -62, -174, -138, + -459, 390, -22, -42, 83, 1339, 1307, 462, + -3768, 511, 300, -525, -787, -89, 675, -2074, + 37, -48, 252, 598, -332, 67, -187, 2, + -106, -35, -148, -186, -542, 799, 2363, -155, + -665, -2867, -209, -200, -80, 1682, 1082, 2, + 516, -481, 276, -1, -220, 54, -12, 259, + 161, -148, 566, -1489, -731, 1262, 499, -816, + 115, 4057, -71, 701, 39, -132, -223, -16, + 229, -2, -40, -61, 234, 405, 108, 304, + -62, -396, 1369, -1438, -2045, 1954, 759, 969, + -166, -235, -115, -68, 1923, 1815, -776, -855, + 34, -63, 17, 87, 223, -145, -130, -16, + -313, -1704, -458, -332, 420, 1332, 676, 878, + -3847, -360, 427, 537, 651, -167, -451, -197, + 277, 136, -201, 517, 10, -156, 35, -927, + 1250, -173, 1004, -169, 322, -140, -559, -4656, + -343, -264, -61, -12, 195, -10, -123, -23, + -20, -6, -367, -102, -215, 41, 838, 1513, + 552, -1609, -753, -763, -656, -633, 14, 35, + 141, 117, -121, 857, -1494, 578, 2546, 1034, + -676, 571, 817, -218, -111, 1424, -51, 878, + -2860, -257, 104, -526, 782, 708, 2350, -500, + -342, 219, -406, 836, -117, 288, -415, 798, + 14, -311, -455, 3, -410, -144, -30, -977, + -145, -2466, -957, 1370, -3201, -327, -85, 149, + -580, 198, 350, 140, -104, 327, -128, -178, + 58, 294, 50, 1814, 581, -909, 287, -267, + -3992, 61, -860, 258, -271, -223, 237, -291, + -3, 66, 110, -620, 319, -62, 177, 364, + 110, -163, -921, -863, 251, 4922, 280, 121, + 128, 209, -126, 578, -56, 41, 124, 350, + 245, -465, -67, 5, 651, 147, 200, 0, + 21, -609, -332, -3, 247, -412, 128, 42, + -1405, -301, -341, -484, -491, -55, 361, -100, + -30, -405, 643, 4249, -31, -91, -10, 6, + 425, -350, -1501, 817, -1348, -201, -345, -3643, + 235, 691, 332, 219, 199, -398, 130, -50, + -190, 89, -23, 100, 1327, -200, 146, 482, + -624, -479, -391, 188, 129, 614, -335, -564, + 1021, -107, -199, 145, 201, 571, 1276, 4253, + 58, 121, 295, 38, 26, 47, -1333, 1138, + 3125, 357, -72, 347, 276, -272, 120, -77, + 535, 247, -71, -2054, -1860, -73, -62, 266, + -30, 183, 17, -46, -7, -140, 997, 526, + -47, -59, 1540, 373, 162, -150, -107, -74, + -278, -37, 4268, -21, -269, 359, 111, -115, + -5, -206, -87, -44, -517, 54, -2859, 189, + -297, -863, -918, -929, -543, 25, -2866, -79, + -1101, -275, -410, -458, -75, -211, -420, 96, + 467, -66, -15, -580, -420, -586, -7, 109, + 236, 227, -488, 106, 258, 76, 78, -8, + -199, -4888, -134, -205, -33, -243, -19, -10, + 157, 129, 120, -928, 604, -345, -47, -430, + -257, 273, 81, 1949, 490, 272, -205, 2460, + -54, 103, -2924, -529, -211, -60, 279, 220, + -57, 342, 209, 984, -1410, -3363, -1028, -1301, + -1293, 227, 1142, -1068, -512, 758, 364, 46, + -358, 16, 257, -158, -253, -182, -2, 181, + 1475, 1574, 215, -968, 246, 369, -273, -717, + 546, 74, -3872, 293, 98, 130, -244, 41, + 143, 699, -56, -126, 67, 54, -2, -878, + 2334, 883, 215, -1979, 246, -759, 499, 248, + 751, -202, 580, -3018, 359, -139, 210, -47, + -168, 89, -659, 259, -54, -40, -490, -169, + -769, 569, -171, 64, -845, 519, 1251, -71, + -459, -4436, 257, -334, -826, -183, 115, -408, + -77, 544, 173, -258, 48, 331, 1735, 1035, + 2793, 1154, -1901, 275, -109, -1185, -403, 1332, + -282, 36, -367, 21, 27, 362, -425, 217, + 150, -304, 192, 53, -1100, 27, 628, 698, + -634, -25, 84, 8, -103, 533, -301, 218, + 4350, 119, -109, 309, 24, -352, -147, -274, + 156, 85, 9, 1706, -854, 2012, -1573, 112, + -673, -1538, -91, 415, -1525, 866, 1493, -621, + -396, 277, -604, -363, 114, -360, -252, -18, + -31, -77, -591, 2483, 535, -1520, -1057, -2189, + -51, 798, 276, -1426, 72, -303, 402, 111, + 327, 272, -8, -216, 189, 1282, 152, -45, + -33, 1524, 2301, -341, 1992, 939, 1678, 1011, + 114, 167, 586, -500, 40, -473, -274, 596, + 1237, -126, 205, 254, -284, -367, -119, 64, + 1915, 437, -585, 1, 402, -271, -984, 530, + 267, 3634, 495, -219, -728, -67, -1340, 983, + 122, 6, 110, -166, 111, 102, -139, -2499, + 753, 1011, 1755, -1252, 872, -510, -1844, 1388, + -782, 287, 461, 36, 77, 437, -361, -216, + -415, 158, -77, -123, 57, -93, 3408, 504, + -942, 434, -648, -251, -420, -387, 1373, -229, + 236, -191, 3, 204, 612, 393, -285, 560, + -164, -199, 303, 146, 93, 1248, 2425, 1001, + 1261, -239, 1085, -1878, -375, -544, -995, -192, + -319, 542, 280, -716, -1323, -67, -34, 252, + -36, 206, -126, -28, 26, -1135, 2799, 527, + -47, -2008, 509, -232, -953, 332, -386, -108, + 290, 507, 578, -809, 375, 850, -1413, 831, + -137, 259, 25, -1075, 407, 1784, -1539, 1658, + 1450, -969, 467, 4, 785, -595, 912, 34, + 91, 286, 1035, -524, 276, -322, 11, 651, + 733, 243, 45, -145, 357, 524, -697, -259, + -757, -1057, 181, 1324, 148, -502, -64, -379, + -746, 1385, 395, 184, -749, -197, -3375, -546, + -4, 532, -270, 687, 501, 285, 401, 431, + -1888, -639, 655, -325, 1896, -1883, 53, -1018, + -1475, 802, -486, -68, 232, 1337, 428, 232, + 1754, -1687, -518, -372, 508, -1269, 327, -900, + -468, 1127, 1397, 1597, 837, 659, -617, 99, + 264, -460, 296, 44, -295, -209, -174, 1105, + 896, 1065, -174, 5, 845, 1311, 1370, -2548, + 351, -660, -24, -1089, -787, -1312, -22, -585, + -197, 749, 293, -112, -169, -23, 3, 1151, + 529, 1173, 224, -1517, 930, -52, 268, -1282, + -559, 466, -528, 1506, -231, -337, 993, -1314, + -250, -3042, 57, 19, 15, 1812, 697, -389, + -201, 647, -723, -1098, -177, -225, -2694, -495, + -431, -238, 388, -1731, 997, 227, -765, -222, + 94, -611, 35, 187, -935, -1470, 1013, 1051, + -378, 311, -710, -566, -532, -369, -1599, 553, + 167, 450, -1068, 2834, -125, 601, -113, -503, + 40, 14, -36, -220, -1543, 867, -612, -1834, + 888, -1791, 1296, -229, -593, -760, -197, 428, + -1290, 892, -62, 1113, -1228, -965, -90, -300, + 288, -133, 779, -1211, -627, 268, 180, 913, + 2230, -413, -146, -217, 170, -1157, -1551, 877, + 75, 1784, -174, -230, -757, 1243, 625, -49, + 114, -218, -409, 195, -1165, 1492, 213, 1100, + -101, -957, 1016, 663, -704, 817, 94, -279, + -256, 469, -75, -123, -2954, 948, -407, 275, +}; + +static const int16_t cb4432s1[] = { + 5416, -223, -123, 156, -33, 185, -144, -108, + -199, -68, -36, 11, 37, 124, -301, 58, + -21, 155, 99, -10, -78, -26, -70, -3160, + -1037, 98, 155, -373, 834, 652, -277, -429, + -529, -103, -358, 187, 1161, -157, 147, -400, + 461, 156, 237, 481, -67, 99, 939, 1179, + -659, 1337, 578, -489, -481, -427, -622, 131, + 1826, -734, -995, -5, -461, 514, -83, -271, + -2928, -86, -382, -205, -133, -386, -195, -67, + 508, 586, 607, -910, -181, -2046, 1212, -179, + 23, 408, -1929, 2044, 2160, -879, 74, 179, + 72, -164, 47, 162, 1497, 826, 2978, -912, + 454, -618, -1907, -501, -494, -299, 96, -138, + -114, -51, -171, 445, 1144, -187, 217, 224, + 402, 13, 42, -58, -1692, 4162, 1272, 970, + -278, 327, 88, -31, -182, 279, -610, 78, + -432, -147, -142, -725, -17, -95, 388, 133, + -61, 28, -1365, 1441, 606, 411, 923, -332, + 1843, 1934, -1451, -514, -283, 768, 940, -428, + 31, 1105, 248, -78, -1477, -367, 404, 68, + -178, 17, 691, -265, -105, 1681, -476, -1307, + -3434, -1700, -524, -871, 472, -171, 237, 104, + -142, -231, -292, -285, 266, -259, -166, -97, + -432, 4003, 1220, -356, 2110, -220, -465, -48, + 117, -178, 290, -21, 205, -19, 321, -343, + -328, -57, 215, -345, 304, 2, 10, -2071, + 185, 433, 212, -1165, 112, 242, -294, -162, + 1107, 1176, -396, 1400, -2600, -434, -640, 457, + 100, -268, 809, 128, -236, -66, -94, -842, + 82, 163, 227, -2641, -485, 291, -326, 42, + 234, -648, 1355, 3016, -1403, -71, 188, 792, + 15, -16, -522, -75, 106, -824, 1133, 947, + 477, -642, -531, -808, 4100, -34, -407, 133, + 33, 15, 63, 72, -223, -15, -491, 38, + 47, 258, -236, 192, 1628, 173, -2116, 687, + 295, -74, -183, 95, 529, 149, -372, 182, + 1317, 21, -1424, -3156, -111, -96, 580, 284, + -274, 41, 145, 1314, 79, 1830, 262, -325, + -16, 169, -245, -2038, 1959, 892, 946, 303, + -171, -432, 883, 34, -238, 2463, -294, 25, + 24, -106, -45, 509, -154, 496, 109, 115, + 169, 702, 396, -97, 657, -251, -112, -114, + -144, -230, 517, -190, 4885, -45, -152, -9, + -170, -2021, 541, -905, -2015, 2588, -936, -20, + -300, 384, 433, -123, 119, -505, -126, 295, + 526, -1352, 450, 142, -126, -115, 1, -140, + -734, 672, -147, -660, -747, 652, 161, -163, + 51, -616, -1974, 1413, -3145, 922, -1289, 215, + 182, -838, -171, 107, -333, 34, 216, -307, + -359, 496, -343, -325, -2552, -1573, 588, -441, + 1296, -3075, 119, -131, 54, 206, 278, 106, + -100, 112, 220, -49, -80, -229, 1051, 3271, + -1300, 324, -31, -1025, 1659, 1526, -161, 669, + -56, 430, 201, -535, -126, -9, -380, 222, + 212, -345, -282, 195, -41, -1235, -593, -593, + 1557, 71, 1023, -831, 545, -875, 161, -772, + 99, -190, 1616, 338, -251, -201, -3104, -774, + 4, -121, 178, -80, 652, -1018, -441, -343, + -236, -240, -244, -26, 2192, 75, -1348, 3771, + -22, -850, -251, 316, 132, -21, 63, 104, + 152, 185, -40, 275, -1356, 482, 3081, 571, + -481, -1387, 815, 1285, -352, -98, -41, 573, + -307, -1879, 427, 196, 169, -26, -232, -98, + -411, -231, -2034, -969, 271, 1421, -1485, -407, + 1404, -343, 861, 888, -11, 202, -245, -397, + 104, 229, 309, -2757, 315, 416, 393, 194, + -176, -663, -166, -229, 244, -152, 183, 24, + -205, 97, -255, -299, 123, -12, 53, 102, + -362, 371, 223, 46, 132, -5177, 157, -92, + -1114, -28, 135, -831, 627, -428, -1116, 421, + 761, 458, 3256, -167, 355, 2045, 113, 234, + -154, 20, -39, 61, -81, 63, 98, -171, + 1727, -1193, 2103, 416, -421, -575, -636, -114, + 700, -260, 1610, -336, 521, 2591, -738, 43, + 103, -63, -335, 168, 110, 41, 1995, 3554, + 1443, -53, -206, 992, 767, -372, 141, -24, + 173, 60, -237, 69, -173, -73, 137, 167, + -164, -159, 312, -151, -78, 619, -192, 689, + -69, -2805, -259, -288, -231, 28, -1682, 2316, + 2298, -336, -131, 59, 542, -218, -281, -214, + -41, 116, 138, 8, -297, -45, -215, -167, + 1587, -1061, -1976, -445, 401, -2392, -42, 581, + -519, -230, 1461, 542, 113, -634, 1776, 332, + 191, 5, 174, 1939, -26, -242, 120, 230, + -986, 3501, -1125, -89, 3, -580, -219, -255, + 37, -119, 94, -17, -297, -176, -434, -234, + 55, -63, -1167, -492, -1753, -3397, 185, -794, + 689, 819, -32, -836, 335, -133, 724, -299, + -318, 424, 558, -654, 119, -447, 140, -100, + 72, -872, -1432, -203, -40, -14, -59, 550, + 85, -53, 5007, 258, 401, -184, -313, -170, + 66, -185, -82, -61, 210, 48, -204, -96, + 130, -562, -1700, -1037, -3926, -884, 1115, -6, + -100, 842, -450, 877, 76, 568, -623, 27, + 73, -195, 328, 41, -24, 124, -77, 1499, + 540, -1064, 4517, -22, -35, 839, -48, 253, + -259, 96, 409, 90, 26, -177, 365, -48, + -324, -26, -23, -83, -77, -80, 1599, 1486, + 266, 659, 236, 231, -16, 359, -163, 455, + -999, -1169, 2453, -599, -945, 4, -2110, -174, + -736, 344, 232, 142, 32, -99, 763, 133, + -325, -56, 1635, -439, 843, 2, -1704, -13, + 771, 3680, -89, 182, 4, 42, 394, 404, + 82, 312, 91, 141, -1577, 1765, 3141, 625, + -271, -2122, 423, 353, 489, 606, -290, -190, + 486, -131, 118, 236, 248, -209, -2, -162, + -95, 95, 170, 278, -2233, 549, 34, -846, + 3595, 445, -400, -65, 131, -14, -16, 611, + -116, 1293, 98, -680, 189, 217, -15, -549, + 131, 8, -768, -1082, 841, -346, 129, -33, + -778, 322, -2508, -2128, -1895, -2021, -27, -42, + -51, -536, 239, -1, 78, 105, 48, 79, + 207, 422, -181, 18, -94, -152, -181, -5012, + -187, -3, -118, -397, -84, -49, 129, -276, + 188, 45, -146, -235, -109, 83, 32, -79, + 2039, -616, 257, -1575, -1756, -2364, 222, 195, + -1138, -290, 58, -641, -252, -11, 402, -31, + -1040, -592, 676, -118, -231, 94, -123, 1642, + 1404, -334, -728, -3425, 382, 111, -194, 677, + 177, -182, 434, 860, -1022, 84, 1214, -733, + 300, -2, -259, 140, 35, 96, 1164, -1476, + -757, -74, 239, -203, 1796, 1207, 1732, -3029, + -610, 658, 490, -465, 136, 56, -614, -612, + -123, 93, -151, 162, 56, 502, 1634, -1825, + 45, 1033, 1554, -2380, 1615, 1317, 786, 387, + -255, -423, -44, -246, -213, -149, 107, -74, + -94, 45, -204, 13, -1959, 936, 2023, 1000, + 1031, 112, 574, 323, 163, 947, -657, 492, + -2624, -44, 739, -305, -31, 247, 270, 213, + -46, -90, 43, -1504, 931, -61, 4045, -863, + 389, -386, -130, -374, -583, -800, -900, 158, + -455, 169, 134, -164, 54, -117, -185, -90, + -203, -41, -811, -2082, 169, 287, -378, -15, + 231, 83, 89, -187, 198, 18, 178, -18, + 527, -40, 94, 54, 79, -4356, 248, 162, + -94, -1431, -31, -2048, 651, 1231, -508, -1089, + -1255, 766, 1673, 357, 13, -813, -2403, 179, + -470, 65, -339, 154, 9, 56, 246, 66, + -2308, 1443, -947, -744, -2473, -1248, -113, 1017, + -608, 149, -182, 41, -524, 16, 285, -268, + -781, -57, -346, 194, 256, -51, 107, -484, + -190, -125, -645, 487, 314, 74, -555, -1012, + 325, 76, 233, -205, -189, -48, -4593, -122, + 10, 121, -91, 108, -49, 254, -1662, 2500, + 87, -1540, -200, 287, -329, -50, -401, 182, + -1300, 689, 915, -224, -768, 471, -339, 133, + 407, -344, 99, 96, 111, 1224, -1431, 2069, + -282, 127, 397, -119, 1332, -1299, 744, -535, + 800, 327, 874, 700, -424, -1596, 1365, -651, + -151, 113, 102, -24, 464, 125, 911, -1583, + -372, 747, 2, 429, -47, -64, 34, 1700, + -741, 343, 728, -226, 1889, 78, -515, 2827, + 77, -66, 108, 515, 90, 2227, -678, 1301, + -974, 122, -983, 2357, 64, -1479, 186, 1436, + -245, 204, 460, 191, -677, -335, -200, -135, + -106, -101, 1112, -2733, -641, 73, 1265, -1281, + -1332, -743, 675, 129, -1144, -1169, 331, -143, + -87, 809, -891, -848, 246, 243, 97, -170, + 36, -1109, 102, 1055, -1395, 1384, 1155, 439, + -1549, -300, -2069, 1014, 187, -782, 980, -971, + -345, -583, -66, -138, -317, -124, 48, -152, + -98, 92, 2446, 128, -1232, 2148, -337, -615, + 467, 1573, -613, 857, 303, 422, -1340, -420, + 305, -626, 94, -496, -386, -129, 243, 27, + -200, -1373, 1468, -2040, 151, -675, 65, 1464, + -432, 545, 269, -510, 584, -1935, 970, -319, + 1465, 490, 263, 555, -256, -49, 315, -242, + -394, -312, -88, 201, -121, -302, 172, 49, + 234, 59, 327, 155, 199, -187, -41, -74, + 52, -31, -59, -5574, -121, 282, 343, -125, + -200, -575, 1328, 155, -1928, 250, 702, 21, + -2718, -153, -102, 2131, 612, 432, -1072, -457, + 222, 427, 144, 149, -433, -1573, 1337, -650, + 176, 13, -1273, 280, -751, -236, 453, 204, + -1595, -2896, -272, 233, 485, 82, -139, -528, + -140, -399, -56, -274, -335, 176, -756, 243, + 2250, -305, 721, 1711, 7, -1230, -1590, -1872, + -137, -714, 263, -1643, 362, -266, -176, 64, + -36, -63, 687, -483, -1488, 709, 929, 1349, + -1245, 645, -1619, 735, -651, 1850, 1031, 159, + -625, 838, 242, -396, -397, -41, 1237, 304, + 81, -94, -736, 578, 1279, 1064, 81, 1900, + -179, 224, 266, -429, 734, 500, 995, -882, + 1563, 1813, -519, 758, 532, -27, 27, 453, +}; + +static const int16_t cb4432m0[] = { + -6132, -262, -273, -1250, -577, 984, -430, -410, + -464, 577, -578, -178, -32, 369, -624, 267, + -68, 474, -480, -225, 166, -409, 437, 4633, + 98, -1560, -464, -869, 103, 193, 461, 72, + 292, -245, 1102, 417, -325, 461, 74, 43, + -120, -213, 333, 160, -468, -212, 31, -81, + 6516, 182, 201, -212, -66, -49, -266, 148, + -108, 98, -46, -11, -59, -20, -20, 2332, + -294, -560, 198, -647, -47, -638, -3877, 11, + 834, 547, 47, 2541, -126, -5, -366, 339, + 3, 2, -66, 60, -526, 914, 321, -658, + 3605, 59, -2392, -655, 384, 775, 366, 327, + 356, 386, 751, -375, 38, -205, -15, -442, + -212, -1241, 1913, -421, -755, 45, -1637, -36, + -2435, 1504, -1248, -763, -664, 133, -123, 814, + 241, -243, -446, 66, -131, -213, 2036, 1294, + -2138, 677, -1042, -771, 294, 371, 474, 85, + 1403, -2618, -478, -537, 275, -826, 349, 84, + 264, -272, -61, -705, 175, -972, 868, 25, + 4183, 881, -639, -833, -757, -1063, -991, -257, + -137, -619, -285, -454, 77, -169, 316, -45, + 4362, -203, -2132, -424, -820, -503, 340, 340, + -612, 648, 2, -342, 81, 630, -1518, 235, + 216, 210, 665, 231, 130, -879, 38, 675, + -136, -48, 540, -234, -152, -169, -5745, -294, + -24, 8, -129, -8, 308, -14, -16, 147, + 62, 70, 248, -2014, 76, -190, -328, -1899, + -353, -140, 836, -365, -112, -3945, -736, 467, + -258, 601, 617, 74, 62, 394, 180, 1151, + -810, 36, 457, 406, 75, -8, -5004, 2335, + -108, -123, 299, -335, 112, -499, -268, -185, + 461, 208, -38, -164, 764, -504, 272, 4853, + 396, 265, -1133, -433, 769, -458, 1005, 645, + 81, -172, 385, -56, -130, -393, 128, -73, + 31, 2038, 127, -436, 123, -2525, 282, -448, + -489, -295, -14, 85, -462, -49, 262, -93, + 238, -148, -3953, -414, -259, 33, -892, 459, + -2186, 60, 444, -610, 844, -486, -299, 219, + -433, 19, -1183, 276, -29, 388, 3327, 102, + -914, -221, 486, -892, -550, 190, 151, -141, + -336, 194, -242, -224, 405, 879, 1600, 349, + -2082, -38, -514, 18, -3574, 161, -142, -38, + -1815, 540, 228, 33, 164, 1074, 4, -278, + -58, 4085, -295, -795, 31, 494, 555, -250, + 22, -202, -312, 92, 109, -238, -448, -622, + -1511, -4346, -417, -706, 37, 1157, -96, -199, + -59, 285, -43, -217, -22, -95, 103, 2242, + 244, 45, -74, -7, 366, -79, -359, -286, + 188, -14, 34, 49, 245, -108, -84, 88, + -333, -216, -79, 15, -5710, -36, -102, -552, + -213, -8, -356, 515, 212, -265, 80, 316, + -1163, -561, -517, -714, -375, -4176, 73, -666, + -363, -28, 1248, -68, 478, 2648, 642, -710, + -555, -744, -166, -744, -596, 138, 499, 59, + 453, -583, -290, -11, -48, 4174, -252, -74, + -78, -62, 449, -265, -818, -357, 171, -513, + 72, 106, -45, 649, 145, 5558, -60, -136, + 69, -172, -134, -66, -68, 100, 683, -427, + 795, -407, 345, 4930, -838, 361, 279, -190, + 173, -341, -9, 722, 383, -140, 123, -269, + 154, 31, 335, -465, 311, 46, 4535, -131, + 90, 151, 287, -11, -526, -614, -2253, -321, + -93, -550, -128, 25, 303, -139, 19, 0, + -3255, -161, 276, 103, -245, -515, 816, -1042, + -1449, 1693, -627, 1287, -837, -727, -80, -478, + -337, 116, 1, -270, -567, -311, -407, -1656, + -216, 196, 3004, -285, -521, 1510, 1818, 1392, + 42, -44, -244, -349, 959, -183, 25, 58, + 43, -345, -310, -8192, -84, 311, -60, -348, + 125, 33, -79, -138, 88, 138, -121, -37, + -211, -118, -142, -37, -132, 181, 162, -1423, + 1781, -3453, 1261, 134, 670, 1218, 761, 292, + -146, -825, 672, 737, 293, 433, 245, -392, + 46, 598, 257, -234, -1201, 718, -4549, -573, + -696, -224, -85, 75, -268, 244, 1817, 341, + -166, 436, -386, -1247, 22, -112, -55, -451, + 106, 388, -32, -254, -2400, -373, 892, 334, + -4114, -307, -107, -316, 41, -214, -403, -56, + -469, -246, 120, -237, 266, 43, 3257, -3925, + 291, 239, 752, -411, 162, 437, 159, 256, + 37, 71, -79, -136, -475, 124, -208, -216, + -245, 16, 40, -459, -4320, 340, -1462, 914, + 10, 490, 436, 162, 271, -238, -38, 2219, + 25, -141, 405, 107, 235, 282, -55, -7, + -3429, 565, -1095, -678, 1979, 233, -874, 592, + -474, 680, 402, -738, 21, 274, -321, 655, + -348, -546, 510, 62, 23, 4722, 572, 423, + -256, 473, 1240, -997, -899, -53, -73, 332, + -902, -771, -335, 0, 769, -587, 592, -703, + -600, -77, -94, -207, 792, -133, -758, 500, + -14, 330, 22, -281, -5460, 152, 607, 337, + -39, -118, -80, -51, 228, 65, -6, 540, + -3515, -1712, -449, -157, -164, -195, -1655, -1285, + 90, -517, -116, 11, 1402, -162, -64, -103, + 46, 302, 37, 71, 2903, 2952, 780, -487, + -297, -426, -369, 150, -129, -233, 813, 1639, + 190, 310, -311, 320, 94, -247, 1484, -32, + 70, -220, 560, 372, 54, 205, 96, -3567, + -680, 1683, -2377, 17, 548, -266, 257, 656, + 331, 205, -121, -814, 139, 326, -370, 625, + 2035, 818, 775, -1165, -41, -4258, 41, 1109, + 984, -885, -43, -314, 204, 204, 95, 407, + -351, 101, 133, -929, 899, -6, 384, -177, + -330, 240, 90, 78, -318, -455, -5, -365, + -61, -80, -72, -4850, -338, -384, 30, 181, + -2721, -767, 3217, 453, -226, -582, 283, 135, + -103, 265, 494, -1444, -120, 70, -976, -67, + -90, 660, 366, -609, 32, 205, 73, 51, + 346, -6, -120, -10, 300, 32, 270, 139, + -55, 453, 5712, 353, -145, 176, -168, 216, + 205, -30, -304, 1085, 221, 464, -426, 1662, + -1397, -1114, 301, -1058, 3553, -388, 743, 696, + -893, -296, -57, -254, -251, -178, 417, 82, + -988, -3566, 2171, -1312, -954, -23, -1349, 480, + 566, 24, -643, -292, -68, 303, 73, -81, + 296, 7, 371, 94, 1718, 498, -774, 857, + 1014, 358, 436, 210, -3481, -202, -416, 59, + 1987, 137, -476, 32, -627, 193, 368, -3, + -290, -3035, -352, -455, -609, -175, -5, -600, + -181, -249, -2551, 226, 105, -249, 1851, -86, + -1203, 214, -57, -505, -522, -247, -154, -40, + -17, -523, 333, -1777, -354, -1568, -3492, 1032, + 1577, 90, 153, 534, -106, -538, 102, 3, + -198, -99, -23, 835, 3495, -1099, 44, 732, + -350, 926, -472, 533, 1529, 54, -844, 1295, + 573, 414, -23, -71, 279, -891, 287, 126, + 1456, 973, 456, 1608, -646, -1244, 452, 651, + 694, 855, -235, -503, 745, -544, -3512, -138, + 678, 473, 220, -273, -9, 265, -1874, 397, + 1196, 284, -963, 298, 318, -2309, -162, 322, + -1250, -16, -1004, -5, 2800, -64, 72, -482, + -162, -412, -2922, 774, -335, 238, -1144, -134, + 1428, 558, 1969, -659, 902, -1698, 793, -858, + -613, 998, 253, -336, -348, -80, -117, -264, + 355, 808, 784, -559, 2030, 1952, -244, -1130, + -986, 1883, 1171, -493, -326, -880, 2588, -243, + -204, 194, -172, -65, 2026, 424, 587, -317, + 2550, -601, 203, -669, 475, -676, -1492, 27, + 41, -1078, -299, -630, 177, -164, -429, -246, + -357, 1191, -867, -1363, 1621, -110, 916, 217, + -1269, 622, -434, -1113, 888, -41, 1020, -1774, + 46, 80, -483, -892, -61, -472, 193, -192, + 2000, -103, 740, -223, 2493, 422, 2508, -331, + 470, -1233, 47, 595, 795, -465, -320, -163, + 128, 6, -209, 603, 536, -416, -1455, -87, + -1191, -98, -281, 1003, 1421, 388, 1163, -1146, + -81, -299, 2518, -1072, 207, -443, 506, -220, + -346, 98, 2119, -416, -2268, -498, 109, -1342, + -335, 1125, -712, 156, -1088, -2092, 1164, -500, + 113, -17, 551, -199, 262, -27, -692, -629, + 204, -1448, -1606, -1554, 289, 382, -691, 1229, + 414, -1746, -1198, 1113, -386, 310, 1354, -12, + -284, -569, 46, -558, 1495, 172, -899, 617, + 827, -365, 100, 1008, 136, 2111, 10, 2320, + -291, 364, -401, -408, -528, -612, 127, 1218, + -384, 129, -1603, 438, 1029, 2536, -150, -1432, + -856, 1068, 773, -762, -808, 676, -693, 404, + 145, 4, 27, -148, -318, -1019, -277, 1404, + 880, -1135, 861, 903, 739, 303, 139, 1918, + -952, 801, -306, -2439, -3, 442, -590, -1034, + 178, 430, 153, 1853, 1997, 742, 1745, -608, + -237, 160, 523, 950, 82, -1468, -1592, 807, + 719, 618, 319, 57, 235, 287, 1344, -50, + 324, -182, -365, -381, -377, 1989, 147, -573, + 1246, 1769, -473, -178, 961, -1297, -750, -1428, + -1246, 789, 158, 612, 17, -292, -227, -142, + 64, 51, -16, -301, -287, -60, -404, -267, + 109, -108, 189, -438, 48, 95, -5059, -42, +}; + +static const int16_t cb4432m1[] = { + 7567, 273, 268, -74, 201, 274, -149, -146, + -262, 243, -273, 63, -127, 135, -160, 231, + 120, 209, -91, -218, -38, -1206, -468, -159, + 278, 536, -995, -60, 22, 1041, -550, -121, + -241, -664, 427, -416, -1395, -732, 152, 3247, + -67, -154, -2430, 421, -405, -558, -73, -2887, + -272, -60, 365, 745, 287, -622, -1103, 412, + 266, 82, 61, -2172, -379, 529, -125, -1482, + 319, 643, 222, -508, 2451, -970, 71, 237, + -280, 202, 983, -223, -307, -130, 217, 3209, + 49, -30, 275, -12, -260, -3959, 1219, -104, + -2700, -201, 54, 851, -590, 691, -254, 408, + 296, -48, -364, 216, 16, 220, -415, 218, + 83, 43, -4032, -1359, 25, 15, -279, -2092, + 794, -433, -195, -162, 606, 166, 87, -316, + 508, 242, -359, 687, -178, 14, -2969, -500, + -1041, 3234, 679, 170, -791, -127, -630, -16, + -19, 181, -2, -185, -172, -88, -118, -167, + 128, 121, 239, 321, -125, 217, -7260, -157, + -161, -347, -257, 102, -1181, 71, -379, -205, + -268, 144, -174, -106, 305, 23, -47, 202, + -110, 660, 54, -2963, -119, -1371, -2823, 1171, + -726, 690, 534, 161, -435, 753, 58, 227, + 241, 138, -76, 473, 193, -1926, -2183, -2526, + -1428, 284, -1270, 336, -1458, 208, 41, -356, + 345, 153, -273, -166, 500, 42, 120, -35, + -81, 56, 1747, -3050, -2029, -764, -947, 888, + 422, 374, 143, -318, -225, 604, 343, -91, + 1626, 75, -211, 160, -667, -195, 38, -446, + -1269, -108, -959, -616, -530, 554, 2865, -156, + -358, -429, -261, 23, 511, 340, -548, 2347, + 105, 12, -32, 164, 170, -168, 268, 2587, + 3511, 612, 329, 159, 456, 273, -452, 168, + -394, 799, -58, 160, -480, -257, 242, 167, + 46, -1433, -1631, 50, 852, 509, 864, -381, + -306, -698, 261, -702, -19, 4113, -38, -153, + -11, 405, -441, -120, 139, -265, 225, 342, + 199, 2085, 237, 278, 252, 1537, 119, 182, + -174, -193, 2486, 87, 2903, -311, -304, 273, + -217, -256, -264, -675, -819, -188, -615, -1183, + 495, -154, -687, 2423, 197, -63, -146, 1151, + 896, -1129, -58, 1114, -1644, 1219, -648, -71, + -130, -2643, 533, -218, 3942, -83, 208, -724, + 198, -643, 590, -944, -56, -420, 115, 23, + -414, -144, 295, 219, -36, 393, -174, 91, + 290, -7066, 158, -275, -70, -119, -1, 302, + -262, -73, -61, 110, -196, -25, 87, -446, + -159, -6, -107, 115, -7562, 5, -33, 284, + -106, 34, -140, 160, -304, -272, -169, 25, + 93, -205, 28, 169, -165, -34, -50, 343, + 2204, 1440, 817, -1921, -590, -527, 81, -364, + -354, 163, -1058, 1977, 244, -75, 1201, -207, + 293, -289, -105, -121, 3588, 925, -2, -201, + -860, 917, 100, 265, -200, -44, -529, 351, + -579, -103, 186, -3622, 52, 181, -259, -411, + -4, -328, 380, 517, 306, 57, 340, -65, + -263, -311, 494, 326, -6136, 747, -141, 296, + 217, -2, -125, 8, -88, 254, -2934, -259, + 946, -905, 653, 436, 3393, -147, -157, 27, + 166, 299, 8, -16, 643, 114, 217, 57, + -21, -298, 19, 129, 1721, -134, 2337, 781, + -483, -748, 118, -330, -226, -3762, 222, -417, + -154, -24, -13, 1138, 210, 357, -122, 257, + -369, 863, 13, -320, -439, -433, 3469, -869, + 116, -2772, 202, 1065, -130, -287, 142, -288, + 54, 318, 131, -16, 84, 238, -361, 934, + 1341, 37, 130, -412, 146, -724, -3, -823, + 2555, -1263, 11, -147, 3164, -83, -39, -127, + 258, 26, -1181, 3339, -676, -30, -56, 691, + 867, 715, -903, 293, -205, -392, -22, 529, + -76, 2201, 433, 134, 1338, -18, 85, 3128, + 33, 924, 257, 1662, -769, 321, -449, -374, + -58, -597, -1670, 97, 222, -998, 404, -155, + 133, 358, -250, -125, 163, 6027, -228, -116, + -61, -878, -693, 710, -516, -191, -27, 443, + 83, -174, -695, -117, -107, -53, -142, 92, + -145, -114, -62, -710, -3192, -872, 3284, -521, + -36, -948, 252, -253, -143, 260, 109, -24, + 262, -169, -196, 195, 105, 27, -135, 1722, + 1862, -513, -270, -144, -414, -59, 91, -288, + -96, -56, -204, 273, 170, -171, -62, -4993, + -125, -67, -50, 226, -275, 600, 105, -217, + -450, -87, -20, -353, 24, -74, 167, 1881, + -4260, -144, 48, 92, 187, 319, 341, 22, + -4, 405, 147, 237, -120, 122, -237, 56, + -515, -153, 333, 834, 401, 210, -5516, 7, + 127, 147, -140, -479, -26, -1669, -21, -147, + 60, 387, 565, -140, -5827, -269, -1119, -324, + 118, -199, -11, 105, -49, 150, -148, 178, + 182, 162, 150, 68, -227, 3, 221, -330, + -23, 65, 6262, 71, 48, -41, -10, -1, + -44, -255, -50, -138, -109, -54, -31, 492, + -214, 239, -194, 35, -6348, -148, 9, 25, + -123, 84, -448, 241, 148, -35, 52, 35, + 7, 99, -16, 57, -43, -256, 3336, 373, + 211, -513, 2328, 86, -274, 386, 74, -174, + 624, -1037, -1154, 36, -209, -1028, -101, -412, + -103, -267, -107, -126, 163, -394, -1097, -100, + -1575, -542, 3326, -2149, 547, 626, -278, -414, + -781, 486, -186, -159, 138, -187, -821, 419, + 393, -4266, 828, 431, 86, 745, 1313, 1484, + 260, 52, 163, -455, -1071, 186, 522, 288, + 421, 18, 97, 1267, 200, 2637, -189, 729, + 746, 203, -639, -843, 2164, 671, 84, -2384, + 430, -161, 404, 166, -33, -17, 591, -227, + -3849, 1579, 175, -718, 99, -410, -844, -239, + 32, 212, 163, 480, 843, -379, -621, -317, + -424, 113, -262, 44, -93, 529, 144, -218, + 140, 3257, -575, -2697, 144, -83, -186, -44, + 977, 153, -230, -1530, 234, 212, 212, 331, + 412, -125, -3, 422, -329, -2181, 1406, 363, + -90, -86, 329, -267, -4462, -189, -87, 154, + 66, -200, 37, 80, -109, -199, 125, 1983, + 260, -438, -2417, 3259, -974, 453, 41, -77, + -538, 1123, 119, 120, 254, -239, -134, 33, + -384, -407, 27, 465, 1810, -910, 980, -15, + -1307, -919, 1880, -327, -303, -198, 149, 413, + 2176, 2269, -707, 343, 360, 169, 148, 182, + 104, 163, 857, 291, -153, 303, -679, -386, + -868, 2283, -320, 167, 3257, 1741, 338, 467, + 209, 207, 834, -226, -479, -120, 1674, -61, + 696, -93, -1327, 2176, 716, 402, 1688, 2219, + -339, 779, 366, 358, 241, -695, -272, -136, + -48, 36, -269, 862, -616, -118, -2028, 1678, + 1971, 115, 290, 71, -765, 31, -2874, 122, + 13, -424, -281, -320, 233, -1032, 40, -186, + 1208, 274, -2310, -1594, 289, 230, 1264, 962, + -310, 23, -548, 12, -38, -2734, 664, 37, + 346, -620, 266, -98, 82, 2369, 963, -1391, + -451, 833, 82, 175, 448, 1874, 345, -440, + 155, 130, 94, 326, 3223, 234, -163, -384, + -354, -539, 827, -9, 530, -226, -21, 332, + -2298, 3221, 1470, -282, -800, 231, 314, -998, + -1051, -648, -434, 743, -72, 119, 91, 414, + 379, 1370, -637, -998, 851, -2904, -266, -1652, + -1356, -1339, -1679, -181, 245, 731, -231, -2, + 221, -182, -325, -411, 346, 246, -2629, 1736, + -361, 24, 229, 1168, 747, 309, 425, -128, + -320, -496, 109, 1496, -70, -797, 37, -271, + -39, 906, -62, -194, 1753, 311, 689, 1354, + -1035, -973, -438, 1166, 2197, -99, -380, -274, + -1565, 447, 100, 349, 485, 653, 744, 50, + -582, -123, -1396, 156, -27, 349, -1067, -1382, + 1388, -1061, -554, 894, -80, -783, -1500, -736, + 897, 1158, -1386, -40, -280, -819, -672, -895, + 994, -308, -466, -578, 455, -1536, 879, -448, + 542, 1508, 850, -2465, 816, 641, -427, 310, + -168, -41, -908, -302, 1513, -29, -1144, 588, + -1703, 1144, 2623, 90, 284, 866, 335, -351, + 419, -745, 879, -183, -824, -1713, -34, -15, + -913, 37, -460, 778, 2130, -145, -153, 1761, + 1420, -243, -32, -877, 140, -700, 612, -2053, + 321, -78, -165, 200, 526, -1002, 2176, -1022, + 1436, 298, -21, -1378, 515, 304, 974, 1722, + 2054, 661, 425, 282, 471, 438, 70, 169, + 1587, -2076, -40, -702, 264, -146, -1499, -863, + -1775, -1059, -490, 92, 631, -1194, -1031, 335, + 257, -1299, 241, -270, -325, -322, -37, 0, + -685, 897, 984, -909, 1556, 1281, 1367, -1269, + -1591, 415, -1156, -374, -110, 1552, -695, 74, + -167, -473, 1421, -611, 175, 1521, 1322, 436, + 1969, -787, 1041, -730, -598, 188, -794, -531, + -2198, -317, -11, -8, -407, 198, -1180, -1675, + 174, 981, 467, -149, -890, 263, 1030, -121, + 2147, -135, 1975, -634, 431, -238, -695, 1338, + -172, 110, 147, -334, -726, 65, -873, 667, + 997, -1118, -339, 144, -700, 1303, -207, -609, + -1617, -765, 839, 505, -36, -58, -2894, 226, +}; + +static const int16_t cb4440sl0[] = { + -3624, -495, 158, -246, -529, -813, 689, 504, + -527, -2216, -198, -323, -690, -591, 175, 262, + 243, -3676, 2648, -986, 166, 243, 301, -700, + 324, -324, 13, 362, 222, -470, 30, 20, + -46, -147, 4050, -97, -560, 284, 317, -1611, + 655, -416, -1582, -675, 389, -124, 150, -27, + 325, -84, 48, 7474, 97, 105, 19, 38, + 133, 19, 28, 25, 40, 34, -59, 22, + 11, 27, 21, 5, -1596, -428, 439, 353, + 2288, -18, 357, -274, 2582, -126, -90, 71, + -9, -704, 205, 22, 44, -120, -43, 517, + 817, 1370, 2151, 2818, -470, 90, 395, -1243, + -345, 959, 19, -1, 123, -108, 347, 25, + -138, 15, 119, -117, -146, 142, 183, -254, + -276, -174, 5980, 283, -317, 70, 51, -15, + -2447, -79, 234, 736, -2600, -641, -1162, 376, + 959, -250, 701, -40, -102, 204, -38, -24, + -893, -387, 339, 1338, -91, -655, -864, 78, + 299, 228, -2732, 234, 1995, -1321, -139, 500, + -316, -140, 2, -80, 186, 11, 16, -69, + -7534, 85, -263, 189, -7, -1, -67, -68, + 3, 24, 391, -3299, -2952, -121, -393, 103, + -60, -113, 141, 185, -119, 240, 270, -392, + -105, 9, -39, 2529, -17, 353, 2966, -855, + 1042, 1294, 132, -257, -257, -496, 112, -179, + 424, 486, -63, 77, 275, -198, 2026, 1657, + 913, -255, -147, -1748, -5, 418, 356, 2022, + 927, -295, 194, 165, 28, 109, 13, 209, + -133, -2802, 420, -1873, -648, 309, -1172, -1825, + -36, 840, 280, 44, -118, 128, 34, 241, + -1005, 1160, -303, 318, 726, -1716, 2625, -950, + -839, -1257, -901, -238, 1123, 131, 252, 1, + 440, 1455, -14, -274, -461, 87, -515, -2299, + 928, -2867, -804, -215, 680, 147, 80, 215, + 15, 1339, 141, -95, 134, -35, 122, 53, + 429, 168, 476, -45, 745, 236, 4229, 318, + 247, -201, -372, 2289, 161, 431, 337, -707, + -1024, 121, -1773, -795, -1187, -401, 394, -1431, + 1526, -35, 432, 2929, 90, 1880, 628, 1298, + -552, -498, 207, -97, -1431, 1105, 29, -739, + -56, 62, 94, 537, -732, 1255, -766, 200, + -365, 2846, 2139, 435, 92, -710, -512, 360, + -339, 1021, 474, -132, 405, -440, 3435, 75, + -254, -2443, -880, 325, 343, 285, 230, -431, + -191, 215, 201, -443, 93, -81, -131, 2981, + -2986, 1003, 437, 434, -386, 17, 222, 70, + 173, -550, 267, -121, -43, 114, -11, -795, + 561, -147, 187, -198, -4969, 50, 59, 674, + -853, 163, 71, -205, -284, -50, -28, -1412, + -105, 262, 272, 565, -824, -541, 3381, 430, + -81, 228, -426, 978, -294, 422, -538, 13, + 9, 430, 180, 2329, -564, -1082, 1740, 1108, + -2011, 11, 343, 868, 723, -806, 342, 339, + -141, -173, 186, 50, 297, 705, 783, -593, + 1609, 212, 528, -2547, -863, -2457, -876, 164, + 162, 365, 68, 30, 11, 48, 47, -285, + -64, 166, -21, -6880, -191, -226, 89, -1, + 22, -93, -6, 44, 282, 52, 294, -690, + -147, 372, 2247, 804, -637, 54, 2385, -1799, + 315, -929, 692, -65, -54, 218, -752, -519, + 2171, 177, 907, 22, -778, -2656, 62, -418, + -434, 307, 1906, -280, 196, 76, 58, -46, + 70, -367, -67, 50, 125, 77, -547, -287, + -97, -10, -84, -271, -4856, 10, 490, -560, + -21, 66, -2469, -322, 1021, 936, 625, -2520, + 1144, -373, 270, 804, 603, -91, 262, 659, + 9, -324, 50, -712, 2705, -3016, 594, 87, + -88, 697, -205, -799, -128, 37, 504, 59, + -274, 655, 672, -20, 1294, -221, -2954, 198, + 674, -1676, 863, 324, 968, 731, 1125, -41, + -149, -303, 223, 1370, -67, -194, -1, -194, + 251, -459, -39, 4477, 113, -74, -386, 214, + -72, -77, -1593, 511, -461, 752, -559, -476, + 204, -722, 1050, 2080, 2468, -154, -208, 964, + 103, -58, 390, -1863, 910, -307, 209, -32, + 663, 103, -133, -3137, -423, 259, -605, -242, + 139, -391, -488, 77, -266, -1694, 397, -659, + 237, 2068, -3, -867, 870, 1647, 645, 1848, + 68, 382, 455, -551, -87, -99, -2926, 372, + 2438, -1166, -6, 521, -195, 1259, -162, 917, + 140, 275, -273, 133, 318, -25, 252, -119, + -132, 3120, 397, 398, -420, 1756, 666, 2176, + -141, 271, -51, 22, -494, -36, 57, 308, + 222, 3585, 16, -265, 2628, -24, 162, 13, + -240, -96, 620, 331, -449, 710, -123, -105, + 23, -170, 20, 256, -5228, 398, -186, 272, + 129, 175, 598, -16, -502, 11, -215, 28, + -110, 3570, 68, 199, -2535, -933, 781, -762, + 325, 18, -438, -319, 473, -677, 176, 290, + 0, 67, -6, -156, 31, 35, -131, -127, + 24, -100, -6826, -117, -53, -40, 99, -50, + -93, 31, 34, -251, 186, 487, -203, -662, + -182, -96, 239, 308, 338, -86, -4871, 264, + -48, 314, -66, 100, -188, 151, 24, 198, + 4, 5046, -47, -654, -43, 41, 109, 103, + -262, 93, -118, -63, 58, 2088, 336, -320, + 2326, 548, -810, -1315, -864, 461, 171, 76, + -1109, -1510, -874, -620, 97, 88, 40, -4, + -7295, -128, -39, 23, -100, -9, -74, 112, + -151, 67, 21, 53, 2, -29, -33, 52, + 3287, -2178, 626, 339, -817, 349, -1187, -550, + -390, 57, -41, 295, 756, 185, -215, 17, + 3, 7502, -134, -122, -31, -53, 91, -170, + -71, 133, -34, 57, -112, -5, -66, 17, + 1, 2328, 3714, 214, -123, -839, 9, -62, + 54, 70, -18, 817, 186, -61, -252, 37, + 98, 9, 2010, 738, -1651, -1924, 1106, -624, + 143, -548, 847, -198, -140, -691, 478, -758, + 56, 54, -7, 209, -2665, 109, -127, -134, + 2099, 333, -602, -2217, -743, 346, 74, 216, + 579, 223, 61, -30, 57, 94, 224, -2595, + -566, -851, 246, 314, 65, 2857, 114, -760, + 77, -611, 119, 181, 4, -2556, 127, 138, + -164, -219, -116, 157, -3143, 197, -98, -1040, + 235, -332, -424, -152, -338, -33, -220, 207, + 254, 5469, -102, -390, -125, -420, 113, -233, + 329, -34, 109, -171, 103, 50, 58, 96, + -500, -2317, -259, 2178, 109, -2030, 759, -780, + 448, 678, -384, -271, 213, 334, -271, 23, + -1121, 636, -1103, -482, -3059, -1200, 1160, 109, + -232, 541, -788, 130, -166, -300, 664, 233, + -97, -29, -286, 33, 1272, -298, -382, -242, + -199, 47, 479, 224, -1761, -1904, 1780, 1439, + -681, -1973, -118, -90, -148, 247, -758, 1936, + 182, 1373, 2346, 120, -758, -476, 1789, 1177, + 611, -394, -14, -39, -994, -674, 1049, -41, + 836, -391, 942, -1040, -1437, 1376, -1916, 1129, + -1018, -653, 1284, -72, -166, 321, 194, -142, + -151, -77, 251, -162, 732, -790, 107, -292, + -675, -4248, -51, -86, -299, -495, 413, -128, + -455, -105, -842, 881, -492, 1241, -1432, -1296, + -52, -430, 2533, -1765, 838, 84, -24, -798, + -428, -154, -658, 37, -388, -591, -931, -433, + -1837, 1363, -683, -717, 3115, 104, 0, 1104, + 208, 148, 404, 101, 18, 217, 58, 49, + 4, -49, -195, 187, -239, -21, 294, -138, +}; + +static const int16_t cb4440sl1[] = { + -3057, -853, 3212, -334, 5, 224, 63, -250, + -345, -102, -289, -115, 75, -99, 206, -8, + 19, 96, -254, -2566, 334, 2773, 136, 199, + -1076, 347, -187, 481, -64, 654, -9, -1094, + 196, 40, -95, 5, 163, -135, 253, -1053, + 316, -231, 24, -2307, 1480, -2052, -18, -459, + -550, -1860, -15, 98, -1406, -66, -250, 21, + 497, -404, -54, -228, 2477, 2011, -145, -1957, + -426, -906, 608, 15, 1453, 218, -79, -636, + -1005, -332, 304, 2338, 1356, 81, -1201, -170, + -126, -1177, -1644, -1046, 16, 182, -328, -347, + 346, 591, 418, 623, -110, -342, -227, 10, + -5055, -411, 128, -103, 87, -28, -133, 196, + 333, 1785, -479, -442, -2892, 453, -2292, -19, + -383, -44, -435, -193, 503, 130, 4, 144, + 2184, -245, -7, 458, 82, -76, 3052, -375, + 1299, -76, 364, -145, 372, 36, 59, -39, + 48, 385, -230, 2764, 2956, -741, -372, 428, + -504, -220, -821, -47, -49, 609, -62, 56, + 6, 216, 376, 519, -512, 54, -318, -183, + -4563, 297, 795, -182, 108, 234, 404, 218, + -123, -17, -192, 170, 349, 134, -91, 43, + -135, -24, -6, -32, -6681, 50, -138, -89, + -18, 15, 24, -416, 356, 311, 83, -267, + 81, 209, -155, -368, 396, 358, 232, 4696, + -347, 724, 112, 10, 331, 358, 197, 54, + 824, 646, -214, 113, -4425, 184, -11, 101, + -313, 186, 253, 169, 78, 52, -70, -108, + 1669, -22, -18, -2600, -27, 2806, 288, -106, + 506, 176, 616, -299, 58, -30, 1, -220, + 400, -177, 874, 70, -36, -274, -139, 1148, + 372, 40, 236, 505, 619, -4002, -95, -48, + -2854, 114, -69, -2805, -401, -9, 203, -1011, + 472, -1066, 412, -220, 245, -183, -27, 35, + -762, 312, -137, -292, -242, 896, 172, -345, + 106, -4490, 506, 569, -11, -352, -108, 334, + -165, 2389, -895, 2761, 467, 201, 150, -516, + 39, -1105, 4, 587, -152, -764, -184, -15, + -137, -30, -12, 7, 382, -461, 1577, 3519, + -173, 1370, 80, 499, 344, -771, 123, -13, + 288, 233, 111, -2472, 3952, 771, 216, -505, + -446, 531, -230, 103, -72, 34, 61, 249, + -175, 353, 83, 51, 169, -97, -60, 7827, + 95, 75, -13, 201, -27, 103, -11, 1, + 3, 121, -73, -28, 7, 2908, -209, -987, + -129, -341, 2840, 889, -147, -521, 123, 95, + -239, 552, -738, 279, -66, 0, 16, 116, + -45, -28, -43, -38, -7627, 30, -52, -209, + 281, -46, 23, -24, 56, -25, -23, -2534, + -107, -46, -93, -49, 238, -25, 96, -356, + 3483, -459, -414, 205, 102, 202, -150, -116, + 1785, 1399, 793, 543, 685, -2837, 255, 362, + -96, 410, 926, 1068, 416, 558, -169, 246, + 138, 2136, 39, -96, -605, 279, -130, -2741, + -1101, -935, -20, -227, 453, 1261, 103, 275, + 358, 43, 197, -23, -251, 322, -22, 233, + 2560, -214, 2, -101, 645, 2864, 287, -479, + 904, -65, 73, 224, 2418, -95, 428, -678, + -278, 71, -545, -571, -566, -181, -212, -2947, + 222, 780, -365, 124, -2703, -198, -69, -246, + -3056, -184, -598, -75, -145, -690, 380, 194, + 485, 214, -484, 54, 163, 363, -924, 1684, + 201, 34, 236, -539, 2374, -150, -490, -1313, + -61, 317, 2123, 315, -551, -26, -328, 207, + 253, -3015, 166, 109, -662, 2466, -157, -740, + 751, 254, -788, -369, -6, 100, -211, 107, + -309, -39, -47, 279, -126, -91, 97, -705, + 235, -231, 182, 283, -5097, -68, 285, 49, + 50, 637, 111, 39, -386, 923, 223, 115, + 1638, 1214, -640, -2168, 482, -2228, 857, 172, + 15, -2207, -89, 335, -18, 295, 718, -956, + 26, 604, -436, 2856, -1131, 98, -754, 243, + 9, 29, -4028, -1725, -1741, 432, -211, -60, + -535, 201, -273, 111, 444, 607, -250, 122, + 98, 159, 97, 281, 3071, -412, -2849, -721, + -14, 960, -43, 794, -427, 297, 478, 379, + -47, -22, 69, -60, -30, -732, 2456, 170, + 142, 6, 2520, -644, -201, -16, 1602, -20, + -293, 542, -451, -167, -9, 14, 1052, 2707, + 2980, -117, 479, -202, -92, 36, 904, -66, + -1088, -31, 75, -62, -110, -29, 112, -102, + 5217, -85, 14, -191, -202, -175, -71, 182, + -231, 275, 144, -1, -202, -13, -29, -19, + 70, 39, 46, 56, -7608, -53, -104, -61, + 44, 23, 1, -157, 42, 12, 38, 37, + 331, -609, -2516, -174, -2491, 258, -256, -926, + 983, 100, 83, 173, -965, 650, -304, -97, + 98, -166, 534, 2570, -611, 493, 103, -98, + 148, 3081, -131, 285, 13, -367, 205, -53, + 41, 29, -154, -2657, -51, -312, 134, 50, + -1514, 634, 411, -2885, -391, 365, -373, -54, + -74, -151, 80, 152, -91, -64, -209, 1134, + -2921, 316, -951, 1124, 713, 2, -2212, 31, + 164, -260, 103, 36, 229, 111, -23, -65, + -37, -220, -108, -30, 86, 17, 87, 205, + 163, 63, -5763, 254, 178, -18, 1760, -380, + 1453, -3151, 710, 106, 66, 387, 235, 463, + -295, 688, -124, 322, -193, 82, 1012, -2033, + -656, 1362, 805, -747, 2527, 470, 43, -1001, + 100, -83, 161, 74, -1128, -307, -82, -197, + -5470, 226, -327, 137, -131, 471, -432, -16, + 243, 224, 168, -164, -58, 125, 23, -2, + -2752, 268, -92, -466, 2876, 874, 182, 540, + -407, -338, -396, 562, -376, 536, -225, 160, + 44, -1501, -246, -1062, -378, 446, -2448, -124, + 499, -2297, -353, -637, 395, 598, -747, 418, + -495, 5, -1014, 2138, 289, -75, 301, 944, + 66, -457, -459, -253, -2, 678, 367, 116, + -2901, 436, -239, -303, -973, 384, -2574, 6, + -225, -164, -440, 627, 388, -3074, -263, 156, + -805, 381, -9, -112, -1481, 536, -711, 3770, + -496, 908, 483, 474, 298, -424, -793, -203, + -334, 134, -91, 208, -73, 5440, -316, -304, + 249, -1, -98, -214, 190, 242, -57, -38, + 244, -219, 30, -224, 66, -30, 22, 24, + 24, -109, -7594, -115, 90, -147, -83, 21, + -257, -52, 134, -49, 92, -117, 30, -8, + -636, 1551, 2207, -66, -1962, 212, 567, 969, + -1595, -562, 355, -467, -861, 937, -148, 15, + -68, -1516, -2118, 1477, 777, 1458, 976, 522, + 325, 957, -130, -132, -918, 448, 1088, 102, + 142, -644, -284, 687, -665, -132, -1870, 1387, + 733, -84, 920, -508, 53, -2183, 254, 565, + 2056, 97, 57, 219, 688, -344, 659, 2033, + 963, -1717, -290, -934, -2119, 57, -1452, 24, + -639, -739, -232, 170, 28, 359, -312, 310, + -103, -1067, -953, 1081, -857, 1926, 1364, -1719, + -863, 1832, 786, 55, 166, 383, -1373, -347, + 1710, -908, 91, 1257, 2013, -592, -1337, 1431, + -90, 617, 549, -356, -68, 134, -48, -133, + -176, -18, -65, 23, 84, -23, -36, -4, + 230, 297, -204, -150, 86, -4965, 742, 40, + 32, -1070, 149, 38, 302, -329, -386, -57, + 45, -1622, 1425, 1817, 1568, 2202, 7, -1192, + -201, -42, -62, -170, -32, -117, -38, 229, + 44, -226, 155, 70, 747, 259, -261, -120, +}; + +static const int16_t cb4440ss0[] = { + -3021, 2048, -450, 1147, 1487, -796, -657, 459, + 609, 63, -153, -1174, -144, 37, -176, -160, + 43, -31, -2577, 88, -797, 1179, -707, 3154, + -543, 875, 116, -40, -150, 326, 293, -112, + -73, -34, 61, 8, -2251, -1551, -2507, 6, + -52, -5, -323, -313, 1076, 920, 1116, -1100, + 1103, 310, -144, 904, 149, -59, 636, -1508, + -378, 381, -917, -868, 1388, -1225, -68, 1491, + 685, -220, 3253, 48, -504, 192, 114, -11, + -1718, -916, 660, -240, 767, -1061, 332, 591, + -477, -278, 25, -1485, 55, 216, -3238, -19, + -320, -148, 273, -876, 22, -529, 3263, -2535, + -756, -133, -481, -1024, 34, 418, -415, 412, + -92, -90, 161, -49, -1699, -2737, 2923, -243, + 122, 87, 984, -377, -37, 128, 350, -444, + -98, -52, 14, -14, -86, 255, 1997, -1239, + 42, 247, -15, 16, 405, 302, -17, 84, + -4033, -12, 254, -365, -205, -162, 329, 31, + -1158, -210, -376, 3958, -1601, -1128, 737, 731, + 300, -785, -777, -403, 463, -226, -109, -277, + -70, -53, -856, -785, -997, 71, 5565, 317, + 447, -279, -357, 254, 93, -47, -206, 133, + 88, 272, 7, 44, 2229, 1666, 234, 519, + -1996, -1195, 549, 449, 174, -1010, 622, 425, + 2288, -9, -390, 612, -40, 32, -1867, -673, + -70, -1174, 106, 134, 354, 61, -144, -290, + 82, -604, 202, -3954, 248, -76, 7, 224, + -1844, 99, -146, 206, -335, 243, 25, 60, + 186, 117, 67, -137, 119, 46, 4563, 45, + -46, -2, 874, 533, 216, -38, 185, -540, + -191, -163, -126, -108, -184, 193, -39, -4768, + 111, -89, -61, 17, 1064, 1678, 894, 4334, + 139, -892, 317, -351, 417, -87, -22, 195, + 20, 140, 234, -197, -268, -5, -1618, -756, + -119, -1749, -704, -943, 421, -3488, 871, -468, + 656, 266, -79, 325, -303, 45, -3, -31, + 1140, -707, -1578, -1434, 290, 327, -1365, -2913, + 1048, 38, -136, -871, -572, -30, 186, 343, + -30, -157, 1301, 1913, -515, -842, -723, -84, + -340, 270, -918, 3213, -1530, -394, -184, -60, + -391, -27, -110, 84, 104, 419, 1201, -810, + 1546, 39, -914, -334, -4257, 427, -95, -426, + -94, 256, -148, 246, -80, 9, -462, -1125, + 644, 3541, -140, 2346, 1045, -335, -867, 809, + 432, 386, -6, 159, 70, -10, 218, 43, + -2229, -607, 537, -924, -3038, -943, -968, 1261, + 28, 197, -285, 61, 137, 69, -2, -251, + 111, -19, -314, 2064, 960, 1529, 1056, 926, + -319, -1617, 1305, 1473, -867, 684, 1357, -834, + -66, 477, 74, -15, -1769, 1925, -2448, -1777, + -507, 264, -1740, 176, -518, -58, 32, -108, + 165, -68, 189, 35, 40, -85, -1152, 255, + 36, -1922, 1500, 1415, 841, -92, 3305, -110, + 3, -219, 167, 573, 219, 310, 27, 195, + 359, -244, 538, -2042, 355, 656, 51, -199, + -204, -3611, -396, 839, 743, -241, -80, -210, + -101, 28, -1399, 1062, -955, 54, -630, -178, + -376, 212, 237, -219, 47, 805, 216, 26, + -4334, 455, 4, 4, -1587, 95, 1186, -3101, + -140, -862, 916, 2063, 211, 96, 337, -185, + -195, 424, 1207, -31, -162, 206, 2485, -46, + -451, -1778, -40, 144, -155, 2884, 803, 396, + 1196, -635, 297, -76, -121, -162, -206, -149, + -2204, 1035, 232, -815, -49, 1006, 553, -407, + 161, 3650, -264, 370, -418, -28, 141, -177, + -113, -90, -315, 626, 62, 1392, -1815, 336, + -1276, -402, 486, -1060, -1848, 2610, 826, 485, + -250, 39, 208, 14, 2555, 2869, -813, -2074, + 337, 601, 855, -655, 566, -707, 189, -77, + 137, -510, -282, 79, 42, 73, 62, 650, + -4732, -486, 354, 420, 828, -645, -492, 388, + 753, 18, 2, 766, -212, 126, -43, 45, + 447, -283, 607, 251, -166, -10, 48, -5850, + -251, 128, -205, -95, 90, 90, 67, 24, + -50, -48, -167, -3231, -2926, 1831, 199, 484, + 169, -614, -135, -374, -418, -239, -89, -121, + 45, 75, -11, 16, -1058, 354, 1633, 589, + -1223, 1218, 842, -1146, 2186, 374, -363, 216, + -2153, -429, 429, -597, 93, 148, 1849, -797, + -162, 31, -325, 343, -323, 161, -373, 684, + -367, -452, -4306, -88, 28, -56, -59, 43, + -49, -1998, -956, 1331, -4214, -129, 30, 79, + -90, -129, 109, 130, -160, 409, 105, 298, + 208, 178, 1724, 731, 773, 128, 817, -425, + -4046, 180, -782, -116, 191, -259, 181, -31, + 162, 43, -41, -69, 1463, -1769, -2, -442, + -636, 1495, -218, -123, -58, 3616, 454, -475, + 247, -383, 304, 185, 155, 40, 1104, 1046, + -8, -736, -1155, -115, 3925, -257, -35, -599, + -437, -135, -256, 55, 214, -88, 215, -57, + -1097, 183, -501, -608, -135, 148, 405, 295, + 96, -513, 1013, 4350, -162, -61, 427, 315, + 24, -77, -1278, -167, -1774, -133, -323, -4339, + 732, 597, -30, -103, 79, -241, 177, -388, + 7, 44, 175, -143, 5030, 277, 58, 42, + -222, -133, -319, 6, 240, 217, -238, -198, + 218, -43, 439, 49, 37, 106, 1123, 2196, + 158, 171, 458, -932, -435, -2783, -300, 444, + 2317, -146, -339, -162, 157, -216, 1, 66, + 987, -190, -728, -3188, -3167, 378, -1, 158, + 459, 78, -42, 386, -133, 155, 294, 359, + -29, 78, 1763, 780, 1019, -330, 179, -51, + -393, 338, 4422, -296, -392, 170, 2, 52, + 253, 150, -191, 139, -371, 161, -2202, 156, + 37, -1004, -384, -466, 23, 183, -3701, 97, + -1293, -355, -83, -63, -26, 69, -1817, 641, + 2996, -16, 2011, -406, -647, -652, 332, 788, + 484, 918, -440, 1246, 165, 52, -260, 31, + -255, -7237, 14, 90, -135, 122, 14, 154, + 5, -78, 111, -254, 154, -23, -24, -83, + -9, 49, -426, 1657, 99, -36, -191, 2625, + 655, -20, -2723, -977, -222, -48, 155, 41, + 20, 194, -73, -26, -1206, -3517, -471, -815, + -1144, -371, 1353, -1069, -1238, 829, -227, 487, + -297, -101, 914, 100, -17, 115, -806, -798, + 585, 1097, -1, -792, 818, 29, -256, -417, + 942, 68, -4165, 34, -408, -252, 55, -77, + 246, 2055, -4, -313, -661, -836, 559, -393, + 2043, 153, 286, -2700, 98, -177, 1201, 99, + 308, -73, 1441, -3902, 730, -1610, 886, -599, + -126, 473, 43, -252, 45, 95, -291, 101, + -307, 259, -149, 26, -510, 498, 1403, -78, + -1039, -2551, 773, -1176, -1525, -405, -259, -283, + 398, 2080, -199, 62, 239, -26, 960, 582, + 2516, 799, -2127, 325, -253, -1652, -965, 1413, + 8, -119, 396, -342, 277, 541, 186, -142, + 1210, -732, 798, -47, -557, -12, 63, 537, + 148, -128, 328, 290, 203, 361, -328, -64, + 4004, 197, -640, 996, -93, -2314, 76, -914, + 1437, -964, -1735, 984, -578, 1389, -1025, -66, + -120, -1211, -32, 5, -1215, 771, 1621, -934, + -984, 148, -1592, -446, 19, -976, -1709, -1113, + -218, 191, -279, 2183, 10, -37, -842, -1582, + -92, 558, 227, -702, -365, -576, -100, 670, + -305, 285, 48, -329, 253, 3878, 156, 70, + -1008, 641, 1541, -234, 1440, 421, 1088, 735, + -206, -83, 460, -139, 107, -1160, -6, 2087, + 1894, -117, 962, 113, -990, 93, -29, 579, + 1217, -52, -342, -451, 670, 202, -1070, 837, + -132, 3507, -59, -114, -691, 208, -1170, 1089, + 305, -200, 603, -1301, -942, -1631, 1291, -2727, + 414, 80, 815, -443, 54, -34, -1141, 1301, + -1199, 372, 102, -257, 70, 450, -55, 80, + -227, 218, 264, 739, -52, -200, 3873, 83, +}; + +static const int16_t cb4440ss1[] = { + 6875, -104, -66, 161, 57, 24, -4, 76, + -122, -100, 31, 188, -119, -50, -244, 49, + 1, -100, 555, 253, 433, 633, -163, -5345, + -170, -217, -49, -29, 331, 633, -87, -46, + -29, 44, -174, -74, 2188, 434, 660, -593, + 1548, 379, 1443, 1676, -63, -2125, 246, 534, + -463, 872, -169, -12, 33, 211, -409, 408, + 1514, -189, -277, 391, -361, -35, 145, -362, + -4669, 212, -97, -65, 387, -81, 70, 36, + 448, 303, 332, -1077, -258, -1353, 1185, -50, + -12, -74, -2101, 2429, 1817, -939, 393, 169, + -22, -36, 1219, 3237, 816, 452, 1807, -646, + 407, -447, -1778, -370, -528, -127, 104, 416, + -121, -134, -62, 20, 1751, -640, -222, 950, + 1603, 555, 9, 219, -1272, 2724, 1004, 1237, + -395, 356, -453, -98, -24, 80, -1621, 474, + -1947, -237, -1059, -2091, 780, 1211, 939, 268, + -412, 1923, -419, 851, 230, 567, 143, 48, + 1506, 2228, -1226, -453, 246, 469, 540, -538, + -96, 977, 508, 105, -3150, -142, -37, 395, + 9, -38, 1, -135, -391, 1702, -179, -1566, + -3181, -1679, 203, -151, 387, 250, 563, 203, + 443, -168, 82, 61, 1604, -1878, 229, -82, + 208, 2965, 1093, 251, 1592, -432, -532, 153, + 407, 157, 191, -216, 52, -58, 935, -2161, + -409, -513, 977, -113, 3247, -1207, -743, -1178, + 136, 206, 184, -885, -64, 16, -23, -24, + 731, 1769, -941, 1543, -2386, -669, -958, 233, + 105, -1124, 948, 97, -1949, 59, -152, -65, + 114, 82, 387, -1908, -492, 129, -624, 93, + 658, -753, 1032, 2480, -1776, 360, -38, 1924, + 168, -12, -10, -128, -1712, -446, 939, 465, + 605, -586, -299, -393, 3878, 111, -379, 146, + 186, -50, -279, -30, -3, 35, -1941, 360, + -79, -111, -4287, -6, 671, -214, -792, 277, + 77, 58, 8, 16, 133, 161, 21, 33, + 1535, -296, -2668, -3198, -28, -386, 1156, 144, + -201, 256, -411, 298, 67, 670, 11, -227, + -4, -104, 12, -1000, 1192, 860, 813, 360, + 25, 93, 792, -350, 81, 4046, -178, 122, + 332, 28, -112, -8, 288, 539, -17, -63, + 8, 231, 55, -514, 105, -344, 252, -153, + 59, -10, -21, 51, 6793, 45, 259, 384, + 209, -2010, 311, -769, -1957, 2791, -463, -293, + -218, 1026, 897, -798, 47, -525, 31, -42, + 2018, -2767, 1658, 685, -1947, 46, -1468, 340, + -272, 318, 21, -421, -396, 244, -51, 290, + 45, 3, -1530, 1359, -3681, 1487, -1689, 209, + 438, -785, -220, 2, -55, -483, -35, 40, + 6, 189, -200, 2, -2026, -1747, 838, -880, + 1128, -3108, 184, -671, -261, 8, 296, -130, + -78, -268, -100, 18, -105, -9, 448, 3184, + -570, 656, -376, -969, 1682, 2635, -277, 577, + 217, 281, 219, -351, 31, 64, 101, 82, + 957, -1885, 774, -3536, -168, -431, -106, -479, + 1041, -103, 774, -142, 894, -724, -94, -766, + -58, 112, 2028, 566, -346, -139, -2671, -1907, + 1039, 189, -33, 1690, 263, -514, -225, -237, + 145, -319, 38, 116, 2891, -77, -2065, 2559, + -327, -763, 86, -172, -283, -147, 137, 245, + -333, 220, 92, 194, -176, 105, 3108, 329, + -372, -1188, 670, 773, -235, 34, -146, 876, + -259, -1580, 876, 105, 582, 259, -63, -99, + -1558, 1122, -1541, -438, 227, 1221, -1297, -746, + 2698, -29, 1169, 995, -2, 201, 392, -405, + -22, -36, 757, -4039, 725, 1960, 1478, -107, + 67, -367, -97, -88, 154, -80, 0, -265, + -163, 14, -109, 33, 597, 115, 543, 468, + -757, 826, 509, -176, -305, -4959, -118, -464, + -421, -72, 1, -187, 123, -88, -1086, 26, + 368, 610, 3394, -337, 364, 2594, 491, 759, + -309, 395, 152, 338, 249, 303, -122, 63, + 1019, -864, 1546, 196, 75, -633, -93, -631, + 777, -74, 1235, -745, 377, 3113, -174, -282, + -24, 89, -920, 2124, 620, 566, 1290, 2977, + 1180, 278, 188, 750, 981, -357, 80, 69, + 77, -151, 150, -15, 834, -893, 818, 1655, + -500, 237, 133, 243, 405, 239, 16, -152, + -70, -3692, -110, 145, 58, -57, -2527, 3072, + 2226, 218, -824, 384, -96, 119, -228, -194, + 136, 111, -251, -109, -179, -34, 143, 109, + 1157, -216, -1429, -702, 323, -1199, -60, 632, + -585, -340, 1040, 471, -32, -380, 3432, 455, + -138, -39, -2416, 652, -253, 145, 281, 393, + -671, 2841, -1616, -46, -385, -1417, -273, -168, + 318, -263, -2, -69, -638, -137, -2668, -359, + -86, 79, -777, -404, -560, -3533, 122, -113, + 617, 497, 117, -268, 110, 73, 752, -1105, + -521, 762, 695, -587, -147, -1235, 1866, -2250, + -671, -511, -2178, -820, -619, 162, -37, 102, + -342, -278, 6837, -278, 185, 10, 361, -52, + -171, 246, 184, -175, 19, 166, -48, -41, + 92, -152, -1227, -983, -3985, -703, 1143, 204, + -523, 1053, -623, 1002, 231, 53, -277, -409, + -67, -56, -90, -47, 448, 754, 554, 972, + 505, -331, 4946, -193, 89, 530, -24, -172, + 254, 244, 140, -10, 40, -77, 1655, -438, + -2776, 51, -553, 592, -2902, 280, 804, 776, + 131, 69, -207, 131, 7, 209, 93, -19, + -1148, -733, 2674, -1628, -1243, -506, -2346, -857, + -1028, 666, 365, -353, 105, 120, 210, -85, + 37, -40, 1027, 11, 1234, -5, -1976, 515, + 289, 3815, -142, -188, -248, -273, -265, 593, + 205, 164, -65, 70, -992, 1586, 2130, 779, + 92, -3067, 421, 1, 1172, 496, -917, -760, + 169, -64, 14, -40, -247, -95, 1769, -145, + 712, -794, -571, 240, -1774, -38, -129, -836, + 3372, 887, -451, 73, -107, 182, 100, 14, + -703, 2559, 490, -839, -333, 134, 804, -3549, + 50, -199, -215, -370, 453, -86, 151, -98, + -58, 128, -2624, -1507, -1623, -2186, -89, -55, + -472, -667, 2, -439, -1453, -262, 565, 56, + -118, 288, -56, 87, -398, 729, 40, -6015, + 219, -212, 287, -250, -211, -29, -61, -55, + -120, -92, 30, 129, -122, 111, 2037, 1260, + 943, -252, -13, -794, -2570, -1117, 297, 374, + -1629, -1, -407, -597, -324, -179, 408, 58, + -902, -1672, 611, -198, -61, 103, 366, 915, + 811, -280, -401, -3849, -111, 221, 353, 232, + 4, -18, 673, 1792, -2350, 132, 1979, -2318, + -417, -689, 326, 768, -377, -522, 373, -389, + -105, -103, 33, -48, 1497, 1125, 1893, -2744, + -1219, 921, 472, -165, -438, -129, -682, -783, + -685, 167, -715, 156, 64, 61, 1147, -892, + -72, 579, 1191, -2759, 1831, 1895, 663, 816, + -98, -61, -223, -366, -429, 31, -129, -121, + -255, 1804, 138, 180, -1063, 598, 763, 720, + 385, -526, 143, 80, 168, 976, -714, 236, + -3204, 93, 874, 238, -359, 1595, 191, 568, + -182, 20, -608, -288, 602, -224, 3874, -308, + -70, -826, -109, -42, -882, -1421, -1603, 625, + -1206, 31, 782, -106, -700, -246, -571, -124, + -848, -390, -523, -2903, -9, 39, -109, -199, + 497, -11, 377, 5, 25, -115, -61, 283, + 27, -131, -193, 280, 178, -5439, 44, -52, + -1210, -617, -162, -1097, -3, 748, -45, -1197, + -1058, 909, 1607, 693, 42, -749, -3001, 407, + -62, 45, 214, -312, -1054, 498, 1291, 1189, + -1268, 1083, -757, -319, -2796, -716, 310, 1583, + -608, 319, -84, -119, -1415, -602, 628, 463, + -1213, -794, -474, 2682, 931, 240, 2491, 76, + -234, -161, -690, 359, 28, -19, -774, -1023, + 738, 675, 248, 52, -348, -545, -2715, -599, + -252, 660, -387, -104, 2316, 456, -90, 100, +}; + +static const int16_t cb4440sm0[] = { + -6448, -59, 298, -659, -59, 329, -569, 397, + -224, 128, -216, 153, -100, 319, -53, -90, + 50, 3313, 4, -215, 405, -256, 78, 2890, + -187, -969, 195, -1022, -119, 214, 254, -360, + -222, 39, 2139, 91, -290, 529, -73, -16, + -318, 128, -348, 565, -1190, 202, -185, -234, + 3498, 48, 68, -1917, 1694, 212, -477, 239, + -3301, -489, 424, 418, -82, -61, 599, 1530, + -200, -252, 162, -243, 43, -534, -2695, 255, + 317, 489, 279, 3337, 246, -349, -149, -128, + -146, 256, -455, 137, -75, 836, 209, -349, + 3494, 255, -1948, -732, 367, 1373, -211, 608, + 345, -17, 43, 102, 19, -219, 173, -2361, + 130, -862, 637, -103, -589, 219, -1261, -238, + -2528, 1643, -1587, -690, -166, 7, -57, 1221, + 326, 103, -830, 608, 196, -3705, 1103, 568, + -1602, 543, -153, -416, 74, 185, 156, 34, + 1329, -798, -214, -515, 121, -797, 749, 346, + 629, -609, -877, -60, 184, -157, 250, 193, + 4385, 369, -181, -191, -308, -314, -395, -173, + -88, -388, -43, 46, 9, -167, 189, -192, + 6086, -226, -1795, 126, -941, -423, 397, 380, + 461, 319, 364, -194, 433, 1214, -3715, -274, + 9, -327, 212, -375, 130, -917, -63, 1120, + -651, -211, 149, -1128, 265, -73, -4630, 493, + -83, -20, -314, -91, 910, -109, -3, -417, + -109, 374, 357, -2773, 253, -234, -306, -3060, + -762, 53, 476, -299, -89, -2440, -658, -83, + -854, 3770, 374, 552, 450, 51, 346, 887, + -463, 189, 254, 182, 15, -37, -3263, 2594, + -647, -83, 404, 770, 691, -654, -301, 81, + -13, 742, 371, 54, 31, -83, -59, 4196, + 653, 256, -1075, -539, 1084, -1077, 1238, 259, + 20, -191, 854, 179, -47, -1025, -189, 281, + 2556, 1765, 106, -79, 320, -3066, 228, -500, + 1, -183, -46, 220, -233, -50, -98, -261, + -84, -25, -4378, -428, -1395, -582, -619, 443, + -1456, 375, 144, -32, 356, -454, 28, 136, + 5, 247, -1057, 709, -362, 293, 3084, 545, + -2804, -625, 16, -228, -238, 164, -201, -114, + -149, 58, -74, 203, 271, 462, 1037, 159, + -1652, -591, -846, -166, -3272, 710, 773, 824, + -1138, 630, -14, 209, 348, 1476, 322, -371, + 241, 4133, -877, -476, -391, 602, 1259, -1204, + 352, 90, -473, 43, -152, -439, -131, -217, + -1559, -5029, -186, -239, -44, 750, 33, -167, + -211, -67, -91, -143, 124, 32, -16, 8192, + 68, -102, 163, -31, 458, 38, 249, 21, + 157, -63, 36, 49, -22, 89, 9, 153, + 46, 60, -146, -13, -7506, -104, 101, -141, + 25, 165, -84, 219, 53, -182, -94, 46, + -1314, -371, -298, -527, 6, -1955, 52, -714, + -461, 174, 1450, -298, 107, 2965, 250, -65, + 46, -171, 296, -785, -784, 35, 36, 29, + 915, -891, -391, 168, 509, 3763, -1267, -138, + 132, 424, -53, -669, -1491, -927, 712, -638, + -440, -299, 522, 1593, 445, 3234, 547, 498, + 440, 145, -135, -188, -296, 1080, 468, 77, + 176, -315, 221, 4784, -666, 274, 762, -42, + 218, -86, -273, 116, 814, -21, 402, -266, + -392, -425, 1126, -68, 142, 357, 5143, 363, + -224, -198, 115, -221, -262, -736, -2774, -196, + -208, -613, 163, 696, 789, 132, 114, 121, + -3138, 164, 172, -189, 232, 53, 310, -50, + -407, 1207, -474, 249, -806, 21, 20, 72, + -534, 101, -47, -223, -4568, -128, -29, -910, + -254, 105, 3163, -119, -135, 1745, 1744, 1105, + 291, -333, -278, -441, 660, 141, -291, 314, + 149, 142, -121, -7878, -240, -204, 189, 376, + 3, -129, 59, 46, 170, 82, -150, -34, + 67, -110, 635, 148, 256, -2939, 157, -509, + 1439, -2470, 794, -298, 407, 980, 805, 349, + 208, -35, 1009, 1180, -114, 776, -339, -776, + 250, 1951, -557, 172, -395, 795, -3075, -348, + -106, 122, -47, -9, 55, 40, 3002, 421, + 538, -1, -277, -3062, -15, 168, 461, 521, + -525, 413, -196, 159, -3314, -85, 983, 565, + -3113, 38, 79, -172, 20, -228, -520, 346, + 47, 485, -177, 51, 175, 444, 3475, -3416, + -81, 118, 264, -162, 20, -192, -219, -111, + -57, -225, 159, -218, 117, -28, -150, -1100, + -681, 444, -54, -11, -4669, -216, -1151, 858, + 168, -39, 52, 387, 74, -39, -154, 2767, + 307, -132, 531, 175, 906, 14, -129, 49, + -3389, 476, -127, -329, 479, 118, -85, 209, + 4, 227, 154, -2, -238, 263, -24, 553, + -231, 78, 2, -183, 31, 5933, 117, 86, + 386, 359, 153, 101, -784, -553, -13, 256, + -347, -1311, -936, -64, 1718, -444, 168, -590, + -3252, -194, -243, -269, 2096, -994, -1081, 309, + 1003, 290, -66, 306, -3239, -25, 700, 365, + -770, 144, 4, 259, -185, 1493, -158, 726, + -3180, -1683, -119, 45, -493, -205, -1728, -1226, + -235, -87, -88, -87, 1966, 8, 142, 496, + 239, 828, 30, -517, 3150, 2266, 402, -315, + 74, -312, -414, -16, 458, 381, 376, 1287, + 1093, -410, -967, 80, 382, -106, 4419, 445, + 293, -283, 282, 324, -80, -25, 115, -1667, + -756, 1893, -2772, 395, 3, -349, 138, 1094, + 406, 432, 214, -1328, 632, -132, -100, 135, + 1627, 1062, 1026, -1341, 24, -3352, -173, 1265, + 861, -821, -87, -367, 278, 151, -101, -32, + 161, 387, 5778, -564, 492, 83, 324, 29, + -423, 91, -132, 190, -310, -457, -62, -99, + 171, -214, -159, -2500, -693, -1538, -311, -784, + -2422, -498, 1781, 342, -467, -78, 466, -252, + 241, 197, 186, -1039, -190, 346, -1881, -240, + -65, 1438, 1001, -3009, -52, 221, -490, 1224, + -63, -39, 53, 169, 130, 86, -56, -90, + 116, 4, 7098, -5, 61, -172, -65, 160, + -94, -30, -111, 270, -653, 521, -426, 1084, + -1169, -1158, 584, -2499, 2494, -321, 695, 823, + -429, 35, 529, -280, -45, -286, 2997, 207, + -633, -2207, 1708, -298, -413, 673, -1017, 292, + 493, 76, -136, -365, -65, 266, 852, 512, + 791, -129, 1364, -1065, 1371, 383, -524, 505, + 943, 147, 229, 39, -2969, 70, -295, 66, + 2759, -16, -435, -474, -1058, 762, 54, -257, + 560, -3167, -572, -418, -478, 370, 72, -20, + 296, 54, -2683, 550, -15, -155, 2146, -143, + -1144, 463, -117, -1690, -1917, 42, 249, -278, + -319, -513, 544, -2033, -317, -1955, -2646, 1345, + 759, 268, 207, 1243, 256, -32, -45, -750, + -211, -184, 2397, 473, 2572, -489, 260, 389, + -237, 602, -463, 569, 1673, -176, -227, 964, + 203, 130, -269, -190, 1339, -978, 973, 1986, + 1145, 1258, 272, 1779, -436, -1306, 652, 807, + 574, 1401, 53, -183, 1612, -828, -3094, -82, + 1061, 1042, -200, -891, -126, 181, -1324, 549, + 555, -4, -868, 79, 157, -1533, 18, 230, + -1096, -335, -669, -166, 1853, -310, -340, 249, + -954, -594, -2929, 415, 5, 135, -1315, -237, + 1868, 787, 1912, -1100, 1139, -1103, -217, -382, + -654, 2078, 528, 133, -115, -56, -41, -207, + 69, 461, 465, -396, 1725, 1306, -443, -720, + -1600, 1176, 652, -997, -306, -1040, 2258, -75, +}; + +static const int16_t cb4440sm1[] = { + 8192, 96, 214, -395, -106, 291, -401, 305, + -102, 194, -73, 31, 71, -19, -349, 65, + -183, 26, -21, 8154, 107, -136, -37, -35, + 85, 127, -202, 43, -195, 225, -51, -69, + -57, -107, 141, -120, -284, -227, 28, 680, + 218, 29, -1800, 488, -207, -453, -99, -3680, + -210, 39, 279, 1406, 278, -37, -1596, 232, + 376, 90, 234, -3348, 242, 1765, 555, -883, + 118, 115, 48, -116, 2166, -292, 136, 527, + -236, -18, 411, -20, -190, -480, 665, 3332, + 378, -287, 337, 199, -5, -3904, 311, -297, + -2720, -193, -17, 911, -224, 457, -48, 254, + 271, -24, -77, 165, 23, 182, -1122, 122, + -520, 309, -3604, -1013, -405, -647, -145, -1162, + 1019, -190, -278, 69, 362, -185, -78, -245, + 472, 670, -493, 620, 76, 717, -2296, -111, + -454, 3224, 27, 47, -351, -154, -293, 187, + -93, 96, 87, -453, -132, 9, 125, -209, + -26, 284, -552, 255, 87, 227, -5445, 112, + 172, -15, -448, 475, -5747, 367, 149, -228, + -797, 371, 67, -102, -118, -418, 332, 38, + -100, 90, -183, -3302, 15, -1049, -1560, 1299, + -710, 1257, 698, 316, -283, 955, 240, 182, + 269, 12, -37, 1817, 649, -1273, -2071, -1719, + -765, 977, -1159, 351, -1583, -85, -771, -215, + 123, 314, -158, 32, 560, 208, 265, -451, + -413, 32, 1954, -3598, -1680, -832, -646, 761, + 272, 394, 213, -35, -44, 343, 309, 244, + 3041, -399, -50, -126, -2755, -146, 243, -367, + -600, -166, -832, -537, 269, -48, 2419, -526, + -309, -17, -235, 73, 341, 351, -840, 3241, + -94, -432, 404, -588, 158, -127, -49, 3259, + 3543, 134, -256, -106, 622, -45, -170, -109, + 68, 377, -84, 210, -250, -267, 257, -77, + 6, -1109, -1498, -327, 1063, 992, 632, -245, + -656, -1100, -60, -456, -170, 3208, -6, 13, + -95, 606, -594, -2039, -369, -1743, 275, -93, + 117, 2828, -138, -108, 206, 1819, 98, -45, + 45, -163, 2962, -398, 3536, -183, -259, -581, + 65, -498, -288, -357, -339, -13, -71, -409, + 36, -15, -545, 1433, 135, -220, 99, 752, + 177, -455, -251, 1172, -1274, 1062, -774, -999, + -63, -2756, 99, -86, 4695, -171, -129, -856, + 26, -543, 610, -1350, -2, 271, 455, -150, + 358, 101, 536, 125, 101, 88, -16, -12, + 488, -7479, 110, 264, 140, -302, 110, 232, + 0, 15, 70, -28, -27, -110, -99, 201, + 78, 215, -108, -267, -7548, 34, 312, -86, + 197, 125, 80, -75, -117, -2, 128, -207, + -131, -513, 614, 33, -4844, -302, -323, 160, + 808, 645, 243, -603, 68, -70, 158, -131, + -212, -34, -247, 625, 134, -42, 525, -89, + 31, 116, -1, 508, 5021, 395, 111, -86, + -172, 1433, -114, -126, -148, -337, -260, 233, + -479, 275, -247, -5672, 386, -110, -99, -142, + -171, -154, -358, 30, 1028, -78, 575, 523, + -586, -739, 1586, 1076, -2519, 1572, -1448, -201, + 166, -54, 137, 1268, 1157, -411, -2905, 195, + 489, -740, 154, 522, 2276, -604, 194, -1112, + 192, 400, -271, 250, 413, 273, 158, -299, + -874, -228, -2454, 162, 819, 457, 3401, 689, + -208, -298, -461, -360, -70, -2133, -114, -124, + 81, -228, 625, 3525, 909, 254, -234, 1316, + -773, 531, -30, -16, -164, -84, 2360, -1900, + 351, -2979, 545, 653, 416, 273, -79, -825, + -107, 71, 495, 223, -176, 129, 40, 424, + 1627, 207, 47, -8, -273, -715, 60, -1253, + 1501, -1199, -248, 39, 2859, -432, 89, 299, + 948, -2608, -896, 3468, 84, 511, 55, 151, + 733, 270, -354, 470, -219, -115, -105, 91, + -259, 1941, 775, 12, 2764, 484, 557, 2288, + -118, 294, -32, 719, -62, -64, -295, -82, + -145, -285, -492, 87, -135, -98, 194, -288, + -8, 263, -475, -53, -388, 5621, 41, -28, + 34, -323, 138, 1935, -1806, -185, 340, 1380, + 48, -542, -2965, -339, 88, 554, 41, 4, + -151, 182, -39, -193, -3355, -312, 3106, -203, + 442, -110, 317, -269, 225, 31, -62, -277, + 163, -766, -408, 210, -58, 128, 161, 3308, + 3321, -138, -278, -149, 216, 134, -253, -135, + -154, -123, 254, 200, -2, 133, -307, -6253, + 310, -6, 959, 26, 191, 315, 528, -75, + -230, -203, 153, -265, -94, -61, -2, 2761, + -4623, -353, -19, 102, -139, 54, 438, 267, + -73, 447, 226, 71, -19, 75, -40, -32, + -850, -500, 422, 1237, -688, 357, -3158, -468, + -450, -279, -694, -1109, 734, -1602, -117, 122, + 261, 979, -20, 385, -2929, 342, -3164, -146, + 252, -104, 62, 469, 289, 249, -214, -38, + 73, 83, -7, 18, -394, -5, -140, -267, + 331, -147, 6540, 395, -103, -147, -271, -20, + 191, 73, -155, 197, 71, 503, 19, 138, + -129, 335, 209, 75, -6207, 140, -176, -5, + 35, -40, -61, -146, 1080, 58, 327, -49, + -842, 1431, 595, 3461, 1, 142, 2001, 297, + -16, -425, 1156, -101, -54, 1060, -222, -295, + 938, -1212, -2374, 73, -272, -3318, -8, -718, + 114, -154, 85, -9, 72, 86, -1330, 226, + -1414, -521, 3161, -1856, 133, 240, -499, -371, + -745, 779, -463, -506, 463, -229, -226, 389, + 135, -4137, 360, 735, -318, 777, 593, 977, + -174, 286, 187, -95, -1626, 245, 97, 9, + 277, 299, 1568, 1066, 375, 1342, -390, 884, + 271, 185, -258, -1100, 2113, -107, -447, -1917, + -58, -29, 1081, -455, -524, -196, 1869, -677, + -3564, 1443, 29, -425, -28, -370, -342, -28, + 30, -118, 58, 607, 454, 45, -120, 232, + 20, 21, -175, -112, -236, 492, 411, 42, + -42, 4041, 39, -2579, 235, -146, 122, 24, + 1301, 123, -461, -3264, 316, -88, -209, 140, + 387, -430, 78, 508, 149, -3588, 1107, 820, + -140, 654, 812, -566, -2578, -403, -72, 120, + 355, -136, -121, 209, 240, 116, 231, 1630, + 208, -178, -3160, 2203, -52, 451, 84, -310, + -1199, 596, 69, 285, 242, 15, 49, 341, + -154, -2286, 1206, -109, 1048, -647, 1127, 98, + -1264, -808, 1744, -1597, 13, 26, -216, 263, + 3276, 3192, -105, -390, -31, 676, 73, 265, + 31, 101, 479, -69, 123, -24, -49, 32, + -653, 2253, 49, -346, 1476, 1820, 396, 639, + -219, 792, 1728, 147, -765, -140, 1181, 98, + 153, -98, -755, 2473, 452, 231, 2031, 2468, + -416, 587, 724, 148, 500, -933, -229, 55, + 102, 74, -164, 652, -425, 100, -2684, 1358, + 1626, -350, 544, -301, -1589, -305, -1266, 11, + 243, -125, -330, 294, 1471, -2922, 1581, -546, + 582, 231, -1407, -877, 602, 219, 350, 1130, + -86, 214, -56, 201, -181, -2140, 1108, 493, + 456, -542, -113, -852, 1647, 1897, 840, -1178, + -369, 788, 488, 256, 366, 2298, 1167, -205, + 256, 585, -555, 292, 2615, 748, -247, -1102, + -1682, 226, 415, 20, 27, 100, 9, 436, + -1746, 2621, 1583, -211, -833, 441, 54, -1183, + -826, -916, -707, 564, -232, -14, 147, 453, + 70, 1094, -903, -337, 450, -1546, -662, -1047, + -2345, -811, -1037, 96, 560, 1381, -119, -383, +}; + +static const int16_t cb4448sl0[] = { + -3850, -1289, -449, -36, -1178, -1175, 705, -97, + 37, -650, 426, -477, -145, 124, 6, 207, + -96, -3145, 2917, -260, 349, 668, -72, 6, + 157, -62, -128, 20, -82, -1357, -707, -619, + -313, -229, 3010, -169, -27, 738, 971, -1450, + 246, 154, -163, -15, -93, 5, -35, -42, + 24, 31, -25, 6803, 33, -32, -68, -68, + -44, 317, 43, -106, 608, -999, -699, 582, + 46, 1631, 830, -1570, -2645, 992, 2126, 132, + 2377, 1551, 247, -247, 1508, -34, 162, -275, + -81, -654, -625, 125, -33, -210, 309, 900, + 571, 726, 2691, 2821, -698, 60, 46, -483, + 14, -210, -295, 102, 214, 226, 2622, -82, + -390, 1436, 107, 554, 381, 1307, 2283, -190, + 27, -35, 5557, 283, 103, 180, 104, -89, + -186, -319, -225, -141, 92, 1, -1942, 1025, + 906, 32, -3, -1089, 182, -799, 483, -368, + -1734, -103, 1680, 474, -133, -1067, -545, -219, + -118, -635, -2559, 1002, 2554, -640, -505, 179, + -344, -81, 107, -61, 79, -12, -29, -37, + -7574, -92, 64, 92, -164, -20, -61, -35, + -312, -159, 333, -3401, -2596, -344, 88, 604, + 535, -87, 365, -13, -77, 131, 127, 588, + 302, -94, -506, 2427, 99, 304, 2653, -1104, + 1380, 976, -530, -120, -105, 293, 9, -826, + 388, -66, 421, -202, 605, 675, 4060, 978, + 143, -94, 21, -2444, -30, 554, 695, 2878, + 657, -104, -435, -326, 307, 20, 20, 159, + 106, -3473, 326, -1029, -304, 670, -2109, -431, + 573, 704, 293, -45, -169, -119, -191, 599, + -910, 1976, -165, 581, 1209, -1689, 2365, -370, + -601, -696, 374, 202, -114, -61, 3, -63, + 30, 369, -158, -128, 198, 52, -98, -44, + -323, -5118, -1100, -669, 2256, 32, -66, 206, + 65, 2801, 783, -470, -973, 471, -211, -27, + 1879, 302, -388, -249, 301, 537, 2761, 321, + 571, 20, 337, 1336, 522, 231, 368, -363, + -2065, -57, -2565, -584, -611, 56, 814, -382, + 1671, 408, 492, 12, 1201, 1513, 247, 2165, + -592, -1246, -493, -1012, -1330, 1251, 75, -100, + 182, 52, -47, 710, -1137, 2420, -559, 266, + -801, 2523, 1229, 736, -409, -49, 269, -174, + -179, -24, 348, -661, 251, -1039, 2647, 283, + 728, -1850, -2088, 196, 39, -72, -35, -94, + -540, 266, 340, -450, 763, -5, 113, 2618, + -2737, 1047, -246, -522, -182, 376, 1068, 203, + 1238, -938, 211, -308, -395, -629, 596, -2634, + 1452, -1155, 83, -89, -3121, 419, 40, 2691, + -306, -343, 4, -347, -725, -117, -315, 115, + -215, 26, 429, 1074, -1831, -1850, 2609, 72, + 467, 191, 432, 857, -186, 0, -443, -24, + 500, 541, 30, 2324, -1160, -1153, 1783, 1282, + -1992, 101, -108, -108, 556, -2012, 506, 691, + -65, -610, 402, 610, 1941, -121, 942, 589, + 1879, 58, 312, -2218, -2056, -2284, -350, -453, + 306, 38, -579, -185, -101, -196, -150, 156, + 126, -44, -143, -7923, 126, -120, -138, -233, + 97, -20, -121, -175, -8, -13, -123, -365, + 251, 730, 2883, 667, -418, -208, 2170, -1442, + 196, -389, -516, 252, -98, 525, -1819, -647, + 1575, 768, 1124, -428, -1010, -2027, 411, -473, + 863, 210, 908, 40, 145, 37, 192, 189, + 52, -217, -168, 63, -7, -53, -121, 13, + -145, 0, -37, 61, -7979, -142, 32, 118, + 190, -7, -13, 113, 36, 31, 1461, -2088, + 2391, -939, -66, 822, 280, 246, -157, -183, + -433, -356, 88, -101, 3969, -3388, -84, 84, + 130, 35, 74, 37, 181, -195, 219, -29, + -23, -32, 69, 625, 2328, -192, -2617, 287, + 543, -1604, 823, -547, -277, 764, 276, 156, + 198, 17, 84, 346, -27, -129, 143, 217, + 212, -249, 20, 6449, 7, 51, -889, -88, + 265, 282, -1956, 1327, -1025, 1338, -1709, -1008, + 372, 57, 1404, 234, 2621, -18, 663, 301, + 0, 167, -372, -2534, 1945, -191, 198, 359, + -43, 92, 24, -5498, -63, 189, 36, -369, + 352, 381, -205, -144, -119, -267, -60, -10, + 387, 2388, -155, -450, 465, 1529, -216, 2673, + -146, 118, 50, 290, 147, 11, -2912, 863, + 2184, -689, -44, 59, -663, 663, 675, 295, + 1331, -115, -10, -54, -1, 31, 1699, 127, + 215, 2966, 163, 416, -1053, 1216, 356, 1428, + -166, -172, -2, -355, -169, -331, -94, -78, + -123, 4875, 311, 67, 1145, 397, -288, 212, + -344, -290, 126, 16, 176, 485, 551, -526, + 11, 120, -274, 83, -5399, -154, -1611, 887, + 321, -446, 1166, -333, 652, 310, -895, 62, + -219, 2840, -753, -34, -3203, -3600, 464, -249, + 336, 297, -85, 316, 144, 306, -249, 149, + 112, 73, 192, -89, 18, 197, 116, 51, + 37, 212, -7248, 163, 31, -52, -31, -101, + -1366, -353, -325, -1335, -440, 1193, 670, -2635, + 872, 1400, 733, 395, 122, 130, -4146, 0, + -382, 1486, 308, 1179, -412, 288, 701, 161, + 147, 959, 60, 77, -123, 17, 193, 204, + -226, 388, 272, -588, -157, 2823, 735, -745, + 2368, 359, -1088, -2004, -1293, 2018, 483, 320, + -1014, -806, -479, -68, -51, 168, 873, 27, + -7906, 57, 19, -23, 27, 43, -13, -50, + 93, 16, 29, 31, -26, 32, -22, 453, + 2922, -2560, 138, 923, -1245, -405, 10, 228, + -270, 145, -192, 83, 48, 101, 77, -226, + 36, 7792, 126, -275, -37, -36, 9, 45, + -89, 13, 148, 125, 24, -442, 111, -12, + 540, 1794, 3008, 1620, -185, -1394, -161, -25, + -313, -317, 591, 2507, 134, -369, 77, 527, + -619, -236, 2681, 87, -1060, -34, 1894, -1123, + 373, -628, 1934, -1279, -1689, -609, -472, -598, + 405, 229, 414, 12, -2923, -33, -435, -49, + 2380, -34, -344, -2171, -284, 274, 226, -287, + -84, -57, -1, -169, -50, 479, 707, -2774, + -532, -640, -244, 44, 458, 2519, -590, -472, +}; + +static const int16_t cb4448sl1[] = { + -2878, -714, 3098, -76, -51, 232, 118, -780, + -691, -267, -309, 105, -179, -5, -84, -11, + -120, -379, 458, -3161, 65, 2994, 64, 374, + -440, 62, -183, 28, -561, 73, 59, -2565, + 445, -451, -1026, 437, 10, -173, 1243, -2278, + -481, -395, -154, -2402, 945, -2789, 117, -1184, + 75, -704, 527, 478, -589, 17, 131, -110, + 574, -1055, -628, -277, 2798, 1483, -657, -1996, + -248, 194, -284, 822, 225, -170, -10, -302, + -427, -1700, -90, 2756, 2124, -49, -964, 372, + -637, 443, 13, -69, -71, 196, -1971, 110, + 1147, 698, 1333, 1369, 527, 165, 903, 577, + -2134, 56, -33, 34, 183, 247, -342, 974, + 1079, 2478, -26, 80, -2377, 430, -1422, 428, + -2187, -469, -1280, -326, -40, 188, 911, 405, + 2772, 279, -493, 265, 768, 45, 5778, 44, + 121, -257, -135, 124, 263, 15, 197, -114, + 5, -14, -8, -82, 3989, -511, 197, 2446, + -292, -205, -919, 162, -121, 145, -40, 71, + -105, 72, 2035, 960, -145, -467, -518, 167, + -2988, 421, 860, 320, 40, -446, 319, 160, + 140, 511, -55, 213, -148, -527, -666, 687, + 9, 23, 344, -156, -4646, -125, -220, 9, + 134, -25, 16, -1319, 763, 58, -1586, -438, + 301, -411, -337, -3398, 358, -68, -111, 5483, + -36, -456, -94, -116, 204, 95, 84, -73, + -163, 69, -190, 64, -3716, -326, 1815, -843, + 312, -498, 684, -641, -766, -104, 606, 70, + 2630, 51, -170, -3584, 167, 461, -162, 132, + 496, 91, 171, 255, 48, 2, -120, -1196, + 534, -431, 2669, -403, 8, 287, -391, 2557, + 849, 167, -275, -184, 605, -3570, 113, 22, + -2586, 668, 294, -910, 67, -141, 0, 418, + 271, 75, 90, -124, 446, -142, -635, 631, + -956, 1566, 25, -1982, 790, 2770, 33, -520, + 23, -7488, 67, -73, 60, 64, -46, -36, + 76, 3, 22, 149, 61, 34, 255, -380, + -284, -2531, -1423, 1507, -926, -1074, -929, -1430, + -141, 165, -80, -268, 21, -767, 1542, 3197, + -191, 2014, -304, 595, 536, -906, -126, -354, + -76, -162, -125, -3139, 3197, 934, 366, -923, + -330, 277, -284, -163, -12, 402, 15, -146, + 20, 83, 111, 196, 23, 71, 77, 7287, + -175, -13, -227, -59, -56, -28, 1, 163, + -50, 59, 635, 150, 95, 2750, 775, -2057, + 423, -1078, 1749, -3, -655, -365, -357, 145, + -76, 5, -93, 224, 150, 108, -34, 173, + 148, -371, 34, 48, -8037, 65, 50, 103, + -42, -10, -96, -90, -3, 60, 92, -79, + -76, 386, 114, -1947, 833, -1279, -484, 217, + 3156, 226, 485, 1191, 425, 88, -59, -243, + 2292, 1681, 671, 62, 899, -2453, -100, 1039, + 713, -104, 554, 219, 356, 963, 741, -102, + 455, 2067, -324, 172, 28, 772, 752, -2351, + -1438, -865, -1668, 105, 1034, 1195, 14, -350, + -425, -648, 2086, -532, 634, 1537, -33, -598, + 2888, -85, 184, 158, -164, 3339, 237, -284, + -54, -246, 46, -254, 365, 55, 1928, -346, + -357, 331, 139, 16, 674, -384, -67, -3399, + 165, 76, 215, 137, -3187, -146, -264, -165, + -3039, 235, -541, -630, -32, -33, -211, 160, + -121, -111, -1296, -47, -128, 292, -1523, 1540, + 771, -166, -509, 212, 2758, -327, -418, -305, + -9, 465, 2513, 195, -70, -209, -66, 127, + -147, -3161, -192, -541, -555, 131, -858, -1609, + 973, -156, -1877, 60, 1011, 66, -348, 912, + -1731, -1296, 305, -369, -560, 470, 46, -863, + -124, -37, 40, -395, -4886, -20, 221, 228, + 177, 182, 98, -151, -195, 854, -194, -374, + 301, 586, 58, -908, -19, -4198, -171, 330, + 48, -3312, -164, 1913, 1183, -42, 1287, -353, + 757, 620, -547, 251, -520, 59, 43, -179, + -191, -131, -2951, -944, -2479, 344, -813, 104, + -697, -44, -270, 198, 245, 2866, 208, 178, + -248, 38, 19, 577, 2812, -765, -855, -439, + -60, -30, -352, 1521, -1069, 457, 415, 572, + -749, -144, 100, 515, -794, -1554, 2507, -270, + 10, 62, 2507, -1550, -75, 70, 2530, 562, + 132, -141, 251, 156, 835, 102, 717, 3226, + 3327, 172, 84, -205, -11, 208, -310, 164, + -27, 11, 281, 37, -518, 20, -76, 82, + 5436, -543, -301, 112, 359, -140, -94, 78, + -18, 38, -196, -92, 13, -111, -23, 30, + -15, -94, 101, 142, -6455, 321, 322, 50, + -216, -321, -10, -465, 101, 45, -585, -969, + 1248, -456, -2523, -852, -2129, -889, 33, -1424, + 1462, 583, 749, 527, -1737, 1262, -594, 414, + -215, -1184, 412, 1758, -1836, 1248, 440, -178, + 784, 3591, -227, 43, -493, -766, -270, 150, + 151, -56, -110, -2832, -73, -166, 470, -179, + -681, 71, -114, -2743, -806, -560, 63, -244, + -90, 182, -143, 995, 404, -13, -1343, 1524, + -2472, 1718, -957, 1229, 458, -395, -2817, -579, + -99, 340, 1538, 684, -492, 1156, -45, -65, + -305, -1408, -325, -270, -358, -127, 92, -97, + 415, 85, -4749, 173, -296, -203, 331, 315, + 184, -46, 1315, -146, -55, 427, 37, 255, + -209, 272, 735, 506, 105, 103, 902, -3449, + 116, 2304, 616, -1564, 1508, 478, 320, -2418, + 244, -176, -32, 238, 92, 290, -168, -78, + -3464, 270, -1902, 2, 696, 92, -1610, -206, + -49, 178, 121, 27, 119, 72, -253, -398, + -2720, -81, -162, -550, 2595, 1445, 249, -104, + 218, -310, -95, 18, -473, 1908, 432, -227, + -168, -2725, -240, -1830, 199, 437, -1392, 304, + 1461, -2394, -603, -540, 769, 340, -104, 1569, + -21, 338, -874, 1533, 281, -59, 487, 2120, + 179, -140, -328, -57, 63, -110, -1330, -485, + -2427, 1159, 355, -26, -2055, 154, -563, -132, + 49, -329, -187, -24, -71, -3970, 276, 158, + 92, -202, 7, -422, -578, 186, -407, 4960, + -595, 1027, 417, 691, 69, 133, 123, -147, +}; + +static const int16_t cb4448ss0[] = { + -2680, 2499, -328, 2212, 1288, -57, -727, 76, + -210, -218, 41, -343, -26, -38, 43, 606, + -619, -531, -2082, 87, -1127, 1282, -23, 2272, + -1816, 104, -31, 85, -22, 60, 1293, 138, + 382, 432, 489, -372, -1649, -2809, -2556, -98, + -232, -233, 169, 186, 79, 1157, 2113, -942, + 636, 877, -601, 2277, 1411, 1165, 1029, -613, + -348, -38, -19, 45, 1318, -1980, 12, 2762, + 1519, 184, 1980, -49, -270, 361, -172, -601, + -196, 186, -67, -124, 1503, -1011, 263, 223, + -384, 153, -21, -1063, -239, 1171, -3501, 512, + -162, -180, 139, -680, 609, -1919, 2969, -2321, + -183, 194, -558, 26, 91, 340, -25, -31, + 127, 662, 182, 191, -2201, -2603, 2252, -523, + 277, 50, 355, 295, -65, 355, 207, 82, + -489, -143, -218, 89, 666, -359, 2716, -2310, + -1912, 417, 400, 43, 110, -93, -142, 61, + -3000, 454, -153, 0, -413, 469, 339, 318, + -197, 75, -80, 2894, -129, 82, 1431, 1183, + 429, -1556, -1339, -1573, -92, -911, -230, -12, + -4, -145, -388, -419, -5, -241, 7120, 165, + -125, -122, 126, -150, 109, -146, -61, -49, + 47, 70, -43, 40, 1867, 1473, -1278, 1229, + -2256, -90, 10, -744, 1196, -109, 402, 258, + 690, -74, 26, 1294, -1079, 142, -2384, -324, + -1696, -2741, 321, 66, 83, -127, -131, 156, + 166, 135, 1812, -3445, 10, 535, -547, 481, + -2243, 287, -335, 218, 195, -1, -25, -94, + 195, 1433, -1428, -1444, 520, 219, 3363, -388, + -807, -454, -29, 316, 125, 159, -144, -156, + -317, 752, 256, 216, 340, 488, 147, -5662, + 55, -110, 387, -102, -211, -66, -26, 3688, + -172, -2366, -244, -5, 353, 11, 503, 88, + 227, 69, -240, -187, -58, -389, -1783, -1427, + 20, -618, 544, -1337, 628, -3180, 708, -538, + -423, 115, 49, -161, 184, -682, -223, 689, + 1299, -891, -1073, -1228, -305, 47, -2221, -1559, + 598, -380, 166, 143, -366, 287, 2122, 509, + 629, 235, 1523, 2900, -640, -425, -462, -231, + -53, -27, -263, 2090, -1892, -1147, -42, 866, + -2301, 461, -1082, -625, -85, 148, 229, -25, + 85, 53, 259, -81, -4072, 2577, -12, -7, + 335, -151, -691, -137, 98, 372, -37, -192, + -17, 3318, -558, 2064, 396, 258, -1067, 229, + 1122, 298, -25, 40, 27, -134, -166, -247, + -2010, -440, 1066, -1400, -3454, -289, 428, 629, + -158, 126, 129, 183, -12, -171, -120, 421, + -445, 66, -900, 3680, 1583, 1985, 25, 229, + -535, -1, 45, 207, -54, -30, 1581, -938, + -703, 405, 878, -398, -1069, 1748, -2587, -1419, + -375, -441, -487, 109, 21, -1399, 648, -271, + -701, 635, 115, -138, -458, -600, -1891, 585, + 420, -1916, 1135, 7, 1584, 910, 4267, 1328, + 279, 395, -35, -99, -168, 503, 216, -126, + 211, 212, 193, -2205, 491, 696, 41, 283, + 649, -3425, -999, 200, 625, -261, -378, -47, + -15, -30, -1262, 1700, -2191, 196, -1773, -251, + 84, 498, -261, 150, 451, 41, 336, 27, + -56, 562, -86, -1, -1073, 1461, 2148, -2961, + -326, -257, 440, -42, -48, -320, 122, 94, + -1267, -830, 2810, -94, -201, 990, 2415, -740, + -166, -267, -157, 68, 301, 290, 65, 931, + 1969, -170, 6, 149, -272, -105, 542, -11, + -3888, 105, 305, 333, -14, -39, 1944, -1164, + 88, 3829, -1190, -535, -644, -330, 509, -93, + -314, -228, -294, -342, -26, 1143, -2371, -400, + 74, 101, -68, -583, -1091, 3367, 1146, -638, + -436, 136, 41, -92, 1518, 2818, -2214, -2044, + 636, -2, 79, -508, 676, -439, -358, -198, + -69, 271, 59, 1638, 468, 97, 264, -8, + -5152, -152, 152, 252, 401, -375, -17, -132, + 51, 63, 633, -180, 367, 111, -18, 15, + -52, 128, -54, 11, 96, -122, -26, -7257, + -42, -1221, -688, 197, -107, -217, 141, -289, + 141, 269, 439, -747, -3743, 2098, 226, 137, + 26, -1645, -1735, -80, 43, -216, 245, 544, + 157, 40, 238, 237, -989, 379, 88, 639, + -1335, 1542, 1147, -510, 1008, -134, -626, 696, + -3034, 334, -689, 115, -168, 39, 1750, -649, + -233, -99, -231, 515, 112, -11, -162, -133, + -138, -486, -4137, 204, -102, 867, -1030, 219, + -254, -2787, -128, 961, -2837, -482, -195, 691, + -170, -178, 164, -54, -2008, -116, 74, 398, + -96, -472, 407, 27, 287, 628, 97, -1425, + -3923, 6, 117, -1081, 930, 396, 452, 87, + -441, -155, -738, 1089, 2128, -3133, -21, -622, + -48, -127, 506, 985, -200, 3361, 184, -522, + 41, 503, 209, 14, -96, 791, 1263, 289, + -101, -1728, -1073, -517, 4156, -685, 214, -721, + -608, -102, -295, -114, 126, -340, 109, 88, + -1588, 82, -549, -376, 76, 84, -210, 59, + -130, 321, 678, 4704, 564, -1, 100, 325, + -296, 256, -936, -886, -1088, -191, 476, -3684, + 1359, 12, -397, -70, -17, 58, 569, 353, + 821, -77, 253, 153, 5697, -171, 181, 3, + -90, -413, -265, 142, 62, 959, 151, -103, + 845, -340, -280, -733, -592, -244, 2534, 3089, + 935, -393, -105, 145, -666, -2865, -1532, 717, + 2867, 206, -800, -125, -34, -189, -138, 42, + 189, -141, 107, -3030, -3795, -494, 108, -149, + 382, 760, -142, 337, -844, 228, 124, 232, + -23, -1, 2298, 750, 636, -353, 157, 676, + -191, 812, 3434, 759, 543, -17, -213, -95, + 316, -693, -604, -1059, 32, -496, -3334, -272, + -104, -495, -130, 627, -376, 74, -599, 55, + -2185, -968, 517, -343, 21, -249, -963, 268, + 3339, 239, 771, -134, 42, 231, 75, 1633, + 331, -125, -414, 457, -316, 111, -475, 363, + -687, -4105, 469, 443, 113, 72, 1498, 406, + 915, -229, 564, -377, 89, 137, 39, 2, + -29, -416, -149, 3598, -253, 12, -1015, 3016, + 916, -726, -2286, -99, -1085, -238, 690, -44, + -51, -115, 25, 56, -905, -3050, -1121, -24, + -2160, -1424, 1009, -180, -424, 188, -417, -66, + -86, 74, -28, -225, -937, -90, 251, -1850, + 1939, 1843, 833, -1879, -192, -318, 103, -363, + -22, -57, -2833, -118, -277, -98, -85, -495, + -874, 3027, -141, -1490, -172, -266, -32, 190, + -12, -364, -380, -2107, 249, -217, 662, -584, + 89, -563, 1153, -3091, -656, 463, 144, -26, +}; + +static const int16_t cb4448ss1[] = { + 6475, -60, 162, 42, -71, 50, -85, -278, + -14, -60, -53, 132, 28, -65, -71, -62, + 6, 119, 195, -140, 28, 37, -603, -4956, + -290, 700, -241, 11, -301, 297, -1009, 468, + 885, 192, 40, 495, 846, -28, 201, -255, + 927, -644, 2424, 2882, -82, -1764, 1077, 315, + 946, 843, 399, 176, 567, 546, 377, 283, + 2469, -1815, -65, 12, 422, -368, -639, -493, + -5606, 84, 122, 241, 267, -8, -257, -23, + -220, -118, 139, -1582, -218, -2436, 2539, -270, + 146, -262, -489, 1551, 604, -225, 363, 234, + -110, -166, 1058, 2342, 1950, 43, 2362, -1189, + 492, 172, -296, 159, -430, -311, -135, -182, + 77, -444, -1995, -855, 2080, -457, 389, 872, + 2549, 935, -128, 519, -374, 310, 96, 119, + -263, 1981, -1019, -628, 212, -173, -2292, 1066, + -1985, -426, 115, -746, 147, 3, 94, 195, + -1762, 1713, -337, 1884, -123, -480, 95, 777, + 1073, 2117, -969, 16, 11, 123, 374, -394, + -1419, 829, 1657, 1294, -2770, 286, 813, -290, + -115, 111, 312, 53, 44, 896, 34, -2288, + -3443, -2053, 98, 293, 429, -168, 74, -58, + 221, -383, 100, 63, 1925, -1207, 199, 94, + -94, 3060, 1825, 611, 292, -141, 382, 141, + 105, -151, 0, 1448, -267, 206, 932, -682, + 251, -183, 1080, 161, 4334, -397, 525, -91, + 127, -104, 921, -2282, -274, -1070, 387, -312, + 1380, 2769, -554, 1501, -921, 102, -183, -104, + -66, -1656, 2049, 122, -2271, 84, -276, -204, + 353, 380, -414, -1757, -1035, -318, -130, -10, + 163, -471, 2425, 2864, -1892, 294, 817, 754, + 277, -29, -214, -39, -312, -57, -54, 986, + 2286, -574, 34, -641, 3783, 214, -399, -155, + 38, -148, -42, -89, 97, -17, -2192, 729, + 272, 1168, -3593, 150, 96, -473, 211, -60, + 136, -26, 142, -285, 93, 666, -465, -181, + 2016, -338, -2186, -2608, -449, 107, -18, 45, + 24, 245, -119, 244, 442, 1509, 158, 242, + 169, -16, -221, 104, 115, 16, -217, 23, + -25, 130, 4076, 662, -315, 3068, -35, 36, + 2785, -223, -528, -157, 43, 186, -514, -240, + 15, -245, 520, -110, -781, -641, 294, -20, + 64, -44, 400, -109, 4756, 1334, -421, -195, + 130, -2182, 64, -897, -1423, 3081, -523, 378, + -164, 968, 593, -192, 71, 114, -143, -10, + 1961, -3141, 3173, -39, -110, -57, 144, -68, + -429, 30, -10, 467, 159, 40, 67, 260, + 814, -168, -836, 1073, -3562, 1786, -1205, -148, + -105, 94, 5, 143, 138, 18, -1384, 20, + 635, -126, -71, -87, -320, -407, 559, -151, + 1312, -4395, -755, -263, -77, 1657, 699, 426, + 469, -469, 253, -80, 317, -71, 268, 3592, + -2051, 304, 157, 43, 1872, 3794, -1537, 1226, + -159, -335, 340, -385, -253, -195, 21, 106, + -31, -187, -63, -2771, 446, -708, 202, -186, + 548, 832, 1757, -1274, 1234, -756, -160, 76, + -82, 64, 2169, 13, -849, 244, -2486, -2138, + 844, -178, 270, 297, 150, 202, -41, -188, + 121, -1272, 371, -319, 2848, -469, -2059, 1290, + -457, -380, 690, 148, -51, -340, 113, 57, + -1259, -396, -1404, 336, -511, 576, 4441, 124, + 143, -483, 85, 138, 196, 38, -188, 1177, + -764, -2067, 820, -264, 218, -300, -501, -230, + -2529, 1349, -1606, -199, 92, -55, -1324, -702, + 2078, -1269, 414, -50, 29, 12, 87, -593, + 217, -82, 94, -2392, 308, 2315, 2188, 768, + -1103, -77, 579, 1706, -826, -224, -297, 145, + -640, 570, 146, -199, 1187, -872, 327, -310, + -122, -23, -13, 808, -139, -4425, -670, 412, + -4, -70, -162, -1056, 685, -312, -957, 339, + 893, -252, 4040, -105, 76, 993, 281, -79, + -139, 168, -298, 795, -1107, 395, 386, -524, + 1052, -2341, 2537, 474, 726, -1028, -357, -52, + 115, -9, 1349, -2240, 785, 2751, 77, 922, + 385, -539, -148, 410, 251, -70, 199, 51, + 1728, -206, 1181, 1182, 1388, -791, 121, -3, + 8, -147, -95, 101, 886, -2412, 19, 2401, + -116, 718, -592, -221, 724, -33, 690, -180, + 868, -3330, 377, -336, 128, 267, -2075, 2848, + 2994, -300, 3, -153, 41, -456, 38, -31, + 309, -106, -92, -14, 96, 672, 634, 207, + 1556, 438, -2147, 282, 2443, -1662, 511, 457, + -259, -505, 173, -204, -858, -117, 2751, 852, + 220, -512, -2576, 1542, 357, -77, -4, 165, + -63, 189, 302, -699, -764, -1559, 25, -233, + 405, 173, 698, -73, -300, -1442, -2923, -1326, + -25, 98, -196, -2915, -1169, -3392, 691, 353, + -196, 96, 41, 180, 198, 280, 207, -158, + -19, 1556, 991, -523, -280, -1599, 1368, -3247, + -996, 159, -136, -469, -48, 0, 30, 95, + -765, 33, 6580, -180, 316, -176, 105, -21, + -9, 166, 148, -52, -49, 42, 2, 318, + -55, -91, -1461, -1474, -3086, -756, 1479, -29, + -668, -255, -51, 241, 249, -212, 132, -129, + -410, 113, 17, 301, 185, 96, 10, 188, + 38, -772, 5152, -13, -10, 1527, 806, -23, + -79, 1102, -77, 329, -99, -404, 2276, -873, + -2681, -765, 71, 20, -2448, -803, 1827, 1115, + -160, -15, 288, -46, 573, 100, -726, -694, + -406, 288, 61, -2216, -904, 77, -2983, -962, + -1438, 809, -38, -79, 95, 52, -231, 518, + 115, 41, 908, 780, 805, -207, -2161, 554, + 968, 3111, 133, -158, -13, -34, -182, -60, + 105, 718, -1245, 227, -818, 1184, 903, 603, + -988, -2647, 1847, 141, 817, -337, 131, 393, + 1653, 839, -261, 466, 465, -297, 1440, -431, + 2058, -1857, -1416, 310, -722, -54, 203, -266, + 3770, 172, -593, -73, -508, -61, 1110, 1261, + 275, 1681, 447, -147, -95, 33, 1281, -3119, + 24, -308, 366, -468, 232, 358, 667, -942, + 696, -924, -2059, -62, 151, -2102, 332, 258, + -186, -636, 685, 214, -3174, -1243, 573, -276, + 9, -262, -20, 158, -174, -21, 593, -6198, + -266, -270, -63, -203, 63, -396, -100, 191, + 212, 85, 120, -791, 37, -47, 2108, 652, + 519, 346, 106, -1840, -2566, -563, 14, 266, + 10, 214, 504, -1269, 50, 164, 120, -105, + -546, -212, -79, 41, -171, 675, -252, 4373, + -16, -1697, -1491, -3588, -587, 623, 67, 269, + 484, -25, 1067, 580, -598, 195, 47, -17, +}; + +static const int16_t cb4448sm0[] = { + -5114, 166, -785, 635, -528, -102, 269, 492, + -185, -614, 122, -124, 85, 145, 270, -154, + 39, 2524, 58, -57, 119, 5, 343, 2873, + -278, -787, 137, 62, -169, 2049, 1476, -325, + 130, -702, 2882, -19, 310, -258, -135, 88, + -268, 69, 69, 695, -1935, 815, 678, 44, + 3085, 278, -587, -1326, 360, 145, -17, 66, + -2475, -594, 132, 358, 406, -369, -237, 3363, + 329, -424, 52, 49, 291, -236, -2332, -261, + 49, -27, 170, 3656, -214, -603, 264, 60, + -87, 145, 116, 179, 190, 679, 339, -340, + 3272, 641, -2631, 484, 159, 305, 290, 208, + 226, 68, 102, -145, -356, 153, 647, -2046, + 937, -1666, 1093, -29, -1161, 749, -2360, 171, + -2185, 841, -1406, -1057, -1764, -300, -205, 452, + 2168, -214, -153, 291, -106, 79, 1717, -20, + -1771, 286, -466, 686, 167, 137, 5, 43, + 1075, -2601, 261, -86, -333, -724, 162, 186, + 4, -334, -412, -309, 888, -114, 531, 297, + 4284, 297, -1695, -212, 75, -263, -2313, 102, + -434, 352, -1813, -472, 114, -185, 6, 66, + 8061, 414, -577, 672, -152, 152, 1, 38, + -66, 48, -35, 62, -98, -19, -3762, 98, + 242, 114, 359, -162, 115, -3038, 340, 253, + -526, -144, 14, -147, 28, -352, -5858, 46, + -597, -392, 226, -54, -70, -47, -45, 16, + 53, 137, 172, -3017, -22, -163, -267, -3289, + -31, -174, 110, 794, 425, 67, 58, -72, + -156, 3937, -585, 2116, 99, -1115, -257, 801, + 270, -329, -257, -18, 122, -369, -2196, 1746, + -305, 599, 800, 749, 1466, -299, -1519, -255, + -233, 217, -117, -256, 301, -249, -327, 5530, + 86, 135, -784, -137, 610, -7, 55, 93, + -106, -50, 267, -229, -26, -1070, 13, -75, + 1733, 2929, -130, -713, 15, -2144, 104, -318, + 282, -8, -285, -468, -124, 59, 520, -78, + -332, -654, -5048, 212, -388, 97, -1523, 227, + -2545, 2159, -127, 1020, 79, -664, 403, -31, + -356, -1, -436, -86, 75, 610, 3048, 235, + -3133, -1189, -44, -23, -324, 260, 469, -113, + 22, 53, 525, 427, 469, 1016, 420, 493, + -1229, -238, -2671, 361, -2745, 193, -253, -59, + 15, 53, -57, 36, -144, 127, 25, 11, + -34, 6560, -12, -80, -72, 70, 654, -1135, + 158, 279, 298, 746, -190, -1382, 138, 527, + -1504, -2753, -106, -55, 225, 54, 136, 53, + 506, 174, 268, -533, -43, -416, -196, 6266, + -81, 22, -158, 350, 1177, -728, 594, 34, + -368, -226, -584, 247, 804, -1141, 78, 3923, + -53, 309, 58, -45, -7634, -73, 39, -152, + 55, -77, -45, -62, -25, -247, -161, 28, + -2629, -401, -295, -687, 298, -3240, 0, -251, + 7, -49, 494, -198, 202, 2201, -301, 83, + 45, -964, 256, -1499, -2394, 24, -267, -599, + 46, 161, -370, 81, 636, 3146, -2077, -964, + 322, 400, -635, -688, -630, -92, -235, 104, + -77, -541, 511, 2722, 441, 2757, 952, 739, + -257, -254, -438, -122, -151, 12, 578, -92, + -440, -63, 93, 4971, -499, 419, 1374, -165, + -417, 64, -13, -235, 1080, -77, 536, 68, + -842, -772, 1627, -471, -1350, -144, 2849, 219, + 114, 68, -55, 350, -11, -1334, -3042, 1166, + -147, -891, -483, 1461, 339, 808, 362, -101, + -2807, -24, -377, 518, -438, 194, -110, 194, + -826, 3380, -81, -30, -43, 103, -99, 1539, + -614, -13, -1154, 196, -3122, -521, 1454, -319, + 159, -428, 722, -208, 162, 1871, 2534, 2287, + 946, 261, -483, -645, 26, -170, -31, 17, + 164, 104, -44, -8192, -20, 94, -235, 56, + 68, -58, 380, -25, -170, 17, 16, -154, + 63, 477, 1280, 614, -529, -2347, -360, 159, + 1967, -2085, 485, 335, 378, 178, 1633, -437, + -46, 23, 640, 1465, -91, 1279, -1025, -1007, + -236, 2632, -257, 262, 177, 3029, -3149, -1001, + 231, -262, 87, -243, -68, -597, 109, 62, + -264, 37, -463, -3105, -633, 881, 1026, -86, + 417, 705, -1144, -68, -2084, 46, 124, -36, + -2461, -73, -126, -303, 1079, -358, -2764, -761, + -1454, -245, 203, 0, -179, -117, 2571, -4751, + -20, 194, 298, 258, 390, 270, -36, 182, + 152, -56, -97, -47, 138, -233, -111, -1490, + -490, -329, 662, -320, -4697, 443, 66, 352, + 203, -114, -119, 186, 649, -106, -5, 2280, + 1132, -376, 1168, 919, 1858, 271, -1741, -130, + -3388, 264, 618, -2375, 260, 1279, 110, 732, + 128, -373, 54, -182, 99, -131, 9, 30, + -83, 27, 204, 109, -306, 6903, 130, -7, + -115, 92, -241, 119, -640, -871, -40, 372, + -68, -147, -1503, -58, 920, -466, 311, 144, + -3648, -121, -357, 5, 1968, -737, -1491, 596, + 818, 122, 688, -137, -2415, -368, 236, 71, + -597, -193, -395, 795, 855, 657, -49, 844, + -3320, -1921, 846, 17, -293, -17, -1676, -1826, + -138, 897, -207, -3, 1838, -901, 86, 275, + 964, 230, 510, -10, 2879, 3949, 332, 289, + 109, -229, 18, 238, 244, 287, 44, 103, + 367, 21, -1134, -378, 1338, -828, 3500, 5, + 1027, 475, 208, 654, 589, -92, 236, -85, + -115, 1095, -2504, 827, -885, -806, -155, 2112, + -346, 1120, -350, -911, -234, 231, 55, 87, + 1957, 601, 755, -1248, 753, -2726, -481, 2038, + 96, -363, 309, 150, 299, -561, -698, -1030, + 118, 1224, 3240, -1523, 1476, 342, -688, -76, + 192, -8, -319, 350, 149, -331, 155, -436, + 286, -994, 160, -2696, -423, -2798, -135, -108, + -2846, -254, 3590, 350, 130, -810, 463, -123, + 59, -256, 251, -750, -76, -8, -1633, 150, + -931, 1958, 1523, -2527, 239, -287, 172, 332, + -13, 486, 247, -26, 149, 59, 130, 265, + 19, 209, 7220, -23, -99, -69, -66, -70, + -54, -75, 60, -264, -102, 1079, -535, 1587, + -557, -1499, 241, -2596, 1157, -140, 270, 33, +}; + +static const int16_t cb4448sm1[] = { + 7894, -331, 383, -556, 63, -371, -23, 73, + 46, -145, 105, 43, -199, -52, -85, -85, + 13, -21, -230, 7379, 268, -243, -460, 251, + 73, 12, 115, -18, -247, 433, -90, -518, + 962, 0, -960, 184, -305, -2003, 276, 1696, + 2418, 270, -2140, -215, -534, -389, -403, -3500, + 416, 567, -393, -183, 253, -100, -285, -107, + 100, 281, -527, -2944, -86, 2652, 311, -785, + -811, -283, 425, -77, 393, 136, 170, 1290, + -765, 108, 676, -213, -1226, -470, 427, 3499, + 616, -1211, -226, -37, 88, -2792, 351, 78, + -2975, 99, 192, 1390, -338, 47, -8, 58, + -255, 50, 221, -49, -788, -207, -2122, -167, + -692, 379, -3239, -965, -698, -463, -45, 34, + 1785, 1026, -1107, 113, 124, -258, -277, -714, + 2764, -178, -200, 907, -45, -213, -2575, -530, + -112, 3616, -128, 76, -366, -135, -22, -51, + 125, -100, -79, 142, 54, 107, 87, 493, + -34, -221, -448, -243, 994, 845, -4656, -105, + -487, 41, -112, 349, -4328, -72, 513, -112, + -685, -470, -138, -541, 340, -1505, -24, 37, + 169, -405, -434, -2994, -42, -416, -1927, 1551, + -1488, 420, 179, -66, 14, 92, 147, 141, + 497, 404, -412, 2301, 336, -2877, -1845, -948, + -784, 262, -211, 6, -1678, -434, -1433, -727, + 1254, 542, -1430, -302, 1558, 107, 617, -833, + -369, -178, 1682, -2569, -1232, -1556, -87, -178, + 400, -178, -427, -124, -63, 142, -221, 33, + 2880, -227, -356, -466, -3362, -398, -167, 164, + 126, 59, -1, 5, 212, 25, 2062, -462, + -33, -46, 45, -201, 823, -268, -302, 3623, + 389, 382, 136, -30, -64, 2, -600, 3114, + 2720, 273, -588, -235, -313, -141, 37, -28, + 355, 184, -433, -110, -576, -56, 134, -623, + -271, -2529, -2753, 947, 1319, -2, 620, 36, + -412, -1986, 221, -404, 514, 3223, -106, 1497, + -368, -167, -142, -366, -125, 16, 142, -435, + -160, 2845, -153, 470, 387, 3117, -75, -375, + 658, 259, 755, -3, 3744, -517, -1446, -667, + 1372, -1692, 117, -96, 195, -201, -134, -76, + 179, 97, 71, 1887, 161, 365, 228, 1177, + 235, -834, -48, 1667, -1123, 2217, -209, 100, + -219, -2778, 81, -579, 3421, -326, -492, -233, + 78, 32, 117, -74, -80, 85, -282, 453, + 500, 721, 800, 83, -624, 1000, 165, -20, + -516, -4193, -334, 107, 1221, -1507, -10, 523, + 85, -44, 21, 34, 199, -106, -2233, 525, + 2138, 40, -55, -63, -8179, 326, 333, -152, + -27, 137, 212, 130, -10, 76, -61, -113, + -544, -179, -187, 0, -5308, 322, -326, 513, + 415, 375, -92, -354, 69, 77, 65, 93, + -352, -165, -1837, 1790, 914, -276, 2215, -1418, + 343, 281, 4, 283, 4398, 1695, -248, 153, + -166, 751, 822, -406, -456, -251, 185, -251, + -222, -169, -266, -6323, 249, -40, -45, -203, + 47, -83, -621, -174, 327, 30, 114, -29, + -505, -224, 1804, 1582, -2292, 2102, -746, -421, + 170, 438, -171, 153, 84, -157, -2937, -123, + -81, -227, -98, 263, 3531, 36, 105, -479, + -94, -357, -22, -124, 279, -116, 543, 201, + -393, -226, -2255, -133, 1613, -123, 2687, 70, + 191, 240, -996, -676, 606, -1245, -306, 413, + -272, -539, 485, 3583, -224, 432, 389, 31, + -888, 318, -149, -228, 764, -426, 1608, -2656, + 254, -2193, 252, 484, -90, -117, -257, -2210, + -156, 553, 559, 680, 298, -16, -519, 1172, + 2172, 1288, -113, 186, -199, -1415, -83, -1984, + 667, -1013, 344, -399, 2889, -1175, -908, 186, + 185, -22, -328, 3132, -1166, 209, -213, 386, + 2140, 552, 1023, 719, 529, -169, 421, 196, + 76, 1995, 532, -75, 2060, -526, 396, 2974, + -264, -348, 149, 586, 22, 97, -337, -252, + 357, 103, -2308, -2578, -1836, -277, 346, -314, + -989, 185, -314, 102, 56, 3779, -265, -1029, + -12, -126, -431, 356, -2493, -86, 172, 116, + 61, -146, -2220, 211, -165, 233, -327, 73, + -7, -104, -546, 253, -2406, 361, 2252, 486, + 675, -177, 2643, 603, 300, 1123, -642, 361, + 684, -2151, 569, -1014, 120, -50, 321, 3174, + 3080, -733, -427, 299, 169, -123, -140, -13, + -315, 21, -120, -24, 174, -191, -350, -7842, + -145, -169, -419, -15, 150, -130, -73, 162, + -9, 38, -287, 109, 390, 147, 151, 1907, + -4243, 7, -207, -147, -230, -343, -117, -111, + 107, 132, 1457, -88, -8, -445, -176, -172, + -1799, -813, 486, 1150, -3026, -168, -2620, -584, + 178, -543, -1868, -359, -113, -1783, 214, -663, + 473, 866, -136, 169, -3324, -129, -3404, -249, + 234, 422, 251, 340, -343, 231, 134, -42, + 32, 64, -209, 12, 236, -267, -419, 1, + 260, -109, 6508, 105, 7, -273, -123, -107, + -152, -274, -157, 75, 74, -201, 46, 37, + 338, -21, -180, 208, -6417, 794, 250, -81, + -585, 4, -119, -314, 529, 219, 159, -132, + -277, 76, -613, 4933, 15, 213, 2461, 286, + 542, 177, 2767, 389, 136, 750, 559, -994, + 684, -12, -2081, -546, -89, -3733, 548, -620, + 675, 118, -121, 190, -52, 19, -19, 25, + -1224, 344, 3094, -2067, 7, 273, -1268, -375, + -297, -201, 271, -191, 123, 6, -260, 2284, + -308, -3062, 242, 668, -221, 1146, 1218, 473, + -133, 82, 57, 112, -1677, 78, -229, 354, + -463, 763, 1628, 2243, 1386, 1630, -145, 255, + -60, 228, 195, -864, 2539, -466, 985, -3075, + 2, 118, 221, -395, -450, -256, -158, -32, + -3829, 2012, -50, -465, 146, -1091, -318, 271, + -12, 596, 160, 120, 92, -209, -335, 104, + -28, 689, 305, -548, -849, 1617, 605, 185, + -414, 3899, -273, 51, 182, -192, 121, 616, + 1219, 414, -959, -4219, 1319, 60, 246, -468, + -32, 225, 338, -39, 1235, -2079, 2250, 626, + 121, 296, -137, -339, -1870, -47, -397, 124, +}; + +static const int16_t fcb8l[] = { + -1239, -1310, -1240, -1146, -1337, 1303, -482, 2215, + 2026, 2222, -1144, -1188, -1209, 2535, -1111, -844, + 1485, 625, 1254, 1204, 5932, -1116, -1235, -1208, + -801, -1020, -558, 1387, 1513, -1079, 3220, -896, + -1083, -1166, 2246, -1210, -838, -950, -960, 764, + 13941, -1307, -817, -1253, 1850, -1320, -1361, -1218, + -671, 780, -839, -1068, -776, 2977, -714, -944, + -823, -580, 357, 591, 302, -1078, -895, -1020, + 3116, -1144, 1438, -891, -71, 1528, -238, -1297, + -1020, 4616, -1185, -514, -1154, -1157, 1901, 2372, + -1131, -1289, -1273, -1289, -1311, -1331, -1340, 439, + 455, 2395, -537, -1180, 2409, -1084, -580, 1937, + 846, -51, 615, 1099, 3854, -1177, -912, -1095, + 656, -995, -647, 3298, -976, -436, 12323, -1291, + -1187, -1341, 4779, -1368, -1357, -1317, -985, 1407, + -513, -1387, -1224, -1069, -1218, -1117, -181, -1209, + 5376, 4256, -22, -1232, -1173, -834, -1054, -947, + -611, -822, -206, 5572, -988, 1067, -837, 738, + -332, -38, -59, 143, 248, 386, -447, -1233, + -1258, -1169, 3653, -1045, -657, -926, 2004, 2201, + -1164, 7042, -1302, -1313, -812, 150, -129, 305, + 442, 742, -1185, -1293, -1220, -872, -1304, -1260, + -853, -1293, 2962, 3011, -178, -1187, -1087, -896, + -895, -1053, 3788, 59, -169, 1632, -1201, -1289, + 5263, -896, 331, -852, 218, 825, 1129, 1024, + -39, -1186, -1054, 1862, -1198, 2010, -1075, -1005, + 702, 1550, 4491, -1055, -890, -645, -987, 2465, + 529, 194, -72, 370, 1547, -968, -849, -1153, + 6459, -1164, -1061, -1020, -838, 125, 3698, -1168, + -1066, 1882, -1159, -439, -1017, -759, 744, 1302, + -812, -985, -1002, -1029, -871, 3690, -170, 604, + 623, 1272, 6135, -1012, -1231, -1066, -927, -1082, + 2393, -843, 1537, 1240, -866, -1161, -866, 6639, + -994, -860, -264, -298, 469, 1184, -868, -1262, + 2167, -1177, 2132, -987, -563, 969, 1145, 1508, + -735, -1232, -1090, -1204, 1507, -1101, -393, 755, + 975, 1246, 1944, -1068, -1169, -1040, -987, -1301, + 5488, -1057, 3150, 1890, -1133, 2725, -1123, -963, + 1901, 260, -484, 449, 564, 1144, 679, -1118, + -989, -702, -556, 162, 689, 712, 673, 443, + -695, -1247, -1019, -1065, -406, -1143, 1750, -743, + 2644, 2402, -1171, -1157, -1059, -823, -688, 1314, + 1458, 629, 857, 856, -875, -1316, 3470, -1061, + -846, -761, -712, -955, 978, 1967, -980, 3517, + -994, -953, -903, 56, 228, -30, 359, 560, + 9926, -1178, -1056, -627, -952, -481, -1168, -268, + -701, -555, -887, -1212, 1768, -1156, -396, -755, + -119, 1594, 949, 1201, -844, 1734, 1312, -331, + -500, -280, -125, -219, -139, 496, -1121, -1227, + -1145, -215, -1123, -765, -173, 4055, 1086, 1465, + -714, -904, -901, -713, -1073, 1233, -797, 645, + 58, 897, -518, -624, -441, -554, 1139, 549, + 147, 72, 127, 428, -1104, -979, 2433, 1867, + -237, -745, -280, 110, 794, 631, -1049, 1141, + -974, -920, -849, -392, 634, 414, 614, 797, + -1162, -1344, -1192, -1259, -1079, -912, 2717, 2548, + 1847, 1920, -1004, -1091, -1006, -692, -85, -24, + 1014, 1427, 751, -584, 6057, -1206, -1072, -795, + -921, -1103, -1157, -623, -818, 2641, 3121, -1084, + -1095, -939, -664, -694, 884, 555, 144, 593, + -874, -1074, 417, -1027, -6, -790, 1687, 80, + 1018, 738, -527, -958, -701, -377, -4, 155, + 304, -348, -947, -342, 2269, -1040, 1124, -494, + -76, 76, 2, 114, -194, 348, 904, 466, + -577, -717, 107, -39, -29, 158, 101, 149, + -968, -921, 558, -264, -445, 138, -121, -33, + 105, 243, -478, -1047, -937, -751, -609, -822, + -709, -976, -1006, 2800, -1108, -1292, -1055, -1272, + -1295, -1152, 305, -1144, 635, 2067, -584, -1135, + -663, -1130, -754, -1009, -937, -515, 1473, 841, + -1235, -1338, -1305, -1141, -1109, -1217, -238, 1915, + 3550, 2306, -963, -985, -874, 763, -826, -694, + 19, 391, 379, 776, -582, -1216, -1285, -1164, + -1276, -1305, -1273, 2631, -579, 2487, 1058, -655, + -808, -878, -910, -1006, -1122, -590, -663, 428, + 2185, -1125, -1032, -1076, -873, -1139, -1029, -477, + 1720, 1238, -1111, -1311, -1343, 1074, -1328, -1181, + -970, -386, 2359, 1777, -1045, -1189, -1117, -1053, + -942, -329, 501, 1237, 808, 1022, -866, -1048, + -678, 1597, 1528, -262, -256, 231, 418, 728, +}; + +static const int16_t fcb8s[] = { + -1022, -858, -773, 304, -881, -771, -341, 937, + 270, 420, -684, -1000, -795, -903, -671, -575, + 14, 3327, 528, 893, 965, -541, -947, -1027, + 4008, -1081, -743, -991, -808, 933, -1406, -1173, + 7513, -824, -213, -797, -648, -40, 176, 217, + -1298, 6743, -755, -232, -440, -680, -269, -60, + -80, -85, -893, -1044, -726, -733, -834, -641, + 231, -779, -501, 1832, -1296, 2548, 2754, 19, + -210, -708, -205, -74, 18, 55, -1225, -1123, + -1239, 6991, -689, 272, -290, 56, 356, 675, + 1623, -1134, -607, 1426, -872, 511, -1060, 408, + 253, 423, 1960, -1337, -1152, -985, -924, 2020, + -398, 348, 4188, 1044, -650, -831, 2909, 2083, + -457, -5, -1037, -964, -128, -40, 6019, -858, + -937, -559, -624, -601, -411, 120, -289, 412, + -1271, -1351, 3858, -1214, 2224, -325, -165, 535, + 559, 386, 1868, 649, 269, 245, -708, -778, + -179, -12, 101, -12, -1235, -892, -829, 2570, + -574, -431, 170, 167, 492, 531, -930, -1093, + -1037, -1177, -1151, -912, -466, 303, 1601, 4089, + -1234, 3160, -631, -1090, -741, -274, 103, 13, + 356, 289, 2709, -1115, -1011, -965, -948, -563, + 1939, 870, 1187, 550, -1028, -1217, -726, -954, + -694, -753, 3729, 141, 518, 854, -1102, 1138, + -947, -620, -379, -436, 72, 449, 432, 428, + -1112, 1276, 544, -334, -445, 179, -32, -37, + 9, 28, -1252, 2983, -963, 1256, 419, -10, + 17, 211, 218, 191, 126, -942, -691, -529, + -533, -193, 1216, 150, 389, 152, -1191, -987, + -942, -860, -463, -705, -159, 184, 1893, 1080, + 1753, -694, -609, -699, 61, 269, -126, 93, + 236, 380, -527, -966, -334, 163, -662, 3295, + -477, 591, 259, 638, 397, 181, -598, -129, + 35, -51, -122, 64, -32, -98, -1351, -1140, + 3372, -753, -776, 718, 513, 134, 420, 354, + -1128, -546, -743, 297, 1819, -77, 179, 17, + 181, 206, -1028, -1027, -757, -755, -389, 1035, + 227, 249, 315, 395, -931, -881, 1207, -777, + -165, -531, -375, 73, 346, 332, -1159, -788, + 1196, 959, -432, -337, 243, 176, 321, -7, +}; + +static const int16_t fcb8m[] = { + -1379, -1331, -1277, -1266, -927, 0, 2552, 2575, + 425, 48, 2568, -26, -841, -762, -679, -562, + -420, 186, 68, 69, -743, -193, 266, 92, + 1714, -241, -357, -93, -252, -222, -884, -385, + 2436, -446, -150, -533, -192, -33, 226, 8, + -756, -1180, -1238, -1258, -1250, -1147, -764, 141, + 3075, 4136, -1255, -1288, -1202, -1188, -1222, -1257, + -500, 1989, 4062, 1328, -300, -186, -399, -329, + -330, -533, -313, 2030, 193, -128, -933, -1016, + 66, 1648, -228, -321, 236, 114, 356, 212, + -677, -826, -784, -670, -484, -423, -188, 215, + 2476, 652, 3424, 1991, 940, -576, -942, -1038, + -1097, -1161, -1120, -956, -763, -416, 2824, 1429, + -693, -755, -455, -670, -535, -225, 4814, 116, + -940, -953, -1008, -856, -797, -582, -531, -213, + -412, 2479, -156, -218, -319, -168, -236, -248, + -305, -515, -224, -382, -501, -759, 139, 1789, + -258, -343, -167, 721, -1014, -1092, -975, -1070, + -1126, -778, -178, 36, 522, 5371, -402, -1351, + -1577, -1662, -1642, -1560, -1249, -870, 602, 8968, + -1126, -1102, -1118, -1072, -946, -511, 482, 1635, + 1108, 2471, -935, -748, -302, -445, -810, -359, + 1433, -83, 336, 1834, -712, -773, -752, -609, + -391, 625, 2550, 403, -447, -18, -261, 91, + 5096, -199, -887, -1018, -728, -930, -921, -684, + -22, 2422, 2118, -417, -757, -789, -732, -794, + -785, -664, -627, 885, 471, 798, -429, -684, + -454, -185, 185, -26, -990, -369, 1048, -25, + -98, 720, 41, -60, -3, -92, -790, -147, + 846, 4007, -346, -907, -849, -730, -639, -842, + 9096, 617, -1164, -1275, -1380, -1396, -1391, -1364, + -1342, -1080, 655, 5687, 505, -818, -1134, -1125, + -1136, -1123, -1088, -996, 3, 36, -48, -28, + 121, -55, 172, -43, 21, -74, 1537, -69, + 378, -38, -113, 159, -149, -609, -693, -796, + -715, 588, 376, -744, -659, -316, 145, 448, + 659, 320, 787, -315, -956, -682, -595, -327, + 146, 348, 837, 577, -1011, -1014, -647, -159, + 679, 158, 294, 670, 507, 540, 418, 558, + 12, -674, -901, -897, -827, -682, 323, 2580, +}; + +static const int16_t fcb8sl[] = { + -1269, -1637, -1349, -1672, -1421, 2750, 212, 3563, + -74, 1555, -1495, -1148, -1172, 1351, -484, -473, + 1418, 557, 899, 635, 6124, -1140, -1154, 783, + -1444, -1509, -1041, 1793, 4459, 1325, 2055, -921, + -794, -713, 1625, -50, 78, -159, 361, 855, + 10282, -1533, -1105, -1582, -1704, -1697, -1440, -1001, + 864, 2038, -1347, -847, -1419, 1474, -1369, -1189, + -1125, -655, -134, 950, -1398, -222, -1498, -1262, + 2597, 729, 2521, -544, 457, 2058, 3821, -1568, + -1577, 2013, -1717, -1620, -1292, 2771, 2559, 4942, + -1497, -1576, -1724, -1550, -1775, -1734, -1097, -635, + 1934, 2706, -1399, -994, 1685, -1142, -511, 1595, + -275, 861, 484, 958, -1374, -764, -1105, -1493, + -1678, -1630, -521, 5138, 53, 1331, 4909, -1376, + 2134, -1638, 1562, -1565, -1487, -1625, 3232, 4742, + -1017, -1353, -1212, -1585, -1309, -1139, -71, -820, + 5928, 2987, -641, -1314, -1198, -1182, -1005, -542, + -1287, -1210, -1103, 6865, -1130, 1375, -884, 1241, + -532, -173, -68, 15, 309, 192, -1128, -1107, + -849, -1343, 2233, -1281, -535, -679, 3878, 1865, + -1427, 4508, -1022, -747, -1117, -1104, -33, 669, + 1216, 1482, -1360, -1075, -1483, -1390, -1366, -754, + -1042, -766, 3467, -624, -968, -1101, -393, -890, + -447, -995, 2346, -909, -784, 977, -1141, -1201, + 5256, -1552, -536, -1419, 0, 596, 556, 1654, + -1124, -1225, -830, 1267, -719, 1791, -546, -297, + 978, 378, 2674, -1261, -1159, -951, -1027, 2537, + -470, -360, -268, 1098, -1154, -1513, -729, -1455, + 5671, -1236, -800, -874, 1630, 1273, 1909, -623, + -724, 1417, -559, -326, -257, -189, 265, 220, + -284, -1302, -1272, -1223, -842, 4338, -934, -1001, + -495, 2944, 4295, -924, -1004, -1097, -1024, -328, + 1736, 106, 452, 158, -1024, -541, -1296, 4376, + -1117, -1224, -843, 1097, 1121, 1251, -829, -1374, + 2292, -1505, 1850, -1153, -943, -979, -534, 1444, + -1510, -1494, -1147, -1397, 1535, -794, -21, 1313, + 638, 1015, -1072, -1275, -1166, -1602, -1618, -1379, + 4541, -226, 2169, 888, -1369, 2392, -1087, -948, + 1074, 674, 384, 124, 500, 749, 398, -1091, + -721, -114, -15, 413, 200, 135, 290, 189, + -1185, -1188, -1339, -1549, -871, -574, 2333, -346, + 554, 3773, -1247, -1531, -1408, -1310, -1007, 2861, + 2465, 608, 1080, 1224, -1103, -1477, 1884, -1412, + -904, -1473, -846, -188, 782, 2049, -1473, 1531, + -1530, -1459, -1546, -1260, -856, 1191, 652, 933, + 5072, -1456, -1653, 3759, -1751, -531, -1391, 4297, + -374, -751, -1570, -1242, 1461, -1286, -913, -621, + 1768, 1246, 1291, 779, -1360, 1641, 1122, -629, + -328, -197, 241, 359, 560, 536, -1474, -506, + -1523, 298, -1551, -1254, -985, 3603, 4317, 958, + -885, -241, -1159, -930, -1249, 1490, -825, 274, + 347, 307, -1060, -1027, -809, -1063, 1554, 1708, + -242, -23, 424, 804, -1317, -853, 1571, 1898, + 239, -556, 298, -161, 777, 765, -1464, 1053, + -1198, -1156, -917, 0, 1460, 447, 1178, 629, + -1455, -1591, 296, -1785, -1694, -1631, 3669, 3819, + 3437, 3274, -956, -666, -874, -284, -858, -202, + -687, 1728, -512, -951, 4692, -1360, -1242, -1188, + -1513, -449, -1566, -1515, -1226, 3857, 1246, -1225, + -860, -1068, -748, -27, 380, 1190, 591, 552, + -1391, 194, -763, -463, 331, -265, 702, 181, + 290, -145, -838, -1359, -1381, -1569, -1399, -1088, + -1357, -1295, -486, -612, 1638, -586, 1458, -774, + -223, -620, -104, 189, 344, 269, 1555, 1428, + -867, -621, -294, -206, 32, 235, 261, 161, + -1021, -105, 654, -235, -282, -7, 189, -159, + -218, 113, -1096, -1318, -1256, -1335, -931, -476, + -1041, -1199, -1134, 2781, -1479, -1222, -1397, -867, + -815, -661, 740, -240, 1158, 735, -1435, -1003, + 351, -990, -245, -72, -347, -72, 1408, 634, + -1697, -1727, -1534, -1716, -1436, -102, 402, 1518, + 1903, 1311, -1477, -930, -355, 508, -162, 21, + -46, 454, 387, 173, -1312, -1284, -1486, -1172, + -1356, -965, -1106, 1760, -670, 2163, -70, 417, + -559, -667, -545, -945, -429, -363, 157, 1280, + 2059, -1319, -1291, -975, -1354, -1249, -780, -476, + 1410, 1252, -1193, -927, -1462, 871, -1281, -1327, + -900, 1540, 1531, 1227, -1651, -1334, -1073, -752, + -154, 710, 830, 773, 279, 307, -1294, -796, + -761, 1012, 1583, -420, -177, -323, 154, 582, +}; + +static const int16_t fcb8ss[] = { + -1481, -1069, -1082, -726, -818, -550, -417, 343, + 489, 275, -814, -510, -712, -933, -558, -236, + 32, 3051, 451, 301, -414, -237, -683, -599, + 3627, -445, -232, 56, 58, 112, -1226, -639, + 4096, -644, -226, -23, 90, 162, 313, 104, + -1385, 5607, -428, -860, -447, -265, -145, -132, + 115, -200, -1349, -1280, -1216, -1046, -657, 43, + 1333, 831, 675, 1174, -1394, 2288, 1840, -682, + -497, -256, 22, 22, 261, 70, -1369, -826, + -975, 2286, -329, -267, 142, 36, 437, 313, + 1570, 52, -470, 622, -244, -247, -114, 22, + -117, -541, -1167, -596, -809, -929, -669, -327, + 102, 516, 2790, 597, -1317, -870, 1327, 987, + -25, 391, -48, -82, 209, -242, 4424, -311, + -396, -765, -382, -336, -365, -414, -74, -13, + 1127, -588, 1363, -714, 368, -450, -390, -364, + 84, 139, 1864, 1881, -15, -790, -281, -286, + 38, -186, -31, -238, -1249, 262, -841, 731, + -414, -61, -274, 280, 100, 557, -841, -775, + -1007, -1063, -687, -374, -360, 31, 1048, 3471, + -1385, 2464, -840, -1105, -714, -400, 56, 445, + 588, 427, 1785, -1093, -783, -847, 41, -23, + 465, 392, 382, 428, -518, -249, -58, -791, + -689, -581, 3146, -183, 296, 66, -1243, 1059, + -1076, -874, 416, 544, 253, 66, 168, 211, + -1388, 1253, 138, -727, -509, 905, 319, -297, + 67, -525, -1470, 2237, -87, 547, 556, -239, + 90, -147, -114, -302, -1017, -824, -585, 25, + 0, 62, 1422, -155, -41, -320, -1125, -1069, + -1134, -783, 1129, 45, 183, 47, 716, 672, + 409, -1169, -910, -447, -34, 79, 95, 455, + 504, 381, 342, -877, -506, -812, -805, 3031, + -249, -518, -69, 564, 243, 261, -332, -434, + -173, -37, 61, 45, -5, 6, -1433, -1009, + 1428, -951, -582, 154, 143, 625, 383, 387, + -1392, -1222, -578, 229, 1294, 218, -142, 355, + -149, 201, -1341, -1135, -857, -767, -273, 2059, + 255, 578, 350, 315, -1041, -617, 254, -504, + -255, -96, -537, -396, 363, 1074, -1361, 484, + 538, -789, -704, -447, 200, 521, 213, 90, +}; + +static const int16_t fcb8sm[] = { + -1183, -1170, -867, -948, -746, 492, 1531, 1412, + 524, 82, 590, -994, -916, -859, -680, 12, + 742, 961, 230, 255, 34, 38, -176, -1, + 1880, -240, -769, -531, 269, -32, -772, -494, + 757, -583, -677, -281, 717, 440, 561, 91, + -1121, -1054, -1189, -1100, -745, -417, -61, 302, + 3079, 1817, -1384, -1479, -1477, -1509, -1077, -323, + 902, 2348, 1464, 1038, -487, -179, -447, -311, + -296, -439, -172, 2166, 245, -28, -1050, -390, + -238, 633, 302, -335, 843, -52, 185, 230, + -110, -433, -690, 148, 63, -289, -404, -469, + 1948, 245, 2016, 1337, -341, -554, -617, -457, + -436, -459, -400, -520, -661, -7, 1078, 971, + -326, -332, -23, -749, 83, -104, 2106, -947, + -867, -883, -705, -433, -35, 164, 427, 646, + -924, 2196, -656, -798, -282, 217, -227, 134, + 446, -15, -584, 33, 185, -571, -159, 1852, + -405, -94, -61, -83, -329, -516, -394, -450, + -173, -140, -54, -156, 226, 1850, -752, -1304, + -1378, -1275, -1017, -680, -337, 356, 1131, 4143, + -1120, -1253, -1269, -860, 90, 973, 152, 886, + 609, 1454, -29, 36, -117, -815, -651, -346, + 2085, -414, 24, -93, -235, -1103, -1132, -758, + -98, 1497, 1285, -289, -34, 402, -646, 637, + 2147, -677, -350, -266, -232, -61, -199, -359, + 167, 1546, 816, -453, -35, -251, -468, -491, + -371, -593, -878, 1445, -795, 651, 108, -155, + -201, -14, 250, -271, -732, 793, 154, -288, + -86, 16, 557, 642, -592, -587, -87, -365, + -309, 1753, -40, 95, -529, -87, -214, -234, + 4999, -466, -755, -800, -785, -722, -532, -703, + -526, -465, 591, 3937, -229, -804, -808, -698, + -576, -613, -506, -725, 10, 13, -117, -55, + 101, 52, 125, -76, -25, -28, 1469, -245, + 8, -25, 65, -53, -262, -282, -411, -588, + -667, 1374, 304, -787, -661, -675, 55, 320, + 720, -4, 366, -103, -136, -332, -314, -293, + -38, 127, 151, 380, -1330, -1338, -618, -40, + 1284, 1500, 466, -515, 105, -161, 19, 697, + -417, -559, -317, -712, -756, -567, 754, 1481, +}; + +static const int16_t fcb11l[] = { + -1291, -1237, -1175, -1186, -1139, 524, 1225, 1464, + -1042, -721, -901, 41, -728, 822, -657, 1078, + -483, 1530, -489, 1253, 926, -326, 404, 89, + -1191, -1170, -1237, 1633, 1493, -465, 986, 1184, + -857, -832, -300, -811, -936, -667, -254, 492, + 4044, -1136, -983, -855, -592, -199, 383, 876, + 2076, -1042, -1019, -729, 1435, -25, 64, 845, + -991, -921, -861, 916, -402, -551, 236, 429, + 5253, -1233, -1268, -414, 1793, -463, -569, 1693, + -1197, 6322, -887, -211, -945, -540, 626, 903, + -993, 1500, -490, 1445, -764, -136, 321, 548, + 462, -228, 127, -322, 481, -183, 88, 155, + -809, -844, -959, 4011, -581, -232, 330, 986, + -900, -916, -1069, -866, -979, -439, 4016, 1558, + -1023, 2121, 1717, -612, -588, -446, 223, 430, + 2567, -972, 2118, -1030, -900, -664, 180, 858, + 3232, -991, -1132, 2119, -446, -548, -258, 895, + -962, -184, 2639, 1081, -661, -222, 292, 530, + -952, 1767, -213, -701, 1079, 37, 131, 489, + -875, -749, 3167, -776, 1247, -109, -83, 636, + -1146, -1070, -1001, -1064, -942, 2891, 1137, 1585, + -1314, -632, -1179, -1105, 1101, 51, 2038, 2036, + -926, -727, 180, 1515, -566, 1191, 101, 595, + 2247, -364, -315, -105, -130, -79, 121, 210, + 7994, -1302, -898, -785, -758, -777, 31, 415, + 744, -652, 688, 1226, -649, -605, -268, 314, + 611, 662, -240, -411, -698, -434, 377, 339, + 953, -810, -931, 1054, -484, -298, 721, 522, + 922, -1046, -952, -871, -618, -270, 419, 635, + 1006, 129, -838, -724, 220, 481, 253, 329, + 205, -456, -724, 675, 598, 332, -14, 291, + -1016, -695, 542, 1270, 498, -456, -113, 362, + -547, -1068, -1178, -1261, -1161, -905, 390, 2204, + -1056, -1102, 5611, -1100, -1076, -902, 360, 978, + -538, -286, 1253, -430, -457, -148, -1, -60, + -1116, -955, 2869, -926, -680, 1111, 706, 842, + -1311, -1275, -1150, -236, 675, 897, 758, 912, + 1886, -1115, -999, -84, -588, 2190, -171, 739, + -737, 150, -902, -854, -917, 334, 557, 534, + -851, -39, -25, 214, -136, -73, 263, 234, + -1021, 1332, -543, -655, -712, -651, 80, 479, + 1555, 1933, -707, -485, -206, 139, 312, 405, + 2472, -1172, -945, -939, -713, 568, 1421, 684, + 70, -1263, -1235, 586, -195, -1065, -449, 3182, + -1143, 529, -926, -558, 419, 390, 375, 563, + -1090, 3370, -688, -528, -346, 136, 317, 615, + -803, -977, -1082, -806, 3607, -443, -156, 1130, + -1288, 1585, -1218, -1226, -979, 359, 1555, 1402, + -341, -416, -480, -360, -415, 542, -148, -322, + -1095, -1074, 762, -864, -634, 1770, 340, 466, + -1040, -834, 1508, -707, 143, 74, 1418, 905, + -1094, -710, -549, -860, 373, 1492, 2024, 741, + -938, -910, 2661, -1087, -1105, -901, 383, 906, + 755, -819, 581, -612, -420, 305, 344, 363, + -356, -991, -845, -1051, 2112, 1738, 554, 954, + -1028, -943, -892, -896, -236, -674, 1076, 679, + -611, -1099, -859, -914, -444, 910, 491, 709, + -1063, 775, 496, -669, -304, 672, 261, 496, + -1086, -963, 1037, -639, -134, -577, 33, 607, + -1070, -649, 730, -748, 1884, -18, 346, 627, + -1089, -1118, -955, 751, -690, 606, 1204, 1037, + -1016, -1095, 473, -919, -1036, -685, 1744, 1216, + -834, -916, -920, -634, 1086, -474, 161, 620, + -997, -899, -25, -499, 399, 405, 163, 401, +}; + +static const int16_t fcb11s[] = { + -1148, -1134, -1000, -585, 715, 774, 626, 650, + 2109, -898, -729, -239, -213, 847, 77, 371, + -902, -790, 1853, -871, -816, 163, 295, 377, + 1718, -1070, -840, -791, 1612, -129, 144, 450, + -830, 1909, -539, 803, -411, -188, 122, 148, + 1202, 705, -696, -578, -213, -25, 126, 142, + 3309, -1083, -865, -771, -470, -237, 980, 521, + 428, -995, -1003, 3088, -1000, -455, 320, 503, + -615, 1746, -751, -734, 1092, 31, 97, 225, + -1175, 2287, 1278, -421, -315, 91, 130, 120, + -1203, 4211, -970, -878, -228, 71, 327, 288, + -1012, -850, 1471, -732, 1228, 201, 146, 271, + -868, -528, 1196, 744, -186, 85, 38, 153, + -1081, -895, -742, 1014, 1110, 66, 237, 335, + -1012, -1137, 4357, -1062, -569, 377, 268, 445, + 1203, -717, 1070, -541, -72, -29, 91, 104, + 6448, -1148, -1069, -810, -659, 118, -284, 300, + -1085, -940, -214, -621, -781, -622, 1789, 711, + -1165, 1643, -890, -809, -533, 148, 384, 373, + -910, -986, -855, -1032, 3647, -478, -132, 713, + -3, -674, -1036, -956, -899, 2698, 629, 665, + -764, -1066, -1173, -1058, -692, -144, 1114, 3195, + -1012, -643, -670, 1547, -576, 351, 251, 273, + -950, 563, -742, 248, -149, 514, 100, 185, + -193, -616, -655, 255, -364, -323, 172, 256, + 308, 228, 16, -187, -243, 219, 88, 53, + -1024, 664, 450, -416, -189, -239, 43, 102, + -64, -499, -159, -400, 905, -64, -68, 46, + -1055, -77, -813, -661, 59, -77, 226, 321, + 1224, -553, -436, 793, -155, -83, -5, 72, + -652, -897, -157, -579, -539, 846, 181, 318, + 782, -967, -802, -569, -6, 364, 540, 513, +}; + +static const int16_t fcb11m[] = { + -453, -1087, -1133, -1125, -852, -158, 1152, 3313, + 1015, -444, 1085, -465, -317, -298, -471, -238, + -647, 1426, -241, 149, -300, -169, -19, -228, + 3282, -269, -1025, -1069, -1097, -1071, -539, 1303, + 1111, -933, -741, -801, -553, 98, 393, 1031, + -786, -729, -835, -810, -78, 1569, 631, 944, + 1031, 651, -409, -397, -346, -221, -99, -216, + -88, -211, -419, 193, 1298, 196, -221, -879, + -1036, -1303, -1282, -1052, -575, 283, 3110, 1337, + 489, -463, -640, 112, 341, -322, 261, 266, + 1646, -817, -1256, -1273, -1217, -1031, -142, 3691, + 3012, 1564, -289, -830, -970, -1032, -1075, -989, + 556, 52, -588, -589, -613, -748, -352, 2054, + -69, -785, -718, -499, -141, 192, 1396, 446, + -3, -514, -612, 3, 171, 1067, -114, -109, + -812, -893, -776, -342, 1428, 421, 438, 552, + -933, -1143, -207, 1312, 791, 166, -198, -79, + -632, 1122, -537, -620, 450, 97, -85, 174, + 1760, 123, -168, 485, -77, -567, -776, -952, + -758, -1176, -1322, -1355, -1207, -928, -177, 6229, + -413, 261, -327, -848, -725, -395, 849, 1533, + -201, -124, 2976, -335, -703, -674, -727, -949, + -521, 209, 1004, 838, 56, -477, -751, -603, + -922, -615, 1832, -448, -329, -148, 73, 467, + 4991, -86, -809, -928, -951, -956, -819, -751, + 1841, -790, -712, -116, -113, -91, 0, -388, + -729, -196, 758, -377, 68, 85, 428, -35, + -5, 2, -9, 18, -31, 53, -23, 26, + -896, -445, -188, 818, -347, -44, 502, 578, + 101, 2968, 269, -724, -702, -747, -719, -673, + 7587, 68, -1171, -1377, -1441, -1455, -1473, -1178, + 699, 585, 15, 2257, -503, -940, -1085, -1288, +}; + +static const int16_t fcb11sl[] = { + -1502, -1463, -1336, -1177, -367, 89, 475, 867, + 550, 820, -805, -580, -803, -89, -817, 1691, + -304, 120, 36, 564, 409, -525, -820, 362, + -969, -870, -605, 1983, 993, 722, 1505, 1101, + -842, -848, -918, -379, -71, 257, 499, 607, + 1619, -956, -1024, -869, -744, -74, 795, 684, + 532, 634, -1360, -818, 49, -981, 111, -473, + -718, -477, 377, 710, -1399, -1105, -1152, -1024, + 2426, -356, -191, 1079, 911, 1164, -809, -791, + -919, 2731, -851, -400, -113, 242, 508, 847, + -1229, 1199, -910, 1127, -686, -383, 26, 352, + 536, 646, -790, -1243, -1103, -1170, -1132, -1065, + -788, -521, 161, 3842, -1098, -883, -1052, 8, + -1103, -747, -552, -480, -241, 820, 3392, -770, + -770, -724, -588, -426, -153, 426, 639, 724, + 1626, -713, 1157, -736, -492, -512, -160, 461, + 569, 583, -1351, 1332, -1222, -1358, 240, 1541, + -724, 612, 1583, 1194, -1061, -990, -671, -969, + -952, 2368, -442, -413, 1933, 1023, -144, -283, + -992, -940, 983, -232, 818, 341, 502, 549, + -1420, -1268, -1279, -1213, -621, 2019, 685, 1948, + 1264, 1200, -1293, -664, 392, -848, 866, 1191, + -220, 95, 450, 640, -1334, 1098, -751, -701, + 1296, -347, -92, 233, 532, 599, -952, -694, + 3085, -908, -256, -494, -177, 123, 809, 941, + 18, -1089, -801, 303, -761, 11, 632, 288, + 476, 518, -241, -1138, -1068, -869, 292, 121, + -26, -96, 457, 548, -106, -784, 930, -700, + 1842, -812, -617, -307, 430, 655, -698, 1157, + 947, -803, -662, -743, -49, 1120, 348, 578, + 855, -1049, -753, -67, 710, -347, -28, 694, + 411, 468, -61, 239, 23, -1072, -757, 477, + -658, -362, 239, 576, -1479, -1279, -1286, -677, + -939, -722, 3217, 338, 1562, 1566, 925, 917, + -697, -708, 645, -447, -280, 714, 503, 552, + -1050, -1021, 889, -956, -934, 705, 457, 616, + 556, 667, -1331, -51, -256, -48, -234, 240, + 757, -74, 148, 356, -1278, 1538, 234, -372, + -472, -221, -424, -494, 170, 551, 216, 294, + -885, 231, -263, 334, -64, -54, 291, 350, + -1140, -1074, -1199, -1374, -1278, -845, -547, 667, + 4544, 1922, -899, -930, -954, -1120, -1092, 1156, + 1889, -404, 259, 1114, -956, -836, 881, -316, + -977, -860, 202, -249, 121, 816, -1188, 3644, + -829, -876, -670, -473, -161, 420, 851, 886, + -1014, 1191, -938, -958, -864, 741, 241, 957, + 288, 629, -1155, -898, 1104, -789, 28, -867, + -580, 2588, 836, 1234, -953, -749, 934, 1137, + -310, -177, -113, 244, 532, 424, -341, -602, + -880, -1105, -303, -381, -527, 1943, 126, 759, + -1277, -1037, 59, -783, 485, -589, 1341, 737, + 488, 709, -1473, -1208, -1082, 589, 791, 735, + 447, 322, 835, 731, -1116, -681, -592, 704, + 520, -545, -104, -24, 263, 458, 632, -721, + -1086, -1223, -1150, -866, 1537, 2815, 123, 1097, + -1238, -861, -1217, -1238, -1261, -914, 1165, 422, + 711, 883, -1196, -972, -428, -230, 171, 8, + -448, 1195, 445, 440, -413, -139, -375, -568, + -781, -520, 611, -586, 881, 589, -724, 972, + -907, -794, -819, -641, 1650, 66, 254, 703, + -1380, -1168, -967, 676, -765, -537, 578, 1542, + 687, 833, 1151, -811, -948, -995, -246, 1301, + -377, 262, 632, 652, 1530, -679, -682, 993, + -666, -457, -72, -20, 317, 516, 861, -528, + 24, -579, -386, 53, 526, -76, 66, 345, + -59, -612, 165, -181, -98, -34, -66, 286, + 95, 108, -1118, -147, 643, -1055, -768, -502, + -587, 27, 2113, 811, -1219, -947, -811, -1188, + 1143, -609, -753, 88, 2844, 1424, -1428, -1082, + -1273, 1086, -1206, -1171, 279, -510, 2325, 1757, + -1437, 654, -1278, -1267, -1117, -950, 779, 2205, + 1150, 1101, -1484, -1009, -1199, -1416, -1215, 657, + -737, 634, 1266, 1742, -1445, -1193, -1358, -1158, + -1015, -995, -655, 4035, 1966, 1903, -1069, 954, + -1099, -1171, -1029, -818, -576, -104, 1390, 1069, + 559, -914, -1034, -1152, -987, -582, -222, 394, + 1204, 775, -1464, -51, -959, -1005, -452, 347, + -94, 1, 525, 595, -1324, -1226, -1102, -825, + -927, -776, -582, 175, 1675, 632, -859, 28, + -914, -209, -468, -625, -230, 646, 579, 446, +}; + +static const int16_t fcb11ss[] = { + -1351, -1229, -1174, -767, 1403, 182, 532, 445, + 415, 610, -1095, -771, -1142, 3221, -803, -680, + -302, 318, 441, 438, -1188, 1145, 1552, -528, + 887, -547, -429, 124, 99, 128, -768, 1049, + -562, 1121, -593, -96, -105, 105, 251, 154, + 1684, 1598, -635, -685, -177, -211, -268, 234, + -118, -49, -719, -873, -1092, -985, -678, -406, + -234, 407, 653, 3195, 991, -584, -874, -14, + -683, 2964, -769, -450, 287, 350, 853, -803, + -574, 1761, -410, -60, -230, -78, -21, 19, + -1271, 4435, -673, -790, 110, -243, -81, 147, + 191, 145, 5571, -611, -634, -699, -195, -281, + -249, -302, -272, -67, -893, -656, -745, -697, + -550, -639, -409, 3085, 383, 798, -311, -340, + -564, -787, 3628, -332, -510, -219, 465, 351, + -747, -1084, -972, -727, -404, -630, -176, 437, + 3352, 978, -886, -751, -767, -580, -693, -942, + -803, -158, -36, -3, -966, -674, 3075, -926, + -172, -9, -40, 111, 169, 212, 181, -811, + -715, -986, -521, -686, 3915, 18, -58, 499, + 210, -1187, -903, -915, -522, 1038, 477, 788, + 290, 412, -1010, -791, -700, -710, 34, 1774, + -256, 96, 131, 241, -1251, 2086, -5, -765, + -446, 141, 93, 160, 88, 129, -1153, 1171, + -1192, -1073, -391, -187, 206, 416, 444, 648, + 707, -542, -504, -750, -623, -648, 776, 692, + 165, 330, 1112, -1199, -876, -428, 949, 65, + 250, 104, 108, 173, 2147, -905, -846, -540, + -376, -131, -113, 124, 314, 485, 1253, -515, + 1435, -527, 21, -100, -368, -84, -119, -144, + -1375, -1189, -1189, -999, -723, -190, 796, 639, + 699, 816, -1188, -919, 683, 842, 177, -62, + -25, 71, 15, 16, 157, 80, -331, -343, + 12, 193, -133, -94, -94, -64, -1306, 531, + -917, -142, 1274, 102, -15, 184, 159, 148, + -43, -1103, -581, -419, 447, -132, -204, 187, + 631, 461, -1302, -1162, -927, 896, 203, 164, + -55, 287, 544, 485, -1258, -791, 677, -945, + -244, -101, 423, 362, 298, 389, -825, -640, + -646, 274, -73, -274, 1473, -13, 132, 169, +}; + +static const int16_t fcb11sm[] = { + -767, -1179, -1188, -1069, -690, -172, 787, 1389, + 1623, 844, -169, -894, -919, 51, 15, 426, + -326, 1579, 182, 77, 202, -417, -357, -17, + 2154, -77, -607, -589, -375, -261, -376, 175, + -829, -801, -579, -290, -244, 533, 1307, 873, + -877, -1175, -1157, -726, 461, 1729, 433, 219, + 246, 606, -791, -827, 649, 891, 820, 720, + 407, -641, -727, -708, 2498, 961, -99, -542, + -530, -507, -536, -608, -642, -622, 316, 195, + -721, -549, -253, 1520, 171, -81, -372, -333, + 1166, -1072, -1230, -1123, -1031, -868, -370, 209, + 1561, 1751, 113, -367, 399, -663, -10, -271, + 950, 118, -335, -272, -863, 60, -875, 1850, + -242, -276, -38, -106, 471, 30, 823, -344, + -752, -714, -309, -419, 86, 1604, -250, -185, + -839, -703, -561, -281, 1813, -57, 255, 266, + -32, 99, 400, 2520, 315, -372, -306, -511, + -549, -659, -760, -729, -559, -137, -610, 174, + 924, -310, -705, -307, 885, 512, -611, -1097, + -1172, -1072, -758, -527, -192, 278, 740, 3398, + -1136, 409, -230, -353, -137, 322, 326, 365, + 133, 173, 2291, -644, -725, -596, -535, -340, + -88, -65, -53, 273, -760, -390, -649, 119, + -243, -222, 1726, -113, 44, 326, -618, 311, + 2345, -241, -398, -399, -382, -322, -444, -457, + 1873, -454, -505, 42, 481, 187, -49, -505, + -634, -754, 1052, -597, 1315, 297, -412, -110, + -205, -552, -682, -524, -1055, -431, 971, -363, + -539, -366, 39, 995, 181, 476, 662, 229, + -445, 1682, -205, -181, -273, -497, -685, -628, + 6135, -21, -834, -934, -1002, -1066, -931, -974, + -902, -643, -820, 1891, -706, -288, -252, -231, + -79, 126, 35, 37, 10, -10, -36, -6, + -9, -47, -7, 1, 11, -2, 644, 315, + 145, -353, -396, -428, -357, -60, 275, 109, + -1179, -952, -698, 138, 286, 171, 394, 263, + 814, 495, -490, 110, 369, 599, 9, 599, + -431, -233, -328, -69, 410, -1002, -462, 77, + 97, 196, 133, -91, 512, 49, 621, -436, + -352, -390, -211, -188, -454, -318, 44, 1424, +}; + +static const int16_t fcb16l[] = { + -13, -798, -772, 235, 515, -181, -120, -509, + -392, -1159, -844, -1041, -881, -1193, 1103, -1080, + 214, 1615, 1819, 1510, -914, -1190, -273, -1099, + -522, -996, -206, 3946, 996, 1678, -1220, -1201, + 2850, -1022, 1101, -814, -188, 879, 1549, 1279, + -1129, 1928, 1550, 38, -356, -574, -157, 286, + 481, 475, -1079, -1176, -861, -548, -657, -381, + 538, 948, -838, 779, -1149, -962, 1788, -779, + -742, -311, 205, 299, 472, 715, 702, -843, + -931, -790, -624, -332, 324, 778, 785, 670, + -1137, -1205, -103, -1182, -1071, -950, 101, 527, + 1596, 1004, 682, -564, -1053, -844, -1184, 1732, + -862, 1994, -988, 1131, -1069, -1276, -1053, 6414, + -1259, -186, -930, 118, 375, 1092, 6215, -900, + -920, -935, -981, -970, -766, -902, -334, 1629, + -1094, -1142, -1155, -779, -1092, 1011, -490, 1063, + 1569, 1340, 2242, -1313, 6027, -1319, -1337, -789, + -1296, -457, 819, 2276, -1071, -1065, -715, 802, + -996, 397, 2396, -27, 1225, 935, 1400, -862, + -802, 1846, -513, -249, -704, 515, 872, 662, + -1141, 5876, -691, -404, -603, -148, -57, 187, + 649, 788, -1116, -915, -551, 3843, -737, -133, + 498, 155, 227, 718, 1798, 1397, -868, -716, + -586, -580, -71, -67, 311, 536, 2465, -524, + 1837, -231, -210, 263, 231, -10, -164, -324, + -951, -1130, 5206, -525, -603, -401, 223, 438, + 1011, 1077, -726, -1102, -1013, -386, -786, 4281, + -329, 262, 550, 1292, -629, -943, -976, 773, + -867, 908, -680, -154, 362, 1056, -1051, -703, + -1333, -1424, -1026, -793, -859, -882, -148, 9958, + -1193, -1156, -1077, 1241, -1013, -726, -139, 551, + 1150, 1019, -733, -997, -651, -625, -54, 722, + 73, -14, 361, 435, 4013, -1260, -1195, 1452, + -1105, 1273, -670, 1546, 1038, 1680, -812, -1060, + -853, -1058, 2094, -801, -457, -320, 683, 960, + -1019, -1158, -1118, -1034, -617, 404, 1376, 847, + 1014, 951, -12, -1004, -1221, -1131, 649, -1052, + 442, -167, -859, 3868, -1216, -1298, -1311, 2866, + -1310, -639, -1079, 1576, 1760, 1837, 118, -1080, + -862, -845, -1065, -1069, 2199, -766, 495, 1309, + -996, -1040, -741, 1357, 1726, 382, 264, 92, + 659, 665, -781, -1356, 2055, -1198, 15, 2143, + 631, 569, 918, 1120, -948, -1253, -1234, 2442, + -1062, 2206, 48, 660, 1822, 1480, -639, 627, + -432, -477, 845, 216, 228, 152, 157, 295, + 2444, -908, -465, -768, 109, 251, 72, -59, + 169, 405, 4395, -837, -931, -839, -215, -564, + 655, 359, 503, 296, 3514, -1082, -1185, -827, + 2879, -1224, -811, -970, 804, 911, 3028, -1284, + -688, -1226, -1251, -551, -1247, -275, 3441, 2322, + -630, -1213, -108, -1191, 1129, -854, 2848, 1609, + 1048, 1535, 2784, -1245, 772, -1230, -1298, -686, + -1293, -639, 278, 2455, 9975, -1077, -1233, -1055, + -139, -853, -48, 24, -720, 533, -1191, 2809, + -1015, -899, -28, -765, -147, 146, 592, 814, + 12493, -1274, -1072, -1297, 877, -1068, -1179, -1032, + 1023, -1178, -840, 930, -660, 1216, -366, -406, + -97, 77, 179, 340, -973, -993, 2280, 1775, + -631, -17, -186, 507, 459, 645, 2095, -1019, + -1067, -949, -857, -1202, -904, -48, 1156, 1273, + -1230, -1245, -1203, -1036, -1150, -955, 1193, 1943, + 1437, 1329, -618, -1055, -730, -1014, 4953, -1125, + 1089, 1085, 1047, 1045, 813, -1036, 1270, -715, + -684, -96, -131, 289, 782, 628, -979, 1060, + -975, -964, -811, -14, 223, 422, 563, 696, + -901, -633, 496, -136, 22, -83, -52, 264, + 24, 147, -446, -1197, -1258, -687, -1239, -795, + -1066, -1196, 147, 2653, -1231, -1275, -1240, -1041, + -1260, -1159, 1961, -34, 2937, 2128, -1318, -1355, + -1326, -1300, -1345, -1326, -870, -298, 2014, 3890, + -933, -1014, -859, -1074, -506, -1163, -954, -819, + 440, 732, -582, -1268, -1206, -1037, -1081, -1255, + -1150, -835, 2360, 1469, -1232, -1384, -1388, 542, + -1359, -606, -1335, 1852, 2142, 3722, -1218, -1321, + -1268, -1207, -1203, -1316, -954, -696, 4730, 2920, + -1225, -1306, -1131, -1273, -1276, -1238, -1040, 2079, + 2652, 1931, -1167, -1302, 659, -532, -650, -560, + -1028, 186, 1224, 2811, -896, -449, -999, -823, + -81, -876, 502, -293, 680, 733, -836, -1111, + -1132, -865, -1141, -938, -980, 1287, 581, 1438, +}; + +static const int16_t fcb16s[] = { + 1260, -1427, -1400, -996, -958, -1195, 6261, 31, + 967, 752, 3776, -975, -840, -707, -696, -555, + 45, 1159, 4, 358, 4718, -1471, -1464, -1291, + -1364, -934, -878, 5198, -273, 1555, -1438, -1729, + -1579, -1470, -1820, -1436, -1255, -631, 4287, 4025, + 1233, -684, -748, -742, -547, -229, 321, 126, + 794, 670, 6689, -1041, -1160, -861, -1002, -976, + 147, -668, 521, 940, -1186, 2097, -570, 1759, + -251, -442, -92, 46, 99, 12, -1336, -1061, + 4427, -945, -861, -460, -306, 494, 481, 536, + -1101, -1105, 2695, 316, -801, -159, 1042, -577, + -78, 340, 2347, 1448, 135, -381, -688, -493, + -254, -234, -74, -80, -1047, -1246, -729, -985, + 5399, -1018, 643, 822, 889, 432, -328, -1386, + -1420, -702, -1450, 6927, -1107, 465, 1625, 1116, + -1258, 2847, -893, -895, -521, -263, 112, 157, + 556, 500, 182, -652, -226, 258, -638, -566, + -419, -669, -224, -221, -1197, -227, -582, 92, + 1914, -184, -11, -18, 270, 166, -1294, -62, + 1536, 2470, -413, -619, -399, 24, 106, 54, + -1223, 2672, 2400, -54, -577, -692, -301, -3, + 206, 89, -1424, -1491, 8425, -1072, -242, -420, + -194, -1, 489, 331, -938, -1319, 2493, -1355, + 551, 2297, 197, -9, 717, 434, -1237, -773, + -1021, 3945, -566, 116, 246, 150, 510, 370, + 11804, -457, -1006, -1231, -1175, -1086, -1221, 589, + -679, -757, -1183, 6502, -584, -454, -629, -570, + -413, -352, -279, -32, -1236, -946, -760, 1535, + -865, -712, -224, 343, 647, 613, -1348, -938, + -961, 8273, -1130, -591, -225, 210, 420, 140, + -1247, -1166, -966, -986, -1120, -907, -181, 470, + 1888, 1161, -1076, -1298, 3479, -1151, 2410, -396, + 1, -44, 357, 594, -896, 745, -33, -422, + -332, -259, 0, 48, 143, 190, -1009, -837, + -876, -371, -370, 1520, -150, 251, 240, 448, + -1024, -1008, -568, -450, -611, -536, 1763, -34, + 355, 454, -769, -599, -639, -737, -912, -725, + -504, -230, 532, 3294, -1077, -289, -875, -542, + -574, -604, -339, 2511, 479, 742, -1218, -946, + 1321, -522, -544, -950, -765, 632, 639, 497, +}; + +static const int16_t fcb16m[] = { + -940, -1197, -1190, -1200, -1192, -960, -718, 610, + 3300, 3253, -1515, -1689, -1798, -1798, -1793, -1764, + -1616, 33, 2377, 7778, -668, 1745, 1501, 785, + -336, -823, -708, -446, -455, -812, 8862, 159, + -1141, -1261, -1323, -1299, -1261, -1227, -1214, -1090, + 3584, 2092, 688, -531, -848, -1000, -1047, -1192, + -1104, -887, 5163, -347, -1129, -1285, -1336, -1291, + -1249, -1109, -498, 2511, -611, -703, -516, -240, + -68, 399, 1570, 252, -5, 43, -1163, -1168, + -1008, -921, -995, -569, 925, 1511, 1001, 2023, + 12926, 135, -1598, -1778, -1847, -1850, -1836, -1734, + -1695, -1690, 621, 4647, 588, -752, -973, -996, + -953, -1081, -1060, -672, -868, 259, 4940, -117, + -718, -907, -828, -776, -606, -981, -1002, -526, + -385, 527, 1501, -239, 38, 25, 112, -77, + 1122, -250, -352, -1113, -1101, -942, -681, 5156, + -800, -636, 5814, -160, -777, -825, -844, -747, + -697, -645, -668, -492, -936, 491, -280, 2573, + -269, -736, -375, -265, -98, -243, -920, -236, + 446, 1095, -666, -600, -246, 783, 282, 0, + -1064, -116, 2271, -118, -482, -240, -187, -271, + 36, 91, -695, -254, -383, -948, 745, 2722, + -129, -799, 238, -379, 2872, -516, -868, -623, + -551, -275, 22, 379, -185, -230, 1524, -672, + -1062, -1164, -1177, -1137, -1058, -790, 6, 4928, + -551, -389, -460, -394, -674, -586, -327, -178, + 615, 2868, -1467, -1203, -1316, -1120, -996, 747, + -219, 2023, 1875, 254, -871, -992, -1062, -1110, + -1149, -992, -492, 40, 528, 5374, 83, -559, + -862, -760, -541, 28, 207, 629, 502, 1260, + -473, -1110, -1336, -1390, -1412, -1379, -1329, -1081, + -238, 9844, -1332, -1306, -1275, -881, -1267, -1249, + -237, 2882, 3535, 584, -13, 52, -50, -4, + 7, 5, 20, -55, 5, 45, 1587, 350, + 191, 617, 153, -236, -336, -649, -798, -1063, + 1451, 707, 253, -733, -923, -859, -621, -738, + -555, 1623, 1727, -411, -724, -772, -746, -675, + -688, -209, 915, 622, -1038, -474, -343, -91, + -173, -104, 255, 96, 1547, 773, -625, 2272, + -90, -509, -527, -247, -147, -234, -45, 166, + 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, +}; + +static const int16_t fcb16sl[] = { + -1337, -1122, -1559, -1452, -1353, -973, 3858, 1145, + 1225, 2103, -607, -181, 557, -429, 15, -496, + -444, -523, -1866, -1134, -1270, 3029, -1110, -798, + -824, -659, 44, 614, 1059, 1173, 714, -932, + -1095, -1061, -921, -1034, -873, 7, -872, 660, + -1335, -1496, -1623, -1405, -1070, -680, 943, 134, + -190, 2837, -1034, -221, -337, -540, -571, -173, + -411, 2314, -111, 970, -1220, -1036, -1096, -147, + 1087, 604, -367, 83, 461, 679, -1333, 194, + -1292, -1139, -1097, -570, -508, -109, 54, 962, + 2592, -1112, -944, -636, -521, 12, 230, 442, + 562, 624, -1107, -1190, 1554, -981, 1507, -1013, + -394, 595, 823, 1094, -1453, -1298, 242, -1185, + -686, -541, 858, 331, 695, 1197, -1259, 968, + -1180, -1254, -752, 1473, 222, 342, 973, 1029, + -1631, -1500, -1619, -1517, -1299, 1683, 2203, 1163, + 1225, 1497, -1189, -937, -931, 3193, -977, -708, + -262, 549, 917, 1465, 704, -565, -708, 846, + -130, -322, -257, 221, 367, 309, -1416, -1123, + -1323, -1260, -405, 3303, -210, 785, 1007, 1616, + -1043, -717, 44, 824, 419, -492, -579, -604, + -15, 676, -1067, -1079, 3897, -1211, -474, -1020, + -589, 114, 593, 1504, -1481, -1249, -1036, -1012, + -719, 846, -189, -297, -31, 1209, -1761, -1566, + -1449, -1645, -1464, 1422, 24, 2153, 1377, 1948, + -1480, 652, -929, -415, -689, -386, 1628, 489, + 487, 756, -1424, -805, 1241, 228, -697, -316, + 423, 660, 557, 587, 1248, -777, 1088, -848, + -498, -399, -60, 169, 497, 689, 5679, -778, + -1109, -1118, -895, -1042, -504, 390, 1670, 469, + 977, -929, -1173, -1058, -999, -696, 1912, 52, + 1297, 1081, -1469, -1243, -1055, 385, -529, 910, + 79, 508, 1225, 753, 656, -1307, -1239, -1470, + -1110, -1255, -362, 2351, 889, 1687, -1566, -1331, + -1410, -1385, 779, -499, -217, 936, 2064, 1493, + -1499, -1345, -1162, 790, -1115, -673, 2083, 1010, + 588, 1265, -1439, -1168, -1294, 752, -1421, -1234, + -169, -529, 1606, 2131, -1556, -1442, -1444, 487, + -1260, -1139, 360, 2528, 1994, 1686, -1548, -1473, + -563, -1125, 967, 1490, 1503, 487, 991, 1024, + -1430, -1151, -1215, -729, -746, -762, -472, 778, + 889, 774, -1329, -1129, 1383, -1230, -723, 1478, + 379, 161, 1266, 1238, -1467, -843, -1277, -1323, + -715, 58, -182, 5140, 762, 1723, -1285, 1134, + -1175, -1057, 1294, -4, -417, 557, 939, 1182, + 39, 565, -809, -703, -783, -883, -112, 412, + 1056, 691, -273, -1334, -898, -1345, -1069, -1247, + -105, 638, 6811, 1157, 982, -856, -805, -1093, + 1267, -747, -650, 311, 281, 1076, 1371, 1614, + -891, -886, -396, -246, -65, 77, 472, 605, + -943, 178, -509, 112, -142, 512, -66, 109, + 144, 76, 2934, -1203, -1428, -1525, -1269, -1618, + -1129, -184, -225, 3157, -249, -1276, -1055, -439, + -161, -268, 284, 614, 778, 670, -1243, 1682, + 919, -468, -479, -341, 31, 468, 325, 606, + -1081, -723, 83, -399, -275, -658, 240, 149, + 2746, 679, -1573, -1287, -494, 775, 975, -751, + -47, 1758, 652, 1155, -1465, -1073, -1087, -1026, + 289, 340, 448, 1348, 351, 682, 2065, -1183, + -1313, -1562, -466, -1546, -1077, -477, 3012, 2512, + -1560, -1532, -1441, -1229, 861, -421, 1515, 2195, + 1163, 1418, -1268, -1103, -804, -1094, 3254, -711, + -558, 713, 1414, 1684, 542, -781, -827, -814, + -245, 1129, -160, 210, 386, 618, -1633, 488, + -1584, -1571, -1349, -662, 711, 1516, 1661, 1673, + -1510, -1530, 1013, -1172, 425, -1415, -856, 2963, + 2258, 1919, -744, -1208, -863, -634, -729, -1068, + -857, -289, 701, 6703, -1502, -1353, -1531, -1372, + -1388, -1067, 1392, 100, 2570, 1703, -1551, -1500, + -1587, -1693, -1753, -1431, -1048, 1162, 1308, 3073, + -998, -1575, -517, -1346, -1293, -1493, -1375, -1109, + -803, 2972, -1446, -1316, -1114, -1405, -1240, -1057, + -1109, -589, 2623, 1626, -1555, -1026, -1346, -1467, + -902, 1291, 176, 630, 4293, 1949, -1233, -1362, + -930, -1175, -1118, -1375, -1172, -967, 4896, 4195, + -1744, -1562, -1797, -1815, -1577, -1194, 371, 3326, + 3183, 3071, -1425, -1773, -1562, -1358, -547, -246, + 24, -526, -1502, 29376, -860, -614, -857, -795, + 793, -616, 1691, -125, 156, 559, -1643, -1462, + -1523, -1413, -1251, -592, 1014, 1888, 243, 1041, +}; + +static const int16_t fcb16ss[] = { + 308, -532, -811, -974, -641, -431, 3409, 258, + 567, 641, 1315, -723, -738, -502, 142, 678, + -67, -170, 73, -65, 2717, -804, -958, -878, + -532, -562, 238, 497, 548, 718, -868, -669, + -932, -1004, -518, -502, -286, 405, 2987, 1420, + 174, -779, -748, -575, -153, -40, 340, 413, + 275, 387, 965, 82, -550, -744, -592, -591, + -604, -163, 428, 843, -1280, 1756, -368, 777, + -29, -453, -61, 43, 50, 137, 950, -229, + 1504, -491, -353, -167, -285, -158, -94, -185, + -1431, 303, 673, -758, -610, -308, 1247, 348, + 95, 31, 1631, 1963, -624, -770, -466, -150, + -122, -123, 34, -141, -883, -374, -948, -629, + 3420, -772, -392, -31, 603, 646, -760, -871, + -936, -948, -727, 3563, -376, 858, 699, 561, + -1370, 2366, -775, -1241, -1105, -247, 177, 432, + 414, 379, -1360, -1057, -945, -848, -568, -779, + -632, -328, -295, 425, -349, 630, -275, -527, + 438, 47, -194, -96, -239, -545, -1381, -689, + 1644, 1165, -437, -153, -193, 307, 183, 66, + -1335, 2590, 2169, -447, -435, -317, -82, 204, + 45, -145, -1324, -205, 4019, -973, -578, 28, + 175, 506, 235, -98, -908, -294, 1443, -850, + -556, 1707, -277, 58, 241, -188, -853, -572, + -577, 1258, 1007, -190, 1, -3, 103, -49, + 5385, 137, -707, -834, -510, -517, -392, -390, + -231, -275, -1249, 5229, -812, -893, -353, -663, + -29, 187, 45, 10, -1388, -1171, -1051, 412, + -379, -411, 240, 574, 632, 284, -838, -912, + -924, 3062, -695, -409, -224, 422, 293, 267, + -1436, -1237, -1303, -1305, -914, -243, 821, 839, + 1043, 1284, -1178, -496, 1594, -736, 1752, -601, + -396, 330, 231, 48, -1253, 808, -896, -967, + -653, -84, 4, 442, 363, 589, -1005, -672, + -687, -93, -274, 1376, -232, -52, 399, 255, + -1085, -1214, -1088, -748, 1036, 414, 220, 509, + 436, 499, -648, -765, -931, -983, -758, -543, + -379, -115, 780, 3327, -1086, -893, -773, -881, + -683, -11, -322, 3418, 739, 961, -1363, -929, + 899, -1005, -792, -338, -185, 702, 627, 638, +}; + +static const int16_t fcb16sm[] = { + -1125, -1385, -1439, -1387, -1120, -681, -135, 616, + 3086, 2537, -1440, -1209, -1027, -1209, -626, 173, + 662, 899, 861, 2180, 387, 1032, 936, 140, + -353, -302, -290, -330, -551, -1019, 3555, -68, + -441, -539, -500, -27, -423, -506, -522, -415, + 2347, 1890, -312, -742, -679, -679, -653, -609, + -433, -472, 2709, -755, -1153, -1066, -1028, -862, + -826, -315, 78, 1699, -363, -429, -690, -190, + -358, -667, 1909, 39, -1, 138, -1592, -1559, + -1357, -1554, -750, 813, 1676, 1537, 977, -269, + 8320, -602, -1140, -1153, -1136, -1174, -1004, -1091, + -1388, -1187, -507, 3103, -200, -665, -590, -381, + -365, -40, -295, -591, -963, 271, 2231, -547, + -65, -270, -64, 243, -183, -548, -796, -277, + -7, -168, 1575, -361, 35, -19, 192, -154, + -384, 144, -426, -528, -598, -778, -297, 1847, + 564, 218, 864, -654, -485, -435, 45, 709, + 630, -11, -691, -111, -775, -356, -522, 2247, + -79, -433, -620, 594, 79, 60, -828, -475, + 768, -79, -655, 550, -201, 77, 858, -11, + -803, 1173, 1027, -971, -656, -648, -40, 17, + 720, 176, -1055, -936, -258, 550, 1086, 1065, + 0, -473, -364, 30, 53, -6, -54, -24, + 21, -81, -88, -45, -14, 81, 674, -1189, + -1049, -846, -489, -24, -47, 165, 658, 1909, + -241, -390, -387, -454, -319, -549, -307, -112, + 778, 1486, -314, 34, -93, -799, -538, 2219, + -445, 39, -38, -258, -427, -943, -760, -602, + -575, -450, 376, 668, 879, 1215, -1216, -784, + -646, -291, 275, 1019, -77, 124, 256, 1166, + -410, -993, -1145, -1118, -940, -825, -560, -131, + 1006, 4878, -1401, -1286, -1316, -1394, 177, -919, + 162, 2292, 1792, 1242, -762, 937, -168, -900, + -829, 203, 1225, 626, -122, -515, 992, -198, + -782, -25, 74, 1019, -606, -364, -350, -5, + 451, 324, 265, -1143, -820, 382, -362, 85, + -797, 693, 1594, -335, -229, -396, -211, -356, + -97, -115, 92, 49, -476, -1124, -1084, -594, + -228, 728, 16, 589, 1213, 841, -829, 1874, + -907, -1000, 1411, -621, -707, 356, 437, 37, +}; + +static const int16_t fcb22l[] = { + 2735, -1224, -1198, -1073, -1115, -1054, -713, 1693, + -1106, -1259, 722, -1256, -1223, 1686, 1589, 2003, + -906, 2529, 2141, -396, -338, -36, 52, 476, + 319, -420, 561, -492, -526, -359, -221, -254, + -752, -1136, -690, -896, 4307, -363, -42, 1363, + -717, -1036, -874, 2315, -952, -872, 262, 1418, + 737, 1374, -506, -470, -275, -126, 242, 428, + -678, -681, -581, 1016, -553, -509, -485, -408, + 9595, -1015, -1168, -932, -812, -690, -167, 753, + -935, -439, 2105, -526, -710, -570, 9, 548, + 530, -1308, -1060, -351, -974, -1038, 93, 5579, + -737, -1282, 1386, -1284, -1243, -1105, 790, 2169, + -701, -660, -555, 1317, 2805, 792, 2209, -490, + -758, -1262, -1083, -1073, 930, -810, -170, 2326, + -1213, -1286, 3435, -1135, -1051, 220, 3040, 1999, + -933, -663, -714, -855, -372, -599, -437, 373, + 5873, -987, -1081, -1003, -747, -271, 582, 1069, + -917, -754, 5676, -565, -616, -396, 177, 908, + 3106, 1459, -678, -543, -340, 47, 336, 493, + -1060, 1427, -560, -763, -710, -661, 193, 595, + -996, 2488, -588, -752, 1306, 114, 292, 689, + -1202, 2334, -1173, -1167, -755, 353, 1711, 1572, + -932, -751, 2099, 2025, -417, 62, 458, 611, + -981, 4387, -639, -560, -520, -152, 262, 748, + -828, -818, -682, 5250, -640, -270, 385, 1049, + -1072, -774, 1870, -668, 1514, -158, 283, 793, + -1087, -1150, -899, -875, -188, -184, 6656, 2311, + -906, 1654, -446, 1677, -654, -101, 364, 721, + -1272, 7928, -812, -576, -708, -347, 397, 1128, + 3830, -1034, -1055, 2244, -759, -706, 79, 893, + -922, -1067, 2740, -868, -858, 1129, 34, 1096, + 2455, -694, 1970, -650, -674, -131, 370, 697, + -1069, -1137, -948, -1045, -1087, -964, 367, 1091, + 4096, -960, -921, -870, 1397, -511, -190, 545, + -657, -1194, -536, -951, -1094, 117, -720, 2532, + -1098, -1147, -1177, 1764, -757, -121, 2372, 2010, + 3662, -952, -995, -894, -625, 464, 731, 863, + -607, -505, 401, -423, -540, 2144, 755, -430, + -1499, -1242, -1202, -1190, -626, 1249, 3388, 2379, + -983, -1090, -907, -1021, -1012, -870, 2723, 1589, + -913, 332, -102, 99, 226, 6, 176, 354, + 156, -36, -829, -774, -685, -15, 498, 503, + 2030, -409, -599, -572, -341, -2, 111, 302, + 788, -1002, -978, -929, -1001, -886, 578, 995, + 1237, -747, -696, -653, 1143, 62, 506, 571, + 994, -993, -902, -871, -662, 1527, 370, 979, + 980, -466, -484, 787, -261, 61, 250, 377, + -112, -676, -535, -344, 274, 363, 185, 334, + -48, -1144, -1095, -1011, -552, 445, 1355, 1207, + -1108, -1128, -1085, -826, -83, 2001, 1265, 1429, + -1024, 1199, -671, -701, -444, 1192, 187, 673, + -1039, -1056, -953, -732, 359, 714, 787, 935, + -1187, -1133, -1112, -971, 2158, 1720, 801, 2016, + -1056, -1068, -889, 1808, 503, 892, 358, 1041, + -1180, -1184, -1068, -788, 1423, -573, 2141, 1949, + -1042, -924, -849, 512, -629, -272, 779, 815, + 1939, -1069, -1092, -1027, -770, 48, 1554, 1285, + -1109, -1148, -1157, -1033, -934, 779, 1358, 1560, + -1053, 222, -1095, -1001, -681, -26, 1112, 1035, + -1168, -1285, -1169, -1180, -1085, -1097, 1313, 3112, + -928, -655, -811, -618, 1555, -480, 71, 467, + -1220, -1123, -1008, -577, -845, 3854, 491, 1878, + -1051, -761, 617, -650, -453, 51, 784, 757, + -993, -883, -905, -708, -869, 969, -64, 655, +}; + +static const int16_t fcb22s[] = { + 9854, -479, -1163, -1147, -1316, -1137, -991, -942, + 522, 739, -1042, -1306, -1040, -126, 1147, 3526, + 1880, -477, -483, -328, -899, 1063, 1243, -610, + -721, -527, -372, 171, 90, 196, 6615, -1167, + -1189, -1079, -954, -817, -833, 2246, 439, 1038, + -1053, -1136, -938, -805, -1022, -1041, -717, 2021, + 341, 935, -1164, -1230, -573, 1768, 11111, -1113, + -874, -631, -367, 7, -1077, -925, 1558, -850, + -918, -755, -512, 452, 260, 400, -787, -966, + -690, -584, -843, -802, 2092, 120, 103, 580, + -746, -512, -241, -621, 2771, -486, -268, 258, + 171, 232, -1265, -1253, 15128, -1123, -1037, -885, + -1109, -664, -659, -240, 1558, -909, -1160, -1247, + -1223, -1031, -989, -415, 3504, 1569, -651, -1241, + -1145, -1014, -1322, -1000, -354, 59, 709, 4206, + -1124, -986, -633, -976, -907, -636, -371, 255, + 1195, 876, -145, -1146, -1018, -992, -480, -762, + 6904, -703, -431, 1043, -1048, -638, -142, 394, + -852, -730, -533, -361, 234, 221, -1070, -930, + -764, 3210, -780, -256, 1777, 258, 307, 382, + -1224, 987, 4894, 3525, -412, -558, -819, -863, + -572, -497, -1175, -1197, 7637, -1109, -748, -116, + -306, 27, 386, 630, -1334, -1378, -1302, 12592, + -1327, -971, 89, -731, 259, 201, -1135, -951, + -585, -64, 3489, 2765, 43, 75, -527, -162, + 2865, -1344, -1394, -1391, -1231, -748, -962, 5403, + 719, 1418, -724, -1101, -955, -743, -937, -1064, + -1095, -601, -60, 411, -1113, -873, -603, 2913, + 2512, -339, -36, 26, -39, 78, -757, -998, + -522, -838, 5507, -973, 796, 536, 250, 312, + -1363, -944, 6021, -58, 5313, -690, -549, -485, + -66, -133, -1257, 6004, 6374, 1487, -976, -987, + -969, -803, -1027, -624, -967, 1744, 3504, 6, + -659, -691, -326, -129, -49, 148, -1032, -683, + 1819, 1804, -491, -452, -295, 33, -20, 42, + -1226, -1086, -792, 6412, -657, -278, -103, -25, + -82, 207, 2450, -6, 2417, 251, -622, -593, + -409, -193, -339, -304, -862, -667, 2457, -500, + -438, -504, 1408, 143, 203, 265, -1128, -1148, + 2791, -373, -951, 2129, -842, -278, 81, 307, + -787, -822, 2655, -604, 2028, -787, 4, 335, + 170, 219, 649, -457, 972, -607, -359, -470, + -238, 68, -57, 107, 2285, -526, -490, -604, + 179, -41, 230, 64, 20, 50, -802, 1168, + -235, -264, -316, 1469, -499, 108, 183, 150, + -1068, -806, -399, 1244, -355, 487, -57, 450, + 195, 248, -1122, -1096, 3327, -956, 1084, 1306, + 247, 442, 169, 283, 3416, -609, -891, -879, + -853, -573, -285, -147, 380, 608, 1271, -874, + -931, 40, -989, 1432, 1981, -34, 285, 190, + -902, -974, 4117, -868, -784, -584, -358, 200, + 261, 521, -945, -981, -773, 3517, -961, 2420, + 9, 318, 187, 322, -1006, -779, -526, 2972, + -712, -578, -576, 167, 156, 270, 460, -74, + -237, 939, -440, -515, 126, 63, 82, 67, + -1069, -1104, -923, -634, -190, 1151, 526, 2920, + 125, 566, -1144, 4199, 1314, -458, -568, -336, + -515, -332, -352, -143, -770, 283, -770, -785, + -807, -348, 93, 427, 181, 334, -798, -830, + -300, -509, 1257, -554, 1341, 6, 242, 272, + -1030, 62, 1293, 340, 752, -493, -6, -34, + 33, 85, -893, -1202, 244, -131, -306, 7590, + -832, 420, 80, 423, -799, -870, -930, -720, + -640, 2390, -409, -177, 91, 370, -864, -949, + 838, -574, -234, 555, 46, -9, -83, 146, + -825, -478, -664, -57, 867, -296, -380, -73, + 70, 171, -1124, 10522, -228, -609, -958, -1025, + -548, -384, -257, 55, 5414, 436, -651, -748, + -671, -525, -25, -273, -264, 57, -1129, 1974, + -145, 1650, -317, -514, -305, -78, -154, 59, + 1269, 1008, -510, -711, -534, -358, 194, 117, + 102, 57, -837, 1260, -126, -494, 47, -162, + 924, -72, 130, 97, 742, -803, -711, -755, + -402, -188, 24, 309, 187, 379, -1092, 5862, + -647, -807, -715, -696, -408, -29, 104, 353, + 3298, 2193, -263, -772, -908, -754, -449, -164, + -157, -44, -986, 2313, -596, 56, 2057, -478, + 74, -51, 51, 121, -899, 1793, -595, -669, + -743, -689, -546, 71, 201, 382, -1061, 3375, + -776, -876, -648, -407, -44, 260, 258, 393, +}; + +static const int16_t fcb22m[] = { + 11522, 868, -1444, -1572, -1674, -1745, -1844, -1616, + -1723, -1508, 27, -321, -693, -597, -374, -380, + 327, 209, 611, 1182, -548, 176, -544, -485, + -341, -376, -383, 1024, 1316, -4, 192, -649, + -979, -945, -802, -183, 3749, 812, -416, -527, + -734, 1059, -521, 924, -462, -631, -76, 182, + 126, 100, -653, -643, -1189, -1264, -1312, -1311, + -1212, -1016, -218, 8415, -1005, 734, 1303, -272, + -397, -521, -245, 389, 242, -234, 458, -912, + -1215, -1228, -1288, -1131, -845, -404, 912, 5497, + 413, 3161, -432, -148, 1704, -663, -996, -1009, + -1419, -929, -36, -471, -640, -571, -197, -573, + -462, 2586, -179, -382, -757, -895, -1096, -1140, + -1216, -1051, -688, -44, 3311, 3518, -474, 2530, + 1475, -676, -702, -777, -380, -316, -538, -468, + -708, 542, -213, -713, -911, -482, -696, -135, + 1282, 2006, 5707, 476, -707, -771, -650, -788, + -778, -853, -962, -926, 10, -11, 3, 1, + -12, -14, 21, 7, -13, -10, -1410, -1712, + 1379, 5757, 218, -1232, -563, -929, -684, -827, + -261, 1040, -154, -309, -99, 62, 856, 199, + -614, -926, -626, 1568, -258, 374, 1071, -140, + -250, -332, -832, -706, -863, -714, -749, 3081, + 498, -695, -395, -600, -279, 588, 245, 3122, + -329, -677, -262, 67, 19, -530, -882, -862, + -1033, -160, 1542, 1916, -416, -600, -553, -219, + -130, -497, -699, 1719, 160, 3293, -212, -923, + -1045, -761, -1238, -1038, 1543, 738, -548, -541, + -403, -281, -115, -95, -313, -19, -292, 1136, + 3592, 696, -654, -856, -726, -693, -1057, -1267, + -722, -381, -683, 1364, -30, 589, 454, 262, + -57, -1018, -312, 846, -139, -587, -127, 2482, + -178, -233, -977, -796, -6, 250, 220, 1577, + 1141, -251, -649, -809, -1051, -873, -762, -990, + -1010, -890, -897, -639, -671, 1964, 788, 2310, + 6001, 20, -1008, -1159, -1208, -1208, -1318, -1227, + -829, 1680, -1023, -998, -1224, -945, -769, -41, + 2033, 196, 917, 1615, 2026, -654, -1014, -918, + -750, -675, -839, 1541, 282, 430, -1059, -708, + -507, -522, -169, 438, 196, 835, 778, 897, + 420, 526, 1239, 198, -736, -953, -835, -229, + -348, 726, -767, 1311, 248, -353, -550, 1017, + -250, -732, 256, -175, -638, 763, -761, -957, + -554, 539, 252, 299, 431, 613, 4398, -378, + -1022, -1020, -990, -757, -621, -83, -34, 122, + -476, 77, -799, -116, 4546, -787, -735, -462, + -875, -907, -1373, -1354, -1355, -1220, -1024, -88, + 1298, 2844, 940, 1135, 2261, 2142, 181, -735, + -924, -941, -799, -715, -662, 86, -719, -521, + 115, -576, -699, 1052, 1295, -57, 42, 230, + 2876, 501, -294, -158, 104, -157, -515, -662, + -987, -1069, -703, -985, -1061, -946, -878, -267, + 397, 132, 534, 3642, 1298, -560, -701, -526, + -294, 197, 310, 75, -3, 267, -342, 2058, + -328, -427, -709, -688, 14, -43, 237, 506, + 2822, -337, -900, -818, -638, -192, 883, -14, + -271, -559, 2822, -165, -988, -933, -917, -603, + -583, -397, 467, 1092, -1044, -479, 2478, -386, + -535, -253, 63, -49, 79, 27, -182, -100, + 362, -628, -661, -707, 1557, 136, 335, 89, + -197, 5697, 220, -473, -472, -1053, -1023, -1087, + -1203, -756, -377, -917, -925, -568, -237, 1422, + 197, -98, 614, 867, -831, -829, -969, -720, + 414, 1080, 1707, 828, -121, -757, -1044, -289, + 816, 284, 809, -84, -22, -552, -9, 193, + -359, 66, -582, -674, 1992, -31, 58, 427, + -515, -299, 932, -608, -1103, -1068, -1016, -770, + 200, 1031, 1112, 1026, -598, -818, -891, -635, + -828, -866, -650, 4795, -407, 215, -853, 373, + -696, 159, 995, 465, -509, 109, 60, 10, + 8455, 198, -999, -1131, -1111, -1195, -1246, -1192, + -1181, -934, -365, -764, -689, -589, -734, 2479, + -960, 1279, 104, -209, -1012, -824, -1059, -921, + -812, -204, 199, 601, 3136, 637, 3021, 3851, + -490, -18, -930, -1081, -1133, -1182, -1268, -980, + -864, -945, -278, 961, -514, -123, 562, 874, + -130, 336, 3314, -331, -1112, -1162, -1227, -1230, + -1172, -988, -319, 3582, 890, 50, -681, -788, + -906, -876, -829, -827, -41, 3416, -740, -913, + -893, 404, 2059, -651, -474, 302, 516, 578, +}; + +static const int16_t fcb22sl[] = { + 1098, -1107, -1125, -983, -770, -233, 201, 823, + -1433, -1294, -17, -1156, -301, 1185, 1307, 1108, + -1247, 1829, 1353, -537, -457, 116, 574, 712, + 159, -489, 511, -340, 54, 119, 213, 351, + -1489, -1256, -1324, -1132, 3710, 262, 1087, 1465, + -1434, -1027, -1116, 825, -662, -428, -109, 1045, + 229, 753, -604, -422, 122, -220, 279, 375, + -349, -684, -197, 490, -160, -116, -120, 146, + 5195, -895, -974, -758, -524, 21, 761, 1016, + -1216, 151, 864, -602, -715, -591, -347, 592, + -1265, -1328, -1375, -878, -660, -549, 143, 4302, + -1433, -1277, 360, -1032, -835, -385, 337, 1111, + -1345, -1250, -1156, 914, 1594, 22, 912, 1012, + -1576, -1411, -1364, -1153, 842, -184, 240, 1302, + -1486, -1162, 1246, -880, -830, 14, 2487, 1607, + -1384, -158, -572, -977, 43, -30, -184, 572, + 2759, -892, -768, -522, -289, -44, 351, 575, + -1292, -546, 3736, -609, -538, -25, 514, 924, + 1772, 1639, -903, -595, -263, 340, 579, 670, + -1425, 770, -1179, -920, -1158, -675, 496, 1208, + -1337, 1240, -1030, -1044, 1840, 312, 809, 908, + -1457, 1410, -1240, -1083, -541, 568, 2768, 1432, + -1249, -890, 1078, 1278, -558, 63, 573, 778, + -1285, 1932, -1004, -902, -339, 59, 17, 659, + -1352, -935, -877, 3421, -455, 160, 820, 1230, + -1326, -978, 986, -790, 1541, 41, 542, 743, + -1491, -1162, -1389, -1265, -928, -139, 5045, 2259, + -1182, 1358, -953, 1338, -502, 122, 749, 839, + -1284, 4389, -1001, -813, -421, 44, 855, 1072, + 1658, -881, -821, 1409, -299, 4, 453, 700, + -1144, -1112, 1230, -790, -421, 1250, -12, 655, + 1545, -872, 1199, -632, -365, 56, 415, 663, + -1401, -1189, -1403, -1189, -1145, -687, -116, 1120, + 1768, -1068, -1024, -629, 1440, 88, 578, 711, + -1651, -1561, -1564, -1430, -1037, 1264, -21, 1944, + -1552, -1336, -1277, 916, -412, 27, 2454, 1661, + 1996, -1087, -1223, -924, -393, 1673, 794, 1017, + -1362, -132, 151, 537, -992, 1830, 777, 991, + -1591, -1355, -1494, -1420, -666, 2407, 3210, 2092, + -1114, -624, -1087, -903, -808, -438, 1881, 654, + -1140, 254, -105, 212, 386, 49, 256, 314, + 83, 98, -1128, -901, -578, 362, 702, 691, + 1191, -204, -335, -226, -102, -44, -5, 120, + 57, -1110, -403, -651, -806, -202, 567, 690, + 349, -908, -1075, -941, 1487, 464, 763, 782, + 387, -1070, -990, -765, -295, 1669, 341, 881, + 232, -1013, -1043, 723, -311, 294, 646, 574, + 72, -1191, -546, -183, 493, 161, 201, 465, + -185, -1434, -1368, -1051, 64, 385, 748, 986, + -740, -530, -1199, -562, 142, 1388, 1487, 715, + -1359, 873, -1187, -923, -455, 1914, 403, 1016, + -1245, -1223, -624, -495, 724, 652, 433, 585, + -1499, -1277, -1381, -1148, 1679, 2138, 995, 1424, + -1345, -1319, -1296, 906, -228, 1534, 506, 1024, + -1628, -1410, -1422, -1197, 1393, -22, 2728, 1784, + -1245, -1056, -942, 2, -165, -115, 840, 569, + 1016, -1191, -1091, -862, -457, 95, 2087, 1029, + -1460, -1486, -1459, -1104, -571, 925, 1234, 935, + -1568, -49, -1325, -1255, -64, 315, 838, 962, + -1651, -1562, -1606, -1571, -1308, -380, 1988, 2117, + -848, -412, -987, -370, 1224, -304, 10, 498, + -1523, -1348, -1373, -959, -772, 3767, 621, 1773, + -931, -628, 169, -513, 61, -306, 994, 476, + -1116, -879, -875, -484, -795, 958, -162, 444, +}; + +static const int16_t fcb22ss[] = { + 6765, -638, -1108, -977, -679, -446, -325, -432, + -127, 96, -569, -621, -1050, -841, -800, 1474, + 1170, 60, 330, 223, -1317, 855, 307, -931, + -648, -549, -148, 535, 642, 445, 3666, -1146, + -1167, -944, -584, 942, -284, 25, 573, 472, + -1041, -1096, -1209, -1082, -770, -737, -139, 2073, + 753, 832, 507, -828, -1112, -1130, 4284, -722, + -261, -57, 499, 300, -1380, -1130, 135, -898, + -816, -395, 195, 453, 650, 537, -953, -1109, + -1221, -981, -747, -647, 2360, 467, 845, 684, + -1177, -792, -1254, -1148, 1344, -745, -323, 180, + 729, 739, -1020, 183, 5226, -638, -358, -86, + -268, -143, 84, -115, 480, -543, -1229, -1097, + -594, -983, -792, -391, 2637, 1405, -761, -866, + -1186, -973, -792, -640, -220, -102, 1165, 3159, + -1241, -1057, -1322, -1007, -731, 44, 264, 668, + 2645, 1592, 2885, -1155, -1347, -1209, -309, -1161, + 4216, -64, 830, 616, -688, -638, -596, 202, + -665, -623, -499, -248, 512, 749, -1395, -708, + -1086, 1209, -745, -367, 1397, 279, 374, 259, + -1357, -254, 2310, 1839, -147, 36, -402, 300, + -49, 47, -1328, -992, 3453, -889, -621, 135, + 437, 70, 663, 346, -1339, -1136, -1275, 6675, + -1309, 2285, -869, 1154, 640, 617, -505, -1042, + -984, -702, 1283, 1573, -168, 135, 249, 253, + -783, -1119, -1342, -975, -1127, 1391, -705, 4439, + 1160, 845, -1283, -1224, -1286, -1142, -1019, -901, + -658, -157, 231, 611, -994, -463, -1017, 1082, + 1831, -459, -164, 114, 0, 108, -1386, -1079, + -1318, -1091, 2540, -717, 762, 1414, 849, 576, + -1405, -566, 2704, -996, 2133, -678, 404, 281, + 4, -32, -1474, 3530, 2301, -711, -919, -305, + -125, 184, 450, 73, -1132, 1567, 1620, -551, + -198, -645, 19, 8, 190, 191, -741, -728, + 410, 1067, -322, -239, 86, 11, -137, -220, + -489, -607, -963, 3630, -624, -478, -12, 124, + 219, 63, 2040, 75, 1338, -293, -333, -336, + -330, -246, -360, -344, -953, -393, 1550, -701, + -616, -254, 1908, 211, 328, -43, -1089, -299, + 1070, -723, -923, 2170, -400, -13, -28, 108, + -812, -400, 876, -650, 1308, -772, -256, -200, + 117, 329, 649, -639, 437, -704, -567, -20, + -211, 197, 330, 342, 1670, -468, -920, -588, + 972, -310, 9, -46, 70, -29, -1313, 1684, + -794, -979, -752, 1864, -173, 108, 248, 292, + -1247, -1226, -1059, 288, -112, 189, 20, 540, + 454, 380, -1035, -803, 1267, -767, 746, 1331, + 107, 317, 158, -116, 2093, -723, -1064, -906, + -713, -789, -518, 48, 494, 1018, 1835, -1353, + -1303, -1098, -559, 800, 520, 662, 615, 574, + -1282, -526, 1829, -1086, -885, -356, -539, -50, + 493, 402, -777, -374, -754, 1721, -701, 2086, + -348, 218, 138, 109, -1367, -1226, -1041, 1949, + -433, -291, -363, 567, 613, 560, 1166, -481, + -737, 1193, -479, -163, -69, 2, 133, 239, + -1444, -1448, -1350, -987, -296, 606, 755, 543, + 741, 806, -851, 2437, 23, -681, -670, -271, + -439, -227, -243, -198, -1307, 424, -1212, -987, + -745, -369, 162, 641, 915, 611, -24, -728, + -1061, -659, 808, -532, 1241, -233, 266, 353, + 175, 210, -262, -328, 101, -238, 66, -339, + -472, -415, 952, -1490, -1302, -955, -1270, 5776, + -792, 777, 1097, 807, -1334, -1172, -1211, -924, + -877, 2458, -355, 593, 936, 699, -336, -700, + -762, -569, -337, 642, 97, 441, -188, -533, + -1062, 188, -873, -801, 418, -167, -57, -29, + 79, 241, -1110, 6430, -816, -807, -462, -601, + -56, -45, 188, 74, 2869, 43, -1122, -799, + -772, -847, 1394, -36, 294, 13, -1304, 2155, + -534, 1545, -315, -325, 183, 31, 372, 187, + 873, 1376, -1037, -810, -516, -235, 485, 99, + 287, 327, -1074, 1203, -1089, -882, -515, -544, + 2041, -40, 208, 191, 597, -1141, -1274, -885, + -386, 106, 593, 394, 671, 678, -1292, 3861, + -1085, -1150, -748, -218, 500, 55, 335, 469, + 3217, 2888, -882, -643, -590, -506, 43, -459, + -210, -222, -965, 2453, -830, -779, 1808, -588, + 130, 4, 130, -23, -1269, 1374, -1238, -1148, + -523, -659, -170, -302, 1055, 1389, -1467, 2505, + -930, -1181, -842, -516, 399, 886, 849, 738, +}; + +static const int16_t fcb22sm[] = { + 5761, -398, -743, -948, -944, -845, -883, -896, + -811, -604, -1142, -1388, -1190, -685, -118, 1498, + 1590, 293, 564, 352, 124, 851, -131, -652, + -573, -279, -756, -478, 833, 670, 2609, -1138, + -1107, -1024, -739, -646, -387, 33, 635, 1037, + -717, -990, -1161, -948, -660, -230, 69, 2510, + 1274, 841, -49, -872, -764, -211, 3046, -30, + -143, -311, -324, -413, -760, 67, 619, -699, + -725, 305, -484, 1292, 472, -156, -568, -1243, + -1256, -994, -803, -386, 1692, 596, 1325, 1290, + -492, -1007, -732, -788, 1136, -610, 45, 1307, + 420, 649, -534, -1075, -949, -367, 219, 444, + -120, 251, 476, 1806, 902, -927, -1151, -879, + -659, -741, -5, 298, 1861, 995, -244, -1031, + -1142, -1085, -952, -773, -468, -9, 1637, 3592, + -971, -1150, -1199, -985, -689, -317, 150, 540, + 2727, 1678, -223, -403, 102, -902, -773, -223, + 3182, -457, 75, -188, -291, -428, -101, -365, + -442, -336, -128, -33, 781, 1242, 501, -753, + -846, 757, -444, -311, 1182, 4, -8, -122, + 1866, -528, -142, 1598, -15, -219, -557, -804, + -916, -965, 114, 130, 3672, -19, -873, -280, + -777, -919, -824, -654, 1078, 39, -50, 119, + -411, -311, -359, -57, -137, 7, -780, -892, + -767, -167, 1302, 1693, -205, -51, -174, -71, + 838, -220, -1133, -993, -710, -340, 650, 1341, + 191, -5, 743, -543, -125, -567, 70, -42, + -501, -448, 47, 1151, 400, -774, -781, 1324, + 1089, 32, -256, -415, -352, -214, 912, -1141, + -988, -638, 1349, 251, 124, -4, 89, -16, + -678, -569, 1502, 146, 114, 816, -98, -269, + -622, -808, -634, 3319, 1218, -323, -750, -548, + -525, -575, -591, -730, 35, 764, 1423, 574, + -352, -672, -802, -314, -308, -29, -1040, -717, + 469, 421, -527, -420, 589, 195, 556, 472, + -626, -864, -133, 3531, -667, -460, -523, 103, + 23, -309, 2381, 136, 1197, -399, -399, -501, + -638, -899, -813, -707, -249, 719, 821, -989, + -629, -568, 642, -4, 297, 70, -1105, 454, + 400, -235, -562, 1607, -116, -205, 1, -490, + 7, -523, 764, 329, 992, -240, -249, -275, + -366, -265, 662, -803, 393, -567, -501, -32, + 178, 371, 126, -146, 1748, -516, -634, -395, + 268, 893, 154, -36, -620, -999, 304, 1490, + -512, -821, -479, 1922, -610, -481, -482, -805, + -996, -16, -567, 542, -22, 589, -114, 69, + 322, 358, -848, 1205, 509, -527, 25, 111, + -243, -197, -20, 62, 1500, -977, -974, -391, + -555, 448, -256, 79, 392, 547, 1472, -1276, + -1203, -987, -315, 515, 855, 183, 231, 62, + -1176, -397, 2831, -527, -575, -435, 174, -337, + 723, 107, -502, -765, -455, 1124, -218, 1444, + 53, -201, -135, -267, -510, -1058, -869, 1130, + -128, -394, 16, 873, 597, 455, 16, 0, + -11, 14, -12, 9, 6, -14, -11, -23, + -453, -1056, -988, -713, -267, 794, 954, 1361, + 822, -448, 379, 1163, 336, -724, 55, 109, + 237, -80, -732, -1017, -264, 654, -1043, -1015, + -654, 91, 17, 548, 504, 932, -1057, -1151, + -964, -130, 1171, -146, 740, 134, 790, 539, + -591, -577, -388, 154, 609, 341, 657, 838, + -379, -872, 711, -665, -818, -549, -151, 2501, + -28, -189, -255, -378, -363, -1157, -929, -887, + -338, 1926, -33, -26, 1009, 765, -79, -98, + -37, -967, -566, 1012, 905, -245, 41, 322, + 194, -148, -220, -171, -239, -242, -147, -14, + 221, 575, 1754, 3059, -246, -713, -696, -636, + -640, -843, -841, -755, 2554, -504, -568, -318, + -324, -171, -294, -238, -288, -174, -289, 1273, + -231, 1053, -284, -338, -394, -227, -303, -226, + 966, 742, -873, -503, -586, -286, 119, -59, + 339, -38, -843, 977, -448, -238, 227, -77, + 729, 6, 45, -493, 277, -1385, -1289, -846, + -117, 376, 763, 553, 769, 670, -652, 3280, + -762, -882, -396, -299, 124, -270, -31, -210, + 2413, 644, -790, -912, -581, -507, -110, -408, + -54, -30, 632, 969, -632, -206, 955, -95, + -578, -337, -377, -467, 1264, 67, -854, -863, + -909, -751, -616, -479, 563, 2070, -972, 1478, + -450, -715, -859, -689, 190, 736, 617, 530, +}; + +static const int16_t fcb44sl[] = { + 2433, -925, -1015, -1009, -875, -276, 378, 464, + 694, 795, -1044, -601, -658, 257, -898, -509, + -346, 2160, 694, 952, -1302, -619, 502, -378, + -624, -178, 349, -100, 204, 546, -1450, -1127, + -1302, -1297, -1051, -840, 3426, 1346, 1577, 1723, + -1267, -710, -872, 448, -1023, -728, -521, -134, + 874, 936, -1134, -549, 203, -932, -1051, 755, + -608, -199, 858, 1008, 1819, -842, -773, -739, + 818, -371, 289, 293, 656, 704, 308, -1009, + -959, -1089, 466, -468, 279, 897, 764, 797, + -1433, -1276, -1253, -1326, -1182, -992, -85, 4339, + 2135, 2136, 1131, -917, -966, -859, -889, 1178, + 62, 659, 771, 882, 1844, -607, 1184, -766, + -805, -385, -61, 502, 648, 732, -1245, 1315, + -818, -827, 621, -588, 193, 480, 649, 776, + -1178, -1202, -1152, -1088, -857, -191, -49, 129, + 1950, 1237, -1461, -1290, -1342, -1401, -1338, -1213, + -623, 224, 4086, 2517, -1150, -814, -747, 916, + 807, -288, 319, 436, 560, 718, 392, -973, + -988, 411, -954, -502, 214, 621, 856, 831, + -1268, 4012, -852, -1002, -1014, -577, 32, 552, + 987, 1138, -1205, -1319, -1145, -928, 80, 371, + 277, 779, 859, 902, -1141, -991, -957, 707, + -892, 1098, 126, 381, 668, 870, -1254, -995, + -1163, -926, -1149, 2572, -17, 747, 1456, 1509, + -1004, -867, 1205, -797, 938, -657, 346, 520, + 782, 872, -1328, -1080, -1111, -1067, 2227, -892, + 665, 1604, 1425, 1477, 1869, -668, -712, 1044, + -800, -139, 0, 355, 609, 717, -1192, -632, + 3546, -780, -870, -501, 141, 504, 921, 1027, + -1125, -1087, 1154, -660, -987, 937, 82, 1390, + 1360, 1243, 1259, -550, -769, -787, -743, -362, + -12, 177, 321, 505, -1147, -899, -947, -849, + 1371, -462, -127, 16, 752, 954, -1405, 448, + -1181, -1259, -1204, -868, -468, 110, 1293, 1263, + -1267, -1180, -1238, -930, -940, 916, 1793, 653, + 1070, 1137, -216, -997, -845, -659, -699, -174, + 758, 961, 417, 630, -1123, 1691, 1229, -732, + -937, -491, -78, 265, 744, 864, 4771, -856, + -1005, -1007, -934, -484, -17, 579, 861, 959, + -1264, 70, -961, -864, -860, -302, 314, 788, + 487, 686, -1133, -790, -466, 561, -812, -256, + 2078, -58, 757, 953, -1133, -286, -655, -476, + -23, -629, 7, 182, 426, 504, -1110, 314, + 497, -822, -662, -754, 1179, 1726, 696, 955, + 1793, -1143, -1268, -1279, -1207, -873, -183, 1546, + 1440, 1305, -1278, 1396, -779, 558, -840, -32, + -18, 257, 616, 757, 265, -906, 499, -897, + -846, -435, 362, 434, 752, 732, 453, 150, + -1029, -1182, -1195, -940, -297, 876, 1084, 1051, + -1377, 1354, -1148, -1313, -1211, -937, -366, 1942, + 1323, 1410, 311, -270, -81, -159, 42, 42, + 7, 357, 255, 285, 1973, 1386, -752, -873, + -916, -466, -39, 493, 638, 759, -1338, 1107, + -1081, -1165, -1038, -484, 1722, 534, 1038, 1102, + -1446, -1212, -1337, -1452, -1422, -1291, -690, 1634, + 1348, 1640, -1044, -184, -757, -683, -100, 1044, + 369, 349, 432, 584, -1137, -528, 1425, 1294, + -842, -257, -32, 289, 639, 796, -1418, -1229, + -1282, -1391, -1421, -1234, -852, -765, 737, 2076, + -1104, -928, -936, -1088, 378, -765, 1603, 581, + 753, 925, -1191, -841, -919, 2886, -907, -232, + 180, 543, 956, 1070, -1314, -843, 804, -1094, + -1209, -1031, -626, 698, 1049, 1152, 256, 831, + -841, -814, -841, -54, 134, 347, 535, 658, + 104, -801, -959, -519, -406, 156, 12, 13, + 380, 494, -1144, -1112, -973, -965, -916, -474, + -225, 460, 402, 734, -1448, -1316, -1278, 231, + -1086, -578, 584, 1115, 1275, 1260, -1321, -963, + -1127, -1288, 41, -1102, -31, 1331, 1003, 1145, + 112, -1270, -1343, -1376, -1114, -778, 392, 1918, + 1165, 1246, -1247, -870, -1232, -1147, -1075, 570, + 181, 1983, 971, 1216, -1309, -1199, 260, -1136, + -950, -742, 1067, 703, 1150, 1144, -1405, -1533, + -1564, -1549, -1264, -737, 1085, 1706, 1806, 1785, + 282, -1173, -1128, -1188, -971, -885, -291, 254, + 841, 987, -142, -1068, -1264, -1232, -1058, 138, + 546, 521, 1096, 987, 890, -936, -1020, -1051, + -871, -521, 1686, 625, 930, 936, -1343, -924, + -1231, -1247, -1052, -951, 1110, 125, 826, 1116, +}; + +static const int16_t fcb44ss[] = { + 6575, -881, -1291, -1258, -1090, -517, -268, -56, + 106, 295, -303, -1134, -1113, -650, -508, 1843, + -235, -141, 454, 832, -1212, 856, -404, -620, + -682, -487, -69, 865, 341, 95, 3626, -1037, + -1366, -1349, -1126, -558, 187, 343, 657, 765, + -410, -735, -1046, -1023, -897, -673, -366, 3174, + 1264, 720, -730, -922, -523, -821, 4042, -463, + 45, 329, 213, -93, 301, -1011, 277, -840, + -820, -451, 417, 470, 739, 953, -1219, -1286, + -1545, -1426, -1209, -803, 1156, 1311, 1329, 1329, + -643, -1136, -1200, -912, 1221, -695, 342, 910, + 905, 812, -996, -365, 4868, -738, -591, -621, + 17, -42, 0, 100, 2085, -1214, -1434, -1432, + -1243, -577, -626, 140, 1357, 1821, -1064, -1261, + -1629, -1525, -1488, -1101, -631, 551, 3556, 3974, + -635, -846, -1005, -646, -803, 123, -151, 357, + 2137, 953, -1168, -1055, -1115, -1061, -823, -651, + 3842, 606, 491, 491, -1297, -1063, -990, -1051, + -1202, -983, -468, -47, 163, 336, -1131, -446, + -683, 644, -660, -675, 1251, 373, 195, -123, + -1109, -430, 1820, 1883, -862, -743, -265, 119, + 66, -41, -1281, -768, 1941, -955, -1054, -856, + 528, 363, 488, 545, -936, -682, -814, 5534, + -826, -347, 58, -38, 168, 14, 1224, -719, + -300, -766, -407, 630, 269, 39, -230, -701, + 1601, -958, -945, -955, -734, -487, -20, 1392, + 544, 282, -118, -1133, -1161, -1065, -939, -213, + -129, -271, 451, 2570, -895, -805, -536, 1455, + 1496, -647, -199, 114, 95, -42, 2230, -855, + -715, -819, 1762, -699, -50, -109, 163, 207, + -334, -759, 3297, -645, 2561, 77, -239, -259, + -275, -445, -1304, 3536, 1610, -526, -926, -582, + -12, 44, -180, -69, -804, 1107, 1451, -868, + -851, -589, -354, -85, 88, 336, -537, -444, + 40, 231, -715, -523, -351, -379, -123, 171, + 1223, -328, -567, 2182, -291, -352, 20, -157, + -338, -635, 2194, -476, 1624, -802, -762, -585, + -245, 48, 63, -45, -32, -646, 847, -556, + -727, -259, 1309, 239, -128, -755, -1018, -640, + 876, -642, -906, 1394, -26, 338, 204, 148, + -988, -521, 135, -807, 1065, -525, -80, -248, + 383, 836, 521, 13, -553, -865, -928, -631, + -137, -83, 446, 221, 1924, 48, -621, -845, + -782, -544, -531, -418, -79, 915, -711, 1247, + -938, -766, -995, 1459, 31, 199, 261, 190, + -670, -1207, -1013, 108, -670, 204, 407, 266, + 473, 998, -606, -923, 1845, -1061, 910, -774, + 268, 493, 178, 61, 1938, -1237, -1010, -1097, + -780, -368, 1125, 354, 398, 550, 1032, -1128, + -1196, -908, -767, 529, 2326, 728, 227, -13, + -1113, -367, 382, -939, -1094, -896, -463, 446, + 896, 1128, -591, -823, -894, 3052, -968, 2157, + -153, -71, 111, 118, -1106, -930, -911, 1663, + -905, -691, -226, 503, 665, 702, 2067, -1149, + -828, 990, -850, -426, -159, 148, 379, 512, + -1268, -1390, -1492, -1343, -1419, 2246, -224, 2124, + 1523, 1338, 522, 1613, -344, -694, -487, -325, + 293, 96, -374, -679, -364, 124, -1201, -1274, + -1078, -513, 15, 1045, 529, 680, 131, -1067, + -1030, -888, -806, -122, 1002, 1302, 757, -473, + -530, -538, -821, -373, 72, 797, 864, 265, + -542, -1090, -241, -1095, -1205, -991, -1172, 5025, + -420, 728, 461, 103, 2325, -915, -1012, -854, + -1117, 2018, -377, -35, 266, 443, -949, -1163, + -1064, -1057, -802, 721, 1278, 470, 308, 263, + 474, -773, -1033, -892, 227, -30, 39, 101, + 456, 476, -1263, 7275, -946, -1157, -1304, -922, + 248, 143, -98, 312, 3419, -402, -649, -629, + -554, -48, 487, 72, -171, -687, -1167, 1869, + -524, 1490, -869, -236, 111, 68, 77, -85, + 1481, 906, -1189, -1321, -1124, -554, 429, 321, + 814, 699, -1048, 486, -858, -1096, -1072, -744, + 1676, -73, 593, 632, 779, -1265, -1470, -1379, + -1050, -548, 781, 524, 1022, 1079, -1149, 3719, + -1064, -1180, -1159, -775, -211, 241, 492, 555, + 3025, 2828, -849, -1133, -1063, -567, -70, -142, + -176, -62, -614, 1745, -684, -610, 1478, -619, + -235, -361, -84, -44, -1155, 1494, -1183, -1210, + -1294, -1017, -330, 210, 931, 1368, -1306, 2714, + -1052, -1128, -1220, -908, 2409, 441, 310, 318, +}; + +static const int16_t fcb44sm[] = { + 5619, -163, -1005, -856, -831, -644, -612, -759, + -770, -456, 199, -551, -1348, -80, 131, -481, + 334, 202, 366, 1246, -1245, 499, -1454, -396, + -675, -257, 525, 1001, 878, 1075, -1004, -1010, + -1127, -947, -976, 332, 3533, 1315, 265, -683, + -1114, 1056, -1009, 1154, -728, -212, 620, 169, + 102, -110, -658, -902, -1238, -1213, -1238, -926, + -735, -455, 1130, 5139, -1184, 190, 1590, -604, + -800, -373, -366, 251, 720, 571, -6, 304, + -1228, -369, -659, -506, -25, -234, 313, 2366, + 623, 1473, -315, 780, 1048, -416, -586, -737, + -1029, -1094, 483, -725, -771, -379, -268, -15, + 697, 1774, -1, -999, -987, -867, -1339, -1255, + -1018, -652, -125, 643, 3006, 2417, -543, 1629, + 1557, -684, -568, -474, -132, -291, -338, -321, + -1250, 641, -158, -935, -575, -575, 154, 415, + 798, 1421, 3147, 1903, -335, -767, -729, -627, + -611, -752, -836, -735, 678, 502, -946, 556, + -821, -51, -256, 94, 151, 70, -808, -324, + -359, 3637, 286, -90, -365, -613, -782, -871, + 75, 1051, -780, -487, 47, 273, 1768, -102, + -828, -1267, -1093, 1420, -624, 225, 1307, 85, + 239, -152, -649, -853, -1072, -796, -644, 1383, + 1143, -199, 94, -25, 70, 52, -1064, 2487, + -844, -607, -587, 148, 726, 224, -238, -484, + -957, -729, 1517, 1334, -475, -317, -253, -186, + 1, 17, -832, 1450, 423, 1408, -576, -825, + -630, -579, -312, 314, 788, 382, -1000, -1060, + -763, 968, -135, 56, 143, 477, -736, 30, + 4023, 68, -266, -420, -538, -751, -893, -879, + -935, 59, 465, 887, -351, 1396, 176, -250, + -684, -1019, -515, -815, -957, -439, 188, 3794, + 86, -98, -245, -829, 1894, -386, -865, 1513, + 24, -506, -281, -615, -476, -364, -1283, -963, + -339, -133, -161, -480, 25, 230, 1364, 1815, + 1766, -844, -1423, -1185, -972, -458, -275, 138, + 1317, 1778, -1295, -874, -1211, -792, -601, -500, + 2301, 901, 1336, 842, 1355, -426, -1160, -959, + -801, -433, 1852, 144, 284, 169, -1122, -851, + -957, 272, -393, 817, 862, 262, 333, 802, + 320, -576, 1615, -615, -886, -311, 108, 13, + 1, 320, -1205, 962, -483, -791, -749, 1158, + 677, -57, 166, 279, -860, 1237, -971, -1057, + -598, -285, 884, 1174, 657, -303, 2254, -706, + -1113, -655, 719, 234, -124, -199, -135, -360, + -758, -623, -385, -18, 3243, 470, -139, -286, + -520, -953, -1193, -1140, -1297, -1137, -764, 25, + 235, 2217, 1501, 1369, 2024, 781, -1353, -835, + -824, -601, -259, -140, 387, 671, 3, -974, + -760, -884, -485, 709, 1505, -95, 321, 739, + 1610, -156, 1515, -76, -420, -369, -189, -506, + -705, -907, -1052, -516, -1048, -996, -471, 1195, + 212, 184, 800, 1665, 747, -1029, -1013, 789, + -703, 559, -139, -98, 380, 523, -355, 2047, + -766, -991, -809, -566, -257, -242, 485, 1322, + 1989, -330, -945, -559, -448, 1241, 811, 10, + -767, -1218, 1600, -755, 428, -729, -355, -665, + -416, -120, 381, 548, -717, -14, 1587, -886, + -9, 353, 839, 201, -454, -1112, -1334, -309, + 660, -375, -661, -511, 1437, 540, 492, 0, + 95, 3911, -237, -301, -562, -483, -569, -799, + -883, -580, -670, -980, -1056, -896, -797, 1551, + 267, 1000, 1617, 75, -1132, -403, -988, -830, + -627, 1164, 1315, 1594, 310, -564, -1091, -563, + 1195, -442, 1086, -344, -176, -258, 175, 476, + 923, -37, -629, -919, 1278, -610, 113, -314, + -81, 192, 731, -944, -1297, -1108, -934, -259, + 640, 1164, 1326, 558, -767, -519, -875, -930, + -817, -533, 496, 2605, 1359, -131, -1010, 912, + -1055, -309, 768, -198, -166, -76, 429, 640, + 3283, -895, -1229, -853, -853, -399, 147, 44, + 237, 495, -833, -909, -1004, -811, 1039, 1627, + -194, 295, 738, 290, -771, 237, -912, -479, + -648, -518, -226, 573, 2346, 419, 1013, 1510, + -865, -873, -982, -557, 598, 50, 81, -81, + -1150, -640, -1011, 1991, -561, -140, 42, 175, + 521, 799, 3231, -46, -1004, -994, -1140, -1094, + -957, -860, 8, 2346, 212, -499, -55, -997, + -623, -588, 38, -58, 975, 1529, -986, -891, + -1121, -619, 1967, -463, -7, 632, 768, 953, +}; + +static const int16_t shape8[] = { + 2765, 1262, 6624, 867, 688, 1884, 3245, 1248, + -2160, 593, 182, -1004, -1067, 687, 1021, -920, + 1396, -242, -2817, -1838, -3351, 1000, 5995, 2459, + -283, 1909, 1452, -4569, 556, -2004, -42, -3393, + -50, -385, 597, 983, 420, 6311, -1572, -1665, + 6128, -1688, -5191, -337, -4199, 371, 1032, -84, + 2169, 931, -392, -250, 137, 831, 8194, -489, + -92, 209, 115, 1453, 246, -647, 936, 1097, + -400, 597, 392, 93, -7709, -711, -724, 2051, + 497, 1919, -876, -769, -172, 2972, 952, 555, + 151, -617, 773, 4840, -3671, 841, 244, -661, + -3424, 958, 81, 532, -315, 796, 5491, -516, + -1, -1371, -531, -5538, 313, -1749, 2413, -835, + -3143, -244, -3470, -850, -4241, -859, -74, 2141, + -1005, 4643, -339, 4089, -861, -6612, 483, -2888, + -580, -45, 3662, 918, -317, 3596, -741, 897, + -2578, -654, -1628, -1865, 629, 3219, 214, -1898, + 1173, -4509, 1682, -2161, 697, -147, 9839, 751, + -1094, -341, -669, -1322, 649, -832, -382, -5467, + -44, 3510, 1312, 3104, -202, 1870, -155, 601, + 719, -22, -350, 394, 81, 397, -9185, -174, + 351, -4717, -4450, 3672, 1163, 2351, 1720, 1048, + -1221, -280, -18, -15, 678, -3931, 4707, -99, + 1823, -535, -1836, 138, 1166, -3031, 5515, 1362, + 1235, 455, 595, -3671, 1102, -163, 62, 1104, + 813, 870, -295, -1088, -299, -3976, 805, -7468, + -412, -2109, 236, 46, -5764, 615, -1475, 853, + 790, -6197, 312, 637, -3923, -422, -1086, -5647, + 878, -1410, 2085, -51, -2941, -769, -63, 838, + 823, 741, 2785, 450, -7003, -121, -915, 60, + -41, 0, -39, 8774, 647, -521, 379, -342, + -344, 818, 1316, 1056, 182, 2765, -467, 7886, + 45, 791, -415, 3864, -2428, 2255, -661, -64, + 1693, 144, 1784, -1194, -46, -1856, 1208, 4131, + 914, 8028, -17, 1939, -1415, 533, 291, -466, + 186, -705, 668, -614, -253, -2190, 287, 3929, + 1472, -1561, 5, 889, -2020, 158, -14, -1419, + 1338, -353, 622, -54, 87, -1104, -2911, 513, + -632, 1533, -267, 22, 6567, 295, 325, 6883, + 963, -373, -349, 183, 896, 1845, -1157, 351, + -367, 1171, 4362, 508, 5632, 704, -1420, -1886, + 686, 5230, -9, 2422, 230, 264, 3738, -270, + -344, -528, -936, 2286, -540, 4274, 337, -665, + 737, 1639, -1307, 5827, 592, -1372, -412, 1419, + 4579, 335, 223, -1067, -112, -446, 149, 1375, + -155, -392, -1980, 561, -67, 341, 6957, 475, + 11449, 39, 81, 766, -1880, 558, -134, -7940, + -489, 249, -886, -358, 6850, 2794, -2217, 1111, + -1222, -1130, -818, 1076, -1823, 865, -2220, 1179, + 4492, 224, -2073, -338, -5351, -390, 133, 496, + -42, -16, 46, 437, 322, -275, -72, 48, + -325, 313, 1108, -1044, -851, -5030, 1035, 4316, + -1281, -913, -1419, -941, 1914, 960, 1242, 202, + 5109, 475, 1254, 1725, -1504, -4, -269, -421, + -150, -4409, -610, -1548, -1684, -817, -210, 72, + -679, -106, -3809, -1137, 4, 7220, -95, 810, + 2432, -331, 492, -81, 138, -62, -613, -636, + 106, 10908, 912, 144, 192, 1251, -3970, -954, + 1145, 1175, -1721, 5326, -1721, -569, -3661, -1166, + 6605, -744, -1494, 853, 134, 3259, -504, -1740, + 180, -207, -659, 196, 179, -106, 118, 789, + -834, 10339, -420, -3002, -456, 113, 6435, 949, + 721, -2709, -1599, -684, -8068, 174, -1416, -58, + 974, 308, -726, 1237, -1594, 519, -131, -198, + -1395, 1180, -173, 338, -5584, -279, -236, 6817, + 89, -220, 3967, -107, 65, 2479, -22, 642, + 7179, 1179, -229, -202, 4948, -5465, 1632, -1285, + 2188, -2037, 1763, 636, 4247, 995, 1176, 2, + -2398, 1236, -661, 382, -1075, 130, 103, -187, + 604, -306, -2635, -2185, 157, 775, 6373, -924, + 1758, -3043, 1707, 2852, -2148, 6779, 376, -1018, + -2374, -989, 249, -5393, -32, 538, -416, -5108, + -658, 1839, 419, 1153, -3956, -617, -1925, 5434, + 626, 1488, -3824, 140, 370, -2230, -7031, 1989, + -581, 639, -4249, -216, 1225, -776, -973, -542, + -2922, -1783, -2430, -3251, 958, 3313, 636, -6277, + 119, -866, -406, -156, -4839, 966, -469, 5559, + 193, 376, -4810, -870, 163, 4130, 2596, 2203, + -114, 2423, -622, -424, 2935, 749, 2500, 4230, + -162, -1489, 2169, -5156, 751, 2748, 2240, -1549, + 4821, 175, 2274, 854, 2993, 838, 322, -2663, + -794, -283, -98, 1393, -709, 362, 285, -1085, + 1075, 374, 1062, 6512, -3375, -3138, 3939, 3628, + 3926, -2442, 1989, -583, -1282, -1882, -3920, -4593, + 540, 2667, -155, 156, -2428, 1229, -436, 1754, + 2815, -1634, -2299, 1155, 990, 3689, -1242, 3145, + 3951, 45, 186, -1110, 257, -335, 8929, 533, + -173, 813, 21, 1584, 541, -44, 1349, 108, + -5163, -684, 5522, -868, -5795, 769, 583, 2827, + -818, -5551, 1485, 37, -631, -262, -4352, -532, + 61, 434, 1775, 8974, -112, -852, -1227, -1645, + 260, 298, -430, 863, -3860, -97, 6467, -328, + -2418, -61, -1253, 1575, 30, -5683, 2113, 973, + -371, -51, 5355, 471, -584, -492, -2187, 2799, + -506, 4435, 1950, -3415, -363, -404, 941, 2628, + -146, 434, 2853, 889, 634, 5749, -54, 126, + 189, -1384, -379, -3205, -540, 1720, 942, -6300, + -286, -58, -1083, 3782, 251, -334, 4172, 631, + 17, 83, 707, 1322, 3273, -573, 1024, -6112, + -540, 4916, 155, -1209, 308, -738, -2150, 786, + -168, 68, -201, -64, -752, -1595, -9188, 320, + -426, 111, -2183, 886, -737, 193, -837, 3219, + 5936, 4022, 764, -82, 3344, -855, 3705, -2652, + 1533, -206, -3673, 1235, 1163, -1217, 3183, 1313, + -745, 6554, 7019, 1302, 2129, 268, -70, 110, + 412, -155, -1703, -4945, 105, -1705, 412, -6588, + 2905, 1279, 73, -2446, -5635, 1168, 2974, 404, + -650, 265, -1773, -1857, -108, -651, 657, -824, + 3352, 177, 155, 1275, 2012, 31, -7, -1065, + 2062, 411, -2325, -208, -6306, 683, 1037, -1060, + 191, -187, -585, 6103, -459, 571, 1640, -693, + 922, -2291, 537, 1934, 263, 3847, -202, 7060, + 136, 4368, 2963, -1032, 18, 1836, -144, -3853, + 474, 2005, 1298, 2396, 825, -2274, 12, 3759, + -394, 907, 490, 2997, 2180, -1570, -1000, 5982, + -129, -820, -3001, 2684, -1132, -2908, 1101, 5044, + 393, -1637, 393, 1343, -1231, 404, 1817, 1463, + -443, 1053, -584, -7756, 45, 499, -4109, 214, + 535, -3348, 54, -1594, 6913, 0, -94, 8772, + 500, 13, 734, 5, 798, -1521, 853, -82, + -263, -619, 1558, 456, 5911, -1376, 1054, -971, + -1275, -147, -111, 4964, 321, 67, 7024, -525, + 620, 883, -1058, -1132, -3313, 630, 226, -6201, + -1011, 1111, -820, -295, 580, 636, 2452, -638, + 6840, -285, 655, 1502, -1049, -567, 329, -33, + -249, 570, 186, 167, 780, 1104, 42, 197, + 10034, -1295, -208, 32, -1473, 716, 159, -6672, + -45, 519, -4300, -246, 3692, 5062, 4305, -748, + -548, 181, -382, -881, -1968, 580, 964, -420, + -327, -3397, -1584, 2770, -3501, 1659, -1252, 2352, + 6, 30, 0, -273, 27, -204, -485, -432, + -6, 176, -428, 1562, 104, -6511, -1084, 2205, + -11, -5254, -132, -508, -69, 373, -1503, 208, + -58, 5311, 92, -966, -6563, -480, -24, 1424, + -1498, -165, 4594, -903, -1787, -353, -7284, 142, + 1008, 875, -6109, -16, 162, 4895, 30, -188, + 2099, 1581, 300, -259, -921, -386, -488, 140, + -482, 7135, -77, 494, -196, 3207, -250, -102, + 318, 978, 161, 7292, 55, -1347, -2605, 898, + 1833, 602, -1988, 630, -145, -102, -414, -133, + 417, -603, 156, -1151, -395, 625, -1676, 86, + 680, 13321, 322, -5816, -292, -223, 4205, -361, + 903, -224, 1745, 95, -6598, 79, 2323, -24, + 263, 778, 146, -939, 1814, 1945, 720, 367, + -2987, 899, -4409, 136, -3185, -342, -3304, 1016, + 284, -345, 2313, -403, 389, -1403, 1835, 151, + -132, -1702, -339, -5679, 2026, -2990, 47, -564, + 399, -2167, 1392, 1384, 5094, -2954, 4467, -22, + -23, 408, 1620, 1381, 2380, 805, 380, -36, + -803, 765, -778, 905, -200, -669, 3942, 289, + 176, -4767, 2015, -3554, 1206, 6071, 180, 2057, + -48, 365, -48, -2423, 585, -109, -1298, 2519, + -525, -589, 374, 976, 3667, 2091, -2890, 1371, + -726, -216, -1027, -116, 2122, -619, -3826, 4649, + 1167, 0, 1237, 1538, 2505, -548, -3093, 1344, + -558, -1927, 199, 2462, 1327, 4597, 833, -3660, + -341, -1010, 428, 148, -1682, 130, 1569, 8785, + -752, -1032, -2407, 353, -379, 3311, 892, 893, + -2596, -217, -835, -2291, 1137, -4339, -58, 2759, + 991, 3527, -281, -6050, -1251, 1802, 8, -3916, +}; + +static const int16_t shape8s[] = { + 2639, 550, 6487, 2812, 1014, 1926, 2959, 757, + -1452, -111, -45, -409, 401, 545, 1545, -1677, + 75, -607, -3658, -368, -4486, 272, 6017, -468, + 1108, 1056, 606, -3288, 1003, -830, -336, -2940, + 247, 227, 1700, 338, -161, 5694, 317, -584, + 6278, -2902, -3862, 293, -3400, 540, 177, -840, + -471, 963, -243, -289, 77, 39, 7626, 333, + 577, 327, -359, 999, -392, 107, 1410, 509, + -983, 36, -193, -68, -7612, -775, -178, 1415, + 1069, 1534, -1276, 1204, 615, 2065, 499, 124, + 265, -454, 1974, 6428, -4028, 1102, -1418, -85, + -816, -64, -46, 926, -960, 78, 4823, -41, + -74, -682, -761, -6598, 3084, -1597, 2945, -861, + -3203, -669, -3717, -310, -2865, -1447, 72, 1987, + 364, 4919, -247, 3678, -196, -6807, -127, -965, + 233, -133, 4000, -76, -182, 3825, 67, 700, + -1934, 545, -2467, -1441, 629, 3409, 512, -3333, + 539, -4896, 3413, -2083, 554, 574, 9430, 296, + -88, -533, -321, -1082, 2363, 42, -50, -5402, + -123, 4458, 1130, 2737, 378, 1509, -3267, 970, + 179, -2114, 602, 479, -438, 277, -9389, 1144, + 2453, -3705, -3842, 3965, 482, 1230, 2211, -281, + -1833, -1741, 1653, -868, 485, -3740, 5371, 989, + 1182, 10, -1812, 233, 1028, -3300, 4698, 1572, + 1580, 928, -314, -3452, 830, -1511, -1079, 554, + 641, 1383, 105, -1101, 1549, -3944, 902, -6557, + 493, -3117, 782, -699, -4806, 910, -259, -28, + 1713, -7012, 570, -1270, -4698, -8, 220, -4295, + 1135, -3905, 945, -467, -2164, -651, 181, 212, + 159, 587, 1587, 1101, -7153, -309, -1470, -1135, + -265, -326, 172, 8840, 726, -780, 170, -1038, + 466, 216, 764, 231, -547, 2456, -420, 8132, + 486, 866, -359, 3351, -1829, 2018, -352, -1353, + 711, 645, 1149, 74, -466, -669, 1009, 3086, + 240, 7468, -182, 1947, -221, 496, -448, 189, + -113, -752, 133, -214, -1310, -144, -1034, 5235, + -1939, -2664, 192, 1526, -2320, 762, -778, 357, + 1251, 424, -225, -1008, -229, -352, -3559, -271, + -1069, 1274, -175, 368, 6453, -505, 31, 7678, + 165, -418, -112, -649, 1421, 667, -334, 1041, + -353, 585, 4109, 1095, 5283, 685, -687, -1459, + 1054, 5048, -194, 2220, 81, 244, 3789, 12, + -923, -1459, 319, 2378, -53, 4097, -662, -1156, + 223, 2589, -547, 4951, -346, -1812, -111, 344, + 5247, 387, -459, -810, 1022, 234, 726, 1840, + -545, -888, 728, 106, 1027, -497, 349, -248, + 11173, -311, 126, 479, -2036, 265, -1286, -7196, + -511, 128, -1833, 496, 7620, 2539, -1809, 962, + -614, -876, 857, 2178, 642, -1180, -2294, 911, + 3932, 711, -1073, -1381, -5317, 237, -414, 579, + -78, -27, -78, -14, 100, -191, 142, -1, + 430, -182, 207, -61, -72, -4866, 583, 5099, + -704, -1496, 1065, -206, 2371, 1496, 1777, -308, + 4802, -1415, 1178, 2650, 312, -338, -250, -64, + -27, -3163, -561, -1283, 952, -902, 354, 1597, + -74, -685, -3266, -873, -744, 7079, 732, 697, + 550, -1362, 251, 34, -742, 0, 105, -608, + -1, 10459, 854, -103, -419, 2286, -3041, -3278, + -51, -491, -187, 4204, 857, -1085, -2501, -1647, + 6740, 605, -2079, 1748, 519, 3462, 106, -699, + 220, -615, -406, 420, 786, 572, 679, 218, + -888, 10283, 129, -2286, -705, -78, 5072, 634, + 702, -6315, -551, -307, -7946, 177, -1897, -579, + 1620, 125, 116, -89, -308, -1018, 142, -506, + -624, 917, -779, 632, -5103, 314, -155, 5687, + 77, -144, 2957, -176, 30, 1347, -426, -51, + 7829, 1201, -592, 1, 4617, -5476, 2216, 414, + 1281, -81, -423, -322, 3623, 447, 863, -375, + -489, 526, -485, 159, 1090, 463, 401, -131, + 223, 1630, -2462, -2261, 623, 1019, 6385, -595, + -654, -2787, 2381, 328, -2069, 5410, -402, -554, + -1594, -860, 83, -5011, -938, 1061, 163, -3523, + -1064, 1215, 761, 1604, -4224, 904, -2706, 4907, + -1838, 3287, -3118, -464, -217, -1187, -6792, 1748, + -569, 613, -3177, -253, 164, -845, 539, -440, + -1871, -2010, -2322, -3026, 478, 2297, -560, -5813, + 768, -1709, -620, 66, -4667, 805, -215, 5366, + -442, -233, -6732, 345, 106, 4483, 1720, 2725, + -109, 2746, -188, 204, 1905, 1225, 253, 3270, + 1912, -1852, -256, -4131, 768, 3984, 473, -1434, + 4380, 208, 2547, 1051, 3347, -171, 629, -2389, + -722, -759, 166, 2192, 325, -193, -289, -945, + -436, 931, 1352, 6918, -2707, -987, 2940, 3574, + 4135, -3205, 351, 927, 128, -1873, -4894, -4816, + -461, 696, -1618, 129, -28, 2195, 2450, 585, + 2557, -1308, -2204, -590, 2345, 3699, -312, 4436, + 3422, -611, -106, -2647, -1752, -73, 8914, -673, + 1625, 850, 720, -1182, -245, -113, 882, -223, + -4873, -1009, 5643, -97, -4779, -155, 444, 2894, + -876, -5534, 1268, -132, -881, -389, -4250, -153, + -44, 986, 1820, 8671, 662, -344, -198, -1909, + 1083, 114, -318, 1070, -3293, -375, 6621, 232, + -2973, -100, -483, -529, -120, -5312, 1702, 651, + -631, 485, 5675, 50, 1132, -465, -1053, 2675, + -1592, 5565, 1036, -2808, 325, 999, 524, 2813, + -265, 337, 4226, 514, 576, 6047, 175, 204, + -514, -617, -94, -2862, -294, 1774, 978, -7040, + -169, 835, -829, 2258, -37, -319, 2750, 138, + -289, -1092, 78, 1032, 4316, -1201, 808, -6243, + -940, 4136, 89, -1076, -647, -255, -207, 227, + -70, -62, -202, 66, 24, -988, -9542, -225, + -739, 161, -2698, 117, -608, 173, -629, 1770, + 5037, 5145, 2530, -1028, 3077, -496, 4671, -1859, + 2148, 447, -4231, 170, 713, 323, 746, 1447, + -1880, 5069, 7765, -492, -775, -659, -770, -59, + -258, -92, -1683, -4639, -1727, -2128, 545, -5060, + 2536, 1549, 492, -1280, -6034, 965, 3244, 475, + -1208, 680, -283, 295, -357, -257, 1753, -362, + 3159, 106, -181, 1805, 947, -1002, -136, 756, + 1189, 237, -2427, -263, -5746, 13, 2171, -1197, + -319, -372, -1300, 5458, 955, 1224, 618, -1087, + 2661, -2026, -20, 2137, 342, 4076, 482, 5441, + -6, 2126, -143, -1596, 274, 1009, 94, -3446, + 398, 1079, 289, 2042, 883, -2005, -320, 3848, + 395, 472, 615, 3245, 753, -1881, -216, 5670, + -64, -565, -2560, 1574, 772, -3824, 932, 4830, + 1182, -1054, 390, -40, 1833, -350, 151, 149, + -966, -62, -713, -8794, -593, 87, -3523, -243, + 560, -3296, 244, -775, 7174, 749, -271, 8566, + 99, 1258, 1239, -489, -107, -1699, -611, 1046, + 65, -509, 524, -354, 6400, -248, 148, -682, + -93, -1584, -61, 4509, 479, 110, 7116, -295, + 480, 1545, 3, 127, -2292, 894, 1261, -6288, + -45, -410, -402, -356, 2649, 649, 1652, -643, + 6587, 117, 876, -33, 956, -302, 1619, -1023, + -99, 386, -86, -498, 684, 1189, 146, 381, + 9832, -97, 264, 91, -1197, 461, 374, -6788, + 427, 294, -4776, 0, 2868, 5199, 4573, -827, + -1867, 623, -1214, -573, -1099, -1476, 306, -701, + -224, -4261, -1135, 2500, -4758, 1469, -101, 1812, + -129, 15, 760, -149, -892, -1417, 761, 1213, + -417, 1569, -98, 1675, -139, -7382, -633, 2584, + -519, -5483, 29, 320, -383, -596, -295, -357, + -416, 4054, -457, -355, -5213, -840, -319, 1321, + -424, -129, 5225, 181, -2696, -174, -7363, -327, + 519, 860, -5132, 275, -141, 4943, 204, -200, + 2989, 939, 390, -461, -333, -394, -174, 312, + -129, 7257, -402, 860, -1, 2677, 901, 609, + 248, 935, -493, 8147, 2081, -1171, -2145, 1560, + 1634, 55, -1746, 561, -747, 931, -712, -544, + 798, -98, 580, -829, -546, 238, -2052, -197, + 802, 13067, 373, -6438, 1159, -845, 4313, 19, + 670, -627, -944, 1277, -6997, -609, 1913, 607, + -454, -89, 859, -43, -71, 494, 169, -713, + -2014, 1570, -4712, 233, -4113, 210, -3689, 1019, + 200, 49, 1800, -611, -472, 1234, 579, 363, + -134, 233, 101, -5539, 1924, -1734, -982, -928, + -707, -1238, 1586, 3676, 4741, -2770, 3105, 942, + -1933, 1363, 288, -2528, 160, 485, -38, 23, + 113, -19, -518, -110, -173, -170, 589, -473, + 296, -3742, 1109, -2977, 1349, 5899, 98, 3130, + 855, 499, 3, -3111, -592, 572, -890, 687, + 697, 194, -344, 1139, 3255, 1270, -2451, 1958, + -395, 267, -951, -2224, 2108, -11, -3357, 2602, + 2403, 1596, -532, 2701, 2251, -1217, -2148, 691, + -757, -2051, 373, 1964, 1493, 4756, 1246, -4345, + -496, -1333, -20, -84, -1558, 305, 1183, 8148, + -628, -702, -1730, 232, -261, 2732, 245, 353, + -3745, 1013, 186, -2042, 810, -3894, 351, 2501, + 852, 4162, -425, -4941, -1536, 2237, 1348, -4274, +}; + +static const int16_t shape11[] = { + 347, -5391, 106, 156, -182, -36, 177, 401, + 700, 524, -1343, -402, -6982, 63, 194, -14, + 82, -36, -677, -393, 187, 7364, -507, -1173, + -759, -3759, -728, 2970, 1334, 32, -1322, -2965, + 156, -839, 382, -6382, -149, 874, 1352, -35, + -499, 99, -425, -3118, -32, -1596, 5608, -822, + -41, 2974, -592, 615, 1777, 2364, 5189, -4171, + -581, 936, -527, 318, -1606, -551, 5350, -448, + -40, 7476, 189, 319, -1390, 10, -921, 10016, + 573, -1065, 829, -1190, -22, -4263, 87, -1742, + -325, 313, -188, 540, -5542, -188, 511, -168, + -518, 17, 152, 1966, -2568, -860, 2735, -1210, + 404, -144, -6873, -129, 434, -2978, 2829, -48, + -9196, -1829, -11261, 1492, -4938, 1802, 93, 384, + 1340, 236, 10066, 731, 861, -195, -7571, -77, + -481, -700, 4694, -734, -6317, 281, 1773, 175, + -5535, 532, 31, 7012, -637, -3586, 1096, 3596, + -197, -7837, -611, 1825, -26, -259, 2307, 12, + 729, -1958, 156, 262, 5494, 26, -5792, -3146, + 450, -1075, 297, 509, 154, 668, 191, -268, + -1585, 369, 1314, -693, 677, 1482, 198, 378, + 11088, -83, 2321, -193, -1082, -3053, 20, -271, + 12975, 272, 1114, 476, -798, -309, -159, 5406, + -109, -675, 621, -2564, 11190, -1342, -88, 428, + -465, -4633, -503, 106, -9448, -454, -28, -402, + 1271, -7972, 754, -207, -2491, 518, -3701, -542, + -1268, -617, -177, 467, -130, 990, 4087, 857, + -524, -5822, 145, 217, -7703, -275, 6647, -81, + 550, 887, -433, -802, 532, 643, 188, 1965, + -920, -284, 3711, 1196, -8896, -357, -626, 908, + -284, -706, -1582, 182, 7705, -138, -2372, -158, + -888, 4247, 4381, -6722, -1619, -1810, 632, -1176, + -62, 4261, -89, 265, 1405, -1449, -389, -7068, + 258, -244, -272, -8149, 37, -457, -8839, 3243, + -4291, -396, -3935, 907, -58, 2388, -908, -1209, + -635, -487, -1717, 6989, -4834, 2136, -822, -699, + 2187, -96, -9775, -3464, 795, 634, -823, -669, + 146, -843, 15, -227, 671, -707, -10004, 198, + 81, -1611, -34, -2127, -2385, -689, 622, 1834, + -63, -4925, -215, -1181, -514, 7701, 607, 2030, + -264, 2479, 913, 178, 3625, -194, 613, 877, + -384, -7732, 1008, 2117, 528, -301, 540, -80, + 559, 28, 7542, -496, 1146, -6573, -1457, 7789, + -227, -1671, -76, -371, -865, -141, 42, 96, + 277, -410, -5606, 328, -8954, -222, -1792, 981, + -120, -650, 2269, -1412, 1038, -186, -8530, -264, + 2284, -727, 1511, -4611, -1653, 1985, -50, -8985, + -245, -3315, 407, -915, -23, -70, 30, -669, + -303, 902, 84, 433, 217, -8303, 7847, -1865, + -680, 254, -38, 364, 16, 50, 90, -534, + -4649, -800, 969, -1081, 454, 147, -62, 8797, + 84, -912, -518, -351, 76, -560, -1438, 629, + 16384, 656, 151, 880, 396, -90, 752, -138, + -861, 9605, 258, -440, -6441, 434, 5765, 282, + 1494, -260, -180, -769, 7867, -86, 536, -262, + -230, -8956, 5857, -591, 1533, 418, -505, -156, + 1165, 415, -168, -1504, -336, -667, 527, 5725, + 42, 429, 1691, 1, 85, -196, 3681, 36, + 469, -364, 559, 910, -1848, 259, 249, -1688, + 261, -36, -592, -156, -69, -5938, -180, -294, + 22, -903, 1389, 4853, 121, 5185, 970, 1210, + 561, 926, 472, -183, 6623, 357, -78, -5877, + 91, -188, -6746, -146, 342, -5648, 3697, 1336, + 728, -69, 398, 2667, -2103, 1901, -807, 258, + 72, -137, 341, 71, -169, -104, -83, 206, + -420, 1187, 744, 120, -5151, -574, 72, -8553, + -312, 140, -69, 6067, 5229, 202, -1722, -164, + 73, 1695, -1064, 234, 24, 4881, -849, -460, + 8641, -328, -1217, 1666, -283, -76, 2772, 401, + 843, -4756, 297, 8593, 367, -732, -225, -198, + -3936, 248, -436, 473, -19, -441, 164, 220, + -266, 3, 106, -244, -5814, 597, -666, -245, + -9298, -867, -480, 280, -40, -139, -6378, -4972, + -886, 3062, 747, -1991, -1668, -423, 534, 866, + -73, -6501, -195, 324, -51, -123, 298, 500, + 193, 278, -8503, -297, 1034, -16, -209, 7451, + 521, -305, -297, -1537, -3025, 689, 248, 319, + 5393, 1497, 2228, -773, -141, 2184, 1024, -4535, + -9160, -600, -932, -2145, -539, 460, -1943, 4265, + -2512, 4416, -304, 1744, 489, -362, 898, 2236, + -2224, 49, -192, 332, 366, -143, 329, -7747, + -4, 1075, 116, 551, 19, -7, 7090, -169, + 837, -71, -371, 451, -31, 474, 867, -421, + -4544, 78, 3208, -549, 1984, 1386, -2208, -1402, + 1616, 189, -37, -6953, -5733, 1589, -1314, 1040, + -1480, -5608, 2627, 3517, 250, 7930, 94, 4687, + 1522, 5543, -130, -462, 7613, -654, 647, -6187, + 139, 342, 5069, -729, 128, 17, -49, 176, + 122, 826, 503, 76, -196, 15583, 12884, 746, + -3942, 814, -1744, 1774, -338, 3089, -1694, 559, + -5355, 2834, -1448, 108, -329, -711, 350, 171, + 297, -123, 672, 625, -5884, 6822, 842, 276, + 242, -2254, -623, -846, 2441, 887, -2066, -1019, + 1329, 107, -83, 826, -67, -352, 549, 137, + -1023, -184, -11, 13790, 48, 883, 3538, -533, + -5553, 861, 738, -436, -5259, -66, -405, 3777, + -574, 738, 253, 363, -76, 288, 324, -337, + 157, -119, -97, 171, 514, -1932, -5171, 579, + 249, 1072, -204, -194, -311, 655, -6728, 186, + -178, 99, 5749, -329, 419, 924, -1131, 598, + -15, -103, -2277, 186, -716, -542, 153, -226, + 5689, 219, 52, 3706, -917, 140, -10576, -151, + 1060, 645, 404, 1310, 331, 216, -1413, -6030, + -5069, -3992, 1366, 932, 1559, -87, 7799, 3854, + 3762, -1043, 474, 1184, 102, -2775, -1199, -1079, + 358, -63, 9784, 141, 3947, 194, -132, -332, + -512, -212, -5839, -227, 7759, 807, -597, -1782, + -148, -352, -1225, -692, 147, -1970, 3508, -947, + 3463, -197, 4737, -698, 578, -172, -775, 8167, + 3102, 883, -914, 16, 827, 114, -1916, -909, + -606, 87, 1036, -435, 102, 96, -370, -204, + -11952, 21, 477, 1285, 6281, 855, -7717, 1155, + -501, -597, 5943, 145, -630, -3406, 13, -4211, + 679, 6570, -231, -6042, -503, -194, 1437, 5640, + -1222, 8181, 386, -986, -503, 1221, 839, 763, + -277, -1787, -1491, 5, -206, 42, 2800, -332, + -2841, -143, -456, 646, -668, -117, 883, 86, + 7111, -270, 624, -1133, -308, -479, -9149, -1424, + 242, -12048, 8, 2307, -6530, -529, 462, -1346, + -153, 4315, -182, -675, -78, -480, -49, 398, + -408, -1440, 8196, 436, -561, -184, 175, 1799, + -154, -439, -721, 2170, 322, 6555, -539, -1672, + -629, -2985, 239, -37, 7544, -1048, -1241, 7241, + -636, 2044, -750, 1206, 1363, -530, -5960, 342, + -7440, 616, 372, 4572, -118, 343, 1086, 570, + -164, 553, -433, 562, 33, 8225, -235, -234, + 1230, 234, 906, 563, -73, 10464, -353, -644, + -1453, 1119, 237, 670, -112, 7083, -451, 3410, + -105, 3244, -1331, 102, 738, -3602, 76, 413, + -318, 10, -5471, 1024, -335, 246, -7820, -164, + 2515, -1411, 673, 6022, 50, -6715, 268, 2152, + -951, -60, 234, -2085, 342, 3002, -169, 2473, + -667, -6846, 870, 5467, 150, -66, -4294, -299, + -612, -3859, 177, 353, -4726, 547, 340, -5646, + -2022, 117, -4949, -303, 280, -266, -361, 673, + -139, -5, -7123, -264, 243, -5245, 351, 656, + 5005, 682, -107, 298, -79, 1407, -449, -797, + -669, -552, -242, -8013, 56, 4092, 1583, -3981, + -49, -7972, 390, 366, -31, 1126, 272, 5120, + -10, 1147, -3682, -155, 252, 163, 455, 358, + -746, -2719, -431, 444, -433, 432, -357, 5370, + 328, -3, 1748, 514, 7198, -527, 172, 401, + -59, -3586, 1443, 534, 1029, 539, 3723, 5392, + -6619, -2559, 2344, 282, -980, 97, -317, -786, + 475, -8646, 307, 447, -3107, 211, -56, 3344, + -1549, -9223, 454, 352, -27, 205, 503, 260, + -372, -631, -1165, -6543, 444, 1535, 404, -1752, + -43, -9381, 754, -94, -7134, 2064, 170, 8222, + -280, -1250, -347, 1688, -1203, 239, -1048, -4570, + -4720, -434, -1008, -4151, -2211, -1414, -506, -5411, + 5379, 984, 4587, -63, 143, 968, -203, 5315, + 591, -756, 1228, -372, 703, 6829, -76, 6935, + 467, 3119, -2, -3825, 175, -4000, -3012, -7745, + -832, -2582, 173, 1992, 3768, 275, 39, 603, + -536, 5851, 474, 254, -72, 1286, -836, 5576, + 1357, 3524, 406, -9214, -554, 3974, -352, 1763, + -482, 658, 1628, 3885, 1938, 6172, 1693, -5183, + 150, -6729, 1238, 1062, -10035, -428, 48, 421, + -185, 659, -426, -633, 131, -741, 462, -463, + -391, -193, -270, -682, -343, -12130, -86, -148, +}; + +static const int16_t shape11s[] = { + 22, -5296, -415, -206, 306, 265, 189, 376, + 721, -1503, -429, -538, -6008, -97, -385, -570, + -313, -1469, -219, -1661, 10, 6256, -1230, -635, + -28, -4208, -344, 394, 138, 1174, -170, -822, + 114, -1087, -101, -7362, 84, 862, 1514, 341, + -115, 320, -120, -1625, 55, -719, 1443, -733, + -577, 7197, 148, 26, 120, 1969, 4940, -3777, + -607, 1675, 64, -634, -84, 334, 6882, -644, + -232, 5008, -316, -164, -138, -16, 15, 9441, + -74, -65, 262, 834, 1143, -101, 434, -329, + 123, -204, -45, 147, -4586, -742, 464, 1412, + 548, -1602, -56, 1356, -771, 263, 709, -481, + -193, 345, -8395, -41, 36, -1900, -178, 816, + -7590, 31, -3011, -371, -2698, 2234, -99, 0, + 714, -845, 9357, 701, -1269, -187, -4227, -450, + -73, -1637, 4679, -138, -4470, 356, 1416, 1462, + -3162, 453, -61, 5243, -241, -2385, 438, 4919, + -252, -3781, 150, 335, 58, -185, 1870, 179, + 192, -2572, -454, 77, 4819, 1891, -4843, -2106, + -472, -3842, 167, 1092, -671, 194, -870, 139, + -115, -455, 452, -519, 299, 1024, 330, -99, + 11189, 82, 57, -849, 167, -4190, 639, 768, + 7477, 626, 94, -1259, -303, 181, -280, 2873, + -589, -461, 1591, -29, 6940, -1264, 120, -282, + -159, -3755, -4, -61, -10172, 152, -12, -200, + 111, -8471, -243, 400, -842, 1661, -3099, 500, + -451, -423, -193, 230, 423, 263, 5011, 1010, + 1044, -4781, 707, 84, -6091, -213, 5193, 434, + 534, 1100, -520, -1590, 75, -322, 2, 2008, + -534, 153, 2641, 1510, -6830, -246, 4, 271, + 75, -1308, -1934, -257, 6748, 589, -301, 627, + 1197, 3708, 4450, -5582, -1312, -2859, 881, 429, + 552, 738, -882, 984, 488, -868, -464, -6969, + 721, -2078, 417, -6121, -184, -128, -7840, 2659, + -2584, -254, 176, -790, -727, 482, 357, 104, + -441, -158, -980, 4563, -4098, 1086, -1217, -562, + 2033, 512, -8331, -3506, -73, 808, -372, -1602, + 748, 911, -599, -1499, 58, 309, -10000, -115, + 70, 1603, 280, -146, -817, 517, 18, 1355, + -121, -4134, 152, -1300, 247, 7258, 415, 130, + -27, 2108, 337, -816, 2480, 396, 533, 66, + -171, -6213, 47, 3081, -648, -930, 1810, -233, + -433, -588, 5526, 58, -18, -3498, -381, 8009, + 7, 1229, 152, -410, -567, 423, -354, 463, + -82, -146, -2868, 271, -5773, 2694, -1006, 150, + -113, -521, 2553, -278, 593, -69, -6517, -785, + 369, -2483, -216, -3144, -889, 1724, -168, -6303, + 171, -1895, -798, -137, -172, -746, -54, 162, + -607, 409, 201, -284, -143, -10681, 7747, -1148, + 303, 58, 4, -96, -485, -146, -286, -577, + -644, -512, 236, 576, 421, 93, 293, 10284, + -2, -117, -590, -546, 350, 445, -301, -300, + 10823, -224, -96, -551, -148, 1042, -125, 224, + -706, 8583, -195, 52, -2732, 200, 4419, 390, + 870, 100, -184, 233, 6179, -317, -472, 1964, + -302, -8722, 2509, -644, 488, -3101, 891, -253, + -38, 133, -15, -1365, -779, -612, 673, 5587, + 834, 377, 835, -2018, 75, -185, 3641, 121, + 693, 63, 503, 646, -7, 348, 141, -1311, + 532, -513, 95, -315, -65, -6478, -16, -848, + -210, -120, 676, 5125, 533, 4147, -622, -4, + -150, -1507, -124, -185, 5365, 267, 1073, -4479, + 173, -204, -4164, -952, -23, -4088, 1391, 205, + 712, -473, -373, 547, -685, 4542, -49, -71, + 33, -271, 132, 246, -188, 6, -309, 118, + 96, 1774, 158, -83, -3573, 1175, -122, -6619, + -1677, -1161, -266, 4776, 3453, 62, -346, -450, + -1380, 103, -457, -1260, -71, 4271, -338, -1394, + 6462, 395, 647, 2430, -735, 444, 1837, 403, + 144, -5573, 211, 4608, -15, 804, 70, 1969, + -3451, -138, -352, 1176, -171, -518, -114, -88, + 335, -308, -64, -428, -4115, 318, -205, -126, + -7854, -609, 105, 144, 270, 266, -4543, -5246, + -311, 587, 305, -115, 372, 727, -294, 414, + 877, -7899, 411, -538, 394, 535, 233, -826, + 329, 491, -4848, -650, 331, 1026, -140, 6474, + 194, -457, 98, -871, -2293, 873, 353, 812, + 4510, 1102, 379, 651, -214, -110, 20, -2749, + -8040, -96, 221, 221, -39, 444, -280, 2814, + -536, 3509, 111, 830, 594, 553, 47, 2812, + -1898, 203, -353, -60, 371, 181, 824, -5448, + 297, 476, 42, -133, 97, 425, 8586, -317, + 121, 453, 1014, -350, 175, 747, -78, -287, + -5832, 625, 4170, -308, 1853, 2846, -3, -876, + 535, 431, -411, -2139, -6021, 374, 298, 1572, + 19, -4069, 1567, 144, 3, 5541, -438, 920, + 87, 1728, 230, 807, 5848, -413, 7, -6241, + 214, 205, 1312, -675, 70, 264, 114, -24, + -482, -72, -296, 327, 249, 11047, 11070, 18, + -937, 350, 22, 362, 555, 815, 130, -125, + -4545, 2662, 203, -318, -305, 323, 633, 416, + -254, 301, 99, 407, -4951, 4766, -790, 1334, + 912, -1046, -350, -135, 3744, 22, -1647, -422, + -151, -113, -130, -345, -2, -263, 18, -24, + -771, -34, -543, 10259, 183, 0, 1743, 1267, + -2554, 320, 611, -1064, -1446, 875, -808, 4865, + -816, 3452, 68, 326, -178, 177, -10, -138, + -33, -93, 65, 264, 185, -157, -5749, 110, + 407, 1240, -698, -61, 176, 1557, -6012, -606, + -555, 458, 3226, -939, 933, 153, -32, 928, + 69, -490, -1543, -87, -20, -196, -327, 423, + 7911, -189, 178, 335, -194, 459, -10572, -196, + 174, -286, 502, -1041, 12, 39, -101, -3983, + -1650, -2902, 386, -151, 1051, -619, 6854, 3408, + 1140, -1854, -755, -40, -1108, -1502, 221, -397, + 375, 1081, 10375, 389, 270, -239, 311, -212, + 384, 1237, -2951, 199, 5281, -56, 34, -704, + 942, 1169, 33, -310, 97, -1216, 3023, -836, + 3256, 404, 3951, -257, 2139, 111, 179, 8255, + 611, -240, -252, -367, -251, -296, -2282, 957, + 61, -265, 720, 232, 34, 146, 204, -290, + -9923, 529, 65, 696, 2958, 352, -3852, 1248, + -743, -395, 5969, 92, -132, -1206, 314, -4013, + 717, 5157, -770, -1878, -1201, -958, 525, 4028, + 116, 6772, -45, -1086, -335, 5815, 51, 57, + -85, -2301, -133, -300, 7, 227, 3429, -1075, + -4353, -832, 30, 1259, -484, 451, 604, -717, + 6765, 294, 118, -410, 299, 592, -3845, 66, + -502, -9088, -74, 259, 450, 475, 202, -1792, + 23, 4719, 709, -398, -1676, -351, -898, -622, + 145, -1392, 7305, 1014, -80, 519, -2065, 1531, + 860, -1448, 134, 1683, 689, 7179, -345, -327, + 1004, -2467, -340, -1302, 5825, 373, 50, 6796, + 314, 13, -270, -426, 702, 279, -4392, -508, + -6521, 60, -278, 2479, 847, -360, -68, -1948, + 91, 969, 421, 459, -341, 6020, -550, -77, + -687, -754, 5, 109, 410, 10860, -183, -317, + -734, -87, 501, -601, 158, 5836, -1057, 1236, + -850, 2965, -330, 547, 1249, -2804, 127, 218, + -455, -805, -4002, 108, -569, 660, -5356, -1091, + 581, -445, -311, 6409, 510, -6789, 519, 1607, + 296, 342, 368, -1440, -846, 1997, -227, 2332, + -2062, -4657, 1030, 5322, 135, 131, -3414, 320, + 1030, -3341, -256, -373, -4565, 1222, 171, -4972, + -1444, 303, -5427, 435, 208, 251, 467, 539, + 136, 199, -8876, -195, -771, -3096, 740, 368, + 1047, -490, 83, 485, 168, 531, -635, -801, + -953, 4, -95, -7603, -59, 2023, 739, -702, + 263, -9230, -313, -997, -510, -772, 156, 3986, + -113, 398, -2602, -1079, 195, -211, 128, 1917, + 221, -965, 11, 71, -101, 180, -36, 7839, + -144, -722, 288, 429, 5704, -984, -510, 775, + 440, -1849, -1348, 1989, 300, 43, 1928, 4341, + -3840, -2427, 2025, -660, -293, 23, -249, -177, + -327, -7858, 33, 245, -1334, 237, -687, 2800, + 30, -8807, -404, 43, 183, 289, 528, 510, + -197, 590, -94, -5423, 381, 1317, 141, -1639, + -432, -7628, -224, 56, -7788, 113, 134, 6981, + -636, 756, -743, 97, 159, 1263, -143, -2941, + -2680, -479, 1395, -1667, -472, -992, -451, -5708, + 4262, 334, 3053, 76, -584, -599, -276, 3518, + 264, -2118, 358, -106, 911, 5053, 480, 4538, + 949, 5203, -103, -14, 177, -3397, 55, -6813, + 680, -1788, 145, 2267, 1104, -789, 54, 261, + 228, 5494, 15, -224, 192, 740, 0, 7632, + 398, 2879, 430, -8212, -657, 815, -228, -488, + -90, -1296, 595, 2979, -15, 4055, -252, -3883, + -935, -7654, 330, 97, -10200, 462, 223, -1017, + -309, -342, -124, -1258, 211, 351, 316, 414, + -91, -18, -202, -74, 410, -11127, 326, 261, +}; + +static const int16_t shape16[] = { + -855, 1549, -4841, 629, 932, -5896, 840, -2041, + -305, -2574, 343, -31, -780, -773, -353, 403, + -1907, -2371, -555, -324, -479, 6961, -286, -4290, + 626, -953, -14, -1681, -443, 1504, -366, 513, + -1206, 870, 9239, 112, -213, 425, 381, 1802, + 750, 594, 61, -152, -2060, -8997, -752, 197, + -493, -176, -389, -591, 2988, 654, 2404, -204, + 304, -279, 202, 66, -185, 415, 159, -1514, + -6775, -37, -2617, -1246, -4012, 1208, -554, 3240, + -655, -394, -1464, -4448, 388, 1058, -364, -1760, + 1081, -558, -116, -108, 99, -925, 763, -1301, + -251, 258, -33, 311, 555, 227, -279, -601, + -135, -675, -10615, -937, 158, 503, -2044, 1075, + -114, 4278, -9040, 67, -1076, -705, -122, -533, + 3299, -1826, -1316, 708, -3840, -740, -370, -1074, + 87, -462, 2177, -1177, 57, -6311, -170, -777, + -256, 435, 291, 10371, -82, -425, -1757, -196, + 3824, -6289, 62, 4506, -519, -783, 1155, 878, + 295, -2044, 305, 186, 263, -1716, -482, -5678, + 415, 2709, 213, 7531, 1376, 813, 1803, 190, + 398, 6483, 1425, 235, 2713, 520, -2892, -1191, + 6074, 654, -6535, 320, -736, -478, 2563, -309, + -3477, -155, 275, 1024, 390, -386, -331, 14043, + 251, -410, 1496, 24, 1272, -816, 549, -238, + -2489, 158, 194, 1, -306, -3088, -264, 200, + -30, -520, -472, -30, -464, -764, 440, -659, + 88, 778, -31, -1794, -3817, -344, 887, -551, + 115, -763, -5338, 2906, 50, 736, 5536, -1101, + 330, -405, 416, 1022, -93, 71, 10034, -200, + -1258, -3405, 480, 141, 399, 500, 311, -503, + 301, 4398, 454, -922, 975, -101, -775, -81, + -1723, 1077, 857, -1682, 813, 847, 342, -276, + 3582, 2991, 5571, 713, 1280, 596, -1325, -1087, + -681, 1411, 391, -1728, 492, 544, 1512, -724, + -7445, -426, 6, -534, -3643, -1598, 2650, -834, + 2096, -333, 67, 1746, -1584, -1003, 1272, 1710, + 1666, 176, -11716, 329, -1829, 385, 802, -382, + 2244, -8, -222, -2351, 369, -1067, -9354, 293, + -51, -1849, -500, -2350, -1824, -826, -450, -2155, + 456, 245, 1796, 320, -73, -306, -122, 290, + 118, -298, -675, -180, -828, 86, -44, 165, + 435, -8249, 769, 630, -1670, -762, 453, 5893, + 259, -92, -1003, -358, -32, -1350, -535, -289, + 409, -558, -344, -752, 6037, -680, 2471, 581, + -351, 1251, -5827, 194, -104, 815, 1257, -619, + 243, 410, 4455, -969, 50, 1286, -1013, -293, + -7740, 73, 615, 523, -149, -824, 2235, 1571, + 970, 944, 4778, -132, -5082, 83, 129, -820, + -803, 694, 1615, 1163, 517, -402, -80, 762, + -107, -419, 142, -294, 11298, 301, 484, -513, + 105, 547, 1130, -4253, -742, 376, -1545, 1076, + 4372, 2338, -2847, 495, -190, -2444, 931, 6487, + 117, -1273, 1488, -75, -322, -487, -2614, -251, + 1233, 4111, -321, -219, -7961, -11, 107, -808, + 450, 111, 4395, 89, 772, -1878, -1894, 1075, + -544, -9467, -459, 637, 842, -956, -738, 4452, + 777, -75, -209, -302, -796, 785, -7413, 321, + 649, -55, 114, 43, -1026, -223, -611, 209, + -5543, 8206, 907, -3358, 1452, -543, -3173, 525, + -95, 35, -475, -525, -705, -569, 350, 206, + -108, -1523, -680, -283, -2583, -4992, -59, -968, + -1719, -2750, 5884, 455, 29, 436, 784, -101, + -216, 110, 612, -511, -12, 98, -67, 177, + -1210, 222, -345, 243, -12670, -472, 282, -2149, + 687, -2631, 4434, 77, -521, -404, -934, 212, + -695, -369, 1138, 1348, -905, 501, 299, -10467, + 1018, 818, 1941, 31, 257, 1219, 944, -157, + 1968, -1649, -126, -440, -599, -1, 6190, 2574, + -332, 753, 195, -131, 5972, -297, 672, -86, + -143, -303, 5, -121, -154, -613, 5541, -1516, + -304, 962, 69, -1857, 4142, -134, 706, 896, + -1226, -135, -310, -9261, 1135, -3437, 620, 802, + -33, -582, 1909, 1407, 242, 2599, -1533, -279, + 836, 8070, -1207, 5745, 200, -77, 162, 781, + -466, -1555, 3297, -957, 225, 1290, 7, 677, + 41, -549, -2778, 1400, 379, -3367, 369, 615, + -6402, 527, 58, 5679, -114, -180, 2842, 88, + -2611, -50, 371, 161, -444, 2062, -38, 272, + -8562, 769, 18, -2593, -226, -503, -959, -1295, + 189, -371, -675, -1528, -98, 514, -1236, 116, + 202, 13662, 1596, -328, 61, 3567, -486, -3316, + -8473, -317, 2868, -419, -17, 535, -965, -503, + -3848, 2222, 620, -1740, 2, 6505, 473, -297, + -70, 3043, -51, -1520, 993, 1046, 1965, 3240, + 1971, -60, -650, -53, -248, -4428, -365, -3723, + 1122, -1681, 1629, 1358, -17, 1136, -256, 2344, + -282, 156, 127, -155, 318, -1281, -1066, 57, + -889, -253, -1396, -579, -920, -1006, -9202, -703, + 195, 5186, 241, 1742, 996, 118, 1431, 4415, + -2452, 6837, -1272, -569, 3485, 328, 441, 832, + 553, 94, 648, 92, -378, 11167, 775, 457, + 1712, -24, 941, 5433, -1645, 2166, 249, -55, + -1816, 383, 735, -876, 443, -568, 293, -1266, + 6963, -178, -174, -1186, 1119, -208, 821, 1499, + -1496, -2171, 1434, 874, 133, -7466, -545, 2193, + -775, -1405, -1205, -575, -1996, -645, -552, -263, + 8861, -517, 76, -992, 278, 2417, -1369, 35, + -1461, -1399, 517, 185, -2895, 347, -3871, 3644, + 284, 3284, -12, -169, -1981, 1196, -67, 2868, + 910, 134, -530, 150, -1328, 1902, -746, 351, + -222, 522, -5702, 797, -1900, 241, 2270, 764, + -335, 1348, -349, 784, -1586, -537, 148, 3211, + -1692, 56, 1678, -321, -290, 7902, 69, 52, + 310, 337, 250, 596, 9998, 336, 1037, 163, + 64, -441, 2894, -1033, 730, -718, -1252, 459, + -131, 7840, -922, -555, 5671, 299, 689, 1115, + -646, -505, -263, 608, -494, 0, 442, -1802, + -598, -701, -4184, 70, -1319, -90, 9155, -339, + 0, 121, 462, 735, -639, 481, 125, 6924, + 3379, 683, 3053, -1219, -499, 1067, -148, -2705, + -11, 795, 1675, 898, 226, 1232, 49, -572, + -9309, 2223, 949, 767, -821, -91, 1075, -352, + -7829, 554, -593, 1284, -245, 1239, 1166, -1157, + -5274, 808, 871, -1446, 7575, -397, -755, 752, + 4193, 179, -205, -37, -750, -2675, -407, -700, + 220, -77, 1604, 63, 461, -9994, -645, -1629, + 103, 576, 132, 10005, -49, -1005, 97, -1608, + 515, -10, -146, -1878, 880, 429, -1271, 996, + -365, 76, -409, 2461, 29, 1159, 217, -6240, + -200, -746, 118, -1884, 457, -816, -608, 3215, + 244, 749, 2268, -236, -1276, -278, 1392, -1767, + 1255, -1474, -8136, 1388, -770, 225, -443, 10, + -392, 659, -1118, -1651, -514, -935, -111, 1112, + 973, -247, -235, -13010, -737, 40, -141, 5167, + -910, 279, -467, -3762, 847, -3935, 1018, 1922, + 830, 190, 253, -1130, -415, 371, 718, 3833, + 1036, -5358, -928, 866, -514, 2724, 2354, 449, + 210, 1462, 680, -1880, -62, 10988, 809, -602, + 145, -536, 114, -147, -568, 3193, -322, 892, + -637, -1381, -65, 761, 1615, 5025, -327, 4941, + -631, -5225, 1204, 3042, 998, -1047, -959, -106, + 1610, -151, 120, -1152, 191, 30, 11963, 101, + 18, -410, -1288, 370, -771, 1337, -544, -613, + 289, -117, 1625, -4506, 2582, -1690, -105, -5324, + -93, 285, -1167, -3564, -729, -4790, 595, 275, + -216, -217, -6000, 682, -171, -875, 224, -164, + 2919, 796, -81, 1434, 186, -375, -4113, -179, + 277, 1363, -453, 2505, 388, -1840, -165, -4800, + -42, -6632, 54, -735, -553, -1679, 917, -2, + -632, 417, -478, -494, -265, 73, -372, -360, + 179, -448, 265, 299, -152, -211, 12730, -77, + 1954, -534, 773, 524, 438, 1901, -4413, -358, + 1552, -248, -1588, -122, -127, 5405, 226, -849, + -7495, -357, -89, 185, 746, 851, 669, 305, + -247, 3457, -193, -161, 638, 600, 610, 855, + -1292, 398, 1528, 2250, 1651, -8414, 763, 1529, + -346, 3769, -111, -6494, 347, -742, 1941, 1967, + 582, -5499, -765, -818, 1850, -1604, -243, -943, + -11, 884, -2996, -2375, 1010, -374, 6605, -287, + -5073, 211, -758, 703, -2607, 747, -130, -429, + -2481, 4894, -457, 3225, 958, 8533, 542, 6177, + -1069, -1210, -963, -5943, -86, 1424, -567, 827, + -510, -6577, -258, -4, -4430, 115, 5401, 1390, + 354, 1755, -998, 852, 993, -481, 218, -987, + 779, -417, 591, 6011, 528, 289, -336, -558, + 60, 9124, -174, 235, -239, -144, -260, -3472, + 746, 4781, 652, -4831, -739, -21, 864, -2310, + 652, 7147, 116, -318, -50, -3485, -325, -345, + -5784, 1144, 2399, -1443, 991, -2318, -785, -281, + -207, -1448, 309, 1001, 952, 1472, -5901, -780, + -2459, 1518, 9878, -1229, 670, -523, 1217, -164, + -55, -95, 243, 7909, 86, -4380, -859, -599, + -183, -2339, 774, -1210, -502, -899, 53, 1039, + 34, -7753, -296, -1951, -4559, 1182, -150, 2878, + -4910, 2761, -1481, 2048, 2600, 1808, -2953, -2257, + 62, 162, 1115, 214, -4510, 926, -6669, 1443, + -124, 193, -314, 302, 699, -18, 745, 341, + 895, -615, -295, -181, 143, -427, 6528, 1074, + -1126, 374, -298, -1274, 22, 887, -511, -1057, + 3228, 722, 607, 624, -95, 11085, 1006, -788, + -285, -92, 1342, -325, -828, 42, -3588, -631, + -576, 4559, -668, -1294, 1739, 1697, -647, 2336, + 376, -120, 1350, 646, -325, 95, 5974, 775, + 199, -8557, 931, -336, -651, -561, -433, -2266, + -129, -657, -1184, 67, 577, 617, 1880, 552, + 90, -617, -273, -1571, -7481, 261, -26, -20, + -459, -1028, 57, -8516, -43, 2774, 1, -4238, + 680, -3310, -56, -152, 548, -1983, 920, 899, + 2180, -307, -2230, -1685, -998, 2091, -112, 21, + -1551, 1182, 6649, -326, 792, 1818, -7596, 563, + 1076, 7422, -908, 1524, -223, 5798, 1318, -3376, + 517, 4162, 756, -4142, 1776, 390, 334, -44, + 218, 5290, 792, 39, 1692, 542, -62, -595, + 590, 27, 8922, 989, 182, 725, 112, 458, + -9170, -1000, 1176, -1290, -1403, -726, 5990, -297, + 1234, -1724, -601, 528, 1072, 184, -146, 61, + 685, 1208, -88, -211, 356, 9569, -363, -135, + -159, -1061, -105, -410, -58, 335, -9986, -300, + -211, 607, 443, -410, -1730, -328, 275, 579, + 805, 899, -464, -18, 296, -446, 2396, -13, + 414, -9662, -385, -808, -1867, 154, -572, 3351, + -1839, -80, 1157, -326, 481, 8815, -1039, 1065, + 2110, 1223, -960, -33, -464, -5660, 490, -314, + 346, 730, -387, -1102, 6656, -719, -1173, -57, + -1186, 2394, -1300, -665, -586, -39, -71, 155, + 1184, 4, -3269, -333, -747, 580, 279, -583, + 7164, -185, 110, 2465, 428, 507, 4462, -4461, + 199, 337, -3597, -249, -70, -680, -5549, 1533, + 917, -303, -9230, -431, -124, -1019, 369, 139, + 1367, 151, -1047, 6820, -151, 222, -2934, -817, + 971, -7325, 556, 1035, -1240, 3115, -1326, 4012, + 2812, 1057, 2580, -261, 3989, 1999, 1624, 2402, + -310, 779, -354, -377, -149, 1035, -2363, 358, + 3666, -246, -1896, 375, 3919, -1392, 683, 624, + -5872, 644, 391, 288, -198, -237, 68, -284, + 88, -1016, 250, 32, 1188, -243, -608, -320, + -219, -11087, 543, 156, 1034, -169, -183, -549, + -66, 716, 996, -928, -309, 5577, 229, 125, + -1328, 9027, -698, -485, -1694, 839, 343, 449, + 1655, 1005, 1053, -408, 9106, 186, 670, 774, + 314, 573, 3888, -882, 26, 2518, -533, -195, + 555, 337, -246, -10779, -231, 31, -314, -941, + 1129, 333, -7503, 168, -551, 237, -159, 4399, + 421, 693, 198, -196, -561, 1035, -548, 1058, + 527, 3617, -361, 1317, -1975, -2638, -1966, -120, + -324, 5678, -2252, -663, 181, -273, -3073, -282, + -622, 363, 71, 184, -776, 284, -1516, -430, + 3, 937, 8587, 258, -1060, -1555, -830, -338, + 318, -9130, -110, 459, -572, 70, 93, 120, + -534, 1296, -168, 29, -914, -332, -997, -818, + 270, -243, 523, 56, -11847, -448, 11, -154, + 164, 2115, -13, -635, 708, -663, 43, -248, + -3244, 254, 19, -1125, 508, 154, 8697, 191, + 595, 4393, -2806, -168, -1916, 393, 3976, 897, + -1716, -35, -180, 605, -1057, -1194, 100, -384, + -37, -107, 2739, -207, 6899, 176, 81, -901, + 1280, -1670, -101, 281, 1147, 48, 21, -151, + -1236, 210, 98, -114, -573, 7940, -153, -302, + -1331, 337, -322, 6598, 477, 147, -999, -3166, + -232, -5104, -799, -1866, -58, -4213, 1376, 181, + 675, 562, 126, 235, 2260, -5152, -243, -699, + -1476, 4135, 569, 567, 737, -4163, 613, -1057, + 1778, 546, -450, -24, 325, 366, 2406, -1319, + 60, -5126, 49, 657, -5937, -194, 882, 3267, + 178, -298, 1873, 12422, 459, 272, 195, -1827, + 212, -802, 730, 471, 1556, 422, 640, 236, + 71, 597, 5783, 5378, -649, 1524, 829, 437, + -351, -122, -1400, 2119, -128, 75, -1677, -633, + -322, -6382, -573, -974, 1672, -378, -242, 3708, + 79, -1325, 397, -150, 1977, 442, 747, -127, +}; + +static const int16_t shape16s[] = { + -392, 96, -7720, 99, 524, -8272, -20, 164, + -434, -85, -428, 1362, 108, 223, 1053, -11, + -193, -5140, -191, -159, 193, 8005, -39, -483, + 1764, -1061, -268, -318, -880, 474, 49, -8, + -223, 130, 11263, 165, 12, -43, -103, -1145, + -588, -81, 299, 73, 444, -7243, -1411, -640, + -946, 16, -881, 496, 2403, -476, 1090, -294, + 29, -148, 109, 145, -52, 247, -545, 1115, + -7451, -491, -1459, 397, -8603, -1022, 1494, 298, + -5156, -358, -1097, -2911, 423, 652, -378, -2357, + -74, 415, -367, 402, 2173, -154, 122, 283, + 1352, 302, -373, -431, -283, -109, -64, -343, + -108, 55, -14644, 241, 37, -723, -71, -208, + -126, 4061, -9887, 494, 2273, -505, -4040, 66, + -806, -1121, -1894, 783, -1445, 426, -820, -1739, + -11, 650, -282, -518, 124, -7266, -21, 160, + -339, 5, -208, 11712, 198, -53, 921, 89, + 5987, -4806, 176, 1884, 64, -517, 2169, 108, + 297, -111, -389, -840, 663, 75, -485, -4862, + -177, 2663, -229, 8120, -219, 462, 3104, 955, + 384, 1310, -73, -504, 258, 170, -1796, -482, + 5691, -437, -8474, 583, -1685, -827, 292, -65, + 1994, -384, 105, 123, 256, -82, -367, 15204, + -128, -260, -10, 169, 249, -1286, 1055, 136, + 678, 61, 1420, -159, -15, -221, -250, 107, + -21, 297, 54, 242, -111, 468, 237, -36, + -159, 37, -102, -488, -4577, 72, 1009, -1, + 1218, 2023, -640, -437, 766, -299, 6144, 184, + -1023, 171, -388, 884, -1294, -320, 8718, 896, + -295, -976, -803, 3092, 1720, -255, -1354, -665, + -63, 4382, 41, -121, -157, 354, 127, 587, + -599, -231, 484, -150, -284, -498, -511, 79, + 5503, 13, 6537, 761, -1619, 1164, -2403, 3057, + -4966, 724, 1076, -1555, 889, -365, 60, -440, + -7144, -132, 283, -305, -126, -1482, 125, -52, + -33, 1284, -961, 1355, 953, -1012, -227, 86, + 731, -14, -15977, -56, -875, -1676, 127, 500, + 3390, -14, -319, -644, 143, 249, -10752, 23, + 54, -1075, -111, 680, -1714, 328, -2092, -852, + 622, 949, 61, 6, -17, 144, 190, 216, + 130, -65, 27, -322, -139, 43, 89, 76, + -84, -10120, -47, 367, -261, 38, 50, 4233, + -210, 14, -1, 25, 762, -299, -132, 177, + 974, -492, -145, -43, 5105, -394, -196, -91, + -25, 473, -8358, -476, 589, -1372, -254, -2387, + -293, -304, 3828, -254, -193, 493, 54, -108, + -8789, -262, -233, -821, -222, 714, 1270, -61, + 892, 13, 3952, -36, -1567, -620, -126, -1056, + 587, 390, -24, 2027, 267, 218, 15, -56, + -130, 40, 551, -29, 14594, -23, 106, -14, + -172, 279, 427, -241, 303, -20, -748, 55, + 5187, 598, -217, 2026, 643, 118, 911, 8023, + 296, 791, 39, -2621, 655, 228, -671, -272, + -176, 6644, -166, -264, -10429, 91, -83, -684, + -169, -344, 2123, -102, -333, -317, -826, 586, + 116, -9311, 445, 141, -1315, -758, 144, 5620, + 363, 66, 142, -161, -684, 454, -6584, -205, + 577, 205, 305, -1536, -4109, -318, 121, -323, + -1036, 8020, 1146, -4004, 175, -1568, -1537, -525, + 2284, 62, 11, 640, 1243, 260, -104, -344, + 102, -624, 122, -300, 266, -6104, -1149, 412, + -1380, 22, 7561, 360, 564, 398, -338, 174, + -76, 131, 44, -426, -12, -175, -113, 78, + 293, -120, -92, 331, -16163, -74, -101, -1198, + -298, -171, 4052, -139, -187, 131, 323, 370, + -144, -160, 131, -284, -190, 83, 878, -14817, + 14, 196, 198, 294, -120, 40, 800, 1841, + 393, -168, 337, -540, -356, 130, 9210, 880, + 304, -2304, -275, 1394, 9903, 673, -62, -4706, + -130, 274, 528, 89, -458, -90, 6318, -133, + 310, -5953, 682, 37, 2937, -371, 197, 77, + -184, 1240, 22, -7695, -171, -4874, -676, -1121, + -842, -642, 1160, -1088, -864, 352, -790, 794, + 801, 10564, -1777, 1095, -441, 1718, 116, 982, + -268, 199, -2408, -2042, 279, -146, 645, -1350, + 5, -150, -932, 113, 25, -672, 153, 158, + -6140, -262, 142, 4815, -1, -424, 810, 63, + 88, -510, -236, 3964, -66, 1229, -16, -758, + -11023, -1149, 48, -1756, 167, 2308, -96, -654, + -639, 369, -221, 47, 202, 329, -352, -26, + -19, 13198, -383, 124, -1211, 3879, -344, -1954, + -8702, 32, 924, 472, 7953, 692, -216, -415, + -3174, -1959, 935, 4048, 155, 7521, 854, -157, + 643, 3760, -107, -2536, 622, -742, 1881, 2262, + 758, -968, -271, -131, 385, -5107, -212, -2548, + 29, -132, -506, -190, -1065, 314, 202, 332, + -2274, 701, 4, -22, -439, 198, -265, -92, + -143, 460, -32, 189, 334, 87, -7639, 45, + -387, 4240, 1231, 92, 1032, -333, -280, 2061, + 296, 365, 2003, -426, -35, 96, -62, 882, + -784, 483, -128, -143, 474, 13740, -166, 184, + -714, 142, 278, 5622, -67, 282, 647, -130, + -31, 300, 727, 728, 409, 178, -601, 84, + 8305, -446, 179, 115, 209, -273, -47, 1932, + -255, -3171, -102, 461, -119, -8102, -809, 108, + -1680, -3171, -775, 324, -246, 132, -27, 84, + 8495, -45, 153, 21, -1384, 290, -869, 38, + -440, 133, -257, -22, -3046, 12, -2797, 4517, + 142, 1605, 423, 579, -558, -301, -257, 701, + -246, -468, -1946, 120, 321, 710, -217, -203, + -50, -44, -5866, 80, 259, 488, 754, 124, + -517, 703, -197, 146, 576, -717, 247, 4121, + 10, -422, -2686, 329, 1183, 14573, 72, 301, + 2043, -125, -1420, -1263, 10340, -678, -1226, 330, + -62, 173, 5885, -56, -178, -1090, -616, 953, + -216, 8277, -124, 411, 7758, -78, -326, 786, + 46, -1365, -555, 479, -774, -576, 8, 304, + 390, -186, -820, 72, -67, -585, 11070, -213, + -12, 344, -399, -748, -150, 2719, 195, 5652, + 4626, 549, 2782, -4, 1928, 482, 1008, -6398, + 843, 457, 1843, 269, 1247, 350, -661, -35, + -6477, 3727, 2313, -424, -907, 415, 1075, 3960, + -1499, 61, 594, -744, 110, 2486, 967, 27, + -5263, -618, -578, 313, 7055, -1081, 739, -492, + -2051, 317, 112, -155, -304, -507, 150, 253, + -42, 221, 92, -275, -355, -8494, -663, 109, + 282, -836, -271, 9316, 165, 63, -171, 10, + -38, -180, -219, -250, -924, -573, -241, 566, + -175, 20, 454, 251, -328, 236, -215, -5673, + 0, -265, 225, 354, 113, -488, 174, -132, + 134, -188, 1255, -94, -55, -193, 404, 504, + 784, -377, -5731, 333, -447, 222, 138, 72, + -256, -58, -230, -169, 728, -481, 95, -394, + -74, -489, -253, -13770, 61, 184, -36, 5025, + -232, 321, 253, -3414, 120, -2512, 799, -586, + 1186, -1135, -955, -54, 7, 83, 0, 5259, + 466, -6358, 254, 388, -211, 207, 2449, 379, + 430, -219, -442, 228, 151, 11819, 67, -101, + 239, -282, 121, -270, 1209, -386, 553, -108, + 789, -518, 237, -48, 497, 8986, 80, 8232, + -89, -359, -803, 473, 995, 1132, 624, 1353, + -305, 711, -71, -26, 18, 254, 13079, -72, + 178, -18, -116, 293, 155, -254, -819, -166, + -808, -190, 150, -4328, -33, -14, 272, -6417, + 78, 78, 67, 310, -177, -435, 225, 610, + -15, 1, -6706, 30, 1, -189, 270, -21, + 276, -182, 77, -231, 30, -116, -7713, 158, + 344, 560, 1466, 3575, -84, -4583, -1260, 372, + 1395, -5223, 284, -1911, 315, -2312, -47, -207, + 414, 129, 36, 85, 317, -125, -63, -212, + -76, 130, -385, 157, 117, 12, 16140, -171, + 375, -721, 161, -342, 950, -667, 1011, 15, + 536, -1203, 1039, -242, -159, 7664, -429, -264, + -8221, -109, 867, -74, -79, -414, 544, 206, + 120, 1859, -44, 73, 554, 121, -160, -127, + -33, 44, -24, 285, 589, -12514, 51, 464, + 17, 264, 58, -6861, 367, -672, 227, 2793, + 782, -6286, -420, -808, -1247, 895, 950, 1533, + -1079, -207, -1927, -4947, -803, -328, 7677, -386, + -4608, -329, -485, 2365, -1492, -1738, -378, -707, + -1850, 9044, 314, 3530, 61, 2921, 79, 9508, + -1102, -3487, 814, -2828, 550, -929, -712, -274, + -566, -2521, 536, -296, -97, 951, 11352, -614, + 106, -342, -1017, -1183, -157, -457, 266, 109, + 545, -313, 1015, 6961, 52, -224, 2247, -248, + -180, 12367, 311, 514, 1218, -561, -2546, -3275, + 218, 8281, 187, -6550, -96, -1001, 1777, 89, + 916, 1042, 399, -267, -97, -3552, 397, 1984, + -6134, 784, 2136, -1346, 619, -1450, -1022, -1226, + 185, 306, -274, -122, 343, 129, -4481, -749, + -759, -496, 8785, -178, 457, -601, 875, 1040, + -268, -1592, -531, 9667, 360, -4978, 525, -436, + 123, -1566, 227, 820, 74, -5, 1477, 154, + -1589, -9411, 248, -485, -3293, -690, 175, 53, + -21, 303, -2376, 106, 515, 2688, -401, -1278, + 425, 540, -353, 662, -7461, -397, -7029, -976, + 445, -1648, 164, -254, -563, 556, 876, -205, + 884, 214, -92, -509, 96, -53, 5734, -295, + -136, 211, 168, 261, -74, 411, 25, -59, + 3596, 400, 320, -69, -21, 14062, -510, 142, + -232, 1597, 34, 240, -476, 131, -3836, -186, + 2579, 2812, -1501, 274, 2685, 2809, -1100, 2696, + -402, 67, 650, -1804, -11, -216, 6751, 112, + 455, -7210, -251, -1075, -833, -966, 1443, -138, + 273, -494, 1557, -15, -339, -82, 402, 206, + 31, -77, -94, 78, -5468, -179, -44, 421, + 163, -386, -133, -6334, 427, 747, -121, -292, + 368, -1087, -338, -1534, 3740, -881, -2012, -1284, + 902, 97, -3407, -567, -118, 1340, -77, -445, + 642, 184, 901, -341, -81, 595, -6531, -248, + -167, 8740, 373, 408, 23, 10709, -299, -876, + -584, -1067, 20, -4556, 295, -1956, 990, -132, + -152, 4068, -92, 142, -1512, 23, -815, 454, + 330, -331, 9042, 120, -100, 34, 96, 152, + -11083, 345, -567, -498, 198, -37, 9276, -479, + 611, -2788, 253, -176, 617, -224, 248, 390, + 39, 25, -110, 127, -13, 6675, -84, 115, + 294, 84, -366, -405, -32, -109, -10469, 99, + 17, -88, -226, 316, -133, -203, -60, 311, + -87, -331, 357, -11, 158, 74, 562, 8, + 354, -10843, -114, -206, 699, -617, -141, 807, + 87, -149, 174, 199, -55, 10880, -332, 182, + 544, 651, -27, 261, -190, -655, 24, -443, + -630, 204, 207, -4174, 3557, 89, -386, 1754, + -485, -127, -97, 40, -1336, -488, -177, -750, + 88, -1040, -2215, -507, 169, 2908, 69, -52, + 8458, 601, 174, 1635, 480, 181, 3004, -3021, + 1868, -364, -2100, -256, -3065, -33, -7467, -890, + -1949, -20, -9472, -230, -847, -634, -377, -40, + 1184, 242, 265, 7056, 42, 16, -5070, -71, + 300, -1186, 187, 337, -1331, 77, -473, 3213, + 5738, 626, 2524, 531, 1001, -803, 1231, -1083, + -564, 539, 191, -498, 184, 603, -1777, -479, + 2298, -604, -2077, 634, 4682, -1387, -875, 498, + -10011, -173, 752, 109, -70, 171, -64, -261, + -79, 37, -233, 128, -66, -70, 356, -310, + 214, -14792, 6, 200, -227, 59, -241, 560, + -230, 479, 403, -22, 148, 7428, 110, -177, + 110, 7518, -2372, -1277, 223, -708, 731, 695, + -702, -2906, 256, -1160, 4941, 121, -1148, -68, + -424, -1590, 4697, 705, 525, 684, -451, -246, + -115, 556, 543, -6658, 384, -589, -1505, 12, + 114, 82, -5084, 164, 154, -295, 106, -271, + -40, -394, -437, 397, -279, -3825, -286, 632, + -1041, 1137, -93, 48, 192, -5914, -92, -235, + 682, 5817, -702, 180, -243, -219, -910, -174, + -146, 142, 12, -69, -207, -269, -53, 567, + -336, 114, 9601, -272, -270, 459, 610, -258, + 97, -10950, 397, 57, -7, 229, 1669, -173, + -173, -92, -347, -133, -357, 92, 132, -609, + 60, -124, 116, -54, -15205, 142, 109, 1127, + 268, -220, 336, -743, -238, -29, -902, 91, + -3597, -288, 1114, -3797, -1615, 32, 11481, 55, + 194, 3567, -1857, -2561, -237, -15, -48, -232, + -58, -21, 37, -535, -450, 857, 2001, 12, + 48, 840, 211, 126, 4833, 275, 176, -111, + 9, -112, -403, 182, 296, 181, -425, -14, + 276, 118, -240, 384, 139, 9183, -230, 143, + 2412, -70, 250, 10191, 809, -15, -257, -1242, + -163, -4253, -352, -436, 264, -4998, -17, -215, + 1412, 1592, 856, -159, 4756, -5032, 307, -251, + 194, 6414, -56, -7, -503, -261, -646, -1050, + -271, -578, -291, 614, 130, -336, -923, -120, + 149, -6012, 273, -295, -4586, 137, 206, 1246, + 498, 614, 991, 13776, 122, 52, -660, -76, + -211, -477, -224, 196, 411, 398, -590, 820, + -441, -35, 4394, 5010, -902, 509, 45, 747, + 1035, -455, -579, 105, 1103, -496, -1249, -248, + 46, -5771, -198, -386, 736, 15, -335, -85, + -624, -124, 580, -327, -102, -18, 866, 381, +}; + +static const int16_t shape22[] = { + 2560, -127, -137, -385, -1875, 90, -240, 140, + 1290, 200, -6762, 374, 1871, 8730, -111, -555, + -1524, -2175, -4689, 521, -179, 166, -1573, 1056, + -346, 247, -92, 5713, 561, 233, -360, 480, + -741, -7552, -1508, 259, -8746, 1604, 1385, 723, + 5678, 2243, 403, 12370, 3526, 574, 4982, 563, + 1713, -1337, 1336, -60, -890, -2184, -563, 9347, + 775, 6318, -883, 1476, -335, 736, -564, 635, + -5557, 617, 54, 257, -325, -66, -5689, 1061, + -897, 90, 8394, 2004, 9456, -222, -2026, -969, + 93, -5, -922, -6491, 1496, -1537, 651, -277, + -1038, 6072, -8534, -2526, 1645, 1459, 547, 2347, + -85, -761, -7210, -153, 414, 6096, 383, 320, + 370, -902, 823, 3071, 499, -731, 38, 473, + 1693, -9456, 946, 1218, -1054, 70, 367, -469, + -7861, -913, 401, 198, -83, 877, -308, 8633, + 253, -2025, 1925, 1412, 1351, -360, -948, -7526, + 1089, -7449, 1652, 141, -43, -2082, 44, 130, + -7525, -15049, -1345, 180, -3009, -4581, -267, 2309, + -1397, -112, -63, 307, -746, -13, 35, -8800, + -1947, -1143, -1096, -2582, -1210, 7683, -743, -1589, + 5699, -80, -1375, -93, -483, 129, 6076, -6099, + 374, -176, -1150, -416, 137, -4309, -1926, 3099, + 82, -836, 392, -655, 108, 428, 3361, 313, + 363, 7534, 1153, 334, 2262, -367, -69, -813, + -9702, 3074, -5461, 0, -1889, 1303, -8306, -113, + -677, 692, -2752, 1292, -171, 430, 4609, -2238, + 196, 1661, -25, -164, -2590, -4919, -615, -7, + -753, 5104, 5197, -66, -310, 827, -126, 615, + 70, -456, 238, 682, -639, -561, 369, 183, + 113, 430, -840, -792, -7282, -7537, 619, -445, + 588, 19, -1061, 652, 46, 861, 9641, -1251, + -41, -699, -605, -1389, 240, -10798, 733, 194, + -1230, -1092, -520, -219, 7, 518, -181, -12062, + 651, -40, 1128, -390, -220, -438, 471, 510, + 632, -321, 1393, 8827, -3241, -6683, 350, 1953, + -246, -582, -5486, -7576, -157, 888, 2965, -23, + 762, 6867, 3697, -43, -7905, -938, 2119, 377, + -25, 691, 136, -725, 7643, -730, 2024, -6932, + 804, 53, 392, 440, 336, 6235, -7037, -5584, + -1579, 1115, 1757, 1001, 32, -294, -592, 300, + -764, -8879, -1612, -845, 1722, 6968, 384, 267, + 862, 10830, -364, -1138, -49, 1041, -908, -14960, + 809, 628, -1150, -1348, -437, 805, 877, -64, + 1041, 5253, -270, 2022, 1253, -992, 11015, 2686, + 17, 80, -1463, 4229, 80, -834, -9286, 1179, + 66, -39, -64, -4057, -423, 116, -1441, -1733, + 752, 1674, 1443, 757, -3149, 9057, -3522, 4007, + -893, 1179, -388, 6368, -478, 4397, 13868, -2996, + 790, 704, -2299, -6003, 449, -5410, 1999, 181, + -1807, -362, -57, 454, -2371, 3658, -485, -212, + 11551, 1535, 478, -1570, -278, 584, 608, -5211, + 6965, 1042, -168, -337, -1071, 72, 451, -204, + -1000, -1044, 689, 186, -166, -375, 9426, 363, + 93, -717, 304, 107, 7853, -1251, 1093, 692, + -742, 33, 576, 447, 678, 452, 408, -4813, + 711, -595, -516, -1108, 1941, 3056, -219, -3413, + 10946, 1513, -2375, 48, -408, 49, -399, -5608, + -58, 161, 4808, 436, 68, -5675, 230, 832, + -1228, 6382, -588, -1312, 772, 4337, -405, -5467, + -222, 1382, 2158, 620, -840, 810, -3830, 48, + -101, 529, -2670, -249, 1035, -7620, -1081, -6646, + 1469, 1043, 743, 1553, -556, -274, 68, 238, + 1078, -110, -5163, 562, 735, -8317, 1202, -1325, + -962, 61, 4280, 570, 7450, 265, -1516, 696, + -1567, -681, 0, -4064, 1548, -2521, 657, 567, + -8343, 1691, -1430, 4827, 807, 905, -2601, -7415, + 921, -1741, 363, 309, 211, -521, 3013, -797, + 648, -3709, 961, 662, 403, -386, -719, -5752, + 1355, 6717, 191, 591, -371, -1225, -5125, 800, + -252, -5769, 1101, 657, -141, 2377, -1365, -218, + -114, 148, 276, 358, -354, 18, -31, -9413, + -5514, -1458, -220, 298, 666, 659, 359, 980, + -1389, 101, 1500, 4661, 472, 264, -7590, -1469, + 41, 38, -259, -346, -486, -9949, 812, 422, + -1354, -2461, -2057, -253, 1806, -107, -41, 16384, + -140, -684, 5421, 1907, -10, -889, -1877, -6815, + -818, -5854, -3196, -895, -1706, -186, 7944, 100, + -11260, -4573, -415, 4685, 395, -6035, 5789, -4566, + 624, -2146, 570, 130, -892, 1385, -262, 6638, + -2324, 348, -288, 607, -1574, 7119, -1037, -40, + -4955, -946, -5215, -1013, -1232, -875, -78, -399, + 231, -173, -5860, 189, -755, -8265, 745, 966, + 202, -1858, -26, -658, 55, 1131, -56, 3030, + 158, 3742, -1261, 317, 6397, 521, -508, -522, + -2040, -747, -6906, -868, -110, -719, 2602, 2570, + -1106, -787, -352, 9212, -545, 7339, -10183, -726, + 1104, -1118, -1655, 383, 1370, 1412, 528, -4689, + -398, -3802, -682, -11004, -2310, 8011, 2301, -5941, + -512, 3813, 210, 1379, -15209, 1143, -2344, 2459, + 2368, -6484, -2078, -246, 383, -204, 1449, -453, + -1539, 416, 508, -7168, -1930, 4279, 453, -215, + -296, -346, 5691, -200, -855, 552, 5921, -109, + 588, -3049, 1312, 6767, -78, -7204, 1187, -754, + -1043, -455, 412, -490, 3124, -273, 1468, -546, + 552, -306, 835, -263, -7234, 324, 318, -1224, + 240, 198, 193, -550, -684, -12416, 85, -1469, + -463, -301, 180, 290, -928, -6399, -931, 176, + 310, -692, 7964, -204, 512, 975, -6415, -394, + -30, -120, 1638, -1474, -381, 5912, 156, -830, + -575, -225, -4079, -787, -957, -801, 181, 575, + 1116, -795, -743, -981, 434, -365, -9780, -1814, + 1447, 1081, 153, 884, 8697, 259, 881, -661, + -1232, -547, 464, 898, -3988, -476, 790, 7589, + -525, -809, -2900, -1271, 170, 223, -5050, -2554, + 1458, -666, 537, -6733, 212, 448, -1556, 1459, + 802, -2716, -8785, 11020, -258, 1229, 1138, 843, + 508, 103, -657, 1273, 8140, 368, -605, 6856, + 110, -423, 5458, -417, 993, 257, 5552, -47, + 1401, -119, -1320, 6193, -1196, 56, -93, -1604, + -1491, -897, 238, 823, 4213, 104, 145, -1049, + -9286, -26, -813, -139, 499, -10351, -466, -515, + -1166, -412, -746, 503, 1872, 17, -11941, -3350, + -108, -7296, -411, 4811, -1870, 162, 5595, -658, + 339, -904, 6911, -715, -240, -71, 377, 4747, + -57, -8920, 521, 753, -375, -1185, 1322, -328, + 5, 525, -610, 127, 1519, 791, 784, -16384, + 116, -1007, -352, 486, -7871, 202, -3684, -387, + 676, -8942, -713, -447, -557, 1159, 974, -380, + -1183, 1049, -9, 838, -932, -139, 371, 1688, + -7617, 1192, 2350, -220, -4558, 2681, 1568, 102, + 1274, -446, -351, 1551, 1101, -8995, -5276, -4416, + 3411, 221, -429, 412, 1625, -4575, 254, -631, + 310, -378, 9743, 859, 934, 142, -1400, -6921, + 6466, -4068, 2664, 418, 70, 284, -903, -23, + -502, 4354, -5993, 125, -34, -1246, -1946, -204, + 1002, -7454, -88, -8628, 2449, 13715, 318, -8759, + 294, -2212, 138, -761, 285, -1686, 291, 606, + 180, 761, -359, -1467, 299, -417, -361, -895, + -5692, 127, -951, 165, 1, 396, -819, -5508, + 280, 760, -411, -1025, -649, -1688, -6290, 272, + -17, -7595, 9, 307, 128, -3995, -119, 481, + -3100, -255, 651, 139, -3492, -6, -4471, 452, + -71, 139, 1255, -6128, 1191, 326, 28, -238, + 1374, -334, -457, -836, -10390, 185, -616, 3366, + -39, 183, -21, 6240, 1141, 341, -348, 738, + 121, -65, -386, -27, -548, 337, -4, -126, + 571, 2263, 4936, -1093, -397, 961, -5886, -734, + 1509, -660, -61, 170, -783, -4197, -1459, 906, + -31, 400, -481, 561, 6, 489, -5397, -1666, + 41, -536, -116, 6713, 1288, -157, -116, 4256, + 1895, 6671, 1837, -544, 1276, 2031, 345, 6471, + -84, 1868, -2006, -1304, -7792, 702, -1189, 105, + -4869, -282, -790, 7083, -628, -1273, 252, -179, +}; + +static const int16_t shape22s[] = { + 493, -2, -310, -109, -1218, -193, -267, -11, + -466, -34, -2492, 287, 241, 3621, -537, 458, + 869, -915, -290, 782, 65, -90, -635, 1836, + 80, 519, 868, 1359, 550, -92, -704, 110, + -210, -4337, -376, -200, -2693, 6, 381, 688, + 556, 883, -88, 1698, 1081, 133, 1130, -78, + 853, -424, -39, -909, -1579, -2774, -372, 3604, + -519, 3777, -66, 1330, -1055, 1135, -995, 220, + -3124, 122, 83, 1045, -701, -120, -6800, -269, + 195, 1197, 5500, -490, 5453, -201, 411, 823, + -146, 46, 252, -2724, 606, -924, -1538, 394, + -420, 6405, -5632, -941, -402, -137, 984, -24, + 594, -40, -140, -20, 204, 1211, 290, -680, + 103, -434, -294, 1646, -159, -2296, -237, 507, + -67, -8999, -97, 403, -1473, -111, 22, -257, + -2203, -600, 577, -117, 48, 2216, -170, 1192, + 700, -477, 1678, 979, 2395, -69, -1746, -2139, + -294, -4210, 181, -372, 320, -180, -503, -550, + -3994, -6315, 502, -804, -432, -112, -457, -1016, + 637, 297, 932, 533, 798, 229, -1001, -2780, + -4009, 1176, 189, -1575, 21, 3512, -348, -1450, + 2488, 463, 611, -46, 85, 94, 3319, -3041, + -362, -261, -1534, -1900, 7, -519, -52, 1166, + -174, -152, -189, -415, 641, 27, 1764, 280, + -301, 2976, 146, -632, 4022, -1994, -84, -61, + -1633, 285, -439, 781, -592, 399, -4794, 203, + -295, 32, -1423, 216, -2773, -9, 3589, -3952, + -195, 161, -223, -2240, -1886, -2643, 978, 113, + -1019, 1645, 1493, -851, 1417, -74, 717, 411, + 887, -1384, 73, 117, -65, -7, 133, 18, + 69, 11, -98, 45, -1751, -2710, 11, -140, + 29, 185, 327, 705, 56, 152, 8202, -117, + 157, -478, 36, -564, 996, -9359, -707, 674, + 1169, 270, 156, -679, 15, 720, -38, -4952, + -196, 183, -356, -1004, 185, -148, -61, 151, + -229, -161, 23, 4350, -650, -4384, -21, 909, + 105, -271, -2538, -4018, -1268, 351, 396, -190, + -135, 970, 3159, -935, -6968, -131, -1031, 53, + -430, 242, -219, 384, 2832, -151, 152, -6891, + 1444, -63, -46, 72, 653, 3955, -4187, -321, + -298, 678, -471, 664, -42, -30, 825, 195, + -1147, -2728, -178, -2305, 680, 1980, -147, 320, + -348, 4307, 806, -263, -60, -102, 8, -10085, + 626, -130, 267, -621, 45, -157, 438, 190, + 78, 1608, -246, -386, 256, -255, 5651, -449, + -13, 198, -3193, 329, -500, -1368, -6647, 609, + -507, -96, 222, -1196, 171, -12, -299, -1423, + 442, 47, -5, -282, -18, 4969, -1764, 231, + -471, 5044, 412, 1496, -146, 35, 5083, -228, + 355, -482, -1063, 1265, 80, -1278, 1225, 826, + -1914, 779, 439, -511, -4177, 425, -38, -55, + 9786, 1005, -538, -664, -641, 638, 125, -2811, + 2308, 28, -1157, -229, -624, 45, 354, -368, + -1661, 90, 778, -328, 272, -223, 9558, 822, + -167, -12, -1020, 2962, 2372, -932, 1961, 1398, + 2660, 3, 235, 421, 114, -283, 371, -1652, + 329, -435, -113, -1296, -501, -686, 297, -384, + 10328, 472, 614, 139, -765, -309, 180, -2009, + -171, -175, 3571, 146, 46, -1356, -134, -15, + -166, 2046, 108, 119, -281, 971, -471, -1134, + 34, -104, 219, 746, -223, 245, -181, 12, + -165, 216, -792, 86, 562, -1807, -116, -1324, + 590, -320, -80, 1863, -420, -1066, -698, -2879, + -6, 182, -2325, 575, 97, -2616, 2938, -673, + -693, -116, 1905, -430, 4739, -12, -3307, 693, + -227, 223, -111, -1498, 5, 1751, -36, 234, + -4584, 838, -370, -296, -818, 337, -46, -8921, + 875, -423, 496, -1196, -24, -1014, 969, 294, + 237, -1733, 27, 2543, 1494, 190, 457, -1391, + 1209, 5651, 548, 504, 686, -2889, -151, 725, + 486, -3716, -285, 830, 31, 5132, 770, -24, + -482, -369, -126, -1552, -347, -272, -387, -9485, + -1547, -1189, 369, 812, 311, 536, 391, 361, + -1708, -288, -94, 2053, 557, -611, -4551, -2368, + 173, 472, 160, -1849, 96, -7569, 183, 484, + -393, -346, -309, -13, -7, 2, -239, 10395, + -587, -115, 1282, -634, 81, 90, -725, -2685, + -1214, -4455, -1897, -2903, -827, 124, 2215, 696, + -1225, -1353, -371, 343, 421, -640, 1480, -1174, + 76, -835, -716, -625, -547, 1250, -2696, 2132, + -548, 439, -607, 408, -221, 5026, 352, -344, + -1339, -602, -1650, -404, -458, -502, 61, -164, + 53, -26, -2652, -209, 64, -4068, 713, 193, + -117, -1290, 95, -86, -515, 1336, -492, 1654, + -2963, 3663, -4231, -1, 3017, 371, 276, -7, + -289, -33, -5942, 237, 30, 586, -264, -493, + 435, -388, -165, 10434, 192, 3897, -5414, 361, + 845, -259, 481, 331, 650, -232, 23, -1789, + 27, -4065, 1020, -4261, -651, 3174, 951, -3363, + 577, -112, 642, -1177, -1707, 492, -250, -1236, + 24, -1394, -1807, -853, 1681, -69, 851, -959, + -5759, -202, 30, -3466, -593, 5414, 65, 141, + -319, 674, 1183, -155, -312, 372, 2829, -75, + -60, -2618, -240, 2944, -631, -4221, -16, 467, + 211, -58, 55, -527, -51, -160, 642, -305, + 388, 413, 210, -81, -3383, -120, 144, -220, + -672, 1352, -630, -2324, -423, -8053, -131, -912, + -260, -380, 470, 154, -1346, -2417, -426, -403, + -137, -160, 2823, 609, -216, -173, -585, -514, + 95, -202, 222, 16, 136, 1751, 237, -1089, + 957, -144, -518, 416, -347, -60, 207, 277, + 512, -1133, 166, 1423, -883, -194, -7016, -1938, + 417, 2302, -992, -179, 738, -74, 411, -462, + -413, 67, 234, -322, -164, -47, -89, 1409, + 390, -1180, -2888, 655, 1958, 0, -1826, -471, + -1247, 307, 104, -8502, -198, -222, 191, 281, + -868, 47, -4553, 2434, 174, 263, 2844, -72, + -597, -1183, -374, -93, 3348, 13, 173, 6285, + -32, -213, 1882, 411, -608, -562, 2998, 293, + 54, -147, -120, 822, -93, 679, 206, -3229, + -767, -1603, -259, -310, 4306, 548, -9, -99, + -5722, -328, -176, 453, 338, -9687, -63, 844, + 322, 615, -1075, -370, 159, -33, -6213, -1375, + 741, -801, -1319, 1513, 1331, -69, 2702, -458, + -203, 103, 4696, -284, 465, -62, -40, 3184, + 238, -6131, 546, 1713, -365, -24, 116, -33, + 304, 807, -231, 291, 903, 749, -254, -12215, + 115, -35, -95, -166, -3776, -170, -4517, -151, + 67, -7725, 666, -573, -744, -719, 37, 31, + 373, 148, -125, 15, -150, -905, -42, 272, + -5223, 650, 5233, 109, -1235, 991, 211, 1522, + -555, -328, -52, 5335, -22, -5476, -3102, -637, + 986, 468, -37, -164, -264, -1290, 754, -940, + -685, -862, 7270, -279, -441, 472, -153, -2515, + 3899, -95, 360, 762, 14, 434, 619, 185, + -230, 1233, -1330, 1360, -756, 361, -1391, -247, + 120, -3573, 293, 375, 806, 5526, 536, 137, + 486, -484, 13, -37, 12, -4, 81, 43, + 10, 43, -38, -371, -64, -1167, -117, -371, + -1958, -166, 543, -97, -83, 391, -59, -1631, + 302, 1077, -128, -641, -64, 21, -2562, -235, + 342, -7121, -646, -49, -961, -141, -210, -555, + -1596, -988, 723, -209, -3585, 10, -35, 1051, + 0, 138, 941, -5002, 805, 3009, 35, -70, + 513, -21, -432, -224, -10628, -167, -1045, 2603, + 336, 360, 515, 683, 981, 3028, 492, -543, + -1844, 23, -30, 52, -40, 447, 11, 363, + -95, 1609, 2613, -13, -400, 719, -4513, -676, + -290, 456, -332, -11, -261, -455, 89, -301, + 285, 287, 202, 281, 87, -202, -1482, -535, + 874, -478, -201, 4715, 824, -204, 145, 2882, + 404, 3376, 363, -18, -127, 764, 106, 1626, + 178, 185, 22, -637, -6216, 1399, -961, -88, + -553, -91, 98, 1831, 9, -583, 1253, -1741, +}; + +static const int16_t shape44s[] = { + -20, -140, 683, -586, -1742, 177, -538, 1900, + 2193, -17, -2096, 261, 645, 339, 77, 1136, + -521, 537, -924, -156, -261, 195, 1049, -39, + 236, -137, 0, 3199, 225, 46, 86, -215, + 557, -5394, 17, 911, -1690, -48, -48, -175, + -11, -631, -153, 4474, -347, -39, 1759, 154, + 170, -180, -273, 603, -590, -5195, -74, 1789, + 240, -212, 431, 2447, 368, -76, -313, 11, + -2926, 19, -71, 208, -51, -728, -6412, -61, + 141, -112, 5280, -76, 4435, -402, -25, 46, + 210, -104, 172, -3830, -366, -23, 239, -112, + 137, 6692, -6288, -720, -132, -136, 552, -1688, + -345, -289, -485, 149, 174, 180, 361, -236, + 92, 407, 6, 2373, 380, -167, 845, 444, + -834, -9358, 413, -1302, 460, 77, 34, 56, + -1516, -143, 207, -43, -31, -106, -52, 403, + -309, 298, -88, 1552, -240, -776, 624, -4181, + -342, -4804, 57, -23, 160, -44, 469, -17, + -3997, -5079, -263, 72, 181, 1085, 538, -611, + -368, 59, -204, -195, -40, -201, -803, -5093, + -3216, 480, 46, -729, 244, 3320, 185, 503, + 2979, -416, 110, 25, 140, -502, 2236, -4420, + -36, -238, -278, 60, -82, -597, 218, 69, + -95, -2102, -2138, -2308, -3796, 20, -211, -229, + 297, 3665, 81, 148, 1315, -4537, -38, 186, + -3106, -526, 90, -35, -193, -302, -5860, 276, + -308, 206, 645, 1, -242, 580, 3025, -2583, + -90, 511, -315, -137, -2033, -4313, 693, 485, + -211, 1486, 1180, 181, -136, 204, 23, 383, + 1479, -213, 42, 32, -64, -136, -91, -146, + 434, 231, 36, -58, -3254, -2647, -18, 345, + 171, -60, 84, 209, 246, -587, 9447, -67, + -187, -108, -226, -458, -519, -11089, -422, -502, + 132, 79, 298, -475, -412, 196, -164, -7347, + 185, -131, 369, 18, -500, 644, -334, 93, + -77, 71, 341, 3566, -281, -4191, -145, 87, + 37, 306, -3482, -5739, 161, -245, 293, 208, + 380, 2888, 31, -23, -2061, -597, -56, 350, + -105, 1167, 64, 342, 3638, -79, -106, 148, + 5422, -719, -232, 8, -395, 3249, -5093, -222, + -707, 241, 318, 735, 376, 78, -166, -1614, + -9, -3373, 330, -1540, 2028, 3400, -9, 317, + 9, 4903, 262, 62, 222, -95, -208, -13376, + -101, 121, 298, 5, 172, 406, -164, 79, + 172, 1993, 235, 229, 1193, -274, 5944, -918, + -15, 1304, 307, 1150, -385, -794, -3467, 660, + 2143, 147, -279, -751, -305, 1052, 205, -108, + 572, -212, 29, -50, 6, 3749, 238, -2016, + -1118, -1329, -971, 2633, 519, 194, 3545, -11, + 77, -92, 1215, -439, 152, -863, 1604, 180, + -514, 252, 308, -131, -938, 133, 378, 11, + 12153, 51, 486, 71, -476, -599, 57, -127, + 2685, -173, -182, 468, -3469, -594, -380, 265, + -879, -352, -278, -309, 575, 124, 10814, -765, + -64, 710, -105, 296, 2562, 98, -358, 556, + 2921, -133, -5, -406, 42, 496, -1053, -1957, + 701, 266, 260, -441, 43, -192, -1, -2174, + 9894, -90, -181, 29, 50, -858, 59, -190, + 49, -282, 1632, 1525, 100, -3659, 13, 173, + -240, 5304, -383, 263, -311, 1747, 169, -2203, + -29, -106, 342, -301, 66, 49, 23, 857, + -607, 698, -1198, -191, -450, -1875, -329, -2156, + 156, 95, 145, 129, -321, 88, 1049, 3980, + -14, 321, -1484, 895, -30, -2174, 289, 933, + -933, 15, 2631, 68, 3054, 221, -87, 175, + 200, 937, -87, -2032, 348, 146, -372, 60, + -2566, 3497, -98, 313, 536, -299, -58, -8949, + 323, -524, -331, 713, -47, 360, 155, 168, + 687, -1391, 1973, 670, 788, -202, -129, -5113, + 54, 1178, 1218, 172, 630, -154, -1047, 840, + 71, -337, 91, 214, -474, 624, -773, 16, + -126, 340, -631, -482, -155, 419, 50, -10976, + -742, -781, 169, 149, 33, -169, 44, 354, + 26, 129, -179, 1401, 776, -155, -3996, -813, + 594, 238, -61, 168, -383, -9261, 294, 470, + -322, -190, -956, -290, 27, -438, -254, 12571, + 344, -393, -568, 56, 81, 171, -115, -4370, + 49, -322, -237, -692, -55, -49, 4317, -6, + -4837, -156, 179, 247, -338, -48, 952, -1061, + -33, -934, 250, -256, -1622, 1039, -738, 2719, + -20, -190, 249, -119, -235, 6080, 123, -502, + -1443, 86, -1684, -177, -128, -58, -237, -641, + -177, 64, -2416, 15, -116, -6465, -412, 161, + 419, 768, 36, 113, -944, -241, -1424, -95, + 635, 1798, -2257, -18, 3046, 173, -33, -207, + -52, -831, -5730, -54, -199, 194, -255, 467, + -211, -853, -512, 11619, 148, 3681, -4603, -282, + 129, -205, -606, 167, 306, 464, 485, -959, + -203, 254, 151, -6880, -262, 5180, 658, -1378, + 1174, -53, -59, -33, -3077, -127, -223, -17, + -31, -2190, 23, 317, -169, 203, -223, -222, + -5295, 116, 80, -2757, -666, 3377, -476, 85, + -630, -147, 1740, -175, -115, 207, 240, -248, + -95, -1016, 3966, 3998, -343, -4751, 187, -113, + -250, 111, -510, -203, 130, 89, 311, 608, + -221, -381, -253, -359, -2254, 45, 224, -141, + 45, -19, 480, -5074, 797, -4580, -163, 110, + -234, 337, 6, 707, 492, -5493, -2750, -94, + -363, 113, 2345, 344, 379, 464, -3222, -56, + -269, -262, -10, -609, 324, 3043, 209, 3092, + -600, 42, -615, -17, -53, 30, 1123, 224, + 593, 632, -90, 428, 1117, -1429, -6741, -95, + -293, -103, -2784, 251, 1688, 621, -349, 1059, + -1093, -148, 447, 149, 88, 92, 687, 1249, + 80, 289, -1841, 221, -10, -92, -1736, 118, + 136, 138, -162, -4162, -111, 62, 95, 166, + -172, -695, -3685, 5694, -527, 2032, -549, 43, + -101, 221, 181, -479, 7697, 2007, -127, 805, + -83, -535, 1354, -383, 253, -622, 2910, 1249, + 782, 13, 42, 994, -545, 75, -485, 330, + -16, 343, 272, -781, 360, -97, -25, -875, + -12689, -623, -307, 195, -256, -11644, 229, 180, + -42, -361, -124, -81, -23, -460, -1993, 212, + -634, -847, 1616, -546, -583, 99, 3800, 10, + 177, 366, 6106, -173, 265, -213, 10, 1108, + -288, -1690, -237, -312, 38, -2272, 431, -26, + -178, -764, 507, 355, 677, -214, -816, -12411, + 47, 12, 294, -295, -3916, -677, -4885, -250, + -453, -7716, 478, 231, 17, -248, 147, 1064, + 637, -80, -41, 265, -383, 142, 116, 2991, + -3060, 809, 2056, -119, -866, -22, -660, 233, + 306, -1873, -1141, 6995, 186, -8678, -109, -39, + -105, 730, 18, -846, 273, -2922, 210, 26, + -174, -142, 990, 131, -436, 1422, -217, -3152, + 3224, 35, 315, -47, 48, -221, 568, 44, + 182, 1696, -1755, -193, 527, 158, -555, -3485, + 171, -4552, -47, -4680, 95, -112, 184, 80, + -36, -915, 87, 24, -259, -1743, 68, -117, + 405, 11, 40, -320, -17, -158, -134, -186, + -1206, -466, 1262, 133, -254, -100, 210, -1735, + -636, 319, -978, 69, 197, -521, -5503, -78, + -544, -1011, 101, -489, -371, -79, -196, -18, + -839, 1091, 682, -1441, -2375, -1127, 54, 829, + -306, -255, 641, -3665, 473, 3504, -1035, -160, + -467, -275, -437, 79, -13513, 326, 132, 82, + 188, 362, -74, 1406, -46, 2864, 351, -558, + -1277, 108, -92, -53, 72, -41, -31, -97, + 353, 73, 1864, -207, 106, -81, -3930, 173, + 41, -539, -497, 135, -526, -823, 69, -10, + 176, 648, -1710, 564, 80, 237, -1956, 234, + 11, 142, -849, 4116, -473, 110, 129, 2137, + -170, 3193, 10, 245, -953, -827, -30, 1235, + 366, -67, 54, -567, -7377, 2461, 582, 74, + -1988, -33, -296, 3090, -54, 145, 564, -295, +}; + +static const uint16_t bark_tab_l8_512[] = { + 4, 5, 4, 5, 4, 5, 5, 5, 5, 6, 6, 6, 6, 8, 7, 9, + 9, 11, 11, 14, 15, 17, 20, 24, 28, 34, 41, 51, 64, 83, +}; + +static const uint16_t bark_tab_m8_256[] = { + 3, 4, 3, 4, 3, 4, 4, 5, 5, 6, 6, 8, 9, 11, 13, 17, 23, 29, 41, 58 +}; + +static const uint16_t bark_tab_s8_64[] = { + 2, 1, 2, 2, 3, 4, 5, 7, 13, 25 +}; + +static const uint16_t bark_tab_l8s_512[] = { + 7, 8, 7, 8, 8, 8, 8, 8, + 8, 9, 9, 10, 10, 11, 11, 12, + 12, 14, 15, 16, 18, 19, 21, 24, + 27, 30, 35, 40, 46, 53, +}; + +static const uint16_t bark_tab_s8s_64[] = { + 3, 3, 3, 3, 4, 5, 6, 8, + 12, 17, +}; + +static const uint16_t bark_tab_m8s_256[] = { + 6, 5, 6, 6, 6, 6, 7, 7, + 8, 8, 9, 10, 11, 13, 15, 18, + 20, 25, 31, 39, +}; + +static const uint16_t bark_tab_l11_512[] = { + 4, 4, 5, 4, 5, 4, 5, 6, + 6, 6, 7, 8, 9, 10, 12, 14, + 17, 21, 27, 33, 44, 58, 82, 121, +}; + +static const uint16_t bark_tab_s11_64[] = { + 2, 1, 2, 3, 4, 6, 13, 33, +}; + +static const uint16_t bark_tab_m11_256[] = { + 3, 3, 4, 3, 4, 4, 5, 6, + 7, 9, 11, 15, 21, 30, 48, 83, +}; + +static const uint16_t bark_tab_l11s_512[] = { + 6, 6, 6, 6, 6, 6, 7, 6, + 7, 7, 8, 8, 8, 9, 10, 10, + 11, 13, 13, 15, 17, 18, 21, 25, + 27, 33, 38, 45, 54, 66, +}; + +static const uint16_t bark_tab_s11s_64[] = { + 2, 3, 2, 3, 3, 4, 6, 8, + 12, 21, +}; + +static const uint16_t bark_tab_m11s_256[] = { + 4, 5, 4, 5, 5, 5, 6, 5, + 7, 7, 8, 9, 10, 12, 15, 17, + 22, 28, 35, 47, +}; + +static const uint16_t bark_tab_l16_1024[] = { + 5, 5, 5, 5, 5, 5, 5, 6, 6, 7, 7, 7, 8, 9, 10, 11, + 12, 14, 17, 19, 22, 27, 33, 40, 51, 64, 84, 114, 164, 257 +}; + +static const uint16_t bark_tab_m16_512[] = { + 3, 3, 3, 3, 4, 3, 4, 4, 4, 5, 5, 6, 7, 8, 10, 12, + 14, 18, 24, 30, 42, 59, 89, 152 +}; + +static const uint16_t bark_tab_s16_128[] = { + 2, 2, 2, 3, 3, 5, 7, 12, 25, 67 +}; + +static const uint16_t bark_tab_l16s_1024[] = { + 9, 9, 8, 9, 10, 9, 10, 10, + 10, 12, 11, 13, 13, 14, 16, 17, + 19, 20, 24, 26, 30, 35, 40, 48, + 56, 68, 83, 102, 128, 165, +}; + +static const uint16_t bark_tab_s16s_128[] = { + 3, 4, 4, 4, 5, 7, 10, 16, + 26, 49, +}; + +static const uint16_t bark_tab_m16s_512[] = { + 7, 6, 7, 7, 7, 8, 9, 9, + 10, 11, 14, 15, 18, 22, 27, 34, + 44, 59, 81, 117, +}; + +static const uint16_t bark_tab_l22_1024[] = { + 3, 4, 3, 4, 3, 4, 4, 4, + 4, 4, 5, 5, 5, 6, 7, 7, + 8, 9, 11, 12, 14, 16, 20, 24, + 29, 36, 45, 60, 80, 113, 173, 302, +}; + +static const uint16_t bark_tab_l22s_1024[] = { + 6, 7, 6, 6, 7, 7, 7, 7, + 7, 8, 9, 8, 10, 10, 11, 12, + 13, 15, 16, 18, 21, 24, 27, 33, + 38, 46, 55, 68, 84, 107, 140, 191, +}; + +static const uint16_t bark_tab_s22s_128[] = { + 3, 2, 3, 4, 4, 6, 9, 14, + 26, 57, +}; + +static const uint16_t bark_tab_m22s_512[] = { + 5, 5, 5, 6, 5, 7, 6, 7, + 9, 9, 11, 13, 15, 20, 24, 33, + 43, 61, 88, 140, +}; + +static const uint16_t bark_tab_l44_2048[] = { + 5, 6, 5, 6, 5, 6, 6, 6, 6, 6, 7, 7, 7, 8, 8, 9, + 9, 10, 11, 11, 13, 14, 16, 17, 19, 22, 25, 29, 33, 39, 46, 54, + 64, 79, 98, 123, 161, 220, 320, 512, +}; + +#define bark_tab_m22_512 bark_tab_m44_512 /* Both tables are identical */ +static const uint16_t bark_tab_m44_512[] = { + 3, 2, 3, 3, 3, 4, 3, 5, 4, 6, 7, 8, 10, 14, 18, 25, + 36, 55, 95, 208, +}; + +#define bark_tab_s22_128 bark_tab_s44_128 /* Both tables are identical */ +static const uint16_t bark_tab_s44_128[] = { + 1, 2, 1, 2, 3, 4, 6, 10, 23, 76 +}; + +static const TwinVQModeTab metasound_mode0806 = { + { + { 8, bark_tab_s8_64, 10, fcb8s, 1, 5, cb0806ss0, cb0806ss1, 27 }, + { 2, bark_tab_m8_256, 20, fcb8m, 2, 5, cb0806sm0, cb0806sm1, 22 }, + { 1, bark_tab_l8_512, 30, fcb8l, 3, 6, cb0806sl0, cb0806sl1, 24 } + }, + 512, 12, ff_metasound_lsp8, 1, 5, 3, 3, shape8, 8, 28, 20, 6, 200 +}; + +static const TwinVQModeTab metasound_mode0806s = { + { + { 8, bark_tab_s8s_64, 10, fcb8ss, 1, 5, cb0806ss0, cb0806ss1, 27 }, + { 2, bark_tab_m8s_256, 20, fcb8sm, 2, 5, cb0806sm0, cb0806sm1, 22 }, + { 1, bark_tab_l8s_512, 30, fcb8sl, 3, 6, cb0806sl0, cb0806sl1, 24 } + }, + 512, 12, ff_metasound_lsp8, 1, 5, 3, 3, shape8s, 8, 28, 20, 6, 200 +}; + +static const TwinVQModeTab metasound_mode0808 = { + { + { 8, bark_tab_s8_64, 10, fcb8s, 1, 5, cb0808s0, cb0808s1, 18 }, + { 2, bark_tab_m8_256, 20, fcb8m, 2, 5, cb0808m0, cb0808m1, 16 }, + { 1, bark_tab_l8_512, 30, fcb8l, 3, 6, cb0808l0, cb0808l1, 17 } + }, + 512, 12, ff_metasound_lsp8, 1, 5, 3, 3, shape8, 8, 28, 20, 6, 200 +}; + +static const TwinVQModeTab metasound_mode0808s = { + { + { 8, bark_tab_s8s_64, 10, fcb8ss, 1, 5, cb0808ss0, cb0808ss1, 18 }, + { 2, bark_tab_m8s_256, 20, fcb8sm, 2, 5, cb0808sm0, cb0808sm1, 16 }, + { 1, bark_tab_l8s_512, 30, fcb8sl, 3, 6, cb0808sl0, cb0808sl1, 17 } + }, + 512, 12, ff_metasound_lsp8, 1, 5, 3, 3, shape8s, 8, 28, 20, 6, 200 +}; + +static const TwinVQModeTab metasound_mode1110 = { + { + { 8, bark_tab_s11_64, 8, fcb11s, 1, 5, cb1110s0, cb1110s1, 21 }, + { 2, bark_tab_m11_256, 16, fcb11m, 2, 5, cb1110m0, cb1110m1, 18 }, + { 1, bark_tab_l11_512, 24, fcb11l, 3, 6, cb1110l0, cb1110l1, 19 } + }, + 512, 16, ff_metasound_lsp11, 1, 6, 4, 3, shape11, 9, 28, 20, 7, 200 +}; + +static const TwinVQModeTab metasound_mode1110s = { + { + { 8, bark_tab_s11s_64, 10, fcb11ss, 1, 5, cb1110ss0, cb1110ss1, 21 }, + { 2, bark_tab_m11s_256, 20, fcb11sm, 2, 5, cb1110sm0, cb1110sm1, 18 }, + { 1, bark_tab_l11s_512, 30, fcb11sl, 3, 6, cb1110sl0, cb1110sl1, 20 } + }, + 512, 16, ff_metasound_lsp11, 1, 6, 4, 3, shape11s, 9, 36, 30, 7, 200 +}; + +static const TwinVQModeTab metasound_mode1616 = { + { + { 8, bark_tab_s16_128, 10, fcb16s, 1, 5, cb1616s0, cb1616s1, 16 }, + { 2, bark_tab_m16_512, 24, fcb16m, 2, 5, cb1616m0, cb1616m1, 15 }, + { 1, bark_tab_l16_1024, 30, fcb16l, 3, 6, cb1616l0, cb1616l1, 16 } + }, + 1024, 16, ff_metasound_lsp16, 1, 6, 4, 3, shape16, 9, 28, 30, 7, 200 +}; + +static const TwinVQModeTab metasound_mode1616s = { + { + { 8, bark_tab_s16s_128, 10, fcb16ss, 1, 5, cb1616ss0, cb1616ss1, 16 }, + { 2, bark_tab_m16s_512, 20, fcb16sm, 2, 5, cb1616sm0, cb1616sm1, 15 }, + { 1, bark_tab_l16s_1024, 30, fcb16sl, 3, 6, cb1616sl0, cb1616sl1, 16 } + }, + 1024, 16, ff_metasound_lsp16, 1, 6, 4, 3, shape16s, 9, 56, 60, 7, 200 +}; + +static const TwinVQModeTab metasound_mode2224 = { + { + { 8, bark_tab_s22_128, 10, fcb22s, 1, 6, cb2224s0, cb2224s1, 15 }, + { 2, bark_tab_m22_512, 20, fcb22m, 2, 6, cb2224m0, cb2224m1, 14 }, + { 1, bark_tab_l22_1024, 32, fcb22l, 4, 6, cb2224l0, cb2224l1, 15 } + }, + 1024, 16, ff_metasound_lsp22, 1, 6, 4, 3, shape22, 9, 56, 36, 7, 200 +}; + +static const TwinVQModeTab metasound_mode2224s = { + { + { 8, bark_tab_s22s_128, 10, fcb22ss, 1, 6, cb2224ss0, cb2224ss1, 15 }, + { 2, bark_tab_m22s_512, 20, fcb22sm, 2, 6, cb2224sm0, cb2224sm1, 14 }, + { 1, bark_tab_l22s_1024, 32, fcb22sl, 4, 6, cb2224sl0, cb2224sl1, 15 } + }, + 1024, 16, ff_metasound_lsp22, 1, 6, 4, 3, shape22s, 9, 56, 36, 7, 200 +}; + +static const TwinVQModeTab metasound_mode4432 = { + { + { 16, bark_tab_s44_128, 10, fcb44ss, 1, 6, cb4432s0, cb4432s1, 23 }, + { 4, bark_tab_m44_512, 20, fcb44sm, 2, 6, cb4432m0, cb4432m1, 21 }, + { 1, bark_tab_l44_2048, 40, fcb44sl, 4, 6, cb4432l0, cb4432l1, 22 } + }, + 2048, 20, ff_metasound_lsp44, 1, 6, 4, 4, shape44s, 9, 84, 54, 7, 200, +}; + +static const TwinVQModeTab metasound_mode4440 = { + { + { 16, bark_tab_s44_128, 10, fcb44ss, 1, 6, cb4440ss0, cb4440ss1, 18 }, + { 4, bark_tab_m44_512, 20, fcb44sm, 2, 6, cb4440sm0, cb4440sm1, 17 }, + { 1, bark_tab_l44_2048, 40, fcb44sl, 4, 6, cb4440sl0, cb4440sl1, 17 } + }, + 2048, 20, ff_metasound_lsp44, 1, 6, 4, 4, shape44s, 9, 84, 54, 7, 200 +}; + +static const TwinVQModeTab metasound_mode4448 = { + { + { 16, bark_tab_s44_128, 10, fcb44ss, 1, 6, cb4448ss0, cb4448ss1, 15 }, + { 4, bark_tab_m44_512, 20, fcb44sm, 2, 6, cb4448sm0, cb4448sm1, 14 }, + { 1, bark_tab_l44_2048, 40, fcb44sl, 4, 6, cb4448sl0, cb4448sl1, 14 } + }, + 2048, 20, ff_metasound_lsp44, 1, 6, 4, 4, shape44s, 9, 84, 54, 7, 200 +}; + +#endif /* AVCODEC_METASOUND_DATA_H */ diff --git a/include/libavcodec/metasound_twinvq_data.h b/include/libavcodec/metasound_twinvq_data.h new file mode 100644 index 0000000..8617e08 --- /dev/null +++ b/include/libavcodec/metasound_twinvq_data.h @@ -0,0 +1,814 @@ +/* + * MetaSound decoder + * Copyright (c) 2013 Konstantin Shishkov + * + * 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_METASOUND_TWINVQ_DATA_H +#define AVCODEC_METASOUND_TWINVQ_DATA_H + +#include "twinvq.h" + +const float ff_metasound_lsp8[] = { + 0.2702, 0.5096, 0.6437, 0.7672, 0.9639, 1.0696, 1.2625, 1.5789, + 1.9285, 2.2383, 2.5129, 2.8470, 0.1740, 0.3677, 0.6082, 0.8387, + 1.1084, 1.3721, 1.6362, 1.8733, 2.0640, 2.3442, 2.6087, 2.8548, + 0.1536, 0.3279, 0.5143, 0.6859, 0.9763, 1.2744, 1.5605, 1.8566, + 2.1007, 2.3450, 2.6075, 2.8850, 0.2075, 0.4533, 0.7709, 1.0377, + 1.2953, 1.5132, 1.7826, 2.0351, 2.2590, 2.4996, 2.6795, 2.8748, + 0.1393, 0.2453, 0.3754, 0.5453, 0.8148, 1.1289, 1.4389, 1.7592, + 2.0353, 2.3215, 2.5934, 2.8588, 0.1250, 0.3627, 0.7613, 1.1380, + 1.4163, 1.5565, 1.6920, 1.8130, 1.8678, 2.0427, 2.4318, 2.8544, + 0.2256, 0.4223, 0.6452, 0.8599, 1.0673, 1.3118, 1.5486, 1.8366, + 2.0759, 2.3026, 2.5284, 2.8030, 0.2304, 0.4404, 0.6891, 0.8964, + 1.1510, 1.4202, 1.6483, 1.8580, 2.1181, 2.3686, 2.6078, 2.9128, + 0.2230, 0.3816, 0.5520, 0.6062, 0.7909, 1.0988, 1.4330, 1.7846, + 2.0713, 2.3457, 2.6048, 2.8708, 0.2447, 0.5800, 0.8249, 0.9905, + 1.1721, 1.3990, 1.6694, 1.9064, 2.1307, 2.4255, 2.6815, 2.9117, + 0.1974, 0.3812, 0.5802, 0.7759, 0.9280, 1.1547, 1.4170, 1.6369, + 1.8890, 2.2587, 2.5626, 2.8239, 0.1209, 0.2510, 0.4841, 0.8048, + 1.1197, 1.3563, 1.6073, 1.8926, 2.1350, 2.3669, 2.6291, 2.8985, + 0.2352, 0.4347, 0.6582, 0.8178, 0.9548, 1.1654, 1.4942, 1.8812, + 2.1703, 2.3779, 2.6412, 2.8871, 0.2091, 0.4084, 0.6730, 0.9151, + 1.1259, 1.3262, 1.5937, 1.8129, 2.0237, 2.3317, 2.5778, 2.8620, + 0.1167, 0.2406, 0.4520, 0.7298, 0.9848, 1.2448, 1.5137, 1.7874, + 2.0280, 2.3020, 2.5914, 2.8794, 0.3003, 0.4966, 0.6520, 0.8505, + 1.1600, 1.3981, 1.5805, 1.8346, 2.0757, 2.3102, 2.5760, 2.8499, + 0.2451, 0.4163, 0.5960, 0.7805, 0.9507, 1.2438, 1.5587, 1.8581, + 2.0735, 2.3198, 2.5704, 2.8220, 0.3112, 0.5517, 0.7032, 0.8528, + 1.1489, 1.4257, 1.6848, 1.9388, 2.1577, 2.4265, 2.6678, 2.9051, + 0.2249, 0.3897, 0.5559, 0.7473, 1.0158, 1.3581, 1.6914, 1.9930, + 2.1843, 2.3534, 2.5512, 2.8065, 0.2600, 0.4574, 0.7349, 0.9691, + 1.1696, 1.3848, 1.6335, 1.9021, 2.1174, 2.3481, 2.5902, 2.8390, + 0.2246, 0.3372, 0.4560, 0.5249, 0.7056, 1.0273, 1.3810, 1.7132, + 1.9819, 2.2574, 2.5410, 2.8491, 0.1419, 0.4834, 0.8835, 1.1453, + 1.2839, 1.4224, 1.5593, 1.7877, 2.1285, 2.4070, 2.6043, 2.8511, + 0.1886, 0.3677, 0.5617, 0.8099, 1.1277, 1.3841, 1.5804, 1.8136, + 2.0307, 2.2805, 2.5399, 2.8322, 0.2351, 0.4151, 0.6675, 0.8713, + 1.0464, 1.3292, 1.6586, 1.9281, 2.1355, 2.3495, 2.6222, 2.8782, + 0.2700, 0.4489, 0.6206, 0.7121, 0.7737, 0.9848, 1.3658, 1.7433, + 2.0139, 2.2243, 2.4806, 2.8175, 0.2479, 0.4425, 0.6490, 0.8745, + 1.1161, 1.3849, 1.6773, 1.9566, 2.1491, 2.3624, 2.5685, 2.8114, + 0.2035, 0.3701, 0.5567, 0.7953, 1.0082, 1.2758, 1.5373, 1.7822, + 2.0175, 2.2601, 2.4759, 2.7771, 0.1856, 0.3461, 0.5998, 0.9041, + 1.2383, 1.4612, 1.6667, 1.9305, 2.1617, 2.4107, 2.6477, 2.8656, + 0.2107, 0.3715, 0.5289, 0.6651, 0.8420, 1.1168, 1.4401, 1.7230, + 1.9901, 2.2687, 2.5452, 2.8655, 0.1218, 0.2999, 0.6348, 0.9482, + 1.2745, 1.5876, 1.9129, 2.2348, 2.4020, 2.4922, 2.6351, 2.8357, + 0.1617, 0.3483, 0.5869, 0.8163, 1.0366, 1.2344, 1.4609, 1.7029, + 1.9476, 2.2337, 2.5258, 2.8442, 0.2505, 0.4894, 0.7510, 0.9152, + 1.0845, 1.3657, 1.6528, 1.8346, 2.0160, 2.2811, 2.5338, 2.8136, + 0.0947, 0.1158, 0.0578, -0.0337, -0.0066, 0.0104, -0.0447, -0.0505, + -0.0778, -0.0293, 0.0251, -0.0143, 0.0349, -0.0227, -0.0909, 0.0523, + 0.0325, -0.0410, -0.1045, -0.0899, -0.0009, 0.0075, -0.0575, -0.0855, + -0.0129, 0.0575, 0.0597, 0.0391, 0.0371, -0.0184, -0.0083, 0.0287, + 0.0143, 0.0167, 0.0120, -0.0168, 0.0452, 0.0223, -0.0352, 0.0119, + -0.0496, -0.0965, -0.0661, -0.0072, 0.1099, 0.0843, -0.0087, -0.0478, + -0.0128, -0.0120, -0.0004, 0.0731, 0.1047, 0.0630, 0.0196, -0.0103, + -0.0399, -0.0986, -0.0912, -0.0390, -0.0247, -0.0694, -0.0749, -0.0066, + 0.0223, 0.0634, 0.0343, -0.0134, 0.0727, 0.0241, 0.0066, 0.0437, + 0.0610, 0.0364, 0.0248, -0.0358, -0.0686, -0.0104, 0.0426, 0.0088, + -0.0137, -0.0165, 0.0671, 0.0815, -0.0863, -0.0644, -0.0088, 0.0023, + 0.0482, 0.1174, 0.1270, 0.0594, 0.0165, 0.0949, 0.1098, 0.0137, + 0.4951, 0.4999, 0.4958, 0.4907, 0.4984, 0.4965, 0.4958, 0.4996, + 0.4987, 0.4958, 0.4986, 0.4977, 0.2841, 0.2186, 0.1474, 0.1687, + 0.2217, 0.2632, 0.2706, 0.2624, 0.2162, 0.2453, 0.2460, 0.2531, +}; + +const float ff_metasound_lsp11[] = { + 0.1103, 0.3862, 0.6863, 0.8447, 0.9231, 1.0261, 1.1248, 1.4057, + 1.6621, 1.8010, 1.8692, 2.0704, 2.3490, 2.6060, 2.7539, 2.8977, + 0.1273, 0.2407, 0.3812, 0.6004, 0.7767, 0.9383, 1.1344, 1.3351, + 1.5233, 1.7262, 1.9466, 2.1739, 2.3495, 2.5162, 2.7164, 2.9202, + 0.2010, 0.3330, 0.4488, 0.6465, 0.8046, 0.9889, 1.1479, 1.2964, + 1.4770, 1.6606, 1.8789, 2.1155, 2.3287, 2.5199, 2.7101, 2.9119, + 0.1168, 0.2197, 0.3279, 0.4691, 0.6268, 0.8251, 1.0533, 1.2714, + 1.4712, 1.6762, 1.8831, 2.1114, 2.3230, 2.5297, 2.7365, 2.9270, + 0.1405, 0.3109, 0.4986, 0.6891, 0.8634, 1.0583, 1.2594, 1.4349, + 1.6232, 1.8116, 1.9905, 2.1935, 2.3799, 2.5656, 2.7661, 2.9486, + 0.1703, 0.3057, 0.4403, 0.5225, 0.5969, 0.8110, 1.0729, 1.3215, + 1.5407, 1.7381, 1.9477, 2.1680, 2.3586, 2.5612, 2.7630, 2.9410, + 0.1128, 0.2628, 0.4523, 0.6495, 0.8176, 0.9816, 1.1746, 1.3710, + 1.5568, 1.7518, 1.9497, 2.1452, 2.3346, 2.5389, 2.7362, 2.9264, + 0.1809, 0.3287, 0.5205, 0.7264, 0.9298, 1.1217, 1.2970, 1.4894, + 1.6874, 1.8493, 2.0576, 2.2382, 2.4097, 2.6041, 2.7796, 2.9389, + 0.2502, 0.4709, 0.6892, 0.8346, 0.9209, 1.0455, 1.2399, 1.4616, + 1.6463, 1.8380, 2.0475, 2.2397, 2.4665, 2.6550, 2.7701, 2.8895, + 0.1040, 0.2340, 0.3964, 0.5740, 0.7764, 0.9941, 1.2000, 1.4014, + 1.6024, 1.7974, 1.9939, 2.1959, 2.3783, 2.5663, 2.7613, 2.9484, + 0.1912, 0.3393, 0.4743, 0.6313, 0.8014, 0.9879, 1.1855, 1.3922, + 1.5678, 1.7289, 1.9271, 2.1165, 2.3089, 2.5414, 2.7448, 2.9269, + 0.0965, 0.2025, 0.3398, 0.4990, 0.6934, 0.9386, 1.1730, 1.3766, + 1.5783, 1.7783, 1.9790, 2.1831, 2.3670, 2.5578, 2.7641, 2.9516, + 0.2126, 0.3652, 0.5545, 0.7170, 0.8674, 1.0640, 1.2558, 1.4061, + 1.5904, 1.8095, 1.9760, 2.1505, 2.3549, 2.5575, 2.7023, 2.8877, + 0.1827, 0.3426, 0.4894, 0.6488, 0.7960, 0.9535, 1.1217, 1.2798, + 1.4566, 1.6453, 1.8044, 2.0042, 2.2379, 2.4611, 2.6697, 2.8966, + 0.2034, 0.3822, 0.5231, 0.6960, 0.9200, 1.0394, 1.1616, 1.3772, + 1.5493, 1.7330, 1.9646, 2.1233, 2.3334, 2.5361, 2.7087, 2.9470, + 0.1050, 0.2060, 0.3705, 0.5998, 0.8337, 1.0577, 1.2559, 1.4327, + 1.6334, 1.8165, 1.9853, 2.2058, 2.4063, 2.5818, 2.7625, 2.9458, + 0.1419, 0.4053, 0.6660, 0.8911, 1.0405, 1.1547, 1.2506, 1.3926, + 1.5669, 1.7527, 1.9694, 2.2054, 2.3889, 2.5743, 2.7586, 2.9174, + 0.1514, 0.2825, 0.4309, 0.5772, 0.7470, 0.9703, 1.1462, 1.3316, + 1.5321, 1.7259, 1.9282, 2.1266, 2.3106, 2.5064, 2.7067, 2.9094, + 0.1693, 0.3156, 0.4878, 0.6635, 0.8206, 0.9569, 1.1154, 1.3064, + 1.5109, 1.7184, 1.9179, 2.1036, 2.2763, 2.4820, 2.6949, 2.9105, + 0.1432, 0.2718, 0.4241, 0.5564, 0.6939, 0.9011, 1.1582, 1.3948, + 1.6181, 1.8024, 1.9814, 2.1740, 2.3459, 2.5456, 2.7491, 2.9307, + 0.2294, 0.3857, 0.5590, 0.7434, 0.9189, 1.0941, 1.2740, 1.4456, + 1.6178, 1.7994, 1.9689, 2.1644, 2.3525, 2.5385, 2.7468, 2.9405, + 0.1667, 0.3109, 0.4612, 0.6032, 0.7375, 0.8866, 1.0840, 1.3053, + 1.4982, 1.7044, 1.9146, 2.1117, 2.2942, 2.4983, 2.7084, 2.9132, + 0.1810, 0.3205, 0.4696, 0.6231, 0.7641, 0.9959, 1.2427, 1.4361, + 1.5889, 1.7544, 1.9083, 2.0733, 2.2457, 2.4461, 2.6793, 2.9098, + 0.1164, 0.3753, 0.6068, 0.7503, 1.0100, 1.2131, 1.3793, 1.5302, + 1.6300, 1.7950, 1.9057, 2.1031, 2.3830, 2.5745, 2.6949, 2.8779, + 0.1571, 0.4378, 0.6735, 0.8312, 0.8944, 0.9818, 1.1622, 1.4094, + 1.6423, 1.8066, 1.9258, 2.1838, 2.4363, 2.6279, 2.7358, 2.8790, + 0.1398, 0.2686, 0.4248, 0.6156, 0.7870, 1.0035, 1.2012, 1.3689, + 1.5363, 1.7398, 1.9604, 2.1619, 2.3345, 2.5097, 2.7271, 2.9368, + 0.1913, 0.3338, 0.4987, 0.6446, 0.7852, 1.0163, 1.1886, 1.3610, + 1.5379, 1.7230, 1.8880, 2.0862, 2.2960, 2.4928, 2.7122, 2.9151, + 0.0908, 0.1752, 0.2899, 0.5365, 0.7761, 1.0100, 1.2124, 1.4060, + 1.6019, 1.8010, 1.9774, 2.1905, 2.3733, 2.5623, 2.7660, 2.9565, + 0.1773, 0.3179, 0.4925, 0.6864, 0.8452, 0.9897, 1.1860, 1.3722, + 1.5515, 1.7658, 1.9802, 2.1819, 2.3620, 2.5442, 2.7250, 2.9220, + 0.1286, 0.2341, 0.3689, 0.5364, 0.7176, 0.9350, 1.1083, 1.2943, + 1.4974, 1.7059, 1.9047, 2.1145, 2.3242, 2.5361, 2.7453, 2.9329, + 0.2273, 0.3834, 0.5565, 0.7192, 0.8431, 0.9962, 1.1763, 1.3571, + 1.5774, 1.7419, 1.9202, 2.1131, 2.2919, 2.4898, 2.6895, 2.9180, + 0.1775, 0.3058, 0.4274, 0.6023, 0.8151, 1.0734, 1.3211, 1.5178, + 1.6706, 1.8154, 1.9686, 2.1537, 2.3461, 2.5276, 2.7181, 2.9121, + 0.1653, 0.4304, 0.6361, 0.7824, 0.9183, 1.0452, 1.2071, 1.4077, + 1.6206, 1.8299, 2.0089, 2.1948, 2.3900, 2.5982, 2.7844, 2.9487, + 0.1492, 0.2609, 0.3820, 0.5485, 0.7243, 0.9319, 1.1538, 1.3579, + 1.5266, 1.7002, 1.8873, 2.1016, 2.3175, 2.5221, 2.7241, 2.9243, + 0.2074, 0.3781, 0.5209, 0.6869, 0.8577, 0.9875, 1.1849, 1.3568, + 1.4907, 1.7335, 1.8902, 2.1224, 2.3099, 2.4918, 2.7023, 2.8765, + 0.1359, 0.2254, 0.3286, 0.4432, 0.6586, 0.8964, 1.1125, 1.3523, + 1.5626, 1.7579, 1.9846, 2.1905, 2.3548, 2.5542, 2.7663, 2.9346, + 0.1430, 0.2966, 0.4685, 0.6493, 0.8315, 1.0304, 1.2220, 1.4082, + 1.5995, 1.7888, 1.9774, 2.1737, 2.3607, 2.5577, 2.7558, 2.9405, + 0.1477, 0.2694, 0.4056, 0.5626, 0.7051, 0.8647, 1.0491, 1.2488, + 1.4814, 1.7072, 1.9150, 2.1147, 2.3038, 2.5144, 2.7184, 2.9202, + 0.1690, 0.3033, 0.4580, 0.6686, 0.8536, 1.0293, 1.2124, 1.3998, + 1.5718, 1.7607, 1.9580, 2.1245, 2.2971, 2.4762, 2.6896, 2.9177, + 0.1092, 0.2779, 0.4853, 0.6880, 0.9011, 1.0953, 1.2752, 1.4618, + 1.6623, 1.8484, 2.0264, 2.2152, 2.4017, 2.5835, 2.7671, 2.9436, + 0.1497, 0.3637, 0.6014, 0.8032, 0.9963, 1.1835, 1.3741, 1.5698, + 1.7382, 1.9094, 2.0710, 2.2392, 2.4082, 2.5926, 2.7762, 2.9536, + 0.1434, 0.2492, 0.3966, 0.5934, 0.8033, 1.0657, 1.2796, 1.4276, + 1.5745, 1.7833, 1.9288, 2.1247, 2.3543, 2.5412, 2.7049, 2.8872, + 0.1612, 0.2926, 0.4574, 0.6387, 0.8265, 1.0180, 1.1808, 1.3526, + 1.5564, 1.7536, 1.9187, 2.1192, 2.3149, 2.5006, 2.7101, 2.9217, + 0.0828, 0.1863, 0.3235, 0.5050, 0.7250, 0.9867, 1.2093, 1.3941, + 1.5980, 1.7932, 1.9809, 2.1894, 2.3918, 2.5773, 2.7540, 2.9329, + 0.2001, 0.3655, 0.5290, 0.6761, 0.8027, 0.9972, 1.2090, 1.4255, + 1.6085, 1.7825, 1.9804, 2.1681, 2.3457, 2.5325, 2.7319, 2.9196, + 0.1505, 0.2767, 0.4254, 0.6054, 0.7821, 0.9567, 1.1294, 1.3080, + 1.4984, 1.6954, 1.8666, 2.0736, 2.2875, 2.4969, 2.7072, 2.9163, + 0.1589, 0.4151, 0.5749, 0.6651, 0.8061, 1.0470, 1.2616, 1.3690, + 1.4985, 1.7808, 1.9825, 2.1068, 2.2751, 2.5448, 2.7133, 2.8689, + 0.0916, 0.1846, 0.3788, 0.6329, 0.8774, 1.0687, 1.2653, 1.4561, + 1.6573, 1.8449, 2.0402, 2.2254, 2.3968, 2.5861, 2.7792, 2.9508, + 0.2282, 0.4159, 0.5834, 0.6899, 0.8108, 1.0321, 1.2795, 1.5262, + 1.6936, 1.8469, 2.0922, 2.2607, 2.3795, 2.5301, 2.7386, 2.9530, + 0.1651, 0.3004, 0.4555, 0.6179, 0.7891, 0.9584, 1.1372, 1.3707, + 1.5951, 1.7880, 1.9434, 2.1465, 2.3311, 2.5081, 2.6977, 2.8970, + 0.1279, 0.3828, 0.6330, 0.8323, 0.9652, 1.1175, 1.2319, 1.3511, + 1.5115, 1.6392, 1.7835, 1.9558, 2.2008, 2.4635, 2.6910, 2.9058, + 0.1193, 0.2185, 0.3521, 0.5311, 0.7378, 0.9239, 1.1105, 1.3217, + 1.5362, 1.7504, 1.9536, 2.1627, 2.3560, 2.5506, 2.7548, 2.9453, + 0.1806, 0.3432, 0.4981, 0.6948, 0.8928, 1.0527, 1.2467, 1.4140, + 1.6326, 1.7950, 1.9935, 2.1969, 2.3512, 2.5682, 2.7445, 2.9277, + 0.1846, 0.3112, 0.4568, 0.5891, 0.7317, 0.8493, 1.0204, 1.2022, + 1.3688, 1.6020, 1.8428, 2.0710, 2.2725, 2.4879, 2.7057, 2.9160, + 0.0880, 0.2514, 0.5332, 0.7272, 0.8906, 1.1354, 1.3199, 1.4941, + 1.6010, 1.7151, 1.8712, 2.0643, 2.2755, 2.5375, 2.7054, 2.8891, + 0.1382, 0.2833, 0.4658, 0.6897, 0.9071, 1.0716, 1.2469, 1.4143, + 1.5910, 1.7947, 1.9805, 2.1581, 2.3338, 2.5215, 2.7292, 2.9211, + 0.1061, 0.3494, 0.6327, 0.8570, 0.9748, 1.0560, 1.1529, 1.3250, + 1.6032, 1.8340, 1.9711, 2.1157, 2.3011, 2.5464, 2.8078, 2.9803, + 0.1603, 0.2839, 0.4307, 0.5980, 0.7980, 1.0399, 1.1971, 1.3524, + 1.5715, 1.7838, 1.9468, 2.1498, 2.3627, 2.5514, 2.7327, 2.9148, + 0.1691, 0.3117, 0.4796, 0.6895, 0.8732, 1.0164, 1.1916, 1.3707, + 1.5384, 1.7202, 1.8857, 2.0672, 2.2487, 2.4593, 2.6789, 2.8940, + 0.0965, 0.1702, 0.3191, 0.5721, 0.8100, 1.0241, 1.2272, 1.4196, + 1.6093, 1.8057, 1.9884, 2.2037, 2.3925, 2.5805, 2.7578, 2.9366, + 0.1950, 0.3519, 0.5272, 0.6973, 0.8732, 1.0656, 1.2112, 1.3959, + 1.6116, 1.7821, 1.9445, 2.1592, 2.3348, 2.5142, 2.7440, 2.9297, + 0.1388, 0.2557, 0.4120, 0.5727, 0.7354, 0.9196, 1.0985, 1.2805, + 1.4643, 1.6535, 1.8340, 2.0546, 2.2758, 2.4778, 2.6921, 2.9122, + 0.1823, 0.3336, 0.4957, 0.6771, 0.8563, 1.0137, 1.2299, 1.3849, + 1.5718, 1.7667, 1.9193, 2.1326, 2.3135, 2.5268, 2.7133, 2.8998, + 0.0790, 0.1901, 0.4083, 0.6456, 0.8463, 1.0285, 1.2297, 1.4181, + 1.6159, 1.8056, 1.9971, 2.1912, 2.3816, 2.5746, 2.7692, 2.9497, + 0.0049, 0.0116, 0.0045, 0.0039, -0.0010, -0.0122, -0.0205, -0.0034, + -0.0140, -0.0041, 0.0191, -0.0322, 0.0002, -0.0124, -0.0269, 0.0059, + 0.0586, 0.0339, -0.0389, -0.0319, -0.0079, -0.0205, -0.0363, -0.0211, + 0.0241, 0.0595, 0.0469, 0.0283, 0.0176, -0.0183, -0.0173, -0.0004, + 0.0024, 0.0145, 0.0534, 0.0197, -0.0065, -0.0067, 0.0133, 0.0358, + -0.0104, -0.0386, -0.0109, -0.0078, 0.0275, 0.0565, 0.0251, -0.0027, + -0.0053, 0.0171, 0.0088, 0.0495, 0.0141, 0.0039, -0.0445, -0.0426, + -0.0184, -0.0280, -0.0223, 0.0039, -0.0171, -0.0606, -0.0786, -0.0430, + 0.0544, 0.0595, 0.0320, -0.0012, 0.0108, 0.0185, 0.0066, 0.0408, + 0.0552, -0.0073, -0.0247, -0.0480, -0.0288, 0.0186, 0.0212, -0.0013, + 0.0403, 0.0598, 0.0690, 0.0516, -0.0298, -0.0177, 0.0278, 0.0168, + -0.0106, 0.0251, 0.0386, 0.0331, -0.0052, 0.0133, 0.0291, -0.0158, + -0.0329, -0.0367, 0.0287, 0.0462, -0.0176, 0.0049, 0.0242, -0.0034, + 0.0135, 0.0086, -0.0149, 0.0241, 0.0504, 0.0246, -0.0273, -0.0369, + -0.0108, -0.0449, -0.0625, -0.0414, -0.0292, -0.0571, -0.0440, -0.0088, + 0.0098, 0.0009, -0.0004, 0.0007, -0.0314, -0.0208, -0.0138, -0.0277, + -0.0044, 0.0522, 0.0315, -0.0270, -0.0277, -0.0256, -0.0103, -0.0201, + -0.0287, -0.0279, -0.0182, 0.0472, 0.0613, 0.0450, 0.0413, 0.0333, + 0.0444, 0.0223, 0.0061, 0.0316, 0.0321, 0.0501, 0.0460, 0.0250, + 0.0227, 0.0235, 0.0099, 0.0185, -0.0347, -0.0684, -0.0189, 0.0242, + -0.0190, -0.0273, -0.0012, -0.0253, 0.0293, -0.0231, -0.0219, -0.0010, + 0.0153, 0.0128, -0.0166, -0.0435, -0.0417, -0.0121, -0.0351, -0.0390, + 0.0077, -0.0278, -0.0355, 0.0092, -0.0063, 0.0005, 0.0216, 0.0461, + 0.0538, 0.0451, 0.0298, -0.0130, 0.0058, 0.0206, 0.0471, 0.0499, + 0.0280, 0.0086, -0.0007, -0.0317, 0.0259, 0.0176, 0.0043, 0.0212, + 0.0138, 0.0106, 0.0220, -0.0025, 0.0050, 0.0122, -0.0051, -0.0086, + -0.0472, -0.0005, 0.0193, 0.0032, 0.0246, 0.0222, 0.0090, -0.0320, + -0.0713, -0.0526, -0.0151, -0.0440, -0.0648, -0.0466, -0.0092, 0.0115, + -0.0129, 0.0053, -0.0344, -0.0385, 0.0392, 0.0599, 0.0414, 0.0165, + -0.0098, -0.0320, -0.0261, -0.0055, -0.0139, -0.0110, 0.0084, 0.0172, + -0.0492, -0.0537, -0.0320, -0.0036, 0.0265, 0.0385, 0.0064, -0.0280, + -0.0230, 0.0134, 0.0241, 0.0106, 0.0387, 0.0105, 0.0068, 0.0260, + 0.4940, 0.4911, 0.4849, 0.4820, 0.4837, 0.4839, 0.4824, 0.4799, + 0.4812, 0.4782, 0.4788, 0.4711, 0.4706, 0.4671, 0.4601, 0.4578, + 0.2954, 0.2121, 0.1859, 0.1958, 0.1474, 0.1086, 0.1351, 0.1362, + 0.1486, 0.1342, 0.1215, 0.1423, 0.1634, 0.1588, 0.1539, 0.1857, +}; + +const float ff_metasound_lsp16[] = { + 0.1813, 0.3911, 0.6301, 0.8012, 1.0057, 1.2041, 1.4271, 1.6943, + 1.9402, 2.1733, 2.3521, 2.4989, 2.5839, 2.6846, 2.7634, 2.8950, + 0.1311, 0.3183, 0.4659, 0.5601, 0.6658, 0.7828, 1.0065, 1.2717, + 1.5185, 1.7339, 1.9530, 2.2189, 2.3739, 2.4991, 2.6984, 2.9256, + 0.1627, 0.4519, 0.6323, 0.7012, 0.7848, 0.9801, 1.1810, 1.3222, + 1.5413, 1.8129, 1.9338, 2.0809, 2.3180, 2.5189, 2.7066, 2.9514, + 0.1475, 0.2447, 0.4240, 0.5669, 0.7872, 0.9838, 1.1823, 1.3814, + 1.5358, 1.6820, 1.8794, 2.1419, 2.4132, 2.6112, 2.7911, 2.9511, + 0.1224, 0.2876, 0.5013, 0.6985, 0.8902, 1.0901, 1.2835, 1.4768, + 1.6596, 1.8538, 2.0467, 2.2304, 2.4124, 2.5942, 2.7729, 2.9531, + 0.1741, 0.3034, 0.4677, 0.5879, 0.7258, 0.9648, 1.1417, 1.3220, + 1.5081, 1.7151, 1.9212, 2.1286, 2.3208, 2.4938, 2.6765, 2.8891, + 0.1657, 0.3174, 0.4907, 0.6559, 0.8295, 1.0254, 1.2071, 1.3880, + 1.5737, 1.7845, 1.9027, 2.1139, 2.3323, 2.5157, 2.7323, 2.9015, + 0.1592, 0.2758, 0.4417, 0.6315, 0.8257, 0.9873, 1.1277, 1.2830, + 1.4337, 1.6315, 1.8899, 2.1356, 2.3572, 2.5632, 2.7468, 2.9420, + 0.1524, 0.4325, 0.5931, 0.7036, 0.7696, 0.8923, 1.1739, 1.4773, + 1.6609, 1.7911, 1.9666, 2.1972, 2.3754, 2.5045, 2.6613, 2.8882, + 0.2130, 0.3013, 0.3721, 0.4257, 0.5079, 0.7015, 0.9815, 1.2554, + 1.4648, 1.6966, 1.9138, 2.1075, 2.3318, 2.5292, 2.7453, 2.9347, + 0.1142, 0.3748, 0.6205, 0.7642, 0.8121, 0.9022, 0.9843, 1.1558, + 1.4467, 1.7422, 1.9574, 2.1302, 2.3812, 2.5898, 2.7720, 2.9583, + 0.1255, 0.2339, 0.3570, 0.5323, 0.7458, 1.0003, 1.1729, 1.3567, + 1.5217, 1.6977, 1.8924, 2.0942, 2.3145, 2.5408, 2.7553, 2.9337, + 0.1316, 0.2289, 0.4327, 0.6663, 0.8509, 0.9994, 1.1697, 1.3804, + 1.5609, 1.6903, 1.8572, 2.1019, 2.3687, 2.5789, 2.7715, 2.9472, + 0.1502, 0.2546, 0.3883, 0.5333, 0.6976, 0.9163, 1.1071, 1.3364, + 1.5420, 1.7525, 1.8948, 2.0839, 2.2819, 2.4651, 2.6875, 2.8987, + 0.1593, 0.3014, 0.4573, 0.6354, 0.8157, 0.9805, 1.1783, 1.3747, + 1.5678, 1.7326, 1.9286, 2.1340, 2.3253, 2.5280, 2.7180, 2.9298, + 0.1811, 0.3167, 0.4655, 0.6507, 0.8198, 1.0075, 1.1892, 1.3743, + 1.5227, 1.7090, 1.8849, 2.0743, 2.2750, 2.4830, 2.6896, 2.8953, + 0.1846, 0.3577, 0.5315, 0.7290, 0.9176, 1.1016, 1.2654, 1.4525, + 1.6315, 1.8268, 2.0238, 2.1934, 2.3868, 2.5753, 2.7682, 2.9469, + 0.0876, 0.1439, 0.2048, 0.3654, 0.6281, 0.8853, 1.0907, 1.2992, + 1.5227, 1.7373, 1.9395, 2.1419, 2.3488, 2.5486, 2.7466, 2.9348, + 0.1391, 0.4170, 0.6561, 0.7953, 0.8734, 0.9986, 1.1870, 1.4520, + 1.6042, 1.7910, 2.0135, 2.1870, 2.3358, 2.5066, 2.7409, 2.9955, + 0.0804, 0.1355, 0.2599, 0.4998, 0.7408, 0.9474, 1.1276, 1.3428, + 1.5556, 1.7712, 1.9699, 2.1535, 2.3605, 2.5548, 2.7489, 2.9325, + 0.1304, 0.3087, 0.4979, 0.6584, 0.8414, 1.0329, 1.2244, 1.4189, + 1.6118, 1.8200, 1.9985, 2.1893, 2.3915, 2.5794, 2.7647, 2.9344, + 0.1895, 0.2849, 0.3705, 0.4126, 0.6265, 0.9207, 1.1774, 1.3762, + 1.5757, 1.7728, 1.9568, 2.1662, 2.3615, 2.5575, 2.7561, 2.9416, + 0.1800, 0.3078, 0.4805, 0.6796, 0.8503, 1.0046, 1.1703, 1.3269, + 1.4862, 1.6502, 1.8454, 2.0873, 2.3175, 2.5356, 2.7516, 2.9469, + 0.1950, 0.3233, 0.4568, 0.5940, 0.7589, 0.9978, 1.1701, 1.3383, + 1.5017, 1.6565, 1.8243, 2.0605, 2.2938, 2.5147, 2.7419, 2.9396, + 0.2531, 0.4391, 0.5790, 0.7170, 0.8998, 1.1430, 1.3577, 1.5326, + 1.6328, 1.7627, 1.9726, 2.1762, 2.3563, 2.5478, 2.7385, 2.9067, + 0.1805, 0.2788, 0.3591, 0.3881, 0.5441, 0.8055, 1.0766, 1.3165, + 1.5316, 1.7508, 1.9477, 2.1374, 2.3438, 2.5484, 2.7501, 2.9410, + 0.2044, 0.3671, 0.5396, 0.7042, 0.8582, 0.9831, 1.1261, 1.3194, + 1.4769, 1.6979, 1.8717, 2.0463, 2.2620, 2.4739, 2.7054, 2.9208, + 0.1048, 0.2175, 0.4206, 0.5923, 0.7483, 0.9400, 1.1356, 1.3799, + 1.5958, 1.7320, 1.8984, 2.1296, 2.3594, 2.5492, 2.7387, 2.9305, + 0.0842, 0.1729, 0.3951, 0.6447, 0.8688, 1.0605, 1.2472, 1.4330, + 1.6232, 1.8144, 2.0216, 2.1915, 2.3878, 2.5763, 2.7685, 2.9464, + 0.1461, 0.2593, 0.4105, 0.5677, 0.7328, 0.8919, 1.0484, 1.2302, + 1.4386, 1.6635, 1.8873, 2.1024, 2.3116, 2.5268, 2.7273, 2.9269, + 0.1503, 0.3108, 0.4756, 0.6731, 0.8600, 1.0233, 1.2115, 1.3971, + 1.5915, 1.7892, 1.9517, 2.1603, 2.3487, 2.5460, 2.7308, 2.8998, + 0.2163, 0.3669, 0.5125, 0.6709, 0.8143, 0.9930, 1.2095, 1.4205, + 1.6176, 1.7112, 1.8398, 2.0896, 2.3513, 2.5290, 2.6667, 2.8960, + 0.2133, 0.4382, 0.6287, 0.8702, 1.1088, 1.3749, 1.6062, 1.7446, + 1.8333, 1.9122, 1.9614, 2.0669, 2.1789, 2.3449, 2.6038, 2.8849, + 0.1598, 0.2719, 0.3877, 0.4815, 0.5926, 0.7795, 1.0449, 1.3045, + 1.5210, 1.7391, 1.9462, 2.1397, 2.3553, 2.5458, 2.7540, 2.9392, + 0.2918, 0.5607, 0.6801, 0.7404, 0.8285, 0.9431, 1.1579, 1.4080, + 1.6332, 1.8472, 1.9738, 2.0771, 2.2890, 2.5178, 2.7445, 2.9830, + 0.1664, 0.2842, 0.3965, 0.5463, 0.8162, 1.0346, 1.1849, 1.3446, + 1.5122, 1.7563, 1.9960, 2.2002, 2.3796, 2.5689, 2.7712, 2.9550, + 0.0911, 0.2397, 0.5052, 0.7868, 1.0299, 1.1311, 1.2244, 1.3333, + 1.4395, 1.6790, 1.9369, 2.1717, 2.3689, 2.5538, 2.7340, 2.9326, + 0.1647, 0.2931, 0.3836, 0.4978, 0.6255, 0.9243, 1.1339, 1.3001, + 1.5269, 1.8010, 1.9715, 2.1419, 2.3784, 2.5503, 2.6719, 2.8745, + 0.2440, 0.3802, 0.4756, 0.6613, 0.8627, 1.0292, 1.2291, 1.4060, + 1.5198, 1.7354, 1.9044, 2.1010, 2.3147, 2.4996, 2.7171, 2.9041, + 0.1590, 0.2876, 0.4572, 0.5996, 0.7713, 0.9490, 1.1205, 1.2815, + 1.4516, 1.6385, 1.8179, 2.0457, 2.2759, 2.4785, 2.6861, 2.9080, + 0.2297, 0.4309, 0.5712, 0.6717, 0.8138, 1.0463, 1.2492, 1.4560, + 1.6796, 1.8458, 1.9642, 2.1452, 2.3636, 2.5395, 2.7456, 2.9495, + 0.2975, 0.4678, 0.4996, 0.5809, 0.6279, 0.6884, 0.8606, 1.1386, + 1.4412, 1.6876, 1.8760, 2.0932, 2.3178, 2.5166, 2.7345, 2.9280, + 0.1278, 0.3737, 0.6004, 0.7069, 0.8147, 1.0180, 1.2581, 1.3812, + 1.4855, 1.7268, 1.9970, 2.1258, 2.2936, 2.5702, 2.7563, 2.8983, + 0.1314, 0.2508, 0.3999, 0.5680, 0.7424, 0.9367, 1.1286, 1.3175, + 1.5336, 1.7404, 1.9317, 2.1404, 2.3514, 2.5562, 2.7510, 2.9402, + 0.1043, 0.2367, 0.4293, 0.6376, 0.8160, 0.9836, 1.1779, 1.3850, + 1.5835, 1.7875, 1.9765, 2.1593, 2.3654, 2.5577, 2.7465, 2.9398, + 0.1529, 0.2515, 0.3454, 0.4374, 0.7011, 0.9015, 1.0744, 1.3532, + 1.5699, 1.7545, 2.0021, 2.1259, 2.2278, 2.4546, 2.7264, 2.9425, + 0.1429, 0.2808, 0.4395, 0.6334, 0.8069, 0.9705, 1.1520, 1.3250, + 1.5109, 1.7285, 1.9356, 2.1469, 2.3479, 2.5554, 2.7512, 2.9348, + 0.1625, 0.3022, 0.4756, 0.6315, 0.8032, 0.9924, 1.1596, 1.3204, + 1.4994, 1.6929, 1.8955, 2.1090, 2.3025, 2.5018, 2.6908, 2.8980, + 0.1692, 0.3427, 0.5228, 0.7756, 0.9688, 1.0950, 1.3056, 1.4360, + 1.5675, 1.8049, 1.9376, 2.1151, 2.3407, 2.5012, 2.7192, 2.9258, + 0.0474, 0.1251, 0.1939, 0.3841, 0.6501, 0.9231, 1.1153, 1.3240, + 1.5478, 1.7599, 1.9651, 2.1510, 2.3645, 2.5552, 2.7542, 2.9393, + 0.2196, 0.4656, 0.7492, 0.9922, 1.1678, 1.2489, 1.3112, 1.3657, + 1.4223, 1.5302, 1.7212, 1.9996, 2.2523, 2.4844, 2.7036, 2.9145, + 0.1128, 0.2368, 0.3704, 0.5476, 0.7723, 0.9968, 1.1930, 1.3992, + 1.6013, 1.7957, 1.9888, 2.1857, 2.3825, 2.5705, 2.7616, 2.9434, + 0.1341, 0.2768, 0.4510, 0.6359, 0.8332, 1.0335, 1.2004, 1.3952, + 1.5762, 1.7681, 1.9815, 2.1735, 2.3657, 2.5552, 2.7514, 2.9498, + 0.1247, 0.2559, 0.3516, 0.4726, 0.6861, 0.9483, 1.1852, 1.3858, + 1.5851, 1.7815, 1.9778, 2.1737, 2.3729, 2.5664, 2.7620, 2.9429, + 0.1988, 0.3320, 0.4777, 0.6737, 0.8425, 1.0265, 1.1694, 1.3655, + 1.5463, 1.7135, 1.9385, 2.1650, 2.3529, 2.5367, 2.7545, 2.9585, + 0.1376, 0.2620, 0.4273, 0.6169, 0.7755, 0.9441, 1.1169, 1.3157, + 1.5179, 1.7020, 1.8931, 2.1059, 2.3112, 2.5136, 2.7169, 2.9198, + 0.2112, 0.4385, 0.6091, 0.7618, 0.9553, 1.1543, 1.3445, 1.5396, + 1.7153, 1.9192, 2.1263, 2.3593, 2.5958, 2.8171, 2.9394, 3.0409, + 0.1347, 0.2099, 0.2646, 0.3453, 0.5266, 0.7869, 1.0513, 1.2795, + 1.4880, 1.7181, 1.9294, 2.1332, 2.3362, 2.5442, 2.7433, 2.9362, + 0.3141, 0.5935, 0.7517, 0.8313, 0.8568, 0.9570, 1.0250, 1.1275, + 1.3422, 1.6303, 1.8577, 2.0705, 2.2957, 2.5095, 2.7244, 2.9262, + 0.0962, 0.2116, 0.3961, 0.5641, 0.7122, 0.8883, 1.1023, 1.3481, + 1.5623, 1.7554, 1.9618, 2.1675, 2.3706, 2.5556, 2.7430, 2.9337, + 0.0898, 0.1510, 0.3060, 0.5820, 0.8221, 1.0388, 1.2261, 1.4289, + 1.6054, 1.8103, 1.9941, 2.1844, 2.3742, 2.5711, 2.7632, 2.9474, + 0.1326, 0.2316, 0.3761, 0.5177, 0.6782, 0.8761, 1.0952, 1.3175, + 1.5078, 1.7034, 1.9051, 2.1245, 2.3424, 2.5484, 2.7444, 2.9389, + 0.1740, 0.3293, 0.5174, 0.6824, 0.8394, 1.0372, 1.2046, 1.3723, + 1.5656, 1.7444, 1.9442, 2.1386, 2.3139, 2.4960, 2.7071, 2.9297, + 0.2304, 0.3775, 0.4865, 0.6182, 0.7842, 0.9208, 1.1151, 1.2843, + 1.4641, 1.6988, 1.9209, 2.1260, 2.3099, 2.5229, 2.7414, 2.9276, + 0.0094, 0.0261, -0.0037, 0.0041, -0.0092, -0.0044, -0.0232, -0.0073, + -0.0047, -0.0021, 0.0250, -0.0580, -0.0140, -0.0342, -0.0586, 0.0020, + 0.0449, 0.0155, -0.0523, -0.0279, 0.0299, -0.0183, -0.0736, -0.0639, + -0.0017, 0.0336, 0.0209, 0.0046, 0.0077, -0.0148, -0.0114, -0.0120, + 0.0115, -0.0050, 0.0445, 0.0048, 0.0188, -0.0137, -0.0080, 0.0239, + -0.0184, -0.0524, -0.0195, -0.0126, 0.0284, 0.0632, 0.0141, -0.0093, + -0.0096, 0.0196, 0.0230, 0.0379, 0.0308, 0.0237, -0.0224, -0.0600, + -0.0755, -0.1074, -0.0988, -0.0606, -0.1038, -0.1552, -0.1480, -0.0672, + 0.0504, 0.0676, 0.0336, -0.0042, 0.0729, 0.1013, 0.0868, 0.0846, + 0.0954, 0.0515, -0.0066, -0.0851, -0.0485, 0.0294, 0.0395, 0.0087, + 0.0078, 0.0446, 0.0881, 0.0672, -0.0384, -0.0025, 0.0415, 0.0353, + 0.0080, 0.0052, 0.0190, 0.0182, 0.0069, 0.0168, 0.0374, 0.0037, + -0.0292, -0.0429, 0.0302, 0.0681, -0.0233, -0.0238, -0.0003, -0.0043, + 0.0054, -0.0029, -0.0149, 0.0642, 0.0622, 0.0341, -0.0232, -0.0461, + -0.0082, -0.0469, -0.0618, -0.0326, -0.0452, -0.0649, -0.0597, -0.0398, + -0.0318, -0.0116, 0.0011, 0.0009, -0.0384, -0.0384, -0.0156, -0.0260, + -0.0007, 0.0473, 0.0111, -0.0358, -0.0484, -0.0204, -0.0029, -0.0090, + -0.0285, -0.0495, -0.0376, 0.0917, 0.1192, 0.1026, 0.0745, 0.0397, + 0.0463, 0.0253, 0.0025, 0.0465, 0.0100, 0.0488, 0.0416, 0.0223, + 0.0263, 0.0072, -0.0053, 0.0595, 0.0060, -0.0518, -0.0316, -0.0043, + -0.0133, -0.0233, -0.0075, -0.0251, 0.0277, -0.0067, -0.0136, -0.0004, + 0.0235, 0.0112, -0.0182, -0.0324, -0.0210, -0.0035, -0.0395, -0.0384, + 0.0005, -0.0150, -0.0356, 0.0127, -0.0033, -0.0034, 0.0205, 0.0747, + 0.1138, 0.1015, 0.0995, -0.0161, -0.0045, 0.0129, 0.0472, 0.0575, + 0.0222, 0.0091, 0.0037, -0.0471, 0.0371, 0.0132, 0.0208, 0.0247, + 0.0117, 0.0164, 0.0225, 0.0124, -0.0023, 0.0088, -0.0046, 0.0047, + -0.0393, 0.0018, 0.0148, 0.0020, 0.0044, 0.0165, 0.0229, -0.0208, + -0.0477, -0.0310, -0.0164, -0.0390, -0.0764, -0.0525, -0.0094, 0.0075, + -0.0102, -0.0045, -0.0504, -0.0709, 0.0822, 0.0710, 0.0426, 0.0014, + -0.0371, -0.0400, -0.0157, -0.0155, -0.0173, -0.0138, -0.0015, 0.0134, + -0.0418, -0.0682, -0.0256, 0.0050, 0.0360, 0.0354, 0.0074, -0.0396, + -0.0235, 0.0284, 0.0494, 0.0153, 0.0448, 0.0025, -0.0061, 0.0252, + 0.1000, 0.2260, 0.2158, 0.2116, 0.2198, 0.2055, 0.2110, 0.1873, + 0.1907, 0.2071, 0.2164, 0.2009, 0.2059, 0.2124, 0.2141, 0.2093, + 0.0875, 0.0981, 0.1177, 0.1071, 0.1033, 0.1248, 0.1048, 0.1238, + 0.1166, 0.1008, 0.1062, 0.0992, 0.0994, 0.1067, 0.0999, 0.1187, + 0.0750, 0.0794, 0.0828, 0.0854, 0.0859, 0.0801, 0.0891, 0.0933, + 0.0969, 0.0920, 0.0915, 0.0862, 0.0868, 0.0891, 0.0842, 0.0824, + 0.0625, 0.0930, 0.0815, 0.0853, 0.0898, 0.0828, 0.0822, 0.0910, + 0.0873, 0.0906, 0.0856, 0.0840, 0.0774, 0.0785, 0.0684, 0.0711, + 0.3319, 0.4219, 0.4588, 0.4090, 0.4092, 0.4014, 0.3548, 0.3353, + 0.3708, 0.3352, 0.3720, 0.3538, 0.4084, 0.4289, 0.4060, 0.4210, + 0.0588, 0.0209, -0.0082, -0.0115, -0.0343, -0.0621, -0.0541, -0.0346, + -0.0346, -0.0366, -0.0220, -0.0265, -0.0102, 0.0374, 0.0306, 0.0404, + 0.0306, 0.0090, -0.0054, 0.0333, 0.0047, 0.0238, 0.0141, 0.0165, + 0.0306, 0.0420, 0.0159, 0.0124, 0.0414, 0.0158, -0.0237, 0.0141, + 0.0765, 0.0057, -0.0260, -0.0426, -0.0395, -0.0126, -0.0579, -0.0417, + -0.0429, -0.0615, -0.0893, -0.0618, -0.0384, -0.0134, -0.0232, -0.0238, +}; + +const float ff_metasound_lsp22[] = { + 0.0664, 0.1875, 0.4300, 0.6730, 0.8793, 1.0640, 1.2563, 1.4433, + 1.6394, 1.8176, 2.0029, 2.1921, 2.3796, 2.5671, 2.7595, 2.9536, + 0.2128, 0.4052, 0.5311, 0.6404, 0.7875, 0.8775, 1.0974, 1.3261, + 1.5563, 1.6790, 1.8339, 2.1195, 2.3226, 2.4609, 2.6440, 2.8947, + 0.2024, 0.3362, 0.4834, 0.6784, 0.9088, 1.0850, 1.2188, 1.4054, + 1.6102, 1.7767, 1.9679, 2.1436, 2.3445, 2.5467, 2.7429, 2.9320, + 0.1181, 0.2279, 0.4413, 0.6114, 0.7710, 0.9427, 1.1142, 1.2707, + 1.4892, 1.7416, 1.9526, 2.1466, 2.3629, 2.5445, 2.7293, 2.9205, + 0.1155, 0.2720, 0.4886, 0.6812, 0.8594, 1.0422, 1.2315, 1.4116, + 1.6137, 1.8020, 1.9758, 2.1743, 2.3602, 2.5568, 2.7472, 2.9374, + 0.1110, 0.3312, 0.4735, 0.5612, 0.7129, 0.8146, 1.0233, 1.3155, + 1.5765, 1.7746, 1.9574, 2.1416, 2.3220, 2.5384, 2.7334, 2.9318, + 0.1656, 0.3350, 0.4215, 0.5609, 0.6759, 0.8503, 1.1405, 1.4094, + 1.6057, 1.6860, 1.7639, 2.0031, 2.2680, 2.5076, 2.7263, 2.9368, + 0.1466, 0.3638, 0.4587, 0.5674, 0.7381, 0.8669, 0.9619, 1.1658, + 1.4667, 1.7440, 1.9335, 2.1018, 2.3022, 2.5281, 2.7359, 2.9261, + 0.1061, 0.2566, 0.4739, 0.6751, 0.8711, 1.0704, 1.2720, 1.4655, + 1.6605, 1.8494, 2.0290, 2.2197, 2.4008, 2.5912, 2.7772, 2.9513, + 0.1116, 0.2364, 0.3971, 0.6316, 0.8583, 1.0335, 1.1686, 1.3302, + 1.5612, 1.7877, 1.9829, 2.2052, 2.3596, 2.5460, 2.7341, 2.9290, + 0.2661, 0.4186, 0.5126, 0.6477, 0.8818, 1.1045, 1.2852, 1.4128, + 1.5851, 1.7593, 1.9399, 2.1757, 2.3684, 2.5136, 2.6927, 2.9064, + 0.1495, 0.2749, 0.4391, 0.6304, 0.8239, 1.0181, 1.1995, 1.3759, + 1.5669, 1.7722, 1.9671, 2.1635, 2.3586, 2.5528, 2.7445, 2.9311, + 0.0912, 0.1759, 0.3066, 0.5660, 0.8005, 0.9568, 1.1832, 1.4504, + 1.6259, 1.7948, 2.0113, 2.2002, 2.3654, 2.5583, 2.7929, 2.9735, + 0.1353, 0.2747, 0.4078, 0.5977, 0.7658, 0.9124, 1.1081, 1.3630, + 1.5875, 1.7847, 1.9323, 2.1181, 2.3321, 2.5046, 2.7183, 2.9225, + 0.1938, 0.4063, 0.4982, 0.6002, 0.7702, 0.9071, 1.1631, 1.3885, + 1.6043, 1.8118, 1.9306, 2.0893, 2.2724, 2.4609, 2.6283, 2.8802, + 0.1857, 0.3351, 0.4381, 0.6101, 0.7561, 0.8555, 1.0384, 1.3171, + 1.5667, 1.6904, 1.7552, 1.9689, 2.2597, 2.5260, 2.7272, 2.9337, + 0.1037, 0.2159, 0.4188, 0.6174, 0.8035, 1.0285, 1.2256, 1.4230, + 1.6400, 1.8322, 2.0144, 2.1988, 2.3810, 2.5682, 2.7613, 2.9438, + 0.1625, 0.2776, 0.4225, 0.6001, 0.7879, 0.9087, 1.0801, 1.2759, + 1.4899, 1.7448, 1.9911, 2.1770, 2.3723, 2.5777, 2.7971, 2.9444, + 0.2111, 0.3640, 0.5839, 0.7290, 0.8051, 1.0023, 1.2315, 1.4143, + 1.5878, 1.7755, 1.9804, 2.1498, 2.3312, 2.5350, 2.7613, 2.9472, + 0.1423, 0.2646, 0.4136, 0.6350, 0.8070, 0.9514, 1.1168, 1.3213, + 1.5776, 1.7721, 1.9404, 2.1545, 2.3385, 2.5137, 2.7396, 2.9553, + 0.1132, 0.2386, 0.4103, 0.5931, 0.7808, 0.9881, 1.1840, 1.3860, + 1.6021, 1.7990, 1.9922, 2.1885, 2.3852, 2.5717, 2.7640, 2.9510, + 0.1267, 0.2602, 0.3913, 0.5944, 0.7598, 0.9198, 1.0781, 1.2715, + 1.5299, 1.7573, 1.9308, 2.1346, 2.3267, 2.5419, 2.7466, 2.9320, + 0.2023, 0.3417, 0.4392, 0.6141, 0.7439, 0.8593, 1.1096, 1.3543, + 1.5185, 1.6553, 1.7862, 2.0341, 2.2718, 2.4834, 2.7103, 2.9466, + 0.1113, 0.2470, 0.3677, 0.5686, 0.7700, 0.9356, 1.0806, 1.2452, + 1.4830, 1.7344, 1.9268, 2.1404, 2.3371, 2.5169, 2.7329, 2.9012, + 0.1664, 0.3554, 0.5573, 0.7471, 0.9245, 1.0998, 1.2787, 1.4655, + 1.6654, 1.8346, 2.0179, 2.2159, 2.4096, 2.5946, 2.7790, 2.9530, + 0.1313, 0.2625, 0.4731, 0.6444, 0.8110, 0.9878, 1.1493, 1.3212, + 1.5719, 1.8138, 1.9861, 2.1943, 2.3714, 2.5578, 2.7346, 2.9296, + 0.1186, 0.3035, 0.5049, 0.6860, 0.8670, 0.9975, 1.1364, 1.3471, + 1.5695, 1.7412, 1.9346, 2.1506, 2.3413, 2.5531, 2.7794, 2.9627, + 0.1108, 0.2697, 0.4787, 0.6344, 0.7909, 0.9586, 1.1440, 1.3511, + 1.5686, 1.7601, 1.9246, 2.1241, 2.3293, 2.5390, 2.7315, 2.9333, + 0.0985, 0.2302, 0.3544, 0.5759, 0.7620, 0.9651, 1.1497, 1.3080, + 1.5500, 1.7845, 1.9518, 2.1734, 2.3565, 2.5665, 2.7605, 2.9102, + 0.1208, 0.2727, 0.4381, 0.5736, 0.7382, 0.8390, 1.0102, 1.2648, + 1.5100, 1.7440, 1.9619, 2.1430, 2.3307, 2.5159, 2.7264, 2.9211, + 0.1582, 0.2777, 0.4475, 0.6551, 0.8591, 1.0084, 1.1414, 1.3291, + 1.5902, 1.7826, 1.9543, 2.1659, 2.3233, 2.5044, 2.6935, 2.9199, + 0.1360, 0.2873, 0.4585, 0.6295, 0.7592, 0.9089, 1.0492, 1.2733, + 1.5391, 1.7768, 1.9372, 2.1329, 2.3168, 2.5015, 2.6857, 2.8837, + 0.0886, 0.1829, 0.3696, 0.6126, 0.8334, 1.0135, 1.2303, 1.4674, + 1.6743, 1.8564, 2.0530, 2.2370, 2.3960, 2.5787, 2.7756, 2.9377, + 0.2005, 0.3537, 0.4700, 0.6249, 0.7385, 0.9097, 1.1759, 1.3811, + 1.5314, 1.6705, 1.8546, 2.1229, 2.3292, 2.5251, 2.7951, 2.9646, + 0.1999, 0.3112, 0.4722, 0.7146, 0.8908, 1.0028, 1.1831, 1.3903, + 1.6125, 1.7514, 1.9083, 2.1248, 2.3271, 2.5339, 2.6945, 2.8918, + 0.1243, 0.2606, 0.4382, 0.5850, 0.7705, 0.9727, 1.1214, 1.3059, + 1.5218, 1.7406, 1.9137, 2.1353, 2.3354, 2.5299, 2.7287, 2.9068, + 0.1039, 0.2426, 0.4265, 0.6284, 0.8152, 0.9941, 1.2004, 1.4038, + 1.5912, 1.7763, 1.9650, 2.1598, 2.3474, 2.5488, 2.7419, 2.9322, + 0.1364, 0.2420, 0.3886, 0.5864, 0.7663, 0.8844, 1.0860, 1.3242, + 1.5518, 1.7893, 2.0004, 2.1562, 2.3619, 2.5516, 2.7687, 2.9181, + 0.1483, 0.2851, 0.4479, 0.6312, 0.7924, 0.9821, 1.1705, 1.3386, + 1.5375, 1.7226, 1.9053, 2.0991, 2.2898, 2.4953, 2.7000, 2.9146, + 0.2332, 0.4561, 0.5407, 0.6212, 0.7524, 0.8215, 0.9522, 1.1685, + 1.5216, 1.7132, 1.8291, 2.0647, 2.2811, 2.4857, 2.7071, 2.9281, + 0.1348, 0.3126, 0.5179, 0.7192, 0.9227, 1.1363, 1.3223, 1.4756, + 1.6509, 1.8191, 1.9991, 2.1976, 2.3877, 2.5768, 2.7590, 2.9386, + 0.1093, 0.2211, 0.4763, 0.6703, 0.8282, 0.9536, 1.1202, 1.3796, + 1.6043, 1.8031, 1.9832, 2.1604, 2.3578, 2.5856, 2.7650, 2.9291, + 0.1865, 0.3027, 0.4580, 0.6719, 0.8400, 1.0082, 1.1901, 1.3782, + 1.5448, 1.6885, 1.9477, 2.1381, 2.2797, 2.5113, 2.7465, 2.9414, + 0.1575, 0.3124, 0.4649, 0.6262, 0.8095, 0.9858, 1.1676, 1.3602, + 1.5646, 1.7582, 1.9550, 2.1671, 2.3628, 2.5734, 2.7670, 2.9519, + 0.1174, 0.2777, 0.4663, 0.6333, 0.8169, 1.0096, 1.1885, 1.3847, + 1.5803, 1.7571, 1.9380, 2.1398, 2.3414, 2.5407, 2.7360, 2.9375, + 0.1073, 0.2264, 0.4083, 0.5973, 0.7474, 0.9514, 1.1349, 1.3337, + 1.5433, 1.7348, 1.9380, 2.1436, 2.3441, 2.5438, 2.7457, 2.9383, + 0.1472, 0.2880, 0.4793, 0.6268, 0.8015, 1.0063, 1.1715, 1.3644, + 1.5525, 1.7410, 1.9258, 2.1227, 2.3214, 2.5149, 2.7148, 2.9196, + 0.1414, 0.2565, 0.4349, 0.6111, 0.7695, 0.9496, 1.1212, 1.3265, + 1.5218, 1.7209, 1.9015, 2.0887, 2.3158, 2.5077, 2.7233, 2.9421, + 0.1252, 0.2667, 0.4454, 0.6431, 0.8371, 1.0124, 1.2110, 1.4160, + 1.6240, 1.8242, 2.0047, 2.1974, 2.3902, 2.5778, 2.7637, 2.9481, + 0.1321, 0.2565, 0.3846, 0.5847, 0.7578, 0.9259, 1.0637, 1.2239, + 1.4690, 1.7346, 1.9750, 2.1882, 2.3712, 2.5509, 2.7280, 2.8885, + 0.1437, 0.2930, 0.4428, 0.6156, 0.8045, 0.9638, 1.1450, 1.3138, + 1.5144, 1.7355, 1.9469, 2.1534, 2.3414, 2.5452, 2.7353, 2.9334, + 0.1692, 0.2770, 0.3831, 0.6100, 0.7825, 0.9302, 1.0690, 1.2481, + 1.4615, 1.6799, 1.9165, 2.1739, 2.3435, 2.5349, 2.7520, 2.9163, + 0.1235, 0.2489, 0.4354, 0.6343, 0.8236, 1.0066, 1.1908, 1.3474, + 1.5656, 1.8275, 2.0620, 2.2548, 2.4135, 2.5913, 2.7639, 2.9334, + 0.1090, 0.1961, 0.3854, 0.5701, 0.7024, 0.8843, 1.1393, 1.3785, + 1.5940, 1.7797, 1.9442, 2.1740, 2.3853, 2.5773, 2.7727, 2.9406, + 0.1560, 0.3477, 0.5011, 0.6287, 0.7612, 0.9896, 1.1510, 1.3420, + 1.5435, 1.6816, 1.8731, 2.0651, 2.2613, 2.4999, 2.7027, 2.8971, + 0.1459, 0.2416, 0.3833, 0.5450, 0.7916, 0.9223, 1.0662, 1.1953, + 1.4029, 1.6616, 1.9320, 2.1459, 2.3386, 2.5081, 2.6799, 2.9195, + 0.1546, 0.3854, 0.6184, 0.8460, 1.0599, 1.2428, 1.3906, 1.5550, + 1.7388, 1.8945, 2.0757, 2.2386, 2.4014, 2.5705, 2.7574, 2.9400, + 0.1080, 0.2307, 0.4112, 0.6067, 0.7725, 0.9467, 1.1285, 1.3205, + 1.5348, 1.7609, 1.9937, 2.1878, 2.3583, 2.5515, 2.7199, 2.9049, + 0.1482, 0.3178, 0.4983, 0.6342, 0.7783, 0.9880, 1.2019, 1.3404, + 1.5223, 1.7296, 1.9211, 2.0943, 2.2928, 2.5008, 2.7136, 2.9224, + 0.1145, 0.2910, 0.4891, 0.6492, 0.8126, 0.9530, 1.1180, 1.3155, + 1.5054, 1.6893, 1.8899, 2.1188, 2.3389, 2.5512, 2.7313, 2.9224, + 0.0939, 0.1689, 0.3250, 0.5792, 0.7698, 0.9245, 1.1574, 1.3865, + 1.5959, 1.7977, 1.9821, 2.1528, 2.3326, 2.5540, 2.7553, 2.9179, + 0.1243, 0.2474, 0.3923, 0.6199, 0.7908, 0.9379, 1.1497, 1.3734, + 1.5582, 1.7420, 1.9539, 2.1385, 2.3240, 2.5277, 2.7311, 2.9178, + 0.1961, 0.3748, 0.5176, 0.6387, 0.8169, 1.0477, 1.2124, 1.3869, + 1.5604, 1.7225, 1.8770, 2.0837, 2.2960, 2.5103, 2.6945, 2.8862, + 0.1295, 0.2403, 0.4149, 0.6189, 0.7913, 0.9130, 1.0832, 1.2787, + 1.4860, 1.7112, 1.9502, 2.1348, 2.2776, 2.4982, 2.7431, 2.9522, + 0.0160, 0.0362, 0.0097, 0.0057, -0.0014, -0.0073, -0.0046, -0.0064, + -0.0121, 0.0019, 0.0149, -0.0440, -0.0479, -0.0382, -0.0480, -0.0182, + 0.0170, 0.0114, -0.0298, -0.0175, -0.0033, -0.0354, -0.0510, -0.0025, + 0.0307, 0.0351, 0.0338, 0.0420, 0.0138, -0.0175, -0.0102, 0.0053, + 0.0084, -0.0003, 0.0412, -0.0027, 0.0145, -0.0039, 0.0083, 0.0400, + 0.0001, -0.0262, 0.0055, -0.0082, 0.0348, 0.0433, 0.0137, -0.0024, + -0.0055, 0.0262, 0.0521, 0.0349, 0.0185, 0.0076, -0.0319, -0.0561, + -0.0460, -0.0253, -0.0097, 0.0163, 0.0184, -0.0037, -0.0480, -0.0371, + 0.0628, 0.0665, 0.0296, -0.0057, 0.0253, 0.0227, 0.0350, 0.0692, + 0.0545, 0.0218, 0.0094, -0.0449, -0.0372, 0.0005, 0.0258, 0.0118, + 0.0285, 0.0760, 0.0822, 0.0527, -0.0299, -0.0049, 0.0170, 0.0195, + 0.0136, 0.0286, 0.0289, 0.0139, 0.0054, 0.0152, 0.0244, 0.0028, + -0.0056, -0.0260, 0.0307, 0.0572, -0.0087, 0.0088, 0.0062, 0.0000, + 0.0125, 0.0000, -0.0292, 0.0820, 0.0872, 0.0646, 0.0346, 0.0076, + -0.0022, -0.0253, -0.0567, -0.0188, -0.0336, -0.0673, -0.0549, -0.0166, + -0.0259, -0.0140, 0.0040, -0.0029, -0.0430, -0.0531, -0.0253, -0.0019, + -0.0071, 0.0393, 0.0072, -0.0327, -0.0236, -0.0235, -0.0177, -0.0186, + -0.0280, -0.0201, -0.0077, 0.0383, 0.0418, 0.0321, 0.0294, 0.0169, + 0.0468, 0.0301, 0.0133, 0.0363, 0.0516, 0.0937, 0.1240, 0.1404, + 0.1325, 0.1178, 0.0999, 0.0251, -0.0037, -0.0495, -0.0703, -0.0219, + -0.0261, -0.0304, -0.0204, -0.0372, 0.0355, 0.0131, -0.0093, -0.0099, + -0.0069, -0.0034, -0.0065, -0.0208, -0.0231, -0.0117, -0.0211, -0.0243, + 0.0046, -0.0107, -0.0070, 0.0123, 0.0230, 0.0152, 0.0164, 0.0412, + 0.0619, 0.0858, 0.0862, -0.0056, 0.0125, 0.0182, 0.0347, 0.0388, + 0.0456, 0.0407, -0.0249, -0.0460, 0.0206, 0.0299, 0.0253, 0.0207, + 0.0177, 0.0238, 0.0253, 0.0030, 0.0042, 0.0020, -0.0081, -0.0136, + -0.0290, -0.0042, 0.0122, 0.0051, 0.0107, 0.0228, 0.0211, -0.0068, + -0.0436, -0.0299, -0.0078, -0.0779, -0.1157, -0.0679, 0.0172, 0.0150, + -0.0051, 0.0081, -0.0512, -0.0616, 0.0576, 0.0799, 0.0803, 0.0336, + 0.0001, -0.0298, -0.0747, -0.0115, -0.0101, -0.0170, -0.0050, 0.0174, + -0.0290, -0.0601, -0.0150, 0.0121, 0.0165, 0.0230, 0.0028, -0.0317, + -0.0165, 0.0356, 0.0451, 0.0120, 0.0321, 0.0084, -0.0058, 0.0122, + 0.1935, 0.1802, 0.2195, 0.2410, 0.2201, 0.1915, 0.1840, 0.1935, + 0.2213, 0.2079, 0.1858, 0.1974, 0.2239, 0.2173, 0.1840, 0.2120, + 0.4912, 0.4777, 0.4607, 0.4395, 0.4426, 0.4388, 0.4416, 0.4345, + 0.4239, 0.4331, 0.4522, 0.4423, 0.4475, 0.4387, 0.4525, 0.4446, +}; + +const float ff_metasound_lsp44[] = { + 0.0927, 0.2291, 0.4059, 0.5779, 0.7288, 0.8821, 1.0377, 1.1915, + 1.3433, 1.4931, 1.6475, 1.7989, 1.9381, 2.0858, 2.2321, 2.3765, + 2.5187, 2.6530, 2.7895, 2.9354, 0.0944, 0.1974, 0.3046, 0.4714, + 0.6116, 0.7829, 0.9027, 1.0375, 1.1869, 1.3488, 1.5036, 1.6781, + 1.8276, 1.9983, 2.1449, 2.3089, 2.4534, 2.6113, 2.7553, 2.9062, + 0.1168, 0.2843, 0.4907, 0.6706, 0.8100, 0.9417, 1.0753, 1.2014, + 1.3151, 1.4496, 1.5832, 1.7379, 1.8642, 2.0230, 2.1681, 2.3250, + 2.4676, 2.6242, 2.7602, 2.9066, 0.1353, 0.2335, 0.3370, 0.4380, + 0.5819, 0.7353, 0.8671, 1.0160, 1.1435, 1.2977, 1.4860, 1.6739, + 1.8412, 2.0028, 2.1537, 2.3124, 2.4741, 2.6272, 2.7862, 2.9536, + 0.1003, 0.2226, 0.3584, 0.4971, 0.6291, 0.7710, 0.9157, 1.0669, + 1.2143, 1.3624, 1.5104, 1.6681, 1.8164, 1.9823, 2.1394, 2.3082, + 2.4677, 2.6306, 2.7909, 2.9382, 0.1056, 0.2027, 0.2956, 0.4005, + 0.5215, 0.6708, 0.8545, 1.0557, 1.2344, 1.4023, 1.5676, 1.7278, + 1.8808, 2.0381, 2.1846, 2.3376, 2.4887, 2.6377, 2.7878, 2.9504, + 0.1015, 0.2462, 0.4122, 0.5783, 0.7233, 0.8833, 1.0377, 1.1903, + 1.3341, 1.4727, 1.6138, 1.7582, 1.8912, 2.0370, 2.1701, 2.3125, + 2.4500, 2.6006, 2.7507, 2.9166, 0.1787, 0.2418, 0.3265, 0.5379, + 0.6584, 0.7681, 0.9545, 1.1050, 1.2125, 1.3528, 1.4763, 1.6705, + 1.8136, 1.9594, 2.0936, 2.2724, 2.4394, 2.5919, 2.7037, 2.8747, + 0.0859, 0.1600, 0.2980, 0.4933, 0.6696, 0.8285, 0.9958, 1.1545, + 1.3107, 1.4591, 1.6127, 1.7652, 1.9143, 2.0680, 2.2171, 2.3643, + 2.5141, 2.6611, 2.8143, 2.9691, 0.0910, 0.2110, 0.3364, 0.4718, + 0.5856, 0.7298, 0.8910, 1.0514, 1.1988, 1.3572, 1.5178, 1.6861, + 1.8399, 2.0099, 2.1639, 2.3225, 2.4774, 2.6321, 2.7863, 2.9412, + 0.1904, 0.2874, 0.3681, 0.4981, 0.6248, 0.7880, 0.9121, 1.0750, + 1.2185, 1.3809, 1.5296, 1.7007, 1.8592, 2.0470, 2.1913, 2.3250, + 2.4519, 2.5984, 2.7408, 2.9023, 0.0917, 0.2067, 0.3246, 0.4961, + 0.6310, 0.8024, 0.9438, 1.1008, 1.2362, 1.3892, 1.5407, 1.7033, + 1.8427, 2.0061, 2.1498, 2.3117, 2.4550, 2.6053, 2.7462, 2.9029, + 0.0989, 0.2193, 0.3756, 0.5410, 0.6929, 0.8368, 0.9801, 1.1250, + 1.2677, 1.4184, 1.5677, 1.7292, 1.8770, 2.0311, 2.1803, 2.3306, + 2.4836, 2.6339, 2.7943, 2.9549, 0.0861, 0.1943, 0.3057, 0.4867, + 0.6194, 0.7592, 0.9184, 1.1052, 1.2486, 1.4064, 1.5609, 1.7273, + 1.8703, 2.0291, 2.1686, 2.3225, 2.4628, 2.6115, 2.7471, 2.9005, + 0.0932, 0.2110, 0.3737, 0.5479, 0.7120, 0.8570, 0.9975, 1.1364, + 1.2772, 1.4220, 1.5612, 1.7089, 1.8410, 1.9827, 2.1263, 2.2859, + 2.4459, 2.6172, 2.7788, 2.9395, 0.1193, 0.2341, 0.3523, 0.5029, + 0.6437, 0.7803, 0.9367, 1.1007, 1.2392, 1.3869, 1.5425, 1.7168, + 1.8709, 2.0248, 2.1584, 2.2949, 2.4308, 2.5823, 2.7235, 2.9034, + 0.0834, 0.1988, 0.3557, 0.5261, 0.6767, 0.8427, 1.0029, 1.1683, + 1.3138, 1.4527, 1.6046, 1.7583, 1.9011, 2.0517, 2.1928, 2.3397, + 2.4839, 2.6291, 2.7771, 2.9329, 0.0938, 0.1967, 0.3213, 0.4675, + 0.6068, 0.7664, 0.9418, 1.1120, 1.2535, 1.3932, 1.5243, 1.6801, + 1.8346, 1.9931, 2.1376, 2.3035, 2.4636, 2.6244, 2.7829, 2.9371, + 0.1017, 0.2552, 0.4327, 0.6017, 0.7467, 0.8797, 1.0097, 1.1442, + 1.2628, 1.4049, 1.5541, 1.7090, 1.8461, 1.9982, 2.1486, 2.3029, + 2.4513, 2.6075, 2.7594, 2.9209, 0.1031, 0.2295, 0.3747, 0.5122, + 0.6596, 0.7935, 0.9345, 1.1050, 1.2384, 1.3543, 1.4739, 1.6136, + 1.7447, 1.8914, 2.0434, 2.1916, 2.3557, 2.5396, 2.7419, 2.9401, + 0.1007, 0.2374, 0.3715, 0.5173, 0.6465, 0.8069, 0.9553, 1.1145, + 1.2594, 1.4143, 1.5617, 1.7166, 1.8457, 2.0012, 2.1462, 2.2864, + 2.4258, 2.5910, 2.7372, 2.9018, 0.0808, 0.1726, 0.2849, 0.4592, + 0.6118, 0.7853, 0.9588, 1.1256, 1.2751, 1.4392, 1.5898, 1.7514, + 1.8977, 2.0554, 2.1937, 2.3430, 2.4831, 2.6249, 2.7601, 2.9155, + 0.1669, 0.2574, 0.3694, 0.5569, 0.6773, 0.8061, 1.0160, 1.1667, + 1.2791, 1.4041, 1.5452, 1.7207, 1.8524, 2.0038, 2.1414, 2.3338, + 2.4747, 2.6157, 2.7303, 2.8848, 0.1598, 0.2521, 0.3416, 0.5149, + 0.6703, 0.7941, 0.9408, 1.1164, 1.2017, 1.3293, 1.4908, 1.6783, + 1.8438, 1.9927, 2.1149, 2.2698, 2.4420, 2.6193, 2.7583, 2.9103, + 0.0902, 0.1978, 0.3265, 0.4578, 0.5878, 0.7439, 0.9110, 1.0906, + 1.2556, 1.4125, 1.5688, 1.7295, 1.8829, 2.0472, 2.2058, 2.3537, + 2.5075, 2.6548, 2.8058, 2.9538, 0.0818, 0.1695, 0.2794, 0.4470, + 0.6069, 0.7641, 0.9313, 1.0946, 1.2411, 1.4072, 1.5640, 1.7186, + 1.8651, 2.0254, 2.1726, 2.3286, 2.4784, 2.6287, 2.7750, 2.9339, + 0.1980, 0.3134, 0.4099, 0.4975, 0.6491, 0.8376, 0.9441, 1.0298, + 1.1795, 1.3866, 1.5784, 1.7209, 1.8137, 1.9271, 2.0863, 2.2930, + 2.4696, 2.6184, 2.7587, 2.9251, 0.1338, 0.2341, 0.3566, 0.4797, + 0.6129, 0.7580, 0.9093, 1.0491, 1.1911, 1.3313, 1.4841, 1.6503, + 1.8035, 1.9685, 2.1128, 2.2694, 2.4093, 2.5728, 2.7206, 2.8994, + 0.0937, 0.2034, 0.3447, 0.5032, 0.6370, 0.7993, 0.9674, 1.1323, + 1.2830, 1.4199, 1.5492, 1.7010, 1.8513, 2.0087, 2.1550, 2.3115, + 2.4643, 2.6237, 2.7812, 2.9392, 0.1085, 0.2152, 0.3126, 0.4569, + 0.5718, 0.7213, 0.8837, 1.0604, 1.2053, 1.3755, 1.5397, 1.7001, + 1.8409, 2.0039, 2.1498, 2.3080, 2.4535, 2.6063, 2.7505, 2.9110, + 0.0562, 0.2066, 0.4034, 0.5490, 0.6682, 0.7924, 0.9495, 1.0800, + 1.1869, 1.3156, 1.4834, 1.6619, 1.8404, 2.0199, 2.1509, 2.2755, + 2.4072, 2.5580, 2.6993, 2.8913, 0.0939, 0.2303, 0.3742, 0.5260, + 0.6662, 0.8294, 0.9769, 1.1315, 1.2792, 1.4153, 1.5436, 1.6701, + 1.8215, 1.9920, 2.1310, 2.3005, 2.4534, 2.5786, 2.7204, 2.9068, + 0.1005, 0.2442, 0.3898, 0.5398, 0.6958, 0.8474, 1.0008, 1.1556, + 1.3020, 1.4456, 1.5954, 1.7470, 1.8922, 2.0500, 2.2019, 2.3492, + 2.4963, 2.6412, 2.7890, 2.9423, 0.1022, 0.2031, 0.3213, 0.4402, + 0.5637, 0.7117, 0.8673, 1.0242, 1.1727, 1.3206, 1.4846, 1.6465, + 1.8015, 1.9655, 2.1233, 2.2873, 2.4464, 2.6074, 2.7685, 2.9409, + 0.1985, 0.3497, 0.4622, 0.5982, 0.7489, 0.8752, 0.9925, 1.1679, + 1.3288, 1.4606, 1.5820, 1.7492, 1.8922, 2.0511, 2.1780, 2.3373, + 2.4760, 2.6233, 2.7466, 2.8978, 0.1284, 0.2433, 0.3630, 0.4852, + 0.6117, 0.7460, 0.8904, 1.0360, 1.1738, 1.3142, 1.4696, 1.6185, + 1.7719, 1.9318, 2.0961, 2.2697, 2.4408, 2.6046, 2.7681, 2.9451, + 0.1042, 0.2286, 0.3598, 0.5064, 0.6438, 0.7899, 0.9350, 1.0891, + 1.2323, 1.3807, 1.5225, 1.6747, 1.8153, 1.9669, 2.1145, 2.2832, + 2.4430, 2.6085, 2.7748, 2.9346, 0.0780, 0.1724, 0.2440, 0.3489, + 0.5280, 0.7426, 0.9272, 1.0914, 1.2562, 1.4188, 1.5804, 1.7376, + 1.8909, 2.0473, 2.1946, 2.3457, 2.4950, 2.6424, 2.7926, 2.9549, + 0.1103, 0.2608, 0.4087, 0.5538, 0.6923, 0.8418, 0.9940, 1.1507, + 1.2919, 1.4406, 1.5802, 1.7262, 1.8638, 2.0085, 2.1572, 2.2975, + 2.4329, 2.5866, 2.7380, 2.9107, 0.1297, 0.2532, 0.4003, 0.5329, + 0.6733, 0.7950, 0.9557, 1.0859, 1.2235, 1.3538, 1.5037, 1.6389, + 1.7964, 1.9285, 2.0898, 2.2541, 2.4231, 2.5711, 2.6875, 2.8947, + 0.0871, 0.1968, 0.3425, 0.4949, 0.6424, 0.7959, 0.9534, 1.1132, + 1.2656, 1.4229, 1.5785, 1.7271, 1.8729, 2.0355, 2.1998, 2.3562, + 2.5151, 2.6663, 2.8145, 2.9534, 0.1038, 0.2204, 0.3248, 0.4566, + 0.5947, 0.7443, 0.8811, 1.0379, 1.2031, 1.3772, 1.5430, 1.7092, + 1.8625, 2.0322, 2.1904, 2.3417, 2.4960, 2.6458, 2.7979, 2.9485, + 0.1329, 0.2763, 0.3943, 0.5147, 0.6512, 0.8071, 0.9410, 1.0879, + 1.2298, 1.3850, 1.5282, 1.6674, 1.8137, 1.9993, 2.1344, 2.2749, + 2.4257, 2.5863, 2.7410, 2.9184, 0.1052, 0.2142, 0.3584, 0.5033, + 0.6387, 0.7804, 0.9320, 1.0780, 1.2172, 1.3764, 1.5421, 1.6887, + 1.8246, 1.9833, 2.1245, 2.2797, 2.4237, 2.5779, 2.7257, 2.9097, + 0.1092, 0.2676, 0.4071, 0.5355, 0.6661, 0.8142, 0.9621, 1.1173, + 1.2628, 1.4185, 1.5696, 1.7220, 1.8595, 2.0178, 2.1720, 2.3221, + 2.4718, 2.6259, 2.7775, 2.9334, 0.0929, 0.2017, 0.3073, 0.4570, + 0.5775, 0.7635, 0.9299, 1.0832, 1.2334, 1.3935, 1.5420, 1.7112, + 1.8601, 2.0309, 2.1735, 2.3230, 2.4543, 2.6034, 2.7418, 2.8988, + 0.0775, 0.2005, 0.3490, 0.5200, 0.6747, 0.8383, 0.9885, 1.1738, + 1.3141, 1.4236, 1.5892, 1.7402, 1.8474, 2.0210, 2.1593, 2.2730, + 2.4235, 2.5604, 2.7128, 2.9005, 0.1104, 0.2292, 0.3353, 0.4732, + 0.6152, 0.7675, 0.9164, 1.0907, 1.2594, 1.4064, 1.5218, 1.6426, + 1.8018, 1.9937, 2.1362, 2.2961, 2.4523, 2.6083, 2.7613, 2.9202, + 0.0826, 0.2000, 0.3384, 0.5144, 0.6694, 0.8377, 0.9870, 1.1461, + 1.2950, 1.4495, 1.5872, 1.7387, 1.8793, 2.0329, 2.1723, 2.3114, + 2.4415, 2.5908, 2.7354, 2.9028, 0.1063, 0.2268, 0.3442, 0.4735, + 0.6116, 0.7507, 0.9028, 1.0768, 1.2426, 1.4052, 1.5566, 1.7015, + 1.8243, 1.9742, 2.1276, 2.2824, 2.4262, 2.5953, 2.7627, 2.9290, + 0.1150, 0.2814, 0.4543, 0.6095, 0.7373, 0.8592, 0.9908, 1.1108, + 1.2339, 1.3590, 1.4864, 1.6168, 1.7392, 1.8752, 2.0212, 2.1688, + 2.3128, 2.4869, 2.7019, 2.9239, 0.0948, 0.2074, 0.3433, 0.4943, + 0.6346, 0.7645, 0.8809, 1.0610, 1.2307, 1.3487, 1.4655, 1.6186, + 1.7534, 1.8859, 2.0486, 2.2200, 2.3835, 2.5581, 2.7565, 2.9502, + 0.1062, 0.2239, 0.3683, 0.5197, 0.6704, 0.8184, 0.9642, 1.1127, + 1.2556, 1.3976, 1.5405, 1.6940, 1.8375, 1.9888, 2.1377, 2.2980, + 2.4555, 2.6184, 2.7849, 2.9452, 0.0888, 0.2005, 0.2847, 0.4322, + 0.5763, 0.7577, 0.9262, 1.1095, 1.2719, 1.4331, 1.5843, 1.7452, + 1.8845, 2.0385, 2.1805, 2.3345, 2.4750, 2.6217, 2.7555, 2.9013, + 0.1713, 0.2617, 0.3868, 0.5859, 0.7073, 0.8535, 1.0593, 1.1778, + 1.3109, 1.4508, 1.5910, 1.7463, 1.8911, 2.0651, 2.2035, 2.3355, + 2.4947, 2.6440, 2.7424, 2.8943, 0.1346, 0.2549, 0.4089, 0.5488, + 0.6949, 0.8394, 0.9810, 1.1145, 1.2528, 1.4044, 1.5423, 1.6872, + 1.8274, 1.9726, 2.1403, 2.2809, 2.4128, 2.5564, 2.6887, 2.8895, + 0.0776, 0.1621, 0.2553, 0.4191, 0.5988, 0.7921, 0.9651, 1.1350, + 1.2930, 1.4475, 1.6011, 1.7585, 1.9068, 2.0638, 2.2102, 2.3594, + 2.5096, 2.6581, 2.8099, 2.9654, 0.0864, 0.1778, 0.2854, 0.4235, + 0.5568, 0.7220, 0.8963, 1.0609, 1.2217, 1.3830, 1.5422, 1.7018, + 1.8551, 2.0206, 2.1783, 2.3328, 2.4869, 2.6366, 2.7923, 2.9539, + 0.1144, 0.2576, 0.4186, 0.5594, 0.6875, 0.8221, 0.9598, 1.0944, + 1.2273, 1.3713, 1.5152, 1.6628, 1.8070, 1.9525, 2.0965, 2.2535, + 2.4132, 2.5725, 2.7250, 2.9150, 0.1079, 0.2221, 0.3334, 0.4845, + 0.6083, 0.7516, 0.9018, 1.0594, 1.2060, 1.3673, 1.5212, 1.6880, + 1.8208, 1.9831, 2.1269, 2.2909, 2.4366, 2.6027, 2.7339, 2.8924, + 0.0994, 0.2233, 0.3634, 0.5145, 0.6568, 0.8131, 0.9746, 1.1296, + 1.2666, 1.4116, 1.5748, 1.7264, 1.8649, 2.0217, 2.1716, 2.3293, + 2.4900, 2.6455, 2.7818, 2.9362, 0.1120, 0.2079, 0.3128, 0.4124, + 0.5291, 0.6816, 0.8478, 1.0150, 1.1772, 1.3456, 1.5208, 1.6882, + 1.8458, 2.0078, 2.1627, 2.3198, 2.4733, 2.6251, 2.7796, 2.9489, + 0.0853, 0.2030, 0.3669, 0.5326, 0.6678, 0.8086, 0.9526, 1.1142, + 1.2551, 1.4158, 1.5694, 1.7073, 1.8431, 1.9686, 2.1153, 2.2376, + 2.3686, 2.5591, 2.7320, 2.9104, 0.0905, 0.2166, 0.3539, 0.5201, + 0.6700, 0.8346, 0.9883, 1.1457, 1.2714, 1.3845, 1.5172, 1.6688, + 1.8008, 1.9535, 2.1019, 2.2708, 2.4135, 2.5974, 2.7486, 2.9033, + 0.0084, 0.0374, 0.0164, -0.0153, 0.0288, 0.0107, -0.0255, -0.0242, + 0.0000, -0.0055, -0.0081, -0.0075, -0.0022, -0.0052, -0.0069, -0.0017, + 0.0003, 0.0091, 0.0028, -0.0027, 0.0085, 0.0043, -0.0235, -0.0411, + 0.0202, 0.0359, 0.0376, 0.0321, 0.0306, -0.0358, -0.0276, -0.0090, + 0.0032, 0.0048, 0.0309, 0.0332, 0.0284, 0.0237, 0.0051, -0.0101, + -0.0233, -0.0428, -0.0585, -0.0387, 0.0039, 0.0081, 0.0029, -0.0017, + -0.0006, -0.0068, 0.0044, 0.0182, 0.0376, 0.0387, -0.0334, -0.0269, + -0.0182, -0.0069, -0.0026, 0.0035, -0.0049, -0.0212, -0.0408, -0.0245, + 0.0186, 0.0189, 0.0153, 0.0120, 0.0157, 0.0055, -0.0046, 0.0179, + 0.0284, -0.0032, -0.0261, -0.0205, -0.0039, 0.0174, 0.0299, 0.0207, + 0.0012, -0.0056, 0.0010, 0.0141, -0.0119, 0.0190, 0.0315, 0.0033, + -0.0128, 0.0300, 0.0328, 0.0308, 0.0353, 0.0266, 0.0066, -0.0328, + -0.0273, 0.0054, 0.0145, 0.0175, 0.0015, -0.0171, 0.0062, -0.0164, + 0.0045, -0.0071, 0.0025, 0.0278, 0.0283, 0.0117, -0.0026, -0.0285, + -0.0408, -0.0366, -0.0059, -0.0208, -0.0354, -0.0334, -0.0263, -0.0064, + 0.0072, -0.0006, -0.0235, -0.0037, -0.0307, -0.0294, -0.0163, -0.0197, + -0.0235, 0.0192, 0.0013, -0.0219, -0.0123, -0.0004, -0.0081, -0.0096, + -0.0123, -0.0101, 0.0021, 0.0151, 0.0106, 0.0151, 0.0292, 0.0033, + 0.0283, 0.0124, 0.0058, -0.0017, -0.0038, 0.0152, 0.0141, 0.0132, + 0.0178, 0.0157, 0.0073, 0.0176, 0.0141, 0.0097, -0.0092, -0.0163, + -0.0230, -0.0134, -0.0099, -0.0147, 0.0040, -0.0183, -0.0175, -0.0080, + -0.0083, -0.0290, -0.0417, -0.0398, -0.0269, -0.0199, -0.0143, -0.0053, + -0.0099, -0.0054, -0.0199, -0.0219, -0.0170, 0.0107, 0.0194, 0.0035, + 0.0437, 0.0406, 0.0215, 0.0120, 0.0053, -0.0028, 0.0238, 0.0337, + 0.0217, 0.0011, 0.0227, 0.0244, 0.0327, 0.0378, 0.0437, 0.0356, + -0.0033, 0.0113, 0.0407, 0.0334, -0.0125, -0.0003, -0.0141, -0.0273, + -0.0137, -0.0079, -0.0145, -0.0071, 0.0114, 0.0181, 0.0150, 0.0085, + -0.0077, -0.0038, -0.0219, -0.0263, -0.0187, -0.0233, 0.0133, 0.0265, + -0.0156, -0.0091, -0.0110, -0.0016, 0.0143, 0.0177, 0.0240, 0.0082, + -0.0143, -0.0257, -0.0014, 0.0002, 0.0082, 0.0180, 0.0325, 0.0340, + -0.0153, -0.0389, -0.0240, 0.0082, 0.0140, 0.0046, -0.0138, -0.0378, + -0.0366, 0.0297, 0.0252, 0.0078, 0.0063, 0.0006, 0.0044, 0.0074, + 0.0094, 0.0113, 0.0105, 0.0137, 0.0438, 0.0262, -0.0078, -0.0185, + -0.0215, -0.0407, -0.0435, -0.0208, -0.0004, -0.0144, -0.0205, -0.0248, + -0.0159, -0.0069, -0.0153, 0.0132, 0.0355, 0.0298, 0.0120, 0.0072, + 0.0236, 0.0526, 0.0479, 0.0233, -0.0133, -0.0283, -0.0468, -0.0549, + -0.0370, 0.0032, 0.0056, 0.0023, 0.0050, 0.0024, 0.0279, 0.0116, + -0.0045, -0.0012, 0.0107, 0.0190, 0.0253, 0.0191, 0.0043, 0.0193, + -0.0348, -0.0246, 0.0123, 0.0210, 0.0135, -0.0096, -0.0109, -0.0076, + -0.0156, -0.0290, 0.0160, 0.0194, 0.0219, 0.0259, 0.0250, 0.0195, + 0.4948, 0.4961, 0.4940, 0.4878, 0.4849, 0.4727, 0.4571, 0.4551, + 0.4534, 0.4468, 0.4412, 0.4354, 0.4298, 0.4272, 0.4498, 0.4506, + 0.4560, 0.4592, 0.4758, 0.4941, 0.2476, 0.1771, 0.1974, 0.1881, + 0.1667, 0.1826, 0.2067, 0.2031, 0.1734, 0.1534, 0.1415, 0.1761, + 0.1897, 0.1772, 0.1651, 0.1247, 0.1041, 0.1231, 0.1809, 0.2234, +}; + +#endif /* AVCODEC_METASOUND_TWINVQ_DATA_H */ diff --git a/include/libavcodec/mf_utils.h b/include/libavcodec/mf_utils.h new file mode 100644 index 0000000..387c005 --- /dev/null +++ b/include/libavcodec/mf_utils.h @@ -0,0 +1,186 @@ +/* + * 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_MF_UTILS_H +#define AVCODEC_MF_UTILS_H + +#include +#include +#ifdef _MSC_VER +// The official way of including codecapi (via dshow.h) makes the ICodecAPI +// interface unavailable in UWP mode, but including icodecapi.h + codecapi.h +// seems to be equivalent. (These headers conflict with the official way +// of including it though, through strmif.h via dshow.h. And on mingw, the +// mf*.h headers below indirectly include strmif.h.) +#include +#else +#define NO_DSHOW_STRSAFE +#include +// Older versions of mingw-w64 need codecapi.h explicitly included, while newer +// ones include it implicitly from dshow.h (via uuids.h). +#include +#endif +#include +#include +#include +#include + +#include "avcodec.h" + +// Windows N editions does not provide MediaFoundation by default. +// So to avoid DLL loading error, MediaFoundation will be dynamically loaded +// except on UWP build since LoadLibrary is not available on it. +typedef struct MFFunctions { + HRESULT (WINAPI *MFStartup) (ULONG Version, DWORD dwFlags); + HRESULT (WINAPI *MFShutdown) (void); + HRESULT (WINAPI *MFCreateAlignedMemoryBuffer) (DWORD cbMaxLength, + DWORD cbAligment, + IMFMediaBuffer **ppBuffer); + HRESULT (WINAPI *MFCreateSample) (IMFSample **ppIMFSample); + HRESULT (WINAPI *MFCreateMediaType) (IMFMediaType **ppMFType); + // MFTEnumEx is missing in Windows Vista's mfplat.dll. + HRESULT (WINAPI *MFTEnumEx)(GUID guidCategory, UINT32 Flags, + const MFT_REGISTER_TYPE_INFO *pInputType, + const MFT_REGISTER_TYPE_INFO *pOutputType, + IMFActivate ***pppMFTActivate, + UINT32 *pnumMFTActivate); +} MFFunctions; + +// These functions do exist in mfapi.h, but are only available within +// __cplusplus ifdefs. +HRESULT ff_MFGetAttributeSize(IMFAttributes *pattr, REFGUID guid, + UINT32 *pw, UINT32 *ph); +HRESULT ff_MFSetAttributeSize(IMFAttributes *pattr, REFGUID guid, + UINT32 uw, UINT32 uh); +#define ff_MFSetAttributeRatio ff_MFSetAttributeSize +#define ff_MFGetAttributeRatio ff_MFGetAttributeSize + +// These do exist in mingw-w64's codecapi.h, but they aren't properly defined +// by the header until after mingw-w64 v7.0.0. +DEFINE_GUID(ff_CODECAPI_AVDecVideoThumbnailGenerationMode, 0x2efd8eee,0x1150,0x4328,0x9c,0xf5,0x66,0xdc,0xe9,0x33,0xfc,0xf4); +DEFINE_GUID(ff_CODECAPI_AVDecVideoDropPicWithMissingRef, 0xf8226383,0x14c2,0x4567,0x97,0x34,0x50,0x04,0xe9,0x6f,0xf8,0x87); +DEFINE_GUID(ff_CODECAPI_AVDecVideoSoftwareDeinterlaceMode, 0x0c08d1ce,0x9ced,0x4540,0xba,0xe3,0xce,0xb3,0x80,0x14,0x11,0x09); +DEFINE_GUID(ff_CODECAPI_AVDecVideoFastDecodeMode, 0x6b529f7d,0xd3b1,0x49c6,0xa9,0x99,0x9e,0xc6,0x91,0x1b,0xed,0xbf); +DEFINE_GUID(ff_CODECAPI_AVLowLatencyMode, 0x9c27891a,0xed7a,0x40e1,0x88,0xe8,0xb2,0x27,0x27,0xa0,0x24,0xee); +DEFINE_GUID(ff_CODECAPI_AVDecVideoH264ErrorConcealment, 0xececace8,0x3436,0x462c,0x92,0x94,0xcd,0x7b,0xac,0xd7,0x58,0xa9); +DEFINE_GUID(ff_CODECAPI_AVDecVideoMPEG2ErrorConcealment, 0x9d2bfe18,0x728d,0x48d2,0xb3,0x58,0xbc,0x7e,0x43,0x6c,0x66,0x74); +DEFINE_GUID(ff_CODECAPI_AVDecVideoCodecType, 0x434528e5,0x21f0,0x46b6,0xb6,0x2c,0x9b,0x1b,0x6b,0x65,0x8c,0xd1); +DEFINE_GUID(ff_CODECAPI_AVDecVideoDXVAMode, 0xf758f09e,0x7337,0x4ae7,0x83,0x87,0x73,0xdc,0x2d,0x54,0xe6,0x7d); +DEFINE_GUID(ff_CODECAPI_AVDecVideoDXVABusEncryption, 0x42153c8b,0xfd0b,0x4765,0xa4,0x62,0xdd,0xd9,0xe8,0xbc,0xc3,0x88); +DEFINE_GUID(ff_CODECAPI_AVDecVideoSWPowerLevel, 0xfb5d2347,0x4dd8,0x4509,0xae,0xd0,0xdb,0x5f,0xa9,0xaa,0x93,0xf4); +DEFINE_GUID(ff_CODECAPI_AVDecVideoMaxCodedWidth, 0x5ae557b8,0x77af,0x41f5,0x9f,0xa6,0x4d,0xb2,0xfe,0x1d,0x4b,0xca); +DEFINE_GUID(ff_CODECAPI_AVDecVideoMaxCodedHeight, 0x7262a16a,0xd2dc,0x4e75,0x9b,0xa8,0x65,0xc0,0xc6,0xd3,0x2b,0x13); +DEFINE_GUID(ff_CODECAPI_AVDecNumWorkerThreads, 0x9561c3e8,0xea9e,0x4435,0x9b,0x1e,0xa9,0x3e,0x69,0x18,0x94,0xd8); +DEFINE_GUID(ff_CODECAPI_AVDecSoftwareDynamicFormatChange, 0x862e2f0a,0x507b,0x47ff,0xaf,0x47,0x01,0xe2,0x62,0x42,0x98,0xb7); +DEFINE_GUID(ff_CODECAPI_AVDecDisableVideoPostProcessing, 0xf8749193,0x667a,0x4f2c,0xa9,0xe8,0x5d,0x4a,0xf9,0x24,0xf0,0x8f); + +// These are missing from mingw-w64's headers until after mingw-w64 v7.0.0. +DEFINE_GUID(ff_CODECAPI_AVEncCommonRateControlMode, 0x1c0608e9, 0x370c, 0x4710, 0x8a, 0x58, 0xcb, 0x61, 0x81, 0xc4, 0x24, 0x23); +DEFINE_GUID(ff_CODECAPI_AVEncCommonQuality, 0xfcbf57a3, 0x7ea5, 0x4b0c, 0x96, 0x44, 0x69, 0xb4, 0x0c, 0x39, 0xc3, 0x91); +DEFINE_GUID(ff_CODECAPI_AVEncCommonMeanBitRate, 0xf7222374, 0x2144, 0x4815, 0xb5, 0x50, 0xa3, 0x7f, 0x8e, 0x12, 0xee, 0x52); +DEFINE_GUID(ff_CODECAPI_AVEncH264CABACEnable, 0xee6cad62, 0xd305, 0x4248, 0xa5, 0xe, 0xe1, 0xb2, 0x55, 0xf7, 0xca, 0xf8); +DEFINE_GUID(ff_CODECAPI_AVEncVideoForceKeyFrame, 0x398c1b98, 0x8353, 0x475a, 0x9e, 0xf2, 0x8f, 0x26, 0x5d, 0x26, 0x3, 0x45); +DEFINE_GUID(ff_CODECAPI_AVEncMPVDefaultBPictureCount, 0x8d390aac, 0xdc5c, 0x4200, 0xb5, 0x7f, 0x81, 0x4d, 0x04, 0xba, 0xba, 0xb2); +DEFINE_GUID(ff_CODECAPI_AVScenarioInfo, 0xb28a6e64,0x3ff9,0x446a,0x8a,0x4b,0x0d,0x7a,0x53,0x41,0x32,0x36); +DEFINE_GUID(ff_CODECAPI_AVEncCommonBufferSize, 0x0db96574, 0xb6a4, 0x4c8b, 0x81, 0x06, 0x37, 0x73, 0xde, 0x03, 0x10, 0xcd); +DEFINE_GUID(ff_CODECAPI_AVEncCommonMaxBitRate, 0x9651eae4, 0x39b9, 0x4ebf, 0x85, 0xef, 0xd7, 0xf4, 0x44, 0xec, 0x74, 0x65); +DEFINE_GUID(ff_CODECAPI_AVEncCommonQualityVsSpeed, 0x98332df8, 0x03cd, 0x476b, 0x89, 0xfa, 0x3f, 0x9e, 0x44, 0x2d, 0xec, 0x9f); +DEFINE_GUID(ff_CODECAPI_AVEncMPVGOPSize, 0x95f31b26, 0x95a4, 0x41aa, 0x93, 0x03, 0x24, 0x6a, 0x7f, 0xc6, 0xee, 0xf1); +DEFINE_GUID(ff_CODECAPI_AVEncVideoEncodeQP, 0x2cb5696b, 0x23fb, 0x4ce1, 0xa0, 0xf9, 0xef, 0x5b, 0x90, 0xfd, 0x55, 0xca); + +DEFINE_GUID(ff_MF_SA_D3D11_BINDFLAGS, 0xeacf97ad, 0x065c, 0x4408, 0xbe, 0xe3, 0xfd, 0xcb, 0xfd, 0x12, 0x8b, 0xe2); +DEFINE_GUID(ff_MF_SA_D3D11_USAGE, 0xe85fe442, 0x2ca3, 0x486e, 0xa9, 0xc7, 0x10, 0x9d, 0xda, 0x60, 0x98, 0x80); +DEFINE_GUID(ff_MF_SA_D3D11_AWARE, 0x206b4fc8, 0xfcf9, 0x4c51, 0xaf, 0xe3, 0x97, 0x64, 0x36, 0x9e, 0x33, 0xa0); +DEFINE_GUID(ff_MF_SA_D3D11_SHARED, 0x7b8f32c3, 0x6d96, 0x4b89, 0x92, 0x3, 0xdd, 0x38, 0xb6, 0x14, 0x14, 0xf3); +DEFINE_GUID(ff_MF_SA_D3D11_SHARED_WITHOUT_MUTEX, 0x39dbd44d, 0x2e44, 0x4931, 0xa4, 0xc8, 0x35, 0x2d, 0x3d, 0xc4, 0x21, 0x15); +DEFINE_GUID(ff_MF_SA_MINIMUM_OUTPUT_SAMPLE_COUNT, 0x851745d5, 0xc3d6, 0x476d, 0x95, 0x27, 0x49, 0x8e, 0xf2, 0xd1, 0xd, 0x18); +DEFINE_GUID(ff_MF_SA_MINIMUM_OUTPUT_SAMPLE_COUNT_PROGRESSIVE, 0xf5523a5, 0x1cb2, 0x47c5, 0xa5, 0x50, 0x2e, 0xeb, 0x84, 0xb4, 0xd1, 0x4a); + +DEFINE_MEDIATYPE_GUID(ff_MFVideoFormat_HEVC, 0x43564548); // FCC('HEVC') +DEFINE_MEDIATYPE_GUID(ff_MFVideoFormat_HEVC_ES, 0x53564548); // FCC('HEVS') + + +// This enum is missing from mingw-w64's codecapi.h by v7.0.0. +enum ff_eAVEncCommonRateControlMode { + ff_eAVEncCommonRateControlMode_CBR = 0, + ff_eAVEncCommonRateControlMode_PeakConstrainedVBR = 1, + ff_eAVEncCommonRateControlMode_UnconstrainedVBR = 2, + ff_eAVEncCommonRateControlMode_Quality = 3, + ff_eAVEncCommonRateControlMode_LowDelayVBR = 4, + ff_eAVEncCommonRateControlMode_GlobalVBR = 5, + ff_eAVEncCommonRateControlMode_GlobalLowDelayVBR = 6 +}; + +enum ff_eAVScenarioInfo { + ff_eAVScenarioInfo_Unknown = 0, + ff_eAVScenarioInfo_DisplayRemoting = 1, + ff_eAVScenarioInfo_VideoConference = 2, + ff_eAVScenarioInfo_Archive = 3, + ff_eAVScenarioInfo_LiveStreaming = 4, + ff_eAVScenarioInfo_CameraRecord = 5, + ff_eAVScenarioInfo_DisplayRemotingWithFeatureMap = 6 +}; + +// These do exist in mingw-w64's mfobjects.idl, but are missing from +// mfobjects.h that is generated from the former, due to incorrect use of +// ifdefs in the IDL file. +enum { + ff_METransformUnknown = 600, + ff_METransformNeedInput, + ff_METransformHaveOutput, + ff_METransformDrainComplete, + ff_METransformMarker, +}; + +// These do exist in all supported headers, but are manually defined here +// to avoid having to include codecapi.h, as there's problems including that +// header when targeting UWP (where including it with MSVC seems to work, +// but fails when built with clang in MSVC mode). +enum ff_eAVEncH264VProfile { + ff_eAVEncH264VProfile_Base = 66, + ff_eAVEncH264VProfile_Main = 77, + ff_eAVEncH264VProfile_High = 100, +}; + +char *ff_hr_str_buf(char *buf, size_t size, HRESULT hr); +#define ff_hr_str(hr) ff_hr_str_buf((char[80]){0}, 80, hr) + +// Possibly compiler-dependent; the MS/MinGW definition for this is just crazy. +#define FF_VARIANT_VALUE(type, contents) &(VARIANT){ .vt = (type), contents } + +#define FF_VAL_VT_UI4(v) FF_VARIANT_VALUE(VT_UI4, .ulVal = (v)) +#define FF_VAL_VT_BOOL(v) FF_VARIANT_VALUE(VT_BOOL, .boolVal = (v)) + +IMFSample *ff_create_memory_sample(MFFunctions *f, void *fill_data, + size_t size, size_t align); +enum AVSampleFormat ff_media_type_to_sample_fmt(IMFAttributes *type); +enum AVPixelFormat ff_media_type_to_pix_fmt(IMFAttributes *type); +const GUID *ff_pix_fmt_to_guid(enum AVPixelFormat pix_fmt); +int ff_fourcc_from_guid(const GUID *guid, uint32_t *out_fourcc); +char *ff_guid_str_buf(char *buf, size_t buf_size, const GUID *guid); +#define ff_guid_str(guid) ff_guid_str_buf((char[80]){0}, 80, guid) +void ff_attributes_dump(void *log, IMFAttributes *attrs); +void ff_media_type_dump(void *log, IMFMediaType *type); +const CLSID *ff_codec_to_mf_subtype(enum AVCodecID codec); +int ff_instantiate_mf(void *log, MFFunctions *f, GUID category, + MFT_REGISTER_TYPE_INFO *in_type, + MFT_REGISTER_TYPE_INFO *out_type, + int use_hw, IMFTransform **res); +void ff_free_mf(MFFunctions *f, IMFTransform **mft); + +#endif diff --git a/include/libavcodec/mjpeg.h b/include/libavcodec/mjpeg.h new file mode 100644 index 0000000..cd5d0af --- /dev/null +++ b/include/libavcodec/mjpeg.h @@ -0,0 +1,131 @@ +/* + * MJPEG encoder and decoder + * Copyright (c) 2000, 2001 Fabrice Bellard + * Copyright (c) 2003 Alex Beregszaszi + * Copyright (c) 2003-2004 Michael Niedermayer + * + * Support for external huffman table, various fixes (AVID workaround), + * aspecting, new decode_frame mechanism and apple mjpeg-b support + * by Alex Beregszaszi + * + * 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 + */ + +/** + * @file + * MJPEG encoder and decoder. + */ + +#ifndef AVCODEC_MJPEG_H +#define AVCODEC_MJPEG_H + +/* JPEG marker codes */ +enum JpegMarker { + /* start of frame */ + SOF0 = 0xc0, /* baseline */ + SOF1 = 0xc1, /* extended sequential, huffman */ + SOF2 = 0xc2, /* progressive, huffman */ + SOF3 = 0xc3, /* lossless, huffman */ + + SOF5 = 0xc5, /* differential sequential, huffman */ + SOF6 = 0xc6, /* differential progressive, huffman */ + SOF7 = 0xc7, /* differential lossless, huffman */ + JPG = 0xc8, /* reserved for JPEG extension */ + SOF9 = 0xc9, /* extended sequential, arithmetic */ + SOF10 = 0xca, /* progressive, arithmetic */ + SOF11 = 0xcb, /* lossless, arithmetic */ + + SOF13 = 0xcd, /* differential sequential, arithmetic */ + SOF14 = 0xce, /* differential progressive, arithmetic */ + SOF15 = 0xcf, /* differential lossless, arithmetic */ + + DHT = 0xc4, /* define huffman tables */ + + DAC = 0xcc, /* define arithmetic-coding conditioning */ + + /* restart with modulo 8 count "m" */ + RST0 = 0xd0, + RST1 = 0xd1, + RST2 = 0xd2, + RST3 = 0xd3, + RST4 = 0xd4, + RST5 = 0xd5, + RST6 = 0xd6, + RST7 = 0xd7, + + SOI = 0xd8, /* start of image */ + EOI = 0xd9, /* end of image */ + SOS = 0xda, /* start of scan */ + DQT = 0xdb, /* define quantization tables */ + DNL = 0xdc, /* define number of lines */ + DRI = 0xdd, /* define restart interval */ + DHP = 0xde, /* define hierarchical progression */ + EXP = 0xdf, /* expand reference components */ + + APP0 = 0xe0, + APP1 = 0xe1, + APP2 = 0xe2, + APP3 = 0xe3, + APP4 = 0xe4, + APP5 = 0xe5, + APP6 = 0xe6, + APP7 = 0xe7, + APP8 = 0xe8, + APP9 = 0xe9, + APP10 = 0xea, + APP11 = 0xeb, + APP12 = 0xec, + APP13 = 0xed, + APP14 = 0xee, + APP15 = 0xef, + + JPG0 = 0xf0, + JPG1 = 0xf1, + JPG2 = 0xf2, + JPG3 = 0xf3, + JPG4 = 0xf4, + JPG5 = 0xf5, + JPG6 = 0xf6, + SOF48 = 0xf7, ///< JPEG-LS + LSE = 0xf8, ///< JPEG-LS extension parameters + JPG9 = 0xf9, + JPG10 = 0xfa, + JPG11 = 0xfb, + JPG12 = 0xfc, + JPG13 = 0xfd, + + COM = 0xfe, /* comment */ + + TEM = 0x01, /* temporary private use for arithmetic coding */ + + /* 0x02 -> 0xbf reserved */ +}; + +#define PREDICT(ret, topleft, top, left, predictor)\ + switch(predictor){\ + case 0: ret= 0; break;\ + case 1: ret= left; break;\ + case 2: ret= top; break;\ + case 3: ret= topleft; break;\ + case 4: ret= left + top - topleft; break;\ + case 5: ret= left + ((top - topleft)>>1); break;\ + case 6: ret= top + ((left - topleft)>>1); break;\ + default:\ + case 7: ret= (left + top)>>1; break;\ + } + +#endif /* AVCODEC_MJPEG_H */ diff --git a/include/libavcodec/mjpegdec.h b/include/libavcodec/mjpegdec.h new file mode 100644 index 0000000..13c524d --- /dev/null +++ b/include/libavcodec/mjpegdec.h @@ -0,0 +1,190 @@ +/* + * MJPEG decoder + * Copyright (c) 2000, 2001 Fabrice Bellard + * Copyright (c) 2003 Alex Beregszaszi + * Copyright (c) 2003-2004 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * MJPEG decoder. + */ + +#ifndef AVCODEC_MJPEGDEC_H +#define AVCODEC_MJPEGDEC_H + +#include "libavutil/log.h" +#include "libavutil/mem_internal.h" +#include "libavutil/pixdesc.h" +#include "libavutil/stereo3d.h" + +#include "avcodec.h" +#include "blockdsp.h" +#include "get_bits.h" +#include "hpeldsp.h" +#include "idctdsp.h" + +#undef near /* This file uses struct member 'near' which in windows.h is defined as empty. */ + +#define MAX_COMPONENTS 4 + +typedef struct ICCEntry { + uint8_t *data; + int length; +} ICCEntry; + +struct JLSState; + +typedef struct MJpegDecodeContext { + AVClass *class; + AVCodecContext *avctx; + GetBitContext gb; + int buf_size; + + int start_code; /* current start code */ + int buffer_size; + uint8_t *buffer; + + uint16_t quant_matrixes[4][64]; + VLC vlcs[3][4]; + int qscale[4]; ///< quantizer scale calculated from quant_matrixes + + int orig_height; /* size given at codec init */ + int first_picture; /* true if decoding first picture */ + int interlaced; /* true if interlaced */ + int bottom_field; /* true if bottom field */ + int lossless; + int ls; + int progressive; + int bayer; /* true if it's a bayer-encoded JPEG embedded in a DNG */ + int rgb; + uint8_t upscale_h[4]; + uint8_t upscale_v[4]; + int rct; /* standard rct */ + int pegasus_rct; /* pegasus reversible colorspace transform */ + int bits; /* bits per component */ + int colr; + int xfrm; + int adobe_transform; + + int maxval; + int near; ///< near lossless bound (si 0 for lossless) + int t1,t2,t3; + int reset; ///< context halfing interval ?rename + + int width, height; + int mb_width, mb_height; + int nb_components; + int block_stride[MAX_COMPONENTS]; + int component_id[MAX_COMPONENTS]; + int h_count[MAX_COMPONENTS]; /* horizontal and vertical count for each component */ + int v_count[MAX_COMPONENTS]; + int comp_index[MAX_COMPONENTS]; + int dc_index[MAX_COMPONENTS]; + int ac_index[MAX_COMPONENTS]; + int nb_blocks[MAX_COMPONENTS]; + int h_scount[MAX_COMPONENTS]; + int v_scount[MAX_COMPONENTS]; + int quant_sindex[MAX_COMPONENTS]; + int h_max, v_max; /* maximum h and v counts */ + int quant_index[4]; /* quant table index for each component */ + int last_dc[MAX_COMPONENTS]; /* last DEQUANTIZED dc (XXX: am I right to do that ?) */ + AVFrame *picture; /* picture structure */ + AVFrame *picture_ptr; /* pointer to picture structure */ + int got_picture; ///< we found a SOF and picture is valid, too. + int linesize[MAX_COMPONENTS]; ///< linesize << interlaced + int8_t *qscale_table; + DECLARE_ALIGNED(32, int16_t, block)[64]; + int16_t (*blocks[MAX_COMPONENTS])[64]; ///< intermediate sums (progressive mode) + uint8_t *last_nnz[MAX_COMPONENTS]; + uint64_t coefs_finished[MAX_COMPONENTS]; ///< bitmask of which coefs have been completely decoded (progressive mode) + int palette_index; + int force_pal8; + uint8_t permutated_scantable[64]; + BlockDSPContext bdsp; + HpelDSPContext hdsp; + IDCTDSPContext idsp; + + int restart_interval; + int restart_count; + + int buggy_avid; + int cs_itu601; + int interlace_polarity; + int multiscope; + + int mjpb_skiptosod; + + int cur_scan; /* current scan, used by JPEG-LS */ + int flipped; /* true if picture is flipped */ + + uint16_t (*ljpeg_buffer)[4]; + unsigned int ljpeg_buffer_size; + + int extern_huff; + AVDictionary *exif_metadata; + + AVStereo3D *stereo3d; ///!< stereoscopic information (cached, since it is read before frame allocation) + + const AVPixFmtDescriptor *pix_desc; + + ICCEntry *iccentries; + int iccnum; + int iccread; + + AVFrame *smv_frame; + int smv_frames_per_jpeg; + int smv_next_frame; + + // Raw stream data for hwaccel use. + const uint8_t *raw_image_buffer; + size_t raw_image_buffer_size; + const uint8_t *raw_scan_buffer; + size_t raw_scan_buffer_size; + + uint8_t raw_huffman_lengths[2][4][16]; + uint8_t raw_huffman_values[2][4][256]; + + enum AVPixelFormat hwaccel_sw_pix_fmt; + enum AVPixelFormat hwaccel_pix_fmt; + void *hwaccel_picture_private; + struct JLSState *jls_state; +} MJpegDecodeContext; + +int ff_mjpeg_build_vlc(VLC *vlc, const uint8_t *bits_table, + const uint8_t *val_table, int is_ac, void *logctx); +int ff_mjpeg_decode_init(AVCodecContext *avctx); +int ff_mjpeg_decode_end(AVCodecContext *avctx); +int ff_mjpeg_decode_frame(AVCodecContext *avctx, + AVFrame *frame, int *got_frame, + AVPacket *avpkt); +int ff_mjpeg_decode_frame_from_buf(AVCodecContext *avctx, + AVFrame *frame, int *got_frame, + const AVPacket *avpkt, const uint8_t *buf, int buf_size); +int ff_mjpeg_decode_dqt(MJpegDecodeContext *s); +int ff_mjpeg_decode_dht(MJpegDecodeContext *s); +int ff_mjpeg_decode_sof(MJpegDecodeContext *s); +int ff_mjpeg_decode_sos(MJpegDecodeContext *s, + const uint8_t *mb_bitmask,int mb_bitmask_size, + const AVFrame *reference); +int ff_mjpeg_find_marker(MJpegDecodeContext *s, + const uint8_t **buf_ptr, const uint8_t *buf_end, + const uint8_t **unescaped_buf_ptr, int *unescaped_buf_size); + +#endif /* AVCODEC_MJPEGDEC_H */ diff --git a/include/libavcodec/mjpegenc.h b/include/libavcodec/mjpegenc.h new file mode 100644 index 0000000..a593b67 --- /dev/null +++ b/include/libavcodec/mjpegenc.h @@ -0,0 +1,115 @@ +/* + * MJPEG encoder + * Copyright (c) 2000, 2001 Fabrice Bellard + * Copyright (c) 2003 Alex Beregszaszi + * Copyright (c) 2003-2004 Michael Niedermayer + * + * Support for external huffman table, various fixes (AVID workaround), + * aspecting, new decode_frame mechanism and apple mjpeg-b support + * by Alex Beregszaszi + * + * 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 + */ + +/** + * @file + * MJPEG encoder. + */ + +#ifndef AVCODEC_MJPEGENC_H +#define AVCODEC_MJPEGENC_H + +#include + +#include "mjpeg.h" +#include "mpegvideo.h" +#include "put_bits.h" + +/** + * Buffer of JPEG frame data. + * + * Optimal Huffman table generation requires the frame data to be loaded into + * a buffer so that the tables can be computed. + * There are at most mb_width*mb_height*12*64 of these per frame. + */ +typedef struct MJpegHuffmanCode { + // 0=DC lum, 1=DC chrom, 2=AC lum, 3=AC chrom + uint8_t table_id; ///< The Huffman table id associated with the data. + uint8_t code; ///< The exponent. + uint16_t mant; ///< The mantissa. +} MJpegHuffmanCode; + +/** + * Holds JPEG frame data and Huffman table data. + */ +typedef struct MJpegContext { + int huffman; + /* Force duplication of mjpeg matrices, useful for rtp streaming */ + int force_duplicated_matrix; + //FIXME use array [3] instead of lumi / chroma, for easier addressing + uint8_t huff_size_dc_luminance[12]; ///< DC luminance Huffman table size. + uint16_t huff_code_dc_luminance[12]; ///< DC luminance Huffman table codes. + uint8_t huff_size_dc_chrominance[12]; ///< DC chrominance Huffman table size. + uint16_t huff_code_dc_chrominance[12]; ///< DC chrominance Huffman table codes. + + uint8_t huff_size_ac_luminance[256]; ///< AC luminance Huffman table size. + uint16_t huff_code_ac_luminance[256]; ///< AC luminance Huffman table codes. + uint8_t huff_size_ac_chrominance[256]; ///< AC chrominance Huffman table size. + uint16_t huff_code_ac_chrominance[256]; ///< AC chrominance Huffman table codes. + + /** Storage for AC luminance VLC (in MpegEncContext) */ + uint8_t uni_ac_vlc_len[64 * 64 * 2]; + /** Storage for AC chrominance VLC (in MpegEncContext) */ + uint8_t uni_chroma_ac_vlc_len[64 * 64 * 2]; + + // Default DC tables have exactly 12 values + uint8_t bits_dc_luminance[17]; ///< DC luminance Huffman bits. + uint8_t val_dc_luminance[12]; ///< DC luminance Huffman values. + uint8_t bits_dc_chrominance[17]; ///< DC chrominance Huffman bits. + uint8_t val_dc_chrominance[12]; ///< DC chrominance Huffman values. + + // 8-bit JPEG has max 256 values + uint8_t bits_ac_luminance[17]; ///< AC luminance Huffman bits. + uint8_t val_ac_luminance[256]; ///< AC luminance Huffman values. + uint8_t bits_ac_chrominance[17]; ///< AC chrominance Huffman bits. + uint8_t val_ac_chrominance[256]; ///< AC chrominance Huffman values. + + size_t huff_ncode; ///< Number of current entries in the buffer. + MJpegHuffmanCode *huff_buffer; ///< Buffer for Huffman code values. +} MJpegContext; + +/** + * Enum for the Huffman encoding strategy. + */ +enum HuffmanTableOption { + HUFFMAN_TABLE_DEFAULT = 0, ///< Use the default Huffman tables. + HUFFMAN_TABLE_OPTIMAL = 1, ///< Compute and use optimal Huffman tables. + NB_HUFFMAN_TABLE_OPTION = 2 +}; + +static inline void put_marker(PutBitContext *p, enum JpegMarker code) +{ + put_bits(p, 8, 0xff); + put_bits(p, 8, code); +} + +int ff_mjpeg_encode_init(MpegEncContext *s); +void ff_mjpeg_amv_encode_picture_header(MpegEncContext *s); +void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[12][64]); +int ff_mjpeg_encode_stuffing(MpegEncContext *s); + +#endif /* AVCODEC_MJPEGENC_H */ diff --git a/include/libavcodec/mjpegenc_common.h b/include/libavcodec/mjpegenc_common.h new file mode 100644 index 0000000..e9f0ea4 --- /dev/null +++ b/include/libavcodec/mjpegenc_common.h @@ -0,0 +1,52 @@ +/* + * lossless JPEG shared bits + * + * 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_MJPEGENC_COMMON_H +#define AVCODEC_MJPEGENC_COMMON_H + +#include + +#include "avcodec.h" +#include "put_bits.h" + +struct MJpegContext; + +int ff_mjpeg_add_icc_profile_size(AVCodecContext *avctx, const AVFrame *frame, + size_t *max_pkt_size); +void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb, + const AVFrame *frame, struct MJpegContext *m, + const uint8_t intra_matrix_permutation[64], + int pred, + uint16_t luma_intra_matrix[64], + uint16_t chroma_intra_matrix[64], + int use_slices); +void ff_mjpeg_encode_picture_trailer(PutBitContext *pb, int header_bits); +void ff_mjpeg_escape_FF(PutBitContext *pb, int start); +void ff_mjpeg_build_huffman_codes(uint8_t *huff_size, uint16_t *huff_code, + const uint8_t *bits_table, + const uint8_t *val_table); +void ff_mjpeg_init_hvsample(AVCodecContext *avctx, int hsample[4], int vsample[4]); + +void ff_mjpeg_encode_dc(PutBitContext *pb, int val, + uint8_t *huff_size, uint16_t *huff_code); + +int ff_mjpeg_encode_check_pix_fmt(AVCodecContext *avctx); + +#endif /* AVCODEC_MJPEGENC_COMMON_H */ diff --git a/include/libavcodec/mjpegenc_huffman.h b/include/libavcodec/mjpegenc_huffman.h new file mode 100644 index 0000000..5fe6550 --- /dev/null +++ b/include/libavcodec/mjpegenc_huffman.h @@ -0,0 +1,76 @@ +/* + * MJPEG encoder + * Copyright (c) 2016 William Ma, Ted Ying, Jerry Jiang + * + * 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 + */ + +/** + * @file + * Huffman table generation for MJPEG encoder. + */ + +#ifndef AVCODEC_MJPEGENC_HUFFMAN_H +#define AVCODEC_MJPEGENC_HUFFMAN_H + +#include + +typedef struct MJpegEncHuffmanContext { + int val_count[256]; +} MJpegEncHuffmanContext; + +// Uses the package merge algorithm to compute the Huffman table. +void ff_mjpeg_encode_huffman_init(MJpegEncHuffmanContext *s); +static inline void ff_mjpeg_encode_huffman_increment(MJpegEncHuffmanContext *s, + uint8_t val) +{ + s->val_count[val]++; +} +void ff_mjpeg_encode_huffman_close(MJpegEncHuffmanContext *s, + uint8_t bits[17], uint8_t val[], + int max_nval); + + +/** + * Used to assign a occurrence count or "probability" to an input value + */ +typedef struct PTable { + int value; ///< input value + int prob; ///< number of occurences of this value in input +} PTable; + +/** + * Used to store intermediate lists in the package merge algorithm + */ +typedef struct PackageMergerList { + int nitems; ///< number of items in the list and probability ex. 4 + int item_idx[515]; ///< index range for each item in items 0, 2, 5, 9, 13 + int probability[514]; ///< probability of each item 3, 8, 18, 46 + int items[257 * 16]; ///< chain of all individual values that make up items A, B, A, B, C, A, B, C, D, C, D, D, E +} PackageMergerList; + +/** + * Used to store optimal huffman encoding results + */ +typedef struct HuffTable { + int code; ///< code is the input value + int length; ///< length of the encoding +} HuffTable; + +void ff_mjpegenc_huffman_compute_bits(PTable *prob_table, HuffTable *distincts, + int size, int max_length); +#endif /* AVCODEC_MJPEGENC_HUFFMAN_H */ diff --git a/include/libavcodec/mlp.h b/include/libavcodec/mlp.h new file mode 100644 index 0000000..bec414c --- /dev/null +++ b/include/libavcodec/mlp.h @@ -0,0 +1,189 @@ +/* + * MLP codec common header file + * Copyright (c) 2007-2008 Ian Caulfield + * + * 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_MLP_H +#define AVCODEC_MLP_H + +#include + +#include "libavutil/channel_layout.h" + +#define SYNC_MLP 0xbb +#define SYNC_TRUEHD 0xba + +/** Last possible matrix channel for each codec */ +#define MAX_MATRIX_CHANNEL_MLP 5 +#define MAX_MATRIX_CHANNEL_TRUEHD 7 +/** Maximum number of channels in a valid stream. + * MLP : 5.1 + 2 noise channels -> 8 channels + * TrueHD: 7.1 -> 8 channels + */ +#define MAX_CHANNELS 8 + +/** Maximum number of matrices used in decoding; most streams have one matrix + * per output channel, but some rematrix a channel (usually 0) more than once. + */ +#define MAX_MATRICES_MLP 6 +#define MAX_MATRICES_TRUEHD 8 +#define MAX_MATRICES 8 + +/** Maximum number of substreams that can be decoded. + * MLP's limit is 2. TrueHD supports at least up to 3. + */ +#define MAX_SUBSTREAMS 4 + +/** which multiple of 48000 the maximum sample rate is */ +#define MAX_RATEFACTOR 4 +/** maximum sample frequency seen in files */ +#define MAX_SAMPLERATE (MAX_RATEFACTOR * 48000) + +/** maximum number of audio samples within one access unit */ +#define MAX_BLOCKSIZE (40 * MAX_RATEFACTOR) +/** next power of two greater than MAX_BLOCKSIZE */ +#define MAX_BLOCKSIZE_POW2 (64 * MAX_RATEFACTOR) + +/** number of allowed filters */ +#define NUM_FILTERS 2 + +/** The maximum number of taps in IIR and FIR filters. */ +#define MAX_FIR_ORDER 8 +#define MAX_IIR_ORDER 4 + +/** Code that signals end of a stream. */ +#define END_OF_STREAM 0xd234d234 + +#define PARAM_BLOCKSIZE (1 << 7) +#define PARAM_MATRIX (1 << 6) +#define PARAM_OUTSHIFT (1 << 5) +#define PARAM_QUANTSTEP (1 << 4) +#define PARAM_FIR (1 << 3) +#define PARAM_IIR (1 << 2) +#define PARAM_HUFFOFFSET (1 << 1) +#define PARAM_PRESENCE (1 << 0) + +#define FIR 0 +#define IIR 1 + +/** filter data */ +typedef struct FilterParams { + uint8_t order; ///< number of taps in filter + uint8_t shift; ///< Right shift to apply to output of filter. + + int32_t state[MAX_FIR_ORDER]; + + int coeff_bits; + int coeff_shift; +} FilterParams; + +/** sample data coding information */ +typedef struct ChannelParams { + FilterParams filter_params[NUM_FILTERS]; + int32_t coeff[NUM_FILTERS][MAX_FIR_ORDER]; + + int16_t huff_offset; ///< Offset to apply to residual values. + int32_t sign_huff_offset; ///< sign/rounding-corrected version of huff_offset + uint8_t codebook; ///< Which VLC codebook to use to read residuals. + uint8_t huff_lsbs; ///< Size of residual suffix not encoded using VLC. +} ChannelParams; + +/** Tables defining the Huffman codes. + * There are three entropy coding methods used in MLP (four if you count + * "none" as a method). These use the same sequences for codes starting with + * 00 or 01, but have different codes starting with 1. + */ +extern const uint8_t ff_mlp_huffman_tables[3][18][2]; + +typedef struct { + uint8_t channel_occupancy; + uint8_t group1_channels; + uint8_t group2_channels; + uint8_t summary_info; +} ChannelInformation; + +/** Tables defining channel information. + * + * Possible channel arrangements are: + * + * (Group 1) C + * (Group 1) L, R + * (Group 1) Lf, Rf / (Group 2) S + * (Group 1) Lf, Rf / (Group 2) Ls, Rs + * (Group 1) Lf, Rf / (Group 2) LFE + * (Group 1) Lf, Rf / (Group 2) LFE, S + * (Group 1) Lf, Rf / (Group 2) LFE, Ls, Rs + * (Group 1) Lf, Rf / (Group 2) C + * (Group 1) Lf, Rf / (Group 2) C, S + * (Group 1) Lf, Rf / (Group 2) C, Ls, Rs + * (Group 1) Lf, Rf / (Group 2) C, LFE + * (Group 1) Lf, Rf / (Group 2) C, LFE, S + * (Group 1) Lf, Rf / (Group 2) C, LFE, Ls, Rs + * (Group 1) Lf, Rf C / (Group 2) S + * (Group 1) Lf, Rf C / (Group 2) Ls, Rs + * (Group 1) Lf, Rf C / (Group 2) LFE + * (Group 1) Lf, Rf C / (Group 2) LFE, S + * (Group 1) Lf, Rf C / (Group 2) LFE, Ls, Rs + * (Group 1) Lf, Rf Ls Rs / (Group 2) LFE + * (Group 1) Lf, Rf Ls Rs / (Group 2) C + * (Group 1) Lf, Rf, Ls, Rs / (Group 2) C, LFE + */ +extern const ChannelInformation ff_mlp_ch_info[21]; + +extern const AVChannelLayout ff_mlp_ch_layouts[12]; + +/** MLP uses checksums that seem to be based on the standard CRC algorithm, but + * are not (in implementation terms, the table lookup and XOR are reversed). + * We can implement this behavior using a standard av_crc on all but the + * last element, then XOR that with the last element. + */ +uint8_t ff_mlp_checksum8 (const uint8_t *buf, unsigned int buf_size); +uint16_t ff_mlp_checksum16(const uint8_t *buf, unsigned int buf_size); + +/** Calculate an 8-bit checksum over a restart header -- a non-multiple-of-8 + * number of bits, starting two bits into the first byte of buf. + */ +uint8_t ff_mlp_restart_checksum(const uint8_t *buf, unsigned int bit_size); + +/** XOR together all the bytes of a buffer. + * Does this belong in dspcontext? + */ +uint8_t ff_mlp_calculate_parity(const uint8_t *buf, unsigned int buf_size); + +void ff_mlp_init_crc(void); + +/** XOR four bytes into one. */ +static inline uint8_t xor_32_to_8(uint32_t value) +{ + value ^= value >> 16; + value ^= value >> 8; + return value; +} + +typedef enum THDChannelModifier { + THD_CH_MODIFIER_NOTINDICATED = 0x0, + THD_CH_MODIFIER_STEREO = 0x0, // Stereo (not Dolby Surround) + THD_CH_MODIFIER_LTRT = 0x1, // Dolby Surround + THD_CH_MODIFIER_LBINRBIN = 0x2, // Dolby Headphone + THD_CH_MODIFIER_MONO = 0x3, // Mono or Dual Mono + THD_CH_MODIFIER_NOTSURROUNDEX = 0x1, // Not Dolby Digital EX + THD_CH_MODIFIER_SURROUNDEX = 0x2, // Dolby Digital EX +} THDChannelModifier; + +#endif /* AVCODEC_MLP_H */ diff --git a/include/libavcodec/mlp_parse.h b/include/libavcodec/mlp_parse.h new file mode 100644 index 0000000..5f1f953 --- /dev/null +++ b/include/libavcodec/mlp_parse.h @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2007 Ian Caulfield + * + * 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_MLP_PARSE_H +#define AVCODEC_MLP_PARSE_H + +#include + +#include "libavutil/channel_layout.h" + +#include "get_bits.h" + +typedef struct MLPHeaderInfo +{ + int stream_type; ///< 0xBB for MLP, 0xBA for TrueHD + int header_size; ///< Size of the major sync header, in bytes + + int group1_bits; ///< The bit depth of the first substream + int group2_bits; ///< Bit depth of the second substream (MLP only) + + int group1_samplerate; ///< Sample rate of first substream + int group2_samplerate; ///< Sample rate of second substream (MLP only) + + int channel_arrangement; + + int channel_modifier_thd_stream0; ///< Channel modifier for substream 0 of TrueHD streams ("2-channel presentation") + int channel_modifier_thd_stream1; ///< Channel modifier for substream 1 of TrueHD streams ("6-channel presentation") + int channel_modifier_thd_stream2; ///< Channel modifier for substream 2 of TrueHD streams ("8-channel presentation") + + int channels_mlp; ///< Channel count for MLP streams + int channels_thd_stream1; ///< Channel count for substream 1 of TrueHD streams ("6-channel presentation") + int channels_thd_stream2; ///< Channel count for substream 2 of TrueHD streams ("8-channel presentation") + uint64_t channel_layout_mlp; ///< Channel layout for MLP streams + uint64_t channel_layout_thd_stream1; ///< Channel layout for substream 1 of TrueHD streams ("6-channel presentation") + uint64_t channel_layout_thd_stream2; ///< Channel layout for substream 2 of TrueHD streams ("8-channel presentation") + + int access_unit_size; ///< Number of samples per coded frame + int access_unit_size_pow2; ///< Next power of two above number of samples per frame + + int is_vbr; ///< Stream is VBR instead of CBR + int peak_bitrate; ///< Peak bitrate for VBR, actual bitrate (==peak) for CBR + + int num_substreams; ///< Number of substreams within stream + + int extended_substream_info; ///< Which substream of substreams carry 16-channel presentation + int substream_info; ///< Which substream of substreams carry 2/6/8-channel presentation +} MLPHeaderInfo; + +static const uint8_t thd_chancount[13] = { +// LR C LFE LRs LRvh LRc LRrs Cs Ts LRsd LRw Cvh LFE2 + 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2, 1, 1 +}; + +static const uint64_t thd_layout[13] = { + AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT, // LR + AV_CH_FRONT_CENTER, // C + AV_CH_LOW_FREQUENCY, // LFE + AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT, // LRs + AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT, // LRvh + AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER, // LRc + AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT, // LRrs + AV_CH_BACK_CENTER, // Cs + AV_CH_TOP_CENTER, // Ts + AV_CH_SURROUND_DIRECT_LEFT|AV_CH_SURROUND_DIRECT_RIGHT, // LRsd + AV_CH_WIDE_LEFT|AV_CH_WIDE_RIGHT, // LRw + AV_CH_TOP_FRONT_CENTER, // Cvh + AV_CH_LOW_FREQUENCY_2, // LFE2 +}; + +static inline int mlp_samplerate(int in) +{ + if (in == 0xF) + return 0; + + return (in & 8 ? 44100 : 48000) << (in & 7) ; +} + +static inline int truehd_channels(int chanmap) +{ + int channels = 0, i; + + for (i = 0; i < 13; i++) + channels += thd_chancount[i] * ((chanmap >> i) & 1); + + return channels; +} + +static inline uint64_t truehd_layout(int chanmap) +{ + int i; + uint64_t layout = 0; + + for (i = 0; i < 13; i++) + layout |= thd_layout[i] * ((chanmap >> i) & 1); + + return layout; +} + +static inline int layout_truehd(uint64_t layout) +{ + int chanmap = 0; + + for (int i = 0; i < 13; i++) { + if ((layout & thd_layout[i]) == thd_layout[i]) + chanmap |= 1 << i; + } + + return chanmap; +} + +int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb); + +#endif /* AVCODEC_MLP_PARSE_H */ diff --git a/include/libavcodec/mlpdsp.h b/include/libavcodec/mlpdsp.h new file mode 100644 index 0000000..7a9ac22 --- /dev/null +++ b/include/libavcodec/mlpdsp.h @@ -0,0 +1,75 @@ +/* + * MLP codec common header file + * Copyright (c) 2007-2008 Ian Caulfield + * + * 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_MLPDSP_H +#define AVCODEC_MLPDSP_H + +#include +#include "mlp.h" + +void ff_mlp_rematrix_channel(int32_t *samples, + const int32_t *coeffs, + const uint8_t *bypassed_lsbs, + const int8_t *noise_buffer, + int index, + unsigned int dest_ch, + uint16_t blockpos, + unsigned int maxchan, + int matrix_noise_shift, + int access_unit_size_pow2, + int32_t mask); + +int32_t ff_mlp_pack_output(int32_t lossless_check_data, + uint16_t blockpos, + int32_t (*sample_buffer)[MAX_CHANNELS], + void *data, + uint8_t *ch_assign, + int8_t *output_shift, + uint8_t max_matrix_channel, + int is32); + +typedef struct MLPDSPContext { + void (*mlp_filter_channel)(int32_t *state, const int32_t *coeff, + int firorder, int iirorder, + unsigned int filter_shift, int32_t mask, + int blocksize, int32_t *sample_buffer); + void (*mlp_rematrix_channel)(int32_t *samples, + const int32_t *coeffs, + const uint8_t *bypassed_lsbs, + const int8_t *noise_buffer, + int index, + unsigned int dest_ch, + uint16_t blockpos, + unsigned int maxchan, + int matrix_noise_shift, + int access_unit_size_pow2, + int32_t mask); + int32_t (*(*mlp_select_pack_output)(uint8_t *ch_assign, + int8_t *output_shift, + uint8_t max_matrix_channel, + int is32))(int32_t, uint16_t, int32_t (*)[], void *, uint8_t*, int8_t *, uint8_t, int); +} MLPDSPContext; + +void ff_mlpdsp_init(MLPDSPContext *c); +void ff_mlpdsp_init_arm(MLPDSPContext *c); +void ff_mlpdsp_init_x86(MLPDSPContext *c); + +#endif /* AVCODEC_MLPDSP_H */ diff --git a/include/libavcodec/mlz.h b/include/libavcodec/mlz.h new file mode 100644 index 0000000..2499312 --- /dev/null +++ b/include/libavcodec/mlz.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2016 Umair Khan + * + * 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_MLZ_H +#define AVCODEC_MLZ_H + +#include "get_bits.h" + +#define CODE_UNSET -1 +#define CODE_BIT_INIT 9 +#define DIC_INDEX_INIT 512 // 2^9 +#define DIC_INDEX_MAX 32768 // 2^15 +#define FLUSH_CODE 256 +#define FREEZE_CODE 257 +#define FIRST_CODE 258 +#define MAX_CODE 32767 +#define TABLE_SIZE 35023 // TABLE_SIZE must be a prime number + +/** Dictionary structure for mlz decompression + */ +typedef struct MLZDict { + int string_code; + int parent_code; + int char_code; + int match_len; +} MLZDict; + +/** MLZ data strucure + */ +typedef struct MLZ { + int dic_code_bit; + int current_dic_index_max; + unsigned int bump_code; + unsigned int flush_code; + int next_code; + int freeze_flag; + MLZDict* dict; + void* context; +} MLZ; + +/** Initialize the dictionary + */ +int ff_mlz_init_dict(void *context, MLZ *mlz); + +/** Flush the dictionary + */ +void ff_mlz_flush_dict(MLZ *dict); + +/** Run mlz decompression on the next size bits and the output will be stored in buff + */ +int ff_mlz_decompression(MLZ* mlz, GetBitContext* gb, int size, unsigned char *buff); + +#endif /*AVCODEC_MLZ_H*/ diff --git a/include/libavcodec/motion_est.h b/include/libavcodec/motion_est.h new file mode 100644 index 0000000..12f7cd4 --- /dev/null +++ b/include/libavcodec/motion_est.h @@ -0,0 +1,147 @@ +/* + * Motion estimation + * + * 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_MOTION_EST_H +#define AVCODEC_MOTION_EST_H + +#include + +#include "avcodec.h" +#include "hpeldsp.h" +#include "me_cmp.h" +#include "qpeldsp.h" + +struct MpegEncContext; + +#if ARCH_IA64 // Limit static arrays to avoid gcc failing "short data segment overflowed" +#define MAX_MV 1024 +#else +#define MAX_MV 4096 +#endif +#define MAX_DMV (2*MAX_MV) +#define ME_MAP_SIZE 64 + +#define FF_ME_ZERO 0 +#define FF_ME_EPZS 1 +#define FF_ME_XONE 2 + +/** + * Motion estimation context. + */ +typedef struct MotionEstContext { + AVCodecContext *avctx; + int skip; ///< set if ME is skipped for the current MB + int co_located_mv[4][2]; ///< mv from last P-frame for direct mode ME + int direct_basis_mv[4][2]; + uint8_t *scratchpad; /**< data area for the ME algo, so that + * the ME does not need to malloc/free. */ + uint8_t *temp; + uint32_t *map; ///< map to avoid duplicate evaluations + uint32_t *score_map; ///< map to store the scores + unsigned map_generation; + int pre_penalty_factor; + int penalty_factor; /**< an estimate of the bits required to + * code a given mv value, e.g. (1,0) takes + * more bits than (0,0). We have to + * estimate whether any reduction in + * residual is worth the extra bits. */ + int sub_penalty_factor; + int mb_penalty_factor; + int flags; + int sub_flags; + int mb_flags; + int pre_pass; ///< = 1 for the pre pass + int dia_size; + int xmin; + int xmax; + int ymin; + int ymax; + int pred_x; + int pred_y; + const uint8_t *src[4][4]; + const uint8_t *ref[4][4]; + int stride; + int uvstride; + /* temp variables for picture complexity calculation */ + int64_t mc_mb_var_sum_temp; + int64_t mb_var_sum_temp; + int scene_change_score; + + me_cmp_func me_pre_cmp[6]; + me_cmp_func me_cmp[6]; + me_cmp_func me_sub_cmp[6]; + me_cmp_func mb_cmp[6]; + + me_cmp_func pix_abs[2][4]; + me_cmp_func sse; + + op_pixels_func(*hpel_put)[4]; + op_pixels_func(*hpel_avg)[4]; + qpel_mc_func(*qpel_put)[16]; + qpel_mc_func(*qpel_avg)[16]; + const uint8_t (*mv_penalty)[MAX_DMV * 2 + 1]; ///< bit amount needed to encode a MV + const uint8_t *current_mv_penalty; + int (*sub_motion_search)(struct MpegEncContext *s, + int *mx_ptr, int *my_ptr, int dmin, + int src_index, int ref_index, + int size, int h); +} MotionEstContext; + +static inline int ff_h263_round_chroma(int x) +{ + //FIXME static or not? + static const uint8_t h263_chroma_roundtab[16] = { + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, + }; + return h263_chroma_roundtab[x & 0xf] + (x >> 3); +} + +/** + * Performs one-time initialization of the MotionEstContext. + */ +int ff_me_init(MotionEstContext *c, struct AVCodecContext *avctx, + const struct MECmpContext *mecc, int mpvenc); + +void ff_me_init_pic(struct MpegEncContext *s); + +void ff_estimate_p_frame_motion(struct MpegEncContext *s, int mb_x, int mb_y); +void ff_estimate_b_frame_motion(struct MpegEncContext *s, int mb_x, int mb_y); + +int ff_pre_estimate_p_frame_motion(struct MpegEncContext *s, + int mb_x, int mb_y); + +int ff_epzs_motion_search(struct MpegEncContext *s, int *mx_ptr, int *my_ptr, + int P[10][2], int src_index, int ref_index, + const int16_t (*last_mv)[2], int ref_mv_scale, + int size, int h); + +int ff_get_mb_score(struct MpegEncContext *s, int mx, int my, int src_index, + int ref_index, int size, int h, int add_rate); + +int ff_get_best_fcode(struct MpegEncContext *s, + const int16_t (*mv_table)[2], int type); + +void ff_fix_long_p_mvs(struct MpegEncContext *s, int type); +void ff_fix_long_mvs(struct MpegEncContext *s, uint8_t *field_select_table, + int field_select, int16_t (*mv_table)[2], int f_code, + int type, int truncate); + +#endif /* AVCODEC_MOTION_EST_H */ diff --git a/include/libavcodec/motionpixels_tablegen.h b/include/libavcodec/motionpixels_tablegen.h new file mode 100644 index 0000000..fd10c80 --- /dev/null +++ b/include/libavcodec/motionpixels_tablegen.h @@ -0,0 +1,91 @@ +/* + * Header file for hardcoded motion pixels RGB to YUV table + * + * Copyright (c) 2009 Reimar Döffinger + * + * 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_MOTIONPIXELS_TABLEGEN_H +#define AVCODEC_MOTIONPIXELS_TABLEGEN_H + +#include +#include "libavutil/attributes.h" + +typedef struct YuvPixel { + int8_t y, v, u; +} YuvPixel; + +static int mp_yuv_to_rgb(int y, int v, int u, int clip_rgb) { + const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; + int r, g, b; + + r = (1000 * y + 701 * v) / 1000; + g = (1000 * y - 357 * v - 172 * u) / 1000; + b = (1000 * y + 886 * u) / 1000; + if (clip_rgb) + return ((cm[r * 8] & 0xF8) << 7) | ((cm[g * 8] & 0xF8) << 2) | (cm[b * 8] >> 3); + if ((unsigned)r < 32 && (unsigned)g < 32 && (unsigned)b < 32) + return (r << 10) | (g << 5) | b; + return 1 << 15; +} + +#if CONFIG_HARDCODED_TABLES +#define motionpixels_tableinit() +#include "libavcodec/motionpixels_tables.h" +#else +static YuvPixel mp_rgb_yuv_table[1 << 15]; + +static av_cold void mp_set_zero_yuv(YuvPixel *p) +{ + int i, j; + + for (i = 0; i < 31; ++i) { + for (j = 31; j > i; --j) + if (!(p[j].u | p[j].v | p[j].y)) + p[j] = p[j - 1]; + for (j = 0; j < 31 - i; ++j) + if (!(p[j].u | p[j].v | p[j].y)) + p[j] = p[j + 1]; + } +} + +static av_cold void mp_build_rgb_yuv_table(YuvPixel *p) +{ + int y, v, u, i; + + for (y = 0; y <= 31; ++y) + for (v = -31; v <= 31; ++v) + for (u = -31; u <= 31; ++u) { + i = mp_yuv_to_rgb(y, v, u, 0); + if (i < (1 << 15) && !(p[i].u | p[i].v | p[i].y)) { + p[i].y = y; + p[i].v = v; + p[i].u = u; + } + } + for (i = 0; i < 1024; ++i) + mp_set_zero_yuv(p + i * 32); +} + +static av_cold void motionpixels_tableinit(void) +{ + mp_build_rgb_yuv_table(mp_rgb_yuv_table); +} +#endif /* CONFIG_HARDCODED_TABLES */ + +#endif /* AVCODEC_MOTIONPIXELS_TABLEGEN_H */ diff --git a/include/libavcodec/mpc.h b/include/libavcodec/mpc.h new file mode 100644 index 0000000..cef8db4 --- /dev/null +++ b/include/libavcodec/mpc.h @@ -0,0 +1,77 @@ +/* + * Musepack decoder + * Copyright (c) 2006 Konstantin Shishkov + * + * 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 + */ + +/** + * @file + * Musepack decoder + * MPEG Audio Layer 1/2 -like codec with frames of 1152 samples + * divided into 32 subbands. + */ + +#ifndef AVCODEC_MPC_H +#define AVCODEC_MPC_H + +#include + +#include "libavutil/lfg.h" +#include "libavutil/mem_internal.h" + +#include "bswapdsp.h" +#include "mpegaudio.h" +#include "mpegaudiodsp.h" + +#define BANDS 32 +#define SAMPLES_PER_BAND 36 +#define MPC_FRAME_SIZE (BANDS * SAMPLES_PER_BAND) + +/** Subband structure - hold all variables for each subband */ +typedef struct Band { + int msf; ///< mid-stereo flag + int res[2]; + int scfi[2]; + int scf_idx[2][3]; + int Q[2]; +}Band; + +typedef struct MPCContext { + BswapDSPContext bdsp; + MPADSPContext mpadsp; + int IS, MSS, gapless; + int lastframelen; + int maxbands, last_max_band; + int last_bits_used; + int oldDSCF[2][BANDS]; + Band bands[BANDS]; + int Q[2][MPC_FRAME_SIZE]; + int cur_frame, frames; + uint8_t *bits; + int buf_size; + AVLFG rnd; + int frames_to_skip; + /* for synthesis */ + DECLARE_ALIGNED(16, MPA_INT, synth_buf)[MPA_MAX_CHANNELS][512*2]; + int synth_buf_offset[MPA_MAX_CHANNELS]; + DECLARE_ALIGNED(16, int32_t, sb_samples)[MPA_MAX_CHANNELS][36][SBLIMIT]; +} MPCContext; + +void ff_mpc_dequantize_and_synth(MPCContext *c, int maxband, int16_t **out, int channels); + +#endif /* AVCODEC_MPC_H */ diff --git a/include/libavcodec/mpc7data.h b/include/libavcodec/mpc7data.h new file mode 100644 index 0000000..ee77393 --- /dev/null +++ b/include/libavcodec/mpc7data.h @@ -0,0 +1,135 @@ +/* + * Musepack decoder + * Copyright (c) 2006 Konstantin Shishkov + * + * 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_MPC7DATA_H +#define AVCODEC_MPC7DATA_H + +#include + +static const int8_t mpc7_idx30[] = { -1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1,-1, 0, 1}; +static const int8_t mpc7_idx31[] = { -1,-1,-1, 0, 0, 0, 1, 1, 1,-1,-1,-1, 0, 0, 0, 1, 1, 1,-1,-1,-1, 0, 0, 0, 1, 1, 1}; +static const int8_t mpc7_idx32[] = { -1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1}; +static const int8_t mpc7_idx50[] = { -2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2,-2,-1, 0, 1, 2}; +static const int8_t mpc7_idx51[] = { -2,-2,-2,-2,-2,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2}; + +#define MPC7_SCFI_SIZE 4 +#define MPC7_SCFI_BITS 3 +static const uint8_t mpc7_scfi[MPC7_SCFI_SIZE * 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] = { + 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] = { + 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 +static const uint8_t mpc7_quant_vlc_sizes[MPC7_QUANT_VLC_TABLES] = { + 27, 25, 7, 9, 15, 31, 63 +}; + +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] = { + /* 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 */ diff --git a/include/libavcodec/mpc8data.h b/include/libavcodec/mpc8data.h new file mode 100644 index 0000000..22c2be4 --- /dev/null +++ b/include/libavcodec/mpc8data.h @@ -0,0 +1,121 @@ +/* + * Musepack SV8 decoder + * Copyright (c) 2007 Konstantin Shishkov + * + * 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_MPC8DATA_H +#define AVCODEC_MPC8DATA_H + +#include + +static const int8_t mpc8_idx50[125] = { + -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, + -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, + -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, + -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, + -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2, -2, -1, 0, 1, 2 +}; +static const int8_t mpc8_idx51[125] = { + -2, -2, -2, -2, -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, + -2, -2, -2, -2, -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, + -2, -2, -2, -2, -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, + -2, -2, -2, -2, -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, + -2, -2, -2, -2, -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2 +}; +static const int8_t mpc8_idx52[125] = { + -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 +}; + +static const unsigned int mpc8_thres[] = {0, 0, 3, 0, 0, 1, 3, 4, 8}; +static const int8_t mpc8_huffq2[5*5*5] = { + 6, 5, 4, 5, 6, 5, 4, 3, 4, 5, 4, 3, 2, 3, 4, 5, 4, 3, 4, 5, 6, 5, 4, 5, + 6, 5, 4, 3, 4, 5, 4, 3, 2, 3, 4, 3, 2, 1, 2, 3, 4, 3, 2, 3, 4, 5, 4, 3, + 4, 5, 4, 3, 2, 3, 4, 3, 2, 1, 2, 3, 2, 1, 0, 1, 2, 3, 2, 1, 2, 3, 4, 3, + 2, 3, 4, 5, 4, 3, 4, 5, 4, 3, 2, 3, 4, 3, 2, 1, 2, 3, 4, 3, 2, 3, 4, 5, + 4, 3, 4, 5, 6, 5, 4, 5, 6, 5, 4, 3, 4, 5, 4, 3, 2, 3, 4, 5, 4, 3, 4, 5, + 6, 5, 4, 5, 6 +}; + + +static const uint32_t mpc8_cnk[16][32] = +{ + {0, 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}, + {0, 0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120, 136, 153, 171, 190, 210, 231, 253, 276, 300, 325, 351, 378, 406, 435, 465}, + {0, 0, 0, 1, 4, 10, 20, 35, 56, 84, 120, 165, 220, 286, 364, 455, 560, 680, 816, 969, 1140, 1330, 1540, 1771, 2024, 2300, 2600, 2925, 3276, 3654, 4060, 4495}, + {0, 0, 0, 0, 1, 5, 15, 35, 70, 126, 210, 330, 495, 715, 1001, 1365, 1820, 2380, 3060, 3876, 4845, 5985, 7315, 8855, 10626, 12650, 14950, 17550, 20475, 23751, 27405, 31465}, + {0, 0, 0, 0, 0, 1, 6, 21, 56, 126, 252, 462, 792, 1287, 2002, 3003, 4368, 6188, 8568, 11628, 15504, 20349, 26334, 33649, 42504, 53130, 65780, 80730, 98280, 118755, 142506, 169911}, + {0, 0, 0, 0, 0, 0, 1, 7, 28, 84, 210, 462, 924, 1716, 3003, 5005, 8008, 12376, 18564, 27132, 38760, 54264, 74613, 100947, 134596, 177100, 230230, 296010, 376740, 475020, 593775, 736281}, + {0, 0, 0, 0, 0, 0, 0, 1, 8, 36, 120, 330, 792, 1716, 3432, 6435, 11440, 19448, 31824, 50388, 77520, 116280, 170544, 245157, 346104, 480700, 657800, 888030, 1184040, 1560780, 2035800, 2629575}, + {0, 0, 0, 0, 0, 0, 0, 0, 1, 9, 45, 165, 495, 1287, 3003, 6435, 12870, 24310, 43758, 75582, 125970, 203490, 319770, 490314, 735471, 1081575, 1562275, 2220075, 3108105, 4292145, 5852925, 7888725}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 10, 55, 220, 715, 2002, 5005, 11440, 24310, 48620, 92378, 167960, 293930, 497420, 817190, 1307504, 2042975, 3124550, 4686825, 6906900, 10015005, 14307150, 20160075}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 11, 66, 286, 1001, 3003, 8008, 19448, 43758, 92378, 184756, 352716, 646646, 1144066, 1961256, 3268760, 5311735, 8436285, 13123110, 20030010, 30045015, 44352165}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 12, 78, 364, 1365, 4368, 12376, 31824, 75582, 167960, 352716, 705432, 1352078, 2496144, 4457400, 7726160, 13037895, 21474180, 34597290, 54627300, 84672315}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 13, 91, 455, 1820, 6188, 18564, 50388, 125970, 293930, 646646, 1352078, 2704156, 5200300, 9657700, 17383860, 30421755, 51895935, 86493225, 141120525}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 14, 105, 560, 2380, 8568, 27132, 77520, 203490, 497420, 1144066, 2496144, 5200300, 10400600, 20058300, 37442160, 67863915, 119759850, 206253075}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 15, 120, 680, 3060, 11628, 38760, 116280, 319770, 817190, 1961256, 4457400, 9657700, 20058300, 40116600, 77558760, 145422675, 265182525}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 16, 136, 816, 3876, 15504, 54264, 170544, 490314, 1307504, 3268760, 7726160, 17383860, 37442160, 77558760, 155117520, 300540195}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 17, 153, 969, 4845, 20349, 74613, 245157, 735471, 2042975, 5311735, 13037895, 30421755, 67863915, 145422675, 300540195} +}; + +static const uint8_t mpc8_cnk_len[16][33] = +{ + {0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6}, + {0, 0, 2, 3, 4, 4, 5, 5, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 0}, + {0, 0, 0, 2, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 0}, + {0, 0, 0, 0, 3, 4, 6, 7, 7, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 0}, + {0, 0, 0, 0, 0, 3, 5, 6, 7, 8, 9, 10, 11, 11, 12, 13, 13, 14, 14, 14, 15, 15, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 0}, + {0, 0, 0, 0, 0, 0, 3, 5, 7, 8, 9, 10, 11, 12, 13, 13, 14, 15, 15, 16, 16, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 0}, + {0, 0, 0, 0, 0, 0, 0, 3, 6, 7, 9, 10, 11, 12, 13, 14, 15, 15, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 21, 22, 22, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 4, 6, 8, 9, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 19, 20, 21, 21, 22, 22, 23, 23, 23, 24, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 6, 8, 10, 11, 13, 14, 15, 16, 17, 18, 19, 19, 20, 21, 21, 22, 23, 23, 24, 24, 25, 25, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 7, 9, 10, 12, 13, 15, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 24, 25, 25, 26, 26, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 7, 9, 11, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 23, 24, 25, 26, 26, 27, 27, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 7, 9, 11, 13, 15, 16, 17, 19, 20, 21, 22, 23, 24, 25, 25, 26, 27, 28, 28, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 7, 10, 12, 14, 15, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 27, 28, 29, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 7, 10, 12, 14, 16, 17, 19, 20, 21, 23, 24, 25, 26, 27, 28, 28, 29, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 8, 10, 12, 14, 16, 18, 19, 21, 22, 23, 25, 26, 27, 28, 29, 30, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8, 10, 13, 15, 17, 18, 20, 21, 23, 24, 25, 27, 28, 29, 30, 0} + +}; + +static const uint32_t mpc8_cnk_lost[16][33] = +{ + {0, 0, 1, 0, 3, 2, 1, 0, 7, 6, 5, 4, 3, 2, 1, 0, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 31}, + {0, 0, 1, 2, 6, 1, 11, 4, 28, 19, 9, 62, 50, 37, 23, 8, 120, 103, 85, 66, 46, 25, 3, 236, 212, 187, 161, 134, 106, 77, 47, 16, 0}, + {0, 0, 0, 0, 6, 12, 29, 8, 44, 8, 91, 36, 226, 148, 57, 464, 344, 208, 55, 908, 718, 508, 277, 24, 1796, 1496, 1171, 820, 442, 36, 3697, 3232, 0}, + {0, 0, 0, 0, 3, 1, 29, 58, 2, 46, 182, 17, 309, 23, 683, 228, 1716, 1036, 220, 3347, 2207, 877, 7529, 5758, 3734, 1434, 15218, 12293, 9017, 5363, 1303, 29576, 0}, + {0, 0, 0, 0, 0, 2, 11, 8, 2, 4, 50, 232, 761, 46, 1093, 3824, 2004, 7816, 4756, 880, 12419, 6434, 31887, 23032, 12406, 65292, 50342, 32792, 12317, 119638, 92233, 60768, 0}, + {0, 0, 0, 0, 0, 0, 1, 4, 44, 46, 50, 100, 332, 1093, 3187, 184, 4008, 14204, 5636, 26776, 11272, 56459, 30125, 127548, 85044, 31914, 228278, 147548, 49268, 454801, 312295, 142384, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 28, 8, 182, 232, 332, 664, 1757, 4944, 13320, 944, 15148, 53552, 14792, 91600, 16987, 178184, 43588, 390776, 160546, 913112, 536372, 61352, 1564729, 828448, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 7, 19, 91, 17, 761, 1093, 1757, 3514, 8458, 21778, 55490, 5102, 58654, 204518, 33974, 313105, 1015577, 534877, 1974229, 1086199, 4096463, 2535683, 499883, 6258916, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 9, 36, 309, 46, 3187, 4944, 8458, 16916, 38694, 94184, 230358, 26868, 231386, 789648, 54177, 1069754, 3701783, 1481708, 6762211, 2470066, 13394357, 5505632, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 62, 226, 23, 1093, 184, 13320, 21778, 38694, 77388, 171572, 401930, 953086, 135896, 925544, 3076873, 8340931, 3654106, 13524422, 3509417, 22756699, 2596624, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 50, 148, 683, 3824, 4008, 944, 55490, 94184, 171572, 343144, 745074, 1698160, 3931208, 662448, 3739321, 12080252, 32511574, 12481564, 49545413, 5193248, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 37, 57, 228, 2004, 14204, 15148, 5102, 230358, 401930, 745074, 1490148, 3188308, 7119516, 16170572, 3132677, 15212929, 47724503, 127314931, 42642616, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 23, 464, 1716, 7816, 5636, 53552, 58654, 26868, 953086, 1698160, 3188308, 6376616, 13496132, 29666704, 66353813, 14457878, 62182381, 189497312, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 8, 344, 1036, 4756, 26776, 14792, 204518, 231386, 135896, 3931208, 7119516, 13496132, 26992264, 56658968, 123012781, 3252931, 65435312, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 208, 220, 880, 11272, 91600, 33974, 789648, 925544, 662448, 16170572, 29666704, 56658968, 113317936, 236330717, 508019104, 0}, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 103, 55, 3347, 12419, 56459, 16987, 313105, 54177, 3076873, 3739321, 3132677, 66353813, 123012781, 236330717, 0} +}; + +#endif /* AVCODEC_MPC8DATA_H */ diff --git a/include/libavcodec/mpc8huff.h b/include/libavcodec/mpc8huff.h new file mode 100644 index 0000000..51997df --- /dev/null +++ b/include/libavcodec/mpc8huff.h @@ -0,0 +1,230 @@ +/* + * Musepack SV8 decoder + * Copyright (c) 2007 Konstantin Shishkov + * + * 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_MPC8HUFF_H +#define AVCODEC_MPC8HUFF_H + +#include + +#define MPC8_MAX_VLC_SIZE 256 + +#define MPC8_BANDS_SIZE 33 +#define MPC8_BANDS_BITS 9 + +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_len_counts[16] = { + 1, 1, 1, 0, 2, 2, 1, 3, 2, 3, 4, 11, 2, 0, 0, 0 +}; + +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] = { + { 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_BITS 9 +#define MPC8_DSCF1_BITS 9 + +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, + /* 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, + 27, 28, 34, 29, 30, 31, 32, 33, +}; + +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_BITS 9 + +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] = { + { 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_BITS 9 + +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_BITS 9 + +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, + 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, + /* 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, + 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, + /* 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, + 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, + /* 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, + /* 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, + 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, +}; + +#endif /* AVCODEC_MPC8HUFF_H */ diff --git a/include/libavcodec/mpcdata.h b/include/libavcodec/mpcdata.h new file mode 100644 index 0000000..64fb4ab --- /dev/null +++ b/include/libavcodec/mpcdata.h @@ -0,0 +1,100 @@ +/* + * Musepack decoder + * Copyright (c) 2006 Konstantin Shishkov + * + * 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_MPCDATA_H +#define AVCODEC_MPCDATA_H + +static const float mpc_CC[18+1] = { + 111.285962475327f, // 32768/2/255*sqrt(3) + 65536.0000 /* this value is never used */, + 21845.3333, 13107.2000, 9362.2857, 7281.7778, 4369.0667, 2114.0645, + 1040.2539, 516.0315, 257.0039, 128.2505, 64.0626, 32.0156, 16.0039, 8.0010, + 4.0002, 2.0001, 1.0000 +}; + +static const float mpc_SCF[256] = { + 307.330047607421875000, 255.999984741210937500, 213.243041992187500000, 177.627334594726562500, + 147.960128784179687500, 123.247924804687500000, 102.663139343261718750, 85.516410827636718750, + 71.233520507812500000, 59.336143493652343750, 49.425861358642578125, 41.170787811279296875, + 34.294471740722656250, 28.566631317138671875, 23.795452117919921875, 19.821151733398437500, + 16.510635375976562500, 13.753040313720703125, 11.456016540527343750, 9.542640686035156250, + 7.948835372924804688, 6.621226310729980469, 5.515353679656982422, 4.594182968139648438, + 3.826865673065185547, 3.187705039978027344, 2.655296564102172852, 2.211810588836669922, + 1.842395424842834473, 1.534679770469665527, 1.278358578681945801, 1.064847946166992188, + 0.886997759342193604, 0.738851964473724365, 0.615449428558349609, 0.512657463550567627, + 0.427033752202987671, 0.355710864067077637, 0.296300262212753296, 0.246812388300895691, + 0.205589950084686279, 0.171252459287643433, 0.142649993300437927, 0.118824683129787445, + 0.098978661000728607, 0.082447312772274017, 0.068677015602588654, 0.057206626981496811, + 0.047652013599872589, 0.039693206548690796, 0.033063672482967377, 0.027541399002075195, + 0.022941453382372856, 0.019109787419438362, 0.015918083488941193, 0.013259455561637878, + 0.011044870130717754, 0.009200163185596466, 0.007663558237254620, 0.006383595988154411, + 0.005317411851137877, 0.004429301247000694, 0.003689522389322519, 0.003073300700634718, + 0.002560000168159604, 0.002132430672645569, 0.001776273478753865, 0.001479601487517357, + 0.001232479466125369, 0.001026631565764546, 0.000855164253152907, 0.000712335284333676, + 0.000593361502978951, 0.000494258652906865, 0.000411707907915115, 0.000342944724252447, + 0.000285666319541633, 0.000237954518524930, 0.000198211506358348, 0.000165106350323185, + 0.000137530398205854, 0.000114560163638089, 0.000095426403277088, 0.000079488345363643, + 0.000066212254751008, 0.000055153526773211, 0.000045941822463647, 0.000038268648495432, + 0.000031877043511486, 0.000026552961571724, 0.000022118103515822, 0.000018423952496960, + 0.000015346795407822, 0.000012783583770215, 0.000010648477655195, 0.000008869976227288, + 0.000007388518497464, 0.000006154492893984, 0.000005126573796588, 0.000004270336830814, + 0.000003557107902452, 0.000002963002089018, 0.000002468123511790, 0.000002055899130937, + 0.000001712524181130, 0.000001426499579793, 0.000001188246528727, 0.000000989786371974, + 0.000000824472920158, 0.000000686770022185, 0.000000572066142013, 0.000000476520028769, + 0.000000396931966407, 0.000000330636652279, 0.000000275413924555, 0.000000229414467867, + 0.000000191097811353, 0.000000159180785886, 0.000000132594522029, 0.000000110448674207, + 0.000000092001613439, 0.000000076635565449, 0.000000063835940978, 0.000000053174105119, + 0.000000044293003043, 0.000000036895215771, 0.000000030733001921, 0.000000025599996789, + 0.000000021324305018, 3689522167600.270019531250000000, 3073300627835.926757812500000000, 2560000000000.002929687500000000, + 2132430501800.519042968750000000, 1776273376956.721923828125000000, 1479601378343.250244140625000000, 1232479339720.794189453125000000, + 1026631459710.774291992187500000, 855164155779.391845703125000000, 712335206965.024780273437500000, 593361454233.829101562500000000, + 494258618594.112609863281250000, 411707872682.763122558593750000, 342944697476.612365722656250000, 285666302081.983886718750000000, + 237954506209.446411132812500000, 198211502766.368713378906250000, 165106349338.563323974609375000, 137530396629.095306396484375000, + 114560161209.611633300781250000, 95426399240.062576293945312500, 79488345475.196502685546875000, 66212254855.064872741699218750, + 55153528064.816276550292968750, 45941822471.611343383789062500, 38268649822.956413269042968750, 31877045369.216873168945312500, + 26552962442.420688629150390625, 22118104306.789615631103515625, 18423953228.829509735107421875, 15346796808.164905548095703125, + 12783585007.291271209716796875, 10648479137.463939666748046875, 8869977230.669750213623046875, 7388519530.061036109924316406, + 6154493909.785535812377929688, 5126574428.270387649536132812, 4270337375.232155323028564453, 3557108465.595236301422119141, + 2963002574.315670013427734375, 2468123854.056322574615478516, 2055899448.676229715347290039, 1712524489.450022459030151367, + 1426499787.649837732315063477, 1188246741.404872417449951172, 989786560.561257958412170410, 824473067.192597866058349609, + 686770123.591610312461853027, 572066234.090648531913757324, 476520111.962911486625671387, 396932039.637152194976806641, + 330636714.243810534477233887, 275413990.026798009872436523, 229414528.498330980539321899, 191097866.455478429794311523, + 159180827.835415601730346680, 132594551.788319095969200134, 110448697.892960876226425171, 92001629.793398514389991760, + 76635578.744844585657119751, 63835955.327594503760337830, 53174116.504741288721561432, 44293010.914454914629459381, + 36895221.676002673804759979, 30733006.278359245508909225, 25600000.000000011175870895, 21324305.018005173653364182, + 17762733.769567202776670456, 14796013.783432489261031151, 12324793.397207930684089661, 10266314.597107734531164169, + 8551641.557793911546468735, 7123352.069650243036448956, 5933614.542338287457823753, 4942586.185941123403608799, + 4117078.726827629376202822, 3429446.974766122177243233, 2856663.020819837693125010, 2379545.062094463035464287, + 1982115.027663686312735081, 1651063.493385632522404194, 1375303.966290952404960990, 1145601.612096115713939071, + 954263.992400625254958868, 794883.454751964658498764, 662122.548550648498348892, 551535.280648162588477135, + 459418.224716113239992410, 382686.498229563992936164, 318770.453692168579436839, 265529.624424206791445613, + 221181.043067896069260314, 184239.532288295013131574, 153467.968081648985389620, 127835.850072912653558888, + 106484.791374639346031472, 88699.772306697457679547, 73885.195300610314006917, 61544.939097855312866159, + 51265.744282703839417081, 42703.373752321524079889, 35571.084655952341563534, 29630.025743156678800005, + 24681.238540563208516687, 20558.994486762283486314, 17125.244894500214286381, 14264.997876498367986642, + 11882.467414048716818797, 9897.865605612574654515, 8244.730671925974093028, 6867.701235916098994494, + 5720.662340906482313585, 4765.201119629112326948, 3969.320396371519564127, 3306.367142438103201130, + 2754.139900267978191550, 2294.145284983308101801, 1910.978664554782881169, 1591.808278354154936096, + 1325.945517883190177599, 1104.486978929608085309, 920.016297933984674273, 766.355787448445425980, + 638.359553275944676898, 531.741165047412550848, 442.930109144548907807, 368.952216760026544762, +}; + +#endif /* AVCODEC_MPCDATA_H */ diff --git a/include/libavcodec/mpeg12.h b/include/libavcodec/mpeg12.h new file mode 100644 index 0000000..86dd627 --- /dev/null +++ b/include/libavcodec/mpeg12.h @@ -0,0 +1,41 @@ +/* + * MPEG-1/2 common code + * Copyright (c) 2007 Aurelien Jacobs + * + * 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_MPEG12_H +#define AVCODEC_MPEG12_H + +#include "libavutil/rational.h" + +/* Start codes. */ +#define SEQ_END_CODE 0x000001b7 +#define SEQ_START_CODE 0x000001b3 +#define GOP_START_CODE 0x000001b8 +#define PICTURE_START_CODE 0x00000100 +#define SLICE_MIN_START_CODE 0x00000101 +#define SLICE_MAX_START_CODE 0x000001af +#define EXT_START_CODE 0x000001b5 +#define USER_START_CODE 0x000001b2 + +void ff_mpeg12_find_best_frame_rate(AVRational frame_rate, + int *code, int *ext_n, int *ext_d, + int nonstandard); + +#endif /* AVCODEC_MPEG12_H */ diff --git a/include/libavcodec/mpeg12codecs.h b/include/libavcodec/mpeg12codecs.h new file mode 100644 index 0000000..f8cf550 --- /dev/null +++ b/include/libavcodec/mpeg12codecs.h @@ -0,0 +1,29 @@ +/* + * MPEG-1/2 codecs common code + * Copyright (c) 2007 Aurelien Jacobs + * + * 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_MPEG12CODECS_H +#define AVCODEC_MPEG12CODECS_H + +#include "mpegvideo.h" + +void ff_mpeg1_clean_buffers(MpegEncContext *s); + +#endif /* AVCODEC_MPEG12CODECS_H */ diff --git a/include/libavcodec/mpeg12data.h b/include/libavcodec/mpeg12data.h new file mode 100644 index 0000000..bc39655 --- /dev/null +++ b/include/libavcodec/mpeg12data.h @@ -0,0 +1,53 @@ +/* + * MPEG-1/2 tables + * copyright (c) 2000,2001 Fabrice Bellard + * copyright (c) 2002-2004 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * MPEG-1/2 tables. + */ + +#ifndef AVCODEC_MPEG12DATA_H +#define AVCODEC_MPEG12DATA_H + +#include +#include "libavutil/rational.h" + +extern const uint16_t ff_mpeg1_default_intra_matrix[]; +extern const uint16_t ff_mpeg1_default_non_intra_matrix[64]; + +extern const uint16_t ff_mpeg12_vlc_dc_lum_code[12]; +extern const unsigned char ff_mpeg12_vlc_dc_lum_bits[12]; +extern const uint16_t ff_mpeg12_vlc_dc_chroma_code[12]; +extern const unsigned char ff_mpeg12_vlc_dc_chroma_bits[12]; + +extern const uint8_t ff_mpeg12_mbAddrIncrTable[36][2]; +extern const uint8_t ff_mpeg12_mbPatTable[64][2]; + +extern const uint8_t ff_mpeg12_mbMotionVectorTable[17][2]; + +extern const AVRational ff_mpeg12_frame_rate_tab[]; +extern const AVRational ff_mpeg2_frame_rate_tab[]; + +extern const float ff_mpeg1_aspect[16]; +extern const AVRational ff_mpeg2_aspect[16]; + +#endif /* AVCODEC_MPEG12DATA_H */ diff --git a/include/libavcodec/mpeg12dec.h b/include/libavcodec/mpeg12dec.h new file mode 100644 index 0000000..79809b7 --- /dev/null +++ b/include/libavcodec/mpeg12dec.h @@ -0,0 +1,52 @@ +/* + * MPEG-1/2 decoder header + * Copyright (c) 2007 Aurelien Jacobs + * + * 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_MPEG12DEC_H +#define AVCODEC_MPEG12DEC_H + +#include "get_bits.h" +#include "mpeg12vlc.h" + +#define MB_TYPE_ZERO_MV MB_TYPE_CODEC_SPECIFIC + +static inline int decode_dc(GetBitContext *gb, int component) +{ + int code, diff; + + if (component == 0) { + code = get_vlc2(gb, ff_dc_lum_vlc, DC_VLC_BITS, 2); + } else { + code = get_vlc2(gb, ff_dc_chroma_vlc, DC_VLC_BITS, 2); + } + if (code == 0) { + diff = 0; + } else { + diff = get_xbits(gb, code); + } + return diff; +} + +int ff_mpeg1_decode_block_intra(GetBitContext *gb, + const uint16_t *quant_matrix, + const uint8_t *scantable, int last_dc[3], + int16_t *block, int index, int qscale); + +#endif /* AVCODEC_MPEG12DEC_H */ diff --git a/include/libavcodec/mpeg12enc.h b/include/libavcodec/mpeg12enc.h new file mode 100644 index 0000000..0b35af8 --- /dev/null +++ b/include/libavcodec/mpeg12enc.h @@ -0,0 +1,35 @@ +/* + * MPEG-1/2 encoder header + * Copyright (c) 2007 Aurelien Jacobs + * + * 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_MPEG12ENC_H +#define AVCODEC_MPEG12ENC_H + +#include + +#include "mpegvideo.h" + +void ff_mpeg1_encode_picture_header(MpegEncContext *s); +void ff_mpeg1_encode_mb(MpegEncContext *s, int16_t block[8][64], + int motion_x, int motion_y); +void ff_mpeg1_encode_init(MpegEncContext *s); +void ff_mpeg1_encode_slice_header(MpegEncContext *s); + +#endif /* AVCODEC_MPEG12ENC_H */ diff --git a/include/libavcodec/mpeg12vlc.h b/include/libavcodec/mpeg12vlc.h new file mode 100644 index 0000000..53f5394 --- /dev/null +++ b/include/libavcodec/mpeg12vlc.h @@ -0,0 +1,70 @@ +/* + * MPEG-1/2 VLC + * copyright (c) 2000,2001 Fabrice Bellard + * copyright (c) 2002-2004 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * MPEG-1/2 VLC. + */ + +#ifndef AVCODEC_MPEG12VLC_H +#define AVCODEC_MPEG12VLC_H + +#include "vlc.h" + +#define DC_VLC_BITS 9 +#define MV_VLC_BITS 8 +#define TEX_VLC_BITS 9 + +#define MBINCR_VLC_BITS 9 +#define MB_PAT_VLC_BITS 9 +#define MB_PTYPE_VLC_BITS 6 +#define MB_BTYPE_VLC_BITS 6 + +extern VLCElem ff_dc_lum_vlc[]; +extern VLCElem ff_dc_chroma_vlc[]; +extern VLCElem ff_mbincr_vlc[]; +extern VLCElem ff_mb_ptype_vlc[]; +extern VLCElem ff_mb_btype_vlc[]; +extern VLCElem ff_mb_pat_vlc[]; +extern VLCElem ff_mv_vlc[]; + +void ff_mpeg12_init_vlcs(void); + +#define MPEG12_RL_NB_ELEMS 111 + +extern const int8_t ff_mpeg12_level[MPEG12_RL_NB_ELEMS]; +extern const int8_t ff_mpeg12_run[MPEG12_RL_NB_ELEMS]; + +extern const uint16_t ff_mpeg1_vlc_table[MPEG12_RL_NB_ELEMS + 2][2]; +extern const uint16_t ff_mpeg2_vlc_table[MPEG12_RL_NB_ELEMS + 2][2]; + +extern RL_VLC_ELEM ff_mpeg1_rl_vlc[]; +extern RL_VLC_ELEM ff_mpeg2_rl_vlc[]; + +void ff_init_2d_vlc_rl(const uint16_t table_vlc[][2], RL_VLC_ELEM rl_vlc[], + const int8_t table_run[], const uint8_t table_level[], + int n, unsigned static_size, int flags); + +void ff_mpeg1_init_uni_ac_vlc(const int8_t max_level[], const uint8_t index_run[], + const uint16_t table_vlc[][2], uint8_t uni_ac_vlc_len[]); + +#endif /* AVCODEC_MPEG12VLC_H */ diff --git a/include/libavcodec/mpeg4audio.h b/include/libavcodec/mpeg4audio.h new file mode 100644 index 0000000..0819e48 --- /dev/null +++ b/include/libavcodec/mpeg4audio.h @@ -0,0 +1,121 @@ +/* + * MPEG-4 Audio common header + * Copyright (c) 2008 Baptiste Coudurier + * + * 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_MPEG4AUDIO_H +#define AVCODEC_MPEG4AUDIO_H + +#include + +#include "get_bits.h" + +typedef struct MPEG4AudioConfig { + int object_type; + int sampling_index; + int sample_rate; + int chan_config; + int sbr; ///< -1 implicit, 1 presence + int ext_object_type; + int ext_sampling_index; + int ext_sample_rate; + int ext_chan_config; + int channels; + int ps; ///< -1 implicit, 1 presence + int frame_length_short; +} MPEG4AudioConfig; + +extern const int ff_mpeg4audio_sample_rates[16]; +extern const uint8_t ff_mpeg4audio_channels[15]; + +/** + * Parse MPEG-4 systems extradata from a potentially unaligned GetBitContext to retrieve audio configuration. + * @param[in] c MPEG4AudioConfig structure to fill. + * @param[in] gb Extradata from container. + * @param[in] sync_extension look for a sync extension after config if true. + * @param[in] logctx opaque struct starting with an AVClass element, used for logging. + * @return negative AVERROR code on error, on success AudioSpecificConfig bit index in extradata. + */ +int ff_mpeg4audio_get_config_gb(MPEG4AudioConfig *c, GetBitContext *gb, + int sync_extension, void *logctx); + +/** + * Parse MPEG-4 systems extradata from a raw buffer to retrieve audio configuration. + * @param[in] c MPEG4AudioConfig structure to fill. + * @param[in] buf Extradata from container. + * @param[in] size Extradata size in bytes. + * @param[in] sync_extension look for a sync extension after config if true. + * @param[in] logctx opaque struct starting with an AVClass element, used for logging. + * @return negative AVERROR code on error, AudioSpecificConfig bit index in extradata on success. + */ +int avpriv_mpeg4audio_get_config2(MPEG4AudioConfig *c, const uint8_t *buf, + int size, int sync_extension, void *logctx); + +enum AudioObjectType { + AOT_NULL = 0, + // Support? Name + AOT_AAC_MAIN = 1, ///< Y Main + AOT_AAC_LC = 2, ///< Y Low Complexity + AOT_AAC_SSR = 3, ///< N (code in SoC repo) Scalable Sample Rate + AOT_AAC_LTP = 4, ///< Y Long Term Prediction + AOT_SBR = 5, ///< Y Spectral Band Replication + AOT_AAC_SCALABLE = 6, ///< N Scalable + AOT_TWINVQ = 7, ///< N Twin Vector Quantizer + AOT_CELP = 8, ///< N Code Excited Linear Prediction + AOT_HVXC = 9, ///< N Harmonic Vector eXcitation Coding + + AOT_TTSI = 12, ///< N Text-To-Speech Interface + AOT_MAINSYNTH = 13, ///< N Main Synthesis + AOT_WAVESYNTH = 14, ///< N Wavetable Synthesis + AOT_MIDI = 15, ///< N General MIDI + AOT_SAFX = 16, ///< N Algorithmic Synthesis and Audio Effects + AOT_ER_AAC_LC = 17, ///< N Error Resilient Low Complexity + + AOT_ER_AAC_LTP = 19, ///< N Error Resilient Long Term Prediction + AOT_ER_AAC_SCALABLE = 20, ///< N Error Resilient Scalable + AOT_ER_TWINVQ = 21, ///< N Error Resilient Twin Vector Quantizer + AOT_ER_BSAC = 22, ///< N Error Resilient Bit-Sliced Arithmetic Coding + AOT_ER_AAC_LD = 23, ///< N Error Resilient Low Delay + AOT_ER_CELP = 24, ///< N Error Resilient Code Excited Linear Prediction + AOT_ER_HVXC = 25, ///< N Error Resilient Harmonic Vector eXcitation Coding + AOT_ER_HILN = 26, ///< N Error Resilient Harmonic and Individual Lines plus Noise + AOT_ER_PARAM = 27, ///< N Error Resilient Parametric + AOT_SSC = 28, ///< N SinuSoidal Coding + AOT_PS = 29, ///< N Parametric Stereo + AOT_SURROUND = 30, ///< N MPEG Surround + AOT_ESCAPE = 31, ///< Y Escape Value + AOT_L1 = 32, ///< Y Layer 1 + AOT_L2 = 33, ///< Y Layer 2 + AOT_L3 = 34, ///< Y Layer 3 + AOT_DST = 35, ///< N Direct Stream Transfer + AOT_ALS = 36, ///< Y Audio LosslesS + AOT_SLS = 37, ///< N Scalable LosslesS + AOT_SLS_NON_CORE = 38, ///< N Scalable LosslesS (non core) + AOT_ER_AAC_ELD = 39, ///< N Error Resilient Enhanced Low Delay + AOT_SMR_SIMPLE = 40, ///< N Symbolic Music Representation Simple + AOT_SMR_MAIN = 41, ///< N Symbolic Music Representation Main + AOT_USAC = 42, ///< Y Unified Speech and Audio Coding + AOT_SAOC = 43, ///< N Spatial Audio Object Coding + AOT_LD_SURROUND = 44, ///< N Low Delay MPEG Surround +}; + +#define MAX_PCE_SIZE 320 /// 16; bits -= 16) + ff_pce_copy_bits(pb, gb, 16); + if (bits) + ff_pce_copy_bits(pb, gb, bits); + align_put_bits(pb); + align_get_bits(gb); + comment_size = ff_pce_copy_bits(pb, gb, 8); + for (; comment_size > 0; comment_size--) + ff_pce_copy_bits(pb, gb, 8); + + return put_bits_count(pb) - offset; +} + +#endif /* AVCODEC_MPEG4AUDIO_COPY_PCE_H */ diff --git a/include/libavcodec/mpeg4audio_sample_rates.h b/include/libavcodec/mpeg4audio_sample_rates.h new file mode 100644 index 0000000..0b8caa6 --- /dev/null +++ b/include/libavcodec/mpeg4audio_sample_rates.h @@ -0,0 +1,30 @@ +/* + * MPEG-4 Audio sample rates + * Copyright (c) 2008 Baptiste Coudurier + * Copyright (c) 2009 Alex Converse + * + * 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_MPEG4AUDIO_SAMPLE_RATES_H +#define AVCODEC_MPEG4AUDIO_SAMPLE_RATES_H + +const int ff_mpeg4audio_sample_rates[16] = { + 96000, 88200, 64000, 48000, 44100, 32000, + 24000, 22050, 16000, 12000, 11025, 8000, 7350 +}; +#endif diff --git a/include/libavcodec/mpeg4data.h b/include/libavcodec/mpeg4data.h new file mode 100644 index 0000000..d3ba947 --- /dev/null +++ b/include/libavcodec/mpeg4data.h @@ -0,0 +1,457 @@ +/* + * copyright (c) 2000,2001 Fabrice Bellard + * H.263+ support + * copyright (c) 2002-2004 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * MPEG-4 tables. + */ + +#ifndef AVCODEC_MPEG4DATA_H +#define AVCODEC_MPEG4DATA_H + +#include "mpeg4videodata.h" + +/* dc encoding for MPEG-4 */ +const uint8_t ff_mpeg4_DCtab_lum[13][2] = +{ + {3,3}, {3,2}, {2,2}, {2,3}, {1,3}, {1,4}, {1,5}, {1,6}, {1,7}, + {1,8}, {1,9}, {1,10}, {1,11}, +}; + +const uint8_t ff_mpeg4_DCtab_chrom[13][2] = +{ + {3,2}, {2,2}, {1,2}, {1,3}, {1,4}, {1,5}, {1,6}, {1,7}, {1,8}, + {1,9}, {1,10}, {1,11}, {1,12}, +}; + +const uint16_t ff_mpeg4_intra_vlc[103][2] = { +{ 0x2, 2 }, +{ 0x6, 3 },{ 0xf, 4 },{ 0xd, 5 },{ 0xc, 5 }, +{ 0x15, 6 },{ 0x13, 6 },{ 0x12, 6 },{ 0x17, 7 }, +{ 0x1f, 8 },{ 0x1e, 8 },{ 0x1d, 8 },{ 0x25, 9 }, +{ 0x24, 9 },{ 0x23, 9 },{ 0x21, 9 },{ 0x21, 10 }, +{ 0x20, 10 },{ 0xf, 10 },{ 0xe, 10 },{ 0x7, 11 }, +{ 0x6, 11 },{ 0x20, 11 },{ 0x21, 11 },{ 0x50, 12 }, +{ 0x51, 12 },{ 0x52, 12 },{ 0xe, 4 },{ 0x14, 6 }, +{ 0x16, 7 },{ 0x1c, 8 },{ 0x20, 9 },{ 0x1f, 9 }, +{ 0xd, 10 },{ 0x22, 11 },{ 0x53, 12 },{ 0x55, 12 }, +{ 0xb, 5 },{ 0x15, 7 },{ 0x1e, 9 },{ 0xc, 10 }, +{ 0x56, 12 },{ 0x11, 6 },{ 0x1b, 8 },{ 0x1d, 9 }, +{ 0xb, 10 },{ 0x10, 6 },{ 0x22, 9 },{ 0xa, 10 }, +{ 0xd, 6 },{ 0x1c, 9 },{ 0x8, 10 },{ 0x12, 7 }, +{ 0x1b, 9 },{ 0x54, 12 },{ 0x14, 7 },{ 0x1a, 9 }, +{ 0x57, 12 },{ 0x19, 8 },{ 0x9, 10 },{ 0x18, 8 }, +{ 0x23, 11 },{ 0x17, 8 },{ 0x19, 9 },{ 0x18, 9 }, +{ 0x7, 10 },{ 0x58, 12 },{ 0x7, 4 },{ 0xc, 6 }, +{ 0x16, 8 },{ 0x17, 9 },{ 0x6, 10 },{ 0x5, 11 }, +{ 0x4, 11 },{ 0x59, 12 },{ 0xf, 6 },{ 0x16, 9 }, +{ 0x5, 10 },{ 0xe, 6 },{ 0x4, 10 },{ 0x11, 7 }, +{ 0x24, 11 },{ 0x10, 7 },{ 0x25, 11 },{ 0x13, 7 }, +{ 0x5a, 12 },{ 0x15, 8 },{ 0x5b, 12 },{ 0x14, 8 }, +{ 0x13, 8 },{ 0x1a, 8 },{ 0x15, 9 },{ 0x14, 9 }, +{ 0x13, 9 },{ 0x12, 9 },{ 0x11, 9 },{ 0x26, 11 }, +{ 0x27, 11 },{ 0x5c, 12 },{ 0x5d, 12 },{ 0x5e, 12 }, +{ 0x5f, 12 },{ 0x3, 7 }, +}; + +const int8_t ff_mpeg4_intra_level[102] = { + 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, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 1, 2, 3, + 4, 5, 1, 2, 3, 4, 1, 2, + 3, 1, 2, 3, 1, 2, 3, 1, + 2, 3, 1, 2, 1, 2, 1, 1, + 1, 1, 1, 1, 2, 3, 4, 5, + 6, 7, 8, 1, 2, 3, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, +}; + +const int8_t ff_mpeg4_intra_run[102] = { + 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, 1, + 1, 1, 1, 1, 1, 2, 2, 2, + 2, 2, 3, 3, 3, 3, 4, 4, + 4, 5, 5, 5, 6, 6, 6, 7, + 7, 7, 8, 8, 9, 9, 10, 11, + 12, 13, 14, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 1, 1, 2, 2, + 3, 3, 4, 4, 5, 5, 6, 6, + 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, +}; + +RLTable ff_mpeg4_rl_intra = { + 102, + 67, + ff_mpeg4_intra_vlc, + ff_mpeg4_intra_run, + ff_mpeg4_intra_level, +}; + +/* Note this is identical to the intra rvlc except that it is reordered. */ +static const uint16_t inter_rvlc[170][2]={ +{0x0006, 3},{0x0001, 4},{0x0004, 5},{0x001C, 7}, +{0x003C, 8},{0x003D, 8},{0x007C, 9},{0x00FC, 10}, +{0x00FD, 10},{0x01FC, 11},{0x01FD, 11},{0x03FC, 12}, +{0x07FC, 13},{0x07FD, 13},{0x0BFC, 13},{0x0BFD, 13}, +{0x0FFC, 14},{0x0FFD, 14},{0x1FFC, 15},{0x0007, 3}, +{0x000C, 6},{0x005C, 8},{0x007D, 9},{0x017C, 10}, +{0x02FC, 11},{0x03FD, 12},{0x0DFC, 13},{0x17FC, 14}, +{0x17FD, 14},{0x000A, 4},{0x001D, 7},{0x00BC, 9}, +{0x02FD, 11},{0x05FC, 12},{0x1BFC, 14},{0x1BFD, 14}, +{0x0005, 5},{0x005D, 8},{0x017D, 10},{0x05FD, 12}, +{0x0DFD, 13},{0x1DFC, 14},{0x1FFD, 15},{0x0008, 5}, +{0x006C, 8},{0x037C, 11},{0x0EFC, 13},{0x2FFC, 15}, +{0x0009, 5},{0x00BD, 9},{0x037D, 11},{0x0EFD, 13}, +{0x000D, 6},{0x01BC, 10},{0x06FC, 12},{0x1DFD, 14}, +{0x0014, 6},{0x01BD, 10},{0x06FD, 12},{0x2FFD, 15}, +{0x0015, 6},{0x01DC, 10},{0x0F7C, 13},{0x002C, 7}, +{0x01DD, 10},{0x1EFC, 14},{0x002D, 7},{0x03BC, 11}, +{0x0034, 7},{0x077C, 12},{0x006D, 8},{0x0F7D, 13}, +{0x0074, 8},{0x1EFD, 14},{0x0075, 8},{0x1F7C, 14}, +{0x00DC, 9},{0x1F7D, 14},{0x00DD, 9},{0x1FBC, 14}, +{0x00EC, 9},{0x37FC, 15},{0x01EC, 10},{0x01ED, 10}, +{0x01F4, 10},{0x03BD, 11},{0x03DC, 11},{0x03DD, 11}, +{0x03EC, 11},{0x03ED, 11},{0x03F4, 11},{0x077D, 12}, +{0x07BC, 12},{0x07BD, 12},{0x0FBC, 13},{0x0FBD, 13}, +{0x0FDC, 13},{0x0FDD, 13},{0x1FBD, 14},{0x1FDC, 14}, +{0x1FDD, 14},{0x37FD, 15},{0x3BFC, 15}, +{0x000B, 4},{0x0078, 8},{0x03F5, 11},{0x0FEC, 13}, +{0x1FEC, 14},{0x0012, 5},{0x00ED, 9},{0x07DC, 12}, +{0x1FED, 14},{0x3BFD, 15},{0x0013, 5},{0x03F8, 11}, +{0x3DFC, 15},{0x0018, 6},{0x07DD, 12},{0x0019, 6}, +{0x07EC, 12},{0x0022, 6},{0x0FED, 13},{0x0023, 6}, +{0x0FF4, 13},{0x0035, 7},{0x0FF5, 13},{0x0038, 7}, +{0x0FF8, 13},{0x0039, 7},{0x0FF9, 13},{0x0042, 7}, +{0x1FF4, 14},{0x0043, 7},{0x1FF5, 14},{0x0079, 8}, +{0x1FF8, 14},{0x0082, 8},{0x3DFD, 15},{0x0083, 8}, +{0x00F4, 9},{0x00F5, 9},{0x00F8, 9},{0x00F9, 9}, +{0x0102, 9},{0x0103, 9},{0x01F5, 10},{0x01F8, 10}, +{0x01F9, 10},{0x0202, 10},{0x0203, 10},{0x03F9, 11}, +{0x0402, 11},{0x0403, 11},{0x07ED, 12},{0x07F4, 12}, +{0x07F5, 12},{0x07F8, 12},{0x07F9, 12},{0x0802, 12}, +{0x0803, 12},{0x1002, 13},{0x1003, 13},{0x1FF9, 14}, +{0x2002, 14},{0x2003, 14},{0x3EFC, 15},{0x3EFD, 15}, +{0x3F7C, 15},{0x3F7D, 15},{0x0000, 4} +}; + +static const int8_t inter_rvlc_run[169]={ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 2, 2, + 2, 2, 2, 2, 3, 3, 3, 3, + 3, 3, 3, 4, 4, 4, 4, 4, + 5, 5, 5, 5, 6, 6, 6, 6, + 7, 7, 7, 7, 8, 8, 8, 9, + 9, 9, 10, 10, 11, 11, 12, 12, +13, 13, 14, 14, 15, 15, 16, 16, +17, 17, 18, 19, 20, 21, 22, 23, +24, 25, 26, 27, 28, 29, 30, 31, +32, 33, 34, 35, 36, 37, 38, + 0, 0, 0, 0, 0, 1, 1, 1, + 1, 1, 2, 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, 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, +}; + +static const int8_t inter_rvlc_level[169]={ + 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, 16, +17, 18, 19, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 1, 2, 3, + 4, 5, 6, 7, 1, 2, 3, 4, + 5, 6, 7, 1, 2, 3, 4, 5, + 1, 2, 3, 4, 1, 2, 3, 4, + 1, 2, 3, 4, 1, 2, 3, 1, + 2, 3, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 2, 1, 2, 1, 2, + 1, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, + 1, 2, 3, 4, 5, 1, 2, 3, + 4, 5, 1, 2, 3, 1, 2, 1, + 2, 1, 2, 1, 2, 1, 2, 1, + 2, 1, 2, 1, 2, 1, 2, 1, + 2, 1, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, +}; + +RLTable ff_rvlc_rl_inter = { + 169, + 103, + inter_rvlc, + inter_rvlc_run, + inter_rvlc_level, +}; + +static const uint16_t intra_rvlc[170][2]={ +{0x0006, 3},{0x0007, 3},{0x000A, 4},{0x0009, 5}, +{0x0014, 6},{0x0015, 6},{0x0034, 7},{0x0074, 8}, +{0x0075, 8},{0x00DD, 9},{0x00EC, 9},{0x01EC, 10}, +{0x01ED, 10},{0x01F4, 10},{0x03EC, 11},{0x03ED, 11}, +{0x03F4, 11},{0x077D, 12},{0x07BC, 12},{0x0FBD, 13}, +{0x0FDC, 13},{0x07BD, 12},{0x0FDD, 13},{0x1FBD, 14}, +{0x1FDC, 14},{0x1FDD, 14},{0x1FFC, 15},{0x0001, 4}, +{0x0008, 5},{0x002D, 7},{0x006C, 8},{0x006D, 8}, +{0x00DC, 9},{0x01DD, 10},{0x03DC, 11},{0x03DD, 11}, +{0x077C, 12},{0x0FBC, 13},{0x1F7D, 14},{0x1FBC, 14}, +{0x0004, 5},{0x002C, 7},{0x00BC, 9},{0x01DC, 10}, +{0x03BC, 11},{0x03BD, 11},{0x0EFD, 13},{0x0F7C, 13}, +{0x0F7D, 13},{0x1EFD, 14},{0x1F7C, 14},{0x0005, 5}, +{0x005C, 8},{0x00BD, 9},{0x037D, 11},{0x06FC, 12}, +{0x0EFC, 13},{0x1DFD, 14},{0x1EFC, 14},{0x1FFD, 15}, +{0x000C, 6},{0x005D, 8},{0x01BD, 10},{0x03FD, 12}, +{0x06FD, 12},{0x1BFD, 14},{0x000D, 6},{0x007D, 9}, +{0x02FC, 11},{0x05FC, 12},{0x1BFC, 14},{0x1DFC, 14}, +{0x001C, 7},{0x017C, 10},{0x02FD, 11},{0x05FD, 12}, +{0x2FFC, 15},{0x001D, 7},{0x017D, 10},{0x037C, 11}, +{0x0DFD, 13},{0x2FFD, 15},{0x003C, 8},{0x01BC, 10}, +{0x0BFD, 13},{0x17FD, 14},{0x003D, 8},{0x01FD, 11}, +{0x0DFC, 13},{0x37FC, 15},{0x007C, 9},{0x03FC, 12}, +{0x00FC, 10},{0x0BFC, 13},{0x00FD, 10},{0x37FD, 15}, +{0x01FC, 11},{0x07FC, 13},{0x07FD, 13},{0x0FFC, 14}, +{0x0FFD, 14},{0x17FC, 14},{0x3BFC, 15}, +{0x000B, 4},{0x0078, 8},{0x03F5, 11},{0x0FEC, 13}, +{0x1FEC, 14},{0x0012, 5},{0x00ED, 9},{0x07DC, 12}, +{0x1FED, 14},{0x3BFD, 15},{0x0013, 5},{0x03F8, 11}, +{0x3DFC, 15},{0x0018, 6},{0x07DD, 12},{0x0019, 6}, +{0x07EC, 12},{0x0022, 6},{0x0FED, 13},{0x0023, 6}, +{0x0FF4, 13},{0x0035, 7},{0x0FF5, 13},{0x0038, 7}, +{0x0FF8, 13},{0x0039, 7},{0x0FF9, 13},{0x0042, 7}, +{0x1FF4, 14},{0x0043, 7},{0x1FF5, 14},{0x0079, 8}, +{0x1FF8, 14},{0x0082, 8},{0x3DFD, 15},{0x0083, 8}, +{0x00F4, 9},{0x00F5, 9},{0x00F8, 9},{0x00F9, 9}, +{0x0102, 9},{0x0103, 9},{0x01F5, 10},{0x01F8, 10}, +{0x01F9, 10},{0x0202, 10},{0x0203, 10},{0x03F9, 11}, +{0x0402, 11},{0x0403, 11},{0x07ED, 12},{0x07F4, 12}, +{0x07F5, 12},{0x07F8, 12},{0x07F9, 12},{0x0802, 12}, +{0x0803, 12},{0x1002, 13},{0x1003, 13},{0x1FF9, 14}, +{0x2002, 14},{0x2003, 14},{0x3EFC, 15},{0x3EFD, 15}, +{0x3F7C, 15},{0x3F7D, 15},{0x0000, 4} +}; + +static const int8_t intra_rvlc_run[169]={ + 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, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 4, 4, 4, 4, + 4, 4, 5, 5, 5, 5, 5, 5, + 6, 6, 6, 6, 6, 7, 7, 7, + 7, 7, 8, 8, 8, 8, 9, 9, + 9, 9, 10, 10, 11, 11, 12, 12, +13, 14, 15, 16, 17, 18, 19, + 0, 0, 0, 0, 0, 1, 1, 1, + 1, 1, 2, 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, 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, +}; + +static const int8_t intra_rvlc_level[169]={ + 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, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, + 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 1, 2, 3, 4, + 5, 6, 1, 2, 3, 4, 5, 6, + 1, 2, 3, 4, 5, 1, 2, 3, + 4, 5, 1, 2, 3, 4, 1, 2, + 3, 4, 1, 2, 1, 2, 1, 2, + 1, 1, 1, 1, 1, 1, 1, + 1, 2, 3, 4, 5, 1, 2, 3, + 4, 5, 1, 2, 3, 1, 2, 1, + 2, 1, 2, 1, 2, 1, 2, 1, + 2, 1, 2, 1, 2, 1, 2, 1, + 2, 1, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, +}; + +RLTable ff_rvlc_rl_intra = { + 169, + 103, + intra_rvlc, + intra_rvlc_run, + intra_rvlc_level, +}; + +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] = { + {1, 1}, {1, 2}, {1, 3}, {1, 4}, +}; + +/* these matrixes will be permuted for the idct */ +const int16_t ff_mpeg4_default_intra_matrix[64] = { + 8, 17, 18, 19, 21, 23, 25, 27, + 17, 18, 19, 21, 23, 25, 27, 28, + 20, 21, 22, 23, 24, 26, 28, 30, + 21, 22, 23, 24, 26, 28, 30, 32, + 22, 23, 24, 26, 28, 30, 32, 35, + 23, 24, 26, 28, 30, 32, 35, 38, + 25, 26, 28, 30, 32, 35, 38, 41, + 27, 28, 30, 32, 35, 38, 41, 45, +}; + +const int16_t ff_mpeg4_default_non_intra_matrix[64] = { + 16, 17, 18, 19, 20, 21, 22, 23, + 17, 18, 19, 20, 21, 22, 23, 24, + 18, 19, 20, 21, 22, 23, 24, 25, + 19, 20, 21, 22, 23, 24, 26, 27, + 20, 21, 22, 23, 25, 26, 27, 28, + 21, 22, 23, 24, 26, 27, 28, 30, + 22, 23, 24, 26, 27, 28, 30, 31, + 23, 24, 25, 27, 28, 30, 31, 33, +}; + +const uint8_t ff_mpeg4_y_dc_scale_table[32]={ +// 0 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 + 0, 8, 8, 8, 8,10,12,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,34,36,38,40,42,44,46 +}; +const uint8_t ff_mpeg4_c_dc_scale_table[32]={ +// 0 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 + 0, 8, 8, 8, 8, 9, 9,10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17,18,18,19,20,21,22,23,24,25 +}; + +const uint8_t ff_mpeg4_dc_threshold[8]={ + 99, 13, 15, 17, 19, 21, 23, 0 +}; + +/* Note these are different in studio mode */ +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 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 uint8_t ff_mpeg4_studio_intra[12][24][2] = { + { + { 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 }, + }, + { + { 0, -6 }, { 21, 8 }, { 20, 8 }, { 19, 7 }, { 18, 5 }, { 17, 4 }, + { 16, 3 }, { 15, 2 }, { 14, 1 }, + }, + { + { 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 }, + }, + { + { 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 }, + }, + { + { 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 }, + }, + { + { 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 }, + }, + { + { 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 }, + }, + { + { 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 }, + }, + { + { 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 }, + }, + { + { 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 }, + }, + { + { 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 }, + }, + { + { 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/include/libavcodec/mpeg4video.h b/include/libavcodec/mpeg4video.h new file mode 100644 index 0000000..29b11eb --- /dev/null +++ b/include/libavcodec/mpeg4video.h @@ -0,0 +1,129 @@ +/* + * MPEG-4 encoder/decoder internal header. + * Copyright (c) 2000,2001 Fabrice Bellard + * Copyright (c) 2002-2010 Michael Niedermayer + * + * 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_MPEG4VIDEO_H +#define AVCODEC_MPEG4VIDEO_H + +#include + +#include "mpegvideo.h" + +void ff_mpeg4_clean_buffers(MpegEncContext *s); +int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s); +void ff_mpeg4_init_direct_mv(MpegEncContext *s); + +/** + * @return the mb_type + */ +int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my); + +#if 0 //3IV1 is quite rare and it slows things down a tiny bit +#define IS_3IV1 s->codec_tag == AV_RL32("3IV1") +#else +#define IS_3IV1 0 +#endif + +/** + * Predict the dc. + * encoding quantized level -> quantized diff + * decoding quantized diff -> quantized level + * @param n block index (0-3 are luma, 4-5 are chroma) + * @param dir_ptr pointer to an integer where the prediction direction will be stored + */ +static inline int ff_mpeg4_pred_dc(MpegEncContext *s, int n, int level, + int *dir_ptr, int encoding) +{ + int a, b, c, wrap, pred, scale, ret; + int16_t *dc_val; + + /* find prediction */ + if (n < 4) + scale = s->y_dc_scale; + else + scale = s->c_dc_scale; + if (IS_3IV1) + scale = 8; + + wrap = s->block_wrap[n]; + dc_val = s->dc_val[0] + s->block_index[n]; + + /* B C + * A X + */ + a = dc_val[-1]; + b = dc_val[-1 - wrap]; + c = dc_val[-wrap]; + + /* outside slice handling (we can't do that by memset as we need the + * dc for error resilience) */ + if (s->first_slice_line && n != 3) { + if (n != 2) + b = c = 1024; + if (n != 1 && s->mb_x == s->resync_mb_x) + b = a = 1024; + } + if (s->mb_x == s->resync_mb_x && s->mb_y == s->resync_mb_y + 1) { + if (n == 0 || n == 4 || n == 5) + b = 1024; + } + + if (abs(a - b) < abs(b - c)) { + pred = c; + *dir_ptr = 1; /* top */ + } else { + pred = a; + *dir_ptr = 0; /* left */ + } + /* we assume pred is positive */ + pred = FASTDIV((pred + (scale >> 1)), scale); + + if (encoding) { + ret = level - pred; + } else { + level += pred; + ret = level; + } + level *= scale; + if (level & (~2047)) { + if (!s->encoding && (s->avctx->err_recognition & (AV_EF_BITSTREAM | AV_EF_AGGRESSIVE))) { + if (level < 0) { + av_log(s->avctx, AV_LOG_ERROR, + "dc<0 at %dx%d\n", s->mb_x, s->mb_y); + return AVERROR_INVALIDDATA; + } + if (level > 2048 + scale) { + av_log(s->avctx, AV_LOG_ERROR, + "dc overflow at %dx%d\n", s->mb_x, s->mb_y); + return AVERROR_INVALIDDATA; + } + } + if (level < 0) + level = 0; + else if (!(s->workaround_bugs & FF_BUG_DC_CLIP)) + level = 2047; + } + dc_val[0] = level; + + return ret; +} + +#endif /* AVCODEC_MPEG4VIDEO_H */ diff --git a/include/libavcodec/mpeg4videodata.h b/include/libavcodec/mpeg4videodata.h new file mode 100644 index 0000000..8aac8a2 --- /dev/null +++ b/include/libavcodec/mpeg4videodata.h @@ -0,0 +1,60 @@ +/* + * MPEG-4 encoder/decoder data. + * Copyright (c) 2000,2001 Fabrice Bellard + * Copyright (c) 2002-2010 Michael Niedermayer + * + * 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_MPEG4VIDEODATA_H +#define AVCODEC_MPEG4VIDEODATA_H + +#include +#include "rl.h" + +/* dc encoding for MPEG-4 */ +extern const uint8_t ff_mpeg4_DCtab_lum[13][2]; +extern const uint8_t ff_mpeg4_DCtab_chrom[13][2]; + +extern const uint16_t ff_mpeg4_intra_vlc[103][2]; +extern const int8_t ff_mpeg4_intra_level[102]; +extern const int8_t ff_mpeg4_intra_run[102]; + +extern RLTable ff_mpeg4_rl_intra; +void ff_mpeg4_init_rl_intra(void); + +/* Note this is identical to the intra rvlc except that it is reordered. */ +extern RLTable ff_rvlc_rl_inter; +extern RLTable ff_rvlc_rl_intra; + +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 */ +extern const int16_t ff_mpeg4_default_intra_matrix[64]; +extern const int16_t ff_mpeg4_default_non_intra_matrix[64]; + +extern const uint8_t ff_mpeg4_y_dc_scale_table[32]; +extern const uint8_t ff_mpeg4_c_dc_scale_table[32]; + +extern const uint8_t ff_mpeg4_dc_threshold[8]; + +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]; + +#endif /* AVCODEC_MPEG4VIDEO_H */ diff --git a/include/libavcodec/mpeg4videodec.h b/include/libavcodec/mpeg4videodec.h new file mode 100644 index 0000000..734237b --- /dev/null +++ b/include/libavcodec/mpeg4videodec.h @@ -0,0 +1,112 @@ +/* + * MPEG-4 decoder internal header. + * Copyright (c) 2000,2001 Fabrice Bellard + * Copyright (c) 2002-2010 Michael Niedermayer + * + * 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_MPEG4VIDEODEC_H +#define AVCODEC_MPEG4VIDEODEC_H + +#include + +#include "get_bits.h" +#include "mpegvideo.h" +#include "mpeg4videodsp.h" + +#include "libavutil/mem_internal.h" + +typedef struct Mpeg4DecContext { + MpegEncContext m; + + /// number of bits to represent the fractional part of time + int time_increment_bits; + int shape; + int vol_sprite_usage; + int sprite_brightness_change; + int sprite_warping_accuracy; + int num_sprite_warping_points; + int real_sprite_warping_points; + int sprite_offset[2][2]; ///< sprite offset[isChroma][isMVY] + int sprite_delta[2][2]; ///< sprite_delta [isY][isMVY] + /// sprite trajectory points + uint16_t sprite_traj[4][2]; + /// sprite shift [isChroma] + int sprite_shift[2]; + + // reversible vlc + int rvlc; + /// could this stream contain resync markers + int resync_marker; + /// time distance of first I -> B, used for interlaced B-frames + int t_frame; + + int new_pred; + int enhancement_type; + int scalability; + + int quant_precision; + + /// QP above which the ac VLC should be used for intra dc + int intra_dc_threshold; + + /* bug workarounds */ + int divx_version; + int divx_build; + int xvid_build; + int lavc_build; + + int vo_type; + + /// flag for having shown the warning about invalid Divx B-frames + int showed_packed_warning; + /** does the stream contain the low_delay flag, + * used to work around buggy encoders. */ + int vol_control_parameters; + int cplx_estimation_trash_i; + int cplx_estimation_trash_p; + int cplx_estimation_trash_b; + + int rgb; + + Mpeg4VideoDSPContext mdsp; + + DECLARE_ALIGNED(8, int32_t, block32)[12][64]; + // 0 = DCT, 1 = DPCM top to bottom scan, -1 = DPCM bottom to top scan + int dpcm_direction; + int16_t dpcm_macroblock[3][256]; +} Mpeg4DecContext; + +int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb, + int header, int parse_only); +void ff_mpeg4_decode_studio(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, + uint8_t *dest_cr, int block_size, int uvlinesize, + int dct_linesize, int dct_offset); +void ff_mpeg4_mcsel_motion(MpegEncContext *s, + uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, + uint8_t *const *ref_picture); +int ff_mpeg4_decode_partitions(Mpeg4DecContext *ctx); +int ff_mpeg4_decode_video_packet_header(Mpeg4DecContext *ctx); +int ff_mpeg4_decode_studio_slice_header(Mpeg4DecContext *ctx); +int ff_mpeg4_workaround_bugs(AVCodecContext *avctx); +void ff_mpeg4_pred_ac(MpegEncContext *s, int16_t *block, int n, + int dir); +int ff_mpeg4_frame_end(AVCodecContext *avctx, const uint8_t *buf, int buf_size); + + +#endif diff --git a/include/libavcodec/mpeg4videodefs.h b/include/libavcodec/mpeg4videodefs.h new file mode 100644 index 0000000..27155ea --- /dev/null +++ b/include/libavcodec/mpeg4videodefs.h @@ -0,0 +1,68 @@ +/* + * MPEG-4 definitions. + * Copyright (c) 2000,2001 Fabrice Bellard + * Copyright (c) 2002-2010 Michael Niedermayer + * + * 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_MPEG4VIDEODEFS_H +#define AVCODEC_MPEG4VIDEODEFS_H + +// shapes +#define RECT_SHAPE 0 +#define BIN_SHAPE 1 +#define BIN_ONLY_SHAPE 2 +#define GRAY_SHAPE 3 + +#define SIMPLE_VO_TYPE 1 +#define CORE_VO_TYPE 3 +#define MAIN_VO_TYPE 4 +#define NBIT_VO_TYPE 5 +#define ARTS_VO_TYPE 10 +#define ACE_VO_TYPE 12 +#define SIMPLE_STUDIO_VO_TYPE 14 +#define CORE_STUDIO_VO_TYPE 15 +#define ADV_SIMPLE_VO_TYPE 17 + +#define VOT_VIDEO_ID 1 +#define VOT_STILL_TEXTURE_ID 2 + +// aspect_ratio_info +#define EXTENDED_PAR 15 + +//vol_sprite_usage / sprite_enable +#define STATIC_SPRITE 1 +#define GMC_SPRITE 2 + +#define MOTION_MARKER 0x1F001 +#define DC_MARKER 0x6B001 + +#define VOS_STARTCODE 0x1B0 +#define USER_DATA_STARTCODE 0x1B2 +#define GOP_STARTCODE 0x1B3 +#define VISUAL_OBJ_STARTCODE 0x1B5 +#define VOP_STARTCODE 0x1B6 +#define SLICE_STARTCODE 0x1B7 +#define EXT_STARTCODE 0x1B8 + +#define QUANT_MATRIX_EXT_ID 0x3 + +/* smaller packets likely don't contain a real frame */ +#define MAX_NVOP_SIZE 19 + +#endif /* AVCODEC_MPEG4VIDEODEFS_H */ diff --git a/include/libavcodec/mpeg4videodsp.h b/include/libavcodec/mpeg4videodsp.h new file mode 100644 index 0000000..e1ccb71 --- /dev/null +++ b/include/libavcodec/mpeg4videodsp.h @@ -0,0 +1,47 @@ +/* + * 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_MPEG4VIDEODSP_H +#define AVCODEC_MPEG4VIDEODSP_H + +#include + +void ff_gmc_c(uint8_t *dst, const uint8_t *src, int stride, int h, int ox, int oy, + int dxx, int dxy, int dyx, int dyy, int shift, int r, + int width, int height); + +typedef struct Mpeg4VideoDSPContext { + /** + * translational global motion compensation. + */ + void (*gmc1)(uint8_t *dst /* align 8 */, const uint8_t *src /* align 1 */, + int srcStride, int h, int x16, int y16, int rounder); + /** + * global motion compensation. + */ + void (*gmc)(uint8_t *dst /* align 8 */, const uint8_t *src /* align 1 */, + int stride, int h, int ox, int oy, + int dxx, int dxy, int dyx, int dyy, + int shift, int r, int width, int height); +} Mpeg4VideoDSPContext; + +void ff_mpeg4videodsp_init(Mpeg4VideoDSPContext *c); +void ff_mpeg4videodsp_init_ppc(Mpeg4VideoDSPContext *c); +void ff_mpeg4videodsp_init_x86(Mpeg4VideoDSPContext *c); + +#endif /* AVCODEC_MPEG4VIDEODSP_H */ diff --git a/include/libavcodec/mpeg4videoenc.h b/include/libavcodec/mpeg4videoenc.h new file mode 100644 index 0000000..f0d5c3d --- /dev/null +++ b/include/libavcodec/mpeg4videoenc.h @@ -0,0 +1,43 @@ +/* + * MPEG-4 encoder internal header. + * Copyright (c) 2000,2001 Fabrice Bellard + * Copyright (c) 2002-2010 Michael Niedermayer + * + * 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_MPEG4VIDEOENC_H +#define AVCODEC_MPEG4VIDEOENC_H + +#include + +#include "mpegvideo.h" +#include "put_bits.h" + +void ff_mpeg4_encode_mb(MpegEncContext *s, + int16_t block[6][64], + int motion_x, int motion_y); +void ff_set_mpeg4_time(MpegEncContext *s); +int ff_mpeg4_encode_picture_header(MpegEncContext *s); + +void ff_mpeg4_encode_video_packet_header(MpegEncContext *s); +void ff_mpeg4_stuffing(PutBitContext *pbc); +void ff_mpeg4_init_partitions(MpegEncContext *s); +void ff_mpeg4_merge_partitions(MpegEncContext *s); +void ff_clean_mpeg4_qscales(MpegEncContext *s); + +#endif diff --git a/include/libavcodec/mpeg_er.h b/include/libavcodec/mpeg_er.h new file mode 100644 index 0000000..bb627a4 --- /dev/null +++ b/include/libavcodec/mpeg_er.h @@ -0,0 +1,27 @@ +/* + * 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_MPEG_ER_H +#define AVCODEC_MPEG_ER_H + +#include "mpegvideo.h" + +int ff_mpeg_er_init(MpegEncContext *s); +void ff_mpeg_er_frame_start(MpegEncContext *s); + +#endif /* AVCODEC_MPEG_ER_H */ diff --git a/include/libavcodec/mpegaudio.h b/include/libavcodec/mpegaudio.h new file mode 100644 index 0000000..74590a8 --- /dev/null +++ b/include/libavcodec/mpegaudio.h @@ -0,0 +1,81 @@ +/* + * copyright (c) 2001 Fabrice Bellard + * + * 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 + */ + +/** + * @file + * mpeg audio declarations for both encoder and decoder. + */ + +#ifndef AVCODEC_MPEGAUDIO_H +#define AVCODEC_MPEGAUDIO_H + +#ifndef USE_FLOATS +# define USE_FLOATS 0 +#endif + +#include +#include "libavutil/internal.h" + +/* max frame size, in samples */ +#define MPA_FRAME_SIZE 1152 + +/* max compressed frame size */ +#define MPA_MAX_CODED_FRAME_SIZE 1792 + +#define MPA_MAX_CHANNELS 2 + +#define SBLIMIT 32 /* number of subbands */ + +#define MPA_STEREO 0 +#define MPA_JSTEREO 1 +#define MPA_DUAL 2 +#define MPA_MONO 3 + +#ifndef FRAC_BITS +#define FRAC_BITS 23 /* fractional bits for sb_samples and dct */ +#define WFRAC_BITS 16 /* fractional bits for window */ +#endif + +#define IMDCT_SCALAR 1.759 + +#define FRAC_ONE (1 << FRAC_BITS) + +#define FIX(a) ((int)((a) * FRAC_ONE)) + +#if USE_FLOATS +# define INTFLOAT float +# define SUINTFLOAT float +typedef float MPA_INT; +typedef float OUT_INT; +#elif FRAC_BITS <= 15 +# define INTFLOAT int +# define SUINTFLOAT SUINT +typedef int16_t MPA_INT; +typedef int16_t OUT_INT; +#else +# define INTFLOAT int +# define SUINTFLOAT SUINT +typedef int32_t MPA_INT; +typedef int16_t OUT_INT; +#endif + +int ff_mpa_l2_select_table(int bitrate, int nb_channels, int freq, int lsf); + +#endif /* AVCODEC_MPEGAUDIO_H */ diff --git a/include/libavcodec/mpegaudio_tablegen.h b/include/libavcodec/mpegaudio_tablegen.h new file mode 100644 index 0000000..bae6962 --- /dev/null +++ b/include/libavcodec/mpegaudio_tablegen.h @@ -0,0 +1,89 @@ +/* + * Header file for hardcoded mpegaudiodec tables + * + * Copyright (c) 2009 Reimar Döffinger + * + * 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_MPEGAUDIO_TABLEGEN_H +#define AVCODEC_MPEGAUDIO_TABLEGEN_H + +#include +#include +#include "libavutil/attributes.h" + +#if CONFIG_HARDCODED_TABLES +#define mpegaudio_tableinit() +#include "libavcodec/mpegaudio_tables.h" +#else +#if defined(BUILD_TABLES) || !USE_FLOATS +#define FIXED_TABLE +static uint32_t exp_table_fixed[512]; +static uint32_t expval_table_fixed[512][16]; +#endif + +#if defined(BUILD_TABLES) || USE_FLOATS +#define FLOAT_TABLE +static float exp_table_float[512]; +static float expval_table_float[512][16]; +#endif + +#define IMDCT_SCALAR 1.759 + +static av_cold void mpegaudio_tableinit(void) +{ + int i, value, exponent; + 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_lut[16]; + double exp2_base = 2.11758236813575084767080625169910490512847900390625e-22; // 2^(-72) + double exp2_val; + + for (i = 0; i < 16; ++i) + pow43_lut[i] = i * cbrt(i); + + for (exponent = 0; exponent < 512; exponent++) { + if (exponent && (exponent & 3) == 0) + exp2_base *= 2; + 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 */ diff --git a/include/libavcodec/mpegaudiodata.h b/include/libavcodec/mpegaudiodata.h new file mode 100644 index 0000000..720c4be --- /dev/null +++ b/include/libavcodec/mpegaudiodata.h @@ -0,0 +1,85 @@ +/* + * MPEG Audio common tables + * copyright (c) 2002 Fabrice Bellard + * + * 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 + */ + +/** + * @file + * mpeg audio layer common tables. + */ + +#ifndef AVCODEC_MPEGAUDIODATA_H +#define AVCODEC_MPEGAUDIODATA_H + +#include + +#include "config.h" + +#include "libavutil/attributes_internal.h" +#include "vlc.h" + +#define MODE_EXT_MS_STEREO 2 +#define MODE_EXT_I_STEREO 1 + +FF_VISIBILITY_PUSH_HIDDEN +extern const uint16_t ff_mpa_bitrate_tab[2][3][15]; +extern const uint16_t ff_mpa_freq_tab[3]; +extern const int ff_mpa_sblimit_table[5]; +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 const VLCElem *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]; + +/* Initialize tables shared between the fixed and + * floating point MPEG audio decoders. */ +void ff_mpegaudiodec_common_init_static(void); +FF_VISIBILITY_POP_HIDDEN + +#endif /* AVCODEC_MPEGAUDIODATA_H */ diff --git a/include/libavcodec/mpegaudiodec_common_tablegen.h b/include/libavcodec/mpegaudiodec_common_tablegen.h new file mode 100644 index 0000000..bf402c9 --- /dev/null +++ b/include/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/include/libavcodec/mpegaudiodecheader.h b/include/libavcodec/mpegaudiodecheader.h new file mode 100644 index 0000000..ed5d1f3 --- /dev/null +++ b/include/libavcodec/mpegaudiodecheader.h @@ -0,0 +1,81 @@ +/* + * MPEG Audio header decoder + * Copyright (c) 2001, 2002 Fabrice Bellard + * + * 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 + */ + +/** + * @file + * MPEG Audio header decoder. + */ + +#ifndef AVCODEC_MPEGAUDIODECHEADER_H +#define AVCODEC_MPEGAUDIODECHEADER_H + +#include +#include "codec_id.h" + +#define MP3_MASK 0xFFFE0CCF + +#define MPA_DECODE_HEADER \ + int frame_size; \ + int error_protection; \ + int layer; \ + int sample_rate; \ + int sample_rate_index; /* between 0 and 8 */ \ + int bit_rate; \ + int nb_channels; \ + int mode; \ + int mode_ext; \ + int lsf; + +typedef struct MPADecodeHeader { + MPA_DECODE_HEADER +} MPADecodeHeader; + +/* header decoding. MUST check the header before because no + consistency check is done there. Return 1 if free format found and + that the frame size must be computed externally */ +int avpriv_mpegaudio_decode_header(MPADecodeHeader *s, uint32_t header); + +/* useful helper to get MPEG audio stream info. Return -1 if error in + header, otherwise the coded frame size in bytes */ +int ff_mpa_decode_header(uint32_t head, int *sample_rate, + int *channels, int *frame_size, int *bitrate, enum AVCodecID *codec_id); + +/* fast header check for resync */ +static inline int ff_mpa_check_header(uint32_t header){ + /* header */ + if ((header & 0xffe00000) != 0xffe00000) + return -1; + /* version check */ + if ((header & (3<<19)) == 1<<19) + return -1; + /* layer check */ + if ((header & (3<<17)) == 0) + return -1; + /* bit rate */ + if ((header & (0xf<<12)) == 0xf<<12) + return -1; + /* frequency */ + if ((header & (3<<10)) == 3<<10) + return -1; + return 0; +} + +#endif /* AVCODEC_MPEGAUDIODECHEADER_H */ diff --git a/include/libavcodec/mpegaudiodsp.h b/include/libavcodec/mpegaudiodsp.h new file mode 100644 index 0000000..5e47a26 --- /dev/null +++ b/include/libavcodec/mpegaudiodsp.h @@ -0,0 +1,95 @@ +/* + * 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_MPEGAUDIODSP_H +#define AVCODEC_MPEGAUDIODSP_H + +#include +#include + +#include "libavutil/attributes_internal.h" +#include "libavutil/macros.h" + +typedef struct MPADSPContext { + void (*apply_window_float)(float *synth_buf, float *window, + int *dither_state, float *samples, + ptrdiff_t incr); + void (*apply_window_fixed)(int32_t *synth_buf, int32_t *window, + int *dither_state, int16_t *samples, + ptrdiff_t incr); + void (*dct32_float)(float *dst, const float *src); + void (*dct32_fixed)(int *dst, const int *src); + + void (*imdct36_blocks_float)(float *out, float *buf, float *in, + int count, int switch_point, int block_type); + void (*imdct36_blocks_fixed)(int *out, int *buf, int *in, + int count, int switch_point, int block_type); +} MPADSPContext; + +FF_VISIBILITY_PUSH_HIDDEN +void ff_mpadsp_init(MPADSPContext *s); + +extern int32_t ff_mpa_synth_window_fixed[]; +extern float ff_mpa_synth_window_float[]; + +extern const int32_t ff_mpa_enwindow[257]; + +void ff_mpa_synth_filter_fixed(MPADSPContext *s, + int32_t *synth_buf_ptr, int *synth_buf_offset, + int32_t *window, int *dither_state, + int16_t *samples, ptrdiff_t incr, + int32_t *sb_samples); + +void ff_mpa_synth_filter_float(MPADSPContext *s, + float *synth_buf_ptr, int *synth_buf_offset, + float *window, int *dither_state, + float *samples, ptrdiff_t incr, + float *sb_samples); + +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); + +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, + ptrdiff_t incr); +void ff_mpadsp_apply_window_fixed(int32_t *synth_buf, int32_t *window, + int *dither_state, int16_t *samples, + ptrdiff_t incr); + +void ff_imdct36_blocks_float(float *out, float *buf, float *in, + int count, int switch_point, int block_type); + +void ff_imdct36_blocks_fixed(int *out, int *buf, int *in, + int count, int switch_point, int block_type); + +/** For SSE implementation, MDCT_BUF_SIZE/2 should be 128-bit aligned */ +#define MDCT_BUF_SIZE FFALIGN(36, 2*4) + +extern int ff_mdct_win_fixed[8][MDCT_BUF_SIZE]; +extern float ff_mdct_win_float[8][MDCT_BUF_SIZE]; +FF_VISIBILITY_POP_HIDDEN + +#endif /* AVCODEC_MPEGAUDIODSP_H */ diff --git a/include/libavcodec/mpegaudiotab.h b/include/libavcodec/mpegaudiotab.h new file mode 100644 index 0000000..bb2e5de --- /dev/null +++ b/include/libavcodec/mpegaudiotab.h @@ -0,0 +1,102 @@ +/* + * mpeg audio layer 2 tables. Most of them come from the mpeg audio + * specification. + * + * Copyright (c) 2000, 2001 Fabrice Bellard + * + * 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 + */ + +/** + * @file + * mpeg audio layer 2 tables. + * Most of them come from the mpeg audio specification. + */ + +#ifndef AVCODEC_MPEGAUDIOTAB_H +#define AVCODEC_MPEGAUDIOTAB_H + +#include +#include "mpegaudio.h" + +static const int costab32[30] = { + FIX(0.54119610014619701222), + FIX(1.3065629648763763537), + + FIX(0.50979557910415917998), + FIX(2.5629154477415054814), + FIX(0.89997622313641556513), + FIX(0.60134488693504528634), + + FIX(0.5024192861881556782), + FIX(5.1011486186891552563), + FIX(0.78815462345125020249), + FIX(0.64682178335999007679), + FIX(0.56694403481635768927), + FIX(1.0606776859903470633), + FIX(1.7224470982383341955), + FIX(0.52249861493968885462), + + FIX(10.19000812354803287), + FIX(0.674808341455005678), + FIX(1.1694399334328846596), + FIX(0.53104259108978413284), + FIX(2.0577810099534108446), + FIX(0.58293496820613388554), + FIX(0.83934964541552681272), + FIX(0.50547095989754364798), + FIX(3.4076084184687189804), + FIX(0.62250412303566482475), + FIX(0.97256823786196078263), + FIX(0.51544730992262455249), + FIX(1.4841646163141661852), + FIX(0.5531038960344445421), + FIX(0.74453627100229857749), + FIX(0.5006029982351962726), +}; + +static const int bitinv32[32] = { + 0, 16, 8, 24, 4, 20, 12, 28, + 2, 18, 10, 26, 6, 22, 14, 30, + 1, 17, 9, 25, 5, 21, 13, 29, + 3, 19, 11, 27, 7, 23, 15, 31 +}; + + +/* signal to noise ratio of each quantification step (could be + computed from quant_steps[]). The values are dB multiplied by 10 +*/ +static const unsigned short quant_snr[17] = { + 70, 110, 160, 208, + 253, 316, 378, 439, + 499, 559, 620, 680, + 740, 800, 861, 920, + 980 +}; + +/* fixed psycho acoustic model. Values of SNR taken from the 'toolame' + project */ +static const float fixed_smr[SBLIMIT] = { + 30, 17, 16, 10, 3, 12, 8, 2.5, + 5, 5, 6, 6, 5, 6, 10, 6, + -4, -10, -21, -30, -42, -55, -68, -75, + -75, -75, -75, -75, -91, -107, -110, -108 +}; + +static const unsigned char nb_scale_factors[4] = { 3, 2, 1, 2 }; + +#endif /* AVCODEC_MPEGAUDIOTAB_H */ diff --git a/include/libavcodec/mpegaudiotabs.h b/include/libavcodec/mpegaudiotabs.h new file mode 100644 index 0000000..671b838 --- /dev/null +++ b/include/libavcodec/mpegaudiotabs.h @@ -0,0 +1,39 @@ +/* + * MPEG Audio common tables + * copyright (c) 2002 Fabrice Bellard + * + * 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_MPEGAUDIOTABS_H +#define AVCODEC_MPEGAUDIOTABS_H + +#include + +const uint16_t ff_mpa_bitrate_tab[2][3][15] = { + { { 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448 }, + { 0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384 }, + { 0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320 } }, + { { 0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256 }, + { 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160 }, + { 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160 } + } +}; + +const uint16_t ff_mpa_freq_tab[3] = { 44100, 48000, 32000 }; + +#endif diff --git a/include/libavcodec/mpegpicture.h b/include/libavcodec/mpegpicture.h new file mode 100644 index 0000000..196aa9b --- /dev/null +++ b/include/libavcodec/mpegpicture.h @@ -0,0 +1,152 @@ +/* + * Mpeg video formats-related defines and utility functions + * + * 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_MPEGPICTURE_H +#define AVCODEC_MPEGPICTURE_H + +#include +#include +#include + +#include "avcodec.h" +#include "threadprogress.h" + +#define MPV_MAX_PLANES 3 +#define EDGE_WIDTH 16 + +typedef struct ScratchpadContext { + uint8_t *edge_emu_buffer; ///< temporary buffer for if MVs point to out-of-frame data + uint8_t *obmc_scratchpad; + union { + uint8_t *scratchpad_buf; ///< the other *_scratchpad point into this buffer + uint8_t *rd_scratchpad; ///< scratchpad for rate distortion mb decision + }; + int linesize; ///< linesize that the buffers in this context have been allocated for +} ScratchpadContext; + +typedef struct BufferPoolContext { + struct FFRefStructPool *mbskip_table_pool; + struct FFRefStructPool *qscale_table_pool; + struct FFRefStructPool *mb_type_pool; + struct FFRefStructPool *motion_val_pool; + struct FFRefStructPool *ref_index_pool; + int alloc_mb_width; ///< mb_width used to allocate tables + int alloc_mb_height; ///< mb_height used to allocate tables + int alloc_mb_stride; ///< mb_stride used to allocate tables +} BufferPoolContext; + +/** + * MPVPicture. + */ +typedef struct MPVPicture { + struct AVFrame *f; + + int8_t *qscale_table_base; + int8_t *qscale_table; + + int16_t (*motion_val_base[2])[2]; + int16_t (*motion_val[2])[2]; + + uint32_t *mb_type_base; + uint32_t *mb_type; ///< types and macros are defined in mpegutils.h + + uint8_t *mbskip_table; + + int8_t *ref_index[2]; + + /// RefStruct reference for hardware accelerator private data + void *hwaccel_picture_private; + + int mb_width; ///< mb_width of the tables + int mb_height; ///< mb_height of the tables + int mb_stride; ///< mb_stride of the tables + + int dummy; ///< Picture is a dummy and should not be output + int field_picture; ///< whether or not the picture was encoded in separate fields + + int b_frame_score; + + int reference; + int shared; + + int display_picture_number; + int coded_picture_number; + + ThreadProgress progress; +} MPVPicture; + +typedef struct MPVWorkPicture { + uint8_t *data[MPV_MAX_PLANES]; + ptrdiff_t linesize[MPV_MAX_PLANES]; + + MPVPicture *ptr; ///< RefStruct reference + + int8_t *qscale_table; + + int16_t (*motion_val[2])[2]; + + uint32_t *mb_type; ///< types and macros are defined in mpegutils.h + + uint8_t *mbskip_table; + + int8_t *ref_index[2]; + + int reference; +} MPVWorkPicture; + +/** + * Allocate a pool of MPVPictures. + */ +struct FFRefStructPool *ff_mpv_alloc_pic_pool(int init_progress); + +/** + * Allocate an MPVPicture's accessories (but not the AVFrame's buffer itself) + * and set the MPVWorkPicture's fields. + */ +int ff_mpv_alloc_pic_accessories(AVCodecContext *avctx, MPVWorkPicture *pic, + ScratchpadContext *sc, + BufferPoolContext *pools, int mb_height); + +/** + * Check that the linesizes of an AVFrame are consistent with the requirements + * of mpegvideo. + * FIXME: There should be no need for this function. mpegvideo should be made + * to work with changing linesizes. + */ +int ff_mpv_pic_check_linesize(void *logctx, const struct AVFrame *f, + ptrdiff_t *linesizep, ptrdiff_t *uvlinesizep); + +int ff_mpv_framesize_alloc(AVCodecContext *avctx, + ScratchpadContext *sc, int linesize); + +/** + * Disable allocating the ScratchpadContext's buffers in future calls + * to ff_mpv_framesize_alloc(). + */ +static inline void ff_mpv_framesize_disable(ScratchpadContext *sc) +{ + sc->linesize = INT_MAX; +} + +void ff_mpv_unref_picture(MPVWorkPicture *pic); +void ff_mpv_workpic_from_pic(MPVWorkPicture *wpic, MPVPicture *pic); +void ff_mpv_replace_picture(MPVWorkPicture *dst, const MPVWorkPicture *src); + +#endif /* AVCODEC_MPEGPICTURE_H */ diff --git a/include/libavcodec/mpegutils.h b/include/libavcodec/mpegutils.h new file mode 100644 index 0000000..e4ce26d --- /dev/null +++ b/include/libavcodec/mpegutils.h @@ -0,0 +1,113 @@ +/* + * Mpeg video formats-related defines and utility functions + * + * 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_MPEGUTILS_H +#define AVCODEC_MPEGUTILS_H + +#include + +#include "libavutil/frame.h" + +#include "avcodec.h" + +/* picture type */ +#define PICT_TOP_FIELD 1 +#define PICT_BOTTOM_FIELD 2 +#define PICT_FRAME 3 + +#define MAX_MB_BYTES (30 * 16 * 16 * 3 / 8 + 120) +#define MAX_FCODE 7 + +/* MB types */ +#define MB_TYPE_INTRA4x4 (1 << 0) +#define MB_TYPE_INTRA16x16 (1 << 1) // FIXME H.264-specific +#define MB_TYPE_INTRA_PCM (1 << 2) // FIXME H.264-specific +#define MB_TYPE_16x16 (1 << 3) +#define MB_TYPE_16x8 (1 << 4) +#define MB_TYPE_8x16 (1 << 5) +#define MB_TYPE_8x8 (1 << 6) +#define MB_TYPE_INTERLACED (1 << 7) +#define MB_TYPE_DIRECT2 (1 << 8) // FIXME +#define MB_TYPE_CBP (1 << 10) +#define MB_TYPE_QUANT (1 << 11) +#define MB_TYPE_FORWARD_MV (1 << 12) +#define MB_TYPE_BACKWARD_MV (1 << 13) +#define MB_TYPE_BIDIR_MV (MB_TYPE_FORWARD_MV | MB_TYPE_BACKWARD_MV) +// MB_TYPE_P[01]L[01], MB_TYPE_L[01] and MB_TYPE_L0L1 are H.264 only. +#define MB_TYPE_P0L0 (1 << 12) +#define MB_TYPE_P1L0 (1 << 13) +#define MB_TYPE_P0L1 (1 << 14) +#define MB_TYPE_P1L1 (1 << 15) +#define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0) +#define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1) +#define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1) +#define MB_TYPE_GMC (1 << 16) +#define MB_TYPE_SKIP (1 << 17) +#define MB_TYPE_ACPRED (1 << 18) + +#define MB_TYPE_INTRA MB_TYPE_INTRA4x4 // default mb_type if there is just one type + +// The following MB-type can be used by each codec as it sees fit. +#define MB_TYPE_CODEC_SPECIFIC (1 << 9) + +#define IS_INTRA4x4(a) ((a) & MB_TYPE_INTRA4x4) +#define IS_INTRA16x16(a) ((a) & MB_TYPE_INTRA16x16) +#define IS_PCM(a) ((a) & MB_TYPE_INTRA_PCM) +#define IS_INTRA(a) ((a) & 7) +#define IS_INTER(a) ((a) & (MB_TYPE_16x16 | MB_TYPE_16x8 | \ + MB_TYPE_8x16 | MB_TYPE_8x8)) +#define IS_SKIP(a) ((a) & MB_TYPE_SKIP) +#define IS_INTRA_PCM(a) ((a) & MB_TYPE_INTRA_PCM) +#define IS_INTERLACED(a) ((a) & MB_TYPE_INTERLACED) +#define IS_DIRECT(a) ((a) & MB_TYPE_DIRECT2) +#define IS_GMC(a) ((a) & MB_TYPE_GMC) +#define IS_16X16(a) ((a) & MB_TYPE_16x16) +#define IS_16X8(a) ((a) & MB_TYPE_16x8) +#define IS_8X16(a) ((a) & MB_TYPE_8x16) +#define IS_8X8(a) ((a) & MB_TYPE_8x8) +#define IS_ACPRED(a) ((a) & MB_TYPE_ACPRED) +#define IS_QUANT(a) ((a) & MB_TYPE_QUANT) + +#define HAS_CBP(a) ((a) & MB_TYPE_CBP) +#define HAS_FORWARD_MV(a) ((a) & MB_TYPE_FORWARD_MV) +#define HAS_BACKWARD_MV(a) ((a) & MB_TYPE_BACKWARD_MV) +// dir == 0 means forward, dir == 1 is backward +#define HAS_MV(a, dir) ((a) & (MB_TYPE_FORWARD_MV << (dir))) + +#define MB_TYPE_MV_2_MV_DIR(a) (((a) >> 12) & (MV_DIR_FORWARD | MV_DIR_BACKWARD)) + +/** + * Draw a horizontal band if supported. + * + * @param h is the normal height, this will be reduced automatically if needed + */ +void ff_draw_horiz_band(AVCodecContext *avctx, const AVFrame *cur, const AVFrame *last, + int y, int h, int picture_structure, int first_field, + int low_delay); + +/** + * Print debugging info for the given picture. + */ +void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, + const uint32_t *mbtype_table, + const int8_t *qscale_table, int16_t (*const motion_val[2])[2], + int mb_width, int mb_height, int mb_stride, int quarter_sample); + +#endif /* AVCODEC_MPEGUTILS_H */ diff --git a/include/libavcodec/mpegvideo.h b/include/libavcodec/mpegvideo.h new file mode 100644 index 0000000..8083299 --- /dev/null +++ b/include/libavcodec/mpegvideo.h @@ -0,0 +1,626 @@ +/* + * Generic DCT based hybrid video encoder + * Copyright (c) 2000, 2001, 2002 Fabrice Bellard + * Copyright (c) 2002-2004 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * mpegvideo header. + */ + +#ifndef AVCODEC_MPEGVIDEO_H +#define AVCODEC_MPEGVIDEO_H + +#include "blockdsp.h" +#include "error_resilience.h" +#include "fdctdsp.h" +#include "get_bits.h" +#include "h264chroma.h" +#include "h263dsp.h" +#include "hpeldsp.h" +#include "idctdsp.h" +#include "me_cmp.h" +#include "motion_est.h" +#include "mpegpicture.h" +#include "mpegvideoencdsp.h" +#include "pixblockdsp.h" +#include "put_bits.h" +#include "ratecontrol.h" +#include "qpeldsp.h" +#include "videodsp.h" + +#define MAX_THREADS 32 + +#define MAX_B_FRAMES 16 + +/** + * Scantable. + */ +typedef struct ScanTable { + const uint8_t *scantable; + uint8_t permutated[64]; + uint8_t raster_end[64]; +} ScanTable; + +enum OutputFormat { + FMT_MPEG1, + FMT_H261, + FMT_H263, + FMT_MJPEG, + FMT_SPEEDHQ, +}; + +/** + * MpegEncContext. + */ +typedef struct MpegEncContext { + AVClass *class; + + int y_dc_scale, c_dc_scale; + int ac_pred; + int block_last_index[12]; ///< last non zero coefficient in block + int h263_aic; ///< Advanced INTRA Coding (AIC) + + /* scantables */ + ScanTable inter_scantable; ///< if inter == intra then intra should be used to reduce the cache usage + + /* WARNING: changes above this line require updates to hardcoded + * offsets used in ASM. */ + + ScanTable intra_scantable; + uint8_t permutated_intra_h_scantable[64]; + uint8_t permutated_intra_v_scantable[64]; + + struct AVCodecContext *avctx; + /* The following pointer is intended for codecs sharing code + * between decoder and encoder and in need of a common context to do so. */ + void *private_ctx; + /* the following parameters must be initialized before encoding */ + int width, height;///< picture size. must be a multiple of 16 + int gop_size; + int intra_only; ///< if true, only intra pictures are generated + int64_t bit_rate; ///< wanted bit rate + enum OutputFormat out_format; ///< output format + int h263_pred; ///< use MPEG-4/H.263 ac/dc predictions + int pb_frame; ///< PB-frame mode (0 = none, 1 = base, 2 = improved) + +/* the following codec id fields are deprecated in favor of codec_id */ + int h263_plus; ///< H.263+ headers + int h263_flv; ///< use flv H.263 header + + enum AVCodecID codec_id; /* see AV_CODEC_ID_xxx */ + int fixed_qscale; ///< fixed qscale if non zero + int encoding; ///< true if we are encoding (vs decoding) + int max_b_frames; ///< max number of B-frames for encoding + int luma_elim_threshold; + int chroma_elim_threshold; + int workaround_bugs; ///< workaround bugs in encoders which cannot be detected automatically + int codec_tag; ///< internal codec_tag upper case converted from avctx codec_tag + /* the following fields are managed internally by the encoder */ + + /* sequence parameters */ + int context_initialized; + int input_picture_number; ///< used to set pic->display_picture_number, should not be used for/by anything else + int coded_picture_number; ///< used to set pic->coded_picture_number, should not be used for/by anything else + int picture_number; //FIXME remove, unclear definition + int picture_in_gop_number; ///< 0-> first pic in gop, ... + int mb_width, mb_height; ///< number of MBs horizontally & vertically + int mb_stride; ///< mb_width+1 used for some arrays to allow simple addressing of left & top MBs without sig11 + int b8_stride; ///< 2*mb_width+1 used for some 8x8 block arrays to allow simple addressing + int h_edge_pos, v_edge_pos;///< horizontal / vertical position of the right/bottom edge (pixel replication) + int mb_num; ///< number of MBs of a picture + ptrdiff_t linesize; ///< line size, in bytes, may be different from width + ptrdiff_t uvlinesize; ///< line size, for chroma in bytes, may be different from width + struct FFRefStructPool *picture_pool; ///< Pool for MPVPictures + MPVPicture **input_picture;///< next pictures on display order for encoding + MPVPicture **reordered_input_picture; ///< pointer to the next pictures in coded order for encoding + + BufferPoolContext buffer_pools; + + int64_t user_specified_pts; ///< last non-zero pts from AVFrame which was passed into avcodec_send_frame() + /** + * pts difference between the first and second input frame, used for + * calculating dts of the first frame when there's a delay */ + int64_t dts_delta; + /** + * reordered pts to be used as dts for the next output frame when there's + * a delay */ + int64_t reordered_pts; + + /** bit output */ + PutBitContext pb; + + int start_mb_y; ///< start mb_y of this thread (so current thread should process start_mb_y <= row < end_mb_y) + int end_mb_y; ///< end mb_y of this thread (so current thread should process start_mb_y <= row < end_mb_y) + struct MpegEncContext *thread_context[MAX_THREADS]; + int slice_context_count; ///< number of used thread_contexts + + /** + * copy of the previous picture structure. + * note, linesize & data, might not match the previous picture (for field pictures) + */ + MPVWorkPicture last_pic; + + /** + * copy of the next picture structure. + * note, linesize & data, might not match the next picture (for field pictures) + */ + MPVWorkPicture next_pic; + + /** + * Reference to the source picture for encoding. + * note, linesize & data, might not match the source picture (for field pictures) + */ + AVFrame *new_pic; + + /** + * copy of the current picture structure. + * note, linesize & data, might not match the current picture (for field pictures) + */ + MPVWorkPicture cur_pic; + + int skipped_last_frame; + int last_dc[3]; ///< last DC values for MPEG-1 + int16_t *dc_val_base; + int16_t *dc_val[3]; ///< used for MPEG-4 DC prediction, all 3 arrays must be continuous + const uint8_t *y_dc_scale_table; ///< qscale -> y_dc_scale table + const uint8_t *c_dc_scale_table; ///< qscale -> c_dc_scale table + const uint8_t *chroma_qscale_table; ///< qscale -> chroma_qscale (H.263) + uint8_t *coded_block_base; + uint8_t *coded_block; ///< used for coded block pattern prediction (msmpeg4v3, wmv1) + int16_t (*ac_val_base)[16]; + int16_t (*ac_val[3])[16]; ///< used for MPEG-4 AC prediction, all 3 arrays must be continuous + int mb_skipped; ///< MUST BE SET only during DECODING + uint8_t *mbskip_table; /**< used to avoid copy if macroblock skipped (for black regions for example) + and used for B-frame encoding & decoding (contains skip table of next P-frame) */ + uint8_t *mbintra_table; ///< used to avoid setting {ac, dc, cbp}-pred stuff to zero on inter MB decoding + uint8_t *cbp_table; ///< used to store cbp, ac_pred for partitioned decoding + uint8_t *pred_dir_table; ///< used to store pred_dir for partitioned decoding + + ScratchpadContext sc; + + int qscale; ///< QP + int chroma_qscale; ///< chroma QP + unsigned int lambda; ///< Lagrange multiplier used in rate distortion + unsigned int lambda2; ///< (lambda*lambda) >> FF_LAMBDA_SHIFT + int *lambda_table; + int adaptive_quant; ///< use adaptive quantization + int dquant; ///< qscale difference to prev qscale + int pict_type; ///< AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ... + int vbv_delay; + int last_pict_type; //FIXME removes + int last_non_b_pict_type; ///< used for MPEG-4 gmc B-frames & ratecontrol + int droppable; + int last_lambda_for[5]; ///< last lambda for a specific pict type + int skipdct; ///< skip dct and code zero residual + + /* motion compensation */ + int unrestricted_mv; ///< mv can point outside of the coded picture + int h263_long_vectors; ///< use horrible H.263v1 long vector mode + + BlockDSPContext bdsp; + FDCTDSPContext fdsp; + H264ChromaContext h264chroma; + HpelDSPContext hdsp; + IDCTDSPContext idsp; + MpegvideoEncDSPContext mpvencdsp; + PixblockDSPContext pdsp; + QpelDSPContext qdsp; + VideoDSPContext vdsp; + H263DSPContext h263dsp; + int f_code; ///< forward MV resolution + int b_code; ///< backward MV resolution for B-frames (MPEG-4) + int16_t (*p_mv_table_base)[2]; + int16_t (*b_forw_mv_table_base)[2]; + int16_t (*b_back_mv_table_base)[2]; + int16_t (*b_bidir_forw_mv_table_base)[2]; + int16_t (*b_bidir_back_mv_table_base)[2]; + int16_t (*b_direct_mv_table_base)[2]; + int16_t (*p_field_mv_table_base)[2]; + int16_t (*b_field_mv_table_base)[2]; + int16_t (*p_mv_table)[2]; ///< MV table (1MV per MB) P-frame encoding + int16_t (*b_forw_mv_table)[2]; ///< MV table (1MV per MB) forward mode B-frame encoding + int16_t (*b_back_mv_table)[2]; ///< MV table (1MV per MB) backward mode B-frame encoding + int16_t (*b_bidir_forw_mv_table)[2]; ///< MV table (1MV per MB) bidir mode B-frame encoding + int16_t (*b_bidir_back_mv_table)[2]; ///< MV table (1MV per MB) bidir mode B-frame encoding + int16_t (*b_direct_mv_table)[2]; ///< MV table (1MV per MB) direct mode B-frame encoding + int16_t (*p_field_mv_table[2][2])[2]; ///< MV table (2MV per MB) interlaced P-frame encoding + int16_t (*b_field_mv_table[2][2][2])[2];///< MV table (4MV per MB) interlaced B-frame encoding + uint8_t (*p_field_select_table[2]); ///< Only the first element is allocated + uint8_t (*b_field_select_table[2][2]); ///< Only the first element is allocated + + /* The following fields are encoder-only */ + uint16_t *mb_var; ///< Table for MB variances + uint16_t *mc_mb_var; ///< Table for motion compensated MB variances + uint8_t *mb_mean; ///< Table for MB luminance + int64_t mb_var_sum; ///< sum of MB variance for current frame + int64_t mc_mb_var_sum; ///< motion compensated MB variance for current frame + uint64_t encoding_error[MPV_MAX_PLANES]; + + int motion_est; ///< ME algorithm + int me_penalty_compensation; + int me_pre; ///< prepass for motion estimation + int mv_dir; +#define MV_DIR_FORWARD 1 +#define MV_DIR_BACKWARD 2 +#define MV_DIRECT 4 ///< bidirectional mode where the difference equals the MV of the last P/S/I-Frame (MPEG-4) + int mv_type; +#define MV_TYPE_16X16 0 ///< 1 vector for the whole mb +#define MV_TYPE_8X8 1 ///< 4 vectors (H.263, MPEG-4 4MV) +#define MV_TYPE_16X8 2 ///< 2 vectors, one per 16x8 block +#define MV_TYPE_FIELD 3 ///< 2 vectors, one per field +#define MV_TYPE_DMV 4 ///< 2 vectors, special mpeg2 Dual Prime Vectors + /**motion vectors for a macroblock + first coordinate : 0 = forward 1 = backward + second " : depend on type + third " : 0 = x, 1 = y + */ + int mv[2][4][2]; + int field_select[2][2]; + int last_mv[2][2][2]; ///< last MV, used for MV prediction in MPEG-1 & B-frame MPEG-4 + const uint8_t *fcode_tab; ///< smallest fcode needed for each MV + int16_t direct_scale_mv[2][64]; ///< precomputed to avoid divisions in ff_mpeg4_set_direct_mv + + MotionEstContext me; + + int no_rounding; /**< apply no rounding to motion compensation (MPEG-4, msmpeg4, ...) + for B-frames rounding mode is always 0 */ + + /* macroblock layer */ + int mb_x, mb_y; + int mb_skip_run; + int mb_intra; + uint16_t *mb_type; ///< Table for candidate MB types for encoding (defines in mpegvideoenc.h) + + int block_index[6]; ///< index to current MB in block based arrays with edges + int block_wrap[6]; + uint8_t *dest[3]; + + int *mb_index2xy; ///< mb_index -> mb_x + mb_y*mb_stride + + /** matrix transmitted in the bitstream */ + uint16_t intra_matrix[64]; + uint16_t chroma_intra_matrix[64]; + uint16_t inter_matrix[64]; + uint16_t chroma_inter_matrix[64]; + + int intra_quant_bias; ///< bias for the quantizer + int inter_quant_bias; ///< bias for the quantizer + int min_qcoeff; ///< minimum encodable coefficient + int max_qcoeff; ///< maximum encodable coefficient + int ac_esc_length; ///< num of bits needed to encode the longest esc + uint8_t *intra_ac_vlc_length; + uint8_t *intra_ac_vlc_last_length; + uint8_t *intra_chroma_ac_vlc_length; + uint8_t *intra_chroma_ac_vlc_last_length; + uint8_t *inter_ac_vlc_length; + uint8_t *inter_ac_vlc_last_length; + uint8_t *luma_dc_vlc_length; + + int coded_score[12]; + + /** precomputed matrix (combine qscale and DCT renorm) */ + int (*q_intra_matrix)[64]; + int (*q_chroma_intra_matrix)[64]; + int (*q_inter_matrix)[64]; + /** identical to the above but for MMX & these are not permutated, second 64 entries are bias*/ + uint16_t (*q_intra_matrix16)[2][64]; + uint16_t (*q_chroma_intra_matrix16)[2][64]; + uint16_t (*q_inter_matrix16)[2][64]; + + /* noise reduction */ + int (*dct_error_sum)[64]; + int dct_count[2]; + uint16_t (*dct_offset)[64]; + + /* bit rate control */ + int64_t total_bits; + int frame_bits; ///< bits used for the current frame + int stuffing_bits; ///< bits used for stuffing + int next_lambda; ///< next lambda used for retrying to encode a frame + RateControlContext rc_context; ///< contains stuff only accessed in ratecontrol.c + + /* statistics, used for 2-pass encoding */ + int mv_bits; + int header_bits; + int i_tex_bits; + int p_tex_bits; + int i_count; + int misc_bits; ///< cbp, mb_type + int last_bits; ///< temp var used for calculating the above vars + + /* error concealment / resync */ + int resync_mb_x; ///< x position of last resync marker + int resync_mb_y; ///< y position of last resync marker + GetBitContext last_resync_gb; ///< used to search for the next resync marker + int mb_num_left; ///< number of MBs left in this video packet (for partitioned Slices only) + + /* H.263 specific */ + int gob_index; + int obmc; ///< overlapped block motion compensation + int mb_info; ///< interval for outputting info about mb offsets as side data + int prev_mb_info, last_mb_info; + uint8_t *mb_info_ptr; + int mb_info_size; + int ehc_mode; + + /* H.263+ specific */ + int umvplus; ///< == H.263+ && unrestricted_mv + int h263_aic_dir; ///< AIC direction: 0 = left, 1 = top + int h263_slice_structured; + int alt_inter_vlc; ///< alternative inter vlc + int modified_quant; + int loop_filter; + int custom_pcf; + + /* MPEG-4 specific */ + int studio_profile; + int dct_precision; + ///< number of bits to represent the fractional part of time (encoder only) + int time_increment_bits; + int last_time_base; + int time_base; ///< time in seconds of last I,P,S Frame + int64_t time; ///< time of current frame + int64_t last_non_b_time; + uint16_t pp_time; ///< time distance between the last 2 p,s,i frames + uint16_t pb_time; ///< time distance between the last b and p,s,i frame + uint16_t pp_field_time; + uint16_t pb_field_time; ///< like above, just for interlaced + int mcsel; + int quarter_sample; ///< 1->qpel, 0->half pel ME/MC + int data_partitioning; ///< data partitioning flag from header + int partitioned_frame; ///< is current frame partitioned + int low_delay; ///< no reordering needed / has no B-frames + PutBitContext tex_pb; ///< used for data partitioned VOPs + PutBitContext pb2; ///< used for data partitioned VOPs + int mpeg_quant; + int padding_bug_score; ///< used to detect the VERY common padding bug in MPEG-4 + + /* divx specific, used to workaround (many) bugs in divx5 */ + int divx_packed; + uint8_t *bitstream_buffer; //Divx 5.01 puts several frames in a single one, this is used to reorder them + int bitstream_buffer_size; + unsigned int allocated_bitstream_buffer_size; + + /* RV10 specific */ + int rv10_version; ///< RV10 version: 0 or 3 + int rv10_first_dc_coded[3]; + + /* MJPEG specific */ + struct MJpegContext *mjpeg_ctx; + int esc_pos; + + /* MSMPEG4 specific */ + int mv_table_index; + int rl_table_index; + int rl_chroma_table_index; + int dc_table_index; + int use_skip_mb_code; + int slice_height; ///< in macroblocks + int first_slice_line; ///< used in MPEG-4 too to handle resync markers + int flipflop_rounding; + enum { + MSMP4_UNUSED, + MSMP4_V1, + MSMP4_V2, + MSMP4_V3, + MSMP4_WMV1, + MSMP4_WMV2, + MSMP4_VC1, ///< for VC1 (image), WMV3 (image) and MSS2. + } msmpeg4_version; + int per_mb_rl_table; + int esc3_level_length; + int esc3_run_length; + int inter_intra_pred; + int mspel; + + /* decompression specific */ + GetBitContext gb; + + /* MPEG-1 specific */ + int last_mv_dir; ///< last mv_dir, used for B-frame encoding + int vbv_delay_pos; ///< offset of vbv_delay in the bitstream + + /* MPEG-2-specific - I wished not to have to support this mess. */ + int progressive_sequence; + int mpeg_f_code[2][2]; + + // picture structure defines are loaded from mpegutils.h + int picture_structure; + + int intra_dc_precision; + int frame_pred_frame_dct; + int top_field_first; + int concealment_motion_vectors; + int q_scale_type; + int brd_scale; + int intra_vlc_format; + int alternate_scan; + int repeat_first_field; + int chroma_420_type; + int chroma_format; +#define CHROMA_420 1 +#define CHROMA_422 2 +#define CHROMA_444 3 + int chroma_x_shift;//depend on pix_format, that depend on chroma_format + int chroma_y_shift; + + int progressive_frame; + int full_pel[2]; + int interlaced_dct; + int first_field; ///< is 1 for the first field of a field picture 0 otherwise + + /* RTP specific */ + int rtp_mode; + int rtp_payload_size; + + uint8_t *ptr_lastgob; + + int16_t (*block)[64]; ///< points to one of the following blocks + int16_t (*blocks)[12][64]; // for HQ mode we need to keep the best block + int (*decode_mb)(struct MpegEncContext *s, int16_t block[12][64]); // used by some codecs to avoid a switch() + +#define SLICE_OK 0 +#define SLICE_ERROR -1 +#define SLICE_END -2 /// clipping, 1-> use a nice continuous function to limit qscale within qmin/qmax. + */ + float rc_qsquish; + float rc_qmod_amp; + int rc_qmod_freq; + float rc_initial_cplx; + float rc_buffer_aggressivity; + float border_masking; + int lmin, lmax; + int vbv_ignore_qmax; + + char *rc_eq; + + /* temp buffers for rate control */ + float *cplx_tab, *bits_tab; + + /* flag to indicate a reinitialization is required, e.g. after + * a frame size change */ + int context_reinit; + + ERContext er; + + int error_rate; + + /* temporary frames used by b_frame_strategy = 2 */ + AVFrame *tmp_frames[MAX_B_FRAMES + 2]; + int b_frame_strategy; + int b_sensitivity; + + /* frame skip options for encoding */ + int frame_skip_threshold; + int frame_skip_factor; + int frame_skip_exp; + int frame_skip_cmp; + me_cmp_func frame_skip_cmp_fn; + + int scenechange_threshold; + int noise_reduction; + + int intra_penalty; +} MpegEncContext; + + +/** + * Set the given MpegEncContext to common defaults (same for encoding + * and decoding). The changed fields will not depend upon the prior + * state of the MpegEncContext. + */ +void ff_mpv_common_defaults(MpegEncContext *s); + +int ff_mpv_common_init(MpegEncContext *s); +void ff_mpv_common_init_arm(MpegEncContext *s); +void ff_mpv_common_init_axp(MpegEncContext *s); +void ff_mpv_common_init_neon(MpegEncContext *s); +void ff_mpv_common_init_ppc(MpegEncContext *s); +void ff_mpv_common_init_x86(MpegEncContext *s); +void ff_mpv_common_init_mips(MpegEncContext *s); +/** + * Initialize an MpegEncContext's thread contexts. Presumes that + * slice_context_count is already set and that all the fields + * that are freed/reset in free_duplicate_context() are NULL. + */ +int ff_mpv_init_duplicate_contexts(MpegEncContext *s); +/** + * Initialize and allocates MpegEncContext fields dependent on the resolution. + */ +int ff_mpv_init_context_frame(MpegEncContext *s); +/** + * Frees and resets MpegEncContext fields depending on the resolution + * as well as the slice thread contexts. + * Is used during resolution changes to avoid a full reinitialization of the + * codec. + */ +void ff_mpv_free_context_frame(MpegEncContext *s); + +void ff_mpv_common_end(MpegEncContext *s); + +void ff_clean_intra_table_entries(MpegEncContext *s); + +int ff_update_duplicate_context(MpegEncContext *dst, const MpegEncContext *src); +void ff_set_qscale(MpegEncContext * s, int qscale); + +void ff_mpv_idct_init(MpegEncContext *s); +void ff_init_scantable(const uint8_t *permutation, ScanTable *st, + const uint8_t *src_scantable); +void ff_init_block_index(MpegEncContext *s); + +void ff_mpv_motion(MpegEncContext *s, + uint8_t *dest_y, uint8_t *dest_cb, + uint8_t *dest_cr, int dir, + uint8_t *const *ref_picture, + const op_pixels_func (*pix_op)[4], + const qpel_mc_func (*qpix_op)[16]); + +static inline void ff_update_block_index(MpegEncContext *s, int bits_per_raw_sample, + int lowres, int chroma_x_shift) +{ + const int bytes_per_pixel = 1 + (bits_per_raw_sample > 8); + const int block_size = (8 * bytes_per_pixel) >> lowres; + + s->block_index[0]+=2; + s->block_index[1]+=2; + s->block_index[2]+=2; + s->block_index[3]+=2; + s->block_index[4]++; + s->block_index[5]++; + s->dest[0]+= 2*block_size; + s->dest[1] += (2 >> chroma_x_shift) * block_size; + s->dest[2] += (2 >> chroma_x_shift) * block_size; +} + +#endif /* AVCODEC_MPEGVIDEO_H */ diff --git a/include/libavcodec/mpegvideodata.h b/include/libavcodec/mpegvideodata.h new file mode 100644 index 0000000..42c9d6c --- /dev/null +++ b/include/libavcodec/mpegvideodata.h @@ -0,0 +1,39 @@ +/* + * 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_MPEGVIDEODATA_H +#define AVCODEC_MPEGVIDEODATA_H + +#include + +#include "libavutil/attributes_internal.h" + +FF_VISIBILITY_PUSH_HIDDEN +/* encoding scans */ +extern const uint8_t ff_alternate_horizontal_scan[64]; +extern const uint8_t ff_alternate_vertical_scan[64]; + +extern const uint8_t ff_mpeg12_dc_scale_table[4][32]; +static const uint8_t *const ff_mpeg1_dc_scale_table = ff_mpeg12_dc_scale_table[0]; + +extern const uint8_t ff_mpeg2_non_linear_qscale[32]; + +extern const uint8_t ff_default_chroma_qscale_table[32]; +FF_VISIBILITY_POP_HIDDEN + +#endif /* AVCODEC_MPEGVIDEODATA_H */ diff --git a/include/libavcodec/mpegvideodec.h b/include/libavcodec/mpegvideodec.h new file mode 100644 index 0000000..6100364 --- /dev/null +++ b/include/libavcodec/mpegvideodec.h @@ -0,0 +1,91 @@ +/* + * MPEGVideo decoders header + * Copyright (c) 2000, 2001, 2002 Fabrice Bellard + * Copyright (c) 2002-2004 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * mpegvideo decoder header. + */ + +#ifndef AVCODEC_MPEGVIDEODEC_H +#define AVCODEC_MPEGVIDEODEC_H + +#include "libavutil/frame.h" +#include "libavutil/log.h" + +#include "avcodec.h" +#include "get_bits.h" +#include "mpegpicture.h" +#include "mpegvideo.h" +#include "mpegvideodata.h" + +#define FF_MPV_QSCALE_TYPE_MPEG1 0 +#define FF_MPV_QSCALE_TYPE_MPEG2 1 + +/** + * Initialize the given MpegEncContext for decoding. + * the changed fields will not depend upon + * the prior state of the MpegEncContext. + * + * Also initialize the picture pool. + */ +int ff_mpv_decode_init(MpegEncContext *s, AVCodecContext *avctx); + +int ff_mpv_common_frame_size_change(MpegEncContext *s); + +int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx); +/** + * Ensure that the dummy frames are allocated according to pict_type if necessary. + */ +int ff_mpv_alloc_dummy_frames(MpegEncContext *s); +void ff_mpv_reconstruct_mb(MpegEncContext *s, int16_t block[12][64]); +void ff_mpv_report_decode_progress(MpegEncContext *s); +void ff_mpv_frame_end(MpegEncContext *s); + +int ff_mpv_export_qp_table(const MpegEncContext *s, AVFrame *f, + const MPVPicture *p, int qp_type); +int ff_mpeg_update_thread_context(AVCodecContext *dst, const AVCodecContext *src); +void ff_mpeg_draw_horiz_band(MpegEncContext *s, int y, int h); +void ff_mpeg_flush(AVCodecContext *avctx); +int ff_mpv_decode_close(AVCodecContext *avctx); + +void ff_print_debug_info(const MpegEncContext *s, const MPVPicture *p, AVFrame *pict); + +static inline int mpeg_get_qscale(MpegEncContext *s) +{ + int qscale = get_bits(&s->gb, 5); + if (s->q_scale_type) + return ff_mpeg2_non_linear_qscale[qscale]; + else + return qscale << 1; +} + +static inline int check_marker(void *logctx, GetBitContext *s, const char *msg) +{ + int bit = get_bits1(s); + if (!bit) + av_log(logctx, AV_LOG_INFO, "Marker bit missing at %d of %d %s\n", + get_bits_count(s) - 1, s->size_in_bits, msg); + + return bit; +} + +#endif /* AVCODEC_MPEGVIDEODEC_H */ diff --git a/include/libavcodec/mpegvideoenc.h b/include/libavcodec/mpegvideoenc.h new file mode 100644 index 0000000..f5044a0 --- /dev/null +++ b/include/libavcodec/mpegvideoenc.h @@ -0,0 +1,168 @@ +/* + * Generic DCT based hybrid video encoder + * Copyright (c) 2000, 2001, 2002 Fabrice Bellard + * Copyright (c) 2002-2004 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * mpegvideo header. + */ + +#ifndef AVCODEC_MPEGVIDEOENC_H +#define AVCODEC_MPEGVIDEOENC_H + +#include + +#include "libavutil/opt.h" +#include "mpegvideo.h" + +#define UNI_AC_ENC_INDEX(run,level) ((run)*128 + (level)) +#define INPLACE_OFFSET 16 + +/* MB types for encoding */ +#define CANDIDATE_MB_TYPE_INTRA (1 << 0) +#define CANDIDATE_MB_TYPE_INTER (1 << 1) +#define CANDIDATE_MB_TYPE_INTER4V (1 << 2) +#define CANDIDATE_MB_TYPE_SKIPPED (1 << 3) + +#define CANDIDATE_MB_TYPE_DIRECT (1 << 4) +#define CANDIDATE_MB_TYPE_FORWARD (1 << 5) +#define CANDIDATE_MB_TYPE_BACKWARD (1 << 6) +#define CANDIDATE_MB_TYPE_BIDIR (1 << 7) + +#define CANDIDATE_MB_TYPE_INTER_I (1 << 8) +#define CANDIDATE_MB_TYPE_FORWARD_I (1 << 9) +#define CANDIDATE_MB_TYPE_BACKWARD_I (1 << 10) +#define CANDIDATE_MB_TYPE_BIDIR_I (1 << 11) + +#define CANDIDATE_MB_TYPE_DIRECT0 (1 << 12) + +/* mpegvideo_enc common options */ +#define FF_MPV_FLAG_SKIP_RD 0x0001 +#define FF_MPV_FLAG_STRICT_GOP 0x0002 +#define FF_MPV_FLAG_QP_RD 0x0004 +#define FF_MPV_FLAG_CBP_RD 0x0008 +#define FF_MPV_FLAG_NAQ 0x0010 +#define FF_MPV_FLAG_MV0 0x0020 + +#define FF_MPV_OPT_CMP_FUNC \ +{ "sad", "Sum of absolute differences, fast", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_SAD }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, .unit = "cmp_func" }, \ +{ "sse", "Sum of squared errors", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_SSE }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, .unit = "cmp_func" }, \ +{ "satd", "Sum of absolute Hadamard transformed differences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_SATD }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, .unit = "cmp_func" }, \ +{ "dct", "Sum of absolute DCT transformed differences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_DCT }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, .unit = "cmp_func" }, \ +{ "psnr", "Sum of squared quantization errors, low quality", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_PSNR }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, .unit = "cmp_func" }, \ +{ "bit", "Number of bits needed for the block", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_BIT }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, .unit = "cmp_func" }, \ +{ "rd", "Rate distortion optimal, slow", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_RD }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, .unit = "cmp_func" }, \ +{ "zero", "Zero", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_ZERO }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, .unit = "cmp_func" }, \ +{ "vsad", "Sum of absolute vertical differences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_VSAD }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, .unit = "cmp_func" }, \ +{ "vsse", "Sum of squared vertical differences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_VSSE }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, .unit = "cmp_func" }, \ +{ "nsse", "Noise preserving sum of squared differences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_NSSE }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, .unit = "cmp_func" }, \ +{ "dct264", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_DCT264 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, .unit = "cmp_func" }, \ +{ "dctmax", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_DCTMAX }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, .unit = "cmp_func" }, \ +{ "chroma", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_CHROMA }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, .unit = "cmp_func" }, \ +{ "msad", "Sum of absolute differences, median predicted", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_MEDIAN_SAD }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, .unit = "cmp_func" } + +#define FF_MPV_OFFSET(x) offsetof(MpegEncContext, x) +#define FF_MPV_OPT_FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM) +#define FF_MPV_COMMON_OPTS \ +FF_MPV_OPT_CMP_FUNC, \ +{ "mpv_flags", "Flags common for all mpegvideo-based encoders.", FF_MPV_OFFSET(mpv_flags), AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, .unit = "mpv_flags" },\ +{ "skip_rd", "RD optimal MB level residual skipping", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_SKIP_RD }, 0, 0, FF_MPV_OPT_FLAGS, .unit = "mpv_flags" },\ +{ "strict_gop", "Strictly enforce gop size", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_STRICT_GOP }, 0, 0, FF_MPV_OPT_FLAGS, .unit = "mpv_flags" },\ +{ "qp_rd", "Use rate distortion optimization for qp selection", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_QP_RD }, 0, 0, FF_MPV_OPT_FLAGS, .unit = "mpv_flags" },\ +{ "cbp_rd", "use rate distortion optimization for CBP", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_CBP_RD }, 0, 0, FF_MPV_OPT_FLAGS, .unit = "mpv_flags" },\ +{ "naq", "normalize adaptive quantization", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_NAQ }, 0, 0, FF_MPV_OPT_FLAGS, .unit = "mpv_flags" },\ +{ "mv0", "always try a mb with mv=<0,0>", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_MV0 }, 0, 0, FF_MPV_OPT_FLAGS, .unit = "mpv_flags" },\ +{ "luma_elim_threshold", "single coefficient elimination threshold for luminance (negative values also consider dc coefficient)",\ + FF_MPV_OFFSET(luma_elim_threshold), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS },\ +{ "chroma_elim_threshold", "single coefficient elimination threshold for chrominance (negative values also consider dc coefficient)",\ + FF_MPV_OFFSET(chroma_elim_threshold), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS },\ +{ "quantizer_noise_shaping", NULL, FF_MPV_OFFSET(quantizer_noise_shaping), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FF_MPV_OPT_FLAGS },\ +{ "error_rate", "Simulate errors in the bitstream to test error concealment.", \ + FF_MPV_OFFSET(error_rate), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FF_MPV_OPT_FLAGS },\ +{"qsquish", "how to keep quantizer between qmin and qmax (0 = clip, 1 = use differentiable function)", \ + FF_MPV_OFFSET(rc_qsquish), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, 0, 99, FF_MPV_OPT_FLAGS}, \ +{"rc_qmod_amp", "experimental quantizer modulation", FF_MPV_OFFSET(rc_qmod_amp), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, FF_MPV_OPT_FLAGS}, \ +{"rc_qmod_freq", "experimental quantizer modulation", FF_MPV_OFFSET(rc_qmod_freq), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS}, \ +{"rc_eq", "Set rate control equation. When computing the expression, besides the standard functions " \ + "defined in the section 'Expression Evaluation', the following functions are available: " \ + "bits2qp(bits), qp2bits(qp). Also the following constants are available: iTex pTex tex mv " \ + "fCode iCount mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex avgTex.", \ + FF_MPV_OFFSET(rc_eq), AV_OPT_TYPE_STRING, .flags = FF_MPV_OPT_FLAGS }, \ +{"rc_init_cplx", "initial complexity for 1-pass encoding", FF_MPV_OFFSET(rc_initial_cplx), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, FF_MPV_OPT_FLAGS}, \ +{"rc_buf_aggressivity", "currently useless", FF_MPV_OFFSET(rc_buffer_aggressivity), AV_OPT_TYPE_FLOAT, {.dbl = 1.0 }, -FLT_MAX, FLT_MAX, FF_MPV_OPT_FLAGS}, \ +{"border_mask", "increase the quantizer for macroblocks close to borders", FF_MPV_OFFSET(border_masking), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, FF_MPV_OPT_FLAGS}, \ +{"lmin", "minimum Lagrange factor (VBR)", FF_MPV_OFFSET(lmin), AV_OPT_TYPE_INT, {.i64 = 2*FF_QP2LAMBDA }, 0, INT_MAX, FF_MPV_OPT_FLAGS }, \ +{"lmax", "maximum Lagrange factor (VBR)", FF_MPV_OFFSET(lmax), AV_OPT_TYPE_INT, {.i64 = 31*FF_QP2LAMBDA }, 0, INT_MAX, FF_MPV_OPT_FLAGS }, \ +{"skip_threshold", "Frame skip threshold", FF_MPV_OFFSET(frame_skip_threshold), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \ +{"skip_factor", "Frame skip factor", FF_MPV_OFFSET(frame_skip_factor), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \ +{"skip_exp", "Frame skip exponent", FF_MPV_OFFSET(frame_skip_exp), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \ +{"skip_cmp", "Frame skip compare function", FF_MPV_OFFSET(frame_skip_cmp), AV_OPT_TYPE_INT, {.i64 = FF_CMP_DCTMAX }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS, .unit = "cmp_func" }, \ +{"sc_threshold", "Scene change threshold", FF_MPV_OFFSET(scenechange_threshold), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \ +{"noise_reduction", "Noise reduction", FF_MPV_OFFSET(noise_reduction), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \ +{"ps", "RTP payload size in bytes", FF_MPV_OFFSET(rtp_payload_size), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \ + +#define FF_MPV_COMMON_BFRAME_OPTS \ +{"b_strategy", "Strategy to choose between I/P/B-frames", FF_MPV_OFFSET(b_frame_strategy), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 2, FF_MPV_OPT_FLAGS }, \ +{"b_sensitivity", "Adjust sensitivity of b_frame_strategy 1", FF_MPV_OFFSET(b_sensitivity), AV_OPT_TYPE_INT, {.i64 = 40 }, 1, INT_MAX, FF_MPV_OPT_FLAGS }, \ +{"brd_scale", "Downscale frames for dynamic B-frame decision", FF_MPV_OFFSET(brd_scale), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 3, FF_MPV_OPT_FLAGS }, + +#define FF_MPV_COMMON_MOTION_EST_OPTS \ +{"motion_est", "motion estimation algorithm", FF_MPV_OFFSET(motion_est), AV_OPT_TYPE_INT, {.i64 = FF_ME_EPZS }, FF_ME_ZERO, FF_ME_XONE, FF_MPV_OPT_FLAGS, .unit = "motion_est" }, \ +{ "zero", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_ZERO }, 0, 0, FF_MPV_OPT_FLAGS, .unit = "motion_est" }, \ +{ "epzs", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_EPZS }, 0, 0, FF_MPV_OPT_FLAGS, .unit = "motion_est" }, \ +{ "xone", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_XONE }, 0, 0, FF_MPV_OPT_FLAGS, .unit = "motion_est" }, \ +{"mepc", "Motion estimation bitrate penalty compensation (1.0 = 256)", FF_MPV_OFFSET(me_penalty_compensation), AV_OPT_TYPE_INT, {.i64 = 256 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \ +{"mepre", "pre motion estimation", FF_MPV_OFFSET(me_pre), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \ +{"intra_penalty", "Penalty for intra blocks in block decision", FF_MPV_OFFSET(intra_penalty), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX/2, FF_MPV_OPT_FLAGS }, \ + +extern const AVClass ff_mpv_enc_class; + +int ff_mpv_encode_init(AVCodecContext *avctx); +void ff_mpv_encode_init_x86(MpegEncContext *s); + +int ff_mpv_encode_end(AVCodecContext *avctx); +int ff_mpv_encode_picture(AVCodecContext *avctx, AVPacket *pkt, + const AVFrame *frame, int *got_packet); +int ff_mpv_reallocate_putbitbuffer(MpegEncContext *s, size_t threshold, size_t size_increase); + +void ff_write_quant_matrix(PutBitContext *pb, uint16_t *matrix); + +void ff_dct_encode_init(MpegEncContext *s); +void ff_mpvenc_dct_init_mips(MpegEncContext *s); +void ff_dct_encode_init_x86(MpegEncContext *s); + +void ff_convert_matrix(MpegEncContext *s, int (*qmat)[64], uint16_t (*qmat16)[2][64], + const uint16_t *quant_matrix, int bias, int qmin, int qmax, int intra); + +void ff_block_permute(int16_t *block, const uint8_t *permutation, + const uint8_t *scantable, int last); + +static inline int get_bits_diff(MpegEncContext *s) +{ + const int bits = put_bits_count(&s->pb); + const int last = s->last_bits; + + s->last_bits = bits; + + return bits - last; +} + +#endif diff --git a/include/libavcodec/mpegvideoencdsp.h b/include/libavcodec/mpegvideoencdsp.h new file mode 100644 index 0000000..6ec6656 --- /dev/null +++ b/include/libavcodec/mpegvideoencdsp.h @@ -0,0 +1,62 @@ +/* + * 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_MPEGVIDEOENCDSP_H +#define AVCODEC_MPEGVIDEOENCDSP_H + +#include + +#include "avcodec.h" + +#define BASIS_SHIFT 16 +#define RECON_SHIFT 6 + +#define EDGE_TOP 1 +#define EDGE_BOTTOM 2 + +typedef struct MpegvideoEncDSPContext { + int (*try_8x8basis)(const int16_t rem[64], const int16_t weight[64], + const int16_t basis[64], int scale); + void (*add_8x8basis)(int16_t rem[64], const int16_t basis[64], int scale); + + int (*pix_sum)(const uint8_t *pix, ptrdiff_t line_size); + int (*pix_norm1)(const uint8_t *pix, ptrdiff_t line_size); + + void (*shrink[4])(uint8_t *dst, ptrdiff_t dst_wrap, const uint8_t *src, + ptrdiff_t src_wrap, int width, int height); + + void (*draw_edges)(uint8_t *buf, ptrdiff_t wrap, int width, int height, + int w, int h, int sides); +} MpegvideoEncDSPContext; + +void ff_mpegvideoencdsp_init(MpegvideoEncDSPContext *c, + AVCodecContext *avctx); +void ff_mpegvideoencdsp_init_aarch64(MpegvideoEncDSPContext *c, + AVCodecContext *avctx); +void ff_mpegvideoencdsp_init_arm(MpegvideoEncDSPContext *c, + AVCodecContext *avctx); +void ff_mpegvideoencdsp_init_ppc(MpegvideoEncDSPContext *c, + AVCodecContext *avctx); +void ff_mpegvideoencdsp_init_riscv(MpegvideoEncDSPContext *c, + AVCodecContext *avctx); +void ff_mpegvideoencdsp_init_x86(MpegvideoEncDSPContext *c, + AVCodecContext *avctx); +void ff_mpegvideoencdsp_init_mips(MpegvideoEncDSPContext *c, + AVCodecContext *avctx); + +#endif /* AVCODEC_MPEGVIDEOENCDSP_H */ diff --git a/include/libavcodec/mqc.h b/include/libavcodec/mqc.h new file mode 100644 index 0000000..5e782b0 --- /dev/null +++ b/include/libavcodec/mqc.h @@ -0,0 +1,87 @@ +/* + * MQ-coder: structures, common and decoder functions + * Copyright (c) 2007 Kamil Nowosad + * + * 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_MQC_H +#define AVCODEC_MQC_H + +/** + * MQ-coder + * @file + * @author Kamil Nowosad + */ + +#include + +#define MQC_CX_UNI 17 +#define MQC_CX_RL 18 + +extern const uint16_t ff_mqc_qe[2 * 47]; +extern const uint8_t ff_mqc_nlps[2 * 47]; +extern const uint8_t ff_mqc_nmps[2 * 47]; + +typedef struct MqcState { + uint8_t *bp, *bpstart; + unsigned int a; + unsigned int c; + unsigned int ct; + uint8_t cx_states[19]; + int raw; +} MqcState; + +/* encoder */ + +/** initialize the encoder */ +void ff_mqc_initenc(MqcState *mqc, uint8_t *bp); + +/** code bit d with context cx */ +void ff_mqc_encode(MqcState *mqc, uint8_t *cxstate, int d); + +/** flush the encoder [returns number of bytes encoded] */ +int ff_mqc_flush_to(MqcState *mqc, uint8_t *dst, int *dst_len); + +/* decoder */ + +/** + * Initialize MQ-decoder. + * @param mqc MQ decoder state + * @param bp byte pointer + * @param raw raw mode + * @param reset reset states + */ +void ff_mqc_initdec(MqcState *mqc, uint8_t *bp, int raw, int reset); + +/** + * MQ decoder. + * @param mqc MQ decoder state + * @param cxstate Context + * @return Decision (0 to 1) + */ +int ff_mqc_decode(MqcState *mqc, uint8_t *cxstate); + +/* common */ + +/** + * MQ-coder context initialisations. + * @param mqc MQ-coder context + */ +void ff_mqc_init_contexts(MqcState *mqc); + +#endif /* AVCODEC_MQC_H */ diff --git a/include/libavcodec/msgsmdec.h b/include/libavcodec/msgsmdec.h new file mode 100644 index 0000000..b2a1a62 --- /dev/null +++ b/include/libavcodec/msgsmdec.h @@ -0,0 +1,30 @@ +/* + * gsm 06.10 decoder, Microsoft variant + * Copyright (c) 2010 Reimar Döffinger + * + * 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_MSGSMDEC_H +#define AVCODEC_MSGSMDEC_H + +#include "avcodec.h" + +int ff_msgsm_decode_block(AVCodecContext *avctx, int16_t *samples, + const uint8_t *buf, int mode); + +#endif /* AVCODEC_MSGSMDEC_H */ diff --git a/include/libavcodec/msmpeg4.h b/include/libavcodec/msmpeg4.h new file mode 100644 index 0000000..b918028 --- /dev/null +++ b/include/libavcodec/msmpeg4.h @@ -0,0 +1,41 @@ +/* + * MSMPEG4 backend for encoder and decoder + * copyright (c) 2007 Aurelien Jacobs + * + * 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_MSMPEG4_H +#define AVCODEC_MSMPEG4_H + +#include + +#include "mpegvideo.h" + +#define II_BITRATE 128*1024 +#define MBAC_BITRATE 50*1024 + +#define DC_MAX 119 + +void ff_msmpeg4_common_init(MpegEncContext *s); +int ff_msmpeg4_coded_block_pred(MpegEncContext * s, int n, + uint8_t **coded_block_ptr); + +int ff_msmpeg4_pred_dc(MpegEncContext *s, int n, + int16_t **dc_val_ptr, int *dir_ptr); + +#endif /* AVCODEC_MSMPEG4_H */ diff --git a/include/libavcodec/msmpeg4_vc1_data.h b/include/libavcodec/msmpeg4_vc1_data.h new file mode 100644 index 0000000..a92193a --- /dev/null +++ b/include/libavcodec/msmpeg4_vc1_data.h @@ -0,0 +1,51 @@ +/* + * Common MSMPEG-4 and VC-1 tables + * Copyright (c) 2001 Fabrice Bellard + * Copyright (c) 2002-2004 Michael Niedermayer + * + * msmpeg4v1 & v2 stuff by Michael Niedermayer + * + * 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_MSMPEG4_VC1_DATA_H +#define AVCODEC_MSMPEG4_VC1_DATA_H + +#include + +#include "vlc.h" +#include "libavutil/attributes_internal.h" + +FF_VISIBILITY_PUSH_HIDDEN +void ff_msmp4_vc1_vlcs_init_once(void); + +#define MSMP4_MB_INTRA_VLC_BITS 9 +extern VLCElem ff_msmp4_mb_i_vlc[]; +#define MSMP4_DC_VLC_BITS 9 +extern const VLCElem *ff_msmp4_dc_vlc[2 /* dc_table_index */][2 /* 0: luma, 1: chroma */]; + +/* intra picture macroblock coded block pattern */ +extern const uint16_t ff_msmp4_mb_i_table[64][2]; + +#define WMV1_SCANTABLE_COUNT 4 + +extern const uint8_t ff_wmv1_scantable[WMV1_SCANTABLE_COUNT][64]; + +extern const uint32_t ff_msmp4_dc_tables[2 /* dc_table_index */][2 /* 0: luma, 1: chroma */][120][2]; +FF_VISIBILITY_POP_HIDDEN + +#endif /* AVCODEC_MSMPEG4_VC1_DATA_H */ diff --git a/include/libavcodec/msmpeg4data.h b/include/libavcodec/msmpeg4data.h new file mode 100644 index 0000000..aa4ca86 --- /dev/null +++ b/include/libavcodec/msmpeg4data.h @@ -0,0 +1,75 @@ +/* + * MSMPEG4 backend for encoder and decoder + * copyright (c) 2001 Fabrice Bellard + * copyright (c) 2002-2004 Michael Niedermayer + * + * msmpeg4v1 & v2 stuff by Michael Niedermayer + * + * 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 + */ + +/** + * @file + * MSMPEG4 data tables. + */ + +#ifndef AVCODEC_MSMPEG4DATA_H +#define AVCODEC_MSMPEG4DATA_H + +#include + +#include "libavutil/attributes_internal.h" + +#include "rl.h" +#include "vlc.h" + +/* motion vector table */ +typedef struct MVTable { + const uint16_t *table_mv_code; + const uint8_t *table_mv_bits; + const uint8_t *table_mvx; + const uint8_t *table_mvy; + uint16_t *table_mv_index; /* encoding: convert mv to index in table_mv */ + const VLCElem *vlc; /* decoding: vlc */ +} MVTable; + +FF_VISIBILITY_PUSH_HIDDEN +#define NB_RL_TABLES 6 + +extern RLTable ff_rl_table[NB_RL_TABLES]; + +extern uint32_t ff_v2_dc_lum_table[512][2]; +extern uint32_t ff_v2_dc_chroma_table[512][2]; + +extern const uint8_t ff_wmv1_y_dc_scale_table[32]; +extern const uint8_t ff_wmv1_c_dc_scale_table[32]; +extern const uint8_t ff_old_ff_y_dc_scale_table[32]; + +#define MSMPEG4_MV_TABLES_NB_ELEMS 1099 +extern MVTable ff_mv_tables[2]; + +extern const uint8_t ff_v2_mb_type[8][2]; +extern const uint8_t ff_v2_intra_cbpc[4][2]; + +extern const uint32_t ff_table_mb_non_intra[128][2]; +extern const uint8_t ff_table_inter_intra[4][2]; + +#define WMV2_INTER_CBP_TABLE_COUNT 4 +extern const uint32_t (* const ff_wmv2_inter_table[WMV2_INTER_CBP_TABLE_COUNT])[2]; +FF_VISIBILITY_POP_HIDDEN + +#endif /* AVCODEC_MSMPEG4DATA_H */ diff --git a/include/libavcodec/msmpeg4dec.h b/include/libavcodec/msmpeg4dec.h new file mode 100644 index 0000000..5daa7c6 --- /dev/null +++ b/include/libavcodec/msmpeg4dec.h @@ -0,0 +1,41 @@ +/* + * MSMPEG4 decoder header + * copyright (c) 2007 Aurelien Jacobs + * + * 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_MSMPEG4DEC_H +#define AVCODEC_MSMPEG4DEC_H + +#include "avcodec.h" +#include "mpegvideo.h" + +#define INTER_INTRA_VLC_BITS 3 +#define MB_NON_INTRA_VLC_BITS 9 + +extern const VLCElem *ff_mb_non_intra_vlc[4]; +extern VLCElem ff_inter_intra_vlc[8]; + +int ff_msmpeg4_decode_init(AVCodecContext *avctx); +int ff_msmpeg4_decode_picture_header(MpegEncContext *s); +int ff_msmpeg4_decode_ext_header(MpegEncContext *s, int buf_size); +void ff_msmpeg4_decode_motion(MpegEncContext * s, int *mx_ptr, int *my_ptr); +int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block, + int n, int coded, const uint8_t *scan_table); + +#endif diff --git a/include/libavcodec/msmpeg4enc.h b/include/libavcodec/msmpeg4enc.h new file mode 100644 index 0000000..da9a45b --- /dev/null +++ b/include/libavcodec/msmpeg4enc.h @@ -0,0 +1,47 @@ +/* + * MSMPEG4 encoder header + * copyright (c) 2007 Aurelien Jacobs + * + * 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_MSMPEG4ENC_H +#define AVCODEC_MSMPEG4ENC_H + +#include "mpegvideo.h" +#include "put_bits.h" +#include "rl.h" + +typedef struct MSMPEG4EncContext { + MpegEncContext s; + + /** [mb_intra][isChroma][level][run][last] */ + unsigned ac_stats[2][2][MAX_LEVEL + 1][MAX_RUN + 1][2]; +} MSMPEG4EncContext; + +void ff_msmpeg4_encode_init(MpegEncContext *s); +void ff_msmpeg4_encode_picture_header(MpegEncContext *s); +void ff_msmpeg4_encode_ext_header(MpegEncContext *s); +void ff_msmpeg4_encode_mb(MpegEncContext *s, int16_t block[6][64], + int motion_x, int motion_y); +void ff_msmpeg4_encode_block(MpegEncContext * s, int16_t * block, int n); +void ff_msmpeg4_handle_slices(MpegEncContext *s); +void ff_msmpeg4_encode_motion(MpegEncContext * s, int mx, int my); + +void ff_msmpeg4_code012(PutBitContext *pb, int n); + +#endif diff --git a/include/libavcodec/msrledec.h b/include/libavcodec/msrledec.h new file mode 100644 index 0000000..7f7bbcf --- /dev/null +++ b/include/libavcodec/msrledec.h @@ -0,0 +1,39 @@ +/* + * Microsoft RLE decoder + * Copyright (C) 2008 Konstantin Shishkov + * + * 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_MSRLEDEC_H +#define AVCODEC_MSRLEDEC_H + +#include "avcodec.h" +#include "bytestream.h" + +/** + * Decode stream in MS RLE format into frame. + * + * @param avctx codec context + * @param pic destination frame + * @param depth bit depth + * @param gb input bytestream context + */ +int ff_msrle_decode(AVCodecContext *avctx, AVFrame *pic, + int depth, GetByteContext *gb); + +#endif /* AVCODEC_MSRLEDEC_H */ diff --git a/include/libavcodec/mss12.h b/include/libavcodec/mss12.h new file mode 100644 index 0000000..27aa2d5 --- /dev/null +++ b/include/libavcodec/mss12.h @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2012 Konstantin Shishkov + * + * 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 + */ + +/** + * @file + * Common header for Microsoft Screen 1 and 2 + */ + +#ifndef AVCODEC_MSS12_H +#define AVCODEC_MSS12_H + +#include "libavutil/intreadwrite.h" +#include "avcodec.h" +#include "get_bits.h" +#include "bytestream.h" + +#define MODEL_MIN_SYMS 2 +#define MODEL_MAX_SYMS 256 +#define THRESH_ADAPTIVE -1 +#define THRESH_LOW 15 +#define THRESH_HIGH 50 + +typedef struct Model { + int16_t cum_prob[MODEL_MAX_SYMS + 1]; + int16_t weights[MODEL_MAX_SYMS + 1]; + uint8_t idx2sym[MODEL_MAX_SYMS + 1]; + int num_syms; + int thr_weight, threshold; +} Model; + +typedef struct ArithCoder { + int low, high, value; + int overread; +#define MAX_OVERREAD 16 + union { + GetBitContext *gb; + GetByteContext *gB; + } gbc; + int (*get_model_sym)(struct ArithCoder *c, Model *m); + int (*get_number) (struct ArithCoder *c, int n); +} ArithCoder; + +typedef struct PixContext { + int cache_size, num_syms; + uint8_t cache[12]; + Model cache_model, full_model; + Model sec_models[15][4]; + int special_initial_cache; +} PixContext; + +struct MSS12Context; + +typedef struct SliceContext { + const struct MSS12Context *c; + Model intra_region, inter_region; + Model pivot, edge_mode, split_mode; + PixContext intra_pix_ctx, inter_pix_ctx; +} SliceContext; + +typedef struct MSS12Context { + AVCodecContext *avctx; + uint32_t pal[256]; + uint8_t *pal_pic; + uint8_t *last_pal_pic; + ptrdiff_t pal_stride; + uint8_t *mask; + ptrdiff_t mask_stride; + uint8_t *rgb_pic; + uint8_t *last_rgb_pic; + ptrdiff_t rgb_stride; + int free_colours; + int keyframe; + int mvX, mvY; + int corrupted; + int slice_split; + int full_model_syms; +} MSS12Context; + +int ff_mss12_decode_rect(SliceContext *ctx, ArithCoder *acoder, + int x, int y, int width, int height); +void ff_mss12_model_update(Model *m, int val); +void ff_mss12_slicecontext_reset(SliceContext *sc); +int ff_mss12_decode_init(MSS12Context *c, int version, + SliceContext *sc1, SliceContext *sc2); +int ff_mss12_decode_end(MSS12Context *ctx); + +#define ARITH_GET_BIT(prefix) \ +static int prefix ## _get_bit(ArithCoder *c) \ +{ \ + int range = c->high - c->low + 1; \ + int bit = 2 * c->value - c->low >= c->high; \ + \ + if (bit) \ + c->low += range >> 1; \ + else \ + c->high = c->low + (range >> 1) - 1; \ + \ + prefix ## _normalise(c); \ + \ + return bit; \ +} + +#define ARITH_GET_MODEL_SYM(prefix) \ +static int prefix ## _get_model_sym(ArithCoder *c, Model *m) \ +{ \ + int idx, val; \ + \ + idx = prefix ## _get_prob(c, m->cum_prob); \ + \ + val = m->idx2sym[idx]; \ + ff_mss12_model_update(m, idx); \ + \ + prefix ## _normalise(c); \ + \ + return val; \ +} + +#endif /* AVCODEC_MSS12_H */ diff --git a/include/libavcodec/mss2dsp.h b/include/libavcodec/mss2dsp.h new file mode 100644 index 0000000..e44c9ab --- /dev/null +++ b/include/libavcodec/mss2dsp.h @@ -0,0 +1,52 @@ +/* + * Microsoft Screen 2 (aka Windows Media Video V9 Screen) decoder + * + * 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 + */ + +/** + * @file + * Microsoft Screen 2 (aka Windows Media Video V9 Screen) decoder DSP routines + */ + +#ifndef AVCODEC_MSS2DSP_H +#define AVCODEC_MSS2DSP_H + +#include +#include + +typedef struct MSS2DSPContext { + void (*mss2_blit_wmv9)(uint8_t *dst, ptrdiff_t dst_stride, + const uint8_t *srcy, ptrdiff_t srcy_stride, + const uint8_t *srcu, const uint8_t *srcv, + ptrdiff_t srcuv_stride, int w, int h); + void (*mss2_blit_wmv9_masked)(uint8_t *dst, ptrdiff_t dst_stride, + int maskcolor, const uint8_t *mask, + ptrdiff_t mask_stride, + const uint8_t *srcy, ptrdiff_t srcy_stride, + const uint8_t *srcu, const uint8_t *srcv, + ptrdiff_t srcuv_stride, int w, int h); + void (*mss2_gray_fill_masked)(uint8_t *dst, ptrdiff_t dst_stride, + int maskcolor, const uint8_t *mask, + ptrdiff_t mask_stride, int w, int h); + void (*upsample_plane)(uint8_t *plane, ptrdiff_t plane_stride, + int w, int h); +} MSS2DSPContext; + +void ff_mss2dsp_init(MSS2DSPContext *dsp); + +#endif /* AVCODEC_MSS2DSP_H */ diff --git a/include/libavcodec/mss34dsp.h b/include/libavcodec/mss34dsp.h new file mode 100644 index 0000000..29c61e3 --- /dev/null +++ b/include/libavcodec/mss34dsp.h @@ -0,0 +1,46 @@ +/* + * Common stuff for some Microsoft Screen codecs + * Copyright (C) 2012 Konstantin Shishkov + * + * 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_MSS34DSP_H +#define AVCODEC_MSS34DSP_H + +#include +#include + +/** + * Generate quantisation matrix for given quality. + * + * @param qmat destination matrix + * @param quality quality setting (1-100) + * @param luma generate quantisation matrix for luma or chroma + */ +void ff_mss34_gen_quant_mat(uint16_t *qmat, int quality, int luma); + +/** + * Transform and output DCT block. + * + * @param dst output plane + * @param stride output plane stride + * @param block block to transform and output + */ +void ff_mss34_dct_put(uint8_t *dst, ptrdiff_t stride, int *block); + +#endif /* AVCODEC_MSS34DSP_H */ diff --git a/include/libavcodec/nellymoser.h b/include/libavcodec/nellymoser.h new file mode 100644 index 0000000..6d032c9 --- /dev/null +++ b/include/libavcodec/nellymoser.h @@ -0,0 +1,57 @@ +/* + * Common code between Nellymoser encoder and decoder + * Copyright (c) 2007 a840bda5870ba11f19698ff6eb9581dfb0f95fa5, + * 539459aeb7d425140b62a3ec7dbf6dc8e408a306, and + * 520e17cd55896441042b14df2566a6eb610ed444 + * Copyright (c) 2007 Loic Minier + * Benjamin Larsson + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * @file + * The 3 alphanumeric copyright notices are md5summed they are from the original + * implementors. The original code is available from http://code.google.com/p/nelly2pcm/ + */ + +#ifndef AVCODEC_NELLYMOSER_H +#define AVCODEC_NELLYMOSER_H + +#include + +#define NELLY_BANDS 23 +#define NELLY_BLOCK_LEN 64 +#define NELLY_HEADER_BITS 116 +#define NELLY_DETAIL_BITS 198 +#define NELLY_BUF_LEN 128 +#define NELLY_FILL_LEN 124 +#define NELLY_BIT_CAP 6 +#define NELLY_BASE_OFF 4228 +#define NELLY_BASE_SHIFT 19 +#define NELLY_SAMPLES (2 * NELLY_BUF_LEN) + +extern const float ff_nelly_dequantization_table[127]; +extern const uint8_t ff_nelly_band_sizes_table[NELLY_BANDS]; +extern const uint16_t ff_nelly_init_table[64]; +extern const int16_t ff_nelly_delta_table[32]; + +void ff_nelly_get_sample_bits(const float *buf, int *bits); + +#endif /* AVCODEC_NELLYMOSER_H */ diff --git a/include/libavcodec/nvdec.h b/include/libavcodec/nvdec.h new file mode 100644 index 0000000..555300d --- /dev/null +++ b/include/libavcodec/nvdec.h @@ -0,0 +1,85 @@ +/* + * HW decode acceleration through NVDEC + * + * Copyright (c) 2016 Anton Khirnov + * + * 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_NVDEC_H +#define AVCODEC_NVDEC_H + +#include "compat/cuda/dynlink_loader.h" + +#include + +#include "libavutil/buffer.h" +#include "libavutil/frame.h" + +#include "avcodec.h" + +#if defined(NVDECAPI_MAJOR_VERSION) && defined(NVDECAPI_MINOR_VERSION) +# define NVDECAPI_CHECK_VERSION(major, minor) \ + ((major) < NVDECAPI_MAJOR_VERSION || ((major) == NVDECAPI_MAJOR_VERSION && (minor) <= NVDECAPI_MINOR_VERSION)) +#else +/* version macros were added in SDK 8.1 ffnvcodec */ +# define NVDECAPI_CHECK_VERSION(major, minor) \ + ((major) < 8 || ((major) == 8 && (minor) <= 0)) +#endif + +typedef struct NVDECFrame { + unsigned int idx; + unsigned int ref_idx; + unsigned int *idx_ref; ///< RefStruct reference + unsigned int *ref_idx_ref; ///< RefStruct reference + struct NVDECDecoder *decoder; ///< RefStruct reference +} NVDECFrame; + +typedef struct NVDECContext { + CUVIDPICPARAMS pic_params; + + struct FFRefStructPool *decoder_pool; + + struct NVDECDecoder *decoder; ///< RefStruct reference + + const uint8_t *bitstream; + int bitstream_len; + unsigned int bitstream_allocated; + uint8_t *bitstream_internal; + + unsigned *slice_offsets; + int nb_slices; + unsigned int slice_offsets_allocated; + + int supports_444; +} NVDECContext; + +int ff_nvdec_decode_init(AVCodecContext *avctx); +int ff_nvdec_decode_uninit(AVCodecContext *avctx); +int ff_nvdec_start_frame(AVCodecContext *avctx, AVFrame *frame); +int ff_nvdec_start_frame_sep_ref(AVCodecContext *avctx, AVFrame *frame, int has_sep_ref); +int ff_nvdec_end_frame(AVCodecContext *avctx); +int ff_nvdec_simple_end_frame(AVCodecContext *avctx); +int ff_nvdec_simple_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, + uint32_t size); +int ff_nvdec_frame_params(AVCodecContext *avctx, + AVBufferRef *hw_frames_ctx, + int dpb_size, + int supports_444); +int ff_nvdec_get_ref_idx(AVFrame *frame); + +#endif /* AVCODEC_NVDEC_H */ diff --git a/include/libavcodec/nvenc.h b/include/libavcodec/nvenc.h new file mode 100644 index 0000000..0130b99 --- /dev/null +++ b/include/libavcodec/nvenc.h @@ -0,0 +1,301 @@ +/* + * 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_NVENC_H +#define AVCODEC_NVENC_H + +#include "config.h" + +#if CONFIG_D3D11VA +#define COBJMACROS +#include "libavutil/hwcontext_d3d11va.h" +#else +typedef void ID3D11Device; +#endif + +#include + +#include "compat/cuda/dynlink_loader.h" +#include "libavutil/buffer.h" +#include "libavutil/fifo.h" +#include "libavutil/opt.h" +#include "hwconfig.h" + +#include "avcodec.h" + +#define MAX_REGISTERED_FRAMES 64 +#define RC_MODE_DEPRECATED 0x800000 +#define RCD(rc_mode) ((rc_mode) | RC_MODE_DEPRECATED) + +#define NVENCAPI_CHECK_VERSION(major, minor) \ + ((major) < NVENCAPI_MAJOR_VERSION || ((major) == NVENCAPI_MAJOR_VERSION && (minor) <= NVENCAPI_MINOR_VERSION)) + +// SDK 8.1 compile time feature checks +#if NVENCAPI_CHECK_VERSION(8, 1) +#define NVENC_HAVE_BFRAME_REF_MODE +#define NVENC_HAVE_QP_MAP_MODE +#endif + +// SDK 9.0 compile time feature checks +#if NVENCAPI_CHECK_VERSION(9, 0) +#define NVENC_HAVE_HEVC_BFRAME_REF_MODE +#endif + +// SDK 9.1 compile time feature checks +#if NVENCAPI_CHECK_VERSION(9, 1) +#define NVENC_HAVE_MULTIPLE_REF_FRAMES +#define NVENC_HAVE_CUSTREAM_PTR +#define NVENC_HAVE_GETLASTERRORSTRING +#endif + +// SDK 10.0 compile time feature checks +#if NVENCAPI_CHECK_VERSION(10, 0) +#define NVENC_HAVE_NEW_PRESETS +#define NVENC_HAVE_MULTIPASS +#define NVENC_HAVE_LDKFS +#define NVENC_HAVE_H264_LVL6 +#define NVENC_HAVE_HEVC_CONSTRAINED_ENCODING +#endif + +// SDK 11.1 compile time feature checks +#if NVENCAPI_CHECK_VERSION(11, 1) +#define NVENC_HAVE_QP_CHROMA_OFFSETS +#define NVENC_HAVE_SINGLE_SLICE_INTRA_REFRESH +#endif + +// SDK 12.1 compile time feature checks +#if NVENCAPI_CHECK_VERSION(12, 1) +#define NVENC_NO_DEPRECATED_RC +#define NVENC_HAVE_SPLIT_FRAME_ENCODING +#endif + +// SDK 12.2 compile time feature checks +#if NVENCAPI_CHECK_VERSION(12, 2) +#define NVENC_HAVE_NEW_BIT_DEPTH_API +#define NVENC_HAVE_TEMPORAL_FILTER +#define NVENC_HAVE_LOOKAHEAD_LEVEL +#define NVENC_HAVE_UHQ_TUNING +#define NVENC_HAVE_UNIDIR_B +#endif + +typedef struct NvencSurface +{ + NV_ENC_INPUT_PTR input_surface; + AVFrame *in_ref; + int reg_idx; + int width; + int height; + int pitch; + + NV_ENC_OUTPUT_PTR output_surface; + NV_ENC_BUFFER_FORMAT format; +} NvencSurface; + +typedef struct NvencFrameData +{ + int64_t duration; + + void *frame_opaque; + AVBufferRef *frame_opaque_ref; +} NvencFrameData; + +typedef struct NvencDynLoadFunctions +{ + CudaFunctions *cuda_dl; + NvencFunctions *nvenc_dl; + + NV_ENCODE_API_FUNCTION_LIST nvenc_funcs; + int nvenc_device_count; +} NvencDynLoadFunctions; + +enum { + PRESET_DEFAULT = 0, + PRESET_SLOW, + PRESET_MEDIUM, + PRESET_FAST, + PRESET_HP, + PRESET_HQ, + PRESET_BD , + PRESET_LOW_LATENCY_DEFAULT , + PRESET_LOW_LATENCY_HQ , + PRESET_LOW_LATENCY_HP, + PRESET_LOSSLESS_DEFAULT, + PRESET_LOSSLESS_HP, +#ifdef NVENC_HAVE_NEW_PRESETS + PRESET_P1, + PRESET_P2, + PRESET_P3, + PRESET_P4, + PRESET_P5, + PRESET_P6, + PRESET_P7, +#endif +}; + +enum { + NV_ENC_H264_PROFILE_BASELINE, + NV_ENC_H264_PROFILE_MAIN, + NV_ENC_H264_PROFILE_HIGH, + NV_ENC_H264_PROFILE_HIGH_444P, +}; + +enum { + NV_ENC_HEVC_PROFILE_MAIN, + NV_ENC_HEVC_PROFILE_MAIN_10, + NV_ENC_HEVC_PROFILE_REXT, +}; + +enum { + NVENC_LOWLATENCY = 1, + NVENC_LOSSLESS = 2, + NVENC_ONE_PASS = 4, + NVENC_TWO_PASSES = 8, + + NVENC_DEPRECATED_PRESET = 0x8000, +}; + +enum { + LIST_DEVICES = -2, + ANY_DEVICE, +}; + +enum { + NVENC_RGB_MODE_DISABLED, + NVENC_RGB_MODE_420, + NVENC_RGB_MODE_444, +}; + +typedef struct NvencContext +{ + AVClass *avclass; + + NvencDynLoadFunctions nvenc_dload_funcs; + + NV_ENC_INITIALIZE_PARAMS init_encode_params; + NV_ENC_CONFIG encode_config; + CUcontext cu_context; + CUcontext cu_context_internal; + CUstream cu_stream; + ID3D11Device *d3d11_device; + + AVFrame *frame; + + int nb_surfaces; + NvencSurface *surfaces; + + NvencFrameData *frame_data_array; + int frame_data_array_nb; + int frame_data_array_pos; + + AVFifo *unused_surface_queue; + AVFifo *output_surface_queue; + AVFifo *output_surface_ready_queue; + AVFifo *timestamp_list; + // This is for DTS calculating, reset after flush + uint64_t output_frame_num; + int64_t initial_delay_time; + + NV_ENC_SEI_PAYLOAD *sei_data; + int sei_data_size; + + struct { + void *ptr; + int ptr_index; + NV_ENC_REGISTERED_PTR regptr; + int mapped; + NV_ENC_MAP_INPUT_RESOURCE in_map; + } registered_frames[MAX_REGISTERED_FRAMES]; + int nb_registered_frames; + + /* the actual data pixel format, different from + * AVCodecContext.pix_fmt when using hwaccel frames on input */ + enum AVPixelFormat data_pix_fmt; + + int support_dyn_bitrate; + + void *nvencoder; + + uint32_t frame_idx_counter; + + int preset; + int profile; + int level; + int tier; + int rc; + int cbr; + int tile_rows; + int tile_cols; + int twopass; + int device; + int flags; + int async_depth; + int rc_lookahead; + int aq; + int no_scenecut; + int forced_idr; + int b_adapt; + int temporal_aq; + int zerolatency; + int nonref_p; + int strict_gop; + int aq_strength; + float quality; + int aud; + int bluray_compat; + int init_qp_p; + int init_qp_b; + int init_qp_i; + int cqp; + int qp_cb_offset; + int qp_cr_offset; + int weighted_pred; + int coder; + int b_ref_mode; + int a53_cc; + int s12m_tc; + int dpb_size; + int tuning_info; + int multipass; + int ldkfs; + int extra_sei; + int intra_refresh; + int single_slice_intra_refresh; + int constrained_encoding; + int udu_sei; + int timing_info; + int highbitdepth; + int max_slice_size; + int rgb_mode; + int tf_level; + int lookahead_level; + int unidir_b; + int split_encode_mode; +} NvencContext; + +int ff_nvenc_encode_init(AVCodecContext *avctx); + +int ff_nvenc_encode_close(AVCodecContext *avctx); + +int ff_nvenc_receive_packet(AVCodecContext *avctx, AVPacket *pkt); + +void ff_nvenc_encode_flush(AVCodecContext *avctx); + +extern const enum AVPixelFormat ff_nvenc_pix_fmts[]; +extern const AVCodecHWConfigInternal *const ff_nvenc_hw_configs[]; + +#endif /* AVCODEC_NVENC_H */ diff --git a/include/libavcodec/on2avcdata.h b/include/libavcodec/on2avcdata.h new file mode 100644 index 0000000..c5e7c80 --- /dev/null +++ b/include/libavcodec/on2avcdata.h @@ -0,0 +1,77 @@ +/* + * On2 Audio for Video Codec decoder + * + * Copyright (c) 2013 Konstantin Shishkov + * + * 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_ON2AVCDATA_H +#define AVCODEC_ON2AVCDATA_H + +#include + +#define ON2AVC_MAX_BANDS 112 +#define ON2AVC_ESC_CB 15 + +typedef struct On2AVCMode { + int num_windows; + int num_bands; + const int *band_start; +} On2AVCMode; + +extern const On2AVCMode ff_on2avc_modes_40[8]; +extern const On2AVCMode ff_on2avc_modes_44[8]; + +#define ON2AVC_SCALE_DIFFS 121 +extern const uint8_t ff_on2avc_scale_diff_syms[]; +extern const uint8_t ff_on2avc_scale_diff_bits[]; + +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]; +extern const float ff_on2avc_window_long_24000[1024]; +extern const float ff_on2avc_window_short[128]; + +extern const double ff_on2avc_tab_10_1[]; +extern const double ff_on2avc_tab_10_2[]; +extern const double ff_on2avc_tab_20_1[]; +extern const double ff_on2avc_tab_20_2[]; +extern const double ff_on2avc_tab_40_1[]; +extern const double ff_on2avc_tab_40_2[]; +extern const double ff_on2avc_tab_84_1[]; +extern const double ff_on2avc_tab_84_2[]; +extern const double ff_on2avc_tab_84_3[]; +extern const double ff_on2avc_tab_84_4[]; +extern const double * const ff_on2avc_tabs_4_10_1[4]; +extern const double * const ff_on2avc_tabs_4_10_2[4]; +extern const double * const ff_on2avc_tabs_9_20_1[9]; +extern const double * const ff_on2avc_tabs_9_20_2[9]; +extern const double * const ff_on2avc_tabs_19_40_1[19]; +extern const double * const ff_on2avc_tabs_19_40_2[19]; +extern const double * const ff_on2avc_tabs_20_84_1[20]; +extern const double * const ff_on2avc_tabs_20_84_2[20]; +extern const double * const ff_on2avc_tabs_20_84_3[20]; +extern const double * const ff_on2avc_tabs_20_84_4[20]; +extern const float ff_on2avc_ctab_1[2048]; +extern const float ff_on2avc_ctab_2[2048]; +extern const float ff_on2avc_ctab_3[2048]; +extern const float ff_on2avc_ctab_4[2048]; + +#endif /* AVCODEC_ON2AVCDATA_H */ diff --git a/include/libavcodec/options_table.h b/include/libavcodec/options_table.h new file mode 100644 index 0000000..47da41b --- /dev/null +++ b/include/libavcodec/options_table.h @@ -0,0 +1,427 @@ +/* + * Copyright (c) 2001 Fabrice Bellard + * Copyright (c) 2002-2004 Michael Niedermayer + * + * 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_OPTIONS_TABLE_H +#define AVCODEC_OPTIONS_TABLE_H + +#include "config_components.h" + +#include +#include +#include + +#include "libavutil/opt.h" +#include "avcodec.h" +#include "version_major.h" + +#define OFFSET(x) offsetof(AVCodecContext,x) +#define DEFAULT 0 //should be NAN but it does not work as it is not a constant in glibc as required by ANSI/ISO C +//these names are too long to be readable +#define V AV_OPT_FLAG_VIDEO_PARAM +#define A AV_OPT_FLAG_AUDIO_PARAM +#define S AV_OPT_FLAG_SUBTITLE_PARAM +#define E AV_OPT_FLAG_ENCODING_PARAM +#define D AV_OPT_FLAG_DECODING_PARAM +#define CC AV_OPT_FLAG_CHILD_CONSTS + +#define AR AV_OPT_TYPE_FLAG_ARRAY + +#define AV_CODEC_DEFAULT_BITRATE 200*1000 + +static const AVOption avcodec_options[] = { +{"b", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT64, {.i64 = AV_CODEC_DEFAULT_BITRATE }, 0, INT64_MAX, A|V|E}, +{"ab", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT64, {.i64 = 128*1000 }, 0, INT_MAX, A|E}, +{"bt", "Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate tolerance specifies how far " + "ratecontrol is willing to deviate from the target average bitrate value. This is not related " + "to minimum/maximum bitrate. Lowering tolerance too much has an adverse effect on quality.", + OFFSET(bit_rate_tolerance), AV_OPT_TYPE_INT, {.i64 = AV_CODEC_DEFAULT_BITRATE*20 }, 0, INT_MAX, A|V|E}, +{"flags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT }, 0, UINT_MAX, V|A|S|E|D, .unit = "flags"}, +{"unaligned", "allow decoders to produce unaligned output", 0, AV_OPT_TYPE_CONST, { .i64 = AV_CODEC_FLAG_UNALIGNED }, INT_MIN, INT_MAX, V | D, .unit = "flags" }, +{"mv4", "use four motion vectors per macroblock (MPEG-4)", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_4MV }, INT_MIN, INT_MAX, V|E, .unit = "flags"}, +{"qpel", "use 1/4-pel motion compensation", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_QPEL }, INT_MIN, INT_MAX, V|E, .unit = "flags"}, +{"loop", "use loop filter", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_LOOP_FILTER }, INT_MIN, INT_MAX, V|E, .unit = "flags"}, +{"qscale", "use fixed qscale", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_QSCALE }, INT_MIN, INT_MAX, 0, .unit = "flags"}, +{"recon_frame", "export reconstructed frames", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_RECON_FRAME}, .unit = "flags"}, +{"copy_opaque", "propagate opaque values", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_COPY_OPAQUE}, .unit = "flags"}, +{"frame_duration", "use frame durations", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_FRAME_DURATION}, .unit = "flags"}, +{"pass1", "use internal 2-pass ratecontrol in first pass mode", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_PASS1 }, INT_MIN, INT_MAX, 0, .unit = "flags"}, +{"pass2", "use internal 2-pass ratecontrol in second pass mode", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_PASS2 }, INT_MIN, INT_MAX, 0, .unit = "flags"}, +{"gray", "only decode/encode grayscale", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_GRAY }, INT_MIN, INT_MAX, V|E|D, .unit = "flags"}, +{"psnr", "error[?] variables will be set during encoding", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_PSNR }, INT_MIN, INT_MAX, V|E, .unit = "flags"}, +{"ildct", "use interlaced DCT", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_INTERLACED_DCT }, INT_MIN, INT_MAX, V|E, .unit = "flags"}, +{"low_delay", "force low delay", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_LOW_DELAY }, INT_MIN, INT_MAX, V|D|E, .unit = "flags"}, +{"global_header", "place global headers in extradata instead of every keyframe", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_GLOBAL_HEADER }, INT_MIN, INT_MAX, V|A|E, .unit = "flags"}, +{"bitexact", "use only bitexact functions (except (I)DCT)", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_BITEXACT }, INT_MIN, INT_MAX, A|V|S|D|E, .unit = "flags"}, +{"aic", "H.263 advanced intra coding / MPEG-4 AC prediction", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_AC_PRED }, INT_MIN, INT_MAX, V|E, .unit = "flags"}, +{"ilme", "interlaced motion estimation", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_INTERLACED_ME }, INT_MIN, INT_MAX, V|E, .unit = "flags"}, +{"cgop", "closed GOP", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_CLOSED_GOP }, INT_MIN, INT_MAX, V|E, .unit = "flags"}, +{"output_corrupt", "Output even potentially corrupted frames", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_OUTPUT_CORRUPT }, INT_MIN, INT_MAX, V|D, .unit = "flags"}, +#if FF_API_DROPCHANGED +{"drop_changed", "Drop frames whose parameters differ from first decoded frame", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG_DROPCHANGED }, INT_MIN, INT_MAX, A|V|D | AV_OPT_FLAG_DEPRECATED, .unit = "flags"}, +#endif +{"flags2", NULL, OFFSET(flags2), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT}, 0, UINT_MAX, V|A|E|D|S, .unit = "flags2"}, +{"fast", "allow non-spec-compliant speedup tricks", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_FAST }, INT_MIN, INT_MAX, V|E, .unit = "flags2"}, +{"noout", "skip bitstream encoding", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_NO_OUTPUT }, INT_MIN, INT_MAX, V|E, .unit = "flags2"}, +{"ignorecrop", "ignore cropping information from sps", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_IGNORE_CROP }, INT_MIN, INT_MAX, V|D, .unit = "flags2"}, +{"local_header", "place global headers at every keyframe instead of in extradata", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_LOCAL_HEADER }, INT_MIN, INT_MAX, V|E, .unit = "flags2"}, +{"chunks", "Frame data might be split into multiple chunks", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_CHUNKS }, INT_MIN, INT_MAX, V|D, .unit = "flags2"}, +{"showall", "Show all frames before the first keyframe", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_SHOW_ALL }, INT_MIN, INT_MAX, V|D, .unit = "flags2"}, +{"export_mvs", "export motion vectors through frame side data", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_EXPORT_MVS}, INT_MIN, INT_MAX, V|D, .unit = "flags2"}, +{"skip_manual", "do not skip samples and export skip information as frame side data", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_SKIP_MANUAL}, INT_MIN, INT_MAX, A|D, .unit = "flags2"}, +{"ass_ro_flush_noop", "do not reset ASS ReadOrder field on flush", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_RO_FLUSH_NOOP}, INT_MIN, INT_MAX, S|D, .unit = "flags2"}, +{"icc_profiles", "generate/parse embedded ICC profiles from/to colorimetry tags", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_FLAG2_ICC_PROFILES}, INT_MIN, INT_MAX, S|D, .unit = "flags2"}, +{"export_side_data", "Export metadata as side data", OFFSET(export_side_data), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT}, 0, UINT_MAX, A|V|S|D|E, .unit = "export_side_data"}, +{"mvs", "export motion vectors through frame side data", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_EXPORT_DATA_MVS}, INT_MIN, INT_MAX, V|D, .unit = "export_side_data"}, +{"prft", "export Producer Reference Time through packet side data", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_EXPORT_DATA_PRFT}, INT_MIN, INT_MAX, A|V|S|E, .unit = "export_side_data"}, +{"venc_params", "export video encoding parameters through frame side data", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_EXPORT_DATA_VIDEO_ENC_PARAMS}, INT_MIN, INT_MAX, V|D, .unit = "export_side_data"}, +{"film_grain", "export film grain parameters through frame side data", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_EXPORT_DATA_FILM_GRAIN}, INT_MIN, INT_MAX, V|D, .unit = "export_side_data"}, +{"enhancements", "export picture enhancement metadata through frame side data", 0, AV_OPT_TYPE_CONST, {.i64 = AV_CODEC_EXPORT_DATA_ENHANCEMENTS}, INT_MIN, INT_MAX, V|D, .unit = "export_side_data"}, +{"time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, 0, INT_MAX}, +{"g", "set the group of picture (GOP) size", OFFSET(gop_size), AV_OPT_TYPE_INT, {.i64 = 12 }, INT_MIN, INT_MAX, V|E}, +{"ar", "set audio sampling rate (in Hz)", OFFSET(sample_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, A|D|E}, +{"cutoff", "set cutoff bandwidth", OFFSET(cutoff), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|E}, +{"frame_size", NULL, OFFSET(frame_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, A|E}, +{"frame_number", NULL, OFFSET(frame_num), AV_OPT_TYPE_INT64, {.i64 = DEFAULT }, INT_MIN, INT_MAX}, +{"delay", NULL, OFFSET(delay), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX}, +{"qcomp", "video quantizer scale compression (VBR). Constant of ratecontrol equation. " + "Recommended range for default rc_eq: 0.0-1.0", + OFFSET(qcompress), AV_OPT_TYPE_FLOAT, {.dbl = 0.5 }, -FLT_MAX, FLT_MAX, V|E}, +{"qblur", "video quantizer scale blur (VBR)", OFFSET(qblur), AV_OPT_TYPE_FLOAT, {.dbl = 0.5 }, -1, FLT_MAX, V|E}, +{"qmin", "minimum video quantizer scale (VBR)", OFFSET(qmin), AV_OPT_TYPE_INT, {.i64 = 2 }, -1, 69, V|E}, +{"qmax", "maximum video quantizer scale (VBR)", OFFSET(qmax), AV_OPT_TYPE_INT, {.i64 = 31 }, -1, 1024, V|E}, +{"qdiff", "maximum difference between the quantizer scales (VBR)", OFFSET(max_qdiff), AV_OPT_TYPE_INT, {.i64 = 3 }, INT_MIN, INT_MAX, V|E}, +{"bf", "set maximum number of B-frames between non-B-frames", OFFSET(max_b_frames), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, -1, INT_MAX, V|E}, +{"b_qfactor", "QP factor between P- and B-frames", OFFSET(b_quant_factor), AV_OPT_TYPE_FLOAT, {.dbl = 1.25 }, -FLT_MAX, FLT_MAX, V|E}, +{"codec_tag", NULL, OFFSET(codec_tag), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX}, +{"bug", "work around not autodetected encoder bugs", OFFSET(workaround_bugs), AV_OPT_TYPE_FLAGS, {.i64 = FF_BUG_AUTODETECT }, INT_MIN, INT_MAX, V|D, .unit = "bug"}, +{"autodetect", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_AUTODETECT }, INT_MIN, INT_MAX, V|D, .unit = "bug"}, +{"xvid_ilace", "Xvid interlacing bug (autodetected if FOURCC == XVIX)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_XVID_ILACE }, INT_MIN, INT_MAX, V|D, .unit = "bug"}, +{"ump4", "(autodetected if FOURCC == UMP4)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_UMP4 }, INT_MIN, INT_MAX, V|D, .unit = "bug"}, +{"no_padding", "padding bug (autodetected)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_NO_PADDING }, INT_MIN, INT_MAX, V|D, .unit = "bug"}, +{"amv", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_AMV }, INT_MIN, INT_MAX, V|D, .unit = "bug"}, +{"qpel_chroma", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_QPEL_CHROMA }, INT_MIN, INT_MAX, V|D, .unit = "bug"}, +{"std_qpel", "old standard qpel (autodetected per FOURCC/version)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_STD_QPEL }, INT_MIN, INT_MAX, V|D, .unit = "bug"}, +{"qpel_chroma2", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_QPEL_CHROMA2 }, INT_MIN, INT_MAX, V|D, .unit = "bug"}, +{"direct_blocksize", "direct-qpel-blocksize bug (autodetected per FOURCC/version)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_DIRECT_BLOCKSIZE }, INT_MIN, INT_MAX, V|D, .unit = "bug"}, +{"edge", "edge padding bug (autodetected per FOURCC/version)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_EDGE }, INT_MIN, INT_MAX, V|D, .unit = "bug"}, +{"hpel_chroma", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_HPEL_CHROMA }, INT_MIN, INT_MAX, V|D, .unit = "bug"}, +{"dc_clip", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_DC_CLIP }, INT_MIN, INT_MAX, V|D, .unit = "bug"}, +{"ms", "work around various bugs in Microsoft's broken decoders", 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_MS }, INT_MIN, INT_MAX, V|D, .unit = "bug"}, +{"trunc", "truncated frames", 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_TRUNCATED}, INT_MIN, INT_MAX, V|D, .unit = "bug"}, +{"iedge", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_BUG_IEDGE }, INT_MIN, INT_MAX, V|D, .unit = "bug"}, +{"strict", "how strictly to follow the standards", OFFSET(strict_std_compliance), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|V|D|E, .unit = "strict"}, +{"very", "strictly conform to a older more strict version of the spec or reference software", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_VERY_STRICT }, INT_MIN, INT_MAX, A|V|D|E, .unit = "strict"}, +{"strict", "strictly conform to all the things in the spec no matter what the consequences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_STRICT }, INT_MIN, INT_MAX, A|V|D|E, .unit = "strict"}, +{"normal", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_NORMAL }, INT_MIN, INT_MAX, A|V|D|E, .unit = "strict"}, +{"unofficial", "allow unofficial extensions", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_UNOFFICIAL }, INT_MIN, INT_MAX, A|V|D|E, .unit = "strict"}, +{"experimental", "allow non-standardized experimental things", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_EXPERIMENTAL }, INT_MIN, INT_MAX, A|V|D|E, .unit = "strict"}, +{"b_qoffset", "QP offset between P- and B-frames", OFFSET(b_quant_offset), AV_OPT_TYPE_FLOAT, {.dbl = 1.25 }, -FLT_MAX, FLT_MAX, V|E}, +{"err_detect", "set error detection flags", OFFSET(err_recognition), AV_OPT_TYPE_FLAGS, {.i64 = 0 }, INT_MIN, INT_MAX, A|V|S|D|E, .unit = "err_detect"}, +{"crccheck", "verify embedded CRCs", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_CRCCHECK }, INT_MIN, INT_MAX, A|V|S|D|E, .unit = "err_detect"}, +{"bitstream", "detect bitstream specification deviations", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_BITSTREAM }, INT_MIN, INT_MAX, A|V|S|D|E, .unit = "err_detect"}, +{"buffer", "detect improper bitstream length", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_BUFFER }, INT_MIN, INT_MAX, A|V|S|D|E, .unit = "err_detect"}, +{"explode", "abort decoding on minor error detection", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_EXPLODE }, INT_MIN, INT_MAX, A|V|S|D|E, .unit = "err_detect"}, +{"ignore_err", "ignore errors", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_IGNORE_ERR }, INT_MIN, INT_MAX, A|V|S|D|E, .unit = "err_detect"}, +{"careful", "consider things that violate the spec, are fast to check and have not been seen in the wild as errors", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_CAREFUL }, INT_MIN, INT_MAX, A|V|S|D|E, .unit = "err_detect"}, +{"compliant", "consider all spec non compliancies as errors", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_COMPLIANT | AV_EF_CAREFUL }, INT_MIN, INT_MAX, A|V|S|D|E, .unit = "err_detect"}, +{"aggressive", "consider things that a sane encoder should not do as an error", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_AGGRESSIVE | AV_EF_COMPLIANT | AV_EF_CAREFUL}, INT_MIN, INT_MAX, A|V|S|D|E, .unit = "err_detect"}, +{"has_b_frames", NULL, OFFSET(has_b_frames), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX}, +{"block_align", NULL, OFFSET(block_align), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX}, +{"rc_override_count", NULL, OFFSET(rc_override_count), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX}, +{"maxrate", "maximum bitrate (in bits/s). Used for VBV together with bufsize.", OFFSET(rc_max_rate), AV_OPT_TYPE_INT64, {.i64 = DEFAULT }, 0, INT_MAX, V|A|E}, +{"minrate", "minimum bitrate (in bits/s). Most useful in setting up a CBR encode. It is of little use otherwise.", + OFFSET(rc_min_rate), AV_OPT_TYPE_INT64, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|A|E}, +{"bufsize", "set ratecontrol buffer size (in bits)", OFFSET(rc_buffer_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|V|E}, +{"i_qfactor", "QP factor between P- and I-frames", OFFSET(i_quant_factor), AV_OPT_TYPE_FLOAT, {.dbl = -0.8 }, -FLT_MAX, FLT_MAX, V|E}, +{"i_qoffset", "QP offset between P- and I-frames", OFFSET(i_quant_offset), AV_OPT_TYPE_FLOAT, {.dbl = 0.0 }, -FLT_MAX, FLT_MAX, V|E}, +{"dct", "DCT algorithm", OFFSET(dct_algo), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, V|E, .unit = "dct"}, +{"auto", "autoselect a good one", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_AUTO }, INT_MIN, INT_MAX, V|E, .unit = "dct"}, +{"fastint", "fast integer", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_FASTINT }, INT_MIN, INT_MAX, V|E, .unit = "dct"}, +{"int", "accurate integer", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_INT }, INT_MIN, INT_MAX, V|E, .unit = "dct"}, +{"mmx", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_MMX }, INT_MIN, INT_MAX, V|E, .unit = "dct"}, +{"altivec", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_ALTIVEC }, INT_MIN, INT_MAX, V|E, .unit = "dct"}, +{"faan", "floating point AAN DCT", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_FAAN }, INT_MIN, INT_MAX, V|E, .unit = "dct"}, +{"neon", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_NEON }, INT_MIN, INT_MAX, V|E, .unit = "dct"}, +{"lumi_mask", "compresses bright areas stronger than medium ones", OFFSET(lumi_masking), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, V|E}, +{"tcplx_mask", "temporal complexity masking", OFFSET(temporal_cplx_masking), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, V|E}, +{"scplx_mask", "spatial complexity masking", OFFSET(spatial_cplx_masking), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, V|E}, +{"p_mask", "inter masking", OFFSET(p_masking), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, V|E}, +{"dark_mask", "compresses dark areas stronger than medium ones", OFFSET(dark_masking), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, -FLT_MAX, FLT_MAX, V|E}, +{"idct", "select IDCT implementation", OFFSET(idct_algo), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, V|E|D, .unit = "idct"}, +{"auto", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_AUTO }, INT_MIN, INT_MAX, V|E|D, .unit = "idct"}, +{"int", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_INT }, INT_MIN, INT_MAX, V|E|D, .unit = "idct"}, +{"simple", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLE }, INT_MIN, INT_MAX, V|E|D, .unit = "idct"}, +{"simplemmx", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEMMX }, INT_MIN, INT_MAX, V|E|D, .unit = "idct"}, +{"arm", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_ARM }, INT_MIN, INT_MAX, V|E|D, .unit = "idct"}, +{"altivec", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_ALTIVEC }, INT_MIN, INT_MAX, V|E|D, .unit = "idct"}, +{"simplearm", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEARM }, INT_MIN, INT_MAX, V|E|D, .unit = "idct"}, +{"simplearmv5te", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEARMV5TE }, INT_MIN, INT_MAX, V|E|D, .unit = "idct"}, +{"simplearmv6", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEARMV6 }, INT_MIN, INT_MAX, V|E|D, .unit = "idct"}, +{"simpleneon", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLENEON }, INT_MIN, INT_MAX, V|E|D, .unit = "idct"}, +{"xvid", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_XVID }, INT_MIN, INT_MAX, V|E|D, .unit = "idct"}, +{"xvidmmx", "deprecated, for compatibility only", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_XVID }, INT_MIN, INT_MAX, V|E|D, .unit = "idct"}, +{"faani", "floating point AAN IDCT", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_FAAN }, INT_MIN, INT_MAX, V|D|E, .unit = "idct"}, +{"simpleauto", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEAUTO }, INT_MIN, INT_MAX, V|E|D, .unit = "idct"}, +{"ec", "set error concealment strategy", OFFSET(error_concealment), AV_OPT_TYPE_FLAGS, {.i64 = 3 }, INT_MIN, INT_MAX, V|D, .unit = "ec"}, +{"guess_mvs", "iterative motion vector (MV) search (slow)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_EC_GUESS_MVS }, INT_MIN, INT_MAX, V|D, .unit = "ec"}, +{"deblock", "use strong deblock filter for damaged MBs", 0, AV_OPT_TYPE_CONST, {.i64 = FF_EC_DEBLOCK }, INT_MIN, INT_MAX, V|D, .unit = "ec"}, +{"favor_inter", "favor predicting from the previous frame", 0, AV_OPT_TYPE_CONST, {.i64 = FF_EC_FAVOR_INTER }, INT_MIN, INT_MAX, V|D, .unit = "ec"}, +{"bits_per_coded_sample", NULL, OFFSET(bits_per_coded_sample), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX}, +{"aspect", "sample aspect ratio", OFFSET(sample_aspect_ratio), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, 0, 10, V|E}, +{"sar", "sample aspect ratio", OFFSET(sample_aspect_ratio), AV_OPT_TYPE_RATIONAL, {.dbl = 0}, 0, 10, V|E}, +{"debug", "print specific debug info", OFFSET(debug), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT }, 0, INT_MAX, V|A|S|E|D, .unit = "debug"}, +{"pict", "picture info", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_PICT_INFO }, INT_MIN, INT_MAX, V|D, .unit = "debug"}, +{"rc", "rate control", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_RC }, INT_MIN, INT_MAX, V|E, .unit = "debug"}, +{"bitstream", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_BITSTREAM }, INT_MIN, INT_MAX, V|D, .unit = "debug"}, +{"mb_type", "macroblock (MB) type", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_MB_TYPE }, INT_MIN, INT_MAX, V|D, .unit = "debug"}, +{"qp", "per-block quantization parameter (QP)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_QP }, INT_MIN, INT_MAX, V|D, .unit = "debug"}, +{"dct_coeff", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_DCT_COEFF }, INT_MIN, INT_MAX, V|D, .unit = "debug"}, +{"green_metadata", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_GREEN_MD }, INT_MIN, INT_MAX, V|D, .unit = "debug"}, +{"skip", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_SKIP }, INT_MIN, INT_MAX, V|D, .unit = "debug"}, +{"startcode", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_STARTCODE }, INT_MIN, INT_MAX, V|D, .unit = "debug"}, +{"er", "error recognition", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_ER }, INT_MIN, INT_MAX, V|D, .unit = "debug"}, +{"mmco", "memory management control operations (H.264)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_MMCO }, INT_MIN, INT_MAX, V|D, .unit = "debug"}, +{"bugs", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_BUGS }, INT_MIN, INT_MAX, V|D, .unit = "debug"}, +{"buffers", "picture buffer allocations", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_BUFFERS }, INT_MIN, INT_MAX, V|D, .unit = "debug"}, +{"thread_ops", "threading operations", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_THREADS }, INT_MIN, INT_MAX, V|A|D, .unit = "debug"}, +{"nomc", "skip motion compensation", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_NOMC }, INT_MIN, INT_MAX, V|A|D, .unit = "debug"}, +{"dia_size", "diamond type & size for motion estimation", OFFSET(dia_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E}, +{"last_pred", "amount of motion predictors from the previous frame", OFFSET(last_predictor_count), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E}, +{"pre_dia_size", "diamond type & size for motion estimation pre-pass", OFFSET(pre_dia_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E}, +{"subq", "sub-pel motion estimation quality", OFFSET(me_subpel_quality), AV_OPT_TYPE_INT, {.i64 = 8 }, INT_MIN, INT_MAX, V|E}, +{"me_range", "limit motion vectors range (1023 for DivX player)", OFFSET(me_range), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E}, +{"global_quality", NULL, OFFSET(global_quality), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|A|E}, +{"slice_flags", NULL, OFFSET(slice_flags), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX}, +{"mbd", "macroblock decision algorithm (high quality mode)", OFFSET(mb_decision), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, 2, V|E, .unit = "mbd"}, +{"simple", "use mbcmp", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MB_DECISION_SIMPLE }, INT_MIN, INT_MAX, V|E, .unit = "mbd"}, +{"bits", "use fewest bits", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MB_DECISION_BITS }, INT_MIN, INT_MAX, V|E, .unit = "mbd"}, +{"rd", "use best rate distortion", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MB_DECISION_RD }, INT_MIN, INT_MAX, V|E, .unit = "mbd"}, +{"rc_init_occupancy", "number of bits which should be loaded into the rc buffer before decoding starts", OFFSET(rc_initial_buffer_occupancy), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E}, +{"threads", "set the number of threads", OFFSET(thread_count), AV_OPT_TYPE_INT, {.i64 = 1 }, 0, INT_MAX, V|A|E|D, .unit = "threads"}, +{"auto", "autodetect a suitable number of threads to use", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, INT_MIN, INT_MAX, V|E|D, .unit = "threads"}, +{"dc", "intra_dc_precision", OFFSET(intra_dc_precision), AV_OPT_TYPE_INT, {.i64 = 0 }, -8, 16, V|E}, +{"nssew", "nsse weight", OFFSET(nsse_weight), AV_OPT_TYPE_INT, {.i64 = 8 }, INT_MIN, INT_MAX, V|E}, +{"skip_top", "number of macroblock rows at the top which are skipped", OFFSET(skip_top), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|D}, +{"skip_bottom", "number of macroblock rows at the bottom which are skipped", OFFSET(skip_bottom), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|D}, +{"profile", NULL, OFFSET(profile), AV_OPT_TYPE_INT, {.i64 = AV_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E|CC, .unit = "avctx.profile"}, +{"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, .unit = "avctx.profile"}, +{"main10", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, V|E, .unit = "avctx.profile"}, +{"level", "encoding level, usually corresponding to the profile level, codec-specific", OFFSET(level), AV_OPT_TYPE_INT, {.i64 = FF_LEVEL_UNKNOWN }, INT_MIN, INT_MAX, V|A|E|CC, .unit = "avctx.level"}, +{"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LEVEL_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, .unit = "avctx.level"}, +{"lowres", "decode at 1= 1/2, 2=1/4, 3=1/8 resolutions", OFFSET(lowres), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, V|A|D}, +{"cmp", "full-pel ME compare function", OFFSET(me_cmp), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E, .unit = "cmp_func"}, +{"subcmp", "sub-pel ME compare function", OFFSET(me_sub_cmp), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E, .unit = "cmp_func"}, +{"mbcmp", "macroblock compare function", OFFSET(mb_cmp), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E, .unit = "cmp_func"}, +{"ildctcmp", "interlaced DCT compare function", OFFSET(ildct_cmp), AV_OPT_TYPE_INT, {.i64 = FF_CMP_VSAD }, INT_MIN, INT_MAX, V|E, .unit = "cmp_func"}, +{"precmp", "pre motion estimation compare function", OFFSET(me_pre_cmp), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E, .unit = "cmp_func"}, +{"sad", "sum of absolute differences, fast", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_SAD }, INT_MIN, INT_MAX, V|E, .unit = "cmp_func"}, +{"sse", "sum of squared errors", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_SSE }, INT_MIN, INT_MAX, V|E, .unit = "cmp_func"}, +{"satd", "sum of absolute Hadamard transformed differences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_SATD }, INT_MIN, INT_MAX, V|E, .unit = "cmp_func"}, +{"dct", "sum of absolute DCT transformed differences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_DCT }, INT_MIN, INT_MAX, V|E, .unit = "cmp_func"}, +{"psnr", "sum of squared quantization errors (avoid, low quality)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_PSNR }, INT_MIN, INT_MAX, V|E, .unit = "cmp_func"}, +{"bit", "number of bits needed for the block", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_BIT }, INT_MIN, INT_MAX, V|E, .unit = "cmp_func"}, +{"rd", "rate distortion optimal, slow", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_RD }, INT_MIN, INT_MAX, V|E, .unit = "cmp_func"}, +{"zero", "0", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_ZERO }, INT_MIN, INT_MAX, V|E, .unit = "cmp_func"}, +{"vsad", "sum of absolute vertical differences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_VSAD }, INT_MIN, INT_MAX, V|E, .unit = "cmp_func"}, +{"vsse", "sum of squared vertical differences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_VSSE }, INT_MIN, INT_MAX, V|E, .unit = "cmp_func"}, +{"nsse", "noise preserving sum of squared differences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_NSSE }, INT_MIN, INT_MAX, V|E, .unit = "cmp_func"}, +#if CONFIG_SNOW_ENCODER +{"w53", "5/3 wavelet, only used in snow", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_W53 }, INT_MIN, INT_MAX, V|E, .unit = "cmp_func"}, +{"w97", "9/7 wavelet, only used in snow", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_W97 }, INT_MIN, INT_MAX, V|E, .unit = "cmp_func"}, +#endif +{"dctmax", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_DCTMAX }, INT_MIN, INT_MAX, V|E, .unit = "cmp_func"}, +{"chroma", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_CHROMA }, INT_MIN, INT_MAX, V|E, .unit = "cmp_func"}, +{"msad", "sum of absolute differences, median predicted", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CMP_MEDIAN_SAD }, INT_MIN, INT_MAX, V|E, .unit = "cmp_func"}, +{"mblmin", "minimum macroblock Lagrange factor (VBR)", OFFSET(mb_lmin), AV_OPT_TYPE_INT, {.i64 = FF_QP2LAMBDA * 2 }, 1, FF_LAMBDA_MAX, V|E}, +{"mblmax", "maximum macroblock Lagrange factor (VBR)", OFFSET(mb_lmax), AV_OPT_TYPE_INT, {.i64 = FF_QP2LAMBDA * 31 }, 1, FF_LAMBDA_MAX, V|E}, +{"skip_loop_filter", "skip loop filtering process for the selected frames", OFFSET(skip_loop_filter), AV_OPT_TYPE_INT, {.i64 = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, V|D, .unit = "avdiscard"}, +{"skip_idct" , "skip IDCT/dequantization for the selected frames", OFFSET(skip_idct), AV_OPT_TYPE_INT, {.i64 = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, V|D, .unit = "avdiscard"}, +{"skip_frame" , "skip decoding for the selected frames", OFFSET(skip_frame), AV_OPT_TYPE_INT, {.i64 = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, V|D, .unit = "avdiscard"}, +{"none" , "discard no frame", 0, AV_OPT_TYPE_CONST, {.i64 = AVDISCARD_NONE }, INT_MIN, INT_MAX, V|D, .unit = "avdiscard"}, +{"default" , "discard useless frames", 0, AV_OPT_TYPE_CONST, {.i64 = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, V|D, .unit = "avdiscard"}, +{"noref" , "discard all non-reference frames", 0, AV_OPT_TYPE_CONST, {.i64 = AVDISCARD_NONREF }, INT_MIN, INT_MAX, V|D, .unit = "avdiscard"}, +{"bidir" , "discard all bidirectional frames", 0, AV_OPT_TYPE_CONST, {.i64 = AVDISCARD_BIDIR }, INT_MIN, INT_MAX, V|D, .unit = "avdiscard"}, +{"nointra" , "discard all frames except I frames", 0, AV_OPT_TYPE_CONST, {.i64 = AVDISCARD_NONINTRA}, INT_MIN, INT_MAX, V|D, .unit = "avdiscard"}, +{"nokey" , "discard all frames except keyframes", 0, AV_OPT_TYPE_CONST, {.i64 = AVDISCARD_NONKEY }, INT_MIN, INT_MAX, V|D, .unit = "avdiscard"}, +{"all" , "discard all frames", 0, AV_OPT_TYPE_CONST, {.i64 = AVDISCARD_ALL }, INT_MIN, INT_MAX, V|D, .unit = "avdiscard"}, +{"bidir_refine", "refine the two motion vectors used in bidirectional macroblocks", OFFSET(bidir_refine), AV_OPT_TYPE_INT, {.i64 = 1 }, 0, 4, V|E}, +{"keyint_min", "minimum interval between IDR-frames", OFFSET(keyint_min), AV_OPT_TYPE_INT, {.i64 = 25 }, INT_MIN, INT_MAX, V|E}, +{"refs", "reference frames to consider for motion compensation", OFFSET(refs), AV_OPT_TYPE_INT, {.i64 = 1 }, INT_MIN, INT_MAX, V|E}, +{"trellis", "rate-distortion optimal quantization", OFFSET(trellis), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|A|E}, +{"mv0_threshold", NULL, OFFSET(mv0_threshold), AV_OPT_TYPE_INT, {.i64 = 256 }, 0, INT_MAX, V|E}, +{"compression_level", NULL, OFFSET(compression_level), AV_OPT_TYPE_INT, {.i64 = FF_COMPRESSION_DEFAULT }, INT_MIN, INT_MAX, V|A|E}, +{"bits_per_raw_sample", NULL, OFFSET(bits_per_raw_sample), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX}, +{"ch_layout", NULL, OFFSET(ch_layout), AV_OPT_TYPE_CHLAYOUT, {.str = NULL }, 0, 0, A|E|D, .unit = "ch_layout"}, +{"rc_max_vbv_use", NULL, OFFSET(rc_max_available_vbv_use), AV_OPT_TYPE_FLOAT, {.dbl = 0 }, 0.0, FLT_MAX, V|E}, +{"rc_min_vbv_use", NULL, OFFSET(rc_min_vbv_overflow_use), AV_OPT_TYPE_FLOAT, {.dbl = 3 }, 0.0, FLT_MAX, V|E}, +#if FF_API_TICKS_PER_FRAME +{"ticks_per_frame", NULL, OFFSET(ticks_per_frame), AV_OPT_TYPE_INT, {.i64 = 1 }, 1, INT_MAX, A|V|E|D}, +#endif +{"color_primaries", "color primaries", OFFSET(color_primaries), AV_OPT_TYPE_INT, {.i64 = AVCOL_PRI_UNSPECIFIED }, 1, INT_MAX, V|E|D, .unit = "color_primaries_type"}, +{"bt709", "BT.709", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT709 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_primaries_type"}, +{"unknown", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, .unit = "color_primaries_type"}, +{"bt470m", "BT.470 M", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT470M }, INT_MIN, INT_MAX, V|E|D, .unit = "color_primaries_type"}, +{"bt470bg", "BT.470 BG", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT470BG }, INT_MIN, INT_MAX, V|E|D, .unit = "color_primaries_type"}, +{"smpte170m", "SMPTE 170 M", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_SMPTE170M }, INT_MIN, INT_MAX, V|E|D, .unit = "color_primaries_type"}, +{"smpte240m", "SMPTE 240 M", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_SMPTE240M }, INT_MIN, INT_MAX, V|E|D, .unit = "color_primaries_type"}, +{"film", "Film", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_FILM }, INT_MIN, INT_MAX, V|E|D, .unit = "color_primaries_type"}, +{"bt2020", "BT.2020", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_BT2020 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_primaries_type"}, +{"smpte428", "SMPTE 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_SMPTE428 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_primaries_type"}, +{"smpte428_1", "SMPTE 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_SMPTE428 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_primaries_type"}, +{"smpte431", "SMPTE 431-2", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_SMPTE431 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_primaries_type"}, +{"smpte432", "SMPTE 422-1", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_SMPTE432 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_primaries_type"}, +{"jedec-p22", "JEDEC P22", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_JEDEC_P22 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_primaries_type"}, +{"ebu3213", "EBU 3213-E", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_EBU3213 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_primaries_type"}, +{"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_PRI_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, .unit = "color_primaries_type"}, +{"color_trc", "color transfer characteristics", OFFSET(color_trc), AV_OPT_TYPE_INT, {.i64 = AVCOL_TRC_UNSPECIFIED }, 1, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"bt709", "BT.709", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_BT709 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"unknown", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"gamma22", "BT.470 M", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_GAMMA22 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"gamma28", "BT.470 BG", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_GAMMA28 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"smpte170m", "SMPTE 170 M", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_SMPTE170M }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"smpte240m", "SMPTE 240 M", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_SMPTE240M }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"linear", "Linear", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_LINEAR }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"log100", "Log", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_LOG }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"log316", "Log square root", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_LOG_SQRT }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"iec61966-2-4", "IEC 61966-2-4", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_IEC61966_2_4 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"bt1361e", "BT.1361", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_BT1361_ECG }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"iec61966-2-1", "IEC 61966-2-1", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_IEC61966_2_1 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"bt2020-10", "BT.2020 - 10 bit", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_BT2020_10 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"bt2020-12", "BT.2020 - 12 bit", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_BT2020_12 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"smpte2084", "SMPTE 2084", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_SMPTE2084 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"smpte428", "SMPTE 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_SMPTE428 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"arib-std-b67", "ARIB STD-B67", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_ARIB_STD_B67 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"log", "Log", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_LOG }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"log_sqrt", "Log square root", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_LOG_SQRT }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"iec61966_2_4", "IEC 61966-2-4", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_IEC61966_2_4 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"bt1361", "BT.1361", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_BT1361_ECG }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"iec61966_2_1", "IEC 61966-2-1", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_IEC61966_2_1 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"bt2020_10bit", "BT.2020 - 10 bit", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_BT2020_10 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"bt2020_12bit", "BT.2020 - 12 bit", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_BT2020_12 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"smpte428_1", "SMPTE 428-1", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_TRC_SMPTE428 }, INT_MIN, INT_MAX, V|E|D, .unit = "color_trc_type"}, +{"colorspace", "color space", OFFSET(colorspace), AV_OPT_TYPE_INT, {.i64 = AVCOL_SPC_UNSPECIFIED }, 0, INT_MAX, V|E|D, .unit = "colorspace_type"}, +{"rgb", "RGB", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_RGB }, INT_MIN, INT_MAX, V|E|D, .unit = "colorspace_type"}, +{"bt709", "BT.709", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_BT709 }, INT_MIN, INT_MAX, V|E|D, .unit = "colorspace_type"}, +{"unknown", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, .unit = "colorspace_type"}, +{"fcc", "FCC", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_FCC }, INT_MIN, INT_MAX, V|E|D, .unit = "colorspace_type"}, +{"bt470bg", "BT.470 BG", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_BT470BG }, INT_MIN, INT_MAX, V|E|D, .unit = "colorspace_type"}, +{"smpte170m", "SMPTE 170 M", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_SMPTE170M }, INT_MIN, INT_MAX, V|E|D, .unit = "colorspace_type"}, +{"smpte240m", "SMPTE 240 M", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_SMPTE240M }, INT_MIN, INT_MAX, V|E|D, .unit = "colorspace_type"}, +{"ycgco", "YCGCO", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_YCGCO }, INT_MIN, INT_MAX, V|E|D, .unit = "colorspace_type"}, +{"bt2020nc", "BT.2020 NCL", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_BT2020_NCL }, INT_MIN, INT_MAX, V|E|D, .unit = "colorspace_type"}, +{"bt2020c", "BT.2020 CL", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_BT2020_CL }, INT_MIN, INT_MAX, V|E|D, .unit = "colorspace_type"}, +{"smpte2085", "SMPTE 2085", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_SMPTE2085 }, INT_MIN, INT_MAX, V|E|D, .unit = "colorspace_type"}, +{"chroma-derived-nc", "Chroma-derived NCL", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_CHROMA_DERIVED_NCL }, INT_MIN, INT_MAX, V|E|D, .unit = "colorspace_type"}, +{"chroma-derived-c", "Chroma-derived CL", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_CHROMA_DERIVED_CL }, INT_MIN, INT_MAX, V|E|D, .unit = "colorspace_type"}, +{"ictcp", "ICtCp", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_ICTCP }, INT_MIN, INT_MAX, V|E|D, .unit = "colorspace_type"}, +{"ipt-c2", "IPT-C2", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_IPT_C2 }, INT_MIN, INT_MAX, V|E|D, .unit = "colorspace_type"}, +{"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, .unit = "colorspace_type"}, +{"ycocg", "YCGCO", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_YCGCO }, INT_MIN, INT_MAX, V|E|D, .unit = "colorspace_type"}, +{"ycgco-re", "YCgCo-R, even add.", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_YCGCO_RE }, INT_MIN, INT_MAX, V|E|D, .unit = "colorspace_type"}, +{"ycgco-ro", "YCgCo-R, odd add.", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_YCGCO_RO }, INT_MIN, INT_MAX, V|E|D, .unit = "colorspace_type"}, +{"bt2020_ncl", "BT.2020 NCL", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_BT2020_NCL }, INT_MIN, INT_MAX, V|E|D, .unit = "colorspace_type"}, +{"bt2020_cl", "BT.2020 CL", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_SPC_BT2020_CL }, INT_MIN, INT_MAX, V|E|D, .unit = "colorspace_type"}, +{"color_range", "color range", OFFSET(color_range), AV_OPT_TYPE_INT, {.i64 = AVCOL_RANGE_UNSPECIFIED }, 0, INT_MAX, V|E|D, .unit = "color_range_type"}, +{"unknown", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, .unit = "color_range_type"}, +{"tv", "MPEG (219*2^(n-8))", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG }, INT_MIN, INT_MAX, V|E|D, .unit = "color_range_type"}, +{"pc", "JPEG (2^n-1)", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_JPEG }, INT_MIN, INT_MAX, V|E|D, .unit = "color_range_type"}, +{"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, .unit = "color_range_type"}, +{"mpeg", "MPEG (219*2^(n-8))", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG }, INT_MIN, INT_MAX, V|E|D, .unit = "color_range_type"}, +{"jpeg", "JPEG (2^n-1)", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_JPEG }, INT_MIN, INT_MAX, V|E|D, .unit = "color_range_type"}, +{"limited", "MPEG (219*2^(n-8))", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG }, INT_MIN, INT_MAX, V|E|D, .unit = "color_range_type"}, +{"full", "JPEG (2^n-1)", 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_JPEG }, INT_MIN, INT_MAX, V|E|D, .unit = "color_range_type"}, +{"chroma_sample_location", "chroma sample location", OFFSET(chroma_sample_location), AV_OPT_TYPE_INT, {.i64 = AVCHROMA_LOC_UNSPECIFIED }, 0, INT_MAX, V|E|D, .unit = "chroma_sample_location_type"}, +{"unknown", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCHROMA_LOC_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, .unit = "chroma_sample_location_type"}, +{"left", "Left", 0, AV_OPT_TYPE_CONST, {.i64 = AVCHROMA_LOC_LEFT }, INT_MIN, INT_MAX, V|E|D, .unit = "chroma_sample_location_type"}, +{"center", "Center", 0, AV_OPT_TYPE_CONST, {.i64 = AVCHROMA_LOC_CENTER }, INT_MIN, INT_MAX, V|E|D, .unit = "chroma_sample_location_type"}, +{"topleft", "Top-left", 0, AV_OPT_TYPE_CONST, {.i64 = AVCHROMA_LOC_TOPLEFT }, INT_MIN, INT_MAX, V|E|D, .unit = "chroma_sample_location_type"}, +{"top", "Top", 0, AV_OPT_TYPE_CONST, {.i64 = AVCHROMA_LOC_TOP }, INT_MIN, INT_MAX, V|E|D, .unit = "chroma_sample_location_type"}, +{"bottomleft", "Bottom-left", 0, AV_OPT_TYPE_CONST, {.i64 = AVCHROMA_LOC_BOTTOMLEFT }, INT_MIN, INT_MAX, V|E|D, .unit = "chroma_sample_location_type"}, +{"bottom", "Bottom", 0, AV_OPT_TYPE_CONST, {.i64 = AVCHROMA_LOC_BOTTOM }, INT_MIN, INT_MAX, V|E|D, .unit = "chroma_sample_location_type"}, +{"unspecified", "Unspecified", 0, AV_OPT_TYPE_CONST, {.i64 = AVCHROMA_LOC_UNSPECIFIED }, INT_MIN, INT_MAX, V|E|D, .unit = "chroma_sample_location_type"}, +{"log_level_offset", "set the log level offset", OFFSET(log_level_offset), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX }, +{"slices", "set the number of slices, used in parallelized encoding", OFFSET(slices), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, V|E}, +{"thread_type", "select multithreading type", OFFSET(thread_type), AV_OPT_TYPE_FLAGS, {.i64 = FF_THREAD_SLICE|FF_THREAD_FRAME }, 0, INT_MAX, V|A|E|D, .unit = "thread_type"}, +{"slice", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_THREAD_SLICE }, INT_MIN, INT_MAX, V|E|D, .unit = "thread_type"}, +{"frame", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_THREAD_FRAME }, INT_MIN, INT_MAX, V|E|D, .unit = "thread_type"}, +{"audio_service_type", "audio service type", OFFSET(audio_service_type), AV_OPT_TYPE_INT, {.i64 = AV_AUDIO_SERVICE_TYPE_MAIN }, 0, AV_AUDIO_SERVICE_TYPE_NB-1, A|E, .unit = "audio_service_type"}, +{"ma", "Main Audio Service", 0, AV_OPT_TYPE_CONST, {.i64 = AV_AUDIO_SERVICE_TYPE_MAIN }, INT_MIN, INT_MAX, A|E, .unit = "audio_service_type"}, +{"ef", "Effects", 0, AV_OPT_TYPE_CONST, {.i64 = AV_AUDIO_SERVICE_TYPE_EFFECTS }, INT_MIN, INT_MAX, A|E, .unit = "audio_service_type"}, +{"vi", "Visually Impaired", 0, AV_OPT_TYPE_CONST, {.i64 = AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED }, INT_MIN, INT_MAX, A|E, .unit = "audio_service_type"}, +{"hi", "Hearing Impaired", 0, AV_OPT_TYPE_CONST, {.i64 = AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED }, INT_MIN, INT_MAX, A|E, .unit = "audio_service_type"}, +{"di", "Dialogue", 0, AV_OPT_TYPE_CONST, {.i64 = AV_AUDIO_SERVICE_TYPE_DIALOGUE }, INT_MIN, INT_MAX, A|E, .unit = "audio_service_type"}, +{"co", "Commentary", 0, AV_OPT_TYPE_CONST, {.i64 = AV_AUDIO_SERVICE_TYPE_COMMENTARY }, INT_MIN, INT_MAX, A|E, .unit = "audio_service_type"}, +{"em", "Emergency", 0, AV_OPT_TYPE_CONST, {.i64 = AV_AUDIO_SERVICE_TYPE_EMERGENCY }, INT_MIN, INT_MAX, A|E, .unit = "audio_service_type"}, +{"vo", "Voice Over", 0, AV_OPT_TYPE_CONST, {.i64 = AV_AUDIO_SERVICE_TYPE_VOICE_OVER }, INT_MIN, INT_MAX, A|E, .unit = "audio_service_type"}, +{"ka", "Karaoke", 0, AV_OPT_TYPE_CONST, {.i64 = AV_AUDIO_SERVICE_TYPE_KARAOKE }, INT_MIN, INT_MAX, A|E, .unit = "audio_service_type"}, +{"request_sample_fmt", "sample format audio decoders should prefer", OFFSET(request_sample_fmt), AV_OPT_TYPE_SAMPLE_FMT, {.i64=AV_SAMPLE_FMT_NONE}, -1, INT_MAX, A|D, .unit = "request_sample_fmt"}, +{"pkt_timebase", NULL, OFFSET(pkt_timebase), AV_OPT_TYPE_RATIONAL, {.dbl = 0 }, 0, INT_MAX, 0}, +{"sub_charenc", "set input text subtitles character encoding", OFFSET(sub_charenc), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, S|D}, +{"sub_charenc_mode", "set input text subtitles character encoding mode", OFFSET(sub_charenc_mode), AV_OPT_TYPE_FLAGS, {.i64 = FF_SUB_CHARENC_MODE_AUTOMATIC}, -1, INT_MAX, S|D, .unit = "sub_charenc_mode"}, +{"do_nothing", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_SUB_CHARENC_MODE_DO_NOTHING}, INT_MIN, INT_MAX, S|D, .unit = "sub_charenc_mode"}, +{"auto", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_SUB_CHARENC_MODE_AUTOMATIC}, INT_MIN, INT_MAX, S|D, .unit = "sub_charenc_mode"}, +{"pre_decoder", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_SUB_CHARENC_MODE_PRE_DECODER}, INT_MIN, INT_MAX, S|D, .unit = "sub_charenc_mode"}, +{"ignore", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_SUB_CHARENC_MODE_IGNORE}, INT_MIN, INT_MAX, S|D, .unit = "sub_charenc_mode"}, +{"apply_cropping", NULL, OFFSET(apply_cropping), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, V | D }, +{"skip_alpha", "Skip processing alpha", OFFSET(skip_alpha), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, V|D }, +{"field_order", "Field order", OFFSET(field_order), AV_OPT_TYPE_INT, {.i64 = AV_FIELD_UNKNOWN }, 0, 5, V|D|E, .unit = "field_order" }, +{"progressive", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_FIELD_PROGRESSIVE }, 0, 0, V|D|E, .unit = "field_order" }, +{"tt", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_FIELD_TT }, 0, 0, V|D|E, .unit = "field_order" }, +{"bb", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_FIELD_BB }, 0, 0, V|D|E, .unit = "field_order" }, +{"tb", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_FIELD_TB }, 0, 0, V|D|E, .unit = "field_order" }, +{"bt", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_FIELD_BT }, 0, 0, V|D|E, .unit = "field_order" }, +{"dump_separator", "set information dump field separator", OFFSET(dump_separator), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, A|V|S|D|E}, +{"codec_whitelist", "List of decoders that are allowed to be used", OFFSET(codec_whitelist), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, A|V|S|D }, +{"pixel_format", "set pixel format", OFFSET(pix_fmt), AV_OPT_TYPE_PIXEL_FMT, {.i64=AV_PIX_FMT_NONE}, -1, INT_MAX, 0 }, +{"video_size", "set video size", OFFSET(width), AV_OPT_TYPE_IMAGE_SIZE, {.str=NULL}, 0, INT_MAX, 0 }, +{"max_pixels", "Maximum number of pixels", OFFSET(max_pixels), AV_OPT_TYPE_INT64, {.i64 = INT_MAX }, 0, INT_MAX, A|V|S|D|E }, +{"max_samples", "Maximum number of samples", OFFSET(max_samples), AV_OPT_TYPE_INT64, {.i64 = INT_MAX }, 0, INT_MAX, A|D|E }, +{"hwaccel_flags", NULL, OFFSET(hwaccel_flags), AV_OPT_TYPE_FLAGS, {.i64 = AV_HWACCEL_FLAG_IGNORE_LEVEL }, 0, UINT_MAX, V|D, .unit = "hwaccel_flags"}, +{"ignore_level", "ignore level even if the codec level used is unknown or higher than the maximum supported level reported by the hardware driver", 0, AV_OPT_TYPE_CONST, { .i64 = AV_HWACCEL_FLAG_IGNORE_LEVEL }, INT_MIN, INT_MAX, V | D, .unit = "hwaccel_flags" }, +{"allow_high_depth", "allow to output YUV pixel formats with a different chroma sampling than 4:2:0 and/or other than 8 bits per component", 0, AV_OPT_TYPE_CONST, {.i64 = AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH }, INT_MIN, INT_MAX, V | D, .unit = "hwaccel_flags"}, +{"allow_profile_mismatch", "attempt to decode anyway if HW accelerated decoder's supported profiles do not exactly match the stream", 0, AV_OPT_TYPE_CONST, {.i64 = AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH }, INT_MIN, INT_MAX, V | D, .unit = "hwaccel_flags"}, +{"unsafe_output", "allow potentially unsafe hwaccel frame output that might require special care to process successfully", 0, AV_OPT_TYPE_CONST, {.i64 = AV_HWACCEL_FLAG_UNSAFE_OUTPUT }, INT_MIN, INT_MAX, V | D, .unit = "hwaccel_flags"}, +{"extra_hw_frames", "Number of extra hardware frames to allocate for the user", OFFSET(extra_hw_frames), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, V|D }, +{"discard_damaged_percentage", "Percentage of damaged samples to discard a frame", OFFSET(discard_damaged_percentage), AV_OPT_TYPE_INT, {.i64 = 95 }, 0, 100, V|D }, +{"side_data_prefer_packet", "Comma-separated list of side data types for which user-supplied (container) data is preferred over coded bytestream", + OFFSET(side_data_prefer_packet), AV_OPT_TYPE_INT | AR, .min = -1, .max = INT_MAX, .flags = V|A|S|D, .unit = "side_data_pkt" }, + {"replaygain", .default_val.i64 = AV_PKT_DATA_REPLAYGAIN, .type = AV_OPT_TYPE_CONST, .flags = A|D, .unit = "side_data_pkt" }, + {"displaymatrix", .default_val.i64 = AV_PKT_DATA_DISPLAYMATRIX, .type = AV_OPT_TYPE_CONST, .flags = A|D, .unit = "side_data_pkt" }, + {"spherical", .default_val.i64 = AV_PKT_DATA_SPHERICAL, .type = AV_OPT_TYPE_CONST, .flags = A|D, .unit = "side_data_pkt" }, + {"stereo3d", .default_val.i64 = AV_PKT_DATA_STEREO3D, .type = AV_OPT_TYPE_CONST, .flags = A|D, .unit = "side_data_pkt" }, + {"audio_service_type", .default_val.i64 = AV_PKT_DATA_AUDIO_SERVICE_TYPE, .type = AV_OPT_TYPE_CONST, .flags = A|D, .unit = "side_data_pkt" }, + {"mastering_display_metadata", .default_val.i64 = AV_PKT_DATA_MASTERING_DISPLAY_METADATA, .type = AV_OPT_TYPE_CONST, .flags = A|D, .unit = "side_data_pkt" }, + {"content_light_level", .default_val.i64 = AV_PKT_DATA_CONTENT_LIGHT_LEVEL, .type = AV_OPT_TYPE_CONST, .flags = A|D, .unit = "side_data_pkt" }, + {"icc_profile", .default_val.i64 = AV_PKT_DATA_ICC_PROFILE, .type = AV_OPT_TYPE_CONST, .flags = A|D, .unit = "side_data_pkt" }, +{NULL}, +}; + +#undef A +#undef V +#undef S +#undef E +#undef D +#undef CC +#undef DEFAULT +#undef OFFSET + +#endif /* AVCODEC_OPTIONS_TABLE_H */ diff --git a/include/libavcodec/packet.h b/include/libavcodec/packet.h index 404d520..0a28010 100644 --- a/include/libavcodec/packet.h +++ b/include/libavcodec/packet.h @@ -33,9 +33,9 @@ #include "libavcodec/version_major.h" /** - * @defgroup lavc_packet AVPacket + * @defgroup lavc_packet_side_data AVPacketSideData * - * Types and functions for working with AVPacket. + * Types and functions for working with AVPacketSideData. * @{ */ enum AVPacketSideDataType { @@ -59,10 +59,6 @@ enum AVPacketSideDataType { * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: * @code * u32le param_flags - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT) - * s32le channel_count - * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT) - * u64le channel_layout * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE) * s32le sample_rate * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS) @@ -161,7 +157,7 @@ enum AVPacketSideDataType { * the packet may contain "dual mono" audio specific to Japanese DTV * and if it is true, recommends only the selected channel to be used. * @code - * u8 selected channels (0=mail/left, 1=sub/right, 2=both) + * u8 selected channels (0=main/left, 1=sub/right, 2=both) * @endcode */ AV_PKT_DATA_JP_DUALMONO, @@ -299,6 +295,56 @@ enum AVPacketSideDataType { */ AV_PKT_DATA_DYNAMIC_HDR10_PLUS, + /** + * IAMF Mix Gain Parameter Data associated with the audio frame. This metadata + * is in the form of the AVIAMFParamDefinition struct and contains information + * defined in sections 3.6.1 and 3.8.1 of the Immersive Audio Model and + * Formats standard. + */ + AV_PKT_DATA_IAMF_MIX_GAIN_PARAM, + + /** + * IAMF Demixing Info Parameter Data associated with the audio frame. This + * metadata is in the form of the AVIAMFParamDefinition struct and contains + * information defined in sections 3.6.1 and 3.8.2 of the Immersive Audio Model + * and Formats standard. + */ + AV_PKT_DATA_IAMF_DEMIXING_INFO_PARAM, + + /** + * IAMF Recon Gain Info Parameter Data associated with the audio frame. This + * metadata is in the form of the AVIAMFParamDefinition struct and contains + * information defined in sections 3.6.1 and 3.8.3 of the Immersive Audio Model + * and Formats standard. + */ + AV_PKT_DATA_IAMF_RECON_GAIN_INFO_PARAM, + + /** + * Ambient viewing environment metadata, as defined by H.274. This metadata + * should be associated with a video stream and contains data in the form + * of the AVAmbientViewingEnvironment struct. + */ + AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT, + + /** + * The number of pixels to discard from the top/bottom/left/right border of the + * decoded frame to obtain the sub-rectangle intended for presentation. + * + * @code + * u32le crop_top + * u32le crop_bottom + * u32le crop_left + * u32le crop_right + * @endcode + */ + AV_PKT_DATA_FRAME_CROPPING, + + /** + * Raw LCEVC payload data, as a uint8_t array, with NAL emulation + * bytes intact. + */ + AV_PKT_DATA_LCEVC, + /** * The number of side data types. * This is not part of the public API/ABI in the sense that it may @@ -310,14 +356,133 @@ enum AVPacketSideDataType { AV_PKT_DATA_NB }; +#if FF_API_QUALITY_FACTOR #define AV_PKT_DATA_QUALITY_FACTOR AV_PKT_DATA_QUALITY_STATS //DEPRECATED +#endif +/** + * This structure stores auxiliary information for decoding, presenting, or + * otherwise processing the coded stream. It is typically exported by demuxers + * and encoders and can be fed to decoders and muxers either in a per packet + * basis, or as global side data (applying to the entire coded stream). + * + * Global side data is handled as follows: + * - During demuxing, it may be exported through + * @ref AVStream.codecpar.side_data "AVStream's codec parameters", which can + * then be passed as input to decoders through the + * @ref AVCodecContext.coded_side_data "decoder context's side data", for + * initialization. + * - For muxing, it can be fed through @ref AVStream.codecpar.side_data + * "AVStream's codec parameters", typically the output of encoders through + * the @ref AVCodecContext.coded_side_data "encoder context's side data", for + * initialization. + * + * Packet specific side data is handled as follows: + * - During demuxing, it may be exported through @ref AVPacket.side_data + * "AVPacket's side data", which can then be passed as input to decoders. + * - For muxing, it can be fed through @ref AVPacket.side_data "AVPacket's + * side data", typically the output of encoders. + * + * Different modules may accept or export different types of side data + * depending on media type and codec. Refer to @ref AVPacketSideDataType for a + * list of defined types and where they may be found or used. + */ typedef struct AVPacketSideData { uint8_t *data; size_t size; enum AVPacketSideDataType type; } AVPacketSideData; +/** + * Allocate a new packet side data. + * + * @param sd pointer to an array of side data to which the side data should + * be added. *sd may be NULL, in which case the array will be + * initialized. + * @param nb_sd pointer to an integer containing the number of entries in + * the array. The integer value will be increased by 1 on success. + * @param type side data type + * @param size desired side data size + * @param flags currently unused. Must be zero + * + * @return pointer to freshly allocated side data on success, or NULL otherwise. + */ +AVPacketSideData *av_packet_side_data_new(AVPacketSideData **psd, int *pnb_sd, + enum AVPacketSideDataType type, + size_t size, int flags); + +/** + * Wrap existing data as packet side data. + * + * @param sd pointer to an array of side data to which the side data should + * be added. *sd may be NULL, in which case the array will be + * initialized + * @param nb_sd pointer to an integer containing the number of entries in + * the array. The integer value will be increased by 1 on success. + * @param type side data type + * @param data a data array. It must be allocated with the av_malloc() family + * of functions. The ownership of the data is transferred to the + * side data array on success + * @param size size of the data array + * @param flags currently unused. Must be zero + * + * @return pointer to freshly allocated side data on success, or NULL otherwise + * On failure, the side data array is unchanged and the data remains + * owned by the caller. + */ +AVPacketSideData *av_packet_side_data_add(AVPacketSideData **sd, int *nb_sd, + enum AVPacketSideDataType type, + void *data, size_t size, int flags); + +/** + * Get side information from a side data array. + * + * @param sd the array from which the side data should be fetched + * @param nb_sd value containing the number of entries in the array. + * @param type desired side information type + * + * @return pointer to side data if present or NULL otherwise + */ +const AVPacketSideData *av_packet_side_data_get(const AVPacketSideData *sd, + int nb_sd, + enum AVPacketSideDataType type); + +/** + * Remove side data of the given type from a side data array. + * + * @param sd the array from which the side data should be removed + * @param nb_sd pointer to an integer containing the number of entries in + * the array. Will be reduced by the amount of entries removed + * upon return + * @param type side information type + */ +void av_packet_side_data_remove(AVPacketSideData *sd, int *nb_sd, + enum AVPacketSideDataType type); + +/** + * Convenience function to free all the side data stored in an array, and + * the array itself. + * + * @param sd pointer to array of side data to free. Will be set to NULL + * upon return. + * @param nb_sd pointer to an integer containing the number of entries in + * the array. Will be set to 0 upon return. + */ +void av_packet_side_data_free(AVPacketSideData **sd, int *nb_sd); + +const char *av_packet_side_data_name(enum AVPacketSideDataType type); + +/** + * @} + */ + +/** + * @defgroup lavc_packet AVPacket + * + * Types and functions for working with AVPacket. + * @{ + */ + /** * This structure stores compressed data. It is typically exported by demuxers * and then passed as input to decoders, or received as output from encoders and @@ -448,13 +613,6 @@ typedef struct AVPacketList { #define AV_PKT_FLAG_DISPOSABLE 0x0010 enum AVSideDataParamChangeFlags { -#if FF_API_OLD_CHANNEL_LAYOUT - /** - * @deprecated those are not used by any decoder - */ - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = 0x0001, - AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002, -#endif AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = 0x0004, AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = 0x0008, }; @@ -603,8 +761,6 @@ int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type, uint8_t* av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, size_t *size); -const char *av_packet_side_data_name(enum AVPacketSideDataType type); - /** * Pack a dictionary for use in side_data. * diff --git a/include/libavcodec/packet_internal.h b/include/libavcodec/packet_internal.h new file mode 100644 index 0000000..52fa6d9 --- /dev/null +++ b/include/libavcodec/packet_internal.h @@ -0,0 +1,75 @@ +/* + * 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_PACKET_INTERNAL_H +#define AVCODEC_PACKET_INTERNAL_H + +#include + +#include "packet.h" + +#define AVPACKET_IS_EMPTY(pkt) (!(pkt)->data && !(pkt)->side_data_elems) + +typedef struct PacketListEntry { + struct PacketListEntry *next; + AVPacket pkt; +} PacketListEntry; + +typedef struct PacketList { + PacketListEntry *head, *tail; +} PacketList; + +/** + * Append an AVPacket to the list. + * + * @param list A PacketList + * @param pkt The packet being appended. The data described in it will + * be made reference counted if it isn't already. + * @param copy A callback to copy the contents of the packet to the list. + May be null, in which case the packet's reference will be + moved to the list. + * @return 0 on success, negative AVERROR value on failure. On failure, + the packet and the list are unchanged. + */ +int avpriv_packet_list_put(PacketList *list, AVPacket *pkt, + int (*copy)(AVPacket *dst, const AVPacket *src), + int flags); + +/** + * Remove the oldest AVPacket in the list and return it. + * + * @note The pkt will be overwritten completely on success. The caller + * owns the packet and must unref it by itself. + * + * @param head A pointer to a PacketList struct + * @param pkt Pointer to an AVPacket struct + * @return 0 on success, and a packet is returned. AVERROR(EAGAIN) if + * the list was empty. + */ +int avpriv_packet_list_get(PacketList *list, AVPacket *pkt); + +/** + * Wipe the list and unref all the packets in it. + */ +void avpriv_packet_list_free(PacketList *list); + +int ff_side_data_set_encoder_stats(AVPacket *pkt, int quality, int64_t *error, int error_count, int pict_type); + +int ff_side_data_set_prft(AVPacket *pkt, int64_t timestamp); + +#endif // AVCODEC_PACKET_INTERNAL_H diff --git a/include/libavcodec/paf.h b/include/libavcodec/paf.h new file mode 100644 index 0000000..ce8245f --- /dev/null +++ b/include/libavcodec/paf.h @@ -0,0 +1,28 @@ +/* + * Packed Animation File decoder/demuxer common code + * Copyright (c) 2012 Paul B Mahol + * + * 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_PAF_H +#define AVCODEC_PAF_H + +#define PAF_SOUND_SAMPLES 2205 +#define PAF_SOUND_FRAME_SIZE ((256 + PAF_SOUND_SAMPLES) * 2) + +#endif /* AVCODEC_PAF_H */ diff --git a/include/libavcodec/parser.h b/include/libavcodec/parser.h new file mode 100644 index 0000000..2cee5ae --- /dev/null +++ b/include/libavcodec/parser.h @@ -0,0 +1,58 @@ +/* + * AVCodecParser prototypes and definitions + * Copyright (c) 2003 Fabrice Bellard + * Copyright (c) 2003 Michael Niedermayer + * + * 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_PARSER_H +#define AVCODEC_PARSER_H + +#include "avcodec.h" + +typedef struct ParseContext{ + uint8_t *buffer; + int index; + int last_index; + unsigned int buffer_size; + uint32_t state; ///< contains the last few bytes in MSB order + int frame_start_found; + int overread; ///< the number of bytes which where irreversibly read from the next frame + int overread_index; ///< the index into ParseContext.buffer of the overread bytes + uint64_t state64; ///< contains the last 8 bytes in MSB order +} ParseContext; + +#define END_NOT_FOUND (-100) + +/** + * Combine the (truncated) bitstream to a complete frame. + * @return -1 if no complete frame could be created, + * AVERROR(ENOMEM) if there was a memory allocation error + */ +int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size); +void ff_parse_close(AVCodecParserContext *s); + +/** + * Fetch timestamps for a specific byte within the current access unit. + * @param off byte position within the access unit + * @param remove Found timestamps will be removed if set to 1, kept if set to 0. + * @param fuzzy Only use found value if it is more informative than what we already have + */ +void ff_fetch_timestamp(AVCodecParserContext *s, int off, int remove, int fuzzy); + +#endif /* AVCODEC_PARSER_H */ diff --git a/include/libavcodec/pcm_tablegen.h b/include/libavcodec/pcm_tablegen.h new file mode 100644 index 0000000..7274c3c --- /dev/null +++ b/include/libavcodec/pcm_tablegen.h @@ -0,0 +1,143 @@ +/* + * Header file for hardcoded PCM tables + * + * Copyright (c) 2010 Reimar Döffinger + * + * 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_PCM_TABLEGEN_H +#define AVCODEC_PCM_TABLEGEN_H + +#include +#include "libavutil/attributes.h" + +/* from g711.c by SUN microsystems (unrestricted use) */ + +#define SIGN_BIT (0x80) /* Sign bit for a A-law byte. */ +#define QUANT_MASK (0xf) /* Quantization field mask. */ +#define NSEGS (8) /* Number of A-law segments. */ +#define SEG_SHIFT (4) /* Left shift for segment number. */ +#define SEG_MASK (0x70) /* Segment field mask. */ + +#define BIAS (0x84) /* Bias for linear code. */ + +#define VIDC_SIGN_BIT (1) +#define VIDC_QUANT_MASK (0x1E) +#define VIDC_QUANT_SHIFT (1) +#define VIDC_SEG_SHIFT (5) +#define VIDC_SEG_MASK (0xE0) + +/* alaw2linear() - Convert an A-law value to 16-bit linear PCM */ +static av_cold int alaw2linear(unsigned char a_val) +{ + int t; + int seg; + + a_val ^= 0x55; + + t = a_val & QUANT_MASK; + seg = ((unsigned)a_val & SEG_MASK) >> SEG_SHIFT; + if(seg) t= (t + t + 1 + 32) << (seg + 2); + else t= (t + t + 1 ) << 3; + + return (a_val & SIGN_BIT) ? t : -t; +} + +static av_cold int ulaw2linear(unsigned char u_val) +{ + int t; + + /* Complement to obtain normal u-law value. */ + u_val = ~u_val; + + /* + * Extract and bias the quantization bits. Then + * shift up by the segment number and subtract out the bias. + */ + t = ((u_val & QUANT_MASK) << 3) + BIAS; + t <<= ((unsigned)u_val & SEG_MASK) >> SEG_SHIFT; + + return (u_val & SIGN_BIT) ? (BIAS - t) : (t - BIAS); +} + +static av_cold int vidc2linear(unsigned char u_val) +{ + int t; + + /* + * Extract and bias the quantization bits. Then + * shift up by the segment number and subtract out the bias. + */ + t = (((u_val & VIDC_QUANT_MASK) >> VIDC_QUANT_SHIFT) << 3) + BIAS; + t <<= ((unsigned)u_val & VIDC_SEG_MASK) >> VIDC_SEG_SHIFT; + + return (u_val & VIDC_SIGN_BIT) ? (BIAS - t) : (t - BIAS); +} + +#if CONFIG_HARDCODED_TABLES +#define pcm_alaw_tableinit() +#define pcm_ulaw_tableinit() +#define pcm_vidc_tableinit() +#include "libavcodec/pcm_tables.h" +#else +/* 16384 entries per table */ +static uint8_t linear_to_alaw[16384]; +static uint8_t linear_to_ulaw[16384]; +static uint8_t linear_to_vidc[16384]; + +static av_cold void build_xlaw_table(uint8_t *linear_to_xlaw, + int (*xlaw2linear)(unsigned char), + int mask) +{ + int i, j, v, v1, v2; + + j = 1; + linear_to_xlaw[8192] = mask; + for(i=0;i<127;i++) { + v1 = xlaw2linear(i ^ mask); + v2 = xlaw2linear((i + 1) ^ mask); + v = (v1 + v2 + 4) >> 3; + for(;j + +#include "avcodec.h" + +typedef struct PixblockDSPContext { + void (*get_pixels)(int16_t *restrict block /* align 16 */, + const uint8_t *pixels /* align 8 */, + ptrdiff_t stride); + void (*get_pixels_unaligned)(int16_t *restrict block /* align 16 */, + const uint8_t *pixels, + ptrdiff_t stride); + void (*diff_pixels)(int16_t *restrict block /* align 16 */, + const uint8_t *s1 /* align 8 */, + const uint8_t *s2 /* align 8 */, + ptrdiff_t stride); + void (*diff_pixels_unaligned)(int16_t *restrict block /* align 16 */, + const uint8_t *s1, + const uint8_t *s2, + ptrdiff_t stride); + +} PixblockDSPContext; + +void ff_pixblockdsp_init(PixblockDSPContext *c, AVCodecContext *avctx); +void ff_pixblockdsp_init_aarch64(PixblockDSPContext *c, AVCodecContext *avctx, + unsigned high_bit_depth); +void ff_pixblockdsp_init_alpha(PixblockDSPContext *c, AVCodecContext *avctx, + unsigned high_bit_depth); +void ff_pixblockdsp_init_arm(PixblockDSPContext *c, AVCodecContext *avctx, + unsigned high_bit_depth); +void ff_pixblockdsp_init_ppc(PixblockDSPContext *c, AVCodecContext *avctx, + unsigned high_bit_depth); +void ff_pixblockdsp_init_riscv(PixblockDSPContext *c, AVCodecContext *avctx, + unsigned high_bit_depth); +void ff_pixblockdsp_init_x86(PixblockDSPContext *c, AVCodecContext *avctx, + unsigned high_bit_depth); +void ff_pixblockdsp_init_mips(PixblockDSPContext *c, AVCodecContext *avctx, + unsigned high_bit_depth); + +#endif /* AVCODEC_PIXBLOCKDSP_H */ diff --git a/include/libavcodec/pixels.h b/include/libavcodec/pixels.h new file mode 100644 index 0000000..98eacd4 --- /dev/null +++ b/include/libavcodec/pixels.h @@ -0,0 +1,37 @@ +/* + * 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_PIXELS_H +#define AVCODEC_PIXELS_H + +#include +#include + +/* pixel operations */ +#define CALL_2X_PIXELS_MACRO(STATIC, a, b, n) \ +STATIC void a(uint8_t *block, const uint8_t *pixels, \ + ptrdiff_t line_size, int h) \ +{ \ + b(block, pixels, line_size, h); \ + b(block + n, pixels + n, line_size, h); \ +} + +#define CALL_2X_PIXELS(a, b, n) CALL_2X_PIXELS_MACRO(static, a, b, n) +#define CALL_2X_PIXELS_EXPORT(a, b, n) CALL_2X_PIXELS_MACRO(, a, b, n) + +#endif /* AVCODEC_PIXELS_H */ diff --git a/include/libavcodec/png.h b/include/libavcodec/png.h new file mode 100644 index 0000000..01171e6 --- /dev/null +++ b/include/libavcodec/png.h @@ -0,0 +1,65 @@ +/* + * PNG image format + * Copyright (c) 2003 Fabrice Bellard + * + * 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_PNG_H +#define AVCODEC_PNG_H + +#include + +#include "pngdsp.h" + +#define PNG_COLOR_MASK_PALETTE 1 +#define PNG_COLOR_MASK_COLOR 2 +#define PNG_COLOR_MASK_ALPHA 4 + +#define PNG_COLOR_TYPE_GRAY 0 +#define PNG_COLOR_TYPE_PALETTE (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE) +#define PNG_COLOR_TYPE_RGB (PNG_COLOR_MASK_COLOR) +#define PNG_COLOR_TYPE_RGB_ALPHA (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA) +#define PNG_COLOR_TYPE_GRAY_ALPHA (PNG_COLOR_MASK_ALPHA) + +#define PNG_FILTER_TYPE_LOCO 64 +#define PNG_FILTER_VALUE_NONE 0 +#define PNG_FILTER_VALUE_SUB 1 +#define PNG_FILTER_VALUE_UP 2 +#define PNG_FILTER_VALUE_AVG 3 +#define PNG_FILTER_VALUE_PAETH 4 +#define PNG_FILTER_VALUE_MIXED 5 + +#define NB_PASSES 7 + +#define PNGSIG 0x89504e470d0a1a0a +#define MNGSIG 0x8a4d4e470d0a1a0a + +/* Mask to determine which y pixels are valid in a pass */ +extern const uint8_t ff_png_pass_ymask[NB_PASSES]; + +int ff_png_get_nb_channels(int color_type); + +/* compute the row size of an interleaved pass */ +int ff_png_pass_row_size(int pass, int bits_per_pixel, int width); + +void ff_add_png_paeth_prediction(uint8_t *dst, uint8_t *src, uint8_t *top, int w, int bpp); + +void ff_png_filter_row(PNGDSPContext *dsp, uint8_t *dst, int filter_type, + uint8_t *src, uint8_t *last, int size, int bpp); + +#endif /* AVCODEC_PNG_H */ diff --git a/include/libavcodec/pngdsp.h b/include/libavcodec/pngdsp.h new file mode 100644 index 0000000..5475d0d --- /dev/null +++ b/include/libavcodec/pngdsp.h @@ -0,0 +1,40 @@ +/* + * PNG image format + * Copyright (c) 2008 Loren Merrit + * + * 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_PNGDSP_H +#define AVCODEC_PNGDSP_H + +#include + +typedef struct PNGDSPContext { + void (*add_bytes_l2)(uint8_t *dst, + uint8_t *src1 /* align 16 */, + uint8_t *src2, int w); + + /* this might write to dst[w] */ + void (*add_paeth_prediction)(uint8_t *dst, uint8_t *src, + uint8_t *top, int w, int bpp); +} PNGDSPContext; + +void ff_pngdsp_init(PNGDSPContext *dsp); +void ff_pngdsp_init_x86(PNGDSPContext *dsp); + +#endif /* AVCODEC_PNGDSP_H */ diff --git a/include/libavcodec/pnm.h b/include/libavcodec/pnm.h new file mode 100644 index 0000000..4906eeb --- /dev/null +++ b/include/libavcodec/pnm.h @@ -0,0 +1,43 @@ +/* + * PNM image format + * Copyright (c) 2002, 2003 Fabrice Bellard + * + * 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_PNM_H +#define AVCODEC_PNM_H + +#include "libavutil/half2float.h" +#include "avcodec.h" + +typedef struct PNMContext { + const uint8_t *bytestream; + const uint8_t *bytestream_start; + const uint8_t *bytestream_end; + int maxval; ///< maximum value of a pixel + int type; + int endian; + int half; + float scale; + + Half2FloatTables h2f_tables; +} PNMContext; + +int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s); + +#endif /* AVCODEC_PNM_H */ diff --git a/include/libavcodec/profiles.h b/include/libavcodec/profiles.h new file mode 100644 index 0000000..33b7ffc --- /dev/null +++ b/include/libavcodec/profiles.h @@ -0,0 +1,81 @@ +/* + * 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_PROFILES_H +#define AVCODEC_PROFILES_H + +#include "codec.h" +#include "defs.h" +#include "libavutil/opt.h" + +#define FF_AVCTX_PROFILE_OPTION(name, description, type, value) \ + {name, description, 0, AV_OPT_TYPE_CONST, {.i64 = value }, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_## type ##_PARAM, .unit = "avctx.profile"}, + +#define FF_AAC_PROFILE_OPTS \ + FF_AVCTX_PROFILE_OPTION("aac_main", NULL, AUDIO, AV_PROFILE_AAC_MAIN)\ + FF_AVCTX_PROFILE_OPTION("aac_low", NULL, AUDIO, AV_PROFILE_AAC_LOW)\ + FF_AVCTX_PROFILE_OPTION("aac_ssr", NULL, AUDIO, AV_PROFILE_AAC_SSR)\ + FF_AVCTX_PROFILE_OPTION("aac_ltp", NULL, AUDIO, AV_PROFILE_AAC_LTP)\ + FF_AVCTX_PROFILE_OPTION("aac_he", NULL, AUDIO, AV_PROFILE_AAC_HE)\ + FF_AVCTX_PROFILE_OPTION("aac_he_v2", NULL, AUDIO, AV_PROFILE_AAC_HE_V2)\ + FF_AVCTX_PROFILE_OPTION("aac_ld", NULL, AUDIO, AV_PROFILE_AAC_LD)\ + FF_AVCTX_PROFILE_OPTION("aac_eld", NULL, AUDIO, AV_PROFILE_AAC_ELD)\ + FF_AVCTX_PROFILE_OPTION("aac_xhe", NULL, AUDIO, AV_PROFILE_AAC_USAC)\ + FF_AVCTX_PROFILE_OPTION("mpeg2_aac_low", NULL, AUDIO, AV_PROFILE_MPEG2_AAC_LOW)\ + FF_AVCTX_PROFILE_OPTION("mpeg2_aac_he", NULL, AUDIO, AV_PROFILE_MPEG2_AAC_HE)\ + +#define FF_MPEG4_PROFILE_OPTS \ + FF_AVCTX_PROFILE_OPTION("mpeg4_sp", NULL, VIDEO, AV_PROFILE_MPEG4_SIMPLE)\ + FF_AVCTX_PROFILE_OPTION("mpeg4_core", NULL, VIDEO, AV_PROFILE_MPEG4_CORE)\ + FF_AVCTX_PROFILE_OPTION("mpeg4_main", NULL, VIDEO, AV_PROFILE_MPEG4_MAIN)\ + FF_AVCTX_PROFILE_OPTION("mpeg4_asp", NULL, VIDEO, AV_PROFILE_MPEG4_ADVANCED_SIMPLE)\ + +#define FF_MPEG2_PROFILE_OPTS \ + FF_AVCTX_PROFILE_OPTION("422", NULL, VIDEO, AV_PROFILE_MPEG2_422)\ + FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, AV_PROFILE_MPEG2_HIGH)\ + FF_AVCTX_PROFILE_OPTION("ss", NULL, VIDEO, AV_PROFILE_MPEG2_SS)\ + FF_AVCTX_PROFILE_OPTION("snr", NULL, VIDEO, AV_PROFILE_MPEG2_SNR_SCALABLE)\ + FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, AV_PROFILE_MPEG2_MAIN)\ + FF_AVCTX_PROFILE_OPTION("simple", NULL, VIDEO, AV_PROFILE_MPEG2_SIMPLE)\ + +#define FF_AV1_PROFILE_OPTS \ + FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, AV_PROFILE_AV1_MAIN)\ + FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, AV_PROFILE_AV1_HIGH)\ + FF_AVCTX_PROFILE_OPTION("professional", NULL, VIDEO, AV_PROFILE_AV1_PROFESSIONAL)\ + +extern const AVProfile ff_aac_profiles[]; +extern const AVProfile ff_dca_profiles[]; +extern const AVProfile ff_eac3_profiles[]; +extern const AVProfile ff_truehd_profiles[]; +extern const AVProfile ff_dnxhd_profiles[]; +extern const AVProfile ff_h264_profiles[]; +extern const AVProfile ff_hevc_profiles[]; +extern const AVProfile ff_vvc_profiles[]; +extern const AVProfile ff_jpeg2000_profiles[]; +extern const AVProfile ff_mpeg2_video_profiles[]; +extern const AVProfile ff_mpeg4_video_profiles[]; +extern const AVProfile ff_vc1_profiles[]; +extern const AVProfile ff_vp9_profiles[]; +extern const AVProfile ff_av1_profiles[]; +extern const AVProfile ff_sbc_profiles[]; +extern const AVProfile ff_prores_profiles[]; +extern const AVProfile ff_mjpeg_profiles[]; +extern const AVProfile ff_arib_caption_profiles[]; +extern const AVProfile ff_evc_profiles[]; + +#endif /* AVCODEC_PROFILES_H */ diff --git a/include/libavcodec/progressframe.h b/include/libavcodec/progressframe.h new file mode 100644 index 0000000..32a345b --- /dev/null +++ b/include/libavcodec/progressframe.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2022 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_PROGRESSFRAME_H +#define AVCODEC_PROGRESSFRAME_H + +/** + * ProgressFrame is an API to easily share frames without an underlying + * av_frame_ref(). Its main usecase is in frame-threading scenarios, + * yet it could also be used for purely single-threaded decoders that + * want to keep multiple references to the same frame. + * + * The underlying principle behind the API is that all that is needed + * to share a frame is a reference count and a contract between all parties. + * The ProgressFrame provides the reference count and the frame is unreferenced + * via ff_thread_release_buffer() when the reference count reaches zero. + * + * In order to make this API also usable for frame-threaded decoders it also + * provides a way of exchanging simple information about the state of + * decoding the frame via ff_thread_progress_report() and + * ff_thread_progress_await(). + * + * The typical contract for frame-threaded decoders is as follows: + * Thread A initializes a ProgressFrame via ff_thread_progress_get_buffer() + * (which already allocates the AVFrame's data buffers), calls + * ff_thread_finish_setup() and starts decoding the frame. Later threads + * receive a reference to this frame, which means they get a pointer + * to the AVFrame and the internal reference count gets incremented. + * Later threads whose frames use A's frame as reference as well as + * the thread that will eventually output A's frame will wait for + * progress on said frame reported by A. As soon as A has reported + * that it has finished decoding its frame, it must no longer modify it + * (neither its data nor its properties). + * + * Because creating a reference with this API does not involve reads + * from the actual AVFrame, the decoding thread may modify the properties + * (i.e. non-data fields) until it has indicated to be done with this + * frame. This is important for e.g. propagating decode_error_flags; + * it also allows to add side-data late. + */ + +struct AVCodecContext; + +/** + * The ProgressFrame structure. + * Hint: It is guaranteed that the AVFrame pointer is at the start + * of ProgressFrame. This allows to use an unnamed + * union { + * struct { + * AVFrame *f; + * }; + * ProgressFrame pf; + * }; + * to simplify accessing the embedded AVFrame. + */ +typedef struct ProgressFrame { + struct AVFrame *f; + struct ProgressInternal *progress; +} ProgressFrame; + +/** + * Notify later decoding threads when part of their reference frame is ready. + * Call this when some part of the frame is finished decoding. + * Later calls with lower values of progress have no effect. + * + * @param f The frame being decoded. + * @param progress Value, in arbitrary units, of how much of the frame has decoded. + * + * @warning Calling this on a blank ProgressFrame causes undefined behaviour + */ +void ff_progress_frame_report(ProgressFrame *f, int progress); + +/** + * Wait for earlier decoding threads to finish reference frames. + * Call this before accessing some part of a frame, with a given + * value for progress, and it will return after the responsible decoding + * thread calls ff_thread_progress_report() with the same or + * higher value for progress. + * + * @param f The frame being referenced. + * @param progress Value, in arbitrary units, to wait for. + * + * @warning Calling this on a blank ProgressFrame causes undefined behaviour + */ +void ff_progress_frame_await(const ProgressFrame *f, int progress); + +/** + * This function allocates ProgressFrame.f + * May be called before ff_progress_frame_get_buffer() in the cases where the + * AVFrame needs to be accessed before the ff_thread_get_buffer() call in + * ff_progress_frame_alloc(). + * + * @note: This must only be called by codecs with the + * FF_CODEC_CAP_USES_PROGRESSFRAMES internal cap. + */ +int ff_progress_frame_alloc(struct AVCodecContext *avctx, ProgressFrame *f); + +/** + * This function sets up the ProgressFrame, i.e. allocates ProgressFrame.f + * if needed, and also calls ff_thread_get_buffer() on the frame. + * + * @note: This must only be called by codecs with the + * FF_CODEC_CAP_USES_PROGRESSFRAMES internal cap. + * @see ff_progress_frame_alloc + */ +int ff_progress_frame_get_buffer(struct AVCodecContext *avctx, + ProgressFrame *f, int flags); + +/** + * Give up a reference to the underlying frame contained in a ProgressFrame + * and reset the ProgressFrame, setting all pointers to NULL. + * + * @note: This implies that when using this API the check for whether + * a frame exists is by checking ProgressFrame.f and not + * ProgressFrame.f->data[0] or ProgressFrame.f->buf[0]. + */ +void ff_progress_frame_unref(ProgressFrame *f); + +/** + * Set dst->f to src->f and make dst a co-owner of src->f. + * dst can then be used to wait on progress of the underlying frame. + * + * @note: There is no underlying av_frame_ref() here. dst->f and src->f + * really point to the same AVFrame. Typically this means that + * the decoding thread is allowed to set all the properties of + * the AVFrame until it has indicated to have finished decoding. + * Afterwards later threads may read all of these fields. + * Access to the frame's data is governed by + * ff_thread_progress_report/await(). + */ +void ff_progress_frame_ref(ProgressFrame *dst, const ProgressFrame *src); + +/** + * Do nothing if dst and src already refer to the same AVFrame; + * otherwise unreference dst and if src is not blank, put a reference + * to src's AVFrame in its place (in case src is not blank). + */ +void ff_progress_frame_replace(ProgressFrame *dst, const ProgressFrame *src); + +#endif /* AVCODEC_PROGRESSFRAME_H */ diff --git a/include/libavcodec/proresdata.h b/include/libavcodec/proresdata.h new file mode 100644 index 0000000..d859e93 --- /dev/null +++ b/include/libavcodec/proresdata.h @@ -0,0 +1,38 @@ +/* + * Apple ProRes compatible decoder + * + * Copyright (c) 2010-2011 Maxim Poliakovski + * + * 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_PRORESDATA_H +#define AVCODEC_PRORESDATA_H + +#include + +#define FRAME_ID MKBETAG('i', 'c', 'p', 'f') + +extern const uint8_t ff_prores_progressive_scan[64]; +extern const uint8_t ff_prores_interlaced_scan[64]; +extern const uint8_t ff_prores_dc_codebook[7]; +extern const uint8_t ff_prores_run_to_cb[16]; +extern const uint8_t ff_prores_level_to_cb[10]; + +#define FIRST_DC_CB 0xB8 // rice_order = 5, exp_golomb_order = 6, switch_bits = 0 + +#endif /* AVCODEC_PRORESDATA_H */ diff --git a/include/libavcodec/proresdec.h b/include/libavcodec/proresdec.h new file mode 100644 index 0000000..230fca4 --- /dev/null +++ b/include/libavcodec/proresdec.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2010-2011 Maxim Poliakovski + * Copyright (c) 2010-2011 Elvis Presley + * + * 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_PRORESDEC_H +#define AVCODEC_PRORESDEC_H + +#include + +#include "get_bits.h" +#include "blockdsp.h" +#include "proresdsp.h" + +#include "libavutil/frame.h" +#include "libavutil/pixfmt.h" + +typedef struct { + const uint8_t *data; + unsigned mb_x; + unsigned mb_y; + unsigned mb_count; + unsigned data_size; + int ret; +} SliceContext; + +typedef struct { + BlockDSPContext bdsp; + ProresDSPContext prodsp; + AVFrame *frame; + int frame_type; ///< 0 = progressive, 1 = tff, 2 = bff + uint8_t qmat_luma[64]; + uint8_t qmat_chroma[64]; + SliceContext *slices; + int slice_count; ///< number of slices in the current picture + unsigned mb_width; ///< width of the current picture in mb + unsigned mb_height; ///< height of the current picture in mb + uint8_t progressive_scan[64]; + uint8_t interlaced_scan[64]; + const uint8_t *scan; + int first_field; + int alpha_info; + void (*unpack_alpha)(GetBitContext *gb, uint16_t *dst, int num_coeffs, const int num_bits); + enum AVPixelFormat pix_fmt; +} ProresContext; + +#endif /* AVCODEC_PRORESDEC_H */ diff --git a/include/libavcodec/proresdsp.h b/include/libavcodec/proresdsp.h new file mode 100644 index 0000000..966ba3d --- /dev/null +++ b/include/libavcodec/proresdsp.h @@ -0,0 +1,39 @@ +/* + * Apple ProRes compatible decoder + * + * Copyright (c) 2010-2011 Maxim Poliakovski + * + * 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_PRORESDSP_H +#define AVCODEC_PRORESDSP_H + +#include +#include + +typedef struct ProresDSPContext { + int idct_permutation_type; + uint8_t idct_permutation[64]; + void (*idct_put)(uint16_t *out, ptrdiff_t linesize, int16_t *block, const int16_t *qmat); +} ProresDSPContext; + +int ff_proresdsp_init(ProresDSPContext *dsp, int bits_per_raw_sample); + +void ff_proresdsp_init_x86(ProresDSPContext *dsp, int bits_per_raw_sample); + +#endif /* AVCODEC_PRORESDSP_H */ diff --git a/include/libavcodec/psymodel.h b/include/libavcodec/psymodel.h new file mode 100644 index 0000000..22899a3 --- /dev/null +++ b/include/libavcodec/psymodel.h @@ -0,0 +1,204 @@ +/* + * audio encoder psychoacoustic model + * Copyright (C) 2008 Konstantin Shishkov + * + * 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_PSYMODEL_H +#define AVCODEC_PSYMODEL_H + +#include "avcodec.h" + +/** maximum possible number of bands */ +#define PSY_MAX_BANDS 128 +/** maximum number of channels */ +#define PSY_MAX_CHANS 20 + +/* cutoff for VBR is purposely increased, since LP filtering actually + * hinders VBR performance rather than the opposite + */ +#define AAC_CUTOFF_FROM_BITRATE(bit_rate,channels,sample_rate) (bit_rate ? FFMIN3(FFMIN3( \ + FFMAX(bit_rate/channels/5, bit_rate/channels*15/32 - 5500), \ + 3000 + bit_rate/channels/4, \ + 12000 + bit_rate/channels/16), \ + 22000, \ + sample_rate / 2): (sample_rate / 2)) +#define AAC_CUTOFF(s) ( \ + (s->flags & AV_CODEC_FLAG_QSCALE) \ + ? s->sample_rate / 2 \ + : AAC_CUTOFF_FROM_BITRATE(s->bit_rate, s->ch_layout.nb_channels, s->sample_rate) \ +) + +/** + * single band psychoacoustic information + */ +typedef struct FFPsyBand { + int bits; + float energy; + float threshold; + float spread; /* Energy spread over the band */ +} FFPsyBand; + +/** + * single channel psychoacoustic information + */ +typedef struct FFPsyChannel { + FFPsyBand psy_bands[PSY_MAX_BANDS]; ///< channel bands information + float entropy; ///< total PE for this channel +} FFPsyChannel; + +/** + * psychoacoustic information for an arbitrary group of channels + */ +typedef struct FFPsyChannelGroup { + FFPsyChannel *ch[PSY_MAX_CHANS]; ///< pointers to the individual channels in the group + uint8_t num_ch; ///< number of channels in this group + uint8_t coupling[PSY_MAX_BANDS]; ///< allow coupling for this band in the group +} FFPsyChannelGroup; + +/** + * windowing related information + */ +typedef struct FFPsyWindowInfo { + int window_type[3]; ///< window type (short/long/transitional, etc.) - current, previous and next + int window_shape; ///< window shape (sine/KBD/whatever) + int num_windows; ///< number of windows in a frame + int grouping[8]; ///< window grouping (for e.g. AAC) + float clipping[8]; ///< maximum absolute normalized intensity in the given window for clip avoidance + int *window_sizes; ///< sequence of window sizes inside one frame (for eg. WMA) +} FFPsyWindowInfo; + +/** + * context used by psychoacoustic model + */ +typedef struct FFPsyContext { + AVCodecContext *avctx; ///< encoder context + const struct FFPsyModel *model; ///< encoder-specific model functions + + FFPsyChannel *ch; ///< single channel information + FFPsyChannelGroup *group; ///< channel group information + int num_groups; ///< number of channel groups + int cutoff; ///< lowpass frequency cutoff for analysis + + uint8_t **bands; ///< scalefactor band sizes for possible frame sizes + int *num_bands; ///< number of scalefactor bands for possible frame sizes + int num_lens; ///< number of scalefactor band sets + + struct { + int size; ///< size of the bitresevoir in bits + int bits; ///< number of bits used in the bitresevoir + int alloc; ///< number of bits allocated by the psy, or -1 if no allocation was done + } bitres; + + void* model_priv_data; ///< psychoacoustic model implementation private data +} FFPsyContext; + +/** + * codec-specific psychoacoustic model implementation + */ +typedef struct FFPsyModel { + const char *name; + int (*init) (FFPsyContext *apc); + + /** + * Suggest window sequence for channel. + * + * @param ctx model context + * @param audio samples for the current frame + * @param la lookahead samples (NULL when unavailable) + * @param channel number of channel element to analyze + * @param prev_type previous window type + * + * @return suggested window information in a structure + */ + FFPsyWindowInfo (*window)(FFPsyContext *ctx, const float *audio, const float *la, int channel, int prev_type); + + /** + * Perform psychoacoustic analysis and set band info (threshold, energy) for a group of channels. + * + * @param ctx model context + * @param channel channel number of the first channel in the group to perform analysis on + * @param coeffs array of pointers to the transformed coefficients + * @param wi window information for the channels in the group + */ + void (*analyze)(FFPsyContext *ctx, int channel, const float **coeffs, const FFPsyWindowInfo *wi); + + void (*end) (FFPsyContext *apc); +} FFPsyModel; + +/** + * Initialize psychoacoustic model. + * + * @param ctx model context + * @param avctx codec context + * @param num_lens number of possible frame lengths + * @param bands scalefactor band lengths for all frame lengths + * @param num_bands number of scalefactor bands for all frame lengths + * @param num_groups number of channel groups + * @param group_map array with # of channels in group - 1, for each group + * + * @return zero if successful, a negative value if not + */ +int ff_psy_init(FFPsyContext *ctx, AVCodecContext *avctx, int num_lens, + const uint8_t **bands, const int *num_bands, + int num_groups, const uint8_t *group_map); + +/** + * Determine what group a channel belongs to. + * + * @param ctx psymodel context + * @param channel channel to locate the group for + * + * @return pointer to the FFPsyChannelGroup this channel belongs to + */ +FFPsyChannelGroup *ff_psy_find_group(FFPsyContext *ctx, int channel); + +/** + * Cleanup model context at the end. + * + * @param ctx model context + */ +void ff_psy_end(FFPsyContext *ctx); + + +/************************************************************************** + * Audio preprocessing stuff. * + * This should be moved into some audio filter eventually. * + **************************************************************************/ +struct FFPsyPreprocessContext; + +/** + * psychoacoustic model audio preprocessing initialization + */ +struct FFPsyPreprocessContext *ff_psy_preprocess_init(AVCodecContext *avctx); + +/** + * Preprocess several channel in audio frame in order to compress it better. + * + * @param ctx preprocessing context + * @param audio samples to be filtered (in place) + * @param channels number of channel to preprocess + */ +void ff_psy_preprocess(struct FFPsyPreprocessContext *ctx, float **audio, int channels); + +/** + * Cleanup audio preprocessing module. + */ +void ff_psy_preprocess_end(struct FFPsyPreprocessContext *ctx); + +#endif /* AVCODEC_PSYMODEL_H */ diff --git a/include/libavcodec/pthread_internal.h b/include/libavcodec/pthread_internal.h new file mode 100644 index 0000000..d0b6a7a --- /dev/null +++ b/include/libavcodec/pthread_internal.h @@ -0,0 +1,66 @@ +/* + * 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_PTHREAD_INTERNAL_H +#define AVCODEC_PTHREAD_INTERNAL_H + +#include "avcodec.h" + +/* H.264 slice threading seems to be buggy with more than 16 threads, + * limit the number of threads to 16 for automatic detection */ +#define MAX_AUTO_THREADS 16 + +int ff_slice_thread_init(AVCodecContext *avctx); +void ff_slice_thread_free(AVCodecContext *avctx); + +int ff_frame_thread_init(AVCodecContext *avctx); +void ff_frame_thread_free(AVCodecContext *avctx, int thread_count); + +#define THREAD_SENTINEL 0 // This forbids putting a mutex/condition variable at the front. +/** + * Initialize/destroy a list of mutexes/conditions contained in a structure. + * The positions of these mutexes/conditions in the structure are given by + * their offsets. Because it is undefined behaviour to destroy + * an uninitialized mutex/condition, ff_pthread_init() stores the number + * of successfully initialized mutexes and conditions in the object itself + * and ff_pthread_free() uses this number to destroy exactly the mutexes and + * condition variables that have been successfully initialized. + * + * @param obj The object containing the mutexes/conditions. + * @param[in] offsets An array of offsets. Its first member gives the offset + * of the variable that contains the count of successfully + * initialized mutexes/condition variables; said variable + * must be an unsigned int. Two arrays of offsets, each + * delimited by a THREAD_SENTINEL follow. The first + * contains the offsets of all the mutexes, the second + * contains the offsets of all the condition variables. + */ +int ff_pthread_init(void *obj, const unsigned offsets[]); +void ff_pthread_free(void *obj, const unsigned offsets[]); + +/** + * Macros to help creating the above lists. mutexes and conds need + * to be parentheses-enclosed lists of offsets in the containing structure. + */ +#define OFFSET_ARRAY(...) __VA_ARGS__, THREAD_SENTINEL +#define DEFINE_OFFSET_ARRAY(type, name, cnt_variable, mutexes, conds) \ +static const unsigned name ## _offsets[] = { offsetof(type, cnt_variable), \ + OFFSET_ARRAY mutexes, \ + OFFSET_ARRAY conds } + +#endif // AVCODEC_PTHREAD_INTERNAL_H diff --git a/include/libavcodec/put_bits.h b/include/libavcodec/put_bits.h new file mode 100644 index 0000000..0caaa6b --- /dev/null +++ b/include/libavcodec/put_bits.h @@ -0,0 +1,428 @@ +/* + * copyright (c) 2004 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * bitstream writer API + */ + +#ifndef AVCODEC_PUT_BITS_H +#define AVCODEC_PUT_BITS_H + +#include +#include + +#include "config.h" +#include "libavutil/intreadwrite.h" +#include "libavutil/avassert.h" +#include "libavutil/common.h" + +#if ARCH_X86_64 +// TODO: Benchmark and optionally enable on other 64-bit architectures. +typedef uint64_t BitBuf; +#define AV_WBBUF AV_WB64 +#define AV_WLBUF AV_WL64 +#else +typedef uint32_t BitBuf; +#define AV_WBBUF AV_WB32 +#define AV_WLBUF AV_WL32 +#endif + +static const int BUF_BITS = 8 * sizeof(BitBuf); + +typedef struct PutBitContext { + BitBuf bit_buf; + int bit_left; + uint8_t *buf, *buf_ptr, *buf_end; +} PutBitContext; + +/** + * Initialize the PutBitContext s. + * + * @param buffer the buffer where to put bits + * @param buffer_size the size in bytes of buffer + */ +static inline void init_put_bits(PutBitContext *s, uint8_t *buffer, + int buffer_size) +{ + if (buffer_size < 0) { + buffer_size = 0; + buffer = NULL; + } + + s->buf = buffer; + s->buf_end = s->buf + buffer_size; + s->buf_ptr = s->buf; + s->bit_left = BUF_BITS; + s->bit_buf = 0; +} + +/** + * @return the total number of bits written to the bitstream. + */ +static inline int put_bits_count(PutBitContext *s) +{ + return (s->buf_ptr - s->buf) * 8 + BUF_BITS - s->bit_left; +} + +/** + * @return the number of bytes output so far; may only be called + * when the PutBitContext is freshly initialized or flushed. + */ +static inline int put_bytes_output(const PutBitContext *s) +{ + av_assert2(s->bit_left == BUF_BITS); + return s->buf_ptr - s->buf; +} + +/** + * @param round_up When set, the number of bits written so far will be + * rounded up to the next byte. + * @return the number of bytes output so far. + */ +static inline int put_bytes_count(const PutBitContext *s, int round_up) +{ + return s->buf_ptr - s->buf + ((BUF_BITS - s->bit_left + (round_up ? 7 : 0)) >> 3); +} + +/** + * Rebase the bit writer onto a reallocated buffer. + * + * @param buffer the buffer where to put bits + * @param buffer_size the size in bytes of buffer, + * must be large enough to hold everything written so far + */ +static inline void rebase_put_bits(PutBitContext *s, uint8_t *buffer, + int buffer_size) +{ + av_assert0(8*buffer_size >= put_bits_count(s)); + + s->buf_end = buffer + buffer_size; + s->buf_ptr = buffer + (s->buf_ptr - s->buf); + s->buf = buffer; +} + +/** + * @return the number of bits available in the bitstream. + */ +static inline int put_bits_left(PutBitContext* s) +{ + return (s->buf_end - s->buf_ptr) * 8 - BUF_BITS + s->bit_left; +} + +/** + * @param round_up When set, the number of bits written will be + * rounded up to the next byte. + * @return the number of bytes left. + */ +static inline int put_bytes_left(const PutBitContext *s, int round_up) +{ + return s->buf_end - s->buf_ptr - ((BUF_BITS - s->bit_left + (round_up ? 7 : 0)) >> 3); +} + +/** + * Pad the end of the output stream with zeros. + */ +static inline void flush_put_bits(PutBitContext *s) +{ +#ifndef BITSTREAM_WRITER_LE + if (s->bit_left < BUF_BITS) + s->bit_buf <<= s->bit_left; +#endif + while (s->bit_left < BUF_BITS) { + av_assert0(s->buf_ptr < s->buf_end); +#ifdef BITSTREAM_WRITER_LE + *s->buf_ptr++ = s->bit_buf; + s->bit_buf >>= 8; +#else + *s->buf_ptr++ = s->bit_buf >> (BUF_BITS - 8); + s->bit_buf <<= 8; +#endif + s->bit_left += 8; + } + s->bit_left = BUF_BITS; + s->bit_buf = 0; +} + +static inline void flush_put_bits_le(PutBitContext *s) +{ + while (s->bit_left < BUF_BITS) { + av_assert0(s->buf_ptr < s->buf_end); + *s->buf_ptr++ = s->bit_buf; + s->bit_buf >>= 8; + s->bit_left += 8; + } + s->bit_left = BUF_BITS; + s->bit_buf = 0; +} + +#ifdef BITSTREAM_WRITER_LE +#define ff_put_string ff_put_string_unsupported_here +#define ff_copy_bits ff_copy_bits_unsupported_here +#else + +/** + * Put the string string in the bitstream. + * + * @param terminate_string 0-terminates the written string if value is 1 + */ +void ff_put_string(PutBitContext *pb, const char *string, + int terminate_string); + +/** + * Copy the content of src to the bitstream. + * + * @param length the number of bits of src to copy + */ +void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length); +#endif + +static inline void put_bits_no_assert(PutBitContext *s, int n, BitBuf value) +{ + BitBuf bit_buf; + int bit_left; + + bit_buf = s->bit_buf; + bit_left = s->bit_left; + + /* XXX: optimize */ +#ifdef BITSTREAM_WRITER_LE + bit_buf |= value << (BUF_BITS - bit_left); + if (n >= bit_left) { + if (s->buf_end - s->buf_ptr >= sizeof(BitBuf)) { + AV_WLBUF(s->buf_ptr, bit_buf); + s->buf_ptr += sizeof(BitBuf); + } else { + av_log(NULL, AV_LOG_ERROR, "Internal error, put_bits buffer too small\n"); + av_assert2(0); + } + bit_buf = value >> bit_left; + bit_left += BUF_BITS; + } + bit_left -= n; +#else + if (n < bit_left) { + bit_buf = (bit_buf << n) | value; + bit_left -= n; + } else { + bit_buf <<= bit_left; + bit_buf |= value >> (n - bit_left); + if (s->buf_end - s->buf_ptr >= sizeof(BitBuf)) { + AV_WBBUF(s->buf_ptr, bit_buf); + s->buf_ptr += sizeof(BitBuf); + } else { + av_log(NULL, AV_LOG_ERROR, "Internal error, put_bits buffer too small\n"); + av_assert2(0); + } + bit_left += BUF_BITS - n; + bit_buf = value; + } +#endif + + s->bit_buf = bit_buf; + s->bit_left = bit_left; +} + +/** + * Write up to 31 bits into a bitstream. + * Use put_bits32 to write 32 bits. + */ +static inline void put_bits(PutBitContext *s, int n, BitBuf value) +{ + av_assert2(n <= 31 && value < (1UL << n)); + put_bits_no_assert(s, n, value); +} + +static inline void put_bits_le(PutBitContext *s, int n, BitBuf value) +{ + BitBuf bit_buf; + int bit_left; + + av_assert2(n <= 31 && value < (1UL << n)); + + bit_buf = s->bit_buf; + bit_left = s->bit_left; + + bit_buf |= value << (BUF_BITS - bit_left); + if (n >= bit_left) { + if (s->buf_end - s->buf_ptr >= sizeof(BitBuf)) { + AV_WLBUF(s->buf_ptr, bit_buf); + s->buf_ptr += sizeof(BitBuf); + } else { + av_log(NULL, AV_LOG_ERROR, "Internal error, put_bits buffer too small\n"); + av_assert2(0); + } + bit_buf = value >> bit_left; + bit_left += BUF_BITS; + } + bit_left -= n; + + s->bit_buf = bit_buf; + s->bit_left = bit_left; +} + +static inline void put_sbits(PutBitContext *pb, int n, int32_t value) +{ + av_assert2(n >= 0 && n <= 31); + + put_bits(pb, n, av_zero_extend(value, n)); +} + +/** + * Write exactly 32 bits into a bitstream. + */ +static void av_unused put_bits32(PutBitContext *s, uint32_t value) +{ + BitBuf bit_buf; + int bit_left; + + if (BUF_BITS > 32) { + put_bits_no_assert(s, 32, value); + return; + } + + bit_buf = s->bit_buf; + bit_left = s->bit_left; + +#ifdef BITSTREAM_WRITER_LE + bit_buf |= (BitBuf)value << (BUF_BITS - bit_left); + if (s->buf_end - s->buf_ptr >= sizeof(BitBuf)) { + AV_WLBUF(s->buf_ptr, bit_buf); + s->buf_ptr += sizeof(BitBuf); + } else { + av_log(NULL, AV_LOG_ERROR, "Internal error, put_bits buffer too small\n"); + av_assert2(0); + } + bit_buf = (uint64_t)value >> bit_left; +#else + bit_buf = (uint64_t)bit_buf << bit_left; + bit_buf |= (BitBuf)value >> (BUF_BITS - bit_left); + if (s->buf_end - s->buf_ptr >= sizeof(BitBuf)) { + AV_WBBUF(s->buf_ptr, bit_buf); + s->buf_ptr += sizeof(BitBuf); + } else { + av_log(NULL, AV_LOG_ERROR, "Internal error, put_bits buffer too small\n"); + av_assert2(0); + } + bit_buf = value; +#endif + + s->bit_buf = bit_buf; + s->bit_left = bit_left; +} + +/** + * Write up to 64 bits into a bitstream. + */ +static inline void put_bits64(PutBitContext *s, int n, uint64_t value) +{ + av_assert2((n == 64) || (n < 64 && value < (UINT64_C(1) << n))); + + if (n < 32) + put_bits(s, n, value); + else if (n == 32) + put_bits32(s, value); + else if (n < 64) { + uint32_t lo = value & 0xffffffff; + uint32_t hi = value >> 32; +#ifdef BITSTREAM_WRITER_LE + put_bits32(s, lo); + put_bits(s, n - 32, hi); +#else + put_bits(s, n - 32, hi); + put_bits32(s, lo); +#endif + } else { + uint32_t lo = value & 0xffffffff; + uint32_t hi = value >> 32; +#ifdef BITSTREAM_WRITER_LE + put_bits32(s, lo); + put_bits32(s, hi); +#else + put_bits32(s, hi); + put_bits32(s, lo); +#endif + + } +} + +static inline void put_sbits63(PutBitContext *pb, int n, int64_t value) +{ + av_assert2(n >= 0 && n < 64); + + put_bits64(pb, n, (uint64_t)(value) & (~(UINT64_MAX << n))); +} + +/** + * Return the pointer to the byte where the bitstream writer will put + * the next bit. + */ +static inline uint8_t *put_bits_ptr(PutBitContext *s) +{ + return s->buf_ptr; +} + +/** + * Skip the given number of bytes. + * PutBitContext must be flushed & aligned to a byte boundary before calling this. + */ +static inline void skip_put_bytes(PutBitContext *s, int n) +{ + av_assert2((put_bits_count(s) & 7) == 0); + av_assert2(s->bit_left == BUF_BITS); + av_assert0(n <= s->buf_end - s->buf_ptr); + s->buf_ptr += n; +} + +/** + * Skip the given number of bits. + * Must only be used if the actual values in the bitstream do not matter. + * If n is < 0 the behavior is undefined. + */ +static inline void skip_put_bits(PutBitContext *s, int n) +{ + unsigned bits = BUF_BITS - s->bit_left + n; + s->buf_ptr += sizeof(BitBuf) * (bits / BUF_BITS); + s->bit_left = BUF_BITS - (bits & (BUF_BITS - 1)); +} + +/** + * Change the end of the buffer. + * + * @param size the new size in bytes of the buffer where to put bits + */ +static inline void set_put_bits_buffer_size(PutBitContext *s, int size) +{ + av_assert0(size <= INT_MAX/8 - BUF_BITS); + s->buf_end = s->buf + size; +} + +/** + * Pad the bitstream with zeros up to the next byte boundary. + */ +static inline void align_put_bits(PutBitContext *s) +{ + put_bits(s, s->bit_left & 7, 0); +} + +#undef AV_WBBUF +#undef AV_WLBUF + +#endif /* AVCODEC_PUT_BITS_H */ diff --git a/include/libavcodec/put_golomb.h b/include/libavcodec/put_golomb.h new file mode 100644 index 0000000..43c1233 --- /dev/null +++ b/include/libavcodec/put_golomb.h @@ -0,0 +1,154 @@ +/* + * exp golomb vlc writing stuff + * Copyright (c) 2003 Michael Niedermayer + * Copyright (c) 2004 Alex Beregszaszi + * + * 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 + */ + +/** + * @file + * @brief + * exp golomb vlc writing stuff + * @author Michael Niedermayer and Alex Beregszaszi + */ + +#ifndef AVCODEC_PUT_GOLOMB_H +#define AVCODEC_PUT_GOLOMB_H + +#include +#include "put_bits.h" + +extern const uint8_t ff_ue_golomb_len[256]; + +/** + * write unsigned exp golomb code. 2^16 - 2 at most + */ +static inline void set_ue_golomb(PutBitContext *pb, int i) +{ + av_assert2(i >= 0); + av_assert2(i <= 0xFFFE); + + if (i < 256) + put_bits(pb, ff_ue_golomb_len[i], i + 1); + else { + int e = av_log2(i + 1); + put_bits(pb, 2 * e + 1, i + 1); + } +} + +/** + * write unsigned exp golomb code. 2^32-2 at most. + */ +static inline void set_ue_golomb_long(PutBitContext *pb, uint32_t i) +{ + av_assert2(i <= (UINT32_MAX - 1)); + + if (i < 256) + put_bits(pb, ff_ue_golomb_len[i], i + 1); + else { + int e = av_log2(i + 1); + put_bits64(pb, 2 * e + 1, i + 1); + } +} + +/** + * write truncated unsigned exp golomb code. + */ +static inline void set_te_golomb(PutBitContext *pb, int i, int range) +{ + av_assert2(range >= 1); + av_assert2(i <= range); + + if (range == 2) + put_bits(pb, 1, i ^ 1); + else + set_ue_golomb(pb, i); +} + +/** + * write signed exp golomb code. 16 bits at most. + */ +static inline void set_se_golomb(PutBitContext *pb, int i) +{ + i = 2 * i - 1; + if (i < 0) + i ^= -1; //FIXME check if gcc does the right thing + set_ue_golomb(pb, i); +} + +/** + * write unsigned golomb rice code (ffv1). + */ +static inline void set_ur_golomb(PutBitContext *pb, int i, int k, int limit, + int esc_len) +{ + int e; + + av_assert2(i >= 0); + + e = i >> k; + if (e < limit) + put_bits(pb, e + k + 1, (1 << k) + av_zero_extend(i, k)); + else + put_bits(pb, limit + esc_len, i - limit + 1); +} + +/** + * write unsigned golomb rice code (jpegls). + */ +static inline void set_ur_golomb_jpegls(PutBitContext *pb, int i, int k, + int limit, int esc_len) +{ + int e; + + av_assert2(i >= 0); + + e = (i >> k) + 1; + if (e < limit) { + while (e > 31) { + put_bits(pb, 31, 0); + e -= 31; + } + put_bits(pb, e, 1); + if (k) + put_sbits(pb, k, i); + } else { + while (limit > 31) { + put_bits(pb, 31, 0); + limit -= 31; + } + put_bits(pb, limit, 1); + put_bits(pb, esc_len, i - 1); + } +} + +/** + * write signed golomb rice code (ffv1). + */ +static inline void set_sr_golomb(PutBitContext *pb, int i, int k, int limit, + int esc_len) +{ + int v; + + v = -2 * i - 1; + v ^= (v >> 31); + + set_ur_golomb(pb, v, k, limit, esc_len); +} + +#endif /* AVCODEC_PUT_GOLOMB_H */ diff --git a/include/libavcodec/qcelpdata.h b/include/libavcodec/qcelpdata.h new file mode 100644 index 0000000..931c990 --- /dev/null +++ b/include/libavcodec/qcelpdata.h @@ -0,0 +1,552 @@ +/* + * QCELP decoder + * Copyright (c) 2007 Reynaldo H. Verdejo Pinochet + * + * 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_QCELPDATA_H +#define AVCODEC_QCELPDATA_H + +/** + * @file + * Data tables for the QCELP decoder + * @author Reynaldo H. Verdejo Pinochet + * @remark FFmpeg merging spearheaded by Kenan Gillet + * @remark Development mentored by Benjamin Larson + */ + +#include +#include +#include "libavutil/common.h" + +/** + * QCELP unpacked data frame + */ +typedef struct QCELPFrame { +/// @name QCELP excitation codebook parameters +/// @{ + uint8_t cbsign[16]; ///< sign of the codebook gain for each codebook subframe + uint8_t cbgain[16]; ///< unsigned codebook gain for each codebook subframe + uint8_t cindex[16]; ///< codebook index for each codebook subframe +/// @} + +/// @name QCELP pitch prediction parameters +/// @{ + uint8_t plag[4]; ///< pitch lag for each pitch subframe + uint8_t pfrac[4]; ///< fractional pitch lag for each pitch subframe + uint8_t pgain[4]; ///< pitch gain for each pitch subframe +/// @} + + /** + * line spectral pair frequencies (LSP) for RATE_OCTAVE, + * line spectral pair frequencies grouped into five vectors + * of dimension two (LSPV) for other rates + */ + uint8_t lspv[10]; + + /** + * reserved bits only present in bitrate 1, 1/4 and 1/8 packets + */ + uint8_t reserved; +} QCELPFrame; + +/** + * Pre-calculated table for hammsinc function. + * Only half of the table is needed because of symmetry. + * + * TIA/EIA/IS-733 2.4.5.2-2/3 + */ +static const float qcelp_hammsinc_table[4] = { -0.006822, 0.041249, -0.143459, 0.588863}; + +typedef struct QCELPBitmap { + uint8_t index; /**< index into the QCELPContext structure */ + uint8_t bitpos; /**< position of the lowest bit in the value's byte */ + uint8_t bitlen; /**< number of bits to read */ +} QCELPBitmap; + +#define QCELP_OF(variable, bit, len) {offsetof(QCELPFrame, variable), bit, len} + +/** + * Bitmap unpacking tables for RATE_FULL + * + * TIA/EIA/IS-733 Table 2.4.7.1-1 + */ +static const QCELPBitmap qcelp_rate_full_bitmap[] = { + // start on bit + QCELP_OF(lspv [ 2], 0, 3), // 265 + QCELP_OF(lspv [ 1], 0, 7), // 262 + QCELP_OF(lspv [ 0], 0, 6), // 255 + QCELP_OF(lspv [ 4], 0, 6), // 249 + QCELP_OF(lspv [ 3], 0, 6), // 243 + QCELP_OF(lspv [ 2], 3, 4), // 237 + QCELP_OF(cbsign[ 0], 0, 1), // 233 + QCELP_OF(cbgain[ 0], 0, 4), // 232 + QCELP_OF(pfrac [ 0], 0, 1), // 228 + QCELP_OF(plag [ 0], 0, 7), // 227 + QCELP_OF(pgain [ 0], 0, 3), // 220 + QCELP_OF(cindex[ 1], 0, 4), // 217 + QCELP_OF(cbsign[ 1], 0, 1), // 213 + QCELP_OF(cbgain[ 1], 0, 4), // 212 + QCELP_OF(cindex[ 0], 0, 7), // 208 + QCELP_OF(cbgain[ 3], 0, 1), // 201 + QCELP_OF(cindex[ 2], 0, 7), // 200 + QCELP_OF(cbsign[ 2], 0, 1), // 193 + QCELP_OF(cbgain[ 2], 0, 4), // 192 + QCELP_OF(cindex[ 1], 4, 3), // 188 + QCELP_OF(plag [ 1], 0, 3), // 185 + QCELP_OF(pgain [ 1], 0, 3), // 182 + QCELP_OF(cindex[ 3], 0, 7), // 179 + QCELP_OF(cbsign[ 3], 0, 1), // 172 + QCELP_OF(cbgain[ 3], 1, 2), // 171 + QCELP_OF(cindex[ 4], 0, 6), // 169 + QCELP_OF(cbsign[ 4], 0, 1), // 163 + QCELP_OF(cbgain[ 4], 0, 4), // 162 + QCELP_OF(pfrac [ 1], 0, 1), // 158 + QCELP_OF(plag [ 1], 3, 4), // 157 + QCELP_OF(cbgain[ 6], 0, 3), // 153 + QCELP_OF(cindex[ 5], 0, 7), // 150 + QCELP_OF(cbsign[ 5], 0, 1), // 143 + QCELP_OF(cbgain[ 5], 0, 4), // 142 + QCELP_OF(cindex[ 4], 6, 1), // 138 + QCELP_OF(cindex[ 7], 0, 3), // 137 + QCELP_OF(cbsign[ 7], 0, 1), // 134 + QCELP_OF(cbgain[ 7], 0, 3), // 133 + QCELP_OF(cindex[ 6], 0, 7), // 130 + QCELP_OF(cbsign[ 6], 0, 1), // 123 + QCELP_OF(cbgain[ 6], 3, 1), // 122 + QCELP_OF(cbgain[ 8], 0, 1), // 121 + QCELP_OF(pfrac [ 2], 0, 1), // 120 + QCELP_OF(plag [ 2], 0, 7), // 119 + QCELP_OF(pgain [ 2], 0, 3), // 112 + QCELP_OF(cindex[ 7], 3, 4), // 109 + QCELP_OF(cbsign[ 9], 0, 1), // 105 + QCELP_OF(cbgain[ 9], 0, 4), // 104 + QCELP_OF(cindex[ 8], 0, 7), // 100 + QCELP_OF(cbsign[ 8], 0, 1), // 93 + QCELP_OF(cbgain[ 8], 1, 3), // 92 + QCELP_OF(cindex[10], 0, 4), // 89 + QCELP_OF(cbsign[10], 0, 1), // 85 + QCELP_OF(cbgain[10], 0, 4), // 84 + QCELP_OF(cindex[ 9], 0, 7), // 80 + QCELP_OF(pgain [ 3], 0, 2), // 73 + QCELP_OF(cindex[11], 0, 7), // 71 + QCELP_OF(cbsign[11], 0, 1), // 64 + QCELP_OF(cbgain[11], 0, 3), // 63 + QCELP_OF(cindex[10], 4, 3), // 60 + QCELP_OF(cindex[12], 0, 2), // 57 + QCELP_OF(cbsign[12], 0, 1), // 55 + QCELP_OF(cbgain[12], 0, 4), // 54 + QCELP_OF(pfrac [ 3], 0, 1), // 50 + QCELP_OF(plag [ 3], 0, 7), // 49 + QCELP_OF(pgain [ 3], 2, 1), // 42 + QCELP_OF(cindex[13], 0, 6), // 41 + QCELP_OF(cbsign[13], 0, 1), // 35 + QCELP_OF(cbgain[13], 0, 4), // 34 + QCELP_OF(cindex[12], 2, 5), // 30 + QCELP_OF(cbgain[15], 0, 3), // 25 + QCELP_OF(cindex[14], 0, 7), // 22 + QCELP_OF(cbsign[14], 0, 1), // 15 + QCELP_OF(cbgain[14], 0, 4), // 14 + QCELP_OF(cindex[13], 6, 1), // 10 + QCELP_OF(reserved, 0, 2), // 9 + QCELP_OF(cindex[15], 0, 7), // 7 + QCELP_OF(cbsign[15], 0, 1) // 0 +}; + +/** + * Bitmap unpacking tables for RATE_HALF + * + * TIA/EIA/IS-733 Table 2.4.7.2-1 + */ +static const QCELPBitmap qcelp_rate_half_bitmap[] = { + // start on bit + QCELP_OF(lspv [2], 0, 3), // 123 + QCELP_OF(lspv [1], 0, 7), // 120 + QCELP_OF(lspv [0], 0, 6), // 113 + QCELP_OF(lspv [4], 0, 6), // 107 + QCELP_OF(lspv [3], 0, 6), // 101 + QCELP_OF(lspv [2], 3, 4), // 95 + QCELP_OF(cbsign[0], 0, 1), // 91 + QCELP_OF(cbgain[0], 0, 4), // 90 + QCELP_OF(pfrac [0], 0, 1), // 86 + QCELP_OF(plag [0], 0, 7), // 85 + QCELP_OF(pgain [0], 0, 3), // 78 + QCELP_OF(plag [1], 0, 6), // 75 + QCELP_OF(pgain [1], 0, 3), // 69 + QCELP_OF(cindex[0], 0, 7), // 66 + QCELP_OF(pgain [2], 0, 2), // 59 + QCELP_OF(cindex[1], 0, 7), // 57 + QCELP_OF(cbsign[1], 0, 1), // 50 + QCELP_OF(cbgain[1], 0, 4), // 49 + QCELP_OF(pfrac [1], 0, 1), // 45 + QCELP_OF(plag [1], 6, 1), // 44 + QCELP_OF(cindex[2], 0, 2), // 43 + QCELP_OF(cbsign[2], 0, 1), // 41 + QCELP_OF(cbgain[2], 0, 4), // 40 + QCELP_OF(pfrac [2], 0, 1), // 36 + QCELP_OF(plag [2], 0, 7), // 35 + QCELP_OF(pgain [2], 2, 1), // 28 + QCELP_OF(pfrac [3], 0, 1), // 27 + QCELP_OF(plag [3], 0, 7), // 26 + QCELP_OF(pgain [3], 0, 3), // 19 + QCELP_OF(cindex[2], 2, 5), // 16 + QCELP_OF(cindex[3], 0, 7), // 11 + QCELP_OF(cbsign[3], 0, 1), // 4 + QCELP_OF(cbgain[3], 0, 4) // 3 +}; + +/** + * Bitmap unpacking tables for RATE_QUARTER + * + * TIA/EIA/IS-733 Table 2.4.7.3-1 + */ +static const QCELPBitmap qcelp_rate_quarter_bitmap[] = { + // start on bit + QCELP_OF(lspv [2], 0, 3), // 53 + QCELP_OF(lspv [1], 0, 7), // 50 + QCELP_OF(lspv [0], 0, 6), // 43 + QCELP_OF(lspv [4], 0, 6), // 37 + QCELP_OF(lspv [3], 0, 6), // 31 + QCELP_OF(lspv [2], 3, 4), // 25 + QCELP_OF(cbgain[3], 0, 4), // 21 + QCELP_OF(cbgain[2], 0, 4), // 17 + QCELP_OF(cbgain[1], 0, 4), // 13 + QCELP_OF(cbgain[0], 0, 4), // 9 + QCELP_OF(reserved, 0, 2), // 5 + QCELP_OF(cbgain[4], 0, 4) // 3 +}; + +/** + * Bitmap unpacking tables for RATE_OCTAVE + * + * trick: CBSEED is written into QCELPContext.cbsign[15], + * which is not used for RATE_OCTAVE. + * CBSEED is only used to ensure the occurrence of random bit + * patterns in the 16 first bits that are used as the seed. + * + * TIA/EIA/IS-733 Table 2.4.7.4-1 + */ +static const QCELPBitmap qcelp_rate_octave_bitmap[] = { + // start on bit + QCELP_OF(cbsign[15], 3, 1), // 19 + QCELP_OF(lspv [0], 0, 1), // 18 + QCELP_OF(lspv [1], 0, 1), // 17 + QCELP_OF(lspv [2], 0, 1), // 16 + QCELP_OF(cbsign[15], 2, 1), // 15 + QCELP_OF(lspv [3], 0, 1), // 14 + QCELP_OF(lspv [4], 0, 1), // 13 + QCELP_OF(lspv [5], 0, 1), // 12 + QCELP_OF(cbsign[15], 1, 1), // 11 + QCELP_OF(lspv [6], 0, 1), // 10 + QCELP_OF(lspv [7], 0, 1), // 9 + QCELP_OF(lspv [8], 0, 1), // 8 + QCELP_OF(cbsign[15], 0, 1), // 7 + QCELP_OF(lspv [9], 0, 1), // 6 + QCELP_OF(cbgain [0], 0, 2), // 5 + QCELP_OF(reserved, 0, 4) // 3 +}; + +/** + * Bitmapping data position for each packet type in + * the QCELPContext + */ +static const QCELPBitmap * const qcelp_unpacking_bitmaps_per_rate[5] = { + NULL, ///< for SILENCE rate + qcelp_rate_octave_bitmap, + qcelp_rate_quarter_bitmap, + qcelp_rate_half_bitmap, + qcelp_rate_full_bitmap, +}; + +static const uint16_t qcelp_unpacking_bitmaps_lengths[5] = { + 0, ///< for SILENCE rate + FF_ARRAY_ELEMS(qcelp_rate_octave_bitmap), + FF_ARRAY_ELEMS(qcelp_rate_quarter_bitmap), + FF_ARRAY_ELEMS(qcelp_rate_half_bitmap), + FF_ARRAY_ELEMS(qcelp_rate_full_bitmap), +}; + +typedef uint16_t qcelp_vector[2]; + +/** + * LSP vector quantization tables in x*10000 form + * + * TIA/EIA/IS-733 tables 2.4.3.2.6.3-1 through 2.4.3.2.6.3-5 + */ + +static const qcelp_vector qcelp_lspvq1[64]= { +{ 327, 118},{ 919, 111},{ 427, 440},{1327, 185}, +{ 469, 50},{1272, 91},{ 892, 59},{1771, 193}, +{ 222, 158},{1100, 127},{ 827, 55},{ 978, 791}, +{ 665, 47},{ 700,1401},{ 670, 859},{1913,1048}, +{ 471, 215},{1046, 125},{ 645, 298},{1599, 160}, +{ 593, 39},{1187, 462},{ 749, 341},{1520, 511}, +{ 290, 792},{ 909, 362},{ 753, 81},{1111,1058}, +{ 519, 253},{ 828, 839},{ 685, 541},{1421,1258}, +{ 386, 130},{ 962, 119},{ 542, 387},{1431, 185}, +{ 526, 51},{1175, 260},{ 831, 167},{1728, 510}, +{ 273, 437},{1172, 113},{ 771, 144},{1122, 751}, +{ 619, 119},{ 492,1276},{ 658, 695},{1882, 615}, +{ 415, 200},{1018, 88},{ 681, 339},{1436, 325}, +{ 555, 122},{1042, 485},{ 826, 345},{1374, 743}, +{ 383,1018},{1005, 358},{ 704, 86},{1301, 586}, +{ 597, 241},{ 832, 621},{ 555, 573},{1504, 839}}; + +static const qcelp_vector qcelp_lspvq2[128]= { +{ 255, 293},{ 904, 219},{ 151,1211},{1447, 498}, +{ 470, 253},{1559, 177},{1547, 994},{2394, 242}, +{ 91, 813},{ 857, 590},{ 934,1326},{1889, 282}, +{ 813, 472},{1057,1494},{ 450,3315},{2163,1895}, +{ 538, 532},{1399, 218},{ 146,1552},{1755, 626}, +{ 822, 202},{1299, 663},{ 706,1732},{2656, 401}, +{ 418, 745},{ 762,1038},{ 583,1748},{1746,1285}, +{ 527,1169},{1314, 830},{ 556,2116},{1073,2321}, +{ 297, 570},{ 981, 403},{ 468,1103},{1740, 243}, +{ 725, 179},{1255, 474},{1374,1362},{1922, 912}, +{ 285, 947},{ 930, 700},{ 593,1372},{1909, 576}, +{ 588, 916},{1110,1116},{ 224,2719},{1633,2220}, +{ 402, 520},{1061, 448},{ 402,1352},{1499, 775}, +{ 664, 589},{1081, 727},{ 801,2206},{2165,1157}, +{ 566, 802},{ 911,1116},{ 306,1703},{1792, 836}, +{ 655, 999},{1061,1038},{ 298,2089},{1110,1753}, +{ 361, 311},{ 970, 239},{ 265,1231},{1495, 573}, +{ 566, 262},{1569, 293},{1341,1144},{2271, 544}, +{ 214, 877},{ 847, 719},{ 794,1384},{2067, 274}, +{ 703, 688},{1099,1306},{ 391,2947},{2024,1670}, +{ 471, 525},{1245, 290},{ 264,1557},{1568, 807}, +{ 718, 399},{1193, 685},{ 883,1594},{2729, 764}, +{ 500, 754},{ 809,1108},{ 541,1648},{1523,1385}, +{ 614,1196},{1209, 847},{ 345,2242},{1442,1747}, +{ 199, 560},{1092, 194},{ 349,1253},{1653, 507}, +{ 625, 354},{1376, 431},{1187,1465},{2164, 872}, +{ 360, 974},{1008, 698},{ 704,1346},{2114, 452}, +{ 720, 816},{1240,1089},{ 439,2475},{1498,2040}, +{ 336, 718},{1213, 187},{ 451,1450},{1368, 885}, +{ 592, 578},{1131, 531},{ 861,1855},{1764,1500}, +{ 444, 970},{ 935, 903},{ 424,1687},{1633,1102}, +{ 793, 897},{1060, 897},{ 185,2011},{1205,1855}}; + +static const qcelp_vector qcelp_lspvq3[128]= { +{ 225, 283},{1296, 355},{ 543, 343},{2073, 274}, +{ 204,1099},{1562, 523},{1388, 161},{2784, 274}, +{ 112, 849},{1870, 175},{1189, 160},{1490,1088}, +{ 969,1115},{ 659,3322},{1158,1073},{3183,1363}, +{ 517, 223},{1740, 223},{ 704, 387},{2637, 234}, +{ 692,1005},{1287,1610},{ 952, 532},{2393, 646}, +{ 490, 552},{1619, 657},{ 845, 670},{1784,2280}, +{ 191,1775},{ 272,2868},{ 942, 952},{2628,1479}, +{ 278, 579},{1565, 218},{ 814, 180},{2379, 187}, +{ 276,1444},{1199,1223},{1200, 349},{3009, 307}, +{ 312, 844},{1898, 306},{ 863, 470},{1685,1241}, +{ 513,1727},{ 711,2233},{1085, 864},{3398, 527}, +{ 414, 440},{1356, 612},{ 964, 147},{2173, 738}, +{ 465,1292},{ 877,1749},{1104, 689},{2105,1311}, +{ 580, 864},{1895, 752},{ 652, 609},{1485,1699}, +{ 514,1400},{ 386,2131},{ 933, 798},{2473, 986}, +{ 334, 360},{1375, 398},{ 621, 276},{2183, 280}, +{ 311,1114},{1382, 807},{1284, 175},{2605, 636}, +{ 230, 816},{1739, 408},{1074, 176},{1619,1120}, +{ 784,1371},{ 448,3050},{1189, 880},{3039,1165}, +{ 424, 241},{1672, 186},{ 815, 333},{2432, 324}, +{ 584,1029},{1137,1546},{1015, 585},{2198, 995}, +{ 574, 581},{1746, 647},{ 733, 740},{1938,1737}, +{ 347,1710},{ 373,2429},{ 787,1061},{2439,1438}, +{ 185, 536},{1489, 178},{ 703, 216},{2178, 487}, +{ 154,1421},{1414, 994},{1103, 352},{3072, 473}, +{ 408, 819},{2055, 168},{ 998, 354},{1917,1140}, +{ 665,1799},{ 993,2213},{1234, 631},{3003, 762}, +{ 373, 620},{1518, 425},{ 913, 300},{1966, 836}, +{ 402,1185},{ 948,1385},{1121, 555},{1802,1509}, +{ 474, 886},{1888, 610},{ 739, 585},{1231,2379}, +{ 661,1335},{ 205,2211},{ 823, 822},{2480,1179}}; + +static const qcelp_vector qcelp_lspvq4[64]= { +{ 348, 311},{ 812,1145},{ 552, 461},{1826, 263}, +{ 601, 675},{1730, 172},{1523, 193},{2449, 277}, +{ 334, 668},{ 805,1441},{1319, 207},{1684, 910}, +{ 582,1318},{1403,1098},{ 979, 832},{2700,1359}, +{ 624, 228},{1292, 979},{ 800, 195},{2226, 285}, +{ 730, 862},{1537, 601},{1115, 509},{2720, 354}, +{ 218,1167},{1212,1538},{1074, 247},{1674,1710}, +{ 322,2142},{1263, 777},{ 981, 556},{2119,1710}, +{ 193, 596},{1035, 957},{ 694, 397},{1997, 253}, +{ 743, 603},{1584, 321},{1346, 346},{2221, 708}, +{ 451, 732},{1040,1415},{1184, 230},{1853, 919}, +{ 310,1661},{1625, 706},{ 856, 843},{2902, 702}, +{ 467, 348},{1108,1048},{ 859, 306},{1964, 463}, +{ 560,1013},{1425, 533},{1142, 634},{2391, 879}, +{ 397,1084},{1345,1700},{ 976, 248},{1887,1189}, +{ 644,2087},{1262, 603},{ 877, 550},{2203,1307}}; + +static const qcelp_vector qcelp_lspvq5[64]= { +{ 360, 222},{ 820,1097},{ 601, 319},{1656, 198}, +{ 604, 513},{1552, 141},{1391, 155},{2474, 261}, +{ 269, 785},{1463, 646},{1123, 191},{2015, 223}, +{ 785, 844},{1202,1011},{ 980, 807},{3014, 793}, +{ 570, 180},{1135,1382},{ 778, 256},{1901, 179}, +{ 807, 622},{1461, 458},{1231, 178},{2028, 821}, +{ 387, 927},{1496,1004},{ 888, 392},{2246, 341}, +{ 295,1462},{1156, 694},{1022, 473},{2226,1364}, +{ 210, 478},{1029,1020},{ 722, 181},{1730, 251}, +{ 730, 488},{1465, 293},{1303, 326},{2595, 387}, +{ 458, 584},{1569, 742},{1029, 173},{1910, 495}, +{ 605,1159},{1268, 719},{ 973, 646},{2872, 428}, +{ 443, 334},{ 835,1465},{ 912, 138},{1716, 442}, +{ 620, 778},{1316, 450},{1186, 335},{1446,1665}, +{ 486,1050},{1675,1019},{ 880, 278},{2214, 202}, +{ 539,1564},{1142, 533},{ 984, 391},{2130,1089}}; + +static const qcelp_vector * const qcelp_lspvq[5] = { + qcelp_lspvq1, + qcelp_lspvq2, + qcelp_lspvq3, + qcelp_lspvq4, + qcelp_lspvq5 +}; + +/** + * The final gain scalefactor before clipping into a usable output float + */ +#define QCELP_SCALE 8192. + +/** + * Table for computing Ga (decoded linear codebook gain magnitude) + * + * @note The table could fit in int16_t in x*8 form, but it seems + * to be slower on x86 + * + * TIA/EIA/IS-733 2.4.6.2.1-3 + */ + +static const float qcelp_g12ga[61] = { + 1.000/QCELP_SCALE, 1.125/QCELP_SCALE, 1.250/QCELP_SCALE, 1.375/QCELP_SCALE, + 1.625/QCELP_SCALE, 1.750/QCELP_SCALE, 2.000/QCELP_SCALE, 2.250/QCELP_SCALE, + 2.500/QCELP_SCALE, 2.875/QCELP_SCALE, 3.125/QCELP_SCALE, 3.500/QCELP_SCALE, + 4.000/QCELP_SCALE, 4.500/QCELP_SCALE, 5.000/QCELP_SCALE, 5.625/QCELP_SCALE, + 6.250/QCELP_SCALE, 7.125/QCELP_SCALE, 8.000/QCELP_SCALE, 8.875/QCELP_SCALE, + 10.000/QCELP_SCALE, 11.250/QCELP_SCALE, 12.625/QCELP_SCALE, 14.125/QCELP_SCALE, + 15.875/QCELP_SCALE, 17.750/QCELP_SCALE, 20.000/QCELP_SCALE, 22.375/QCELP_SCALE, + 25.125/QCELP_SCALE, 28.125/QCELP_SCALE, 31.625/QCELP_SCALE, 35.500/QCELP_SCALE, + 39.750/QCELP_SCALE, 44.625/QCELP_SCALE, 50.125/QCELP_SCALE, 56.250/QCELP_SCALE, + 63.125/QCELP_SCALE, 70.750/QCELP_SCALE, 79.375/QCELP_SCALE, 89.125/QCELP_SCALE, + 100.000/QCELP_SCALE, 112.250/QCELP_SCALE, 125.875/QCELP_SCALE, 141.250/QCELP_SCALE, + 158.500/QCELP_SCALE, 177.875/QCELP_SCALE, 199.500/QCELP_SCALE, 223.875/QCELP_SCALE, + 251.250/QCELP_SCALE, 281.875/QCELP_SCALE, 316.250/QCELP_SCALE, 354.875/QCELP_SCALE, + 398.125/QCELP_SCALE, 446.625/QCELP_SCALE, 501.125/QCELP_SCALE, 562.375/QCELP_SCALE, + 631.000/QCELP_SCALE, 708.000/QCELP_SCALE, 794.375/QCELP_SCALE, 891.250/QCELP_SCALE, + 1000.000/QCELP_SCALE}; + +/** + * Circular codebook for rate 1 frames in x*100 form + * + * TIA/EIA/IS-733 2.4.6.1-2 + */ +static const int16_t qcelp_rate_full_codebook[128] = { + 10, -65, -59, 12, 110, 34, -134, 157, + 104, -84, -34, -115, 23, -101, 3, 45, + -101, -16, -59, 28, -45, 134, -67, 22, + 61, -29, 226, -26, -55, -179, 157, -51, + -220, -93, -37, 60, 118, 74, -48, -95, + -181, 111, 36, -52, -215, 78, -112, 39, + -17, -47, -223, 19, 12, -98, -142, 130, + 54, -127, 21, -12, 39, -48, 12, 128, + 6, -167, 82, -102, -79, 55, -44, 48, + -20, -53, 8, -61, 11, -70, -157, -168, + 20, -56, -74, 78, 33, -63, -173, -2, + -75, -53, -146, 77, 66, -29, 9, -75, + 65, 119, -43, 76, 233, 98, 125, -156, + -27, 78, -9, 170, 176, 143, -148, -7, + 27, -136, 5, 27, 18, 139, 204, 7, + -184, -197, 52, -3, 78, -189, 8, -65 +}; +#define QCELP_RATE_FULL_CODEBOOK_RATIO .01 + +/** + * Circular codebook for rate 1/2 frames in x*2 form + * + * TIA/EIA/IS-733 2.4.6.1-1 + */ +static const int8_t qcelp_rate_half_codebook[128] = { + 0, -4, 0, -3, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, -3, -2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 5, + 0, 0, 0, 0, 0, 0, 4, 0, + 0, 3, 2, 0, 3, 4, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 3, 0, 0, + -3, 3, 0, 0, -2, 0, 3, 0, + 0, 0, 0, 0, 0, 0, -5, 0, + 0, 0, 0, 3, 0, 0, 0, 3, + 0, 0, 0, 0, 0, 0, 0, 4, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 3, 6, -3, -4, 0, -3, -3, + 3, -3, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 +}; +#define QCELP_RATE_HALF_CODEBOOK_RATIO 0.5 + +/** + * sqrt(1.887) is the maximum of the pseudorandom + * white sequence used to generate the scaled codebook + * vector for bitrate 1/4. + * + * TIA/EIA/IS-733 2.4.8.1.2 + */ +#define QCELP_SQRT1887 1.373681186 + +/** + * Table for impulse response of BPF used to filter + * the white excitation for bitrate 1/4 synthesis + * + * Only half the tables are needed because of symmetry. + * + * TIA/EIA/IS-733 2.4.8.1.2-1.1 + */ +static const double qcelp_rnd_fir_coefs[11] = { + -1.344519e-1, 1.735384e-2, -6.905826e-2, 2.434368e-2, + -8.210701e-2, 3.041388e-2, -9.251384e-2, 3.501983e-2, + -9.918777e-2, 3.749518e-2, 8.985137e-1 +}; + +/** + * This spread factor is used, for bitrate 1/8 and I_F_Q, + * to force LSP frequencies to be at least 80 Hz apart. + * + * TIA/EIA/IS-733 2.4.3.3.2 + */ +#define QCELP_LSP_SPREAD_FACTOR 0.02 + +/** + * Predictor coefficient for the conversion of LSP codes + * to LSP frequencies for 1/8 and I_F_Q + * + * TIA/EIA/IS-733 2.4.3.2.7-2 + */ +#define QCELP_LSP_OCTAVE_PREDICTOR 29.0/32 + +/** + * Initial coefficient to perform bandwidth expansion on LPC + * + * @note: 0.9883 looks like an approximation of 253/256. + * + * TIA/EIA/IS-733 2.4.3.3.6 6 + */ +#define QCELP_BANDWIDTH_EXPANSION_COEFF 0.9883 + +#endif /* AVCODEC_QCELPDATA_H */ diff --git a/include/libavcodec/qdm2_tablegen.h b/include/libavcodec/qdm2_tablegen.h new file mode 100644 index 0000000..6e174a7 --- /dev/null +++ b/include/libavcodec/qdm2_tablegen.h @@ -0,0 +1,156 @@ +/* + * Header file for hardcoded QDM2 tables + * + * Copyright (c) 2010 Reimar Döffinger + * + * 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_QDM2_TABLEGEN_H +#define AVCODEC_QDM2_TABLEGEN_H + +#include +#include +#include "libavutil/attributes.h" +#include "qdm2data.h" + +#define SOFTCLIP_THRESHOLD 27600 +#define HARDCLIP_THRESHOLD 35716 + +#if CONFIG_HARDCODED_TABLES +#define softclip_table_init() +#define rnd_table_init() +#define init_noise_samples() +#define qdm2_init_vlc() +#include "libavcodec/qdm2_tables.h" +#else +static uint16_t softclip_table[HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1]; +static float noise_table[4096 + 20]; +static uint8_t random_dequant_index[256][5]; +static uint8_t random_dequant_type24[128][3]; +static float noise_samples[128]; + +static av_cold void softclip_table_init(void) { + int i; + double dfl = SOFTCLIP_THRESHOLD - 32767; + float delta = 1.0 / -dfl; + for (i = 0; i < HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1; i++) + softclip_table[i] = SOFTCLIP_THRESHOLD - ((int)(sin((float)i * delta) * dfl) & 0x0000FFFF); +} + + +// random generated table +static av_cold void rnd_table_init(void) { + int i,j; + uint32_t ldw; + uint64_t random_seed = 0; + float delta = 1.0 / 16384.0; + for(i = 0; i < 4096 ;i++) { + random_seed = random_seed * 214013 + 2531011; + noise_table[i] = (delta * (float)(((int32_t)random_seed >> 16) & 0x00007FFF)- 1.0) * 1.3; + } + + for (i = 0; i < 256 ;i++) { + random_seed = 81; + ldw = i; + for (j = 0; j < 5 ;j++) { + random_dequant_index[i][j] = ldw / random_seed; + ldw %= random_seed; + random_seed /= 3; + } + } + for (i = 0; i < 128 ;i++) { + random_seed = 25; + ldw = i; + for (j = 0; j < 3 ;j++) { + random_dequant_type24[i][j] = ldw / random_seed; + ldw %= random_seed; + random_seed /= 5; + } + } +} + + +static av_cold void init_noise_samples(void) { + int i; + unsigned random_seed = 0; + float delta = 1.0 / 16384.0; + for (i = 0; i < 128;i++) { + random_seed = random_seed * 214013 + 2531011; + noise_samples[i] = (delta * (float)((random_seed >> 16) & 0x00007fff) - 1.0); + } +} + +static VLC vlc_tab_level; +static VLC vlc_tab_diff; +static VLC vlc_tab_run; +static VLC fft_level_exp_alt_vlc; +static VLC fft_level_exp_vlc; +static VLC fft_stereo_exp_vlc; +static VLC fft_stereo_phase_vlc; +static VLC vlc_tab_tone_level_idx_hi1; +static VLC vlc_tab_tone_level_idx_mid; +static VLC vlc_tab_tone_level_idx_hi2; +static VLC vlc_tab_type30; +static VLC vlc_tab_type34; +static VLC vlc_tab_fft_tone_offset[5]; + +static VLCElem qdm2_table[3838]; + +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[*offset]; + vlc->table_allocated = FF_ARRAY_ELEMS(qdm2_table) - *offset; + ff_vlc_init_from_lengths(vlc, nb_bits, nb_codes, + &tab[0][1], 2, &tab[0][0], 2, 1, + -1, VLC_INIT_STATIC_OVERLONG | VLC_INIT_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, &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, &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, &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, &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, &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], + &offset, tab); + tab += tab_fft_tone_offset_sizes[i]; + } +} + +#endif /* CONFIG_HARDCODED_TABLES */ + +#endif /* AVCODEC_QDM2_TABLEGEN_H */ diff --git a/include/libavcodec/qdm2data.h b/include/libavcodec/qdm2data.h new file mode 100644 index 0000000..713f584 --- /dev/null +++ b/include/libavcodec/qdm2data.h @@ -0,0 +1,461 @@ +/* + * QDM2 compatible decoder + * Copyright (c) 2003 Ewald Snel + * Copyright (c) 2005 Benjamin Larsson + * Copyright (c) 2005 Alex Beregszaszi + * Copyright (c) 2005 Roberto Togni + * + * 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 + */ + + /** + * @file + * Various QDM2 tables. + */ + +#ifndef AVCODEC_QDM2DATA_H +#define AVCODEC_QDM2DATA_H + +#include + +/** VLC TABLES **/ + +/* values in this table range from -1..23; adjust retrieved value by -1 */ +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 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 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 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 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 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 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 tab_type34[10][2] = { + { 1, 4 }, { 9, 5 }, { 0, 5 }, { 3, 3 }, { 7, 3 }, { 8, 3 }, { 2, 3 }, + { 4, 3 }, { 6, 3 }, { 5, 3 }, +}; + +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 }, + /* 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 }, + /* 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 }, + /* 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 }, + /* 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 }, + { 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 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 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[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[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] = { + { 1, 2 }, {-1, 0 }, {-1,-2 }, { 0, 0 } +}; + +static const int16_t fft_level_index_table[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, +}; + +static const uint8_t last_coeff[3] = { + 4, 7, 10 +}; + +static const uint8_t coeff_per_sb_for_avg[3][30] = { + { 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, + { 0, 1, 2, 2, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }, + { 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9 } +}; + +static const uint32_t dequant_table[3][10][30] = { + { { 256, 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, 256, 256, 205, 154, 102, 51, 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, 51, 102, 154, 205, 256, 238, 219, 201, 183, 165, 146, 128, 110, 91, 73, 55, 37, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 18, 37, 55, 73, 91, 110, 128, 146, 165, 183, 201, 219, 238, 256, 228, 199, 171, 142, 114, 85, 57, 28 }, + { 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, 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, 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 } }, + { { 256, 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, 256, 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, 256, 171, 85, 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, 85, 171, 256, 171, 85, 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, 85, 171, 256, 219, 183, 146, 110, 73, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 37, 73, 110, 146, 183, 219, 256, 228, 199, 171, 142, 114, 85, 57, 28, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 57, 85, 114, 142, 171, 199, 228, 256, 213, 171, 128, 85, 43 }, + { 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, 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 } }, + { { 256, 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, 256, 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, 256, 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, 256, 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, 256, 256, 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, 256, 171, 85, 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, 85, 171, 256, 192, 128, 64, 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, 64, 128, 192, 256, 205, 154, 102, 51, 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, 51, 102, 154, 205, 256, 213, 171, 128, 85, 43, 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, 43, 85, 128, 171, 213, 256, 213, 171, 128, 85, 43 } } +}; + +static const uint8_t coeff_per_sb_for_dequant[3][30] = { + { 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3 }, + { 0, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6 }, + { 0, 1, 2, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9 } +}; + +/* first index is subband, 2nd index is 0, 1 or 3 (2 is unused) */ +static const int8_t tone_level_idx_offset_table[30][4] = { + { -50, -50, 0, -50 }, + { -50, -50, 0, -50 }, + { -50, -9, 0, -19 }, + { -16, -6, 0, -12 }, + { -11, -4, 0, -8 }, + { -8, -3, 0, -6 }, + { -7, -3, 0, -5 }, + { -6, -2, 0, -4 }, + { -5, -2, 0, -3 }, + { -4, -1, 0, -3 }, + { -4, -1, 0, -2 }, + { -3, -1, 0, -2 }, + { -3, -1, 0, -2 }, + { -3, -1, 0, -2 }, + { -2, -1, 0, -1 }, + { -2, -1, 0, -1 }, + { -2, -1, 0, -1 }, + { -2, 0, 0, -1 }, + { -2, 0, 0, -1 }, + { -1, 0, 0, -1 }, + { -1, 0, 0, -1 }, + { -1, 0, 0, -1 }, + { -1, 0, 0, -1 }, + { -1, 0, 0, -1 }, + { -1, 0, 0, -1 }, + { -1, 0, 0, -1 }, + { -1, 0, 0, 0 }, + { -1, 0, 0, 0 }, + { -1, 0, 0, 0 }, + { -1, 0, 0, 0 } +}; + +/* all my samples have 1st index 0 or 1 */ +/* second index is subband, only indexes 0-29 seem to be used */ +static const int8_t coding_method_table[5][30] = { + { 34, 30, 24, 24, 16, 16, 16, 16, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 + }, + { 34, 30, 24, 24, 16, 16, 16, 16, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 + }, + { 34, 30, 30, 30, 24, 24, 16, 16, 16, 16, 16, 16, 10, 10, 10, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10 + }, + { 34, 34, 30, 30, 24, 24, 24, 24, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 10, 10, 10, 10, 10, 10, 10, 10 + }, + { 34, 34, 30, 30, 30, 30, 30, 30, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16 + }, +}; + +static const int vlc_stage3_values[60] = { + 0, 1, 2, 3, 4, 6, 8, 10, 12, 16, 20, 24, + 28, 36, 44, 52, 60, 76, 92, 108, 124, 156, 188, 220, + 252, 316, 380, 444, 508, 636, 764, 892, 1020, 1276, 1532, 1788, + 2044, 2556, 3068, 3580, 4092, 5116, 6140, 7164, 8188, 10236, 12284, 14332, + 16380, 20476, 24572, 28668, 32764, 40956, 49148, 57340, 65532, 81916, 98300,114684 +}; + +static const float fft_tone_sample_table[4][16][5] = { + { { .0100000000f,-.0037037037f,-.0020000000f,-.0069444444f,-.0018416207f }, + { .0416666667f, .0000000000f, .0000000000f,-.0208333333f,-.0123456791f }, + { .1250000000f, .0558035709f, .0330687836f,-.0164473690f,-.0097465888f }, + { .1562500000f, .0625000000f, .0370370370f,-.0062500000f,-.0037037037f }, + { .1996007860f, .0781250000f, .0462962948f, .0022727272f, .0013468013f }, + { .2000000000f, .0625000000f, .0370370373f, .0208333333f, .0074074073f }, + { .2127659619f, .0555555556f, .0329218097f, .0208333333f, .0123456791f }, + { .2173913121f, .0473484844f, .0280583613f, .0347222239f, .0205761325f }, + { .2173913121f, .0347222239f, .0205761325f, .0473484844f, .0280583613f }, + { .2127659619f, .0208333333f, .0123456791f, .0555555556f, .0329218097f }, + { .2000000000f, .0208333333f, .0074074073f, .0625000000f, .0370370370f }, + { .1996007860f, .0022727272f, .0013468013f, .0781250000f, .0462962948f }, + { .1562500000f,-.0062500000f,-.0037037037f, .0625000000f, .0370370370f }, + { .1250000000f,-.0164473690f,-.0097465888f, .0558035709f, .0330687836f }, + { .0416666667f,-.0208333333f,-.0123456791f, .0000000000f, .0000000000f }, + { .0100000000f,-.0069444444f,-.0018416207f,-.0037037037f,-.0020000000f } }, + + { { .0050000000f,-.0200000000f, .0125000000f,-.3030303030f, .0020000000f }, + { .1041666642f, .0400000000f,-.0250000000f, .0333333333f,-.0200000000f }, + { .1250000000f, .0100000000f, .0142857144f,-.0500000007f,-.0200000000f }, + { .1562500000f,-.0006250000f,-.00049382716f,-.000625000f,-.00049382716f }, + { .1562500000f,-.0006250000f,-.00049382716f,-.000625000f,-.00049382716f }, + { .1250000000f,-.0500000000f,-.0200000000f, .0100000000f, .0142857144f }, + { .1041666667f, .0333333333f,-.0200000000f, .0400000000f,-.0250000000f }, + { .0050000000f,-.3030303030f, .0020000001f,-.0200000000f, .0125000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f } }, + + { { .1428571492f, .1250000000f,-.0285714287f,-.0357142873f, .0208333333f }, + { .1818181818f, .0588235296f, .0333333333f, .0212765951f, .0100000000f }, + { .1818181818f, .0212765951f, .0100000000f, .0588235296f, .0333333333f }, + { .1428571492f,-.0357142873f, .0208333333f, .1250000000f,-.0285714287f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f } }, + + { { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f }, + { .0000000000f, .0000000000f, .0000000000f, .0000000000f, .0000000000f } } +}; + +static const float fft_tone_level_table[2][64] = { { +/* pow ~ (i > 46) ? 0 : (((((i & 1) ? 431 : 304) << (i >> 1))) / 1024.0); */ + 0.17677669f, 0.42677650f, 0.60355347f, 0.85355347f, + 1.20710683f, 1.68359375f, 2.37500000f, 3.36718750f, + 4.75000000f, 6.73437500f, 9.50000000f, 13.4687500f, + 19.0000000f, 26.9375000f, 38.0000000f, 53.8750000f, + 76.0000000f, 107.750000f, 152.000000f, 215.500000f, + 304.000000f, 431.000000f, 608.000000f, 862.000000f, + 1216.00000f, 1724.00000f, 2432.00000f, 3448.00000f, + 4864.00000f, 6896.00000f, 9728.00000f, 13792.0000f, + 19456.0000f, 27584.0000f, 38912.0000f, 55168.0000f, + 77824.0000f, 110336.000f, 155648.000f, 220672.000f, + 311296.000f, 441344.000f, 622592.000f, 882688.000f, + 1245184.00f, 1765376.00f, 2490368.00f, 0.00000000f, + 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f, + 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f, + 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f, + 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f, + }, { +/* pow = (i > 45) ? 0 : ((((i & 1) ? 431 : 304) << (i >> 1)) / 512.0); */ + 0.59375000f, 0.84179688f, 1.18750000f, 1.68359375f, + 2.37500000f, 3.36718750f, 4.75000000f, 6.73437500f, + 9.50000000f, 13.4687500f, 19.0000000f, 26.9375000f, + 38.0000000f, 53.8750000f, 76.0000000f, 107.750000f, + 152.000000f, 215.500000f, 304.000000f, 431.000000f, + 608.000000f, 862.000000f, 1216.00000f, 1724.00000f, + 2432.00000f, 3448.00000f, 4864.00000f, 6896.00000f, + 9728.00000f, 13792.0000f, 19456.0000f, 27584.0000f, + 38912.0000f, 55168.0000f, 77824.0000f, 110336.000f, + 155648.000f, 220672.000f, 311296.000f, 441344.000f, + 622592.000f, 882688.000f, 1245184.00f, 1765376.00f, + 2490368.00f, 3530752.00f, 0.00000000f, 0.00000000f, + 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f, + 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f, + 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f, + 0.00000000f, 0.00000000f, 0.00000000f, 0.00000000f +} }; + +static const float fft_tone_envelope_table[4][31] = { + { .009607375f, .038060248f, .084265202f, .146446645f, .222214907f, .308658302f, + .402454883f, .500000060f, .597545207f, .691341758f, .777785182f, .853553414f, + .915734828f, .961939812f, .990392685f, 1.00000000f, .990392625f, .961939752f, + .915734768f, .853553295f, .777785063f, .691341639f, .597545087f, .500000000f, + .402454853f, .308658272f, .222214878f, .146446615f, .084265172f, .038060218f, + .009607345f }, + { .038060248f, .146446645f, .308658302f, .500000060f, .691341758f, .853553414f, + .961939812f, 1.00000000f, .961939752f, .853553295f, .691341639f, .500000000f, + .308658272f, .146446615f, .038060218f, .000000000f, .000000000f, .000000000f, + .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, + .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, + .000000000f }, + { .146446645f, .500000060f, .853553414f, 1.00000000f, .853553295f, .500000000f, + .146446615f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, + .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, + .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, + .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, + .000000000f }, + { .500000060f, 1.00000000f, .500000000f, .000000000f, .000000000f, .000000000f, + .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, + .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, + .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, + .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, .000000000f, + .000000000f } +}; + +static const float sb_noise_attenuation[32] = { + 0.0f, 0.0f, 0.3f, 0.4f, 0.5f, 0.7f, 1.0f, 1.0f, + 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, + 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, + 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, +}; + +static const uint8_t fft_subpackets[32] = { + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0 +}; + +/* first index is joined_stereo, second index is 0 or 2 (1 is unused) */ +static const float dequant_1bit[2][3] = { + {-0.920000f, 0.000000f, 0.920000f }, + {-0.890000f, 0.000000f, 0.890000f } +}; + +static const float type30_dequant[8] = { + -1.0f,-0.625f,-0.291666656732559f,0.0f, + 0.25f,0.5f,0.75f,1.0f, +}; + +static const float type34_delta[10] = { // FIXME: covers 8 entries.. + -1.0f,-0.60947573184967f,-0.333333343267441f,-0.138071194291115f,0.0f, + 0.138071194291115f,0.333333343267441f,0.60947573184967f,1.0f,0.0f, +}; + +#endif /* AVCODEC_QDM2DATA_H */ diff --git a/include/libavcodec/qoi.h b/include/libavcodec/qoi.h new file mode 100644 index 0000000..3efab1e --- /dev/null +++ b/include/libavcodec/qoi.h @@ -0,0 +1,35 @@ +/* + * QOI image format + * + * 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_QOI_H +#define AVCODEC_QOI_H + +#define QOI_OP_INDEX 0x00 /* 00xxxxxx */ +#define QOI_OP_DIFF 0x40 /* 01xxxxxx */ +#define QOI_OP_LUMA 0x80 /* 10xxxxxx */ +#define QOI_OP_RUN 0xc0 /* 11xxxxxx */ +#define QOI_OP_RGB 0xfe /* 11111110 */ +#define QOI_OP_RGBA 0xff /* 11111111 */ + +#define QOI_MASK_2 0xc0 /* 11000000 */ + +#define QOI_COLOR_HASH(px) (px[0]*3 + px[1]*5 + px[2]*7 + px[3]*11) + +#endif /* AVCODEC_QOI_H */ diff --git a/include/libavcodec/qpeldsp.h b/include/libavcodec/qpeldsp.h new file mode 100644 index 0000000..91019ed --- /dev/null +++ b/include/libavcodec/qpeldsp.h @@ -0,0 +1,83 @@ +/* + * quarterpel DSP functions + * + * 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 + */ + +/** + * @file + * quarterpel DSP functions + */ + +#ifndef AVCODEC_QPELDSP_H +#define AVCODEC_QPELDSP_H + +#include +#include + +void ff_put_pixels8x8_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride); +void ff_avg_pixels8x8_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride); +void ff_put_pixels16x16_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride); +void ff_avg_pixels16x16_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride); + +void ff_put_pixels8_l2_8(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, + int dst_stride, int src_stride1, int src_stride2, + int h); + +#define DEF_OLD_QPEL(name) \ +void ff_put_ ## name(uint8_t *dst /* align width (8 or 16) */, \ + const uint8_t *src /* align 1 */, \ + ptrdiff_t stride); \ +void ff_put_no_rnd_ ## name(uint8_t *dst /* align width (8 or 16) */, \ + const uint8_t *src /* align 1 */, \ + ptrdiff_t stride); \ +void ff_avg_ ## name(uint8_t *dst /* align width (8 or 16) */, \ + const uint8_t *src /* align 1 */, \ + ptrdiff_t stride); + +DEF_OLD_QPEL(qpel16_mc11_old_c) +DEF_OLD_QPEL(qpel16_mc31_old_c) +DEF_OLD_QPEL(qpel16_mc12_old_c) +DEF_OLD_QPEL(qpel16_mc32_old_c) +DEF_OLD_QPEL(qpel16_mc13_old_c) +DEF_OLD_QPEL(qpel16_mc33_old_c) +DEF_OLD_QPEL(qpel8_mc11_old_c) +DEF_OLD_QPEL(qpel8_mc31_old_c) +DEF_OLD_QPEL(qpel8_mc12_old_c) +DEF_OLD_QPEL(qpel8_mc32_old_c) +DEF_OLD_QPEL(qpel8_mc13_old_c) +DEF_OLD_QPEL(qpel8_mc33_old_c) + +typedef void (*qpel_mc_func)(uint8_t *dst /* align width (8 or 16) */, + const uint8_t *src /* align 1 */, + ptrdiff_t stride); + +/** + * quarterpel DSP context + */ +typedef struct QpelDSPContext { + qpel_mc_func put_qpel_pixels_tab[2][16]; + qpel_mc_func avg_qpel_pixels_tab[2][16]; + qpel_mc_func put_no_rnd_qpel_pixels_tab[2][16]; +} QpelDSPContext; + +void ff_qpeldsp_init(QpelDSPContext *c); + +void ff_qpeldsp_init_x86(QpelDSPContext *c); +void ff_qpeldsp_init_mips(QpelDSPContext *c); + +#endif /* AVCODEC_QPELDSP_H */ diff --git a/include/libavcodec/qsv.h b/include/libavcodec/qsv.h index b77158e..c156b08 100755 --- a/include/libavcodec/qsv.h +++ b/include/libavcodec/qsv.h @@ -21,7 +21,7 @@ #ifndef AVCODEC_QSV_H #define AVCODEC_QSV_H -#include +#include #include "libavutil/buffer.h" @@ -61,6 +61,8 @@ typedef struct AVQSVContext { * required by the encoder and the user-provided value nb_opaque_surfaces. * The array of the opaque surfaces will be exported to the caller through * the opaque_surfaces field. + * + * The caller must set this field to zero for oneVPL (MFX_VERSION >= 2.0) */ int opaque_alloc; diff --git a/include/libavcodec/qsv_internal.h b/include/libavcodec/qsv_internal.h new file mode 100644 index 0000000..d970cd2 --- /dev/null +++ b/include/libavcodec/qsv_internal.h @@ -0,0 +1,167 @@ +/* + * Intel MediaSDK QSV encoder/decoder shared code + * + * 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_QSV_INTERNAL_H +#define AVCODEC_QSV_INTERNAL_H + +#include "config.h" + +#if CONFIG_VAAPI && !defined(_WIN32) // Do not enable for libva-win32 on Windows +#define AVCODEC_QSV_LINUX_SESSION_HANDLE +#endif //CONFIG_VAAPI && !defined(_WIN32) + +#ifdef AVCODEC_QSV_LINUX_SESSION_HANDLE +#include +#include +#if HAVE_UNISTD_H +#include +#endif +#include +#include +#include "libavutil/hwcontext_vaapi.h" +#endif + +#include + +#include "libavutil/frame.h" + +#include "avcodec.h" + +#define QSV_VERSION_MAJOR 1 +#define QSV_VERSION_MINOR 1 + +#define ASYNC_DEPTH_DEFAULT 4 // internal parallelism + +#define QSV_MAX_ENC_PAYLOAD 2 // # of mfxEncodeCtrl payloads supported +#define QSV_MAX_ENC_EXTPARAM 8 // # of mfxEncodeCtrl extparam supported + +#define QSV_MAX_ROI_NUM 256 + +#define QSV_MAX_FRAME_EXT_PARAMS 4 + +#define QSV_VERSION_ATLEAST(MAJOR, MINOR) \ + (MFX_VERSION_MAJOR > (MAJOR) || \ + MFX_VERSION_MAJOR == (MAJOR) && MFX_VERSION_MINOR >= (MINOR)) + +#define QSV_RUNTIME_VERSION_ATLEAST(MFX_VERSION, MAJOR, MINOR) \ + ((MFX_VERSION.Major > (MAJOR)) || \ + (MFX_VERSION.Major == (MAJOR) && MFX_VERSION.Minor >= (MINOR))) + +#define QSV_ONEVPL QSV_VERSION_ATLEAST(2, 0) +#define QSV_HAVE_OPAQUE !QSV_ONEVPL + +typedef struct QSVMid { + AVBufferRef *hw_frames_ref; + mfxHDLPair *handle_pair; + + AVFrame *locked_frame; + AVFrame *hw_frame; + mfxFrameSurface1 surf; +} QSVMid; + +typedef struct QSVFrame { + AVFrame *frame; + mfxFrameSurface1 surface; + mfxEncodeCtrl enc_ctrl; + mfxExtDecodedFrameInfo dec_info; +#if QSV_VERSION_ATLEAST(1, 34) + mfxExtAV1FilmGrainParam av1_film_grain_param; +#endif + +#if QSV_VERSION_ATLEAST(1, 35) + mfxExtMasteringDisplayColourVolume mdcv; + mfxExtContentLightLevelInfo clli; +#endif + + mfxExtBuffer *ext_param[QSV_MAX_FRAME_EXT_PARAMS]; + int num_ext_params; + + mfxPayload *payloads[QSV_MAX_ENC_PAYLOAD]; ///< used for enc_ctrl.Payload + mfxExtBuffer *extparam[QSV_MAX_ENC_EXTPARAM]; ///< used for enc_ctrl.ExtParam + + int queued; + int used; + + struct QSVFrame *next; +} QSVFrame; + +typedef struct QSVSession { + mfxSession session; +#ifdef AVCODEC_QSV_LINUX_SESSION_HANDLE + AVBufferRef *va_device_ref; + AVHWDeviceContext *va_device_ctx; +#endif + void *loader; +} QSVSession; + +typedef struct QSVFramesContext { + AVBufferRef *hw_frames_ctx; + void *logctx; + + /** + * The memory ids for the external frames. + * Refcounted (via the RefStruct API), since we need one reference + * owned by the QSVFramesContext (i.e. by the encoder/decoder) and + * another one given to the MFX session from the frame allocator. + */ + QSVMid *mids; + int nb_mids; +} QSVFramesContext; + +int ff_qsv_print_iopattern(void *log_ctx, int mfx_iopattern, + const char *extra_string); + +int ff_qsv_print_error(void *log_ctx, mfxStatus err, + const char *error_string); + +int ff_qsv_print_warning(void *log_ctx, mfxStatus err, + const char *warning_string); + +int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id); + +enum AVPixelFormat ff_qsv_map_fourcc(uint32_t fourcc); + +int ff_qsv_map_pixfmt(enum AVPixelFormat format, uint32_t *fourcc, uint16_t *shift); +enum AVPictureType ff_qsv_map_pictype(int mfx_pic_type); + +enum AVFieldOrder ff_qsv_map_picstruct(int mfx_pic_struct); + +int ff_qsv_init_internal_session(AVCodecContext *avctx, QSVSession *qs, + const char *load_plugins, int gpu_copy); + +int ff_qsv_close_internal_session(QSVSession *qs); + +int ff_qsv_init_session_device(AVCodecContext *avctx, mfxSession *psession, + AVBufferRef *device_ref, const char *load_plugins, + int gpu_copy); + +int ff_qsv_init_session_frames(AVCodecContext *avctx, mfxSession *session, + QSVFramesContext *qsv_frames_ctx, + const char *load_plugins, int opaque, int gpu_copy); + +int ff_qsv_find_surface_idx(QSVFramesContext *ctx, QSVFrame *frame); + +void ff_qsv_frame_add_ext_param(AVCodecContext *avctx, QSVFrame *frame, + mfxExtBuffer *param); + +int ff_qsv_map_frame_to_surface(const AVFrame *frame, mfxFrameSurface1 *surface); + + +#endif /* AVCODEC_QSV_INTERNAL_H */ diff --git a/include/libavcodec/qsvenc.h b/include/libavcodec/qsvenc.h new file mode 100644 index 0000000..4bc77f2 --- /dev/null +++ b/include/libavcodec/qsvenc.h @@ -0,0 +1,331 @@ +/* + * Intel MediaSDK QSV encoder utility functions + * + * copyright (c) 2013 Yukinori Yamazoe + * + * 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_QSVENC_H +#define AVCODEC_QSVENC_H + +#include +#include + +#include "libavutil/common.h" +#include "libavutil/hwcontext.h" +#include "libavutil/hwcontext_qsv.h" +#include "libavutil/avutil.h" +#include "libavutil/fifo.h" + +#include "avcodec.h" +#include "hwconfig.h" +#include "qsv_internal.h" + +#define QSV_HAVE_EXT_VP9_TILES QSV_VERSION_ATLEAST(1, 29) +#define QSV_HAVE_EXT_AV1_PARAM QSV_VERSION_ATLEAST(2, 5) + +#if defined(_WIN32) || defined(__CYGWIN__) +#define QSV_HAVE_AVBR 1 +#define QSV_HAVE_VCM 1 +#define QSV_HAVE_MF 0 +#define QSV_HAVE_HE QSV_VERSION_ATLEAST(2, 4) +#else +#define QSV_HAVE_AVBR 0 +#define QSV_HAVE_VCM 0 +#define QSV_HAVE_MF !QSV_ONEVPL +#define QSV_HAVE_HE 0 +#endif + +#define QSV_COMMON_OPTS \ +{ "async_depth", "Maximum processing parallelism", OFFSET(qsv.async_depth), AV_OPT_TYPE_INT, { .i64 = ASYNC_DEPTH_DEFAULT }, 1, INT_MAX, VE }, \ +{ "preset", NULL, OFFSET(qsv.preset), AV_OPT_TYPE_INT, { .i64 = MFX_TARGETUSAGE_UNKNOWN }, MFX_TARGETUSAGE_UNKNOWN, MFX_TARGETUSAGE_BEST_SPEED, VE, .unit = "preset" }, \ +{ "veryfast", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BEST_SPEED }, INT_MIN, INT_MAX, VE, .unit = "preset" }, \ +{ "faster", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_6 }, INT_MIN, INT_MAX, VE, .unit = "preset" }, \ +{ "fast", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_5 }, INT_MIN, INT_MAX, VE, .unit = "preset" }, \ +{ "medium", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BALANCED }, INT_MIN, INT_MAX, VE, .unit = "preset" }, \ +{ "slow", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_3 }, INT_MIN, INT_MAX, VE, .unit = "preset" }, \ +{ "slower", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_2 }, INT_MIN, INT_MAX, VE, .unit = "preset" }, \ +{ "veryslow", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_TARGETUSAGE_BEST_QUALITY }, INT_MIN, INT_MAX, VE, .unit = "preset" }, \ +{ "forced_idr", "Forcing I frames as IDR frames", OFFSET(qsv.forced_idr), AV_OPT_TYPE_BOOL,{ .i64 = 0 }, 0, 1, VE }, \ +{ "low_power", "enable low power mode(experimental: many limitations by mfx version, BRC modes, etc.)", OFFSET(qsv.low_power), AV_OPT_TYPE_BOOL, { .i64 = -1}, -1, 1, VE},\ +{ "qsv_params", "Set QSV encoder parameters as key1=value1:key2=value2:...", OFFSET(qsv.qsv_params), AV_OPT_TYPE_DICT, { 0 }, 0, 0, VE }, + +#if QSV_HAVE_HE +#define QSV_HE_OPTIONS \ +{ "dual_gfx", "Prefer processing on both iGfx and dGfx simultaneously", OFFSET(qsv.dual_gfx), AV_OPT_TYPE_INT, { .i64 = MFX_HYPERMODE_OFF }, MFX_HYPERMODE_OFF, MFX_HYPERMODE_ADAPTIVE, VE, .unit = "dual_gfx" }, \ +{ "off", "Disable HyperEncode mode", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_HYPERMODE_OFF }, INT_MIN, INT_MAX, VE, .unit = "dual_gfx" }, \ +{ "on", "Enable HyperEncode mode and return error if incompatible parameters during initialization", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_HYPERMODE_ON }, INT_MIN, INT_MAX, VE, .unit = "dual_gfx" }, \ +{ "adaptive", "Enable HyperEncode mode or fallback to single GPU if incompatible parameters during initialization", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_HYPERMODE_ADAPTIVE }, INT_MIN, INT_MAX, VE, .unit = "dual_gfx" }, +#endif + +#define QSV_OPTION_RDO \ +{ "rdo", "Enable rate distortion optimization", OFFSET(qsv.rdo), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, + +#define QSV_OPTION_MAX_FRAME_SIZE \ +{ "max_frame_size", "Maximum encoded frame size in bytes", OFFSET(qsv.max_frame_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, VE }, \ +{ "max_frame_size_i", "Maximum encoded I frame size in bytes",OFFSET(qsv.max_frame_size_i), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, VE }, \ +{ "max_frame_size_p", "Maximum encoded P frame size in bytes",OFFSET(qsv.max_frame_size_p), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, VE }, + +#define QSV_OPTION_MAX_SLICE_SIZE \ +{ "max_slice_size", "Maximum encoded slice size in bytes", OFFSET(qsv.max_slice_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, VE }, + +#define QSV_OPTION_BITRATE_LIMIT \ +{ "bitrate_limit", "Toggle bitrate limitations", OFFSET(qsv.bitrate_limit), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, + +#define QSV_OPTION_MBBRC \ +{ "mbbrc", "MB level bitrate control", OFFSET(qsv.mbbrc), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, + +#define QSV_OPTION_EXTBRC \ +{ "extbrc", "Extended bitrate control", OFFSET(qsv.extbrc), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, + +#define QSV_OPTION_ADAPTIVE_I \ +{ "adaptive_i", "Adaptive I-frame placement", OFFSET(qsv.adaptive_i), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, + +#define QSV_OPTION_ADAPTIVE_B \ +{ "adaptive_b", "Adaptive B-frame placement", OFFSET(qsv.adaptive_b), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, + +#define QSV_OPTION_P_STRATEGY \ +{ "p_strategy", "Enable P-pyramid: 0-default 1-simple 2-pyramid(bf need to be set to 0).", OFFSET(qsv.p_strategy), AV_OPT_TYPE_INT, { .i64 = 0}, 0, 2, VE }, + +#define QSV_OPTION_B_STRATEGY \ +{ "b_strategy", "Strategy to choose between I/P/B-frames", OFFSET(qsv.b_strategy), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VE }, + +#define QSV_OPTION_DBLK_IDC \ +{ "dblk_idc", "This option disable deblocking. It has value in range 0~2.", OFFSET(qsv.dblk_idc), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 2, VE}, + +#define QSV_OPTION_LOW_DELAY_BRC \ +{ "low_delay_brc", "Allow to strictly obey avg frame size", OFFSET(qsv.low_delay_brc), AV_OPT_TYPE_BOOL,{ .i64 = -1 }, -1, 1, VE }, + +#define QSV_OPTION_MAX_MIN_QP \ +{ "max_qp_i", "Maximum video quantizer scale for I frame", OFFSET(qsv.max_qp_i), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 51, VE}, \ +{ "min_qp_i", "Minimum video quantizer scale for I frame", OFFSET(qsv.min_qp_i), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 51, VE}, \ +{ "max_qp_p", "Maximum video quantizer scale for P frame", OFFSET(qsv.max_qp_p), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 51, VE}, \ +{ "min_qp_p", "Minimum video quantizer scale for P frame", OFFSET(qsv.min_qp_p), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 51, VE}, \ +{ "max_qp_b", "Maximum video quantizer scale for B frame", OFFSET(qsv.max_qp_b), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 51, VE}, \ +{ "min_qp_b", "Minimum video quantizer scale for B frame", OFFSET(qsv.min_qp_b), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 51, VE}, + +#define QSV_OPTION_SCENARIO \ +{ "scenario", "A hint to encoder about the scenario for the encoding session", OFFSET(qsv.scenario), AV_OPT_TYPE_INT, { .i64 = MFX_SCENARIO_UNKNOWN }, \ + MFX_SCENARIO_UNKNOWN, MFX_SCENARIO_REMOTE_GAMING, VE, .unit = "scenario" }, \ +{ "unknown", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCENARIO_UNKNOWN }, .flags = VE, .unit = "scenario" }, \ +{ "displayremoting", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCENARIO_DISPLAY_REMOTING }, .flags = VE, .unit = "scenario" }, \ +{ "videoconference", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCENARIO_VIDEO_CONFERENCE }, .flags = VE, .unit = "scenario" }, \ +{ "archive", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCENARIO_ARCHIVE }, .flags = VE, .unit = "scenario" }, \ +{ "livestreaming", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCENARIO_LIVE_STREAMING }, .flags = VE, .unit = "scenario" }, \ +{ "cameracapture", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCENARIO_CAMERA_CAPTURE }, .flags = VE, .unit = "scenario" }, \ +{ "videosurveillance", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCENARIO_VIDEO_SURVEILLANCE }, .flags = VE, .unit = "scenario" }, \ +{ "gamestreaming", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCENARIO_GAME_STREAMING }, .flags = VE, .unit = "scenario" }, \ +{ "remotegaming", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCENARIO_REMOTE_GAMING }, .flags = VE, .unit = "scenario" }, + +#define QSV_OPTION_AVBR \ +{ "avbr_accuracy", "Accuracy of the AVBR ratecontrol (unit of tenth of percent)", OFFSET(qsv.avbr_accuracy), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, UINT16_MAX, VE }, \ +{ "avbr_convergence", "Convergence of the AVBR ratecontrol (unit of 100 frames)", OFFSET(qsv.avbr_convergence), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, UINT16_MAX, VE }, + +#define QSV_OPTION_SKIP_FRAME \ +{ "skip_frame", "Allow frame skipping", OFFSET(qsv.skip_frame), AV_OPT_TYPE_INT, { .i64 = MFX_SKIPFRAME_NO_SKIP }, \ + MFX_SKIPFRAME_NO_SKIP, MFX_SKIPFRAME_BRC_ONLY, VE, .unit = "skip_frame" }, \ +{ "no_skip", "Frame skipping is disabled", \ + 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SKIPFRAME_NO_SKIP }, .flags = VE, .unit = "skip_frame" }, \ +{ "insert_dummy", "Encoder inserts into bitstream frame where all macroblocks are encoded as skipped", \ + 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SKIPFRAME_INSERT_DUMMY }, .flags = VE, .unit = "skip_frame" }, \ +{ "insert_nothing", "Encoder inserts nothing into bitstream", \ + 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SKIPFRAME_INSERT_NOTHING }, .flags = VE, .unit = "skip_frame" }, \ +{ "brc_only", "skip_frame metadata indicates the number of missed frames before the current frame", \ + 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SKIPFRAME_BRC_ONLY }, .flags = VE, .unit = "skip_frame" }, + +extern const AVCodecHWConfigInternal *const ff_qsv_enc_hw_configs[]; + +typedef int SetEncodeCtrlCB (AVCodecContext *avctx, + const AVFrame *frame, mfxEncodeCtrl* enc_ctrl); +typedef struct QSVEncContext { + AVCodecContext *avctx; + + QSVFrame *work_frames; + + mfxSession session; + QSVSession internal_qs; + + int packet_size; + int width_align; + int height_align; + + mfxVideoParam param; + mfxFrameAllocRequest req; + + mfxExtCodingOption extco; + mfxExtCodingOption2 extco2; + mfxExtCodingOption3 extco3; +#if QSV_HAVE_MF + mfxExtMultiFrameParam extmfp; + mfxExtMultiFrameControl extmfc; +#endif + mfxExtHEVCTiles exthevctiles; + mfxExtVP9Param extvp9param; +#if QSV_HAVE_EXT_AV1_PARAM + mfxExtAV1TileParam extav1tileparam; + mfxExtAV1BitstreamParam extav1bsparam; +#endif +#if QSV_HAVE_HE + mfxExtHyperModeParam exthypermodeparam; +#endif +#if QSV_HAVE_OPAQUE + mfxExtOpaqueSurfaceAlloc opaque_alloc; + mfxFrameSurface1 **opaque_surfaces; + AVBufferRef *opaque_alloc_buf; +#endif + + mfxExtVideoSignalInfo extvsi; + + mfxExtBuffer *extparam_internal[5 + (QSV_HAVE_MF * 2) + (QSV_HAVE_EXT_AV1_PARAM * 2) + QSV_HAVE_HE]; + int nb_extparam_internal; + + mfxExtBuffer **extparam_str; + int nb_extparam_str; + + mfxExtBuffer **extparam; + int nb_extparam; + + AVFifo *async_fifo; + + QSVFramesContext frames_ctx; + + mfxVersion ver; + + int hevc_vps; + + // options set by the caller + int async_depth; + int idr_interval; + int profile; + int tier; + int preset; + int avbr_accuracy; + int avbr_convergence; + int pic_timing_sei; + int look_ahead; + int look_ahead_depth; + int look_ahead_downsampling; + int vcm; + int rdo; + int max_frame_size; + int max_frame_size_i; + int max_frame_size_p; + int max_slice_size; + int dblk_idc; + int scenario; + + int tile_cols; + int tile_rows; + + int aud; + + int single_sei_nal_unit; + int max_dec_frame_buffering; + + int bitrate_limit; + int mbbrc; + int extbrc; + int adaptive_i; + int adaptive_b; + int b_strategy; + int p_strategy; + int cavlc; + + int int_ref_type; + int int_ref_cycle_size; + int int_ref_qp_delta; + int int_ref_cycle_dist; + int recovery_point_sei; + + int repeat_pps; + int low_power; + int gpb; + int transform_skip; + + int a53_cc; + +#if QSV_HAVE_MF + int mfmode; +#endif + char *load_plugins; + SetEncodeCtrlCB *set_encode_ctrl_cb; + int forced_idr; + int low_delay_brc; + + int co2_idx; + int co3_idx; + int exthevctiles_idx; + int exthypermodeparam_idx; + int vp9_idx; + + int max_qp_i; + int min_qp_i; + int max_qp_p; + int min_qp_p; + int max_qp_b; + int min_qp_b; + // These are used for qp reset + int old_global_quality; + float old_i_quant_factor; + float old_i_quant_offset; + float old_b_quant_factor; + float old_b_quant_offset; + // This is used for max_frame_size reset + int old_max_frame_size; + // This is used for gop reset + int old_gop_size; + // These are used for intra refresh reset + int old_int_ref_type; + int old_int_ref_cycle_size; + int old_int_ref_qp_delta; + int old_int_ref_cycle_dist; + // These are used for max/min qp reset; + int old_qmax; + int old_qmin; + int old_max_qp_i; + int old_min_qp_i; + int old_max_qp_p; + int old_min_qp_p; + int old_max_qp_b; + int old_min_qp_b; + // This is used for low_delay_brc reset + int old_low_delay_brc; + // This is used for framerate reset + AVRational old_framerate; + // These are used for bitrate control reset + int old_bit_rate; + int old_rc_buffer_size; + int old_rc_initial_buffer_occupancy; + int old_rc_max_rate; + // This is used for SEI Timing reset + int old_pic_timing_sei; + int skip_frame; + // This is used for Hyper Encode + int dual_gfx; + + AVDictionary *qsv_params; +} QSVEncContext; + +int ff_qsv_enc_init(AVCodecContext *avctx, QSVEncContext *q); + +int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q, + AVPacket *pkt, const AVFrame *frame, int *got_packet); + +int ff_qsv_enc_close(AVCodecContext *avctx, QSVEncContext *q); + +#endif /* AVCODEC_QSVENC_H */ diff --git a/include/libavcodec/ra144.h b/include/libavcodec/ra144.h new file mode 100644 index 0000000..82ef852 --- /dev/null +++ b/include/libavcodec/ra144.h @@ -0,0 +1,92 @@ +/* + * Real Audio 1.0 (14.4K) + * Copyright (c) 2003 The FFmpeg project + * + * 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_RA144_H +#define AVCODEC_RA144_H + +#include + +#include "libavutil/mem_internal.h" + +#include "lpc.h" +#include "audio_frame_queue.h" +#include "audiodsp.h" + +#define NBLOCKS 4 ///< number of subblocks within a block +#define BLOCKSIZE 40 ///< subblock size in 16-bit words +#define BUFFERSIZE 146 ///< the size of the adaptive codebook +#define FIXED_CB_SIZE 128 ///< size of fixed codebooks +#define FRAME_SIZE 20 ///< size of encoded frame +#define LPC_ORDER 10 ///< order of LPC filter + +typedef struct RA144Context { + AVCodecContext *avctx; + AudioDSPContext adsp; + LPCContext lpc_ctx; + AudioFrameQueue afq; + int last_frame; + + unsigned int old_energy; ///< previous frame energy + + unsigned int lpc_tables[2][10]; + + /** LPC coefficients: lpc_coef[0] is the coefficients of the current frame + * and lpc_coef[1] of the previous one. */ + unsigned int *lpc_coef[2]; + + unsigned int lpc_refl_rms[2]; + + int16_t curr_block[NBLOCKS * BLOCKSIZE]; + + /** The current subblock padded by the last 10 values of the previous one. */ + int16_t curr_sblock[50]; + + /** Adaptive codebook, its size is two units bigger to avoid a + * buffer overflow. */ + int16_t adapt_cb[146+2]; + + DECLARE_ALIGNED(16, int16_t, buffer_a)[FFALIGN(BLOCKSIZE,16)]; +} RA144Context; + +void ff_copy_and_dup(int16_t *target, const int16_t *source, int offset); +int ff_eval_refl(int *refl, const int16_t *coefs, AVCodecContext *avctx); +void ff_eval_coefs(int *coefs, const int *refl); +void ff_int_to_int16(int16_t *out, const int *inp); +int ff_t_sqrt(unsigned int x); +unsigned int ff_rms(const int *data); +int ff_interp(RA144Context *ractx, int16_t *out, int a, int copyold, + int energy); +unsigned int ff_rescale_rms(unsigned int rms, unsigned int energy); +int ff_irms(AudioDSPContext *adsp, const int16_t *data/*align 16*/); +void ff_subblock_synthesis(RA144Context *ractx, const int16_t *lpc_coefs, + int cba_idx, int cb1_idx, int cb2_idx, + int gval, int gain); + +extern const int16_t ff_gain_val_tab[256][3]; +extern const uint8_t ff_gain_exp_tab[256]; +extern const int8_t ff_cb1_vects[128][40]; +extern const int8_t ff_cb2_vects[128][40]; +extern const uint16_t ff_cb1_base[128]; +extern const uint16_t ff_cb2_base[128]; +extern const int16_t ff_energy_tab[32]; +extern const int16_t * const ff_lpc_refl_cb[10]; + +#endif /* AVCODEC_RA144_H */ diff --git a/include/libavcodec/ra288.h b/include/libavcodec/ra288.h new file mode 100644 index 0000000..e7b12c5 --- /dev/null +++ b/include/libavcodec/ra288.h @@ -0,0 +1,149 @@ +/* + * RealAudio 2.0 (28.8K) + * Copyright (c) 2003 The FFmpeg project + * + * 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_RA288_H +#define AVCODEC_RA288_H + +#include +#include "libavutil/macros.h" +#include "libavutil/mem_internal.h" + +static const float amptable[8]={ + 0.515625, 0.90234375, 1.57910156, 2.76342773, + -0.515625, -0.90234375, -1.57910156, -2.76342773 +}; + +static const int16_t codetable[128][5]={ + { 668, -2950, -1254, -1790, -2553}, { -5032, -4577, -1045, 2908, 3318}, + { -2819, -2677, -948, -2825, -4450}, { -6679, -340, 1482, -1276, 1262}, + { -562, -6757, 1281, 179, -1274}, { -2512, -7130, -4925, 6913, 2411}, + { -2478, -156, 4683, -3873, 0}, { -8208, 2140, -478, -2785, 533}, + { 1889, 2759, 1381, -6955, -5913}, { 5082, -2460, -5778, 1797, 568}, + { -2208, -3309, -4523, -6236, -7505}, { -2719, 4358, -2988, -1149, 2664}, + { 1259, 995, 2711, -2464,-10390}, { 1722, -7569, -2742, 2171, -2329}, + { 1032, 747, -858, -7946,-12843}, { 3106, 4856, -4193, -2541, 1035}, + { 1862, -960, -6628, 410, 5882}, { -2493, -2628, -4000, -60, 7202}, + { -2672, 1446, 1536, -3831, 1233}, { -5302, 6912, 1589, -4187, 3665}, + { -3456, -8170, -7709, 1384, 4698}, { -4699, -6209,-11176, 8104, 16830}, + { 930, 7004, 1269, -8977, 2567}, { 4649, 11804, 3441, -5657, 1199}, + { 2542, -183, -8859, -7976, 3230}, { -2872, -2011, -9713, -8385, 12983}, + { 3086, 2140, -3680, -9643, -2896}, { -7609, 6515, -2283, -2522, 6332}, + { -3333, -5620, -9130,-11131, 5543}, { -407, -6721,-17466, -2889, 11568}, + { 3692, 6796, -262,-10846, -1856}, { 7275, 13404, -2989,-10595, 4936}, + { 244, -2219, 2656, 3776, -5412}, { -4043, -5934, 2131, 863, -2866}, + { -3302, 1743, -2006, -128, -2052}, { -6361, 3342, -1583, -21, 1142}, + { -3837, -1831, 6397, 2545, -2848}, { -9332, -6528, 5309, 1986, -2245}, + { -4490, 748, 1935, -3027, -493}, { -9255, 5366, 3193, -4493, 1784}, + { 4784, -370, 1866, 1057, -1889}, { 7342, -2690, -2577, 676, -611}, + { -502, 2235, -1850, -1777, -2049}, { 1011, 3880, -2465, 2209, -152}, + { 2592, 2829, 5588, 2839, -7306}, { -3049, -4918, 5955, 9201, -4447}, + { 697, 3908, 5798, -4451, -4644}, { -2121, 5444, -2570, 321, -1202}, + { 2846, -2086, 3532, 566, -708}, { -4279, 950, 4980, 3749, 452}, + { -2484, 3502, 1719, -170, 238}, { -3435, 263, 2114, -2005, 2361}, + { -7338, -1208, 9347, -1216, -4013}, {-13498, -439, 8028, -4232, 361}, + { -3729, 5433, 2004, -4727, -1259}, { -3986, 7743, 8429, -3691, -987}, + { 5198, -423, 1150, -1281, 816}, { 7409, 4109, -3949, 2690, 30}, + { 1246, 3055, -35, -1370, -246}, { -1489, 5635, -678, -2627, 3170}, + { 4830, -4585, 2008, -1062, 799}, { -129, 717, 4594, 14937, 10706}, + { 417, 2759, 1850, -5057, -1153}, { -3887, 7361, -5768, 4285, 666}, + { 1443, -938, 20, -2119, -1697}, { -3712, -3402, -2212, 110, 2136}, + { -2952, 12, -1568, -3500, -1855}, { -1315, -1731, 1160, -558, 1709}, + { 88, -4569, 194, -454, -2957}, { -2839, -1666, -273, 2084, -155}, + { -189, -2376, 1663, -1040, -2449}, { -2842, -1369, 636, -248, -2677}, + { 1517, 79, -3013, -3669, -973}, { 1913, -2493, -5312, -749, 1271}, + { -2903, -3324, -3756, -3690, -1829}, { -2913, -1547, -2760, -1406, 1124}, + { 1844, -1834, 456, 706, -4272}, { 467, -4256, -1909, 1521, 1134}, + { -127, -994, -637, -1491, -6494}, { 873, -2045, -3828, -2792, -578}, + { 2311, -1817, 2632, -3052, 1968}, { 641, 1194, 1893, 4107, 6342}, + { -45, 1198, 2160, -1449, 2203}, { -2004, 1713, 3518, 2652, 4251}, + { 2936, -3968, 1280, 131, -1476}, { 2827, 8, -1928, 2658, 3513}, + { 3199, -816, 2687, -1741, -1407}, { 2948, 4029, 394, -253, 1298}, + { 4286, 51, -4507, -32, -659}, { 3903, 5646, -5588, -2592, 5707}, + { -606, 1234, -1607, -5187, 664}, { -525, 3620, -2192, -2527, 1707}, + { 4297, -3251, -2283, 812, -2264}, { 5765, 528, -3287, 1352, 1672}, + { 2735, 1241, -1103, -3273, -3407}, { 4033, 1648, -2965, -1174, 1444}, + { 74, 918, 1999, 915, -1026}, { -2496, -1605, 2034, 2950, 229}, + { -2168, 2037, 15, -1264, -208}, { -3552, 1530, 581, 1491, 962}, + { -2613, -2338, 3621, -1488, -2185}, { -1747, 81, 5538, 1432, -2257}, + { -1019, 867, 214, -2284, -1510}, { -1684, 2816, -229, 2551, -1389}, + { 2707, 504, 479, 2783, -1009}, { 2517, -1487, -1596, 621, 1929}, + { -148, 2206, -4288, 1292, -1401}, { -527, 1243, -2731, 1909, 1280}, + { 2149, -1501, 3688, 610, -4591}, { 3306, -3369, 1875, 3636, -1217}, + { 2574, 2513, 1449, -3074, -4979}, { 814, 1826, -2497, 4234, -4077}, + { 1664, -220, 3418, 1002, 1115}, { 781, 1658, 3919, 6130, 3140}, + { 1148, 4065, 1516, 815, 199}, { 1191, 2489, 2561, 2421, 2443}, + { 770, -5915, 5515, -368, -3199}, { 1190, 1047, 3742, 6927, -2089}, + { 292, 3099, 4308, -758, -2455}, { 523, 3921, 4044, 1386, 85}, + { 4367, 1006, -1252, -1466, -1383}, { 3852, 1579, -77, 2064, 868}, + { 5109, 2919, -202, 359, -509}, { 3650, 3206, 2303, 1693, 1296}, + { 2905, -3907, 229, -1196, -2332}, { 5977, -3585, 805, 3825, -3138}, + { 3746, -606, 53, -269, -3301}, { 606, 2018, -1316, 4064, 398} +}; + +DECLARE_ALIGNED(32, static const float, syn_window)[FFALIGN(111, 16)]={ + 0.576690972, 0.580838025, 0.585013986, 0.589219987, 0.59345597, 0.597723007, + 0.602020264, 0.606384277, 0.610748291, 0.615142822, 0.619598389, 0.624084473, + 0.628570557, 0.633117676, 0.637695313, 0.642272949, 0.646911621, 0.651580811, + 0.656280518, 0.66104126, 0.665802002, 0.670593262, 0.675445557, 0.680328369, + 0.685241699, 0.690185547, 0.695159912, 0.700164795, 0.705230713, 0.710327148, + 0.715454102, 0.720611572, 0.725830078, 0.731048584, 0.736328125, 0.741638184, + 0.747009277, 0.752380371, 0.7578125, 0.763305664, 0.768798828, 0.774353027, + 0.779937744, 0.785583496, 0.791229248, 0.796936035, 0.802703857, 0.808502197, + 0.814331055, 0.820220947, 0.826141357, 0.832092285, 0.838104248, 0.844146729, + 0.850250244, 0.856384277, 0.862548828, 0.868774414, 0.875061035, 0.881378174, + 0.88772583, 0.894134521, 0.900604248, 0.907104492, 0.913635254, 0.920227051, + 0.926879883, 0.933563232, 0.940307617, 0.94708252, 0.953918457, 0.96081543, + 0.96774292, 0.974731445, 0.981781006, 0.988861084, 0.994842529, 0.998565674, + 0.999969482, 0.99911499, 0.996002197, 0.990600586, 0.982910156, 0.973022461, + 0.960876465, 0.946533203, 0.930053711, 0.911437988, 0.89074707, 0.868041992, + 0.843322754, 0.816680908, 0.788208008, 0.757904053, 0.725891113, 0.692199707, + 0.656921387, 0.620178223, 0.582000732, 0.542480469, 0.501739502, 0.459838867, + 0.416900635, 0.373016357, 0.328277588, 0.282775879, 0.236663818, 0.189971924, + 0.142852783, 0.0954284668,0.0477600098 +}; + +DECLARE_ALIGNED(32, static const float, gain_window)[FFALIGN(38, 16)]={ + 0.505699992, 0.524200022, 0.54339999, 0.563300014, 0.583953857, 0.60534668, + 0.627502441, 0.650482178, 0.674316406, 0.699005127, 0.724578857, 0.75112915, + 0.778625488, 0.807128906, 0.836669922, 0.86730957, 0.899078369, 0.932006836, + 0.961486816, 0.982757568, 0.995635986, 1, 0.995819092, 0.983154297, + 0.96206665, 0.932769775, 0.895507813, 0.850585938, 0.798400879, 0.739379883, + 0.674072266, 0.602996826, 0.526763916, 0.446014404, 0.361480713, 0.273834229, + 0.183868408, 0.0923461914 +}; + +/** synthesis bandwidth broadening table */ +DECLARE_ALIGNED(32, static const float, syn_bw_tab)[FFALIGN(36, 16)] = { + 0.98828125, 0.976699829, 0.965254128, 0.953942537, 0.942763507, 0.931715488, + 0.920796931, 0.910006344, 0.899342179, 0.888803005, 0.878387332, 0.868093729, + 0.857920766, 0.847867012, 0.837931097, 0.828111589, 0.818407178, 0.808816493, + 0.799338162, 0.789970934, 0.780713439, 0.771564424, 0.762522638, 0.753586829, + 0.744755745, 0.736028135, 0.727402806, 0.718878567, 0.710454226, 0.702128589, + 0.693900526, 0.685768902, 0.677732527, 0.669790328, 0.66194123, 0.654184103 +}; + +/** gain bandwidth broadening table */ +DECLARE_ALIGNED(32, static const float, gain_bw_tab)[FFALIGN(10, 16)] = { + 0.90625, 0.821289063, 0.74432373, 0.674499512, 0.61126709, + 0.553955078, 0.50201416, 0.454956055, 0.41229248, 0.373657227 +}; + +#endif /* AVCODEC_RA288_H */ diff --git a/include/libavcodec/ralfdata.h b/include/libavcodec/ralfdata.h new file mode 100644 index 0000000..9a84e45 --- /dev/null +++ b/include/libavcodec/ralfdata.h @@ -0,0 +1,9920 @@ +/* + * RealAudio Lossless decoder + * + * Copyright (c) 2012 Konstantin Shishkov + * + * 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_RALFDATA_H +#define AVCODEC_RALFDATA_H + +#include + +#define FILTERPARAM_ELEMENTS 643 +#define BIAS_ELEMENTS 255 +#define CODING_MODE_ELEMENTS 140 +#define FILTER_COEFFS_ELEMENTS 43 +#define SHORT_CODES_ELEMENTS 169 +#define LONG_CODES_ELEMENTS 441 + +static const uint8_t filter_param_def[3][324] = { + { + 0x48, 0x86, 0x66, 0x8A, 0xBB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB4, 0x54, 0x45, + 0x66, 0x88, 0xAA, 0xAB, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x65, 0x45, 0x55, 0x66, 0x77, 0x78, + 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0xBC, 0xCB, 0xBF, 0xFF, 0xCF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xF9, 0x86, 0x55, 0x55, 0x55, 0x66, 0x67, 0x77, 0x88, 0x88, 0x99, + 0x99, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0x9B, 0xBB, 0xCB, 0xBB, 0xCC, 0xCC, + 0xCF, 0xFF, 0xCC, 0xCF, 0xFC, 0xBC, 0xCC, 0xFB, 0xB9, 0xFC, 0xA8, 0x76, + 0x66, 0x56, 0x66, 0x67, 0x67, 0x77, 0x78, 0x88, 0x88, 0x89, 0x88, 0x89, + 0x99, 0x99, 0x9A, 0x9A, 0x9A, 0x9A, 0xAA, 0xAA, 0xAA, 0xAA, 0x9A, 0xA9, + 0xAB, 0xA9, 0xA9, 0x98, 0x86, 0xFF, 0xCA, 0x88, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x88, 0x88, 0x88, 0x88, 0x99, 0x99, 0x99, 0x98, 0x99, 0x99, 0x9A, + 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x98, 0x88, 0x87, + 0x65, 0xFF, 0xFB, 0xAA, 0xA9, 0x88, 0x88, 0x89, 0x99, 0x98, 0x99, 0x9A, + 0xA9, 0x9A, 0xA9, 0xAA, 0xA9, 0x9A, 0xAA, 0xA9, 0xAA, 0xA9, 0x99, 0x99, + 0xA9, 0x9A, 0x99, 0x99, 0x99, 0x98, 0x88, 0x77, 0x64, 0xFF, 0xFF, 0xFC, + 0xBB, 0xBA, 0xB9, 0xAA, 0xAB, 0xAA, 0xAA, 0xBA, 0xAB, 0xAB, 0xAB, 0xCB, + 0xBA, 0xAB, 0xBB, 0xBB, 0xAA, 0xBA, 0xAA, 0xAA, 0xAA, 0xA9, 0xAA, 0x99, + 0x99, 0x99, 0x88, 0x87, 0x64, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0xBB, 0xBB, + 0xBB, 0xBB, 0xBB, 0xCB, 0xBB, 0xBC, 0xBB, 0xCC, 0xFB, 0xCC, 0xCF, 0xCF, + 0xCC, 0xFC, 0xFC, 0xCF, 0xCB, 0xCC, 0xBB, 0xBB, 0xCB, 0xBB, 0xAA, 0x99, + 0x86, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xB8, 0xA0, 0x00, 0x00, + }, { + 0xFB, 0x95, 0x67, 0x8B, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0x55, 0x56, + 0x77, 0x89, 0xBA, 0xBB, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB8, 0x65, 0x55, 0x55, 0x56, 0x77, 0x78, + 0x89, 0x9A, 0xAA, 0xAA, 0xBC, 0xBC, 0xCB, 0xBC, 0xCF, 0xCF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFB, 0x86, 0x55, 0x55, 0x55, 0x55, 0x56, 0x67, 0x77, 0x77, 0x88, + 0x89, 0x9A, 0x99, 0x99, 0xAA, 0xBB, 0xBB, 0xAB, 0xBF, 0xCB, 0xFA, 0xCC, + 0xFC, 0xEC, 0xEF, 0xFB, 0xBC, 0xFF, 0xBC, 0xBB, 0xA9, 0xFF, 0x98, 0x76, + 0x66, 0x66, 0x65, 0x66, 0x66, 0x76, 0x77, 0x77, 0x77, 0x88, 0x88, 0x88, + 0x89, 0x99, 0x99, 0x99, 0x99, 0xA9, 0x99, 0x99, 0x9A, 0x99, 0x99, 0xAA, + 0xAA, 0xA9, 0x99, 0x98, 0x76, 0xFF, 0xF9, 0x87, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x99, 0x99, 0x89, 0x99, + 0x99, 0x99, 0x99, 0x89, 0x99, 0x99, 0x99, 0x98, 0x99, 0x98, 0x77, 0x77, + 0x65, 0xFF, 0xCA, 0xA9, 0x99, 0x89, 0x88, 0x88, 0x98, 0x89, 0x99, 0x98, + 0x99, 0x99, 0x99, 0x99, 0x9A, 0x99, 0x99, 0xA9, 0x9A, 0xA9, 0x99, 0x99, + 0x99, 0x99, 0xA9, 0x99, 0x99, 0x98, 0x88, 0x77, 0x64, 0xFF, 0xCB, 0xA9, + 0xA9, 0xAA, 0xAA, 0xAA, 0x9A, 0xAB, 0xAA, 0x9A, 0xBB, 0xAB, 0xAB, 0xBB, + 0xAB, 0xBA, 0xBB, 0xBA, 0xAA, 0xBA, 0xBA, 0xAA, 0xAA, 0xA9, 0xA9, 0x99, + 0x99, 0x99, 0x88, 0x77, 0x64, 0xFF, 0xFF, 0xFF, 0xBC, 0xFB, 0xCB, 0xBB, + 0xBB, 0xBB, 0xBA, 0xBA, 0xAB, 0xBF, 0xCB, 0xBB, 0xBB, 0xBC, 0xBF, 0xCC, + 0xCB, 0xCB, 0xCC, 0xBB, 0xBB, 0xFB, 0xCB, 0xBC, 0xCA, 0xBC, 0xAA, 0xA9, + 0x86, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFC, 0xFF, 0xFF, 0xCF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xF0, 0x00, 0x00, + }, { + 0x9B, 0x65, 0x67, 0xAB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB5, 0x54, 0x56, + 0x67, 0x88, 0xA9, 0xAB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xA8, 0x65, 0x44, 0x45, 0x56, 0x67, 0x78, + 0x89, 0x99, 0xA9, 0xAA, 0xBB, 0xBB, 0xAB, 0xBC, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xF9, 0x76, 0x55, 0x54, 0x55, 0x55, 0x56, 0x67, 0x77, 0x77, 0x88, + 0x89, 0x99, 0x98, 0x99, 0x8A, 0x99, 0xBB, 0xAB, 0xBC, 0xAB, 0xBA, 0xAA, + 0xBB, 0xCB, 0xCC, 0xBB, 0xCC, 0xBB, 0xAC, 0xBA, 0x97, 0xFB, 0x97, 0x76, + 0x66, 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x88, 0x88, 0x88, 0x88, + 0x99, 0x89, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x9A, 0x98, 0x99, 0x99, + 0xA9, 0x99, 0x88, 0x87, 0x65, 0xFF, 0xCA, 0x98, 0x87, 0x77, 0x77, 0x87, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, + 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x88, 0x87, 0x77, + 0x64, 0xFF, 0xFC, 0xCA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0x99, 0xAA, 0x9A, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0x99, 0x99, 0x99, 0x89, 0x88, 0x87, 0x64, 0xFF, 0xFF, 0xFB, + 0xFF, 0xBC, 0xFC, 0xBB, 0xCB, 0xBB, 0xCA, 0xCB, 0xBC, 0xCC, 0xBF, 0xBC, + 0xBB, 0xBB, 0xBE, 0xBC, 0xCB, 0xCC, 0xBB, 0xFC, 0xBC, 0xCC, 0xAB, 0xCB, + 0xAB, 0xBB, 0xAA, 0xA9, 0x97, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0xCF, 0xFB, + 0xCC, 0xFC, 0xCF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + } +}; + +static const uint8_t bias_def[3][128] = { + { + 0x4A, 0xAA, 0xAA, 0xAA, 0xBA, 0xBA, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x9A, 0xA9, 0xA9, + 0x99, 0xA9, 0x99, 0x99, 0xA9, 0xA9, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, + 0x99, 0x99, 0x88, 0x98, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x77, 0x78, 0x77, 0x77, 0x77, 0x77, 0x66, 0x66, 0x66, 0x55, 0x55, 0x55, + 0x55, 0x54, 0x44, 0x32, 0x44, 0x55, 0x55, 0x66, 0x66, 0x66, 0x66, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x87, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x89, 0x88, 0x89, 0x89, 0x99, 0x99, 0x98, 0x99, 0x9A, + 0x99, 0x99, 0x99, 0x99, 0x9A, 0xA9, 0x9A, 0x99, 0x9A, 0xA9, 0xA9, 0xA9, + 0xAA, 0xAA, 0xA9, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xAA, 0xAA, 0xAA, + 0xAA, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBA, 0x40, + }, { + 0x4C, 0xBC, 0xAC, 0xBC, 0xBA, 0xAB, 0xAB, 0xBB, 0xBA, 0xAA, 0xAB, 0xAA, + 0xBB, 0xAA, 0xBB, 0xAA, 0xAB, 0xBA, 0xBA, 0xAA, 0xBB, 0xAA, 0xA9, 0xAA, + 0xBB, 0xAA, 0xAA, 0x9A, 0x9A, 0xAA, 0xA9, 0xAA, 0x99, 0x99, 0x99, 0x99, + 0x99, 0x99, 0x99, 0x99, 0x98, 0x98, 0x98, 0x89, 0x88, 0x88, 0x88, 0x88, + 0x87, 0x78, 0x77, 0x77, 0x77, 0x77, 0x67, 0x66, 0x66, 0x55, 0x44, 0x45, + 0x54, 0x44, 0x44, 0x33, 0x44, 0x45, 0x55, 0x56, 0x66, 0x66, 0x66, 0x67, + 0x77, 0x77, 0x77, 0x77, 0x87, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x99, 0x88, 0x99, 0x99, 0x89, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0xA9, + 0xA9, 0xAA, 0x9A, 0xA9, 0xAA, 0x9A, 0xAA, 0x9A, 0xAA, 0xAB, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xBB, 0xBA, 0xAA, 0xAB, 0xAB, 0xAA, + 0xAB, 0xAB, 0xAC, 0xBB, 0xAA, 0xBB, 0xBB, 0x40, + }, { + 0x5B, 0xBB, 0xBC, 0xBB, 0xCB, 0xCC, 0xBB, 0xBB, 0xBC, 0xCC, 0xBB, 0xCB, + 0xBA, 0xCB, 0xBC, 0xBB, 0xAA, 0xBB, 0xAB, 0xBA, 0xBB, 0xBB, 0xAB, 0xBB, + 0xAA, 0xBA, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA9, 0x9A, + 0x9A, 0x99, 0x9A, 0x99, 0x99, 0x99, 0x99, 0x99, 0x98, 0x98, 0x89, 0x99, + 0x88, 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x66, 0x66, 0x55, + 0x54, 0x44, 0x43, 0x22, 0x34, 0x44, 0x55, 0x56, 0x66, 0x66, 0x67, 0x77, + 0x77, 0x77, 0x87, 0x88, 0x88, 0x88, 0x88, 0x88, 0x99, 0x89, 0x99, 0x99, + 0x99, 0x99, 0x99, 0x9A, 0x9A, 0xA9, 0xA9, 0x9A, 0x9A, 0xAA, 0x9A, 0xAA, + 0xAA, 0xAA, 0xBA, 0xAA, 0xAA, 0xAA, 0xBA, 0xAA, 0xAA, 0xAB, 0xBA, 0xBB, + 0xAA, 0xBB, 0xAB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBC, + 0xBB, 0xBC, 0xBB, 0xBB, 0xCC, 0xBC, 0xCB, 0x50, + } +}; + +static const uint8_t coding_mode_def[3][72] = { + { + 0xAA, 0x99, 0xAC, 0xB9, 0xBD, 0xAA, 0x7A, 0xA8, 0xA8, 0xA8, 0x79, 0x79, + 0x77, 0xA8, 0x97, 0x79, 0x89, 0x77, 0x87, 0x87, 0x68, 0x78, 0x66, 0x86, + 0x87, 0x67, 0x68, 0x66, 0x76, 0x76, 0x57, 0x67, 0x55, 0x75, 0x65, 0x56, + 0x56, 0x55, 0x65, 0x65, 0x56, 0x45, 0x55, 0x54, 0x55, 0x55, 0x45, 0x55, + 0x54, 0x55, 0x55, 0x45, 0x56, 0x64, 0x66, 0x76, 0x57, 0x67, 0x77, 0x77, + 0x98, 0x88, 0x9D, 0xBF, 0xBA, 0xEC, 0xFC, 0xBA, 0xEF, 0xFC, 0x00, 0x00, + }, { + 0xCF, 0x9B, 0xAF, 0xFF, 0xFF, 0xAB, 0x8A, 0x98, 0xB8, 0xF9, 0x78, 0x89, + 0x77, 0xF9, 0xF7, 0x79, 0x89, 0x77, 0x97, 0x97, 0x68, 0x68, 0x66, 0xA6, + 0x87, 0x77, 0x68, 0x66, 0x75, 0x76, 0x67, 0x56, 0x65, 0x75, 0x75, 0x56, + 0x56, 0x55, 0x65, 0x65, 0x56, 0x56, 0x55, 0x54, 0x55, 0x55, 0x45, 0x55, + 0x53, 0x55, 0x65, 0x35, 0x67, 0x64, 0x66, 0x66, 0x56, 0x78, 0x86, 0x88, + 0xA8, 0xFB, 0xAF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, + }, { + 0xDC, 0xAD, 0xCC, 0xCA, 0xCF, 0xFE, 0xDF, 0xFF, 0xE9, 0xFF, 0x99, 0x79, + 0x97, 0x97, 0x97, 0x79, 0x79, 0x77, 0x97, 0x97, 0x79, 0x79, 0x77, 0x86, + 0x87, 0x68, 0x68, 0x76, 0x76, 0x76, 0x67, 0x57, 0x66, 0x65, 0x76, 0x66, + 0x56, 0x55, 0x64, 0x65, 0x55, 0x45, 0x55, 0x54, 0x55, 0x55, 0x35, 0x55, + 0x53, 0x55, 0x65, 0x35, 0x67, 0x64, 0x67, 0x87, 0x57, 0x8A, 0x86, 0x8B, + 0xBA, 0x9A, 0xCD, 0xAA, 0xAF, 0xFC, 0xFF, 0xFF, 0xDF, 0xFF, 0x00, 0x00, + } +}; + +static const uint8_t filter_coeffs_def[3][10][11][24] = { + { + { + { + 0x47, 0x88, 0x76, 0x52, 0x12, 0x35, 0x44, 0x43, 0x34, 0x45, 0x77, 0x67, + 0x66, 0x87, 0x87, 0x7D, 0x8A, 0x89, 0x9D, 0xDD, 0x9C, 0xC0, 0x00, 0x00, + }, + { + 0x7C, 0xCC, 0xC7, 0x65, 0xCC, 0x22, 0x23, 0x46, 0x32, 0x22, 0x46, 0x7B, + 0xB6, 0xBB, 0xBB, 0xBC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xC0, 0x00, 0x00, + }, + { + 0xBB, 0xBB, 0xB4, 0x43, 0x25, 0x5B, 0x5A, 0xAB, 0x5B, 0x22, 0x22, 0x2B, + 0xBA, 0xAA, 0x46, 0x5B, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xB0, 0x00, 0x00, + }, + { + 0x99, 0x89, 0x88, 0x89, 0x31, 0x88, 0x88, 0x89, 0x88, 0x38, 0x88, 0x13, + 0x28, 0x88, 0x88, 0x28, 0x88, 0x88, 0x88, 0x88, 0x99, 0x90, 0x00, 0x00, + }, + { + 0x99, 0x89, 0x88, 0x89, 0x88, 0x88, 0x88, 0x39, 0x98, 0x88, 0x88, 0x88, + 0x08, 0x88, 0x88, 0x81, 0x99, 0x88, 0x99, 0x99, 0x99, 0x20, 0x00, 0x00, + }, + { + 0xAA, 0xD9, 0x86, 0xCD, 0xDD, 0xDD, 0x98, 0x76, 0x43, 0x65, 0x35, 0x63, + 0x23, 0x44, 0x33, 0x24, 0x45, 0x44, 0x45, 0x59, 0xA8, 0x90, 0x00, 0x00, + }, + { + 0x99, 0x89, 0x88, 0x89, 0x98, 0x88, 0x88, 0x89, 0x98, 0x08, 0x88, 0x88, + 0x28, 0x88, 0x88, 0x83, 0x19, 0x98, 0x88, 0x99, 0x99, 0x90, 0x00, 0x00, + }, + { + 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA5, 0xA4, 0x01, 0x4A, 0xAA, + 0x53, 0x4A, 0xA4, 0xAA, 0x5A, 0xAA, 0xAA, 0xAA, 0xAA, 0xB0, 0x00, 0x00, + }, + { + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x9A, 0xAA, 0xA3, 0x31, 0x31, + 0x34, 0x34, 0xA9, 0xA5, 0x44, 0x4A, 0xAA, 0xAA, 0xAA, 0xA0, 0x00, 0x00, + }, + { + 0xEE, 0xDE, 0xED, 0xDE, 0xEE, 0xED, 0xDD, 0xDE, 0xE8, 0xEE, 0xE7, 0x64, + 0x47, 0x43, 0x30, 0x43, 0x43, 0x36, 0x7E, 0xEE, 0xEE, 0x90, 0x00, 0x00, + }, + { + 0x67, 0x87, 0x87, 0x66, 0x65, 0x55, 0x44, 0x45, 0x65, 0x54, 0x54, 0x32, + 0x34, 0x66, 0x63, 0x55, 0x44, 0x54, 0x34, 0x45, 0x56, 0x60, 0x00, 0x00, + }, + }, + { + { + 0x56, 0x66, 0x65, 0x54, 0x33, 0x34, 0x33, 0x33, 0x33, 0x34, 0x44, 0x45, + 0x56, 0x66, 0x67, 0x77, 0x77, 0x77, 0x78, 0x89, 0x89, 0x60, 0x00, 0x00, + }, + { + 0x78, 0x89, 0x98, 0x65, 0x65, 0x32, 0x22, 0x32, 0x33, 0x33, 0x45, 0x77, + 0x77, 0x8B, 0x9A, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEE, 0xF0, 0x00, 0x00, + }, + { + 0x9D, 0xD8, 0x8D, 0x57, 0x56, 0x55, 0x44, 0x45, 0x22, 0x22, 0x23, 0x34, + 0x57, 0x78, 0x88, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD0, 0x00, 0x00, + }, + { + 0xDC, 0xCC, 0x8C, 0xCC, 0x87, 0x65, 0x55, 0x54, 0x23, 0x44, 0x21, 0x23, + 0x46, 0x56, 0x87, 0x7C, 0x8C, 0x8C, 0xCC, 0xCC, 0xCC, 0xD0, 0x00, 0x00, + }, + { + 0xDD, 0xCD, 0xCC, 0xCD, 0xDC, 0xC7, 0x64, 0x58, 0x31, 0x25, 0x33, 0x22, + 0x44, 0x56, 0x66, 0x6D, 0xDD, 0xDD, 0xDC, 0xDC, 0xDC, 0xD0, 0x00, 0x00, + }, + { + 0xB9, 0x99, 0xA6, 0x67, 0x78, 0x76, 0x78, 0x88, 0x66, 0x55, 0x44, 0x43, + 0x23, 0x33, 0x33, 0x33, 0x34, 0x45, 0x56, 0x66, 0x88, 0xB0, 0x00, 0x00, + }, + { + 0xDD, 0xCD, 0xDC, 0xCD, 0xDC, 0xCC, 0x77, 0xC5, 0x53, 0x12, 0x23, 0x33, + 0x33, 0x46, 0x65, 0x75, 0x8D, 0xDD, 0xDD, 0xDC, 0xDC, 0xD0, 0x00, 0x00, + }, + { + 0xDD, 0xCD, 0xCC, 0xCD, 0xDC, 0xCC, 0x8C, 0x85, 0x55, 0x33, 0x21, 0x23, + 0x33, 0x44, 0x56, 0x56, 0x56, 0x8D, 0xDD, 0xCC, 0xDC, 0xD0, 0x00, 0x00, + }, + { + 0xEE, 0xDE, 0xDD, 0xDE, 0xDD, 0xDD, 0xDD, 0x87, 0x75, 0x55, 0x43, 0x22, + 0x21, 0x25, 0x65, 0x55, 0x66, 0x77, 0xD8, 0x8D, 0xDD, 0x90, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xAA, 0x98, 0x77, 0x55, 0x43, + 0x33, 0x33, 0x21, 0x33, 0x34, 0x66, 0x89, 0xAF, 0xFF, 0xC0, 0x00, 0x00, + }, + { + 0x57, 0x77, 0x76, 0x66, 0x65, 0x55, 0x44, 0x44, 0x44, 0x44, 0x44, 0x44, + 0x33, 0x44, 0x43, 0x44, 0x44, 0x45, 0x56, 0x66, 0x77, 0x50, 0x00, 0x00, + }, + }, + { + { + 0x57, 0x76, 0x66, 0x65, 0x44, 0x44, 0x43, 0x33, 0x33, 0x33, 0x33, 0x34, + 0x45, 0x56, 0x67, 0x77, 0x77, 0x89, 0x88, 0x89, 0x99, 0x60, 0x00, 0x00, + }, + { + 0x8A, 0x99, 0x88, 0x77, 0x66, 0x44, 0x43, 0x32, 0x32, 0x22, 0x33, 0x45, + 0x67, 0x89, 0xEB, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFB, 0xBA, 0xA7, 0x78, 0x66, 0x65, 0x54, 0x22, 0x21, 0x23, 0x44, + 0x56, 0x8A, 0x9E, 0xAF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xAF, 0xFD, 0xDF, 0xAC, 0x98, 0x77, 0x66, 0x44, 0x31, 0x11, 0x35, + 0x67, 0x88, 0x8A, 0xAA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xEF, 0xEE, 0xEF, 0xA8, 0x8E, 0x97, 0x66, 0x43, 0x22, 0x21, 0x23, + 0x45, 0x67, 0x97, 0x7F, 0xFF, 0xEE, 0xE9, 0xEE, 0xEE, 0xF0, 0x00, 0x00, + }, + { + 0xAA, 0xA9, 0x97, 0x65, 0x45, 0x45, 0x67, 0x66, 0x55, 0x54, 0x44, 0x44, + 0x33, 0x33, 0x33, 0x33, 0x44, 0x45, 0x56, 0x68, 0x8B, 0xB0, 0x00, 0x00, + }, + { + 0xEE, 0xDE, 0xED, 0xDE, 0xED, 0xDD, 0xD8, 0x77, 0x65, 0x43, 0x11, 0x22, + 0x34, 0x66, 0x78, 0x87, 0xEE, 0xEE, 0xEE, 0x9D, 0xED, 0xE0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xDC, 0xFF, 0xAE, 0xEA, 0x98, 0x76, 0x54, 0x31, 0x11, + 0x34, 0x56, 0x88, 0x99, 0x9B, 0xFF, 0xFF, 0xBF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xCF, 0xDF, 0xFF, 0xFD, 0x9A, 0x76, 0x65, 0x43, 0x21, + 0x12, 0x35, 0x56, 0x67, 0x89, 0x99, 0xAF, 0xAF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFE, 0xEF, 0xDB, 0xBA, 0xAA, 0x99, 0x76, 0x55, 0x43, 0x22, + 0x22, 0x33, 0x33, 0x44, 0x55, 0x67, 0x8A, 0xFA, 0xFB, 0xA0, 0x00, 0x00, + }, + { + 0x57, 0x77, 0x77, 0x66, 0x65, 0x55, 0x54, 0x44, 0x44, 0x44, 0x43, 0x33, + 0x33, 0x34, 0x44, 0x44, 0x55, 0x55, 0x66, 0x77, 0x88, 0x60, 0x00, 0x00, + }, + }, + { + { + 0x58, 0x77, 0x76, 0x66, 0x55, 0x54, 0x44, 0x33, 0x33, 0x23, 0x33, 0x33, + 0x45, 0x56, 0x66, 0x77, 0x88, 0x88, 0x88, 0x88, 0x99, 0x60, 0x00, 0x00, + }, + { + 0x9A, 0xA9, 0xA9, 0x88, 0x76, 0x55, 0x44, 0x33, 0x22, 0x22, 0x23, 0x45, + 0x56, 0x99, 0x9D, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFD, 0xBB, 0xAA, 0xBA, 0xA9, 0x87, 0x77, 0x54, 0x33, 0x21, 0x12, 0x45, + 0x68, 0x8A, 0xAA, 0xCB, 0xFF, 0xCF, 0xFF, 0xFF, 0xFE, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xEF, 0xFE, 0xA9, 0x98, 0x87, 0x65, 0x41, 0x02, 0x45, + 0x77, 0x88, 0xAC, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xBF, 0xFC, 0xAB, 0xFB, 0xBA, 0xAB, 0xB8, 0x88, 0x76, 0x52, 0x01, 0x35, + 0x78, 0x99, 0xAB, 0xAA, 0xCF, 0xBB, 0xCF, 0xFC, 0xFC, 0xF0, 0x00, 0x00, + }, + { + 0xBA, 0xCA, 0x98, 0x75, 0x21, 0x35, 0x77, 0x77, 0x76, 0x65, 0x54, 0x44, + 0x44, 0x34, 0x44, 0x44, 0x45, 0x56, 0x78, 0x88, 0x9A, 0xC0, 0x00, 0x00, + }, + { + 0xDF, 0xCF, 0xCC, 0xFF, 0xAB, 0xC9, 0xB9, 0x98, 0x97, 0x75, 0x20, 0x13, + 0x56, 0x89, 0x89, 0xAA, 0xFC, 0xBC, 0xAF, 0xCC, 0xFF, 0xD0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xBB, 0xFB, 0xFF, 0xFB, 0xBA, 0xA8, 0x77, 0x54, 0x21, 0x11, + 0x45, 0x67, 0x88, 0x8A, 0xEF, 0xBB, 0xFF, 0xBB, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFB, 0xCB, 0xB9, 0x88, 0x65, 0x31, 0x12, + 0x23, 0x35, 0x67, 0x88, 0xAA, 0xAC, 0xFC, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFC, 0xEF, 0xFF, 0xBB, 0xAA, 0xA9, 0x76, 0x55, 0x32, 0x22, + 0x22, 0x33, 0x34, 0x56, 0x67, 0x68, 0x9A, 0xAA, 0xCD, 0xE0, 0x00, 0x00, + }, + { + 0x58, 0x77, 0x77, 0x66, 0x66, 0x55, 0x54, 0x44, 0x44, 0x43, 0x33, 0x33, + 0x33, 0x34, 0x44, 0x55, 0x55, 0x66, 0x67, 0x78, 0x88, 0x60, 0x00, 0x00, + }, + }, + { + { + 0x57, 0x77, 0x76, 0x66, 0x55, 0x55, 0x54, 0x43, 0x33, 0x22, 0x33, 0x34, + 0x45, 0x55, 0x66, 0x67, 0x77, 0x77, 0x78, 0x88, 0x99, 0x50, 0x00, 0x00, + }, + { + 0xAC, 0x99, 0x98, 0x87, 0x76, 0x66, 0x54, 0x43, 0x32, 0x21, 0x23, 0x45, + 0x66, 0x89, 0x99, 0x99, 0xAA, 0xBF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xB9, 0xAA, 0x98, 0x77, 0x65, 0x42, 0x21, 0x12, 0x45, + 0x78, 0x8A, 0xBA, 0xAA, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFD, 0xBC, 0xBB, 0xB9, 0x98, 0x76, 0x32, 0x01, 0x46, + 0x79, 0xAB, 0xBB, 0xBE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xAA, 0xAA, 0x99, 0x76, 0x42, 0x01, 0x36, + 0x79, 0x9A, 0xAB, 0xBF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xCC, 0xDC, 0xB9, 0x75, 0x10, 0x47, 0x89, 0x99, 0x98, 0x87, 0x76, 0x66, + 0x55, 0x55, 0x55, 0x56, 0x66, 0x67, 0x78, 0x99, 0xBE, 0xE0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFC, 0xCC, 0xFF, 0xFB, 0xAB, 0x87, 0x64, 0x10, 0x23, + 0x67, 0x99, 0x9A, 0xAD, 0xCE, 0xFF, 0xFC, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFB, 0xFF, 0xFD, 0xFA, 0xB9, 0x97, 0x65, 0x20, 0x13, + 0x56, 0x78, 0xAA, 0x9B, 0xFB, 0xFC, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xCF, 0xFC, 0xC9, 0xAC, 0x98, 0x87, 0x54, 0x31, 0x12, + 0x23, 0x45, 0x67, 0x78, 0x9A, 0xAA, 0xEB, 0xFF, 0xFF, 0xE0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFE, 0xCA, 0xFA, 0x99, 0x98, 0x88, 0x65, 0x44, 0x32, 0x22, + 0x22, 0x33, 0x45, 0x56, 0x67, 0x78, 0x99, 0xBB, 0xAB, 0xA0, 0x00, 0x00, + }, + { + 0x48, 0x77, 0x76, 0x66, 0x65, 0x55, 0x55, 0x44, 0x44, 0x43, 0x33, 0x33, + 0x33, 0x34, 0x45, 0x55, 0x55, 0x66, 0x67, 0x77, 0x78, 0x60, 0x00, 0x00, + }, + }, + { + { + 0x68, 0x87, 0x77, 0x77, 0x66, 0x55, 0x54, 0x43, 0x33, 0x22, 0x23, 0x34, + 0x45, 0x55, 0x66, 0x78, 0x88, 0x98, 0x88, 0x88, 0x89, 0x60, 0x00, 0x00, + }, + { + 0xAB, 0xBA, 0xAA, 0xBA, 0x99, 0x87, 0x76, 0x54, 0x33, 0x21, 0x12, 0x46, + 0x67, 0x89, 0x9A, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFD, 0xCA, 0x98, 0x87, 0x76, 0x54, 0x21, 0x11, 0x45, + 0x78, 0x8A, 0x9A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xAA, 0x99, 0x76, 0x32, 0x01, 0x46, + 0x78, 0x9A, 0xAB, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCA, 0xE9, 0x89, 0x76, 0x52, 0x01, 0x35, + 0x68, 0x98, 0x9A, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xAD, 0xCB, 0xA9, 0x74, 0x10, 0x46, 0x89, 0x9A, 0xA9, 0x98, 0x77, 0x76, + 0x66, 0x55, 0x55, 0x56, 0x66, 0x66, 0x78, 0x88, 0x8A, 0xD0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xAA, 0xAA, 0x87, 0x63, 0x10, 0x24, + 0x67, 0x89, 0xAF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0x9A, 0x97, 0x64, 0x20, 0x13, + 0x67, 0x89, 0x9A, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x99, 0x87, 0x76, 0x43, 0x21, 0x12, + 0x34, 0x56, 0x67, 0x88, 0x89, 0xAE, 0xCF, 0xFD, 0xEF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xAA, 0x87, 0x66, 0x54, 0x31, 0x12, + 0x33, 0x44, 0x55, 0x67, 0x77, 0x89, 0xAB, 0xAB, 0xCF, 0xC0, 0x00, 0x00, + }, + { + 0x58, 0x87, 0x87, 0x77, 0x76, 0x66, 0x55, 0x55, 0x44, 0x43, 0x32, 0x22, + 0x33, 0x44, 0x55, 0x56, 0x67, 0x77, 0x78, 0x88, 0x88, 0x70, 0x00, 0x00, + }, + }, + { + { + 0x67, 0x76, 0x66, 0x76, 0x66, 0x55, 0x44, 0x44, 0x33, 0x22, 0x22, 0x34, + 0x56, 0x67, 0x77, 0x89, 0x88, 0x99, 0xAB, 0x9A, 0xAB, 0x70, 0x00, 0x00, + }, + { + 0x9B, 0xA9, 0x88, 0x88, 0x87, 0x77, 0x65, 0x54, 0x43, 0x21, 0x12, 0x45, + 0x67, 0x9A, 0x9A, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEE, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFC, 0xCB, 0xBA, 0xAA, 0x98, 0x87, 0x65, 0x31, 0x02, 0x56, + 0x89, 0xAB, 0xCB, 0xBC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xAA, 0x9A, 0x98, 0x76, 0x42, 0x01, 0x36, + 0x79, 0xAF, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x78, 0xA9, 0x98, 0x76, 0x52, 0x01, 0x35, + 0x78, 0x8E, 0xCB, 0xBF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0x8C, 0xBA, 0x99, 0x74, 0x10, 0x36, 0x89, 0x9A, 0xA9, 0x99, 0x88, 0x87, + 0x76, 0x66, 0x66, 0x66, 0x66, 0x56, 0x66, 0x78, 0x89, 0xC0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x8A, 0xA9, 0x88, 0x63, 0x10, 0x24, + 0x67, 0x8B, 0xBC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC9, 0x99, 0x76, 0x54, 0x10, 0x24, + 0x56, 0x78, 0x9A, 0xAA, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xD9, 0x87, 0x54, 0x20, 0x22, + 0x45, 0x67, 0x77, 0x89, 0xAC, 0xAB, 0xFB, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAD, 0xAB, 0x86, 0x54, 0x21, 0x12, + 0x34, 0x45, 0x66, 0x77, 0x67, 0x77, 0x88, 0x99, 0x9A, 0x90, 0x00, 0x00, + }, + { + 0x57, 0x77, 0x76, 0x66, 0x65, 0x55, 0x55, 0x55, 0x54, 0x43, 0x32, 0x23, + 0x33, 0x44, 0x55, 0x55, 0x66, 0x67, 0x88, 0x77, 0x77, 0x50, 0x00, 0x00, + }, + }, + { + { + 0x35, 0x44, 0x45, 0x55, 0x54, 0x44, 0x44, 0x43, 0x33, 0x33, 0x23, 0x44, + 0x68, 0x99, 0xAA, 0xAA, 0xCB, 0xAB, 0xAF, 0xFE, 0xEB, 0xE0, 0x00, 0x00, + }, + { + 0x77, 0x66, 0x67, 0x66, 0x66, 0x66, 0x54, 0x44, 0x33, 0x22, 0x12, 0x45, + 0x68, 0xAA, 0xBE, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEE, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xEA, 0x98, 0x88, 0x87, 0x77, 0x65, 0x55, 0x44, 0x32, 0x02, 0x46, + 0x78, 0x89, 0xAA, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xAB, 0xAB, 0x99, 0x76, 0x65, 0x42, 0x01, 0x45, + 0x78, 0xAA, 0xAD, 0xAC, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xEB, 0xBA, 0xA9, 0x86, 0x42, 0x01, 0x36, + 0x77, 0x8A, 0xBB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xAC, 0xBB, 0x98, 0x74, 0x10, 0x36, 0x77, 0x89, 0x99, 0x99, 0x88, 0x77, + 0x76, 0x66, 0x66, 0x55, 0x56, 0x67, 0x89, 0xAA, 0xAB, 0xC0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xC9, 0x99, 0x99, 0x88, 0x64, 0x10, 0x24, + 0x55, 0x68, 0x89, 0xBB, 0xAD, 0xBF, 0xBF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x97, 0x65, 0x65, 0x54, 0x20, 0x23, + 0x45, 0x56, 0x77, 0x77, 0x8E, 0xCB, 0xBE, 0xDF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0x76, 0x53, 0x21, 0x13, + 0x34, 0x55, 0x45, 0x55, 0x67, 0x79, 0xAB, 0xFA, 0xFB, 0xA0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFE, 0x87, 0x54, 0x21, 0x23, + 0x33, 0x44, 0x55, 0x55, 0x44, 0x45, 0x57, 0x8A, 0xAA, 0x80, 0x00, 0x00, + }, + { + 0x79, 0x99, 0x99, 0x97, 0x77, 0x76, 0x54, 0x44, 0x44, 0x44, 0x32, 0x33, + 0x33, 0x33, 0x44, 0x45, 0x56, 0x67, 0x88, 0x77, 0x78, 0x60, 0x00, 0x00, + }, + }, + { + { + 0x34, 0x54, 0x45, 0x55, 0x54, 0x44, 0x44, 0x33, 0x32, 0x43, 0x34, 0x44, + 0x56, 0x77, 0xBB, 0xB6, 0xCC, 0xCC, 0xCC, 0xC8, 0xCB, 0x70, 0x00, 0x00, + }, + { + 0x7E, 0x67, 0x55, 0x65, 0x44, 0x55, 0x44, 0x33, 0x22, 0x23, 0x23, 0x57, + 0x98, 0xDD, 0xDD, 0xDE, 0xED, 0xDD, 0xDD, 0xDD, 0xDD, 0xE0, 0x00, 0x00, + }, + { + 0xFF, 0xEF, 0xEE, 0x97, 0x75, 0x54, 0x43, 0x33, 0x33, 0x32, 0x12, 0x58, + 0x88, 0xEE, 0xAE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEE, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x88, 0x87, 0x66, 0x53, 0x22, 0x02, 0x57, + 0x9D, 0xFF, 0xFF, 0xEF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xA9, 0x78, 0x76, 0x42, 0x01, 0x36, + 0x99, 0x9A, 0xFF, 0xDF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xAB, 0xAA, 0xA8, 0x75, 0x10, 0x26, 0x79, 0x88, 0x77, 0x77, 0x66, 0x66, + 0x57, 0x78, 0x88, 0x89, 0x98, 0x9A, 0xBB, 0xBB, 0xDD, 0xC0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFE, 0xEF, 0xFF, 0xFE, 0xA8, 0x78, 0x76, 0x54, 0x20, 0x22, + 0x45, 0x6E, 0x8E, 0xEF, 0xFF, 0xF9, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFA, 0xE7, 0x66, 0x64, 0x20, 0x23, + 0x34, 0x56, 0x78, 0x88, 0xAF, 0xFC, 0xFF, 0xFF, 0xAF, 0xF0, 0x00, 0x00, + }, + { + 0xEE, 0xDE, 0xED, 0xDE, 0xED, 0x8D, 0xDD, 0xD9, 0xE6, 0x63, 0x21, 0x23, + 0x43, 0x34, 0x35, 0x55, 0x65, 0x47, 0xEE, 0xED, 0xED, 0xE0, 0x00, 0x00, + }, + { + 0xDD, 0xCD, 0xDC, 0xCD, 0xDD, 0xCC, 0xCC, 0xCD, 0xDD, 0x76, 0x43, 0x44, + 0x44, 0x43, 0x34, 0x33, 0x22, 0x33, 0x35, 0xD8, 0xCC, 0xD0, 0x00, 0x00, + }, + { + 0x6B, 0x77, 0xBB, 0xB6, 0x96, 0x55, 0x55, 0x54, 0x44, 0x44, 0x33, 0x43, + 0x33, 0x33, 0x45, 0x34, 0x44, 0x68, 0x57, 0x78, 0x86, 0x50, 0x00, 0x00, + }, + }, + { + { + 0x4A, 0xAA, 0xAA, 0x9A, 0x44, 0x44, 0x45, 0x23, 0x24, 0x22, 0xA3, 0x3A, + 0x44, 0x99, 0x99, 0x9A, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA0, 0x00, 0x00, + }, + { + 0xAA, 0x45, 0x34, 0x94, 0x4A, 0x4A, 0x32, 0x23, 0x32, 0x24, 0x4A, 0xAA, + 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA0, 0x00, 0x00, + }, + { + 0xAA, 0xAA, 0xAA, 0xAA, 0x4A, 0xA4, 0x44, 0x21, 0x43, 0x32, 0x23, 0x5A, + 0xAA, 0xAA, 0x99, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA0, 0x00, 0x00, + }, + { + 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0x7D, 0x8D, 0x74, 0x21, 0x11, 0x35, 0x7D, + 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD0, 0x00, 0x00, + }, + { + 0xFE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE9, 0x64, 0x32, 0x01, 0x57, + 0xE8, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xF0, 0x00, 0x00, + }, + { + 0xEE, 0xDE, 0xE9, 0x55, 0x10, 0x27, 0x98, 0x65, 0x48, 0xAE, 0x99, 0x88, + 0x77, 0x87, 0x79, 0x89, 0xEA, 0xEE, 0xAE, 0xEE, 0xEE, 0xE0, 0x00, 0x00, + }, + { + 0xCB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xB6, 0x45, 0x11, 0x13, + 0x44, 0x3B, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xC0, 0x00, 0x00, + }, + { + 0xBB, 0xAB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x5A, 0x31, 0x12, + 0x23, 0x34, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xB0, 0x00, 0x00, + }, + { + 0xBB, 0xBB, 0xBB, 0xAB, 0xBB, 0xBB, 0xAA, 0xAB, 0xBB, 0xBB, 0xB5, 0x55, + 0x64, 0x22, 0x24, 0x55, 0x32, 0x14, 0xBB, 0xBB, 0xBB, 0xB0, 0x00, 0x00, + }, + { + 0xAA, 0xAA, 0xA9, 0x9A, 0xAA, 0xA9, 0x99, 0x9A, 0x4A, 0xAA, 0xA3, 0x33, + 0x32, 0x34, 0x35, 0x44, 0x42, 0x24, 0xA4, 0xAA, 0xAA, 0xA0, 0x00, 0x00, + }, + { + 0xAA, 0x9A, 0x99, 0x9A, 0xA9, 0x54, 0x94, 0x95, 0x44, 0x53, 0x34, 0x53, + 0x23, 0x34, 0x34, 0x45, 0x33, 0x4A, 0x99, 0x99, 0xA9, 0xA0, 0x00, 0x00, + }, + }, + }, + { + { + { + 0x57, 0xAB, 0x66, 0x52, 0x12, 0x44, 0x45, 0x43, 0x33, 0x45, 0x77, 0xA6, + 0x77, 0xA7, 0xA7, 0x65, 0x77, 0xBB, 0xB7, 0xBB, 0x7B, 0xB0, 0x00, 0x00, + }, + { + 0xBB, 0x5B, 0xBB, 0x5B, 0xBB, 0x21, 0x22, 0x45, 0x62, 0x26, 0x56, 0xBB, + 0xBB, 0xBA, 0xAA, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xB0, 0x00, 0x00, + }, + { + 0xAA, 0x3A, 0x99, 0x93, 0x19, 0x99, 0x99, 0x99, 0x99, 0x24, 0x19, 0x33, + 0x99, 0x93, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0xA0, 0x00, 0x00, + }, + { + 0x77, 0x67, 0x66, 0x67, 0x76, 0x66, 0x66, 0x67, 0x77, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x10, 0x77, 0x76, 0x77, 0x77, 0x77, 0x70, 0x00, 0x00, + }, + { + 0x77, 0x67, 0x66, 0x67, 0x76, 0x66, 0x66, 0x67, 0x77, 0x66, 0x66, 0x66, + 0x61, 0x66, 0x66, 0x67, 0x07, 0x76, 0x77, 0x77, 0x77, 0x70, 0x00, 0x00, + }, + { + 0xDD, 0xDD, 0xD6, 0xCD, 0xDD, 0xD9, 0x88, 0xC9, 0x64, 0x76, 0x34, 0x42, + 0x12, 0x54, 0x53, 0x34, 0x54, 0x56, 0x66, 0x79, 0xDD, 0xD0, 0x00, 0x00, + }, + { + 0x88, 0x78, 0x77, 0x78, 0x77, 0x77, 0x77, 0x78, 0x87, 0x07, 0x77, 0x77, + 0x21, 0x77, 0x77, 0x78, 0x88, 0x87, 0x87, 0x88, 0x88, 0x80, 0x00, 0x00, + }, + { + 0xAA, 0x9A, 0x99, 0x9A, 0x99, 0x99, 0x99, 0x9A, 0x99, 0x01, 0x99, 0x99, + 0x43, 0x99, 0x34, 0x99, 0x94, 0x99, 0x99, 0x99, 0xAA, 0xA0, 0x00, 0x00, + }, + { + 0x99, 0x89, 0x88, 0x89, 0x88, 0x88, 0x88, 0x89, 0x88, 0x82, 0x88, 0x21, + 0x82, 0x82, 0x83, 0x88, 0x82, 0x88, 0x88, 0x88, 0x99, 0x90, 0x00, 0x00, + }, + { + 0xDD, 0xDD, 0xDD, 0xCD, 0xDD, 0xDD, 0xCC, 0xCD, 0xDD, 0xDD, 0xD6, 0x74, + 0x56, 0x64, 0x20, 0x54, 0x42, 0x38, 0xDD, 0xDD, 0xDD, 0xD0, 0x00, 0x00, + }, + { + 0x79, 0x87, 0x96, 0x76, 0x76, 0x55, 0x66, 0x44, 0x55, 0x44, 0x55, 0x32, + 0x24, 0x88, 0x62, 0x55, 0x45, 0x43, 0x47, 0x66, 0x76, 0x60, 0x00, 0x00, + }, + }, + { + { + 0x57, 0x66, 0x65, 0x54, 0x43, 0x34, 0x33, 0x33, 0x33, 0x33, 0x44, 0x45, + 0x55, 0x66, 0x77, 0x77, 0x77, 0x77, 0x98, 0x88, 0x79, 0x60, 0x00, 0x00, + }, + { + 0x88, 0x98, 0x8D, 0x65, 0x66, 0x32, 0x33, 0x22, 0x23, 0x33, 0x45, 0x67, + 0x78, 0x68, 0x8D, 0xCD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD0, 0x00, 0x00, + }, + { + 0x8D, 0xCD, 0xDC, 0xC5, 0x56, 0x46, 0x45, 0x54, 0x22, 0x22, 0x22, 0x45, + 0x57, 0x6C, 0xCC, 0xCD, 0xDD, 0xDD, 0xDD, 0xDC, 0xCC, 0xD0, 0x00, 0x00, + }, + { + 0xCC, 0xCC, 0xCB, 0xBC, 0xCC, 0xC7, 0xB5, 0x54, 0x12, 0x33, 0x22, 0x25, + 0x56, 0xB6, 0x7B, 0xB7, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xC0, 0x00, 0x00, + }, + { + 0xBB, 0xAB, 0xBA, 0xAB, 0xBB, 0xA5, 0xA5, 0x55, 0x21, 0x2B, 0x33, 0x23, + 0x44, 0x55, 0xA6, 0x5B, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xB0, 0x00, 0x00, + }, + { + 0xAC, 0xAB, 0xC6, 0x66, 0x87, 0x87, 0x77, 0x98, 0x66, 0x54, 0x43, 0x43, + 0x33, 0x32, 0x33, 0x33, 0x44, 0x45, 0x66, 0x68, 0x79, 0xA0, 0x00, 0x00, + }, + { + 0xBB, 0xBB, 0xBB, 0xAB, 0xBB, 0xBB, 0xBA, 0x4B, 0x43, 0x22, 0x22, 0x32, + 0x44, 0x34, 0xA5, 0xA6, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xB0, 0x00, 0x00, + }, + { + 0xBB, 0xAB, 0xAA, 0xAB, 0xBA, 0xAA, 0xA6, 0x65, 0x54, 0x43, 0x21, 0x23, + 0x34, 0x34, 0x55, 0x56, 0x6B, 0xBB, 0xB6, 0xBA, 0xBA, 0xB0, 0x00, 0x00, + }, + { + 0xDD, 0xCD, 0xDC, 0xCD, 0xDD, 0xCC, 0xCC, 0xC6, 0x66, 0x44, 0x43, 0x32, + 0x21, 0x25, 0x65, 0x46, 0x54, 0x8D, 0xDD, 0xDC, 0xD7, 0xC0, 0x00, 0x00, + }, + { + 0xFF, 0xEF, 0xEE, 0xEF, 0xEE, 0xEE, 0xEE, 0x9A, 0xF7, 0x66, 0x55, 0x43, + 0x33, 0x22, 0x22, 0x33, 0x34, 0x78, 0x98, 0xEE, 0xFE, 0x90, 0x00, 0x00, + }, + { + 0x57, 0x67, 0x66, 0x76, 0x65, 0x55, 0x44, 0x54, 0x44, 0x43, 0x43, 0x34, + 0x43, 0x44, 0x44, 0x44, 0x45, 0x45, 0x55, 0x67, 0x77, 0x60, 0x00, 0x00, + }, + }, + { + { + 0x78, 0x88, 0x76, 0x66, 0x55, 0x54, 0x44, 0x33, 0x22, 0x23, 0x33, 0x44, + 0x55, 0x67, 0x67, 0x78, 0x98, 0x98, 0x99, 0x9A, 0xA9, 0x90, 0x00, 0x00, + }, + { + 0x99, 0xAA, 0xAB, 0x97, 0x65, 0x55, 0x44, 0x32, 0x22, 0x22, 0x33, 0x45, + 0x67, 0x89, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFC, 0xBB, 0xA8, 0x88, 0x77, 0x76, 0x54, 0x32, 0x11, 0x23, 0x46, + 0x77, 0x8A, 0xF8, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xEE, 0xDE, 0xED, 0xDE, 0xE9, 0xDD, 0x77, 0x65, 0x43, 0x21, 0x12, 0x34, + 0x57, 0x7D, 0x78, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE0, 0x00, 0x00, + }, + { + 0xEE, 0xEE, 0xEE, 0xDE, 0xEE, 0xE7, 0x7D, 0x96, 0x54, 0x22, 0x11, 0x24, + 0x56, 0x87, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE0, 0x00, 0x00, + }, + { + 0xCB, 0xAA, 0x97, 0x65, 0x44, 0x45, 0x77, 0x76, 0x66, 0x55, 0x44, 0x33, + 0x33, 0x33, 0x33, 0x33, 0x44, 0x55, 0x68, 0x99, 0x9A, 0xC0, 0x00, 0x00, + }, + { + 0xDD, 0xDD, 0xDD, 0x7D, 0xDD, 0xDC, 0xCC, 0x66, 0x66, 0x43, 0x11, 0x22, + 0x34, 0x56, 0x8C, 0xCD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD0, 0x00, 0x00, + }, + { + 0xFF, 0xEF, 0xFE, 0xEF, 0xFF, 0xEE, 0xE9, 0x88, 0x76, 0x54, 0x31, 0x11, + 0x34, 0x57, 0x77, 0x8F, 0xAF, 0xFF, 0xFF, 0xFE, 0xFE, 0xF0, 0x00, 0x00, + }, + { + 0xFE, 0xEE, 0xEE, 0xEA, 0xAE, 0xEE, 0xA9, 0xE9, 0x87, 0x65, 0x43, 0x11, + 0x22, 0x35, 0x56, 0x66, 0x88, 0x9A, 0xEE, 0xEA, 0xEE, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xEA, 0xFF, 0xFB, 0xEA, 0x98, 0x76, 0x55, 0x43, 0x22, + 0x22, 0x33, 0x33, 0x44, 0x46, 0x78, 0xAA, 0xFF, 0xFB, 0xB0, 0x00, 0x00, + }, + { + 0x79, 0x99, 0x77, 0x77, 0x66, 0x55, 0x54, 0x44, 0x43, 0x43, 0x33, 0x33, + 0x33, 0x34, 0x44, 0x55, 0x55, 0x66, 0x66, 0x79, 0x99, 0x80, 0x00, 0x00, + }, + }, + { + { + 0x68, 0x87, 0x77, 0x66, 0x55, 0x55, 0x54, 0x43, 0x32, 0x22, 0x33, 0x34, + 0x45, 0x66, 0x77, 0x78, 0x88, 0x89, 0x98, 0x88, 0x88, 0x60, 0x00, 0x00, + }, + { + 0xAA, 0xAB, 0xAB, 0xA9, 0x88, 0x66, 0x65, 0x43, 0x22, 0x21, 0x23, 0x46, + 0x78, 0xA9, 0xBF, 0xEF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFD, 0xFF, 0xFF, 0xBC, 0x99, 0x98, 0x76, 0x65, 0x42, 0x21, 0x12, 0x46, + 0x67, 0x99, 0xFF, 0xEF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xBE, 0xFA, 0xB9, 0x87, 0x65, 0x31, 0x02, 0x56, + 0x79, 0x9A, 0xAF, 0xEA, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0x9B, 0xAE, 0xBE, 0x9B, 0xBB, 0xAB, 0xAA, 0x98, 0x76, 0x52, 0x01, 0x35, + 0x88, 0x99, 0x9A, 0xAC, 0xBA, 0xBB, 0xEA, 0xBA, 0xEA, 0xB0, 0x00, 0x00, + }, + { + 0xCC, 0xBC, 0xA7, 0x65, 0x21, 0x46, 0x88, 0x87, 0x77, 0x65, 0x44, 0x44, + 0x43, 0x33, 0x44, 0x45, 0x55, 0x56, 0x78, 0x9A, 0x9B, 0xC0, 0x00, 0x00, + }, + { + 0x9E, 0x9E, 0xA9, 0xAB, 0xAA, 0xA9, 0x9D, 0x99, 0x87, 0x65, 0x10, 0x23, + 0x68, 0x88, 0x98, 0x9A, 0xA9, 0xAA, 0xDA, 0xAD, 0xAA, 0x90, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFE, 0xEF, 0xFF, 0xFC, 0xBB, 0xA9, 0xA7, 0x65, 0x30, 0x12, + 0x56, 0x78, 0x9A, 0x9A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC, 0xBA, 0x98, 0x76, 0x41, 0x11, + 0x24, 0x47, 0x77, 0x89, 0xBB, 0xED, 0xCF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xCF, 0xFF, 0xEF, 0xCF, 0xCE, 0x9B, 0xA9, 0x87, 0x65, 0x42, 0x11, + 0x23, 0x44, 0x55, 0x66, 0x67, 0x9A, 0xAB, 0xCF, 0xCC, 0xD0, 0x00, 0x00, + }, + { + 0x68, 0x78, 0x77, 0x76, 0x66, 0x55, 0x55, 0x54, 0x44, 0x33, 0x33, 0x32, + 0x33, 0x34, 0x55, 0x55, 0x66, 0x66, 0x77, 0x77, 0x88, 0x60, 0x00, 0x00, + }, + }, + { + { + 0x68, 0x77, 0x76, 0x66, 0x55, 0x55, 0x54, 0x44, 0x32, 0x22, 0x33, 0x34, + 0x55, 0x56, 0x66, 0x66, 0x67, 0x78, 0x88, 0x99, 0x99, 0x50, 0x00, 0x00, + }, + { + 0xCB, 0xCA, 0xAA, 0xA9, 0x97, 0x77, 0x66, 0x54, 0x32, 0x21, 0x13, 0x46, + 0x79, 0xAA, 0xAB, 0xBF, 0xCD, 0xFD, 0xCF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFC, 0xFF, 0xBB, 0xA9, 0xA8, 0x87, 0x65, 0x31, 0x02, 0x56, + 0x89, 0xAB, 0xBB, 0xBB, 0xBC, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFB, 0xFF, 0xCD, 0xCF, 0x99, 0x87, 0x65, 0x42, 0x01, 0x45, + 0x67, 0x9A, 0xBB, 0xAF, 0xBD, 0xBF, 0xFC, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xF9, 0xA8, 0x86, 0x42, 0x01, 0x36, + 0x78, 0x8A, 0xBF, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB0, 0x00, 0x00, + }, + { + 0xCF, 0xDB, 0xBA, 0x85, 0x10, 0x47, 0x89, 0x99, 0x99, 0x87, 0x66, 0x65, + 0x55, 0x55, 0x55, 0x56, 0x66, 0x77, 0x89, 0xAC, 0xCE, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xBF, 0xBB, 0xFF, 0x98, 0x63, 0x10, 0x24, + 0x59, 0x99, 0xBF, 0xFB, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0xBB, 0xAF, 0x97, 0x65, 0x20, 0x13, + 0x56, 0x78, 0x99, 0xAB, 0xFD, 0xAF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC, 0xBB, 0xAA, 0x97, 0x65, 0x30, 0x13, + 0x44, 0x56, 0x88, 0x89, 0xA9, 0xBF, 0xFF, 0xCF, 0xFC, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFD, 0xFF, 0xFA, 0xBA, 0xBA, 0xB9, 0x87, 0x65, 0x32, 0x11, + 0x23, 0x45, 0x56, 0x67, 0x77, 0x9A, 0xBA, 0xBF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0x57, 0x78, 0x77, 0x66, 0x66, 0x55, 0x55, 0x44, 0x44, 0x43, 0x33, 0x23, + 0x33, 0x44, 0x45, 0x55, 0x56, 0x66, 0x66, 0x77, 0x78, 0x60, 0x00, 0x00, + }, + }, + { + { + 0x68, 0x87, 0x87, 0x77, 0x66, 0x55, 0x54, 0x44, 0x32, 0x22, 0x23, 0x44, + 0x45, 0x56, 0x66, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x50, 0x00, 0x00, + }, + { + 0x9A, 0xB9, 0xA9, 0xA8, 0x87, 0x76, 0x65, 0x54, 0x43, 0x21, 0x12, 0x45, + 0x68, 0x88, 0xAA, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFC, 0xCF, 0xBA, 0x98, 0x77, 0x65, 0x31, 0x02, 0x56, + 0x89, 0xAC, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB9, 0x87, 0x76, 0x42, 0x01, 0x36, + 0x89, 0xAA, 0xBD, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xBF, 0xFF, 0xEF, 0xBF, 0xAC, 0x99, 0x87, 0x42, 0x01, 0x35, + 0x79, 0xAA, 0xBB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xCD, 0xCC, 0xB9, 0x74, 0x10, 0x46, 0x8A, 0xA9, 0x99, 0x98, 0x77, 0x66, + 0x66, 0x55, 0x55, 0x55, 0x66, 0x67, 0x89, 0x9A, 0xAB, 0xD0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0xDA, 0xA8, 0x53, 0x10, 0x24, + 0x68, 0x9A, 0xAE, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFB, 0x98, 0x74, 0x10, 0x23, + 0x57, 0x89, 0xAB, 0xBC, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0xBA, 0x98, 0x65, 0x20, 0x13, + 0x56, 0x78, 0x89, 0x9A, 0xAC, 0xEF, 0xFB, 0xFF, 0xDF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0x99, 0x86, 0x54, 0x21, 0x12, + 0x34, 0x45, 0x56, 0x67, 0x67, 0x99, 0xAB, 0xEB, 0xFF, 0xB0, 0x00, 0x00, + }, + { + 0x57, 0x87, 0x77, 0x77, 0x66, 0x66, 0x65, 0x55, 0x44, 0x43, 0x32, 0x22, + 0x33, 0x44, 0x55, 0x56, 0x67, 0x77, 0x77, 0x88, 0x99, 0x70, 0x00, 0x00, + }, + }, + { + { + 0x78, 0x88, 0x88, 0x77, 0x76, 0x65, 0x54, 0x44, 0x33, 0x32, 0x12, 0x34, + 0x46, 0x78, 0x99, 0x9A, 0xBA, 0xAC, 0xAB, 0xCB, 0xAA, 0x90, 0x00, 0x00, + }, + { + 0x9A, 0x98, 0x88, 0x98, 0x87, 0x77, 0x65, 0x54, 0x43, 0x21, 0x12, 0x45, + 0x67, 0x8B, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xBD, 0xA9, 0x99, 0x87, 0x77, 0x55, 0x41, 0x02, 0x46, + 0x79, 0xAB, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFE, 0xFF, 0xFF, 0xDB, 0x9A, 0xBA, 0x98, 0x76, 0x42, 0x01, 0x36, + 0x79, 0xBB, 0xCB, 0xFC, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFA, 0x9A, 0xAA, 0x87, 0x42, 0x01, 0x35, + 0x78, 0xDA, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xBC, 0xCC, 0xA9, 0x74, 0x10, 0x36, 0x8A, 0xAA, 0xA9, 0x99, 0x88, 0x77, + 0x76, 0x66, 0x65, 0x66, 0x55, 0x66, 0x78, 0x88, 0xAB, 0xC0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xAA, 0x97, 0x63, 0x10, 0x24, + 0x67, 0x88, 0x9B, 0xFD, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xFF, 0xFC, 0xBB, 0x97, 0x64, 0x10, 0x23, + 0x67, 0x88, 0xAA, 0xAB, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xBD, 0xA7, 0x64, 0x20, 0x14, + 0x55, 0x77, 0x78, 0x8A, 0xAA, 0xAB, 0xFD, 0xCC, 0xBF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEA, 0x76, 0x54, 0x21, 0x12, + 0x34, 0x45, 0x56, 0x67, 0x77, 0x8A, 0xAA, 0x99, 0xBA, 0x90, 0x00, 0x00, + }, + { + 0x68, 0x88, 0x77, 0x66, 0x66, 0x55, 0x55, 0x55, 0x54, 0x43, 0x22, 0x23, + 0x34, 0x44, 0x44, 0x56, 0x77, 0x77, 0x78, 0x99, 0x99, 0x60, 0x00, 0x00, + }, + }, + { + { + 0x45, 0x56, 0x66, 0x65, 0x55, 0x54, 0x44, 0x44, 0x44, 0x42, 0x12, 0x35, + 0x68, 0x8E, 0x9A, 0xBC, 0xEB, 0xBB, 0xEB, 0xBB, 0xBE, 0xB0, 0x00, 0x00, + }, + { + 0x87, 0x77, 0x76, 0x76, 0x66, 0x66, 0x55, 0x54, 0x43, 0x31, 0x12, 0x45, + 0x56, 0xA9, 0xEE, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xAF, 0x98, 0x97, 0x78, 0x75, 0x55, 0x44, 0x32, 0x02, 0x45, + 0x68, 0x8E, 0x9C, 0xEF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xBA, 0x98, 0x77, 0x65, 0x42, 0x01, 0x45, + 0x69, 0x9C, 0x9B, 0xDF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xCA, 0xAA, 0xA8, 0x76, 0x52, 0x01, 0x35, + 0x67, 0x8A, 0xEA, 0xBF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xA9, 0xAB, 0x98, 0x74, 0x10, 0x36, 0x89, 0x99, 0x99, 0x88, 0x87, 0x87, + 0x76, 0x66, 0x66, 0x55, 0x56, 0x67, 0x79, 0x9B, 0x9B, 0xB0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB8, 0x88, 0x87, 0x54, 0x10, 0x24, + 0x56, 0x77, 0x89, 0xBF, 0xFF, 0xEC, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xDC, 0xFF, 0xFB, 0xDB, 0xB9, 0x86, 0x53, 0x20, 0x23, + 0x44, 0x56, 0x88, 0x78, 0xAA, 0xFF, 0xAB, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xBF, 0xFA, 0x97, 0x64, 0x20, 0x23, + 0x44, 0x55, 0x56, 0x67, 0x77, 0x89, 0x9B, 0xB9, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xD9, 0x75, 0x43, 0x21, 0x23, + 0x34, 0x44, 0x44, 0x55, 0x55, 0x66, 0x66, 0x78, 0x8A, 0x80, 0x00, 0x00, + }, + { + 0x79, 0x89, 0x98, 0x88, 0x77, 0x77, 0x54, 0x44, 0x44, 0x43, 0x22, 0x33, + 0x33, 0x44, 0x45, 0x45, 0x66, 0x68, 0x77, 0x98, 0x88, 0x60, 0x00, 0x00, + }, + }, + { + { + 0x25, 0x45, 0x57, 0x45, 0x45, 0x55, 0x43, 0x33, 0x33, 0x33, 0x34, 0x44, + 0x55, 0xBB, 0xBB, 0x6B, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xB0, 0x00, 0x00, + }, + { + 0x86, 0x76, 0x75, 0x55, 0x55, 0x65, 0x74, 0x44, 0x33, 0x32, 0x12, 0x35, + 0x6C, 0xCC, 0xCC, 0xCD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xD0, 0x00, 0x00, + }, + { + 0xEE, 0xDE, 0xDD, 0x8E, 0x76, 0x55, 0x43, 0x44, 0x32, 0x32, 0x12, 0x46, + 0x87, 0x99, 0x9D, 0xDE, 0xEE, 0xEE, 0xDD, 0xDD, 0xDD, 0xE0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFE, 0xEF, 0xFF, 0xA9, 0x96, 0x55, 0x43, 0x32, 0x02, 0x45, + 0x88, 0xEE, 0xE9, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xAF, 0x89, 0x66, 0x42, 0x01, 0x36, + 0xD9, 0x8A, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xAA, 0xEA, 0xF9, 0x74, 0x10, 0x35, 0x79, 0x98, 0x87, 0x66, 0x66, 0x55, + 0x56, 0x67, 0x77, 0x77, 0x88, 0x99, 0xAA, 0xFC, 0xEE, 0xB0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xE9, 0x97, 0xF7, 0x65, 0x20, 0x13, + 0x56, 0x79, 0xEA, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xEE, 0xEE, 0xED, 0xDE, 0xEE, 0xED, 0xDD, 0xDE, 0x75, 0x63, 0x11, 0x22, + 0x34, 0x45, 0x67, 0x78, 0x9E, 0xEE, 0xEE, 0xEE, 0xEE, 0xE0, 0x00, 0x00, + }, + { + 0xEE, 0xDE, 0xDD, 0xDE, 0xED, 0xD8, 0xDD, 0xDE, 0x87, 0x54, 0x20, 0x23, + 0x46, 0x46, 0x56, 0x67, 0x76, 0x79, 0x8E, 0xED, 0xED, 0xE0, 0x00, 0x00, + }, + { + 0xEE, 0xDE, 0xDD, 0xDE, 0xDD, 0xDD, 0xDD, 0xD9, 0x98, 0x54, 0x32, 0x23, + 0x45, 0x44, 0x34, 0x43, 0x23, 0x66, 0x36, 0xD8, 0xDD, 0x90, 0x00, 0x00, + }, + { + 0x7B, 0x7B, 0xA7, 0x77, 0x6A, 0x57, 0x56, 0x55, 0x45, 0x43, 0x33, 0x33, + 0x33, 0x33, 0x44, 0x43, 0x35, 0xBB, 0xBA, 0xAA, 0xB7, 0x50, 0x00, 0x00, + }, + }, + { + { + 0x24, 0xA3, 0x44, 0x44, 0xAA, 0x49, 0x34, 0x43, 0x24, 0x42, 0x35, 0xA9, + 0x99, 0x49, 0x99, 0x9A, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA0, 0x00, 0x00, + }, + { + 0x99, 0x39, 0x94, 0x94, 0x39, 0x43, 0x92, 0x33, 0x29, 0x22, 0x39, 0x99, + 0x99, 0x99, 0x88, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x90, 0x00, 0x00, + }, + { + 0x99, 0x99, 0x99, 0x99, 0x49, 0x49, 0x33, 0x34, 0x33, 0x21, 0x23, 0x99, + 0x99, 0x99, 0x98, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x90, 0x00, 0x00, + }, + { + 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xC6, 0x32, 0x21, 0x12, 0x45, + 0xC7, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xD0, 0x00, 0x00, + }, + { + 0xED, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD7, 0xDD, 0x75, 0x42, 0x01, 0x38, + 0xDD, 0x7D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xE0, 0x00, 0x00, + }, + { + 0xCC, 0x8C, 0x87, 0x64, 0x10, 0x37, 0x86, 0x66, 0x67, 0x69, 0x78, 0x77, + 0x76, 0x66, 0x66, 0x67, 0x68, 0x77, 0x88, 0xCC, 0xCC, 0xC0, 0x00, 0x00, + }, + { + 0xBB, 0xAB, 0xAA, 0xAB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA4, 0x20, 0x22, + 0x44, 0xA5, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBA, 0xB0, 0x00, 0x00, + }, + { + 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0x4B, 0x33, 0x03, + 0x23, 0x46, 0x4B, 0x5B, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xB0, 0x00, 0x00, + }, + { + 0xBB, 0xBB, 0xBB, 0xAB, 0xBB, 0xBB, 0xAA, 0xAB, 0xBB, 0xBB, 0xB2, 0x43, + 0x44, 0x32, 0x13, 0x46, 0x34, 0x35, 0xBB, 0xBB, 0xBB, 0xB0, 0x00, 0x00, + }, + { + 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA9, 0x9A, 0xAA, 0xAA, 0xA4, 0x23, + 0x32, 0xA5, 0x32, 0xA2, 0x24, 0xA3, 0xAA, 0x4A, 0xAA, 0xA0, 0x00, 0x00, + }, + { + 0xA9, 0x59, 0x99, 0x99, 0x99, 0x54, 0x49, 0x45, 0x55, 0x45, 0x43, 0x39, + 0x52, 0x33, 0x43, 0x44, 0x25, 0x59, 0x59, 0x99, 0x59, 0xA0, 0x00, 0x00, + }, + }, + }, + { + { + { + 0x58, 0x76, 0x5B, 0x53, 0x21, 0x25, 0x54, 0x43, 0x33, 0x48, 0x88, 0x56, + 0x67, 0x6B, 0x87, 0xBC, 0x7C, 0x8C, 0xCC, 0xCC, 0x8C, 0xB0, 0x00, 0x00, + }, + { + 0xCC, 0xCC, 0x6C, 0x4C, 0xCC, 0x12, 0x12, 0x45, 0x53, 0x35, 0x7C, 0xCC, + 0xCC, 0xCC, 0xBB, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xC0, 0x00, 0x00, + }, + { + 0xAA, 0xAA, 0xA4, 0xA1, 0x44, 0x55, 0xA9, 0x9A, 0xAA, 0xA2, 0x22, 0x24, + 0xA5, 0xA4, 0x49, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA0, 0x00, 0x00, + }, + { + 0x99, 0x88, 0x33, 0x88, 0x88, 0x88, 0x88, 0x28, 0x88, 0x88, 0x88, 0x21, + 0x33, 0x88, 0x83, 0x82, 0x88, 0x88, 0x88, 0x88, 0x89, 0x90, 0x00, 0x00, + }, + { + 0x66, 0x56, 0x55, 0x56, 0x65, 0x55, 0x55, 0x56, 0x06, 0x65, 0x55, 0x55, + 0x55, 0x55, 0x55, 0x56, 0x66, 0x66, 0x66, 0x66, 0x66, 0x60, 0x00, 0x00, + }, + { + 0xEE, 0x9D, 0xA6, 0x9D, 0xDA, 0xD9, 0x97, 0x55, 0x42, 0x64, 0x43, 0x32, + 0x24, 0x44, 0x33, 0x44, 0x66, 0x55, 0x58, 0x7D, 0xDD, 0xA0, 0x00, 0x00, + }, + { + 0x88, 0x78, 0x77, 0x78, 0x77, 0x77, 0x77, 0x78, 0x82, 0x07, 0x77, 0x77, + 0x72, 0x27, 0x77, 0x78, 0x87, 0x77, 0x87, 0x88, 0x88, 0x80, 0x00, 0x00, + }, + { + 0xBB, 0xAB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x44, 0x01, 0x3A, 0xAA, + 0x4A, 0x4A, 0x45, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xB0, 0x00, 0x00, + }, + { + 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x89, 0x99, 0x92, 0x39, 0x21, + 0x49, 0x43, 0x33, 0x99, 0x34, 0x39, 0x99, 0x99, 0x99, 0x90, 0x00, 0x00, + }, + { + 0xEE, 0xEE, 0xED, 0xDE, 0xEE, 0xED, 0xDD, 0xDE, 0xEE, 0xEE, 0x97, 0x75, + 0x55, 0x75, 0x20, 0x34, 0x63, 0x26, 0x8E, 0xEE, 0xEE, 0xE0, 0x00, 0x00, + }, + { + 0x69, 0xB8, 0x77, 0x8B, 0x85, 0x56, 0x55, 0x44, 0x65, 0x44, 0x33, 0x32, + 0x23, 0x67, 0xA4, 0x74, 0x45, 0x44, 0x45, 0x68, 0x86, 0x70, 0x00, 0x00, + }, + }, + { + { + 0x67, 0x76, 0x66, 0x54, 0x43, 0x43, 0x33, 0x33, 0x33, 0x33, 0x44, 0x44, + 0x55, 0x66, 0x67, 0x67, 0x77, 0x77, 0x89, 0x89, 0x99, 0x60, 0x00, 0x00, + }, + { + 0xA9, 0x99, 0x99, 0x66, 0x66, 0x43, 0x33, 0x22, 0x22, 0x33, 0x34, 0x57, + 0x78, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFE, 0xE9, 0xE9, 0x87, 0x65, 0x55, 0x44, 0x44, 0x32, 0x22, 0x22, 0x34, + 0x56, 0x79, 0x8E, 0xEA, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xF0, 0x00, 0x00, + }, + { + 0xEE, 0xDE, 0xDD, 0xD8, 0xDD, 0x75, 0x54, 0x54, 0x33, 0x44, 0x31, 0x13, + 0x45, 0x66, 0x88, 0x89, 0x8E, 0xDD, 0xDD, 0xDD, 0xED, 0xE0, 0x00, 0x00, + }, + { + 0xCC, 0xBC, 0xBB, 0xBC, 0xCB, 0x75, 0x65, 0x45, 0x32, 0x24, 0x43, 0x12, + 0x46, 0x54, 0x77, 0xBC, 0xCC, 0xCC, 0xCB, 0xCB, 0xCB, 0xC0, 0x00, 0x00, + }, + { + 0xA9, 0x8B, 0x97, 0x56, 0x88, 0x76, 0x77, 0x66, 0x55, 0x44, 0x33, 0x33, + 0x33, 0x33, 0x33, 0x33, 0x45, 0x56, 0x67, 0x8A, 0xCA, 0xC0, 0x00, 0x00, + }, + { + 0xDD, 0xCD, 0xCC, 0xCD, 0xDC, 0xCC, 0x68, 0x55, 0x53, 0x21, 0x23, 0x33, + 0x33, 0x45, 0x77, 0x67, 0xDD, 0xDD, 0xDD, 0xDC, 0xDC, 0xD0, 0x00, 0x00, + }, + { + 0xEE, 0xDE, 0xDD, 0xDE, 0xE9, 0x8D, 0xD8, 0x67, 0x44, 0x32, 0x22, 0x22, + 0x33, 0x44, 0x46, 0x87, 0xEE, 0xEE, 0xEE, 0xDD, 0xDD, 0xE0, 0x00, 0x00, + }, + { + 0xFF, 0xEF, 0xEE, 0xEF, 0xFE, 0xEE, 0xE9, 0x78, 0x67, 0x54, 0x43, 0x22, + 0x12, 0x35, 0x53, 0x55, 0x56, 0x7A, 0xFE, 0xEE, 0xFE, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0xFB, 0x87, 0x66, 0x54, 0x33, + 0x33, 0x22, 0x22, 0x33, 0x46, 0x67, 0x7A, 0xCF, 0xCF, 0xF0, 0x00, 0x00, + }, + { + 0x67, 0x77, 0x77, 0x66, 0x66, 0x55, 0x55, 0x44, 0x43, 0x44, 0x33, 0x34, + 0x43, 0x44, 0x43, 0x44, 0x44, 0x55, 0x66, 0x76, 0x88, 0x70, 0x00, 0x00, + }, + }, + { + { + 0x78, 0x77, 0x76, 0x66, 0x55, 0x44, 0x44, 0x33, 0x33, 0x22, 0x33, 0x34, + 0x45, 0x67, 0x78, 0x88, 0x88, 0x99, 0x89, 0xA9, 0xA9, 0x70, 0x00, 0x00, + }, + { + 0xA9, 0x9B, 0x99, 0x87, 0x77, 0x54, 0x44, 0x33, 0x22, 0x22, 0x23, 0x45, + 0x67, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFD, 0xAA, 0x98, 0x87, 0x77, 0x65, 0x32, 0x11, 0x23, 0x44, + 0x57, 0x9A, 0xCE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x88, 0x77, 0x65, 0x54, 0x31, 0x11, 0x35, + 0x57, 0x88, 0x8F, 0xDF, 0xFC, 0x9F, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xEF, 0xEE, 0xEF, 0xFE, 0x99, 0x87, 0x77, 0x54, 0x22, 0x11, 0x24, + 0x66, 0x77, 0x78, 0xEA, 0xF9, 0xFF, 0xEE, 0xEE, 0xFE, 0xF0, 0x00, 0x00, + }, + { + 0xAB, 0xAA, 0x97, 0x65, 0x44, 0x45, 0x66, 0x65, 0x54, 0x44, 0x43, 0x33, + 0x33, 0x33, 0x33, 0x44, 0x55, 0x66, 0x78, 0x8B, 0xAB, 0xB0, 0x00, 0x00, + }, + { + 0xEE, 0xDE, 0xED, 0xDE, 0x98, 0x8D, 0xDD, 0x67, 0x66, 0x43, 0x11, 0x22, + 0x34, 0x57, 0x77, 0x8E, 0xEE, 0xEE, 0xEE, 0xED, 0xDD, 0xE0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xEF, 0xFB, 0xFF, 0xBB, 0x98, 0x66, 0x54, 0x31, 0x11, + 0x34, 0x56, 0x98, 0xBF, 0xDC, 0xBF, 0xBF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0xAA, 0x88, 0x66, 0x32, 0x11, + 0x23, 0x35, 0x66, 0x77, 0x99, 0xCE, 0xFE, 0xCD, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xCA, 0xA9, 0x76, 0x54, 0x42, 0x22, + 0x22, 0x33, 0x34, 0x55, 0x56, 0x77, 0x9B, 0xBF, 0xFF, 0xC0, 0x00, 0x00, + }, + { + 0x69, 0x88, 0x77, 0x77, 0x76, 0x65, 0x55, 0x44, 0x43, 0x43, 0x33, 0x33, + 0x33, 0x34, 0x44, 0x44, 0x55, 0x67, 0x77, 0x88, 0x89, 0x70, 0x00, 0x00, + }, + }, + { + { + 0x79, 0x98, 0x87, 0x77, 0x66, 0x55, 0x44, 0x43, 0x33, 0x22, 0x23, 0x33, + 0x45, 0x66, 0x77, 0x88, 0x89, 0x99, 0x9A, 0xA9, 0x99, 0x70, 0x00, 0x00, + }, + { + 0xBB, 0xFB, 0xBA, 0xA9, 0x98, 0x76, 0x65, 0x44, 0x32, 0x21, 0x22, 0x35, + 0x79, 0xAE, 0xCC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xCF, 0xFA, 0xAA, 0x99, 0x88, 0x77, 0x65, 0x33, 0x21, 0x12, 0x44, + 0x57, 0x89, 0xAB, 0xBE, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xBF, 0xDB, 0xA9, 0x99, 0x86, 0x65, 0x41, 0x02, 0x45, + 0x78, 0x89, 0xCA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAB, 0xA9, 0x98, 0x76, 0x52, 0x01, 0x35, + 0x68, 0x89, 0x9E, 0xEF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, + }, + { + 0xDB, 0xCA, 0x98, 0x75, 0x21, 0x46, 0x77, 0x76, 0x66, 0x54, 0x44, 0x44, + 0x33, 0x34, 0x44, 0x45, 0x66, 0x77, 0x89, 0xAC, 0xCB, 0xD0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0x98, 0x77, 0x65, 0x10, 0x23, + 0x56, 0x89, 0xAA, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBB, 0xCA, 0x87, 0x65, 0x30, 0x12, + 0x56, 0x78, 0xA9, 0xBA, 0xFD, 0xCF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xED, 0xAA, 0xA9, 0x97, 0x64, 0x31, 0x12, + 0x23, 0x45, 0x56, 0x78, 0xA9, 0xAC, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFC, 0xCB, 0xA8, 0x65, 0x54, 0x32, 0x12, + 0x23, 0x34, 0x45, 0x56, 0x77, 0x88, 0xAC, 0xDF, 0xDF, 0xE0, 0x00, 0x00, + }, + { + 0x68, 0x98, 0x88, 0x77, 0x77, 0x66, 0x55, 0x54, 0x44, 0x43, 0x32, 0x22, + 0x33, 0x44, 0x55, 0x56, 0x66, 0x77, 0x78, 0x89, 0x99, 0x70, 0x00, 0x00, + }, + }, + { + { + 0x8A, 0xA9, 0x88, 0x87, 0x66, 0x65, 0x54, 0x43, 0x33, 0x22, 0x23, 0x33, + 0x45, 0x55, 0x67, 0x78, 0x88, 0x88, 0x88, 0x99, 0x99, 0x60, 0x00, 0x00, + }, + { + 0xCF, 0xBF, 0xCA, 0xAA, 0x98, 0x87, 0x76, 0x54, 0x33, 0x21, 0x12, 0x45, + 0x78, 0x8A, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xEF, 0xBE, 0xBA, 0x99, 0x77, 0x65, 0x31, 0x02, 0x56, + 0x89, 0x9B, 0xBC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBB, 0x97, 0x76, 0x32, 0x01, 0x46, + 0x88, 0x9B, 0xAB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFC, 0xA8, 0x97, 0x42, 0x01, 0x35, + 0x78, 0x9A, 0xBC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xDC, 0xCB, 0xB9, 0x75, 0x10, 0x47, 0x89, 0x89, 0x88, 0x76, 0x66, 0x55, + 0x55, 0x55, 0x55, 0x66, 0x77, 0x78, 0x9A, 0xAC, 0xFE, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xCA, 0xA9, 0x87, 0x63, 0x10, 0x24, + 0x67, 0x8A, 0xCA, 0xFF, 0xFE, 0xCF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xAA, 0x98, 0x74, 0x20, 0x13, + 0x57, 0x8A, 0x9E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xA9, 0x87, 0x65, 0x30, 0x13, + 0x44, 0x56, 0x78, 0x9A, 0xBE, 0xEF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0x98, 0x65, 0x54, 0x31, 0x12, + 0x33, 0x44, 0x55, 0x67, 0x78, 0x9A, 0xAC, 0xFC, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0x68, 0x88, 0x87, 0x77, 0x77, 0x76, 0x55, 0x54, 0x44, 0x43, 0x32, 0x22, + 0x33, 0x44, 0x45, 0x56, 0x67, 0x78, 0x89, 0x9A, 0xBB, 0x90, 0x00, 0x00, + }, + }, + { + { + 0x8A, 0x99, 0x88, 0x77, 0x76, 0x66, 0x55, 0x43, 0x33, 0x22, 0x22, 0x33, + 0x45, 0x67, 0x77, 0x88, 0x88, 0x99, 0xAA, 0x9A, 0xAA, 0x80, 0x00, 0x00, + }, + { + 0xBC, 0xAA, 0xAB, 0xA9, 0x98, 0x87, 0x66, 0x54, 0x33, 0x21, 0x12, 0x45, + 0x89, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xEF, 0xFC, 0xCC, 0xBA, 0x98, 0x87, 0x65, 0x31, 0x02, 0x56, + 0x79, 0xBB, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFD, 0xBA, 0x98, 0x76, 0x42, 0x01, 0x36, + 0x78, 0x9A, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xBB, 0xA9, 0x87, 0x42, 0x01, 0x35, + 0x78, 0xAB, 0xFB, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xDD, 0xEC, 0xC9, 0x74, 0x10, 0x47, 0x89, 0x99, 0x99, 0x87, 0x76, 0x66, + 0x55, 0x55, 0x55, 0x56, 0x67, 0x78, 0x89, 0xBC, 0xCD, 0xE0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDA, 0x98, 0x63, 0x10, 0x24, + 0x58, 0x9A, 0xBF, 0xEF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xDB, 0x97, 0x74, 0x10, 0x23, + 0x57, 0x9A, 0xAB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCA, 0xA8, 0x65, 0x20, 0x13, + 0x56, 0x77, 0x89, 0x9B, 0xCE, 0xCF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0x9A, 0xAA, 0x76, 0x54, 0x21, 0x12, + 0x34, 0x45, 0x56, 0x66, 0x78, 0x99, 0xAF, 0xEC, 0xEF, 0xB0, 0x00, 0x00, + }, + { + 0x78, 0x88, 0x87, 0x77, 0x66, 0x66, 0x65, 0x55, 0x54, 0x43, 0x22, 0x22, + 0x33, 0x44, 0x55, 0x67, 0x77, 0x88, 0x98, 0x99, 0xAA, 0x80, 0x00, 0x00, + }, + }, + { + { + 0x67, 0x77, 0x86, 0x66, 0x66, 0x65, 0x54, 0x44, 0x33, 0x32, 0x12, 0x34, + 0x57, 0x99, 0xAC, 0x9A, 0xAC, 0xFB, 0xCF, 0xEE, 0xEB, 0xA0, 0x00, 0x00, + }, + { + 0xAA, 0x99, 0x88, 0x87, 0x77, 0x77, 0x66, 0x55, 0x43, 0x21, 0x12, 0x35, + 0x8A, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFA, 0xDA, 0x99, 0x98, 0x77, 0x76, 0x65, 0x53, 0x32, 0x02, 0x45, + 0x67, 0x9A, 0xCF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xCF, 0xFB, 0xBB, 0xE9, 0x87, 0x76, 0x42, 0x01, 0x36, + 0x89, 0xBB, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAA, 0xA9, 0x76, 0x52, 0x01, 0x35, + 0x67, 0x8A, 0x9A, 0xC9, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xEC, 0xCC, 0xA9, 0x74, 0x10, 0x37, 0x88, 0x89, 0x99, 0x88, 0x87, 0x76, + 0x66, 0x55, 0x55, 0x56, 0x77, 0x78, 0xAA, 0xFE, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, 0xBA, 0x87, 0x64, 0x10, 0x24, + 0x46, 0x77, 0xAB, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xCF, 0xFF, 0x88, 0x64, 0x10, 0x24, + 0x46, 0x78, 0x88, 0xAA, 0xBF, 0xCC, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xDC, 0xA7, 0x65, 0x20, 0x14, + 0x55, 0x57, 0x77, 0x88, 0x9A, 0xAA, 0xBB, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF9, 0x97, 0x76, 0x53, 0x21, 0x13, + 0x34, 0x45, 0x55, 0x66, 0x66, 0x77, 0x88, 0xAA, 0xDC, 0xA0, 0x00, 0x00, + }, + { + 0x9D, 0xAC, 0xBA, 0x98, 0x88, 0x77, 0x65, 0x54, 0x54, 0x43, 0x21, 0x23, + 0x34, 0x45, 0x55, 0x66, 0x67, 0x79, 0x99, 0x9D, 0xBB, 0x80, 0x00, 0x00, + }, + }, + { + { + 0x47, 0x7C, 0x65, 0x45, 0x45, 0x45, 0x45, 0x33, 0x43, 0x22, 0x23, 0x44, + 0x57, 0x77, 0xCC, 0xB8, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xC0, 0x00, 0x00, + }, + { + 0x89, 0x88, 0x67, 0x68, 0x67, 0x76, 0x55, 0x55, 0x43, 0x21, 0x12, 0x46, + 0x8E, 0xEA, 0xEE, 0xEF, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xF0, 0x00, 0x00, + }, + { + 0xEE, 0xDE, 0xD9, 0xD8, 0x87, 0x66, 0x64, 0x55, 0x44, 0x42, 0x02, 0x45, + 0x67, 0x8D, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xED, 0xDD, 0xE0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFA, 0xFF, 0xCF, 0xB7, 0x98, 0x66, 0x54, 0x42, 0x01, 0x57, + 0x89, 0xFA, 0xFF, 0xEF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xAA, 0x88, 0x76, 0x42, 0x01, 0x36, + 0x78, 0xFF, 0xFF, 0xEA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xBC, 0xAA, 0xB8, 0x75, 0x10, 0x35, 0x78, 0x88, 0x87, 0x66, 0x66, 0x55, + 0x55, 0x66, 0x77, 0x77, 0x88, 0x99, 0x9A, 0xDB, 0xBB, 0xD0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFD, 0x99, 0x87, 0x65, 0x10, 0x23, + 0x56, 0x78, 0x9E, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xEF, 0xFE, 0xEF, 0xFF, 0xEE, 0xE9, 0xE8, 0x65, 0x54, 0x20, 0x23, + 0x34, 0x67, 0x7A, 0x99, 0x9F, 0xF9, 0xFF, 0xFE, 0xFE, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xEF, 0xEE, 0xEF, 0xFE, 0xEE, 0xE9, 0xEF, 0x87, 0x53, 0x20, 0x23, + 0x55, 0x55, 0x56, 0x68, 0x98, 0x8A, 0x9F, 0xFE, 0xFE, 0xF0, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x8A, 0x77, 0x54, 0x31, 0x23, + 0x44, 0x34, 0x44, 0x44, 0x43, 0x45, 0x57, 0xFA, 0xFB, 0xF0, 0x00, 0x00, + }, + { + 0x7C, 0xB7, 0x8B, 0x76, 0x76, 0x66, 0x55, 0x54, 0x44, 0x43, 0x33, 0x32, + 0x33, 0x44, 0x54, 0x44, 0x44, 0x57, 0x98, 0x87, 0xCB, 0x50, 0x00, 0x00, + }, + }, + { + { + 0x46, 0xAB, 0x6A, 0x6B, 0x65, 0x54, 0x54, 0x32, 0x22, 0x32, 0x43, 0x44, + 0xA4, 0x6A, 0xAA, 0xAB, 0xBB, 0xBB, 0xBB, 0xAA, 0xAA, 0xB0, 0x00, 0x00, + }, + { + 0x67, 0x66, 0x6B, 0x6C, 0x56, 0xB5, 0x55, 0x34, 0x32, 0x21, 0x23, 0x64, + 0xBB, 0xBB, 0xBB, 0xBC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCB, 0xC0, 0x00, 0x00, + }, + { + 0xCC, 0xCC, 0xCC, 0xBC, 0x76, 0x57, 0x55, 0x54, 0x43, 0x21, 0x12, 0x46, + 0x7C, 0xBB, 0xBB, 0xBC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xC0, 0x00, 0x00, + }, + { + 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0x77, 0x43, 0x22, 0x02, 0x57, + 0x8D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD0, 0x00, 0x00, + }, + { + 0xDD, 0xCD, 0xCC, 0xCD, 0xCC, 0xCC, 0xCC, 0xCC, 0x65, 0x42, 0x01, 0x3C, + 0x7C, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDC, 0xD0, 0x00, 0x00, + }, + { + 0xEE, 0x8E, 0xD9, 0x75, 0x10, 0x35, 0x77, 0x66, 0x68, 0x77, 0x66, 0x65, + 0x66, 0x65, 0x66, 0x68, 0x88, 0xEE, 0xAE, 0xED, 0xDD, 0xE0, 0x00, 0x00, + }, + { + 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD8, 0xDD, 0x55, 0x20, 0x14, + 0x56, 0x4D, 0x7D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD0, 0x00, 0x00, + }, + { + 0xCC, 0xCC, 0xCC, 0xBC, 0xCC, 0xCC, 0xCB, 0xBC, 0xC7, 0x63, 0x20, 0x23, + 0x44, 0x55, 0x76, 0x7C, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xC0, 0x00, 0x00, + }, + { + 0xBB, 0xBB, 0xBA, 0xAB, 0xBB, 0xBA, 0xAA, 0xAB, 0xB5, 0xB6, 0x31, 0x22, + 0x34, 0x43, 0x34, 0x54, 0x45, 0x4B, 0xBB, 0xBB, 0xBB, 0xB0, 0x00, 0x00, + }, + { + 0xCC, 0xBC, 0xCB, 0xBC, 0xCB, 0xBB, 0xBB, 0xB7, 0x66, 0x55, 0x42, 0x22, + 0x23, 0x34, 0x43, 0x35, 0x54, 0x55, 0x6C, 0xCB, 0xCB, 0xC0, 0x00, 0x00, + }, + { + 0xCB, 0xBB, 0x6B, 0xB7, 0xBB, 0x6B, 0x65, 0x55, 0x34, 0x33, 0x43, 0x32, + 0x23, 0x34, 0x55, 0x44, 0x46, 0xBB, 0xBB, 0xB6, 0xBB, 0xC0, 0x00, 0x00, + }, + }, + { + { + 0x88, 0x78, 0x71, 0x78, 0x77, 0x77, 0x77, 0x78, 0x27, 0x71, 0x77, 0x17, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x77, 0x88, 0x87, 0x88, 0x80, 0x00, 0x00, + }, + { + 0x99, 0x89, 0x88, 0x89, 0x88, 0x82, 0x88, 0x83, 0x83, 0x12, 0x22, 0x38, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x98, 0x90, 0x00, 0x00, + }, + { + 0x99, 0x89, 0x88, 0x89, 0x88, 0x88, 0x38, 0x89, 0x22, 0x11, 0x28, 0x88, + 0x88, 0x88, 0x88, 0x89, 0x98, 0x88, 0x88, 0x98, 0x98, 0x90, 0x00, 0x00, + }, + { + 0xAA, 0x9A, 0x99, 0x9A, 0x39, 0x99, 0x99, 0x33, 0x99, 0x42, 0x02, 0x99, + 0x99, 0x99, 0x99, 0x9A, 0xA9, 0x99, 0x99, 0x99, 0xA9, 0xA0, 0x00, 0x00, + }, + { + 0xAA, 0x9A, 0x99, 0x9A, 0x99, 0x99, 0x99, 0x9A, 0xA9, 0x92, 0x01, 0x34, + 0x99, 0x99, 0x99, 0x9A, 0xA9, 0x99, 0x9A, 0xA9, 0xA9, 0xA0, 0x00, 0x00, + }, + { + 0xAA, 0xAA, 0xAA, 0xAA, 0x30, 0x4A, 0xAA, 0x9A, 0xAA, 0xA4, 0x43, 0x43, + 0x35, 0x4A, 0x3A, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xA0, 0x00, 0x00, + }, + { + 0xAA, 0x9A, 0x99, 0x9A, 0x99, 0x99, 0x99, 0x9A, 0x99, 0x93, 0x11, 0x13, + 0x34, 0x99, 0x99, 0x9A, 0x99, 0x99, 0x99, 0x99, 0xA9, 0xA0, 0x00, 0x00, + }, + { + 0x99, 0x89, 0x88, 0x89, 0x88, 0x88, 0x88, 0x89, 0x88, 0x88, 0x31, 0x12, + 0x88, 0x18, 0x88, 0x89, 0x98, 0x88, 0x89, 0x99, 0x98, 0x90, 0x00, 0x00, + }, + { + 0x88, 0x78, 0x77, 0x78, 0x77, 0x77, 0x77, 0x78, 0x77, 0x77, 0x71, 0x11, + 0x72, 0x77, 0x77, 0x78, 0x87, 0x77, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, + }, + { + 0xAA, 0x9A, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x99, 0x39, 0x92, 0x21, + 0x19, 0x39, 0x99, 0x94, 0x93, 0x99, 0x99, 0x99, 0xAA, 0xA0, 0x00, 0x00, + }, + { + 0x88, 0x78, 0x77, 0x78, 0x77, 0x77, 0x77, 0x78, 0x77, 0x72, 0x77, 0x72, + 0x17, 0x27, 0x77, 0x78, 0x87, 0x71, 0x78, 0x87, 0x88, 0x80, 0x00, 0x00, + }, + }, + }, +}; + +static const uint8_t short_codes_def[3][15][88] = { + { + { + 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xDD, 0xFC, 0xCD, 0xFF, 0xFF, 0xFF, 0xCC, 0xCB, 0xBC, + 0xDF, 0xFF, 0xFD, 0xDB, 0xC9, 0x69, 0xBC, 0xFF, 0xFC, 0xFF, 0xB9, 0x42, + 0x5A, 0xCD, 0xFF, 0xFD, 0xDC, 0x62, 0x03, 0x9B, 0xCF, 0xFF, 0xFD, 0xC9, + 0x53, 0x4A, 0xCC, 0xFF, 0xFF, 0xFF, 0xBA, 0x9A, 0xBC, 0xFF, 0xFF, 0xFC, + 0xDC, 0xBC, 0xBC, 0xFF, 0xFF, 0xFF, 0xFE, 0xCC, 0xCD, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xDF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCD, 0xFF, + 0xFF, 0xFF, 0xFC, 0xFC, 0xCC, 0xCF, 0xDF, 0xFF, 0xFF, 0xDB, 0xA9, 0x9B, + 0xCF, 0xDF, 0xFF, 0xCB, 0x97, 0x67, 0x9B, 0xFF, 0xFF, 0xDC, 0xA7, 0x42, + 0x47, 0xAD, 0xFF, 0xFF, 0xC9, 0x63, 0x03, 0x69, 0xBF, 0xFF, 0xFC, 0xA7, + 0x53, 0x47, 0xAC, 0xDF, 0xFD, 0xDC, 0x97, 0x77, 0x8C, 0xBD, 0xFF, 0xFF, + 0xCC, 0xAA, 0xAB, 0xCF, 0xFF, 0xFF, 0xFF, 0xCC, 0xCC, 0xCF, 0xFF, 0xFF, + 0xFF, 0xFE, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xDC, 0xFF, 0xDF, + 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB9, 0xAF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x96, 0x56, 0x9F, 0xFF, 0xFF, 0xFF, 0xA6, 0x43, + 0x47, 0xEF, 0xFF, 0xFF, 0xF9, 0x53, 0x03, 0x6A, 0xFF, 0xFF, 0xFF, 0xA6, + 0x43, 0x46, 0xAF, 0xFF, 0xFF, 0xFF, 0x96, 0x56, 0x9F, 0xFF, 0xFF, 0xFF, + 0xFF, 0xC9, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFD, 0xDD, 0xFF, 0xFF, 0xFD, 0xFF, 0xFD, 0xFD, 0xFF, + 0xFF, 0xFF, 0xFF, 0xDD, 0xDB, 0xBC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFA, 0x43, + 0x6B, 0xFF, 0xDF, 0xFF, 0xFD, 0xA3, 0x02, 0xAD, 0xFF, 0xFF, 0xFD, 0xFB, + 0x52, 0x3A, 0xDF, 0xFF, 0xFF, 0xFF, 0xCB, 0xAA, 0xCE, 0xFF, 0xDF, 0xFF, + 0xFE, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, 0xFD, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xCF, 0xCC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xCC, 0xCA, + 0xFF, 0xCF, 0xFB, 0xAA, 0xAA, 0xCF, 0xCB, 0xFC, 0xFF, 0xAA, 0xA9, 0x99, + 0xAC, 0xBF, 0xFC, 0xA9, 0x98, 0x88, 0x99, 0xAA, 0xCF, 0xCA, 0xA8, 0x53, + 0x58, 0x9F, 0xCC, 0xCC, 0xB9, 0x73, 0x02, 0x68, 0xAC, 0xCF, 0xCA, 0x98, + 0x53, 0x37, 0x9B, 0xAC, 0xFB, 0xAA, 0x97, 0x78, 0x8A, 0xFB, 0xFF, 0xFA, + 0xBB, 0x99, 0x9A, 0xAB, 0xFF, 0xFF, 0xEB, 0xBA, 0xAA, 0xAC, 0xCB, 0xFF, + 0xBF, 0xBC, 0xBC, 0xCF, 0xFF, 0xFF, 0xCF, 0xFC, 0xFC, 0xFF, 0xFF, 0xCF, + 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFD, 0xFC, 0xFF, + 0xFF, 0xFF, 0xFC, 0xAB, 0xBA, 0xFC, 0xFF, 0xFF, 0xFF, 0xA9, 0x77, 0x78, + 0xAF, 0xFF, 0xFF, 0xA8, 0x65, 0x45, 0x68, 0xFF, 0xFC, 0xFB, 0x74, 0x33, + 0x35, 0x7B, 0xFF, 0xFF, 0xB7, 0x43, 0x23, 0x46, 0xAF, 0xFF, 0xCB, 0x75, + 0x33, 0x35, 0x7A, 0xCC, 0xFF, 0xF8, 0x65, 0x45, 0x68, 0xAC, 0xCF, 0xCC, + 0xA8, 0x77, 0x78, 0xBF, 0xFF, 0xFF, 0xFF, 0xB9, 0x99, 0xFC, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDA, 0xFC, 0xFF, + 0xFF, 0xFC, 0xFB, 0x9A, 0x99, 0xBA, 0xFF, 0xFF, 0xFB, 0x97, 0x77, 0x77, + 0x9C, 0xCF, 0xFC, 0x98, 0x65, 0x45, 0x68, 0xAF, 0xFF, 0xC9, 0x75, 0x33, + 0x35, 0x79, 0xFF, 0xFB, 0x86, 0x43, 0x23, 0x47, 0x9F, 0xFF, 0xC9, 0x75, + 0x33, 0x35, 0x7B, 0xBF, 0xFF, 0xA8, 0x65, 0x45, 0x68, 0xAF, 0xFF, 0xFA, + 0xA8, 0x77, 0x78, 0x9B, 0xFF, 0xFF, 0xFF, 0xFB, 0x99, 0xBB, 0xFF, 0xFF, + 0xFF, 0xFE, 0xCE, 0xFF, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBB, 0xBC, 0xEF, + 0xFF, 0xFF, 0xDB, 0x99, 0x89, 0xAC, 0xDF, 0xFF, 0xDB, 0x97, 0x66, 0x67, + 0x9C, 0xFF, 0xEC, 0x97, 0x65, 0x45, 0x67, 0xAC, 0xFF, 0xB9, 0x65, 0x33, + 0x35, 0x69, 0xBF, 0xFB, 0x86, 0x43, 0x33, 0x46, 0x9B, 0xEE, 0xB9, 0x65, + 0x33, 0x35, 0x69, 0xBE, 0xFD, 0xA7, 0x65, 0x45, 0x67, 0xAC, 0xDF, 0xDB, + 0x97, 0x66, 0x67, 0x9B, 0xDF, 0xFF, 0xDC, 0xA9, 0x89, 0x9B, 0xCF, 0xFF, + 0xFF, 0xDC, 0xBB, 0xBC, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xEF, 0xFF, + 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xBB, 0xFF, + 0xFF, 0xFF, 0xFF, 0xAA, 0x99, 0xAB, 0xFF, 0xFF, 0xFA, 0x98, 0x76, 0x67, + 0xAC, 0xCF, 0xFA, 0xA7, 0x64, 0x45, 0x67, 0x9B, 0xFF, 0xF8, 0x74, 0x33, + 0x34, 0x68, 0xAF, 0xFB, 0x96, 0x43, 0x33, 0x46, 0x8B, 0xFF, 0xF9, 0x75, + 0x43, 0x35, 0x69, 0xBF, 0xCC, 0x98, 0x65, 0x45, 0x67, 0x9A, 0xBF, 0xFF, + 0x98, 0x66, 0x68, 0x8F, 0xFF, 0xFF, 0xFF, 0x98, 0x88, 0xAF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xBA, 0xBA, 0xBE, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, + 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF, + 0xFF, 0xAA, 0xFF, 0xF9, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x88, 0x7F, + 0xAF, 0xFA, 0xFF, 0xF8, 0x75, 0x55, 0x79, 0xFF, 0xFF, 0xF9, 0x75, 0x32, + 0x34, 0x8A, 0xFF, 0xFF, 0xB8, 0x43, 0x22, 0x58, 0xFF, 0xFF, 0xCF, 0x95, + 0x33, 0x46, 0x7A, 0xFF, 0xFA, 0xFF, 0x75, 0x46, 0x79, 0xFA, 0xFF, 0xAF, + 0xF9, 0x89, 0x8A, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xAA, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFA, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFA, 0xFF, 0xFA, + 0x90, 0x00, 0x00, 0x00, + }, + { + 0xBC, 0xBA, 0xAA, 0x99, 0xAA, 0xBD, 0xBB, 0xBA, 0x99, 0x88, 0x89, 0x9B, + 0xCC, 0xBA, 0x98, 0x77, 0x77, 0x78, 0x9A, 0xBA, 0x98, 0x76, 0x65, 0x66, + 0x78, 0xAB, 0xA8, 0x76, 0x55, 0x45, 0x56, 0x79, 0xA9, 0x87, 0x55, 0x44, + 0x44, 0x67, 0x8A, 0x98, 0x75, 0x44, 0x44, 0x45, 0x68, 0x9A, 0x87, 0x65, + 0x44, 0x45, 0x67, 0x8A, 0xA9, 0x76, 0x55, 0x45, 0x56, 0x79, 0xAB, 0x98, + 0x76, 0x55, 0x56, 0x78, 0x9A, 0xBA, 0x98, 0x77, 0x77, 0x78, 0x9A, 0xCD, + 0xCB, 0xA9, 0x88, 0x89, 0xAA, 0xBB, 0xDD, 0xCA, 0xA9, 0x9A, 0xAB, 0xCC, + 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xCA, 0xAA, 0xAA, 0xAB, 0xCE, 0xDC, 0xCB, 0xA9, 0x88, 0x89, 0x9B, + 0xCD, 0xBB, 0x98, 0x87, 0x77, 0x78, 0xAB, 0xDA, 0xA8, 0x76, 0x65, 0x66, + 0x78, 0xAC, 0xA9, 0x76, 0x55, 0x44, 0x56, 0x79, 0xAA, 0x97, 0x65, 0x44, + 0x44, 0x67, 0x9A, 0xA8, 0x75, 0x44, 0x34, 0x45, 0x79, 0x9A, 0x87, 0x65, + 0x44, 0x45, 0x67, 0x9A, 0xB9, 0x76, 0x55, 0x45, 0x56, 0x79, 0xAB, 0xA8, + 0x76, 0x65, 0x66, 0x78, 0xBB, 0xCB, 0xA8, 0x77, 0x77, 0x78, 0xAB, 0xBD, + 0xCB, 0xA9, 0x98, 0x99, 0xAA, 0xCD, 0xFD, 0xFB, 0xAA, 0xAB, 0xAB, 0xCC, + 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xCD, 0xCB, 0xAA, 0xAA, 0xAB, 0xCE, 0xED, 0xCB, 0xA9, 0x88, 0x89, 0xAB, + 0xCE, 0xCB, 0x98, 0x77, 0x77, 0x78, 0x9B, 0xCB, 0xA8, 0x76, 0x65, 0x56, + 0x78, 0xAB, 0xA9, 0x76, 0x55, 0x45, 0x56, 0x79, 0xBA, 0x87, 0x55, 0x44, + 0x45, 0x57, 0x8A, 0xA8, 0x75, 0x44, 0x34, 0x45, 0x78, 0xAA, 0x87, 0x65, + 0x44, 0x45, 0x67, 0x8A, 0xA9, 0x76, 0x55, 0x45, 0x56, 0x79, 0xAB, 0xA8, + 0x76, 0x65, 0x66, 0x78, 0xAB, 0xCB, 0x98, 0x77, 0x77, 0x78, 0x9B, 0xCD, + 0xCB, 0xA9, 0x88, 0x89, 0xAB, 0xCD, 0xED, 0xCB, 0xAA, 0xAA, 0xAB, 0xCD, + 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xCD, 0xCB, 0xB9, 0xAA, 0xBB, 0xFF, 0xDD, 0xCB, 0xA9, 0x89, 0x89, 0x9B, + 0xEF, 0xBB, 0xA8, 0x77, 0x77, 0x78, 0x9B, 0xFC, 0xA8, 0x76, 0x55, 0x56, + 0x78, 0xAB, 0xB9, 0x76, 0x55, 0x45, 0x56, 0x79, 0xBB, 0x97, 0x65, 0x44, + 0x44, 0x57, 0x8A, 0xA8, 0x75, 0x44, 0x44, 0x45, 0x68, 0xAA, 0x87, 0x65, + 0x44, 0x45, 0x57, 0x9A, 0xB9, 0x76, 0x55, 0x45, 0x56, 0x79, 0xBB, 0x98, + 0x76, 0x55, 0x66, 0x78, 0xAB, 0xFB, 0xA8, 0x77, 0x77, 0x78, 0xAB, 0xBD, + 0xFB, 0xA9, 0x88, 0x89, 0xAC, 0xCC, 0xBC, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, + 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xAB, 0xA9, 0xAA, 0xAB, 0xCC, 0xDC, 0xBA, 0x98, 0x88, 0x88, 0x9A, + 0xBD, 0xBA, 0x98, 0x77, 0x77, 0x78, 0x9B, 0xCA, 0xA8, 0x76, 0x65, 0x56, + 0x78, 0xAB, 0xA9, 0x76, 0x55, 0x45, 0x56, 0x79, 0xBA, 0x87, 0x55, 0x44, + 0x45, 0x57, 0x89, 0x98, 0x75, 0x44, 0x44, 0x45, 0x68, 0x9A, 0x87, 0x55, + 0x44, 0x45, 0x57, 0x89, 0xA8, 0x76, 0x55, 0x55, 0x56, 0x79, 0xAB, 0xA8, + 0x76, 0x55, 0x56, 0x78, 0x9A, 0xCB, 0xA8, 0x77, 0x77, 0x78, 0x9B, 0xDC, + 0xCB, 0xA9, 0x88, 0x89, 0x9A, 0xBD, 0xCB, 0xCB, 0xA9, 0xA9, 0xAA, 0xBB, + 0xB0, 0x00, 0x00, 0x00, + }, + }, + { + { + 0xAF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFB, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xA9, 0xAF, + 0xFF, 0xFF, 0xFF, 0xFB, 0x96, 0x56, 0x9F, 0xFF, 0xFF, 0xFF, 0xA6, 0x32, + 0x36, 0xAF, 0xFF, 0xFF, 0xF9, 0x63, 0x12, 0x6A, 0xFF, 0xFF, 0xFF, 0x96, + 0x33, 0x36, 0xBF, 0xFF, 0xFF, 0xFF, 0x96, 0x56, 0x9A, 0xFF, 0xFF, 0xFF, + 0xFF, 0xDA, 0x9A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0x56, 0xFC, 0xCF, 0xFF, 0xFF, 0xF6, 0x32, + 0x39, 0xFF, 0xFF, 0xFF, 0xF8, 0x62, 0x12, 0x6F, 0xFF, 0xFF, 0xFF, 0xF6, + 0x43, 0x37, 0xFF, 0xFF, 0xFF, 0xFF, 0xA6, 0x58, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEA, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x96, 0x56, 0x9F, 0xFF, 0xFF, 0xFF, 0xB6, 0x43, + 0x36, 0xFF, 0xFF, 0xFF, 0xFB, 0x62, 0x12, 0x5B, 0xFF, 0xFF, 0xFF, 0xD6, + 0x42, 0x36, 0xFF, 0xFF, 0xFF, 0xFF, 0x96, 0x56, 0x9F, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFA, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x43, + 0x5F, 0xFF, 0xFF, 0xFF, 0xFF, 0xA3, 0x11, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x61, 0x3E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x8A, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x53, + 0x5E, 0xFF, 0xFF, 0xFF, 0xFF, 0x93, 0x11, 0x8F, 0xFF, 0xFF, 0xFF, 0xFE, + 0x51, 0x39, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x88, 0xCF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0x00, 0x00, 0x00, + }, + { + 0x77, 0x67, 0x76, 0x67, 0x77, 0x66, 0x66, 0x67, 0x77, 0x77, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x70, 0x00, 0x00, 0x00, + }, + { + 0x77, 0x67, 0x76, 0x67, 0x77, 0x66, 0x66, 0x67, 0x77, 0x77, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x70, 0x00, 0x00, 0x00, + }, + { + 0x77, 0x67, 0x76, 0x67, 0x77, 0x66, 0x66, 0x67, 0x77, 0x77, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x70, 0x00, 0x00, 0x00, + }, + { + 0x77, 0x67, 0x76, 0x67, 0x77, 0x66, 0x66, 0x67, 0x77, 0x77, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x70, 0x00, 0x00, 0x00, + }, + { + 0x77, 0x67, 0x76, 0x67, 0x77, 0x66, 0x66, 0x67, 0x77, 0x77, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x70, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xBB, 0xAA, 0xAA, 0xAC, 0xDE, 0xCB, 0xBA, 0xA9, 0x98, 0x99, 0xAB, + 0xDE, 0xBA, 0x98, 0x77, 0x77, 0x78, 0xAB, 0xEA, 0xA8, 0x76, 0x65, 0x66, + 0x79, 0xAC, 0xA9, 0x86, 0x54, 0x44, 0x56, 0x79, 0xAA, 0x87, 0x65, 0x44, + 0x45, 0x57, 0x9A, 0xA9, 0x75, 0x44, 0x34, 0x45, 0x78, 0x9A, 0x87, 0x65, + 0x44, 0x45, 0x67, 0x9A, 0xB9, 0x86, 0x55, 0x45, 0x56, 0x89, 0xAC, 0xA8, + 0x76, 0x65, 0x66, 0x78, 0x9A, 0xCC, 0xA8, 0x87, 0x77, 0x89, 0x9B, 0xBF, + 0xDB, 0xA9, 0x98, 0x99, 0x9B, 0xBC, 0xDF, 0xCB, 0xAA, 0xB9, 0xAB, 0xBB, + 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xBC, 0xCB, 0xAA, 0x9A, 0xAB, 0xCE, 0xCD, 0xCB, 0x99, 0x88, 0x89, 0x9B, + 0xCD, 0xCA, 0x98, 0x77, 0x67, 0x78, 0x9B, 0xCB, 0xA8, 0x76, 0x65, 0x56, + 0x78, 0xAB, 0xA9, 0x76, 0x55, 0x45, 0x56, 0x79, 0xAA, 0x87, 0x65, 0x44, + 0x45, 0x57, 0x8A, 0x98, 0x65, 0x44, 0x44, 0x45, 0x78, 0xAA, 0x87, 0x55, + 0x44, 0x45, 0x57, 0x8A, 0xA9, 0x76, 0x55, 0x45, 0x56, 0x79, 0xAB, 0xA8, + 0x76, 0x55, 0x66, 0x78, 0x9B, 0xCB, 0xA8, 0x77, 0x67, 0x78, 0x9B, 0xCD, + 0xDB, 0xA9, 0x88, 0x89, 0x9B, 0xCD, 0xDC, 0xDB, 0xAA, 0xA9, 0xAB, 0xBE, + 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xBC, 0xBB, 0xAA, 0xAA, 0xAB, 0xCD, 0xDC, 0xCB, 0x99, 0x88, 0x89, 0xAB, + 0xCD, 0xBB, 0x98, 0x77, 0x77, 0x78, 0x9B, 0xCB, 0xA8, 0x76, 0x55, 0x56, + 0x78, 0xAB, 0xA9, 0x76, 0x55, 0x44, 0x56, 0x79, 0xAA, 0x87, 0x65, 0x44, + 0x45, 0x57, 0x8A, 0xA8, 0x75, 0x44, 0x44, 0x45, 0x68, 0xAA, 0x87, 0x55, + 0x44, 0x45, 0x67, 0x89, 0xA9, 0x76, 0x55, 0x45, 0x56, 0x79, 0xAB, 0xA8, + 0x76, 0x65, 0x66, 0x78, 0xAA, 0xCB, 0x98, 0x77, 0x77, 0x78, 0x9A, 0xBD, + 0xCB, 0xA9, 0x88, 0x89, 0xAB, 0xBB, 0xDD, 0xCB, 0xAA, 0x9A, 0xAA, 0xBB, + 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xEC, 0xBA, 0xAA, 0xBD, 0xEF, 0xDD, 0xCB, 0xA9, 0x99, 0x9A, 0xBD, + 0xCF, 0xDB, 0x98, 0x77, 0x77, 0x88, 0xAC, 0xDE, 0xA9, 0x76, 0x55, 0x66, + 0x79, 0x9F, 0xB9, 0x86, 0x55, 0x45, 0x56, 0x89, 0xBB, 0x97, 0x65, 0x44, + 0x45, 0x67, 0x9B, 0xB8, 0x75, 0x44, 0x34, 0x45, 0x79, 0xAA, 0x97, 0x64, + 0x44, 0x45, 0x57, 0x9B, 0xC9, 0x86, 0x55, 0x44, 0x56, 0x79, 0xBC, 0xA8, + 0x76, 0x55, 0x66, 0x79, 0xBF, 0xFC, 0xA8, 0x87, 0x77, 0x78, 0xAA, 0xFF, + 0xFC, 0xAA, 0x99, 0x99, 0xAC, 0xCF, 0xFF, 0xCB, 0xBA, 0xAB, 0xBC, 0xBE, + 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xBC, 0xBB, 0xBB, 0x9B, 0xBB, 0xFE, 0xCD, 0xCC, 0xA9, 0x99, 0x99, 0xAC, + 0xED, 0xCC, 0xA8, 0x87, 0x77, 0x88, 0xAB, 0xCB, 0xA8, 0x76, 0x56, 0x66, + 0x79, 0xBC, 0xA9, 0x86, 0x55, 0x44, 0x56, 0x79, 0xCA, 0x97, 0x65, 0x44, + 0x44, 0x67, 0x8A, 0xA9, 0x75, 0x44, 0x34, 0x45, 0x79, 0xBB, 0x97, 0x64, + 0x44, 0x45, 0x67, 0x9A, 0xB9, 0x86, 0x54, 0x45, 0x56, 0x89, 0xBC, 0xA9, + 0x76, 0x66, 0x66, 0x79, 0xAC, 0xFC, 0xA8, 0x87, 0x77, 0x79, 0x9B, 0xDE, + 0xDC, 0xA9, 0x99, 0x9A, 0xAB, 0xBD, 0xBD, 0xDB, 0xBA, 0xAA, 0xBB, 0xCD, + 0xB0, 0x00, 0x00, 0x00, + }, + }, + { + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0x7F, 0xFC, 0xAF, 0xFF, 0xFF, 0xF6, 0x32, + 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x63, 0x5F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xBF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xCC, 0xCF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0x99, 0xBB, + 0xFF, 0xFF, 0xFC, 0xBB, 0x86, 0x56, 0x9B, 0xFF, 0xFF, 0xFB, 0xA7, 0x42, + 0x36, 0xAF, 0xFF, 0xFF, 0xF9, 0x62, 0x13, 0x59, 0xFF, 0xFF, 0xFF, 0xA6, + 0x32, 0x47, 0xAF, 0xEF, 0xFF, 0xFF, 0x96, 0x57, 0x9A, 0xCC, 0xFF, 0xFF, + 0xFB, 0xAA, 0xAA, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xBF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0x99, 0x9B, + 0xFF, 0xFF, 0xFF, 0xFA, 0x86, 0x56, 0x8B, 0xFF, 0xFF, 0xFF, 0xA6, 0x42, + 0x36, 0xAF, 0xFF, 0xFF, 0xF9, 0x52, 0x13, 0x58, 0xFF, 0xFF, 0xFF, 0xA5, + 0x33, 0x36, 0x9F, 0xFF, 0xFF, 0xFE, 0x86, 0x56, 0x8B, 0xFF, 0xFF, 0xFF, + 0xFE, 0xA8, 0x9A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x77, 0x7F, + 0xFF, 0xFF, 0xFF, 0xFF, 0x75, 0x45, 0x68, 0xCF, 0xFF, 0xFF, 0xB5, 0x43, + 0x35, 0x8F, 0xFF, 0xFF, 0xF8, 0x43, 0x23, 0x57, 0xCF, 0xFF, 0xFF, 0xA5, + 0x32, 0x34, 0x8F, 0xFF, 0xFF, 0xFF, 0x64, 0x44, 0x6F, 0xFF, 0xFF, 0xFF, + 0xFF, 0x87, 0x98, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, 0xAF, 0xFF, 0xFF, 0xFF, 0xF3, + 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF4, 0x02, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x52, 0x37, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8F, 0xFF, 0xFF, + 0xF0, 0x00, 0x00, 0x00, + }, + { + 0x8F, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x88, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8F, 0xF8, 0x67, 0x87, + 0xFF, 0xFF, 0xFF, 0xF8, 0x76, 0x54, 0x77, 0xEF, 0xFF, 0xFF, 0x84, 0x33, + 0x35, 0x7F, 0xFF, 0xF8, 0x86, 0x53, 0x23, 0x57, 0xFF, 0xFF, 0xFF, 0x65, + 0x33, 0x35, 0x78, 0xFF, 0xFF, 0xF8, 0x55, 0x44, 0x58, 0xEE, 0xEE, 0xFE, + 0xFE, 0x67, 0x88, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFC, 0xCC, 0xFC, 0xFF, 0xFF, 0xFF, 0xBC, 0xA9, 0xA9, 0xCF, + 0xFF, 0xFC, 0xBA, 0x98, 0x77, 0x89, 0xBF, 0xFF, 0xB9, 0x87, 0x66, 0x67, + 0x8A, 0xCF, 0xBA, 0x87, 0x65, 0x44, 0x67, 0x9F, 0xFB, 0xA8, 0x65, 0x43, + 0x45, 0x69, 0xCF, 0xEA, 0x76, 0x43, 0x33, 0x46, 0x8F, 0xFC, 0xA8, 0x65, + 0x43, 0x34, 0x68, 0xAF, 0xF9, 0x97, 0x64, 0x44, 0x57, 0xAF, 0xFF, 0xFA, + 0x97, 0x66, 0x67, 0x9C, 0xFF, 0xFF, 0xFB, 0xA9, 0x99, 0x9B, 0xFF, 0xFF, + 0xFF, 0xFF, 0xCB, 0xCC, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, 0xDC, 0xCD, 0xCF, 0xFF, + 0xFF, 0xCC, 0xCB, 0xA9, 0x9A, 0xBC, 0xFF, 0xFD, 0xDB, 0xA8, 0x76, 0x78, + 0xAD, 0xFF, 0xDC, 0xA8, 0x65, 0x45, 0x68, 0xBF, 0xFE, 0xCA, 0x75, 0x33, + 0x35, 0x7A, 0xCF, 0xFC, 0xA6, 0x43, 0x23, 0x47, 0x9C, 0xFF, 0xC9, 0x75, + 0x33, 0x35, 0x79, 0xCE, 0xFD, 0xB8, 0x65, 0x45, 0x68, 0xAC, 0xDF, 0xFC, + 0xA8, 0x76, 0x78, 0xAB, 0xDF, 0xFF, 0xFD, 0xBA, 0x99, 0xAB, 0xCF, 0xFF, + 0xFF, 0xFD, 0xDD, 0xCD, 0xDF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, + 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x9D, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xAF, 0x77, 0x8A, + 0xFF, 0xFF, 0xFF, 0xF9, 0x75, 0x45, 0x68, 0xFF, 0xFF, 0xFF, 0x84, 0x33, + 0x35, 0x9A, 0xFF, 0xFF, 0xF6, 0x43, 0x23, 0x47, 0xFF, 0xFF, 0xFF, 0x75, + 0x33, 0x35, 0x7A, 0xFF, 0xFF, 0xF8, 0x64, 0x45, 0x69, 0xFF, 0xFF, 0xFF, + 0x97, 0x86, 0x78, 0x9F, 0xFF, 0xFF, 0xAF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xDF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, + 0xF0, 0x00, 0x00, 0x00, + }, + { + 0x77, 0x67, 0x76, 0x67, 0x77, 0x66, 0x66, 0x67, 0x77, 0x77, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x70, 0x00, 0x00, 0x00, + }, + { + 0x77, 0x67, 0x76, 0x67, 0x77, 0x66, 0x66, 0x67, 0x77, 0x77, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x70, 0x00, 0x00, 0x00, + }, + { + 0xEE, 0xDD, 0xDD, 0xDD, 0x5D, 0xDD, 0x4D, 0xDD, 0xDD, 0xD6, 0xDD, 0xD5, + 0xDD, 0xDD, 0x5D, 0xDD, 0x6D, 0xDD, 0xDD, 0xD5, 0xDD, 0xDD, 0xD6, 0xDD, + 0xDD, 0x6D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD6, 0xDD, 0xDD, 0xD6, + 0xD5, 0xDD, 0x5D, 0x6D, 0x55, 0xDD, 0x0D, 0x55, 0x65, 0xDD, 0x5D, 0xDD, + 0x66, 0xDD, 0xDD, 0xDD, 0xDD, 0xD5, 0xD5, 0x5D, 0x5D, 0xD6, 0xDD, 0xDD, + 0xDD, 0xDD, 0xD6, 0xD5, 0x6D, 0x6D, 0x6D, 0xD4, 0x6D, 0xDD, 0xDD, 0xDD, + 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0x55, 0xD6, 0xDD, 0xDE, + 0xE0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0x9B, 0xA9, 0x9B, 0xAC, 0xCC, 0xFA, 0xBA, 0xBB, 0xA9, 0xAA, 0xBF, + 0xFF, 0xAA, 0xAA, 0x98, 0x88, 0x88, 0xAD, 0xF9, 0x99, 0x88, 0x76, 0x66, + 0x79, 0xAA, 0x99, 0x98, 0x75, 0x54, 0x56, 0x8F, 0xFA, 0xA9, 0x75, 0x43, + 0x34, 0x68, 0xAB, 0xBA, 0x86, 0x53, 0x33, 0x56, 0x8A, 0xBC, 0xB8, 0x64, + 0x33, 0x45, 0x79, 0xAC, 0xCB, 0x86, 0x54, 0x55, 0x67, 0x8A, 0xAC, 0xCA, + 0x76, 0x67, 0x78, 0x89, 0xBB, 0xFF, 0xB9, 0x78, 0x88, 0x9A, 0xBB, 0x9F, + 0xFD, 0xF9, 0xAB, 0x9A, 0xAB, 0xAA, 0xFF, 0xFC, 0xFA, 0xAB, 0x99, 0xAA, + 0x80, 0x00, 0x00, 0x00, + }, + { + 0xCC, 0xBC, 0xBB, 0xBC, 0xBB, 0xBB, 0xBB, 0xBC, 0xCB, 0xBB, 0xBB, 0xBB, + 0xBB, 0xBB, 0xBB, 0xBC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xB4, 0xBB, + 0xBB, 0xBB, 0xBB, 0xB4, 0x44, 0xB4, 0x2B, 0xBC, 0xCC, 0xCB, 0xBB, 0x33, + 0x4B, 0xBB, 0xBB, 0xBB, 0xB4, 0xBB, 0x44, 0x3B, 0xBB, 0xBB, 0xBB, 0xBB, + 0xB3, 0xB4, 0xBB, 0xBB, 0xBB, 0xBB, 0xB4, 0x44, 0x3B, 0xBB, 0xBB, 0xBB, + 0xB4, 0xB3, 0xBB, 0xBC, 0xCC, 0xCC, 0xCC, 0xCB, 0xB4, 0xBB, 0xBB, 0xBB, + 0xBB, 0xBB, 0xBB, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCB, 0xCC, 0xCC, + 0xC0, 0x00, 0x00, 0x00, + }, + { + 0x77, 0x67, 0x76, 0x67, 0x77, 0x66, 0x66, 0x67, 0x77, 0x77, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x76, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x67, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x70, 0x00, 0x00, 0x00, + }, + }, +}; + +static const uint8_t long_codes_def[3][125][224] = { + { + { + 0xBE, 0xED, 0xDD, 0xDD, 0xDD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, + 0xFE, 0xED, 0xDD, 0xCC, 0xDE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFE, 0xED, 0xDC, + 0xCB, 0xCB, 0xBB, 0xCC, 0xDE, 0xEF, 0xFF, 0xFE, 0xED, 0xDC, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xDD, 0xFF, 0xFF, 0xFE, 0xDC, 0xBB, 0xA9, 0x99, 0x99, + 0x99, 0xAB, 0xCD, 0xEF, 0xFE, 0xEC, 0xCB, 0xA9, 0x88, 0x87, 0x78, 0x89, + 0xAB, 0xCD, 0xFF, 0xFE, 0xCB, 0xA9, 0x87, 0x77, 0x66, 0x77, 0x89, 0xAB, + 0xDE, 0xFD, 0xDC, 0xAA, 0x87, 0x76, 0x65, 0x66, 0x67, 0x89, 0xBC, 0xEF, + 0xDD, 0xBA, 0x98, 0x76, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xED, 0xDC, + 0xA9, 0x87, 0x65, 0x54, 0x45, 0x56, 0x79, 0xAC, 0xDD, 0xDD, 0xCA, 0x98, + 0x65, 0x54, 0x44, 0x55, 0x67, 0x9A, 0xBD, 0xDE, 0xEB, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x66, 0x89, 0xAB, 0xDD, 0xED, 0xCA, 0x98, 0x76, 0x55, 0x55, + 0x56, 0x78, 0x9A, 0xCC, 0xDE, 0xFC, 0xBA, 0x87, 0x76, 0x65, 0x66, 0x77, + 0x89, 0xBB, 0xDD, 0xFE, 0xDB, 0xA9, 0x87, 0x76, 0x67, 0x77, 0x89, 0xAB, + 0xCD, 0xDF, 0xEF, 0xCB, 0xA9, 0x88, 0x87, 0x88, 0x89, 0xAB, 0xCC, 0xED, + 0xFF, 0xED, 0xCB, 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xEF, 0xFF, + 0xFD, 0xDB, 0xBA, 0xAA, 0xAA, 0xAB, 0xCC, 0xDE, 0xFD, 0xFF, 0xFF, 0xFD, + 0xDC, 0xCC, 0xBC, 0xCC, 0xDC, 0xDE, 0xEF, 0xEF, 0xFF, 0xFF, 0xFF, 0xDE, + 0xDD, 0xCD, 0xDD, 0xEE, 0xFF, 0xFE, 0xDF, 0xFF, 0xFF, 0xEF, 0xDD, 0xDD, + 0xDD, 0xDD, 0xDD, 0xFD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xCD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xEF, 0xFF, 0xFF, 0xCF, 0xFE, + 0xDC, 0xDC, 0xCC, 0xBB, 0xCC, 0xCC, 0xDE, 0xEF, 0xFF, 0xEE, 0xDD, 0xCC, + 0xCB, 0xBA, 0xAA, 0xBB, 0xBC, 0xDD, 0xFF, 0xDC, 0xDD, 0xCB, 0xBA, 0xA9, + 0x99, 0x9A, 0x9A, 0xBC, 0xDF, 0xFF, 0xBD, 0xDB, 0xBA, 0x99, 0x88, 0x88, + 0x88, 0x9A, 0xBC, 0xEF, 0xDD, 0xCC, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x89, + 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x67, 0x78, 0x9A, + 0xCC, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x65, 0x66, 0x67, 0x88, 0xAB, 0xCC, + 0xCC, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x67, 0x89, 0xBC, 0xCC, 0xCA, + 0x98, 0x76, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xCC, 0xBB, 0xA9, 0x87, + 0x66, 0x55, 0x55, 0x56, 0x67, 0x89, 0xAC, 0xBC, 0xCA, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCC, 0xB9, 0x87, 0x66, 0x55, 0x55, + 0x56, 0x77, 0x89, 0xAB, 0xCD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x67, + 0x89, 0xAB, 0xBD, 0xDF, 0xCA, 0x98, 0x87, 0x76, 0x66, 0x77, 0x89, 0x9A, + 0xBC, 0xCF, 0xDD, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x88, 0x9A, 0xBC, 0xDD, + 0xFF, 0xDC, 0xBA, 0x99, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBC, 0xDF, 0xFF, + 0xDC, 0xBA, 0xAA, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xFF, 0xFF, 0xEC, + 0xBB, 0xBA, 0xAA, 0xAB, 0xBB, 0xDC, 0xDF, 0xDF, 0xFF, 0xFD, 0xEE, 0xCC, + 0xBC, 0xBB, 0xCC, 0xDD, 0xCE, 0xFE, 0xCF, 0xFF, 0xDD, 0xDD, 0xCD, 0xDC, + 0xCB, 0xBD, 0xCD, 0xDD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEF, 0xFF, 0xDD, 0xEE, + 0xDD, 0xCD, 0xCC, 0xCC, 0xCC, 0xCD, 0xDF, 0xFF, 0xFF, 0xDE, 0xDD, 0xCC, + 0xBB, 0xBB, 0xBA, 0xBB, 0xCD, 0xDE, 0xFF, 0xFD, 0xDD, 0xCC, 0xBA, 0xAA, + 0x99, 0x9A, 0xAA, 0xBC, 0xDE, 0xFF, 0xCD, 0xCB, 0xBA, 0x99, 0x98, 0x88, + 0x89, 0x9A, 0xBC, 0xDF, 0xED, 0xCC, 0xBA, 0x98, 0x88, 0x77, 0x77, 0x88, + 0x9A, 0xBC, 0xDE, 0xCC, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x67, 0x78, 0x9A, + 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x76, 0x65, 0x56, 0x67, 0x89, 0xAB, 0xCC, + 0xCC, 0xBA, 0x98, 0x76, 0x55, 0x55, 0x56, 0x67, 0x89, 0xBC, 0xCC, 0xCA, + 0x98, 0x76, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCC, 0xCC, 0xB9, 0x87, + 0x65, 0x55, 0x45, 0x56, 0x67, 0x89, 0xAC, 0xCC, 0xCB, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x66, 0x78, 0x9B, 0xCC, 0xCC, 0xBA, 0x87, 0x76, 0x55, 0x55, + 0x56, 0x78, 0x99, 0xBC, 0xCD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x77, + 0x89, 0xAB, 0xCC, 0xDD, 0xCB, 0x98, 0x87, 0x76, 0x66, 0x77, 0x89, 0x9B, + 0xBC, 0xCE, 0xED, 0xBA, 0x98, 0x87, 0x77, 0x78, 0x89, 0x9A, 0xBC, 0xDC, + 0xEE, 0xDC, 0xBA, 0x99, 0x88, 0x88, 0x99, 0x9A, 0xBC, 0xCD, 0xCF, 0xFE, + 0xDD, 0xBB, 0xAA, 0x99, 0x9A, 0xAA, 0xBC, 0xCC, 0xDC, 0xFF, 0xFE, 0xDC, + 0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xDF, 0xFF, 0xFF, 0xED, 0xCC, + 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xFD, 0xDF, 0xFF, 0xED, 0xDD, 0xDC, 0xCC, + 0xCC, 0xCC, 0xCC, 0xDD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xCD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDF, 0xFF, 0xFF, 0xDD, 0xFF, + 0xDF, 0xEC, 0xCC, 0xDC, 0xCD, 0xDD, 0xDF, 0xFF, 0xFF, 0xEE, 0xCC, 0xCC, + 0xBB, 0xBB, 0xBB, 0xAC, 0xCC, 0xEF, 0xEF, 0xFD, 0xDD, 0xCC, 0xBB, 0xAA, + 0x99, 0x9A, 0xAB, 0xBC, 0xDF, 0xFF, 0xDD, 0xCB, 0xBA, 0x99, 0x98, 0x88, + 0x89, 0x9A, 0xBC, 0xDD, 0xFC, 0xDB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x88, + 0x9A, 0xBC, 0xED, 0xBC, 0xBA, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x88, 0x9A, + 0xBD, 0xDD, 0xCB, 0xA9, 0x87, 0x66, 0x65, 0x56, 0x67, 0x89, 0xAC, 0xCE, + 0xCC, 0xBA, 0x98, 0x76, 0x55, 0x55, 0x56, 0x67, 0x8A, 0xBC, 0xDC, 0xDB, + 0xA9, 0x76, 0x65, 0x55, 0x55, 0x56, 0x78, 0xAA, 0xCC, 0xCC, 0xB9, 0x87, + 0x66, 0x55, 0x45, 0x55, 0x67, 0x89, 0xBC, 0xCC, 0xDB, 0xA8, 0x76, 0x65, + 0x55, 0x55, 0x66, 0x78, 0x9B, 0xCC, 0xCC, 0xBA, 0x97, 0x66, 0x55, 0x55, + 0x56, 0x78, 0x9A, 0xBC, 0xCF, 0xDC, 0xA9, 0x87, 0x66, 0x65, 0x66, 0x77, + 0x89, 0xAB, 0xCC, 0xFD, 0xCB, 0xA8, 0x87, 0x76, 0x66, 0x77, 0x89, 0xAB, + 0xBC, 0xCF, 0xFD, 0xCB, 0x99, 0x87, 0x77, 0x78, 0x89, 0xAA, 0xCC, 0xCC, + 0xFF, 0xDC, 0xBA, 0xA9, 0x98, 0x88, 0x99, 0x9A, 0xBC, 0xDD, 0xCF, 0xFE, + 0xDD, 0xBB, 0xAA, 0xA9, 0xAA, 0xAA, 0xBB, 0xBD, 0xDC, 0xFF, 0xFF, 0xDD, + 0xBC, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xFE, 0xCF, 0xFF, 0xFD, 0xFD, 0xDD, + 0xDC, 0xCC, 0xCC, 0xDD, 0xDE, 0xFE, 0xCF, 0xFF, 0xDD, 0xCD, 0xDD, 0xCC, + 0xCD, 0xCC, 0xCD, 0xCD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xBF, 0xEE, 0xDD, 0xDD, 0xCD, 0xDD, 0xDD, 0xEF, 0xFF, 0xFF, 0xDE, 0xFF, + 0xFD, 0xED, 0xDD, 0xCC, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEF, 0xDD, + 0xCC, 0xCB, 0xBB, 0xCC, 0xDE, 0xFF, 0xFF, 0xFE, 0xFD, 0xDC, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCD, 0xDF, 0xFF, 0xFF, 0xDC, 0xBA, 0xA9, 0x99, 0x89, + 0x99, 0xAB, 0xCD, 0xFF, 0xFD, 0xDD, 0xCA, 0xA9, 0x88, 0x87, 0x78, 0x89, + 0xAB, 0xCD, 0xFF, 0xDE, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x77, 0x89, 0xAB, + 0xDF, 0xFE, 0xDC, 0xA9, 0x87, 0x76, 0x65, 0x56, 0x67, 0x89, 0xAC, 0xEF, + 0xED, 0xCA, 0x98, 0x76, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xED, 0xDB, + 0xA9, 0x76, 0x65, 0x54, 0x55, 0x56, 0x79, 0xAB, 0xCE, 0xDD, 0xBA, 0x87, + 0x66, 0x54, 0x44, 0x55, 0x67, 0x9A, 0xBD, 0xDD, 0xDB, 0xA9, 0x86, 0x65, + 0x54, 0x55, 0x66, 0x79, 0xAB, 0xCD, 0xDD, 0xCA, 0x98, 0x76, 0x55, 0x55, + 0x56, 0x78, 0x9A, 0xCD, 0xDF, 0xFC, 0xB9, 0x87, 0x66, 0x65, 0x66, 0x77, + 0x89, 0xBC, 0xDD, 0xFF, 0xDC, 0xA9, 0x87, 0x76, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xDF, 0xFF, 0xCB, 0xA9, 0x88, 0x87, 0x78, 0x89, 0xAB, 0xBC, 0xED, + 0xFF, 0xFD, 0xCB, 0xA9, 0x99, 0x99, 0x99, 0xAB, 0xBC, 0xDF, 0xEF, 0xFF, + 0xED, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xCC, 0xCD, 0xED, 0xFF, 0xFF, 0xFD, + 0xDC, 0xCB, 0xBC, 0xCC, 0xCD, 0xDE, 0xEF, 0xEF, 0xFF, 0xFF, 0xFF, 0xED, + 0xDE, 0xDD, 0xDE, 0xDD, 0xDF, 0xFF, 0xBF, 0xFF, 0xEF, 0xDF, 0xED, 0xDC, + 0xDD, 0xDD, 0xDE, 0xED, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xBC, 0xDC, + 0xCC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDD, 0xBC, 0xCB, 0xBA, + 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCD, 0xDB, 0xCB, 0xAA, 0xA9, 0x98, + 0x88, 0x88, 0x99, 0x9A, 0xBB, 0xCC, 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88, + 0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBB, 0xAB, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x67, 0x78, 0x89, + 0xAB, 0xAA, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA, + 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xAA, 0xA9, + 0x88, 0x76, 0x66, 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xAA, 0x98, 0x87, + 0x66, 0x65, 0x55, 0x56, 0x67, 0x88, 0x9A, 0xAA, 0xA9, 0x88, 0x76, 0x66, + 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x88, 0x9A, 0xAA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x78, 0x99, 0xAA, 0xBA, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x77, 0x78, 0x89, + 0xAB, 0xAB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0xAA, 0xBA, + 0xBC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBC, 0xCB, + 0xBA, 0x99, 0x98, 0x88, 0x89, 0x99, 0x9A, 0xAB, 0xCB, 0xCC, 0xCB, 0xBA, + 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBD, 0xDD, 0xCB, 0xBB, 0xAA, + 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDC, 0xBD, 0xCC, 0xBB, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAB, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBB, 0xAA, 0xAA, 0x9A, 0x9A, 0xAA, 0xAB, 0xBB, 0xCD, 0xBB, 0xCC, + 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDC, 0xBC, 0xBB, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xCA, 0xBB, 0xAA, 0x99, 0x98, + 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCB, 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x77, + 0x88, 0x89, 0x9A, 0xAB, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBA, 0xAA, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x67, 0x78, 0x89, + 0xAA, 0xAA, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x66, 0x67, 0x78, 0x89, 0xAA, + 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xA9, 0xA9, + 0x88, 0x76, 0x66, 0x65, 0x66, 0x66, 0x77, 0x89, 0xAA, 0xAA, 0x98, 0x77, + 0x66, 0x65, 0x55, 0x66, 0x67, 0x78, 0x9A, 0x99, 0xA9, 0x88, 0x76, 0x66, + 0x65, 0x66, 0x66, 0x78, 0x89, 0xA9, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x88, 0x9A, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x78, 0x89, 0xAA, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89, + 0xAA, 0xAB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, 0x89, 0x9A, 0xAA, + 0xBB, 0xBA, 0x99, 0x88, 0x87, 0x78, 0x88, 0x89, 0x9A, 0xAB, 0xAB, 0xCB, + 0xAA, 0x99, 0x98, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xBA, 0xCC, 0xCB, 0xAA, + 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xBD, 0xDC, 0xCC, 0xBA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDB, 0xBD, 0xCC, 0xBA, 0xAA, 0xA9, 0x99, + 0xAA, 0xAA, 0xAB, 0xBB, 0x90, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBB, 0xAA, 0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xBB, 0xDC, + 0xBB, 0xAA, 0xAA, 0x99, 0x9A, 0xAA, 0xBB, 0xBC, 0xDD, 0xBC, 0xBB, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCB, 0xBB, 0xAA, 0x99, 0x88, + 0x88, 0x88, 0x89, 0x99, 0xAB, 0xBB, 0xAB, 0xAA, 0x99, 0x88, 0x87, 0x77, + 0x78, 0x88, 0x99, 0xAB, 0xBA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, + 0x88, 0x9A, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x76, 0x66, 0x67, 0x77, 0x89, + 0x9A, 0xAA, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x66, 0x67, 0x78, 0x89, 0xAA, + 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, 0x66, 0x77, 0x78, 0x99, 0x99, 0x99, + 0x87, 0x76, 0x66, 0x66, 0x66, 0x66, 0x77, 0x89, 0x99, 0x99, 0x98, 0x77, + 0x66, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0x99, 0xA9, 0x87, 0x76, 0x66, + 0x66, 0x66, 0x66, 0x77, 0x89, 0x99, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x88, 0x9A, 0x9A, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x78, 0x89, 0xA9, 0xAA, 0x99, 0x88, 0x77, 0x76, 0x66, 0x77, 0x78, 0x89, + 0x9A, 0xAA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, 0x89, 0x9A, 0xBA, + 0xBB, 0xAA, 0x98, 0x88, 0x87, 0x77, 0x88, 0x89, 0x9A, 0xAB, 0xAB, 0xBB, + 0xA9, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBB, 0xCC, 0xBB, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xBC, 0xDC, 0xBB, 0xBA, 0xAA, + 0x99, 0xAA, 0xAA, 0xBB, 0xBC, 0xCB, 0xBC, 0xCB, 0xBA, 0xAA, 0x99, 0x99, + 0x99, 0xAA, 0xAA, 0xBB, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0xCD, 0xBB, 0xCC, + 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDC, 0xBC, 0xBB, 0xAA, + 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xBB, 0xBC, 0xCB, 0xBB, 0xAA, 0x99, 0x98, + 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x78, + 0x88, 0x88, 0x9A, 0xAB, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBB, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x66, 0x77, 0x78, 0x89, + 0x9A, 0xAA, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x66, 0x67, 0x78, 0x89, 0xAA, + 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0x99, 0xA9, + 0x88, 0x76, 0x66, 0x65, 0x66, 0x66, 0x77, 0x89, 0xA9, 0x9A, 0x98, 0x77, + 0x66, 0x65, 0x55, 0x66, 0x67, 0x88, 0x9A, 0x99, 0xA9, 0x88, 0x76, 0x66, + 0x55, 0x66, 0x66, 0x78, 0x89, 0xA9, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x88, 0x9A, 0x9A, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x78, 0x99, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x77, 0x78, 0x89, + 0xAA, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, 0x89, 0x9A, 0xBA, + 0xBB, 0xAA, 0x99, 0x88, 0x87, 0x77, 0x88, 0x89, 0x9A, 0xAB, 0xAB, 0xBB, + 0xAA, 0x99, 0x98, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCB, 0xCD, 0xCB, 0xAA, + 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xBD, 0xDC, 0xCB, 0xBA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDB, 0xBC, 0xCB, 0xBA, 0xAA, 0x9A, 0x99, + 0x99, 0xAA, 0xAA, 0xBB, 0x90, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xCC, 0xDC, + 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xED, 0xBC, 0xCB, 0xAA, + 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xCB, 0xCB, 0xAA, 0x99, 0x98, + 0x88, 0x88, 0x99, 0x9A, 0xBB, 0xCC, 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x78, + 0x88, 0x89, 0x9A, 0xBC, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, + 0x89, 0xAA, 0xBB, 0xAA, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x77, 0x78, 0x89, + 0xAA, 0xBA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA, + 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA, 0xA9, + 0x88, 0x76, 0x66, 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xAA, 0x98, 0x87, + 0x66, 0x65, 0x55, 0x66, 0x67, 0x88, 0x9A, 0xAA, 0xA9, 0x88, 0x76, 0x66, + 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x88, 0x9A, 0xAA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67, + 0x78, 0x99, 0xAA, 0xAB, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x77, 0x78, 0x89, + 0xAA, 0xAB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, 0x89, 0x9A, 0xBA, + 0xBC, 0xBA, 0x99, 0x88, 0x88, 0x78, 0x88, 0x89, 0x9A, 0xBB, 0xBC, 0xCB, + 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCB, 0xDD, 0xCB, 0xBA, + 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xCD, 0xED, 0xCB, 0xBB, 0xAA, + 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDC, 0xBD, 0xDC, 0xBB, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xBF, 0xEE, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, + 0xFE, 0xED, 0xDD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFE, 0xDD, + 0xCC, 0xCB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFE, 0xFE, 0xDC, 0xCB, 0xBA, + 0xAA, 0xAB, 0xBC, 0xDD, 0xFF, 0xFF, 0xEE, 0xDD, 0xBB, 0xA9, 0x99, 0x99, + 0x9A, 0xBC, 0xDE, 0xFF, 0xFD, 0xDC, 0xBB, 0xA9, 0x88, 0x77, 0x88, 0x99, + 0xAC, 0xDF, 0xFF, 0xDD, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x78, 0x8A, 0xBC, + 0xEF, 0xFD, 0xDC, 0xB9, 0x87, 0x66, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xFF, + 0xDD, 0xBA, 0x98, 0x76, 0x55, 0x45, 0x56, 0x78, 0xAB, 0xDE, 0xFD, 0xDB, + 0xA9, 0x76, 0x55, 0x44, 0x45, 0x67, 0x89, 0xBC, 0xEF, 0xED, 0xBA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x78, 0x9B, 0xCD, 0xEE, 0xDC, 0xA9, 0x86, 0x55, + 0x44, 0x55, 0x67, 0x89, 0xBC, 0xDD, 0xEE, 0xCB, 0x98, 0x76, 0x55, 0x55, + 0x66, 0x78, 0xAB, 0xCE, 0xEF, 0xFD, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x78, + 0x9A, 0xCD, 0xEE, 0xFF, 0xDC, 0xBA, 0x88, 0x77, 0x77, 0x78, 0x9A, 0xBC, + 0xDF, 0xEF, 0xFF, 0xDC, 0xBA, 0x98, 0x88, 0x89, 0x9A, 0xBC, 0xCD, 0xEF, + 0xFF, 0xFE, 0xDC, 0xBA, 0xA9, 0x99, 0xAA, 0xBB, 0xCD, 0xEF, 0xEF, 0xFF, + 0xFE, 0xDC, 0xCB, 0xBB, 0xBB, 0xBC, 0xDD, 0xEF, 0xFE, 0xFF, 0xFF, 0xFE, + 0xDD, 0xDC, 0xCC, 0xCD, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, + 0xEF, 0xEE, 0xEE, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF, 0xFF, 0xFE, 0xED, + 0xDE, 0xEE, 0xEF, 0xEF, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAD, 0xCD, 0xCB, 0xBC, 0xCB, 0xCC, 0xCD, 0xDD, 0xDE, 0xEF, 0xBD, 0xDE, + 0xDD, 0xCC, 0xCC, 0xCC, 0xDC, 0xDD, 0xFF, 0xFF, 0xFF, 0xDD, 0xDD, 0xCB, + 0xBB, 0xBB, 0xBB, 0xBB, 0xDD, 0xEF, 0xEF, 0xDD, 0xDC, 0xCC, 0xBB, 0xAA, + 0xA9, 0xAA, 0xBB, 0xCC, 0xFF, 0xFE, 0xCD, 0xCC, 0xAA, 0x99, 0x98, 0x88, + 0x99, 0xAB, 0xCE, 0xFE, 0xCC, 0xCB, 0xBA, 0x98, 0x88, 0x77, 0x77, 0x89, + 0xAB, 0xCD, 0xFE, 0xCD, 0xBB, 0x99, 0x87, 0x76, 0x66, 0x77, 0x89, 0xAC, + 0xDE, 0xDC, 0xDB, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x67, 0x8A, 0xBC, 0xFD, + 0xCC, 0xBA, 0x98, 0x76, 0x55, 0x55, 0x56, 0x78, 0x9B, 0xCD, 0xDC, 0xCB, + 0x99, 0x76, 0x55, 0x44, 0x45, 0x67, 0x89, 0xAB, 0xDD, 0xCC, 0xBA, 0x87, + 0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xCD, 0xDC, 0xCB, 0xA8, 0x76, 0x65, + 0x54, 0x55, 0x67, 0x89, 0xAB, 0xDC, 0xCD, 0xBA, 0x98, 0x76, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xBD, 0xCD, 0xEC, 0xB9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x9A, 0xBB, 0xDC, 0xDE, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCD, 0xCE, 0xFD, 0xCB, 0xA9, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xCC, 0xDD, + 0xEF, 0xFD, 0xDB, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDD, 0xDF, 0xFD, + 0xFD, 0xCC, 0xBB, 0xAA, 0xAA, 0xBB, 0xBC, 0xDD, 0xFC, 0xEF, 0xEF, 0xED, + 0xDD, 0xCC, 0xBC, 0xBC, 0xCC, 0xED, 0xEE, 0xDF, 0xFF, 0xFF, 0xFD, 0xED, + 0xDC, 0xDC, 0xDD, 0xDD, 0xDD, 0xED, 0xBE, 0xDD, 0xDD, 0xDD, 0xDC, 0xDC, + 0xCD, 0xCC, 0xCC, 0xDD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEF, 0xFF, 0xDD, 0xFE, + 0xDD, 0xCC, 0xCC, 0xCB, 0xCC, 0xDD, 0xDE, 0xFF, 0xFF, 0xDE, 0xDD, 0xCB, + 0xBA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDE, 0xFF, 0xFD, 0xDD, 0xCB, 0xAA, 0xA9, + 0x99, 0x99, 0xAB, 0xBC, 0xEF, 0xFF, 0xCD, 0xCB, 0xAA, 0x98, 0x88, 0x88, + 0x89, 0x9A, 0xBC, 0xDE, 0xEC, 0xCB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x88, + 0x9A, 0xBC, 0xEE, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x67, 0x89, 0xAB, + 0xCD, 0xEC, 0xCA, 0x99, 0x87, 0x66, 0x55, 0x56, 0x67, 0x89, 0xAB, 0xDD, + 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xBA, + 0x98, 0x76, 0x55, 0x55, 0x55, 0x66, 0x78, 0xAB, 0xCD, 0xCB, 0xA9, 0x87, + 0x65, 0x55, 0x45, 0x56, 0x67, 0x8A, 0xBC, 0xCC, 0xCA, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x79, 0xAB, 0xCC, 0xCC, 0xB9, 0x87, 0x76, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xBC, 0xDD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x77, + 0x89, 0xAB, 0xCC, 0xDD, 0xCB, 0x99, 0x87, 0x76, 0x67, 0x77, 0x89, 0xAB, + 0xCD, 0xDE, 0xDD, 0xBA, 0x99, 0x88, 0x77, 0x88, 0x89, 0xAA, 0xBC, 0xDD, + 0xEF, 0xDC, 0xBA, 0xA9, 0x98, 0x88, 0x99, 0xAA, 0xBC, 0xDD, 0xDF, 0xFF, + 0xDC, 0xCB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xED, 0xFF, 0xFE, 0xDC, + 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xEF, 0xEF, 0xFF, 0xFF, 0xED, 0xDC, + 0xCC, 0xCC, 0xCD, 0xDE, 0xEE, 0xFE, 0xDF, 0xFF, 0xFE, 0xED, 0xDD, 0xDC, + 0xCD, 0xDD, 0xDD, 0xEE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xBE, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEF, 0xEF, 0xCD, 0xFD, + 0xED, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xEE, 0xFF, 0xFF, 0xDE, 0xDC, 0xCB, + 0xBB, 0xBA, 0xAB, 0xBB, 0xCC, 0xDD, 0xFF, 0xFD, 0xDD, 0xCB, 0xAA, 0xA9, + 0x99, 0x9A, 0xAB, 0xBC, 0xDE, 0xFE, 0xCD, 0xCB, 0xBA, 0x99, 0x88, 0x88, + 0x89, 0xAA, 0xBD, 0xEF, 0xDC, 0xDC, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x89, + 0x9A, 0xCD, 0xFD, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x67, 0x89, 0xAC, 0xDD, + 0xCC, 0xB9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xCC, 0xCA, + 0x98, 0x76, 0x55, 0x54, 0x55, 0x67, 0x79, 0xAB, 0xDD, 0xCB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x67, 0x8A, 0xBC, 0xCC, 0xCB, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xCC, 0xBA, 0x97, 0x76, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xBC, 0xCD, 0xDB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x77, + 0x89, 0xAB, 0xDC, 0xDD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCD, 0xDD, 0xED, 0xBA, 0xA9, 0x88, 0x77, 0x88, 0x89, 0x9B, 0xBC, 0xDD, + 0xDE, 0xDC, 0xBB, 0xA9, 0x99, 0x99, 0x99, 0xAB, 0xBC, 0xCE, 0xCF, 0xFE, + 0xDC, 0xCB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xED, 0xFF, 0xEE, 0xED, + 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCE, 0xEE, 0xDF, 0xFF, 0xFF, 0xED, 0xDD, + 0xDC, 0xCC, 0xCD, 0xDD, 0xFE, 0xFE, 0xBF, 0xFE, 0xDD, 0xDD, 0xCD, 0xCC, + 0xDD, 0xCC, 0xDD, 0xEE, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xBF, 0xFF, 0xFE, 0xEE, 0xEE, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, + 0xFF, 0xEE, 0xDD, 0xDD, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xED, + 0xCC, 0xCB, 0xCC, 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFE, 0xDC, 0xCB, 0xBA, + 0xAA, 0xAB, 0xBC, 0xDF, 0xFF, 0xFF, 0xEE, 0xDC, 0xBB, 0xA9, 0x99, 0x99, + 0x9A, 0xBC, 0xDF, 0xFF, 0xFE, 0xED, 0xCB, 0xA9, 0x88, 0x77, 0x88, 0x9A, + 0xBC, 0xDF, 0xFF, 0xEE, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x78, 0x8A, 0xBC, + 0xEF, 0xFD, 0xDC, 0xB9, 0x87, 0x66, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xFF, + 0xDD, 0xCA, 0x98, 0x76, 0x55, 0x45, 0x56, 0x78, 0xAB, 0xDF, 0xFE, 0xDC, + 0xA9, 0x76, 0x55, 0x44, 0x45, 0x67, 0x89, 0xBC, 0xEF, 0xED, 0xCA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x78, 0x9B, 0xCE, 0xEE, 0xDC, 0xA9, 0x76, 0x55, + 0x44, 0x55, 0x67, 0x89, 0xBC, 0xEE, 0xEE, 0xCB, 0x98, 0x76, 0x55, 0x55, + 0x66, 0x78, 0xAB, 0xCE, 0xEF, 0xFD, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x78, + 0x9A, 0xBD, 0xEF, 0xFF, 0xEC, 0xB9, 0x98, 0x77, 0x77, 0x78, 0x9A, 0xBC, + 0xDF, 0xFF, 0xFF, 0xDC, 0xBA, 0x98, 0x88, 0x88, 0x9A, 0xBB, 0xDE, 0xFF, + 0xFF, 0xFE, 0xDC, 0xBA, 0xA9, 0x99, 0xAA, 0xBB, 0xCD, 0xFF, 0xFF, 0xFF, + 0xFE, 0xEC, 0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xED, 0xDC, 0xCC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, + 0xEE, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xEE, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xBB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDE, 0xBC, 0xDD, + 0xCB, 0xBB, 0xBA, 0xAA, 0xBB, 0xBB, 0xCC, 0xDD, 0xED, 0xCC, 0xCB, 0xBA, + 0xAA, 0xA9, 0x99, 0xAA, 0xBB, 0xCC, 0xDE, 0xDB, 0xCB, 0xBA, 0xA9, 0x99, + 0x99, 0x99, 0x9A, 0xAB, 0xCD, 0xDC, 0xBC, 0xBA, 0xA9, 0x98, 0x88, 0x88, + 0x88, 0x99, 0xAB, 0xCD, 0xCB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xAB, 0xCC, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x67, 0x78, 0x9A, + 0xBC, 0xCA, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67, 0x89, 0x9A, 0xBB, + 0xAA, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xBA, 0xA9, + 0x98, 0x76, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBB, 0xAA, 0x99, 0x87, + 0x66, 0x55, 0x55, 0x56, 0x67, 0x89, 0xAB, 0xBB, 0xA9, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, 0x66, 0x65, 0x55, + 0x66, 0x78, 0x89, 0xAB, 0xBB, 0xBA, 0x98, 0x87, 0x66, 0x66, 0x66, 0x77, + 0x89, 0xAA, 0xBB, 0xBB, 0xAA, 0x98, 0x87, 0x77, 0x67, 0x77, 0x88, 0x9A, + 0xBB, 0xBC, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x78, 0x88, 0x9A, 0xAB, 0xCB, + 0xCC, 0xCB, 0xAA, 0x99, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBC, 0xBD, 0xDC, + 0xCB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDC, 0xDE, 0xED, 0xCB, + 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xCD, 0xEE, 0xDD, 0xCC, 0xBB, + 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xDC, 0xAE, 0xDD, 0xCC, 0xBB, 0xBB, 0xBB, + 0xBB, 0xBB, 0xBC, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBA, 0xAA, 0xAA, 0xA9, 0xAA, 0xAA, 0xBB, 0xBC, 0xDC, 0xAB, 0xCB, + 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xED, 0xBB, 0xBB, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xCD, 0xDA, 0xBA, 0xAA, 0x99, 0x98, + 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xCC, 0xAB, 0xAA, 0x99, 0x88, 0x87, 0x77, + 0x88, 0x89, 0xAA, 0xBC, 0xCA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x89, 0xAB, 0xBB, 0xAA, 0x99, 0x88, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89, + 0xAB, 0xBA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xBA, + 0x9A, 0x98, 0x87, 0x66, 0x66, 0x56, 0x66, 0x77, 0x89, 0xAB, 0xAA, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x66, 0x78, 0x99, 0xAA, 0xAA, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x67, 0x89, 0x9A, 0xAA, 0xA9, 0x88, 0x76, 0x66, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0xAA, 0x99, 0x87, 0x66, 0x66, 0x66, + 0x66, 0x77, 0x89, 0x9A, 0xAA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xBA, 0xBB, 0xA9, 0x88, 0x77, 0x76, 0x67, 0x77, 0x88, 0x99, + 0xAB, 0xAB, 0xBA, 0xA9, 0x88, 0x87, 0x77, 0x77, 0x88, 0x89, 0xAA, 0xBA, + 0xBB, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xAC, 0xDB, + 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xCD, 0xCC, 0xBB, + 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xBC, 0xED, 0xDC, 0xBB, 0xBA, + 0xAA, 0xAA, 0xBA, 0xBB, 0xCC, 0xCC, 0xAC, 0xCC, 0xCB, 0xBB, 0xAA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBB, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBB, 0xCC, + 0xBA, 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xDC, 0xBB, 0xBA, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xCA, 0xBA, 0xA9, 0x99, 0x88, + 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77, + 0x88, 0x89, 0x9A, 0xAB, 0xBA, 0xAA, 0x98, 0x88, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBA, 0x9A, 0x99, 0x87, 0x77, 0x66, 0x66, 0x67, 0x78, 0x89, + 0xAA, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA, + 0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99, + 0x87, 0x76, 0x66, 0x55, 0x66, 0x66, 0x78, 0x89, 0xA9, 0x99, 0x98, 0x77, + 0x66, 0x65, 0x56, 0x66, 0x77, 0x88, 0x9A, 0x99, 0x99, 0x87, 0x76, 0x66, + 0x66, 0x66, 0x67, 0x78, 0x89, 0xA9, 0x99, 0x98, 0x77, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x88, 0x9A, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x88, 0x99, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x67, 0x77, 0x78, 0x89, + 0xAA, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0x9A, 0xBA, + 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xAB, 0xBB, + 0xAA, 0x99, 0x98, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xBB, 0xCC, 0xCB, 0xAA, + 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xBC, 0xDC, 0xCB, 0xBA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xCB, 0xBC, 0xCB, 0xBB, 0xAA, 0xAA, 0x99, + 0x9A, 0xAA, 0xAB, 0xBB, 0x90, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBB, 0xAA, 0xAA, 0xA9, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xAB, 0xDC, + 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xEC, 0xBC, 0xBB, 0xAA, + 0xA9, 0x99, 0x99, 0x99, 0xAB, 0xBC, 0xCD, 0xCB, 0xBB, 0xAA, 0x99, 0x88, + 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xCC, 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x78, + 0x88, 0x89, 0xAA, 0xBC, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, + 0x89, 0xAA, 0xBB, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x78, 0x99, + 0xAB, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xBA, + 0x9A, 0x98, 0x87, 0x66, 0x65, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x66, 0x78, 0x99, 0xAA, 0xAA, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x67, 0x89, 0x9A, 0xAA, 0xA9, 0x88, 0x76, 0x66, + 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0xAA, 0x99, 0x87, 0x66, 0x66, 0x66, + 0x66, 0x77, 0x89, 0xAB, 0xAA, 0xAA, 0x98, 0x77, 0x76, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xBA, 0xAB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xAB, 0xBA, 0xA9, 0x88, 0x87, 0x77, 0x77, 0x88, 0x99, 0xAB, 0xBA, + 0xBC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xBB, 0xCB, + 0xBA, 0xA9, 0x99, 0x98, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xCD, 0xCB, 0xBA, + 0xAA, 0xAA, 0x99, 0x9A, 0xAA, 0xBB, 0xCD, 0xCD, 0xED, 0xDC, 0xBB, 0xBB, + 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDC, 0xAC, 0xCC, 0xBB, 0xBA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xBB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0xCC, 0xCE, 0xAC, 0xDD, + 0xCB, 0xBB, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xFE, 0xBC, 0xCB, 0xBA, + 0xAA, 0x99, 0x9A, 0xAA, 0xAB, 0xCC, 0xDE, 0xDB, 0xCB, 0xBA, 0xA9, 0x99, + 0x98, 0x99, 0x9A, 0xAB, 0xCC, 0xDD, 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88, + 0x88, 0x99, 0xAB, 0xCD, 0xCB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x99, 0xAB, 0xCC, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x67, 0x78, 0x9A, + 0xBC, 0xCA, 0xAA, 0x98, 0x77, 0x66, 0x65, 0x66, 0x67, 0x88, 0x9A, 0xBB, + 0xAA, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xBA, 0xA9, + 0x88, 0x76, 0x65, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0x99, 0x87, + 0x66, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xBA, 0xAA, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x55, + 0x66, 0x78, 0x89, 0xAB, 0xBB, 0xBA, 0x98, 0x87, 0x66, 0x66, 0x66, 0x77, + 0x89, 0x9A, 0xBB, 0xBB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xBB, 0xBC, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x78, 0x88, 0x9A, 0xAB, 0xCB, + 0xCC, 0xCB, 0xA9, 0x99, 0x88, 0x88, 0x89, 0x99, 0xAB, 0xBC, 0xBD, 0xDC, + 0xCB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDC, 0xDE, 0xDC, 0xCB, + 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xCE, 0xFE, 0xDC, 0xCC, 0xBB, + 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xEC, 0xBE, 0xDC, 0xCC, 0xCB, 0xBB, 0xBB, + 0xBB, 0xBB, 0xBC, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xED, 0xDE, 0xDD, 0xDD, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xBE, 0xFF, + 0xEE, 0xDD, 0xDD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xED, 0xDC, + 0xCC, 0xBC, 0xCC, 0xCD, 0xEE, 0xFF, 0xFF, 0xFD, 0xED, 0xCC, 0xBB, 0xAA, + 0xAA, 0xAB, 0xBC, 0xDF, 0xFF, 0xFF, 0xDD, 0xDC, 0xBA, 0x99, 0x98, 0x99, + 0x9A, 0xBC, 0xDF, 0xFF, 0xFD, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A, + 0xBC, 0xEF, 0xFF, 0xDD, 0xCB, 0x98, 0x87, 0x66, 0x66, 0x78, 0x9A, 0xBD, + 0xEF, 0xFD, 0xDC, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9B, 0xCD, 0xFF, + 0xDD, 0xBA, 0x97, 0x66, 0x54, 0x45, 0x56, 0x79, 0xAC, 0xDE, 0xFE, 0xDB, + 0xA9, 0x76, 0x55, 0x44, 0x45, 0x67, 0x8A, 0xBD, 0xFF, 0xDD, 0xCA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCE, 0xEE, 0xDC, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x67, 0x8A, 0xBD, 0xEF, 0xEE, 0xCB, 0x98, 0x76, 0x55, 0x55, + 0x66, 0x79, 0xAB, 0xDE, 0xEF, 0xED, 0xBA, 0x98, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBD, 0xFE, 0xEF, 0xEC, 0xBA, 0x98, 0x77, 0x77, 0x78, 0x9A, 0xBC, + 0xDE, 0xEF, 0xFF, 0xDC, 0xBA, 0x99, 0x88, 0x89, 0x9A, 0xAB, 0xCD, 0xEE, + 0xFF, 0xFE, 0xDC, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xEF, 0xEF, 0xFF, + 0xFF, 0xDC, 0xCC, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, + 0xED, 0xDD, 0xCD, 0xCD, 0xDD, 0xDF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFE, + 0xFE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xEE, 0xEE, + 0xEE, 0xEF, 0xEF, 0xFF, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xDD, 0xDD, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xEF, 0xFF, 0xCE, 0xFE, + 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xEE, 0xFF, 0xFF, 0xDF, 0xED, 0xCB, + 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDF, 0xFF, 0xFE, 0xED, 0xCB, 0xAA, 0x99, + 0x99, 0x99, 0xAB, 0xCD, 0xDF, 0xFF, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0x9A, 0xBC, 0xEF, 0xFD, 0xDB, 0xB9, 0x98, 0x77, 0x77, 0x77, 0x89, + 0xAB, 0xCD, 0xFE, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x67, 0x89, 0xAB, + 0xCD, 0xFC, 0xCB, 0x98, 0x77, 0x66, 0x55, 0x56, 0x67, 0x89, 0xAC, 0xDE, + 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xCA, + 0x98, 0x76, 0x55, 0x54, 0x55, 0x67, 0x79, 0xAB, 0xCD, 0xDC, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xCA, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xBA, 0x87, 0x66, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xCC, 0xDD, 0xDB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78, + 0x89, 0xBC, 0xDD, 0xED, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCE, 0xDE, 0xEC, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x89, 0xAB, 0xCD, 0xEE, + 0xFF, 0xEC, 0xBB, 0xA9, 0x99, 0x99, 0x99, 0xAB, 0xCC, 0xDF, 0xEF, 0xFF, + 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBD, 0xDE, 0xFF, 0xFF, 0xFF, 0xED, + 0xCC, 0xCB, 0xBB, 0xCC, 0xCC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEE, 0xDD, + 0xDC, 0xDD, 0xDD, 0xEE, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xEF, 0xED, 0xDD, + 0xDD, 0xDF, 0xFF, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEF, 0xFF, 0xCE, 0xFE, + 0xDD, 0xCC, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFF, 0xEE, 0xDD, 0xCB, + 0xBA, 0xAA, 0xAA, 0xAB, 0xCC, 0xDE, 0xFF, 0xFD, 0xDC, 0xCB, 0xAA, 0x99, + 0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xFF, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0x9A, 0xBC, 0xDF, 0xED, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xBC, 0xEE, 0xCC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x67, 0x89, 0x9B, + 0xCD, 0xEC, 0xBA, 0x98, 0x76, 0x66, 0x55, 0x56, 0x67, 0x89, 0xAB, 0xDD, + 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xDC, 0xBA, + 0x98, 0x76, 0x55, 0x55, 0x55, 0x67, 0x78, 0xAB, 0xCD, 0xCB, 0xA9, 0x87, + 0x65, 0x55, 0x55, 0x56, 0x67, 0x8A, 0xBC, 0xDC, 0xBA, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x78, 0xAB, 0xCD, 0xCC, 0xA9, 0x87, 0x66, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xBC, 0xDD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x77, + 0x89, 0xAB, 0xCD, 0xDD, 0xCA, 0x98, 0x87, 0x77, 0x67, 0x77, 0x89, 0xAB, + 0xCD, 0xDE, 0xEC, 0xBA, 0x99, 0x88, 0x77, 0x78, 0x89, 0xAA, 0xBC, 0xDD, + 0xEE, 0xDC, 0xBA, 0xA9, 0x98, 0x89, 0x99, 0xAA, 0xBC, 0xDE, 0xEF, 0xFE, + 0xDC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xCC, 0xDE, 0xFE, 0xFF, 0xFE, 0xED, + 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDE, 0xFF, 0xEF, 0xFF, 0xFF, 0xED, 0xDC, + 0xCC, 0xCC, 0xDD, 0xDE, 0xFF, 0xFF, 0xDF, 0xFF, 0xEE, 0xDD, 0xDD, 0xCD, + 0xDD, 0xDE, 0xEE, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xDC, 0xDC, 0xCC, 0xBC, 0xCC, 0xCD, 0xDD, 0xDE, 0xEE, 0xBE, 0xFE, + 0xDD, 0xCC, 0xCB, 0xBB, 0xCC, 0xCD, 0xEE, 0xFF, 0xFF, 0xDE, 0xDC, 0xCB, + 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xEF, 0xFF, 0xFD, 0xDD, 0xCB, 0xAA, 0x99, + 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xFE, 0xCD, 0xCB, 0xAA, 0x98, 0x88, 0x88, + 0x89, 0xAA, 0xCC, 0xEE, 0xEC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89, + 0xAB, 0xCD, 0xED, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCE, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x55, 0x56, 0x77, 0x8A, 0xAC, 0xDD, + 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xCB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xDC, 0xCA, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xDC, 0xCC, 0xBA, 0x87, 0x76, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xBC, 0xDC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x99, 0xAC, 0xDC, 0xDD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCD, 0xDD, 0xEC, 0xCA, 0xA9, 0x88, 0x88, 0x88, 0x89, 0xAB, 0xBC, 0xDD, + 0xDE, 0xDC, 0xCB, 0xA9, 0x99, 0x99, 0x99, 0xAB, 0xBC, 0xDE, 0xDE, 0xFE, + 0xDD, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xDD, 0xEF, 0xEE, 0xDD, + 0xCC, 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xEF, 0xEF, 0xFF, 0xFE, 0xEE, 0xDD, + 0xCD, 0xCD, 0xCD, 0xDD, 0xFF, 0xFE, 0xCE, 0xED, 0xEE, 0xDD, 0xDD, 0xCC, + 0xDD, 0xCD, 0xDE, 0xDE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xBE, 0xEE, 0xED, 0xDD, 0xDD, 0xDD, 0xDD, 0xEE, 0xEF, 0xFF, 0xBE, 0xFF, + 0xFE, 0xDD, 0xDC, 0xCD, 0xDD, 0xEE, 0xFF, 0xFF, 0xFF, 0xEF, 0xED, 0xDC, + 0xCB, 0xBB, 0xBB, 0xCC, 0xDD, 0xFF, 0xFF, 0xFD, 0xEE, 0xCC, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBC, 0xDE, 0xFF, 0xFF, 0xDD, 0xDC, 0xBA, 0x99, 0x98, 0x89, + 0x9A, 0xAB, 0xDD, 0xFF, 0xFD, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x78, 0x99, + 0xAC, 0xDE, 0xFF, 0xDD, 0xCB, 0x98, 0x87, 0x66, 0x66, 0x78, 0x9A, 0xBC, + 0xDF, 0xED, 0xDC, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xEE, + 0xDC, 0xBA, 0x97, 0x66, 0x55, 0x45, 0x56, 0x78, 0xAB, 0xCE, 0xED, 0xDB, + 0xA8, 0x76, 0x55, 0x44, 0x45, 0x67, 0x89, 0xBC, 0xDE, 0xDC, 0xBA, 0x87, + 0x65, 0x54, 0x44, 0x56, 0x78, 0x9B, 0xCE, 0xDD, 0xDB, 0xA9, 0x76, 0x65, + 0x44, 0x55, 0x67, 0x89, 0xBC, 0xDE, 0xDD, 0xCA, 0x98, 0x76, 0x55, 0x55, + 0x66, 0x78, 0xAB, 0xDD, 0xEE, 0xEC, 0xBA, 0x98, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBD, 0xEE, 0xEF, 0xDC, 0xB9, 0x98, 0x77, 0x77, 0x78, 0x9A, 0xBC, + 0xDE, 0xEE, 0xFE, 0xDB, 0xAA, 0x98, 0x88, 0x88, 0x9A, 0xAB, 0xCE, 0xFE, + 0xFF, 0xED, 0xDB, 0xBA, 0xAA, 0x99, 0xAA, 0xBB, 0xCD, 0xEF, 0xEF, 0xFF, + 0xFE, 0xDC, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEF, 0xFE, 0xFF, 0xFF, 0xFE, + 0xED, 0xCC, 0xCC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEE, + 0xDE, 0xDE, 0xEE, 0xEF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFE, 0xEE, 0xED, 0xDE, + 0xED, 0xDE, 0xEE, 0xFE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xCC, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEE, 0xBC, 0xDD, + 0xCC, 0xBB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEE, 0xFE, 0xCD, 0xCB, 0xBA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xEE, 0xEC, 0xCB, 0xBA, 0xA9, 0x99, + 0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xED, 0xBC, 0xBA, 0x99, 0x88, 0x88, 0x88, + 0x89, 0x9A, 0xBB, 0xCD, 0xDB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xBC, 0xDD, 0xBB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x88, 0x9A, + 0xBC, 0xCB, 0xBA, 0x98, 0x77, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xCC, + 0xBB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xA9, + 0x98, 0x76, 0x65, 0x44, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, + 0x66, 0x54, 0x45, 0x56, 0x77, 0x89, 0xAB, 0xBB, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x56, + 0x66, 0x78, 0x99, 0xAB, 0xBB, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAB, 0xCC, 0xCC, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A, + 0xBC, 0xCC, 0xCB, 0xBA, 0x99, 0x88, 0x87, 0x88, 0x88, 0x9A, 0xAB, 0xCC, + 0xDD, 0xCB, 0xBA, 0x99, 0x98, 0x88, 0x99, 0x9A, 0xAB, 0xCD, 0xCD, 0xED, + 0xCB, 0xBA, 0xAA, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDC, 0xDF, 0xED, 0xCC, + 0xBB, 0xBA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDD, 0xDE, 0xFE, 0xED, 0xDC, 0xCB, + 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xFD, 0xAE, 0xDD, 0xDD, 0xCC, 0xCB, 0xBB, + 0xBB, 0xCC, 0xCC, 0xDD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xBB, 0xCC, + 0xBA, 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xDD, 0xBC, 0xBA, 0xA9, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xCA, 0xBA, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x89, 0x9A, 0xBB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77, + 0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBB, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89, + 0xAA, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x9A, 0xAA, + 0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99, + 0x87, 0x76, 0x66, 0x55, 0x56, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x98, 0x77, + 0x66, 0x65, 0x56, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66, + 0x55, 0x66, 0x67, 0x78, 0x89, 0xAA, 0x9A, 0x98, 0x77, 0x66, 0x66, 0x66, + 0x66, 0x77, 0x89, 0x9A, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0xAA, 0xBB, + 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xBB, 0xCB, + 0xAA, 0x99, 0x99, 0x88, 0x89, 0x99, 0xAA, 0xBB, 0xCB, 0xCC, 0xCB, 0xBA, + 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xCC, 0xDC, 0xCB, 0xBB, 0xAA, + 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDC, 0xAD, 0xCC, 0xBB, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBC, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xAB, 0xCB, + 0xBA, 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDC, 0xAB, 0xAA, 0xA9, + 0x99, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xCA, 0xBA, 0x99, 0x98, 0x88, + 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBB, 0xAA, 0xA9, 0x88, 0x87, 0x77, 0x77, + 0x78, 0x88, 0x9A, 0xAB, 0xB9, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBA, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89, + 0xAA, 0xA9, 0x99, 0x87, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA, + 0x99, 0x88, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x98, + 0x87, 0x76, 0x66, 0x66, 0x66, 0x67, 0x78, 0x89, 0xA9, 0x99, 0x88, 0x77, + 0x66, 0x66, 0x56, 0x66, 0x77, 0x88, 0x9A, 0x99, 0x98, 0x87, 0x76, 0x66, + 0x66, 0x66, 0x67, 0x78, 0x89, 0xA9, 0x99, 0x98, 0x77, 0x66, 0x66, 0x66, + 0x66, 0x77, 0x88, 0x9A, 0x99, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x78, 0x99, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x89, + 0xAA, 0xAA, 0xAA, 0x98, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0x9A, 0xBA, + 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xAB, 0xBB, + 0xAA, 0x99, 0x98, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCB, 0xBC, 0xBB, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xBC, 0xDC, 0xCB, 0xBA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xCC, 0xBC, 0xCB, 0xBA, 0xAA, 0x99, 0x99, + 0x9A, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0xBC, 0xAB, 0xDC, + 0xBB, 0xAA, 0xAA, 0x9A, 0xAA, 0xAA, 0xBB, 0xCD, 0xDC, 0xBC, 0xBB, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xCA, 0xBB, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCC, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77, + 0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0xAA, 0xBB, 0xAA, 0x99, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89, + 0xAB, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xAA, + 0x9A, 0x98, 0x87, 0x66, 0x66, 0x56, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0xA9, + 0x87, 0x76, 0x66, 0x55, 0x56, 0x67, 0x78, 0x89, 0xAA, 0x9A, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x87, 0x76, 0x66, + 0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0xAA, 0x98, 0x87, 0x66, 0x66, 0x66, + 0x66, 0x77, 0x89, 0x9A, 0xAA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x99, 0xAB, 0xBB, + 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xBB, 0xCB, + 0xAA, 0xA9, 0x99, 0x89, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xCC, 0xCB, 0xBA, + 0xAA, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xCD, 0xDD, 0xCC, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDC, 0xAD, 0xCB, 0xBB, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xCC, 0xBB, 0xBB, 0xAB, 0xAB, 0xBB, 0xBC, 0xCC, 0xDD, 0xAC, 0xDD, + 0xCC, 0xBB, 0xBB, 0xBA, 0xBB, 0xBC, 0xCD, 0xDE, 0xFD, 0xCD, 0xCB, 0xBA, + 0xAA, 0xA9, 0xAA, 0xAA, 0xBC, 0xCD, 0xDE, 0xDB, 0xCC, 0xBA, 0xA9, 0x99, + 0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xED, 0xBC, 0xBA, 0x99, 0x88, 0x88, 0x88, + 0x89, 0x9A, 0xAB, 0xCD, 0xCB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xBB, 0xDC, 0xBB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x88, 0x9A, + 0xBC, 0xCB, 0xBA, 0x98, 0x77, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xCC, + 0xAA, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xBA, 0xAA, + 0x98, 0x76, 0x65, 0x44, 0x55, 0x67, 0x88, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, + 0x66, 0x54, 0x45, 0x56, 0x77, 0x89, 0xAB, 0xBB, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x56, + 0x66, 0x78, 0x99, 0xAB, 0xBB, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAB, 0xCB, 0xCC, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A, + 0xBC, 0xCC, 0xCB, 0xBA, 0x98, 0x88, 0x87, 0x88, 0x89, 0x9A, 0xAC, 0xCC, + 0xCD, 0xCB, 0xBA, 0x99, 0x98, 0x88, 0x99, 0x9A, 0xAB, 0xCD, 0xCD, 0xDD, + 0xCB, 0xBA, 0xAA, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xDC, 0xDE, 0xDD, 0xCC, + 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xDD, 0xFE, 0xED, 0xDC, 0xCB, + 0xBB, 0xBB, 0xCC, 0xCC, 0xDD, 0xED, 0xBD, 0xED, 0xDC, 0xCC, 0xBB, 0xBB, + 0xBB, 0xCC, 0xCC, 0xDD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xCF, 0xFF, 0xFF, 0xEF, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, + 0xFF, 0xFE, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEE, + 0xDD, 0xDC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, 0xCC, 0xBB, + 0xBB, 0xBC, 0xCE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCB, 0xAA, 0x99, 0x9A, + 0xAB, 0xCD, 0xFF, 0xFF, 0xFF, 0xFE, 0xCB, 0xA9, 0x88, 0x88, 0x89, 0xAB, + 0xCD, 0xFF, 0xFF, 0xEF, 0xDC, 0xA9, 0x87, 0x77, 0x77, 0x88, 0xAB, 0xCE, + 0xFF, 0xFE, 0xED, 0xBA, 0x87, 0x66, 0x55, 0x66, 0x79, 0xAC, 0xDF, 0xFF, + 0xFF, 0xCB, 0x98, 0x76, 0x54, 0x45, 0x67, 0x8A, 0xBC, 0xFF, 0xFF, 0xEC, + 0xB9, 0x86, 0x54, 0x33, 0x45, 0x68, 0x9B, 0xDE, 0xFF, 0xFE, 0xDB, 0x98, + 0x75, 0x43, 0x34, 0x56, 0x89, 0xBC, 0xEF, 0xFF, 0xED, 0xBA, 0x87, 0x65, + 0x44, 0x55, 0x78, 0x9B, 0xCE, 0xFF, 0xFF, 0xDC, 0xA9, 0x86, 0x65, 0x55, + 0x67, 0x8A, 0xBC, 0xEF, 0xFF, 0xFE, 0xDB, 0xA8, 0x87, 0x66, 0x77, 0x89, + 0xAC, 0xDF, 0xFF, 0xFF, 0xED, 0xCB, 0xA9, 0x88, 0x88, 0x89, 0xAB, 0xCD, + 0xFF, 0xFF, 0xFF, 0xED, 0xCB, 0xA9, 0x99, 0x9A, 0xAB, 0xCD, 0xEF, 0xFF, + 0xFF, 0xFF, 0xED, 0xCC, 0xBB, 0xBB, 0xBB, 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFE, 0xDD, 0xCC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFD, 0xEE, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xDD, 0xCC, 0xCC, 0xCC, 0xBC, 0xDC, 0xDD, 0xEE, 0xFF, 0xBD, 0xFD, + 0xDC, 0xCC, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFF, 0xDE, 0xDC, 0xCB, + 0xBA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xFF, 0xED, 0xDC, 0xBB, 0xAA, 0x99, + 0x99, 0x99, 0xAB, 0xBC, 0xDD, 0xEE, 0xCC, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0x9A, 0xBC, 0xDF, 0xEC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89, + 0x9B, 0xCD, 0xFD, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xDC, 0xCB, 0x98, 0x77, 0x66, 0x55, 0x56, 0x67, 0x89, 0xBC, 0xDD, + 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xDC, 0xCA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xDC, 0xCB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xCC, 0xCA, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xB9, 0x87, 0x76, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xBD, 0xDD, 0xDB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBB, 0xDD, 0xDD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCD, 0xDD, 0xEC, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xCC, 0xEE, + 0xEE, 0xDC, 0xBB, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xEE, 0xFE, + 0xDC, 0xBB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0xFE, 0xDD, + 0xCC, 0xBC, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xEF, 0xFF, 0xFE, 0xED, 0xDD, + 0xCD, 0xCC, 0xCE, 0xDE, 0xFE, 0xFE, 0xAF, 0xFE, 0xEE, 0xDD, 0xDD, 0xCD, + 0xDD, 0xDE, 0xEE, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xDE, 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xEF, 0xFF, 0xCE, 0xFE, + 0xDD, 0xCC, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFF, 0xEE, 0xDC, 0xCB, + 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xFD, 0xDC, 0xBB, 0xA9, 0x99, + 0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xFF, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0x9A, 0xBC, 0xDE, 0xEC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xBC, 0xDE, 0xCC, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x67, 0x89, 0xAB, + 0xCD, 0xDC, 0xBA, 0x98, 0x76, 0x65, 0x55, 0x56, 0x67, 0x89, 0xAB, 0xDD, + 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xDC, 0xBA, + 0x98, 0x76, 0x55, 0x55, 0x55, 0x67, 0x79, 0xAB, 0xCD, 0xCB, 0xA9, 0x87, + 0x65, 0x55, 0x55, 0x56, 0x77, 0x8A, 0xBC, 0xDC, 0xBA, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xA9, 0x87, 0x66, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xBC, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78, + 0x89, 0xAB, 0xDD, 0xDD, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCD, 0xDD, 0xDC, 0xBA, 0x99, 0x88, 0x77, 0x88, 0x89, 0xAB, 0xCD, 0xEE, + 0xEE, 0xDC, 0xBA, 0xA9, 0x98, 0x89, 0x99, 0xAA, 0xBC, 0xDE, 0xEE, 0xFE, + 0xDC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xCC, 0xDE, 0xFF, 0xFF, 0xFE, 0xDD, + 0xCB, 0xBB, 0xBB, 0xBB, 0xCD, 0xDE, 0xEF, 0xFF, 0xFF, 0xFF, 0xED, 0xDC, + 0xCC, 0xCD, 0xDD, 0xEE, 0xFF, 0xFF, 0xCF, 0xFF, 0xFE, 0xDD, 0xDD, 0xDD, + 0xDD, 0xDE, 0xEE, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xFD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCD, 0xEE, 0xFF, 0xFF, 0xBF, 0xFE, + 0xED, 0xCC, 0xCC, 0xBB, 0xCC, 0xDD, 0xDF, 0xFF, 0xFF, 0xFE, 0xED, 0xCB, + 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xEF, 0xFF, 0xFD, 0xED, 0xCB, 0xAA, 0x99, + 0x99, 0x99, 0xAB, 0xBC, 0xDE, 0xFF, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0xAA, 0xBD, 0xDF, 0xFD, 0xDB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89, + 0x9B, 0xCD, 0xFF, 0xCC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xEC, 0xBB, 0x98, 0x77, 0x65, 0x55, 0x56, 0x67, 0x89, 0xBC, 0xDE, + 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xCA, + 0x98, 0x76, 0x55, 0x54, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCB, 0xA9, 0x87, + 0x65, 0x55, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xCA, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xDC, 0xA9, 0x87, 0x66, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xBD, 0xDD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78, + 0x99, 0xBC, 0xDD, 0xDD, 0xCA, 0x99, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCD, 0xEE, 0xEC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x89, 0xAB, 0xCD, 0xDD, + 0xFF, 0xDC, 0xBA, 0xA9, 0x99, 0x99, 0x99, 0xAB, 0xBC, 0xDE, 0xFF, 0xFF, + 0xDD, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDE, 0xFF, 0xFF, 0xFE, 0xED, + 0xCC, 0xCB, 0xBB, 0xBC, 0xCD, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFE, 0xDD, + 0xDC, 0xDD, 0xDD, 0xEE, 0xFF, 0xFF, 0xCF, 0xFF, 0xFE, 0xEE, 0xDD, 0xDD, + 0xDD, 0xDE, 0xEF, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCF, 0xEE, 0xEE, 0xDD, 0xDE, 0xDE, 0xEE, 0xEE, 0xFE, 0xEF, 0xAF, 0xFF, + 0xFE, 0xED, 0xDD, 0xDD, 0xDE, 0xEF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFE, 0xDC, + 0xCC, 0xCB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFE, 0xFE, 0xDC, 0xBB, 0xAA, + 0xAA, 0xAB, 0xCC, 0xDE, 0xFF, 0xFF, 0xEE, 0xDC, 0xBA, 0xA9, 0x99, 0x99, + 0x9A, 0xBC, 0xDE, 0xFF, 0xFE, 0xEC, 0xBA, 0x99, 0x87, 0x77, 0x88, 0x9A, + 0xBC, 0xDF, 0xFF, 0xED, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x78, 0x9A, 0xBD, + 0xEF, 0xFD, 0xDC, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9B, 0xCD, 0xFF, + 0xDD, 0xBA, 0x98, 0x66, 0x54, 0x45, 0x56, 0x89, 0xAC, 0xDE, 0xED, 0xDB, + 0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBD, 0xEE, 0xED, 0xBA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xDE, 0xFE, 0xDC, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x67, 0x9A, 0xBD, 0xEE, 0xED, 0xCB, 0x98, 0x76, 0x55, 0x55, + 0x67, 0x89, 0xAC, 0xDE, 0xEE, 0xED, 0xBA, 0x98, 0x76, 0x66, 0x67, 0x78, + 0x9B, 0xCD, 0xFE, 0xFF, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC, + 0xDF, 0xFF, 0xFE, 0xDC, 0xBA, 0x99, 0x98, 0x99, 0x9A, 0xBC, 0xDF, 0xFF, + 0xFF, 0xFE, 0xDC, 0xBB, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xFF, 0xFF, + 0xFE, 0xDD, 0xCC, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFE, + 0xEE, 0xDD, 0xDC, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEE, + 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEE, + 0xEE, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xBC, 0xCC, 0xBB, 0xBA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDE, 0xBC, 0xDC, + 0xCB, 0xBB, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDE, 0xFE, 0xCC, 0xCB, 0xBA, + 0xAA, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xDE, 0xEB, 0xCB, 0xAA, 0x99, 0x98, + 0x88, 0x99, 0x9A, 0xAB, 0xCD, 0xDD, 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88, + 0x88, 0x9A, 0xAB, 0xCD, 0xDB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xAB, 0xCC, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x88, 0x9A, + 0xBC, 0xCA, 0xAA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77, 0x89, 0xAB, 0xCC, + 0xAA, 0x99, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xBA, 0xA9, + 0x88, 0x76, 0x65, 0x44, 0x55, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0x98, 0x87, + 0x66, 0x54, 0x45, 0x56, 0x77, 0x89, 0xAB, 0xBB, 0xA9, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x56, + 0x66, 0x78, 0x99, 0xAB, 0xBB, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x67, 0x77, + 0x89, 0xAA, 0xBB, 0xBB, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A, + 0xBC, 0xCC, 0xCB, 0xAA, 0x98, 0x88, 0x87, 0x88, 0x89, 0x9A, 0xBB, 0xCC, + 0xCD, 0xCB, 0xAA, 0x99, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCC, 0xCD, 0xDD, + 0xCB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDD, 0xDE, 0xDC, 0xCB, + 0xBB, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xDE, 0xFE, 0xED, 0xCC, 0xBB, + 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xED, 0xAE, 0xDD, 0xDC, 0xCC, 0xBB, 0xBB, + 0xBB, 0xCC, 0xCD, 0xDD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xAB, 0xCB, + 0xBA, 0xAA, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xDD, 0xBB, 0xBA, 0xA9, + 0x99, 0x98, 0x89, 0x99, 0xAA, 0xBB, 0xCD, 0xCA, 0xBA, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x89, 0x9A, 0xBB, 0xCC, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, + 0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBB, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x67, 0x78, 0x89, + 0xAB, 0xA9, 0x99, 0x87, 0x77, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xAA, + 0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99, + 0x87, 0x76, 0x66, 0x55, 0x56, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x98, 0x77, + 0x66, 0x65, 0x55, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66, + 0x65, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x89, 0x9A, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0xAA, 0xBB, + 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xBB, 0xCB, + 0xAA, 0xA9, 0x99, 0x88, 0x89, 0x99, 0xAA, 0xBB, 0xCB, 0xCD, 0xCB, 0xAA, + 0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xCD, 0xDC, 0xCB, 0xBB, 0xAA, + 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDC, 0xAC, 0xCC, 0xBB, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAB, 0xBB, 0xCC, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xAB, 0xCB, + 0xBA, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDC, 0xBB, 0xBA, 0xA9, + 0x99, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCC, 0xCA, 0xBA, 0x99, 0x98, 0x88, + 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBB, 0xAA, 0xA9, 0x88, 0x87, 0x77, 0x77, + 0x78, 0x89, 0x9A, 0xAB, 0xB9, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBB, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, 0x78, 0x89, + 0xAA, 0xA9, 0x99, 0x87, 0x76, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA, + 0x99, 0x88, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x98, + 0x87, 0x76, 0x66, 0x65, 0x66, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x88, 0x77, + 0x66, 0x65, 0x56, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66, + 0x66, 0x66, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x98, 0x77, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x66, 0x77, + 0x88, 0x99, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x89, + 0xAB, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0x9A, 0xBA, + 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xBB, 0xBB, 0xCB, + 0xAA, 0x99, 0x98, 0x88, 0x88, 0x99, 0x9A, 0xBB, 0xCB, 0xCC, 0xCB, 0xAA, + 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xCC, 0xDC, 0xCB, 0xBA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDC, 0xBC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCC, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xAB, 0xCC, + 0xBB, 0xAA, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0xCD, 0xDC, 0xBC, 0xBB, 0xA9, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xCA, 0xBA, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x89, 0x9A, 0xBB, 0xCC, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, + 0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0xAA, 0xBB, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x67, 0x78, 0x89, + 0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xAA, + 0x99, 0x98, 0x77, 0x66, 0x66, 0x56, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99, + 0x87, 0x76, 0x66, 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0x99, 0x98, 0x77, + 0x66, 0x65, 0x55, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0xA9, 0x87, 0x76, 0x66, + 0x56, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x87, 0x66, 0x66, 0x66, + 0x66, 0x77, 0x89, 0x9A, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x99, 0xAA, 0xBB, + 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBB, 0xCB, + 0xAA, 0xA9, 0x99, 0x88, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xCD, 0xCC, 0xBA, + 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xBB, 0xCD, 0xCC, 0xDC, 0xCC, 0xBB, 0xAA, + 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDC, 0xAD, 0xCC, 0xBB, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAB, 0xBB, 0xCC, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xBC, 0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCC, 0xDD, 0xAC, 0xDC, + 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xEE, 0xCC, 0xCB, 0xAA, + 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDE, 0xEB, 0xCB, 0xAA, 0x99, 0x98, + 0x88, 0x89, 0x9A, 0xAB, 0xBC, 0xDD, 0xBB, 0xAA, 0x99, 0x88, 0x87, 0x78, + 0x88, 0x99, 0xAB, 0xCD, 0xCB, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x88, + 0x99, 0xAB, 0xCC, 0xAB, 0xA9, 0x87, 0x77, 0x66, 0x66, 0x77, 0x88, 0x9A, + 0xBC, 0xCA, 0xA9, 0x98, 0x77, 0x66, 0x56, 0x66, 0x77, 0x89, 0x9A, 0xBB, + 0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xBA, 0xA9, + 0x87, 0x76, 0x55, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0x98, 0x77, + 0x65, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xBA, 0xA9, 0x88, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0xA9, 0x87, 0x76, 0x65, 0x56, + 0x66, 0x78, 0x89, 0xAB, 0xBB, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAA, 0xBB, 0xBB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xBC, 0xBC, 0xCB, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x89, 0x9A, 0xAB, 0xCC, + 0xCC, 0xCB, 0xA9, 0x99, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCC, 0xCD, 0xDC, + 0xBB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDD, 0xDE, 0xDC, 0xCB, + 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xDE, 0xEE, 0xDD, 0xCC, 0xBB, + 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xED, 0xBE, 0xDD, 0xCC, 0xCB, 0xBB, 0xBB, + 0xBB, 0xBC, 0xCC, 0xDE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, + 0xFF, 0xFE, 0xED, 0xDE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, + 0xCC, 0xCC, 0xCC, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEC, 0xCB, 0xBA, + 0xAA, 0xBB, 0xCD, 0xEF, 0xFF, 0xFF, 0xFF, 0xDD, 0xBB, 0xA9, 0x99, 0x99, + 0xAA, 0xBD, 0xEF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x88, 0x77, 0x88, 0x9A, + 0xCD, 0xFF, 0xFF, 0xFE, 0xDB, 0xA9, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xCD, + 0xFF, 0xFF, 0xDC, 0xB9, 0x87, 0x65, 0x55, 0x56, 0x78, 0xAB, 0xDF, 0xFF, + 0xFD, 0xCA, 0x98, 0x65, 0x54, 0x45, 0x56, 0x89, 0xBC, 0xEF, 0xFE, 0xDC, + 0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xCD, 0xFF, 0xFE, 0xCA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x79, 0xAC, 0xDF, 0xFF, 0xEC, 0xB9, 0x87, 0x55, + 0x44, 0x55, 0x67, 0x9A, 0xCD, 0xFF, 0xFF, 0xDB, 0xA8, 0x76, 0x55, 0x55, + 0x67, 0x89, 0xAC, 0xDF, 0xFF, 0xFD, 0xCB, 0x98, 0x76, 0x66, 0x67, 0x89, + 0xAB, 0xCF, 0xFF, 0xFF, 0xFD, 0xCA, 0x98, 0x87, 0x77, 0x89, 0x9A, 0xCD, + 0xFF, 0xFF, 0xFF, 0xEC, 0xBB, 0xA9, 0x99, 0x99, 0xAA, 0xBC, 0xDF, 0xFF, + 0xFF, 0xFF, 0xDD, 0xCB, 0xBA, 0xAA, 0xAB, 0xCC, 0xDF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFE, 0xDC, 0xCC, 0xCC, 0xCD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xED, 0xDD, 0xDC, 0xCC, 0xCC, 0xCD, 0xDE, 0xEE, 0xDE, 0xAF, 0xFE, + 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFF, 0xEF, 0xDD, 0xCB, + 0xBB, 0xAA, 0xAB, 0xBB, 0xCD, 0xEE, 0xFF, 0xEE, 0xED, 0xCB, 0xAA, 0x99, + 0x99, 0x9A, 0xAB, 0xCD, 0xEE, 0xFF, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x99, 0xAB, 0xCD, 0xEF, 0xED, 0xDC, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89, + 0xAB, 0xCE, 0xEE, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xDE, 0xEC, 0xCB, 0x98, 0x76, 0x65, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xDD, + 0xCC, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9B, 0xCD, 0xDC, 0xCA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xCC, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xCD, 0xDC, 0xCB, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAC, 0xDE, 0xDC, 0xBA, 0x98, 0x76, 0x55, 0x55, + 0x66, 0x78, 0x9B, 0xCD, 0xDD, 0xDB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x9A, 0xBC, 0xDD, 0xDD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x99, 0xAB, + 0xDE, 0xED, 0xED, 0xCB, 0xA9, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xEE, + 0xDE, 0xEC, 0xCB, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xEF, 0xEE, 0xFE, + 0xED, 0xCB, 0xBB, 0xAA, 0xAB, 0xBB, 0xCD, 0xEF, 0xFF, 0xFF, 0xFF, 0xED, + 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xEF, 0xFF, 0xFE, 0xFF, 0xFF, 0xEE, 0xED, + 0xDD, 0xDD, 0xDE, 0xEE, 0xFF, 0xFF, 0xAF, 0xEE, 0xEE, 0xED, 0xDD, 0xDD, + 0xDD, 0xED, 0xEF, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xDD, 0xCC, 0xCC, 0xCC, 0xBC, 0xCC, 0xDD, 0xDD, 0xEE, 0xBE, 0xFE, + 0xDD, 0xCC, 0xBB, 0xBB, 0xBC, 0xCD, 0xEE, 0xFF, 0xFE, 0xDE, 0xDC, 0xCB, + 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFF, 0xED, 0xDC, 0xCB, 0xAA, 0x99, + 0x99, 0x99, 0xAB, 0xBC, 0xDE, 0xFE, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0xAB, 0xCC, 0xDE, 0xDC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x89, + 0xAB, 0xCD, 0xED, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xDC, 0xBA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x77, 0x8A, 0xBC, 0xDD, + 0xBC, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCC, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xCC, 0xB9, 0x87, 0x76, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xBD, 0xDC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x9A, 0xBC, 0xDD, 0xDD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCD, 0xDD, 0xDD, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xDD, + 0xDE, 0xDC, 0xBB, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDE, 0xED, 0xEE, + 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xCC, 0xDE, 0xFE, 0xEF, 0xFE, 0xDD, + 0xCC, 0xCB, 0xBB, 0xBC, 0xCC, 0xDE, 0xEF, 0xEE, 0xFF, 0xEE, 0xED, 0xDC, + 0xCC, 0xDD, 0xDD, 0xDE, 0xFF, 0xFF, 0xBE, 0xEE, 0xED, 0xDD, 0xDD, 0xCD, + 0xCD, 0xDD, 0xEE, 0xEF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xED, 0xDD, 0xCC, 0xCC, 0xDC, 0xDD, 0xDE, 0xEF, 0xEF, 0xAE, 0xFE, + 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xDE, 0xEF, 0xFF, 0xFE, 0xEE, 0xDD, 0xDB, + 0xBB, 0xBA, 0xAB, 0xBC, 0xCD, 0xEE, 0xFF, 0xED, 0xED, 0xCB, 0xAA, 0x99, + 0x99, 0x9A, 0xBB, 0xCD, 0xEF, 0xFE, 0xDD, 0xCB, 0xAA, 0x98, 0x88, 0x88, + 0x99, 0xAB, 0xCD, 0xEF, 0xED, 0xDB, 0xB9, 0x98, 0x77, 0x77, 0x78, 0x89, + 0xAB, 0xCD, 0xEE, 0xCC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x77, 0x89, 0xAC, + 0xDE, 0xDC, 0xCB, 0x98, 0x76, 0x65, 0x55, 0x56, 0x77, 0x9A, 0xBC, 0xED, + 0xCC, 0xB9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9B, 0xCD, 0xDC, 0xCA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xBC, 0xDD, 0xCC, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xCB, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xDC, 0xBA, 0x98, 0x76, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xCD, 0xDD, 0xDC, 0xB9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x9A, 0xBC, 0xDD, 0xDE, 0xDB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x99, 0xAB, + 0xDD, 0xEE, 0xED, 0xCB, 0xA9, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xEE, + 0xFF, 0xED, 0xCB, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xCD, 0xDE, 0xEE, 0xFF, + 0xDD, 0xCC, 0xBB, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xEE, 0xFF, 0xFE, 0xED, + 0xDC, 0xCB, 0xCC, 0xCC, 0xCD, 0xEE, 0xFF, 0xEE, 0xFF, 0xFF, 0xFE, 0xED, + 0xDD, 0xDD, 0xDE, 0xEE, 0xEF, 0xFF, 0xAE, 0xEE, 0xEE, 0xED, 0xED, 0xDD, + 0xDD, 0xDE, 0xEE, 0xFE, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, + 0xFF, 0xFF, 0xED, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, + 0xCC, 0xCC, 0xCC, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xCB, 0xBA, + 0xAA, 0xBB, 0xCD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBB, 0xA9, 0x99, 0x99, + 0xAB, 0xBD, 0xFF, 0xFF, 0xFF, 0xFD, 0xCA, 0xA9, 0x87, 0x77, 0x88, 0x9A, + 0xBD, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xCD, + 0xFF, 0xFF, 0xFC, 0xB9, 0x87, 0x65, 0x55, 0x56, 0x78, 0xAB, 0xDF, 0xFF, + 0xFD, 0xCA, 0x97, 0x65, 0x54, 0x45, 0x56, 0x89, 0xAC, 0xFF, 0xFF, 0xDC, + 0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xCF, 0xFF, 0xFD, 0xCA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x79, 0xAC, 0xDF, 0xFF, 0xFC, 0xB9, 0x86, 0x65, + 0x44, 0x55, 0x67, 0x9A, 0xCD, 0xFF, 0xFF, 0xDB, 0xA8, 0x76, 0x55, 0x55, + 0x67, 0x89, 0xAC, 0xEF, 0xFF, 0xFF, 0xCA, 0x98, 0x76, 0x66, 0x67, 0x89, + 0xAB, 0xCF, 0xFF, 0xFF, 0xFD, 0xBA, 0x98, 0x87, 0x77, 0x89, 0x9B, 0xCD, + 0xFF, 0xFF, 0xFF, 0xFC, 0xBA, 0xA9, 0x99, 0x99, 0xAB, 0xBC, 0xFF, 0xFF, + 0xFF, 0xFF, 0xED, 0xCB, 0xBA, 0xAA, 0xAB, 0xCD, 0xEF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFD, 0xDC, 0xCC, 0xCC, 0xCD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xDD, 0xCC, 0xCC, 0xBC, 0xBC, 0xCC, 0xDD, 0xDE, 0xEE, 0xAE, 0xEE, + 0xDD, 0xCC, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xFF, 0xFE, 0xDE, 0xDC, 0xCB, + 0xBA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDE, 0xEF, 0xED, 0xDC, 0xBB, 0xAA, 0x99, + 0x99, 0x9A, 0xAB, 0xBC, 0xDE, 0xFE, 0xCD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x99, 0xAB, 0xCD, 0xDF, 0xEC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x89, + 0xAB, 0xCD, 0xEE, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xDB, 0xBA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD, + 0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBD, 0xDB, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xCB, 0xA9, 0x87, + 0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xDC, 0xBA, 0x98, 0x76, 0x65, + 0x54, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x78, 0x9A, 0xBC, 0xCC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x9A, 0xAC, 0xDD, 0xDD, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCD, 0xDD, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xBC, 0xED, + 0xEE, 0xDC, 0xCB, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDE, 0xEE, 0xFE, + 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDD, 0xEE, 0xEF, 0xFE, 0xDD, + 0xCC, 0xCB, 0xBB, 0xBC, 0xCD, 0xDD, 0xEF, 0xEE, 0xFF, 0xFE, 0xED, 0xDD, + 0xCC, 0xCC, 0xDD, 0xEE, 0xEF, 0xFE, 0x9E, 0xED, 0xDD, 0xDD, 0xDC, 0xCC, + 0xDD, 0xDD, 0xDE, 0xEF, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xCD, 0x9C, 0xDC, + 0xBB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xED, 0xBC, 0xCB, 0xAA, + 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDD, 0xDB, 0xBB, 0xAA, 0x99, 0x98, + 0x88, 0x89, 0x99, 0xAB, 0xBC, 0xDC, 0xBB, 0xAA, 0x99, 0x88, 0x87, 0x78, + 0x88, 0x99, 0xAB, 0xBC, 0xCA, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x88, + 0x99, 0xAB, 0xCC, 0xAB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x67, 0x78, 0x9A, + 0xAC, 0xCA, 0xA9, 0x98, 0x76, 0x66, 0x66, 0x66, 0x77, 0x89, 0x9A, 0xBB, + 0xAA, 0x98, 0x77, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xBA, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xBA, 0xA9, 0x88, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0x99, 0x87, 0x76, 0x65, 0x56, + 0x66, 0x78, 0x89, 0xAB, 0xBA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAA, 0xBB, 0xBB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xBC, 0xBB, 0xBB, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x88, 0x9A, 0xAB, 0xCB, + 0xBC, 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCC, 0xCC, 0xCC, + 0xBB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBD, 0xDC, 0xCD, 0xCC, 0xBB, + 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xCC, 0xEE, 0xDC, 0xCB, 0xBB, + 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xED, 0x9D, 0xCC, 0xCB, 0xBB, 0xBB, 0xBB, + 0xBB, 0xBC, 0xCC, 0xDD, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xBC, 0x9B, 0xCB, + 0xBA, 0xAA, 0xA9, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xDC, 0xBB, 0xBA, 0xA9, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xBA, 0xBA, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x99, 0x9A, 0xBB, 0xCB, 0xAA, 0xA9, 0x98, 0x88, 0x77, 0x77, + 0x88, 0x89, 0x9A, 0xBC, 0xBA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0xAA, 0xBB, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x99, + 0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA, + 0x99, 0x98, 0x77, 0x66, 0x65, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0x99, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0x99, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66, + 0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x78, 0x89, 0xAA, 0xAA, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x67, 0x77, + 0x88, 0x9A, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x87, 0x77, 0x78, 0x88, 0x99, 0xAA, 0xBA, + 0xAB, 0xBA, 0x99, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xBB, 0xCB, + 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xBA, + 0xAA, 0xA9, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xBC, 0xDC, 0xCC, 0xBB, 0xAA, + 0xAA, 0xAA, 0xAB, 0xBC, 0xCC, 0xDC, 0x9C, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAB, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBB, 0xAA, 0xAA, 0xA9, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0x9B, 0xCC, + 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDC, 0xBC, 0xBB, 0xAA, + 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCD, 0xCA, 0xBB, 0xAA, 0x99, 0x88, + 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77, + 0x88, 0x99, 0xAA, 0xCC, 0xBA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x99, 0xAB, 0xBB, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, 0x78, 0x9A, + 0xAC, 0xBA, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xBB, + 0x9A, 0x98, 0x77, 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xB9, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0x9A, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xAA, 0xA9, 0x87, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x78, 0x89, 0xAB, 0xAA, 0xBA, 0x98, 0x77, 0x76, 0x66, 0x66, 0x77, + 0x89, 0x9A, 0xBA, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xAB, 0xBB, 0xBB, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x88, 0x9A, 0xAB, 0xCB, + 0xBC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x89, 0x99, 0xAB, 0xBC, 0xBB, 0xCC, + 0xBB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCB, 0xCD, 0xCC, 0xBB, + 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xCC, 0xDC, 0xCC, 0xCB, 0xBB, + 0xBB, 0xAB, 0xBB, 0xCC, 0xCD, 0xDC, 0x9C, 0xCB, 0xBB, 0xBA, 0xAA, 0xAA, + 0xAA, 0xBB, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDE, 0xEE, 0xEF, 0x9E, 0xFE, + 0xDD, 0xCC, 0xCB, 0xBB, 0xCC, 0xDD, 0xEF, 0xFF, 0xFF, 0xDE, 0xDC, 0xCB, + 0xBA, 0xAA, 0xAB, 0xBB, 0xCD, 0xEE, 0xFF, 0xFD, 0xDC, 0xCB, 0xAA, 0x99, + 0x99, 0x9A, 0xAB, 0xCD, 0xEF, 0xFF, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x99, 0xAB, 0xCD, 0xEF, 0xEC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x78, 0x89, + 0xAB, 0xCD, 0xEE, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x78, 0x89, 0xAB, + 0xDE, 0xEC, 0xCA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD, + 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9B, 0xCD, 0xDC, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xCC, 0xA9, 0x87, + 0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xCB, 0x98, 0x76, 0x65, + 0x44, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x78, 0x9B, 0xBD, 0xDD, 0xDB, 0xB9, 0x88, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBC, 0xDD, 0xDD, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x99, 0xAB, + 0xCD, 0xDD, 0xED, 0xCB, 0xA9, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xED, + 0xEE, 0xED, 0xCB, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xEE, 0xFE, + 0xDD, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFE, 0xEF, 0xFE, 0xDD, + 0xDC, 0xCB, 0xBB, 0xCC, 0xCD, 0xEE, 0xFF, 0xFE, 0xFF, 0xFF, 0xEE, 0xDD, + 0xDC, 0xDD, 0xDD, 0xEE, 0xFF, 0xFF, 0xAE, 0xFE, 0xEE, 0xED, 0xDD, 0xDD, + 0xDD, 0xDE, 0xEE, 0xFF, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xED, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xCC, + 0xCC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBB, 0xAA, 0xAB, + 0xBC, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xEC, 0xBA, 0x99, 0x89, 0x9A, 0xBB, + 0xDF, 0xFF, 0xFF, 0xFF, 0xFD, 0xBA, 0x98, 0x77, 0x77, 0x89, 0xBC, 0xEF, + 0xFF, 0xFF, 0xFF, 0xCB, 0x98, 0x65, 0x55, 0x67, 0x8A, 0xBC, 0xFF, 0xFF, + 0xFF, 0xDC, 0xA9, 0x75, 0x44, 0x44, 0x67, 0x9B, 0xCF, 0xFF, 0xFF, 0xFE, + 0xCA, 0x87, 0x54, 0x33, 0x45, 0x79, 0xAC, 0xDF, 0xFF, 0xFF, 0xDC, 0xA9, + 0x75, 0x43, 0x34, 0x57, 0x8A, 0xCE, 0xFF, 0xFF, 0xFF, 0xCB, 0x97, 0x64, + 0x44, 0x45, 0x79, 0xAC, 0xDF, 0xFF, 0xFF, 0xFD, 0xBA, 0x87, 0x65, 0x55, + 0x68, 0x9B, 0xCD, 0xFF, 0xFF, 0xFF, 0xDC, 0xB9, 0x87, 0x77, 0x78, 0x9A, + 0xBD, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0x98, 0x89, 0x9A, 0xBC, 0xDF, + 0xFF, 0xFF, 0xFF, 0xFE, 0xDC, 0xBB, 0xAA, 0xAB, 0xBC, 0xDF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xDD, 0xCC, 0xCC, 0xCD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFE, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xCD, 0x9E, 0xFE, + 0xDD, 0xDD, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xFE, 0xFD, 0xDE, 0xED, 0xDC, + 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xEC, 0xDD, 0xCC, 0xBA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCD, 0xED, 0xED, 0xCD, 0xCC, 0xBA, 0xA9, 0x99, 0x99, + 0x9A, 0xBB, 0xCD, 0xDF, 0xDC, 0xDC, 0xBA, 0x99, 0x88, 0x77, 0x88, 0x9A, + 0xBC, 0xCD, 0xED, 0xCD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x78, 0x9A, 0xBC, + 0xDE, 0xDC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9B, 0xBD, 0xED, + 0xCC, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x66, 0x89, 0xAB, 0xCD, 0xDC, 0xCB, + 0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xDD, 0xCC, 0xBA, 0x87, + 0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x67, 0x9A, 0xBC, 0xED, 0xCD, 0xCA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88, + 0x9B, 0xCC, 0xED, 0xCD, 0xCB, 0xAA, 0x98, 0x87, 0x77, 0x89, 0x9A, 0xBC, + 0xDD, 0xDC, 0xDC, 0xCC, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xED, + 0xDE, 0xDD, 0xCC, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xEE, 0xDC, 0xFE, + 0xDD, 0xCC, 0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEE, 0xFE, 0xDF, 0xEE, 0xDD, + 0xDD, 0xCC, 0xCC, 0xCC, 0xDD, 0xEE, 0xEF, 0xED, 0xFF, 0xEE, 0xED, 0xDD, + 0xDD, 0xDE, 0xEF, 0xEF, 0xFF, 0xEE, 0x9D, 0xDD, 0xCD, 0xDD, 0xDD, 0xDD, + 0xDD, 0xDE, 0xEE, 0xFE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xDD, 0xCC, 0xCB, 0xBB, 0xBC, 0xCC, 0xCD, 0xDD, 0xDE, 0xAE, 0xEE, + 0xDC, 0xCC, 0xBB, 0xBB, 0xBC, 0xCD, 0xDD, 0xEF, 0xFE, 0xDE, 0xDC, 0xCB, + 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xEF, 0xED, 0xDC, 0xCB, 0xAA, 0x99, + 0x99, 0x9A, 0xAB, 0xBC, 0xDE, 0xEE, 0xCC, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x99, 0xAA, 0xBC, 0xDE, 0xDC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x78, 0x89, + 0xAB, 0xCC, 0xDD, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xDB, 0xBA, 0x98, 0x77, 0x65, 0x55, 0x56, 0x77, 0x9A, 0xBC, 0xDD, + 0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xDB, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xCC, 0xBA, 0x88, 0x76, 0x55, 0x55, + 0x67, 0x78, 0x9A, 0xBD, 0xCC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBC, 0xDD, 0xCD, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x99, 0xAB, + 0xCD, 0xDC, 0xDC, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xDD, + 0xDD, 0xDC, 0xBB, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xDD, 0xED, + 0xDC, 0xBB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFE, 0xDF, 0xEE, 0xDC, + 0xCC, 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xFF, 0xFE, 0xFE, 0xFE, 0xDD, 0xDD, + 0xCC, 0xCC, 0xDD, 0xDE, 0xFF, 0xFE, 0xAE, 0xED, 0xDD, 0xDD, 0xCC, 0xCC, + 0xCD, 0xDD, 0xEE, 0xEF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xDE, 0xED, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0xDE, 0x9F, 0xFF, + 0xED, 0xDD, 0xDD, 0xCC, 0xCD, 0xDD, 0xEE, 0xEF, 0xFE, 0xEF, 0xED, 0xDC, + 0xBB, 0xBB, 0xBB, 0xCC, 0xCE, 0xEE, 0xFF, 0xED, 0xED, 0xDC, 0xBA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCD, 0xEE, 0xFD, 0xDE, 0xDC, 0xBA, 0x99, 0x98, 0x89, + 0x9A, 0xAB, 0xCD, 0xEF, 0xDD, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x78, 0x9A, + 0xBB, 0xCD, 0xED, 0xCD, 0xCB, 0xA8, 0x87, 0x66, 0x66, 0x78, 0x9A, 0xBC, + 0xDE, 0xDC, 0xDB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xED, + 0xCD, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x66, 0x79, 0xAB, 0xCD, 0xDC, 0xCB, + 0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xDD, 0xCC, 0xBA, 0x87, + 0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x76, 0x65, + 0x45, 0x56, 0x67, 0x9A, 0xBC, 0xDD, 0xDD, 0xCA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAB, 0xCD, 0xDD, 0xDC, 0xBA, 0x98, 0x76, 0x66, 0x67, 0x88, + 0x9A, 0xBD, 0xDD, 0xDD, 0xCB, 0xAA, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC, + 0xCE, 0xDE, 0xED, 0xCB, 0xAA, 0x99, 0x88, 0x89, 0x9A, 0xBC, 0xCD, 0xED, + 0xEF, 0xED, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBC, 0xCD, 0xEE, 0xDE, 0xFE, + 0xDD, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xFE, 0xDF, 0xFE, 0xDD, + 0xDC, 0xCC, 0xCC, 0xCC, 0xDE, 0xEE, 0xEF, 0xEE, 0xFF, 0xEF, 0xEE, 0xDE, + 0xDD, 0xDD, 0xDE, 0xEF, 0xFF, 0xFF, 0xAE, 0xDD, 0xDD, 0xED, 0xDD, 0xDD, + 0xDD, 0xDE, 0xEE, 0xEE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFE, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xCC, + 0xCC, 0xCD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xCB, 0xAA, 0xAB, + 0xBC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0x99, 0x89, 0x9A, 0xBC, + 0xDF, 0xFF, 0xFF, 0xFF, 0xFD, 0xBA, 0x98, 0x77, 0x77, 0x89, 0xBC, 0xDF, + 0xFF, 0xFF, 0xFF, 0xCB, 0x98, 0x66, 0x55, 0x67, 0x8A, 0xBD, 0xFF, 0xFF, + 0xFF, 0xFC, 0xA9, 0x76, 0x44, 0x45, 0x67, 0x9B, 0xCD, 0xFF, 0xFF, 0xFF, + 0xCA, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAC, 0xFF, 0xFF, 0xFF, 0xFC, 0xA9, + 0x75, 0x43, 0x24, 0x57, 0x8A, 0xCE, 0xFF, 0xFF, 0xFF, 0xCB, 0x97, 0x65, + 0x44, 0x46, 0x79, 0xAC, 0xDF, 0xFF, 0xFF, 0xFD, 0xBA, 0x87, 0x65, 0x56, + 0x68, 0x9B, 0xCD, 0xFF, 0xFF, 0xFF, 0xDC, 0xB9, 0x87, 0x77, 0x78, 0x9A, + 0xBD, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0x99, 0x89, 0x9A, 0xBC, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBB, 0xAA, 0xAB, 0xBC, 0xDF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xDD, 0xCC, 0xCC, 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xED, 0xCD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xDD, 0x9E, 0xFE, + 0xDD, 0xDC, 0xCC, 0xBC, 0xCC, 0xDD, 0xEE, 0xEF, 0xFE, 0xDE, 0xDD, 0xCC, + 0xBB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xEF, 0xED, 0xED, 0xCB, 0xBA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCD, 0xDE, 0xEE, 0xDD, 0xCC, 0xBA, 0x99, 0x98, 0x99, + 0x9A, 0xAB, 0xCC, 0xDE, 0xDC, 0xDC, 0xBA, 0x98, 0x88, 0x77, 0x88, 0x99, + 0xAB, 0xCD, 0xED, 0xCC, 0xBA, 0x99, 0x87, 0x76, 0x67, 0x78, 0x9A, 0xBC, + 0xDD, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD, + 0xCC, 0xBA, 0x98, 0x76, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB, + 0xA8, 0x76, 0x54, 0x34, 0x55, 0x67, 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x97, + 0x65, 0x44, 0x34, 0x56, 0x78, 0x9B, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x56, 0x68, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x56, + 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB, 0xBA, 0x98, 0x77, 0x66, 0x77, 0x88, + 0x9A, 0xBC, 0xDD, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x78, 0x89, 0x9A, 0xBC, + 0xDE, 0xDD, 0xEC, 0xCB, 0xAA, 0x99, 0x88, 0x99, 0x9A, 0xBB, 0xCD, 0xED, + 0xDE, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xEF, 0xED, 0xEE, + 0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEF, 0xEE, 0xEF, 0xFE, 0xDD, + 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xFF, 0xED, 0xFF, 0xEE, 0xED, 0xDD, + 0xCD, 0xDD, 0xDD, 0xEE, 0xFF, 0xFF, 0x8E, 0xDD, 0xDD, 0xCC, 0xCC, 0xCD, + 0xDD, 0xDD, 0xDE, 0xEE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBB, 0xAA, 0xAA, 0xA9, 0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0x9B, 0xCC, + 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCC, 0xEC, 0xBC, 0xBB, 0xAA, + 0xA9, 0x99, 0x99, 0xAA, 0xAA, 0xBC, 0xCD, 0xBB, 0xBB, 0xAA, 0x99, 0x98, + 0x88, 0x89, 0x9A, 0xAB, 0xBC, 0xCB, 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, + 0x88, 0x99, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x99, 0xAB, 0xCB, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x88, 0x9A, + 0xAB, 0xBA, 0xA9, 0x98, 0x77, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xBB, + 0x9A, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xA9, 0xA9, + 0x87, 0x76, 0x55, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBA, 0x9A, 0x98, 0x87, + 0x65, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xAA, 0xA9, 0x88, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x87, 0x76, 0x65, 0x56, + 0x66, 0x78, 0x99, 0xAB, 0xAA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x89, 0xAA, 0xBA, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, 0x9A, + 0xBB, 0xBA, 0xBB, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, + 0xBC, 0xBB, 0xA9, 0x99, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xBB, 0xCC, + 0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCC, 0xBC, 0xCC, 0xBB, + 0xBA, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0xDD, 0xCC, 0xDD, 0xDC, 0xCB, 0xBB, + 0xBB, 0xBB, 0xBC, 0xCC, 0xCD, 0xEC, 0x8C, 0xBB, 0xBB, 0xBA, 0xAA, 0xAA, + 0xAA, 0xBB, 0xBC, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0x9B, 0xCB, + 0xBA, 0xAA, 0xA9, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xCB, 0xAB, 0xBA, 0xA9, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xBA, 0xBA, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x99, 0x9A, 0xBB, 0xCB, 0xAA, 0xA9, 0x98, 0x88, 0x77, 0x77, + 0x88, 0x89, 0x9A, 0xBB, 0xB9, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0xAA, 0xBA, 0x9A, 0x99, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x99, + 0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA, + 0x99, 0x98, 0x77, 0x66, 0x65, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0x99, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0x99, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x87, 0x76, 0x66, + 0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x67, 0x78, 0x89, 0xAA, 0xA9, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x67, 0x77, + 0x88, 0x9A, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x87, 0x77, 0x78, 0x88, 0x99, 0xAA, 0xBA, + 0xAB, 0xBA, 0x99, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xBB, 0xCB, + 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xBA, + 0xAA, 0xA9, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xBB, 0xDC, 0xCB, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBB, 0xCC, 0xDC, 0x9B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0x8B, 0xDC, + 0xCB, 0xBB, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0xDD, 0xDC, 0xBC, 0xCB, 0xBA, + 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCD, 0xCB, 0xCB, 0xBA, 0x99, 0x98, + 0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xCB, 0xAB, 0xAA, 0x99, 0x88, 0x87, 0x88, + 0x88, 0x9A, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x77, 0x88, 0x9A, + 0xBB, 0xBA, 0xA9, 0x98, 0x76, 0x66, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xBA, + 0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xBA, 0xA9, + 0x88, 0x76, 0x55, 0x55, 0x55, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x98, 0x87, + 0x65, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x87, 0x76, 0x65, 0x56, + 0x66, 0x78, 0x99, 0xAB, 0xAA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAB, 0xBB, 0xAB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, 0x9A, + 0xBC, 0xBB, 0xCB, 0xAA, 0x98, 0x88, 0x87, 0x88, 0x89, 0x9A, 0xAB, 0xCB, + 0xBC, 0xBB, 0xAA, 0x99, 0x98, 0x88, 0x99, 0x9A, 0xAB, 0xCC, 0xBB, 0xCC, + 0xBB, 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xAB, 0xCC, 0xCC, 0xBD, 0xCC, 0xBB, + 0xBA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xCD, 0xCC, 0xDD, 0xCC, 0xCB, 0xBB, + 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xDC, 0x8C, 0xBB, 0xBB, 0xBB, 0xAA, 0xAA, + 0xBB, 0xBB, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xDD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xCD, 0xDD, 0x8E, 0xFE, + 0xED, 0xDD, 0xCC, 0xCC, 0xCD, 0xDD, 0xEF, 0xFF, 0xFD, 0xDE, 0xED, 0xCC, + 0xCB, 0xBB, 0xBB, 0xCC, 0xCD, 0xEE, 0xEF, 0xED, 0xDD, 0xCC, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCD, 0xEE, 0xFD, 0xDD, 0xDC, 0xBA, 0xA9, 0x99, 0x99, + 0x9A, 0xBB, 0xCD, 0xEE, 0xEC, 0xDC, 0xBA, 0xA9, 0x88, 0x77, 0x88, 0x9A, + 0xBC, 0xCE, 0xED, 0xCD, 0xCB, 0xA9, 0x87, 0x76, 0x67, 0x78, 0x9A, 0xBC, + 0xDE, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xED, + 0xCC, 0xBA, 0x98, 0x76, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB, + 0xA9, 0x76, 0x54, 0x34, 0x45, 0x68, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, + 0x65, 0x44, 0x34, 0x56, 0x79, 0xAB, 0xCD, 0xDC, 0xDB, 0xA9, 0x87, 0x65, + 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xDD, 0xDD, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAB, 0xCE, 0xDC, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x77, 0x89, + 0xAB, 0xCC, 0xDD, 0xDD, 0xDB, 0xAA, 0x98, 0x87, 0x78, 0x89, 0x9A, 0xBC, + 0xDE, 0xDD, 0xED, 0xCB, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xCD, 0xED, + 0xDE, 0xDD, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xEF, 0xED, 0xFF, + 0xED, 0xDC, 0xCB, 0xBB, 0xBB, 0xBC, 0xDD, 0xEE, 0xFE, 0xDF, 0xFE, 0xDD, + 0xDC, 0xCC, 0xCC, 0xDD, 0xDD, 0xEE, 0xFF, 0xFD, 0xFF, 0xFE, 0xEE, 0xED, + 0xDD, 0xDD, 0xEE, 0xEE, 0xFF, 0xFF, 0x9D, 0xDD, 0xDE, 0xDD, 0xDD, 0xCD, + 0xDD, 0xEE, 0xDE, 0xEF, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xCF, 0xFE, 0xEE, 0xDE, 0xDD, 0xDD, 0xDD, 0xED, 0xDD, 0xDD, 0x9F, 0xFF, + 0xFF, 0xFF, 0xEE, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEE, + 0xDD, 0xDD, 0xCD, 0xDD, 0xDE, 0xEF, 0xFF, 0xEE, 0xFF, 0xED, 0xDC, 0xCB, + 0xBB, 0xCC, 0xCD, 0xEE, 0xFF, 0xFE, 0xEF, 0xED, 0xCC, 0xBA, 0xAA, 0xAA, + 0xBB, 0xCD, 0xEE, 0xFF, 0xFE, 0xEE, 0xDC, 0xBA, 0x98, 0x88, 0x99, 0xAB, + 0xCD, 0xDE, 0xFE, 0xEF, 0xDC, 0xBA, 0x98, 0x77, 0x77, 0x89, 0xAB, 0xCD, + 0xFF, 0xEE, 0xED, 0xCA, 0x98, 0x76, 0x55, 0x67, 0x89, 0xAC, 0xDE, 0xFF, + 0xEE, 0xCB, 0xA8, 0x76, 0x54, 0x45, 0x67, 0x8A, 0xBD, 0xDF, 0xEE, 0xED, + 0xBA, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xDE, 0xFF, 0xDE, 0xCB, 0xA8, + 0x75, 0x43, 0x24, 0x57, 0x8A, 0xBD, 0xEF, 0xED, 0xED, 0xBA, 0x97, 0x65, + 0x44, 0x46, 0x78, 0xAB, 0xDD, 0xFE, 0xDF, 0xDC, 0xA9, 0x87, 0x65, 0x56, + 0x78, 0x9A, 0xCD, 0xEF, 0xEE, 0xED, 0xDB, 0xA9, 0x87, 0x77, 0x78, 0x9A, + 0xBC, 0xDF, 0xFE, 0xDF, 0xED, 0xCB, 0xA9, 0x98, 0x88, 0x9A, 0xBB, 0xDD, + 0xFF, 0xFD, 0xFE, 0xDD, 0xCB, 0xAA, 0xAA, 0xAA, 0xBC, 0xDD, 0xFE, 0xFE, + 0xDF, 0xEE, 0xDD, 0xCC, 0xCB, 0xBB, 0xBC, 0xCD, 0xEF, 0xFF, 0xFD, 0xFE, + 0xFE, 0xDD, 0xDC, 0xCC, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xDF, 0xFE, 0xFF, + 0xEE, 0xED, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xEF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8C, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, + 0xED, 0xFE, 0xEF, 0xFF, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xCD, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0x9E, 0xFE, + 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0xEE, 0xEE, 0xDE, 0xDD, 0xCC, + 0xBB, 0xBB, 0xBB, 0xBB, 0xCD, 0xDD, 0xEF, 0xED, 0xDD, 0xCB, 0xBA, 0xAA, + 0xAA, 0xAA, 0xAB, 0xCC, 0xDE, 0xED, 0xCD, 0xCB, 0xBA, 0x99, 0x98, 0x89, + 0x9A, 0xAB, 0xCC, 0xDE, 0xDC, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x99, + 0xAB, 0xCD, 0xED, 0xCC, 0xBA, 0x98, 0x87, 0x66, 0x66, 0x78, 0x99, 0xAB, + 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD, + 0xCC, 0xBA, 0x97, 0x66, 0x54, 0x45, 0x66, 0x89, 0xAB, 0xCD, 0xDC, 0xCB, + 0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x89, 0xBC, 0xDD, 0xCC, 0xBA, 0x87, + 0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x86, 0x65, + 0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x56, + 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xDC, 0xAA, 0x98, 0x77, 0x66, 0x67, 0x88, + 0x9A, 0xBD, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x88, 0x9A, 0xBC, + 0xDE, 0xDD, 0xDC, 0xCB, 0xAA, 0x99, 0x88, 0x89, 0x9A, 0xBC, 0xCD, 0xEE, + 0xDD, 0xDC, 0xCB, 0xAA, 0xAA, 0xAA, 0xAA, 0xBC, 0xCD, 0xEF, 0xED, 0xEE, + 0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEE, 0xFE, 0xDE, 0xEE, 0xDD, + 0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xEE, 0xFF, 0xED, 0xFF, 0xEE, 0xEE, 0xDD, + 0xDD, 0xDD, 0xDE, 0xEE, 0xFF, 0xFF, 0x9D, 0xED, 0xDD, 0xDD, 0xDD, 0xDD, + 0xDD, 0xDE, 0xEE, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xDD, 0xCC, 0xCB, 0xBB, 0xBB, 0xBC, 0xCC, 0xCD, 0xDD, 0xAE, 0xEE, + 0xDC, 0xCC, 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xDE, 0xED, 0xDE, 0xDC, 0xCB, + 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDE, 0xDD, 0xDC, 0xCB, 0xAA, 0x99, + 0x99, 0x99, 0xAA, 0xBC, 0xCD, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0xAA, 0xBC, 0xDD, 0xDC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89, + 0xAA, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xCB, 0xBA, 0x98, 0x77, 0x65, 0x55, 0x56, 0x78, 0x89, 0xAB, 0xDC, + 0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBC, 0xAA, 0x88, 0x76, 0x65, 0x55, + 0x67, 0x78, 0x9A, 0xBC, 0xCC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x99, 0xAB, + 0xCD, 0xDC, 0xCC, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCC, 0xDD, + 0xCD, 0xCC, 0xBA, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xDD, 0xED, + 0xCC, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xEE, 0xDE, 0xDD, 0xDC, + 0xCB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xEF, 0xED, 0xFE, 0xED, 0xDD, 0xCC, + 0xCC, 0xCC, 0xDD, 0xDE, 0xEF, 0xFE, 0xAD, 0xDD, 0xDD, 0xCC, 0xCC, 0xCC, + 0xCD, 0xDD, 0xDE, 0xEE, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0x9E, 0xFE, + 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDE, 0xEE, 0xED, 0xDE, 0xED, 0xCC, + 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xDD, 0xED, 0xCB, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xED, 0xDD, 0xCC, 0xBA, 0x99, 0x98, 0x99, + 0x9A, 0xAB, 0xCD, 0xDE, 0xDC, 0xDC, 0xBA, 0x99, 0x88, 0x77, 0x88, 0x99, + 0xAB, 0xCD, 0xED, 0xCC, 0xBA, 0xA9, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBC, + 0xCD, 0xCC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC, + 0xCC, 0xBA, 0x98, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xCB, + 0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xDC, 0xCC, 0xBA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xCC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88, + 0x9A, 0xBC, 0xDC, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC, + 0xDD, 0xDC, 0xDC, 0xCB, 0xAA, 0x99, 0x88, 0x99, 0x9A, 0xBB, 0xCD, 0xED, + 0xDE, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDE, 0xDD, 0xED, + 0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xED, 0xDF, 0xED, 0xDD, + 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xEF, 0xDD, 0xEE, 0xEE, 0xDD, 0xDD, + 0xDD, 0xDD, 0xDE, 0xEE, 0xEF, 0xFE, 0x9D, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, + 0xCD, 0xDD, 0xDD, 0xDE, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xFF, 0xFF, 0xFE, 0xFD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0x8F, 0xFF, + 0xFF, 0xFF, 0xFE, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xEE, 0xFE, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xEE, 0xDD, + 0xDD, 0xDD, 0xFE, 0xFF, 0xEF, 0xFF, 0xFF, 0xFE, 0xFD, 0xCC, 0xBB, 0xBC, + 0xCC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, 0xCB, 0xBA, 0xAA, 0xAB, 0xCD, + 0xDE, 0xFF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x88, 0x88, 0x9A, 0xCD, 0xEF, + 0xFF, 0xFF, 0xFF, 0xEC, 0xA9, 0x86, 0x66, 0x78, 0x9B, 0xCE, 0xFF, 0xFF, + 0xFF, 0xED, 0xCA, 0x86, 0x54, 0x45, 0x78, 0xAC, 0xDE, 0xFF, 0xFF, 0xFF, + 0xCB, 0xA8, 0x64, 0x22, 0x46, 0x8A, 0xBD, 0xFF, 0xFF, 0xEF, 0xFE, 0xBA, + 0x86, 0x42, 0x24, 0x68, 0xAC, 0xDE, 0xFF, 0xFF, 0xFE, 0xDC, 0xA8, 0x75, + 0x44, 0x56, 0x8A, 0xBD, 0xFF, 0xFF, 0xFF, 0xED, 0xCB, 0x98, 0x76, 0x66, + 0x79, 0xAC, 0xDF, 0xFF, 0xFF, 0xFF, 0xED, 0xCA, 0x98, 0x88, 0x89, 0xAB, + 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xBB, 0xAA, 0xAA, 0xAB, 0xCD, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xCC, 0xBB, 0xCC, 0xDD, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFE, 0xED, 0xDD, 0xDD, 0xDE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9E, 0xFE, 0xFF, 0xEF, 0xFF, 0xFE, + 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xDD, 0xCC, 0xCB, 0xBB, 0xBB, 0xCC, 0xCC, 0xCD, 0xDD, 0x9D, 0xFE, + 0xDD, 0xCC, 0xCB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEE, 0xFE, 0xDE, 0xDD, 0xCC, + 0xBB, 0xAA, 0xAB, 0xBB, 0xBC, 0xDD, 0xEE, 0xED, 0xDD, 0xCB, 0xAA, 0xA9, + 0x99, 0x9A, 0xAB, 0xCC, 0xDD, 0xED, 0xCD, 0xCB, 0xAA, 0x98, 0x88, 0x88, + 0x99, 0xAB, 0xBC, 0xDE, 0xDC, 0xCB, 0xBA, 0x98, 0x87, 0x77, 0x78, 0x89, + 0xAB, 0xCD, 0xED, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x78, 0x89, 0xAB, + 0xCD, 0xCC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD, + 0xBB, 0xA9, 0x87, 0x66, 0x54, 0x55, 0x66, 0x78, 0x9A, 0xCD, 0xCB, 0xBA, + 0x98, 0x76, 0x54, 0x44, 0x45, 0x67, 0x89, 0xAB, 0xCC, 0xBC, 0xA9, 0x87, + 0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xCA, 0x98, 0x76, 0x65, + 0x54, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x56, + 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xCB, 0xA9, 0x88, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBC, 0xDC, 0xCC, 0xCA, 0xA9, 0x88, 0x77, 0x77, 0x88, 0x9A, 0xBB, + 0xCD, 0xDC, 0xDC, 0xBA, 0xA9, 0x98, 0x88, 0x89, 0x9A, 0xAB, 0xCD, 0xDD, + 0xDE, 0xDC, 0xBB, 0xAA, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xDE, 0xDD, 0xED, + 0xDC, 0xCB, 0xBA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDE, 0xFE, 0xDE, 0xED, 0xDC, + 0xCC, 0xCB, 0xBB, 0xCC, 0xDD, 0xDE, 0xEF, 0xED, 0xEF, 0xEE, 0xDD, 0xDD, + 0xDC, 0xDD, 0xDD, 0xEE, 0xFF, 0xFE, 0x8D, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, + 0xCC, 0xCD, 0xDE, 0xEE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0x9C, 0xDC, + 0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDC, 0xBC, 0xCB, 0xAA, + 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCD, 0xCB, 0xCB, 0xAA, 0x99, 0x98, + 0x88, 0x99, 0x99, 0xAB, 0xBC, 0xDC, 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88, + 0x88, 0x99, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xAB, 0xCB, 0xAB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x9A, + 0xBB, 0xBA, 0xA9, 0x98, 0x76, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xBB, + 0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xBA, 0xA9, + 0x88, 0x76, 0x55, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0x98, 0x87, + 0x65, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xBA, 0xA9, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0x99, 0x87, 0x76, 0x65, 0x56, + 0x66, 0x78, 0x99, 0xAB, 0xBA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAA, 0xBB, 0xAB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A, + 0xBC, 0xBB, 0xBB, 0xA9, 0x98, 0x88, 0x87, 0x88, 0x89, 0x9A, 0xBB, 0xCB, + 0xBC, 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCD, 0xCB, 0xDC, + 0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xDC, 0xBD, 0xCC, 0xBB, + 0xBA, 0xAA, 0xAA, 0xBB, 0xBB, 0xCC, 0xDE, 0xCC, 0xED, 0xCC, 0xCB, 0xBB, + 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xED, 0x8C, 0xCC, 0xBB, 0xBB, 0xBB, 0xBB, + 0xBB, 0xBC, 0xCC, 0xDD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0x9B, 0xCB, + 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDB, 0xBB, 0xBA, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBA, 0xBA, 0xA9, 0x99, 0x88, + 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x78, + 0x88, 0x89, 0xAA, 0xBB, 0xBA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, + 0x99, 0xAA, 0xBA, 0x9A, 0x99, 0x87, 0x77, 0x66, 0x66, 0x77, 0x88, 0x99, + 0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xBA, + 0x9A, 0x98, 0x77, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAA, 0xA9, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x88, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x78, 0x89, 0xAA, 0xA9, 0xA9, 0x98, 0x87, 0x76, 0x66, 0x67, 0x77, + 0x89, 0x9A, 0xBA, 0xAA, 0xA9, 0x88, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xAB, 0xAA, 0xBA, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xBB, + 0xAB, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x89, 0x99, 0xAA, 0xBC, 0xBA, 0xCB, + 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xBA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xBB, 0xCC, 0xCB, 0xBB, 0xBA, + 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDC, 0x9B, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAB, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0x9C, 0xDC, + 0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDC, 0xBC, 0xBB, 0xAA, + 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCD, 0xBB, 0xCB, 0xAA, 0x99, 0x98, + 0x88, 0x89, 0x99, 0xAB, 0xBC, 0xCB, 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x78, + 0x88, 0x99, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x77, 0x88, 0x9A, + 0xBB, 0xBA, 0xA9, 0x98, 0x76, 0x66, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xBB, + 0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xAA, 0xA9, + 0x87, 0x76, 0x55, 0x55, 0x55, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x98, 0x87, + 0x65, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xAA, 0xA9, 0x88, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x99, 0x87, 0x76, 0x65, 0x56, + 0x67, 0x78, 0x99, 0xAB, 0xAA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x67, 0x78, + 0x89, 0xAA, 0xBB, 0xAB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, 0x9A, + 0xBC, 0xBA, 0xBB, 0xA9, 0x98, 0x88, 0x87, 0x88, 0x89, 0x9A, 0xAB, 0xCB, + 0xBC, 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xBB, 0xCC, + 0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDB, 0xBD, 0xCC, 0xBB, + 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xCC, 0xDD, 0xCC, 0xCB, 0xBB, + 0xBB, 0xBB, 0xBC, 0xCC, 0xCD, 0xDC, 0x8C, 0xCB, 0xBB, 0xBA, 0xAA, 0xAA, + 0xBB, 0xBB, 0xBC, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xDC, 0xCC, 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCC, 0xCD, 0x8D, 0xEE, + 0xDD, 0xCC, 0xCB, 0xBB, 0xCC, 0xCC, 0xDD, 0xEE, 0xFD, 0xDD, 0xDC, 0xCB, + 0xBA, 0xAA, 0xAB, 0xBB, 0xBC, 0xDD, 0xEF, 0xDD, 0xDC, 0xCB, 0xAA, 0xA9, + 0x99, 0x9A, 0xAB, 0xBC, 0xDD, 0xED, 0xCC, 0xCB, 0xAA, 0x98, 0x88, 0x88, + 0x99, 0xAB, 0xBC, 0xDD, 0xDC, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x78, 0x89, + 0xAB, 0xCC, 0xDC, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xCB, 0xBB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC, + 0xBB, 0xA9, 0x87, 0x66, 0x54, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, + 0x98, 0x76, 0x54, 0x44, 0x45, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87, + 0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x65, + 0x54, 0x56, 0x67, 0x89, 0xAB, 0xCC, 0xBC, 0xBA, 0x98, 0x76, 0x65, 0x56, + 0x67, 0x88, 0x9B, 0xBD, 0xCC, 0xCB, 0xA9, 0x88, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBC, 0xDD, 0xCD, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x88, 0x9A, 0xAB, + 0xCD, 0xCC, 0xDC, 0xBB, 0xA9, 0x98, 0x88, 0x89, 0x99, 0xAB, 0xCD, 0xDD, + 0xDD, 0xCC, 0xBA, 0xAA, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDE, 0xDD, 0xED, + 0xDC, 0xCB, 0xBA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDE, 0xEE, 0xDE, 0xDD, 0xDC, + 0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xED, 0xFF, 0xDE, 0xDD, 0xDC, + 0xCC, 0xCD, 0xDD, 0xEE, 0xEF, 0xFE, 0x9D, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, + 0xCD, 0xDD, 0xDE, 0xEE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xEF, 0xFF, 0xFF, 0xFE, 0xEF, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0x9F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xEE, 0xDE, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, + 0xDD, 0xDD, 0xDD, 0xDD, 0xEE, 0xFF, 0xFF, 0xEF, 0xFF, 0xFD, 0xDC, 0xCC, + 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFE, 0xFF, 0xFE, 0xDC, 0xBA, 0xAA, 0xAA, + 0xAB, 0xCD, 0xEF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0x98, 0x88, 0x89, 0xAB, + 0xCD, 0xEF, 0xFF, 0xEF, 0xDC, 0xBA, 0x98, 0x76, 0x77, 0x89, 0xAB, 0xCD, + 0xFF, 0xEE, 0xED, 0xCA, 0x98, 0x66, 0x55, 0x66, 0x89, 0xAB, 0xDE, 0xFF, + 0xEE, 0xDB, 0xA8, 0x76, 0x44, 0x45, 0x67, 0x8A, 0xCD, 0xFF, 0xFE, 0xFD, + 0xBA, 0x86, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xDE, 0xFF, 0xDE, 0xDB, 0xA8, + 0x75, 0x43, 0x34, 0x56, 0x8A, 0xBD, 0xEF, 0xFE, 0xFD, 0xBA, 0x87, 0x65, + 0x44, 0x45, 0x78, 0xAB, 0xDE, 0xFF, 0xEE, 0xDC, 0xA9, 0x87, 0x65, 0x55, + 0x68, 0x9A, 0xCD, 0xFF, 0xFE, 0xFD, 0xCB, 0xA9, 0x87, 0x76, 0x77, 0x9A, + 0xBC, 0xEF, 0xFF, 0xEF, 0xFD, 0xCB, 0xA9, 0x88, 0x88, 0x9A, 0xBC, 0xDF, + 0xFF, 0xFD, 0xFE, 0xDC, 0xCB, 0xAA, 0x9A, 0xAA, 0xBC, 0xDF, 0xFF, 0xFF, + 0xDF, 0xFE, 0xDD, 0xCC, 0xBB, 0xBB, 0xCD, 0xDD, 0xFF, 0xFF, 0xFD, 0xFF, + 0xFE, 0xED, 0xDC, 0xDC, 0xDD, 0xEE, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xEE, + 0xEF, 0xED, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xDD, 0xCD, 0xDE, 0xDD, 0xDF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xDE, 0xDD, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0x9E, 0xFE, + 0xED, 0xDD, 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xEF, 0xFD, 0xEE, 0xED, 0xDC, + 0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xED, 0xED, 0xCC, 0xBA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFD, 0xDE, 0xCC, 0xBA, 0x99, 0x98, 0x99, + 0x9A, 0xAB, 0xCD, 0xDE, 0xDD, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A, + 0xAB, 0xCD, 0xED, 0xCD, 0xCB, 0xA8, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBC, + 0xDD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD, + 0xCC, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB, + 0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x87, + 0x65, 0x44, 0x44, 0x56, 0x79, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDD, 0xCD, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAC, 0xCE, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x66, 0x67, 0x89, + 0xAB, 0xCD, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC, + 0xDE, 0xEC, 0xDD, 0xCB, 0xAA, 0x99, 0x89, 0x99, 0xAA, 0xBC, 0xDE, 0xEE, + 0xDD, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xEF, 0xEC, 0xED, + 0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xFE, 0xDF, 0xEE, 0xDD, + 0xCC, 0xCC, 0xCC, 0xCD, 0xED, 0xFE, 0xFF, 0xFC, 0xFF, 0xFE, 0xED, 0xDD, + 0xDD, 0xDD, 0xEE, 0xFE, 0xFF, 0xFF, 0x9D, 0xED, 0xDD, 0xDD, 0xDD, 0xDD, + 0xED, 0xDE, 0xEF, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xDD, 0xDC, 0xCC, 0xBB, 0xBB, 0xBC, 0xCC, 0xCD, 0xDD, 0xAE, 0xEE, + 0xDD, 0xCC, 0xCB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEE, 0xEE, 0xDE, 0xDD, 0xCB, + 0xBA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDE, 0xDD, 0xDC, 0xCB, 0xAA, 0x99, + 0x99, 0x9A, 0xAA, 0xBC, 0xCD, 0xED, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0xAA, 0xBC, 0xCD, 0xDC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x78, 0x89, + 0xAA, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xDC, 0xCA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xDC, + 0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, + 0x98, 0x76, 0x54, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x65, + 0x54, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBC, 0xAA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x78, 0x9A, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x99, 0xAB, + 0xCD, 0xDC, 0xDC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xED, + 0xCD, 0xCC, 0xBA, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xED, 0xED, + 0xCC, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDE, 0xFE, 0xDE, 0xDD, 0xCC, + 0xCC, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xFF, 0xED, 0xFE, 0xED, 0xDD, 0xCC, + 0xCC, 0xCD, 0xDD, 0xEE, 0xEF, 0xFF, 0xAD, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, + 0xCD, 0xDD, 0xEE, 0xEF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xED, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0x9E, 0xFF, + 0xEE, 0xDD, 0xCC, 0xCC, 0xCC, 0xCD, 0xDE, 0xEF, 0xFD, 0xEF, 0xED, 0xDC, + 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xDD, 0xED, 0xCC, 0xBB, 0xAA, + 0xAA, 0xAA, 0xAB, 0xCC, 0xDD, 0xED, 0xDE, 0xDC, 0xBA, 0xA9, 0x98, 0x89, + 0x9A, 0xAB, 0xCC, 0xDE, 0xDD, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x99, + 0xAB, 0xCD, 0xED, 0xCD, 0xCB, 0xA8, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBB, + 0xCD, 0xDC, 0xDB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD, + 0xCC, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB, + 0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88, + 0x9A, 0xBC, 0xDD, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x78, 0x89, 0x9A, 0xBC, + 0xCD, 0xDD, 0xDC, 0xCB, 0xAA, 0x99, 0x98, 0x99, 0x9A, 0xBB, 0xCD, 0xDD, + 0xDE, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDD, 0xDD, 0xED, + 0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xED, 0xDE, 0xED, 0xDD, + 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDE, 0xEF, 0xDD, 0xFE, 0xEE, 0xDD, 0xDD, + 0xDD, 0xDD, 0xDE, 0xEE, 0xEF, 0xFE, 0x9D, 0xDD, 0xDD, 0xDD, 0xDD, 0xCC, + 0xDD, 0xDD, 0xDE, 0xDE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xFF, 0xFE, 0xEE, 0xDD, 0xDD, 0xDC, 0xCC, 0xDD, 0xCD, 0x8F, 0xFF, + 0xFF, 0xFF, 0xFE, 0xDE, 0xEE, 0xDF, 0xEF, 0xFF, 0xFE, 0xEF, 0xFF, 0xFF, + 0xDD, 0xDC, 0xCC, 0xDD, 0xDE, 0xEE, 0xFF, 0xDF, 0xFF, 0xEE, 0xDC, 0xCB, + 0xBB, 0xBC, 0xCD, 0xDD, 0xFF, 0xFE, 0xFF, 0xFD, 0xDC, 0xBA, 0xAA, 0xAA, + 0xAB, 0xCD, 0xEE, 0xFF, 0xEE, 0xEE, 0xCC, 0xBA, 0x98, 0x88, 0x89, 0xAB, + 0xCC, 0xEF, 0xFF, 0xFF, 0xDC, 0xBA, 0x88, 0x77, 0x77, 0x89, 0xAB, 0xCD, + 0xEF, 0xFE, 0xED, 0xCA, 0x97, 0x65, 0x55, 0x67, 0x89, 0xAC, 0xDE, 0xFE, + 0xEE, 0xDB, 0xA8, 0x75, 0x44, 0x45, 0x67, 0x8A, 0xBD, 0xEE, 0xED, 0xFC, + 0xBA, 0x87, 0x54, 0x33, 0x45, 0x78, 0x9B, 0xDE, 0xFF, 0xDD, 0xCB, 0xA8, + 0x75, 0x43, 0x34, 0x57, 0x8A, 0xBC, 0xEF, 0xFD, 0xDC, 0xBA, 0x87, 0x65, + 0x44, 0x45, 0x78, 0xAB, 0xDE, 0xFF, 0xDE, 0xDC, 0xA9, 0x87, 0x65, 0x55, + 0x68, 0x9A, 0xCD, 0xEF, 0xFD, 0xED, 0xCB, 0xA9, 0x87, 0x77, 0x78, 0x9A, + 0xBC, 0xEF, 0xFF, 0xDE, 0xEC, 0xCB, 0xA9, 0x88, 0x88, 0x9A, 0xBC, 0xDD, + 0xFF, 0xFF, 0xFF, 0xDC, 0xBB, 0xAA, 0xAA, 0xAA, 0xBC, 0xDD, 0xEF, 0xFF, + 0xEF, 0xFE, 0xDD, 0xCC, 0xBB, 0xBB, 0xCC, 0xDD, 0xFF, 0xFF, 0xFE, 0xFE, + 0xEE, 0xDD, 0xDC, 0xCC, 0xCD, 0xDF, 0xEF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, + 0xEE, 0xED, 0xEE, 0xEE, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xEF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xDD, 0xDE, 0xED, 0xDE, 0xFF, + 0xEF, 0xFF, 0xFF, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCF, 0xDD, 0xDC, 0xCC, 0xCC, 0xCB, 0xCC, 0xCC, 0xCC, 0xCD, 0x8E, 0xFE, + 0xED, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xEE, 0xEF, 0xFD, 0xDE, 0xED, 0xCC, + 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xED, 0xED, 0xCB, 0xBA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFD, 0xDD, 0xCC, 0xBA, 0x99, 0x99, 0x99, + 0x9A, 0xAB, 0xCD, 0xEE, 0xDC, 0xDC, 0xBA, 0x98, 0x88, 0x77, 0x88, 0x99, + 0xAB, 0xCD, 0xED, 0xCC, 0xCA, 0x98, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBB, + 0xDD, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD, + 0xCC, 0xBA, 0x98, 0x66, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB, + 0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x97, + 0x65, 0x44, 0x34, 0x56, 0x79, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x56, 0x68, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x56, + 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88, + 0x9A, 0xBC, 0xED, 0xCD, 0xCB, 0xAA, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC, + 0xDE, 0xDC, 0xDC, 0xCB, 0xAA, 0x99, 0x88, 0x99, 0x9A, 0xBC, 0xCD, 0xEE, + 0xDE, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBC, 0xCD, 0xDF, 0xED, 0xED, + 0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEE, 0xFE, 0xDE, 0xED, 0xDD, + 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xEF, 0xFF, 0xED, 0xFE, 0xEE, 0xED, 0xDD, + 0xCD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0x7C, 0xCC, 0xCC, 0xCC, 0xDC, 0xCD, + 0xDD, 0xDE, 0xEE, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xBC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0x8C, 0xDD, + 0xCB, 0xBB, 0xBA, 0xAA, 0xAB, 0xBB, 0xBC, 0xCD, 0xDC, 0xCC, 0xCB, 0xBA, + 0xAA, 0x99, 0x9A, 0xAA, 0xAB, 0xBC, 0xDD, 0xCB, 0xCB, 0xBA, 0xA9, 0x99, + 0x89, 0x99, 0x9A, 0xAB, 0xBC, 0xDC, 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88, + 0x89, 0x9A, 0xAB, 0xCC, 0xBB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xAB, 0xCB, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x89, 0x9A, + 0xBC, 0xBA, 0xAA, 0x98, 0x77, 0x66, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xCB, + 0xAA, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xAB, 0xBA, 0xA9, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0x9A, 0xBB, 0xAA, 0x99, 0x87, + 0x66, 0x54, 0x45, 0x56, 0x78, 0x99, 0xAB, 0xBA, 0xAA, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x89, 0xAA, 0xBB, 0xAA, 0xA9, 0x88, 0x76, 0x65, 0x56, + 0x66, 0x78, 0x9A, 0xAB, 0xBA, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x67, 0x78, + 0x89, 0xAB, 0xCB, 0xBB, 0xAA, 0x99, 0x87, 0x77, 0x77, 0x78, 0x89, 0x9A, + 0xBC, 0xBB, 0xCB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xBB, 0xCC, + 0xBC, 0xBB, 0xAA, 0x99, 0x99, 0x89, 0x99, 0xAA, 0xBB, 0xCD, 0xCB, 0xCC, + 0xCB, 0xAA, 0xA9, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xDC, 0xBD, 0xDC, 0xBB, + 0xBA, 0xAA, 0xAA, 0xBB, 0xBB, 0xCC, 0xDE, 0xCC, 0xDD, 0xDC, 0xCC, 0xBB, + 0xBB, 0xBB, 0xCC, 0xCD, 0xDD, 0xED, 0x8C, 0xCB, 0xBB, 0xBB, 0xBB, 0xBB, + 0xBB, 0xBC, 0xCC, 0xDD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBA, 0xAA, 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0x9B, 0xCC, + 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xCB, 0xBC, 0xBA, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBA, 0xBB, 0xA9, 0x99, 0x88, + 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x78, + 0x88, 0x99, 0xAA, 0xBB, 0xBA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, + 0x99, 0xAA, 0xBA, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x99, + 0xAB, 0xA9, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xBA, + 0x9A, 0x98, 0x77, 0x66, 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xA9, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x88, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x78, 0x89, 0xAA, 0xA9, 0xA9, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xAB, 0xAA, 0xBA, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xBB, + 0xAB, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x89, 0x99, 0xAA, 0xBC, 0xBB, 0xCB, + 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xCB, 0xBC, 0xCB, 0xBA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xCB, 0xDC, 0xCB, 0xBB, 0xBA, + 0xAA, 0xAB, 0xBB, 0xBC, 0xCD, 0xDC, 0x9B, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xBB, 0xBC, 0xCC, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0x8C, 0xDC, + 0xCB, 0xBB, 0xAA, 0xAA, 0xBB, 0xBB, 0xCC, 0xCD, 0xDC, 0xBD, 0xCB, 0xBA, + 0xAA, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xCB, 0xCB, 0xBA, 0xA9, 0x99, + 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDB, 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88, + 0x89, 0x9A, 0xAB, 0xBC, 0xBB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x88, + 0x9A, 0xBB, 0xCB, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x89, 0x9A, + 0xBB, 0xBA, 0xBA, 0x98, 0x77, 0x66, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xBB, + 0xAA, 0x99, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xBB, 0xBA, 0xA9, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAA, 0xBB, 0xAA, 0x99, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x99, 0xAB, 0xBA, 0xAA, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x89, 0x9A, 0xBB, 0xAB, 0xA9, 0x88, 0x76, 0x65, 0x56, + 0x67, 0x78, 0x9A, 0xAB, 0xBA, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x67, 0x78, + 0x89, 0xAB, 0xBB, 0xBB, 0xBA, 0x98, 0x88, 0x77, 0x77, 0x78, 0x89, 0x9A, + 0xBC, 0xBB, 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, + 0xBC, 0xBB, 0xAA, 0x99, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xCB, 0xDC, + 0xBB, 0xAA, 0xAA, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xDC, 0xCD, 0xCC, 0xCB, + 0xBB, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDD, 0xCC, 0xDD, 0xCC, 0xCC, 0xBB, + 0xBB, 0xBB, 0xCC, 0xCC, 0xDE, 0xED, 0x8C, 0xCB, 0xBB, 0xBB, 0xBB, 0xBB, + 0xBB, 0xBB, 0xCC, 0xCD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xEE, 0xED, 0xDC, 0xCC, 0xBC, 0xCC, 0xCC, 0xDC, 0xCD, 0x7E, 0xFF, + 0xEE, 0xDD, 0xCC, 0xCC, 0xCD, 0xDE, 0xEE, 0xEF, 0xFD, 0xEF, 0xED, 0xDC, + 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xEE, 0xFF, 0xED, 0xEE, 0xDC, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCD, 0xDF, 0xFE, 0xDE, 0xDC, 0xBA, 0xA9, 0x99, 0x99, + 0x9A, 0xAB, 0xCD, 0xEF, 0xED, 0xEC, 0xBA, 0x99, 0x88, 0x77, 0x88, 0x9A, + 0xBB, 0xDD, 0xED, 0xDD, 0xCB, 0x99, 0x87, 0x76, 0x67, 0x78, 0x9A, 0xBC, + 0xCE, 0xDD, 0xDB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xCD, 0xED, + 0xCC, 0xBA, 0x98, 0x76, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB, + 0xA9, 0x76, 0x54, 0x34, 0x45, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x97, + 0x65, 0x44, 0x34, 0x56, 0x79, 0xAB, 0xCD, 0xEC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x56, + 0x67, 0x89, 0xAB, 0xCE, 0xDD, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x77, 0x89, + 0xAB, 0xCD, 0xED, 0xDD, 0xCB, 0xAA, 0x98, 0x87, 0x78, 0x89, 0x9A, 0xBC, + 0xDF, 0xED, 0xED, 0xCB, 0xAA, 0x99, 0x89, 0x99, 0xAA, 0xBC, 0xDE, 0xEF, + 0xDE, 0xDD, 0xCC, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFE, 0xFD, 0xFE, + 0xDD, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xFF, 0xFF, 0xDF, 0xEF, 0xED, + 0xDD, 0xCC, 0xCC, 0xCD, 0xEE, 0xFE, 0xFF, 0xFD, 0xEF, 0xEE, 0xFE, 0xDD, + 0xDD, 0xED, 0xEE, 0xFF, 0xFF, 0xFF, 0x8D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, + 0xED, 0xFE, 0xEF, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xED, 0xDD, 0xDD, 0xDD, 0xCC, 0x8F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFD, 0xFE, 0xEF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, + 0xFE, 0xCD, 0xDC, 0xDD, 0xDD, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xDC, 0xCC, + 0xBC, 0xBC, 0xDD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFE, 0xDD, 0xBB, 0xAA, 0xAA, + 0xBB, 0xCC, 0xDF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0x98, 0x88, 0x89, 0xAB, + 0xCC, 0xDE, 0xFF, 0xFF, 0xFD, 0xBA, 0x98, 0x77, 0x77, 0x89, 0xAB, 0xDD, + 0xFF, 0xFF, 0xFE, 0xCB, 0x98, 0x65, 0x55, 0x67, 0x89, 0xAC, 0xDF, 0xFF, + 0xFF, 0xDB, 0xA8, 0x75, 0x44, 0x45, 0x67, 0x8A, 0xCD, 0xFF, 0xFF, 0xFD, + 0xBA, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xCE, 0xFF, 0xEF, 0xCB, 0xA8, + 0x75, 0x43, 0x34, 0x57, 0x8A, 0xBD, 0xFF, 0xFE, 0xFD, 0xCA, 0x97, 0x65, + 0x44, 0x45, 0x78, 0xAB, 0xDD, 0xFF, 0xEF, 0xDC, 0xA9, 0x87, 0x65, 0x55, + 0x67, 0x9A, 0xCE, 0xFF, 0xFE, 0xFF, 0xDB, 0xA9, 0x87, 0x76, 0x77, 0x9A, + 0xBC, 0xFF, 0xFF, 0xEF, 0xFC, 0xCB, 0xA9, 0x88, 0x88, 0x9A, 0xBC, 0xDF, + 0xFF, 0xFE, 0xFE, 0xDC, 0xCB, 0xAA, 0xAA, 0xAA, 0xBC, 0xDE, 0xFF, 0xFF, + 0xDF, 0xFE, 0xDC, 0xDC, 0xBB, 0xBB, 0xCC, 0xDF, 0xFF, 0xFF, 0xFD, 0xFF, + 0xFE, 0xED, 0xDD, 0xDC, 0xDE, 0xFE, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, + 0xEF, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8C, 0xDC, 0xDC, 0xDE, 0xFE, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xDE, 0xEE, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x8F, 0xFF, + 0xEE, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xFE, 0xED, 0xFF, 0xFE, 0xDD, + 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEF, 0xDD, 0xEE, 0xDC, 0xCB, 0xBB, + 0xAB, 0xBB, 0xBC, 0xCD, 0xDE, 0xED, 0xDE, 0xDD, 0xCB, 0xAA, 0x99, 0x99, + 0xAA, 0xBC, 0xCD, 0xEE, 0xDD, 0xDD, 0xCB, 0xA9, 0x88, 0x88, 0x89, 0x9A, + 0xBC, 0xDD, 0xED, 0xCD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x88, 0x9A, 0xBC, + 0xDE, 0xDD, 0xDC, 0xBA, 0x87, 0x66, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xDD, + 0xCD, 0xCA, 0x98, 0x76, 0x54, 0x45, 0x67, 0x8A, 0xAC, 0xDE, 0xDC, 0xDB, + 0xA9, 0x87, 0x54, 0x33, 0x45, 0x78, 0x9A, 0xCD, 0xDD, 0xCD, 0xCA, 0x98, + 0x75, 0x43, 0x34, 0x56, 0x89, 0xAC, 0xCE, 0xDC, 0xDC, 0xBA, 0x87, 0x65, + 0x44, 0x55, 0x78, 0x9A, 0xCD, 0xED, 0xCD, 0xCB, 0xA9, 0x87, 0x65, 0x55, + 0x67, 0x8A, 0xBC, 0xDE, 0xDC, 0xDC, 0xBA, 0x98, 0x87, 0x76, 0x77, 0x89, + 0xAB, 0xCD, 0xEE, 0xCD, 0xDC, 0xBA, 0x99, 0x88, 0x88, 0x89, 0xAB, 0xCD, + 0xDF, 0xDC, 0xED, 0xCB, 0xBA, 0xA9, 0x99, 0x9A, 0xAB, 0xBC, 0xEF, 0xFE, + 0xCE, 0xDD, 0xCC, 0xBB, 0xAA, 0xBB, 0xBB, 0xCC, 0xDE, 0xFF, 0xED, 0xED, + 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xFF, 0xFF, 0xDE, 0xEE, 0xDD, + 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xFF, 0xFF, 0xFD, 0xEE, 0xEE, 0xEE, 0xEE, + 0xDE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0x8D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, + 0xED, 0xEE, 0xEF, 0xFF, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xED, 0xDC, 0xCC, 0xBB, 0xBB, 0xBB, 0xBC, 0xCC, 0xCC, 0xAE, 0xFE, + 0xED, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xED, 0xEE, 0xDD, 0xCB, + 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDE, 0xDD, 0xDC, 0xCB, 0xAA, 0x99, + 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xDC, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0x9A, 0xBC, 0xCD, 0xCC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x89, + 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xBC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xCC, + 0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x88, 0x76, 0x65, 0x55, + 0x66, 0x78, 0x9A, 0xBD, 0xDB, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCD, 0xDC, 0xCB, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xED, + 0xCD, 0xCB, 0xBA, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xEC, 0xDD, + 0xCC, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDE, 0xFE, 0xCE, 0xDD, 0xCC, + 0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFC, 0xEE, 0xDD, 0xDC, 0xCC, + 0xCC, 0xCC, 0xDD, 0xEE, 0xFF, 0xFF, 0x9D, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, + 0xDD, 0xDE, 0xEE, 0xFF, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xEF, 0xFF, 0xED, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x8F, 0xFF, + 0xEE, 0xDD, 0xDC, 0xCC, 0xCC, 0xDD, 0xDD, 0xEE, 0xED, 0xFF, 0xFD, 0xDC, + 0xCB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEE, 0xDF, 0xFE, 0xDC, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFD, 0xEF, 0xDC, 0xBA, 0x99, 0x98, 0x99, + 0x9A, 0xAB, 0xCC, 0xDE, 0xDE, 0xEC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A, + 0xAB, 0xCD, 0xED, 0xDD, 0xCB, 0xA8, 0x77, 0x66, 0x67, 0x78, 0x9A, 0xBC, + 0xDD, 0xDD, 0xDB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBD, 0xDD, + 0xDD, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB, + 0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x67, 0x9A, 0xBC, 0xED, 0xCD, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAB, 0xDE, 0xEC, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88, + 0xAB, 0xCD, 0xEE, 0xDD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC, + 0xEF, 0xED, 0xDD, 0xCB, 0xAA, 0x99, 0x98, 0x99, 0x9A, 0xBC, 0xDE, 0xFE, + 0xDD, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xFD, 0xFE, + 0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDE, 0xFF, 0xFF, 0xDE, 0xDD, 0xDD, + 0xDC, 0xCC, 0xCC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFD, 0xFE, 0xED, 0xDD, 0xED, + 0xDD, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0x8C, 0xDC, 0xDD, 0xCD, 0xDD, 0xDE, + 0xDE, 0xEF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDD, 0xDC, 0xDD, 0xCC, 0xCC, 0x7F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, + 0xFD, 0xDD, 0xDD, 0xDD, 0xDF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xDD, 0xCB, + 0xBB, 0xBC, 0xCC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDC, 0xBA, 0xAA, 0xAA, + 0xBB, 0xCC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFB, 0xBA, 0x98, 0x88, 0x89, 0xAB, + 0xCC, 0xDF, 0xFF, 0xFF, 0xDC, 0xBA, 0x97, 0x77, 0x77, 0x89, 0xAB, 0xCD, + 0xFF, 0xFF, 0xFD, 0xCB, 0x98, 0x65, 0x55, 0x67, 0x89, 0xBC, 0xDF, 0xFF, + 0xFF, 0xDC, 0xA8, 0x75, 0x44, 0x45, 0x67, 0x8A, 0xBD, 0xFF, 0xFF, 0xFD, + 0xBA, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xDF, 0xFF, 0xFF, 0xDC, 0x98, + 0x75, 0x43, 0x34, 0x56, 0x8A, 0xCD, 0xFF, 0xFF, 0xFD, 0xCA, 0x97, 0x65, + 0x44, 0x45, 0x78, 0xAC, 0xDF, 0xFF, 0xEF, 0xDC, 0xA9, 0x87, 0x65, 0x55, + 0x68, 0x9A, 0xCE, 0xFF, 0xFF, 0xFE, 0xCB, 0xA9, 0x87, 0x77, 0x78, 0x9A, + 0xBC, 0xDF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x98, 0x88, 0x9A, 0xBC, 0xDF, + 0xFF, 0xFD, 0xFF, 0xDD, 0xBB, 0xAA, 0xAA, 0xAA, 0xBC, 0xDE, 0xFF, 0xFF, + 0xDF, 0xFD, 0xDD, 0xCB, 0xBB, 0xBB, 0xCD, 0xDF, 0xFF, 0xFF, 0xFD, 0xFF, + 0xDF, 0xDD, 0xDC, 0xDC, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFE, + 0xEF, 0xEF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFE, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8C, 0xCD, 0xDD, 0xED, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xEF, 0xFF, 0xEF, 0xEE, 0xDD, 0xDD, 0xDD, 0xDD, 0xDC, 0xDD, 0x7F, 0xFF, + 0xFF, 0xFE, 0xED, 0xEE, 0xDE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, + 0xDC, 0xCC, 0xCD, 0xDD, 0xEE, 0xEF, 0xFF, 0xEF, 0xFF, 0xFD, 0xDC, 0xCB, + 0xBB, 0xBC, 0xCD, 0xCF, 0xFF, 0xFE, 0xFF, 0xFD, 0xDB, 0xBA, 0xAA, 0xAA, + 0xAB, 0xCC, 0xDE, 0xFF, 0xFF, 0xFD, 0xDC, 0xAA, 0x99, 0x89, 0x99, 0xAB, + 0xBC, 0xDF, 0xFF, 0xFD, 0xDC, 0xBA, 0x98, 0x77, 0x78, 0x89, 0xAB, 0xCD, + 0xFF, 0xEF, 0xED, 0xCA, 0x98, 0x76, 0x56, 0x67, 0x89, 0xBC, 0xDE, 0xFE, + 0xDE, 0xCB, 0xA9, 0x76, 0x54, 0x45, 0x68, 0x9A, 0xBC, 0xEF, 0xEE, 0xED, + 0xBA, 0x87, 0x64, 0x23, 0x46, 0x78, 0xAB, 0xDD, 0xFE, 0xFE, 0xDB, 0xA9, + 0x76, 0x43, 0x24, 0x57, 0x8A, 0xBD, 0xDE, 0xED, 0xFD, 0xBA, 0x98, 0x65, + 0x44, 0x56, 0x79, 0xAB, 0xCD, 0xFF, 0xDD, 0xDC, 0xB9, 0x87, 0x66, 0x56, + 0x78, 0x9A, 0xBD, 0xEF, 0xFD, 0xFD, 0xCB, 0xA9, 0x88, 0x77, 0x78, 0x9A, + 0xBC, 0xDE, 0xFF, 0xDE, 0xDC, 0xBB, 0xA9, 0x98, 0x89, 0x9A, 0xAC, 0xDE, + 0xFF, 0xFE, 0xFE, 0xDD, 0xCB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xEF, 0xFF, + 0xDF, 0xED, 0xDC, 0xCC, 0xBB, 0xBB, 0xBC, 0xDD, 0xFF, 0xFF, 0xFD, 0xFF, + 0xEF, 0xDD, 0xDC, 0xCC, 0xDD, 0xDD, 0xEF, 0xFF, 0xFF, 0xDF, 0xFF, 0xEE, + 0xEE, 0xDD, 0xDE, 0xEE, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xED, + 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7C, 0xCC, 0xCC, 0xDD, 0xDC, 0xCE, + 0xEF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xBC, 0xCC, 0xBB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBA, 0xBB, 0xBB, 0x8D, 0xED, + 0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xEC, 0xCD, 0xCC, 0xBB, + 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xCC, 0xDC, 0xBA, 0xA9, 0x99, + 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xDC, 0xBC, 0xBA, 0xA9, 0x88, 0x88, 0x88, + 0x89, 0x9A, 0xAB, 0xCD, 0xBB, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x89, + 0x9A, 0xBC, 0xCC, 0xBB, 0xA9, 0x88, 0x77, 0x66, 0x67, 0x78, 0x89, 0x9A, + 0xBC, 0xBB, 0xBA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xCB, + 0xAB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xBA, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCB, 0xAB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xBA, 0xBA, 0x98, 0x77, 0x65, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCB, 0xAB, 0xA9, 0x88, 0x76, 0x65, 0x55, + 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0xA9, 0x87, 0x77, 0x66, 0x66, 0x78, + 0x89, 0xAB, 0xCC, 0xBB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xBC, 0xCB, 0xCB, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x89, 0xAA, 0xBC, 0xDC, + 0xBC, 0xCB, 0xBA, 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xDD, 0xDB, 0xCC, + 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBC, 0xCD, 0xED, 0xCD, 0xCC, 0xCC, + 0xBB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xEF, 0xEC, 0xDD, 0xDD, 0xCC, 0xCC, + 0xCB, 0xCC, 0xCD, 0xDE, 0xEE, 0xFE, 0x8C, 0xCC, 0xCB, 0xBB, 0xBB, 0xBB, + 0xCC, 0xCC, 0xDE, 0xDE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0x9B, 0xCC, + 0xBB, 0xAA, 0xAA, 0xA9, 0xAA, 0xAA, 0xBB, 0xCC, 0xCB, 0xBC, 0xBA, 0xA9, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xBC, 0xBB, 0xBA, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x99, 0xAA, 0xAB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x78, + 0x88, 0x99, 0x9A, 0xBB, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, + 0x99, 0xAA, 0xBA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x99, + 0xAB, 0xA9, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xBA, + 0x9A, 0x98, 0x77, 0x66, 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xA9, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x88, 0x76, 0x66, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x78, 0x89, 0xAA, 0xA9, 0xA9, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xBA, 0xBA, 0x99, 0x98, 0x88, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xBB, + 0xAB, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBA, 0xBB, + 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xCC, 0xBC, 0xCB, 0xBA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xCB, 0xCC, 0xCB, 0xBB, 0xBA, + 0xAA, 0xAB, 0xBB, 0xBC, 0xCD, 0xDC, 0x9B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xBB, 0xBC, 0xCD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xBC, 0xCC, 0xBB, 0xBB, 0xAA, 0xAA, 0xAB, 0xAB, 0xBB, 0xBC, 0x8D, 0xED, + 0xCC, 0xCB, 0xBA, 0xBA, 0xBB, 0xBB, 0xCC, 0xCD, 0xDC, 0xCD, 0xCC, 0xBB, + 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xCC, 0xCB, 0xBA, 0xA9, 0x99, + 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDC, 0xBC, 0xBA, 0x99, 0x88, 0x88, 0x88, + 0x89, 0x9A, 0xAB, 0xBC, 0xBB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x89, + 0x9A, 0xAB, 0xCB, 0xBB, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x77, 0x89, 0x9A, + 0xBC, 0xBA, 0xBA, 0x98, 0x76, 0x65, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xCB, + 0xAB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xBA, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xBB, 0xAA, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xAB, 0xBA, 0xBA, 0x98, 0x77, 0x65, + 0x55, 0x56, 0x67, 0x89, 0xAB, 0xBB, 0xAB, 0xA9, 0x88, 0x76, 0x65, 0x55, + 0x67, 0x78, 0x9A, 0xBC, 0xBA, 0xBA, 0x99, 0x87, 0x77, 0x66, 0x66, 0x78, + 0x89, 0xAB, 0xCB, 0xBB, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x78, 0x89, 0xAA, + 0xBC, 0xCB, 0xCB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xBC, 0xDC, + 0xBC, 0xCB, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xCD, 0xCB, 0xCC, + 0xBB, 0xAA, 0xAA, 0xA9, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xBD, 0xCC, 0xCC, + 0xBB, 0xBA, 0xAB, 0xBB, 0xBC, 0xCD, 0xDE, 0xDC, 0xED, 0xCC, 0xCB, 0xBB, + 0xBB, 0xCC, 0xCC, 0xCD, 0xDE, 0xEE, 0x8C, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, + 0xBB, 0xCC, 0xCD, 0xDD, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xEF, 0xFF, 0xEF, 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x7F, 0xFF, + 0xFF, 0xFF, 0xDD, 0xDC, 0xDE, 0xDE, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFE, + 0xDD, 0xCC, 0xBC, 0xCC, 0xDE, 0xEE, 0xFF, 0xEF, 0xFE, 0xED, 0xCB, 0xBB, + 0xAB, 0xBB, 0xBC, 0xDD, 0xEF, 0xFE, 0xEF, 0xED, 0xCB, 0xAA, 0x99, 0x9A, + 0xAB, 0xBC, 0xDE, 0xEF, 0xED, 0xED, 0xCB, 0xA9, 0x98, 0x88, 0x89, 0x9A, + 0xBC, 0xDE, 0xFD, 0xEE, 0xDB, 0xA9, 0x87, 0x77, 0x77, 0x89, 0xAB, 0xCD, + 0xEF, 0xED, 0xEC, 0xBA, 0x87, 0x66, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xEE, + 0xDE, 0xCB, 0x98, 0x76, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xDF, 0xED, 0xDC, + 0xB9, 0x86, 0x54, 0x33, 0x45, 0x78, 0x9B, 0xCD, 0xED, 0xDD, 0xCB, 0x98, + 0x75, 0x43, 0x34, 0x57, 0x89, 0xBC, 0xDE, 0xFD, 0xDD, 0xBA, 0x87, 0x65, + 0x44, 0x46, 0x78, 0x9B, 0xCD, 0xEF, 0xEE, 0xCB, 0xA9, 0x87, 0x65, 0x56, + 0x67, 0x8A, 0xBC, 0xDF, 0xFE, 0xDD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x89, + 0xAC, 0xCE, 0xEF, 0xDE, 0xDC, 0xBA, 0xA9, 0x88, 0x88, 0x89, 0xAB, 0xCD, + 0xEF, 0xFD, 0xED, 0xDC, 0xBB, 0xA9, 0xA9, 0x9A, 0xBB, 0xCD, 0xEF, 0xFF, + 0xEF, 0xED, 0xCC, 0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xED, 0xFF, + 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xDE, 0xEF, 0xFF, 0xFF, 0xDF, 0xFF, 0xDD, + 0xDD, 0xDD, 0xDE, 0xDE, 0xEF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFE, 0xEE, + 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xDE, 0xDC, 0xED, 0xDD, 0xDE, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDC, 0xCC, 0x7F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xCB, + 0xCE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBB, 0xAA, 0xAB, 0xBC, + 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBA, 0x98, 0x89, 0xAB, 0xCD, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFD, 0xBA, 0x87, 0x66, 0x78, 0xAB, 0xCD, 0xFF, 0xFF, + 0xFF, 0xFF, 0xDB, 0x97, 0x54, 0x45, 0x79, 0xAC, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFC, 0xA8, 0x64, 0x22, 0x46, 0x8A, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCA, + 0x96, 0x42, 0x24, 0x68, 0xAC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xA9, 0x75, + 0x43, 0x57, 0x9A, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0xA8, 0x76, 0x67, + 0x89, 0xBD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x88, 0x9A, 0xBC, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xCB, 0xAA, 0xAB, 0xBD, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCC, 0xBB, 0xCD, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xDC, 0xDD, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xFF, 0xDF, 0xDD, 0xDD, 0xCC, 0xDB, 0xCC, 0xCC, 0xCC, 0x8F, 0xFF, + 0xFE, 0xFD, 0xDD, 0xCC, 0xCC, 0xDD, 0xDD, 0xDE, 0xFD, 0xFF, 0xFF, 0xDD, + 0xCC, 0xBB, 0xBB, 0xBC, 0xDD, 0xDD, 0xFF, 0xDF, 0xFD, 0xDD, 0xCB, 0xBA, + 0xAA, 0xAA, 0xAC, 0xCC, 0xFF, 0xFD, 0xFF, 0xDD, 0xCA, 0xA9, 0x99, 0x99, + 0x9A, 0xAB, 0xCD, 0xEF, 0xDF, 0xDD, 0xCB, 0xA9, 0x88, 0x88, 0x88, 0x99, + 0xAC, 0xCD, 0xFD, 0xDE, 0xCB, 0xA9, 0x87, 0x76, 0x77, 0x78, 0x9A, 0xBC, + 0xDF, 0xED, 0xEC, 0xA9, 0x87, 0x66, 0x55, 0x67, 0x78, 0x9B, 0xBE, 0xFF, + 0xDD, 0xCA, 0x98, 0x76, 0x54, 0x45, 0x67, 0x89, 0xAC, 0xDF, 0xFD, 0xCB, + 0xA9, 0x86, 0x54, 0x34, 0x45, 0x78, 0x9A, 0xBD, 0xEF, 0xDC, 0xBA, 0x98, + 0x65, 0x43, 0x34, 0x56, 0x89, 0xAC, 0xDE, 0xFC, 0xDB, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x78, 0x9A, 0xBD, 0xDF, 0xDD, 0xBB, 0xA8, 0x77, 0x65, 0x55, + 0x67, 0x8A, 0xAC, 0xDF, 0xFC, 0xDC, 0xBA, 0x98, 0x77, 0x76, 0x77, 0x89, + 0xAB, 0xCE, 0xEF, 0xCD, 0xCB, 0xAA, 0x98, 0x88, 0x88, 0x89, 0xAB, 0xCD, + 0xDF, 0xFD, 0xED, 0xCB, 0xBA, 0xA9, 0x99, 0x9A, 0xAA, 0xCD, 0xFF, 0xFF, + 0xDE, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDE, 0xFF, 0xFD, 0xFD, + 0xDD, 0xCC, 0xCB, 0xBB, 0xCC, 0xDD, 0xFE, 0xFF, 0xFF, 0xCE, 0xED, 0xED, + 0xDC, 0xCC, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xEF, 0xEF, + 0xEF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xDD, 0xDE, 0xEF, 0xDF, 0xDF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xAF, 0xFF, + 0xED, 0xDC, 0xCC, 0xBB, 0xBC, 0xCC, 0xCD, 0xDE, 0xED, 0xFF, 0xED, 0xCC, + 0xBB, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDE, 0xEF, 0xFD, 0xCB, 0xAA, 0x99, + 0x99, 0x99, 0xAA, 0xBC, 0xCD, 0xDD, 0xEE, 0xDB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0x9A, 0xBC, 0xCD, 0xDD, 0xDC, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89, + 0x9A, 0xBC, 0xDD, 0xDC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xDC, 0xCB, 0x98, 0x76, 0x65, 0x55, 0x66, 0x77, 0x89, 0xAC, 0xCD, + 0xCC, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBD, 0xDC, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xCC, 0xA9, 0x87, 0x76, 0x55, 0x55, + 0x66, 0x78, 0x9B, 0xCD, 0xEC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x9A, 0xBC, 0xEE, 0xCC, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x78, 0x99, 0xAC, + 0xDE, 0xFC, 0xCC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x9A, 0xAB, 0xCE, 0xFF, + 0xDD, 0xCC, 0xBA, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCD, 0xEF, 0xFD, 0xED, + 0xCC, 0xBB, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xEF, 0xFF, 0xDE, 0xED, 0xDC, + 0xCB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFD, 0xFE, 0xED, 0xDD, 0xDC, + 0xDD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xAD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, + 0xEE, 0xEF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xDD, 0xDD, 0xDD, 0xDC, 0xCC, 0x8F, 0xFF, + 0xFF, 0xFF, 0xDD, 0xDE, 0xED, 0xDD, 0xDD, 0xFF, 0xFD, 0xFF, 0xFF, 0xFD, + 0xCC, 0xCC, 0xCC, 0xCB, 0xCD, 0xDE, 0xEF, 0xDF, 0xFF, 0xEC, 0xDB, 0xBB, + 0xAA, 0xAB, 0xBB, 0xCC, 0xDF, 0xFD, 0xFF, 0xFD, 0xCB, 0xA9, 0x99, 0x99, + 0xAA, 0xBC, 0xDD, 0xEF, 0xDF, 0xED, 0xCB, 0xA9, 0x88, 0x88, 0x88, 0x9A, + 0xBC, 0xCC, 0xFD, 0xFE, 0xDB, 0xA9, 0x87, 0x76, 0x77, 0x78, 0x9A, 0xBC, + 0xDE, 0xDF, 0xFC, 0xBA, 0x87, 0x66, 0x55, 0x67, 0x78, 0x9B, 0xBD, 0xFE, + 0xEF, 0xCA, 0x98, 0x76, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCE, 0xED, 0xDC, + 0xA9, 0x86, 0x54, 0x33, 0x45, 0x68, 0x9A, 0xBC, 0xED, 0xED, 0xBA, 0x98, + 0x75, 0x43, 0x34, 0x57, 0x89, 0xAC, 0xDD, 0xED, 0xDC, 0xA9, 0x87, 0x65, + 0x44, 0x56, 0x78, 0x9A, 0xBD, 0xFF, 0xFF, 0xCB, 0xA9, 0x87, 0x65, 0x56, + 0x67, 0x89, 0xBC, 0xDF, 0xED, 0xDC, 0xBA, 0x98, 0x87, 0x76, 0x77, 0x89, + 0xAB, 0xCE, 0xFF, 0xCE, 0xCB, 0xBA, 0x99, 0x88, 0x88, 0x89, 0xAB, 0xDD, + 0xFF, 0xFF, 0xFD, 0xCB, 0xBA, 0xA9, 0x99, 0x9A, 0xAB, 0xCD, 0xDF, 0xFF, + 0xDF, 0xEE, 0xCC, 0xBA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDF, 0xFF, 0xFE, 0xFD, + 0xDD, 0xCC, 0xBB, 0xCC, 0xCC, 0xCD, 0xFF, 0xFF, 0xFF, 0xDD, 0xDE, 0xDD, + 0xDC, 0xCD, 0xCC, 0xDD, 0xEF, 0xFF, 0xFF, 0xFC, 0xFF, 0xED, 0xDD, 0xDD, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8C, 0xCD, 0xCD, 0xDD, 0xEE, 0xDE, + 0xFE, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDF, 0x8F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xCF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0xBB, 0xBC, 0xCD, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCA, 0x99, 0x99, 0xAB, 0xCF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xCA, 0x97, 0x77, 0x89, 0xBC, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xDC, 0x97, 0x54, 0x46, 0x8A, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFD, 0xB9, 0x74, 0x12, 0x57, 0x9B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, + 0x97, 0x42, 0x24, 0x79, 0xBD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xB9, 0x86, + 0x44, 0x57, 0x9B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xA9, 0x87, 0x77, + 0x8A, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xAA, 0x99, 0x9A, 0xCF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xCC, 0xBB, 0xBB, 0xCF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFD, 0xDC, 0xDD, 0xCD, 0x7F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, + 0xCC, 0xCF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC, 0xBB, 0xBC, + 0xCF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCC, 0xBA, 0xA9, 0xAA, 0xBC, + 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC, 0xA9, 0x88, 0x88, 0x9A, 0xBD, 0xDF, + 0xFF, 0xFF, 0xFF, 0xFB, 0xB9, 0x87, 0x66, 0x78, 0x9A, 0xCD, 0xFF, 0xFF, + 0xFF, 0xFD, 0xCA, 0x87, 0x54, 0x45, 0x78, 0xAB, 0xDF, 0xFF, 0xFF, 0xFF, + 0xDB, 0xA8, 0x64, 0x22, 0x46, 0x8A, 0xBD, 0xFF, 0xFF, 0xFF, 0xFC, 0xBA, + 0x86, 0x42, 0x24, 0x68, 0xAB, 0xCD, 0xFF, 0xFF, 0xFF, 0xDB, 0xA8, 0x75, + 0x44, 0x56, 0x8A, 0xBD, 0xFF, 0xFF, 0xFF, 0xFF, 0xCA, 0x98, 0x76, 0x66, + 0x79, 0xAC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBA, 0x98, 0x88, 0x89, 0xAB, + 0xCF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFC, 0xBA, 0xAA, 0x9A, 0xAC, 0xCC, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xCB, 0xBB, 0xCC, 0xDF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xDD, 0xDF, 0xDC, 0xCC, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xCF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7D, 0xDC, 0xDC, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xCB, 0xCC, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xA9, 0x9A, 0xBC, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0x98, 0x77, 0x89, 0xBF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFC, 0xA8, 0x54, 0x46, 0x8A, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xCA, 0x74, 0x12, 0x47, 0xAB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, + 0xA7, 0x42, 0x24, 0x7A, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCA, 0x86, + 0x44, 0x58, 0xAC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xBA, 0x87, 0x78, + 0x9B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBA, 0x99, 0xAB, 0xCF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xCC, 0xCC, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xCC, 0xCB, 0xBA, 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xAB, 0xBC, 0x9C, 0xCC, + 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDC, 0xCC, 0xBB, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBB, 0xBB, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x99, 0x9A, 0xBB, 0xCB, 0xBB, 0xA9, 0x98, 0x88, 0x77, 0x77, + 0x88, 0x89, 0xAA, 0xBB, 0xBA, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0xAB, 0xBB, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x99, + 0xAB, 0xBA, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA, + 0x9A, 0x98, 0x77, 0x66, 0x55, 0x56, 0x66, 0x77, 0x89, 0xAB, 0xA9, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xA9, 0xA9, 0x87, 0x76, 0x66, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x78, 0x89, 0xAB, 0xBA, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xBB, 0xAA, 0xA9, 0x88, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xBB, 0xBA, 0xBA, 0x99, 0x88, 0x87, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xCC, + 0xBB, 0xBA, 0x99, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xBC, 0xCB, 0xCB, + 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xCC, 0xBC, 0xCB, 0xBA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDC, 0xDC, 0xCB, 0xBB, 0xBB, + 0xBA, 0xBB, 0xBB, 0xCC, 0xDD, 0xEE, 0x9C, 0xCB, 0xBB, 0xBA, 0xAA, 0xAA, + 0xBB, 0xBB, 0xCC, 0xDD, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xFF, 0xFF, 0xED, 0xEE, 0xED, 0xDD, 0xDC, 0xCD, 0xDC, 0x7F, 0xFF, + 0xFF, 0xFE, 0xED, 0xDD, 0xDD, 0xFD, 0xFF, 0xEE, 0xFD, 0xFF, 0xFF, 0xDE, + 0xDD, 0xCC, 0xCC, 0xDD, 0xDD, 0xFF, 0xFF, 0xEF, 0xFF, 0xDD, 0xDC, 0xCC, + 0xBB, 0xCC, 0xBD, 0xDD, 0xEF, 0xFE, 0xFF, 0xFD, 0xDC, 0xBB, 0xAA, 0xAA, + 0xBB, 0xCD, 0xDE, 0xEF, 0xDF, 0xFE, 0xDC, 0xBA, 0x99, 0x99, 0x99, 0xAB, + 0xCC, 0xDE, 0xFD, 0xFD, 0xEC, 0xCA, 0x98, 0x87, 0x78, 0x89, 0xAB, 0xCD, + 0xFF, 0xDE, 0xFD, 0xCA, 0x98, 0x76, 0x66, 0x78, 0x9A, 0xBC, 0xDD, 0xFE, + 0xDD, 0xCB, 0xA9, 0x86, 0x54, 0x45, 0x78, 0x9A, 0xCE, 0xDF, 0xEE, 0xDC, + 0xBA, 0x97, 0x64, 0x23, 0x46, 0x79, 0xAB, 0xDD, 0xFD, 0xEE, 0xDB, 0xA9, + 0x76, 0x42, 0x24, 0x67, 0x9A, 0xBC, 0xDE, 0xEF, 0xEE, 0xCA, 0x98, 0x75, + 0x44, 0x56, 0x89, 0xAB, 0xDE, 0xFE, 0xEE, 0xDC, 0xBA, 0x88, 0x76, 0x66, + 0x78, 0x9B, 0xCD, 0xEF, 0xDD, 0xFD, 0xCB, 0xA9, 0x98, 0x77, 0x88, 0x9A, + 0xBC, 0xDF, 0xFF, 0xDF, 0xDD, 0xCB, 0xA9, 0x99, 0x99, 0x9A, 0xBC, 0xDE, + 0xFF, 0xFD, 0xEE, 0xDD, 0xCB, 0xAA, 0xAA, 0xAB, 0xCC, 0xDE, 0xFF, 0xFF, + 0xDF, 0xFD, 0xDC, 0xCC, 0xBC, 0xCB, 0xCC, 0xCE, 0xFF, 0xFF, 0xFD, 0xEF, + 0xFE, 0xDD, 0xDC, 0xCD, 0xCD, 0xDD, 0xFF, 0xFF, 0xFF, 0xCF, 0xEE, 0xDD, + 0xEE, 0xDE, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xDF, 0xFF, + 0xFE, 0xEF, 0xEF, 0xFF, 0xFF, 0xFF, 0x7C, 0xCD, 0xCC, 0xDD, 0xEE, 0xEF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xCF, 0xDF, 0xDC, 0xCB, 0xCD, 0x7F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, + 0xCC, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xCC, 0xBC, + 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBB, 0xAA, 0xBB, 0xBC, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xA9, 0x98, 0x89, 0xAB, 0xCD, 0xDF, + 0xFF, 0xFF, 0xFF, 0xFD, 0xBA, 0x87, 0x66, 0x78, 0xAB, 0xCF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xCB, 0x97, 0x54, 0x45, 0x79, 0xBC, 0xDF, 0xFF, 0xFF, 0xFF, + 0xFC, 0xB9, 0x64, 0x22, 0x46, 0x9A, 0xCF, 0xFF, 0xFF, 0xFF, 0xFD, 0xBA, + 0x86, 0x42, 0x23, 0x68, 0xAC, 0xDF, 0xFF, 0xFF, 0xFF, 0xDC, 0xA9, 0x75, + 0x44, 0x57, 0x9B, 0xCF, 0xDF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA8, 0x76, 0x67, + 0x8A, 0xBC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0xA9, 0x88, 0x9A, 0xBC, + 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xCB, 0xBB, 0xAB, 0xBC, 0xCF, 0xFF, + 0xFF, 0xFD, 0xFF, 0xFD, 0xDF, 0xCC, 0xCC, 0xCD, 0xDD, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xCD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7D, 0xDD, 0xDF, 0xFD, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFD, 0x7F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCD, 0xDD, + 0xCC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDC, 0xBB, 0xBB, 0xCF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xCB, 0xA9, 0xAA, 0xBC, 0xDD, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0x97, 0x77, 0x89, 0xAC, 0xDF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFC, 0xA8, 0x64, 0x46, 0x8A, 0xBD, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xB9, 0x74, 0x12, 0x47, 0x9B, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, + 0x97, 0x42, 0x24, 0x79, 0xBD, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xBA, 0x86, + 0x44, 0x58, 0x9C, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDB, 0xA9, 0x87, 0x78, + 0x9A, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xBA, 0x99, 0xAB, 0xBD, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xCC, 0xBB, 0xBC, 0xCE, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xDC, 0xCC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xFF, 0xFF, 0xFF, 0xDF, 0xDF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xCF, 0xED, 0xCC, 0xED, 0xBB, 0xCB, 0xBB, 0xCC, 0xBC, 0xCC, 0x6D, 0xFF, + 0xED, 0xDC, 0xCC, 0xBD, 0xCC, 0xDC, 0xEE, 0xFF, 0xFC, 0xED, 0xDF, 0xCD, + 0xCC, 0xCB, 0xCC, 0xCD, 0xCD, 0xDE, 0xFF, 0xCF, 0xED, 0xEC, 0xCB, 0xBA, + 0xBB, 0xBB, 0xCC, 0xCC, 0xDD, 0xFC, 0xDD, 0xDC, 0xBA, 0xBA, 0xA9, 0x9A, + 0xAA, 0xBB, 0xCD, 0xEF, 0xDC, 0xDC, 0xCB, 0xA9, 0x98, 0x88, 0x99, 0x9B, + 0xBC, 0xCD, 0xFD, 0xBC, 0xCB, 0xAA, 0x98, 0x77, 0x77, 0x89, 0xAA, 0xBD, + 0xCD, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x56, 0x67, 0x89, 0xAB, 0xCC, 0xDC, + 0xBC, 0xBB, 0xA8, 0x76, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xCE, 0xDC, 0xDB, + 0xB9, 0x87, 0x64, 0x23, 0x46, 0x78, 0xAB, 0xBC, 0xEC, 0xCC, 0xBA, 0x98, + 0x76, 0x43, 0x34, 0x57, 0x89, 0xBB, 0xCD, 0xDB, 0xCB, 0xBA, 0x97, 0x65, + 0x44, 0x56, 0x78, 0x9B, 0xBD, 0xDD, 0xCD, 0xCB, 0xA9, 0x87, 0x66, 0x56, + 0x78, 0x9A, 0xBB, 0xDF, 0xEB, 0xDC, 0xBA, 0xA9, 0x87, 0x77, 0x78, 0x8A, + 0xBB, 0xCD, 0xFD, 0xCC, 0xDB, 0xBB, 0x99, 0x98, 0x88, 0x9A, 0xAA, 0xBC, + 0xDF, 0xDC, 0xDD, 0xBC, 0xBB, 0xAA, 0x99, 0xAA, 0xAB, 0xBC, 0xCE, 0xFE, + 0xDF, 0xFD, 0xCC, 0xBB, 0xAA, 0xBB, 0xBB, 0xCC, 0xDC, 0xFF, 0xEC, 0xFF, + 0xDC, 0xDC, 0xCC, 0xBB, 0xBC, 0xCD, 0xED, 0xED, 0xFE, 0xDE, 0xEE, 0xED, + 0xCD, 0xCC, 0xCC, 0xDD, 0xDD, 0xEF, 0xEF, 0xEC, 0xEF, 0xFE, 0xED, 0xED, + 0xDE, 0xED, 0xEE, 0xFE, 0xFF, 0xFF, 0x6C, 0xCC, 0xDD, 0xDD, 0xDD, 0xBC, + 0xCC, 0xED, 0xDD, 0xEF, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xED, 0xDD, 0xDD, 0xDE, 0xEF, 0xFF, 0xCF, 0xFF, + 0xFF, 0xDD, 0xDC, 0xCC, 0xCD, 0xDE, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xEC, + 0xCB, 0xBA, 0xAA, 0xBB, 0xCC, 0xDF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0xA9, + 0x99, 0x9A, 0xAA, 0xBC, 0xEF, 0xFF, 0xFD, 0xDC, 0xBA, 0x98, 0x88, 0x88, + 0x99, 0xAA, 0xBC, 0xDF, 0xFF, 0xDD, 0xBA, 0x98, 0x77, 0x77, 0x77, 0x89, + 0xAB, 0xBC, 0xFF, 0xFD, 0xCA, 0x98, 0x76, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xED, 0xDB, 0xA8, 0x76, 0x65, 0x55, 0x56, 0x78, 0x89, 0xBC, 0xDF, + 0xDC, 0xB9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9B, 0xCD, 0xED, 0xCA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAC, 0xEF, 0xDC, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xCD, 0xFD, 0xDA, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAC, 0xDF, 0xDC, 0xB9, 0x87, 0x76, 0x55, 0x55, + 0x66, 0x78, 0xAB, 0xDF, 0xFD, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x9A, 0xBE, 0xEF, 0xDE, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x9A, 0xBC, + 0xDF, 0xFE, 0xDC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x9A, 0xBC, 0xFE, 0xFF, + 0xFE, 0xDC, 0xBA, 0xA9, 0x99, 0x99, 0xAA, 0xBC, 0xDF, 0xFF, 0xFF, 0xFD, + 0xDC, 0xBB, 0xBB, 0xAA, 0xBB, 0xBC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDE, + 0xDC, 0xCC, 0xCD, 0xCE, 0xEF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xDF, 0xDD, + 0xED, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xBE, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xEF, 0xFE, 0xFF, 0xFD, 0xEC, 0xDD, 0xCC, 0xCC, 0xCC, 0xDD, 0x6F, 0xFF, + 0xFF, 0xFF, 0xFD, 0xDD, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, + 0xED, 0xCC, 0xCD, 0xFF, 0xED, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xDD, 0xCC, + 0xCC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFE, 0xFF, 0xFE, 0xFD, 0xCC, 0xCB, 0xBB, + 0xBD, 0xFD, 0xEF, 0xFF, 0xDF, 0xEE, 0xFD, 0xCB, 0xBA, 0xA9, 0xAB, 0xBC, + 0xDD, 0xDF, 0xFF, 0xFF, 0xDC, 0xCB, 0xA9, 0x88, 0x88, 0x9A, 0xBC, 0xDF, + 0xFF, 0xFF, 0xFE, 0xDC, 0xA9, 0x87, 0x66, 0x78, 0x9B, 0xCC, 0xDD, 0xFE, + 0xED, 0xDC, 0xBA, 0x97, 0x54, 0x45, 0x79, 0xAB, 0xDD, 0xFF, 0xFD, 0xDD, + 0xCB, 0xA8, 0x64, 0x22, 0x46, 0x8A, 0xBC, 0xDF, 0xFE, 0xDD, 0xDC, 0xBA, + 0x86, 0x42, 0x24, 0x68, 0xAB, 0xCD, 0xFF, 0xED, 0xDD, 0xCB, 0xA9, 0x75, + 0x44, 0x57, 0x8A, 0xBD, 0xDF, 0xFF, 0xDF, 0xDD, 0xCB, 0x98, 0x76, 0x67, + 0x89, 0xBC, 0xCD, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0x98, 0x88, 0x89, 0xAB, + 0xCD, 0xDE, 0xFE, 0xDF, 0xFD, 0xED, 0xBB, 0xA9, 0xAA, 0xBC, 0xCD, 0xDF, + 0xFF, 0xEF, 0xFF, 0xFF, 0xDC, 0xCA, 0xBB, 0xBC, 0xCD, 0xDF, 0xFF, 0xFF, + 0xDF, 0xFF, 0xDC, 0xDD, 0xCC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFF, 0xFD, 0xFF, + 0xFF, 0xEF, 0xDD, 0xDC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF, + 0xDF, 0xDD, 0xFD, 0xFD, 0xFF, 0xFF, 0xFF, 0xFD, 0xED, 0xFF, 0xFE, 0xDF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6C, 0xDD, 0xDC, 0xCC, 0xFD, 0xFD, + 0xDD, 0xDF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xDF, 0xFD, 0xCD, 0xDC, 0xFD, 0xDD, 0xDD, 0x8F, 0xFF, + 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xCD, 0xFF, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCC, + 0xCC, 0xCD, 0xDE, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xCB, 0xBB, 0xCB, + 0xCC, 0xCF, 0xFD, 0xFF, 0xFF, 0xFD, 0xFD, 0xCB, 0xAA, 0xA9, 0xAA, 0xBC, + 0xCD, 0xFF, 0xFF, 0xFF, 0xDF, 0xBB, 0xA9, 0x88, 0x88, 0x9A, 0xBC, 0xDF, + 0xFF, 0xFF, 0xFF, 0xDC, 0xA9, 0x87, 0x66, 0x78, 0x9A, 0xCC, 0xFF, 0xFD, + 0xFF, 0xDC, 0xBA, 0x87, 0x54, 0x45, 0x79, 0xAB, 0xDC, 0xDF, 0xFF, 0xFD, + 0xCA, 0x98, 0x64, 0x22, 0x46, 0x8A, 0xBD, 0xFF, 0xFF, 0xDF, 0xDC, 0xB9, + 0x86, 0x42, 0x24, 0x68, 0x9C, 0xCF, 0xDF, 0xFF, 0xFF, 0xCB, 0xA9, 0x75, + 0x44, 0x56, 0x8A, 0xBD, 0xFF, 0xFF, 0xFF, 0xDD, 0xBB, 0x98, 0x76, 0x66, + 0x79, 0xAB, 0xDF, 0xFF, 0xFF, 0xFF, 0xCC, 0xBA, 0x99, 0x88, 0x89, 0xAB, + 0xDD, 0xFF, 0xFF, 0xEF, 0xFF, 0xCC, 0xBA, 0xAA, 0xAA, 0xAB, 0xCD, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBB, 0xBB, 0xBC, 0xCD, 0xFF, 0xFF, 0xFF, + 0xDF, 0xFF, 0xDD, 0xDC, 0xDD, 0xCD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFD, 0xFF, 0xDD, 0xDF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, + 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7D, 0xDD, 0xDF, 0xFD, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0xBC, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0xA9, 0x9A, 0xBF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x98, 0x77, 0x89, 0xAF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFB, 0xA8, 0x64, 0x46, 0x8A, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xB9, 0x74, 0x12, 0x47, 0x9A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, + 0x97, 0x42, 0x24, 0x79, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEA, 0x86, + 0x44, 0x57, 0x9B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB9, 0x87, 0x78, + 0x9B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAA, 0x99, 0xAA, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFB, 0xBB, 0xEF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCD, 0xCC, 0xCF, 0xBB, 0x6F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFE, + 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xBC, + 0xCC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBA, 0x99, 0xAA, 0xBC, + 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB9, 0x98, 0x88, 0xAA, 0xBF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xCD, 0xB9, 0x87, 0x66, 0x78, 0x9A, 0xCF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xCA, 0x87, 0x54, 0x45, 0x79, 0xAB, 0xDF, 0xFF, 0xFF, 0xFD, + 0xFB, 0xA8, 0x64, 0x22, 0x46, 0x8A, 0xBD, 0xFF, 0xFF, 0xFF, 0xFF, 0xB9, + 0x86, 0x42, 0x24, 0x68, 0xAB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xA8, 0x75, + 0x44, 0x56, 0x9B, 0xCD, 0xFF, 0xFF, 0xFF, 0xFF, 0xCA, 0x98, 0x76, 0x66, + 0x89, 0xCC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0x98, 0x88, 0x89, 0xBB, + 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFB, 0xCB, 0xAA, 0xAA, 0xBC, 0xDF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xCC, 0xAB, 0xBC, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFC, 0xCD, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6C, 0xBC, 0xCF, 0xFF, 0xCD, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xDC, 0xDB, 0xBA, 0xAA, 0xA9, 0xAA, 0xA9, 0xAB, 0xBB, 0xCC, 0xAF, 0xFD, + 0xBB, 0xBA, 0xA9, 0xAA, 0x9A, 0xAB, 0xBB, 0xCD, 0xDC, 0xCB, 0xBB, 0xAA, + 0x99, 0x99, 0x89, 0x9A, 0xAA, 0xBB, 0xCC, 0xCC, 0xBB, 0xAA, 0x99, 0x88, + 0x88, 0x88, 0x99, 0xAA, 0xAB, 0xCB, 0xBB, 0xB9, 0x88, 0x87, 0x77, 0x77, + 0x88, 0x89, 0xAA, 0xBB, 0xCA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0xAB, 0xCA, 0xAA, 0x98, 0x87, 0x66, 0x66, 0x66, 0x67, 0x78, 0x9A, + 0xAB, 0xBB, 0xAA, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x9A, 0xBB, + 0xAA, 0x98, 0x77, 0x66, 0x55, 0x56, 0x66, 0x77, 0x89, 0x9B, 0xAA, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x66, 0x78, 0x99, 0xAB, 0xAA, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9C, 0xA9, 0xA9, 0x87, 0x76, 0x66, + 0x55, 0x66, 0x67, 0x78, 0x9A, 0xBB, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x78, 0x89, 0x9A, 0xBA, 0xA9, 0x98, 0x87, 0x76, 0x66, 0x67, 0x77, + 0x88, 0x9B, 0xBC, 0xAA, 0x99, 0x98, 0x77, 0x77, 0x77, 0x77, 0x89, 0x9A, + 0xBC, 0xCA, 0xAA, 0x99, 0x88, 0x87, 0x77, 0x77, 0x89, 0x99, 0xAB, 0xDD, + 0xCB, 0xCB, 0xA9, 0x89, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xCB, 0xDC, + 0xBA, 0xA9, 0x99, 0x98, 0x99, 0x9A, 0xBA, 0xBC, 0xDC, 0xEC, 0xCC, 0xAB, + 0xBA, 0x9A, 0x9A, 0xAA, 0xAB, 0xBC, 0xEF, 0xEC, 0xEC, 0xCB, 0xBB, 0xBB, + 0xBA, 0xBB, 0xBB, 0xCC, 0xDC, 0xEE, 0xAC, 0xBC, 0xCB, 0xBA, 0xCA, 0xBA, + 0xBC, 0xBB, 0xDD, 0xDD, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xBF, 0xDF, 0xCC, 0xED, 0xBA, 0xBC, 0xCB, 0xBB, 0xBB, 0xCF, 0x6F, 0xFF, + 0xDC, 0xFF, 0xEF, 0xED, 0xFD, 0xFF, 0xFF, 0xFF, 0xFD, 0xDF, 0xFF, 0xFD, + 0xFF, 0xDC, 0xDF, 0xFD, 0xFD, 0xFD, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xDC, + 0xBB, 0xCB, 0xFC, 0xFF, 0xFF, 0xFC, 0xCF, 0xFC, 0xFF, 0xCB, 0xBB, 0xAB, + 0xCC, 0xBF, 0xFD, 0xFF, 0xFF, 0xFF, 0xCB, 0xBB, 0xA9, 0xA9, 0xAC, 0xBE, + 0xEE, 0xFE, 0xED, 0xCF, 0xFF, 0xDA, 0xA9, 0x88, 0x88, 0xAA, 0xCD, 0xCD, + 0xFF, 0xDC, 0xFF, 0xFB, 0xA9, 0x86, 0x66, 0x78, 0xAB, 0xCC, 0xFD, 0xFC, + 0xCF, 0xDD, 0xDA, 0x86, 0x54, 0x46, 0x79, 0xAD, 0xCF, 0xFF, 0xCC, 0xFF, + 0xCB, 0xA9, 0x64, 0x22, 0x47, 0x8A, 0xCB, 0xFF, 0xFF, 0xCF, 0xFD, 0xB9, + 0x86, 0x42, 0x24, 0x68, 0x9B, 0xCE, 0xFD, 0xCC, 0xFD, 0xBB, 0xA9, 0x76, + 0x44, 0x57, 0x8A, 0xBC, 0xEE, 0xDE, 0xED, 0xFF, 0xDB, 0xA8, 0x76, 0x66, + 0x78, 0xAC, 0xCD, 0xDF, 0xFD, 0xFF, 0xFB, 0xCB, 0xA9, 0x88, 0x89, 0x9B, + 0xCF, 0xCF, 0xFF, 0xDF, 0xFC, 0xDF, 0xCA, 0xA9, 0xAA, 0xAA, 0xCF, 0xDD, + 0xFF, 0xFC, 0xFF, 0xFD, 0xCC, 0xCC, 0xBB, 0xAB, 0xCC, 0xCF, 0xFF, 0xFC, + 0xCF, 0xDD, 0xFC, 0xFF, 0xCB, 0xCD, 0xFF, 0xDF, 0xFF, 0xFF, 0xFC, 0xFF, + 0xDF, 0xDF, 0xCF, 0xFC, 0xCF, 0xFF, 0xFF, 0xDF, 0xFD, 0xCF, 0xFF, 0xCF, + 0xFF, 0xFC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC, 0xFF, 0xFF, 0xFF, 0xCF, + 0xFD, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0x6D, 0xCC, 0xCD, 0xBD, 0xDC, 0xFD, + 0xCD, 0xCF, 0xFF, 0xFF, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, + 0xCC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC, 0xCB, 0xCC, + 0xCC, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xBA, 0xA9, 0xAA, 0xCF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xA9, 0x88, 0x88, 0x9A, 0xBF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFB, 0xB9, 0x86, 0x66, 0x78, 0x9A, 0xCF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xB9, 0x87, 0x54, 0x45, 0x78, 0xAC, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFB, 0xA8, 0x64, 0x22, 0x46, 0x8A, 0xBC, 0xFF, 0xFF, 0xFF, 0xFC, 0xCA, + 0x86, 0x42, 0x24, 0x68, 0x9C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xA8, 0x75, + 0x44, 0x56, 0x8A, 0xCC, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0x98, 0x76, 0x66, + 0x89, 0xBC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0x98, 0x88, 0x89, 0xAC, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xCB, 0xAA, 0xA9, 0xBB, 0xCF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xBB, 0xCF, 0xEF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF, 0xCF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xFF, 0xFF, 0x9F, 0x6F, 0xFF, + 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0x9C, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x78, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x65, 0x47, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0x94, 0x12, 0x58, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF8, 0x52, 0x14, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, + 0x54, 0x78, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0x87, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x99, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x6F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x98, 0x98, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xF9, 0x74, 0x57, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFA, 0x85, 0x12, 0x59, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF9, 0x52, 0x14, 0x89, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x97, + 0x54, 0x67, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x89, + 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5F, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF, 0x5F, 0xFF, + 0xFF, 0xFF, 0xF6, 0xF6, 0x6F, 0x68, 0xF5, 0xFF, 0xFF, 0xFF, 0xFF, 0xF6, + 0x66, 0xF6, 0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF6, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x66, 0xF6, 0x6F, + 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF, 0x6F, 0x66, 0x66, 0xFF, 0x6F, 0xF6, + 0xFF, 0xFF, 0x6F, 0xCF, 0xFF, 0x6F, 0xFF, 0xF6, 0x6F, 0x6F, 0xFF, 0x6F, + 0xFF, 0xF6, 0x56, 0xF6, 0xF6, 0x56, 0xFF, 0xFF, 0x66, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x65, 0x56, 0x6F, 0xFF, 0xF6, 0xFF, 0x6F, 0xFF, 0xFF, + 0xF6, 0x66, 0xF6, 0xFF, 0x66, 0x6F, 0xFF, 0x6F, 0xFF, 0x6F, 0xF6, 0xFF, + 0x66, 0x6F, 0x56, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF6, 0x6F, + 0x46, 0xF5, 0x6F, 0x6F, 0xFF, 0xF5, 0x6B, 0xAF, 0xFF, 0x5F, 0xFF, 0xFF, + 0x6F, 0x6F, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xF6, 0x66, 0xF5, 0xFF, + 0x5F, 0xFF, 0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xF5, 0x55, 0xF6, 0xF6, 0xFF, + 0xFF, 0x6F, 0xFF, 0xFF, 0x6F, 0xF6, 0xFF, 0xF6, 0xF6, 0xFF, 0xFF, 0xFF, + 0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xF6, 0x6F, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xF6, 0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0x6F, + 0xF6, 0xFF, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF6, 0xFF, 0xFF, 0xFF, 0x6F, 0x6F, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0xF9, 0xFF, 0x9F, 0x4F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xF9, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x98, 0x98, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xF8, 0x67, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xF8, 0x97, 0x54, 0x47, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x8F, 0x74, 0x12, 0x57, 0x8F, 0xF9, 0xFF, 0xFF, 0x9F, 0xFF, 0x9F, + 0x98, 0x52, 0x24, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, + 0x54, 0x58, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0xF8, + 0x9F, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xFF, 0x89, 0xFF, + 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5F, 0xF9, 0x99, 0xFF, 0x9F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAA, 0xBA, 0xFF, 0xFF, 0xBF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xA8, 0x77, 0x9A, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xF8, 0x54, 0x45, 0x9A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFA, 0x84, 0x22, 0x47, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xA8, 0x42, 0x14, 0x7A, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x96, + 0x44, 0x59, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0x97, 0x78, + 0xAB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFA, 0xBF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xBF, 0xFB, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5F, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xFF, 0xFF, 0x5F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x7F, 0xFF, 0xF7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF6, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0x76, 0xF7, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0x6F, 0x67, 0x6F, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0xF7, 0x55, 0x5F, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xF7, 0x55, 0x44, 0x46, 0x7F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF7, 0xF5, 0x54, 0x44, 0x57, 0x66, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF6, + 0x75, 0x44, 0x34, 0x46, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x55, + 0x45, 0x45, 0x56, 0xFF, 0xFF, 0xFF, 0xFD, 0xCF, 0x6F, 0x7F, 0x75, 0x57, + 0x56, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x76, 0x66, 0x7F, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0x7F, 0xF7, 0x7F, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0xFF, 0xFF, 0xF7, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0x7F, 0xFF, 0xF7, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8F, 0xFF, 0xFF, 0x5F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xA7, 0x78, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFC, 0x44, 0x45, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0x73, 0x22, 0x48, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF7, 0x42, 0x24, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x86, + 0x43, 0x4C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x77, + 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xF9, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4F, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF, 0xFF, 0xF7, 0x7F, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x75, 0x67, 0x78, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xF9, 0x76, 0x43, 0x46, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xF6, 0x63, 0x23, 0x58, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xAF, 0x43, 0x23, 0x57, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0x85, + 0x54, 0x45, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8F, 0xF7, 0x55, + 0x68, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xBF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4F, 0xF8, 0xF8, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xBF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xAF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x87, 0x88, 0x9F, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xAA, 0x87, 0x66, 0x78, 0xAF, 0xBF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xBF, 0xA7, 0x54, 0x45, 0x6A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xF7, 0x64, 0x22, 0x46, 0x89, 0xDF, 0xFF, 0xFF, 0xFF, 0xFB, 0xFF, + 0x76, 0x42, 0x24, 0x68, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x75, + 0x44, 0x57, 0xA9, 0xFF, 0xFF, 0xFA, 0xFF, 0xFF, 0xFF, 0x97, 0x76, 0x67, + 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xBA, 0x98, 0x8A, 0xBB, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFA, 0xAF, 0xBF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x9F, 0xFF, 0xCF, 0x99, 0xFF, 0x3F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFD, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x78, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x64, 0x47, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFA, 0x84, 0x22, 0x48, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF7, 0x42, 0x14, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, + 0x44, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x99, 0x88, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xEE, 0xEF, 0xFF, 0xFF, 0x3F, 0xFF, + 0xFE, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, + 0xFF, 0xFF, 0xFF, 0xFE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x64, 0x56, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xF3, 0x12, 0x46, 0xFF, 0xFE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0x52, 0x24, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0x44, 0x6E, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFE, 0xFE, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFD, 0x83, 0x47, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xF4, 0x12, 0x4F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF7, 0x42, 0x24, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, + 0x44, 0x77, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0x8F, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x9C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + }, + { + { + 0xBE, 0xDD, 0xEC, 0xDD, 0xDD, 0xDC, 0xDE, 0xEE, 0xFF, 0xFF, 0xCD, 0xFE, + 0xFD, 0xDD, 0xDC, 0xCD, 0xDD, 0xEE, 0xEF, 0xFF, 0xFF, 0xDE, 0xFD, 0xCC, + 0xCC, 0xBB, 0xBB, 0xCC, 0xCD, 0xFF, 0xFF, 0xFD, 0xED, 0xDC, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCD, 0xFF, 0xFF, 0xDF, 0xEC, 0xBB, 0xA9, 0x99, 0x99, + 0x99, 0xAB, 0xCD, 0xFF, 0xFD, 0xEC, 0xBB, 0xA9, 0x88, 0x77, 0x78, 0x89, + 0xAB, 0xCD, 0xFE, 0xED, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xFC, 0xDC, 0xA9, 0x87, 0x76, 0x65, 0x66, 0x67, 0x89, 0xBC, 0xDF, + 0xDC, 0xCA, 0x98, 0x76, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xDD, 0xDB, + 0xA9, 0x87, 0x65, 0x54, 0x55, 0x56, 0x79, 0xAC, 0xDD, 0xDC, 0xBA, 0x97, + 0x65, 0x54, 0x44, 0x55, 0x67, 0x8A, 0xBD, 0xDE, 0xCB, 0xA9, 0x76, 0x65, + 0x54, 0x55, 0x66, 0x79, 0xAB, 0xCD, 0xED, 0xCA, 0x98, 0x76, 0x55, 0x55, + 0x56, 0x78, 0x9A, 0xBD, 0xDE, 0xDC, 0xB9, 0x87, 0x66, 0x65, 0x66, 0x77, + 0x89, 0xAC, 0xDC, 0xEF, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xDF, 0xFE, 0xCB, 0xA9, 0x88, 0x77, 0x78, 0x89, 0xAB, 0xCC, 0xED, + 0xFF, 0xED, 0xCB, 0xA9, 0x99, 0x99, 0x99, 0xAB, 0xBC, 0xDF, 0xDF, 0xFF, + 0xED, 0xCC, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFD, 0xFF, 0xFF, 0xFE, + 0xDC, 0xCB, 0xBB, 0xBC, 0xCC, 0xEE, 0xEF, 0xEF, 0xFF, 0xFF, 0xFE, 0xEE, + 0xCC, 0xDD, 0xDD, 0xDF, 0xEF, 0xFF, 0xDF, 0xFF, 0xFE, 0xFF, 0xDD, 0xDD, + 0xDD, 0xDD, 0xDE, 0xDE, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAD, 0xCB, 0xBB, 0xBC, 0xCB, 0xFC, 0xDB, 0xCD, 0xFF, 0xFF, 0xCF, 0xFF, + 0xBD, 0xCC, 0xDC, 0xDB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xCC, 0xDC, + 0xBB, 0xAB, 0xBA, 0xBC, 0xCD, 0xDD, 0xDD, 0xFB, 0xDD, 0xFB, 0xAB, 0xAA, + 0x9A, 0xAA, 0xAA, 0xBC, 0xFF, 0xFF, 0xCF, 0xFC, 0xCB, 0xBA, 0x99, 0x99, + 0x99, 0xAB, 0xBC, 0xCF, 0xFB, 0xDB, 0xBA, 0xA9, 0x98, 0x87, 0x78, 0x88, + 0xAA, 0xBC, 0xDF, 0xCF, 0xFB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x89, 0xAA, + 0xBF, 0xCF, 0xCC, 0xA9, 0x98, 0x76, 0x65, 0x56, 0x67, 0x89, 0xAB, 0xFC, + 0xCB, 0xDA, 0xA8, 0x76, 0x65, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xFB, + 0xA9, 0x87, 0x65, 0x44, 0x45, 0x56, 0x79, 0x9B, 0xCC, 0xBF, 0xBA, 0x97, + 0x75, 0x54, 0x44, 0x56, 0x68, 0x9A, 0xBE, 0xFB, 0xDB, 0xA9, 0x86, 0x65, + 0x44, 0x45, 0x67, 0x89, 0xAA, 0xCC, 0xDF, 0xBB, 0x98, 0x76, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xAC, 0xDC, 0xFC, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78, + 0x8A, 0xAB, 0xBB, 0xFC, 0xBC, 0xB9, 0x87, 0x76, 0x77, 0x77, 0x89, 0xAB, + 0xDC, 0xBC, 0xFC, 0xBB, 0xA9, 0x98, 0x88, 0x88, 0x99, 0x9A, 0xCB, 0xCB, + 0xFF, 0xFC, 0xCA, 0xAA, 0x99, 0x99, 0xA9, 0x9B, 0xBC, 0xCD, 0xDF, 0xFF, + 0xCF, 0xBB, 0xBA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCF, 0xDD, 0xFF, 0xFF, 0xFD, + 0xCC, 0xCB, 0xBB, 0xCC, 0xBB, 0xDB, 0xFF, 0xCF, 0xFF, 0xFF, 0xDD, 0xFD, + 0xBF, 0xDC, 0xCB, 0xBF, 0xDF, 0xFC, 0xFF, 0xFF, 0xFE, 0xED, 0xFF, 0xCB, + 0xBC, 0xDC, 0xBC, 0xBC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xCD, 0xDF, 0xDD, 0xDD, 0xDC, 0xDD, 0xDD, 0xDE, 0xFF, 0xFF, 0xDF, 0xFF, + 0xFE, 0xDD, 0xDC, 0xCC, 0xCD, 0xDE, 0xEF, 0xFF, 0xFF, 0xEF, 0xFD, 0xDC, + 0xBB, 0xBB, 0xBB, 0xBB, 0xCD, 0xDF, 0xFF, 0xFD, 0xFE, 0xDC, 0xBB, 0xAA, + 0x9A, 0xAA, 0xAB, 0xCD, 0xEF, 0xFF, 0xDF, 0xDC, 0xBA, 0xA9, 0x98, 0x88, + 0x89, 0xAA, 0xBD, 0xDF, 0xFD, 0xEC, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x89, + 0x9A, 0xBC, 0xEF, 0xDD, 0xCB, 0x99, 0x87, 0x76, 0x66, 0x67, 0x88, 0xAB, + 0xCD, 0xFD, 0xDB, 0xA9, 0x87, 0x66, 0x65, 0x56, 0x67, 0x89, 0xAB, 0xED, + 0xDC, 0xBA, 0x98, 0x76, 0x55, 0x55, 0x56, 0x77, 0x8A, 0xBD, 0xDD, 0xCB, + 0xA8, 0x76, 0x65, 0x55, 0x55, 0x66, 0x78, 0xAB, 0xCD, 0xDC, 0xB9, 0x87, + 0x65, 0x55, 0x44, 0x55, 0x67, 0x89, 0xBD, 0xDD, 0xCB, 0xA8, 0x76, 0x65, + 0x55, 0x55, 0x66, 0x78, 0x9B, 0xCD, 0xDC, 0xBA, 0x98, 0x76, 0x55, 0x55, + 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xDB, 0xA9, 0x87, 0x66, 0x65, 0x66, 0x67, + 0x89, 0xAB, 0xDD, 0xED, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x77, 0x89, 0x9B, + 0xCC, 0xDE, 0xEC, 0xCB, 0xA9, 0x88, 0x77, 0x78, 0x89, 0x9A, 0xBC, 0xED, + 0xFF, 0xDD, 0xBA, 0xA9, 0x98, 0x88, 0x89, 0xAA, 0xBC, 0xDD, 0xDF, 0xFF, + 0xFD, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xED, 0xFF, 0xFE, 0xFD, + 0xCB, 0xBB, 0xBB, 0xBC, 0xBC, 0xDD, 0xEF, 0xEF, 0xFF, 0xFF, 0xFE, 0xDC, + 0xCC, 0xCC, 0xCC, 0xDE, 0xDF, 0xFE, 0xDF, 0xFF, 0xFF, 0xFE, 0xDD, 0xDC, + 0xCD, 0xDD, 0xDE, 0xDE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xEE, 0xEE, 0xEE, 0xDE, 0xEE, 0xEE, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xED, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0x4D, 0xDD, + 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xE3, 0xEE, 0xE4, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x5E, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x3E, 0x4E, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0x44, 0x44, 0x4D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, + 0x44, 0x4D, 0xDD, 0xD4, 0x4D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD4, 0xD3, + 0x3D, 0x4D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xE4, 0xE4, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x4E, 0xEE, 0x44, 0xEE, + 0xE4, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE4, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xED, 0xED, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x4E, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xED, 0xED, 0xED, 0xEE, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xAD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDC, 0xFD, 0xFF, 0xFF, 0xFF, 0xDD, 0xFF, + 0xDF, 0xDD, 0xCC, 0xCC, 0xCC, 0xDF, 0xFF, 0xFF, 0xFF, 0xEF, 0xDD, 0xDC, + 0xCC, 0xBB, 0xBB, 0xBC, 0xCC, 0xDF, 0xFF, 0xFE, 0xFD, 0xEC, 0xBB, 0xAA, + 0x9A, 0xAA, 0xAB, 0xCD, 0xDF, 0xFF, 0xCD, 0xCD, 0xBA, 0xA9, 0x98, 0x88, + 0x99, 0x9A, 0xCD, 0xDF, 0xFD, 0xDC, 0xBA, 0xA9, 0x88, 0x77, 0x78, 0x89, + 0x9A, 0xBD, 0xFF, 0xCC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x77, 0x89, 0x9A, + 0xDF, 0xFC, 0xDB, 0xB9, 0x87, 0x66, 0x65, 0x66, 0x67, 0x89, 0xAC, 0xDD, + 0xDD, 0xBA, 0x98, 0x76, 0x55, 0x55, 0x56, 0x78, 0x8A, 0xCD, 0xED, 0xCB, + 0xA8, 0x76, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9B, 0xDE, 0xDC, 0xBA, 0x87, + 0x65, 0x55, 0x45, 0x55, 0x67, 0x8A, 0xBD, 0xCD, 0xCB, 0xA8, 0x76, 0x55, + 0x54, 0x55, 0x56, 0x78, 0xAB, 0xCD, 0xED, 0xBA, 0x98, 0x76, 0x55, 0x55, + 0x56, 0x78, 0x9A, 0xBC, 0xCD, 0xFB, 0xA9, 0x87, 0x66, 0x65, 0x66, 0x67, + 0x89, 0xAB, 0xCD, 0xFF, 0xDB, 0xA8, 0x87, 0x76, 0x66, 0x77, 0x89, 0xAB, + 0xCC, 0xDF, 0xFD, 0xCA, 0x98, 0x88, 0x77, 0x77, 0x89, 0x9A, 0xBC, 0xED, + 0xFF, 0xFD, 0xCB, 0xA9, 0x98, 0x88, 0x99, 0xAA, 0xBC, 0xDD, 0xDF, 0xFF, + 0xDC, 0xCB, 0xAA, 0xAA, 0x9A, 0xAB, 0xBC, 0xCE, 0xED, 0xFF, 0xFF, 0xFD, + 0xCC, 0xBB, 0xBC, 0xBB, 0xCC, 0xDD, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xDC, + 0xCC, 0xCD, 0xDC, 0xDF, 0xFF, 0xEF, 0xDF, 0xFF, 0xFE, 0xFC, 0xEC, 0xCD, + 0xCC, 0xDD, 0xCD, 0xDD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xCB, 0xBB, 0xBB, 0xBA, 0xAB, 0xBB, 0xCC, 0xCC, 0xEF, 0xBC, 0xDD, + 0xCC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCC, 0xEE, 0xFE, 0xCC, 0xCC, 0xBB, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xCC, 0xDE, 0xEC, 0xCC, 0xBA, 0xAA, 0x99, + 0x98, 0x99, 0x9A, 0xAB, 0xBC, 0xDD, 0xBC, 0xBA, 0xA9, 0x98, 0x88, 0x88, + 0x88, 0x99, 0xAB, 0xBC, 0xDB, 0xBB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x78, + 0x99, 0xAB, 0xCC, 0xBB, 0xAA, 0x98, 0x77, 0x76, 0x66, 0x77, 0x78, 0x9A, + 0xAC, 0xCB, 0xBA, 0x98, 0x87, 0x66, 0x66, 0x66, 0x67, 0x78, 0x9A, 0xBB, + 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xBB, 0xBA, + 0x98, 0x76, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xAB, 0xBB, 0x99, 0x87, + 0x66, 0x55, 0x55, 0x56, 0x67, 0x89, 0xAA, 0xAB, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x55, + 0x66, 0x77, 0x89, 0xAB, 0xBB, 0xBA, 0x98, 0x87, 0x66, 0x66, 0x66, 0x67, + 0x88, 0x9A, 0xBB, 0xCC, 0xAA, 0x98, 0x77, 0x76, 0x66, 0x77, 0x78, 0x99, + 0xAB, 0xBC, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x88, 0x99, 0xAB, 0xBB, + 0xCC, 0xCB, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBD, 0xDD, + 0xBB, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xEE, 0xDC, 0xCB, + 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xCF, 0xFE, 0xDD, 0xCC, 0xBB, + 0xBA, 0xBB, 0xBB, 0xBC, 0xCD, 0xDC, 0xCE, 0xDD, 0xDC, 0xCB, 0xBB, 0xBB, + 0xBB, 0xBB, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDD, 0xBC, 0xDC, + 0xCC, 0xBB, 0xBA, 0xAA, 0xAA, 0xAB, 0xCB, 0xCD, 0xEE, 0xBD, 0xCC, 0xBB, + 0xAA, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xCD, 0xDB, 0xCC, 0xAA, 0xA9, 0x99, + 0x88, 0x89, 0x99, 0x9A, 0xBC, 0xDC, 0xBC, 0xBA, 0x99, 0x98, 0x88, 0x77, + 0x88, 0x89, 0x9A, 0xBC, 0xCB, 0xBA, 0xA9, 0x88, 0x87, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBB, 0xAB, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x67, 0x78, 0x89, + 0xAB, 0xBA, 0xAA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x9A, 0xBA, + 0xAA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x66, 0x67, 0x89, 0xAA, 0xAA, 0xA9, + 0x88, 0x76, 0x66, 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xAA, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x67, 0x88, 0x9A, 0xAA, 0xA9, 0x88, 0x76, 0x66, + 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xBA, 0x98, 0x87, 0x66, 0x66, 0x66, + 0x66, 0x77, 0x88, 0x9A, 0xAB, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67, + 0x88, 0x9A, 0xAA, 0xBA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x78, 0x99, + 0xAB, 0xAB, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x78, 0x89, 0xAB, 0xBB, + 0xCC, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xBC, 0xBC, 0xCB, + 0xBA, 0x99, 0x99, 0x88, 0x89, 0x99, 0xAA, 0xBB, 0xCB, 0xDD, 0xDC, 0xBA, + 0xA9, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0xCD, 0xBE, 0xEE, 0xCC, 0xCB, 0xBA, + 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDB, 0xCD, 0xEC, 0xBB, 0xBB, 0xBA, 0xAA, + 0xAA, 0xAB, 0xBB, 0xBC, 0x90, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBA, 0xAA, 0xAA, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xBB, 0xCB, + 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDC, 0xBC, 0xBB, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xCA, 0xBB, 0xAA, 0x99, 0x98, + 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, 0xAB, 0xAA, 0x99, 0x88, 0x87, 0x77, + 0x88, 0x88, 0x9A, 0xAB, 0xBA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x77, 0x77, 0x89, + 0x9A, 0xAA, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x66, 0x67, 0x78, 0x89, 0xAA, + 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0x99, 0xA9, + 0x88, 0x76, 0x66, 0x66, 0x66, 0x66, 0x77, 0x89, 0xA9, 0x9A, 0x98, 0x77, + 0x66, 0x65, 0x56, 0x66, 0x67, 0x78, 0x9A, 0x99, 0xA9, 0x87, 0x76, 0x66, + 0x65, 0x66, 0x66, 0x77, 0x89, 0xA9, 0xAA, 0x98, 0x87, 0x66, 0x66, 0x66, + 0x66, 0x77, 0x88, 0x9A, 0x9A, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x78, 0x99, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89, + 0x9A, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, 0x89, 0x9A, 0xAA, + 0xBB, 0xAA, 0x99, 0x88, 0x87, 0x78, 0x88, 0x89, 0x9A, 0xAB, 0xAB, 0xCB, + 0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBA, 0xCD, 0xCB, 0xAA, + 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xBD, 0xDC, 0xCB, 0xBA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCB, 0xCC, 0xCB, 0xBA, 0xAA, 0x99, 0x99, + 0x99, 0xAA, 0xAA, 0xBB, 0x90, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDD, 0xCC, 0xCB, + 0xBC, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xAC, 0xCD, 0xDE, 0xBD, 0xCB, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xCA, 0xBC, 0xBA, 0x99, 0x98, + 0x88, 0x89, 0x89, 0x9A, 0xBB, 0xCC, 0xAB, 0xAA, 0x99, 0x88, 0x87, 0x77, + 0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, + 0x89, 0xAA, 0xCC, 0xAA, 0xA9, 0x88, 0x87, 0x76, 0x66, 0x77, 0x78, 0x89, + 0xAB, 0xBA, 0xB9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77, 0x78, 0x99, 0xAA, + 0xAA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xAA, 0xA9, + 0x87, 0x76, 0x66, 0x65, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xAA, 0x98, 0x87, + 0x66, 0x65, 0x55, 0x66, 0x67, 0x88, 0x9A, 0xAA, 0xA9, 0x88, 0x76, 0x66, + 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x88, 0x9A, 0xAA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67, + 0x78, 0x9A, 0xBA, 0xAB, 0xA9, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x99, + 0xAA, 0xBB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, 0x89, 0xAB, 0xBA, + 0xBB, 0xAA, 0x99, 0x88, 0x87, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBD, 0xBB, + 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xBB, 0xDD, 0xCB, 0xAB, + 0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xBC, 0xBD, 0xDC, 0xBB, 0xBB, 0xAA, + 0xA9, 0xAA, 0xAA, 0xBB, 0xDC, 0xDC, 0xBE, 0xDC, 0xBB, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAB, 0xBB, 0x90, 0x00, 0x00, 0x00, + }, + { + 0x9C, 0xBB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xCB, 0xEC, + 0xCC, 0xBB, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0xDD, 0xEE, 0xBD, 0xCB, 0xBA, + 0xAA, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCE, 0xDB, 0xCB, 0xBA, 0xA9, 0x99, + 0x88, 0x89, 0x99, 0xAA, 0xBC, 0xDC, 0xBC, 0xBA, 0xA9, 0x98, 0x88, 0x88, + 0x88, 0x99, 0xAA, 0xBC, 0xCB, 0xBB, 0xA9, 0x88, 0x87, 0x77, 0x77, 0x78, + 0x89, 0xAB, 0xBC, 0xAB, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x77, 0x78, 0x99, + 0xAB, 0xBA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x67, 0x78, 0x9A, 0xBB, + 0xAA, 0x99, 0x87, 0x76, 0x66, 0x55, 0x66, 0x67, 0x89, 0x9A, 0xAA, 0xA9, + 0x88, 0x76, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAA, 0xAA, 0x98, 0x87, + 0x66, 0x55, 0x55, 0x56, 0x67, 0x88, 0x9A, 0xAA, 0xA9, 0x88, 0x76, 0x65, + 0x55, 0x56, 0x66, 0x78, 0x99, 0xAA, 0xAB, 0x99, 0x87, 0x76, 0x66, 0x56, + 0x66, 0x77, 0x89, 0x9A, 0xAB, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xAA, 0xBB, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x77, 0x78, 0x99, + 0xAB, 0xBB, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88, 0x99, 0xAA, 0xBB, + 0xCC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBC, 0xDC, + 0xBA, 0xA9, 0x99, 0x88, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xCD, 0xDC, 0xBB, + 0xAA, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0xCD, 0xBD, 0xED, 0xCC, 0xBB, 0xBB, + 0xAA, 0xAA, 0xAB, 0xBC, 0xCC, 0xDC, 0xBD, 0xDC, 0xCB, 0xBB, 0xAA, 0xAA, + 0xAA, 0xBB, 0xBB, 0xBC, 0x90, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xED, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xFF, 0xFF, 0xEF, 0xBF, 0xFF, + 0xFD, 0xDD, 0xDD, 0xDD, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xED, 0xDC, + 0xCC, 0xCC, 0xCC, 0xDD, 0xFF, 0xFF, 0xFF, 0xFD, 0xFE, 0xDC, 0xCB, 0xBB, + 0xBB, 0xBB, 0xCC, 0xEF, 0xFF, 0xFF, 0xDE, 0xDC, 0xBB, 0xAA, 0x99, 0x99, + 0xAA, 0xBC, 0xDF, 0xFF, 0xED, 0xEC, 0xCB, 0xA9, 0x98, 0x88, 0x88, 0x9A, + 0xBD, 0xEF, 0xFF, 0xDD, 0xCB, 0xA9, 0x88, 0x76, 0x67, 0x78, 0x9A, 0xCD, + 0xEF, 0xFD, 0xDC, 0xBA, 0x98, 0x76, 0x55, 0x56, 0x78, 0x9B, 0xCD, 0xEE, + 0xDE, 0xCB, 0x98, 0x76, 0x54, 0x44, 0x56, 0x79, 0xAC, 0xDE, 0xED, 0xDC, + 0xB9, 0x87, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xCD, 0xED, 0xDE, 0xCB, 0x98, + 0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xDE, 0xDE, 0xFC, 0xB9, 0x87, 0x55, + 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xED, 0xEE, 0xDB, 0xA8, 0x76, 0x55, 0x55, + 0x67, 0x89, 0xAB, 0xCE, 0xEF, 0xFD, 0xCA, 0x98, 0x76, 0x66, 0x67, 0x78, + 0x9B, 0xBD, 0xED, 0xFF, 0xFD, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC, + 0xDE, 0xDF, 0xFE, 0xDC, 0xBA, 0x99, 0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xED, + 0xFF, 0xFF, 0xEC, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xFE, 0xEF, 0xFF, + 0xFF, 0xEC, 0xDC, 0xBB, 0xBB, 0xCC, 0xCC, 0xDE, 0xFD, 0xFF, 0xFF, 0xFF, + 0xFE, 0xED, 0xDC, 0xCD, 0xDD, 0xDE, 0xEF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xEE, 0xFE, 0xDE, 0xEE, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF, 0xEE, 0xDD, 0xDE, + 0xFE, 0xDD, 0xDE, 0xEE, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + { + 0xBF, 0xDD, 0xDC, 0xCC, 0xBC, 0xCD, 0xDD, 0xDF, 0xFF, 0xFF, 0xCD, 0xDF, + 0xDC, 0xCB, 0xCB, 0xCB, 0xCC, 0xCD, 0xFF, 0xFF, 0xFF, 0xDE, 0xDC, 0xCC, + 0xBB, 0xBA, 0xAB, 0xBB, 0xCD, 0xFF, 0xFF, 0xFC, 0xDD, 0xBB, 0xAA, 0x99, + 0x99, 0x9A, 0xAB, 0xCD, 0xDF, 0xFF, 0xDC, 0xBB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0xAB, 0xBC, 0xDF, 0xFC, 0xCC, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x89, + 0xAB, 0xBD, 0xFF, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xDD, 0xFC, 0xCA, 0x99, 0x87, 0x66, 0x55, 0x56, 0x67, 0x89, 0xAB, 0xFF, + 0xCC, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBE, 0xEC, 0xBA, + 0x98, 0x76, 0x55, 0x54, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xDD, 0xCB, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x78, 0xAB, 0xCC, 0xCC, 0xBA, 0x97, 0x76, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xBC, 0xDF, 0xDB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAB, 0xCD, 0xDD, 0xDB, 0xA8, 0x87, 0x77, 0x67, 0x77, 0x89, 0xAA, + 0xBD, 0xFF, 0xDD, 0xCA, 0xA9, 0x88, 0x77, 0x88, 0x89, 0x9A, 0xBC, 0xDC, + 0xFF, 0xFD, 0xCB, 0xAA, 0x99, 0x89, 0x99, 0xAA, 0xBC, 0xCF, 0xCF, 0xFF, + 0xFD, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDC, 0xFF, 0xFF, 0xFF, 0xFD, + 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFE, 0xDC, + 0xCC, 0xCC, 0xDD, 0xCC, 0xFE, 0xDF, 0xDF, 0xFF, 0xFF, 0xDD, 0xCC, 0xCD, + 0xCC, 0xCF, 0xDD, 0xDD, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + { + 0xBF, 0xDD, 0xED, 0xED, 0xDD, 0xDE, 0xEE, 0xFF, 0xFF, 0xFF, 0xCE, 0xFF, + 0xFF, 0xFE, 0xDE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFE, 0xDD, + 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xFF, 0xFF, 0xFE, 0xFE, 0xED, 0xCC, 0xBB, + 0xBB, 0xBB, 0xCD, 0xEF, 0xFF, 0xFF, 0xDE, 0xDD, 0xBB, 0xAA, 0x99, 0x99, + 0xAB, 0xCD, 0xED, 0xFF, 0xFE, 0xFD, 0xCB, 0xA9, 0x98, 0x88, 0x88, 0x9A, + 0xBD, 0xEF, 0xFF, 0xDF, 0xDC, 0xB9, 0x87, 0x76, 0x67, 0x78, 0x9A, 0xCE, + 0xFF, 0xFE, 0xDD, 0xBA, 0x97, 0x76, 0x55, 0x56, 0x78, 0x9B, 0xCE, 0xFF, + 0xED, 0xDB, 0xA8, 0x76, 0x54, 0x44, 0x56, 0x79, 0xAC, 0xEF, 0xEE, 0xEC, + 0xB9, 0x86, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xCD, 0xFE, 0xEE, 0xCB, 0x98, + 0x65, 0x44, 0x44, 0x56, 0x79, 0xAC, 0xEF, 0xFD, 0xEC, 0xB9, 0x87, 0x55, + 0x44, 0x45, 0x67, 0x9A, 0xCD, 0xFD, 0xEF, 0xDB, 0xA8, 0x76, 0x55, 0x55, + 0x67, 0x89, 0xAC, 0xDF, 0xEE, 0xFD, 0xCB, 0x98, 0x76, 0x66, 0x67, 0x78, + 0xAB, 0xCD, 0xEE, 0xFF, 0xFD, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC, + 0xDF, 0xEF, 0xFF, 0xED, 0xBA, 0xA9, 0x99, 0x99, 0xAA, 0xBC, 0xDD, 0xEE, + 0xFF, 0xFF, 0xDC, 0xCB, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xEE, 0xEF, 0xFF, + 0xFF, 0xED, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xEF, 0xFE, 0xFF, 0xFF, 0xFF, + 0xED, 0xDD, 0xDD, 0xDD, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xEE, 0xFE, 0xEF, 0xFF, 0xFF, 0xFF, 0xBF, 0xEF, 0xFF, 0xEE, 0xED, 0xEE, + 0xED, 0xFE, 0xFE, 0xEE, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xCB, 0xBB, 0xBB, 0xBB, 0xAB, 0xBB, 0xCC, 0xCD, 0xDE, 0xBC, 0xDD, + 0xCC, 0xBB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDF, 0xFD, 0xBC, 0xCB, 0xBA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xEE, 0xEB, 0xCB, 0xBA, 0xA9, 0x99, + 0x99, 0x99, 0xAA, 0xAB, 0xCD, 0xDD, 0xBC, 0xBA, 0x99, 0x88, 0x88, 0x88, + 0x89, 0x9A, 0xAB, 0xCD, 0xCB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xBC, 0xCC, 0xBB, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x77, 0x88, 0x9A, + 0xBC, 0xCB, 0xBA, 0x98, 0x77, 0x66, 0x65, 0x66, 0x77, 0x89, 0xAB, 0xBB, + 0xBB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xBA, 0xBA, + 0x98, 0x76, 0x65, 0x54, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, + 0x66, 0x54, 0x45, 0x56, 0x77, 0x89, 0xAB, 0xBB, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x55, + 0x66, 0x78, 0x89, 0xAB, 0xBB, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAA, 0xBB, 0xCC, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xAB, 0xBC, 0xCB, 0xBA, 0x99, 0x88, 0x87, 0x78, 0x88, 0x9A, 0xAB, 0xCB, + 0xCD, 0xCB, 0xBA, 0x99, 0x98, 0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xCD, 0xDD, + 0xCB, 0xBA, 0xAA, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDC, 0xDE, 0xDD, 0xCB, + 0xBB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xCE, 0xEE, 0xDD, 0xCC, 0xCB, + 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEC, 0xBD, 0xDD, 0xCC, 0xCC, 0xBB, 0xBB, + 0xBB, 0xBB, 0xCC, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCC, 0xBB, 0xCC, + 0xBB, 0xAA, 0xAA, 0x99, 0xA9, 0xAA, 0xBB, 0xBD, 0xDC, 0xAB, 0xBA, 0xA9, + 0x99, 0x99, 0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xCA, 0xBA, 0xA9, 0x99, 0x88, + 0x88, 0x88, 0x89, 0x9A, 0xBB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x88, 0x77, + 0x88, 0x89, 0x9A, 0xBB, 0xB9, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0xAA, 0xBB, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89, + 0xAA, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA, + 0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99, + 0x87, 0x76, 0x66, 0x55, 0x56, 0x67, 0x78, 0x89, 0xAA, 0x9A, 0x98, 0x77, + 0x66, 0x65, 0x55, 0x66, 0x77, 0x88, 0x9A, 0x99, 0xA9, 0x88, 0x76, 0x66, + 0x65, 0x66, 0x67, 0x78, 0x89, 0xA9, 0x99, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x88, 0x9A, 0x9A, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x88, 0x99, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x89, + 0xAA, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0x9A, 0xAA, + 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBB, 0xCB, + 0xAA, 0xA9, 0x98, 0x88, 0x89, 0x99, 0x9A, 0xAB, 0xBB, 0xCC, 0xBB, 0xAA, + 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xBD, 0xDD, 0xCB, 0xBB, 0xAA, + 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDB, 0xBD, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAB, 0xBB, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xBB, 0xCB, + 0xBA, 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xAB, 0xCC, 0xDC, 0xAB, 0xAA, 0xA9, + 0x99, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCA, 0xBA, 0x99, 0x98, 0x88, + 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x88, 0x88, 0x77, 0x77, + 0x78, 0x89, 0x9A, 0xAB, 0xB9, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBA, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89, + 0xAA, 0xA9, 0x99, 0x87, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x89, 0xAA, + 0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99, + 0x87, 0x76, 0x66, 0x66, 0x66, 0x66, 0x78, 0x89, 0xAA, 0x99, 0x98, 0x77, + 0x66, 0x65, 0x56, 0x66, 0x67, 0x88, 0x9A, 0x99, 0x99, 0x87, 0x76, 0x66, + 0x66, 0x66, 0x67, 0x78, 0x89, 0xA9, 0x9A, 0x98, 0x77, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x88, 0x9A, 0xAA, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x66, 0x77, + 0x78, 0x89, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x67, 0x77, 0x78, 0x89, + 0x9A, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, 0x89, 0x9A, 0xAA, + 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xAB, 0xBB, + 0xAA, 0x99, 0x98, 0x88, 0x88, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xCB, 0xBA, + 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBB, 0xBD, 0xDC, 0xCB, 0xBB, 0xAA, + 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCB, 0xCD, 0xCB, 0xBB, 0xAA, 0xAA, 0x99, + 0xAA, 0xAA, 0xAB, 0xBB, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBA, 0xAA, 0xA9, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0xCD, 0xAB, 0xCC, + 0xBB, 0xBB, 0xAA, 0xAA, 0xBA, 0xBC, 0xCD, 0xED, 0xEC, 0xBC, 0xBB, 0xBA, + 0xA9, 0xA9, 0xA9, 0xAA, 0xAB, 0xBC, 0xDE, 0xDB, 0xBB, 0xBA, 0x99, 0x99, + 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDC, 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, + 0x88, 0x99, 0xAB, 0xCC, 0xBA, 0xBA, 0x99, 0x88, 0x87, 0x77, 0x77, 0x78, + 0x89, 0xAB, 0xCC, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x78, 0x9A, + 0xBB, 0xBA, 0xAA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67, 0x89, 0x9A, 0xBA, + 0xAA, 0x99, 0x87, 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xAA, 0xAA, + 0x98, 0x76, 0x65, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBA, 0xAA, 0x99, 0x87, + 0x66, 0x55, 0x55, 0x56, 0x67, 0x89, 0xAA, 0xBA, 0xA9, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0xAB, 0xA9, 0x87, 0x76, 0x65, 0x55, + 0x66, 0x78, 0x89, 0xAA, 0xAB, 0xBA, 0x98, 0x87, 0x66, 0x66, 0x66, 0x77, + 0x89, 0x9A, 0xAA, 0xBB, 0xA9, 0x98, 0x87, 0x77, 0x67, 0x77, 0x88, 0x9A, + 0xAB, 0xAC, 0xCB, 0xAA, 0x98, 0x87, 0x77, 0x78, 0x89, 0x99, 0xAA, 0xBA, + 0xCC, 0xCB, 0xA9, 0x99, 0x88, 0x88, 0x89, 0x99, 0xAA, 0xBB, 0xAC, 0xCC, + 0xBB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBB, 0xCB, 0xCE, 0xDC, 0xCB, + 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xBE, 0xED, 0xDC, 0xCC, 0xBB, + 0xBB, 0xBB, 0xAA, 0xBC, 0xCC, 0xDB, 0xAD, 0xDD, 0xBB, 0xBB, 0xBB, 0xBA, + 0xAA, 0xBB, 0xBB, 0xBC, 0x90, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xCD, 0xAB, 0xCC, + 0xCB, 0xBB, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDE, 0xFD, 0xBC, 0xBB, 0xAA, + 0xAA, 0x9A, 0xAA, 0xAA, 0xBB, 0xCD, 0xDE, 0xDB, 0xBB, 0xAA, 0x99, 0x99, + 0x89, 0x99, 0x9A, 0xAB, 0xCD, 0xDC, 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88, + 0x89, 0x9A, 0xBB, 0xCC, 0xCA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xBB, 0xCC, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x88, 0x9A, + 0xBC, 0xCA, 0xAA, 0x98, 0x77, 0x66, 0x65, 0x66, 0x67, 0x89, 0xAA, 0xCB, + 0xAA, 0x99, 0x87, 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xBA, 0xAA, + 0x98, 0x76, 0x65, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0xA9, 0x87, + 0x66, 0x55, 0x45, 0x56, 0x67, 0x89, 0xAB, 0xBB, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x55, + 0x66, 0x78, 0x89, 0xAB, 0xBB, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0x9A, 0xBB, 0xBC, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xAB, 0xBC, 0xCB, 0xBA, 0x99, 0x88, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xBB, + 0xCD, 0xCB, 0xAA, 0x99, 0x98, 0x88, 0x89, 0x99, 0xAA, 0xBB, 0xBD, 0xED, + 0xCB, 0xBA, 0xA9, 0x99, 0x99, 0xAA, 0xAA, 0xBC, 0xCB, 0xDE, 0xED, 0xCC, + 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0xCD, 0xBD, 0xFE, 0xED, 0xCC, 0xCC, + 0xBB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDB, 0xAD, 0xDD, 0xCC, 0xCC, 0xBB, 0xBB, + 0xAB, 0xBB, 0xBB, 0xBC, 0x90, 0x00, 0x00, 0x00, + }, + { + 0xAF, 0xDF, 0xDF, 0xFD, 0xDD, 0xCD, 0xDF, 0xFD, 0xFF, 0xDD, 0x9F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xDF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xDF, 0xCD, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDF, 0xCC, 0xCD, 0xFD, 0xFF, 0xFF, + 0xFF, 0xFD, 0xFF, 0xFF, 0xFD, 0xBA, 0x88, 0xAC, 0xDF, 0xFD, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xCA, 0x74, 0x46, 0x9C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xDF, 0xFC, 0x85, 0x22, 0x47, 0xDF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, + 0xD8, 0x42, 0x13, 0x7B, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xA6, + 0x43, 0x58, 0xCF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xA8, 0x78, + 0xAB, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xDB, 0xBC, 0xDF, + 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xDD, 0xFD, 0xDF, 0xDF, + 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFD, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDF, + 0xDD, 0xFD, 0xFF, 0xDD, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xFF, 0xFD, 0xDD, 0xCD, 0xDE, 0xDD, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, + 0xFF, 0xED, 0xDC, 0xCC, 0xCD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEE, 0xDD, + 0xBB, 0xBA, 0xBB, 0xBD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFD, 0xCC, 0xBA, 0xAA, + 0x99, 0xAA, 0xBB, 0xCE, 0xFF, 0xFF, 0xFF, 0xEC, 0xBA, 0x99, 0x88, 0x89, + 0x9A, 0xAB, 0xCE, 0xFF, 0xFE, 0xFC, 0xCA, 0x98, 0x87, 0x77, 0x78, 0x99, + 0xAB, 0xDD, 0xFF, 0xDD, 0xBB, 0x98, 0x77, 0x66, 0x66, 0x77, 0x99, 0xBC, + 0xDF, 0xED, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xFF, + 0xFC, 0xB9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0xAB, 0xCF, 0xFC, 0xDB, + 0xA8, 0x76, 0x55, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xED, 0xDC, 0xCA, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9B, 0xCE, 0xFE, 0xDB, 0xA9, 0x76, 0x55, + 0x44, 0x55, 0x67, 0x89, 0xBC, 0xDD, 0xDC, 0xCA, 0x98, 0x76, 0x55, 0x55, + 0x66, 0x78, 0xAB, 0xCF, 0xED, 0xFD, 0xBA, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x9A, 0xBE, 0xEF, 0xDF, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x9A, 0xBC, + 0xCF, 0xFE, 0xFF, 0xDC, 0xA9, 0x98, 0x88, 0x88, 0x9A, 0xBC, 0xDF, 0xEF, + 0xFF, 0xFE, 0xCB, 0xBA, 0x99, 0x9A, 0xAA, 0xBC, 0xCD, 0xFF, 0xFF, 0xFF, + 0xFD, 0xCD, 0xCB, 0xBB, 0xBB, 0xBC, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, + 0xED, 0xDC, 0xDC, 0xDD, 0xCF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xDF, 0xEF, + 0xDD, 0xEE, 0xFF, 0xDE, 0xFF, 0xFF, 0xBF, 0xFF, 0xFD, 0xFF, 0xFE, 0xED, + 0xFE, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xEE, 0xED, 0xDD, 0xCC, 0xCC, 0xDD, 0xEE, 0xEF, 0xFF, 0xDE, 0xFF, + 0xED, 0xCC, 0xCC, 0xBC, 0xCC, 0xDD, 0xEE, 0xFF, 0xFF, 0xEF, 0xED, 0xCC, + 0xBB, 0xAA, 0xAA, 0xBB, 0xCD, 0xDE, 0xFF, 0xFE, 0xFD, 0xCB, 0xAA, 0xA9, + 0x99, 0x99, 0xAB, 0xBC, 0xEF, 0xFF, 0xDD, 0xCB, 0xAA, 0x98, 0x88, 0x88, + 0x89, 0xAA, 0xBC, 0xEF, 0xFD, 0xDB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89, + 0x9B, 0xCD, 0xEE, 0xDD, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x67, 0x89, 0xAB, + 0xCE, 0xEC, 0xCB, 0x98, 0x77, 0x66, 0x55, 0x56, 0x67, 0x89, 0xBC, 0xDE, + 0xCC, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xDC, 0xBA, + 0x98, 0x76, 0x55, 0x54, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x77, 0x9A, 0xBD, 0xDC, 0xCA, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xDC, 0xB9, 0x87, 0x66, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xCD, 0xDD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78, + 0x9A, 0xBC, 0xED, 0xED, 0xCB, 0x99, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCD, 0xDE, 0xEC, 0xBA, 0x99, 0x88, 0x87, 0x88, 0x89, 0xAB, 0xCD, 0xEF, + 0xFF, 0xDD, 0xBB, 0xA9, 0x99, 0x99, 0x99, 0xAB, 0xCC, 0xEF, 0xFF, 0xFF, + 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCD, 0xEF, 0xFF, 0xFF, 0xFF, 0xED, + 0xCC, 0xBB, 0xBB, 0xBC, 0xDC, 0xDE, 0xFF, 0xEF, 0xFF, 0xFF, 0xEE, 0xED, + 0xDC, 0xDD, 0xED, 0xEF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFE, 0xED, 0xDD, 0xDD, + 0xDD, 0xDD, 0xEF, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCD, 0xCD, 0xDC, 0xCC, 0xCD, 0xDE, 0xDD, 0xFF, 0xFF, 0xFF, 0xDD, 0xFE, + 0xDC, 0xCC, 0xCB, 0xCC, 0xCD, 0xDD, 0xFF, 0xFF, 0xFF, 0xDF, 0xDD, 0xCB, + 0xBB, 0xBA, 0xBB, 0xBC, 0xCD, 0xEF, 0xEF, 0xFD, 0xFC, 0xCB, 0xA9, 0xA9, + 0x99, 0x9A, 0xAB, 0xCD, 0xDF, 0xFE, 0xCE, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x99, 0xAB, 0xCD, 0xEF, 0xFC, 0xCB, 0xAA, 0x98, 0x77, 0x77, 0x77, 0x89, + 0xAB, 0xCE, 0xFE, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAC, + 0xDE, 0xEC, 0xCA, 0x98, 0x77, 0x65, 0x55, 0x56, 0x77, 0x9A, 0xBC, 0xDD, + 0xCC, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xEC, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xCC, 0xB9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xCB, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xDC, 0xBA, 0x98, 0x76, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xCD, 0xDD, 0xDC, 0xB9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x99, 0xBB, 0xDF, 0xDE, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCD, 0xDD, 0xED, 0xBB, 0xA9, 0x98, 0x88, 0x88, 0x89, 0xAA, 0xBD, 0xDD, + 0xFF, 0xED, 0xCB, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDE, 0xEF, 0xFF, + 0xFD, 0xCC, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xEE, 0xFF, 0xFF, 0xED, + 0xDC, 0xCB, 0xBC, 0xCB, 0xCD, 0xCD, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xDD, + 0xEC, 0xDC, 0xCC, 0xEF, 0xEF, 0xFF, 0xCF, 0xFF, 0xFF, 0xFD, 0xED, 0xDD, + 0xDC, 0xDD, 0xDD, 0xDF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xBF, 0xEE, 0xED, 0xEF, 0xED, 0xEE, 0xFE, 0xEF, 0xFE, 0xFF, 0xAE, 0xFF, + 0xFE, 0xEE, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDD, + 0xDD, 0xDD, 0xDD, 0xEE, 0xFF, 0xFF, 0xFF, 0xFE, 0xFE, 0xED, 0xCC, 0xCB, + 0xBB, 0xCC, 0xDE, 0xEF, 0xFF, 0xFF, 0xFF, 0xDD, 0xCB, 0xAA, 0xAA, 0xAA, + 0xBB, 0xCD, 0xEF, 0xFF, 0xFE, 0xFE, 0xCB, 0xA9, 0x98, 0x88, 0x89, 0xAB, + 0xCD, 0xFF, 0xFF, 0xEE, 0xDC, 0xA9, 0x88, 0x77, 0x77, 0x89, 0xAB, 0xDE, + 0xFF, 0xFF, 0xFD, 0xBA, 0x97, 0x76, 0x55, 0x66, 0x89, 0xAC, 0xDF, 0xFE, + 0xEE, 0xDB, 0xA8, 0x76, 0x54, 0x45, 0x67, 0x8A, 0xBD, 0xFF, 0xEE, 0xED, + 0xBA, 0x87, 0x54, 0x33, 0x45, 0x68, 0x9B, 0xDF, 0xFE, 0xFF, 0xDB, 0xA8, + 0x75, 0x43, 0x34, 0x56, 0x89, 0xBC, 0xEF, 0xEE, 0xFD, 0xCA, 0x87, 0x65, + 0x44, 0x45, 0x68, 0x9B, 0xCE, 0xFF, 0xFF, 0xEC, 0xB9, 0x86, 0x65, 0x55, + 0x67, 0x8A, 0xBD, 0xEF, 0xFF, 0xFF, 0xDC, 0xA9, 0x87, 0x66, 0x77, 0x89, + 0xAB, 0xCF, 0xFF, 0xFF, 0xFE, 0xCB, 0xA9, 0x88, 0x88, 0x89, 0xAB, 0xCD, + 0xEF, 0xFF, 0xFF, 0xFE, 0xCB, 0xAA, 0x99, 0x9A, 0xAA, 0xBC, 0xDE, 0xFF, + 0xFF, 0xFF, 0xFE, 0xDC, 0xBB, 0xBB, 0xBB, 0xCC, 0xDE, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xED, 0xDD, 0xCD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xEF, 0xEF, 0xEF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xEF, 0xFF, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xAE, 0xDD, 0xED, 0xDD, 0xDD, 0xDD, 0xDD, 0xFE, 0xEE, 0xFF, 0xBD, 0xFF, + 0xEE, 0xED, 0xED, 0xEE, 0xEF, 0xFE, 0xFF, 0xFF, 0xFE, 0xEE, 0xED, 0xDD, + 0xCC, 0xCC, 0xDD, 0xDE, 0xEE, 0xFF, 0xFF, 0xEE, 0xEE, 0xDC, 0xCB, 0xBB, + 0xBB, 0xBC, 0xDD, 0xEE, 0xFF, 0xFE, 0xDE, 0xDC, 0xBB, 0xAA, 0x99, 0xAA, + 0xBB, 0xCD, 0xEF, 0xFF, 0xED, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x89, 0xAB, + 0xCD, 0xEF, 0xFE, 0xDD, 0xDB, 0xA9, 0x87, 0x77, 0x77, 0x89, 0xAB, 0xCE, + 0xFF, 0xED, 0xDC, 0xBA, 0x97, 0x76, 0x55, 0x67, 0x89, 0xAC, 0xDE, 0xFE, + 0xDD, 0xCB, 0xA8, 0x76, 0x54, 0x45, 0x67, 0x8A, 0xBC, 0xEF, 0xDD, 0xDC, + 0xB9, 0x87, 0x54, 0x33, 0x45, 0x68, 0x9B, 0xCD, 0xEE, 0xDE, 0xCB, 0xA8, + 0x75, 0x43, 0x34, 0x56, 0x89, 0xBC, 0xDF, 0xDD, 0xED, 0xBA, 0x97, 0x65, + 0x44, 0x45, 0x78, 0x9A, 0xCD, 0xEE, 0xDE, 0xDC, 0xB9, 0x87, 0x65, 0x55, + 0x67, 0x89, 0xBC, 0xDE, 0xDD, 0xEE, 0xDB, 0xA9, 0x87, 0x66, 0x77, 0x89, + 0xAB, 0xCD, 0xFD, 0xDE, 0xED, 0xCB, 0xA9, 0x88, 0x88, 0x89, 0x9A, 0xBC, + 0xDF, 0xDD, 0xFE, 0xED, 0xCB, 0xAA, 0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xFE, + 0xDF, 0xFF, 0xED, 0xCC, 0xBB, 0xAB, 0xBB, 0xBC, 0xDE, 0xEF, 0xDD, 0xFF, + 0xFF, 0xEE, 0xDC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xFE, 0xDF, 0xFF, 0xFF, + 0xEE, 0xED, 0xDD, 0xDD, 0xDD, 0xDE, 0xFE, 0xED, 0xFF, 0xFF, 0xFF, 0xEF, + 0xEE, 0xEE, 0xFE, 0xFF, 0xFF, 0xFE, 0x9D, 0xEE, 0xDD, 0xDE, 0xDD, 0xDD, + 0xDD, 0xDD, 0xFE, 0xED, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xBB, 0xCB, + 0xBA, 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDC, 0xAB, 0xBA, 0xA9, + 0x99, 0x88, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xCA, 0xBA, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBB, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77, + 0x88, 0x89, 0x99, 0xAB, 0xBA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xAA, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89, + 0xAA, 0xA9, 0x99, 0x87, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA, + 0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x98, + 0x87, 0x76, 0x66, 0x55, 0x66, 0x67, 0x78, 0x89, 0xA9, 0x99, 0x98, 0x77, + 0x66, 0x65, 0x56, 0x66, 0x77, 0x88, 0x9A, 0x99, 0x99, 0x87, 0x76, 0x66, + 0x65, 0x66, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x67, 0x77, + 0x88, 0x9A, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x89, + 0xAA, 0xAA, 0xA9, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0x9A, 0xBA, + 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xAB, 0xCB, + 0xA9, 0x99, 0x98, 0x88, 0x89, 0x99, 0xAA, 0xAB, 0xCB, 0xBC, 0xBA, 0xAA, + 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBC, 0xCC, 0xCB, 0xBA, 0xAA, + 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDC, 0xAC, 0xBB, 0xBA, 0xAA, 0x99, 0x99, + 0xAA, 0xAA, 0xAB, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xAB, 0xCB, + 0xBA, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0xCC, 0xAB, 0xBA, 0xA9, + 0x99, 0x88, 0x89, 0x99, 0x9A, 0xAB, 0xBC, 0xBA, 0xBA, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x89, 0x99, 0xAB, 0xBB, 0xAA, 0xA9, 0x98, 0x88, 0x77, 0x77, + 0x78, 0x89, 0x99, 0xAB, 0xA9, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBA, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89, + 0x9A, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x89, 0xAA, + 0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x98, + 0x87, 0x76, 0x66, 0x56, 0x66, 0x67, 0x78, 0x89, 0xA9, 0x99, 0x88, 0x77, + 0x66, 0x65, 0x56, 0x66, 0x77, 0x88, 0x9A, 0x99, 0x98, 0x87, 0x76, 0x66, + 0x66, 0x66, 0x67, 0x78, 0x89, 0xA9, 0x99, 0x98, 0x77, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x88, 0x99, 0xAA, 0x9A, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x89, + 0xAA, 0xAA, 0xAA, 0x98, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0x9A, 0xBA, + 0xAB, 0xA9, 0x99, 0x88, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xAB, 0xBB, + 0xAA, 0x99, 0x98, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCB, 0xBC, 0xBB, 0xAA, + 0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xAB, 0xBC, 0xBC, 0xDC, 0xBB, 0xBA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDC, 0xAC, 0xBB, 0xBA, 0xAA, 0xA9, 0x99, + 0xAA, 0xAA, 0xAB, 0xBC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xBD, 0xAB, 0xCB, + 0xBA, 0xAA, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xBC, 0xDC, 0xBC, 0xBA, 0xA9, + 0x99, 0x89, 0x88, 0x99, 0x9A, 0xAB, 0xCD, 0xBA, 0xBA, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x89, 0x9A, 0xBB, 0xBC, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, + 0x78, 0x89, 0x9A, 0xBC, 0xB9, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBA, 0x9A, 0x99, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89, + 0xAB, 0xA9, 0x99, 0x87, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x9A, 0xAA, + 0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x98, + 0x87, 0x76, 0x66, 0x65, 0x66, 0x66, 0x78, 0x89, 0xAA, 0x99, 0x98, 0x77, + 0x66, 0x65, 0x56, 0x66, 0x67, 0x88, 0x9A, 0x99, 0x99, 0x87, 0x76, 0x66, + 0x66, 0x66, 0x67, 0x78, 0x89, 0xAA, 0x9A, 0x98, 0x87, 0x66, 0x66, 0x66, + 0x66, 0x77, 0x88, 0x9A, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x88, 0x99, 0xAA, 0x9A, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x89, + 0xAA, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0x9A, 0xBA, + 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0x9A, 0xBB, 0xBB, 0xCB, + 0xAA, 0x99, 0x98, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xCB, 0xCC, 0xCB, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBC, 0xDC, 0xBC, 0xBA, 0xAA, + 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDC, 0xAD, 0xCB, 0xBA, 0xAA, 0xAA, 0x9A, + 0xAA, 0xAA, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xCC, 0xCC, 0xBC, 0xCB, 0xCB, 0xCC, 0xCC, 0xCD, 0xDD, 0x9C, 0xED, + 0xCD, 0xCC, 0xCB, 0xCC, 0xCC, 0xCD, 0xEE, 0xEF, 0xFD, 0xCD, 0xCC, 0xCB, + 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xDC, 0xCC, 0xBA, 0xAA, 0x99, + 0x9A, 0xAA, 0xBB, 0xBC, 0xDE, 0xFD, 0xCD, 0xBB, 0xA9, 0x98, 0x88, 0x89, + 0x9A, 0xAB, 0xCC, 0xEE, 0xDC, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x99, + 0xAB, 0xCD, 0xED, 0xBC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x78, 0x89, 0xBB, + 0xCE, 0xDC, 0xCB, 0xA8, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC, + 0xBC, 0xBA, 0x87, 0x66, 0x55, 0x45, 0x66, 0x78, 0x9A, 0xCD, 0xCC, 0xCB, + 0xA8, 0x76, 0x55, 0x44, 0x45, 0x67, 0x89, 0xAC, 0xCC, 0xCC, 0xBA, 0x87, + 0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBD, 0xCC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x67, 0x89, 0xAB, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x66, 0x78, 0x9A, 0xBD, 0xCD, 0xCC, 0xAA, 0x98, 0x76, 0x66, 0x66, 0x78, + 0x9A, 0xBC, 0xDC, 0xDD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x78, 0x89, 0xAB, + 0xCD, 0xDD, 0xED, 0xCB, 0xAA, 0x99, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xDC, + 0xDE, 0xDD, 0xCB, 0xBA, 0xA9, 0x99, 0x99, 0xAA, 0xBC, 0xDD, 0xDD, 0xEE, + 0xDD, 0xCC, 0xBB, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDD, 0xDF, 0xFE, 0xEE, + 0xDC, 0xCC, 0xCB, 0xCC, 0xCC, 0xCD, 0xDE, 0xDE, 0xFF, 0xFF, 0xEE, 0xDD, + 0xDC, 0xCD, 0xDD, 0xDD, 0xED, 0xED, 0xAE, 0xDD, 0xDD, 0xCD, 0xCC, 0xCC, + 0xCC, 0xCD, 0xDD, 0xDD, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xFE, 0xEE, 0xDD, 0xDD, 0xDD, 0xEE, 0xEF, 0xEF, 0xFF, 0xBF, 0xFF, + 0xFF, 0xDD, 0xDD, 0xDD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, + 0xCC, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xFF, 0xFF, 0xFE, 0xDC, 0xCB, 0xAA, + 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xFF, 0xEF, 0xDC, 0xBB, 0xA9, 0x99, 0x99, + 0x9A, 0xBC, 0xDE, 0xFF, 0xFE, 0xED, 0xBA, 0x99, 0x88, 0x77, 0x78, 0x9A, + 0xBC, 0xDF, 0xFF, 0xED, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x78, 0x9A, 0xBC, + 0xEF, 0xFD, 0xDC, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x78, 0x9A, 0xCE, 0xFF, + 0xED, 0xBA, 0x97, 0x65, 0x55, 0x45, 0x56, 0x79, 0xAB, 0xDE, 0xFD, 0xCB, + 0xA9, 0x76, 0x55, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xEF, 0xDD, 0xBA, 0x87, + 0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xDE, 0xEE, 0xDC, 0xA9, 0x76, 0x55, + 0x44, 0x55, 0x67, 0x9A, 0xBD, 0xEF, 0xEE, 0xCA, 0x98, 0x76, 0x55, 0x55, + 0x67, 0x89, 0xAC, 0xDF, 0xFE, 0xED, 0xBA, 0x98, 0x76, 0x66, 0x67, 0x78, + 0x9B, 0xCD, 0xEE, 0xFF, 0xDC, 0xBA, 0x98, 0x77, 0x77, 0x88, 0x9A, 0xBC, + 0xEF, 0xFF, 0xFE, 0xDC, 0xBA, 0x99, 0x88, 0x89, 0xAA, 0xBC, 0xDE, 0xFF, + 0xFF, 0xFF, 0xDC, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xFF, 0xFF, + 0xFF, 0xDC, 0xCB, 0xBB, 0xBB, 0xCC, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xED, 0xDD, 0xCD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, + 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xAF, 0xFA, 0x7F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF, 0x9F, 0xAA, 0xBA, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF, 0xFF, 0x98, 0x89, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x76, 0x78, 0x78, 0x8F, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xF7, 0x64, 0x56, 0x78, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xA9, 0x74, 0x22, 0x57, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x97, 0x52, 0x14, 0x69, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x86, + 0x44, 0x57, 0x8A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x99, 0x76, 0x77, + 0x89, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xC9, 0x89, 0x99, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xAF, 0xFA, 0xFF, 0xFF, + 0xFF, 0xFA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF, 0xFF, 0xFF, 0xFF, + 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, + 0xFF, 0xFA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF, 0xFF, 0xAF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x79, 0xFA, 0xCF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xAF, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xCD, 0xDD, 0xCC, 0xCB, 0xBB, 0xCC, 0xCC, 0xDD, 0xEE, 0xEE, 0xCD, 0xEE, + 0xDD, 0xCC, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xFF, 0xDE, 0xDC, 0xCB, + 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xFD, 0xDC, 0xBB, 0xAA, 0x99, + 0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xFE, 0xCC, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0x9A, 0xBC, 0xDE, 0xEC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x67, 0x88, 0xAB, + 0xCD, 0xDC, 0xCA, 0x98, 0x77, 0x65, 0x55, 0x56, 0x67, 0x89, 0xAB, 0xDD, + 0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xDC, 0xBA, + 0x98, 0x76, 0x55, 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xBB, 0xA9, 0x87, + 0x65, 0x55, 0x45, 0x56, 0x77, 0x9A, 0xBC, 0xDC, 0xBA, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xCC, 0xA9, 0x87, 0x66, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xBD, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78, + 0x99, 0xAC, 0xDD, 0xDD, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCD, 0xDD, 0xDC, 0xBA, 0x99, 0x88, 0x78, 0x88, 0x89, 0xAA, 0xBC, 0xDD, + 0xEE, 0xDC, 0xBA, 0xA9, 0x99, 0x99, 0x99, 0xAB, 0xBC, 0xDE, 0xDE, 0xFE, + 0xDC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xCC, 0xDD, 0xED, 0xFF, 0xFE, 0xDC, + 0xCB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xEF, 0xEF, 0xFF, 0xFF, 0xED, 0xDD, + 0xCC, 0xCC, 0xDD, 0xEE, 0xEF, 0xFE, 0xCF, 0xFF, 0xEE, 0xDD, 0xDD, 0xDD, + 0xDD, 0xDD, 0xDD, 0xEE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xDE, 0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0xEF, 0xFF, 0xBF, 0xEF, + 0xED, 0xDC, 0xCC, 0xCC, 0xCD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFE, 0xDD, 0xCB, + 0xBB, 0xBA, 0xBB, 0xBC, 0xCD, 0xEF, 0xFF, 0xFD, 0xED, 0xCB, 0xBA, 0xA9, + 0x99, 0x9A, 0xBB, 0xCD, 0xEF, 0xFF, 0xDD, 0xCC, 0xBA, 0x99, 0x88, 0x88, + 0x89, 0xAB, 0xCD, 0xEF, 0xED, 0xCC, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x89, + 0xAB, 0xDE, 0xFF, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x67, 0x89, 0xAC, + 0xDE, 0xED, 0xCB, 0xA9, 0x77, 0x66, 0x55, 0x56, 0x67, 0x8A, 0xBC, 0xDE, + 0xDC, 0xBA, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCE, 0xED, 0xCB, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xDC, 0xB9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xEC, 0xCB, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAC, 0xDF, 0xDD, 0xBA, 0x97, 0x66, 0x55, 0x55, + 0x66, 0x78, 0xAB, 0xCD, 0xDD, 0xDB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78, + 0x9A, 0xBD, 0xDF, 0xDE, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x9A, 0xAC, + 0xDF, 0xDF, 0xFD, 0xCB, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xBB, 0xCD, 0xEE, + 0xFF, 0xFC, 0xCB, 0xAA, 0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xEF, 0xFF, 0xFE, + 0xEC, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCD, 0xEF, 0xED, 0xEF, 0xFF, 0xED, + 0xDD, 0xCB, 0xCB, 0xCC, 0xDD, 0xDE, 0xFF, 0xEF, 0xFF, 0xFF, 0xEE, 0xED, + 0xDD, 0xDE, 0xEE, 0xEE, 0xFF, 0xFE, 0xAE, 0xFF, 0xEE, 0xEE, 0xEE, 0xED, + 0xFD, 0xED, 0xFE, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCF, 0xFE, 0xFF, 0xEE, 0xEF, 0xEF, 0xDF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, + 0xFF, 0xFE, 0xEE, 0xDD, 0xDF, 0xEF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFD, + 0xDD, 0xCB, 0xBC, 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xCB, 0xBA, + 0xAA, 0xBB, 0xBC, 0xDF, 0xFF, 0xFF, 0xEF, 0xDD, 0xCB, 0xA9, 0x99, 0x99, + 0x9A, 0xBC, 0xDF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x88, 0x77, 0x88, 0x9A, + 0xBC, 0xDF, 0xFF, 0xFE, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x78, 0x9A, 0xBD, + 0xFF, 0xFE, 0xDC, 0xB9, 0x87, 0x66, 0x55, 0x56, 0x78, 0x9B, 0xDE, 0xFF, + 0xEE, 0xCA, 0x98, 0x65, 0x54, 0x45, 0x56, 0x79, 0xAC, 0xEF, 0xFF, 0xDC, + 0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x8A, 0xCD, 0xFF, 0xED, 0xCA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x79, 0xAC, 0xDF, 0xFE, 0xEC, 0xA9, 0x86, 0x65, + 0x44, 0x55, 0x67, 0x9A, 0xCD, 0xFF, 0xEE, 0xCB, 0x98, 0x76, 0x55, 0x55, + 0x67, 0x89, 0xAC, 0xDF, 0xFF, 0xFD, 0xCA, 0x98, 0x76, 0x66, 0x67, 0x89, + 0xAB, 0xCE, 0xEF, 0xFF, 0xEC, 0xBA, 0x98, 0x87, 0x77, 0x89, 0x9B, 0xCD, + 0xEF, 0xFF, 0xFF, 0xEC, 0xBA, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xDF, 0xFF, + 0xFF, 0xFE, 0xDC, 0xBB, 0xAA, 0xAA, 0xAB, 0xCC, 0xDF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xDD, 0xCB, 0xCB, 0xCC, 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFE, 0xDD, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBB, 0xAA, 0xAA, 0x99, 0xAA, 0xAA, 0xAB, 0xCC, 0xCD, 0xBB, 0xCC, + 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDD, 0xEE, 0xBC, 0xBB, 0xA9, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xDA, 0xBA, 0xA9, 0x99, 0x88, + 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xCC, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77, + 0x88, 0x89, 0x9A, 0xBC, 0xCA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0xAB, 0xBB, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x67, 0x78, 0x99, + 0xAB, 0xBA, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xBB, + 0x9A, 0x98, 0x77, 0x66, 0x65, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xB9, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAB, 0x9A, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xAA, 0xA9, 0x87, 0x76, 0x66, + 0x55, 0x66, 0x67, 0x78, 0x9A, 0xAA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x89, 0xAA, 0xAA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xBB, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xBB, 0xBA, 0xA9, 0x88, 0x87, 0x77, 0x77, 0x88, 0x99, 0xAA, 0xBB, + 0xBC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBC, 0xCC, + 0xBB, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xDD, 0xCC, 0xBB, + 0xAA, 0xAA, 0xA9, 0xAA, 0xAB, 0xBB, 0xCD, 0xCD, 0xDD, 0xDC, 0xCB, 0xBB, + 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xEC, 0xAE, 0xDD, 0xCC, 0xBB, 0xAA, 0xAA, + 0xAB, 0xBB, 0xBC, 0xCD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBA, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0xCB, 0x9B, 0xCB, + 0xBA, 0xAA, 0xAA, 0xA9, 0xAA, 0xAA, 0xBB, 0xCD, 0xDC, 0xBC, 0xBB, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xCA, 0xBB, 0xAA, 0x99, 0x88, + 0x88, 0x88, 0x99, 0x9A, 0xBC, 0xCC, 0xAB, 0xA9, 0x98, 0x88, 0x87, 0x77, + 0x88, 0x89, 0x9A, 0xBC, 0xBA, 0xAA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0xAA, 0xBB, 0xAA, 0x99, 0x88, 0x77, 0x66, 0x66, 0x67, 0x78, 0x89, + 0xAB, 0xB9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xBB, + 0x9A, 0x98, 0x87, 0x66, 0x65, 0x56, 0x66, 0x77, 0x89, 0xAB, 0xA9, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x87, 0x76, 0x65, + 0x55, 0x66, 0x67, 0x78, 0x9A, 0xBA, 0xAA, 0x98, 0x87, 0x66, 0x66, 0x66, + 0x67, 0x78, 0x89, 0xAA, 0xAA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x67, 0x77, + 0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x78, 0x88, 0x99, 0xAA, 0xBB, + 0xBB, 0xBA, 0x99, 0x98, 0x88, 0x88, 0x89, 0x99, 0xAA, 0xBC, 0xBB, 0xCB, + 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xCD, 0xCC, 0xBB, + 0xAA, 0xA9, 0x99, 0xAA, 0xAB, 0xBB, 0xDD, 0xBC, 0xDC, 0xCC, 0xCB, 0xBA, + 0xAA, 0xBA, 0xBB, 0xBC, 0xCC, 0xDC, 0x9C, 0xCC, 0xBB, 0xBA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xAB, 0xCB, + 0xBA, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDC, 0xAB, 0xBA, 0xA9, + 0x99, 0x98, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCA, 0xBA, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x98, 0x88, 0x77, 0x77, + 0x78, 0x89, 0x9A, 0xAB, 0xB9, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBA, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x67, 0x78, 0x89, + 0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA, + 0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x98, + 0x87, 0x76, 0x66, 0x55, 0x66, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x88, 0x77, + 0x66, 0x65, 0x55, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66, + 0x66, 0x66, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x98, 0x77, 0x66, 0x66, 0x66, + 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x67, 0x77, + 0x88, 0x9A, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x99, 0xAA, 0xBA, + 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0x9A, 0xBB, 0xAB, 0xBB, + 0xAA, 0x99, 0x99, 0x88, 0x89, 0x99, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xAA, + 0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xBC, 0xBC, 0xDC, 0xCB, 0xBA, 0xAA, + 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xCB, 0xAC, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAB, 0xBB, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCC, 0x9C, 0xDC, + 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xEC, 0xBC, 0xCB, 0xAA, + 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCE, 0xCB, 0xCB, 0xBA, 0x99, 0x98, + 0x88, 0x89, 0x99, 0xAB, 0xBC, 0xDC, 0xBB, 0xBA, 0x98, 0x88, 0x77, 0x77, + 0x88, 0x89, 0xAA, 0xBC, 0xCB, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x99, 0xAB, 0xCB, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x67, 0x78, 0x99, + 0xBC, 0xBA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x89, 0x9A, 0xBB, + 0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xBA, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xBA, 0xA9, 0x88, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0x98, 0x87, 0x76, 0x65, 0x66, + 0x66, 0x78, 0x89, 0xAB, 0xBB, 0xAA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x89, 0xAA, 0xCB, 0xBB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x77, 0x89, 0x9A, + 0xBC, 0xBB, 0xBA, 0xA9, 0x98, 0x87, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xCC, + 0xBC, 0xBB, 0x99, 0x98, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCD, 0xCC, 0xDC, + 0xBB, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDC, 0xDD, 0xDC, 0xBB, + 0xAA, 0xAA, 0xAA, 0xAA, 0xBC, 0xCC, 0xCD, 0xDD, 0xDE, 0xCD, 0xCB, 0xBB, + 0xBB, 0xBB, 0xBC, 0xCD, 0xDD, 0xED, 0x9D, 0xCC, 0xCC, 0xBB, 0xBB, 0xBB, + 0xBB, 0xBC, 0xCC, 0xDD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAE, 0xDE, 0xDD, 0xED, 0xDC, 0xCC, 0xDC, 0xDD, 0xDD, 0xDD, 0x9E, 0xFF, + 0xFF, 0xFD, 0xEE, 0xEE, 0xEE, 0xDE, 0xEE, 0xEF, 0xFD, 0xEF, 0xEE, 0xED, + 0xDD, 0xDD, 0xDD, 0xDE, 0xEF, 0xEE, 0xEF, 0xDE, 0xEF, 0xDD, 0xDC, 0xCC, + 0xCC, 0xCC, 0xDD, 0xEE, 0xEF, 0xFD, 0xDF, 0xED, 0xCC, 0xBB, 0xBB, 0xBB, + 0xBC, 0xCD, 0xDD, 0xFF, 0xDE, 0xEE, 0xDC, 0xBA, 0x99, 0x99, 0x9A, 0xBC, + 0xCE, 0xFE, 0xFD, 0xDF, 0xDC, 0xBA, 0x98, 0x87, 0x88, 0x9A, 0xBC, 0xDE, + 0xFE, 0xDD, 0xEE, 0xCB, 0xA8, 0x76, 0x66, 0x67, 0x9A, 0xBC, 0xEE, 0xFD, + 0xDE, 0xDC, 0xA9, 0x86, 0x54, 0x45, 0x68, 0x9B, 0xCD, 0xEF, 0xED, 0xED, + 0xCB, 0x97, 0x64, 0x32, 0x46, 0x79, 0xBC, 0xDE, 0xFE, 0xDE, 0xEC, 0xB9, + 0x86, 0x42, 0x24, 0x57, 0x9A, 0xCD, 0xEF, 0xDD, 0xED, 0xCB, 0x98, 0x75, + 0x44, 0x56, 0x79, 0xAC, 0xDE, 0xEE, 0xDF, 0xED, 0xCA, 0x98, 0x76, 0x66, + 0x78, 0x9B, 0xCD, 0xFF, 0xED, 0xEF, 0xDC, 0xBA, 0x98, 0x77, 0x78, 0x9A, + 0xBC, 0xDE, 0xFE, 0xDF, 0xED, 0xDC, 0xBA, 0x99, 0x99, 0x9A, 0xBC, 0xDD, + 0xEF, 0xEE, 0xFF, 0xED, 0xCC, 0xBB, 0xAA, 0xBB, 0xBC, 0xDD, 0xEF, 0xFE, + 0xDF, 0xFE, 0xEE, 0xDC, 0xCC, 0xCC, 0xCC, 0xDE, 0xEF, 0xFF, 0xEE, 0xFE, + 0xFE, 0xEE, 0xEE, 0xDD, 0xDD, 0xED, 0xEE, 0xEE, 0xFE, 0xEE, 0xEF, 0xFF, + 0xEE, 0xEE, 0xDE, 0xEE, 0xFE, 0xFF, 0xFF, 0xEE, 0xFF, 0xFF, 0xFE, 0xEF, + 0xEF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xAE, 0xDD, 0xDD, 0xEE, 0xDD, 0xDD, + 0xEE, 0xDE, 0xEE, 0xFE, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xCF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEF, 0xFE, 0xEF, 0xFF, 0xEF, 0xAF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xEE, 0xDE, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xEC, 0xCC, + 0xCC, 0xCC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEC, 0xBA, 0xAA, 0xAA, + 0xBC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEC, 0xBA, 0x98, 0x88, 0x89, 0xAB, + 0xDE, 0xFF, 0xFF, 0xFF, 0xFD, 0xBA, 0x98, 0x77, 0x77, 0x89, 0xAC, 0xDF, + 0xFF, 0xFF, 0xFE, 0xCB, 0x98, 0x66, 0x55, 0x66, 0x89, 0xBC, 0xDF, 0xFF, + 0xFF, 0xDC, 0xA8, 0x76, 0x44, 0x45, 0x67, 0x8A, 0xCD, 0xFF, 0xFF, 0xFD, + 0xCA, 0x86, 0x54, 0x33, 0x45, 0x68, 0xAC, 0xDF, 0xFF, 0xFF, 0xDC, 0xA8, + 0x75, 0x43, 0x34, 0x56, 0x8A, 0xBD, 0xEF, 0xFE, 0xFE, 0xCA, 0x87, 0x65, + 0x44, 0x45, 0x78, 0xAC, 0xDF, 0xFF, 0xFF, 0xED, 0xB9, 0x86, 0x65, 0x55, + 0x67, 0x9B, 0xCE, 0xFF, 0xFF, 0xFF, 0xDB, 0xA9, 0x87, 0x66, 0x77, 0x8A, + 0xBD, 0xEF, 0xFF, 0xFF, 0xFF, 0xDB, 0xA9, 0x98, 0x88, 0x9A, 0xBC, 0xEF, + 0xFF, 0xFF, 0xFF, 0xFE, 0xDC, 0xBA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFE, 0xDD, 0xCC, 0xBC, 0xCD, 0xDE, 0xEF, 0xFF, 0xFE, 0xFF, + 0xFF, 0xFF, 0xED, 0xDD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xDE, 0xDD, 0xDD, 0xCC, 0xDD, 0xDD, 0xEE, 0xDE, 0xEF, 0xAE, 0xFE, + 0xEE, 0xDD, 0xCC, 0xCC, 0xDD, 0xEE, 0xFF, 0xFF, 0xFF, 0xDF, 0xDE, 0xDC, + 0xCC, 0xBB, 0xBB, 0xCC, 0xDD, 0xFE, 0xEF, 0xEE, 0xFD, 0xDC, 0xBA, 0xAA, + 0x9A, 0xAA, 0xBC, 0xDD, 0xEF, 0xFF, 0xDD, 0xDC, 0xBA, 0xA9, 0x88, 0x88, + 0x99, 0xAB, 0xCD, 0xFF, 0xFC, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x78, 0x89, + 0xAC, 0xDD, 0xFE, 0xDD, 0xCA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xBC, + 0xDE, 0xFC, 0xDB, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xEF, + 0xDD, 0xBA, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0xAB, 0xDE, 0xEC, 0xCB, + 0xA8, 0x76, 0x55, 0x44, 0x45, 0x67, 0x89, 0xBD, 0xEF, 0xCC, 0xBA, 0x87, + 0x65, 0x54, 0x44, 0x56, 0x78, 0x9B, 0xCD, 0xDD, 0xDB, 0xA8, 0x76, 0x55, + 0x44, 0x55, 0x67, 0x89, 0xBC, 0xEE, 0xDD, 0xCA, 0x98, 0x76, 0x55, 0x55, + 0x67, 0x89, 0xAB, 0xCE, 0xED, 0xDC, 0xB9, 0x87, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBC, 0xFE, 0xED, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x88, 0x9A, 0xBC, + 0xDE, 0xED, 0xEE, 0xCB, 0xAA, 0x98, 0x88, 0x89, 0x9A, 0xBC, 0xDD, 0xEE, + 0xEF, 0xED, 0xCC, 0xBA, 0xA9, 0x99, 0xAA, 0xBB, 0xCD, 0xEF, 0xED, 0xFE, + 0xED, 0xDC, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xEF, 0xFE, 0xFF, 0xFF, 0xED, + 0xDD, 0xDC, 0xCD, 0xCD, 0xDD, 0xEE, 0xFF, 0xEE, 0xFF, 0xFF, 0xFE, 0xEE, + 0xDE, 0xDD, 0xEE, 0xEF, 0xFF, 0xFF, 0x9F, 0xEE, 0xED, 0xFE, 0xEF, 0xEE, + 0xDF, 0xEE, 0xEE, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xDD, 0xDC, 0xCC, 0xCB, 0xCC, 0xCC, 0xDD, 0xEE, 0xEE, 0xBE, 0xFE, + 0xDD, 0xCC, 0xCB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFF, 0xDE, 0xDC, 0xCB, + 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFF, 0xFD, 0xDC, 0xCB, 0xAA, 0x99, + 0x99, 0x9A, 0xAB, 0xBC, 0xDE, 0xEE, 0xCD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0xAA, 0xBC, 0xDE, 0xEC, 0xCB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x89, + 0xAB, 0xCD, 0xEE, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x67, 0x89, 0xAB, + 0xCD, 0xEC, 0xCA, 0x98, 0x87, 0x66, 0x55, 0x56, 0x67, 0x89, 0xBC, 0xDD, + 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xDC, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xCC, 0xDC, 0xBA, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xBA, 0x87, 0x66, 0x55, 0x55, + 0x67, 0x78, 0x9A, 0xCD, 0xDD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x67, 0x78, + 0x9A, 0xBC, 0xDD, 0xDD, 0xCA, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x99, 0xAB, + 0xCD, 0xDD, 0xEC, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xDD, + 0xDE, 0xDC, 0xBB, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xEE, 0xEE, + 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xEE, 0xEF, 0xFE, 0xDD, + 0xCC, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xEE, 0xFF, 0xFF, 0xED, 0xDD, + 0xDC, 0xCD, 0xDD, 0xDE, 0xEF, 0xFE, 0xBE, 0xFE, 0xEE, 0xED, 0xDD, 0xDD, + 0xDD, 0xDD, 0xEE, 0xEE, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xDD, 0xDD, 0x9D, 0xFF, + 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xEE, 0xEF, 0xFD, 0xEE, 0xDD, 0xCC, + 0xBB, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xEF, 0xDE, 0xED, 0xCB, 0xBA, 0xA9, + 0x99, 0x9A, 0xAB, 0xCD, 0xDE, 0xFE, 0xDD, 0xCB, 0xAA, 0x99, 0x88, 0x88, + 0x99, 0xAB, 0xCD, 0xEF, 0xDC, 0xCB, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x89, + 0xAB, 0xCD, 0xFD, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x67, 0x89, 0xAB, + 0xCE, 0xEC, 0xDB, 0xA9, 0x87, 0x65, 0x55, 0x56, 0x77, 0x8A, 0xBD, 0xED, + 0xCC, 0xB9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9B, 0xCD, 0xDC, 0xCB, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xBB, 0xDD, 0xCC, 0xB9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xCD, 0xDC, 0xDB, 0x98, 0x76, 0x55, + 0x45, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xCC, 0xBA, 0x97, 0x76, 0x55, 0x55, + 0x67, 0x88, 0xAA, 0xCD, 0xDC, 0xDB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBC, 0xDD, 0xCC, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x88, 0x9A, 0xAB, + 0xCD, 0xDE, 0xED, 0xCB, 0xA9, 0x98, 0x88, 0x89, 0x9A, 0xAB, 0xCC, 0xDD, + 0xEE, 0xDC, 0xCB, 0xAA, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xEE, 0xDE, 0xFD, + 0xDD, 0xCB, 0xBA, 0xBA, 0xAB, 0xBB, 0xCC, 0xDD, 0xFD, 0xFF, 0xFE, 0xDD, + 0xDC, 0xCC, 0xCC, 0xCC, 0xDC, 0xDD, 0xFE, 0xEF, 0xFF, 0xEF, 0xEE, 0xDD, + 0xDD, 0xDD, 0xDD, 0xDF, 0xFF, 0xEF, 0xAD, 0xDD, 0xDD, 0xDE, 0xDC, 0xDD, + 0xDD, 0xDC, 0xDD, 0xDE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFD, 0xDD, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xCC, + 0xBC, 0xCC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0xAA, 0xAA, + 0xBC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0x98, 0x88, 0x89, 0xAC, + 0xDF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBA, 0x88, 0x76, 0x77, 0x89, 0xAC, 0xDF, + 0xFF, 0xFF, 0xFD, 0xCA, 0x98, 0x66, 0x55, 0x67, 0x89, 0xBC, 0xFF, 0xFF, + 0xFF, 0xFC, 0xA8, 0x76, 0x44, 0x45, 0x67, 0x8A, 0xCF, 0xFF, 0xFF, 0xFD, + 0xBA, 0x87, 0x54, 0x33, 0x45, 0x68, 0xAB, 0xDF, 0xFF, 0xFF, 0xDC, 0xA8, + 0x75, 0x43, 0x34, 0x56, 0x8A, 0xBD, 0xFF, 0xFF, 0xFF, 0xCA, 0x87, 0x65, + 0x44, 0x45, 0x78, 0xAB, 0xDF, 0xFF, 0xFF, 0xFC, 0xB9, 0x86, 0x65, 0x55, + 0x67, 0x9A, 0xCD, 0xFF, 0xFF, 0xFF, 0xDC, 0xA9, 0x87, 0x66, 0x77, 0x8A, + 0xBC, 0xDF, 0xFF, 0xFF, 0xFF, 0xDC, 0xA9, 0x88, 0x88, 0x99, 0xBC, 0xDF, + 0xFF, 0xFF, 0xFF, 0xFD, 0xCC, 0xBA, 0xAA, 0xAA, 0xBC, 0xCF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xEC, 0xCC, 0xBC, 0xCC, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFD, 0xDD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xED, 0xDD, 0xCD, 0xCC, 0xCC, 0xDD, 0xDE, 0xDE, 0xEE, 0x9E, 0xFF, + 0xED, 0xDD, 0xDC, 0xCC, 0xCD, 0xDE, 0xFE, 0xFF, 0xFF, 0xDF, 0xED, 0xCC, + 0xCB, 0xBB, 0xBB, 0xBC, 0xDD, 0xEF, 0xFF, 0xFE, 0xEE, 0xDC, 0xBA, 0xAA, + 0x9A, 0xAA, 0xBB, 0xCD, 0xDF, 0xFE, 0xDD, 0xDC, 0xBA, 0xA9, 0x98, 0x89, + 0x9A, 0xAB, 0xCD, 0xEF, 0xED, 0xDC, 0xBA, 0x99, 0x88, 0x77, 0x88, 0x99, + 0xAB, 0xCD, 0xEE, 0xCC, 0xCB, 0xA8, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBC, + 0xDE, 0xEC, 0xDB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBD, 0xED, + 0xCC, 0xBA, 0x98, 0x76, 0x54, 0x55, 0x66, 0x79, 0xAB, 0xCE, 0xDC, 0xCB, + 0xA8, 0x76, 0x54, 0x34, 0x45, 0x67, 0x8A, 0xBC, 0xED, 0xDC, 0xBA, 0x87, + 0x65, 0x54, 0x34, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xDB, 0xA9, 0x87, 0x65, + 0x44, 0x56, 0x67, 0x9A, 0xBC, 0xDD, 0xCD, 0xCA, 0x98, 0x76, 0x65, 0x56, + 0x67, 0x89, 0xAB, 0xCD, 0xDD, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88, + 0x9A, 0xBC, 0xED, 0xDE, 0xDC, 0xA9, 0x98, 0x77, 0x77, 0x89, 0x9A, 0xBC, + 0xDD, 0xDD, 0xFD, 0xCB, 0xAA, 0x99, 0x88, 0x99, 0x9A, 0xBC, 0xCD, 0xFE, + 0xEF, 0xED, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBC, 0xCD, 0xEF, 0xED, 0xFF, + 0xED, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEE, 0xFE, 0xEF, 0xFF, 0xED, + 0xDD, 0xCC, 0xCC, 0xCC, 0xDD, 0xDF, 0xFF, 0xED, 0xFF, 0xFF, 0xEE, 0xED, + 0xDD, 0xDD, 0xEE, 0xEF, 0xFF, 0xFE, 0x9E, 0xDD, 0xED, 0xDD, 0xDD, 0xDD, + 0xED, 0xDD, 0xDE, 0xEE, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0x9B, 0xDC, + 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xED, 0xBC, 0xBB, 0xAA, + 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xCD, 0xCB, 0xBB, 0xAA, 0x99, 0x88, + 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xDC, 0xAB, 0xAA, 0x99, 0x88, 0x77, 0x77, + 0x88, 0x89, 0xAA, 0xCC, 0xCA, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0xAB, 0xCB, 0xAA, 0x99, 0x87, 0x77, 0x66, 0x66, 0x67, 0x78, 0x9A, + 0xAB, 0xBA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xBB, + 0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xBA, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0xAA, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xAA, 0xA9, 0x87, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0xAA, 0x98, 0x87, 0x66, 0x66, 0x66, + 0x67, 0x78, 0x89, 0xAB, 0xBA, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x89, 0x9A, 0xBB, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x89, 0x9A, + 0xBC, 0xBB, 0xBB, 0xA9, 0x88, 0x87, 0x77, 0x78, 0x88, 0x9A, 0xAB, 0xCB, + 0xBC, 0xBB, 0xA9, 0x98, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBC, 0xCC, 0xDC, + 0xBB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDC, 0xCD, 0xDC, 0xBB, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xCC, 0xDD, 0xCC, 0xBB, 0xBB, + 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEC, 0x8D, 0xCC, 0xCB, 0xBB, 0xBA, 0xAA, + 0xBB, 0xBB, 0xBC, 0xCD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xBC, 0x9B, 0xCC, + 0xBB, 0xAA, 0xAA, 0x99, 0xAA, 0xAA, 0xBB, 0xCD, 0xDC, 0xAB, 0xBA, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0x9A, 0xBB, 0xCC, 0xCA, 0xBA, 0xA9, 0x99, 0x88, + 0x88, 0x88, 0x99, 0x9A, 0xBB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77, + 0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xA9, 0x98, 0x88, 0x77, 0x77, 0x77, 0x78, + 0x89, 0xAA, 0xBB, 0x9A, 0x99, 0x87, 0x77, 0x66, 0x66, 0x67, 0x78, 0x89, + 0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x9A, 0xBA, + 0x9A, 0x98, 0x77, 0x66, 0x65, 0x56, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99, + 0x87, 0x76, 0x66, 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x87, 0x76, 0x66, + 0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x87, 0x66, 0x66, 0x66, + 0x67, 0x78, 0x89, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x67, 0x77, + 0x89, 0x9A, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x87, 0x77, 0x78, 0x88, 0x99, 0xAA, 0xBB, + 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x99, 0xAA, 0xBB, 0xBB, 0xCB, + 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xBA, + 0xAA, 0xA9, 0x9A, 0xAA, 0xAB, 0xBB, 0xCC, 0xBC, 0xDC, 0xCC, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBC, 0xCC, 0xDC, 0x9C, 0xCB, 0xBB, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBA, 0xAA, 0xAA, 0x99, 0x9A, 0xAA, 0xAB, 0xBB, 0xCC, 0x8B, 0xCC, + 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDC, 0xBC, 0xBB, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xCD, 0xCB, 0xBB, 0xAA, 0x99, 0x88, + 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xCC, 0xAB, 0xAA, 0x99, 0x88, 0x87, 0x77, + 0x88, 0x89, 0x9A, 0xBC, 0xBA, 0xAA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0xAB, 0xBB, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x67, 0x78, 0x9A, + 0xAB, 0xBA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xBA, + 0x9A, 0x98, 0x77, 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xAA, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xA9, 0xA9, 0x87, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0xAA, 0x98, 0x87, 0x66, 0x66, 0x66, + 0x67, 0x78, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x67, 0x77, + 0x89, 0xAA, 0xBA, 0xAB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x78, 0x89, 0x9A, + 0xAB, 0xBB, 0xBA, 0xA9, 0x88, 0x87, 0x77, 0x88, 0x89, 0x9A, 0xAB, 0xBB, + 0xBC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBC, 0xBB, 0xCC, + 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCB, 0xCD, 0xCC, 0xBB, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xCD, 0xDD, 0xCC, 0xCB, 0xBB, + 0xBA, 0xBB, 0xBB, 0xBC, 0xCD, 0xDC, 0x9C, 0xCB, 0xBB, 0xBA, 0xAA, 0xAA, + 0xAA, 0xAB, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xDC, 0xCC, 0xCC, 0xBB, 0xBB, 0xCC, 0xCC, 0xDD, 0xDD, 0x8D, 0xEE, + 0xDD, 0xCC, 0xCC, 0xCB, 0xCC, 0xDD, 0xEF, 0xEE, 0xFE, 0xDE, 0xDC, 0xCC, + 0xBB, 0xAB, 0xBB, 0xBB, 0xCC, 0xDD, 0xFF, 0xED, 0xDD, 0xCB, 0xBA, 0xA9, + 0x99, 0xAA, 0xAB, 0xBC, 0xDD, 0xFD, 0xCD, 0xCB, 0xAA, 0x99, 0x88, 0x88, + 0x99, 0xAA, 0xBC, 0xDE, 0xDC, 0xCB, 0xAA, 0x98, 0x87, 0x77, 0x78, 0x89, + 0xAA, 0xCD, 0xDD, 0xCC, 0xBA, 0x98, 0x87, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCE, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x8A, 0xBC, 0xDD, + 0xCC, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x9B, 0xBC, 0xDB, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x45, 0x67, 0x89, 0xAC, 0xCC, 0xCB, 0xB9, 0x87, + 0x65, 0x54, 0x34, 0x56, 0x78, 0x9A, 0xCC, 0xCC, 0xCA, 0x98, 0x76, 0x55, + 0x54, 0x56, 0x67, 0x89, 0xAB, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x56, + 0x67, 0x89, 0x9A, 0xCC, 0xCC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBC, 0xDC, 0xCC, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x88, 0x9A, 0xBB, + 0xCD, 0xDD, 0xEC, 0xCB, 0xA9, 0x98, 0x88, 0x89, 0x9A, 0xAB, 0xCC, 0xDD, + 0xDD, 0xEC, 0xBB, 0xAA, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDD, 0xDD, 0xFE, + 0xDC, 0xCB, 0xBB, 0xAA, 0xAB, 0xBB, 0xBC, 0xDD, 0xED, 0xEF, 0xEE, 0xDD, + 0xCC, 0xCB, 0xBB, 0xCC, 0xCC, 0xDD, 0xDE, 0xEE, 0xFF, 0xEE, 0xDE, 0xDD, + 0xCD, 0xDC, 0xDD, 0xED, 0xEF, 0xEE, 0x9E, 0xEE, 0xDD, 0xDD, 0xDC, 0xCC, + 0xCC, 0xCD, 0xDD, 0xDE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xAF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xED, 0xDD, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDC, 0xCB, + 0xBB, 0xCC, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, 0xDC, 0xBA, 0xAA, 0xAA, + 0xBB, 0xCD, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0x98, 0x88, 0x89, 0xAB, + 0xCD, 0xFF, 0xFF, 0xFF, 0xEC, 0xBA, 0x98, 0x76, 0x67, 0x89, 0xAB, 0xDD, + 0xFF, 0xFF, 0xED, 0xCA, 0x98, 0x66, 0x55, 0x66, 0x89, 0xBC, 0xDF, 0xFF, + 0xFF, 0xDB, 0xA8, 0x76, 0x54, 0x44, 0x67, 0x8A, 0xBC, 0xFF, 0xFF, 0xFD, + 0xBA, 0x87, 0x54, 0x33, 0x45, 0x68, 0xAB, 0xEF, 0xFF, 0xFF, 0xDB, 0xA8, + 0x65, 0x43, 0x34, 0x56, 0x8A, 0xBD, 0xEF, 0xFE, 0xFD, 0xCA, 0x87, 0x64, + 0x44, 0x56, 0x78, 0xAB, 0xDE, 0xFF, 0xEF, 0xDC, 0xB9, 0x86, 0x65, 0x56, + 0x67, 0x9A, 0xCD, 0xFF, 0xFE, 0xFF, 0xDC, 0xA9, 0x87, 0x66, 0x77, 0x8A, + 0xBC, 0xDF, 0xFF, 0xEF, 0xFD, 0xCB, 0xA9, 0x88, 0x88, 0x9A, 0xBB, 0xDE, + 0xFF, 0xFF, 0xFF, 0xED, 0xCB, 0xAA, 0xA9, 0xAA, 0xBB, 0xCD, 0xFF, 0xFF, + 0xFF, 0xFF, 0xDD, 0xDC, 0xCB, 0xBB, 0xBC, 0xCE, 0xFF, 0xFF, 0xFD, 0xFF, + 0xFF, 0xFF, 0xDD, 0xDD, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xDD, 0xDD, 0xDF, 0xEE, 0xEF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xEF, 0xED, 0xED, 0xDD, 0xCC, 0xCD, 0xDD, 0xDD, 0xED, 0xDE, 0x9E, 0xFF, + 0xFE, 0xDD, 0xDC, 0xCC, 0xDD, 0xDE, 0xEE, 0xFE, 0xFE, 0xFE, 0xED, 0xDD, + 0xCC, 0xBB, 0xBB, 0xCC, 0xDD, 0xEE, 0xEF, 0xED, 0xFE, 0xDC, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBC, 0xCD, 0xEF, 0xFF, 0xDE, 0xDC, 0xBA, 0xA9, 0x99, 0x99, + 0x9A, 0xBC, 0xCD, 0xEF, 0xEC, 0xDC, 0xBB, 0xA9, 0x88, 0x77, 0x88, 0x9A, + 0xBC, 0xCE, 0xEE, 0xDD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x78, 0x9A, 0xBC, + 0xEF, 0xDD, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xCD, 0xEE, + 0xDC, 0xBA, 0x98, 0x66, 0x54, 0x45, 0x56, 0x89, 0xAC, 0xCD, 0xDC, 0xCB, + 0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xED, 0xCC, 0xBA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x79, 0xAB, 0xDD, 0xDD, 0xDB, 0xA9, 0x86, 0x55, + 0x44, 0x55, 0x67, 0x9A, 0xBD, 0xDD, 0xDE, 0xCB, 0x98, 0x76, 0x55, 0x55, + 0x67, 0x89, 0xAB, 0xDE, 0xED, 0xDC, 0xBA, 0x98, 0x76, 0x66, 0x67, 0x89, + 0xAB, 0xCD, 0xEE, 0xDE, 0xDC, 0xAA, 0x98, 0x87, 0x78, 0x89, 0x9A, 0xBC, + 0xDE, 0xED, 0xED, 0xDB, 0xBA, 0x99, 0x99, 0x99, 0x9A, 0xBC, 0xDD, 0xEF, + 0xEE, 0xED, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xEF, 0xFD, 0xEF, + 0xDD, 0xDC, 0xCB, 0xBB, 0xBB, 0xCC, 0xDE, 0xEE, 0xFF, 0xDF, 0xFF, 0xED, + 0xDD, 0xCC, 0xDD, 0xCD, 0xDE, 0xEF, 0xFF, 0xFD, 0xFF, 0xFF, 0xEE, 0xEE, + 0xDF, 0xDE, 0xEE, 0xEF, 0xFF, 0xFF, 0x9D, 0xED, 0xDE, 0xDE, 0xDE, 0xED, + 0xEE, 0xEE, 0xFF, 0xEF, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xDE, 0xED, 0xDC, 0xCC, 0xBC, 0xCC, 0xCC, 0xDD, 0xDD, 0xDD, 0xAE, 0xFE, + 0xDD, 0xCC, 0xCB, 0xBB, 0xCC, 0xCC, 0xDE, 0xEF, 0xFE, 0xDE, 0xDC, 0xCB, + 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xEF, 0xED, 0xDC, 0xCB, 0xAA, 0x99, + 0x99, 0x99, 0xAB, 0xBC, 0xDE, 0xEE, 0xCD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0xAA, 0xBC, 0xDE, 0xEC, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x89, + 0xAA, 0xCC, 0xED, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xDC, 0xBA, 0x98, 0x87, 0x65, 0x55, 0x56, 0x77, 0x89, 0xBC, 0xDD, + 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xDB, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCC, 0xBA, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xCC, 0xBA, 0x87, 0x76, 0x55, 0x55, + 0x67, 0x78, 0x9A, 0xBD, 0xDC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBC, 0xDD, 0xDD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x88, 0x99, 0xAB, + 0xCD, 0xDD, 0xDC, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xDE, + 0xDE, 0xDC, 0xBB, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xEE, 0xEE, + 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFE, 0xDF, 0xED, 0xDD, + 0xCC, 0xCB, 0xBB, 0xBC, 0xCC, 0xDE, 0xEF, 0xED, 0xFF, 0xEE, 0xED, 0xDD, + 0xCD, 0xCD, 0xDD, 0xEE, 0xFF, 0xFF, 0xAE, 0xEE, 0xDD, 0xDD, 0xDD, 0xDD, + 0xDD, 0xDE, 0xEE, 0xEF, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xCF, 0xED, 0xDD, 0xDC, 0xDC, 0xDC, 0xCC, 0xCD, 0xDD, 0xDD, 0x8E, 0xFE, + 0xEE, 0xDD, 0xDC, 0xCC, 0xCD, 0xDD, 0xEE, 0xEE, 0xFE, 0xEF, 0xEE, 0xDC, + 0xCC, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xEF, 0xDE, 0xFE, 0xDC, 0xBB, 0xAA, + 0xAA, 0xAB, 0xBC, 0xCD, 0xDD, 0xED, 0xDE, 0xDC, 0xBB, 0xA9, 0x99, 0x99, + 0x9A, 0xBB, 0xCD, 0xDF, 0xDD, 0xEC, 0xBA, 0x99, 0x88, 0x77, 0x88, 0x9A, + 0xBB, 0xDD, 0xFD, 0xDD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x78, 0x9A, 0xBC, + 0xDD, 0xEC, 0xDC, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xEC, + 0xCC, 0xBA, 0x98, 0x75, 0x54, 0x45, 0x56, 0x89, 0xAB, 0xCE, 0xDC, 0xCB, + 0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x79, 0xAB, 0xCD, 0xDC, 0xDC, 0xA9, 0x86, 0x55, + 0x44, 0x55, 0x78, 0x9A, 0xBC, 0xDD, 0xDD, 0xCA, 0x98, 0x76, 0x55, 0x56, + 0x67, 0x89, 0xAC, 0xDD, 0xDD, 0xDC, 0xBA, 0x98, 0x76, 0x66, 0x77, 0x89, + 0xAB, 0xBD, 0xED, 0xCD, 0xDC, 0xB9, 0x98, 0x87, 0x78, 0x89, 0x9A, 0xBC, + 0xDE, 0xED, 0xDE, 0xCB, 0xBA, 0x99, 0x98, 0x99, 0xAB, 0xBB, 0xCD, 0xEE, + 0xDE, 0xED, 0xDC, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xEE, 0xDD, 0xEE, + 0xDC, 0xDC, 0xBC, 0xBC, 0xBB, 0xCC, 0xCD, 0xDD, 0xFD, 0xDF, 0xEE, 0xDE, + 0xDC, 0xCD, 0xCD, 0xDD, 0xDD, 0xDE, 0xEE, 0xED, 0xEF, 0xEF, 0xFF, 0xEE, + 0xED, 0xDE, 0xED, 0xDD, 0xFF, 0xFD, 0x9D, 0xDD, 0xDE, 0xCD, 0xDC, 0xDD, + 0xDD, 0xED, 0xDE, 0xEF, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFD, 0xDF, 0xDD, 0x8F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDC, + 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCC, 0xBB, 0xBB, + 0xCC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xBB, 0xA9, 0x99, 0x9A, 0xBC, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0x98, 0x87, 0x78, 0x8A, 0xBC, 0xFF, + 0xFF, 0xFF, 0xFF, 0xCB, 0xA8, 0x76, 0x55, 0x67, 0x9A, 0xCD, 0xFF, 0xFF, + 0xFF, 0xFD, 0xB9, 0x76, 0x54, 0x45, 0x68, 0x9B, 0xCF, 0xFF, 0xFF, 0xFF, + 0xCB, 0x97, 0x54, 0x23, 0x45, 0x79, 0xBC, 0xFF, 0xFF, 0xFF, 0xFC, 0xA9, + 0x75, 0x43, 0x24, 0x57, 0x9B, 0xCF, 0xFF, 0xFF, 0xFF, 0xDB, 0x98, 0x65, + 0x44, 0x56, 0x79, 0xBC, 0xFF, 0xFF, 0xFF, 0xFD, 0xCA, 0x87, 0x65, 0x56, + 0x78, 0xAB, 0xCF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0x88, 0x77, 0x78, 0x9A, + 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBA, 0x99, 0x99, 0xAA, 0xCD, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBB, 0xBA, 0xBB, 0xCD, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xDD, 0xFC, 0xCC, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xDD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xDD, 0x9E, 0xEF, + 0xDD, 0xCC, 0xCB, 0xCC, 0xCC, 0xCD, 0xDE, 0xFF, 0xFE, 0xDE, 0xED, 0xCC, + 0xCB, 0xBA, 0xBA, 0xBB, 0xCD, 0xCD, 0xEE, 0xEE, 0xED, 0xCC, 0xBA, 0xA9, + 0x99, 0x9A, 0xBB, 0xBD, 0xDD, 0xFE, 0xDE, 0xCB, 0xBA, 0x99, 0x88, 0x88, + 0x99, 0xAB, 0xBC, 0xDE, 0xDC, 0xCC, 0xBA, 0x98, 0x87, 0x77, 0x78, 0x89, + 0xAB, 0xCD, 0xEE, 0xCD, 0xBA, 0x98, 0x87, 0x66, 0x66, 0x78, 0x89, 0xBB, + 0xCE, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD, + 0xCC, 0xBA, 0x87, 0x66, 0x54, 0x45, 0x56, 0x78, 0x9B, 0xCD, 0xCB, 0xCB, + 0x98, 0x76, 0x55, 0x44, 0x45, 0x67, 0x89, 0xBC, 0xCD, 0xCC, 0xB9, 0x87, + 0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xCB, 0xA8, 0x76, 0x65, + 0x44, 0x56, 0x67, 0x89, 0xAC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x56, + 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCC, 0xA9, 0x88, 0x76, 0x66, 0x67, 0x88, + 0x9A, 0xBC, 0xDD, 0xCD, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x88, 0x9A, 0xBC, + 0xDD, 0xDC, 0xEC, 0xBB, 0xA9, 0x98, 0x88, 0x99, 0x99, 0xBB, 0xCD, 0xDD, + 0xCE, 0xDC, 0xCB, 0xAA, 0xA9, 0x99, 0xAA, 0xBB, 0xBD, 0xDF, 0xDD, 0xEE, + 0xDD, 0xCB, 0xBB, 0xBA, 0xAB, 0xBC, 0xCD, 0xDE, 0xFE, 0xDE, 0xEE, 0xDD, + 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xEF, 0xED, 0xFF, 0xEE, 0xDD, 0xDD, + 0xDC, 0xDE, 0xDD, 0xEE, 0xEF, 0xFD, 0x8D, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, + 0xDC, 0xDD, 0xDE, 0xDE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0x8C, 0xDC, + 0xCB, 0xBB, 0xBA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDC, 0xBC, 0xCB, 0xBA, + 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDC, 0xCB, 0xCB, 0xBA, 0xA9, 0x98, + 0x88, 0x99, 0x99, 0xAB, 0xBC, 0xDC, 0xBC, 0xBA, 0x99, 0x88, 0x88, 0x88, + 0x88, 0x99, 0xAB, 0xCC, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x99, 0xAB, 0xCB, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x88, 0x9A, + 0xBC, 0xBA, 0xA9, 0x98, 0x77, 0x66, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xBB, + 0xAA, 0x99, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xBA, 0xA9, + 0x87, 0x76, 0x55, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0x98, 0x77, + 0x65, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xBA, 0xA9, 0x88, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0xA9, 0x87, 0x66, 0x65, 0x56, + 0x66, 0x78, 0x99, 0xAB, 0xBA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x89, 0xAB, 0xBB, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A, + 0xBC, 0xBB, 0xBB, 0xA9, 0x98, 0x88, 0x77, 0x88, 0x89, 0x9A, 0xAB, 0xCB, + 0xBC, 0xBB, 0xA9, 0x99, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCD, 0xCC, 0xCC, + 0xBA, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xEC, 0xCD, 0xDC, 0xBB, + 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCC, 0xDE, 0xCC, 0xED, 0xCC, 0xCC, 0xCB, + 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xDD, 0x8C, 0xCB, 0xCB, 0xBB, 0xBB, 0xBB, + 0xBB, 0xCB, 0xCC, 0xCC, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0x9B, 0xCB, + 0xBA, 0xAA, 0xA9, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xDC, 0xAB, 0xBA, 0xA9, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xBA, 0xBA, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x98, 0x88, 0x77, 0x77, + 0x88, 0x89, 0xAA, 0xBB, 0xA9, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0xAA, 0xBA, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x99, + 0xAA, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA, + 0x99, 0x98, 0x77, 0x66, 0x65, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0x99, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x87, 0x76, 0x66, + 0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x67, 0x78, 0x89, 0xAA, 0xA9, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x67, 0x77, + 0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x87, 0x77, 0x78, 0x88, 0x99, 0xAA, 0xBA, + 0xAB, 0xBA, 0x99, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xBB, 0xBB, + 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xBA, + 0xAA, 0xA9, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xBB, 0xCC, 0xCB, 0xBB, 0xBA, + 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDC, 0x9B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0x8B, 0xDC, + 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCC, 0xDB, 0xBC, 0xCB, 0xAA, + 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCD, 0xBB, 0xBB, 0xAA, 0x99, 0x98, + 0x88, 0x99, 0x9A, 0xAB, 0xBB, 0xDB, 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88, + 0x88, 0x99, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x88, 0x9A, + 0xBB, 0xBA, 0xA9, 0x98, 0x77, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xBA, + 0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xAA, 0xA9, + 0x88, 0x76, 0x55, 0x55, 0x55, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x98, 0x87, + 0x65, 0x54, 0x55, 0x56, 0x78, 0x89, 0xAB, 0xAA, 0xAA, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAB, 0xA9, 0x87, 0x76, 0x65, 0x56, + 0x67, 0x78, 0x99, 0xAB, 0xAA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x89, 0xAA, 0xBA, 0xAB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, 0x9A, + 0xBB, 0xBA, 0xBB, 0xAA, 0x98, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, + 0xBC, 0xBB, 0xAA, 0x99, 0x98, 0x88, 0x99, 0x9A, 0xAB, 0xCC, 0xBB, 0xCC, + 0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xCB, 0xBC, 0xCC, 0xBB, + 0xAB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xBC, 0xDC, 0xCC, 0xCB, 0xBB, + 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDC, 0x8B, 0xBB, 0xBB, 0xAA, 0xAA, 0xAA, + 0xAA, 0xBB, 0xBC, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xBE, 0xDD, 0xCC, 0xCC, 0xCC, 0xBC, 0xCC, 0xCC, 0xCC, 0xDC, 0x8E, 0xEE, + 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEF, 0xFD, 0xEE, 0xED, 0xCC, + 0xBB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEE, 0xDD, 0xED, 0xCC, 0xBA, 0xAA, + 0xA9, 0xAA, 0xAB, 0xCC, 0xDE, 0xFD, 0xCD, 0xDC, 0xBA, 0x99, 0x98, 0x89, + 0x9A, 0xAB, 0xCC, 0xDE, 0xDC, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x78, 0x99, + 0xAB, 0xCD, 0xED, 0xCD, 0xBB, 0x99, 0x87, 0x66, 0x66, 0x78, 0x8A, 0xBB, + 0xCD, 0xDD, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD, + 0xBC, 0xBA, 0x97, 0x66, 0x54, 0x45, 0x66, 0x89, 0xAB, 0xCD, 0xCC, 0xCB, + 0x98, 0x76, 0x54, 0x44, 0x45, 0x67, 0x89, 0xBC, 0xDD, 0xBC, 0xBA, 0x87, + 0x65, 0x44, 0x44, 0x56, 0x78, 0x9A, 0xCD, 0xCC, 0xCB, 0xA9, 0x86, 0x65, + 0x44, 0x56, 0x67, 0x9A, 0xAC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x56, + 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCC, 0xA9, 0x98, 0x76, 0x66, 0x67, 0x88, + 0x9A, 0xBC, 0xDD, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC, + 0xDD, 0xDC, 0xDD, 0xCB, 0xA9, 0x99, 0x88, 0x99, 0x9A, 0xAB, 0xCD, 0xDD, + 0xCD, 0xDD, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBC, 0xCD, 0xEF, 0xDD, 0xEE, + 0xDC, 0xCB, 0xBB, 0xBA, 0xBB, 0xBC, 0xCC, 0xDE, 0xEE, 0xEE, 0xFE, 0xDD, + 0xCC, 0xBC, 0xCC, 0xCC, 0xDD, 0xDE, 0xFF, 0xED, 0xFE, 0xEE, 0xDD, 0xDD, + 0xDD, 0xDD, 0xDD, 0xEE, 0xEF, 0xFD, 0x9D, 0xED, 0xCC, 0xDC, 0xCC, 0xDC, + 0xDD, 0xDD, 0xEE, 0xED, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xEE, 0xFE, 0x9F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFD, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xDC, + 0xDC, 0xDD, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDC, 0xBB, 0xBB, + 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDB, 0xAA, 0x9A, 0xAB, 0xCC, + 0xDF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x88, 0x88, 0x9A, 0xBD, 0xEF, + 0xFF, 0xFF, 0xFF, 0xDC, 0xA9, 0x87, 0x66, 0x78, 0x9B, 0xCD, 0xFF, 0xFF, + 0xFF, 0xFD, 0xBA, 0x86, 0x54, 0x45, 0x78, 0xAC, 0xDE, 0xFF, 0xFF, 0xFF, + 0xDB, 0x98, 0x64, 0x22, 0x46, 0x89, 0xBC, 0xFF, 0xFF, 0xFF, 0xFD, 0xBA, + 0x86, 0x42, 0x24, 0x68, 0x9B, 0xDE, 0xFF, 0xFD, 0xFF, 0xCC, 0xA8, 0x75, + 0x44, 0x56, 0x8A, 0xBD, 0xFF, 0xFF, 0xFF, 0xED, 0xCB, 0x98, 0x76, 0x66, + 0x79, 0xAC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFC, 0xCA, 0x98, 0x88, 0x89, 0xAB, + 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBB, 0xAA, 0x9A, 0xAB, 0xCD, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFE, 0xDD, 0xCB, 0xBB, 0xBC, 0xCD, 0xEF, 0xFF, 0xFF, + 0xEF, 0xFE, 0xFE, 0xDD, 0xDC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, + 0xFF, 0xFF, 0xEF, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, + 0xEF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xDD, 0xDD, 0xDE, 0xDE, 0xDE, + 0xFF, 0xFF, 0xFF, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xCC, 0xDD, 0x9E, 0xEE, + 0xEE, 0xED, 0xDC, 0xCD, 0xCD, 0xDD, 0xDD, 0xEF, 0xED, 0xEE, 0xDD, 0xCC, + 0xCC, 0xBB, 0xCB, 0xCC, 0xDD, 0xDE, 0xEF, 0xDD, 0xEE, 0xCC, 0xBB, 0xAA, + 0xAA, 0xAB, 0xBC, 0xCC, 0xDE, 0xEE, 0xDE, 0xDC, 0xBA, 0xA9, 0x99, 0x99, + 0xAA, 0xBC, 0xCC, 0xDE, 0xDC, 0xDC, 0xBA, 0x99, 0x88, 0x78, 0x88, 0x9A, + 0xBC, 0xCD, 0xDD, 0xCD, 0xCB, 0xA9, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBC, + 0xDE, 0xDC, 0xDB, 0xA9, 0x87, 0x65, 0x55, 0x56, 0x78, 0xAB, 0xCD, 0xED, + 0xCD, 0xBA, 0x98, 0x65, 0x54, 0x45, 0x57, 0x89, 0xBB, 0xCD, 0xDC, 0xDB, + 0xA9, 0x76, 0x54, 0x44, 0x45, 0x68, 0x9A, 0xBC, 0xDD, 0xDD, 0xBA, 0x98, + 0x65, 0x44, 0x44, 0x56, 0x79, 0xAB, 0xCD, 0xDC, 0xDB, 0xA9, 0x87, 0x55, + 0x44, 0x55, 0x68, 0x9A, 0xCC, 0xED, 0xCC, 0xCB, 0xA8, 0x76, 0x55, 0x55, + 0x67, 0x89, 0xAB, 0xDD, 0xDC, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x89, + 0xAB, 0xCD, 0xED, 0xCD, 0xCC, 0xBA, 0x98, 0x88, 0x78, 0x89, 0x9A, 0xCC, + 0xDE, 0xEC, 0xDC, 0xCB, 0xBA, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xDD, 0xEE, + 0xDD, 0xDD, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDE, 0xEE, 0xED, 0xED, + 0xDD, 0xDC, 0xCB, 0xBB, 0xBB, 0xBD, 0xCD, 0xFE, 0xEE, 0xCE, 0xEE, 0xDD, + 0xDD, 0xDC, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEC, 0xFE, 0xEE, 0xFE, 0xFD, + 0xDD, 0xDD, 0xEE, 0xEF, 0xEF, 0xFE, 0x8D, 0xDC, 0xDD, 0xDD, 0xCD, 0xDD, + 0xDD, 0xDD, 0xDE, 0xFE, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xDD, 0xCC, 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDD, 0xAD, 0xEE, + 0xDD, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xDE, 0xFD, 0xDE, 0xDC, 0xCB, + 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xEE, 0xDD, 0xDC, 0xCB, 0xAA, 0x99, + 0x99, 0x99, 0xAA, 0xBC, 0xCD, 0xDD, 0xCD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0xAA, 0xBC, 0xDD, 0xCC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x89, + 0x9A, 0xBC, 0xDC, 0xCC, 0xAA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xCB, 0xBA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x78, 0x89, 0xAC, 0xCC, + 0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xDC, 0xBB, 0xB9, 0x88, 0x76, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCD, 0xDC, 0xDC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCC, 0xED, + 0xCD, 0xCC, 0xBA, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDE, 0xDD, 0xDD, + 0xDC, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFE, 0xDE, 0xDD, 0xCC, + 0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xED, 0xEE, 0xED, 0xDD, 0xCC, + 0xCC, 0xCC, 0xDD, 0xDE, 0xEF, 0xFF, 0xAD, 0xDD, 0xCD, 0xCC, 0xCC, 0xCC, + 0xCD, 0xDD, 0xDE, 0xEE, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCD, 0xDD, 0xDC, 0xCC, 0xCC, 0xCB, 0xCC, 0xCC, 0xCC, 0xDC, 0x9D, 0xFE, + 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xDE, 0xED, 0xDE, 0xED, 0xCC, + 0xBB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xDD, 0xEC, 0xCB, 0xBA, 0xAA, + 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xDC, 0xCD, 0xDC, 0xBA, 0x99, 0x98, 0x99, + 0x9A, 0xAB, 0xBC, 0xDE, 0xCC, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A, + 0xAB, 0xCC, 0xDC, 0xCC, 0xBA, 0xA8, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBB, + 0xCD, 0xCC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC, + 0xCC, 0xBA, 0x98, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xCB, + 0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x79, 0xAB, 0xCD, 0xCC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x68, 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xCB, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88, + 0xAA, 0xBC, 0xDC, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x89, 0x9A, 0xBC, + 0xDE, 0xDC, 0xDC, 0xBB, 0xAA, 0x99, 0x98, 0x99, 0x9A, 0xBB, 0xCD, 0xED, + 0xCD, 0xDC, 0xCB, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xEE, 0xDC, 0xED, + 0xCC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xED, 0xDE, 0xDD, 0xDC, + 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xEF, 0xDD, 0xEE, 0xED, 0xDD, 0xDD, + 0xDC, 0xDD, 0xDD, 0xEE, 0xEF, 0xFE, 0x9D, 0xDC, 0xDC, 0xCC, 0xCC, 0xCC, + 0xCC, 0xDD, 0xDD, 0xDE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xFF, 0xFE, 0xEE, 0xDD, 0xDD, 0xDD, 0xDC, 0xDD, 0xDD, 0x8F, 0xFF, + 0xFF, 0xFF, 0xEE, 0xED, 0xDF, 0xDE, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xED, + 0xDC, 0xDD, 0xDC, 0xDD, 0xDE, 0xFF, 0xFF, 0xEE, 0xFF, 0xDD, 0xDC, 0xCB, + 0xBB, 0xBB, 0xCC, 0xDE, 0xFF, 0xFE, 0xFF, 0xED, 0xDC, 0xBA, 0xAA, 0xAA, + 0xAB, 0xCD, 0xDE, 0xFF, 0xED, 0xFE, 0xDC, 0xBA, 0x98, 0x88, 0x89, 0xAB, + 0xCD, 0xEF, 0xFF, 0xDF, 0xDC, 0xBA, 0x98, 0x76, 0x77, 0x89, 0xAB, 0xCD, + 0xFF, 0xFE, 0xED, 0xCA, 0x98, 0x66, 0x55, 0x67, 0x89, 0xBC, 0xDE, 0xFE, + 0xED, 0xDB, 0xA8, 0x76, 0x44, 0x44, 0x67, 0x8A, 0xBD, 0xDF, 0xFD, 0xFC, + 0xBA, 0x86, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xCE, 0xFE, 0xEE, 0xCB, 0xA8, + 0x75, 0x43, 0x34, 0x57, 0x89, 0xBC, 0xFF, 0xFE, 0xED, 0xBA, 0x87, 0x65, + 0x44, 0x45, 0x78, 0xAB, 0xDE, 0xFF, 0xDF, 0xDC, 0xA9, 0x87, 0x65, 0x56, + 0x68, 0x9A, 0xCD, 0xEF, 0xFE, 0xEE, 0xCB, 0xA9, 0x87, 0x76, 0x78, 0x8A, + 0xBC, 0xDF, 0xFF, 0xDE, 0xED, 0xCB, 0xA9, 0x98, 0x88, 0x9A, 0xBC, 0xDE, + 0xFF, 0xFE, 0xEE, 0xDD, 0xCB, 0xAA, 0x99, 0xAA, 0xBC, 0xCE, 0xFF, 0xFF, + 0xEF, 0xFF, 0xDD, 0xCC, 0xBB, 0xBB, 0xCC, 0xDE, 0xEF, 0xFF, 0xFE, 0xFE, + 0xEF, 0xDD, 0xDC, 0xCD, 0xCD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, + 0xEE, 0xED, 0xDE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9E, 0xDF, 0xFF, 0xFF, 0xFD, 0xFE, + 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xED, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0x9E, 0xFF, + 0xEE, 0xDE, 0xDC, 0xCC, 0xCD, 0xDD, 0xEE, 0xEF, 0xFE, 0xFF, 0xED, 0xDC, + 0xCB, 0xBB, 0xBB, 0xCC, 0xCD, 0xEE, 0xFF, 0xDD, 0xFE, 0xCC, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCD, 0xDD, 0xEE, 0xDE, 0xDC, 0xBA, 0xA9, 0x99, 0x99, + 0x9A, 0xAB, 0xDE, 0xDE, 0xDD, 0xEC, 0xCA, 0x99, 0x88, 0x77, 0x88, 0x9A, + 0xBB, 0xCD, 0xED, 0xCD, 0xCB, 0xA9, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBC, + 0xDD, 0xDC, 0xDB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xED, + 0xCC, 0xCA, 0x98, 0x65, 0x54, 0x45, 0x66, 0x89, 0xAB, 0xDD, 0xDC, 0xCB, + 0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBD, 0xDC, 0xCC, 0xBA, 0x87, + 0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xEC, 0xCB, 0xA9, 0x86, 0x65, + 0x44, 0x55, 0x68, 0x9A, 0xBD, 0xDD, 0xCD, 0xCB, 0x98, 0x76, 0x55, 0x55, + 0x67, 0x89, 0xAC, 0xDE, 0xDC, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x89, + 0xAB, 0xCD, 0xFD, 0xCE, 0xCB, 0xBA, 0x98, 0x87, 0x77, 0x89, 0x9A, 0xBC, + 0xEE, 0xDC, 0xDD, 0xCB, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xFE, + 0xDE, 0xDD, 0xCC, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xED, 0xEE, + 0xDD, 0xCC, 0xBB, 0xBB, 0xBB, 0xCD, 0xDE, 0xEF, 0xFF, 0xDE, 0xEE, 0xDE, + 0xDD, 0xCC, 0xCD, 0xDE, 0xEE, 0xEF, 0xFF, 0xED, 0xFF, 0xFE, 0xEE, 0xDD, + 0xDD, 0xEE, 0xEE, 0xFF, 0xFF, 0xFF, 0x8D, 0xCD, 0xCD, 0xDD, 0xDC, 0xCD, + 0xED, 0xEE, 0xEE, 0xFF, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0x8B, 0xCC, + 0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDC, 0xBC, 0xCB, 0xAA, + 0xAA, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCD, 0xBB, 0xBB, 0xAA, 0x99, 0x98, + 0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xCB, 0xBB, 0xAA, 0x99, 0x88, 0x87, 0x88, + 0x89, 0x99, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x88, + 0x99, 0xAB, 0xCB, 0xAB, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x77, 0x88, 0x9A, + 0xBB, 0xBA, 0xAA, 0x98, 0x76, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xBB, + 0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xBA, 0xA9, + 0x88, 0x76, 0x55, 0x55, 0x55, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x98, 0x87, + 0x65, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xBA, 0xA9, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0xA9, 0x87, 0x76, 0x65, 0x56, + 0x66, 0x78, 0x99, 0xAB, 0xBA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAA, 0xBB, 0xAB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A, + 0xBC, 0xBA, 0xCB, 0xAA, 0x98, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, + 0xBC, 0xBB, 0xAA, 0x99, 0x98, 0x88, 0x89, 0x9A, 0xAB, 0xCC, 0xCB, 0xCC, + 0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDC, 0xBC, 0xCC, 0xBB, + 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xCC, 0xDD, 0xCC, 0xCB, 0xBB, + 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xED, 0x8C, 0xBB, 0xBB, 0xBB, 0xAB, 0xAB, + 0xBB, 0xBC, 0xCC, 0xCD, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0x8B, 0xCC, + 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xCB, 0xBB, 0xBA, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBA, 0xBA, 0xA9, 0x99, 0x88, + 0x88, 0x89, 0x99, 0xAA, 0xBB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x88, + 0x88, 0x99, 0xAA, 0xBB, 0xAA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, + 0x99, 0xAA, 0xBA, 0x9A, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x99, + 0xAB, 0xA9, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x89, 0x9A, 0xBA, + 0x9A, 0x98, 0x77, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xA9, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x88, 0x9A, 0xAA, 0x9A, 0x98, 0x87, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x88, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x99, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x78, 0x89, 0xAB, 0xA9, 0xA9, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0x9A, 0xBA, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xAB, 0xAA, 0xBA, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xBB, + 0xAB, 0xBA, 0xA9, 0x99, 0x88, 0x88, 0x89, 0x99, 0xAA, 0xBC, 0xBA, 0xCB, + 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xBB, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xBB, 0xDC, 0xCB, 0xBB, 0xBA, + 0xAA, 0xBB, 0xBB, 0xBC, 0xCD, 0xDC, 0x9B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAB, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0x8B, 0xCC, + 0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDB, 0xBC, 0xBB, 0xAA, + 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0xCD, 0xBB, 0xCB, 0xAA, 0x99, 0x98, + 0x88, 0x99, 0x99, 0xAB, 0xBC, 0xCB, 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, + 0x88, 0x9A, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xAB, 0xBB, 0xAB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x9A, + 0xBB, 0xBA, 0xAA, 0x98, 0x76, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xBB, + 0xAA, 0xA8, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xAA, 0xA9, + 0x88, 0x76, 0x55, 0x55, 0x55, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x98, 0x87, + 0x65, 0x55, 0x55, 0x56, 0x78, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x87, 0x76, 0x65, 0x56, + 0x66, 0x78, 0x99, 0xAB, 0xAA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAA, 0xBB, 0xAB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A, + 0xBB, 0xBA, 0xBB, 0xA9, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xBB, 0xCB, + 0xBC, 0xBB, 0xAA, 0x99, 0x98, 0x88, 0x99, 0x9A, 0xAB, 0xCD, 0xBB, 0xCC, + 0xBB, 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xAB, 0xBC, 0xDC, 0xBC, 0xCC, 0xBB, + 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xCB, 0xDD, 0xCC, 0xCB, 0xBB, + 0xBB, 0xBB, 0xCC, 0xCC, 0xDD, 0xDC, 0x8B, 0xBB, 0xBB, 0xBB, 0xAA, 0xAA, + 0xAB, 0xBB, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xEC, 0xCC, 0xCB, 0xCB, 0xBB, 0xCC, 0xCC, 0xCC, 0xCD, 0x8D, 0xED, + 0xED, 0xDC, 0xCB, 0xBB, 0xBC, 0xCD, 0xCD, 0xEF, 0xFD, 0xDE, 0xED, 0xCB, + 0xBB, 0xAA, 0xAA, 0xBB, 0xCC, 0xCE, 0xEE, 0xDD, 0xDD, 0xCB, 0xBA, 0x99, + 0x99, 0x9A, 0xAA, 0xBC, 0xDE, 0xED, 0xDD, 0xCB, 0xBA, 0x99, 0x88, 0x88, + 0x99, 0xAA, 0xBC, 0xDD, 0xDC, 0xDB, 0xAA, 0x98, 0x87, 0x77, 0x78, 0x89, + 0xAB, 0xBC, 0xDC, 0xCD, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x78, 0x89, 0xAB, + 0xCD, 0xCB, 0xCA, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x99, 0xBC, 0xDC, + 0xBB, 0xA9, 0x87, 0x66, 0x54, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, + 0x98, 0x76, 0x54, 0x44, 0x55, 0x67, 0x89, 0xAC, 0xCC, 0xCC, 0xA9, 0x87, + 0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xDB, 0xCB, 0x98, 0x76, 0x65, + 0x54, 0x55, 0x67, 0x89, 0xAC, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x88, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBC, 0xDC, 0xCC, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x88, 0x9A, 0xBC, + 0xDD, 0xDC, 0xDC, 0xBA, 0xA9, 0x98, 0x88, 0x89, 0x9A, 0xAB, 0xCD, 0xDD, + 0xCD, 0xDC, 0xBB, 0xAA, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xDE, 0xEC, 0xED, + 0xDC, 0xCB, 0xBA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xED, 0xDE, 0xED, 0xDC, + 0xCC, 0xBC, 0xBC, 0xCC, 0xDD, 0xDE, 0xFF, 0xED, 0xFF, 0xDD, 0xDD, 0xDD, + 0xCD, 0xDD, 0xDD, 0xEE, 0xEF, 0xFE, 0x9D, 0xDD, 0xDD, 0xDD, 0xCC, 0xCC, + 0xCC, 0xDD, 0xEE, 0xEE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xFE, 0xED, 0xDE, 0xDD, 0xDD, 0xDD, 0xDD, 0xCC, 0xDD, 0x9F, 0xFF, + 0xFF, 0xEE, 0xDE, 0xDD, 0xDD, 0xDE, 0xEE, 0xEF, 0xFD, 0xEF, 0xEF, 0xEE, + 0xDD, 0xCC, 0xCC, 0xCD, 0xCD, 0xEE, 0xFF, 0xDF, 0xFF, 0xED, 0xCC, 0xCB, + 0xBB, 0xBB, 0xCC, 0xDD, 0xDE, 0xFE, 0xDE, 0xDD, 0xCC, 0xAA, 0xAA, 0xAA, + 0xAB, 0xBC, 0xDD, 0xFF, 0xEE, 0xFD, 0xCB, 0xBA, 0x98, 0x88, 0x89, 0xAA, + 0xBC, 0xDF, 0xFF, 0xEE, 0xDC, 0xB9, 0x87, 0x77, 0x77, 0x89, 0xAB, 0xCD, + 0xEF, 0xEE, 0xEC, 0xBA, 0x97, 0x66, 0x55, 0x67, 0x89, 0xAB, 0xCE, 0xFE, + 0xDE, 0xCB, 0xA8, 0x76, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xDE, 0xED, 0xEC, + 0xB9, 0x87, 0x54, 0x33, 0x45, 0x78, 0x9B, 0xCE, 0xEE, 0xDD, 0xCB, 0x98, + 0x75, 0x43, 0x34, 0x56, 0x8A, 0xBC, 0xDF, 0xED, 0xEC, 0xCA, 0x87, 0x65, + 0x44, 0x45, 0x78, 0xAB, 0xDE, 0xEE, 0xDD, 0xDB, 0xA9, 0x87, 0x65, 0x55, + 0x67, 0x9A, 0xCD, 0xFF, 0xED, 0xDE, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x8A, + 0xBC, 0xEF, 0xFF, 0xDF, 0xDC, 0xBA, 0xA9, 0x88, 0x88, 0x9A, 0xBB, 0xCE, + 0xEF, 0xFD, 0xED, 0xDC, 0xCB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xEF, 0xFF, + 0xDF, 0xED, 0xDC, 0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEF, 0xFF, 0xFD, 0xEE, + 0xDD, 0xDD, 0xCC, 0xCD, 0xCD, 0xDD, 0xFF, 0xFF, 0xFF, 0xDF, 0xEF, 0xEF, + 0xDD, 0xEE, 0xDE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFE, 0xFE, + 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8C, 0xDD, 0xDE, 0xDE, 0xED, 0xDD, + 0xEE, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xCD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0x9D, 0xFE, + 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDE, 0xEF, 0xED, 0xDE, 0xDD, 0xCC, + 0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xDD, 0xEF, 0xDD, 0xDD, 0xCC, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBC, 0xDD, 0xED, 0xCD, 0xDB, 0xBA, 0x99, 0x98, 0x89, + 0x9A, 0xAB, 0xCC, 0xEE, 0xDC, 0xDC, 0xBA, 0x98, 0x88, 0x77, 0x88, 0x99, + 0xAB, 0xCD, 0xDD, 0xCC, 0xBA, 0x98, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xAB, + 0xDD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBD, 0xDD, + 0xCC, 0xBA, 0x98, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCE, 0xDB, 0xCB, + 0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xDC, 0xCC, 0xBA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x79, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAB, 0xCE, 0xDC, 0xCC, 0xAA, 0x98, 0x77, 0x66, 0x67, 0x88, + 0x9B, 0xBD, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC, + 0xEE, 0xDC, 0xDD, 0xCB, 0xAA, 0x99, 0x98, 0x99, 0xAA, 0xBC, 0xDE, 0xEE, + 0xCD, 0xDC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xFF, 0xEC, 0xDD, + 0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xFE, 0xCF, 0xEE, 0xDD, + 0xCC, 0xCC, 0xCC, 0xCD, 0xDE, 0xEF, 0xFF, 0xED, 0xEE, 0xED, 0xDD, 0xDD, + 0xDD, 0xDD, 0xEE, 0xFE, 0xFF, 0xFE, 0x8C, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, + 0xDD, 0xEE, 0xEE, 0xEF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xDE, 0xDD, 0xCC, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xCC, 0xCC, 0x9E, 0xEE, + 0xDD, 0xCC, 0xCB, 0xBB, 0xBC, 0xCC, 0xDD, 0xDE, 0xED, 0xDE, 0xDC, 0xCB, + 0xBB, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDE, 0xDD, 0xDD, 0xCB, 0xAA, 0xA9, + 0x99, 0x9A, 0xAA, 0xBC, 0xCD, 0xED, 0xCD, 0xCB, 0xAA, 0x98, 0x88, 0x88, + 0x99, 0xAA, 0xBC, 0xDD, 0xDC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x78, 0x89, + 0xAB, 0xBC, 0xDC, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x78, 0x89, 0xAB, + 0xCC, 0xCC, 0xCB, 0x99, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC, + 0xCB, 0xA9, 0x87, 0x65, 0x54, 0x55, 0x67, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, + 0x98, 0x76, 0x54, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87, + 0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x87, 0x65, + 0x54, 0x55, 0x67, 0x89, 0xAC, 0xDC, 0xBC, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0x9B, 0xCD, 0xCB, 0xCB, 0xA9, 0x88, 0x77, 0x66, 0x67, 0x78, + 0x9A, 0xBC, 0xDD, 0xCC, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x99, 0xAB, + 0xCD, 0xDC, 0xCC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xDD, + 0xCD, 0xCC, 0xBB, 0xAA, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDE, 0xEC, 0xDD, + 0xCC, 0xBB, 0xBA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xEE, 0xDE, 0xDD, 0xCC, + 0xCB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xEF, 0xED, 0xEE, 0xDD, 0xDD, 0xCC, + 0xCC, 0xCD, 0xDD, 0xEE, 0xEF, 0xFE, 0xAD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, + 0xCD, 0xDD, 0xDE, 0xEF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xDD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x9D, 0xFF, + 0xED, 0xDD, 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xEE, 0xFD, 0xDE, 0xED, 0xCC, + 0xCB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEF, 0xDD, 0xDD, 0xCC, 0xBA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xEC, 0xDD, 0xDC, 0xBA, 0x99, 0x99, 0x99, + 0x9A, 0xAB, 0xCD, 0xDE, 0xDC, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A, + 0xAB, 0xCD, 0xED, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x78, 0x9A, 0xAC, + 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD, + 0xCC, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB, + 0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x79, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88, + 0x9A, 0xCC, 0xDD, 0xCD, 0xCB, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC, + 0xDD, 0xDC, 0xDD, 0xCB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xED, + 0xCD, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xEE, 0xDC, 0xED, + 0xDC, 0xCC, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFD, 0xCE, 0xED, 0xDD, + 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xFF, 0xED, 0xEE, 0xEE, 0xDE, 0xDD, + 0xDD, 0xDE, 0xDE, 0xEE, 0xFF, 0xFE, 0x9D, 0xDC, 0xCD, 0xDD, 0xCC, 0xCD, + 0xDD, 0xDD, 0xDE, 0xEE, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCF, 0xFF, 0xEE, 0xDD, 0xCD, 0xCC, 0xDC, 0xCC, 0xDD, 0xCD, 0x8F, 0xFF, + 0xFF, 0xFE, 0xED, 0xEE, 0xDD, 0xDE, 0xEE, 0xFF, 0xFD, 0xEF, 0xFF, 0xEE, + 0xDD, 0xCC, 0xCD, 0xDD, 0xDE, 0xEE, 0xEF, 0xDE, 0xFE, 0xED, 0xDC, 0xCB, + 0xBB, 0xBC, 0xCC, 0xDE, 0xEF, 0xFE, 0xEE, 0xEE, 0xCC, 0xBA, 0xAA, 0xAA, + 0xAB, 0xCC, 0xCE, 0xEF, 0xED, 0xED, 0xDC, 0xBA, 0x98, 0x88, 0x89, 0xAA, + 0xCD, 0xDE, 0xFE, 0xDE, 0xDC, 0xBA, 0x88, 0x77, 0x77, 0x89, 0xAB, 0xCD, + 0xEF, 0xEE, 0xED, 0xCB, 0x98, 0x65, 0x55, 0x67, 0x89, 0xAC, 0xDE, 0xFE, + 0xEE, 0xDB, 0xA9, 0x75, 0x44, 0x45, 0x67, 0x8A, 0xBD, 0xEF, 0xED, 0xEC, + 0xCA, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xCE, 0xFE, 0xDD, 0xCB, 0xA8, + 0x75, 0x43, 0x34, 0x57, 0x8A, 0xBD, 0xEF, 0xED, 0xDC, 0xBA, 0x97, 0x65, + 0x44, 0x45, 0x78, 0xAB, 0xDE, 0xEE, 0xDE, 0xCB, 0xA9, 0x87, 0x65, 0x55, + 0x68, 0x9A, 0xCD, 0xEF, 0xFD, 0xED, 0xCB, 0xA9, 0x87, 0x76, 0x78, 0x9A, + 0xBC, 0xEE, 0xFF, 0xDF, 0xDC, 0xBA, 0xA9, 0x88, 0x88, 0x9A, 0xBC, 0xDE, + 0xEF, 0xED, 0xFE, 0xDD, 0xCB, 0xBA, 0xAA, 0xAA, 0xBC, 0xDE, 0xDE, 0xFE, + 0xDF, 0xED, 0xDC, 0xCC, 0xBB, 0xBB, 0xCC, 0xDE, 0xEE, 0xFF, 0xED, 0xEF, + 0xED, 0xDD, 0xCD, 0xDD, 0xDD, 0xEE, 0xFF, 0xFE, 0xFE, 0xDF, 0xFE, 0xDE, + 0xEE, 0xEE, 0xDE, 0xEE, 0xFF, 0xEF, 0xFE, 0xFE, 0xFF, 0xEE, 0xEE, 0xEF, + 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9D, 0xDD, 0xDD, 0xDD, 0xDD, 0xEE, + 0xEE, 0xFE, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xDC, 0xCC, 0xBB, 0xBB, 0xCC, 0xCC, 0xBC, 0xBC, 0xCD, 0x8D, 0xEE, + 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xED, 0xDE, 0xED, 0xDC, + 0xBB, 0xBB, 0xBB, 0xBC, 0xCC, 0xCD, 0xDF, 0xDC, 0xDC, 0xCC, 0xBA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xED, 0xCD, 0xCC, 0xBA, 0x99, 0x99, 0x99, + 0x9A, 0xAB, 0xCC, 0xDE, 0xDC, 0xDC, 0xBA, 0x99, 0x88, 0x77, 0x88, 0x99, + 0xAB, 0xCD, 0xED, 0xCD, 0xCB, 0x98, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBC, + 0xCD, 0xCC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBD, 0xDC, + 0xCD, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xCB, + 0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xED, 0xCC, 0xBA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x79, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDD, 0xCD, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAC, 0xCE, 0xCC, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x89, + 0x9A, 0xBC, 0xED, 0xCC, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x89, 0x9A, 0xBC, + 0xDF, 0xDC, 0xDC, 0xCB, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xDD, 0xED, + 0xCE, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDF, 0xDC, 0xED, + 0xDD, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEE, 0xEE, 0xDE, 0xED, 0xDD, + 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xDF, 0xEF, 0xED, 0xFF, 0xEE, 0xED, 0xDC, + 0xDD, 0xDD, 0xEE, 0xEE, 0xFF, 0xFE, 0x7C, 0xCD, 0xCC, 0xCC, 0xCC, 0xCD, + 0xDD, 0xDD, 0xED, 0xEE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0x8B, 0xDC, + 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCC, 0xDC, 0xBC, 0xBB, 0xAA, + 0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xCD, 0xBB, 0xCB, 0xAA, 0x99, 0x98, + 0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xCB, 0xAB, 0xAA, 0x98, 0x88, 0x88, 0x88, + 0x88, 0x99, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x99, 0xAB, 0xCB, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x9A, + 0xBB, 0xBA, 0xA9, 0x98, 0x76, 0x66, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xBB, + 0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xA9, 0xA9, + 0x88, 0x76, 0x55, 0x55, 0x55, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0x98, 0x87, + 0x66, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0xA9, 0x87, 0x76, 0x65, 0x56, + 0x66, 0x78, 0x99, 0xAB, 0xBA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0x9A, 0xBB, 0xAB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A, + 0xBB, 0xBA, 0xBB, 0xA9, 0x98, 0x88, 0x87, 0x88, 0x89, 0x9A, 0xAB, 0xCB, + 0xAB, 0xBB, 0xAA, 0x99, 0x98, 0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xCB, 0xCB, + 0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDC, 0xBC, 0xCC, 0xBB, + 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xCB, 0xDD, 0xCC, 0xBB, 0xBB, + 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xED, 0x8B, 0xBB, 0xBB, 0xBB, 0xBA, 0xAA, + 0xBB, 0xBB, 0xCC, 0xCD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0x8B, 0xCC, + 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xCB, 0xBB, 0xBA, 0xA9, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xBA, 0xBA, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x99, 0xAA, 0xAB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x78, + 0x88, 0x99, 0xAA, 0xBB, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, + 0x99, 0xAA, 0xBA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x99, + 0xAB, 0xA9, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xBA, + 0x9A, 0x98, 0x77, 0x66, 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xA9, 0x99, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x88, 0x76, 0x66, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x78, 0x89, 0xAA, 0xA9, 0xA9, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0x9A, 0xBA, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xAB, 0xAA, 0xBA, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xBB, + 0xAB, 0xBA, 0xA9, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBA, 0xBB, + 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xCB, 0xBC, 0xBB, 0xBA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xCB, 0xCC, 0xCB, 0xBB, 0xBA, + 0xAA, 0xAB, 0xBB, 0xBC, 0xCC, 0xDC, 0x8B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAB, 0xBB, 0xCC, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0x8C, 0xDC, + 0xBB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDC, 0xBC, 0xBB, 0xAA, + 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0xCC, 0xBB, 0xBB, 0xAA, 0x99, 0x98, + 0x88, 0x89, 0x9A, 0xAB, 0xBB, 0xCB, 0xBB, 0xAA, 0x99, 0x88, 0x87, 0x88, + 0x89, 0x99, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xAB, 0xBB, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77, 0x89, 0x9A, + 0xBB, 0xBA, 0xA9, 0x98, 0x76, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xBB, + 0xAA, 0x98, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xAA, 0xA9, + 0x88, 0x76, 0x55, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0xAA, 0x98, 0x87, + 0x65, 0x55, 0x55, 0x56, 0x78, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x56, + 0x66, 0x78, 0x89, 0xAB, 0xAA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAA, 0xBB, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A, + 0xBB, 0xBA, 0xBB, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, + 0xBC, 0xBB, 0xAA, 0x99, 0x98, 0x88, 0x89, 0x9A, 0xAB, 0xCC, 0xBB, 0xCC, + 0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDB, 0xBD, 0xCC, 0xBB, + 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0xCD, 0xCB, 0xDC, 0xCC, 0xBB, 0xBB, + 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xDC, 0x8C, 0xBB, 0xBB, 0xBA, 0xAA, 0xAA, + 0xBB, 0xBB, 0xBC, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xDD, 0xCD, 0xCB, 0xCB, 0xBB, 0xCB, 0xCB, 0xCC, 0xCC, 0x7D, 0xFF, + 0xDD, 0xCC, 0xCB, 0xBB, 0xCC, 0xCD, 0xDD, 0xDE, 0xED, 0xDD, 0xDC, 0xCC, + 0xBB, 0xAB, 0xAB, 0xBB, 0xCC, 0xDD, 0xEE, 0xDD, 0xDD, 0xCB, 0xBA, 0xA9, + 0x99, 0xAA, 0xAB, 0xBC, 0xCD, 0xEC, 0xCD, 0xCB, 0xAA, 0x99, 0x88, 0x89, + 0x99, 0xAA, 0xBC, 0xDD, 0xDC, 0xDB, 0xBA, 0x98, 0x87, 0x77, 0x78, 0x99, + 0xAB, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x78, 0x89, 0xAB, + 0xCD, 0xCC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC, + 0xBC, 0xB9, 0x87, 0x65, 0x54, 0x55, 0x67, 0x79, 0x9B, 0xBC, 0xCC, 0xBA, + 0x98, 0x76, 0x54, 0x44, 0x45, 0x67, 0x89, 0xAC, 0xCD, 0xCC, 0xA9, 0x87, + 0x65, 0x54, 0x44, 0x56, 0x78, 0x9B, 0xBD, 0xDB, 0xCA, 0xA8, 0x87, 0x65, + 0x54, 0x55, 0x67, 0x89, 0xBB, 0xCD, 0xBB, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAA, 0xCD, 0xDC, 0xCB, 0xA9, 0x88, 0x77, 0x66, 0x67, 0x78, + 0x9A, 0xBC, 0xDD, 0xCC, 0xBB, 0xA9, 0x98, 0x77, 0x77, 0x88, 0x9A, 0xBB, + 0xDE, 0xDC, 0xDC, 0xBA, 0xA9, 0x98, 0x88, 0x89, 0x9A, 0xBB, 0xDD, 0xED, + 0xDD, 0xDC, 0xBB, 0xAA, 0xA9, 0x99, 0xAA, 0xBC, 0xCD, 0xEF, 0xDC, 0xED, + 0xDC, 0xBB, 0xBB, 0xAA, 0xBB, 0xBC, 0xCC, 0xEE, 0xEE, 0xDE, 0xED, 0xDD, + 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xEE, 0xEF, 0xFD, 0xFE, 0xDD, 0xDD, 0xDC, + 0xDD, 0xDD, 0xDE, 0xED, 0xFF, 0xFE, 0x8D, 0xCD, 0xCD, 0xCC, 0xCC, 0xCC, + 0xCD, 0xDD, 0xEE, 0xEF, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xED, 0xDD, 0xDD, 0xDC, 0x8F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, + 0xFF, 0xEE, 0xED, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xDC, + 0xCC, 0xCC, 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEC, 0xCB, 0xBB, 0xAB, + 0xBC, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, 0xBB, 0xA9, 0x99, 0x9A, 0xAB, + 0xCD, 0xFF, 0xFF, 0xEF, 0xFD, 0xCA, 0x98, 0x77, 0x77, 0x89, 0xAC, 0xDF, + 0xFF, 0xFF, 0xFE, 0xDB, 0xA8, 0x76, 0x56, 0x67, 0x8A, 0xBD, 0xDF, 0xFF, + 0xFF, 0xFC, 0xB9, 0x76, 0x54, 0x45, 0x68, 0x9B, 0xCD, 0xFF, 0xFF, 0xFD, + 0xCB, 0x97, 0x54, 0x23, 0x46, 0x79, 0xAC, 0xEF, 0xFF, 0xFF, 0xEC, 0xA9, + 0x76, 0x43, 0x24, 0x57, 0x9B, 0xCD, 0xFF, 0xFF, 0xFD, 0xCB, 0x98, 0x65, + 0x44, 0x46, 0x79, 0xBC, 0xEF, 0xFF, 0xEF, 0xDD, 0xBA, 0x87, 0x66, 0x56, + 0x78, 0xAB, 0xDF, 0xFF, 0xFF, 0xFE, 0xDC, 0xA9, 0x88, 0x77, 0x78, 0x9A, + 0xCD, 0xFF, 0xFF, 0xDF, 0xFD, 0xCB, 0xAA, 0x99, 0x99, 0xAB, 0xBD, 0xDF, + 0xFF, 0xFD, 0xFF, 0xDD, 0xCB, 0xBB, 0xAA, 0xBB, 0xCC, 0xFE, 0xFF, 0xFF, + 0xEF, 0xFD, 0xED, 0xDC, 0xCC, 0xCC, 0xCD, 0xEF, 0xFF, 0xFF, 0xFD, 0xFF, + 0xEF, 0xDD, 0xDD, 0xDE, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF, + 0xEF, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7C, 0xCD, 0xDD, 0xDD, 0xFD, 0xEF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xDE, 0xEE, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x9E, 0xFF, + 0xEE, 0xED, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xFD, 0xEF, 0xED, 0xDC, + 0xCB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEF, 0xDD, 0xED, 0xDC, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xFE, 0xDE, 0xDC, 0xBA, 0x99, 0x99, 0x99, + 0x9A, 0xAB, 0xCC, 0xDE, 0xDD, 0xDC, 0xBA, 0x98, 0x88, 0x77, 0x88, 0x99, + 0xAB, 0xCD, 0xED, 0xDD, 0xCA, 0x98, 0x77, 0x66, 0x67, 0x78, 0x9A, 0xBC, + 0xDD, 0xDC, 0xDB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xCD, 0xED, + 0xCC, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB, + 0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xED, 0xCC, 0xBA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x67, 0x9A, 0xBC, 0xED, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAC, 0xDE, 0xEC, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x78, + 0x9B, 0xCD, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC, + 0xEF, 0xEC, 0xDC, 0xCB, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xFE, + 0xCE, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xEC, 0xED, + 0xDC, 0xCC, 0xBB, 0xBB, 0xBB, 0xCD, 0xDE, 0xEF, 0xFF, 0xCF, 0xED, 0xDD, + 0xDC, 0xCC, 0xCC, 0xCD, 0xDE, 0xEF, 0xFF, 0xFC, 0xFE, 0xFE, 0xDD, 0xDD, + 0xDE, 0xEE, 0xEE, 0xFF, 0xFF, 0xFF, 0x8D, 0xDD, 0xCD, 0xDD, 0xDD, 0xDD, + 0xDD, 0xEE, 0xFF, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xDE, 0xED, 0xDC, 0xCC, 0xBB, 0xBB, 0xBB, 0xBC, 0xCC, 0xCC, 0x9E, 0xFE, + 0xED, 0xCC, 0xCB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xED, 0xEE, 0xDD, 0xCB, + 0xBA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xDD, 0xDC, 0xCB, 0xAA, 0x99, + 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xDD, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0x9A, 0xBB, 0xCD, 0xCC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x89, + 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xCC, + 0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x55, + 0x66, 0x78, 0x9A, 0xBD, 0xCB, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCD, 0xDC, 0xCB, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xEE, + 0xCD, 0xCB, 0xBA, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xEC, 0xDD, + 0xCC, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFF, 0xCE, 0xDD, 0xCC, + 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFD, 0xEE, 0xDD, 0xCD, 0xCC, + 0xCC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFF, 0xAD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, + 0xDD, 0xDE, 0xEF, 0xFF, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xED, 0xEE, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x9F, 0xFF, + 0xFE, 0xED, 0xDC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xED, 0xEF, 0xEE, 0xDC, + 0xCC, 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEE, 0xDE, 0xEE, 0xDC, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBC, 0xDD, 0xED, 0xDE, 0xDC, 0xBA, 0x99, 0x98, 0x99, + 0x9A, 0xAB, 0xCC, 0xDE, 0xDD, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x99, + 0xAB, 0xCD, 0xDD, 0xDD, 0xCB, 0xA8, 0x77, 0x66, 0x67, 0x78, 0x9A, 0xBC, + 0xDD, 0xCC, 0xDB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC, + 0xCC, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xCB, + 0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x79, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAC, 0xCD, 0xDC, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88, + 0x9B, 0xCD, 0xDD, 0xCD, 0xCB, 0xAA, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC, + 0xDF, 0xDD, 0xDC, 0xCB, 0xAA, 0x99, 0x89, 0x99, 0xAA, 0xBC, 0xDD, 0xED, + 0xCD, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xEF, 0xED, 0xED, + 0xDC, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEE, 0xFE, 0xCD, 0xED, 0xDD, + 0xCC, 0xCC, 0xCC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFD, 0xFE, 0xEE, 0xED, 0xDD, + 0xDD, 0xEE, 0xDE, 0xFE, 0xFF, 0xFE, 0x9C, 0xCD, 0xCC, 0xCC, 0xCC, 0xDD, + 0xDD, 0xDE, 0xEF, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xEF, 0xFF, 0xFF, 0xFF, 0xEE, 0xDD, 0xDD, 0xDD, 0xCC, 0xCD, 0x7F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xEE, 0xFE, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, + 0xEF, 0xDC, 0xDD, 0xDD, 0xFF, 0xEF, 0xFF, 0xDF, 0xFF, 0xFE, 0xDD, 0xCC, + 0xBB, 0xBC, 0xCD, 0xDD, 0xDF, 0xFE, 0xFF, 0xFF, 0xDC, 0xBA, 0xAA, 0xAA, + 0xAB, 0xCC, 0xDF, 0xFF, 0xEF, 0xFF, 0xDC, 0xBA, 0x98, 0x88, 0x99, 0xAB, + 0xCD, 0xDF, 0xFE, 0xFF, 0xFC, 0xBA, 0x98, 0x77, 0x77, 0x89, 0xAB, 0xCD, + 0xFF, 0xFF, 0xFD, 0xCB, 0x97, 0x65, 0x55, 0x67, 0x89, 0xBB, 0xDF, 0xFF, + 0xFF, 0xDC, 0xA8, 0x75, 0x44, 0x45, 0x67, 0x9A, 0xCD, 0xFF, 0xFF, 0xFD, + 0xBA, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xDF, 0xFF, 0xFE, 0xDB, 0xA8, + 0x75, 0x43, 0x34, 0x57, 0x8A, 0xBD, 0xFF, 0xFF, 0xED, 0xBA, 0x87, 0x65, + 0x44, 0x45, 0x78, 0xAB, 0xDF, 0xFF, 0xFF, 0xDC, 0xA9, 0x87, 0x65, 0x55, + 0x67, 0x9B, 0xCF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x87, 0x76, 0x78, 0x9A, + 0xBC, 0xDF, 0xFF, 0xEF, 0xEC, 0xCB, 0xA9, 0x98, 0x88, 0x9A, 0xBC, 0xDF, + 0xFF, 0xFE, 0xFF, 0xCD, 0xCB, 0xAA, 0xAA, 0xAB, 0xBC, 0xDF, 0xFF, 0xFF, + 0xEF, 0xFF, 0xDD, 0xCB, 0xBB, 0xBB, 0xDC, 0xEE, 0xFF, 0xFF, 0xFD, 0xFE, + 0xEF, 0xDD, 0xDC, 0xDD, 0xDD, 0xEE, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xDC, 0xDD, 0xDE, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xCF, 0xDE, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xDC, 0xCC, 0xCD, 0x8F, 0xFF, + 0xEE, 0xDC, 0xDC, 0xBC, 0xCD, 0xDE, 0xDD, 0xEF, 0xED, 0xEE, 0xEE, 0xDC, + 0xBB, 0xBB, 0xBB, 0xBB, 0xCD, 0xED, 0xEE, 0xED, 0xFE, 0xDC, 0xBA, 0xAA, + 0xAA, 0xAA, 0xAB, 0xCC, 0xDD, 0xED, 0xDE, 0xCC, 0xBA, 0x99, 0x88, 0x89, + 0x99, 0xAB, 0xBC, 0xDE, 0xDD, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x99, + 0xAB, 0xCE, 0xDD, 0xDD, 0xCA, 0x98, 0x77, 0x66, 0x67, 0x78, 0x99, 0xAB, + 0xCE, 0xDD, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9B, 0xBD, 0xDD, + 0xCC, 0xBA, 0x87, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCE, 0xDC, 0xCB, + 0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xCD, 0xCC, 0xBA, 0x87, + 0x65, 0x54, 0x44, 0x56, 0x78, 0x9B, 0xCD, 0xEC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x67, 0x8A, 0xBC, 0xDD, 0xCD, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x78, + 0x9A, 0xBD, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC, + 0xDE, 0xDC, 0xDC, 0xCB, 0xAA, 0x99, 0x88, 0x99, 0x9A, 0xBC, 0xDD, 0xEE, + 0xCE, 0xDC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xBC, 0xCD, 0xEF, 0xED, 0xEE, + 0xDC, 0xCC, 0xBB, 0xBB, 0xBB, 0xBC, 0xDD, 0xEE, 0xFE, 0xDE, 0xEE, 0xDD, + 0xCC, 0xCC, 0xCC, 0xCD, 0xDF, 0xEE, 0xFF, 0xEC, 0xEF, 0xEE, 0xDD, 0xDD, + 0xDD, 0xDD, 0xEF, 0xFF, 0xFF, 0xFE, 0x8D, 0xDD, 0xDC, 0xDC, 0xDD, 0xDD, + 0xDD, 0xDE, 0xEF, 0xEF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xBB, 0xAA, 0xAA, 0xAA, 0x9A, 0xAA, 0xAA, 0xAB, 0xBB, 0x8B, 0xDC, + 0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDB, 0xBC, 0xBB, 0xAA, + 0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xCD, 0xBB, 0xCB, 0xAA, 0x99, 0x88, + 0x88, 0x99, 0x99, 0xAA, 0xBC, 0xCB, 0xAB, 0xAA, 0x99, 0x88, 0x87, 0x88, + 0x88, 0x99, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x88, + 0x99, 0xAB, 0xCB, 0xAB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x9A, + 0xBB, 0xAA, 0xA9, 0x98, 0x76, 0x66, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xBA, + 0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xAA, 0xA9, + 0x88, 0x76, 0x55, 0x55, 0x55, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x98, 0x87, + 0x66, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x56, + 0x66, 0x78, 0x89, 0xAB, 0xBA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAA, 0xBB, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xBB, 0xBA, 0xBA, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x89, 0x9A, 0xAB, 0xCB, + 0xAC, 0xBA, 0xA9, 0x99, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCC, 0xCB, 0xCB, + 0xBA, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDC, 0xBC, 0xCB, 0xBB, + 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xDB, 0xDC, 0xCC, 0xBB, 0xBB, + 0xBB, 0xBB, 0xBC, 0xCD, 0xDD, 0xEC, 0x8B, 0xBB, 0xBB, 0xBB, 0xAA, 0xAA, + 0xBB, 0xBB, 0xCC, 0xCD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0x9B, 0xCC, + 0xBB, 0xAA, 0xAA, 0x99, 0xAA, 0xAA, 0xBB, 0xBC, 0xCB, 0xBC, 0xBA, 0xA9, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xBA, 0xBA, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77, + 0x88, 0x99, 0x9A, 0xBB, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, + 0x99, 0xAA, 0xBA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x99, + 0xAB, 0xA9, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA, + 0x99, 0x98, 0x77, 0x66, 0x65, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xA9, 0x99, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0x99, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x88, 0x76, 0x66, + 0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xBA, 0x9A, 0xA9, 0x88, 0x87, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x88, 0x77, 0x78, 0x88, 0x99, 0xAA, 0xBB, + 0xAB, 0xAA, 0x99, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBA, 0xBB, + 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xCB, 0xBC, 0xBB, 0xBA, + 0xAA, 0xA9, 0x9A, 0xAA, 0xAB, 0xBB, 0xCD, 0xCB, 0xDC, 0xCB, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDC, 0x9B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAB, 0xBB, 0xCC, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xBC, 0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0x8C, 0xDD, + 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCC, 0xDC, 0xCD, 0xCB, 0xAA, + 0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xCD, 0xCB, 0xCB, 0xAA, 0x99, 0x98, + 0x88, 0x89, 0x99, 0xAA, 0xBC, 0xCB, 0xBC, 0xAA, 0x98, 0x88, 0x77, 0x78, + 0x88, 0x99, 0xAB, 0xBC, 0xBB, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, + 0x99, 0xAB, 0xCB, 0xAB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x9A, + 0xAB, 0xBA, 0xA9, 0x88, 0x76, 0x66, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xBB, + 0xAA, 0x98, 0x77, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xBA, 0xA9, + 0x87, 0x76, 0x55, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0xAA, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xBA, 0xA9, 0x88, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x56, + 0x66, 0x78, 0x89, 0xAB, 0xBA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAA, 0xBB, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xBC, 0xBB, 0xBB, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x89, 0x9A, 0xAB, 0xCC, + 0xBC, 0xBB, 0xA9, 0x99, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCC, 0xCB, 0xCC, + 0xBB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDC, 0xBD, 0xCC, 0xBB, + 0xBA, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0xDD, 0xCC, 0xDC, 0xCC, 0xCB, 0xBB, + 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xED, 0x8B, 0xBB, 0xBB, 0xBA, 0xAA, 0xBB, + 0xBB, 0xBC, 0xCC, 0xCD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xCF, 0xED, 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x7E, 0xFF, + 0xFE, 0xDD, 0xDC, 0xCD, 0xDD, 0xCE, 0xEE, 0xFF, 0xFD, 0xDF, 0xDD, 0xDC, + 0xDC, 0xCC, 0xBC, 0xCC, 0xCD, 0xDD, 0xFE, 0xDD, 0xEE, 0xDC, 0xBB, 0xBB, + 0xAA, 0xBB, 0xBB, 0xDD, 0xDE, 0xED, 0xDE, 0xDD, 0xBA, 0xA9, 0x99, 0x99, + 0xAA, 0xBB, 0xCD, 0xDD, 0xDD, 0xDC, 0xBB, 0xA9, 0x88, 0x88, 0x89, 0x9A, + 0xBC, 0xDE, 0xED, 0xCD, 0xCB, 0xA9, 0x87, 0x76, 0x77, 0x88, 0x9A, 0xBC, + 0xDE, 0xDD, 0xDC, 0xBA, 0x87, 0x65, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xDC, + 0xDD, 0xBA, 0x98, 0x76, 0x54, 0x45, 0x67, 0x89, 0xBC, 0xCE, 0xDC, 0xDB, + 0xA9, 0x86, 0x54, 0x33, 0x45, 0x78, 0x9A, 0xCD, 0xDD, 0xCD, 0xCA, 0x98, + 0x75, 0x43, 0x34, 0x57, 0x89, 0xAC, 0xCE, 0xCC, 0xDB, 0xB9, 0x87, 0x65, + 0x44, 0x56, 0x78, 0x9A, 0xBD, 0xFD, 0xCD, 0xCB, 0xA9, 0x87, 0x65, 0x56, + 0x67, 0x89, 0xBC, 0xDD, 0xDC, 0xDD, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x89, + 0xAB, 0xCD, 0xED, 0xCD, 0xCB, 0xBA, 0x99, 0x88, 0x88, 0x89, 0xAB, 0xCD, + 0xDF, 0xEC, 0xED, 0xDB, 0xBA, 0xA9, 0x99, 0x9A, 0xAB, 0xBC, 0xDE, 0xDE, + 0xCF, 0xDD, 0xCB, 0xBB, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xDF, 0xED, 0xFE, + 0xDD, 0xCC, 0xCB, 0xCB, 0xCC, 0xCD, 0xDE, 0xEE, 0xFD, 0xDF, 0xEF, 0xFD, + 0xDD, 0xDD, 0xDC, 0xED, 0xED, 0xEE, 0xFF, 0xFD, 0xFF, 0xFD, 0xEE, 0xED, + 0xDD, 0xDF, 0xEE, 0xFE, 0xFF, 0xFF, 0x8D, 0xDD, 0xDC, 0xCD, 0xDD, 0xCD, + 0xCD, 0xDD, 0xED, 0xEE, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFE, 0xCF, 0xCD, 0xCC, 0xCC, 0x8F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, + 0xFF, 0xCD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDB, 0xCC, 0xBB, + 0xCC, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC, 0xBA, 0xAA, 0xAB, 0xBC, + 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0xA9, 0x88, 0x88, 0x9A, 0xBD, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFD, 0xA9, 0x87, 0x66, 0x78, 0x9B, 0xCD, 0xFF, 0xFF, + 0xFF, 0xDC, 0xBA, 0x86, 0x54, 0x45, 0x78, 0xAC, 0xDF, 0xFF, 0xFF, 0xFF, + 0xFB, 0xA8, 0x64, 0x22, 0x46, 0x89, 0xBD, 0xFF, 0xFF, 0xDF, 0xDC, 0xB9, + 0x86, 0x42, 0x24, 0x68, 0x9B, 0xDD, 0xFF, 0xFF, 0xFF, 0xCC, 0xA8, 0x75, + 0x44, 0x56, 0x8A, 0xBF, 0xFF, 0xFF, 0xFF, 0xCF, 0xCA, 0x98, 0x76, 0x66, + 0x79, 0xAD, 0xFF, 0xFF, 0xFF, 0xFD, 0xFD, 0xBA, 0x98, 0x88, 0x89, 0xAB, + 0xDC, 0xFF, 0xFF, 0xDF, 0xFF, 0xDC, 0xCA, 0xAA, 0xAA, 0xAB, 0xCF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xDB, 0xCC, 0xBB, 0xCC, 0xFD, 0xDF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xCF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFD, 0xFF, 0xCD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xFD, 0xDD, 0xDC, 0xCC, 0xCB, 0xCC, 0xCC, 0xCC, 0xCC, 0x8F, 0xFF, + 0xEE, 0xDD, 0xDC, 0xCC, 0xCD, 0xDC, 0xED, 0xDF, 0xFC, 0xFF, 0xEE, 0xDC, + 0xCC, 0xCB, 0xBB, 0xBC, 0xCC, 0xDE, 0xEF, 0xDF, 0xFD, 0xCC, 0xBB, 0xAB, + 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xED, 0xDD, 0xDC, 0xBB, 0xAA, 0x99, 0x99, + 0x9A, 0xBC, 0xCD, 0xDD, 0xDD, 0xFD, 0xCB, 0xA9, 0x88, 0x88, 0x89, 0x9A, + 0xBB, 0xCD, 0xDD, 0xDC, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x88, 0x9A, 0xBC, + 0xDE, 0xDD, 0xDC, 0xA9, 0x87, 0x66, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xED, + 0xCC, 0xCA, 0x98, 0x76, 0x54, 0x45, 0x67, 0x89, 0xAC, 0xDE, 0xDC, 0xCB, + 0xA9, 0x87, 0x54, 0x33, 0x45, 0x78, 0x9A, 0xBC, 0xDD, 0xDC, 0xBA, 0x98, + 0x75, 0x43, 0x34, 0x56, 0x89, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x56, 0x78, 0x9A, 0xBD, 0xDD, 0xDD, 0xCB, 0xA9, 0x87, 0x65, 0x55, + 0x67, 0x89, 0xBC, 0xDE, 0xDC, 0xCC, 0xBA, 0x98, 0x87, 0x76, 0x77, 0x89, + 0xAB, 0xCD, 0xEE, 0xCD, 0xCB, 0xBA, 0x99, 0x88, 0x88, 0x89, 0xAB, 0xCD, + 0xDE, 0xFC, 0xED, 0xBB, 0xBA, 0xA9, 0x99, 0x9A, 0xAB, 0xBD, 0xDF, 0xFE, + 0xCD, 0xED, 0xCB, 0xBB, 0xBA, 0xAA, 0xBB, 0xCC, 0xED, 0xFF, 0xEC, 0xEE, + 0xDC, 0xCC, 0xCC, 0xBC, 0xCC, 0xDD, 0xDF, 0xEF, 0xFF, 0xCD, 0xED, 0xDD, + 0xCD, 0xCD, 0xDC, 0xDD, 0xDF, 0xEF, 0xFF, 0xFC, 0xFF, 0xFD, 0xEE, 0xED, + 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0x8D, 0xDC, 0xCD, 0xCD, 0xDD, 0xED, + 0xEE, 0xFE, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0xAF, 0xFF, + 0xFD, 0xDC, 0xCB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEF, 0xFE, 0xFF, 0xED, 0xCB, + 0xBB, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xEF, 0xEE, 0xED, 0xCB, 0xAA, 0x99, + 0x99, 0x99, 0xAA, 0xBC, 0xCD, 0xFE, 0xED, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0x9A, 0xBC, 0xDD, 0xDD, 0xDB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89, + 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xDC, 0xCA, 0x98, 0x76, 0x65, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xDD, + 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xDC, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xCB, 0xA9, 0x87, 0x76, 0x65, 0x55, + 0x66, 0x78, 0x9B, 0xCD, 0xEC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x9A, 0xBC, 0xDE, 0xCC, 0xBA, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x99, 0xAB, + 0xDF, 0xED, 0xDC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x9A, 0xAB, 0xCD, 0xFF, + 0xDD, 0xCC, 0xBA, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCD, 0xFF, 0xFD, 0xED, + 0xCC, 0xBB, 0xBA, 0xAA, 0xAB, 0xBC, 0xCD, 0xEF, 0xFF, 0xDF, 0xED, 0xDC, + 0xCC, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xFF, 0xFD, 0xFF, 0xED, 0xDD, 0xDD, + 0xDD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xAD, 0xDD, 0xDD, 0xDD, 0xDC, 0xDD, + 0xDE, 0xEF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xEF, 0xFF, 0xED, 0xDC, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0x9F, 0xFF, + 0xFE, 0xDD, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xFD, 0xFE, 0xEE, 0xCC, + 0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xDE, 0xEE, 0xDE, 0xFF, 0xDC, 0xBB, 0xAA, + 0x99, 0xAA, 0xAB, 0xCC, 0xCE, 0xDD, 0xED, 0xEC, 0xBA, 0x99, 0x88, 0x88, + 0x9A, 0xAB, 0xBC, 0xEE, 0xCD, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x78, 0x89, + 0xAB, 0xCC, 0xED, 0xDD, 0xCA, 0x98, 0x77, 0x66, 0x66, 0x78, 0x89, 0xAB, + 0xCD, 0xDD, 0xDB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD, + 0xDC, 0xBA, 0x97, 0x65, 0x54, 0x55, 0x66, 0x78, 0xAB, 0xBD, 0xCC, 0xCB, + 0xA8, 0x76, 0x54, 0x44, 0x55, 0x67, 0x89, 0xAC, 0xDE, 0xCC, 0xA9, 0x87, + 0x65, 0x44, 0x44, 0x56, 0x78, 0x9B, 0xCD, 0xDC, 0xCB, 0xA8, 0x76, 0x65, + 0x54, 0x55, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xDC, 0xA9, 0x88, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBD, 0xDD, 0xDD, 0xCB, 0xA9, 0x88, 0x87, 0x77, 0x88, 0x9A, 0xBC, + 0xDF, 0xDD, 0xDC, 0xCB, 0xA9, 0x98, 0x88, 0x89, 0x9A, 0xBC, 0xCE, 0xFE, + 0xDD, 0xDC, 0xBB, 0xBA, 0xA9, 0xAA, 0xAA, 0xBC, 0xDE, 0xDF, 0xFD, 0xFD, + 0xCC, 0xCB, 0xBB, 0xBA, 0xBB, 0xBC, 0xDD, 0xEF, 0xFF, 0xDF, 0xDD, 0xDC, + 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xEE, 0xFF, 0xFD, 0xEE, 0xDE, 0xDD, 0xDD, + 0xDD, 0xDD, 0xEF, 0xEF, 0xFF, 0xFF, 0x9C, 0xCC, 0xCC, 0xCD, 0xDC, 0xED, + 0xEE, 0xEF, 0xFF, 0xFE, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xDD, 0xED, 0xDD, 0xCC, 0xDD, 0x8F, 0xFF, + 0xFF, 0xFE, 0xFE, 0xDD, 0xDD, 0xDF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, + 0xFE, 0xDD, 0xDD, 0xDC, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFE, 0xDD, 0xCC, + 0xBB, 0xBB, 0xCD, 0xDF, 0xFF, 0xFD, 0xFF, 0xDE, 0xDC, 0xBB, 0xAA, 0xAA, + 0xAA, 0xCC, 0xCF, 0xFF, 0xDF, 0xFF, 0xCC, 0xBA, 0x98, 0x88, 0x99, 0xAB, + 0xCD, 0xFD, 0xFF, 0xED, 0xED, 0xBA, 0x87, 0x77, 0x77, 0x89, 0xAB, 0xCD, + 0xFF, 0xDD, 0xED, 0xCB, 0x97, 0x65, 0x55, 0x67, 0x89, 0xBC, 0xFF, 0xEF, + 0xEF, 0xDB, 0xA8, 0x75, 0x44, 0x45, 0x67, 0x9A, 0xCD, 0xEF, 0xED, 0xEC, + 0xCA, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xDF, 0xFE, 0xDE, 0xCB, 0xA8, + 0x75, 0x43, 0x34, 0x57, 0x89, 0xCD, 0xEF, 0xFD, 0xEC, 0xCA, 0x97, 0x65, + 0x44, 0x45, 0x79, 0xAB, 0xDE, 0xDF, 0xFE, 0xDC, 0xA9, 0x87, 0x65, 0x55, + 0x67, 0x9A, 0xCD, 0xFF, 0xFE, 0xDE, 0xCB, 0xA9, 0x87, 0x77, 0x78, 0x9A, + 0xBC, 0xEF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x98, 0x88, 0x9A, 0xBC, 0xDE, + 0xFF, 0xFF, 0xDF, 0xCC, 0xBB, 0xAA, 0xA9, 0xAB, 0xBC, 0xDD, 0xFE, 0xFF, + 0xDF, 0xEE, 0xEC, 0xCC, 0xBB, 0xBC, 0xBD, 0xED, 0xFF, 0xFF, 0xFF, 0xEF, + 0xFD, 0xDD, 0xCC, 0xDC, 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xCF, 0xDE, 0xEF, + 0xDE, 0xFD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFD, 0xFF, 0xEE, + 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7C, 0xCB, 0xCD, 0xDE, 0xFF, 0xEE, + 0xDF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xCD, 0xED, 0xDB, 0xCC, 0xBA, 0xAB, 0xBB, 0xBB, 0xBB, 0xBB, 0x7F, 0xFD, + 0xCD, 0xCB, 0xBA, 0xBB, 0xBB, 0xBF, 0xDC, 0xDC, 0xFD, 0xDD, 0xDC, 0xBB, + 0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0xED, 0xCF, 0xEC, 0xDC, 0xBA, 0xAA, 0x99, + 0x98, 0x99, 0xAA, 0xBB, 0xCD, 0xDF, 0xDC, 0xBA, 0xA9, 0x88, 0x88, 0x88, + 0x99, 0x9A, 0xBC, 0xCE, 0xDC, 0xDB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x89, + 0x9A, 0xCD, 0xCF, 0xCC, 0xB9, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAA, + 0xCC, 0xDC, 0xCA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x77, 0x89, 0xAC, 0xCC, + 0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDB, 0xCA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAA, 0xCC, 0xCB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xDB, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xBB, 0xA9, 0x88, 0x76, 0x65, 0x55, + 0x67, 0x78, 0x9A, 0xBD, 0xCB, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x89, 0xAC, 0xCF, 0xCC, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCD, 0xCC, 0xDB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCC, 0xDD, + 0xDF, 0xCB, 0xAA, 0xA9, 0x98, 0x99, 0x9A, 0xAB, 0xBD, 0xDF, 0xFC, 0xEE, + 0xDB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBD, 0xDE, 0xFF, 0xCF, 0xDD, 0xDD, + 0xBC, 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xFF, 0xDD, 0xDD, 0xED, 0xCD, 0xCD, + 0xDC, 0xCC, 0xCE, 0xDF, 0xFF, 0xFF, 0x8D, 0xBB, 0xED, 0xCC, 0xCB, 0xCD, + 0xCF, 0xDD, 0xDF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xCB, 0xBA, 0xAA, 0x99, 0x99, 0x9A, 0xAA, 0xAA, 0xBB, 0x7C, 0xDC, + 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0xDC, 0xCC, 0xBB, 0xAA, + 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xCB, 0xBA, 0xA9, 0x99, 0x88, + 0x88, 0x88, 0x99, 0x9A, 0xBC, 0xDC, 0xBB, 0xAA, 0x98, 0x88, 0x77, 0x77, + 0x88, 0x99, 0xAA, 0xBB, 0xBA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, + 0x99, 0xAB, 0xBB, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x9A, + 0xAB, 0xB9, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAB, + 0x9A, 0x98, 0x77, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xB9, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xB9, 0xA9, 0x88, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x78, 0x89, 0xAB, 0xBA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xBB, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xAC, 0xBA, 0xBA, 0xA9, 0x88, 0x87, 0x77, 0x78, 0x88, 0x9A, 0xAB, 0xCC, + 0xBB, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x89, 0x99, 0xAB, 0xCD, 0xCB, 0xCB, + 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xBB, 0xCC, 0xDE, 0xBC, 0xCC, 0xBB, + 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xCE, 0xDB, 0xDE, 0xCC, 0xCB, 0xBB, + 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xED, 0x9C, 0xCB, 0xBB, 0xAB, 0xAA, 0xBA, + 0xBB, 0xBB, 0xCD, 0xDD, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xBC, 0xBB, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0x9C, 0xCC, + 0xBB, 0xAA, 0x99, 0x99, 0x9A, 0xAA, 0xAB, 0xBC, 0xDC, 0xBC, 0xBA, 0xA9, + 0x99, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xBB, 0xBA, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xBB, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77, + 0x88, 0x89, 0x9A, 0xAB, 0xBA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, 0x78, 0x89, + 0xAB, 0xA9, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA, + 0x99, 0x98, 0x77, 0x66, 0x65, 0x66, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99, + 0x87, 0x76, 0x65, 0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x99, 0x98, 0x77, + 0x66, 0x65, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66, + 0x55, 0x66, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xBB, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xBA, 0xBA, 0x99, 0x88, 0x87, 0x77, 0x77, 0x88, 0x99, 0xAB, 0xBB, + 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBB, 0xBB, + 0xAA, 0x99, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xDC, 0xBC, 0xBB, 0xAA, + 0xAA, 0x99, 0x99, 0xAA, 0xAA, 0xBC, 0xCD, 0xDB, 0xCD, 0xCB, 0xBB, 0xAA, + 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDD, 0x9C, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xBB, 0xCC, 0xDD, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xCC, 0xCB, 0xBA, 0xAA, 0xAA, 0x9A, 0xAA, 0xAA, 0xBB, 0xBB, 0x8C, 0xCD, + 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCC, 0xDC, 0xCC, 0xBA, 0xBA, + 0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xAB, 0xCC, 0xCC, 0xCB, 0xA9, 0x99, 0x88, + 0x88, 0x89, 0x99, 0x9A, 0xBB, 0xCB, 0xBB, 0xAA, 0x98, 0x88, 0x77, 0x78, + 0x88, 0x99, 0xAA, 0xBC, 0xBB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, + 0x99, 0xAB, 0xBB, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x99, + 0xAB, 0xAA, 0xA9, 0x88, 0x76, 0x66, 0x56, 0x66, 0x77, 0x89, 0x9A, 0xBB, + 0x9A, 0x98, 0x77, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xAA, 0xA9, + 0x87, 0x76, 0x55, 0x55, 0x56, 0x67, 0x79, 0x9A, 0xBB, 0xAA, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x88, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x78, 0x99, 0xAB, 0xBA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAA, 0xBC, 0xAB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xBC, 0xBA, 0xBA, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x88, 0x9A, 0xBB, 0xCB, + 0xAB, 0xBA, 0xA9, 0x99, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCC, 0xCB, 0xDB, + 0xAA, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xDC, 0xBC, 0xBB, 0xBA, + 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xDB, 0xCC, 0xCC, 0xBB, 0xBB, + 0xBB, 0xBB, 0xBC, 0xCC, 0xCE, 0xDD, 0x7B, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, + 0xBB, 0xCB, 0xCC, 0xCC, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xDC, 0xFE, 0xCD, 0xCC, 0xDD, 0x7F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFD, 0xFF, 0xDF, 0xFF, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xDC, + 0xBD, 0xDF, 0xFD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xDC, 0xCC, 0xBB, + 0xCC, 0xFF, 0xDF, 0xFF, 0xFD, 0xFF, 0xFD, 0xCB, 0xAA, 0xAA, 0xAC, 0xBB, + 0xBE, 0xDF, 0xFF, 0xEF, 0xDF, 0xDC, 0xA9, 0x98, 0x89, 0xAA, 0xCB, 0xFF, + 0xFF, 0xFF, 0xFF, 0xCC, 0xA9, 0x86, 0x66, 0x78, 0xAB, 0xCD, 0xFF, 0xFD, + 0xFF, 0xFD, 0xBA, 0x86, 0x54, 0x45, 0x79, 0xAC, 0xCF, 0xDF, 0xFF, 0xFF, + 0xCC, 0xA8, 0x64, 0x22, 0x46, 0x8A, 0xBE, 0xDF, 0xFF, 0xFF, 0xFD, 0xCA, + 0x86, 0x42, 0x24, 0x68, 0xAB, 0xCF, 0xFF, 0xFF, 0xFF, 0xDC, 0xA9, 0x75, + 0x44, 0x56, 0x8A, 0xCD, 0xDF, 0xFE, 0xFF, 0xFD, 0xDB, 0x98, 0x76, 0x66, + 0x89, 0xBC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBA, 0x99, 0x88, 0x89, 0xBB, + 0xDD, 0xFF, 0xFF, 0xFF, 0xFD, 0xCC, 0xBA, 0xA9, 0x9A, 0xBC, 0xDD, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xBC, 0xBB, 0xCC, 0xCC, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xDC, 0xFD, 0xDD, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xDC, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xCD, 0xDF, 0xFD, 0xEE, 0xDF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xDF, 0xFF, 0xFD, 0xFF, 0xFC, 0xFF, 0xFC, 0xFF, 0x7F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, + 0xFF, 0xDF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFC, 0xCC, 0xCF, + 0xDD, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xCF, 0xDD, 0xBB, 0xBA, 0xAC, 0xCB, + 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAA, 0x99, 0x89, 0xAA, 0xAF, 0xFF, + 0xFF, 0xFF, 0xCF, 0xFC, 0xBA, 0x87, 0x66, 0x79, 0xAB, 0xDD, 0xFF, 0xFF, + 0xFF, 0xFF, 0xCB, 0x97, 0x54, 0x45, 0x79, 0xBC, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xB9, 0x64, 0x22, 0x46, 0x8A, 0xDD, 0xDD, 0xFF, 0xFF, 0xFD, 0xDC, + 0x96, 0x42, 0x23, 0x69, 0xBB, 0xCF, 0xFF, 0xFF, 0xFF, 0xFC, 0xB9, 0x75, + 0x44, 0x57, 0x9B, 0xBF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF, 0xA9, 0x76, 0x66, + 0x89, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0xA9, 0x88, 0x99, 0xAD, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xAA, 0xAB, 0xCC, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xDB, 0xBB, 0xBF, 0xCF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xDD, 0xFD, 0xFD, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xDC, 0xDC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xDF, 0xFD, 0xFF, 0xFA, 0xBD, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0x89, 0x99, 0x98, 0x88, 0x88, 0x88, 0x88, 0x98, 0x98, 0x9A, 0x6A, 0xCB, + 0x9A, 0xA9, 0x99, 0x99, 0xAA, 0x9A, 0xAB, 0xAA, 0xDA, 0x9A, 0xA9, 0x89, + 0x99, 0x89, 0x99, 0x89, 0x8A, 0x99, 0xAA, 0x9A, 0xAA, 0x99, 0x88, 0x88, + 0x88, 0x88, 0x89, 0xA9, 0xAA, 0xAA, 0x89, 0xA9, 0x98, 0x88, 0x88, 0x88, + 0x88, 0x89, 0x9A, 0xB9, 0xA9, 0xA9, 0x98, 0x78, 0x77, 0x77, 0x77, 0x88, + 0x89, 0x9A, 0xA9, 0x89, 0x98, 0x87, 0x76, 0x76, 0x77, 0x77, 0x88, 0x99, + 0x9A, 0xA8, 0x98, 0x88, 0x76, 0x66, 0x66, 0x77, 0x77, 0x88, 0x89, 0x98, + 0x89, 0x98, 0x87, 0x76, 0x66, 0x66, 0x67, 0x78, 0x88, 0x9B, 0xA8, 0x99, + 0x87, 0x76, 0x65, 0x55, 0x66, 0x77, 0x88, 0x98, 0xA8, 0x89, 0x88, 0x87, + 0x76, 0x65, 0x56, 0x67, 0x77, 0x88, 0x99, 0x98, 0x99, 0x78, 0x77, 0x66, + 0x65, 0x66, 0x67, 0x78, 0x8A, 0x99, 0x89, 0x98, 0x78, 0x77, 0x66, 0x66, + 0x67, 0x77, 0x88, 0xAB, 0x98, 0x99, 0x89, 0x87, 0x77, 0x76, 0x67, 0x77, + 0x88, 0x89, 0xA9, 0x9A, 0x9A, 0x98, 0x77, 0x77, 0x77, 0x77, 0x78, 0x89, + 0x9B, 0x98, 0xA9, 0x99, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x9A, 0xA9, + 0x8A, 0x99, 0x99, 0x89, 0x88, 0x88, 0x88, 0x99, 0x8A, 0xAA, 0xA9, 0xAB, + 0xAA, 0x98, 0x88, 0x89, 0x88, 0x89, 0x9A, 0xBA, 0xA9, 0xAC, 0xBA, 0xB9, + 0xAA, 0x99, 0x99, 0x9A, 0x99, 0xAA, 0xAD, 0xA9, 0xBA, 0xAB, 0xAB, 0xA9, + 0x9A, 0x9A, 0xBA, 0xAA, 0x9C, 0xBB, 0x8B, 0xA9, 0xA8, 0x99, 0x98, 0x88, + 0x99, 0x9A, 0xAA, 0xAB, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFE, 0xDD, 0xCC, 0xCC, 0xDC, 0xDD, 0xED, 0xEF, 0xDF, 0xFF, + 0xED, 0xDC, 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xFF, 0xFF, 0xFF, 0xFE, 0xCB, + 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xFF, 0xFD, 0xCB, 0xAA, 0x99, + 0x99, 0x99, 0xAA, 0xBC, 0xDD, 0xFF, 0xFD, 0xCB, 0xA9, 0x98, 0x87, 0x88, + 0x89, 0x9A, 0xBC, 0xFF, 0xFE, 0xDC, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xBC, 0xDF, 0xDC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x67, 0x89, 0xAB, + 0xCD, 0xEE, 0xBB, 0x98, 0x76, 0x65, 0x55, 0x56, 0x67, 0x89, 0xAB, 0xDF, + 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xBA, + 0x98, 0x76, 0x55, 0x45, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xCB, 0xA9, 0x87, + 0x65, 0x55, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xDC, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xCC, 0xA9, 0x87, 0x76, 0x55, 0x55, + 0x66, 0x78, 0x9B, 0xCD, 0xEC, 0xCA, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78, + 0x9A, 0xBC, 0xDF, 0xDC, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xDF, 0xFF, 0xDC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xFF, + 0xFE, 0xCB, 0xBA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xCD, 0xFF, 0xFF, 0xFD, + 0xDC, 0xCB, 0xAA, 0xAA, 0xAA, 0xBC, 0xCD, 0xFF, 0xFF, 0xFF, 0xEF, 0xDD, + 0xCB, 0xBB, 0xBB, 0xCC, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDD, + 0xDD, 0xDE, 0xDE, 0xFF, 0xFF, 0xFF, 0xCF, 0xFE, 0xFE, 0xFE, 0xEF, 0xDD, + 0xDF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xAA, 0x99, 0xA9, 0x89, 0x89, 0x99, 0x98, 0x99, 0xBB, 0x6B, 0xAB, + 0xBA, 0xAA, 0x99, 0x99, 0x99, 0xBA, 0xAB, 0xBE, 0xFB, 0x9B, 0xAA, 0x99, + 0x99, 0x99, 0x99, 0xA9, 0xAC, 0x9B, 0xBA, 0xC9, 0xB9, 0xA9, 0x99, 0x88, + 0x89, 0x88, 0x89, 0xAA, 0xAA, 0xBA, 0x99, 0x99, 0x88, 0x88, 0x77, 0x87, + 0x88, 0x89, 0xAA, 0xAA, 0xA9, 0x9A, 0x88, 0x87, 0x77, 0x77, 0x78, 0x88, + 0x99, 0xAA, 0xA9, 0x9A, 0x99, 0x87, 0x76, 0x66, 0x67, 0x77, 0x88, 0x99, + 0xBB, 0xA9, 0x99, 0x88, 0x77, 0x66, 0x66, 0x66, 0x78, 0x88, 0x99, 0xB9, + 0x9A, 0x98, 0x87, 0x66, 0x55, 0x56, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x99, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x77, 0x78, 0x8A, 0xA9, 0x99, 0x99, 0x87, + 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xA8, 0x99, 0x98, 0x76, 0x66, + 0x55, 0x56, 0x67, 0x78, 0x99, 0xA9, 0x99, 0x98, 0x98, 0x77, 0x66, 0x66, + 0x67, 0x78, 0x98, 0x9B, 0xA9, 0x99, 0x98, 0x87, 0x77, 0x66, 0x77, 0x77, + 0x89, 0x99, 0xCA, 0x9A, 0xA9, 0x88, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xAB, 0x99, 0xBA, 0x99, 0x88, 0x88, 0x87, 0x88, 0x88, 0x89, 0x9B, 0xB9, + 0xAB, 0xA9, 0xAA, 0x88, 0x88, 0x88, 0x88, 0x9A, 0xBA, 0xAB, 0xA9, 0xEA, + 0xAA, 0x9A, 0xA9, 0x9A, 0x89, 0x99, 0x9A, 0xAC, 0xAB, 0xAC, 0xDA, 0xBA, + 0xAA, 0x9A, 0x99, 0xAA, 0xAB, 0xBA, 0xCC, 0xAA, 0xFB, 0xDB, 0xBA, 0xAA, + 0xAA, 0xBA, 0xBB, 0xBB, 0xFC, 0xFB, 0x7A, 0x99, 0x99, 0x99, 0x99, 0x99, + 0x99, 0x9A, 0xAA, 0xAB, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xA9, 0xAA, 0xBB, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0x98, 0x77, 0x89, 0xAF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xA8, 0x54, 0x46, 0x8A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xDA, 0x74, 0x12, 0x47, 0xAB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xA7, 0x42, 0x24, 0x79, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0x86, + 0x44, 0x57, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xB9, 0x87, 0x77, + 0x9B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xBA, 0x9A, 0xAB, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0x8A, 0x98, 0x88, 0x87, 0x77, 0xF7, 0x6F, 0x88, 0x8F, 0xAA, 0x59, 0xFA, + 0xAF, 0xAF, 0x8A, 0x87, 0x8A, 0xA8, 0xFA, 0xA9, 0xF9, 0x9A, 0xAF, 0x98, + 0x9A, 0x79, 0x89, 0x78, 0x9A, 0xFA, 0xFF, 0xAC, 0x88, 0x8F, 0x87, 0x88, + 0xA8, 0x89, 0x9A, 0x87, 0xAF, 0xFA, 0x7A, 0xA9, 0x87, 0x78, 0x77, 0x98, + 0x78, 0x89, 0xAA, 0xFA, 0xA8, 0x98, 0x99, 0x87, 0x78, 0x87, 0x77, 0x87, + 0x87, 0xFA, 0xE8, 0x8B, 0x97, 0x76, 0x88, 0x77, 0x67, 0x77, 0x78, 0x78, + 0x8A, 0x87, 0xA9, 0x8F, 0x77, 0x77, 0x67, 0x97, 0x88, 0x78, 0x99, 0xA8, + 0x79, 0x89, 0x77, 0x76, 0x66, 0x76, 0x77, 0x77, 0x8F, 0x89, 0x98, 0xF9, + 0x88, 0x97, 0x66, 0x57, 0x67, 0x78, 0x77, 0xA9, 0x88, 0x78, 0x87, 0x87, + 0x66, 0x66, 0x66, 0x67, 0x68, 0x97, 0xF9, 0x88, 0xA8, 0x78, 0x87, 0x76, + 0x66, 0x77, 0x68, 0x77, 0x88, 0x89, 0x99, 0xA8, 0x78, 0x77, 0x77, 0x76, + 0x67, 0x76, 0x77, 0x89, 0xA9, 0x8A, 0x87, 0x87, 0x77, 0x68, 0x76, 0x76, + 0x88, 0x9A, 0x9A, 0xAA, 0xA7, 0x97, 0x87, 0x87, 0x87, 0x77, 0x99, 0x77, + 0x9A, 0x87, 0x9A, 0x99, 0x79, 0x79, 0x76, 0x87, 0x98, 0x99, 0xA8, 0x88, + 0x98, 0x9A, 0xA9, 0x99, 0x97, 0x98, 0x8A, 0x98, 0x9A, 0xFF, 0xA8, 0xFA, + 0x7F, 0x8A, 0x8F, 0x98, 0x8A, 0xA8, 0xFF, 0xF9, 0xA8, 0xAF, 0x99, 0x99, + 0x88, 0x99, 0xAA, 0x98, 0x9A, 0xAA, 0xAF, 0xAA, 0xFA, 0xF9, 0x9A, 0xFA, + 0xF9, 0x8A, 0xA8, 0x98, 0xAF, 0xA9, 0x9F, 0xFA, 0x89, 0x87, 0x78, 0x98, + 0x87, 0x8A, 0x87, 0x99, 0x90, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xFF, 0xBF, 0xFF, 0xFF, 0x6F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xBF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0x88, 0xAB, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xF8, 0x65, 0x57, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0x84, 0x12, 0x58, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF8, 0x52, 0x14, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0x96, + 0x54, 0x68, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xA8, 0x89, + 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEB, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFB, 0xFF, 0xFF, 0xFF, 0xBF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xEF, 0xFE, 0xEF, 0xFF, 0xFE, 0xEE, 0xE5, 0xFF, 0xFF, 0xFF, 0xFE, + 0xEE, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEE, + 0xEE, 0xEE, 0x4E, 0xEE, 0xEE, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0x5F, 0xFF, + 0xFF, 0xF5, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEE, 0x5E, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE5, 0xE5, + 0xEE, 0xEE, 0xEE, 0xEF, 0xFF, 0x55, 0xF5, 0x5F, 0xF5, 0xFF, 0x5F, 0x5F, + 0xFF, 0xFF, 0xF4, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x55, 0xFF, 0xFF, 0xFF, + 0xFF, 0xF5, 0xFF, 0xF5, 0xFF, 0x5F, 0x4F, 0xFE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xE3, 0xE5, 0xEE, 0x5E, 0xEE, 0xEE, 0xEE, 0xE5, 0x4E, + 0xEE, 0x5E, 0x5E, 0xE5, 0x5E, 0x5E, 0x55, 0xEE, 0xEE, 0x54, 0xEE, 0xE5, + 0x5E, 0xE5, 0xE6, 0x5E, 0xEE, 0xEE, 0xEE, 0xEF, 0xF5, 0xFF, 0xF5, 0xFF, + 0xF5, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5F, 0xF5, 0xFF, 0x5F, 0xFF, + 0xF5, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF5, 0xFF, 0x5F, 0xF5, 0x5F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF4, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF5, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x5F, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0x5F, + 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFE, 0xFE, 0xFF, + 0xFF, 0xFF, 0xFE, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0x78, 0xF6, 0x66, 0x68, 0x76, 0x67, 0x67, 0x98, 0x78, 0x7F, 0x68, 0x98, + 0x9F, 0xF8, 0xF7, 0xFE, 0x8F, 0xFF, 0x9F, 0xFF, 0x9F, 0x88, 0x7F, 0x88, + 0x9F, 0x79, 0x9F, 0xFF, 0x8F, 0x9F, 0xF9, 0x96, 0x99, 0x97, 0x78, 0x67, + 0xF7, 0x98, 0xFF, 0x79, 0x99, 0xF8, 0x77, 0xF8, 0x89, 0x97, 0x78, 0x89, + 0xF7, 0x8F, 0xFF, 0xFF, 0x78, 0x99, 0x79, 0x97, 0x97, 0x77, 0x99, 0x7F, + 0x79, 0x99, 0x98, 0x77, 0x9F, 0x67, 0x67, 0x67, 0x78, 0x98, 0x9F, 0x99, + 0x89, 0xF6, 0x9F, 0x79, 0x78, 0x76, 0x66, 0xF8, 0x78, 0x89, 0x78, 0xF8, + 0x87, 0x88, 0x99, 0x87, 0x77, 0x69, 0x79, 0x78, 0xF7, 0x9F, 0x77, 0xF9, + 0x99, 0x76, 0x77, 0x77, 0x68, 0x87, 0x78, 0x9F, 0x97, 0x88, 0x78, 0x89, + 0x97, 0x76, 0x77, 0x77, 0x89, 0x8F, 0x8F, 0x67, 0x89, 0x98, 0x89, 0x78, + 0x77, 0x87, 0x78, 0x79, 0x78, 0x96, 0x68, 0x9F, 0xA8, 0x97, 0x78, 0x78, + 0x8F, 0x89, 0x79, 0x8F, 0x67, 0xFF, 0x8F, 0x99, 0x77, 0x66, 0x66, 0x76, + 0x86, 0xF8, 0xF6, 0x99, 0x9F, 0x7F, 0x89, 0x97, 0x79, 0x88, 0x6F, 0x88, + 0x89, 0x68, 0xFF, 0xFF, 0xF9, 0x98, 0x89, 0xF8, 0xFF, 0x98, 0x9F, 0xF7, + 0x78, 0x79, 0xF9, 0x77, 0x89, 0xF8, 0x97, 0x89, 0xF9, 0x98, 0x77, 0x9F, + 0x9F, 0x89, 0x9F, 0x99, 0x98, 0x9F, 0x99, 0x9F, 0x98, 0x89, 0x98, 0xFF, + 0x9F, 0xF8, 0xF9, 0x88, 0x9F, 0x7F, 0xF9, 0x67, 0xFF, 0x99, 0x98, 0xF9, + 0xFF, 0x89, 0x9F, 0xFF, 0x9F, 0xF9, 0x59, 0x77, 0x98, 0x68, 0x96, 0x77, + 0x68, 0x89, 0xF7, 0x6F, 0x60, 0x00, 0x00, 0x00, + }, + { + 0x68, 0x89, 0x78, 0x77, 0x67, 0x88, 0x88, 0xFF, 0x79, 0x99, 0x69, 0xF9, + 0xF9, 0x88, 0x87, 0x79, 0x8F, 0xF9, 0xF8, 0xF9, 0xF7, 0x8F, 0x98, 0x78, + 0x79, 0xF9, 0xF8, 0x88, 0x79, 0x7F, 0xF9, 0x97, 0xFF, 0x8F, 0x98, 0x78, + 0x77, 0x67, 0xF8, 0xF9, 0xFF, 0xF9, 0x78, 0xF8, 0x88, 0x87, 0x88, 0x77, + 0x98, 0xF7, 0x98, 0xFF, 0x98, 0x9F, 0xF8, 0x98, 0x87, 0x76, 0x79, 0x97, + 0x78, 0x89, 0x8C, 0x77, 0x88, 0x78, 0x77, 0x77, 0x88, 0x77, 0x78, 0x79, + 0x9F, 0x88, 0x79, 0x77, 0x77, 0x77, 0x67, 0x77, 0x77, 0x8F, 0x99, 0x97, + 0x87, 0x77, 0x78, 0x87, 0x78, 0x76, 0x77, 0x78, 0x9F, 0x99, 0xF7, 0x77, + 0x98, 0x76, 0x76, 0x77, 0x68, 0x7F, 0x78, 0xFF, 0xF9, 0x78, 0x88, 0x87, + 0x88, 0x76, 0x67, 0x88, 0x79, 0x78, 0xF9, 0x87, 0x89, 0x97, 0x77, 0x68, + 0x67, 0x77, 0x77, 0x77, 0x8E, 0x78, 0x78, 0x8A, 0x88, 0x77, 0x87, 0x77, + 0x67, 0x88, 0x88, 0x8F, 0x87, 0x89, 0x88, 0x77, 0x76, 0x77, 0x79, 0x77, + 0x77, 0x8F, 0x88, 0x79, 0xF8, 0x77, 0x78, 0x77, 0x88, 0x77, 0x78, 0x98, + 0x89, 0x89, 0xFF, 0xF8, 0x88, 0x99, 0x77, 0x98, 0x78, 0x87, 0x99, 0x99, + 0x98, 0xF8, 0x98, 0xFF, 0xFF, 0x79, 0x88, 0x77, 0x79, 0x8F, 0x88, 0xF8, + 0x88, 0xFF, 0x88, 0x78, 0x99, 0x9F, 0x88, 0xF9, 0xF8, 0x88, 0x99, 0xB9, + 0xF7, 0x88, 0x99, 0xF9, 0x99, 0x9F, 0xFF, 0x99, 0xFF, 0x8F, 0x98, 0x8F, + 0x89, 0x99, 0xF8, 0x99, 0x8F, 0xF9, 0x5F, 0x89, 0x77, 0x87, 0x99, 0x78, + 0x88, 0x77, 0xF8, 0x8F, 0x80, 0x00, 0x00, 0x00, + }, + { + 0x5E, 0xDE, 0xE5, 0xDE, 0xEE, 0xED, 0xDD, 0xDE, 0xEE, 0xEE, 0x4E, 0xED, + 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xED, + 0xDD, 0x4D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0x5E, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xDD, + 0x5D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD5, 0x45, 0xDD, + 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xE5, 0xEE, 0xEE, 0xE5, 0xEE, 0xEE, + 0x5E, 0xEE, 0xEE, 0xEE, 0xE5, 0xE5, 0xEE, 0xE5, 0x54, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0x45, 0xEE, 0xEE, 0x55, 0xEE, 0xEE, 0xE5, 0xED, 0xDD, 0xDD, + 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0x5D, 0xDD, 0xDD, 0xDD, 0x55, 0xDD, 0xDD, + 0x55, 0x5D, 0x4D, 0xDD, 0xDD, 0x45, 0xDD, 0x5D, 0xDD, 0xDD, 0xDD, 0xDD, + 0x54, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, 0x5E, 0xEE, 0x5E, 0xEE, + 0xEE, 0x5E, 0xEE, 0xEE, 0xE5, 0xEE, 0xEE, 0xEE, 0x4E, 0xEE, 0x4E, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x5E, 0xEE, 0xE4, 0xE5, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE5, 0xEE, 0xEE, 0xEE, 0x5E, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x55, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE5, 0x5E, 0xEE, 0xEE, 0xEE, 0xEE, 0xED, + 0xEE, 0xED, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE5, 0xED, 0xED, + 0xEE, 0xEE, 0xEE, 0x5E, 0xEE, 0xEE, 0xED, 0xED, 0xEE, 0xE5, 0xEE, 0xEE, + 0xED, 0xED, 0xED, 0xEE, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xF9, 0xF8, 0xF9, 0x4F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xF8, 0x64, 0x68, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0x85, 0x12, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x52, 0x14, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, + 0x54, 0x5F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x59, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xF7, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0x7F, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF, 0xF6, + 0xF6, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF7, 0xF6, 0xFF, 0xF6, 0xFF, 0xFF, 0xFF, 0xF6, 0xFF, 0xFF, 0x66, 0xF6, + 0xFF, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x57, 0x67, 0x6F, 0xFF, + 0xFF, 0xFF, 0xFD, 0xBF, 0xF7, 0xF7, 0x6F, 0x66, 0x6F, 0x66, 0xF6, 0xFF, + 0xFF, 0xF6, 0xF6, 0xFF, 0x75, 0x76, 0xF5, 0x66, 0x66, 0x66, 0xFF, 0xFF, + 0xF6, 0xFF, 0xFF, 0xF5, 0x57, 0x66, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xF6, + 0xFF, 0x56, 0x56, 0x75, 0x77, 0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xF7, 0xF6, + 0xF6, 0xF6, 0x44, 0xF5, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x66, + 0x56, 0x75, 0x56, 0xF6, 0xFF, 0xFD, 0xC6, 0xAF, 0xF6, 0x6F, 0xFF, 0x55, + 0x57, 0x5F, 0x7F, 0xFF, 0xFF, 0xF7, 0xFF, 0xFF, 0x65, 0x6F, 0xFF, 0x68, + 0x7F, 0xFF, 0xFF, 0x6F, 0xFF, 0xF6, 0xF6, 0x5F, 0x65, 0x6F, 0x6F, 0xFF, + 0xFF, 0xFF, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xF6, 0x6F, 0xFF, 0xFF, 0xFF, + 0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF6, 0xFF, 0xFF, + 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5F, 0x7F, 0x7F, 0xFF, 0xFF, 0x7F, + 0xFF, 0x7F, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFD, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF6, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x12, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x61, 0x15, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF5, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + }, + { + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + { + 0xEE, 0xEE, 0xEE, 0xDE, 0xEE, 0xEE, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xED, + 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xED, + 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, + 0x5E, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x5E, 0xED, + 0xD5, 0x55, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, + 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xE5, 0xE5, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE5, 0xEE, 0xE5, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0x5E, 0x5E, 0xEE, 0x55, 0x54, 0xEE, 0xEE, 0xEE, 0xEE, 0xED, + 0xDD, 0xDD, 0xD5, 0x5D, 0x44, 0x5D, 0xDD, 0xDD, 0xDD, 0xDD, 0x5D, 0xD5, + 0xD5, 0x5D, 0xDD, 0xD3, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0x5D, + 0xD4, 0x35, 0x5D, 0xDD, 0xDD, 0xDD, 0xDD, 0xD5, 0x5E, 0xE4, 0x54, 0x53, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE5, 0xEE, 0xEE, 0x5E, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xE5, 0xEE, 0x5E, 0xEE, 0xE5, 0x5E, 0xEE, 0x5E, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0x5E, 0xEE, 0xE4, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xE5, 0xEE, 0xEE, 0xED, 0xEE, 0xED, 0xDD, 0xED, 0xED, 0xED, 0xED, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xED, 0xEE, 0xEE, 0xED, + 0xEE, 0xED, 0xED, 0xEE, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xDC, 0xCD, 0xCC, 0xCC, 0xDC, 0xDD, 0xFF, 0xFF, 0xFF, 0xDD, 0xEF, + 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xDF, 0xEF, 0xFF, 0xFF, 0xDF, 0xFD, 0xDC, + 0xBB, 0xBB, 0xAA, 0xBB, 0xCD, 0xDF, 0xFF, 0xFD, 0xED, 0xCC, 0xBB, 0xA9, + 0x99, 0x99, 0xAA, 0xBC, 0xDF, 0xFF, 0xCD, 0xCC, 0xBA, 0x99, 0x88, 0x88, + 0x89, 0x9A, 0xBC, 0xDF, 0xEC, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x88, + 0x9A, 0xBC, 0xEE, 0xDD, 0xBA, 0xA8, 0x87, 0x76, 0x66, 0x67, 0x88, 0x9A, + 0xCD, 0xDD, 0xDB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x67, 0x89, 0xAB, 0xCD, + 0xCC, 0xA9, 0x87, 0x76, 0x55, 0x55, 0x56, 0x77, 0x89, 0xBD, 0xDC, 0xCB, + 0x98, 0x76, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBD, 0xCC, 0xA9, 0x87, + 0x65, 0x55, 0x55, 0x56, 0x67, 0x89, 0xAD, 0xCD, 0xCA, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x66, 0x78, 0x9A, 0xCC, 0xDC, 0xB9, 0x87, 0x66, 0x55, 0x55, + 0x56, 0x77, 0x8A, 0xBC, 0xDD, 0xDB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x67, + 0x89, 0xAB, 0xCD, 0xEC, 0xCA, 0x98, 0x87, 0x66, 0x66, 0x77, 0x88, 0x9A, + 0xBC, 0xDE, 0xDC, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x89, 0x9A, 0xBC, 0xDC, + 0xFE, 0xEC, 0xBA, 0x99, 0x88, 0x88, 0x89, 0x9A, 0xBC, 0xCD, 0xDF, 0xFE, + 0xDC, 0xBB, 0xA9, 0x99, 0x9A, 0xAA, 0xBC, 0xCD, 0xEE, 0xFF, 0xFF, 0xDC, + 0xCB, 0xBA, 0xAB, 0xBB, 0xCC, 0xDD, 0xDE, 0xDF, 0xFF, 0xFF, 0xED, 0xCC, + 0xCC, 0xCC, 0xCC, 0xDD, 0xEF, 0xED, 0xDF, 0xFF, 0xDF, 0xDD, 0xDD, 0xDC, + 0xCC, 0xCD, 0xED, 0xCE, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xEE, 0xEE, 0xEE, 0xDE, 0xEE, 0xEE, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xED, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x4E, + 0xEE, 0xED, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xD4, 0xDD, + 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0x4E, 0x4E, 0x4E, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x4E, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xE4, 0xE3, 0x4D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, + 0xDD, 0xDD, 0xDD, 0x4D, 0x4D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, + 0x44, 0x4D, 0x4D, 0xDD, 0xDD, 0xDD, 0xDD, 0x4E, 0xE4, 0xEE, 0x3E, 0x4E, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE3, 0xEE, 0xE5, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE4, 0xEE, 0xEE, 0xEE, 0x4E, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x4E, 0x3E, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE4, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0x4E, 0xEE, 0x4E, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xED, 0xED, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + { + 0x9C, 0xBB, 0xAA, 0xAA, 0xAA, 0x9A, 0xAA, 0xAB, 0xBC, 0xCD, 0xBB, 0xCC, + 0xBB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDC, 0xBC, 0xCB, 0xAA, + 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xAB, 0xCD, 0xDB, 0xCB, 0xAA, 0x99, 0x99, + 0x88, 0x88, 0x89, 0x9A, 0xBB, 0xCC, 0xAB, 0xAA, 0xA9, 0x98, 0x88, 0x88, + 0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBB, 0xAA, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x77, 0x78, 0x89, + 0xAB, 0xBA, 0xAA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA, + 0xAA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA, 0xA9, + 0x88, 0x76, 0x66, 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xAA, 0x98, 0x87, + 0x66, 0x65, 0x55, 0x56, 0x67, 0x88, 0x9A, 0xAA, 0xA9, 0x88, 0x76, 0x66, + 0x55, 0x56, 0x66, 0x78, 0x99, 0xAA, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x56, + 0x66, 0x77, 0x89, 0x9A, 0xAA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x88, 0x99, 0xAA, 0xAB, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x77, 0x78, 0x89, + 0xAB, 0xAB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0xAA, 0xBA, + 0xBB, 0xBA, 0x99, 0x98, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBC, 0xCC, + 0xBA, 0x99, 0x98, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xBB, 0xDD, 0xCC, 0xBA, + 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBD, 0xDD, 0xCB, 0xBB, 0xAA, + 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCB, 0xBC, 0xCB, 0xBA, 0xAA, 0xA9, 0x9A, + 0xAA, 0xAA, 0xBA, 0xBC, 0x90, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0x9A, 0xBB, 0xCC, 0xBB, 0xCC, + 0xCA, 0xAA, 0xAA, 0x9A, 0xA9, 0xAA, 0xBB, 0xBD, 0xDC, 0xBC, 0xBB, 0xAA, + 0xA9, 0x99, 0x98, 0x99, 0xA9, 0xAB, 0xBB, 0xCB, 0xBA, 0xAA, 0x99, 0x88, + 0x88, 0x88, 0x89, 0x99, 0xAB, 0xBB, 0xAA, 0xA9, 0x98, 0x88, 0x88, 0x77, + 0x88, 0x88, 0x9A, 0xAB, 0xAA, 0xAA, 0x98, 0x88, 0x77, 0x77, 0x77, 0x78, + 0x88, 0x99, 0xBA, 0x9A, 0x99, 0x88, 0x77, 0x76, 0x66, 0x77, 0x77, 0x89, + 0x9A, 0xA9, 0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77, 0x78, 0x89, 0xAA, + 0x99, 0x98, 0x87, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0x99, 0x99, + 0x88, 0x76, 0x66, 0x66, 0x66, 0x67, 0x77, 0x89, 0x99, 0x99, 0x98, 0x77, + 0x66, 0x66, 0x56, 0x66, 0x67, 0x78, 0x99, 0x99, 0xA9, 0x87, 0x76, 0x66, + 0x66, 0x66, 0x66, 0x77, 0x89, 0xA9, 0x99, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x88, 0x99, 0x99, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x78, 0x89, 0xA9, 0xAA, 0x99, 0x88, 0x77, 0x76, 0x67, 0x77, 0x78, 0x89, + 0x9A, 0x9A, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, 0x88, 0x9A, 0xB9, + 0xAB, 0xAA, 0x99, 0x88, 0x87, 0x77, 0x88, 0x89, 0x99, 0xAB, 0xAB, 0xCA, + 0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x99, 0xAB, 0xBB, 0xBB, 0xBB, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xBC, 0xCC, 0xCB, 0xAA, 0x9A, + 0x99, 0x9A, 0x9A, 0xAB, 0xBC, 0xCC, 0xBC, 0xCA, 0xAA, 0xA9, 0x99, 0x99, + 0x99, 0x9A, 0xAA, 0xAB, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xBB, 0xCC, + 0xBB, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0xCC, 0xBC, 0xBA, 0xAA, + 0x99, 0x99, 0x89, 0x99, 0x99, 0xAA, 0xBC, 0xBA, 0xBA, 0xA9, 0x99, 0x88, + 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xAA, 0xA9, 0x98, 0x88, 0x87, 0x77, + 0x88, 0x88, 0x99, 0xAA, 0xAA, 0xA9, 0x98, 0x88, 0x77, 0x77, 0x77, 0x77, + 0x88, 0x99, 0xAA, 0x9A, 0x99, 0x88, 0x77, 0x77, 0x67, 0x77, 0x77, 0x89, + 0x9A, 0x99, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x66, 0x77, 0x78, 0x89, 0xA9, + 0x99, 0x98, 0x87, 0x76, 0x66, 0x66, 0x66, 0x77, 0x78, 0x99, 0x99, 0x98, + 0x87, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x89, 0x99, 0x99, 0x88, 0x77, + 0x76, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0x99, 0x99, 0x87, 0x77, 0x66, + 0x66, 0x66, 0x67, 0x77, 0x89, 0x99, 0x99, 0x98, 0x77, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x88, 0x99, 0x99, 0x99, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x78, 0x89, 0xA9, 0x9A, 0x98, 0x87, 0x77, 0x77, 0x67, 0x77, 0x78, 0x89, + 0x9A, 0x9A, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, 0x88, 0x99, 0xA9, + 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77, 0x88, 0x88, 0x99, 0xAB, 0xAA, 0xBA, + 0xA9, 0x98, 0x88, 0x88, 0x88, 0x89, 0x99, 0xAA, 0xBA, 0xBB, 0xBA, 0xA9, + 0x99, 0x99, 0x89, 0x99, 0x99, 0xAA, 0xBB, 0xBC, 0xCB, 0xBB, 0xAA, 0xA9, + 0x99, 0x99, 0xAA, 0xAA, 0xBC, 0xCB, 0xBC, 0xBB, 0xAA, 0x99, 0x99, 0x99, + 0x99, 0x9A, 0xAA, 0xBB, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9C, 0xBA, 0xAA, 0x9A, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xCB, 0xAB, 0xCC, + 0xBA, 0xAA, 0xA9, 0x99, 0xA9, 0xAA, 0xAA, 0xBC, 0xCC, 0xAC, 0xBA, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xBB, 0xCB, 0xA9, 0x99, 0x88, + 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCC, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, + 0x78, 0x88, 0x99, 0xAA, 0xAA, 0xBA, 0x98, 0x88, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xAA, 0x9A, 0x99, 0x88, 0x77, 0x76, 0x67, 0x77, 0x77, 0x88, + 0x9A, 0x99, 0x99, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x89, 0xA9, + 0x99, 0x98, 0x77, 0x76, 0x66, 0x66, 0x66, 0x67, 0x88, 0x89, 0x99, 0x98, + 0x87, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0xA9, 0x99, 0x98, 0x87, + 0x66, 0x66, 0x66, 0x66, 0x67, 0x78, 0x89, 0x99, 0x99, 0x87, 0x76, 0x66, + 0x66, 0x66, 0x67, 0x77, 0x89, 0x99, 0x9A, 0x88, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x88, 0x9A, 0x99, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x66, 0x77, + 0x78, 0x89, 0xA9, 0xAA, 0x99, 0x87, 0x77, 0x77, 0x67, 0x77, 0x77, 0x89, + 0x9A, 0xAA, 0xBA, 0x98, 0x88, 0x77, 0x77, 0x77, 0x78, 0x89, 0x99, 0xAA, + 0xAB, 0xAA, 0x98, 0x88, 0x87, 0x77, 0x88, 0x89, 0x9A, 0xAB, 0xAA, 0xBA, + 0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAA, 0xBB, 0xCC, 0xBA, 0xA9, + 0xA9, 0x99, 0x98, 0x99, 0x99, 0xAB, 0xAB, 0xAC, 0xCC, 0xBA, 0xAA, 0xA9, + 0x99, 0x9A, 0x9A, 0xBB, 0xBC, 0xCB, 0xBC, 0xBB, 0xAA, 0xA9, 0x99, 0x99, + 0x9A, 0x9A, 0xAA, 0xBB, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBB, 0xAA, 0xAA, 0xA9, 0xAA, 0xAA, 0xBB, 0xBC, 0xDD, 0xCB, 0xDC, + 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDD, 0xCC, 0xBB, 0xAA, + 0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xCD, 0xDB, 0xBB, 0xAA, 0x99, 0x88, + 0x88, 0x88, 0x99, 0x9A, 0xBC, 0xCC, 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, + 0x88, 0x89, 0x9A, 0xAB, 0xBA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBB, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x66, 0x77, 0x78, 0x89, + 0xAB, 0xAA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA, + 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0xA9, + 0x88, 0x76, 0x66, 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xAA, 0x98, 0x87, + 0x66, 0x65, 0x55, 0x66, 0x67, 0x88, 0x9A, 0xA9, 0xA9, 0x88, 0x76, 0x66, + 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x88, 0x9A, 0xAA, 0xB9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67, + 0x78, 0x99, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x77, 0x78, 0x89, + 0x9A, 0xAA, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x78, 0x89, 0x9A, 0xBA, + 0xBC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xAC, 0xCB, + 0xBA, 0x99, 0x98, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBB, 0xDC, 0xCB, 0xBA, + 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCD, 0xDD, 0xCB, 0xBA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDB, 0xBD, 0xCC, 0xBB, 0xAA, 0xAA, 0xAA, + 0x9A, 0xAA, 0xBB, 0xBC, 0x90, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xDC, 0xDD, 0xCC, 0xCC, 0xCD, 0xDE, 0xED, 0xFF, 0xFF, 0xCF, 0xFF, + 0xEE, 0xDD, 0xDC, 0xCD, 0xCD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, 0xDC, + 0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEF, 0xFF, 0xFF, 0xFE, 0xDC, 0xBB, 0xAA, + 0xA9, 0xAA, 0xAB, 0xCD, 0xEF, 0xFF, 0xDD, 0xCC, 0xBA, 0x99, 0x88, 0x88, + 0x99, 0xAB, 0xCD, 0xEF, 0xFD, 0xDC, 0xBA, 0x99, 0x88, 0x77, 0x78, 0x89, + 0xAB, 0xCE, 0xFE, 0xDD, 0xCA, 0x98, 0x87, 0x76, 0x66, 0x77, 0x89, 0xAB, + 0xDF, 0xFD, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x77, 0x9A, 0xBC, 0xEE, + 0xDC, 0xBA, 0x97, 0x76, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xED, 0xCB, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xDC, 0xB9, 0x87, + 0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xDD, 0xCB, 0xA8, 0x76, 0x55, + 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xDD, 0xBA, 0x98, 0x76, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xCD, 0xDE, 0xDC, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x9A, 0xBC, 0xDD, 0xFD, 0xDB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x99, 0xAC, + 0xCD, 0xDF, 0xFD, 0xCB, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xEF, + 0xFF, 0xFD, 0xCB, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xCD, 0xEF, 0xDF, 0xFE, + 0xED, 0xCB, 0xBA, 0xAA, 0xAB, 0xBC, 0xCC, 0xDE, 0xFF, 0xFF, 0xFF, 0xFD, + 0xDC, 0xBC, 0xCB, 0xCC, 0xCD, 0xDE, 0xFF, 0xEF, 0xFF, 0xFF, 0xFE, 0xEE, + 0xDD, 0xDE, 0xDE, 0xEF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xEE, 0xED, 0xDD, + 0xEE, 0xDF, 0xEE, 0xFE, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xDC, 0xCC, 0xCC, 0xCB, 0xCC, 0xCC, 0xEF, 0xFF, 0xDF, 0xCD, 0xFF, + 0xCD, 0xCC, 0xCC, 0xCC, 0xBD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDC, 0xBB, + 0xBB, 0xAB, 0xBA, 0xBC, 0xDC, 0xDF, 0xFF, 0xFD, 0xDC, 0xCB, 0xAA, 0xA9, + 0x99, 0x9A, 0xBB, 0xBC, 0xFF, 0xFF, 0xCC, 0xDB, 0xA9, 0x99, 0x88, 0x88, + 0x89, 0xAB, 0xCC, 0xDF, 0xFC, 0xDC, 0xA9, 0x98, 0x87, 0x77, 0x78, 0x89, + 0xAB, 0xCD, 0xFF, 0xBC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCF, 0xFC, 0xBB, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xCF, + 0xCC, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xFC, 0xBB, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xCB, 0xA8, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xEC, 0xBA, 0x87, 0x76, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xBD, 0xCD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x77, + 0x89, 0xAB, 0xCC, 0xDD, 0xDB, 0x99, 0x87, 0x77, 0x77, 0x77, 0x89, 0xAB, + 0xBC, 0xCF, 0xFD, 0xBB, 0xA9, 0x88, 0x88, 0x88, 0x89, 0x9B, 0xCC, 0xFC, + 0xFF, 0xDD, 0xBA, 0x9A, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xFD, 0xDF, 0xFD, + 0xFD, 0xCB, 0xAA, 0xAA, 0xAA, 0xAA, 0xBC, 0xCF, 0xFD, 0xFF, 0xFF, 0xDC, + 0xCB, 0xBB, 0xBB, 0xBB, 0xCD, 0xDD, 0xDF, 0xDF, 0xFF, 0xFF, 0xFD, 0xFD, + 0xCC, 0xCC, 0xFC, 0xCD, 0xFE, 0xFE, 0xDF, 0xFF, 0xFD, 0xDD, 0xFC, 0xDC, + 0xDD, 0xCC, 0xCE, 0xFD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xCF, 0xDD, 0xDC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEF, 0xFF, 0xFF, 0xFD, 0xFE, + 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCE, 0xFF, 0xFF, 0xFF, 0xEF, 0xDD, 0xCB, + 0xBB, 0xAA, 0xAA, 0xBB, 0xCC, 0xDF, 0xFF, 0xFD, 0xED, 0xCB, 0xAA, 0xA9, + 0x99, 0x99, 0xAA, 0xBC, 0xDF, 0xFF, 0xDD, 0xCB, 0xAA, 0x99, 0x88, 0x88, + 0x89, 0x9A, 0xBD, 0xEF, 0xFC, 0xDB, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x88, + 0x9A, 0xBD, 0xFF, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x67, 0x89, 0xAB, + 0xCD, 0xFC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x67, 0x89, 0xAB, 0xDF, + 0xCC, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xCA, + 0x98, 0x76, 0x55, 0x55, 0x55, 0x66, 0x78, 0xAB, 0xCD, 0xCC, 0xA9, 0x87, + 0x65, 0x55, 0x45, 0x56, 0x67, 0x8A, 0xBD, 0xDC, 0xCA, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x79, 0xAB, 0xCD, 0xDC, 0xB9, 0x87, 0x66, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xBD, 0xDE, 0xDB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x77, + 0x89, 0xAC, 0xCD, 0xFD, 0xCB, 0x98, 0x87, 0x76, 0x67, 0x77, 0x89, 0xAB, + 0xCD, 0xDF, 0xFD, 0xBA, 0x99, 0x88, 0x77, 0x78, 0x89, 0xAA, 0xBC, 0xDD, + 0xFF, 0xFD, 0xBA, 0xA9, 0x99, 0x89, 0x99, 0xAA, 0xBC, 0xDD, 0xEF, 0xFF, + 0xED, 0xCB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xFF, 0xFF, 0xFF, 0xED, + 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xEF, 0xFF, 0xFF, 0xFE, 0xDD, + 0xCC, 0xCC, 0xDD, 0xEE, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFD, 0xED, 0xDD, + 0xDD, 0xDD, 0xED, 0xEE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xAE, 0xCD, 0xCC, 0xEC, 0xCD, 0xCC, 0xCD, 0xEF, 0xFF, 0xFF, 0xDD, 0xFD, + 0xDC, 0xDC, 0xCD, 0xCC, 0xDD, 0xED, 0xDF, 0xFF, 0xFF, 0xCF, 0xDF, 0xCC, + 0xBB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDF, 0xFF, 0xFD, 0xFD, 0xCB, 0xBB, 0xAA, + 0x99, 0xA9, 0xAB, 0xCD, 0xFF, 0xFF, 0xDE, 0xCB, 0xBA, 0x99, 0x88, 0x88, + 0x89, 0xAA, 0xCD, 0xFF, 0xFD, 0xDC, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x88, + 0x9A, 0xBD, 0xFD, 0xCC, 0xBA, 0x99, 0x87, 0x66, 0x66, 0x67, 0x88, 0xAC, + 0xCF, 0xEC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x67, 0x89, 0xAC, 0xDD, + 0xDD, 0xBA, 0x97, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xDC, 0xCB, + 0x98, 0x76, 0x55, 0x54, 0x55, 0x67, 0x79, 0xAB, 0xDD, 0xDC, 0xB9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x77, 0x9A, 0xBC, 0xDD, 0xCB, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAC, 0xBD, 0xDC, 0xB9, 0x97, 0x66, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xCD, 0xCD, 0xDB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78, + 0x99, 0xAC, 0xDC, 0xFE, 0xCA, 0x98, 0x87, 0x76, 0x67, 0x78, 0x99, 0xAC, + 0xCD, 0xCD, 0xED, 0xBA, 0x99, 0x88, 0x78, 0x88, 0x99, 0xAB, 0xCD, 0xDC, + 0xFF, 0xFC, 0xBA, 0xA9, 0x99, 0x89, 0x99, 0xAB, 0xBC, 0xDD, 0xCF, 0xFF, + 0xFD, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xCB, 0xCD, 0xDC, 0xFF, 0xFF, 0xDD, + 0xCC, 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xFF, 0xDF, 0xFF, 0xFF, 0xEE, 0xDE, + 0xDC, 0xCD, 0xDF, 0xEE, 0xFF, 0xFD, 0xDF, 0xFF, 0xEE, 0xDC, 0xDD, 0xCC, + 0xCC, 0xCC, 0xCC, 0xFD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAE, 0xED, 0xDE, 0xDD, 0xDD, 0xDE, 0xDF, 0xFF, 0xFF, 0xFF, 0xCD, 0xFE, + 0xFF, 0xEE, 0xDD, 0xDD, 0xCE, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xEE, 0xDC, + 0xCB, 0xCB, 0xBB, 0xCC, 0xDE, 0xEF, 0xFF, 0xFD, 0xFE, 0xDC, 0xCB, 0xAA, + 0xAA, 0xAA, 0xBC, 0xCD, 0xEF, 0xFF, 0xDF, 0xDC, 0xBB, 0xA9, 0x99, 0x99, + 0x9A, 0xAB, 0xDF, 0xFF, 0xFD, 0xDD, 0xBA, 0xA9, 0x88, 0x77, 0x78, 0x89, + 0xAB, 0xDE, 0xFF, 0xDD, 0xDB, 0xA9, 0x87, 0x76, 0x66, 0x77, 0x89, 0xBC, + 0xFE, 0xFD, 0xDB, 0xB9, 0x87, 0x66, 0x55, 0x56, 0x77, 0x9A, 0xBD, 0xFF, + 0xDD, 0xCA, 0x98, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9B, 0xCE, 0xFD, 0xEB, + 0xA9, 0x76, 0x55, 0x44, 0x45, 0x67, 0x89, 0xBD, 0xFF, 0xDD, 0xBA, 0x97, + 0x65, 0x54, 0x44, 0x56, 0x78, 0x9B, 0xCD, 0xED, 0xDB, 0xA9, 0x76, 0x55, + 0x44, 0x55, 0x67, 0x89, 0xBC, 0xFD, 0xED, 0xCB, 0x98, 0x76, 0x55, 0x55, + 0x66, 0x78, 0xAB, 0xDF, 0xFD, 0xEC, 0xB9, 0x87, 0x66, 0x66, 0x66, 0x78, + 0x9A, 0xBC, 0xED, 0xDF, 0xFC, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x9A, 0xAC, + 0xDE, 0xEF, 0xFF, 0xCB, 0xA9, 0x88, 0x88, 0x88, 0x9A, 0xBB, 0xCE, 0xFE, + 0xFF, 0xFE, 0xCB, 0xBA, 0x99, 0x99, 0xAA, 0xAB, 0xCD, 0xEF, 0xEF, 0xFF, + 0xED, 0xDC, 0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEE, 0xFF, 0xFF, 0xFF, 0xFE, + 0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, + 0xDE, 0xDE, 0xEF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xDD, 0xED, 0xCD, + 0xDD, 0xCC, 0xDD, 0xDE, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xBB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xAC, 0xDC, + 0xCB, 0xBB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDD, 0xFE, 0xCC, 0xCB, 0xBA, + 0xAA, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDE, 0xDB, 0xCB, 0xAA, 0xA9, 0x99, + 0x88, 0x89, 0x99, 0xAB, 0xBC, 0xED, 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88, + 0x88, 0x99, 0xAB, 0xCC, 0xCB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x78, + 0x99, 0xAB, 0xCC, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x78, 0x99, + 0xBC, 0xBA, 0xAA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xBB, + 0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xBA, 0xA9, + 0x88, 0x76, 0x65, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0x98, 0x87, + 0x66, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xBA, 0xA9, 0x88, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, 0x66, 0x65, 0x56, + 0x66, 0x77, 0x89, 0xAB, 0xBB, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x89, 0x9A, 0xBB, 0xBB, 0xA9, 0x98, 0x77, 0x77, 0x67, 0x77, 0x88, 0x9A, + 0xBB, 0xBC, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x88, 0x99, 0xAB, 0xCB, + 0xCC, 0xCB, 0xA9, 0x98, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBC, 0xBD, 0xDC, + 0xBB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCC, 0xEE, 0xDC, 0xCB, + 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xCD, 0xFD, 0xDC, 0xCB, 0xBB, + 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEC, 0xBD, 0xDD, 0xCC, 0xCB, 0xBB, 0xBB, + 0xBB, 0xBB, 0xCB, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x8A, 0xA9, 0x99, 0x99, 0x98, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xAA, 0xBB, + 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xDC, 0xAB, 0xBA, 0xA9, + 0x99, 0x99, 0x88, 0x99, 0x9A, 0xAA, 0xBC, 0xC9, 0xAA, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x89, 0x99, 0xAB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77, + 0x78, 0x88, 0x99, 0xAB, 0xB9, 0xA9, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, + 0x88, 0x9A, 0xAA, 0x9A, 0x98, 0x87, 0x77, 0x76, 0x66, 0x77, 0x78, 0x89, + 0xAA, 0xA9, 0x99, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, 0x78, 0x89, 0xA9, + 0x99, 0x98, 0x87, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0x99, 0x99, + 0x87, 0x76, 0x66, 0x66, 0x66, 0x67, 0x78, 0x89, 0x99, 0x89, 0x88, 0x77, + 0x66, 0x66, 0x66, 0x66, 0x77, 0x78, 0x9A, 0x99, 0x98, 0x87, 0x76, 0x66, + 0x66, 0x66, 0x67, 0x78, 0x89, 0x99, 0x99, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x88, 0x99, 0x99, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x66, 0x77, + 0x78, 0x89, 0xA9, 0x9A, 0x99, 0x87, 0x77, 0x77, 0x67, 0x77, 0x78, 0x89, + 0x9A, 0x9A, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, 0x89, 0x9A, 0xBA, + 0xAB, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x88, 0x99, 0x99, 0xAB, 0xAB, 0xBB, + 0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x99, 0xAA, 0xBA, 0xBC, 0xBB, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xAB, 0xAD, 0xDD, 0xBB, 0xAA, 0xA9, + 0xA9, 0x9A, 0xAA, 0xAB, 0xBB, 0xDB, 0xAC, 0xCB, 0xAA, 0xA9, 0x99, 0x99, + 0x99, 0x9A, 0xAA, 0xAB, 0x90, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xAA, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xBA, 0xCB, + 0xBB, 0xAA, 0xAA, 0xA9, 0xAA, 0xAA, 0xBB, 0xCC, 0xDC, 0xAB, 0xBB, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xCA, 0xBA, 0xA9, 0x99, 0x88, + 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77, + 0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xAA, 0x98, 0x88, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBB, 0x9A, 0x99, 0x88, 0x77, 0x66, 0x66, 0x67, 0x78, 0x89, + 0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA, + 0x9A, 0x98, 0x87, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99, + 0x87, 0x76, 0x66, 0x55, 0x66, 0x66, 0x78, 0x89, 0xAA, 0x9A, 0x98, 0x77, + 0x66, 0x65, 0x55, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0xA9, 0x87, 0x76, 0x66, + 0x56, 0x66, 0x67, 0x78, 0x89, 0xAA, 0xAA, 0x98, 0x77, 0x66, 0x66, 0x66, + 0x66, 0x77, 0x89, 0x9A, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x67, 0x77, 0x88, 0x89, + 0xAB, 0xAB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0xAA, 0xBA, + 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xAB, 0xCB, + 0xAA, 0x99, 0x98, 0x88, 0x89, 0x99, 0x9A, 0xAB, 0xBB, 0xCC, 0xCB, 0xBA, + 0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xAB, 0xBC, 0xBD, 0xDC, 0xCB, 0xBB, 0xAA, + 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDB, 0xBC, 0xCB, 0xBB, 0xAA, 0xAA, 0x9A, + 0xAA, 0xAA, 0xAA, 0xBB, 0x90, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBA, 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xAA, 0xBC, 0xBD, 0xBB, 0xCC, + 0xBB, 0xBA, 0xAA, 0xA9, 0xA9, 0xAA, 0xBB, 0xCD, 0xDD, 0xBC, 0xBA, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBD, 0xCB, 0xBB, 0xA9, 0x99, 0x88, + 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCC, 0xAB, 0xAA, 0x99, 0x88, 0x77, 0x77, + 0x88, 0x89, 0x9A, 0xAB, 0xBA, 0xAA, 0x98, 0x88, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBB, 0xAA, 0x99, 0x87, 0x77, 0x66, 0x66, 0x67, 0x78, 0x89, + 0xAB, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA, + 0x9A, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA, 0x99, + 0x87, 0x76, 0x66, 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0x99, 0x98, 0x77, + 0x66, 0x65, 0x56, 0x66, 0x67, 0x88, 0x9A, 0xA9, 0xA9, 0x87, 0x76, 0x66, + 0x65, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x77, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x88, 0x9A, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x76, 0x67, 0x77, 0x78, 0x99, + 0xAB, 0xAB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x99, 0xAA, 0xBB, + 0xBC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x89, 0xAA, 0xBB, 0xBC, 0xCC, + 0xAA, 0x99, 0x98, 0x88, 0x89, 0x99, 0x9A, 0xBB, 0xCB, 0xCD, 0xCB, 0xAA, + 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xBD, 0xDC, 0xCB, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBB, 0xCC, 0xDB, 0xAD, 0xCB, 0xBB, 0xBA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDE, 0xBC, 0xDC, + 0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xFD, 0xBC, 0xCB, 0xBA, + 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCE, 0xDB, 0xBB, 0xAA, 0x99, 0x98, + 0x88, 0x89, 0x99, 0xAB, 0xBC, 0xDD, 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88, + 0x88, 0x99, 0xAB, 0xBC, 0xCB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x89, 0xAB, 0xCC, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x78, 0x9A, + 0xAB, 0xBA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xBB, + 0xAA, 0x99, 0x87, 0x66, 0x65, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xBA, 0xA9, + 0x88, 0x76, 0x65, 0x55, 0x55, 0x67, 0x78, 0x99, 0xBB, 0xAA, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xBA, 0xA9, 0x88, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBB, 0xAA, 0x99, 0x87, 0x76, 0x65, 0x56, + 0x66, 0x77, 0x89, 0xAB, 0xBB, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x89, 0x9A, 0xBB, 0xBB, 0xAA, 0x98, 0x77, 0x76, 0x67, 0x77, 0x88, 0x9A, + 0xAB, 0xBB, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x88, 0x99, 0xAB, 0xBB, + 0xCC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x89, 0x99, 0xAA, 0xBC, 0xBC, 0xCC, + 0xBB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDC, 0xDD, 0xDC, 0xBB, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xCE, 0xFD, 0xDC, 0xCB, 0xBB, + 0xAB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDC, 0xBD, 0xDC, 0xCC, 0xBB, 0xBB, 0xAA, + 0xAB, 0xBB, 0xBC, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xBE, 0xED, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xEF, 0xFF, 0xFF, 0xBE, 0xFF, + 0xED, 0xDD, 0xCD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xED, 0xDC, + 0xCC, 0xBC, 0xBC, 0xDD, 0xDE, 0xFF, 0xFF, 0xFD, 0xDD, 0xDC, 0xBB, 0xAA, + 0xAA, 0xBB, 0xCC, 0xDE, 0xFF, 0xFF, 0xDE, 0xDC, 0xBA, 0xA9, 0x99, 0x99, + 0x9A, 0xBC, 0xDE, 0xFF, 0xFD, 0xDC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x9A, + 0xBC, 0xDF, 0xFF, 0xDD, 0xCB, 0xA9, 0x87, 0x76, 0x67, 0x78, 0x9A, 0xBD, + 0xFF, 0xFD, 0xDC, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9B, 0xCD, 0xFE, + 0xDD, 0xBA, 0x98, 0x76, 0x54, 0x45, 0x56, 0x89, 0xAB, 0xEE, 0xFD, 0xDB, + 0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBD, 0xEE, 0xDD, 0xBA, 0x98, + 0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xDE, 0xED, 0xEC, 0xA9, 0x87, 0x55, + 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xED, 0xED, 0xCB, 0x98, 0x76, 0x55, 0x55, + 0x67, 0x89, 0xAB, 0xCE, 0xEE, 0xFD, 0xBA, 0x98, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBD, 0xEE, 0xFF, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC, + 0xDE, 0xEF, 0xFE, 0xDC, 0xBA, 0x99, 0x88, 0x99, 0x9A, 0xBB, 0xCD, 0xFE, + 0xEF, 0xFE, 0xDC, 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDF, 0xEF, 0xFF, + 0xFE, 0xDC, 0xCC, 0xCB, 0xBB, 0xBC, 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xED, 0xDD, 0xCC, 0xCD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xDE, 0xED, 0xEE, 0xEF, 0xFF, 0xFF, 0xBE, 0xFF, 0xFF, 0xEE, 0xEE, 0xDE, + 0xED, 0xDD, 0xEE, 0xFE, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDF, 0xFE, 0xFF, 0xBC, 0xED, + 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xDE, 0xFF, 0xFF, 0xFF, 0xCD, 0xDC, 0xCC, + 0xBB, 0xAB, 0xAB, 0xBC, 0xCD, 0xEF, 0xFF, 0xFC, 0xDC, 0xCB, 0xAA, 0xA9, + 0x99, 0x9A, 0xAB, 0xCC, 0xFF, 0xFE, 0xCD, 0xCB, 0xAA, 0x99, 0x88, 0x88, + 0x99, 0xAB, 0xCD, 0xEF, 0xFC, 0xCB, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x89, + 0xAB, 0xCE, 0xFE, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xDE, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x56, 0x77, 0x8A, 0xBC, 0xDE, + 0xCC, 0xB9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9B, 0xCD, 0xDC, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x45, 0x67, 0x89, 0xAC, 0xDD, 0xCC, 0xB9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xCD, 0xDD, 0xCB, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAC, 0xCD, 0xCC, 0xBA, 0x98, 0x76, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xCC, 0xCD, 0xDB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78, + 0x9A, 0xBC, 0xDD, 0xDD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xDD, 0xDE, 0xED, 0xBB, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCC, 0xDD, + 0xFF, 0xEC, 0xCB, 0xAA, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xDD, 0xDF, 0xFF, + 0xFE, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xED, 0xDD, 0xFF, 0xFF, 0xEE, + 0xCC, 0xCB, 0xBB, 0xCC, 0xCC, 0xDD, 0xEE, 0xDF, 0xFF, 0xFF, 0xFE, 0xED, + 0xDC, 0xCD, 0xCD, 0xDD, 0xDE, 0xED, 0xCF, 0xFF, 0xFE, 0xEE, 0xDD, 0xDD, + 0xCD, 0xCC, 0xDD, 0xDD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xCD, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDE, 0xFF, 0xFF, 0xDD, 0xED, + 0xDC, 0xCC, 0xCB, 0xBB, 0xCC, 0xCD, 0xEE, 0xFF, 0xFF, 0xDE, 0xDD, 0xCB, + 0xBB, 0xAA, 0xAA, 0xBB, 0xCD, 0xDF, 0xFF, 0xFD, 0xDC, 0xBB, 0xAA, 0x99, + 0x99, 0x99, 0xAB, 0xBC, 0xDE, 0xFF, 0xCD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0xAA, 0xBC, 0xEF, 0xFC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89, + 0x9B, 0xCD, 0xEE, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x67, 0x89, 0xAB, + 0xCD, 0xEC, 0xCA, 0x98, 0x87, 0x66, 0x55, 0x56, 0x67, 0x89, 0xAC, 0xDE, + 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xDC, 0xBA, + 0x98, 0x76, 0x55, 0x54, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xDC, 0xCA, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xCC, 0xBA, 0x87, 0x66, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xBC, 0xDD, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78, + 0x99, 0xAB, 0xDD, 0xDD, 0xCA, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCD, 0xDE, 0xDC, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x89, 0xAA, 0xBC, 0xDD, + 0xEE, 0xDC, 0xBB, 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xDF, 0xFF, + 0xDD, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xFD, 0xFF, 0xFF, 0xED, + 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xDF, 0xFF, 0xFE, 0xED, 0xDD, + 0xCC, 0xCC, 0xCD, 0xDE, 0xEF, 0xFE, 0xCF, 0xFF, 0xFF, 0xDE, 0xDD, 0xDD, + 0xCD, 0xDD, 0xDE, 0xEE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xBE, 0xDD, 0xCC, 0xCC, 0xCC, 0xCD, 0xDF, 0xEE, 0xFF, 0xFF, 0xCD, 0xDE, + 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFF, 0xDD, 0xCC, 0xBB, + 0xBB, 0xBB, 0xBB, 0xBB, 0xCD, 0xDF, 0xFF, 0xFD, 0xDC, 0xCB, 0xBA, 0xA9, + 0x99, 0xAA, 0xAB, 0xCD, 0xFF, 0xFF, 0xCC, 0xBB, 0xA9, 0x98, 0x88, 0x88, + 0x99, 0xAB, 0xCF, 0xFF, 0xFC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89, + 0xAB, 0xCE, 0xFF, 0xCD, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xDD, 0xFC, 0xCB, 0x98, 0x87, 0x65, 0x55, 0x56, 0x77, 0x8A, 0xBD, 0xFF, + 0xCC, 0xB9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xED, 0xCB, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xCC, 0xB9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xDD, 0xCB, 0xA8, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xED, 0xBA, 0x98, 0x76, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xBD, 0xCD, 0xFC, 0xB9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x99, 0xAB, 0xFD, 0xFF, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCD, 0xDF, 0xFD, 0xBB, 0xA9, 0x98, 0x88, 0x88, 0x89, 0xAB, 0xCC, 0xDD, + 0xFF, 0xDE, 0xCC, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xDD, 0xCF, 0xFF, + 0xDD, 0xCB, 0xBB, 0xBA, 0xAA, 0xBB, 0xBC, 0xCD, 0xED, 0xFF, 0xFF, 0xDD, + 0xDD, 0xCC, 0xBB, 0xCC, 0xCC, 0xCD, 0xDD, 0xDF, 0xFF, 0xFF, 0xFE, 0xED, + 0xDC, 0xCD, 0xED, 0xDE, 0xDF, 0xEE, 0xBF, 0xFF, 0xFF, 0xFE, 0xED, 0xDC, + 0xDD, 0xCC, 0xCC, 0xDD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xDD, 0xDC, 0xCC, 0xDC, 0xCD, 0xDD, 0xDE, 0xFF, 0xEF, 0xBE, 0xEE, + 0xDD, 0xDC, 0xCC, 0xCD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFE, 0xDE, 0xDD, 0xCB, + 0xBB, 0xBB, 0xBB, 0xCC, 0xDE, 0xEF, 0xFF, 0xFD, 0xDD, 0xCB, 0xBA, 0xAA, + 0xAA, 0xAB, 0xBC, 0xCE, 0xFF, 0xFE, 0xCD, 0xDB, 0xBA, 0x99, 0x98, 0x99, + 0x9A, 0xAC, 0xDD, 0xFF, 0xFD, 0xDC, 0xBA, 0x99, 0x87, 0x77, 0x78, 0x99, + 0xBC, 0xDE, 0xEE, 0xDC, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x78, 0x9A, 0xBC, + 0xDF, 0xFC, 0xDB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBD, 0xFE, + 0xCC, 0xBA, 0x98, 0x66, 0x55, 0x45, 0x56, 0x78, 0xAB, 0xCE, 0xDD, 0xCB, + 0xA8, 0x76, 0x55, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xDE, 0xDD, 0xBA, 0x87, + 0x65, 0x44, 0x44, 0x56, 0x78, 0x9B, 0xCD, 0xDD, 0xDB, 0xA9, 0x86, 0x55, + 0x44, 0x55, 0x67, 0x89, 0xBC, 0xDE, 0xDD, 0xCB, 0x98, 0x76, 0x55, 0x55, + 0x67, 0x89, 0xAB, 0xCD, 0xDE, 0xFC, 0xBA, 0x98, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBC, 0xDD, 0xFF, 0xDC, 0xAA, 0x98, 0x77, 0x77, 0x88, 0x99, 0xAB, + 0xCD, 0xDE, 0xFE, 0xDB, 0xBA, 0x98, 0x88, 0x89, 0x9A, 0xAB, 0xCD, 0xDE, + 0xEF, 0xEE, 0xCC, 0xBA, 0xA9, 0x99, 0x9A, 0xAB, 0xCC, 0xED, 0xEF, 0xFF, + 0xFD, 0xDC, 0xBB, 0xBB, 0xBB, 0xBB, 0xCD, 0xDE, 0xEF, 0xFF, 0xFF, 0xFE, + 0xDD, 0xCD, 0xCC, 0xCC, 0xCC, 0xDE, 0xEF, 0xEF, 0xFF, 0xFF, 0xFE, 0xED, + 0xDD, 0xDD, 0xDD, 0xEE, 0xFF, 0xFE, 0xBF, 0xEE, 0xEE, 0xFE, 0xED, 0xDD, + 0xDD, 0xDD, 0xDE, 0xEE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0x9C, 0xCB, 0xBB, 0xBA, 0xBA, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xAC, 0xDD, + 0xCC, 0xBB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEF, 0xFE, 0xCD, 0xCB, 0xBB, + 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xEF, 0xDB, 0xCB, 0xBA, 0xA9, 0x99, + 0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xED, 0xBC, 0xBA, 0xA9, 0x88, 0x88, 0x88, + 0x89, 0x9A, 0xBB, 0xCD, 0xDB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xBC, 0xDC, 0xBB, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0x9A, + 0xBC, 0xCB, 0xBA, 0x98, 0x77, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xCC, + 0xBB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xBB, 0xBA, + 0x98, 0x76, 0x55, 0x54, 0x55, 0x67, 0x88, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x89, 0xAB, 0xBB, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x67, 0x88, 0xAA, 0xBB, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x55, + 0x66, 0x78, 0x9A, 0xBC, 0xBB, 0xBA, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAB, 0xCB, 0xCC, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, 0x9A, + 0xBC, 0xBC, 0xCB, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xBB, 0xCC, + 0xCD, 0xCB, 0xAA, 0x99, 0x98, 0x89, 0x99, 0x9A, 0xBB, 0xCD, 0xCC, 0xDD, + 0xCB, 0xBA, 0xAA, 0xA9, 0x9A, 0xAA, 0xBC, 0xCC, 0xDC, 0xDE, 0xED, 0xCC, + 0xBB, 0xBA, 0xAA, 0xAB, 0xBB, 0xCC, 0xCD, 0xCD, 0xFE, 0xED, 0xDC, 0xCC, + 0xBB, 0xCB, 0xCC, 0xCD, 0xDD, 0xEC, 0xAD, 0xDD, 0xCC, 0xCC, 0xBB, 0xBB, + 0xBB, 0xCB, 0xCC, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBA, 0xAA, 0xA9, 0xA9, 0x9A, 0xAA, 0xAB, 0xBB, 0xCC, 0xAB, 0xDC, + 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xED, 0xBB, 0xBB, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xCA, 0xBB, 0xA9, 0x99, 0x88, + 0x88, 0x88, 0x99, 0x9A, 0xBB, 0xDC, 0xAB, 0xAA, 0x98, 0x88, 0x77, 0x77, + 0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xAA, 0x98, 0x88, 0x77, 0x77, 0x77, 0x78, + 0x89, 0xAB, 0xBB, 0xAA, 0x99, 0x87, 0x77, 0x66, 0x66, 0x67, 0x78, 0x89, + 0xAB, 0xBA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x9A, 0xBB, + 0x9A, 0x98, 0x87, 0x66, 0x65, 0x56, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0xAA, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xAA, 0xA9, 0x87, 0x76, 0x66, + 0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x78, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xBB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x99, 0xAB, 0xBB, + 0xBC, 0xBA, 0x99, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBC, 0xCB, + 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xCD, 0xCB, 0xBB, + 0xAA, 0xA9, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xCD, 0xEC, 0xDC, 0xBB, 0xBB, + 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDC, 0xAD, 0xCC, 0xCB, 0xBA, 0xAA, 0xAA, + 0xAA, 0xAB, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xAB, 0xCB, + 0xBA, 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xDC, 0xBC, 0xBA, 0xA9, + 0x99, 0x99, 0x89, 0x99, 0x9A, 0xAB, 0xCC, 0xCA, 0xBA, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x98, 0x88, 0x77, 0x77, + 0x78, 0x89, 0x9A, 0xBB, 0xBA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBA, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x67, 0x78, 0x89, + 0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA, + 0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99, + 0x87, 0x76, 0x66, 0x55, 0x56, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x88, 0x77, + 0x66, 0x65, 0x56, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66, + 0x66, 0x66, 0x67, 0x78, 0x89, 0xAA, 0x9A, 0x98, 0x77, 0x66, 0x66, 0x66, + 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x88, 0x99, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0xAA, 0xBA, + 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0x9A, 0xBB, 0xBB, 0xCB, + 0xAA, 0x99, 0x98, 0x88, 0x89, 0x99, 0xAA, 0xAB, 0xCB, 0xBC, 0xCB, 0xBA, + 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xBC, 0xDC, 0xCB, 0xBA, 0xAA, + 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDC, 0xAC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBA, 0xAA, 0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xAB, 0xCC, + 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xAB, 0xBA, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCD, 0xCA, 0xBA, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x99, 0x9A, 0xBB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77, + 0x88, 0x89, 0x9A, 0xBC, 0xBA, 0xBA, 0x98, 0x88, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBB, 0x9A, 0x99, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89, + 0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x67, 0x88, 0x9A, 0xAA, + 0x9A, 0x98, 0x77, 0x66, 0x66, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x99, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x87, 0x76, 0x66, + 0x55, 0x66, 0x67, 0x78, 0x89, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x67, 0x77, 0x89, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x67, 0x77, + 0x88, 0x9A, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xAB, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0xAA, 0xBA, + 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xAC, 0xBB, 0xCB, + 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xBD, 0xCB, 0xBA, + 0xAA, 0x99, 0x99, 0x9A, 0xAA, 0xAB, 0xCD, 0xCD, 0xDC, 0xCB, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBB, 0xCC, 0xDC, 0xAC, 0xCC, 0xBB, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xAB, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0xCC, 0x9B, 0xCC, + 0xCB, 0xBB, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDD, 0xED, 0xBC, 0xCB, 0xBA, + 0xAA, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xDD, 0xCB, 0xCB, 0xAA, 0x99, 0x99, + 0x89, 0x99, 0x9A, 0xAB, 0xCC, 0xDC, 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88, + 0x88, 0x9A, 0xAB, 0xCD, 0xCA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xBB, 0xCC, 0xAB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x88, 0x9A, + 0xBC, 0xBA, 0xAA, 0x98, 0x77, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xBB, + 0xAA, 0x99, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xAB, 0xBA, 0xA9, + 0x98, 0x76, 0x55, 0x55, 0x55, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0x99, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x89, 0xAB, 0xBA, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xAB, 0xA9, 0x87, 0x76, 0x65, 0x56, + 0x66, 0x78, 0x99, 0xAB, 0xBB, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAA, 0xBB, 0xBC, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A, + 0xAB, 0xBB, 0xCB, 0xAA, 0x98, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, + 0xCC, 0xCB, 0xAA, 0x99, 0x98, 0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xBC, 0xDC, + 0xCB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDC, 0xCE, 0xDC, 0xCB, + 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xCD, 0xED, 0xDD, 0xCC, 0xCB, + 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xEC, 0xAD, 0xCC, 0xCC, 0xBB, 0xBB, 0xBB, + 0xBB, 0xBB, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xFE, 0xED, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xBF, 0xFF, + 0xFE, 0xFD, 0xDD, 0xDD, 0xDE, 0xEE, 0xFF, 0xFF, 0xFE, 0xFF, 0xFE, 0xED, + 0xCC, 0xCB, 0xCC, 0xCC, 0xDE, 0xEF, 0xFF, 0xEE, 0xFF, 0xEC, 0xCB, 0xBA, + 0xAA, 0xAB, 0xBC, 0xDD, 0xFF, 0xFE, 0xEF, 0xED, 0xCB, 0xAA, 0x99, 0x99, + 0xAA, 0xBC, 0xDE, 0xFF, 0xEE, 0xFD, 0xCB, 0xA9, 0x88, 0x88, 0x89, 0x9A, + 0xBC, 0xDE, 0xFF, 0xDE, 0xCB, 0xA9, 0x87, 0x76, 0x77, 0x78, 0x9A, 0xBD, + 0xEF, 0xED, 0xEC, 0xB9, 0x87, 0x66, 0x55, 0x66, 0x79, 0xAB, 0xCE, 0xFE, + 0xDD, 0xCA, 0x98, 0x76, 0x54, 0x45, 0x67, 0x89, 0xAC, 0xDE, 0xED, 0xDB, + 0xA9, 0x86, 0x54, 0x43, 0x45, 0x68, 0x9A, 0xCD, 0xEE, 0xDD, 0xBA, 0x98, + 0x75, 0x43, 0x34, 0x56, 0x79, 0xAB, 0xDE, 0xED, 0xDC, 0xB9, 0x87, 0x65, + 0x44, 0x55, 0x78, 0x9A, 0xCD, 0xEE, 0xDD, 0xCB, 0xA9, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xBC, 0xDF, 0xED, 0xED, 0xBA, 0x98, 0x77, 0x66, 0x77, 0x89, + 0xAB, 0xCD, 0xFE, 0xDE, 0xEC, 0xBA, 0x99, 0x88, 0x78, 0x89, 0xAB, 0xBD, + 0xEF, 0xED, 0xFE, 0xDC, 0xBA, 0xA9, 0x99, 0x99, 0xAB, 0xBC, 0xDF, 0xFE, + 0xEF, 0xFE, 0xDC, 0xBB, 0xBA, 0xAA, 0xBB, 0xCD, 0xDE, 0xEF, 0xFD, 0xFE, + 0xEE, 0xDD, 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xFF, 0xFF, 0xEF, 0xFF, 0xEE, + 0xEE, 0xDD, 0xDD, 0xDD, 0xEE, 0xEF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xEE, + 0xFE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xAE, 0xEE, 0xEE, 0xEE, 0xDD, 0xDE, + 0xEF, 0xFE, 0xEE, 0xFF, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xBE, 0xDC, 0xDC, 0xCC, 0xCB, 0xCB, 0xCC, 0xCC, 0xDD, 0xCD, 0xAD, 0xED, + 0xDD, 0xCC, 0xCC, 0xCC, 0xBC, 0xCD, 0xCE, 0xEF, 0xFE, 0xEE, 0xDC, 0xCB, + 0xBB, 0xBA, 0xAB, 0xBB, 0xCC, 0xDE, 0xDF, 0xDC, 0xDC, 0xCB, 0xAA, 0x99, + 0x99, 0x9A, 0xAB, 0xCD, 0xDE, 0xFD, 0xCD, 0xCB, 0xA9, 0x99, 0x88, 0x88, + 0x99, 0xAA, 0xBC, 0xEF, 0xDC, 0xDB, 0xAA, 0x98, 0x77, 0x77, 0x77, 0x89, + 0xAB, 0xCD, 0xDD, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xDE, 0xDC, 0xCB, 0x98, 0x77, 0x65, 0x55, 0x56, 0x77, 0x89, 0xBC, 0xDD, + 0xCC, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9B, 0xBC, 0xDB, 0xCA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xCB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xDC, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xCC, 0xBA, 0x88, 0x76, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xBD, 0xCC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x9A, 0xBC, 0xDC, 0xCD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAC, + 0xCE, 0xDC, 0xDD, 0xCA, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xED, + 0xDD, 0xDC, 0xCB, 0xAA, 0x99, 0x99, 0x9A, 0xAC, 0xCD, 0xEE, 0xDD, 0xEF, + 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xED, 0xFD, 0xEE, 0xEE, 0xDD, + 0xDC, 0xCB, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xED, 0xFF, 0xED, 0xED, 0xDD, + 0xDC, 0xCD, 0xDD, 0xEE, 0xEF, 0xFE, 0xAD, 0xED, 0xDD, 0xDD, 0xCD, 0xDC, + 0xDD, 0xDE, 0xED, 0xED, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xCD, 0xDD, 0xCC, 0xCC, 0xBB, 0xBC, 0xCC, 0xCD, 0xDE, 0xEF, 0xCE, 0xFE, + 0xDD, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xDE, 0xFF, 0xFF, 0xDE, 0xDC, 0xCB, + 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCE, 0xFF, 0xED, 0xDC, 0xBB, 0xAA, 0x99, + 0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xFE, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x88, 0x9A, 0xBC, 0xDE, 0xEC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xBC, 0xDE, 0xCC, 0xB9, 0x98, 0x77, 0x66, 0x66, 0x67, 0x88, 0x9B, + 0xCD, 0xDC, 0xBA, 0x98, 0x76, 0x65, 0x55, 0x56, 0x67, 0x89, 0xAB, 0xDD, + 0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xDB, 0xBA, + 0x98, 0x76, 0x55, 0x55, 0x55, 0x67, 0x78, 0xAB, 0xCC, 0xCB, 0xA9, 0x87, + 0x65, 0x55, 0x55, 0x56, 0x77, 0x8A, 0xBC, 0xCC, 0xBA, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xBC, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78, + 0x89, 0xAC, 0xDD, 0xDD, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCD, 0xDD, 0xDC, 0xBA, 0x99, 0x88, 0x77, 0x88, 0x89, 0xAB, 0xBD, 0xDD, + 0xDE, 0xDC, 0xBA, 0x99, 0x98, 0x89, 0x99, 0xAB, 0xBC, 0xDE, 0xED, 0xFD, + 0xDC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xCC, 0xDE, 0xFE, 0xEF, 0xEE, 0xDC, + 0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFE, 0xFF, 0xEE, 0xDD, 0xDC, + 0xCC, 0xCC, 0xDD, 0xEE, 0xEF, 0xFF, 0xCF, 0xEE, 0xED, 0xDD, 0xDD, 0xCC, + 0xCD, 0xDD, 0xDF, 0xEE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xCC, 0xCC, 0xBB, 0xBB, 0xBC, 0xBC, 0xCC, 0xCC, 0xDD, 0xAC, 0xDD, + 0xDD, 0xCC, 0xCC, 0xBC, 0xBC, 0xCC, 0xDD, 0xDF, 0xFD, 0xDE, 0xEC, 0xCB, + 0xBB, 0xAA, 0xAA, 0xBB, 0xCC, 0xCD, 0xDE, 0xCC, 0xDD, 0xCB, 0xAA, 0xA9, + 0x99, 0x9A, 0xAB, 0xCC, 0xDD, 0xED, 0xCD, 0xBB, 0xAA, 0x99, 0x88, 0x88, + 0x99, 0xAA, 0xBC, 0xDD, 0xDB, 0xCB, 0xAA, 0x98, 0x87, 0x77, 0x78, 0x89, + 0xAB, 0xCC, 0xED, 0xBC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x77, 0x89, 0xAB, + 0xCD, 0xCB, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC, + 0xBC, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xCA, + 0x98, 0x76, 0x55, 0x44, 0x45, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xB9, 0x87, + 0x65, 0x44, 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xCA, 0xA8, 0x76, 0x65, + 0x44, 0x56, 0x67, 0x89, 0xAB, 0xCC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x56, + 0x67, 0x78, 0x9A, 0xBD, 0xCC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBC, 0xDC, 0xCD, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x9A, 0xAB, + 0xCD, 0xCC, 0xDC, 0xBB, 0xA9, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xDC, + 0xCD, 0xDC, 0xBB, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCD, 0xCC, 0xED, + 0xDC, 0xCB, 0xBB, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xDD, 0xDE, 0xDD, 0xDD, + 0xCC, 0xBB, 0xBB, 0xCC, 0xCC, 0xCD, 0xDF, 0xDD, 0xFF, 0xED, 0xDD, 0xDC, + 0xCC, 0xCD, 0xDD, 0xEE, 0xEE, 0xFD, 0xAD, 0xDC, 0xDC, 0xCC, 0xCC, 0xBC, + 0xCC, 0xCC, 0xDC, 0xDE, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAE, 0xED, 0xDD, 0xDD, 0xDD, 0xDC, 0xDD, 0xDD, 0xDD, 0xDD, 0x9E, 0xFF, + 0xFF, 0xED, 0xED, 0xDD, 0xEE, 0xEF, 0xFE, 0xFF, 0xFD, 0xDF, 0xEE, 0xDD, + 0xDD, 0xDD, 0xDD, 0xDD, 0xEF, 0xFE, 0xFF, 0xED, 0xFE, 0xDD, 0xCC, 0xCB, + 0xBC, 0xCC, 0xDE, 0xEE, 0xEE, 0xFE, 0xDF, 0xDD, 0xCB, 0xBA, 0xAA, 0xAB, + 0xBC, 0xDD, 0xDF, 0xEF, 0xED, 0xED, 0xDB, 0xBA, 0x99, 0x88, 0x99, 0xAB, + 0xCD, 0xEF, 0xFD, 0xDE, 0xDC, 0xBA, 0x98, 0x77, 0x77, 0x89, 0xAB, 0xDD, + 0xFF, 0xDD, 0xED, 0xBA, 0x98, 0x76, 0x55, 0x67, 0x89, 0xBC, 0xDD, 0xFE, + 0xDE, 0xCB, 0xA9, 0x76, 0x54, 0x45, 0x67, 0x9A, 0xCD, 0xEF, 0xED, 0xED, + 0xCA, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xCE, 0xED, 0xDE, 0xDB, 0xA8, + 0x75, 0x43, 0x24, 0x57, 0x8A, 0xBC, 0xDE, 0xED, 0xED, 0xCA, 0x97, 0x65, + 0x44, 0x46, 0x78, 0xAC, 0xCD, 0xED, 0xDE, 0xDD, 0xBA, 0x87, 0x65, 0x56, + 0x68, 0x9A, 0xBD, 0xEF, 0xDD, 0xFE, 0xDC, 0xA9, 0x87, 0x77, 0x78, 0x8A, + 0xBC, 0xDE, 0xEE, 0xEF, 0xFD, 0xDB, 0xAA, 0x98, 0x88, 0x9A, 0xAB, 0xCD, + 0xFF, 0xDD, 0xFE, 0xED, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDF, 0xFE, + 0xDF, 0xFE, 0xED, 0xDC, 0xCB, 0xBB, 0xBC, 0xCC, 0xDE, 0xFF, 0xEE, 0xFF, + 0xFF, 0xFE, 0xDD, 0xCD, 0xDD, 0xDD, 0xEF, 0xEF, 0xFE, 0xFF, 0xFF, 0xFE, + 0xFE, 0xEE, 0xED, 0xEE, 0xEE, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xEF, + 0xFE, 0xEF, 0xFE, 0xFF, 0xFF, 0xFE, 0xAD, 0xDD, 0xDD, 0xDD, 0xED, 0xDE, + 0xDE, 0xEE, 0xDD, 0xEE, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xDC, 0xCB, 0xBB, 0xAA, 0xAB, 0xBB, 0xBC, 0xCD, 0xCD, 0xAD, 0xED, + 0xCC, 0xBB, 0xAA, 0xBA, 0xAB, 0xBC, 0xCD, 0xDF, 0xFD, 0xDD, 0xCC, 0xBB, + 0xAA, 0xA9, 0x9A, 0xAA, 0xBB, 0xCD, 0xEE, 0xDC, 0xDB, 0xBA, 0xA9, 0x99, + 0x99, 0x99, 0x9A, 0xAB, 0xCD, 0xDD, 0xBC, 0xBA, 0xA9, 0x88, 0x88, 0x88, + 0x89, 0x9A, 0xBB, 0xCD, 0xCB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xBB, 0xCC, 0xBB, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x77, 0x89, 0x9A, + 0xBC, 0xCB, 0xBA, 0x98, 0x77, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xCC, + 0xBB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xAC, 0xCA, 0xA9, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x88, 0x9A, 0xBB, 0xAB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x99, 0xAB, 0xBB, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x89, 0x9A, 0xBB, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x55, + 0x67, 0x78, 0x9A, 0xAC, 0xBB, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x67, 0x78, + 0x89, 0xAB, 0xCC, 0xBC, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, 0x9A, + 0xBC, 0xCC, 0xCB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xBB, 0xCC, + 0xCD, 0xCB, 0xAA, 0x99, 0x98, 0x99, 0x99, 0xAA, 0xBC, 0xCD, 0xCC, 0xDD, + 0xCB, 0xBA, 0xAA, 0x99, 0x9A, 0xAA, 0xBB, 0xCD, 0xDD, 0xCE, 0xDD, 0xCC, + 0xBB, 0xBA, 0xAA, 0xBB, 0xBC, 0xCD, 0xEE, 0xDD, 0xFD, 0xED, 0xCC, 0xCC, + 0xBC, 0xBC, 0xCC, 0xDD, 0xEE, 0xFE, 0x9D, 0xDD, 0xCC, 0xCC, 0xBB, 0xBB, + 0xBC, 0xCC, 0xDD, 0xEE, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBA, 0xAA, 0xAA, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0x9B, 0xDC, + 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCC, 0xDC, 0xBB, 0xBB, 0xAA, + 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCD, 0xCA, 0xBB, 0xA9, 0x99, 0x88, + 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xDC, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x78, + 0x88, 0x89, 0xAA, 0xBC, 0xBA, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x99, 0xAB, 0xBB, 0x9A, 0x99, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x9A, + 0xAB, 0xBA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xBA, + 0x9A, 0x98, 0x77, 0x66, 0x65, 0x56, 0x66, 0x77, 0x89, 0xAB, 0xAA, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x77, + 0x66, 0x55, 0x45, 0x66, 0x77, 0x89, 0xAB, 0xA9, 0xA9, 0x87, 0x76, 0x66, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x66, 0x77, + 0x89, 0x9A, 0xBA, 0xAB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xAB, 0xBB, 0xBA, 0xA9, 0x88, 0x87, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xBB, + 0xBB, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xBC, 0xBB, 0xCC, + 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xCC, 0xCC, 0xCC, 0xBB, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xCC, 0xDD, 0xDC, 0xCB, 0xBB, + 0xAA, 0xAB, 0xBB, 0xBC, 0xCC, 0xDD, 0x9C, 0xCB, 0xBB, 0xBA, 0xAA, 0xAA, + 0xAA, 0xBB, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xAB, 0xCB, + 0xBA, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xCC, 0xAB, 0xBA, 0xA9, + 0x99, 0x88, 0x89, 0x99, 0x9A, 0xAB, 0xBC, 0xBA, 0xBA, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77, + 0x78, 0x89, 0x9A, 0xAB, 0xB9, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBA, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x67, 0x78, 0x89, + 0xAA, 0xA9, 0x99, 0x87, 0x77, 0x66, 0x66, 0x66, 0x77, 0x78, 0x99, 0xAA, + 0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x98, + 0x87, 0x76, 0x66, 0x55, 0x66, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x88, 0x77, + 0x66, 0x65, 0x56, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66, + 0x66, 0x66, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x98, 0x77, 0x66, 0x66, 0x66, + 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x89, 0xAA, 0xBA, + 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xBB, 0xBB, + 0xAA, 0x99, 0x98, 0x88, 0x89, 0x99, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xAA, + 0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xBC, 0xDC, 0xCB, 0xBA, 0xAA, + 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDC, 0xAC, 0xBB, 0xBA, 0xAA, 0xAA, 0x9A, + 0xAA, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBA, 0xA9, 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0x9B, 0xCC, + 0xBB, 0xAA, 0xA9, 0x99, 0xAA, 0xAA, 0xBB, 0xBC, 0xDC, 0xBC, 0xBA, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xBA, 0xBA, 0xA9, 0x99, 0x88, + 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77, + 0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBA, 0x9A, 0x98, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x89, + 0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA, + 0x9A, 0x98, 0x77, 0x66, 0x66, 0x56, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0x99, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66, + 0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x67, 0x78, 0x89, 0xAA, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x67, 0x77, + 0x88, 0x9A, 0xAA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xBA, 0xBA, 0x99, 0x88, 0x87, 0x77, 0x77, 0x88, 0x99, 0xAA, 0xBB, + 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xBB, 0xCB, + 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xAA, + 0xAA, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xBB, 0xCC, 0xCB, 0xBB, 0xAA, + 0xAA, 0xAA, 0xAB, 0xBC, 0xCC, 0xDC, 0x9C, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xAD, 0xCC, 0xCC, 0xCC, 0xCB, 0xBB, 0xBC, 0xBC, 0xCC, 0xDC, 0x9D, 0xED, + 0xED, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xED, 0xDF, 0xDD, 0xCC, + 0xBB, 0xBB, 0xBB, 0xBB, 0xCD, 0xDD, 0xEE, 0xDC, 0xDD, 0xCB, 0xBA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xEC, 0xCC, 0xCB, 0xBA, 0x99, 0x99, 0x99, + 0x9A, 0xAB, 0xCC, 0xDE, 0xCC, 0xCC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x9A, + 0xAB, 0xCD, 0xDC, 0xCC, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x88, 0x9A, 0xBB, + 0xCD, 0xCC, 0xCB, 0xA9, 0x87, 0x66, 0x56, 0x67, 0x88, 0xAA, 0xBC, 0xDC, + 0xBC, 0xBA, 0x98, 0x76, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xCB, 0xCB, + 0xA9, 0x87, 0x54, 0x33, 0x45, 0x78, 0x9A, 0xBC, 0xDC, 0xBC, 0xBA, 0x98, + 0x76, 0x43, 0x34, 0x56, 0x89, 0xAB, 0xCD, 0xCC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xCC, 0xCD, 0xBA, 0x99, 0x87, 0x65, 0x56, + 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xCC, 0xBA, 0x98, 0x87, 0x76, 0x77, 0x88, + 0x9A, 0xBC, 0xDC, 0xCD, 0xCC, 0xAA, 0x98, 0x88, 0x88, 0x88, 0x9A, 0xBB, + 0xCD, 0xDC, 0xDC, 0xBB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xCD, 0xDC, + 0xCE, 0xDD, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDE, 0xDD, 0xDD, + 0xDD, 0xCC, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDD, 0xED, 0xDF, 0xEE, 0xDD, + 0xDC, 0xCB, 0xCC, 0xCC, 0xCC, 0xEE, 0xEF, 0xDD, 0xEE, 0xEE, 0xED, 0xDD, + 0xCD, 0xCD, 0xDE, 0xEE, 0xEE, 0xFE, 0x9D, 0xCD, 0xCD, 0xCC, 0xCC, 0xCC, + 0xCC, 0xDD, 0xDD, 0xDE, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xCF, 0xFF, 0xFE, 0xFF, 0xEE, 0xDE, 0xDE, 0xEF, 0xEE, 0xEE, 0xAF, 0xFF, + 0xFF, 0xFE, 0xEE, 0xED, 0xEF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, + 0xDD, 0xCD, 0xCC, 0xDE, 0xEF, 0xFF, 0xFF, 0xEF, 0xFF, 0xEE, 0xDC, 0xBB, + 0xBB, 0xBB, 0xCD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFD, 0xCB, 0xBA, 0x99, 0x9A, + 0xAB, 0xCD, 0xFE, 0xFF, 0xFF, 0xFE, 0xCB, 0xA9, 0x98, 0x88, 0x89, 0x9B, + 0xCD, 0xEF, 0xFE, 0xFF, 0xDC, 0xB9, 0x87, 0x76, 0x77, 0x78, 0xAB, 0xCD, + 0xEF, 0xFE, 0xED, 0xBA, 0x97, 0x66, 0x55, 0x67, 0x79, 0xAB, 0xDE, 0xFF, + 0xEF, 0xCB, 0x98, 0x76, 0x54, 0x45, 0x67, 0x89, 0xBC, 0xEF, 0xFE, 0xEC, + 0xB9, 0x86, 0x54, 0x33, 0x45, 0x68, 0x9B, 0xCE, 0xFF, 0xFE, 0xCB, 0x98, + 0x75, 0x43, 0x34, 0x56, 0x89, 0xBC, 0xEF, 0xFE, 0xED, 0xB9, 0x87, 0x65, + 0x44, 0x55, 0x78, 0x9B, 0xCE, 0xFF, 0xFF, 0xDB, 0xA9, 0x87, 0x65, 0x55, + 0x67, 0x8A, 0xBD, 0xFF, 0xFF, 0xED, 0xCB, 0x98, 0x87, 0x66, 0x77, 0x89, + 0xAC, 0xEF, 0xFF, 0xFF, 0xED, 0xCB, 0x99, 0x88, 0x88, 0x89, 0xAB, 0xCE, + 0xEF, 0xFE, 0xFF, 0xDD, 0xCB, 0xA9, 0x99, 0x9A, 0xAB, 0xCD, 0xFF, 0xFF, + 0xFF, 0xFF, 0xED, 0xCB, 0xBB, 0xBB, 0xBC, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xEE, 0xDC, 0xCC, 0xCC, 0xDD, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, + 0xEE, 0xEE, 0xDE, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xEE, 0xFE, 0xEF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xDD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xDD, 0x9E, 0xEE, + 0xDD, 0xCC, 0xCC, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFE, 0xEF, 0xDD, 0xCC, + 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFF, 0xDD, 0xEC, 0xCB, 0xAA, 0x99, + 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xED, 0xDD, 0xCB, 0xAA, 0x98, 0x88, 0x88, + 0x89, 0xAB, 0xBC, 0xDF, 0xEC, 0xDB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89, + 0xAB, 0xCD, 0xED, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCE, 0xEC, 0xCA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x77, 0x8A, 0xBC, 0xDD, + 0xCC, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCD, 0xDC, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xBB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xCA, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xCC, 0xBA, 0x88, 0x76, 0x55, 0x55, + 0x66, 0x78, 0x9B, 0xCD, 0xDC, 0xDB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x9A, 0xBC, 0xDD, 0xDD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x89, 0xBC, + 0xDE, 0xED, 0xED, 0xCA, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xDD, + 0xDE, 0xDC, 0xCB, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xFD, 0xFE, + 0xDC, 0xBB, 0xBB, 0xAA, 0xAA, 0xBC, 0xCC, 0xDE, 0xFE, 0xDF, 0xEE, 0xDD, + 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xEE, 0xFF, 0xED, 0xFE, 0xFE, 0xED, 0xDD, + 0xCD, 0xDD, 0xDE, 0xFE, 0xFF, 0xFF, 0xAE, 0xEE, 0xED, 0xDD, 0xDD, 0xDD, + 0xDD, 0xEE, 0xFE, 0xEF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xDE, 0xDD, 0xDC, 0xCC, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xEE, 0xBE, 0xEE, + 0xDD, 0xCC, 0xBB, 0xBB, 0xBB, 0xCD, 0xDE, 0xEF, 0xFE, 0xDE, 0xDC, 0xCB, + 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xEF, 0xED, 0xDC, 0xCB, 0xAA, 0x99, + 0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xEE, 0xDC, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0x9A, 0xBC, 0xDE, 0xEC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x89, + 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x67, 0x89, 0xAB, + 0xCD, 0xDC, 0xBA, 0x98, 0x76, 0x65, 0x55, 0x56, 0x67, 0x89, 0xAB, 0xDD, + 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBC, 0xDB, 0xBA, + 0x98, 0x76, 0x55, 0x55, 0x55, 0x67, 0x89, 0xAB, 0xDC, 0xCB, 0xA9, 0x87, + 0x65, 0x55, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCC, 0xBA, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xA9, 0x87, 0x66, 0x55, 0x55, + 0x66, 0x78, 0x9A, 0xBD, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x66, 0x66, 0x78, + 0x99, 0xAC, 0xDD, 0xDC, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCD, 0xDD, 0xDC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xEE, + 0xDE, 0xDC, 0xBA, 0xA9, 0x99, 0x99, 0x99, 0xAB, 0xBC, 0xDE, 0xEE, 0xED, + 0xDC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFE, 0xDF, 0xEE, 0xDC, + 0xCB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xFF, 0xFE, 0xFF, 0xEE, 0xED, 0xDC, + 0xCC, 0xCC, 0xDD, 0xEE, 0xFF, 0xFF, 0xBF, 0xEE, 0xDD, 0xDD, 0xDC, 0xDD, + 0xDD, 0xDE, 0xEF, 0xFF, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xEE, 0xDD, 0xDD, 0xCC, 0xDD, 0xCD, 0xDE, 0xEF, 0xFE, 0xAF, 0xFF, + 0xFD, 0xDC, 0xCC, 0xCC, 0xCC, 0xED, 0xEE, 0xFF, 0xFF, 0xFF, 0xDD, 0xCC, + 0xBB, 0xAA, 0xBB, 0xBB, 0xCD, 0xEE, 0xFF, 0xFE, 0xED, 0xCB, 0xAA, 0xA9, + 0x99, 0x9A, 0xAB, 0xCD, 0xEE, 0xFE, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x99, 0xAB, 0xCD, 0xEF, 0xED, 0xDC, 0xAA, 0x98, 0x77, 0x77, 0x77, 0x89, + 0xAB, 0xCD, 0xFD, 0xDD, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCF, 0xEC, 0xCB, 0xA8, 0x77, 0x65, 0x55, 0x56, 0x77, 0x8A, 0xBC, 0xDE, + 0xCC, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xCE, 0xDC, 0xCA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xCC, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xCD, 0xDC, 0xCA, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xDC, 0xBA, 0x87, 0x76, 0x55, 0x55, + 0x66, 0x78, 0x9B, 0xCD, 0xDD, 0xDC, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x9A, 0xBC, 0xDE, 0xDE, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x99, 0xBB, + 0xCD, 0xED, 0xED, 0xCB, 0xA9, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xEE, + 0xEE, 0xED, 0xCB, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xCD, 0xEF, 0xED, 0xFF, + 0xDD, 0xCB, 0xBB, 0xAA, 0xAA, 0xBC, 0xCD, 0xDE, 0xFF, 0xEF, 0xFF, 0xFD, + 0xDC, 0xCB, 0xBC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFE, 0xFF, 0xFF, 0xEE, 0xDD, + 0xDD, 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xAE, 0xEE, 0xED, 0xED, 0xDD, 0xDD, + 0xDE, 0xEE, 0xEF, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xFF, 0xFF, 0xEE, 0xFE, 0xDE, 0xEE, 0xFF, 0xDE, 0xFF, 0x9F, 0xFF, + 0xFF, 0xFF, 0xDD, 0xDE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, + 0xDC, 0xCC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEC, 0xCB, 0xBA, + 0xAA, 0xAB, 0xCD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x99, 0x99, + 0x9A, 0xBC, 0xDF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x87, 0x77, 0x88, 0x9A, + 0xBD, 0xFF, 0xFF, 0xEF, 0xDB, 0xA9, 0x87, 0x66, 0x66, 0x78, 0x9A, 0xCD, + 0xFF, 0xFF, 0xFC, 0xB9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9B, 0xCE, 0xFF, + 0xEE, 0xCA, 0x98, 0x65, 0x54, 0x45, 0x56, 0x89, 0xAC, 0xDF, 0xFE, 0xDC, + 0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xCD, 0xFF, 0xED, 0xCA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x79, 0xAC, 0xDF, 0xFE, 0xDC, 0xA9, 0x86, 0x65, + 0x44, 0x55, 0x67, 0x9A, 0xCD, 0xFF, 0xEE, 0xCB, 0x98, 0x76, 0x55, 0x55, + 0x67, 0x89, 0xAC, 0xFF, 0xFF, 0xFD, 0xCA, 0x98, 0x76, 0x66, 0x67, 0x88, + 0xAB, 0xCE, 0xFF, 0xFF, 0xFC, 0xBA, 0x98, 0x87, 0x77, 0x89, 0x9B, 0xCD, + 0xFF, 0xFE, 0xFF, 0xDC, 0xBA, 0x99, 0x98, 0x99, 0xAB, 0xCD, 0xFF, 0xFF, + 0xFF, 0xFF, 0xED, 0xCB, 0xBA, 0xAA, 0xAB, 0xCD, 0xEF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xDD, 0xCC, 0xCC, 0xCC, 0xCE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFE, 0xED, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xEE, 0xDE, 0xFE, + 0xFF, 0xFF, 0xFF, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xBE, 0xEE, 0xDD, 0xDD, 0xCC, 0xCC, 0xDD, 0xDD, 0xDD, 0xED, 0x9F, 0xFF, + 0xFE, 0xDD, 0xDD, 0xCD, 0xDD, 0xEF, 0xEE, 0xFF, 0xFE, 0xEF, 0xED, 0xDC, + 0xCC, 0xBB, 0xBC, 0xCC, 0xDD, 0xEE, 0xFF, 0xEE, 0xEE, 0xDC, 0xBB, 0xAA, + 0xAA, 0xAB, 0xBC, 0xDD, 0xEF, 0xFE, 0xDD, 0xCC, 0xCA, 0xA9, 0x99, 0x99, + 0x9A, 0xBC, 0xCD, 0xEF, 0xDE, 0xDC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x9A, + 0xBC, 0xDE, 0xFE, 0xDE, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x9A, 0xBC, + 0xDE, 0xED, 0xDC, 0xA9, 0x87, 0x66, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xEE, + 0xDD, 0xBA, 0x98, 0x76, 0x54, 0x45, 0x67, 0x89, 0xAC, 0xDF, 0xED, 0xDB, + 0xA9, 0x87, 0x54, 0x33, 0x45, 0x78, 0x9A, 0xCC, 0xFD, 0xDC, 0xCA, 0x98, + 0x75, 0x43, 0x34, 0x56, 0x89, 0xAB, 0xCE, 0xDD, 0xDC, 0xA9, 0x87, 0x65, + 0x44, 0x56, 0x78, 0x9A, 0xBD, 0xEE, 0xDD, 0xCA, 0xA9, 0x77, 0x65, 0x56, + 0x67, 0x89, 0xAC, 0xDE, 0xED, 0xED, 0xCA, 0x98, 0x77, 0x76, 0x77, 0x89, + 0xAB, 0xCD, 0xFE, 0xEE, 0xDC, 0xBA, 0x98, 0x88, 0x78, 0x89, 0x9A, 0xBC, + 0xDE, 0xED, 0xFE, 0xCC, 0xBA, 0xA9, 0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xEE, + 0xEF, 0xFD, 0xDC, 0xBB, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xEE, 0xFF, + 0xED, 0xDC, 0xCC, 0xBB, 0xBB, 0xCD, 0xDD, 0xEF, 0xFF, 0xEF, 0xFF, 0xFE, + 0xED, 0xDD, 0xDC, 0xDD, 0xDE, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFE, 0xEE, + 0xEE, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0x9E, 0xDE, 0xDD, 0xDE, 0xDD, 0xCD, + 0xDD, 0xFE, 0xEF, 0xFF, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBA, 0xAA, 0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0x8B, 0xCB, + 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDC, 0xBC, 0xBB, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xCD, 0xCA, 0xBB, 0xA9, 0x99, 0x88, + 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77, + 0x88, 0x89, 0xAA, 0xBC, 0xBA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0xAB, 0xCB, 0xAA, 0x99, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x99, + 0xAB, 0xB9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xBA, + 0x9A, 0x98, 0x77, 0x66, 0x65, 0x56, 0x66, 0x77, 0x89, 0xAB, 0xA9, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x87, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x78, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xBA, 0xAB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xAA, 0xBA, 0xA9, 0x88, 0x87, 0x77, 0x78, 0x88, 0x99, 0xAA, 0xBB, + 0xBC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBB, 0xCB, + 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xCB, 0xBD, 0xCB, 0xBB, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xCC, 0xDD, 0xCC, 0xBB, 0xBA, + 0xAA, 0xBB, 0xBB, 0xBB, 0xCC, 0xDC, 0x9C, 0xCC, 0xBB, 0xBA, 0xAA, 0xAA, + 0xAA, 0xBB, 0xBB, 0xCC, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xAB, 0xCB, + 0xBA, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xDC, 0xBB, 0xBA, 0xA9, + 0x99, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xCA, 0xBA, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77, + 0x78, 0x89, 0x9A, 0xBB, 0xB9, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBB, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, 0x67, 0x78, 0x89, + 0xAB, 0xA9, 0x99, 0x87, 0x77, 0x66, 0x66, 0x66, 0x67, 0x78, 0x9A, 0xAA, + 0x99, 0x98, 0x77, 0x66, 0x66, 0x66, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99, + 0x87, 0x76, 0x66, 0x55, 0x56, 0x67, 0x78, 0x89, 0xAA, 0x99, 0x98, 0x77, + 0x66, 0x65, 0x56, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66, + 0x66, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x77, 0x66, 0x66, 0x66, + 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xAA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, 0x99, 0xAA, 0xBA, + 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBB, 0xCB, + 0xAA, 0x99, 0x99, 0x88, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xBA, + 0xAA, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xBC, 0xDC, 0xCB, 0xBB, 0xAA, + 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDC, 0x9C, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xBB, 0xAA, 0xAA, 0x99, 0x99, 0xAA, 0xAA, 0xBC, 0xCC, 0x9C, 0xCC, + 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xDD, 0xED, 0xBC, 0xBA, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xCB, 0xBB, 0xA9, 0x99, 0x88, + 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77, + 0x88, 0x89, 0xAA, 0xBC, 0xBA, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x99, 0xAB, 0xBB, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, 0x78, 0x99, + 0xAB, 0xBA, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xBA, + 0x9A, 0x98, 0x77, 0x66, 0x55, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0x99, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x99, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xAA, 0xA9, 0x87, 0x76, 0x66, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x78, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xBB, 0xAB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xAB, 0xBB, 0xBA, 0xA9, 0x88, 0x87, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xCB, + 0xBC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x89, 0x99, 0xAA, 0xBC, 0xBB, 0xCB, + 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAB, 0xBC, 0xCC, 0xCD, 0xCB, 0xBA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xCC, 0xED, 0xCC, 0xBB, 0xBB, + 0xBB, 0xAB, 0xBB, 0xBC, 0xDC, 0xDD, 0x9C, 0xCB, 0xBB, 0xBB, 0xAA, 0xAA, + 0xAA, 0xBB, 0xBC, 0xCD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xBC, 0xDC, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0x9D, 0xED, + 0xCC, 0xBB, 0xBA, 0xAB, 0xBB, 0xBC, 0xDD, 0xEF, 0xFE, 0xDD, 0xCC, 0xBA, + 0xAA, 0xAA, 0x9A, 0xAA, 0xBC, 0xCD, 0xDF, 0xEC, 0xDC, 0xAA, 0x99, 0x99, + 0x89, 0x99, 0x9A, 0xBB, 0xCD, 0xDD, 0xCC, 0xBA, 0x99, 0x88, 0x88, 0x88, + 0x89, 0x9A, 0xBB, 0xCD, 0xDB, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x89, + 0x9A, 0xBC, 0xDD, 0xBB, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x77, 0x89, 0x9B, + 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x66, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xCC, + 0xBB, 0x99, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDB, 0xA9, + 0x88, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0x9B, 0xCC, 0xBB, 0xA9, 0x87, + 0x66, 0x54, 0x45, 0x56, 0x77, 0x89, 0xAC, 0xCB, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x88, 0xAA, 0xCC, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x56, + 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBB, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAB, 0xCC, 0xCC, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAA, + 0xBC, 0xDC, 0xDC, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xBB, 0xDD, + 0xCD, 0xCC, 0xBA, 0x99, 0x98, 0x89, 0x99, 0xAA, 0xBC, 0xCD, 0xCD, 0xED, + 0xCB, 0xBA, 0xAA, 0x99, 0x9A, 0xAA, 0xBC, 0xCD, 0xED, 0xDF, 0xED, 0xCC, + 0xBB, 0xBB, 0xAB, 0xBB, 0xBB, 0xCD, 0xDE, 0xED, 0xEE, 0xDD, 0xDC, 0xCC, + 0xBB, 0xCC, 0xCC, 0xDD, 0xEE, 0xEE, 0x9D, 0xCD, 0xCC, 0xCC, 0xCB, 0xBC, + 0xCC, 0xCC, 0xCD, 0xDD, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFE, 0xFF, 0xFD, 0xDD, 0xDC, 0xED, 0xDD, 0xDD, 0x9F, 0xFF, + 0xFF, 0xFF, 0xFE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFE, + 0xED, 0xDD, 0xCD, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xCD, 0xBB, + 0xBB, 0xBC, 0xDD, 0xEF, 0xFF, 0xFE, 0xFF, 0xFF, 0xDC, 0xBA, 0xAA, 0xAA, + 0xAB, 0xCD, 0xDE, 0xFF, 0xEF, 0xFD, 0xDC, 0xBA, 0x98, 0x88, 0x89, 0xAB, + 0xCD, 0xEF, 0xFF, 0xFF, 0xED, 0xBA, 0x88, 0x77, 0x77, 0x89, 0xAB, 0xCD, + 0xFF, 0xFF, 0xFD, 0xCA, 0x98, 0x66, 0x55, 0x67, 0x89, 0xAC, 0xDF, 0xFF, + 0xEF, 0xCB, 0xA8, 0x75, 0x44, 0x45, 0x67, 0x8A, 0xBD, 0xFF, 0xFF, 0xFC, + 0xBA, 0x87, 0x54, 0x33, 0x45, 0x68, 0xAB, 0xDF, 0xFF, 0xFF, 0xDB, 0xA8, + 0x75, 0x43, 0x34, 0x56, 0x8A, 0xBD, 0xEF, 0xFF, 0xFD, 0xBA, 0x87, 0x65, + 0x44, 0x45, 0x78, 0xAB, 0xDF, 0xFF, 0xFF, 0xEC, 0xA9, 0x87, 0x65, 0x55, + 0x68, 0x9A, 0xCD, 0xFF, 0xFF, 0xFF, 0xCC, 0xA9, 0x87, 0x76, 0x77, 0x8A, + 0xBC, 0xFF, 0xFF, 0xFF, 0xFE, 0xCB, 0xA9, 0x98, 0x88, 0x9A, 0xBC, 0xDF, + 0xFF, 0xFF, 0xFF, 0xDE, 0xCB, 0xBA, 0xA9, 0xAA, 0xBC, 0xCD, 0xFF, 0xFF, + 0xFF, 0xFF, 0xDD, 0xDC, 0xBB, 0xBB, 0xCC, 0xDE, 0xFF, 0xFF, 0xFE, 0xFF, + 0xFF, 0xFE, 0xDD, 0xCC, 0xDC, 0xDF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, + 0xFF, 0xED, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xDD, 0xDD, 0xFE, 0xED, 0xDF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDC, 0x9D, 0xEE, + 0xEE, 0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xED, 0xDC, + 0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xDD, 0xED, 0xCB, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xEE, 0xDD, 0xCB, 0xBA, 0x99, 0x99, 0x89, + 0x9A, 0xAB, 0xCD, 0xEE, 0xDC, 0xCC, 0xBA, 0x99, 0x88, 0x77, 0x88, 0x99, + 0xAB, 0xCD, 0xDD, 0xCD, 0xBA, 0x99, 0x87, 0x66, 0x66, 0x78, 0x9A, 0xBC, + 0xDD, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD, + 0xCC, 0xBA, 0x97, 0x66, 0x54, 0x45, 0x66, 0x79, 0xAB, 0xCD, 0xDC, 0xCB, + 0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xDD, 0xCC, 0xBA, 0x87, + 0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x67, 0x8A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xDC, 0xBA, 0x98, 0x76, 0x66, 0x67, 0x88, + 0x9A, 0xBD, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC, + 0xDE, 0xDC, 0xDD, 0xCB, 0xAA, 0x99, 0x98, 0x89, 0x9A, 0xBB, 0xCD, 0xEE, + 0xDE, 0xDD, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBC, 0xDD, 0xDF, 0xED, 0xED, + 0xDC, 0xCC, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xFF, 0xFE, 0xCE, 0xFF, 0xDD, + 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEF, 0xFF, 0xFD, 0xFE, 0xFF, 0xDE, 0xDD, + 0xDD, 0xDD, 0xDE, 0xEF, 0xFF, 0xFE, 0x9D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, + 0xDD, 0xEE, 0xEF, 0xEF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xDD, 0xCC, 0xCC, 0xBB, 0xBC, 0xCC, 0xCC, 0xDD, 0xDD, 0xAE, 0xFE, + 0xDD, 0xCC, 0xCB, 0xBB, 0xBC, 0xCC, 0xDE, 0xEF, 0xFE, 0xDE, 0xDD, 0xCB, + 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xEE, 0xED, 0xDD, 0xCB, 0xAA, 0x99, + 0x99, 0x99, 0xAB, 0xBC, 0xDE, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0xAA, 0xBC, 0xDE, 0xDC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x89, + 0xAB, 0xCC, 0xDD, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xDC, 0xCA, 0x98, 0x77, 0x66, 0x55, 0x56, 0x77, 0x89, 0xBC, 0xDD, + 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xDB, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xDC, 0xBB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCC, 0xBA, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xB9, 0x87, 0x76, 0x55, 0x55, + 0x67, 0x78, 0x9A, 0xBD, 0xCC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBC, 0xDD, 0xCD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x99, 0xAB, + 0xCD, 0xDD, 0xDC, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xED, + 0xDE, 0xDC, 0xBB, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCD, 0xDE, 0xED, 0xED, + 0xDC, 0xBB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFE, 0xDF, 0xEE, 0xDD, + 0xCC, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xED, 0xFF, 0xEE, 0xDD, 0xDD, + 0xCC, 0xDD, 0xDD, 0xEE, 0xFF, 0xFF, 0xAE, 0xDD, 0xDD, 0xDD, 0xDD, 0xCC, + 0xDD, 0xDD, 0xEE, 0xEF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xED, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0xDD, 0x9F, 0xFE, + 0xED, 0xDD, 0xCD, 0xDC, 0xCC, 0xDD, 0xDE, 0xEF, 0xFD, 0xEF, 0xDE, 0xCC, + 0xCB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xEF, 0xDD, 0xED, 0xDC, 0xBB, 0xAA, + 0xAA, 0xAA, 0xAB, 0xCD, 0xEF, 0xFD, 0xDD, 0xDB, 0xBA, 0x99, 0x98, 0x89, + 0x9A, 0xAB, 0xCD, 0xEE, 0xDD, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x78, 0x99, + 0xAB, 0xCD, 0xFD, 0xDD, 0xCB, 0x98, 0x77, 0x66, 0x66, 0x78, 0x9A, 0xBC, + 0xDD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x56, 0x78, 0x9A, 0xBD, 0xDD, + 0xCC, 0xBA, 0x97, 0x65, 0x54, 0x55, 0x56, 0x79, 0xAB, 0xCD, 0xDC, 0xCB, + 0xA8, 0x76, 0x55, 0x44, 0x55, 0x67, 0x8A, 0xBC, 0xED, 0xCC, 0xBA, 0x87, + 0x65, 0x54, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x76, 0x55, + 0x44, 0x55, 0x67, 0x8A, 0xBC, 0xDC, 0xCD, 0xCA, 0x98, 0x76, 0x55, 0x55, + 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xDC, 0xBA, 0x98, 0x76, 0x66, 0x67, 0x88, + 0x9A, 0xCC, 0xDD, 0xDD, 0xCC, 0xAA, 0x98, 0x77, 0x77, 0x88, 0x9A, 0xBC, + 0xDD, 0xDC, 0xED, 0xCB, 0xA9, 0x99, 0x88, 0x89, 0x9A, 0xBC, 0xCE, 0xED, + 0xDF, 0xDC, 0xCB, 0xBA, 0xA9, 0xAA, 0xAA, 0xBC, 0xDD, 0xEF, 0xED, 0xEE, + 0xDD, 0xCC, 0xCC, 0xBB, 0xBB, 0xBC, 0xDD, 0xEE, 0xEE, 0xEF, 0xFE, 0xED, + 0xDC, 0xDC, 0xCC, 0xCD, 0xDD, 0xEF, 0xFF, 0xFE, 0xFF, 0xEE, 0xFD, 0xDD, + 0xDD, 0xDD, 0xED, 0xDF, 0xFF, 0xFF, 0x9D, 0xDD, 0xCD, 0xDD, 0xDD, 0xDD, + 0xDD, 0xDE, 0xDE, 0xEF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xFF, 0xFE, 0xFE, 0xDE, 0xCD, 0xDD, 0xED, 0xDD, 0xDE, 0x8F, 0xFF, + 0xFF, 0xEF, 0xED, 0xEE, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, + 0xDD, 0xDC, 0xDD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xCC, 0xBB, + 0xBB, 0xBB, 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFD, 0xCC, 0xBA, 0xA9, 0x9A, + 0xAB, 0xCD, 0xEF, 0xFF, 0xFF, 0xFE, 0xDC, 0xA9, 0x88, 0x88, 0x89, 0xAA, + 0xCD, 0xFF, 0xFF, 0xEF, 0xEC, 0xB9, 0x87, 0x76, 0x77, 0x88, 0xAB, 0xCE, + 0xFF, 0xFF, 0xFD, 0xBA, 0x97, 0x66, 0x55, 0x66, 0x89, 0xAC, 0xDF, 0xFF, + 0xEE, 0xDB, 0xA8, 0x76, 0x54, 0x45, 0x67, 0x8A, 0xBD, 0xFF, 0xFD, 0xDD, + 0xB9, 0x86, 0x54, 0x33, 0x45, 0x68, 0x9B, 0xCF, 0xFF, 0xEF, 0xCB, 0x98, + 0x65, 0x43, 0x34, 0x56, 0x89, 0xBC, 0xFF, 0xFD, 0xED, 0xBA, 0x87, 0x65, + 0x44, 0x55, 0x78, 0x9B, 0xDD, 0xFE, 0xEF, 0xDC, 0xA9, 0x87, 0x65, 0x55, + 0x67, 0x9A, 0xBD, 0xFF, 0xFF, 0xFD, 0xCB, 0xA8, 0x87, 0x66, 0x77, 0x89, + 0xBC, 0xDF, 0xFF, 0xFF, 0xDD, 0xBB, 0xA9, 0x88, 0x88, 0x89, 0xAB, 0xCF, + 0xFF, 0xFF, 0xFF, 0xEC, 0xCB, 0xAA, 0xA9, 0x9A, 0xBB, 0xDD, 0xFF, 0xFF, + 0xFF, 0xFD, 0xED, 0xCB, 0xBB, 0xBB, 0xCC, 0xCD, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xED, 0xDC, 0xCD, 0xCD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xEF, 0xEE, 0xED, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9D, 0xDE, 0xEF, 0xFE, 0xED, 0xEF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xBC, 0xCC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0x9D, 0xED, + 0xDC, 0xBB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDF, 0xED, 0xDD, 0xDC, 0xBB, + 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDF, 0xDC, 0xCC, 0xBB, 0xA9, 0x99, + 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xDD, 0xCC, 0xBA, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0x9A, 0xBC, 0xCD, 0xDB, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xBC, 0xCC, 0xBB, 0xAA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAA, + 0xBC, 0xCB, 0xBA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xCB, + 0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xAA, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x55, + 0x67, 0x78, 0x9A, 0xBC, 0xBB, 0xBA, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x89, 0xAB, 0xCC, 0xBC, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xBC, 0xDC, 0xCB, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xCC, + 0xCD, 0xCB, 0xBA, 0x99, 0x98, 0x99, 0x9A, 0xAB, 0xBB, 0xDD, 0xCC, 0xDC, + 0xCC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDE, 0xCD, 0xDD, 0xCC, + 0xBB, 0xBB, 0xBB, 0xBB, 0xBD, 0xDD, 0xEF, 0xDD, 0xED, 0xDD, 0xCC, 0xCC, + 0xBC, 0xCC, 0xCD, 0xDD, 0xEE, 0xFD, 0x8D, 0xCC, 0xCC, 0xBB, 0xBB, 0xBB, + 0xCB, 0xCC, 0xDD, 0xDE, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBA, 0xAA, 0xAA, 0x99, 0x99, 0x9A, 0xAA, 0xAB, 0xBB, 0x8B, 0xCC, + 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCC, 0xDC, 0xBC, 0xBB, 0xAA, + 0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCD, 0xCA, 0xBB, 0xAA, 0x99, 0x98, + 0x88, 0x89, 0x99, 0xAA, 0xBB, 0xCB, 0xAB, 0xAA, 0x99, 0x88, 0x77, 0x78, + 0x88, 0x99, 0xAA, 0xBC, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x78, + 0x99, 0xAB, 0xBB, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, 0x78, 0x9A, + 0xAB, 0xBA, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, 0x89, 0x9A, 0xBA, + 0x9A, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xA9, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0x9A, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xA9, 0xA9, 0x88, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0x9A, 0x98, 0x87, 0x76, 0x65, 0x56, + 0x66, 0x78, 0x89, 0xAB, 0xAA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAA, 0xBA, 0xAB, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xBB, 0xBA, 0xBA, 0xA9, 0x98, 0x88, 0x77, 0x88, 0x88, 0x9A, 0xAB, 0xCB, + 0xBB, 0xBA, 0xA9, 0x99, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xBC, 0xBB, 0xCB, + 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCC, 0xBC, 0xCB, 0xBB, + 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xCD, 0xCB, 0xDC, 0xCC, 0xBB, 0xBB, + 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDC, 0x8C, 0xBB, 0xBA, 0xAB, 0xAA, 0xAA, + 0xAB, 0xBB, 0xBB, 0xCC, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBB, 0x9B, 0xCB, + 0xBB, 0xAA, 0xAA, 0x9A, 0xAA, 0xAA, 0xBB, 0xCC, 0xDC, 0xBC, 0xBA, 0xA9, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBA, 0xBA, 0xA9, 0x99, 0x88, + 0x88, 0x88, 0x99, 0x9A, 0xBB, 0xCB, 0xAA, 0xA9, 0x98, 0x88, 0x77, 0x77, + 0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0xAA, 0xBA, 0x9A, 0x99, 0x87, 0x77, 0x66, 0x66, 0x77, 0x78, 0x99, + 0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA, + 0x9A, 0x98, 0x77, 0x66, 0x65, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0x99, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0x99, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x87, 0x76, 0x66, + 0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x78, 0x89, 0xAA, 0xA9, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x66, 0x77, + 0x89, 0x9A, 0xBA, 0xAA, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xAA, 0xBA, 0x99, 0x88, 0x87, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xBB, + 0xAB, 0xBA, 0x99, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBB, 0xCB, + 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xBA, + 0xAA, 0xA9, 0x99, 0xAA, 0xAB, 0xBB, 0xCC, 0xCB, 0xDC, 0xCB, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDC, 0x9B, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAB, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0x8C, 0xCC, + 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCC, 0xDC, 0xBC, 0xBB, 0xAA, + 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCD, 0xCB, 0xBB, 0xAA, 0x99, 0x88, + 0x88, 0x89, 0x99, 0xAA, 0xBC, 0xCB, 0xBB, 0xBA, 0x99, 0x88, 0x77, 0x78, + 0x88, 0x99, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x88, + 0x99, 0xAB, 0xCB, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x67, 0x88, 0x9A, + 0xBC, 0xBA, 0xA9, 0x88, 0x76, 0x66, 0x56, 0x66, 0x77, 0x88, 0x9A, 0xBB, + 0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xAA, 0xA9, + 0x87, 0x76, 0x55, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xBA, 0xAA, 0x98, 0x77, + 0x65, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xAA, 0xA9, 0x88, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x99, 0x87, 0x76, 0x65, 0x66, + 0x67, 0x78, 0x99, 0xAB, 0xAA, 0xBA, 0x98, 0x87, 0x66, 0x66, 0x66, 0x77, + 0x89, 0xAA, 0xBB, 0xBB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x78, 0x88, 0x9A, + 0xBB, 0xBB, 0xBB, 0xA9, 0x98, 0x88, 0x77, 0x88, 0x89, 0x9A, 0xAB, 0xCB, + 0xBC, 0xBB, 0xA9, 0x99, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCC, 0xBB, 0xCC, + 0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCC, 0xCD, 0xCC, 0xBB, + 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xCC, 0xDD, 0xCC, 0xCB, 0xBB, + 0xBB, 0xBB, 0xBB, 0xCC, 0xCE, 0xEC, 0x9C, 0xCB, 0xBB, 0xBA, 0xAA, 0xAA, + 0xAB, 0xBB, 0xBC, 0xCC, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xBF, 0xDC, 0xCC, 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCC, 0xCD, 0x7D, 0xFD, + 0xDD, 0xCC, 0xCB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEF, 0xFD, 0xDE, 0xDC, 0xCB, + 0xBB, 0xAA, 0xAA, 0xBB, 0xCC, 0xCE, 0xEE, 0xDC, 0xDC, 0xCB, 0xAA, 0x99, + 0x99, 0x9A, 0xAB, 0xCC, 0xCD, 0xED, 0xCD, 0xCB, 0xA9, 0x99, 0x88, 0x88, + 0x99, 0xAB, 0xBC, 0xDE, 0xCC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x78, 0x89, + 0xAA, 0xBD, 0xDD, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x78, 0x89, 0xAB, + 0xCD, 0xCC, 0xCA, 0xA8, 0x77, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC, + 0xBC, 0xA9, 0x87, 0x65, 0x54, 0x55, 0x66, 0x78, 0x9A, 0xBD, 0xCB, 0xBA, + 0x98, 0x76, 0x54, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87, + 0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xCC, 0xCA, 0x98, 0x76, 0x65, + 0x54, 0x56, 0x67, 0x89, 0xAC, 0xCC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x56, + 0x67, 0x88, 0x9A, 0xBD, 0xDC, 0xCB, 0xA9, 0x88, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBC, 0xDC, 0xCD, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x88, 0x99, 0xAB, + 0xCD, 0xDC, 0xDC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xFD, + 0xDD, 0xDC, 0xBB, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDD, 0xED, 0xED, + 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xEE, 0xDF, 0xEE, 0xDC, + 0xCC, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xED, 0xEE, 0xFD, 0xDD, 0xCC, + 0xCC, 0xCC, 0xDD, 0xEE, 0xFF, 0xEE, 0x8D, 0xDC, 0xDC, 0xCC, 0xCC, 0xCC, + 0xCD, 0xDD, 0xDD, 0xEE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xEF, 0xFD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDC, 0xDD, 0x8F, 0xFF, + 0xFF, 0xFE, 0xFD, 0xDE, 0xFE, 0xFE, 0xEF, 0xFF, 0xFD, 0xFF, 0xFF, 0xEE, + 0xDC, 0xCD, 0xDC, 0xDD, 0xEE, 0xFF, 0xFF, 0xDF, 0xFF, 0xED, 0xDC, 0xCB, + 0xBB, 0xBC, 0xCD, 0xDE, 0xEF, 0xFE, 0xEF, 0xEE, 0xCC, 0xBA, 0xA9, 0x9A, + 0xAB, 0xCC, 0xDE, 0xFF, 0xEE, 0xFE, 0xDC, 0xBA, 0x98, 0x88, 0x89, 0x9B, + 0xCD, 0xDE, 0xFF, 0xDE, 0xDC, 0xBA, 0x97, 0x76, 0x77, 0x89, 0xAB, 0xCD, + 0xFF, 0xDD, 0xED, 0xBA, 0x97, 0x66, 0x55, 0x66, 0x89, 0xAC, 0xCD, 0xFE, + 0xDE, 0xDB, 0xA8, 0x76, 0x54, 0x45, 0x67, 0x8A, 0xBC, 0xEE, 0xED, 0xEC, + 0xB9, 0x86, 0x54, 0x33, 0x45, 0x68, 0x9B, 0xCE, 0xFE, 0xDD, 0xCB, 0xA8, + 0x75, 0x43, 0x34, 0x56, 0x8A, 0xBC, 0xEF, 0xEE, 0xEC, 0xBA, 0x87, 0x65, + 0x44, 0x46, 0x78, 0xAB, 0xCD, 0xFE, 0xED, 0xDB, 0xA9, 0x87, 0x65, 0x55, + 0x67, 0x9A, 0xBD, 0xDF, 0xFD, 0xED, 0xCB, 0xA9, 0x87, 0x66, 0x77, 0x8A, + 0xBC, 0xDE, 0xFF, 0xDE, 0xDD, 0xBA, 0xA9, 0x88, 0x88, 0x99, 0xAB, 0xDD, + 0xEF, 0xFD, 0xFE, 0xDC, 0xCB, 0xAA, 0x99, 0xAA, 0xBC, 0xCD, 0xFF, 0xFF, + 0xDF, 0xFE, 0xDD, 0xCC, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xFF, 0xED, 0xFF, + 0xEE, 0xDD, 0xDC, 0xCC, 0xCD, 0xDD, 0xEF, 0xFF, 0xFF, 0xDF, 0xFE, 0xEE, + 0xEE, 0xED, 0xEE, 0xDF, 0xFE, 0xFF, 0xFF, 0xFC, 0xFF, 0xEF, 0xEF, 0xFE, + 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8C, 0xCC, 0xDD, 0xDD, 0xDD, 0xDD, + 0xDE, 0xFF, 0xEF, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xED, 0xDD, 0xCD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0x9E, 0xFE, + 0xED, 0xDD, 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xEF, 0xFD, 0xEF, 0xED, 0xDC, + 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xDF, 0xDD, 0xED, 0xCC, 0xBA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xED, 0xDD, 0xDC, 0xBA, 0x99, 0x98, 0x89, + 0x9A, 0xAB, 0xCD, 0xDD, 0xDD, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x99, + 0xAB, 0xCD, 0xED, 0xCC, 0xCA, 0x98, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xAC, + 0xDD, 0xDC, 0xCB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD, + 0xCC, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB, + 0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xDD, 0xCC, 0xBA, 0x87, + 0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x78, + 0x9B, 0xBC, 0xDD, 0xCC, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC, + 0xDE, 0xDC, 0xEC, 0xCB, 0xAA, 0x99, 0x88, 0x99, 0x9A, 0xBC, 0xDD, 0xFE, + 0xCE, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBC, 0xCE, 0xEF, 0xFC, 0xED, + 0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xFF, 0xDE, 0xED, 0xDD, + 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xFF, 0xFD, 0xFE, 0xEE, 0xED, 0xED, + 0xDD, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0x9D, 0xDD, 0xDC, 0xDC, 0xDD, 0xDD, + 0xDD, 0xEE, 0xEF, 0xEF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xDD, 0xDC, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xCC, 0xDD, 0xAE, 0xEE, + 0xDD, 0xCC, 0xCB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEE, 0xED, 0xDE, 0xDC, 0xCB, + 0xBA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDE, 0xDD, 0xDC, 0xCB, 0xAA, 0x99, + 0x99, 0x99, 0xAA, 0xBC, 0xDD, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x99, 0xAA, 0xBC, 0xDD, 0xDC, 0xCB, 0xA9, 0x98, 0x77, 0x77, 0x78, 0x89, + 0xAB, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xCB, 0xCA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xAC, 0xDC, + 0xBB, 0xA9, 0x87, 0x65, 0x54, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87, + 0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x78, 0x9A, 0xBD, 0xCC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x99, 0xAB, + 0xCD, 0xDC, 0xDC, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xED, + 0xCD, 0xCC, 0xBA, 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xDC, 0xED, + 0xCC, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xEE, 0xDE, 0xDD, 0xDC, + 0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xFD, 0xEE, 0xED, 0xDD, 0xCC, + 0xCC, 0xCC, 0xDD, 0xEE, 0xFF, 0xFF, 0x9D, 0xDD, 0xDD, 0xCC, 0xCC, 0xCC, + 0xCD, 0xDE, 0xEE, 0xEF, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xDE, 0xEE, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDC, 0x9E, 0xFE, + 0xED, 0xDD, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0xEF, 0xFD, 0xDF, 0xED, 0xDC, + 0xCB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xDE, 0xDE, 0xED, 0xCC, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCC, 0xCD, 0xED, 0xDE, 0xDC, 0xBA, 0x99, 0x99, 0x99, + 0x9A, 0xAB, 0xCC, 0xDE, 0xDC, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x99, + 0xAB, 0xCD, 0xDD, 0xCD, 0xBA, 0xA8, 0x77, 0x66, 0x67, 0x78, 0x9A, 0xBB, + 0xDD, 0xCC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC, + 0xCD, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xCB, + 0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88, + 0x9B, 0xCC, 0xED, 0xCD, 0xCB, 0xAA, 0x98, 0x87, 0x78, 0x89, 0x9A, 0xBC, + 0xDE, 0xDD, 0xDC, 0xCB, 0xAA, 0x99, 0x88, 0x99, 0xAA, 0xBC, 0xCD, 0xED, + 0xDE, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBC, 0xDD, 0xDE, 0xEC, 0xDD, + 0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xFE, 0xDE, 0xEE, 0xDD, + 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xEE, 0xFF, 0xFD, 0xEE, 0xEE, 0xDD, 0xDC, + 0xDD, 0xDD, 0xDD, 0xEF, 0xFF, 0xFF, 0x9D, 0xDC, 0xDC, 0xCC, 0xCC, 0xCD, + 0xDD, 0xED, 0xEE, 0xEE, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xFF, 0xEF, 0xED, 0xDD, 0xCD, 0xDC, 0xCC, 0xCD, 0xDD, 0x8F, 0xFF, + 0xFF, 0xFF, 0xEE, 0xDD, 0xDE, 0xEF, 0xEF, 0xFF, 0xFE, 0xFF, 0xFF, 0xEE, + 0xDD, 0xCC, 0xCC, 0xDD, 0xEE, 0xEF, 0xFF, 0xDF, 0xFF, 0xED, 0xCC, 0xBB, + 0xBB, 0xBB, 0xCD, 0xDE, 0xFF, 0xFE, 0xEF, 0xFD, 0xCB, 0xAA, 0x99, 0x9A, + 0xAB, 0xBC, 0xDE, 0xFF, 0xEE, 0xFD, 0xCB, 0xA9, 0x98, 0x88, 0x89, 0x9B, + 0xCC, 0xEE, 0xFD, 0xEF, 0xDB, 0xA9, 0x87, 0x76, 0x67, 0x88, 0x9B, 0xCD, + 0xFF, 0xFD, 0xDD, 0xBA, 0x97, 0x66, 0x55, 0x66, 0x89, 0xAB, 0xDE, 0xFF, + 0xDD, 0xCB, 0x98, 0x76, 0x54, 0x45, 0x67, 0x8A, 0xBC, 0xDF, 0xFE, 0xEC, + 0xA9, 0x86, 0x54, 0x33, 0x45, 0x68, 0x9B, 0xCD, 0xFE, 0xDD, 0xCB, 0x98, + 0x65, 0x43, 0x34, 0x56, 0x89, 0xBC, 0xDF, 0xED, 0xDC, 0xBA, 0x87, 0x65, + 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xEE, 0xDE, 0xCB, 0xA9, 0x76, 0x65, 0x56, + 0x67, 0x8A, 0xBD, 0xDF, 0xFD, 0xFD, 0xCB, 0x98, 0x87, 0x66, 0x77, 0x89, + 0xAC, 0xEF, 0xFF, 0xDF, 0xDD, 0xBB, 0xA9, 0x88, 0x88, 0x99, 0xAB, 0xCE, + 0xFF, 0xFD, 0xEF, 0xDD, 0xCB, 0xAA, 0x99, 0x9A, 0xBB, 0xCD, 0xEF, 0xFF, + 0xEF, 0xFE, 0xDD, 0xCC, 0xBB, 0xBB, 0xBC, 0xCD, 0xEF, 0xFF, 0xFE, 0xFF, + 0xDE, 0xDD, 0xCC, 0xCC, 0xCC, 0xDE, 0xEF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, + 0xEE, 0xED, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFE, 0xEF, 0xFF, 0xFF, 0xFF, 0x9D, 0xDD, 0xDD, 0xEE, 0xDD, 0xDF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xCC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCC, 0x8D, 0xEE, + 0xCC, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xEF, 0xED, 0xCD, 0xDC, 0xCB, + 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDD, 0xCC, 0xDC, 0xBB, 0xAA, 0x99, + 0x99, 0x99, 0xAA, 0xBC, 0xCC, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0x9A, 0xBC, 0xCD, 0xCC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x89, + 0x9A, 0xBC, 0xDC, 0xBB, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xBC, 0xCB, 0xBA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xDC, + 0xBB, 0xA9, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87, + 0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xBB, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x88, 0x76, 0x65, 0x55, + 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xAB, 0xCC, 0xBC, 0xBA, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x99, 0xAB, + 0xCD, 0xCC, 0xCC, 0xBA, 0x99, 0x98, 0x88, 0x88, 0x99, 0xAB, 0xBC, 0xDC, + 0xCD, 0xCC, 0xBA, 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xCC, 0xDD, 0xDC, 0xED, + 0xCC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xED, 0xCE, 0xED, 0xCC, + 0xBB, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xEE, 0xDC, 0xEE, 0xED, 0xDC, 0xCC, + 0xCC, 0xCC, 0xCC, 0xDD, 0xEE, 0xFE, 0x7C, 0xCC, 0xCC, 0xCB, 0xCB, 0xBB, + 0xCC, 0xCC, 0xDE, 0xDE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xBB, 0xBA, 0xAA, 0xAA, 0x9A, 0xAA, 0xAA, 0xAB, 0xBB, 0x8C, 0xDC, + 0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0xCC, 0xDC, 0xBC, 0xCB, 0xBA, + 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCD, 0xBB, 0xBB, 0xAA, 0x99, 0x99, + 0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xCB, 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, + 0x88, 0x9A, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x77, 0x89, 0x9A, + 0xBB, 0xBA, 0xAA, 0x98, 0x76, 0x66, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xBB, + 0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xAA, 0xA9, + 0x98, 0x76, 0x55, 0x45, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x98, 0x87, + 0x66, 0x54, 0x45, 0x56, 0x78, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x56, + 0x66, 0x78, 0x99, 0xAB, 0xAA, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x67, 0x78, + 0x89, 0xAA, 0xBB, 0xAB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, 0x9A, + 0xBC, 0xBA, 0xBB, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xBB, 0xCB, + 0xBC, 0xBA, 0xAA, 0x99, 0x98, 0x89, 0x99, 0x9A, 0xAB, 0xCC, 0xBB, 0xCB, + 0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDC, 0xBD, 0xCC, 0xBB, + 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDD, 0xCB, 0xDD, 0xCC, 0xCB, 0xBB, + 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xED, 0x8B, 0xBB, 0xBB, 0xBA, 0xAA, 0xAA, + 0xBB, 0xBB, 0xBC, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0x9B, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0x9B, 0xCB, + 0xBB, 0xAA, 0xAA, 0x9A, 0xAA, 0xAA, 0xBB, 0xBC, 0xDB, 0xBB, 0xBA, 0xA9, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBA, 0xBA, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x99, 0xAA, 0xBB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x78, + 0x88, 0x99, 0xAA, 0xBB, 0xAA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, + 0x99, 0xAA, 0xBA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x99, + 0xAB, 0xA9, 0xA9, 0x88, 0x77, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xBA, + 0x9A, 0x98, 0x77, 0x66, 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xA9, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x99, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0xA9, 0x88, 0x76, 0x66, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x78, 0x89, 0xAA, 0xA9, 0xA9, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xAA, 0xBA, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x88, 0x99, 0xAA, 0xBA, + 0xAB, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBA, 0xCB, + 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCB, 0xBC, 0xCB, 0xBA, + 0xAA, 0xAA, 0x99, 0xAA, 0xAA, 0xBB, 0xCC, 0xCB, 0xCC, 0xCB, 0xBB, 0xBA, + 0xAA, 0xAA, 0xBB, 0xBC, 0xCC, 0xDC, 0x9B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBB, 0xAA, 0xAA, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0xBB, 0x8B, 0xCC, + 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDB, 0xBC, 0xBB, 0xAA, + 0xA9, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xBB, 0xBB, 0xAA, 0x99, 0x88, + 0x88, 0x89, 0x99, 0xAA, 0xBC, 0xCB, 0xAB, 0xAA, 0x98, 0x88, 0x87, 0x88, + 0x88, 0x99, 0xAB, 0xBC, 0xBA, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, + 0x99, 0xAB, 0xBA, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x9A, + 0xAB, 0xAA, 0xA9, 0x98, 0x76, 0x66, 0x56, 0x66, 0x77, 0x89, 0x9A, 0xBA, + 0x9A, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xA9, 0xA9, + 0x87, 0x76, 0x55, 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0x9A, 0x98, 0x87, + 0x66, 0x55, 0x55, 0x56, 0x77, 0x89, 0xAB, 0xA9, 0xA9, 0x88, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x99, 0x87, 0x76, 0x66, 0x56, + 0x66, 0x78, 0x89, 0xAB, 0xAA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAA, 0xBA, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xBB, 0xBA, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x88, 0x9A, 0xAB, 0xCB, + 0xAC, 0xBA, 0xA9, 0x99, 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xBB, 0xCB, + 0xBA, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCB, 0xBC, 0xCB, 0xBB, + 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xCB, 0xDD, 0xCC, 0xBB, 0xBB, + 0xBB, 0xBB, 0xBB, 0xCC, 0xDC, 0xDC, 0x8B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xBB, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xCC, 0xCC, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xCC, 0x7D, 0xFE, + 0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEE, 0xED, 0xDD, 0xDC, 0xBB, + 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDE, 0xDC, 0xDC, 0xCB, 0xA9, 0x99, + 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xED, 0xCD, 0xBA, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0x9A, 0xAC, 0xCD, 0xCC, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x89, + 0x9A, 0xBC, 0xDD, 0xBC, 0xA9, 0x98, 0x77, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCC, 0xCB, 0xBA, 0x98, 0x77, 0x65, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xCC, + 0xBB, 0xA9, 0x87, 0x65, 0x54, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x88, 0x76, 0x65, 0x55, + 0x67, 0x78, 0x9A, 0xBC, 0xCB, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x78, + 0x99, 0xBB, 0xCC, 0xCC, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCC, 0xCC, 0xDC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xBC, 0xDD, + 0xCC, 0xCC, 0xBA, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDE, 0xDC, 0xDD, + 0xCC, 0xBB, 0xBA, 0xAA, 0xAA, 0xAB, 0xCC, 0xDE, 0xED, 0xDE, 0xDD, 0xCC, + 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xDD, 0xEF, 0xED, 0xED, 0xEE, 0xEC, 0xCC, + 0xCC, 0xCC, 0xDD, 0xDE, 0xFF, 0xFE, 0x8D, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, + 0xCC, 0xCC, 0xDD, 0xEF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xFF, 0xFF, 0xED, 0xDC, 0xDD, 0xDD, 0xCD, 0xCC, 0xCC, 0x8F, 0xFF, + 0xFF, 0xEE, 0xEE, 0xED, 0xEE, 0xEF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFE, + 0xDD, 0xDD, 0xCD, 0xCD, 0xEE, 0xEF, 0xEF, 0xEE, 0xFF, 0xED, 0xDD, 0xCB, + 0xBB, 0xBC, 0xCD, 0xDD, 0xEF, 0xFD, 0xEF, 0xDE, 0xDC, 0xBA, 0xAA, 0xAA, + 0xAB, 0xCD, 0xDE, 0xFF, 0xDE, 0xFE, 0xDC, 0xA9, 0x98, 0x88, 0x99, 0xAB, + 0xCC, 0xEF, 0xFD, 0xEF, 0xDC, 0xB9, 0x87, 0x77, 0x77, 0x89, 0xAB, 0xCD, + 0xEF, 0xEE, 0xDD, 0xCA, 0x98, 0x66, 0x55, 0x67, 0x89, 0xAC, 0xDE, 0xFE, + 0xED, 0xDB, 0xA8, 0x76, 0x44, 0x45, 0x67, 0x8A, 0xBD, 0xEF, 0xDD, 0xED, + 0xBA, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xCE, 0xFE, 0xDE, 0xCB, 0xA8, + 0x75, 0x43, 0x34, 0x56, 0x89, 0xBC, 0xEF, 0xED, 0xED, 0xCA, 0x87, 0x65, + 0x44, 0x45, 0x78, 0xAB, 0xCE, 0xEE, 0xDD, 0xDC, 0xA9, 0x87, 0x65, 0x55, + 0x68, 0x9A, 0xCD, 0xDF, 0xFD, 0xFD, 0xCB, 0xA9, 0x87, 0x76, 0x77, 0x89, + 0xBC, 0xDE, 0xEF, 0xCE, 0xDC, 0xCB, 0xA9, 0x98, 0x88, 0x99, 0xBB, 0xDD, + 0xFF, 0xED, 0xEF, 0xEC, 0xCB, 0xAA, 0xA9, 0xAA, 0xBB, 0xDD, 0xEF, 0xFF, + 0xCD, 0xED, 0xDC, 0xCC, 0xBB, 0xBB, 0xBC, 0xDD, 0xFF, 0xFF, 0xFC, 0xFE, + 0xDD, 0xDD, 0xDC, 0xCD, 0xCD, 0xDD, 0xFF, 0xFF, 0xFF, 0xCE, 0xDE, 0xED, + 0xDD, 0xEE, 0xDE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFC, 0xFE, 0xFE, 0xDE, 0xEE, + 0xDE, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0x7C, 0xCC, 0xCC, 0xCD, 0xDD, 0xDE, + 0xEE, 0xDE, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xDD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x9E, 0xFE, + 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDE, 0xEE, 0xFD, 0xDF, 0xED, 0xCC, + 0xCB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEE, 0xDD, 0xED, 0xDC, 0xBA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xED, 0xDD, 0xDC, 0xBA, 0x99, 0x98, 0x99, + 0x9A, 0xAB, 0xCD, 0xDE, 0xDC, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x99, + 0xAB, 0xCD, 0xED, 0xCC, 0xCB, 0x99, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBC, + 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD, + 0xCC, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB, + 0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x79, 0xAB, 0xCD, 0xCC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88, + 0x9A, 0xCD, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC, + 0xDE, 0xDC, 0xDC, 0xCB, 0xAA, 0x99, 0x98, 0x99, 0x9A, 0xBC, 0xDE, 0xED, + 0xCD, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xEF, 0xDC, 0xED, + 0xDC, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xFE, 0xCE, 0xED, 0xDD, + 0xDC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xFF, 0xEC, 0xFE, 0xEE, 0xED, 0xDD, + 0xDD, 0xDD, 0xEE, 0xEE, 0xFF, 0xFF, 0x8D, 0xDD, 0xDC, 0xDD, 0xDD, 0xDD, + 0xDD, 0xDD, 0xEE, 0xEE, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCD, 0xDD, 0xCC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCC, 0xCC, 0xAE, 0xEE, + 0xDD, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xED, 0xDE, 0xDC, 0xCB, + 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDE, 0xDD, 0xDC, 0xCB, 0xAA, 0x99, + 0x99, 0x99, 0xAA, 0xBC, 0xCD, 0xDD, 0xCD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0x9A, 0xBC, 0xCD, 0xCC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x89, + 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xCB, 0xBA, 0x98, 0x76, 0x65, 0x55, 0x66, 0x78, 0x89, 0xAB, 0xCC, + 0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x88, 0x76, 0x65, 0x55, + 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCD, 0xDC, 0xCC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xED, + 0xCD, 0xCB, 0xBA, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCC, 0xDE, 0xDC, 0xDD, + 0xCC, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xDE, 0xFE, 0xCE, 0xDD, 0xCC, + 0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xED, 0xEE, 0xDD, 0xDC, 0xCC, + 0xCC, 0xCC, 0xDD, 0xEE, 0xEF, 0xFE, 0xAD, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, + 0xCC, 0xDD, 0xEE, 0xEF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xDD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCD, 0x9E, 0xFF, + 0xED, 0xDD, 0xCC, 0xCC, 0xCC, 0xDD, 0xDD, 0xDE, 0xFD, 0xEE, 0xED, 0xCC, + 0xCB, 0xBB, 0xBB, 0xBB, 0xCD, 0xDD, 0xEE, 0xDD, 0xED, 0xCC, 0xBA, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBC, 0xDD, 0xED, 0xDD, 0xCC, 0xBA, 0x99, 0x98, 0x99, + 0x9A, 0xAB, 0xCD, 0xDE, 0xDD, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A, + 0xAB, 0xCD, 0xDD, 0xCD, 0xCB, 0x98, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBB, + 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC, + 0xCC, 0xBA, 0x98, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xCC, 0xCB, + 0xA8, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xCC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xDB, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88, + 0x9A, 0xCD, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC, + 0xDE, 0xDC, 0xDC, 0xCB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xBC, 0xCD, 0xED, + 0xCE, 0xDC, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBC, 0xCD, 0xEF, 0xEC, 0xED, + 0xDC, 0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEE, 0xFE, 0xCE, 0xED, 0xDD, + 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFD, 0xEE, 0xEE, 0xDD, 0xDD, + 0xDD, 0xDD, 0xDE, 0xEF, 0xEF, 0xFF, 0x9C, 0xCD, 0xDC, 0xDC, 0xCC, 0xCD, + 0xDD, 0xDD, 0xEE, 0xFE, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCF, 0xFE, 0xED, 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x7E, 0xFF, + 0xFF, 0xFE, 0xEE, 0xDD, 0xDD, 0xDE, 0xEE, 0xEF, 0xFD, 0xDF, 0xFE, 0xFE, + 0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xEE, 0xEF, 0xDE, 0xFE, 0xEE, 0xCC, 0xBB, + 0xBB, 0xBB, 0xCC, 0xCD, 0xEF, 0xFD, 0xEF, 0xED, 0xCB, 0xBA, 0xA9, 0x9A, + 0xAB, 0xBC, 0xDD, 0xEE, 0xDE, 0xED, 0xCB, 0xA9, 0x98, 0x88, 0x89, 0xAA, + 0xCC, 0xDE, 0xED, 0xDE, 0xDB, 0xB9, 0x87, 0x76, 0x77, 0x89, 0xAB, 0xCD, + 0xEF, 0xDE, 0xDC, 0xBA, 0x97, 0x66, 0x55, 0x67, 0x89, 0xAC, 0xCE, 0xFD, + 0xDD, 0xCB, 0xA8, 0x75, 0x54, 0x45, 0x67, 0x8A, 0xBD, 0xDF, 0xED, 0xEC, + 0xB9, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xCD, 0xED, 0xDD, 0xCB, 0xA8, + 0x75, 0x43, 0x34, 0x56, 0x89, 0xBC, 0xEF, 0xED, 0xDC, 0xBA, 0x87, 0x65, + 0x44, 0x46, 0x78, 0xAB, 0xCD, 0xED, 0xDD, 0xDB, 0xA9, 0x87, 0x65, 0x55, + 0x67, 0x9A, 0xBC, 0xEF, 0xDD, 0xED, 0xCB, 0xA9, 0x87, 0x76, 0x77, 0x89, + 0xBC, 0xDE, 0xFE, 0xDF, 0xDC, 0xCB, 0xA9, 0x88, 0x88, 0x99, 0xAB, 0xCD, + 0xFF, 0xED, 0xEE, 0xDD, 0xBB, 0xAA, 0x99, 0xAA, 0xAB, 0xCD, 0xEF, 0xFF, + 0xDE, 0xED, 0xCC, 0xCB, 0xBB, 0xBB, 0xBC, 0xDD, 0xEF, 0xFF, 0xFE, 0xFF, + 0xED, 0xDD, 0xCC, 0xCC, 0xCD, 0xDE, 0xFE, 0xFF, 0xFF, 0xDF, 0xFE, 0xEE, + 0xDE, 0xDE, 0xDE, 0xEE, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xEF, 0xEE, 0xFE, + 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8C, 0xDD, 0xDC, 0xDE, 0xDE, 0xED, + 0xED, 0xFF, 0xEE, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xCF, 0xEE, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xDD, 0x8E, 0xFF, + 0xED, 0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDE, 0xEF, 0xFE, 0xEF, 0xED, 0xCC, + 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEE, 0xEE, 0xDE, 0xED, 0xCB, 0xBA, 0xAA, + 0xA9, 0xAA, 0xAB, 0xCD, 0xDE, 0xFD, 0xED, 0xDC, 0xBA, 0x99, 0x98, 0x99, + 0x9A, 0xAB, 0xCC, 0xDF, 0xDC, 0xCC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A, + 0xAB, 0xCD, 0xED, 0xDC, 0xBA, 0x98, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBC, + 0xCE, 0xDC, 0xDB, 0xA9, 0x87, 0x66, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC, + 0xCC, 0xBA, 0x98, 0x66, 0x54, 0x55, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB, + 0xA8, 0x76, 0x54, 0x34, 0x55, 0x67, 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x98, + 0x65, 0x53, 0x34, 0x56, 0x78, 0x9A, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, + 0x54, 0x56, 0x67, 0x99, 0xBC, 0xDD, 0xCC, 0xCA, 0x98, 0x77, 0x65, 0x56, + 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x88, + 0x9A, 0xBD, 0xED, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC, + 0xDE, 0xEC, 0xDD, 0xCB, 0xAA, 0x99, 0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xEE, + 0xDE, 0xDC, 0xCB, 0xAA, 0xAA, 0x9A, 0xAA, 0xBB, 0xCE, 0xEF, 0xFD, 0xEE, + 0xDD, 0xCC, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDE, 0xFF, 0xDE, 0xED, 0xDD, + 0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFD, 0xFF, 0xFD, 0xED, 0xDD, + 0xDD, 0xDD, 0xDE, 0xEF, 0xFF, 0xFE, 0x7C, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, + 0xDD, 0xDD, 0xEE, 0xFE, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0x8B, 0xDC, + 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xBB, 0xCC, 0xCD, 0xEB, 0xBC, 0xBB, 0xAA, + 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCD, 0xBB, 0xCB, 0xAA, 0x99, 0x98, + 0x88, 0x99, 0x9A, 0xAB, 0xBC, 0xCB, 0xAB, 0xAA, 0x98, 0x88, 0x88, 0x88, + 0x89, 0x9A, 0xAB, 0xBC, 0xBA, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x77, 0x88, + 0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77, 0x89, 0x9A, + 0xBB, 0xBA, 0xA9, 0x98, 0x76, 0x66, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xBB, + 0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xAB, 0xAA, 0xA9, + 0x88, 0x76, 0x55, 0x45, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x98, 0x87, + 0x66, 0x55, 0x45, 0x56, 0x78, 0x89, 0xAB, 0xAA, 0xA9, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x56, + 0x66, 0x78, 0x99, 0xAB, 0xBA, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAA, 0xBB, 0xAB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xBC, 0xBA, 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x9A, 0xAB, 0xCB, + 0xBC, 0xBB, 0xAA, 0x99, 0x98, 0x88, 0x99, 0x9A, 0xAB, 0xCC, 0xBB, 0xCC, + 0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xDC, 0xBD, 0xCC, 0xBB, + 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xDD, 0xCB, 0xDC, 0xCC, 0xCB, 0xBB, + 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xEC, 0x8B, 0xBB, 0xBB, 0xBA, 0xAA, 0xAA, + 0xAB, 0xBB, 0xBC, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xAB, 0xBA, 0xAA, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0x8B, 0xCB, + 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCB, 0xBB, 0xBA, 0xAA, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBB, 0xCC, 0xBA, 0xBA, 0xA9, 0x98, 0x88, + 0x88, 0x89, 0x99, 0xAA, 0xBB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x78, + 0x88, 0x99, 0xAA, 0xBB, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, + 0x99, 0xAA, 0xBA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, 0x88, 0x99, + 0xAB, 0xA9, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xBA, + 0x9A, 0x98, 0x77, 0x66, 0x55, 0x56, 0x66, 0x78, 0x89, 0xAA, 0xA9, 0xA9, + 0x87, 0x76, 0x65, 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x77, + 0x66, 0x55, 0x55, 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x88, 0x76, 0x66, + 0x55, 0x56, 0x67, 0x78, 0x9A, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x78, 0x89, 0xAB, 0xA9, 0xA9, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xBA, 0xAA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xAA, 0xBA, 0xA9, 0x98, 0x88, 0x77, 0x78, 0x88, 0x99, 0xAB, 0xBB, + 0xAB, 0xBA, 0xA9, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBA, 0xCB, + 0xBA, 0xA9, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBC, 0xCB, 0xBC, 0xCB, 0xBA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xCB, 0xCC, 0xCB, 0xBB, 0xBA, + 0xAA, 0xAB, 0xBB, 0xBC, 0xCC, 0xDC, 0x8B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xAB, 0xBB, 0xCC, 0xA0, 0x00, 0x00, 0x00, + }, + { + 0xAC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0xBB, 0x8C, 0xDC, + 0xCB, 0xBB, 0xAA, 0xAA, 0xAB, 0xBB, 0xBC, 0xCD, 0xDC, 0xBC, 0xCB, 0xBA, + 0xA9, 0x99, 0x9A, 0xAA, 0xAB, 0xBC, 0xCD, 0xCB, 0xCB, 0xAA, 0x99, 0x98, + 0x89, 0x99, 0x9A, 0xAB, 0xBC, 0xCB, 0xBB, 0xBA, 0x99, 0x88, 0x88, 0x88, + 0x89, 0x9A, 0xAB, 0xBC, 0xBB, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x78, 0x88, + 0x9A, 0xAB, 0xCB, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x77, 0x89, 0x9A, + 0xBC, 0xBA, 0xA9, 0x98, 0x76, 0x66, 0x56, 0x66, 0x77, 0x89, 0xAA, 0xBB, + 0xAA, 0x98, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x99, 0xAB, 0xBA, 0xA9, + 0x88, 0x76, 0x55, 0x45, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0x98, 0x87, + 0x66, 0x54, 0x45, 0x56, 0x78, 0x89, 0xAB, 0xBA, 0xA9, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x56, + 0x66, 0x78, 0x99, 0xAB, 0xBA, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAA, 0xCB, 0xAB, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x89, 0x9A, + 0xBC, 0xBB, 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, + 0xBC, 0xBB, 0xAA, 0x99, 0x98, 0x88, 0x99, 0x9A, 0xAB, 0xCC, 0xCB, 0xCC, + 0xBB, 0xAA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDC, 0xBD, 0xCC, 0xBB, + 0xBA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCD, 0xDD, 0xDC, 0xDD, 0xCC, 0xCB, 0xBB, + 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xED, 0x8C, 0xBB, 0xBB, 0xBB, 0xBB, 0xAB, + 0xBB, 0xBC, 0xCC, 0xCD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xCE, 0xDC, 0xCC, 0xCB, 0xBB, 0xBB, 0xBB, 0xCC, 0xBC, 0xCC, 0x7D, 0xFE, + 0xDD, 0xCC, 0xCB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEE, 0xFD, 0xDE, 0xDC, 0xCB, + 0xBB, 0xAA, 0xAA, 0xBB, 0xCC, 0xCD, 0xDE, 0xDD, 0xDD, 0xCB, 0xAA, 0x99, + 0x99, 0x9A, 0xAB, 0xCC, 0xDD, 0xFD, 0xCD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x99, 0xAB, 0xBC, 0xDD, 0xCC, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x78, 0x89, + 0xAB, 0xBD, 0xDC, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x78, 0x89, 0xAB, + 0xCD, 0xDB, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDC, + 0xCB, 0xA9, 0x87, 0x65, 0x54, 0x55, 0x67, 0x78, 0x9B, 0xBC, 0xCB, 0xBA, + 0x98, 0x76, 0x54, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87, + 0x65, 0x54, 0x44, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xCB, 0x98, 0x77, 0x65, + 0x54, 0x55, 0x67, 0x89, 0xAC, 0xCC, 0xBC, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0x9A, 0xBD, 0xCC, 0xCB, 0xA9, 0x88, 0x77, 0x66, 0x67, 0x78, + 0x9A, 0xBC, 0xDD, 0xCC, 0xBB, 0xA9, 0x88, 0x77, 0x77, 0x88, 0x99, 0xBB, + 0xCD, 0xDC, 0xDC, 0xBA, 0xA9, 0x98, 0x88, 0x89, 0x99, 0xAB, 0xCD, 0xDD, + 0xDE, 0xDC, 0xBB, 0xAA, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDE, 0xFC, 0xDD, + 0xDC, 0xBB, 0xBA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDF, 0xEE, 0xDE, 0xDE, 0xDC, + 0xCC, 0xCB, 0xBC, 0xBC, 0xCD, 0xDE, 0xFF, 0xED, 0xFE, 0xED, 0xDD, 0xCC, + 0xCD, 0xCC, 0xDE, 0xDE, 0xFF, 0xFF, 0x8C, 0xCC, 0xDC, 0xCC, 0xCC, 0xCC, + 0xDD, 0xCD, 0xDE, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xEF, 0xFF, 0xEE, 0xED, 0xED, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0x8F, 0xFF, + 0xFF, 0xFF, 0xFE, 0xED, 0xED, 0xDD, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xEE, + 0xDD, 0xDC, 0xCD, 0xDD, 0xDD, 0xFF, 0xFF, 0xDE, 0xFF, 0xED, 0xDC, 0xCB, + 0xBB, 0xCC, 0xCC, 0xDD, 0xFF, 0xFD, 0xEF, 0xEE, 0xDC, 0xBB, 0xAA, 0xAA, + 0xBB, 0xCD, 0xDE, 0xFF, 0xEF, 0xFE, 0xDB, 0xBA, 0x98, 0x88, 0x99, 0xAB, + 0xCC, 0xDE, 0xFF, 0xEF, 0xDD, 0xB9, 0x87, 0x77, 0x77, 0x89, 0xAB, 0xCE, + 0xEF, 0xED, 0xED, 0xCA, 0x97, 0x66, 0x55, 0x67, 0x89, 0xAC, 0xDD, 0xFF, + 0xDD, 0xDB, 0xA8, 0x75, 0x44, 0x45, 0x67, 0x8A, 0xBD, 0xFF, 0xED, 0xEC, + 0xBA, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xDE, 0xFE, 0xDD, 0xCB, 0xA8, + 0x75, 0x43, 0x34, 0x57, 0x8A, 0xBD, 0xFE, 0xFD, 0xEC, 0xCA, 0x87, 0x65, + 0x44, 0x45, 0x78, 0xAC, 0xDF, 0xFF, 0xDE, 0xDC, 0xA9, 0x87, 0x65, 0x55, + 0x67, 0x9A, 0xCD, 0xFF, 0xFD, 0xFD, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x8A, + 0xBD, 0xEF, 0xFF, 0xCF, 0xDD, 0xCB, 0xA9, 0x88, 0x88, 0x9A, 0xBC, 0xDE, + 0xFF, 0xED, 0xFD, 0xED, 0xCB, 0xAA, 0xAA, 0xAA, 0xBC, 0xDE, 0xEE, 0xFF, + 0xDE, 0xFD, 0xDD, 0xCB, 0xBB, 0xBB, 0xCC, 0xEE, 0xFF, 0xFF, 0xFD, 0xFE, + 0xEE, 0xDD, 0xDD, 0xCD, 0xDD, 0xEE, 0xFE, 0xFF, 0xFF, 0xDF, 0xEE, 0xEE, + 0xDD, 0xED, 0xDD, 0xEF, 0xEF, 0xFF, 0xFF, 0xFD, 0xEE, 0xEE, 0xEF, 0xEF, + 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7C, 0xCC, 0xCC, 0xDD, 0xDD, 0xDE, + 0xFE, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xEF, 0xEF, 0xED, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x8F, 0xFF, + 0xEF, 0xDD, 0xDC, 0xCC, 0xCC, 0xDD, 0xDE, 0xEE, 0xED, 0xEF, 0xED, 0xDC, + 0xCB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEE, 0xDE, 0xFE, 0xDC, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xFD, 0xEE, 0xDC, 0xBA, 0x99, 0x99, 0x99, + 0x9A, 0xAB, 0xCD, 0xDE, 0xDD, 0xDD, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A, + 0xAB, 0xCD, 0xED, 0xDD, 0xCA, 0x98, 0x87, 0x66, 0x67, 0x78, 0x9A, 0xBC, + 0xDE, 0xDC, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xEE, + 0xCC, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCE, 0xDC, 0xCB, + 0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xED, 0xCC, 0xBA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x67, 0x9A, 0xBC, 0xEE, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAC, 0xDE, 0xEC, 0xCC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x78, + 0x9B, 0xCD, 0xEE, 0xCD, 0xCB, 0xA9, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBD, + 0xEF, 0xFC, 0xDC, 0xCB, 0xAA, 0x99, 0x98, 0x99, 0x9A, 0xBC, 0xDF, 0xFF, + 0xCE, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xFF, 0xFC, 0xED, + 0xDD, 0xCC, 0xBB, 0xBB, 0xBB, 0xCD, 0xDE, 0xEF, 0xFF, 0xCE, 0xED, 0xDD, + 0xDC, 0xCC, 0xCD, 0xDD, 0xDF, 0xFF, 0xFF, 0xFC, 0xFE, 0xEE, 0xEE, 0xEE, + 0xDD, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, + 0xEF, 0xEF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xEE, 0xDD, 0xCC, 0xCB, 0xBB, 0xBB, 0xCC, 0xCC, 0xCC, 0xAF, 0xFE, + 0xED, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xED, 0xEF, 0xDD, 0xCB, + 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xDE, 0xDD, 0xED, 0xCB, 0xAA, 0x99, + 0x99, 0x99, 0xAA, 0xBB, 0xCD, 0xED, 0xDD, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0x9A, 0xBC, 0xCD, 0xDC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x89, + 0x9A, 0xBC, 0xDC, 0xCC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCC, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, 0x66, 0x77, 0x89, 0xAB, 0xCC, + 0xBB, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xCC, 0xBB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBC, 0xCB, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xBB, 0xA9, 0x87, 0x76, 0x65, 0x55, + 0x66, 0x78, 0x9A, 0xBD, 0xDB, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAB, + 0xCD, 0xEC, 0xCC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCD, 0xEE, + 0xCD, 0xCB, 0xBA, 0xA9, 0x99, 0x99, 0x9A, 0xAB, 0xCD, 0xEF, 0xEC, 0xDD, + 0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xCD, 0xDF, 0xFF, 0xCE, 0xDD, 0xCC, + 0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEF, 0xFF, 0xFC, 0xEE, 0xDD, 0xDD, 0xCC, + 0xCC, 0xCD, 0xDD, 0xEF, 0xFF, 0xFF, 0xAD, 0xDD, 0xCC, 0xCC, 0xCC, 0xCD, + 0xDD, 0xEE, 0xEF, 0xFF, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xDF, 0xFE, 0xED, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x8F, 0xFF, + 0xFE, 0xDD, 0xDC, 0xCC, 0xDD, 0xDD, 0xDD, 0xEE, 0xEC, 0xEF, 0xEE, 0xDC, + 0xCB, 0xBB, 0xBB, 0xBC, 0xCC, 0xDD, 0xEF, 0xDE, 0xEE, 0xDC, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xCC, 0xDD, 0xED, 0xEE, 0xDC, 0xBA, 0x99, 0x99, 0x99, + 0x9A, 0xAB, 0xCC, 0xDE, 0xDD, 0xEC, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A, + 0xAB, 0xCD, 0xDD, 0xDD, 0xCB, 0xA8, 0x77, 0x66, 0x67, 0x78, 0x9A, 0xBC, + 0xCD, 0xDD, 0xDC, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xCC, 0xDD, + 0xCC, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xDC, 0xCB, + 0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x9A, 0xBC, 0xDD, 0xCC, 0xBA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDC, 0xCB, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x67, 0x9A, 0xBC, 0xEE, 0xCC, 0xCA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAB, 0xDE, 0xDD, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x78, + 0x9B, 0xCD, 0xEE, 0xCD, 0xCB, 0xAA, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBC, + 0xEF, 0xEC, 0xDD, 0xCB, 0xAA, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xDE, 0xFE, + 0xCE, 0xDC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAB, 0xBC, 0xDE, 0xEF, 0xFC, 0xED, + 0xDC, 0xCC, 0xBB, 0xBB, 0xBB, 0xCC, 0xDE, 0xEF, 0xFF, 0xCE, 0xED, 0xDD, + 0xDC, 0xCC, 0xCC, 0xDD, 0xDE, 0xFF, 0xFF, 0xFD, 0xFE, 0xEE, 0xDD, 0xDD, + 0xDD, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0x8C, 0xCC, 0xCC, 0xDC, 0xDD, 0xDD, + 0xDE, 0xEE, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xEF, 0xFF, 0xFF, 0xFD, 0xED, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0x7F, 0xFF, + 0xFF, 0xFF, 0xFE, 0xDE, 0xDF, 0xDE, 0xEF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, + 0xED, 0xDD, 0xCC, 0xCD, 0xEE, 0xEE, 0xFF, 0xDF, 0xFF, 0xFF, 0xED, 0xCC, + 0xBC, 0xBB, 0xCD, 0xDD, 0xEF, 0xFD, 0xFF, 0xFE, 0xEC, 0xBA, 0xAA, 0xAA, + 0xBB, 0xCC, 0xDF, 0xEF, 0xDF, 0xFF, 0xDC, 0xBA, 0x98, 0x88, 0x99, 0xAB, + 0xCC, 0xEF, 0xFF, 0xFF, 0xED, 0xBA, 0x87, 0x77, 0x77, 0x89, 0xAB, 0xDD, + 0xEF, 0xDF, 0xFF, 0xCA, 0x97, 0x65, 0x55, 0x67, 0x89, 0xBC, 0xDF, 0xFE, + 0xEF, 0xDC, 0xA8, 0x75, 0x44, 0x45, 0x67, 0x9A, 0xBD, 0xEF, 0xFE, 0xFD, + 0xCA, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xCF, 0xFF, 0xDF, 0xDC, 0xA8, + 0x75, 0x43, 0x34, 0x57, 0x8A, 0xCD, 0xEF, 0xED, 0xFD, 0xCA, 0x97, 0x65, + 0x44, 0x45, 0x78, 0xAB, 0xDF, 0xFF, 0xEF, 0xDC, 0xB9, 0x87, 0x65, 0x55, + 0x68, 0x9B, 0xCF, 0xFF, 0xFD, 0xEE, 0xCB, 0xA9, 0x87, 0x76, 0x78, 0x9A, + 0xCD, 0xFF, 0xFF, 0xDF, 0xED, 0xCB, 0xA9, 0x98, 0x88, 0x9A, 0xBC, 0xDF, + 0xFF, 0xFD, 0xFD, 0xDC, 0xCB, 0xAA, 0xAA, 0xAA, 0xCD, 0xDF, 0xFF, 0xFF, + 0xDF, 0xFD, 0xDD, 0xCC, 0xCB, 0xCC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFD, 0xFE, + 0xFE, 0xDD, 0xDC, 0xDD, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFE, 0xEE, + 0xEE, 0xDE, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xEF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8D, 0xCC, 0xCD, 0xDE, 0xEF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xEF, 0xFF, 0xDF, 0xDE, 0xDD, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x7F, 0xFF, + 0xEF, 0xFF, 0xFD, 0xEE, 0xFE, 0xDD, 0xEF, 0xFF, 0xFD, 0xFF, 0xFF, 0xEE, + 0xDD, 0xDD, 0xDD, 0xCD, 0xDF, 0xFF, 0xFF, 0xDF, 0xFE, 0xED, 0xDC, 0xCB, + 0xBB, 0xBC, 0xCC, 0xDD, 0xFF, 0xFD, 0xFF, 0xFD, 0xDB, 0xBA, 0xAA, 0xAA, + 0xBB, 0xCC, 0xDD, 0xFF, 0xFF, 0xFE, 0xDB, 0xAA, 0x98, 0x89, 0x99, 0xAB, + 0xCC, 0xFF, 0xFF, 0xFE, 0xDC, 0xBA, 0x98, 0x77, 0x78, 0x89, 0xAC, 0xCC, + 0xFF, 0xFD, 0xFD, 0xCA, 0x98, 0x76, 0x66, 0x67, 0x89, 0xAC, 0xCD, 0xFE, + 0xDD, 0xCB, 0xA9, 0x76, 0x54, 0x45, 0x67, 0x9A, 0xCC, 0xDF, 0xDD, 0xED, + 0xBA, 0x97, 0x64, 0x23, 0x46, 0x78, 0xAB, 0xDD, 0xFF, 0xDD, 0xCB, 0xA9, + 0x76, 0x43, 0x24, 0x57, 0x9A, 0xCD, 0xFF, 0xFE, 0xDC, 0xCA, 0x98, 0x65, + 0x44, 0x56, 0x78, 0xAC, 0xDE, 0xFD, 0xDD, 0xDC, 0xAA, 0x87, 0x66, 0x56, + 0x78, 0x9A, 0xBD, 0xFF, 0xFE, 0xDD, 0xCB, 0xA9, 0x87, 0x77, 0x78, 0x99, + 0xBC, 0xEF, 0xFF, 0xDF, 0xED, 0xCB, 0xA9, 0x98, 0x89, 0x9A, 0xBC, 0xDD, + 0xFF, 0xFD, 0xFF, 0xEC, 0xCB, 0xBA, 0xAA, 0xAA, 0xAC, 0xDE, 0xEF, 0xFF, + 0xDF, 0xFE, 0xCC, 0xDC, 0xBB, 0xBB, 0xBC, 0xDD, 0xEF, 0xFF, 0xFE, 0xFF, + 0xDE, 0xED, 0xDD, 0xCC, 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFE, 0xFF, + 0xFF, 0xEC, 0xED, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xED, 0xFE, + 0xED, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6C, 0xCB, 0xBC, 0xCD, 0xDC, 0xCF, + 0xDF, 0xEF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xCC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0x8D, 0xDC, + 0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDC, 0xCD, 0xCB, 0xAA, + 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xCD, 0xCB, 0xCB, 0xBA, 0x99, 0x99, + 0x89, 0x99, 0x9A, 0xAB, 0xBC, 0xDB, 0xBC, 0xAA, 0x99, 0x88, 0x88, 0x88, + 0x89, 0x9A, 0xAB, 0xCD, 0xBB, 0xBA, 0x99, 0x88, 0x77, 0x77, 0x78, 0x89, + 0x9A, 0xAB, 0xCB, 0xAB, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x77, 0x89, 0x9A, + 0xBC, 0xBA, 0xBA, 0x98, 0x76, 0x66, 0x56, 0x66, 0x78, 0x89, 0xAB, 0xBB, + 0xAA, 0x99, 0x87, 0x66, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBB, 0xBA, 0xA9, + 0x98, 0x76, 0x55, 0x44, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0x99, 0x87, + 0x66, 0x54, 0x45, 0x56, 0x78, 0x89, 0xAB, 0xBA, 0xA9, 0x98, 0x76, 0x65, + 0x55, 0x56, 0x67, 0x89, 0x9A, 0xBB, 0xAA, 0xA9, 0x87, 0x76, 0x66, 0x56, + 0x66, 0x78, 0x9A, 0xAB, 0xBA, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAB, 0xCC, 0xAB, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A, + 0xBC, 0xCA, 0xCB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xBC, 0xCC, + 0xBC, 0xBB, 0xAA, 0x99, 0x99, 0x88, 0x99, 0x9A, 0xBB, 0xCD, 0xDB, 0xDC, + 0xCB, 0xAA, 0xAA, 0x99, 0x9A, 0xAA, 0xBB, 0xCD, 0xDD, 0xBD, 0xCC, 0xBB, + 0xBA, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xDB, 0xDD, 0xCC, 0xCB, 0xBB, + 0xBB, 0xBB, 0xCC, 0xCD, 0xDE, 0xED, 0x8C, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, + 0xBB, 0xBC, 0xDD, 0xDE, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xBC, 0xBB, 0xAA, 0x99, 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0x9B, 0xCB, + 0xBA, 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xBB, 0xBC, 0xDB, 0xBC, 0xBA, 0xA9, + 0x99, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xBA, 0xBA, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x99, 0x9A, 0xAB, 0xCB, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, + 0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x78, + 0x89, 0xAA, 0xBA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, 0x78, 0x99, + 0xAB, 0xA9, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA, + 0x99, 0x98, 0x77, 0x66, 0x65, 0x56, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99, + 0x87, 0x76, 0x65, 0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x99, 0x98, 0x77, + 0x66, 0x65, 0x55, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66, + 0x65, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x9A, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x98, 0x77, 0x76, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xBA, 0x9A, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xBA, 0xBA, 0x99, 0x88, 0x87, 0x77, 0x77, 0x88, 0x99, 0xAA, 0xBB, + 0xAB, 0xAA, 0x99, 0x98, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xBA, 0xBB, + 0xAA, 0xA9, 0x99, 0x99, 0x99, 0x99, 0xAA, 0xBC, 0xCC, 0xBC, 0xBB, 0xAA, + 0xAA, 0x99, 0x99, 0xAA, 0xAA, 0xBB, 0xCD, 0xCB, 0xCC, 0xCB, 0xBB, 0xAA, + 0xAA, 0xAA, 0xBB, 0xBC, 0xCD, 0xDD, 0x9B, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xBB, 0xBC, 0xCD, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xBD, 0xCB, 0xBB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBB, 0xBB, 0x8D, 0xDC, + 0xCB, 0xBB, 0xBA, 0xAA, 0xAB, 0xBB, 0xCC, 0xCD, 0xDB, 0xCC, 0xCB, 0xAA, + 0xAA, 0x99, 0x9A, 0xAA, 0xAB, 0xBB, 0xCD, 0xBC, 0xCB, 0xAA, 0x99, 0x98, + 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xDB, 0xBB, 0xBA, 0x98, 0x88, 0x88, 0x88, + 0x89, 0x9A, 0xAB, 0xBC, 0xBB, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x88, + 0x9A, 0xBB, 0xCB, 0xAB, 0xA9, 0x87, 0x76, 0x66, 0x67, 0x77, 0x89, 0x9A, + 0xBB, 0xBA, 0xB9, 0x98, 0x76, 0x66, 0x56, 0x66, 0x78, 0x89, 0xAB, 0xBB, + 0xAA, 0x99, 0x87, 0x65, 0x55, 0x55, 0x67, 0x78, 0x9A, 0xAB, 0xBA, 0xA9, + 0x88, 0x76, 0x55, 0x44, 0x56, 0x67, 0x89, 0x9A, 0xBB, 0xAA, 0x99, 0x87, + 0x66, 0x54, 0x45, 0x56, 0x78, 0x89, 0xAB, 0xBA, 0xAA, 0x98, 0x77, 0x65, + 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0xAA, 0xA9, 0x88, 0x76, 0x66, 0x56, + 0x66, 0x78, 0x99, 0xBB, 0xBA, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAB, 0xCB, 0xAB, 0xAA, 0x98, 0x88, 0x77, 0x77, 0x77, 0x89, 0x9A, + 0xBC, 0xCB, 0xBB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x89, 0x9A, 0xBC, 0xCC, + 0xBC, 0xBB, 0xAA, 0x99, 0x99, 0x88, 0x99, 0x9A, 0xAB, 0xCD, 0xCB, 0xCB, + 0xBB, 0xAA, 0xA9, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xDD, 0xBD, 0xDC, 0xBB, + 0xBB, 0xAA, 0xAA, 0xAB, 0xBB, 0xCC, 0xDE, 0xDB, 0xDD, 0xCC, 0xCB, 0xBB, + 0xBB, 0xBC, 0xCC, 0xCD, 0xDD, 0xED, 0x8B, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, + 0xBB, 0xBC, 0xCD, 0xDD, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xEE, 0xFF, 0xDF, 0xDD, 0xCC, 0xCC, 0xDD, 0xCC, 0xCC, 0xCC, 0x7F, 0xFF, + 0xFF, 0xFD, 0xDE, 0xDD, 0xDE, 0xDE, 0xEF, 0xFF, 0xFE, 0xFF, 0xFF, 0xED, + 0xCD, 0xCC, 0xCC, 0xDC, 0xDD, 0xEE, 0xFF, 0xDF, 0xFF, 0xDE, 0xCC, 0xBB, + 0xBB, 0xBB, 0xBC, 0xDD, 0xFE, 0xFE, 0xFF, 0xED, 0xCB, 0xAA, 0x99, 0xAA, + 0xAA, 0xBC, 0xCE, 0xEF, 0xEE, 0xED, 0xCB, 0xA9, 0x88, 0x88, 0x89, 0xAB, + 0xCC, 0xDE, 0xFF, 0xDF, 0xDB, 0xA9, 0x87, 0x77, 0x77, 0x89, 0xAB, 0xCD, + 0xDE, 0xED, 0xFC, 0xBA, 0x97, 0x66, 0x55, 0x67, 0x89, 0xAB, 0xCE, 0xED, + 0xDE, 0xCB, 0xA8, 0x75, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xDE, 0xED, 0xEC, + 0xB9, 0x87, 0x54, 0x33, 0x45, 0x78, 0xAB, 0xCE, 0xFF, 0xDE, 0xCB, 0x98, + 0x75, 0x43, 0x34, 0x57, 0x89, 0xBC, 0xDE, 0xFD, 0xDC, 0xBA, 0x97, 0x65, + 0x44, 0x46, 0x78, 0xAB, 0xCD, 0xFE, 0xDE, 0xCB, 0xA9, 0x87, 0x65, 0x56, + 0x67, 0x9A, 0xBC, 0xDF, 0xDD, 0xED, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x89, + 0xAC, 0xDF, 0xFF, 0xEF, 0xDC, 0xBB, 0xA9, 0x88, 0x88, 0x99, 0xAB, 0xCD, + 0xFF, 0xFF, 0xFD, 0xDC, 0xBB, 0xAA, 0x99, 0x9A, 0xAB, 0xCE, 0xDF, 0xFF, + 0xDF, 0xFD, 0xDC, 0xBB, 0xBB, 0xBB, 0xBC, 0xCD, 0xEF, 0xFF, 0xFD, 0xFF, + 0xDE, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xEE, 0xFF, 0xFF, 0xDF, 0xEF, 0xEE, + 0xED, 0xDD, 0xDD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFD, 0xFE, 0xEF, 0xFE, 0xEE, + 0xEF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7C, 0xCC, 0xDD, 0xDD, 0xED, 0xDE, + 0xEE, 0xEF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xCC, 0xCB, 0xBB, 0x7F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, + 0xFF, 0xDD, 0xFD, 0xDF, 0xFF, 0xDF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC, + 0xCC, 0xCD, 0xFF, 0xFD, 0xFF, 0xFD, 0xFF, 0xFF, 0xFC, 0xDB, 0xBA, 0xBB, + 0xCB, 0xDD, 0xFD, 0xFF, 0xFF, 0xFF, 0xFD, 0xCB, 0xA9, 0x99, 0x9A, 0xBC, + 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xCB, 0x98, 0x77, 0x78, 0x9A, 0xBC, 0xDD, + 0xFD, 0xFF, 0xFF, 0xDD, 0xA8, 0x76, 0x55, 0x68, 0x9A, 0xBC, 0xFF, 0xFF, + 0xFF, 0xFC, 0xC9, 0x76, 0x54, 0x45, 0x68, 0xAB, 0xCC, 0xFF, 0xFF, 0xFD, + 0xCA, 0x97, 0x54, 0x23, 0x45, 0x79, 0xBC, 0xFF, 0xFF, 0xFF, 0xDC, 0xB9, + 0x76, 0x43, 0x24, 0x57, 0x9A, 0xCF, 0xFF, 0xFF, 0xFD, 0xDB, 0xA8, 0x65, + 0x44, 0x56, 0x79, 0xBD, 0xFF, 0xFF, 0xFF, 0xDC, 0xBA, 0x87, 0x65, 0x56, + 0x78, 0xAC, 0xDF, 0xFF, 0xFD, 0xFC, 0xFD, 0xBA, 0x88, 0x77, 0x78, 0x9A, + 0xCD, 0xFF, 0xFF, 0xDF, 0xFF, 0xDC, 0xBA, 0x99, 0x99, 0xAB, 0xCD, 0xFF, + 0xFF, 0xFD, 0xFF, 0xFD, 0xDC, 0xBB, 0xBA, 0xBB, 0xDD, 0xFF, 0xFF, 0xFF, + 0xDF, 0xFD, 0xFF, 0xDD, 0xDC, 0xCB, 0xDC, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, + 0xDF, 0xDD, 0xFD, 0xFD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFD, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7C, 0xCB, 0xDD, 0xCF, 0xFF, 0xDF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xEF, 0xEF, 0xFD, 0xDC, 0xDC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x9F, 0xFF, + 0xFE, 0xDD, 0xDC, 0xCC, 0xCC, 0xCC, 0xDD, 0xDF, 0xFD, 0xFF, 0xFF, 0xCC, + 0xCB, 0xBB, 0xBB, 0xBB, 0xBC, 0xDC, 0xEF, 0xEF, 0xFD, 0xDC, 0xBA, 0xAA, + 0x99, 0xAA, 0xAB, 0xCC, 0xDE, 0xFD, 0xFE, 0xDC, 0xBA, 0x99, 0x88, 0x89, + 0x9A, 0xAA, 0xCC, 0xDD, 0xED, 0xDC, 0xBA, 0x98, 0x87, 0x77, 0x78, 0x89, + 0xAB, 0xCD, 0xEE, 0xDD, 0xBA, 0x98, 0x77, 0x66, 0x66, 0x78, 0x89, 0xAC, + 0xCD, 0xDD, 0xCB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xED, + 0xDC, 0xBA, 0x87, 0x65, 0x54, 0x45, 0x66, 0x79, 0xAB, 0xCD, 0xEC, 0xCB, + 0xA8, 0x76, 0x54, 0x44, 0x55, 0x67, 0x89, 0xBD, 0xEE, 0xCC, 0xBA, 0x87, + 0x65, 0x54, 0x44, 0x56, 0x78, 0xAB, 0xDE, 0xEC, 0xCB, 0x98, 0x76, 0x65, + 0x54, 0x55, 0x67, 0x8A, 0xBC, 0xFE, 0xCC, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAB, 0xDF, 0xFC, 0xCB, 0xA9, 0x88, 0x76, 0x66, 0x67, 0x78, + 0x9A, 0xBE, 0xFF, 0xCC, 0xCB, 0xA9, 0x88, 0x77, 0x77, 0x78, 0x9A, 0xBC, + 0xFF, 0xFC, 0xDD, 0xBB, 0xAA, 0x99, 0x88, 0x89, 0x9A, 0xBC, 0xDF, 0xFF, + 0xDD, 0xDC, 0xBB, 0xBA, 0xA9, 0x9A, 0xAA, 0xBC, 0xDE, 0xFF, 0xFC, 0xED, + 0xCC, 0xCC, 0xBB, 0xBB, 0xBC, 0xCC, 0xDE, 0xFF, 0xFF, 0xDD, 0xDD, 0xED, + 0xDC, 0xDC, 0xDD, 0xDD, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFE, 0xDE, 0xDD, + 0xDD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0x9C, 0xDD, 0xDD, 0xDF, 0xDE, 0xEE, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFE, 0xDC, 0xCC, 0xCC, 0xCC, 0xCD, 0xDD, 0xDE, 0xBF, 0xFF, + 0xFE, 0xDC, 0xCC, 0xBB, 0xBC, 0xCC, 0xDD, 0xEF, 0xFF, 0xFF, 0xFD, 0xCC, + 0xBB, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xEF, 0xEF, 0xFD, 0xCB, 0xAA, 0x99, + 0x99, 0x99, 0xAA, 0xBC, 0xDD, 0xFE, 0xFE, 0xCB, 0xA9, 0x98, 0x88, 0x88, + 0x89, 0x9A, 0xBC, 0xDF, 0xDD, 0xDC, 0xA9, 0x88, 0x77, 0x77, 0x77, 0x89, + 0x9A, 0xBC, 0xDD, 0xDC, 0xBA, 0x98, 0x76, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xDC, 0xCB, 0x98, 0x76, 0x65, 0x55, 0x56, 0x77, 0x89, 0xAC, 0xDD, + 0xCC, 0xA9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xBD, 0xDC, 0xBA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xCB, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xBD, 0xDC, 0xBA, 0x98, 0x76, 0x65, + 0x55, 0x55, 0x67, 0x89, 0xAC, 0xDE, 0xCC, 0xA9, 0x87, 0x76, 0x65, 0x55, + 0x66, 0x78, 0x9B, 0xCD, 0xEC, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x9A, 0xBC, 0xEF, 0xCC, 0xBA, 0x99, 0x87, 0x77, 0x77, 0x78, 0x89, 0xAC, + 0xDF, 0xFD, 0xDC, 0xBA, 0x99, 0x88, 0x88, 0x88, 0x99, 0xAB, 0xCE, 0xFF, + 0xDD, 0xDC, 0xBA, 0xA9, 0x99, 0x99, 0x9A, 0xBB, 0xCD, 0xFF, 0xFD, 0xED, + 0xCC, 0xBB, 0xAA, 0xAA, 0xAB, 0xBC, 0xDD, 0xFF, 0xFF, 0xDF, 0xED, 0xDC, + 0xCC, 0xBB, 0xBC, 0xCC, 0xDE, 0xFF, 0xFF, 0xFE, 0xFF, 0xEE, 0xDD, 0xDC, + 0xDD, 0xDD, 0xEF, 0xFF, 0xFF, 0xFF, 0xBE, 0xED, 0xDD, 0xDD, 0xDD, 0xDD, + 0xEF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFE, 0xDD, 0xFD, 0xEC, 0xDC, 0xCD, 0xCE, 0x9F, 0xFF, + 0xFF, 0xFD, 0xDD, 0xCC, 0xDC, 0xDD, 0xDE, 0xEF, 0xFD, 0xFF, 0xFF, 0xED, + 0xDC, 0xCB, 0xBB, 0xCC, 0xCC, 0xDD, 0xEF, 0xDF, 0xFE, 0xDD, 0xCB, 0xAA, + 0xAA, 0xAA, 0xBC, 0xCD, 0xDD, 0xFD, 0xFF, 0xDC, 0xBA, 0x99, 0x98, 0x99, + 0x9A, 0xAB, 0xCC, 0xDD, 0xDF, 0xED, 0xBA, 0x98, 0x87, 0x77, 0x88, 0x9A, + 0xAB, 0xCD, 0xFD, 0xED, 0xCB, 0x98, 0x77, 0x66, 0x67, 0x78, 0x9A, 0xAC, + 0xDD, 0xDD, 0xEB, 0xA9, 0x87, 0x65, 0x55, 0x66, 0x78, 0x9A, 0xBC, 0xDD, + 0xDD, 0xBA, 0x97, 0x65, 0x54, 0x45, 0x67, 0x89, 0xAB, 0xDE, 0xDD, 0xCB, + 0xA9, 0x76, 0x54, 0x44, 0x45, 0x67, 0x8A, 0xBC, 0xFD, 0xDD, 0xBA, 0x97, + 0x65, 0x44, 0x44, 0x56, 0x78, 0xAB, 0xCD, 0xDD, 0xDC, 0xA9, 0x87, 0x65, + 0x44, 0x55, 0x67, 0x9A, 0xBD, 0xEE, 0xDD, 0xBA, 0x98, 0x76, 0x65, 0x55, + 0x67, 0x89, 0xAC, 0xDD, 0xED, 0xDC, 0xBA, 0x98, 0x77, 0x66, 0x67, 0x78, + 0x9B, 0xCF, 0xFE, 0xDD, 0xDB, 0xAA, 0x98, 0x87, 0x77, 0x88, 0x9A, 0xBD, + 0xDF, 0xFD, 0xDD, 0xBB, 0xA9, 0x99, 0x89, 0x89, 0xAA, 0xBD, 0xEE, 0xFF, + 0xDE, 0xDC, 0xBB, 0xAA, 0xAA, 0xAA, 0xAB, 0xBD, 0xDF, 0xFF, 0xFD, 0xDD, + 0xDC, 0xCB, 0xBB, 0xBB, 0xBC, 0xCD, 0xDF, 0xFF, 0xFF, 0xDE, 0xDD, 0xDC, + 0xCC, 0xCC, 0xCC, 0xDD, 0xFE, 0xFF, 0xFF, 0xFC, 0xFF, 0xDF, 0xFE, 0xDE, + 0xDD, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9C, 0xCC, 0xDC, 0xDC, 0xDD, 0xDD, + 0xDD, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBB, 0xBB, 0xCB, 0x7F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFD, 0xFF, 0xCF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFD, 0xFF, + 0xCD, 0xDC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBB, 0xCC, + 0xCC, 0xCD, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xCB, 0xAA, 0xA9, 0xAB, 0xBD, + 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCC, 0xA9, 0x88, 0x88, 0x9A, 0xBC, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFC, 0xB9, 0x76, 0x66, 0x78, 0x9B, 0xCD, 0xFF, 0xFF, + 0xFF, 0xFF, 0xCA, 0x86, 0x54, 0x45, 0x79, 0xAB, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFB, 0xA8, 0x64, 0x22, 0x46, 0x8A, 0xCF, 0xFF, 0xFF, 0xFF, 0xFD, 0xBA, + 0x86, 0x42, 0x24, 0x68, 0xAB, 0xDF, 0xFF, 0xFF, 0xFF, 0xDC, 0xB8, 0x75, + 0x44, 0x56, 0x8A, 0xCF, 0xFF, 0xFF, 0xDF, 0xFD, 0xCB, 0x98, 0x76, 0x67, + 0x89, 0xBC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xBA, 0xA9, 0x88, 0x89, 0xBB, + 0xCF, 0xFF, 0xFF, 0xDF, 0xFF, 0xCC, 0xBB, 0xAA, 0xAA, 0xBC, 0xDF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFD, 0xCC, 0xCC, 0xBC, 0xCC, 0xCF, 0xFF, 0xFF, 0xFF, + 0xCF, 0xFD, 0xFF, 0xCC, 0xDD, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xDD, 0xDF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, + 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7B, 0xCD, 0xDC, 0xCD, 0xDF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xDF, 0xFD, 0xCB, 0xBF, 0xBC, 0xDC, 0xBA, 0xCB, 0xCB, 0x7F, 0xDF, + 0xDD, 0xDF, 0xCC, 0xBC, 0xFC, 0xFC, 0xFF, 0xFF, 0xFC, 0xDD, 0xFF, 0xDD, + 0xDC, 0xFB, 0xDB, 0xCB, 0xCF, 0xDC, 0xFF, 0xBC, 0xFF, 0xFA, 0xFB, 0xFB, + 0xAB, 0xCC, 0xCC, 0xFF, 0xFF, 0xFF, 0xFD, 0xFC, 0xBB, 0xAA, 0xA9, 0x9A, + 0xBB, 0xCC, 0xCC, 0xFF, 0xCC, 0xFD, 0xCB, 0x9B, 0x89, 0x88, 0x99, 0xAB, + 0xAD, 0xCD, 0xFF, 0xFC, 0xBA, 0xAA, 0x97, 0x77, 0x78, 0x89, 0xAA, 0xBF, + 0xFF, 0xCB, 0xFC, 0xB9, 0x97, 0x76, 0x66, 0x77, 0x89, 0xAA, 0xFC, 0xFB, + 0xBC, 0xBB, 0xA9, 0x76, 0x54, 0x55, 0x67, 0x8A, 0xAC, 0xDC, 0xDD, 0xCC, + 0xB9, 0x97, 0x64, 0x23, 0x46, 0x78, 0x9C, 0xCB, 0xFC, 0xCF, 0xBB, 0xA8, + 0x76, 0x43, 0x24, 0x67, 0x99, 0xAC, 0xCF, 0xCF, 0xBC, 0xC9, 0x97, 0x65, + 0x44, 0x56, 0x78, 0x9A, 0xCD, 0xFF, 0xDC, 0xCA, 0xA9, 0x87, 0x66, 0x66, + 0x78, 0x9A, 0xBB, 0xFF, 0xFF, 0xFF, 0xCB, 0xA9, 0x87, 0x77, 0x77, 0x8A, + 0xBC, 0xBC, 0xFC, 0xFC, 0xCF, 0xCC, 0x99, 0x98, 0x88, 0x99, 0x9A, 0xCF, + 0xCF, 0xFF, 0xFF, 0xFC, 0xCB, 0xAA, 0x9A, 0xA9, 0xAA, 0xCF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFE, 0xEC, 0xAA, 0xAB, 0xAC, 0xCC, 0xDF, 0xFF, 0xFC, 0xDF, + 0xCD, 0xCD, 0xBC, 0xCB, 0xCF, 0xFB, 0xDC, 0xFD, 0xFF, 0xDF, 0xFF, 0xDC, + 0xFD, 0xDC, 0xFC, 0xDF, 0xDD, 0xCF, 0xFF, 0xFA, 0xDC, 0xDF, 0xFD, 0xFD, + 0xCD, 0xDF, 0xDF, 0xDD, 0xDF, 0xFF, 0x6C, 0xBB, 0xCC, 0xCC, 0xDB, 0xFD, + 0xCF, 0xFF, 0xDD, 0xFF, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xBC, 0xCB, 0xAA, 0xAA, 0x99, 0x99, 0xA9, 0xAA, 0xAA, 0xAB, 0x8C, 0xCC, + 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, 0xAB, 0xCB, 0xCD, 0xDB, 0xBC, 0xCA, 0xBA, + 0x9A, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCE, 0xCB, 0xBB, 0xAA, 0x99, 0x98, + 0x88, 0x89, 0x9A, 0xAB, 0xBC, 0xCB, 0xBB, 0xA9, 0x98, 0x88, 0x88, 0x88, + 0x89, 0x99, 0xAB, 0xBC, 0xBA, 0xBA, 0x98, 0x87, 0x77, 0x77, 0x78, 0x89, + 0x9A, 0xAB, 0xCB, 0xAB, 0xA9, 0x87, 0x77, 0x66, 0x67, 0x77, 0x89, 0x9A, + 0xBC, 0xBA, 0xA9, 0x98, 0x76, 0x66, 0x66, 0x66, 0x77, 0x89, 0x9A, 0xBB, + 0xAA, 0x98, 0x87, 0x66, 0x55, 0x56, 0x67, 0x78, 0x89, 0xAB, 0xBA, 0xA9, + 0x88, 0x76, 0x65, 0x44, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0x9A, 0x98, 0x87, + 0x66, 0x54, 0x45, 0x56, 0x78, 0x89, 0xAA, 0xB9, 0xA9, 0x88, 0x77, 0x65, + 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBB, 0x9A, 0xA9, 0x87, 0x76, 0x66, 0x56, + 0x66, 0x78, 0x99, 0xAB, 0xBA, 0xBA, 0x99, 0x87, 0x76, 0x66, 0x66, 0x77, + 0x89, 0xAB, 0xCB, 0xAB, 0xA9, 0x98, 0x88, 0x77, 0x77, 0x77, 0x88, 0x9A, + 0xBC, 0xDA, 0xBB, 0xA9, 0x98, 0x88, 0x87, 0x88, 0x88, 0x9A, 0xAB, 0xCB, + 0xAC, 0xBA, 0xAA, 0x99, 0x98, 0x88, 0x89, 0x99, 0xAB, 0xCD, 0xCA, 0xCB, + 0xBA, 0xBA, 0xA9, 0x99, 0x99, 0xAA, 0xAB, 0xCC, 0xDC, 0xBD, 0xCC, 0xBB, + 0xBA, 0xAA, 0xBA, 0xAA, 0xBB, 0xBE, 0xED, 0xCB, 0xCC, 0xDD, 0xCB, 0xBB, + 0xBB, 0xBB, 0xBB, 0xCD, 0xFE, 0xFE, 0x8C, 0xBB, 0xBB, 0xAA, 0xAB, 0xBB, + 0xBB, 0xCC, 0xCD, 0xDD, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xBC, 0xBB, 0xAA, 0xA9, 0x99, 0x99, 0x99, 0xAA, 0xAB, 0xBC, 0xAC, 0xCC, + 0xBA, 0xAA, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xBC, 0xDC, 0xBC, 0xBA, 0xA9, + 0x99, 0x98, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xBB, 0xBA, 0xA9, 0x98, 0x88, + 0x88, 0x88, 0x89, 0x9A, 0xAB, 0xCB, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, + 0x88, 0x89, 0x9A, 0xBB, 0xBA, 0xA9, 0x98, 0x77, 0x77, 0x77, 0x77, 0x78, + 0x89, 0x9A, 0xBA, 0xAA, 0x98, 0x87, 0x76, 0x66, 0x66, 0x77, 0x78, 0x89, + 0xAB, 0xA9, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0x9A, 0xAA, + 0x99, 0x98, 0x77, 0x66, 0x65, 0x66, 0x66, 0x77, 0x89, 0x9A, 0xA9, 0x99, + 0x87, 0x76, 0x65, 0x55, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x99, 0x88, 0x77, + 0x66, 0x65, 0x55, 0x66, 0x77, 0x88, 0x9A, 0xA9, 0x99, 0x87, 0x76, 0x66, + 0x65, 0x66, 0x67, 0x78, 0x99, 0xAA, 0x99, 0x98, 0x87, 0x76, 0x66, 0x66, + 0x66, 0x77, 0x89, 0xAA, 0xA9, 0xA9, 0x88, 0x77, 0x76, 0x66, 0x66, 0x77, + 0x88, 0x9A, 0xBA, 0xAA, 0x99, 0x88, 0x77, 0x77, 0x77, 0x77, 0x88, 0x99, + 0xAB, 0xBA, 0xAA, 0x99, 0x88, 0x87, 0x77, 0x77, 0x88, 0x99, 0xAB, 0xBB, + 0xAB, 0xAA, 0x99, 0x88, 0x88, 0x88, 0x88, 0x99, 0xAA, 0xBC, 0xCB, 0xBB, + 0xAA, 0x99, 0x99, 0x98, 0x99, 0x99, 0xAA, 0xBC, 0xDC, 0xBC, 0xBB, 0xBA, + 0xAA, 0x99, 0x99, 0x9A, 0xAB, 0xBC, 0xCD, 0xDC, 0xDC, 0xCB, 0xBA, 0xAA, + 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xED, 0xAC, 0xBB, 0xBA, 0xAA, 0xAA, 0xAA, + 0xAA, 0xBB, 0xCC, 0xDE, 0xD0, 0x00, 0x00, 0x00, + }, + { + 0xBC, 0xBA, 0xBA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xBB, 0x8C, 0xCC, + 0xBB, 0xBA, 0xAA, 0xAA, 0xBB, 0xBB, 0xCD, 0xDC, 0xDB, 0xBC, 0xBC, 0xA9, + 0x99, 0x99, 0x99, 0x9A, 0xAA, 0xBB, 0xCC, 0xAB, 0xCA, 0xAA, 0x98, 0x88, + 0x88, 0x89, 0x99, 0xAA, 0xCC, 0xBA, 0xBB, 0xA9, 0x98, 0x88, 0x78, 0x88, + 0x88, 0x99, 0xAA, 0xBB, 0xAA, 0xAA, 0x98, 0x87, 0x77, 0x77, 0x77, 0x88, + 0x99, 0xAA, 0xBA, 0xBA, 0x98, 0x87, 0x76, 0x66, 0x67, 0x77, 0x88, 0x9A, + 0xBA, 0xAA, 0xA9, 0x88, 0x76, 0x66, 0x66, 0x66, 0x77, 0x88, 0xAA, 0xAA, + 0xAA, 0x98, 0x87, 0x66, 0x55, 0x56, 0x67, 0x78, 0x99, 0xAA, 0xAA, 0xA9, + 0x88, 0x76, 0x65, 0x44, 0x56, 0x67, 0x88, 0x9A, 0xAA, 0x9A, 0x98, 0x87, + 0x66, 0x54, 0x45, 0x66, 0x78, 0x89, 0xAB, 0xAA, 0xB9, 0x98, 0x76, 0x66, + 0x55, 0x56, 0x67, 0x88, 0x9A, 0xBA, 0xAA, 0x99, 0x88, 0x77, 0x66, 0x66, + 0x66, 0x78, 0x99, 0xAB, 0xBA, 0xAA, 0x98, 0x87, 0x77, 0x66, 0x66, 0x77, + 0x89, 0x9A, 0xBB, 0xAB, 0xA9, 0x98, 0x87, 0x77, 0x77, 0x77, 0x89, 0x9A, + 0xBB, 0xAB, 0xDA, 0xA9, 0x98, 0x88, 0x77, 0x88, 0x88, 0x9A, 0xAC, 0xBB, + 0xBC, 0xAB, 0xA9, 0x99, 0x98, 0x88, 0x89, 0x9A, 0xAA, 0xBD, 0xCB, 0xBB, + 0xBB, 0xA9, 0xA9, 0x99, 0x99, 0xAA, 0xAC, 0xBC, 0xCC, 0xBC, 0xCC, 0xBA, + 0xAA, 0xAA, 0xAA, 0xAA, 0xAB, 0xBC, 0xCD, 0xCB, 0xCD, 0xBB, 0xCB, 0xBA, + 0xBB, 0xBB, 0xAC, 0xBB, 0xDD, 0xDD, 0x7A, 0xAA, 0xAA, 0xBA, 0xAA, 0xAA, + 0xAB, 0xBB, 0xBB, 0xCD, 0xB0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xBF, 0xDF, 0xBB, 0xAB, 0xBF, 0x6F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, + 0xFF, 0xCC, 0xFD, 0xFF, 0xDF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFC, + 0xBB, 0xDF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBC, 0xBF, + 0xCF, 0xBF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFD, 0xFF, 0xBB, 0xBA, 0xAB, 0xFC, + 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, 0xCA, 0x99, 0x99, 0xAC, 0xDF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xCD, 0xBA, 0x87, 0x77, 0x89, 0x9B, 0xBF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xCB, 0x97, 0x54, 0x46, 0x8A, 0xDB, 0xFF, 0xFF, 0xFF, 0xFF, + 0xCD, 0xA9, 0x64, 0x12, 0x57, 0x9B, 0xBF, 0xDF, 0xFF, 0xFF, 0xFF, 0xBA, + 0x97, 0x52, 0x24, 0x79, 0xAB, 0xCF, 0xFF, 0xFF, 0xFF, 0xFC, 0xA9, 0x86, + 0x54, 0x57, 0x9B, 0xFD, 0xFF, 0xFD, 0xFF, 0xFC, 0xCC, 0xA9, 0x87, 0x77, + 0x8A, 0xAC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0x99, 0x99, 0x9A, 0xAF, + 0xCF, 0xFF, 0xFF, 0xDF, 0xFF, 0xBF, 0xAC, 0xBA, 0xAA, 0xCC, 0xBF, 0xFF, + 0xFF, 0xFD, 0xFF, 0xFF, 0xCB, 0xBC, 0xBB, 0xDF, 0xDD, 0xFF, 0xFF, 0xFF, + 0xDF, 0xFF, 0xDF, 0xFC, 0xCD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFD, 0xFD, 0xDF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xFF, 0xFD, + 0xDF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6B, 0xCF, 0xDF, 0xDF, 0xFF, 0xCF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xAF, 0xFF, 0xBF, 0xAB, 0xFB, 0x9F, 0xBB, 0xAB, 0x6B, 0xFF, + 0xFB, 0xFF, 0xAF, 0xAA, 0xFB, 0xFA, 0xBB, 0xFF, 0xFF, 0xFF, 0xFB, 0xBF, + 0xB9, 0xFB, 0xBA, 0xBB, 0xBF, 0xFF, 0xFF, 0xFA, 0xFF, 0xFA, 0xFB, 0xBB, + 0xAA, 0xFF, 0xFA, 0xBF, 0xBF, 0xFF, 0xBF, 0xFA, 0xAF, 0xBB, 0x99, 0x9A, + 0xA9, 0xBF, 0xFB, 0xFB, 0xAB, 0xFB, 0xBA, 0xA9, 0x98, 0x9A, 0x99, 0xAA, + 0xFB, 0xBB, 0xFF, 0xAF, 0xFA, 0xAA, 0x98, 0x78, 0x78, 0x89, 0xAF, 0xBF, + 0xAF, 0xFB, 0xBF, 0xBA, 0x99, 0x76, 0x66, 0x88, 0x99, 0xBF, 0xFF, 0xBF, + 0xFF, 0xFA, 0x98, 0x77, 0x54, 0x56, 0x79, 0x9B, 0xBF, 0xBB, 0xBB, 0xAF, + 0xAB, 0xA8, 0x64, 0x22, 0x57, 0x88, 0x9A, 0xFF, 0xAB, 0xAF, 0x99, 0xB8, + 0x77, 0x52, 0x25, 0x79, 0xA9, 0xAA, 0xFF, 0xFA, 0xBB, 0xBA, 0x98, 0x76, + 0x54, 0x66, 0x78, 0x99, 0xBF, 0xFB, 0x9F, 0xFA, 0x9A, 0x98, 0x76, 0x66, + 0x78, 0x8A, 0xFA, 0xAB, 0xAF, 0xFB, 0xBA, 0xB8, 0x98, 0x88, 0x78, 0x9A, + 0xAB, 0xFF, 0xFB, 0xAF, 0xBF, 0xBA, 0xAA, 0x99, 0xA9, 0x9F, 0x8A, 0xFA, + 0xFF, 0xAA, 0xFF, 0xBB, 0xAF, 0xA9, 0xA8, 0x89, 0xAB, 0xFA, 0xBB, 0xFF, + 0xFB, 0xFF, 0xFF, 0xFB, 0xA9, 0xAB, 0xAF, 0xBF, 0xBB, 0xBB, 0xBB, 0xFF, + 0xBF, 0xFB, 0xFF, 0xFA, 0xBF, 0xAF, 0xAF, 0xFB, 0xFF, 0xAF, 0xBF, 0xFF, + 0xFF, 0xBB, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFB, 0xFF, 0xFB, 0xFF, 0xFF, 0xFB, 0x6F, 0xAA, 0xAB, 0xAB, 0xBA, 0xFA, + 0xFA, 0xBB, 0xFF, 0xFB, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xDE, 0xFF, 0xFF, 0xFF, 0xDC, 0xCC, 0xCF, 0xCD, 0xCF, 0x6F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xDC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFD, 0xCD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xDC, + 0xFC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0xCC, 0xDC, 0xDD, + 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCF, 0xEB, 0xBA, 0xBB, 0xBC, 0xDD, 0xFD, + 0xDF, 0xFC, 0xFF, 0xDD, 0xCB, 0x98, 0x78, 0x9A, 0xCC, 0xFF, 0xFF, 0xFF, + 0xDF, 0xFF, 0xFD, 0xB8, 0x54, 0x46, 0x9B, 0xCD, 0xDF, 0xFF, 0xFF, 0xFF, + 0xCD, 0xDA, 0x74, 0x22, 0x48, 0xAC, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, + 0xA7, 0x42, 0x14, 0x7A, 0xDF, 0xFF, 0xFF, 0xDD, 0xFF, 0xFD, 0xDA, 0x96, + 0x44, 0x58, 0xBC, 0xFD, 0xFF, 0xFF, 0xFF, 0xDF, 0xFC, 0xDA, 0x97, 0x78, + 0xAC, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFC, 0xCA, 0xAA, 0xAB, 0xCF, + 0xFF, 0xFD, 0xFF, 0xDF, 0xFF, 0xFD, 0xFC, 0xDC, 0xBC, 0xCD, 0xDF, 0xDF, + 0xFF, 0xFC, 0xFF, 0xFD, 0xFF, 0xDF, 0xCC, 0xFD, 0xFD, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xDF, 0xFF, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, + 0xDD, 0xFF, 0xFF, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xDF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6B, 0xDD, 0xCD, 0xDD, 0xFF, 0xDF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xDD, 0xDD, 0xCD, 0xDD, 0xDE, 0xDF, 0xFF, 0xCF, 0xFF, + 0xFF, 0xDC, 0xCC, 0xCB, 0xCC, 0xBD, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xDC, + 0xBB, 0xBA, 0xAA, 0xBB, 0xCC, 0xDF, 0xEF, 0xFF, 0xFD, 0xCC, 0xBA, 0x99, + 0x99, 0x99, 0xAA, 0xBC, 0xDF, 0xFF, 0xFE, 0xDC, 0xAA, 0x98, 0x88, 0x88, + 0x89, 0xAB, 0xBC, 0xDE, 0xFF, 0xDC, 0xB9, 0x98, 0x77, 0x77, 0x77, 0x89, + 0xAA, 0xCC, 0xFF, 0xFC, 0xCA, 0x98, 0x76, 0x66, 0x66, 0x77, 0x89, 0xAB, + 0xCD, 0xFE, 0xCB, 0xA8, 0x76, 0x65, 0x55, 0x56, 0x77, 0x99, 0xBC, 0xDE, + 0xDC, 0xB9, 0x87, 0x65, 0x55, 0x55, 0x66, 0x78, 0x9A, 0xCD, 0xDC, 0xCA, + 0x98, 0x76, 0x55, 0x44, 0x55, 0x67, 0x89, 0xAB, 0xDD, 0xCC, 0xA9, 0x87, + 0x65, 0x54, 0x45, 0x56, 0x78, 0x9A, 0xCD, 0xEC, 0xCA, 0x98, 0x76, 0x55, + 0x55, 0x55, 0x67, 0x89, 0xAB, 0xDF, 0xCC, 0xB9, 0x87, 0x76, 0x55, 0x55, + 0x66, 0x78, 0xAB, 0xCF, 0xFD, 0xCB, 0xA9, 0x87, 0x76, 0x66, 0x66, 0x78, + 0x9A, 0xBC, 0xFF, 0xDD, 0xCA, 0xA9, 0x87, 0x77, 0x77, 0x78, 0x9A, 0xBC, + 0xDF, 0xFD, 0xDC, 0xBA, 0xA9, 0x88, 0x88, 0x88, 0x9A, 0xAC, 0xDF, 0xFF, + 0xFF, 0xDC, 0xBA, 0xA9, 0x99, 0x99, 0xAA, 0xBB, 0xDF, 0xFF, 0xFF, 0xFF, + 0xDD, 0xCB, 0xBA, 0xAA, 0xAB, 0xBC, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDC, + 0xDC, 0xCC, 0xCC, 0xCD, 0xDE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEE, 0xDD, + 0xDD, 0xDE, 0xEF, 0xFF, 0xFF, 0xFF, 0xDF, 0xFF, 0xFE, 0xFE, 0xDD, 0xEF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xCF, 0xFE, 0xFD, 0xDC, 0xCF, 0xFD, 0xED, 0xCC, 0xBC, 0xEC, 0x7F, 0xEF, + 0xFF, 0xEF, 0xEF, 0xEE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDF, 0xDD, 0xFF, + 0xDD, 0xFD, 0xEF, 0xEF, 0xEE, 0xEF, 0xFF, 0xCF, 0xEF, 0xFF, 0xDF, 0xEF, + 0xDF, 0xDE, 0xEF, 0xEF, 0xFF, 0xFD, 0xEE, 0xFD, 0xFD, 0xDD, 0xDD, 0xCC, + 0xDD, 0xEE, 0xFE, 0xFD, 0xED, 0xFF, 0xEE, 0xDC, 0xCC, 0xBC, 0xBC, 0xCE, + 0xED, 0xFF, 0xFE, 0xEF, 0xCD, 0xFF, 0xBB, 0xAA, 0xAA, 0xBC, 0xDD, 0xEE, + 0xFF, 0xFF, 0xFF, 0xFC, 0xCB, 0x98, 0x77, 0x89, 0xBC, 0xDE, 0xFF, 0xFD, + 0xDE, 0xDF, 0xDC, 0xA8, 0x54, 0x46, 0x8A, 0xCF, 0xEF, 0xEF, 0xDC, 0xFF, + 0xDC, 0xCA, 0x74, 0x12, 0x47, 0xAC, 0xED, 0xEE, 0xFE, 0xEE, 0xEF, 0xFB, + 0xA7, 0x42, 0x24, 0x7A, 0xBD, 0xEE, 0xEF, 0xDE, 0xED, 0xDE, 0xCA, 0x86, + 0x44, 0x68, 0xAD, 0xDD, 0xEE, 0xFD, 0xDE, 0xEE, 0xFC, 0xB9, 0x87, 0x78, + 0xAB, 0xCF, 0xDD, 0xFF, 0xFD, 0xFF, 0xFC, 0xCC, 0xBA, 0x9A, 0xAB, 0xBE, + 0xEF, 0xEF, 0xFD, 0xDF, 0xFF, 0xFD, 0xCC, 0xCC, 0xCC, 0xDC, 0xCD, 0xFF, + 0xFF, 0xEF, 0xFF, 0xFE, 0xDE, 0xDD, 0xCC, 0xFD, 0xEF, 0xDF, 0xFF, 0xFE, + 0xFF, 0xFF, 0xED, 0xDD, 0xDD, 0xEF, 0xEF, 0xFF, 0xFF, 0xFF, 0xDE, 0xFF, + 0xFE, 0xFF, 0xED, 0xFE, 0xFE, 0xFF, 0xEF, 0xFF, 0xFF, 0xCE, 0xEF, 0xFF, + 0xFF, 0xFD, 0xDE, 0xFF, 0xEF, 0xFF, 0xFF, 0xFD, 0xFF, 0xEF, 0xFE, 0xEE, + 0xFF, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0xDD, 0xCC, 0xCC, 0xCE, 0xCE, + 0xCE, 0xED, 0xFF, 0xFF, 0xC0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xF8, 0xFF, 0x8F, 0xF8, 0xF8, 0xF9, 0xF8, 0x5F, 0xFF, + 0xF9, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8F, 0xFF, 0xFF, + 0xF8, 0x99, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xFF, + 0x88, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xFE, 0x8F, 0x8F, + 0x8F, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x88, 0x78, 0xFF, 0xFF, + 0xF8, 0x8F, 0xFF, 0xFF, 0xFF, 0xF9, 0x8F, 0xF8, 0xF9, 0xF9, 0x8F, 0xFF, + 0x8F, 0x8F, 0xF8, 0x89, 0x8F, 0x68, 0x68, 0x88, 0x88, 0xF8, 0xFF, 0xFF, + 0xFF, 0xF8, 0x88, 0x78, 0x64, 0x56, 0xFF, 0x8F, 0xF8, 0xFF, 0xFF, 0xF8, + 0xFF, 0x88, 0x64, 0x22, 0x48, 0x88, 0x8F, 0xFF, 0xFF, 0xE9, 0x8F, 0xFF, + 0xF7, 0x52, 0x25, 0x78, 0x8F, 0xF8, 0xFF, 0xFF, 0x9F, 0xFF, 0xF8, 0x87, + 0x44, 0x58, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x8F, 0xF7, 0x76, + 0x88, 0xF9, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0x79, 0x88, 0xF9, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xFF, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF8, 0xFF, 0xFF, 0x98, 0xFF, 0xFF, 0x8F, 0xF9, 0xFF, 0x8F, 0xFF, 0xFF, + 0x8F, 0xFF, 0xFF, 0xF8, 0xFF, 0x98, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x8F, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0x8F, 0xFF, 0xFF, + 0xFF, 0x8F, 0xFF, 0x8F, 0xFF, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0x99, 0xFF, 0xCF, 0xF8, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0x7F, 0x87, 0x87, 0x66, 0x68, 0x87, 0x77, 0x77, 0x68, 0xFF, 0x57, 0xFF, + 0x88, 0xFF, 0x88, 0x88, 0x8F, 0x88, 0xFF, 0xFF, 0xF8, 0x6F, 0xF7, 0x78, + 0xF8, 0x8F, 0x87, 0x78, 0x87, 0xFF, 0xF7, 0x87, 0xF7, 0xF8, 0x7F, 0xF8, + 0x88, 0x88, 0x87, 0x88, 0x8F, 0x87, 0xF8, 0x88, 0xF7, 0xF7, 0xFF, 0x8F, + 0x88, 0x7F, 0x8F, 0xF8, 0xF7, 0x8F, 0x8F, 0xF7, 0x77, 0xF7, 0x68, 0x8F, + 0x8F, 0xFF, 0xF7, 0x69, 0x8F, 0x88, 0x76, 0x78, 0x6F, 0x77, 0x6F, 0xFF, + 0x7F, 0x88, 0xF8, 0x8F, 0xF7, 0x87, 0x88, 0xF7, 0x7F, 0xF8, 0x8F, 0x77, + 0x68, 0x87, 0xF7, 0x86, 0x87, 0x67, 0x67, 0x7F, 0x78, 0xF8, 0x77, 0x77, + 0x88, 0x67, 0xF7, 0x76, 0x88, 0x78, 0x77, 0xFF, 0x8F, 0x7F, 0x88, 0x87, + 0x67, 0x67, 0x77, 0x77, 0x78, 0x8F, 0x7F, 0x77, 0x7F, 0x87, 0x76, 0x68, + 0x87, 0x77, 0x67, 0x7F, 0x7E, 0xE8, 0xCB, 0x88, 0x7F, 0xF7, 0x77, 0x87, + 0x6F, 0x8F, 0x87, 0x7F, 0x68, 0x88, 0xF7, 0x88, 0xF7, 0xF6, 0x87, 0xF8, + 0x87, 0xFF, 0xF7, 0x88, 0xF8, 0x8F, 0x8F, 0xF7, 0x88, 0x7F, 0xFF, 0x8F, + 0xFF, 0x77, 0xF8, 0x88, 0x78, 0x8F, 0xF7, 0x78, 0x77, 0x88, 0x8F, 0xF7, + 0x8F, 0xF8, 0xFF, 0xF8, 0x8F, 0x88, 0x78, 0x77, 0x7F, 0xF8, 0x78, 0xF8, + 0x88, 0x88, 0x7F, 0x8F, 0x7F, 0x8F, 0xA7, 0x78, 0x7F, 0xFF, 0xFF, 0x87, + 0x8F, 0x78, 0x87, 0x8F, 0x8F, 0x87, 0x8F, 0x77, 0xF8, 0xF7, 0x88, 0x8F, + 0x8F, 0xFF, 0xF8, 0x87, 0x7F, 0xF8, 0x8F, 0x87, 0x8F, 0x87, 0x78, 0x7F, + 0xF7, 0x77, 0x78, 0xF8, 0x70, 0x00, 0x00, 0x00, + }, + { + 0x57, 0x78, 0x66, 0x77, 0x66, 0x76, 0x77, 0x76, 0x87, 0x79, 0x68, 0xAD, + 0x98, 0x89, 0x98, 0xDA, 0xB9, 0x99, 0x99, 0x9D, 0x98, 0x79, 0xAA, 0x89, + 0x98, 0x88, 0x88, 0x98, 0xAA, 0x88, 0x9A, 0x87, 0x89, 0xA9, 0x99, 0x89, + 0x98, 0x98, 0x99, 0x89, 0xA9, 0x99, 0x7A, 0x88, 0x79, 0x98, 0x88, 0x87, + 0x87, 0x98, 0x88, 0x9A, 0x76, 0x98, 0x77, 0x88, 0x87, 0x97, 0x88, 0x98, + 0x98, 0x99, 0x88, 0x79, 0x89, 0x99, 0x78, 0x87, 0x88, 0x88, 0x89, 0xA9, + 0x98, 0x87, 0x99, 0x87, 0x78, 0x78, 0x87, 0x87, 0x87, 0x97, 0x99, 0x97, + 0x79, 0x98, 0x98, 0x78, 0x87, 0x98, 0x87, 0x78, 0x88, 0x9A, 0x76, 0x99, + 0x77, 0x78, 0x78, 0x77, 0x87, 0x78, 0x88, 0x99, 0xA7, 0x79, 0x88, 0x89, + 0x87, 0x77, 0x87, 0x88, 0x78, 0x88, 0x89, 0x77, 0x88, 0x97, 0x88, 0x87, + 0x87, 0x67, 0x88, 0x89, 0x89, 0x88, 0x79, 0x89, 0x88, 0x78, 0x87, 0x77, + 0x77, 0x78, 0x89, 0x8A, 0x76, 0x89, 0x97, 0x77, 0x97, 0x87, 0x77, 0x99, + 0x89, 0x99, 0x96, 0x6A, 0xA8, 0x88, 0x88, 0x88, 0x89, 0x87, 0x88, 0x88, + 0x99, 0x87, 0x9A, 0xA8, 0x88, 0x98, 0x78, 0x88, 0x88, 0x88, 0x99, 0x98, + 0x79, 0x99, 0x88, 0x88, 0x98, 0x88, 0x87, 0x88, 0x88, 0xA9, 0x78, 0xAA, + 0x98, 0x98, 0xA8, 0x88, 0x88, 0x88, 0x88, 0x88, 0xA7, 0x8A, 0x98, 0x89, + 0x8A, 0x88, 0x88, 0x9A, 0x89, 0x89, 0x99, 0x78, 0xA9, 0x99, 0xD8, 0x89, + 0x98, 0x8A, 0x89, 0x98, 0xAA, 0x87, 0x69, 0x88, 0x87, 0x87, 0x78, 0x77, + 0x67, 0x87, 0x77, 0x79, 0x50, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAB, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x85, 0x68, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xF5, 0x12, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x61, 0x15, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, + 0x65, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBB, 0xAF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xBB, 0xFF, 0x6F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFB, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xA9, 0x99, 0xBF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x97, 0x66, 0x88, 0xBF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFB, 0xB7, 0x53, 0x45, 0x7A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xF9, 0x63, 0x22, 0x46, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x96, 0x42, 0x24, 0x79, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBA, 0x85, + 0x44, 0x57, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x86, 0x67, + 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF9, 0x99, 0xBF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xBB, 0xBF, 0xFD, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8F, 0xFF, 0x5F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x88, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xF6, 0x12, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xF3, 0x07, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, + 0xBC, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF9, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xE5, 0xEF, 0xFF, 0xFF, 0x3F, 0xFF, + 0xEE, 0xEE, 0xE5, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5F, 0x5E, + 0x5E, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xF4, 0x5F, 0x5F, 0xFF, 0xF5, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x54, 0x55, 0x5F, 0x5F, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x5F, 0x4F, 0xFF, 0x54, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, + 0xEE, 0xEE, 0x4E, 0xE5, 0xE6, 0xEE, 0x5E, 0xEE, 0xEE, 0xEE, 0xEE, 0xE5, + 0xE5, 0xE5, 0xEE, 0x5E, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x5E, + 0xEE, 0x44, 0xEE, 0xEE, 0xEE, 0xEE, 0x5E, 0xEF, 0xFF, 0xF5, 0x45, 0x3F, + 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xF5, 0xFF, 0xFF, 0xFF, 0x4F, 0x4F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5F, 0x5F, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF5, 0xFF, 0x5F, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFE, 0xFF, 0xFF, 0xFE, 0xFF, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFF, + 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, + 0xFF, 0xFE, 0xFF, 0xFE, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xAF, 0x5F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFA, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, + 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0x99, 0x9B, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xA7, 0x67, 0x7F, 0xAB, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xA7, 0x54, 0x45, 0x79, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0x64, 0x22, 0x47, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xA6, 0x42, 0x23, 0x69, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x75, + 0x43, 0x57, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x77, 0x67, + 0x9A, 0xBE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xF9, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xDF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xBA, 0xAA, 0xAF, 0x5F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x99, 0xAA, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFC, 0x65, 0x56, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, + 0xFF, 0xFF, 0x94, 0x12, 0x59, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF9, 0x52, 0x14, 0x9D, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x97, + 0x54, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAA, 0xAA, + 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0xFA, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x9F, 0xFF, 0xBF, 0xFB, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFE, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xF9, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xAA, 0xAF, 0xFF, 0xA9, 0xAA, 0xFF, 0x5F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xAF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, + 0xAF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFA, 0xFF, 0xAF, 0xFF, 0xAF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xA8, 0xA7, 0x67, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xD7, 0x53, 0x45, 0x7A, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFA, 0x64, 0x22, 0x47, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xF9, + 0x97, 0x42, 0x24, 0x68, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFA, 0x76, + 0x44, 0x58, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x76, 0x67, + 0xFF, 0xFA, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xA9, 0xAF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xCA, 0xAF, 0xFF, 0xFA, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFA, 0xFA, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4F, 0xA9, 0xAF, 0xFF, 0xFA, 0x9F, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0x5F, 0xEF, 0x56, 0x6F, 0xF6, 0x66, 0xEE, 0xEF, 0x6F, 0xFF, 0x56, 0xE6, + 0xE6, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEE, 0xE6, 0xEE, + 0xEE, 0xEE, 0xE6, 0xEE, 0xEE, 0xEE, 0xEE, 0xEF, 0xFF, 0xFF, 0x6F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xEE, 0xEE, 0xE6, 0xEE, 0xEE, 0x6E, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x6E, 0x4E, 0x6E, 0xEE, 0xEE, 0xEE, + 0xE6, 0xEE, 0xEE, 0xEF, 0xF6, 0xF5, 0x6F, 0x56, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xF5, 0xFF, 0xFF, 0xFF, 0xF4, 0x6F, 0x6F, 0xFF, 0xFF, 0xFF, 0xFE, + 0xEE, 0xE5, 0xE6, 0x66, 0x65, 0x6E, 0xE5, 0xEE, 0xE6, 0xEE, 0xEE, 0xEE, + 0xEE, 0xE5, 0x56, 0x45, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xE6, 0xE6, 0x65, 0x65, 0xEE, 0xEE, 0xEE, 0xE6, 0xEE, 0xEE, 0xE6, 0x66, + 0x6E, 0x6E, 0xEE, 0xEE, 0xE6, 0xEE, 0x6E, 0xEF, 0xF6, 0xF6, 0xFF, 0x56, + 0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x55, 0x6F, + 0x66, 0xF5, 0xF6, 0xFF, 0xF6, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF6, 0xF5, 0xF6, 0xFF, 0x6F, 0xFE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xE6, 0xEE, 0xEE, 0xFE, 0x6E, 0xFE, + 0xFF, 0xFE, 0xFF, 0x6E, 0xF6, 0xFE, 0xFF, 0x66, 0xFF, 0xFE, 0xFF, 0xFE, + 0xEF, 0xFF, 0xFF, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x5F, 0xFF, 0xFE, 0xFF, 0xFF, 0x5F, 0xFF, 0x65, 0x6F, 0xF6, 0xFE, + 0x66, 0xFE, 0x66, 0x5E, 0x50, 0x00, 0x00, 0x00, + }, + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xA8, 0xFF, 0xFF, 0xF7, 0xFF, 0x3F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x8F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFE, 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0x76, 0x77, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0x86, 0x54, 0x45, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xF9, 0x64, 0x22, 0x48, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF6, 0x42, 0x24, 0x5F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xF5, + 0x44, 0x5B, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0xF6, + 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x87, 0x7F, 0x8F, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0x8F, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xEE, 0xEE, 0xEE, 0xDE, 0xEE, 0xEE, 0xED, 0xD5, 0xEE, 0xEE, 0x3E, 0xEE, + 0xEE, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xED, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xED, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, + 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xE4, 0x21, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xDD, + 0xDD, 0xD1, 0x1D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, + 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xED, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFE, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0x75, 0x4F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xF4, 0x12, 0x47, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x42, 0x14, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x54, 0xBF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x5F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + { + 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x4F, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFC, 0xCF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x77, 0x67, 0xAF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xF6, 0x44, 0x45, 0xF7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xF6, 0x54, 0x22, 0x46, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF5, 0x42, 0x34, 0x5F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x75, + 0x43, 0x4F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0x56, + 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x6F, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, + 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, + }, + { + 0xEE, 0xEE, 0xEE, 0xDE, 0xEE, 0xEE, 0xED, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, + 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0x53, 0x4E, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xE5, 0x12, 0xEE, 0xEE, 0xEE, 0xEE, 0xED, 0xDD, 0xDD, 0xDD, + 0xDD, 0xD2, 0x24, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, + 0xD3, 0x3D, 0xDD, 0xDD, 0xDD, 0xDD, 0xDD, 0xDE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0xEE, 0x3E, 0xE5, 0xEE, 0xEE, 0xEE, 0xEE, + 0xEE, 0xEE, 0xEE, 0xED, 0xE0, 0x00, 0x00, 0x00, + }, + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + { + 0x88, 0x88, 0x88, 0x78, 0x88, 0x88, 0x87, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x87, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x87, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, + 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, + 0x88, 0x88, 0x88, 0x88, 0x80, 0x00, 0x00, 0x00, + }, + }, +}; + +#endif /* AVCODEC_RALFDATA_H */ diff --git a/include/libavcodec/rangecoder.h b/include/libavcodec/rangecoder.h new file mode 100644 index 0000000..110908d --- /dev/null +++ b/include/libavcodec/rangecoder.h @@ -0,0 +1,144 @@ +/* + * Range coder + * Copyright (c) 2004 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * Range coder. + */ + +#ifndef AVCODEC_RANGECODER_H +#define AVCODEC_RANGECODER_H + +#include + +#include "libavutil/avassert.h" +#include "libavutil/intmath.h" + +typedef struct RangeCoder { + int low; + int range; + int outstanding_count; + int outstanding_byte; + uint8_t zero_state[256]; + uint8_t one_state[256]; + uint8_t *bytestream_start; + uint8_t *bytestream; + uint8_t *bytestream_end; + int overread; +#define MAX_OVERREAD 2 +} RangeCoder; + +void ff_init_range_encoder(RangeCoder *c, uint8_t *buf, int buf_size); +void ff_init_range_decoder(RangeCoder *c, const uint8_t *buf, int buf_size); + +/** + * Terminates the range coder + * @param version version 0 requires the decoder to know the data size in bytes + * version 1 needs about 1 bit more space but does not need to + * carry the size from encoder to decoder + */ +int ff_rac_terminate(RangeCoder *c, int version); + +void ff_build_rac_states(RangeCoder *c, int factor, int max_p); + +static inline void renorm_encoder(RangeCoder *c) +{ + // FIXME: optimize + if (c->outstanding_byte < 0) { + c->outstanding_byte = c->low >> 8; + } else if (c->low <= 0xFF00) { + *c->bytestream++ = c->outstanding_byte; + for (; c->outstanding_count; c->outstanding_count--) + *c->bytestream++ = 0xFF; + c->outstanding_byte = c->low >> 8; + } else if (c->low >= 0x10000) { + *c->bytestream++ = c->outstanding_byte + 1; + for (; c->outstanding_count; c->outstanding_count--) + *c->bytestream++ = 0x00; + c->outstanding_byte = (c->low >> 8) & 0xFF; + } else { + c->outstanding_count++; + } + + c->low = (c->low & 0xFF) << 8; + c->range <<= 8; +} + +static inline int get_rac_count(RangeCoder *c) +{ + int x = c->bytestream - c->bytestream_start + c->outstanding_count; + if (c->outstanding_byte >= 0) + x++; + return 8 * x - av_log2(c->range); +} + +static inline void put_rac(RangeCoder *c, uint8_t *const state, int bit) +{ + int range1 = (c->range * (*state)) >> 8; + + av_assert2(*state); + av_assert2(range1 < c->range); + av_assert2(range1 > 0); + if (!bit) { + c->range -= range1; + *state = c->zero_state[*state]; + } else { + c->low += c->range - range1; + c->range = range1; + *state = c->one_state[*state]; + } + + while (c->range < 0x100) + renorm_encoder(c); +} + +static inline void refill(RangeCoder *c) +{ + if (c->range < 0x100) { + c->range <<= 8; + c->low <<= 8; + if (c->bytestream < c->bytestream_end) { + c->low += c->bytestream[0]; + c->bytestream++; + } else + c->overread ++; + } +} + +static inline int get_rac(RangeCoder *c, uint8_t *const state) +{ + int range1 = (c->range * (*state)) >> 8; + + c->range -= range1; + if (c->low < c->range) { + *state = c->zero_state[*state]; + refill(c); + return 0; + } else { + c->low -= c->range; + *state = c->one_state[*state]; + c->range = range1; + refill(c); + return 1; + } +} + +#endif /* AVCODEC_RANGECODER_H */ diff --git a/include/libavcodec/ratecontrol.h b/include/libavcodec/ratecontrol.h new file mode 100644 index 0000000..4d71a18 --- /dev/null +++ b/include/libavcodec/ratecontrol.h @@ -0,0 +1,93 @@ +/* + * Ratecontrol + * Copyright (c) 2000, 2001, 2002 Fabrice Bellard + * Copyright (c) 2002-2004 Michael Niedermayer + * + * 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_RATECONTROL_H +#define AVCODEC_RATECONTROL_H + +/** + * @file + * ratecontrol header. + */ + +#include + +typedef struct Predictor{ + double coeff; + double count; + double decay; +} Predictor; + +typedef struct RateControlEntry{ + int pict_type; + float qscale; + int i_count; + int f_code; + int b_code; + int mv_bits; + int i_tex_bits; + int p_tex_bits; + int misc_bits; + int header_bits; + uint64_t expected_bits; + int new_pict_type; + float new_qscale; + int64_t mc_mb_var_sum; + int64_t mb_var_sum; +}RateControlEntry; + +/** + * rate control context. + */ +typedef struct RateControlContext{ + int num_entries; ///< number of RateControlEntries + RateControlEntry *entry; + double buffer_index; ///< amount of bits in the video/audio buffer + Predictor pred[5]; + double short_term_qsum; ///< sum of recent qscales + double short_term_qcount; ///< count of recent qscales + double pass1_rc_eq_output_sum;///< sum of the output of the rc equation, this is used for normalization + double pass1_wanted_bits; ///< bits which should have been output by the pass1 code (including complexity init) + double last_qscale; + double last_qscale_for[5]; ///< last qscale for a specific pict type, used for max_diff & ipb factor stuff + int64_t last_mc_mb_var_sum; + int64_t last_mb_var_sum; + uint64_t i_cplx_sum[5]; + uint64_t p_cplx_sum[5]; + uint64_t mv_bits_sum[5]; + uint64_t qscale_sum[5]; + int frame_count[5]; + int last_non_b_pict_type; + + struct AVExpr *rc_eq_eval; +}RateControlContext; + +struct MpegEncContext; + +/* rate control */ +int ff_rate_control_init(struct MpegEncContext *s); +float ff_rate_estimate_qscale(struct MpegEncContext *s, int dry_run); +void ff_write_pass1_stats(struct MpegEncContext *s); +int ff_vbv_update(struct MpegEncContext *s, int frame_size); +void ff_get_2pass_fcode(struct MpegEncContext *s); +void ff_rate_control_uninit(RateControlContext *rcc); + +#endif /* AVCODEC_RATECONTROL_H */ diff --git a/include/libavcodec/raw.h b/include/libavcodec/raw.h new file mode 100644 index 0000000..9a4ddef --- /dev/null +++ b/include/libavcodec/raw.h @@ -0,0 +1,48 @@ +/* + * Raw Video Codec + * Copyright (c) 2001 Fabrice Bellard + * + * 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 + */ + +/** + * @file + * Raw Video Codec + */ + +#ifndef AVCODEC_RAW_H +#define AVCODEC_RAW_H + +#include "libavutil/pixfmt.h" + +typedef struct PixelFormatTag { + enum AVPixelFormat pix_fmt; + unsigned int fourcc; +} PixelFormatTag; + +const struct PixelFormatTag *avpriv_get_raw_pix_fmt_tags(void); + +enum PixelFormatTagLists { + PIX_FMT_LIST_RAW, + PIX_FMT_LIST_AVI, + PIX_FMT_LIST_MOV, +}; + +enum AVPixelFormat avpriv_pix_fmt_find(enum PixelFormatTagLists list, + unsigned fourcc); + +#endif /* AVCODEC_RAW_H */ diff --git a/include/libavcodec/rectangle.h b/include/libavcodec/rectangle.h new file mode 100644 index 0000000..df7c18a --- /dev/null +++ b/include/libavcodec/rectangle.h @@ -0,0 +1,124 @@ +/* + * rectangle filling function + * Copyright (c) 2003 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * useful rectangle filling function + * @author Michael Niedermayer + */ + +#ifndef AVCODEC_RECTANGLE_H +#define AVCODEC_RECTANGLE_H + +#include "config.h" +#include "libavutil/common.h" +#include "libavutil/avassert.h" + +/** + * fill a rectangle. + * @param h height of the rectangle, should be a constant + * @param w width of the rectangle, should be a constant + * @param size the size of val (1, 2 or 4), should be a constant + */ +static av_always_inline void fill_rectangle(void *vp, int w, int h, int stride, uint32_t val, int size){ + uint8_t *p= (uint8_t*)vp; + av_assert2(size==1 || size==2 || size==4); + av_assert2(w<=4); + + w *= size; + stride *= size; + + av_assert2((((long)vp)&(FFMIN(w, 8<<(HAVE_NEON|ARCH_PPC|HAVE_MMX))-1)) == 0); + av_assert2((stride&(w-1))==0); + if(w==2){ + const uint16_t v= size==4 ? val : val*0x0101; + *(uint16_t*)(p + 0*stride)= v; + if(h==1) return; + *(uint16_t*)(p + 1*stride)= v; + if(h==2) return; + *(uint16_t*)(p + 2*stride)= v; + *(uint16_t*)(p + 3*stride)= v; + }else if(w==4){ + const uint32_t v= size==4 ? val : size==2 ? val*0x00010001 : val*0x01010101; + *(uint32_t*)(p + 0*stride)= v; + if(h==1) return; + *(uint32_t*)(p + 1*stride)= v; + if(h==2) return; + *(uint32_t*)(p + 2*stride)= v; + *(uint32_t*)(p + 3*stride)= v; + }else if(w==8){ + // gcc cannot optimize 64-bit math on x86_32 +#if HAVE_FAST_64BIT + const uint64_t v= size==2 ? val*0x0001000100010001ULL : val*0x0100000001ULL; + *(uint64_t*)(p + 0*stride)= v; + if(h==1) return; + *(uint64_t*)(p + 1*stride)= v; + if(h==2) return; + *(uint64_t*)(p + 2*stride)= v; + *(uint64_t*)(p + 3*stride)= v; + }else if(w==16){ + const uint64_t v= val*0x0100000001ULL; + *(uint64_t*)(p + 0+0*stride)= v; + *(uint64_t*)(p + 8+0*stride)= v; + *(uint64_t*)(p + 0+1*stride)= v; + *(uint64_t*)(p + 8+1*stride)= v; + if(h==2) return; + *(uint64_t*)(p + 0+2*stride)= v; + *(uint64_t*)(p + 8+2*stride)= v; + *(uint64_t*)(p + 0+3*stride)= v; + *(uint64_t*)(p + 8+3*stride)= v; +#else + const uint32_t v= size==2 ? val*0x00010001 : val; + *(uint32_t*)(p + 0+0*stride)= v; + *(uint32_t*)(p + 4+0*stride)= v; + if(h==1) return; + *(uint32_t*)(p + 0+1*stride)= v; + *(uint32_t*)(p + 4+1*stride)= v; + if(h==2) return; + *(uint32_t*)(p + 0+2*stride)= v; + *(uint32_t*)(p + 4+2*stride)= v; + *(uint32_t*)(p + 0+3*stride)= v; + *(uint32_t*)(p + 4+3*stride)= v; + }else if(w==16){ + *(uint32_t*)(p + 0+0*stride)= val; + *(uint32_t*)(p + 4+0*stride)= val; + *(uint32_t*)(p + 8+0*stride)= val; + *(uint32_t*)(p +12+0*stride)= val; + *(uint32_t*)(p + 0+1*stride)= val; + *(uint32_t*)(p + 4+1*stride)= val; + *(uint32_t*)(p + 8+1*stride)= val; + *(uint32_t*)(p +12+1*stride)= val; + if(h==2) return; + *(uint32_t*)(p + 0+2*stride)= val; + *(uint32_t*)(p + 4+2*stride)= val; + *(uint32_t*)(p + 8+2*stride)= val; + *(uint32_t*)(p +12+2*stride)= val; + *(uint32_t*)(p + 0+3*stride)= val; + *(uint32_t*)(p + 4+3*stride)= val; + *(uint32_t*)(p + 8+3*stride)= val; + *(uint32_t*)(p +12+3*stride)= val; +#endif + }else + av_assert2(0); + av_assert2(h==4); +} + +#endif /* AVCODEC_RECTANGLE_H */ diff --git a/include/libavcodec/refstruct.h b/include/libavcodec/refstruct.h new file mode 100644 index 0000000..c64ad62 --- /dev/null +++ b/include/libavcodec/refstruct.h @@ -0,0 +1,297 @@ +/* + * 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_REFSTRUCT_H +#define AVCODEC_REFSTRUCT_H + +#include + +/** + * RefStruct is an API for creating reference-counted objects + * with minimal overhead. The API is designed for objects, + * not buffers like the AVBuffer API. The main differences + * to the AVBuffer API are as follows: + * + * - It uses void* instead of uint8_t* as its base type due to + * its focus on objects. + * - There are no equivalents of AVBuffer and AVBufferRef. + * E.g. there is no way to get the usable size of the object: + * The user is supposed to know what is at the other end of + * the pointer. It also avoids one level of indirection. + * - Custom allocators are not supported. This allows to simplify + * the implementation and reduce the amount of allocations. + * - It also has the advantage that the user's free callback need + * only free the resources owned by the object, but not the + * object itself. + * - Because referencing (and replacing) an object managed by the + * RefStruct API does not involve allocations, they can not fail + * and therefore need not be checked. + * + * @note Referencing and unreferencing the buffers is thread-safe and thus + * may be done from multiple threads simultaneously without any need for + * additional locking. + */ + +/** + * This union is used for all opaque parameters in this API to spare the user + * to cast const away in case the opaque to use is const-qualified. + * + * The functions provided by this API with an FFRefStructOpaque come in pairs + * named foo_c and foo. The foo function accepts void* as opaque and is just + * a wrapper around the foo_c function; "_c" means "(potentially) const". + */ +typedef union { + void *nc; + const void *c; +} FFRefStructOpaque; + +/** + * If this flag is set in ff_refstruct_alloc_ext_c(), the object will not + * be initially zeroed. + */ +#define FF_REFSTRUCT_FLAG_NO_ZEROING (1 << 0) + +/** + * Allocate a refcounted object of usable size `size` managed via + * the RefStruct API. + * + * By default (in the absence of flags to the contrary), + * the returned object is initially zeroed. + * + * @param size Desired usable size of the returned object. + * @param flags A bitwise combination of FF_REFSTRUCT_FLAG_* flags. + * @param opaque A pointer that will be passed to the free_cb callback. + * @param free_cb A callback for freeing this object's content + * when its reference count reaches zero; + * it must not free the object itself. + * @return A pointer to an object of the desired size or NULL on failure. + */ +void *ff_refstruct_alloc_ext_c(size_t size, unsigned flags, FFRefStructOpaque opaque, + void (*free_cb)(FFRefStructOpaque opaque, void *obj)); + +/** + * A wrapper around ff_refstruct_alloc_ext_c() for the common case + * of a non-const qualified opaque. + * + * @see ff_refstruct_alloc_ext_c() + */ +static inline +void *ff_refstruct_alloc_ext(size_t size, unsigned flags, void *opaque, + void (*free_cb)(FFRefStructOpaque opaque, void *obj)) +{ + return ff_refstruct_alloc_ext_c(size, flags, (FFRefStructOpaque){.nc = opaque}, + free_cb); +} + +/** + * Equivalent to ff_refstruct_alloc_ext(size, 0, NULL, NULL) + */ +static inline +void *ff_refstruct_allocz(size_t size) +{ + return ff_refstruct_alloc_ext(size, 0, NULL, NULL); +} + +/** + * Decrement the reference count of the underlying object and automatically + * free the object if there are no more references to it. + * + * `*objp == NULL` is legal and a no-op. + * + * @param objp Pointer to a pointer that is either NULL or points to an object + * managed via this API. `*objp` is set to NULL on return. + */ +void ff_refstruct_unref(void *objp); + +/** + * Create a new reference to an object managed via this API, + * i.e. increment the reference count of the underlying object + * and return obj. + * @return a pointer equal to obj. + */ +void *ff_refstruct_ref(void *obj); + +/** + * Analog of ff_refstruct_ref(), but for constant objects. + * @see ff_refstruct_ref() + */ +const void *ff_refstruct_ref_c(const void *obj); + +/** + * Ensure `*dstp` refers to the same object as src. + * + * If `*dstp` is already equal to src, do nothing. Otherwise unreference `*dstp` + * and replace it with a new reference to src in case `src != NULL` (this + * involves incrementing the reference count of src's underlying object) or + * with NULL otherwise. + * + * @param dstp Pointer to a pointer that is either NULL or points to an object + * managed via this API. + * @param src A pointer to an object managed via this API or NULL. + */ +void ff_refstruct_replace(void *dstp, const void *src); + +/** + * Check whether the reference count of an object managed + * via this API is 1. + * + * @param obj A pointer to an object managed via this API. + * @return 1 if the reference count of obj is 1; 0 otherwise. + */ +int ff_refstruct_exclusive(const void *obj); + +/** + * FFRefStructPool is an API for a thread-safe pool of objects managed + * via the RefStruct API. + * + * Frequently allocating and freeing large or complicated objects may be slow + * and wasteful. This API is meant to solve this in cases when the caller + * needs a set of interchangable objects. + * + * At the beginning, the user must call allocate the pool via + * ff_refstruct_pool_alloc() or its analogue ff_refstruct_pool_alloc_ext(). + * Then whenever an object is needed, call ff_refstruct_pool_get() to + * get a new or reused object from the pool. This new object works in all + * aspects the same way as the ones created by ff_refstruct_alloc_ext(). + * However, when the last reference to this object is unreferenced, it is + * (optionally) reset and returned to the pool instead of being freed and + * will be reused for subsequent ff_refstruct_pool_get() calls. + * + * When the caller is done with the pool and no longer needs to create any new + * objects, ff_refstruct_pool_uninit() must be called to mark the pool as + * freeable. Then entries returned to the pool will then be freed. + * Once all the entries are freed, the pool will automatically be freed. + * + * Allocating and releasing objects with this API is thread-safe as long as + * the user-supplied callbacks (if provided) are thread-safe. + */ + +/** + * The buffer pool. This structure is opaque and not meant to be accessed + * directly. It is allocated with the allocators below and freed with + * ff_refstruct_pool_uninit(). + */ +typedef struct FFRefStructPool FFRefStructPool; + +/** + * If this flag is not set, every object in the pool will be zeroed before + * the init callback is called or before it is turned over to the user + * for the first time if no init callback has been provided. + */ +#define FF_REFSTRUCT_POOL_FLAG_NO_ZEROING FF_REFSTRUCT_FLAG_NO_ZEROING +/** + * If this flag is set and both init_cb and reset_cb callbacks are provided, + * then reset_cb will be called if init_cb fails. + * The object passed to reset_cb will be in the state left by init_cb. + */ +#define FF_REFSTRUCT_POOL_FLAG_RESET_ON_INIT_ERROR (1 << 16) +/** + * If this flag is set and both init_cb and free_entry_cb callbacks are + * provided, then free_cb will be called if init_cb fails. + * + * It will be called after reset_cb in case reset_cb and the + * FF_REFSTRUCT_POOL_FLAG_RESET_ON_INIT_ERROR flag are also set. + * + * The object passed to free_cb will be in the state left by + * the callbacks applied earlier (init_cb potentially followed by reset_cb). + */ +#define FF_REFSTRUCT_POOL_FLAG_FREE_ON_INIT_ERROR (1 << 17) +/** + * If this flag is set, the entries will be zeroed before + * being returned to the user (after the init or reset callbacks + * have been called (if provided)). Furthermore, to avoid zeroing twice + * it also makes the pool behave as if the FF_REFSTRUCT_POOL_FLAG_NO_ZEROING + * flag had been provided. + */ +#define FF_REFSTRUCT_POOL_FLAG_ZERO_EVERY_TIME (1 << 18) + +/** + * Equivalent to ff_refstruct_pool_alloc(size, flags, NULL, NULL, NULL, NULL, NULL) + */ +FFRefStructPool *ff_refstruct_pool_alloc(size_t size, unsigned flags); + +/** + * Allocate an FFRefStructPool, potentially using complex callbacks. + * + * @param size size of the entries of the pool + * @param flags a bitwise combination of FF_REFSTRUCT_POOL_FLAG_* flags + * @param opaque A pointer that will be passed to the callbacks below. + * @param init A callback that will be called directly after a new entry + * has been allocated. obj has already been zeroed unless + * the FF_REFSTRUCT_POOL_FLAG_NO_ZEROING flag is in use. + * @param reset A callback that will be called after an entry has been + * returned to the pool and before it is reused. + * @param free_entry A callback that will be called when an entry is freed + * after the pool has been marked as to be uninitialized. + * @param free A callback that will be called when the pool itself is + * freed (after the last entry has been returned and freed). + */ +FFRefStructPool *ff_refstruct_pool_alloc_ext_c(size_t size, unsigned flags, + FFRefStructOpaque opaque, + int (*init_cb)(FFRefStructOpaque opaque, void *obj), + void (*reset_cb)(FFRefStructOpaque opaque, void *obj), + void (*free_entry_cb)(FFRefStructOpaque opaque, void *obj), + void (*free_cb)(FFRefStructOpaque opaque)); + +/** + * A wrapper around ff_refstruct_pool_alloc_ext_c() for the common case + * of a non-const qualified opaque. + * + * @see ff_refstruct_pool_alloc_ext_c() + */ +static inline +FFRefStructPool *ff_refstruct_pool_alloc_ext(size_t size, unsigned flags, + void *opaque, + int (*init_cb)(FFRefStructOpaque opaque, void *obj), + void (*reset_cb)(FFRefStructOpaque opaque, void *obj), + void (*free_entry_cb)(FFRefStructOpaque opaque, void *obj), + void (*free_cb)(FFRefStructOpaque opaque)) +{ + return ff_refstruct_pool_alloc_ext_c(size, flags, (FFRefStructOpaque){.nc = opaque}, + init_cb, reset_cb, free_entry_cb, free_cb); +} + +/** + * Get an object from the pool, reusing an old one from the pool when + * available. + * + * Every call to this function must happen before ff_refstruct_pool_uninit(). + * Otherwise undefined behaviour may occur. + * + * @param pool the pool from which to get the object + * @return a reference to the object on success, NULL on error. + */ +void *ff_refstruct_pool_get(FFRefStructPool *pool); + +/** + * Mark the pool as being available for freeing. It will actually be freed + * only once all the allocated buffers associated with the pool are released. + * Thus it is safe to call this function while some of the allocated buffers + * are still in use. + * + * It is illegal to try to get a new entry after this function has been called. + * + * @param poolp pointer to a pointer to either NULL or a pool to be freed. + * `*poolp` will be set to NULL. + */ +static inline void ff_refstruct_pool_uninit(FFRefStructPool **poolp) +{ + ff_refstruct_unref(poolp); +} + +#endif /* AVCODEC_REFSTRUCT_H */ diff --git a/include/libavcodec/rl.h b/include/libavcodec/rl.h new file mode 100644 index 0000000..c45d865 --- /dev/null +++ b/include/libavcodec/rl.h @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2000-2002 Fabrice Bellard + * Copyright (c) 2002-2004 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * rl header. + */ + +#ifndef AVCODEC_RL_H +#define AVCODEC_RL_H + +#include + +#include "vlc.h" + +/* run length table */ +#define MAX_RUN 64 +#define MAX_LEVEL 64 + +/** RLTable. */ +typedef struct RLTable { + int n; ///< number of entries of table_vlc minus 1 + int last; ///< number of values for last = 0 + const uint16_t (*table_vlc)[2]; + const int8_t *table_run; + const int8_t *table_level; + uint8_t *index_run[2]; ///< encoding only + int8_t *max_level[2]; ///< encoding & decoding + int8_t *max_run[2]; ///< encoding & decoding + RL_VLC_ELEM *rl_vlc[32]; ///< decoding only +} RLTable; + +/** + * Initialize max_level and index_run from table_run and table_level; + * this is equivalent to initializing RLTable.max_level[0] and + * RLTable.index_run[0] with ff_rl_init(). + */ +void ff_rl_init_level_run(uint8_t max_level[MAX_LEVEL + 1], + uint8_t index_run[MAX_RUN + 1], + const uint8_t table_run[/* n */], + const uint8_t table_level[/* n*/], int n); + +/** + * Initialize index_run, max_level and max_run from n, last, table_vlc, + * table_run and table_level. + * @param static_store static uint8_t array[2][2*MAX_RUN + MAX_LEVEL + 3] + * to hold the level and run tables. + * @note This function does not touch rl_vlc at all, hence there is no need + * to synchronize calls to ff_rl_init() and ff_rl_init_vlc() using the + * same RLTable. + */ +void ff_rl_init(RLTable *rl, uint8_t static_store[2][2*MAX_RUN + MAX_LEVEL + 3]); + +/** + * Initialize rl_vlc from n, last, table_vlc, table_run and table_level. + * All rl_vlc pointers to be initialized must already point to a static + * buffer of `static_size` RL_VLC_ELEM elements; if a pointer is NULL, + * initializing further VLCs stops. + * @note This function does not touch what ff_rl_init() initializes at all, + * hence there is no need to synchronize calls to ff_rl_init() and + * ff_rl_init_vlc() using the same RLTable. + */ +void ff_rl_init_vlc(RLTable *rl, unsigned static_size); + +#define VLC_INIT_RL(rl, static_size)\ +{\ + static RL_VLC_ELEM rl_vlc_table[32][static_size];\ +\ + for (int q = 0; q < 32; q++) \ + rl.rl_vlc[q] = rl_vlc_table[q]; \ +\ + ff_rl_init_vlc(&rl, static_size); \ +} + +#define INIT_FIRST_VLC_RL(rl, static_size) \ +do { \ + static RL_VLC_ELEM rl_vlc_table[static_size]; \ + \ + rl.rl_vlc[0] = rl_vlc_table; \ + ff_rl_init_vlc(&rl, static_size); \ +} while (0) + +static inline int get_rl_index(const RLTable *rl, int last, int run, int level) +{ + int index; + index = rl->index_run[last][run]; + if (index >= rl->n) + return rl->n; + if (level > rl->max_level[last][run]) + return rl->n; + return index + level - 1; +} + +#endif /* AVCODEC_RL_H */ diff --git a/include/libavcodec/rle.h b/include/libavcodec/rle.h new file mode 100644 index 0000000..a92edf7 --- /dev/null +++ b/include/libavcodec/rle.h @@ -0,0 +1,51 @@ +/* + * RLE encoder + * + * 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_RLE_H +#define AVCODEC_RLE_H + +#include + +/** + * Count up to 127 consecutive pixels which are either all the same or + * all differ from the previous and next pixels. + * @param start Pointer to the first pixel + * @param len Maximum number of pixels + * @param bpp Bytes per pixel + * @param same 1 if searching for identical pixel values, 0 for differing + * @return Number of matching consecutive pixels found + */ +int ff_rle_count_pixels(const uint8_t *start, int len, int bpp, int same); + +/** + * RLE compress the row, with maximum size of out_size. + * Value before repeated bytes is (count ^ xor_rep) + add_rep. + * Value before raw bytes is (count ^ xor_raw) + add_raw. + * @param outbuf Output buffer + * @param out_size Maximum output size + * @param inbuf Input buffer + * @param bpp Bytes per pixel + * @param w Image width + * @return Size of output in bytes, or -1 if larger than out_size + */ +int ff_rle_encode(uint8_t *outbuf, int out_size, const uint8_t *inbuf, int bpp, + int w, int add_rep, int xor_rep, int add_raw, int xor_raw); + +#endif /* AVCODEC_RLE_H */ diff --git a/include/libavcodec/rnd_avg.h b/include/libavcodec/rnd_avg.h new file mode 100644 index 0000000..344775e --- /dev/null +++ b/include/libavcodec/rnd_avg.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2001-2003 BERO + * Copyright (c) 2011 Oskar Arvidsson + * + * 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_RND_AVG_H +#define AVCODEC_RND_AVG_H + +#include +#include + +#define BYTE_VEC32(c) ((c) * 0x01010101UL) +#define BYTE_VEC64(c) ((c) * 0x0001000100010001UL) + +static inline uint32_t rnd_avg32(uint32_t a, uint32_t b) +{ + return (a | b) - (((a ^ b) & ~BYTE_VEC32(0x01)) >> 1); +} + +static inline uint32_t no_rnd_avg32(uint32_t a, uint32_t b) +{ + return (a & b) + (((a ^ b) & ~BYTE_VEC32(0x01)) >> 1); +} + +static inline uint64_t rnd_avg64(uint64_t a, uint64_t b) +{ + return (a | b) - (((a ^ b) & ~BYTE_VEC64(0x01)) >> 1); +} + +static inline uint64_t no_rnd_avg64(uint64_t a, uint64_t b) +{ + return (a & b) + (((a ^ b) & ~BYTE_VEC64(0x01)) >> 1); +} + +#endif /* AVCODEC_RND_AVG_H */ diff --git a/include/libavcodec/roqvideo.h b/include/libavcodec/roqvideo.h new file mode 100644 index 0000000..2c2e428 --- /dev/null +++ b/include/libavcodec/roqvideo.h @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2003 Mike Melanson + * Copyright (C) 2003 Dr. Tim Ferguson + * + * 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_ROQVIDEO_H +#define AVCODEC_ROQVIDEO_H + +#include "libavutil/frame.h" + +typedef struct roq_cell { + unsigned char y[4]; + unsigned char u, v; +} roq_cell; + +typedef struct roq_qcell { + int idx[4]; +} roq_qcell; + +typedef struct motion_vect { + int d[2]; +} motion_vect; + +typedef struct RoqContext { + const AVClass *class; + void *logctx; + AVFrame *last_frame; + AVFrame *current_frame; + int width, height; + + roq_cell cb2x2[256]; + roq_qcell cb4x4[256]; +} RoqContext; + +#define RoQ_INFO 0x1001 +#define RoQ_QUAD_CODEBOOK 0x1002 +#define RoQ_QUAD_VQ 0x1011 +#define RoQ_SOUND_MONO 0x1020 +#define RoQ_SOUND_STEREO 0x1021 + +#define RoQ_ID_MOT 0x00 +#define RoQ_ID_FCC 0x01 +#define RoQ_ID_SLD 0x02 +#define RoQ_ID_CCC 0x03 + +void ff_apply_vector_2x2(RoqContext *ri, int x, int y, roq_cell *cell); +void ff_apply_vector_4x4(RoqContext *ri, int x, int y, roq_cell *cell); + +void ff_apply_motion_4x4(RoqContext *ri, int x, int y, int deltax, int deltay); + +void ff_apply_motion_8x8(RoqContext *ri, int x, int y, int deltax, int deltay); + +#endif /* AVCODEC_ROQVIDEO_H */ diff --git a/include/libavcodec/rtjpeg.h b/include/libavcodec/rtjpeg.h new file mode 100644 index 0000000..14befb5 --- /dev/null +++ b/include/libavcodec/rtjpeg.h @@ -0,0 +1,51 @@ +/* + * RTJpeg decoding functions + * copyright (c) 2006 Reimar Doeffinger + * + * 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_RTJPEG_H +#define AVCODEC_RTJPEG_H + +#include + +#include "libavutil/frame.h" +#include "libavutil/mem_internal.h" +#include "idctdsp.h" + +#define RTJPEG_FILE_VERSION 0 +#define RTJPEG_HEADER_SIZE 12 + +typedef struct RTJpegContext { + int w, h; + IDCTDSPContext idsp; + uint8_t scan[64]; + uint32_t lquant[64]; + uint32_t cquant[64]; + DECLARE_ALIGNED(16, int16_t, block)[64]; +} RTJpegContext; + +struct AVCodecContext; +void ff_rtjpeg_init(RTJpegContext *c, struct AVCodecContext *avctx); + +void ff_rtjpeg_decode_init(RTJpegContext *c, int width, int height, + const uint32_t *lquant, const uint32_t *cquant); + +int ff_rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f, + const uint8_t *buf, int buf_size); +#endif /* AVCODEC_RTJPEG_H */ diff --git a/include/libavcodec/rv10dec.h b/include/libavcodec/rv10dec.h new file mode 100644 index 0000000..daa6b8d --- /dev/null +++ b/include/libavcodec/rv10dec.h @@ -0,0 +1,28 @@ +/* + * RV10/RV20 decoder + * + * 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_RV10DEC_H +#define AVCODEC_RV10DEC_H + +#include "mpegvideo.h" + +int ff_rv_decode_dc(MpegEncContext *s, int n); + +#endif /* AVCODEC_RV10DEC_H */ diff --git a/include/libavcodec/rv10enc.h b/include/libavcodec/rv10enc.h new file mode 100644 index 0000000..fc3665e --- /dev/null +++ b/include/libavcodec/rv10enc.h @@ -0,0 +1,29 @@ +/* + * RV10/RV20 encoder + * + * 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_RV10ENC_H +#define AVCODEC_RV10ENC_H + +#include "mpegvideo.h" + +int ff_rv10_encode_picture_header(MpegEncContext *s); +void ff_rv20_encode_picture_header(MpegEncContext *s); + +#endif /* AVCODEC_RV10ENC_H */ diff --git a/include/libavcodec/rv30data.h b/include/libavcodec/rv30data.h new file mode 100644 index 0000000..5c4cb97 --- /dev/null +++ b/include/libavcodec/rv30data.h @@ -0,0 +1,181 @@ +/* + * RealVideo 3 decoder + * copyright (c) 2007 Konstantin Shishkov + * + * 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 + */ + +/** + * @file + * miscellaneous RV30 tables + */ + +#ifndef AVCODEC_RV30DATA_H +#define AVCODEC_RV30DATA_H + +#include + +/** DC quantizer mapping for RV30 */ +static const uint8_t rv30_luma_dc_quant[32] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 22, 22, 23, 23, 23, 24, 24, 25, 25 +}; + +/** + * This table is used for storing the differences + * between the predicted and the real intra type. + */ +static const uint8_t rv30_itype_code[9*9*2] = { + 0, 0, 0, 1, 1, 0, 1, 1, 0, 2, 2, 0, 0, 3, 3, 0, 1, 2, + 2, 1, 0, 4, 4, 0, 3, 1, 1, 3, 0, 5, 5, 0, 2, 2, 1, 4, + 4, 1, 0, 6, 3, 2, 1, 5, 2, 3, 5, 1, 6, 0, 0, 7, 4, 2, + 2, 4, 3, 3, 6, 1, 1, 6, 7, 0, 0, 8, 5, 2, 4, 3, 2, 5, + 3, 4, 1, 7, 4, 4, 7, 1, 8, 0, 6, 2, 3, 5, 5, 3, 2, 6, + 1, 8, 2, 7, 7, 2, 8, 1, 5, 4, 4, 5, 3, 6, 6, 3, 8, 2, + 4, 6, 5, 5, 6, 4, 2, 8, 7, 3, 3, 7, 6, 5, 5, 6, 7, 4, + 4, 7, 8, 3, 3, 8, 7, 5, 8, 4, 5, 7, 4, 8, 6, 6, 7, 6, + 5, 8, 8, 5, 6, 7, 8, 6, 7, 7, 6, 8, 8, 7, 7, 8, 8, 8, +}; + +/** + * This table is used for retrieving the current intra type + * based on its neighbors and adjustment provided by + * code read and decoded before. + * + * This is really a three-dimensional matrix with dimensions + * [-1..9][-1..9][0..9]. The first and second coordinates are + * determined by the top and left neighbors (-1 if unavailable). + */ +static const uint8_t rv30_itype_from_context[900] = { + 0, 9, 9, 9, 9, 9, 9, 9, 9, + 0, 2, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, + 2, 0, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, 9, + + 0, 1, 9, 9, 9, 9, 9, 9, 9, + 0, 2, 1, 6, 4, 8, 5, 7, 3, + 1, 0, 2, 6, 5, 4, 3, 8, 7, + 2, 8, 0, 1, 7, 4, 3, 6, 5, + 2, 0, 1, 3, 8, 5, 4, 7, 6, + 2, 0, 1, 4, 6, 7, 8, 3, 5, + 0, 1, 5, 2, 6, 3, 8, 4, 7, + 0, 1, 6, 2, 4, 7, 5, 8, 3, + 2, 7, 0, 1, 4, 8, 6, 3, 5, + 2, 8, 0, 1, 7, 3, 4, 5, 6, + + 1, 0, 9, 9, 9, 9, 9, 9, 9, + 1, 2, 5, 6, 3, 0, 4, 8, 7, + 1, 6, 2, 5, 3, 0, 4, 8, 7, + 2, 1, 7, 6, 8, 3, 5, 0, 4, + 1, 2, 5, 3, 6, 8, 4, 7, 0, + 1, 6, 2, 0, 4, 5, 8, 7, 3, + 1, 5, 2, 6, 3, 8, 4, 0, 7, + 1, 6, 0, 2, 4, 5, 7, 3, 8, + 2, 1, 7, 6, 0, 8, 5, 4, 3, + 1, 2, 7, 8, 3, 4, 5, 6, 0, + + 9, 9, 9, 9, 9, 9, 9, 9, 9, + 0, 2, 1, 8, 7, 6, 5, 4, 3, + 1, 2, 0, 6, 5, 7, 4, 8, 3, + 2, 8, 7, 1, 0, 6, 4, 3, 5, + 2, 0, 8, 1, 3, 7, 5, 4, 6, + 2, 0, 4, 1, 7, 8, 6, 3, 5, + 2, 0, 1, 5, 8, 4, 6, 7, 3, + 2, 0, 6, 1, 4, 7, 8, 5, 3, + 2, 7, 8, 1, 0, 5, 4, 6, 3, + 2, 8, 7, 1, 0, 4, 3, 6, 5, + + 9, 9, 9, 9, 9, 9, 9, 9, 9, + 0, 2, 1, 3, 5, 8, 6, 4, 7, + 1, 0, 2, 5, 3, 6, 4, 8, 7, + 2, 8, 1, 0, 3, 5, 7, 6, 4, + 3, 2, 5, 8, 1, 4, 6, 7, 0, + 4, 2, 0, 6, 1, 5, 8, 3, 7, + 5, 3, 1, 2, 8, 6, 4, 0, 7, + 1, 6, 0, 2, 4, 5, 8, 3, 7, + 2, 7, 0, 1, 5, 4, 8, 6, 3, + 2, 8, 3, 5, 1, 0, 7, 6, 4, + + 9, 9, 9, 9, 9, 9, 9, 9, 9, + 2, 0, 6, 1, 4, 7, 5, 8, 3, + 1, 6, 2, 0, 4, 5, 3, 7, 8, + 2, 8, 7, 6, 4, 0, 1, 5, 3, + 4, 2, 1, 0, 6, 8, 3, 5, 7, + 4, 2, 6, 0, 1, 5, 7, 8, 3, + 1, 2, 5, 0, 6, 3, 4, 7, 8, + 6, 4, 0, 1, 2, 7, 5, 3, 8, + 2, 7, 4, 6, 0, 1, 8, 5, 3, + 2, 8, 7, 4, 6, 1, 3, 5, 0, + + 9, 9, 9, 9, 9, 9, 9, 9, 9, + 5, 1, 2, 3, 6, 8, 0, 4, 7, + 1, 5, 6, 3, 2, 0, 4, 8, 7, + 2, 1, 5, 3, 6, 8, 7, 4, 0, + 5, 3, 1, 2, 6, 8, 4, 7, 0, + 1, 6, 2, 4, 5, 8, 0, 3, 7, + 5, 1, 3, 6, 2, 0, 8, 4, 7, + 1, 6, 5, 2, 0, 4, 3, 7, 8, + 2, 7, 1, 6, 5, 0, 8, 3, 4, + 2, 5, 1, 3, 6, 8, 4, 0, 7, + + 9, 9, 9, 9, 9, 9, 9, 9, 9, + 1, 6, 2, 0, 5, 4, 3, 7, 8, + 1, 6, 5, 4, 2, 3, 0, 7, 8, + 2, 1, 6, 7, 4, 8, 5, 3, 0, + 2, 1, 6, 5, 8, 4, 3, 0, 7, + 6, 4, 1, 2, 0, 5, 7, 8, 3, + 1, 6, 5, 2, 3, 0, 4, 8, 7, + 6, 1, 4, 0, 2, 7, 5, 3, 8, + 2, 7, 4, 6, 1, 5, 0, 8, 3, + 2, 1, 6, 8, 4, 7, 3, 5, 0, + + 9, 9, 9, 9, 9, 9, 9, 9, 9, + 2, 0, 4, 7, 6, 1, 8, 5, 3, + 6, 1, 2, 0, 4, 7, 5, 8, 3, + 2, 7, 8, 0, 1, 6, 4, 3, 5, + 2, 4, 0, 8, 3, 1, 7, 6, 5, + 4, 2, 7, 0, 6, 1, 8, 5, 3, + 2, 1, 0, 8, 5, 6, 7, 4, 3, + 2, 6, 4, 1, 7, 0, 5, 8, 3, + 2, 7, 4, 0, 8, 6, 1, 5, 3, + 2, 8, 7, 4, 1, 0, 3, 6, 5, + + 9, 9, 9, 9, 9, 9, 9, 9, 9, + 2, 0, 8, 1, 3, 4, 6, 5, 7, + 1, 2, 0, 6, 8, 5, 7, 3, 4, + 2, 8, 7, 1, 0, 3, 6, 5, 4, + 8, 3, 2, 5, 1, 0, 4, 7, 6, + 2, 0, 4, 8, 5, 1, 7, 6, 3, + 2, 1, 0, 8, 5, 3, 6, 4, 7, + 2, 1, 6, 0, 8, 4, 5, 7, 3, + 2, 7, 8, 4, 0, 6, 1, 5, 3, + 2, 8, 3, 0, 7, 4, 1, 6, 5, +}; + +/** + * Loop filter limits are taken from this table. + */ +static const uint8_t rv30_loop_filt_lim[32] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5 +}; +#endif /* AVCODEC_RV30DATA_H */ diff --git a/include/libavcodec/rv34.h b/include/libavcodec/rv34.h new file mode 100644 index 0000000..6fe1f80 --- /dev/null +++ b/include/libavcodec/rv34.h @@ -0,0 +1,144 @@ +/* + * RV30/40 decoder common data declarations + * Copyright (c) 2007 Mike Melanson, Konstantin Shishkov + * + * 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 + */ + +/** + * @file + * RV30 and RV40 decoder common data declarations + */ + +#ifndef AVCODEC_RV34_H +#define AVCODEC_RV34_H + +#include "libavutil/mem_internal.h" + +#include "avcodec.h" +#include "mpegvideo.h" + +#include "h264pred.h" +#include "rv34dsp.h" + +#define MB_TYPE_SEPARATE_DC 0x01000000 +#define IS_SEPARATE_DC(a) ((a) & MB_TYPE_SEPARATE_DC) + +/** + * RV30 and RV40 Macroblock types + */ +enum RV40BlockTypes{ + RV34_MB_TYPE_INTRA, ///< Intra macroblock + RV34_MB_TYPE_INTRA16x16, ///< Intra macroblock with DCs in a separate 4x4 block + RV34_MB_P_16x16, ///< P-frame macroblock, one motion frame + RV34_MB_P_8x8, ///< P-frame macroblock, 8x8 motion compensation partitions + RV34_MB_B_FORWARD, ///< B-frame macroblock, forward prediction + RV34_MB_B_BACKWARD, ///< B-frame macroblock, backward prediction + RV34_MB_SKIP, ///< Skipped block + RV34_MB_B_DIRECT, ///< Bidirectionally predicted B-frame macroblock, no motion vectors + RV34_MB_P_16x8, ///< P-frame macroblock, 16x8 motion compensation partitions + RV34_MB_P_8x16, ///< P-frame macroblock, 8x16 motion compensation partitions + RV34_MB_B_BIDIR, ///< Bidirectionally predicted B-frame macroblock, two motion vectors + RV34_MB_P_MIX16x16, ///< P-frame macroblock with DCs in a separate 4x4 block, one motion vector + RV34_MB_TYPES +}; + +/** + * VLC tables used by the decoder + * + * Intra frame VLC sets do not contain some of those tables. + */ +typedef struct RV34VLC{ + const VLCElem *cbppattern[2]; ///< VLCs used for pattern of coded block patterns decoding + VLC cbp[2][4]; ///< VLCs used for coded block patterns decoding + const VLCElem *first_pattern[4]; ///< VLCs used for decoding coefficients in the first subblock + const VLCElem *second_pattern[2]; ///< VLCs used for decoding coefficients in the subblocks 2 and 3 + const VLCElem *third_pattern[2]; ///< VLCs used for decoding coefficients in the last subblock + const VLCElem *coefficient; ///< VLCs used for decoding big coefficients +}RV34VLC; + +/** essential slice information */ +typedef struct SliceInfo{ + int type; ///< slice type (intra, inter) + int quant; ///< quantizer used for this slice + int vlc_set; ///< VLCs used for this slice + int start, end; ///< start and end macroblocks of the slice + int width; ///< coded width + int height; ///< coded height + int pts; ///< frame timestamp +}SliceInfo; + +/** decoder context */ +typedef struct RV34DecContext{ + MpegEncContext s; + RV34DSPContext rdsp; + int8_t *intra_types_hist;///< old block types, used for prediction + int8_t *intra_types; ///< block types + int intra_types_stride;///< block types array stride + const uint8_t *luma_dc_quant_i;///< luma subblock DC quantizer for intraframes + const uint8_t *luma_dc_quant_p;///< luma subblock DC quantizer for interframes + + const RV34VLC *cur_vlcs; ///< VLC set used for current frame decoding + H264PredContext h; ///< functions for 4x4 and 16x16 intra block prediction + SliceInfo si; ///< current slice information + + int *mb_type; ///< internal macroblock types + int block_type; ///< current block type + int luma_vlc; ///< which VLC set will be used for decoding of luma blocks + int chroma_vlc; ///< which VLC set will be used for decoding of chroma blocks + int is16; ///< current block has additional 16x16 specific features or not + int dmv[4][2]; ///< differential motion vectors for the current macroblock + + int rv30; ///< indicates which RV variant is currently decoded + int max_rpr; + + int cur_pts, last_pts, next_pts; + int scaled_weight; + int weight1, weight2; ///< B-frame distance fractions (0.14) used in motion compensation + int mv_weight1, mv_weight2; + + int orig_width, orig_height; + + uint16_t *cbp_luma; ///< CBP values for luma subblocks + uint8_t *cbp_chroma; ///< CBP values for chroma subblocks + uint16_t *deblock_coefs; ///< deblock coefficients for each macroblock + + /** 8x8 block available flags (for MV prediction) */ + DECLARE_ALIGNED(8, uint32_t, avail_cache)[3*4]; + + /** temporary blocks for RV4 weighted MC */ + uint8_t *tmp_b_block_y[2]; + uint8_t *tmp_b_block_uv[4]; + uint8_t *tmp_b_block_base; + + int (*parse_slice_header)(struct RV34DecContext *r, GetBitContext *gb, SliceInfo *si); + int (*decode_mb_info)(struct RV34DecContext *r); + int (*decode_intra_types)(struct RV34DecContext *r, GetBitContext *gb, int8_t *dst); + void (*loop_filter)(struct RV34DecContext *r, int row); +}RV34DecContext; + +/** + * common decoding functions + */ +int ff_rv34_get_start_offset(GetBitContext *gb, int blocks); +int ff_rv34_decode_init(AVCodecContext *avctx); +int ff_rv34_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt); +int ff_rv34_decode_end(AVCodecContext *avctx); +int ff_rv34_decode_update_thread_context(AVCodecContext *dst, const AVCodecContext *src); + +#endif /* AVCODEC_RV34_H */ diff --git a/include/libavcodec/rv34data.h b/include/libavcodec/rv34data.h new file mode 100644 index 0000000..4509e1f --- /dev/null +++ b/include/libavcodec/rv34data.h @@ -0,0 +1,113 @@ +/* + * RealVideo 4 decoder + * copyright (c) 2007 Konstantin Shishkov + * + * 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 + */ + +/** + * @file + * miscellaneous RV30/40 tables + */ + +#ifndef AVCODEC_RV34DATA_H +#define AVCODEC_RV34DATA_H + +#include + +/** + * number of ones in nibble minus one + */ +static const uint8_t rv34_count_ones[16] = { + 0, 0, 0, 1, 0, 1, 1, 2, 0, 1, 1, 2, 1, 2, 2, 3 +}; + +/** + * values used to reconstruct coded block pattern + */ +static const uint8_t rv34_cbp_code[16] = { + 0x00, 0x20, 0x10, 0x30, 0x02, 0x22, 0x12, 0x32, + 0x01, 0x21, 0x11, 0x31, 0x03, 0x23, 0x13, 0x33 +}; + +/** + * precalculated results of division by three and modulo three for values 0-107 + * + * A lot of four-tuples in RV40 are represented as c0*27+c1*9+c2*3+c3. + * This table allows conversion from a value back to a vector. + */ +static const uint8_t modulo_three_table[108] = { + 0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x08, 0x09, 0x0A, + 0x10, 0x11, 0x12, 0x14, 0x15, 0x16, 0x18, 0x19, 0x1A, + 0x20, 0x21, 0x22, 0x24, 0x25, 0x26, 0x28, 0x29, 0x2A, + + 0x40, 0x41, 0x42, 0x44, 0x45, 0x46, 0x48, 0x49, 0x4A, + 0x50, 0x51, 0x52, 0x54, 0x55, 0x56, 0x58, 0x59, 0x5A, + 0x60, 0x61, 0x62, 0x64, 0x65, 0x66, 0x68, 0x69, 0x6A, + + 0x80, 0x81, 0x82, 0x84, 0x85, 0x86, 0x88, 0x89, 0x8A, + 0x90, 0x91, 0x92, 0x94, 0x95, 0x96, 0x98, 0x99, 0x9A, + 0xA0, 0xA1, 0xA2, 0xA4, 0xA5, 0xA6, 0xA8, 0xA9, 0xAA, + + 0xC0, 0xC1, 0xC2, 0xC4, 0xC5, 0xC6, 0xC8, 0xC9, 0xCA, + 0xD0, 0xD1, 0xD2, 0xD4, 0xD5, 0xD6, 0xD8, 0xD9, 0xDA, + 0xE0, 0xE1, 0xE2, 0xE4, 0xE5, 0xE6, 0xE8, 0xE9, 0xEA, +}; + +/** + * quantizer values used for AC and DC coefficients in chroma blocks + */ +static const uint8_t rv34_chroma_quant[2][32] = { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 17, 18, 19, 20, 20, 21, 22, 22, 23, 23, 24, 24, 25, 25 }, + { 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 15, 16, 17, 18, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23 } +}; + +/** + * This table is used for dequantizing. + */ +static const uint16_t rv34_qscale_tab[32] = { + 60, 67, 76, 85, 96, 108, 121, 136, + 152, 171, 192, 216, 242, 272, 305, 341, + 383, 432, 481, 544, 606, 683, 767, 854, + 963, 1074, 1212, 1392, 1566, 1708, 1978, 2211 +}; + +/** + * tables used to translate a quantizer value into a VLC set for decoding + * The first table is used for intraframes. The two last entries are invalid. + */ +static const uint8_t rv34_quant_to_vlc_set[2][32] = { + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, + 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6 }, +}; + +/** + * maximum number of macroblocks for each of the possible slice offset sizes + * @todo This is the same as ff_mba_max, maybe use it instead. + */ +static const uint16_t rv34_mb_max_sizes[6] = { 0x2F, 0x62, 0x18B, 0x62F, 0x18BF, 0x23FF }; +/** + * bits needed to code the slice offset for the given size + * @todo This is the same as ff_mba_length, maybe use it instead. + */ +static const uint8_t rv34_mb_bits_sizes[6] = { 6, 7, 9, 11, 13, 14 }; + +#endif /* AVCODEC_RV34DATA_H */ diff --git a/include/libavcodec/rv34dsp.h b/include/libavcodec/rv34dsp.h new file mode 100644 index 0000000..d59b3c2 --- /dev/null +++ b/include/libavcodec/rv34dsp.h @@ -0,0 +1,90 @@ +/* + * RV30/40 decoder motion compensation functions + * Copyright (c) 2008 Konstantin Shishkov + * + * 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 + */ + +/** + * @file + * RV30/40 decoder motion compensation functions + */ + +#ifndef AVCODEC_RV34DSP_H +#define AVCODEC_RV34DSP_H + +#include "h264chroma.h" +#include "qpeldsp.h" + +typedef void (*rv40_weight_func)(uint8_t *dst/*align width (8 or 16)*/, + uint8_t *src1/*align width (8 or 16)*/, + uint8_t *src2/*align width (8 or 16)*/, + int w1, int w2, ptrdiff_t stride); + +typedef void (*rv34_inv_transform_func)(int16_t *block); + +typedef void (*rv34_idct_add_func)(uint8_t *dst, ptrdiff_t stride, int16_t *block); +typedef void (*rv34_idct_dc_add_func)(uint8_t *dst, ptrdiff_t stride, + int dc); + +typedef void (*rv40_weak_loop_filter_func)(uint8_t *src, ptrdiff_t stride, + int filter_p1, int filter_q1, + int alpha, int beta, + int lims, int lim_q1, int lim_p1); + +typedef void (*rv40_strong_loop_filter_func)(uint8_t *src, ptrdiff_t stride, + int alpha, int lims, + int dmode, int chroma); + +typedef int (*rv40_loop_filter_strength_func)(uint8_t *src, ptrdiff_t stride, + int beta, int beta2, int edge, + int *p1, int *q1); + +typedef struct RV34DSPContext { + qpel_mc_func put_pixels_tab[4][16]; + qpel_mc_func avg_pixels_tab[4][16]; + h264_chroma_mc_func put_chroma_pixels_tab[3]; + h264_chroma_mc_func avg_chroma_pixels_tab[3]; + /** + * Biweight functions, first dimension is transform size (16/8), + * second is whether the weight is prescaled by 1/512 to skip + * the intermediate shifting. + */ + rv40_weight_func rv40_weight_pixels_tab[2][2]; + rv34_inv_transform_func rv34_inv_transform; + rv34_inv_transform_func rv34_inv_transform_dc; + rv34_idct_add_func rv34_idct_add; + rv34_idct_dc_add_func rv34_idct_dc_add; + rv40_weak_loop_filter_func rv40_weak_loop_filter[2]; + rv40_strong_loop_filter_func rv40_strong_loop_filter[2]; + rv40_loop_filter_strength_func rv40_loop_filter_strength[2]; +} RV34DSPContext; + +void ff_rv30dsp_init(RV34DSPContext *c); +void ff_rv34dsp_init(RV34DSPContext *c); +void ff_rv40dsp_init(RV34DSPContext *c); + +void ff_rv34dsp_init_arm(RV34DSPContext *c); +void ff_rv34dsp_init_riscv(RV34DSPContext *c); +void ff_rv34dsp_init_x86(RV34DSPContext *c); + +void ff_rv40dsp_init_aarch64(RV34DSPContext *c); +void ff_rv40dsp_init_riscv(RV34DSPContext *c); +void ff_rv40dsp_init_x86(RV34DSPContext *c); +void ff_rv40dsp_init_arm(RV34DSPContext *c); + +#endif /* AVCODEC_RV34DSP_H */ diff --git a/include/libavcodec/rv34vlc.h b/include/libavcodec/rv34vlc.h new file mode 100644 index 0000000..aa29357 --- /dev/null +++ b/include/libavcodec/rv34vlc.h @@ -0,0 +1,4055 @@ +/* + * RealVideo 3/4 decoder + * Copyright (c) 2007 Konstantin Shishkov + * + * 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 + */ + +/** + * @file + * RV30/40 VLC tables + */ + +#ifndef AVCODEC_RV34VLC_H +#define AVCODEC_RV34VLC_H + +#include + +#define NUM_INTRA_TABLES 5 +#define NUM_INTER_TABLES 7 + +#define CBPPAT_VLC_SIZE 1296 +#define CBP_VLC_SIZE 16 +#define FIRSTBLK_VLC_SIZE 864 +#define OTHERBLK_VLC_SIZE 108 +#define COEFF_VLC_SIZE 32 +#define MAX_VLC_SIZE 1296 + +static const uint8_t rv34_table_intra_cbppat[NUM_INTRA_TABLES][2][CBPPAT_VLC_SIZE] = { + { + { + 8, 10, 10, 10, 10, 10, 11, 10, 10, 11, 10, 10, 10, 10, 10, 6, + 12, 12, 13, 12, 13, 12, 13, 11, 13, 13, 13, 12, 13, 12, 12, 8, + 14, 13, 16, 13, 15, 13, 16, 12, 16, 16, 16, 14, 16, 13, 14, 10, + 12, 13, 12, 12, 13, 13, 13, 12, 13, 13, 12, 12, 13, 12, 12, 8, + 13, 14, 14, 12, 14, 14, 14, 12, 14, 15, 14, 12, 14, 13, 13, 8, + 16, 16, 16, 12, 16, 16, 16, 13, 16, 16, 16, 13, 16, 14, 14, 9, + 14, 16, 13, 13, 16, 16, 16, 14, 15, 16, 14, 13, 15, 15, 14, 10, + 16, 16, 14, 13, 16, 16, 16, 13, 16, 16, 16, 13, 16, 15, 14, 10, + 16, 16, 16, 11, 16, 16, 16, 12, 16, 16, 16, 12, 16, 16, 15, 9, + 12, 13, 13, 13, 12, 12, 14, 12, 12, 14, 13, 12, 12, 12, 12, 8, + 14, 14, 16, 14, 13, 12, 14, 12, 14, 15, 14, 13, 13, 12, 13, 8, + 16, 16, 16, 15, 16, 13, 16, 13, 16, 16, 16, 15, 16, 13, 15, 10, + 14, 16, 14, 14, 14, 14, 15, 13, 14, 16, 14, 13, 13, 13, 13, 9, + 16, 16, 16, 14, 16, 14, 16, 12, 16, 16, 14, 13, 14, 13, 13, 8, + 16, 16, 16, 14, 16, 14, 16, 13, 16, 16, 16, 14, 16, 14, 14, 9, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 14, 10, + 16, 16, 16, 14, 16, 16, 16, 13, 16, 16, 16, 14, 16, 15, 14, 9, + 16, 16, 16, 13, 16, 16, 16, 12, 16, 16, 16, 13, 16, 15, 15, 8, + 14, 16, 16, 16, 14, 14, 16, 14, 16, 16, 16, 15, 13, 13, 14, 10, + 16, 16, 16, 16, 15, 13, 16, 13, 16, 16, 16, 16, 16, 13, 14, 10, + 16, 16, 16, 16, 16, 11, 16, 12, 16, 16, 16, 16, 16, 12, 16, 9, + 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 14, 14, 10, + 16, 16, 16, 16, 16, 15, 16, 13, 16, 16, 16, 15, 16, 13, 14, 9, + 16, 16, 16, 16, 16, 13, 16, 12, 16, 16, 16, 16, 16, 13, 14, 8, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 11, + 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 14, 9, + 16, 16, 16, 14, 16, 15, 16, 11, 16, 16, 16, 14, 16, 14, 14, 8, + 12, 13, 13, 13, 13, 13, 14, 12, 12, 13, 12, 12, 12, 12, 12, 8, + 14, 14, 16, 14, 15, 14, 16, 13, 14, 15, 14, 13, 14, 13, 13, 9, + 16, 16, 16, 15, 16, 16, 16, 14, 16, 16, 16, 14, 16, 14, 16, 10, + 14, 15, 14, 14, 15, 14, 15, 13, 14, 14, 13, 12, 13, 13, 13, 9, + 15, 16, 15, 14, 16, 16, 16, 13, 15, 16, 14, 12, 14, 13, 13, 8, + 16, 16, 16, 14, 16, 16, 16, 13, 16, 16, 16, 13, 16, 14, 14, 9, + 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 13, 13, 16, 16, 14, 10, + 16, 16, 16, 14, 16, 16, 16, 14, 16, 16, 15, 13, 16, 14, 14, 9, + 16, 16, 16, 12, 16, 16, 16, 13, 16, 16, 16, 12, 16, 16, 15, 8, + 13, 14, 14, 14, 14, 14, 16, 13, 13, 14, 14, 13, 12, 12, 12, 8, + 16, 16, 16, 14, 15, 14, 16, 13, 15, 16, 14, 13, 13, 12, 13, 8, + 16, 16, 16, 16, 16, 14, 16, 14, 16, 16, 16, 14, 16, 13, 14, 9, + 15, 16, 16, 15, 16, 15, 16, 13, 14, 16, 14, 13, 13, 13, 12, 8, + 16, 16, 16, 14, 16, 14, 15, 12, 15, 15, 14, 12, 13, 12, 12, 7, + 16, 16, 16, 14, 16, 14, 16, 12, 16, 16, 16, 13, 16, 13, 13, 7, + 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 14, 14, 16, 14, 13, 9, + 16, 16, 16, 14, 16, 16, 16, 13, 16, 16, 14, 12, 16, 13, 12, 7, + 16, 16, 16, 12, 16, 16, 16, 11, 16, 16, 15, 12, 16, 13, 13, 6, + 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 15, 13, 13, 14, 10, + 16, 16, 16, 16, 16, 14, 16, 14, 16, 16, 16, 16, 14, 13, 14, 9, + 16, 16, 16, 16, 16, 13, 16, 13, 16, 16, 16, 16, 16, 12, 14, 8, + 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 14, 14, 13, 13, 9, + 16, 16, 16, 16, 16, 14, 16, 13, 16, 16, 16, 13, 14, 12, 12, 7, + 16, 16, 16, 16, 16, 13, 16, 12, 16, 16, 16, 13, 14, 12, 13, 6, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 14, 9, + 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 13, 15, 13, 12, 7, + 16, 16, 16, 13, 16, 14, 16, 11, 16, 16, 16, 12, 16, 12, 12, 5, + 14, 16, 15, 16, 16, 16, 16, 15, 14, 15, 14, 14, 13, 14, 13, 10, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 14, 16, 10, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 11, + 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 14, 14, 15, 14, 13, 10, + 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 14, 13, 16, 14, 14, 9, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 15, 9, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 12, 13, 16, 16, 13, 10, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, 13, 16, 16, 13, 9, + 16, 16, 16, 14, 16, 16, 16, 14, 16, 16, 15, 12, 16, 16, 14, 8, + 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 15, 14, 13, 13, 13, 9, + 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 14, 14, 13, 13, 9, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 15, 9, + 16, 16, 16, 16, 16, 16, 16, 15, 15, 16, 14, 14, 14, 13, 13, 9, + 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 14, 12, 13, 12, 12, 7, + 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 13, 16, 13, 13, 7, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, 13, 16, 14, 13, 9, + 16, 16, 16, 15, 16, 16, 16, 13, 16, 16, 13, 12, 14, 13, 12, 6, + 16, 16, 16, 13, 16, 16, 16, 12, 16, 16, 14, 10, 15, 12, 12, 5, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 12, 13, 13, 9, + 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 15, 13, 12, 13, 8, + 16, 16, 16, 16, 16, 14, 16, 14, 16, 16, 16, 16, 15, 12, 14, 8, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 13, 13, 13, 8, + 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 15, 13, 12, 11, 12, 6, + 16, 16, 16, 15, 16, 14, 16, 12, 16, 16, 16, 12, 13, 10, 12, 5, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 14, 13, 14, 12, 8, + 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 13, 12, 13, 12, 10, 5, + 16, 16, 16, 13, 16, 13, 16, 10, 16, 16, 13, 10, 13, 10, 10, 1, + }, + { + 2, 7, 7, 8, 7, 8, 9, 8, 7, 9, 8, 8, 8, 8, 9, 7, + 6, 9, 10, 10, 10, 10, 11, 10, 10, 11, 11, 11, 10, 11, 11, 9, + 9, 11, 12, 12, 12, 13, 14, 13, 13, 14, 14, 13, 13, 13, 14, 11, + 6, 10, 9, 10, 10, 11, 11, 11, 10, 11, 10, 11, 11, 11, 11, 9, + 6, 9, 10, 10, 10, 11, 12, 11, 10, 12, 11, 11, 11, 11, 11, 8, + 9, 11, 12, 12, 12, 13, 13, 13, 12, 14, 14, 13, 13, 13, 13, 10, + 9, 13, 11, 13, 13, 14, 14, 13, 13, 14, 13, 13, 14, 14, 14, 12, + 9, 12, 12, 12, 12, 14, 14, 13, 13, 14, 13, 13, 13, 14, 13, 11, + 8, 12, 12, 11, 12, 14, 14, 12, 13, 14, 14, 13, 13, 13, 14, 11, + 6, 10, 10, 11, 9, 10, 12, 11, 10, 12, 11, 11, 10, 11, 11, 9, + 7, 10, 10, 11, 10, 11, 12, 11, 11, 12, 11, 11, 11, 11, 11, 9, + 9, 12, 13, 13, 12, 12, 14, 13, 13, 14, 14, 13, 14, 13, 14, 11, + 8, 11, 11, 12, 11, 12, 12, 12, 11, 13, 12, 12, 12, 12, 12, 10, + 7, 10, 10, 11, 10, 11, 12, 11, 10, 12, 11, 11, 11, 11, 11, 8, + 9, 11, 12, 12, 12, 12, 13, 12, 12, 13, 13, 12, 13, 12, 13, 10, + 10, 13, 13, 14, 14, 14, 15, 14, 14, 15, 14, 15, 14, 14, 14, 12, + 9, 12, 12, 13, 12, 13, 14, 13, 12, 13, 13, 12, 13, 13, 13, 10, + 9, 12, 12, 12, 12, 13, 14, 12, 12, 14, 13, 12, 13, 13, 13, 10, + 9, 12, 13, 13, 11, 13, 14, 13, 13, 14, 14, 14, 12, 13, 13, 11, + 10, 12, 13, 13, 12, 12, 14, 13, 13, 14, 14, 14, 13, 13, 14, 11, + 10, 13, 14, 14, 13, 12, 15, 13, 14, 14, 14, 14, 15, 13, 14, 11, + 11, 14, 14, 14, 13, 14, 15, 14, 14, 15, 15, 14, 13, 14, 14, 12, + 10, 13, 12, 13, 12, 12, 14, 13, 13, 14, 13, 13, 13, 13, 13, 10, + 10, 12, 13, 13, 13, 12, 14, 12, 13, 14, 14, 13, 13, 13, 13, 10, + 13, 15, 16, 16, 15, 15, 16, 16, 15, 16, 15, 16, 16, 16, 16, 14, + 11, 14, 14, 14, 14, 14, 15, 14, 14, 15, 15, 14, 14, 14, 15, 11, + 10, 13, 13, 13, 13, 13, 14, 12, 13, 14, 14, 13, 13, 13, 13, 10, + 6, 10, 10, 11, 10, 11, 12, 11, 10, 12, 10, 11, 10, 11, 11, 9, + 8, 11, 11, 12, 11, 12, 13, 12, 11, 12, 12, 12, 12, 12, 12, 10, + 11, 13, 14, 14, 13, 14, 15, 14, 13, 15, 15, 14, 14, 14, 15, 12, + 7, 11, 10, 12, 11, 12, 12, 12, 11, 12, 11, 12, 11, 12, 12, 10, + 7, 10, 10, 11, 10, 11, 12, 11, 11, 12, 11, 11, 11, 11, 11, 9, + 10, 12, 13, 13, 12, 13, 14, 13, 13, 14, 13, 13, 13, 13, 13, 10, + 10, 13, 12, 14, 13, 14, 14, 14, 13, 14, 12, 14, 15, 14, 14, 11, + 10, 12, 12, 12, 12, 13, 14, 13, 13, 14, 13, 12, 13, 13, 13, 10, + 9, 12, 13, 13, 13, 14, 14, 13, 13, 14, 14, 13, 13, 13, 13, 10, + 7, 10, 10, 11, 10, 11, 12, 11, 10, 12, 12, 11, 9, 11, 11, 9, + 7, 10, 11, 11, 10, 11, 12, 11, 10, 12, 12, 11, 11, 11, 11, 9, + 10, 12, 13, 13, 13, 13, 15, 13, 13, 14, 13, 13, 13, 13, 13, 10, + 8, 11, 11, 11, 11, 11, 12, 11, 11, 12, 12, 11, 11, 12, 11, 9, + 6, 9, 9, 10, 9, 10, 10, 10, 9, 11, 10, 10, 9, 10, 10, 7, + 8, 10, 11, 11, 11, 11, 12, 11, 11, 12, 12, 11, 11, 11, 11, 8, + 10, 13, 13, 13, 13, 14, 14, 13, 13, 14, 13, 13, 13, 13, 13, 11, + 8, 11, 11, 11, 11, 12, 12, 11, 11, 12, 11, 11, 11, 11, 11, 8, + 8, 11, 11, 11, 11, 12, 12, 10, 11, 12, 12, 11, 11, 11, 11, 8, + 10, 13, 13, 13, 12, 13, 14, 13, 12, 14, 14, 14, 10, 13, 13, 11, + 10, 12, 12, 13, 12, 13, 14, 12, 12, 13, 13, 13, 12, 12, 13, 10, + 11, 13, 14, 14, 13, 13, 14, 13, 13, 15, 14, 13, 13, 13, 13, 10, + 10, 12, 13, 13, 12, 13, 14, 13, 13, 14, 14, 13, 12, 13, 13, 11, + 8, 11, 11, 11, 11, 11, 12, 11, 11, 12, 12, 11, 11, 11, 11, 8, + 9, 11, 12, 12, 11, 11, 12, 11, 12, 12, 12, 11, 12, 11, 11, 8, + 12, 15, 14, 14, 14, 15, 15, 14, 14, 15, 15, 14, 14, 14, 15, 12, + 10, 12, 12, 12, 12, 12, 13, 12, 12, 13, 13, 12, 12, 12, 12, 9, + 9, 11, 11, 11, 11, 11, 12, 10, 11, 12, 12, 11, 11, 11, 11, 7, + 10, 13, 13, 13, 13, 14, 15, 14, 13, 14, 14, 14, 12, 14, 15, 12, + 11, 14, 14, 14, 14, 15, 15, 14, 14, 15, 15, 15, 14, 15, 15, 12, + 13, 16, 16, 16, 15, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 14, + 10, 13, 13, 14, 13, 15, 14, 14, 13, 15, 13, 14, 14, 14, 14, 12, + 10, 13, 13, 13, 13, 13, 14, 13, 13, 14, 13, 13, 13, 13, 14, 11, + 12, 14, 14, 14, 14, 15, 15, 14, 14, 15, 15, 14, 15, 14, 14, 12, + 11, 14, 14, 15, 14, 15, 15, 14, 14, 15, 12, 14, 15, 16, 15, 12, + 11, 13, 13, 14, 13, 14, 14, 14, 14, 14, 13, 13, 14, 14, 14, 11, + 11, 14, 14, 14, 14, 15, 15, 14, 14, 16, 14, 13, 14, 14, 14, 11, + 10, 13, 13, 13, 12, 14, 14, 14, 12, 15, 14, 14, 11, 13, 13, 12, + 10, 12, 13, 14, 12, 13, 14, 13, 13, 14, 14, 13, 12, 13, 13, 11, + 12, 14, 14, 15, 14, 15, 16, 15, 15, 15, 15, 15, 14, 14, 15, 12, + 10, 13, 13, 13, 12, 13, 14, 13, 13, 14, 13, 13, 12, 13, 13, 11, + 9, 11, 11, 12, 11, 12, 12, 11, 11, 12, 12, 11, 11, 11, 11, 9, + 10, 12, 12, 12, 12, 12, 13, 12, 12, 13, 13, 12, 13, 12, 12, 9, + 11, 13, 13, 15, 14, 14, 15, 14, 14, 15, 14, 14, 14, 14, 14, 11, + 10, 12, 12, 12, 12, 12, 13, 12, 12, 13, 11, 11, 12, 12, 12, 8, + 9, 12, 12, 11, 12, 12, 13, 11, 12, 12, 12, 11, 12, 11, 11, 8, + 10, 13, 13, 14, 12, 14, 15, 14, 13, 15, 15, 14, 10, 13, 13, 11, + 11, 13, 14, 13, 13, 14, 14, 13, 13, 14, 14, 14, 11, 13, 13, 11, + 12, 14, 14, 14, 14, 14, 15, 14, 15, 16, 15, 14, 13, 13, 14, 11, + 11, 14, 13, 14, 13, 14, 15, 14, 13, 15, 14, 14, 11, 13, 13, 11, + 9, 12, 12, 12, 11, 12, 13, 11, 12, 13, 12, 11, 10, 11, 11, 8, + 10, 12, 12, 12, 12, 12, 13, 11, 12, 12, 12, 11, 11, 11, 11, 8, + 12, 15, 14, 15, 14, 15, 16, 15, 15, 15, 15, 14, 14, 14, 14, 12, + 10, 12, 12, 12, 12, 12, 13, 11, 12, 13, 12, 11, 11, 11, 11, 8, + 8, 10, 10, 10, 10, 10, 11, 9, 10, 11, 10, 9, 10, 9, 9, 5, + }, + }, + { + { + 12, 12, 11, 9, 11, 10, 11, 9, 11, 11, 10, 9, 9, 8, 9, 5, + 14, 13, 14, 11, 14, 11, 13, 10, 14, 13, 12, 10, 12, 10, 11, 6, + 16, 13, 16, 12, 16, 12, 16, 11, 16, 14, 16, 12, 15, 12, 13, 8, + 14, 14, 12, 11, 14, 12, 13, 10, 13, 13, 11, 10, 12, 11, 10, 6, + 16, 15, 14, 11, 16, 13, 14, 10, 15, 14, 13, 10, 13, 11, 11, 7, + 16, 16, 16, 11, 16, 14, 16, 11, 16, 16, 15, 12, 15, 13, 13, 8, + 16, 16, 13, 12, 16, 16, 15, 12, 16, 16, 12, 11, 15, 13, 12, 8, + 16, 16, 14, 11, 16, 16, 16, 11, 16, 16, 14, 11, 15, 14, 13, 8, + 16, 16, 15, 10, 16, 16, 16, 10, 16, 16, 15, 11, 16, 14, 14, 8, + 14, 14, 14, 12, 13, 11, 13, 10, 13, 13, 12, 11, 11, 10, 10, 6, + 16, 15, 16, 13, 13, 11, 14, 11, 15, 14, 13, 11, 12, 10, 11, 7, + 16, 15, 16, 14, 16, 11, 16, 11, 16, 16, 16, 13, 16, 12, 13, 8, + 16, 16, 14, 13, 15, 13, 14, 11, 14, 15, 13, 11, 13, 11, 11, 7, + 16, 16, 15, 13, 15, 13, 14, 11, 16, 15, 14, 11, 13, 11, 11, 7, + 16, 16, 16, 13, 16, 13, 16, 11, 16, 16, 16, 12, 16, 12, 13, 8, + 16, 16, 16, 14, 16, 16, 16, 13, 16, 16, 14, 13, 15, 14, 13, 9, + 16, 16, 16, 13, 16, 16, 16, 12, 16, 16, 14, 12, 15, 13, 13, 8, + 16, 16, 16, 12, 16, 16, 16, 11, 16, 16, 15, 12, 16, 13, 13, 7, + 16, 16, 16, 16, 13, 12, 16, 12, 16, 16, 14, 13, 12, 11, 12, 8, + 16, 16, 16, 15, 14, 11, 16, 11, 16, 16, 16, 13, 14, 11, 13, 8, + 16, 16, 16, 16, 15, 10, 16, 11, 16, 16, 16, 14, 15, 11, 13, 8, + 16, 16, 16, 16, 16, 14, 16, 13, 16, 16, 14, 14, 14, 12, 13, 9, + 16, 16, 16, 15, 16, 13, 16, 12, 16, 16, 16, 13, 14, 12, 13, 8, + 16, 16, 16, 14, 16, 12, 16, 11, 16, 16, 16, 13, 15, 12, 13, 7, + 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 15, 16, 14, 13, 9, + 16, 16, 16, 16, 16, 16, 16, 12, 16, 16, 16, 14, 16, 13, 13, 8, + 16, 16, 16, 14, 16, 14, 16, 10, 16, 16, 16, 13, 16, 13, 13, 7, + 14, 14, 13, 12, 13, 12, 13, 11, 12, 13, 11, 10, 11, 10, 10, 6, + 16, 16, 15, 13, 16, 13, 15, 11, 14, 14, 13, 11, 13, 11, 11, 7, + 16, 16, 16, 14, 16, 14, 16, 12, 16, 16, 16, 13, 16, 13, 14, 9, + 16, 16, 13, 13, 15, 14, 14, 11, 13, 14, 11, 11, 12, 11, 11, 7, + 16, 16, 15, 12, 16, 14, 15, 11, 14, 14, 12, 11, 13, 11, 11, 7, + 16, 16, 16, 13, 16, 14, 16, 12, 16, 16, 14, 12, 16, 13, 13, 8, + 16, 16, 14, 14, 16, 16, 16, 13, 16, 16, 12, 11, 15, 13, 12, 8, + 16, 16, 15, 13, 16, 16, 16, 12, 16, 16, 13, 11, 16, 13, 12, 8, + 16, 16, 16, 11, 16, 16, 16, 11, 16, 16, 14, 11, 16, 14, 13, 7, + 16, 16, 15, 13, 14, 13, 14, 11, 14, 14, 12, 11, 11, 10, 11, 7, + 16, 16, 16, 13, 14, 12, 15, 11, 15, 14, 13, 11, 12, 11, 11, 7, + 16, 16, 16, 14, 16, 13, 16, 12, 16, 16, 16, 13, 14, 12, 13, 8, + 16, 16, 15, 13, 15, 14, 14, 12, 14, 14, 12, 11, 12, 11, 11, 7, + 16, 16, 14, 12, 15, 13, 14, 11, 15, 14, 13, 11, 12, 11, 11, 6, + 16, 16, 16, 13, 16, 13, 16, 11, 16, 15, 14, 11, 14, 11, 12, 6, + 16, 16, 16, 14, 16, 16, 16, 13, 16, 16, 13, 12, 14, 13, 12, 8, + 16, 16, 15, 13, 16, 14, 15, 11, 16, 16, 13, 11, 14, 12, 11, 6, + 16, 16, 16, 12, 16, 14, 15, 11, 16, 16, 13, 10, 14, 12, 12, 6, + 16, 16, 16, 16, 16, 14, 16, 13, 16, 16, 14, 13, 12, 11, 12, 8, + 16, 16, 16, 16, 16, 13, 16, 12, 16, 16, 15, 13, 13, 11, 12, 8, + 16, 16, 16, 15, 16, 12, 16, 12, 16, 16, 16, 14, 14, 11, 13, 7, + 16, 16, 16, 16, 16, 15, 16, 13, 16, 16, 14, 13, 13, 12, 12, 8, + 16, 16, 16, 14, 15, 13, 15, 11, 16, 15, 14, 12, 13, 11, 11, 6, + 16, 16, 16, 14, 16, 12, 15, 11, 16, 16, 15, 12, 14, 11, 12, 6, + 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 15, 13, 14, 13, 12, 8, + 16, 16, 16, 14, 16, 14, 16, 12, 16, 16, 14, 12, 13, 12, 11, 6, + 16, 16, 16, 13, 16, 13, 15, 10, 16, 16, 14, 11, 14, 11, 11, 5, + 16, 16, 15, 14, 16, 16, 16, 13, 14, 14, 12, 12, 12, 12, 12, 8, + 16, 16, 16, 15, 16, 16, 16, 14, 16, 16, 14, 13, 14, 13, 13, 9, + 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 14, 16, 13, 15, 9, + 16, 16, 14, 15, 16, 16, 16, 14, 14, 16, 12, 12, 13, 13, 12, 8, + 16, 16, 16, 14, 16, 16, 16, 13, 16, 15, 13, 12, 14, 12, 12, 8, + 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 14, 12, 16, 13, 13, 8, + 16, 16, 16, 15, 16, 16, 16, 14, 16, 16, 11, 11, 15, 14, 12, 8, + 16, 16, 16, 14, 16, 16, 16, 13, 16, 16, 12, 11, 15, 13, 12, 8, + 16, 16, 16, 13, 16, 16, 16, 12, 16, 16, 13, 10, 16, 13, 12, 7, + 16, 16, 16, 16, 16, 15, 16, 13, 14, 16, 13, 13, 12, 12, 12, 8, + 16, 16, 16, 15, 16, 14, 16, 13, 16, 16, 14, 13, 13, 12, 12, 8, + 16, 16, 16, 16, 16, 15, 16, 13, 16, 16, 16, 13, 15, 12, 14, 8, + 16, 16, 16, 15, 16, 16, 16, 13, 14, 16, 13, 12, 12, 12, 11, 8, + 16, 16, 16, 14, 16, 14, 16, 12, 14, 14, 13, 11, 13, 11, 11, 6, + 16, 16, 16, 14, 16, 14, 16, 12, 16, 15, 14, 11, 14, 11, 12, 6, + 16, 16, 16, 15, 16, 16, 16, 14, 16, 16, 12, 12, 14, 13, 11, 8, + 16, 16, 15, 14, 16, 16, 16, 12, 16, 15, 12, 11, 13, 12, 11, 6, + 16, 16, 16, 13, 16, 14, 16, 11, 16, 14, 13, 10, 14, 11, 11, 5, + 16, 16, 16, 16, 16, 16, 16, 14, 14, 16, 15, 13, 11, 11, 11, 8, + 16, 16, 16, 16, 16, 15, 16, 13, 16, 16, 16, 13, 12, 11, 12, 7, + 16, 16, 16, 16, 16, 13, 16, 12, 16, 16, 16, 13, 13, 11, 13, 7, + 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 14, 13, 12, 12, 11, 7, + 16, 16, 16, 15, 16, 14, 15, 12, 16, 14, 13, 12, 12, 11, 11, 6, + 16, 16, 16, 14, 16, 13, 15, 11, 16, 14, 14, 11, 13, 10, 11, 5, + 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 13, 12, 12, 12, 11, 7, + 16, 16, 16, 14, 16, 14, 15, 12, 16, 15, 12, 11, 12, 11, 10, 5, + 16, 16, 16, 13, 16, 13, 14, 10, 16, 14, 12, 9, 12, 10, 9, 3, + }, + { + 2, 6, 6, 7, 6, 7, 8, 7, 7, 8, 7, 8, 7, 8, 8, 5, + 5, 8, 9, 9, 9, 9, 12, 10, 10, 11, 10, 10, 10, 11, 11, 8, + 9, 10, 13, 12, 13, 12, 15, 13, 13, 14, 13, 14, 13, 13, 14, 11, + 5, 10, 9, 10, 10, 10, 12, 10, 10, 12, 10, 11, 11, 11, 11, 8, + 6, 9, 10, 9, 10, 11, 12, 10, 10, 12, 11, 11, 10, 11, 11, 8, + 9, 11, 12, 11, 12, 13, 14, 12, 13, 14, 14, 12, 13, 13, 13, 11, + 10, 13, 11, 12, 14, 14, 15, 13, 13, 15, 12, 13, 14, 14, 14, 12, + 9, 12, 12, 12, 13, 13, 15, 13, 13, 14, 13, 13, 14, 13, 15, 11, + 8, 11, 12, 10, 12, 13, 14, 12, 13, 14, 14, 13, 13, 13, 14, 11, + 5, 9, 10, 10, 9, 10, 12, 11, 10, 12, 11, 11, 9, 11, 11, 9, + 6, 10, 10, 11, 10, 10, 12, 11, 11, 12, 11, 11, 11, 11, 11, 9, + 9, 11, 13, 13, 12, 11, 14, 12, 13, 15, 13, 13, 14, 13, 14, 11, + 8, 11, 11, 12, 11, 12, 13, 12, 12, 13, 12, 13, 12, 12, 12, 10, + 7, 10, 10, 11, 10, 11, 12, 11, 11, 12, 11, 11, 11, 11, 12, 9, + 9, 12, 12, 12, 12, 12, 14, 12, 13, 14, 13, 13, 13, 13, 13, 11, + 11, 14, 13, 15, 15, 16, 16, 15, 15, 16, 15, 15, 16, 16, 15, 13, + 10, 12, 13, 13, 13, 14, 15, 13, 13, 14, 13, 13, 14, 14, 14, 11, + 9, 12, 12, 12, 13, 13, 14, 12, 13, 14, 14, 13, 13, 13, 14, 11, + 9, 13, 13, 13, 11, 12, 15, 13, 13, 15, 14, 14, 11, 13, 14, 11, + 10, 13, 13, 13, 12, 12, 15, 13, 13, 15, 14, 14, 13, 13, 14, 11, + 10, 12, 13, 13, 12, 11, 14, 12, 13, 15, 13, 13, 13, 13, 14, 11, + 11, 14, 15, 15, 13, 14, 16, 14, 14, 16, 16, 14, 14, 15, 15, 13, + 10, 13, 13, 13, 12, 13, 14, 13, 13, 14, 14, 14, 13, 13, 14, 11, + 10, 12, 13, 13, 13, 12, 14, 13, 13, 14, 14, 13, 13, 13, 13, 11, + 13, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, + 12, 15, 15, 15, 14, 15, 16, 14, 15, 16, 16, 15, 16, 15, 15, 13, + 10, 12, 12, 12, 13, 13, 14, 12, 13, 14, 13, 13, 13, 13, 13, 11, + 6, 10, 10, 11, 10, 11, 12, 11, 10, 12, 11, 11, 10, 11, 11, 9, + 8, 11, 12, 12, 12, 12, 13, 12, 12, 13, 12, 13, 12, 13, 13, 10, + 11, 13, 15, 14, 15, 14, 16, 14, 15, 16, 16, 14, 15, 15, 15, 13, + 7, 11, 10, 12, 11, 11, 13, 11, 11, 13, 10, 11, 12, 12, 12, 10, + 7, 11, 11, 11, 11, 11, 13, 11, 11, 13, 11, 12, 12, 12, 12, 9, + 10, 12, 13, 13, 13, 13, 15, 13, 14, 15, 14, 14, 14, 14, 15, 11, + 10, 13, 12, 14, 14, 14, 15, 13, 13, 15, 12, 13, 15, 15, 14, 12, + 10, 13, 12, 12, 13, 13, 15, 14, 13, 15, 13, 13, 14, 14, 14, 11, + 10, 13, 13, 12, 13, 14, 15, 13, 13, 15, 13, 13, 14, 14, 14, 11, + 7, 10, 11, 11, 10, 11, 12, 11, 10, 12, 12, 12, 9, 11, 12, 9, + 7, 11, 11, 11, 11, 11, 13, 11, 11, 13, 12, 12, 11, 12, 12, 9, + 10, 12, 14, 13, 13, 13, 16, 13, 14, 16, 14, 14, 13, 13, 14, 11, + 8, 11, 11, 12, 11, 12, 13, 12, 12, 13, 12, 12, 12, 12, 12, 10, + 6, 9, 9, 10, 9, 10, 11, 10, 10, 11, 10, 10, 10, 10, 10, 8, + 8, 11, 11, 11, 12, 11, 13, 11, 12, 13, 12, 12, 12, 12, 12, 10, + 11, 14, 13, 14, 14, 14, 16, 14, 14, 16, 14, 14, 15, 15, 14, 12, + 9, 12, 11, 12, 12, 12, 13, 12, 12, 13, 12, 12, 12, 12, 12, 10, + 8, 11, 11, 11, 11, 11, 13, 11, 12, 12, 12, 12, 12, 12, 12, 9, + 10, 13, 14, 13, 11, 13, 14, 14, 13, 15, 15, 14, 10, 13, 14, 11, + 10, 13, 13, 13, 12, 13, 14, 13, 13, 14, 14, 14, 13, 13, 13, 11, + 10, 13, 14, 13, 13, 12, 15, 13, 14, 15, 14, 14, 14, 13, 14, 12, + 11, 14, 14, 14, 13, 13, 15, 14, 14, 15, 14, 15, 13, 14, 14, 12, + 9, 11, 12, 12, 11, 11, 13, 12, 12, 13, 12, 12, 12, 12, 12, 10, + 9, 11, 12, 12, 12, 11, 13, 11, 12, 13, 12, 12, 12, 12, 12, 10, + 13, 15, 15, 16, 15, 16, 16, 15, 16, 16, 16, 15, 15, 15, 16, 14, + 10, 13, 13, 13, 13, 13, 14, 13, 13, 14, 13, 13, 13, 13, 13, 11, + 8, 11, 11, 11, 11, 11, 12, 11, 11, 12, 12, 11, 12, 11, 12, 9, + 11, 14, 14, 15, 14, 15, 15, 14, 13, 15, 14, 15, 12, 14, 15, 13, + 12, 15, 15, 15, 15, 15, 16, 15, 15, 16, 16, 16, 15, 16, 15, 13, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, + 11, 14, 13, 15, 14, 14, 16, 14, 14, 16, 13, 14, 15, 14, 15, 12, + 11, 14, 13, 14, 14, 14, 16, 15, 14, 16, 14, 14, 15, 15, 15, 12, + 13, 15, 15, 15, 15, 16, 16, 15, 16, 16, 16, 15, 16, 16, 16, 13, + 11, 14, 13, 14, 14, 14, 15, 14, 14, 16, 12, 14, 16, 16, 14, 12, + 11, 14, 14, 14, 14, 15, 16, 15, 14, 16, 13, 14, 16, 15, 14, 12, + 12, 14, 14, 14, 14, 14, 16, 14, 15, 16, 14, 14, 14, 15, 15, 12, + 11, 14, 14, 14, 13, 14, 16, 15, 13, 16, 15, 15, 11, 14, 14, 12, + 11, 14, 14, 15, 14, 14, 16, 14, 14, 15, 14, 14, 13, 15, 15, 12, + 13, 15, 16, 15, 15, 15, 16, 15, 16, 16, 16, 16, 15, 15, 16, 13, + 11, 14, 14, 14, 14, 14, 15, 14, 14, 16, 14, 14, 14, 15, 14, 12, + 9, 12, 12, 12, 12, 12, 13, 12, 12, 13, 12, 13, 12, 12, 12, 10, + 11, 13, 13, 13, 13, 13, 14, 13, 13, 14, 13, 14, 13, 13, 14, 11, + 12, 15, 14, 15, 15, 15, 16, 15, 14, 16, 14, 14, 16, 16, 14, 13, + 10, 12, 12, 12, 12, 12, 14, 12, 13, 13, 12, 12, 13, 13, 13, 10, + 10, 12, 12, 12, 12, 12, 14, 12, 12, 13, 12, 12, 12, 12, 12, 10, + 10, 14, 14, 14, 12, 14, 16, 14, 13, 16, 16, 16, 10, 13, 14, 12, + 11, 14, 14, 14, 13, 14, 16, 14, 14, 16, 15, 14, 12, 13, 14, 12, + 12, 14, 14, 14, 14, 14, 16, 14, 14, 16, 15, 15, 14, 14, 15, 12, + 12, 14, 15, 15, 14, 15, 16, 14, 15, 15, 15, 15, 13, 15, 14, 12, + 9, 12, 12, 12, 12, 13, 13, 12, 12, 13, 13, 12, 11, 12, 12, 10, + 10, 12, 12, 12, 12, 12, 13, 12, 12, 13, 12, 12, 12, 12, 12, 10, + 13, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 15, 16, 15, 13, + 10, 12, 12, 13, 12, 13, 13, 12, 13, 14, 13, 13, 12, 13, 13, 10, + 7, 10, 10, 10, 10, 10, 11, 10, 10, 11, 10, 10, 10, 10, 10, 7, + }, + }, + { + { + 10, 10, 9, 8, 9, 8, 9, 7, 9, 9, 8, 7, 8, 7, 7, 4, + 13, 11, 12, 9, 12, 9, 12, 9, 12, 11, 11, 9, 10, 9, 9, 6, + 15, 12, 15, 11, 14, 10, 14, 10, 14, 13, 13, 11, 13, 11, 12, 7, + 13, 12, 11, 9, 12, 11, 12, 9, 12, 12, 10, 9, 10, 10, 9, 6, + 14, 13, 12, 10, 13, 12, 13, 9, 13, 12, 11, 10, 12, 11, 10, 6, + 16, 14, 14, 10, 15, 13, 14, 10, 15, 15, 14, 11, 14, 12, 12, 8, + 15, 14, 12, 11, 15, 14, 13, 11, 14, 14, 11, 10, 13, 12, 11, 8, + 15, 16, 13, 11, 16, 14, 14, 11, 15, 15, 12, 10, 14, 13, 12, 8, + 16, 15, 14, 10, 16, 14, 14, 10, 16, 15, 14, 10, 14, 13, 12, 7, + 13, 12, 12, 11, 11, 9, 12, 9, 12, 12, 11, 10, 10, 9, 9, 6, + 13, 13, 14, 12, 12, 10, 12, 10, 14, 13, 12, 11, 11, 10, 10, 7, + 16, 14, 16, 13, 14, 11, 15, 10, 16, 15, 14, 12, 14, 11, 12, 8, + 14, 14, 13, 12, 13, 12, 13, 10, 13, 13, 12, 11, 11, 10, 10, 7, + 15, 14, 14, 12, 14, 12, 13, 10, 14, 13, 12, 11, 12, 11, 11, 7, + 16, 15, 16, 13, 15, 13, 15, 10, 16, 15, 14, 12, 14, 12, 12, 7, + 15, 16, 14, 13, 16, 14, 14, 12, 15, 15, 12, 12, 13, 12, 12, 8, + 16, 16, 14, 13, 16, 14, 14, 11, 15, 15, 14, 11, 14, 12, 12, 8, + 16, 16, 15, 12, 16, 14, 15, 10, 16, 16, 13, 12, 14, 13, 12, 7, + 14, 14, 14, 13, 13, 11, 13, 11, 14, 14, 13, 12, 11, 10, 11, 8, + 16, 15, 16, 13, 13, 11, 14, 11, 15, 14, 14, 13, 12, 11, 12, 8, + 15, 15, 16, 14, 14, 10, 14, 10, 16, 15, 15, 13, 14, 10, 12, 8, + 16, 16, 16, 14, 15, 13, 14, 12, 15, 15, 13, 13, 13, 12, 12, 8, + 16, 16, 16, 14, 15, 13, 14, 11, 16, 16, 14, 13, 13, 12, 12, 8, + 16, 16, 16, 14, 16, 12, 15, 11, 16, 15, 15, 13, 14, 12, 12, 8, + 16, 16, 16, 16, 16, 15, 15, 13, 16, 16, 14, 13, 14, 13, 12, 9, + 16, 16, 16, 14, 16, 15, 15, 11, 16, 16, 14, 13, 15, 13, 12, 8, + 16, 16, 16, 14, 16, 14, 14, 10, 16, 16, 15, 13, 14, 12, 12, 7, + 12, 12, 12, 11, 12, 11, 12, 10, 11, 11, 10, 9, 9, 9, 9, 6, + 14, 13, 14, 12, 13, 12, 13, 10, 13, 13, 12, 10, 12, 10, 11, 7, + 16, 14, 16, 13, 15, 13, 16, 12, 15, 14, 14, 12, 14, 12, 13, 8, + 14, 14, 13, 11, 14, 12, 13, 11, 12, 12, 10, 10, 11, 10, 10, 7, + 14, 14, 13, 12, 14, 12, 13, 11, 13, 13, 12, 10, 12, 11, 10, 7, + 16, 15, 15, 12, 16, 14, 15, 11, 16, 14, 13, 11, 14, 12, 12, 8, + 16, 16, 13, 13, 16, 15, 14, 12, 14, 14, 11, 11, 13, 12, 11, 8, + 16, 16, 14, 12, 16, 14, 14, 12, 15, 14, 12, 11, 14, 12, 12, 8, + 16, 15, 14, 11, 16, 15, 15, 11, 16, 15, 13, 11, 14, 13, 12, 8, + 14, 13, 13, 12, 13, 11, 13, 10, 12, 13, 11, 10, 10, 10, 10, 7, + 15, 14, 14, 13, 13, 12, 13, 11, 14, 13, 12, 11, 12, 10, 11, 7, + 16, 15, 16, 14, 15, 12, 15, 11, 16, 14, 14, 12, 14, 11, 12, 8, + 14, 15, 13, 12, 14, 13, 13, 11, 13, 13, 11, 11, 11, 10, 10, 7, + 14, 14, 14, 12, 14, 13, 13, 10, 14, 13, 12, 10, 12, 10, 10, 6, + 16, 15, 15, 13, 16, 13, 15, 11, 15, 14, 13, 11, 13, 11, 11, 7, + 16, 16, 14, 13, 16, 15, 14, 12, 15, 15, 12, 11, 13, 12, 11, 8, + 16, 16, 14, 13, 16, 14, 14, 11, 15, 14, 12, 11, 13, 12, 11, 7, + 16, 16, 15, 12, 16, 14, 14, 11, 15, 15, 13, 11, 14, 12, 11, 6, + 16, 15, 15, 14, 14, 12, 14, 12, 13, 14, 13, 12, 11, 11, 11, 8, + 16, 16, 16, 14, 14, 12, 15, 12, 15, 14, 14, 12, 12, 11, 12, 8, + 16, 16, 16, 15, 14, 12, 15, 12, 16, 15, 14, 13, 13, 11, 12, 8, + 16, 16, 16, 15, 15, 14, 15, 12, 14, 14, 13, 12, 12, 11, 11, 8, + 16, 16, 15, 14, 14, 12, 14, 11, 14, 14, 13, 12, 12, 11, 11, 7, + 16, 16, 16, 14, 15, 12, 14, 11, 15, 15, 14, 12, 13, 11, 12, 7, + 16, 16, 16, 16, 16, 15, 16, 13, 15, 15, 14, 12, 13, 12, 11, 8, + 16, 16, 16, 14, 15, 14, 14, 12, 16, 15, 13, 12, 13, 12, 11, 7, + 16, 16, 16, 13, 16, 13, 14, 10, 16, 15, 14, 11, 13, 11, 11, 6, + 14, 15, 13, 13, 14, 13, 14, 12, 12, 13, 11, 11, 11, 11, 10, 8, + 16, 16, 15, 13, 16, 14, 16, 13, 14, 14, 13, 12, 13, 12, 12, 8, + 16, 16, 16, 14, 16, 14, 16, 13, 16, 14, 15, 13, 15, 13, 13, 9, + 15, 15, 14, 14, 15, 14, 14, 12, 13, 14, 11, 11, 12, 12, 11, 8, + 15, 16, 15, 13, 15, 14, 14, 12, 14, 14, 12, 11, 13, 12, 12, 8, + 16, 16, 16, 13, 16, 15, 15, 13, 16, 15, 14, 11, 15, 12, 13, 8, + 16, 16, 14, 13, 16, 15, 15, 13, 14, 14, 10, 11, 14, 12, 11, 8, + 16, 16, 15, 13, 16, 16, 15, 13, 15, 14, 12, 11, 14, 13, 12, 8, + 16, 16, 15, 13, 16, 15, 16, 12, 16, 14, 13, 10, 15, 13, 12, 7, + 15, 15, 15, 14, 14, 14, 15, 12, 13, 14, 12, 12, 11, 11, 11, 8, + 16, 15, 16, 14, 15, 13, 15, 12, 14, 14, 13, 12, 12, 11, 12, 8, + 16, 16, 16, 15, 16, 14, 16, 13, 16, 15, 14, 12, 14, 11, 13, 8, + 16, 16, 15, 14, 16, 14, 15, 13, 14, 14, 12, 11, 12, 11, 11, 8, + 15, 16, 15, 14, 15, 14, 14, 12, 14, 13, 12, 11, 12, 11, 11, 7, + 16, 16, 16, 14, 16, 13, 16, 12, 15, 14, 13, 11, 13, 11, 12, 7, + 16, 16, 15, 14, 16, 15, 15, 13, 14, 15, 11, 11, 13, 12, 11, 8, + 16, 16, 15, 13, 16, 14, 15, 12, 15, 14, 12, 11, 13, 11, 11, 7, + 16, 16, 15, 13, 16, 14, 16, 12, 15, 14, 13, 10, 13, 11, 11, 6, + 16, 16, 16, 14, 14, 14, 15, 13, 14, 14, 14, 12, 11, 11, 11, 8, + 16, 16, 16, 14, 15, 14, 16, 13, 15, 14, 14, 13, 12, 11, 11, 7, + 16, 16, 16, 16, 15, 13, 16, 12, 15, 15, 14, 12, 13, 10, 12, 7, + 16, 16, 16, 14, 15, 15, 14, 13, 14, 14, 13, 12, 12, 11, 11, 8, + 16, 15, 16, 14, 16, 13, 15, 12, 14, 14, 13, 12, 12, 10, 10, 6, + 16, 15, 16, 14, 16, 13, 16, 11, 16, 14, 13, 11, 13, 10, 11, 6, + 16, 16, 16, 15, 16, 16, 15, 13, 14, 16, 12, 12, 12, 12, 10, 7, + 16, 16, 16, 14, 16, 14, 14, 12, 15, 15, 12, 11, 12, 11, 10, 6, + 16, 16, 16, 13, 16, 13, 15, 10, 15, 14, 13, 10, 13, 10, 10, 4, + }, + { + 1, 6, 6, 7, 6, 7, 9, 8, 7, 9, 7, 8, 7, 8, 8, 6, + 6, 9, 10, 10, 10, 10, 12, 11, 10, 12, 11, 11, 11, 11, 12, 9, + 9, 10, 13, 11, 13, 12, 14, 13, 14, 14, 14, 14, 14, 14, 14, 12, + 6, 10, 9, 10, 10, 11, 13, 11, 11, 13, 10, 12, 11, 12, 12, 9, + 6, 10, 10, 10, 10, 11, 13, 11, 11, 13, 12, 12, 11, 12, 12, 9, + 9, 11, 13, 12, 13, 14, 15, 13, 14, 16, 14, 14, 14, 14, 15, 12, + 10, 13, 11, 13, 14, 14, 16, 14, 14, 15, 13, 14, 15, 15, 16, 12, + 9, 13, 12, 12, 14, 14, 16, 14, 14, 15, 14, 14, 15, 15, 15, 12, + 8, 11, 12, 11, 13, 14, 15, 13, 13, 15, 14, 14, 13, 15, 15, 11, + 6, 10, 10, 11, 9, 10, 13, 11, 10, 13, 11, 12, 10, 12, 12, 9, + 6, 10, 10, 11, 11, 10, 13, 11, 11, 13, 11, 12, 12, 12, 13, 10, + 9, 12, 13, 13, 13, 12, 16, 13, 14, 15, 14, 14, 15, 14, 15, 12, + 8, 12, 12, 13, 12, 13, 15, 14, 13, 15, 13, 14, 13, 13, 14, 11, + 7, 11, 11, 12, 11, 12, 13, 12, 12, 13, 12, 13, 12, 13, 13, 10, + 9, 12, 13, 13, 13, 13, 16, 13, 13, 15, 14, 14, 14, 15, 15, 12, + 11, 15, 14, 15, 15, 16, 16, 16, 15, 16, 15, 16, 16, 16, 16, 14, + 10, 13, 13, 14, 14, 14, 16, 15, 14, 16, 15, 15, 15, 15, 16, 13, + 9, 12, 13, 13, 13, 14, 16, 14, 13, 15, 14, 14, 14, 16, 15, 12, + 10, 13, 14, 14, 11, 13, 16, 14, 14, 16, 15, 15, 12, 14, 15, 12, + 10, 13, 14, 14, 12, 12, 16, 15, 14, 16, 15, 15, 14, 14, 16, 12, + 9, 12, 13, 14, 13, 11, 16, 13, 14, 15, 13, 14, 14, 14, 15, 12, + 11, 15, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 10, 13, 14, 14, 13, 14, 16, 15, 14, 16, 16, 16, 14, 15, 16, 13, + 10, 13, 13, 14, 13, 13, 16, 13, 13, 14, 14, 15, 15, 14, 15, 13, + 13, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, + 12, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 10, 12, 13, 14, 13, 13, 14, 13, 13, 14, 13, 14, 14, 14, 15, 12, + 6, 10, 11, 11, 10, 11, 13, 12, 11, 13, 11, 12, 11, 12, 12, 10, + 8, 12, 13, 13, 12, 13, 14, 14, 13, 15, 14, 14, 14, 14, 15, 12, + 12, 14, 16, 15, 15, 15, 16, 15, 16, 16, 16, 16, 16, 16, 16, 14, + 7, 11, 11, 12, 12, 12, 14, 13, 12, 14, 11, 12, 13, 13, 13, 11, + 8, 11, 12, 12, 12, 12, 14, 13, 12, 14, 12, 13, 13, 14, 14, 11, + 11, 13, 14, 14, 14, 14, 16, 15, 15, 16, 15, 15, 16, 16, 16, 13, + 10, 14, 12, 14, 14, 15, 16, 15, 13, 16, 12, 14, 16, 16, 15, 13, + 10, 13, 13, 14, 14, 15, 16, 15, 14, 16, 14, 15, 15, 16, 16, 12, + 10, 13, 14, 13, 14, 14, 16, 15, 14, 16, 15, 15, 14, 16, 16, 13, + 7, 11, 11, 11, 10, 12, 14, 13, 11, 14, 13, 13, 10, 12, 13, 10, + 8, 11, 12, 12, 11, 12, 14, 13, 12, 15, 13, 13, 12, 13, 14, 11, + 11, 13, 14, 14, 14, 14, 16, 15, 14, 16, 15, 16, 16, 16, 16, 14, + 8, 12, 12, 13, 12, 13, 15, 14, 12, 15, 13, 13, 13, 14, 14, 11, + 6, 10, 10, 11, 10, 11, 13, 12, 11, 13, 11, 12, 11, 12, 12, 9, + 9, 12, 13, 13, 13, 13, 14, 13, 13, 15, 14, 14, 14, 14, 14, 12, + 11, 15, 14, 15, 14, 15, 16, 16, 16, 16, 15, 16, 16, 16, 16, 14, + 9, 13, 12, 13, 13, 13, 15, 14, 13, 14, 13, 14, 14, 15, 14, 12, + 9, 12, 12, 12, 12, 13, 14, 13, 13, 14, 13, 13, 13, 13, 14, 11, + 10, 13, 15, 14, 12, 14, 16, 14, 14, 16, 15, 15, 12, 14, 16, 12, + 10, 14, 14, 14, 13, 14, 16, 15, 14, 16, 16, 16, 13, 14, 16, 13, + 11, 13, 14, 14, 14, 13, 16, 14, 14, 16, 15, 15, 15, 15, 16, 13, + 11, 15, 15, 15, 14, 15, 16, 16, 15, 16, 16, 16, 14, 16, 16, 13, + 9, 13, 13, 13, 12, 13, 15, 14, 13, 15, 14, 14, 13, 14, 15, 11, + 9, 12, 12, 13, 12, 12, 14, 13, 13, 14, 13, 14, 14, 14, 14, 11, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, + 11, 14, 14, 15, 15, 14, 16, 16, 14, 16, 14, 15, 15, 16, 16, 12, + 9, 12, 12, 13, 12, 12, 14, 12, 12, 14, 13, 13, 13, 13, 14, 11, + 11, 14, 14, 16, 14, 16, 16, 16, 13, 16, 14, 16, 14, 16, 16, 13, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 15, 14, 16, 14, 15, 16, 16, 15, 16, 14, 15, 16, 16, 16, 13, + 11, 15, 14, 16, 15, 16, 16, 16, 15, 16, 15, 16, 16, 16, 16, 14, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 11, 14, 13, 14, 15, 14, 16, 15, 14, 16, 12, 14, 16, 16, 15, 13, + 11, 14, 14, 16, 14, 15, 16, 16, 15, 16, 14, 15, 16, 16, 16, 14, + 12, 14, 14, 15, 14, 16, 16, 15, 14, 16, 15, 15, 15, 16, 16, 13, + 11, 14, 15, 15, 13, 15, 16, 16, 14, 16, 16, 16, 12, 15, 15, 13, + 11, 15, 16, 16, 15, 16, 16, 16, 15, 16, 16, 16, 14, 16, 16, 14, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, + 11, 15, 14, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, + 10, 13, 13, 14, 14, 14, 16, 15, 14, 16, 14, 15, 14, 14, 15, 12, + 12, 15, 14, 16, 14, 15, 16, 15, 15, 16, 15, 15, 16, 15, 16, 13, + 12, 16, 14, 16, 15, 16, 16, 16, 16, 16, 14, 15, 16, 16, 16, 14, + 10, 13, 13, 14, 14, 13, 16, 14, 13, 16, 13, 14, 15, 15, 15, 12, + 10, 13, 13, 14, 13, 13, 16, 14, 14, 15, 14, 14, 14, 14, 15, 12, + 10, 14, 15, 14, 13, 15, 16, 15, 14, 16, 16, 16, 11, 14, 16, 12, + 11, 14, 14, 16, 14, 15, 16, 15, 15, 16, 16, 16, 13, 15, 16, 13, + 12, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 15, 16, 13, + 12, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 13, + 10, 13, 14, 14, 13, 14, 16, 14, 13, 16, 15, 14, 12, 14, 16, 11, + 10, 13, 13, 14, 13, 14, 16, 14, 14, 15, 14, 14, 13, 14, 14, 11, + 13, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 11, 13, 14, 15, 14, 14, 16, 15, 14, 16, 14, 15, 14, 15, 16, 12, + 8, 11, 11, 11, 11, 12, 13, 12, 11, 13, 11, 12, 11, 12, 12, 9, + }, + }, + { + { + 8, 8, 8, 7, 8, 7, 8, 6, 8, 8, 7, 6, 7, 6, 6, 4, + 11, 10, 11, 9, 11, 9, 11, 8, 11, 10, 10, 9, 10, 8, 9, 6, + 13, 11, 13, 10, 12, 10, 13, 9, 13, 12, 13, 10, 12, 10, 11, 7, + 11, 11, 10, 9, 11, 10, 11, 9, 10, 11, 9, 8, 10, 9, 9, 6, + 12, 12, 11, 9, 12, 11, 12, 9, 12, 12, 11, 9, 11, 10, 10, 7, + 14, 13, 13, 10, 15, 12, 13, 10, 15, 13, 13, 10, 13, 12, 12, 8, + 13, 13, 11, 10, 14, 13, 12, 10, 13, 13, 10, 10, 12, 11, 10, 8, + 15, 14, 13, 10, 14, 13, 13, 10, 14, 13, 12, 10, 13, 12, 11, 8, + 14, 14, 13, 10, 16, 13, 13, 10, 15, 14, 13, 10, 13, 12, 12, 8, + 11, 11, 11, 10, 10, 9, 10, 9, 10, 10, 10, 9, 9, 8, 9, 6, + 12, 12, 12, 11, 11, 9, 12, 9, 12, 12, 11, 10, 11, 9, 10, 7, + 14, 13, 14, 12, 13, 10, 13, 10, 15, 13, 14, 12, 12, 10, 12, 8, + 13, 13, 12, 11, 12, 11, 12, 10, 12, 12, 11, 10, 11, 10, 10, 7, + 14, 13, 13, 11, 13, 12, 12, 10, 13, 13, 12, 11, 12, 10, 10, 7, + 16, 15, 15, 12, 14, 12, 13, 10, 15, 14, 13, 12, 13, 12, 12, 8, + 15, 15, 13, 13, 14, 14, 14, 12, 14, 14, 12, 11, 13, 12, 11, 8, + 15, 16, 14, 12, 15, 14, 13, 11, 15, 15, 13, 12, 13, 12, 11, 8, + 16, 15, 15, 12, 16, 14, 14, 10, 15, 15, 14, 12, 14, 12, 12, 8, + 13, 13, 13, 13, 11, 10, 12, 10, 12, 13, 12, 11, 10, 10, 10, 8, + 14, 13, 14, 13, 12, 10, 13, 10, 14, 14, 13, 12, 12, 10, 11, 8, + 15, 14, 16, 14, 13, 10, 14, 10, 16, 14, 14, 13, 13, 10, 12, 8, + 15, 15, 14, 14, 14, 13, 13, 12, 14, 14, 13, 12, 12, 11, 11, 9, + 15, 15, 15, 14, 14, 12, 14, 11, 15, 14, 13, 13, 13, 11, 11, 8, + 16, 15, 16, 14, 15, 12, 14, 11, 16, 16, 15, 13, 14, 12, 12, 8, + 16, 16, 16, 14, 15, 14, 14, 12, 15, 15, 14, 13, 13, 12, 11, 9, + 16, 16, 15, 15, 16, 14, 14, 11, 16, 16, 14, 13, 14, 12, 12, 8, + 16, 16, 16, 13, 15, 13, 14, 10, 16, 16, 15, 13, 14, 12, 12, 8, + 11, 11, 11, 10, 11, 10, 11, 9, 10, 10, 9, 8, 9, 9, 9, 6, + 12, 12, 13, 11, 12, 11, 12, 10, 12, 12, 11, 10, 11, 10, 10, 7, + 15, 13, 15, 12, 14, 13, 14, 11, 14, 13, 13, 11, 13, 11, 12, 8, + 12, 13, 12, 11, 13, 11, 12, 10, 11, 12, 10, 9, 11, 10, 10, 7, + 14, 13, 13, 11, 14, 12, 13, 11, 12, 12, 11, 10, 12, 11, 10, 7, + 15, 14, 15, 12, 15, 13, 15, 11, 15, 14, 13, 11, 13, 12, 12, 8, + 14, 14, 13, 12, 15, 14, 13, 12, 13, 13, 11, 10, 13, 12, 11, 8, + 16, 15, 13, 12, 15, 14, 14, 12, 14, 14, 12, 11, 14, 12, 11, 8, + 16, 15, 14, 12, 16, 15, 15, 11, 15, 14, 13, 11, 14, 13, 12, 8, + 12, 12, 12, 11, 12, 11, 12, 10, 11, 11, 11, 10, 10, 9, 9, 7, + 13, 13, 14, 12, 13, 11, 13, 11, 13, 12, 12, 11, 11, 10, 10, 7, + 15, 14, 16, 13, 14, 12, 14, 11, 14, 14, 14, 12, 13, 11, 12, 8, + 13, 13, 13, 12, 13, 12, 13, 11, 12, 12, 11, 10, 11, 10, 10, 7, + 14, 14, 13, 12, 13, 12, 13, 10, 13, 13, 11, 10, 12, 10, 10, 7, + 16, 15, 15, 13, 15, 12, 14, 11, 15, 14, 13, 11, 13, 11, 11, 7, + 15, 16, 14, 13, 15, 14, 14, 12, 14, 14, 12, 11, 13, 12, 11, 8, + 16, 15, 14, 13, 15, 14, 14, 11, 14, 14, 12, 11, 13, 12, 11, 7, + 16, 15, 15, 12, 16, 14, 14, 11, 15, 14, 13, 11, 14, 12, 11, 7, + 14, 15, 14, 14, 13, 12, 13, 12, 13, 13, 12, 12, 11, 10, 11, 8, + 15, 15, 15, 14, 13, 12, 14, 12, 14, 14, 13, 12, 12, 11, 11, 8, + 16, 15, 16, 14, 14, 12, 15, 12, 16, 14, 14, 13, 13, 11, 12, 8, + 15, 15, 15, 14, 14, 13, 14, 12, 14, 14, 13, 12, 12, 11, 11, 8, + 15, 15, 15, 14, 14, 13, 14, 12, 14, 14, 13, 12, 12, 11, 11, 7, + 16, 15, 16, 14, 15, 12, 15, 11, 15, 14, 14, 12, 13, 11, 12, 7, + 16, 16, 16, 15, 16, 15, 14, 13, 15, 15, 13, 12, 13, 12, 11, 9, + 16, 16, 16, 14, 15, 14, 14, 12, 15, 15, 13, 12, 14, 12, 11, 8, + 16, 16, 16, 14, 16, 14, 14, 11, 15, 15, 14, 12, 14, 12, 11, 7, + 13, 13, 13, 12, 13, 12, 13, 11, 11, 12, 11, 10, 10, 10, 10, 8, + 15, 14, 14, 13, 14, 13, 14, 12, 13, 13, 12, 11, 13, 11, 11, 8, + 16, 15, 16, 14, 16, 14, 16, 13, 15, 14, 14, 12, 14, 12, 13, 9, + 14, 15, 13, 13, 14, 13, 14, 12, 12, 13, 11, 11, 12, 11, 11, 8, + 15, 15, 14, 13, 15, 14, 14, 12, 13, 13, 12, 11, 13, 12, 11, 8, + 16, 16, 16, 13, 16, 15, 16, 13, 15, 14, 14, 12, 14, 13, 13, 9, + 14, 15, 13, 13, 16, 15, 15, 13, 13, 14, 11, 11, 13, 12, 11, 9, + 16, 16, 14, 13, 16, 15, 16, 13, 14, 14, 12, 11, 14, 13, 12, 8, + 16, 16, 15, 12, 16, 15, 15, 12, 15, 14, 13, 11, 14, 13, 12, 8, + 14, 14, 14, 13, 14, 13, 14, 12, 12, 13, 12, 11, 11, 11, 11, 8, + 15, 15, 15, 14, 14, 13, 15, 12, 14, 13, 13, 12, 12, 11, 11, 8, + 16, 16, 16, 15, 15, 14, 16, 13, 15, 14, 14, 12, 14, 12, 12, 9, + 15, 15, 14, 14, 14, 14, 14, 13, 13, 14, 12, 11, 12, 11, 11, 8, + 15, 15, 15, 13, 15, 14, 14, 12, 13, 13, 12, 11, 12, 11, 11, 7, + 16, 15, 16, 14, 16, 14, 15, 12, 15, 14, 14, 12, 13, 12, 12, 8, + 16, 16, 15, 14, 16, 15, 15, 13, 14, 14, 12, 11, 13, 12, 11, 8, + 16, 16, 15, 13, 16, 14, 14, 12, 14, 15, 12, 11, 13, 12, 11, 7, + 16, 16, 16, 13, 16, 15, 15, 12, 15, 14, 13, 11, 14, 12, 11, 7, + 15, 15, 15, 14, 13, 13, 14, 13, 13, 14, 13, 12, 11, 11, 11, 8, + 16, 16, 16, 14, 15, 13, 15, 12, 14, 14, 14, 13, 12, 11, 12, 8, + 16, 16, 16, 14, 15, 13, 15, 12, 15, 14, 14, 12, 13, 11, 12, 8, + 15, 16, 16, 14, 15, 14, 15, 13, 14, 14, 12, 12, 11, 11, 11, 8, + 16, 15, 15, 14, 15, 14, 14, 12, 14, 14, 13, 12, 12, 11, 11, 7, + 16, 16, 16, 13, 15, 13, 15, 12, 15, 14, 14, 12, 13, 11, 11, 7, + 16, 16, 16, 15, 15, 16, 15, 13, 14, 14, 12, 12, 12, 12, 11, 8, + 16, 16, 16, 14, 16, 14, 14, 12, 15, 15, 13, 11, 12, 11, 10, 7, + 16, 16, 15, 13, 16, 14, 14, 11, 15, 14, 13, 10, 13, 11, 10, 5, + }, + { + 1, 6, 6, 7, 6, 7, 9, 7, 6, 9, 7, 8, 7, 8, 8, 5, + 5, 8, 10, 10, 10, 10, 12, 11, 11, 12, 11, 11, 11, 12, 12, 9, + 9, 10, 12, 11, 13, 12, 15, 13, 14, 15, 15, 14, 14, 15, 15, 12, + 6, 10, 9, 10, 10, 11, 13, 12, 11, 13, 11, 12, 12, 12, 12, 10, + 6, 10, 10, 10, 11, 11, 13, 11, 11, 13, 12, 12, 11, 12, 12, 10, + 9, 12, 13, 12, 13, 13, 16, 13, 14, 16, 15, 14, 14, 15, 16, 12, + 9, 13, 11, 13, 14, 14, 16, 15, 14, 16, 13, 15, 15, 15, 15, 12, + 9, 13, 12, 13, 14, 15, 16, 15, 14, 16, 15, 15, 15, 15, 16, 12, + 8, 12, 12, 11, 13, 14, 15, 13, 13, 15, 14, 14, 14, 14, 14, 12, + 6, 10, 10, 11, 9, 10, 13, 11, 11, 13, 12, 12, 10, 12, 12, 9, + 6, 10, 11, 11, 11, 10, 13, 12, 11, 13, 12, 12, 12, 12, 13, 10, + 9, 12, 13, 13, 13, 12, 16, 13, 14, 16, 14, 15, 16, 14, 15, 12, + 8, 12, 13, 13, 13, 13, 16, 14, 13, 16, 13, 14, 14, 14, 14, 12, + 7, 11, 11, 12, 11, 12, 14, 13, 12, 14, 13, 13, 12, 13, 13, 11, + 9, 12, 13, 13, 13, 13, 15, 14, 14, 16, 16, 15, 15, 15, 16, 12, + 11, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 10, 14, 14, 15, 15, 16, 16, 16, 14, 16, 14, 16, 16, 16, 16, 13, + 9, 13, 13, 13, 14, 14, 16, 14, 14, 16, 15, 14, 14, 16, 16, 13, + 9, 13, 14, 14, 11, 13, 16, 14, 13, 16, 15, 16, 13, 14, 15, 12, + 10, 13, 14, 15, 13, 12, 16, 14, 14, 16, 15, 15, 14, 14, 16, 13, + 9, 12, 13, 14, 12, 11, 15, 13, 13, 15, 13, 14, 15, 14, 16, 12, + 11, 15, 16, 16, 14, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 13, + 11, 14, 14, 15, 13, 14, 16, 15, 15, 16, 16, 16, 16, 16, 16, 13, + 10, 12, 13, 14, 13, 13, 16, 14, 14, 14, 14, 16, 15, 14, 16, 13, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 9, 12, 13, 14, 13, 13, 16, 13, 13, 15, 15, 16, 15, 15, 16, 12, + 6, 11, 11, 12, 10, 12, 13, 12, 11, 13, 11, 12, 11, 12, 13, 10, + 9, 12, 13, 13, 13, 13, 16, 14, 14, 15, 14, 14, 14, 14, 14, 12, + 12, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 7, 11, 11, 12, 12, 12, 14, 13, 12, 14, 11, 13, 13, 13, 13, 11, + 8, 12, 12, 13, 12, 13, 14, 13, 13, 14, 13, 13, 13, 14, 14, 11, + 11, 14, 14, 15, 16, 15, 16, 16, 15, 16, 16, 16, 16, 16, 16, 13, + 10, 14, 12, 14, 15, 15, 16, 16, 14, 16, 12, 15, 16, 16, 16, 13, + 11, 14, 13, 15, 15, 15, 16, 16, 14, 16, 14, 14, 16, 16, 16, 13, + 11, 14, 14, 14, 15, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 13, + 7, 11, 12, 11, 10, 12, 14, 13, 12, 14, 13, 13, 10, 12, 13, 10, + 8, 12, 12, 13, 12, 12, 15, 13, 13, 14, 13, 13, 13, 13, 14, 11, + 11, 13, 15, 16, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, + 9, 12, 13, 13, 13, 13, 15, 14, 13, 15, 13, 14, 13, 14, 14, 12, + 7, 11, 11, 11, 11, 11, 13, 12, 11, 13, 11, 12, 11, 12, 12, 10, + 9, 12, 13, 13, 13, 13, 16, 13, 14, 16, 15, 14, 14, 14, 16, 12, + 12, 14, 14, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 14, + 10, 13, 13, 14, 14, 14, 16, 15, 14, 16, 14, 14, 16, 15, 15, 12, + 9, 12, 13, 13, 13, 15, 16, 14, 13, 16, 14, 13, 13, 14, 14, 11, + 10, 14, 15, 14, 12, 14, 16, 15, 13, 16, 16, 16, 12, 14, 16, 12, + 11, 14, 14, 14, 14, 14, 16, 15, 15, 16, 16, 16, 14, 15, 16, 13, + 11, 14, 14, 16, 14, 13, 16, 15, 14, 16, 15, 16, 15, 15, 16, 13, + 12, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 14, + 10, 13, 14, 14, 13, 14, 16, 14, 13, 16, 15, 15, 13, 14, 14, 12, + 9, 12, 13, 14, 13, 12, 16, 14, 13, 16, 14, 14, 14, 14, 15, 12, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, + 9, 12, 13, 13, 13, 13, 14, 13, 12, 15, 14, 14, 14, 14, 14, 11, + 11, 14, 14, 16, 14, 16, 16, 16, 13, 16, 14, 16, 14, 16, 16, 13, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 14, 14, 16, 16, 15, 16, 16, 15, 16, 14, 16, 16, 16, 16, 14, + 12, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 10, 14, 12, 15, 15, 15, 16, 16, 14, 16, 12, 14, 16, 16, 15, 14, + 12, 15, 14, 16, 16, 16, 16, 16, 15, 16, 14, 16, 16, 16, 16, 14, + 12, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 14, + 11, 15, 15, 16, 14, 16, 16, 16, 14, 16, 16, 16, 13, 16, 16, 13, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 11, 15, 14, 16, 14, 14, 16, 15, 14, 16, 15, 16, 15, 16, 16, 12, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, + 12, 16, 15, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 14, + 10, 14, 13, 14, 15, 14, 16, 15, 14, 16, 13, 16, 16, 16, 15, 13, + 10, 14, 14, 14, 13, 14, 16, 15, 15, 16, 14, 14, 14, 16, 16, 12, + 10, 14, 15, 14, 13, 16, 16, 15, 13, 16, 16, 16, 12, 14, 16, 12, + 11, 16, 16, 16, 14, 15, 16, 16, 16, 16, 16, 16, 14, 16, 16, 13, + 12, 15, 14, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 14, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 14, + 11, 14, 14, 14, 14, 15, 16, 14, 14, 16, 16, 16, 13, 15, 15, 12, + 10, 14, 13, 14, 14, 14, 16, 15, 14, 16, 15, 15, 14, 14, 16, 12, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 12, 14, 14, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 13, + 8, 11, 11, 12, 12, 12, 13, 12, 11, 13, 12, 12, 12, 13, 12, 10, + }, + }, + { + { + 5, 6, 6, 6, 6, 6, 7, 6, 6, 7, 6, 6, 6, 6, 6, 4, + 9, 9, 9, 8, 9, 8, 10, 8, 10, 10, 9, 9, 9, 8, 9, 6, + 11, 10, 12, 10, 11, 10, 12, 9, 12, 11, 11, 10, 11, 10, 11, 8, + 9, 10, 9, 8, 10, 10, 10, 9, 9, 10, 8, 8, 9, 9, 8, 7, + 10, 11, 10, 9, 11, 11, 11, 9, 11, 11, 10, 9, 10, 10, 10, 7, + 13, 12, 12, 10, 13, 12, 13, 10, 13, 12, 12, 11, 13, 12, 11, 9, + 11, 12, 10, 10, 12, 12, 11, 10, 11, 12, 10, 10, 11, 11, 10, 8, + 12, 12, 11, 10, 13, 13, 13, 10, 13, 13, 12, 11, 13, 12, 11, 9, + 12, 12, 12, 10, 13, 13, 13, 10, 13, 13, 12, 10, 13, 12, 12, 9, + 9, 9, 10, 10, 9, 8, 10, 9, 9, 10, 9, 9, 8, 8, 9, 6, + 10, 11, 11, 11, 10, 9, 11, 9, 11, 11, 11, 10, 10, 9, 10, 7, + 12, 12, 13, 12, 12, 10, 13, 10, 13, 13, 13, 12, 12, 11, 11, 9, + 11, 12, 11, 11, 11, 11, 11, 10, 11, 12, 10, 10, 10, 10, 10, 8, + 12, 12, 12, 11, 12, 11, 11, 10, 12, 12, 11, 11, 11, 11, 10, 8, + 14, 13, 13, 12, 13, 12, 13, 10, 14, 14, 13, 12, 13, 12, 12, 9, + 13, 14, 13, 12, 13, 13, 13, 12, 13, 13, 12, 12, 12, 12, 11, 9, + 14, 14, 13, 12, 13, 13, 13, 11, 14, 14, 13, 12, 13, 12, 12, 9, + 14, 15, 14, 12, 15, 13, 13, 11, 15, 14, 14, 12, 14, 13, 12, 9, + 11, 11, 12, 12, 10, 10, 12, 11, 11, 12, 11, 11, 10, 10, 10, 8, + 12, 12, 14, 13, 11, 10, 12, 11, 13, 13, 13, 12, 12, 10, 11, 9, + 13, 13, 14, 14, 12, 10, 13, 11, 14, 14, 14, 13, 12, 11, 12, 9, + 13, 13, 13, 13, 12, 13, 13, 12, 13, 14, 12, 12, 12, 12, 11, 9, + 13, 14, 14, 13, 13, 12, 13, 11, 14, 14, 13, 12, 13, 12, 12, 9, + 14, 14, 14, 14, 14, 12, 13, 11, 15, 15, 15, 13, 14, 12, 12, 9, + 14, 15, 15, 13, 14, 14, 13, 12, 13, 14, 13, 13, 12, 12, 11, 10, + 16, 16, 15, 14, 15, 14, 13, 11, 15, 15, 14, 13, 13, 13, 12, 9, + 15, 15, 15, 13, 14, 13, 13, 11, 15, 15, 15, 13, 14, 13, 12, 9, + 8, 9, 9, 9, 9, 9, 10, 9, 8, 10, 9, 9, 8, 8, 9, 7, + 11, 11, 11, 11, 11, 11, 12, 10, 11, 11, 11, 10, 10, 10, 10, 8, + 13, 13, 14, 12, 13, 12, 14, 11, 13, 13, 13, 12, 13, 11, 12, 9, + 10, 11, 10, 11, 11, 11, 12, 10, 10, 11, 10, 10, 10, 10, 10, 8, + 12, 12, 12, 11, 12, 12, 12, 11, 11, 12, 11, 10, 11, 11, 10, 8, + 14, 13, 14, 12, 14, 13, 14, 12, 14, 13, 13, 11, 13, 12, 12, 9, + 12, 13, 12, 12, 13, 13, 13, 12, 12, 13, 11, 11, 12, 12, 11, 9, + 13, 14, 13, 12, 14, 14, 14, 12, 14, 13, 12, 11, 13, 12, 12, 9, + 14, 14, 13, 12, 15, 14, 15, 12, 14, 14, 13, 11, 13, 13, 12, 9, + 10, 11, 11, 11, 10, 10, 12, 10, 10, 11, 10, 10, 9, 9, 10, 7, + 12, 12, 13, 12, 12, 11, 12, 11, 12, 12, 12, 11, 11, 10, 10, 8, + 14, 13, 14, 13, 14, 12, 13, 12, 14, 13, 14, 12, 13, 11, 12, 9, + 12, 13, 12, 12, 12, 12, 12, 11, 11, 12, 11, 10, 10, 10, 10, 8, + 12, 12, 12, 12, 12, 12, 12, 11, 12, 12, 11, 10, 11, 10, 10, 7, + 14, 14, 14, 12, 14, 12, 14, 11, 14, 13, 13, 11, 13, 11, 11, 8, + 13, 15, 13, 13, 14, 14, 14, 12, 13, 14, 12, 12, 12, 12, 11, 9, + 14, 15, 13, 12, 14, 13, 13, 11, 13, 13, 12, 11, 13, 12, 11, 8, + 15, 15, 15, 12, 15, 14, 14, 11, 14, 14, 13, 11, 13, 12, 12, 8, + 12, 13, 13, 13, 12, 12, 13, 12, 12, 13, 12, 12, 11, 11, 11, 9, + 13, 14, 15, 14, 13, 12, 14, 12, 13, 13, 14, 12, 12, 11, 12, 9, + 14, 14, 15, 14, 14, 12, 14, 12, 14, 14, 14, 13, 13, 11, 12, 9, + 13, 14, 14, 14, 13, 13, 14, 13, 13, 13, 12, 12, 12, 12, 11, 9, + 14, 14, 14, 13, 13, 13, 13, 12, 13, 14, 13, 12, 12, 11, 11, 8, + 15, 14, 15, 14, 14, 13, 14, 11, 15, 14, 14, 12, 13, 11, 12, 8, + 14, 15, 14, 14, 15, 14, 14, 13, 14, 15, 13, 13, 12, 12, 11, 10, + 16, 15, 14, 14, 14, 14, 13, 12, 14, 14, 13, 12, 13, 12, 11, 9, + 15, 15, 15, 14, 16, 14, 14, 11, 15, 15, 14, 12, 13, 12, 11, 8, + 11, 12, 11, 12, 12, 12, 12, 11, 10, 11, 10, 10, 10, 10, 10, 8, + 13, 13, 13, 13, 13, 13, 14, 12, 12, 12, 12, 12, 12, 11, 12, 9, + 14, 14, 14, 13, 15, 13, 15, 13, 14, 14, 14, 12, 14, 12, 13, 10, + 12, 13, 12, 13, 13, 13, 13, 12, 11, 12, 11, 11, 12, 11, 11, 9, + 14, 14, 13, 13, 14, 14, 14, 12, 12, 13, 12, 11, 13, 12, 12, 9, + 14, 14, 15, 13, 15, 15, 15, 13, 15, 13, 13, 12, 14, 12, 13, 10, + 13, 15, 12, 13, 14, 14, 14, 13, 12, 13, 11, 11, 13, 12, 11, 10, + 14, 15, 14, 13, 15, 14, 15, 13, 14, 14, 12, 11, 13, 13, 12, 9, + 14, 15, 14, 13, 15, 14, 15, 13, 14, 14, 13, 11, 14, 13, 12, 9, + 12, 13, 13, 13, 12, 13, 13, 12, 11, 12, 12, 11, 11, 11, 11, 9, + 13, 14, 14, 13, 14, 13, 14, 12, 13, 13, 13, 12, 12, 11, 11, 9, + 15, 15, 16, 14, 15, 14, 14, 13, 15, 14, 14, 13, 13, 12, 13, 10, + 13, 14, 14, 13, 13, 14, 14, 13, 12, 13, 12, 12, 11, 11, 11, 9, + 14, 14, 14, 13, 14, 13, 14, 12, 13, 13, 12, 11, 12, 11, 11, 8, + 15, 15, 15, 13, 15, 14, 14, 12, 14, 13, 13, 12, 13, 12, 12, 9, + 14, 15, 14, 14, 15, 15, 14, 13, 13, 14, 12, 12, 13, 12, 12, 9, + 15, 15, 14, 13, 15, 14, 14, 13, 14, 14, 12, 11, 13, 12, 11, 8, + 15, 16, 14, 13, 15, 15, 15, 12, 14, 14, 13, 11, 14, 12, 12, 8, + 12, 14, 13, 13, 13, 13, 14, 12, 12, 13, 12, 12, 10, 11, 11, 9, + 14, 15, 15, 14, 13, 13, 15, 13, 13, 14, 14, 12, 12, 11, 12, 9, + 15, 15, 16, 14, 14, 13, 15, 13, 14, 14, 14, 13, 13, 11, 12, 9, + 14, 15, 14, 14, 14, 14, 14, 13, 13, 14, 13, 12, 12, 12, 11, 9, + 14, 15, 15, 14, 14, 14, 14, 12, 13, 14, 13, 12, 12, 11, 11, 8, + 15, 15, 15, 14, 14, 13, 15, 12, 15, 14, 14, 12, 13, 11, 11, 8, + 14, 16, 14, 14, 14, 15, 14, 13, 13, 14, 12, 12, 12, 12, 11, 9, + 15, 15, 15, 14, 15, 14, 14, 12, 14, 14, 13, 12, 12, 11, 11, 8, + 15, 15, 14, 13, 15, 13, 14, 12, 14, 14, 13, 11, 13, 11, 11, 7, + }, + { + 1, 5, 6, 7, 6, 7, 9, 8, 6, 9, 8, 8, 7, 8, 8, 6, + 5, 8, 10, 10, 10, 11, 13, 12, 11, 13, 12, 12, 12, 12, 13, 10, + 8, 10, 13, 12, 13, 13, 16, 14, 14, 16, 16, 14, 16, 16, 16, 12, + 5, 10, 9, 11, 11, 12, 13, 12, 11, 13, 11, 12, 12, 12, 13, 10, + 6, 10, 11, 11, 11, 12, 14, 12, 11, 13, 13, 13, 12, 13, 13, 11, + 8, 12, 13, 12, 14, 14, 16, 14, 14, 16, 16, 16, 16, 16, 16, 13, + 9, 13, 11, 14, 14, 16, 16, 16, 14, 16, 14, 16, 16, 16, 16, 13, + 9, 13, 13, 13, 14, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 14, + 8, 12, 13, 12, 13, 14, 16, 14, 14, 16, 16, 16, 14, 16, 16, 13, + 5, 10, 11, 12, 9, 11, 13, 12, 11, 13, 13, 13, 11, 12, 13, 10, + 6, 10, 11, 12, 11, 11, 14, 13, 12, 14, 12, 13, 13, 13, 13, 11, + 9, 12, 14, 15, 13, 13, 16, 16, 14, 16, 16, 16, 16, 16, 16, 13, + 8, 13, 13, 14, 13, 14, 16, 16, 14, 16, 14, 16, 14, 16, 14, 13, + 7, 11, 12, 13, 12, 12, 14, 13, 12, 14, 13, 14, 13, 14, 14, 12, + 9, 13, 14, 14, 14, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, + 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 15, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 9, 13, 14, 14, 14, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 14, + 9, 13, 14, 15, 11, 13, 16, 14, 14, 16, 16, 16, 13, 14, 16, 13, + 9, 13, 14, 16, 13, 13, 16, 16, 14, 16, 16, 16, 16, 15, 16, 14, + 8, 12, 13, 16, 13, 12, 16, 14, 13, 16, 14, 16, 16, 16, 16, 13, + 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 14, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 9, 13, 16, 16, 14, 14, 16, 16, 14, 16, 16, 16, 16, 16, 16, 14, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 9, 13, 14, 15, 14, 14, 16, 14, 13, 16, 16, 16, 14, 16, 16, 14, + 6, 11, 11, 12, 11, 12, 14, 13, 11, 14, 12, 13, 12, 13, 13, 11, + 9, 13, 13, 14, 13, 14, 16, 16, 14, 16, 16, 16, 15, 16, 16, 13, + 11, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 7, 11, 11, 13, 12, 13, 16, 14, 12, 16, 12, 14, 14, 14, 14, 12, + 8, 12, 12, 13, 12, 14, 16, 14, 13, 16, 14, 14, 14, 14, 14, 12, + 11, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 10, 14, 13, 16, 16, 16, 16, 16, 14, 16, 14, 16, 16, 16, 16, 16, + 10, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 10, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 7, 11, 12, 12, 11, 13, 16, 14, 12, 15, 14, 14, 11, 13, 13, 12, + 8, 12, 12, 13, 13, 13, 16, 14, 13, 16, 13, 15, 13, 14, 14, 12, + 11, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 8, 12, 13, 14, 13, 14, 16, 16, 14, 16, 14, 16, 14, 16, 15, 13, + 6, 11, 11, 12, 11, 12, 13, 13, 11, 13, 12, 13, 12, 13, 13, 11, + 9, 13, 14, 14, 14, 14, 16, 14, 14, 16, 16, 16, 16, 16, 14, 13, + 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 14, 13, 14, 14, 16, 16, 16, 14, 16, 14, 16, 16, 16, 16, 13, + 9, 13, 14, 13, 13, 16, 16, 14, 13, 16, 16, 16, 13, 16, 14, 13, + 10, 14, 14, 16, 13, 16, 16, 16, 16, 16, 16, 16, 13, 14, 16, 14, + 11, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 10, 14, 16, 16, 14, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 14, 14, 14, 14, 16, 16, 16, 14, 16, 16, 16, 14, 16, 16, 13, + 9, 13, 13, 16, 14, 14, 16, 16, 14, 16, 14, 16, 16, 16, 16, 13, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 9, 13, 14, 14, 13, 16, 16, 14, 13, 16, 14, 16, 14, 14, 16, 12, + 10, 14, 14, 16, 16, 16, 16, 16, 13, 16, 16, 16, 14, 16, 16, 14, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 14, 13, 16, 16, 16, 16, 16, 14, 16, 12, 16, 16, 16, 16, 14, + 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, + 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 14, 16, 16, 14, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, + 11, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 13, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 15, 14, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 14, + 10, 14, 14, 14, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, + 10, 14, 16, 16, 13, 16, 16, 16, 14, 16, 16, 16, 12, 16, 16, 14, + 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, + 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 15, 14, 16, 14, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 13, + 10, 15, 14, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 14, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 8, 12, 12, 13, 12, 14, 14, 14, 12, 16, 13, 14, 12, 14, 14, 11, + }, + }, +}; + + +static const uint8_t rv34_table_intra_cbp[NUM_INTRA_TABLES][8][CBP_VLC_SIZE] = { + { + { 0, 3, 3, 4, 3, 5, 5, 5, 2, 5, 4, 6, 4, 6, 6, 6, }, + { 0, 2, 3, 4, 2, 5, 6, 7, 3, 6, 5, 7, 4, 7, 8, 8, }, + { 0, 3, 4, 4, 3, 4, 5, 5, 3, 5, 4, 5, 4, 5, 5, 3, }, + { 0, 3, 3, 4, 3, 4, 5, 5, 3, 5, 4, 6, 3, 5, 6, 5, }, + { 0, 4, 4, 4, 4, 5, 5, 4, 4, 5, 4, 5, 4, 4, 4, 2, }, + { 0, 3, 3, 4, 3, 4, 5, 5, 3, 5, 4, 5, 4, 5, 5, 4, }, + { 0, 6, 6, 5, 6, 5, 6, 4, 6, 6, 5, 4, 4, 4, 4, 1, }, + { 0, 4, 4, 4, 4, 5, 5, 4, 4, 5, 5, 4, 4, 4, 4, 2, }, + }, + { + { 0, 4, 3, 4, 3, 4, 5, 4, 3, 5, 4, 5, 3, 5, 5, 5, }, + { 0, 2, 3, 4, 2, 5, 6, 7, 3, 6, 5, 7, 4, 7, 8, 8, }, + { 0, 4, 4, 4, 4, 4, 5, 4, 4, 5, 4, 4, 3, 4, 4, 3, }, + { 0, 3, 3, 4, 3, 4, 5, 5, 3, 5, 4, 6, 3, 5, 6, 5, }, + { 0, 4, 4, 4, 4, 4, 5, 4, 4, 5, 5, 5, 4, 4, 4, 2, }, + { 0, 3, 3, 4, 3, 4, 5, 5, 3, 5, 4, 5, 4, 5, 5, 4, }, + { 0, 5, 6, 5, 5, 5, 6, 4, 6, 6, 5, 4, 5, 4, 4, 1, }, + { 0, 4, 4, 4, 4, 4, 5, 4, 4, 5, 5, 4, 4, 4, 5, 2, }, + }, + { + { 0, 3, 3, 4, 3, 4, 4, 5, 3, 5, 4, 5, 4, 5, 5, 5, }, + { 0, 2, 3, 4, 2, 4, 6, 7, 3, 6, 5, 7, 5, 7, 8, 8, }, + { 0, 4, 4, 4, 4, 4, 5, 4, 3, 5, 4, 4, 4, 4, 4, 3, }, + { 0, 3, 3, 4, 3, 3, 6, 6, 3, 6, 4, 6, 3, 6, 6, 5, }, + { 0, 4, 4, 4, 3, 4, 5, 4, 4, 5, 4, 4, 4, 4, 4, 3, }, + { 0, 3, 3, 4, 3, 4, 5, 5, 3, 5, 4, 5, 4, 5, 5, 4, }, + { 0, 5, 5, 5, 5, 5, 6, 4, 5, 6, 5, 5, 5, 4, 4, 1, }, + { 0, 4, 4, 4, 4, 4, 6, 4, 4, 6, 5, 4, 4, 4, 4, 2, }, + }, + { + { 0, 3, 3, 4, 3, 4, 4, 5, 3, 5, 4, 5, 4, 5, 5, 5, }, + { 0, 2, 3, 4, 2, 4, 7, 6, 3, 7, 5, 7, 5, 7, 7, 7, }, + { 0, 3, 3, 4, 3, 4, 5, 5, 3, 5, 4, 5, 4, 5, 5, 4, }, + { 0, 3, 3, 3, 3, 4, 6, 6, 3, 6, 4, 6, 3, 6, 6, 5, }, + { 0, 3, 4, 4, 3, 4, 5, 4, 4, 5, 4, 5, 4, 5, 4, 3, }, + { 0, 3, 3, 4, 3, 4, 5, 5, 3, 5, 4, 5, 4, 5, 5, 4, }, + { 0, 4, 5, 4, 4, 4, 5, 4, 4, 5, 5, 4, 4, 4, 4, 2, }, + { 0, 4, 4, 4, 4, 5, 5, 4, 4, 5, 5, 4, 4, 4, 4, 2, }, + }, + { + { 0, 3, 3, 4, 3, 4, 5, 6, 2, 5, 4, 7, 4, 6, 6, 7, }, + { 0, 2, 3, 4, 2, 4, 6, 7, 3, 7, 5, 7, 5, 7, 7, 7, }, + { 0, 3, 3, 4, 3, 4, 5, 5, 3, 5, 4, 5, 4, 5, 5, 4, }, + { 0, 2, 3, 4, 3, 4, 6, 5, 3, 6, 4, 6, 4, 6, 6, 6, }, + { 0, 3, 3, 4, 3, 4, 5, 5, 3, 5, 4, 5, 4, 5, 5, 4, }, + { 0, 3, 3, 4, 3, 4, 5, 5, 3, 5, 4, 5, 4, 5, 5, 4, }, + { 0, 4, 4, 4, 4, 5, 5, 4, 4, 5, 5, 4, 4, 4, 4, 2, }, + { 0, 3, 4, 4, 4, 4, 5, 4, 4, 5, 4, 4, 4, 4, 4, 3, }, + }, +}; + + +static const uint8_t rv34_table_intra_firstpat[NUM_INTRA_TABLES][4][FIRSTBLK_VLC_SIZE] = { + { + { + 0, 10, 5, 10, 7, 12, 9, 11, 8, 13, 9, 12, 10, 13, 11, 12, + 16, 16, 14, 15, 15, 16, 13, 14, 5, 12, 6, 11, 9, 13, 10, 11, + 9, 14, 9, 12, 11, 14, 11, 12, 16, 16, 14, 15, 15, 16, 13, 13, + 10, 15, 9, 12, 12, 16, 11, 12, 12, 16, 10, 13, 13, 16, 11, 12, + 16, 16, 13, 14, 15, 16, 13, 12, 6, 12, 8, 11, 8, 12, 10, 11, + 9, 14, 10, 12, 10, 13, 11, 12, 15, 16, 14, 15, 14, 16, 13, 13, + 8, 13, 9, 12, 10, 13, 10, 12, 10, 14, 9, 12, 11, 14, 10, 12, + 15, 16, 13, 15, 14, 16, 13, 13, 11, 16, 10, 13, 13, 16, 11, 12, + 12, 16, 11, 13, 13, 16, 11, 12, 16, 16, 13, 14, 15, 16, 12, 12, + 10, 16, 12, 14, 10, 14, 11, 12, 12, 16, 13, 14, 11, 14, 12, 12, + 16, 16, 15, 16, 14, 15, 13, 13, 11, 16, 12, 14, 11, 14, 11, 12, + 12, 16, 12, 14, 11, 14, 11, 12, 16, 16, 14, 15, 13, 15, 13, 12, + 14, 16, 13, 14, 13, 16, 12, 12, 14, 16, 13, 14, 13, 16, 12, 12, + 16, 16, 14, 14, 14, 15, 12, 11, 2, 10, 6, 10, 7, 12, 9, 11, + 8, 12, 9, 11, 10, 13, 10, 11, 15, 16, 14, 15, 14, 16, 13, 13, + 5, 12, 6, 11, 9, 13, 10, 11, 9, 13, 9, 11, 10, 13, 10, 11, + 15, 16, 13, 14, 14, 16, 13, 13, 9, 15, 8, 12, 12, 15, 11, 11, + 11, 16, 10, 12, 13, 15, 11, 11, 15, 16, 13, 14, 15, 16, 12, 12, + 6, 12, 8, 11, 8, 12, 9, 11, 9, 14, 9, 12, 10, 13, 10, 11, + 15, 16, 14, 15, 14, 16, 13, 13, 7, 13, 8, 11, 9, 13, 10, 11, + 9, 14, 9, 12, 10, 13, 10, 11, 14, 16, 13, 14, 13, 16, 12, 12, + 11, 16, 10, 12, 12, 15, 11, 11, 11, 16, 10, 12, 12, 15, 11, 11, + 15, 16, 12, 13, 14, 16, 12, 11, 9, 15, 11, 13, 9, 13, 11, 12, + 11, 16, 12, 14, 10, 14, 11, 12, 16, 16, 14, 15, 13, 15, 12, 12, + 11, 16, 11, 14, 10, 14, 11, 12, 11, 16, 12, 13, 11, 14, 11, 11, + 15, 16, 14, 15, 13, 14, 12, 12, 13, 16, 12, 14, 13, 15, 11, 11, + 13, 16, 12, 14, 13, 15, 11, 11, 16, 16, 13, 14, 13, 15, 11, 10, + 5, 12, 7, 11, 8, 13, 10, 11, 9, 13, 9, 12, 10, 14, 11, 12, + 16, 16, 14, 15, 14, 16, 13, 13, 7, 13, 7, 11, 9, 13, 10, 11, + 9, 14, 9, 12, 11, 14, 11, 12, 16, 16, 14, 14, 14, 16, 13, 13, + 9, 15, 8, 12, 12, 15, 11, 12, 11, 16, 10, 12, 13, 16, 11, 12, + 16, 16, 13, 14, 15, 16, 12, 12, 7, 13, 8, 12, 9, 13, 10, 11, + 10, 14, 10, 12, 10, 14, 11, 12, 16, 16, 14, 15, 14, 16, 13, 13, + 8, 14, 9, 12, 10, 13, 10, 11, 9, 14, 9, 12, 10, 14, 10, 11, + 15, 16, 13, 14, 14, 16, 12, 12, 11, 16, 10, 12, 12, 15, 11, 12, + 11, 16, 10, 12, 12, 15, 11, 11, 15, 16, 12, 14, 14, 16, 12, 11, + 10, 16, 11, 13, 9, 14, 11, 12, 12, 16, 12, 14, 11, 14, 11, 12, + 16, 16, 14, 16, 14, 15, 13, 12, 11, 16, 11, 14, 10, 14, 11, 12, + 11, 16, 12, 14, 11, 14, 11, 11, 15, 16, 14, 15, 13, 15, 12, 12, + 13, 16, 12, 14, 13, 15, 11, 11, 13, 16, 12, 14, 12, 14, 11, 11, + 15, 16, 12, 13, 13, 14, 11, 10, 6, 13, 8, 11, 9, 13, 10, 11, + 10, 14, 10, 12, 10, 13, 10, 11, 15, 16, 13, 13, 13, 14, 12, 11, + 7, 13, 8, 11, 9, 13, 9, 11, 10, 14, 9, 11, 10, 13, 10, 11, + 15, 16, 13, 13, 13, 14, 11, 11, 9, 14, 8, 11, 10, 13, 9, 10, + 11, 15, 9, 11, 11, 13, 9, 10, 15, 16, 12, 13, 13, 14, 10, 9, + 7, 13, 8, 11, 9, 13, 9, 11, 10, 14, 10, 12, 10, 13, 10, 11, + 15, 16, 13, 13, 13, 14, 11, 11, 8, 13, 8, 11, 9, 13, 9, 10, + 9, 14, 9, 11, 10, 13, 9, 10, 14, 16, 12, 13, 13, 14, 11, 10, + 9, 14, 8, 11, 10, 13, 9, 9, 10, 14, 8, 11, 10, 13, 9, 9, + 14, 16, 11, 12, 12, 14, 10, 9, 9, 14, 9, 12, 8, 12, 9, 10, + 11, 15, 10, 12, 10, 13, 9, 10, 15, 16, 13, 13, 12, 13, 11, 10, + 9, 14, 9, 12, 9, 12, 9, 10, 10, 14, 10, 12, 9, 12, 9, 9, + 14, 16, 12, 13, 11, 13, 10, 9, 10, 14, 9, 11, 10, 12, 8, 8, + 10, 14, 9, 11, 10, 12, 8, 8, 12, 14, 9, 10, 10, 11, 8, 7, + }, + { + 0, 9, 6, 9, 6, 10, 8, 9, 7, 11, 8, 11, 9, 11, 9, 10, + 14, 16, 13, 14, 13, 14, 12, 11, 5, 11, 7, 10, 8, 10, 8, 9, + 8, 12, 8, 11, 9, 12, 9, 10, 14, 16, 12, 13, 13, 14, 11, 11, + 10, 14, 9, 11, 11, 13, 10, 10, 11, 15, 9, 11, 12, 13, 10, 10, + 15, 16, 12, 12, 13, 14, 11, 9, 6, 11, 7, 10, 7, 10, 8, 9, + 8, 12, 9, 11, 9, 11, 9, 10, 14, 16, 13, 13, 13, 14, 11, 11, + 7, 12, 8, 11, 8, 11, 9, 9, 9, 13, 9, 11, 9, 12, 9, 10, + 14, 16, 12, 13, 12, 14, 11, 10, 11, 14, 10, 12, 11, 13, 10, 10, + 12, 15, 10, 12, 12, 13, 10, 10, 15, 16, 12, 12, 13, 14, 10, 9, + 10, 14, 11, 13, 9, 12, 10, 10, 11, 15, 12, 13, 10, 12, 10, 10, + 14, 16, 13, 14, 12, 13, 11, 10, 11, 14, 11, 13, 10, 12, 10, 10, + 12, 15, 11, 13, 10, 12, 10, 10, 15, 16, 13, 13, 12, 13, 11, 9, + 13, 16, 12, 13, 12, 13, 10, 9, 14, 16, 12, 13, 12, 13, 10, 9, + 16, 16, 12, 12, 13, 13, 10, 7, 4, 10, 6, 9, 7, 10, 8, 9, + 8, 12, 9, 11, 9, 11, 9, 9, 14, 16, 13, 13, 13, 14, 11, 11, + 6, 11, 7, 10, 8, 11, 8, 9, 9, 12, 9, 11, 9, 12, 9, 9, + 14, 16, 12, 13, 13, 14, 11, 10, 10, 14, 9, 11, 11, 13, 9, 9, + 11, 14, 9, 11, 11, 13, 10, 9, 14, 16, 11, 12, 13, 14, 10, 9, + 6, 11, 8, 10, 7, 10, 8, 9, 9, 12, 9, 11, 9, 11, 9, 9, + 14, 16, 13, 13, 12, 13, 11, 10, 8, 12, 8, 10, 8, 11, 9, 9, + 9, 12, 9, 11, 9, 11, 9, 9, 14, 16, 12, 13, 12, 13, 11, 10, + 11, 14, 10, 11, 11, 13, 9, 9, 11, 14, 10, 11, 11, 13, 9, 9, + 14, 16, 11, 12, 13, 14, 10, 8, 10, 14, 11, 12, 9, 12, 10, 10, + 11, 14, 11, 13, 10, 12, 10, 10, 14, 16, 13, 14, 12, 13, 11, 9, + 11, 14, 11, 12, 10, 12, 10, 10, 11, 14, 11, 12, 10, 12, 10, 9, + 14, 16, 13, 13, 11, 12, 10, 9, 13, 16, 12, 13, 12, 13, 10, 9, + 13, 16, 11, 12, 11, 13, 10, 8, 15, 16, 12, 12, 12, 12, 9, 7, + 8, 12, 8, 11, 9, 12, 9, 10, 10, 14, 10, 12, 11, 13, 10, 10, + 16, 16, 14, 14, 14, 14, 12, 11, 8, 13, 8, 11, 9, 12, 10, 10, + 11, 14, 10, 12, 11, 13, 10, 10, 16, 16, 13, 14, 14, 14, 12, 11, + 11, 14, 9, 12, 11, 13, 10, 10, 12, 15, 10, 12, 12, 14, 10, 10, + 15, 16, 12, 12, 14, 14, 11, 9, 9, 13, 9, 11, 9, 12, 10, 10, + 11, 14, 10, 12, 10, 12, 10, 10, 15, 16, 14, 14, 13, 14, 12, 11, + 9, 13, 9, 11, 10, 12, 10, 10, 10, 14, 10, 12, 10, 12, 10, 10, + 15, 16, 13, 13, 13, 14, 11, 10, 11, 15, 10, 12, 11, 13, 10, 10, + 11, 15, 10, 12, 12, 13, 10, 9, 15, 16, 11, 12, 13, 14, 10, 9, + 11, 15, 11, 13, 10, 12, 10, 10, 12, 16, 12, 13, 11, 13, 10, 10, + 16, 16, 14, 14, 12, 13, 11, 9, 11, 15, 11, 13, 10, 13, 10, 10, + 12, 15, 12, 13, 10, 12, 10, 10, 14, 16, 13, 13, 12, 13, 10, 9, + 13, 16, 12, 13, 12, 13, 10, 9, 13, 16, 11, 12, 11, 13, 10, 9, + 14, 16, 11, 12, 12, 12, 9, 7, 10, 15, 10, 12, 11, 13, 10, 10, + 12, 16, 12, 13, 12, 13, 11, 10, 16, 16, 14, 14, 14, 15, 12, 10, + 10, 14, 10, 12, 10, 13, 10, 10, 12, 15, 11, 12, 11, 13, 10, 10, + 16, 16, 14, 13, 14, 14, 11, 9, 11, 14, 10, 11, 11, 12, 9, 9, + 12, 15, 10, 11, 11, 13, 9, 8, 16, 16, 12, 12, 13, 13, 10, 7, + 10, 15, 10, 12, 10, 13, 10, 10, 12, 15, 11, 12, 11, 13, 10, 10, + 16, 16, 14, 13, 14, 14, 11, 9, 10, 14, 10, 12, 10, 12, 10, 10, + 12, 15, 11, 12, 11, 13, 10, 10, 16, 16, 13, 13, 13, 14, 11, 9, + 11, 14, 10, 11, 10, 12, 9, 8, 11, 14, 9, 11, 11, 12, 9, 8, + 14, 16, 10, 11, 12, 13, 9, 7, 11, 15, 11, 12, 10, 12, 10, 9, + 13, 16, 11, 12, 11, 12, 10, 9, 16, 16, 13, 13, 12, 13, 10, 7, + 11, 15, 10, 12, 10, 12, 9, 8, 12, 15, 11, 12, 10, 12, 9, 8, + 14, 16, 12, 12, 11, 12, 9, 7, 11, 14, 10, 11, 10, 12, 8, 7, + 11, 14, 9, 10, 10, 11, 8, 6, 12, 15, 9, 9, 9, 10, 7, 4, + }, + { + 0, 6, 3, 7, 3, 7, 6, 7, 5, 9, 6, 9, 7, 9, 8, 8, + 16, 16, 16, 16, 16, 16, 16, 11, 3, 8, 5, 8, 6, 8, 7, 7, + 7, 11, 7, 10, 8, 10, 8, 9, 16, 16, 16, 16, 16, 16, 14, 10, + 8, 16, 7, 11, 10, 16, 9, 9, 11, 16, 9, 14, 16, 16, 10, 9, + 16, 16, 16, 16, 16, 16, 16, 10, 3, 8, 5, 8, 5, 8, 7, 7, + 7, 11, 8, 10, 8, 10, 8, 9, 16, 16, 16, 16, 16, 16, 16, 11, + 6, 10, 7, 9, 7, 10, 8, 8, 8, 11, 8, 10, 8, 11, 8, 8, + 16, 16, 16, 16, 16, 16, 11, 10, 10, 16, 9, 13, 11, 16, 10, 9, + 11, 16, 9, 11, 16, 16, 10, 9, 16, 16, 11, 16, 16, 16, 11, 9, + 9, 16, 10, 11, 8, 11, 9, 9, 11, 16, 12, 16, 10, 16, 10, 10, + 16, 16, 16, 16, 16, 16, 16, 10, 10, 16, 11, 16, 10, 16, 10, 10, + 11, 16, 11, 16, 10, 16, 10, 9, 16, 16, 16, 16, 16, 16, 11, 9, + 16, 16, 16, 16, 16, 16, 11, 9, 16, 16, 16, 16, 16, 16, 11, 9, + 16, 16, 11, 16, 16, 16, 9, 7, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + }, + { + 2, 8, 5, 9, 6, 9, 8, 8, 8, 12, 9, 11, 9, 11, 10, 10, + 16, 16, 14, 16, 14, 16, 14, 12, 5, 10, 6, 9, 8, 10, 8, 9, + 9, 12, 9, 11, 10, 12, 10, 10, 16, 16, 14, 15, 15, 16, 13, 12, + 10, 13, 9, 12, 11, 12, 10, 10, 12, 15, 11, 12, 12, 13, 11, 10, + 16, 16, 15, 14, 15, 16, 13, 12, 6, 10, 8, 10, 7, 10, 8, 9, + 9, 13, 10, 11, 10, 12, 10, 10, 16, 16, 14, 16, 14, 16, 13, 12, + 7, 11, 8, 11, 9, 11, 9, 9, 10, 13, 10, 11, 10, 12, 10, 9, + 16, 16, 14, 14, 14, 15, 12, 11, 11, 14, 11, 12, 11, 13, 10, 10, + 12, 15, 11, 13, 12, 13, 11, 10, 16, 16, 14, 16, 15, 15, 13, 11, + 10, 13, 11, 12, 10, 12, 10, 10, 12, 15, 12, 13, 11, 13, 11, 11, + 16, 16, 15, 16, 14, 15, 13, 11, 11, 14, 11, 13, 11, 12, 11, 10, + 12, 16, 12, 13, 12, 13, 11, 10, 16, 16, 15, 16, 13, 15, 12, 11, + 13, 15, 12, 13, 13, 14, 11, 11, 14, 16, 13, 13, 13, 14, 11, 11, + 16, 16, 15, 14, 15, 15, 12, 10, 3, 8, 6, 9, 7, 9, 8, 8, + 8, 12, 9, 11, 9, 11, 9, 9, 16, 16, 15, 15, 15, 16, 13, 12, + 6, 10, 7, 9, 8, 10, 8, 8, 9, 12, 9, 11, 10, 12, 10, 9, + 16, 16, 14, 14, 14, 15, 13, 11, 10, 13, 9, 11, 11, 12, 10, 10, + 12, 14, 11, 12, 12, 13, 11, 10, 16, 16, 14, 14, 15, 15, 13, 11, + 6, 10, 8, 10, 7, 10, 8, 9, 10, 12, 10, 11, 10, 11, 10, 9, + 16, 16, 14, 15, 14, 15, 13, 11, 8, 11, 8, 10, 9, 11, 9, 9, + 9, 13, 9, 11, 10, 11, 9, 9, 16, 16, 13, 14, 14, 14, 12, 10, + 11, 14, 10, 12, 11, 12, 10, 10, 12, 14, 11, 12, 12, 13, 10, 10, + 16, 16, 13, 14, 15, 15, 12, 10, 10, 13, 11, 12, 10, 12, 10, 10, + 12, 14, 12, 13, 11, 13, 11, 10, 16, 16, 15, 14, 14, 14, 12, 11, + 11, 14, 11, 12, 10, 12, 10, 10, 12, 15, 12, 12, 11, 13, 10, 10, + 16, 16, 14, 15, 13, 14, 12, 10, 13, 15, 12, 13, 12, 13, 11, 10, + 13, 16, 12, 13, 12, 13, 11, 10, 16, 16, 13, 14, 13, 15, 11, 9, + 6, 10, 8, 10, 8, 11, 9, 10, 11, 13, 11, 12, 11, 13, 11, 10, + 16, 16, 16, 16, 16, 16, 13, 12, 8, 11, 9, 11, 9, 11, 10, 10, + 11, 14, 11, 12, 11, 12, 11, 10, 16, 16, 15, 15, 16, 16, 13, 12, + 11, 14, 10, 12, 12, 13, 11, 10, 13, 16, 12, 13, 13, 14, 11, 11, + 16, 16, 15, 16, 16, 16, 13, 12, 8, 12, 9, 11, 9, 11, 10, 10, + 11, 14, 11, 12, 11, 12, 11, 10, 16, 16, 16, 16, 16, 16, 13, 12, + 9, 12, 10, 11, 10, 12, 10, 10, 11, 14, 11, 12, 11, 13, 10, 10, + 16, 16, 15, 14, 15, 15, 13, 11, 12, 14, 11, 13, 12, 13, 11, 10, + 12, 15, 11, 12, 13, 13, 11, 10, 16, 16, 14, 15, 16, 15, 13, 11, + 11, 15, 12, 13, 11, 13, 11, 10, 13, 16, 13, 14, 12, 14, 11, 11, + 16, 16, 16, 16, 15, 15, 13, 12, 12, 14, 12, 13, 11, 13, 11, 10, + 13, 15, 12, 13, 11, 13, 11, 10, 16, 16, 15, 15, 13, 15, 13, 11, + 13, 16, 13, 13, 13, 13, 12, 11, 13, 16, 13, 13, 13, 13, 11, 10, + 16, 16, 13, 15, 14, 14, 12, 9, 9, 13, 10, 12, 11, 13, 11, 11, + 13, 16, 13, 14, 13, 14, 12, 11, 16, 16, 16, 16, 16, 16, 14, 12, + 10, 14, 11, 13, 11, 13, 11, 10, 13, 16, 13, 13, 13, 14, 12, 11, + 16, 16, 16, 16, 16, 16, 14, 12, 11, 15, 11, 13, 12, 13, 11, 10, + 14, 16, 12, 13, 13, 14, 12, 10, 16, 16, 15, 16, 16, 16, 13, 11, + 10, 14, 11, 12, 11, 13, 11, 10, 13, 16, 12, 13, 12, 14, 12, 11, + 16, 16, 16, 16, 16, 16, 14, 12, 11, 14, 11, 12, 11, 13, 11, 10, + 13, 15, 12, 13, 12, 13, 11, 10, 16, 16, 15, 15, 16, 16, 13, 11, + 12, 15, 12, 13, 12, 13, 11, 10, 13, 16, 12, 13, 13, 13, 11, 10, + 16, 16, 14, 14, 16, 15, 13, 10, 12, 15, 12, 13, 12, 13, 11, 10, + 14, 16, 13, 14, 13, 14, 12, 11, 16, 16, 16, 16, 15, 16, 13, 11, + 12, 16, 12, 13, 12, 13, 11, 10, 13, 16, 13, 13, 12, 14, 11, 10, + 16, 16, 15, 16, 14, 15, 13, 10, 12, 15, 12, 14, 12, 13, 11, 10, + 13, 16, 12, 13, 12, 13, 11, 10, 16, 16, 13, 14, 13, 14, 11, 8, + }, + }, + { + { + 0, 11, 5, 11, 7, 13, 10, 12, 7, 13, 9, 13, 10, 14, 12, 13, + 16, 16, 15, 16, 16, 16, 15, 15, 4, 13, 6, 12, 10, 14, 11, 12, + 8, 14, 9, 13, 11, 15, 12, 13, 16, 16, 15, 16, 15, 16, 15, 14, + 9, 16, 9, 13, 13, 16, 12, 13, 12, 16, 10, 14, 14, 16, 13, 13, + 16, 16, 14, 16, 16, 16, 14, 14, 5, 13, 8, 13, 8, 13, 11, 12, + 9, 14, 10, 13, 10, 14, 12, 13, 16, 16, 15, 16, 15, 16, 14, 15, + 7, 14, 9, 13, 10, 14, 11, 13, 9, 15, 10, 13, 11, 14, 12, 13, + 16, 16, 14, 16, 15, 16, 14, 14, 11, 16, 11, 14, 13, 16, 12, 13, + 12, 16, 11, 14, 14, 16, 12, 13, 16, 16, 14, 15, 16, 16, 14, 13, + 10, 16, 12, 15, 10, 15, 12, 14, 12, 16, 13, 16, 11, 15, 13, 14, + 16, 16, 16, 16, 14, 16, 14, 14, 11, 16, 12, 15, 11, 16, 12, 13, + 12, 16, 13, 15, 12, 16, 12, 13, 16, 16, 16, 16, 14, 16, 14, 14, + 14, 16, 13, 15, 14, 16, 13, 13, 14, 16, 14, 15, 14, 16, 13, 13, + 16, 16, 15, 16, 15, 16, 13, 13, 2, 12, 6, 11, 7, 13, 10, 12, + 7, 13, 9, 12, 10, 14, 11, 12, 16, 16, 15, 16, 15, 16, 14, 15, + 5, 13, 6, 12, 9, 13, 10, 12, 8, 14, 9, 13, 11, 14, 11, 13, + 16, 16, 14, 16, 15, 16, 14, 14, 9, 16, 8, 13, 12, 16, 11, 13, + 11, 16, 10, 13, 13, 16, 12, 13, 16, 16, 13, 15, 16, 16, 13, 13, + 5, 13, 8, 12, 7, 13, 10, 12, 8, 14, 10, 13, 10, 14, 11, 13, + 16, 16, 14, 16, 15, 16, 14, 14, 7, 14, 8, 12, 9, 14, 11, 12, + 8, 14, 9, 13, 10, 14, 11, 12, 15, 16, 14, 15, 14, 16, 13, 14, + 11, 16, 10, 13, 13, 16, 12, 13, 11, 16, 10, 13, 13, 16, 12, 13, + 16, 16, 13, 15, 15, 16, 13, 13, 9, 16, 12, 15, 9, 14, 11, 13, + 11, 16, 13, 15, 11, 14, 12, 13, 16, 16, 15, 16, 14, 16, 14, 14, + 11, 16, 12, 14, 11, 15, 12, 13, 11, 16, 12, 14, 11, 15, 12, 13, + 16, 16, 15, 16, 14, 16, 13, 13, 13, 16, 13, 15, 13, 16, 12, 13, + 14, 16, 13, 15, 13, 16, 12, 12, 16, 16, 14, 15, 14, 16, 12, 12, + 4, 13, 7, 12, 8, 14, 11, 12, 9, 14, 10, 13, 11, 14, 12, 13, + 16, 16, 15, 16, 16, 16, 15, 15, 6, 14, 7, 12, 10, 14, 11, 12, + 9, 15, 10, 13, 11, 15, 12, 13, 16, 16, 15, 16, 16, 16, 14, 14, + 9, 16, 8, 13, 12, 16, 11, 13, 12, 16, 10, 14, 13, 16, 12, 13, + 16, 16, 14, 16, 16, 16, 14, 14, 6, 14, 8, 13, 8, 14, 11, 13, + 9, 15, 10, 13, 11, 14, 12, 13, 16, 16, 15, 16, 16, 16, 14, 14, + 7, 15, 9, 13, 10, 14, 11, 13, 9, 15, 10, 13, 11, 14, 11, 13, + 16, 16, 14, 16, 15, 16, 14, 14, 10, 16, 10, 13, 12, 16, 12, 13, + 11, 16, 10, 13, 13, 16, 12, 13, 16, 16, 13, 14, 15, 16, 13, 13, + 9, 16, 12, 14, 9, 14, 11, 13, 12, 16, 12, 15, 11, 15, 12, 13, + 16, 16, 16, 16, 15, 16, 14, 14, 10, 16, 12, 15, 11, 15, 12, 13, + 11, 16, 12, 14, 11, 15, 12, 13, 16, 16, 14, 16, 13, 16, 13, 13, + 13, 16, 13, 15, 13, 16, 12, 13, 13, 16, 12, 14, 13, 16, 12, 12, + 15, 16, 13, 14, 13, 16, 12, 12, 6, 14, 8, 13, 9, 14, 10, 12, + 10, 15, 10, 12, 11, 14, 11, 12, 16, 16, 14, 14, 14, 16, 13, 13, + 7, 15, 8, 13, 9, 14, 10, 12, 10, 15, 10, 13, 11, 14, 11, 12, + 16, 16, 14, 14, 14, 16, 13, 12, 9, 16, 8, 12, 11, 14, 10, 11, + 11, 16, 10, 13, 11, 14, 10, 11, 16, 16, 13, 14, 14, 16, 12, 11, + 7, 14, 9, 13, 9, 14, 10, 12, 10, 16, 10, 13, 11, 14, 11, 12, + 16, 16, 14, 14, 14, 15, 13, 12, 7, 14, 9, 13, 9, 14, 10, 12, + 9, 14, 10, 12, 10, 14, 11, 12, 15, 16, 13, 14, 14, 15, 12, 12, + 9, 15, 9, 12, 11, 14, 10, 11, 10, 15, 9, 12, 11, 14, 10, 11, + 14, 16, 11, 13, 13, 15, 11, 11, 9, 16, 10, 13, 9, 14, 10, 11, + 11, 16, 11, 13, 10, 14, 10, 11, 16, 16, 14, 15, 13, 15, 12, 12, + 9, 16, 10, 13, 9, 13, 10, 11, 10, 15, 10, 13, 10, 13, 10, 11, + 14, 16, 13, 14, 12, 14, 11, 11, 11, 16, 10, 13, 11, 13, 9, 10, + 11, 14, 10, 12, 10, 13, 9, 9, 13, 15, 10, 11, 11, 12, 9, 8, + }, + { + 0, 10, 5, 10, 6, 11, 8, 10, 7, 12, 8, 11, 9, 12, 9, 10, + 14, 16, 13, 13, 13, 14, 12, 11, 5, 12, 6, 10, 8, 12, 9, 10, + 8, 13, 8, 11, 9, 12, 9, 10, 14, 16, 12, 13, 13, 14, 11, 11, + 9, 15, 8, 12, 11, 14, 10, 10, 11, 16, 9, 12, 12, 14, 10, 10, + 14, 16, 11, 12, 13, 14, 11, 10, 5, 12, 8, 11, 7, 11, 9, 10, + 8, 13, 9, 11, 9, 12, 9, 10, 14, 16, 12, 13, 13, 14, 11, 11, + 7, 13, 8, 11, 9, 12, 9, 10, 9, 13, 9, 11, 9, 12, 9, 10, + 14, 16, 12, 13, 12, 13, 11, 10, 11, 15, 10, 12, 12, 14, 10, 10, + 12, 16, 10, 12, 12, 14, 10, 10, 14, 16, 11, 12, 13, 14, 10, 9, + 10, 15, 11, 13, 9, 13, 10, 10, 11, 15, 12, 13, 10, 12, 10, 10, + 14, 16, 13, 14, 12, 13, 11, 10, 11, 16, 11, 13, 10, 13, 10, 10, + 11, 16, 11, 13, 10, 13, 10, 10, 14, 16, 13, 14, 12, 13, 11, 9, + 13, 16, 12, 13, 12, 14, 11, 10, 14, 16, 12, 13, 12, 14, 10, 9, + 16, 16, 12, 13, 13, 13, 10, 8, 3, 11, 6, 10, 7, 11, 9, 10, + 8, 12, 8, 11, 9, 12, 9, 10, 14, 16, 13, 13, 13, 14, 11, 11, + 5, 12, 6, 10, 8, 12, 9, 10, 8, 13, 8, 11, 9, 12, 9, 10, + 14, 16, 12, 13, 13, 14, 11, 10, 9, 14, 8, 11, 11, 14, 10, 10, + 11, 15, 9, 11, 12, 14, 10, 10, 14, 16, 11, 12, 13, 14, 11, 9, + 6, 12, 8, 11, 7, 11, 9, 10, 8, 13, 9, 11, 9, 12, 9, 10, + 14, 16, 12, 13, 13, 13, 11, 10, 7, 13, 8, 11, 8, 12, 9, 10, + 9, 13, 9, 11, 9, 12, 9, 9, 14, 16, 12, 13, 12, 13, 11, 10, + 10, 15, 9, 12, 11, 14, 10, 10, 11, 15, 9, 11, 11, 13, 10, 9, + 14, 16, 11, 12, 13, 14, 10, 9, 9, 15, 11, 13, 9, 12, 10, 10, + 11, 15, 11, 13, 9, 12, 10, 10, 14, 16, 13, 14, 12, 13, 11, 10, + 10, 15, 11, 13, 10, 13, 10, 10, 11, 15, 11, 13, 10, 12, 10, 10, + 14, 16, 12, 13, 11, 12, 10, 9, 13, 16, 12, 13, 12, 14, 10, 9, + 13, 16, 11, 12, 12, 13, 10, 9, 14, 16, 11, 12, 12, 13, 9, 8, + 7, 13, 8, 12, 9, 13, 10, 11, 10, 14, 10, 12, 11, 13, 11, 11, + 16, 16, 13, 14, 14, 14, 12, 11, 8, 14, 8, 12, 9, 13, 10, 10, + 10, 14, 10, 12, 11, 13, 10, 10, 16, 16, 13, 13, 14, 14, 12, 11, + 10, 15, 9, 12, 11, 14, 10, 10, 12, 16, 10, 12, 12, 14, 10, 10, + 16, 16, 12, 13, 14, 15, 11, 10, 8, 14, 9, 12, 9, 13, 10, 11, + 10, 15, 10, 12, 10, 13, 10, 11, 16, 16, 13, 14, 14, 14, 12, 11, + 8, 14, 9, 12, 9, 13, 10, 10, 10, 14, 10, 12, 10, 13, 10, 10, + 15, 16, 13, 13, 13, 14, 11, 10, 10, 15, 10, 12, 12, 14, 10, 10, + 11, 16, 9, 12, 12, 14, 10, 10, 14, 16, 11, 12, 13, 14, 10, 9, + 11, 16, 11, 13, 10, 13, 10, 10, 12, 16, 12, 13, 10, 13, 11, 10, + 15, 16, 14, 14, 12, 13, 11, 10, 11, 16, 11, 13, 10, 13, 10, 10, + 11, 16, 12, 13, 10, 12, 10, 10, 14, 16, 13, 14, 11, 13, 11, 9, + 13, 16, 12, 13, 12, 14, 10, 10, 12, 16, 11, 12, 12, 13, 10, 9, + 14, 16, 11, 12, 11, 12, 9, 8, 10, 16, 10, 13, 11, 14, 11, 11, + 12, 16, 11, 13, 12, 14, 11, 11, 16, 16, 14, 13, 14, 14, 12, 10, + 10, 15, 10, 13, 10, 13, 10, 11, 12, 16, 11, 13, 11, 13, 11, 10, + 16, 16, 14, 13, 14, 14, 12, 10, 11, 15, 9, 12, 11, 13, 10, 9, + 12, 16, 10, 12, 12, 13, 10, 9, 16, 16, 12, 12, 13, 14, 10, 8, + 10, 16, 10, 13, 10, 14, 11, 11, 12, 16, 11, 13, 12, 14, 11, 10, + 16, 16, 14, 13, 14, 14, 12, 10, 9, 15, 9, 12, 10, 13, 10, 10, + 11, 16, 10, 12, 11, 13, 10, 10, 16, 16, 13, 13, 13, 14, 11, 9, + 10, 15, 9, 11, 11, 13, 9, 9, 11, 15, 9, 11, 11, 13, 9, 8, + 14, 16, 10, 11, 13, 13, 10, 8, 11, 16, 11, 13, 10, 13, 10, 9, + 13, 16, 11, 13, 11, 13, 10, 9, 16, 16, 13, 13, 13, 13, 10, 8, + 11, 16, 10, 12, 10, 13, 10, 9, 11, 16, 11, 12, 10, 12, 9, 9, + 15, 16, 12, 13, 11, 12, 10, 8, 11, 16, 10, 12, 11, 12, 9, 8, + 11, 15, 9, 11, 10, 12, 9, 7, 13, 15, 9, 9, 10, 10, 7, 5, + }, + { + 0, 7, 3, 8, 4, 9, 7, 8, 5, 10, 7, 10, 8, 11, 8, 9, + 16, 16, 16, 16, 16, 16, 11, 10, 2, 10, 4, 9, 7, 10, 7, 8, + 7, 16, 7, 10, 9, 16, 8, 9, 16, 16, 16, 16, 16, 16, 11, 10, + 8, 16, 7, 10, 10, 16, 9, 8, 10, 16, 9, 11, 16, 16, 9, 9, + 16, 16, 16, 16, 16, 16, 11, 9, 3, 10, 6, 9, 6, 11, 8, 8, + 7, 16, 8, 10, 9, 16, 9, 9, 16, 16, 16, 16, 16, 16, 11, 10, + 5, 16, 7, 10, 8, 11, 8, 8, 8, 16, 8, 10, 9, 16, 8, 8, + 16, 16, 11, 16, 16, 16, 10, 9, 9, 16, 9, 11, 11, 16, 9, 9, + 11, 16, 9, 11, 11, 16, 9, 8, 16, 16, 10, 16, 16, 16, 10, 9, + 8, 16, 10, 16, 8, 16, 10, 9, 12, 16, 11, 16, 10, 16, 10, 9, + 16, 16, 16, 16, 16, 16, 12, 10, 10, 16, 11, 16, 10, 16, 10, 9, + 11, 16, 11, 16, 10, 16, 10, 9, 16, 16, 16, 16, 16, 16, 11, 9, + 16, 16, 16, 16, 16, 16, 10, 9, 16, 16, 11, 16, 16, 16, 10, 9, + 16, 16, 10, 11, 11, 16, 9, 7, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + }, + { + 2, 9, 6, 9, 6, 10, 8, 9, 8, 12, 9, 11, 9, 12, 10, 10, + 16, 16, 14, 14, 15, 15, 13, 12, 5, 11, 7, 10, 8, 11, 9, 9, + 9, 13, 9, 11, 10, 12, 10, 10, 15, 16, 14, 14, 14, 16, 12, 11, + 10, 14, 9, 11, 11, 13, 10, 10, 12, 15, 10, 12, 12, 13, 11, 10, + 16, 16, 14, 15, 14, 15, 12, 11, 5, 11, 8, 10, 7, 11, 9, 9, + 9, 13, 9, 12, 9, 12, 10, 10, 15, 16, 13, 14, 13, 16, 12, 11, + 7, 12, 8, 11, 9, 11, 9, 10, 9, 13, 9, 11, 10, 12, 9, 9, + 16, 16, 13, 14, 13, 14, 11, 11, 10, 14, 10, 12, 11, 13, 10, 10, + 11, 16, 11, 12, 12, 13, 10, 10, 16, 16, 13, 14, 13, 14, 12, 11, + 10, 14, 11, 13, 10, 13, 10, 11, 12, 16, 12, 13, 10, 12, 11, 11, + 16, 16, 14, 15, 13, 14, 12, 11, 11, 15, 11, 13, 11, 13, 10, 10, + 12, 15, 12, 13, 11, 13, 11, 10, 15, 16, 14, 15, 13, 15, 12, 11, + 12, 16, 12, 13, 12, 14, 11, 11, 13, 16, 12, 13, 12, 14, 11, 10, + 16, 16, 13, 14, 13, 14, 11, 10, 3, 10, 6, 9, 7, 10, 8, 9, + 9, 12, 9, 11, 10, 12, 9, 10, 15, 16, 14, 14, 14, 14, 12, 11, + 6, 11, 7, 10, 8, 10, 9, 9, 9, 13, 9, 11, 10, 12, 9, 9, + 15, 16, 13, 14, 14, 15, 12, 11, 10, 14, 9, 11, 11, 12, 10, 10, + 12, 14, 10, 12, 11, 13, 10, 10, 15, 16, 13, 14, 14, 16, 12, 11, + 6, 11, 8, 10, 7, 11, 9, 9, 9, 13, 9, 11, 9, 12, 9, 9, + 15, 16, 14, 14, 13, 14, 12, 11, 7, 11, 8, 11, 8, 11, 9, 9, + 9, 12, 9, 11, 9, 12, 9, 9, 15, 16, 13, 13, 13, 14, 11, 10, + 10, 13, 10, 12, 11, 13, 10, 10, 11, 15, 10, 12, 11, 13, 10, 10, + 14, 16, 12, 13, 13, 14, 11, 10, 10, 14, 11, 12, 9, 12, 10, 10, + 11, 15, 11, 13, 10, 13, 10, 10, 15, 16, 14, 14, 13, 14, 12, 11, + 10, 14, 10, 12, 10, 12, 10, 10, 11, 15, 11, 12, 10, 12, 10, 10, + 15, 16, 13, 14, 12, 14, 11, 10, 12, 16, 11, 13, 12, 14, 11, 10, + 12, 16, 12, 13, 11, 13, 10, 10, 15, 16, 12, 14, 12, 14, 11, 9, + 7, 12, 9, 11, 9, 12, 10, 10, 11, 14, 11, 12, 11, 13, 11, 11, + 16, 16, 15, 16, 15, 16, 13, 12, 8, 12, 9, 11, 9, 12, 10, 10, + 11, 14, 11, 12, 11, 13, 10, 10, 16, 16, 14, 15, 15, 16, 13, 12, + 11, 14, 10, 12, 11, 13, 10, 10, 12, 16, 11, 13, 12, 14, 11, 10, + 16, 16, 14, 15, 14, 16, 12, 11, 8, 13, 9, 11, 9, 12, 10, 10, + 11, 14, 11, 12, 11, 13, 10, 10, 16, 16, 15, 15, 14, 15, 13, 12, + 9, 13, 9, 12, 9, 12, 10, 10, 11, 14, 10, 12, 10, 12, 10, 10, + 16, 16, 14, 15, 14, 14, 12, 11, 11, 15, 11, 12, 11, 13, 11, 10, + 12, 16, 11, 12, 12, 13, 11, 10, 16, 16, 13, 15, 14, 15, 11, 11, + 11, 16, 11, 13, 10, 13, 11, 11, 12, 16, 12, 14, 11, 13, 11, 11, + 16, 16, 14, 15, 14, 15, 13, 11, 11, 16, 11, 13, 11, 13, 11, 10, + 12, 16, 12, 13, 10, 13, 11, 10, 16, 16, 14, 14, 12, 14, 12, 10, + 12, 16, 12, 14, 12, 14, 11, 11, 13, 16, 12, 14, 12, 14, 11, 10, + 15, 16, 12, 14, 12, 14, 11, 9, 9, 14, 11, 13, 11, 13, 11, 11, + 13, 16, 12, 14, 13, 14, 12, 11, 16, 16, 16, 16, 16, 16, 14, 12, + 9, 14, 10, 12, 10, 13, 11, 11, 12, 16, 12, 13, 13, 14, 11, 11, + 16, 16, 16, 16, 16, 14, 13, 12, 10, 15, 11, 13, 11, 14, 11, 10, + 13, 16, 12, 13, 12, 15, 11, 10, 16, 16, 14, 16, 15, 16, 13, 11, + 10, 14, 10, 13, 11, 14, 11, 11, 13, 16, 12, 13, 12, 14, 11, 11, + 16, 16, 16, 16, 15, 16, 13, 12, 10, 14, 10, 12, 10, 13, 10, 11, + 12, 15, 12, 13, 12, 13, 11, 10, 16, 16, 14, 14, 15, 15, 13, 11, + 11, 16, 11, 13, 11, 14, 11, 10, 12, 16, 11, 13, 12, 14, 11, 10, + 16, 16, 13, 14, 14, 15, 12, 10, 11, 16, 12, 13, 11, 14, 11, 10, + 13, 16, 13, 14, 12, 14, 11, 11, 16, 16, 15, 16, 15, 15, 12, 11, + 11, 16, 12, 13, 11, 14, 11, 10, 13, 16, 12, 13, 11, 14, 11, 10, + 16, 16, 14, 15, 13, 14, 12, 10, 12, 16, 12, 14, 12, 14, 10, 10, + 12, 16, 11, 13, 11, 14, 10, 10, 14, 16, 11, 13, 12, 13, 10, 8, + }, + }, + { + { + 0, 12, 6, 13, 7, 14, 11, 14, 8, 14, 10, 14, 11, 15, 13, 15, + 16, 16, 16, 16, 16, 16, 16, 16, 5, 14, 7, 13, 10, 16, 12, 14, + 9, 16, 10, 14, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 9, 14, 14, 16, 13, 16, 12, 16, 11, 16, 16, 16, 14, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 5, 14, 9, 14, 8, 14, 12, 14, + 9, 16, 11, 14, 11, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 8, 16, 10, 14, 11, 16, 12, 14, 10, 16, 11, 15, 12, 16, 13, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 12, 16, 14, 16, 14, 16, + 13, 16, 12, 16, 15, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 13, 16, 11, 16, 14, 16, 13, 16, 14, 16, 13, 16, 14, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 14, 16, 13, 16, 14, 16, + 13, 16, 14, 16, 13, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 15, 16, 16, 16, 14, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 1, 12, 6, 12, 8, 14, 11, 13, + 8, 14, 10, 13, 11, 14, 13, 14, 16, 16, 16, 16, 16, 16, 16, 16, + 5, 14, 7, 13, 10, 14, 11, 14, 9, 16, 10, 14, 12, 16, 13, 15, + 16, 16, 16, 16, 16, 16, 16, 16, 9, 16, 9, 14, 13, 16, 13, 14, + 12, 16, 11, 15, 14, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 5, 14, 9, 13, 8, 14, 12, 14, 9, 16, 11, 14, 11, 16, 13, 14, + 16, 16, 16, 16, 16, 16, 16, 16, 7, 15, 9, 14, 10, 16, 12, 14, + 9, 16, 10, 14, 11, 16, 12, 14, 16, 16, 16, 16, 16, 16, 15, 16, + 11, 16, 11, 15, 14, 16, 13, 15, 12, 16, 11, 15, 14, 16, 13, 14, + 16, 16, 14, 16, 16, 16, 14, 16, 10, 16, 13, 16, 10, 16, 13, 16, + 12, 16, 14, 16, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 16, 13, 16, 12, 16, 13, 16, 12, 16, 13, 16, 12, 16, 13, 16, + 16, 16, 16, 16, 16, 16, 15, 16, 14, 16, 14, 16, 16, 16, 14, 16, + 15, 16, 14, 16, 14, 16, 14, 16, 16, 16, 16, 16, 16, 16, 14, 14, + 4, 14, 8, 13, 9, 16, 12, 14, 9, 16, 11, 14, 11, 16, 13, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 6, 15, 8, 13, 10, 16, 12, 14, + 10, 16, 11, 14, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 9, 16, 9, 14, 13, 16, 13, 15, 12, 16, 11, 16, 14, 16, 13, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 6, 16, 9, 14, 9, 16, 12, 14, + 10, 16, 11, 15, 12, 16, 13, 15, 16, 16, 16, 16, 16, 16, 16, 16, + 8, 16, 10, 14, 11, 16, 12, 14, 10, 16, 11, 14, 12, 16, 13, 15, + 16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 11, 15, 14, 16, 13, 15, + 12, 16, 11, 15, 14, 16, 13, 14, 16, 16, 14, 16, 16, 16, 14, 16, + 10, 16, 13, 16, 10, 16, 13, 15, 13, 16, 14, 16, 12, 16, 14, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 13, 16, 12, 16, 13, 16, + 12, 16, 13, 16, 11, 16, 13, 16, 16, 16, 16, 16, 15, 16, 15, 16, + 14, 16, 14, 16, 15, 16, 14, 16, 14, 16, 14, 16, 14, 16, 14, 14, + 16, 16, 14, 16, 15, 16, 14, 14, 6, 16, 9, 14, 10, 16, 12, 14, + 10, 16, 11, 13, 12, 16, 13, 14, 16, 16, 16, 16, 16, 16, 14, 14, + 7, 16, 9, 14, 10, 16, 12, 13, 11, 16, 11, 14, 12, 16, 12, 14, + 16, 16, 16, 16, 16, 16, 14, 14, 9, 16, 9, 14, 12, 16, 11, 13, + 12, 16, 11, 14, 12, 16, 12, 13, 16, 16, 14, 16, 16, 16, 13, 14, + 7, 16, 10, 14, 10, 16, 12, 14, 11, 16, 11, 14, 11, 16, 12, 14, + 16, 16, 16, 16, 16, 16, 14, 14, 8, 16, 10, 14, 10, 16, 11, 13, + 10, 16, 11, 13, 11, 16, 12, 13, 16, 16, 14, 16, 16, 16, 14, 14, + 10, 16, 9, 13, 12, 16, 11, 13, 11, 16, 10, 13, 12, 16, 11, 12, + 16, 16, 13, 15, 15, 16, 13, 13, 9, 16, 11, 14, 9, 16, 11, 13, + 12, 16, 12, 16, 12, 16, 12, 13, 16, 16, 16, 16, 15, 16, 14, 14, + 10, 16, 11, 14, 10, 16, 11, 13, 11, 16, 12, 14, 10, 15, 11, 13, + 16, 16, 15, 16, 13, 16, 13, 13, 12, 16, 11, 13, 12, 16, 11, 12, + 12, 16, 11, 13, 11, 14, 11, 11, 13, 16, 12, 13, 12, 14, 11, 11, + }, + { + 0, 10, 5, 10, 6, 11, 8, 10, 7, 12, 8, 11, 8, 12, 9, 10, + 14, 16, 13, 13, 13, 14, 12, 11, 4, 12, 6, 10, 8, 12, 9, 10, + 8, 13, 8, 11, 9, 12, 9, 10, 14, 16, 12, 13, 13, 14, 11, 11, + 9, 15, 8, 12, 12, 14, 10, 11, 11, 16, 9, 12, 12, 14, 10, 10, + 14, 16, 11, 13, 13, 15, 11, 11, 4, 12, 8, 11, 6, 11, 9, 10, + 8, 13, 9, 11, 8, 12, 9, 10, 14, 16, 12, 13, 13, 14, 11, 11, + 7, 13, 8, 11, 9, 12, 9, 10, 8, 13, 9, 11, 9, 12, 9, 10, + 14, 16, 12, 13, 12, 13, 11, 10, 11, 16, 10, 12, 12, 14, 10, 11, + 11, 16, 10, 12, 12, 14, 10, 10, 15, 16, 11, 13, 13, 14, 11, 10, + 10, 16, 11, 13, 9, 13, 10, 11, 11, 15, 12, 13, 10, 12, 10, 11, + 15, 16, 13, 14, 12, 13, 11, 11, 11, 16, 11, 13, 10, 13, 10, 11, + 12, 16, 11, 13, 10, 13, 10, 10, 15, 16, 13, 14, 12, 13, 11, 10, + 13, 16, 12, 13, 13, 14, 11, 11, 14, 16, 12, 13, 12, 14, 11, 10, + 16, 16, 13, 13, 13, 14, 11, 9, 3, 11, 6, 10, 6, 11, 9, 10, + 8, 12, 8, 11, 9, 12, 9, 10, 14, 16, 13, 13, 13, 13, 12, 11, + 5, 12, 6, 10, 8, 12, 9, 10, 8, 13, 8, 11, 9, 12, 9, 10, + 14, 16, 12, 13, 13, 14, 11, 11, 9, 15, 8, 11, 11, 14, 10, 10, + 11, 15, 9, 11, 12, 14, 10, 10, 14, 16, 11, 12, 13, 14, 11, 10, + 5, 12, 8, 11, 7, 11, 9, 10, 8, 13, 9, 11, 9, 12, 9, 10, + 14, 16, 12, 13, 13, 13, 11, 11, 7, 13, 8, 11, 8, 12, 9, 10, + 8, 13, 8, 11, 9, 12, 9, 9, 13, 16, 11, 13, 12, 13, 11, 10, + 10, 15, 9, 12, 11, 14, 10, 10, 11, 15, 9, 11, 11, 13, 10, 10, + 14, 16, 11, 12, 13, 14, 10, 10, 9, 16, 11, 13, 9, 12, 10, 10, + 11, 16, 11, 13, 9, 12, 10, 10, 15, 16, 13, 14, 12, 13, 11, 10, + 11, 16, 11, 13, 10, 13, 10, 10, 11, 15, 11, 13, 9, 12, 10, 10, + 14, 16, 12, 13, 11, 13, 10, 10, 13, 16, 12, 13, 12, 14, 11, 10, + 13, 16, 11, 13, 12, 13, 10, 10, 14, 16, 11, 12, 12, 13, 10, 9, + 7, 14, 8, 12, 9, 13, 10, 11, 10, 14, 10, 12, 11, 13, 11, 11, + 16, 16, 14, 14, 14, 14, 12, 12, 7, 14, 8, 12, 9, 13, 10, 11, + 10, 14, 10, 12, 11, 13, 10, 11, 16, 16, 13, 13, 14, 14, 12, 11, + 10, 15, 9, 12, 12, 14, 10, 10, 12, 16, 9, 12, 12, 14, 10, 10, + 16, 16, 12, 13, 14, 15, 12, 11, 8, 14, 9, 12, 9, 13, 10, 11, + 10, 15, 10, 12, 10, 13, 10, 11, 16, 16, 14, 14, 14, 14, 12, 11, + 8, 14, 9, 12, 9, 13, 10, 11, 10, 14, 10, 12, 10, 13, 10, 10, + 15, 16, 13, 13, 13, 14, 12, 11, 10, 15, 10, 12, 12, 14, 10, 10, + 11, 16, 9, 12, 12, 14, 10, 10, 14, 16, 11, 12, 13, 14, 11, 10, + 11, 16, 11, 14, 9, 13, 10, 11, 12, 16, 12, 14, 10, 13, 11, 11, + 16, 16, 14, 15, 13, 14, 12, 11, 11, 16, 12, 14, 10, 13, 11, 11, + 11, 16, 11, 13, 10, 13, 10, 10, 15, 16, 13, 14, 12, 13, 11, 10, + 13, 16, 12, 14, 13, 14, 11, 10, 12, 16, 11, 13, 12, 13, 10, 10, + 14, 16, 11, 12, 11, 13, 10, 9, 10, 16, 10, 13, 11, 14, 11, 11, + 12, 16, 11, 13, 12, 14, 11, 11, 16, 16, 14, 13, 14, 15, 12, 11, + 10, 16, 10, 13, 10, 14, 11, 11, 12, 16, 11, 13, 11, 14, 11, 11, + 16, 16, 14, 13, 14, 14, 12, 11, 11, 15, 9, 12, 11, 14, 10, 10, + 13, 16, 10, 12, 12, 14, 10, 10, 16, 16, 13, 13, 14, 14, 11, 10, + 10, 16, 10, 13, 11, 14, 11, 11, 12, 16, 11, 13, 12, 14, 11, 11, + 16, 16, 14, 14, 14, 14, 12, 11, 9, 16, 10, 13, 10, 14, 11, 11, + 11, 15, 11, 12, 11, 13, 11, 11, 16, 16, 13, 13, 14, 14, 12, 10, + 10, 15, 9, 12, 11, 14, 10, 10, 11, 16, 9, 11, 11, 13, 10, 9, + 15, 16, 11, 12, 13, 14, 10, 9, 11, 16, 11, 13, 10, 13, 10, 10, + 13, 16, 12, 13, 11, 13, 10, 10, 16, 16, 14, 14, 13, 13, 11, 10, + 11, 16, 11, 13, 10, 13, 10, 10, 12, 16, 11, 13, 10, 13, 10, 10, + 15, 16, 13, 13, 12, 13, 11, 9, 11, 16, 11, 12, 11, 13, 10, 9, + 11, 15, 10, 11, 11, 12, 9, 8, 13, 15, 10, 10, 10, 11, 8, 7, + }, + { + 0, 9, 3, 8, 5, 9, 7, 8, 5, 11, 6, 9, 8, 11, 8, 9, + 16, 16, 16, 16, 16, 16, 11, 10, 2, 10, 4, 9, 7, 10, 7, 8, + 7, 16, 7, 10, 9, 11, 8, 9, 16, 16, 11, 16, 16, 16, 11, 10, + 7, 16, 7, 10, 10, 16, 8, 9, 10, 16, 8, 10, 11, 16, 9, 9, + 16, 16, 16, 16, 16, 16, 11, 10, 3, 11, 6, 9, 6, 11, 8, 8, + 7, 16, 8, 10, 8, 11, 8, 9, 16, 16, 15, 16, 16, 16, 11, 10, + 5, 11, 7, 9, 8, 11, 8, 8, 7, 16, 7, 10, 8, 11, 8, 8, + 16, 16, 11, 16, 16, 16, 10, 9, 9, 16, 8, 11, 11, 16, 9, 9, + 10, 16, 8, 11, 11, 16, 9, 9, 16, 16, 10, 16, 16, 16, 10, 9, + 8, 16, 10, 11, 8, 16, 9, 9, 11, 16, 11, 16, 10, 16, 10, 9, + 16, 16, 16, 16, 16, 16, 11, 10, 9, 16, 10, 16, 10, 16, 9, 9, + 10, 16, 10, 16, 9, 16, 9, 9, 16, 16, 16, 16, 15, 16, 10, 9, + 16, 16, 11, 16, 16, 16, 10, 10, 13, 16, 11, 16, 11, 16, 10, 9, + 16, 16, 10, 11, 11, 16, 9, 8, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + }, + { + 1, 10, 6, 10, 7, 11, 9, 10, 8, 12, 9, 12, 9, 12, 10, 10, + 16, 16, 14, 16, 14, 15, 13, 12, 5, 12, 7, 10, 9, 11, 9, 10, + 9, 13, 9, 12, 10, 13, 10, 10, 16, 16, 14, 15, 14, 14, 13, 12, + 10, 15, 10, 12, 12, 14, 11, 11, 12, 16, 11, 13, 12, 14, 11, 11, + 16, 16, 14, 16, 15, 16, 13, 12, 6, 12, 8, 11, 8, 11, 10, 10, + 9, 13, 10, 12, 10, 12, 10, 10, 15, 16, 13, 15, 13, 14, 12, 12, + 7, 13, 9, 11, 9, 12, 10, 10, 9, 14, 10, 12, 10, 13, 10, 10, + 15, 16, 13, 15, 13, 14, 12, 11, 11, 15, 11, 13, 12, 14, 11, 11, + 12, 16, 11, 13, 12, 14, 11, 11, 16, 16, 13, 15, 14, 16, 12, 11, + 10, 16, 12, 14, 10, 13, 11, 11, 12, 16, 12, 14, 11, 13, 11, 11, + 16, 16, 15, 16, 14, 16, 13, 12, 11, 16, 12, 14, 11, 14, 11, 11, + 12, 16, 12, 14, 11, 14, 11, 11, 16, 16, 14, 15, 13, 15, 12, 12, + 13, 16, 13, 15, 13, 15, 12, 12, 13, 16, 12, 15, 12, 15, 11, 11, + 16, 16, 13, 16, 13, 15, 12, 11, 4, 11, 7, 10, 7, 11, 9, 10, + 9, 13, 9, 12, 10, 12, 10, 10, 15, 16, 14, 15, 14, 15, 13, 12, + 6, 12, 7, 11, 9, 11, 9, 10, 9, 13, 9, 12, 10, 12, 10, 10, + 15, 16, 14, 15, 14, 15, 12, 12, 10, 15, 9, 12, 12, 13, 11, 11, + 12, 15, 11, 13, 12, 14, 11, 11, 16, 16, 13, 15, 14, 16, 12, 12, + 6, 12, 8, 11, 8, 11, 9, 10, 9, 14, 10, 12, 10, 12, 10, 10, + 14, 16, 13, 14, 13, 14, 12, 12, 8, 13, 9, 11, 9, 12, 10, 10, + 9, 13, 9, 12, 9, 12, 9, 10, 14, 16, 13, 14, 13, 14, 12, 11, + 11, 15, 11, 13, 11, 14, 11, 11, 12, 16, 10, 13, 12, 13, 11, 10, + 15, 16, 12, 15, 13, 16, 12, 11, 10, 15, 11, 13, 10, 13, 11, 11, + 12, 16, 12, 14, 11, 13, 11, 11, 16, 16, 14, 15, 13, 16, 13, 12, + 11, 16, 11, 14, 11, 13, 11, 11, 12, 16, 12, 14, 10, 13, 11, 11, + 15, 16, 13, 16, 12, 14, 12, 11, 12, 16, 12, 14, 12, 15, 11, 11, + 13, 16, 12, 14, 12, 14, 11, 11, 15, 16, 13, 15, 13, 15, 11, 10, + 7, 13, 9, 12, 10, 13, 11, 11, 11, 15, 12, 13, 12, 13, 11, 11, + 16, 16, 15, 16, 16, 16, 14, 13, 8, 13, 9, 12, 10, 13, 11, 11, + 12, 15, 11, 13, 12, 13, 11, 11, 16, 16, 14, 15, 15, 16, 13, 12, + 11, 16, 11, 13, 12, 14, 11, 11, 13, 16, 12, 14, 13, 15, 12, 11, + 16, 16, 14, 16, 15, 16, 13, 12, 9, 15, 10, 13, 10, 13, 11, 11, + 12, 15, 11, 13, 11, 13, 11, 11, 16, 16, 14, 16, 16, 16, 13, 12, + 9, 14, 10, 13, 10, 13, 11, 11, 11, 14, 11, 13, 11, 13, 11, 11, + 16, 16, 14, 16, 14, 16, 12, 12, 11, 16, 11, 14, 12, 14, 12, 11, + 12, 16, 11, 13, 13, 14, 11, 11, 16, 16, 13, 15, 14, 16, 12, 11, + 12, 16, 12, 14, 11, 14, 11, 11, 13, 16, 13, 14, 12, 15, 12, 11, + 16, 16, 16, 16, 14, 16, 13, 12, 12, 16, 12, 14, 11, 14, 12, 11, + 12, 16, 12, 15, 11, 14, 11, 11, 16, 16, 14, 16, 13, 15, 12, 12, + 13, 16, 13, 16, 13, 16, 12, 12, 13, 16, 12, 15, 12, 16, 11, 11, + 14, 16, 12, 15, 12, 15, 11, 10, 9, 16, 11, 14, 12, 14, 12, 12, + 13, 16, 13, 15, 14, 16, 12, 12, 16, 16, 16, 16, 16, 16, 14, 13, + 10, 16, 11, 14, 12, 14, 12, 12, 13, 16, 13, 14, 13, 16, 12, 12, + 16, 16, 15, 16, 16, 16, 13, 12, 11, 16, 11, 14, 12, 15, 12, 11, + 13, 16, 12, 14, 13, 16, 12, 11, 16, 16, 14, 16, 16, 16, 13, 12, + 11, 16, 11, 14, 12, 14, 12, 12, 13, 16, 12, 15, 13, 16, 12, 12, + 16, 16, 16, 16, 16, 16, 14, 13, 10, 16, 11, 14, 11, 15, 11, 11, + 13, 16, 12, 14, 12, 14, 12, 11, 16, 16, 14, 16, 16, 16, 13, 12, + 11, 16, 11, 15, 12, 15, 12, 11, 13, 16, 11, 14, 13, 15, 12, 11, + 16, 16, 13, 16, 14, 16, 12, 11, 12, 16, 12, 15, 11, 15, 12, 11, + 14, 16, 13, 15, 12, 16, 12, 11, 16, 16, 15, 16, 14, 16, 13, 12, + 11, 16, 12, 15, 11, 15, 11, 11, 13, 16, 13, 16, 11, 15, 11, 11, + 16, 16, 14, 16, 13, 15, 12, 11, 12, 16, 12, 15, 12, 16, 11, 11, + 12, 16, 11, 15, 12, 14, 11, 11, 13, 16, 12, 13, 11, 13, 10, 9, + }, + }, + { + { + 0, 13, 6, 13, 8, 14, 12, 16, 8, 16, 11, 16, 12, 16, 14, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 4, 16, 7, 14, 11, 16, 13, 16, + 9, 16, 11, 16, 12, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 10, 16, 16, 16, 16, 16, 13, 16, 12, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 5, 16, 10, 16, 8, 16, 13, 16, + 10, 16, 12, 16, 12, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 8, 16, 10, 16, 11, 16, 13, 16, 10, 16, 12, 16, 12, 16, 14, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 12, 16, 16, 16, 16, 16, + 14, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 16, 16, 16, 11, 16, 16, 16, 13, 16, 16, 16, 13, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 13, 16, 16, 16, + 14, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 1, 13, 7, 13, 8, 16, 12, 16, + 8, 16, 10, 16, 11, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 4, 16, 7, 14, 10, 16, 12, 16, 9, 16, 10, 16, 12, 16, 14, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 10, 16, 9, 16, 14, 16, 14, 16, + 13, 16, 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 5, 16, 9, 16, 8, 16, 12, 16, 9, 16, 11, 16, 11, 16, 13, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 7, 16, 10, 16, 11, 16, 13, 16, + 9, 16, 11, 16, 11, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 12, 16, 16, 16, 14, 16, 13, 16, 12, 16, 16, 16, 14, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 10, 16, 13, 16, 11, 16, 14, 16, + 13, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 14, 16, 13, 16, 14, 16, 13, 16, 14, 16, 13, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 4, 16, 8, 16, 9, 16, 13, 16, 10, 16, 11, 16, 12, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 6, 16, 8, 16, 11, 16, 13, 16, + 10, 16, 11, 16, 13, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 9, 16, 9, 16, 13, 16, 13, 16, 13, 16, 12, 16, 16, 16, 14, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 6, 16, 10, 16, 10, 16, 13, 16, + 10, 16, 12, 16, 12, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 8, 16, 10, 16, 11, 16, 13, 16, 10, 16, 11, 16, 12, 16, 14, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 11, 16, 16, 16, 14, 16, + 12, 16, 11, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 13, 16, 10, 16, 13, 16, 13, 16, 16, 16, 13, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 13, 16, 12, 16, 14, 16, + 12, 16, 15, 16, 12, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 6, 16, 10, 16, 10, 16, 13, 16, + 11, 16, 11, 16, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 8, 16, 9, 16, 11, 16, 12, 16, 11, 16, 11, 16, 12, 16, 13, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 9, 16, 9, 16, 12, 16, 12, 16, + 13, 16, 11, 16, 13, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 8, 16, 10, 16, 10, 16, 12, 16, 11, 16, 12, 16, 12, 16, 13, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 8, 16, 10, 16, 11, 16, 12, 16, + 10, 16, 11, 16, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 10, 14, 12, 16, 12, 16, 11, 16, 10, 14, 13, 16, 12, 14, + 16, 16, 14, 16, 16, 16, 14, 16, 9, 16, 12, 16, 10, 16, 12, 16, + 13, 16, 13, 16, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 12, 16, 11, 16, 12, 16, 11, 16, 12, 16, 11, 16, 12, 15, + 16, 16, 16, 16, 16, 16, 16, 16, 13, 16, 12, 16, 13, 16, 12, 13, + 12, 16, 12, 16, 12, 16, 12, 13, 16, 16, 13, 14, 13, 16, 13, 13, + }, + { + 0, 10, 5, 10, 5, 10, 8, 10, 6, 11, 8, 11, 8, 11, 9, 10, + 14, 16, 13, 14, 13, 14, 12, 12, 4, 12, 5, 10, 8, 12, 9, 10, + 7, 12, 8, 11, 9, 12, 9, 10, 14, 16, 12, 13, 13, 14, 12, 12, + 9, 16, 8, 12, 12, 14, 10, 11, 11, 16, 9, 12, 12, 14, 11, 11, + 14, 16, 12, 13, 14, 15, 12, 12, 4, 12, 7, 11, 6, 11, 9, 10, + 8, 12, 9, 11, 8, 11, 9, 10, 14, 16, 12, 14, 13, 14, 12, 12, + 7, 13, 8, 11, 8, 12, 9, 10, 8, 13, 8, 11, 9, 12, 9, 10, + 14, 16, 12, 13, 12, 13, 11, 11, 11, 16, 10, 12, 12, 14, 11, 11, + 12, 16, 10, 12, 12, 14, 11, 11, 16, 16, 12, 13, 14, 15, 12, 11, + 10, 16, 11, 14, 9, 13, 10, 11, 11, 16, 12, 14, 10, 13, 11, 11, + 15, 16, 13, 14, 13, 14, 12, 12, 11, 16, 12, 14, 10, 13, 11, 11, + 12, 16, 12, 14, 11, 13, 11, 11, 15, 16, 13, 14, 13, 14, 12, 11, + 14, 16, 13, 14, 13, 15, 12, 12, 14, 16, 12, 14, 13, 15, 11, 11, + 16, 16, 13, 14, 14, 15, 12, 11, 3, 11, 5, 10, 6, 11, 9, 10, + 7, 12, 8, 11, 9, 11, 9, 10, 14, 16, 13, 13, 13, 14, 12, 12, + 5, 12, 6, 10, 8, 12, 9, 10, 8, 13, 8, 11, 9, 12, 9, 10, + 14, 16, 12, 13, 13, 14, 12, 12, 9, 16, 8, 11, 11, 14, 10, 11, + 11, 16, 9, 12, 12, 14, 10, 11, 15, 16, 12, 13, 14, 15, 12, 11, + 5, 12, 7, 11, 6, 11, 9, 10, 8, 13, 9, 11, 8, 11, 9, 10, + 14, 16, 12, 14, 13, 13, 12, 12, 7, 13, 8, 11, 8, 12, 9, 10, + 8, 12, 8, 11, 9, 12, 9, 10, 13, 16, 12, 13, 12, 13, 11, 11, + 10, 16, 9, 12, 12, 14, 10, 11, 11, 15, 9, 12, 12, 14, 10, 11, + 14, 16, 11, 13, 13, 14, 11, 11, 9, 16, 11, 14, 8, 13, 10, 11, + 11, 16, 12, 13, 10, 13, 10, 11, 16, 16, 13, 15, 13, 14, 12, 12, + 11, 16, 11, 14, 10, 13, 10, 11, 11, 16, 11, 13, 10, 13, 10, 11, + 14, 16, 13, 14, 12, 13, 11, 11, 14, 16, 12, 14, 13, 15, 11, 11, + 13, 16, 12, 13, 12, 14, 11, 11, 14, 16, 12, 13, 12, 13, 11, 10, + 6, 14, 8, 12, 9, 13, 10, 11, 10, 14, 10, 12, 11, 13, 11, 12, + 16, 16, 14, 14, 14, 14, 13, 12, 7, 14, 8, 12, 9, 13, 10, 11, + 10, 14, 10, 12, 11, 13, 11, 11, 16, 16, 13, 14, 14, 15, 13, 12, + 10, 16, 8, 12, 12, 14, 10, 11, 12, 16, 10, 12, 13, 15, 11, 11, + 16, 16, 13, 14, 15, 16, 12, 12, 8, 15, 9, 13, 9, 13, 10, 11, + 10, 15, 10, 13, 10, 13, 11, 11, 16, 16, 14, 14, 14, 14, 13, 12, + 8, 15, 9, 12, 10, 13, 10, 11, 10, 14, 10, 12, 10, 13, 10, 11, + 16, 16, 13, 14, 13, 14, 12, 12, 10, 16, 10, 13, 12, 15, 11, 11, + 11, 16, 9, 12, 12, 14, 11, 11, 14, 16, 11, 13, 14, 16, 12, 11, + 10, 16, 12, 14, 9, 13, 11, 11, 12, 16, 12, 14, 11, 13, 11, 11, + 16, 16, 15, 16, 14, 14, 13, 12, 11, 16, 12, 14, 11, 14, 11, 11, + 11, 16, 12, 14, 10, 13, 11, 11, 15, 16, 13, 15, 12, 14, 12, 11, + 14, 16, 13, 14, 13, 16, 12, 12, 12, 16, 12, 13, 12, 14, 11, 11, + 14, 16, 11, 12, 12, 13, 10, 10, 9, 16, 10, 14, 11, 15, 12, 12, + 12, 16, 11, 13, 12, 15, 12, 12, 16, 16, 14, 13, 15, 15, 13, 12, + 10, 16, 10, 14, 11, 15, 11, 12, 12, 16, 11, 13, 12, 14, 12, 12, + 16, 16, 14, 13, 15, 14, 13, 12, 11, 16, 9, 12, 12, 14, 11, 11, + 13, 16, 11, 13, 13, 15, 11, 11, 16, 16, 14, 14, 16, 16, 12, 12, + 10, 16, 10, 14, 11, 14, 11, 12, 12, 16, 11, 13, 12, 14, 12, 12, + 16, 16, 14, 14, 15, 15, 13, 12, 10, 16, 10, 13, 11, 14, 11, 12, + 11, 16, 11, 13, 11, 14, 11, 12, 16, 16, 14, 14, 14, 14, 13, 12, + 11, 16, 10, 12, 12, 15, 11, 11, 12, 16, 9, 12, 12, 14, 10, 11, + 16, 16, 12, 13, 14, 15, 11, 11, 11, 16, 12, 14, 10, 14, 11, 11, + 13, 16, 12, 14, 12, 14, 11, 11, 16, 16, 15, 15, 14, 15, 12, 12, + 11, 16, 12, 14, 11, 14, 11, 11, 12, 16, 12, 14, 11, 13, 11, 11, + 16, 16, 14, 14, 13, 14, 12, 11, 12, 16, 11, 13, 12, 14, 10, 10, + 12, 15, 11, 12, 12, 13, 10, 10, 14, 15, 11, 11, 12, 12, 10, 9, + }, + { + 0, 8, 3, 8, 5, 9, 7, 8, 5, 10, 6, 10, 8, 11, 8, 9, + 16, 16, 15, 16, 16, 16, 11, 11, 2, 10, 4, 9, 7, 10, 7, 8, + 7, 16, 7, 10, 9, 11, 8, 9, 16, 16, 15, 16, 16, 16, 11, 11, + 7, 16, 6, 11, 10, 16, 9, 10, 10, 16, 9, 11, 11, 16, 9, 10, + 16, 16, 16, 16, 16, 16, 16, 11, 3, 10, 6, 9, 5, 10, 7, 9, + 7, 16, 8, 10, 8, 11, 8, 9, 16, 16, 16, 16, 16, 16, 11, 11, + 5, 11, 7, 10, 8, 11, 8, 9, 7, 14, 7, 10, 8, 11, 8, 9, + 16, 16, 11, 16, 16, 16, 10, 11, 9, 16, 9, 11, 11, 16, 9, 10, + 10, 16, 8, 11, 11, 16, 9, 10, 16, 16, 11, 16, 16, 16, 11, 10, + 8, 16, 9, 16, 7, 16, 9, 10, 11, 16, 11, 16, 10, 16, 10, 10, + 16, 16, 16, 16, 16, 16, 16, 11, 9, 16, 10, 16, 9, 16, 9, 10, + 10, 16, 10, 16, 9, 16, 9, 10, 16, 16, 16, 16, 11, 16, 11, 11, + 16, 16, 16, 16, 16, 16, 10, 10, 11, 16, 11, 16, 11, 16, 10, 10, + 16, 16, 11, 16, 11, 16, 10, 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, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + }, + { + 1, 10, 6, 10, 7, 11, 9, 10, 8, 12, 9, 12, 9, 12, 10, 10, + 15, 16, 14, 15, 14, 16, 13, 12, 5, 12, 7, 11, 8, 11, 9, 10, + 9, 13, 9, 12, 10, 12, 10, 10, 16, 16, 14, 15, 13, 16, 13, 12, + 10, 15, 10, 13, 12, 14, 11, 11, 12, 16, 11, 13, 12, 14, 11, 11, + 16, 16, 14, 16, 14, 16, 13, 12, 5, 12, 8, 11, 7, 11, 9, 10, + 9, 13, 10, 12, 9, 12, 10, 10, 14, 16, 14, 15, 13, 14, 13, 12, + 7, 13, 9, 12, 9, 12, 10, 10, 9, 13, 9, 12, 9, 12, 10, 10, + 14, 16, 13, 14, 13, 15, 12, 12, 11, 16, 11, 13, 12, 14, 11, 11, + 12, 16, 11, 14, 12, 14, 11, 11, 16, 16, 14, 16, 14, 16, 13, 12, + 10, 16, 11, 14, 10, 13, 11, 11, 12, 16, 12, 14, 11, 13, 11, 11, + 15, 16, 15, 16, 14, 16, 13, 12, 11, 16, 12, 14, 11, 14, 11, 12, + 12, 16, 12, 14, 11, 14, 11, 11, 15, 16, 14, 16, 13, 16, 13, 12, + 13, 16, 13, 16, 13, 16, 12, 12, 13, 16, 13, 16, 13, 16, 12, 12, + 16, 16, 14, 15, 14, 16, 13, 12, 4, 11, 7, 10, 7, 11, 9, 10, + 9, 13, 9, 11, 9, 12, 10, 10, 15, 16, 14, 15, 14, 15, 13, 12, + 6, 12, 7, 11, 8, 11, 9, 10, 9, 13, 9, 12, 10, 12, 10, 10, + 15, 16, 13, 14, 14, 15, 12, 12, 10, 14, 10, 12, 12, 13, 11, 11, + 12, 16, 11, 13, 12, 14, 11, 11, 16, 16, 14, 15, 15, 16, 13, 12, + 6, 12, 8, 11, 8, 11, 9, 10, 9, 13, 10, 12, 9, 12, 10, 10, + 16, 16, 14, 15, 13, 14, 12, 12, 8, 13, 9, 11, 9, 12, 9, 10, + 9, 13, 9, 12, 9, 12, 9, 10, 14, 16, 13, 14, 13, 14, 12, 11, + 11, 15, 11, 13, 12, 14, 11, 11, 11, 16, 10, 13, 12, 14, 11, 11, + 15, 16, 13, 15, 14, 16, 12, 11, 10, 16, 12, 13, 10, 13, 11, 11, + 11, 16, 12, 14, 10, 13, 11, 11, 16, 16, 14, 16, 13, 16, 13, 12, + 11, 16, 12, 14, 10, 14, 11, 11, 11, 16, 12, 14, 10, 13, 11, 11, + 16, 16, 14, 16, 12, 15, 12, 11, 13, 16, 13, 15, 13, 15, 12, 12, + 13, 16, 12, 15, 12, 15, 12, 11, 15, 16, 13, 16, 13, 16, 12, 11, + 8, 14, 9, 12, 10, 13, 11, 11, 11, 16, 11, 13, 11, 13, 11, 11, + 16, 16, 16, 16, 16, 16, 14, 13, 9, 14, 10, 12, 10, 13, 11, 11, + 11, 16, 11, 13, 12, 13, 11, 11, 16, 16, 15, 16, 15, 16, 14, 12, + 11, 16, 11, 13, 12, 14, 12, 11, 13, 16, 12, 14, 13, 14, 12, 11, + 16, 16, 15, 16, 16, 16, 14, 13, 9, 14, 10, 13, 10, 13, 11, 11, + 11, 16, 11, 13, 11, 13, 11, 11, 16, 16, 15, 16, 14, 15, 14, 13, + 9, 14, 10, 13, 10, 13, 11, 11, 11, 15, 11, 13, 11, 13, 11, 11, + 16, 16, 14, 16, 14, 16, 13, 12, 12, 16, 12, 14, 13, 14, 12, 11, + 12, 16, 11, 14, 12, 15, 12, 11, 16, 16, 13, 16, 15, 16, 13, 11, + 11, 16, 12, 14, 11, 14, 12, 11, 13, 16, 13, 15, 12, 14, 12, 12, + 16, 16, 16, 16, 14, 16, 14, 13, 12, 16, 13, 15, 11, 14, 12, 12, + 12, 16, 13, 14, 11, 15, 12, 11, 16, 16, 15, 16, 13, 15, 13, 12, + 13, 16, 13, 15, 13, 16, 12, 12, 13, 16, 13, 15, 13, 15, 12, 12, + 15, 16, 13, 16, 13, 15, 11, 10, 10, 16, 12, 14, 12, 15, 12, 12, + 14, 16, 13, 15, 13, 16, 13, 12, 16, 16, 16, 16, 16, 16, 15, 13, + 10, 16, 12, 14, 12, 15, 12, 12, 13, 16, 13, 15, 13, 15, 13, 12, + 16, 16, 16, 16, 16, 16, 14, 13, 11, 16, 12, 15, 13, 16, 12, 12, + 14, 16, 13, 16, 13, 16, 12, 12, 16, 16, 15, 16, 15, 16, 14, 12, + 11, 16, 12, 14, 12, 16, 12, 12, 14, 16, 13, 15, 13, 15, 13, 12, + 16, 16, 16, 16, 16, 16, 15, 13, 11, 16, 12, 14, 12, 15, 12, 12, + 13, 16, 12, 14, 12, 15, 12, 12, 16, 16, 16, 16, 16, 16, 14, 12, + 12, 16, 12, 15, 13, 16, 12, 12, 13, 16, 12, 15, 13, 15, 12, 11, + 16, 16, 14, 16, 15, 16, 13, 12, 12, 16, 13, 16, 12, 16, 12, 12, + 15, 16, 14, 16, 13, 16, 12, 12, 16, 16, 16, 16, 16, 16, 14, 13, + 12, 16, 13, 15, 12, 16, 12, 12, 13, 16, 13, 15, 12, 15, 12, 12, + 16, 16, 15, 16, 14, 16, 13, 12, 13, 16, 13, 16, 12, 16, 12, 12, + 13, 16, 12, 16, 12, 15, 12, 12, 14, 16, 12, 14, 12, 14, 11, 10, + }, + }, + { + { + 0, 16, 6, 16, 8, 16, 16, 16, 9, 16, 11, 16, 12, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 4, 16, 7, 16, 11, 16, 16, 16, + 10, 16, 11, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 10, 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 5, 16, 10, 16, 9, 16, 16, 16, + 10, 16, 13, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 8, 16, 11, 16, 12, 16, 16, 16, 10, 16, 12, 16, 13, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 16, 16, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 1, 16, 7, 16, 8, 16, 13, 16, + 9, 16, 11, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 4, 16, 7, 16, 11, 16, 13, 16, 9, 16, 11, 16, 13, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 9, 16, 9, 16, 16, 16, 16, 16, + 13, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 4, 16, 10, 16, 8, 16, 16, 16, 10, 16, 12, 16, 12, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 7, 16, 10, 16, 11, 16, 16, 16, + 9, 16, 11, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 12, 16, 16, 16, 16, 16, 13, 16, 12, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 10, 16, 16, 16, 11, 16, 16, 16, + 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 16, 16, 13, 16, 16, 16, 13, 16, 16, 16, 13, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 4, 16, 8, 16, 10, 16, 16, 16, 10, 16, 11, 16, 12, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 6, 16, 8, 16, 11, 16, 16, 16, + 10, 16, 12, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 9, 16, 9, 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 6, 16, 10, 16, 10, 16, 16, 16, + 11, 16, 12, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 8, 16, 11, 16, 11, 16, 16, 16, 10, 16, 12, 16, 12, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 12, 16, 16, 16, 16, 16, + 12, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 16, 16, 10, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 16, 16, 12, 16, 16, 16, + 12, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 6, 16, 10, 16, 11, 16, 16, 16, + 11, 16, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 8, 16, 9, 16, 11, 16, 13, 16, 11, 16, 12, 16, 13, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 9, 16, 9, 16, 13, 16, 12, 16, + 13, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 8, 16, 10, 16, 10, 16, 14, 16, 12, 16, 12, 16, 12, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 9, 16, 11, 16, 11, 16, 13, 16, + 10, 16, 12, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 16, 10, 16, 13, 16, 12, 16, 12, 16, 11, 16, 16, 16, 13, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 9, 16, 12, 16, 10, 16, 13, 16, + 16, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 13, 16, 11, 16, 13, 16, 12, 16, 13, 16, 12, 16, 13, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 13, 16, 13, 16, 16, 16, 12, 16, + 13, 16, 12, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, + }, + { + 0, 10, 4, 10, 5, 11, 9, 11, 6, 11, 8, 11, 8, 12, 10, 12, + 15, 16, 13, 15, 14, 15, 13, 14, 4, 12, 5, 11, 8, 12, 9, 11, + 7, 13, 8, 12, 9, 13, 10, 12, 15, 16, 13, 15, 14, 16, 13, 14, + 10, 16, 9, 13, 12, 16, 11, 13, 11, 16, 10, 14, 13, 16, 12, 13, + 16, 16, 14, 16, 15, 16, 14, 15, 4, 12, 7, 12, 6, 12, 9, 11, + 8, 13, 9, 12, 9, 12, 10, 12, 15, 16, 13, 15, 14, 15, 13, 14, + 7, 13, 8, 12, 9, 13, 10, 12, 8, 13, 9, 12, 9, 13, 10, 12, + 14, 16, 13, 15, 13, 15, 13, 14, 12, 16, 11, 14, 13, 16, 12, 13, + 12, 16, 11, 14, 13, 16, 12, 13, 16, 16, 14, 16, 15, 16, 14, 15, + 10, 16, 12, 16, 10, 14, 12, 13, 12, 16, 13, 16, 11, 14, 12, 13, + 16, 16, 16, 16, 15, 16, 14, 15, 12, 16, 13, 16, 11, 15, 12, 13, + 13, 16, 13, 16, 12, 15, 12, 14, 16, 16, 16, 16, 14, 16, 13, 14, + 16, 16, 14, 16, 14, 16, 13, 15, 16, 16, 14, 16, 14, 16, 13, 15, + 16, 16, 16, 16, 16, 16, 14, 16, 2, 11, 5, 11, 6, 11, 9, 11, + 7, 12, 8, 11, 9, 12, 10, 12, 15, 16, 14, 14, 14, 14, 13, 14, + 4, 13, 6, 11, 8, 12, 9, 11, 8, 13, 8, 12, 10, 13, 10, 12, + 15, 16, 13, 15, 14, 15, 13, 14, 9, 16, 8, 13, 12, 15, 11, 12, + 11, 16, 10, 14, 13, 16, 12, 13, 16, 16, 14, 16, 16, 16, 14, 15, + 5, 13, 8, 12, 7, 12, 9, 11, 8, 13, 9, 12, 9, 12, 10, 12, + 16, 16, 14, 15, 14, 15, 13, 13, 7, 13, 8, 12, 9, 13, 10, 12, + 8, 13, 8, 12, 9, 13, 10, 12, 14, 16, 13, 14, 13, 15, 12, 13, + 11, 16, 10, 14, 13, 16, 12, 13, 11, 16, 10, 13, 12, 15, 11, 13, + 14, 16, 12, 14, 14, 16, 13, 14, 10, 16, 12, 15, 9, 14, 11, 13, + 12, 16, 12, 16, 11, 14, 12, 13, 16, 16, 15, 16, 16, 16, 14, 15, + 11, 16, 12, 15, 11, 15, 12, 13, 12, 16, 12, 15, 11, 14, 12, 13, + 16, 16, 14, 16, 13, 15, 13, 14, 15, 16, 14, 16, 14, 16, 13, 14, + 14, 16, 13, 16, 14, 16, 13, 14, 16, 16, 14, 16, 14, 16, 13, 14, + 7, 15, 8, 13, 9, 14, 11, 13, 10, 14, 10, 13, 11, 14, 12, 13, + 16, 16, 15, 16, 15, 16, 15, 14, 7, 16, 8, 13, 10, 14, 11, 13, + 11, 15, 10, 13, 12, 14, 12, 13, 16, 16, 16, 16, 16, 16, 15, 15, + 10, 16, 9, 13, 13, 16, 12, 13, 13, 16, 11, 14, 14, 16, 13, 14, + 16, 16, 16, 16, 16, 16, 15, 16, 8, 16, 10, 14, 9, 14, 11, 13, + 11, 16, 11, 14, 11, 14, 12, 13, 16, 16, 16, 16, 16, 16, 14, 15, + 8, 16, 10, 14, 10, 14, 11, 13, 10, 15, 10, 14, 11, 14, 12, 13, + 16, 16, 14, 16, 15, 16, 14, 14, 11, 16, 10, 14, 13, 16, 12, 13, + 11, 16, 10, 13, 13, 16, 12, 13, 16, 16, 13, 16, 16, 16, 14, 14, + 11, 16, 12, 16, 10, 15, 12, 13, 14, 16, 14, 16, 12, 16, 13, 14, + 16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 13, 16, 11, 16, 12, 14, + 12, 16, 13, 16, 11, 14, 12, 13, 16, 16, 16, 16, 14, 16, 14, 14, + 15, 16, 14, 16, 16, 16, 13, 14, 13, 16, 13, 15, 14, 16, 13, 14, + 14, 16, 13, 14, 14, 15, 13, 14, 9, 16, 11, 16, 12, 16, 13, 14, + 12, 16, 12, 15, 13, 16, 13, 14, 16, 16, 16, 15, 16, 16, 15, 15, + 10, 16, 10, 16, 12, 16, 12, 14, 12, 16, 12, 14, 13, 16, 13, 14, + 16, 16, 16, 16, 16, 16, 15, 15, 11, 16, 10, 14, 14, 16, 12, 13, + 14, 16, 12, 16, 14, 16, 13, 14, 16, 16, 16, 16, 16, 16, 16, 15, + 10, 16, 12, 16, 11, 16, 12, 14, 13, 16, 12, 15, 13, 16, 13, 14, + 16, 16, 16, 16, 16, 16, 16, 15, 10, 16, 11, 16, 12, 16, 12, 14, + 12, 16, 12, 15, 13, 16, 13, 14, 16, 16, 16, 16, 16, 16, 14, 14, + 11, 16, 10, 14, 14, 16, 12, 13, 13, 16, 11, 14, 14, 16, 12, 13, + 16, 16, 15, 16, 16, 16, 14, 14, 12, 16, 13, 16, 11, 16, 12, 14, + 15, 16, 14, 16, 13, 16, 13, 14, 16, 16, 16, 16, 16, 16, 14, 16, + 12, 16, 13, 16, 12, 16, 12, 14, 13, 16, 13, 16, 12, 16, 12, 13, + 16, 16, 16, 16, 16, 16, 14, 15, 13, 16, 13, 16, 14, 16, 12, 13, + 13, 16, 13, 14, 14, 16, 12, 13, 16, 16, 14, 14, 14, 15, 13, 13, + }, + { + 0, 9, 3, 9, 5, 9, 7, 9, 5, 10, 7, 11, 8, 11, 9, 10, + 16, 16, 16, 16, 16, 16, 16, 16, 2, 11, 4, 10, 7, 11, 8, 10, + 7, 16, 7, 11, 9, 16, 9, 11, 16, 16, 16, 16, 16, 16, 16, 16, + 8, 16, 7, 16, 11, 16, 10, 11, 11, 16, 10, 16, 16, 16, 11, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 2, 11, 6, 10, 6, 10, 8, 10, + 7, 16, 8, 16, 8, 11, 9, 11, 16, 16, 16, 16, 16, 16, 16, 16, + 5, 13, 7, 11, 8, 11, 9, 11, 6, 12, 8, 12, 8, 12, 9, 11, + 16, 16, 16, 16, 16, 16, 16, 16, 10, 16, 10, 16, 12, 16, 10, 13, + 10, 16, 9, 16, 11, 16, 11, 12, 16, 16, 16, 16, 16, 16, 16, 16, + 8, 16, 10, 16, 8, 16, 10, 12, 11, 16, 12, 16, 10, 16, 11, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 10, 16, 11, 16, 10, 16, 11, 16, + 11, 16, 12, 16, 10, 16, 11, 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, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + }, + { + 1, 10, 5, 10, 6, 10, 9, 10, 7, 12, 9, 12, 9, 12, 10, 10, + 16, 16, 15, 16, 14, 16, 13, 13, 5, 12, 7, 11, 8, 11, 9, 10, + 8, 13, 9, 12, 10, 12, 10, 11, 16, 16, 16, 16, 14, 16, 13, 12, + 10, 16, 10, 13, 12, 14, 12, 12, 12, 16, 11, 14, 13, 15, 12, 12, + 16, 16, 16, 15, 16, 16, 14, 13, 5, 12, 8, 11, 7, 11, 9, 10, + 8, 13, 10, 12, 9, 12, 10, 10, 15, 16, 14, 15, 14, 14, 13, 13, + 7, 13, 9, 12, 9, 12, 10, 10, 9, 13, 10, 13, 10, 13, 10, 10, + 14, 16, 14, 15, 14, 16, 13, 12, 11, 16, 12, 14, 12, 15, 12, 12, + 12, 16, 12, 15, 13, 16, 12, 12, 16, 16, 15, 16, 16, 16, 14, 13, + 10, 16, 12, 14, 10, 14, 12, 12, 12, 16, 13, 14, 11, 14, 12, 12, + 16, 16, 16, 16, 14, 16, 14, 13, 11, 16, 12, 14, 11, 14, 12, 12, + 12, 16, 13, 16, 11, 15, 12, 12, 16, 16, 16, 16, 14, 16, 14, 13, + 13, 16, 14, 16, 14, 16, 13, 13, 13, 16, 13, 16, 13, 16, 13, 12, + 16, 16, 16, 16, 16, 16, 13, 13, 4, 11, 7, 10, 7, 11, 9, 10, + 8, 12, 9, 12, 9, 12, 10, 11, 15, 16, 14, 15, 14, 16, 13, 13, + 6, 12, 7, 11, 8, 11, 9, 10, 9, 13, 9, 12, 10, 12, 10, 10, + 16, 16, 15, 16, 15, 16, 13, 12, 10, 16, 10, 13, 12, 14, 12, 11, + 12, 16, 11, 14, 13, 14, 12, 12, 16, 16, 16, 14, 16, 16, 14, 13, + 6, 12, 8, 11, 7, 11, 9, 10, 9, 14, 10, 12, 9, 12, 10, 10, + 15, 16, 14, 16, 14, 16, 14, 13, 7, 13, 9, 12, 9, 12, 10, 10, + 9, 13, 9, 12, 9, 12, 10, 10, 14, 16, 13, 14, 14, 16, 12, 11, + 11, 16, 11, 14, 12, 14, 12, 12, 12, 16, 11, 14, 12, 14, 12, 11, + 16, 16, 13, 16, 14, 16, 13, 12, 10, 16, 12, 14, 10, 14, 11, 11, + 12, 16, 13, 14, 11, 14, 12, 12, 16, 16, 16, 16, 14, 16, 13, 13, + 11, 16, 12, 16, 11, 14, 12, 12, 12, 16, 12, 14, 11, 14, 12, 11, + 16, 16, 15, 16, 13, 15, 13, 12, 13, 16, 14, 16, 13, 16, 13, 12, + 13, 16, 13, 16, 13, 16, 13, 12, 16, 16, 14, 16, 14, 16, 12, 11, + 8, 13, 10, 12, 10, 13, 11, 11, 11, 14, 12, 14, 12, 14, 12, 12, + 16, 16, 16, 16, 16, 16, 14, 13, 9, 14, 10, 13, 10, 13, 11, 11, + 12, 16, 12, 13, 12, 13, 12, 11, 16, 16, 16, 16, 16, 16, 15, 14, + 12, 16, 11, 14, 13, 15, 12, 12, 13, 16, 12, 15, 14, 15, 13, 12, + 16, 16, 16, 16, 16, 16, 15, 13, 9, 14, 11, 13, 10, 13, 11, 11, + 11, 16, 12, 14, 12, 14, 12, 12, 16, 16, 16, 16, 16, 16, 16, 13, + 10, 15, 11, 13, 11, 14, 12, 11, 11, 16, 12, 14, 11, 14, 12, 11, + 16, 16, 16, 16, 16, 16, 14, 12, 12, 16, 12, 14, 13, 15, 13, 12, + 12, 16, 12, 14, 13, 15, 12, 12, 16, 16, 14, 16, 16, 16, 14, 12, + 12, 16, 13, 16, 11, 14, 12, 12, 14, 16, 14, 16, 12, 16, 13, 12, + 16, 16, 16, 16, 16, 16, 16, 13, 12, 16, 13, 16, 12, 16, 13, 12, + 12, 16, 13, 16, 12, 16, 12, 12, 16, 16, 16, 16, 14, 16, 14, 12, + 14, 16, 14, 16, 14, 16, 14, 13, 13, 16, 13, 16, 13, 16, 13, 12, + 16, 16, 13, 16, 13, 16, 12, 11, 9, 16, 12, 15, 13, 16, 13, 12, + 13, 16, 14, 16, 14, 16, 14, 13, 16, 16, 16, 16, 16, 16, 16, 14, + 10, 16, 12, 15, 12, 15, 13, 12, 13, 16, 14, 16, 13, 16, 13, 12, + 16, 16, 16, 16, 16, 16, 16, 13, 12, 16, 12, 16, 13, 16, 13, 12, + 14, 16, 13, 16, 14, 16, 13, 12, 16, 16, 16, 16, 16, 16, 16, 13, + 11, 16, 12, 15, 12, 16, 13, 12, 14, 16, 14, 16, 13, 16, 13, 13, + 16, 16, 16, 16, 16, 16, 15, 13, 11, 16, 12, 16, 12, 16, 13, 12, + 13, 16, 13, 15, 13, 16, 13, 12, 16, 16, 16, 16, 16, 16, 15, 13, + 12, 16, 12, 16, 13, 16, 13, 12, 13, 16, 12, 16, 13, 16, 13, 12, + 16, 16, 14, 16, 16, 16, 14, 12, 12, 16, 14, 16, 11, 16, 13, 12, + 14, 16, 14, 16, 13, 16, 13, 12, 16, 16, 16, 16, 16, 16, 16, 13, + 12, 16, 13, 16, 12, 16, 13, 12, 13, 16, 13, 16, 12, 16, 13, 12, + 16, 16, 16, 16, 14, 16, 14, 12, 13, 16, 13, 16, 13, 16, 13, 13, + 13, 16, 12, 16, 12, 16, 12, 12, 14, 16, 13, 15, 13, 16, 12, 11, + }, + }, +}; + + +static const uint8_t rv34_table_intra_secondpat[NUM_INTRA_TABLES][2][OTHERBLK_VLC_SIZE] = { + { + { + 0, 5, 10, 3, 6, 10, 7, 8, 9, 4, 6, 10, 6, 7, 9, 8, + 8, 9, 8, 8, 9, 8, 9, 9, 9, 9, 8, 3, 6, 10, 4, 6, + 10, 7, 7, 9, 5, 7, 10, 6, 7, 9, 7, 7, 8, 7, 8, 9, + 8, 8, 9, 8, 8, 7, 6, 8, 10, 6, 8, 10, 7, 8, 9, 7, + 8, 10, 7, 8, 10, 8, 8, 8, 8, 9, 9, 8, 8, 9, 9, 8, + 7, 7, 8, 9, 7, 8, 9, 7, 7, 7, 8, 8, 9, 7, 8, 9, + 7, 7, 7, 8, 8, 8, 7, 7, 7, 7, 6, 5, + }, + { + 0, 5, 11, 3, 6, 11, 8, 9, 11, 3, 6, 10, 6, 7, 11, 9, + 9, 11, 7, 9, 11, 9, 9, 11, 10, 10, 11, 2, 6, 10, 4, 7, + 10, 7, 9, 11, 4, 7, 11, 6, 7, 10, 9, 9, 11, 7, 9, 11, + 8, 9, 10, 10, 10, 10, 5, 8, 11, 6, 8, 11, 8, 9, 11, 6, + 8, 11, 7, 8, 11, 9, 9, 11, 8, 10, 11, 9, 9, 11, 10, 10, + 10, 8, 9, 11, 8, 9, 11, 9, 9, 10, 8, 9, 11, 8, 9, 11, + 9, 9, 10, 8, 9, 10, 9, 9, 10, 9, 9, 8, + }, + }, + { + { + 0, 5, 10, 4, 6, 10, 7, 8, 10, 4, 6, 10, 6, 7, 9, 8, + 8, 9, 8, 8, 9, 8, 9, 9, 9, 9, 9, 2, 6, 10, 4, 6, + 10, 7, 7, 9, 5, 7, 10, 6, 7, 9, 7, 7, 9, 7, 8, 9, + 8, 8, 9, 9, 8, 8, 6, 8, 10, 6, 8, 10, 7, 8, 9, 6, + 8, 10, 7, 8, 10, 8, 8, 9, 8, 9, 10, 8, 8, 9, 9, 9, + 8, 8, 8, 10, 7, 8, 9, 7, 8, 8, 7, 8, 10, 7, 8, 9, + 7, 7, 8, 8, 8, 9, 8, 8, 8, 7, 7, 6, + }, + { + 0, 5, 12, 4, 7, 12, 8, 10, 13, 4, 7, 12, 6, 8, 12, 10, + 10, 12, 8, 9, 12, 10, 10, 12, 12, 12, 12, 1, 6, 12, 4, 7, + 12, 8, 9, 12, 4, 7, 12, 6, 8, 11, 9, 10, 12, 8, 9, 12, + 9, 10, 11, 11, 11, 12, 6, 8, 12, 7, 9, 12, 9, 10, 13, 6, + 9, 12, 8, 9, 12, 10, 10, 12, 9, 10, 12, 10, 10, 12, 12, 12, + 12, 8, 10, 12, 9, 10, 12, 10, 10, 12, 8, 10, 12, 9, 10, 12, + 10, 10, 11, 9, 10, 12, 10, 10, 11, 11, 10, 10, + }, + }, + { + { + 0, 5, 10, 3, 6, 10, 7, 8, 11, 4, 6, 10, 6, 7, 10, 8, + 9, 10, 8, 8, 10, 9, 9, 10, 10, 10, 10, 2, 6, 10, 4, 6, + 10, 7, 8, 10, 4, 7, 10, 6, 7, 10, 8, 8, 10, 7, 8, 10, + 8, 8, 9, 10, 9, 9, 5, 8, 11, 6, 8, 10, 7, 9, 10, 6, + 8, 11, 7, 8, 10, 8, 8, 10, 8, 9, 11, 9, 9, 10, 10, 9, + 9, 8, 9, 10, 8, 9, 10, 8, 9, 10, 8, 9, 10, 8, 8, 10, + 8, 8, 9, 8, 9, 10, 8, 8, 9, 9, 8, 8, + }, + { + 0, 6, 13, 4, 7, 14, 9, 11, 14, 3, 7, 13, 7, 8, 13, 11, + 11, 14, 8, 10, 13, 10, 11, 13, 13, 13, 14, 1, 6, 12, 4, 8, + 13, 9, 10, 15, 4, 8, 13, 7, 8, 12, 11, 11, 14, 8, 10, 13, + 10, 10, 13, 13, 13, 14, 5, 9, 13, 7, 9, 13, 10, 11, 14, 6, + 10, 14, 8, 10, 14, 11, 11, 14, 9, 11, 14, 11, 11, 13, 13, 13, + 14, 9, 10, 14, 9, 11, 13, 11, 12, 14, 9, 11, 13, 9, 11, 14, + 11, 12, 13, 10, 12, 15, 11, 11, 13, 13, 12, 13, + }, + }, + { + { + 0, 5, 11, 3, 6, 11, 7, 9, 12, 3, 6, 11, 6, 7, 11, 9, + 9, 11, 8, 9, 11, 9, 9, 11, 11, 11, 12, 2, 6, 11, 4, 6, + 11, 7, 9, 11, 4, 7, 11, 5, 7, 10, 9, 9, 11, 7, 8, 11, + 9, 9, 10, 11, 11, 11, 5, 8, 11, 6, 8, 11, 8, 9, 12, 6, + 8, 11, 7, 8, 11, 9, 9, 11, 8, 9, 12, 9, 9, 11, 11, 11, + 11, 8, 10, 12, 8, 10, 11, 9, 10, 12, 8, 10, 12, 8, 9, 12, + 10, 10, 12, 9, 10, 12, 9, 9, 11, 11, 10, 11, + }, + { + 0, 6, 13, 3, 8, 14, 10, 12, 16, 3, 8, 15, 7, 9, 15, 12, + 13, 15, 9, 11, 15, 11, 12, 16, 14, 16, 16, 1, 7, 13, 4, 8, + 14, 9, 11, 15, 4, 8, 14, 7, 9, 14, 12, 13, 15, 8, 10, 14, + 11, 11, 14, 16, 14, 16, 6, 9, 14, 7, 10, 14, 11, 13, 15, 7, + 10, 14, 9, 10, 13, 12, 12, 15, 10, 11, 14, 11, 11, 14, 14, 14, + 16, 9, 11, 14, 10, 11, 14, 13, 14, 15, 9, 12, 14, 10, 12, 16, + 13, 14, 16, 10, 13, 16, 12, 12, 14, 15, 14, 15, + }, + }, + { + { + 0, 6, 12, 3, 7, 12, 9, 11, 13, 4, 7, 12, 6, 8, 12, 10, + 11, 13, 8, 10, 13, 10, 11, 13, 13, 13, 14, 1, 6, 12, 4, 7, + 12, 9, 10, 14, 4, 7, 12, 6, 7, 12, 10, 11, 13, 8, 9, 13, + 10, 10, 12, 13, 13, 14, 6, 9, 13, 7, 9, 13, 10, 12, 14, 7, + 9, 13, 8, 10, 13, 11, 11, 14, 9, 11, 13, 11, 11, 14, 13, 13, + 14, 10, 12, 14, 10, 12, 14, 12, 13, 15, 10, 12, 14, 10, 12, 14, + 12, 13, 15, 11, 13, 15, 12, 12, 15, 14, 14, 14, + }, + { + 0, 6, 16, 3, 8, 16, 10, 13, 16, 3, 8, 16, 7, 9, 16, 13, + 16, 16, 8, 10, 16, 11, 13, 16, 16, 16, 16, 1, 7, 14, 4, 8, + 16, 10, 12, 16, 4, 8, 13, 7, 9, 16, 13, 14, 16, 8, 10, 16, + 11, 11, 14, 16, 16, 16, 6, 9, 14, 8, 10, 14, 12, 16, 16, 6, + 10, 13, 9, 11, 16, 13, 14, 16, 9, 12, 16, 12, 11, 16, 16, 16, + 16, 10, 12, 16, 11, 12, 16, 16, 14, 16, 9, 12, 16, 11, 12, 16, + 16, 15, 16, 10, 13, 16, 12, 13, 16, 16, 16, 16, + }, + }, +}; + +static const uint8_t rv34_table_intra_thirdpat[NUM_INTRA_TABLES][2][OTHERBLK_VLC_SIZE] = { + { + { + 0, 5, 10, 3, 6, 10, 7, 8, 10, 4, 7, 10, 6, 7, 10, 8, + 8, 10, 8, 9, 10, 9, 9, 10, 9, 9, 9, 2, 6, 10, 4, 7, + 10, 7, 8, 9, 5, 7, 10, 6, 7, 10, 8, 8, 9, 8, 9, 10, + 8, 8, 9, 9, 9, 8, 6, 8, 11, 6, 8, 10, 7, 8, 10, 6, + 8, 11, 7, 8, 10, 8, 8, 9, 8, 9, 10, 9, 9, 10, 9, 9, + 9, 7, 8, 10, 7, 8, 10, 7, 8, 8, 7, 8, 10, 7, 8, 9, + 7, 8, 8, 8, 8, 9, 8, 8, 8, 7, 7, 7, + }, + { + 0, 4, 10, 3, 6, 10, 7, 8, 11, 3, 6, 10, 5, 7, 10, 9, + 9, 11, 9, 10, 11, 9, 10, 11, 11, 11, 11, 2, 6, 10, 4, 6, + 10, 7, 8, 10, 4, 7, 10, 6, 7, 10, 8, 9, 10, 8, 9, 11, + 9, 9, 11, 10, 10, 11, 6, 8, 11, 6, 8, 11, 8, 9, 11, 7, + 9, 11, 7, 8, 11, 9, 9, 11, 9, 10, 12, 10, 10, 12, 11, 11, + 11, 8, 9, 11, 8, 9, 11, 9, 9, 11, 9, 10, 11, 9, 10, 11, + 9, 10, 11, 10, 11, 12, 10, 10, 12, 10, 10, 10, + }, + }, + { + { + 0, 5, 10, 3, 6, 10, 7, 8, 10, 4, 7, 10, 6, 7, 10, 8, + 9, 10, 8, 9, 11, 8, 9, 10, 10, 10, 10, 2, 6, 10, 4, 6, + 10, 7, 8, 10, 4, 7, 10, 5, 7, 10, 8, 8, 10, 8, 9, 10, + 8, 9, 10, 9, 9, 9, 5, 7, 11, 6, 8, 11, 7, 8, 11, 6, + 8, 11, 7, 8, 10, 8, 9, 10, 8, 9, 11, 9, 9, 10, 10, 9, + 10, 7, 8, 10, 7, 8, 10, 8, 9, 10, 8, 9, 10, 8, 9, 10, + 8, 8, 10, 9, 9, 10, 9, 9, 10, 9, 9, 9, + }, + { + 0, 5, 11, 3, 6, 11, 8, 9, 12, 4, 7, 12, 6, 7, 12, 9, + 10, 13, 10, 11, 13, 10, 11, 14, 12, 13, 14, 1, 6, 11, 4, 7, + 11, 8, 9, 12, 5, 7, 11, 6, 8, 12, 9, 10, 13, 10, 11, 14, + 10, 11, 13, 12, 12, 14, 6, 8, 12, 7, 9, 13, 9, 10, 14, 7, + 10, 13, 8, 10, 12, 11, 11, 13, 11, 13, 14, 11, 12, 14, 13, 13, + 15, 9, 10, 12, 9, 11, 14, 10, 11, 14, 11, 11, 13, 10, 11, 13, + 11, 12, 14, 12, 14, 15, 13, 13, 14, 13, 13, 14, + }, + }, + { + { + 0, 5, 11, 3, 6, 11, 7, 9, 11, 4, 6, 11, 5, 7, 10, 9, + 9, 11, 8, 9, 11, 9, 10, 11, 11, 11, 11, 2, 6, 10, 3, 6, + 10, 7, 9, 11, 4, 7, 10, 5, 7, 10, 8, 9, 11, 8, 9, 11, + 9, 9, 11, 11, 11, 11, 5, 8, 11, 6, 8, 11, 8, 10, 12, 6, + 8, 11, 7, 8, 11, 9, 10, 11, 9, 10, 12, 9, 10, 11, 11, 11, + 11, 8, 9, 11, 8, 10, 12, 9, 11, 12, 8, 10, 12, 9, 10, 12, + 10, 11, 12, 10, 11, 12, 10, 10, 11, 11, 11, 11, + }, + { + 0, 5, 13, 2, 7, 16, 9, 11, 16, 4, 8, 16, 7, 9, 16, 12, + 12, 16, 12, 16, 16, 12, 16, 16, 16, 16, 16, 1, 6, 13, 4, 8, + 16, 9, 11, 16, 6, 9, 16, 7, 10, 16, 13, 13, 16, 13, 15, 16, + 12, 16, 16, 16, 16, 16, 7, 9, 16, 8, 11, 15, 11, 13, 16, 10, + 12, 16, 10, 12, 16, 16, 13, 16, 16, 16, 16, 14, 16, 16, 16, 16, + 16, 12, 12, 16, 12, 16, 16, 16, 16, 16, 13, 14, 16, 12, 13, 16, + 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, + }, + }, + { + { + 0, 6, 11, 3, 7, 11, 8, 10, 12, 4, 7, 11, 6, 8, 11, 10, + 11, 12, 9, 10, 12, 10, 10, 12, 12, 12, 13, 1, 6, 11, 4, 7, + 11, 8, 10, 12, 4, 7, 11, 6, 8, 11, 10, 10, 12, 9, 10, 12, + 10, 10, 12, 13, 13, 13, 6, 8, 12, 7, 10, 12, 10, 12, 13, 7, + 9, 12, 8, 10, 12, 11, 11, 13, 11, 12, 14, 11, 11, 13, 13, 13, + 13, 9, 11, 13, 10, 12, 14, 12, 13, 15, 10, 12, 14, 11, 12, 14, + 13, 13, 14, 12, 13, 15, 13, 13, 14, 14, 14, 14, + }, + { + 0, 5, 16, 2, 6, 16, 10, 14, 16, 4, 8, 16, 7, 9, 16, 11, + 16, 16, 11, 16, 16, 16, 16, 16, 16, 16, 16, 1, 6, 12, 4, 8, + 12, 12, 12, 16, 6, 8, 16, 8, 10, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 12, 16, 16, 7, 10, 16, 8, 11, 14, 16, 16, 16, 10, + 12, 16, 10, 16, 16, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + }, + }, + { + { + 0, 5, 11, 3, 6, 11, 10, 10, 12, 3, 7, 11, 6, 8, 11, 11, + 11, 12, 10, 10, 12, 11, 11, 13, 14, 13, 14, 1, 6, 11, 4, 7, + 11, 10, 11, 13, 5, 7, 11, 7, 8, 11, 11, 11, 13, 10, 11, 13, + 11, 11, 12, 13, 13, 14, 7, 10, 12, 9, 11, 13, 12, 13, 14, 9, + 10, 13, 9, 10, 13, 12, 11, 13, 12, 13, 16, 12, 13, 13, 14, 14, + 14, 11, 14, 16, 12, 14, 15, 14, 13, 16, 13, 13, 15, 13, 14, 16, + 14, 13, 16, 13, 13, 16, 13, 14, 15, 15, 14, 15, + }, + { + 0, 4, 16, 2, 7, 16, 10, 16, 16, 4, 10, 16, 7, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 1, 6, 13, 4, 11, + 16, 16, 16, 16, 6, 10, 16, 8, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 8, 16, 16, 10, 16, 16, 16, 16, 16, 10, + 16, 16, 10, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 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 uint8_t rv34_intra_coeff[NUM_INTRA_TABLES][COEFF_VLC_SIZE] = { +{ + 1, 3, 3, 4, 4, 5, 6, 6, 6, 7, 7, 7, 8, 8, 9, 9, + 9, 9, 10, 10, 10, 11, 11, 11, 10, 10, 10, 12, 13, 14, 15, 15, +}, +{ + 1, 2, 3, 5, 5, 6, 6, 7, 7, 8, 8, 9, 10, 10, 10, 11, + 11, 11, 12, 12, 13, 13, 13, 13, 13, 13, 13, 14, 16, 16, 16, 16, +}, +{ + 1, 2, 3, 4, 5, 6, 8, 8, 9, 9, 10, 10, 11, 12, 12, 12, + 13, 13, 14, 14, 14, 14, 16, 16, 14, 16, 16, 16, 14, 16, 16, 16, +}, +{ + 1, 2, 3, 4, 5, 6, 8, 8, 9, 9, 10, 10, 11, 12, 12, 12, + 13, 13, 16, 16, 16, 16, 16, 16, 16, 16, 14, 12, 16, 16, 16, 16, +}, +{ + 1, 2, 3, 4, 5, 7, 7, 8, 8, 9, 10, 10, 12, 11, 13, 12, + 15, 13, 14, 13, 12, 15, 14, 13, 12, 12, 10, 11, 16, 16, 16, 16, +} +}; + + +static const uint8_t rv34_inter_cbppat[NUM_INTER_TABLES][CBPPAT_VLC_SIZE] = { +{ + 7, 9, 9, 8, 9, 8, 9, 8, 9, 9, 8, 8, 8, 8, 8, 4, + 7, 10, 11, 10, 11, 10, 12, 10, 12, 11, 11, 10, 11, 10, 10, 7, + 10, 11, 15, 12, 15, 12, 15, 12, 15, 14, 14, 12, 14, 12, 14, 9, + 7, 11, 10, 10, 12, 11, 11, 10, 11, 12, 10, 10, 11, 10, 10, 7, + 8, 12, 12, 11, 13, 12, 12, 10, 13, 13, 12, 10, 12, 11, 11, 7, + 11, 13, 15, 11, 15, 13, 15, 12, 16, 14, 14, 12, 15, 13, 13, 9, + 10, 15, 11, 12, 15, 14, 14, 12, 15, 15, 12, 12, 14, 14, 12, 9, + 11, 15, 13, 12, 16, 15, 14, 12, 15, 15, 13, 12, 15, 14, 13, 9, + 13, 15, 14, 10, 16, 15, 16, 11, 16, 16, 15, 12, 16, 15, 15, 9, + 7, 11, 11, 11, 11, 10, 11, 10, 11, 12, 11, 10, 10, 10, 10, 7, + 9, 12, 13, 12, 12, 11, 13, 10, 13, 13, 12, 11, 12, 10, 11, 7, + 12, 13, 16, 14, 15, 12, 16, 12, 16, 15, 15, 13, 15, 12, 14, 9, + 9, 13, 13, 12, 13, 12, 13, 11, 13, 13, 12, 11, 12, 11, 11, 7, + 9, 13, 13, 12, 13, 12, 13, 11, 13, 13, 13, 11, 12, 11, 11, 7, + 12, 14, 15, 13, 16, 13, 15, 11, 16, 14, 15, 12, 15, 12, 13, 8, + 12, 16, 14, 14, 16, 15, 15, 13, 16, 15, 14, 13, 15, 14, 13, 9, + 12, 15, 14, 13, 15, 14, 15, 12, 16, 15, 14, 12, 14, 13, 13, 8, + 13, 16, 16, 12, 16, 14, 16, 11, 16, 16, 15, 12, 16, 14, 14, 8, + 10, 15, 15, 15, 12, 12, 14, 12, 14, 15, 15, 14, 12, 12, 13, 9, + 11, 15, 16, 14, 13, 12, 15, 12, 16, 15, 15, 14, 14, 12, 13, 9, + 14, 15, 16, 16, 15, 11, 16, 12, 16, 16, 16, 15, 16, 12, 15, 9, + 12, 16, 16, 15, 14, 14, 14, 13, 16, 16, 15, 14, 14, 13, 13, 9, + 12, 15, 15, 14, 14, 13, 15, 12, 16, 15, 14, 13, 14, 13, 13, 8, + 13, 16, 16, 15, 16, 12, 16, 11, 16, 16, 16, 14, 16, 13, 14, 8, + 14, 16, 16, 16, 16, 16, 15, 14, 16, 16, 16, 15, 16, 15, 14, 11, + 13, 16, 16, 15, 16, 15, 15, 12, 16, 16, 16, 14, 15, 14, 14, 9, + 14, 16, 16, 13, 16, 14, 16, 10, 16, 16, 16, 13, 16, 14, 14, 8, + 7, 12, 11, 11, 11, 11, 12, 10, 11, 11, 10, 10, 10, 10, 10, 7, + 9, 13, 13, 12, 13, 12, 13, 11, 13, 13, 12, 11, 12, 11, 11, 8, + 12, 14, 16, 14, 16, 14, 16, 13, 16, 14, 15, 13, 15, 13, 14, 9, + 9, 13, 12, 12, 13, 12, 13, 11, 12, 13, 11, 10, 12, 11, 11, 7, + 9, 13, 13, 12, 13, 12, 13, 11, 13, 13, 12, 11, 12, 11, 11, 7, + 12, 14, 16, 13, 16, 14, 15, 12, 15, 15, 14, 12, 15, 13, 13, 8, + 11, 15, 13, 14, 15, 15, 14, 13, 15, 15, 12, 12, 14, 14, 12, 9, + 11, 15, 14, 13, 15, 14, 14, 12, 15, 14, 13, 11, 14, 13, 12, 8, + 13, 16, 15, 12, 16, 15, 16, 12, 16, 16, 14, 11, 15, 14, 14, 8, + 8, 13, 13, 12, 12, 12, 13, 11, 12, 13, 12, 11, 11, 10, 10, 7, + 9, 13, 14, 12, 13, 12, 13, 11, 13, 13, 13, 11, 12, 11, 11, 7, + 12, 14, 16, 14, 15, 13, 15, 12, 15, 15, 15, 13, 14, 12, 13, 8, + 9, 13, 13, 12, 13, 12, 13, 11, 13, 13, 12, 11, 12, 11, 11, 7, + 9, 13, 12, 12, 13, 12, 12, 10, 13, 13, 12, 10, 12, 10, 10, 6, + 11, 14, 14, 12, 14, 12, 14, 11, 14, 14, 13, 11, 13, 11, 12, 7, + 12, 16, 14, 14, 15, 15, 14, 13, 15, 15, 13, 12, 14, 13, 12, 8, + 11, 14, 13, 12, 14, 13, 13, 11, 14, 14, 13, 11, 13, 12, 11, 7, + 11, 14, 14, 12, 15, 13, 14, 11, 15, 14, 13, 11, 14, 12, 12, 6, + 11, 16, 15, 15, 13, 14, 15, 13, 14, 15, 15, 13, 12, 12, 12, 9, + 12, 15, 15, 14, 14, 13, 15, 12, 15, 15, 14, 13, 13, 11, 12, 8, + 13, 16, 16, 15, 16, 13, 16, 13, 16, 16, 15, 14, 14, 12, 14, 8, + 11, 16, 15, 14, 14, 14, 14, 13, 15, 15, 14, 13, 13, 12, 12, 8, + 11, 14, 14, 13, 13, 12, 14, 11, 14, 14, 13, 12, 12, 11, 11, 7, + 12, 14, 15, 13, 14, 12, 14, 11, 15, 14, 14, 12, 13, 11, 12, 7, + 13, 16, 16, 16, 16, 15, 16, 14, 16, 16, 15, 14, 15, 14, 13, 9, + 12, 15, 14, 13, 15, 13, 14, 12, 15, 15, 13, 12, 13, 12, 12, 7, + 11, 15, 14, 12, 14, 13, 14, 10, 15, 14, 13, 11, 13, 11, 11, 5, + 10, 15, 15, 15, 15, 14, 15, 13, 12, 14, 12, 12, 12, 13, 12, 9, + 12, 16, 16, 15, 16, 15, 16, 14, 14, 15, 14, 13, 14, 13, 13, 9, + 14, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 14, 16, 14, 15, 11, + 11, 15, 15, 14, 15, 15, 15, 14, 14, 15, 12, 12, 13, 13, 12, 9, + 12, 15, 15, 14, 16, 14, 15, 13, 14, 14, 13, 12, 14, 13, 12, 8, + 13, 16, 16, 15, 16, 16, 16, 14, 16, 16, 15, 12, 16, 14, 14, 9, + 13, 16, 14, 16, 16, 16, 16, 15, 15, 16, 11, 12, 16, 15, 12, 9, + 13, 16, 15, 14, 16, 15, 16, 14, 15, 16, 12, 11, 15, 14, 13, 8, + 13, 16, 16, 13, 16, 16, 16, 13, 16, 16, 13, 11, 16, 14, 14, 8, + 11, 15, 15, 15, 14, 14, 15, 13, 13, 15, 14, 13, 12, 12, 12, 9, + 11, 15, 16, 14, 15, 14, 15, 13, 14, 14, 14, 13, 13, 12, 13, 8, + 13, 16, 16, 16, 16, 15, 16, 14, 16, 16, 16, 13, 15, 12, 14, 9, + 11, 16, 15, 14, 14, 14, 15, 13, 14, 14, 13, 12, 13, 12, 11, 8, + 11, 14, 14, 13, 14, 13, 14, 12, 13, 13, 12, 11, 12, 11, 11, 7, + 12, 15, 15, 13, 15, 14, 15, 12, 15, 14, 14, 11, 13, 12, 12, 7, + 13, 16, 15, 15, 16, 16, 16, 14, 15, 16, 12, 12, 14, 14, 12, 8, + 11, 15, 14, 13, 15, 13, 14, 12, 14, 14, 12, 11, 13, 12, 11, 6, + 11, 14, 14, 12, 15, 13, 14, 11, 15, 14, 12, 10, 13, 11, 11, 5, + 12, 16, 16, 16, 15, 15, 16, 15, 14, 16, 15, 15, 10, 12, 12, 9, + 13, 16, 16, 16, 15, 14, 16, 13, 15, 15, 15, 14, 12, 11, 13, 8, + 14, 16, 16, 16, 16, 14, 16, 13, 16, 16, 16, 14, 14, 11, 14, 8, + 13, 16, 16, 15, 15, 15, 15, 14, 15, 16, 14, 13, 12, 12, 11, 8, + 11, 15, 15, 13, 14, 13, 14, 12, 14, 14, 13, 12, 12, 11, 11, 6, + 11, 15, 15, 13, 15, 12, 14, 11, 14, 14, 13, 11, 12, 10, 11, 5, + 13, 16, 16, 15, 16, 16, 16, 14, 16, 16, 14, 14, 14, 13, 11, 8, + 11, 14, 14, 13, 14, 13, 14, 11, 14, 14, 12, 11, 12, 11, 10, 5, + 10, 13, 13, 11, 13, 12, 13, 9, 13, 13, 12, 9, 12, 10, 10, 3, +}, +{ + 5, 7, 7, 7, 7, 7, 8, 7, 7, 8, 7, 7, 7, 7, 7, 4, + 7, 9, 11, 9, 11, 9, 11, 9, 11, 10, 10, 9, 10, 9, 10, 6, + 11, 11, 14, 11, 14, 11, 14, 11, 15, 13, 14, 12, 14, 12, 13, 9, + 6, 11, 10, 9, 11, 10, 11, 9, 11, 11, 9, 9, 10, 10, 9, 6, + 8, 11, 11, 10, 12, 11, 12, 10, 12, 12, 11, 10, 12, 11, 11, 7, + 11, 13, 14, 11, 15, 13, 15, 11, 15, 14, 14, 12, 14, 13, 13, 9, + 10, 14, 11, 11, 15, 14, 13, 12, 14, 14, 11, 11, 14, 13, 12, 9, + 11, 14, 13, 11, 15, 14, 14, 11, 15, 15, 13, 11, 14, 14, 13, 9, + 12, 14, 14, 10, 16, 15, 16, 11, 16, 16, 15, 11, 16, 15, 14, 9, + 6, 10, 11, 10, 10, 9, 11, 9, 10, 11, 10, 10, 9, 9, 9, 6, + 9, 12, 12, 11, 12, 10, 12, 10, 12, 12, 12, 11, 11, 10, 11, 7, + 12, 13, 15, 13, 14, 11, 15, 11, 15, 15, 14, 13, 14, 12, 14, 9, + 9, 12, 12, 11, 12, 11, 12, 11, 12, 13, 11, 11, 12, 11, 11, 7, + 9, 12, 12, 11, 13, 11, 12, 10, 13, 13, 12, 11, 12, 11, 11, 7, + 12, 14, 15, 12, 15, 12, 14, 11, 15, 15, 14, 12, 14, 13, 13, 8, + 12, 15, 14, 13, 15, 14, 14, 13, 16, 16, 14, 13, 15, 14, 13, 9, + 12, 15, 14, 13, 15, 14, 14, 12, 15, 15, 13, 12, 14, 13, 13, 9, + 13, 15, 15, 12, 16, 14, 15, 11, 16, 16, 15, 12, 15, 14, 14, 9, + 10, 14, 14, 14, 12, 11, 13, 12, 14, 15, 14, 13, 12, 11, 12, 9, + 12, 14, 15, 14, 13, 11, 14, 12, 15, 15, 15, 14, 13, 11, 13, 9, + 13, 15, 16, 15, 14, 11, 16, 11, 16, 16, 16, 14, 15, 12, 15, 9, + 12, 15, 15, 14, 14, 14, 14, 13, 15, 15, 14, 14, 14, 13, 13, 9, + 12, 15, 15, 14, 14, 13, 14, 12, 15, 15, 14, 13, 14, 13, 13, 9, + 13, 15, 16, 14, 15, 13, 16, 11, 16, 16, 15, 14, 15, 13, 14, 9, + 14, 16, 16, 16, 16, 16, 15, 14, 16, 16, 16, 16, 16, 16, 14, 11, + 14, 16, 16, 14, 16, 15, 15, 12, 16, 16, 16, 14, 15, 14, 14, 9, + 14, 16, 16, 14, 16, 14, 16, 11, 16, 16, 16, 14, 16, 14, 14, 9, + 6, 11, 10, 10, 10, 10, 11, 10, 10, 11, 9, 9, 9, 9, 9, 6, + 9, 12, 12, 11, 13, 11, 13, 11, 12, 12, 11, 11, 12, 11, 11, 7, + 12, 14, 16, 13, 16, 14, 16, 13, 15, 14, 15, 12, 15, 13, 14, 9, + 8, 12, 11, 11, 12, 12, 12, 11, 11, 12, 10, 10, 11, 11, 10, 7, + 9, 12, 12, 11, 13, 12, 13, 11, 13, 12, 11, 10, 12, 11, 11, 7, + 12, 14, 15, 12, 15, 14, 15, 12, 15, 14, 14, 12, 14, 13, 13, 9, + 11, 15, 13, 13, 15, 14, 14, 13, 14, 15, 11, 11, 14, 14, 12, 9, + 11, 14, 13, 12, 15, 14, 14, 12, 14, 14, 12, 11, 14, 13, 12, 8, + 13, 15, 15, 12, 16, 15, 15, 12, 15, 15, 14, 11, 15, 14, 14, 8, + 8, 12, 12, 11, 11, 11, 12, 11, 11, 12, 11, 11, 10, 10, 10, 7, + 9, 13, 13, 12, 13, 11, 13, 11, 12, 13, 12, 11, 11, 10, 11, 7, + 12, 14, 15, 14, 15, 13, 15, 12, 15, 14, 14, 13, 14, 12, 13, 9, + 9, 13, 12, 12, 12, 12, 12, 11, 12, 13, 11, 11, 11, 11, 10, 7, + 9, 12, 12, 11, 12, 11, 12, 10, 12, 12, 11, 10, 11, 10, 10, 7, + 11, 13, 14, 12, 14, 12, 14, 11, 14, 13, 13, 11, 13, 11, 12, 7, + 12, 15, 14, 13, 15, 14, 14, 13, 15, 15, 13, 12, 13, 13, 12, 9, + 11, 14, 13, 12, 14, 13, 13, 11, 14, 14, 12, 11, 13, 12, 11, 7, + 11, 14, 14, 12, 14, 13, 14, 11, 14, 14, 13, 11, 13, 12, 12, 7, + 11, 15, 15, 14, 13, 13, 14, 13, 14, 15, 14, 13, 11, 11, 12, 9, + 12, 15, 15, 14, 14, 12, 14, 12, 14, 14, 14, 13, 12, 11, 12, 8, + 13, 16, 16, 15, 15, 12, 16, 13, 16, 15, 15, 14, 14, 12, 14, 9, + 12, 15, 15, 14, 14, 14, 14, 13, 15, 15, 14, 13, 12, 12, 12, 9, + 11, 14, 14, 13, 13, 12, 13, 11, 14, 13, 13, 12, 12, 11, 11, 7, + 12, 14, 15, 13, 14, 12, 14, 11, 15, 14, 13, 12, 13, 11, 12, 7, + 13, 16, 16, 15, 16, 15, 15, 14, 16, 16, 15, 14, 14, 14, 12, 9, + 12, 15, 14, 13, 14, 13, 14, 12, 15, 14, 13, 12, 13, 12, 12, 8, + 12, 14, 14, 13, 15, 13, 14, 11, 14, 14, 13, 12, 13, 12, 12, 6, + 10, 14, 14, 13, 14, 14, 14, 13, 12, 13, 12, 12, 12, 12, 11, 9, + 12, 15, 15, 14, 15, 14, 16, 14, 14, 14, 13, 12, 14, 13, 13, 9, + 14, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 14, 16, 14, 16, 11, + 11, 15, 14, 14, 15, 14, 14, 14, 13, 14, 11, 12, 13, 13, 12, 9, + 12, 15, 14, 14, 15, 14, 15, 13, 14, 14, 13, 12, 14, 13, 13, 9, + 13, 16, 16, 14, 16, 15, 16, 14, 16, 15, 15, 12, 16, 14, 14, 9, + 13, 16, 14, 15, 16, 16, 16, 14, 14, 16, 11, 12, 15, 14, 12, 9, + 13, 16, 15, 14, 16, 15, 16, 14, 15, 15, 12, 11, 15, 14, 13, 9, + 14, 16, 16, 13, 16, 16, 16, 14, 16, 15, 13, 11, 16, 14, 14, 9, + 11, 15, 15, 14, 14, 14, 14, 13, 13, 14, 13, 13, 11, 11, 11, 9, + 12, 15, 15, 14, 15, 14, 15, 13, 14, 14, 13, 13, 13, 12, 12, 9, + 13, 16, 16, 16, 16, 14, 16, 14, 16, 15, 16, 14, 15, 12, 14, 9, + 11, 15, 14, 14, 15, 14, 14, 13, 14, 14, 12, 12, 12, 12, 11, 8, + 11, 14, 14, 13, 14, 13, 13, 12, 13, 13, 12, 11, 12, 11, 11, 7, + 12, 14, 15, 13, 15, 13, 14, 13, 14, 14, 13, 12, 13, 12, 12, 8, + 13, 16, 15, 15, 16, 15, 15, 14, 15, 16, 12, 12, 14, 14, 11, 9, + 12, 15, 14, 13, 15, 13, 14, 12, 14, 14, 12, 11, 13, 12, 11, 7, + 12, 14, 14, 13, 15, 13, 14, 12, 15, 14, 13, 10, 13, 12, 12, 6, + 12, 16, 16, 15, 14, 14, 15, 14, 13, 15, 14, 14, 10, 11, 11, 9, + 13, 16, 16, 15, 15, 14, 15, 14, 15, 15, 15, 14, 12, 11, 12, 8, + 14, 16, 16, 16, 16, 14, 16, 14, 16, 15, 15, 14, 14, 11, 14, 8, + 12, 16, 16, 15, 15, 14, 15, 14, 14, 16, 14, 14, 12, 12, 11, 8, + 11, 14, 14, 13, 14, 13, 14, 12, 14, 14, 13, 12, 12, 11, 11, 7, + 12, 14, 15, 13, 14, 13, 14, 12, 14, 14, 13, 12, 13, 11, 12, 6, + 14, 16, 16, 16, 16, 16, 15, 14, 16, 16, 14, 13, 13, 13, 11, 8, + 12, 15, 15, 13, 15, 13, 14, 12, 14, 14, 13, 12, 13, 12, 10, 6, + 11, 14, 13, 12, 14, 12, 13, 10, 14, 13, 12, 10, 12, 10, 10, 4, +}, +{ + 4, 6, 6, 6, 6, 6, 7, 6, 6, 7, 6, 6, 6, 6, 6, 3, + 6, 9, 10, 9, 10, 9, 11, 9, 10, 10, 10, 9, 10, 9, 10, 6, + 10, 11, 14, 11, 14, 11, 14, 11, 14, 13, 14, 11, 14, 11, 13, 9, + 6, 10, 9, 9, 10, 10, 10, 9, 10, 11, 9, 9, 10, 10, 9, 6, + 8, 11, 11, 9, 12, 11, 12, 10, 12, 12, 11, 10, 12, 11, 11, 7, + 11, 13, 14, 11, 15, 13, 15, 11, 15, 14, 14, 11, 15, 13, 14, 9, + 10, 13, 11, 11, 14, 14, 13, 11, 14, 14, 11, 11, 13, 13, 11, 9, + 11, 14, 12, 11, 15, 14, 14, 11, 15, 15, 13, 11, 14, 14, 13, 9, + 12, 14, 13, 10, 16, 15, 16, 11, 16, 16, 14, 11, 16, 14, 14, 9, + 6, 10, 10, 10, 9, 9, 10, 9, 10, 11, 10, 10, 9, 9, 9, 6, + 8, 11, 12, 11, 11, 10, 12, 10, 12, 12, 12, 11, 11, 10, 11, 7, + 11, 13, 15, 13, 14, 11, 15, 11, 15, 14, 14, 13, 14, 12, 14, 9, + 8, 12, 12, 12, 12, 12, 12, 11, 12, 13, 11, 11, 11, 11, 11, 8, + 9, 12, 12, 11, 12, 12, 13, 11, 13, 13, 12, 11, 12, 11, 11, 8, + 11, 14, 15, 13, 14, 13, 15, 11, 15, 15, 14, 13, 15, 13, 14, 9, + 12, 16, 14, 14, 15, 15, 14, 12, 15, 16, 14, 13, 14, 14, 13, 10, + 11, 15, 14, 13, 15, 14, 15, 12, 15, 16, 14, 13, 15, 14, 13, 9, + 13, 15, 15, 12, 16, 15, 16, 12, 16, 16, 15, 13, 15, 14, 14, 9, + 10, 14, 14, 14, 11, 11, 13, 11, 14, 14, 14, 13, 11, 11, 11, 9, + 11, 14, 15, 14, 13, 11, 14, 12, 15, 15, 15, 14, 13, 11, 13, 9, + 13, 14, 16, 15, 14, 11, 16, 12, 16, 16, 16, 14, 15, 12, 15, 10, + 12, 16, 15, 15, 14, 14, 14, 12, 16, 16, 14, 14, 14, 13, 13, 10, + 12, 15, 15, 14, 14, 13, 14, 12, 15, 16, 14, 14, 14, 13, 13, 9, + 13, 16, 16, 14, 16, 13, 16, 12, 16, 16, 16, 14, 16, 13, 15, 10, + 14, 16, 16, 16, 16, 16, 15, 14, 16, 16, 16, 16, 16, 16, 14, 11, + 13, 16, 16, 15, 16, 16, 16, 13, 16, 16, 16, 15, 16, 15, 14, 10, + 14, 16, 16, 14, 16, 14, 16, 12, 16, 16, 16, 15, 16, 15, 15, 10, + 6, 10, 10, 10, 10, 10, 11, 10, 9, 10, 9, 9, 9, 9, 9, 6, + 9, 12, 12, 11, 12, 11, 13, 11, 12, 12, 11, 10, 12, 11, 11, 8, + 12, 14, 15, 14, 15, 14, 16, 13, 15, 14, 14, 12, 15, 13, 14, 10, + 8, 12, 11, 11, 12, 12, 12, 11, 11, 12, 10, 10, 11, 11, 10, 7, + 9, 12, 12, 11, 13, 12, 13, 11, 12, 13, 11, 10, 12, 12, 11, 8, + 11, 14, 14, 13, 15, 14, 15, 13, 15, 14, 14, 12, 15, 13, 14, 9, + 11, 15, 12, 13, 15, 15, 14, 13, 14, 15, 11, 11, 14, 14, 12, 9, + 11, 14, 13, 13, 15, 14, 15, 13, 15, 15, 13, 11, 15, 14, 13, 9, + 13, 15, 15, 12, 16, 15, 16, 13, 16, 15, 14, 11, 16, 15, 14, 9, + 8, 12, 12, 11, 11, 11, 12, 11, 11, 12, 11, 11, 9, 10, 10, 7, + 9, 12, 13, 12, 12, 11, 13, 11, 12, 13, 12, 12, 11, 11, 11, 8, + 12, 14, 15, 14, 15, 13, 16, 13, 15, 14, 15, 13, 14, 12, 14, 9, + 9, 13, 12, 12, 12, 12, 13, 12, 12, 13, 11, 11, 11, 11, 10, 8, + 9, 12, 12, 12, 12, 12, 13, 11, 12, 13, 11, 11, 12, 11, 11, 7, + 11, 13, 14, 13, 14, 13, 15, 12, 14, 14, 14, 12, 14, 12, 13, 8, + 12, 15, 14, 14, 15, 15, 14, 13, 15, 16, 13, 13, 14, 14, 12, 9, + 11, 14, 13, 13, 14, 14, 14, 12, 14, 15, 13, 12, 14, 13, 12, 8, + 11, 14, 14, 13, 15, 14, 15, 12, 15, 15, 14, 12, 14, 13, 13, 8, + 11, 14, 14, 14, 13, 13, 14, 13, 13, 14, 14, 13, 11, 11, 11, 9, + 11, 15, 15, 14, 14, 13, 15, 13, 14, 15, 14, 14, 13, 11, 13, 9, + 13, 16, 16, 16, 15, 13, 16, 13, 16, 16, 16, 15, 15, 12, 15, 10, + 11, 15, 15, 15, 14, 14, 14, 13, 15, 15, 14, 14, 13, 13, 12, 9, + 11, 14, 14, 13, 13, 13, 14, 12, 14, 14, 13, 13, 13, 12, 12, 8, + 12, 15, 15, 14, 15, 13, 15, 12, 15, 15, 14, 13, 14, 12, 13, 8, + 13, 16, 16, 16, 16, 16, 16, 14, 16, 16, 15, 15, 15, 15, 13, 10, + 12, 15, 15, 14, 15, 14, 15, 13, 15, 16, 14, 13, 14, 14, 13, 9, + 12, 15, 15, 14, 15, 14, 15, 12, 15, 15, 14, 13, 14, 13, 13, 8, + 10, 14, 13, 13, 14, 13, 14, 13, 11, 13, 11, 11, 11, 11, 11, 9, + 12, 15, 16, 14, 15, 14, 16, 14, 14, 14, 14, 13, 14, 13, 13, 10, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 13, 16, 14, 16, 11, + 11, 15, 14, 14, 15, 14, 15, 14, 13, 14, 11, 12, 13, 13, 11, 9, + 12, 15, 15, 14, 15, 15, 16, 14, 14, 14, 13, 12, 14, 13, 13, 9, + 13, 16, 16, 15, 16, 16, 16, 15, 16, 15, 15, 12, 16, 14, 15, 10, + 12, 16, 14, 15, 16, 16, 16, 14, 14, 16, 11, 12, 14, 15, 12, 9, + 13, 16, 15, 14, 16, 16, 16, 14, 15, 16, 13, 12, 15, 15, 13, 9, + 14, 16, 16, 14, 16, 16, 16, 15, 16, 16, 14, 12, 16, 15, 15, 10, + 11, 14, 14, 14, 14, 14, 14, 13, 12, 14, 13, 13, 11, 11, 11, 9, + 11, 15, 15, 14, 14, 14, 16, 14, 14, 14, 14, 13, 13, 12, 13, 9, + 13, 16, 16, 16, 16, 15, 16, 15, 16, 15, 16, 14, 15, 13, 15, 10, + 11, 15, 15, 14, 14, 14, 15, 14, 14, 15, 13, 13, 12, 13, 11, 9, + 11, 14, 14, 13, 14, 14, 14, 13, 13, 14, 13, 12, 13, 12, 12, 8, + 12, 15, 15, 14, 16, 14, 16, 14, 15, 15, 15, 13, 14, 13, 14, 9, + 13, 16, 15, 16, 16, 16, 16, 15, 15, 16, 13, 13, 14, 14, 12, 9, + 12, 15, 14, 14, 15, 15, 15, 13, 14, 15, 13, 12, 14, 13, 12, 8, + 12, 15, 14, 14, 15, 15, 15, 13, 15, 15, 14, 12, 14, 13, 13, 8, + 12, 16, 15, 15, 13, 14, 15, 14, 13, 15, 14, 14, 10, 11, 11, 9, + 12, 16, 16, 15, 15, 14, 16, 14, 15, 15, 15, 14, 13, 12, 13, 9, + 14, 16, 16, 16, 16, 14, 16, 15, 16, 15, 16, 15, 14, 12, 15, 10, + 12, 16, 15, 15, 15, 15, 15, 14, 15, 16, 14, 14, 12, 13, 11, 9, + 11, 15, 15, 14, 14, 14, 15, 13, 14, 15, 14, 13, 13, 12, 12, 8, + 12, 15, 15, 14, 15, 14, 15, 13, 15, 15, 14, 13, 14, 12, 13, 8, + 14, 16, 16, 16, 16, 16, 16, 15, 16, 16, 14, 14, 14, 14, 11, 9, + 12, 15, 15, 14, 15, 15, 15, 13, 15, 15, 14, 13, 14, 13, 12, 8, + 11, 14, 14, 13, 14, 13, 14, 12, 13, 14, 13, 12, 13, 12, 12, 7, +}, +{ + 2, 6, 6, 5, 6, 6, 7, 6, 6, 7, 6, 6, 6, 6, 6, 3, + 6, 9, 10, 9, 10, 9, 11, 9, 10, 10, 10, 9, 10, 9, 10, 7, + 10, 11, 14, 11, 14, 11, 14, 11, 14, 13, 14, 12, 14, 12, 13, 9, + 6, 10, 9, 9, 10, 10, 10, 9, 10, 11, 9, 9, 10, 10, 9, 7, + 8, 11, 11, 9, 12, 11, 12, 10, 12, 12, 11, 10, 12, 11, 11, 8, + 11, 13, 14, 11, 16, 13, 15, 12, 16, 14, 14, 12, 15, 13, 14, 10, + 10, 13, 11, 11, 14, 14, 13, 11, 13, 14, 11, 11, 13, 13, 11, 9, + 11, 13, 13, 11, 15, 14, 14, 12, 15, 15, 13, 12, 15, 14, 13, 10, + 12, 14, 14, 11, 16, 15, 16, 12, 16, 16, 15, 12, 16, 15, 15, 10, + 6, 10, 10, 10, 9, 9, 10, 9, 10, 11, 10, 10, 9, 9, 9, 7, + 8, 11, 12, 11, 11, 10, 12, 10, 12, 12, 12, 11, 11, 10, 11, 8, + 12, 13, 16, 13, 14, 11, 16, 12, 16, 15, 15, 13, 14, 12, 14, 10, + 9, 13, 12, 12, 12, 12, 12, 11, 13, 13, 12, 12, 12, 12, 11, 8, + 10, 13, 13, 12, 13, 12, 13, 11, 14, 14, 13, 12, 13, 12, 12, 9, + 12, 14, 16, 13, 15, 13, 15, 12, 16, 16, 16, 13, 16, 14, 14, 10, + 12, 16, 14, 14, 16, 15, 14, 13, 16, 16, 14, 14, 15, 15, 13, 11, + 12, 16, 15, 14, 16, 15, 15, 12, 16, 16, 15, 14, 16, 15, 14, 10, + 14, 16, 16, 14, 16, 15, 16, 13, 16, 16, 16, 14, 16, 16, 15, 11, + 10, 14, 14, 13, 11, 11, 13, 12, 14, 14, 13, 13, 11, 11, 12, 9, + 12, 14, 16, 14, 13, 11, 14, 12, 16, 15, 15, 14, 14, 12, 13, 10, + 13, 14, 16, 15, 14, 11, 16, 12, 16, 16, 16, 15, 16, 13, 15, 11, + 12, 16, 15, 15, 14, 14, 14, 13, 16, 16, 15, 15, 14, 14, 13, 11, + 13, 16, 16, 15, 14, 14, 15, 13, 16, 16, 16, 15, 15, 14, 14, 11, + 14, 16, 16, 15, 16, 14, 16, 13, 16, 16, 16, 15, 16, 14, 15, 11, + 15, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 14, 12, + 15, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 15, 12, + 15, 16, 16, 15, 16, 15, 16, 13, 16, 16, 16, 16, 16, 16, 16, 11, + 6, 10, 10, 10, 10, 10, 11, 10, 9, 10, 9, 9, 9, 9, 9, 7, + 9, 12, 13, 12, 13, 12, 14, 12, 12, 12, 12, 11, 12, 11, 11, 8, + 12, 14, 16, 14, 16, 14, 16, 14, 15, 14, 15, 13, 16, 13, 14, 11, + 8, 12, 11, 11, 12, 12, 12, 11, 11, 12, 10, 10, 11, 11, 10, 8, + 10, 13, 13, 12, 14, 13, 14, 12, 13, 13, 12, 11, 13, 12, 12, 9, + 12, 15, 15, 13, 16, 15, 16, 14, 16, 15, 15, 12, 16, 14, 15, 10, + 11, 15, 13, 13, 16, 15, 14, 13, 14, 15, 11, 12, 14, 14, 12, 10, + 12, 16, 14, 13, 16, 16, 16, 14, 16, 15, 13, 12, 15, 15, 14, 10, + 14, 16, 16, 14, 16, 16, 16, 14, 16, 16, 15, 13, 16, 16, 15, 11, + 8, 12, 12, 12, 11, 11, 12, 11, 11, 12, 11, 11, 9, 10, 10, 8, + 10, 13, 14, 13, 13, 12, 14, 12, 13, 13, 13, 12, 12, 11, 12, 9, + 13, 15, 16, 15, 16, 14, 16, 14, 16, 15, 16, 14, 15, 13, 15, 11, + 10, 13, 13, 13, 13, 13, 13, 12, 13, 14, 12, 12, 12, 12, 11, 9, + 10, 13, 13, 13, 13, 13, 14, 12, 13, 14, 13, 12, 12, 12, 12, 9, + 12, 15, 15, 14, 16, 14, 16, 13, 16, 15, 15, 13, 15, 13, 14, 10, + 13, 16, 15, 15, 16, 16, 15, 14, 16, 16, 13, 14, 15, 15, 12, 10, + 12, 16, 14, 14, 16, 16, 15, 13, 16, 16, 14, 13, 15, 14, 13, 10, + 13, 16, 16, 14, 16, 15, 16, 13, 16, 16, 16, 13, 16, 15, 15, 10, + 11, 15, 15, 14, 13, 13, 14, 13, 13, 15, 14, 14, 11, 12, 12, 10, + 12, 15, 16, 15, 14, 13, 16, 14, 16, 15, 16, 14, 13, 12, 13, 10, + 14, 16, 16, 16, 16, 14, 16, 14, 16, 16, 16, 16, 16, 13, 16, 11, + 12, 16, 16, 16, 15, 15, 15, 14, 15, 16, 14, 14, 13, 14, 12, 10, + 12, 16, 16, 15, 15, 14, 16, 13, 16, 16, 15, 14, 14, 13, 13, 10, + 13, 16, 16, 15, 16, 14, 16, 13, 16, 16, 16, 15, 16, 14, 15, 10, + 15, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 13, 12, + 14, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 15, 16, 15, 14, 11, + 14, 16, 16, 15, 16, 16, 16, 13, 16, 16, 16, 15, 16, 15, 14, 10, + 10, 14, 13, 13, 13, 13, 14, 13, 11, 13, 11, 11, 11, 11, 11, 9, + 12, 15, 16, 15, 16, 15, 16, 14, 14, 14, 14, 13, 14, 13, 14, 11, + 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 14, 16, 12, + 11, 15, 14, 14, 15, 15, 15, 14, 13, 14, 11, 12, 13, 13, 12, 10, + 13, 16, 15, 15, 16, 16, 16, 15, 15, 15, 13, 12, 15, 14, 13, 10, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 12, + 13, 16, 14, 15, 16, 16, 16, 15, 14, 16, 11, 12, 15, 15, 12, 10, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, 13, 16, 16, 14, 11, + 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 11, + 11, 15, 15, 14, 13, 14, 14, 14, 13, 14, 13, 13, 11, 12, 11, 10, + 12, 16, 16, 16, 16, 15, 16, 15, 15, 15, 15, 14, 13, 12, 14, 10, + 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 14, 16, 12, + 12, 16, 15, 15, 16, 16, 16, 14, 14, 15, 13, 13, 13, 13, 12, 10, + 12, 16, 16, 15, 15, 15, 16, 14, 14, 15, 14, 13, 14, 13, 13, 10, + 14, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 14, 16, 14, 15, 11, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 14, 15, 15, 12, 11, + 13, 16, 16, 15, 16, 16, 16, 14, 16, 16, 14, 13, 16, 14, 13, 10, + 14, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 14, 16, 14, 15, 10, + 12, 16, 16, 15, 14, 15, 16, 14, 13, 15, 14, 14, 11, 12, 12, 10, + 13, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 15, 13, 12, 14, 11, + 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, 16, 11, + 14, 16, 16, 16, 16, 16, 16, 15, 16, 16, 15, 15, 13, 14, 12, 11, + 13, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 14, 14, 13, 13, 10, + 14, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 15, 15, 14, 14, 10, + 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 15, 16, 13, 11, + 14, 16, 16, 16, 16, 16, 16, 14, 16, 16, 15, 14, 15, 14, 13, 10, + 12, 15, 15, 14, 15, 14, 16, 14, 14, 16, 15, 13, 14, 13, 13, 9, +}, +{ + 2, 5, 5, 5, 5, 5, 6, 6, 5, 6, 5, 6, 5, 6, 6, 4, + 6, 8, 10, 8, 10, 9, 11, 9, 10, 10, 10, 9, 10, 9, 10, 8, + 10, 11, 13, 11, 13, 11, 14, 11, 14, 13, 13, 12, 13, 12, 13, 10, + 6, 10, 8, 9, 10, 10, 10, 9, 10, 11, 9, 9, 10, 10, 9, 7, + 8, 11, 11, 10, 12, 11, 12, 10, 12, 12, 11, 10, 12, 12, 11, 9, + 11, 13, 14, 11, 15, 14, 15, 12, 16, 14, 14, 12, 15, 14, 14, 11, + 10, 13, 11, 11, 14, 13, 13, 12, 13, 14, 11, 11, 13, 13, 12, 10, + 11, 14, 13, 11, 16, 14, 14, 12, 15, 15, 14, 12, 15, 14, 14, 11, + 12, 14, 14, 11, 16, 16, 16, 13, 16, 16, 16, 13, 16, 16, 15, 12, + 6, 10, 10, 10, 8, 9, 10, 9, 10, 11, 10, 10, 9, 9, 9, 8, + 8, 11, 12, 12, 11, 10, 12, 11, 12, 12, 12, 12, 12, 11, 12, 9, + 11, 13, 16, 14, 14, 12, 15, 12, 16, 15, 16, 14, 14, 13, 14, 11, + 9, 13, 12, 12, 12, 12, 12, 11, 13, 13, 12, 12, 12, 12, 11, 10, + 10, 13, 13, 12, 13, 12, 13, 11, 14, 14, 13, 13, 13, 13, 12, 10, + 13, 14, 16, 14, 15, 14, 16, 13, 16, 16, 16, 14, 16, 14, 15, 12, + 12, 16, 14, 14, 16, 15, 14, 13, 16, 16, 14, 14, 15, 15, 13, 12, + 13, 16, 15, 14, 16, 16, 15, 13, 16, 16, 15, 14, 16, 16, 14, 12, + 14, 16, 16, 14, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, 12, + 10, 13, 14, 13, 11, 11, 13, 12, 13, 14, 13, 13, 11, 12, 12, 10, + 11, 14, 15, 15, 13, 12, 14, 13, 16, 16, 16, 15, 14, 13, 14, 11, + 12, 14, 16, 16, 14, 12, 16, 13, 16, 16, 16, 16, 15, 13, 16, 12, + 12, 16, 15, 16, 14, 15, 14, 14, 16, 16, 15, 16, 14, 14, 13, 12, + 13, 16, 16, 16, 16, 14, 16, 13, 16, 16, 16, 16, 16, 14, 15, 12, + 14, 16, 16, 16, 16, 14, 16, 14, 16, 16, 16, 16, 16, 15, 16, 13, + 15, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 15, 13, + 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 13, + 15, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, 13, + 6, 10, 10, 10, 10, 10, 10, 10, 8, 10, 9, 9, 8, 9, 9, 7, + 9, 12, 13, 12, 13, 12, 13, 12, 12, 12, 12, 11, 12, 11, 12, 10, + 12, 14, 16, 14, 16, 14, 16, 14, 16, 15, 15, 14, 16, 14, 15, 12, + 8, 12, 11, 11, 12, 12, 12, 11, 11, 12, 10, 10, 11, 12, 10, 9, + 10, 13, 13, 12, 14, 13, 14, 12, 13, 13, 12, 11, 13, 13, 12, 10, + 13, 15, 16, 14, 16, 16, 16, 14, 16, 15, 15, 13, 16, 15, 15, 12, + 11, 15, 13, 13, 15, 15, 15, 14, 14, 14, 11, 12, 14, 14, 12, 11, + 13, 16, 14, 14, 16, 16, 16, 14, 16, 15, 13, 13, 16, 14, 14, 11, + 14, 16, 16, 14, 16, 16, 16, 15, 16, 16, 16, 14, 16, 16, 16, 12, + 8, 12, 12, 12, 11, 11, 12, 12, 11, 12, 11, 11, 9, 10, 10, 9, + 10, 13, 14, 13, 13, 12, 14, 13, 13, 13, 13, 13, 12, 11, 12, 10, + 13, 15, 16, 15, 16, 14, 16, 14, 16, 16, 16, 15, 16, 13, 15, 12, + 10, 14, 13, 13, 13, 13, 13, 13, 13, 14, 12, 12, 12, 12, 11, 10, + 10, 13, 13, 13, 13, 13, 14, 12, 13, 14, 13, 12, 13, 12, 12, 10, + 13, 16, 16, 14, 16, 15, 16, 14, 16, 16, 15, 14, 16, 14, 15, 11, + 13, 16, 15, 16, 16, 16, 15, 14, 16, 16, 14, 14, 15, 15, 13, 12, + 13, 16, 15, 14, 16, 16, 16, 14, 16, 16, 14, 14, 15, 15, 14, 11, + 14, 16, 16, 15, 16, 16, 16, 14, 16, 16, 16, 15, 16, 16, 15, 12, + 11, 14, 15, 14, 13, 13, 14, 14, 13, 15, 14, 14, 11, 12, 12, 11, + 13, 16, 16, 16, 14, 14, 16, 14, 16, 16, 16, 15, 14, 13, 14, 12, + 14, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, 14, 16, 13, + 13, 16, 16, 16, 15, 16, 15, 15, 16, 16, 15, 16, 14, 14, 13, 12, + 13, 16, 16, 15, 15, 14, 16, 14, 16, 16, 16, 15, 14, 14, 14, 11, + 14, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 15, 16, 12, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 13, + 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 12, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 12, + 9, 13, 13, 13, 13, 13, 14, 13, 10, 12, 11, 12, 11, 12, 11, 10, + 12, 15, 16, 15, 16, 16, 16, 16, 14, 14, 14, 13, 14, 13, 14, 12, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 14, + 11, 15, 14, 14, 15, 14, 15, 14, 13, 14, 11, 12, 13, 13, 12, 11, + 13, 16, 16, 15, 16, 16, 16, 15, 15, 15, 14, 13, 16, 15, 14, 12, + 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 13, + 12, 16, 14, 15, 16, 16, 16, 16, 14, 16, 11, 13, 15, 16, 13, 12, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 14, 16, 16, 15, 12, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 13, + 11, 15, 14, 14, 13, 14, 15, 14, 12, 14, 13, 13, 11, 12, 12, 11, + 13, 16, 16, 16, 16, 15, 16, 16, 15, 15, 15, 15, 14, 13, 14, 12, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 13, + 13, 16, 16, 16, 16, 16, 16, 15, 14, 16, 13, 14, 13, 14, 13, 11, + 13, 16, 16, 16, 16, 16, 16, 15, 15, 16, 15, 14, 14, 14, 14, 11, + 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 12, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 15, 16, 16, 13, 12, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 14, 16, 16, 15, 12, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 12, + 11, 16, 16, 15, 13, 15, 16, 15, 13, 15, 15, 15, 11, 12, 12, 11, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 14, 15, 12, + 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 13, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 14, 14, 13, 12, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 14, 14, 12, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 12, + 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 14, 13, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 12, + 12, 14, 14, 14, 14, 15, 16, 14, 14, 16, 15, 14, 14, 15, 14, 11, +}, +{ + 1, 5, 5, 6, 5, 6, 7, 7, 5, 7, 6, 7, 5, 6, 6, 6, + 6, 9, 10, 9, 10, 9, 11, 10, 11, 11, 11, 10, 11, 10, 11, 9, + 10, 11, 14, 12, 14, 12, 16, 12, 16, 13, 16, 13, 14, 13, 16, 12, + 6, 10, 9, 9, 10, 11, 11, 10, 10, 11, 9, 10, 10, 11, 10, 9, + 8, 11, 11, 10, 13, 12, 13, 12, 13, 13, 12, 12, 13, 13, 13, 11, + 11, 13, 16, 12, 16, 16, 16, 13, 16, 16, 16, 14, 16, 16, 16, 13, + 10, 14, 11, 12, 14, 14, 13, 13, 13, 16, 12, 13, 14, 16, 13, 12, + 11, 14, 13, 12, 16, 16, 16, 14, 16, 16, 14, 14, 16, 16, 16, 13, + 12, 14, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 6, 10, 10, 11, 9, 9, 11, 10, 10, 11, 11, 11, 9, 10, 10, 9, + 9, 12, 13, 12, 12, 11, 13, 12, 13, 13, 13, 13, 12, 12, 13, 11, + 12, 13, 16, 16, 16, 13, 16, 14, 16, 16, 16, 16, 16, 14, 16, 13, + 9, 13, 13, 13, 13, 13, 13, 13, 13, 14, 13, 13, 13, 13, 12, 11, + 10, 14, 14, 13, 14, 13, 14, 13, 16, 16, 14, 15, 14, 14, 14, 12, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 14, 14, 16, 11, 12, 14, 13, 14, 16, 16, 16, 12, 13, 13, 12, + 12, 16, 16, 16, 13, 13, 16, 14, 16, 16, 16, 16, 16, 14, 16, 13, + 13, 16, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 6, 10, 10, 10, 10, 11, 11, 11, 9, 11, 9, 10, 9, 10, 10, 9, + 9, 13, 13, 13, 13, 13, 14, 13, 12, 13, 13, 12, 13, 12, 13, 11, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 8, 13, 12, 12, 13, 13, 13, 13, 11, 13, 10, 12, 12, 13, 12, 11, + 10, 14, 13, 13, 16, 16, 16, 14, 14, 14, 13, 13, 14, 14, 14, 12, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 11, 16, 13, 16, 16, 16, 16, 16, 14, 16, 12, 13, 16, 16, 14, 13, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 8, 13, 13, 13, 11, 12, 13, 13, 11, 13, 12, 13, 10, 12, 12, 11, + 10, 14, 16, 16, 14, 13, 16, 14, 14, 16, 16, 14, 13, 13, 14, 12, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 10, 16, 14, 16, 14, 14, 14, 14, 13, 16, 13, 14, 13, 14, 12, 12, + 10, 14, 14, 14, 14, 16, 16, 14, 14, 16, 14, 14, 14, 14, 14, 12, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 16, 16, 16, 13, 16, 16, 16, 14, 16, 16, 16, 12, 14, 14, 13, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 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, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 9, 14, 13, 14, 13, 14, 16, 16, 11, 13, 12, 13, 11, 13, 12, 12, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 16, 14, 16, 16, 16, 16, 16, 13, 16, 12, 13, 14, 16, 13, 13, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 16, 16, 16, 16, 16, 16, 14, 16, 12, 16, 16, 16, 14, 14, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 16, 16, 16, 14, 16, 16, 16, 13, 16, 14, 16, 12, 13, 13, 13, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 14, 14, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 16, 16, 16, 14, 16, 16, 16, 14, 16, 16, 16, 12, 16, 14, 14, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, +}, +{ + 1, 5, 5, 6, 5, 6, 7, 8, 5, 7, 6, 8, 6, 7, 7, 7, + 5, 9, 10, 10, 10, 10, 12, 11, 10, 11, 11, 11, 10, 11, 12, 10, + 9, 11, 13, 12, 13, 12, 16, 14, 16, 14, 16, 16, 16, 13, 16, 13, + 5, 10, 9, 10, 10, 11, 11, 11, 10, 11, 9, 11, 10, 11, 11, 10, + 8, 11, 11, 11, 12, 13, 13, 13, 12, 13, 12, 12, 13, 13, 13, 12, + 11, 13, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 9, 14, 11, 12, 14, 16, 13, 14, 13, 16, 12, 14, 16, 16, 13, 13, + 11, 16, 13, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 14, 14, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 5, 10, 11, 11, 9, 10, 11, 11, 10, 12, 11, 12, 9, 11, 11, 11, + 8, 12, 13, 13, 11, 11, 14, 13, 13, 14, 13, 16, 12, 12, 13, 12, + 11, 13, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 9, 13, 12, 13, 12, 13, 13, 14, 13, 16, 13, 16, 13, 16, 13, 13, + 10, 14, 13, 14, 13, 13, 16, 14, 16, 16, 16, 16, 16, 16, 16, 13, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 9, 14, 16, 16, 11, 12, 14, 16, 13, 16, 16, 16, 12, 14, 13, 13, + 11, 16, 16, 16, 13, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 16, 16, 14, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 5, 10, 10, 11, 10, 11, 12, 12, 8, 11, 10, 11, 9, 11, 11, 11, + 9, 12, 13, 13, 13, 13, 16, 16, 12, 13, 13, 13, 13, 13, 16, 13, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 8, 13, 11, 13, 12, 13, 13, 14, 11, 13, 10, 13, 12, 14, 12, 12, + 10, 14, 13, 14, 16, 16, 16, 16, 13, 16, 13, 14, 16, 16, 16, 14, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 16, 13, 16, 16, 16, 16, 16, 13, 16, 12, 16, 16, 16, 16, 16, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 8, 13, 13, 13, 11, 13, 14, 16, 11, 13, 13, 14, 10, 12, 12, 12, + 10, 14, 16, 16, 13, 16, 16, 16, 13, 16, 16, 16, 13, 13, 16, 14, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 14, 16, 13, 16, 16, 16, 13, 16, 13, 16, 13, 16, 13, 14, + 10, 16, 16, 16, 14, 16, 16, 16, 14, 16, 16, 16, 13, 16, 16, 13, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 16, 16, 13, 16, 16, 16, 14, 16, 16, 16, 12, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 9, 14, 13, 16, 13, 16, 16, 16, 10, 14, 12, 14, 11, 13, 13, 13, + 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, 16, 16, 16, + 11, 16, 16, 16, 16, 16, 16, 16, 12, 16, 12, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 16, 16, 16, 16, 16, 16, 16, 13, 16, 13, 16, 16, 16, 16, 16, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 16, 16, 14, 16, 16, 16, 12, 16, 16, 16, 12, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 16, 16, 16, 14, 16, 16, 16, 14, 16, 16, 16, 12, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 14, +} +}; + + +static const uint8_t rv34_inter_cbp[NUM_INTER_TABLES][4][CBP_VLC_SIZE] = { +{ + { 0, 6, 6, 3, 6, 4, 5, 3, 6, 5, 4, 3, 3, 4, 4, 3 }, + { 0, 6, 6, 4, 6, 4, 5, 3, 6, 5, 4, 3, 4, 4, 4, 2 }, + { 0, 7, 7, 4, 7, 5, 5, 4, 7, 5, 5, 4, 5, 4, 4, 1 }, + { 0, 7, 7, 5, 7, 5, 6, 4, 7, 6, 5, 3, 5, 4, 4, 1 } +}, +{ + { 0, 6, 6, 3, 6, 3, 5, 4, 6, 5, 3, 4, 3, 4, 4, 3 }, + { 0, 6, 6, 4, 6, 4, 4, 4, 6, 4, 4, 3, 4, 4, 4, 2 }, + { 0, 6, 6, 4, 6, 4, 5, 4, 6, 5, 4, 3, 4, 4, 3, 2 }, + { 0, 7, 7, 5, 7, 5, 6, 4, 7, 6, 5, 3, 5, 4, 4, 1 } +}, +{ + { 0, 6, 6, 3, 6, 3, 5, 4, 6, 5, 3, 4, 3, 4, 4, 3 }, + { 0, 5, 5, 3, 5, 4, 5, 4, 5, 5, 4, 4, 4, 4, 4, 2 }, + { 0, 6, 6, 4, 6, 4, 5, 3, 6, 5, 4, 3, 4, 4, 4, 2 }, + { 0, 7, 7, 5, 7, 5, 6, 4, 7, 6, 5, 3, 5, 4, 4, 1 } +}, +{ + { 0, 6, 6, 3, 6, 3, 5, 4, 6, 5, 3, 4, 3, 4, 4, 3 }, + { 0, 5, 5, 3, 5, 4, 5, 4, 5, 5, 4, 4, 4, 4, 4, 2 }, + { 0, 6, 6, 4, 6, 4, 5, 3, 6, 5, 4, 3, 4, 4, 4, 2 }, + { 0, 7, 7, 4, 7, 5, 6, 4, 7, 6, 5, 4, 4, 4, 4, 1 } +}, +{ + { 0, 5, 5, 3, 5, 3, 5, 4, 5, 5, 3, 4, 3, 4, 4, 4 }, + { 0, 5, 5, 3, 5, 4, 5, 4, 5, 5, 3, 4, 3, 4, 4, 3 }, + { 0, 6, 6, 4, 6, 4, 5, 4, 6, 5, 4, 3, 4, 4, 3, 2 }, + { 0, 7, 7, 4, 7, 5, 6, 4, 7, 6, 5, 4, 4, 4, 4, 1 } +}, +{ + { 0, 5, 5, 3, 5, 3, 5, 4, 5, 5, 3, 4, 3, 4, 4, 4 }, + { 0, 5, 5, 3, 5, 4, 5, 4, 5, 5, 3, 4, 3, 4, 4, 3 }, + { 0, 5, 5, 3, 5, 4, 4, 4, 5, 4, 4, 4, 3, 4, 4, 3 }, + { 0, 6, 6, 4, 6, 4, 5, 4, 6, 5, 4, 3, 4, 4, 3, 2 } +}, +{ + { 0, 4, 4, 3, 4, 3, 5, 5, 4, 5, 3, 5, 3, 5, 4, 5 }, + { 0, 4, 4, 3, 4, 4, 5, 4, 4, 5, 3, 5, 3, 5, 4, 4 }, + { 0, 4, 4, 3, 4, 4, 5, 4, 4, 5, 4, 4, 3, 4, 4, 4 }, + { 0, 4, 4, 3, 5, 4, 5, 4, 5, 5, 4, 4, 3, 4, 4, 3 } +} +}; + + +static const uint8_t rv34_table_inter_firstpat[NUM_INTER_TABLES][2][FIRSTBLK_VLC_SIZE] = { + { + { + 0, 7, 5, 7, 5, 7, 6, 6, 7, 10, 7, 9, 8, 9, 8, 7, + 12, 14, 11, 12, 12, 12, 11, 9, 6, 9, 6, 8, 7, 9, 7, 7, + 8, 11, 8, 9, 9, 10, 9, 8, 13, 15, 12, 12, 12, 13, 11, 9, + 10, 13, 9, 10, 11, 12, 9, 8, 12, 14, 10, 11, 12, 13, 10, 9, + 16, 16, 12, 12, 14, 13, 11, 9, 6, 9, 7, 9, 7, 9, 8, 7, + 9, 11, 9, 10, 9, 10, 9, 8, 14, 16, 12, 12, 13, 13, 11, 9, + 8, 11, 8, 10, 9, 10, 9, 8, 10, 13, 10, 11, 10, 11, 9, 8, + 14, 16, 12, 12, 13, 13, 11, 9, 12, 14, 10, 11, 12, 13, 10, 9, + 13, 16, 11, 12, 13, 13, 10, 9, 16, 16, 13, 12, 14, 14, 11, 9, + 11, 13, 11, 12, 10, 11, 10, 9, 13, 14, 12, 12, 11, 12, 10, 9, + 16, 16, 13, 13, 13, 13, 11, 9, 12, 15, 12, 12, 11, 12, 10, 9, + 13, 16, 13, 13, 12, 12, 11, 9, 16, 16, 14, 13, 13, 13, 11, 9, + 14, 16, 13, 13, 13, 14, 11, 9, 16, 16, 13, 13, 14, 14, 11, 9, + 16, 16, 13, 13, 14, 13, 11, 8, 4, 9, 6, 8, 6, 9, 7, 7, + 8, 11, 8, 9, 9, 10, 8, 8, 13, 15, 12, 12, 13, 13, 11, 9, + 7, 10, 7, 9, 8, 10, 8, 8, 9, 12, 9, 10, 10, 11, 9, 8, + 14, 16, 12, 12, 13, 13, 11, 9, 11, 13, 9, 10, 11, 12, 9, 8, + 12, 14, 10, 11, 12, 13, 10, 9, 16, 16, 13, 12, 14, 14, 11, 9, + 7, 10, 8, 9, 8, 10, 8, 8, 10, 12, 10, 11, 10, 11, 9, 8, + 14, 16, 13, 13, 13, 13, 11, 9, 9, 12, 9, 10, 9, 11, 9, 8, + 11, 13, 10, 11, 10, 11, 10, 9, 15, 16, 13, 13, 13, 13, 11, 9, + 12, 14, 11, 11, 12, 13, 10, 9, 13, 16, 11, 12, 13, 13, 10, 9, + 16, 16, 12, 12, 14, 13, 11, 8, 11, 14, 11, 12, 10, 11, 10, 9, + 13, 15, 12, 13, 11, 12, 10, 9, 16, 16, 14, 13, 13, 13, 11, 9, + 12, 15, 12, 13, 11, 12, 10, 9, 13, 16, 13, 13, 12, 12, 11, 9, + 16, 16, 14, 13, 13, 13, 11, 9, 15, 16, 13, 13, 13, 13, 11, 9, + 16, 16, 13, 13, 13, 13, 11, 9, 16, 16, 13, 12, 13, 13, 10, 7, + 8, 11, 8, 10, 9, 11, 9, 9, 10, 13, 10, 11, 11, 12, 10, 9, + 15, 16, 13, 13, 14, 14, 12, 10, 9, 12, 9, 11, 10, 11, 9, 9, + 12, 14, 11, 11, 11, 12, 10, 9, 16, 16, 13, 13, 14, 14, 12, 10, + 12, 14, 10, 11, 12, 13, 10, 9, 14, 16, 11, 12, 13, 14, 10, 9, + 16, 16, 13, 13, 15, 14, 11, 9, 9, 12, 10, 11, 9, 11, 10, 9, + 12, 14, 11, 12, 11, 12, 10, 9, 16, 16, 14, 13, 14, 14, 12, 10, + 11, 14, 10, 12, 11, 12, 10, 9, 12, 15, 11, 12, 12, 13, 11, 10, + 16, 16, 14, 13, 14, 14, 12, 10, 13, 16, 11, 12, 13, 14, 11, 9, + 14, 16, 12, 12, 13, 14, 11, 9, 16, 16, 13, 13, 14, 14, 11, 9, + 12, 15, 12, 13, 10, 12, 10, 9, 14, 16, 13, 13, 11, 12, 11, 10, + 16, 16, 14, 14, 14, 13, 12, 9, 13, 16, 13, 13, 12, 13, 11, 10, + 14, 16, 13, 13, 12, 13, 11, 10, 16, 16, 14, 14, 13, 13, 12, 9, + 15, 16, 13, 13, 13, 14, 11, 9, 16, 16, 13, 13, 13, 14, 11, 9, + 16, 16, 13, 12, 13, 13, 10, 8, 10, 13, 10, 11, 10, 12, 10, 9, + 12, 14, 11, 12, 12, 13, 11, 10, 16, 16, 13, 13, 14, 14, 12, 9, + 11, 14, 10, 11, 11, 12, 10, 9, 13, 16, 11, 12, 12, 13, 11, 10, + 16, 16, 14, 13, 14, 14, 12, 9, 12, 15, 10, 11, 12, 13, 9, 8, + 14, 16, 11, 11, 13, 14, 10, 8, 16, 16, 12, 12, 14, 14, 10, 8, + 11, 14, 11, 12, 11, 12, 10, 9, 13, 16, 12, 13, 12, 13, 11, 10, + 16, 16, 14, 13, 14, 14, 12, 9, 12, 15, 11, 12, 11, 13, 10, 10, + 13, 16, 12, 13, 12, 13, 11, 10, 16, 16, 14, 13, 14, 14, 12, 9, + 13, 16, 11, 11, 13, 13, 10, 8, 14, 16, 11, 12, 13, 14, 10, 8, + 16, 16, 12, 12, 14, 14, 10, 8, 12, 15, 12, 13, 10, 11, 10, 9, + 14, 16, 13, 13, 11, 12, 10, 9, 16, 16, 14, 13, 13, 13, 11, 8, + 13, 16, 12, 13, 11, 12, 10, 9, 14, 16, 13, 13, 12, 12, 10, 9, + 16, 16, 14, 13, 13, 12, 10, 8, 14, 16, 12, 12, 12, 13, 10, 8, + 14, 16, 12, 12, 12, 13, 10, 7, 16, 16, 11, 11, 12, 11, 8, 5, + }, + { + 0, 7, 4, 8, 5, 8, 7, 8, 6, 10, 7, 10, 8, 10, 9, 9, + 13, 16, 12, 13, 13, 14, 12, 12, 4, 10, 6, 9, 8, 11, 8, 9, + 8, 12, 8, 11, 10, 12, 10, 10, 14, 16, 12, 13, 14, 15, 12, 12, + 9, 14, 9, 11, 12, 14, 11, 11, 11, 15, 10, 12, 13, 14, 11, 11, + 15, 16, 13, 14, 15, 16, 13, 12, 5, 10, 7, 10, 7, 10, 9, 9, + 8, 12, 9, 11, 10, 11, 10, 10, 14, 16, 13, 14, 14, 14, 12, 12, + 8, 12, 8, 11, 10, 12, 10, 10, 10, 14, 10, 12, 11, 13, 10, 11, + 15, 16, 13, 14, 14, 15, 13, 12, 11, 16, 10, 12, 13, 15, 11, 11, + 13, 16, 11, 13, 14, 15, 12, 12, 16, 16, 14, 14, 16, 16, 13, 12, + 11, 15, 11, 13, 11, 13, 11, 11, 13, 16, 12, 14, 12, 13, 12, 12, + 16, 16, 14, 15, 15, 15, 13, 12, 12, 16, 12, 14, 12, 14, 12, 12, + 14, 16, 13, 14, 13, 14, 12, 12, 16, 16, 14, 16, 16, 16, 13, 12, + 14, 16, 13, 14, 15, 16, 13, 12, 16, 16, 14, 15, 16, 16, 13, 12, + 16, 16, 15, 16, 16, 16, 13, 12, 2, 9, 5, 8, 6, 9, 8, 9, + 7, 11, 8, 10, 9, 11, 9, 10, 13, 16, 12, 13, 14, 14, 12, 12, + 5, 11, 6, 10, 9, 11, 9, 9, 9, 13, 9, 11, 10, 12, 10, 10, + 14, 16, 12, 14, 14, 15, 12, 12, 9, 14, 9, 11, 12, 14, 10, 11, + 11, 16, 10, 12, 13, 14, 11, 11, 16, 16, 13, 14, 15, 16, 13, 12, + 6, 11, 7, 10, 8, 11, 9, 9, 9, 13, 9, 11, 10, 12, 10, 10, + 14, 16, 13, 14, 14, 14, 12, 12, 8, 13, 8, 11, 10, 12, 10, 10, + 10, 13, 10, 12, 11, 13, 10, 11, 14, 16, 13, 14, 14, 15, 12, 12, + 11, 15, 10, 12, 13, 15, 11, 11, 12, 16, 11, 13, 13, 15, 12, 11, + 16, 16, 13, 14, 15, 16, 13, 12, 11, 15, 11, 13, 10, 13, 11, 11, + 13, 16, 12, 14, 12, 13, 12, 11, 16, 16, 14, 15, 15, 15, 13, 12, + 12, 16, 12, 13, 12, 14, 12, 12, 13, 16, 12, 14, 13, 14, 12, 12, + 16, 16, 14, 15, 15, 15, 13, 12, 14, 16, 13, 14, 15, 16, 12, 12, + 16, 16, 13, 14, 15, 16, 12, 12, 16, 16, 14, 15, 16, 16, 13, 12, + 6, 12, 7, 10, 9, 12, 9, 10, 9, 13, 9, 12, 11, 13, 11, 11, + 14, 16, 13, 14, 15, 15, 13, 12, 8, 13, 8, 11, 10, 13, 10, 10, + 10, 14, 10, 12, 12, 14, 11, 11, 15, 16, 13, 14, 16, 16, 13, 12, + 10, 15, 9, 12, 12, 15, 11, 11, 12, 16, 11, 13, 14, 16, 12, 12, + 16, 16, 14, 14, 16, 16, 13, 12, 8, 13, 9, 11, 10, 12, 10, 11, + 11, 14, 11, 12, 11, 13, 11, 11, 16, 16, 14, 15, 15, 16, 13, 12, + 10, 14, 10, 12, 11, 13, 11, 11, 11, 15, 11, 13, 12, 14, 11, 11, + 15, 16, 13, 14, 15, 16, 13, 12, 12, 16, 11, 13, 13, 16, 12, 12, + 13, 16, 11, 13, 14, 16, 12, 12, 16, 16, 13, 14, 16, 16, 13, 12, + 12, 16, 12, 14, 11, 13, 11, 11, 13, 16, 13, 14, 12, 14, 12, 12, + 16, 16, 15, 16, 16, 16, 14, 13, 13, 16, 12, 14, 12, 14, 12, 12, + 14, 16, 13, 14, 13, 14, 12, 12, 16, 16, 14, 16, 14, 16, 13, 12, + 15, 16, 13, 15, 15, 16, 13, 12, 15, 16, 13, 15, 14, 16, 13, 12, + 16, 16, 14, 15, 15, 16, 13, 11, 8, 13, 8, 11, 10, 13, 10, 11, + 11, 15, 10, 12, 12, 14, 11, 11, 15, 16, 13, 14, 15, 15, 13, 12, + 9, 14, 9, 12, 11, 14, 10, 11, 11, 16, 10, 12, 13, 14, 11, 11, + 16, 16, 13, 14, 15, 16, 13, 12, 11, 15, 9, 12, 12, 14, 10, 10, + 12, 16, 11, 12, 14, 15, 11, 11, 16, 16, 13, 14, 16, 16, 12, 11, + 9, 14, 10, 12, 11, 13, 11, 11, 12, 16, 11, 13, 12, 14, 11, 11, + 16, 16, 14, 14, 15, 15, 13, 12, 10, 15, 10, 12, 12, 14, 11, 11, + 12, 16, 11, 13, 13, 14, 11, 11, 16, 16, 14, 14, 15, 16, 13, 12, + 12, 16, 10, 12, 13, 15, 11, 11, 13, 16, 11, 13, 14, 15, 11, 11, + 16, 16, 13, 13, 15, 16, 12, 11, 12, 16, 11, 13, 10, 13, 11, 11, + 14, 16, 13, 14, 12, 14, 11, 11, 16, 16, 15, 16, 14, 15, 13, 11, + 13, 16, 12, 14, 12, 14, 11, 11, 13, 16, 12, 14, 12, 14, 11, 11, + 16, 16, 14, 15, 14, 14, 12, 11, 14, 16, 12, 13, 13, 15, 11, 11, + 14, 16, 12, 13, 13, 14, 11, 11, 15, 16, 12, 13, 13, 13, 10, 9, + }, + }, + { + { + 0, 7, 4, 7, 5, 7, 6, 6, 6, 10, 7, 8, 8, 9, 8, 7, + 13, 14, 11, 12, 12, 12, 11, 9, 5, 9, 6, 8, 7, 9, 7, 7, + 8, 11, 8, 9, 9, 10, 9, 8, 13, 16, 12, 12, 12, 13, 11, 9, + 10, 13, 8, 10, 11, 12, 9, 9, 12, 14, 10, 11, 12, 13, 10, 9, + 15, 16, 12, 12, 14, 14, 11, 9, 6, 10, 7, 9, 7, 9, 8, 7, + 8, 11, 9, 10, 9, 10, 9, 8, 14, 16, 12, 12, 13, 12, 11, 9, + 8, 11, 8, 10, 9, 10, 9, 8, 10, 13, 10, 11, 10, 11, 9, 9, + 14, 16, 12, 12, 13, 13, 11, 9, 12, 15, 10, 11, 12, 13, 10, 9, + 13, 16, 11, 12, 13, 13, 10, 9, 16, 16, 12, 13, 14, 14, 11, 9, + 10, 14, 11, 12, 9, 11, 10, 9, 12, 15, 12, 13, 11, 12, 11, 9, + 16, 16, 13, 13, 13, 13, 11, 9, 12, 15, 12, 13, 11, 12, 11, 9, + 13, 16, 12, 13, 12, 13, 11, 10, 16, 16, 13, 13, 13, 13, 11, 9, + 14, 16, 13, 13, 13, 14, 11, 10, 16, 16, 13, 13, 13, 14, 11, 10, + 16, 16, 13, 13, 14, 14, 11, 9, 4, 9, 6, 8, 6, 9, 7, 7, + 8, 11, 8, 9, 9, 10, 9, 8, 13, 15, 12, 12, 13, 13, 11, 9, + 6, 10, 7, 9, 8, 10, 8, 8, 9, 12, 9, 10, 10, 11, 9, 8, + 14, 16, 12, 12, 13, 13, 11, 10, 10, 13, 8, 10, 11, 12, 9, 9, + 12, 15, 10, 11, 12, 13, 10, 9, 16, 16, 12, 12, 14, 14, 11, 9, + 7, 11, 8, 9, 7, 10, 8, 8, 9, 12, 10, 11, 9, 11, 9, 9, + 14, 16, 12, 13, 13, 13, 11, 10, 9, 12, 9, 10, 9, 11, 9, 9, + 10, 13, 10, 11, 10, 11, 10, 9, 14, 16, 12, 13, 13, 13, 11, 9, + 12, 15, 10, 11, 12, 13, 10, 9, 13, 16, 11, 12, 13, 13, 10, 9, + 16, 16, 12, 12, 14, 14, 11, 9, 10, 14, 11, 12, 9, 11, 10, 9, + 12, 16, 12, 13, 11, 12, 11, 9, 16, 16, 14, 14, 13, 13, 11, 9, + 12, 16, 12, 13, 11, 12, 10, 10, 13, 16, 12, 13, 11, 12, 11, 10, + 16, 16, 13, 13, 13, 13, 11, 9, 14, 16, 13, 13, 13, 14, 11, 9, + 15, 16, 13, 13, 13, 14, 11, 9, 16, 16, 13, 13, 13, 13, 10, 8, + 7, 11, 8, 10, 9, 11, 9, 9, 10, 13, 10, 11, 11, 12, 10, 10, + 15, 16, 13, 13, 14, 14, 12, 10, 9, 13, 9, 11, 10, 12, 10, 9, + 11, 14, 10, 12, 12, 13, 10, 10, 16, 16, 13, 13, 14, 14, 12, 10, + 11, 15, 9, 11, 12, 13, 10, 9, 13, 16, 11, 12, 13, 14, 11, 10, + 16, 16, 13, 13, 15, 15, 11, 10, 9, 13, 10, 11, 9, 11, 10, 9, + 11, 14, 11, 12, 11, 12, 11, 10, 16, 16, 14, 14, 14, 14, 12, 10, + 10, 14, 10, 12, 11, 12, 10, 10, 12, 15, 11, 12, 12, 13, 11, 10, + 16, 16, 13, 13, 14, 14, 12, 10, 13, 16, 11, 12, 13, 14, 11, 10, + 13, 16, 11, 12, 13, 14, 11, 10, 16, 16, 12, 13, 14, 14, 11, 9, + 11, 15, 12, 13, 10, 12, 10, 10, 13, 16, 13, 14, 11, 13, 11, 10, + 16, 16, 14, 14, 14, 14, 12, 10, 13, 16, 13, 13, 11, 13, 11, 10, + 14, 16, 13, 14, 12, 13, 11, 10, 16, 16, 14, 14, 13, 13, 12, 10, + 15, 16, 13, 14, 14, 14, 11, 10, 15, 16, 13, 13, 13, 14, 11, 10, + 16, 16, 12, 13, 13, 13, 10, 8, 9, 13, 10, 11, 10, 12, 10, 10, + 12, 15, 11, 12, 12, 13, 11, 10, 16, 16, 14, 13, 14, 14, 12, 10, + 10, 14, 10, 12, 11, 13, 10, 10, 13, 16, 11, 12, 12, 14, 11, 10, + 16, 16, 13, 13, 14, 14, 12, 10, 12, 16, 9, 11, 12, 14, 10, 9, + 13, 16, 10, 12, 13, 14, 10, 9, 16, 16, 12, 12, 14, 14, 11, 9, + 10, 14, 11, 12, 10, 12, 10, 10, 13, 16, 12, 13, 12, 13, 11, 10, + 16, 16, 14, 14, 14, 14, 12, 10, 11, 16, 11, 12, 11, 13, 11, 10, + 13, 16, 12, 13, 12, 14, 11, 10, 16, 16, 14, 14, 14, 14, 12, 10, + 13, 16, 11, 12, 13, 14, 10, 9, 14, 16, 11, 12, 13, 14, 10, 9, + 16, 16, 12, 12, 14, 14, 10, 8, 12, 16, 12, 13, 10, 12, 10, 9, + 14, 16, 13, 13, 11, 12, 11, 9, 16, 16, 14, 14, 13, 13, 11, 9, + 13, 16, 12, 13, 11, 12, 10, 9, 14, 16, 13, 13, 11, 13, 11, 9, + 16, 16, 14, 14, 13, 13, 11, 9, 14, 16, 12, 13, 12, 13, 10, 8, + 14, 16, 12, 12, 12, 13, 10, 8, 15, 16, 11, 11, 11, 12, 9, 6, + }, + { + 0, 7, 4, 7, 5, 8, 7, 8, 5, 10, 7, 10, 8, 10, 9, 10, + 13, 16, 12, 14, 14, 14, 13, 12, 4, 10, 6, 9, 8, 11, 9, 9, + 8, 12, 8, 11, 10, 12, 10, 10, 14, 16, 13, 14, 14, 15, 13, 12, + 9, 14, 9, 12, 12, 14, 11, 11, 12, 16, 11, 13, 13, 15, 12, 12, + 15, 16, 14, 15, 15, 16, 13, 13, 5, 10, 7, 10, 7, 10, 9, 9, + 8, 12, 9, 11, 9, 11, 10, 10, 14, 16, 13, 14, 14, 15, 13, 12, + 7, 12, 8, 11, 10, 12, 10, 10, 10, 13, 10, 12, 11, 13, 11, 11, + 15, 16, 13, 15, 14, 16, 13, 13, 11, 16, 11, 13, 13, 16, 12, 12, + 13, 16, 12, 14, 14, 16, 12, 12, 16, 16, 14, 16, 16, 16, 14, 13, + 11, 15, 12, 14, 11, 13, 11, 12, 13, 16, 12, 14, 12, 14, 12, 12, + 16, 16, 14, 16, 14, 16, 13, 13, 13, 16, 12, 14, 12, 14, 12, 12, + 14, 16, 13, 15, 13, 15, 13, 13, 16, 16, 15, 16, 16, 16, 14, 13, + 15, 16, 13, 16, 15, 16, 13, 13, 16, 16, 14, 16, 16, 16, 14, 13, + 16, 16, 16, 16, 16, 16, 14, 13, 2, 9, 5, 8, 6, 9, 8, 9, + 7, 11, 8, 10, 9, 11, 9, 10, 14, 16, 13, 14, 14, 15, 13, 12, + 5, 11, 6, 10, 9, 11, 9, 10, 8, 13, 9, 11, 11, 12, 10, 11, + 14, 16, 13, 14, 14, 16, 13, 13, 9, 15, 9, 12, 12, 14, 11, 11, + 12, 16, 11, 13, 13, 15, 12, 12, 16, 16, 14, 15, 16, 16, 14, 13, + 6, 11, 7, 10, 8, 11, 9, 10, 9, 13, 9, 12, 10, 12, 10, 11, + 14, 16, 13, 14, 14, 15, 13, 13, 8, 12, 8, 11, 10, 12, 10, 11, + 9, 13, 10, 12, 11, 13, 11, 11, 14, 16, 13, 14, 14, 16, 13, 13, + 12, 16, 11, 13, 13, 15, 12, 12, 13, 16, 11, 13, 14, 16, 12, 12, + 16, 16, 14, 15, 16, 16, 13, 13, 11, 15, 11, 14, 10, 13, 11, 12, + 13, 16, 13, 15, 12, 14, 12, 12, 16, 16, 15, 16, 15, 16, 14, 13, + 12, 16, 12, 14, 12, 14, 12, 12, 13, 16, 13, 15, 13, 14, 12, 13, + 16, 16, 15, 16, 15, 16, 13, 13, 15, 16, 13, 16, 15, 16, 13, 13, + 16, 16, 14, 16, 16, 16, 13, 13, 16, 16, 15, 16, 16, 16, 14, 13, + 5, 12, 7, 10, 9, 12, 10, 10, 9, 13, 9, 12, 11, 13, 11, 11, + 15, 16, 13, 14, 15, 15, 13, 13, 7, 13, 8, 11, 10, 13, 10, 11, + 10, 14, 10, 12, 12, 14, 11, 12, 16, 16, 14, 15, 16, 16, 14, 13, + 10, 16, 9, 12, 13, 15, 11, 12, 13, 16, 11, 13, 14, 16, 12, 12, + 16, 16, 14, 16, 16, 16, 14, 13, 8, 13, 9, 12, 9, 12, 10, 11, + 11, 15, 11, 13, 11, 13, 11, 12, 16, 16, 14, 16, 16, 16, 14, 13, + 9, 14, 10, 12, 11, 13, 11, 12, 11, 15, 11, 13, 12, 14, 12, 12, + 16, 16, 14, 16, 15, 16, 14, 13, 12, 16, 11, 14, 14, 16, 12, 12, + 13, 16, 12, 14, 14, 16, 13, 13, 16, 16, 13, 15, 16, 16, 14, 13, + 11, 16, 12, 14, 10, 13, 12, 12, 13, 16, 13, 15, 12, 14, 12, 13, + 16, 16, 16, 16, 16, 16, 14, 14, 13, 16, 13, 15, 12, 15, 12, 13, + 13, 16, 13, 15, 12, 15, 13, 13, 16, 16, 15, 16, 14, 16, 14, 13, + 16, 16, 14, 16, 16, 16, 14, 13, 15, 16, 14, 16, 15, 16, 14, 13, + 16, 16, 14, 16, 15, 16, 13, 12, 8, 14, 9, 12, 10, 14, 11, 12, + 11, 16, 10, 13, 12, 14, 12, 12, 16, 16, 14, 15, 15, 16, 14, 13, + 9, 15, 9, 12, 12, 14, 11, 12, 12, 16, 11, 13, 13, 15, 12, 12, + 16, 16, 14, 15, 16, 16, 14, 13, 11, 16, 9, 12, 13, 15, 11, 11, + 13, 16, 11, 13, 14, 16, 12, 12, 16, 16, 14, 14, 16, 16, 13, 12, + 9, 15, 10, 13, 11, 14, 11, 12, 12, 16, 11, 14, 12, 14, 12, 12, + 16, 16, 14, 16, 16, 16, 14, 13, 10, 16, 10, 13, 12, 15, 12, 12, + 12, 16, 12, 14, 13, 15, 12, 12, 16, 16, 14, 16, 16, 16, 14, 13, + 12, 16, 11, 13, 13, 16, 12, 12, 13, 16, 11, 13, 14, 16, 12, 12, + 16, 16, 13, 14, 16, 16, 13, 12, 11, 16, 12, 14, 10, 13, 11, 12, + 13, 16, 13, 15, 12, 14, 12, 12, 16, 16, 16, 16, 15, 16, 13, 12, + 12, 16, 12, 15, 12, 14, 12, 12, 13, 16, 13, 15, 12, 14, 12, 12, + 16, 16, 15, 16, 14, 15, 13, 12, 14, 16, 13, 14, 13, 16, 12, 12, + 13, 16, 12, 14, 13, 15, 12, 12, 14, 16, 12, 13, 13, 14, 11, 10, + }, + }, + { + { + 0, 7, 4, 7, 5, 7, 6, 6, 6, 10, 7, 8, 8, 9, 8, 8, + 13, 14, 11, 12, 12, 12, 11, 10, 5, 9, 6, 8, 7, 9, 7, 7, + 8, 11, 8, 9, 9, 10, 9, 8, 13, 16, 12, 12, 13, 13, 11, 10, + 10, 14, 8, 10, 11, 13, 9, 9, 12, 15, 10, 11, 12, 13, 10, 10, + 16, 16, 12, 13, 14, 14, 11, 10, 5, 10, 7, 9, 6, 9, 8, 8, + 8, 11, 9, 10, 9, 10, 9, 8, 14, 16, 12, 12, 13, 13, 11, 10, + 8, 12, 8, 10, 9, 10, 9, 9, 10, 13, 9, 11, 10, 11, 9, 9, + 14, 16, 12, 13, 13, 13, 11, 10, 12, 16, 10, 12, 12, 13, 10, 10, + 13, 16, 11, 12, 13, 14, 11, 10, 16, 16, 12, 13, 14, 14, 11, 10, + 10, 14, 11, 13, 9, 11, 10, 10, 12, 16, 12, 13, 11, 12, 11, 10, + 16, 16, 13, 14, 13, 13, 12, 10, 12, 16, 12, 13, 11, 13, 11, 10, + 13, 16, 12, 13, 12, 13, 11, 10, 16, 16, 13, 14, 13, 14, 12, 10, + 14, 16, 13, 14, 13, 14, 12, 11, 16, 16, 13, 14, 14, 15, 12, 11, + 16, 16, 13, 14, 14, 14, 11, 10, 3, 9, 5, 8, 6, 9, 7, 7, + 8, 11, 8, 10, 9, 10, 9, 8, 14, 15, 12, 12, 13, 13, 11, 10, + 6, 11, 6, 9, 8, 10, 8, 8, 9, 12, 9, 10, 10, 11, 9, 9, + 14, 16, 12, 13, 13, 13, 11, 10, 10, 14, 8, 11, 12, 13, 9, 9, + 12, 16, 10, 11, 12, 13, 10, 10, 16, 16, 12, 13, 14, 14, 11, 10, + 6, 11, 8, 10, 7, 10, 8, 8, 9, 12, 10, 11, 9, 11, 9, 9, + 14, 16, 12, 13, 13, 13, 12, 10, 9, 12, 9, 11, 9, 11, 9, 9, + 10, 13, 10, 11, 10, 12, 10, 9, 14, 16, 12, 13, 13, 13, 11, 10, + 12, 16, 10, 12, 12, 14, 10, 10, 13, 16, 10, 12, 13, 14, 11, 10, + 16, 16, 12, 13, 14, 14, 11, 10, 10, 15, 11, 13, 9, 11, 10, 10, + 12, 16, 12, 13, 11, 12, 11, 10, 16, 16, 14, 14, 13, 14, 12, 10, + 12, 16, 12, 13, 11, 13, 11, 10, 13, 16, 12, 13, 11, 13, 11, 10, + 16, 16, 13, 14, 13, 13, 12, 10, 14, 16, 13, 14, 14, 14, 11, 11, + 15, 16, 13, 14, 13, 14, 11, 10, 16, 16, 13, 13, 13, 14, 11, 9, + 7, 12, 8, 11, 9, 11, 9, 10, 10, 14, 10, 12, 11, 12, 11, 10, + 16, 16, 13, 13, 14, 14, 12, 11, 9, 13, 9, 11, 10, 12, 10, 10, + 11, 15, 10, 12, 12, 13, 11, 10, 16, 16, 13, 14, 14, 14, 12, 11, + 11, 16, 9, 11, 12, 14, 10, 10, 13, 16, 10, 12, 13, 14, 11, 10, + 16, 16, 13, 14, 16, 16, 12, 11, 9, 13, 10, 12, 9, 12, 10, 10, + 11, 15, 11, 13, 11, 13, 11, 11, 16, 16, 14, 14, 14, 14, 13, 11, + 10, 14, 10, 12, 11, 13, 11, 10, 12, 16, 11, 13, 12, 13, 11, 11, + 16, 16, 13, 14, 14, 14, 12, 11, 13, 16, 11, 13, 13, 14, 11, 11, + 13, 16, 11, 13, 13, 14, 11, 11, 16, 16, 12, 13, 14, 15, 12, 10, + 11, 16, 12, 14, 10, 12, 11, 10, 13, 16, 13, 14, 11, 13, 11, 11, + 16, 16, 15, 16, 14, 14, 13, 11, 13, 16, 13, 14, 12, 13, 11, 11, + 13, 16, 13, 14, 12, 13, 11, 11, 16, 16, 14, 14, 13, 14, 12, 11, + 15, 16, 13, 14, 14, 16, 12, 11, 14, 16, 13, 14, 13, 14, 12, 11, + 16, 16, 12, 13, 13, 14, 11, 9, 9, 14, 10, 12, 10, 13, 11, 11, + 12, 16, 12, 13, 12, 14, 12, 11, 16, 16, 14, 14, 14, 14, 13, 11, + 10, 16, 10, 13, 12, 14, 11, 11, 13, 16, 12, 13, 13, 14, 12, 11, + 16, 16, 14, 14, 15, 15, 13, 11, 12, 16, 9, 12, 13, 14, 10, 10, + 14, 16, 11, 12, 13, 15, 11, 10, 16, 16, 13, 13, 15, 16, 11, 10, + 10, 16, 11, 13, 11, 13, 11, 11, 13, 16, 12, 14, 12, 14, 12, 11, + 16, 16, 14, 14, 14, 14, 13, 11, 11, 16, 11, 13, 12, 14, 11, 11, + 13, 16, 12, 14, 13, 14, 12, 11, 16, 16, 14, 14, 14, 15, 13, 11, + 13, 16, 11, 13, 13, 14, 11, 10, 14, 16, 11, 13, 13, 14, 11, 10, + 16, 16, 12, 13, 14, 15, 11, 9, 12, 16, 12, 14, 10, 13, 11, 10, + 14, 16, 13, 14, 11, 13, 11, 10, 16, 16, 14, 15, 13, 14, 12, 10, + 13, 16, 13, 14, 11, 13, 11, 10, 14, 16, 13, 14, 12, 13, 11, 10, + 16, 16, 14, 14, 13, 13, 11, 10, 14, 16, 12, 13, 13, 14, 11, 9, + 14, 16, 12, 13, 12, 13, 10, 9, 14, 16, 11, 11, 12, 12, 9, 7, + }, + { + 0, 7, 3, 8, 5, 8, 7, 9, 5, 10, 7, 10, 8, 11, 10, 10, + 14, 16, 14, 15, 14, 16, 14, 14, 4, 10, 6, 10, 8, 11, 9, 10, + 8, 12, 9, 11, 10, 12, 11, 11, 15, 16, 14, 16, 15, 16, 14, 14, + 10, 16, 10, 13, 13, 16, 12, 13, 13, 16, 12, 14, 14, 16, 13, 13, + 16, 16, 16, 16, 16, 16, 14, 15, 4, 10, 7, 10, 7, 10, 9, 10, + 8, 12, 9, 12, 10, 12, 11, 12, 14, 16, 14, 16, 15, 16, 14, 14, + 8, 12, 9, 12, 10, 13, 11, 12, 10, 14, 11, 13, 11, 14, 12, 13, + 16, 16, 14, 16, 16, 16, 14, 15, 12, 16, 12, 14, 14, 16, 13, 14, + 14, 16, 13, 16, 16, 16, 14, 14, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 16, 12, 16, 11, 14, 13, 13, 13, 16, 13, 16, 13, 15, 13, 14, + 16, 16, 16, 16, 16, 16, 15, 16, 13, 16, 13, 16, 13, 16, 13, 14, + 14, 16, 14, 16, 14, 16, 14, 15, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 15, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 2, 9, 5, 9, 6, 10, 8, 10, + 7, 11, 8, 11, 9, 12, 10, 11, 14, 16, 14, 16, 15, 16, 14, 14, + 5, 11, 6, 10, 9, 12, 10, 11, 9, 13, 9, 12, 11, 13, 11, 12, + 16, 16, 14, 16, 16, 16, 14, 14, 10, 16, 9, 13, 13, 16, 12, 13, + 13, 16, 12, 14, 14, 16, 13, 13, 16, 16, 16, 16, 16, 16, 16, 14, + 5, 11, 8, 11, 7, 11, 10, 11, 9, 13, 10, 13, 10, 13, 11, 12, + 16, 16, 14, 16, 16, 16, 14, 14, 8, 13, 9, 12, 10, 13, 11, 12, + 10, 14, 10, 13, 11, 14, 12, 12, 16, 16, 14, 16, 15, 16, 14, 14, + 12, 16, 12, 14, 14, 16, 13, 14, 14, 16, 12, 16, 15, 16, 13, 14, + 16, 16, 15, 16, 16, 16, 15, 15, 11, 16, 12, 16, 10, 14, 12, 13, + 13, 16, 14, 16, 13, 16, 13, 14, 16, 16, 16, 16, 16, 16, 15, 16, + 13, 16, 13, 16, 13, 16, 13, 14, 14, 16, 14, 16, 13, 16, 13, 14, + 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 15, 16, 16, 16, 15, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, + 5, 13, 7, 12, 9, 13, 11, 12, 10, 14, 10, 13, 11, 13, 12, 13, + 16, 16, 16, 16, 16, 16, 16, 15, 7, 14, 8, 12, 11, 14, 11, 12, + 11, 16, 11, 13, 13, 16, 13, 13, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 16, 10, 14, 14, 16, 12, 13, 13, 16, 12, 15, 16, 16, 14, 14, + 16, 16, 16, 16, 16, 16, 16, 16, 8, 14, 10, 13, 9, 13, 11, 12, + 11, 16, 12, 14, 12, 14, 13, 13, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 11, 14, 12, 14, 12, 13, 11, 16, 12, 14, 12, 15, 13, 13, + 16, 16, 15, 16, 16, 16, 15, 16, 13, 16, 12, 16, 15, 16, 14, 14, + 13, 16, 12, 16, 16, 16, 14, 14, 16, 16, 14, 16, 16, 16, 14, 16, + 11, 16, 13, 16, 10, 14, 12, 13, 14, 16, 14, 16, 13, 16, 14, 14, + 16, 16, 16, 16, 16, 16, 16, 16, 13, 16, 14, 16, 13, 16, 14, 15, + 13, 16, 14, 16, 13, 16, 14, 15, 16, 16, 16, 16, 15, 16, 15, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 15, 16, + 16, 16, 15, 16, 16, 16, 14, 14, 8, 16, 10, 14, 11, 16, 12, 13, + 12, 16, 12, 14, 13, 16, 13, 14, 16, 16, 16, 16, 16, 16, 16, 14, + 10, 16, 10, 14, 12, 16, 12, 13, 13, 16, 12, 15, 14, 16, 13, 14, + 16, 16, 16, 16, 16, 16, 16, 15, 11, 16, 10, 13, 13, 16, 12, 13, + 14, 16, 12, 14, 15, 16, 13, 13, 16, 16, 16, 16, 16, 16, 15, 14, + 10, 16, 11, 14, 11, 16, 12, 13, 13, 16, 13, 16, 13, 16, 13, 14, + 16, 16, 16, 16, 16, 16, 16, 15, 11, 16, 12, 14, 13, 16, 13, 14, + 13, 16, 13, 16, 14, 16, 13, 14, 16, 16, 16, 16, 16, 16, 16, 15, + 13, 16, 12, 14, 14, 16, 13, 13, 13, 16, 12, 15, 14, 16, 13, 13, + 16, 16, 14, 16, 16, 16, 14, 13, 11, 16, 12, 16, 11, 15, 12, 13, + 14, 16, 14, 16, 13, 16, 13, 14, 16, 16, 16, 16, 16, 16, 14, 14, + 12, 16, 13, 16, 12, 16, 13, 14, 13, 16, 14, 16, 13, 16, 13, 14, + 16, 16, 16, 16, 14, 16, 14, 14, 14, 16, 13, 16, 14, 16, 13, 13, + 13, 16, 13, 16, 14, 16, 13, 13, 15, 16, 13, 14, 13, 15, 12, 12, + }, + }, + { + { + 0, 7, 4, 6, 4, 7, 6, 7, 6, 9, 7, 8, 7, 9, 8, 8, + 13, 14, 12, 12, 12, 13, 11, 11, 5, 9, 5, 8, 7, 9, 7, 8, + 8, 11, 8, 10, 9, 10, 9, 9, 13, 15, 12, 13, 12, 13, 11, 11, + 9, 14, 8, 11, 11, 13, 10, 10, 11, 15, 10, 12, 12, 13, 10, 11, + 14, 16, 12, 13, 14, 14, 12, 11, 5, 9, 7, 9, 6, 9, 8, 8, + 8, 11, 8, 10, 8, 10, 9, 9, 13, 16, 12, 13, 13, 13, 11, 11, + 7, 11, 8, 10, 9, 11, 9, 9, 9, 13, 9, 11, 10, 11, 10, 10, + 14, 16, 12, 13, 13, 13, 12, 11, 11, 16, 10, 12, 12, 14, 11, 11, + 13, 16, 11, 13, 13, 14, 11, 11, 16, 16, 13, 14, 14, 15, 12, 11, + 10, 15, 11, 13, 9, 12, 10, 10, 12, 16, 12, 13, 11, 12, 11, 11, + 15, 16, 13, 14, 13, 14, 12, 11, 12, 16, 12, 14, 11, 13, 11, 11, + 13, 16, 12, 14, 12, 13, 12, 11, 16, 16, 13, 14, 14, 14, 12, 11, + 14, 16, 13, 14, 14, 15, 12, 12, 16, 16, 13, 14, 14, 16, 12, 12, + 16, 16, 14, 14, 14, 15, 12, 11, 3, 9, 5, 8, 6, 9, 7, 8, + 7, 11, 8, 10, 9, 10, 9, 9, 13, 14, 12, 13, 13, 13, 12, 11, + 6, 11, 6, 9, 8, 10, 8, 9, 9, 12, 8, 10, 10, 11, 9, 10, + 14, 16, 12, 13, 13, 14, 12, 11, 9, 14, 8, 11, 11, 13, 10, 10, + 12, 16, 10, 12, 12, 14, 11, 11, 16, 16, 12, 13, 14, 15, 12, 11, + 6, 11, 8, 10, 7, 10, 8, 9, 9, 12, 9, 11, 9, 11, 10, 10, + 14, 16, 13, 13, 13, 14, 12, 11, 8, 12, 9, 11, 9, 11, 9, 10, + 10, 13, 9, 11, 10, 12, 10, 10, 14, 16, 12, 13, 13, 14, 12, 11, + 12, 16, 10, 12, 12, 14, 11, 11, 12, 16, 10, 12, 13, 14, 11, 11, + 15, 16, 12, 13, 14, 14, 11, 11, 10, 15, 11, 13, 9, 12, 10, 10, + 12, 16, 12, 14, 11, 13, 11, 11, 16, 16, 14, 14, 14, 14, 12, 11, + 12, 16, 12, 14, 11, 13, 11, 11, 13, 16, 12, 14, 11, 13, 11, 11, + 16, 16, 13, 14, 13, 14, 12, 11, 14, 16, 13, 14, 14, 15, 12, 11, + 14, 16, 13, 14, 13, 15, 12, 11, 16, 16, 13, 14, 13, 14, 11, 10, + 6, 13, 8, 11, 9, 12, 10, 10, 10, 14, 10, 12, 11, 13, 11, 11, + 16, 16, 13, 14, 14, 14, 13, 12, 8, 14, 8, 12, 10, 13, 10, 11, + 11, 15, 10, 12, 12, 13, 11, 11, 16, 16, 14, 14, 15, 16, 13, 12, + 11, 16, 9, 12, 12, 14, 11, 11, 13, 16, 11, 13, 13, 16, 11, 11, + 16, 16, 13, 14, 16, 16, 13, 12, 8, 14, 10, 12, 9, 12, 10, 11, + 11, 15, 11, 13, 11, 13, 11, 11, 16, 16, 14, 15, 14, 15, 13, 12, + 10, 15, 10, 13, 11, 13, 11, 11, 11, 15, 11, 13, 12, 13, 11, 11, + 16, 16, 13, 15, 14, 15, 13, 12, 12, 16, 11, 13, 13, 15, 11, 11, + 13, 16, 11, 13, 13, 15, 11, 11, 16, 16, 12, 14, 14, 16, 12, 11, + 11, 16, 12, 14, 10, 13, 11, 11, 13, 16, 13, 15, 12, 14, 12, 12, + 16, 16, 15, 16, 14, 15, 13, 12, 12, 16, 13, 14, 12, 14, 12, 12, + 13, 16, 13, 14, 12, 14, 12, 12, 16, 16, 14, 15, 13, 14, 12, 12, + 15, 16, 13, 15, 14, 16, 12, 12, 14, 16, 13, 14, 13, 15, 12, 12, + 15, 16, 12, 13, 13, 14, 11, 10, 9, 15, 10, 13, 11, 14, 11, 12, + 12, 16, 12, 14, 12, 14, 12, 12, 16, 16, 14, 14, 14, 15, 13, 12, + 10, 16, 10, 13, 12, 14, 12, 12, 13, 16, 12, 14, 13, 15, 12, 12, + 16, 16, 14, 14, 15, 16, 13, 12, 11, 16, 9, 12, 13, 15, 11, 11, + 14, 16, 11, 13, 14, 16, 11, 11, 16, 16, 13, 14, 16, 16, 12, 11, + 10, 16, 11, 14, 11, 14, 12, 12, 13, 16, 13, 14, 12, 14, 12, 12, + 16, 16, 14, 15, 15, 15, 13, 12, 11, 16, 12, 14, 12, 15, 12, 12, + 13, 16, 12, 14, 13, 15, 12, 12, 16, 16, 14, 15, 15, 16, 13, 12, + 12, 16, 11, 13, 13, 15, 11, 11, 13, 16, 11, 13, 13, 15, 11, 11, + 16, 16, 12, 13, 14, 16, 12, 10, 11, 16, 12, 14, 10, 13, 11, 11, + 14, 16, 13, 14, 12, 14, 11, 11, 16, 16, 15, 16, 14, 14, 12, 11, + 12, 16, 13, 14, 11, 14, 11, 11, 13, 16, 13, 14, 12, 14, 11, 11, + 16, 16, 14, 15, 13, 14, 12, 11, 14, 16, 12, 14, 13, 14, 11, 10, + 13, 16, 12, 13, 12, 14, 11, 10, 14, 16, 11, 12, 12, 12, 10, 8, + }, + { + 0, 8, 4, 9, 5, 9, 8, 10, 6, 11, 8, 11, 9, 12, 11, 12, + 16, 16, 16, 16, 16, 16, 16, 16, 4, 11, 6, 11, 9, 12, 10, 12, + 9, 13, 10, 13, 11, 16, 12, 13, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 16, 11, 16, 16, 16, 14, 16, 14, 16, 13, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 4, 11, 8, 12, 7, 12, 10, 12, + 8, 13, 10, 13, 10, 13, 12, 14, 16, 16, 16, 16, 16, 16, 16, 16, + 8, 13, 10, 14, 11, 16, 12, 14, 11, 16, 12, 16, 12, 16, 13, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 13, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 14, 16, 12, 16, 16, 16, 13, 16, 16, 16, 14, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 1, 10, 5, 10, 7, 11, 9, 11, + 8, 12, 9, 12, 10, 13, 12, 13, 16, 16, 16, 16, 16, 16, 16, 16, + 5, 12, 7, 12, 10, 13, 11, 12, 9, 16, 10, 13, 12, 16, 13, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 10, 16, 16, 16, 14, 16, + 14, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 6, 12, 9, 13, 8, 12, 11, 13, 10, 16, 11, 16, 11, 16, 13, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 9, 16, 10, 14, 11, 16, 12, 16, + 10, 16, 11, 16, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 14, 16, 13, 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 14, 16, 11, 16, 14, 16, + 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 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, + 6, 16, 9, 13, 10, 16, 12, 14, 11, 16, 12, 16, 12, 16, 13, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 8, 16, 9, 14, 12, 16, 13, 16, + 12, 16, 12, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 10, 16, 16, 16, 14, 16, 16, 16, 13, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 8, 16, 11, 16, 10, 16, 12, 16, + 12, 16, 13, 16, 13, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 12, 16, 13, 16, 14, 16, 11, 16, 13, 16, 13, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 13, 16, 16, 16, 16, 16, + 14, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 16, 16, 11, 16, 14, 16, 16, 16, 16, 16, 14, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 8, 16, 11, 16, 12, 16, 13, 16, + 13, 16, 13, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 11, 16, 13, 16, 14, 16, 14, 16, 13, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 10, 16, 16, 16, 13, 16, + 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 12, 16, 12, 16, 13, 16, 13, 16, 16, 16, 14, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 13, 16, 14, 16, 16, 16, + 13, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 12, 16, 16, 16, 14, 16, 14, 16, 13, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 13, 16, 11, 16, 13, 16, + 16, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 13, 16, 16, 16, 13, 16, 16, 16, 13, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 14, 15, + }, + }, + { + { + 0, 7, 3, 7, 4, 7, 6, 7, 6, 9, 7, 9, 7, 9, 8, 9, + 13, 14, 12, 13, 13, 13, 12, 12, 4, 9, 5, 9, 7, 9, 8, 9, + 7, 11, 8, 10, 9, 11, 9, 10, 13, 16, 12, 14, 13, 14, 12, 12, + 9, 14, 8, 12, 12, 14, 10, 11, 11, 16, 10, 13, 13, 14, 11, 12, + 15, 16, 13, 14, 14, 16, 12, 12, 5, 10, 7, 9, 6, 9, 8, 9, + 8, 11, 8, 11, 8, 10, 9, 10, 14, 16, 12, 14, 13, 14, 12, 12, + 7, 12, 8, 11, 9, 11, 9, 10, 9, 13, 9, 12, 10, 12, 10, 11, + 14, 16, 12, 14, 13, 14, 12, 12, 12, 16, 11, 13, 13, 15, 11, 12, + 13, 16, 11, 14, 13, 15, 12, 12, 15, 16, 13, 15, 14, 16, 13, 13, + 10, 15, 12, 14, 9, 13, 11, 12, 12, 16, 12, 14, 11, 13, 12, 12, + 15, 16, 13, 15, 14, 15, 13, 13, 12, 16, 12, 14, 12, 14, 12, 12, + 13, 16, 13, 14, 12, 14, 12, 12, 16, 16, 14, 15, 14, 16, 13, 13, + 15, 16, 13, 15, 14, 16, 12, 13, 16, 16, 14, 16, 14, 16, 13, 13, + 16, 16, 14, 16, 15, 16, 13, 13, 3, 9, 5, 9, 6, 9, 8, 9, + 7, 11, 8, 10, 9, 11, 9, 10, 14, 15, 13, 14, 13, 14, 12, 12, + 5, 11, 6, 10, 8, 11, 9, 10, 9, 12, 9, 11, 10, 12, 10, 11, + 14, 16, 13, 14, 14, 15, 13, 13, 9, 15, 8, 12, 12, 14, 10, 11, + 12, 16, 10, 13, 13, 15, 11, 12, 15, 16, 13, 14, 14, 16, 13, 13, + 6, 11, 8, 11, 7, 10, 9, 10, 9, 13, 10, 12, 9, 12, 10, 11, + 14, 16, 13, 14, 14, 14, 13, 13, 8, 13, 9, 12, 9, 12, 10, 11, + 9, 13, 9, 12, 10, 12, 10, 11, 14, 16, 12, 14, 13, 14, 12, 12, + 12, 16, 11, 13, 13, 15, 11, 12, 12, 16, 11, 13, 13, 15, 11, 12, + 14, 16, 12, 14, 14, 15, 12, 12, 10, 15, 11, 14, 9, 13, 11, 12, + 12, 16, 12, 14, 11, 14, 12, 12, 16, 16, 14, 16, 14, 15, 13, 13, + 12, 16, 12, 14, 11, 14, 12, 12, 12, 16, 13, 14, 11, 14, 12, 12, + 15, 16, 14, 15, 13, 15, 12, 13, 14, 16, 13, 15, 14, 16, 13, 13, + 14, 16, 13, 15, 14, 16, 12, 13, 15, 16, 13, 15, 13, 15, 12, 12, + 6, 13, 8, 12, 9, 12, 10, 11, 10, 14, 11, 13, 11, 13, 12, 12, + 15, 16, 14, 15, 15, 15, 14, 13, 8, 14, 9, 12, 11, 13, 11, 12, + 11, 15, 11, 13, 12, 14, 12, 12, 16, 16, 14, 15, 15, 16, 14, 14, + 10, 16, 9, 13, 12, 15, 11, 12, 13, 16, 11, 14, 13, 16, 12, 12, + 16, 16, 14, 15, 16, 16, 13, 13, 8, 14, 10, 13, 9, 13, 11, 12, + 11, 15, 12, 14, 11, 14, 12, 12, 16, 16, 15, 16, 15, 16, 14, 14, + 10, 15, 10, 13, 11, 14, 11, 12, 11, 15, 11, 14, 12, 14, 12, 12, + 15, 16, 14, 15, 14, 16, 13, 13, 12, 16, 11, 14, 13, 16, 12, 12, + 12, 16, 11, 14, 13, 15, 12, 12, 15, 16, 12, 14, 15, 16, 13, 13, + 11, 16, 12, 14, 10, 14, 11, 12, 13, 16, 13, 16, 12, 14, 12, 13, + 16, 16, 16, 16, 15, 16, 14, 13, 12, 16, 13, 15, 12, 14, 12, 13, + 13, 16, 13, 15, 12, 14, 12, 13, 16, 16, 14, 16, 13, 15, 13, 13, + 15, 16, 14, 16, 14, 16, 13, 13, 14, 16, 13, 15, 13, 16, 13, 13, + 14, 16, 12, 14, 13, 14, 12, 12, 9, 16, 11, 14, 11, 15, 12, 13, + 13, 16, 12, 14, 12, 15, 13, 13, 16, 16, 14, 15, 15, 15, 14, 13, + 11, 16, 11, 14, 12, 16, 12, 13, 13, 16, 12, 14, 13, 16, 13, 13, + 16, 16, 14, 15, 16, 16, 14, 13, 11, 16, 10, 13, 13, 16, 11, 12, + 14, 16, 11, 14, 14, 16, 12, 12, 16, 16, 14, 14, 16, 16, 13, 12, + 11, 16, 12, 14, 11, 15, 12, 13, 13, 16, 13, 15, 13, 16, 13, 13, + 16, 16, 15, 16, 15, 16, 14, 13, 11, 16, 12, 15, 12, 16, 12, 13, + 13, 16, 13, 15, 13, 16, 13, 13, 16, 16, 15, 16, 15, 16, 14, 13, + 12, 16, 11, 14, 13, 16, 12, 12, 13, 16, 11, 14, 13, 16, 12, 12, + 16, 16, 13, 14, 15, 16, 12, 12, 11, 16, 12, 14, 10, 14, 11, 12, + 14, 16, 13, 15, 12, 15, 12, 12, 16, 16, 16, 16, 14, 15, 13, 12, + 12, 16, 13, 15, 12, 14, 12, 12, 13, 16, 13, 15, 12, 14, 12, 12, + 16, 16, 14, 16, 14, 15, 12, 12, 14, 16, 13, 15, 13, 16, 11, 12, + 13, 16, 12, 14, 13, 15, 11, 11, 14, 16, 12, 13, 12, 13, 11, 10, + }, + { + 0, 8, 4, 9, 5, 10, 9, 11, 5, 11, 9, 12, 9, 13, 12, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 4, 11, 6, 12, 9, 13, 11, 13, + 9, 16, 10, 16, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 4, 12, 8, 13, 7, 12, 11, 16, + 8, 16, 11, 16, 11, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 8, 16, 10, 16, 11, 16, 13, 16, 11, 16, 12, 16, 13, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 1, 10, 6, 11, 7, 12, 10, 13, + 7, 12, 10, 13, 10, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 5, 13, 7, 12, 10, 16, 12, 16, 10, 16, 11, 16, 12, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 11, 16, 16, 16, 16, 16, + 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 5, 13, 9, 16, 8, 16, 12, 16, 9, 16, 12, 16, 11, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 9, 16, 11, 16, 12, 16, 13, 16, + 10, 16, 12, 16, 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, 16, 16, 16, 16, 16, 16, 16, 12, 16, 16, 16, 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, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 6, 16, 9, 16, 10, 16, 13, 16, 11, 16, 12, 16, 13, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 8, 16, 9, 16, 12, 16, 13, 16, + 12, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 16, 10, 16, 16, 16, 16, 16, 16, 16, 13, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 8, 16, 11, 16, 11, 16, 13, 16, + 12, 16, 13, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 12, 16, 13, 16, 16, 16, 11, 16, 13, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 16, 16, 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 7, 16, 11, 16, 12, 16, 16, 16, + 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 11, 16, 13, 16, 16, 16, 16, 16, 13, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 10, 16, 16, 16, 16, 16, + 16, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 12, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 13, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 12, 16, 16, 16, 16, 16, 16, 16, 12, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 16, 16, 11, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 16, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + }, + }, + { + { + 0, 7, 4, 8, 4, 8, 7, 8, 6, 10, 7, 10, 8, 10, 9, 10, + 13, 16, 13, 15, 13, 15, 13, 14, 4, 10, 5, 10, 7, 10, 9, 10, + 7, 12, 8, 11, 9, 12, 10, 11, 13, 16, 13, 15, 13, 16, 13, 14, + 9, 16, 9, 13, 12, 16, 11, 13, 11, 16, 11, 14, 13, 16, 12, 14, + 15, 16, 14, 16, 15, 16, 14, 14, 4, 10, 7, 10, 6, 10, 9, 10, + 8, 12, 9, 12, 9, 11, 10, 12, 13, 16, 13, 16, 14, 16, 13, 14, + 7, 12, 8, 12, 9, 12, 10, 12, 9, 13, 10, 13, 10, 13, 11, 12, + 14, 16, 13, 16, 14, 16, 13, 14, 12, 16, 11, 14, 13, 16, 12, 14, + 13, 16, 12, 16, 14, 16, 13, 14, 16, 16, 14, 16, 15, 16, 14, 14, + 10, 16, 12, 15, 10, 14, 12, 13, 12, 16, 13, 16, 12, 14, 13, 14, + 15, 16, 14, 16, 14, 16, 14, 14, 12, 16, 13, 16, 12, 16, 13, 14, + 13, 16, 13, 16, 13, 16, 13, 14, 16, 16, 14, 16, 15, 16, 14, 15, + 15, 16, 14, 16, 15, 16, 13, 15, 16, 16, 14, 16, 15, 16, 14, 15, + 16, 16, 16, 16, 16, 16, 15, 15, 2, 9, 5, 10, 6, 10, 8, 10, + 7, 11, 8, 11, 9, 11, 10, 11, 14, 16, 13, 15, 14, 15, 14, 14, + 5, 11, 6, 11, 8, 12, 9, 11, 8, 13, 9, 12, 10, 13, 11, 12, + 14, 16, 13, 15, 14, 16, 14, 14, 9, 16, 8, 13, 12, 16, 11, 13, + 12, 16, 11, 14, 13, 16, 12, 13, 16, 16, 14, 16, 15, 16, 14, 15, + 5, 12, 8, 11, 7, 11, 9, 11, 9, 13, 10, 13, 10, 13, 11, 12, + 14, 16, 14, 16, 14, 16, 14, 15, 8, 13, 9, 13, 10, 13, 11, 12, + 9, 13, 10, 13, 10, 13, 11, 13, 13, 16, 13, 15, 13, 16, 13, 14, + 12, 16, 11, 14, 13, 16, 12, 14, 12, 16, 11, 14, 13, 16, 12, 14, + 14, 16, 13, 16, 14, 16, 13, 14, 10, 16, 12, 15, 9, 14, 11, 13, + 12, 16, 13, 16, 12, 15, 12, 14, 16, 16, 15, 16, 15, 16, 14, 14, + 12, 16, 13, 16, 12, 16, 12, 14, 12, 16, 13, 16, 12, 15, 13, 14, + 15, 16, 14, 16, 14, 16, 14, 14, 15, 16, 14, 16, 14, 16, 14, 15, + 14, 16, 13, 16, 14, 16, 13, 14, 16, 16, 14, 16, 14, 16, 13, 14, + 6, 14, 9, 13, 9, 14, 11, 12, 10, 14, 11, 13, 11, 14, 12, 13, + 16, 16, 15, 16, 15, 16, 14, 15, 8, 15, 9, 13, 11, 14, 11, 13, + 11, 16, 11, 14, 12, 15, 12, 14, 16, 16, 15, 16, 16, 16, 15, 16, + 10, 16, 9, 14, 12, 16, 12, 13, 13, 16, 11, 15, 14, 16, 13, 14, + 16, 16, 15, 16, 16, 16, 15, 16, 8, 15, 10, 13, 10, 14, 11, 13, + 11, 16, 12, 14, 12, 14, 12, 14, 16, 16, 16, 16, 16, 16, 15, 16, + 10, 16, 11, 14, 11, 15, 12, 13, 11, 16, 11, 14, 12, 15, 12, 14, + 16, 16, 14, 16, 15, 16, 14, 15, 12, 16, 11, 15, 13, 16, 13, 14, + 12, 16, 11, 14, 13, 16, 13, 14, 15, 16, 13, 16, 16, 16, 14, 15, + 10, 16, 12, 15, 10, 15, 12, 13, 13, 16, 13, 16, 12, 16, 13, 14, + 16, 16, 16, 16, 16, 16, 15, 15, 12, 16, 13, 16, 12, 16, 13, 14, + 12, 16, 13, 16, 12, 16, 13, 14, 16, 16, 15, 16, 14, 16, 14, 15, + 15, 16, 14, 16, 15, 16, 14, 15, 14, 16, 13, 16, 14, 16, 13, 14, + 14, 16, 13, 15, 14, 16, 13, 14, 9, 16, 11, 16, 11, 16, 12, 14, + 13, 16, 12, 16, 13, 16, 13, 14, 16, 16, 15, 16, 16, 16, 15, 15, + 11, 16, 11, 16, 12, 16, 13, 14, 13, 16, 12, 16, 13, 16, 13, 14, + 16, 16, 15, 16, 16, 16, 15, 15, 11, 16, 10, 15, 13, 16, 12, 13, + 14, 16, 12, 16, 14, 16, 13, 14, 16, 16, 15, 16, 16, 16, 14, 14, + 11, 16, 12, 16, 11, 16, 13, 14, 13, 16, 13, 16, 13, 16, 13, 14, + 16, 16, 16, 16, 16, 16, 15, 15, 11, 16, 12, 16, 12, 16, 13, 14, + 13, 16, 13, 16, 13, 16, 13, 14, 16, 16, 15, 16, 16, 16, 15, 14, + 12, 16, 12, 15, 13, 16, 12, 14, 13, 16, 12, 16, 14, 16, 13, 14, + 16, 16, 14, 16, 16, 16, 14, 14, 11, 16, 12, 16, 11, 16, 12, 14, + 14, 16, 14, 16, 12, 16, 13, 14, 16, 16, 16, 16, 16, 16, 15, 14, + 12, 16, 13, 16, 12, 16, 12, 14, 13, 16, 13, 16, 12, 16, 13, 14, + 16, 16, 16, 16, 15, 16, 14, 14, 14, 16, 13, 16, 14, 16, 12, 14, + 13, 16, 13, 16, 13, 16, 12, 13, 15, 16, 13, 14, 14, 15, 13, 13, + }, + { + 0, 8, 4, 10, 5, 11, 10, 16, 5, 12, 9, 16, 10, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 4, 12, 7, 12, 9, 16, 12, 16, + 9, 16, 11, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 4, 12, 9, 16, 8, 16, 12, 16, + 8, 16, 11, 16, 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 8, 16, 11, 16, 12, 16, 16, 16, 11, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 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, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 1, 11, 6, 12, 7, 16, 11, 16, + 7, 16, 10, 16, 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 5, 16, 7, 16, 10, 16, 12, 16, 9, 16, 11, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 11, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 5, 16, 10, 16, 8, 16, 12, 16, 9, 16, 12, 16, 12, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 9, 16, 11, 16, 12, 16, 16, 16, + 10, 16, 12, 16, 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, 16, 16, 16, 16, 16, 16, 16, 12, 16, 16, 16, 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, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 5, 16, 9, 16, 10, 16, 16, 16, 11, 16, 12, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 8, 16, 9, 16, 12, 16, 16, 16, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 16, 10, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 8, 16, 11, 16, 11, 16, 16, 16, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 12, 16, 16, 16, 16, 16, 11, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 11, 16, 16, 16, 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 6, 16, 10, 16, 12, 16, 16, 16, + 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 9, 16, 10, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 9, 16, 16, 16, 16, 16, + 16, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 9, 16, 16, 16, 12, 16, 16, 16, 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, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 13, 16, 12, 16, 16, 16, 16, 16, 16, 16, 12, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 16, 16, 11, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + }, + }, + { + { + 0, 8, 4, 10, 5, 9, 8, 10, 6, 11, 8, 12, 8, 11, 10, 13, + 14, 16, 14, 16, 14, 16, 16, 16, 3, 11, 5, 11, 8, 12, 10, 12, + 7, 12, 9, 13, 10, 13, 11, 13, 14, 16, 14, 16, 16, 16, 16, 16, + 9, 16, 9, 16, 12, 16, 12, 16, 11, 16, 11, 16, 14, 16, 13, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 4, 11, 7, 12, 6, 11, 10, 12, + 8, 13, 9, 13, 9, 13, 11, 14, 13, 16, 14, 16, 14, 16, 16, 16, + 7, 13, 9, 13, 9, 13, 11, 13, 9, 14, 10, 16, 11, 16, 12, 16, + 15, 16, 14, 16, 16, 16, 16, 16, 12, 16, 12, 16, 14, 16, 13, 16, + 13, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 12, 16, 10, 16, 13, 16, 12, 16, 13, 16, 12, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 13, 16, 13, 16, 14, 16, + 13, 16, 14, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 2, 10, 5, 11, 6, 11, 9, 11, + 7, 12, 9, 13, 9, 13, 11, 13, 14, 16, 16, 16, 16, 16, 16, 16, + 4, 12, 6, 12, 8, 13, 10, 13, 8, 13, 9, 13, 11, 16, 12, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 9, 16, 8, 16, 12, 16, 12, 16, + 12, 16, 11, 16, 13, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 5, 12, 8, 13, 7, 13, 10, 13, 8, 14, 10, 14, 10, 14, 12, 14, + 16, 16, 16, 16, 16, 16, 16, 16, 7, 14, 9, 16, 10, 16, 11, 14, + 8, 14, 10, 16, 11, 16, 12, 16, 13, 16, 14, 16, 16, 16, 16, 16, + 11, 16, 11, 16, 13, 16, 13, 16, 12, 16, 12, 16, 14, 16, 14, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 9, 16, 12, 16, 10, 16, 12, 16, + 12, 16, 13, 16, 12, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 13, 16, 12, 16, 14, 16, 12, 16, 13, 16, 12, 16, 14, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 6, 16, 8, 16, 9, 16, 11, 13, 10, 16, 11, 16, 11, 16, 13, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 7, 16, 9, 16, 10, 16, 12, 16, + 11, 16, 11, 16, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 9, 16, 12, 16, 13, 16, 13, 16, 12, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 7, 16, 10, 16, 9, 16, 12, 16, + 11, 16, 12, 16, 12, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 9, 16, 11, 16, 11, 16, 12, 16, 11, 16, 12, 16, 13, 16, 13, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 12, 16, 14, 16, 14, 16, + 12, 16, 12, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 12, 16, 10, 16, 13, 16, 13, 16, 14, 16, 13, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 13, 16, 12, 16, 14, 16, + 12, 16, 14, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 9, 16, 11, 16, 11, 16, 13, 16, + 12, 16, 13, 16, 13, 16, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 11, 16, 13, 16, 13, 16, 13, 16, 13, 16, 14, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 11, 16, 14, 16, 13, 16, + 14, 16, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 12, 16, 12, 16, 13, 16, 13, 16, 13, 16, 13, 16, 14, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 12, 16, 13, 16, 14, 16, + 13, 16, 13, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 12, 16, 14, 16, 14, 16, 14, 16, 14, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 13, 16, 11, 16, 14, 16, + 16, 16, 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 14, 16, 13, 16, 14, 16, 16, 16, 16, 16, 14, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + }, + { + 0, 10, 4, 12, 5, 16, 11, 16, 6, 16, 10, 16, 11, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 3, 16, 7, 16, 10, 16, 16, 16, + 9, 16, 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, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 4, 16, 10, 16, 9, 16, 16, 16, + 9, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 9, 16, 12, 16, 16, 16, 16, 16, 11, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 1, 16, 6, 16, 8, 16, 16, 16, + 8, 16, 11, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 5, 16, 8, 16, 11, 16, 16, 16, 10, 16, 12, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 12, 16, 11, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 5, 16, 11, 16, 9, 16, 16, 16, 10, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 9, 16, 12, 16, 16, 16, 16, 16, + 10, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 5, 16, 9, 16, 11, 16, 16, 16, 11, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 8, 16, 10, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 11, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 8, 16, 16, 16, 11, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 16, 16, 16, 16, 16, 16, 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, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 12, 16, 16, 16, 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, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 6, 16, 11, 16, 15, 16, 16, 16, + 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 9, 16, 10, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 11, 16, 9, 16, 16, 16, 16, 16, + 16, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 10, 16, 16, 16, 16, 16, 16, 16, 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, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 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, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 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 uint8_t rv34_table_inter_secondpat[NUM_INTER_TABLES][2][OTHERBLK_VLC_SIZE] = { + { + { + 0, 4, 8, 3, 6, 8, 6, 7, 8, 4, 6, 8, 6, 7, 8, 7, + 8, 8, 7, 8, 8, 8, 8, 8, 8, 8, 8, 3, 6, 8, 4, 6, + 9, 7, 7, 8, 5, 7, 9, 6, 7, 9, 8, 8, 8, 7, 8, 8, + 8, 8, 8, 8, 8, 7, 6, 8, 9, 7, 8, 9, 7, 8, 9, 7, + 8, 9, 7, 8, 9, 8, 8, 9, 8, 8, 9, 8, 9, 9, 8, 8, + 8, 8, 9, 9, 8, 9, 9, 7, 8, 8, 8, 9, 9, 8, 9, 9, + 8, 8, 8, 7, 8, 8, 8, 8, 8, 7, 7, 6, + }, + { + 0, 4, 9, 3, 6, 9, 7, 8, 10, 3, 6, 9, 5, 7, 10, 9, + 9, 10, 7, 8, 10, 8, 9, 10, 10, 10, 10, 2, 6, 9, 4, 7, + 10, 8, 9, 10, 4, 7, 10, 6, 7, 10, 9, 9, 10, 7, 8, 10, + 8, 9, 10, 10, 10, 10, 6, 8, 10, 7, 9, 11, 9, 10, 11, 7, + 9, 11, 8, 9, 11, 10, 10, 11, 8, 9, 11, 9, 10, 11, 11, 11, + 10, 8, 10, 11, 9, 10, 11, 9, 10, 11, 8, 10, 11, 9, 10, 11, + 10, 10, 11, 8, 10, 11, 9, 10, 10, 10, 10, 9, + }, + }, + { + { + 0, 4, 8, 3, 6, 8, 6, 7, 9, 4, 6, 8, 5, 7, 8, 8, + 8, 9, 7, 7, 8, 8, 8, 8, 8, 9, 8, 3, 6, 8, 4, 6, + 9, 7, 7, 9, 5, 6, 9, 6, 7, 9, 8, 8, 9, 7, 8, 8, + 8, 8, 8, 8, 8, 8, 6, 8, 9, 7, 8, 10, 7, 8, 9, 7, + 8, 10, 7, 8, 10, 8, 8, 9, 7, 8, 9, 8, 9, 9, 9, 9, + 8, 7, 9, 10, 8, 9, 10, 8, 8, 8, 8, 9, 10, 8, 9, 9, + 8, 8, 8, 7, 8, 8, 8, 8, 8, 8, 7, 6, + }, + { + 0, 4, 9, 3, 6, 10, 8, 9, 11, 3, 5, 9, 5, 7, 10, 9, + 10, 11, 7, 8, 10, 9, 9, 11, 11, 11, 12, 2, 5, 10, 4, 7, + 10, 8, 9, 11, 4, 6, 10, 6, 7, 10, 9, 10, 11, 7, 9, 10, + 9, 9, 11, 11, 11, 11, 6, 8, 11, 7, 9, 11, 9, 10, 12, 7, + 9, 11, 8, 9, 12, 10, 10, 12, 8, 10, 11, 10, 10, 11, 12, 11, + 11, 8, 10, 12, 9, 11, 12, 10, 11, 12, 9, 10, 12, 10, 11, 12, + 11, 11, 12, 9, 10, 12, 10, 10, 11, 11, 11, 10, + }, + }, + { + { + 0, 4, 8, 3, 6, 9, 7, 8, 9, 4, 6, 8, 5, 7, 9, 8, + 9, 9, 7, 8, 9, 8, 8, 9, 9, 9, 9, 2, 6, 9, 4, 6, + 9, 7, 8, 10, 5, 7, 9, 6, 7, 9, 8, 8, 9, 7, 8, 9, + 8, 8, 9, 9, 9, 9, 6, 8, 10, 7, 8, 10, 8, 9, 10, 6, + 8, 10, 8, 8, 10, 9, 9, 10, 8, 9, 10, 9, 9, 10, 10, 10, + 9, 8, 9, 10, 8, 9, 10, 8, 9, 10, 8, 9, 10, 9, 9, 10, + 9, 9, 9, 8, 9, 9, 8, 9, 9, 9, 9, 8, + }, + { + 0, 4, 10, 3, 6, 10, 8, 10, 12, 2, 6, 10, 6, 8, 11, 10, + 11, 12, 7, 9, 11, 9, 10, 12, 12, 13, 13, 2, 6, 10, 4, 7, + 11, 9, 10, 13, 4, 7, 11, 7, 8, 11, 10, 11, 12, 8, 9, 12, + 10, 10, 12, 12, 12, 13, 6, 9, 12, 8, 10, 13, 10, 12, 14, 7, + 10, 13, 9, 10, 13, 11, 11, 13, 9, 11, 13, 11, 11, 13, 13, 13, + 13, 9, 11, 13, 10, 12, 14, 11, 12, 14, 9, 11, 14, 11, 12, 14, + 12, 12, 14, 9, 12, 13, 11, 12, 13, 13, 12, 12, + }, + }, + { + { + 0, 4, 9, 3, 6, 9, 7, 8, 10, 3, 6, 9, 6, 7, 9, 9, + 9, 10, 7, 8, 9, 8, 9, 10, 10, 10, 11, 2, 6, 9, 4, 7, + 10, 7, 9, 10, 4, 7, 10, 6, 7, 10, 9, 9, 10, 7, 8, 10, + 8, 9, 10, 10, 10, 10, 6, 8, 11, 7, 9, 11, 8, 10, 11, 6, + 9, 11, 8, 9, 11, 9, 9, 11, 8, 9, 11, 9, 10, 11, 11, 10, + 10, 8, 10, 11, 9, 10, 11, 9, 10, 11, 8, 10, 11, 9, 10, 11, + 10, 10, 11, 8, 10, 11, 9, 10, 11, 10, 10, 10, + }, + { + 0, 4, 12, 3, 7, 12, 10, 11, 14, 3, 6, 12, 7, 9, 13, 12, + 13, 14, 8, 11, 13, 11, 12, 14, 14, 14, 14, 1, 7, 12, 5, 8, + 13, 10, 12, 14, 4, 8, 13, 8, 9, 13, 12, 13, 14, 9, 11, 14, + 11, 12, 14, 14, 14, 14, 7, 10, 14, 9, 11, 14, 11, 13, 16, 8, + 11, 14, 10, 12, 14, 13, 13, 16, 10, 12, 15, 12, 13, 15, 15, 15, + 15, 10, 13, 15, 12, 13, 14, 13, 15, 15, 10, 13, 15, 12, 13, 15, + 13, 14, 15, 10, 13, 14, 12, 13, 14, 14, 14, 14, + }, + }, + { + { + 0, 4, 9, 3, 6, 10, 7, 9, 11, 3, 5, 9, 5, 7, 10, 9, + 10, 12, 7, 8, 10, 9, 10, 11, 11, 12, 12, 2, 6, 10, 4, 7, + 10, 7, 9, 12, 4, 7, 10, 6, 7, 11, 9, 10, 12, 7, 9, 11, + 9, 9, 11, 11, 11, 12, 5, 8, 11, 7, 9, 12, 9, 10, 13, 6, + 9, 12, 8, 9, 12, 10, 10, 12, 8, 10, 12, 10, 10, 12, 12, 12, + 12, 8, 10, 12, 9, 11, 13, 10, 11, 13, 9, 11, 13, 10, 11, 13, + 11, 11, 13, 9, 11, 12, 10, 11, 12, 11, 11, 12, + }, + { + 0, 4, 12, 3, 7, 13, 10, 12, 15, 3, 7, 13, 7, 9, 14, 12, + 12, 13, 8, 11, 14, 11, 13, 15, 15, 14, 14, 1, 6, 13, 5, 8, + 13, 10, 13, 15, 4, 8, 13, 8, 9, 14, 13, 13, 15, 8, 11, 14, + 12, 12, 15, 15, 14, 14, 7, 10, 13, 9, 11, 13, 12, 14, 16, 8, + 11, 14, 10, 12, 15, 13, 13, 16, 10, 12, 15, 12, 13, 15, 15, 14, + 15, 11, 12, 14, 12, 14, 14, 13, 15, 15, 10, 12, 14, 12, 13, 15, + 14, 15, 15, 10, 13, 13, 12, 13, 15, 14, 14, 15, + }, + }, + { + { + 0, 5, 10, 3, 7, 11, 9, 11, 14, 3, 7, 11, 7, 8, 12, 11, + 12, 14, 7, 9, 12, 10, 11, 14, 13, 14, 16, 1, 7, 11, 5, 8, + 12, 9, 11, 15, 4, 8, 12, 7, 9, 13, 11, 12, 15, 8, 10, 13, + 10, 11, 14, 14, 14, 16, 6, 9, 13, 8, 11, 14, 10, 13, 16, 7, + 10, 14, 9, 11, 15, 12, 13, 16, 9, 11, 15, 12, 12, 15, 14, 14, + 16, 10, 12, 14, 11, 13, 15, 12, 14, 16, 10, 12, 15, 11, 13, 16, + 13, 14, 16, 10, 13, 16, 12, 13, 15, 14, 15, 16, + }, + { + 0, 5, 16, 3, 8, 14, 11, 13, 14, 2, 8, 14, 8, 10, 16, 13, + 13, 14, 9, 13, 16, 12, 13, 16, 16, 14, 16, 1, 7, 14, 6, 10, + 14, 12, 16, 16, 5, 9, 14, 9, 11, 16, 15, 16, 16, 10, 12, 16, + 13, 13, 16, 16, 14, 16, 8, 11, 14, 11, 13, 14, 14, 14, 16, 8, + 12, 14, 11, 13, 16, 16, 16, 16, 10, 12, 15, 13, 14, 16, 16, 16, + 16, 11, 14, 14, 14, 15, 16, 16, 15, 16, 10, 13, 16, 13, 14, 14, + 16, 16, 16, 10, 13, 16, 13, 14, 16, 16, 16, 16, + }, + }, + { + { + 0, 5, 11, 3, 7, 13, 9, 12, 16, 3, 7, 12, 6, 9, 14, 11, + 13, 16, 7, 10, 16, 11, 12, 16, 16, 16, 16, 1, 6, 12, 5, 9, + 16, 9, 13, 16, 4, 8, 16, 7, 10, 16, 12, 15, 16, 7, 11, 16, + 11, 12, 16, 16, 16, 16, 6, 10, 15, 8, 11, 16, 11, 14, 16, 7, + 11, 16, 10, 12, 16, 13, 16, 16, 9, 13, 16, 13, 14, 16, 16, 16, + 16, 10, 12, 16, 12, 16, 16, 16, 16, 16, 11, 13, 16, 13, 16, 16, + 16, 16, 16, 12, 16, 16, 16, 16, 16, 16, 16, 16, + }, + { + 0, 5, 16, 3, 8, 16, 12, 12, 16, 2, 8, 16, 8, 10, 16, 13, + 13, 16, 9, 13, 16, 12, 13, 16, 16, 16, 16, 1, 8, 16, 6, 10, + 16, 12, 16, 16, 5, 9, 16, 9, 11, 16, 13, 16, 16, 9, 12, 14, + 12, 12, 16, 16, 16, 16, 8, 11, 13, 11, 12, 16, 14, 16, 16, 8, + 12, 16, 11, 13, 16, 16, 15, 16, 9, 13, 14, 12, 13, 16, 16, 16, + 16, 10, 12, 13, 14, 13, 16, 16, 16, 16, 9, 13, 16, 13, 12, 16, + 16, 16, 16, 10, 12, 16, 14, 15, 16, 16, 16, 16, + }, + }, +}; + +static const uint8_t rv34_table_inter_thirdpat[NUM_INTER_TABLES][2][OTHERBLK_VLC_SIZE] = { + { + { + 0, 5, 8, 3, 6, 9, 6, 7, 9, 4, 6, 9, 6, 7, 9, 8, + 8, 9, 7, 8, 9, 8, 9, 9, 9, 9, 9, 2, 6, 9, 4, 7, + 9, 7, 8, 9, 5, 7, 9, 6, 7, 9, 8, 8, 9, 7, 8, 9, + 8, 9, 9, 9, 9, 8, 5, 8, 10, 6, 8, 10, 8, 9, 9, 7, + 8, 10, 7, 9, 10, 8, 9, 9, 8, 9, 10, 9, 9, 10, 9, 9, + 9, 7, 9, 10, 8, 9, 10, 8, 8, 9, 8, 9, 10, 8, 9, 10, + 8, 8, 9, 8, 9, 9, 8, 9, 9, 8, 8, 7, + }, + { + 0, 4, 9, 2, 6, 10, 7, 8, 10, 3, 6, 10, 6, 7, 10, 9, + 9, 10, 8, 9, 11, 9, 10, 11, 10, 11, 11, 2, 6, 10, 4, 7, + 10, 8, 9, 10, 5, 7, 10, 7, 8, 10, 9, 9, 10, 9, 10, 11, + 10, 10, 11, 11, 11, 11, 6, 9, 11, 7, 9, 11, 9, 10, 12, 8, + 9, 11, 8, 10, 11, 10, 10, 11, 10, 11, 12, 11, 11, 12, 11, 11, + 11, 9, 11, 12, 10, 11, 12, 10, 11, 12, 10, 11, 12, 10, 11, 12, + 11, 11, 12, 11, 12, 12, 11, 12, 12, 12, 11, 11, + }, + }, + { + { + 0, 4, 9, 3, 6, 9, 6, 8, 9, 4, 6, 9, 5, 7, 9, 8, + 8, 9, 7, 8, 10, 8, 9, 10, 9, 9, 9, 2, 6, 9, 4, 7, + 9, 7, 8, 9, 5, 7, 9, 6, 7, 10, 8, 9, 9, 7, 9, 10, + 8, 9, 10, 9, 9, 9, 5, 8, 10, 6, 8, 10, 8, 9, 10, 7, + 8, 10, 7, 9, 11, 9, 9, 10, 8, 9, 10, 9, 10, 10, 10, 10, + 9, 7, 9, 10, 8, 9, 11, 8, 9, 10, 8, 9, 11, 8, 9, 11, + 9, 9, 10, 9, 9, 10, 9, 9, 10, 9, 9, 8, + }, + { + 0, 4, 9, 2, 5, 10, 7, 8, 11, 3, 6, 10, 6, 7, 10, 9, + 10, 11, 8, 9, 11, 9, 10, 11, 11, 11, 12, 2, 6, 10, 4, 7, + 10, 8, 9, 11, 5, 7, 10, 6, 8, 10, 9, 10, 11, 9, 10, 12, + 10, 10, 12, 11, 12, 12, 6, 9, 11, 8, 9, 12, 9, 11, 13, 8, + 10, 12, 9, 10, 12, 11, 11, 12, 10, 12, 13, 11, 12, 13, 13, 12, + 13, 10, 11, 13, 10, 12, 13, 11, 12, 13, 11, 12, 13, 11, 12, 13, + 12, 12, 13, 12, 13, 14, 13, 13, 14, 13, 13, 13, + }, + }, + { + { + 0, 4, 9, 3, 6, 9, 7, 8, 10, 3, 6, 9, 5, 7, 10, 8, + 9, 10, 7, 9, 10, 8, 9, 10, 10, 10, 10, 2, 6, 9, 4, 7, + 10, 7, 9, 10, 4, 7, 10, 6, 8, 10, 8, 9, 10, 8, 9, 10, + 9, 9, 10, 10, 10, 10, 5, 8, 11, 7, 9, 11, 8, 10, 11, 7, + 9, 11, 8, 9, 11, 9, 10, 11, 9, 10, 11, 10, 10, 11, 11, 11, + 11, 8, 10, 11, 9, 10, 11, 9, 10, 11, 9, 10, 12, 9, 10, 12, + 10, 11, 11, 9, 10, 11, 10, 11, 11, 10, 10, 10, + }, + { + 0, 4, 10, 3, 6, 11, 8, 10, 12, 3, 6, 11, 6, 8, 11, 10, + 11, 13, 9, 10, 13, 11, 12, 14, 13, 13, 14, 1, 6, 10, 5, 8, + 12, 9, 10, 13, 5, 8, 11, 7, 9, 12, 11, 11, 13, 10, 12, 13, + 11, 12, 14, 14, 13, 15, 7, 10, 12, 9, 11, 14, 11, 12, 15, 9, + 11, 13, 10, 11, 14, 12, 12, 14, 12, 14, 16, 13, 13, 16, 14, 14, + 16, 12, 13, 15, 12, 14, 15, 13, 14, 16, 13, 14, 16, 14, 14, 16, + 14, 15, 16, 14, 16, 16, 15, 16, 16, 15, 15, 16, + }, + }, + { + { + 0, 4, 9, 2, 6, 9, 7, 9, 11, 3, 6, 10, 6, 7, 10, 9, + 10, 11, 7, 9, 10, 9, 10, 11, 11, 11, 12, 2, 6, 10, 4, 7, + 10, 8, 9, 11, 5, 7, 10, 7, 8, 10, 9, 10, 11, 8, 9, 11, + 9, 10, 11, 11, 12, 11, 6, 9, 11, 7, 10, 12, 9, 11, 12, 7, + 10, 12, 9, 10, 12, 11, 11, 12, 9, 11, 12, 10, 11, 12, 12, 12, + 12, 9, 11, 12, 9, 11, 13, 11, 12, 13, 9, 11, 13, 10, 12, 13, + 11, 12, 13, 11, 12, 13, 11, 12, 13, 12, 13, 12, + }, + { + 0, 4, 11, 2, 6, 12, 9, 11, 16, 4, 7, 12, 7, 9, 15, 11, + 12, 16, 10, 11, 16, 11, 13, 16, 16, 16, 16, 1, 6, 11, 5, 8, + 16, 9, 12, 16, 6, 9, 15, 8, 10, 16, 12, 13, 16, 12, 14, 16, + 12, 16, 16, 16, 16, 16, 8, 11, 14, 10, 12, 16, 12, 16, 16, 10, + 13, 16, 12, 16, 16, 13, 14, 16, 14, 16, 16, 16, 16, 16, 16, 16, + 16, 13, 13, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + }, + }, + { + { + 0, 5, 9, 3, 6, 10, 8, 10, 12, 3, 6, 10, 6, 8, 10, 10, + 11, 12, 8, 9, 11, 10, 10, 12, 13, 13, 13, 1, 6, 10, 5, 8, + 11, 9, 11, 13, 5, 8, 11, 7, 9, 11, 11, 11, 13, 8, 9, 11, + 10, 10, 12, 13, 13, 14, 6, 9, 12, 8, 11, 13, 11, 13, 15, 8, + 10, 13, 10, 11, 13, 12, 13, 15, 10, 12, 13, 12, 12, 13, 14, 14, + 14, 9, 12, 14, 11, 13, 15, 13, 15, 16, 11, 13, 15, 12, 14, 15, + 14, 15, 16, 13, 14, 15, 14, 14, 15, 15, 16, 16, + }, + { + 0, 4, 16, 2, 7, 16, 10, 13, 16, 3, 8, 16, 7, 10, 16, 16, + 16, 16, 12, 16, 16, 15, 16, 16, 16, 16, 16, 1, 7, 16, 6, 9, + 16, 10, 16, 16, 7, 12, 16, 9, 13, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 9, 16, 16, 11, 13, 16, 16, 16, 16, 12, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 14, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + }, + }, + { + { + 0, 4, 9, 3, 6, 11, 9, 12, 16, 3, 6, 10, 6, 8, 11, 12, + 13, 16, 8, 9, 12, 10, 11, 13, 16, 16, 16, 1, 6, 10, 5, 8, + 12, 10, 13, 16, 5, 8, 11, 8, 9, 13, 13, 14, 16, 9, 10, 14, + 11, 12, 15, 16, 16, 16, 6, 10, 13, 9, 12, 16, 14, 16, 16, 9, + 12, 14, 11, 13, 16, 16, 16, 16, 12, 14, 16, 14, 16, 16, 16, 16, + 16, 11, 16, 16, 13, 16, 16, 16, 16, 16, 12, 16, 16, 13, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + }, + { + 0, 4, 16, 2, 8, 16, 10, 16, 16, 3, 9, 16, 8, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 1, 7, 16, 5, 10, + 16, 16, 16, 16, 7, 16, 16, 11, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 10, 15, 16, 10, 16, 16, 16, 16, 16, 14, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + }, + }, + { + { + 0, 3, 9, 3, 7, 11, 11, 15, 16, 3, 6, 11, 7, 9, 12, 16, + 16, 16, 8, 10, 16, 11, 16, 16, 16, 16, 16, 1, 6, 11, 6, 9, + 15, 16, 16, 16, 5, 8, 16, 9, 11, 16, 16, 16, 16, 10, 16, 16, + 16, 16, 16, 16, 16, 16, 7, 11, 16, 11, 16, 16, 16, 16, 16, 11, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + }, + { + 0, 4, 16, 2, 8, 16, 16, 16, 16, 3, 12, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 1, 7, 16, 5, 12, + 16, 16, 16, 16, 6, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 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, + }, + }, +}; + + +static const uint8_t rv34_inter_coeff[NUM_INTER_TABLES][COEFF_VLC_SIZE] = { +{ + 1, 2, 4, 4, 5, 5, 6, 7, 7, 7, 8, 8, 8, 9, 9, 10, + 10, 10, 10, 11, 11, 11, 11, 12, 11, 11, 11, 13, 14, 15, 16, 16, +}, +{ + 1, 2, 3, 5, 5, 6, 6, 7, 7, 8, 9, 9, 9, 10, 10, 10, + 11, 11, 12, 12, 12, 12, 13, 13, 12, 12, 13, 14, 16, 16, 16, 16, +}, +{ + 1, 2, 3, 4, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 12, + 12, 12, 13, 13, 13, 14, 14, 15, 14, 14, 16, 16, 16, 16, 16, 16, +}, +{ + 1, 2, 3, 4, 5, 6, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, + 13, 13, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, +}, +{ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, +}, +{ + 1, 2, 3, 4, 5, 6, 7, 8, 10, 10, 11, 11, 13, 12, 12, 13, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, +}, +{ + 1, 2, 3, 4, 5, 6, 7, 8, 10, 10, 10, 11, 14, 13, 15, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 15, 16, 16, 16, +} +}; + +#endif /* AVCODEC_RV34VLC_H */ diff --git a/include/libavcodec/rv40data.h b/include/libavcodec/rv40data.h new file mode 100644 index 0000000..36f9f91 --- /dev/null +++ b/include/libavcodec/rv40data.h @@ -0,0 +1,101 @@ +/* + * RealVideo 4 decoder + * copyright (c) 2007 Konstantin Shishkov + * + * 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 + */ + +/** + * @file + * miscellaneous RV40 tables + */ + +#ifndef AVCODEC_RV40DATA_H +#define AVCODEC_RV40DATA_H + +#include + +/** + * standard widths and heights coded in RV40 + */ +//@{ +static const int rv40_standard_widths[] = { 160, 172, 240, 320, 352, 640, 704, 0}; +static const int rv40_standard_heights[] = { 120, 132, 144, 240, 288, 480, -8, -10, 180, 360, 576, 0}; +//@} + +#define MODE2_PATTERNS_NUM 20 +/** + * intra types table + * + * These values are actually coded 3-tuples + * used for detecting standard block configurations. + */ +static const uint16_t rv40_aic_table_index[MODE2_PATTERNS_NUM] = { + 0x000, 0x100, 0x200, + 0x011, 0x111, 0x211, 0x511, 0x611, + 0x022, 0x122, 0x222, 0x722, + 0x272, 0x227, + 0x822, 0x282, 0x228, + 0x112, 0x116, 0x221 +}; + +/** + * luma quantizer values + * The second table is used for inter blocks. + */ +static const uint8_t rv40_luma_dc_quant[2][32] = { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 22, 22, 22, 22 }, + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 20, 21, 21, 22, 23, 23, 23, 24, 24, 24, 24 } +}; + +/** + * @name Coefficients used by the RV40 loop filter + * @{ + */ + +/** alpha parameter for RV40 loop filter - almost the same as in JVT-A003r1 */ +static const uint8_t rv40_alpha_tab[32] = { + 128, 128, 128, 128, 128, 128, 128, 128, + 128, 128, 122, 96, 75, 59, 47, 37, + 29, 23, 18, 15, 13, 11, 10, 9, + 8, 7, 6, 5, 4, 3, 2, 1 +}; +/** beta parameter for RV40 loop filter - almost the same as in JVT-A003r1 */ +static const uint8_t rv40_beta_tab[32] = { + 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 4, 4, 4, 6, 6, + 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 13, 14, 15, 16, 17 +}; +/** clip table for RV40 loop filter - the same as in JVT-A003r1 */ +static const uint8_t rv40_filter_clip_tbl[3][32] = { + { + 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, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 5, 5 + }, + { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 7, 8, 9 + } +}; +/** @} */ // end loopfilter group + +#endif /* AVCODEC_RV40DATA_H */ diff --git a/include/libavcodec/rv40vlc2.h b/include/libavcodec/rv40vlc2.h new file mode 100644 index 0000000..fec47ff --- /dev/null +++ b/include/libavcodec/rv40vlc2.h @@ -0,0 +1,619 @@ +/* + * RealVideo 4 decoder + * copyright (c) 2007 Konstantin Shishkov + * + * 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 + */ + +/** + * @file + * RV40 VLC tables used for macroblock information decoding + */ + +#ifndef AVCODEC_RV40VLC2_H +#define AVCODEC_RV40VLC2_H + +#include + +/** + * codes used for the first four block types + */ +//@{ +#define AIC_TOP_BITS 7 +#define AIC_TOP_SIZE 16 +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 }, +}; +//@} + +/** + * codes used for determining a pair of block types + */ +//@{ +#define AIC_MODE2_NUM 20 +#define AIC_MODE2_SIZE 81 +#define AIC_MODE2_BITS 9 + +static const uint8_t aic_mode2_vlc_syms[AIC_MODE2_NUM][AIC_MODE2_SIZE] = { + { + 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, + }, +}; + +static const uint8_t aic_mode2_vlc_bits[AIC_MODE2_NUM][AIC_MODE2_SIZE] = { + { + 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, + }, +}; +//@} + +/** + * Codes used for determining block type + */ +//@{ +#define AIC_MODE1_NUM 90 +#define AIC_MODE1_SIZE 9 +#define AIC_MODE1_BITS 7 + +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 */ +}; + +//@} + +#define PBTYPE_ESCAPE 0xFF + +/** tables used for P-frame macroblock type decoding */ +//@{ +#define NUM_PTYPE_VLCS 7 +#define PTYPE_VLC_SIZE 8 +#define PTYPE_VLC_BITS 7 + +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 block_num_to_ptype_vlc_num[12] = { + 0, 1, 2, 3, 0, 0, 2, 0, 4, 5, 0, 6 +}; +//@} + +/** tables used for P-frame macroblock type decoding */ +//@{ +#define NUM_BTYPE_VLCS 6 +#define BTYPE_VLC_SIZE 7 +#define BTYPE_VLC_BITS 6 + +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 } }, +}; + +static const uint8_t block_num_to_btype_vlc_num[12] = { + 0, 1, 0, 0, 2, 3, 0, 5, 0, 0, 4, 0 +}; +//@} +#endif /* AVCODEC_RV40VLC2_H */ diff --git a/include/libavcodec/sbc.h b/include/libavcodec/sbc.h new file mode 100644 index 0000000..0a54f1f --- /dev/null +++ b/include/libavcodec/sbc.h @@ -0,0 +1,120 @@ +/* + * Bluetooth low-complexity, subband codec (SBC) + * + * Copyright (C) 2017 Aurelien Jacobs + * Copyright (C) 2012-2014 Intel Corporation + * Copyright (C) 2008-2010 Nokia Corporation + * Copyright (C) 2004-2010 Marcel Holtmann + * Copyright (C) 2004-2005 Henryk Ploetz + * Copyright (C) 2005-2006 Brad Midgley + * + * 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 + */ + +/** + * @file + * SBC common definitions for the encoder and decoder + */ + +#ifndef AVCODEC_SBC_H +#define AVCODEC_SBC_H + +#include +#include +#include "libavutil/crc.h" +#include "libavutil/mem_internal.h" + +#define MSBC_BLOCKS 15 + +/* sampling frequency */ +#define SBC_FREQ_16000 0x00 +#define SBC_FREQ_32000 0x01 +#define SBC_FREQ_44100 0x02 +#define SBC_FREQ_48000 0x03 + +/* blocks */ +#define SBC_BLK_4 0x00 +#define SBC_BLK_8 0x01 +#define SBC_BLK_12 0x02 +#define SBC_BLK_16 0x03 + +/* channel mode */ +#define SBC_MODE_MONO 0x00 +#define SBC_MODE_DUAL_CHANNEL 0x01 +#define SBC_MODE_STEREO 0x02 +#define SBC_MODE_JOINT_STEREO 0x03 + +/* allocation method */ +#define SBC_AM_LOUDNESS 0x00 +#define SBC_AM_SNR 0x01 + +/* subbands */ +#define SBC_SB_4 0x00 +#define SBC_SB_8 0x01 + +/* synchronisation words */ +#define SBC_SYNCWORD 0x9C +#define MSBC_SYNCWORD 0xAD + +/* extra bits of precision for the synthesis filter input data */ +#define SBCDEC_FIXED_EXTRA_BITS 2 + +/* + * Enforce 16 byte alignment for the data, which is supposed to be used + * with SIMD optimized code. + */ +#define SBC_ALIGN 16 + +/* This structure contains an unpacked SBC frame. + Yes, there is probably quite some unused space herein */ +struct sbc_frame { + uint8_t frequency; + uint8_t blocks; + enum { + MONO = SBC_MODE_MONO, + DUAL_CHANNEL = SBC_MODE_DUAL_CHANNEL, + STEREO = SBC_MODE_STEREO, + JOINT_STEREO = SBC_MODE_JOINT_STEREO + } mode; + uint8_t channels; + enum { + LOUDNESS = SBC_AM_LOUDNESS, + SNR = SBC_AM_SNR + } allocation; + uint8_t subbands; + uint8_t bitpool; + uint16_t codesize; + + /* bit number x set means joint stereo has been used in subband x */ + uint8_t joint; + + /* only the lower 4 bits of every element are to be used */ + DECLARE_ALIGNED(SBC_ALIGN, uint32_t, scale_factor)[2][8]; + + /* raw integer subband samples in the frame */ + DECLARE_ALIGNED(SBC_ALIGN, int32_t, sb_sample_f)[16][2][8]; + + /* modified subband samples */ + DECLARE_ALIGNED(SBC_ALIGN, int32_t, sb_sample)[16][2][8]; + + const AVCRC *crc_ctx; +}; + +uint8_t ff_sbc_crc8(const AVCRC *crc_ctx, const uint8_t *data, size_t len); +void ff_sbc_calculate_bits(const struct sbc_frame *frame, int (*bits)[8]); + +#endif /* AVCODEC_SBC_H */ diff --git a/include/libavcodec/sbcdec_data.h b/include/libavcodec/sbcdec_data.h new file mode 100644 index 0000000..1b79d1d --- /dev/null +++ b/include/libavcodec/sbcdec_data.h @@ -0,0 +1,44 @@ +/* + * Bluetooth low-complexity, subband codec (SBC) + * + * Copyright (C) 2017 Aurelien Jacobs + * Copyright (C) 2008-2010 Nokia Corporation + * Copyright (C) 2004-2010 Marcel Holtmann + * Copyright (C) 2004-2005 Henryk Ploetz + * Copyright (C) 2005-2006 Brad Midgley + * + * 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 + */ + +/** + * @file + * SBC decoder tables + */ + +#ifndef AVCODEC_SBCDEC_DATA_H +#define AVCODEC_SBCDEC_DATA_H + +#include + +extern const int32_t ff_sbc_proto_4_40m0[]; +extern const int32_t ff_sbc_proto_4_40m1[]; +extern const int32_t ff_sbc_proto_8_80m0[]; +extern const int32_t ff_sbc_proto_8_80m1[]; +extern const int32_t ff_synmatrix4[8][4]; +extern const int32_t ff_synmatrix8[16][8]; + +#endif /* AVCODEC_SBCDEC_DATA_H */ diff --git a/include/libavcodec/sbcdsp.h b/include/libavcodec/sbcdsp.h new file mode 100644 index 0000000..24264df --- /dev/null +++ b/include/libavcodec/sbcdsp.h @@ -0,0 +1,88 @@ +/* + * Bluetooth low-complexity, subband codec (SBC) + * + * Copyright (C) 2017 Aurelien Jacobs + * Copyright (C) 2008-2010 Nokia Corporation + * Copyright (C) 2004-2010 Marcel Holtmann + * Copyright (C) 2004-2005 Henryk Ploetz + * Copyright (C) 2005-2006 Brad Midgley + * + * 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 + */ + +/** + * @file + * SBC basic "building bricks" + */ + +#ifndef AVCODEC_SBCDSP_H +#define AVCODEC_SBCDSP_H + +#include "libavutil/mem_internal.h" + +#include "sbc.h" +#include "sbcdsp_data.h" + +#define SCALE_OUT_BITS 15 +#define SBC_X_BUFFER_SIZE 328 + +typedef struct sbc_dsp_context SBCDSPContext; + +struct sbc_dsp_context { + int position; + /* Number of consecutive blocks handled by the encoder */ + uint8_t increment; + DECLARE_ALIGNED(SBC_ALIGN, int16_t, X)[2][SBC_X_BUFFER_SIZE]; + void (*sbc_analyze_4)(const int16_t *in, int32_t *out, const int16_t *consts); + void (*sbc_analyze_8)(const int16_t *in, int32_t *out, const int16_t *consts); + /* Polyphase analysis filter for 4 subbands configuration, + * it handles "increment" blocks at once */ + void (*sbc_analyze_4s)(SBCDSPContext *s, + int16_t *x, int32_t *out, int out_stride); + /* Polyphase analysis filter for 8 subbands configuration, + * it handles "increment" blocks at once */ + void (*sbc_analyze_8s)(SBCDSPContext *s, + int16_t *x, int32_t *out, int out_stride); + /* Process input data (deinterleave, endian conversion, reordering), + * depending on the number of subbands and input data byte order */ + int (*sbc_enc_process_input_4s)(int position, const uint8_t *pcm, + int16_t X[2][SBC_X_BUFFER_SIZE], + int nsamples, int nchannels); + int (*sbc_enc_process_input_8s)(int position, const uint8_t *pcm, + int16_t X[2][SBC_X_BUFFER_SIZE], + int nsamples, int nchannels); + /* Scale factors calculation */ + void (*sbc_calc_scalefactors)(int32_t sb_sample_f[16][2][8], + uint32_t scale_factor[2][8], + int blocks, int channels, int subbands); + /* Scale factors calculation with joint stereo support */ + int (*sbc_calc_scalefactors_j)(int32_t sb_sample_f[16][2][8], + uint32_t scale_factor[2][8], + int blocks, int subbands); +}; + +/* + * Initialize pointers to the functions which are the basic "building bricks" + * of SBC codec. Best implementation is selected based on target CPU + * capabilities. + */ +void ff_sbcdsp_init(SBCDSPContext *s); + +void ff_sbcdsp_init_arm(SBCDSPContext *s); +void ff_sbcdsp_init_x86(SBCDSPContext *s); + +#endif /* AVCODEC_SBCDSP_H */ diff --git a/include/libavcodec/sbcdsp_data.h b/include/libavcodec/sbcdsp_data.h new file mode 100644 index 0000000..10fad5c --- /dev/null +++ b/include/libavcodec/sbcdsp_data.h @@ -0,0 +1,55 @@ +/* + * Bluetooth low-complexity, subband codec (SBC) + * + * Copyright (C) 2017 Aurelien Jacobs + * Copyright (C) 2008-2010 Nokia Corporation + * Copyright (C) 2004-2010 Marcel Holtmann + * Copyright (C) 2004-2005 Henryk Ploetz + * Copyright (C) 2005-2006 Brad Midgley + * + * 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 + */ + +/** + * @file + * miscellaneous SBC tables + */ + +#ifndef AVCODEC_SBCDSP_DATA_H +#define AVCODEC_SBCDSP_DATA_H + +#include "sbc.h" + +#define SBC_PROTO_FIXED_SCALE 16 +#define SBC_COS_TABLE_FIXED_SCALE 15 + +/* + * Constant tables for the use in SIMD optimized analysis filters + * Each table consists of two parts: + * 1. reordered "proto" table + * 2. reordered "cos" table + * + * Due to non-symmetrical reordering, separate tables for "even" + * and "odd" cases are needed + */ + +extern const int16_t ff_sbcdsp_analysis_consts_fixed4_simd_even[]; +extern const int16_t ff_sbcdsp_analysis_consts_fixed4_simd_odd[]; +extern const int16_t ff_sbcdsp_analysis_consts_fixed8_simd_even[]; +extern const int16_t ff_sbcdsp_analysis_consts_fixed8_simd_odd[]; + +#endif /* AVCODEC_SBCDSP_DATA_H */ diff --git a/include/libavcodec/sbr.h b/include/libavcodec/sbr.h new file mode 100644 index 0000000..40bb30e --- /dev/null +++ b/include/libavcodec/sbr.h @@ -0,0 +1,226 @@ +/* + * Spectral Band Replication definitions and structures + * Copyright (c) 2008-2009 Robert Swain ( rob opendot cl ) + * Copyright (c) 2010 Alex Converse + * + * 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 + */ + +/** + * @file + * Spectral Band Replication definitions and structures + * @author Robert Swain ( rob opendot cl ) + */ + +#ifndef AVCODEC_SBR_H +#define AVCODEC_SBR_H + +#include + +#include "libavutil/mem_internal.h" +#include "libavutil/tx.h" + +#include "aacps.h" +#include "sbrdsp.h" + +/** + * Spectral Band Replication header - spectrum parameters that invoke a reset if they differ from the previous header. + */ +typedef struct SpectrumParameters { + uint8_t bs_start_freq; + uint8_t bs_stop_freq; + uint8_t bs_xover_band; + + /** + * @name Variables associated with bs_header_extra_1 + * @{ + */ + uint8_t bs_freq_scale; + uint8_t bs_alter_scale; + uint8_t bs_noise_bands; + /** @} */ +} SpectrumParameters; + +#define SBR_SYNTHESIS_BUF_SIZE ((1280-128)*2) + +/** + * Spectral Band Replication per channel data + */ +typedef struct SBRData { + /** + * @name Main bitstream data variables + * @{ + */ + unsigned bs_frame_class; + unsigned bs_add_harmonic_flag; + AAC_SIGNE bs_num_env; + uint8_t bs_freq_res[9]; + AAC_SIGNE bs_num_noise; + uint8_t bs_df_env[9]; + uint8_t bs_df_noise[2]; + uint8_t bs_invf_mode[2][5]; + uint8_t bs_add_harmonic[48]; + unsigned bs_amp_res; + /** @} */ + + /** + * @name State variables + * @{ + */ + DECLARE_ALIGNED(32, INTFLOAT, synthesis_filterbank_samples)[SBR_SYNTHESIS_BUF_SIZE]; + DECLARE_ALIGNED(32, INTFLOAT, analysis_filterbank_samples) [1312]; + int synthesis_filterbank_samples_offset; + ///l_APrev and l_A + int e_a[2]; + ///Chirp factors + INTFLOAT bw_array[5]; + ///QMF values of the original signal + INTFLOAT W[2][32][32][2]; + ///QMF output of the HF adjustor + int Ypos; + DECLARE_ALIGNED(16, INTFLOAT, Y)[2][38][64][2]; + DECLARE_ALIGNED(16, AAC_FLOAT, g_temp)[42][48]; + AAC_FLOAT q_temp[42][48]; + uint8_t s_indexmapped[9][48]; + ///Envelope scalefactors + uint8_t env_facs_q[9][48]; + AAC_FLOAT env_facs[9][48]; + ///Noise scalefactors + uint8_t noise_facs_q[3][5]; + AAC_FLOAT noise_facs[3][5]; + ///Envelope time borders + uint8_t t_env[9]; + ///Envelope time border of the last envelope of the previous frame + uint8_t t_env_num_env_old; + ///Noise time borders + uint8_t t_q[3]; + unsigned f_indexnoise; + unsigned f_indexsine; + //inter_tes (USAC) + uint8_t temp_shape[6]; + uint8_t temp_shape_mode[6]; + /** @} */ +} SBRData; + +typedef struct SpectralBandReplication SpectralBandReplication; + +/** + * aacsbr functions pointers + */ +typedef struct AACSBRContext { + int (*sbr_lf_gen)(SpectralBandReplication *sbr, + INTFLOAT X_low[32][40][2], const INTFLOAT W[2][32][32][2], + int buf_idx); + void (*sbr_hf_assemble)(INTFLOAT Y1[38][64][2], + const INTFLOAT X_high[64][40][2], + SpectralBandReplication *sbr, SBRData *ch_data, + const int e_a[2]); + int (*sbr_x_gen)(SpectralBandReplication *sbr, INTFLOAT X[2][38][64], + const INTFLOAT Y0[38][64][2], const INTFLOAT Y1[38][64][2], + const INTFLOAT X_low[32][40][2], int ch); + void (*sbr_hf_inverse_filter)(SBRDSPContext *dsp, + INTFLOAT (*alpha0)[2], INTFLOAT (*alpha1)[2], + const INTFLOAT X_low[32][40][2], int k0); +} AACSBRContext; + +/** + * Spectral Band Replication + */ +struct SpectralBandReplication { + int sample_rate; + int start; + int ready_for_dequant; + int id_aac; + int usac; + int inter_tes; // USAC-only + int reset; + SpectrumParameters spectrum_params; + int bs_amp_res_header; + int bs_sbr_preprocessing; // USAC-only + /** + * @name Variables associated with bs_header_extra_2 + * @{ + */ + unsigned bs_limiter_bands; + unsigned bs_limiter_gains; + unsigned bs_interpol_freq; + unsigned bs_smoothing_mode; + /** @} */ + unsigned bs_coupling; + AAC_SIGNE k[5]; ///< k0, k1, k2 + ///kx', and kx respectively, kx is the first QMF subband where SBR is used. + ///kx' is its value from the previous frame + AAC_SIGNE kx[2]; + ///M' and M respectively, M is the number of QMF subbands that use SBR. + AAC_SIGNE m[2]; + unsigned kx_and_m_pushed; + ///The number of frequency bands in f_master + AAC_SIGNE n_master; + SBRData data[2]; + PSContext ps; + ///N_Low and N_High respectively, the number of frequency bands for low and high resolution + AAC_SIGNE n[2]; + ///Number of noise floor bands + AAC_SIGNE n_q; + ///Number of limiter bands + AAC_SIGNE n_lim; + ///The master QMF frequency grouping + uint16_t f_master[49]; + ///Frequency borders for low resolution SBR + uint16_t f_tablelow[25]; + ///Frequency borders for high resolution SBR + uint16_t f_tablehigh[49]; + ///Frequency borders for noise floors + uint16_t f_tablenoise[6]; + ///Frequency borders for the limiter + uint16_t f_tablelim[30]; + AAC_SIGNE num_patches; + uint8_t patch_num_subbands[6]; + uint8_t patch_start_subband[6]; + ///QMF low frequency input to the HF generator + DECLARE_ALIGNED(16, INTFLOAT, X_low)[32][40][2]; + ///QMF output of the HF generator + DECLARE_ALIGNED(16, INTFLOAT, X_high)[64][40][2]; + ///QMF values of the reconstructed signal + DECLARE_ALIGNED(16, INTFLOAT, X)[2][2][38][64]; + ///Zeroth coefficient used to filter the subband signals + DECLARE_ALIGNED(16, INTFLOAT, alpha0)[64][2]; + ///First coefficient used to filter the subband signals + DECLARE_ALIGNED(16, INTFLOAT, alpha1)[64][2]; + ///Dequantized envelope scalefactors, remapped + AAC_FLOAT e_origmapped[8][48]; + ///Dequantized noise scalefactors, remapped + AAC_FLOAT q_mapped[8][48]; + ///Sinusoidal presence, remapped + uint8_t s_mapped[8][48]; + ///Estimated envelope + AAC_FLOAT e_curr[8][48]; + ///Amplitude adjusted noise scalefactors + AAC_FLOAT q_m[8][48]; + ///Sinusoidal levels + AAC_FLOAT s_m[8][48]; + AAC_FLOAT gain[8][48]; + DECLARE_ALIGNED(32, INTFLOAT, qmf_filter_scratch)[5][64]; + AVTXContext *mdct_ana; + av_tx_fn mdct_ana_fn; + AVTXContext *mdct; + av_tx_fn mdct_fn; + SBRDSPContext dsp; + AACSBRContext c; +}; + +#endif /* AVCODEC_SBR_H */ diff --git a/include/libavcodec/sbrdsp.h b/include/libavcodec/sbrdsp.h new file mode 100644 index 0000000..09b2cbf --- /dev/null +++ b/include/libavcodec/sbrdsp.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2012 Mans Rullgard + * + * 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_SBRDSP_H +#define AVCODEC_SBRDSP_H + +#include +#include "aac_defines.h" + +typedef struct SBRDSPContext { + void (*sum64x5)(INTFLOAT *z); + AAC_FLOAT (*sum_square)(INTFLOAT (*x)[2], int n); + void (*neg_odd_64)(INTFLOAT *x); + void (*qmf_pre_shuffle)(INTFLOAT *z); + void (*qmf_post_shuffle)(INTFLOAT W[32][2], const INTFLOAT *z); + void (*qmf_deint_neg)(INTFLOAT *v, const INTFLOAT *src); + void (*qmf_deint_bfly)(INTFLOAT *v, const INTFLOAT *src0, const INTFLOAT *src1); + void (*autocorrelate)(const INTFLOAT x[40][2], AAC_FLOAT phi[3][2][2]); + void (*hf_gen)(INTFLOAT (*X_high)[2], const INTFLOAT (*X_low)[2], + const INTFLOAT alpha0[2], const INTFLOAT alpha1[2], + INTFLOAT bw, int start, int end); + void (*hf_g_filt)(INTFLOAT (*Y)[2], const INTFLOAT (*X_high)[40][2], + const AAC_FLOAT *g_filt, int m_max, intptr_t ixh); + void (*hf_apply_noise[4])(INTFLOAT (*Y)[2], const AAC_FLOAT *s_m, + const AAC_FLOAT *q_filt, int noise, + int kx, int m_max); +} SBRDSPContext; + +extern const INTFLOAT AAC_RENAME(ff_sbr_noise_table)[][2]; + +void AAC_RENAME(ff_sbrdsp_init)(SBRDSPContext *s); +void ff_sbrdsp_init_arm(SBRDSPContext *s); +void ff_sbrdsp_init_aarch64(SBRDSPContext *s); +void ff_sbrdsp_init_riscv(SBRDSPContext *s); +void ff_sbrdsp_init_x86(SBRDSPContext *s); + +#endif /* AVCODEC_SBRDSP_H */ diff --git a/include/libavcodec/scpr.h b/include/libavcodec/scpr.h new file mode 100644 index 0000000..d161a42 --- /dev/null +++ b/include/libavcodec/scpr.h @@ -0,0 +1,360 @@ +/* + * ScreenPressor decoder + * + * Copyright (c) 2017 Paul B Mahol + * + * 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_SCPR_H +#define AVCODEC_SCPR_H + +#include "avcodec.h" +#include "bytestream.h" +#include "scpr3.h" + +typedef struct RangeCoder { + uint32_t code; + uint32_t range; + uint32_t code1; +} RangeCoder; + +typedef struct PixelModel { + uint32_t freq[256]; + uint32_t lookup[16]; + uint32_t total_freq; +} PixelModel; + +typedef struct SCPRContext { + int version; + AVFrame *last_frame; + AVFrame *current_frame; + GetByteContext gb; + RangeCoder rc; + PixelModel pixel_model[3][4096]; + uint32_t op_model[6][7]; + uint32_t run_model[6][257]; + uint32_t range_model[257]; + uint32_t count_model[257]; + uint32_t fill_model[6]; + uint32_t sxy_model[4][17]; + uint32_t mv_model[2][513]; + uint32_t nbx, nby; + uint32_t nbcount; + uint32_t *blocks; + uint32_t cbits; + int cxshift; + + PixelModel3 pixel_model3[3][4096]; + RunModel3 run_model3[6]; + RunModel3 range_model3; + RunModel3 count_model3; + FillModel3 fill_model3; + SxyModel3 sxy_model3[4]; + MVModel3 mv_model3[2]; + OpModel3 op_model3[6]; + + int (*get_freq)(RangeCoder *rc, uint32_t total_freq, uint32_t *freq); + int (*decode)(GetByteContext *gb, RangeCoder *rc, uint32_t cumFreq, uint32_t freq, uint32_t total_freq); +} SCPRContext; + +static int decode_run_i(AVCodecContext *avctx, uint32_t ptype, int run, + int *px, int *py, uint32_t clr, uint32_t *dst, + int linesize, uint32_t *plx, uint32_t *ply, + uint32_t backstep, int off, int *cx, int *cx1) +{ + uint32_t r, g, b; + int z; + int x = *px, + y = *py; + uint32_t lx = *plx, + ly = *ply; + + if (y >= avctx->height) + return AVERROR_INVALIDDATA; + + switch (ptype) { + case 0: + while (run-- > 0) { + dst[y * linesize + x] = clr; + lx = x; + ly = y; + (x)++; + if (x >= avctx->width) { + x = 0; + (y)++; + if (y >= avctx->height && run) + return AVERROR_INVALIDDATA; + } + } + break; + case 1: + while (run-- > 0) { + dst[y * linesize + x] = dst[ly * linesize + lx]; + lx = x; + ly = y; + (x)++; + if (x >= avctx->width) { + x = 0; + (y)++; + if (y >= avctx->height && run) + return AVERROR_INVALIDDATA; + } + } + clr = dst[ly * linesize + lx]; + break; + case 2: + if (y < 1) + return AVERROR_INVALIDDATA; + + while (run-- > 0) { + clr = dst[y * linesize + x + off + 1]; + dst[y * linesize + x] = clr; + lx = x; + ly = y; + (x)++; + if (x >= avctx->width) { + x = 0; + (y)++; + if (y >= avctx->height && run) + return AVERROR_INVALIDDATA; + } + } + break; + case 4: + if (y < 1 || (y == 1 && x == 0)) + return AVERROR_INVALIDDATA; + + while (run-- > 0) { + uint8_t *odst = (uint8_t *)dst; + int off1 = (ly * linesize + lx) * 4; + int off2 = ((y * linesize + x) + off) * 4; + + if (x == 0) { + z = backstep * 4; + } else { + z = 0; + } + + r = odst[off1] + + odst[off2 + 4] - + odst[off2 - z ]; + g = odst[off1 + 1] + + odst[off2 + 5] - + odst[off2 - z + 1]; + b = odst[off1 + 2] + + odst[off2 + 6] - + odst[off2 - z + 2]; + clr = ((b & 0xFF) << 16) + ((g & 0xFF) << 8) + (r & 0xFF); + dst[y * linesize + x] = clr; + lx = x; + ly = y; + (x)++; + if (x >= avctx->width) { + x = 0; + (y)++; + if (y >= avctx->height && run) + return AVERROR_INVALIDDATA; + } + } + break; + case 5: + if (y < 1 || (y == 1 && x == 0)) + return AVERROR_INVALIDDATA; + + while (run-- > 0) { + if (x == 0) { + z = backstep; + } else { + z = 0; + } + + clr = dst[y * linesize + x + off - z]; + dst[y * linesize + x] = clr; + lx = x; + ly = y; + (x)++; + if (x >= avctx->width) { + x = 0; + (y)++; + if (y >= avctx->height && run) + return AVERROR_INVALIDDATA; + } + } + break; + } + + *px = x; + *py = y; + *plx= lx; + *ply= ly; + + if (avctx->bits_per_coded_sample == 16) { + *cx1 = (clr & 0x3F00) >> 2; + *cx = (clr & 0x3FFFFF) >> 16; + } else { + *cx1 = (clr & 0xFC00) >> 4; + *cx = (clr & 0xFFFFFF) >> 18; + } + + return 0; +} + +static int decode_run_p(AVCodecContext *avctx, uint32_t ptype, int run, + int x, int y, uint32_t clr, + uint32_t *dst, uint32_t *prev, + int linesize, int plinesize, + uint32_t *bx, uint32_t *by, + uint32_t backstep, int sx1, int sx2, + int *cx, int *cx1) +{ + uint32_t r, g, b; + int z; + + switch (ptype) { + case 0: + while (run-- > 0) { + if (*by >= avctx->height) + return AVERROR_INVALIDDATA; + + dst[*by * linesize + *bx] = clr; + (*bx)++; + if (*bx >= x * 16 + sx2 || *bx >= avctx->width) { + *bx = x * 16 + sx1; + (*by)++; + } + } + break; + case 1: + while (run-- > 0) { + if (*bx == 0) { + if (*by < 1) + return AVERROR_INVALIDDATA; + z = backstep; + } else { + z = 0; + } + + if (*by >= avctx->height) + return AVERROR_INVALIDDATA; + + clr = dst[*by * linesize + *bx - 1 - z]; + dst[*by * linesize + *bx] = clr; + (*bx)++; + if (*bx >= x * 16 + sx2 || *bx >= avctx->width) { + *bx = x * 16 + sx1; + (*by)++; + } + } + break; + case 2: + while (run-- > 0) { + if (*by < 1 || *by >= avctx->height) + return AVERROR_INVALIDDATA; + + clr = dst[(*by - 1) * linesize + *bx]; + dst[*by * linesize + *bx] = clr; + (*bx)++; + if (*bx >= x * 16 + sx2 || *bx >= avctx->width) { + *bx = x * 16 + sx1; + (*by)++; + } + } + break; + case 3: + while (run-- > 0) { + if (*by >= avctx->height) + return AVERROR_INVALIDDATA; + + clr = prev[*by * plinesize + *bx]; + dst[*by * linesize + *bx] = clr; + (*bx)++; + if (*bx >= x * 16 + sx2 || *bx >= avctx->width) { + *bx = x * 16 + sx1; + (*by)++; + } + } + break; + case 4: + while (run-- > 0) { + uint8_t *odst = (uint8_t *)dst; + + if (*by < 1 || *by >= avctx->height) + return AVERROR_INVALIDDATA; + + if (*bx == 0) { + if (*by < 2) + return AVERROR_INVALIDDATA; + z = backstep; + } else { + z = 0; + } + + r = odst[((*by - 1) * linesize + *bx) * 4] + + odst[(*by * linesize + *bx - 1 - z) * 4] - + odst[((*by - 1) * linesize + *bx - 1 - z) * 4]; + g = odst[((*by - 1) * linesize + *bx) * 4 + 1] + + odst[(*by * linesize + *bx - 1 - z) * 4 + 1] - + odst[((*by - 1) * linesize + *bx - 1 - z) * 4 + 1]; + b = odst[((*by - 1) * linesize + *bx) * 4 + 2] + + odst[(*by * linesize + *bx - 1 - z) * 4 + 2] - + odst[((*by - 1) * linesize + *bx - 1 - z) * 4 + 2]; + clr = ((b & 0xFF) << 16) + ((g & 0xFF) << 8) + (r & 0xFF); + dst[*by * linesize + *bx] = clr; + (*bx)++; + if (*bx >= x * 16 + sx2 || *bx >= avctx->width) { + *bx = x * 16 + sx1; + (*by)++; + } + } + break; + case 5: + while (run-- > 0) { + if (*by < 1 || *by >= avctx->height) + return AVERROR_INVALIDDATA; + + if (*bx == 0) { + if (*by < 2) + return AVERROR_INVALIDDATA; + z = backstep; + } else { + z = 0; + } + + clr = dst[(*by - 1) * linesize + *bx - 1 - z]; + dst[*by * linesize + *bx] = clr; + (*bx)++; + if (*bx >= x * 16 + sx2 || *bx >= avctx->width) { + *bx = x * 16 + sx1; + (*by)++; + } + } + break; + } + + if (avctx->bits_per_coded_sample == 16) { + *cx1 = (clr & 0x3F00) >> 2; + *cx = (clr & 0x3FFFFF) >> 16; + } else { + *cx1 = (clr & 0xFC00) >> 4; + *cx = (clr & 0xFFFFFF) >> 18; + } + + return 0; +} + +#endif /* AVCODEC_SCPR_H */ diff --git a/include/libavcodec/scpr3.h b/include/libavcodec/scpr3.h new file mode 100644 index 0000000..8988300 --- /dev/null +++ b/include/libavcodec/scpr3.h @@ -0,0 +1,77 @@ +/* + * ScreenPressor version 3 decoder + * + * Copyright (c) 2017 Paul B Mahol + * + * 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_SCPR3_H +#define AVCODEC_SCPR3_H + +#include + +typedef struct PixelModel3 { + uint8_t type; + uint8_t length; + uint8_t maxpos; + uint8_t fshift; + uint16_t size; + uint32_t cntsum; + uint8_t symbols[256]; + uint16_t freqs[256]; + uint16_t freqs1[256]; + uint16_t cnts[256]; + uint8_t dectab[32]; +} PixelModel3; + +typedef struct FillModel3 { + uint32_t cntsum; + uint16_t freqs[2][5]; + uint16_t cnts[5]; + uint8_t dectab[32]; +} FillModel3; + +typedef struct OpModel3 { + uint32_t cntsum; + uint16_t freqs[2][6]; + uint16_t cnts[6]; + uint8_t dectab[32]; +} OpModel3; + +typedef struct RunModel3 { + uint32_t cntsum; + uint16_t freqs[2][256]; + uint16_t cnts[256]; + uint8_t dectab[32]; +} RunModel3; + +typedef struct SxyModel3 { + uint32_t cntsum; + uint16_t freqs[2][16]; + uint16_t cnts[16]; + uint8_t dectab[32]; +} SxyModel3; + +typedef struct MVModel3 { + uint32_t cntsum; + uint16_t freqs[2][512]; + uint16_t cnts[512]; + uint8_t dectab[32]; +} MVModel3; + +#endif /* AVCODEC_SCPR3_H */ diff --git a/include/libavcodec/sei.h b/include/libavcodec/sei.h new file mode 100644 index 0000000..f96b7b6 --- /dev/null +++ b/include/libavcodec/sei.h @@ -0,0 +1,157 @@ +/* + * 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_SEI_H +#define AVCODEC_SEI_H + +// SEI payload types form a common namespace between the H.264, H.265 +// and H.266 standards. A given payload type always has the same +// meaning, but some names have different payload types in different +// standards (e.g. scalable-nesting is 30 in H.264 but 133 in H.265). +// The content of the payload data depends on the standard, though +// many generic parts have the same interpretation everywhere (such as +// mastering-display-colour-volume and user-data-unregistered). +enum SEIType { + SEI_TYPE_BUFFERING_PERIOD = 0, + SEI_TYPE_PIC_TIMING = 1, + SEI_TYPE_PAN_SCAN_RECT = 2, + SEI_TYPE_FILLER_PAYLOAD = 3, + SEI_TYPE_USER_DATA_REGISTERED_ITU_T_T35 = 4, + SEI_TYPE_USER_DATA_UNREGISTERED = 5, + SEI_TYPE_RECOVERY_POINT = 6, + SEI_TYPE_DEC_REF_PIC_MARKING_REPETITION = 7, + SEI_TYPE_SPARE_PIC = 8, + SEI_TYPE_SCENE_INFO = 9, + SEI_TYPE_SUB_SEQ_INFO = 10, + SEI_TYPE_SUB_SEQ_LAYER_CHARACTERISTICS = 11, + SEI_TYPE_SUB_SEQ_CHARACTERISTICS = 12, + SEI_TYPE_FULL_FRAME_FREEZE = 13, + SEI_TYPE_FULL_FRAME_FREEZE_RELEASE = 14, + SEI_TYPE_FULL_FRAME_SNAPSHOT = 15, + SEI_TYPE_PROGRESSIVE_REFINEMENT_SEGMENT_START = 16, + SEI_TYPE_PROGRESSIVE_REFINEMENT_SEGMENT_END = 17, + SEI_TYPE_MOTION_CONSTRAINED_SLICE_GROUP_SET = 18, + SEI_TYPE_FILM_GRAIN_CHARACTERISTICS = 19, + SEI_TYPE_DEBLOCKING_FILTER_DISPLAY_PREFERENCE = 20, + SEI_TYPE_STEREO_VIDEO_INFO = 21, + SEI_TYPE_POST_FILTER_HINT = 22, + SEI_TYPE_TONE_MAPPING_INFO = 23, + SEI_TYPE_SCALABILITY_INFO = 24, + SEI_TYPE_SUB_PIC_SCALABLE_LAYER = 25, + SEI_TYPE_NON_REQUIRED_LAYER_REP = 26, + SEI_TYPE_PRIORITY_LAYER_INFO = 27, + SEI_TYPE_LAYERS_NOT_PRESENT_4 = 28, + SEI_TYPE_LAYER_DEPENDENCY_CHANGE = 29, + SEI_TYPE_SCALABLE_NESTING_4 = 30, + SEI_TYPE_BASE_LAYER_TEMPORAL_HRD = 31, + SEI_TYPE_QUALITY_LAYER_INTEGRITY_CHECK = 32, + SEI_TYPE_REDUNDANT_PIC_PROPERTY = 33, + SEI_TYPE_TL0_DEP_REP_INDEX = 34, + SEI_TYPE_TL_SWITCHING_POINT = 35, + SEI_TYPE_PARALLEL_DECODING_INFO = 36, + SEI_TYPE_MVC_SCALABLE_NESTING = 37, + SEI_TYPE_VIEW_SCALABILITY_INFO = 38, + SEI_TYPE_MULTIVIEW_SCENE_INFO_4 = 39, + SEI_TYPE_MULTIVIEW_ACQUISITION_INFO_4 = 40, + SEI_TYPE_NON_REQUIRED_VIEW_COMPONENT = 41, + SEI_TYPE_VIEW_DEPENDENCY_CHANGE = 42, + SEI_TYPE_OPERATION_POINTS_NOT_PRESENT = 43, + SEI_TYPE_BASE_VIEW_TEMPORAL_HRD = 44, + SEI_TYPE_FRAME_PACKING_ARRANGEMENT = 45, + SEI_TYPE_MULTIVIEW_VIEW_POSITION_4 = 46, + SEI_TYPE_DISPLAY_ORIENTATION = 47, + SEI_TYPE_MVCD_SCALABLE_NESTING = 48, + SEI_TYPE_MVCD_VIEW_SCALABILITY_INFO = 49, + SEI_TYPE_DEPTH_REPRESENTATION_INFO_4 = 50, + SEI_TYPE_THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO_4 = 51, + SEI_TYPE_DEPTH_TIMING = 52, + SEI_TYPE_DEPTH_SAMPLING_INFO = 53, + SEI_TYPE_CONSTRAINED_DEPTH_PARAMETER_SET_IDENTIFIER = 54, + SEI_TYPE_GREEN_METADATA = 56, + SEI_TYPE_STRUCTURE_OF_PICTURES_INFO = 128, + SEI_TYPE_ACTIVE_PARAMETER_SETS = 129, + SEI_TYPE_PARAMETER_SETS_INCLUSION_INDICATION = SEI_TYPE_ACTIVE_PARAMETER_SETS, + SEI_TYPE_DECODING_UNIT_INFO = 130, + SEI_TYPE_TEMPORAL_SUB_LAYER_ZERO_IDX = 131, + SEI_TYPE_DECODED_PICTURE_HASH = 132, + SEI_TYPE_SCALABLE_NESTING_5 = 133, + SEI_TYPE_REGION_REFRESH_INFO = 134, + SEI_TYPE_NO_DISPLAY = 135, + SEI_TYPE_TIME_CODE = 136, + SEI_TYPE_MASTERING_DISPLAY_COLOUR_VOLUME = 137, + SEI_TYPE_SEGMENTED_RECT_FRAME_PACKING_ARRANGEMENT = 138, + SEI_TYPE_TEMPORAL_MOTION_CONSTRAINED_TILE_SETS = 139, + SEI_TYPE_CHROMA_RESAMPLING_FILTER_HINT = 140, + SEI_TYPE_KNEE_FUNCTION_INFO = 141, + SEI_TYPE_COLOUR_REMAPPING_INFO = 142, + SEI_TYPE_DEINTERLACED_FIELD_IDENTIFICATION = 143, + SEI_TYPE_CONTENT_LIGHT_LEVEL_INFO = 144, + SEI_TYPE_DEPENDENT_RAP_INDICATION = 145, + SEI_TYPE_CODED_REGION_COMPLETION = 146, + SEI_TYPE_ALTERNATIVE_TRANSFER_CHARACTERISTICS = 147, + SEI_TYPE_AMBIENT_VIEWING_ENVIRONMENT = 148, + SEI_TYPE_CONTENT_COLOUR_VOLUME = 149, + SEI_TYPE_EQUIRECTANGULAR_PROJECTION = 150, + SEI_TYPE_CUBEMAP_PROJECTION = 151, + SEI_TYPE_FISHEYE_VIDEO_INFO = 152, + SEI_TYPE_SPHERE_ROTATION = 154, + SEI_TYPE_REGIONWISE_PACKING = 155, + SEI_TYPE_OMNI_VIEWPORT = 156, + SEI_TYPE_REGIONAL_NESTING = 157, + SEI_TYPE_MCTS_EXTRACTION_INFO_SETS = 158, + SEI_TYPE_MCTS_EXTRACTION_INFO_NESTING = 159, + SEI_TYPE_LAYERS_NOT_PRESENT_5 = 160, + SEI_TYPE_INTER_LAYER_CONSTRAINED_TILE_SETS = 161, + SEI_TYPE_BSP_NESTING = 162, + SEI_TYPE_BSP_INITIAL_ARRIVAL_TIME = 163, + SEI_TYPE_SUB_BITSTREAM_PROPERTY = 164, + SEI_TYPE_ALPHA_CHANNEL_INFO = 165, + SEI_TYPE_OVERLAY_INFO = 166, + SEI_TYPE_TEMPORAL_MV_PREDICTION_CONSTRAINTS = 167, + SEI_TYPE_FRAME_FIELD_INFO = 168, + SEI_TYPE_THREE_DIMENSIONAL_REFERENCE_DISPLAYS_INFO = 176, + SEI_TYPE_DEPTH_REPRESENTATION_INFO_5 = 177, + SEI_TYPE_MULTIVIEW_SCENE_INFO_5 = 178, + SEI_TYPE_MULTIVIEW_ACQUISITION_INFO_5 = 179, + SEI_TYPE_MULTIVIEW_VIEW_POSITION_5 = 180, + SEI_TYPE_ALTERNATIVE_DEPTH_INFO = 181, + SEI_TYPE_SEI_MANIFEST = 200, + SEI_TYPE_SEI_PREFIX_INDICATION = 201, + SEI_TYPE_ANNOTATED_REGIONS = 202, + SEI_TYPE_SUBPIC_LEVEL_INFO = 203, + SEI_TYPE_SAMPLE_ASPECT_RATIO_INFO = 204, +}; + +/** + * frame_packing_arrangement types. H.265 and H.274 use only 3..5 + * with all the other values being reserved. H.264 uses a few more values + * that are prefixed with SEI_FPA_H264 in the enum below. + * + * The semantics of the common values are the same for all standards. + */ +typedef enum { + SEI_FPA_H264_TYPE_CHECKERBOARD = 0, + SEI_FPA_H264_TYPE_INTERLEAVE_COLUMN = 1, + SEI_FPA_H264_TYPE_INTERLEAVE_ROW = 2, + SEI_FPA_TYPE_SIDE_BY_SIDE = 3, + SEI_FPA_TYPE_TOP_BOTTOM = 4, + SEI_FPA_TYPE_INTERLEAVE_TEMPORAL = 5, + SEI_FPA_H264_TYPE_2D = 6, +} SEIFpaType; + +#endif /* AVCODEC_SEI_H */ diff --git a/include/libavcodec/sgi.h b/include/libavcodec/sgi.h new file mode 100644 index 0000000..5ec891e --- /dev/null +++ b/include/libavcodec/sgi.h @@ -0,0 +1,36 @@ +/* + * SGI image encoder + * Xiaohui Sun + * + * 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_SGI_H +#define AVCODEC_SGI_H + +/** + * SGI image file signature + */ +#define SGI_MAGIC 474 + +#define SGI_HEADER_SIZE 512 + +#define SGI_GRAYSCALE 1 +#define SGI_RGB 3 +#define SGI_RGBA 4 + +#endif /* AVCODEC_SGI_H */ diff --git a/include/libavcodec/sheervideodata.h b/include/libavcodec/sheervideodata.h new file mode 100644 index 0000000..fbce3a4 --- /dev/null +++ b/include/libavcodec/sheervideodata.h @@ -0,0 +1,175 @@ +/* + * BitJazz SheerVideo decoder + * Copyright (c) 2016 Paul B Mahol + * + * 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_SHEERVIDEODATA_H +#define AVCODEC_SHEERVIDEODATA_H + +#include "libavutil/common.h" + +typedef struct SheerTable { + uint8_t lens[2 * 15]; + uint16_t nb_16s; +} SheerTable; + +static const SheerTable rgb[2] = { + { + { 0, 0, 2, 2, 3, 3, 5, 5, 8, 8, 10, 9, 14, 15, 18, + 17, 16, 13, 10, 10, 8, 7, 6, 5, 3, 2, 3, 0, 0, 0 }, 54 + }, + { + { 0, 2, 0, 2, 0, 1, 1, 0, 2, 1, 3, 3, 4, 7, 13, + 11, 8, 4, 3, 3, 1, 2, 1, 0, 1, 0, 1, 2, 0, 0 }, 180 + } +}; + +static const SheerTable rgbi[2] = { + { + { 0, 0, 1, 3, 3, 3, 6, 8, 8, 11, 12, 15, 18, 21, 38, + 0, 22, 19, 15, 12, 11, 7, 8, 6, 4, 2, 3, 0, 0, 0 }, 0 + }, + { + { 1, 0, 1, 1, 1, 1, 2, 1, 2, 4, 3, 5, 5, 6, 12, + 14, 6, 6, 5, 3, 3, 3, 2, 1, 1, 2, 0, 1, 0, 0 }, 164 + } +}; + +static const SheerTable ybr[2] = { + { + { 0, 0, 2, 2, 2, 3, 5, 5, 7, 7, 8, 9, 13, 13, 19, + 16, 14, 12, 9, 9, 7, 6, 6, 4, 4, 1, 2, 1, 0, 0 }, 70 + }, + { + { 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 2, 2, 3, 5, 5, + 5, 5, 3, 2, 2, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0 }, 212 + } +}; + +static const SheerTable ybyr[2] = { + { + { 0, 0, 2, 2, 3, 3, 5, 5, 8, 8, 10, 10, 13, 15, 19, + 18, 15, 12, 10, 10, 8, 7, 6, 5, 3, 2, 3, 0, 0, 0 }, 54 + }, + { + { 1, 1, 0, 1, 0, 1, 0, 1, 1, 2, 2, 3, 2, 5, 5, + 5, 4, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 1, 0, 0 }, 208 + } +}; + +static const SheerTable byry[2] = { + { + { 0, 0, 2, 2, 2, 3, 5, 5, 7, 7, 8, 11, 10, 14, 19, + 14, 16, 12, 10, 8, 7, 6, 6, 4, 4, 1, 2, 1, 0, 0 }, 70 + }, + { + { 1, 1, 0, 1, 0, 1, 0, 1, 2, 1, 2, 2, 3, 4, 6, + 6, 4, 2, 3, 2, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0 }, 208 + } +}; + +static const SheerTable ybr10i[2] = { + { + { 0, 0, 1, 0, 3, 8, 9, 12, 19, 27, 27, 39, 50, 63, 93, + 89, 64, 50, 38, 26, 26, 20, 12, 9, 8, 3, 0, 0, 0, 0 }, 328 + }, + { + { 0, 1, 1, 2, 2, 1, 2, 2, 4, 4, 6, 7, 9, 13, 28, + 28, 12, 11, 6, 7, 5, 3, 3, 1, 1, 2, 2, 1, 0, 0 }, 860 + } +}; + +static const SheerTable ybr10[2] = { + { + { 0, 0, 0, 1, 6, 6, 8, 12, 18, 21, 27, 29, 36, 47, 71, + 72, 46, 36, 29, 27, 21, 17, 13, 7, 7, 5, 0, 0, 0, 0 }, 462 + }, + { + { 0, 1, 2, 1, 2, 1, 1, 1, 2, 3, 2, 5, 6, 10, 20, + 20, 10, 6, 4, 3, 2, 2, 2, 1, 1, 1, 2, 1, 0, 0 }, 912 + } +}; + +static const SheerTable rgbx[2] = { + { + { 0, 0, 0, 1, 3, 9, 10, 13, 19, 26, 28, 35, 40, 53, 77, + 77, 50, 42, 34, 28, 25, 19, 13, 10, 8, 4, 0, 0, 0, 0 }, 400 + }, + { + { 0, 0, 1, 2, 6, 4, 3, 2, 3, 4, 6, 8, 10, 18, 39, + 39, 18, 11, 8, 6, 4, 4, 1, 3, 5, 4, 3, 0, 0, 0 }, 812 + } +}; + +static const SheerTable yry10[2] = { + { + { 0, 0, 0, 1, 6, 6, 8, 12, 18, 21, 27, 29, 36, 47, 71, + 72, 46, 36, 29, 27, 21, 17, 13, 7, 7, 5, 0, 0, 0, 0 }, 462 + }, + { + { 0, 1, 2, 1, 1, 1, 2, 3, 2, 4, 5, 5, 8, 14, 16, + 18, 11, 7, 7, 4, 4, 3, 2, 2, 1, 1, 2, 1, 0, 0 }, 896 + } +}; + +static const SheerTable yry10i[2] = { + { + { 0, 0, 1, 0, 3, 8, 9, 12, 19, 27, 27, 40, 48, 64, 93, + 89, 65, 49, 38, 26, 26, 20, 12, 9, 8, 3, 0, 0, 0, 0 }, 328 + }, + { + { 0, 1, 0, 3, 1, 3, 3, 3, 6, 7, 7, 12, 11, 19, 23, + 20, 18, 12, 12, 8, 6, 5, 4, 3, 2, 2, 2, 1, 0, 0 }, 830 + } +}; + +static const SheerTable ybri[2] = { + { + { 0, 0, 2, 2, 2, 3, 5, 5, 7, 10, 11, 13, 15, 13, 26, + 20, 16, 17, 12, 11, 9, 7, 5, 5, 3, 3, 1, 1, 0, 0 }, 32 + }, + { + { 1, 0, 1, 0, 1, 1, 0, 2, 1, 2, 2, 2, 3, 6, 6, + 5, 6, 3, 2, 2, 2, 1, 2, 0, 1, 1, 0, 0, 1, 0 }, 202 + } +}; + +static const SheerTable byryi[2] = { + { + { 0, 0, 2, 2, 2, 2, 6, 5, 8, 8, 12, 12, 16, 14, 24, + 20, 16, 18, 12, 12, 8, 7, 5, 6, 3, 1, 2, 1, 0, 0 }, 32 + }, + { + { 1, 0, 1, 1, 0, 2, 1, 2, 2, 3, 3, 4, 5, 4, 6, + 7, 5, 4, 4, 3, 3, 2, 2, 2, 0, 1, 1, 1, 0, 0 }, 186 + } +}; + +static const SheerTable rgbxi[2] = { + { + { 0, 0, 1, 3, 2, 3, 4, 6, 16, 23, 27, 29, 24, 29, 76, + 78, 29, 21, 29, 27, 23, 15, 7, 4, 3, 2, 3, 0, 0, 0 }, 540 + }, + { + { 0, 1, 1, 2, 0, 2, 6, 4, 3, 9, 7, 12, 13, 16, 29, + 32, 17, 14, 12, 7, 8, 4, 4, 6, 2, 0, 2, 1, 0, 0 }, 810 + } +}; + +#endif /* AVCODEC_SHEERVIDEODATA_H */ diff --git a/include/libavcodec/simple_idct.h b/include/libavcodec/simple_idct.h new file mode 100644 index 0000000..20578b3 --- /dev/null +++ b/include/libavcodec/simple_idct.h @@ -0,0 +1,64 @@ +/* + * Simple IDCT + * + * Copyright (c) 2001 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * simple idct header. + */ + +#ifndef AVCODEC_SIMPLE_IDCT_H +#define AVCODEC_SIMPLE_IDCT_H + +#include +#include + +void ff_simple_idct_put_int16_8bit(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_simple_idct_add_int16_8bit(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_simple_idct_int16_8bit(int16_t *block); + +void ff_simple_idct_put_int16_10bit(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_simple_idct_add_int16_10bit(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_simple_idct_int16_10bit(int16_t *block); + +void ff_simple_idct_put_int32_10bit(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_simple_idct_add_int32_10bit(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_simple_idct_int32_10bit(int16_t *block); + +void ff_simple_idct_put_int16_12bit(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_simple_idct_add_int16_12bit(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_simple_idct_int16_12bit(int16_t *block); + +/** + * Special version of ff_simple_idct_int16_10bit() which does dequantization + * and scales by a factor of 2 more between the two IDCTs to account + * for larger scale of input coefficients. + */ +void ff_prores_idct_10(int16_t *block, const int16_t *qmat); +void ff_prores_idct_12(int16_t *block, const int16_t *qmat); + +void ff_simple_idct248_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block); + +void ff_simple_idct84_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_simple_idct48_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block); +void ff_simple_idct44_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block); + +#endif /* AVCODEC_SIMPLE_IDCT_H */ diff --git a/include/libavcodec/sinewin.h b/include/libavcodec/sinewin.h new file mode 100644 index 0000000..fc4e69a --- /dev/null +++ b/include/libavcodec/sinewin.h @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2008 Robert Swain + * + * 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_SINEWIN_H +#define AVCODEC_SINEWIN_H + +#include "config.h" +#include "libavutil/mem_internal.h" + +#if CONFIG_HARDCODED_TABLES +# define SINETABLE_CONST const +#else +# define SINETABLE_CONST +#endif + +#define SINETABLE(size) \ + SINETABLE_CONST DECLARE_ALIGNED(32, float, ff_sine_##size)[size] + +/** + * Generate a sine window. + * @param window pointer to half window + * @param n size of half window + */ +void ff_sine_window_init(float *window, int n); + +/** + * initialize the specified entry of ff_sine_windows + */ +void ff_init_ff_sine_windows(int index); + +extern SINETABLE( 32); +extern SINETABLE( 64); +extern SINETABLE( 128); +extern SINETABLE( 256); +extern SINETABLE( 512); +extern SINETABLE(1024); +extern SINETABLE(2048); +extern SINETABLE(4096); +extern SINETABLE(8192); + +extern SINETABLE_CONST float *const ff_sine_windows[]; + +#endif /* AVCODEC_SINEWIN_H */ diff --git a/include/libavcodec/sinewin_fixed_tablegen.h b/include/libavcodec/sinewin_fixed_tablegen.h new file mode 100644 index 0000000..660c005 --- /dev/null +++ b/include/libavcodec/sinewin_fixed_tablegen.h @@ -0,0 +1,77 @@ +/* + * Header file for hardcoded sine windows + * + * Copyright (c) 2009 Reimar Döffinger + * + * 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_SINEWIN_FIXED_TABLEGEN_H +#define AVCODEC_SINEWIN_FIXED_TABLEGEN_H + +#ifdef BUILD_TABLES +#undef DECLARE_ALIGNED +#define DECLARE_ALIGNED(align, type, name) type name +#else +#include "libavutil/mem_internal.h" +#endif + +#define SINETABLE(size) \ + static SINETABLE_CONST DECLARE_ALIGNED(32, int, sine_##size##_fixed)[size] + +#if CONFIG_HARDCODED_TABLES +#define init_sine_windows_fixed() +#define SINETABLE_CONST const +#include "libavcodec/sinewin_fixed_tables.h" +#else +// do not use libavutil/libm.h since this is compiled both +// for the host and the target and config.h is only valid for the target +#include +#include "libavutil/attributes.h" + +#define SINETABLE_CONST +SINETABLE( 96); +SINETABLE( 120); +SINETABLE( 128); +SINETABLE( 480); +SINETABLE( 512); +SINETABLE( 768); +SINETABLE( 960); +SINETABLE(1024); + +#define SIN_FIX(a) (int)floor((a) * 0x80000000 + 0.5) + +// Generate a sine window. +static av_cold void sine_window_init_fixed(int *window, int n) +{ + for (int i = 0; i < n; i++) + window[i] = SIN_FIX(sinf((i + 0.5) * (M_PI / (2.0 * n)))); +} + +static av_cold void init_sine_windows_fixed(void) +{ + sine_window_init_fixed(sine_96_fixed, 96); + sine_window_init_fixed(sine_120_fixed, 120); + sine_window_init_fixed(sine_128_fixed, 128); + sine_window_init_fixed(sine_480_fixed, 480); + sine_window_init_fixed(sine_512_fixed, 512); + sine_window_init_fixed(sine_768_fixed, 768); + sine_window_init_fixed(sine_960_fixed, 960); + sine_window_init_fixed(sine_1024_fixed, 1024); +} +#endif /* CONFIG_HARDCODED_TABLES */ +#endif /* AVCODEC_SINEWIN_FIXED_TABLEGEN_H */ diff --git a/include/libavcodec/sinewin_tablegen.h b/include/libavcodec/sinewin_tablegen.h new file mode 100644 index 0000000..6887d59 --- /dev/null +++ b/include/libavcodec/sinewin_tablegen.h @@ -0,0 +1,113 @@ +/* + * Header file for hardcoded sine windows + * + * Copyright (c) 2009 Reimar Döffinger + * + * 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_SINEWIN_TABLEGEN_H +#define AVCODEC_SINEWIN_TABLEGEN_H + +#include +// do not use libavutil/libm.h since this is compiled both +// for the host and the target and config.h is only valid for the target +#include +#include "libavutil/attributes.h" +#include "libavutil/common.h" + +#if !CONFIG_HARDCODED_TABLES +#ifndef BUILD_TABLES +#include "libavutil/thread.h" +#endif + +SINETABLE( 32); +SINETABLE( 64); +SINETABLE( 128); +SINETABLE( 256); +SINETABLE( 512); +SINETABLE(1024); +SINETABLE(2048); +SINETABLE(4096); +SINETABLE(8192); +#else +#include "libavcodec/sinewin_tables.h" +#endif + +SINETABLE_CONST float *const ff_sine_windows[] = { + NULL, NULL, NULL, NULL, NULL, // unused + ff_sine_32, ff_sine_64, ff_sine_128, + ff_sine_256, ff_sine_512, ff_sine_1024, + ff_sine_2048, ff_sine_4096, ff_sine_8192, +}; + +// Generate a sine window. +av_cold void ff_sine_window_init(float *window, int n) +{ + int i; + for(i = 0; i < n; i++) + window[i] = 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) \ +{ \ + ff_sine_window_init(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 ff_init_ff_sine_windows(int index) +{ + assert(index >= 5 && index < FF_ARRAY_ELEMS(ff_sine_windows)); +#if !CONFIG_HARDCODED_TABLES +#ifdef BUILD_TABLES + ff_sine_window_init(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 +} + +#endif /* AVCODEC_SINEWIN_TABLEGEN_H */ diff --git a/include/libavcodec/sipr.h b/include/libavcodec/sipr.h new file mode 100644 index 0000000..e707398 --- /dev/null +++ b/include/libavcodec/sipr.h @@ -0,0 +1,106 @@ +/* + * SIPR / ACELP.NET decoder + * + * Copyright (c) 2008 Vladimir Voroshilov + * Copyright (c) 2009 Vitor Sessak + * + * 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_SIPR_H +#define AVCODEC_SIPR_H + +#include "acelp_pitch_delay.h" +#include "libavutil/mem_internal.h" + +#define LP_FILTER_ORDER_16k 16 +#define L_SUBFR_16k 80 +#define PITCH_MIN 30 +#define PITCH_MAX 281 + +#define LSFQ_DIFF_MIN (0.0125 * M_PI) + +#define LP_FILTER_ORDER 10 + +/** Number of past samples needed for excitation interpolation */ +#define L_INTERPOL (LP_FILTER_ORDER + 1) + +/** Subframe size for all modes except 16k */ +#define SUBFR_SIZE 48 + +#define SUBFRAME_COUNT_16k 2 + +typedef enum { + MODE_16k, + MODE_8k5, + MODE_6k5, + MODE_5k0, + MODE_COUNT +} SiprMode; + +typedef struct SiprParameters { + int ma_pred_switch; ///< switched moving average predictor + int vq_indexes[5]; + int pitch_delay[5]; ///< pitch delay + int gp_index[5]; ///< adaptive-codebook gain indexes + int16_t fc_indexes[5][10]; ///< fixed-codebook indexes + int gc_index[5]; ///< fixed-codebook gain indexes +} SiprParameters; + +typedef struct SiprContext { + SiprMode mode; + + float past_pitch_gain; + float lsf_history[LP_FILTER_ORDER_16k]; + + float excitation[L_INTERPOL + PITCH_MAX + 2 * L_SUBFR_16k]; + + DECLARE_ALIGNED(16, float, synth_buf)[LP_FILTER_ORDER + 5*SUBFR_SIZE + 6]; + + float lsp_history[LP_FILTER_ORDER]; + float gain_mem; + float energy_history[4]; + float highpass_filt_mem[2]; + float postfilter_mem[PITCH_DELAY_MAX + LP_FILTER_ORDER]; + + /* 5k0 */ + float tilt_mem; + float postfilter_agc; + float postfilter_mem5k0[PITCH_DELAY_MAX + LP_FILTER_ORDER]; + float postfilter_syn5k0[LP_FILTER_ORDER + SUBFR_SIZE*5]; + + /* 16k */ + int pitch_lag_prev; + float iir_mem[LP_FILTER_ORDER_16k+1]; + float filt_buf[2][LP_FILTER_ORDER_16k+1]; + float *filt_mem[2]; + float mem_preemph[LP_FILTER_ORDER_16k]; + float synth[LP_FILTER_ORDER_16k]; + double lsp_history_16k[16]; + + void (*decode_frame)(struct SiprContext *ctx, SiprParameters *params, + float *out_data); +} SiprContext; + +extern const float ff_pow_0_5[16]; + +void ff_sipr_init_16k(SiprContext *ctx); + +void ff_sipr_decode_frame_16k(SiprContext *ctx, SiprParameters *params, + float *out_data); + +#endif /* AVCODEC_SIPR_H */ diff --git a/include/libavcodec/sipr16kdata.h b/include/libavcodec/sipr16kdata.h new file mode 100644 index 0000000..16a653d --- /dev/null +++ b/include/libavcodec/sipr16kdata.h @@ -0,0 +1,533 @@ +/* + * SIPR decoder for the 16k mode + * + * Copyright (c) 2008 Vladimir Voroshilov + * Copyright (c) 2009 Vitor Sessak + * + * 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_SIPR16KDATA_H +#define AVCODEC_SIPR16KDATA_H + +static const float pred_16k[2] = {0.8, 0.6}; +static const float qu[2] = { 0.12, 0.5}; + +static const float gain_cb_16k[32] = { + 0.07499, 0.10593, 0.14125, 0.18836, + 0.23714, 0.28184, 0.32734, 0.37584, + 0.42170, 0.47315, 0.53088, 0.59566, + 0.66834, 0.74989, 0.84140, 0.94406, + 1.05925, 1.18850, 1.33352, 1.49624, + 1.67880, 1.88365, 2.11349, 2.37137, + 2.66073, 3.05492, 3.54813, 4.21697, + 5.30884, 7.07946, 9.44061, 13.33521, +}; + +static const float gain_pitch_cb_16k[16] = { + 0.00, 0.2, 0.40, 0.5, 0.60, 0.7, 0.75, 0.8, + 0.85, 0.9, 0.95, 1.0, 1.05, 1.1, 1.15, 1.2, +}; + + +static const float mean_lsf_16k[16] = { + 0.131554, 0.246615, 0.435896, 0.644419, + 0.827810, 1.017876, 1.198910, 1.379159, + 1.562157, 1.736908, 1.940719, 2.131963, + 2.347162, 2.521521, 2.717870, 2.847068 +}; + +/** + * Hamming windowed sinc function, like in AMR + */ +static const float sinc_win[40] = { + 0.874475, 0.755101, 0.455962, 0.118807, -0.114223, -0.176778, + -0.101923, 0.015553, 0.086555, 0.078193, 0.018660, -0.037513, + -0.052733, -0.027459, 0.009967, 0.030278, 0.024050, 0.003055, + -0.013862, -0.016162, -0.006725, 0.004212, 0.008634, 0.005721, + -0.000000, -0.003710, -0.003690, -0.001228, 0.001409, 0.002610, +}; + +static const float lsf_cb1_16k[128][3] = { + {-0.089990, -0.172485, -0.203391}, {-0.094710, -0.178687, -0.134483}, + {-0.056398, -0.131952, -0.154500}, {-0.051362, -0.128138, -0.198549}, + {-0.061700, -0.142830, -0.251623}, {-0.041512, -0.115637, -0.229420}, + {-0.036544, -0.107512, -0.173125}, {-0.024158, -0.088450, -0.204144}, + {-0.038690, -0.103368, -0.132674}, {-0.056954, -0.128472, -0.104669}, + {-0.020963, -0.076785, -0.163199}, {-0.012952, -0.077249, -0.128385}, + {-0.032787, -0.097044, -0.093967}, {-0.035214, -0.053838, -0.111940}, + {-0.013850, -0.036926, -0.139328}, {-0.004956, -0.065092, -0.087709}, + {-0.065354, -0.065595, -0.079064}, {-0.023627, -0.081457, -0.054195}, + {-0.027335, -0.035244, -0.068034}, { 0.016555, -0.047075, -0.128286}, + { 0.021066, -0.037252, -0.092041}, { 0.014681, -0.043044, -0.057739}, + {-0.008493, -0.008143, -0.102486}, {-0.002303, -0.061540, -0.022952}, + {-0.006061, -0.014278, -0.033652}, {-0.005276, 0.011246, -0.062762}, + { 0.043411, -0.006303, -0.063730}, { 0.035885, -0.010052, -0.115290}, + { 0.030628, -0.031538, -0.017807}, { 0.022345, 0.028210, -0.032335}, + { 0.026535, 0.027536, -0.091150}, {-0.003365, -0.008077, 0.015687}, + {-0.026013, 0.017493, -0.010355}, { 0.059069, 0.010634, -0.007530}, + { 0.044038, -0.019424, 0.030453}, {-0.036065, -0.034215, -0.007758}, + { 0.022486, 0.042543, 0.027870}, {-0.049985, -0.016085, 0.021768}, + {-0.021715, 0.021168, 0.052076}, {-0.004243, -0.061228, 0.027640}, + {-0.033950, -0.017287, 0.064656}, { 0.016151, 0.000727, 0.062757}, + {-0.063456, -0.043152, 0.056707}, {-0.067715, 0.006126, 0.058178}, + {-0.038931, 0.051673, 0.030636}, {-0.073017, -0.074716, 0.026387}, + {-0.039893, -0.104629, 0.039616}, {-0.073179, -0.074601, 0.082069}, + {-0.066154, -0.027180, 0.099439}, {-0.075167, -0.121149, 0.071938}, + {-0.030382, -0.092582, 0.091067}, {-0.084519, -0.137542, 0.023626}, + {-0.060956, -0.121259, -0.015264}, {-0.030069, -0.093823, -0.008692}, + {-0.063564, -0.065225, -0.025820}, {-0.052074, -0.117595, -0.059689}, + {-0.091652, -0.165173, -0.045573}, {-0.070167, -0.121342, 0.131707}, + {-0.061024, -0.005833, -0.051035}, { 0.007837, -0.051816, 0.074575}, + {-0.070643, -0.053927, 0.149498}, {-0.014358, -0.066681, 0.139708}, + {-0.058186, 0.029576, 0.092923}, {-0.023371, 0.007058, 0.112484}, + {-0.057969, 0.022786, 0.148420}, { 0.029439, -0.017673, 0.121423}, + {-0.015811, 0.056785, 0.091594}, { 0.004347, 0.056680, 0.137848}, + {-0.004464, 0.002342, 0.184013}, { 0.029660, 0.046870, 0.082654}, + { 0.059408, 0.001016, 0.086063}, { 0.055263, 0.027574, 0.155037}, + { 0.062166, 0.064323, 0.117371}, { 0.022967, 0.100050, 0.077227}, + { 0.041795, 0.096343, 0.170421}, { 0.053189, 0.122931, 0.118549}, + { 0.094247, 0.094448, 0.078395}, { 0.082407, 0.033408, 0.041085}, + { 0.096820, 0.115960, 0.149433}, { 0.067804, 0.121849, 0.025336}, + {-0.008421, 0.104316, 0.032314}, { 0.031013, 0.073218, -0.004899}, + { 0.085079, 0.060323, -0.009687}, { 0.028174, 0.092766, -0.055590}, + { 0.070133, 0.039160, -0.061035}, {-0.039211, 0.072517, -0.028756}, + { 0.129686, 0.100233, -0.046998}, { 0.154189, 0.107616, 0.022791}, + {-0.049331, 0.094184, 0.087984}, {-0.013179, 0.126552, 0.125099}, + {-0.058716, 0.098524, 0.150886}, {-0.022753, 0.080011, 0.191127}, + { 0.013451, 0.164593, 0.153768}, { 0.074818, 0.181214, 0.108211}, + { 0.091323, 0.169249, 0.168460}, { 0.033885, 0.155516, 0.213745}, + {-0.032128, 0.227238, 0.135815}, {-0.059176, 0.168980, 0.229110}, + { 0.033917, 0.229753, 0.222264}, { 0.082702, 0.116370, 0.224697}, + { 0.127737, 0.186658, 0.212783}, { 0.047528, 0.063920, 0.216856}, + {-0.002446, 0.114174, 0.263289}, {-0.077783, 0.082523, 0.249697}, + { 0.010023, 0.024267, 0.256874}, { 0.053190, 0.111422, 0.310407}, + {-0.078804, 0.004444, 0.224078}, {-0.055253, -0.059180, 0.217892}, + {-0.065371, 0.008124, 0.333405}, {-0.076188, -0.098767, 0.286983}, + {-0.071911, -0.115804, 0.198031}, {-0.062473, 0.183639, 0.370162}, + {-0.042666, 0.255210, 0.262720}, { 0.011999, 0.217530, 0.318291}, + {-0.042144, 0.322087, 0.326387}, { 0.090663, 0.205835, 0.294784}, + { 0.058218, 0.293649, 0.277927}, { 0.157506, 0.282870, 0.294610}, + { 0.118248, 0.261007, 0.148614}, { 0.065261, 0.332362, 0.411912}, + { 0.141269, 0.451850, 0.315726}, { 0.001706, 0.456301, 0.357590}, + {-0.052947, 0.356559, 0.456944}, { 0.247707, 0.263837, 0.152591}, + { 0.306847, 0.417373, 0.258553}, { 0.166347, 0.149222, 0.118973}, + { 0.379709, 0.292172, 0.139875}, { 0.010171, -0.055170, -0.174523} +}; + +static const float lsf_cb2_16k[256][3] = { + {-0.213011, -0.293385, -0.330597}, {-0.212582, -0.240992, -0.338239}, + {-0.223373, -0.306214, -0.277192}, {-0.231138, -0.287729, -0.229412}, + {-0.238466, -0.228571, -0.260954}, {-0.140931, -0.247018, -0.258566}, + {-0.136239, -0.249669, -0.350143}, {-0.149738, -0.192970, -0.281475}, + {-0.167058, -0.261052, -0.196301}, {-0.177049, -0.201324, -0.207897}, + {-0.116915, -0.200629, -0.212526}, {-0.162247, -0.143805, -0.245093}, + {-0.082042, -0.191842, -0.266338}, {-0.098846, -0.208511, -0.320481}, + {-0.113510, -0.152470, -0.222474}, {-0.066197, -0.179112, -0.207813}, + {-0.129490, -0.169320, -0.155238}, {-0.078843, -0.190292, -0.155172}, + {-0.087790, -0.147729, -0.169351}, {-0.141037, -0.127207, -0.177910}, + {-0.126525, -0.223961, -0.153639}, {-0.101464, -0.189953, -0.114559}, + {-0.102450, -0.106303, -0.151171}, {-0.103208, -0.144457, -0.105378}, + {-0.170794, -0.140525, -0.136428}, {-0.168641, -0.203064, -0.135368}, + {-0.138193, -0.116042, -0.111905}, {-0.145085, -0.168581, -0.092613}, + {-0.126379, -0.220431, -0.091327}, {-0.212934, -0.184797, -0.101632}, + {-0.193711, -0.140556, -0.078304}, {-0.173674, -0.197276, -0.060140}, + {-0.197897, -0.241907, -0.091997}, {-0.156037, -0.258519, -0.111628}, + {-0.241964, -0.191124, -0.063140}, {-0.261340, -0.240847, -0.103132}, + {-0.221621, -0.242972, -0.041255}, {-0.224166, -0.232742, -0.161568}, + {-0.203591, -0.294470, -0.126035}, {-0.209540, -0.303149, -0.053170}, + {-0.253859, -0.295066, -0.156050}, {-0.278143, -0.331105, -0.085237}, + {-0.300273, -0.198750, -0.094834}, {-0.260477, -0.169713, -0.132476}, + {-0.211889, -0.172454, -0.164281}, {-0.228370, -0.122149, -0.124178}, + {-0.254629, -0.135668, -0.081692}, {-0.263813, -0.154928, -0.213596}, + {-0.308224, -0.106877, -0.084404}, {-0.242644, -0.082862, -0.085835}, + {-0.252084, -0.064888, -0.146498}, {-0.198162, -0.105721, -0.188887}, + {-0.189238, -0.088028, -0.109736}, {-0.197598, -0.099831, -0.044030}, + {-0.269017, -0.105991, -0.021513}, {-0.231349, -0.058825, -0.041407}, + {-0.225589, -0.027501, -0.087160}, {-0.160347, -0.058341, -0.079789}, + {-0.158729, -0.108951, -0.067262}, {-0.170483, -0.053023, -0.017561}, + {-0.175207, -0.013649, -0.049513}, {-0.156004, -0.108378, -0.004052}, + {-0.219958, -0.082362, 0.014950}, {-0.217785, -0.012981, -0.009410}, + {-0.123290, -0.040849, -0.040910}, {-0.119861, -0.095078, -0.060246}, + {-0.117537, -0.065479, 0.002968}, {-0.103231, -0.113298, -0.023282}, + {-0.136365, -0.149524, -0.051387}, {-0.119332, -0.164400, -0.009103}, + {-0.104522, -0.060948, -0.083056}, {-0.071461, -0.070787, -0.037347}, + {-0.081116, -0.149015, -0.056740}, {-0.069561, -0.108099, -0.069167}, + {-0.055624, -0.117369, -0.025091}, {-0.091941, -0.190091, -0.060020}, + {-0.072003, -0.168433, -0.006540}, {-0.033305, -0.154427, -0.054608}, + {-0.062988, -0.127093, -0.108307}, {-0.056690, -0.170813, -0.102834}, + {-0.018273, -0.127863, -0.094998}, {-0.056239, -0.123678, -0.146262}, + {-0.023442, -0.154617, -0.137417}, {-0.051903, -0.078379, -0.093395}, + {-0.014599, -0.104412, -0.135959}, {-0.051582, -0.081280, -0.140643}, + {-0.092727, -0.091930, -0.107816}, {-0.024814, -0.140993, -0.183243}, + {-0.064307, -0.113024, -0.194788}, {-0.000118, -0.098858, -0.195336}, + {-0.028090, -0.048258, -0.164101}, {-0.093414, -0.055969, -0.172743}, + {-0.114445, -0.104336, -0.215204}, {-0.048518, -0.132063, -0.242991}, + {-0.159620, -0.060240, -0.178592}, {-0.135728, -0.067473, -0.131876}, + {-0.078464, -0.038040, -0.125105}, {-0.011061, -0.064011, -0.102496}, + {-0.033887, -0.026485, -0.109493}, {-0.129128, -0.014216, -0.111329}, + {-0.190687, -0.030660, -0.135825}, {-0.082037, 0.010997, -0.100167}, + {-0.183403, 0.001651, -0.098962}, {-0.074775, -0.030335, -0.062217}, + {-0.031759, -0.050551, -0.059420}, {-0.051439, 0.010827, -0.052148}, + {-0.126744, 0.008689, -0.047785}, {-0.145916, 0.042019, -0.077431}, + {-0.093552, 0.054143, -0.060473}, {-0.090660, 0.012868, -0.018195}, + {-0.079783, -0.033071, 0.001482}, {-0.033010, -0.022331, -0.014506}, + {-0.004798, -0.017339, -0.060120}, {-0.025021, 0.026390, -0.003263}, + {-0.001437, 0.025994, -0.040892}, {-0.074821, 0.019005, 0.027549}, + {-0.030811, -0.012114, 0.034284}, { 0.006785, 0.004618, 0.018717}, + { 0.013392, -0.032597, -0.023731}, { 0.035994, 0.005963, -0.011757}, + { 0.008071, -0.045750, 0.024889}, { 0.013055, 0.017040, 0.054121}, + {-0.012989, 0.044864, 0.036327}, { 0.025054, 0.047137, 0.009974}, + { 0.053801, 0.024178, 0.031774}, { 0.056442, -0.030647, 0.021291}, + { 0.032247, 0.052680, 0.049886}, { 0.035369, 0.090207, 0.031394}, + { 0.064720, 0.070390, 0.040938}, { 0.022112, 0.054834, 0.091059}, + { 0.041765, 0.086248, 0.070196}, { 0.070645, 0.060852, 0.078825}, + { 0.058506, 0.016920, 0.081612}, { 0.000009, 0.086500, 0.059849}, + { 0.071253, 0.107392, 0.059046}, { 0.094702, 0.096160, 0.090982}, + { 0.047639, 0.110877, 0.111227}, { 0.122444, 0.090909, 0.057396}, + { 0.101916, 0.052299, 0.029909}, { 0.076560, 0.086094, -0.007252}, + { 0.123411, 0.030769, 0.082749}, { 0.135579, 0.103022, 0.009540}, + { 0.120576, 0.065284, -0.024095}, { 0.077483, 0.028526, -0.012369}, + { 0.128747, 0.017901, -0.003874}, { 0.158254, 0.046962, 0.029577}, + { 0.102287, -0.002211, 0.037329}, { 0.089654, -0.021372, -0.006857}, + { 0.137917, 0.027228, -0.053223}, { 0.098728, -0.012192, -0.048518}, + { 0.083974, 0.036153, -0.062266}, { 0.048230, -0.010241, -0.052293}, + { 0.110135, 0.007715, -0.095233}, { 0.068294, -0.014317, -0.104029}, + { 0.063909, -0.056416, -0.063023}, { 0.059133, -0.044675, -0.023780}, + { 0.030748, 0.021845, -0.086332}, { 0.023994, -0.045574, -0.076232}, + { 0.052147, -0.059825, -0.109667}, { 0.013087, -0.020420, -0.121945}, + { 0.018163, -0.096765, -0.088758}, { 0.020196, -0.076470, -0.048112}, + { 0.020282, -0.084204, -0.135535}, { 0.040076, -0.053464, -0.161949}, + {-0.017796, -0.103070, -0.059559}, {-0.016484, -0.070138, -0.016866}, + { 0.004849, -0.112481, -0.017731}, { 0.040160, -0.073873, -0.005327}, + { 0.002202, -0.094723, 0.045366}, {-0.056918, -0.081578, 0.017875}, + {-0.031099, -0.141708, 0.009186}, {-0.102802, -0.122675, 0.030060}, + {-0.061717, -0.145116, 0.076680}, {-0.073607, -0.050464, 0.072853}, + {-0.117403, -0.194921, 0.040101}, {-0.185236, -0.133620, 0.045939}, + {-0.160174, -0.057226, 0.056641}, {-0.178489, -0.173435, -0.007806}, + {-0.199916, -0.204866, 0.047342}, {-0.152337, -0.249651, 0.034656}, + {-0.185637, -0.230942, -0.002072}, {-0.122548, -0.215209, -0.024552}, + {-0.249578, -0.209714, 0.009470}, {-0.160108, -0.257702, -0.040992}, + {-0.216694, -0.289353, 0.027182}, {-0.226390, -0.147844, -0.022742}, + {-0.288737, -0.272150, -0.013948}, {-0.262554, -0.237035, 0.072473}, + {-0.306267, -0.188335, -0.032894}, {-0.259666, -0.345816, 0.024138}, + {-0.271093, -0.137143, 0.040404}, {-0.201317, -0.286782, 0.107615}, + {-0.235725, -0.163396, 0.113844}, {-0.159988, -0.209788, 0.112140}, + {-0.262985, -0.056741, 0.093506}, {-0.277226, -0.037306, 0.016008}, + {-0.293486, -0.040422, -0.062018}, {-0.214921, 0.022900, 0.055295}, + {-0.253889, 0.058575, -0.000151}, {-0.246689, 0.024242, -0.058488}, + {-0.143790, 0.006767, 0.014061}, {-0.187077, 0.048882, -0.035625}, + {-0.196369, 0.112085, 0.031546}, {-0.124264, 0.086197, -0.020800}, + {-0.126249, 0.016960, 0.095741}, {-0.079816, 0.080398, 0.051038}, + {-0.056269, 0.075380, -0.028262}, {-0.120493, 0.148495, 0.028430}, + {-0.161750, 0.101290, 0.117806}, {-0.003247, 0.083393, -0.017061}, + {-0.034007, 0.142542, 0.007402}, {-0.037618, 0.025871, 0.089496}, + {-0.082819, 0.184435, 0.073224}, { 0.006448, 0.167015, 0.080548}, + { 0.035315, 0.144022, 0.003218}, {-0.023459, 0.088147, 0.152604}, + { 0.006247, -0.024099, 0.077792}, { 0.039894, 0.057586, -0.042455}, + {-0.020417, 0.035400, -0.093971}, { 0.075465, 0.052063, 0.145582}, + { 0.078027, 0.184720, 0.092096}, { 0.107295, 0.148380, 0.022264}, + { 0.066928, -0.052831, 0.065108}, { 0.093295, 0.118157, 0.149815}, + { 0.119373, 0.137114, 0.099536}, { 0.138653, 0.075509, 0.121545}, + { 0.174025, 0.077531, 0.077169}, { 0.165839, 0.150080, 0.133423}, + { 0.173276, 0.155887, 0.048150}, { 0.162910, 0.095898, 0.171896}, + { 0.214577, 0.112888, 0.115579}, { 0.204755, 0.106392, 0.032337}, + { 0.178853, 0.205034, 0.114760}, { 0.177401, 0.070504, -0.013778}, + { 0.241624, 0.166921, 0.066087}, { 0.219595, 0.183553, 0.172332}, + { 0.123671, 0.170842, 0.167216}, { 0.177104, 0.240197, 0.186359}, + { 0.272003, 0.220214, 0.126073}, { 0.093748, 0.235843, 0.160998}, + { 0.141510, 0.190012, 0.240416}, { 0.046878, 0.168984, 0.190412}, + { 0.094898, 0.107038, 0.235003}, { 0.108592, 0.269536, 0.262528}, + {-0.027754, 0.234355, 0.134544}, { 0.265127, 0.267540, 0.199041}, + { 0.199523, 0.291507, 0.265171}, { 0.266177, 0.209339, 0.350369}, + { 0.322159, 0.344794, 0.270823}, { 0.399957, 0.264065, 0.110387}, + { 0.277817, 0.127407, -0.035625}, {-0.177038, 0.208155, 0.119077}, + { 0.049075, -0.076294, 0.145711}, { 0.187246, 0.042865, -0.127097}, + { 0.117885, -0.023489, -0.138658}, {-0.284256, 0.068153, 0.124259} +}; + +static const float lsf_cb3_16k[128][3] = { + {-0.223412, -0.236300, -0.188067}, {-0.202286, -0.218711, -0.102947}, + {-0.251652, -0.161020, -0.125280}, {-0.169223, -0.138155, -0.140430}, + {-0.176427, -0.146628, -0.222632}, {-0.120584, -0.187276, -0.180164}, + {-0.195559, -0.074225, -0.169109}, {-0.144551, -0.142774, -0.073340}, + {-0.111001, -0.111310, -0.130696}, {-0.095221, -0.174684, -0.111841}, + {-0.112158, -0.103049, -0.195130}, {-0.059989, -0.142170, -0.157850}, + {-0.127598, -0.051759, -0.153109}, {-0.063753, -0.067898, -0.164117}, + {-0.141753, -0.068274, -0.091999}, {-0.060482, -0.101054, -0.099475}, + {-0.104699, -0.104456, -0.066496}, {-0.073649, -0.052614, -0.091612}, + {-0.088268, -0.019072, -0.129956}, {-0.018837, -0.104115, -0.127837}, + {-0.021630, -0.033055, -0.129868}, {-0.083768, -0.047549, -0.041407}, + {-0.055892, -0.108526, -0.043200}, {-0.027816, -0.062499, -0.048190}, + {-0.002248, -0.110428, -0.062868}, { 0.001270, -0.033245, -0.072404}, + {-0.042747, -0.013835, -0.033829}, {-0.037615, -0.147833, -0.083912}, + {-0.045023, 0.006011, -0.092182}, {-0.050411, -0.081832, 0.005787}, + { 0.000357, -0.104282, -0.009428}, {-0.003893, -0.047892, -0.001506}, + {-0.040077, -0.147110, -0.009065}, {-0.060858, -0.030972, 0.012999}, + {-0.014674, 0.001370, 0.005554}, {-0.101362, -0.126061, -0.001898}, + {-0.102519, -0.000390, -0.015721}, {-0.132687, -0.069608, -0.019928}, + {-0.102227, -0.076131, 0.043306}, {-0.055193, 0.027001, 0.011857}, + {-0.156427, -0.016629, 0.017480}, {-0.078736, 0.002809, 0.057979}, + {-0.157789, -0.016693, -0.055073}, {-0.179397, -0.095520, 0.022065}, + {-0.110219, 0.010408, -0.081927}, {-0.125392, 0.049111, 0.044595}, + {-0.112528, 0.063173, -0.024954}, {-0.185525, 0.053093, -0.032102}, + {-0.176887, -0.019379, -0.115125}, {-0.249706, -0.017664, -0.059188}, + {-0.200243, -0.103311, -0.066846}, {-0.055404, 0.045106, -0.046991}, + {-0.000544, 0.022690, -0.044831}, { 0.022298, -0.016367, -0.022509}, + { 0.028278, 0.017585, -0.100612}, { 0.061781, -0.020826, -0.068190}, + { 0.029157, -0.074477, -0.098898}, { 0.043073, -0.067234, -0.032293}, + { 0.060157, 0.034636, -0.034885}, { 0.071153, -0.013881, -0.009036}, + { 0.054196, -0.029989, -0.131139}, { 0.030193, 0.024976, 0.009861}, + { 0.055943, -0.045304, 0.031927}, { 0.033217, -0.002418, 0.038165}, + { 0.063814, 0.045625, 0.025309}, { 0.033689, 0.038819, 0.049700}, + { 0.073582, 0.028527, 0.060200}, {-0.007957, 0.022531, 0.043687}, + {-0.000984, 0.054518, 0.018742}, { 0.057004, 0.060916, 0.060573}, + { 0.009883, 0.015238, 0.080211}, { 0.022742, 0.070832, 0.068855}, + { 0.053001, 0.029790, 0.091446}, {-0.042447, 0.060379, 0.061462}, + { 0.076826, 0.062468, 0.089653}, { 0.039065, 0.069768, 0.119128}, + { 0.064145, 0.095353, 0.071621}, { 0.094411, 0.069527, 0.054197}, + { 0.042812, 0.093060, 0.027980}, { 0.094791, 0.099189, 0.101112}, + { 0.117611, 0.048601, 0.093111}, { 0.119951, 0.122758, 0.051546}, + { 0.103558, 0.085245, -0.010700}, { 0.150126, 0.059766, 0.020280}, + { 0.108066, 0.017170, 0.008606}, { 0.108422, 0.023253, -0.063942}, + { 0.019652, 0.072284, -0.030331}, { 0.192719, 0.075624, 0.071156}, + { 0.221140, 0.069191, -0.035085}, { 0.188367, 0.126200, 0.035225}, + { 0.185760, 0.043537, -0.101714}, {-0.042518, 0.099646, 0.003244}, + {-0.015308, -0.027521, 0.046006}, { 0.034086, -0.045777, 0.095989}, + { 0.007174, -0.093358, 0.046459}, {-0.051248, -0.062095, 0.083161}, + {-0.045626, -0.133301, 0.052997}, {-0.037840, 0.024042, 0.131097}, + {-0.020217, -0.115942, 0.126170}, {-0.134550, -0.036291, 0.111322}, + {-0.110576, -0.160024, 0.091841}, {-0.093308, -0.184958, 0.013939}, + {-0.082735, -0.167417, -0.051725}, {-0.169934, -0.173003, -0.007155}, + {-0.128244, -0.213123, -0.053337}, {-0.079852, -0.154116, -0.246546}, + {-0.032242, -0.108756, -0.204133}, {-0.140117, -0.199495, -0.284505}, + { 0.010842, -0.074979, -0.166333}, {-0.093313, 0.145006, 0.034110}, + {-0.039236, 0.113213, 0.111053}, { 0.040613, -0.031783, 0.174058}, + {-0.164232, 0.131421, 0.149842}, { 0.026893, 0.107281, 0.179297}, + { 0.047086, 0.158606, 0.103267}, {-0.070567, 0.210459, 0.134734}, + { 0.094392, 0.137050, 0.166892}, { 0.086039, 0.063657, 0.168825}, + { 0.159371, 0.120897, 0.154357}, { 0.147101, 0.160684, 0.114882}, + { 0.120158, 0.199650, 0.180948}, { 0.191417, 0.174500, 0.170734}, + { 0.159153, 0.142165, 0.233347}, { 0.232002, 0.150181, 0.102736}, + { 0.188299, 0.221738, 0.228748}, { 0.256786, 0.209685, 0.161534}, + { 0.257861, 0.247793, 0.250516}, {-0.164461, -0.000143, 0.232461} +}; + +static const float lsf_cb4_16k[128][3] = { + {-0.193369, -0.304643, -0.253777}, {-0.164125, -0.277786, -0.153116}, + {-0.135681, -0.209120, -0.211724}, {-0.121822, -0.215734, -0.292207}, + {-0.198781, -0.161674, -0.242538}, {-0.164147, -0.180570, -0.138070}, + {-0.095915, -0.198695, -0.154309}, {-0.248386, -0.234462, -0.136984}, + {-0.164968, -0.108318, -0.175635}, {-0.124171, -0.111809, -0.224402}, + {-0.067398, -0.157017, -0.195759}, {-0.090132, -0.119174, -0.165253}, + {-0.099460, -0.146895, -0.106799}, {-0.141493, -0.108103, -0.108880}, + {-0.085088, -0.098340, -0.109953}, {-0.105526, -0.054463, -0.154315}, + {-0.040480, -0.144285, -0.124042}, {-0.040969, -0.084039, -0.142880}, + {-0.049082, -0.118553, -0.066686}, {-0.096336, -0.087515, -0.055741}, + {-0.058605, -0.059327, -0.089275}, {-0.121842, -0.058681, -0.086949}, + {-0.053792, -0.022025, -0.124451}, {-0.036744, -0.068891, -0.045865}, + { 0.003900, -0.098237, -0.091158}, {-0.001664, -0.045089, -0.081353}, + {-0.072829, -0.034087, -0.038416}, {-0.100822, -0.007330, -0.088715}, + {-0.035911, -0.005864, -0.062577}, {-0.020205, -0.026547, -0.019634}, + { 0.004291, -0.041290, -0.138181}, { 0.023404, -0.010932, -0.044904}, + { 0.013557, 0.014823, -0.092943}, { 0.059673, -0.031024, -0.095739}, + { 0.021130, -0.080607, -0.034594}, { 0.024655, -0.035564, 0.003243}, + { 0.017106, 0.006952, -0.000308}, { 0.075208, -0.030910, -0.031181}, + { 0.024965, 0.048632, -0.039448}, { 0.057028, 0.021547, -0.009418}, + {-0.018577, 0.023697, -0.009759}, { 0.024077, 0.033053, 0.024324}, + { 0.037052, -0.003436, 0.044530}, {-0.012871, -0.007179, 0.031795}, + { 0.077877, 0.021547, 0.023131}, { 0.053365, 0.052078, 0.029433}, + { 0.011429, 0.070426, 0.028734}, {-0.001827, 0.033115, 0.061505}, + {-0.044870, 0.038568, 0.026239}, { 0.061633, 0.034799, 0.059784}, + { 0.034261, 0.060342, 0.065185}, { 0.058981, 0.082481, 0.047252}, + { 0.090008, 0.065942, 0.044470}, { 0.066961, 0.073728, -0.000428}, + { 0.074763, 0.060293, 0.085632}, { 0.066366, 0.103375, 0.079642}, + { 0.122297, 0.036558, 0.058745}, { 0.111042, 0.092093, 0.085412}, + { 0.099243, 0.115476, 0.039254}, { 0.019973, 0.122844, 0.050255}, + { 0.159571, 0.098965, 0.051740}, { 0.137624, 0.072405, -0.006922}, + { 0.130240, 0.146091, 0.089698}, { 0.138335, 0.092968, 0.136193}, + { 0.066031, 0.149304, 0.125476}, { 0.202749, 0.145751, 0.077122}, + { 0.002224, 0.082811, 0.131200}, { 0.124476, 0.178073, 0.162336}, + { 0.174722, 0.190298, 0.127106}, { 0.202193, 0.153569, 0.163840}, + { 0.242604, 0.197796, 0.136929}, { 0.185809, 0.229348, 0.193353}, + {-0.058814, 0.195178, 0.141821}, { 0.253646, 0.247175, 0.205766}, + { 0.061433, -0.025542, 0.119311}, {-0.057816, 0.082445, 0.073243}, + {-0.069239, 0.148678, 0.031146}, {-0.030217, -0.008503, 0.106194}, + {-0.026708, 0.087469, -0.009589}, {-0.090418, 0.000265, 0.056807}, + {-0.050607, -0.019383, 0.010494}, {-0.079397, 0.008233, -0.011469}, + {-0.072634, -0.061165, 0.046917}, {-0.075741, -0.072343, -0.007557}, + {-0.025162, -0.073363, 0.005173}, {-0.123371, -0.041257, -0.008375}, + {-0.139904, 0.018285, 0.009920}, {-0.143421, -0.104238, 0.033457}, + {-0.100923, -0.134400, -0.023257}, {-0.157791, -0.095042, -0.036959}, + {-0.219890, -0.078637, 0.001815}, {-0.183607, -0.023053, -0.043678}, + {-0.145303, -0.158923, -0.059045}, {-0.197615, -0.165199, 0.028099}, + {-0.225131, -0.167756, -0.056401}, {-0.216572, -0.104751, -0.102964}, + {-0.171336, -0.241967, -0.063404}, {-0.134035, -0.205614, 0.011831}, + {-0.297116, -0.211173, -0.015352}, {-0.086464, -0.200592, -0.070454}, + {-0.217777, -0.278403, 0.030398}, {-0.236248, -0.323694, -0.087588}, + {-0.222074, -0.210785, 0.106210}, {-0.283400, -0.097077, 0.041303}, + {-0.078417, -0.154464, 0.062956}, {-0.214417, -0.100695, 0.121909}, + {-0.178576, -0.028847, 0.061042}, {-0.037999, -0.144233, -0.010546}, + {-0.086695, -0.070996, 0.125282}, { 0.010788, -0.085006, 0.058527}, + {-0.154015, 0.066560, 0.071038}, {-0.143503, 0.033260, 0.154393}, + {-0.134069, 0.032420, -0.056293}, {-0.110851, 0.086908, 0.003920}, + {-0.057254, 0.047674, -0.055571}, {-0.214206, 0.068784, -0.004735}, + {-0.257264, 0.050468, 0.081702}, {-0.291834, 0.004120, -0.022366}, + {-0.173309, -0.029081, -0.115901}, {-0.207622, 0.168664, 0.136030}, + { 0.090541, 0.032754, -0.057330}, { 0.140219, -0.000735, -0.015633}, + { 0.136697, -0.017163, -0.100909}, { 0.029838, -0.089515, -0.147130}, + {-0.055367, -0.072683, -0.214015}, { 0.048680, -0.057633, -0.212429}, + {-0.013134, -0.113898, -0.196403}, {-0.071702, -0.159408, -0.254895} +}; + +static const float lsf_cb5_16k[128][4] = { + {-0.201277, -0.278679, -0.173262, -0.198580}, + {-0.214667, -0.151922, -0.117551, -0.192713}, + {-0.160962, -0.207728, -0.124750, -0.129749}, + {-0.131043, -0.137818, -0.155281, -0.166308}, + {-0.179134, -0.169602, -0.165223, -0.066293}, + {-0.136474, -0.177035, -0.250127, -0.134370}, + {-0.066970, -0.146274, -0.170638, -0.134436}, + {-0.083288, -0.165860, -0.103437, -0.140361}, + {-0.130474, -0.119317, -0.124393, -0.086408}, + {-0.127609, -0.134415, -0.073592, -0.116103}, + {-0.113027, -0.091756, -0.107786, -0.131935}, + {-0.125530, -0.182152, -0.093796, -0.045088}, + {-0.077122, -0.138052, -0.166271, -0.038886}, + {-0.073027, -0.106845, -0.067073, -0.113910}, + {-0.049146, -0.107019, -0.112531, -0.063388}, + {-0.101539, -0.119586, -0.050297, -0.040670}, + {-0.107784, -0.066913, -0.080993, -0.052352}, + {-0.152155, -0.103010, -0.090461, -0.015526}, + {-0.153087, -0.087656, -0.029889, -0.037367}, + {-0.215281, -0.138062, -0.089162, -0.050839}, + {-0.053350, -0.060169, -0.063459, -0.024499}, + {-0.051674, -0.076355, -0.033733, -0.077211}, + {-0.045047, -0.107006, -0.020880, -0.024525}, + {-0.083003, -0.063672, -0.013243, -0.028324}, + {-0.104104, -0.075450, -0.032746, 0.024480}, + {-0.085695, -0.019502, -0.045121, -0.025016}, + {-0.123120, -0.030844, -0.003533, -0.016224}, + {-0.025568, -0.049172, -0.003911, -0.027522}, + {-0.039029, -0.019857, -0.043211, -0.058087}, + {-0.040122, -0.023067, -0.001356, 0.008607}, + {-0.063351, -0.001776, 0.016015, -0.027088}, + {-0.068110, -0.038838, 0.042525, 0.001076}, + {-0.043623, -0.020736, -0.047862, 0.037710}, + {-0.041052, 0.021954, -0.025660, 0.000758}, + {-0.013035, 0.002583, -0.008233, -0.037300}, + {-0.005523, -0.014670, 0.019651, -0.012667}, + {-0.004409, -0.014437, -0.059412, -0.019701}, + { 0.024946, -0.011663, -0.014351, -0.028762}, + { 0.012660, 0.018489, -0.010205, 0.012695}, + {-0.004423, 0.017827, 0.040544, 0.003629}, + { 0.020684, 0.026743, 0.007752, -0.025595}, + { 0.032071, 0.000043, 0.026188, -0.006444}, + { 0.058793, 0.015820, -0.001119, -0.017415}, + { 0.020156, -0.047590, 0.004227, 0.008670}, + { 0.054770, 0.032135, 0.029770, -0.009767}, + { 0.030884, 0.047757, 0.033068, 0.006866}, + { 0.062039, 0.011646, 0.056037, 0.016859}, + { 0.013798, -0.028196, 0.060710, 0.014299}, + { 0.100043, 0.041445, 0.023379, -0.014889}, + { 0.062728, -0.042821, 0.002180, -0.055380}, + { 0.061663, 0.018767, -0.015571, -0.074095}, + { 0.062980, 0.080497, 0.011808, -0.031787}, + { 0.084964, 0.043100, -0.025877, 0.020309}, + { 0.014707, 0.035421, -0.041440, -0.053373}, + { 0.081268, 0.005791, -0.066290, -0.039825}, + { 0.017691, -0.020401, -0.040513, -0.083960}, + { 0.120874, 0.055753, -0.025988, -0.059552}, + { 0.079912, 0.007894, -0.085380, -0.114587}, + { 0.036856, -0.039331, -0.104237, -0.069116}, + { 0.008526, -0.064273, -0.048312, -0.038595}, + { 0.033461, -0.028956, -0.066505, 0.038722}, + {-0.042064, -0.043989, -0.100653, -0.071550}, + {-0.015342, -0.064850, -0.065675, -0.122769}, + {-0.006581, -0.004919, -0.113564, -0.145753}, + { 0.008273, -0.070702, -0.164998, -0.095541}, + {-0.001698, -0.063744, -0.129971, -0.011162}, + {-0.048471, -0.087500, -0.111006, -0.161823}, + {-0.032193, -0.091955, -0.080642, 0.012288}, + {-0.095873, -0.015986, -0.072722, -0.101745}, + {-0.079477, -0.082060, -0.203008, -0.100297}, + {-0.023883, -0.064022, -0.168341, -0.211739}, + {-0.070530, -0.103547, -0.123858, 0.055049}, + {-0.033503, -0.076812, -0.016287, 0.044159}, + {-0.088427, -0.161682, -0.058579, 0.013873}, + {-0.083068, -0.168222, -0.016773, -0.080209}, + {-0.080548, -0.139090, 0.030544, 0.007171}, + {-0.117482, -0.083718, 0.027074, -0.003674}, + {-0.163085, -0.156856, -0.012618, -0.022329}, + {-0.176540, -0.113042, -0.020148, 0.051770}, + {-0.153891, -0.199293, -0.043244, 0.028331}, + {-0.107822, -0.150615, 0.016430, 0.092919}, + {-0.137676, -0.183224, 0.066026, 0.029343}, + {-0.191106, -0.099250, 0.045370, 0.004084}, + {-0.237042, -0.130815, -0.022543, -0.029428}, + {-0.201014, -0.053591, -0.007305, -0.033547}, + {-0.249286, -0.228408, 0.005002, 0.007146}, + {-0.206509, -0.211998, -0.061352, -0.047233}, + {-0.255702, -0.135114, 0.076375, 0.036630}, + {-0.296271, -0.073946, -0.007273, -0.019601}, + {-0.302917, -0.175111, -0.070024, -0.043905}, + {-0.239275, -0.043962, -0.084982, -0.067446}, + {-0.254583, -0.294720, -0.088762, -0.070451}, + {-0.205583, -0.238996, -0.124753, 0.033076}, + {-0.205583, -0.215882, -0.028472, 0.118679}, + {-0.153640, -0.204464, -0.039654, -0.134441}, + {-0.145929, -0.191970, -0.175308, 0.021366}, + {-0.149348, -0.212569, -0.118324, 0.103812}, + {-0.166397, -0.220581, -0.265260, -0.029113}, + {-0.164171, -0.231262, -0.258828, 0.061427}, + {-0.200198, -0.263453, -0.212016, 0.115359}, + {-0.130088, -0.212168, -0.202368, 0.118563}, + {-0.206387, -0.078075, -0.227856, -0.111165}, + {-0.129605, -0.176848, -0.241584, -0.259900}, + {-0.176826, -0.045901, -0.141712, -0.209345}, + {-0.351173, -0.031097, -0.133935, -0.182412}, + {-0.164232, 0.027006, -0.014039, -0.053567}, + {-0.171037, -0.025924, 0.030972, 0.017329}, + {-0.080862, -0.021577, 0.007652, 0.063968}, + {-0.061788, 0.042024, -0.018783, -0.057979}, + {-0.110311, 0.054760, 0.031446, -0.006710}, + {-0.136637, 0.022171, 0.084991, 0.028039}, + {-0.254471, -0.004376, 0.078034, 0.033649}, + {-0.234464, 0.088157, 0.040999, 0.002639}, + {-0.037095, 0.059443, 0.072180, 0.015027}, + {-0.046841, -0.004813, 0.088266, 0.038786}, + {-0.086782, 0.120100, 0.082655, 0.020271}, + {-0.118361, -0.069242, 0.094867, 0.039200}, + {-0.023342, -0.084303, 0.052684, 0.017093}, + {-0.014194, 0.001012, 0.011946, 0.074125}, + {-0.015342, 0.076396, 0.022365, -0.028001}, + { 0.027706, 0.037047, 0.107573, 0.060815}, + { 0.030615, 0.040664, 0.010467, 0.074289}, + { 0.038646, 0.115584, 0.069627, 0.007642}, + { 0.096463, 0.069818, 0.062494, 0.015413}, + { 0.054834, 0.065232, 0.054286, 0.110088}, + { 0.152312, 0.092371, 0.026420, -0.013184}, + { 0.144264, 0.123438, 0.080131, 0.023233}, + { 0.124405, 0.009943, -0.148477, -0.205184} +}; + +static const float * const lsf_codebooks_16k[] = { + lsf_cb1_16k[0], lsf_cb2_16k[0], lsf_cb3_16k[0], lsf_cb4_16k[0], + lsf_cb5_16k[0] +}; + +#endif /* AVCODEC_SIPR16KDATA_H */ diff --git a/include/libavcodec/siprdata.h b/include/libavcodec/siprdata.h new file mode 100644 index 0000000..0dbc113 --- /dev/null +++ b/include/libavcodec/siprdata.h @@ -0,0 +1,263 @@ +/* + * SIPR / ACELP.NET decoder + * + * Copyright (c) 2008 Vladimir Voroshilov + * Copyright (c) 2009 Vitor Sessak + * + * 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_SIPRDATA_H +#define AVCODEC_SIPRDATA_H + +static const float mean_lsf[10] = { + 0.297151, 0.452308, 0.765443, 1.134803, 1.421125, + 1.773822, 2.049173, 2.375914, 2.585097, 0.075756 +}; + +static const float lsf_cb1[64][2] = { + { 0.007587, -0.005843}, { 0.042163, -0.028048}, {-0.017147, -0.060705}, + { 0.013773, -0.038108}, {-0.041563, -0.078571}, {-0.076928, -0.119343}, + { 0.012654, 0.176005}, { 0.059737, 0.156869}, { 0.171767, 0.231837}, + { 0.114030, 0.242047}, { 0.168977, 0.283101}, { 0.146210, 0.397961}, + { 0.249446, 0.268421}, { 0.137074, 0.186724}, {-0.057736, -0.135638}, + {-0.109664, -0.124611}, {-0.021234, -0.031174}, {-0.013990, -0.091819}, + {-0.040046, -0.111426}, {-0.016830, 0.055361}, { 0.057815, 0.071606}, + { 0.060670, 0.114436}, { 0.106695, 0.140838}, { 0.093601, 0.092793}, + { 0.039593, 0.006142}, {-0.066589, -0.092463}, {-0.102589, -0.171380}, + {-0.059621, -0.050671}, { 0.166131, 0.139773}, { 0.213069, 0.190761}, + { 0.061820, 0.037661}, { 0.136471, 0.090823}, {-0.019789, 0.013515}, + { 0.022280, 0.079473}, { 0.215281, 0.461959}, { 0.206497, 0.340077}, + { 0.012249, -0.065596}, { 0.091345, 0.190871}, { 0.019506, 0.037266}, + {-0.050702, -0.013223}, {-0.057334, 0.028943}, { 0.291512, 0.371415}, + {-0.053467, 0.084160}, { 0.025372, 0.375310}, { 0.269995, 0.566520}, + {-0.095259, -0.012353}, { 0.050479, 0.212893}, { 0.101219, 0.049320}, + { 0.072426, 0.283362}, {-0.084116, -0.150542}, {-0.031485, 0.144922}, + { 0.012714, 0.256910}, {-0.009528, 0.102768}, {-0.039572, 0.204967}, + {-0.098800, 0.055038}, { 0.020719, 0.128387}, {-0.045559, -0.178373}, + {-0.082338, 0.136933}, {-0.058270, 0.292806}, { 0.084242, 0.505112}, + { 0.121825, 0.326386}, {-0.102658, -0.069341}, { 0.071675, 0.004744}, + {-0.117763, -0.202608} +}; + +static const float lsf_cb2[128][2] = { + { 0.025412, 0.006095}, {-0.069803, 0.010650}, {-0.175957, -0.185800}, + {-0.139298, -0.048013}, {-0.156150, -0.129688}, {-0.160523, 0.068022}, + { 0.199683, 0.259982}, { 0.258038, 0.236147}, { 0.367089, 0.304716}, + { 0.251764, 0.305853}, { 0.394314, 0.382153}, { 0.448579, 0.337438}, + { 0.323286, 0.425563}, { 0.015369, 0.123820}, {-0.026770, 0.083881}, + {-0.112161, -0.097993}, {-0.221847, -0.161311}, {-0.050014, -0.092862}, + {-0.214960, -0.398498}, {-0.114062, -0.241381}, { 0.137950, 0.138852}, + { 0.031529, 0.065719}, { 0.208734, 0.084760}, { 0.157862, 0.057535}, + { 0.124750, 0.011922}, {-0.035227, -0.154397}, {-0.105523, -0.291427}, + {-0.073488, -0.201948}, {-0.224184, -0.273290}, {-0.168019, -0.240297}, + {-0.271591, -0.384682}, {-0.124784, 0.014253}, { 0.004210, -0.110418}, + { 0.074270, -0.014272}, { 0.053058, -0.068672}, {-0.090098, -0.145019}, + { 0.303214, 0.210323}, { 0.413443, 0.272002}, { 0.356904, 0.230646}, + {-0.035186, -0.028579}, {-0.117558, 0.115105}, {-0.159225, 0.218385}, + {-0.230178, 0.172901}, {-0.216148, -0.110195}, { 0.309444, 0.101508}, + { 0.250489, 0.118338}, { 0.293324, 0.151205}, {-0.023634, 0.033084}, + { 0.076708, 0.114024}, { 0.123119, 0.087704}, {-0.060265, 0.126543}, + {-0.223766, -0.021903}, {-0.241987, -0.328089}, { 0.205598, 0.147925}, + {-0.087010, 0.064601}, {-0.287892, -0.286099}, {-0.179451, -0.350781}, + {-0.219572, 0.043816}, {-0.217263, 0.245550}, {-0.286743, -0.180981}, + { 0.172659, 0.112620}, {-0.105422, 0.176856}, { 0.006176, -0.051491}, + { 0.099802, 0.176322}, {-0.186620, -0.068980}, { 0.164689, 0.185018}, + { 0.519877, 0.376111}, { 0.521941, 0.533731}, { 0.473375, 0.439534}, + { 0.214235, 0.202476}, { 0.579215, 0.466969}, { 0.310414, 0.271057}, + { 0.257450, 0.058939}, { 0.023936, -0.169464}, {-0.268817, -0.064531}, + {-0.174182, -0.000198}, {-0.268405, -0.234529}, {-0.296522, 0.247140}, + { 0.115950, -0.072194}, {-0.303666, 0.149084}, {-0.347762, -0.011002}, + {-0.223829, -0.214137}, {-0.278958, -0.457975}, { 0.135500, 0.238466}, + { 0.312730, 0.342760}, { 0.071754, -0.125912}, { 0.485938, 0.260429}, + { 0.037536, 0.179771}, { 0.391493, 0.156938}, { 0.397320, 0.484446}, + {-0.308630, -0.342418}, {-0.269599, -0.128453}, {-0.086683, -0.043863}, + { 0.421115, 0.213521}, { 0.082417, 0.049006}, {-0.087873, 0.238126}, + { 0.338899, 0.166131}, {-0.166988, 0.147105}, {-0.167214, -0.294075}, + { 0.588706, 0.328303}, { 0.207270, 0.017671}, {-0.141658, 0.291147}, + {-0.140850, 0.374321}, { 0.028180, 0.322510}, {-0.229858, 0.328036}, + {-0.060743, -0.260916}, {-0.011131, 0.246442}, {-0.058151, 0.310760}, + {-0.127536, -0.186432}, {-0.128523, -0.334884}, {-0.283899, 0.077729}, + {-0.031595, 0.181015}, {-0.329330, -0.108630}, {-0.215739, 0.107458}, + { 0.175734, 0.327134}, { 0.255801, 0.176077}, { 0.228265, 0.396859}, + {-0.370909, -0.185081}, {-0.355138, -0.300405}, { 0.061669, 0.242616}, + { 0.104489, 0.307995}, {-0.320021, -0.234002}, { 0.077349, 0.416286}, + {-0.339471, -0.407609}, {-0.019384, -0.215111}, { 0.168229, -0.032453}, + {-0.040140, 0.399658}, {-0.275141, 0.008218} +}; + +static const float lsf_cb3[128][2] = { + { 0.024608, 0.006198}, {-0.216616, -0.398169}, {-0.089601, -0.201370}, + {-0.121878, -0.305281}, { 0.037913, 0.059320}, { 0.245126, 0.244089}, + { 0.266853, 0.182476}, { 0.319362, 0.203481}, { 0.349945, 0.252644}, + { 0.393849, 0.279272}, { 0.445707, 0.258063}, { 0.387321, 0.200855}, + {-0.038818, 0.129603}, {-0.009510, 0.076441}, {-0.023892, -0.028199}, + {-0.117134, -0.145990}, {-0.186585, -0.052886}, {-0.034250, -0.084547}, + {-0.087443, -0.095426}, {-0.453322, -0.174493}, {-0.363975, -0.148186}, + {-0.334413, -0.202479}, {-0.221313, -0.181320}, {-0.131146, -0.050611}, + {-0.104706, 0.115139}, { 0.192765, 0.275417}, { 0.014184, 0.194251}, + { 0.154215, 0.226949}, { 0.084031, 0.221759}, { 0.189438, 0.164566}, + { 0.130737, 0.170962}, {-0.066815, 0.062954}, {-0.177176, -0.145167}, + {-0.247608, -0.129767}, {-0.187886, -0.293720}, {-0.244036, -0.344655}, + {-0.203063, -0.234947}, {-0.292715, -0.158421}, { 0.064990, -0.028164}, + { 0.147664, 0.085995}, { 0.107977, 0.002253}, { 0.071286, 0.027533}, + { 0.021017, -0.049807}, {-0.272056, -0.217857}, {-0.065596, 0.008375}, + {-0.150818, -0.195514}, {-0.012767, -0.150787}, { 0.238541, 0.136606}, + { 0.291741, 0.114024}, { 0.202677, 0.103701}, { 0.140985, 0.037759}, + {-0.257347, -0.442383}, {-0.320666, -0.319742}, {-0.488725, -0.603660}, + {-0.319170, -0.469806}, { 0.014970, -0.101074}, { 0.102209, 0.066790}, + {-0.076202, -0.044884}, { 0.073868, 0.152565}, { 0.070755, -0.091358}, + {-0.016751, 0.027216}, { 0.071201, 0.096981}, {-0.060975, -0.145638}, + { 0.114156, 0.117587}, {-0.284757, -0.029101}, {-0.253005, -0.073645}, + {-0.204028, -0.098492}, {-0.114508, 0.001219}, {-0.225284, -0.011998}, + {-0.235670, 0.084330}, { 0.161921, 0.128334}, { 0.025717, 0.119456}, + {-0.255292, -0.281471}, {-0.392803, -0.095809}, { 0.039229, -0.152110}, + {-0.310905, -0.099233}, {-0.268773, 0.032308}, {-0.340150, 0.013129}, + {-0.344890, -0.045157}, {-0.188423, 0.265603}, {-0.168235, -0.000936}, + { 0.000462, 0.297000}, { 0.263674, 0.371214}, {-0.146797, -0.098225}, + {-0.386557, -0.282426}, {-0.070940, -0.255550}, { 0.293258, 0.252785}, + { 0.408332, 0.387751}, {-0.381914, -0.358918}, {-0.463621, -0.315560}, + {-0.323681, -0.258465}, { 0.250055, 0.071195}, {-0.405256, -0.429754}, + {-0.135748, -0.251274}, { 0.186827, 0.060177}, { 0.116742, -0.053526}, + {-0.403321, -0.220339}, {-0.414144, -0.021108}, {-0.416877, 0.050184}, + {-0.470083, -0.079564}, {-0.315554, 0.219217}, {-0.273183, 0.138437}, + { 0.253231, 0.306374}, { 0.177802, 0.346298}, { 0.210358, 0.207697}, + {-0.323480, 0.077519}, {-0.193136, 0.048170}, { 0.114492, 0.292778}, + {-0.130766, 0.056677}, {-0.171572, -0.349267}, {-0.370076, -0.536392}, + {-0.311109, -0.389953}, { 0.334928, 0.367664}, { 0.351246, 0.438664}, + { 0.518803, 0.331253}, { 0.437061, 0.327257}, { 0.318906, 0.307389}, + {-0.025972, -0.206758}, { 0.373278, 0.325438}, { 0.473488, 0.389441}, + { 0.478553, 0.477990}, { 0.332783, 0.153825}, { 0.212098, 0.452336}, + { 0.161522, -0.011212}, { 0.209368, 0.020687}, {-0.086262, 0.204493}, + {-0.388643, 0.133640}, {-0.177016, 0.134404} +}; + +static const float lsf_cb4[128][2] = { + {-0.003594, -0.022447}, { 0.070651, 0.028334}, {-0.290374, -0.018347}, + {-0.224495, -0.370312}, {-0.269555, -0.131227}, {-0.122714, -0.267733}, + { 0.173325, 0.138698}, { 0.161946, 0.020687}, { 0.111706, 0.022510}, + { 0.097638, 0.056049}, { 0.139754, 0.059920}, { 0.056549, -0.050586}, + { 0.036301, 0.021501}, {-0.066347, 0.012324}, {-0.066972, 0.096136}, + {-0.120062, -0.084201}, { 0.011225, 0.047425}, {-0.012846, -0.067390}, + {-0.116201, 0.122874}, {-0.027819, 0.035453}, {-0.024743, 0.072835}, + {-0.034061, -0.001310}, { 0.077469, 0.081609}, { 0.128347, 0.139584}, + { 0.183416, 0.086563}, {-0.155839, -0.053775}, {-0.190403, -0.018639}, + {-0.202548, -0.062841}, {-0.373733, -0.275094}, {-0.394260, -0.186513}, + {-0.465700, -0.220031}, { 0.064400, -0.095825}, {-0.262053, -0.199837}, + {-0.167233, -0.094402}, { 0.048600, 0.057567}, {-0.007122, 0.168506}, + { 0.050938, 0.156451}, {-0.060828, 0.147083}, {-0.171889, 0.195822}, + {-0.218934, 0.138431}, {-0.270532, 0.195775}, {-0.405818, 0.075643}, + {-0.440187, 0.193387}, {-0.484968, 0.157607}, {-0.480560, 0.067230}, + {-0.436757, -0.111847}, {-0.040731, -0.040363}, {-0.202319, -0.170457}, + {-0.158515, -0.134551}, {-0.356709, -0.378549}, {-0.268820, -0.289831}, + {-0.188486, -0.289306}, {-0.148139, -0.177616}, {-0.071591, -0.191128}, + {-0.052270, -0.150589}, {-0.020543, -0.116220}, { 0.039584, -0.012592}, + {-0.268226, 0.042704}, {-0.209755, 0.069423}, {-0.168964, 0.124504}, + {-0.363240, 0.188266}, {-0.524935, -0.025010}, {-0.105894, -0.002699}, + {-0.251830, -0.062018}, {-0.310480, -0.082325}, { 0.014652, 0.083127}, + {-0.136512, 0.033116}, {-0.073755, -0.025236}, { 0.110766, 0.095954}, + { 0.002878, 0.011838}, {-0.074977, -0.244586}, {-0.047023, -0.081339}, + {-0.183249, 0.029525}, { 0.263435, 0.206934}, {-0.156721, -0.229993}, + {-0.112224, -0.208941}, {-0.116534, -0.123191}, {-0.073988, -0.111668}, + { 0.029484, -0.137573}, {-0.009802, -0.161685}, {-0.023273, 0.114043}, + {-0.332651, 0.049072}, {-0.394009, 0.018608}, {-0.433543, -0.035318}, + {-0.368459, -0.108024}, {-0.350215, -0.037617}, {-0.321140, -0.178537}, + { 0.020307, -0.048487}, {-0.210512, -0.232274}, {-0.082140, -0.065443}, + { 0.081961, -0.009340}, { 0.146794, 0.101973}, { 0.213999, 0.124687}, + { 0.100217, -0.054095}, {-0.114411, -0.041403}, {-0.097631, 0.037061}, + {-0.099651, -0.157978}, {-0.215790, -0.116550}, {-0.107100, 0.076300}, + { 0.084653, 0.126088}, { 0.246439, 0.091442}, { 0.160077, 0.188536}, + { 0.273900, 0.279190}, { 0.320417, 0.232550}, { 0.132710, -0.018988}, + { 0.018950, -0.091681}, {-0.032073, -0.202906}, { 0.212789, 0.178188}, + { 0.208580, 0.239726}, { 0.049420, 0.099840}, {-0.145695, -0.010619}, + {-0.132525, -0.322660}, { 0.019666, 0.126603}, { 0.260809, 0.147727}, + {-0.232795, -0.001090}, {-0.049826, 0.225987}, {-0.154774, 0.076614}, + { 0.045032, 0.221397}, { 0.321014, 0.161632}, {-0.062379, 0.053586}, + { 0.132252, 0.246675}, { 0.392627, 0.271905}, {-0.264585, 0.102344}, + {-0.327200, 0.121624}, {-0.399642, 0.124445}, {-0.108335, 0.179171}, + { 0.100374, 0.182731}, { 0.203852, 0.049505} +}; + +static const float lsf_cb5[32][2] = { + {-0.047705, 0.008002}, { 0.011332, 0.065028}, {-0.021796, -0.034777}, + {-0.147394, -0.001241}, {-0.001577, 0.020599}, {-0.083827, -0.028975}, + {-0.177707, 0.066046}, {-0.043241, -0.165144}, { 0.053322, 0.096519}, + {-0.097688, 0.106484}, {-0.023392, 0.111234}, {-0.146747, -0.159360}, + { 0.027241, -0.011806}, {-0.043156, 0.057667}, { 0.019516, -0.062116}, + { 0.025990, 0.162533}, { 0.091888, 0.009720}, {-0.098511, 0.036414}, + { 0.013722, -0.116512}, { 0.054833, -0.180975}, { 0.119497, 0.128774}, + { 0.118378, -0.125997}, { 0.065882, -0.030932}, { 0.120581, -0.039964}, + {-0.050561, -0.088577}, { 0.050134, 0.033194}, {-0.129654, -0.075112}, + {-0.225334, -0.040234}, { 0.070629, -0.084455}, { 0.095508, 0.063548}, + { 0.150514, 0.034366}, { 0.186092, -0.069272} +}; + +static const float * const lsf_codebooks[] = { + lsf_cb1[0], lsf_cb2[0], lsf_cb3[0], lsf_cb4[0], lsf_cb5[0] +}; + +static const float gain_cb[128][2] = { + {0.035230, 0.161540}, {0.049223, 0.448359}, {0.057443, 0.809043}, + {0.072434, 1.760306}, {0.111491, 0.566418}, {0.112820, 1.098524}, + {0.143493, 0.726856}, {0.144840, 0.347800}, {0.180341, 1.050010}, + {0.188171, 2.197256}, {0.189771, 0.256947}, {0.198260, 0.484678}, + {0.210622, 0.755825}, {0.220694, 0.590788}, {0.237062, 1.322214}, + {0.255175, 0.338710}, {0.298980, 0.919051}, {0.314627, 0.520961}, + {0.337106, 1.469863}, {0.341422, 2.804546}, {0.363257, 0.736222}, + {0.363881, 0.367640}, {0.369850, 1.937934}, {0.370136, 1.075201}, + {0.397152, 0.549410}, {0.426557, 0.876015}, {0.450686, 0.215588}, + {0.468116, 0.671848}, {0.470495, 1.242034}, {0.474180, 1.739845}, + {0.484875, 0.490564}, {0.498917, 0.971238}, {0.530996, 0.785765}, + {0.539768, 2.130689}, {0.546021, 0.589544}, {0.546632, 3.050846}, + {0.552336, 0.389775}, {0.556302, 1.400103}, {0.559688, 1.105421}, + {0.574140, 0.667513}, {0.595547, 0.828943}, {0.597771, 0.496929}, + {0.617079, 1.863075}, {0.619657, 1.221713}, {0.621172, 0.950275}, + {0.628426, 0.630766}, {0.628689, 4.242164}, {0.640899, 1.529846}, + {0.645813, 0.331127}, {0.653056, 0.748168}, {0.662909, 1.077438}, + {0.669505, 2.631114}, {0.681570, 1.839298}, {0.687844, 0.903400}, + {0.688660, 1.270830}, {0.695070, 0.578227}, {0.697926, 0.428440}, + {0.715454, 0.812355}, {0.729981, 1.539357}, {0.737434, 1.106765}, + {0.740241, 2.033374}, {0.740871, 0.568460}, {0.752689, 0.698461}, + {0.756587, 0.893078}, {0.767797, 0.499246}, {0.768516, 3.712434}, + {0.773153, 1.332360}, {0.786125, 1.042996}, {0.788792, 0.238388}, + {0.790861, 2.273229}, {0.795338, 1.582767}, {0.809621, 0.595501}, + {0.821032, 0.756460}, {0.824590, 0.922925}, {0.826019, 1.186793}, + {0.827426, 1.885076}, {0.830080, 6.088666}, {0.837028, 2.819993}, + {0.845561, 1.490623}, {0.848323, 0.410436}, {0.856522, 0.729725}, + {0.862636, 0.966880}, {0.874561, 1.681660}, {0.874751, 1.177630}, + {0.879289, 2.301300}, {0.886671, 0.613068}, {0.896729, 0.781097}, + {0.904777, 3.484111}, {0.906098, 1.330892}, {0.919182, 1.877203}, + {0.919901, 0.569511}, {0.921772, 1.034126}, {0.922439, 0.376000}, + {0.934221, 1.485214}, {0.938842, 0.869135}, {0.939166, 2.378294}, + {0.958933, 1.122722}, {0.959042, 0.694098}, {0.960995, 1.743430}, + {0.970763, 2.884897}, {0.982881, 0.814506}, {0.990141, 1.330022}, + {0.996447, 1.823381}, {1.000013, 0.967498}, {1.000743, 0.480597}, + {1.008020, 5.095226}, {1.013883, 2.105435}, {1.026438, 0.691312}, + {1.027361, 1.558169}, {1.030123, 3.586526}, {1.033916, 1.118036}, + {1.039315, 2.543360}, {1.068596, 0.836380}, {1.081023, 1.318768}, + {1.093150, 2.267843}, {1.095607, 1.712383}, {1.102816, 1.037334}, + {1.103231, 3.536292}, {1.107320, 0.508615}, {1.150000, 7.999000}, + {1.156731, 1.236772}, {1.168428, 2.268084}, {1.184130, 0.775839}, + {1.210609, 1.511840}, {1.220663, 4.365683}, {1.224016, 0.983179}, + {1.252236, 2.778535}, {1.301176, 1.923126} +}; + +static const float pred[4] = { + 0.200, 0.334, 0.504, 0.691 +}; + +#endif /* AVCODEC_SIPRDATA_H */ diff --git a/include/libavcodec/snappy.h b/include/libavcodec/snappy.h new file mode 100644 index 0000000..a65cb3a --- /dev/null +++ b/include/libavcodec/snappy.h @@ -0,0 +1,60 @@ +/* + * Snappy module + * Copyright (c) Luca Barbato + * + * 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 + */ + +/** + * @file + * Snappy decompression + * + * Snappy is a compression/decompression algorithm that does not aim for + * maximum compression, but rather for very high speeds and reasonable + * compression. + * + * http://en.wikipedia.org/wiki/Snappy_%28software%29 + */ + +#ifndef AVCODEC_SNAPPY_H +#define AVCODEC_SNAPPY_H + +#include + +#include "bytestream.h" + +/** + * Get the uncompressed length of an input buffer compressed using the Snappy + * algorithm. The GetByteContext is not advanced. + * + * @param gb input GetByteContext. + * @return A positive length on success, AVERROR otherwise. + */ + int64_t ff_snappy_peek_uncompressed_length(GetByteContext *gb); + +/** + * Decompress an input buffer using Snappy algorithm. + * + * @param gb input GetByteContext. + * @param buf input buffer pointer. + * @param size input/output on input, the size of buffer, on output, the size + * of the uncompressed data. + * @return 0 if success, AVERROR otherwise. + */ +int ff_snappy_uncompress(GetByteContext *gb, uint8_t *buf, int64_t *size); + +#endif /* AVCODEC_SNAPPY_H */ diff --git a/include/libavcodec/snow.h b/include/libavcodec/snow.h new file mode 100644 index 0000000..a5e2c13 --- /dev/null +++ b/include/libavcodec/snow.h @@ -0,0 +1,431 @@ +/* + * Copyright (C) 2004 Michael Niedermayer + * Copyright (C) 2006 Robert Edele + * + * 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_SNOW_H +#define AVCODEC_SNOW_H + +#include "libavutil/motion_vector.h" + +#include "avcodec.h" +#include "hpeldsp.h" +#include "snow_dwt.h" + +#include "rangecoder.h" +#include "mathops.h" + +#include "h264qpel.h" +#include "videodsp.h" + +#define SNOW_MAX_PLANES 4 + +#define MID_STATE 128 + +#define MAX_PLANES 4 +#define QSHIFT 5 +#define QROOT (1<ref_frames == 1){ + *mx = mid_pred(left->mx, top->mx, tr->mx); + *my = mid_pred(left->my, top->my, tr->my); + }else{ + const int *scale = ff_scale_mv_ref[ref]; + *mx = mid_pred((left->mx * scale[left->ref] + 128) >>8, + (top ->mx * scale[top ->ref] + 128) >>8, + (tr ->mx * scale[tr ->ref] + 128) >>8); + *my = mid_pred((left->my * scale[left->ref] + 128) >>8, + (top ->my * scale[top ->ref] + 128) >>8, + (tr ->my * scale[tr ->ref] + 128) >>8); + } +} + +static av_always_inline int same_block(BlockNode *a, BlockNode *b){ + if((a->type&BLOCK_INTRA) && (b->type&BLOCK_INTRA)){ + return !((a->color[0] - b->color[0]) | (a->color[1] - b->color[1]) | (a->color[2] - b->color[2])); + }else{ + return !((a->mx - b->mx) | (a->my - b->my) | (a->ref - b->ref) | ((a->type ^ b->type)&BLOCK_INTRA)); + } +} + +//FIXME name cleanup (b_w, block_w, b_width stuff) +//XXX should we really inline it? +static av_always_inline void add_yblock(SnowContext *s, int sliced, slice_buffer *sb, IDWTELEM *dst, uint8_t *dst8, const uint8_t *obmc, int src_x, int src_y, int b_w, int b_h, int w, int h, int dst_stride, int src_stride, int obmc_stride, int b_x, int b_y, int add, int offset_dst, int plane_index){ + const int b_width = s->b_width << s->block_max_depth; + const int b_height= s->b_height << s->block_max_depth; + const int b_stride= b_width; + BlockNode *lt= &s->block[b_x + b_y*b_stride]; + BlockNode *rt= lt+1; + BlockNode *lb= lt+b_stride; + BlockNode *rb= lb+1; + uint8_t *block[4]; + // When src_stride is large enough, it is possible to interleave the blocks. + // Otherwise the blocks are written sequentially in the tmp buffer. + int tmp_step= src_stride >= 7*MB_SIZE ? MB_SIZE : MB_SIZE*src_stride; + uint8_t *tmp = s->scratchbuf; + uint8_t *ptmp; + int x,y; + + if(b_x<0){ + lt= rt; + lb= rb; + }else if(b_x + 1 >= b_width){ + rt= lt; + rb= lb; + } + if(b_y<0){ + lt= lb; + rt= rb; + }else if(b_y + 1 >= b_height){ + lb= lt; + rb= rt; + } + + if(src_x<0){ //FIXME merge with prev & always round internal width up to *16 + obmc -= src_x; + b_w += src_x; + if(!sliced && !offset_dst) + dst -= src_x; + src_x=0; + } + if(src_x + b_w > w){ + b_w = w - src_x; + } + if(src_y<0){ + obmc -= src_y*obmc_stride; + b_h += src_y; + if(!sliced && !offset_dst) + dst -= src_y*dst_stride; + src_y=0; + } + if(src_y + b_h> h){ + b_h = h - src_y; + } + + if(b_w<=0 || b_h<=0) return; + + if(!sliced && offset_dst) + dst += src_x + src_y*dst_stride; + dst8+= src_x + src_y*src_stride; +// src += src_x + src_y*src_stride; + + ptmp= tmp + 3*tmp_step; + block[0]= ptmp; + ptmp+=tmp_step; + ff_snow_pred_block(s, block[0], tmp, src_stride, src_x, src_y, b_w, b_h, lt, plane_index, w, h); + + if(same_block(lt, rt)){ + block[1]= block[0]; + }else{ + block[1]= ptmp; + ptmp+=tmp_step; + ff_snow_pred_block(s, block[1], tmp, src_stride, src_x, src_y, b_w, b_h, rt, plane_index, w, h); + } + + if(same_block(lt, lb)){ + block[2]= block[0]; + }else if(same_block(rt, lb)){ + block[2]= block[1]; + }else{ + block[2]= ptmp; + ptmp+=tmp_step; + ff_snow_pred_block(s, block[2], tmp, src_stride, src_x, src_y, b_w, b_h, lb, plane_index, w, h); + } + + if(same_block(lt, rb) ){ + block[3]= block[0]; + }else if(same_block(rt, rb)){ + block[3]= block[1]; + }else if(same_block(lb, rb)){ + block[3]= block[2]; + }else{ + block[3]= ptmp; + ff_snow_pred_block(s, block[3], tmp, src_stride, src_x, src_y, b_w, b_h, rb, plane_index, w, h); + } + if(sliced){ + s->dwt.inner_add_yblock(obmc, obmc_stride, block, b_w, b_h, src_x,src_y, src_stride, sb, add, dst8); + }else{ + for(y=0; y>1); + const uint8_t *obmc3= obmc1+ obmc_stride*(obmc_stride>>1); + const uint8_t *obmc4= obmc3+ (obmc_stride>>1); + for(x=0; x>= 8 - FRAC_BITS; + } + if(add){ + v += dst[x + y*dst_stride]; + v = (v + (1<<(FRAC_BITS-1))) >> FRAC_BITS; + if(v&(~255)) v= ~(v>>31); + dst8[x + y*src_stride] = v; + }else{ + dst[x + y*dst_stride] -= v; + } + } + } + } +} + +static av_always_inline void predict_slice(SnowContext *s, IDWTELEM *buf, int plane_index, int add, int mb_y){ + Plane *p= &s->plane[plane_index]; + const int mb_w= s->b_width << s->block_max_depth; + const int mb_h= s->b_height << s->block_max_depth; + int x, y, mb_x; + int block_size = MB_SIZE >> s->block_max_depth; + int block_w = plane_index ? block_size>>s->chroma_h_shift : block_size; + int block_h = plane_index ? block_size>>s->chroma_v_shift : block_size; + const uint8_t *obmc = plane_index ? ff_obmc_tab[s->block_max_depth+s->chroma_h_shift] : ff_obmc_tab[s->block_max_depth]; + const int obmc_stride= plane_index ? (2*block_size)>>s->chroma_h_shift : 2*block_size; + int ref_stride= s->current_picture->linesize[plane_index]; + uint8_t *dst8= s->current_picture->data[plane_index]; + int w= p->width; + int h= p->height; + av_assert2(s->chroma_h_shift == s->chroma_v_shift); // obmc params assume squares + if(s->keyframe || (s->avctx->debug&512)){ + if(mb_y==mb_h) + return; + + if(add){ + for(y=block_h*mb_y; y>= FRAC_BITS; + if(v&(~255)) v= ~(v>>31); + dst8[x + y*ref_stride]= v; + } + } + }else{ + for(y=block_h*mb_y; yb_height << s->block_max_depth; + int mb_y; + for(mb_y=0; mb_y<=mb_h; mb_y++) + predict_slice(s, buf, plane_index, add, mb_y); +} + +static inline void set_blocks(SnowContext *s, int level, int x, int y, int l, int cb, int cr, int mx, int my, int ref, int type){ + const int w= s->b_width << s->block_max_depth; + const int rem_depth= s->block_max_depth - level; + const int index= (x + y*w) << rem_depth; + const int block_w= 1<block[index + i + j*w]= block; + } + } +} + +extern const int8_t ff_quant3bA[256]; + +#define QEXPSHIFT (7-FRAC_BITS+8) //FIXME try to change this to 0 + +#endif /* AVCODEC_SNOW_H */ diff --git a/include/libavcodec/snow_dwt.h b/include/libavcodec/snow_dwt.h new file mode 100644 index 0000000..6e7d22c --- /dev/null +++ b/include/libavcodec/snow_dwt.h @@ -0,0 +1,166 @@ +/* + * Copyright (C) 2004-2010 Michael Niedermayer + * + * 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_SNOW_DWT_H +#define AVCODEC_SNOW_DWT_H + +#include +#include + +#include "libavutil/attributes.h" + +struct MpegEncContext; + +typedef int DWTELEM; +typedef short IDWTELEM; + +#define MAX_DECOMPOSITIONS 8 + +typedef struct DWTCompose { + IDWTELEM *b0; + IDWTELEM *b1; + IDWTELEM *b2; + IDWTELEM *b3; + int y; +} DWTCompose; + +/** Used to minimize the amount of memory used in order to + * optimize cache performance. **/ +typedef struct slice_buffer_s { + IDWTELEM **line; ///< For use by idwt and predict_slices. + IDWTELEM **data_stack; ///< Used for internal purposes. + int data_stack_top; + int line_count; + int line_width; + int data_count; + IDWTELEM *base_buffer; ///< Buffer that this structure is caching. +} slice_buffer; + +struct SnowDWTContext; + +typedef struct SnowDWTContext { + void (*vertical_compose97i)(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, + IDWTELEM *b3, IDWTELEM *b4, IDWTELEM *b5, + int width); + void (*horizontal_compose97i)(IDWTELEM *b, IDWTELEM *temp, int width); + void (*inner_add_yblock)(const uint8_t *obmc, const int obmc_stride, + uint8_t **block, int b_w, int b_h, int src_x, + int src_y, int src_stride, slice_buffer *sb, + int add, uint8_t *dst8); +} SnowDWTContext; + + +#define DWT_97 0 +#define DWT_53 1 + +#define liftS lift +#define W_AM 3 +#define W_AO 0 +#define W_AS 1 + +#undef liftS +#define W_BM 1 +#define W_BO 8 +#define W_BS 4 + +#define W_CM 1 +#define W_CO 0 +#define W_CS 0 + +#define W_DM 3 +#define W_DO 4 +#define W_DS 3 + +#define slice_buffer_get_line(slice_buf, line_num) \ + ((slice_buf)->line[line_num] ? (slice_buf)->line[line_num] \ + : ff_slice_buffer_load_line((slice_buf), \ + (line_num))) + +/* C bits used by mmx/sse2/altivec */ + +static av_always_inline void snow_interleave_line_header(int *i, int width, IDWTELEM *low, IDWTELEM *high) +{ + *i = width - 2; + + if (width & 1) { + low[*i + 1] = low[(*i + 1)>>1]; + (*i)--; + } +} + +static av_always_inline void snow_interleave_line_footer(int *i, IDWTELEM *low, const IDWTELEM *high) +{ + for (; *i >= 0; *i -= 2) { + low[*i + 1] = high[*i >> 1]; + low[*i] = low[*i >> 1]; + } +} + +static av_always_inline void snow_horizontal_compose_lift_lead_out(int i, IDWTELEM *dst, const IDWTELEM *src, const IDWTELEM *ref, int width, int w, int lift_high, int mul, int add, int shift) +{ + for (; i < w; i++) + dst[i] = src[i] - ((mul * (ref[i] + ref[i + 1]) + add) >> shift); + + if ((width ^ lift_high) & 1) + dst[w] = src[w] - ((mul * 2 * ref[w] + add) >> shift); +} + +static av_always_inline void snow_horizontal_compose_liftS_lead_out(int i, IDWTELEM *dst, const IDWTELEM *src, const IDWTELEM *ref, int width, int w) +{ + for (; i < w; i++) + dst[i] = src[i] + ((ref[i] + ref[(i+1)]+W_BO + 4 * src[i]) >> W_BS); + + if (width & 1) + dst[w] = src[w] + ((2 * ref[w] + W_BO + 4 * src[w]) >> W_BS); +} + +int ff_slice_buffer_init(slice_buffer *buf, int line_count, + int max_allocated_lines, int line_width, + IDWTELEM *base_buffer); +void ff_slice_buffer_release(slice_buffer *buf, int line); +void ff_slice_buffer_flush(slice_buffer *buf); +void ff_slice_buffer_destroy(slice_buffer *buf); +IDWTELEM *ff_slice_buffer_load_line(slice_buffer *buf, int line); + +void ff_snow_inner_add_yblock(const uint8_t *obmc, const int obmc_stride, + uint8_t **block, int b_w, int b_h, int src_x, + int src_y, int src_stride, slice_buffer *sb, + int add, uint8_t *dst8); + +int ff_w53_32_c(struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t line_size, int h); +int ff_w97_32_c(struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t line_size, int h); + +void ff_spatial_dwt(int *buffer, int *temp, int width, int height, int stride, + int type, int decomposition_count); + +void ff_spatial_idwt_buffered_init(DWTCompose *cs, slice_buffer *sb, int width, + int height, int stride_line, int type, + int decomposition_count); +void ff_spatial_idwt_buffered_slice(SnowDWTContext *dsp, DWTCompose *cs, + slice_buffer *slice_buf, IDWTELEM *temp, + int width, int height, int stride_line, + int type, int decomposition_count, int y); +void ff_spatial_idwt(IDWTELEM *buffer, IDWTELEM *temp, int width, int height, + int stride, int type, int decomposition_count); + +void ff_dwt_init(SnowDWTContext *c); +void ff_dwt_init_x86(SnowDWTContext *c); + +#endif /* AVCODEC_DWT_H */ diff --git a/include/libavcodec/snowdata.h b/include/libavcodec/snowdata.h new file mode 100644 index 0000000..ca0c1e3 --- /dev/null +++ b/include/libavcodec/snowdata.h @@ -0,0 +1,138 @@ +/* + * Copyright (C) 2004 Michael Niedermayer + * Copyright (C) 2006 Robert Edele + * + * 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_SNOWDATA_H +#define AVCODEC_SNOWDATA_H + +#include "snow.h" + +static const uint8_t obmc32[1024]={ + 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, + 0, 4, 4, 4, 8, 8, 8, 12, 12, 16, 16, 16, 20, 20, 20, 24, 24, 20, 20, 20, 16, 16, 16, 12, 12, 8, 8, 8, 4, 4, 4, 0, + 0, 4, 8, 8, 12, 12, 16, 20, 20, 24, 28, 28, 32, 32, 36, 40, 40, 36, 32, 32, 28, 28, 24, 20, 20, 16, 12, 12, 8, 8, 4, 0, + 0, 4, 8, 12, 16, 20, 24, 28, 28, 32, 36, 40, 44, 48, 52, 56, 56, 52, 48, 44, 40, 36, 32, 28, 28, 24, 20, 16, 12, 8, 4, 0, + 4, 8, 12, 16, 20, 24, 28, 32, 40, 44, 48, 52, 56, 60, 64, 68, 68, 64, 60, 56, 52, 48, 44, 40, 32, 28, 24, 20, 16, 12, 8, 4, + 4, 8, 12, 20, 24, 32, 36, 40, 48, 52, 56, 64, 68, 76, 80, 84, 84, 80, 76, 68, 64, 56, 52, 48, 40, 36, 32, 24, 20, 12, 8, 4, + 4, 8, 16, 24, 28, 36, 44, 48, 56, 60, 68, 76, 80, 88, 96,100,100, 96, 88, 80, 76, 68, 60, 56, 48, 44, 36, 28, 24, 16, 8, 4, + 4, 12, 20, 28, 32, 40, 48, 56, 64, 72, 80, 88, 92,100,108,116,116,108,100, 92, 88, 80, 72, 64, 56, 48, 40, 32, 28, 20, 12, 4, + 4, 12, 20, 28, 40, 48, 56, 64, 72, 80, 88, 96,108,116,124,132,132,124,116,108, 96, 88, 80, 72, 64, 56, 48, 40, 28, 20, 12, 4, + 4, 16, 24, 32, 44, 52, 60, 72, 80, 92,100,108,120,128,136,148,148,136,128,120,108,100, 92, 80, 72, 60, 52, 44, 32, 24, 16, 4, + 4, 16, 28, 36, 48, 56, 68, 80, 88,100,112,120,132,140,152,164,164,152,140,132,120,112,100, 88, 80, 68, 56, 48, 36, 28, 16, 4, + 4, 16, 28, 40, 52, 64, 76, 88, 96,108,120,132,144,156,168,180,180,168,156,144,132,120,108, 96, 88, 76, 64, 52, 40, 28, 16, 4, + 8, 20, 32, 44, 56, 68, 80, 92,108,120,132,144,156,168,180,192,192,180,168,156,144,132,120,108, 92, 80, 68, 56, 44, 32, 20, 8, + 8, 20, 32, 48, 60, 76, 88,100,116,128,140,156,168,184,196,208,208,196,184,168,156,140,128,116,100, 88, 76, 60, 48, 32, 20, 8, + 8, 20, 36, 52, 64, 80, 96,108,124,136,152,168,180,196,212,224,224,212,196,180,168,152,136,124,108, 96, 80, 64, 52, 36, 20, 8, + 8, 24, 40, 56, 68, 84,100,116,132,148,164,180,192,208,224,240,240,224,208,192,180,164,148,132,116,100, 84, 68, 56, 40, 24, 8, + 8, 24, 40, 56, 68, 84,100,116,132,148,164,180,192,208,224,240,240,224,208,192,180,164,148,132,116,100, 84, 68, 56, 40, 24, 8, + 8, 20, 36, 52, 64, 80, 96,108,124,136,152,168,180,196,212,224,224,212,196,180,168,152,136,124,108, 96, 80, 64, 52, 36, 20, 8, + 8, 20, 32, 48, 60, 76, 88,100,116,128,140,156,168,184,196,208,208,196,184,168,156,140,128,116,100, 88, 76, 60, 48, 32, 20, 8, + 8, 20, 32, 44, 56, 68, 80, 92,108,120,132,144,156,168,180,192,192,180,168,156,144,132,120,108, 92, 80, 68, 56, 44, 32, 20, 8, + 4, 16, 28, 40, 52, 64, 76, 88, 96,108,120,132,144,156,168,180,180,168,156,144,132,120,108, 96, 88, 76, 64, 52, 40, 28, 16, 4, + 4, 16, 28, 36, 48, 56, 68, 80, 88,100,112,120,132,140,152,164,164,152,140,132,120,112,100, 88, 80, 68, 56, 48, 36, 28, 16, 4, + 4, 16, 24, 32, 44, 52, 60, 72, 80, 92,100,108,120,128,136,148,148,136,128,120,108,100, 92, 80, 72, 60, 52, 44, 32, 24, 16, 4, + 4, 12, 20, 28, 40, 48, 56, 64, 72, 80, 88, 96,108,116,124,132,132,124,116,108, 96, 88, 80, 72, 64, 56, 48, 40, 28, 20, 12, 4, + 4, 12, 20, 28, 32, 40, 48, 56, 64, 72, 80, 88, 92,100,108,116,116,108,100, 92, 88, 80, 72, 64, 56, 48, 40, 32, 28, 20, 12, 4, + 4, 8, 16, 24, 28, 36, 44, 48, 56, 60, 68, 76, 80, 88, 96,100,100, 96, 88, 80, 76, 68, 60, 56, 48, 44, 36, 28, 24, 16, 8, 4, + 4, 8, 12, 20, 24, 32, 36, 40, 48, 52, 56, 64, 68, 76, 80, 84, 84, 80, 76, 68, 64, 56, 52, 48, 40, 36, 32, 24, 20, 12, 8, 4, + 4, 8, 12, 16, 20, 24, 28, 32, 40, 44, 48, 52, 56, 60, 64, 68, 68, 64, 60, 56, 52, 48, 44, 40, 32, 28, 24, 20, 16, 12, 8, 4, + 0, 4, 8, 12, 16, 20, 24, 28, 28, 32, 36, 40, 44, 48, 52, 56, 56, 52, 48, 44, 40, 36, 32, 28, 28, 24, 20, 16, 12, 8, 4, 0, + 0, 4, 8, 8, 12, 12, 16, 20, 20, 24, 28, 28, 32, 32, 36, 40, 40, 36, 32, 32, 28, 28, 24, 20, 20, 16, 12, 12, 8, 8, 4, 0, + 0, 4, 4, 4, 8, 8, 8, 12, 12, 16, 16, 16, 20, 20, 20, 24, 24, 20, 20, 20, 16, 16, 16, 12, 12, 8, 8, 8, 4, 4, 4, 0, + 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, + //error:0.000020 +}; +static const uint8_t obmc16[256]={ + 0, 4, 4, 8, 8, 12, 12, 16, 16, 12, 12, 8, 8, 4, 4, 0, + 4, 8, 16, 20, 28, 32, 40, 44, 44, 40, 32, 28, 20, 16, 8, 4, + 4, 16, 24, 36, 44, 56, 64, 76, 76, 64, 56, 44, 36, 24, 16, 4, + 8, 20, 36, 48, 64, 76, 92,104,104, 92, 76, 64, 48, 36, 20, 8, + 8, 28, 44, 64, 80,100,116,136,136,116,100, 80, 64, 44, 28, 8, + 12, 32, 56, 76,100,120,144,164,164,144,120,100, 76, 56, 32, 12, + 12, 40, 64, 92,116,144,168,196,196,168,144,116, 92, 64, 40, 12, + 16, 44, 76,104,136,164,196,224,224,196,164,136,104, 76, 44, 16, + 16, 44, 76,104,136,164,196,224,224,196,164,136,104, 76, 44, 16, + 12, 40, 64, 92,116,144,168,196,196,168,144,116, 92, 64, 40, 12, + 12, 32, 56, 76,100,120,144,164,164,144,120,100, 76, 56, 32, 12, + 8, 28, 44, 64, 80,100,116,136,136,116,100, 80, 64, 44, 28, 8, + 8, 20, 36, 48, 64, 76, 92,104,104, 92, 76, 64, 48, 36, 20, 8, + 4, 16, 24, 36, 44, 56, 64, 76, 76, 64, 56, 44, 36, 24, 16, 4, + 4, 8, 16, 20, 28, 32, 40, 44, 44, 40, 32, 28, 20, 16, 8, 4, + 0, 4, 4, 8, 8, 12, 12, 16, 16, 12, 12, 8, 8, 4, 4, 0, +//error:0.000015 +}; + +//linear *64 +static const uint8_t obmc8[64]={ + 4, 12, 20, 28, 28, 20, 12, 4, + 12, 36, 60, 84, 84, 60, 36, 12, + 20, 60,100,140,140,100, 60, 20, + 28, 84,140,196,196,140, 84, 28, + 28, 84,140,196,196,140, 84, 28, + 20, 60,100,140,140,100, 60, 20, + 12, 36, 60, 84, 84, 60, 36, 12, + 4, 12, 20, 28, 28, 20, 12, 4, +//error:0.000000 +}; + +//linear *64 +static const uint8_t obmc4[16]={ + 16, 48, 48, 16, + 48,144,144, 48, + 48,144,144, 48, + 16, 48, 48, 16, +//error:0.000000 +}; + +const int8_t ff_quant3bA[256]={ + 0, 0, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, + 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, + 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, + 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, + 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, + 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, + 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, + 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, + 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, + 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, + 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, + 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, + 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, + 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, + 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, + 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, 1,-1, +}; + +const uint8_t * const ff_obmc_tab[4]= { + obmc32, obmc16, obmc8, obmc4 +}; + +/* ff_qexp[i] = lrintf(128 * 2^(i / QROOT)) with QROOT = 32 */ +const uint8_t ff_qexp[QROOT] = { + 128, 131, 134, 137, 140, 143, 146, 149, 152, 156, 159, + 162, 166, 170, 173, 177, 181, 185, 189, 193, 197, 202, + 206, 211, 215, 220, 225, 230, 235, 240, 245, 251, +}; + +/* table generated at runtime */ +int ff_scale_mv_ref[MAX_REF_FRAMES][MAX_REF_FRAMES]; + + +#endif /* AVCODEC_SNOW_H */ diff --git a/include/libavcodec/sp5x.h b/include/libavcodec/sp5x.h new file mode 100644 index 0000000..d84d851 --- /dev/null +++ b/include/libavcodec/sp5x.h @@ -0,0 +1,148 @@ +/* + * Sunplus JPEG tables + * Copyright (c) 2003 The FFmpeg project + * + * 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_SP5X_H +#define AVCODEC_SP5X_H + +#include + +static const uint8_t sp5x_data_sof[] = +{ + 0xFF, 0xC0, /* SOF */ + 0x00, 0x11, /* len */ + 0x08, /* bits */ + 0x00, 0xf0, /* height (default: 240) */ + 0x01, 0x40, /* width (default: 240) */ + 0x03, /* nb components */ + 0x01, 0x22, 0x00, /* 21 vs 22 ? */ + 0x02, 0x11, 0x01, + 0x03, 0x11, 0x01 +}; + +static const uint8_t sp5x_data_sos[] = +{ + 0xFF, 0xDA, /* SOS */ + 0x00, 0x0C, /* len */ + 0x03, /* nb components */ + 0x01, 0x00, + 0x02, 0x11, + 0x03, 0x11, + 0x00, /* Ss */ + 0x3F, /* Se */ + 0x00 /* Ah/Al */ +}; + +static const uint8_t sp5x_data_dqt[] = +{ + 0xFF, 0xDB, /* DQT */ + 0x00, 0x84, /* len */ + 0x00, + 0x05, 0x03, 0x04, 0x04, 0x04, 0x03, 0x05, 0x04, + 0x04, 0x04, 0x06, 0x05, 0x05, 0x06, 0x08, 0x0D, + 0x08, 0x08, 0x07, 0x07, 0x08, 0x10, 0x0C, 0x0C, + 0x0A, 0x0D, 0x14, 0x11, 0x15, 0x14, 0x13, 0x11, + 0x13, 0x13, 0x16, 0x18, 0x1F, 0x1A, 0x16, 0x17, + 0x1E, 0x17, 0x13, 0x13, 0x1B, 0x25, 0x1C, 0x1E, + 0x20, 0x21, 0x23, 0x23, 0x23, 0x15, 0x1A, 0x27, + 0x29, 0x26, 0x22, 0x29, 0x1F, 0x22, 0x23, 0x22, + 0x01, + 0x05, 0x06, 0x06, 0x08, 0x07, 0x08, 0x10, 0x08, + 0x08, 0x10, 0x22, 0x16, 0x13, 0x16, 0x22, 0x22, + 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, + 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, + 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, + 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, + 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, + 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22 +}; + +static const uint8_t sp5x_data_dht[] = { + 0xFF, 0xC4, /* DHT */ + 0x01, 0xA2, /* len */ + 0x00, 0x00, 0x01, 0x05, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, + 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x01, 0x00, 0x03, + 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, + 0x0A, 0x0B, 0x10, 0x00, 0x02, 0x01, 0x03, 0x03, + 0x02, 0x04, 0x03, 0x05, 0x05, 0x04, 0x04, 0x00, + 0x00, 0x01, 0x7D, 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, 0x11, 0x00, 0x02, + 0x01, 0x02, 0x04, 0x04, 0x03, 0x04, 0x07, 0x05, + 0x04, 0x04, 0x00, 0x01, 0x02, 0x77, 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 sp5x_qscale_five_quant_table[][64]= +{ + /* index 5, Q60 */ + { 13, 9, 10, 11, 10, 8, 13, 11, 10, 11, 14, 14, 13, 15, 19, 32, + 21, 19, 18, 18, 19, 39, 28, 30, 23, 32, 46, 41, 49, 48, 46, 41, + 45, 44, 51, 58, 74, 62, 51, 54, 70, 55, 44, 45, 64, 87, 65, 70, + 76, 78, 82, 83, 82, 50, 62, 90, 97, 90, 80, 96, 74, 81, 82, 79 }, + { 14, 14, 14, 19, 17, 19, 38, 21, 21, 38, 79, 53, 45, 53, 79, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, + 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79, 79 }, +}; + +#endif /* AVCODEC_SP5X_H */ diff --git a/include/libavcodec/speedhq.h b/include/libavcodec/speedhq.h new file mode 100644 index 0000000..c40991b --- /dev/null +++ b/include/libavcodec/speedhq.h @@ -0,0 +1,35 @@ +/* + * NewTek SpeedHQ common header + * + * 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_SPEEDHQ_H +#define AVCODEC_SPEEDHQ_H + +#include +#include "libavutil/attributes_internal.h" + +#define SPEEDHQ_RL_NB_ELEMS 121 + +FF_VISIBILITY_PUSH_HIDDEN +extern const uint8_t ff_speedhq_run[SPEEDHQ_RL_NB_ELEMS]; +extern const uint8_t ff_speedhq_level[SPEEDHQ_RL_NB_ELEMS]; +extern const uint16_t ff_speedhq_vlc_table[SPEEDHQ_RL_NB_ELEMS + 2][2]; +FF_VISIBILITY_POP_HIDDEN + +#endif /* AVCODEC_SPEEDHQ_H */ diff --git a/include/libavcodec/speedhqenc.h b/include/libavcodec/speedhqenc.h new file mode 100644 index 0000000..0c52e6a --- /dev/null +++ b/include/libavcodec/speedhqenc.h @@ -0,0 +1,45 @@ +/* + * SpeedHQ encoder + * Copyright (c) 2000, 2001 Fabrice Bellard + * Copyright (c) 2003 Alex Beregszaszi + * Copyright (c) 2003-2004 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * SpeedHQ encoder. + */ + +#ifndef AVCODEC_SPEEDHQENC_H +#define AVCODEC_SPEEDHQENC_H + +#include + +#include "mpegvideo.h" + +int ff_speedhq_encode_init(MpegEncContext *s); +void ff_speedhq_encode_close(MpegEncContext *s); +void ff_speedhq_encode_mb(MpegEncContext *s, int16_t block[12][64]); + +void ff_speedhq_encode_picture_header(MpegEncContext *s); +void ff_speedhq_end_slice(MpegEncContext *s); + +int ff_speedhq_mb_y_order_to_mb(int mb_y_order, int mb_height, int *first_in_slice); + +#endif /* AVCODEC_SPEEDHQENC_H */ diff --git a/include/libavcodec/speexdata.h b/include/libavcodec/speexdata.h new file mode 100644 index 0000000..476a8c1 --- /dev/null +++ b/include/libavcodec/speexdata.h @@ -0,0 +1,780 @@ +/* + * Copyright 2002-2008 Xiph.org Foundation + * Copyright 2002-2008 Jean-Marc Valin + * Copyright 2005-2007 Analog Devices Inc. + * Copyright 2005-2008 Commonwealth Scientific and Industrial Research Organisation (CSIRO) + * Copyright 1993, 2002, 2006 David Rowe + * Copyright 2003 EpicGames + * Copyright 1992-1994 Jutta Degener, Carsten Bormann + + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + + * - Neither the name of the Xiph.org Foundation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * 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_SPEEXDATA_H +#define AVCODEC_SPEEXDATA_H + +#include "libavutil/common.h" + +static const int8_t high_lsp_cdbk[512] = { + 39, 12, -14, -20, -29, -61, -67, -76, -32, -71, -67, 68, 77, 46, + 34, 5, -13, -48, -46, -72, -81, -84, -60, -58, -40, -28, 82, 93, + 68, 45, 29, 3, -19, -47, -28, -43, -35, -30, -8, -13, -39, -91, + -91, -123, -96, 10, 10, -6, -18, -55, -60, -91, -56, -36, -27, -16, + -48, -75, 40, 28, -10, -28, 35, 9, 37, 19, 1, -20, -31, -41, + -18, -25, -35, -68, -80, 45, 27, -1, 47, 13, 0, -29, -35, -57, + -50, -79, -73, -38, -19, 5, 35, 14, -10, -23, 16, -8, 5, -24, + -40, -62, -23, -27, -22, -16, -18, -46, -72, -77, 43, 21, 33, 1, + -80, -70, -70, -64, -56, -52, -39, -33, -31, -38, -19, -19, -15, 32, + 33, -2, 7, -15, -15, -24, -23, -33, -41, -56, -24, -57, 5, 89, + 64, 41, 27, 5, -9, -47, -60, -97, -97, -124, -20, -9, -44, -73, + 31, 29, -4, 64, 48, 7, -35, -57, 0, -3, -26, -47, -3, -6, + -40, -76, -79, -48, 12, 81, 55, 10, 9, -24, -43, -73, -57, -69, + 16, 5, -28, -53, 18, 29, 20, 0, -4, -11, 6, -13, 23, 7, + -17, -35, -37, -37, -30, -68, -63, 6, 24, -9, -14, 3, 21, -13, + -27, -57, -49, -80, -24, -41, -5, -16, -5, 1, 45, 25, 12, -7, + 3, -15, -6, -16, -15, -8, 6, -13, -42, -81, -80, -87, 14, 1, + -10, -3, -43, -69, -46, -24, -28, -29, 36, 6, -43, -56, -12, 12, + 54, 79, 43, 9, 54, 22, 2, 8, -12, -43, -46, -52, -38, -69, + -89, -5, 75, 38, 33, 5, -13, -53, -62, -87, -89, -113, -99, -55, + -34, -37, 62, 55, 33, 16, 21, -2, -17, -46, -29, -38, -38, -48, + -39, -42, -36, -75, -72, -88, -48, -30, 21, 2, -15, -57, -64, -98, + -84, -76, 25, 1, -46, -80, -12, 18, -7, 3, 34, 6, 38, 31, + 23, 4, -1, 20, 14, -15, -43, -78, -91, -24, 14, -3, 54, 16, + 0, -27, -28, -44, -56, -83, -92, -89, -3, 34, 56, 41, 36, 22, + 20, -8, -7, -35, -42, -62, -49, 3, 12, -10, -50, -87, -96, -66, + 92, 70, 38, 9, -70, -71, -62, -42, -39, -43, -11, -7, -50, -79, + -58, -50, -31, 32, 31, -6, -4, -25, 7, -17, -38, -70, -58, -27, + -43, -83, -28, 59, 36, 20, 31, 2, -27, -71, -80, -109, -98, -75, + -33, -32, -31, -2, 33, 15, -6, 43, 33, -5, 0, -22, -10, -27, + -34, -49, -11, -20, -41, -91, -100, -121, -39, 57, 41, 10, -19, -50, + -38, -59, -60, -70, -18, -20, -8, -31, -8, -15, 1, -14, -26, -25, + 33, 21, 32, 17, 1, -19, -19, -26, -58, -81, -35, -22, 45, 30, + 11, -11, 3, -26, -48, -87, -67, -83, -58, 3, -1, -26, -20, 44, + 10, 25, 39, 5, -9, -35, -27, -38, 7, 10, 4, -9, -42, -85, + -102, -127, 52, 44, 28, 10, -47, -61, -40, -39, -17, -1, -10, -33, + -42, -74, -48, 21, -4, 70, 52, 10 +}; + +static const int8_t high_lsp_cdbk2[512] = { + -36, -62, 6, -9, -10, -14, -56, 23, 1, -26, 23, -48, -17, 12, 8, + -7, 23, 29, -36, -28, -6, -29, -17, -5, 40, 23, 10, 10, -46, -13, + 36, 6, 4, -30, -29, 62, 32, -32, -1, 22, -14, 1, -4, -22, -45, + 2, 54, 4, -30, -57, -59, -12, 27, -3, -31, 8, -9, 5, 10, -14, + 32, 66, 19, 9, 2, -25, -37, 23, -15, 18, -38, -31, 5, -9, -21, + 15, 0, 22, 62, 30, 15, -12, -14, -46, 77, 21, 33, 3, 34, 29, + -19, 50, 2, 11, 9, -38, -12, -37, 62, 1, -15, 54, 32, 6, 2, + -24, 20, 35, -21, 2, 19, 24, -13, 55, 4, 9, 39, -19, 30, -1, + -21, 73, 54, 33, 8, 18, 3, 15, 6, -19, -47, 6, -3, -48, -50, + 1, 26, 20, 8, -23, -50, 65, -14, -55, -17, -31, -37, -28, 53, -1, + -17, -53, 1, 57, 11, -8, -25, -30, -37, 64, 5, -52, -45, 15, 23, + 31, 15, 14, -25, 24, 33, -2, -44, -56, -18, 6, -21, -43, 4, -12, + 17, -37, 20, -10, 34, 15, 2, 15, 55, 21, -11, -31, -6, 46, 25, + 16, -9, -25, -8, -62, 28, 17, 20, -32, -29, 26, 30, 25, -19, 2, + -16, -17, 26, -51, 2, 50, 42, 19, -66, 23, 29, -2, 3, 19, -19, + -37, 32, 15, 6, 30, -34, 13, 11, -5, 40, 31, 10, -42, 4, -9, + 26, -9, -70, 17, -2, -23, 20, -22, -55, 51, -24, -31, 22, -22, 15, + -13, 3, -10, -28, -16, 56, 4, -63, 11, -18, -15, -18, -38, -35, 16, + -7, 34, -1, -21, -49, -47, 9, -37, 7, 8, 69, 55, 20, 6, -33, + -45, -10, -9, 6, -9, 12, 71, 15, -3, -42, -7, -24, 32, -35, -2, + -42, -17, -5, 0, -2, -33, -54, 13, -12, -34, 47, 23, 19, 55, 7, + -8, 74, 31, 14, 16, -23, -26, 19, 12, -18, -49, -28, -31, -20, 2, + -14, -20, -47, 78, 40, 13, -23, -11, 21, -6, 18, 1, 47, 5, 38, + 35, 32, 46, 22, 8, 13, 16, -14, 18, 51, 19, 40, 39, 11, -26, + -1, -17, 47, 2, -53, -15, 31, -22, 38, 21, -15, -16, 5, -33, 53, + 15, -38, 86, 11, -3, -24, 49, 13, -4, -11, -18, 28, 20, -12, -27, + -26, 35, -25, -35, -3, -20, -61, 30, 10, -55, -12, -22, -52, -54, -14, + 19, -32, -12, 45, 15, -8, -48, -9, 11, -32, 8, -16, -34, -13, 51, + 18, 38, -2, -32, -17, 22, -2, -18, -28, -70, 59, 27, -28, -19, -10, + -20, -9, -9, -8, -21, 21, -8, 35, -2, 45, -3, -9, 12, 0, 30, + 7, -39, 43, 27, -38, -91, 30, 26, 19, -55, -4, 63, 14, -17, 13, + 9, 13, 2, 7, 4, 6, 61, 72, -1, -17, 29, -1, -22, -17, 8, + -28, -37, 63, 44, 41, 3, 2, 14, 9, -6, 75, -8, -7, -12, -15, + -12, 13, 9, -4, 30, -22, -65, 15, 0, -45, 4, -4, 1, 5, 22, + 11, 23 +}; + +static const int8_t exc_5_256_table[1280] = { + -8, -37, 5, -43, 5, 73, 61, 39, 12, -3, -61, -32, 2, 42, + 30, -3, 17, -27, 9, 34, 20, -1, -5, 2, 23, -7, -46, 26, + 53, -47, 20, -2, -33, -89, -51, -64, 27, 11, 15, -34, -5, -56, + 25, -9, -1, -29, 1, 40, 67, -23, -16, 16, 33, 19, 7, 14, + 85, 22, -10, -10, -12, -7, -1, 52, 89, 29, 11, -20, -37, -46, + -15, 17, -24, -28, 24, 2, 1, 0, 23, -101, 23, 14, -1, -23, + -18, 9, 5, -13, 38, 1, -28, -28, 4, 27, 51, -26, 34, -40, + 35, 47, 54, 38, -54, -26, -6, 42, -25, 13, -30, -36, 18, 41, + -4, -33, 23, -32, -7, -4, 51, -3, 17, -52, 56, -47, 36, -2, + -21, 36, 10, 8, -33, 31, 19, 9, -5, -40, 10, -9, -21, 19, + 18, -78, -18, -5, 0, -26, -36, -47, -51, -44, 18, 40, 27, -2, + 29, 49, -26, 2, 32, -54, 30, -73, 54, 3, -5, 36, 22, 53, + 10, -1, -84, -53, -29, -5, 3, -44, 53, -51, 4, 22, 71, -35, + -1, 33, -5, -27, -7, 36, 17, -23, -39, 16, -9, -55, -15, -20, + 39, -35, 6, -39, -14, 18, 48, -64, -17, -15, 9, 39, 81, 37, + -68, 37, 47, -21, -6, -104, 13, 6, 9, -2, 35, 8, -23, 18, + 42, 45, 21, 33, -5, -49, 9, -6, -43, -56, 39, 2, -16, -25, + 87, 1, -3, -9, 17, -25, -11, -9, -1, 10, 2, -14, -14, 4, + -1, -10, 28, -23, 40, -32, 26, -9, 26, 4, -27, -23, 3, 42, + -60, 1, 49, -3, 27, 10, -52, -40, -2, 18, 45, -23, 17, -44, + 3, -3, 17, -46, 52, -40, -47, 25, 75, 31, -49, 53, 30, -30, + -32, -36, 38, -6, -15, -16, 54, -27, -48, 3, 38, -29, -32, -22, + -14, -4, -23, -13, 32, -39, 9, 8, -45, -13, 34, -16, 49, 40, + 32, 31, 28, 23, 23, 32, 47, 59, -68, 8, 62, 44, 25, -14, + -24, -65, -16, 36, 67, -25, -38, -21, 4, -33, -2, 42, 5, -63, + 40, 11, 26, -42, -23, -61, 79, -31, 23, -20, 10, -32, 53, -25, + -36, 10, -26, -5, 3, 0, -71, 5, -10, -37, 1, -24, 21, -54, + -17, 1, -29, -25, -15, -27, 32, 68, 45, -16, -37, -18, -5, 1, + 0, -77, 71, -6, 3, -20, 71, -67, 29, -35, 10, -30, 19, 4, + 16, 17, 5, 0, -14, 19, 2, 28, 26, 59, 3, 2, 24, 39, + 55, -50, -45, -18, -17, 33, -35, 14, -1, 1, 8, 87, -35, -29, + 0, -27, 13, -7, 23, -13, 37, -40, 50, -35, 14, 19, -7, -14, + 49, 54, -5, 22, -2, -29, -8, -27, 38, 13, 27, 48, 12, -41, + -21, -15, 28, 7, -16, -24, -19, -20, 11, -20, 9, 2, 13, 23, + -20, 11, 27, -27, 71, -69, 8, 2, -6, 22, 12, 16, 16, 9, + -16, -8, -17, 1, 25, 1, 40, -37, -33, 66, 94, 53, 4, -22, + -25, -41, -42, 25, 35, -16, -15, 57, 31, -29, -32, 21, 16, -60, + 45, 15, -1, 7, 57, -26, -47, -29, 11, 8, 15, 19, -105, -8, + 54, 27, 10, -17, 6, -12, -1, -10, 4, 0, 23, -10, 31, 13, + 11, 10, 12, -64, 23, -3, -8, -19, 16, 52, 24, -40, 16, 10, + 40, 5, 9, 0, -13, -7, -21, -8, -6, -7, -21, 59, 16, -53, + 18, -60, 11, -47, 14, -18, 25, -13, -24, 4, -39, 16, -28, 54, + 26, -67, 30, 27, -20, -52, 20, -12, 55, 12, 18, -16, 39, -14, + -6, -26, 56, -88, -55, 12, 25, 26, -37, 6, 75, 0, -34, -81, + 54, -30, 1, -7, 49, -23, -14, 21, 10, -62, -58, -57, -47, -34, + 15, -4, 34, -78, 31, 25, -11, 7, 50, -10, 42, -63, 14, -36, + -4, 57, 55, 57, 53, 42, -42, -1, 15, 40, 37, 15, 25, -11, + 6, 1, 31, -2, -6, -1, -7, -64, 34, 28, 30, -1, 3, 21, + 0, -88, -12, -56, 25, -28, 40, 8, -28, -14, 9, 12, 2, -6, + -17, 22, 49, -6, -26, 14, 28, -20, 4, -12, 50, 35, 40, 13, + -38, -58, -29, 17, 30, 22, 60, 26, -54, -39, -12, 58, -28, -63, + 10, -21, -8, -12, 26, -62, 6, -10, -11, -22, -6, -7, 4, 1, + 18, 2, -70, 11, 14, 4, 13, 19, -24, -34, 24, 67, 17, 51, + -21, 13, 23, 54, -30, 48, 1, -13, 80, 26, -16, -2, 13, -4, + 6, -30, 29, -24, 73, -58, 30, -27, 20, -2, -21, 41, 45, 30, + -27, -3, -5, -18, -20, -49, -3, -35, 10, 42, -19, -67, -53, -11, + 9, 13, -15, -33, -51, -30, 15, 7, 25, -30, 4, 28, -22, -34, + 54, -29, 39, -46, 20, 16, 34, -4, 47, 75, 1, -44, -55, -24, + 7, -1, 9, -42, 50, -8, -36, 41, 68, 0, -4, -10, -23, -15, + -50, 64, 36, -9, -27, 12, 25, -38, -47, -37, 32, -49, 51, -36, + 2, -4, 69, -26, 19, 7, 45, 67, 46, 13, -63, 46, 15, -47, + 4, -41, 13, -6, 5, -21, 37, 26, -55, -7, 33, -1, -28, 10, + -17, -64, -14, 0, -36, -17, 93, -3, -9, -66, 44, -21, 3, -12, + 38, -6, -13, -12, 19, 13, 43, -43, -10, -12, 6, -5, 9, -49, + 32, -5, 2, 4, 5, 15, -16, 10, -21, 8, -62, -8, 64, 8, + 79, -1, -66, -49, -18, 5, 40, -5, -30, -45, 1, -6, 21, -32, + 93, -18, -30, -21, 32, 21, -18, 22, 8, 5, -41, -54, 80, 22, + -10, -7, -8, -23, -64, 66, 56, -14, -30, -41, -46, -14, -29, -37, + 27, -14, 42, -2, -9, -29, 34, 14, 33, -14, 22, 4, 10, 26, + 26, 28, 32, 23, -72, -32, 3, 0, -14, 35, -42, -78, -32, 6, + 29, -18, -45, -5, 7, -33, -45, -3, -22, -34, 8, -8, 4, -51, + -25, -9, 59, -78, 21, -5, -25, -48, 66, -15, -17, -24, -49, -13, + 25, -23, -64, -6, 40, -24, -19, -11, 57, -33, -8, 1, 10, -52, + -54, 28, 39, 49, 34, -11, -61, -41, -43, 10, 15, -15, 51, 30, + 15, -51, 32, -34, -2, -34, 14, 18, 16, 1, 1, -3, -3, 1, + 1, -18, 6, 16, 48, 12, -5, -42, 7, 36, 48, 7, -20, -10, + 7, 12, 2, 54, 39, -38, 37, 54, 4, -11, -8, -46, -10, 5, + -10, -34, 46, -12, 29, -37, 39, 36, -11, 24, 56, 17, 14, 20, + 25, 0, -25, -28, 55, -7, -5, 27, 3, 9, -26, -8, 6, -24, + -10, -30, -31, -34, 18, 4, 22, 21, 40, -1, -29, -37, -8, -21, + 92, -29, 11, -3, 11, 73, 23, 22, 7, 4, -44, -9, -11, 21, + -13, 11, 9, -78, -1, 47, 114, -12, -37, -19, -5, -11, -22, 19, + 12, -30, 7, 38, 45, -21, -8, -9, 55, -45, 56, -21, 7, 17, + 46, -57, -87, -6, 27, 31, 31, 7, -56, -12, 46, 21, -5, -12, + 36, 3, 3, -21, 43, 19, 12, -7, 9, -14, 0, -9, -33, -91, + 7, 26, 3, -11, 64, 83, -31, -46, 25, 2, 9, 5, 2, 2, + -1, 20, -17, 10, -5, -27, -8, 20, 8, -19, 16, -21, -13, -31, + 5, 5, 42, 24, 9, 34, -20, 28, -61, 22, 11, -39, 64, -20, + -1, -30, -9, -20, 24, -25, -24, -29, 22, -60, 6, -5, 41, -9, + -87, 14, 34, 15, -57, 52, 69, 15, -3, -102, 58, 16, 3, 6, + 60, -75, -32, 26, 7, -57, -27, -32, -24, -21, -29, -16, 62, -46, + 31, 30, -27, -15, 7, 15 +}; + +static const int8_t exc_5_64_table[320] = { + 1, 5, -15, 49, -66, -48, -4, 50, -44, 7, 37, 16, -18, 25, -26, + -26, -15, 19, 19, -27, -47, 28, 57, 5, -17, -32, -41, 68, 21, -2, + 64, 56, 8, -16, -13, -26, -9, -16, 11, 6, -39, 25, -19, 22, -31, + 20, -45, 55, -43, 10, -16, 47, -40, 40, -20, -51, 3, -17, -14, -15, + -24, 53, -20, -46, 46, 27, -68, 32, 3, -18, -5, 9, -31, 16, -9, + -10, -1, -23, 48, 95, 47, 25, -41, -32, -3, 15, -25, -55, 36, 41, + -27, 20, 5, 13, 14, -22, 5, 2, -23, 18, 46, -15, 17, -18, -34, + -5, -8, 27, -55, 73, 16, 2, -1, -17, 40, -78, 33, 0, 2, 19, + 4, 53, -16, -15, -16, -28, -3, -13, 49, 8, -7, -29, 27, -13, 32, + 20, 32, -61, 16, 14, 41, 44, 40, 24, 20, 7, 4, 48, -60, -77, + 17, -6, -48, 65, -15, 32, -30, -71, -10, -3, -6, 10, -2, -7, -29, + -56, 67, -30, 7, -5, 86, -6, -10, 0, 5, -31, 60, 34, -38, -3, + 24, 10, -2, 30, 23, 24, -41, 12, 70, -43, 15, -17, 6, 13, 16, + -13, 8, 30, -15, -8, 5, 23, -34, -98, -4, -13, 13, -48, -31, 70, + 12, 31, 25, 24, -24, 26, -7, 33, -16, 8, 5, -11, -14, -8, -65, + 13, 10, -2, -9, 0, -3, -68, 5, 35, 7, 0, -31, -1, -17, -9, + -9, 16, -37, -18, -1, 69, -48, -28, 22, -21, -11, 5, 49, 55, 23, + -86, -36, 16, 2, 13, 63, -51, 30, -11, 13, 24, -18, -6, 14, -19, + 1, 41, 9, -5, 27, -36, -44, -34, -37, -21, -26, 31, -39, 15, 43, + 5, -8, 29, 20, -8, -20, -52, -28, -1, 13, 26, -34, -10, -9, 27, + -8, 8, 27, -66, 4, 12, -22, 49, 10, -77, 32, -18, 3, -38, 12, + -3, -1, 2, 2, 0 +}; + +static const int8_t gain_cdbk_nb[512] = { + -32, -32, -32, 0, -28, -67, -5, 33, -42, -6, -32, 18, -57, -10, -54, + 35, -16, 27, -41, 42, 19, -19, -40, 36, -45, 24, -21, 40, -8, -14, + -18, 28, 1, 14, -58, 53, -18, -88, -39, 39, -38, 21, -18, 37, -19, + 20, -43, 38, 10, 17, -48, 54, -52, -58, -13, 33, -44, -1, -11, 32, + -12, -11, -34, 22, 14, 0, -46, 46, -37, -35, -34, 5, -25, 44, -30, + 43, 6, -4, -63, 49, -31, 43, -41, 43, -23, 30, -43, 41, -43, 26, + -14, 44, -33, 1, -13, 27, -13, 18, -37, 37, -46, -73, -45, 34, -36, + 24, -25, 34, -36, -11, -20, 19, -25, 12, -18, 33, -36, -69, -59, 34, + -45, 6, 8, 46, -22, -14, -24, 18, -1, 13, -44, 44, -39, -48, -26, + 15, -32, 31, -37, 34, -33, 15, -46, 31, -24, 30, -36, 37, -41, 31, + -23, 41, -50, 22, -4, 50, -22, 2, -21, 28, -17, 30, -34, 40, -7, + -60, -28, 29, -38, 42, -28, 42, -44, -11, 21, 43, -16, 8, -44, 34, + -39, -55, -43, 21, -11, -35, 26, 41, -9, 0, -34, 29, -8, 121, -81, + 113, 7, -16, -22, 33, -37, 33, -31, 36, -27, -7, -36, 17, -34, 70, + -57, 65, -37, -11, -48, 21, -40, 17, -1, 44, -33, 6, -6, 33, -9, + 0, -20, 34, -21, 69, -33, 57, -29, 33, -31, 35, -55, 12, -1, 49, + -33, 27, -22, 35, -50, -33, -47, 17, -50, 54, 51, 94, -1, -5, -44, + 35, -4, 22, -40, 45, -39, -66, -25, 24, -33, 1, -26, 20, -24, -23, + -25, 12, -11, 21, -45, 44, -25, -45, -19, 17, -43, 105, -16, 82, 5, + -21, 1, 41, -16, 11, -33, 30, -13, -99, -4, 57, -37, 33, -15, 44, + -25, 37, -63, 54, -36, 24, -31, 31, -53, -56, -38, 26, -41, -4, 4, + 37, -33, 13, -30, 24, 49, 52, -94, 114, -5, -30, -15, 23, 1, 38, + -40, 56, -23, 12, -36, 29, -17, 40, -47, 51, -37, -41, -39, 11, -49, + 34, 0, 58, -18, -7, -4, 34, -16, 17, -27, 35, 30, 5, -62, 65, + 4, 48, -68, 76, -43, 11, -11, 38, -18, 19, -15, 41, -23, -62, -39, + 23, -42, 10, -2, 41, -21, -13, -13, 25, -9, 13, -47, 42, -23, -62, + -24, 24, -44, 60, -21, 58, -18, -3, -52, 32, -22, 22, -36, 34, -75, + 57, 16, 90, -19, 3, 10, 45, -29, 23, -38, 32, -5, -62, -51, 38, + -51, 40, -18, 53, -42, 13, -24, 32, -34, 14, -20, 30, -56, -75, -26, + 37, -26, 32, 15, 59, -26, 17, -29, 29, -7, 28, -52, 53, -12, -30, + 5, 30, -5, -48, -5, 35, 2, 2, -43, 40, 21, 16, 16, 75, -25, + -45, -32, 10, -43, 18, -10, 42, 9, 0, -1, 52, -1, 7, -30, 36, + 19, -48, -4, 48, -28, 25, -29, 32, -22, 0, -31, 22, -32, 17, -10, + 36, -64, -41, -62, 36, -52, 15, 16, 58, -30, -22, -32, 6, -7, 9, + -38, 36 +}; + +static const int8_t exc_8_128_table[1024] = { + -14, 9, 13, -32, 2, -10, 31, -10, -8, -8, 6, -4, -1, 10, -64, + 23, 6, 20, 13, 6, 8, -22, 16, 34, 7, 42, -49, -28, 5, 26, + 4, -15, 41, 34, 41, 32, 33, 24, 23, 14, 8, 40, 34, 4, -24, + -41, -19, -15, 13, -13, 33, -54, 24, 27, -44, 33, 27, -15, -15, 24, + -19, 14, -36, 14, -9, 24, -12, -4, 37, -5, 16, -34, 5, 10, 33, + -15, -54, -16, 12, 25, 12, 1, 2, 0, 3, -1, -4, -4, 11, 2, + -56, 54, 27, -20, 13, -6, -46, -41, -33, -11, -5, 7, 12, 14, -14, + -5, 8, 20, 6, 3, 4, -8, -5, -42, 11, 8, -14, 25, -2, 2, + 13, 11, -22, 39, -9, 9, 5, -45, -9, 7, -9, 12, -7, 34, -17, + -102, 7, 2, -42, 18, 35, -9, -34, 11, -5, -2, 3, 22, 46, -52, + -25, -9, -94, 8, 11, -5, -5, -5, 4, -7, -35, -7, 54, 5, -32, + 3, 24, -9, -22, 8, 65, 37, -1, -12, -23, -6, -9, -28, 55, -33, + 14, -3, 2, 18, -60, 41, -17, 8, -16, 17, -11, 0, -11, 29, -28, + 37, 9, -53, 33, -14, -9, 7, -25, -7, -11, 26, -32, -8, 24, -21, + 22, -19, 19, -10, 29, -14, 0, 0, 0, 0, 0, 0, 0, 0, -5, + -52, 10, 41, 6, -30, -4, 16, 32, 22, -27, -22, 32, -3, -28, -3, + 3, -35, 6, 17, 23, 21, 8, 2, 4, -45, -17, 14, 23, -4, -31, + -11, -3, 14, 1, 19, -11, 2, 61, -8, 9, -12, 7, -10, 12, -3, + -24, 99, -48, 23, 50, -37, -5, -23, 0, 8, -14, 35, -64, -5, 46, + -25, 13, -1, -49, -19, -15, 9, 34, 50, 25, 11, -6, -9, -16, -20, + -32, -33, -32, -27, 10, -8, 12, -15, 56, -14, -32, 33, 3, -9, 1, + 65, -9, -9, -10, -2, -6, -23, 9, 17, 3, -28, 13, -32, 4, -2, + -10, 4, -16, 76, 12, -52, 6, 13, 33, -6, 4, -14, -9, -3, 1, + -15, -16, 28, 1, -15, 11, 16, 9, 4, -21, -37, -40, -6, 22, 12, + -15, -23, -14, -17, -16, -9, -10, -9, 13, -39, 41, 5, -9, 16, -38, + 25, 46, -47, 4, 49, -14, 17, -2, 6, 18, 5, -6, -33, -22, 44, + 50, -2, 1, 3, -6, 7, 7, -3, -21, 38, -18, 34, -14, -41, 60, + -13, 6, 16, -24, 35, 19, -13, -36, 24, 3, -17, -14, -10, 36, 44, + -44, -29, -3, 3, -54, -8, 12, 55, 26, 4, -2, -5, 2, -11, 22, + -23, 2, 22, 1, -25, -39, 66, -49, 21, -8, -2, 10, -14, -60, 25, + 6, 10, 27, -25, 16, 5, -2, -9, 26, -13, -20, 58, -2, 7, 52, + -9, 2, 5, -4, -15, 23, -1, -38, 23, 8, 27, -6, 0, -27, -7, + 39, -10, -14, 26, 11, -45, -12, 9, -5, 34, 4, -35, 10, 43, -22, + -11, 56, -7, 20, 1, 10, 1, -26, 9, 94, 11, -27, -14, -13, 1, + -11, 0, 14, -5, -6, -10, -4, -15, -8, -41, 21, -5, 1, -28, -8, + 22, -9, 33, -23, -4, -4, -12, 39, 4, -7, 3, -60, 80, 8, -17, + 2, -6, 12, -5, 1, 9, 15, 27, 31, 30, 27, 23, 61, 47, 26, + 10, -5, -8, -12, -13, 5, -18, 25, -15, -4, -15, -11, 12, -2, -2, + -16, -2, -6, 24, 12, 11, -4, 9, 1, -9, 14, -45, 57, 12, 20, + -35, 26, 11, -64, 32, -10, -10, 42, -4, -9, -16, 32, 24, 7, 10, + 52, -11, -57, 29, 0, 8, 0, -6, 17, -17, -56, -40, 7, 20, 18, + 12, -6, 16, 5, 7, -1, 9, 1, 10, 29, 12, 16, 13, -2, 23, + 7, 9, -3, -4, -5, 18, -64, 13, 55, -25, 9, -9, 24, 14, -25, + 15, -11, -40, -30, 37, 1, -19, 22, -5, -31, 13, -2, 0, 7, -4, + 16, -67, 12, 66, -36, 24, -8, 18, -15, -23, 19, 0, -45, -7, 4, + 3, -13, 13, 35, 5, 13, 33, 10, 27, 23, 0, -7, -11, 43, -74, + 36, -12, 2, 5, -8, 6, -33, 11, -16, -14, -5, -7, -3, 17, -34, + 27, -16, 11, -9, 15, 33, -31, 8, -16, 7, -6, -7, 63, -55, -17, + 11, -1, 20, -46, 34, -30, 6, 9, 19, 28, -9, 5, -24, -8, -23, + -2, 31, -19, -16, -5, -15, -18, 0, 26, 18, 37, -5, -15, -2, 17, + 5, -27, 21, -33, 44, 12, -27, -9, 17, 11, 25, -21, -31, -7, 13, + 33, -8, -25, -7, 7, -10, 4, -6, -9, 48, -82, -23, -8, 6, 11, + -23, 3, -3, 49, -29, 25, 31, 4, 14, 16, 9, -4, -18, 10, -26, + 3, 5, -44, -9, 9, -47, -55, 15, 9, 28, 1, 4, -3, 46, 6, + -6, -38, -29, -31, -15, -6, 3, 0, 14, -6, 8, -54, -50, 33, -5, + 1, -14, 33, -48, 26, -4, -5, -3, -5, -3, -5, -28, -22, 77, 55, + -1, 2, 10, 10, -9, -14, -66, -49, 11, -36, -6, -20, 10, -10, 16, + 12, 4, -1, -16, 45, -44, -50, 31, -2, 25, 42, 23, -32, -22, 0, + 11, 20, -40, -35, -40, -36, -32, -26, -21, -13, 52, -22, 6, -24, -20, + 17, -5, -8, 36, -25, -11, 21, -26, 6, 34, -8, 7, 20, -3, 5, + -25, -8, 18, -5, -9, -4, 1, -9, 20, 20, 39, 48, -24, 9, 5, + -65, 22, 29, 4, 3, -43, -11, 32, -6, 9, 19, -27, -10, -47, -14, + 24, 10, -7, -36, -7, -1, -4, -5, -5, 16, 53, 25, -26, -29, -4, + -12, 45, -58, -34, 33, -5, 2, -1, 27, -48, 31, -15, 22, -5, 4, + 7, 7, -25, -3, 11, -22, 16, -12, 8, -3, 7, -11, 45, 14, -73, + -19, 56, -46, 24, -20, 28, -12, -2, -1, -36, -3, -33, 19, -6, 7, + 2, -15, 5, -31, -45, 8, 35, 13, 20, 0, -9, 48, -13, -43, -3, + -13, 2, -5, 72, -68, -27, 2, 1, -2, -7, 5, 36, 33, -40, -12, + -4, -5, 23, 19 +}; + +static const int8_t exc_10_32_table[320] = { + 7, 17, 17, 27, 25, 22, 12, 4, -3, 0, 28, -36, 39, -24, -15, + 3, -9, 15, -5, 10, 31, -28, 11, 31, -21, 9, -11, -11, -2, -7, + -25, 14, -22, 31, 4, -14, 19, -12, 14, -5, 4, -7, 4, -5, 9, + 0, -2, 42, -47, -16, 1, 8, 0, 9, 23, -57, 0, 28, -11, 6, + -31, 55, -45, 3, -5, 4, 2, -2, 4, -7, -3, 6, -2, 7, -3, + 12, 5, 8, 54, -10, 8, -7, -8, -24, -25, -27, -14, -5, 8, 5, + 44, 23, 5, -9, -11, -11, -13, -9, -12, -8, -29, -8, -22, 6, -15, + 3, -12, -1, -5, -3, 34, -1, 29, -16, 17, -4, 12, 2, 1, 4, + -2, -4, 2, -1, 11, -3, -52, 28, 30, -9, -32, 25, 44, -20, -24, + 4, 6, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -25, -10, 22, 29, 13, -13, -22, -13, -4, 0, -4, -16, 10, 15, -36, + -24, 28, 25, -1, -3, 66, -33, -11, -15, 6, 0, 3, 4, -2, 5, + 24, -20, -47, 29, 19, -2, -4, -1, 0, -1, -2, 3, 1, 8, -11, + 5, 5, -57, 28, 28, 0, -16, 4, -4, 12, -6, -1, 2, -20, 61, + -9, 24, -22, -42, 29, 6, 17, 8, 4, 2, -65, 15, 8, 10, 5, + 6, 5, 3, 2, -2, -3, 5, -9, 4, -5, 23, 13, 23, -3, -63, + 3, -5, -4, -6, 0, -3, 23, -36, -46, 9, 5, 5, 8, 4, 9, + -5, 1, -3, 10, 1, -6, 10, -11, 24, -47, 31, 22, -12, 14, -10, + 6, 11, -7, -7, 7, -31, 51, -12, -6, 7, 6, -17, 9, -11, -20, + 52, -19, 3, -6, -6, -8, -5, 23, -41, 37, 1, -21, 10, -14, 8, + 7, 5, -15, -15, 23, 39, -26, -33, 7, 2, -32, -30, -21, -8, 4, + 12, 17, 15, 14, 11 +}; + +static const int8_t exc_10_16_table[160] = { + 22, 39, 14, 44, 11, 35, -2, 23, -4, 6, 46, -28, 13, -27, -23, + 12, 4, 20, -5, 9, 37, -18, -23, 23, 0, 9, -6, -20, 4, -1, + -17, -5, -4, 17, 0, 1, 9, -2, 1, 2, 2, -12, 8, -25, 39, + 15, 9, 16, -55, -11, 9, 11, 5, 10, -2, -60, 8, 13, -6, 11, + -16, 27, -47, -12, 11, 1, 16, -7, 9, -3, -29, 9, -14, 25, -19, + 34, 36, 12, 40, -10, -3, -24, -14, -37, -21, -35, -2, -36, 3, -6, + 67, 28, 6, -17, -3, -12, -16, -15, -17, -7, -59, -36, -13, 1, 7, + 1, 2, 10, 2, 11, 13, 10, 8, -2, 7, 3, 5, 4, 2, 2, + -3, -8, 4, -5, 6, 7, -42, 15, 35, -2, -46, 38, 28, -20, -9, + 1, 7, -3, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + -15, -28, 52, 32, 5, -5, -17, -20, -10, -1 +}; + +static const int8_t gain_cdbk_lbr[128] = { + -32, -32, -32, 0, -31, -58, -16, 22, -41, -24, -43, 14, -56, -22, -55, 29, + -13, 33, -41, 47, -4, -39, -9, 29, -41, 15, -12, 38, -8, -15, -12, 31, + 1, 2, -44, 40, -22, -66, -42, 27, -38, 28, -23, 38, -21, 14, -37, 31, + 0, 21, -50, 52, -53, -71, -27, 33, -37, -1, -19, 25, -19, -5, -28, 22, + 6, 65, -44, 74, -33, -48, -33, 9, -40, 57, -14, 58, -17, 4, -45, 32, + -31, 38, -33, 36, -23, 28, -40, 39, -43, 29, -12, 46, -34, 13, -23, 28, + -16, 15, -27, 34, -14, -82, -15, 43, -31, 25, -32, 29, -21, 5, -5, 38, + -47, -63, -51, 33, -46, 12, 3, 47, -28, -17, -29, 11, -10, 14, -40, 38 +}; + +static const int8_t exc_20_32_table[640] = { + 12, 32, 25, 46, 36, 33, 9, 14, -3, 6, 1, -8, 0, -10, -5, + -7, -7, -7, -5, -5, 31, -27, 24, -32, -4, 10, -11, 21, -3, 19, + 23, -9, 22, 24, -10, -1, -10, -13, -7, -11, 42, -33, 31, 19, -8, + 0, -10, -16, 1, -21, -17, 10, -8, 14, 8, 4, 11, -2, 5, -2, + -33, 11, -16, 33, 11, -4, 9, -4, 11, 2, 6, -5, 8, -5, 11, + -4, -6, 26, -36, -16, 0, 4, -2, -8, 12, 6, -1, 34, -46, -22, + 9, 9, 21, 9, 5, -66, -5, 26, 2, 10, 13, 2, 19, 9, 12, + -81, 3, 13, 13, 0, -14, 22, -35, 6, -7, -4, 6, -6, 10, -6, + -31, 38, -33, 0, -10, -11, 5, -12, 12, -17, 5, 0, -6, 13, -9, + 10, 8, 25, 33, 2, -12, 8, -6, 10, -2, 21, 7, 17, 43, 5, + 11, -7, -9, -20, -36, -20, -23, -4, -4, -3, 27, -9, -9, -49, -39, + -38, -11, -9, 6, 5, 23, 25, 5, 3, 3, 4, 1, 2, -3, -1, + 87, 39, 17, -21, -9, -19, -9, -15, -13, -14, -17, -11, -10, -11, -8, + -6, -1, -3, -3, -1, -54, -34, -27, -8, -11, -4, -5, 0, 0, 4, + 8, 6, 9, 7, 9, 7, 6, 5, 5, 5, 48, 10, 19, -10, 12, + -1, 9, -3, 2, 5, -3, 2, -2, -2, 0, -2, -26, 6, 9, -7, + -16, -9, 2, 7, 7, -5, -43, 11, 22, -11, -9, 34, 37, -15, -13, + -6, 1, -1, 1, 1, -64, 56, 52, -11, -27, 5, 4, 3, 1, 2, + 1, 3, -1, -4, -4, -10, -7, -4, -4, 2, -1, -7, -7, -12, -10, + -15, -9, -5, -5, -11, -16, -13, 6, 16, 4, -13, -16, -10, -4, 2, + -47, -13, 25, 47, 19, -14, -20, -8, -17, 0, -3, -13, 1, 6, -17, + -14, 15, 1, 10, 6, -24, 0, -10, 19, -69, -8, 14, 49, 17, -5, + 33, -29, 3, -4, 0, 2, -8, 5, -6, 2, 120, -56, -12, -47, 23, + -9, 6, -5, 1, 2, -5, 1, -10, 4, -1, -1, 4, -1, 0, -3, + 30, -52, -67, 30, 22, 11, -1, -4, 3, 0, 7, 2, 0, 1, -10, + -4, -8, -13, 5, 1, 1, -1, 5, 13, -9, -3, -10, -62, 22, 48, + -4, -6, 2, 3, 5, 1, 1, 4, 1, 13, 3, -20, 10, -9, 13, + -2, -4, 9, -20, 44, -1, 20, -32, -67, 19, 0, 28, 11, 8, 2, + -11, 15, -19, -53, 31, 2, 34, 10, 6, -4, -58, 8, 10, 13, 14, + 1, 12, 2, 0, 0, -128, 37, -8, 44, -9, 26, -3, 18, 2, 6, + 11, -1, 9, 1, 5, 3, 0, 1, 1, 2, 12, 3, -2, -3, 7, + 25, 9, 18, -6, -37, 3, -8, -16, 3, -10, -7, 17, -34, -44, 11, + 17, -15, -3, -16, -1, -13, 11, -46, -65, -2, 8, 13, 2, 4, 4, + 5, 15, 5, 9, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -9, 19, -12, 12, -28, + 38, 29, -1, 12, 2, 5, 23, -10, 3, 4, -15, 21, -4, 3, 3, + 6, 17, -9, -4, -8, -20, 26, 5, -10, 6, 1, -19, 18, -15, -12, + 47, -6, -2, -7, -9, -1, -17, -2, -2, -14, 30, -14, 2, -7, -4, + -1, -12, 11, -25, 16, -3, -12, 11, -7, 7, -17, 1, 19, -28, 31, + -7, -10, 7, -10, 3, 12, 5, -16, 6, 24, 41, -29, -54, 0, 1, + 7, -1, 5, -6, 13, 10, -4, -8, 8, -9, -27, -53, -38, -1, 10, + 19, 17, 16, 12, 12, 0, 3, -7, -4, 13, 12, -31, -14, 6, -5, + 3, 5, 17, 43, 50, 25, 10, 1, -6, -2 +}; + +static const int8_t cdbk_nb[640] = { + 30, 19, 38, 34, 40, 32, 46, 43, 58, 43, 5, -18, -25, -40, + -33, -55, -52, 20, 34, 28, -20, -63, -97, -92, 61, 53, 47, 49, + 53, 75, -14, -53, -77, -79, 0, -3, -5, 19, 22, 26, -9, -53, + -55, 66, 90, 72, 85, 68, 74, 52, -4, -41, -58, -31, -18, -31, + 27, 32, 30, 18, 24, 3, 8, 5, -12, -3, 26, 28, 74, 63, + -2, -39, -67, -77, -106, -74, 59, 59, 73, 65, 44, 40, 71, 72, + 82, 83, 98, 88, 89, 60, -6, -31, -47, -48, -13, -39, -9, 7, + 2, 79, -1, -39, -60, -17, 87, 81, 65, 50, 45, 19, -21, -67, + -91, -87, -41, -50, 7, 18, 39, 74, 10, -31, -28, 39, 24, 13, + 23, 5, 56, 45, 29, 10, -5, -13, -11, -35, -18, -8, -10, -8, + -25, -71, -77, -21, 2, 16, 50, 63, 87, 87, 5, -32, -40, -51, + -68, 0, 12, 6, 54, 34, 5, -12, 32, 52, 68, 64, 69, 59, + 65, 45, 14, -16, -31, -40, -65, -67, 41, 49, 47, 37, -11, -52, + -75, -84, -4, 57, 48, 42, 42, 33, -11, -51, -68, -6, 13, 0, + 8, -8, 26, 32, -23, -53, 0, 36, 56, 76, 97, 105, 111, 97, + -1, -28, -39, -40, -43, -54, -44, -40, -18, 35, 16, -20, -19, -28, + -42, 29, 47, 38, 74, 45, 3, -29, -48, -62, -80, -104, -33, 56, + 59, 59, 10, 17, 46, 72, 84, 101, 117, 123, 123, 106, -7, -33, + -49, -51, -70, -67, -27, -31, 70, 67, -16, -62, -85, -20, 82, 71, + 86, 80, 85, 74, -19, -58, -75, -45, -29, -33, -18, -25, 45, 57, + -12, -42, -5, 12, 28, 36, 52, 64, 81, 82, 13, -9, -27, -28, + 22, 3, 2, 22, 26, 6, -6, -44, -51, 2, 15, 10, 48, 43, + 49, 34, -19, -62, -84, -89, -102, -24, 8, 17, 61, 68, 39, 24, + 23, 19, 16, -5, 12, 15, 27, 15, -8, -44, -49, -60, -18, -32, + -28, 52, 54, 62, -8, -48, -77, -70, 66, 101, 83, 63, 61, 37, + -12, -50, -75, -64, 33, 17, 13, 25, 15, 77, 1, -42, -29, 72, + 64, 46, 49, 31, 61, 44, -8, -47, -54, -46, -30, 19, 20, -1, + -16, 0, 16, -12, -18, -9, -26, -27, -10, -22, 53, 45, -10, -47, + -75, -82, -105, -109, 8, 25, 49, 77, 50, 65, 114, 117, 124, 118, + 115, 96, 90, 61, -9, -45, -63, -60, -75, -57, 8, 11, 20, 29, + 0, -35, -49, -43, 40, 47, 35, 40, 55, 38, -24, -76, -103, -112, + -27, 3, 23, 34, 52, 75, 8, -29, -43, 12, 63, 38, 35, 29, + 24, 8, 25, 11, 1, -15, -18, -43, -7, 37, 40, 21, -20, -56, + -19, -19, -4, -2, 11, 29, 51, 63, -2, -44, -62, -75, -89, 30, + 57, 51, 74, 51, 50, 46, 68, 64, 65, 52, 63, 55, 65, 43, + 18, -9, -26, -35, -55, -69, 3, 6, 8, 17, -15, -61, -86, -97, + 1, 86, 93, 74, 78, 67, -1, -38, -66, -48, 48, 39, 29, 25, + 17, -1, 13, 13, 29, 39, 50, 51, 69, 82, 97, 98, -2, -36, + -46, -27, -16, -30, -13, -4, -7, -4, 25, -5, -11, -6, -25, -21, + 33, 12, 31, 29, -8, -38, -52, -63, -68, -89, -33, -1, 10, 74, + -2, -15, 59, 91, 105, 105, 101, 87, 84, 62, -7, -33, -50, -35, + -54, -47, 25, 17, 82, 81, -13, -56, -83, 21, 58, 31, 42, 25, + 72, 65, -24, -66, -91, -56, 9, -2, 21, 10, 69, 75, 2, -24, + 11, 22, 25, 28, 38, 34, 48, 33, 7, -29, -26, 17, 15, -1, + 14, 0, -2, 0, -6, -41, -67, 6, -2, -9, 19, 2, 85, 74, + -22, -67, -84, -71, -50, 3, 11, -9, 2, 62 +}; + +static const int8_t cdbk_nb_low1[320] = { + -34, -52, -15, 45, 2, 23, 21, 52, 24, -33, -9, -1, 9, -44, -41, + -13, -17, 44, 22, -17, -6, -4, -1, 22, 38, 26, 16, 2, 50, 27, + -35, -34, -9, -41, 6, 0, -16, -34, 51, 8, -14, -31, -49, 15, -33, + 45, 49, 33, -11, -37, -62, -54, 45, 11, -5, -72, 11, -1, -12, -11, + 24, 27, -11, -43, 46, 43, 33, -12, -9, -1, 1, -4, -23, -57, -71, + 11, 8, 16, 17, -8, -20, -31, -41, 53, 48, -16, 3, 65, -24, -8, + -23, -32, -37, -32, -49, -10, -17, 6, 38, 5, -9, -17, -46, 8, 52, + 3, 6, 45, 40, 39, -7, -6, -34, -74, 31, 8, 1, -16, 43, 68, + -11, -19, -31, 4, 6, 0, -6, -17, -16, -38, -16, -30, 2, 9, -39, + -16, -1, 43, -10, 48, 3, 3, -16, -31, -3, 62, 68, 43, 13, 3, + -10, 8, 20, -56, 12, 12, -2, -18, 22, -15, -40, -36, 1, 7, 41, + 0, 1, 46, -6, -62, -4, -12, -2, -11, -83, -13, -2, 91, 33, -10, + 0, 4, -11, -16, 79, 32, 37, 14, 9, 51, -21, -28, -56, -34, 0, + 21, 9, -26, 11, 28, -42, -54, -23, -2, -15, 31, 30, 8, -39, -66, + -39, -36, 31, -28, -40, -46, 35, 40, 22, 24, 33, 48, 23, -34, 14, + 40, 32, 17, 27, -3, 25, 26, -13, -61, -17, 11, 4, 31, 60, -6, + -26, -41, -64, 13, 16, -26, 54, 31, -11, -23, -9, -11, -34, -71, -21, + -34, -35, 55, 50, 29, -22, -27, -50, -38, 57, 33, 42, 57, 48, 26, + 11, 0, -49, -31, 26, -4, -14, 5, 78, 37, 17, 0, -49, -12, -23, + 26, 14, 2, 2, -43, -17, -12, 10, -8, -4, 8, 18, 12, -6, 20, + -12, -6, -13, -25, 34, 15, 40, 49, 7, 8, 13, 20, 20, -19, -22, + -2, -8, 2, 51, -51 +}; + +static const int8_t cdbk_nb_low2[320] = { + -6, 53, -21, -24, 4, 26, 17, -4, -37, 25, 17, -36, -13, 31, 3, + -6, 27, 15, -10, 31, 28, 26, -10, -10, -40, 16, -7, 15, 13, 41, + -9, 0, -4, 50, -6, -7, 14, 38, 22, 0, -48, 2, 1, -13, -19, + 32, -3, -60, 11, -17, -1, -24, -34, -1, 35, -5, -27, 28, 44, 13, + 25, 15, 42, -11, 15, 51, 35, -36, 20, 8, -4, -12, -29, 19, -47, + 49, -15, -4, 16, -29, -39, 14, -30, 4, 25, -9, -5, -51, -14, -3, + -40, -32, 38, 5, -9, -8, -4, -1, -22, 71, -3, 14, 26, -18, -22, + 24, -41, -25, -24, 6, 23, 19, -10, 39, -26, -27, 65, 45, 2, -7, + -26, -8, 22, -12, 16, 15, 16, -35, -5, 33, -21, -8, 0, 23, 33, + 34, 6, 21, 36, 6, -7, -22, 8, -37, -14, 31, 38, 11, -4, -3, + -39, -32, -8, 32, -23, -6, -12, 16, 20, -28, -4, 23, 13, -52, -1, + 22, 6, -33, -40, -6, 4, -62, 13, 5, -26, 35, 39, 11, 2, 57, + -11, 9, -20, -28, -33, 52, -5, -6, -2, 22, -14, -16, -48, 35, 1, + -58, 20, 13, 33, -1, -74, 56, -18, -22, -31, 12, 6, -14, 4, -2, + -9, -47, 10, -3, 29, -17, -5, 61, 14, 47, -12, 2, 72, -39, -17, + 92, 64, -53, -51, -15, -30, -38, -41, -29, -28, 27, 9, 36, 9, -35, + -42, 81, -21, 20, 25, -16, -5, -17, -35, 21, 15, -28, 48, 2, -2, + 9, -19, 29, -40, 30, -18, -18, 18, -16, -57, 15, -20, -12, -15, -37, + -15, 33, -39, 21, -22, -13, 35, 11, 13, -38, -63, 29, 23, -27, 32, + 18, 3, -26, 42, 33, -64, -66, -17, 16, 56, 2, 36, 3, 31, 21, + -41, -39, 8, -57, 14, 37, -2, 19, -36, -19, -23, -29, -16, 1, -3, + -8, -10, 31, 64, -65 +}; + +static const int8_t cdbk_nb_high1[320] = { + -26, -8, 29, 21, 4, 19, -39, 33, -7, -36, 56, 54, 48, 40, 29, + -4, -24, -42, -66, -43, -60, 19, -2, 37, 41, -10, -37, -60, -64, 18, + -22, 77, 73, 40, 25, 4, 19, -19, -66, -2, 11, 5, 21, 14, 26, + -25, -86, -4, 18, 1, 26, -37, 10, 37, -1, 24, -12, -59, -11, 20, + -6, 34, -16, -16, 42, 19, -28, -51, 53, 32, 4, 10, 62, 21, -12, + -34, 27, 4, -48, -48, -50, -49, 31, -7, -21, -42, -25, -4, -43, -22, + 59, 2, 27, 12, -9, -6, -16, -8, -32, -58, -16, -29, -5, 41, 23, + -30, -33, -46, -13, -10, -38, 52, 52, 1, -17, -9, 10, 26, -25, -6, + 33, -20, 53, 55, 25, -32, -5, -42, 23, 21, 66, 5, -28, 20, 9, + 75, 29, -7, -42, -39, 15, 3, -23, 21, 6, 11, 1, -29, 14, 63, + 10, 54, 26, -24, -51, -49, 7, -23, -51, 15, -66, 1, 60, 25, 10, + 0, -30, -4, -15, 17, 19, 59, 40, 4, -5, 33, 6, -22, -58, -70, + -5, 23, -6, 60, 44, -29, -16, -47, -29, 52, -19, 50, 28, 16, 35, + 31, 36, 0, -21, 6, 21, 27, 22, 42, 7, -66, -40, -8, 7, 19, + 46, 0, -4, 60, 36, 45, -7, -29, -6, -32, -39, 2, 6, -9, 33, + 20, -51, -34, 18, -6, 19, 6, 11, 5, -19, -29, -2, 42, -11, -45, + -21, -55, 57, 37, 2, -14, -67, -16, -27, -38, 69, 48, 19, 2, -17, + 20, -20, -16, -34, -17, -25, -61, 10, 73, 45, 16, -40, -64, -17, -29, + -22, 56, 17, -39, 8, -11, 8, -25, -18, -13, -19, 8, 54, 57, 36, + -17, -26, -4, 6, -21, 40, 42, -4, 20, 31, 53, 10, -34, -53, 31, + -17, 35, 0, 15, -6, -20, -63, -73, 22, 25, 29, 17, 8, -29, -39, + -69, 18, 15, -15, -5 +}; + +static const int8_t cdbk_nb_high2[320] = { + 11, 47, 16, -9, -46, -32, 26, -64, 34, -5, 38, -7, 47, 20, 2, + -73, -99, -3, -45, 20, 70, -52, 15, -6, -7, -82, 31, 21, 47, 51, + 39, -3, 9, 0, -41, -7, -15, -54, 2, 0, 27, -31, 9, -45, -22, + -38, -24, -24, 8, -33, 23, 5, 50, -36, -17, -18, -51, -2, 13, 19, + 43, 12, -15, -12, 61, 38, 38, 7, 13, 0, 6, -1, 3, 62, 9, + 27, 22, -33, 38, -35, -9, 30, -43, -9, -32, -1, 4, -4, 1, -5, + -11, -8, 38, 31, 11, -10, -42, -21, -37, 1, 43, 15, -13, -35, -19, + -18, 15, 23, -26, 59, 1, -21, 53, 8, -41, -50, -14, -28, 4, 21, + 25, -28, -40, 5, -40, -41, 4, 51, -33, -8, -8, 1, 17, -60, 12, + 25, -41, 17, 34, 43, 19, 45, 7, -37, 24, -15, 56, -2, 35, -10, + 48, 4, -47, -2, 5, -5, -54, 5, -3, -33, -10, 30, -2, -44, -24, + -38, 9, -9, 42, 4, 6, -56, 44, -16, 9, -40, -26, 18, -20, 10, + 28, -41, -21, -4, 13, -18, 32, -30, -3, 37, 15, 22, 28, 50, -40, + 3, -29, -64, 7, 51, -19, -11, 17, -27, -40, -64, 24, -12, -7, -27, + 3, 37, 48, -1, 2, -9, -38, -34, 46, 1, 27, -6, 19, -13, 26, + 10, 34, 20, 25, 40, 50, -6, -7, 30, 9, -24, 0, -23, 71, -61, + 22, 58, -34, -4, 2, -49, -33, 25, 30, -8, -6, -16, 77, 2, 38, + -8, -35, -6, -30, 56, 78, 31, 33, -20, 13, -39, 20, 22, 4, 21, + -8, 4, -6, 10, -83, -41, 9, -25, -43, 15, -7, -12, -34, -39, -37, + -33, 19, 30, 16, -33, 42, -25, 25, -68, 44, -15, -11, -4, 23, 50, + 14, 4, -39, -43, 20, -30, 60, 9, -20, 7, 16, 19, -33, 37, 29, + 16, -35, 7, 38, -27 +}; + +static const int8_t hexc_table[1024] = { + -24, 21, -20, 5, -5, -7, 14, -10, 2, -27, 16, -20, 0, + -32, 26, 19, 8, -11, -41, 31, 28, -27, -32, 34, 42, 34, + -17, 22, -10, 13, -29, 18, -12, -26, -24, 11, 22, 5, -5, + -5, 54, -68, -43, 57, -25, 24, 4, 4, 26, -8, -12, -17, + 54, 30, -45, 1, 10, -15, 18, -41, 11, 68, -67, 37, -16, + -24, -16, 38, -22, 6, -29, 30, 66, -27, 5, 7, -16, 13, + 2, -12, -7, -3, -20, 36, 4, -28, 9, 3, 32, 48, 26, + 39, 3, 0, 7, -21, -13, 5, -82, -7, 73, -20, 34, -9, + -5, 1, -1, 10, -5, -10, -1, 9, 1, -9, 10, 0, -14, + 11, -1, -2, -1, 11, 20, 96, -81, -22, -12, -9, -58, 9, + 24, -30, 26, -35, 27, -12, 13, -18, 56, -59, 15, -7, 23, + -15, -1, 6, -25, 14, -22, -20, 47, -11, 16, 2, 38, -23, + -19, -30, -9, 40, -11, 5, 4, -6, 8, 26, -21, -11, 127, + 4, 1, 6, -9, 2, -7, -2, -3, 7, -5, 10, -19, 7, + -106, 91, -3, 9, -4, 21, -8, 26, -80, 8, 1, -2, -10, + -17, -17, -27, 32, 71, 6, -29, 11, -23, 54, -38, 29, -22, + 39, 87, -31, -12, -20, 3, -2, -2, 2, 20, 0, -1, -35, + 27, 9, -6, -12, 3, -12, -6, 13, 1, 14, -22, -59, -15, + -17, -25, 13, -7, 7, 3, 0, 1, -7, 6, -3, 61, -37, + -23, -23, -29, 38, -31, 27, 1, -8, 2, -27, 23, -26, 36, + -34, 5, 24, -24, -6, 7, 3, -59, 78, -62, 44, -16, 1, + 6, 0, 17, 8, 45, 0, -110, 6, 14, -2, 32, -77, -56, + 62, -3, 3, -13, 4, -16, 102, -15, -36, -1, 9, -113, 6, + 23, 0, 9, 9, 5, -8, -1, -14, 5, -12, 121, -53, -27, + -8, -9, 22, -13, 3, 2, -3, 1, -2, -71, 95, 38, -19, + 15, -16, -5, 71, 10, 2, -32, -13, -5, 15, -1, -2, -14, + -85, 30, 29, 6, 3, 2, 0, 0, 0, 0, 0, 0, 0, + 0, 2, -65, -56, -9, 18, 18, 23, -14, -2, 0, 12, -29, + 26, -12, 1, 2, -12, -64, 90, -6, 4, 1, 5, -5, -110, + -3, -31, 22, -29, 9, 0, 8, -40, -5, 21, -5, -5, 13, + 10, -18, 40, 1, 35, -20, 30, -28, 11, -6, 19, 7, 14, + 18, -64, 9, -6, 16, 51, 68, 8, 16, 12, -8, 0, -9, + 20, -22, 25, 7, -4, -13, 41, -35, 93, -18, -54, 11, -1, + 1, -9, 4, -66, 66, -31, 20, -22, 25, -23, 11, 10, 9, + 19, 15, 11, -5, -31, -10, -23, -28, -6, -6, -3, -4, 5, + 3, -28, 22, -11, -42, 25, -25, -16, 41, 34, 47, -6, 2, + 42, -19, -22, 5, -39, 32, 6, -35, 22, 17, -30, 8, -26, + -11, -11, 3, -12, 33, 33, -37, 21, -1, 6, -4, 3, 0, + -5, 5, 12, -12, 57, 27, -61, -3, 20, -17, 2, 0, 4, + 0, -2, -33, -58, 81, -23, 39, -10, -5, 2, 6, -7, 5, + 4, -3, -2, -13, -23, -72, 107, 15, -5, 0, -7, -3, -6, + 5, -4, 15, 47, 12, -31, 25, -16, 8, 22, -25, -62, -56, + -18, 14, 28, 12, 2, -11, 74, -66, 41, -20, -7, 16, -20, + 16, -8, 0, -16, 4, -19, 92, 12, -59, -14, -39, 49, -25, + -16, 23, -27, 19, -3, -33, 19, 85, -29, 6, -7, -10, 16, + -7, -12, 1, -6, 2, 4, -2, 64, 10, -25, 41, -2, -31, + 15, 0, 110, 50, 69, 35, 28, 19, -10, 2, -43, -49, -56, + -15, -16, 10, 3, 12, -1, -8, 1, 26, -12, -1, 7, -11, + -27, 41, 25, 1, -11, -18, 22, -7, -1, -47, -8, 23, -3, + -17, -7, 18, -125, 59, -5, 3, 18, 1, 2, 3, 27, -35, + 65, -53, 50, -46, 37, -21, -28, 7, 14, -37, -5, -5, 12, + 5, -8, 78, -19, 21, -6, -16, 8, -7, 5, 2, 7, 2, + 10, -6, 12, -60, 44, 11, -36, -32, 31, 0, 2, -2, 2, + 1, -3, 7, -10, 17, -21, 10, 6, -2, 19, -2, 59, -38, + -86, 38, 8, -41, -30, -45, -33, 7, 15, 28, 29, -7, 24, + -40, 7, 7, 5, -2, 9, 24, -23, -18, 6, -29, 30, 2, + 28, 49, -11, -46, 10, 43, -13, -9, -1, -3, -7, -7, -17, + -6, 97, -33, -21, 3, 5, 1, 12, -43, -8, 28, 7, -43, + -7, 17, -20, 19, -1, 2, -13, 9, 54, 34, 9, -28, -11, + -9, -17, 110, -59, 44, -26, 0, 3, -12, -47, 73, -34, -43, + 38, -33, 16, -5, -46, -4, -6, -2, -25, 19, -29, 28, -13, + 5, 14, 27, -40, -43, 4, 32, -13, -2, -35, -4, 112, -42, + 9, -12, 37, -28, 17, 14, -19, 35, -39, 23, 3, -14, -1, + -57, -5, 94, -9, 3, -39, 5, 30, -10, -32, 42, -13, -14, + -97, -63, 30, -9, 1, -7, 12, 5, 20, 17, -9, -36, -30, + 25, 47, -9, -15, 12, -22, 98, -8, -50, 15, -27, 21, -16, + -11, 2, 12, -10, 10, -3, 33, 36, -96, 0, -17, 31, -9, + 9, 3, -20, 13, -11, 8, -4, 10, -10, 9, 1, 112, -70, + -27, 5, -21, 2, -57, -3, -29, 10, 19, -21, 21, -10, -66, + -3, 91, -35, 30, -12, 0, -7, 59, -28, 26, 2, 14, -18, + 1, 1, 11, 17, 20, -54, -59, 27, 4, 29, 32, 5, 19, + 12, -4, 1, 7, -10, 5, -2, 10, 0, 23, -5, 28, -104, + 46, 11, 16, 3, 29, 1, -8, -14, 1, 7, -50, 88, -62, + 26, 8, -17, -14, 50, 0, 32, -12, -3, -27, 18, -8, -5, + 8, 3, -20, -11, 37, -12, 9, 33, 46, -101, -1, -4, 1, + 6, -1, 28, -42, -15, 16, 5, -1, -2, -55, 85, 38, -9, + -4, 11, -2, -9, -6, 3, -20, -10, -77, 89, 24, -3, -104, + -57, -26, -31, -20, -6, -9, 14, 20, -23, 46, -15, -31, 28, + 1, -15, -2, 6, -2, 31, 45, -76, 23, -25, +}; + +static const int8_t hexc_10_32_table[320] = { + -3, -2, -1, 0, -4, 5, 35, -40, -9, 13, -44, 5, -27, -1, -7, + 6, -11, 7, -8, 7, 19, -14, 15, -4, 9, -10, 10, -8, 10, -9, + -1, 1, 0, 0, 2, 5, -18, 22, -53, 50, 1, -23, 50, -36, 15, + 3, -13, 14, -10, 6, 1, 5, -3, 4, -2, 5, -32, 25, 5, -2, + -1, -4, 1, 11, -29, 26, -6, -15, 30, -18, 0, 15, -17, 40, -41, + 3, 9, -2, -2, 3, -3, -1, -5, 2, 21, -6, -16, -21, 23, 2, + 60, 15, 16, -16, -9, 14, 9, -1, 7, -9, 0, 1, 1, 0, -1, + -6, 17, -28, 54, -45, -1, 1, -1, -6, -6, 2, 11, 26, -29, -2, + 46, -21, 34, 12, -23, 32, -23, 16, -10, 3, 66, 19, -20, 24, 7, + 11, -3, 0, -3, -1, -50, -46, 2, -18, -3, 4, -1, -2, 3, -3, + -19, 41, -36, 9, 11, -24, 21, -16, 9, -3, -25, -3, 10, 18, -9, + -2, -5, -1, -5, 6, -4, -3, 2, -26, 21, -19, 35, -15, 7, -13, + 17, -19, 39, -43, 48, -31, 16, -9, 7, -2, -5, 3, -4, 9, -19, + 27, -55, 63, -35, 10, 26, -44, -2, 9, 4, 1, -6, 8, -9, 5, + -8, -1, -3, -16, 45, -42, 5, 15, -16, 10, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -16, 24, -55, 47, -38, 27, -19, 7, -3, 1, + 16, 27, 20, -19, 18, 5, -7, 1, -5, 2, -6, 8, -22, 0, -3, + -3, 8, -1, 7, -8, 1, -3, 5, 0, 17, -48, 58, -52, 29, -7, + -2, 3, -10, 6, -26, 58, -31, 1, -6, 3, 93, -29, 39, 3, 17, + 5, 6, -1, -1, -1, 27, 13, 10, 19, -7, -34, 12, 10, -4, 9, + -76, 9, 8, -28, -2, -11, 2, -1, 3, 1, -83, 38, -39, 4, -16, + -6, -2, -5, 5, -2, +}; + +static const float shift_filt[3][7] = { + {-0.011915f, 0.046995f, -0.152373f, 0.614108f, 0.614108f, -0.152373f, + 0.046995f}, + {-0.0324855f, 0.0859768f, -0.2042986f, 0.9640297f, 0.2086420f, -0.0302054f, + -0.0063646f}, + {-0.0063646f, -0.0302054f, 0.2086420f, 0.9640297f, -0.2042986f, 0.0859768f, + -0.0324855f} +}; + +static const float vbr_hb_thresh[5][11] = { + {-1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f}, /* silence */ + {-1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f}, /* 2 kbps */ + {11.0f, 11.0f, 9.5f, 8.5f, 7.5f, 6.0f, 5.0f, 3.9f, 3.0f, 2.0f, 1.0f}, /* 6 kbps */ + {11.0f, 11.0f, 11.0f, 11.0f, 11.0f, 9.5f, 8.7f, 7.8f, 7.0f, 6.5f, 4.0f}, /* 10 kbps */ + {11.0f, 11.0f, 11.0f, 11.0f, 11.0f, 11.0f, 11.0f, 11.0f, 9.8f, 7.5f, 5.5f} /* 18 kbps */ +}; + +static const float vbr_uhb_thresh[2][11] = { + {-1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f}, /* silence */ + { 3.9f, 2.5f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f} /* 2 kbps */ +}; + +static const float h0[64] = { + 3.596189e-05f, -0.0001123515f, -0.0001104587f, 0.0002790277f, + 0.0002298438f, -0.0005953563f, -0.0003823631f, 0.00113826f, + 0.0005308539f, -0.001986177f, -0.0006243724f, 0.003235877f, + 0.0005743159f, -0.004989147f, -0.0002584767f, 0.007367171f, + -0.0004857935f, -0.01050689f, 0.001894714f, 0.01459396f, + -0.004313674f, -0.01994365f, 0.00828756f, 0.02716055f, + -0.01485397f, -0.03764973f, 0.026447f, 0.05543245f, + -0.05095487f, -0.09779096f, 0.1382363f, 0.4600981f, + 0.4600981f, 0.1382363f, -0.09779096f, -0.05095487f, + 0.05543245f, 0.026447f, -0.03764973f, -0.01485397f, + 0.02716055f, 0.00828756f, -0.01994365f, -0.004313674f, + 0.01459396f, 0.001894714f, -0.01050689f, -0.0004857935f, + 0.007367171f, -0.0002584767f, -0.004989147f, 0.0005743159f, + 0.003235877f, -0.0006243724f, -0.001986177f, 0.0005308539f, + 0.00113826f, -0.0003823631f, -0.0005953563f, 0.0002298438f, + 0.0002790277f, -0.0001104587f, -0.0001123515f, 3.596189e-05f +}; + +static const float gc_quant_bound[16] = { + 0.97979, 1.28384, 1.68223, 2.20426, 2.88829, 3.78458, 4.95900, 6.49787, + 8.51428, 11.15642, 14.61846, 19.15484, 25.09895, 32.88761, 43.09325, 56.46588 +}; + +static const uint16_t wb_skip_table[8] = { 0, 36, 112, 192, 352, 0, 0, 0 }; +static const float e_ratio_quant[4] = {.25f, .315f, .397f, .5f}; +static const float e_ratio_quant_bounds[3] = {0.2825f, 0.356f, 0.4485f}; +static const float attenuation[10] = { 1.f, 0.961f, 0.852f, 0.698f, 0.527f, + 0.368f, 0.237f, 0.141f, 0.077f, 0.039f }; +static const float exc_gain_quant_scal3_bound[7] = { + 0.112338f, 0.236980f, 0.369316f, 0.492054f, + 0.637471f, 0.828874f, 1.132784f +}; +static const float exc_gain_quant_scal3[8] = { 0.061130f, 0.163546f, 0.310413f, + 0.428220f, 0.555887f, 0.719055f, + 0.938694f, 1.326874f }; +static const float exc_gain_quant_scal1_bound[1] = { 0.87798f }; +static const float exc_gain_quant_scal1[2] = { 0.70469f, 1.05127f }; + +#endif /* AVCODEC_SPEEXDATA_H */ diff --git a/include/libavcodec/startcode.h b/include/libavcodec/startcode.h new file mode 100644 index 0000000..8b75832 --- /dev/null +++ b/include/libavcodec/startcode.h @@ -0,0 +1,36 @@ +/* + * 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 + */ + +/** + * @file + * Accelerated start code search function for start codes common to + * MPEG-1/2/4 video, VC-1, H.264/5 + */ + +#ifndef AVCODEC_STARTCODE_H +#define AVCODEC_STARTCODE_H + +#include + +const uint8_t *avpriv_find_start_code(const uint8_t *p, + const uint8_t *end, + uint32_t *state); + +int ff_startcode_find_candidate_c(const uint8_t *buf, int size); + +#endif /* AVCODEC_STARTCODE_H */ diff --git a/include/libavcodec/sunrast.h b/include/libavcodec/sunrast.h new file mode 100644 index 0000000..d162e63 --- /dev/null +++ b/include/libavcodec/sunrast.h @@ -0,0 +1,56 @@ +/* + * Sun Rasterfile Image Format + * Copyright (c) 2007, 2008 Ivo van Poorten + * + * 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_SUNRAST_H +#define AVCODEC_SUNRAST_H + +#define RAS_MAGIC 0x59a66a95 + +#define RMT_NONE 0 +#define RMT_EQUAL_RGB 1 +#define RMT_RAW 2 ///< the data layout of this map type is unknown + +/* The Old and Standard format types indicate that the image data is + * uncompressed. There is no difference between the two formats. */ +#define RT_OLD 0 +#define RT_STANDARD 1 + +/* The Byte-Encoded format type indicates that the image data is compressed + * using a run-length encoding scheme. */ +#define RT_BYTE_ENCODED 2 +#define RLE_TRIGGER 0x80 + +/* The RGB format type indicates that the image is uncompressed with reverse + * component order from Old and Standard (RGB vs BGR). */ +#define RT_FORMAT_RGB 3 + +/* The TIFF and IFF format types indicate that the raster file was originally + * converted from either of these file formats. We do not have any samples or + * documentation of the format details. */ +#define RT_FORMAT_TIFF 4 +#define RT_FORMAT_IFF 5 + +/* The Experimental format type is implementation-specific and is generally an + * indication that the image file does not conform to the Sun Raster file + * format specification. */ +#define RT_EXPERIMENTAL 0xffff + +#endif /* AVCODEC_SUNRAST_H */ diff --git a/include/libavcodec/svq1.h b/include/libavcodec/svq1.h new file mode 100644 index 0000000..0ccf17c --- /dev/null +++ b/include/libavcodec/svq1.h @@ -0,0 +1,67 @@ +/* + * SVQ1 decoder + * ported to MPlayer by Arpi + * ported to libavcodec by Nick Kurshev + * + * Copyright (c) 2002 The Xine project + * Copyright (c) 2002 The FFmpeg project + * + * SVQ1 Encoder (c) 2004 Mike Melanson + * + * 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 + */ + +/** + * @file + * Sorenson Vector Quantizer #1 (SVQ1) video codec. + * For more information of the SVQ1 algorithm, visit: + * http://www.pcisys.net/~melanson/codecs/ + */ + +#ifndef AVCODEC_SVQ1_H +#define AVCODEC_SVQ1_H + +#include + +#include "libavutil/attributes_internal.h" + +#define SVQ1_BLOCK_SKIP 0 +#define SVQ1_BLOCK_INTER 1 +#define SVQ1_BLOCK_INTER_4V 2 +#define SVQ1_BLOCK_INTRA 3 + +#define SVQ1_BLOCK_SKIP_CODE 1 +#define SVQ1_BLOCK_SKIP_LEN 1 +#define SVQ1_BLOCK_INTER_CODE 1 +#define SVQ1_BLOCK_INTER_LEN 2 +#define SVQ1_BLOCK_INTRA_CODE 0 +#define SVQ1_BLOCK_INTRA_LEN 3 + +FF_VISIBILITY_PUSH_HIDDEN +extern const int8_t *const ff_svq1_inter_codebooks[6]; +extern const int8_t *const ff_svq1_intra_codebooks[6]; + +extern const uint8_t ff_svq1_block_type_vlc[4][2]; +extern const uint8_t ff_svq1_intra_multistage_vlc[6][8][2]; +extern const uint8_t ff_svq1_inter_multistage_vlc[6][8][2]; +extern const uint16_t ff_svq1_intra_mean_vlc[256][2]; +extern const uint16_t ff_svq1_inter_mean_vlc[512][2]; + +extern const uint16_t ff_svq1_frame_size_table[7][2]; +FF_VISIBILITY_POP_HIDDEN + +#endif /* AVCODEC_SVQ1_H */ diff --git a/include/libavcodec/svq1_cb.h b/include/libavcodec/svq1_cb.h new file mode 100644 index 0000000..30cca19 --- /dev/null +++ b/include/libavcodec/svq1_cb.h @@ -0,0 +1,1525 @@ +/* + * SVQ1 decoder + * ported to MPlayer by Arpi + * ported to libavcodec by Nick Kurshev + * + * Copyright (c) 2002 The Xine project + * Copyright (c) 2002 The FFmpeg project + * + * 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 + */ + +/** + * @file + * svq1 code books. + */ + +#ifndef AVCODEC_SVQ1_CB_H +#define AVCODEC_SVQ1_CB_H + +#include +#include + +#include "libavutil/mem_internal.h" + +/* 6x16-entry codebook for inter-coded 4x2 vectors */ +DECLARE_ALIGNED(4, static const int8_t, svq1_inter_codebook_4x2)[768] = { + 7, 2, -6, -7, 7, 3, -3, -4, -7, -2, 7, 8, -8, -4, 3, 4, + 19, 17, 9, 3,-14,-16,-12, -8,-18,-16, -8, -3, 11, 14, 12, 8, + 7,-16,-10, 20, 7,-17,-10, 20, -6, 18, 8,-21, -7, 18, 9,-20, + 25, 3,-20,-14, 29, 7,-18,-13,-29, -4, 21, 14,-31, -6, 20, 14, + -19,-26,-28,-24, 31, 32, 22, 10, 15, 24, 31, 28,-32,-32,-22,-13, + 2, -8,-23,-26, -9, 3, 27, 35, 3, 11, 21, 21, 8, -4,-27,-34, + -30,-31, 12, 47,-29,-30, 13, 47, 38, 30,-17,-46, 34, 26,-19,-46, + -42,-50,-51,-43, 34, 48, 55, 48, 48, 54, 51, 42,-44,-52,-53,-47, + 4, 5, 0, -6, -2, -2, 0, 1,-11, -6, -1, -2, 1, 8, 9, 1, + 0, 1, -6, 5, 8, 1,-12, 2, 7,-14, -7, 8, 5, -8, 0, 8, + 1, 4, 11, 8,-12, -8, 0, -5, -1, 1, 0, 4,-15, -8, 3, 16, + 17, 8, -4, -6, 9, -4,-13, -8, 2, 6, 1,-18, -1, 11, 11,-12, + 6, 0, 2, 0, 14, 6, -7,-21, 1, -1,-13,-20, 1, 1, 10, 21, + -22, -5, 7, 13,-11, -1, 4, 12, -7, 0, 14, 19, -4, 3, -5,-19, + -26,-14, 10, 15, 18, 4, -6, -2, 25, 19, -5,-18,-20, -7, 4, 2, + -13, -6, -1, -4, 25, 37, -2,-35, 5, 4, 1, 1,-21,-36, 2, 43, + 2, -2, -1, 3, 8, -2, -6, -1, -2, -3, 2, 12, -5, -2, -2, -1, + -3, -1, -1, -5, -1, 7, 8, -2, 2, 7, 5, -3, 1, 1, -3, -8, + -3, -1, -3, -2, -2, -3, 2, 13, 15, 0,-11, -6, 3, 0, 0, 0, + -6, -9, -5, -4, 18, 4, 1, 3, 12, 3, 0, 4,-16, -3, 3, -3, + -17, 3, 18, 2, -1, -3, -1, -1, -6, 16, -8, 0, -9, 14, -7, 0, + 3,-13, 14, -5, 3,-13, 14, -4, -7, 20, 14,-23, 8, -7, -8, 4, + 8,-15,-19, 16,-10, 13, 11, -3, 9, -1, 1, 26, 5,-15,-27, 2, + -20, 7, 16, -4,-40, 9, 31, 1, 26,-12,-30, -7, 40, -2,-19, 4, + 6, 0, 0, 0, -6, -2, 1, 2, 0, -1, 0, -6, 9, 0, -2, -1, + -7, 8, 2, -3, -1, 2, -3, 2, 7, -4, -2, 4, 2, 0, 0, -6, + -3, -2, 9, 2, -2, -1, 0, -4, -3, -3, 0, -3, -6, 2, 10, 4, + 3, 0,-10, 8, 0, 0, -4, 4, -1, 1, 4, 2, 3, -7, -9, 7, + 2, 1, -9, -4, -1, 12, 0, 0, 3, -1, 7, -4, 3,-14, 4, 2, + -12, -9, 1, 11, 2, 5, 1, 0, 3, 1, 0, 2, 0, 8, 6,-19, + -6,-10, -7, -4, 9, 7, 5, 7, 6, 21, 3, -3,-11, -9, -5, -2, + -4, -9,-16, -1, -2, -5, 1, 36, 8, 11, 19, 0, 2, 5, -4,-41, + -1, -1, -2, -1, -2, -2, 1, 6, 0, 4, 1, -8, 1, 1, 1, 0, + -2, -3, 4, 0, 2, -1, 3, -3, 1, 3, -4, 1, -1, 3, 0, -5, + 3, 4, 2, 3, -2, -3, -6, -1, -2, -3, -2, 2, -4, 8, 1, 0, + -7, 4, 2, 6, -7, -1, 1, 0, -2, 2, -4, 1, 8, -6, 2, -1, + -6, 2, 0, 2, 5, 4, -8, -1, -1,-11, 0, 9, 0, -2, 2, 2, + 17, -5, -4, -1, -1, -4, -2, -2, 0,-13, 9, -3, -1, 12, -7, 2, + 0, -2, -5, 2, -7, -5, 20, -3, 7, 7, -1,-30, 3, 5, 8, 1, + -6, 3, -1, -4, 2, -2,-11, 18, 0, -7, 3, 14, 20, -3,-18, -9, + 7, -2, 0, -1, -2, 0, 0, -1, -4, -1, 1, 0, -2, 2, 0, 4, + 1, -3, 2, 1, 3, 1, -5, 1, -3, 0, -1, -2, 7, 1, 0, -3, + 2, 5, 0, -2, 2, -5, -1, 1, -1, -2, 4, -1, 0, -3, 5, 0, + 0, 3, -1, -2, -4, 1, 5, -1, -1, 0, -1, 9, -1, -2, -1, -1, + -2, 5, 5, -1, -2, 2, -3, -2, 1, 2,-11, 1, 2, 1, 3, 2, + 2,-10, -1, -2, 4, 2, 4, 1, 4, 5, -5, 1, 0, 6,-11, 1, + 1, 0, 6, 6, 0, 2, 1,-15, 7, 3, 5, 9,-30, 2, 2, 2, + -34, 1, 9, 2, 5, 8, 8, 2, 7, 2, 6, 6, 2,-27, 1, 4 +}; + +/* 6x16-entry codebook for inter-coded 4x4 vectors */ +DECLARE_ALIGNED(4, static const int8_t, svq1_inter_codebook_4x4)[1536] = { + 4, 0, -6, -7, -4, -8,-13, -9, -8, -8, -1, 6, -2, 5, 22, 27, + -16, -7, 11, 10,-18, -7, 13, 10,-15, -4, 12, 8, -9, -1, 9, 5, + -2, 2, 15,-16, -3, 2, 19,-19, -3, 2, 19,-19, -2, 3, 15,-14, + 17, 22, 22, 16, -6, -7, -5, -2,-12,-16,-16,-12, 1, 1, -1, -3, + 11,-17, 0, 8, 14,-21, -1, 9, 14,-21, -2, 8, 11,-16, -2, 6, + 7, -2,-16, 11, 9, -2,-21, 14, 10, -1,-22, 14, 8, -1,-18, 10, + -10, 16, 3, -9,-13, 20, 4,-11,-14, 21, 4,-10,-11, 16, 3, -8, + 11, 4, -9, -9, 15, 6,-12,-14, 17, 8,-12,-14, 16, 10, -7,-11, + 4, 10, 14, 13, -1, 7, 15, 16,-12, -7, 3, 8,-20,-23,-18,-10, + -10,-18,-26,-25, 4, 1, -6,-11, 13, 15, 11, 3, 12, 15, 13, 8, + -16,-19,-16,-11, 7, 12, 15, 11, 11, 16, 16, 11, -6, -9,-11,-10, + 18, 19, 12, 5, 18, 16, 5, -4, 6, 0,-10,-15, -9,-17,-23,-22, + -10,-14, -1, 21,-11,-17, 0, 29,-11,-16, 1, 30,-10,-14, 0, 23, + -16,-17,-12, -6,-19,-19,-14, -7, -3, -1, 1, 2, 27, 35, 29, 19, + -37, -8, 23, 23,-42, -9, 28, 29,-43,-10, 26, 28,-38,-11, 19, 22, + 32, 16,-16,-33, 39, 20,-18,-37, 38, 19,-19,-38, 32, 15,-17,-34, + 24, 9, -6, -4, -1,-10, -6, 3, -8, -9, -1, 3, 3, 7, 2, -6, + -1, -3, -1, 0, -1, 4, 2, -7, -3, 11, 3,-16, 1, 20, 9,-18, + -3, -8, 6, 12, -5,-10, 7, 13, -6, -9, 5, 7, -5, -5, 2, -1, + -8, 12, -3, -1,-10, 15, -3, 1,-11, 13, -4, 1,-11, 8, -3, 2, + 9, 6, -5,-12, 3, 0, -8,-13, -4, -4, -1, -1, -4, 1, 15, 18, + 9, 13, 14, 12, 4, 3, -1, -2, -2, -5, -8, -5, -7,-11, -9, -4, + 7, -5, -7, -4, 14, -2, -7, -4, 17, 0, -8, -5, 15, 1, -7, -5, + -10, -1, 6, 4,-15, -9, 2, 4, 2, -1, -3, 0, 25, 13, -8,-10, + 7, 11, -3,-16, 7, 11, -3,-15, 6, 7, -2, -9, 4, 2, -3, -5, + -7, -1, -1, 0, -9, -2, 2, 6,-12, -4, 6, 14,-13, -6, 8, 19, + -18,-18,-11, -5, -3, 0, 3, 4, 6, 8, 6, 6, 6, 6, 6, 6, + -5, 3, 13,-10, -6, 1, 15, -9, -6, -3, 15, -6, -6, -6, 10, -3, + 9, 1, -9, -9, 11, 9, 6, 5, 0, 3, 8, 7,-15,-14, -6, -5, + -11, -6, 11, 19, -2, -5, -9, -8, 6, 2, -9,-10, 6, 5, 4, 5, + -7, -3, 8, 15, -1, 3, 10, 15, 5, 5, -1, -2, 4, -2,-21,-25, + 6, -6, -6, 5, 8, -9, -7, 9, 8,-12, -7, 13, 4,-14, -7, 14, + -4, -3, 1, 1, -3, -5, -2, -3, 7, 0, -2, -4, 20, 7, -4, -4, + -3,-20, -6, 10, 6, 0, 0, 1, 5, 8, 5, -1, -3, 0, 0, -2, + 13, 6, -1, 2, 5, 3, 2, 3, -3, 0, 3, 0,-16, -8, -2, -5, + -2, -7, -6, 0, -3, -6, -3, 1, -5, -1, 2, -1, -1, 12, 16, 5, + -7, 1, 9, 8,-10, -2, 5, 3, -6, 2, 7, 3, -4, 0, -1, -7, + 3, 4, -9,-24, 0, 2, 6, 3, -1, -1, 4, 7, 5, 3, -1, -2, + 3, 6, -9, 2, 1, 6,-13, 1, 1, 8,-10, 2, 1, 8, -7, 1, + -3, -3, 2, 22, -2, -3, -5, 12, -2, -3,-10, 2, -3, -1, -4, 2, + 11, 12, 8, 2, -5, -5, -5, -8, -6, -4, 0, -3, -2, -1, 3, 3, + 12, -6, -2, -1, 12, -8, -2, -2, 9, -7, 0, -3, 4, -6, 2, -2, + -19, 1, 12, -3, -4, 4, 5, -4, 6, 1, -2, -1, 4, -4, -2, 7, + -3, -4, -7, -8, -4, -4, -2, 0, -1, 2, 14, 16, -4, -2, 4, 4, + -1, 7, 2, -5, -2, 0, -1, 1, 4, -3, -1, 13, 6,-12,-14, 8, + -1, 5, 4, -5, -2, 5, 3, -9, -2, 7, 4,-12, -1, 7, 4, -9, + -6, -3, 1, 1, 11, 11, 0, -6, 6, 4, -2, -7,-12,-10, 3, 10, + -2, -3, -3, -2, 6, 11, 14, 10, -9,-11,-10,-10, 2, 2, 3, 2, + -7, -5, -7, -1, -1, 2, 0, 7, -1, 1, 0, 9, 3, 4, -5, -1, + 10, -1,-15, -1, 4, 1, -5, 2, -3, 1, -1, 1, -3, 1, 4, 4, + 2, -1, 4, 10, 6, 2, -1, 0, 2, 2, -7,-12, -4, 2, 0, -3, + -1, -4, -1, -8, 3, -1, 2, -9, 4, 0, 5, -5, 2, 0, 8, 3, + 3, 2, 1, 1, 4, -2, 0, 3, 2, -1, 4, 1, 0, 6, -1,-25, + -1, -2, -2, -4, -3, 0, -1, -4, -1, -1, -4, 2, 0, -6, 2, 25, + -11, -1, 5, 0, 7, 0, -2, 2, 10, -1, -3, 4, -5, -5, -2, -1, + 0, 6, 3, -1, -2, -1, -1, 1, -1, -7,-12, -5, 8, 6, 2, 4, + 2, 6, -1, -6, 9, 10, -1, -4, 1, 0, -4, 0, 3, -2, -9, -5, + -4, 3, 4, 0, -4, 3, 3, 0,-11, 0, 3, 2,-11, 3, 7, 2, + 2, -4, 7, 3, 1, -8, 7, 1, -1,-12, 4, 1, 3, -9, 2, 2, + 2, -2, -2, 9,-17, -3, 3, 1, -4, 7, 1, -6, 5, 4, -1, 3, + -1, 2, 0, -4, -7, 8, 12, -1, -2, 5, 4, -5, 3, -5, -8, -2, + 0, 0, -5, -2, -2, -8, 3, 27, -1, -4, -3, 6, -3, 1, -2, -7, + 4, 4, 1, -1, -7,-10, -7, -3, 10, 10, 5, 3, -2, -2, -4, -3, + 0, 1, 5, 7, 4, -2,-16,-20, 0, 4, 7, 8, 2, 0, -2, -1, + -2, 1, 3, 17, -3, 1, -2, -1, -1, -2, -1, -2, -1, -5, -1, 0, + 5, -3, 1, 0, 6, -2, 0, 0, -1, -2, 0, -3,-11, 1, 8, -1, + 3, 0, 0, 0, 0, 2, 4, 1, 2, 0, 6, 1, -2,-18, -3, 2, + -14, 0, 6, 1, -5, -2, -1, 1, -1, 1, 0, 1, 1, 7, 4, 0, + -1, 0, 1, -4, 1, 8, 3, -4, -3, 4, 1, 3, -6, 1, -4, 1, + 1,-12, 3, 3, -1,-10, 0, -1, 2, 0, 2, 1, 3, 2, 2, 4, + 3, 0, 0, 3, 2, 0, -2, 1, 5, 2, -5, 0, 6, -1,-14, -1, + -2, -6, -3, -3, 2, -1, 4, 5, 6, -1, -2, 0, 4, 4, -1, -5, + -4, 1,-11, 0, -1, 2, -4, 1, 2, -3, 3, -1, 1, -2, 15, 0, + 1, -1, 0, -2, 1, -4, -7, 1, -2, -6, -1, 21, -2, 2, -1, 1, + 21, -1, -2, 0, -1, -3, 1, -2, -9, -2, 2, -1, 2, 1, -4, -1, + 1, 8, 2, -6,-10, -1, 4, 0, -4, -3, 3, 3, 5, 0, -1, -1, + 3, 2, 1, -2, -2, -2, 4, 3, 5, 2, -4,-17, 0, -2, 4, 3, + -7, -4, 0, 3, 9, 9, 2, -1,-11, -6, 0, -1, 5, 1, 0, 1, + 0, 17, 5,-11, 3, -2, -6, 0, 2, -2, -4, 1, -4, 1, 2, -1, + -5, -1, -5, -3, -3, 5, -3, -2, 4, 16, 2, -5, -2, 5, -1, -1, + 0, 0, -4, 1, -1, 2, 5, 11, -1, -1, -2, 1, -4, -2, -3, -1, + -5, -1, 10, 0, 6, 1, 0, -3, 0, -4, 1, 0, -2, -4, 3, -1, + 6, 9, 3, 0, -2, 1, -2, 0, -2, -3, -2, -2, 1, 0, 1, -6, + 1, 0, 2, 1, -1, 3, -2, 1, 0, -1,-15, 0, -1, 5, 2, 6, + 2, 0, 2, 2, 0,-12, -4, 6, 0, 1, 4, -1, 1, 2, 1, -4, + 1, -2, -7, 0, 0, 0, 0, -1, -5, 2, 11, 3, 1, 3, 0, -6, + 0, -3, -9, -4, 1, 3, -1, 0, 4, 1, -2, 0, 7, -3, -1, 6, + 1, -2, 6, 2, 0, -1, 3, -2, -2, 4, 0, 2, -1, 2,-14, 2, + 2, 2, 0, -1, -2, 3, -3,-14, 0, 2, 3, -3, 5, 1, 3, 2, + 1, -3, 4,-14, 1, -2, 11, -1, 0, -1, 3, 0, -1, 1, 0, 2, + -2, 3, -3, 2, -4, -1, -4, 3, -1, 2, 1, 3, -6, -2, 2, 7, + -2, 1, 2, 0, -2, 0, 0, -1, 12, 5, -1, 2, -8, -1, 1, -7, + 2, -2, -4, 2, 11, 0,-11, -2, 3, 1, -3, -1, 0, 3, 1, -1, + 0, 3, 0, -2, 0, -6, -1, -3, 12, -7, -2, 0, 7, -2, 1, 1, + 1, 2, 2, 2, -1, 2, 0, 2,-23, 0, 4, 0, 3, 2, 1, 3, + -4, -5, -1, 5, -3, 5, 10, -1, 0, 0, 3, -4, 1, -1, 2, -5 +}; + +/* 6x16-entry codebook for inter-coded 8x4 vectors */ +DECLARE_ALIGNED(4, static const int8_t, svq1_inter_codebook_8x4)[3072] = { + 9, 8, 4, 0, -3, -4, -4, -3, 9, 8, 4, -1, -4, -5, -5, -3, + 8, 7, 3, -2, -5, -5, -5, -4, 6, 4, 1, -2, -4, -5, -4, -3, + -12,-14,-11, -4, 1, 5, 6, 6, -8,-10, -7, -5, -2, 1, 1, 1, + 5, 4, 3, 1, 0, 0, -1, -1, 13, 13, 9, 6, 3, 0, -1, -2, + -4, -4, -3, -1, 1, 4, 8, 11, -5, -6, -4, -2, 0, 3, 8, 12, + -7, -7, -6, -4, -2, 2, 7, 10, -7, -7, -5, -4, -2, 1, 5, 8, + -3, -2, -1, 1, 3, 6, 7, 6, 2, 3, 5, 7, 8, 8, 6, 4, + 4, 5, 4, 3, 1, -2, -6, -7, 1, 0, -2, -7,-10,-14,-17,-16, + -5, -4, 1, 8, 9, 3, -3, -7, -7, -6, 1, 11, 12, 5, -3, -8, + -8, -7, 0, 9, 11, 5, -3, -7, -8, -6, -1, 5, 8, 4, -2, -6, + -4, -5, -7, -8, -9, -9, -8, -6, -4, -5, -6, -7, -7, -6, -4, -2, + 0, 1, 2, 3, 5, 8, 10, 9, 1, 2, 3, 6, 9, 12, 14, 13, + 5, 6, 6, 5, 4, 3, 2, 1, 5, 6, 7, 7, 6, 6, 6, 4, + -1, 0, 1, 1, 3, 5, 5, 5,-13,-16,-17,-17,-14,-10, -6, -4, + 9, 11, 13, 16, 15, 13, 12, 10, -4, -5, -6, -7, -7, -7, -6, -5, + -6, -6, -7, -7, -7, -7, -6, -5, -2, -1, 0, 0, 0, 0, 0, -1, + -11,-13,-15,-16,-16,-14,-12,-10, 2, 3, 4, 5, 4, 3, 3, 3, + 6, 7, 8, 8, 8, 7, 6, 5, 3, 4, 3, 3, 3, 3, 3, 3, + 3, 4, 4, 1, -2, -7,-13,-17, 5, 7, 7, 5, 1, -5,-13,-19, + 6, 8, 9, 8, 5, -1, -9,-16, 6, 8, 10, 10, 7, 2, -4,-11, + 18, 9, -1,-10,-13, -9, -4, 0, 22, 12, -1,-12,-15,-10, -4, 2, + 23, 13, 0,-10,-13, -9, -3, 2, 20, 12, 2, -6, -9, -6, -2, 2, + -6, -6, -6, -7, -7, -7, -7, -6, -6, -7, -8, -8, -9, -9, -9, -8, + -3, -3, -3, -3, -3, -3, -3, -3, 12, 15, 18, 21, 21, 19, 17, 14, + 14, 16, 18, 18, 18, 16, 15, 13, 5, 6, 6, 5, 5, 4, 4, 3, + -6, -7, -9,-10,-10,-10, -9, -7,-10,-11,-13,-14,-14,-13,-12,-10, + -27,-17, -4, 5, 9, 10, 10, 7,-32,-19, -3, 7, 11, 12, 11, 8, + -30,-16, -2, 8, 12, 12, 10, 7,-23,-12, 0, 7, 10, 11, 9, 6, + 16, 17, 16, 12, 6, -1, -8,-12, 17, 18, 15, 10, 1, -8,-15,-18, + 15, 14, 10, 4, -5,-14,-20,-23, 10, 8, 4, -1, -9,-16,-21,-22, + -10,-12,-12,-11, -5, 4, 14, 20,-11,-13,-15,-12, -4, 7, 19, 27, + -11,-13,-14,-11, -3, 8, 21, 28,-10,-11,-12, -9, -2, 8, 18, 25, + -1, -1, -1, 1, 4, 6, 6, 5, 0, 0, 0, 2, 4, 3, 1, -2, + 0, 0, 2, 4, 4, -1, -7,-10, 0, 0, 3, 5, 3, -3,-11,-15, + -14,-13, -8, -1, 3, 3, -1, -4, -5, -4, -1, 4, 8, 8, 3, 0, + 3, 2, 2, 3, 4, 5, 3, 1, 5, 3, 0, -2, -2, -1, -1, -1, + 9, 1, -6, -6, -5, -3, -2, -1, 12, 1, -6, -6, -4, -2, -1, 0, + 14, 4, -4, -4, -2, -2, -1, -1, 14, 6, -1, -1, -1, -1, -1, -1, + 4, 6, 8, 10, 11, 9, 7, 5, -1, -1, -1, 0, 0, -1, -1, -2, + -2, -4, -4, -5, -5, -5, -5, -4, -2, -3, -3, -4, -4, -3, -2, -1, + 2, 3, 4, 4, 3, 1, 0, 0, -1, 1, 4, 5, 6, 5, 4, 3, + -8, -6, -2, 2, 3, 4, 4, 3,-14,-13, -9, -5, -2, -1, 0, 0, + -3, -4, -5, -4, 0, 7, 12, 13, -3, -4, -5, -5, -2, 4, 9, 10, + -2, -3, -4, -5, -4, -1, 3, 4, -1, -1, -2, -3, -3, -2, 0, 1, + 9, 5, -2, -8,-11,-10, -7, -4, 12, 10, 6, 2, 0, -1, 0, 0, + 2, 2, 3, 4, 3, 1, 1, 1, -9, -8, -4, 0, 1, 2, 1, 0, + 6, 8, 8, 5, 1, -5,-11,-13, 0, 1, 2, 2, -1, -4, -8,-11, + -3, -2, 1, 3, 3, 1, -1, -4, -2, -1, 2, 5, 6, 6, 4, 1, + 3, 4, 5, 5, 4, 1, -3, -6, 5, 6, 4, 2, 2, 2, 0, -3, + 6, 5, 0, -5, -5, -2, -1, -2, 7, 4, -3,-11,-12, -7, -3, -2, + 1, 0, -1, -1, -1, 0, 0, 0, 2, 3, 4, 4, 5, 5, 4, 3, + -7, -9, -9,-10,-10, -9, -7, -6, 3, 4, 5, 6, 5, 5, 5, 5, + -7, -7, -7, -7, -6, -6, -5, -4, -5, -4, -3, -1, -1, -1, 0, 0, + -3, -2, 1, 4, 5, 5, 5, 5, -2, -1, 3, 6, 9, 10, 10, 9, + -14, 1, 10, 3, -2, 0, 1, 1,-16, 2, 13, 3, -3, -1, 1, 0, + -15, 2, 12, 3, -4, -2, 1, 1,-10, 3, 10, 2, -3, -1, 1, 1, + 0, 1, 4, 2, -5,-10, -3, 11, -1, 1, 4, 2, -6,-13, -2, 15, + -1, 0, 3, 1, -6,-12, -1, 15, -1, 1, 2, 1, -4, -8, 0, 11, + 10, 5, -2, -2, 2, 5, 1, -4, 7, 0, -8, -6, 1, 5, 2, -4, + 2, -5,-12, -7, 2, 7, 4, -1, -1, -7,-10, -4, 4, 9, 7, 2, + -5, -5, -4, -6, -6, -5, -5, -3, -1, -2, -2, -4, -5, -6, -5, -4, + 6, 7, 7, 4, 0, -2, -3, -3, 13, 14, 13, 10, 5, 1, -1, -2, + 1, 1, 2, 2, 2, 2, 2, 2, -5, -6, -8, -9, -9, -8, -7, -6, + 7, 9, 10, 11, 11, 9, 7, 5, -1, -2, -3, -3, -4, -4, -4, -3, + -1, -1, 0, 0, 0, 0, -1, -1, -3, -3, -4, -5, -4, -3, -3, -2, + 2, 1, -1, -3, -3, -2, -1, 0, 12, 12, 8, 3, 1, 0, 0, 1, + -6, -8, -8, -6, -2, 2, 6, 8, 1, 1, -1, -2, 0, 3, 5, 7, + 3, 3, 1, -1, -1, 0, 0, 2, 0, 1, 0, -1, -1, -1, -2, -1, + 1, 0, 0, 0, 0, 0, 2, 4, 2, 1, 3, 4, 3, 1, 0, 2, + 2, 1, 0, 0, -1, -1, 0, 3, 5, 1, -6,-12,-13, -8, -1, 4, + -2, 0, -1, -2, -1, 0, 2, 3, -6, -3, -2, 0, 1, 1, 1, 1, + -9, -5, 0, 4, 5, 3, 1, 0, -8, -3, 3, 7, 8, 4, 1, 0, + 1, 2, 2, 3, 3, 1, -1, -3, 4, 5, 5, 6, 6, 5, 2, 0, + 0, 0, 0, 0, 1, 0, -2, -4, -3, -3, -4, -3, -3, -4, -7, -8, + 14, 12, 6, -1, -3, -3, 0, 0, 7, 5, 1, -3, -5, -4, -2, -1, + -2, -2, -2, -2, -2, -2, -1, -1, -6, -4, -1, 1, 1, 1, 0, -1, + 2, 2, 1, -3, -6, -7, -6, -3, 1, 0, -1, -3, -2, 1, 4, 6, + 0, 0, 1, 2, 4, 7, 8, 7, 0, 0, 0, 0, -1, -4, -7, -8, + 0, 2, 1, -2, -3, -3, -2, -1, -1, 1, 0, -3, -5, -2, 0, 2, + -2, -1, -2, -5, -4, 1, 6, 9, -3, -2, -3, -4, -2, 5, 11, 13, + -4, -2, 2, 6, 4, -3,-10,-14, -2, -1, 1, 4, 4, 1, -1, -2, + 0, 0, -1, -2, -2, 0, 4, 6, 2, 2, 0, -3, -3, 0, 5, 9, + -4, -4, -2, 1, 6, 9, 3, -7, -2, -2, -2, -1, 4, 8, 0,-11, + 1, 1, 0, 0, 2, 6, -1,-10, 2, 2, 1, 0, 2, 4, 0, -7, + -1, -2, -3, -6, -7, -8, -8, -8, 2, 3, 3, 1, -1, -2, -3, -4, + 5, 5, 5, 4, 3, 2, 0, -1, 3, 3, 3, 3, 2, 2, 1, 1, + 3, 3, 2, -2, -3, 0, 7, 10, 1, 2, 2, -2, -5, -4, 0, 3, + 0, 3, 4, 2, -3, -5, -6, -4, 0, 2, 4, 4, 1, -4, -7, -7, + 2, 4, 5, 5, 5, 5, 6, 6, -4, -4, -3, -5, -5, -3, -3, -2, + -3, -4, -4, -5, -4, -2, -2, -2, 1, 1, 0, 0, 2, 4, 5, 4, + -2, 0, 3, 4, 4, 3, 2, 2, -9, -7, -4, 0, 3, 6, 6, 6, + -5, -5, -3, -2, 0, 1, 3, 4, 5, 5, 2, -2, -4, -6, -5, -3, + 1, -6, -4, 7, 5, -2, -2, 1, 5, -5, -4, 6, 4, -5, -4, 1, + 5, -5, -4, 6, 4, -5, -3, 1, 1, -7, -3, 8, 7, -1, -3, 1, + -8, -7, -4, 0, 2, 4, 5, 5, 5, 6, 5, 2, -1, -5, -7, -7, + 5, 6, 4, 1, -3, -5, -6, -5, -7, -7, -5, -2, 1, 6, 9, 10, + 6, 3, 0, 1, 3, 0, -8,-14, 3, 0, -1, 1, 4, 3, 0, -4, + 1, 0, 0, 1, 2, 1, 1, 1, -1, -1, 1, 2, 1, -1, -1, 0, + 1, 1, 1, 1, 0, -2, -3, 0, 1, 2, 1, 0, -2, -8, -9, -4, + 1, 3, 3, 2, 1, -3, -3, 1, 0, 1, 1, 1, 1, 1, 4, 8, + 2, 5, 9, 7, 2, -1, -1, 1, -4, -1, 1, 0, -3, -4, -1, 2, + -3, 0, 3, 3, 0, -1, 0, 2, -4, -1, 1, 1, -2, -4, -5, -4, + 1, -1, -2, -2, -1, 2, 4, 5, 2, 1, 1, 0, -1, -1, 0, 0, + 2, 3, 4, 5, 4, 2, 1, 0, -9, -9, -6, -3, -1, -1, -1, -1, + -6, -6, 4, 7, 0, -2, -1, -2, -1, -2, 5, 6, -1, -2, 0, -1, + 4, -1, 1, 0, -4, -2, 0, -2, 7, 1, -1, -2, -3, 1, 3, 1, + 4, 2, 1, 3, 3, 1, 1, 2, 2, -2, -4, 0, 3, 1, 0, 0, + 1, -4, -8, -4, 1, 2, 1, 0, 2, -3, -9, -6, 0, 3, 3, 2, + -1, -1, 0, -1, -1, 0, 1, 2, 3, 1, -4, -8, -7, -3, 1, 2, + 2, -1, -3, -2, -1, 0, 1, 0, -1, 0, 5, 11, 9, 3, -1, -3, + -1, -2, -2, -1, 1, 1, 1, 1, 0, -1, 0, 3, 6, 6, 5, 5, + 2, 1, -1, -1, -2, -5, -6, -4, 2, 2, 2, 1, -1, -4, -5, -5, + -1, -3, -6, -7, -6, -4, -1, 1, 5, 5, 3, 4, 4, 3, 4, 5, + -1, -2, -3, -2, -2, -2, 0, 1, 0, 0, 0, 0, 0, 1, 2, 3, + -6, -6, -4, -1, 2, 2, 2, 2, -6, -7, -5, -2, 0, -1, -1, 0, + 2, 2, 2, 4, 4, 3, 3, 4, 2, 1, 0, -1, 0, 0, 2, 4, + 12, 5, -5, -8, -5, 0, 2, 2, 2, -3, -6, -3, 0, 0, -1, -2, + -2, -3, -1, 3, 4, 1, -2, -3, 2, 2, 3, 4, 3, 1, -1, -1, + 3, 2, 1, 0, 1, 4, 3, 0, 4, 3, 0, -5, -6, 0, 3, 3, + 2, 3, 1, -7,-12, -6, 1, 3, 1, 3, 4, -1, -6, -4, 0, 1, + -9, -4, 2, 6, 7, 4, 1, 0, -7, -1, 4, 6, 4, 0, -3, -3, + -6, 0, 4, 4, 1, -2, -3, -2, -4, 1, 3, 2, 0, -2, -1, 0, + 0, 5, 2, -5, -3, 3, 1, -4, -2, 4, 2, -6, -3, 6, 4, -3, + -1, 5, 3, -5, -1, 7, 3, -4, -1, 2, 0, -6, -3, 5, 3, -3, + -8, -3, 3, 5, 3, 1, -2, -2, 2, 4, 4, -2, -4, -3, 1, 3, + 2, 1, -3, -5, -3, 3, 4, 3, -5, -6, -5, 3, 10, 8, -1, -5, + 0, 3, 2, -4, -9, -7, 0, 6, -5, -1, 5, 7, 4, -1, -3, -3, + -5, -5, -2, 3, 6, 5, -1, -4, 9, 6, 0, -4, -2, 1, 1, -1, + -1, -1, -1, 1, 1, 0, -1, 0, -1, 0, 0, 0, 0, -1, -1, 0, + 2, 1, -2, -1, 1, 1, 0, 0, 12, 8, 2, -1, -1, -4, -7, -7, + 2, 1, 3, 6, 7, 4, 2, 0, 1, 0, -1, 0, -1, -4, -7, -8, + 0, 0, -1, 0, 0, 0, -1, -3, 0, 0, 0, 0, 1, 1, 0, -2, + -1, 0, 1, 1, 0, 0, -1, -2, 0, 0, -1, -3, -4, -3, -1, 1, + -1, 0, 0, 0, 1, 4, 10, 12, -1, 0, -2, -2, -3, -3, -1, 1, + -3, -1, -2, -4, 2, 9, 9, 7, -3, 0, -1, -3, 0, 2, -1, 1, + -1, 1, -2, -3, 0, -1, -3, 0, 0, 0, -3, -2, 0, -1, -1, 1, + -1, -2, -1, -1, -2, -1, -1, -2, 2, -1, -2, -1, 0, 1, 0, -2, + 3, -1, -2, 2, 5, 3, -1, -3, 1, -5, -5, 1, 6, 6, 2, 0, + 1, 2, 0, -1, 0, 1, 0, -2, -5, -3, -1, 0, 1, 2, 1, -2, + -7, -5, -2, -2, -2, -2, 0, 1, -1, 0, 1, 1, 0, 3, 9, 12, + 0, 6, 5, 1, -2, -3, 0, 3, 0, 6, 5, 1, 1, 1, 2, 3, + -5, -2, -2, -3, 0, 0, 0, 0, -6, -3, -3, -2, 0, 0, -1, -2, + 4, 4, 2, 1, 0, -1, -1, 0, -2, -2, 0, 1, 2, 1, 1, 0, + 2, 2, 1, -1, -3, -5, -9,-10, 2, 1, -1, -1, 1, 4, 4, 1, + 4, 0, -2, -2, -2, -2, -1, 0, 7, 1, -4, -3, -2, 0, 1, 1, + 10, 5, -1, -2, 0, 1, 1, 0, 5, 1, -3, -4, -3, -1, -1, -2, + 2, 1, -1, -3, -3, 1, 1, -1, -2, -1, 3, 0, -1, 1, 1, 0, + -3, 1, 7, 2, -3, -2, -1, 0, -2, 4, 8, -1, -8, -5, 0, 2, + -4, -1, 1, 2, 1, -3, -4, -2, -5, -3, -2, 1, 4, 4, 4, 6, + -3, -2, -4, -3, 0, 1, 1, 2, 2, 2, 2, 1, 2, 1, -1, -1, + -4, -1, 0, -1, -3, -3, -1, -1, 1, 4, 4, 2, 0, -1, -2, -3, + 4, 6, 5, 3, 2, 1, -2, -4, 0, 1, 1, 1, 1, -1, -4, -6, + 1, 2, 2, -1, -6, -5, -1, 2, -3, -2, 1, 1, -4, -3, 2, 5, + -2, -1, 2, 2, -3, -4, 0, 3, -2, -2, 2, 6, 5, 2, 1, 2, + 2, -3, -3, 0, 0, 2, 3, 1, 3, -1, 1, 3, 1, 2, -1, -5, + -5, -7, -4, -2, 1, 8, 8, 1, -1, 0, 2, 0, -3, 0, 1, -3, + -2, -5, -5, -2, -3, -1, 0, -2, -1, -4, 0, 4, 0, 2, 4, 0, + 0, 0, 8, 10, 2, 1, 3, -1, -4, -3, 2, 3, -3, -3, 1, -1, + 1, -2, -4, 2, 7, 3, -2, -1, 6, 4, -2, -1, 2, 0, -1, 3, + 1, 1, -2, -2, -2, -5, -3, 4, -6, -2, 1, 1, -1, -4, -2, 4, + -2, -1, -2, -2, 0, 1, 0, -2, -1, 1, 0, -1, 0, 0, -1, -3, + 0, 1, -2, -4, -3, -1, 0, 0, 6, 8, 5, 0, 0, 1, 2, 3, + -2, -2, 2, 5, 2, 0, 0, 1, 2, -2, -2, -1, -1, 1, 2, 4, + 2, -1, 0, 1, 0, 0, 0, 1, -8, -7, -1, 1, -1, -1, 1, 3, + 0, 3, 6, 2, -2, 1, 2, 0,-10, -7, -1, 0, -3, -1, 2, 1, + 0, 0, 2, 2, 1, 1, 1, -1, 3, 0, -2, -2, 0, 2, 1, 0, + 8, 1, 0, 0, -2, -3, -1, 0, 2, -2, 2, 5, 1, -2, -1, 1, + -3, -6, -3, -1, -3, -3, -1, 2, 2, 0, 1, 2, 2, 1, 0, 0, + 1, -1, -1, -2, -1, 0, 1, 0, 15, 9, 2, -1, -2, -3, -3, -3, + 0, -3, -2, 0, 0, -1, -1, -1, 1, 0, 1, 0, 0, -1, -1, -1, + 0, 2, 2, -2, -3, -3, -7, -8, 0, 2, 2, 0, 1, 2, 1, 1, + 1, 2, 2, 2, 3, 1, 0, 3, 1, 0, -1, -2, -1, -2, 0, 5, + -11, -6, -1, 1, 2, 3, 1, -3, 1, 4, 3, -1, -2, 1, 2, -1, + 2, 2, 1, -1, -2, 0, 1, -1, 0, 0, -1, -1, 0, 2, 3, 2, + 1, 1, 2, 1, -1, 1, 0, -4, 0, 0, 0, -2, -2, 2, 4, -2, + -2, -3, 0, 0, -1, 2, 1, -6, 0, 2, 5, 5, 3, 2, -1, -7, + 4, 2, 0, 0, 3, 3, 1, -1, 0, -1, -1, 3, 6, 4, 1, -1, + -2, -2, 0, 2, 2, 0, -2, -2, -1, 0, -1, -5, -7, -5, -1, 1, + 5, -1, -2, 0, 2, 4, 2, -5, 0, -5, -2, 2, 1, 2, 0, -6, + 6, 1, 0, 1, -2, -1, 4, 2, 2, -3, -3, 0, -1, -2, 0, 0, + 1, -1, 0, 2, 0, 0, 6, 11, 2, -1, -1, 0, -3, -2, 3, 5, + 0, -2, -1, 0, -1, 0, 0, -3, 1, -1, -1, -1, -2, -1, -3, -7, + 1, 1, -2, -2, 1, 3, 1, -2, -1, 2, 0, -1, -1, 1, 0, 0, + -4, 2, 3, -1, -2, -2, 0, 1,-11, -2, 4, 5, 6, 2, -1, -2, + -6, -2, 1, -1, -3, -4, 1, 9, -3, 0, 3, 3, 2, -3, -3, 3, + 1, 1, 0, 0, 1, -1, -2, 3, 2, 0, -3, -3, 0, -1, -1, 3, + 1, -1, -3, 1, 2, -6, -4, 6, 0, -2, -5, -2, 0, -3, -2, 3, + 2, 2, 1, -2, -2, 1, 2, -1, -1, 1, 1, -2, -1, 6, 7, -1, + 1, 0, -4, -2, 1, -2, -3, 1, -4, 0, -3, -2, 2, 0, -3, 0, + -3, 4, 3, 1, 8, 7, 0, -1, -3, 4, 1, -4, 2, 3, -2, -3, + -3, 6, 1, -4, 1, 1, -1, -1, -2, 4, -3, -3, 3, 0, -1, -1, + 1, 2, -4, 2, 4, -3, -1, 2, 3, -1, -4, 5, 4, -6, -3, 2 +}; + +/* 6x16-entry codebook for inter-coded 8x8 vectors */ +DECLARE_ALIGNED(4, static const int8_t, svq1_inter_codebook_8x8)[6144] = { + -4, -3, 4, 5, 2, 1, 1, 0, -5, -3, 5, 5, 2, 1, 0, 0, + -6, -4, 5, 5, 2, 1, 0, 0, -7, -4, 4, 5, 2, 1, 0, 0, + -8, -5, 3, 4, 2, 1, 0, 0, -8, -6, 3, 4, 1, 1, 1, 0, + -8, -6, 2, 4, 2, 1, 1, 0, -8, -6, 2, 4, 1, 1, 1, 1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -2, -2, -2, -2, -2, -2, + -2, -3, -3, -3, -3, -3, -3, -3, -2, -3, -3, -3, -3, -3, -4, -3, + -2, -2, -2, -2, -2, -3, -3, -2, 1, 1, 1, 1, 1, 0, -1, -1, + 4, 5, 5, 5, 4, 3, 3, 2, 7, 7, 8, 8, 8, 7, 6, 5, + 2, 1, 2, 4, 4, 0, -4, -6, 1, 1, 2, 5, 5, 1, -5, -7, + 1, 2, 1, 4, 5, 1, -5, -8, 1, 1, 1, 5, 5, 0, -6, -8, + 0, 1, 1, 5, 6, 1, -6, -9, 0, 0, 1, 4, 5, 0, -5, -8, + 0, 0, 1, 4, 5, 0, -5, -7, 0, 0, 1, 4, 4, 1, -4, -7, + 1, 2, 3, 0, -3, -4, -3, -1, 1, 3, 4, 0, -3, -4, -3, -1, + 2, 4, 5, 1, -3, -4, -3, -2, 2, 5, 6, 1, -3, -5, -4, -2, + 3, 6, 6, 1, -3, -5, -4, -2, 3, 6, 6, 1, -3, -5, -4, -2, + 3, 6, 6, 1, -3, -5, -4, -2, 3, 5, 5, 1, -3, -4, -4, -2, + 2, 2, 2, 2, 1, 0, 0, -1, 4, 4, 4, 3, 2, 1, 1, 0, + 4, 5, 4, 4, 3, 3, 2, 1, 4, 4, 4, 4, 4, 3, 2, 2, + 2, 3, 3, 3, 3, 3, 2, 1, -1, -1, -1, -1, 0, 0, 0, 0, + -5, -6, -6, -5, -5, -4, -3, -3, -7, -9, -9, -8, -7, -6, -6, -5, + 6, 6, 6, 6, 6, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 2, + 0, -1, -1, -1, -2, -2, -1, -1, -3, -5, -6, -6, -6, -6, -5, -4, + -3, -5, -6, -7, -6, -6, -5, -4, -1, -2, -2, -2, -2, -2, -1, -1, + 0, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, 3, + 2, 1, -2, -5, -4, 0, 2, 5, 2, 1, -2, -6, -5, 0, 3, 5, + 2, 1, -2, -6, -6, -1, 3, 6, 3, 2, -2, -7, -6, 0, 4, 7, + 2, 1, -2, -7, -5, 0, 5, 7, 2, 1, -2, -6, -5, 0, 4, 7, + 2, 1, -2, -6, -4, 0, 4, 6, 1, 1, -2, -5, -4, 0, 3, 6, + -10, -9, -6, -4, -1, 2, 3, 2,-10, -9, -5, -3, 0, 4, 4, 3, + -9, -7, -3, -1, 2, 5, 5, 3, -7, -5, -2, 0, 3, 5, 5, 3, + -6, -3, 0, 1, 4, 6, 5, 3, -4, -2, 1, 2, 3, 5, 4, 2, + -2, 0, 1, 2, 2, 4, 3, 1, -1, 1, 2, 2, 2, 3, 3, 1, + -4, -5, -5, -6, -6, -6, -6, -5, -3, -3, -4, -4, -4, -4, -4, -4, + 0, 0, 0, 0, -1, -1, -1, -1, 5, 5, 6, 5, 5, 4, 3, 2, + 5, 6, 7, 7, 7, 6, 5, 4, 3, 3, 4, 4, 4, 4, 3, 2, + 0, -1, 0, 0, -1, -1, 0, -1, -3, -3, -4, -4, -4, -4, -3, -3, + 1, -2, -5, 1, 5, 4, 2, 0, 1, -3, -6, 1, 6, 5, 2, 0, + 0, -4, -7, 0, 6, 6, 2, 1, -1, -5, -9, -1, 6, 6, 3, 1, + -1, -6,-10, -2, 6, 6, 3, 1, -1, -6, -9, -2, 5, 6, 3, 1, + -2, -6, -9, -2, 5, 5, 3, 1, -2, -6, -7, -2, 4, 4, 2, 1, + -5, -7, -8, -9, -9, -8, -7, -6, -5, -6, -6, -7, -7, -6, -6, -5, + -3, -3, -3, -4, -5, -5, -4, -4, -1, 0, 0, -1, -1, -1, -1, -1, + 0, 1, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 5, 5, 5, 4, + 3, 4, 5, 6, 8, 8, 8, 7, 3, 4, 5, 6, 7, 7, 7, 6, + 5, 6, 7, 8, 9, 10, 10, 9, 3, 4, 6, 7, 8, 9, 9, 8, + 0, 1, 2, 3, 4, 5, 5, 5, -1, -2, -1, -1, 0, 1, 2, 2, + -2, -3, -3, -3, -3, -2, -1, 0, -3, -4, -5, -5, -5, -5, -5, -4, + -4, -5, -5, -6, -7, -7, -6, -5, -3, -4, -5, -6, -7, -7, -6, -6, + 13, 7, 0, -3, -3, -4, -4, -5, 14, 7, 0, -3, -3, -4, -4, -4, + 15, 8, -1, -4, -4, -4, -5, -4, 15, 8, -1, -4, -4, -5, -4, -3, + 15, 7, -1, -4, -5, -5, -5, -4, 14, 7, -1, -4, -4, -4, -4, -3, + 12, 6, -1, -4, -4, -4, -4, -3, 11, 5, -1, -4, -4, -4, -4, -3, + -17, -4, 5, 4, 4, 4, 3, 3,-18, -5, 5, 4, 4, 4, 3, 3, + -19, -5, 6, 4, 4, 4, 3, 2,-20, -5, 6, 4, 4, 4, 3, 3, + -20, -4, 6, 4, 4, 5, 3, 3,-19, -5, 6, 4, 4, 5, 3, 3, + -18, -4, 5, 4, 4, 4, 3, 2,-17, -5, 4, 3, 4, 4, 3, 3, + -6, -6, -6, -4, -2, 1, 6, 11, -6, -7, -7, -4, -2, 2, 8, 13, + -8, -8, -7, -4, -2, 3, 9, 14, -8, -8, -7, -5, -1, 4, 10, 16, + -8, -8, -7, -5, -1, 4, 10, 17, -8, -8, -7, -4, 0, 5, 10, 16, + -8, -8, -6, -3, 0, 4, 9, 15, -7, -7, -5, -3, 0, 4, 8, 12, + 8, 7, 7, 5, 2, -2, -8,-14, 8, 8, 7, 5, 2, -2, -8,-15, + 8, 8, 7, 5, 1, -3, -9,-16, 8, 8, 7, 5, 1, -3,-10,-17, + 8, 9, 8, 5, 1, -3,-10,-17, 8, 8, 7, 4, 1, -4,-10,-16, + 7, 7, 7, 4, 1, -3, -9,-14, 6, 7, 6, 3, 0, -3, -9,-13, + 5, 1, -4, -4, -3, -1, 0, 0, 7, 2, -3, -3, -2, -1, 1, 0, + 7, 1, -3, -3, -1, 0, 1, 1, 6, 1, -3, -2, -1, 1, 1, 0, + 6, 0, -4, -2, -1, 0, 1, 0, 5, 0, -4, -3, -1, 0, 0, -1, + 5, 0, -3, -1, 0, 0, 0, -2, 4, 1, -2, -1, 0, 1, 0, -1, + 2, 2, 1, 1, -2, -6, -8, -8, 1, 1, 1, 1, -2, -5, -8, -8, + 1, 1, 1, 0, -1, -3, -5, -5, 0, 0, 0, 0, -1, -1, -1, -2, + 0, -1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 2, 3, 2, + 2, 1, 1, 1, 2, 3, 4, 3, 3, 3, 3, 3, 4, 4, 5, 4, + -4, -4, -3, -2, 0, 0, 1, 1, -4, -4, -3, -2, -1, 0, 0, 1, + -2, -2, -2, -1, -1, -1, 0, 0, 0, 1, 0, 0, 0, 0, 0, -1, + 2, 2, 2, 2, 2, 2, 1, 1, 3, 4, 4, 4, 4, 4, 4, 3, + 1, 1, 1, 3, 3, 4, 3, 3, -5, -6, -5, -4, -3, -3, -2, -2, + -4, -2, -1, -1, -1, -1, 0, 1, -4, -2, -1, -1, -1, -1, 0, 1, + -3, -2, -1, -1, -1, 0, 1, 2, -4, -3, -2, -1, -1, 1, 3, 3, + -4, -3, -3, -1, -1, 1, 4, 5, -4, -3, -2, -2, -1, 1, 4, 7, + -2, -2, -1, -1, 0, 2, 6, 8, -1, 0, 0, 1, 1, 4, 7, 8, + -3, -3, -3, -2, -2, -1, -1, 0, -1, -1, 0, 1, 2, 2, 3, 3, + 0, 1, 2, 4, 5, 6, 6, 5, -1, 0, 2, 3, 5, 6, 5, 3, + -1, -1, 0, 2, 3, 3, 2, 1, -2, -2, -1, 0, -1, -3, -4, -4, + 0, 0, -1, -1, -2, -4, -8, -7, 1, 2, 1, 0, -1, -4, -6, -7, + -2, 4, 1, -6, 0, 3, 0, 0, -2, 5, 1, -7, 0, 3, 0, 0, + -3, 5, 1, -8, 0, 3, -1, -1, -2, 6, 1, -9, 0, 3, 0, -1, + -2, 6, 2, -8, 0, 4, 0, -1, -3, 5, 1, -7, 1, 4, 0, 0, + -2, 4, 1, -7, 0, 4, 1, 0, -1, 4, 1, -6, 0, 3, 1, 0, + 0, 0, 0, 3, 4, 5, 4, 1, 1, 1, 1, 2, 3, 3, 2, 0, + 2, 2, 1, 2, 2, 1, -1, -2, 4, 3, 1, 1, 0, -1, -3, -5, + 5, 3, 1, -1, -2, -3, -4, -6, 5, 3, 0, -2, -3, -5, -6, -7, + 4, 3, 0, -2, -3, -4, -5, -5, 4, 3, 0, -1, -2, -2, -3, -3, + 0, 0, 0, 0, -1, -5, -2, 6, 0, 0, 0, 1, -1, -6, -2, 8, + 0, 0, 0, 2, 0, -6, -3, 9, 0, -1, 0, 2, 0, -7, -2, 10, + 0, -1, 0, 2, -1, -8, -3, 10, 0, -1, -1, 2, -1, -7, -3, 9, + 0, -1, 0, 1, -1, -6, -3, 8, 0, 0, 0, 1, 0, -5, -2, 7, + 2, 3, 3, 2, 1, 0, -1, -1, 3, 4, 3, 2, 1, 0, -1, -2, + 3, 4, 4, 2, 1, -1, -2, -3, 2, 3, 3, 2, 0, -1, -2, -3, + -1, 0, 1, 1, 0, -1, -2, -2, -5, -4, -3, -1, 0, 1, 1, 1, + -8, -8, -5, -1, 1, 3, 4, 3,-10, -9, -5, 0, 3, 5, 6, 5, + -5, -1, 4, 5, 3, 1, 0, 0, -6, -1, 4, 5, 2, 0, -1, -2, + -6, -1, 5, 4, 2, -1, -2, -2, -7, -1, 4, 4, 1, -2, -3, -3, + -6, -1, 5, 4, 1, -2, -3, -3, -5, 0, 4, 4, 1, -1, -2, -2, + -4, 0, 5, 4, 1, -1, -1, -2, -3, 1, 4, 3, 1, -1, -1, -2, + -2, -3, -2, 1, 4, 6, 5, 3, -3, -4, -4, 0, 3, 5, 4, 2, + -3, -5, -5, -1, 2, 4, 3, 1, -4, -6, -4, -1, 2, 4, 2, -1, + -2, -4, -3, 1, 2, 4, 2, -1, -2, -4, -2, 1, 3, 3, 1, -2, + -2, -3, -2, 1, 3, 3, 1, -2, -2, -2, -1, 1, 3, 3, 0, -2, + -4, -4, -3, -2, -1, 2, 5, 7, -4, -4, -3, -3, -2, 1, 5, 7, + -2, -3, -2, -3, -3, -1, 3, 5, -1, -1, 0, -2, -3, -2, 2, 4, + 1, 1, 1, -1, -4, -3, 1, 3, 4, 3, 2, -1, -4, -3, -1, 1, + 6, 4, 3, 0, -3, -3, -2, 0, 6, 5, 3, 1, -2, -3, -2, -1, + 12, 11, 8, 4, 0, -2, -2, -1, 10, 9, 6, 2, -1, -2, -1, 0, + 4, 3, 2, 0, -1, -1, 0, 1, -1, -1, -1, -1, -2, 0, 1, 2, + -3, -5, -4, -2, -2, 0, 2, 3, -5, -5, -4, -2, -1, 0, 1, 2, + -5, -5, -4, -2, -1, 0, 1, 1, -4, -4, -3, -2, -2, -1, 0, 0, + 3, 3, 2, -1, -3, -4, -3, -2, 3, 2, 0, -2, -4, -4, -3, -2, + 2, 2, 1, -1, -3, -5, -4, -3, 3, 3, 3, 1, -2, -3, -3, -3, + 4, 4, 4, 3, 0, -2, -2, -2, 5, 5, 5, 3, 0, -1, -2, -2, + 5, 5, 4, 2, -1, -2, -3, -2, 3, 3, 3, 0, -2, -4, -4, -4, + -1, -1, 4, -2, -2, 6, 2, -5, -1, 0, 4, -2, -3, 6, 2, -6, + -1, 0, 4, -2, -3, 7, 3, -7, -1, -1, 4, -3, -4, 8, 3, -7, + 0, -1, 4, -3, -4, 7, 3, -6, -1, -1, 4, -3, -4, 7, 3, -6, + -1, -1, 3, -3, -4, 6, 3, -6, -1, 0, 3, -2, -3, 6, 3, -5, + 1, -2, -7, 2, 5, -2, -1, 1, 1, -2, -8, 3, 6, -3, -1, 2, + 2, -2, -9, 4, 7, -4, -2, 2, 3, -1, -9, 5, 7, -4, -1, 3, + 3, -1, -9, 4, 7, -4, -2, 2, 3, -1, -7, 4, 6, -4, -2, 1, + 2, 0, -6, 4, 6, -4, -1, 1, 2, 0, -5, 3, 4, -3, -1, 1, + -2, 2, 2, 0, 0, -1, -3, -4, -2, 2, 2, 1, 1, 0, -2, -4, + -2, 2, 2, 2, 2, 1, -1, -2, -3, 2, 3, 3, 4, 2, 0, -2, + -3, 2, 3, 2, 4, 2, 0, -3, -4, 1, 2, 1, 2, 1, -1, -3, + -5, 0, 1, 0, 1, 1, -2, -3, -4, 0, 0, 0, 1, 0, -2, -3, + 0, 0, -1, -2, -2, 2, 7, 8, 0, 0, -1, -3, -2, 1, 6, 7, + 0, 1, -1, -3, -3, 0, 4, 5, 0, 1, 0, -1, -1, 0, 1, 3, + 0, 2, 1, 1, 0, -1, 0, 1, -2, 0, 1, 2, 1, 0, -1, -1, + -5, -2, 0, 1, 1, 0, -3, -3, -6, -4, -1, 1, 1, -1, -3, -4, + -4, -2, 2, 5, 6, 4, 3, 2, -5, -3, 1, 4, 4, 2, 0, 0, + -4, -2, 0, 2, 1, -1, -2, -2, -2, -1, 0, 1, 0, -2, -3, -2, + -2, 0, 0, 0, -1, -1, -2, -1, -2, -1, -1, 0, 0, 0, 1, 2, + -2, -2, -1, -1, 0, 1, 3, 4, -2, -3, -2, -1, 0, 2, 4, 5, + 2, 1, -2, -2, -1, 0, 1, 0, 1, 0, -3, -3, -1, 0, 1, 0, + 0, -1, -3, -3, -1, 1, 1, 1, 0, 0, -3, -1, 1, 2, 3, 3, + 0, -1, -3, -1, 1, 3, 3, 3, -2, -2, -4, -2, 1, 3, 4, 4, + -3, -3, -4, -2, 1, 3, 3, 4, -2, -3, -5, -2, 1, 2, 3, 3, + 4, 5, 3, 4, 4, 4, 4, 5, 3, 3, 1, 0, 0, 0, 0, 1, + 1, 1, -1, -2, -3, -4, -3, -2, 2, 2, 0, -2, -2, -4, -3, -2, + 2, 3, 1, -1, -1, -3, -3, -2, 1, 2, 0, 0, -1, -2, -2, -1, + 0, 1, 0, -1, -1, -3, -2, -1, 1, 1, 0, -1, -1, -2, -2, -2, + -2, -1, -1, 0, 1, 2, 1, 0, 1, 2, 3, 5, 6, 5, 5, 3, + 1, 2, 3, 4, 5, 5, 4, 3, -2, -2, -3, -3, -2, -1, 0, 0, + -3, -3, -4, -5, -4, -3, -2, -1, -1, -1, -2, -2, -2, -1, 0, 0, + 0, 1, 0, -1, -1, 0, 0, 1, -1, 0, -1, -2, -3, -2, -2, -1, + 7, 7, 6, 5, 4, 2, -1, -2, 3, 3, 2, 2, 1, 0, -2, -3, + 0, -1, -1, -1, 0, -1, -2, -2, -1, -3, -2, -1, 0, 0, 0, 1, + 0, -2, -2, -1, -1, 1, 2, 2, 3, 1, -1, -1, -1, 1, 2, 2, + 3, 1, -2, -3, -2, -1, 1, 2, 1, -2, -5, -6, -5, -3, -2, 0, + 0, -1, -2, -3, -1, 0, -2, -2, 0, 0, -1, -1, 0, 1, -1, -2, + 0, 0, -2, -1, 0, 0, 0, -2, -1, -2, -3, -3, -2, -1, -3, -3, + -1, -2, -3, -3, -2, -2, -3, -4, 2, 2, 0, 0, 0, 0, -1, -2, + 5, 5, 3, 2, 2, 2, 0, -1, 8, 8, 6, 5, 4, 4, 2, 1, + -7, -8, -6, -3, -1, -1, -2, -1, -5, -5, -3, 0, 2, 1, 0, 0, + -1, -1, 0, 3, 4, 3, 1, 1, 2, 1, 1, 3, 4, 3, 2, 2, + 3, 2, 0, 2, 3, 2, 1, 2, 4, 2, -1, -1, 0, 1, 1, 1, + 3, 2, -2, -3, -2, -1, 0, 1, 3, 1, -3, -4, -3, -2, 0, 1, + -4, -2, -1, 2, 3, 3, 1, 0, -7, -5, -4, -2, 0, 0, -1, -2, + -6, -5, -5, -4, -2, -2, -2, -3, -1, 0, -1, -1, 0, 0, 0, -1, + 2, 3, 2, 2, 2, 2, 1, 0, 3, 5, 4, 3, 1, 0, 1, 0, + 3, 4, 3, 2, 0, -1, -1, -1, 5, 5, 3, 1, 0, -1, -1, -1, + 1, 1, 0, -1, -3, -5, -6, -4, 1, 1, 0, 0, 0, -3, -3, -1, + 0, -1, -1, 0, 1, 0, 1, 3, -2, -2, -3, -1, 2, 2, 4, 7, + -2, -2, -2, 0, 2, 2, 3, 6, -1, 0, 0, 1, 1, 0, 0, 3, + 0, 3, 3, 3, 1, -2, -3, -1, 1, 3, 4, 3, 0, -3, -5, -4, + 0, 2, 0, -1, -3, -4, -2, -2, 1, 4, 2, 0, -2, -3, -2, -1, + 3, 6, 3, 1, -2, -2, 0, -1, 4, 7, 4, 1, -2, -3, -1, 0, + 3, 6, 3, 0, -3, -3, -1, 0, 1, 3, 0, -1, -3, -2, 1, 1, + 0, 1, -1, -2, -3, -1, 2, 2, -2, -1, -3, -3, -3, -1, 1, 2, + 3, 1, -1, 0, 1, 0, 0, 0, 2, -1, -2, -1, 1, 0, -1, -1, + 1, -1, -2, 0, 1, 0, -2, -3, 0, -2, -1, 1, 3, 1, -3, -5, + 0, -2, -1, 2, 5, 2, -3, -5, 0, -2, -1, 4, 6, 3, -2, -5, + 0, -2, 0, 4, 7, 4, -2, -4, 0, -2, 0, 4, 6, 4, -2, -4, + -2, -2, -3, -4, -3, -2, -1, 0, 1, 1, 0, -1, -1, -1, 0, 1, + 3, 3, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2, 1, 0, 0, 1, + 0, 0, 0, 0, -1, -1, -1, -1, -4, -4, -4, -4, -4, -4, -4, -3, + -3, -3, -2, -3, -2, -1, -1, 0, 3, 4, 4, 5, 5, 6, 6, 7, + -1, -2, 7, -2, -4, -1, -1, 0, -1, -2, 9, -1, -4, -1, -1, 0, + -1, -3, 10, -1, -4, -1, -1, 1, -1, -3, 10, -2, -3, -1, -1, 2, + -1, -2, 10, -2, -4, -1, -1, 2, -1, -2, 9, -2, -4, -1, -1, 2, + -1, -2, 8, -2, -4, 0, -1, 1, 0, -2, 7, -2, -3, -1, 0, 2, + 3, -4, 1, 3, -3, -2, 1, 0, 3, -5, 1, 4, -3, -2, 1, 0, + 3, -6, 2, 5, -3, -1, 3, 0, 3, -6, 2, 5, -3, -1, 2, 0, + 3, -6, 1, 5, -4, -2, 3, 0, 3, -6, 1, 5, -3, -2, 2, 0, + 2, -6, 1, 4, -3, -1, 1, 0, 2, -6, 1, 4, -2, -1, 1, 0, + 0, 0, 1, 1, 1, 0, 0, 2, 0, -1, 1, 1, 1, 0, 0, 2, + 0, -1, 0, 0, 0, 0, 0, 2, 0, -1, 0, 0, 0, 0, -1, 0, + 1, 0, 1, 0, 0, -1, -2, -1, 3, 1, 1, 0, 0, -2, -4, -3, + 5, 3, 2, 1, 0, -3, -5, -4, 5, 4, 2, 0, -1, -4, -5, -5, + 1, 0, -1, -2, -2, -3, -6, -9, 2, 0, -1, -1, 0, 0, -3, -6, + 1, 0, 0, -1, 0, 0, -2, -5, 2, 1, 1, 1, 1, 2, -1, -3, + 1, 1, 2, 1, 2, 2, 1, -1, 1, 1, 2, 1, 1, 1, 1, 1, + 0, 0, 2, 1, 0, 0, 2, 2, 0, 1, 2, 2, 0, 0, 2, 2, + -4, -3, 0, 1, 4, 6, 4, 3, -3, -2, 0, 0, 2, 4, 1, 0, + -1, -1, 0, 0, 1, 1, -2, -3, 1, 1, 1, 0, 1, 1, -3, -5, + 1, 1, 1, 0, 1, 1, -3, -5, -1, 0, 0, -1, 1, 1, -2, -4, + -1, 0, 0, -1, 1, 2, 0, -2, -1, 0, 0, 0, 2, 3, 1, 0, + -1, 0, 3, 4, 0, -4, -5, -5, 0, 0, 4, 5, 2, -2, -3, -2, + 0, -1, 2, 4, 2, -1, -1, 0, 0, -2, -1, 1, 0, -2, 0, 1, + 1, -2, -2, 0, 0, -1, -1, 1, 1, -2, -3, 0, 1, 0, -1, 0, + 1, -2, -2, 1, 3, 1, 0, 0, 1, -2, -1, 2, 4, 2, 0, 0, + 1, 2, 3, 2, 0, 2, 2, 1, -1, 0, 1, 0, -3, 1, 1, 1, + -1, 0, 0, -2, -4, 0, 2, 1, -1, 2, 2, -1, -5, 0, 2, 1, + -1, 3, 4, -1, -5, 0, 2, 1, -2, 2, 4, 0, -4, -1, 0, 0, + -4, 0, 2, 0, -4, -2, 0, 0, -5, -1, 2, 1, -2, 1, 3, 2, + 1, 0, 1, 0, 1, 2, -1, -2, 2, 0, -1, -2, 1, 3, 0, -1, + 3, 0, -2, -4, 0, 3, 1, 0, 5, 1, -3, -5, -2, 2, 1, 1, + 6, 1, -2, -5, -2, 1, 0, 1, 5, 1, -1, -5, -2, 0, -1, 0, + 3, 0, -2, -4, -2, 0, -1, 0, 1, -1, 0, -2, 0, 1, 0, 1, + 1, 1, 2, 3, 2, 1, 1, 2, -1, -1, 0, 1, 1, 0, 1, 1, + -4, -3, 0, 0, 1, 1, 1, 2, -4, -3, 0, 2, 2, 2, 3, 2, + -5, -4, 0, 1, 1, 1, 1, 2, -5, -4, -1, -1, -2, -2, -1, 0, + -3, -2, 0, 0, -2, -3, -2, -1, 2, 3, 4, 4, 2, 0, 0, 0, + -4, -2, 0, 1, 0, 0, 0, 0, -3, -1, 1, 1, 0, 0, 0, 0, + -2, 0, 2, 2, 0, 0, 0, 2, -1, 1, 2, 1, -1, 0, 3, 5, + 0, 2, 1, -1, -2, 0, 5, 6, 0, 1, 0, -3, -3, 0, 4, 6, + 1, 1, -2, -4, -4, -3, 1, 2, 1, 0, -2, -4, -5, -4, -2, 0, + -1, -3, -3, -3, -3, -2, -1, -1, 3, 2, 1, 0, 0, 1, 1, 1, + 5, 4, 3, 2, 1, 1, 2, 2, 2, 1, 0, -2, -2, -2, -1, -1, + 0, 0, 0, -1, -2, -2, -2, -2, 0, 1, 3, 3, 2, 1, -1, -1, + 0, 1, 3, 4, 3, 2, 1, -1, -4, -3, -1, 1, 0, -2, -3, -3, + -3, -4, -7, -8, -7, -4, -1, 2, 0, -1, -3, -4, -4, -2, 0, 2, + 1, 0, 0, -1, -3, -2, 0, 2, 2, 1, 1, 0, -1, -1, 0, 2, + 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 0, 1, 2, 3, 3, 2, 2, 0, 0, 1, 3, 4, 4, 3, 2, + 3, 3, 3, 0, -1, 0, 1, 2, 1, 1, 1, -1, -2, -1, -1, 1, + -2, -2, -1, -3, -3, -2, -2, 0, -4, -4, -2, -2, -2, -2, -3, 0, + -4, -4, -1, 1, 1, 0, -1, 2, -3, -1, 2, 3, 4, 3, 3, 5, + -2, 0, 2, 3, 3, 3, 3, 3, -2, -2, 0, 0, 0, 0, 0, 1, + 0, 2, 1, -1, -3, -1, 3, -2, -1, 0, -1, -1, -3, 0, 4, -2, + -2, -2, -2, -2, -2, 1, 5, -2, -3, -2, -3, -1, -2, 1, 4, -3, + -2, 0, -1, 0, -1, 0, 3, -5, 1, 2, 1, 2, 0, 0, 2, -5, + 2, 4, 2, 3, 1, 1, 3, -3, 1, 2, 1, 1, 0, 1, 4, -2, + 4, -3, -4, -1, 3, 3, 1, 3, 4, -4, -4, -1, 3, 2, 0, 2, + 4, -3, -4, 0, 2, 2, -1, 1, 4, -3, -2, 1, 2, 1, -2, 0, + 2, -4, -2, 1, 2, 0, -3, 0, 2, -3, -2, 0, 1, 0, -2, 2, + 3, -1, -1, 0, 0, 0, 0, 3, 2, -2, -2, -2, -1, -1, -1, 2, + 2, 2, 3, 4, 3, 1, 0, -1, 1, 0, 1, 2, 1, -1, -2, -2, + 2, 1, 2, 1, 1, 0, -1, -1, 4, 3, 4, 3, 2, 1, 1, 1, + 3, 2, 2, 2, 1, 1, 1, 1, -1, -2, -1, 0, -1, -1, -1, -1, + -3, -3, -2, -1, -2, -2, -2, -2, -4, -4, -3, -3, -4, -4, -3, -3, + 2, 1, -1, -3, -4, -2, 3, 4, 2, 2, 1, -1, -3, -2, 1, 2, + 1, 2, 3, 3, 0, -2, -1, -2, -1, 0, 2, 4, 2, 0, -1, -3, + -2, -2, 0, 3, 3, 2, 0, -3, 0, -2, -3, -1, 1, 2, 2, -1, + 3, -1, -4, -5, -3, 0, 2, 0, 6, 3, -2, -6, -5, 0, 3, 1, + -2, 3, -2, 0, 3, -2, -2, 1, -3, 4, -3, 0, 3, -2, -1, 2, + -3, 5, -3, 0, 4, -2, -1, 2, -2, 4, -4, -1, 3, -3, -2, 2, + -3, 4, -3, 0, 3, -3, -1, 2, -2, 5, -2, 0, 3, -3, -1, 2, + -2, 4, -3, 1, 3, -2, -1, 2, -2, 3, -2, 1, 3, -2, 0, 2, + 1, 0, 0, -1, 1, 2, -4, -1, 2, 0, 0, -1, 1, 2, -4, -2, + 1, 1, 1, -1, 2, 4, -2, 0, 0, -1, 1, -1, 2, 5, -1, 1, + 0, -1, 0, -2, 1, 5, -1, 1, 0, -1, -1, -2, 0, 3, -3, -1, + 1, 1, 0, -2, 0, 3, -3, -1, 1, 1, 0, -3, 0, 3, -2, 0, + 1, 0, -1, 1, 1, 2, 4, 5, 1, 0, -1, 1, 1, 1, 5, 7, + 0, 0, -2, -1, -1, 0, 3, 5, 0, -1, -2, -1, -1, -1, 2, 3, + 0, -1, -3, -1, -1, -1, 1, 2, -1, -2, -4, -2, -2, -2, 0, 0, + -1, -2, -2, -1, -2, -2, 0, 0, 0, -1, -1, 0, -1, -1, 0, 0, + 3, 3, 0, -1, -1, 1, 4, 4, 2, 3, 0, -2, -2, 0, 1, 1, + 2, 3, 1, -1, -1, 0, 1, 0, 1, 2, 0, -1, -1, -1, 0, -2, + 0, 1, 0, -1, -2, -1, 0, -2, 0, 1, 0, -1, -2, -1, 1, 0, + 1, 1, -1, -3, -4, -3, 1, 3, 1, 2, -1, -3, -5, -4, 1, 3, + -3, -2, 0, 1, 1, 1, 0, -2, 0, 1, 1, 1, 0, 0, -1, -3, + 1, 2, 1, 1, 0, -1, -1, -2, 0, -1, -3, -1, -1, -1, 0, -1, + 0, -3, -6, -3, -2, -1, 1, 1, 2, -1, -4, -3, -2, 0, 2, 2, + 5, 4, 1, 1, 0, 1, 3, 2, 5, 4, 2, 1, 0, -1, 0, 1, + -2, 0, -2, -5, -6, -3, 0, 0, -2, 0, 1, 0, -1, 1, 2, 2, + -2, 0, 1, 3, 2, 2, 2, 1, -2, 0, 2, 4, 3, 2, 1, 1, + -2, 0, 2, 3, 2, 0, -1, 0, -3, -1, 1, 1, 0, -1, -1, 1, + -4, -1, 1, 0, -1, -2, 0, 2, -4, -1, 0, -1, -1, -2, 1, 4, + -3, 0, 0, -1, 1, 1, 1, 0, -3, 1, 0, -1, 0, 0, -1, -1, + -1, 3, 3, 0, 1, 0, 0, 1, -3, 2, 2, -2, -1, 0, 0, 1, + -5, 0, 0, -2, -1, 1, 0, 2, -7, -2, 1, 0, 1, 2, 2, 2, + -5, 0, 3, 2, 3, 3, 2, 2, -3, 2, 4, 1, 0, 0, -2, -3, + 5, 2, -2, -2, 0, -1, -1, -1, 2, -1, -4, -3, -1, -2, -1, -1, + 0, -2, -2, 1, 2, -1, 0, 1, -1, -2, -1, 3, 3, -1, 0, 2, + 1, 0, 0, 3, 3, -2, -1, 2, 2, 1, 1, 3, 2, -2, -2, 0, + 1, 0, -1, 1, 1, -3, -3, -2, 1, 0, 1, 2, 3, 0, 0, 0, + -4, -5, -3, 0, 1, -1, -2, -1, -2, -3, -1, 1, 2, 0, 0, 0, + 1, 1, 2, 1, 2, 1, 1, 1, 3, 4, 3, 1, 0, -2, -1, -1, + 3, 3, 2, 0, -2, -3, -3, -2, 1, 1, 0, -1, -2, -4, -2, -2, + 2, 1, 0, 0, 0, -1, 0, 1, 2, 1, 1, 1, 1, 1, 1, 3, + 0, 0, 0, -1, -2, -1, 1, 0, -2, -1, -1, -2, -3, -2, 0, 0, + -1, 0, 0, -1, -2, 0, 1, 1, 1, 1, 0, -1, -1, 1, 3, 1, + 2, 2, 0, -2, -1, 2, 3, 0, 3, 1, -1, -1, 1, 4, 2, -2, + 2, 0, -3, -1, 3, 5, 0, -5, 1, -1, -2, 0, 3, 3, -1, -6, + -1, 0, 3, 4, 2, 0, 1, 2, -2, -1, 0, 1, -1, -2, 0, 1, + -2, -3, -2, -3, -6, -7, -6, -3, 2, 2, 3, 1, -1, -2, -3, -2, + 2, 2, 3, 1, 0, 0, 0, 0, 2, 1, 1, 0, 1, 1, 0, 1, + 1, 0, 0, 0, 0, 1, 1, 2, 1, 0, -1, 0, 0, 2, 2, 1, + 1, 1, 3, 1, -1, -1, -1, 1, -2, -1, 0, 0, -2, -2, -1, 2, + -2, -2, 1, 1, 1, 0, 1, 3, -2, -2, 0, -1, 0, -1, 0, 2, + 0, 0, 1, 0, -1, -1, -2, 1, 3, 2, 2, 1, 0, -2, -2, 1, + 5, 3, 3, 2, 1, 1, 1, 4, 0, -3, -4, -5, -4, -3, -1, 1, + -6, -4, -1, 2, 2, 0, 0, -1, -4, -2, 1, 3, 3, 2, 2, 0, + -3, -2, -1, 2, 3, 3, 2, 0, -3, -2, -2, 1, 2, 1, 1, -1, + -2, -2, -2, 0, 2, 2, 1, -1, -1, -1, -1, 1, 2, 3, 2, 0, + -1, -1, -2, 1, 2, 2, 2, -1, 0, -1, -2, 0, 2, 1, 0, -1, + 6, 4, 2, 1, 0, 0, 0, 1, 4, 2, -1, -2, -2, -2, -1, -1, + 2, 1, -1, -2, -2, -2, -2, -1, 2, 2, 0, -2, -2, -2, -1, 0, + 0, 0, -1, -2, -2, -1, 0, 1, -3, -3, -2, -1, -1, -2, -1, 0, + -3, -2, 2, 3, 2, 0, -1, -2, -2, 0, 4, 5, 5, 2, 0, -1, + 5, 4, 2, 0, -1, -2, -1, -1, 4, 3, 2, 1, 0, -1, 0, -1, + 1, 1, 0, 1, 1, 0, 1, -1, -2, -1, -1, 0, 0, -2, -2, -3, + -1, 0, 0, 0, -1, -3, -3, -5, 0, 1, 1, -1, -1, -2, -2, -3, + -1, -1, -1, -2, -1, 1, 3, 1, -1, -2, -2, -1, 2, 5, 6, 5, + -3, -3, -2, 1, 1, -2, -1, -1, 1, 2, 3, 4, 1, -3, -1, -3, + 3, 2, 0, 1, -1, -3, -1, -3, 1, 0, -1, 0, -1, -1, 1, 0, + 1, 1, 0, 1, 2, 2, 5, 3, 1, 1, 1, 2, 2, 2, 3, 0, + -3, -1, -2, -2, -3, -3, -1, -3, -1, 1, 1, 0, -1, -1, 0, -2, + 2, 0, -2, -2, 2, 4, 1, -2, 1, 0, -2, -1, 3, 5, 2, -1, + -1, -2, -3, -2, 1, 3, 1, -2, -1, -2, -1, -1, 0, 2, 1, -1, + 0, 0, 1, 1, 1, 2, 2, 0, 0, 1, 4, 4, 2, 2, 3, 1, + -2, -1, 2, 1, -2, -3, -2, -3, -1, 0, 1, 0, -3, -4, -4, -5, + 4, 0, -3, -4, -4, -4, -2, -1, 5, 0, -1, 0, -1, -3, -2, -1, + 4, 0, 0, 1, 1, 0, 0, 0, 0, -3, -2, -1, 0, 0, 1, 0, + 0, -2, 0, 0, 1, 1, 2, 1, 2, 0, 0, 0, 1, 1, 1, 0, + 2, 0, -1, -1, 1, 1, 1, 0, 1, -1, -2, -2, 0, 2, 2, 2, + -3, -5, -2, 0, -1, -3, -3, 0, 0, -2, 0, 2, 2, 0, 0, 3, + 2, -1, -2, 0, 0, -1, -1, 2, 5, 2, -1, -1, -1, -1, -1, 2, + 5, 2, 0, -1, -1, 0, -1, 2, 2, 1, 0, 0, 0, 1, 0, 2, + -1, -1, 1, 1, 2, 2, 1, 2, -3, -2, 0, 0, 0, 0, -2, -1, + 0, 3, 2, 0, -2, -3, -3, -3, 0, 3, 3, 1, 0, 0, 1, 2, + -1, 0, -1, -2, -1, -1, 1, 3, -1, 0, -1, -2, -1, -1, 0, 2, + -1, 0, -1, -2, 0, 0, -1, 2, -1, 0, -1, -2, -1, -1, -2, 1, + 0, 1, 0, -3, -1, -1, -1, 2, 5, 5, 2, -1, -1, -1, 1, 3, + 0, 0, 1, -1, -3, -2, 0, 2, 1, 1, 3, 0, -2, -2, 0, 1, + 1, 1, 3, 1, 0, 0, -1, -1, 0, -1, 2, 1, 1, 0, -1, -3, + -1, -2, 1, 1, 1, 0, -2, -4, -1, 0, 2, 1, 1, 0, -1, -3, + 1, 1, 3, 2, 1, 0, -2, -3, 2, 2, 4, 2, 1, -1, -2, -4, + 1, 2, 2, 2, 0, -2, 0, 2, -1, -1, -2, -3, -4, -5, -3, 1, + 0, 1, 1, 0, -1, -1, -1, 1, 0, 1, 1, 1, 0, 0, 0, 2, + 0, 1, 1, 2, 1, 1, 1, 2, -1, -1, 0, 2, 2, 2, 2, 3, + -2, -4, -4, -1, -2, -2, -2, 0, 1, 0, 0, 1, 0, 0, 0, 1, + 0, -1, -3, -2, 0, 2, 2, 1, 0, -1, -2, -3, 0, 1, 1, 2, + 1, 0, -2, -3, -1, 0, 0, 1, -1, 0, -1, -2, 0, 0, -1, 0, + -1, 1, 1, 0, 2, 2, 0, 0, 0, 2, 3, 1, 3, 5, 3, 2, + -1, 1, 1, -2, 0, 3, 1, 1, -1, 0, 0, -4, -4, -1, -1, -1, + -1, 1, 1, 0, 1, 2, 1, 2, -3, 0, 1, 0, 1, 1, 0, 2, + -5, -3, -1, -1, 0, 1, 0, 1, -4, -3, -2, -3, -2, -1, -1, 0, + 0, 0, -1, -2, -2, -2, -2, 0, 3, 4, 2, 0, 0, 0, 0, 1, + 2, 1, 0, 0, 0, 0, -1, 0, 0, 1, 2, 3, 4, 4, 3, 2, + -1, 4, 7, 4, 0, 0, 0, 0, -1, 4, 6, 3, 0, 1, 1, 1, + 0, 3, 4, 0, -1, 0, 0, 1, 0, 1, 1, -2, -1, 0, -1, -1, + -1, 0, -1, -1, -1, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, + -1, -3, -3, 0, 1, -1, -2, -1, -3, -4, -4, -2, -1, -2, -2, -1, + 2, 2, 1, 0, 1, 1, 0, -3, -2, -1, 0, 0, 1, 1, 0, -3, + -2, -1, 0, 1, 2, 1, 1, -2, 1, 2, 2, 2, 3, 3, 2, -1, + 1, 2, 1, 0, 1, 1, 2, -1, 0, 1, -2, -4, -2, 0, 1, -1, + 1, 1, -1, -3, -2, 0, -1, -3, 1, 2, 0, -1, 0, 1, -1, -4, + -1, -1, -2, -2, 0, 3, 4, 3, 1, 1, -1, -3, -2, 0, 0, 0, + 2, 2, 2, 2, 2, 1, -1, -1, 1, 1, 1, 3, 3, 0, -2, -2, + 0, -1, -1, -1, 0, -2, -1, -1, -1, -3, -4, -3, -2, -2, 0, 2, + -1, -1, 0, 1, 2, 2, 3, 5, -2, -1, -1, 0, 0, 0, 0, 1, + -2, -3, 2, 0, 0, 1, 1, -1, -1, -4, 1, -2, -1, 2, 2, 0, + 1, -4, 0, -2, -2, 1, 1, -1, 2, -3, 1, -1, -1, 1, 1, -1, + 3, -2, 3, 1, 0, 1, 1, -1, 1, -3, 2, 1, 0, 1, 0, -1, + -1, -5, 1, 0, -1, 0, 1, 1, 0, -3, 3, 3, 1, 2, 3, 3, + 0, -1, -2, 1, 5, 5, 2, -1, 1, -1, -2, -1, 1, 1, -2, -5, + 1, 1, -1, -2, -1, -1, -1, -3, 1, 1, -1, -1, -1, 2, 4, 3, + -1, -1, -1, -1, -1, 0, 4, 3, -1, -1, 0, 1, -1, -3, -1, -1, + 0, 0, 0, 2, 2, 0, 0, -1, 0, -2, -3, 0, 1, 1, 3, 2, + 2, 3, 2, 1, 0, 0, -2, -2, 2, 3, 0, 1, 1, 3, 3, 2, + 0, 0, -3, -1, -1, 2, 2, 3, -2, -2, -3, 1, 1, 2, 1, 1, + -2, -1, -2, 2, 1, 1, -1, -2, 0, 1, 0, 2, 0, 0, -2, -2, + 0, 1, 0, 2, 0, 0, -2, -2, -3, -2, -2, 0, -1, -2, -2, -3, + 0, 1, -1, 3, -1, 1, 3, -1, 0, 1, -1, 3, -1, -1, 2, -3, + 1, 1, -2, 3, -1, -3, 0, -3, 2, 2, -2, 3, 0, -2, 1, -2, + 1, 1, -3, 3, -1, -2, 1, -3, 1, 1, -3, 3, 0, -1, 1, -2, + 1, 2, -1, 4, 0, -1, 1, -2, 0, 1, -1, 3, -1, -3, 0, -3, + -3, -3, -1, 1, 2, 1, -1, -2, -2, -2, 0, 2, 1, 0, -2, -2, + -3, -2, 1, 2, 1, -1, -2, -1, -3, -2, 2, 4, 0, -2, -2, 1, + -3, -1, 2, 4, 0, -2, -2, 2, -1, 1, 4, 3, -1, -3, -2, 2, + 0, 2, 4, 2, -1, -2, -1, 2, 0, 1, 2, 0, -1, 0, 1, 3, + 3, 0, -5, 1, 4, 0, 0, 1, 1, -2, -5, 2, 5, -1, -2, 1, + -1, 0, 0, 3, 3, 1, 0, -1, -2, 3, 4, -2, -3, -1, 0, -2, + -3, 3, 5, -3, -3, 0, 0, -2, -1, 3, 2, -2, -2, 2, 2, -1, + 2, 0, 0, -1, 0, 0, 0, 0, 0, -3, -2, 1, 3, 0, -2, -2 +}; + +/* list of codebooks for inter-coded vectors */ +const int8_t* const ff_svq1_inter_codebooks[6] = { + svq1_inter_codebook_4x2, svq1_inter_codebook_4x4, + svq1_inter_codebook_8x4, svq1_inter_codebook_8x8, + NULL, NULL, +}; + +/* 6x16-entry codebook for intra-coded 4x2 vectors */ +DECLARE_ALIGNED(4, static const int8_t, svq1_intra_codebook_4x2)[768] = { + 12, 13, 13, 11, -7,-10,-15,-17,-16,-15,-12,-10, 11, 15, 15, 12, + 2, 17, 20, 15,-45,-24, 2, 13, 21, 20, -6,-36, 12, 16, -1,-27, + -18,-21, 10, 45,-11,-20, -7, 21, 43, -8,-28, 0, 33,-16,-28, 3, + -12,-18,-18, -6,-20,-10, 28, 55, -5,-18,-21,-18, 56, 30, -6,-20, + -34, 27, 29,-22,-30, 29, 26,-25, 30, 34, 33, 26,-25,-31,-35,-33, + -31,-35,-36,-32, 29, 36, 37, 31,-71,-12, 38, 34,-63, -1, 42, 33, + 58, 37,-31,-60, 55, 34,-33,-61,-57,-57, 22, 93,-57,-58, 21, 93, + 59, 69, 70, 62,-63,-68,-68,-60,-64,-71,-71,-64, 63, 73, 72, 62, + -2, 0, 7, 15,-11,-10, -3, 5, -5, -8,-10,-10, 1, 9, 14, 9, + 15, 8, -4,-11, 12, 2,-11,-12, -8, 0, 19, 28, 4, -1,-15,-26, + -15, 27, 2,-14,-14, 22, 1, -9, -4, -6,-13,-10, -6,-14, 6, 47, + -35,-20, 6, 23, 6, 9, 6, 4, -6, 2, 23,-22, -7, 4, 28,-21, + 20,-22, -2, 6, 22,-28, -5, 8,-10,-18,-16,-12, 36, 19, 2, -1, + -3, 0, 4, 8,-45,-10, 23, 23, 40, 15,-20,-35, -4, -1, 4, 1, + 9, -5,-33, 24, 8, 3,-26, 19, -1, 4, 6, -3, 32, 25,-13,-49, + 24, 24, 15, 7,-17,-27,-19, -7,-47, 0, 39, 24,-21, -6, 7, 4, + -1, 0,-10,-13, 1, 1, 5, 16, 20, 5, -3, -9, -1, -4, -2, -6, + -17, -7, 1, 4, 12, 7, 0, 0, 3, 0, 12, 11, -3, 1, 0,-23, + 4, 17, -6, 0, 6, 3,-25, 0,-17, 10, 8, 5,-14, 4, 1, 4, + 13, 10, 4, 2,-23, -9, 1, 2, 3, -3, 1, 7, 1,-23, -7, 20, + -7,-18, 2, 12, -5, -4, 10, 9, 4, 10, 7,-24, 6, 3, 4,-10, + 22,-14,-22, 6, 0, 5, 5, -1, -4, 3,-11, -4, -7, 31, 7,-14, + -5,-16, -1, 42, -4, -2, -9, -5, 5, -8, -6, -3, 42, -4,-21, -5, + -18, 12, 20,-12, 13,-13,-10, 7, -8, -9, -2,-18,-16, 6, 40, 8, + 10, -1, 0, 4, -3, 4, -1,-13, -2, 6, 1,-15, 5, 3, 1, 2, + -4, -2, 1, 3, 15, 0, -9, -4, -3, -4, -4, -4, -3, 5, 16, -3, + 2, 13, 3, 4, -3, -8,-10, 0, -6, -2, -4, -1, -2, -3, -6, 23, + 6, -6, 7, 1, 4,-18, 5, 1, -1, 1,-15, 14, -5, 6, -4, 4, + 2, 2, 2, 6,-24, 2, 7, 3,-26, 0, 3, 3, 5, 7, 1, 6, + 14, -2,-18, -3, 7, 5, -4, 2, -6, 3, 32, 1, -6, -6, -6,-12, + 5,-36, 7, 6, 9, -1, 11, 0, 4, 4, 5, 3, 4, 15, 3,-38, + 10, 23, -5,-42, 0, 4, 4, 4, 23, 17, -6,-13,-13,-37, 1, 29, + 5,-14, -1, 1, 5, 0, 3, 1, 0, 4, -5, 2, 8, 0, 0,-10, + 4, 7, -2, -3,-10, 3, 1, 1,-12, -1, 13, 3, 0, -1, 1, -3, + 0, -1, 3, 1, -6, -9, 3, 9, -6, 1, -4, -6, 8, -1, 0, 8, + -3, -3, 0, 18, -5, -1, -4, -1, -8, -2, 3, -4, 0, 17, -1, -5, + 5, -2, 9,-10, 1, -5, 6, -5, 4, 2, 2, 3, 10,-14, -8, 1, + -1, -2,-18, -1, -1, 20, 1, 2, -1, 1, -9, 1, -1, -9, 22, -4, + 6, -4, 8, -3, -1, 7,-19, 5, -7, 31, -4, -4, -6, 0, -5, -5, + -7, -8,-19, -4, 1, 1, 4, 32, 38, -1, -8, 4, -7, -8, -6,-12, + -1, 0, -7, 1, -1, 9, -1, 0, 9, -1, -1, 0, 2, -6, 1, -3, + -12, 0, 2, 1, 1, 1, 8, 0, 9, 1, 0, 2, -2, 1,-11, 0, + 0, 8, 2,-10, -1, 2, -1, 0, -2, -4, 0, -5, -2, -1, -1, 14, + -3, 7, -1, 5, 0,-10, 1, 1, -1, -5, 14, -1, -2, 1, -3, -2, + -6, 0, 0, 6, 2, 3, -9, 4, 4, -5, -1, -1, -7, 3, 8, -1, + 2, -4, -1,-11, 11, 2, 1, 0, -1, 2, 3, 9, 0, 2, 0,-15, + 3, 5,-20, 3, 3, -1, 3, 3, 1, -1, 16, 1, 2,-29, 9, 2, + -13, -6, -1, -3, 36, -1, -8, -3, 2, 5, 4, 2,-37, 9, 11, 3 +}; + +/* 6x16-entry codebook for intra-coded 4x4 vectors */ +DECLARE_ALIGNED(4, static const int8_t, svq1_intra_codebook_4x4)[1536] = { + -11, -3, 3, 6,-10, -1, 5, 7, -9, -1, 6, 7, -9, -1, 4, 6, + 5, 7, 0,-14, 6, 9, 2,-15, 6, 9, 2,-15, 4, 6, 0,-14, + 16, 3, -5, -6, 16, 1, -8, -8, 14, -1, -9, -9, 12, 0, -8, -8, + 8, 12, 16, 17, -2, 2, 6, 9,-10, -8, -4, 0,-15,-14,-11, -7, + -7,-10, -2, 16, -7,-11, -3, 18, -7,-11, -1, 20, -6, -8, 1, 19, + -9,-13,-16,-17, 2, -2, -7, -9, 11, 8, 4, -1, 16, 15, 11, 7, + -22, -2, 13, 15,-24, -2, 14, 16,-25, -4, 13, 15,-25, -6, 10, 13, + 26, 26, 22, 16, 17, 15, 9, 3, -2, -6,-11,-14,-20,-25,-28,-28, + -27,-27,-25,-21,-16,-15,-11, -7, 3, 8, 12, 13, 23, 28, 31, 30, + 20, 16, -7,-33, 22, 19, -6,-35, 22, 19, -6,-34, 20, 17, -6,-32, + -20,-20, 2, 38,-21,-22, 2, 40,-21,-22, 2, 40,-20,-20, 3, 38, + -47, -4, 24, 26,-50, -3, 26, 27,-50, -3, 26, 27,-47, -4, 24, 26, + 45, 6,-23,-27, 48, 5,-25,-28, 48, 5,-26,-28, 44, 6,-24,-27, + -30,-36,-10, 76,-31,-37,-11, 78,-31,-37,-11, 78,-31,-36,-10, 77, + -53,-32, 35, 52,-54,-34, 36, 52,-54,-34, 36, 52,-53,-33, 34, 51, + -93,-34, 62, 65,-93,-34, 62, 66,-93,-34, 62, 65,-93,-34, 60, 64, + -7, 0, 2, 2, -8, -1, 3, 3, -8, 0, 4, 5, -6, 1, 5, 5, + 3, 7, 11, 11, 2, 2, 3, 3, 1, -2, -6, -7, 1, -5,-11,-13, + 3, -2, -4, -3, 7, 0, -5, -5, 12, 4, -5, -7, 14, 6, -4, -7, + 18, 14, 3, -2, 6, 4, 0, -3, -8, -5, -2, 0,-16,-11, -2, 2, + -8, -6, 7, 18, -7, -8, 2, 13, -4, -6, -2, 6, 0, -4, -3, 1, + 1, -3,-13,-18, 0, -1, -5, -7, -1, 1, 6, 7, -2, 4, 15, 17, + -15,-14, -7, -2, -6, -5, -1, 0, 6, 6, 3, 1, 15, 13, 6, 1, + 2, -2,-11, 10, 2, -1,-12, 11, 3, -1,-12, 11, 2, -2,-11, 11, + -9, 14, -1, -5, -9, 15, -2, -5, -8, 16, -2, -5, -7, 15, -1, -4, + 2, 6, 8, 8, -2, 3, 9, 12,-11, -5, 4, 10,-19,-16, -8, 0, + 14, 8, -7,-15, 12, 7, -7,-14, 8, 5, -4, -9, 5, 3, -1, -4, + 12,-14, -2, 2, 13,-15, -1, 3, 14,-15, -1, 3, 13,-14, -1, 3, + 0, 6, 10,-13, 0, 6, 10,-15, 0, 7, 9,-17, 1, 6, 8,-16, + -8, -5, 15, -2, -8, -6, 17, -2, -8, -6, 16, -3, -8, -5, 15, -2, + -9,-11,-11,-10, 9, 10, 9, 8, 8, 10, 10, 9, -8, -9, -8, -7, + 9, 10, 9, 7, -8,-10,-10,-10, -7,-10,-11,-11, 11, 12, 11, 8, + 0, 10, 7, 0, 0, 7, 0, -6, 0, 2, -5, -6, -2, -1, -4, -1, + 5, 0, -6, -9, 2, 2, 2, 1, -2, 0, 5, 7, -6, -5, 1, 4, + 3, -8, 2, -1, 4, -9, 3, 0, 5, -7, 3, 0, 7, -5, 3, 0, + -5, -3, 2, 9, -6, -3, 1, 8, -6, -3, 1, 7, -5, -2, 0, 4, + 13, 8, 3, 1, -3, -5, -4, -1, -8, -7, -3, 0, -1, 1, 3, 2, + 3, 2, -5,-12, 4, 3, -2, -9, 3, 4, 1, -4, 3, 5, 4, -1, + -9, -8, -4, 0, 8, 6, 2, 0, 10, 8, 3, 0, -6, -5, -3, -1, + -3, -9,-12, -5, 0, -3, -5, 0, 2, 3, 2, 4, 5, 8, 7, 6, + -1, -2, 5, 12, -1, -1, 5, 9, 2, 1, -1, -2, 2, -1,-11,-17, + -7, 3, 3, -1, -9, 3, 4, -1,-10, 4, 6, -1, -9, 5, 7, 0, + -18, -7, 2, 2, -8, 1, 5, 3, 3, 4, 1, 0, 9, 5, -2, -3, + -2, 0, 6, 8, -4, -5, -5, -3, 1, -2, -6, -8, 10, 9, 3, -1, + 0, -2, -2, 0, 0, -4, -5, 0, -2, -8, -4, 8, -5, -7, 6, 24, + 9, 1, -7, 1, 9, 1, -8, 1, 8, 0,-10, 1, 8, -1,-11, -1, + 8, 8, 6, 3, 5, 4, 3, 2, -2, -3, -1, 0,-10,-13, -8, -4, + 0, 4, 2, -3, 0, 6, 3, -5, 3, 10, 2,-12, 5, 10, -4,-22, + 0, -4, -1, 3, 1, -4, -1, 5, 1, -5, 0, 8, -1, -6, -2, 7, + -1, -1, -2, -4, -1, -2, -4, -6, -1, -1, -1, -2, 1, 5, 10, 9, + 10, 3, 0, -2, 6, -1, -2, -5, 3, -1, -2, -6, 2, 0, 0, -5, + 6, 3, 0, 0, 6, 3, 1, 1, 4, -2, -2, 1, 0, -9, -9, -2, + -11, -3, 1, 2, -6, 2, 4, 5, -3, 2, 3, 4, -2, 1, 1, 2, + -6, -4, -1, -2, 2, -1, -1, -2, 10, 2, -2, -2, 11, 2, -4, -1, + 6, 0, -2, 2, 3, 3, 0, 0, -6, 3, 3, 0,-17, -1, 5, 0, + -1, 4, 10, 11, -3, -2, 0, 1, -3, -4, -5, -3, -1, -2, -2, -1, + 2, -3, -9,-12, 3, 3, 3, 2, 2, 2, 4, 4, 2, 1, -1, -2, + -2, 9, 5,-10, -3, 5, 5, -5, -2, 1, 2, 0, -1, -2, -2, 1, + -2, -3, 7, -2, -1, -3, 7, -3, -1, -2, 8, -4, -2, -2, 7, -3, + 1, -8, -3, 12, 2, -2, -2, 4, 1, 3, 0, -5, -1, 5, 2, -7, + -1, 3, 1, -5, -7, -2, 3, 1, -2, -7, -2, 2, 20, 3, -5, -1, + 5, 0, -3, -2, -7, -7, 0, 6, -6, 0, 7, 6, 2, 6, 0, -7, + -2, 6, -7, 1, -2, 7, -8, 3, -2, 7, -7, 3, -1, 7, -6, 2, + -5, -2, 5, 7, 4, 1, -4, -8, 6, 3, -2, -5, -7, -5, 3, 7, + -1, -1, 6, 5, 0, -1, 1, -4, 2, 1, 0, -7, 1, 0, 0, -4, + -8, 0, 3, 1, -2, 1, -1, -1, 1, -1, -3, 1, 1, -2, 1, 9, + 5, 2, -3, -4, -1, 0, -1, -3, -3, 1, 3, 1, -4, 0, 4, 2, + 2, -2, -2, 12, 0, -2, -5, 3, -1, 0, -3, 1, -3, -1, -2, 1, + 1, 5, 3, 0, -6, -4, -2, 1, 0, -2, -2, 2, 6, 1, -4, -1, + -3, -5, -5, -1, 3, 5, 5, 4, 0, 3, 1, -1, -2, 1, -2, -3, + 2, -4, -5, -3, 4, -2, -3, -2, 6, 0, -1, -1, 7, 1, 0, 0, + -3, -2, -2, 0, -2, -3, -5, -1, -2, 2, 0, -1, -1, 11, 9, -1, + 0, 1, -1,-10, -1, 1, 0, -6, 1, 0, 1, 4, 2, -5, -1, 13, + -2, 4, 5, 0, -5, 1, 6, 3, -6, -2, 3, 2, -5, -2, 0, -2, + -1, 1, 1, -2, -1, -2, 0, 2, 5, 5, 5, 7, 0, -4, -8, -7, + 0, 2, -1, -5, -1, 2, 2, -3, 0, 5, 3, -5, 3, 8, 2,-12, + 8, 4, 0, -2, 10, -1, -4, -1, 3, -6, -3, 0, -4, -5, 0, 0, + 0,-10, -4, 2, -1, -6, 3, 5, -1, -3, 6, 4, 0, -2, 4, 2, + 0, 8, 1, -1, 0, 11, 1, -3, -1, 6, -2, -4, -3, -2, -7, -4, + 0, -1, -1, -1, 4, 5, 6, 5, -5, -9, -8, -5, 2, 2, 3, 2, + 0, 2, 6, 1, 2, 0, 3, 0, 1, -2, -1, -2, 0, -1, -3, -6, + 0, 0, 2, 0, 4, 0, 2, 1, 5, -2, 0, 0, -2, -9, -1, 2, + 0, 1, 0,-10, -1, 1, 8, 0, -1, -2, 4, 0, 1, -1, 2, -1, + -3, -2, 2, -1, -3, -1, 2, -3, 0, -1, 1, 0, 8, 1, -1, 3, + 0, 1, 1, 2, 0, -4, -2, 0, -1, -5, 1, -1, -2, -1, 11, 2, + 1, 5, -2, -2, 0, 2, -4, 0, -2, 1, -5, 1, 0, 5, 0, 1, + -5, -3, 0, 6, -4, 2, 0, 0, -3, 5, 1, 0, -3, 3, 0, 0, + 3, -2, -3, 1, 1, -4, 0, 8, -2, -3, -2, 3, 1, 2, -1, -1, + 1, 1, 0, 2, 2, 0, 1, 6, 1, -1, 2, 1, 0, 3, 0,-19, + 1, -3, -2, 2, 6, 5, -2, -7, -3, 1, 3, 1, -1, -1, 0, 2, + -8, -1, -1, -4, 1, 1, -1, 2, 4, 3, 2, 3, -5, 1, 3, 0, + 0, 2, -1, 1, -3, 0, 0, 5, -5, -2, 0, 8, -4, -4, -4, 6, + 1, 2, 1, 2, 2, 2, -3, 2, 4, 0, -9, 0, 7, 0,-11, 1, + 0, 0, 0, -2, 3, 3, -1, -6, 4, 3, -3,-10, -1, 2, 6, 2, + 7, -2, -3, 5, -4, 0, 3, -1, -4, 2, 1, -7, 2, -1, -1, 3, + 3, 2, 2, 2, -5, -7, -7, -5, 5, 6, 4, 2, -2, -1, 0, 1 +}; + +/* 6x16-entry codebook for intra-coded 8x4 vectors */ +DECLARE_ALIGNED(4, static const int8_t, svq1_intra_codebook_8x4)[3072] = { + 5, 6, 6, 6, 7, 7, 8, 8, 0, 0, 0, 0, 0, 1, 2, 3, + -3, -4, -4, -5, -5, -4, -3, -2, -4, -4, -4, -5, -4, -4, -3, -3, + 1, 2, 2, 2, 2, 3, 3, 3, 2, 3, 3, 4, 4, 5, 5, 5, + -1, 0, 1, 1, 2, 3, 4, 4, -9,-10, -9, -9, -8, -7, -6, -5, + -4, -4, -5, -6, -6, -7, -7, -7, 0, -1, -2, -2, -3, -3, -4, -4, + 4, 4, 3, 3, 2, 1, 1, 0, 7, 7, 7, 6, 6, 5, 4, 4, + 2, 4, 5, 6, 4, 1, -3, -6, 3, 4, 5, 5, 4, 0, -5, -8, + 2, 3, 4, 4, 2, -2, -7,-10, 2, 2, 2, 1, 0, -4, -9,-12, + -9, -7, -3, 1, 4, 4, 3, 3,-10, -7, -2, 3, 5, 5, 3, 3, + -9, -6, -2, 3, 6, 5, 4, 3, -8, -6, -1, 3, 4, 4, 3, 2, + -5, -5, -5, -5, -3, 1, 4, 7, -5, -5, -5, -4, -2, 1, 6, 8, + -4, -5, -4, -3, -1, 3, 8, 10, -3, -4, -3, -2, 1, 5, 9, 11, + -2, -2, -2, -2, -2, -2, -2, -2, -4, -5, -5, -5, -5, -5, -5, -4, + -3, -4, -4, -4, -4, -4, -4, -3, 9, 10, 10, 11, 11, 11, 10, 10, + 7, 4, 1, -2, -4, -6, -9,-10, 9, 7, 3, 0, -2, -4, -8, -9, + 11, 8, 4, 2, 0, -3, -6, -8, 11, 9, 5, 3, 1, -2, -5, -7, + -13,-13,-13,-12,-11,-10, -8, -8, 0, 1, 2, 3, 4, 4, 4, 3, + 3, 4, 5, 6, 6, 6, 5, 4, 3, 4, 4, 4, 3, 3, 3, 2, + 10, 10, 11, 10, 9, 9, 8, 7, 6, 6, 6, 6, 5, 4, 3, 2, + 0, 0, 0, -1, -2, -3, -4, -4,-10,-10,-11,-12,-13,-14,-14,-14, + 16, 16, 17, 16, 15, 13, 12, 11, -1, -2, -3, -4, -4, -4, -4, -3, + -4, -5, -6, -6, -6, -6, -6, -6, -5, -6, -6, -6, -6, -6, -5, -5, + -13,-13,-13,-12,-11,-10, -8, -6, -9, -8, -7, -6, -4, -2, 0, 1, + -2, -1, 1, 3, 5, 7, 8, 9, 5, 7, 9, 11, 13, 14, 15, 15, + 16, 14, 11, 7, 2, -3, -7, -9, 14, 12, 8, 3, -1, -6, -9,-11, + 11, 9, 4, 0, -4, -8,-11,-13, 8, 5, 1, -3, -6,-10,-12,-14, + -18,-15, -9, -3, 1, 6, 9, 11,-17,-13, -7, -1, 3, 7, 11, 12, + -15,-11, -5, 1, 5, 9, 12, 13,-13, -9, -3, 2, 5, 9, 11, 13, + 22, 21, 19, 15, 10, 3, -4, -9, 20, 18, 15, 9, 2, -5,-12,-17, + 16, 13, 8, 1, -7,-14,-20,-24, 10, 6, -1, -8,-15,-21,-25,-27, + -25,-23,-20,-14, -7, 1, 9, 14,-23,-21,-16, -9, 0, 9, 16, 21, + -20,-16,-10, -1, 8, 16, 22, 25,-15,-11, -3, 6, 14, 20, 25, 27, + -4, -2, 0, 1, 2, 2, 2, 2, -5, -2, 0, 2, 3, 3, 3, 3, + -6, -4, -1, 1, 2, 3, 3, 3, -7, -5, -2, 0, 1, 1, 2, 2, + 2, 1, 1, 1, 1, 0, -2, -3, 3, 3, 2, 1, 0, -1, -3, -4, + 4, 3, 2, 1, 0, -2, -4, -6, 5, 4, 3, 1, -1, -3, -5, -6, + 5, 6, 6, 4, 2, 0, -2, -3, 3, 4, 4, 4, 3, 1, 0, -1, + -2, -2, -1, -1, -1, -1, -2, -2, -5, -4, -3, -2, -2, -2, -3, -3, + -1, -1, -1, -1, -1, -1, -1, -1, -3, -4, -4, -4, -3, -3, -3, -3, + -1, -1, -1, -1, -1, -1, -1, -2, 5, 6, 6, 6, 6, 5, 4, 3, + 4, 4, 4, 4, 4, 5, 6, 7, 0, -1, -1, -1, -1, 0, 1, 2, + -2, -3, -3, -3, -3, -2, -1, 0, -3, -3, -4, -4, -4, -3, -2, -1, + 0, -2, -4, -4, -2, 0, 2, 3, 0, -2, -3, -3, -1, 2, 4, 5, + -1, -2, -4, -3, 0, 3, 5, 6, -2, -3, -4, -3, -1, 2, 4, 5, + 9, 4, 0, -3, -3, -1, 0, 1, 8, 4, -1, -4, -3, -1, 1, 2, + 6, 2, -3, -5, -4, -2, 0, 1, 5, 1, -3, -4, -4, -2, 0, 1, + 5, 3, 1, -1, -4, -8,-10,-10, 3, 3, 2, 1, 0, -2, -3, -4, + 1, 1, 1, 2, 3, 2, 1, 0, -1, 0, 1, 2, 3, 4, 3, 2, + 0, 1, 2, 2, 1, -1, -3, -3, 0, 1, 1, 1, -1, -2, -4, -3, + -3, -3, -3, -3, -3, -3, -1, 2, -4, -4, -3, 0, 3, 7, 12, 14, + -5, -5, -6, -6, -6, -6, -6, -5, 2, 2, 2, 1, 0, 0, 0, 0, + 4, 4, 3, 2, 1, 0, 0, 0, 6, 6, 5, 4, 2, 2, 1, 1, + -7, -7, -6, -3, 0, 4, 7, 8, -1, -2, -3, -3, -2, -1, 1, 2, + 3, 3, 1, -1, -2, -2, -2, -1, 6, 6, 4, 2, 0, -2, -2, -2, + -6, -5, -2, 2, 5, 9, 11, 12, -4, -4, -2, 0, 2, 4, 5, 6, + -3, -2, -2, -2, -2, -1, 0, 1, -2, -2, -2, -3, -3, -3, -3, -2, + -7, -3, 1, 3, 3, 0, -3, -5, -6, -2, 3, 5, 4, 1, -3, -5, + -5, -1, 4, 6, 5, 2, -3, -4, -4, 0, 5, 7, 6, 3, -1, -3, + 0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -3, -3, -3, -3, -2, -1, + 6, 7, 8, 9, 9, 8, 7, 6, -4, -4, -5, -5, -6, -6, -5, -4, + -9, -8, -6, -4, 0, 3, 6, 6, -5, -4, -1, 3, 5, 6, 5, 3, + 1, 3, 6, 6, 4, 1, -2, -5, 6, 7, 5, 1, -3, -7,-10,-11, + 10, 9, 5, 1, -3, -6, -6, -4, 5, 3, -1, -5, -6, -5, -2, 2, + -2, -4, -6, -6, -4, 1, 6, 10, -6, -7, -7, -4, 1, 7, 11, 12, + 6, 5, 3, 2, 0, 0, 0, 0, 2, 1, -1, -2, -3, -2, -1, -1, + 0, -1, -2, -4, -4, -2, -1, 1, 0, 0, -1, -2, -1, 0, 2, 3, + 0, -1, -2, -2, -2, -2, -1, -1, 5, 4, 2, 1, 0, 0, 0, 0, + 6, 5, 3, 1, 0, 0, 0, 0, 2, 0, -2, -4, -4, -3, -2, -2, + -7, -4, 0, 2, 2, 2, 2, 1, -7, -3, 0, 0, 0, 0, 0, 0, + -4, -1, 1, 1, 0, 0, 0, 1, -1, 1, 2, 2, 2, 2, 3, 3, + -2, 0, 2, 2, 1, 1, 1, 1, -1, 1, 2, 2, 1, 0, 0, -1, + 0, 2, 4, 2, 0, -1, -2, -3, 1, 2, 3, 1, -2, -4, -6, -6, + 1, 2, 2, 4, 5, 6, 4, 1, 0, -1, -1, -1, 0, 0, -2, -4, + 0, 0, -1, -2, -2, -2, -4, -6, 2, 1, 0, 0, 1, 1, -1, -3, + 1, 1, 1, 1, 1, 2, 3, 3, 0, 0, 1, 0, 1, 2, 4, 4, + -1, -1, -1, -1, 0, 1, 2, 3, -4, -4, -5, -5, -5, -3, -1, 0, + -6, -5, -5, -4, -3, -2, -1, -1, -1, 0, 0, 1, 1, 2, 3, 3, + 0, 1, 1, 1, 2, 2, 3, 4, 0, 0, -1, -1, 0, 1, 2, 3, + 0, 1, 1, 1, 0, 0, -1, -1, 1, 3, 3, 2, 1, -1, -2, -2, + -2, 0, 2, 2, 2, 2, 1, 1, -9, -8, -4, -2, 1, 3, 3, 3, + -1, -1, -1, -2, -3, -3, -3, -4, 0, 0, 0, -1, -2, -2, -3, -3, + 2, 2, 2, 0, -1, -1, -1, -1, 5, 5, 4, 3, 2, 2, 2, 2, + 6, 3, -1, -4, -3, -1, 1, 1, 2, -1, -3, -4, -1, 2, 2, 0, + -1, -2, -2, 1, 4, 4, 1, -3, -2, -1, 1, 4, 6, 3, -3, -8, + 3, 3, 2, 1, -1, -2, -2, -2, -4, -4, -2, -1, 1, 3, 4, 4, + -4, -5, -5, -4, -2, 0, 2, 2, 7, 7, 4, 1, -1, -2, -3, -2, + -1, 1, 3, 0, -4, -6, 0, 6, -2, 1, 4, 1, -4, -6, -1, 7, + -3, 1, 4, 2, -3, -6, -1, 6, -2, 0, 3, 2, -2, -5, -1, 4, + 1, -1, -2, 1, 4, 4, -1, -7, 1, -1, -4, -1, 5, 6, 0, -6, + 3, 0, -4, -3, 3, 6, 2, -4, 3, 0, -5, -4, 1, 4, 1, -3, + 2, 2, 3, 3, 3, 3, 2, 2, -4, -5, -6, -7, -7, -7, -7, -6, + 1, 2, 3, 3, 3, 3, 2, 2, 0, 0, 1, 1, 1, 2, 2, 1, + 3, -3, -3, 3, 4, -2, -2, 2, 3, -4, -4, 4, 4, -4, -4, 2, + 4, -4, -4, 4, 4, -4, -3, 3, 3, -3, -4, 3, 3, -3, -3, 3, + -2, -2, -2, -2, -2, -2, -1, -1, 6, 7, 8, 8, 8, 7, 6, 5, + -5, -6, -7, -7, -8, -7, -6, -5, 1, 1, 2, 2, 2, 2, 1, 1, + 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, -1, 0, 0, + -2, -3, -2, -2, -2, -3, -3, -3, 2, 3, 5, 6, 4, 2, 1, 0, + 8, 6, 2, 0, 0, 0, 0, 0, 4, 1, 0, 0, 0, -1, -1, -1, + 1, -1, 0, 0, 0, -1, -2, -3, -2, -2, -1, 0, 0, -2, -4, -5, + 3, 1, -1, -2, -3, -4, -5, -5, 2, 1, 0, 0, 1, 1, 0, 0, + 0, -1, -1, 0, 2, 2, 2, 2, -1, -2, -1, 1, 2, 2, 2, 2, + 0, -1, -2, -1, -1, -1, -1, 0, -1, -2, -2, -1, -1, 0, 0, 1, + 2, 1, 1, 2, 2, 1, 1, 0, 6, 5, 3, 1, 0, -2, -4, -4, + -3, -2, -1, 0, 1, 1, 0, -1, 0, 1, 3, 4, 5, 5, 3, 1, + -1, -1, -1, 0, 1, 0, -1, -2, -2, -2, -2, -1, 0, -1, -2, -3, + 0, -1, -2, -2, -1, -1, 0, 2, 1, -1, -2, -1, -1, -1, 0, 2, + 1, 0, -2, -2, -2, -2, 1, 5, 1, -1, -2, -2, -2, 0, 5, 10, + 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, 0, 1, 2, + 1, 2, 2, 3, 4, 4, 6, 5, -3, -3, -3, -2, -2, -3, -3, -3, + 1, -1, -2, -2, 0, 3, 5, 7, 2, 0, -2, -3, -2, 0, 2, 3, + 3, 1, -2, -3, -3, -2, -1, -1, 3, 1, 0, -1, -1, -1, -1, -1, + 1, 3, 5, 4, 2, -1, -3, -4, -3, -2, 1, 2, 1, 0, -1, -2, + -5, -3, 0, 2, 2, 1, 0, 0, -3, -1, 1, 2, 2, 1, 0, 0, + 0, -1, -1, -1, 1, 2, 3, 4, -3, -4, -4, -3, -1, 0, 0, 1, + -2, -3, -2, -1, 1, 1, 1, 1, -2, -2, 0, 3, 4, 4, 3, 2, + -4, -4, -3, -2, -1, 1, 2, 3, 0, 1, 1, 1, -1, -2, -3, -3, + 3, 4, 5, 4, 2, -1, -3, -3, -2, -2, 0, 2, 2, 2, 1, 0, + -4, 0, 5, 7, 4, -1, -4, -4, -1, 2, 4, 3, 0, -3, -3, -2, + 2, 1, 0, -1, -2, -2, 0, 1, 0, 0, -1, -2, -2, -1, 1, 2, + -4, -3, -2, -1, 0, 1, 2, 2, 10, 9, 5, 0, -3, -4, -3, -2, + 1, -1, -2, -2, -1, 0, 0, 0, -2, -2, -1, 1, 1, 1, 0, -1, + -5, -3, 0, 3, 4, 2, 0, -2, -2, -1, 0, 1, 1, 0, -1, -1, + 3, 2, -1, -2, -2, -1, 1, 1, 7, 5, -1, -5, -6, -2, 2, 4, + -2, 3, 3, -3, -4, 1, 2, -2, -3, 3, 4, -3, -4, 2, 3, -2, + -3, 3, 4, -3, -4, 2, 3, -2, -4, 2, 4, -2, -3, 1, 2, -1, + 4, 3, -1, -3, -3, -1, 1, 2, -4, -6, -4, 0, 4, 5, 4, 1, + 0, 2, 5, 6, 2, -3, -5, -4, 1, 1, -1, -3, -5, -2, 2, 4, + -1, 0, 1, 2, 2, 3, 3, 4, -1, 0, 1, 1, 0, -1, -1, -1, + -1, 0, 1, 2, 2, 1, -1, -2, -3, -2, -1, 0, 0, -1, -2, -3, + 1, 1, 1, 1, 0, 0, 1, 2, 1, 0, -1, 0, 0, 1, 1, 0, + 1, -2, -4, -1, 1, 2, 1, 0, 1, -4, -7, -3, 1, 3, 2, 1, + 1, 1, 1, 1, 1, 1, 0, -1, 1, 1, 1, 0, 1, 2, 2, 0, + 1, 1, 0, 0, 0, 2, 0, -3, 3, 2, 0, -1, -1, -2, -6, -9, + 0, 0, 0, 1, 0, 0, 1, 2, 1, 0, 0, 0, -1, -1, 0, 2, + 0, 1, 1, 1, -1, -3, -2, 0, -7, -5, 1, 6, 6, 2, -1, -1, + 3, 1, -1, -3, -4, -2, 1, 4, 2, 0, -2, -3, -4, -3, -1, 2, + 2, 2, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, + -1, 1, 1, -2, -5, -6, -4, -1, -1, 1, 4, 3, 2, 0, 1, 2, + -1, 0, 2, 3, 1, 0, 0, 1, -1, 0, 1, 0, 0, -1, -1, 0, + 0, 1, 2, 2, 0, -2, -1, 1, -2, -1, -1, -2, -1, 2, 6, 8, + -1, -1, -2, -3, -2, 0, 1, 2, -1, 0, 0, -1, -1, 0, -1, -1, + 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, -1, -1, 1, + -1, 0, 2, 2, -1, -3, -2, 3, 0, 2, 3, 0, -5, -7, -2, 4, + -1, 0, 0, 0, -1, -2, -3, -3, -1, 0, -1, -2, -2, -2, -2, -2, + 1, 1, 0, 0, 1, 2, 0, -1, 1, 2, 1, 2, 5, 6, 2, 0, + -2, -4, -3, 0, 2, 2, 0, -3, 3, 1, 0, 1, 2, 1, -2, -3, + 3, 1, 0, 0, 0, 0, 0, -1, 1, -1, -2, -2, -1, 1, 3, 3, + 3, 2, 1, 2, 4, 3, 1, -2, -2, -4, -4, -3, -1, 0, -2, -3, + 1, 0, -1, -1, 0, 1, 0, -1, 3, 2, 0, 0, 0, 1, 1, 0, + 1, 1, 0, 0, 0, 0, 0, 0, 2, 3, 3, 2, 2, 2, 1, 1, + 0, -1, -2, -3, -5, -5, -5, -4, 1, 1, 0, -1, 0, 1, 3, 3, + -9, -6, -2, 0, 1, 1, 2, 2, -6, -2, 1, 2, 1, 1, 0, 1, + -2, 1, 2, 2, 1, 1, 1, 1, 0, 2, 2, 1, 0, 1, 1, 1, + 1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, -3, -2, 0, + -3, -3, -3, -2, -1, 3, 7, 9, 1, 2, 2, 2, 0, -2, -4, -3, + 2, 0, -2, -1, 3, 4, -1, -6, 1, 0, -2, -3, -1, 3, 3, 0, + 0, 3, 3, 0, -2, -1, 1, 1, -6, -1, 3, 2, -1, -2, 0, 1, + 5, 3, 0, -2, -3, 0, 2, 1, 1, 1, 2, 2, 0, -2, -4, -7, + -3, -2, 1, 2, 2, 1, -1, -4, 2, 2, 0, -2, -2, 0, 2, 2, + 0, 0, -2, -3, -2, -1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, + -2, -1, 0, 1, 0, 1, 2, 3, -4, -2, 0, 0, -1, 0, 2, 3, + -2, -2, -2, -1, -1, 0, 2, 4, 0, 0, 0, 0, -1, -1, 0, 1, + 0, -1, -1, -1, -1, -1, 0, 0, 6, 4, 2, 0, -1, -2, -1, -1, + 0, 1, 1, 1, 1, -1, -5,-10, 1, 1, 1, 1, 1, 1, 0, -4, + 1, 0, 1, 1, 1, 1, 1, -1, 2, 1, 1, 1, 0, 0, 0, 0, + -3, 1, 4, 3, 3, 1, -1, 0, -4, 0, 1, 0, -1, 0, 0, 0, + -5, 0, 2, 1, 1, 1, 0, -1, -1, 2, 1, -2, -2, -1, 0, -1, + 2, 4, 5, 3, 0, -1, 1, 2, 0, 0, 1, 0, -2, -2, -1, -1, + -2, -2, -2, -2, -3, -2, -1, 0, 0, 0, 1, 0, 0, 0, 1, 2, + 0, -2, -2, -3, -1, 2, 2, -1, 1, 0, 0, 0, 1, 5, 3, -2, + -1, -1, 0, -1, 0, 2, 0, -5, -1, 0, 1, 0, 0, 2, 2, -2, + 3, 1, -1, -1, 0, 1, 1, 2, 1, 0, 0, 1, 1, 1, 1, 1, + -10, -8, -2, 1, 2, 1, 1, 1, -1, 1, 2, 1, 0, 0, 0, 0, + -1, -1, 0, 1, 2, 2, 2, 1, -1, -1, -1, 0, -1, -3, -5, -4, + 1, 1, 2, 1, 1, 0, 0, 2, -1, -2, -1, -1, -1, 0, 2, 4, + -3, -7, -5, 0, 2, 0, 0, 0, 3, -1, -2, 1, 2, 1, 1, 2, + 1, -2, -1, 1, 2, 1, 0, 1, 0, -1, 0, 3, 2, -1, -1, -1, + 2, 1, 1, 0, 0, 0, 0, 0, -9, -7, -2, 3, 3, 2, 1, 1, + 3, 2, 0, -2, -2, -1, 1, 1, 0, -1, 0, 0, 1, 1, 0, 0, + -2, -1, 1, 1, 1, 0, 0, 0, 1, 2, 1, -2, -4, -3, 1, 2, + 1, 2, 1, -2, -3, 0, 3, 1, -1, -1, 0, 0, 1, 3, 0, -4, + 2, 0, -1, 1, 2, -2, -2, 3, 2, 0, -1, 2, 3, -2, -4, 1, + 0, 1, 1, 1, 2, -2, -6, -2, -1, 0, 0, 0, 2, 0, -2, -1, + -1, -1, 1, 2, 1, -2, -3, -2, 3, -1, -2, -1, -1, 0, 1, 2, + 10, 4, 0, 0, -1, -2, -2, -1, 3, -1, -2, -1, 0, -1, -1, 0, + -5, 2, 7, 1, -4, -2, 1, 0, -2, 2, 3, -1, -3, 0, 2, 0, + 2, 1, 0, 0, 1, 1, -1, -2, 1, -2, -2, -1, -1, -2, 0, 0, + 0, 3, -2, -7, -1, 3, 0, 0, 1, 3, -3, -5, 2, 3, -1, 0, + 0, 2, -2, -2, 4, 2, -2, 0, -1, 1, -1, 0, 2, -1, -2, 1, + 4, 0, -3, -4, -2, 1, 2, 1, 0, 0, 3, 5, 3, 1, -1, -2, + 1, 1, 1, -1, -3, -1, 1, 1, 1, -1, -2, -2, 0, 0, -1, -2 +}; + +/* 6x16-entry codebook for intra-coded 8x8 vectors */ +DECLARE_ALIGNED(4, static const int8_t, svq1_intra_codebook_8x8)[6144] = { + 4, 4, 3, 2, 2, 1, 0, -1, 4, 3, 3, 2, 1, 0, -1, -1, + 3, 3, 2, 2, 1, 0, -1, -2, 3, 2, 2, 1, 0, -1, -2, -3, + 2, 2, 1, 0, -1, -1, -2, -3, 2, 1, 0, 0, -1, -2, -3, -4, + 1, 0, 0, -1, -2, -3, -4, -4, 0, 0, -1, -2, -2, -3, -4, -4, + 2, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 3, 3, + 1, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, + -1, 0, 0, 0, 0, 0, 1, 1, -2, -2, -1, -1, -1, -1, -1, -1, + -3, -3, -3, -3, -3, -3, -2, -2, -5, -4, -4, -4, -4, -4, -4, -3, + -4, -2, -1, 0, 1, 2, 2, 3, -4, -2, -1, 0, 1, 2, 3, 3, + -4, -3, -1, 0, 1, 2, 3, 3, -4, -3, -1, 0, 1, 2, 3, 3, + -5, -3, -1, 0, 1, 2, 3, 3, -5, -3, -1, 0, 1, 2, 3, 3, + -5, -3, -1, 0, 1, 1, 2, 3, -5, -3, -2, -1, 0, 1, 2, 3, + 4, 4, 5, 5, 6, 6, 7, 7, 2, 2, 2, 3, 3, 4, 4, 4, + 0, 0, 0, 0, 1, 1, 1, 2, -2, -2, -2, -2, -1, -1, -1, 0, + -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, + -1, -2, -2, -2, -2, -2, -2, -2, -1, -1, -1, -1, -2, -2, -2, -2, + 5, 3, 1, -1, -2, -3, -3, -3, 5, 3, 1, -1, -2, -3, -3, -3, + 5, 3, 1, -1, -2, -3, -3, -3, 5, 3, 1, -1, -2, -3, -3, -3, + 5, 4, 1, 0, -2, -3, -3, -3, 6, 4, 2, 0, -2, -2, -3, -3, + 6, 4, 2, 0, -1, -2, -2, -3, 6, 4, 2, 1, -1, -2, -2, -2, + -1, 1, 3, 3, 2, 0, -3, -6, -1, 1, 3, 4, 3, 0, -3, -6, + -1, 1, 4, 4, 3, 1, -3, -6, -1, 1, 3, 4, 3, 1, -3, -6, + -2, 1, 3, 4, 3, 1, -3, -6, -2, 1, 3, 4, 3, 1, -3, -7, + -2, 1, 3, 3, 2, 0, -3, -7, -2, 0, 2, 3, 2, 0, -3, -6, + 10, 9, 8, 6, 6, 5, 4, 4, 6, 5, 4, 3, 2, 2, 2, 1, + 2, 1, 0, -1, -2, -2, -2, -1, -1, -2, -3, -4, -4, -4, -4, -3, + -2, -3, -4, -4, -5, -4, -4, -3, -2, -2, -3, -3, -3, -3, -2, -2, + -1, -1, -1, -1, -1, -1, -1, 0, 1, 1, 1, 1, 1, 1, 1, 2, + -2, -1, 1, 2, 4, 5, 7, 8, -3, -2, 0, 1, 3, 5, 7, 8, + -4, -3, -1, 0, 2, 4, 6, 7, -5, -4, -2, -1, 1, 3, 5, 7, + -6, -5, -3, -2, 0, 2, 4, 6, -6, -5, -4, -2, -1, 1, 3, 5, + -7, -6, -5, -3, -2, 0, 2, 3, -8, -7, -5, -4, -3, -1, 1, 2, + 11, 9, 7, 5, 3, 1, -1, -1, 10, 8, 6, 3, 1, 0, -2, -2, + 9, 7, 5, 2, 0, -2, -3, -4, 8, 6, 3, 1, -1, -3, -4, -4, + 6, 4, 2, -1, -3, -4, -5, -5, 5, 3, 0, -2, -4, -5, -6, -6, + 3, 1, -1, -3, -5, -6, -7, -7, 2, 0, -2, -4, -6, -6, -7, -7, + 5, 6, 7, 7, 7, 8, 8, 8, 3, 4, 5, 5, 6, 6, 6, 6, + 0, 2, 2, 3, 4, 4, 4, 5, -2, -1, 0, 1, 2, 2, 3, 3, + -4, -3, -2, -1, 0, 1, 1, 2, -6, -5, -4, -3, -2, -2, -1, 0, + -8, -7, -6, -6, -5, -4, -3, -3,-10, -9, -8, -8, -7, -6, -6, -5, + 6, 5, 3, 1, -1, -3, -6, -8, 6, 5, 4, 2, -1, -3, -6, -8, + 6, 5, 4, 2, 0, -3, -6, -8, 6, 5, 4, 2, 0, -3, -6, -8, + 6, 6, 4, 2, 0, -3, -6, -8, 6, 5, 4, 2, 0, -3, -6, -8, + 6, 5, 4, 2, 0, -3, -6, -8, 6, 5, 4, 2, -1, -3, -5, -8, + 11, 10, 9, 8, 7, 6, 5, 4, 8, 8, 7, 6, 5, 4, 3, 2, + 6, 5, 4, 4, 2, 2, 1, 0, 3, 3, 2, 1, 0, 0, -1, -2, + 1, 1, 0, -1, -2, -2, -3, -3, -1, -1, -2, -3, -4, -4, -5, -5, + -3, -4, -4, -5, -6, -6, -7, -7, -5, -5, -6, -7, -8, -8, -8, -8, + -14,-13,-12,-11, -9, -7, -6, -4,-12,-11,-10, -9, -7, -5, -3, -1, + -10, -9, -7, -6, -3, -2, 0, 2, -8, -6, -4, -2, 0, 2, 4, 5, + -5, -3, 0, 2, 4, 5, 7, 8, -2, 0, 2, 4, 6, 8, 9, 10, + 0, 3, 5, 7, 8, 10, 11, 12, 3, 5, 7, 8, 10, 11, 12, 12, + -19,-19,-18,-18,-17,-16,-15,-14,-15,-15,-14,-13,-12,-11,-10, -9, + -11,-10, -9, -8, -6, -5, -4, -3, -6, -5, -3, -2, -1, 0, 1, 2, + -1, 0, 2, 3, 4, 5, 6, 6, 4, 6, 7, 8, 9, 10, 10, 10, + 9, 10, 11, 12, 13, 14, 14, 14, 12, 14, 14, 15, 16, 16, 16, 16, + 22, 21, 19, 17, 14, 11, 9, 5, 20, 19, 17, 14, 11, 8, 4, 1, + 17, 15, 13, 10, 6, 3, 0, -4, 13, 11, 8, 5, 1, -2, -5, -9, + 9, 6, 3, -1, -4, -7,-11,-13, 4, 0, -3, -6, -9,-12,-15,-17, + -2, -5, -8,-11,-14,-16,-18,-20, -8,-10,-13,-16,-17,-19,-21,-22, + 17, 18, 18, 18, 17, 16, 16, 14, 16, 16, 15, 15, 14, 13, 12, 11, + 12, 12, 11, 10, 9, 8, 7, 5, 7, 6, 6, 4, 3, 2, 1, -1, + 1, 0, -1, -2, -3, -4, -5, -6, -5, -6, -7, -8, -9,-10,-11,-12, + -11,-12,-13,-14,-15,-16,-16,-17,-16,-17,-17,-18,-19,-20,-20,-20, + 0, 0, 0, 0, -1, -1, -2, -3, 1, 0, 0, 0, 0, -1, -2, -3, + 1, 1, 0, 0, -1, -1, -2, -2, 1, 1, 1, 0, 0, -1, -1, -2, + 2, 1, 1, 1, 0, -1, -1, -2, 2, 2, 1, 1, 0, 0, -1, -2, + 2, 2, 1, 1, 1, 0, -1, -1, 2, 2, 1, 1, 1, 0, 0, -2, + 0, -1, -1, 0, 0, 1, 2, 3, 0, -1, -1, 0, 1, 1, 2, 2, + -1, -1, -1, -1, 0, 1, 2, 2, -1, -1, -2, -1, 0, 1, 1, 2, + -1, -2, -2, -1, 0, 0, 1, 2, -1, -2, -2, -2, -1, 0, 1, 2, + -1, -1, -2, -1, 0, 0, 1, 2, -1, -1, -1, -1, 0, 1, 1, 2, + 3, 2, 2, 2, 1, 1, 0, 0, 3, 2, 2, 2, 2, 1, 0, 0, + 2, 2, 2, 1, 1, 1, 0, 0, 2, 2, 1, 1, 1, 0, 0, -1, + 1, 1, 1, 0, 0, 0, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, + -2, -2, -2, -2, -2, -2, -2, -2, -2, -3, -3, -3, -2, -2, -2, -2, + 5, 2, 0, 0, -1, 0, 0, 0, 4, 2, 0, -1, -1, -1, 0, -1, + 4, 1, -1, -1, -2, -1, -1, -1, 4, 1, -1, -1, -2, -1, -1, -1, + 4, 1, -1, -2, -2, -1, -1, -1, 4, 1, -1, -2, -2, -1, -1, -1, + 4, 1, -1, -1, -1, -1, -1, -1, 4, 2, 0, -1, 0, 0, 0, -1, + -2, -1, 0, 1, 1, 1, 1, 1, -3, -1, 0, 1, 1, 1, 1, 1, + -3, -1, 0, 1, 1, 1, 1, 1, -3, -1, 0, 1, 1, 1, 1, 1, + -3, -2, 0, 1, 2, 2, 1, 1, -4, -2, 0, 1, 2, 2, 2, 2, + -5, -3, -1, 1, 1, 2, 1, 2, -5, -3, -2, 0, 1, 1, 1, 1, + 3, 3, 1, 0, -2, -4, -4, -5, 3, 3, 2, 0, -1, -2, -3, -4, + 2, 2, 1, 1, 0, -1, -2, -2, 1, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 0, 1, 1, 1, 1, 1, -2, -1, -1, 0, 0, 1, 2, 2, + -3, -2, -2, -1, 0, 1, 2, 3, -3, -3, -2, -1, 0, 1, 2, 3, + -3, -3, -3, -3, -3, -2, -2, -2, -3, -3, -2, -2, -2, -1, -1, -1, + -2, -2, -2, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 2, 2, 2, 2, + 1, 1, 1, 2, 2, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, + -8, -7, -5, -3, -2, -1, 0, -1, -4, -3, -1, 0, 1, 2, 1, 1, + -1, 1, 2, 3, 3, 2, 2, 1, 1, 2, 3, 3, 2, 2, 1, 0, + 2, 3, 3, 2, 1, 0, 0, -1, 1, 2, 1, 0, -1, -1, -1, -1, + 1, 1, 0, -1, -1, -2, -2, -1, 1, 1, 0, 0, -1, -1, 0, -1, + -4, -3, -2, 0, 1, 2, 3, 3, -4, -3, -2, 0, 1, 2, 2, 2, + -3, -3, -2, -1, 0, 1, 1, 1, -2, -2, -2, -1, -1, 0, 0, 0, + 0, -1, -1, -1, -1, -1, -1, -1, 2, 1, 1, 0, 0, -1, -1, -2, + 3, 3, 3, 1, 0, -1, -2, -2, 5, 4, 4, 2, 1, 0, -1, -2, + 0, 0, 0, 0, 1, 2, 3, 3, 0, -1, 0, 0, 1, 2, 3, 3, + 0, -1, 0, 0, 1, 2, 3, 2, 0, 0, 0, 1, 1, 2, 2, 2, + 2, 1, 1, 1, 1, 1, 1, 0, 2, 2, 2, 1, 0, 0, -1, -2, + 2, 1, 0, 0, -2, -3, -5, -6, 0, -1, -1, -3, -5, -6, -8, -9, + -2, 0, 1, 2, 2, 1, -1, -4, -2, 0, 2, 2, 2, 1, -1, -4, + -2, 0, 2, 2, 2, 1, -1, -3, -2, 0, 2, 2, 2, 1, -1, -3, + -2, -1, 2, 2, 2, 1, -1, -3, -2, -1, 1, 2, 2, 1, -1, -3, + -3, -1, 1, 2, 2, 1, -1, -3, -2, -1, 1, 2, 2, 1, -1, -3, + -1, 1, 1, -1, -3, -3, 0, 4, -1, 1, 1, -1, -3, -3, 0, 4, + -1, 1, 1, 0, -3, -3, 0, 4, -1, 1, 2, 0, -3, -3, 0, 5, + 0, 1, 2, 0, -3, -4, 0, 4, 0, 1, 2, 0, -3, -4, 0, 5, + 0, 1, 2, 0, -3, -3, 0, 4, 0, 1, 2, -1, -2, -2, 0, 4, + 6, 6, 5, 6, 5, 5, 5, 5, 2, 2, 2, 2, 2, 2, 2, 2, + 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -2, -2, -2, -2, + -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, -2, + -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 0, 0, 0, 0, 0, + -1, -2, -2, -2, -2, -2, -2, -1, -3, -3, -3, -3, -3, -3, -3, -2, + -3, -4, -4, -3, -3, -3, -2, -2, -2, -2, -2, -2, -1, -1, 0, 0, + 0, 1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 6, + 4, 1, -2, -3, -3, -1, 1, 3, 4, 1, -2, -4, -3, -1, 1, 3, + 5, 1, -2, -4, -3, -1, 1, 4, 5, 1, -2, -3, -3, -1, 2, 4, + 5, 1, -2, -3, -3, -1, 2, 4, 4, 0, -3, -4, -3, -1, 2, 4, + 4, 0, -3, -3, -3, -1, 1, 3, 3, 0, -2, -3, -2, -1, 1, 3, + -3, -4, -4, -4, -4, -4, -4, -4, -1, -1, -1, -1, -1, -1, -2, -2, + 2, 1, 1, 2, 2, 1, 1, 1, 3, 3, 3, 4, 4, 3, 3, 3, + 3, 3, 3, 4, 4, 4, 3, 3, 1, 2, 1, 2, 2, 2, 2, 2, + -2, -2, -2, -1, -1, -1, 0, 0, -4, -4, -4, -4, -3, -3, -3, -3, + -1, -2, -3, -3, -2, -2, -1, 0, 0, -1, -2, -2, -2, -1, 0, 1, + 2, 1, -1, -1, -1, -1, 0, 1, 3, 1, 0, -1, -1, 0, 0, 1, + 3, 2, 0, -1, 0, 0, 0, 1, 3, 1, 0, -1, 0, 0, 0, 1, + 3, 1, 0, -1, 0, 0, 0, 1, 2, 1, 0, 0, 0, 0, 0, 1, + 0, 0, 0, 1, 1, 2, 3, 4, 0, 0, -1, 0, 0, 0, 2, 3, + 0, -1, -1, -1, -1, -1, 0, 1, 0, -1, -1, -1, -1, -1, -1, 0, + 0, 0, -1, -1, -1, -2, -2, -1, 1, 0, 0, -1, -1, -2, -2, -1, + 2, 2, 1, 0, -1, -1, -1, -1, 3, 3, 2, 1, 0, -1, -1, 0, + 1, 0, 1, 0, 0, -1, -2, -1, 0, 0, 0, 0, -1, -1, -2, -1, + 0, -1, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, + -1, -1, -1, 0, 0, 0, 1, 1, -1, -1, -1, 0, 1, 1, 2, 3, + -2, -2, -1, 0, 1, 2, 3, 4, -2, -2, -1, 0, 1, 2, 4, 5, + -3, -1, 1, 0, 0, -1, 0, 1, -3, 0, 1, 0, -1, -1, 0, 2, + -3, 0, 1, 0, -1, -1, 0, 2, -2, 1, 2, 0, -1, -1, 0, 2, + -2, 1, 2, 0, -1, -1, 0, 2, -2, 1, 2, 0, -1, -1, 0, 2, + -1, 2, 2, 0, -1, -1, 0, 2, -1, 1, 1, 0, -1, -1, -1, 1, + -2, -2, -1, 1, 3, 4, 3, 1, -2, -2, -1, 0, 2, 3, 2, 0, + -2, -2, -1, 0, 1, 2, 1, -1, -1, -1, -1, 0, 1, 2, 1, -1, + -1, -1, -1, 0, 1, 1, 0, -2, 0, -1, -1, 0, 1, 1, 0, -1, + 0, -1, -1, 0, 1, 1, 1, -1, 0, -1, -1, 0, 0, 1, 0, -1, + -2, -1, 0, 1, 1, 1, 1, 1, -2, -1, 0, 0, 0, 0, 0, 0, + -2, -1, -1, 0, -1, -1, -2, -2, -2, -1, -1, -1, -1, -2, -2, -3, + -1, 0, 1, 1, 0, -1, -2, -2, 1, 2, 3, 3, 2, 1, 0, 0, + 1, 2, 3, 3, 3, 2, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, + 0, -1, -1, -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, -1, 0, 0, 1, 1, 0, 0, 0, + -3, -2, -1, -1, -1, -1, 0, -1, -5, -5, -4, -3, -2, -2, -2, -1, + 1, 1, 1, 1, 2, 1, 0, -1, 1, 1, 1, 2, 1, 1, 0, -1, + 1, 1, 1, 1, 1, 1, 0, -2, 2, 1, 1, 1, 1, 1, 0, -2, + 1, 1, 0, 0, 0, 0, -1, -3, 1, 1, 0, 0, 0, -1, -2, -3, + 1, 1, 0, 0, -1, -1, -2, -4, 1, 0, 0, -1, -2, -2, -3, -4, + 8, 7, 5, 3, 2, 1, 1, 1, 2, 1, 0, 0, -1, -1, -2, -1, + -1, -1, -1, -2, -2, -2, -2, -1, -1, -1, -1, -1, 0, -1, -1, 0, + 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, + -1, 0, 0, 0, 0, 0, -1, -1, -2, -2, -1, -1, -1, -2, -2, -1, + 9, 4, 0, -2, -2, -2, -1, -1, 7, 2, -1, -2, -2, -1, 0, 0, + 4, 0, -2, -2, -1, 0, 1, 1, 1, -2, -2, -2, -1, 0, 1, 1, + -1, -2, -2, -1, 0, 1, 1, 1, -1, -2, -1, 0, 1, 1, 1, 0, + -1, -1, 0, 1, 1, 1, 0, -1, 0, -1, 0, 1, 0, 0, -1, -1, + 0, 1, 1, 1, 1, 1, 0, 0, 1, 2, 2, 2, 1, 0, 0, 0, + 2, 2, 2, 2, 1, 0, -1, -1, 1, 1, 1, 0, -1, -2, -2, -2, + 0, 0, 0, -1, -2, -3, -2, -2, -1, -1, -1, -2, -2, -2, -1, 0, + -1, -1, -1, -1, 0, 0, 1, 2, -1, -1, -1, 0, 1, 2, 3, 4, + -1, -1, 0, 0, -1, -2, -3, -3, -1, -1, 0, 0, 0, -1, -1, -1, + -2, -2, -1, 0, 1, 1, 1, 1, -2, -2, -2, 0, 1, 2, 3, 3, + -1, -1, -1, 0, 1, 3, 3, 3, 1, 0, 0, 0, 1, 1, 2, 2, + 2, 2, 1, 0, 0, -1, -1, -1, 3, 2, 1, 0, -1, -2, -3, -3, + -1, -1, -1, -2, -2, -3, -4, -5, 0, 0, 0, -1, -1, -3, -3, -4, + 1, 1, 1, 0, 0, -1, -2, -3, 2, 2, 2, 1, 1, 0, -1, -1, + 2, 2, 2, 2, 1, 1, 0, -1, 2, 2, 2, 2, 2, 1, 0, 0, + 1, 1, 2, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, -1, + -2, 2, 3, 1, -1, 1, 1, -1, -3, 2, 3, 0, -1, 1, 1, -1, + -3, 2, 3, 0, -1, 1, 1, -1, -4, 2, 3, 0, -1, 1, 1, -2, + -4, 1, 3, 0, -1, 1, 1, -2, -4, 1, 3, -1, -2, 1, 1, -2, + -3, 1, 2, 0, -1, 1, 1, -2, -3, 1, 2, 0, -1, 1, 1, -1, + -1, -1, -1, -2, -2, -2, -2, -2, 1, 1, 1, 1, 0, 0, 0, 0, + 1, 2, 2, 2, 2, 2, 2, 2, 0, 0, 1, 1, 1, 2, 2, 2, + -2, -2, -1, -1, -1, 0, 0, 0, -3, -3, -3, -3, -3, -3, -3, -2, + -1, -1, -1, -1, -2, -2, -2, -2, 4, 4, 4, 4, 4, 3, 3, 2, + -3, -3, -2, -1, 0, 1, 2, 5, -3, -3, -3, -2, -1, 1, 3, 6, + -3, -3, -2, -2, 0, 2, 3, 5, -3, -2, -2, -2, 0, 1, 3, 5, + -2, -2, -2, -1, -1, 1, 3, 5, -2, -2, -1, -1, 0, 1, 2, 4, + -1, -1, -1, -1, 0, 1, 1, 4, -1, -1, -1, -1, 0, 1, 2, 3, + 0, -1, 0, 1, 1, 0, -1, -1, 0, 0, 0, 1, 2, 0, -1, -1, + 1, 0, -1, 0, 1, 0, 0, 0, 1, -1, -2, -1, 0, 0, 0, 0, + 1, -2, -3, -1, 0, 0, 0, 1, 1, -1, -3, -2, 0, 1, 1, 2, + 1, -1, -2, -1, 0, 1, 1, 2, 2, 0, -1, 0, 1, 1, 2, 2, + 1, 1, 1, 1, 0, 0, 1, 2, -1, 0, 0, -1, 0, 0, 0, 1, + -3, -2, -1, -1, -1, 0, 1, 1, -4, -2, -1, 0, 0, 1, 1, 1, + -3, -2, 0, 0, 1, 1, 1, 1, -3, -1, 0, 1, 1, 1, 0, 0, + -1, 0, 1, 1, 1, 0, 0, -1, 0, 1, 2, 2, 1, 0, 0, -1, + -4, -4, -4, -3, -2, -1, -1, -1, -2, -2, -2, -1, 0, 0, 0, 0, + -1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, + 0, 0, 1, 1, 2, 2, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, + 0, 0, 0, 1, 1, 1, 1, 0, -1, 0, 0, 1, 1, 1, 0, 0, + 1, 2, 2, 2, 1, -1, -2, -4, 1, 1, 2, 2, 1, 0, -2, -4, + 0, 1, 1, 1, 1, 0, -1, -3, -1, 0, 1, 1, 0, 0, -1, -2, + -1, 0, 1, 1, 1, 0, 0, -1, -2, -1, 0, 0, 0, 0, 0, -1, + -1, -1, 0, 1, 1, 0, 0, 0, -1, 0, 1, 1, 1, 1, 1, 0, + 2, 2, 0, -1, -2, -1, -1, -2, 1, 1, -1, -2, -2, -1, -1, -2, + 1, 1, -1, -2, -2, 0, 0, -1, 1, 1, 0, -2, -1, 1, 1, 0, + 1, 1, 0, -1, -1, 1, 2, 1, 1, 1, 0, -1, -1, 1, 2, 1, + 1, 1, 0, -1, -1, 1, 1, 1, 1, 1, 0, -1, 0, 1, 1, 1, + 0, 0, -1, -2, -4, -4, -4, -4, 3, 3, 3, 2, 1, 0, 0, 0, + 3, 3, 3, 3, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 1, + -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, 0, -1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 0, + -1, -1, 0, -1, -1, 1, 2, -1, 1, 1, 0, 0, 0, 2, 3, -1, + 1, 1, 0, -1, -1, 1, 3, -1, 1, 1, 0, -2, -2, 0, 1, -2, + 1, 0, 0, -2, -2, 0, 1, -3, 0, 0, 0, 0, -1, 1, 1, -3, + 0, 1, 1, 0, 1, 2, 1, -3, -1, 0, 1, 1, 1, 2, 1, -4, + -4, -3, 0, 1, 1, 1, 0, 0, -4, -2, 0, 1, 1, 1, 0, -1, + -3, -1, 1, 1, 1, 0, -1, -1, -1, 1, 1, 1, 1, 0, -1, 0, + 1, 2, 2, 1, 0, -1, 0, 0, 2, 2, 1, 0, -1, -1, 0, 1, + 2, 1, 0, -1, -2, -1, 0, 1, 2, 2, 0, -1, -2, -1, 1, 1, + 1, 1, 0, 0, -1, -1, -1, -1, 0, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, -1, -1, -1, -1, -1, + 1, 0, 0, -1, -1, -1, -1, -1, 2, 1, 0, 0, -1, -1, -1, -1, + 5, 3, 2, 1, 0, 0, 0, 0, 6, 5, 3, 2, 1, 0, 0, 0, + 4, 4, 3, 1, 0, 0, 0, 1, 3, 3, 2, 1, 0, 0, 0, 1, + 2, 2, 1, 0, -1, -1, 0, 1, 0, 0, 0, -1, -1, -1, 0, 1, + 0, 0, -1, -1, -2, -1, 0, 2, 0, -1, -1, -2, -2, -2, 0, 1, + 0, -1, -1, -2, -2, -2, -1, 0, 0, 0, -1, -2, -2, -2, -1, 0, + 0, 0, -1, -1, -1, 0, 2, 3, 0, -1, -2, -2, -1, -1, 1, 2, + 1, 0, -1, -1, -1, 0, 0, 0, 1, 1, 1, 0, 0, 0, -1, -1, + 1, 2, 1, 0, 0, -1, -1, -1, -1, 0, 0, 0, -1, -1, -1, -1, + -3, -2, -1, -1, 0, 1, 1, 2, -4, -3, -1, 1, 2, 3, 5, 5, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 0, 0, 0, -1, 0, 0, 0, 1, -1, -1, -2, -2, -2, -1, -1, 0, + 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, + 1, 1, 1, 1, 2, 2, 1, 1, -4, -3, -4, -4, -4, -4, -3, -3, + -1, 0, 1, 2, 2, 3, 3, 3, -1, -1, -1, -1, 0, 0, 0, 0, + 0, 0, -1, -2, -2, -3, -3, -2, 3, 2, 1, 0, -1, -2, -2, -2, + 4, 3, 2, 1, 1, 0, 0, 0, 2, 2, 1, 1, 0, 1, 1, 1, + 0, -1, -1, -1, -1, 0, 0, 1, -2, -2, -2, -2, -2, -1, 0, 0, + 1, -1, 0, 2, 1, -2, -1, 1, 1, -1, 0, 2, 1, -2, -2, 1, + 1, -1, 0, 3, 2, -2, -1, 1, 0, -2, 0, 3, 2, -2, -2, 1, + 0, -2, 0, 3, 2, -2, -2, 1, 0, -2, 0, 3, 1, -2, -1, 1, + 0, -2, 0, 2, 1, -2, -2, 1, 0, -1, 0, 2, 1, -2, -1, 1, + 0, 1, 2, 2, 3, 3, 2, 2, 0, 1, 1, 2, 3, 3, 2, 1, + 0, 0, 1, 2, 2, 2, 2, 1, -1, 0, 0, 1, 1, 1, 1, 1, + -1, -1, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, + -2, -2, -2, -2, -2, -2, -2, -1, -2, -2, -2, -2, -2, -2, -2, -1, + 0, 0, -1, -2, -1, 0, 3, 5, 0, 0, -1, -1, -1, 0, 2, 4, + 1, 1, 0, 0, -1, -1, 1, 2, 1, 2, 1, 1, 0, -1, -1, 0, + 0, 1, 2, 1, 0, -1, -2, -2, -1, 0, 1, 2, 1, 0, -3, -3, + -2, -1, 1, 2, 2, 0, -2, -4, -2, -1, 0, 2, 2, 1, -1, -3, + 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, -1, 0, 0, 0, 0, 0, + -1, -1, -1, -1, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, + -1, -1, -1, -1, -1, -1, -1, 0, -1, 0, 0, 0, 0, -1, -1, 0, + 0, 0, 1, 1, 0, 0, 0, 1, 3, 3, 3, 4, 3, 3, 3, 3, + 5, 1, -2, -2, 0, 0, 0, -1, 4, -1, -3, -1, 0, 0, 0, -1, + 3, -1, -1, 0, 1, 1, 0, -1, 2, 0, 0, 1, 1, 1, 0, -2, + 1, 0, 0, 1, 1, 1, 0, -2, 0, -1, -1, -1, 0, 0, 0, -1, + 0, -1, -1, -1, -1, 0, 0, -1, 2, 1, 0, 0, 0, 1, 0, 0, + 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, + 1, -1, -1, 0, 0, 0, 0, 0, 2, 0, -1, -1, -1, -1, -1, 0, + 3, 1, -1, -1, -2, -2, -2, -1, 4, 2, 1, 0, -1, -2, -2, -1, + 2, 1, 0, 0, -1, -1, 0, 0, 0, -1, -1, -1, -1, 0, 1, 1, + 0, 1, 2, 2, 2, 1, -1, -3, 0, 0, 1, 1, 1, 0, -1, -2, + 0, 0, 0, 0, 0, 0, -1, -1, 0, 0, -1, 0, 0, 1, 1, 0, + 0, 0, -1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 0, + 0, 0, 1, 1, 2, 1, -1, -3, 0, 0, 0, 1, 1, -1, -4, -5, + -2, -2, -2, -1, 0, 2, 2, 2, 0, 0, 0, 0, 1, 1, 1, 0, + 1, 1, 1, 1, 1, 0, -2, -3, 0, 0, 1, 1, 0, -1, -3, -4, + -1, -1, 0, 1, 0, 0, -2, -3, -1, -1, 0, 1, 1, 1, 0, -1, + 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, + 0, 1, 0, 0, 1, 1, 1, 2, 1, 2, 0, 0, 0, 0, -1, 1, + 0, 2, 0, -1, 1, 0, -1, 0, 0, 1, 0, 0, 2, 1, 0, 1, + 0, 1, -1, 0, 2, 2, 0, 1, -1, 0, -1, -1, 2, 1, 1, 2, + -2, -2, -3, -2, 0, 1, 1, 1, -2, -2, -3, -3, -1, -1, -1, 0, + -3, -1, 0, 1, 2, 1, 1, 0, -3, -1, 0, 1, 2, 1, 1, 1, + -2, 0, 0, 1, 1, 1, 1, 1, -1, 0, 0, 0, 0, 0, 0, 0, + -2, 0, 0, 0, 0, -1, -1, 0, -2, 0, 0, 0, 0, 0, -1, -1, + -3, 0, 1, 1, 1, 1, 0, 1, -5, -2, 0, 1, 2, 2, 1, 2, + -2, -1, -1, 0, 0, 1, 2, 3, 0, 0, 1, 1, 0, 0, 1, 2, + 0, 0, 1, 0, -1, -1, 0, 1, -1, -1, -1, -1, -2, -2, -1, 0, + -2, -2, -2, -2, -2, -1, 0, 1, 0, 0, 0, -1, 0, 1, 2, 2, + 2, 1, 0, 0, 0, 1, 2, 2, 2, 1, 0, -1, -1, -1, 0, 0, + 0, 1, 1, 1, 1, 1, -1, -4, -1, -1, 0, 1, 1, 1, 0, -3, + -2, -1, 0, 0, 1, 2, 2, -2, -1, 0, 0, 0, 0, 2, 3, -1, + -1, 0, 0, 0, 0, 1, 2, 0, 0, 0, -1, -2, -1, 1, 1, 0, + 0, 0, -1, -2, -2, 0, 2, 1, 0, 0, -1, -2, -1, 1, 2, 2, + 1, 0, 0, 0, -2, -3, -2, -3, 0, 0, 1, 0, -2, -2, -1, -1, + 0, -1, 1, 1, -1, -1, 0, 0, 0, -1, 1, 1, -1, -1, 0, 0, + 0, 1, 2, 1, -1, -1, 0, 1, 1, 2, 3, 2, 0, 0, 1, 2, + -1, 0, 2, 1, 0, 0, 2, 3, -2, -1, 0, 0, -1, 0, 1, 2, + 1, 1, 0, -1, -2, -2, -1, 1, 1, 1, 1, -1, -2, -2, 0, 2, + 1, 1, 1, -1, -1, -1, 0, 2, 0, 0, 0, 0, 0, 0, 1, 2, + -1, -1, -1, 0, 0, 0, 1, 2, -1, -2, -1, 1, 1, 1, 0, 0, + -1, -2, -1, 1, 2, 2, 0, -1, -1, -2, -1, 2, 2, 2, 0, -1, + -1, -1, -1, -2, -1, -1, 0, 1, 0, 0, -1, -1, -1, 0, 1, 2, + 1, 0, 0, 0, 0, 1, 1, 2, 1, 1, 0, 0, 1, 1, 1, 1, + 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, -1, -1, -1, + 1, 2, 1, 0, -1, -2, -2, -3, 2, 2, 1, 0, -2, -3, -4, -4, + -4, -2, 1, 1, 1, 1, 0, 0, -2, 0, 1, 0, 0, 0, 0, 0, + 0, 1, 1, -2, -2, -1, 0, 1, 2, 2, 1, -2, -2, -1, 1, 2, + 1, 2, 1, -2, -2, -1, 1, 2, -1, 1, 1, -1, -1, -1, 0, 1, + -2, 0, 1, 1, 0, -1, -1, 0, -2, 0, 2, 2, 1, -1, -1, 0, + 1, 1, 0, 0, 0, 1, 0, 0, -2, -3, -3, -2, -2, -1, 0, 0, + -3, -4, -3, -2, -1, 0, 0, 0, -1, -1, 0, 1, 2, 3, 2, 1, + 0, 1, 2, 3, 3, 3, 2, 1, 1, 1, 1, 2, 1, 0, 0, -1, + 0, 0, 0, 0, -1, -1, -1, -1, 0, -1, -1, 0, 0, 0, 0, 0, + 1, 1, 0, 0, -1, -1, 0, 2, 0, 0, 1, 0, -1, -1, 1, 1, + -2, -1, 0, 1, 1, 1, 1, 1, -3, -3, 0, 2, 2, 1, 1, 0, + -2, -2, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, -1, -1, + 3, 1, -1, -3, -2, -1, 0, 1, 4, 2, -1, -3, -3, -1, 1, 2, + 0, 0, 0, -1, -1, -1, -1, -1, 1, 2, 1, 0, 0, 0, -1, -1, + 2, 3, 3, 2, 1, 0, -1, -1, 3, 4, 4, 2, 1, 0, -1, -2, + 3, 3, 2, 1, 0, -1, -2, -2, 1, 1, 0, -1, -1, -2, -2, -3, + 0, 0, 0, -1, -1, -2, -2, -2, -1, -1, -1, -1, -1, -2, -2, -1, + 1, 2, 2, 2, 2, 1, 2, 2, 0, 1, 1, 1, 1, 0, 0, 0, + 0, 0, 0, 1, 1, 0, -1, -2, 0, 0, 0, 0, 1, 0, -1, -4, + 1, 0, 0, 0, 0, 0, -2, -5, 1, 0, 0, 0, 0, 0, -1, -4, + 1, 0, -1, 0, 0, 0, -1, -3, 0, -1, -1, 0, 1, 1, 1, -1, + -2, -1, 0, 0, -1, -1, -1, -2, -1, 0, 0, 0, -1, -1, -2, -2, + 0, 1, 1, 0, -1, -1, -1, -2, 0, 1, 1, 0, 0, 0, -1, -1, + 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 0, 1, 2, 2, 1, + 1, 1, 0, 0, 1, 2, 2, 1, 1, 1, 0, -1, 0, 1, 1, 0, + 4, 2, 1, 0, 0, 1, 1, 1, 4, 2, 1, 0, 0, 0, 0, 1, + 3, 1, 0, 0, -1, -1, -1, 0, 1, 0, 0, -1, -1, -2, -1, 0, + 0, 0, 0, 0, -1, -1, -1, 0, -1, -1, 0, 0, -1, -1, 0, 1, + -2, -1, 0, -1, -1, 0, 0, 1, -2, -2, -1, -2, -1, 0, 0, 1, + 0, 1, 1, 1, 2, 1, 0, -1, -1, -1, -1, 0, 0, -1, -2, -2, + -1, 0, -1, 0, 0, -1, -2, -1, 0, 0, 0, 0, 0, 0, 1, 2, + 0, 0, 0, 0, 0, 0, 2, 3, -1, 0, -1, -1, -1, -1, 0, 3, + -1, 0, 0, -1, -1, -2, 0, 3, 0, 0, 0, 0, -1, -1, 1, 4, + 2, 2, 0, 0, 0, 0, 0, 1, 1, 1, -1, -2, -1, -2, -1, 1, + -1, -1, -2, -2, -2, -3, -2, 0, -1, 0, -1, -1, -1, -2, -1, 1, + 1, 1, 0, 0, 1, 0, 0, 1, 2, 2, 0, 0, 1, 0, 0, 1, + 2, 2, 0, 0, 0, 0, -1, -1, 2, 2, 0, 0, 1, 0, -1, -1, + -1, 0, 1, 1, 0, -1, -1, -1, 1, 2, 3, 2, 1, 0, 0, 0, + 0, 1, 1, 1, 0, -1, 0, 0, -2, -2, -1, 0, 1, 0, 0, 0, + -2, -2, -1, 2, 2, 2, 1, 0, -2, -1, 0, 1, 1, 0, 0, -1, + -1, -1, 0, 0, -1, -2, -1, -2, 0, 1, 1, 1, 0, 0, 1, 1, + -3, -3, -3, -2, -1, -1, -2, -2, -1, -1, 0, 1, 2, 1, 0, 0, + 1, 1, 1, 2, 2, 1, 0, 0, 1, 1, 1, 1, 1, 0, -1, 1, + 1, 0, -1, -1, 0, 0, -1, 1, 0, -1, -1, -1, 0, -1, -1, 1, + 1, 0, -1, 0, 0, -1, 0, 2, 2, 0, -1, 0, 0, 0, 0, 2, + 1, 0, -2, -1, 0, 1, 1, 0, 2, 0, -1, -1, 0, 1, 1, 0, + 1, 0, -2, -1, 0, 1, 0, -1, 1, 0, -1, -1, 0, 1, 0, -1, + 0, 1, 1, 0, 1, 1, 0, 0, -2, 1, 2, 1, 0, 0, 0, 1, + -5, 0, 2, 1, 0, -1, 0, 1, -6, -1, 2, 1, 0, -1, 0, 0, + 5, 3, 0, -1, -2, -1, -1, -1, 1, 1, 0, -1, -1, 0, -1, -1, + -1, 0, 1, 1, 2, 2, 1, 0, -2, -1, 0, 1, 2, 1, 1, 1, + -2, -1, -1, -1, 0, -1, 0, 1, 0, 1, 0, 0, -1, -1, 0, 0, + 0, 1, 1, 1, 1, 0, 0, 0, -3, -2, 0, 1, 1, 0, 0, -1, + -1, 0, 1, 0, -1, 0, 2, 3, -1, 0, 0, -2, -4, -2, -1, 0, + 0, 1, 1, 0, -2, -1, 0, -1, 1, 2, 3, 1, 0, 1, 1, 0, + -1, 0, 1, 1, 1, 1, 1, 0, -2, -3, -2, 0, 0, 0, 1, 0, + -1, -2, -2, 0, 1, 0, 0, -1, 3, 1, 0, 0, 1, 0, -1, -1, + -2, -1, 0, 0, -1, -1, 0, 0, -1, 0, 0, 0, 0, 1, 1, 1, + -1, -1, -1, 0, 1, 1, 1, 1, 0, -2, -3, -1, 1, 0, 0, 0, + 1, -1, -3, -1, 1, 1, 0, -1, 3, 1, -1, 1, 2, 2, 0, -1, + 3, 1, 0, 1, 2, 1, 1, 0, 0, -2, -2, -1, -1, 0, 0, 0, + 1, 0, -1, -1, 1, 2, 1, 0, 0, -1, -2, -1, 1, 2, 2, 1, + -1, -1, -1, 0, 0, 1, 2, 0, -2, 0, 0, 0, 0, 0, 1, -1, + -1, 0, 1, 0, -1, -1, -1, -1, 0, 1, 1, 2, 0, -2, -1, 0, + 1, 2, 2, 2, 1, -1, -1, 0, 0, 1, 1, 1, 0, -2, -2, -1, + 0, 0, -1, -1, -1, -1, -2, -2, 0, 0, -1, 0, 1, 2, 2, 1, + 0, 0, -1, -1, 0, 1, 2, 2, 1, 1, -1, -2, -1, -1, -1, -1, + 2, 2, 1, 0, 0, -1, -2, -2, 1, 2, 2, 1, 0, 0, -2, -2, + 0, 0, 0, 0, 1, 1, 0, -1, 0, -1, -1, -1, 2, 3, 2, 1, + 0, -2, 1, 2, -1, 0, 0, 1, -1, -2, 2, 3, -1, 0, 0, 0, + 0, -2, 2, 3, -1, -1, 0, 0, 0, -1, 3, 2, -2, 0, 1, 0, + 0, -1, 3, 1, -2, 0, 1, 0, 0, -1, 2, 1, -1, 1, 0, -1, + 0, 0, 1, -1, -2, 0, 0, -1, 1, 0, 0, -2, -2, -1, -1, -1, + 1, 1, 1, 1, 1, -1, -1, -2, 0, 0, 0, 1, 1, 1, 1, 1, + 0, 0, 0, 1, 1, 1, 2, 3, 1, 0, 0, -1, 0, 0, 1, 2, + 0, -1, -1, -2, -1, 0, 1, 2, -2, -2, -2, -2, -1, 0, 1, 1, + -1, -1, -1, -1, 0, 0, 0, -1, 2, 2, 2, 0, -1, -1, -2, -4, + -1, -2, -1, -1, 0, 1, 2, 3, -1, -1, -1, -1, 0, 1, 2, 3, + 1, 0, -1, 0, -1, 0, 1, 2, 1, 0, 0, 0, -1, 0, 2, 2, + 1, 0, -1, -1, -2, 0, 1, 2, 0, -2, -2, -2, -3, -1, 0, 1, + 0, -2, -2, -2, -2, -1, 1, 1, 0, 0, 0, 0, 0, 1, 2, 2 +}; + +/* list of codebooks for intra-coded vectors */ +const int8_t* const ff_svq1_intra_codebooks[6] = { + svq1_intra_codebook_4x2, svq1_intra_codebook_4x4, + svq1_intra_codebook_8x4, svq1_intra_codebook_8x8, + NULL, NULL, +}; + +#endif /* AVCODEC_SVQ1_CB_H */ diff --git a/include/libavcodec/svq1_vlc.h b/include/libavcodec/svq1_vlc.h new file mode 100644 index 0000000..5c27928 --- /dev/null +++ b/include/libavcodec/svq1_vlc.h @@ -0,0 +1,268 @@ +/* + * Copyright (C) 2003 The FFmpeg project + * + * 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_SVQ1_VLC_H +#define AVCODEC_SVQ1_VLC_H + +#include + +/* values in this table range from 0..3; adjust retrieved value by +0 */ +const uint8_t ff_svq1_block_type_vlc[4][2] = { + /* { code, length } */ + { 0x1, 1 }, { 0x1, 2 }, { 0x1, 3 }, { 0x0, 3 } +}; + +/* values in this table range from -1..6; adjust retrieved value by -1 */ +const uint8_t ff_svq1_intra_multistage_vlc[6][8][2] = { + /* { code, length } */ + { { 0x1, 5 }, { 0x1, 1 }, { 0x3, 3 }, { 0x2, 3 }, + { 0x3, 4 }, { 0x2, 4 }, { 0x0, 5 }, { 0x1, 4 } }, + { { 0x1, 4 }, { 0x3, 2 }, { 0x5, 3 }, { 0x4, 3 }, + { 0x3, 3 }, { 0x2, 3 }, { 0x0, 4 }, { 0x1, 3 } }, + { { 0x1, 5 }, { 0x1, 1 }, { 0x3, 3 }, { 0x0, 5 }, + { 0x3, 4 }, { 0x2, 3 }, { 0x2, 4 }, { 0x1, 4 } }, + { { 0x1, 6 }, { 0x1, 1 }, { 0x1, 2 }, { 0x0, 6 }, + { 0x3, 4 }, { 0x2, 4 }, { 0x1, 5 }, { 0x1, 4 } }, + { { 0x1, 6 }, { 0x1, 1 }, { 0x1, 2 }, { 0x3, 5 }, + { 0x2, 5 }, { 0x0, 6 }, { 0x1, 5 }, { 0x1, 3 } }, + { { 0x1, 7 }, { 0x1, 1 }, { 0x1, 2 }, { 0x1, 3 }, + { 0x1, 4 }, { 0x1, 6 }, { 0x0, 7 }, { 0x1, 5 } } +}; + +/* values in this table range from -1..6; adjust retrieved value by -1 */ +const uint8_t ff_svq1_inter_multistage_vlc[6][8][2] = { + /* { code, length } */ + { { 0x3, 2 }, { 0x5, 3 }, { 0x4, 3 }, { 0x3, 3 }, + { 0x2, 3 }, { 0x1, 3 }, { 0x1, 4 }, { 0x0, 4 } }, + { { 0x3, 2 }, { 0x5, 3 }, { 0x4, 3 }, { 0x3, 3 }, + { 0x2, 3 }, { 0x1, 3 }, { 0x1, 4 }, { 0x0, 4 } }, + { { 0x1, 1 }, { 0x3, 3 }, { 0x2, 3 }, { 0x3, 4 }, + { 0x2, 4 }, { 0x1, 4 }, { 0x1, 5 }, { 0x0, 5 } }, + { { 0x1, 1 }, { 0x3, 3 }, { 0x2, 3 }, { 0x3, 4 }, + { 0x2, 4 }, { 0x1, 4 }, { 0x1, 5 }, { 0x0, 5 } }, + { { 0x1, 1 }, { 0x3, 3 }, { 0x2, 3 }, { 0x3, 4 }, + { 0x2, 4 }, { 0x1, 4 }, { 0x1, 5 }, { 0x0, 5 } }, + { { 0x1, 1 }, { 0x1, 2 }, { 0x1, 3 }, { 0x3, 5 }, + { 0x2, 5 }, { 0x1, 5 }, { 0x1, 6 }, { 0x0, 6 } } +}; + +/* values in this table range from 0..255; adjust retrieved value by +0 */ +const uint16_t ff_svq1_intra_mean_vlc[256][2] = { + /* { code, length } */ + { 0x37, 6 }, { 0x56, 7 }, { 0x01, 17 }, { 0x01, 20 }, + { 0x02, 20 }, { 0x03, 20 }, { 0x00, 20 }, { 0x04, 20 }, + { 0x05, 20 }, { 0x03, 19 }, { 0x15, 11 }, { 0x42, 9 }, + { 0x14, 11 }, { 0x03, 14 }, { 0x02, 14 }, { 0x01, 15 }, + { 0x01, 16 }, { 0x01, 12 }, { 0x2B, 10 }, { 0x18, 11 }, + { 0x0C, 11 }, { 0x41, 9 }, { 0x78, 8 }, { 0x6C, 8 }, + { 0x55, 7 }, { 0x0F, 4 }, { 0x0E, 4 }, { 0x34, 6 }, + { 0x51, 7 }, { 0x72, 8 }, { 0x6E, 8 }, { 0x40, 9 }, + { 0x3F, 9 }, { 0x3E, 9 }, { 0x3D, 9 }, { 0x3C, 9 }, + { 0x3B, 9 }, { 0x3A, 9 }, { 0x39, 9 }, { 0x38, 9 }, + { 0x37, 9 }, { 0x43, 9 }, { 0x46, 9 }, { 0x47, 9 }, + { 0x45, 9 }, { 0x44, 9 }, { 0x49, 9 }, { 0x48, 9 }, + { 0x4A, 8 }, { 0x79, 8 }, { 0x76, 8 }, { 0x77, 8 }, + { 0x71, 8 }, { 0x75, 8 }, { 0x74, 8 }, { 0x73, 8 }, + { 0x6A, 8 }, { 0x55, 8 }, { 0x70, 8 }, { 0x6F, 8 }, + { 0x52, 8 }, { 0x6D, 8 }, { 0x4C, 8 }, { 0x6B, 8 }, + { 0x40, 7 }, { 0x69, 8 }, { 0x68, 8 }, { 0x67, 8 }, + { 0x66, 8 }, { 0x65, 8 }, { 0x64, 8 }, { 0x63, 8 }, + { 0x62, 8 }, { 0x61, 8 }, { 0x60, 8 }, { 0x5F, 8 }, + { 0x5E, 8 }, { 0x5D, 8 }, { 0x5C, 8 }, { 0x5B, 8 }, + { 0x5A, 8 }, { 0x59, 8 }, { 0x58, 8 }, { 0x57, 8 }, + { 0x56, 8 }, { 0x3D, 7 }, { 0x54, 8 }, { 0x53, 8 }, + { 0x3F, 7 }, { 0x51, 8 }, { 0x50, 8 }, { 0x4F, 8 }, + { 0x4E, 8 }, { 0x4D, 8 }, { 0x41, 7 }, { 0x4B, 8 }, + { 0x53, 7 }, { 0x3E, 7 }, { 0x48, 8 }, { 0x4F, 7 }, + { 0x52, 7 }, { 0x45, 8 }, { 0x50, 7 }, { 0x43, 8 }, + { 0x42, 8 }, { 0x41, 8 }, { 0x42, 7 }, { 0x43, 7 }, + { 0x3E, 8 }, { 0x44, 7 }, { 0x3C, 8 }, { 0x45, 7 }, + { 0x46, 7 }, { 0x47, 7 }, { 0x48, 7 }, { 0x49, 7 }, + { 0x4A, 7 }, { 0x4B, 7 }, { 0x4C, 7 }, { 0x4D, 7 }, + { 0x4E, 7 }, { 0x58, 7 }, { 0x59, 7 }, { 0x5A, 7 }, + { 0x5B, 7 }, { 0x5C, 7 }, { 0x5D, 7 }, { 0x44, 8 }, + { 0x49, 8 }, { 0x29, 8 }, { 0x3F, 8 }, { 0x3D, 8 }, + { 0x3B, 8 }, { 0x2C, 8 }, { 0x28, 8 }, { 0x25, 8 }, + { 0x26, 8 }, { 0x5E, 7 }, { 0x57, 7 }, { 0x54, 7 }, + { 0x5F, 7 }, { 0x62, 7 }, { 0x63, 7 }, { 0x64, 7 }, + { 0x61, 7 }, { 0x65, 7 }, { 0x67, 7 }, { 0x66, 7 }, + { 0x35, 6 }, { 0x36, 6 }, { 0x60, 7 }, { 0x39, 8 }, + { 0x3A, 8 }, { 0x38, 8 }, { 0x37, 8 }, { 0x36, 8 }, + { 0x35, 8 }, { 0x34, 8 }, { 0x33, 8 }, { 0x32, 8 }, + { 0x31, 8 }, { 0x30, 8 }, { 0x2D, 8 }, { 0x2B, 8 }, + { 0x2A, 8 }, { 0x27, 8 }, { 0x40, 8 }, { 0x46, 8 }, + { 0x47, 8 }, { 0x26, 9 }, { 0x25, 9 }, { 0x24, 9 }, + { 0x23, 9 }, { 0x22, 9 }, { 0x2E, 8 }, { 0x2F, 8 }, + { 0x1F, 9 }, { 0x36, 9 }, { 0x1D, 9 }, { 0x21, 9 }, + { 0x1B, 9 }, { 0x1C, 9 }, { 0x19, 9 }, { 0x1A, 9 }, + { 0x18, 9 }, { 0x17, 9 }, { 0x16, 9 }, { 0x1E, 9 }, + { 0x20, 9 }, { 0x27, 9 }, { 0x28, 9 }, { 0x29, 9 }, + { 0x2A, 9 }, { 0x2B, 9 }, { 0x2C, 9 }, { 0x2D, 9 }, + { 0x2E, 9 }, { 0x2F, 9 }, { 0x30, 9 }, { 0x35, 9 }, + { 0x31, 9 }, { 0x32, 9 }, { 0x33, 9 }, { 0x34, 9 }, + { 0x19, 10 }, { 0x2A, 10 }, { 0x17, 10 }, { 0x16, 10 }, + { 0x15, 10 }, { 0x28, 10 }, { 0x26, 10 }, { 0x25, 10 }, + { 0x22, 10 }, { 0x21, 10 }, { 0x18, 10 }, { 0x14, 10 }, + { 0x29, 10 }, { 0x12, 10 }, { 0x0D, 10 }, { 0x0E, 10 }, + { 0x0F, 10 }, { 0x10, 10 }, { 0x11, 10 }, { 0x1A, 10 }, + { 0x1B, 10 }, { 0x1C, 10 }, { 0x1D, 10 }, { 0x1E, 10 }, + { 0x1F, 10 }, { 0x20, 10 }, { 0x13, 10 }, { 0x23, 10 }, + { 0x24, 10 }, { 0x09, 11 }, { 0x08, 11 }, { 0x07, 11 }, + { 0x27, 10 }, { 0x05, 11 }, { 0x0B, 11 }, { 0x06, 11 }, + { 0x04, 11 }, { 0x03, 11 }, { 0x02, 11 }, { 0x01, 11 }, + { 0x0A, 11 }, { 0x16, 11 }, { 0x19, 11 }, { 0x17, 11 }, + { 0x0D, 11 }, { 0x0E, 11 }, { 0x0F, 11 }, { 0x10, 11 }, + { 0x11, 11 }, { 0x12, 11 }, { 0x13, 11 }, { 0x01, 14 } +}; + +/* values in this table range from -256..255; adjust retrieved value by -256 */ +const uint16_t ff_svq1_inter_mean_vlc[512][2] = { + /* { code, length } */ + { 0x5A, 22 }, { 0xD4, 22 }, { 0xD5, 22 }, { 0xD6, 22 }, + { 0xD7, 22 }, { 0xD8, 22 }, { 0xD9, 22 }, { 0xDA, 22 }, + { 0xDB, 22 }, { 0xDC, 22 }, { 0xDD, 22 }, { 0xDE, 22 }, + { 0xDF, 22 }, { 0xE0, 22 }, { 0xE1, 22 }, { 0xE2, 22 }, + { 0xE3, 22 }, { 0xE4, 22 }, { 0xE5, 22 }, { 0xE6, 22 }, + { 0xE8, 22 }, { 0xCB, 22 }, { 0xE9, 22 }, { 0xEA, 22 }, + { 0xE7, 22 }, { 0xEC, 22 }, { 0xED, 22 }, { 0xEE, 22 }, + { 0xEF, 22 }, { 0xF0, 22 }, { 0xF1, 22 }, { 0xF2, 22 }, + { 0xF3, 22 }, { 0xF4, 22 }, { 0xF5, 22 }, { 0xF6, 22 }, + { 0xF7, 22 }, { 0xF8, 22 }, { 0x102,22 }, { 0xEB, 22 }, + { 0xF9, 22 }, { 0xFC, 22 }, { 0xFD, 22 }, { 0xFE, 22 }, + { 0x100,22 }, { 0x5C, 22 }, { 0x60, 22 }, { 0x101,22 }, + { 0x71, 22 }, { 0x104,22 }, { 0x105,22 }, { 0xFB, 22 }, + { 0xFF, 22 }, { 0x86, 21 }, { 0xFA, 22 }, { 0x7C, 22 }, + { 0x75, 22 }, { 0x103,22 }, { 0x78, 22 }, { 0xD3, 22 }, + { 0x7B, 22 }, { 0x82, 22 }, { 0xD2, 22 }, { 0xD1, 22 }, + { 0xD0, 22 }, { 0xCF, 22 }, { 0xCE, 22 }, { 0xCD, 22 }, + { 0xCC, 22 }, { 0xC3, 22 }, { 0xCA, 22 }, { 0xC9, 22 }, + { 0xC8, 22 }, { 0xC7, 22 }, { 0xC6, 22 }, { 0xC5, 22 }, + { 0x8B, 22 }, { 0xC4, 22 }, { 0xC2, 22 }, { 0xC1, 22 }, + { 0xC0, 22 }, { 0xBF, 22 }, { 0xBE, 22 }, { 0xBD, 22 }, + { 0xBC, 22 }, { 0xBB, 22 }, { 0xBA, 22 }, { 0xB9, 22 }, + { 0x61, 22 }, { 0x84, 22 }, { 0x85, 22 }, { 0x86, 22 }, + { 0x87, 22 }, { 0x88, 22 }, { 0x89, 22 }, { 0x8A, 22 }, + { 0x8C, 22 }, { 0x8D, 22 }, { 0x8E, 22 }, { 0x8F, 22 }, + { 0x90, 22 }, { 0x91, 22 }, { 0x92, 22 }, { 0x93, 22 }, + { 0x94, 22 }, { 0x95, 22 }, { 0x96, 22 }, { 0x97, 22 }, + { 0x98, 22 }, { 0x99, 22 }, { 0x9A, 22 }, { 0x9B, 22 }, + { 0x9C, 22 }, { 0x9D, 22 }, { 0x9E, 22 }, { 0x9F, 22 }, + { 0xA0, 22 }, { 0xA1, 22 }, { 0xA2, 22 }, { 0xA3, 22 }, + { 0xA4, 22 }, { 0xA5, 22 }, { 0xA6, 22 }, { 0xA7, 22 }, + { 0xA8, 22 }, { 0xA9, 22 }, { 0xAA, 22 }, { 0xAB, 22 }, + { 0x8E, 21 }, { 0x8F, 21 }, { 0xAC, 22 }, { 0xAD, 22 }, + { 0xAE, 22 }, { 0xAF, 22 }, { 0xB0, 22 }, { 0xB1, 22 }, + { 0x53, 20 }, { 0x90, 21 }, { 0xB2, 22 }, { 0x91, 21 }, + { 0xB3, 22 }, { 0xB4, 22 }, { 0x54, 20 }, { 0xB5, 22 }, + { 0xB6, 22 }, { 0x8C, 21 }, { 0x34, 19 }, { 0x3D, 18 }, + { 0x55, 20 }, { 0xB7, 22 }, { 0xB8, 22 }, { 0x8B, 21 }, + { 0x56, 20 }, { 0x3D, 19 }, { 0x57, 20 }, { 0x58, 20 }, + { 0x40, 19 }, { 0x43, 19 }, { 0x47, 19 }, { 0x2A, 18 }, + { 0x2E, 19 }, { 0x2C, 18 }, { 0x46, 19 }, { 0x59, 20 }, + { 0x49, 19 }, { 0x2D, 19 }, { 0x38, 18 }, { 0x36, 18 }, + { 0x39, 18 }, { 0x45, 19 }, { 0x28, 18 }, { 0x30, 18 }, + { 0x35, 18 }, { 0x20, 17 }, { 0x44, 19 }, { 0x32, 18 }, + { 0x31, 18 }, { 0x1F, 17 }, { 0x2F, 18 }, { 0x2E, 18 }, + { 0x2D, 18 }, { 0x21, 17 }, { 0x22, 17 }, { 0x23, 17 }, + { 0x24, 17 }, { 0x27, 16 }, { 0x23, 16 }, { 0x20, 16 }, + { 0x1D, 16 }, { 0x25, 16 }, { 0x1E, 16 }, { 0x24, 16 }, + { 0x2A, 16 }, { 0x26, 16 }, { 0x21, 15 }, { 0x29, 16 }, + { 0x22, 15 }, { 0x23, 15 }, { 0x24, 15 }, { 0x1B, 15 }, + { 0x1A, 15 }, { 0x1D, 15 }, { 0x1F, 15 }, { 0x27, 15 }, + { 0x17, 14 }, { 0x18, 14 }, { 0x19, 14 }, { 0x1B, 14 }, + { 0x1C, 14 }, { 0x1E, 14 }, { 0x25, 14 }, { 0x20, 14 }, + { 0x21, 14 }, { 0x13, 13 }, { 0x14, 13 }, { 0x15, 13 }, + { 0x16, 13 }, { 0x17, 13 }, { 0x18, 13 }, { 0x19, 13 }, + { 0x1A, 13 }, { 0x18, 12 }, { 0x17, 12 }, { 0x15, 12 }, + { 0x14, 12 }, { 0x13, 12 }, { 0x12, 12 }, { 0x0F, 11 }, + { 0x10, 11 }, { 0x12, 11 }, { 0x13, 11 }, { 0x1B, 11 }, + { 0x1A, 11 }, { 0x0E, 10 }, { 0x13, 10 }, { 0x0F, 10 }, + { 0x10, 10 }, { 0x11, 10 }, { 0x12, 10 }, { 0x0D, 9 }, + { 0x14, 9 }, { 0x15, 9 }, { 0x0C, 9 }, { 0x13, 9 }, + { 0x0F, 8 }, { 0x0E, 8 }, { 0x10, 8 }, { 0x11, 8 }, + { 0x0C, 7 }, { 0x09, 7 }, { 0x0A, 7 }, { 0x08, 6 }, + { 0x09, 6 }, { 0x09, 5 }, { 0x08, 5 }, { 0x05, 4 }, + { 0x01, 1 }, { 0x03, 3 }, { 0x07, 5 }, { 0x06, 5 }, + { 0x0B, 6 }, { 0x0A, 6 }, { 0x0E, 7 }, { 0x0F, 7 }, + { 0x0B, 7 }, { 0x0D, 7 }, { 0x0B, 8 }, { 0x0D, 8 }, + { 0x0C, 8 }, { 0x0F, 9 }, { 0x10, 9 }, { 0x11, 9 }, + { 0x0E, 9 }, { 0x12, 9 }, { 0x17, 10 }, { 0x14, 10 }, + { 0x16, 10 }, { 0x15, 10 }, { 0x19, 11 }, { 0x18, 11 }, + { 0x17, 11 }, { 0x16, 11 }, { 0x15, 11 }, { 0x14, 11 }, + { 0x11, 11 }, { 0x19, 12 }, { 0x1A, 12 }, { 0x16, 12 }, + { 0x1D, 12 }, { 0x1B, 12 }, { 0x1C, 12 }, { 0x20, 13 }, + { 0x1C, 13 }, { 0x23, 13 }, { 0x22, 13 }, { 0x21, 13 }, + { 0x1F, 13 }, { 0x1E, 13 }, { 0x1B, 13 }, { 0x1D, 13 }, + { 0x24, 14 }, { 0x16, 14 }, { 0x1A, 14 }, { 0x22, 14 }, + { 0x1D, 14 }, { 0x1F, 14 }, { 0x15, 14 }, { 0x23, 14 }, + { 0x18, 15 }, { 0x20, 15 }, { 0x29, 15 }, { 0x28, 15 }, + { 0x26, 15 }, { 0x25, 15 }, { 0x19, 15 }, { 0x1C, 15 }, + { 0x1E, 15 }, { 0x17, 15 }, { 0x2C, 16 }, { 0x2B, 16 }, + { 0x1C, 16 }, { 0x21, 16 }, { 0x2D, 16 }, { 0x28, 16 }, + { 0x1F, 16 }, { 0x1B, 16 }, { 0x1A, 16 }, { 0x22, 16 }, + { 0x2D, 17 }, { 0x32, 17 }, { 0x2C, 17 }, { 0x27, 17 }, + { 0x31, 17 }, { 0x33, 17 }, { 0x2F, 17 }, { 0x2B, 17 }, + { 0x37, 18 }, { 0x2A, 17 }, { 0x2E, 17 }, { 0x30, 17 }, + { 0x29, 17 }, { 0x28, 17 }, { 0x26, 17 }, { 0x25, 17 }, + { 0x2F, 19 }, { 0x33, 18 }, { 0x34, 18 }, { 0x30, 19 }, + { 0x3A, 18 }, { 0x3B, 18 }, { 0x31, 19 }, { 0x3C, 18 }, + { 0x2B, 18 }, { 0x29, 18 }, { 0x48, 19 }, { 0x27, 18 }, + { 0x42, 19 }, { 0x41, 19 }, { 0x26, 18 }, { 0x52, 20 }, + { 0x51, 20 }, { 0x3F, 19 }, { 0x3E, 19 }, { 0x39, 19 }, + { 0x3C, 19 }, { 0x3B, 19 }, { 0x3A, 19 }, { 0x25, 18 }, + { 0x38, 19 }, { 0x50, 20 }, { 0x37, 19 }, { 0x36, 19 }, + { 0x87, 21 }, { 0x4F, 20 }, { 0x35, 19 }, { 0x4E, 20 }, + { 0x33, 19 }, { 0x32, 19 }, { 0x4D, 20 }, { 0x4C, 20 }, + { 0x83, 22 }, { 0x4B, 20 }, { 0x81, 22 }, { 0x80, 22 }, + { 0x7F, 22 }, { 0x7E, 22 }, { 0x7D, 22 }, { 0x84, 21 }, + { 0x8D, 21 }, { 0x7A, 22 }, { 0x79, 22 }, { 0x4A, 20 }, + { 0x77, 22 }, { 0x76, 22 }, { 0x89, 21 }, { 0x74, 22 }, + { 0x73, 22 }, { 0x72, 22 }, { 0x49, 20 }, { 0x70, 22 }, + { 0x6F, 22 }, { 0x6E, 22 }, { 0x6D, 22 }, { 0x6C, 22 }, + { 0x6B, 22 }, { 0x6A, 22 }, { 0x69, 22 }, { 0x68, 22 }, + { 0x67, 22 }, { 0x66, 22 }, { 0x65, 22 }, { 0x64, 22 }, + { 0x63, 22 }, { 0x62, 22 }, { 0x8A, 21 }, { 0x88, 21 }, + { 0x5F, 22 }, { 0x5E, 22 }, { 0x5D, 22 }, { 0x85, 21 }, + { 0x5B, 22 }, { 0x83, 21 }, { 0x59, 22 }, { 0x58, 22 }, + { 0x57, 22 }, { 0x56, 22 }, { 0x55, 22 }, { 0x54, 22 }, + { 0x53, 22 }, { 0x52, 22 }, { 0x51, 22 }, { 0x50, 22 }, + { 0x4F, 22 }, { 0x4E, 22 }, { 0x4D, 22 }, { 0x4C, 22 }, + { 0x4B, 22 }, { 0x4A, 22 }, { 0x49, 22 }, { 0x48, 22 }, + { 0x47, 22 }, { 0x46, 22 }, { 0x45, 22 }, { 0x44, 22 }, + { 0x43, 22 }, { 0x42, 22 }, { 0x41, 22 }, { 0x40, 22 }, + { 0x3F, 22 }, { 0x3E, 22 }, { 0x3D, 22 }, { 0x3C, 22 }, + { 0x3B, 22 }, { 0x3A, 22 }, { 0x39, 22 }, { 0x38, 22 }, + { 0x37, 22 }, { 0x36, 22 }, { 0x35, 22 }, { 0x34, 22 }, + { 0x33, 22 }, { 0x32, 22 }, { 0x31, 22 }, { 0x30, 22 }, + { 0x2F, 22 }, { 0x2E, 22 }, { 0x2D, 22 }, { 0x2C, 22 }, + { 0x2B, 22 }, { 0x2A, 22 }, { 0x29, 22 }, { 0x28, 22 }, + { 0x27, 22 }, { 0x26, 22 }, { 0x25, 22 }, { 0x24, 22 }, + { 0x23, 22 }, { 0x22, 22 }, { 0x21, 22 }, { 0x20, 22 }, + { 0x1F, 22 }, { 0x1E, 22 }, { 0x1D, 22 }, { 0x1C, 22 }, + { 0x1B, 22 }, { 0x1A, 22 }, { 0x19, 22 }, { 0x18, 22 }, + { 0x17, 22 }, { 0x16, 22 }, { 0x15, 22 }, { 0x14, 22 }, + { 0x13, 22 }, { 0x12, 22 }, { 0x11, 22 }, { 0x10, 22 }, + { 0x0F, 22 }, { 0x0E, 22 }, { 0x0D, 22 }, { 0x0C, 22 }, + { 0x0B, 22 }, { 0x0A, 22 }, { 0x09, 22 }, { 0x08, 22 }, + { 0x07, 22 }, { 0x06, 22 }, { 0x05, 22 }, { 0x04, 22 }, + { 0x03, 22 }, { 0x02, 22 }, { 0x01, 22 }, { 0x00, 22 } +}; + +#endif /* AVCODEC_SVQ1_VLC_H */ diff --git a/include/libavcodec/svq1enc_cb.h b/include/libavcodec/svq1enc_cb.h new file mode 100644 index 0000000..1edb4ec --- /dev/null +++ b/include/libavcodec/svq1enc_cb.h @@ -0,0 +1,86 @@ +/* + * SVQ1 Encoder + * Copyright (C) 2004 Mike Melanson + * + * 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 + */ + +/** + * @file + * svq1 code books. + */ + +#ifndef AVCODEC_SVQ1ENC_CB_H +#define AVCODEC_SVQ1ENC_CB_H + +#include + +static const int8_t svq1_inter_codebook_sum[4][16*6] = { + { -1, 1, -2, 0, 1, -1, -1, -1, -2, -1, 1, -1, -1, 0, -1, -1, + 0, -1, -1, -1, -1, 0, -1, 0, 0, 0, -3, 1, -1, 0, 1, -1, + 1, -1, 2, 2, 1, 1, 2, 0, 0, 0, -1, 1, 1, 0, 0, 0, + 1, -1, 0, 1, -1, 1, 1, 0, 1, 0, -1, 1, 1, 0, 0, 0, + -2, 0, 0, -2, 0, 0, -2, 0, -2, -1, -2, -1, 0, 0, -1, 0, + 1, 0, 1, -1, 2, 2, 1, 2, 2, 1, 0, 1, 1, 0, 1, 1, }, + { -2, 1, -1, -1, 1, 0, 1, -1, -1, -1, 1, -1, 0, -1, 0, -1, + 0, 0, 0, -2, 0, 1, 0, -1, -1, 0, 2, -3, 1, -2, 3, -1, + 2, 0, 2, 1, 1, -1, 1, 1, 0, 0, 1, 1, 2, -2, 1, 0, + -2, -1, 2, -2, -2, 0, -3, 0, -1, 0, -1, 0, -1, 0, -2, -3, + 1, -2, -2, -1, 1, -1, -1, 1, -1, 1, 1, 0, -2, 0, 1, 1, + 1, 1, 2, 1, 0, 0, -1, 0, 0, 1, 0, 1, -1, 1, 0, 2, }, + { 0, 0, 0, -3, 1, 1, 1, -3, 0, -1, 0, -3, 1, -3, 0, -2, + 1, 2, -1, -3, 0, -3, 1, -1, 0, -1, 0, 0, 1, 2, 1, 1, + -1, 2, -3, 3, 1, 0, -5, 1, 0, -1, -3, 1, 0, 2, 0, -3, + 4, 2, 0, -2, 1, -2, 3, -2, 1, 1, 0, -1, 2, 5, 3, 1, + -1, 0, 2, -3, -2, 0, 0, -2, 2, -3, -1, -1, 2, 1, 0, -2, + 3, -1, 1, -1, 2, 4, 0, 1, 0, 1, 0, -1, -3, -2, -1, 0, }, + { 0, 2, -1, -1, 2, -4, -2, 3, 0, -1, -5, 1, 0, 1, 0, 6, + -2, 2, 0, 1, 1, -1, -1, -2, 1, -2, -1, 0, 2, -2, -2, -1, + -4, 2, -1, -3, -1, -2, 2, -1, 2, -1, 2, 0, 3, -3, -3, 0, + -3, 0, 0, -2, 4, -4, 0, -1, 4, 0, -2, -2, 3, -2, 0, 4, + 5, 0, 1, 0, -3, 3, 3, 2, 0, 0, 1, 2, -5, -2, -3, 0, + -3, 2, -2, 2, -2, 4, 7, -3, 4, 2, 3, 2, -1, 0, -3, 1, } +}; + +static const int8_t svq1_intra_codebook_sum[4][16*6] = { + { 0, 0, 0, -1, -1, -1, -1, -2, 0, -1, -1, 0, -1, 0, 1, 0, + 1, 0, -1, 1, 0, 0, -1, 1, -1, 0, 0, 0, -1, 1, 0, 0, + -1, 0, 0, 1, -1, 1, 0, -1, -1, 0, 1, 1, 0, 0, -1, 1, + 0, 1, 0, 0, 1, -1, 0, 0, 0, -1, 1, 0, 1, 0, -2, 1, + 0, -1, 1, 0, 0, 0, 1, 0, -1, 0, 0, 0, -1, 0, 0, 0, + 0, 1, 1, 0, 0, -1, 0, 1, 0, 0, 0, 0, -1, 1, 1, -1, }, + { -1, -2, 0, -1, 1, 0, -1, 0, -1, -4, -1, -2, -1, -2, 1, -2, + 0, 0, 4, -2, -1, 1, 1, 0, 2, 1, 1, 0, 2, 0, 0, 0, + 1, 1, 0, -1, -1, -1, 1, 0, -1, -3, -3, 1, -1, 1, -2, -1, + 1, -1, 0, 1, 2, 1, -1, -1, 1, 1, 1, 2, 1, 0, 1, -2, + -2, 0, -1, -2, -2, 0, -1, -1, -1, 0, 1, 0, -1, -1, 0, -1, + 0, 2, 1, 2, 2, 1, -1, 1, 0, 2, 0, -1, 1, 0, 0, 0, }, + { -2, 0, -1, -1, 1, 1, -2, 0, -2, 0, 1, -2, -2, 1, -1, -1, + 3, -2, 0, -3, -4, -3, 2, 1, 0, 3, -2, 2, 3, 2, 2, -1, + -3, 1, 0, 1, 0, 0, 0, 1, -2, 1, -2, -2, -1, -2, -2, 2, + 0, -4, 0, 2, -1, 0, 2, 2, 2, 1, 0, -1, -1, 1, -3, 2, + 2, 1, 0, 3, 1, -1, 1, 3, 1, 0, 1, 1, 2, -1, 1, -1, + -2, -1, 0, -1, 1, -1, 1, -2, -2, -1, -1, -3, 1, -4, -3, 1, }, + { -2, 0, -2, 3, -1, -1, 0, 2, 2, -1, -3, 2, 1, 0, -2, -1, + -3, -2, -2, 1, 2, -3, 0, 1, -5, -2, -3, 0, -2, -1, 2, 0, + -1, -1, 0, -2, 1, 3, -7, -2, -2, -1, 2, -1, 0, 3, 1, 3, + 1, 0, 0, 1, 2, 3, 1, 2, 0, -2, -2, 1, 1, 2, 2, 3, + 4, 1, -1, 2, -2, 4, 0, 0, 0, 4, 2, 0, -2, -2, 2, -4, + -1, 5, -2, -2, -3, 2, -3, -1, 3, -3, 0, 4, 3, 0, 1, -2, } +}; + +#endif /* AVCODEC_SVQ1ENC_CB_H */ diff --git a/include/libavcodec/svq1encdsp.h b/include/libavcodec/svq1encdsp.h new file mode 100644 index 0000000..751b5ee --- /dev/null +++ b/include/libavcodec/svq1encdsp.h @@ -0,0 +1,60 @@ +/* + * SVQ1 encoder DSP + * + * 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_SVQ1ENCDSP_H +#define AVCODEC_SVQ1ENCDSP_H + +#include + +#include "config.h" + +typedef struct SVQ1EncDSPContext { + int (*ssd_int8_vs_int16)(const int8_t *pix1, const int16_t *pix2, + intptr_t size); +} SVQ1EncDSPContext; + +void ff_svq1enc_init_ppc(SVQ1EncDSPContext *c); +void ff_svq1enc_init_riscv(SVQ1EncDSPContext *c); +void ff_svq1enc_init_x86(SVQ1EncDSPContext *c); + +static int ssd_int8_vs_int16_c(const int8_t *pix1, const int16_t *pix2, + intptr_t size) +{ + int score = 0; + + for (intptr_t i = 0; i < size; i++) + score += (pix1[i] - pix2[i]) * (pix1[i] - pix2[i]); + return score; +} + +static inline void ff_svq1enc_init(SVQ1EncDSPContext *c) +{ + c->ssd_int8_vs_int16 = ssd_int8_vs_int16_c; + +#if ARCH_PPC + ff_svq1enc_init_ppc(c); +#elif ARCH_RISCV + ff_svq1enc_init_riscv(c); +#elif ARCH_X86 + ff_svq1enc_init_x86(c); +#endif +} + +#endif /* AVCODEC_SVQ1ENCDSP_H */ diff --git a/include/libavcodec/synth_filter.h b/include/libavcodec/synth_filter.h new file mode 100644 index 0000000..cf6f267 --- /dev/null +++ b/include/libavcodec/synth_filter.h @@ -0,0 +1,53 @@ +/* + * copyright (c) 2008 Michael Niedermayer + * + * 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_SYNTH_FILTER_H +#define AVCODEC_SYNTH_FILTER_H + +#include "libavutil/tx.h" +#include "dcadct.h" + +typedef struct SynthFilterContext { + void (*synth_filter_float)(AVTXContext *imdct, + float *synth_buf_ptr, int *synth_buf_offset, + float synth_buf2[32], const float window[512], + float out[32], float in[32], + float scale, av_tx_fn imdct_fn); + void (*synth_filter_float_64)(AVTXContext *imdct, + float *synth_buf_ptr, int *synth_buf_offset, + float synth_buf2[64], const float window[1024], + float out[64], float in[64], float scale, + av_tx_fn imdct_fn); + void (*synth_filter_fixed)(DCADCTContext *imdct, + int32_t *synth_buf_ptr, int *synth_buf_offset, + int32_t synth_buf2[32], const int32_t window[512], + int32_t out[32], const int32_t in[32]); + void (*synth_filter_fixed_64)(DCADCTContext *imdct, + int32_t *synth_buf_ptr, int *synth_buf_offset, + int32_t synth_buf2[64], const int32_t window[1024], + int32_t out[64], const int32_t in[64]); +} SynthFilterContext; + +void ff_synth_filter_init(SynthFilterContext *c); +void ff_synth_filter_init_aarch64(SynthFilterContext *c); +void ff_synth_filter_init_arm(SynthFilterContext *c); +void ff_synth_filter_init_x86(SynthFilterContext *c); + +#endif /* AVCODEC_SYNTH_FILTER_H */ diff --git a/include/libavcodec/tableprint.h b/include/libavcodec/tableprint.h new file mode 100644 index 0000000..6f61c71 --- /dev/null +++ b/include/libavcodec/tableprint.h @@ -0,0 +1,134 @@ +/* + * Generate a file for hardcoded tables + * + * Copyright (c) 2009 Reimar Döffinger + * + * 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_TABLEPRINT_H +#define AVCODEC_TABLEPRINT_H + +#include +#include + +#include "libavutil/common.h" + +#define WRITE_1D_FUNC_ARGV(type, linebrk, fmtstr, ...)\ +void write_##type##_array(const type *data, int len)\ +{\ + int i;\ + printf(" ");\ + for (i = 0; i < len - 1; i++) {\ + printf(" "fmtstr",", __VA_ARGS__);\ + if ((i & linebrk) == linebrk) printf("\n ");\ + }\ + printf(" "fmtstr"\n", __VA_ARGS__);\ +} + +#define WRITE_1D_FUNC(type, fmtstr, linebrk)\ + WRITE_1D_FUNC_ARGV(type, linebrk, fmtstr, data[i]) + +#define WRITE_2D_FUNC(type)\ +void write_##type##_2d_array(const void *arg, int len, int len2)\ +{\ + const type *data = arg;\ + int i;\ + printf(" {\n");\ + for (i = 0; i < len; i++) {\ + write_##type##_array(data + i * len2, len2);\ + printf(i == len - 1 ? " }\n" : " }, {\n");\ + }\ +} + +/** + * @name Predefined functions for printing tables + * + * @{ + */ +void write_int8_t_array (const int8_t *, int); +void write_uint8_t_array (const uint8_t *, int); +void write_uint16_t_array (const uint16_t *, int); +void write_uint32_t_array (const uint32_t *, int); +void write_int32_t_array (const int32_t *, int); +void write_float_array (const float *, int); +void write_int8_t_2d_array (const void *, int, int); +void write_uint8_t_2d_array (const void *, int, int); +void write_uint32_t_2d_array(const void *, int, int); +void write_float_2d_array (const void *, int, int); +/** @} */ // end of printfuncs group + +/* + * MSVC doesn't have %zu, since it was introduced in C99, + * but has its own %Iu for printing size_t values. + */ +#if defined(_MSC_VER) +#define FMT "Iu" +#else +#define FMT "zu" +#endif + +#define WRITE_ARRAY_ALIGNED(prefix, align, type, name) \ + do { \ + const size_t array_size = FF_ARRAY_ELEMS(name); \ + printf(prefix" DECLARE_ALIGNED("#align", " \ + #type", "#name")[%"FMT"] = {\n", \ + array_size); \ + write_##type##_array(name, array_size); \ + printf("};\n"); \ + } while(0) + +#define WRITE_ARRAY(prefix, type, name) \ + do { \ + const size_t array_size = FF_ARRAY_ELEMS(name); \ + printf(prefix" "#type" "#name"[%"FMT"] = {\n", \ + array_size); \ + write_##type##_array(name, array_size); \ + printf("};\n"); \ + } while(0) + +#define WRITE_2D_ARRAY(prefix, type, name) \ + do { \ + const size_t array_size1 = FF_ARRAY_ELEMS(name); \ + const size_t array_size2 = FF_ARRAY_ELEMS(name[0]); \ + printf(prefix" "#type" "#name"[%"FMT"][%"FMT"] = {\n", \ + array_size1, array_size2 ); \ + write_##type##_2d_array(name, array_size1, array_size2); \ + printf("};\n"); \ + } while(0) + + +WRITE_1D_FUNC(int8_t, "%3"PRIi8, 15) +WRITE_1D_FUNC(uint8_t, "0x%02"PRIx8, 15) +WRITE_1D_FUNC(uint16_t, "0x%08"PRIx16, 7) +WRITE_1D_FUNC(int16_t, "%5"PRIi16, 7) +WRITE_1D_FUNC(uint32_t, "0x%08"PRIx32, 7) +WRITE_1D_FUNC(int32_t, "0x%08"PRIx32, 7) +WRITE_1D_FUNC(float, "%.18e", 3) + +WRITE_2D_FUNC(int8_t) +WRITE_2D_FUNC(uint8_t) +WRITE_2D_FUNC(uint32_t) +WRITE_2D_FUNC(float) + +static inline void write_fileheader(void) +{ + printf("/* This file was automatically generated. */\n"); + printf("#include \n"); +} + +#endif /* AVCODEC_TABLEPRINT_H */ diff --git a/include/libavcodec/tableprint_vlc.h b/include/libavcodec/tableprint_vlc.h new file mode 100644 index 0000000..b97c1f9 --- /dev/null +++ b/include/libavcodec/tableprint_vlc.h @@ -0,0 +1,79 @@ +/* + * Helpers for generating hard-coded VLC tables + * + * Copyright (c) 2014 Reimar Döffinger + * + * 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_TABLEPRINT_VLC_H +#define AVCODEC_TABLEPRINT_VLC_H + +#define AVUTIL_LOG_H +#define av_log(a, ...) while(0) +#define ff_dlog(a, ...) while(0) +#define AVUTIL_MEM_H +#define av_malloc(s) NULL +#define av_malloc_array(a, b) NULL +#define av_realloc_f(p, o, n) NULL +#define av_free(p) while(0) +#define av_freep(p) while(0) +#define AVUTIL_INTERNAL_H +#define avpriv_request_sample(...) +#include "tableprint.h" +#include "vlc.h" +#include "libavutil/reverse.c" +#include "vlc.c" + +// The following will have to be modified if VLCBaseType changes. +WRITE_1D_FUNC_ARGV(VLCElem, 3, "{ .sym =%5" PRId16 ", .len =%2"PRIi16 " }", + data[i].sym, data[i].len) + +static void write_vlc_type(const VLC *vlc, const VLCElem *base_table, const char *base_table_name) +{ + printf(" .bits = %i,\n", vlc->bits); + // Unfortunately need to cast away const currently + printf(" .table = (VLCElem *)(%s + 0x%x),\n", base_table_name, (int)(vlc->table - base_table)); + printf(" .table_size = 0x%x,\n", vlc->table_size); + printf(" .table_allocated = 0x%x,\n", vlc->table_allocated); +} + +#define WRITE_VLC_TABLE(prefix, name) \ + WRITE_ARRAY(prefix, VLCElem, name) + +#define WRITE_VLC_TYPE(prefix, name, base_table) \ + do { \ + printf(prefix" VLC "#name" = {\n"); \ + write_vlc_type(&name, base_table, #base_table); \ + printf("};\n"); \ + } while(0) + +#define WRITE_VLC_ARRAY(prefix, name, base_table) \ + do { \ + int i; \ + const size_t array_size = FF_ARRAY_ELEMS(name); \ + printf(prefix" VLC "#name"[%"FMT"] = {{\n", \ + array_size); \ + for (i = 0; i < array_size; i++) { \ + write_vlc_type(name + i, \ + base_table, #base_table); \ + if (i != array_size - 1) printf("}, {\n"); \ + } \ + printf("}};\n"); \ + } while(0) + +#endif /* AVCODEC_TABLEPRINT_VLC_H */ diff --git a/include/libavcodec/tak.h b/include/libavcodec/tak.h new file mode 100644 index 0000000..1d1ee64 --- /dev/null +++ b/include/libavcodec/tak.h @@ -0,0 +1,162 @@ +/* + * TAK decoder/demuxer common code + * Copyright (c) 2012 Paul B Mahol + * + * 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 + */ + +/** + * @file + * TAK (Tom's lossless Audio Kompressor) decoder/demuxer common functions + */ + +#ifndef AVCODEC_TAK_H +#define AVCODEC_TAK_H + +#include + +#include "get_bits.h" + +#define TAK_FORMAT_DATA_TYPE_BITS 3 +#define TAK_FORMAT_SAMPLE_RATE_BITS 18 +#define TAK_FORMAT_BPS_BITS 5 +#define TAK_FORMAT_CHANNEL_BITS 4 +#define TAK_FORMAT_VALID_BITS 5 +#define TAK_FORMAT_CH_LAYOUT_BITS 6 +#define TAK_SIZE_FRAME_DURATION_BITS 4 +#define TAK_SIZE_SAMPLES_NUM_BITS 35 +#define TAK_LAST_FRAME_POS_BITS 40 +#define TAK_LAST_FRAME_SIZE_BITS 24 +#define TAK_ENCODER_CODEC_BITS 6 +#define TAK_ENCODER_PROFILE_BITS 4 +#define TAK_SAMPLE_RATE_MIN 6000 +#define TAK_CHANNELS_MIN 1 +#define TAK_BPS_MIN 8 +#define TAK_FRAME_HEADER_FLAGS_BITS 3 +#define TAK_FRAME_HEADER_SYNC_ID 0xA0FF +#define TAK_FRAME_HEADER_SYNC_ID_BITS 16 +#define TAK_FRAME_HEADER_SAMPLE_COUNT_BITS 14 +#define TAK_FRAME_HEADER_NO_BITS 21 +#define TAK_FRAME_DURATION_QUANT_SHIFT 5 +#define TAK_CRC24_BITS 24 + + +#define TAK_FRAME_FLAG_IS_LAST 0x1 +#define TAK_FRAME_FLAG_HAS_INFO 0x2 +#define TAK_FRAME_FLAG_HAS_METADATA 0x4 + +#define TAK_MAX_CHANNELS (1 << TAK_FORMAT_CHANNEL_BITS) + +#define TAK_MIN_FRAME_HEADER_BITS (TAK_FRAME_HEADER_SYNC_ID_BITS + \ + TAK_FRAME_HEADER_FLAGS_BITS + \ + TAK_FRAME_HEADER_NO_BITS + \ + TAK_CRC24_BITS) + +#define TAK_MIN_FRAME_HEADER_LAST_BITS (TAK_MIN_FRAME_HEADER_BITS + 2 + \ + TAK_FRAME_HEADER_SAMPLE_COUNT_BITS) + +#define TAK_ENCODER_BITS (TAK_ENCODER_CODEC_BITS + \ + TAK_ENCODER_PROFILE_BITS) + +#define TAK_SIZE_BITS (TAK_SIZE_SAMPLES_NUM_BITS + \ + TAK_SIZE_FRAME_DURATION_BITS) + +#define TAK_FORMAT_BITS (TAK_FORMAT_DATA_TYPE_BITS + \ + TAK_FORMAT_SAMPLE_RATE_BITS + \ + TAK_FORMAT_BPS_BITS + \ + TAK_FORMAT_CHANNEL_BITS + 1 + \ + TAK_FORMAT_VALID_BITS + 1 + \ + TAK_FORMAT_CH_LAYOUT_BITS * \ + TAK_MAX_CHANNELS) + +#define TAK_STREAMINFO_BITS (TAK_ENCODER_BITS + \ + TAK_SIZE_BITS + \ + TAK_FORMAT_BITS) + +#define TAK_MAX_FRAME_HEADER_BITS (TAK_MIN_FRAME_HEADER_LAST_BITS + \ + TAK_STREAMINFO_BITS + 31) + +#define TAK_STREAMINFO_BYTES ((TAK_STREAMINFO_BITS + 7) / 8) +#define TAK_MAX_FRAME_HEADER_BYTES ((TAK_MAX_FRAME_HEADER_BITS + 7) / 8) +#define TAK_MIN_FRAME_HEADER_BYTES ((TAK_MIN_FRAME_HEADER_BITS + 7) / 8) + +enum TAKCodecType { + TAK_CODEC_MONO_STEREO = 2, + TAK_CODEC_MULTICHANNEL = 4, +}; + +enum TAKMetaDataType { + TAK_METADATA_END = 0, + TAK_METADATA_STREAMINFO, + TAK_METADATA_SEEKTABLE, + TAK_METADATA_SIMPLE_WAVE_DATA, + TAK_METADATA_ENCODER, + TAK_METADATA_PADDING, + TAK_METADATA_MD5, + TAK_METADATA_LAST_FRAME, +}; + +enum TAKFrameSizeType { + TAK_FST_94ms = 0, + TAK_FST_125ms, + TAK_FST_188ms, + TAK_FST_250ms, + TAK_FST_4096, + TAK_FST_8192, + TAK_FST_16384, + TAK_FST_512, + TAK_FST_1024, + TAK_FST_2048, +}; + +typedef struct TAKStreamInfo { + int flags; + enum TAKCodecType codec; + int data_type; + int sample_rate; + int channels; + int bps; + int frame_num; + int frame_samples; + int last_frame_samples; + uint64_t ch_layout; + int64_t samples; +} TAKStreamInfo; + +int ff_tak_check_crc(const uint8_t *buf, unsigned int buf_size); + +/** + * Parse the Streaminfo metadata block. + * @param[out] s storage for parsed information + * @param[in] buf input buffer + * @param[in] size size of input buffer in bytes + * @return non-zero on error, 0 if OK + */ +int avpriv_tak_parse_streaminfo(TAKStreamInfo *s, const uint8_t *buf, int size); + +/** + * Validate and decode a frame header. + * @param logctx for use as av_log() context + * @param[in] gb GetBitContext from which to read frame header + * @param[out] s frame information + * @param log_level_offset log level offset, can be used to silence + * error messages. + * @return non-zero on error, 0 if OK + */ +int ff_tak_decode_frame_header(void *logctx, GetBitContext *gb, + TAKStreamInfo *s, int log_level_offset); +#endif /* AVCODEC_TAK_H */ diff --git a/include/libavcodec/takdsp.h b/include/libavcodec/takdsp.h new file mode 100644 index 0000000..13b5e53 --- /dev/null +++ b/include/libavcodec/takdsp.h @@ -0,0 +1,35 @@ +/* + * 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_TAKDSP_H +#define AVCODEC_TAKDSP_H + +#include + +typedef struct TAKDSPContext { + void (*decorrelate_ls)(const int32_t *p1, int32_t *p2, int length); + void (*decorrelate_sr)(int32_t *p1, const int32_t *p2, int length); + void (*decorrelate_sm)(int32_t *p1, int32_t *p2, int length); + void (*decorrelate_sf)(int32_t *p1, const int32_t *p2, int length, int dshift, int dfactor); +} TAKDSPContext; + +void ff_takdsp_init(TAKDSPContext *c); +void ff_takdsp_init_riscv(TAKDSPContext *c); +void ff_takdsp_init_x86(TAKDSPContext *c); + +#endif /* AVCODEC_TAKDSP_H */ diff --git a/include/libavcodec/targa.h b/include/libavcodec/targa.h new file mode 100644 index 0000000..c2f5224 --- /dev/null +++ b/include/libavcodec/targa.h @@ -0,0 +1,48 @@ +/* + * 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_TARGA_H +#define AVCODEC_TARGA_H + +/** + * @file + * targa file common definitions + * + * Based on: + * http://www.gamers.org/dEngine/quake3/TGA.txt + * + * and other specs you can find referenced for example in: + * http://en.wikipedia.org/wiki/Truevision_TGA + */ + +enum TargaCompr { + TGA_NODATA = 0, // no image data + TGA_PAL = 1, // palettized + TGA_RGB = 2, // true-color + TGA_BW = 3, // black & white or grayscale + TGA_RLE = 8, // flag pointing that data is RLE-coded +}; + +enum TargaFlags { + TGA_RIGHTTOLEFT = 0x10, // right-to-left (flipped horizontally) + TGA_TOPTOBOTTOM = 0x20, // top-to-bottom (NOT flipped vertically) + TGA_INTERLEAVE2 = 0x40, // 2-way interleave, odd then even lines + TGA_INTERLEAVE4 = 0x80, // 4-way interleave +}; + +#endif /* AVCODEC_TARGA_H */ diff --git a/include/libavcodec/texturedsp.h b/include/libavcodec/texturedsp.h new file mode 100644 index 0000000..0bf49e8 --- /dev/null +++ b/include/libavcodec/texturedsp.h @@ -0,0 +1,97 @@ +/* + * Texture block module + * Copyright (C) 2015 Vittorio Giovara + * + * 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 + */ + +/** + * @file + * Texture block (4x4) module + * + * References: + * https://www.opengl.org/wiki/S3_Texture_Compression + * https://www.opengl.org/wiki/Red_Green_Texture_Compression + * https://msdn.microsoft.com/en-us/library/bb694531%28v=vs.85%29.aspx + * + * All functions return how much data has been written or read. + * + * Pixel input or output format is always AV_PIX_FMT_RGBA. + */ + +#ifndef AVCODEC_TEXTUREDSP_H +#define AVCODEC_TEXTUREDSP_H + +#include +#include + +#define TEXTURE_BLOCK_W 4 +#define TEXTURE_BLOCK_H 4 + +typedef struct TextureDSPContext { + int (*dxt1_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block); + int (*dxt1a_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block); + int (*dxt2_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block); + int (*dxt3_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block); + int (*dxt4_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block); + int (*dxt5_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block); + int (*dxt5y_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block); + int (*dxt5ys_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block); + int (*rgtc1s_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block); + int (*rgtc1u_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block); + int (*rgtc1u_gray_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block); + int (*rgtc1u_alpha_block)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block); + int (*rgtc2s_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block); + int (*rgtc2u_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block); + int (*dxn3dc_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block); +} TextureDSPContext; + +typedef struct TextureDSPEncContext { + int (*dxt1_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block); + int (*dxt5_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block); + int (*dxt5ys_block) (uint8_t *dst, ptrdiff_t stride, const uint8_t *block); +} TextureDSPEncContext; + +typedef struct TextureDSPThreadContext { + union { + const uint8_t *in; // Input frame data + uint8_t *out; // Output frame data + } frame_data; + ptrdiff_t stride; // Frame linesize + int width, height; // Frame width / height + union { + const uint8_t *in; // Compressed texture for decompression + uint8_t *out; // Compressed texture of compression + } tex_data; + int tex_ratio; // Number of compressed bytes in a texture block + int raw_ratio; // Number bytes in a line of a raw block + int slice_count; // Number of slices for threaded operations + + /* Pointer to the selected compress or decompress function. */ + int (*tex_funct)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block); +} TextureDSPThreadContext; + +void ff_texturedsp_init(TextureDSPContext *c); +void ff_texturedspenc_init(TextureDSPEncContext *c); + +struct AVCodecContext; +int ff_texturedsp_exec_decompress_threads(struct AVCodecContext *avctx, + TextureDSPThreadContext *ctx); +int ff_texturedsp_exec_compress_threads(struct AVCodecContext *avctx, + TextureDSPThreadContext *ctx); + +#endif /* AVCODEC_TEXTUREDSP_H */ diff --git a/include/libavcodec/thread.h b/include/libavcodec/thread.h new file mode 100644 index 0000000..7df5839 --- /dev/null +++ b/include/libavcodec/thread.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2008 Alexander Strange + * + * 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 + */ + +/** + * @file + * Multithreading API for decoders + * @author Alexander Strange + */ + +#ifndef AVCODEC_THREAD_H +#define AVCODEC_THREAD_H + +#include "libavutil/buffer.h" + +#include "avcodec.h" + +int ff_thread_can_start_frame(AVCodecContext *avctx); + +/** + * If the codec defines update_thread_context(), call this + * when they are ready for the next thread to start decoding + * the next frame. After calling it, do not change any variables + * read by the update_thread_context() method, or call ff_thread_get_buffer(). + * + * @param avctx The context. + */ +void ff_thread_finish_setup(AVCodecContext *avctx); + +/** + * Wrapper around get_buffer() for frame-multithreaded codecs. + * Call this function instead of ff_get_buffer(f). + * Cannot be called after the codec has called ff_thread_finish_setup(). + * + * @param avctx The current context. + * @param f The frame to write into. + */ +int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f, int flags); + +int ff_slice_thread_execute_with_mainfunc(AVCodecContext *avctx, + int (*action_func2)(AVCodecContext *c, void *arg, int jobnr, int threadnr), + int (*main_func)(AVCodecContext *c), void *arg, int *ret, int job_count); + +enum ThreadingStatus { + FF_THREAD_IS_COPY, + FF_THREAD_IS_FIRST_THREAD, + FF_THREAD_NO_FRAME_THREADING, +}; + +/** + * Allows to synchronize objects whose lifetime is the whole decoding + * process among all frame threads. + * + * When called from a non-copy thread, do nothing. + * When called from another thread, place a new RefStruct reference + * at the given offset in the calling thread's private data from + * the RefStruct reference in the private data of the first decoding thread. + * The first thread must have a valid RefStruct reference at the given + * offset in its private data; the calling thread must not have + * a reference at this offset in its private data (must be NULL). + * + * @param avctx an AVCodecContext + * @param offset offset of the RefStruct reference in avctx's private data + * + * @retval FF_THREAD_IS_COPY if frame-threading is in use and the + * calling thread is a copy; in this case, the RefStruct reference + * will be set. + * @retval FF_THREAD_IS_MAIN_THREAD if frame-threading is in use + * and the calling thread is the main thread. + * @retval FF_THREAD_NO_FRAME_THREADING if frame-threading is not in use. + */ +enum ThreadingStatus ff_thread_sync_ref(AVCodecContext *avctx, size_t offset); + +#endif /* AVCODEC_THREAD_H */ diff --git a/include/libavcodec/threadframe.h b/include/libavcodec/threadframe.h new file mode 100644 index 0000000..d5954ad --- /dev/null +++ b/include/libavcodec/threadframe.h @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2022 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_THREADFRAME_H +#define AVCODEC_THREADFRAME_H + +#include "libavutil/frame.h" +#include "avcodec.h" + +typedef struct ThreadFrame { + AVFrame *f; + AVCodecContext *owner[2]; + struct ThreadFrameProgress *progress; +} ThreadFrame; + +/** + * Notify later decoding threads when part of their reference picture is ready. + * Call this when some part of the picture is finished decoding. + * Later calls with lower values of progress have no effect. + * + * @param f The picture being decoded. + * @param progress Value, in arbitrary units, of how much of the picture has decoded. + * @param field The field being decoded, for field-picture codecs. + * 0 for top field or frame pictures, 1 for bottom field. + */ +void ff_thread_report_progress(ThreadFrame *f, int progress, int field); + +/** + * Wait for earlier decoding threads to finish reference pictures. + * Call this before accessing some part of a picture, with a given + * value for progress, and it will return after the responsible decoding + * thread calls ff_thread_report_progress() with the same or + * higher value for progress. + * + * @param f The picture being referenced. + * @param progress Value, in arbitrary units, to wait for. + * @param field The field being referenced, for field-picture codecs. + * 0 for top field or frame pictures, 1 for bottom field. + */ +void ff_thread_await_progress(const ThreadFrame *f, int progress, int field); + +/** + * Wrapper around ff_get_buffer() for frame-multithreaded codecs. + * Call this function instead of ff_get_buffer() if you might need + * to wait for progress on this frame. + * Cannot be called after the codec has called ff_thread_finish_setup(). + * + * @param avctx The current context. + * @param f The frame to write into. + * @note: It is fine to call this with codecs that do not support + * frame threading. + */ +int ff_thread_get_ext_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags); + +/** + * Unref a ThreadFrame. + * + * This is basically a wrapper around av_frame_unref() and should + * be called instead of it. + * + * @param avctx The current context. + * @param f The picture being released. + */ +void ff_thread_release_ext_buffer(ThreadFrame *f); + +int ff_thread_ref_frame(ThreadFrame *dst, const ThreadFrame *src); + +int ff_thread_replace_frame(ThreadFrame *dst, const ThreadFrame *src); + +#endif diff --git a/include/libavcodec/threadprogress.h b/include/libavcodec/threadprogress.h new file mode 100644 index 0000000..cc3414c --- /dev/null +++ b/include/libavcodec/threadprogress.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2022 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_THREADPROGRESS_H +#define AVCODEC_THREADPROGRESS_H + +/** + * ThreadProgress is an API to easily notify other threads about progress + * of any kind as long as it can be packaged into an int and is consistent + * with the natural ordering of integers. + * + * Each initialized ThreadProgress can be in one of two modes: No-op mode + * or ordinary mode. In the former mode, ff_thread_report_progress() and + * ff_thread_await_progress() are no-ops to simply support usecases like + * non-frame-threading. Only in the latter case perform these functions + * what their name already implies. + */ + +#include +#include +#include "libavutil/thread.h" + +/** + * This struct should be treated as opaque by users. + */ +typedef struct ThreadProgress { + atomic_int progress; + unsigned init; + AVMutex progress_mutex; + AVCond progress_cond; +} ThreadProgress; + +/** + * Initialize a ThreadProgress. + * + * @param init_mode If zero, the ThreadProgress will be initialized + * to be in no-op mode as described above. Otherwise + * it is initialized to be in ordinary mode. + */ +int ff_thread_progress_init(ThreadProgress *pro, int init_mode); + +/** + * Destroy a ThreadProgress. Can be called on a ThreadProgress that + * has never been initialized provided that the ThreadProgress struct + * has been initially zeroed. Must be called even if ff_thread_progress_init() + * failed. + */ +void ff_thread_progress_destroy(ThreadProgress *pro); + +/** + * Reset the ::ThreadProgress.progress counter; must only be called + * if the ThreadProgress is not in use in any way (e.g. no thread + * may wait on it via ff_thread_progress_await()). + */ +static inline void ff_thread_progress_reset(ThreadProgress *pro) +{ + atomic_init(&pro->progress, pro->init ? -1 : INT_MAX); +} + +/** + * This function is a no-op in no-op mode; otherwise it notifies + * other threads that a certain level of progress has been reached. + * Later calls with lower values of progress have no effect. + */ +void ff_thread_progress_report(ThreadProgress *pro, int progress); + +/** + * This function is a no-op in no-op mode; otherwise it waits + * until other threads have reached a certain level of progress: + * This function will return after another thread has called + * ff_thread_progress_report() with the same or higher value for progress. + */ +void ff_thread_progress_await(const ThreadProgress *pro, int progress); + +#endif /* AVCODEC_THREADPROGRESS_H */ diff --git a/include/libavcodec/tiff.h b/include/libavcodec/tiff.h new file mode 100644 index 0000000..12afcfa --- /dev/null +++ b/include/libavcodec/tiff.h @@ -0,0 +1,225 @@ +/* + * Copyright (c) 2006 Konstantin Shishkov + * + * 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 + */ + +/** + * @file + * TIFF constants & data structures + * + * For more information about the TIFF format, check the official docs at: + * http://partners.adobe.com/public/developer/tiff/index.html + * @author Konstantin Shishkov + */ + +#ifndef AVCODEC_TIFF_H +#define AVCODEC_TIFF_H + +/** TIFF types in ascenting priority (last in the list is highest) */ +enum TiffType { + /** TIFF image based on the TIFF 6.0 or TIFF/EP (ISO 12234-2) specifications */ + TIFF_TYPE_TIFF, + /** Digital Negative (DNG) image */ + TIFF_TYPE_DNG, + /** Digital Negative (DNG) image part of an CinemaDNG image sequence */ + TIFF_TYPE_CINEMADNG, +}; + +/** abridged list of TIFF and TIFF/EP tags */ +enum TiffTags { + TIFF_SUBFILE = 0xfe, + TIFF_WIDTH = 0x100, + TIFF_HEIGHT, + TIFF_BPP, + TIFF_COMPR, + TIFF_PHOTOMETRIC = 0x106, + TIFF_FILL_ORDER = 0x10A, + TIFF_DOCUMENT_NAME = 0x10D, + TIFF_IMAGE_DESCRIPTION = 0x10E, + TIFF_MAKE = 0x10F, + TIFF_MODEL = 0x110, + TIFF_STRIP_OFFS = 0x111, + TIFF_SAMPLES_PER_PIXEL = 0x115, + TIFF_ROWSPERSTRIP = 0x116, + TIFF_STRIP_SIZE, + TIFF_XRES = 0x11A, + TIFF_YRES = 0x11B, + TIFF_PLANAR = 0x11C, + TIFF_PAGE_NAME = 0x11D, + TIFF_XPOS = 0x11E, + TIFF_YPOS = 0x11F, + TIFF_GRAY_RESPONSE_CURVE= 0x123, + TIFF_T4OPTIONS = 0x124, + TIFF_T6OPTIONS, + TIFF_RES_UNIT = 0x128, + TIFF_PAGE_NUMBER = 0x129, + TIFF_SOFTWARE_NAME = 0x131, + TIFF_DATE = 0x132, + TIFF_ARTIST = 0x13B, + TIFF_HOST_COMPUTER = 0x13C, + TIFF_PREDICTOR = 0x13D, + TIFF_PAL = 0x140, + TIFF_TILE_WIDTH = 0x142, + TIFF_TILE_LENGTH = 0x143, + TIFF_TILE_OFFSETS = 0x144, + TIFF_TILE_BYTE_COUNTS = 0x145, + TIFF_SUB_IFDS = 0x14A, + TIFF_EXTRASAMPLES = 0x152, + TIFF_YCBCR_COEFFICIENTS = 0x211, + TIFF_YCBCR_SUBSAMPLING = 0x212, + TIFF_YCBCR_POSITIONING = 0x213, + TIFF_REFERENCE_BW = 0x214, + TIFF_CFA_PATTERN_DIM = 0x828D, + TIFF_CFA_PATTERN = 0x828E, + TIFF_COPYRIGHT = 0x8298, + TIFF_MODEL_TIEPOINT = 0x8482, + TIFF_MODEL_PIXEL_SCALE = 0x830E, + TIFF_MODEL_TRANSFORMATION= 0x8480, + TIFF_ICC_PROFILE = 0x8773, + TIFF_GEO_KEY_DIRECTORY = 0x87AF, + TIFF_GEO_DOUBLE_PARAMS = 0x87B0, + TIFF_GEO_ASCII_PARAMS = 0x87B1, +}; + +/** abridged list of DNG tags */ +enum DngTags { + DNG_VERSION = 0xC612, + DNG_BACKWARD_VERSION = 0xC613, + DNG_LINEARIZATION_TABLE = 0xC618, + DNG_BLACK_LEVEL = 0xC61A, + DNG_WHITE_LEVEL = 0xC61D, + DNG_COLOR_MATRIX1 = 0xC621, + DNG_COLOR_MATRIX2 = 0xC622, + DNG_CAMERA_CALIBRATION1 = 0xC623, + DNG_CAMERA_CALIBRATION2 = 0xC624, + DNG_ANALOG_BALANCE = 0xC627, + DNG_AS_SHOT_NEUTRAL = 0xC628, + DNG_AS_SHOT_WHITE_XY = 0xC629, +}; + +/** list of CinemaDNG tags */ +enum CinemaDngTags { + CINEMADNG_TIME_CODES = 0xC763, + CINEMADNG_FRAME_RATE = 0xC764, + CINEMADNG_T_STOP = 0xC772, + CINEMADNG_REEL_NAME = 0xC789, + CINEMADNG_CAMERA_LABEL = 0xC7A1, +}; + +/** list of TIFF, TIFF/EP and DNG compression types */ +enum TiffCompr { + TIFF_RAW = 1, + TIFF_CCITT_RLE, + TIFF_G3, + TIFF_G4, + TIFF_LZW, + TIFF_JPEG, + TIFF_NEWJPEG, + TIFF_ADOBE_DEFLATE, + TIFF_PACKBITS = 0x8005, + TIFF_DEFLATE = 0x80B2, + TIFF_LZMA = 0x886D, +}; + +enum TiffGeoTagKey { + TIFF_GT_MODEL_TYPE_GEOKEY = 1024, + TIFF_GT_RASTER_TYPE_GEOKEY = 1025, + TIFF_GT_CITATION_GEOKEY = 1026, + TIFF_GEOGRAPHIC_TYPE_GEOKEY = 2048, + TIFF_GEOG_CITATION_GEOKEY = 2049, + TIFF_GEOG_GEODETIC_DATUM_GEOKEY = 2050, + TIFF_GEOG_PRIME_MERIDIAN_GEOKEY = 2051, + TIFF_GEOG_LINEAR_UNITS_GEOKEY = 2052, + TIFF_GEOG_LINEAR_UNIT_SIZE_GEOKEY = 2053, + TIFF_GEOG_ANGULAR_UNITS_GEOKEY = 2054, + TIFF_GEOG_ANGULAR_UNIT_SIZE_GEOKEY = 2055, + TIFF_GEOG_ELLIPSOID_GEOKEY = 2056, + TIFF_GEOG_SEMI_MAJOR_AXIS_GEOKEY = 2057, + TIFF_GEOG_SEMI_MINOR_AXIS_GEOKEY = 2058, + TIFF_GEOG_INV_FLATTENING_GEOKEY = 2059, + TIFF_GEOG_AZIMUTH_UNITS_GEOKEY = 2060, + TIFF_GEOG_PRIME_MERIDIAN_LONG_GEOKEY = 2061, + TIFF_PROJECTED_CS_TYPE_GEOKEY = 3072, + TIFF_PCS_CITATION_GEOKEY = 3073, + TIFF_PROJECTION_GEOKEY = 3074, + TIFF_PROJ_COORD_TRANS_GEOKEY = 3075, + TIFF_PROJ_LINEAR_UNITS_GEOKEY = 3076, + TIFF_PROJ_LINEAR_UNIT_SIZE_GEOKEY = 3077, + TIFF_PROJ_STD_PARALLEL1_GEOKEY = 3078, + TIFF_PROJ_STD_PARALLEL2_GEOKEY = 3079, + TIFF_PROJ_NAT_ORIGIN_LONG_GEOKEY = 3080, + TIFF_PROJ_NAT_ORIGIN_LAT_GEOKEY = 3081, + TIFF_PROJ_FALSE_EASTING_GEOKEY = 3082, + TIFF_PROJ_FALSE_NORTHING_GEOKEY = 3083, + TIFF_PROJ_FALSE_ORIGIN_LONG_GEOKEY = 3084, + TIFF_PROJ_FALSE_ORIGIN_LAT_GEOKEY = 3085, + TIFF_PROJ_FALSE_ORIGIN_EASTING_GEOKEY = 3086, + TIFF_PROJ_FALSE_ORIGIN_NORTHING_GEOKEY = 3087, + TIFF_PROJ_CENTER_LONG_GEOKEY = 3088, + TIFF_PROJ_CENTER_LAT_GEOKEY = 3089, + TIFF_PROJ_CENTER_EASTING_GEOKEY = 3090, + TIFF_PROJ_CENTER_NORTHING_GEOKEY = 3091, + TIFF_PROJ_SCALE_AT_NAT_ORIGIN_GEOKEY = 3092, + TIFF_PROJ_SCALE_AT_CENTER_GEOKEY = 3093, + TIFF_PROJ_AZIMUTH_ANGLE_GEOKEY = 3094, + TIFF_PROJ_STRAIGHT_VERT_POLE_LONG_GEOKEY = 3095, + TIFF_VERTICAL_CS_TYPE_GEOKEY = 4096, + TIFF_VERTICAL_CITATION_GEOKEY = 4097, + TIFF_VERTICAL_DATUM_GEOKEY = 4098, + TIFF_VERTICAL_UNITS_GEOKEY = 4099 +}; + +/** list of TIFF, TIFF/AP and DNG PhotometricInterpretation (TIFF_PHOTOMETRIC) values */ +enum TiffPhotometric { + TIFF_PHOTOMETRIC_NONE = -1, + TIFF_PHOTOMETRIC_WHITE_IS_ZERO, /* mono or grayscale, 0 is white */ + TIFF_PHOTOMETRIC_BLACK_IS_ZERO, /* mono or grayscale, 0 is black */ + TIFF_PHOTOMETRIC_RGB, /* RGB or RGBA*/ + TIFF_PHOTOMETRIC_PALETTE, /* Uses a palette */ + TIFF_PHOTOMETRIC_ALPHA_MASK, /* Transparency mask */ + TIFF_PHOTOMETRIC_SEPARATED, /* CMYK or some other ink set */ + TIFF_PHOTOMETRIC_YCBCR, /* YCbCr */ + TIFF_PHOTOMETRIC_CIE_LAB = 8, /* 1976 CIE L*a*b* */ + TIFF_PHOTOMETRIC_ICC_LAB, /* ICC L*a*b* */ + TIFF_PHOTOMETRIC_ITU_LAB, /* ITU L*a*b* */ + TIFF_PHOTOMETRIC_CFA = 32803, /* Color Filter Array (TIFF/AP and DNG) */ + TIFF_PHOTOMETRIC_LOG_L = 32844, /* CIE Log2(L) */ + TIFF_PHOTOMETRIC_LOG_LUV, /* CIE Log L*u*v* */ + TIFF_PHOTOMETRIC_LINEAR_RAW = 34892, /* Linear Raw (DNG) */ +}; + +enum TiffGeoTagType { + GEOTIFF_SHORT = 0, + GEOTIFF_DOUBLE = 34736, + GEOTIFF_STRING = 34737 +}; + +typedef struct TiffGeoTag { + enum TiffGeoTagKey key; + enum TiffTags type; + int count; + int offset; + char *val; +} TiffGeoTag; + +typedef struct TiffGeoTagKeyName { + const enum TiffGeoTagKey key; + const char *const name; +} TiffGeoTagKeyName; + +#endif /* AVCODEC_TIFF_H */ diff --git a/include/libavcodec/tiff_common.h b/include/libavcodec/tiff_common.h new file mode 100644 index 0000000..e429b8e --- /dev/null +++ b/include/libavcodec/tiff_common.h @@ -0,0 +1,131 @@ +/* + * TIFF Common Routines + * Copyright (c) 2013 Thilo Borgmann + * + * 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 + */ + +/** + * @file + * TIFF Common Routines + * @author Thilo Borgmann + */ + +#ifndef AVCODEC_TIFF_COMMON_H +#define AVCODEC_TIFF_COMMON_H + +#include +#include "libavutil/dict.h" +#include "bytestream.h" + +/** data type identifiers for TIFF tags */ +enum TiffTypes { + TIFF_BYTE = 1, + TIFF_STRING, + TIFF_SHORT, + TIFF_LONG, + TIFF_RATIONAL, + TIFF_SBYTE, + TIFF_UNDEFINED, + TIFF_SSHORT, + TIFF_SLONG, + TIFF_SRATIONAL, + TIFF_FLOAT, + TIFF_DOUBLE, + TIFF_IFD +}; + +/** sizes of various TIFF field types (string size = 100)*/ +static const uint8_t type_sizes[14] = { + 0, 1, 100, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8, 4 +}; + +static const uint16_t ifd_tags[] = { + 0x8769, // EXIF IFD + 0x8825, // GPS IFD + 0xA005 // Interoperability IFD +}; + + +/** Returns a value > 0 if the tag is a known IFD-tag. + * The return value is the array index + 1 within ifd_tags[]. + */ +int ff_tis_ifd(unsigned tag); + +/** Reads a short from the bytestream using given endianness. */ +unsigned ff_tget_short(GetByteContext *gb, int le); + +/** Reads a long from the bytestream using given endianness. */ +unsigned ff_tget_long(GetByteContext *gb, int le); + +/** Reads a double from the bytestream using given endianness. */ +double ff_tget_double(GetByteContext *gb, int le); + +/** Reads a byte from the bytestream using given endianness. */ +unsigned ff_tget(GetByteContext *gb, int type, int le); + +/** Adds count rationals converted to a string + * into the metadata dictionary. + */ +int ff_tadd_rational_metadata(int count, const char *name, const char *sep, + GetByteContext *gb, int le, AVDictionary **metadata); + +/** Adds count longs converted to a string + * into the metadata dictionary. + */ +int ff_tadd_long_metadata(int count, const char *name, const char *sep, + GetByteContext *gb, int le, AVDictionary **metadata); + +/** Adds count doubles converted to a string + * into the metadata dictionary. + */ +int ff_tadd_doubles_metadata(int count, const char *name, const char *sep, + GetByteContext *gb, int le, AVDictionary **metadata); + +/** Adds count shorts converted to a string + * into the metadata dictionary. + */ +int ff_tadd_shorts_metadata(int count, const char *name, const char *sep, + GetByteContext *gb, int le, int is_signed, AVDictionary **metadata); + +/** Adds count bytes converted to a string + * into the metadata dictionary. + */ +int ff_tadd_bytes_metadata(int count, const char *name, const char *sep, + GetByteContext *gb, int le, int is_signed, AVDictionary **metadata); + +/** Adds a string of count characters + * into the metadata dictionary. + */ +int ff_tadd_string_metadata(int count, const char *name, + GetByteContext *gb, int le, AVDictionary **metadata); + +/** Decodes a TIFF header from the input bytestream + * and sets the endianness in *le and the offset to + * the first IFD in *ifd_offset accordingly. + */ +int ff_tdecode_header(GetByteContext *gb, int *le, int *ifd_offset); + +/** Reads the first 3 fields of a TIFF tag, which are + * the tag id, the tag type and the count of values for that tag. + * Afterwards the bytestream is located at the first value to read and + * *next holds the bytestream offset of the following tag. + */ +int ff_tread_tag(GetByteContext *gb, int le, unsigned *tag, unsigned *type, + unsigned *count, int *next); + +#endif /* AVCODEC_TIFF_COMMON_H */ diff --git a/include/libavcodec/tiff_data.h b/include/libavcodec/tiff_data.h new file mode 100644 index 0000000..1742ccf --- /dev/null +++ b/include/libavcodec/tiff_data.h @@ -0,0 +1,1914 @@ +/* + * TIFF data tables + * Copyright (c) 2011 Thomas Kuehnel + * + * 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 + */ + +/** + * @file + * TIFF data tables + * @author Thomas Kuehnel + * @see GeoTIFF specification at + * http://www.remotesensing.org/geotiff/spec/geotiffhome.html + */ + +#ifndef AVCODEC_TIFF_DATA_H +#define AVCODEC_TIFF_DATA_H + +#include "tiff.h" + +typedef struct TiffGeoTagNameType { + enum TiffGeoTagType type; + unsigned offset; +} TiffGeoTagNameType; + +#define TIFF_CONF_KEY_ID_OFFSET 1024 +#define CONF_NAME_TYPE_MAP(KEY) \ + KEY(GTModelTypeGeoKey, SHORT ) \ + KEY(GTRasterTypeGeoKey, SHORT ) \ + KEY(GTCitationGeoKey, STRING) \ + +#define TIFF_GEOG_KEY_ID_OFFSET 2048 +#define GEOG_NAME_TYPE_MAP(KEY) \ + KEY(GeographicTypeGeoKey, SHORT ) \ + KEY(GeogCitationGeoKey, STRING) \ + KEY(GeogGeodeticDatumGeoKey, SHORT ) \ + KEY(GeogPrimeMeridianGeoKey, SHORT ) \ + KEY(GeogLinearUnitsGeoKey, SHORT ) \ + KEY(GeogLinearUnitSizeGeoKey, DOUBLE) \ + KEY(GeogAngularUnitsGeoKey, SHORT ) \ + KEY(GeogAngularUnitSizeGeoKey, DOUBLE) \ + KEY(GeogEllipsoidGeoKey, SHORT ) \ + KEY(GeogSemiMajorAxisGeoKey, DOUBLE) \ + KEY(GeogSemiMinorAxisGeoKey, DOUBLE) \ + KEY(GeogInvFlatteningGeoKey, DOUBLE) \ + KEY(GeogAzimuthUnitsGeoKey, SHORT ) \ + KEY(GeogPrimeMeridianLongGeoKey, DOUBLE) \ + +#define TIFF_PROJ_KEY_ID_OFFSET 3072 +#define PROJ_NAME_TYPE_MAP(KEY) \ + KEY(ProjectedCSTypeGeoKey, SHORT ) \ + KEY(PCSCitationGeoKey, STRING) \ + KEY(ProjectionGeoKey, SHORT ) \ + KEY(ProjCoordTransGeoKey, SHORT ) \ + KEY(ProjLinearUnitsGeoKey, SHORT ) \ + KEY(ProjLinearUnitSizeGeoKey, DOUBLE) \ + KEY(ProjStdParallel1GeoKey, DOUBLE) \ + KEY(ProjStdParallel2GeoKey, DOUBLE) \ + KEY(ProjNatOriginLongGeoKey, DOUBLE) \ + KEY(ProjNatOriginLatGeoKey, DOUBLE) \ + KEY(ProjFalseEastingGeoKey, DOUBLE) \ + KEY(ProjFalseNorthingGeoKey, DOUBLE) \ + KEY(ProjFalseOriginLongGeoKey, DOUBLE) \ + KEY(ProjFalseOriginLatGeoKey, DOUBLE) \ + KEY(ProjFalseOriginEastingGeoKey, DOUBLE) \ + KEY(ProjFalseOriginNorthingGeoKey, DOUBLE) \ + KEY(ProjCenterLongGeoKey, DOUBLE) \ + KEY(ProjCenterLatGeoKey, DOUBLE) \ + KEY(ProjCenterEastingGeoKey, DOUBLE) \ + KEY(ProjCenterNorthingGeoKey, DOUBLE) \ + KEY(ProjScaleAtNatOriginGeoKey, DOUBLE) \ + KEY(ProjScaleAtCenterGeoKey, DOUBLE) \ + KEY(ProjAzimuthAngleGeoKey, DOUBLE) \ + KEY(ProjStraightVertPoleLongGeoKey, DOUBLE) \ + +#define TIFF_VERT_KEY_ID_OFFSET 4096 +#define VERT_NAME_TYPE_MAP(KEY) \ + KEY(VerticalCSTypeGeoKey, SHORT ) \ + KEY(VerticalCitationGeoKey, STRING) \ + KEY(VerticalDatumGeoKey, SHORT ) \ + KEY(VerticalUnitsGeoKey, SHORT ) \ + +#define ADD_OFFSET(NAME, TYPE) \ + NAME ## _OFFSET, \ + NAME ## _END = NAME ## _OFFSET + sizeof(#NAME) - 1, \ + +#define STRING(NAME, TYPE) #NAME "\0" + +#define ENTRY(NAME, TYPE) { .type = GEOTIFF_ ## TYPE, .offset = NAME ## _OFFSET }, +#define NAME_TYPE_MAP(NAME, name) \ + enum { \ + NAME ## _NAME_TYPE_MAP(ADD_OFFSET) \ + }; \ + static const TiffGeoTagNameType tiff_ ## name ## _name_type_map[] = { \ + NAME ## _NAME_TYPE_MAP(ENTRY) \ + }; \ + static const char *const tiff_ ## name ## _name_type_string = \ + NAME ## _NAME_TYPE_MAP(STRING) + +NAME_TYPE_MAP(CONF, conf); +NAME_TYPE_MAP(GEOG, geog); +NAME_TYPE_MAP(PROJ, proj); +NAME_TYPE_MAP(VERT, vert); + +#define TIFF_GEO_KEY_UNDEFINED 0 +#define TIFF_GEO_KEY_USER_DEFINED 32767 + +#define TIFF_GT_MODEL_TYPE_OFFSET 1 +static const char *const tiff_gt_model_type_codes[] = { + "ModelTypeProjected", + "ModelTypeGeographic", + "ModelTypeGeocentric" +}; + +#define TIFF_GT_RASTER_TYPE_OFFSET 1 +static const char *const tiff_gt_raster_type_codes[] = { + "RasterPixelIsArea", + "RasterPixelIsPoint" +}; + +#define TIFF_LINEAR_UNIT_OFFSET 9001 +static const char *const tiff_linear_unit_codes[] = { + "Linear_Meter", + "Linear_Foot", + "Linear_Foot_US_Survey", + "Linear_Foot_Modified_American", + "Linear_Foot_Clarke", + "Linear_Foot_Indian", + "Linear_Link", + "Linear_Link_Benoit", + "Linear_Link_Sears", + "Linear_Chain_Benoit", + "Linear_Chain_Sears", + "Linear_Yard_Sears", + "Linear_Yard_Indian", + "Linear_Fathom", + "Linear_Mile_International_Nautical" +}; + +#define TIFF_ANGULAR_UNIT_OFFSET 9101 +static const char *const tiff_angular_unit_codes[] = { + "Angular_Radian", + "Angular_Degree", + "Angular_Arc_Minute", + "Angular_Arc_Second", + "Angular_Grad", + "Angular_Gon", + "Angular_DMS", + "Angular_DMS_Hemisphere" +}; + +#define TIFF_GCS_TYPE_OFFSET 4201 +static const char *const tiff_gcs_type_codes[] = { + "GCS_Adindan", + "GCS_AGD66", + "GCS_AGD84", + "GCS_Ain_el_Abd", + "GCS_Afgooye", + "GCS_Agadez", + "GCS_Lisbon", + "GCS_Aratu", + "GCS_Arc_1950", + "GCS_Arc_1960", + "GCS_Batavia", + "GCS_Barbados", + "GCS_Beduaram", + "GCS_Beijing_1954", + "GCS_Belge_1950", + "GCS_Bermuda_1957", + "GCS_Bern_1898", + "GCS_Bogota", + "GCS_Bukit_Rimpah", + "GCS_Camacupa", + "GCS_Campo_Inchauspe", + "GCS_Cape", + "GCS_Carthage", + "GCS_Chua", + "GCS_Corrego_Alegre", + "GCS_Cote_d_Ivoire", + "GCS_Deir_ez_Zor", + "GCS_Douala", + "GCS_Egypt_1907", + "GCS_ED50", + "GCS_ED87", + "GCS_Fahud", + "GCS_Gandajika_1970", + "GCS_Garoua", + "GCS_Guyane_Francaise", + "GCS_Hu_Tzu_Shan", + "GCS_HD72", + "GCS_ID74", + "GCS_Indian_1954", + "GCS_Indian_1975", + "GCS_Jamaica_1875", + "GCS_JAD69", + "GCS_Kalianpur", + "GCS_Kandawala", + "GCS_Kertau", + "GCS_KOC", + "GCS_La_Canoa", + "GCS_PSAD56", + "GCS_Lake", + "GCS_Leigon", + "GCS_Liberia_1964", + "GCS_Lome", + "GCS_Luzon_1911", + "GCS_Hito_XVIII_1963", + "GCS_Herat_North", + "GCS_Mahe_1971", + "GCS_Makassar", + "GCS_EUREF89", + "GCS_Malongo_1987", + "GCS_Manoca", + "GCS_Merchich", + "GCS_Massawa", + "GCS_Minna", + "GCS_Mhast", + "GCS_Monte_Mario", + "GCS_M_poraloko", + "GCS_NAD27", + "GCS_NAD_Michigan", + "GCS_NAD83", + "GCS_Nahrwan_1967", + "GCS_Naparima_1972", + "GCS_GD49", + "GCS_NGO_1948", + "GCS_Datum_73", + "GCS_NTF", + "GCS_NSWC_9Z_2", + "GCS_OSGB_1936", + "GCS_OSGB70", + "GCS_OS_SN80", + "GCS_Padang", + "GCS_Palestine_1923", + "GCS_Pointe_Noire", + "GCS_GDA94", + "GCS_Pulkovo_1942", + "GCS_Qatar", + "GCS_Qatar_1948", + "GCS_Qornoq", + "GCS_Loma_Quintana", + "GCS_Amersfoort", + "GCS_RT38", + "GCS_SAD69", + "GCS_Sapper_Hill_1943", + "GCS_Schwarzeck", + "GCS_Segora", + "GCS_Serindung", + "GCS_Sudan", + "GCS_Tananarive", + "GCS_Timbalai_1948", + "GCS_TM65", + "GCS_TM75", + "GCS_Tokyo", + "GCS_Trinidad_1903", + "GCS_TC_1948", + "GCS_Voirol_1875", + "GCS_Voirol_Unifie", + "GCS_Bern_1938", + "GCS_Nord_Sahara_1959", + "GCS_Stockholm_1938", + "GCS_Yacare", + "GCS_Yoff", + "GCS_Zanderij", + "GCS_MGI", + "GCS_Belge_1972", + "GCS_DHDN", + "GCS_Conakry_1905", + "GCS_WGS_72", + "GCS_WGS_72BE", + "GCS_WGS_84", + "GCS_Bern_1898_Bern", + "GCS_Bogota_Bogota", + "GCS_Lisbon_Lisbon", + "GCS_Makassar_Jakarta", + "GCS_MGI_Ferro", + "GCS_Monte_Mario_Rome", + "GCS_NTF_Paris", + "GCS_Padang_Jakarta", + "GCS_Belge_1950_Brussels", + "GCS_Tananarive_Paris", + "GCS_Voirol_1875_Paris", + "GCS_Voirol_Unifie_Paris", + "GCS_Batavia_Jakarta", + "GCS_ATF_Paris", + "GCS_NDG_Paris" +}; + +#define TIFF_GCSE_TYPE_OFFSET 4001 +static const char *const tiff_gcse_type_codes[] = { + "GCSE_Airy1830", + "GCSE_AiryModified1849", + "GCSE_AustralianNationalSpheroid", + "GCSE_Bessel1841", + "GCSE_BesselModified", + "GCSE_BesselNamibia", + "GCSE_Clarke1858", + "GCSE_Clarke1866", + "GCSE_Clarke1866Michigan", + "GCSE_Clarke1880_Benoit", + "GCSE_Clarke1880_IGN", + "GCSE_Clarke1880_RGS", + "GCSE_Clarke1880_Arc", + "GCSE_Clarke1880_SGA1922", + "GCSE_Everest1830_1937Adjustment", + "GCSE_Everest1830_1967Definition", + "GCSE_Everest1830_1975Definition", + "GCSE_Everest1830Modified", + "GCSE_GRS1980", + "GCSE_Helmert1906", + "GCSE_IndonesianNationalSpheroid", + "GCSE_International1924", + "GCSE_International1967", + "GCSE_Krassowsky1940", + "GCSE_NWL9D", + "GCSE_NWL10D", + "GCSE_Plessis1817", + "GCSE_Struve1860", + "GCSE_WarOffice", + "GCSE_WGS84", + "GCSE_GEM10C", + "GCSE_OSU86F", + "GCSE_OSU91A", + "GCSE_Clarke1880", + "GCSE_Sphere" +}; + +#define TIFF_GEODETIC_DATUM_OFFSET 6201 +static const char *const tiff_geodetic_datum_codes[] = { + "Datum_Adindan", + "Datum_Australian_Geodetic_Datum_1966", + "Datum_Australian_Geodetic_Datum_1984", + "Datum_Ain_el_Abd_1970", + "Datum_Afgooye", + "Datum_Agadez", + "Datum_Lisbon", + "Datum_Aratu", + "Datum_Arc_1950", + "Datum_Arc_1960", + "Datum_Batavia", + "Datum_Barbados", + "Datum_Beduaram", + "Datum_Beijing_1954", + "Datum_Reseau_National_Belge_1950", + "Datum_Bermuda_1957", + "Datum_Bern_1898", + "Datum_Bogota", + "Datum_Bukit_Rimpah", + "Datum_Camacupa", + "Datum_Campo_Inchauspe", + "Datum_Cape", + "Datum_Carthage", + "Datum_Chua", + "Datum_Corrego_Alegre", + "Datum_Cote_d_Ivoire", + "Datum_Deir_ez_Zor", + "Datum_Douala", + "Datum_Egypt_1907", + "Datum_European_Datum_1950", + "Datum_European_Datum_1987", + "Datum_Fahud", + "Datum_Gandajika_1970", + "Datum_Garoua", + "Datum_Guyane_Francaise", + "Datum_Hu_Tzu_Shan", + "Datum_Hungarian_Datum_1972", + "Datum_Indonesian_Datum_1974", + "Datum_Indian_1954", + "Datum_Indian_1975", + "Datum_Jamaica_1875", + "Datum_Jamaica_1969", + "Datum_Kalianpur", + "Datum_Kandawala", + "Datum_Kertau", + "Datum_Kuwait_Oil_Company", + "Datum_La_Canoa", + "Datum_Provisional_S_American_Datum_1956", + "Datum_Lake", + "Datum_Leigon", + "Datum_Liberia_1964", + "Datum_Lome", + "Datum_Luzon_1911", + "Datum_Hito_XVIII_1963", + "Datum_Herat_North", + "Datum_Mahe_1971", + "Datum_Makassar", + "Datum_European_Reference_System_1989", + "Datum_Malongo_1987", + "Datum_Manoca", + "Datum_Merchich", + "Datum_Massawa", + "Datum_Minna", + "Datum_Mhast", + "Datum_Monte_Mario", + "Datum_M_poraloko", + "Datum_North_American_Datum_1927", + "Datum_NAD_Michigan", + "Datum_North_American_Datum_1983", + "Datum_Nahrwan_1967", + "Datum_Naparima_1972", + "Datum_New_Zealand_Geodetic_Datum_1949", + "Datum_NGO_1948", + "Datum_Datum_73", + "Datum_Nouvelle_Triangulation_Francaise", + "Datum_NSWC_9Z_2", + "Datum_OSGB_1936", + "Datum_OSGB_1970_SN", + "Datum_OS_SN_1980", + "Datum_Padang_1884", + "Datum_Palestine_1923", + "Datum_Pointe_Noire", + "Datum_Geocentric_Datum_of_Australia_1994", + "Datum_Pulkovo_1942", + "Datum_Qatar", + "Datum_Qatar_1948", + "Datum_Qornoq", + "Datum_Loma_Quintana", + "Datum_Amersfoort", + "Datum_RT38", + "Datum_South_American_Datum_1969", + "Datum_Sapper_Hill_1943", + "Datum_Schwarzeck", + "Datum_Segora", + "Datum_Serindung", + "Datum_Sudan", + "Datum_Tananarive_1925", + "Datum_Timbalai_1948", + "Datum_TM65", + "Datum_TM75", + "Datum_Tokyo", + "Datum_Trinidad_1903", + "Datum_Trucial_Coast_1948", + "Datum_Voirol_1875", + "Datum_Voirol_Unifie_1960", + "Datum_Bern_1938", + "Datum_Nord_Sahara_1959", + "Datum_Stockholm_1938", + "Datum_Yacare", + "Datum_Yoff", + "Datum_Zanderij", + "Datum_Militar_Geographische_Institut", + "Datum_Reseau_National_Belge_1972", + "Datum_Deutsche_Hauptdreiecksnetz", + "Datum_Conakry_1905", + "Datum_WGS72", + "Datum_WGS72_Transit_Broadcast_Ephemeris", + "Datum_WGS84", + "Datum_Ancienne_Triangulation_Francaise", + "Datum_Nord_de_Guerre" +}; + +#define TIFF_GEODETIC_DATUM_E_OFFSET 6001 +static const char *const tiff_geodetic_datum_e_codes[] = { + "DatumE_Airy1830", + "DatumE_AiryModified1849", + "DatumE_AustralianNationalSpheroid", + "DatumE_Bessel1841", + "DatumE_BesselModified", + "DatumE_BesselNamibia", + "DatumE_Clarke1858", + "DatumE_Clarke1866", + "DatumE_Clarke1866Michigan", + "DatumE_Clarke1880_Benoit", + "DatumE_Clarke1880_IGN", + "DatumE_Clarke1880_RGS", + "DatumE_Clarke1880_Arc", + "DatumE_Clarke1880_SGA1922", + "DatumE_Everest1830_1937Adjustment", + "DatumE_Everest1830_1967Definition", + "DatumE_Everest1830_1975Definition", + "DatumE_Everest1830Modified", + "DatumE_GRS1980", + "DatumE_Helmert1906", + "DatumE_IndonesianNationalSpheroid", + "DatumE_International1924", + "DatumE_International1967", + "DatumE_Krassowsky1960", + "DatumE_NWL9D", + "DatumE_NWL10D", + "DatumE_Plessis1817", + "DatumE_Struve1860", + "DatumE_WarOffice", + "DatumE_WGS84", + "DatumE_GEM10C", + "DatumE_OSU86F", + "DatumE_OSU91A", + "DatumE_Clarke1880", + "DatumE_Sphere" +}; + +#define TIFF_ELLIPSOID_OFFSET 7001 +static const char *const tiff_ellipsoid_codes[] = { + "Ellipse_Airy_1830", + "Ellipse_Airy_Modified_1849", + "Ellipse_Australian_National_Spheroid", + "Ellipse_Bessel_1841", + "Ellipse_Bessel_Modified", + "Ellipse_Bessel_Namibia", + "Ellipse_Clarke_1858", + "Ellipse_Clarke_1866", + "Ellipse_Clarke_1866_Michigan", + "Ellipse_Clarke_1880_Benoit", + "Ellipse_Clarke_1880_IGN", + "Ellipse_Clarke_1880_RGS", + "Ellipse_Clarke_1880_Arc", + "Ellipse_Clarke_1880_SGA_1922", + "Ellipse_Everest_1830_1937_Adjustment", + "Ellipse_Everest_1830_1967_Definition", + "Ellipse_Everest_1830_1975_Definition", + "Ellipse_Everest_1830_Modified", + "Ellipse_GRS_1980", + "Ellipse_Helmert_1906", + "Ellipse_Indonesian_National_Spheroid", + "Ellipse_International_1924", + "Ellipse_International_1967", + "Ellipse_Krassowsky_1940", + "Ellipse_NWL_9D", + "Ellipse_NWL_10D", + "Ellipse_Plessis_1817", + "Ellipse_Struve_1860", + "Ellipse_War_Office", + "Ellipse_WGS_84", + "Ellipse_GEM_10C", + "Ellipse_OSU86F", + "Ellipse_OSU91A", + "Ellipse_Clarke_1880", + "Ellipse_Sphere" +}; + +#define TIFF_PRIME_MERIDIAN_OFFSET 8901 +static const char *const tiff_prime_meridian_codes[] = { + "PM_Greenwich", + "PM_Lisbon", + "PM_Paris", + "PM_Bogota", + "PM_Madrid", + "PM_Rome", + "PM_Bern", + "PM_Jakarta", + "PM_Ferro", + "PM_Brussels", + "PM_Stockholm" +}; + +static const TiffGeoTagKeyName tiff_proj_cs_type_codes[] = { + {20137, "PCS_Adindan_UTM_zone_37N"}, + {20138, "PCS_Adindan_UTM_zone_38N"}, + {20248, "PCS_AGD66_AMG_zone_48"}, + {20249, "PCS_AGD66_AMG_zone_49"}, + {20250, "PCS_AGD66_AMG_zone_50"}, + {20251, "PCS_AGD66_AMG_zone_51"}, + {20252, "PCS_AGD66_AMG_zone_52"}, + {20253, "PCS_AGD66_AMG_zone_53"}, + {20254, "PCS_AGD66_AMG_zone_54"}, + {20255, "PCS_AGD66_AMG_zone_55"}, + {20256, "PCS_AGD66_AMG_zone_56"}, + {20257, "PCS_AGD66_AMG_zone_57"}, + {20258, "PCS_AGD66_AMG_zone_58"}, + {20348, "PCS_AGD84_AMG_zone_48"}, + {20349, "PCS_AGD84_AMG_zone_49"}, + {20350, "PCS_AGD84_AMG_zone_50"}, + {20351, "PCS_AGD84_AMG_zone_51"}, + {20352, "PCS_AGD84_AMG_zone_52"}, + {20353, "PCS_AGD84_AMG_zone_53"}, + {20354, "PCS_AGD84_AMG_zone_54"}, + {20355, "PCS_AGD84_AMG_zone_55"}, + {20356, "PCS_AGD84_AMG_zone_56"}, + {20357, "PCS_AGD84_AMG_zone_57"}, + {20358, "PCS_AGD84_AMG_zone_58"}, + {20437, "PCS_Ain_el_Abd_UTM_zone_37N"}, + {20438, "PCS_Ain_el_Abd_UTM_zone_38N"}, + {20439, "PCS_Ain_el_Abd_UTM_zone_39N"}, + {20499, "PCS_Ain_el_Abd_Bahrain_Grid"}, + {20538, "PCS_Afgooye_UTM_zone_38N"}, + {20539, "PCS_Afgooye_UTM_zone_39N"}, + {20700, "PCS_Lisbon_Portugese_Grid"}, + {20822, "PCS_Aratu_UTM_zone_22S"}, + {20823, "PCS_Aratu_UTM_zone_23S"}, + {20824, "PCS_Aratu_UTM_zone_24S"}, + {20973, "PCS_Arc_1950_Lo13"}, + {20975, "PCS_Arc_1950_Lo15"}, + {20977, "PCS_Arc_1950_Lo17"}, + {20979, "PCS_Arc_1950_Lo19"}, + {20981, "PCS_Arc_1950_Lo21"}, + {20983, "PCS_Arc_1950_Lo23"}, + {20985, "PCS_Arc_1950_Lo25"}, + {20987, "PCS_Arc_1950_Lo27"}, + {20989, "PCS_Arc_1950_Lo29"}, + {20991, "PCS_Arc_1950_Lo31"}, + {20993, "PCS_Arc_1950_Lo33"}, + {20995, "PCS_Arc_1950_Lo35"}, + {21100, "PCS_Batavia_NEIEZ"}, + {21148, "PCS_Batavia_UTM_zone_48S"}, + {21149, "PCS_Batavia_UTM_zone_49S"}, + {21150, "PCS_Batavia_UTM_zone_50S"}, + {21413, "PCS_Beijing_Gauss_zone_13"}, + {21414, "PCS_Beijing_Gauss_zone_14"}, + {21415, "PCS_Beijing_Gauss_zone_15"}, + {21416, "PCS_Beijing_Gauss_zone_16"}, + {21417, "PCS_Beijing_Gauss_zone_17"}, + {21418, "PCS_Beijing_Gauss_zone_18"}, + {21419, "PCS_Beijing_Gauss_zone_19"}, + {21420, "PCS_Beijing_Gauss_zone_20"}, + {21421, "PCS_Beijing_Gauss_zone_21"}, + {21422, "PCS_Beijing_Gauss_zone_22"}, + {21423, "PCS_Beijing_Gauss_zone_23"}, + {21473, "PCS_Beijing_Gauss_13N"}, + {21474, "PCS_Beijing_Gauss_14N"}, + {21475, "PCS_Beijing_Gauss_15N"}, + {21476, "PCS_Beijing_Gauss_16N"}, + {21477, "PCS_Beijing_Gauss_17N"}, + {21478, "PCS_Beijing_Gauss_18N"}, + {21479, "PCS_Beijing_Gauss_19N"}, + {21480, "PCS_Beijing_Gauss_20N"}, + {21481, "PCS_Beijing_Gauss_21N"}, + {21482, "PCS_Beijing_Gauss_22N"}, + {21483, "PCS_Beijing_Gauss_23N"}, + {21500, "PCS_Belge_Lambert_50"}, + {21790, "PCS_Bern_1898_Swiss_Old"}, + {21817, "PCS_Bogota_UTM_zone_17N"}, + {21818, "PCS_Bogota_UTM_zone_18N"}, + {21891, "PCS_Bogota_Colombia_3W"}, + {21892, "PCS_Bogota_Colombia_Bogota"}, + {21893, "PCS_Bogota_Colombia_3E"}, + {21894, "PCS_Bogota_Colombia_6E"}, + {22032, "PCS_Camacupa_UTM_32S"}, + {22033, "PCS_Camacupa_UTM_33S"}, + {22191, "PCS_C_Inchauspe_Argentina_1"}, + {22192, "PCS_C_Inchauspe_Argentina_2"}, + {22193, "PCS_C_Inchauspe_Argentina_3"}, + {22194, "PCS_C_Inchauspe_Argentina_4"}, + {22195, "PCS_C_Inchauspe_Argentina_5"}, + {22196, "PCS_C_Inchauspe_Argentina_6"}, + {22197, "PCS_C_Inchauspe_Argentina_7"}, + {22332, "PCS_Carthage_UTM_zone_32N"}, + {22391, "PCS_Carthage_Nord_Tunisie"}, + {22392, "PCS_Carthage_Sud_Tunisie"}, + {22523, "PCS_Corrego_Alegre_UTM_23S"}, + {22524, "PCS_Corrego_Alegre_UTM_24S"}, + {22832, "PCS_Douala_UTM_zone_32N"}, + {22992, "PCS_Egypt_1907_Red_Belt"}, + {22993, "PCS_Egypt_1907_Purple_Belt"}, + {22994, "PCS_Egypt_1907_Ext_Purple"}, + {23028, "PCS_ED50_UTM_zone_28N"}, + {23029, "PCS_ED50_UTM_zone_29N"}, + {23030, "PCS_ED50_UTM_zone_30N"}, + {23031, "PCS_ED50_UTM_zone_31N"}, + {23032, "PCS_ED50_UTM_zone_32N"}, + {23033, "PCS_ED50_UTM_zone_33N"}, + {23034, "PCS_ED50_UTM_zone_34N"}, + {23035, "PCS_ED50_UTM_zone_35N"}, + {23036, "PCS_ED50_UTM_zone_36N"}, + {23037, "PCS_ED50_UTM_zone_37N"}, + {23038, "PCS_ED50_UTM_zone_38N"}, + {23239, "PCS_Fahud_UTM_zone_39N"}, + {23240, "PCS_Fahud_UTM_zone_40N"}, + {23433, "PCS_Garoua_UTM_zone_33N"}, + {23846, "PCS_ID74_UTM_zone_46N"}, + {23847, "PCS_ID74_UTM_zone_47N"}, + {23848, "PCS_ID74_UTM_zone_48N"}, + {23849, "PCS_ID74_UTM_zone_49N"}, + {23850, "PCS_ID74_UTM_zone_50N"}, + {23851, "PCS_ID74_UTM_zone_51N"}, + {23852, "PCS_ID74_UTM_zone_52N"}, + {23853, "PCS_ID74_UTM_zone_53N"}, + {23886, "PCS_ID74_UTM_zone_46S"}, + {23887, "PCS_ID74_UTM_zone_47S"}, + {23888, "PCS_ID74_UTM_zone_48S"}, + {23889, "PCS_ID74_UTM_zone_49S"}, + {23890, "PCS_ID74_UTM_zone_50S"}, + {23891, "PCS_ID74_UTM_zone_51S"}, + {23892, "PCS_ID74_UTM_zone_52S"}, + {23893, "PCS_ID74_UTM_zone_53S"}, + {23894, "PCS_ID74_UTM_zone_54S"}, + {23947, "PCS_Indian_1954_UTM_47N"}, + {23948, "PCS_Indian_1954_UTM_48N"}, + {24047, "PCS_Indian_1975_UTM_47N"}, + {24048, "PCS_Indian_1975_UTM_48N"}, + {24100, "PCS_Jamaica_1875_Old_Grid"}, + {24200, "PCS_JAD69_Jamaica_Grid"}, + {24370, "PCS_Kalianpur_India_0"}, + {24371, "PCS_Kalianpur_India_I"}, + {24372, "PCS_Kalianpur_India_IIa"}, + {24373, "PCS_Kalianpur_India_IIIa"}, + {24374, "PCS_Kalianpur_India_IVa"}, + {24382, "PCS_Kalianpur_India_IIb"}, + {24383, "PCS_Kalianpur_India_IIIb"}, + {24384, "PCS_Kalianpur_India_IVb"}, + {24500, "PCS_Kertau_Singapore_Grid"}, + {24547, "PCS_Kertau_UTM_zone_47N"}, + {24548, "PCS_Kertau_UTM_zone_48N"}, + {24720, "PCS_La_Canoa_UTM_zone_20N"}, + {24721, "PCS_La_Canoa_UTM_zone_21N"}, + {24818, "PCS_PSAD56_UTM_zone_18N"}, + {24819, "PCS_PSAD56_UTM_zone_19N"}, + {24820, "PCS_PSAD56_UTM_zone_20N"}, + {24821, "PCS_PSAD56_UTM_zone_21N"}, + {24877, "PCS_PSAD56_UTM_zone_17S"}, + {24878, "PCS_PSAD56_UTM_zone_18S"}, + {24879, "PCS_PSAD56_UTM_zone_19S"}, + {24880, "PCS_PSAD56_UTM_zone_20S"}, + {24891, "PCS_PSAD56_Peru_west_zone"}, + {24892, "PCS_PSAD56_Peru_central"}, + {24893, "PCS_PSAD56_Peru_east_zone"}, + {25000, "PCS_Leigon_Ghana_Grid"}, + {25231, "PCS_Lome_UTM_zone_31N"}, + {25391, "PCS_Luzon_Philippines_I"}, + {25392, "PCS_Luzon_Philippines_II"}, + {25393, "PCS_Luzon_Philippines_III"}, + {25394, "PCS_Luzon_Philippines_IV"}, + {25395, "PCS_Luzon_Philippines_V"}, + {25700, "PCS_Makassar_NEIEZ"}, + {25932, "PCS_Malongo_1987_UTM_32S"}, + {26191, "PCS_Merchich_Nord_Maroc"}, + {26192, "PCS_Merchich_Sud_Maroc"}, + {26193, "PCS_Merchich_Sahara"}, + {26237, "PCS_Massawa_UTM_zone_37N"}, + {26331, "PCS_Minna_UTM_zone_31N"}, + {26332, "PCS_Minna_UTM_zone_32N"}, + {26391, "PCS_Minna_Nigeria_West"}, + {26392, "PCS_Minna_Nigeria_Mid_Belt"}, + {26393, "PCS_Minna_Nigeria_East"}, + {26432, "PCS_Mhast_UTM_zone_32S"}, + {26591, "PCS_Monte_Mario_Italy_1"}, + {26592, "PCS_Monte_Mario_Italy_2"}, + {26632, "PCS_M_poraloko_UTM_32N"}, + {26692, "PCS_M_poraloko_UTM_32S"}, + {26703, "PCS_NAD27_UTM_zone_3N"}, + {26704, "PCS_NAD27_UTM_zone_4N"}, + {26705, "PCS_NAD27_UTM_zone_5N"}, + {26706, "PCS_NAD27_UTM_zone_6N"}, + {26707, "PCS_NAD27_UTM_zone_7N"}, + {26708, "PCS_NAD27_UTM_zone_8N"}, + {26709, "PCS_NAD27_UTM_zone_9N"}, + {26710, "PCS_NAD27_UTM_zone_10N"}, + {26711, "PCS_NAD27_UTM_zone_11N"}, + {26712, "PCS_NAD27_UTM_zone_12N"}, + {26713, "PCS_NAD27_UTM_zone_13N"}, + {26714, "PCS_NAD27_UTM_zone_14N"}, + {26715, "PCS_NAD27_UTM_zone_15N"}, + {26716, "PCS_NAD27_UTM_zone_16N"}, + {26717, "PCS_NAD27_UTM_zone_17N"}, + {26718, "PCS_NAD27_UTM_zone_18N"}, + {26719, "PCS_NAD27_UTM_zone_19N"}, + {26720, "PCS_NAD27_UTM_zone_20N"}, + {26721, "PCS_NAD27_UTM_zone_21N"}, + {26722, "PCS_NAD27_UTM_zone_22N"}, + {26729, "PCS_NAD27_Alabama_East"}, + {26730, "PCS_NAD27_Alabama_West"}, + {26731, "PCS_NAD27_Alaska_zone_1"}, + {26732, "PCS_NAD27_Alaska_zone_2"}, + {26733, "PCS_NAD27_Alaska_zone_3"}, + {26734, "PCS_NAD27_Alaska_zone_4"}, + {26735, "PCS_NAD27_Alaska_zone_5"}, + {26736, "PCS_NAD27_Alaska_zone_6"}, + {26737, "PCS_NAD27_Alaska_zone_7"}, + {26738, "PCS_NAD27_Alaska_zone_8"}, + {26739, "PCS_NAD27_Alaska_zone_9"}, + {26740, "PCS_NAD27_Alaska_zone_10"}, + {26741, "PCS_NAD27_California_I"}, + {26742, "PCS_NAD27_California_II"}, + {26743, "PCS_NAD27_California_III"}, + {26744, "PCS_NAD27_California_IV"}, + {26745, "PCS_NAD27_California_V"}, + {26746, "PCS_NAD27_California_VI"}, + {26747, "PCS_NAD27_California_VII"}, + {26748, "PCS_NAD27_Arizona_East"}, + {26749, "PCS_NAD27_Arizona_Central"}, + {26750, "PCS_NAD27_Arizona_West"}, + {26751, "PCS_NAD27_Arkansas_North"}, + {26752, "PCS_NAD27_Arkansas_South"}, + {26753, "PCS_NAD27_Colorado_North"}, + {26754, "PCS_NAD27_Colorado_Central"}, + {26755, "PCS_NAD27_Colorado_South"}, + {26756, "PCS_NAD27_Connecticut"}, + {26757, "PCS_NAD27_Delaware"}, + {26758, "PCS_NAD27_Florida_East"}, + {26759, "PCS_NAD27_Florida_West"}, + {26760, "PCS_NAD27_Florida_North"}, + {26761, "PCS_NAD27_Hawaii_zone_1"}, + {26762, "PCS_NAD27_Hawaii_zone_2"}, + {26763, "PCS_NAD27_Hawaii_zone_3"}, + {26764, "PCS_NAD27_Hawaii_zone_4"}, + {26765, "PCS_NAD27_Hawaii_zone_5"}, + {26766, "PCS_NAD27_Georgia_East"}, + {26767, "PCS_NAD27_Georgia_West"}, + {26768, "PCS_NAD27_Idaho_East"}, + {26769, "PCS_NAD27_Idaho_Central"}, + {26770, "PCS_NAD27_Idaho_West"}, + {26771, "PCS_NAD27_Illinois_East"}, + {26772, "PCS_NAD27_Illinois_West"}, + {26773, "PCS_NAD27_Indiana_East"}, + {26774, "PCS_NAD27_Indiana_West"}, + {26775, "PCS_NAD27_Iowa_North"}, + {26776, "PCS_NAD27_Iowa_South"}, + {26777, "PCS_NAD27_Kansas_North"}, + {26778, "PCS_NAD27_Kansas_South"}, + {26779, "PCS_NAD27_Kentucky_North"}, + {26780, "PCS_NAD27_Kentucky_South"}, + {26781, "PCS_NAD27_Louisiana_North"}, + {26782, "PCS_NAD27_Louisiana_South"}, + {26783, "PCS_NAD27_Maine_East"}, + {26784, "PCS_NAD27_Maine_West"}, + {26785, "PCS_NAD27_Maryland"}, + {26786, "PCS_NAD27_Massachusetts"}, + {26787, "PCS_NAD27_Massachusetts_Is"}, + {26788, "PCS_NAD27_Michigan_North"}, + {26789, "PCS_NAD27_Michigan_Central"}, + {26790, "PCS_NAD27_Michigan_South"}, + {26791, "PCS_NAD27_Minnesota_North"}, + {26792, "PCS_NAD27_Minnesota_Cent"}, + {26793, "PCS_NAD27_Minnesota_South"}, + {26794, "PCS_NAD27_Mississippi_East"}, + {26795, "PCS_NAD27_Mississippi_West"}, + {26796, "PCS_NAD27_Missouri_East"}, + {26797, "PCS_NAD27_Missouri_Central"}, + {26798, "PCS_NAD27_Missouri_West"}, + {26801, "PCS_NAD_Michigan_Michigan_East"}, + {26802, "PCS_NAD_Michigan_Michigan_Old_Central"}, + {26803, "PCS_NAD_Michigan_Michigan_West"}, + {26903, "PCS_NAD83_UTM_zone_3N"}, + {26904, "PCS_NAD83_UTM_zone_4N"}, + {26905, "PCS_NAD83_UTM_zone_5N"}, + {26906, "PCS_NAD83_UTM_zone_6N"}, + {26907, "PCS_NAD83_UTM_zone_7N"}, + {26908, "PCS_NAD83_UTM_zone_8N"}, + {26909, "PCS_NAD83_UTM_zone_9N"}, + {26910, "PCS_NAD83_UTM_zone_10N"}, + {26911, "PCS_NAD83_UTM_zone_11N"}, + {26912, "PCS_NAD83_UTM_zone_12N"}, + {26913, "PCS_NAD83_UTM_zone_13N"}, + {26914, "PCS_NAD83_UTM_zone_14N"}, + {26915, "PCS_NAD83_UTM_zone_15N"}, + {26916, "PCS_NAD83_UTM_zone_16N"}, + {26917, "PCS_NAD83_UTM_zone_17N"}, + {26918, "PCS_NAD83_UTM_zone_18N"}, + {26919, "PCS_NAD83_UTM_zone_19N"}, + {26920, "PCS_NAD83_UTM_zone_20N"}, + {26921, "PCS_NAD83_UTM_zone_21N"}, + {26922, "PCS_NAD83_UTM_zone_22N"}, + {26923, "PCS_NAD83_UTM_zone_23N"}, + {26929, "PCS_NAD83_Alabama_East"}, + {26930, "PCS_NAD83_Alabama_West"}, + {26931, "PCS_NAD83_Alaska_zone_1"}, + {26932, "PCS_NAD83_Alaska_zone_2"}, + {26933, "PCS_NAD83_Alaska_zone_3"}, + {26934, "PCS_NAD83_Alaska_zone_4"}, + {26935, "PCS_NAD83_Alaska_zone_5"}, + {26936, "PCS_NAD83_Alaska_zone_6"}, + {26937, "PCS_NAD83_Alaska_zone_7"}, + {26938, "PCS_NAD83_Alaska_zone_8"}, + {26939, "PCS_NAD83_Alaska_zone_9"}, + {26940, "PCS_NAD83_Alaska_zone_10"}, + {26941, "PCS_NAD83_California_1"}, + {26942, "PCS_NAD83_California_2"}, + {26943, "PCS_NAD83_California_3"}, + {26944, "PCS_NAD83_California_4"}, + {26945, "PCS_NAD83_California_5"}, + {26946, "PCS_NAD83_California_6"}, + {26948, "PCS_NAD83_Arizona_East"}, + {26949, "PCS_NAD83_Arizona_Central"}, + {26950, "PCS_NAD83_Arizona_West"}, + {26951, "PCS_NAD83_Arkansas_North"}, + {26952, "PCS_NAD83_Arkansas_South"}, + {26953, "PCS_NAD83_Colorado_North"}, + {26954, "PCS_NAD83_Colorado_Central"}, + {26955, "PCS_NAD83_Colorado_South"}, + {26956, "PCS_NAD83_Connecticut"}, + {26957, "PCS_NAD83_Delaware"}, + {26958, "PCS_NAD83_Florida_East"}, + {26959, "PCS_NAD83_Florida_West"}, + {26960, "PCS_NAD83_Florida_North"}, + {26961, "PCS_NAD83_Hawaii_zone_1"}, + {26962, "PCS_NAD83_Hawaii_zone_2"}, + {26963, "PCS_NAD83_Hawaii_zone_3"}, + {26964, "PCS_NAD83_Hawaii_zone_4"}, + {26965, "PCS_NAD83_Hawaii_zone_5"}, + {26966, "PCS_NAD83_Georgia_East"}, + {26967, "PCS_NAD83_Georgia_West"}, + {26968, "PCS_NAD83_Idaho_East"}, + {26969, "PCS_NAD83_Idaho_Central"}, + {26970, "PCS_NAD83_Idaho_West"}, + {26971, "PCS_NAD83_Illinois_East"}, + {26972, "PCS_NAD83_Illinois_West"}, + {26973, "PCS_NAD83_Indiana_East"}, + {26974, "PCS_NAD83_Indiana_West"}, + {26975, "PCS_NAD83_Iowa_North"}, + {26976, "PCS_NAD83_Iowa_South"}, + {26977, "PCS_NAD83_Kansas_North"}, + {26978, "PCS_NAD83_Kansas_South"}, + {26979, "PCS_NAD83_Kentucky_North"}, + {26980, "PCS_NAD83_Kentucky_South"}, + {26981, "PCS_NAD83_Louisiana_North"}, + {26982, "PCS_NAD83_Louisiana_South"}, + {26983, "PCS_NAD83_Maine_East"}, + {26984, "PCS_NAD83_Maine_West"}, + {26985, "PCS_NAD83_Maryland"}, + {26986, "PCS_NAD83_Massachusetts"}, + {26987, "PCS_NAD83_Massachusetts_Is"}, + {26988, "PCS_NAD83_Michigan_North"}, + {26989, "PCS_NAD83_Michigan_Central"}, + {26990, "PCS_NAD83_Michigan_South"}, + {26991, "PCS_NAD83_Minnesota_North"}, + {26992, "PCS_NAD83_Minnesota_Cent"}, + {26993, "PCS_NAD83_Minnesota_South"}, + {26994, "PCS_NAD83_Mississippi_East"}, + {26995, "PCS_NAD83_Mississippi_West"}, + {26996, "PCS_NAD83_Missouri_East"}, + {26997, "PCS_NAD83_Missouri_Central"}, + {26998, "PCS_NAD83_Missouri_West"}, + {27038, "PCS_Nahrwan_1967_UTM_38N"}, + {27039, "PCS_Nahrwan_1967_UTM_39N"}, + {27040, "PCS_Nahrwan_1967_UTM_40N"}, + {27120, "PCS_Naparima_UTM_20N"}, + {27200, "PCS_GD49_NZ_Map_Grid"}, + {27291, "PCS_GD49_North_Island_Grid"}, + {27292, "PCS_GD49_South_Island_Grid"}, + {27429, "PCS_Datum_73_UTM_zone_29N"}, + {27500, "PCS_ATF_Nord_de_Guerre"}, + {27581, "PCS_NTF_France_I"}, + {27582, "PCS_NTF_France_II"}, + {27583, "PCS_NTF_France_III"}, + {27591, "PCS_NTF_Nord_France"}, + {27592, "PCS_NTF_Centre_France"}, + {27593, "PCS_NTF_Sud_France"}, + {27700, "PCS_British_National_Grid"}, + {28232, "PCS_Point_Noire_UTM_32S"}, + {28348, "PCS_GDA94_MGA_zone_48"}, + {28349, "PCS_GDA94_MGA_zone_49"}, + {28350, "PCS_GDA94_MGA_zone_50"}, + {28351, "PCS_GDA94_MGA_zone_51"}, + {28352, "PCS_GDA94_MGA_zone_52"}, + {28353, "PCS_GDA94_MGA_zone_53"}, + {28354, "PCS_GDA94_MGA_zone_54"}, + {28355, "PCS_GDA94_MGA_zone_55"}, + {28356, "PCS_GDA94_MGA_zone_56"}, + {28357, "PCS_GDA94_MGA_zone_57"}, + {28358, "PCS_GDA94_MGA_zone_58"}, + {28404, "PCS_Pulkovo_Gauss_zone_4"}, + {28405, "PCS_Pulkovo_Gauss_zone_5"}, + {28406, "PCS_Pulkovo_Gauss_zone_6"}, + {28407, "PCS_Pulkovo_Gauss_zone_7"}, + {28408, "PCS_Pulkovo_Gauss_zone_8"}, + {28409, "PCS_Pulkovo_Gauss_zone_9"}, + {28410, "PCS_Pulkovo_Gauss_zone_10"}, + {28411, "PCS_Pulkovo_Gauss_zone_11"}, + {28412, "PCS_Pulkovo_Gauss_zone_12"}, + {28413, "PCS_Pulkovo_Gauss_zone_13"}, + {28414, "PCS_Pulkovo_Gauss_zone_14"}, + {28415, "PCS_Pulkovo_Gauss_zone_15"}, + {28416, "PCS_Pulkovo_Gauss_zone_16"}, + {28417, "PCS_Pulkovo_Gauss_zone_17"}, + {28418, "PCS_Pulkovo_Gauss_zone_18"}, + {28419, "PCS_Pulkovo_Gauss_zone_19"}, + {28420, "PCS_Pulkovo_Gauss_zone_20"}, + {28421, "PCS_Pulkovo_Gauss_zone_21"}, + {28422, "PCS_Pulkovo_Gauss_zone_22"}, + {28423, "PCS_Pulkovo_Gauss_zone_23"}, + {28424, "PCS_Pulkovo_Gauss_zone_24"}, + {28425, "PCS_Pulkovo_Gauss_zone_25"}, + {28426, "PCS_Pulkovo_Gauss_zone_26"}, + {28427, "PCS_Pulkovo_Gauss_zone_27"}, + {28428, "PCS_Pulkovo_Gauss_zone_28"}, + {28429, "PCS_Pulkovo_Gauss_zone_29"}, + {28430, "PCS_Pulkovo_Gauss_zone_30"}, + {28431, "PCS_Pulkovo_Gauss_zone_31"}, + {28432, "PCS_Pulkovo_Gauss_zone_32"}, + {28464, "PCS_Pulkovo_Gauss_4N"}, + {28465, "PCS_Pulkovo_Gauss_5N"}, + {28466, "PCS_Pulkovo_Gauss_6N"}, + {28467, "PCS_Pulkovo_Gauss_7N"}, + {28468, "PCS_Pulkovo_Gauss_8N"}, + {28469, "PCS_Pulkovo_Gauss_9N"}, + {28470, "PCS_Pulkovo_Gauss_10N"}, + {28471, "PCS_Pulkovo_Gauss_11N"}, + {28472, "PCS_Pulkovo_Gauss_12N"}, + {28473, "PCS_Pulkovo_Gauss_13N"}, + {28474, "PCS_Pulkovo_Gauss_14N"}, + {28475, "PCS_Pulkovo_Gauss_15N"}, + {28476, "PCS_Pulkovo_Gauss_16N"}, + {28477, "PCS_Pulkovo_Gauss_17N"}, + {28478, "PCS_Pulkovo_Gauss_18N"}, + {28479, "PCS_Pulkovo_Gauss_19N"}, + {28480, "PCS_Pulkovo_Gauss_20N"}, + {28481, "PCS_Pulkovo_Gauss_21N"}, + {28482, "PCS_Pulkovo_Gauss_22N"}, + {28483, "PCS_Pulkovo_Gauss_23N"}, + {28484, "PCS_Pulkovo_Gauss_24N"}, + {28485, "PCS_Pulkovo_Gauss_25N"}, + {28486, "PCS_Pulkovo_Gauss_26N"}, + {28487, "PCS_Pulkovo_Gauss_27N"}, + {28488, "PCS_Pulkovo_Gauss_28N"}, + {28489, "PCS_Pulkovo_Gauss_29N"}, + {28490, "PCS_Pulkovo_Gauss_30N"}, + {28491, "PCS_Pulkovo_Gauss_31N"}, + {28492, "PCS_Pulkovo_Gauss_32N"}, + {28600, "PCS_Qatar_National_Grid"}, + {28991, "PCS_RD_Netherlands_Old"}, + {28992, "PCS_RD_Netherlands_New"}, + {29118, "PCS_SAD69_UTM_zone_18N"}, + {29119, "PCS_SAD69_UTM_zone_19N"}, + {29120, "PCS_SAD69_UTM_zone_20N"}, + {29121, "PCS_SAD69_UTM_zone_21N"}, + {29122, "PCS_SAD69_UTM_zone_22N"}, + {29177, "PCS_SAD69_UTM_zone_17S"}, + {29178, "PCS_SAD69_UTM_zone_18S"}, + {29179, "PCS_SAD69_UTM_zone_19S"}, + {29180, "PCS_SAD69_UTM_zone_20S"}, + {29181, "PCS_SAD69_UTM_zone_21S"}, + {29182, "PCS_SAD69_UTM_zone_22S"}, + {29183, "PCS_SAD69_UTM_zone_23S"}, + {29184, "PCS_SAD69_UTM_zone_24S"}, + {29185, "PCS_SAD69_UTM_zone_25S"}, + {29220, "PCS_Sapper_Hill_UTM_20S"}, + {29221, "PCS_Sapper_Hill_UTM_21S"}, + {29333, "PCS_Schwarzeck_UTM_33S"}, + {29635, "PCS_Sudan_UTM_zone_35N"}, + {29636, "PCS_Sudan_UTM_zone_36N"}, + {29700, "PCS_Tananarive_Laborde"}, + {29738, "PCS_Tananarive_UTM_38S"}, + {29739, "PCS_Tananarive_UTM_39S"}, + {29800, "PCS_Timbalai_1948_Borneo"}, + {29849, "PCS_Timbalai_1948_UTM_49N"}, + {29850, "PCS_Timbalai_1948_UTM_50N"}, + {29900, "PCS_TM65_Irish_Nat_Grid"}, + {30200, "PCS_Trinidad_1903_Trinidad"}, + {30339, "PCS_TC_1948_UTM_zone_39N"}, + {30340, "PCS_TC_1948_UTM_zone_40N"}, + {30491, "PCS_Voirol_N_Algerie_ancien"}, + {30492, "PCS_Voirol_S_Algerie_ancien"}, + {30591, "PCS_Voirol_Unifie_N_Algerie"}, + {30592, "PCS_Voirol_Unifie_S_Algerie"}, + {30600, "PCS_Bern_1938_Swiss_New"}, + {30729, "PCS_Nord_Sahara_UTM_29N"}, + {30730, "PCS_Nord_Sahara_UTM_30N"}, + {30731, "PCS_Nord_Sahara_UTM_31N"}, + {30732, "PCS_Nord_Sahara_UTM_32N"}, + {31028, "PCS_Yoff_UTM_zone_28N"}, + {31121, "PCS_Zanderij_UTM_zone_21N"}, + {31291, "PCS_MGI_Austria_West"}, + {31292, "PCS_MGI_Austria_Central"}, + {31293, "PCS_MGI_Austria_East"}, + {31300, "PCS_Belge_Lambert_72"}, + {31491, "PCS_DHDN_Germany_zone_1"}, + {31492, "PCS_DHDN_Germany_zone_2"}, + {31493, "PCS_DHDN_Germany_zone_3"}, + {31494, "PCS_DHDN_Germany_zone_4"}, + {31495, "PCS_DHDN_Germany_zone_5"}, + {32001, "PCS_NAD27_Montana_North"}, + {32002, "PCS_NAD27_Montana_Central"}, + {32003, "PCS_NAD27_Montana_South"}, + {32005, "PCS_NAD27_Nebraska_North"}, + {32006, "PCS_NAD27_Nebraska_South"}, + {32007, "PCS_NAD27_Nevada_East"}, + {32008, "PCS_NAD27_Nevada_Central"}, + {32009, "PCS_NAD27_Nevada_West"}, + {32010, "PCS_NAD27_New_Hampshire"}, + {32011, "PCS_NAD27_New_Jersey"}, + {32012, "PCS_NAD27_New_Mexico_East"}, + {32013, "PCS_NAD27_New_Mexico_Cent"}, + {32014, "PCS_NAD27_New_Mexico_West"}, + {32015, "PCS_NAD27_New_York_East"}, + {32016, "PCS_NAD27_New_York_Central"}, + {32017, "PCS_NAD27_New_York_West"}, + {32018, "PCS_NAD27_New_York_Long_Is"}, + {32019, "PCS_NAD27_North_Carolina"}, + {32020, "PCS_NAD27_North_Dakota_N"}, + {32021, "PCS_NAD27_North_Dakota_S"}, + {32022, "PCS_NAD27_Ohio_North"}, + {32023, "PCS_NAD27_Ohio_South"}, + {32024, "PCS_NAD27_Oklahoma_North"}, + {32025, "PCS_NAD27_Oklahoma_South"}, + {32026, "PCS_NAD27_Oregon_North"}, + {32027, "PCS_NAD27_Oregon_South"}, + {32028, "PCS_NAD27_Pennsylvania_N"}, + {32029, "PCS_NAD27_Pennsylvania_S"}, + {32030, "PCS_NAD27_Rhode_Island"}, + {32031, "PCS_NAD27_South_Carolina_N"}, + {32033, "PCS_NAD27_South_Carolina_S"}, + {32034, "PCS_NAD27_South_Dakota_N"}, + {32035, "PCS_NAD27_South_Dakota_S"}, + {32036, "PCS_NAD27_Tennessee"}, + {32037, "PCS_NAD27_Texas_North"}, + {32038, "PCS_NAD27_Texas_North_Cen"}, + {32039, "PCS_NAD27_Texas_Central"}, + {32040, "PCS_NAD27_Texas_South_Cen"}, + {32041, "PCS_NAD27_Texas_South"}, + {32042, "PCS_NAD27_Utah_North"}, + {32043, "PCS_NAD27_Utah_Central"}, + {32044, "PCS_NAD27_Utah_South"}, + {32045, "PCS_NAD27_Vermont"}, + {32046, "PCS_NAD27_Virginia_North"}, + {32047, "PCS_NAD27_Virginia_South"}, + {32048, "PCS_NAD27_Washington_North"}, + {32049, "PCS_NAD27_Washington_South"}, + {32050, "PCS_NAD27_West_Virginia_N"}, + {32051, "PCS_NAD27_West_Virginia_S"}, + {32052, "PCS_NAD27_Wisconsin_North"}, + {32053, "PCS_NAD27_Wisconsin_Cen"}, + {32054, "PCS_NAD27_Wisconsin_South"}, + {32055, "PCS_NAD27_Wyoming_East"}, + {32056, "PCS_NAD27_Wyoming_E_Cen"}, + {32057, "PCS_NAD27_Wyoming_W_Cen"}, + {32058, "PCS_NAD27_Wyoming_West"}, + {32059, "PCS_NAD27_Puerto_Rico"}, + {32060, "PCS_NAD27_St_Croix"}, + {32100, "PCS_NAD83_Montana"}, + {32104, "PCS_NAD83_Nebraska"}, + {32107, "PCS_NAD83_Nevada_East"}, + {32108, "PCS_NAD83_Nevada_Central"}, + {32109, "PCS_NAD83_Nevada_West"}, + {32110, "PCS_NAD83_New_Hampshire"}, + {32111, "PCS_NAD83_New_Jersey"}, + {32112, "PCS_NAD83_New_Mexico_East"}, + {32113, "PCS_NAD83_New_Mexico_Cent"}, + {32114, "PCS_NAD83_New_Mexico_West"}, + {32115, "PCS_NAD83_New_York_East"}, + {32116, "PCS_NAD83_New_York_Central"}, + {32117, "PCS_NAD83_New_York_West"}, + {32118, "PCS_NAD83_New_York_Long_Is"}, + {32119, "PCS_NAD83_North_Carolina"}, + {32120, "PCS_NAD83_North_Dakota_N"}, + {32121, "PCS_NAD83_North_Dakota_S"}, + {32122, "PCS_NAD83_Ohio_North"}, + {32123, "PCS_NAD83_Ohio_South"}, + {32124, "PCS_NAD83_Oklahoma_North"}, + {32125, "PCS_NAD83_Oklahoma_South"}, + {32126, "PCS_NAD83_Oregon_North"}, + {32127, "PCS_NAD83_Oregon_South"}, + {32128, "PCS_NAD83_Pennsylvania_N"}, + {32129, "PCS_NAD83_Pennsylvania_S"}, + {32130, "PCS_NAD83_Rhode_Island"}, + {32133, "PCS_NAD83_South_Carolina"}, + {32134, "PCS_NAD83_South_Dakota_N"}, + {32135, "PCS_NAD83_South_Dakota_S"}, + {32136, "PCS_NAD83_Tennessee"}, + {32137, "PCS_NAD83_Texas_North"}, + {32138, "PCS_NAD83_Texas_North_Cen"}, + {32139, "PCS_NAD83_Texas_Central"}, + {32140, "PCS_NAD83_Texas_South_Cen"}, + {32141, "PCS_NAD83_Texas_South"}, + {32142, "PCS_NAD83_Utah_North"}, + {32143, "PCS_NAD83_Utah_Central"}, + {32144, "PCS_NAD83_Utah_South"}, + {32145, "PCS_NAD83_Vermont"}, + {32146, "PCS_NAD83_Virginia_North"}, + {32147, "PCS_NAD83_Virginia_South"}, + {32148, "PCS_NAD83_Washington_North"}, + {32149, "PCS_NAD83_Washington_South"}, + {32150, "PCS_NAD83_West_Virginia_N"}, + {32151, "PCS_NAD83_West_Virginia_S"}, + {32152, "PCS_NAD83_Wisconsin_North"}, + {32153, "PCS_NAD83_Wisconsin_Cen"}, + {32154, "PCS_NAD83_Wisconsin_South"}, + {32155, "PCS_NAD83_Wyoming_East"}, + {32156, "PCS_NAD83_Wyoming_E_Cen"}, + {32157, "PCS_NAD83_Wyoming_W_Cen"}, + {32158, "PCS_NAD83_Wyoming_West"}, + {32161, "PCS_NAD83_Puerto_Rico_Virgin_Is"}, + {32201, "PCS_WGS72_UTM_zone_1N"}, + {32202, "PCS_WGS72_UTM_zone_2N"}, + {32203, "PCS_WGS72_UTM_zone_3N"}, + {32204, "PCS_WGS72_UTM_zone_4N"}, + {32205, "PCS_WGS72_UTM_zone_5N"}, + {32206, "PCS_WGS72_UTM_zone_6N"}, + {32207, "PCS_WGS72_UTM_zone_7N"}, + {32208, "PCS_WGS72_UTM_zone_8N"}, + {32209, "PCS_WGS72_UTM_zone_9N"}, + {32210, "PCS_WGS72_UTM_zone_10N"}, + {32211, "PCS_WGS72_UTM_zone_11N"}, + {32212, "PCS_WGS72_UTM_zone_12N"}, + {32213, "PCS_WGS72_UTM_zone_13N"}, + {32214, "PCS_WGS72_UTM_zone_14N"}, + {32215, "PCS_WGS72_UTM_zone_15N"}, + {32216, "PCS_WGS72_UTM_zone_16N"}, + {32217, "PCS_WGS72_UTM_zone_17N"}, + {32218, "PCS_WGS72_UTM_zone_18N"}, + {32219, "PCS_WGS72_UTM_zone_19N"}, + {32220, "PCS_WGS72_UTM_zone_20N"}, + {32221, "PCS_WGS72_UTM_zone_21N"}, + {32222, "PCS_WGS72_UTM_zone_22N"}, + {32223, "PCS_WGS72_UTM_zone_23N"}, + {32224, "PCS_WGS72_UTM_zone_24N"}, + {32225, "PCS_WGS72_UTM_zone_25N"}, + {32226, "PCS_WGS72_UTM_zone_26N"}, + {32227, "PCS_WGS72_UTM_zone_27N"}, + {32228, "PCS_WGS72_UTM_zone_28N"}, + {32229, "PCS_WGS72_UTM_zone_29N"}, + {32230, "PCS_WGS72_UTM_zone_30N"}, + {32231, "PCS_WGS72_UTM_zone_31N"}, + {32232, "PCS_WGS72_UTM_zone_32N"}, + {32233, "PCS_WGS72_UTM_zone_33N"}, + {32234, "PCS_WGS72_UTM_zone_34N"}, + {32235, "PCS_WGS72_UTM_zone_35N"}, + {32236, "PCS_WGS72_UTM_zone_36N"}, + {32237, "PCS_WGS72_UTM_zone_37N"}, + {32238, "PCS_WGS72_UTM_zone_38N"}, + {32239, "PCS_WGS72_UTM_zone_39N"}, + {32240, "PCS_WGS72_UTM_zone_40N"}, + {32241, "PCS_WGS72_UTM_zone_41N"}, + {32242, "PCS_WGS72_UTM_zone_42N"}, + {32243, "PCS_WGS72_UTM_zone_43N"}, + {32244, "PCS_WGS72_UTM_zone_44N"}, + {32245, "PCS_WGS72_UTM_zone_45N"}, + {32246, "PCS_WGS72_UTM_zone_46N"}, + {32247, "PCS_WGS72_UTM_zone_47N"}, + {32248, "PCS_WGS72_UTM_zone_48N"}, + {32249, "PCS_WGS72_UTM_zone_49N"}, + {32250, "PCS_WGS72_UTM_zone_50N"}, + {32251, "PCS_WGS72_UTM_zone_51N"}, + {32252, "PCS_WGS72_UTM_zone_52N"}, + {32253, "PCS_WGS72_UTM_zone_53N"}, + {32254, "PCS_WGS72_UTM_zone_54N"}, + {32255, "PCS_WGS72_UTM_zone_55N"}, + {32256, "PCS_WGS72_UTM_zone_56N"}, + {32257, "PCS_WGS72_UTM_zone_57N"}, + {32258, "PCS_WGS72_UTM_zone_58N"}, + {32259, "PCS_WGS72_UTM_zone_59N"}, + {32260, "PCS_WGS72_UTM_zone_60N"}, + {32301, "PCS_WGS72_UTM_zone_1S"}, + {32302, "PCS_WGS72_UTM_zone_2S"}, + {32303, "PCS_WGS72_UTM_zone_3S"}, + {32304, "PCS_WGS72_UTM_zone_4S"}, + {32305, "PCS_WGS72_UTM_zone_5S"}, + {32306, "PCS_WGS72_UTM_zone_6S"}, + {32307, "PCS_WGS72_UTM_zone_7S"}, + {32308, "PCS_WGS72_UTM_zone_8S"}, + {32309, "PCS_WGS72_UTM_zone_9S"}, + {32310, "PCS_WGS72_UTM_zone_10S"}, + {32311, "PCS_WGS72_UTM_zone_11S"}, + {32312, "PCS_WGS72_UTM_zone_12S"}, + {32313, "PCS_WGS72_UTM_zone_13S"}, + {32314, "PCS_WGS72_UTM_zone_14S"}, + {32315, "PCS_WGS72_UTM_zone_15S"}, + {32316, "PCS_WGS72_UTM_zone_16S"}, + {32317, "PCS_WGS72_UTM_zone_17S"}, + {32318, "PCS_WGS72_UTM_zone_18S"}, + {32319, "PCS_WGS72_UTM_zone_19S"}, + {32320, "PCS_WGS72_UTM_zone_20S"}, + {32321, "PCS_WGS72_UTM_zone_21S"}, + {32322, "PCS_WGS72_UTM_zone_22S"}, + {32323, "PCS_WGS72_UTM_zone_23S"}, + {32324, "PCS_WGS72_UTM_zone_24S"}, + {32325, "PCS_WGS72_UTM_zone_25S"}, + {32326, "PCS_WGS72_UTM_zone_26S"}, + {32327, "PCS_WGS72_UTM_zone_27S"}, + {32328, "PCS_WGS72_UTM_zone_28S"}, + {32329, "PCS_WGS72_UTM_zone_29S"}, + {32330, "PCS_WGS72_UTM_zone_30S"}, + {32331, "PCS_WGS72_UTM_zone_31S"}, + {32332, "PCS_WGS72_UTM_zone_32S"}, + {32333, "PCS_WGS72_UTM_zone_33S"}, + {32334, "PCS_WGS72_UTM_zone_34S"}, + {32335, "PCS_WGS72_UTM_zone_35S"}, + {32336, "PCS_WGS72_UTM_zone_36S"}, + {32337, "PCS_WGS72_UTM_zone_37S"}, + {32338, "PCS_WGS72_UTM_zone_38S"}, + {32339, "PCS_WGS72_UTM_zone_39S"}, + {32340, "PCS_WGS72_UTM_zone_40S"}, + {32341, "PCS_WGS72_UTM_zone_41S"}, + {32342, "PCS_WGS72_UTM_zone_42S"}, + {32343, "PCS_WGS72_UTM_zone_43S"}, + {32344, "PCS_WGS72_UTM_zone_44S"}, + {32345, "PCS_WGS72_UTM_zone_45S"}, + {32346, "PCS_WGS72_UTM_zone_46S"}, + {32347, "PCS_WGS72_UTM_zone_47S"}, + {32348, "PCS_WGS72_UTM_zone_48S"}, + {32349, "PCS_WGS72_UTM_zone_49S"}, + {32350, "PCS_WGS72_UTM_zone_50S"}, + {32351, "PCS_WGS72_UTM_zone_51S"}, + {32352, "PCS_WGS72_UTM_zone_52S"}, + {32353, "PCS_WGS72_UTM_zone_53S"}, + {32354, "PCS_WGS72_UTM_zone_54S"}, + {32355, "PCS_WGS72_UTM_zone_55S"}, + {32356, "PCS_WGS72_UTM_zone_56S"}, + {32357, "PCS_WGS72_UTM_zone_57S"}, + {32358, "PCS_WGS72_UTM_zone_58S"}, + {32359, "PCS_WGS72_UTM_zone_59S"}, + {32360, "PCS_WGS72_UTM_zone_60S"}, + {32401, "PCS_WGS72BE_UTM_zone_1N"}, + {32402, "PCS_WGS72BE_UTM_zone_2N"}, + {32403, "PCS_WGS72BE_UTM_zone_3N"}, + {32404, "PCS_WGS72BE_UTM_zone_4N"}, + {32405, "PCS_WGS72BE_UTM_zone_5N"}, + {32406, "PCS_WGS72BE_UTM_zone_6N"}, + {32407, "PCS_WGS72BE_UTM_zone_7N"}, + {32408, "PCS_WGS72BE_UTM_zone_8N"}, + {32409, "PCS_WGS72BE_UTM_zone_9N"}, + {32410, "PCS_WGS72BE_UTM_zone_10N"}, + {32411, "PCS_WGS72BE_UTM_zone_11N"}, + {32412, "PCS_WGS72BE_UTM_zone_12N"}, + {32413, "PCS_WGS72BE_UTM_zone_13N"}, + {32414, "PCS_WGS72BE_UTM_zone_14N"}, + {32415, "PCS_WGS72BE_UTM_zone_15N"}, + {32416, "PCS_WGS72BE_UTM_zone_16N"}, + {32417, "PCS_WGS72BE_UTM_zone_17N"}, + {32418, "PCS_WGS72BE_UTM_zone_18N"}, + {32419, "PCS_WGS72BE_UTM_zone_19N"}, + {32420, "PCS_WGS72BE_UTM_zone_20N"}, + {32421, "PCS_WGS72BE_UTM_zone_21N"}, + {32422, "PCS_WGS72BE_UTM_zone_22N"}, + {32423, "PCS_WGS72BE_UTM_zone_23N"}, + {32424, "PCS_WGS72BE_UTM_zone_24N"}, + {32425, "PCS_WGS72BE_UTM_zone_25N"}, + {32426, "PCS_WGS72BE_UTM_zone_26N"}, + {32427, "PCS_WGS72BE_UTM_zone_27N"}, + {32428, "PCS_WGS72BE_UTM_zone_28N"}, + {32429, "PCS_WGS72BE_UTM_zone_29N"}, + {32430, "PCS_WGS72BE_UTM_zone_30N"}, + {32431, "PCS_WGS72BE_UTM_zone_31N"}, + {32432, "PCS_WGS72BE_UTM_zone_32N"}, + {32433, "PCS_WGS72BE_UTM_zone_33N"}, + {32434, "PCS_WGS72BE_UTM_zone_34N"}, + {32435, "PCS_WGS72BE_UTM_zone_35N"}, + {32436, "PCS_WGS72BE_UTM_zone_36N"}, + {32437, "PCS_WGS72BE_UTM_zone_37N"}, + {32438, "PCS_WGS72BE_UTM_zone_38N"}, + {32439, "PCS_WGS72BE_UTM_zone_39N"}, + {32440, "PCS_WGS72BE_UTM_zone_40N"}, + {32441, "PCS_WGS72BE_UTM_zone_41N"}, + {32442, "PCS_WGS72BE_UTM_zone_42N"}, + {32443, "PCS_WGS72BE_UTM_zone_43N"}, + {32444, "PCS_WGS72BE_UTM_zone_44N"}, + {32445, "PCS_WGS72BE_UTM_zone_45N"}, + {32446, "PCS_WGS72BE_UTM_zone_46N"}, + {32447, "PCS_WGS72BE_UTM_zone_47N"}, + {32448, "PCS_WGS72BE_UTM_zone_48N"}, + {32449, "PCS_WGS72BE_UTM_zone_49N"}, + {32450, "PCS_WGS72BE_UTM_zone_50N"}, + {32451, "PCS_WGS72BE_UTM_zone_51N"}, + {32452, "PCS_WGS72BE_UTM_zone_52N"}, + {32453, "PCS_WGS72BE_UTM_zone_53N"}, + {32454, "PCS_WGS72BE_UTM_zone_54N"}, + {32455, "PCS_WGS72BE_UTM_zone_55N"}, + {32456, "PCS_WGS72BE_UTM_zone_56N"}, + {32457, "PCS_WGS72BE_UTM_zone_57N"}, + {32458, "PCS_WGS72BE_UTM_zone_58N"}, + {32459, "PCS_WGS72BE_UTM_zone_59N"}, + {32460, "PCS_WGS72BE_UTM_zone_60N"}, + {32501, "PCS_WGS72BE_UTM_zone_1S"}, + {32502, "PCS_WGS72BE_UTM_zone_2S"}, + {32503, "PCS_WGS72BE_UTM_zone_3S"}, + {32504, "PCS_WGS72BE_UTM_zone_4S"}, + {32505, "PCS_WGS72BE_UTM_zone_5S"}, + {32506, "PCS_WGS72BE_UTM_zone_6S"}, + {32507, "PCS_WGS72BE_UTM_zone_7S"}, + {32508, "PCS_WGS72BE_UTM_zone_8S"}, + {32509, "PCS_WGS72BE_UTM_zone_9S"}, + {32510, "PCS_WGS72BE_UTM_zone_10S"}, + {32511, "PCS_WGS72BE_UTM_zone_11S"}, + {32512, "PCS_WGS72BE_UTM_zone_12S"}, + {32513, "PCS_WGS72BE_UTM_zone_13S"}, + {32514, "PCS_WGS72BE_UTM_zone_14S"}, + {32515, "PCS_WGS72BE_UTM_zone_15S"}, + {32516, "PCS_WGS72BE_UTM_zone_16S"}, + {32517, "PCS_WGS72BE_UTM_zone_17S"}, + {32518, "PCS_WGS72BE_UTM_zone_18S"}, + {32519, "PCS_WGS72BE_UTM_zone_19S"}, + {32520, "PCS_WGS72BE_UTM_zone_20S"}, + {32521, "PCS_WGS72BE_UTM_zone_21S"}, + {32522, "PCS_WGS72BE_UTM_zone_22S"}, + {32523, "PCS_WGS72BE_UTM_zone_23S"}, + {32524, "PCS_WGS72BE_UTM_zone_24S"}, + {32525, "PCS_WGS72BE_UTM_zone_25S"}, + {32526, "PCS_WGS72BE_UTM_zone_26S"}, + {32527, "PCS_WGS72BE_UTM_zone_27S"}, + {32528, "PCS_WGS72BE_UTM_zone_28S"}, + {32529, "PCS_WGS72BE_UTM_zone_29S"}, + {32530, "PCS_WGS72BE_UTM_zone_30S"}, + {32531, "PCS_WGS72BE_UTM_zone_31S"}, + {32532, "PCS_WGS72BE_UTM_zone_32S"}, + {32533, "PCS_WGS72BE_UTM_zone_33S"}, + {32534, "PCS_WGS72BE_UTM_zone_34S"}, + {32535, "PCS_WGS72BE_UTM_zone_35S"}, + {32536, "PCS_WGS72BE_UTM_zone_36S"}, + {32537, "PCS_WGS72BE_UTM_zone_37S"}, + {32538, "PCS_WGS72BE_UTM_zone_38S"}, + {32539, "PCS_WGS72BE_UTM_zone_39S"}, + {32540, "PCS_WGS72BE_UTM_zone_40S"}, + {32541, "PCS_WGS72BE_UTM_zone_41S"}, + {32542, "PCS_WGS72BE_UTM_zone_42S"}, + {32543, "PCS_WGS72BE_UTM_zone_43S"}, + {32544, "PCS_WGS72BE_UTM_zone_44S"}, + {32545, "PCS_WGS72BE_UTM_zone_45S"}, + {32546, "PCS_WGS72BE_UTM_zone_46S"}, + {32547, "PCS_WGS72BE_UTM_zone_47S"}, + {32548, "PCS_WGS72BE_UTM_zone_48S"}, + {32549, "PCS_WGS72BE_UTM_zone_49S"}, + {32550, "PCS_WGS72BE_UTM_zone_50S"}, + {32551, "PCS_WGS72BE_UTM_zone_51S"}, + {32552, "PCS_WGS72BE_UTM_zone_52S"}, + {32553, "PCS_WGS72BE_UTM_zone_53S"}, + {32554, "PCS_WGS72BE_UTM_zone_54S"}, + {32555, "PCS_WGS72BE_UTM_zone_55S"}, + {32556, "PCS_WGS72BE_UTM_zone_56S"}, + {32557, "PCS_WGS72BE_UTM_zone_57S"}, + {32558, "PCS_WGS72BE_UTM_zone_58S"}, + {32559, "PCS_WGS72BE_UTM_zone_59S"}, + {32560, "PCS_WGS72BE_UTM_zone_60S"}, + {32601, "PCS_WGS84_UTM_zone_1N"}, + {32602, "PCS_WGS84_UTM_zone_2N"}, + {32603, "PCS_WGS84_UTM_zone_3N"}, + {32604, "PCS_WGS84_UTM_zone_4N"}, + {32605, "PCS_WGS84_UTM_zone_5N"}, + {32606, "PCS_WGS84_UTM_zone_6N"}, + {32607, "PCS_WGS84_UTM_zone_7N"}, + {32608, "PCS_WGS84_UTM_zone_8N"}, + {32609, "PCS_WGS84_UTM_zone_9N"}, + {32610, "PCS_WGS84_UTM_zone_10N"}, + {32611, "PCS_WGS84_UTM_zone_11N"}, + {32612, "PCS_WGS84_UTM_zone_12N"}, + {32613, "PCS_WGS84_UTM_zone_13N"}, + {32614, "PCS_WGS84_UTM_zone_14N"}, + {32615, "PCS_WGS84_UTM_zone_15N"}, + {32616, "PCS_WGS84_UTM_zone_16N"}, + {32617, "PCS_WGS84_UTM_zone_17N"}, + {32618, "PCS_WGS84_UTM_zone_18N"}, + {32619, "PCS_WGS84_UTM_zone_19N"}, + {32620, "PCS_WGS84_UTM_zone_20N"}, + {32621, "PCS_WGS84_UTM_zone_21N"}, + {32622, "PCS_WGS84_UTM_zone_22N"}, + {32623, "PCS_WGS84_UTM_zone_23N"}, + {32624, "PCS_WGS84_UTM_zone_24N"}, + {32625, "PCS_WGS84_UTM_zone_25N"}, + {32626, "PCS_WGS84_UTM_zone_26N"}, + {32627, "PCS_WGS84_UTM_zone_27N"}, + {32628, "PCS_WGS84_UTM_zone_28N"}, + {32629, "PCS_WGS84_UTM_zone_29N"}, + {32630, "PCS_WGS84_UTM_zone_30N"}, + {32631, "PCS_WGS84_UTM_zone_31N"}, + {32632, "PCS_WGS84_UTM_zone_32N"}, + {32633, "PCS_WGS84_UTM_zone_33N"}, + {32634, "PCS_WGS84_UTM_zone_34N"}, + {32635, "PCS_WGS84_UTM_zone_35N"}, + {32636, "PCS_WGS84_UTM_zone_36N"}, + {32637, "PCS_WGS84_UTM_zone_37N"}, + {32638, "PCS_WGS84_UTM_zone_38N"}, + {32639, "PCS_WGS84_UTM_zone_39N"}, + {32640, "PCS_WGS84_UTM_zone_40N"}, + {32641, "PCS_WGS84_UTM_zone_41N"}, + {32642, "PCS_WGS84_UTM_zone_42N"}, + {32643, "PCS_WGS84_UTM_zone_43N"}, + {32644, "PCS_WGS84_UTM_zone_44N"}, + {32645, "PCS_WGS84_UTM_zone_45N"}, + {32646, "PCS_WGS84_UTM_zone_46N"}, + {32647, "PCS_WGS84_UTM_zone_47N"}, + {32648, "PCS_WGS84_UTM_zone_48N"}, + {32649, "PCS_WGS84_UTM_zone_49N"}, + {32650, "PCS_WGS84_UTM_zone_50N"}, + {32651, "PCS_WGS84_UTM_zone_51N"}, + {32652, "PCS_WGS84_UTM_zone_52N"}, + {32653, "PCS_WGS84_UTM_zone_53N"}, + {32654, "PCS_WGS84_UTM_zone_54N"}, + {32655, "PCS_WGS84_UTM_zone_55N"}, + {32656, "PCS_WGS84_UTM_zone_56N"}, + {32657, "PCS_WGS84_UTM_zone_57N"}, + {32658, "PCS_WGS84_UTM_zone_58N"}, + {32659, "PCS_WGS84_UTM_zone_59N"}, + {32660, "PCS_WGS84_UTM_zone_60N"}, + {32701, "PCS_WGS84_UTM_zone_1S"}, + {32702, "PCS_WGS84_UTM_zone_2S"}, + {32703, "PCS_WGS84_UTM_zone_3S"}, + {32704, "PCS_WGS84_UTM_zone_4S"}, + {32705, "PCS_WGS84_UTM_zone_5S"}, + {32706, "PCS_WGS84_UTM_zone_6S"}, + {32707, "PCS_WGS84_UTM_zone_7S"}, + {32708, "PCS_WGS84_UTM_zone_8S"}, + {32709, "PCS_WGS84_UTM_zone_9S"}, + {32710, "PCS_WGS84_UTM_zone_10S"}, + {32711, "PCS_WGS84_UTM_zone_11S"}, + {32712, "PCS_WGS84_UTM_zone_12S"}, + {32713, "PCS_WGS84_UTM_zone_13S"}, + {32714, "PCS_WGS84_UTM_zone_14S"}, + {32715, "PCS_WGS84_UTM_zone_15S"}, + {32716, "PCS_WGS84_UTM_zone_16S"}, + {32717, "PCS_WGS84_UTM_zone_17S"}, + {32718, "PCS_WGS84_UTM_zone_18S"}, + {32719, "PCS_WGS84_UTM_zone_19S"}, + {32720, "PCS_WGS84_UTM_zone_20S"}, + {32721, "PCS_WGS84_UTM_zone_21S"}, + {32722, "PCS_WGS84_UTM_zone_22S"}, + {32723, "PCS_WGS84_UTM_zone_23S"}, + {32724, "PCS_WGS84_UTM_zone_24S"}, + {32725, "PCS_WGS84_UTM_zone_25S"}, + {32726, "PCS_WGS84_UTM_zone_26S"}, + {32727, "PCS_WGS84_UTM_zone_27S"}, + {32728, "PCS_WGS84_UTM_zone_28S"}, + {32729, "PCS_WGS84_UTM_zone_29S"}, + {32730, "PCS_WGS84_UTM_zone_30S"}, + {32731, "PCS_WGS84_UTM_zone_31S"}, + {32732, "PCS_WGS84_UTM_zone_32S"}, + {32733, "PCS_WGS84_UTM_zone_33S"}, + {32734, "PCS_WGS84_UTM_zone_34S"}, + {32735, "PCS_WGS84_UTM_zone_35S"}, + {32736, "PCS_WGS84_UTM_zone_36S"}, + {32737, "PCS_WGS84_UTM_zone_37S"}, + {32738, "PCS_WGS84_UTM_zone_38S"}, + {32739, "PCS_WGS84_UTM_zone_39S"}, + {32740, "PCS_WGS84_UTM_zone_40S"}, + {32741, "PCS_WGS84_UTM_zone_41S"}, + {32742, "PCS_WGS84_UTM_zone_42S"}, + {32743, "PCS_WGS84_UTM_zone_43S"}, + {32744, "PCS_WGS84_UTM_zone_44S"}, + {32745, "PCS_WGS84_UTM_zone_45S"}, + {32746, "PCS_WGS84_UTM_zone_46S"}, + {32747, "PCS_WGS84_UTM_zone_47S"}, + {32748, "PCS_WGS84_UTM_zone_48S"}, + {32749, "PCS_WGS84_UTM_zone_49S"}, + {32750, "PCS_WGS84_UTM_zone_50S"}, + {32751, "PCS_WGS84_UTM_zone_51S"}, + {32752, "PCS_WGS84_UTM_zone_52S"}, + {32753, "PCS_WGS84_UTM_zone_53S"}, + {32754, "PCS_WGS84_UTM_zone_54S"}, + {32755, "PCS_WGS84_UTM_zone_55S"}, + {32756, "PCS_WGS84_UTM_zone_56S"}, + {32757, "PCS_WGS84_UTM_zone_57S"}, + {32758, "PCS_WGS84_UTM_zone_58S"}, + {32759, "PCS_WGS84_UTM_zone_59S"}, + {32760, "PCS_WGS84_UTM_zone_60S"} +}; + +static const TiffGeoTagKeyName tiff_projection_codes[] = { + {10101, "Proj_Alabama_CS27_East"}, + {10102, "Proj_Alabama_CS27_West"}, + {10131, "Proj_Alabama_CS83_East"}, + {10132, "Proj_Alabama_CS83_West"}, + {10201, "Proj_Arizona_Coordinate_System_east"}, + {10202, "Proj_Arizona_Coordinate_System_Central"}, + {10203, "Proj_Arizona_Coordinate_System_west"}, + {10231, "Proj_Arizona_CS83_east"}, + {10232, "Proj_Arizona_CS83_Central"}, + {10233, "Proj_Arizona_CS83_west"}, + {10301, "Proj_Arkansas_CS27_North"}, + {10302, "Proj_Arkansas_CS27_South"}, + {10331, "Proj_Arkansas_CS83_North"}, + {10332, "Proj_Arkansas_CS83_South"}, + {10401, "Proj_California_CS27_I"}, + {10402, "Proj_California_CS27_II"}, + {10403, "Proj_California_CS27_III"}, + {10404, "Proj_California_CS27_IV"}, + {10405, "Proj_California_CS27_V"}, + {10406, "Proj_California_CS27_VI"}, + {10407, "Proj_California_CS27_VII"}, + {10431, "Proj_California_CS83_1"}, + {10432, "Proj_California_CS83_2"}, + {10433, "Proj_California_CS83_3"}, + {10434, "Proj_California_CS83_4"}, + {10435, "Proj_California_CS83_5"}, + {10436, "Proj_California_CS83_6"}, + {10501, "Proj_Colorado_CS27_North"}, + {10502, "Proj_Colorado_CS27_Central"}, + {10503, "Proj_Colorado_CS27_South"}, + {10531, "Proj_Colorado_CS83_North"}, + {10532, "Proj_Colorado_CS83_Central"}, + {10533, "Proj_Colorado_CS83_South"}, + {10600, "Proj_Connecticut_CS27"}, + {10630, "Proj_Connecticut_CS83"}, + {10700, "Proj_Delaware_CS27"}, + {10730, "Proj_Delaware_CS83"}, + {10901, "Proj_Florida_CS27_East"}, + {10902, "Proj_Florida_CS27_West"}, + {10903, "Proj_Florida_CS27_North"}, + {10931, "Proj_Florida_CS83_East"}, + {10932, "Proj_Florida_CS83_West"}, + {10933, "Proj_Florida_CS83_North"}, + {11001, "Proj_Georgia_CS27_East"}, + {11002, "Proj_Georgia_CS27_West"}, + {11031, "Proj_Georgia_CS83_East"}, + {11032, "Proj_Georgia_CS83_West"}, + {11101, "Proj_Idaho_CS27_East"}, + {11102, "Proj_Idaho_CS27_Central"}, + {11103, "Proj_Idaho_CS27_West"}, + {11131, "Proj_Idaho_CS83_East"}, + {11132, "Proj_Idaho_CS83_Central"}, + {11133, "Proj_Idaho_CS83_West"}, + {11201, "Proj_Illinois_CS27_East"}, + {11202, "Proj_Illinois_CS27_West"}, + {11231, "Proj_Illinois_CS83_East"}, + {11232, "Proj_Illinois_CS83_West"}, + {11301, "Proj_Indiana_CS27_East"}, + {11302, "Proj_Indiana_CS27_West"}, + {11331, "Proj_Indiana_CS83_East"}, + {11332, "Proj_Indiana_CS83_West"}, + {11401, "Proj_Iowa_CS27_North"}, + {11402, "Proj_Iowa_CS27_South"}, + {11431, "Proj_Iowa_CS83_North"}, + {11432, "Proj_Iowa_CS83_South"}, + {11501, "Proj_Kansas_CS27_North"}, + {11502, "Proj_Kansas_CS27_South"}, + {11531, "Proj_Kansas_CS83_North"}, + {11532, "Proj_Kansas_CS83_South"}, + {11601, "Proj_Kentucky_CS27_North"}, + {11602, "Proj_Kentucky_CS27_South"}, + {11631, "Proj_Kentucky_CS83_North"}, + {11632, "Proj_Kentucky_CS83_South"}, + {11701, "Proj_Louisiana_CS27_North"}, + {11702, "Proj_Louisiana_CS27_South"}, + {11731, "Proj_Louisiana_CS83_North"}, + {11732, "Proj_Louisiana_CS83_South"}, + {11801, "Proj_Maine_CS27_East"}, + {11802, "Proj_Maine_CS27_West"}, + {11831, "Proj_Maine_CS83_East"}, + {11832, "Proj_Maine_CS83_West"}, + {11900, "Proj_Maryland_CS27"}, + {11930, "Proj_Maryland_CS83"}, + {12001, "Proj_Massachusetts_CS27_Mainland"}, + {12002, "Proj_Massachusetts_CS27_Island"}, + {12031, "Proj_Massachusetts_CS83_Mainland"}, + {12032, "Proj_Massachusetts_CS83_Island"}, + {12101, "Proj_Michigan_State_Plane_East"}, + {12102, "Proj_Michigan_State_Plane_Old_Central"}, + {12103, "Proj_Michigan_State_Plane_West"}, + {12111, "Proj_Michigan_CS27_North"}, + {12112, "Proj_Michigan_CS27_Central"}, + {12113, "Proj_Michigan_CS27_South"}, + {12141, "Proj_Michigan_CS83_North"}, + {12142, "Proj_Michigan_CS83_Central"}, + {12143, "Proj_Michigan_CS83_South"}, + {12201, "Proj_Minnesota_CS27_North"}, + {12202, "Proj_Minnesota_CS27_Central"}, + {12203, "Proj_Minnesota_CS27_South"}, + {12231, "Proj_Minnesota_CS83_North"}, + {12232, "Proj_Minnesota_CS83_Central"}, + {12233, "Proj_Minnesota_CS83_South"}, + {12301, "Proj_Mississippi_CS27_East"}, + {12302, "Proj_Mississippi_CS27_West"}, + {12331, "Proj_Mississippi_CS83_East"}, + {12332, "Proj_Mississippi_CS83_West"}, + {12401, "Proj_Missouri_CS27_East"}, + {12402, "Proj_Missouri_CS27_Central"}, + {12403, "Proj_Missouri_CS27_West"}, + {12431, "Proj_Missouri_CS83_East"}, + {12432, "Proj_Missouri_CS83_Central"}, + {12433, "Proj_Missouri_CS83_West"}, + {12501, "Proj_Montana_CS27_North"}, + {12502, "Proj_Montana_CS27_Central"}, + {12503, "Proj_Montana_CS27_South"}, + {12530, "Proj_Montana_CS83"}, + {12601, "Proj_Nebraska_CS27_North"}, + {12602, "Proj_Nebraska_CS27_South"}, + {12630, "Proj_Nebraska_CS83"}, + {12701, "Proj_Nevada_CS27_East"}, + {12702, "Proj_Nevada_CS27_Central"}, + {12703, "Proj_Nevada_CS27_West"}, + {12731, "Proj_Nevada_CS83_East"}, + {12732, "Proj_Nevada_CS83_Central"}, + {12733, "Proj_Nevada_CS83_West"}, + {12800, "Proj_New_Hampshire_CS27"}, + {12830, "Proj_New_Hampshire_CS83"}, + {12900, "Proj_New_Jersey_CS27"}, + {12930, "Proj_New_Jersey_CS83"}, + {13001, "Proj_New_Mexico_CS27_East"}, + {13002, "Proj_New_Mexico_CS27_Central"}, + {13003, "Proj_New_Mexico_CS27_West"}, + {13031, "Proj_New_Mexico_CS83_East"}, + {13032, "Proj_New_Mexico_CS83_Central"}, + {13033, "Proj_New_Mexico_CS83_West"}, + {13101, "Proj_New_York_CS27_East"}, + {13102, "Proj_New_York_CS27_Central"}, + {13103, "Proj_New_York_CS27_West"}, + {13104, "Proj_New_York_CS27_Long_Island"}, + {13131, "Proj_New_York_CS83_East"}, + {13132, "Proj_New_York_CS83_Central"}, + {13133, "Proj_New_York_CS83_West"}, + {13134, "Proj_New_York_CS83_Long_Island"}, + {13200, "Proj_North_Carolina_CS27"}, + {13230, "Proj_North_Carolina_CS83"}, + {13301, "Proj_North_Dakota_CS27_North"}, + {13302, "Proj_North_Dakota_CS27_South"}, + {13331, "Proj_North_Dakota_CS83_North"}, + {13332, "Proj_North_Dakota_CS83_South"}, + {13401, "Proj_Ohio_CS27_North"}, + {13402, "Proj_Ohio_CS27_South"}, + {13431, "Proj_Ohio_CS83_North"}, + {13432, "Proj_Ohio_CS83_South"}, + {13501, "Proj_Oklahoma_CS27_North"}, + {13502, "Proj_Oklahoma_CS27_South"}, + {13531, "Proj_Oklahoma_CS83_North"}, + {13532, "Proj_Oklahoma_CS83_South"}, + {13601, "Proj_Oregon_CS27_North"}, + {13602, "Proj_Oregon_CS27_South"}, + {13631, "Proj_Oregon_CS83_North"}, + {13632, "Proj_Oregon_CS83_South"}, + {13701, "Proj_Pennsylvania_CS27_North"}, + {13702, "Proj_Pennsylvania_CS27_South"}, + {13731, "Proj_Pennsylvania_CS83_North"}, + {13732, "Proj_Pennsylvania_CS83_South"}, + {13800, "Proj_Rhode_Island_CS27"}, + {13830, "Proj_Rhode_Island_CS83"}, + {13901, "Proj_South_Carolina_CS27_North"}, + {13902, "Proj_South_Carolina_CS27_South"}, + {13930, "Proj_South_Carolina_CS83"}, + {14001, "Proj_South_Dakota_CS27_North"}, + {14002, "Proj_South_Dakota_CS27_South"}, + {14031, "Proj_South_Dakota_CS83_North"}, + {14032, "Proj_South_Dakota_CS83_South"}, + {14100, "Proj_Tennessee_CS27"}, + {14130, "Proj_Tennessee_CS83"}, + {14201, "Proj_Texas_CS27_North"}, + {14202, "Proj_Texas_CS27_North_Central"}, + {14203, "Proj_Texas_CS27_Central"}, + {14204, "Proj_Texas_CS27_South_Central"}, + {14205, "Proj_Texas_CS27_South"}, + {14231, "Proj_Texas_CS83_North"}, + {14232, "Proj_Texas_CS83_North_Central"}, + {14233, "Proj_Texas_CS83_Central"}, + {14234, "Proj_Texas_CS83_South_Central"}, + {14235, "Proj_Texas_CS83_South"}, + {14301, "Proj_Utah_CS27_North"}, + {14302, "Proj_Utah_CS27_Central"}, + {14303, "Proj_Utah_CS27_South"}, + {14331, "Proj_Utah_CS83_North"}, + {14332, "Proj_Utah_CS83_Central"}, + {14333, "Proj_Utah_CS83_South"}, + {14400, "Proj_Vermont_CS27"}, + {14430, "Proj_Vermont_CS83"}, + {14501, "Proj_Virginia_CS27_North"}, + {14502, "Proj_Virginia_CS27_South"}, + {14531, "Proj_Virginia_CS83_North"}, + {14532, "Proj_Virginia_CS83_South"}, + {14601, "Proj_Washington_CS27_North"}, + {14602, "Proj_Washington_CS27_South"}, + {14631, "Proj_Washington_CS83_North"}, + {14632, "Proj_Washington_CS83_South"}, + {14701, "Proj_West_Virginia_CS27_North"}, + {14702, "Proj_West_Virginia_CS27_South"}, + {14731, "Proj_West_Virginia_CS83_North"}, + {14732, "Proj_West_Virginia_CS83_South"}, + {14801, "Proj_Wisconsin_CS27_North"}, + {14802, "Proj_Wisconsin_CS27_Central"}, + {14803, "Proj_Wisconsin_CS27_South"}, + {14831, "Proj_Wisconsin_CS83_North"}, + {14832, "Proj_Wisconsin_CS83_Central"}, + {14833, "Proj_Wisconsin_CS83_South"}, + {14901, "Proj_Wyoming_CS27_East"}, + {14902, "Proj_Wyoming_CS27_East_Central"}, + {14903, "Proj_Wyoming_CS27_West_Central"}, + {14904, "Proj_Wyoming_CS27_West"}, + {14931, "Proj_Wyoming_CS83_East"}, + {14932, "Proj_Wyoming_CS83_East_Central"}, + {14933, "Proj_Wyoming_CS83_West_Central"}, + {14934, "Proj_Wyoming_CS83_West"}, + {15001, "Proj_Alaska_CS27_1"}, + {15002, "Proj_Alaska_CS27_2"}, + {15003, "Proj_Alaska_CS27_3"}, + {15004, "Proj_Alaska_CS27_4"}, + {15005, "Proj_Alaska_CS27_5"}, + {15006, "Proj_Alaska_CS27_6"}, + {15007, "Proj_Alaska_CS27_7"}, + {15008, "Proj_Alaska_CS27_8"}, + {15009, "Proj_Alaska_CS27_9"}, + {15010, "Proj_Alaska_CS27_10"}, + {15031, "Proj_Alaska_CS83_1"}, + {15032, "Proj_Alaska_CS83_2"}, + {15033, "Proj_Alaska_CS83_3"}, + {15034, "Proj_Alaska_CS83_4"}, + {15035, "Proj_Alaska_CS83_5"}, + {15036, "Proj_Alaska_CS83_6"}, + {15037, "Proj_Alaska_CS83_7"}, + {15038, "Proj_Alaska_CS83_8"}, + {15039, "Proj_Alaska_CS83_9"}, + {15040, "Proj_Alaska_CS83_10"}, + {15101, "Proj_Hawaii_CS27_1"}, + {15102, "Proj_Hawaii_CS27_2"}, + {15103, "Proj_Hawaii_CS27_3"}, + {15104, "Proj_Hawaii_CS27_4"}, + {15105, "Proj_Hawaii_CS27_5"}, + {15131, "Proj_Hawaii_CS83_1"}, + {15132, "Proj_Hawaii_CS83_2"}, + {15133, "Proj_Hawaii_CS83_3"}, + {15134, "Proj_Hawaii_CS83_4"}, + {15135, "Proj_Hawaii_CS83_5"}, + {15201, "Proj_Puerto_Rico_CS27"}, + {15202, "Proj_St_Croix"}, + {15230, "Proj_Puerto_Rico_Virgin_Is"}, + {15914, "Proj_BLM_14N_feet"}, + {15915, "Proj_BLM_15N_feet"}, + {15916, "Proj_BLM_16N_feet"}, + {15917, "Proj_BLM_17N_feet"}, + {17348, "Proj_Map_Grid_of_Australia_48"}, + {17349, "Proj_Map_Grid_of_Australia_49"}, + {17350, "Proj_Map_Grid_of_Australia_50"}, + {17351, "Proj_Map_Grid_of_Australia_51"}, + {17352, "Proj_Map_Grid_of_Australia_52"}, + {17353, "Proj_Map_Grid_of_Australia_53"}, + {17354, "Proj_Map_Grid_of_Australia_54"}, + {17355, "Proj_Map_Grid_of_Australia_55"}, + {17356, "Proj_Map_Grid_of_Australia_56"}, + {17357, "Proj_Map_Grid_of_Australia_57"}, + {17358, "Proj_Map_Grid_of_Australia_58"}, + {17448, "Proj_Australian_Map_Grid_48"}, + {17449, "Proj_Australian_Map_Grid_49"}, + {17450, "Proj_Australian_Map_Grid_50"}, + {17451, "Proj_Australian_Map_Grid_51"}, + {17452, "Proj_Australian_Map_Grid_52"}, + {17453, "Proj_Australian_Map_Grid_53"}, + {17454, "Proj_Australian_Map_Grid_54"}, + {17455, "Proj_Australian_Map_Grid_55"}, + {17456, "Proj_Australian_Map_Grid_56"}, + {17457, "Proj_Australian_Map_Grid_57"}, + {17458, "Proj_Australian_Map_Grid_58"}, + {18031, "Proj_Argentina_1"}, + {18032, "Proj_Argentina_2"}, + {18033, "Proj_Argentina_3"}, + {18034, "Proj_Argentina_4"}, + {18035, "Proj_Argentina_5"}, + {18036, "Proj_Argentina_6"}, + {18037, "Proj_Argentina_7"}, + {18051, "Proj_Colombia_3W"}, + {18052, "Proj_Colombia_Bogota"}, + {18053, "Proj_Colombia_3E"}, + {18054, "Proj_Colombia_6E"}, + {18072, "Proj_Egypt_Red_Belt"}, + {18073, "Proj_Egypt_Purple_Belt"}, + {18074, "Proj_Extended_Purple_Belt"}, + {18141, "Proj_New_Zealand_North_Island_Nat_Grid"}, + {18142, "Proj_New_Zealand_South_Island_Nat_Grid"}, + {19900, "Proj_Bahrain_Grid"}, + {19905, "Proj_Netherlands_E_Indies_Equatorial"}, + {19912, "Proj_RSO_Borneo"} +}; + +#define TIFF_COORD_TRANS_OFFSET 1 +static const char *const tiff_coord_trans_codes[] = { + "CT_TransverseMercator", + "CT_TransvMercator_Modified_Alaska", + "CT_ObliqueMercator", + "CT_ObliqueMercator_Laborde", + "CT_ObliqueMercator_Rosenmund", + "CT_ObliqueMercator_Spherical", + "CT_Mercator", + "CT_LambertConfConic_2SP", + "CT_LambertConfConic_Helmert", + "CT_LambertAzimEqualArea", + "CT_AlbersEqualArea", + "CT_AzimuthalEquidistant", + "CT_EquidistantConic", + "CT_Stereographic", + "CT_PolarStereographic", + "CT_ObliqueStereographic", + "CT_Equirectangular", + "CT_CassiniSoldner", + "CT_Gnomonic", + "CT_MillerCylindrical", + "CT_Orthographic", + "CT_Polyconic", + "CT_Robinson", + "CT_Sinusoidal", + "CT_VanDerGrinten", + "CT_NewZealandMapGrid", + "CT_TransvMercator_SouthOriented" +}; + +#define TIFF_VERT_CS_OFFSET 5001 +static const char *const tiff_vert_cs_codes[] = { + "VertCS_Airy_1830_ellipsoid", + "VertCS_Airy_Modified_1849_ellipsoid", + "VertCS_ANS_ellipsoid", + "VertCS_Bessel_1841_ellipsoid", + "VertCS_Bessel_Modified_ellipsoid", + "VertCS_Bessel_Namibia_ellipsoid", + "VertCS_Clarke_1858_ellipsoid", + "VertCS_Clarke_1866_ellipsoid", + "VertCS_Clarke_1880_Benoit_ellipsoid", + "VertCS_Clarke_1880_IGN_ellipsoid", + "VertCS_Clarke_1880_RGS_ellipsoid", + "VertCS_Clarke_1880_Arc_ellipsoid", + "VertCS_Clarke_1880_SGA_1922_ellipsoid", + "VertCS_Everest_1830_1937_Adjustment_ellipsoid", + "VertCS_Everest_1830_1967_Definition_ellipsoid", + "VertCS_Everest_1830_1975_Definition_ellipsoid", + "VertCS_Everest_1830_Modified_ellipsoid", + "VertCS_GRS_1980_ellipsoid", + "VertCS_Helmert_1906_ellipsoid", + "VertCS_INS_ellipsoid", + "VertCS_International_1924_ellipsoid", + "VertCS_International_1967_ellipsoid", + "VertCS_Krassowsky_1940_ellipsoid", + "VertCS_NWL_9D_ellipsoid", + "VertCS_NWL_10D_ellipsoid", + "VertCS_Plessis_1817_ellipsoid", + "VertCS_Struve_1860_ellipsoid", + "VertCS_War_Office_ellipsoid", + "VertCS_WGS_84_ellipsoid", + "VertCS_GEM_10C_ellipsoid", + "VertCS_OSU86F_ellipsoid", + "VertCS_OSU91A_ellipsoid" +}; + +#define TIFF_ORTHO_VERT_CS_OFFSET 5101 +static const char *const tiff_ortho_vert_cs_codes[] = { + "VertCS_Newlyn", + "VertCS_North_American_Vertical_Datum_1929", + "VertCS_North_American_Vertical_Datum_1988", + "VertCS_Yellow_Sea_1956", + "VertCS_Baltic_Sea", + "VertCS_Caspian_Sea" +}; + +#endif diff --git a/include/libavcodec/to_upper4.h b/include/libavcodec/to_upper4.h new file mode 100644 index 0000000..d9648b5 --- /dev/null +++ b/include/libavcodec/to_upper4.h @@ -0,0 +1,37 @@ +/* + * Converting FOURCCs to uppercase + * Copyright (c) 2001 Fabrice Bellard + * Copyright (c) 2002-2004 Michael Niedermayer + * + * 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_TO_UPPER4_H +#define AVCODEC_TO_UPPER4_H + +#include "libavutil/avstring.h" +#include "internal.h" + +unsigned int ff_toupper4(unsigned int x) +{ + return av_toupper(x & 0xFF) | + (av_toupper((x >> 8) & 0xFF) << 8) | + (av_toupper((x >> 16) & 0xFF) << 16) | +((unsigned)av_toupper((x >> 24) & 0xFF) << 24); +} + +#endif diff --git a/include/libavcodec/tpeldsp.h b/include/libavcodec/tpeldsp.h new file mode 100644 index 0000000..3732f17 --- /dev/null +++ b/include/libavcodec/tpeldsp.h @@ -0,0 +1,59 @@ +/* + * thirdpel DSP functions + * + * 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 + */ + +/** + * @file + * thirdpel DSP functions + */ + +#ifndef AVCODEC_TPELDSP_H +#define AVCODEC_TPELDSP_H + +#include + +/* add and put pixel (decoding) */ +// blocksizes for hpel_pixels_func are 8x4,8x8 16x8 16x16 +// h for hpel_pixels_func is limited to {width/2, width} but never larger +// than 16 and never smaller than 4 +typedef void (*tpel_mc_func)(uint8_t *block /* align width (8 or 16) */, + const uint8_t *pixels /* align 1 */, + int line_size, int w, int h); + +/** + * thirdpel DSP context + */ +typedef struct TpelDSPContext { + /** + * Thirdpel motion compensation with rounding (a + b + 1) >> 1. + * this is an array[12] of motion compensation functions for the + * 9 thirdpel positions
+ * *pixels_tab[xthirdpel + 4 * ythirdpel] + * @param block destination where the result is stored + * @param pixels source + * @param line_size number of bytes in a horizontal line of block + * @param h height + */ + tpel_mc_func put_tpel_pixels_tab[11]; // FIXME individual func ptr per width? + tpel_mc_func avg_tpel_pixels_tab[11]; // FIXME individual func ptr per width? +} TpelDSPContext; + +void ff_tpeldsp_init(TpelDSPContext *c); + +#endif /* AVCODEC_TPELDSP_H */ diff --git a/include/libavcodec/truemotion1data.h b/include/libavcodec/truemotion1data.h new file mode 100644 index 0000000..3e58143 --- /dev/null +++ b/include/libavcodec/truemotion1data.h @@ -0,0 +1,832 @@ +/* + * Duck Truemotion v1 Decoding Tables + * + * Data in this file was originally part of VpVision from On2 which is + * distributed under the GNU GPL. It is redistributed with libavcodec under + * the GNU LGPL using the common understanding that data tables necessary + * for decoding algorithms are not necessarily copyrightable. + * + * 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_TRUEMOTION1DATA_H +#define AVCODEC_TRUEMOTION1DATA_H + +#include +#include + +/* Y delta tables, skinny and fat */ +static const int16_t ydt1[8] = { 0, -2, 2, -6, 6, -12, 12, -12 }; +static const int16_t ydt2[8] = { 0, -2, 4, -6, 8, -12, 12, -12 }; +static const int16_t ydt3[8] = { 4, -6, 20, -20, 46, -46, 94, -94 }; +static const int16_t fat_ydt3[8] = { 0, -15, 50, -50, 115, -115, 235, -235 }; +static const int16_t ydt4[8] = { 0, -4, 4, -16, 16, -36, 36, -80 }; +/* NOTE: This table breaks the [+,-] pattern that the rest of the + * tables maintain. Is this intentional? */ +static const int16_t fat_ydt4[8] = { 0, 40, 80, -76, 160, -154, 236, -236 }; + +/* C delta tables, skinny and fat */ +static const int16_t cdt1[8] = { 0, -1, 1, -2, 3, -4, 5, -4 }; +static const int16_t cdt2[8] = { 0, -4, 3, -16, 20, -32, 36, -32 }; +static const int16_t fat_cdt2[8] = { 0, -20, 15, -80, 100, -160, 180, -160 }; +static const int16_t cdt3[8] = { 0, -2, 2, -8, 8, -18, 18, -40 }; + +/* all the delta tables to choose from, at all 4 delta levels */ +static const int16_t * const ydts[] = { ydt1, ydt2, ydt3, ydt4, NULL }; +static const int16_t * const fat_ydts[] = { fat_ydt3, fat_ydt3, fat_ydt3, fat_ydt4, NULL }; +static const int16_t * const cdts[] = { cdt1, cdt1, cdt2, cdt3, NULL }; +static const int16_t * const fat_cdts[] = { fat_cdt2, fat_cdt2, fat_cdt2, fat_ydt4, NULL }; + +static const uint8_t pc_tbl2[] = { +0x8,0x00,0x00,0x00,0x00, +0x8,0x00,0x00,0x00,0x00, +0x8,0x10,0x00,0x00,0x00, +0x8,0x01,0x00,0x00,0x00, +0x8,0x00,0x10,0x00,0x00, +0x8,0x00,0x01,0x00,0x00, +0x8,0x00,0x00,0x10,0x00, +0x8,0x00,0x00,0x01,0x00, +0x8,0x00,0x00,0x00,0x10, +0x8,0x00,0x00,0x00,0x01, +0x6,0x00,0x00,0x00, +0x6,0x10,0x00,0x00, +0x6,0x01,0x00,0x00, +0x6,0x00,0x10,0x00, +0x6,0x00,0x01,0x00, +0x6,0x00,0x00,0x01, +0x6,0x00,0x00,0x10, +0x6,0x00,0x00,0x02, +0x6,0x00,0x00,0x20, +0x6,0x20,0x10,0x00, +0x6,0x00,0x02,0x01, +0x6,0x00,0x20,0x10, +0x6,0x02,0x01,0x00, +0x6,0x11,0x00,0x00, +0x6,0x00,0x20,0x00, +0x6,0x00,0x02,0x00, +0x6,0x20,0x00,0x00, +0x6,0x01,0x10,0x00, +0x6,0x02,0x00,0x00, +0x6,0x01,0x00,0x02, +0x6,0x10,0x00,0x20, +0x6,0x00,0x01,0x02, +0x6,0x10,0x01,0x00, +0x6,0x00,0x10,0x20, +0x6,0x10,0x10,0x00, +0x6,0x10,0x00,0x01, +0x6,0x20,0x00,0x10, +0x6,0x02,0x00,0x01, +0x6,0x01,0x01,0x00, +0x6,0x01,0x00,0x10, +0x6,0x00,0x11,0x00, +0x6,0x10,0x00,0x02, +0x6,0x00,0x01,0x10, +0x6,0x00,0x00,0x11, +0x6,0x10,0x00,0x10, +0x6,0x01,0x00,0x01, +0x6,0x00,0x00,0x22, +0x6,0x02,0x01,0x01, +0x6,0x10,0x20,0x10, +0x6,0x01,0x02,0x01, +0x6,0x20,0x10,0x10, +0x6,0x01,0x00,0x20, +0x6,0x00,0x10,0x01, +0x6,0x21,0x10,0x00, +0x6,0x10,0x02,0x01, +0x6,0x12,0x01,0x00, +0x6,0x01,0x20,0x10, +0x6,0x01,0x02,0x00, +0x6,0x10,0x20,0x00, +0x6,0x00,0x10,0x02, +0x6,0x00,0x01,0x20, +0x6,0x00,0x02,0x21, +0x6,0x00,0x02,0x20, +0x6,0x00,0x00,0x12, +0x6,0x00,0x00,0x21, +0x6,0x20,0x11,0x00, +0x6,0x00,0x01,0x01, +0x6,0x11,0x10,0x00, +0x6,0x00,0x20,0x12, +0x6,0x00,0x20,0x11, +0x6,0x20,0x10,0x02, +0x6,0x02,0x01,0x20, +0x6,0x00,0x22,0x11, +0x6,0x00,0x10,0x10, +0x6,0x02,0x11,0x00, +0x6,0x00,0x21,0x10, +0x6,0x00,0x02,0x03, +0x6,0x20,0x10,0x01, +0x6,0x00,0x12,0x01, +0x4,0x11,0x00, +0x4,0x00,0x22, +0x4,0x20,0x00, +0x4,0x01,0x10, +0x4,0x02,0x20, +0x4,0x00,0x20, +0x4,0x02,0x00, +0x4,0x10,0x01, +0x4,0x00,0x11, +0x4,0x02,0x01, +0x4,0x02,0x21, +0x4,0x00,0x02, +0x4,0x20,0x02, +0x4,0x01,0x01, +0x4,0x10,0x10, +0x4,0x10,0x02, +0x4,0x22,0x00, +0x4,0x10,0x00, +0x4,0x01,0x00, +0x4,0x21,0x00, +0x4,0x12,0x00, +0x4,0x00,0x10, +0x4,0x20,0x12, +0x4,0x01,0x11, +0x4,0x00,0x01, +0x4,0x01,0x02, +0x4,0x11,0x02, +0x4,0x11,0x01, +0x4,0x10,0x20, +0x4,0x20,0x01, +0x4,0x22,0x11, +0x4,0x00,0x12, +0x4,0x20,0x10, +0x4,0x22,0x01, +0x4,0x01,0x20, +0x4,0x00,0x21, +0x4,0x10,0x11, +0x4,0x21,0x10, +0x4,0x10,0x22, +0x4,0x02,0x03, +0x4,0x12,0x01, +0x4,0x20,0x11, +0x4,0x11,0x10, +0x4,0x20,0x30, +0x4,0x11,0x20, +0x4,0x02,0x10, +0x4,0x22,0x10, +0x4,0x11,0x11, +0x4,0x30,0x20, +0x4,0x30,0x00, +0x4,0x01,0x22, +0x4,0x01,0x12, +0x4,0x02,0x11, +0x4,0x03,0x02, +0x4,0x03,0x00, +0x4,0x10,0x21, +0x4,0x12,0x20, +0x4,0x00,0x00, +0x4,0x12,0x21, +0x4,0x21,0x11, +0x4,0x02,0x22, +0x4,0x10,0x12, +0x4,0x31,0x00, +0x4,0x20,0x20, +0x4,0x00,0x03, +0x4,0x02,0x02, +0x4,0x22,0x20, +0x4,0x01,0x21, +0x4,0x21,0x02, +0x4,0x21,0x12, +0x4,0x11,0x22, +0x4,0x00,0x30, +0x4,0x12,0x11, +0x4,0x20,0x22, +0x4,0x31,0x20, +0x4,0x21,0x30, +0x4,0x22,0x02, +0x4,0x22,0x22, +0x4,0x20,0x31, +0x4,0x13,0x02, +0x4,0x03,0x10, +0x4,0x11,0x12, +0x4,0x00,0x13, +0x4,0x21,0x01, +0x4,0x12,0x03, +0x4,0x13,0x00, +0x4,0x13,0x10, +0x4,0x02,0x13, +0x4,0x30,0x01, +0x4,0x12,0x10, +0x4,0x22,0x13, +0x4,0x03,0x12, +0x4,0x31,0x01, +0x4,0x30,0x22, +0x4,0x00,0x31, +0x4,0x01,0x31, +0x4,0x02,0x23, +0x4,0x01,0x30, +0x4,0x11,0x21, +0x4,0x22,0x21, +0x4,0x01,0x13, +0x4,0x10,0x03, +0x4,0x22,0x03, +0x4,0x30,0x21, +0x4,0x21,0x31, +0x4,0x33,0x00, +0x4,0x13,0x12, +0x4,0x11,0x31, +0x4,0x30,0x02, +0x4,0x12,0x02, +0x4,0x11,0x13, +0x4,0x12,0x22, +0x4,0x20,0x32, +0x4,0x10,0x13, +0x4,0x22,0x31, +0x4,0x21,0x20, +0x4,0x01,0x33, +0x4,0x33,0x10, +0x4,0x20,0x13, +0x4,0x31,0x22, +0x4,0x13,0x30, +0x4,0x01,0x03, +0x4,0x11,0x33, +0x4,0x20,0x21, +0x4,0x13,0x31, +0x4,0x03,0x22, +0x4,0x31,0x02, +0x4,0x00,0x24, +0x2,0x00, +0x2,0x10, +0x2,0x20, +0x2,0x30, +0x2,0x40, +0x2,0x50, +0x2,0x60, +0x2,0x01, +0x2,0x11, +0x2,0x21, +0x2,0x31, +0x2,0x41, +0x2,0x51, +0x2,0x61, +0x2,0x02, +0x2,0x12, +0x2,0x22, +0x2,0x32, +0x2,0x42, +0x2,0x52, +0x2,0x62, +0x2,0x03, +0x2,0x13, +0x2,0x23, +0x2,0x33, +0x2,0x43, +0x2,0x53, +0x2,0x63, +0x2,0x04, +0x2,0x14, +0x2,0x24, +0x2,0x34, +0x2,0x44, +0x2,0x54, +0x2,0x64, +0x2,0x05, +0x2,0x15, +0x2,0x25, +0x2,0x35, +0x2,0x45, +0x2,0x55, +0x2,0x65, +0x2,0x06, +0x2,0x16, +0x2,0x26, +0x2,0x36, +0x2,0x46, +0x2,0x56, +0x2,0x66 +}; + +static const uint8_t pc_tbl3[] = { +0x6,0x00,0x00,0x00, +0x6,0x00,0x00,0x00, +0x6,0x00,0x00,0x01, +0x6,0x00,0x00,0x10, +0x6,0x00,0x00,0x11, +0x6,0x00,0x01,0x00, +0x6,0x00,0x01,0x01, +0x6,0x00,0x01,0x10, +0x6,0x00,0x01,0x11, +0x6,0x00,0x10,0x00, +0x6,0x00,0x10,0x01, +0x6,0x00,0x10,0x10, +0x6,0x00,0x10,0x11, +0x6,0x00,0x11,0x00, +0x6,0x00,0x11,0x01, +0x6,0x00,0x11,0x10, +0x6,0x00,0x11,0x11, +0x6,0x01,0x00,0x00, +0x6,0x01,0x00,0x01, +0x6,0x01,0x00,0x10, +0x6,0x01,0x00,0x11, +0x6,0x01,0x01,0x00, +0x6,0x01,0x01,0x01, +0x6,0x01,0x01,0x10, +0x6,0x01,0x01,0x11, +0x6,0x01,0x10,0x00, +0x6,0x01,0x10,0x01, +0x6,0x01,0x10,0x10, +0x6,0x01,0x10,0x11, +0x6,0x01,0x11,0x00, +0x6,0x01,0x11,0x01, +0x6,0x01,0x11,0x10, +0x6,0x01,0x11,0x11, +0x6,0x10,0x00,0x00, +0x6,0x10,0x00,0x01, +0x6,0x10,0x00,0x10, +0x6,0x10,0x00,0x11, +0x6,0x10,0x01,0x00, +0x6,0x10,0x01,0x01, +0x6,0x10,0x01,0x10, +0x6,0x10,0x01,0x11, +0x6,0x10,0x10,0x00, +0x6,0x10,0x10,0x01, +0x6,0x10,0x10,0x10, +0x6,0x10,0x10,0x11, +0x6,0x10,0x11,0x00, +0x6,0x10,0x11,0x01, +0x6,0x10,0x11,0x10, +0x6,0x10,0x11,0x11, +0x6,0x11,0x00,0x00, +0x6,0x11,0x00,0x01, +0x6,0x11,0x00,0x10, +0x6,0x11,0x00,0x11, +0x6,0x11,0x01,0x00, +0x6,0x11,0x01,0x01, +0x6,0x11,0x01,0x10, +0x6,0x11,0x01,0x11, +0x6,0x11,0x10,0x00, +0x6,0x11,0x10,0x01, +0x6,0x11,0x10,0x10, +0x6,0x11,0x10,0x11, +0x6,0x11,0x11,0x00, +0x6,0x11,0x11,0x01, +0x6,0x11,0x11,0x10, +0x4,0x00,0x00, +0x4,0x00,0x01, +0x4,0x00,0x02, +0x4,0x00,0x03, +0x4,0x00,0x10, +0x4,0x00,0x11, +0x4,0x00,0x12, +0x4,0x00,0x13, +0x4,0x00,0x20, +0x4,0x00,0x21, +0x4,0x00,0x22, +0x4,0x00,0x23, +0x4,0x00,0x30, +0x4,0x00,0x31, +0x4,0x00,0x32, +0x4,0x00,0x33, +0x4,0x01,0x00, +0x4,0x01,0x01, +0x4,0x01,0x02, +0x4,0x01,0x03, +0x4,0x01,0x10, +0x4,0x01,0x11, +0x4,0x01,0x12, +0x4,0x01,0x13, +0x4,0x01,0x20, +0x4,0x01,0x21, +0x4,0x01,0x22, +0x4,0x01,0x23, +0x4,0x01,0x30, +0x4,0x01,0x31, +0x4,0x01,0x32, +0x4,0x01,0x33, +0x4,0x02,0x00, +0x4,0x02,0x01, +0x4,0x02,0x02, +0x4,0x02,0x03, +0x4,0x02,0x10, +0x4,0x02,0x11, +0x4,0x02,0x12, +0x4,0x02,0x13, +0x4,0x02,0x20, +0x4,0x02,0x21, +0x4,0x02,0x22, +0x4,0x02,0x23, +0x4,0x02,0x30, +0x4,0x02,0x31, +0x4,0x02,0x32, +0x4,0x02,0x33, +0x4,0x03,0x00, +0x4,0x03,0x01, +0x4,0x03,0x02, +0x4,0x03,0x03, +0x4,0x03,0x10, +0x4,0x03,0x11, +0x4,0x03,0x12, +0x4,0x03,0x13, +0x4,0x03,0x20, +0x4,0x03,0x21, +0x4,0x03,0x22, +0x4,0x03,0x23, +0x4,0x03,0x30, +0x4,0x03,0x31, +0x4,0x03,0x32, +0x4,0x03,0x33, +0x4,0x10,0x00, +0x4,0x10,0x01, +0x4,0x10,0x02, +0x4,0x10,0x03, +0x4,0x10,0x10, +0x4,0x10,0x11, +0x4,0x10,0x12, +0x4,0x10,0x13, +0x4,0x10,0x20, +0x4,0x10,0x21, +0x4,0x10,0x22, +0x4,0x10,0x23, +0x4,0x10,0x30, +0x4,0x10,0x31, +0x4,0x10,0x32, +0x4,0x10,0x33, +0x4,0x11,0x00, +0x4,0x11,0x01, +0x4,0x11,0x02, +0x4,0x11,0x03, +0x4,0x11,0x10, +0x4,0x11,0x11, +0x4,0x11,0x12, +0x4,0x11,0x13, +0x4,0x11,0x20, +0x4,0x11,0x21, +0x4,0x11,0x22, +0x4,0x11,0x23, +0x4,0x11,0x30, +0x4,0x11,0x31, +0x4,0x11,0x32, +0x4,0x11,0x33, +0x4,0x12,0x00, +0x4,0x12,0x01, +0x4,0x12,0x02, +0x4,0x12,0x03, +0x4,0x12,0x10, +0x4,0x12,0x11, +0x4,0x12,0x12, +0x4,0x12,0x13, +0x4,0x12,0x20, +0x4,0x12,0x21, +0x4,0x12,0x22, +0x4,0x12,0x23, +0x4,0x12,0x30, +0x4,0x12,0x31, +0x4,0x12,0x32, +0x4,0x12,0x33, +0x4,0x13,0x00, +0x4,0x13,0x01, +0x4,0x13,0x02, +0x4,0x13,0x03, +0x4,0x13,0x10, +0x4,0x13,0x11, +0x4,0x13,0x12, +0x4,0x13,0x13, +0x4,0x13,0x20, +0x4,0x13,0x21, +0x4,0x13,0x22, +0x4,0x13,0x23, +0x4,0x13,0x30, +0x4,0x13,0x31, +0x4,0x13,0x32, +0x4,0x13,0x33, +0x2,0x00, +0x2,0x10, +0x2,0x20, +0x2,0x30, +0x2,0x40, +0x2,0x50, +0x2,0x60, +0x2,0x70, +0x2,0x01, +0x2,0x11, +0x2,0x21, +0x2,0x31, +0x2,0x41, +0x2,0x51, +0x2,0x61, +0x2,0x71, +0x2,0x02, +0x2,0x12, +0x2,0x22, +0x2,0x32, +0x2,0x42, +0x2,0x52, +0x2,0x62, +0x2,0x72, +0x2,0x03, +0x2,0x13, +0x2,0x23, +0x2,0x33, +0x2,0x43, +0x2,0x53, +0x2,0x63, +0x2,0x73, +0x2,0x04, +0x2,0x14, +0x2,0x24, +0x2,0x34, +0x2,0x44, +0x2,0x54, +0x2,0x64, +0x2,0x74, +0x2,0x05, +0x2,0x15, +0x2,0x25, +0x2,0x35, +0x2,0x45, +0x2,0x55, +0x2,0x65, +0x2,0x75, +0x2,0x06, +0x2,0x16, +0x2,0x26, +0x2,0x36, +0x2,0x46, +0x2,0x56, +0x2,0x66, +0x2,0x76, +0x2,0x07, +0x2,0x17, +0x2,0x27, +0x2,0x37, +0x2,0x47, +0x2,0x57, +0x2,0x67, +0x2,0x77 +}; + +static const uint8_t pc_tbl4[] = { +0x8,0x00,0x00,0x00,0x00, +0x8,0x00,0x00,0x00,0x00, +0x8,0x20,0x00,0x00,0x00, +0x8,0x00,0x00,0x00,0x01, +0x8,0x10,0x00,0x00,0x00, +0x8,0x00,0x00,0x00,0x02, +0x8,0x01,0x00,0x00,0x00, +0x8,0x00,0x00,0x00,0x10, +0x8,0x02,0x00,0x00,0x00, +0x6,0x00,0x00,0x00, +0x6,0x20,0x00,0x00, +0x6,0x00,0x00,0x01, +0x6,0x10,0x00,0x00, +0x6,0x00,0x00,0x02, +0x6,0x00,0x10,0x00, +0x6,0x00,0x20,0x00, +0x6,0x00,0x02,0x00, +0x6,0x00,0x01,0x00, +0x6,0x01,0x00,0x00, +0x6,0x00,0x00,0x20, +0x6,0x02,0x00,0x00, +0x6,0x00,0x00,0x10, +0x6,0x10,0x00,0x20, +0x6,0x01,0x00,0x02, +0x6,0x20,0x00,0x10, +0x6,0x02,0x00,0x01, +0x6,0x20,0x10,0x00, +0x6,0x00,0x12,0x00, +0x6,0x00,0x02,0x01, +0x6,0x02,0x01,0x00, +0x6,0x00,0x21,0x00, +0x6,0x00,0x01,0x02, +0x6,0x00,0x20,0x10, +0x6,0x00,0x00,0x21, +0x6,0x00,0x00,0x12, +0x6,0x00,0x01,0x20, +0x6,0x12,0x00,0x00, +0x6,0x00,0x10,0x20, +0x6,0x01,0x20,0x00, +0x6,0x02,0x10,0x00, +0x6,0x10,0x20,0x00, +0x6,0x01,0x02,0x00, +0x6,0x21,0x00,0x00, +0x6,0x00,0x02,0x10, +0x6,0x20,0x01,0x00, +0x6,0x00,0x22,0x00, +0x6,0x10,0x02,0x00, +0x6,0x00,0x10,0x02, +0x6,0x11,0x00,0x00, +0x6,0x00,0x11,0x00, +0x6,0x22,0x00,0x00, +0x6,0x20,0x00,0x02, +0x6,0x10,0x00,0x01, +0x6,0x00,0x20,0x01, +0x6,0x02,0x20,0x00, +0x6,0x01,0x10,0x00, +0x6,0x01,0x00,0x20, +0x6,0x00,0x20,0x02, +0x6,0x01,0x20,0x02, +0x6,0x10,0x01,0x00, +0x6,0x02,0x00,0x10, +0x6,0x00,0x10,0x01, +0x6,0x10,0x01,0x20, +0x6,0x20,0x02,0x10, +0x6,0x00,0x00,0x22, +0x6,0x10,0x00,0x02, +0x6,0x00,0x02,0x20, +0x6,0x20,0x02,0x00, +0x6,0x00,0x00,0x11, +0x6,0x02,0x10,0x01, +0x6,0x00,0x01,0x10, +0x6,0x00,0x02,0x11, +0x4,0x01,0x02, +0x4,0x02,0x01, +0x4,0x01,0x00, +0x4,0x10,0x20, +0x4,0x20,0x10, +0x4,0x20,0x00, +0x4,0x11,0x00, +0x4,0x02,0x00, +0x4,0x12,0x00, +0x4,0x00,0x21, +0x4,0x22,0x00, +0x4,0x00,0x12, +0x4,0x21,0x00, +0x4,0x02,0x11, +0x4,0x00,0x01, +0x4,0x10,0x02, +0x4,0x02,0x20, +0x4,0x20,0x11, +0x4,0x01,0x10, +0x4,0x21,0x10, +0x4,0x10,0x00, +0x4,0x10,0x22, +0x4,0x20,0x20, +0x4,0x00,0x22, +0x4,0x01,0x22, +0x4,0x20,0x01, +0x4,0x02,0x02, +0x4,0x00,0x20, +0x4,0x00,0x10, +0x4,0x00,0x11, +0x4,0x22,0x01, +0x4,0x11,0x20, +0x4,0x12,0x01, +0x4,0x12,0x20, +0x4,0x11,0x02, +0x4,0x10,0x10, +0x4,0x01,0x01, +0x4,0x02,0x21, +0x4,0x20,0x12, +0x4,0x01,0x12, +0x4,0x22,0x11, +0x4,0x21,0x12, +0x4,0x22,0x10, +0x4,0x21,0x02, +0x4,0x20,0x02, +0x4,0x10,0x01, +0x4,0x00,0x02, +0x4,0x10,0x21, +0x4,0x01,0x20, +0x4,0x11,0x22, +0x4,0x12,0x21, +0x4,0x22,0x20, +0x4,0x02,0x10, +0x4,0x02,0x22, +0x4,0x11,0x10, +0x4,0x22,0x02, +0x4,0x20,0x21, +0x4,0x01,0x11, +0x4,0x11,0x01, +0x4,0x10,0x12, +0x4,0x02,0x12, +0x4,0x20,0x22, +0x4,0x21,0x20, +0x4,0x01,0x21, +0x4,0x12,0x02, +0x4,0x21,0x11, +0x4,0x12,0x22, +0x4,0x12,0x10, +0x4,0x22,0x21, +0x4,0x10,0x11, +0x4,0x21,0x01, +0x4,0x11,0x12, +0x4,0x12,0x11, +0x4,0x66,0x66, +0x4,0x22,0x22, +0x4,0x11,0x21, +0x4,0x11,0x11, +0x4,0x21,0x22, +0x4,0x00,0x00, +0x4,0x22,0x12, +0x4,0x12,0x12, +0x4,0x21,0x21, +0x4,0x42,0x00, +0x4,0x00,0x04, +0x4,0x40,0x00, +0x4,0x30,0x00, +0x4,0x31,0x00, +0x4,0x00,0x03, +0x4,0x00,0x14, +0x4,0x00,0x13, +0x4,0x01,0x24, +0x4,0x20,0x13, +0x4,0x01,0x42, +0x4,0x14,0x20, +0x4,0x42,0x02, +0x4,0x13,0x00, +0x4,0x00,0x24, +0x4,0x31,0x20, +0x4,0x22,0x13, +0x4,0x11,0x24, +0x4,0x12,0x66, +0x4,0x30,0x01, +0x4,0x02,0x13, +0x4,0x12,0x42, +0x4,0x40,0x10, +0x4,0x40,0x02, +0x4,0x01,0x04, +0x4,0x24,0x00, +0x4,0x42,0x10, +0x4,0x21,0x13, +0x4,0x13,0x12, +0x4,0x31,0x21, +0x4,0x21,0x24, +0x4,0x00,0x40, +0x4,0x10,0x24, +0x4,0x10,0x42, +0x4,0x32,0x01, +0x4,0x11,0x42, +0x4,0x20,0x31, +0x4,0x12,0x40, +0x2,0x00, +0x2,0x10, +0x2,0x20, +0x2,0x30, +0x2,0x40, +0x2,0x50, +0x2,0x60, +0x2,0x70, +0x2,0x01, +0x2,0x11, +0x2,0x21, +0x2,0x31, +0x2,0x41, +0x2,0x51, +0x2,0x61, +0x2,0x71, +0x2,0x02, +0x2,0x12, +0x2,0x22, +0x2,0x32, +0x2,0x42, +0x2,0x52, +0x2,0x62, +0x2,0x72, +0x2,0x03, +0x2,0x13, +0x2,0x23, +0x2,0x33, +0x2,0x43, +0x2,0x53, +0x2,0x63, +0x2,0x73, +0x2,0x04, +0x2,0x14, +0x2,0x24, +0x2,0x34, +0x2,0x44, +0x2,0x54, +0x2,0x64, +0x2,0x74, +0x2,0x05, +0x2,0x15, +0x2,0x25, +0x2,0x35, +0x2,0x45, +0x2,0x55, +0x2,0x65, +0x2,0x75, +0x2,0x06, +0x2,0x16, +0x2,0x26, +0x2,0x36, +0x2,0x46, +0x2,0x56, +0x2,0x66, +0x2,0x76, +0x2,0x07, +0x2,0x17, +0x2,0x27, +0x2,0x37, +0x2,0x47, +0x2,0x57, +0x2,0x67, +0x2,0x77 +}; + +static const uint8_t * const tables[] = { pc_tbl2, pc_tbl3, pc_tbl4 }; + +#endif /* AVCODEC_TRUEMOTION1DATA_H */ diff --git a/include/libavcodec/truespeech_data.h b/include/libavcodec/truespeech_data.h new file mode 100644 index 0000000..73ebda5 --- /dev/null +++ b/include/libavcodec/truespeech_data.h @@ -0,0 +1,159 @@ +/* + * DSP Group TrueSpeech compatible decoder + * copyright (c) 2005 Konstantin Shishkov + * + * 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_TRUESPEECH_DATA_H +#define AVCODEC_TRUESPEECH_DATA_H + +#include + +/* codebooks fo expanding input filter */ +static const int16_t ts_cb_0[32] = { + 0x8240, 0x8364, 0x84CE, 0x865D, 0x8805, 0x89DE, 0x8BD7, 0x8DF4, + 0x9051, 0x92E2, 0x95DE, 0x990F, 0x9C81, 0xA079, 0xA54C, 0xAAD2, + 0xB18A, 0xB90A, 0xC124, 0xC9CC, 0xD339, 0xDDD3, 0xE9D6, 0xF893, + 0x096F, 0x1ACA, 0x29EC, 0x381F, 0x45F9, 0x546A, 0x63C3, 0x73B5, +}; + +static const int16_t ts_cb_1[32] = { + 0x9F65, 0xB56B, 0xC583, 0xD371, 0xE018, 0xEBB4, 0xF61C, 0xFF59, + 0x085B, 0x1106, 0x1952, 0x214A, 0x28C9, 0x2FF8, 0x36E6, 0x3D92, + 0x43DF, 0x49BB, 0x4F46, 0x5467, 0x5930, 0x5DA3, 0x61EC, 0x65F9, + 0x69D4, 0x6D5A, 0x709E, 0x73AD, 0x766B, 0x78F0, 0x7B5A, 0x7DA5, +}; + +static const int16_t ts_cb_2[16] = { + 0x96F8, 0xA3B4, 0xAF45, 0xBA53, 0xC4B1, 0xCECC, 0xD86F, 0xE21E, + 0xEBF3, 0xF640, 0x00F7, 0x0C20, 0x1881, 0x269A, 0x376B, 0x4D60, +}; + +static const int16_t ts_cb_3[16] = { + 0xC654, 0xDEF2, 0xEFAA, 0xFD94, 0x096A, 0x143F, 0x1E7B, 0x282C, + 0x3176, 0x3A89, 0x439F, 0x4CA2, 0x557F, 0x5E50, 0x6718, 0x6F8D, +}; + +static const int16_t ts_cb_4[16] = { + 0xABE7, 0xBBA8, 0xC81C, 0xD326, 0xDD0E, 0xE5D4, 0xEE22, 0xF618, + 0xFE28, 0x064F, 0x0EB7, 0x17B8, 0x21AA, 0x2D8B, 0x3BA2, 0x4DF9, +}; + +static const int16_t ts_cb_5[8] = { + 0xD51B, 0xF12E, 0x042E, 0x13C7, 0x2260, 0x311B, 0x40DE, 0x5385, +}; + +static const int16_t ts_cb_6[8] = { + 0xB550, 0xC825, 0xD980, 0xE997, 0xF883, 0x0752, 0x1811, 0x2E18, +}; + +static const int16_t ts_cb_7[8] = { + 0xCEF0, 0xE4F9, 0xF6BB, 0x0646, 0x14F5, 0x23FF, 0x356F, 0x4A8D, +}; + +static const int16_t * const ts_codebook[8] = { + ts_cb_0, ts_cb_1, ts_cb_2, ts_cb_3, ts_cb_4, ts_cb_5, ts_cb_6, ts_cb_7 +}; + +/* table used for decoding pulse positions */ +static const int16_t ts_pulse_values[120] = { + 0x0E46, 0x0CCC, 0x0B6D, 0x0A28, 0x08FC, 0x07E8, 0x06EB, 0x0604, + 0x0532, 0x0474, 0x03C9, 0x0330, 0x02A8, 0x0230, 0x01C7, 0x016C, + 0x011E, 0x00DC, 0x00A5, 0x0078, 0x0054, 0x0038, 0x0023, 0x0014, + 0x000A, 0x0004, 0x0001, 0x0000, 0x0000, 0x0000, + + 0x0196, 0x017A, 0x015F, 0x0145, 0x012C, 0x0114, 0x00FD, 0x00E7, + 0x00D2, 0x00BE, 0x00AB, 0x0099, 0x0088, 0x0078, 0x0069, 0x005B, + 0x004E, 0x0042, 0x0037, 0x002D, 0x0024, 0x001C, 0x0015, 0x000F, + 0x000A, 0x0006, 0x0003, 0x0001, 0x0000, 0x0000, + + 0x001D, 0x001C, 0x001B, 0x001A, 0x0019, 0x0018, 0x0017, 0x0016, + 0x0015, 0x0014, 0x0013, 0x0012, 0x0011, 0x0010, 0x000F, 0x000E, + 0x000D, 0x000C, 0x000B, 0x000A, 0x0009, 0x0008, 0x0007, 0x0006, + 0x0005, 0x0004, 0x0003, 0x0002, 0x0001, 0x0000, + + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, + 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001 +}; + +/* filter for correlated input filter */ +static const int16_t ts_decay_994_1000[8] = + { 0x7F3B, 0x7E78, 0x7DB6, 0x7CF5, 0x7C35, 0x7B76, 0x7AB8, 0x79FC }; + +/* two-point filters table */ +static const int16_t ts_order2_coeffs[25 * 2] = { + 0xED2F, 0x5239, + 0x54F1, 0xE4A9, + 0x2620, 0xEE3E, + 0x09D6, 0x2C40, + 0xEFB5, 0x2BE0, + + 0x3FE1, 0x3339, + 0x442F, 0xE6FE, + 0x4458, 0xF9DF, + 0xF231, 0x43DB, + 0x3DB0, 0xF705, + + 0x4F7B, 0xFEFB, + 0x26AD, 0x0CDC, + 0x33C2, 0x0739, + 0x12BE, 0x43A2, + 0x1BDF, 0x1F3E, + + 0x0211, 0x0796, + 0x2AEB, 0x163F, + 0x050D, 0x3A38, + 0x0D1E, 0x0D78, + 0x150F, 0x3346, + + 0x38A4, 0x0B7D, + 0x2D5D, 0x1FDF, + 0x19B7, 0x2822, + 0x0D99, 0x1F12, + 0x194C, 0x0CE6 +}; + +/* possible pulse values */ +static const int16_t ts_pulse_scales[64] = { + 0x0002, 0x0006, 0xFFFE, 0xFFFA, + 0x0004, 0x000C, 0xFFFC, 0xFFF4, + 0x0006, 0x0012, 0xFFFA, 0xFFEE, + 0x000A, 0x001E, 0xFFF6, 0xFFE2, + 0x0010, 0x0030, 0xFFF0, 0xFFD0, + 0x0019, 0x004B, 0xFFE7, 0xFFB5, + 0x0028, 0x0078, 0xFFD8, 0xFF88, + 0x0040, 0x00C0, 0xFFC0, 0xFF40, + 0x0065, 0x012F, 0xFF9B, 0xFED1, + 0x00A1, 0x01E3, 0xFF5F, 0xFE1D, + 0x0100, 0x0300, 0xFF00, 0xFD00, + 0x0196, 0x04C2, 0xFE6A, 0xFB3E, + 0x0285, 0x078F, 0xFD7B, 0xF871, + 0x0400, 0x0C00, 0xFC00, 0xF400, + 0x0659, 0x130B, 0xF9A7, 0xECF5, + 0x0A14, 0x1E3C, 0xF5EC, 0xE1C4 +}; + +/* filters used in final output calculations */ +static const int16_t ts_decay_35_64[8] = + { 0x4666, 0x26B8, 0x154C, 0x0BB6, 0x0671, 0x038B, 0x01F3, 0x0112 }; +static const int16_t ts_decay_3_4[8] = + { 0x6000, 0x4800, 0x3600, 0x2880, 0x1E60, 0x16C8, 0x1116, 0x0CD1 }; + +#endif /* AVCODEC_TRUESPEECH_DATA_H */ diff --git a/include/libavcodec/tscc2data.h b/include/libavcodec/tscc2data.h new file mode 100644 index 0000000..63f5619 --- /dev/null +++ b/include/libavcodec/tscc2data.h @@ -0,0 +1,435 @@ +/* + * TechSmith Screen Codec 2 (aka Dora) decoder + * Copyright (c) 2012 Konstantin Shishkov + * + * 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_TSCC2DATA_H +#define AVCODEC_TSCC2DATA_H + +#include + +#define NUM_VLC_SETS 13 + +static const uint16_t tscc2_quants[NUM_VLC_SETS][3] = { + { 655, 861, 1130 }, { 983, 1291, 1695 }, { 1311, 1721, 2260 }, + { 1638, 2151, 2825 }, { 1966, 2582, 3390 }, { 2294, 3012, 3955 }, + { 2621, 3442, 4520 }, { 2949, 3872, 5085 }, { 3277, 4303, 5650 }, + { 3604, 4733, 6215 }, { 3932, 5163, 6780 }, { 4260, 5593, 7345 }, + { 4588, 6024, 7910 }, +}; + +#define DC_VLC_COUNT 47 + +static const uint16_t tscc2_dc_vlc_syms[DC_VLC_COUNT] = { + 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 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, + 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, + /* 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, + 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, + /* 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, + 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, + /* 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, + 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, + /* 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, + 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, + /* 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, + 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, + /* 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, + 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, + /* 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, + 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, + /* 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, + 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, + /* 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, + 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, + /* 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, + 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, + /* 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, + 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, + /* 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, + 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 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, + 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, + /* 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, + 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, + /* 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, + 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, + /* 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, + 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, + /* 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, + 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, + /* 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, + 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, + /* 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, + 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, + /* 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, + 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, + /* 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, + 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, + /* 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, + 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, + /* 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, + 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, + /* 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, + /* 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, + 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] = { + 172, 169, 165, 162, 131, 132, 130, 125, 121, 114, 110, 101, 96 +}; + +#endif /* AVCODEC_TSCC2DATA_H */ diff --git a/include/libavcodec/ttadata.h b/include/libavcodec/ttadata.h new file mode 100644 index 0000000..1ec1d74 --- /dev/null +++ b/include/libavcodec/ttadata.h @@ -0,0 +1,50 @@ +/* + * TTA (The Lossless True Audio) data + * + * 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_TTADATA_H +#define AVCODEC_TTADATA_H + +#include + +#define MAX_ORDER 16 +typedef struct TTAFilter { + int32_t shift, round, error; + int32_t qm[MAX_ORDER]; + int32_t dx[MAX_ORDER]; + int32_t dl[MAX_ORDER]; +} TTAFilter; + +typedef struct TTARice { + uint32_t k0, k1, sum0, sum1; +} TTARice; + +typedef struct TTAChannel { + int32_t predictor; + TTAFilter filter; + TTARice rice; +} TTAChannel; + +extern const uint32_t ff_tta_shift_1[]; +extern const uint32_t * const ff_tta_shift_16; +extern const uint8_t ff_tta_filter_configs[]; + +void ff_tta_rice_init(TTARice *c, uint32_t k0, uint32_t k1); +void ff_tta_filter_init(TTAFilter *c, int32_t shift); +#endif /* AVCODEC_TTADATA_H */ diff --git a/include/libavcodec/ttadsp.h b/include/libavcodec/ttadsp.h new file mode 100644 index 0000000..737d9bd --- /dev/null +++ b/include/libavcodec/ttadsp.h @@ -0,0 +1,33 @@ +/* + * 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_TTADSP_H +#define AVCODEC_TTADSP_H + +#include + +typedef struct TTADSPContext { + void (*filter_process)(int32_t *qm, int32_t *dx, int32_t *dl, + int32_t *error, int32_t *in, int32_t shift, + int32_t round); +} TTADSPContext; + +void ff_ttadsp_init(TTADSPContext *c); +void ff_ttadsp_init_x86(TTADSPContext *c); + +#endif /* AVCODEC_TTADSP_H */ diff --git a/include/libavcodec/ttaencdsp.h b/include/libavcodec/ttaencdsp.h new file mode 100644 index 0000000..4b00728 --- /dev/null +++ b/include/libavcodec/ttaencdsp.h @@ -0,0 +1,33 @@ +/* + * 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_TTAENCDSP_H +#define AVCODEC_TTAENCDSP_H + +#include + +typedef struct TTAEncDSPContext { + void (*filter_process)(int32_t *qm, int32_t *dx, int32_t *dl, + int32_t *error, int32_t *in, int32_t shift, + int32_t round); +} TTAEncDSPContext; + +void ff_ttaencdsp_init(TTAEncDSPContext *c); +void ff_ttaencdsp_init_x86(TTAEncDSPContext *c); + +#endif /* AVCODEC_TTAENCDSP_H */ diff --git a/include/libavcodec/ttmlenc.h b/include/libavcodec/ttmlenc.h new file mode 100644 index 0000000..cbed6f6 --- /dev/null +++ b/include/libavcodec/ttmlenc.h @@ -0,0 +1,34 @@ +/* + * TTML subtitle encoder shared functionality + * Copyright (c) 2020 24i + * + * 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_TTMLENC_H +#define AVCODEC_TTMLENC_H + +#define TTMLENC_EXTRADATA_SIGNATURE "lavc-ttmlenc" +#define TTMLENC_EXTRADATA_SIGNATURE_SIZE (sizeof(TTMLENC_EXTRADATA_SIGNATURE) - 1) + +#define TTML_DEFAULT_NAMESPACING \ +" xmlns=\"http://www.w3.org/ns/ttml\"\n" \ +" xmlns:ttm=\"http://www.w3.org/ns/ttml#metadata\"\n" \ +" xmlns:tts=\"http://www.w3.org/ns/ttml#styling\"\n" \ +" xmlns:ttp=\"http://www.w3.org/ns/ttml#parameter\"\n" + +#endif /* AVCODEC_TTMLENC_H */ diff --git a/include/libavcodec/twinvq.h b/include/libavcodec/twinvq.h new file mode 100644 index 0000000..84f4e51 --- /dev/null +++ b/include/libavcodec/twinvq.h @@ -0,0 +1,213 @@ +/* + * TwinVQ decoder + * Copyright (c) 2009 Vitor Sessak + * + * 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_TWINVQ_H +#define AVCODEC_TWINVQ_H + +#include +#include + +#include "libavutil/attributes_internal.h" +#include "libavutil/tx.h" +#include "libavutil/common.h" +#include "libavutil/float_dsp.h" +#include "avcodec.h" + +enum TwinVQCodec { + TWINVQ_CODEC_VQF, + TWINVQ_CODEC_METASOUND, +}; + +enum TwinVQFrameType { + TWINVQ_FT_SHORT = 0, ///< Short frame (divided in n sub-blocks) + TWINVQ_FT_MEDIUM, ///< Medium frame (divided in m +#include + +/* + * The bark_tab_* tables are constructed so that + * + * /i-1 \ + * |-- | + * bark |\ bark_tab[j] | == i + * |/ | + * |-- | + * \j=0 / + * + * + * for some slightly nonconventional bark-scale function + */ +static const uint16_t bark_tab_l08_512[] = { + 7, 8, 7, 8, 8, 8, 8, 8, 8, 9, + 9, 10, 10, 11, 11, 12, 12, 14, 15, 16, + 18, 19, 21, 24, 27, 30, 35, 40, 46, 53 +}; + +static const uint16_t bark_tab_l11_512[] = { + 6, 6, 6, 6, 6, 6, 7, 6, 7, 7, + 8, 8, 8, 9, 10, 10, 11, 13, 13, 15, + 17, 18, 21, 25, 27, 33, 38, 45, 54, 66 +}; + +static const uint16_t bark_tab_l16_1024[] = { + 9, 9, 8, 9, 10, 9, 10, 10, 10, 12, + 11, 13, 13, 14, 16, 17, 19, 20, 24, 26, + 30, 35, 40, 48, 56, 68, 83, 102, 128, 165 +}; + +static const uint16_t bark_tab_l22_1024[] = { + 6, 7, 6, 6, 7, 7, 7, 7, 7, 8, + 9, 8, 10, 10, 11, 12, 13, 15, 16, 18, + 21, 24, 27, 33, 38, 46, 55, 68, 84, 107, + 140, 191 +}; + +static const uint16_t bark_tab_l22_512[] = { + 3, 3, 3, 4, 3, 3, 4, 3, 4, 4, + 4, 5, 4, 5, 6, 6, 7, 7, 8, 9, + 10, 12, 14, 16, 20, 22, 28, 34, 42, 53, + 71, 95 +}; + +static const uint16_t bark_tab_l44_2048[] = { + 5, 6, 5, 6, 5, 6, 6, 6, 6, 6, + 7, 7, 7, 8, 8, 9, 9, 10, 11, 11, + 13, 14, 16, 17, 19, 22, 25, 29, 33, 39, + 46, 54, 64, 79, 98, 123, 161, 220, 320, 512 +}; + +static const uint16_t bark_tab_m08_256[] = { + 6, 5, 6, 6, 6, 6, 7, 7, 8, 8, + 9, 10, 11, 13, 15, 18, 20, 25, 31, 39 +}; + +static const uint16_t bark_tab_m11_256[] = { + 4, 5, 4, 5, 5, 5, 6, 5, 7, 7, + 8, 9, 10, 12, 15, 17, 22, 28, 35, 47 +}; + +static const uint16_t bark_tab_m16_512[] = { + 7, 6, 7, 7, 7, 8, 9, 9, 10, 11, + 14, 15, 18, 22, 27, 34, 44, 59, 81, 117 +}; + +static const uint16_t bark_tab_m22_256[] = { + 3, 2, 3, 2, 3, 3, 4, 3, 4, 5, + 5, 7, 8, 9, 13, 16, 22, 30, 44, 70 +}; + +static const uint16_t bark_tab_m22_512[] = { + 5, 5, 5, 6, 5, 7, 6, 7, 9, 9, + 11, 13, 15, 20, 24, 33, 43, 61, 88, 140 +}; + +static const uint16_t bark_tab_m44_512[] = { + 3, 2, 3, 3, 3, 4, 3, 5, 4, 6, + 7, 8, 10, 14, 18, 25, 36, 55, 95, 208 +}; + +static const uint16_t bark_tab_s08_64[] = { + 3, 3, 3, 3, 4, 5, 6, 8, 12, 17 +}; + +static const uint16_t bark_tab_s11_64[] = { + 2, 3, 2, 3, 3, 4, 6, 8, 12, 21 +}; + +static const uint16_t bark_tab_s16_128[] = { + 3, 4, 4, 4, 5, 7, 10, 16, 26, 49 +}; + +static const uint16_t bark_tab_s22_128[] = { + 3, 2, 3, 4, 4, 6, 9, 14, 26, 57 +}; + +static const uint16_t bark_tab_s44_128[] = { + 1, 2, 1, 2, 3, 4, 6, 10, 23, 76 +}; + +/** + * TwinVQ codebooks. They are coded in a struct so we can use code such as + * + * float val = tab.fcb0808l[get_bits(gb, 12)]; + * + * without risking a segfault on malformed files. + */ +static const struct twinvq_data { + int16_t fcb08l[640]; + int16_t fcb08m[320]; + int16_t fcb08s[320]; + int16_t shape08[1280]; + + int16_t cb0808l0[1088]; + int16_t cb0808l1[1088]; + int16_t cb0808s0[1152]; + int16_t cb0808s1[1152]; + int16_t cb0808m0[1024]; + int16_t cb0808m1[1024]; + + int16_t cb1108l0[1728]; + int16_t cb1108l1[1728]; + int16_t cb1108m0[1536]; + int16_t cb1108m1[1536]; + int16_t cb1108s0[1856]; + int16_t cb1108s1[1856]; + + int16_t fcb11l[640]; + int16_t fcb11m[320]; + int16_t fcb11s[320]; + int16_t shape11[1280]; + + int16_t cb1110l0[1280]; + int16_t cb1110l1[1280]; + int16_t cb1110m0[1152]; + int16_t cb1110m1[1152]; + int16_t cb1110s0[1344]; + int16_t cb1110s1[1344]; + + int16_t fcb16l[640]; + int16_t fcb16m[320]; + int16_t fcb16s[320]; + int16_t shape16[1920]; + + int16_t cb1616l0[1024]; + int16_t cb1616l1[1024]; + int16_t cb1616m0[960]; + int16_t cb1616m1[960]; + int16_t cb1616s0[1024]; + int16_t cb1616s1[1024]; + + int16_t cb2220l0[1152]; + int16_t cb2220l1[1152]; + int16_t cb2220m0[1088]; + int16_t cb2220m1[1088]; + int16_t cb2220s0[1152]; + int16_t cb2220s1[1152]; + + int16_t fcb22l_1[512]; + int16_t fcb22m_1[640]; + int16_t fcb22s_1[640]; + int16_t shape22_1[1152]; + + int16_t cb2224l0[960]; + int16_t cb2224l1[960]; + int16_t cb2224m0[896]; + int16_t cb2224m1[896]; + int16_t cb2224s0[960]; + int16_t cb2224s1[960]; + + int16_t fcb22l_2[512]; + int16_t fcb22m_2[640]; + int16_t fcb22s_2[640]; + int16_t shape22_2[1152]; + float lsp22_2[1312]; + + int16_t cb2232l0[768]; + int16_t cb2232l1[768]; + int16_t cb2232m0[704]; + int16_t cb2232m1[704]; + int16_t cb2232s0[704]; + int16_t cb2232s1[704]; + + int16_t cb4440l0[1088]; + int16_t cb4440l1[1088]; + int16_t cb4440m0[1088]; + int16_t cb4440m1[1088]; + int16_t cb4440s0[1152]; + int16_t cb4440s1[1152]; + + int16_t fcb44l[640]; + int16_t fcb44m[640]; + int16_t fcb44s[640]; + int16_t shape44[1152]; + + int16_t cb4448l0[896]; + int16_t cb4448l1[896]; + int16_t cb4448m0[896]; + int16_t cb4448m1[896]; + int16_t cb4448s0[960]; + int16_t cb4448s1[960]; +} tab = { +.cb0808l0 = { + 96, -12592, -12443, 425, 182, -456, -341, -843, + 615, 689, 982, 1470, -518, 231, -538, 282, + 409, -600, -303, -29, 51, -4, -115, 79, + -27, 450, -937, -461, -554, -159, 426, 710, +-29106, -2148, 99, 3426, 1838, 12427, 585, -2080, + -2524, -474, 1572, 718, 578, -344, 188, 328, + 12125, 112, 654, -1232, -1644, 288, 553, 1513, + 966, 1012, 49, 631, -111, -238, -116, -182, + -21, -46, 334, 11013, -454, -261, 12, 21, + 52, -20440, -295, -502, -516, -329, -230, 465, + 59, 270, 971, -127, 505, -194, 43, -30, + 300, 38, 665, -613, 33, -172, -153, 323, + -166, 54, 399, 109, 186, -1765, -222, 138, + 16, 204, 30111, 208, -564, -612, 156, -146, + -345, 321, -138, 202, -184, 93, 710, -15945, +-13401, 234, -1113, 146, -9, 56, -628, -834, + -1268, 872, 61, -1184, -126, -205, 145, -109, + -8248, 113, -146, 1288, 9142, 857, -782, -686, + -256, -650, 1061, -202, 12, -709, -88, 273, + 497, 150, -59, -8807, 240, 532, 16, 1482, + 11012, -444, 1918, -1786, 1934, 172, 598, -1324, + 5638, -3166, 492, -545, -770, 1067, 0, -356, + -421, 1684, 273, -502, 316, 1116, 807, -529, + -831, -13379, -420, 236, 470, -2590, -193, -47, + 580, -1613, 798, 27, -16, -12768, -893, 256, + 0, 1659, 1463, 544, 196, -30444, 314, -421, + 508, -276, -173, 414, -380, -371, -40, -121, + 375, 432, -438, 1, -350, -280, 1198, -373, + 452, 100, -68, 9053, 165, 770, 73, 291, + 717, 515, 596, -323, -4, -2, 803, 738, + 2605, 30, 73, 455, 11280, 1534, -283, 1502, + -9126, -4760, -570, 483, -179, -8628, -1639, 322, + -56, 6149, -3330, 114, 4598, -1976, -34, -56, + 840, 753, 12292, -7100, -492, 320, -412, 908, + 1186, 444, 6546, -788, 5394, 697, 13105, 194, + -394, 294, 2639, 12, -1009, -1426, -36, 2106, + -252, -31979, -66, 341, 996, 298, 105, 6, + 10, 106, -498, -244, -105, -574, 16, -206, + 24, -2067, -381, 10265, -103, -762, -785, -2036, +-11927, 16, -710, -35, -270, -99, 4, 772, + -272, -186, -328, -14936, -57, -1357, -175, -606, + 220, 918, -11, 398, -189, -278, 138, 429, + 509, -701, -43, -42, -630, -560, 11736, -528, + 10286, -633, -870, 423, 550, -888, 297, -170, + 258, 2234, 486, 292, -446, -11858, 10008, 52, + 1203, -164, 810, -1527, -604, -883, -588, -96, + 332, 148, -180, 223, 356, 285, 434, -57, + -172, -520, -432, -72, 294, -93, -134, 316, + 30647, -351, 278, 84, -439, 589, 105, 1001, + 297, 660, 196, 171, 178, -90, -55, 1172, + 21100, 227, -288, 372, 162, 458, -555, -1329, + 380, 366, -104, 105, 674, -378, 1328, 283, + -1928, 549, 762, 454, 55, 606, 12499, 24, + 435, 23, 29, 6170, 1129, -95, 97, 569, + 132, 491, 164, -288, -1011, -134, 1234, -427, + -254, -524, 226, -14114, 328, -70, 1666, -189, + -2352, 1097, 619, 632, -981, 745, 587, -27, + -200, -871, 50, 470, -246, 2610, 581, 254, + 9893, -586, 880, -11894, 386, 1135, 117, 1072, + 116, -830, -160, -1002, -699, -66, -230, -260, + 112, 106, 221, 297, -47, 7642, 170, -330, + -599, -51, -476, 33, 475, 624, 6199, -350, + -406, 184, 906, -528, 382, 401, 348, 26, + -186, 33, -130, -62, -50, 1268, -132, -109, + 1164, -354, 675, 3, -402, -244, 644, 648, + -132, -4, 45, 20386, -136, 568, 126, 376, + 14476, -376, 267, 13518, -260, 111, 1014, 758, + 439, 551, -164, 207, 128, -416, 616, 690, + -9460, -1856, 1123, 826, -265, -762, 1596, -632, + 52, -622, -894, 367, -433, -100, 1873, 756, +-17436, 168, -541, 550, 145, -5612, -1057, -1344, + -656, -194, 216, -500, -245, 246, 64, 688, + 727, 12538, -5492, 252, -908, -424, -532, -659, + -277, -230, -736, -183, 35, -228, 200, -12, + -248, -60, -493, 433, 446, 366, -644, 92, + -324, 29, 833, -21542, -977, 94, 379, 49, + -1058, 248, -178, 85, -961, -1198, -48, 467, + -242, -10202, 1556, 11263, -716, 814, -1686, 3594, + -27, 694, -802, 390, 4144, -663, 44, -546, + 312, -28, -484, 981, -307, 496, 408, 203, + 12543, 296, -1240, 159, 846, -957, -1493, -618, + 1593, 11868, 2616, 1954, 412, -922, -1320, 3325, + -254, -1892, 607, -2223, -8745, -1486, 17, 343, + -50, -562, 22011, -350, -491, -70, -60, 617, + 768, -346, 387, 660, 1409, 222, 616, 173, + -1323, 4017, -207, -525, -13243, 11, 440, -614, + -280, 549, -670, -79, 459, 560, -102, -214, + -54, -1201, 230, -526, 857, 1044, -369, 2470, +-11010, -12586, 243, -205, 838, -920, 348, -738, + 1319, 86, -78, -428, -1909, -155, 2, 508, + 711, -292, 1699, 225, -101, -163, 540, 9692, + 235, -183, -38, 198, -466, -204, -8957, -914, + -299, 193, 10, 723, 643, -533, -1418, 323, + 20, 334, -886, -331, 368, 130, -30233, -152, + -14, 637, 132, -232, -149, -430, 64, -243, + -376, 370, 388, 196, -1098, 117, -794, -16, + -274, 348, 464, -28156, 184, 322, -101, 2, + -27, -183, 610, 256, -160, -573, -226, 588, + 1613, 1028, 9518, -2151, -1602, -528, -356, -116, +-11511, 1828, -2206, -47, -757, -1479, -1429, -14717, + 1686, 253, 802, 462, -37, -916, -289, -401, + 13383, 353, -74, 114, -189, 636, 434, -639, + 1013, 234, 11752, 219, 1464, -132, -12838, 125, + -592, -40, -162, -1772, 506, 479, 422, 36, + 15, -960, 799, 517, 1311, -409, 748, 729, + 446, 11029, -13039, 1257, -651, -13, -742, 1416, + -388, -274, -795, 163, -572, 74, 430, -90, + -126, -74, -598, 140, 125, -20, -20332, 208, + 37, 19, -174, -209, 305, 28, -402, 28, + -315, -1, -134, 440, -832, 79, -635, -304, + 8, -32768, 625, 470, -1224, -351, 546, -1171, + -706, 652, 31, 7484, -448, 916, 1244, -379, + -300, 68, 868, 607, 247, 70, -984, 14314, + 21, -350, -82, 368, 456, -742, 472, 34, + 782, -498, -879, 700, 417, 216, 415, -161, + -181, -608, 1570, 862, -96, -114, 8095, -26, + 168, -363, -804, -36, -770, 139, -171, 6645, + -1425, 4826, -5288, 1358, -11747, -64, 650, -3206, + -1692, 789, -2047, -279, 916, -1648, 1164, 2044, + -144, -717, -392, -216, 372, 348, 1052, -175, + 668, 308, -15, 29112, -406, -774, 365, -1006, + -526, 1076, 59, -672, -87, -106, 174, 96, + 615, 462, -43, -496, 112, 149, -56, -182, + -268, -32768, -205, -676, 165, -1210, -325, 7964, + -44, 546, -699, 285, -418, 355, 238, 550, + 67, 425, 384, -950, -330, -208, -452, 212, + 11610, -190, 37, -907, -11137, -982, 585, -783, + -864, 164, -24, -514, -211, 2, -510, -580, + 595, 128, 100, -229, -55, 290, -539, 40, + -7786, -270, 295, -508, 562, -1196, 218, 33, + 3788, -8954, -1082, 297, -906, -322, 123, 1162, + -343, -11655, 88, -28, 1173, 9, -99, 36, +-11987, 356, 12630, 767, -183, -983, -559, 186, + 1148, 530, -440, 1230, -456, -133, -424, 35, + -357, 418, 1457, -687, 740, -242, 17855, -368, + -1057, -262, -646, 406, -712, -1058, -84, 454 +}, + +.cb0808l1 = { + 982, -26, -721, 359, 509, 13290, 2391, 727, + 325, 328, 269, -156, 346, -242, -31, -356, + 741, 396, -98, 108, 35, -237, -29684, 196, + -69, 462, -339, 24, -1221, 352, -658, 396, + 243, -1658, -458, -1153, 5, -662, -47, 18, + -572, -567, -2084, -980, -210, 150, -396, 14836, + -210, 0, -162, -539, 588, -868, 248, -8576, + 1020, 526, 1056, 262, -149, 818, -1353, -1120, + 767, -738, -634, -14742, -105, 811, 1718, -116, + -64, 307, 920, -1244, 2388, 10213, -4505, -250, + 617, -1725, -645, 1258, 1146, -590, 707, -12, + 372, 1794, 1012, -149, 404, -978, -306, 168, + -1536, 89, 142, 938, -19891, 973, -481, -419, + -904, -455, -1821, -1617, 654, -2022, 1906, -497, +-11346, -330, -11679, -14, 1, 535, -377, 1057, + -214, -213, 430, -13, -3379, -11250, 911, -716, + -240, -10, 260, 132, -611, -64, -594, -8540, + 837, -3717, -1154, 906, 10623, -502, -167, 67, + 119, 13501, -1469, 213, -1048, -1403, 432, -1079, + 45, -230, -730, -203, -595, -1150, -460, -97, + 395, -304, 27816, -300, -16, 153, -671, 551, + 436, -956, -182, 194, 113, -5504, 194, 263, + -332, -517, -244, -396, 540, 56, -371, 446, + 147, -66, 7, -306, 1440, -308, 327, 645, + 597, -6642, 72, 392, -138, -50, -144, -262, + 504, -230, 114, 2076, 8175, 1188, 290, -872, + 202, 69, 82, -281, -126, -291, -158, -152, + -45, 239, 153, -516, -422, -691, 801, 28, + 496, -298, -11118, 10430, -227, -851, 214, -801, + 538, 834, -137, 942, 573, 405, 1308, 2234, + 300, 1269, 12361, -752, 2177, -743, 60, 464, + 946, 302, -422, 116, -1200, -110, -843, 284, + -578, 732, -308, 153, -64, 156, 225, -29232, + -452, -466, -130, 888, 240, 305, -83, 236, + 208, 417, 1530, 294, 594, 351, 508, 137, + -7274, -184, 201, 44, -635, -891, -652, -596, + 380, -652, -8670, -76, -3746, -732, 262, -1860, + -1030, 1366, -279, 444, 911, 209, 330, 251, + -208, -747, 65, -10154, -204, 12960, -325, 347, + -465, -730, -727, 385, -89, -763, -427, 868, + -39, -859, 34, -29, -388, -1324, -218, 2051, + -1593, 5511, 10507, -8516, 2254, 5847, -1474, 1994, + 4704, -1876, 880, -3810, -489, -946, -1225, -1104, + 125, 139, -668, 2232, -537, 179, -215, 63, + 144, 72, 1198, 9750, 248, -709, 308, 10552, + -434, -462, 13569, 1096, -491, -262, 804, -1599, + 679, 569, 604, 1326, 213, -2026, 324, -2612, + -373, -12818, -20, 38, -171, 316, 15516, 306, + 763, 97, 91, -832, 23, -437, -390, 505, + -1226, 2518, 106, -2065, 315, 86, 523, 172, + -1012, -13851, 3358, 2610, -381, -194, 1200, -4106, + -1298, -3637, -1534, 780, 1367, -544, -770, 1690, + 1047, -54, 2136, 12502, 32, 6689, 706, -1172, + 846, -4853, 2146, 2548, -39, -465, -596, 177, + 213, 421, 28, -388, 11, 69, 31, -83, + -28, -166, -150, -19836, -323, 3, 659, 783, + 390, 139, -138, 31, -111, 453, -80, 432, + -519, -259, 686, 11431, 163, -13179, 554, 40, + -379, -120, -692, 340, 169, 120, -476, 643, + 778, 501, -128, 543, 1275, -134, 20568, 201, + 401, 512, -362, -210, -269, -812, 112, 75, + 149, -547, -494, -418, -100, -13621, -1002, 1176, + 1634, -395, -4289, -1531, -47, 850, -1102, 13558, + -403, 683, -164, -2215, -1180, -1750, 344, 630, + -968, 669, 540, 26, -594, 192, -17, -336, + 19645, 1133, 18, -56, 418, -426, -1535, 409, + 732, 186, 268, -20422, -22, 62, -621, 722, + 440, 96, -307, -128, 480, 5, 87, 668, + -361, -599, -22, 652, -176, -114, 214, -12233, + -698, 232, 608, -126, -714, -488, -228, 929, + -1582, -19845, 245, -460, 124, 57, 328, -436, + -158, 236, -196, -534, 209, 69, 229, 210, + -251, 1100, 583, 415, 210, 189, -219, 1242, + 19482, -105, 190, -374, -43, -232, 253, 561, + -297, -376, -1077, -308, 13486, -12462, 64, -190, + -298, -643, 460, 232, -987, -478, 1596, 168, + -722, 616, -873, -98, -948, 231, -1102, 11915, + 746, -495, 1248, 1203, 11067, -32, 160, -94, + -24, -153, -209, -1453, -1059, -313, -922, 1143, + -538, -1348, -323, 679, -54, -232, -470, 2075, +-19135, 628, -774, 35, 247, -86, 721, 512, + 1305, 850, 9760, 248, -2404, -220, 6, -73, + -1370, 567, 1432, -2529, -1508, 14358, -992, -1111, + -940, -111, 968, -530, 576, 102, -1045, 453, + 180, -94, -7936, -310, 512, 996, -32, -1062, + -150, -26, -6687, -181, -336, -1510, 616, 70, + -332, -175, 624, -546, 171, 364, 1011, 68, + -284, -368, 711, 46, 73, -34, -419, 404, + 28270, 283, -324, 335, -131, 316, 212, -27, + -342, -1062, 470, 1269, 454, 286, -1928, -1674, + -739, -389, 1073, -6172, -317, -586, -194, -182, +-13034, -848, 4596, -659, 709, -630, -310, 400, + 344, -276, 430, 876, -2047, -1012, -1672, -180, + 64, 22005, -736, 829, 266, 182, 436, -112, + -36, 131, 252, -63, 154, 368, 107, 93, + -42, -32768, 0, 200, -230, 271, -1776, 4329, + 986, -553, 481, 1888, -2770, 848, -6305, 264, + 12244, 1610, -640, 1348, -2742, -2078, 907, -1115, + 370, -16539, -1571, -176, 24, -515, 234, 954, + 605, 613, -154, 463, 535, -160, 684, 470, + 827, 10458, 150, -669, -6684, 339, -542, -730, + -351, 984, 212, 116, -7, 62, 926, 2175, + -185, -552, 489, -209, 5247, 38, 366, 53, + 16, 263, -142, -535, -224, 338, -174, -125, + 113, -12750, 400, -410, 281, -12, 744, -173, + 486, -12159, -107, -183, -484, 2, 150, 1, + -239, 7, -399, -608, -873, 698, -1623, 701, + -773, 272, -832, -94, -921, 885, 13588, 178, + 192, 148, 1346, 44, 59, -275, -14, -328, + 212, 133, -223, 300, -394, -275, -43, -76, + -47, 322, -208, 21713, 484, 329, 1860, 40, + -916, 502, 130, 477, 1754, 503, 7984, -338, + -323, -230, 354, 928, 430, -89, -94, 108, + -543, 365, -130, 70, 902, -131, 58, 469, + 580, -30949, 36, 232, -410, -451, 104, -8698, + 113, -1682, -42, -279, -92, -280, -477, -386, + -531, 832, 80, -15002, -56, 93, 164, -721, + 8388, -412, -2396, 584, 1004, -310, -2229, -304, + -383, 275, 1062, 1266, 297, -70, -909, 891, + 131, -1046, 539, 32502, 1000, -21, -229, 138, + 1528, -175, 546, 326, 168, -320, 716, -291, + -298, -227, 1094, -59, -12561, 12943, 786, 600, + -206, 889, -761, 54, 332, -1253, -597, 357, + -1124, -50, -168, 1172, 2266, 75, -174, 583, + 408, -157, 14666, 378, 302, -5, 48, 109, + 28, -21, 1044, 529, -859, -1182, -202, 1984, + 308, 402, 66, -1139, 2595, -380, 1119, 309, + 482, -10705, 100, -4591, 11646, -1364, -365, 9521, + -318, -23, 1076, -135, -2742, -833, 78, 910, + 96, -20, -599, 46, 855, -1265, 4748, 2394, + -250, -9096, -962, 191, -346, 348, 342, 1909, + 15330, 266, 540, 271, 2986, 1356, 1542, -1019, + -895, 737, 281, 684, -538, 10414, -922, 287, + 679, 204, -11142, -2321, -346, -1572, -250, -315, + -604, 1336, 311, 1317, -1111, 409, -104, -221, +-14125, -1511, -990, 705, -808, 587, 676, 348 +}, + +.cb0808s0 = { + -7488, -1327, -5244, -2049, -3736, -45, 446, 1558, + -755, -6052, 6034, -4326, 740, -348, 12369, 2115, + -662, -685, -6592, 10176, 8575, -1035, -2752, -4453, + -283, 1547, 4776, -2932, 700, 3425, -3905, 1073, + 2356, -7094, -1705, -435, 4840, -1944, 1188, 780, + -3963, -6170, -1726, 4759, -4356, -2124, -1686, 321, + -901, 1414, -923, -2678, -1198, -14777, -2038, -3528, + 123, 11216, 1904, -1914, 7588, 2744, -4265, -4886, + -3530, -1495, -1709, -5857, 3829, 2196, -4842, -817, + -874, -5649, -2181, -3871, 3774, -1368, 322, -1126, + -996, -3873, 13698, -9369, -848, 3797, -667, -1083, + 2429, -3351, -1672, -3562, -1590, -3507, 552, 6610, + -4137, -10061, -5452, -6142, -1454, 1726, -1298, -4479, + 6126, 1626, -2791, 1584, 1300, 5726, 2584, 11109, + 696, -3344, -2418, 9029, 4346, -3554, 1393, 144, + 2051, 8916, 6174, 5170, 376, 9778, -2298, -4119, + 3733, -35, -2673, 2222, 1383, 2046, 2859, -16131, + 1637, -1195, -662, 2800, -2241, 3801, -5062, -978, + 5670, -5449, -79, 3479, 606, 3766, -1325, -265, + 907, -745, 1005, -14528, -4227, -3955, -7194, 3690, + 2166, -2520, 11555, -511, 5900, -388, -3854, -3440, + 2136, -868, -2986, 722, 1286, -4027, 10382, -1646, + 5193, 2539, 1239, 7819, -67, 3382, -3297, -46, + -3808, 830, 1313, -2188, -4346, 5922, -1057, -6294, + 14317, 2001, 968, 4150, -4121, 1412, -302, -8401, + -1388, 10649, -9513, 1042, 840, -4606, 2098, 1166, + 1472, -802, -2810, 420, -561, -325, 2652, -2866, + 1334, 4878, 958, 83, 456, 1203, -7594, 14590, + -1210, 2202, -1954, -1938, -3413, -1096, 6036, -1675, + -1320, -4485, -10665, 10026, -2484, -3273, 4753, -275, + -3542, 924, 1262, 7348, -2959, -749, -408, 4594, + 4876, -491, 3409, 4616, 110, 557, -1378, -1616, + -4532, 1699, 1412, 579, -494, 716, 197, -23346, + -2284, 156, 1096, -151, -1827, 688, -322, 2371, + -7909, -1324, -1683, 7861, 7074, -451, 258, 9088, + 1900, 8660, 840, 3491, -3275, 3029, -475, -2122, + -5725, -8668, -6069, -3458, 4240, -3007, -5463, 9395, + -2686, 4718, -717, 42, -1802, 3122, -3197, -5212, + -1572, -243, -451, 8213, -2199, -3372, 4110, -8176, +-10525, -5551, 4312, 682, 2069, 1985, -3713, -6780, + 1193, 2831, -2228, 486, -3667, -789, -1691, 4567, + 464, -2114, -2340, -1881, 1921, 1602, 18418, 1535, + -567, 228, -9359, -6027, -267, 3628, 32767, 1423, + -74, -2817, 2112, -128, -1516, -2446, 1673, 2812, + -1582, 2125, 618, 2569, 2714, -1710, 340, 3255, + 848, 3379, -2317, -2361, -1823, 412, -2496, -18164, + -1224, 2552, -3040, 144, -597, 7716, 4916, -2867, + -2172, 2120, -2776, 675, -11985, 1692, -1384, -3588, + 4310, 1020, -4215, -251, -7090, -1916, 1914, -2804, + 6189, -6732, -1370, -3704, 450, -2652, 6553, -38, + 10348, 1244, -2246, -3729, -2158, -1340, 2357, 3118, + 9378, -1727, 3150, -3867, 1277, -15, 769, -2352, + -411, 1428, -14032, -1029, 2828, -1894, 6084, -36, + 518, 13159, 1095, -1185, -3207, -555, -3256, -76, + 3884, 3394, 1010, 1946, 160, -4863, 4714, -7087, + -3985, 5602, 3350, 7822, -5729, -7701, 9296, 3067, + 3582, 5256, 13629, -4012, -2206, -3867, -664, -104, + 4397, -7862, 36, 955, -38, -973, 3458, 5004, + 364, -9116, -2764, -2168, -1892, -7632, -4834, -5788, + -3565, -1245, -4544, 6552, 4601, 2342, 6625, 1040, + 2154, -6985, 5838, -1912, -3439, 1189, -2422, -555, + 3286, -14872, -776, 1228, 2434, 120, 13673, 904, + -1354, 645, -1550, -1377, -1888, 1416, -679, -1685, + 1731, 2404, -5786, 3285, -193, -123, 1973, 3663, + -1388, -14961, -3597, 5555, -1420, 284, 1527, -2575, + 1941, 871, 3900, -2168, -12763, 2970, -408, -3131, + -6426, 1892, 782, 6768, -284, 1034, 9785, 6029, + -3873, -4102, -4349, 2548, -3686, -5622, 4769, -351, + 8178, -7253, 3687, 624, -4386, 4028, -2780, -1938, + -4061, -1872, -1264, 7300, 760, 8530, -821, -874, +-14225, -1143, -5400, -850, -2537, 478, 1668, -1244, + -362, 877, 3481, -1338, -5218, 2091, 3996, -577, + 390, 8626, 820, 181, -988, 5604, 9694, 1112, + -3064, -266, 1234, -486, 1264, -2173, -13671, 3729, + -3212, 2548, 1745, -9363, 8065, 3713, -3343, -4847, + 2808, -4716, -2175, 25, -5718, 4056, 1855, 4663, + 2324, -1166, 543, 2, 3931, -3196, 2771, -920, + -2907, -746, -1241, -306, 2793, -22, -2642, 3048, + 3256, 1804, -1310, 17876, -1816, 56, -1694, -465, + -534, -2274, 6139, -2247, -2515, -1077, 3305, 1519, + 273, 1128, -1637, 2561, -1534, 874, -22808, -1119, + -2551, -10344, -2229, -3510, 194, 2594, 1737, 4713, + 13767, 3532, -311, 8097, -1012, -841, -4360, 793, + -267, -206, 12905, -2683, -6424, 196, 7098, -1690, + -690, 1236, -2882, -2668, -2020, 8291, -2714, -4607, + -923, -2077, -2878, 1687, -10457, -1575, 2172, -3974, + 5795, 1748, -1852, -5143, 4763, -5097, -2840, -1851, + 2634, 5970, 180, -3326, -1655, 1226, 375, 5137, + -2678, -5246, 4327, -3670, 9956, -1976, 2189, 2952, + -6785, -697, 1129, -5768, -5819, 6532, 3650, -1711, + 3857, 47, -9618, -1941, 2524, -1244, 7242, 11646, + -64, 2304, 201, -3707, -700, 149, 2692, -805, + 3978, 2738, -977, -1004, -5776, 12779, 7454, -353, + -4731, -3866, 7076, 146, -3302, 3065, 1955, -343, + -1459, -426, -5906, -1318, 500, -1014, -1002, -2090, + -2924, -20521, 2610, 1581, 397, -3380, -2885, 510, + -1147, 3398, 1914, 99, -119, 144, -3128, 2445, + 1791, 397, 3734, -80, -3410, -3798, -1142, -1515, + -2615, -1540, 5193, 2187, 940, 4969, -2334, -16589, + 325, -2186, -4567, 5121, -894, -6848, -6002, 1832, + -568, 8259, 833, 3420, -4459, -748, 3442, 4358, + -3041, -10203, 9303, -1511, -4821, 1950, -966, 3573, + 453, 705, 16238, -901, -163, -2866, -104, -1767, + -1779, -1249, 3251, 1975, 1254, -838, -390, -3150, + 1020, 2526, -2025, 662, -2817, -1338, -855, -3442, +-21123, 241, -134, -952, -588, 2572, 2080, 8153, + 114, 9732, -6774, -5266, -2462, 2286, -599, -426, + 1396, -7051, -1228, 312, -4495, -2525, 4649, -1305, + -1106, -2366, 2232, 4065, -18674, -1295, -3259, -1004, + -5136, 206, 1177, -5130, 2394, 2518, -1381, 2564, + -138, 4341, 16988, 2546, 6782, -3433, 850, -970, + -255, 1308, 2228, 1704, -1283, 1452, -2608, 1487, + 3106, -2267, -2998, -6814, 1654, 21195, 1555, 968, + 154, 124, -1258, 714, -407, 44, 247, 992, + 2228, 2824, 1435, -341, 1212, -1612, 6126, 1636, + -8368, 578, -5418, 217, -191, 204, -7147, 5110, + 3766, 5055, -5979, 6683, 368, -3597, -4595, 7630, + -3611, -2384, 1369, 6995, -3299, -53, 2036, -4654, + 4259, 9618, -1012, -2964, 4397, -2112, 11885, -1648, + -942, -3474, -544, -1410, -1958, -1535, 2981, -1591, +-16787, 335, 4609, -1990, 3821, -645, 1842, -64, + -3485, 3202, -374, -58, -1410, 7304, -1958, -2142, +-11412, -2533, 513, -6149, -6679, 2152, 3153, 5102, + 2216, -1361, 2260, 4863, -7031, 1538, -5250, -2511, + 96, 3339, -3447, -3708, 7168, -4168, 838, -3134, + 3228, -1531, -5598, 14125, 208, -2150, 819, -1085, + 12282, 6714, -2778, -9252, -5117, -6623, -1711, -4253, + -6306, -1292, -1370, -1027, -908, -2863, -1832, 4645, + -722, -284, -161, -5106, 7110, -12494, -1514, -5453, + -3308, 3520, 1101, -1096, -2325, -746, -33, 2645, + -4458, -797, -684, 1514, 1716, -6204, 6580, -3427, + -650, -10493, 4868, 5833, -2385, -274, 1530, 3892, + -1940, -1415, -2389, -11499, -2064, 937, -333, 1361, + -1583, 5458, -2296, -3263, -8344, -4236, -6357, -2372, + -3115, 1336, -2184, 194, -4262, -7838, 6946, 4535, + 749, 7332, 67, -327, 273, 3211, -1825, -357, + 7039, 3346, 6282, 488, -3940, 10196, 6463, 327, + 4407, 909, 889, -4943, -622, -4049, 2532, 1870, + 652, 1778, 663, 3063, -1012, -1390, 4162, 20486, + -86, 3166, 325, -1912, 511, -634, 1262, -4719, + -1490, 6767, -3314, -125, 4490, -10334, 5386, 9932, + 781, 290, 2198, 1695, 3790, -1878, 7760, -300, + 2021, 5508, 2200, 232, 7138, 1370, -3268, 3496, + 13934, -1230, -2303, 958, 141, 3348, -2867, -987 +}, + +.cb0808s1 = { + 9313, 734, 6610, -3629, -12020, 5317, -244, -1858, + 2, -1812, -6486, 892, 926, -236, 1016, -1249, + -469, -238, -1908, -10594, -4704, -907, -7746, 3847, + 564, -5956, 3395, 371, -5136, 4001, 1180, 769, + -555, -1872, -2943, -1744, 8620, 1485, 9901, -1392, + 3425, -7940, 151, 376, 1984, 3031, 3815, -974, + 537, -7038, 1964, -5625, 4457, -10214, -1787, -2768, + -8514, 176, -3692, 6441, 3148, 602, -2000, 13769, + -2792, 1104, -2067, -6219, 1515, -288, 3240, -5490, + 11589, 3742, -2343, -1752, 3701, 7525, -1676, 845, + 6895, 2884, 3540, 2454, 1010, 2454, -5761, 2035, + 3369, -9628, -862, -7060, 1802, 5676, 2396, 2757, + 5891, -701, -11896, -4061, 7932, -272, 2562, 83, + 560, -5180, -2223, -356, -3343, 2874, -1370, -7612, + 1773, 2006, -4258, 5312, 342, 8196, 4939, 519, + 3568, 4420, 2768, -11872, -3021, 1893, 1690, -5483, + -8129, 7540, -116, -2064, -4473, 1141, 1930, 656, + -7728, -2742, -3276, 2782, 2860, -6082, 5198, -4751, + -486, -789, -16932, -566, 5116, 1196, 832, 4282, + 78, 3088, 2768, 2125, 1027, 1712, 310, 808, + -1595, -106, 3174, 4598, -2945, 1551, -7688, 620, + -1640, 339, 4538, 3339, 532, -351, 260, 249, + -2135, -543, -18362, -648, -3871, 5514, -1782, -11301, + -374, -2078, 1610, 50, -4439, -2546, -3058, 839, + -9221, 2618, 1790, 103, -1061, -363, 285, -3542, + 503, -437, 30, 1382, 75, -2852, -1028, 3095, + 4318, -2316, 739, 801, -22765, 2162, 913, 1698, + 149, 2049, -313, -803, 3393, -1476, 4396, -4003, + 854, -1344, 1062, 10009, 6332, -8522, -2616, -9904, + -390, -3146, -2951, 4222, 5538, 495, 3776, -13684, + 4687, -2187, -905, 4997, 6209, 4775, -1234, 1956, + -4607, 3006, -370, -670, -12448, -5802, 8151, 140, + 1485, -6340, 2139, 1231, 22, -212, 2090, -676, + 2366, -701, -4113, 365, 2970, -577, 918, 7324, + -709, 2035, 5162, 7232, -13287, -3259, -908, -1900, + -4255, -2590, 318, 4891, 696, -40, -1647, 1572, + -1221, 4896, 5241, 49, -2083, -5068, 7645, 8978, + 1628, 2895, -4930, -8068, 2266, 2025, -1868, 3250, + 2642, -785, -14571, 9979, 3481, -2246, 1154, 2646, + 2616, -2033, -2936, -1300, 2490, 879, -1237, -1228, + -724, -1780, 524, -6619, -3339, -2526, 3533, 844, + 2946, 2208, -3522, -12411, -3062, 2380, 448, 604, + -4708, 2403, 1914, -58, 149, -3704, -2019, 4246, + -7020, -3197, -712, -2219, 10036, -2776, -3166, 2648, + 2947, 3386, 6445, 1587, -268, -536, 1895, -9005, + 10791, -982, 8215, 6414, 5166, 4751, 160, 3050, + -865, 6216, -1187, -7077, 1640, 5078, 4354, 1762, + -3869, 1174, -149, 1078, 1884, 5149, 15091, -432, + -2441, -1102, -1194, 1078, -1535, 8289, -2702, 4007, + 694, 72, 685, 2816, 13244, -422, -7094, 432, + 2044, -12004, -276, 2174, -908, -4784, 5725, -250, + 22, 5116, -2, 2686, 955, -8509, -7697, -3735, + 672, -1202, 4299, 4284, 12352, -2362, 5757, 1317, + 4293, 508, 3050, -524, 1097, 3346, -537, -2440, + -1596, -5659, 4188, -625, 1659, 3061, 2791, 1712, + -2991, 966, -16903, 610, -3314, 4160, -3750, 580, + -3407, -340, -11829, -520, -1625, 2905, 674, -147, + -5284, -4278, -5021, 4635, 6299, 2207, 2595, -7811, + -68, 4107, 4314, -1540, -11044, -2214, -803, 232, + -7602, -95, 1130, 4991, -361, 1675, 4487, 3607, + -6192, -130, 137, -1440, 2826, 178, -13834, -984, + 1149, 1230, 1587, 1571, 3286, 5293, -2259, 2021, + -6211, -7608, -2710, 2502, 4315, -539, -8530, -746, + -654, -4003, -5917, -3728, 4522, -10350, -1266, 210, + 5078, -2988, -3866, 3919, 969, -1063, -6300, -4584, + -2420, -2094, -884, 2338, -3150, 5461, -1145, -734, + 1644, 2183, 19114, -1144, -2313, -404, 1236, 3583, + 134, 1802, -4088, -2795, 681, 3738, 1831, 16571, + 917, -2290, -3648, -1588, -158, -528, -792, 394, + -7432, 2446, 402, -391, -73, -1398, 1286, -6503, + 5216, 1094, -939, 1673, -2038, 15842, -1971, 4160, + -1664, 7231, 642, 5770, 4209, -1839, 220, -266, + 165, 2055, 5222, -3344, -6544, 5412, 1514, 586, + 1591, -15256, -2715, 941, 1308, -9170, -2863, 4935, + -2913, -1291, 2791, 7967, 14, -1101, 3774, 3580, + 848, 1337, 1138, -2839, -3564, -5300, 12429, 14, + 1466, -7114, 1198, -3474, -237, -2577, -1305, 445, + 1069, -174, 1684, 3902, 229, 5842, -690, 978, + -754, 1182, -859, 21078, -185, 710, 797, -2155, + 367, -2168, 1002, 3805, -924, 468, -2322, -3590, + 1608, 3387, 18, 1536, -858, 642, -7964, 17689, + 9843, -4878, -3003, 7373, 5934, 4286, 10484, -63, + -4629, 974, -2227, 2602, 3810, 1905, -1668, -2130, + 2020, -2360, 2853, 612, 5070, -1248, -868, -497, + 3478, -1937, -3006, -645, 3589, 3019, -3293, 16469, + -5243, -2918, 1788, -2569, 3717, -9630, -1352, -3870, + -416, -4190, -8863, -6888, -498, -814, -783, -4625, + 5841, 1562, -2173, 481, 280, 816, 4742, -9962, + 11799, -2029, -2460, 4972, -600, -1452, -1901, -2122, + 3130, 2686, -819, -2366, 866, -2093, 1052, -58, + 284, 3830, -4738, -4114, -1321, 1307, -2820, 4915, +-11701, 522, -1982, 7024, 8403, 1762, -46, 532, + 5097, 5013, -615, 3086, 2089, 6899, -1107, -4047, + -2903, 5356, -4802, -965, 6706, 3895, 9022, 1388, + 10971, 5927, -2954, -965, -3473, -5177, -2654, 3418, + -5315, -16695, -6587, -416, 404, 1230, -2586, -3292, + 1390, 14, -481, -4446, 1335, 109, 1060, 3958, + 1275, -5655, 1253, -2411, 207, -12550, 6208, -2447, + -3415, 2503, 848, 3094, 9336, 2647, 2455, 2238, + 2356, -2132, 5347, 915, 2227, -103, 5832, -2504, + 7562, 9568, -6100, 4091, 2668, -1722, 287, 6763, + 4058, -387, -2060, 5522, 3184, 4766, -158, 650, +-11284, 11841, 6230, -4232, 5308, 3174, 4926, -2970, + -4761, -980, 117, 1944, -1974, -5484, 6534, -266, + -7222, 924, -2654, -588, 9609, -2337, 1892, -2110, + 5088, 1856, 7964, -4029, -940, 1429, 805, -4705, + -1362, 892, -189, -8354, 3259, 194, 767, -2877, + -4165, -990, 12185, -160, -2002, -1384, -5388, -1604, + 226, -6353, -4157, 1773, 2360, -4356, -730, -5462, + -4054, -15669, -1528, -394, 4101, -203, 2792, -787, + 3391, -299, 6384, -1630, -7186, -12765, 4618, 934, + -401, 2790, 2284, -4932, -1260, -6009, -2590, -2285, + -1289, 3366, -4192, -4462, 32767, -3135, -1888, 67, + -2874, 150, 4760, -1571, 584, -2187, 358, -1733, + -1286, -4573, -2003, 1872, 940, -1942, -255, -8856, + -1320, -3348, 4854, -509, 2836, -14, 2490, -1537, + 882, 1188, -3132, -15209, -1633, -44, -2827, 368, + -1099, -1073, -467, 6318, 5863, 2840, -5200, 569, + -2984, 6587, 9596, -4924, 457, 4879, -4449, 3528, + 1868, -3894, -3905, 15420, -2590, -599, -4975, 3892, + -1454, -616, 1890, -2700, -3268, -1386, -1065, -3078, + -2454, -1902, 4726, -34, -4218, 1619, -3074, 5540, + -6392, -3570, 2687, -8742, 333, -106, 2326, -1737, + -3775, 397, -3553, -6632, -6066, 9567, 2904, -889, + 1136, 1295, 19390, -268, -3127, -180, 1696, -814, + -775, -4914, -456, -758, -866, 1102, -3740, -374, + 469, -6902, 1440, -10243, -6221, -4797, -3074, -1142, + 297, 5069, -1547, 5474, 716, -454, 3806, 4100, + 2901, -2169, -744, 5032, -5586, -2986, 2286, 2414, + 7860, -2672, -46, -10046, 5348, -1018, 1016, 9142, + 4543, 5587, 2228, -2684, -4594, -2457, -1850, -3651, + -1806, 4826, -11686, 1940, -3529, 1078, -5234, -2420, + -83, -2322, -5134, -775, 677, -9257, -864, -915, + 4494, 411, -4820, 5999, 4472, 5823, -4597, 3121, + -1868, -1539, 2338, -4249, 1154, -13422, 791, -1235, + -1240, 364, 177, -1508, -2527, -2949, -2062, 118, + -3115, 293, -1927, 18644, -1100, 152, -2528, 1914, + -1380, -1624, 302, -831, -920, 320, -879, -1252, + 813, -11, 6960, -522, 3092, -119, 1486, 3068, + 6690, -3079, 13305, 6342, 937, 1632, -1026, 1896, + -2335, -3961, 5510, 2782, 187, -2448, -1251, 756, +-15856, 3179, -1155, 808, -1748, -6593, 1494, -3122, + -98, -3808, 491, 1752, 3188, 2158, -1924, 763, + 1165, 148, -3161, -1284, 18082, -195, -1125, 845 +}, + +.cb0808m0 = { +-18656, -461, 236, -1122, -796, -101, 851, -3748, + 1374, -8549, -3366, -1482, 1026, 2046, 4394, -521, + 232, -486, -1656, 32767, 1954, -1183, -130, 392, + 194, -868, 2883, -168, -1674, -910, -34, 819, + -1105, 1628, -4871, -585, -1170, -572, 451, 3911, + 10770, -35, -4126, 7124, 7110, -860, -3914, -3294, + 272, -647, 220, 11965, -3378, 2726, 1990, 1624, + -3689, 9884, 2394, 3096, -518, 5169, -4018, 3108, + 168, 1256, -410, -3851, -11176, -10479, 2042, 1421, + 1488, -992, -1562, -653, -1191, 2246, 467, 4732, + 154, 729, 7244, -18, 1313, -51, -1824, 1218, + 1473, -6763, -11270, -4295, 4118, 1043, -5782, 1370, + 46, -11027, 4086, -1501, -11, -621, 464, 781, + 13680, 257, 554, 3119, 750, -1857, 1046, -1252, + -512, 739, 14811, 12642, 3841, 2824, 163, 1620, + 39, 4766, 1411, -2197, 525, 658, 419, 5, + 92, 1544, 290, -2038, 10603, -5764, -3335, -6629, + -2579, 4020, -3107, 2779, 849, 5678, 260, 2804, + 99, 1339, 544, 1438, -450, -598, 764, 1568, + -1034, -4560, 2604, -18205, 1644, 1003, -675, 3217, + -334, -832, -1452, 322, 608, 300, -4776, -812, + -36, 627, 1654, -248, -838, 21571, -89, -1626, + 530, -1151, 9440, 522, -6138, 2213, -10095, -562, + 1000, 5037, -122, -3, 7064, 397, -2118, 362, + 15791, -1047, -15010, -1527, -1356, -2805, -560, -3148, + 266, -45, 1324, -3312, -1772, 2382, 189, 6537, + 124, -1272, 156, 588, -2678, -3106, 2828, -3684, + 689, 3884, 4650, 192, -323, -5426, -722, 11486, + -607, 3591, 4299, 2117, 362, -9114, 11700, -3391, + 2357, 7639, 2197, 4350, 2970, -2525, 169, -6112, + 91, 1520, -19, 1558, -4588, -837, -8163, 897, + -7992, 2080, -3102, 774, -10592, -314, -137, -524, + 87, -799, -111, 74, 1312, 862, 266, 243, + 199, -288, 1205, -829, 1650, 2880, -24776, 3867, +-13101, 597, -9778, -2084, -3089, -1112, 548, -638, + 3727, -446, 4877, 2099, 68, -2736, -4914, -7103, + 263, -9228, -782, -2109, 1088, -1881, -1424, -30, + -1353, 586, 4085, -3573, -11921, 2366, 516, -1028, + 834, -234, 2150, -15893, 2305, -3619, -2567, -8366, + 610, 2946, -2383, 2293, 946, -3550, -6770, -1481, + -758, -864, -232, 2855, 40, -2330, 2069, -345, + 1801, -589, -1241, 647, 6988, -2625, 14308, 2801, + 759, -2740, -680, 964, 365, -506, 22268, 1766, + -202, -2751, -293, 3754, 1280, -521, -3355, 4615, + 594, -1783, -39, -46, 48, -2638, -551, 2548, + -1880, 3730, -1726, 939, -345, -7, -1630, -23405, + -1002, 5655, 2100, 440, 1682, 1020, -594, 344, + 1511, -1286, 5518, 473, -11398, -4552, 720, 4701, + 7726, 126, -1953, -484, -1648, -1766, 1589, 996, + -688, -381, 1678, 1498, -528, -860, -667, -823, + 32767, -463, -243, -1242, 1074, 2460, -1411, -459, + -1533, 1462, -2603, -784, -391, 338, 3444, 2170, + -924, 949, 1972, 1520, -3062, -671, 12908, 2636, + 2805, 722, -12016, -26, 616, 1192, 1193, -1028, + -128, -22850, 191, 408, -3105, -592, -440, 1264, + -2580, 847, 850, 2300, -278, 126, 2214, -2693, + -21, -194, -594, -533, 45, 570, 38, 636, + 1276, 171, 29846, 648, 911, -358, 300, 602, + 413, -10167, -54, -1353, 42, -1770, 491, -12154, + -1808, 26, 425, 2009, 910, -8134, 362, 2001, + -114, -2586, -1049, -249, -312, 160, 1677, 27043, + -44, 160, 834, 243, -606, -272, -979, -1605, + 105, -491, 754, -230, 2442, 24, -5139, -395, + -3562, 14436, -1208, -3232, 2555, -12980, -906, 429, + 217, -432, -1263, -244, -225, 912, -64, 780, + 1101, 854, -240, 308, -28630, 518, 32, 976, + -8642, -3041, 1801, -742, -1513, 128, -3189, 857, +-14277, -1802, 1229, -68, -565, 65, 4094, 1614, + -8254, -1153, -640, 16225, 3508, -1383, -3882, -347, + 1346, 3845, 2665, 2340, -1862, -5318, 1402, -1352, +-21682, -694, -1182, 286, -806, 2133, 1848, -532, + -3750, 7564, 1054, 284, -3742, 2559, 2748, 3408, + -1544, -342, -22578, 1225, 958, 2559, 267, 378, + -3608, -1404, -1669, -13, 1135, 153, -625, 1436, + 211, 556, 739, 1094, 10452, 850, 5128, 11469, + 121, 4937, -3643, 1371, -373, -6686, 229, -3256, + -75, 1304, -1023, -452, 288, 12709, 13572, -501, + 1840, -1044, -2014, -4077, -2726, -1010, -3826, -629, + -466, -923, -847, 5784, 898, -12036, 1253, -1741, + 1546, -3710, 2782, -3430, -1810, 263, -8254, 3126, + 55, -376, 202, 968, -1686, 944, -15300, -2664, + 1393, 783, -11080, 1714, -1666, -1064, -4859, -2344, + 334, 1313, -1209, 877, -1828, -2130, -3057, 340, + 8030, -3222, 11622, -5620, 1469, 3340, 2862, -3945, + -868, 351, -1314, 2277, -2346, 12384, 996, -2460, + 1810, 703, -2158, 3168, -9887, 8754, 3503, -1414, + 445, 850, -30, 2389, -617, 3271, -1606, -5633, + 2993, 10009, 5704, -11589, 4278, 1304, -2418, 479, +-16596, -12349, 2915, 327, 895, 1278, 1412, -310, + -653, -1287, 880, -4294, 38, 2179, -2074, -1810, + 198, -1544, -8008, 2456, -2821, -3223, -3713, 11763, + -2081, -141, 4833, 1652, 3598, 551, -1655, -1154, + -60, -302, 739, -1494, 2595, -1006, 2665, 10834, +-11270, -2996, -636, -446, 1816, -1539, 4149, -184, + -100, -55, 265, 2207, 639, -162, -2210, -626, + 605, -21149, 2163, -970, -330, -4655, 3396, -3092, + -544, -650, -304, 93, -1484, -888, -8982, 1871, + 1701, -1423, 1671, -11, -1287, -14292, 592, 1040, + -622, 13202, -660, -12745, -2836, -1832, 3481, 1546, + 235, -646, 2132, -602, 2391, 1534, 3599, -4932, + -296, -1855, -2075, -2646, -219, -10248, 1161, 5955, + 6954, 9109, 3498, -5932, -1787, 373, 1234, 1244, + -813, -76, 9083, -5120, -499, -1774, -2150, 10601, + -170, 1160, 982, -597, 95, 151, -534, 6554, + 840, -958, -720, 2066, -50, -2877, -74, -2068, +-24760, -725, -357, 1273, 1941, 2525, 46, -819, + -230, 1030, 2291, -287, 1092, -2315, 427, -19, + 448, 1698, 9797, 10962, 3034, 2622, -2652, -1128, + -194, -180, -1176, -1794, -22248, 244, -3, -1856, + -1054, -2751, -459, -62, -433, -2274, -1790, -192, + -720, -421, 55, -721, 1960, 1094, 2500, -2353, + -480, -784, -1221, -505, 1738, -9960, -10772, -13657, + 122, 387, -667, -454, 988, 30780, -757, -2319, + 878, 962, 753, 1306, 716, -771, 539, -705, + 508, 1915, 2114, 937, 447, 935, -1432, -1143, + 4435, 11759, -2442, -53, -10601, 1979, 5419, -2296, + -172, -5987, -1168, -2012, 2257, -1451, 97, -1253, + 5548, 884, -14448, 3134, 2549, 172, 5404, 869, + -83, 597, -12416, 762, -1035, -805, -1369, -804, + 664, 9644, -4329, 1130, -1526, -2900, 628, 620, + -6436, -2370, 2107, -11836, 37, 864, 2105, 314, + 216, -529, 810, 3141, 3716, 7019, -2653, 1466, +-14940, 13128, 1218, 2287, -145, -443, -923, 476, + 2411, 5428, -611, 2212, 1450, -3042, -4750, 3562, + 587, -15378, -15151, 600, 1029, -2353, -934, 1986, + 1444, -2171, 1020, -700, -1508, 195, -2466, -798, + 16460, -2164, 520, 2711, -13832, -2024, -871, -5268, + 3556, 117, -416, -8, 2128, -1570, 2052, -3169 +}, + +.cb0808m1 = { + 16492, -295, 2556, 1303, -440, 7584, 3305, -3422, + -1196, -1809, 2142, -1292, 1048, 314, 1945, 578, + 1080, -255, 1109, 617, 1597, 198, -29081, -243, + 54, -33, 76, -418, 1332, 475, 1495, 1554, + -782, 308, -1286, 1044, 300, 1544, 646, 9441, + 2577, -11140, 1421, 1107, -483, -590, 625, 8544, + 446, -1814, 1714, 685, 9620, -4981, -3100, -724, + 8439, -2333, 506, 3557, -1160, -2199, -659, 4107, + 8620, -1406, -3745, 1729, 10756, 868, -82, 2584, + -3140, 3632, 2617, 3880, -1175, -163, 1864, -980, + 551, 201, -433, -1464, 708, 1926, -8471, 3870, + -2376, 15567, 2112, 753, -2450, 72, 1131, 2932, + -139, 6392, 1547, 3, 625, -823, -1750, 811, + -977, -1389, 1300, 1184, 399, 4684, 196, 3679, + -1672, -218, -11023, 98, 492, 4072, 1213, -2004, + 3602, -1787, 1288, -9442, 4157, -4267, 3509, 5317, + -574, -11094, 1078, 6240, 1593, -12773, 408, 3960, + 1116, 1517, -816, -577, -696, 554, 1645, -936, + 83, -20255, -754, 1460, 1110, 1412, -757, 377, + 2373, -1608, -1414, -1028, -3152, 1534, -4145, 2274, + -286, -7058, 2286, 4013, 2515, 2681, -5602, 0, + -1740, 257, 756, 11496, 954, 4513, 3968, 4851, + 278, -511, 829, 2853, -9743, -3723, -1550, -444, + 4256, -679, -11411, -4290, -1470, -4191, -952, -239, + -198, 1361, 9527, 1481, -981, 1403, 991, -255, + 9326, 1832, -1936, -135, 1123, 2756, 1932, 2543, + 795, 12612, 2429, -498, -13185, 3812, -1628, 196, + 1822, 4333, 2760, -676, -2902, 1244, -1974, -7046, +-12216, 1503, -2176, 1916, 365, 636, -11348, -5030, + -3319, -3794, -1016, 1157, -4158, 3424, 344, 4494, + 812, -3074, 4356, 293, -3463, 1232, 1746, 2696, + -8269, -961, -4316, 130, -4278, -14007, 3025, -2703, + 179, -10176, 1511, -1460, -1100, -1171, -1575, -2596, + -2026, -11400, 2689, 1480, 743, -1669, 2728, 742, + -60, 11452, 84, -662, 1424, -15103, -410, 2141, + -1664, -1378, -122, 97, -358, -820, 382, -3865, + 374, 1698, -21, -752, 595, -8771, -731, 9368, + 1698, -2586, -6790, -2507, -1776, 4993, -3867, -2807, + -190, 14465, -13938, 3095, -1198, 374, 1682, 1888, + 286, -576, -2094, 454, -690, 1396, -1139, -422, + 405, 238, 1718, 2048, 13448, -151, -247, 202, + -900, -5630, 3121, -10988, -1615, 1955, -3901, 3360, + 1429, 3928, 1951, -1099, -435, 1572, 1500, 19176, + 731, -439, 3686, -3039, 244, -4270, -34, 1289, + 296, -406, 2216, -1400, -1946, 264, 1536, 2992, + 54, 892, -181, -1545, 278, 24923, 989, 1301, + -1279, -188, -198, -661, 612, -1520, 2355, -12972, + -694, -560, 1364, -2988, -6236, 2555, -6630, 1423, + 440, -598, -1092, 304, -2529, -1698, -909, 2560, + 844, 768, -2988, -661, 18432, 1158, -639, 5070, + 11015, -14, 2313, 756, -1941, -10986, -490, -5235, + 2646, 2406, 170, -546, 337, 6499, -4450, 5598, + 299, -504, 14322, -972, 9356, -2056, 8812, -1599, + -1931, 2084, 119, -983, -305, 1437, 403, 2651, + -159, 229, 209, 1438, -1789, -1159, 1017, 416, + 408, 454, 858, -652, -1554, 1198, 18278, 122, + 433, -165, 162, -10532, 11563, 4754, -2022, 4246, + -1396, -2417, -1796, -1496, -1279, 3877, -1217, -770, + 983, -609, 1766, -184, -5664, 546, 7948, 1978, + -250, 4350, 3498, 2797, 802, 846, -12628, -1092, + -240, 781, -11252, -955, 9944, -222, 1177, 1262, + -534, 1790, -7396, 1452, 4251, 303, -3714, -2295, + -290, -227, 672, 22690, -622, -466, 1599, -496, + 326, 871, -1948, 148, 449, 214, -2175, 713, + 394, 1921, -28716, -786, 1083, -641, 1232, -246, + 1572, 1575, -879, -2962, -57, 369, 1633, -1457, + 1194, -1222, 304, -955, 104, -1249, -935, 135, + -758, 3483, -1190, 1457, 1130, -1284, -3709, 18042, + 6, 25, 1233, -328, 347, -512, 2071, 328, +-18037, 4582, 3841, -434, -745, 332, -576, 3006, + 336, -11505, -646, 3509, -996, 1270, 2041, 1353, + 1193, 2976, 11569, -3165, 1450, 4351, 2522, -10022, + -6, 12602, 874, 518, 475, 1251, -3290, -2674, + 4802, -11794, -946, -426, -2846, 1619, 1105, -1022, + -1, 1759, 646, 10347, -2937, 13505, 1104, 614, + 1149, -800, 2377, -115, 792, -948, -2431, -1779, + -1142, 809, -3130, 447, -15516, 313, 11235, -1346, + -2426, -2737, -1738, 2236, 1094, 802, 1323, 3612, + -213, 1383, 2800, 10394, 1210, -2360, -10203, -1991, + -102, -2669, 2303, -2184, 1830, -1158, -5633, -4083, + -252, 311, 612, -331, -2786, -12421, 9994, -6006, + -4996, -954, 1014, -1147, 860, 1252, 1114, -2069, + 266, -230, -591, -4442, 230, 20603, 1386, 1130, + -1468, -3600, 2168, 836, -1754, -511, -542, 216, + 26, 3476, 1165, -4293, 3098, -245, -579, 1830, + 2248, 5326, -18357, 397, 5466, 734, 3920, -3678, + 319, -1062, -610, -7509, -1064, 1456, -5729, 1088, + 9099, 2266, 241, 201, -10017, -1545, -2799, 1491, + 27098, -60, -1736, 1387, 859, -1474, -79, -1122, + -971, -1302, 906, -1133, -2659, -296, 1344, -2698, + -448, -1476, -212, -1585, 1310, 14353, -2165, -2229, + -656, 5219, -3266, -1850, 7942, 4997, -2295, 519, + 608, -9498, -1700, 1770, -15308, 1286, -2914, 2252, + -717, 2136, 2478, -3747, 2362, -5, -237, 2334, + 701, -774, -672, -20, -599, 623, -700, -713, + -979, -29926, -1090, 848, -141, 1273, -711, 1782, + -221, -103, 170, -185, -1059, 3066, 1321, 1182, + 3641, -217, 1959, 11806, 2390, -10312, -2575, 1612, + 596, -352, 2197, -2041, 2385, -898, -9363, -1144, +-10896, 20, -7842, -1047, 3687, 2147, 2584, -249, + -72, 32767, 1936, 446, -889, -845, -896, 1269, + 448, 327, -3411, 4, 702, -1900, -646, 799, + -770, 662, -911, -856, 287, 1667, -108, -64, + 16, 1578, -2059, -27327, 112, -188, 2504, -692, + 250, 360, 564, 868, 4147, 1340, 18080, -3584, + 445, 364, -2623, -412, -2918, -116, 2611, -2396, + -44, 10934, -1512, -1166, 239, 913, 190, -14681, + -767, 2610, 2931, -2389, 3590, -1680, 6287, -531, + -616, 1317, -1034, -900, 871, -329, 467, 1200, + -1914, 1108, 3150, -6878, 544, -14411, 2807, 5427, + 13361, 1448, -1753, 524, -5851, 1467, -1866, 6888, + -8742, 1372, -1515, 4883, -2248, -1042, 4628, 10768, + 149, -358, -1287, -1289, 32767, -1137, 941, -2112, + 451, -1436, 174, 294, 475, -3667, 1610, 1641, + -599, 626, 2058, 671, 1626, -985, -123, 2040, + 421, 1797, 18448, 2538, -359, -5042, 3096, -1136, + -320, 1823, 30, -12002, -1297, -850, -418, -1497, + -1761, 5073, 10944, 212, -4713, -1614, -1752, -2135, + 483, 1043, -1989, -293, 39, -1049, 67, -7482, + 712, -5358, 896, 12460, -1744, -1793, 1538, 3577, + -6, 418, -72, 1072, 1367, 1080, 3564, 1468, + 482, -1298, -6442, -299, -12934, -757, -4199, 3842, +-11331, -1216, -206, 1598, -1135, -3240, 3294, -286, + -540, 777, 1188, -1189, 4516, 2638, 2071, 9702, + -900, 1002, 18707, -705, -1856, 1185, -4832, -1694, + -3502, -2324, -2826, -4600, 1996, -3110, 110, 117, + 405, -16854, -510, -14725, 1699, 1922, -2117, -2718, + 45, 1064, 507, -1781, 2106, -2310, 1239, 5860 +}, + +.cb1108l0 = { + 2354, 8016, 12528, -947, -348, 1760, 2054, -3960, + -2125, -3578, 3932, 1647, -3316, 6053, 392, -3128, + 3209, -2445, 463, -2835, -1555, 1259, 296, -1465, + 1839, -4811, 420, -215, 469, -1013, -272, 185, +-27061, -1154, 8, 298, 259, -953, -555, 472, + 617, -1127, -673, 982, -398, -1681, 328, 882, + 614, 800, 431, 84, 880, -240, 15758, -14324, + 1301, 1578, 932, -694, -1456, 2435, -1651, 1464, + 227, 1527, 527, -128, 698, 2405, -726, 1489, + 1016, 1938, -1897, -1478, -238, 932, 2507, -519, + -1147, 557, 2334, 700, -12914, 14861, 158, 255, + 1195, -883, 3359, -1045, 2095, 520, 249, 926, + 789, 1392, -185, -1654, 902, 9, -2166, -1916, + 543, -2126, 2842, -332, 1356, -344, 436, -404, + -174, -489, 858, 258, 229, -45, 327, -316, + -1176, -454, 115, -220, -458, -194, 271, -530, + 1572, -574, -25068, 167, 601, -1027, -1705, -3144, + -4231, -1636, -1012, -1002, -519, -825, -458, 945, + 546, 193, -17909, -156, -1067, 826, 338, 1152, + 562, -506, 848, 239, 188, 656, 97, -174, + -59, 242, 1946, -67, 745, 2043, 424, -192, + 574, -524, 1553, 566, 1480, -747, 487, -20623, + 872, -1089, 1034, 1357, 919, 153, 154, 498, + 54, 555, -989, 707, -85, -21, 700, -1424, + 90, 655, -399, 123, -709, 117, 438, 330, + -720, 190, 812, -138, 460, -32768, -162, -410, + -327, -122, -1208, -554, -502, -178, -309, 373, + 4295, -945, -5502, -2752, -6615, -1241, 1278, -1315, + -7683, -986, -419, -50, 2384, -4640, -6246, -11804, + -308, -446, 3486, -4824, 1736, -590, 960, 195, + 593, 164, 3355, 1655, 1233, 66, -787, -347, +-13751, 74, -1209, -812, -4098, -102, 910, -1659, + -2036, -3147, -2075, -2605, -1240, 4499, 1727, -9484, + 549, 728, 3411, 1958, -4439, -1064, 5690, -1600, + -1984, 1695, -588, 4815, -138, -3380, -512, 1553, + 1978, 4310, -730, -402, 828, 2124, 14216, -222, + 2757, -8686, 523, 2516, 1017, 790, -136, -470, + -252, -717, 808, -1113, 13766, -114, -1182, 3053, + -5238, -2231, 1720, -511, -987, 1592, -1257, -2578, + 1777, 1075, 2367, -227, 2330, -672, -2620, -1449, + 2122, 362, 1249, 1338, -327, -21631, -1540, 24, + -2356, -656, 1981, -92, -207, -2188, 34, -457, + -1291, 1231, -460, -128, -396, 593, -671, -1513, + 136, -335, 560, -1121, 490, 1008, 948, 8629, + -3344, 467, 881, -5731, 1120, -300, -1432, 1227, + 1558, 990, -1078, 214, -922, -81, 1120, -15586, + -1176, 1203, -1911, 151, 1484, 1555, -421, -420, + -428, -762, 292, -59, 1075, -649, -841, 494, + 194, 27, -768, -356, 54, 163, -73, 293, + -1717, -392, 750, 234, 751, -111, 26858, 911, + -389, 451, 442, 260, -117, 270, 19, -2429, + 618, -962, 378, 10, -1954, -1336, 525, -258, + -693, -4155, 10265, 2924, -1361, 3197, 10199, 6870, + -2608, -5792, 619, -1994, -2035, -701, 2598, 465, + -575, 311, 175, 162, -1191, 162, -157, -147, + 325, 551, 536, -188, -290, -165, 343, 14, + -268, -27113, 278, 127, -233, -68, 606, 125, + 665, 438, -442, 2510, 800, -1991, -641, -386, + -1574, 78, 946, 189, 106, -2249, -268, -1708, + -1192, 986, 3076, 1807, 21, -5884, -964, 256, +-15916, -1320, -2867, -3562, 491, 3502, -337, -1542, + 496, -3182, 1676, -2371, -4264, -2053, 14342, -5674, + 1744, 1813, -3731, -3761, 1350, 1783, -438, -920, + 2366, 1438, -687, 512, -1934, 323, -3158, 1775, + 1964, -6742, 10162, 7763, 1469, 1967, 851, 2742, + 7413, -3338, 742, 1854, 310, -192, -936, -1770, + -775, -976, -1532, -1436, -670, -4032, 1194, -1336, + -4369, 332, 604, 962, -27563, -972, 842, -743, + 275, 713, -251, -799, -1190, 372, -213, -423, + 202, 1189, -31, 1084, -974, 756, -148, -1669, + 640, -549, -339, -1506, -112, -598, -870, 410, +-13307, 13141, -1911, 2308, -92, -776, 221, 1503, + 1578, 803, -308, -1672, -404, -83, -3517, -1327, + -606, -2426, -61, -513, 318, -1805, 2049, 1887, + -777, 1268, -542, -116, 3550, -18840, -2986, -979, + 2653, -2875, -922, -10520, 804, 107, 3234, -1270, + -608, 1042, 3599, 965, -342, -2096, -267, 1704, + -3939, 791, 2180, -985, 816, -716, -2661, 99, + 1523, 11902, -1782, 775, -12517, 3244, -3762, 2046, + -278, 1539, 2895, -2425, -10, 990, 1484, -1377, + -3399, -984, 3171, 1513, 696, -785, 155, -1072, + 414, 2016, -1932, -3124, -1126, 68, 3855, 1360, + 4074, 17596, 1714, -596, 4000, 1656, 230, -258, + 2266, 843, -1720, 4624, -714, 854, 696, 636, + -1357, 350, -1256, -523, 168, -9933, -766, 198, + 2680, 8060, 2168, -2789, -14255, 1444, -520, 169, + 1032, 1478, 294, -644, -320, 856, 1282, -216, + -1000, -925, 2, -890, 679, -629, 1152, -1329, +-13941, -16385, -1050, -1022, 106, -1151, -41, -709, + 1771, -882, -729, -1420, 1544, -120, 386, -838, + -2744, 1559, 904, 273, -4221, -1065, -312, -1046, + 234, 830, 387, 172, -956, -332, 360, 408, + 125, 90, 348, 915, -264, 911, 263, 124, + -620, -612, 220, 164, 202, 124, -30252, -159, + 1006, -320, 283, -1641, -1312, -9057, 5525, 7520, + -2884, -12194, 2771, -1164, 1842, 1261, -582, 766, + 2498, 393, 953, -617, -756, -323, -1862, 1195, + -1326, -436, -965, 366, -6727, -1226, 9014, 400, + -1258, -812, -279, -404, 1621, 86, 1622, -16, + 96, -515, -257, -39, -134, 1843, -294, -491, + -908, -120, -720, -1162, -1555, 405, -134, 528, + 23596, -77, 183, -444, 2077, 955, 649, 2246, + 3236, 735, -1202, 7954, 9440, 6134, -7267, 28, + -3398, 500, 4965, -1230, 306, 357, 2942, -906, + -4733, 903, -3945, 4447, 1046, -1125, 465, 1183, +-12710, -1018, -11302, 5177, -219, -6232, 1552, 2061, + -1372, -1290, -822, 295, 814, -3003, -527, -614, + -856, 802, 167, 1178, -494, -1625, 754, -1550, + 682, -1286, -480, -694, 86, -67, -1429, -1235, + -559, -311, 322, -308, -56, 296, -158, -24, + -748, -197, 26954, 1054, 209, -226, 165, 681, + -131, 341, 341, 1510, 615, 907, -264, 1355, + 388, 198, -5, 418, -783, 28539, 82, -559, + -459, -344, 279, -114, 966, -529, -423, 286, + -418, -766, 42, 186, 461, 418, -688, 2937, + 2793, 146, 1709, -665, 2022, 293, -1522, -2740, +-15926, -600, -1503, -1732, -2827, -1027, 1702, 252, + -643, 470, -815, 858, -1954, 1190, 1847, -16, + 266, 29, 486, 25985, 139, 220, 433, -330, + 168, -362, -562, 180, 906, 386, -845, 664, + 1064, -616, -1498, -335, -164, -930, -854, -869, + -101, -204, 835, 117, -16034, -4478, 2634, 1629, + -1873, -1156, -373, -526, 2537, 967, -2433, -857, + 1264, -1670, 113, 845, 7654, -1343, 5245, -1605, + 2236, -1190, -48, 3340, -1981, -1606, -1369, -227, + -727, -570, 1136, 1868, 667, 92, -144, 531, + 949, -1086, 530, 1764, 302, 190, -28036, 182, + 825, 229, -656, 585, 444, 200, -1195, -1855, + -387, -781, 1156, 692, -1164, -517, -464, -275, + -328, 218, -970, 174, -384, -561, -38, -720, + -140, 1021, -271, -57, 463, -25313, -342, -40, + 26, 159, -854, 916, -1532, -1033, 265, 105, + -719, -588, 96, -435, -296, -226, 224, 357, + 30, 576, -66, -30037, -72, 374, 32, 256, + 304, -852, -706, 248, -741, -379, 980, 629, + 1344, 3858, -2211, -153, -3914, -3775, 1570, 718, + -1042, -1338, -4409, 1338, 5118, 5186, 3619, 2142, + 9081, -2784, 4169, 3598, 6621, 4562, -170, -614, + 1196, -1174, 5024, 721, -71, 267, 4, 25598, + -369, 356, 331, 1099, 377, -356, -938, 1161, + -863, 1107, -132, 222, 148, 1410, 908, 60, + 377, 1280, 468, 690, 454, 247, -4552, 6122, + -267, 2973, -5932, -6424, -4983, -4193, -3386, 1691, + 1349, 1419, -3730, 300, 12150, -2927, 1588, -34, + -2435, -271, -961, -1744, 1881, -73, -453, -788, + -798, 9166, 2744, 858, 342, 991, -287, 822, + -37, 1156, -1493, 723, -14127, -1755, 2029, -933, + -1276, 632, -5249, 464, -272, 1149, -290, 4693, + -728, -1475, 841, 10, -283, 92, -268, -295, + 358, 160, 405, 2, -381, 679, 716, -190, + 128, 275, 255, 123, -412, -453, -273, 26, + -174, -340, 644, -376, 27584, -25, 66, 3107, + -1707, 911, 500, -1029, 1029, -1557, 9020, -398, + -2512, -582, 1131, -16696, -429, -1284, -3, 2320, + -532, -302, -174, -146, -413, 2152, 1009, 42, + 402, -1471, 157, 5742, -782, -229, 2379, 646, + 2842, -1776, -463, -2749, -3617, -1710, -12281, -566, + 263, -3174, -2337, 9590, -1150, 2465, 4577, 2064, + -648, -2175, -1877, -674, -634, -338, 343, -1492, + 878, -530, 1072, 13670, -4542, 746, 9704, -4188, + -7076, 1179, -740, -589, -876, 268, -1080, -986, + -4584, 2692, 3032, -2067, 230, -3533, 944, -4950, + -1908, 1452, -255, -698, 1460, -606, -250, -154, +-22303, -945, 1626, -588, -482, -1549, -129, 978, + -631, -722, 1094, 1771, -311, 532, -508, 696, + -1128, 1270, 854, -84, 4290, 414, 3351, 1061, + 931, -2936, -9606, -35, 2514, -1095, 567, -452, + -8520, 4037, -431, 2744, -2276, 2647, -1188, -454, + -400, -3698, -315, 11558, -667, 512, 162, -395, +-13015, -11, -1944, -890, -14358, -3850, -4296, 1310, + -580, -248, 1305, 402, -1049, 115, 2085, -1797, + -1172, -321, -919, -313, -512, -131, 1619, 576, + 499, -2024, 130, 14, -76, -6324, 495, 2445, +-16757, -2348, -2706, -1906, 2377, -2252, -619, -2579, + 643, -661, -1276, 935, 893, 992, -2204, -2451, + -395, -508, 1163, -216, -13034, -718, -1018, -1675, + -698, 710, -257, 2658, 1178, 2046, -2270, -2588, +-14442, -1142, -1026, 2247, -536, 314, 123, -1175, + -673, 1576, -2600, 5, 964, 619, -1714, -14811, + -1502, -1646, -1151, -93, -11652, -222, 343, -2203, + -351, -928, -289, 2679, 2101, 742, 747, -2245, + 146, -1828, -2728, 1058, 1048, 3046, 242, 4432, + 246, 350, -13419, 768, -805, 1819, 14332, 1316, + -370, 391, -1421, -1426, -355, -812, -64, 196, + -2917, 1097, -1550, -1246, 436, -62, -813, 1350, + 555, -2236, -1589, 980, -1483, 10122, -2434, 7236, +-15225, 1513, 2090, -1224, -83, -2821, 664, 658, + -3242, -1031, 1509, 2667, -160, -1315, 1060, 891, + 432, -1311, -2503, 1304, 1295, 1745, -722, -2496, + -4409, -3360, -2776, -2793, -4921, 12616, -1031, -443, + 1495, -2416, -4640, 4508, -2944, 2608, 1323, -394, + -415, -2111, -2065, 1030, -3636, -1338, 2916, -3007, + -3680, -3152, -115, 577, 2742, 785, -4429, -1945, + -304, -4883, -133, -3136, -1927, -576, 618, 1780, + 2568, -2102, -158, -3986, -1187, 280, 655, 162, + -1352, -5730, 15372, -1314, 1553, 274, -2873, 4221, + 4610, -4143, -13699, 2760, -1255, -238, 1487, 1583, + 1422, -2272, 4734, -6368, 795, -406, 1498, 1588, + -500, -2744, -875, 2080, 1901, 960, 344, 979, + -258, 952, 2526, -11785, 893, 669, 1361, 518, + -1368, 3854, 2539, 623, -1835, -4177, 2686, -2956, + -2804, 1121, -8890, 1377, 1125, -3990, 140, 3594, + 1757, 2271, 366, 1723, 2150, 13557, -1768, -1433, + -6632, -578, 3266, 2509, 7142, 680, 1532, 1318, + -1123, 5668, 1283, -412, -5404, 2893, -2647, -2695, + -1412, 340, -650, 863, 1895, 2867, 384, 626, + 856, 508, 1365, -295, 960, -26080, 234, -4, + 239, -412, -6, -765, 736, -30, 136, 912, + 538, -792, 413, 871, -437, 305, 30, -194, + 1105, -1113, 3550, -4854, 449, -549, -7626, 3706, + -3698, 1778, 1441, 2240, 73, 513, -3383, -2346, + -1372, 3955, 2973, 1175, -6087, 5071, -2135, 8552, + 4961, -1201, -1458, -2627, -730, 515, -756, 476, + -1104, 2115, -1276, 498, 336, -451, 809, -1030, + 556, -211, -70, -93, 89, -755, 296, 872, + -282, 380, -298, 2774, 660, 1339, -545, 429 +}, + +.cb1108l1 = { +-13570, -9232, -673, 267, -819, 1633, -33, 623, + -850, -4376, -1135, 999, -262, 1928, 695, -1751, + -2793, 772, 5064, -1158, 280, -2144, 1313, 888, + -2482, 469, 2996, -1406, 12525, -1200, -1202, 939, + -3, 847, 818, -924, 135, -1308, -12000, -544, + -592, -3914, 441, 3372, 3188, 1314, -1836, -706, + -844, -1319, 1029, -1754, 172, 2468, -903, -889, +-14602, -2054, 11694, -1980, -730, -1661, 214, 1243, + -337, -646, -95, 1432, -854, -236, 88, -2, + 514, -1643, -84, 3561, 302, 770, -1248, 480, + 664, 738, 1728, -1783, -2227, -702, -3582, -16641, + 1713, 1506, 660, -2471, 2061, -48, -3161, 1697, + 900, -1477, 558, 287, -5515, 1023, -1972, 999, + -1856, -3022, -228, 711, 1270, 2644, -648, 1064, + 3899, -1205, -754, 1080, 1262, 18, 860, 2274, + 655, 494, -221, -15647, 1334, -473, -1648, -341, + 3541, 3109, -1671, 639, -2491, 185, 477, -388, + 5198, -5680, 812, 700, 2180, -536, -19468, -2508, + 2592, 2901, 32, -1165, 1500, -422, -790, -1914, + 971, 111, 1226, -1302, 541, -3862, -832, 642, + 305, -3870, 8921, 570, 180, 1734, -1572, -891, + 17672, -756, 702, 2740, -647, 2122, 102, -1371, + 461, 454, 204, -307, -1248, -2330, 1353, -1783, + -1939, -601, 512, 2118, -2178, 254, 1190, -1252, + 923, 1166, 360, 320, 320, 1210, -142, -416, + 1260, -205, 1403, -1025, 19252, 328, 58, 21, + -1044, 1786, 2153, 697, -436, -1617, -869, -493, + -2419, -3102, 1995, 1519, -1799, -153, 2689, -665, + -1371, -915, 18486, 941, -2612, -1057, 1076, -3351, + -48, -1478, 575, 728, 130, -168, 40, 898, + 2141, 1518, -965, -1910, 896, 838, 1220, 416, + -1494, 1404, -126, 21472, 604, 1740, 102, -812, + -796, -734, 1082, -507, -468, -1732, 1171, 252, + 359, 436, -765, 791, 726, -810, 1838, -1798, + 5662, -2362, 1275, -2829, -4041, 1398, 2681, 480, + 13740, -752, 2252, 1306, -1026, 1834, 54, 9993, + 559, 1370, 711, 1918, -1757, 646, 16, -3262, + 2676, 1751, -2595, 4782, -1050, 2401, -15131, 1100, + 386, 708, -359, 455, -25, -950, 241, -482, + 268, 2327, -2766, -142, -1992, -566, -36, 990, + -6302, 3245, -1394, -1579, 760, -757, -2115, -8542, + -2945, -800, -4027, -3102, -1319, -1989, -1787, -426, + 590, 1031, 467, 31, 2674, 1686, -14352, 1174, + -1446, -813, -1267, 2919, 2052, -1574, -753, 3369, + -1090, 3830, 2042, 11376, 1140, 895, 1130, -720, + -1284, -2277, 49, -724, 397, 13201, -985, 1599, + -365, 1517, -496, 978, 2152, 1391, 1777, 3032, + -936, 280, 1719, -4551, 4874, -941, -160, 956, + -676, -229, -548, 183, -16606, -855, -3433, 1248, + -578, 2254, -532, 3081, -1406, -1859, -605, 1809, + -1001, -114, -1222, 3890, -609, 3114, -2430, -2142, + 440, 1780, 1606, -4211, 1047, -456, 8280, 9, + 5866, -1718, -932, -13049, -562, 3097, -583, -21, + -1972, 1254, -172, 527, 2282, 5064, -5391, 1074, + 357, 1845, 24, -996, 100, -50, 1098, 2905, + -417, -937, -439, 247, 18502, -2380, -2088, -402, + -580, 83, -282, -70, 969, 540, -219, -1132, + -1701, -195, -3030, -2748, -1974, -1304, -1909, 1080, + 1042, 1124, -128, 5816, 2303, 2840, -2420, 35, + 16550, 721, -2079, -1489, 1023, -654, 2025, 1479, + -185, -2449, 500, 3034, 2663, 3911, 1203, 998, + 594, -533, -163, -262, 739, 13, -426, 182, + 394, 350, -30055, -371, 150, -430, 147, -1122, + 43, -390, 298, 831, -194, 158, -114, -257, + -1346, -585, 206, -456, 478, -502, -1710, -1719, + -581, -536, 45, -861, 825, 1093, -255, -685, + 38, -20, 419, -594, 10, -1408, -526, -19191, + 196, -1496, 255, 1844, -8759, -3565, -1009, -926, + -818, -1195, 236, 2898, -182, 14344, -1384, 1064, + 1181, -1846, 543, -583, 170, -3305, -1187, -2406, + -40, -1051, -1071, -28, 1482, -1060, -1057, 3028, + -2023, 913, 1052, 980, -5158, 4642, -14067, 3920, + 1450, -4497, -1591, 842, -2222, -392, -42, -3546, + -258, -3566, 2595, 225, -2696, 4624, 2283, 1483, + -1506, 2164, 151, 380, -3207, -1086, -10594, 2005, + 2379, -2567, -925, -363, -1261, 13174, -73, 1168, + 2215, -1721, 726, 525, 1048, 322, -827, 2117, + 3890, 1346, -3512, 2243, 638, 2259, -1371, -2260, + 10590, 851, -1247, -894, 1871, -882, -1955, 3822, + -3654, -1730, 906, 2074, -548, 885, -2501, -1316, + -3275, -10694, 2031, 1077, 3013, -1105, 2951, 1907, + 1218, 194, 1860, -1662, 178, 915, 1092, 809, + -451, -610, -728, 799, -129, -101, -905, -2, + 2470, 1292, -137, 544, -18795, -1081, -300, -59, + 282, -329, -544, -1324, 2155, 9326, 462, -388, + -303, -2940, -608, -13652, 532, -1350, -1026, 1330, + 5559, -333, 4961, 707, -1832, 1070, 2483, -2016, + -315, 2197, 849, -348, 379, -2179, -15691, 903, + 3192, 3888, 396, 4610, 3261, -2589, -4903, -643, + 3604, -1380, 1524, -2155, 469, -3528, -790, 429, + -3862, 1797, -104, 2364, -1162, -1559, 1011, 1849, + -235, -1952, -2088, 1436, 2502, -3862, -1704, -14859, + -2863, 710, 624, 4373, -6302, -616, -807, -1577, + -2492, -620, -917, 948, 4957, -848, -863, 514, + -2210, 2162, -753, -15168, -2068, 12472, -2611, -723, + 2797, -8573, -2270, 978, -2597, 2215, -684, 2535, + 3114, -261, -178, 2385, -4869, 1161, -32, -1469, + 2074, -1407, 3226, -992, 4546, -3158, 1044, 463, + -5285, 4, -1396, -1395, 1770, -1767, -860, -6, + -2242, -1548, -667, 587, -982, -2246, -1312, 1550, + -542, 5302, -716, 135, -15895, 3382, -478, 1279, + 615, 3365, 1620, -12613, -230, 3101, 3230, -1307, + 2860, 628, 647, -3595, -214, -1631, 2783, 748, + 1088, -57, -6014, 2496, 359, 719, 1476, -750, + -1644, -2125, 3913, -3788, 565, -1118, -1411, 1377, + -1020, -246, 18851, -1438, -1150, -1492, -681, -798, + -776, 960, 911, -1449, 336, -1114, -2111, -877, + -532, 668, 1018, 1098, 408, 2032, -607, -656, + -5997, 3089, 2462, -18368, -1027, 78, -4066, 439, + -845, 1476, 290, 490, -452, 1638, -3381, 80, + 1699, 458, 260, 1215, -516, 1883, -62, 35, + -2540, -1703, -1042, 1751, -422, 1222, 207, -104, + 1112, 151, -473, -522, 26426, 562, 884, -2201, + -281, 238, -839, 1037, -588, 81, -109, -2, + -32, 75, 654, 489, 524, -388, -1408, -906, + -1193, -936, -273, -40, -100, -662, -522, -145, + 119, 614, -922, -25329, -180, -668, -574, 161, + -448, 173, 750, -609, -812, -125, 814, 572, + 2602, 20372, 244, 1820, 724, 515, 932, -1290, + -712, -990, -305, -13, -763, -1157, 481, -764, + 320, 624, -620, 642, -1494, -568, -601, -655, + -790, -1348, 334, -1302, 382, 782, -1122, -641, +-23549, 180, 463, -634, -666, 599, -356, -1071, + 816, -576, 1208, 912, -377, 624, 1049, 42, + -95, 370, 1932, -167, -275, 142, -159, -410, + 595, -562, -632, 748, 1192, 614, -41, -18, + -156, -61, 1280, -686, 363, 759, 756, -19362, + -614, 2151, -1185, 169, 327, 1494, 782, -1313, + -134, 841, 218, -76, -2980, 202, 80, 281, + 89, -61, -1678, 59, -125, 195, 320, -1310, + -56, 806, 47, -65, 249, 18432, -666, -506, + -204, -194, -560, -416, -3641, 330, -268, 842, + 10600, -176, 424, -1744, -3609, -1682, -844, -309, + -538, 435, 14251, -1281, 373, 2748, -702, -1358, + -766, 3480, -679, 4039, 529, -5698, -38, -813, + 1203, 4734, 318, -1044, -5109, 2187, -3474, 415, + 2436, -3021, -1628, -456, -1451, 3406, -1798, 1001, + -8648, 468, 1188, 497, 4628, -948, -4073, -11894, + -2750, -738, 1520, -4070, -810, -5755, -1370, 2978, + 4460, 917, 1221, -324, -1166, 2339, -1221, -2048, + 714, 6884, 3096, 6998, 13, -275, -3879, 790, + 104, 1383, 2056, 1957, -9216, -430, -199, 261, + 764, -109, -210, 795, 884, -334, 1546, -272, + -35, 738, -268, -13, -448, 645, 97, 76, + 1284, -343, -654, 112, 643, 22846, 634, -597, + -621, -784, -380, 951, -452, -685, 140, 688, + -770, 247, -679, -228, -26856, 311, -546, -444, + 606, 69, -195, 18, -220, -334, -42, 543, + -28, 492, 766, 208, -1206, -554, 213, -1112, + -1675, -608, 382, 2011, 5077, -17442, 1367, -702, + -856, -416, -1728, -1987, 2966, -1952, 38, 152, + 712, 210, -589, 3029, -1189, -2016, -8071, 10746, + -2143, -556, -1964, 162, -504, 995, 982, -2565, + -634, -985, -1668, 444, -2098, -411, 488, 1397, + -1134, 1888, -920, -279, 15057, -757, -1258, -3040, + -890, -105, -670, -490, -238, -2419, -1302, 915, + -784, -929, 1653, -89, 1076, 445, 2538, -1424, + 19175, -91, 437, 752, 254, 935, 854, -1666, + -86, -543, 1053, 664, -155, -485, -3994, -50, + 50, -58, -2626, 1801, -314, -16052, -1831, 1009, + 2344, -3030, -938, 1761, -1283, -150, -425, -6660, + -900, 1374, 803, 549, -2683, 837, 483, -655, + 4610, 1259, -45, 834, 1103, -3250, -3604, -2882, + -2463, -5331, 11312, -1653, -3505, -1855, -4962, 8579, + 2370, -2474, 501, -1282, 985, -924, 3452, 456, + -242, 3878, -2095, 2994, 7076, -459, 2574, 16116, + 8277, -88, 572, -38, 0, 1664, -553, 1820, + -2096, 1076, 415, -420, 1900, -1696, -130, 298, + -1555, 201, -404, -1831, -932, 844, 9606, -497, +-16304, 3278, 918, -523, -1573, 2488, -813, 147, + 1540, 3795, 1390, 1061, -78, -10, 574, 2620, + -1143, -512, -582, -1496, 736, -4323, 786, -2873, + -1342, 3932, 14508, 12635, -899, 1730, -673, 386, + -676, 2787, -2780, -2960, 375, 475, -2188, 2250, + 851, 788, 268, 1264, 2973, -94, 1062, 1006, + -697, 669, -635, -986, -4848, -1486, -6, -3914, + 6267, -1560, 8, -503, 5273, -3545, 69, 15146, + 2263, -1490, -548, 1740, 1636, -892, -895, 769, + -471, 226, 6497, -2466, -2037, -1068, 1075, -902, + 13668, -1213, 12424, -3523, -124, -1090, 972, -1134, + -494, -2568, 881, -3081, 369, -254, -618, -914, + 443, -1254, 658, 1322, 546, -14, 778, -116, + -378, -802, -268, 48, 1140, 25942, 503, -637, + -871, 1050, 298, -187, 387, -406, 343, 212, + 110, 723, 695, -47, -50, -568, -66, 347, + -1588, 20, 701, -485, -98, -787, 4502, 1046, + -1628, -2526, 185, 1016, -256, -700, -403, -154, + 103, -752, -689, 2084, -1463, 2294, 360, 17590, + -698, -1262, 788, 116, 755, 751, -440, -610, + -469, 1235, -2314, 1240, -308, 553, 1065, 24442, + -733, 667, 4, -484, 93, -263, -361, -278, + -1524, 176, 1311, 1561, 435, -436, -1079, 260, + -366, 472, -1049, 647, 158, 302, -931, -36, + -990, 736, -444, 1077, -1560, -251, 148, 1000, + 1096, -300, -224, -307, -17646, 39, 206, 74, + 505, -3051, -1285, -793, -724, 718, 324, 803, + 874, 6062, -2235, -3321, -550, 9264, 3483, -4172, + -4024, -471, 858, 2682, -1078, -1922, 2088, 1135, + -878, 545, 2205, 836, -1088, 547, 12461, 2222, + -828, -3841, 4797, -2360, -2510, -4029, -2213, 13736, + 1032, -958, 1895, 264, -1499, -2066, -241, 1324, + -224, -792, 776, 2130, 2600, -2276, -4239, 3260, + 1610, -1620, -1220, -2752, 979, -2028, 19626, -2146, + 684, -729, -235, -289, 588, -600, 245, -879, + -816, 413, -87, -1158, -246, 69, 970, -111, + 500, 1097, 1087, -138, -1356, 30, -434, -452, +-22802, 177, 492, 206, -257, -854, 1445, 37, + 1384, 97, -258, 811, -222, 53, 548, 1744, + 124, -1031, 1076, 186, 453, -173, 1180, -2235, + 583, -392, -1542, -726, 2937, -3635, -856, 1446, + 7796, -2779, -962, -2277, 1651, 1960, -1460, -1277, + -9794, -288, 2459, 2350, -2521, 84, 578, 2286, + 480, 1620, 6421, -200, 170, 1513, 198, -1001, + -491, -1000, 161, -482, 607, 214, 743, -292, + -394, -192, 92, 73, -415, -316, 593, -42, + -346, 456, 44, 950, 129, -189, 806, -221 +}, + +.cb1108s0 = { +-32768, -828, 9569, 331, 6938, 3122, -1008, 2847, + 646, -5690, 1712, -795, -4406, 1368, 307, -526, + -2206, 26, -210, 1358, 746, 1920, 667, 3866, + -413, -720, -4328, -2475, -1189, -863, -3809, -5052, + -8567, 2859, 1915, 4895, 12440, -13002, 2757, -5969, + 4054, 1100, -9430, 4930, 10266, -1522, 7092, -8778, + -1968, 4325, 8440, 3888, -1966, -688, -2455, 2966, + -2380, 1682, 4956, -2310, -3706, 404, 6774, 17562, +-12437, -2667, 4864, -9411, -6436, -9316, -903, -5526, + 3463, -1690, -5250, -12568, 2338, -1310, -3019, 776, + -641, 3483, 54, -10732, -3878, -691, -17615, 4530, + 10267, 7830, 8488, -12624, -4514, -17183, 7070, 3115, + 4176, 383, -4558, 410, 6379, 6242, 4702, 4853, + -217, 446, -3811, -2396, 244, -2120, 3275, 5122, + 180, 4523, 8680, -1868, -6164, 2636, -5056, -4039, +-11618, 4014, 11349, -2616, 8240, -5119, 1988, -2552, + 6060, 3206, -662, 2686, 1116, -10447, -3004, 650, + 7811, -12148, -327, 856, -916, -397, -600, 4621, + 3011, 5539, 5417, -2374, 9667, -4714, 7821, -2819, + 573, 4492, 1882, -26770, 1486, -6963, 1103, 2515, + 8196, 1849, -7492, -5243, 2106, -5290, -11000, -1410, + -3448, -8548, -4536, -7730, 3083, 6109, -14458, -8624, + -381, 7840, 4694, -3906, 8223, 3315, 5849, 13112, +-13132, 6081, 11801, -7624, -376, -6372, -6817, 6834, + 1760, -1435, 1072, 3505, -1494, -709, 5786, 454, + 1807, 2650, 7728, 1357, -1002, -5366, -2368, 2052, + 333, 6312, -336, 8274, -1653, -4309, -6630, 2841, + 2448, 8398, 5376, -7248, -1474, -1842, -4119, 838, + 501, -4206, 4052, -1250, -20943, -3338, -592, -2973, + 7057, -128, -3235, -4313, -2510, -11313, -4925, 3103, + 1448, -5186, -1322, -16815, 1956, -7950, 2641, -2890, + 4396, 2322, -1381, -1911, 448, 2543, 3535, 782, + 3719, -624, 1610, -2843, 7583, 1794, 700, 3107, + 4528, 5461, 2540, -1074, 5976, 741, 576, 4426, + 4400, -4920, 5724, -3734, -1186, 10645, 1100, 10537, + 2828, 11670, -8391, -32572, -9405, -6807, -875, 2277, + 736, -4546, -18693, 1204, -1083, 3422, -3328, 6013, + -2992, 5812, 2744, -11668, -2519, -2384, -3635, 6532, + 6874, -2820, -5222, -12261, -14266, -6663, -1150, -2032, + 2099, 4642, 1638, -4162, -644, 249, -3133, 11830, +-10712, 12370, 4818, -1924, -5639, -6448, 2455, -4898, + -613, 1760, 2393, 1414, 7039, -7018, 5901, -2900, + 3786, -3230, -3718, 3514, -4040, -4676, 6367, -1449, + -2758, -2888, 4066, -7140, 408, -7656, 3156, 19919, + -1858, 6671, 352, -3355, 3074, 5524, -1429, 1954, + -6664, -10082, 4405, -1598, -806, 1779, -6913, 7062, + 5064, 6518, -1042, 3400, -5530, -1192, 590, -3298, + -772, 571, -6239, 9810, -12380, 1302, 1344, -3430, + 3830, 4106, 5792, -6196, 224, -2604, 3954, -12551, + -5539, -8306, 1801, -4521, 3578, -4349, -5716, 4960, + 3620, 1516, 5779, 5550, -3710, 3329, 10542, 4198, + 5148, -3291, 196, 6232, 6943, -1303, -10306, 1862, + 6547, -1544, -2996, 2868, -4389, -6894, 28557, -13130, + 1397, -2331, -4076, 2870, 3592, 6613, 265, -4790, + -3514, -3152, 8710, 230, 3142, -1264, 1822, -769, + 6168, -1792, 2189, 2660, -2664, 3402, -533, -3100, + -476, -1164, 6092, -2930, 3372, -5895, 8507, -918, + -4716, -1582, 23959, 1506, 2360, -117, 2029, -452, + -6575, 964, -13132, -2838, 3800, -3355, 3168, 5230, + 11116, 826, -1711, -3546, 7398, -4092, -2884, 743, + -1784, -3824, -3437, 1050, -3306, 928, -5109, -7999, + 1581, 8609, -4662, -3594, -1618, 9929, -3982, -5591, + -8789, -1444, -12011, 1304, 12668, -5138, 10837, -7951, + -4089, 3921, -5375, -2486, -2590, 11398, -80, 7734, + -4547, -11286, -7098, -7758, 5303, 7380, -11266, -11138, + -8676, 30, 6328, 597, 7852, 3144, -3933, 15142, + 3954, 12197, -507, -1667, 5517, -4187, 709, -1330, + 2094, 4739, 1341, 8276, 8544, -10107, -10151, 3641, + 771, 4798, 4839, -3254, -9246, -7304, 14850, -18155, + 3068, 4993, -4930, 10985, 6270, 8528, 5904, -13010, + -7824, 1300, -706, -156, -4228, 302, 9962, -3087, + 4472, 4541, 13179, -6576, -2541, 8284, -51, 5366, + -4369, 289, 3890, -3671, 1894, 21820, -3031, 5336, + -8412, 2487, -1211, -6759, 1292, 3749, -8904, 638, + 6863, 154, 1145, -684, 6648, -3874, 2005, 4670, + 4408, 4191, 3984, 632, 2957, -1532, -3974, -2576, + -1636, -3714, -136, -4946, 3900, 367, 27072, 1864, + 1426, -3321, 860, -1768, -2009, -3436, 2666, -9899, + -1328, -2330, -3078, -3258, -4600, 5604, -5248, 1703, + 4403, -4781, -8275, 6717, -3860, 10980, -10634, -8360, + -2291, 20311, 7602, -4028, 483, -4886, 2677, -4921, + 6065, 5393, -2145, 6201, -472, 1796, 2869, -3578, + 3053, -2342, -3193, -2589, -3215, 1322, 536, -164, + -314, 4800, -1903, -1338, -11833, -23399, 5562, 4440, + -1864, 2520, -4251, -1464, 5053, -8553, -3852, -5932, + -849, -7113, -3493, -5338, -1671, 1496, 4504, -1830, + 5716, -210, 1397, -2060, 2242, -583, 2604, 5355, + 13938, 13150, 1346, 2649, -1527, -4568, 8891, 7399, + -6492, -10371, -4885, 13056, -8262, -1267, -2959, -868, + 5941, 299, -601, 8834, 1436, 5404, 1914, -3775, + 980, 8848, -2270, -1952, 6902, 8642, -25725, 9556, + 14540, 1998, -13157, 308, -13844, -10126, -2147, 8296, + 1772, 1094, -9712, -8560, -7552, 5527, -1446, -1097, + -5798, -17270, 2860, -210, 2136, 175, 729, 11775, + -5154, -4202, 13342, 3977, 14494, -5659, 9105, -11067, + -3694, 4794, -593, 6817, 1875, -4975, 3663, 4141, + -8317, -8932, 2127, -4176, 1136, -148, 7640, 8127, + -744, 2354, 389, 1600, -6475, -4558, 10735, 11407, + 3896, 13098, 1814, 5191, -3850, 2629, 18430, 8343, + 4630, -4624, -702, -3834, -2276, -2894, -1556, 1437, + 424, 5652, -6260, 2387, -5845, 7496, 10657, -2754, + 4806, 1169, 1308, -4114, -5347, 15076, 5686, 7287, + 3004, -6254, 5186, -14096, 10323, -1974, -9355, -5544, + -986, -5998, 261, 4494, 2467, -1911, -603, -4548, + -1344, 1995, -1603, 10464, 5222, 3714, -5342, -8039, + 12530, -26465, -1813, 4044, 746, 8123, -12078, -4703, + 2971, -4487, 2556, 3904, -2518, 1504, 5774, 5431, + 1120, -934, -5202, -6826, -8774, 7156, -2392, 10643, + -2918, -4298, 3361, -3758, -894, 5828, -203, -4905, + 6480, 11771, -19830, -17545, -4920, -17263, 10066, 10125, + -8980, -19719, 23554, 27907, 2607, -7014, 6128, -23759, + -4802, -7099, 874, 13103, 21667, -8475, -12938, -13122, + -3694, -18860, -3518, -3586, 12658, -793, 10661, 6925, + -730, -11373, -7845, 94, -2627, -6044, -2213, -4381, +-10198, -5816, -56, -4349, 3722, 3911, -1719, -2513, +-13290, 3218, 105, 1876, -76, -1107, 2563, 4520, + 10288, 5862, -7738, 6180, 9863, 1380, 6756, 2632, +-18798, 9314, 7190, -7454, 432, -15141, 8462, 2128, + -2386, -2710, 292, -751, -3125, 6147, 4941, 3146, + 3046, 120, 321, -5884, 5105, -4300, 6264, -317, + 1667, -694, 7950, 5639, -3284, 1089, -6456, -14694, + -3527, -1104, 4313, -20858, 7920, -10782, -13536, 933, + 4523, 2640, 2118, 97, -614, 9834, -9515, 232, + 5086, -6720, -1529, 568, 3139, -3665, -8567, -13771, + 6274, -4370, -5653, -8920, -7667, -9391, -6653, 12489, + -3666, -5103, -12324, 4796, -540, 10396, 3668, -3467, + 7124, -4398, 87, -12139, -204, 1213, -2190, 11948, + -2641, -2434, -5647, 2819, 3148, 3558, -6455, 3705, + 1644, -3090, -4225, -5998, 112, 17789, -7220, 2166, + 4153, 4516, -1100, -1667, -1402, -8837, 6344, -1586, + -3451, 2357, 616, -392, -8163, -11579, 6160, -2783, + 7895, 11321, -11847, 8070, 5231, -6496, -3172, -3470, + -2960, -11437, 465, -470, -2568, 11197, -9417, -4117, + -1162, -1893, -2361, 551, 14478, 3510, -1372, 3117, + -8236, -2904, 14556, 3191, 200, 2166, -13974, 2718, + 3946, 2444, 1982, 5320, 2087, -2222, 1573, 742, + -8828, -3917, -11080, -241, -8472, 6119, 290, -2364, + -3163, 1923, -1964, -582, 2564, -5566, -6411, 2069, + 7392, 9115, 25316, 1504, 2540, -814, -1746, 566, + -1580, -2290, 170, 698, 105, 9567, -6714, -584, + -4934, -379, -491, -978, 4580, 1180, -3355, 1882, + -4343, 4817, 1503, 9968, -8878, -4908, 3419, -4818, + -2254, 6694, -4368, -10849, -5093, 4510, -3129, 152, + 1926, -4490, 1510, -17764, -6699, 962, 3474, 4981, + 25, -7128, 1432, 5386, 3108, -4545, 1092, 1663, + -1363, 3076, -8916, 6158, 244, -1181, -825, -933, + -5570, 17221, -535, -2892, -5031, -1297, -3010, 5840, + 678, 748, 3944, 1630, -3648, -5457, -2618, 876, + 6655, -2834, 2597, -6667, 1330, -40, -4423, 6257, + 743, 6083, -584, -3742, -1401, 1779, -5166, 4559, + 5558, 8588, -6476, 7521, -1561, 4950, -778, 3564, + 11403, -1010, -3151, -14151, -1020, 2595, -3278, 24555, + -4859, -909, 2314, 1301, 2098, -5664, 3938, -4050, + -203, 3368, -2580, 3061, -9266, -6263, -6748, 3890, + 1950, -329, 1050, -1106, 588, 23705, -661, 6913, + 722, -5820, 2147, 3789, -1689, 661, 5389, -8519, + 1152, 3800, 7160, 5234, 1343, 3218, -2900, -391, + -4258, 5084, -4783, 7262, -10013, -811, -5252, 6474, +-17338, -2388, -2596, -8715, 5836, 9523, 639, 4652, + 3071, 3114, -1648, 1563, -931, -10143, 4394, -2838, +-11900, -1012, 841, -5812, -3048, -2715, -196, -5794, +-20022, 1949, 3464, -770, 2200, -3564, 1975, -6242, + -1937, 3954, 5678, -2744, 1888, -3825, 5770, 3869, + 8315, -7386, 1318, 1302, -5534, -4554, 924, -3804, + -4292, -22757, -7972, -7469, -3543, 7858, -10125, -2637, + -4765, -10644, -5944, 1159, -3293, 4363, -1219, -12248, + 5060, -7232, 6947, -1609, -3037, -5084, 6580, 15873, + 5336, 7295, 2386, 2961, 4655, 9714, 5080, 11635, + 1790, 2897, 687, -914, -692, -6653, -8562, -1412, + 244, 4478, 1650, 7175, 1046, -6689, 3693, -3520, + 6046, -1336, 1976, 16822, -1176, 792, -1733, 8286, + -7359, -2402, -8536, 1392, -3271, 6580, -4939, 1562, + 595, -4237, 4872, 4266, -1798, -6589, 7457, 4207, + 9978, -3996, -2236, -3078, 1861, 10101, -2394, -3250, + -7619, -7082, -14305, 5664, -1337, -11019, -3839, 10190, + 7249, 3086, -1782, 24, -3566, 10769, -4102, -6408, + -688, -8987, 3018, -5942, 7478, -368, -7931, -3018, + 6766, -78, 5705, -3264, -1100, 4850, 4518, -28, + -6276, 4905, 7094, -4394, -2846, -88, 434, 2039, + 352, 9827, 12372, 1207, -8561, -4476, 1496, -4927, + 2087, -6730, 1134, -81, 57, -8701, -2918, 3953, + -2844, -1842, 4804, -5315, -401, 7060, -16397, -4802, + -9849, 17542, -11715, -12432, -6676, 9323, -13189, -5761, + 8054, -620, -7431, 3726, 17790, 7880, 251, 2983, + 3736, 7118, 17197, 8613, 1445, -15290, -16184, 11084, + -4971, -5922, -1893, 9067, 9321, -8139, 714, 182, + -3138, 7258, -1874, -2781, 10800, 2915, 5316, -5206, + -2581, 10219, -484, 862, 119, 6628, 1514, 3883, + -880, 7586, -2573, 3279, 3801, 4492, -3850, 9416, + -38, 7518, -574, 4052, -1136, -668, 9672, -9536, + 2551, -4223, -1074, -3616, 8446, 158, 3262, 7965, + 1311, -8634, -6786, 700, 4973, 917, -754, -1156, + 6054, 2067, 10757, 421, 1030, 11351, 2149, -4286, + 12075, 4593, 1193, -5290, -8566, -2965, 6824, -6238, + 2392, -3395, 5350, -2789, 7529, -1873, 3032, -1494, + -2703, -18535, 1583, 9539, 2556, -4422, -6079, -2699, + -7860, -4573, -8236, 4281, -1079, -17578, -2840, 7468, + 4675, -5002, -1268, -1529, -8222, 8285, -766, -4314, + 6048, 11507, 5046, -2444, 3186, 1732, 7872, 6598, + 2828, -2920, 8278, 13263, -10204, 1334, -5552, 10532, + 5412, 2554, -10076, 1128, -3959, -3210, 4091, 1824, + 4984, 5558, -2204, 2080, -3802, 6614, -7380, 3612, + -4624, 6366, -1795, 4038, 6227, -4312, -4910, -2127, + 15077, 4144, -16885, 3757, 2303, -670, 5625, -2590, + -2594, 2491, -3174, 4199, 1152, -1532, -7308, -8578, + 6431, 2975, 6032, 3037, -7451, -2643, 5503, -7856, + -2451, 5309, -3678, 8145, 1864, -8341, -15575, 7716, +-10337, 8935, 12350, -10418, -4092, 734, 10400, 10934, + 5724, 1778, 5836, -3203, -10700, 2766, 4178, -18135, +-16589, -5465, -5005, 7239, 25480, 7310, -6408, 6142, + -7748, -1423, -4318, -321, -2899, 3728, -3184, -3578, +-11598, -1223, -8554, 656, -3945, -4084, -724, 301, + 9539, 9695, -1799, -2602, -1379, -5282, -4709, 11858, + 9562, -7508, 4886, 896, 5780, -160, -12724, -9598, + 1220, -5411, -5072, -6476, -11763, -104, 9311, 5230, + 591, 4342, 263, 13198, -17801, -1892, 2619, 18194, + -2080, 16536, 18497, -25926, 25541, 66, -6648, 1627, + 2794, -3790, 9424, 1387, 20702, 5260, 5211, 1702, + 1019, -11143, -6501, -18711, 10869, -4204, 4994, 1722, + 8569, 3670, 4386, -16874, 8876, -2297, -2743, -4562, + -9207, 8033, -346, -3586, -9451, 3242, 1552, 4278, + -6787, 7118, 3630, 4602, -7371, -12789, -10424, -14922, + -3010, 1885, 4144, -4490, 4074, 7796, -1201, -7244, + 2675, 1221, -7060, -12828, -3520, 1983, -4615, 8207, + 1606, 517, 3646, -7252, 816, -3690, -674, 13100, +-16254, 4727, -8184, -968, -5366, -2288, -20260, 1174, +-19384, -4199, -5292, 582, -13118, 1836, 1698, -2034, +-14601, 6642, -10530, 482, -851, 9968, 7050, -13366, + -8354, 4740, -20050, -193, -1881, -1205, -4042, 7067, + 12872, 5846, -4792, -1833, 2504, -3222, -1607, 2634, + 4587, 6761, 1549, 1124, 9427, 3978, -8305, 7524, + 2507, -5744, 3238, 5238, -3664, 694, -28496, -1674 +}, + +.cb1108s1 = { +-10979, 8698, -630, 4660, 3060, -7292, 10140, 11942, + 1448, -5820, -3144, 3100, 10575, 6888, 3505, 9996, + 2787, -484, 8057, 1503, 6329, 3074, 3954, 9419, + -736, 2333, -1858, 3264, -4026, 16130, -14501, -5284, + -472, 850, -7258, 1542, 1473, -2348, -7055, -9574, + -2275, -4383, 7542, -360, -2945, -3878, 28, 809, + 600, 2246, 587, -1779, -3456, -737, 3242, -2523, + -1862, 6127, 899, 1070, -15614, 10990, -3084, 9546, + 7339, 8899, -1490, -10379, -9193, -3857, 8289, 7261, + 12489, 7814, -6458, 1223, 15486, -10960, -1880, 4922, + -7819, -527, -2370, 3687, 1358, 10367, -14266, -1496, + 1060, -9325, -5582, -3947, -17536, 1470, 4878, 10793, + 2904, -2566, -4995, 6549, 6141, 11048, 3177, -494, + 9087, 797, -2575, -5616, 1197, 2966, -11287, 4658, + -504, 4571, 1814, 18830, 26254, 2399, 8750, 2656, + 8206, -12987, -9119, -1027, -457, 1228, 6137, 2322, + 1732, -5694, -892, -249, -178, -7009, -4368, 402, + -5564, -5183, 2470, -4745, 2788, -3255, -5181, -706, + 40, -4915, 8926, -3633, -2455, 15054, 5376, -867, + -7270, -979, 7053, -7433, 13749, 5039, -2234, 8474, + 7031, -3917, 5127, -7602, 580, 12067, 2252, 149, + 86, -582, -5729, 2193, 4178, -9195, -11824, 3897, + 1298, -1044, 6450, 1885, -19562, 6205, -4610, -2544, + 5192, -4885, 5021, -2373, -102, 7358, -2434, -3512, + -4048, 3070, 45, -1344, 202, -2189, 448, 1172, + 2939, -547, 1003, -6370, 3643, -1157, 3932, -6044, +-12882, 1959, -1574, 2574, 14854, -16317, -6627, 505, + 1102, -9361, -8087, 7525, -1466, 284, 3756, -383, + 5147, 5060, -474, 531, -6144, -1872, -1206, 527, + -4861, -12410, 7508, -7226, 5046, -12233, -4153, 4628, +-14402, -5265, 534, 1528, -13408, -62, -18757, -1280, + -9301, -10254, -8990, -6335, -7724, -3394, 1951, -13271, + -1389, -5274, -4616, -9643, -10295, 1332, -5618, -10737, + -7536, -9314, -7006, -760, 7694, 2955, -404, -2800, + 15250, -3828, 5994, 5408, 8411, 16568, -7280, -6901, + -222, -1554, -862, -1871, 939, -3678, -4348, -3200, + 3220, 1614, 8598, 8162, 1749, -7378, -1658, 931, + 3870, 9183, 1509, -5068, -17, 5733, -8121, 2769, + -3195, -3296, 8940, 2828, -2470, -2448, 7413, -2851, + -1058, -4505, -9653, -5074, 73, -3286, -4014, -1760, + 2562, 13690, -3464, 5438, -3394, 16997, -2944, 291, + 4224, 1175, -2237, -6894, -5479, -1291, 3390, 5455, + 898, 3461, -7914, -4785, 1879, 1059, -3721, -5796, + 5054, -3931, 6315, -2460, 1909, 573, -3373, 3052, + -178, 986, 572, -5976, 5781, -4928, -10539, 580, +-18727, 757, 1759, -4049, 2232, 1890, 4115, 699, + -2934, 4926, 2391, 10848, 5103, 4340, -1518, 2288, + 2283, 8886, -5131, -4429, -4384, -3265, 11933, 3993, + 11474, 3721, 1532, 976, 6112, 1954, -2360, -1783, + 2080, -6356, 2482, -4646, -1992, 1590, 1790, 3290, + -2312, -564, 508, -1688, -7522, -9263, 3059, 1883, + -3005, -1303, -9146, 10282, 1333, 4692, -2083, -15792, + 2208, 1128, -11574, -7149, -1126, -4995, 18963, -6262, + 5045, 2179, -822, -1249, 10092, -338, 5744, 1635, + 2535, 6114, -1339, -8337, -4370, 4288, 2468, 3051, + 12491, -9554, -4034, 522, -1085, 5852, -2759, 4918, +-10717, -194, -11376, 3059, 12075, 1037, 5260, 816, + 5918, -1987, 7924, -6022, -10374, 11607, 25035, -11598, + 16894, 2458, -5461, -2039, 385, 6002, 7574, 1229, + -834, -1032, -7453, 2694, -1447, 3632, 4215, 3541, + 2936, -3294, 1001, -6451, -4595, -11682, 7880, 2261, + 3786, -2849, 2276, -826, 3742, 7586, -334, 2837, + -2331, -12849, 1170, -1150, -5253, -997, -8996, 8124, + 2234, 904, -2294, 3144, 7352, -5452, 1536, -8800, + 1886, -18282, -9787, -8066, -12066, 1536, 4460, -1345, + 1418, 7471, 13451, -7299, 5507, 6795, -184, 8905, + -2040, -4933, 4998, 7317, -6667, -5134, 9094, -8561, + -2534, 3422, 2278, 3118, 205, 5811, 2247, 5946, + 1078, -2105, -6946, 170, -1625, -4734, -1447, -4329, + -4553, -2230, -8738, -15289, 7311, 6665, 5047, 1984, + 11896, 13922, -10490, -9313, 1424, -2991, 1408, 335, + 8914, 3773, 8814, 7917, -4560, -114, -624, 8984, + -1598, -580, 3233, 590, -2172, -3162, -3985, 5394, + 13842, -11625, 73, 12826, -1204, 5119, 10304, -10006, + -2695, 1318, 156, 84, -760, -4638, -3804, 3041, + -782, -2994, -3113, 637, -3256, -5831, 452, -1204, + 1614, -11626, -4769, 10612, -8710, -20019, 10542, -4279, + 6912, -1429, 3812, 2844, 3903, -11622, -8954, 180, + 3898, 3858, 119, 1385, 4038, -5899, -969, -5454, + 13305, -6748, 5934, 8027, -7348, -3797, -29781, -4956, + 2037, -2331, -3292, 8254, 6597, 4446, -7848, 6250, + 1400, -1182, -4966, -3490, -1410, -2286, 3334, 350, + 9271, 2987, -934, -5702, -3881, -97, -671, 5108, + -133, 1302, 11630, -8858, -3027, -42, 3682, -1507, + 3992, 5641, 2778, -8698, -2509, -1360, 77, 2116, + 98, 2853, -6334, 5915, -1214, -2721, 8921, 1380, + -4158, -4315, -4740, -21049, 7044, 866, 2094, -9442, + 9003, -5147, -4897, 3407, -11558, 4280, 4508, 6697, + 1612, 1508, 8547, -14257, -151, -9530, -7250, 11321, +-14430, -4944, -2488, 1349, -248, -1490, 1749, 3970, + -5830, 20767, 4642, 3236, 36, -17079, -11099, 5996, +-10759, -39, 7822, -7527, -1431, 179, -3841, 2298, + 1407, -241, -2303, 9244, -3626, 6609, 1959, -518, + 368, 1678, -5334, -5849, -4986, -2363, 607, 2809, + -1006, -7695, 10022, 2216, -8992, 4282, 807, 14707, + 9528, -11065, 3014, 3157, 5597, 1139, -1298, -3642, + 7839, 860, -4336, 2624, -4171, 1791, -2825, 5362, + -529, 1494, 337, -4487, -671, 5360, 3283, 4933, +-14692, 4033, -4365, 2713, -6903, -1784, -10862, 6173, + 5278, 14859, -852, 10020, 12304, 8898, -3089, 9183, + 1841, 8276, 4929, -261, -1264, 615, 3615, 14535, + 6557, 519, 4228, 7382, -1805, -4529, 4992, 4277, + -342, -9610, -5193, -7022, -23264, 2402, -740, 2875, + -5052, 1983, 4987, 3336, -3806, 1335, -2868, 846, + 7652, 936, 3510, -4570, -3010, -8805, 6177, -4413, + 5879, -15204, -1632, 13416, -4543, 3838, -9293, 1744, + 920, 15544, 3820, -5852, 3935, 2357, -6486, 1932, + 12044, -6374, -2545, -2389, 2755, -8073, -8203, 4659, + 4286, 16128, -987, 434, -4495, -4428, -4816, -10329, + -4529, -13408, -13283, -1136, 4002, -1271, 3547, -5274, + -5577, 701, -365, -2764, 370, -369, 2611, -832, + 3862, 4604, -7786, 11170, -1453, -1568, 10758, 168, + 402, -1985, 1436, -8858, 10080, -8559, 3998, -4310, +-13478, -3104, -11458, 506, -18194, -3724, -6768, 7960, + -4213, 1121, -1658, -1141, -1874, -383, -5090, 748, + -1032, -1207, 1046, -1865, -2387, 2126, -3672, 6733, + -2794, 3797, 15562, -11989, 170, 6129, 658, 929, + 4800, -4296, -955, -2189, -188, 3180, -118, -766, + -2182, -6928, -2254, 6615, -4422, 6324, -31, 3742, + -5832, -5022, 4671, 1574, -6309, 288, -2768, -2492, + -4818, -5192, -248, -3236, -429, 120, 1182, -10486, + -2964, -3713, -5978, 11817, -20052, -6525, 2054, -879, + -602, -2843, 7244, -1372, 417, -172, 3322, -6556, + -7021, 5842, 7357, -2799, 3660, 7579, 4682, -2242, + 73, -9247, 21061, -2060, -3614, 2486, 4793, -2959, + -510, -74, -5982, 2274, -4147, 3260, 1994, -1678, + -7494, -13624, 2560, -7375, -896, -4945, -2838, -11096, + -1969, 5879, 444, -3220, 14630, 4915, -2376, -8475, + 9854, 11380, 11060, 1534, -14413, 4366, -9544, -10646, + -7654, -17916, 3481, -3240, 1776, -2436, -8403, 3679, + -1914, 12537, -5540, -5294, 5995, 5968, -2609, -16882, + 789, -9506, -10075, -12142, -7580, -7090, -2046, 11065, + 7617, -3503, -2013, 3516, 6347, -195, -3119, 2444, + 14, -4998, 767, 4976, -3974, 9038, 579, 1804, + -8206, 32767, -5633, 1018, 13388, 996, -12737, -3179, + -2058, 13663, 1274, -4475, 7386, -1698, 17927, -6118, + 15942, -2922, -3434, 5903, 6333, -9149, 14140, -1488, + 2999, 1151, 2361, -1935, -10243, -11566, -5319, 965, + 5146, 3652, -441, -2173, -3484, 3685, -13595, -1703, + -78, -1408, 18517, -3788, -3266, 3162, 996, 19950, + -8560, 4989, 6593, -5329, 2950, -13896, -3524, 5590, + 4055, 6084, 2493, 12659, -5786, 4858, 7252, -7111, + -7318, 5411, 7393, -8714, -3454, -1562, 1919, -49, + -680, 7285, -398, -2956, 7100, 5563, -538, 1719, + -16, -3824, 437, -6842, 1504, 5694, 1214, 3209, +-15562, -4365, 9329, -25577, 1425, -2598, -8389, -6891, + -3275, 3304, -3993, -6391, -934, 7862, 4844, -134, + 9890, -4646, 2468, -9901, -4111, -3080, -5056, 476, +-13099, 1447, 205, -2424, 7098, -12075, -4646, -13725, + 8367, -2910, -8461, 1387, 3553, -10228, -2771, 4698, + -6483, 12234, -8086, 3329, 2374, 452, -1805, 5083, + 2014, 164, 7143, 81, 6062, 2838, 5318, -4982, + 1440, 2014, -3273, -6658, -798, -3204, 1398, -599, + -5834, 2070, 4644, -17238, 390, -1684, -4932, 8961, +-12217, -3079, 6574, 1387, -5991, -7803, 1285, 7439, + -395, -3048, 2038, -847, -690, -5127, 2228, -4180, + -3499, 530, -584, 9884, -323, 446, -15644, -9162, + -1683, 3643, -3578, 2634, 496, 8097, 109, 1056, + 1422, 5452, 6517, -449, -2389, 302, 6827, 1507, + -3106, -7188, -4909, -441, 12955, -3933, -5322, 5155, +-23171, -2780, -2655, -4048, 12844, -3709, 6555, -5700, + 3780, -6566, -4415, 11091, 11291, 6443, 9146, -796, + -1420, 5600, 12098, -5790, 6619, -10474, -12177, -5890, + 21700, 11148, 3427, 3130, -5727, 14646, 13953, -2721, + 1404, -3102, -4693, 4762, 1757, 2533, 3998, -530, + -758, 5301, -1426, 8948, -720, 6877, -3863, 2396, + 5266, -685, 890, -7188, 2742, -270, 8125, -804, + 32292, 6964, 8599, -3466, -1080, -8423, 2070, -295, + -157, -5432, 152, 2478, -3738, 1104, 1500, -5290, + -2463, -6386, -2537, -2331, -3290, -2398, 159, 6588, + -2547, -2424, -2184, 8316, 5670, -5608, -2600, 2659, + 166, 14828, 2622, -10490, -16378, 64, 434, 4576, + -3010, 2479, -6798, 3431, 360, -1067, 3421, 664, + 4029, -4050, -240, 3875, 672, 3587, 501, 2494, + -48, 9997, 3259, 8551, -7624, 17342, 10765, 4328, + -3721, 1729, -2844, -6330, 5114, 15589, -261, -7554, + 2708, 7260, 5852, -8736, 436, -6160, -588, -5919, + 5752, 3127, -4558, 540, 74, -4048, 3735, 7873, + -2869, -544, -111, 5182, 1032, 2315, -159, 5105, + 4106, -494, 678, -4756, -3865, -7389, -2492, 7193, + 5146, -7926, 12043, 11137, 1719, 2307, -5476, 12679, + 7996, 726, 933, 3222, 7515, 678, -5858, -2716, + 1503, -3014, -2125, 4982, -4984, 467, 986, 5450, + -1472, 5314, -1285, 218, -3411, 4511, 8047, 4268, + -8307, -10587, 17200, 3303, 7553, 5361, 1108, -7982, + 8240, -5856, -3376, -3952, -2884, 4401, -7252, 4078, + 7538, 3420, -13834, -1139, 10742, -2536, 636, 7758, + 4282, -3505, 1190, -7382, -8164, 5306, -408, -5005, + 2776, 7806, 4781, -7903, -2370, 13884, 542, 5643, + 6948, 6471, 2699, 815, 4454, 1882, 2290, -3856, + -3086, 8215, 3234, 4444, -1580, 2835, -3083, 6706, + 7409, 4626, 2658, 2308, 7965, -1034, -2584, 344, + 704, 12280, 10344, -8032, -4410, -6168, 6860, 7977, + -5630, -6680, -5001, -6199, -10378, -1764, -3322, -4284, + -1048, 2721, -11738, -11800, -7975, 2754, 3424, -7641, + -2245, -4945, -194, -1948, -2850, 4111, -21846, -8750, + 4306, 24494, 10428, 26998, 4976, -2701, -3283, -723, + -1539, 6758, -9730, -3517, 6401, -4546, -410, -9900, + -4947, 6996, 10983, 5110, 19948, -78, -1794, 11051, + -14, 316, 6447, -20430, 9363, 9062, -2134, 13711, + 6448, 6655, -5232, 4610, -10352, -3042, -8713, 5777, + -2438, -2602, -7293, -755, 6736, 2960, -3676, -2882, + -9806, 1342, 1242, 2122, 2749, 631, 6502, 2266, +-12996, 13620, 19762, 8096, 702, -4394, -8668, -1460, + -3228, -173, -6239, 4643, -1916, 4098, -2234, 1202, + 1763, 6170, -6320, 12984, -5936, 8301, 6021, 2191, + 466, -4044, -1913, -3458, 8197, -3249, -5935, 2383, + -4241, 4977, -4415, 704, 3488, -8356, 10229, 562, + 14, -4828, -3890, -7599, -4208, -3166, 1132, -16584, + -506, 1397, 6266, 3307, 5782, 2349, 3257, -3017, + 7814, 1216, 7440, -10096, 12698, 944, 1221, -1683, + 152, 6020, -7910, 3897, -6954, -9439, -9838, -3860, + -5383, -4228, -1980, -4045, 7442, -5504, 2145, 636, + 2857, -4538, -820, 4275, -2104, 5076, 5191, -363, +-23254, 1962, -66, 7550, 88, 8721, -1361, 7733, + -2661, 5282, -5112, -24, -975, -3200, -2235, 5144, + 213, -6340, -3974, 1266, -2383, 2432, -124, -233, + -3504, 10604, 806, -918, 11601, 19332, 206, 7456, + -8885, -9692, 3087, 3685, -2183, -7538, 11970, -5098, + -7364, -1173, -3099, 6532, -6850, 4622, -828, 390, + 467, -5364, 4442, -1878, 8949, -4340, -261, -2720, + 6659, 16184, -6552, -3736, -15416, 15774, -306, -4240, + -1807, -10304, 11073, 2743, 3974, -5557, -3499, 5315, +-10742, -378, -4517, -5949, -7664, -2830, -6510, -6096, + 2052, 3425, 1971, -3328, 5326, -1362, 1806, -14286, +-12774, 6058, -3365, -735, -2586, -18658, 6664, 9502, + -1590, 323, 6445, -17766, 14694, -9786, 3696, -4547, + 1601, 3645, -584, 910, 2516, 8197, 3898, 4306, + 631, -2020, 4309, -765, -6591, 2083, 8969, -1474, + -27, 9130, -5808, 8492, -135, 2230, 2296, -4509, + 4600, 4951, 1930, -2564, -5889, -1338, -11737, 6387, + -3649, -5447, -2462, -4751, -1012, 3523, -3504, -9510 +}, + +.cb1108m0 = { + -2417, 4623, 2916, -4257, 120, -10323, 1198, -10252, + -117, 8767, 3160, 2323, 1162, -650, 2237, -4171, + 2386, 432, 1627, -7255, 38, 124, -3658, -1558, +-11711, 10, 8146, 1700, -1975, -16731, 2397, 1056, + -2502, -2660, -2731, -2477, 1488, 1220, 4880, -1156, + 1805, -3, -3009, -6233, -2216, 3440, -3082, 2124, + 70, -2461, 1125, 1919, 11949, -2506, -622, 2209, + -702, 2685, 9183, -510, -2806, -1129, -1823, -1746, + -3600, 2298, -3360, 10793, -1714, 1662, -62, 395, + 14142, -261, -144, -9896, 11481, -884, -2197, 352, + -326, -453, -1984, 2027, -1466, 3290, 94, 3481, + 2533, 4401, 5492, 3803, 247, -896, -1688, -3166, + 1130, -1125, -1973, 322, 867, -1936, 714, -880, + 8, 2313, 23418, -1682, -677, 384, -2140, -386, + 920, -2523, -495, -1494, 3027, -707, 1172, -1403, + 2177, -2137, -885, -1035, -1637, 375, 2452, -3709, + -1171, 2069, 1095, -1937, -686, -956, 2034, 3410, + -3075, -359, -598, -2084, 18550, 1781, -45, 1400, + -1580, -13180, -609, -1376, -3145, -248, 5661, 6886, + -3915, -194, 9876, 1065, 3879, -1726, -837, -660, + -7467, -3055, 3516, 283, -1604, -625, 1165, 3023, + -1531, -1825, 1430, -561, -881, 1346, -129, -1817, + 851, -32768, -294, -188, -116, -646, 1176, 630, + 903, 417, -2487, 352, -789, 571, -127, -2054, + -2112, 418, 1631, 266, -270, 362, -2765, -1198, + -182, 3586, -1272, 1470, -66, -18384, -1230, 823, + 1171, 1350, 1101, 1410, -3730, 1535, -101, -3234, + 2315, -34, -458, 1361, -16497, -990, 1438, 2542, + -1193, 586, -1708, 2689, 2741, 6010, 4209, -5974, + -628, 1556, 2238, 6134, -3040, -2937, 2188, -1660, + 1137, 1316, -2650, 905, -502, -93, -1177, -31964, + -1170, 1504, -1284, -104, 168, 55, 3478, -161, + 2818, -484, -32, -1536, 1218, -854, -351, 4465, + 16922, 681, 4198, 419, -414, 6824, -3906, 11598, + 75, 4904, 1374, 64, -2692, -3759, 3065, -1397, + -202, -347, -2466, 96, 1035, -765, -258, 3711, + 1437, -18250, 566, 976, 2483, 4, -1096, 1906, + 3745, -2621, -2756, 1864, -560, 98, 821, -4094, + 5349, 1369, -5245, -2170, 2932, -1052, 3932, -413, + -400, 31206, 1125, 1631, 43, -764, 1666, 780, + 2036, -564, 64, 1311, -202, 843, -2030, 856, + 1766, -3163, -1158, -626, 316, 127, 1783, 1918, + 3384, -2887, -5885, 1763, 4910, -248, 17100, -3022, + -1880, -2927, -1287, -3308, -1767, -2622, -1460, -250, + 3597, -4526, 946, -1533, 1059, -8, -807, -1283, + 1436, -11184, 643, 398, -1565, 1983, -60, -9862, + 1219, 322, 3132, -2043, 1138, 6258, -3540, 790, + -923, -4692, -1401, 2733, -8918, 4905, 6181, 192, + 82, -1094, 4, -634, -1323, -2865, 1036, 1484, + -2461, -937, 414, 221, 2179, -438, 1273, -2690, + 18442, 2781, 1788, 2264, -1230, 4284, -4708, 1190, + -4810, -975, 230, -3728, 2504, 3602, 3488, 88, + 1322, 487, 2965, -3731, -2341, 5937, 8545, 1716, + 7308, 9017, 6426, 727, 3992, -4584, 388, 3714, + 1164, 18, 445, 1253, 398, -1989, -824, -430, + 745, -5447, 2176, -1986, -3963, 2861, 194, 17739, + 1891, -5368, 4172, 125, 530, -2766, 1179, 401, + 1759, -1609, 31234, 910, 1100, 1036, -948, -1101, + -614, 1768, -344, 840, -696, -842, 320, -1444, + -2560, -3199, 58, -2172, 1375, -3002, -821, -863, +-12096, -2484, -677, -2130, 4450, 3568, -3192, -1114, + -3218, 3121, -503, 5570, -561, 3896, 10566, -3065, + -2768, 1398, 1719, -2708, 1952, -142, 4777, -978, + 2238, -5780, -430, 1228, -1298, -2923, 4353, -1621, + -2368, -2908, -8012, 4398, -502, 518, -6964, 622, + -377, 3758, 6598, 4438, 6849, -7696, 470, 3585, + 466, -14664, 3438, 14706, -1944, -2544, -785, 3653, + 1274, 443, -694, 1968, -3499, 2855, -3930, -1210, + -528, 1931, 3849, -772, -2659, 4499, -3624, -540, + -1645, -949, -382, 979, 595, 165, 429, -80, +-20468, 1040, 544, 2545, -5010, -2122, -2840, -335, + -405, 404, -50, -2996, 1226, 519, -1046, 3745, + -2317, 6211, -14500, 9754, -5802, 5230, -3112, 1506, + 3741, 664, -902, 197, 2476, -3618, 2040, -1066, + 2338, -257, -2580, -293, 2740, -576, 2050, -865, + -3666, -2090, -1831, -32056, 658, 1549, 1602, 1728, + -534, 390, -1517, -627, -4025, -797, -2351, 2759, + -102, 2574, -56, 796, -232, -886, 1639, -2773, + 1007, 830, 5880, -2220, 762, -3834, -2865, -415, + 584, -3498, -4546, -16108, 344, -4072, 551, -5435, + 2007, -1418, 3838, -1662, 1981, 3545, 1424, 769, + 2135, 1705, -15076, -636, 283, 3386, 97, -1048, + -3933, 204, -8616, -556, -2936, 4241, 5100, 1777, + 98, 719, 6202, -1496, 708, 2160, -2396, 4060, + 1513, 2253, -46, -1823, -132, 709, -756, -944, + 575, 1070, -1583, 587, -24575, -1989, 874, -568, + 1040, 1116, -4002, 3196, 2826, 117, 1590, 2456, + 938, 112, -938, -1268, 5056, -2851, 2995, 2559, +-13121, -8374, 3593, -6684, 3663, 766, 747, 1016, + -921, 2241, -1942, 4269, -3312, -1012, 2340, 2781, + -3881, 2532, -1976, -1436, -3219, 420, 22088, -742, + -640, 3270, 1446, 1935, 1279, 1913, 1377, -3297, + -751, 4209, -1052, 2381, 2938, -1330, 2154, 2784, + -2420, 1270, 2334, -526, 1480, -435, 2206, 252, + -510, -1018, -1469, -1294, -950, 424, 1058, -2317, + -846, -20737, -1877, 88, -431, -1268, 116, -378, + -2326, 3115, -246, 30, -4725, 648, 2084, 14286, + -817, 2496, -1947, -4869, -9703, 1505, -2476, -2108, + 747, -449, 3002, -5464, -514, 1805, 2559, 2494, + 12782, -1232, 12091, 2118, 3996, 2592, 1058, 510, + -1384, -3050, 2533, -408, 5219, 3044, 3242, -185, + 2654, -3723, 16, -1723, 1823, 6144, -4806, 182, + 1772, 4841, 16390, -96, 2505, -7713, -5244, -3316, + -6776, 1448, -1470, 4238, 294, 889, -2372, -6281, + -2423, 5423, 2119, 2897, 1378, 817, -993, -1599, +-14662, 3014, -3397, -6182, -245, 4897, 5116, 2285, + -2863, 1174, 415, -6777, 3863, -6009, -4722, -119, + 606, -2247, 4447, 1064, -1935, 2705, -2629, -1144, +-11980, 3805, 882, 1634, 5446, -4300, 643, 3436, + 7632, 592, 998, 674, -2647, 4644, -6854, 1368, + -146, -3395, 10599, 1369, 3852, 1689, 2437, -3937, + 3405, 2517, 1895, -14092, -1142, 2570, 10163, 1608, + -2445, 850, -1678, 3112, -3465, 3138, 4413, -1973, + -4151, 1163, 1822, -3819, -1568, -407, -2642, 424, + 365, -3599, 164, -1448, 1062, 1536, 1590, -1982, + 200, 18572, -230, -638, -1253, 1650, 2280, 4945, + 4527, -2353, -4216, 3752, -3807, 3686, -4816, 2382, +-14833, 1306, 17246, -739, 2012, 3521, 1473, -1436, + 1514, -142, -461, 1038, 2462, 971, 1354, 1272, + 1787, 2420, -922, 3364, 2250, 497, 1349, 2795, +-32768, 425, 1874, -72, 2461, 389, -306, -1180, + -646, 251, 299, -2735, 577, 1055, 1826, 1620, + -1214, 1422, -901, -1273, -2367, -1241, 366, 521, + -433, 55, 4000, 3035, -1390, 2505, 1786, -15397, + 413, -5916, -234, 3559, -6776, -5068, 2251, 36, + -180, 596, 5744, -2450, -1276, -4786, -1872, 24, + 252, 464, 2833, -136, -25600, -33, 873, 2646, + 1471, -1336, -1330, -276, 1778, -242, -951, 1580, + -79, -858, -927, -4310, -604, 7568, -1713, -948, + 192, -260, -1334, -1116, -705, 638, 132, 1186, + -952, 1157, 428, 2039, 1568, 1778, 22453, -2190, + 2176, 1674, -3996, 1294, 1162, 274, 415, -2877, + 464, 505, -1842, -1066, -2241, -761, -291, 8, + -987, -104, 796, -32768, 1302, -809, 571, 1214, + 455, 686, 656, -1752, 886, -790, 644, -1114, + 2358, 11452, -4398, 1334, 13095, 3230, -1818, 4053, + -1990, -1093, 878, 3796, 2712, -1523, -1229, 1077, + 960, 1250, -75, -3233, -7734, 2783, 8430, -327, + -1428, -1687, -4092, 269, 3161, -569, -1267, 1774, + 2772, -2033, 171, -520, 1551, 3719, -3364, -220, + 1904, -1282, -2008, -818, 4261, -886, -19201, -3454, + -478, -2645, -2601, -2124, -3977, 2960, 1563, -432, + -989, 2682, 1734, -9085, 4614, -4454, 2535, -7201, + -220, -10022, -431, -7907, 889, -9658, 6653, 762, + -1827, 5886, 862, -1836, -430, -16363, 5709, 851, + 1814, 304, 5045, 1685, -1004, 5108, -5936, -3143, + 940, 1832, -270, -674, 1441, -241, 3222, -551, + -434, -69, -3584, 349, -1354, -12080, 3639, 5219, + 7583, -1023, 2078, 3263, -5807, -873, 4085, -5153, + -3623, -436, -4717, -1803, -6274, -2049, -247, 2516, + 1922, 10204, 2194, -1574, -535, 656, 1638, -3091, + 1156, 1377, -1220, 4956, -221, 4984, -1154, 4603, + -1618, -5655, -2583, 13494, -2442, -3968, 3086, 1098, + -1625, -13781, -12826, 2659, 3604, -702, -1900, -3508, + -6283, 2320, 1979, -2823, -4890, -1728, 2, -4402, + -437, 1932, -3272, 2853, -3018, 840, -632, -6691, + -484, 9579, 1008, 11677, -2814, -2029, 8048, -1170, + -7366, -2664, 3349, 1319, -1160, -1864, 606, 1568, + 5428, -4763, -2470, 2145, 1798, -502, -1538, -3736, + -1376, 1330, -3567, -78, 478, -743, 890, -800, + -44, -1832, -1761, -1022, -996, -846, 1188, -1042, + -3202, -2439, 1602, 3601, 564, 18338, -17, 1327, + -387, -1998, -1260, 3352, 849, -4780, 1932, -56, + 2625, 10753, -1676, -10536, 2980, 1542, 1177, -3113, + -859, 522, 3092, 9588, 2882, -4540, -1406, -5183, + 50, -4245, 3649, -420, -3612, -5290, -1919, 14559, + -2605, 1169, -2009, 10760, -2372, 339, -2538, 4476, + 3001, -4570, -3158, -3465, 2873, 650, -2099, 76, + 1166, -1469, -2769, -391, 4215, -630, -1448, -1796, + -1573, 5914, 807, -1580, 2072, 99, 580, -2999, + 1079, -202, 17940, -1233, -4909, 1079, 390, -891, + 1834, -2155, -2642, -1703, 1856, -14125, 2081, 3178, + -2480, -4342, -11991, -2050, 1046, 2412, 436, 1046, + -2291, -1718, -3087, 1710, -963, -1914, -3423, 6190, + -1238, -4333, 115, -10550, -2742, -919, -4849, 1502, + -3054, -3304, 2300, -1850, 2337, -6643, 1995, -1279, + -238, 738, -124, 13593, 252, -1424, -165, 2786, + -1717, -838, -11244, -10971, -902, -3330, -2580, -2735, + -171, 4041, -2149, 2502, 6726, -738, -4235, 368, + 6144, -1718, -8620, -1888, 112, -282, -19, 4126, + 10797, 610, -3097, 7783, -2974, -2058, -3558, 470, + -5914, 10322, -20, 85, -1652, 6111, -1398, 2613, + 3733, -3716, 1930, -4325, -1199, -921, -446, 1095, + 1006, 910, -2323, -351, 808, -32768, 274, 1346, + 105, 2360, -1184, 2249, -970, 153, 3180, 1307, + 2207, -962, 2209, -921, 1504, -117, -2111, -3734, + 5738, 8014, 76, 1566, 3013, -462, -3600, 3939, + 4862, 1038, 4312, -790, -426, -1656, 20, -10568, + -6389, -6597, 4230, 2910, 2504, -2962, 256, 814, + -488, 824, -355, 3574, -1890, -2657, -767, 2730, + -1087, -2538, -3522, -4067, 6249, -3354, 13923, 4070, +-11004, 4703, 909, -5968, -5483, -4242, -780, -2489 +}, + +.cb1108m1 = { + 752, -4098, 7726, 592, -9487, 2004, 318, -4322, + 6989, -3350, -478, -4308, 2023, 753, -7081, -3934, + -866, 6267, -5710, 2100, -8467, 100, -4654, -6773, + 4271, 10728, 11618, 1128, 12733, 1471, -5518, -1162, + -2159, -402, -632, -4720, -28, -1412, -1037, 897, + -1242, -1735, -2632, -3460, 3389, -582, 206, 325, + -2547, 46, 1340, -4424, -13408, -4918, -2832, 1454, + 2127, 1276, 2292, -3973, -3230, -7810, 542, 4227, + 2673, -8490, -902, 1361, -1398, -1986, -991, -680, + 602, -2887, -557, 2656, 3214, 1794, 31241, 1462, + -1457, -3750, -1923, -2381, 1313, -128, -172, -647, + -574, 1045, 2438, 1662, 503, 288, 1535, -1016, + 2487, -820, 4692, 2799, -31949, 166, -1655, -2192, + -636, 1357, -2361, -459, -1752, 2782, -293, -144, + 1900, 685, 1766, 1900, -347, -4488, 590, 915, + 798, 1133, -4494, -1388, 75, 884, 13088, -2392, + 679, -315, -7520, 1086, 3873, 3297, -812, -626, + -9443, 2548, -6417, 1619, 7196, -57, 5, 3594, + -1922, 184, 2784, -261, -3310, 2779, 174, 2814, + -965, -2912, -1835, 425, -4285, 896, 2001, 3717, + 775, -1192, 22365, -175, 1522, -711, -1135, 5123, + -517, 870, 4323, 585, -437, 260, -1737, -1984, + 2522, -2539, -973, -8812, -16173, 4678, -4107, 130, + -7832, 1140, 2792, 3394, -692, -4105, -299, 1488, + 1246, 604, 2796, -3767, 579, 188, -1544, 86, + 424, 1204, 4441, -1000, 15227, 3459, -3444, -1631, + -2177, 3497, 1684, 925, 2872, -3905, 5729, 647, + 913, -758, -547, 566, 1787, 792, -1509, -1641, + -926, -1515, -116, 1266, 481, -3944, 28526, -2279, + 5577, 1026, 4082, -605, 696, 1094, -478, 5732, + 7247, 1461, 1521, -234, -42, -878, 270, -554, + 3702, -71, 1362, 7719, 305, -13654, -4985, -1072, + -2044, 6851, 438, -8435, 923, -537, 1511, -1003, + 2056, -2299, -15578, 503, 1944, 3188, 2318, 1761, + 1290, -2322, -568, -1591, -2746, -1966, -9784, 1514, + -5596, 4070, -181, -3006, -1903, -240, -1143, 393, + -1530, -822, 520, 989, -1600, -3374, 946, 678, + 86, -1957, 1947, 1188, 356, 719, -2874, -2245, +-19010, 547, 9067, 439, -2384, 847, -3307, -116, + -1114, -445, -3505, -967, -1252, 4880, 625, 1478, + -2970, -2275, 1337, 422, 3870, -1906, -1033, 1724, + -532, 1734, 1011, -21848, -477, -251, -615, 770, + 7520, 1030, -4372, -446, -3156, -2314, 172, 901, + 70, 1837, 1205, -1344, 2933, 1080, -1290, 1353, + 10205, 1158, 11135, 560, -3480, -2376, 7539, -5418, +-14092, 2138, -253, -9344, -1907, 2177, 687, 2772, + -2730, -546, -4180, 2021, -577, 2530, -3822, -7080, + 971, 2083, -1220, 203, 3187, 3705, -752, -2591, + -704, -17469, -1168, -214, 2518, 308, -585, 1117, + -1893, 2488, 1856, -23, 2418, -2922, 1960, 235, + -1629, -8277, 1088, 2032, 874, 2763, -1867, 60, + 1684, 834, -2676, 1574, -3098, 3250, -3723, -126, + 59, -787, 2710, 930, 1384, 475, -3915, -1162, + 1640, -16818, 2356, -70, 761, 4151, -778, 523, + -183, 19374, -4223, -1379, -1667, -1690, -512, 8742, + -34, 3816, -678, 2749, 2418, -341, -1216, 4280, + -2208, -264, -2884, 4679, -821, 1824, -6724, -1528, +-12042, -9908, 935, 4338, -116, 612, 6, -161, + 1935, 1600, -442, 4059, 2510, 2186, -7678, 3600, + -2460, -1072, -122, -1817, -246, 2786, 9079, 525, + -226, 2628, -2549, 1459, 4533, 1111, -17410, 4529, + -2545, -3272, 403, -2758, -1876, 2734, 2136, -6171, + -2055, 1163, -2820, 2992, 2978, 1458, 1572, 2508, + 13576, -1545, 14861, -796, -6444, 4022, -4358, -529, + 3439, -2630, -2457, 3030, -2972, -398, 471, 2547, + 1127, 1344, 202, 420, -1858, -589, 594, 1478, + 5590, 1682, -1560, -378, -2198, 400, 2231, 566, + -80, -2042, -4557, -2309, 8743, -4258, 1291, 11770, + 718, 2342, 2912, 5170, 2470, 6832, 833, 4990, + 2009, -1258, -898, -1414, 1214, 670, -2104, -5068, + 788, -18997, -743, -864, -356, 1592, -5786, 652, + 4952, -2319, -1097, 2177, -1654, 2879, -1645, -172, + -1581, -3062, -805, -1065, -2222, 20857, -1146, 864, + 1690, -1794, 855, 307, 2320, 3618, 6184, -4129, + 187, -2423, 4946, -3072, -213, -2621, -2026, -5793, + -986, -1597, 2125, 1474, 1766, 360, -4652, -1030, + 1546, -1085, -253, 1016, -96, -1608, -7017, -4855, + 1295, -271, 3751, 341, 19804, -2006, 2322, -2298, + 353, -2077, -764, 212, 150, -1140, 564, -614, + 268, -2023, -332, -699, -937, 1684, -1617, -22863, + 1202, -144, 62, 373, -598, 184, 987, 3721, + -611, 86, 3676, 362, -652, -214, -311, -694, + -1973, 2351, -733, -1601, -1189, 28227, -154, 10, + -347, 3400, 1333, -1695, -773, 1362, -447, -2999, + -626, -1776, 2474, 2195, -1041, -797, 1828, 62, + 3397, -1779, -2924, 1740, -1694, 4083, 15100, 3871, + -7821, -108, 292, 998, 3141, 5813, -918, -1290, + -902, 895, -1336, -50, 2014, -2066, 2383, 68, + 31769, -334, 1243, 1981, -715, 125, -380, -1272, + 1068, -357, -1734, -1138, -630, 1042, 688, -438, + -558, -2460, -2894, 4196, -1004, -2177, -2291, -4701, +-13990, 747, -5558, -2754, 1950, -2780, 8414, -1286, + -946, 220, -2507, -192, 3726, -1361, 1296, -2215, + 872, 8270, -2797, -6732, 1256, -1957, -2916, 107, +-14847, 1868, 4638, 1292, -1006, 5285, 2947, -5028, + 942, 153, 420, -1152, -391, 3612, 4621, 172, + 762, -876, -3561, -14406, -552, -2570, -4448, -15704, + -806, -928, 3380, -686, -2604, -3895, -714, -626, + -1763, 1144, 485, 34, -1922, 1528, -213, 5050, + -804, 185, 96, 3320, -621, -329, -1444, 864, + -1684, 16583, 1872, 3327, 2146, 1132, -8216, 73, + 6524, 1623, -4147, -4985, 1450, -646, -7189, 4524, + -1596, 2120, 3913, 680, 2094, 1660, 752, -1221, + 2414, 3986, -10314, 2096, 129, -5458, 634, -5426, + -594, -9731, 2083, -2284, -5085, -4777, -1323, -1740, + 6157, -841, -126, 247, -1163, -7005, 3863, -764, + -1552, 1356, 10788, -745, -12481, -73, 5234, -3220, + 2979, 635, 3372, -540, -36, 2887, 5221, 931, + -1724, -4824, 780, -49, 120, -739, 890, 714, + -1438, -458, -1861, -16732, -1858, -13282, 2182, -6796, + -3307, 556, -2968, 542, -2358, 1463, -3536, 1866, + 2833, -1369, -1576, -2825, 3561, -1625, 1858, -1052, + -1079, 1302, -2049, 19052, -1188, -4137, 1592, -4705, + 1082, -1168, 2355, 649, -1900, -2582, 1000, -3065, + -2399, 3625, 1062, 860, 2586, -2645, 14755, 3147, + 5002, -6720, 1728, -2114, 5090, -2838, 3020, -5048, + 4182, 2237, 706, -4945, -86, -1908, -1207, 135, + 675, -200, -22134, 1492, 2490, -1324, -1135, -842, + 1457, 185, 1342, 3516, -882, 1069, 1159, -52, + 1844, -1186, 554, 3860, 1824, -2136, -881, -1281, +-13259, -705, -90, 2150, 573, 2787, 1068, -1968, + 121, 805, 4382, -1033, -9220, -744, -1446, 7180, + 257, -5983, -1643, -6198, 1854, -3524, 1060, -118, + 56, -843, 2832, -98, -3493, 368, 6, -1877, + -3615, -1954, 17971, 962, 1532, -1754, 3776, 661, + -2025, -60, -1013, -1222, -3062, -69, -4933, 3064, + -1176, 213, 477, 1081, 1679, -2328, 1984, -21759, + -881, -54, -1101, -1092, 598, 1648, -3384, -213, + 379, -1318, -1972, 630, -536, -1970, -461, -356, +-22416, -1855, -113, 876, -2809, -587, -2323, -56, + 2177, -797, 1649, -4069, 1350, -2075, 101, -1384, + 1703, 1085, 471, 8093, 1020, -4112, 970, 866, + -1456, -341, 1418, -12938, 379, 9787, 1814, 2337, + -1705, 9913, 1026, 1962, -744, -2900, -1690, 1534, + -959, -629, 2330, 3735, 4742, -3139, -2135, 2298, + -2765, -1389, -3634, 27139, 671, 2208, 494, 1015, + -1197, -239, -321, -1145, -679, -637, -3116, 544, + -952, 882, 396, 1087, -3163, -2684, 759, -725, + -2186, -542, 2545, 3669, 24, 1689, 10473, 1836, + -419, 322, 2475, 1908, -1346, 50, -6401, -3644, + 552, 2348, 1327, 11853, 2467, 5493, 1544, 464, + 1796, -2801, 8217, 1014, -2103, 3764, 8091, 170, +-12422, 1708, -2438, -1873, 1970, 2160, -5027, -647, + -118, 2830, 2379, -1091, -5723, 124, 3017, 417, + 55, 1376, -1079, 7122, 3086, 17847, 2468, 3273, + -599, 3302, -922, -2073, -1696, 805, 2022, -1899, + 3188, 1425, -4364, -140, -3760, 437, 1393, -1298, + 17166, -1283, -2904, -692, 518, -404, 944, -1990, + -968, 1323, 2376, -11708, 2187, 3164, -559, 2212, + 1598, -1741, 360, 633, 3075, -660, -1012, 778, + 565, -2020, -123, 5, -2217, -2967, 374, 272, + 336, -1725, -408, -2270, -2645, -1044, -517, 1911, + -386, -4439, -7603, -1000, 7660, 589, 14931, 2901, + 11998, -13102, -1919, 3904, 86, 1617, 7324, 3078, + 1714, 4636, -2504, -194, -3274, -710, 33, -1965, + -2298, 2513, 726, 75, 67, 884, 2104, 4110, + 1936, 10387, 2722, -1970, -12496, 4799, 3086, -2938, + 1719, -2138, -338, -1124, 971, -4200, 480, -3361, + 6220, 5954, 1830, 1001, 2996, 4166, -2854, -437, + -1430, 1072, -312, -12949, 3113, -2479, -2034, 6956, + 2805, 2128, 856, -8803, -4709, -1274, -120, 1252, + 3898, 6526, -3914, -2276, 2754, -2604, -3038, 4136, + 2598, -2172, 4861, -2457, 2, -2693, -808, 3527, + -1184, 392, -2202, 2406, 960, -1064, -2589, 1161, + 2418, 728, -466, -4865, 211, 14720, -2093, -1977, + 85, -12618, -2073, -3028, -1067, 1734, -2491, 9506, + -422, -2718, -2966, 3883, -2852, 336, 1306, -2297, + 2009, 2589, 3071, 192, -1239, -10553, 2, -1174, + -3036, 9939, -27, -1278, 1448, 18655, 761, 931, + 445, -94, 206, 448, -1865, 232, -4353, 4596, + -260, -976, 594, 648, 796, -1376, -1186, 3056, + 3171, -5675, 6179, -1287, 16934, -1478, 1090, 577, + 8075, 1119, 2943, -3208, 1852, 1986, 6003, 901, + -962, -3196, -1907, 392, -2605, 2796, 4082, -456, + -3109, -1219, 123, 2470, 174, -1254, -1350, -4919, + 1271, 12302, -1154, -6317, -3346, -1315, -144, 1214, + -49, 3491, -1029, -2043, -8373, 4197, 4971, 9808, + 9732, 700, 2247, -2755, -2034, 3260, 839, -10554, + 1661, 11484, -3180, -1909, 1089, -813, 3116, -2103, + -3726, -4514, 663, 1152, 3902, 4862, 2739, -3828, + 707, 2712, -8009, -832, -16492, -1472, -2422, -5593, + 322, -1894, 2810, 109, -1788, 2050, 3539, -3112, + -6178, 2487, 2102, -135, 3163, 2096, 4123, -310, + -1090, -2, -2662, -17087, 1373, 1448, 162, 527, + 655, -2248, -3530, 194, 1305, 7590, -5515, 1225, + 1607, -3816, 2185, -2679, -4486, -582, 4981, -1675, + 147, 14790, 119, 11771, -1228, 1012, -6133, -2247, + -3913, 1348, -1846, -513, -6386, -749, 6726, 745, + -809, -799, 3224, 43, -2230, 2598, 2994, -1590, +-11198, -14476, -256, 695, 877, -3680, -2734, -1448, + 1336, -1633, 3327, 3497, 2956, -782, 2958, -1866, + 2876, 2003, -856, 1282, 5068, 391, -10539, 1703 +}, + +.cb1110l0 = { +-14944, -14950, -73, -1141, 1532, -575, -620, -816, + 1185, -1597, -2651, 1426, -1458, 1317, -1320, -19, + -209, -352, -163, 912, -85, -180, -546, -1121, + -435, -345, 229, 364, -850, 632, -426, -359, +-32768, 278, -1021, 310, -31, -355, -442, -234, + 415, -202, -10393, 1645, -378, -2270, 837, -1857, + 556, -935, -1344, 3016, 3452, 1597, 1378, 466, +-13740, -878, 1475, 237, -1301, 9756, -592, 23, + -192, 335, -58, 285, 376, 40, 24, 292, + 426, -1962, -798, 745, 1379, -34, 397, -14748, + -6285, 7343, -6374, 4442, -14800, 1878, -24, 1606, + -728, -476, 1754, -1052, 911, 3139, -1444, -222, + -1968, 1858, 1330, 244, 213, 935, -92, -348, + 155, 418, 29128, 236, -190, -226, -309, -178, + -690, 46, 716, -534, 147, -630, -75, -826, + 37, 4745, -1056, 2400, 1398, 1494, 460, -221, + 2908, -656, -15611, -2940, 2342, -98, 581, -3144, + -471, 3772, 2057, 1583, 13738, -139, 330, 1175, + 429, 63, -14544, -374, 1439, -1226, -422, -690, + 816, 1279, -592, 1642, 700, 1338, 0, -714, + 46, 377, -188, -366, -197, -637, -622, -262, + -69, -637, -1266, 257, 620, -1040, 324, -19064, + -602, -463, -1329, 513, 2699, -421, -1918, 2250, + -404, 403, -1514, 134, 147, 3, 426, 605, + 276, 561, -26, -294, 630, -500, -480, -133, + -712, -1144, 238, -633, 173, -29164, -1182, -274, + -138, -271, -232, 30, 706, -168, -848, 704, + -2132, -248, -108, 669, 1165, 234, 1243, -12201, + 2208, -1971, -829, 10305, -3964, -1502, -409, -3918, + 4520, -2259, -797, 2235, -5560, -1710, -2472, 280, + -1747, -980, -4529, -5208, -1813, 330, 890, -6220, + -710, -5583, -4704, -913, 2920, -12484, -4340, 334, + -1303, 283, -740, -1261, 3556, 3210, -11640, -14438, + -2557, -795, 747, 546, -2488, 1891, 485, 725, + 338, 1579, 2092, 2354, 284, 2812, 490, 1442, + 187, -2699, 1196, -1783, 1228, 2364, 13364, 258, + 2102, -6163, -200, -5475, 2804, -576, 6878, -2852, + 2246, 1186, 584, -136, 5258, 3825, 3045, -1661, + -5246, 2548, -5054, -4383, -1542, 12912, -1580, 1268, + -1415, -2012, 1021, -2106, 979, 2390, 3411, -1076, + -439, 5416, 1333, 440, 3422, -13384, 2540, 2544, + -3668, -2308, 1042, 589, 4166, 5090, 1539, -3447, + 7003, -4396, 319, -590, 481, -471, 22260, -1936, + -297, 1302, 1163, 937, -164, 847, 768, 827, + -430, 792, 472, -1557, 712, -602, -1007, -278, + -974, -3198, 10560, -2124, 335, -1206, 629, -13712, + 12, -1673, -691, -666, -2890, 826, 1792, -1547, + -2016, 807, 1810, 841, -814, 1214, 760, -1056, + 404, -94, 144, 297, -584, 106, 116, -132, + 236, -507, 86, 853, -670, 413, 32767, 730, + 10835, -502, 1297, -3857, -1035, -1602, -164, -1721, + 1468, 507, 1064, 1478, 4323, -760, -882, -4331, + 2564, -10933, 3000, 2101, -2492, -72, 12636, 2743, + -1113, -8334, 6720, 2348, 491, -23, -1065, 1506, + 2090, -1731, -1997, 675, 425, 8165, 695, 2285, + -433, 515, -465, -347, -1006, 357, -55, 57, + 481, -31494, -816, 60, 76, -439, -328, -217, + 265, 123, 839, 218, 1355, 243, -878, -12819, + 5168, 318, 1376, -2931, 12689, -83, -220, 2848, + -770, 150, 1631, 1955, 1552, -1371, -3053, 1752, + -7250, -24, -514, -5568, -1529, -112, 419, -1136, + -672, -1847, -1136, 90, 453, 4810, 13012, -2355, + -2477, 1393, 451, 3390, 12, -2228, 1840, -2543, + -2404, -2969, 186, -444, 204, -265, -11467, 2204, + 1821, 3591, 67, 8821, 4015, -183, -5902, -1468, + 11394, 3062, -128, -476, 2495, -2888, 13482, 686, + -1320, 371, -884, 1829, -1810, 337, -1124, -1442, + 432, 1950, -1203, 663, -10445, 2310, 766, 137, + 4418, 2821, 135, 116, -12164, -3592, 686, 2310, + 1229, 1930, -1756, -1309, 1439, -3741, -305, 1547, + -9940, 3198, 1333, 2403, -2847, -3892, -259, -1766, + 881, 14310, -1711, -840, 2259, 3027, -1527, 1156, + 2904, -75, -728, 1536, -127, 152, -3240, -726, +-11914, 1037, -851, -1893, -748, -3294, -1114, 6072, + 103, -1539, 4573, -1637, 5242, 2705, -9890, 254, + -1565, -407, 1818, -23004, 1110, 119, 256, -707, + -451, -679, 374, -935, -669, 403, -10, -594, + -525, 1403, -1016, -553, 595, -169, 2523, -82, + 947, 11572, -1166, 11668, -4962, 842, -860, 89, + -3308, -640, 558, -851, 622, -1002, -4933, 2762, + 1991, -121, 1401, -111, -49, 868, 135, -1392, + -279, -560, 412, -241, 1414, -802, -1256, -298, + 447, 17738, -320, -1150, 1650, -398, 5626, 6076, + -8919, 455, 12716, -2094, 157, 1361, -1515, 1494, + -6210, -553, -1785, -424, -3049, -4066, -1188, -732, + 1992, -1926, 1495, 1085, -22434, 1187, 391, -1512, + 747, -313, -502, 1331, 456, -323, 246, -581, + 56, 1448, 2071, 535, 782, 520, -136, -290, +-12350, -11858, -456, 2340, -310, 22, 2210, -2531, + -392, -898, 3919, 1354, -332, -4255, 169, 425, + -476, 2577, -1172, 1984, 266, 514, -516, 2481, + 81, 2103, -710, 273, 1405, -14811, 5858, 3621, + -982, 345, 2044, 158, -2050, -602, 954, 342, + 239, 157, -317, -35, -260, 307, -31972, 228, + -77, 225, -154, 643, -883, -518, 32, 372, + 208, -22488, -458, 530, 104, 254, -775, -1264, + -571, 900, -263, -323, -296, 962, 520, 548, + -2196, 42, 1408, -211, -16117, 2052, 12656, -822, + 507, 321, -772, -786, -144, -3539, 892, -3430, + 19, -1831, 1161, 1836, 988, -1134, -704, -2994, + 692, 765, 457, 1624, 502, 13, 364, 337, + 32108, 1517, -225, 189, 141, 985, -572, 262, + -146, 31, 236, 269, -278, -1686, -13968, 1247, + -1009, 1046, 13467, 1276, -268, 307, -1383, 1544, + 136, 949, 70, 446, 1391, -2188, 745, -374, +-14231, -712, -15202, -533, -108, -2244, -1232, 450, + -895, 1086, -782, -1082, -718, -660, 796, -2095, + 2722, -468, -1717, 147, -23566, 377, -220, -1731, + -1416, 486, -241, 266, -802, -322, 1066, -544, + -167, 520, -1297, -100, 622, 670, -188, 711, + 32, 1155, 628, 350, -112, -154, -1048, -44, + 36, -454, 304, 32767, 356, 462, -1194, 549, + 138, 0, 1044, -119, 195, 1098, 521, 3294, + -3776, -224, 4297, -1256, -303, 2107, 300, -13283, + 2933, -3194, -1408, -4152, 4195, 287, -932, 1247, + 13453, 277, 418, -598, 87, 1132, -80, -405, +-13400, 656, -1310, -1447, -3974, 1719, 313, 500, + 1078, -114, 1449, -293, -120, -4754, 5583, 235, + -5140, -865, -484, 15572, 336, -1854, -154, -454, + -1475, -726, -3718, -4048, 1575, 480, 1094, -2209, + -3202, 420, -564, -48, 964, -2667, 2172, -1666, + 112, -730, 203, 3618, -15857, -4853, 48, -1084, + 1512, -937, 3353, -453, 223, 2267, 139, 190, + 1959, -720, 4389, 681, 10383, -112, 12390, -882, + 1695, 3539, -169, 3131, -122, 3627, 252, 185, + -523, 112, -219, 214, -182, -102, 118, 230, + -60, -801, -25, 42, -279, 262, -32358, 344, + -542, 382, -223, -404, 1201, -2646, -163, -803, + 3041, -1009, 3818, 756, 5834, 14249, -1828, 139, + -218, -658, -1314, -4980, -3322, -1461, -1598, -91, + 2464, -954, -5203, -791, 1339, -13598, 594, 702, + -388, -1115, -2377, -370, -3658, -3322, 1871, 2513, + 2910, 4095, -2195, 4291, 886, -567, 1182, -302, + -672, -21, -268, -29244, -199, -1024, -1284, 485, + 1432, -1086, 119, 1030, 418, -643, -1165, 1847, + -30, -844, -909, -416, -604, -609, -289, -391, + -238, -94, -391, -810, 413, 356, 954, -1935, + 30996, 441, 138, 1381, 1130, -2313, 558, -203, + -248, -951, 408, 1815, 256, -429, -892, -695, + 1138, 439, -760, -63, 6498, 570, 15252, -3397, + 170, 935, 338, 1, -528, 524, -541, -281, + -3, 499, -333, 685, 436, 32176, 389, -153, + 572, 256, 53, 16, -902, 724, 2849, 2503, + 80, 667, -1867, 742, 15205, -8715, -2588, -476, + -450, -733, -891, 1178, -1751, -1630, -114, 144, + -138, 10145, -188, -1608, -131, -247, -544, 9774, + -610, -2868, -3472, 345, -9294, 3724, 2634, -5124, + -392, 2551, -649, 782, -18, -160, -351, 12074, + 13865, -1294, 1262, -3135, -2861, 18, 753, 167, + 620, -2432, 1998, 740, 1902, 400, -206, 3518, + -3563, -632, 72, -1810, 1520, -827, -572, 1604, + -613, 3704, -736, 11100, 12702, -3189, -792, -3552, + 1621, 1841, 1236, 1215, -457, 9542, 9278, 2633, + -8801, 862, 1741, -4840, -2620, 616, 324, 2152, + 3632, 880, -472, 1927, -3456, -2105, -965, 3426, + -1893, 3095, -1152, -3542, 182, 998, -386, 1202, + 481, -1951, -510, -931, 1688, 151, -13664, -3894, + -973, -906, 1524, 9576, 2607, 12497, -819, -5214, + 5936, -634, -610, -4148, -421, -486, -1864, -306, + 2421, 724, -219, -1304, -2106, -504, 6762, 5266 +}, + +.cb1110l1 = { + -2972, -1201, -1388, -1762, 340, 21127, -999, 126, + 111, -1224, -1738, 311, -712, -450, -114, -648, + -752, -172, 67, 375, -967, -1032, -10763, -1885, + -2223, -3258, 480, -228, -143, -1299, 13128, -3062, + 1418, 6, -649, -1816, -288, 767, 345, 876, + -491, 948, 540, -167, 1969, -1883, -455, 20584, + -656, 114, 308, 279, 1105, -594, 1332, 255, + -356, -186, -540, 1898, -873, -477, 1404, 30475, + 370, -322, -337, -206, -440, -894, -54, -466, + -640, -408, -256, -560, -1503, 626, -573, -1684, + 419, 407, 2076, 5022, 3143, -1135, -12118, -12082, + -1462, -2060, -5432, -1092, 1575, 1958, -968, 122, + 958, -5312, 677, -1952, -12276, -1594, 1211, -1094, + 1992, -11032, -2993, -834, -1297, -1139, 312, -1546, + -4253, 1191, 21, 2771, 639, -2514, 6623, 746, + 1830, 2967, 1688, -14893, 7988, 4099, -97, 1165, + -2350, 65, -1308, 1834, -2084, 1683, 5118, -1633, + -10, -5282, 403, -1489, -264, 398, -2420, 12854, + -1498, -2642, -1486, 826, 699, -2213, -2296, 11849, + 478, -2202, -561, -250, 199, -2433, -948, -402, + 433, 403, 13031, -124, -180, 1499, -643, 527, + 11368, 5833, 938, 3202, -452, 2875, -1163, -117, + -2047, -1068, 211, 3122, -236, 13548, -702, 352, + -312, -1901, -2145, 2334, -12100, -76, -419, 362, + 3501, -220, -3086, 572, 1537, 3240, -1489, -1012, + 640, -513, 930, 390, 31019, 724, -78, -706, + 183, -157, -122, -847, -1156, 301, 508, -456, + 321, 317, 1300, -512, -1743, 10190, -294, -116, + 4183, 1374, 13360, -1339, 1832, 2547, -702, -2782, + -1464, 1176, -1287, 2256, 2169, 836, 2096, -248, + 1777, 11306, -211, 265, -3834, 336, 1936, -586, + 633, 1037, -1915, 12862, 930, -273, 2333, -3239, + 429, 374, 2518, -671, 570, -2208, 385, -284, +-15613, -1752, 1341, -531, -744, -1111, 290, -2302, + -1012, -2933, -366, -30, -4595, 1400, 560, 48, + 15739, -945, 411, 1876, 2441, -2144, -1222, 12448, + 54, -726, -2743, 2548, 2100, 1307, 408, -198, + -1802, -63, -1919, 933, -329, -528, -15918, 1704, + 3028, 217, 606, -2804, 2052, 9320, 592, 969, + 6836, 647, -671, 584, -1, 3564, -2575, 436, + -2195, 414, -201, 1099, -772, -220, -578, -467, + 125, -934, 271, -21476, 288, 215, 216, 476, + -560, 768, 1142, -169, -1112, -14096, -14436, 2769, + -1464, -61, 1373, -3539, -1067, 1175, -1549, -861, + -332, -1876, 3159, 340, 1711, -2453, 457, 2536, + 1114, -2278, 2464, -3253, -466, 12291, 12484, -2868, + -800, 1142, -4244, -178, 3781, 1542, -663, 1976, + 3105, 145, -100, -1774, -1039, 1627, 15540, 4194, + 5392, 741, 1816, -544, -9100, 4255, -1083, -1266, + 2580, -4200, 1934, 1721, 129, 2276, -2704, -1341, + -1310, -11926, -1478, 199, 755, 619, 4231, -478, + -1627, -1242, 1842, 13170, -2416, 778, 192, 273, + 782, 774, 2188, -838, 3139, -1532, -1639, -1073, + -596, 770, -353, -53, 82, -322, -20584, -344, + -443, 158, -144, -554, 50, 954, -145, -336, + -2050, 596, -950, -2690, 13908, -13783, 4792, 879, + 584, -2987, 967, 192, -585, -783, -1341, -3108, + -1622, 2478, -1362, -1470, -1556, -430, -110, -736, + -8097, 2073, 964, -417, 1669, -5425, -7846, 536, + 12883, -1690, 1143, -242, -438, -2274, 57, 302, + -574, 637, 2816, -1642, 2166, -172, 893, 421, + -614, -565, -338, -526, -1085, -939, -1138, -991, + 1919, 1720, -18845, -1950, -342, 1930, 321, 184, + -956, -374, -462, -216, -6, 26, 386, -50, + 603, -720, 634, -252, 261, -860, 218, 22846, + 11544, -459, -946, 452, -102, -1203, -1802, -1105, + -310, 787, -220, -1113, -2043, 650, 13767, -3638, + -296, -902, -413, 252, -816, -172, -505, -1335, + 890, 768, -523, 808, -331, 20000, -264, 1763, + 133, -1, -464, 949, -954, -147, 1780, -190, + 30, -7422, -4615, -1006, -470, -742, 500, 7509, + 1500, 1550, -3614, 810, 2595, 1506, -12926, 3588, + 402, -2547, 1505, 65, 4, 3382, -2201, -2441, + -1521, -5450, -3820, 282, 5212, 1186, -1056, -2334, + 988, 12987, 390, 4141, -2680, 1663, -8034, -1792, + -225, -674, -7147, 13254, 1631, 10163, -3332, -7, + -675, -735, 772, -2299, -326, 1641, -1174, -1911, + 82, 776, 891, -445, 18590, 238, 1417, -2372, + -9718, -2682, 600, -1401, 604, -1791, -22, 1546, + -1764, 525, -1355, 348, 3260, 1115, 204, 524, + 225, -12776, -679, -15595, -1188, 1078, 82, -859, + 28, 819, -1220, 563, 2309, 331, -1158, -2010, + -264, -383, 1732, -424, -2742, -775, -329, 132, + 391, 1261, 1033, -9812, -11829, 2433, 2690, 606, + -2724, 7216, -296, -1834, -1694, 456, -4732, -400, + -3192, 1428, -316, -13674, -2702, 2320, -6548, -2025, + 1222, 1749, 4005, 2924, -3539, -5104, -2333, -1438, + 2598, 62, -757, 760, 343, 154, -31947, -534, + 1296, 697, 88, 345, -577, -500, -174, -326, + -198, 272, 157, -815, -636, -1163, -867, -273, + 1054, 774, 1624, 989, 107, -1088, -673, 2143, +-22962, -566, 151, 72, -27, 1034, -444, 501, + 1905, -1455, 21, 289, -10670, -789, -2421, -2686, + -327, 804, -3009, 907, 960, 1379, -43, -552, + 2203, -1406, -911, -11094, -529, 4458, -4152, -70, + 3162, -12546, 326, 874, 1426, 3019, 2315, 104, +-12516, -1591, -2877, 772, 1982, 1160, -4491, 3417, + -1524, -2139, 130, 930, 9359, -18308, -376, 4090, + -468, 156, -216, 60, -643, -3440, 256, -835, + -2389, 1660, -542, -1628, 4270, 3574, -3136, 433, + 1069, 30024, 561, 268, 790, 294, 207, -1552, + -736, -97, -215, -98, 690, 686, -202, -736, + -453, 655, 511, -156, 1006, 361, 1424, -1254, + -361, -1253, -1419, -290, 78, 555, 565, -488, + -923, -18193, -630, -908, 188, 925, -1684, 241, + -319, -14478, 17007, -1415, 274, 592, 1344, 1784, + -731, 344, 992, 141, 290, 481, 628, 623, + -1166, -2092, 140, -1056, 13736, 754, 1980, -238, + 2132, -1372, -2216, -12057, -1662, 66, 1742, 2209, + -962, -1574, -3044, 173, -3066, 183, -4476, -1016, + 6160, 780, -1193, -3334, 179, -371, 244, 160, + -686, 669, 330, 426, 65, 159, -664, -186, + 479, -742, 54, 605, 32603, -941, 370, -91, + 856, 825, 1042, 374, 651, 313, 734, -240, + -49, -685, -1994, -604, -875, 44, -884, 886, + 13012, -1506, -4317, -1926, 3050, -1027, -482, -40, + 137, -2560, 1366, -11812, 2112, 2266, -2690, -1339, + -700, -243, 2322, -1042, 4635, -3210, 4281, 47, + 670, 9218, 1165, 814, -62, -2276, 12987, -714, + 2481, 1355, 896, 2840, -1664, 2048, -345, 2285, + 1754, -669, 2284, -288, -575, 944, -1528, 44, + 1071, -706, -543, -1347, 880, 257, 1364, 1444, +-17896, 99, 1539, 1813, -611, 355, -2290, 980, + -787, 132, 300, 2353, 204, -798, -296, -594, + 895, 842, 18755, 1129, 79, -189, 515, 882, + -286, 109, 305, 374, 1323, 861, -18, -78, + 294, -320, 674, 504, -159, -549, -95, -32403, + -90, 658, 1082, 1611, -137, -74, 1160, -794, + -55, 822, 2627, 1203, -3540, 9829, -7860, -9063, + -4015, -894, -2218, 729, -879, -1869, -2446, 4050, + -488, 13211, -290, -820, 371, 14196, 866, -891, + 218, -1838, 2162, 1144, -186, 512, 1416, 546, + 3298, -1253, 128, 1202, 557, -1967, 680, 545, + -139, -3008, 18453, -3322, -137, 163, 1377, 1116, + 2572, -1577, -1846, 651, -1319, 796, -862, 331, + 4383, 2453, -1894, 3264, 14137, 842, -3087, 3740, + -1100, -2400, -1364, 2406, 417, -2393, -868, -3158, + -9712, 3480, -1403, 1896, 201, 1285, -593, -11718, + 99, -539, -186, 45, -2266, -12228, -2658, 2802, + -1198, 1022, -3840, 1401, -1918, 1655, 1725, 96, + -205, -913, 1629, 568, -1285, 1264, -1160, 594, + 223, -336, -1436, -472, -19792, 553, 1494, -195, + 570, 282, -653, -54, -1115, 153, -484, 141, + -188, -278, -173, 464, 13, -634, -42, 390, + -464, -246, 622, 1229, -692, 29175, -574, 1150, + -135, 2685, 2452, 63, -962, -918, -1657, -1978, + -172, -677, -3414, 1345, -3964, 2875, -1412, -654, + -3000, 10739, 11348, -2232, 516, 8303, -189, 2564, + -150, -373, 903, -275, 2394, -1135, 508, 424, + -1704, -2222, -3789, 1938, 216, -12702, 2488, -1364, + -2175, 1114, -819, -2756, 1564, 952, 36, 609, + -933, -1568, 110, 143, -1575, -4236, 528, 15042, + -1920, 348, -2623, 5217, 1911, -1088, 259, -590, + 364, 2081, -3585, 662, 249, -119, -111, 778, + 2167, 11, 2500, 7182, 14452, 4388, 4121, 3623, + 1598, 532, -507, 877, 3830, 372, -2184, -2810, + 11748, -2095, -1079, -3070, -768, 2901, -3587, -2572, + 10008, 563, -4588, 1026, 1117, 1879, -12004, -416, + 317, 2032, 1800, 1058, -84, -296, -1748, 2588, +-11019, -1627, -3264, 2480, 96, 2146, -2672, 2418 +}, + +.cb1110s0 = { +-32746, 360, -2774, -672, -1808, -14, -1037, -1327, + 1409, -2215, 172, 1557, 945, 2031, -702, 1844, + -1106, 472, 2603, -978, 2782, -5691, 1473, -5668, + 7129, 6600, -2160, 108, -1844, 2062, -2395, -740, + 1690, -45, -725, 77, 7236, -12903, -3356, -764, + 1870, 720, -2201, 790, 9950, -3694, -5340, -4031, + 4115, 6863, 2352, 1484, 3606, -4855, 714, 4104, + 6240, 7261, -6855, 4919, -2847, 6701, 7469, -616, +-11442, -1935, 9157, -4072, 133, -5976, 2455, -9360, + -2898, -4353, -7721, -3098, -3505, 2568, -5432, -576, +-10072, 250, 2173, -4196, -4322, 2688, 5220, -6026, + -346, 11678, 2071, -7344, -2182, -530, -180, -2568, + 1524, -1617, -8825, -4845, 2794, -2813, -2669, -2423, + -2709, -8985, 2105, -4629, 708, 2040, -5680, -2470, + -7277, 6841, 6523, 4196, -6788, -1982, 3844, -5000, + 156, 1930, 1780, -3824, -286, 3908, 1703, 7304, + 1145, 144, 1180, 7145, 3175, -13823, 6580, -3066, + -6321, -9739, 4432, -1145, 2923, -2636, 3838, -7037, + -3913, 1262, -1398, 363, -141, -886, -5667, -212, + -2118, -2717, 2724, -18802, -2098, -155, -1399, 782, + 797, 766, 2613, 5374, -3767, -1711, 624, 693, + 2544, -6153, 7179, 6835, -762, 5061, 655, 2600, + 9208, -7030, 7047, 1654, -3404, 176, -5486, 1374, +-15378, -487, 7456, -1954, 2404, -2994, -1608, 2362, + -498, -7952, -6143, -3996, 1596, -3013, 1181, -1534, + -5265, 220, -2677, 1047, -4629, -15066, 3966, -446, +-11713, -5694, -393, -250, -1336, -7394, 1508, 6239, + 3788, 6273, 6215, 822, 2657, 8057, 8391, -658, + -2561, -11587, -2589, -6702, -9227, -1016, -2220, -9702, + 5988, 1859, -6100, -4594, 221, 2529, 2217, 8273, + 1804, -6128, -2859, -8259, -4707, -2494, 1913, -352, + -4561, -289, -1801, -994, -4445, -1001, 5422, 10868, + -7366, 1679, -5195, -6859, 2982, -406, 2400, 4520, + -3611, -1892, 4900, -3504, 771, 2774, -772, -1929, + -7354, 375, 628, 4522, 1069, -969, 8083, -155, + 3178, -1138, 1752, -17288, 4390, -2483, -2071, -1353, + -1155, -456, -2683, 6798, -1908, 1797, -6657, -2770, + 5610, -14518, 5922, -3964, -938, -853, 1416, -1077, + -4562, -160, 5820, -3031, 5091, 1987, -2746, -3779, + 238, -264, -3074, -11718, 9370, 9806, -6302, 3979, + -2938, 4034, 393, -1399, -4466, 2181, 756, 394, + 2264, -3664, 78, 470, -3228, 3942, -1714, 708, + 4988, 1938, -2722, 4555, -5054, -1026, 19312, 354, + 107, -5357, -4364, 597, -2566, -2812, -2278, -446, + 1384, -371, -2566, -388, -3964, -8989, 9136, 3389, + 8440, -5570, -1262, -5874, 2056, -5973, -185, 4540, + -4924, 154, -3653, -1113, -3048, 7099, -2734, 2940, + -6704, 1543, -8120, 10134, -9485, -6645, 4816, -442, + -32, -2430, 4932, -6129, -5050, 6120, -2147, -6910, + -1342, 1075, -2458, 50, -4747, -3080, 1886, 1490, + 18972, 48, 787, 2441, -405, 1668, -1399, 2202, + 2175, -3592, 1548, -2728, -4864, 504, 383, 376, + -1073, 2142, 504, -3114, 6378, -5516, 13462, 196, + 1840, 7087, 792, -3583, 302, 1012, -5504, 270, + 3354, -4486, -2312, -2522, -2872, -3899, -2261, 5211, + 1417, -3075, -151, -985, -772, -1630, 164, 659, + 1496, -349, -621, -32, -2982, -1720, -3475, -7370, + -1541, 1122, 20474, 1726, 4474, -3228, 7024, 3265, + 522, -2193, -2113, 5388, 1912, 5929, 11768, -1162, + 2600, 4048, 652, 3360, -3215, 376, 10028, 6054, + -3814, -1155, 93, 4512, -3581, -4037, 7484, -1481, + 2797, 2635, -12275, -2780, -6235, 5739, 2687, 376, + 5984, -2547, -8834, 4332, 2752, 1942, 1002, -3312, + 5251, -86, -7794, 918, -2413, 3131, -3316, 2095, + -4569, -15382, -5534, 1290, 5179, 2928, 3034, 2365, + 270, -7476, -3024, 6910, 1355, -6262, -2040, 10490, + 1432, 12284, 1125, -3160, 4518, 973, -2351, -1726, + 1967, 1488, 382, 3559, -3742, -2908, -944, -1662, + 682, 902, -4360, 5026, -4252, -1212, -3269, -6024, + -3788, 9128, -2638, -1625, 315, 3087, -3265, -10441, + -7207, -4078, -3266, -7543, -5223, 5460, 2496, -9258, + -227, 4048, 860, -520, 13616, -3458, 3837, 809, + -104, -4062, -4846, -136, -1631, 13977, -1136, 3380, + 1099, -4022, 1831, 3360, -9034, -52, -516, 10144, + 5074, 4866, 8282, -972, 2496, 2336, 8766, 2881, + 2417, -5588, 3064, 3934, -4202, 627, -986, 1750, + 958, -2348, 5006, -2597, -90, 133, 23271, 2431, + -3984, 1894, -2094, -1816, 5007, -3164, 2526, -1862, + 2651, 1809, 7173, 3410, 154, 14930, 3032, -5314, + 44, 8868, -543, -2158, 5341, 258, -8188, 3772, + 2804, 7544, 8339, -3560, -63, -735, 1300, -4308, + -1085, -4986, 1564, -6744, -2605, -310, 1275, 1166, + -640, 4814, 4373, 3103, -1242, 6049, -4786, 597, + 182, 2371, 6950, -2265, 389, -14669, -1942, -2733, + -485, -865, -597, -1376, 1626, -3956, -1244, 1532, + 3918, -3311, 1574, -88, -20573, -5471, -71, -1731, + 1436, 2428, 3982, -4576, -914, 5460, -4973, 1650, + -2364, -2486, 3212, 5424, -2501, 4595, -937, 728, + -5140, -9948, 1437, 10560, -5704, -264, -2752, 949, + 5229, -1445, 430, 827, 4103, -1999, -4625, -4171, + -8769, -8927, 7161, 4539, 6968, 5975, -4626, -2793, + 10080, -10386, -2479, 1724, 2992, 354, 3650, 3328, + 4490, -1931, 7348, 7283, -3304, 4446, -1698, -1224, + -3002, 4340, 1041, 607, -454, -4261, -18071, -1199, + -3902, 570, 5808, 5582, 6710, 235, -205, -4288, + 3472, -686, -103, -3658, -436, -9680, -190, 275, + -919, 2522, -2087, 9096, 5060, -6450, 10282, 3344, + -8167, -7688, 11881, 3101, -1280, -9942, -11741, 2213, + 712, 3976, -4218, -5285, 2797, 2996, 4006, 2053, + 2344, 6200, 141, 2616, -3981, 6970, -4194, -1621, +-13724, 7772, 2800, 2220, 445, -266, 4030, 444, + -228, 2642, 1617, -2511, 1699, 8740, 3438, -2063, + -2093, 1806, 950, -7112, -1513, -2886, -8789, 870, + 3456, -4126, -3330, 541, -10173, -1789, 3156, 4466, + -5965, 479, 5177, -2806, 2506, -1646, -3609, 1617, + -7373, -3146, -2389, 3601, 7850, 89, -3373, 4670, + -4180, -3186, 3056, -1691, 1314, 9234, -7799, 1323, + -4360, -9866, -1930, 8091, -13452, 8503, 1980, 11247, + 7688, -5953, -4165, -3192, 540, 1631, 131, 2250, + 5330, -146, -8724, -3148, 2834, 1148, -3886, 374, + -1836, -3898, 9649, 1119, 10221, 128, 8868, -7301, + 2601, 1252, 2340, -3789, 4682, 181, 4434, -1740, + 4368, 879, -620, 2046, 1842, 844, -925, -2506, + -3344, -8820, -722, -451, 521, 903, -1286, -3059, + -5308, -4759, -2706, -1429, 2762, 927, -1459, -7274, +-12028, 8838, 3987, 2406, 8626, -3128, 6505, -4322, + -197, -2464, 2738, -46, 161, 13919, 2252, 2059, + 981, 204, 1161, 4910, 683, -4311, 2081, -1932, + 1119, -6067, -5325, 8528, -4704, -5522, -6183, 5744, + -3407, -2021, 2688, -3230, 2490, -976, -500, -7834, + 2064, 3191, 4740, 3686, 1762, 2604, -2442, -5720, + -7550, 457, -3478, -8097, -6510, -9105, 8031, -4895, + 500, -2436, 1483, -4415, -2023, -3768, -2497, -1911, + 789, 566, -969, -4204, 6128, -5076, 2664, -4222, + 6755, 1774, 6881, 64, 1205, -9243, 4782, 4432, + 5193, -2258, -4787, -7433, 1755, -794, 1297, -7535, + 12773, 9124, 806, 2348, -8112, 7874, -4348, -1410, + -350, -2528, 576, 661, 272, 4598, 691, 1913, + -3349, -1881, -1854, -779, -821, 8444, 60, 2570, + -1813, -1354, -4512, -5471, 4728, 3289, 2617, -9326, + -6670, -859, -2713, -9839, 4676, -2657, 3106, -1393, + 10278, -3069, -2253, 1015, 2246, -2227, 16, -388, + 7962, 1493, -3122, -2707, 7982, -6106, -1462, -1665, + -1302, 2347, 3640, -15122, -2211, 417, 6819, 959, + -2876, -6868, 11060, -2329, -302, 1595, -4610, 9514, + 12677, -4614, -2899, -141, -4857, 1447, 6400, -2894, + 1696, -2888, 1889, 3489, 2775, -504, -6597, -5258, + -7256, -379, -1249, -136, 3118, -3537, 3295, -3458, + 2103, -399, 15281, -222, -1809, 172, 2257, 1947, + 707, 3562, -5691, 3575, -2210, 5750, 815, 4059, + -16, 1306, -13308, -1733, -1338, -3477, 5247, -1950, + -5148, -678, 8074, 1740, 290, 2033, 4639, -4240, + -536, -5214, -1366, 2491, 501, -59, -4480, 430, + -285, -5947, -755, -14559, 5696, 6960, 4462, 2317, + 6414, -13174, 4962, -899, 5924, 11100, 5303, -970, + -2528, -6239, 2253, 2236, 553, 458, -2229, 8016, + -7082, 2869, -4209, -4460, -6536, 3557, -1766, 7815, + -655, -6029, -5250, -1627, 2646, -3466, -3584, 901, + 10305, -895, -427, 949, -2776, 3436, 769, -4131, + 9019, -4898, -3562, -7978, -359, 1358, -1528, -3095, + 5840, -6214, 2591, -2086, 9480, 640, 2858, 216, + -3625, 5740, -7008, -1097, -2091, -143, 4832, 6210, + -1358, 3998, -714, 835, -4004, 3664, 1980, 1240, + 2902, 510, -1565, 427, -2052, -4208, -1505, 1187, + -1229, 3732, -932, -1014, 4784, 18474, -5111, 3047, + -54, -1547, -3892, 8612, 274, 1446, -3548, -7689, + -423, 1192, -4508, -10403, -8735, -446, 444, -6353, + 4008, -1462, -8906, -1161, -2395, 2442, 2204, -5472, +-17376, 2471, -689, 1394, -3657, -2119, -769, 2872, + 1393, -2701, -3536, 3650, -378, 859, -3338, 1412, + 3010, -3243, -335, -3619, -511, -1931, -7126, -5018, + -9332, -4440, 1906, -2265, 1386, 8072, -6576, -1300, + 5458, -4894, 630, -7146, 2263, 810, 2968, 1124, + -2219, 2292, -3914, -1836, -6683, 1511, -2755, 1396, + 2425, -23842, 2249, -53, -891, -1678, -1766, -1788, + 502, -4210, 211, 10376, -5507, 837, -6196, 2132, + -472, -10153, 7234, -1456, -148, 4886, 2427, 2371, + 1234, -962, 6298, 1016, 1735, -566, -878, -8071 +}, + +.cb1110s1 = { + 2525, 12164, 4861, 9505, -7371, -414, 3002, 576, + -347, -998, 2861, -804, 3034, 810, -788, -539, + -2092, 4970, 1828, -2869, -2802, 6649, 3673, -193, + -4034, 722, 1642, 3792, 8770, 10428, -3303, -3849, + -4520, -234, -4190, -1219, -1300, -4128, 8384, -1150, + 1578, -6174, -1072, -4871, -8180, -6698, 3806, -7386, + -2545, 1052, -550, -1148, -1308, -8834, -2654, 1982, + 8716, 6579, 1360, -2404, 1893, 2680, 3801, 11097, + 1455, 2453, -7585, -7503, -12710, -420, 2023, -656, + 1124, 2872, 9676, -4309, -202, 1458, -6526, -534, + -1535, 924, 3068, -1142, 5073, 1284, -5632, 869, + -1637, -2898, 4900, -10202, -10488, -1097, 1890, 11006, + -44, 1368, -1979, 6507, 316, 961, 8, -4085, + 2561, -2034, -1077, 2594, -465, -5134, -868, 54, + -6694, 9608, -3516, 7165, 11011, 9542, 4780, -2800, + -1130, -1714, -2684, -369, 4746, -2688, 4146, -7652, + 984, -3263, -276, -9134, -2848, -3983, 9994, 3608, + 3234, -596, 263, 3102, -178, -2264, 3820, -4293, + -5752, -3577, -3914, 1095, -1562, 22110, 4610, 69, + -2999, 254, 2178, -2901, -1203, -1292, 2642, -3254, + -1389, 2955, 1340, 542, 810, 1369, 3208, -795, + -3272, -2717, -1129, 8781, -6854, -3028, -616, 729, + 529, -6946, 1621, 9574, -14909, 5398, 854, -774, + -9978, -5417, -2516, -4683, 5715, -66, 3336, -5040, + 640, -7566, 3494, 7016, -2269, 1376, -13994, 6448, + -3948, -1697, -3988, -6559, 2376, 4231, -3131, 2045, + -2417, -5919, -7016, -1695, 9046, -7966, 5187, -2553, + 1402, -2351, -220, 5931, -1823, -2270, 584, -3784, + 2924, 6166, -3035, 2370, 4923, -1080, 682, -7899, +-10827, -1824, -908, 1568, -3565, 4033, -4266, -1948, + 923, 5488, -203, -2396, -907, 2783, -3278, 1415, + 7710, -190, -5208, -2279, 1266, -1132, -3392, 10251, + -1064, 11283, 2162, 2213, -5088, 4479, -4658, -1803, + 1534, -4233, -4073, 6938, 3966, -4878, -332, 5961, + 9217, 488, 6520, 4430, 7988, 9383, -2586, 1206, + -6983, -873, 1251, 1849, 5945, -2144, -2032, -1852, + 416, 3720, 2419, 8462, 3173, 11524, -2894, -5517, + -211, 17830, 3170, 1098, -721, -2066, -1956, -3097, + -1061, 2815, 447, 701, 449, -485, 2609, 1239, + 2257, -1760, 3091, 7538, 3710, -2689, -3092, 6903, + -2457, 3271, 6355, -1486, -828, 1994, -3575, 3949, + 3185, 2606, -4912, -16039, -8833, 1831, 2580, 1993, + -1117, -3408, -7590, -7278, -141, 2696, 805, 1896, + 308, 378, 9308, 2894, -4324, 1042, 837, 4716, + -4702, 2493, -5173, 8616, -468, -14829, 3759, 3251, + -4237, -1340, 5224, 2099, -764, -8263, -1699, 76, + -1464, 2115, -582, 3286, -3653, 1017, 1696, -1414, + -668, -9748, -5730, 2413, -1270, -6070, 17002, 2164, + -5440, 1801, -2123, 800, 2135, 4801, -887, -2141, + -647, -4846, -463, -577, -1846, -555, -1929, 2046, + 8272, -8399, 3886, -5950, -4202, -12600, -2805, 477, + 65, 6140, 1089, -4737, 8967, 1952, -1968, -3660, + 6641, 850, -3304, -1775, 4010, 10819, 14365, -696, + -1331, -1724, -237, -3611, 244, 3005, 4349, -182, + -4124, 2466, 2746, -61, 3391, -1392, 3788, 1582, + 3723, 7140, -2207, -3678, -2675, -252, -7476, 9426, + -6196, 3226, 3554, -6326, -4284, 6346, -4432, 5199, + -2633, -2499, 1200, -1140, -3910, 6624, 16732, 5946, + -766, 2630, -1200, 1988, 5510, -1199, 4126, 1287, + 454, -1795, 2664, 5001, 1058, 500, -437, 2992, + -2012, -160, 796, -4846, -6572, -10088, 603, 483, + -4510, -12799, 3502, -1784, 3510, -3956, 6038, 9044, + -6029, 7170, -1608, 120, 914, -200, 3939, -6274, + 3020, 6235, -2754, 5368, -1693, -6028, 386, -2006, + 1898, -11704, -9973, -525, -2624, 1799, 4140, 3248, + -57, -3731, 3764, 5582, -3830, -2484, -2066, 1517, + -900, -8250, -8191, 2676, 1147, 6752, 6908, 1196, + -2634, 3408, 2980, -1042, 3971, 632, -4946, -5690, + 133, 2445, -446, -1294, -777, 3356, -5628, -6020, + -8042, 5069, -1421, -2701, -15117, 3074, -912, -2574, + 2643, 5252, -2118, 3849, -3793, -850, 4170, 6240, + -697, 6976, -3752, 1155, 7769, -8912, -7728, 4224, + -2362, -3760, 3688, 2402, -3411, -3165, -2550, -8, + -209, -334, -837, 5688, 3425, -4564, 9999, -4780, + 3093, 4346, -5556, 1636, 1755, -14696, 1810, 6547, + -60, 4054, 10539, 6118, -4414, 1760, 3581, -841, + 4471, -23, 180, 259, -4439, -13230, -1326, 1913, + -621, -1641, -2882, -4934, 516, -3886, -4468, -110, + -4526, -5157, 7550, -4449, 813, -4364, 1768, -8829, + 2003, -1372, 1873, -209, 1539, 1076, -12408, -1464, + -1878, 1563, 2020, 704, 1425, -275, -3718, 4618, + -1120, -5057, -3590, 4022, -1977, 620, 143, -2507, + 3697, -3263, 616, -3002, -3347, 21051, -4398, 364, + -1924, 284, -2724, -2297, 4916, 2702, 4866, 4293, + -2781, 1094, -1525, -562, 5487, -2098, 4658, 1362, + -597, -3426, 3173, -5174, 3922, -3844, 1482, 4711, + 5853, 1490, 5499, -17537, 956, 544, 268, -4782, + -504, -4003, -911, 599, 1746, -7322, 1907, 1990, + 16985, 3171, -2645, 1040, -7239, 5618, 304, 3606, + -3377, 3630, 7319, 108, -496, 1026, 3062, -392, + 2366, 1948, -530, 806, 2700, -2676, -2717, 5238, +-16008, -823, -264, -1560, -1014, -760, -3684, -330, + 5644, -1668, -10239, -2583, 7411, -593, 2193, -1479, + -2892, 3834, -3625, -12234, -1103, 1868, -5121, 3879, + 2748, 1936, 2026, 4572, -6037, 3310, -8678, 11724, + 5290, -2316, 4131, 834, -3915, 869, -1734, -5752, + 1255, 9534, -3625, -115, -5912, -125, 2298, -1494, + 5910, -496, -2719, 1320, 3175, -3012, -3906, 4602, + -4760, -5918, -2568, 6632, -8802, -5876, 6358, 2349, + 207, 5191, 8369, -5932, 2710, 7950, 3673, -2592, + 1311, 8384, -4360, 8614, -5662, 1180, 2147, 1044, + 1591, -5555, -1597, 4418, 38, -1579, 4675, -1725, + -1693, -6470, 3066, -7601, -12822, 524, -2986, -3406, + 8860, -1266, -930, 4316, 1171, -2908, 199, -1785, + -2851, -3588, 3072, -3585, -2668, -1123, 1508, 460, + 6780, -19480, 2854, -1574, 1004, 5074, 1907, -1988, + 1177, 74, -1436, 2224, 1232, -3008, -3454, -862, + 604, -653, 2778, 2349, 3242, 8426, -430, 3684, + 4814, -1886, 5118, 1487, 442, -2322, -900, -2854, + -234, -10350, -7922, -745, -1490, -5638, -6014, -4079, + -2979, -351, 9493, -2274, -11362, -8166, -7364, 8261, + 1554, -1722, 4651, -831, 2276, 1502, 2600, 1266, + 4456, -4145, -3837, -3584, 4242, 4058, -2395, -6971, + 4486, 3233, 6226, 1306, -11506, -6223, -5132, 1537, + -4407, 1510, 5732, 2808, 5817, -4972, -2900, 897, + -2441, -1819, 5651, -6988, -10063, -2288, -5820, -1250, + 925, 3120, 6125, -9901, -137, 3684, -6601, 1077, + 3272, 21, 3341, -838, -3643, -1727, -4417, 660, + -6551, -184, -8125, -1780, 5232, 6077, -7968, 6423, + 3823, 3026, 4555, 464, 3318, -5504, 837, -3571, + 3853, -2277, -1864, -742, -5380, 6096, 6856, 1076, + 877, -642, 1926, -4712, -14482, -3323, -2672, 7485, + -2116, -3932, 2233, -3270, 326, 2221, 132, -1893, + -748, 453, 3597, -2308, -4371, 5632, 3609, -1033, + -444, -2591, 17359, -3120, -2604, 3157, -370, 9242, + -1606, 2675, -853, 1475, -416, -3280, -1159, 191, + -3670, 282, 4282, -957, -2978, 3564, 91, -20520, + -3046, 1248, 1277, 3368, 1118, 311, -598, 1406, + -2377, -1444, 1417, -3626, 167, -6440, 3341, 629, + -2523, 4398, -1187, 4322, -383, 1934, -3298, -8530, + 2195, 5220, 510, -1256, -6932, -1061, 5141, -16242, + -1390, -546, -3760, -2029, -929, -6044, -3503, 312, + 8478, 701, 8865, 4715, 1987, 1342, 1400, -71, + -5229, -1547, -8827, 2349, 12836, -1479, 4621, 6003, + -6749, -3184, -5667, -2930, -1074, 3204, 330, 4692, + 2872, -10808, 75, -1260, 18003, 4100, -1462, 1391, + -1667, -2039, -687, -4806, 5913, 2682, 7730, 7034, + 2703, 1666, 120, 1601, 2123, 1402, -4702, -11229, + 7875, -5591, 4634, -2274, 3015, -597, -7520, -1095, + -4814, -173, 5562, 1533, 2807, 8466, 5195, 7806, + 2585, -2877, 6938, -3942, 402, -3825, 4162, 9149, + -6423, 2447, 7041, 2932, -9813, 2124, -58, -3, +-12856, -7973, 1484, 907, 180, 8042, -2124, 4356, + -4117, 1126, -9706, -2101, 3957, -1877, 1139, 7148, + 3707, -1341, 4509, -1220, 4570, -1650, -6504, 7036, +-10268, -328, 4678, -12205, 5062, 6089, -496, -7740, + 2207, 4489, -205, 1386, -2695, -1442, 4730, 892, + 12061, 3818, -3305, 4431, 9300, 3470, 4608, 4315, + 892, 866, -1714, 1529, 2569, -11398, -3068, -282, + 1626, 587, -1568, -1630, -220, -2033, 7141, -2732, + -3541, 3404, 15514, 1883, -2697, -926, 5972, 6485, + -6794, 2111, 2490, 1201, 5467, -2352, 3264, -97, + 2400, -728, -3364, 3417, 1481, 2862, 462, 2855, + -5233, 5740, 7208, -10508, -3254, 1450, -1270, -293, + 3400, -6978, 10035, -1213, 4308, 2641, 8579, 8518, + -2919, -351, -459, -2069, -617, 638, -1347, 107, + 6009, 2035, -280, 2009, 3280, -1236, -14960, -5177, + -2440, 965, -2646, -2095, 5274, 1825, 3705, 3831, + -446, -4018, 7178, -2415, 4344, 1850, -509, -500, + 1056, -4374, 5709, 1336, 3352, 7915, -2302, 12209, +-14362, 6429, 1423, 2912, 6474, -1599, 1116, 2280, + -1738, 3108, -5792, -3554, 623, -1110, -6114, 4488, + 8941, -3176, 13670, -3320, -327, -2657, -7349, 3782, + -1481, 5737, -200, 2968, -9474, 5752, 5056, 4688, + -5352, -432, -906, -3832, -8519, -7, 3667, 3583, + 6250, 8724, 10737, 9371, 950, -1630, -10740, 5788, + 4111, -2910, 437, -2482, 1910, 185, -2168, -3155, + -3515, -1754, 4978, 4298, -6921, 476, -2778, 546 +}, + +.cb1110m0 = { + 3666, -1078, -175, 1370, 2491, -10050, -685, -7617, + 4002, 11104, 903, 5948, 2821, 3050, -2465, 1151, + -848, -2139, 12321, -1408, -1469, 2046, -2693, 2479, + -3498, 3077, -3822, 1841, -2404, -11172, -407, -3062, + -1725, -5475, 597, 1924, -197, 434, -1648, 2678, + -2462, 1148, 599, 1284, -13171, -949, -6508, 754, + 7466, 5924, 1411, -536, 10825, 588, 297, -310, + -593, -896, 784, -242, 716, 501, -52, 4043, + -755, -690, 2630, 17762, -2159, 2126, 954, -1316, + 11129, 1570, 387, -2639, 13953, -311, 5231, -2297, + -3612, -678, -1117, 690, -279, 2403, -1541, 493, + -1692, -2048, -771, -933, 423, 700, 840, 739, + 1956, -944, 612, -2678, 101, 245, -786, 850, + 269, 1355, 21773, 463, -2589, 596, -519, 788, + -43, 1220, 10674, 4847, 1192, 335, 875, -106, + 10644, 2600, 5391, -262, 2296, -5928, -1072, -122, + 2504, 1313, 1117, -981, 350, 375, -810, 8, + 1462, -2020, -2368, 8, 22663, 1537, 87, 908, + 832, -4884, 312, 620, 1042, -4444, 660, 1582, + -2710, -2954, 10012, -9580, 8102, 5696, -1371, -3035, + -3347, 402, 218, 1096, -1924, 88, -2270, 4175, + -1083, -497, -2437, -3332, -824, 212, -2362, 4600, + -7800, -11501, 7795, 236, -1336, -12920, 705, 4532, + -1488, 11746, -3213, -2650, 2524, -2638, -128, -328, + 3402, 453, -242, -2500, 2224, 708, 450, -3014, + -132, 1251, -131, -831, -710, -21985, 222, -2132, + -3261, 490, -3020, -860, 2550, 892, -623, -3666, + -664, -131, 2018, 2817, -12005, 496, -610, -7238, + -3909, -2867, 6872, 1903, 848, 6644, 3812, -5686, + -4055, -377, -2096, -10247, -1068, 1486, 415, -253, + -2186, 1050, 771, -6856, 1044, 7466, 2953, -7514, + 1601, 7015, -1778, -1622, -3364, -1755, 2835, 176, + 2700, 991, 2560, -554, 4867, 1571, -5610, 2610, + 12438, -3751, -9964, -2753, 4856, -2595, -5423, 10025, + 812, 687, 2715, 4013, 3086, -12039, 328, -3992, + 4044, -3920, -111, -553, -1720, 2454, 1706, -1365, + 804, -32329, -471, 897, -4670, 780, -3680, -1409, + -2630, 20, 184, -157, -290, 2794, -546, -160, + 1564, 1146, 628, -4787, -239, 11233, -492, 1955, + 608, 9273, -3220, 3830, 390, -5982, -3342, -3384, + 2356, 1820, -3473, 979, -40, -20190, 47, -200, + 5106, -381, 1824, -197, 2280, 2434, -2633, -1409, + -1109, -1072, 857, 1554, 7459, 6, 12130, -1078, + 1038, -300, -13748, 3201, -762, 2670, -1051, -445, + 914, -172, -558, 2634, -1158, 3129, -74, -3415, + 1086, -8892, 118, -647, 285, 186, 3022, -5077, + 1342, 3453, -7991, -65, 4690, 944, 3717, -1909, + -9783, -367, -1699, -772, -32768, 1286, -408, 340, + -340, 430, 1274, 596, -109, -727, 276, -946, + 139, 1804, -1050, -3562, -1392, -1179, 257, 1639, + 25708, 2278, 2415, 2174, 153, 126, -60, 592, + 994, -334, -268, 1826, -306, -2241, 2774, -3188, + 758, -450, 8023, 542, 6819, -1712, 14195, -2198, + 281, -12, -590, -1153, 4568, -3676, 1973, -5221, + -1839, -603, 3324, 2492, -3070, -846, 123, -1184, + 667, -10886, -65, -2615, 971, 10219, -1245, 7378, + -2122, -2306, 571, -2298, 1958, -4356, -9210, 4321, + 2805, 1888, 11129, 1282, -5819, -2528, -873, 1123, + -5968, -2644, -5515, -2151, -944, -7712, -2007, -2260, + -1920, 2100, -325, 153, 1050, 10, 1462, 650, +-12559, 3530, 754, 4493, 1528, -6991, -4842, 1483, + -2408, 2785, -1651, -830, 1433, -2464, 18899, -1891, + -3137, 996, 2485, 3056, -1061, -4015, -2282, 1356, + -2572, -490, 1209, 1137, 4, -636, -1282, 1001, + -1190, -172, -14049, -4256, -1972, 2225, -4738, -1054, + 5254, 8113, 4294, 36, 11765, -3993, -1084, 3864, + -3016, -10356, 353, 2963, -1228, 536, 609, -343, + 1246, 3617, -3667, 4794, -20360, 473, 725, -1246, + -1649, 1900, -2589, -2869, -2550, -886, -1164, -1876, + 307, 3784, -4782, -476, -700, 2118, -1860, 1533, + -5013, 2356, 3305, 3338, -14312, -1278, -322, 1950, + -954, -1990, 1438, 3358, 7479, 3046, -6677, -3078, + 1717, 3113, -12484, -1302, -221, -510, 10423, -3497, + 4170, -3606, 6983, -2902, 458, 667, 566, 2415, + -403, -2898, -44, -1832, -110, 1799, 1172, 7, + -1534, 90, 686, -26902, 1601, -822, 658, 182, + -151, 345, 1488, 1416, -272, 1560, 9774, 2084, + 16, -14344, 1428, 514, 2658, -1312, 2095, 454, + -1783, -2056, 4529, 1154, -2239, 956, 668, -1396, + -2898, 405, -12659, -12556, -650, -587, 3461, -2470, + 0, -3156, 3186, -4104, 1729, 1438, -1842, -422, + 4476, 1945, -932, -1439, -702, -1398, 3349, 1876, + -999, -2086, -17879, -432, 4036, -2299, 1133, 88, + -2221, -2730, -938, -998, -132, -426, 2084, 2060, + -1134, -313, 402, -538, -2593, 2022, 725, 1566, + -2070, 21622, 1767, -424, -32672, 205, -1239, -3253, + 198, -1257, 2342, -1918, 1505, 452, 1348, -604, + 978, 1079, -4, 2476, -1247, -146, -861, -1928, +-12222, -13042, -1384, -1971, -1428, 1224, -639, -83, + 1034, 3488, -2310, -565, 74, -335, 2774, 602, + 872, -2132, -147, 2160, 244, 162, 12600, 628, +-10194, -1296, 1068, -1824, -4945, 3194, 2066, -895, + -784, 2347, -1982, 73, 1030, 12589, -62, -2272, + 3827, -1776, 2546, -1417, 3310, 4726, -3078, -548, + -8522, 1632, -6667, 1008, 1128, 805, 954, 616, + 499, -31526, -1327, 790, -190, 1058, -1157, 1432, + -16, 411, -3180, 827, 327, 914, 1716, 1442, + 1052, -1635, -1805, -4145, -13678, 3597, -2273, -5920, + 3592, 1136, -211, 717, 3901, -5132, 3036, -601, + 12976, 1633, 10316, -1674, -468, 905, 2331, 841, + -247, -6053, -593, -3281, 4291, 5159, -1053, -1814, + 2613, 2221, 1146, 871, -421, -542, 923, -3567, + -1138, 10051, 10860, -6121, -661, -5677, -890, -266, + 2100, 6223, -70, -2658, -78, 3424, 714, 2138, + -1355, -981, 1990, 772, 938, 1311, -1963, 924, +-22516, 260, -341, 1251, -1578, 23, 1375, 1068, + 2688, -3965, 713, -5342, -257, 37, -6034, -276, + 228, -1240, -7171, -3402, -14677, 1708, -317, -2880, + 874, 1466, 524, 2091, 565, -4220, -265, 52, + -3373, -220, -3175, 2646, 448, -1628, -1986, 2200, + 3722, -15752, 7120, -2036, -2170, -627, -1079, -4060, + 2257, -925, -3418, -13488, -1308, 3476, -783, -3924, + -820, -860, 2418, 2982, -8753, 9001, 294, -11915, + -969, 3329, -761, 1459, -5308, 1811, 379, 306, + 632, -2732, 2512, 1188, -3470, -2167, -572, -2274, + -1657, 24074, -159, -138, -1826, -2527, -3117, -906, + -1770, -1182, 1240, -3064, 2313, -790, 336, -3843, +-13384, -423, 13066, -14, -1908, -32, 2607, 487, + -2426, 195, 135, 2742, 1540, -1034, 856, -2288, + -287, -774, 497, 1760, 191, 178, 298, 38, +-30898, 801, -1456, 2311, 1272, -1845, 334, -933, + 183, -1614, 739, 1881, -13548, -13589, 1496, -2075, + -1281, -1510, 108, 3683, -1120, 752, -980, -277, + -1289, 2016, -290, 1838, -321, -139, -881, -12391, +-14713, 1906, 990, -3202, 2320, 749, 1872, -2545, + -1457, -1727, 734, -327, -316, 1062, -3149, -2959, + 2210, 912, 952, 1926, -8918, 1098, 594, -1439, + -1402, 11097, 3482, -472, 219, -3845, -662, 9715, + 3928, 1254, -2009, 12375, -1724, 13938, 1892, -1390, + 686, 2174, 1010, -1297, -199, 1855, 463, 2601, + 4408, 1978, 1679, -1614, -3, -11965, 16220, 828, + 1497, -747, -484, 519, -1804, -3814, 3287, 2104, + 1149, 478, -3918, 1504, 2376, -316, -520, -1449, + -3918, 664, 2772, -16434, 334, -540, -778, -2812, + -6026, -4392, -2446, 3479, 3742, -624, 3895, 1145, + -344, 333, 11898, -2725, 12873, -1145, -1807, -279, + -452, -1581, 548, -5180, -2012, 3411, 1188, -1407, + -4016, -468, 1904, -1724, -11390, -30, 14402, 1610, + -2138, 1249, 346, 6097, -1433, -655, -174, 3652, + 4010, 954, -1458, -354, -1872, -2689, 880, -846, + -1304, -1725, 1750, -1186, 1520, 499, -583, 18201, + -1083, -3323, 3072, -5440, -182, 1065, -1112, -984, + 2501, -529, 613, 2054, 460, -5245, 2827, -1445, + -2403, -12898, 1504, -8428, -1035, -4620, 1704, -2586 +}, + +.cb1110m1 = { + 1442, 12425, -2072, 741, -3624, 12979, 2031, -364, + 3750, -5082, -1968, 146, 670, -3988, -831, 3962, + 397, 6213, -1178, 816, -88, -432, -9620, 11572, + 194, 289, -1958, -2115, -871, 5372, -3145, 3612, + 1644, 826, 525, -2545, -514, -537, 2485, -1014, + 1276, 541, -936, -302, -1172, 183, 827, 23939, + 1120, -346, -313, 2759, 3934, -3082, -2260, -906, + -967, 1496, 102, -2782, 323, -1109, -37, 2554, + -2920, 998, -930, -1952, -1138, 1842, -1593, 17345, + -1214, -1065, 2182, -1169, 11745, 278, 8310, 1491, + -564, 1169, 8406, 1359, -1249, -2094, -1365, 4069, + 1828, 897, 1258, 1083, 4319, 610, 766, 2273, + 4057, 621, 338, 1317, -20941, 548, -2012, 563, + 1102, -27, 3007, 1129, -1068, 1282, -2939, 2983, + 1958, 1800, 1912, 1728, -606, 1804, -4768, 5068, + -1365, 4543, 399, -14152, -6206, 6187, -2205, 1174, + -1892, -3284, -206, 2872, -2622, -43, 11268, -104, + 292, -1836, -6276, 725, 2066, -604, 11382, -448, + 742, 2854, -910, -838, -1802, 3678, -397, -530, +-10647, 2356, 12161, 1506, 2649, -3335, 3128, 2169, + 5942, 2152, 14124, 428, 187, 248, 1592, -44, + -59, -2934, 1883, -923, 2673, -847, 150, -2142, + -7620, 11078, -595, 6490, -13673, 948, 219, -1314, + -3080, 1339, 11020, 1362, 247, -1863, 1069, -3786, + 1706, 1064, 320, 4535, 136, 3795, 1465, -1356, + -449, 13, -421, 1769, 20470, 2181, -371, 2444, + -744, 2263, -155, -688, -236, -4481, 1551, 2812, + 2476, -1436, -470, -272, 2276, 594, -858, -978, + 1122, 2468, -9350, -353, -1020, 494, 13167, 1770, + 1734, -70, -4630, 12358, -818, -979, -3931, 1000, + -4343, 2570, 5567, 3322, 2930, -236, -4796, 6987, + -1658, 4291, 1118, 1710, -2050, -13566, -2, -23, + 2104, 1101, -316, 1906, 1643, 340, 5940, 3180, + -837, 1978, -10514, 1466, -6936, 3600, 1205, 957, + -211, -8272, 1611, 5330, -5217, -2264, -5681, -3085, + -9201, -62, 3366, 1370, -9494, 244, -5516, 1210, + 2930, -432, -1265, 376, -1910, -1016, -845, 3228, + 1094, -3168, 634, -265, -3426, 4367, -4004, -277, +-15081, 3998, 9671, 3418, 691, 9124, -2723, 1939, + 2311, 581, -4980, 3381, -1502, 878, -1037, 1496, + 3002, 904, -5388, -3300, 263, 1277, -694, 766, + 1781, 1134, 250, -32602, -285, 210, 2550, -383, + 908, 302, 292, -352, 2615, -97, -1863, 1908, + 2685, -502, -3767, 416, 990, -602, -1533, 43, + 1288, 1326, 16638, 433, -1204, 1850, -1609, 1407, + -7196, 2319, 5770, 1584, 1150, -634, -1686, 1359, + -1396, 438, 246, 186, -11262, -1194, -3790, -3267, + 2692, 755, 142, 16276, -2338, -1341, 10433, 38, + -1510, -2520, -3205, 913, 3783, -1622, -4744, 1891, + 2502, -8, -2962, 2091, 14986, 1270, 2931, 682, + 1073, -10215, 1606, -1010, -822, 1168, -1403, 254, + 1156, 3206, 3958, 1739, -402, -654, -4862, -1869, + 2643, -2858, 658, -910, -2548, 5428, -1992, -208, + 1950, -15526, 520, -4212, 3182, 4160, 1524, -2916, + 586, 3213, 675, 185, -629, 669, -838, 502, + -4065, 353, -4072, -1832, -2108, 5034, 2484, 15386, + -2102, 4988, 70, 1011, 2568, 1360, -2821, 3352, +-11074, -2686, 611, 460, 1811, 3093, 34, -9140, + -1163, 26, -875, 2510, 1134, -1322, 2274, -960, + -823, -510, 1092, 1490, 1466, -1978, 32767, -2379, + -1019, -633, -1306, -242, 2050, 1336, -2668, -2195, + -442, 8, 2292, 4344, -2439, -1472, 1035, -14443, + -1820, 6309, -2096, 45, 3617, 1561, 1252, 2828, + 10682, -894, 10841, 2373, -101, 913, 2160, 2653, + 2960, -4433, 1193, 4892, -2123, -7911, 991, -2643, + -1364, -3641, -9736, 444, 869, 2990, 926, -1220, + -1676, 7492, 4376, -3742, -6964, 4531, 7522, -2686, + 164, 1070, -7305, 1863, 542, 146, -800, 18492, + -4849, -3876, 2162, 5111, 2606, 4243, -3035, -2990, + -1710, -426, -5315, -2332, -1020, -268, -1242, -39, + -1684, -32768, 1288, -726, -1768, 304, 702, -2969, + -700, 586, 1541, -1099, -348, -2816, -2181, -1260, + -1658, 2278, 323, -1548, 2513, 11816, -2416, -5837, + -118, 6770, 3360, -4097, -264, -1270, 1064, -9862, + -3669, -56, 603, -1475, 1464, -9553, 6, -3091, + 5331, -396, 892, -2774, -4674, 3667, -9982, -5160, + -1146, -4026, -2032, 2936, 1805, -1026, 1065, -420, + -572, 1756, -479, -583, 30760, -732, 750, 270, + -1541, 28, -1114, -96, -264, 1167, 548, 570, + 84, -1981, -2110, -1136, 358, -6337, -257, -14658, + 1144, -9032, 322, -3730, -3086, -1351, -3320, -4116, + -396, -129, -3202, 1403, -347, 2400, -371, 532, + 1555, -2760, 1078, 804, -1314, 21956, 2231, -2808, + -1947, 838, 12428, -14514, -384, -1554, -675, -885, + 1358, 1612, -3266, -98, 1876, -447, 2241, 3375, + -1765, 2792, 674, -1513, -1132, -3696, 11368, -1916, + -2778, -466, -377, 2090, 3897, 5422, -2550, 2360, + 3279, 8657, 990, -2128, 2592, -970, -2397, -269, + 22742, 694, 310, -2433, 920, -690, 1478, 1370, + -450, 445, -1379, -1244, 2374, 1400, -1040, -5692, + -1700, -1630, -4068, -1193, -719, -2953, -3562, 264, +-13247, -4629, 5, 3245, -5724, 2449, 3190, -5375, + -3560, -3834, 1271, 1568, -762, 2938, 782, -1390, + 243, -466, 1376, 974, -1646, -1784, 249, -514, +-13543, 1904, 10778, -772, -155, 7838, -30, 3634, + -473, -9100, -112, -3990, -840, 1495, -2346, -326, + 3655, 1292, -292, -10972, 3431, -262, 171, -9775, + -985, 578, 312, -2553, 3375, -8316, 1410, -1326, + 2459, -3116, 1079, 7194, 2720, 1998, 2742, 4672, + -1589, -8932, -124, -652, -72, 2409, -926, -3661, + -3762, 14832, -1350, -2234, 1258, -1604, 169, 103, + 1263, -400, -765, 144, 824, 855, -13344, -1629, + 1977, 2995, -1964, -650, -219, -11607, -6062, -792, + -1243, -1438, 1757, 1436, -3739, 812, -856, -9603, + -2428, -11372, 3273, -2318, -8263, 1551, -2054, -3646, + 3149, 2255, 594, -412, -3030, 1558, 694, -1211, + 618, 3256, 6526, -1572, -9054, 6655, -3208, 3616, + 2162, 3137, 4254, 4610, -10040, 1188, 335, -615, + 640, -1990, -314, 6014, -2392, -2174, 343, 6730, + -1320, 183, -97, -3566, 2988, -13343, -1573, -9070, + 428, 2839, 6728, -1109, -1113, -1102, 5012, 1308, + -3943, 3207, 764, -2928, 1144, -3044, 4033, 1846, + 6460, -4165, 8509, 9824, 15708, -642, 748, 124, + -406, 13033, 807, -299, 1319, 1499, -1206, -1102, + -3129, 3795, 47, -2483, -2470, 2287, 4028, 1656, + -364, -1712, -1568, -3940, -2770, -13688, 796, 3380, + 363, 1673, 1160, -3934, 2884, -5060, 832, 4799, + 364, -3030, -10596, -1805, -3256, -2492, -1831, 1088, + 11108, 3236, 5128, 3052, 4486, 84, 2078, 200, + -4071, 1713, 1539, 24597, -1019, 32, -48, 82, + 81, 1171, -1261, -1783, -1693, 2194, 1714, -225, + -1989, 402, 2611, -708, -15901, 222, -507, 12855, + 1162, -1536, -2884, 1911, -1256, -926, -1875, -1448, + -2730, 3059, -1231, 1680, 1824, 1288, -215, -9, + 40, -957, 27662, -1844, -1927, -846, -1144, -439, + -3507, -2844, -1880, 637, 1042, 237, 1007, -387, +-11913, -2584, -142, 624, -494, 1439, 2225, -13017, + -1901, -1253, -1071, -7083, -2154, 814, 3867, 1130, + -2611, -2260, 1548, -12389, -1018, 102, 1178, 1058, +-14863, 2020, 4094, -1259, -861, -886, -3119, 2638, + 1725, -1364, -2086, 183, 507, -978, -3086, -14966, + 759, -1341, -70, 8538, 2974, -140, 2509, -4460, + 2724, -1372, 491, -6138, -345, -2170, -1187, -330, +-11090, 15657, -300, 2105, 496, -2093, -447, 2000, + 3451, 1482, 758, 4142, 562, -4042, 1491, 3183, + 1685, -2729, 1611, 11698, 14918, 25, 842, -2766, + -667, -1564, -2619, 646, 1391, 862, -909, -2141, + -589, 1468, -755, 1324, -765, 634, 195, -19622, + -1006, -1161, 2434, -1808, 4168, 4108, -2580, -635, + -2533, -2170, -3701, -1047, -363, 769, 5064, -8, + -654, 2346, 752, 13736, -4056, 7, 5492, 7326, + -4894, -3860, 3325, -3947, 4721, 5557, -3699, 194, +-12957, 1052, -1317, -2642, -2931, 1050, -3951, 2392, + -9683, 2519, 2880, -3700, -1820, 831, 4370, -1177 +}, + +.cb1616l0 = { + -185, -20290, 476, -272, 31, -638, 806, -61, + 220, 176, 178, -788, -441, -333, -360, -263, + -116, -512, 9794, -727, 8904, 1192, -277, 756, + -670, 795, -311, 240, -617, -675, -970, 756, + 857, 529, -166, 674, 890, -522, 837, 79, + -618, -1308, -13832, 744, 5422, 2688, 531, 398, + 1500, -1965, -209, -346, 613, 2147, 10053, -1398, + 189, -108, 471, -1202, 999, 178, 762, -601, + 1116, 9468, -281, 763, -1204, -822, -20, -160, + -806, 14720, -269, 143, -1362, -532, -788, -1532, + -405, 85, -271, -4959, 276, -34, -28, -66, + 112, -188, -582, -678, 128, 680, 982, 596, + 12154, -10468, -167, -380, 734, -296, 282, -223, + -86, -342, -812, 514, 387, -418, -364, -1216, + 14, 373, 357, 10897, 11235, -714, 206, -618, + -607, 596, 190, 726, 496, -300, 95, 1022, + -153, 212, -540, 252, 281, 238, -234, 28, + 24, 184, 32767, -627, 569, 323, 486, 544, + -348, -589, -284, 238, 228, 475, 83, -7753, + 182, 745, 400, -633, -207, 137, 382, 90, + 78, 715, 448, 463, 937, 10203, -12047, -667, + -370, -1516, -360, 94, 832, 1027, 1013, 92, + -5446, 834, 302, 764, -94, -462, 8095, 1057, + 308, -635, 308, -877, -946, -616, 51, 1090, +-13351, 490, -819, 15182, -384, 411, -546, -242, + 460, -323, 76, 277, 1582, 900, -1119, 345, + 1316, 1138, 2020, 1612, -148, 812, 1241, -10350, + -9495, -965, -69, 1967, -168, -128, 1042, 447, + 491, -133, -5083, -450, -164, 50, 326, 269, + -283, 226, -40, -334, -110, 60, -47, 169, + 9166, 1188, -942, -14, 2112, -230, 634, -741, + -214, -336, -606, 3102, 59, 216, 1805, -1176, + 211, -8, 564, 156, -261, 300, 597, -21842, + 66, -232, -506, -1126, 1057, 603, 1448, -391, + 249, -9445, -10240, 694, 167, -1158, -645, -385, + -209, 330, 519, -345, -600, 192, 78, -229, + 208, -9053, -383, 10646, -264, 84, 295, -148, + 87, 1292, 257, 1080, -564, -2395, -1200, -484, + -48, -513, -383, -11, -516, -17356, -1172, -218, + 124, -327, 31, 328, -80, 231, 58, -951, + 560, -501, -392, 30528, -56, 382, -515, -50, + -155, 338, 0, -414, -899, 95, 11, 378, + -350, 459, 673, 76, 86, 379, 32222, 143, + -48, 425, -394, -60, -348, 450, -489, 220, + 56, 1129, -125, 322, 168, -16, 322, -293, + 294, -38, 328, 141, 692, -82, -160, -32768, + -140, -1543, 1079, 1052, -924, -569, 168, -1782, + 815, 706, -1318, -3436, 2860, 10922, 236, 10311, + 882, -1911, 11, 1638, -189, 245, -858, 11060, + -826, 696, 224, 1707, 1766, 472, 10832, -265, + -161, 163, 478, -258, -284, -86, 496, 425, + -71, -10344, -141, 425, -1457, 1145, -63, -713, + -583, -327, 628, 368, -18, -1746, -525, -338, + -110, -359, 92, -233, -21328, 460, -275, -98, + -58, 51, 208, 56, -1145, -51, -242, 65, + 76, 214, 141, 28, -86, 26, 925, 193, + 9980, -326, 11342, 176, -534, -303, 130, -1575, + 189, -496, -699, 381, 411, 644, 229, -147, + 694, -1998, 523, -1576, 8028, -10385, -1924, 1174, + 608, 2402, 575, -1753, 437, -816, 1267, 147, + 1448, -614, 865, 1076, -156, 5000, 2020, 2021, + 10283, -460, -2381, -3226, -3991, 4904, -284, 105, + -268, 1049, 203, -646, 732, 6490, -128, 932, + 10, -866, 74, -64, 834, 204, 159, -162, + -170, -110, -28908, 52, -512, -72, 327, 615, + 534, -484, 131, -262, 31, -407, 284, 33, + 11118, -170, 318, 12848, -1126, -659, 500, 310, + -403, -234, 237, -544, 1232, -243, -1178, -965, + -117, 108, -1304, 11728, -2254, 1231, -1077, -136, + -632, -103, -256, -1644, -300, 1680, -1175, -956, + -43, 1718, 175, 144, 275, -802, -223, 1116, + 321, -871, -1174, -1175, 1008, 255, 31172, 28, + -621, -222, -12473, -10995, -712, 247, 1762, 418, + -181, 90, 92, -406, -435, -105, -596, 2262, + -116, -1574, -3402, 6796, 7944, 973, -2661, 2260, + 621, -6984, 382, -1375, -2604, 1550, -1453, 1133, + 966, 403, 284, -72, -36, 174, 457, -90, + 38, -437, -476, -370, 469, 32767, -267, 350, + 694, -169, -782, 2110, -620, -782, -669, -6478, + 10550, -3294, 485, 177, 553, -3232, 1628, 2335, + -870, -360, -1112, 2197, -474, -5113, 3346, 878, + 566, -3823, -1175, 357, 10509, 1077, -514, 1012, + 38, 59, 669, 654, 349, -1046, 355, 192, + 57, 95, 11869, -702, 10201, 204, 45, -608, + -444, 921, -1070, -316, 1286, -2566, 2026, -127, + -79, -954, 93, -1288, -10024, 693, 8820, -366, + -84, -6378, 1682, -627, 386, 254, 503, -152, + -336, 38, -341, 373, -85, 1088, -1707, 119, + -242, 242, -326, -162, 109, 70, -114, -831, + -279, -32768, 62, 58, 214, 136, 194, -103, +-10047, -610, 91, -310, 12059, 346, -656, 986, + 478, 364, 1777, -173, -663, -103, 1011, -373, + 200, 1632, -13098, 3651, 418, 478, 68, -217, + 169, 78, -1176, -1191, -1664, -328, 152, -1053, + 547, 527, -10435, -176, 11131, -137, -36, 1062, + 33, 71, -730, 2080, 2061, -372, -637, -84, + 744, 109, -357, 550, 309, -239, -134, 135, +-20461, -177, -690, -488, -36, -415, 275, 64, + 378, 11250, -802, -569, -200, 1499, 13103, -1090, + -175, 189, -162, -751, 1052, -949, -98, 1249, + 479, -1304, 3293, 771, 1642, -381, 1423, 2258, + 1184, 4806, -10950, -3873, 348, -815, -5315, -3306, + -3307, 2337, 776, -125, -48, -435, -155, -30, + 294, 116, 96, -47, 1022, -391, -183, 252, + 826, -32, 293, -1369, 18310, -146, 239, -266, + 34, -154, -704, -498, -135, 228, -563, -210, + -158, -514, -201, -571, -341, -428, 74, -152, + 297, -162, -644, -216, -252, -13810, 705, 464, + 21097, 74, -169, 792, 12, 131, 320, -398, + -446, 44, -362, 388, -22, -13, -209, 1205, + 9341, 590, -683, -351, 177, -1618, 495, 14, + -319, 755, 11352, 249, -989, 1574, -922, -364, + 366, -10348, 337, -558, -124, 12056, 102, 802, + -548, -254, 1532, 7, -282, -459, -839, 171, + -4445, -1610, -1515, -37, 970, 306, -881, -238, + -154, -58, 27, 435, 166, 571, 225, -844, + -9967, -192, -874, -459, -1283, -1431, 1552, -38, + -686, -207, 709, 11982, -383, 1922, -92, -60, + 708, -900, 867, 39, 1470, 517, -182, -456, + 90, 1026, -192, 9988, 942, 48, 789, 981, + 74, -692, -1283, 1239, 1625, -1121, -286, -1115, + 294, 13228, 980, 312, -745, 11711, 1055, 1052, + -907, 201, 688, 364, 1171, 96, -591, -981, + -246, 875, -352, 677, 881, -397, 12890, 10, + 0, 412, 76, 464, 275, -721, -28, -197, + 104, -238, -372, -272, 490, 1426, 963, -13232, + -1190, 790, 161, -321, 1138, 646, 359, -183, + -659, -129, 348, -22703, 1016, -147, 26, -80 +}, + +.cb1616l1 = { + 292, 310, -255, 305, 69, 25001, -16, -668, + 210, 17, -12, 45, -758, -76, -544, -882, + 61, 26, -1682, -8820, 154, -11775, 64, 472, + -464, 245, 478, -1560, 869, 2192, 98, 645, + -95, -9369, -594, -635, -11132, 900, 1606, -904, + 841, 2570, -1464, 961, 1056, 669, 461, 3307, + -157, -644, 121, -694, 170, 116, 393, 1507, + -233, -654, -162, 108, 98, 17471, 347, -11344, + -701, -284, -246, -337, -1903, 14, 9865, 453, +-11318, -3662, 2373, 1106, -1424, -1709, -2743, -860, + 11008, 1579, -38, -1381, 467, -487, -1306, 369, + 426, -424, 128, 1078, 1085, 683, 12552, 792, + -184, -278, 186, 2006, 363, 310, -75, 862, + 377, 490, -256, -1568, -124, -10785, -1456, -524, + -1259, 517, -1844, 914, 769, 945, 739, -1053, + -691, 177, 96, -1070, -162, -707, -594, -9885, + 103, 452, -734, -6774, -753, 192, 88, -292, + 201, -532, 231, -281, -691, -1232, -1768, -753, + 369, 1556, -139, 668, 941, 264, 10372, 9740, + 976, 2519, -88, 941, 446, -130, 2131, -631, + 325, 285, 176, -236, -634, -91, 112, 32767, + -233, -726, 156, 881, -217, -497, -236, -1106, + 283, 164, -328, -629, -27442, -17, 176, -338, + -192, 538, -773, 634, -180, 872, -190, -530, + 586, 6994, 3060, -336, 736, -1268, -1142, -69, + -1359, -1047, -975, -86, 12489, 1162, -509, -478, + 717, -514, -502, -1755, 11064, 7668, 340, 230, + -127, 1490, -63, 680, -297, 125, 1700, 2505, + 3, -2043, 255, 1547, 569, -2483, 733, -896, + 881, 4780, 1544, -13442, 1328, 1937, -4448, -384, + 749, 173, 7350, 156, -144, 52, -527, -34, + -3, -173, 118, -528, -75, 39, 42, -874, +-14636, 474, -413, -106, -115, -431, 54, 722, + 156, -468, 369, 149, -68, -791, 1318, 2150, + 69, 454, 19032, 3, 111, -40, 349, 88, + 385, -54, -395, -224, -519, 0, -219, 179, + -253, -11379, 11005, 1857, -126, -248, 304, -616, + 351, 324, 500, 1494, -1390, 2349, -1257, -1114, + -213, 8156, -2066, 9746, 763, -848, 349, -7, + 723, -966, 469, 91, -252, 1336, 579, 1816, + 1372, -941, 364, 276, -33, 7, -425, -433, + -21, 546, -671, -31271, -926, 101, 147, 302, + -552, 224, 568, -2386, 519, -458, 13171, -1464, + 1161, 639, -10, -877, 331, 3372, -72, 5158, + -706, 906, 2668, 1008, -2732, 3264, 105, 630, + 673, -1948, -196, -13130, 1726, 737, 4829, 93, + 654, 2175, 3858, -5, 245, -471, 369, 5435, + 356, -12934, 61, 1984, 975, 706, -2454, -642, + -93, -780, -443, -1487, -460, 1112, 385, 309, +-10268, 197, -1692, -1870, 50, -1934, 5380, -1193, + 775, -493, -992, -557, 2952, 408, 4616, -1341, + 10774, 5305, 854, 3031, 67, 617, 2436, -2072, + -1469, 804, -578, 243, 264, 9150, 200, 10753, + -350, 182, -52, -406, 508, -761, -161, -1142, + 25, 484, 127, 126, 477, -341, 110, 371, + 32767, 1090, 678, 175, 146, 1020, -897, 878, + -137, -507, -534, 658, 678, 505, -753, -207, + 391, 60, -23279, -772, -1323, -1578, -3, 196, + -749, 220, -482, -785, 456, 38, 1034, -579, + -58, -1539, 421, -746, 238, 1531, 21290, 586, + -441, -276, 1512, 553, -1407, -276, 60, -1068, + 299, 650, -25, 12590, 2058, 925, -295, -1744, + 5152, 4935, -419, 272, -383, -665, -194, -255, + 574, -267, 541, 1031, -282, -648, 622, -1464, + -28, -269, -533, -80, -476, 282, -336, 125, + 104, 464, -8948, 849, 171, 1518, -296, 51, + -27, 3097, -5103, -412, -494, -194, -713, -1277, + 102, 1740, -445, 3432, 1180, 6404, -10908, -970, + 31, 142, -242, -79, -78, -76, 124, 1031, + 83, -55, 1522, -613, -32768, -394, 1306, 287, + 701, -4725, -1085, 415, -122, -538, -675, 82, + 116, -728, -99, 500, 659, -329, 292, -106, + 9243, -340, -11933, -498, 341, -825, -401, -402, + 142, -13, -309, -722, 141, 0, -681, 494, + 671, -1210, 1466, -1335, 11743, -280, 1616, -11481, + 52, 317, 902, -653, -967, -494, -162, -685, + -438, 756, 81, -207, 577, -7476, -353, 918, + -31, -107, 181, 523, -46, -752, 373, -908, + -1808, -916, 632, 1508, -35, -6943, 64, 13072, + -655, 163, 1221, -1655, -2568, -446, -401, 470, + -622, -944, 3744, -458, 203, 125, 238, 5196, + 21, 12193, 1095, 1091, -787, -1157, -980, -1154, + 7707, -29, 106, 1226, 696, -974, -379, -537, + 56, 95, -477, -528, -11245, -1014, 140, 380, + 89, 540, 84, -619, -322, -572, -240, -26, + 727, 310, 43, -790, -31, -24318, 110, 618, + 44, -108, 89, -191, -33, -201, -490, 43, + -136, 1366, -2, 162, -832, 469, -140, -278, + 600, -15775, -1699, 184, 1825, 728, -1803, -876, + 152, 60, -813, 3063, -929, 972, -282, 718, + 8426, -888, 1383, -664, 571, 958, 982, 236, + -548, 66, 1898, -274, 10715, -1693, 79, -1254, + 296, 609, 682, -1074, 272, 157, -18972, 377, + -12, 438, 536, -672, 292, 719, -464, 1106, + -296, -812, 6, -334, 67, 678, 382, 678, + 301, -22165, 184, 80, -671, -86, 139, -298, + 416, -610, 1057, 15, -230, 376, -768, 643, + 58, 27, 178, -742, 60, -500, 485, -19923, + -1016, 717, 1126, 287, 2171, -388, 1453, -21, + -268, -1555, -263, 713, 1709, -1103, -10699, 1788, + -8, -501, -892, 11476, -2006, 466, 8070, -286, + 163, 35, 494, 76, 1428, -2249, 100, -1542, + 319, -214, -701, 10130, -294, -11962, -656, 227, + -512, -1014, 213, -600, -720, 63, -180, 1286, + 1063, -9671, -1056, 1269, 1484, 20, 790, 29, + -9906, -373, 608, 361, -659, 43, -1034, -96, + -219, -65, 392, -19615, -464, 212, 820, -182, + -227, 463, 301, 642, -219, 386, -1170, 108, + -5583, 422, -507, 530, -1058, -131, 20, -14487, + 101, -14, -415, 32, -1133, -917, 944, -832, + 580, 2509, -959, 470, 1184, 432, -1238, 193, +-13382, 2329, 1993, 1035, 80, 3139, -553, 1683, + 390, 1480, 642, 564, -11173, 422, -984, -559, + -686, 168, -777, -810, -1278, -427, -96, 1691, + 29172, -435, -50, -968, 221, 685, 52, -373, + 525, -563, 350, 528, 305, 705, 313, 612, + -254, -220, -1638, -156, 24, 109, -893, -697, + 245, 2579, 667, -142, 12315, -694, 3799, 5, + -438, -473, -426, 59, -5381, -56, 200, -280, + -276, 96, 435, 729, 336, 123, -714, -372, +-12609, -12053, -238, 223, -242, 230, 663, -645, + 98, 515, 3, 724, 510, -48, 1090, -173, + -5024, 536, 635, -143, 702, 172, -196, 164, + 190, -152, -180, 238, -142, -329, 191, -296, + -416, 11775, -496, -95, 392, 994, -584, -925, + -963, 286, -458, 3104, -1990, 968, -1430, 998, + -407, 28485, 436, 42, 378, -210, 148, -149, + -532, 94, -628, 186, -186, -274, 250, -316 +}, + +.cb1616s0 = { + 5604, 1491, -2064, 1321, -2846, -3007, -1899, -896, + 556, 1969, -2225, 18515, 4156, 1333, 3489, -2168, + 1897, -1440, -1514, -13837, 1017, 4797, 453, -2101, + -6822, 923, 185, 754, -201, -4151, 126, -793, + -437, 2474, 4286, -6405, 4007, -1644, -757, -13106, + 2460, -1874, -1867, -1099, -5146, 2945, 2162, -4427, + 1692, 763, 1756, -821, 66, -348, 2001, 702, + 1046, -1365, -570, 1073, 32655, -9, 450, -761, + 908, -200, -572, -1306, 2589, 2406, 1926, 1772, + 11042, -1989, 3914, -1192, 1817, -11710, 2985, -2942, + 15684, 1919, -667, -1267, 5212, 444, 864, -3844, + 438, -2382, 974, 983, -887, -822, 185, 245, + -3192, 1030, 1441, -28152, -2616, -380, 300, 1990, + -94, -999, 285, 553, 2107, 960, -859, 1001, + -1632, 2208, -1302, 1331, -3956, 10593, -1931, -4486, + 9376, -6587, -463, -3605, 2460, 1306, 2, 1987, + 1643, -552, 1327, 1124, -581, 1347, 650, -29514, + 278, 1062, 1459, 951, 2416, 396, -594, 930, + 434, 3308, -2816, 5466, 4831, -2869, -68, -894, + 58, -13036, 210, -1940, -2524, 1139, 2044, -32, + 969, 2187, 516, 581, 8185, 2080, 176, -708, + 1529, 1132, -675, -1384, -10949, 1174, -5245, 580, + 7490, 3258, 4314, 2706, -13676, -1735, 1937, 577, + -108, 2676, 612, -966, -966, 3255, 1401, 1443, + -1850, -252, 9270, 5037, -1492, -1957, -2134, 1198, + 3470, 10482, -468, -671, -1655, -955, 3248, 3360, + 448, -1854, -25145, -2771, -3318, 561, -672, 1791, + 2194, -598, 1673, -420, 547, 122, -160, -172, + 1686, -397, 1187, 11, -879, -58, 323, 180, + -2588, -2139, -1794, -2924, 999, -26969, -1280, -1401, + -770, 6159, -4449, -4174, 5270, -4813, 4139, -2023, + 2694, 2884, 3418, -5948, 3118, -1176, 4691, 8566, +-32768, -681, -553, -216, -216, -931, -507, 579, + -932, -740, 349, 81, 2120, -1222, 564, -1576, + 1241, 159, 2579, 3236, 19205, -744, -1727, -1803, + 1247, -575, -261, 261, 540, -255, -60, -1428, +-14184, -5194, 863, 997, 1043, -828, 466, -12553, + 2106, 56, -566, 1142, 401, 1360, 2322, 629, + 937, 2954, -10086, -12, 2554, -5760, 523, -15184, + 636, 156, 165, -2638, 1134, 658, 4398, -1385, + -1924, 1179, 3222, -908, -1153, 18082, 1011, 1948, + -1007, 352, -172, -6446, -22, -228, -264, 73, + 76, 2229, -1349, 6103, -11588, 576, 3374, -1616, + 7904, 3146, 984, 1056, -1626, 3113, -3674, 203, + -452, -938, 2074, 2409, -1228, -8186, -2766, 11098, + 1598, -8658, -735, 556, 1610, -7419, -5267, 1158, + 2841, 4497, 7551, -2066, 1105, 761, 2549, -1764, + 2870, 3889, -1478, 1912, 2504, -1417, 963, -14602, + 579, 28, -2953, 1589, 3962, -1372, -3304, 566, + 2687, 9700, -2464, -13110, 3005, -772, -3775, -138, + -4244, 5031, 2523, -2883, 582, -446, -274, 3311, + -157, -784, -948, -292, 3085, -781, 954, -2133, + -6693, 13909, -2236, 416, -2589, -3194, 668, -1988, + -2234, 2365, 1034, 1201, -100, 1688, 372, 156, + -254, 931, 576, -4680, 566, -1823, 294, 1645, + 27678, -1353, -1230, 1744, 570, 1679, 608, -35, + -7150, -4383, -11992, -2910, -2096, 512, 1838, 3129, + -410, -2306, -551, -3904, 4140, -12782, -1743, -106, + -4190, -5554, 12975, -573, -3532, -4050, 15, 1307, + 62, 1643, -1988, 5774, 2064, 4734, 1009, 2038, + -2794, -2704, 2275, -279, -1588, -910, 31315, 1249, + -1642, 78, 164, -260, -878, 698, 1189, 159, + -6137, -1994, 775, 3484, 1635, 1121, 4391, -5883, +-11300, 3722, -422, -2180, -3206, -3181, -1490, 291, + 1326, 399, 1952, -8405, 2240, 175, 3541, 4258, + 1518, -781, 1105, 498, -348, 771, 15918, 120, + 379, -2036, -3723, 10948, -1827, 3220, 40, 210, + -294, -813, -2349, -707, 967, 953, 2625, -13614, + -1519, 9454, 11606, -903, 817, 6237, -8878, -160, + -1768, 444, -2812, -1697, -1010, -964, 1846, 2997, + 2633, -1924, 501, -1464, 2402, -986, -1143, 527, + 1187, -929, 20923, -563, 785, -486, -940, 1625, + -796, -697, 348, -428, 1451, 1087, -2252, -2481, + 939, 890, -2508, -1357, -1868, 1395, -6386, -21986, + 2574, -384, -324, 7752, 2996, -641, -7903, -5745, + -4226, -4178, -4394, 9307, 3906, -227, -496, 4556, + 1099, -838, -2546, 1190, 9937, 11057, 3846, -156, + 433, -2873, -1769, 36, 3188, 4490, 4369, 4714, + -4681, -2804, -1525, -947, -5064, -4180, -1348, -1404, + -1097, -3922, -1088, -444, -13636, -1547, 1685, -1625, + -8494, 2492, -72, 9893, 2470, 705, 105, 5609, + -5403, 846, 90, -688, 1184, 6286, -253, -1610, + 3348, -2082, 8838, -2453, -1315, -1235, -719, -4607, + -2138, -5522, -10466, 1900, 1541, -2688, 729, 368, + -8845, 1282, 438, -2532, -2328, 4833, -6145, 4037, + 3584, 7965, -1495, 6999, -5037, -1364, 7095, 4253, + 2711, -8336, 3946, -1347, 192, -820, -328, -1152, + 1554, 869, 5053, 9707, -5888, -4294, -3858, -3344, + 8344, -644, 1750, -1796, -149, -3706, -14823, 656, + -1487, -2466, 640, -2286, -2902, 2906, 44, 211, + -336, 29976, -298, 2092, -688, 1857, 1807, -1705, + 3211, 425, -1046, 128, 1191, -1966, -726, -3040, + -3632, 1212, 2986, 5266, 1086, 3624, 3068, 422, + 989, 24479, 3791, -2229, -3713, -2379, -1370, -1799, + 2742, -3259, -4973, -626, 2287, 5655, 663, -918, + 13266, 7762, -1131, 2490, -3123, 2869, -846, -2828, + 119, 14540, 4588, -2784, -3713, -2547, 3698, 3189, + 3372, -5436, 856, 4382, 4124, 3406, -336, -911, + -137, 4268, -4436, 1566, 1169, -3020, 13980, -162, + -7226, -2550, -946, -2408, -1056, -587, -273, -932, + -219, -8021, -1086, -2587, 3852, 1235, -22, 222, + -1100, -1594, 137, -1985, 10225, 4998, -348, -450, + 6651, -2217, -7705, 2508, 10061, -4512, -2262, 6156, + 2962, 150, -2456, 1089, -927, -609, -3130, -1682, + -1215, -9251, -130, -3776, -309, -13872, -276, -6922, + -82, 2660, -1255, -6562, 2640, 2646, 422, -84, + -6020, -11551, -1710, -3462, -2666, 12510, 3145, -218, + 2956, 447, 30, 2268, -2410, -1400, 660, 431, + 3068, 258, -2862, 3919, 2693, -744, 3070, -2179, + -1192, -932, -2095, -279, 2045, -8205, 15263, -4415, + 2116, 4047, 10308, 3110, 1368, -1547, 10919, 988, + -81, -907, -1728, -1052, -3539, -4769, -2576, -1038, + 9255, 152, 431, 2455, -1544, 1880, -312, 2724, +-13336, -4197, -1199, 709, -695, -1687, 442, -2564, + -1626, -1888, 1870, 3539, -2922, -3506, -7890, -5486, + -1640, 2178, 2173, -3200, -4626, 1116, 13161, -5221, + -852, -1047, -3328, -3975, -4441, 2870, -1458, 5664, + -28, 3853, 1809, 2721, 658, -15262, 3611, 3223, + 595, 44, -5327, -2486, -1806, 606, -2474, -1236, + 983, 1741, -8390, 1948, 1875, -1806, -6294, -814, + -747, 2209, -1332, 2058, -1326, 5808, 1113, -10765, + -584, 4038, 1412, -3356, 24, -12826, -4322, -2287, +-10793, 3008, -6903, -1273, 1590, -608, -514, -309, + -144, -2024, 1822, 4375, 1122, -631, -76, -595, + 192, -11323, 8168, 10180, -646, 2478, 4516, 1095, + 94, 6, 1251, -658, 2620, 626, 3078, 727, + 7769, 966, -3593, -6990, -2358, 1022, 1288, 2733, + -259, -291, 2482, 297, -1268, 10338, 739, -1862 +}, + +.cb1616s1 = { +-12873, -2429, 6659, 4401, -2250, 1684, 1508, 1780, + -1081, -10, -6012, 895, -2373, -1263, 125, 1448, + 4744, 1556, -7267, 2354, -11368, 1155, -7699, -1424, + -914, -591, 2472, 538, 1431, 953, 5, -3066, + -1063, 3, 406, 979, 922, -668, 1633, 2, + 649, -139, 964, 860, -18807, 1944, 2183, -1358, + 1395, -1167, 5369, -3525, 735, -2698, 10556, -1137, + -3979, 1383, -1997, 5995, 6465, 2310, 1781, -311, + 3376, 7199, -2745, -1656, -5702, 3180, 3017, -5673, + -712, -8902, 2058, -570, 170, 2276, 3869, -9332, + -7965, 1130, 2111, 5638, -1507, 2944, 1574, -919, + -1459, -970, 11093, 544, -2952, -146, -4684, -303, + -528, -1199, -890, -2720, -1665, -10952, 373, 1657, + 1960, -1386, 299, -4356, -4527, 8948, 7378, 1580, + 1301, -6057, 7650, -7399, 4646, -1768, 2756, -263, + -286, -334, 1369, -786, -3760, 824, -13524, -5099, + -1693, -347, -1821, 1992, 3462, 1421, 4900, -462, +-13331, -1617, -2350, 4083, -8721, -5880, 4900, 2912, + 235, 10369, -1340, 776, -2598, 14344, -3805, -568, + -3788, 3591, -394, -1077, 3908, 6080, 1953, -1454, + -1013, 507, 10097, 3396, -4662, -763, 2506, 1486, + 3088, 580, -86, 1117, 1606, -3454, -10782, 4870, + 6170, 4020, -5675, 6848, 439, -8765, 3877, 6250, + 734, 3245, -874, -4312, -879, -4368, -1287, 3212, + -2130, -1435, 1619, -280, -3082, -1070, -18921, 940, + -2428, -1548, -1142, -271, 193, -240, -890, 918, + -4350, -5042, -8994, 5060, -6495, 3455, -259, 892, + -1290, 1348, -1049, -12681, -49, 18286, 75, 791, + 1830, -4116, 10240, -12, -459, 2477, -2582, -3344, + -1598, 982, -324, -48, -4229, -8476, 11120, 100, + -6238, 1164, 2369, -2052, 247, 626, 2213, 2279, + -2627, 289, -471, -1136, -1818, 15413, 579, 1034, + -6835, -8645, -12667, 758, -932, -4398, 565, 458, + -2024, -4050, -3100, 1897, 1324, 3191, 1876, 7660, + 385, -1066, -1539, -1317, -2632, 766, 63, 389, + -189, 1136, -653, 802, 755, 70, -29812, 640, +-11953, 10901, 2078, -529, 10373, 2509, -2776, -104, + -2232, 174, -837, 158, 1507, 1963, -273, 1534, + 1084, 8469, 2568, 12662, -2276, 2808, 2052, -7430, + 434, 3777, 991, 664, 2724, 1631, -3632, 2099, + -582, 4140, 757, 11248, 540, -1425, -10204, 1604, + 600, -2034, -1060, 977, 1843, 3831, -933, -816, + 2975, -6413, 1589, -915, -696, 2155, -556, -17893, + 3348, -1239, 1014, -2539, 1588, -320, 2402, -1485, + -8062, -1046, -1458, 200, 1323, 357, -3752, 2836, + 5774, -11638, -913, -648, 1676, 246, -1277, -1065, + 2334, 14911, 228, 880, -2172, 3072, -2520, 1445, + 1442, 2568, -1254, 730, -1950, -192, 12003, -1587, + 2558, 714, 33, 4324, -4642, -231, -279, -255, + 17824, 1292, 3530, -766, -64, 245, 1677, 1716, + 2507, -3594, -3532, 3000, 1996, -5342, -1868, -5642, + -21, 1132, -1202, 1104, -6543, 1242, 457, -1711, +-32768, 49, -458, 295, 858, 2043, 1268, -1257, + -346, 793, 554, 1260, -1082, 985, -1453, 1704, + 2431, -2858, 1466, -5424, -8870, 4714, -1539, 5767, + 110, -2568, -1482, -348, -11580, -2838, 1213, -599, + -1591, -3472, -6907, 6191, 3928, 4708, 1326, -1510, + 6322, 3849, -4112, 7689, 5976, -3298, 372, -5450, + -2208, 6564, -6915, 911, 4216, 1682, -739, -2146, + 203, 350, -816, 351, -3386, -3016, -15045, -10824, + -553, -4969, 138, 256, 1672, -1840, 2851, 15838, + 2934, 1871, -600, -3293, -845, -2696, 1463, -1075, + 720, -1177, -1538, 2415, 7315, -484, 1082, 962, + 766, -845, -10687, -5932, -4410, 3840, 362, 194, + -4576, 10209, -3548, -127, -1202, 246, -734, 770, + 311, -3126, 772, -2422, -1141, -12330, 960, 1567, + 2816, 80, -4414, -778, 665, 2308, -420, -180, + -1242, -423, 12138, 113, -1477, 2899, 214, 348, + -927, -764, 26, -1127, -2288, -32768, 1302, 394, + 646, -453, -946, -838, 1649, -2292, 1182, -1558, + -6413, -265, -1942, -3467, 1863, -3526, 3446, -863, + 886, 202, -202, 15706, 2226, 1763, 894, 936, + 16191, -693, 1682, 6678, 1742, 1365, 700, -1765, + -803, 299, -2194, 1259, 689, 1670, -635, 28, + 11890, -14, -878, -5439, 103, 11124, 528, 1179, + -62, 868, -664, 749, -1128, 1429, -485, 1920, + -866, 1176, 1051, 379, -29470, 2354, -252, -1648, + -412, -804, 1339, -383, -812, 959, 893, -1741, + 1462, -1868, 470, 2112, -1889, -2236, -1668, -755, + -2562, 1354, 6183, -10964, 5651, -1062, 2550, -6225, + -194, 1687, -782, 1568, -85, 10, -8, 1128, + -521, -1090, -1933, -3441, -2698, 3049, -5822, 20847, + 710, 789, -1872, 1082, -1242, 4152, 1624, 10795, + -2149, -134, 1087, 900, -7943, 5178, -3429, -11622, + -3617, -7444, -824, 3462, -579, -830, 1010, -3301, + 12202, -5446, -1763, 340, -744, -509, 554, 1140, + 12266, -1328, 4652, 992, -1931, -708, 1074, 2762, + 2931, -414, -217, 10166, -4167, -903, 660, 1000, + 27, -1037, -1532, 1308, 8655, 9087, -2998, 9928, + -3722, -556, 4812, 3062, 600, 1281, 3879, 114, + -5404, 1869, 2174, 2083, -11631, -301, -3609, 2443, + 2300, 4863, -838, -29, 2166, 1319, 2110, 1387, + -741, -1225, -1729, -13536, -7376, -1520, 619, -4919, + 2517, -4338, -1650, 475, 456, 4372, 792, 3224, + 1963, -547, -2071, 2142, -254, 1549, -6846, 2430, + -96, 19844, 595, 1197, -1367, 2019, 2014, -1547, + -3775, -1186, -9690, -394, -4106, -1728, -1036, 2945, + 509, 14242, -1893, -2494, -3004, 458, -1753, 2628, + 9790, 3450, -1652, -322, 8263, 3952, -2156, -2110, + -442, 1256, 1561, -4913, -3452, 74, 3051, 8907, + -3376, -96, 16654, 557, 520, -446, -2520, -1712, + 2151, -2423, 3761, -3507, 487, 2103, 777, -416, + 509, 468, 3629, -3155, 11460, 2106, -2191, -1014, + 1154, 9317, 704, -282, 3098, 2722, 84, 150, + -5922, 3063, 8373, -11896, -1157, -2286, -1781, 7331, + 1331, -334, -974, -1653, 752, -1970, -89, -3470, + 2418, -1334, 3615, 12770, -116, 1965, -1643, 1480, + -2225, -10686, -1174, 530, -972, -933, 719, 722, + 1530, -317, 105, -14155, 2569, 4506, -8502, -681, + -1544, -542, -2814, -1161, -629, -1776, -3540, -1366, + -3681, 1838, -1630, -703, 12613, -12335, -2020, 2173, + 27, 315, 4766, 4590, -1603, -68, 1154, -2940, + 1198, 7884, 2502, -586, 440, -5124, -2454, -2597, + -826, 7401, 2803, 4552, -3212, 2966, -5567, 588, + 2216, 7444, -2633, -5922, 434, 3423, 4084, 2296, + 13258, 2070, -4624, -1226, 166, -367, -527, 1110, + -1407, -150, 140, 584, -373, -2649, 862, 500, + 3292, -3506, -679, -20109, 1775, -726, 3378, 754, + -1962, -5764, -1338, -3628, -691, 4554, -1890, -6021, + -6566, 2590, 262, 2509, 257, -4386, -2480, 6352, + -2026, 1234, -399, 22808, -2221, -626, -714, -339, + -1196, -455, -80, 713, 1662, 474, -2324, -527, + 4101, -10526, -4617, 10492, -1143, 805, 1360, 3796, + 942, 684, 2596, 1313, 1589, -570, 5476, -27, + 9220, -1493, 2631, -6726, -2976, -14295, 137, -734, + -2015, 658, 323, 83, 2539, -1230, 1714, -2080, + 658, -18803, 2978, 996, -3374, -28, -1335, 150, + 2154, 1069, -852, 293, 535, -1004, -993, -3692 +}, + +.cb1616m0 = { +-16476, -11442, -305, -196, -767, -2167, -1, 378, + -2200, 22, 2405, 944, -1786, -806, 669, 952, + 10435, -2752, -1625, 1060, -12314, 1283, 234, -2405, + 627, 798, -1058, 311, -2794, -2715, 73, -214, + 813, -2749, 10732, -445, -12147, -2507, -1972, 1652, + -1920, 215, 298, 1106, 826, -7445, 69, -1679, + -675, 1249, 1444, -1109, -48, -1452, -2368, 3034, + -492, 13068, 311, -3446, 326, -1426, 2384, -2146, + 2916, 8957, -196, 2212, 447, 1775, 2607, -11962, + -278, 4335, -1743, 135, 212, -41, -92, 164, + -11, -504, 828, -519, -834, 251, 1919, 762, + 24917, -180, -132, -330, 138, 225, 1038, 3, + 32138, -388, 208, -638, -1338, -165, 200, -230, + 225, -777, -2270, 8198, 583, 3946, -1534, 1666, + -1032, 11384, 202, 30, 2758, -505, -2815, 1265, + 64, -17, -360, 636, 134, 502, 259, 872, +-28148, -1046, -348, -86, -739, 55, 448, 168, + -656, 1094, -1074, 4552, -834, 2296, 2356, -572, + -1917, 10979, 3127, -52, -9969, -527, 1994, -1626, + 1041, 3310, -2319, 2232, -11444, -2400, -1788, -1254, + 5265, 3198, 7088, 4522, 1292, -191, -15886, 2787, + 22, -1610, 184, 380, 521, 336, -158, 877, + 468, 6515, -756, -5484, 100, -464, 9244, -2726, + -1644, -2741, -5362, -1635, 894, -1849, 10118, -3264, + -4472, 1255, -3571, -437, -1050, 1505, -11178, -193, +-11513, -24, 719, 212, -1999, -725, 502, -1164, + -1060, -618, -91, -738, 740, -2254, -4635, 2700, + 95, -853, 1093, -11620, -968, 9492, -25, -664, + 367, 1105, 5501, -112, 7516, 10286, 821, -484, + 204, 1425, -3491, -1234, -4240, 3807, 2877, 1824, + 423, 466, -428, -845, -86, 13276, 8436, -690, + -688, 574, -2874, -552, 4540, 926, -5443, 629, + -395, 2090, -17468, 335, 2419, 1275, -3750, -1589, + 470, -1735, 330, 2532, 1094, -6218, -884, -236, + -9678, -9945, -447, 542, -728, -1922, 108, -2193, + -946, 3270, 2121, 2624, 1010, -10742, -102, 2813, +-13070, 1523, -1532, -1291, 420, -1999, 262, -1194, + -4226, -1450, -275, 83, 1168, 1590, -1517, -426, + -1424, 152, 676, 11463, 824, -2092, -1106, -11502, + -2327, -278, 2597, -11, 793, -118, 393, 580, + -499, -743, -77, -427, -408, -692, -29195, -247, + -2014, -922, 97, 581, 5469, -1419, -698, 1490, + -3814, -2818, -13816, 680, 3595, 1544, 2366, -3018, + 2479, 323, 346, -260, 337, 2730, 12214, -1118, +-11301, -3028, 212, -41, 1764, -580, 553, 5454, + -8, -366, -1202, 901, -796, -8350, 4380, -1452, + -300, 1152, 3058, -3476, -27, 13046, 34, -11438, + -1321, -1528, 13237, 114, 2514, 976, -571, -1192, + -2050, -1635, -964, 416, -23, -1083, -9, 32767, + -548, 556, -1217, -56, 325, 1048, -145, 202, + 1520, 44, 402, 400, -611, 8667, -1083, 1068, + 1224, -12031, 2318, -1109, 1266, 1306, 4673, 285, + -5603, 1555, -100, -1059, 403, -213, -680, -904, + 11443, 581, 12160, -638, 309, -65, 933, -2280, + 1958, 2642, 1808, 7945, -2088, 850, -428, 785, + -989, 1234, -1413, 745, -10756, 1943, -184, 3252, + -96, 932, -664, 13222, 11326, -1374, -327, 1901, + 1069, -1540, 104, -139, -904, 106, 1664, 925, + 46, 353, -835, -554, 1618, -956, -437, -727, + -3403, 1038, 968, 436, 46, -4385, 340, -16903, + -498, 47, -554, -399, -2418, -347, 358, 23280, + 234, -172, -338, 1058, -2172, -1, 1710, -64, + -583, -2224, -780, -637, 3500, 108, 1045, 828, + -728, 9466, -2487, -12773, 1924, -1158, 208, 49, + 136, 12055, 42, -1381, -375, -11534, -249, 1602, + 996, 204, -710, 4761, -511, -15761, 166, -1184, + -192, 50, -105, 890, -9566, 2062, -1536, 133, + -185, -643, -172, -894, -355, -16, -1395, 542, + 2160, -481, -1104, -793, 517, -20454, 698, -181, + -135, -434, 1677, -181, -415, -738, -1574, 1664, +-14058, 597, -12354, -460, -313, 1724, -686, 85, + -1162, -648, 865, 165, -225, -1947, 2818, -778, + -4010, 402, 686, 11170, -332, 10336, -757, 4794, + 2204, -477, -292, -366, 8412, -2476, 494, 510, + 10514, 769, 642, -441, 1079, 6954, 4246, -2272, + -290, -224, 1312, 398, 1536, -692, 330, 157, + -946, -100, -1830, 214, -25652, 1382, -1836, -440, + 110, -506, -438, -2370, 126, 562, -3515, 1014, + 8526, -1641, -2493, 4411, -9210, 2110, 625, 114, + 323, 2450, 2407, 682, 1999, -9424, 2480, 69, + -2091, -11845, -3684, -429, -1622, -919, -518, 70, + 1450, -3523, 5126, 5706, -1451, 2633, 820, -204, + 11338, -8014, 753, -103, 290, -923, 1408, 298, + -1962, -887, 9691, -1366, -11048, -55, -223, -1040, + -163, 132, 676, -760, 4990, -310, -9286, -2427, + 14442, -418, -802, -359, -323, 2877, -210, -1436, + 1574, -1206, 265, -155, -225, -32768, 347, 222, + -1165, 200, 924, 1135, -843, -66, -343, -334, + -113, 209, 14, -203, 1214, -896, 910, -1496, + 1831, -7833, -841, -10453, 1605, -8514, -477, -48, + -241, -58, -32768, 213, 108, 450, 1155, -30, + 89, 240, -768, 1332, 290, -1377, 951, 586, + -8939, 1298, 496, 705, -1661, 1798, -1906, -2233, + -1716, -986, -2204, -1149, 2686, 8578, 32767, 645, + -661, -135, 770, -432, -550, -385, -272, 625, + 1234, -729, 19, 1753, -284, -106, -655, 750, + -442, 23143, -328, -520, -506, 790, -1048, -730, + -471, -438, 483, -374, 939, -226, -397, -849, +-12054, -772, -40, -11776, 232, -540, -2497, -679, + 337, 1357, 458, -341, -7542, 1001, 492, -416, + -1496, -8966, 9814, -1752, -674, 2526, -544, -2900, + -1318, -1578, -238, 75, 11181, 1750, -3182, 564, + -570, 528, 1004, 146, 1144, 7430, 158, 9524, + -36, -340, -441, 596, -1659, 1420, -686, -36, + -596, 2215, -1295, -19722, -2149, -1046, -2339, -1166, + 3057, -370, -556, -33, -322, 260, -23, -106, + -323, 147, -57, 179, 458, 684, -1283, 1251, + 1231, -18548, -513, -480, -695, 593, 3072, 1960, + 322, -702, -1043, -544, 6005, 1378, 100, -225, + -848, -1294, -3346, 828, -2610, -3010, 9623, -1329, + 1956, -1098, -3730, 1137, 12413, -1260, 2457, -10844, + 6824, -4289, -653, -302, -4415, 650, -1684, 6129, + -370, -652, -3245, -473, -150, -3018, 1864, -1258, + 928, -2379, 14451, -119, 2282, -248, 3139, 6502, + 4318, 2214, -1627, 126, -422, 326, -622, -302, + 32252, -268, 456, -260, -260, -968, 391, -497, + 152, 1764, -10580, -369, 277, 70, -13137, -1114, + -1111, 464, 2266, -2968, 728, -1216, 1726, 1044, + 344, -16436, 1558, 3178, -551, 604, 442, -891, + 9570, 1596, -541, -2182, 730, -906, 242, 935 +}, + +.cb1616m1 = { + -116, -53, -24868, -544, -783, 97, -912, -1202, + -622, -147, -215, -362, -16, -522, -1694, -358, + -724, 2628, 439, -18106, -1566, 3048, 4133, -1238, + -3233, -1130, -2884, -2762, 1031, -1037, 63, -2219, + 10701, -1518, -10322, 1425, 792, -1820, 380, -777, + -3017, 1531, -1052, -3491, 1085, -428, -765, -113, + 42, -265, 365, 99, -859, 35, 610, 44, + -495, 262, 1689, 2082, 21605, 412, -717, -1163, + -3285, -5062, -1583, 599, -277, -62, 615, 6014, + -1781, 465, -544, -14114, 11277, -20, 696, 663, + 1156, -240, 631, -2802, 333, -2544, -1628, 775, + -960, -553, 496, -378, 526, -421, -426, 290, + 555, 403, 390, -31714, 25, 449, 654, -334, + -1317, 165, 496, 1554, -88, -777, 626, -1511, + -9020, -1725, 12705, -798, -1240, 195, 1932, -833, + -939, 43, 182, 2547, 4879, 9234, 370, 2058, + -7757, 544, 1106, -660, 546, 9983, 225, 124, + 952, -2153, -1732, 2760, -1270, -176, 3334, -6735, + -526, 10475, -627, 7835, -2263, 475, 731, 908, + 8264, 1605, -192, 5026, 2414, 5223, 595, 1093, + 2345, -796, 8663, 1028, 8188, -185, -1506, -3044, + -100, -1818, -6369, -170, 1728, -9249, 886, -2111, + -349, -1146, 2127, 11622, -8043, 2880, 2215, 1693, + -2303, 1698, 1121, -3575, -927, -716, 1940, 2514, +-11672, 1619, 916, -7, -585, 508, -1316, -972, + 778, 9774, -2126, 2368, -56, 6716, 1169, -3656, + -1330, 9530, -12158, 1188, -11426, -353, 945, -1941, + 1750, 962, -1133, 1793, 2318, -2641, 1109, 933, + 804, 505, 60, -1642, -2238, -2328, -1558, -1568, + -27, 952, 4, 1376, -862, -18404, -1828, 4107, + -454, 52, -1202, 1150, 686, -1950, -497, -10883, + 400, -422, 1734, -54, 11165, -3309, 6402, -877, +-19967, -400, 1642, 1305, -2432, -3115, 375, 3898, + 1812, -5305, -946, 1717, -757, 3322, 126, 747, + 1836, 9957, 1904, 658, 13043, -1779, 675, 716, + -453, 670, -1572, 210, -1533, -133, 294, 546, +-24084, -1036, -485, -117, -184, -624, 273, -901, + 866, 609, -1119, 28, 250, 13, 70, 1178, + 882, -632, -21624, -1339, 926, -1814, -1279, 1868, + -181, 383, -679, -1070, 5091, 1148, 1034, 2144, + -2779, -3810, 4536, 1713, 1003, 13322, 2866, -3217, + 2508, 4395, 480, 14, 167, 763, -34, 1034, + -1342, -1349, -100, -225, 464, -914, -1403, -1851, + 23767, 770, -457, -257, -1072, 1201, 583, -59, + 2627, 1469, -7, -11642, 3352, -1003, -6, 11588, + -311, -2435, -2180, -2352, 1952, 5532, 1945, 7281, + 504, 11882, -603, 45, 42, -1396, -1115, -1041, + -1061, 566, -2733, -765, 687, 118, -1174, -20412, + -244, -986, -151, 2888, 1102, -1303, -135, 529, + 1186, 13220, -183, 906, -4209, -4455, 2247, 246, + -6474, 2794, 1450, -6495, -1819, 598, -438, 244, + -1064, -673, -672, -1563, 543, -2278, -3087, -811, + 1866, 80, -18987, -682, 569, -551, 514, 6876, + 7582, 839, -4031, 823, 2342, -1300, 1180, 702, +-10168, -1957, 485, -374, -151, -11066, -461, -12824, + -1221, 1281, -718, 2012, 330, -289, -487, -207, + -722, 394, 156, -2023, -11006, -373, -4, -238, + 10581, 991, -1236, -814, 553, 1295, -2269, 2783, + -1973, 681, 9759, 3674, -1680, -12118, -1340, -2372, + -288, 2143, -328, 809, 312, 2038, 736, -10, + 908, -11319, 74, 6362, -1122, 1546, -184, 1630, + -1851, -2143, 1048, 8858, -462, -6458, -1540, 811, + 130, -3542, -10424, 9353, 388, 1168, -1797, 1796, + -4151, -2329, 1, -272, 846, -642, 248, -1144, + -9863, -1684, -190, 7611, -4147, -692, 5354, -2363, + 609, -4926, 3166, 2094, 857, -369, 118, 725, + -899, -601, -6, 556, -32540, 950, -478, 757, + 136, -560, -754, 562, -448, 223, -704, 616, + 365, 22610, 1191, -1264, -94, 927, -294, -1270, + -16, -2520, -2026, 420, -6621, -504, 9666, 452, + -379, -1888, 536, 1161, -3021, 609, -4890, -231, + 3926, -943, 32767, -615, 300, 870, -742, 429, + -42, 155, 1060, -900, -347, 34, 491, -3625, + -1529, 10175, 178, -7938, -406, 1628, -362, -7340, + -433, 489, 568, 674, 536, -2886, -6118, -16, + -531, 182, 1498, -4194, -306, 63, -1429, 1109, + 631, -10386, -16, -5938, -52, 10638, -793, 35, + -874, 1633, -252, 709, -286, -780, 17172, -32, + 912, 137, -1684, 2781, -5637, 338, 10961, 1401, + 176, 1890, 563, -371, 578, -235, -882, -616, + -591, -672, -821, 12194, 917, 778, -427, 358, + -1411, 2032, -1372, 1891, -1784, 1830, -1808, -464, + 13973, 2016, 8606, -914, -7329, -1853, -2627, 2219, + 2628, 2161, 2185, 2414, 8857, -273, 1016, 2253, + 1070, 907, 367, -430, 574, 1039, 93, 170, + 255, -267, 550, -668, 287, 1827, 19833, 244, + -3731, 4, 21365, -127, 356, 643, 2016, 3290, + 1242, 46, -734, -2298, -316, -6618, -296, -1465, + 657, -1451, 469, 212, 2823, -2803, -11862, 931, + 44, 660, 1576, 1848, -10529, 2813, -1163, -260, + -195, 16320, -3447, -262, -76, -439, -3487, 1292, + 3330, -616, 1477, 1900, 8843, 81, -846, 6845, + -95, -112, -231, 129, 6982, 165, -3115, 2456, + 2032, 12201, 2747, 1691, -728, -1935, -239, 968, + 15578, -2260, -1813, 440, 2188, -3845, 1278, -136, + -1388, -7850, -462, 2921, -1740, -136, 164, 103, + -206, 32767, -459, 1249, 736, -590, -797, 628, + 612, 327, 396, 552, -128, -76, -258, -557, + 429, 170, 532, -347, 169, -593, 28319, -633, + -1339, -997, -258, 324, 628, 3254, -1118, 8902, + -63, 4762, -2820, 2429, 820, -46, -5366, -2193, + -9005, -1304, -597, -10143, 555, -3000, 294, -1577, + -871, -140, 726, 3700, -2226, 903, -253, 10330, + -2946, 656, 725, -668, -920, 1653, 1312, 1623, + -1150, -11970, 2157, 4532, -340, -8648, -616, -1429, + -980, -30, 647, -474, 442, 5098, 188, -1258, + -8172, -10927, -4207, -112, 2501, -3241, -1949, 159, + -525, 1090, 420, 10418, -11897, 1072, -78, -1028, + 3367, -2647, 3421, 2021, 2358, -973, 272, 27911, + 472, -402, 1397, -927, -1032, -1274, 848, 221, + -2745, -710, -692, -409, 1922, 142, 594, 1053, +-11350, -791, 3767, 1569, 541, 11921, 134, 368, + -948, -2689, 896, -1193, 1190, 8514, 1436, 1017, + 599, -3358, 4002, 12936, -675, 1044, -1210, 296, + -1109, 1992, 1282, 774, -13102, -608, -11145, 134, + 278, 944, -888, 350, -1574, 189, -2542, 3476, + -3018, 3368, -9304, -1839, 533, -2, 1057, 686, +-11819, -1146, -973, 1594, 3526, -2890, -1528, 3489, + -475, -259, -9610, -475, -984, -3559, -742, 408, + -130, -2291, 899, 12177, -1934, -162, -3238, 1610 +}, + +.cb2220l0 = { +-12528, 350, 1782, -474, 1439, -14269, -8, -1782, + -753, -1720, 167, -440, -2706, 222, -1629, -288, + 671, -111, 10270, 878, 152, 330, -1000, 639, + -1280, 1111, -2072, 1439, -476, 553, -2974, -614, + 1666, -466, 11811, -1393, 154, 624, -697, 176, + 1108, 504, 250, 572, -6, 704, 16, 647, + -1143, -1407, -411, 23745, 319, -189, -404, -641, + -86, -707, -770, -302, 13, -398, 76, -681, + -525, 354, -1225, -757, -23170, -484, -965, -430, + 13477, 898, 505, -17, 13812, -890, 357, 662, + 1000, -935, -60, 944, 400, -432, -221, 1047, + 307, -180, 5260, 16509, 650, -269, 1563, -6002, + -3082, 186, -3334, -5770, 1010, -394, 128, -699, + 537, -27, 1014, -531, -50, -163, -1664, -1026, + 732, -1296, 21856, 574, 416, -745, -443, -1382, + 272, 791, 1308, -308, -1636, 168, -10922, 119, + -1190, 1123, 1492, 1706, 1076, -2016, 3270, -994, + 876, -2316, -2992, 12625, -412, -159, 5249, 1424, + -304, 557, -431, -360, -340, -561, -292, 1748, + -224, 1789, -352, 386, 136, 76, 1309, -270, +-24204, -515, 1142, 2119, 1144, -173, 1008, -693, + -430, -1052, 1890, -12483, -11416, 2918, 1591, -1202, + -1782, -1335, 1354, 1703, -510, 4287, -854, 1153, + 2018, -518, -960, 11825, 1295, -563, 11252, 190, + 4078, 222, -3115, 3306, 747, 2638, 1015, -1674, + 8032, -2386, 573, -349, -832, 96, 9564, 11708, + -483, 1326, 1804, -2903, -2024, -234, 1009, 3229, + -232, 803, 275, 444, -629, -192, 381, -1289, + -109, -29019, 270, -420, -408, -466, 113, -537, + -266, 296, 180, 506, 1015, -565, -517, 1494, +-11053, 3968, -1735, 3474, -1991, -8326, 8075, 1740, + -3995, -1287, -2558, 1030, 3742, -618, -2600, -1783, + 2696, 1480, 1054, 341, 3762, 4225, -1742, -11582, + 4348, -8756, 493, -404, 3840, -1049, -683, -962, + 163, 10997, -97, -848, -4632, 2794, 2684, 2540, + 739, 8534, 3688, -878, 3138, 2576, 6444, 3674, + -2371, -218, 2864, 12270, 2866, 189, 4549, 4894, + -6378, -1050, -3166, -5897, 2245, 2803, -70, -1909, + 2783, 3951, 153, 11221, -658, 12780, -238, 3418, + -2235, 754, 311, -739, -2414, 702, 1076, 303, + -320, 47, -3288, -234, -1376, 3022, -103, -1780, + 716, 11886, 10942, -5402, -5431, 1196, -624, -885, + -652, -3248, 74, -435, -686, 154, 8675, 3325, + -1779, -341, 564, -901, 1335, -639, 3494, -1820, + 290, -92, -3088, 4775, -2140, 2334, 710, 10536, +-15042, 14823, -1082, -1045, 1008, 734, 241, -1048, + -933, 245, 913, 114, 322, -1798, 246, 1067, + 348, 408, -183, -728, -12915, 685, 1525, 1694, + 183, -168, 12703, -1268, 1613, -2072, 1546, 743, + 2356, 2135, -550, -153, 1327, 2, 12487, -3111, + 2347, -1722, -300, -193, 2222, -1928, -658, -384, + -5738, -1141, 3634, 10312, -69, -1549, 10879, 1795, + -361, -1838, 143, 1202, 327, -15549, -1268, -194, + 3284, -12, -344, -2042, 1663, 334, -798, -873, + 1736, -324, 195, -417, -382, -22936, 812, -478, + -962, -451, 730, 382, -135, 1311, -290, 122, + 148, -775, -305, -32218, -84, 98, 374, 369, + -44, 923, -432, 156, -1471, 236, -39, 143, + -146, 835, 135, 229, -297, 1690, 6786, -12169, + 815, -176, 1868, -9, -3052, 108, 114, 260, + 11337, -2689, -132, 765, -239, 54, 691, -9737, + -627, -474, 12212, 2222, -7595, -239, 1793, 2115, + 563, -2390, -1991, 2906, 675, 923, 146, -3605, + 981, -1725, 92, -562, -21192, 304, -450, -323, + -889, -726, 688, -1186, 2590, 466, 326, -734, + 308, -782, -3219, 963, 454, 1348, -513, 953, + -1414, -320, 1012, -1148, 1185, -17356, -15, 1546, + 1346, 2182, -2457, 1426, -1690, 155, 8793, 1394, + 510, 2608, -203, 2697, 608, 2612, -13542, 177, + 4642, -824, 1877, -1864, 1681, -1033, 1487, -749, + 356, -11, -1, -366, -215, 1531, -38, -922, + -378, -296, 1245, 19967, -2389, -459, -3729, -163, + 6578, 354, -1471, 195, 353, 1831, -605, -2291, + -359, 947, 8409, 3454, 12416, 2434, 3485, 40, + 350, 1640, 738, -9827, 935, -171, -944, 1407, + -399, 571, 2805, -13108, 784, 678, 2405, 328, + -417, 1188, -1596, -649, -1358, -1130, 341, 202, + -2459, 11307, -2250, -3518, -1812, 3338, -924, 10027, + 3004, 703, -184, -666, 223, -1644, -7221, 3507, + 10108, 1324, -412, -371, -92, 2496, 3182, 10, + 10269, -998, -1010, 610, 3296, -1842, 407, 406, + -1609, -181, 2202, -662, -1450, 1360, 1488, -212, + 1501, -214, -555, 168, 275, 301, -950, 3272, + -323, 20632, -21, -1729, 11013, 2149, -9278, 6735, + -593, -7374, -430, -2776, 2343, -1374, 519, -4876, + 827, -2477, -1971, 1249, -23380, -1810, 199, -761, + 2182, 1654, 447, -488, -1219, 364, -53, -382, + -989, 154, -545, -872, 776, -211, 7706, -767, + 8006, -138, 1989, -180, 306, 486, 1112, -648, + -12, 1538, -300, 2458, -5833, -1181, -7680, -6700, + -621, -308, -29995, 602, -24, 94, 752, 517, + 86, -249, 1058, 704, -404, -387, 106, -632, + -159, 1275, -197, -1263, -1210, -1689, -10488, 1950, + -2037, 5974, -3960, 38, 1284, 2851, -2813, -1613, + -1646, 10164, 138, -2956, 196, -118, -484, 860, + 124, -262, 30, -1448, 128, 287, 327, 590, + 27272, 391, -738, -1631, -481, -1511, 82, -574, + -737, -614, -447, -80, 292, -19, 252, -2, +-28117, 332, 141, 1485, -154, 1382, -1755, -422, + -1692, -2144, 910, 1004, 1894, -1537, 897, -458, + 19483, -1321, 2280, 622, 288, -2253, -1001, -976, + -408, -394, 132, -250, -428, -22, 140, 287, + -141, 30981, -293, 631, 729, -2, -231, -127, + 377, -879, -294, -107, 253, -964, 1258, 570, + 71, 9421, 8358, 9295, 8354, -546, 1153, -1807, + 1577, 2911, -1808, 1808, -1631, -1348, -6977, -382, + 1625, -2793, 10633, 1977, -1793, -12480, 1, 2010, + 23, 423, 1102, -1920, -478, 1845, 1016, 465, + 758, 800, -1540, 5448, -10472, -2749, -989, -6362, + 9283, 373, -2560, -5478, -1618, 20, -564, -1074, + 4075, -471, -515, 409, -2069, 359, -788, -11618, + 2524, 917, 2757, 243, -3261, 6922, 6268, -3148, + -2804, -3412, -4262, -1903, 1043, -12255, -162, 1598, + 496, 454, 1401, -1635, -12711, -673, 3392, 1255, + 1602, -1206, -297, -2066, 3009, 1149, 1285, -1307, + 412, 27971, 183, 569, 1304, -706, 824, -635, + -358, -340, -28, -1344, 955, 14, 676, -243, + -20, -11947, 1350, 8122, 196, -10161, 4925, -3764, + 1661, -401, 145, 253, 680, 718, -614, -613, + 498, -293, -4257, -684, -14853, -10522, 698, 1537, + -2016, 1162, -2684, -1578, 8, -238, -3214, -2749, + -1577, -1187, 113, -1457, 1068, 590, 25, -644, + 1000, 2430, -1612, 13246, -2684, -1642, -4648, 816, + -1103, -7556, 5753, -3998, -1338, -776, -1958, -9652, + -1288, -290, -4240, -2788, -8191, 1625, 2558, 1238, + -1824, -39, -3129, -8916, -3302, -5632, -1768, 866, + 708, 684, 3530, -8772, 1485, 677, -10398, 686, + -852, -6974, 5286, -2658, 612, 1180, -3367, 4285, + 5708, 1416, 166, 2787, -3697, 1431, 1648, 7942, + -544, -1064, -514, -840, -870, 1246, -3582, -9310, + -3802, 4025, -8251, 5978, 132, -619, 2792, 9786, + 1244, 242, -1948, -4701, -5904, 951, 7486, -3494, + 48, -4468, -2403, 6090, -2343, -4175, 1336, -2546, + -281, -736, -1758, -1720, 11066, -918, -1354, 3885, + -33, -4116, 1246, -218, -8082, -766, 7796, 1505, + 1559, -964, 1741, -454, -1628, -762, 3034, -804, + -888, -9682, 9603, -2556, 2874, -5456, 3066, -7747, + 956, -660, -1538, -381, -760, 1747, 547, -517, + -697, -1411, 410, -514, -3988, -219, 13358, -2393, + -280, 11230, 2640, 795, 2534, -8094, -1838, 71, + 16, -203, 4224, -96, -2829, 2010, 1961, -1312, + -1266, 3952, 6894, 6996, -8062, 4708, 1193, -3439, + 1549, 935, 170, 614, -868, 43, -246, -188, + -940, 130, 126, -736, 697, -510, -56, 1596 +}, + +.cb2220l1 = { +-13582, 1049, 15596, -101, 707, 2677, 542, -522, + -636, 194, -2361, -1252, 524, -32, 227, -419, + -652, -601, 84, -10428, -1417, 13117, -573, 3774, + -3632, 2025, -1237, -692, -1486, 192, 1221, 452, + 436, -764, -2636, -153, -685, 118, -424, -635, + -458, 209, -577, -12042, 4240, -10861, 49, -1534, + -991, -2416, -280, 2095, -1841, 1278, -94, -423, + -572, -949, 734, -1087, 12449, 6514, -4582, -7845, + -3722, 1446, 2531, -1238, -2070, 1515, -1331, 2382, + 1066, -1298, -1189, 6811, -1868, -1082, -1732, 356, + -2622, 493, -3345, 1367, 1737, 4497, -14734, -1350, + -354, -1340, 8478, -1152, 1832, 1793, 830, 974, +-13918, 522, -1472, -2502, -2625, -157, -360, -17, + -830, 673, 36, -1339, -14860, 522, -13377, 851, + 937, -1103, -44, 408, -364, -953, -392, 1837, + 2342, 1236, 111, -218, -919, 985, 10077, -1065, + 1840, -124, 3780, -11015, 204, 437, -830, 6712, + -1720, 288, -991, 1094, 5647, -1296, -2284, 1642, + 1000, -35, -115, 208, -244, -1099, -832, -2092, + 802, -163, 3343, -964, 314, 126, -1204, 754, +-17838, -826, 4414, 8331, -770, 1246, -3500, 1680, + 833, -108, 494, -910, -6314, -2832, 2553, -6230, + 1165, 3631, -1717, 2404, -32768, 520, -38, 1228, + -708, 58, 260, 771, 588, -448, 389, 156, + 606, -830, 400, -488, -188, 536, -1428, 11982, + -156, -1407, 1796, 1036, 905, 1371, -1472, 325, + 3098, -1436, 6449, 2105, -11183, 1632, -1848, 1019, + 1247, 1308, -1351, -823, 1679, -651, 978, 296, + 1088, 3965, -1414, -11838, 139, 8664, -3452, -1804, + 3088, -2044, -221, -1347, 1232, -909, -1323, -1409, + 1399, 2557, 14552, 1535, -5088, 1699, 1012, 3333, + 3940, 2294, 1189, -2256, -484, -3307, -1333, 464, + -305, -744, -24, -20464, 332, 2968, 308, -649, + 292, -402, 1226, -2575, -1505, -100, 1413, 733, + -1024, 616, -121, -322, 67, -161, -708, 251, + 462, -26697, -1112, -1381, -324, -286, 1091, 662, + 15830, 13124, -1049, -1816, -355, 1848, -801, -1710, + 2513, 458, -798, 386, -726, -356, -1240, -1133, + -388, 631, 91, 1867, 2511, -306, 3097, 14399, + -571, 2191, -2916, 2850, 761, -2442, 698, -2193, + -2739, -1914, -4077, -4631, 12702, 333, 1162, -6248, +-12466, -310, -107, -2465, -163, 1970, -998, -1253, + 2007, 79, -426, -276, 365, 568, -520, 23642, + 276, 1059, 184, 1081, 650, 2286, -191, 883, + -1946, 246, 64, -225, 800, 910, -136, 1187, + 955, -15604, 12847, -747, 874, 506, -646, 1920, + -449, -321, 1152, 1341, 1653, 341, -32, 907, + 673, 1045, 1245, -499, -10331, 4683, -1121, -3164, + 3382, 6397, -1341, -769, 1186, 229, -1354, -7370, + 155, 1858, 5617, -3487, -247, -783, 724, 508, + 14029, -528, 1853, 1572, 580, -708, 528, -1394, + 8922, 2284, 550, 3084, -1726, -3235, -700, 7132, + -3540, -200, 3288, -815, -2189, 1232, 2412, 2088, + -1101, 12592, 806, 1508, 1741, 13, 1124, -3883, + -687, -8180, -3094, -3346, 1781, 11836, -657, -3469, + 1429, -1822, -3433, 87, 3871, 651, -965, -1757, + 6778, 109, 112, -131, 710, 11943, -12107, -3460, + -726, 1002, -3803, 580, 2756, -1293, 116, 457, + 581, 3834, -1678, -977, 1242, -2040, 232, -10034, + 1644, -2290, 1368, 172, -3012, 1423, -2620, 3608, +-10831, -303, -1610, 3246, 562, 5212, 448, -877, + 954, 688, -8981, 579, 717, 1315, -952, 6817, + 662, 3218, 7213, -2116, 10446, 1012, 2270, -858, + 10, -1066, 10618, 6108, -547, 3221, -893, 3888, + -1088, -10085, -247, 1064, -3500, 3123, -2480, -2128, + 2788, -2253, -9756, -472, -166, -680, 727, 74, +-14151, -189, -1734, 610, -1169, 845, 94, -786, + 394, -581, 500, 1981, -10940, 354, 500, 399, + -1952, -373, 2197, -4712, -2582, 2751, 654, 613, + -1254, 1406, 2056, -12518, 1583, -582, 4834, -1541, + 508, -20580, 270, 1214, 515, -1082, 5, 7, + -533, -28, 1270, -1307, 497, -57, -331, 933, + 92, -856, -10458, -4576, -9991, 2426, 6552, -3022, + 279, -562, -192, 1878, -2237, 4978, -1753, 332, + -1462, -853, 238, 478, 9746, -7385, -10290, -8278, + 457, 3121, 841, 48, -3745, -1298, -637, -1820, + -468, -248, 1400, 394, -125, -950, 11524, -1860, + 426, -773, 12669, -1620, -158, 1625, 1045, 768, + -66, -12, 1625, -770, 559, 54, 593, 14468, + 14994, 490, 543, -811, 700, -277, 900, -178, + -2000, 475, 241, 950, 106, -1260, 874, -862, + 18907, -1947, -844, 205, 1253, -83, 1966, 2300, + -2694, 852, 2450, 661, -334, -518, -1136, -2377, + 325, 1152, 511, 881, -22205, 898, 574, -582, + -265, -1362, -253, -40, -780, -1967, 469, 1484, + -818, -926, 958, -415, -7934, -330, 330, 1439, + 1643, 77, 1034, -156, -12094, 3782, -5725, -520, + -598, 2345, 3506, 5333, -322, 99, -48, 1490, + 20, 11393, 3468, -1144, 7013, -3728, 7145, 1432, + 1810, 26, -912, -6530, -1079, 1771, 95, 4007, +-11346, -43, 249, -14616, -249, 1, -725, 244, + 1053, 1815, -626, 408, -344, 1972, 2222, 2288, + -2324, -411, -3993, 494, -706, -5078, -11695, -3645, + -2090, 2465, 5893, -5096, 6815, -537, 5003, 1258, + 185, -1555, -875, -2047, -170, -433, -194, -1020, + 349, -724, -31811, 197, 251, -418, -222, -618, + 278, 554, 363, 183, -898, 14, 350, 745, + -2054, -1623, 806, -770, -1246, 1594, -54, -18501, + 1516, 840, -86, 484, 514, 1209, 978, 564, + -537, 34, -431, 128, 938, -1807, 832, -90, +-29509, -642, 1397, -52, 523, -393, 216, 908, + 9, -63, 710, -949, 3, -184, 175, 613, + -687, -408, 27, -855, 18258, 1282, -948, -219, + 2374, 1668, -4567, 1063, -2045, 12026, 461, 3074, + 1050, -1788, 169, -13442, 612, 19, -2019, 685, + 452, -152, 299, 310, -2327, 348, -215, 1634, + -201, 2162, -10300, 12452, -3733, -420, 2388, 518, + -2308, -160, 1552, 3347, 1650, 3293, -1108, 2065, +-12618, 20, -42, -643, 202, -1298, 251, 2489, + 1322, 2362, 3698, -190, 592, -12484, -937, 2072, + 1531, 302, -409, -899, -1016, -388, 1103, 30006, + 789, -1609, -548, -1002, 1055, 605, -955, 1557, + 452, -623, 810, 597, -696, 10628, -1174, 606, + 2628, -553, -2297, 6668, -2600, 787, 3504, -3606, + 4087, 1052, 6276, -7619, 337, 2565, -13, 1205, + -124, 1222, -28082, -79, -553, 628, 542, 1315, + -609, 322, -895, -377, -694, 610, 239, -152, + -2901, 9890, 716, 1030, -3306, 988, -738, 562, + -2209, -1676, 4507, 1165, -12924, 866, -154, 3664, + -367, -2580, -7286, -572, 2167, 118, 508, -4429, + -480, 842, 2489, -1636, -2042, 1125, 1847, 2586, + -5639, 3361, -760, 11189, 623, -282, 1353, -279, + 515, -816, 713, 322, 417, -2820, -1114, -1563, + 401, -21604, -1300, -972, -2298, -483, 2176, -830, + 2135, -4084, 1095, 1950, -1937, 539, -374, 3197, + 682, 472, -1368, -8095, -12026, 4833, 5586, 467, + 2400, 148, 381, -138, 954, -459, -724, 970, + 156, -1955, -1363, 560, -761, -1708, -1599, -17408, + -1064, -1372, -500, 1160, 735, 441, -773, -228, + 420, -1128, 260, 930, 12879, -926, -231, 1355, + -850, 559, 11377, -1729, 2478, 961, 336, 1056, + 5081, 9788, -555, 4067, 8664, -2720, -1462, 3012, + -7280, 965, 1462, -4703, 3649, 2084, -699, -262, + 408, -188, 2193, -2216, -4509, -736, -1039, -4848, + -8243, -7958, -172, -1318, 9566, 4665, 3363, -3672, + 1581, -551, -2024, 1630, 1543, 90, -1728, -792, + -1799, 2571, 80, -412, -301, -2870, 1796, -5327, + 111, 17342, 592, -2108, 477, 1541, 1266, -1062, + -215, -2210, 223, 1215, -197, 87, -18340, -67, + 804, -398, -118, -3457, -741, -1935, -704, -274, + 566, -872, -1821, 12874, 5057, 2069, 1742, -6205, + -6115, -1614, -294, 187, -5210, 1734, -1466, -2162, + -2266, -642, -148, 440, 2, 233, -319, -637, + -734, -230, 301, 508, -433, 311, -313, -1206 +}, + +.cb2220s0 = { +-15119, 7508, 1337, 4182, -2914, -3733, 2686, -470, + 2249, -3901, 1444, 3805, 99, -1771, -354, -903, + -2755, -709, -4980, 214, -2750, -652, -1042, 1434, + -1090, -612, -2574, 1274, 1310, -760, 1420, -112, + 2776, -4843, 15060, -4929, -3942, -5721, -1628, -1142, + 3023, -1435, 1402, 1010, 623, -3527, 2624, 184, + 988, 98, 340, 16676, -1262, -1162, 3183, -4816, + -592, 1019, -1406, -2478, 2371, -1004, 3944, 803, + 5665, -2261, 16427, 349, 3113, -916, 442, -1754, + -3551, -1351, 1563, -1316, 532, 343, -392, 1509, + -717, -122, 2462, -929, -185, -683, -18780, 2682, + -123, 518, -379, -5160, 245, 1940, 13964, -12311, + 590, -30, 159, -1558, -1940, 36, -1528, -515, + -1178, 856, -395, 29, -5854, -12943, 13286, -2572, + 1049, 768, 3292, -3921, -52, -462, 1968, 4933, + 630, 930, 1026, 2606, 319, -277, 6333, -2119, + -4700, 2164, 1583, 154, 2107, -1467, 339, 634, +-17240, -595, -3525, -2690, -1788, -476, -41, 165, + -1016, -1456, -348, 11289, -2920, -3804, 2357, 12012, + 3848, 1796, 2164, -5555, 4527, -201, 965, -4893, + 3419, 6441, 1691, -77, 348, -769, 27319, -345, + -336, -541, -320, 972, 926, -1026, 1052, 702, + 224, 76, 742, 220, 6292, 8625, -3742, 4139, + -5989, -5615, -641, -231, -837, 6156, 4141, 3792, + 4746, 9972, 1800, -397, -2237, -2218, -7595, -2761, + -496, -1451, 1178, -970, -1226, 2527, -2105, 1778, + 1446, 1986, 9970, -13107, -985, -1142, -1367, -329, + -4498, 590, 36, 2073, -1069, 862, 133, 2516, + -27, 4494, -11602, -1638, 2524, 1449, 5684, -611, + -9452, -2618, 5006, 3481, -639, 379, -2333, -498, + -713, 382, 784, 269, -5692, -350, 524, -18705, + -1042, -1349, 1210, 1770, 3964, 4908, -1131, 17535, + -788, -1896, 30, -2682, 1044, 1604, -3740, 18, + 1771, 331, 4279, 2634, -368, -447, -6995, -1224, + -688, -5368, -236, -8872, 2449, -12189, 4465, 1895, + 2484, 1315, -5446, -457, -575, 101, 2356, -1585, + 3204, -104, -7244, -1678, -801, -2620, -4603, -11876, + -1787, 2962, -1796, -3385, -411, 5796, 2900, -562, + 835, 293, 7127, 4939, 721, -2972, -482, 121, + -2694, -2277, 412, 12770, -342, 718, 3306, 502, + -7281, -307, 552, 7158, 3289, -5051, 5230, -1185, + 3024, -942, -1347, -283, -13937, -208, 2576, -906, + 1848, 5692, -2434, 175, 7837, 1872, -4536, -3341, + -957, 14787, -1598, 9058, 3776, 407, -1734, 1259, + -3011, -131, -3589, -614, 272, -2968, -1611, 3645, + -8126, 2120, 4868, -5462, -13235, -3452, -6077, 5064, + -1593, -1395, -2427, -1139, -958, 1585, -1330, 2178, + -778, 3545, 2836, 7712, 5993, -432, 3575, 929, + -7951, 115, 2180, 3904, -193, 1556, -252, -913, + 2574, 11948, -4525, 1391, -8513, 4540, -12815, -3379, + -4676, 1838, -5676, 1321, -6168, 1397, 1020, 438, + -141, 3424, 392, -512, -1614, -1396, -318, -2451, + 1545, -7132, -1763, -424, 3575, -828, 19216, 1978, + 1624, -1969, -1667, -772, -2031, -781, 1732, 244, + -212, 416, 900, -8960, 1002, -1077, 4667, -3527, + 1586, -13109, -2442, 3829, 4358, 1056, 2960, -1087, + -662, 4775, -6316, 6157, -3736, -2040, -187, 904, + 1254, -636, 2032, -734, -1271, -2691, 3376, 564, + -7769, -5482, 840, 14171, -5828, -966, 1685, -10192, + -388, -434, 3706, 594, 2188, 365, 209, 298, + 1825, -236, 12762, 1644, 3199, -468, 12876, 130, + -2169, -3406, -3571, -4655, 2339, 10757, 1292, 2920, + 289, -314, -591, -1631, -1778, -1296, -254, 469, + -9408, 1154, 334, -4, -1922, 2787, 317, 416, + -1703, 14075, 1601, 638, -2260, -973, -824, 2816, + -2954, 3282, -3716, -882, -3447, 3058, -6701, 1233, + 177, 3579, 3508, -3539, -10511, 7507, 7608, -1928, + 2482, -719, 2278, 5167, 9828, 10572, -3635, -2750, + 3407, -116, 3343, -3432, -3375, 982, 903, -3239, + -444, -1574, -333, 9613, -1914, -532, 1879, -78, +-17944, -7029, 1586, -3122, 360, -401, 1219, -2086, + 3066, 878, 5780, -948, 102, 1952, 418, -416, + 1002, 1380, 1297, -92, -640, -555, -1159, -28517, + -1757, -696, 124, -618, 1590, 300, -598, 924, + -190, -1734, -4196, -5345, -14068, 5971, 8293, -3878, + -1448, -1777, -174, 921, -1555, -866, 560, 232, + -1914, -4002, -772, 1960, -4945, 3424, 6492, 3675, + -800, 5346, 4404, -639, 10697, 1631, -1446, -4469, + -7804, 3721, 4824, -620, 1099, -2956, 5175, -2453, + -4894, 2562, -1842, 4940, 1391, 2818, 1095, -4285, + 6469, -1966, -14564, -2232, 592, 5570, -2682, 2651, + 4678, -7444, -2387, 6812, -12757, -5664, -42, 134, + -2861, -1780, -158, 1410, -4990, 673, 2083, -2639, + 3019, -2, 8305, -1981, -2114, -54, 2892, 1659, +-14913, -74, -1092, -1187, 2465, -2218, 791, -608, + 3077, 26, -1096, -1692, 3234, -7116, -1835, -5244, + 398, 10137, 698, 2298, 498, 7060, 6430, 1393, + 2540, 487, -1534, -1926, -5139, 3425, 4533, 5067, + -535, -924, 938, -1799, 16120, 2037, -3727, -821, + 2986, 2314, -223, 1358, 9, 2697, -1806, -940, + -3630, -1843, -2776, -2246, 580, -1678, 2427, 2126, + -1935, 2956, 849, 18234, 638, 342, 1036, 249, + -24, 2713, -1973, -134, -4469, -2014, -6162, -19776, + 703, -50, 2295, -2294, 1971, 1179, 1014, 2374, + -1480, 1513, 630, 1542, 24716, 3534, 2926, 662, + -2886, -521, -348, 402, 1112, -371, 1587, 1822, + 1880, 1284, 302, 1873, 1284, -924, 6420, 4650, + 7986, 427, 361, -8276, 304, -11911, -1305, -2018, + 189, 258, 839, -942, 479, -3162, -1195, -1138, + 1560, -1850, -5304, -10132, -10533, -1301, -3147, -680, + 56, 4260, -6867, -1350, -1094, -1385, 1831, -2, + -941, 3740, 7701, -855, 3304, 3444, -4467, 269, + -4092, 588, 13957, -1566, -3561, 1936, 2816, 2982, + 1804, 2710, 419, 685, 4468, 488, -9520, -2738, + 3974, -9978, -1681, -2418, 2340, -717, -899, -2855, +-10470, 1030, -2346, -5555, 2559, 2180, -5324, 1832, + 10294, 342, 11318, -2376, -3904, -1524, -3806, 1078, + -1896, 7199, -3522, 1364, 2291, -911, -156, -4327, + -778, -30451, -577, -158, 560, 2749, 799, 2689, + 337, -301, -1218, 1243, 687, -880, -419, 40, + -280, 4, 1834, 9908, 1953, 408, 1080, 8777, + 3861, 552, -6906, -3546, -6666, 35, -1903, 4788, + 5080, 2865, -233, 1031, -4519, -13752, -2417, -1742, + -7389, 3191, -626, -411, -7351, 3063, -1801, -4377, + -2974, -124, 2778, 2733, 349, -1191, -6528, -1699, + 6907, 239, -2765, -5706, 3627, 2096, -20, 2285, + 7164, 3523, -11582, 3616, -614, 6266, -285, 3643, + 1506, 3665, 1261, -2338, 418, -5062, 4893, 2945, + 1923, -2990, -4531, -8858, 2769, -5029, 2202, 3337, + 10703, 716, 5614, -14982, -2366, -5415, 25, -1665, + 4353, 3060, -2159, 1005, -1587, -368, -949, -2788, + 1063, 1307, -59, -46, -6337, 500, -1194, 2914, + 2372, -1393, -1914, 3820, -1160, -135, 3777, -14151, + 5208, -2290, 5738, 1018, 385, 1883, -2626, -9289, + 1082, 1558, -1756, 2720, -519, -13050, -3672, 1759, + -13, 3471, 4071, -5977, 167, -4210, 2219, 1344, + -2412, 4497, -6946, 660, 8774, -3141, 6080, -4478, + 2520, -609, -3080, -741, 7864, 7428, -333, 1154, + -1849, 1478, 460, -338, -6651, -2480, 1692, 2104, + 1642, 2720, 1017, 2759, -1822, -2668, -2265, -1019, + -8926, 1487, 733, -15128, 5543, -4214, -7044, 666, + 7108, 2222, -2454, 4995, 5108, 1481, 2242, 5743, + -487, 9669, 295, 3539, 4836, 487, -1541, 824, + -5946, 6692, -368, -1390, -6103, 4545, 2671, -12272, + 3160, 760, -2080, 3523, -2752, -2940, -718, 2202, + -5523, 2346, -5580, -5007, 6212, -5406, -11348, 1272, + 5389, 2331, 3691, -1184, -3585, -4500, -603, -38, + -5285, -531, 4844, -3850, 3944, -6525, -5723, -2313, + -985, 879, 578, -3217, -3600, -2814, 1432, 11568, + -1461, -1761, -4110, -4104, -103, -1803, 5195, -1477, + 1348, 107, 3902, 1215, 3522, -3404, 9098, -237, + 68, 34, -2524, -12040, -6183, 2122, 470, -1257, + 346, -232, -1725, 5913, -1525, -5873, 1846, -11368, + 1043, -1027, 4201, -3864, -4294, 7756, 1847, -3688 +}, + +.cb2220s1 = { + 32767, -2256, 16, 2156, 267, 1128, 1394, -1936, + -488, -405, -345, 1068, 578, 1504, -1192, -405, + 292, 1149, 4243, 152, 1036, 1782, 2655, -23349, + -1100, -1933, 354, 966, -1554, 1173, -1186, 495, + 618, 1009, -2715, 461, 5974, 939, 3552, 1325, + 3385, -956, 2177, 2101, -145, -1000, 2326, 2466, + 2822, 15822, -581, -713, 4398, 828, -3249, -3942, + 1990, -862, 2272, 348, -2972, 241, -2678, -1881, +-22307, 417, -587, 312, 280, -2524, 2380, 299, + 3931, 178, 2910, -2544, -356, -786, 546, -73, + -862, 240, -1653, 1286, -3875, -2072, -1477, 16800, + -1148, 2099, 3216, 5174, 2177, 3042, -796, 414, + -506, 883, 1837, 1451, 2864, 850, 2395, -414, + 3254, -1937, -16379, -3976, 2178, -1473, 4759, -832, + 8890, 3324, -3053, -407, -1530, -431, -1220, 128, + -3472, 980, 52, -14716, 1732, 1931, -6518, -1784, +-11113, 4466, -24, -8559, 105, 5478, -4116, -2213, + -3006, 1738, -4189, 3310, -753, 1869, 580, -885, + 3089, 8146, -4990, -1825, -524, 3620, -6920, 621, + -1064, 4633, -1509, 80, -10949, -2752, 476, -3684, + 3547, -1967, 3364, 2887, -729, 7921, -4216, -3681, +-14417, -3978, 261, -1146, -1124, -901, 777, 783, + -2, -989, -1582, 3988, 7785, -6371, -2258, 3344, + 354, 13289, 3339, 316, -3186, -2088, -1951, 310, + -545, -704, -40, 4416, -392, -1033, 5650, 99, + -3008, -3716, 2448, -3758, 9463, -1793, -130, 1705, + 6501, -2214, 2970, -10476, 564, -5952, -541, 2077, + -90, 6588, -2858, -1733, -9247, -345, -3170, 4986, + 3353, -4868, 8873, 113, -5223, 1562, -163, -2446, + -4459, -8052, 1106, -10883, 1185, -1756, -152, 3109, + 181, -1427, 8291, 11419, -6265, 2116, -469, 5150, + 1355, 182, -740, 779, -7754, 1868, 144, 3936, + -60, -784, -231, 879, 17032, -2273, 1886, -538, + 1015, 1798, -633, 1090, 1910, 128, -6094, -1946, + -1570, -727, -18457, 498, 784, -4419, 1656, -21, + 154, 2430, 3815, -41, -2708, -1594, 228, -784, + 7284, -452, -7634, -12868, 3564, 5473, -1244, 2231, + 28, 4321, -1464, 1402, -1358, 2241, 656, -1128, + 1160, -2352, 3641, -680, 1816, 6864, -42, 1269, + -280, -1265, -2048, 238, -653, 13571, 3874, -269, + 7977, 2238, -1246, -2066, 4741, 1706, 3498, 595, + 2559, 55, 593, 1681, 1612, 43, -2756, 2702, + 2439, -2471, -809, 1890, 17032, -787, -4280, 1167, + -1926, -4973, -1181, -2764, -4151, 2962, 3444, 844, + 2446, 14013, 3326, -1195, -1829, 1588, 1765, -3140, + 8562, -14425, 4040, 2003, -738, -1032, -3314, -2236, + 548, 768, -2348, 436, 1755, 31, -4616, 1259, + 269, 1543, -1393, 5338, -16463, 2900, -2480, 1659, + 217, -5864, 3878, 5268, 1244, -520, -1202, 1238, + 182, -1049, -695, -320, -6832, -5904, 2914, -2616, + 2586, -10958, -3258, -1846, -4633, 2371, 3251, -3583, + 2631, -4162, 3035, 2718, 616, 2890, 206, 16128, + 979, 3551, -6864, -3221, 5881, 3692, 1718, 234, + -2844, 1668, 102, 2687, -838, 988, 1116, 533, + 4026, -7235, 5972, -13781, -3394, -3518, -294, -6383, + 1675, 4507, 5444, 385, -1931, 930, 699, 1639, + 415, 6720, 7854, 1514, 3192, -2253, -14786, -1307, + 871, 1329, 1881, 6628, 2851, -85, -2284, -4538, + -837, -2232, 269, -2227, 13930, -2063, -7540, 8978, + 1195, 2717, -1282, -972, 1305, 3864, 2412, 2308, + -4824, -3282, -864, -489, -1458, 2192, 15903, 2460, + 2792, -4137, 1034, -359, 5, 2297, -6, -3859, + 478, -1535, 2080, -741, 2030, -603, -2640, -1902, + -8208, 3818, -1273, -8138, 2015, 9169, -3440, -1779, + 4076, -576, -93, -1718, 744, 2563, 6744, -3841, + 1355, 1590, -4196, -13924, 356, 13381, 2552, -2862, + 2790, -578, 3562, 2711, -686, -3783, -489, 1230, + 896, 1208, -1101, -3482, -2478, 772, 1254, 320, + -1825, -327, 1070, -1712, 295, -18141, -2618, 1537, + -603, 3782, -1272, -1901, 414, 169, -6574, -6966, + 2711, -3292, 13204, -1324, 3620, 4962, 2835, 4177, + 4861, -2378, -5534, 3701, -4224, -631, -3199, -653, + 4785, -1045, -2097, 580, 2190, -140, 48, 3075, + -1346, -810, 2016, 566, -2543, 235, -5930, 1956, + 481, 19003, -3938, 6489, 2697, 4796, 3435, 7102, + 3062, 1460, -5814, 2723, 4181, -4979, -2534, -2058, + -136, 3554, -2684, 15252, 4112, -3146, 2812, 7182, + -2642, 5443, -1043, -803, 2786, -1622, 1988, -780, + 1482, -13015, -1762, -1377, -4005, 161, -9568, 8166, + 1832, 330, -6484, 945, -4388, 1090, -524, 1556, + -582, 320, 770, -938, -8757, 977, 1084, -7062, + 3552, 775, -4708, -2281, -552, -10027, 4263, 1197, + -672, -93, 5716, -3825, -4526, 1781, 9799, 4450, + 1981, -3149, -9664, 3119, 3794, -91, 6710, 840, + -1098, 11310, -2933, 785, -2573, 748, 1803, -1401, + -1547, -4118, 849, -580, -1404, 1536, -9382, -1610, + 2335, 403, -2939, -3015, -3753, -7593, 1640, 3346, + -2594, -8028, 5485, 2189, -3369, 2106, 5369, -2573, + -515, 1459, 6996, 1344, -389, -7009, 10332, -840, + -3869, 901, -6449, -2348, -2461, -4103, -810, -2060, + 1040, 117, 32241, -231, 945, 999, -1183, 180, + 1443, 188, 855, -1634, 774, -202, 99, 1714, + 286, -849, 1968, -9743, -15458, -859, -3726, 2257, + 355, -167, -1674, 1808, -488, 1118, -1416, -1685, + 2928, 1471, -1145, -536, 2307, -972, -1191, 1625, + -1436, 378, 20178, -638, 1826, 472, -300, -845, + -1045, 1074, -1041, -510, -39, 516, 4548, 2741, +-10197, -2336, 3828, 2093, -4148, -9138, 4239, 2520, + -3536, -3807, 2998, -2226, -6898, 4838, 2552, -2024, + -5579, 1370, 11706, -7626, 1566, 989, -4934, -1345, + -5962, 4259, 1158, -3712, -2710, -1037, 105, -2733, + 1068, 3682, 3904, 2044, 184, 537, -3438, -1376, + 332, 17812, -3170, 2386, -2090, 3481, -1352, 431, + -1016, -1062, -564, -1752, -2602, 1299, 6720, 789, + 1275, -9801, 5320, 2327, -4048, 4443, -7820, 1112, + 1232, -1139, -920, -744, -845, -3754, 5958, -5388, + 3336, -3578, -4027, 688, -7043, -136, -163, -1395, + 13400, 1729, -1862, 2612, 321, -3874, 947, -990, + -3164, 11487, 46, -1978, -2139, 1222, 3897, -9664, + 3692, 5431, -3364, -3706, 180, -4009, 2563, -313, + 3228, -1631, -9763, -9184, -6058, -4594, 1040, -3323, + 321, -3233, 5035, -1919, -5525, 1899, 1196, -1834, + -391, 549, -2114, -1436, -2624, 2441, 618, -27606, + -841, -936, 1067, 1157, 230, 784, -755, 1798, + -219, -1026, -1119, 320, -2611, -1382, 8776, 1151, + 3739, -607, 2997, -7704, -5870, 1800, 1357, 4973, + -9674, -5182, -50, -886, 2056, -802, -1909, 574, + -1716, -6388, -2882, -3526, -3188, -543, 244, 9648, + 5129, -5069, 598, -9049, 1834, -3375, 1369, 1461, + -1295, -380, -274, 7258, -9353, -2401, 11915, -5087, + 1505, 4211, -719, -902, 1762, -168, 642, 699, + -2067, -933, 1092, -958, 715, -1978, -1968, -1613, + -1263, -777, 1170, -9652, -9570, 612, -3935, 237, + 386, 4237, -1468, -10172, -4964, 2919, -6428, -7184, + 119, 3610, 59, 3168, -5474, -853, -5735, -1765, + 3063, -1352, 944, -1934, -3500, 9282, 5920, 784, + 90, 275, 3211, 2418, -8570, -10498, -2026, -1020, + -2989, 1511, -41, -11462, -1980, 5296, 2614, -21, + 770, -156, -2817, -4748, -8672, 3447, -7231, 4598, + -1347, -689, -3198, 434, 56, -2065, 1798, 13761, + -533, -1280, -796, 2481, 56, 1377, -5473, 9116, + -1185, -602, 2547, -3693, -8880, 2978, 9093, 1829, + 4844, -649, 316, -162, 1520, -5814, 4860, 199, + -1330, -5182, -6269, 2642, 1220, 2816, -4098, -3981, +-13264, -398, 361, 2768, -4786, 1023, -97, 655, + -397, 2403, -1576, -386, -1112, 792, -1195, -759, + 742, 729, -2916, -1020, 21350, -26, -3577, 659, + -1263, 1378, -4339, 1880, 4842, -669, -1203, 5936, + 816, -8356, 3660, 1673, -677, -2370, 1652, 8710, + -1254, 6171, -6868, -891, -6752, -169, -5678, -7588, + -3247, 2982, 5281, -4941, -359, -3354, 851, -1609, +-11194, 610, 261, -1936, 2715, -3540, -2488, 2086, + 6110, 914, -3224, 1777, -1558, 937, 3736, -3109, + 1903, 4250, -4478, 2636, 2292, -1451, 10231, 7600 +}, + +.cb2220m0 = { +-26430, -533, 1599, 208, -293, 2303, 704, 1586, + -1064, -1630, 690, 1697, 623, 1786, 332, 682, + 199, 12695, 475, 1288, -2471, -797, -68, 9659, + -816, -2465, 546, -1421, 1596, -926, 4471, 2360, + 5551, -900, 297, 96, 400, 936, 1548, -1066, + -1625, 652, 1416, -118, -525, 683, 1545, 1340, + 20684, 936, -1033, -773, 8416, 954, -4822, 4223, +-10815, -312, -896, 531, 3140, -1649, 508, 10294, + -315, -2078, 584, 1523, 118, 997, -11837, -605, + -262, -1732, -613, 12220, -2666, -1802, -507, -4410, + -100, 2127, -114, -886, -2806, 500, 1034, -2811, + 12642, 1015, -9193, -4201, 238, 1096, -1159, 1619, + 2534, 1644, -3465, 4797, 639, 2583, -1316, -9884, + 948, 1479, 1186, -1760, -343, -1286, -1653, 678, + -7439, 4542, -6295, -1600, -6978, 48, 448, 369, + 1597, -3696, -2121, 1002, 2428, -11368, 5385, 827, +-10674, -2252, 2240, 1230, -3074, -1894, 296, -2216, + 571, 114, -497, -1675, 1311, -2297, 1843, -350, + -856, 2067, 1198, -588, 270, -470, 2640, 274, + 19586, -762, -11471, -623, -506, 4236, -10981, -214, + -1856, 409, -1276, -935, -1681, 5116, 774, 3008, + 4388, -112, -9493, -1108, 1454, 1385, 1065, 519, + -486, 308, -1141, 289, 1424, -3672, -15989, -3738, + -1592, -258, 3304, 62, 1441, 45, -686, -1070, + -1616, -701, 2313, 1918, 4843, 654, -16902, 263, + 1837, -4062, 2727, -709, 1524, -1628, 2025, -281, + 264, 1238, -1023, -11981, -2990, -1293, 801, -9606, + -604, -210, 1248, 4014, 3652, -11286, -2094, -470, + -1330, 14523, -2388, 1413, -3968, 641, 2936, 161, + -1687, -1260, 1722, -1968, 364, -854, -14386, 10146, + 792, 133, 1746, 261, 3345, -408, 2036, 272, + 1412, 720, -3302, -1495, -4334, 2210, 799, 17546, + 2600, 1314, 764, 1327, 3433, -377, 4296, 2402, + -1074, 470, 7220, -2556, 3326, -4338, -2086, -1945, + 11865, 3525, 1513, 1520, -1814, -13020, -929, -2001, + -1496, 580, -3293, -3146, -2185, 1442, 390, -2026, + -2141, -192, -18700, -2039, -4330, 1691, -250, 1451, + -2913, 2832, -3284, 2899, 1529, -888, 486, -2381, + -1459, -2663, 530, -717, -248, -1714, 12662, 1820, +-11488, -1044, 3035, 3872, -2430, 679, 1075, 475, + -593, 930, -1751, 405, -2308, 2148, 510, -2798, + 445, -240, -6865, 2106, -11323, 670, 4342, 154, + -7748, -1805, 5381, -842, -697, -709, 688, -498, + 5525, 15212, -2006, -4146, -2452, 2392, -3522, -2023, + 1306, 5522, 916, -3616, -287, -653, 333, -330, + 4, -24886, 635, 119, -1949, 899, -36, -37, + 2658, -133, 2064, -534, -549, -1745, -70, 32767, + 1089, -869, 150, -599, -1146, -574, -424, 377, + -648, -303, 590, 453, 1910, -351, 553, 304, + -752, -752, -502, -42, -31211, -634, 449, 638, + 1086, -1406, 1220, 802, -924, -1874, -212, 86, + -200, -1140, 618, -621, -605, -10976, 1699, -603, + 2056, -4448, -1519, 2564, -743, 12304, 1482, 547, + -1589, -817, -217, -1633, -1089, -2270, 181, -634, + 3890, 734, -1319, -2035, 3304, 13144, -9076, -4067, + 70, 1309, 1067, -354, 1529, 1379, -1002, -3324, + -525, -817, -1438, 10834, 1036, 12441, 1242, 2461, + 2858, 2257, 430, -1177, 1142, -870, 844, 1102, + 1208, -1482, 830, 17622, -2753, 6, 174, 4385, + -339, 2157, -155, -68, -190, -1181, 29, -2046, + -2140, 27, 949, 1889, 446, -54, 16696, -49, + -3304, -1929, 1833, 3735, -495, -1225, -11743, -2259, + 891, -1954, 2848, -504, 1164, -2489, 861, 579, +-11547, 976, -42, 1477, -2428, -1561, 112, 74, + -2721, 12046, 632, 1283, -1900, 1990, -1193, 1606, + -1370, -2812, -1309, -1419, -12526, 3391, -4213, -2710, + 269, 90, 14575, -345, 820, 6118, 892, 6302, + -2825, 332, -3071, 2279, 3756, 185, -3029, 2402, + 245, 1010, -273, -32751, -140, -600, 482, 1516, + -462, 1931, 1941, 272, -310, 544, -422, -815, + -1116, 803, -617, -1640, -4336, -11735, 3656, -1176, + 1170, -6209, 2139, -1571, 2067, 1011, 9842, 790, + 1702, -191, 911, 2771, -253, 794, -3862, -1885, + -494, 2070, -2682, 772, 763, 4304, -15657, -2194, + -1998, -963, -5222, -175, 238, 32, 10067, -692, + 2824, -474, 3016, -11994, -51, 713, 2423, 2864, + -338, 4838, -1095, 215, -13471, -2, 704, 752, +-14654, 1396, 484, 564, -886, -775, -1099, 775, + -1035, 1661, -1013, -1118, 449, 822, 14253, -13238, + -1084, -1107, -1672, 996, 472, 2237, -440, 1186, + 1200, -2112, -1388, -1093, -1902, 555, -328, -1493, + -2034, 426, -2144, -388, -20028, 1285, 1122, 730, + 1661, -1576, -2084, 2930, 337, -66, 1591, 8685, + 2361, 146, 1370, 22, 1371, -105, -4190, 371, +-13252, 328, 1301, -995, 3689, 6422, -79, -1407, + -384, 828, 840, 854, 266, 1222, 796, -550, + -729, -1213, -87, 524, 1070, 22334, -2333, 574, + 680, -624, 463, 4047, -236, 114, 1020, -692, + 1575, -320, -3229, 222, 520, 996, 2104, -5404, +-18197, -1105, -184, -1057, 10712, -2509, -7140, -2307, + 1333, 3041, 183, 1241, -7861, -3060, 1432, 9, + -1431, -2605, 2663, 273, 250, 770, -740, 6699, +-10929, -7227, 105, -2983, -1203, 1637, -6072, -6630, + 933, -1526, 658, 2612, 5377, -91, -66, 4944, + 3025, 2723, -869, 142, 10532, 9858, -207, 3072, + -2610, 0, 81, 1078, 2136, -266, 223, 931, + -385, 983, 1029, 108, 2290, -491, 26685, 565, + -140, -662, 680, -2206, -803, -777, -250, -467, + 98, 2944, -12296, -4190, -2254, -748, -2076, 4780, + -510, -221, 1428, -6162, 2693, 6238, -4030, 266, + 6540, 2502, 5147, -4649, 1804, -10514, -3413, 2503, + 2143, -1924, -3811, 3674, 4341, -1054, -3130, -1260, + -576, 887, 25908, -773, 1186, 548, -606, -744, + -995, 1320, -507, 279, 1803, -2451, 880, -31, + -5, 1615, 770, -11818, 1062, -1126, 472, -297, +-12126, -1197, 1912, -962, 1241, 2348, 2332, -3047, + 1561, 3844, 720, -387, 371, 2942, 1174, -2347, + 1244, 10148, -1620, -11788, 1315, -31, -1867, 3450, + -1589, 5180, 3184, -2614, -13, 130, 107, 297, + 113, -1407, 29190, -544, -173, 990, 913, -1848, + -990, 1230, 264, 1896, -6974, -102, -2232, 3826, + -2269, -5027, 94, -12612, 436, -5979, 1757, 1757, + -724, 2378, 2584, 728, -1022, -7274, 668, 744, + -516, 420, -11866, 246, -1357, 2406, 3674, -2594, + 1638, -3037, -2402, 1525, -7304, -1078, 1772, 9264, + 12366, 202, 2, -728, 684, -437, 1446, -3546, + 828, -2106, -2736, 964, -180, 6524, 2250, 514, + -782, 675, 1418, -11225, 2760, -3970, -545, 9128, + -6601, -556, -1966, -4625, -149, -198, -3330, -1575, + -6198, 656, 674, 367, 1809, 155, -5126, 6109, + -572, 4927, 1448, -1855, 1636, 8648, 2010, 8973, + 3087, 10172, 34, -1183, -12, -1057, 192, -2955, + 1034, -374, 2500, 9318, -4090, -5220, -404, -1022, + -1458, -1367, 765, -1193, 1542, 302, -1337, -34, + 1449, 1434, 2210, 404, -3277, -8024, 1363, -7591, + 9096, -9179, 1176, -7311, 544, -8942, -713, -56, + 2623, -35, 1623, 2212, 1733, -712, -1327, -320, + -1966, 11352, -1276, -3804, -550, 520, -4848, 550, + 1488, 944, 10756, -782, 5643, -2647, -6513, -3500, + -2877, 1880, -6634, 2349, 256, 440, 188, -8428, + -4580, 2479, 4763, -1807, -513, -4292, -1729, -6878, + 448, -6706, -1162, 4938, -721, 5465, 1409, -8759, + -898, -4254, -5230, -3886, -7969, 1730, 3656, 1198, + 3537, 33, 4091, -2088, -7646, 1160, 2922, 855, + -1254, -2616, -770, -685, -100, -577, -4927, -792, + -2107, 9613, 2563, 5096, 6143, -3404, -8630, 4164 +}, + +.cb2220m1 = { + 32524, -324, 411, -34, -697, 818, -71, 2326, + -142, -989, -1512, 358, -260, 3791, -575, 93, + 224, 208, -1101, 32767, 1147, -203, 2015, 461, + 668, -296, -3340, -38, 720, -993, 1765, -1344, + 1323, 648, -997, 729, 581, 349, 861, -2035, + 1791, -2142, -822, -1425, 820, -6555, -811, -15708, + -912, 4835, 1500, -604, 527, -937, -640, -1240, + 4692, 1259, 174, -12040, 450, 8196, 2796, -5123, + 1595, 538, -101, -218, 5581, 367, -2700, 277, + 2111, 2718, 1458, 155, -100, 3284, -498, 9961, + -1505, -10336, -1170, 5337, 1032, -14947, 1154, -578, +-11773, -945, -660, 669, 2340, -1038, 1520, 713, + 2663, 422, -1242, 1918, -234, -1793, -1580, -271, + -5628, -2010, -12209, -1784, -4417, -2804, -3123, -4316, + 126, 6353, -2391, -2088, 836, -2550, 521, -1258, + 918, 4471, -528, 4243, -615, 3453, -6683, 1784, + 790, 13200, 700, 322, -815, 6049, -290, 928, + -1121, -1531, -878, -1150, 1404, 325, -530, -435, + -254, -804, -2536, 589, 8439, -1087, -16248, -637, + -1528, 305, -1577, 642, -22699, -139, 1319, 588, + -3079, 800, -597, -1408, -1150, 3145, -868, 3244, + -1004, 1004, -1459, -11618, -4557, -3643, -914, 4238, + -626, 4025, 3227, 537, -4285, 2010, 747, 1595, + 1599, 5994, -797, -911, 2854, -3426, -8488, -1899, + -301, -2146, -111, -522, -1852, 3075, -3864, -1531, + 654, 193, -11264, 5561, 304, 525, 346, -2761, + -1124, 1134, 8354, -12460, -1023, -7634, -2750, -1518, + 5001, 1480, -1039, -502, 1455, 586, 1012, -1270, + 12435, 895, 1169, 466, -10696, -3861, 4381, 1790, + 767, -1808, -537, -1057, -2374, -2058, 9992, -858, + -1568, -678, -3812, -1520, 1521, 230, -1716, 13418, + -1930, -979, 3272, 1116, -4555, -559, -320, 12080, + 13696, -286, 652, 2420, 1725, -277, 213, -1046, + 1642, -576, -1514, -973, -1501, 77, 537, -606, + 1144, -680, -568, 1104, 2176, -969, 1657, -784, + 1107, -1056, -59, -5607, 64, 11913, -178, 8703, + 3744, 276, -50, -12807, 1122, -6138, 1901, -439, + 733, 6829, 3001, -61, -1005, 3816, 3987, -3588, + -778, 2257, 12101, 196, 13796, 355, 1407, 989, + 101, 1041, 988, 1274, -1478, -1127, 1320, -442, + 3452, -1717, 1244, -466, -868, -323, 502, 1243, + -70, 897, 958, 2781, -2492, 788, 744, -12324, + 1111, -11704, -452, -734, 19574, -45, -584, -2387, + -830, 603, 380, 787, -2962, 2046, 2524, -2403, + 699, -4144, 1587, 573, 588, 238, -88, 31, + -278, -32768, -1173, -745, 667, -188, 1221, -369, + -261, 322, -2054, 651, 100, -2092, 315, 1558, + 596, -407, -146, -1234, -30970, -71, 633, 536, + -1345, 1819, 655, 680, -1453, 492, -1265, -1292, + 1780, -68, 1008, 215, -19980, -521, -3148, -256, + 193, 916, 453, 86, 116, 108, 1518, -1420, + -1501, 688, 669, 1196, -1579, -942, 868, 804, + 110, 1126, 202, 1086, 23516, 1070, -1623, 747, + -38, -116, 1176, 554, -2361, 1008, 1085, 1972, + -1794, -96, 464, -20910, -1208, -3857, -466, -2173, + 2461, 2364, -931, -684, 3056, -719, -936, 887, + -3149, 1004, 7085, -2985, -9393, 5142, -9621, 150, + 174, 572, -2232, -390, 1356, 160, -10796, 2256, + 2238, 242, 1663, 485, 12378, 1236, 688, -2908, + 1084, 1047, 4850, -72, -642, 1604, 152, -850, + 670, 968, -3207, 1690, 105, -2516, 11539, 390, + -1117, -588, -10771, 2879, 4742, -8351, 1571, -850, + -605, -1959, 395, 12324, 1750, 2290, -92, 774, + -2897, 1025, -1841, 546, 3904, 3908, 11494, 9, + 1340, -11976, -525, 1522, -43, -43, -1860, -6160, + -199, 2479, 4593, -2876, -2985, 1044, -62, -812, + 10424, -2489, -1098, 796, -1292, -2070, 1096, -1944, + -2145, -4374, 1041, -1014, 9036, -2142, 328, -8232, + 152, -13336, -2225, 13716, -367, -558, -1942, 161, + -472, 2224, -748, 3550, -809, -493, 2121, 1234, + 772, 5146, 2485, -2282, 7546, -1441, 1595, 9176, + 6208, 1292, 1704, 3968, -1500, -1974, -3519, -2826, + 149, -903, 504, -187, -940, 121, -215, -615, + -257, -1954, 958, 2057, -191, 21258, -726, 2081, + 1278, 1670, -854, 2730, -8132, -530, 1004, 2574, + 1430, -2536, -10851, 1389, 155, -140, 2158, 2762, + 3807, 3850, -3728, -954, -11366, 709, 14727, 514, + 694, -87, 857, -249, -419, 617, -418, -1144, + -32, -2182, -839, 1449, -1072, -785, -246, 13634, + 12488, 358, -447, -2262, 926, 1023, -901, -345, + 2260, -1530, -1466, -2973, -2170, 2090, 44, -23476, + 603, -1740, -345, -438, -3004, 1322, -3088, 1274, + 341, -348, -534, 1055, 3026, -932, 514, 8958, +-15489, -374, 1077, 1166, 48, 1016, -918, -27, + -410, -266, -1401, -3888, -2918, -2146, 2815, 1834, + -875, 162, -678, 1876, -2033, 1999, -12854, -1563, + 192, 414, 782, -3109, 1432, -4197, 2358, 8517, + 784, 1256, -1362, 2938, -11355, -5184, -10314, -39, + -2182, -1686, 241, -195, -232, -6169, 206, 181, + -470, 1008, -599, -284, 733, -836, 648, -138, + 2078, 313, 24432, 548, -441, 1446, -1628, -1218, + -64, -716, -2456, 1987, -352, -1025, -1951, 1320, + 350, 744, 2598, -984, -18328, 622, -4, -1572, + 893, -3043, -4365, 127, -1, -226, -1696, 1332, + -1360, 6756, 2596, 12059, 370, -3690, 497, 585, + 1619, -778, 9174, -2046, 2214, 2004, 1133, 1069, + 132, -250, -1555, -906, 561, -12904, -1039, -8006, + 1876, 2300, -1116, 1895, 1782, 3734, -1108, 1338, + -1409, -248, 16117, -1458, 156, -2626, 64, -1199, + -3544, 4283, -3390, -404, 1426, -907, -2768, -780, + -34, -18656, 2003, 515, 3171, -653, 762, -3352, + -154, -1171, -452, -1590, -5936, 519, 1210, 502, + -409, 2262, 695, 1028, 8652, 2532, -2636, 3472, + -1186, 1350, -651, -639, 8382, -3234, 630, -10323, + -2285, -1916, 826, -1449, -738, -344, 1022, -3248, +-20921, -200, 568, -84, 777, -1570, -2756, 2834, + 26, 3878, -1709, 101, 1433, -2238, 305, 61, + -1041, 2399, 628, -1509, -388, 946, 733, -1538, + -650, 19935, 478, -10696, 850, -682, 447, 2311, + 35, -1258, 2332, -11417, 1743, -834, 660, 3170, + 2378, -2734, -762, -1151, -1802, -9324, 4625, 2304, + -1186, 1180, 4894, 662, -7067, 869, 613, 1802, + 4839, 3412, -5460, -862, -4202, 7876, -1057, 2872, + -1336, 1731, -10788, 1088, 3433, 42, -939, 2479, + 6425, 991, -1621, 3222, -2464, 2988, -29, 481, + 11606, -2800, -8315, 7660, -3385, 1217, -728, -3670, + 684, -2295, -724, -567, -2150, -106, -1920, -2143, + 3465, 1968, -1089, -11953, -2704, 3049, -1351, 7225, + 5727, -525, 2639, 1955, 2259, 6489, -1867, 1544, + -3199, -4992, 2420, 4119, -2860, -9505, -2152, 10204, + -1133, -1201, -1468, -2989, 4658, 578, 1115, 368, + 1570, -776, -503, 1554, 1329, -696, -760, 575, + -1527, -3865, 8372, -3378, -8137, -8392, -3471, -1854, + -4852, 5270, -634, 608, 1289, -7660, 4983, -1266, + -2070, -906, 3291, 2459, 4807, -4241, 5773, -2258, + -4500, 2634, -13176, 6412, 282, -5849, 294, -626, + 888, -1088, 656, 192, -630, -3405, -12469, 2882, + 2184, 3920, 2715, -6852, -1111, 869, -161, 341, + 1856, -9450, 2719, -579, -3840, -8763, 1153, -3532, + -571, -766, 8301, 2936, -10501, -1073, 10068, -2930, + 6308, -2747, 3093, -1710, -3865, -1464, -4447, 446, + 898, 5386, -1074, -4651, 6205, 455, -1773, -1270, + 6986, -2493, 4076, 10605, -2522, 977, 4098, 1153, + -434, 4071, -2890, 2920, 9175, 2276, 4699, 642, + -1067, -968, 508, -1752, 728, 3260, -500, 1414, + 5554, 2761, 1973, -4704, 2127, 1397, -1070, -14536 +}, + +.cb2224l0 = { +-12451, 389, 917, 1238, -626, -904, -1877, 2328, +-12808, -1345, 406, 80, 383, -3841, 1188, -907, + 2369, -13409, 11191, -2547, -532, 762, -1627, 680, + -2305, -811, -1118, 3232, 3413, -2010, -453, -6816, + -4100, 1643, 11209, 933, -2272, 1440, -2465, -6862, + 186, 1563, -8468, -1832, -1166, -596, -326, 105, + -115, -352, -624, 31621, 129, -301, -615, -313, + -176, 620, -5, -1354, -3563, 678, -301, 621, + 904, -769, -1314, -956, -2294, -362, 381, -2398, + 17085, 100, 3962, -830, 18705, 237, -1296, 3534, + 1452, 259, 1690, -3106, -3624, -316, -16, 5900, + 2195, -1008, 14335, 14173, -1637, 1130, 1110, 499, + -1516, 500, -720, -494, -1010, -1264, -773, 1389, + 212, 8036, 780, 608, -415, 931, -301, -2186, + 2256, -706, 12972, -3461, -3695, 2073, -2768, -1525, + -7539, -441, -753, 4558, -8171, -1751, -6885, 4077, + 6714, 53, 1090, -3006, 3688, -1162, -59, 302, + 928, -450, 238, 10809, 353, 698, -476, 172, + -2198, -4377, -7518, 1605, 6348, 5147, -165, 165, + -463, -93, 1251, 671, 587, -402, -227, -462, +-27960, 215, -56, -958, -657, 508, 98, -2811, + -1443, 3076, 6218, -9760, -10465, -770, 345, 3076, + -116, -2884, 2215, -2652, 1306, 2638, -124, -317, + 366, 1461, -295, 5073, 460, 1920, 12216, -7032, + 6816, 3037, -2630, -1087, -1315, 123, -582, -2137, + 5061, 291, 1740, -214, 1920, -3470, 10895, 9491, + 3558, -1256, -448, -10304, -2391, 1890, 484, 11057, + 6636, 422, 2316, -1663, -348, 633, 1200, 1788, + -1124, -24435, 140, 869, 738, 223, -1429, 602, + 433, -196, -1127, -1937, -879, -310, -564, 1022, + -4380, 7247, -3938, 4461, 2219, -8465, 9266, -4564, + -3169, -3463, -477, 749, 2460, -776, 294, -171, + 1072, 1748, 1000, -208, 1908, -998, -1898, -10485, + 2360, -11950, -2412, -2609, 3885, -2738, 1348, -559, + -1342, 9366, 1560, -816, 1178, 342, -175, 1286, + 3014, 10641, 246, 3128, 6618, -305, 10906, 6359, + -4395, 1415, 196, 11136, 1772, -3047, 3313, -1231, + -1974, -3021, -1480, -1345, -830, 1551, 2521, -506, + 7821, 7715, 5078, 8215, 2102, 1552, 2247, 3766, + -3158, -1811, 631, 3980, -397, 9030, -1267, -1974, + 1539, -360, -315, 796, -4749, 2076, -1017, 717, + 2290, 11212, 9365, 1626, 379, 2060, 1329, 4, + -25, -1348, 566, -1266, 1670, 2166, 13123, 42, + 2416, -2170, -6380, 172, 316, 40, 300, -487, + 402, -220, 846, -894, -1413, -2227, 1962, 19478, +-14756, 14377, -582, -770, -186, -1008, -1520, -722, + -885, 2622, 311, -753, 480, 539, -1011, -1748, + -832, -603, -2015, 869, -14860, -600, 2110, 484, + -5874, 1532, 3290, -222, -4670, -33, -794, -2061, + -1185, -96, 337, 515, -1887, 26, 20283, -455, + -799, -62, -1083, 236, -1721, -569, -1259, 361, + 1090, -226, 1480, 13367, -638, 940, 3736, 6419, + -5995, 830, -6599, 4549, 1583, -9001, 1104, -1281, + -1270, -94, 1104, -2076, 652, 2263, 1465, -25, + 9046, -8139, -2646, -13200, -534, -15244, -1448, -1390, + 452, 584, -314, -1192, 951, 885, 396, 776, + 1303, 1298, -448, -32641, -234, -62, 31, -164, + -1042, -82, -26, -272, -559, -164, 669, -500, + 516, 1347, 9615, 1123, -1346, -1898, 8341, -10583, + 2286, -5233, 1503, 454, -2024, 4248, -2298, -2117, + 13390, -849, 2078, 1096, -651, -12232, -374, -812, + -3729, -829, -144, 1213, -469, 1112, 1146, 816, + 818, -912, -967, 907, 12, 2443, -759, -1833, + -174, -838, 488, -1560, -18242, -558, 5510, -1316, + 1758, 3957, -7130, -1394, 4962, 3870, -1907, -9247, + 2217, -3880, -4413, 1893, -3085, -202, 599, 1307, + 1574, -1070, -2593, -2722, 9506, -10170, 1105, 4879, + 2208, 38, 5596, -5990, -3205, 35, 9405, -219, + 618, 1308, 353, 3457, 1712, 717, -12937, 25, + 2176, -2590, -1223, 528, 1318, 4588, 7678, 5743, + -8430, -4487, 1364, 8082, -1727, -387, 469, 3172, + 401, -2771, 694, 14554, -2278, 3640, -11084, 924, + -593, -3841, -4338, 227, 750, 2974, -2834, -1765, + 2133, -1181, 5149, 11758, 11949, 3538, 2442, 2801, + 1457, -822, -3419, -2468, 191, -646, -975, -1271, + 832, 3088, -495, -10022, 1817, 1319, -880, 1342, + -1448, -3597, -3310, 8753, -161, -6550, 1422, -640, + -508, 11542, -277, -165, 837, 7389, -942, 11009, + -97, 1548, 1418, -445, 2105, -946, -8676, 5274, + 8842, 576, -1392, -1737, -1276, 5491, 312, 3624, + 2806, 2157, -537, 1656, 1982, -1300, -146, 463, + 496, 16792, -140, -1755, -832, -2123, -399, 5811, + -702, 2891, -3630, -1843, 346, 508, -364, -498, + -558, 32048, -744, 90, -372, 430, 704, 871, + 139, 772, 696, -108, -18, 310, -411, -798, + 465, -165, -321, 745, -27861, -752, 499, -215, + 172, 35, -196, -770, 274, -546, -96, -470, + -8976, 9156, 581, 904, -4644, -7801, 3525, -607, + 6444, 4058, -696, -1107, -632, 1475, 196, -933, + 883, 1101, 278, 433, 544, -497, 4, -1882, + 1504, 594, -30386, 218, 211, 850, -989, 319, + -867, -42, 754, 498, -70, -562, 660, -11561, + 54, 803, 425, 966, -1017, -1224, -12630, 1834, + -41, 98, -1083, 3508, 1750, -1751, 72, -503, + -38, 22211, 252, 88, 221, 690, 82, -1340, + 508, 638, 832, 482, 51, 7954, 2702, -1176, + 8830, -311, 2536, -6072, -4147, 5234, 494, -157, + -1289, -5678, -1617, 1508, -140, -55, 713, 440, +-32583, 105, -394, -613, -972, 578, 1122, -32, + 114, -228, 342, -1237, 1123, 1126, -188, -106, + 11308, -3787, 563, 3423, -9926, 1623, -2551, -1448, + -4125, 918, -1366, -476, -66, 4, 761, 164, + -61, 20445, 238, 296, 492, -1126, -98, -1201, + 14, -1840, -865, 1178, -869, 105, 907, 248, + 1538, 2990, 11691, 7783, 1566, -6704, 2397, 594, + -1825, -383, 4264, 1911, 468, 1018, -676, -2676, + -7756, -2623, 10705, 2710, -8078, -5256, 1699, -2100, + -355, -2086, 10828, 611, 18, -830, 978, -4181, + 1324, -5262, -327, 1796, -9777, 1306, -1934, -8930, + 9520, -2364, -3997, -10209, -6326, 1394, -1758, 868, + 1192, -2916, -23, -1586, -296, 438, -279, -14171, + -1554, -206, 2383, 506, 1181, 8298, -491, -2771, + -4286, -7116, -1680, 506, 1729, -12965, -925, -985, + 420, -1746, -267, -478, -11763, -1030, 187, -3878, + 1516, 2472, -371, 29, 809, -1700, -152, 560, + 1833, 14397, 968, -96, -3242, -2497, -76, 2096, + 9593, -1200, 446, 1505, 8058, 1722, 501, 923, + -1171, -9516, -2536, 7368, -2, -5304, -2440, -352, + 510, 320, 301, 120, 687, -942, 137, 824, + -316, 1312, 510, -1133, -27448, -404, 1041, 272 +}, + +.cb2224l1 = { +-14840, -1361, 12733, 798, -496, 1691, -1668, -1730, + 928, -3233, 338, -578, 156, 784, -787, -242, + -618, -853, -1282, -11766, 3970, 12178, -2034, 244, + -3411, 300, 159, 3494, -3060, -1459, -2484, -10680, + 752, 227, -1612, -922, -549, 158, 2260, -7640, + -4479, -4075, -2412, -7707, 600, -12358, 93, -1666, + -795, -13060, 61, 511, -2102, -2122, 364, -157, + 2310, -1552, 1260, 158, 9503, 7050, 7, -5902, + -7098, 444, 3736, -1836, 3109, -2328, 457, -871, + -327, -780, 661, 8684, 2530, -268, 954, 1380, + -1029, 418, -136, -3515, 1953, -1688, -8623, -3292, + 7758, 2796, 11643, -931, -501, -873, -444, -1342, +-13900, -246, -283, -1779, 998, -1318, 408, 1505, + -462, 10667, -1813, 78, -16514, 360, -2029, 942, + 1674, 171, 317, 244, 1183, 724, 760, 1634, + 863, 793, 126, -326, 980, -629, 22219, -649, + 1274, 717, 1355, -1853, -1792, -1017, -2104, -768, + -1708, 2302, 2353, 11167, 10734, -3412, -2266, 75, + -104, 425, -880, 2072, 2934, -930, 270, -2414, + -925, 1023, -746, -236, -1620, 825, 1324, -101, +-19348, -1291, 585, 2165, 2891, 3662, -577, 1800, + 408, -1486, 107, 351, -319, 1104, 956, 403, + 628, -277, -57, 938, -32768, -71, -441, -208, + -32, 191, 314, -171, 613, 749, 844, -472, + -444, 952, 42, -8026, 2720, 1911, -2780, 12311, + -122, 3569, -91, 6048, -776, 1694, -63, -1272, + 3581, 1622, 2538, 190, -13108, -820, -3056, 1189, + -1428, -244, -752, -6187, -3473, -697, 1368, 1043, + 7702, 352, -140, -12999, -80, 12672, -1473, 3113, + 1505, 667, 2392, 1767, 537, 1949, 657, -130, + 980, 1743, 8269, 2380, -2311, 197, -651, 2531, + 553, -1117, -396, 472, 4565, -12672, 2322, -360, +-12766, 2205, -2651, -10690, -218, 586, 5229, 34, + 59, 1730, 1226, 2106, 4008, -1878, -9520, -1366, + -1174, -290, -1037, 1642, 1234, 305, -1279, -642, + 1126, -13199, -29, 642, 2928, 1936, -260, 588, + 11690, 9282, -3362, 7732, 1073, 2738, 4688, -1507, + -1461, -2271, -1131, 1969, -2152, 1637, -774, 66, + -1190, -206, -491, -1080, 644, -378, 367, 17980, + -1583, 2162, 918, -121, -432, 115, 5, 791, + 1968, -2287, -1574, -9545, 11146, 3540, -4700, -515, + -4548, 881, 591, 1044, -259, -978, 2, 232, + 778, -198, -1161, -378, -83, 421, 282, 26564, + -801, -1628, -1983, -301, 931, 886, 2196, 1453, + 752, 2956, -3478, 490, -1420, 13303, 1293, -9466, + 462, -12829, 11130, 8061, 593, 3697, -611, -534, + -698, -1148, 1598, 293, -726, -698, 289, 180, + 876, -369, -43, 234, -21629, -1448, -753, -480, + 956, 994, 531, -916, 630, 720, -2300, -9544, + -1418, 993, 2130, -2359, 2460, -339, -277, 1577, + 12206, -3507, -1280, 1938, 871, -1850, -809, -3364, + 6918, 1134, 5010, 8772, 2103, -9775, -1404, 5148, + -1494, 1549, 1761, -812, 654, -611, 822, -229, + -384, 10466, -337, 2207, 131, 2818, -2925, -3374, + -8786, -8552, -2282, 88, -1058, 8571, 2900, -529, + -1569, 1882, -981, 204, 2955, -4227, 4196, -3041, + 10804, 1822, 82, 1936, 2380, 12992, -5659, -3449, + 1329, -1668, 1291, -1726, 8328, 314, 2737, -677, + 2384, -910, -878, 687, 640, -721, -912, -12772, + -2079, -398, -1788, -2516, -8711, -1038, -985, -7151, + -9057, 890, 459, -298, 918, -10061, 848, -716, + 1822, 836, -9516, -985, -1379, -409, -2237, 1036, + -1082, -1704, 1333, -1432, 11463, -2355, -5975, -1674, + -640, -554, 8352, 2732, -5251, 4243, -354, 3662, + -592, -9317, -1205, -1084, -995, 11288, -2098, -1620, + 2367, -1286, -5312, -64, 540, -2327, -2703, -2013, + -8649, -1306, -948, 1443, 664, 2400, 4706, 4061, + 387, -20, 1859, 9283, -18175, 806, -1401, 1253, + 596, 2176, -1682, 2209, 733, 1404, -6652, 2754, + 950, 2346, 3629, -6875, 5069, -9302, 1472, 942, + 1184, -10432, 960, 3987, 1985, 421, 300, -716, + 938, 500, -160, 226, -87, -1648, -1857, -1977, + -323, 2305, -13843, -4148, -2978, 5430, -3422, -1138, + -2146, 1548, -1430, 734, -339, 8598, -4568, -496, + 477, 4969, 2593, 2842, 8645, -2365, -7455, -2687, + 249, 7516, -53, 219, 1139, -668, 566, -522, + 1289, 33, -141, -920, 2526, -2797, 16456, -2000, + -758, -194, 10984, 187, 1686, -4799, 9671, 1838, + -1224, 1325, 656, -5434, 3207, 1813, 1833, 14375, + 12259, -95, -536, -1746, -3568, -442, 964, -1472, + 1345, 2692, -589, 520, 616, 357, 326, -1363, + 28603, 700, 473, -908, -1129, 1046, 1106, -471, + -472, -980, 29, 574, -350, -545, -585, -1936, + 279, 882, -880, -52, -30552, 371, -154, -1275, + -1914, 104, -110, 1122, -719, 729, -743, 360, + 766, 198, -11674, 612, -10602, 1157, 186, -3132, + 3070, 1535, 155, 774, -9432, 4966, -6717, 320, + 5167, 112, 2727, 11228, 1368, 1864, 1197, -1519, + 1504, 17863, 49, 2212, 611, -1788, 2932, 395, + 32, -566, 2425, -9457, 673, 670, -247, 1617, +-12578, 1408, 462, -14935, 1438, -808, -1850, -784, + 1856, -1648, 767, -1452, -1652, -1621, 1016, 1428, +-11203, 4217, -6410, 2570, -1016, -1720, -9036, -390, + 62, -1245, 3027, -255, 1646, 1358, -907, -864, + -118, 874, 268, 252, 104, -926, -552, -1206, + 965, -208, -24472, 890, -1516, -630, -885, -804, + -374, -22520, -1143, -777, 532, 185, 603, 1775, + -1887, 413, -458, -1036, -211, 2693, 6976, -9498, + 1437, 10163, 2450, -1574, 4941, 884, -470, -3366, + 4664, 420, -568, 5703, 10, -1692, 143, 1592, +-10966, 2891, -2961, 3938, 1990, 1726, -5247, 3326, + -6575, 584, -277, -441, 1679, -520, 1339, 1077, +-11462, -267, -351, 201, 10939, 4150, 3890, 1484, + 2615, -676, -448, 2316, -1278, 9734, -3039, 2841, + 964, -7557, 156, -7228, -120, 5533, -4322, 1796, + 2555, -9912, -3038, 2236, 1190, 222, -1684, 3273, + -1768, 6233, -6442, 8545, -49, -45, 2366, 293, + 308, -689, 308, 368, -452, 1125, 2326, -2335, +-17793, 2027, -779, 734, -2032, 1246, -2898, 4174, + -74, -40, -3105, -2135, 996, -12714, 3614, 4936, + -1928, 1528, -4158, -1791, -2318, 907, -326, 22513, + -660, 1022, 434, -564, 28, -112, 252, 372, + -842, -2, 648, 2323, -614, 23377, -263, 486, + -408, -362, -821, -724, 972, 1248, 444, -1741, + -420, -1371, 1088, -565, 22, -394, -64, -292, + -103, -501, -30510, -294, -266, 433, -700, 742, + -756, -407, -961, -148, -1416, -1041, -481, 121, + 346, 10240, 12629, 1476, -2647, 1350, -2012, -262, + -5621, 714, 4398, -2732, -10473, 9834, -5165, -991, + -557, -2733, -3460, 5779, 659, 1472, 2029, -2339 +}, + +.cb2224s0 = { +-27522, 2628, -2486, 277, 874, -2351, 2725, 915, + 994, -1209, -439, 2936, 46, 1014, -1816, -3561, +-14386, 3113, -10400, -1025, 2114, 1328, -278, 1182, + -1820, 3928, -1062, -282, -1327, -1468, 5975, 2342, + -630, -4217, 10116, -1254, -2646, -5210, -9942, 1904, + 21, 504, 2325, 1443, 6470, 2598, 8130, 810, + 304, -1059, -645, 14634, -3198, 4277, -669, -7170, + 1554, -2321, 2386, -1072, 2483, -4141, 2841, 3414, + 8014, -3141, 10857, 6634, 3138, 3199, -320, 36, + -1366, -4129, 3157, 2602, 4273, -2435, 2645, 2986, + -3712, -3995, -5476, -4693, -1664, 6384, -11201, 1320, + 2184, -5102, -2984, -1569, -2116, -1513, 14284, -11182, + -2925, -731, -1321, -6363, 1483, 3463, 1292, -2065, + -357, 9108, 6371, 3840, -6905, -8918, 2906, -1658, + 757, 1998, -580, -708, 2198, 1867, 960, 4522, + 1896, -1674, -4943, 2695, -2465, -2078, 9755, -4853, + -2602, 3466, 3897, -3633, 4918, -2049, 3730, -1982, +-10085, -3458, -1866, 32, -1706, 3648, -308, -942, + -1630, 1730, 512, 14612, 3415, 974, 3079, 765, + 897, -270, -1813, -1533, 1118, -2805, -2764, 1130, + -1798, 4594, -3134, 964, -20082, 2574, 32450, -1379, + 52, 358, -226, 1902, 257, -1071, -650, -399, + -381, 2073, 2310, 2164, 8221, 1433, -629, 1440, + 1120, -3362, -4642, 2000, 378, 1208, -2648, 4534, + 3307, 13200, 2780, 3100, -3194, -10606, -11563, -4491, + 2218, -4500, 622, 1313, 2682, 3003, -1387, -3886, + -1567, -4864, 10899, -20606, -1606, -60, 602, 125, + -730, -1112, 979, 325, -13, -185, 1241, -288, + -552, 6042, -7049, -7359, -1456, 493, 11204, -65, + -2170, -5248, 2248, -1046, 591, 2085, -2844, 244, + -3454, 581, 1315, 3043, 304, -620, 405, -19944, + 769, 1076, -1456, -694, 2560, -1046, 2514, 14552, + 1586, -7027, -4710, 1366, 1552, 4354, 3296, 462, + 600, 500, 3225, 5083, -792, 3199, -698, -3589, + -2596, -3350, 2758, -3019, 5664, -9387, 4716, -3125, + 3306, 6268, -592, -622, -4144, -6290, 4990, -748, + 1854, -1042, -2996, -4279, 338, -1864, -8639, -11208, + 932, -722, 1788, -1927, 450, 2191, 11828, -6400, + 5364, -2236, 3212, 8340, -3229, -2846, -4676, -1825, + 2628, -303, -589, 7728, -4216, -3866, -4400, -194, +-11316, 5646, 3716, 4827, 232, -583, 308, -1833, + 2153, -2508, -46, 857, -9587, 2768, 5136, 1462, + 5142, 7990, -3424, 1067, 7462, 4944, 98, 1014, + -4750, 13824, 1130, 2334, 9393, 2416, -4519, 27, + 2000, 929, -204, 481, -2780, -3720, 1267, 269, + -5383, -1999, 1249, -4238, -9351, -7440, -5964, 6154, + -6827, 3112, -2613, -164, 1604, 1245, -50, 8619, + -4044, 4652, 2846, 8359, 5345, -2902, 2295, 4801, + -5016, -6270, 2893, 2732, -3510, -2613, 4548, -6376, + 4510, 10566, 1859, 1038, -8381, 2782, -1622, 159, + -1035, -3232, -3766, 1580, -720, -4476, -3863, -920, + -2135, -458, 352, -2645, 3029, 301, -1145, -478, + 3696, -11700, 9930, 6649, 7290, 2362, 17226, 3238, + 1786, 662, 971, -736, -647, 1745, -506, -777, + 1458, 2406, -1417, -7933, -846, -2654, 1104, 618, + -2783, -10168, -3322, 9498, -939, -2342, -1876, -1914, + 84, 3468, -6533, 7796, -3797, -1318, -2183, 1310, + -895, 4943, 1062, -4468, 142, -244, 884, 613, +-13963, -5853, -947, 18703, -964, 1090, 1070, 1388, + -1572, -1110, 671, 1706, 620, -262, -2421, -2277, + -5665, -5212, 4994, 2379, -593, 2048, 14489, 1165, + -1775, -2093, 2466, 419, 404, 5429, 3089, -1350, + 1975, 2281, 60, 599, -1600, 2286, 2358, 6698, +-16423, 3760, 666, -1309, -1346, 2786, 2364, 1448, + 1114, 17956, -5301, 2430, 1178, -164, 2195, 3927, + -122, -737, 1468, 307, -1863, 1592, -7714, -2428, + 958, 220, 59, 4124, -1945, 11151, 8604, -2077, + -4787, -4578, 1096, 2685, 6478, 8314, -6221, -3842, + 2173, -43, 104, -2510, 3109, -2324, -4238, -4709, + -3233, 3228, 11454, 2428, 578, 780, -1096, 72, +-22624, -1421, -4104, 226, 464, -1726, -1971, 2068, + 1142, 1412, 1412, 798, -2605, -3451, -1104, -2224, + -2250, -3470, -572, -1420, -1292, -58, -217, -21417, + -172, -6368, 30, -2170, 95, 378, -2926, -2180, + 2820, -683, 2018, -4313, -13469, 5396, 1808, -592, + 4732, -6602, -5602, -983, -4130, -477, -1236, -2263, + 3992, -12962, -1778, -2631, -2421, -746, 1964, 1754, + -760, 2753, -116, -3860, 10246, -448, -1318, -100, +-10372, 1420, -210, 2768, 48, -2373, 7721, -3217, + -328, 1543, -2527, 3709, 4024, -916, -4588, -726, + -4302, -982, -14714, 3615, -1190, 9051, 199, 2252, + 1348, -4204, 693, 1241, -14160, -2460, -2017, 2997, + 766, -360, -450, -2919, -7976, 3210, -179, 8935, + 670, 1155, 6888, -2249, 2729, 1810, 6283, 684, + -9717, -1763, -921, -4578, 3941, -6408, 1431, -2742, + -91, -2094, -2118, -9752, 2801, -2497, 147, -5901, + -5270, 13170, 2810, 1576, -3191, 10253, 4226, -1340, + 2456, 1079, 12541, -5124, -8356, -1000, -558, 180, + -2070, -1880, -5718, -687, 10549, 1066, 220, -4147, + -695, 3648, -3460, -3143, -1623, 2150, -11222, -2566, + -6395, 3552, -4176, -698, 1248, 112, -4628, -960, + -724, 1191, 2084, 15207, -346, 371, 190, 5345, + -4283, -7482, 1354, -4424, -3775, -4143, 1444, -14876, + -589, 2498, 1305, -486, 1628, -867, 1584, 1094, + -10, -1260, -1046, 2528, 27472, 910, -1069, 829, + -117, -1097, 770, 252, -1412, 2353, 2200, -11, + 624, 8459, 6320, -9465, 1225, 2532, 5415, 9252, + -1441, -1378, 1081, -1997, -3904, -14740, -5220, 3627, + 5725, 6180, -5336, 72, 4638, 915, -496, 628, + 1880, -420, 2800, -7143, -7578, 3180, -4210, -1111, + 2979, -442, -182, 2778, 2398, -13878, 2209, -282, + -888, 180, 3584, -1005, 2, 999, -3074, 1205, + -4605, 5250, 17255, 2839, 2718, -678, -2651, 160, + 1596, 4685, 2324, 3100, 3744, -1954, -11674, 621, + -678, -6242, -3449, -1890, 3134, -289, -7162, 2268, + -8437, -624, 4999, -5946, 13013, 244, -200, -1494, + -1108, 3768, 445, 2429, -1264, 786, -2993, 3482, + 2448, -968, -1184, 213, -772, 4931, 42, -3850, + 2020, -17970, 84, 3016, -602, 1805, 731, 3522, + -2606, -637, 25535, 680, 1083, 4138, 1602, 190, + -1854, -962, -379, -2499, 2453, -362, -4552, 4689, + 2168, -5930, -10552, -5585, -4694, 2447, 2047, 5420, + 3908, -1449, -90, -68, 496, -12713, -2127, 1406, +-10766, 2438, 2278, 2962, -6411, -22, -1966, 2814, + -1746, -383, -2381, -5981, 10920, -12354, -656, 2260, + 5200, -1908, -2275, 4276, 1174, -932, -532, 2832, + 601, 1551, -8434, -4170, -6411, 9099, -6886, 2243, + 561, 2026, -3598, -1125, 646, -5188, 6017, -632, + 772, -2919, -3776, -9938, 2461, -122, 128, -1416, + -1533, 343, 1318, -13738, -1528, -6418, -1196, 832 +}, + +.cb2224s1 = { + 32767, -749, -1885, -806, 739, -1858, 3902, 1029, + 332, -2122, 1240, 2705, 1362, 190, 1058, -1404, + 1224, 1122, 1208, 190, 1984, -1355, 1694, -21000, + -1012, 2418, -1269, -1154, 1113, 2291, -2317, 315, + 12872, -2296, -1510, 1104, 11324, -1146, -1018, 1326, + -902, 168, 647, -1828, -3838, -5682, 2732, -238, + -134, 13450, 1570, 2424, 996, -3494, -3720, 4897, + 5875, 149, -6367, 6659, -2329, 6916, 1134, 425, +-19014, -479, -1900, 3470, -1777, -811, 1723, -46, + -2103, -1298, 2929, -4279, -639, -2443, 7231, -1187, + -2145, -777, -3287, 4895, 8878, -9318, 289, 4015, + -3148, -598, 2226, 11700, 114, 3237, 9586, -4570, + 2592, 3614, -2272, -2829, -3356, -1095, -5290, 4709, + -1867, -1930, -20722, 937, 892, 1415, 1544, 2950, + 5090, 937, -1411, 123, -31, -1568, 338, -938, + 5465, 5796, 480, -2782, 3351, -2489, -383, 1529, + -5686, 2446, -693, -12796, -599, 1894, -1576, -2244, + -4686, 10165, -1085, 10050, 2681, 1138, 2544, -1809, + -806, 5278, -8730, -3740, -2343, 971, -3254, -165, + -212, -4164, 850, 233, -13694, 442, 1073, 3854, +-12926, -2001, 3468, -765, 829, 2174, 1531, -6036, +-10848, -11009, 803, 1713, 2884, 1992, 75, -2989, + 268, 346, 1998, 4798, 8976, -4632, 1863, -4127, + -612, 4790, 10946, -1296, 8009, -1351, 356, -1711, + 313, 2301, 1318, 8050, 700, 1218, 2270, -2156, + 67, 1537, 1941, 3442, 13321, 691, 2344, 2594, + 1551, 3853, 7279, -10441, 1006, -11862, 5532, -611, + -582, 2257, -2873, 3993, -5133, -2264, -2478, 1576, + 1834, -4931, 10264, -1429, -10404, 393, -3715, -1470, + -2003, 384, 4869, -6780, -1297, 1572, 1043, 6980, + -4382, -3005, 3698, 4176, -1348, -4972, 1574, 9815, + -5995, -979, 3609, 3702, -8503, 668, 3354, 2552, + 9183, -1175, 1224, -2859, 11176, 6088, -1355, 84, + 1271, -380, 5336, 299, -690, -365, -8047, -3679, + -3204, 1334, -13451, -1392, 2200, -3646, -1046, -4292, + 741, -1701, 1722, 2061, -1358, 7266, -6356, 963, + 2190, -1349, -1882, -14128, -4662, 3552, 565, -1109, + 5413, 1239, -2618, 794, -2064, 11805, 9004, -2134, + 2804, 946, 80, -2387, -1205, 11, 1642, -1825, + -2324, -5018, 4208, 5285, 661, 12430, 1907, 784, + 10864, 340, 18, -138, 2885, -2247, 17, 334, + -3172, 2977, 970, 536, -1540, -516, -488, -512, + -1334, -1930, -2418, 1078, 24837, 12, 2060, -252, + -2536, -2206, -3179, -6785, -8842, 8736, 1393, 119, + 1652, 10126, 856, 855, -742, -289, -2208, 3831, + 6909, -6556, 2472, -245, -1729, 1460, -3014, 59, + -58, 132, 3903, -3762, -1419, 13273, 2708, -7752, + 84, 3525, -1305, -334, -13421, 5931, -4845, -2697, + 666, 558, -1102, 632, -2946, 4153, -4018, 4516, + 4875, 4460, -1567, 2233, 386, -754, 1256, 2145, + -1692, -13046, 1581, -518, 4397, 1215, -723, 3413, + -640, -5088, 1711, -714, 2536, 2433, -691, 10758, + -8764, 5541, -2071, -1662, 12955, 12998, 1252, -94, + 802, 2573, -2557, -66, -832, 106, -728, 1050, + -811, -2684, 629, -16524, 1531, -1617, 1348, 204, + 1722, 368, 554, -1752, 114, 1349, 1952, -1007, + 2626, 2035, 8148, -2539, -4296, -4460, -8542, -3089, + -1543, -857, -2617, -1765, 6642, 2167, -1531, -6881, + 86, -414, -5896, -5152, 17445, 1129, -5006, 2936, + -3432, -2226, 1176, 972, 1170, 530, 3390, 260, + -2909, -3550, -5255, 1771, -382, -1690, 17070, 2688, + 566, 2430, -1768, 3373, 1460, -3464, -629, 3119, + 430, -3554, 8357, 7075, 293, 2955, -61, -6919, + -4939, 3678, -6852, 652, 2206, 5918, -2768, -3022, + 5721, -770, -1102, -1057, -2760, 3086, 5611, -160, + 2714, -1042, 2569, -14248, 3846, 8212, 5392, 144, +-11896, 618, 1212, 3283, -3777, -715, -3870, 2528, + -2900, 1645, -1786, -1852, 2776, -1348, -586, 234, + -4, -1666, 46, 2095, -1987, -18728, -2980, 2501, + 4042, 79, -1849, -2013, 8047, -1898, -108, 340, + -4760, 2134, 9000, 347, 10365, 4779, 6660, 1694, + -3253, -2282, -1488, 10406, -8054, -3414, -2934, -1611, + 3172, -2195, 4973, 1249, 2888, -4054, -5738, -2995, + -2282, 1977, -353, -516, 5322, 3225, -4907, 1303, + -4656, 9947, -236, 9382, 2332, 2076, 1470, 3173, + 4712, 2645, 559, 4904, 1511, -1715, -4856, 5750, + -1276, -306, -5980, 14393, 1443, 85, 156, 7718, + 793, 4199, 2122, 1098, 128, -1996, -1397, -20, + -534, -13296, -1518, -2970, -1001, -6474, -6146, 8337, + 5476, 3058, -526, -1295, 1623, -8791, 1257, 2006, + -5725, 3035, -2917, 1280, -8479, 5934, 9870, -13131, + 14, 1088, -9, 1969, 366, -3214, 192, 2764, + 1499, 346, -2031, -2900, -2529, 1072, 11717, 5206, + -44, -2514, -8900, 2892, 2132, 3635, 3735, 2726, + 1398, 6035, -2830, -4568, 424, -8696, 1368, -3860, + 1823, -2620, 4546, -2210, 1660, -1672, -10524, -484, + 950, 11, -4494, -6220, -5653, -13332, 2868, 460, + -4120, -4030, -3277, 522, -3403, 1126, -170, -1892, + -4366, 1304, 3477, -1507, 1111, -594, 1670, -8416, + -1690, 2492, -7109, 2531, 4131, -8123, -4884, 16505, + -240, -63, 32099, 974, -1360, -2395, -2005, -1156, + -877, -416, -922, 1857, 766, 71, 1380, -259, + -272, -1924, 2498, -3290, -16045, -2064, 2966, 2936, + -1265, 2121, 488, 3781, 1484, -1193, 4776, -1001, + -669, 1569, -379, -604, -5, -1943, 757, 359, + -560, 118, 17941, 2323, 215, 7621, -3582, -8130, + -698, 9893, -2752, -417, -1262, -1504, 3319, 1186, + -2192, 3014, 781, -3602, -6190, -7725, 3169, 2038, + 1175, 612, 2477, -4136, -12152, 4538, 567, -116, + -3222, -470, -118, -9257, -635, 3078, -11596, 93, + -4178, 4150, 5985, 4414, -2110, 542, -1125, -1242, + -234, 807, -1385, -2448, 824, 109, -1826, 3032, + 269, 14188, 3468, 908, -12, 2290, 5758, 1685, + 680, 5963, -2763, -173, -34, 3135, 1230, 2226, + 2471, -9546, 2266, -1583, 729, 3506, -10664, -652, + 2212, -620, 2762, -751, -6337, -4339, 4131, -1234, + 5423, -2279, -2884, -929, -12582, 416, 2046, -3854, + 11130, -2738, -670, -202, 6216, -7266, 9726, 1308, + -1761, 4696, -1061, -144, 482, -1586, 4377, -5016, + -3894, 2296, 4340, -555, -3003, -2117, -962, 100, + 4548, -1870, -13885, 1351, -3226, -8114, 377, -391, + -1344, -2148, 4756, -3518, -14429, -670, -238, 400, + 1234, 4389, 1181, 1046, 425, -32, 840, -29846, + 1580, -992, 1844, 1961, -1305, 1055, 418, 52, + -641, 2430, -1773, -5323, 3341, -5367, 14027, 3051, + 3864, 404, 4186, -1875, -5822, -4321, 112, 395, + -177, 1080, -3008, 520, 8, 226, 1430, -1635, + 8, -2632, -3249, -3595, 622, 564, 8404, 14463, + 160, -7828, -4113, -16547, 848, 6320, 2311, 4074, + -2050, 668, 1463, -2322, 1790, 864, 317, -594 +}, + +.cb2224m0 = { +-17338, 5737, -912, 5906, -5315, 920, 2743, -2232, + 1943, -753, 1696, -1818, -2272, -564, -1306, -527, + -156, 9952, 36, 2524, 2053, 1841, -1670, 10622, + 2532, -5616, -324, -1132, -1148, 1920, 10232, -75, + -630, -10796, 1618, 1104, -2557, -603, 2115, 966, + -3763, -3183, -851, 4502, -1565, 10062, 313, -709, + 10707, 867, 3820, -2747, 3470, -1942, -486, 4092, + -6289, -2363, 556, 3190, 5046, -1869, 2886, 10572, + -948, -4191, 1544, -1727, 721, -3153, -712, 934, + 1610, 1070, 1248, 10645, 2340, -11102, -2744, -353, + -65, -4973, -1782, -1037, 1210, 1192, 1138, 1106, + 9422, 652, -9595, -1663, 460, 9107, -2827, 775, + 1131, 4732, 93, 476, 387, 32767, -161, 266, + -406, 604, 675, 83, -589, -639, 220, -830, + 2200, -142, -2000, -128, 902, 823, 287, 717, + 1857, -1626, 208, 2784, -72, -19310, 6190, -2063, + -9101, 3419, 1721, -2092, 332, -6533, -7594, 1138, + 807, -2582, -668, 410, -497, 1526, 96, 944, + 3319, 1294, -335, 1964, -380, -618, 3069, 101, + 18964, -2298, -10304, -1190, -998, -1384, -11466, -256, + -4475, 4027, -3532, 1828, -1311, -3417, -3925, -221, + 27688, 2277, -1227, 1043, -399, -3327, 515, 1665, + -616, 2724, -546, 4608, -576, -103, -9064, -1281, + -563, -3588, 2174, -824, 3379, -2360, 354, 844, + -7044, -2295, -2613, -11152, 1006, -1064, -17007, 1180, + 387, -8448, 836, -578, 2621, -356, -1476, 2362, + 822, 4547, 118, -11628, 352, 367, -958, -12423, + -65, -1591, -2304, -2880, 1684, 1708, -1693, -781, + -71, 10012, -534, -3672, 417, -2048, -1955, 10491, + -1257, 861, -414, -4058, 3042, 1529, -5823, 6877, + -3918, 993, 221, 2576, -7780, 170, -648, -139, + -3410, 7974, -756, 2657, -596, 12527, -199, 13752, + 2198, -938, -2265, 1736, 257, 1517, -676, -1165, + -2874, -2433, 123, -829, 2605, -10270, -3158, 3624, + 2072, 6960, 1490, 4634, 455, -8175, 1139, -4545, + -1491, 3727, -8738, -1951, 593, 14, 2897, 2490, + -2273, -1436, -10992, 3005, -4392, -3434, -4561, -1014, + -9506, -1609, -1248, -1593, -190, -10472, 3264, -2274, + 5097, -633, 473, 427, 725, 1577, 11032, 318, +-12228, 78, -1116, 441, 1930, 4041, -648, -4324, + -224, 2738, 8826, -40, 327, 1761, 2371, 171, + 4039, -3411, -2495, 1150, -12181, -1704, 35, 528, + 417, 626, 1866, -472, 466, 905, -854, -875, + 1194, 24371, 488, 26, 695, 1777, 798, -169, + -16, -1252, 395, 871, 1170, -635, -1637, 2094, + -5427, -16393, -384, 3872, 33, -687, -1777, -4160, + 3020, -1906, 3868, 699, -400, 6755, -3253, 12699, + 1474, 7312, 991, -646, 26770, 2524, 2144, -500, + 1096, -1869, 1036, -1707, 521, -2091, 1445, 2335, + 107, 238, -227, -120, -32768, 591, -257, 867, + -1231, 650, -465, 356, 431, 762, -516, -594, + 512, 242, 2298, 1012, -1538, -11748, 3551, -5608, + -2174, -2428, 10557, 625, 1002, 27865, -589, -1527, + -1552, 156, 1905, 1041, -4190, 2300, 1603, -980, + -1764, 484, 1555, -2664, 381, 11676, -8848, -3060, + 675, -646, 736, -1279, -1261, -1988, 543, -1880, + 1917, -2165, 2846, 11863, 2076, 10381, -307, 4354, + 73, -2788, -2464, 964, -218, 1552, 1846, 1470, + 577, -594, 725, 30798, 43, 13, -1474, 260, + 1218, 1433, -114, 1020, -648, -678, -1879, -65, + 791, 366, 8547, 931, 1091, 1018, 16312, -1116, + -777, -1098, 404, 180, -899, -2865, -10089, -751, + 40, -2358, -2980, 3574, 7905, -190, 9207, -18, +-18766, -270, -5300, -2023, 2422, -1189, 1267, -1085, + -704, 6823, 2164, 2, 125, -2319, 411, 591, + -488, -566, -3394, 304, -12375, -268, 11098, -150, + -2392, -1255, 3172, 162, 1295, 5897, 7944, 6019, + 3329, -2014, 2957, -4933, 4805, 2780, -5453, 2680, + 3220, 2784, -549, -19908, -1222, 550, -3540, 1822, + 4082, 2399, -6844, 2145, 938, -597, 122, -20, +-14986, -1620, 1575, 561, 408, -6305, 760, 1634, + 2652, -8301, -2988, 1864, 2524, 3228, 7466, -2620, + 410, 1364, 1740, 2204, 1999, 1704, -2601, -351, + -104, 10688, -7166, 134, -346, 11852, -13322, -3171, + -1230, 1109, -2336, -962, -563, 1030, 2832, -969, + -1997, 3233, -414, -8246, -2074, 2737, 3557, 1625, + 1036, 845, 1848, 1710, -10388, -4586, 6915, 2734, + -8693, -667, 1568, 1758, 2396, -3262, -2497, -1472, +-11848, -689, 3379, 1692, 1449, 2844, 8524, -15598, + 337, 590, 3303, -1594, -2548, 4529, 433, -1921, + 920, 1061, -1693, 191, 44, 957, -2397, -1126, + 41, 2164, -1587, 568, -17290, 4687, -1028, -403, + 1169, -1282, -1602, 242, -1234, 1870, 1067, 2444, + 1752, -2552, 8775, 1384, 5683, -4770, -12436, -680, +-13344, -196, -276, -299, 734, 12378, 2364, 327, + -1494, 560, -90, 3394, 496, 2357, 629, -17, + 1040, -706, 589, 294, -1135, 25012, 444, 1206, + -298, 1424, 1524, -2188, -64, -1101, -1998, 374, + 1377, -1382, -11349, 1456, -171, -2369, 6966, -2808, + -8987, 3390, -811, 671, 3032, -3396, -9815, 2246, + 4418, -678, 1851, -1592, -11038, -1194, -3612, 2589, + -250, -495, 1203, 1348, -805, 1853, -345, -555, + -8755, -9695, -3768, -1506, -8172, -322, -7163, -6319, + 2052, 116, -4459, -2328, 4857, -2569, 1419, 959, + 1138, 7034, 4836, 3449, 6826, 13411, -893, 981, + -2060, -3710, 3177, -761, -1128, 4386, -127, 6698, + 3426, -2922, -61, 408, 1426, -1238, 15468, 94, + 373, 3597, -2432, -1989, -859, -8976, 2938, -777, + 409, -206, -7758, 3384, 295, -466, 29, 7925, + 2048, 930, 2296, -10030, 330, 7864, -1004, -385, + 2130, 388, 3587, -4480, 1560, -12768, -2606, 8178, + 771, -3519, -1590, -592, 2192, -1126, -77, -3947, + 1868, -1304, 11107, 781, 6240, 4134, -3314, 407, + -6125, 5168, -503, 2155, -990, 143, 219, -9950, + -1186, -1446, 1930, -8963, -4084, -6141, -976, 153, +-13665, 564, 13631, 138, -269, 379, 1333, -1710, + -940, -511, 1214, -2190, 1347, -1397, -1321, 94, + -1802, 6627, 1306, -12347, 2780, -1091, -4362, 5047, + -446, -3472, 6064, 1075, 478, 769, 58, 802, + 562, -1581, 28580, 194, 1338, 573, -555, 617, + -409, -1249, -8, 1133, 952, -120, 2502, 5313, + 969, -1664, 1769, -12199, 5551, -402, 4862, 3270 +}, + +.cb2224m1 = { + 32767, -54, 1385, -206, 19, 522, -1176, -667, + -260, -1388, -1751, -2234, 228, -343, -893, -898, + -1004, 2517, -232, 20996, 507, -1857, 2574, 840, + -615, -1922, 660, 844, 52, 1272, 609, -692, + 21805, 938, 678, -399, -22, -1839, -996, 1560, + 218, 3973, -6547, -1151, -3914, -789, 938, -11509, + -2282, -606, -327, 3088, 797, -1540, -7598, 1378, + -100, 2108, -1907, -11671, 1538, 11136, 310, -2096, + -3037, 3181, 1731, 2043, 3424, -1098, 2046, 545, + -1778, 605, 932, 832, -2356, -1498, 1129, 11542, + 119, -10994, -3720, 4316, 346, -9141, 3921, -918, + -5476, 372, -318, 9254, -681, 4896, 1587, 1620, + 1850, 4057, -1507, -362, -1074, -328, -1502, -3092, + 2735, -378, -11572, -1292, -2575, -3397, -7566, -8977, + 1670, 8659, -655, 884, 1815, -9348, 570, 394, + 1670, 1942, -195, 386, 553, 8885, -9206, -624, + -2312, 15852, 782, 562, -1497, 720, 1804, 1415, + -3809, 3783, -1918, -3496, -637, 581, 1161, 961, + -960, -930, -1673, 904, 11510, -2286, -9964, 2964, + -5752, 2229, 786, -1479, -18882, 1517, 128, 3282, + 157, -2178, -564, -6029, 766, -4599, 3620, -4380, +-20114, -677, 2134, -93, 1486, 648, -4790, 1862, + -1476, -56, -3443, -2622, -2806, -1185, 122, 1801, + -1547, 12241, -2785, 2386, 56, -4075, -10964, -832, + -4744, -1350, 2849, -255, -1375, 163, 1306, 37, + 2304, -1396, -11234, 9712, 1732, -2262, 3632, -431, + -579, -4045, 806, -12168, -1309, 840, -1474, 918, + -1240, -1601, 48, -4137, 6934, 3968, 7370, 4088, + 8648, 2351, 1466, 615, -12314, -2347, 4382, 862, + -4288, -3138, 1886, -4357, 375, 1949, 73, 287, + 135, -60, -1498, -2427, 1263, 3322, -582, 17508, + -1202, 1558, 3351, 484, -439, -571, -370, 11952, + 11656, -1407, -1410, -2976, -459, 397, 1980, -1374, + 1237, 5044, -2074, 405, -10650, -174, -12556, -1962, + 4569, -1293, -200, 3106, 343, 748, 1918, 1084, + -670, 3, -1070, -397, 3965, 9966, -609, 9691, + -900, 137, 2305, -5944, -944, -1500, 638, -703, + -582, 10098, -523, 776, 1266, 4860, 6213, 1181, + -5634, 518, 9116, -4740, 10683, -547, -1295, -91, + 104, -3115, -1724, -17, 1953, -745, 694, -474, + 12248, -596, -674, 765, 674, 4494, 1205, 5883, + -1638, -3996, -664, 8694, -5620, 3968, -717, -10425, + -285, -12605, 368, -3904, 12363, -1288, 1242, -1497, + -3117, 2396, -220, 1700, -2788, 250, 107, -150, + 345, 681, -44, -2466, -389, 2098, 312, 54, + 2734, -22225, -1232, -1778, 1063, -1586, -6658, 344, + -2889, -4348, -3685, -2100, 12, -1755, -6401, -149, + 8150, -10689, -748, 1443, -32768, 1698, 1461, 216, + 1373, -2814, 1014, 1135, -227, -1309, -616, 1566, + 395, -724, 852, 1579, -9647, -1214, 728, 329, + 9244, 179, 7204, -836, -3954, 168, -5722, 152, + -2886, 472, -651, 5114, 8734, -71, 11406, 1098, + -1452, 1190, 598, -880, 14611, 12540, -1523, 1340, + 1015, 1510, -208, 206, 1314, -1532, -246, -3210, + -1637, -197, 197, -32768, 1448, -191, -1720, -217, + 1021, 973, -2099, 56, 606, 39, -1569, -1205, + -2375, -2156, 4798, 2504, -11914, 933, -6015, 2657, + -2911, -5173, -1964, 1576, 5268, 1190, 675, 856, + -1718, -4332, 166, 1556, 19005, 2040, 1198, -2170, + 1824, -3409, 121, 830, -252, -525, 289, -1701, + 292, 854, -1150, -1108, 171, 511, 22114, 662, + -1263, -540, -2306, -2332, 869, -5191, 186, 536, + 410, -7576, 590, 13625, 3519, 3858, -2787, -376, + -6506, 891, 5025, -2054, 8316, -2115, 7668, -5808, + -2464, -2422, 1541, -3851, 1578, 420, -617, -6507, + -858, 160, 3876, -2830, -5970, -3295, 9829, 1099, + 1617, 3502, -3124, -4116, 138, 287, 914, -548, + 1056, -1546, 1218, -227, 11632, -574, -996, -9894, + 808, -5868, -1457, 8374, -2086, -280, 1038, 528, + 1862, 284, 3926, -144, 7168, 1224, 11628, -221, + 1018, 1683, 922, 561, 6910, 1895, 3044, 12613, + -74, -1424, 1654, 8872, 2255, -990, -2039, 269, + 9558, 10122, 958, 466, -1948, -1242, 1042, 886, + -1143, -3444, -8720, 1918, -300, 19074, -1629, 991, + 908, -896, 1207, 3602, -4802, -2912, 4100, 2936, + -1344, 459, -6904, -714, 524, 171, -1430, 1454, + -2725, 1130, -757, 2861, -11174, -2768, 5466, 3662, + 110, -1999, 12376, -2173, -2508, -2838, -2025, -4378, + 134, -9856, 1738, 1027, 1428, 38, -1560, 12824, + 13932, 549, 586, 720, 923, -1040, -2827, -3272, + 1902, -2113, 2624, 3296, -34, 12291, 1449, -12138, + -796, 186, 2777, -1007, 3276, -587, -1917, -130, + 2120, -564, -364, 1005, -615, 1504, -2412, 9219, +-11412, -2490, 1262, -2720, 1608, -3276, 1294, 1882, + -188, 7090, 6029, -4207, -2739, 72, -10035, -1672, + 1509, -124, -1649, 420, -3623, -1069, -11225, -754, + -388, 790, -3209, -330, -2632, -11920, 3178, -1788, + 2585, 4146, 1944, -2757, -10616, 220, -14136, 2158, + -274, 2010, -362, 1107, -348, -1990, 96, -985, + 1599, 1566, 1393, 304, -1380, -924, -285, 620, + -30, -902, 26210, 1485, 1042, -1160, 352, -177, + 1245, 1879, -18, 727, -421, 223, -1298, 1066, + 962, 1306, 3866, 870, -18780, -3873, 107, -1408, + -1261, 808, -818, 1738, 1439, -2156, -1499, -2108, + -4626, 4039, -964, 16682, -1169, 266, 9373, 1238, + -2728, 2381, 12159, 2155, -472, -2293, -513, 3808, + -690, -2190, -1139, -6, 1379, -22803, 1380, -612, + 308, 1394, -902, -1454, -2620, -1080, -2864, -3301, + 108, 218, 8718, -617, -1098, 1436, -2005, -3966, + -2658, 6152, -874, -4636, 8705, -3382, -12072, 418, + -1837, -12582, 270, -788, -1174, 2156, 461, -297, + 478, -632, -356, 5796, -12024, 416, 2602, 3544, + -1240, -970, 4874, 7221, 704, 8940, 2316, 1174, + 2537, 5380, -5, -1818, 3020, -4120, 7042, -9618, + -1622, 3576, 2455, -298, 451, -5298, 7371, -1570, +-12956, 9758, -216, 889, 5395, -2779, -4036, 1736, + -1871, -2036, -1119, 1847, 912, 2292, 850, 220, + 1300, 2228, 399, -2885, -2696, 2399, 3179, 6266, + 1629, 13091, -232, -5322, 1397, -724, 1666, -2012, + 3643, 1400, -2724, -18007, -506, -103, 1318, 2473, + 965, -587, 1135, -904, -510, -10767, 1937, -585, + -73, -1662, 3021, 340, -12475, -1618, -1, -1914 +}, + +.cb2232l0 = { + -9947, -673, 522, -36, 396, -433, 949, -442, +-12495, -2186, 4280, -997, -1715, -7385, -379, 3498, + -572, -9897, 6686, -4736, 577, 1866, 659, -123, + -1682, 420, -866, 4458, 5821, 3155, 7929, -5562, + -1798, 3086, 8556, -65, -8943, 2354, -4187, -3798, + 627, -1859, -9760, -1811, -1724, -45, -1838, 1638, + 499, 148, -335, 20916, -264, -556, -269, -1014, + -1531, 711, -519, 462, -5117, 3944, -950, 8277, + 878, -4803, -5003, -4402, -4722, 2988, -144, -6887, + 10661, -909, 700, -2287, 12126, -101, -761, 1836, + 827, -609, 538, 442, -4504, 1812, 3818, 7359, + 96, -555, 1598, 10040, -554, 924, 3426, -1786, + 2620, -2132, 867, -519, -2299, -672, -508, 201, + -2457, 10872, -5003, 5422, -8890, -104, 2579, 940, + 401, 871, 11167, 1216, 1054, -2876, -1523, -3950, + -1229, -3410, -428, 3648, -9389, -3025, -1752, 7583, + 3953, 1938, 3899, 1435, 8170, 1019, -2320, 1299, + -1152, 226, 394, 11328, -1471, 604, -184, 567, + -3704, -5723, -5938, 423, 9362, 4546, -3318, -3395, + 5084, -4341, -1781, -2619, 1078, -365, 151, -413, +-21591, -968, -202, -183, 849, -481, 407, -11, + -2708, 2472, 2689, -9232, -9482, -1776, 645, -1510, + -1410, -6115, -114, -2550, 1922, 1668, 288, -1302, + 948, 1967, 52, 2393, -1975, 374, 17358, -1332, + 5303, 3195, -2674, 4784, -1418, -1359, -57, -2126, + 4618, 8890, 6455, 1181, 76, 374, 9585, 8762, + 672, -642, 666, -6485, 1751, 3255, -934, 6196, + 892, 171, -102, -44, -326, 1330, -320, -480, + -842, -22376, -561, -141, 635, -6528, 5711, 2400, + 838, 2846, -3212, -5341, -5479, 4961, 2110, -7480, + -4215, 7964, -1308, 1219, 1541, -4418, 6293, -4522, + -4887, -5760, 2790, 1441, 6135, -1133, -1627, 1235, + 914, 572, -1043, -1473, -519, -4618, -1228, -12212, + 1101, -10794, -4292, -4355, 6431, -588, -992, 612, + -1771, 6751, 4871, 581, 620, -352, 277, 727, + 2226, 8552, -43, 2295, 9409, 1122, 7618, 1885, + 1192, -1432, -1103, 8666, -2078, -403, -1787, 1572, + -2200, -7705, -6743, -1277, -1228, 955, 7613, -1536, + 8530, 5703, 5446, 4251, -853, 4910, 1578, 2832, + 1274, -2610, 243, 2820, 951, 9240, 1617, 605, + -6755, -2728, -5658, 3866, -157, 1215, -8470, -2038, + -189, 10411, 7444, -376, 407, -1128, 770, -410, + 503, 1707, 786, -529, 82, -27, 21512, -282, + 81, -1129, -686, -555, 2674, -99, 1284, 2216, + 1238, 404, -3398, 1010, 3966, -1134, -2682, 14222, + -1581, 9779, -1114, 848, 1905, 2129, -3937, -4742, + 1229, 8051, -4344, 3914, 4273, -659, 159, -1188, + -1844, 912, -1256, -478, -16158, -2869, 959, -2096, + -2166, 2360, 7861, -2718, -6358, 7653, 6639, -3239, + -1690, -1242, 3439, 1254, -954, 604, 17512, -288, + 2412, 211, -298, 2656, -5217, -1770, 892, 1979, + -1482, 3498, -40, 10424, -1038, -1862, 9905, 298, + 77, 2179, -4444, 2580, -2069, -6473, 61, 84, + 1035, -645, -662, -824, -743, -104, -1962, -124, + 4976, -5378, -1254, -7055, -3474, -10695, -1254, 2547, + -694, 3194, -82, -2634, 230, 358, -12, 1594, + -90, 598, -76, -21136, -1278, 846, -84, 259, + -2536, -4442, 2337, -1606, -3264, -3126, -591, -1295, + -2440, -2592, 10888, 5821, -862, -5070, 10402, -10633, + 159, -2660, 894, -2112, -1774, 3732, -1020, 422, + 9487, 1608, -992, 2046, 275, -10676, 2606, -999, + 477, -1868, -1690, 4764, -6419, -7550, 8159, 529, + 2308, -394, -2394, 2826, 6680, 496, 3628, -646, + 3186, -657, -2260, -1416, -9202, 496, 6624, 2441, + 1554, -2195, -8458, -3459, 466, 6706, 1056, -8777, + 5436, -4000, -3130, 4794, -6127, 2008, 1602, 195, + 558, -1362, -880, -2662, 9726, -9793, 2989, -3182, + -2378, -1338, 1086, -4682, 372, -399, 11129, -601, + -666, 5206, -1106, 362, 3155, 328, -9862, 719, + 1602, 998, -2342, 857, 1510, 476, 7256, 4652, + -5750, -4991, 4611, 8718, -4434, -4119, -351, -1606, + -1033, -3717, 3585, 9381, -1594, 5052, -7414, -205, + 2356, -5949, -8738, 1526, -1838, 4760, -5444, 623, + 112, -2863, 5710, 4920, 9497, 3759, 10748, -201, + 716, 747, -2559, -4077, -449, -741, -136, -1303, + -572, 1886, -986, -10529, -51, 1360, 2418, 116, + -1490, 1928, -9977, 4720, 227, -11212, 3730, -2996, + 1300, 9935, 356, -4618, -384, 972, 3174, 3732, + -803, 2666, 790, 2067, 2343, -1209, -10147, 21, + 9066, -4564, 2508, -176, 264, 9834, 3360, 7278, + 9386, -1274, 522, -50, 4150, -884, 592, -688, + 309, 20750, 672, -1326, -346, 366, 2058, -607, + 633, 620, -677, 330, 69, 432, 319, 436, + -300, 21845, -318, -676, 320, -386, 889, -724, + -1394, -2664, -431, 2046, -136, 5520, 6700, 1192, + 5779, 9386, -3541, -5638, -16125, -259, 545, -267, + 1972, -2366, -43, 615, 251, 1003, -980, 2262, +-10519, 12166, 2007, -884, -1560, -1250, -491, -438, + 820, 1212, 3512, 354, -1066, -46, 98, 315, + 8532, 944, -1297, 8011, 1029, -383, -1606, -8381, + -1650, 2852, -958, 1757, -4270, 2160, -9283, 2918, + -3718, -224, 6154, -5671, 3764, -554, 5214, -2526, + -31, 547, 6, 1633, -4562, 1424, 1177, -866, + 1648, 653, 6056, -1845, -1271, -350, 596, -2286, + 9893, -6594, 1099, 630, -537, 230, 972, -134, + -491, 79, 306, -74, 253, 208, -1804, 73 +}, + +.cb2232l1 = { +-11397, 378, 12845, -1813, 342, 329, 1165, 550, + 556, -115, 755, 117, 2511, 260, -1189, -1406, + -1528, 1866, 3300, -9678, 1025, 10413, 199, 2878, + -3572, 8701, -1895, -1189, -576, -3384, -162, -10866, + 3253, -1267, 91, 2277, -86, -3394, 6576, -2475, + -1136, -4295, -1610, -8064, 297, -8908, -4433, -2954, + -82, -11426, -4610, 2063, 1522, -7972, -495, 1799, + 2922, -5179, -865, 4739, 11072, 3927, -483, -11111, + -2375, -1432, 1210, -1342, 2418, 1688, 852, -64, + 133, -4582, -7136, 10558, -3417, -3162, 2033, 3149, + -3050, 2532, 568, -2444, 4082, -2859, -10350, -4983, + 6633, 230, 5954, -1140, -657, -998, 1156, 736, + -8894, 64, 939, -260, -1704, -526, -1330, -869, + -2427, 12377, 1296, -120, -10560, 1794, -9090, 1487, + 7162, 519, -382, -3234, -66, 1294, 2363, 1482, + 498, -4053, -752, -154, -587, -293, 16533, 65, + -1211, 1666, 291, 2820, 2222, 2, 865, 344, + -1206, -1214, -2162, 8842, 11063, -2093, 1896, -857, + -144, 321, -9548, 4464, 5038, -282, 1160, -194, + 823, 3479, -8234, 5834, -320, 7114, -184, -2663, +-11670, 472, -2013, -1282, 4390, 4453, -2126, -2483, + -900, -6262, -2237, -539, -1134, 164, 426, -8969, + -1746, -1960, 8172, -2127, -19948, 657, -712, 344, + -443, 458, -564, 56, 756, -157, 274, -1324, + -3372, 2981, 635, -9454, -4916, 2884, 2316, 8200, + -1452, 2135, 1785, -1054, 82, 5007, -4164, 642, + 9241, 5091, 1002, 2467, -8409, -854, -861, -2317, + 405, -1810, -793, -7907, 496, -1005, 3373, -1016, + 9527, -542, 1672, -9105, 280, 11170, 273, 908, + 89, -233, 10850, 870, 436, 1630, 3328, -499, + 5091, 1224, 9135, -480, -1134, 2428, -2904, 5077, + 2014, 2859, 4277, 7763, 8719, -11474, 1619, 1167, + -3188, -1063, -433, -4291, 2646, 1024, 2008, 317, + 746, 327, 6824, 1174, 8978, 5254, -8948, -136, + -2602, -1442, -698, -950, 1800, 296, -1016, 1653, + 3771, -9326, 4536, 7033, 4729, 6630, 1042, 167, + 11485, 12338, -147, 2834, 611, 1844, -313, 486, + -916, -887, -1423, 642, 242, 75, -1875, -645, + -1239, -2118, 1458, -272, -1703, 949, 778, 21826, + 214, -1320, 310, 2680, -1542, -2202, 1072, -132, + -2067, -3593, -8293, -10331, 9030, 402, -2702, 2984, +-12068, 3170, -1098, -1175, -1188, 2998, 1159, -1712, + -904, 236, 42, 823, 548, -546, -1954, 15989, + -2212, 1886, 2300, 2293, 2606, 2905, 2365, -1214, + 1592, 1362, -2210, 1674, -1892, 15049, -1012, -2824, + -792, -11447, 11144, 4853, -357, -1230, 748, 1212, + -294, -424, -2720, 78, -2149, 966, 7794, 1645, + 138, -709, 464, 3614, -10308, 310, -4726, -3694, + 1088, -576, 690, 68, -145, -3282, -9280, -9537, + -1274, 3202, 588, 1790, 1437, 3880, -1803, -1154, + 15082, -2388, -1746, -885, 2267, 1813, 1688, -1039, + 9775, 350, 3218, 10550, 1048, -3731, -3748, 3517, + -910, -663, -413, -1045, -1236, -248, -132, -1196, + 12, 15815, 653, 1429, -371, 4094, -3050, 567, + -5524, -11128, -4261, 1929, -1719, 8236, 686, 1309, + -1057, -715, -2586, 1327, -38, -6180, 3499, -2080, + 8980, -1890, 62, -1004, 3308, 5809, -5778, -3865, + -610, 180, -519, 3129, 9000, 1607, 8484, -4056, + 4741, -4491, -355, -1324, 1203, -1864, -811, -15995, + -121, 1325, -817, -2170, -5753, 731, -1875, -2286, + -9193, -307, 247, 2469, -1738, -12290, 31, 1028, + 670, -66, -1856, 570, -3542, -3401, 144, -320, + -524, 184, -928, -1606, 10978, -3114, -8861, 1467, + 1156, 872, 8276, 5655, -695, 2788, 3733, 2155, + -2044, -10260, 1683, 1859, -263, 17966, -19, 1621, + 50, -261, -4143, 1245, -22, -1564, 809, 2462, + -8005, 1247, -1471, -763, -1686, -698, 2868, 796, + 4036, -3672, 11209, 1102, -9369, -1008, 1273, -906, + -4458, 1642, -3254, 3563, -94, -6267, -604, 8687, + 2388, 2214, 1759, -7788, 4296, -7467, 3547, 3248, + 845, -7784, -2195, -42, 5327, -1002, -3915, -4581, + -1215, -919, -3444, 5142, -1874, -3020, -2627, 1129, + -4456, 1840, -11472, -914, -6366, 3495, -2775, 484, + -5859, 980, -1967, 1350, 929, 6856, -3952, -3365, + 1514, 7423, -675, -2260, 6027, -3072, -6388, -3716, + -2398, 5564, 1447, -86, 1180, -1239, -1372, -435, + -1314, -1978, 942, -2018, 1027, 704, 20417, -94, + -1239, 252, -171, -1100, 1684, 1401, 623, -354, + -2674, -5042, -734, -6631, 7587, 4901, -1596, 6806, + 4230, -859, -867, 1266, -3869, -3972, 1548, -4889, + 2811, 2263, 2468, 354, -6197, -1278, 1947, 5675, + 10612, -1730, 2056, -70, 3034, -583, 879, -3719, + -8623, -1241, 822, 5832, 163, -1075, -784, 398, + 1170, -717, -374, 856, -21602, 89, -513, 260, + 854, 1152, 762, -601, 523, -107, 1033, 1877, + -1456, 226, -20758, 365, -8943, 1305, 193, 948, + 295, 2696, -3165, -1982, -2439, 1067, -12266, -1018, + 3400, -178, 1995, 11745, 1833, 9785, 1171, 582, + -1844, 157, -1242, -4080, 864, -1771, -4257, 721, + -4010, 7990, 142, 730, 1976, -6623, 4637, -7394, + -1143, -835, 3341, 1732, -7266, -448, 5379, 290, + 1855, 6977, 6637, -6561, -1370, -1767, -2769, -1189, + 3872, -4895, -4679, 3906, -1664, 1514, 7908, -7960, + -4147, -1235, -1706, 3314, 144, 1668, -9505, 2268, + 4147, 2515, -1451, 6475, 1675, 106, 981, 201, + 309, 60, -133, -472, 561, -380, 1130, 91 +}, + +.cb2232s0 = { +-26218, 1606, -390, -696, 266, -947, 561, -1526, + -8, 1080, -187, 5671, 2249, -30, -4129, -768, +-10908, 3826, -10422, -144, -1259, -1372, -3553, 1287, + -5151, 6442, -5101, 1386, 791, -1593, 12942, -764, + 424, -6212, 9733, 702, -9721, 524, -4818, -1232, + 6, -484, -818, 955, 6425, 3594, 5156, -286, + 1514, 4466, -1756, 11321, -679, -1481, -477, -8015, + -3059, 4476, 679, -1143, 2877, 2581, 3230, 239, + 12018, -1597, 13431, 11852, 260, 3306, -714, 1299, + -4375, -778, 170, -565, -3510, -6632, 3354, 5901, + -1070, -5912, -3430, -4970, -4712, 2648, -9113, 1561, + 1002, -5659, -3177, 638, 2289, -1050, 12310, -10364, + 2830, -961, -194, -6442, 2206, 3454, -2087, 4327, + 1080, 10257, 8107, 4904, -3141, -2339, 7568, -363, + 3765, 7960, 7067, 1496, -3842, 1805, 2415, 913, + -1641, -5411, -7583, 4597, -1324, 2882, 11310, -2570, + -2877, 3544, 4642, -2249, 7110, -307, -3413, -2871, + -8974, -6358, -5703, 4046, 83, 1887, -3476, -4346, + -2995, -346, -46, 22143, -576, 2597, 696, 1520, + 140, 2937, -3356, -988, 4090, -1246, -3347, 1387, + 2264, 1282, 7040, -806, -12810, -1105, 32767, -4266, + 108, -1998, -680, -1279, -467, -110, 462, 768, + 1678, 1408, -1888, -1115, 9430, 5852, -3578, 5367, + -1096, -4310, -9588, 4350, 6048, 2516, 3214, 4468, + -276, 15175, -848, -2875, -314, -6002, -11743, 448, + 9238, -3026, -3934, 2840, -2070, 1850, 444, 511, + -542, -7382, 6002, -14447, -1498, 176, 812, -2632, + -2291, -3312, 3953, 370, -2154, 1678, -1186, -6382, + 1544, 3534, -3767, -7459, 7265, -3272, 10669, -1677, + -7046, -1679, -132, 2108, -1948, -2938, -5393, -6222, +-11293, 2066, 981, -731, 1869, -2211, 3558, -21513, + -678, -493, -2087, 245, 635, -2011, -3316, 13445, + 2089, -10186, 1114, -1241, 2121, -2305, 3316, -1282, + 2733, 318, 3534, 4844, -1439, 8932, -7649, -556, + -7519, -3442, 5068, -3546, 8586, -8425, 7146, -683, + 665, 3052, -2581, 248, -8320, 2270, 7045, -800, + 5890, 2187, -251, -2552, -3867, 3665, -1643, -11757, + -5542, 1806, 3669, -508, -3436, 600, 10412, -5426, + 1680, -4545, 11536, -1859, -5446, -4594, -4300, -1173, + 282, 2100, -2556, 9486, -7325, -7252, -3155, -775, +-13674, 4272, 3066, 9352, 1647, 1136, 794, -520, + -654, 1539, -2244, 3155, -12039, 731, 3379, -1904, + 6866, 9669, -2384, 2099, -2426, 1633, -3358, -5662, + 2164, 10679, -5330, 7066, 5826, -187, -4840, -1174, + -3694, 976, -2548, 2292, -3517, -1007, -4041, 684, +-14986, -4789, -4135, -4376, -10678, -1482, -10466, 3575, + -1960, 3185, 1198, -196, -892, -5424, 4802, 13608, + -7772, 3952, 4404, -52, 1097, 3182, -2699, 900, + -1258, -8055, -3102, 784, -2574, 1556, 1060, -5417, + 537, 11991, -650, -487, -10250, 6766, -3716, 1062, + 2525, 1039, -3002, 5742, -502, -4583, -144, -144, + -5896, -978, 1786, -1420, 1944, -130, -5202, -1578, + 7821, -11675, 9980, 5065, 5942, -362, 16344, -801, + 1932, 1242, -10, 791, -170, -2468, -479, 3297, + 4328, 11473, -1549, -12316, 209, 1739, 1875, 1305, + -4310, -13049, -4913, 9208, -966, 2570, -138, 890, + 1373, -1324, -965, 8563, -7560, 490, -1392, 5695, + -5656, 5431, 3974, -1131, -1246, -1334, -3859, -3150, +-12976, -6929, 665, 9393, 490, 2212, 18, 542, + 229, -3925, 1836, 4223, 5268, 1200, 471, 20, + -9914, -5774, 8362, 5929, -7087, 2005, 15624, 1626, + 5419, -1492, -1536, -417, 1957, 2585, -404, -1125, + 2296, 596, 836, -356, 745, -2810, 2879, -2354, +-21682, -108, 726, -862, 593, -42, 266, -1356, + -2119, 19613, 814, 2462, -2940, 222, 3595, 5634, + -807, 1219, 2446, 5666, -1839, 7092, -10581, -5136, + -2408, 5726, -1116, -2348, -6318, 8991, 6750, -5321, + -7344, -2194, -5544, 1705, 12500, 9069, -1966, -4914, + 2225, 3537, -1485, -5141, 434, -1620, -5383, -710, + -5443, 3930, 7082, 667, -3289, -3202, -2097, 1970, +-11647, -2927, -2098, -1345, 3449, -2075, 262, -756, + 1829, -271, -1292, 1079, -5746, -344, 3660, -4456, + 3593, -7652, -1367, -828, -2290, 1063, 4234, -17596, + -911, -6068, 1040, -2956, 2704, 1763, 974, 3132, + 697, 1267, 240, -5520, -12368, 10830, -633, -5939, + 2307, 1868, -2216, -1261, 597, -6302, -5145, 3550, + 7519, -6963, 3752, 876, -1912, 30, -9192, 1075, + -4632, 9108, 1139, 911, 9290, 1268, -1006, -1718, + -6668, 3294, -1510, 6527, 456, -1400, 11424, -4168, + -3940, 4738, -4863, 2990, 3202, -441, -4744, 4623, + -4351, 3997, -11016, -737, 136, 7978, -3801, 4170, + 3602, -2217, 849, -2552, -22232, 323, 193, -4, + -1030, 590, 1625, 3208, -10595, 2624, -741, 13121, + -1044, 1601, 5175, 2199, -3833, 1804, -2314, 793, +-11486, -655, -3320, -2975, 4065, -3124, -706, -7264, + -1038, -3082, -5503, -7147, 8367, 1205, -1092, -1694, + -1078, 11584, 8, -1237, -2077, 9732, 4963, 2780, + 674, 581, 8226, -1231, -9252, 644, -3284, -744 +}, + +.cb2232s1 = { + 32767, -45, 422, -1139, -1052, -2085, -695, -612, + 1451, -288, 58, -878, 53, 2912, -1891, -7148, + 1893, 3028, 165, 963, 2260, -7904, 5857, -18824, + -2617, -1030, -872, 1500, 1118, -745, 143, -436, + 1239, -3840, 1785, -2506, 20237, -1026, -1556, -1371, + -660, -1185, 939, 1315, -3658, -5428, 587, -4105, + 1596, 12612, 5781, 1172, -3490, -1182, -333, 6258, + -2594, 2144, -4830, -190, 1972, 2687, 1327, -987, +-15046, 4659, -71, 6890, 1588, -4787, 4318, -3704, + 496, -5601, 1954, -1250, -3389, -5156, 9238, 2298, + -4945, 183, -2036, 114, 12250, -2330, 71, -3395, + -1402, 3668, 531, 10915, 1162, 7738, 9089, -1250, + 1500, 6357, 1155, -5094, -2641, 1657, 470, 2022, + 535, -306, -18031, -903, 2913, -5486, 1769, -1419, + 9082, 2149, 3516, 6960, 833, 1123, 1266, 1672, + -690, 9634, -2986, -4675, 1006, -2205, -2919, -3205, + -2759, 107, -931, -9694, 2340, -862, -2782, -3636, + -9414, 9564, 1057, 8664, 1326, 3928, 1452, -4692, + -3437, 8610, -10466, -6638, -2879, 3408, 861, -3057, + -823, 164, 3153, -3698, -15693, -886, 1456, 3278, + -6160, -57, 1110, 22, -2985, 7299, -1082, -7921, +-12212, 480, -7645, -211, 1586, 3874, 3242, -883, + 6730, -1597, -506, 3744, 7552, -7607, -65, -1442, + 266, 10012, 1594, -2628, 6988, -1049, -516, -691, + 672, 4913, 1788, 14973, 342, 962, 7212, 1124, + 500, 1135, -311, 3886, 12548, 5432, 6219, 3341, + -122, 5636, 6871, -10831, 4010, -10084, 1456, 5216, + -1013, 1102, 4164, -1490, -5186, -242, -4498, 3322, + 3584, -2176, 5704, 515, -11556, 1446, 4303, -3928, + -4227, -7268, 6069, -11330, 822, -2054, -3035, -2516, + -1816, -3796, 8408, 8849, -3030, -8201, 1149, 7388, + 1036, 2586, 5618, -2274, -5037, -1497, 384, 1454, + 8154, 1672, -2409, 3347, 13258, -979, 513, 7826, + 2662, 1818, 5537, -1104, 2645, -10632, -8767, -5667, + -1029, 806, -9040, -4684, 792, -5008, -5807, -3924, + 964, 313, -2521, 1106, -5728, 13534, -8078, 4216, + -1388, -2588, 986, -14536, -1410, 3461, 1360, -1348, + -104, 1493, -2858, -2860, 2045, 18330, 4814, -3628, + -705, -3228, -660, -2664, 2616, 4548, 3753, 1574, + -1319, -1110, 556, 3304, -2803, 13052, 4592, 2922, + 13667, -2322, -3056, -2717, 174, -4222, -4296, -7695, + 1366, 1786, 1041, -110, -1997, 4102, -1855, -900, + 203, 1311, 3412, 4107, 22609, -4112, 427, -2488, + 257, -1267, -1277, -6430, -7193, 10667, 4495, -4317, + 6846, 13213, 7335, -972, -3137, 335, -609, 3131, + 2406, -3762, 2151, -5188, -7675, 2068, -2027, 3722, + -773, -3276, 1539, -7886, 1005, 13693, 4601, -8386, + -508, 5662, -4889, 93, -10603, 4051, -2, 1094, + -4897, -2274, -2377, 2228, -5507, -464, -3455, -227, + 9433, 8093, -2245, 3701, -1047, -6827, 2037, 1926, + -3610, -15420, -581, -6127, -2075, 2501, -2216, 5385, + -2297, -2660, 1563, 3244, 1418, -2012, 2964, 12235, + -8595, 2728, -3541, -6511, 11038, 11326, -183, -1102, + 1038, 1224, 20, 1441, -349, 1240, -7737, -930, + 1411, 6945, 4130, -13544, -2625, 3550, 3149, -730, + 7658, 3098, 673, -2259, 2556, 1543, 1478, -951, + -8128, 4951, 11919, 4588, -8448, 784, -11498, -1908, + 2578, 2936, -7496, -5834, 1987, 3407, -4133, -4924, + -1348, -1300, 916, 899, 20257, 2027, 1450, 4388, + -3748, 3846, 2187, -1158, 4720, -3613, 5312, 4055, + 448, -6383, -8794, -2232, 1920, 834, 27087, -754, + 90, 1410, -985, -1381, -61, 650, 1080, 7035, + -2772, -1233, 13410, 4494, -472, -2896, -5083, -2217, + -5778, 437, -6853, 4996, 3442, 6092, -6497, -3871, + 4024, -898, -73, -3067, -2793, 5640, 6076, -2454, + 3598, -277, 1672, -6858, 2419, 9753, 6292, 8835, + -9909, -4724, -618, 7266, -416, 1965, -4968, 2421, + 1155, 3815, -116, -3725, 7872, -4901, 2383, 1612, + -2186, -2302, 2791, -2226, 1144, -13379, -6602, -806, + 7099, -2098, 4194, -2128, 8663, -4275, 452, -135, + -6053, 1280, 12815, 3278, 8452, 4479, -1648, 1453, + 1407, -966, -1016, 3173, -7333, -4552, -13176, -1744, + 577, -1572, 611, 1202, -146, -5773, 3012, -3016, + -1581, 3162, 3818, -1970, 6195, 1946, -9656, 2861, + -7875, 3133, -7840, 10951, -1684, -306, -227, 9776, + -82, 1736, 1180, 3457, -2874, 5365, -7428, 7604, + 2623, -2998, -2270, 10410, 1252, -2725, -4433, 1758, + -5225, 6522, 6698, 712, 4694, -2392, 240, 423, + -3030, -12708, -3136, -5176, 480, -1624, -12900, 7537, + 4371, 1186, -1828, -757, -1850, -974, -3755, 1415, + -6302, 2642, -3823, -1570, -8090, 8251, 1945, -9213, + 1147, 4128, -4301, 806, -1745, 704, -2496, 1375, + -802, 9, -808, -252, -5453, 3857, 10353, -536, + 1875, -2896, -10792, 3358, 1063, -890, 7200, 3660, + 406, 2840, -6973, -4469, 4638, -8091, 2772, -8035, + 1728, -5315, 7234, -2718, 3707, -1226, -11858, -2397, + 772, 3285, -4089, -1400, 1113, -16680, 1885, -435, + -959, 242, -817, 259, -2010, -1857, -557, -914 +}, + +.cb2232m0 = { +-13394, 14382, -488, -1088, -817, 100, 305, 2267, + 2527, -1584, 995, -5781, -3585, -1826, 803, -4108, + -3137, 12111, -211, 838, 4879, -1964, -1728, 13830, + 2084, -11535, 664, -2499, -3421, -703, 4528, 968, + 1008, -12010, 984, 2658, 422, 1412, 10772, 2216, + -4291, 1329, -2324, 2392, -2029, 12322, 1053, 169, + 12635, -902, -62, -670, -3007, -3322, -2948, 1817, +-10688, -1264, 1949, 2734, 1072, -1429, 2085, 10312, + -1685, -4433, -1287, -9620, -1132, 20, 614, 2470, + 2821, 5934, 3526, 11292, 50, -12970, -11948, 1114, + 1980, -945, -713, -5357, 3766, -447, 969, 2247, + 11854, 2148, -12393, 1518, 610, 4527, 1164, 1347, + -1422, 649, 653, 855, -24, 30152, 20, -564, + -2825, -11, -1408, -80, 239, 305, -3163, -854, + 568, -18, -4212, -403, 288, -3009, 229, -1152, + 16390, -877, -458, 316, -128, -12165, 1088, -828, +-10886, -269, 747, -1026, 1716, -10920, -9204, -3123, + 958, -6128, -260, -851, -1524, -2386, -6472, 228, + 2667, 3158, -140, 1719, 2330, -2730, 3080, 44, + 15743, -2167, -11637, -607, 476, 408, -12505, -1862, + -1892, -440, -3785, -2348, 1229, -338, -438, -797, + 29933, -715, 366, -197, 576, -188, 484, 240, + -4844, 1168, -1054, 863, 875, -295, -16091, -1972, + 3976, 3833, 3056, -770, 1011, -3098, 165, 3973, + -9367, -18, -299, -11254, 1005, 8644, -14788, -2268, + 2644, -8410, 578, 2169, -766, 2764, 2378, 3282, + -2710, 7612, -542, -12062, -2437, -414, -506, -10332, + 2732, 839, -2593, 923, 1159, -1057, -7333, -86, + 2832, 11328, -1616, -302, 4399, -547, 6107, 9983, + -6901, -85, -544, -4916, 366, 4878, -8662, 7313, + -3056, -1027, 2381, 8906, -7270, 509, -1124, -2512, + -1636, 5830, -5868, 2369, -3236, 12557, -2713, 12793, + -2957, 1688, -852, 4723, -122, -2336, -4698, -1306, + -7399, -2090, -1953, -1505, 3335, -10906, -2598, 1322, + 2556, 7210, -1553, 1262, 1878, -10719, 1746, -2736, + 1448, 8734, -9602, 828, 1752, -1632, 8037, 2728, + 562, -1879, -10572, -544, -2254, -1997, -6384, -87, + -5878, -473, 498, -2960, -5698, -11500, 1815, 2050, + 7388, 5230, 2782, 5602, 514, -306, 13022, 523, +-10776, -846, 716, 270, 3350, -6021, 1420, -6175, + -1978, 3967, 11612, 3320, -4100, -2468, 4595, -5338, + 65, 3478, 19, 3501, -15896, -1335, -1861, -1944, + 3935, 3630, 4627, -5892, -458, 383, -211, -594, + -165, 24865, -656, 2300, -404, 257, 214, -643, + 2298, -180, 35, 4974, 834, -998, -1738, 5449, + -9222, -10858, 4188, 9147, -5639, -1691, 990, -1945, + 3421, -3527, 9005, -2038, -2369, 5098, 967, 15840, + 196, -3204, -1079, -776, 11806, -1352, -2053, 2011, + 309, 642, 1541, -1466, -4465, 6679, 5756, 7474, + -58, -1864, 5908, -1576, -30374, -904, -571, -1136, + 425, -22, 666, 1150, -734, 82, 1254, -226, + -437, -890, 1464, -3368, 987, -11885, 1127, -7224, + 1872, -8198, 8775, -2695, 1457, 15102, -899, -1384, + -1975, 1891, 3128, 1465, -1649, -1363, 1483, 303, + -534, -7, -1710, -1377, 769, 12698, -8987, -802, + 4636, 572, 2004, -3513, 442, -9863, 3215, -4550, + 2138, -4346, 5682, 11053, 7220, 9842, 797, -1399, + -2679, -5857, -2143, 3241, 2330, 248, -630, 1044, + 639, -3432, 125, 22083, 1976, -1003, 813, 552, + -571, 4358, -6200, 3635, 5439, -636, 233, -4856, + -3519, -460, 6956, -4215, 1537, 7895, 13910, -7637, + 1392, 1572, 648, 3690, -1988, -2463, -3302, 677, + -924, -535, -6025, 4126, 7178, -4145, 4960, -1860, +-10926, -1470, -9506, -226, -258, 32, -479, 2222, + 94, 11358, 3984, -2732, 2111, -590, -2444, -344, + -425, 598, -1382, -1213, -17632, 1566, 1387, -3521, + -57, -1829, 4788, 574, -206, 7962, 9157, 6459, + -1594, -1355, 4874, 1066, 2006, 1793, -7569, 2369, + 1108, 1305, -3046, -14052, -1736, -4045, -4328, 7497, + 3304, 1518, -5666, -529, 4256, 4667, 932, -1495, +-10414, -414, -2110, -3150, -1250, -8799, -419, 5162, + 8497, -8720, -746, -3015, 6403, 3855, 7350, 165, + -59, -958, 5780, 6044, 1736, 3016, 31, 1012, + 3422, 7598, -6837, -2092, 2262, 6171, -10362, -2108, + -1352, 1798, -4872, -6369, 2507, 2640, 6074, 1835, + 2948, 388, 398, -9295, -5384, -2088, 2096, 742, + 3286, 441, 7135, -2112, -9958, -5612, 2479, 5427, +-10114, -674, 308, -1037, 770, 514, 1868, -252, +-11901, -984, 670, 2506, 5396, -1047, 9113, -10865, + 4872, 1720, 2226, 947, -2336, 2649, 173, -1464, + -2874, 4463, -1270, 3429, 6242, -5380, -7772, -4550, + -8451, 2045, -2855, 5336, -15066, -418, -4886, -648, + 3736, 945, -956, -4825, -116, 130, 1889, 9642, + 3790, -4371, 7180, -1556, 6562, -2207, -7910, 506, +-21594, 662, -338, -943, -1022, 6453, 301, -464, + -457, 840, 3313, 10946, -294, 8156, 138, -1425, + 2397, -792, 6468, 4615, -511, 15938, 494, 274, + -5976, -660, 3894, -2140, 1424, 2003, 4101, 2823 +}, + +.cb2232m1 = { + 20456, -1952, -1581, 869, 628, 76, 1404, 4060, + 508, -3177, -946, -2992, 2422, 1139, -1931, -240, + 1011, 365, -1106, 20973, -1438, 372, 137, -1058, + 1171, -1252, 2794, 1434, 1814, 482, 3948, -2704, + 20422, -241, 441, -1121, 499, 1036, -918, 9708, + -3166, -488, -10379, -3201, -5254, -1871, 5665, -12622, + -7591, 127, 1469, -2267, 1813, -4197, 2065, -602, + -395, -652, 333, -19114, -1092, 4310, 1590, 1688, + -1453, 177, 4402, 1168, 5972, -1295, -3258, 1542, + -4832, 3377, -5545, -3622, -4944, 2064, -2846, 8118, + -845, -6778, -3640, 5729, -907, -11007, -5, 2634, +-11118, 2108, 144, 13299, 251, 336, 563, -75, + 3004, 169, -3892, 1477, 1066, -1571, -1113, -1088, + 517, 465, -21841, -1541, -1094, 1841, -9213, -17478, + 1662, 8, 1192, 1174, 1014, -5659, -695, 316, + -5161, 1803, -1056, -2369, -2919, 2941, -9712, 1975, + 426, 11214, 2288, 6186, -7348, -3062, 3341, 3252, + -4102, -346, -876, -7088, -3330, 4507, 310, -1632, + 299, -2636, -2740, -752, 10159, -7201, -9568, 3134, + -4002, -41, 2479, -1816, -14099, 3575, 1161, 6427, + -2466, 390, -1883, -6265, -1266, -263, 1474, -592, +-21234, 94, 4187, 1, 3227, -3273, 1950, 406, + 543, 1661, -2648, -9252, -2048, -5987, -722, 4932, + -4410, 12504, -1572, 2244, 5610, 307, -9710, -3642, + -6436, 4368, 2956, -2269, -6196, 4069, -766, -3695, + 3416, -5786, -9668, 11677, 1208, -965, 1516, 1132, + 1018, -6168, 1970, -10357, 1379, -725, -8789, 3730, + -65, -4758, -1818, -1050, 9641, 4519, 2886, 2667, + 6348, 2436, -438, 1978, -9374, -1286, 3893, -2073, +-11199, -2081, 3345, -3444, -9480, 2410, 1986, -1869, + 3252, 5949, -2119, -401, -214, 3416, -1067, 18510, + -2986, 3510, 508, -357, -837, -1205, 2884, 11587, + 11565, -555, -2664, -873, 3642, -2068, 1734, -4408, + 330, -181, -1358, 1407, -9739, 809, -10203, -2066, + 3440, -2063, 3238, 3734, 1671, 750, 6890, 4068, + 1238, 493, -1330, 76, 8918, 10855, 85, 12236, + 3570, -1074, 3008, -9424, -3186, 1271, -380, -157, + -4974, 10575, -1378, -219, 1354, -1589, 10936, 2268, + -3787, -1040, 7567, 924, 10490, -806, -1318, -1576, + -209, 93, -3745, -3820, 439, -9828, -6265, -864, + 31342, 35, 1332, 443, -590, 846, 104, 868, + -863, 1526, -1088, 11494, -7055, 3564, 109, -3072, + -2234, -4530, 1866, -3425, 9940, 3158, -1821, -680, + -1124, 2884, 1191, -61, -9698, 7596, -558, -9019, + -1181, 208, -1342, -68, -312, 294, -1468, 1410, + 39, -21081, 724, -2137, 935, -8, -10297, 3509, + -6510, -6558, -6906, -1905, 1915, 5920, -8983, 3416, + 7300, -1372, -1422, 1822, -10433, -2530, 1669, 554, + -3008, -3351, -922, 8279, -5184, 5520, 4785, 683, + -506, -4558, 1938, 8442, -12639, -54, -2907, -820, + 10004, 1780, 485, 1401, -3786, 786, -5937, 2632, + -1540, 972, -3342, 2294, 8076, -1006, 11731, -1825, + 3036, 1085, 1160, -9680, 11111, 7838, -2504, -2112, + 2376, 2534, 3624, 555, 3610, -520, -831, -15, + -498, 167, 711, -22685, -999, -1466, -1643, -394, + 5404, -4247, -2307, 4052, -1156, -1240, -490, -1598, + -4365, -8382, 10493, 464, -16592, 3723, -7709, -821, + -4218, -922, 398, 5635, 2184, 5090, -7144, 2420, + 792, -324, -1278, 3172, 13101, 1608, -3996, -2219, + 2995, -6924, 816, -2482, -406, 3458, 503, -8154, + 3460, 2542, -3703, 8524, -61, -430, 23212, 1203, + 2335, 5556, -476, 923, -565, 593, -1611, 1814, + -1614, -7067, -1957, 10166, -4306, -421, -4026, 1854, + -9881, 667, 7720, -2906, 7003, -1823, 6344, -8614, + -2965, -2720, -62, -802, 1945, 4574, -4604, -8341, + 518, -3543, 95, -4262, -5220, -133, 10270, 1999, + 3234, 8900, -4866, -3708, -4465, 4542, 2545, 1770, + 6995, 3559, 1133, -1152, 14680, 1002, 634, -12913, + 1686, -1645, -1796, -50, 112, -1108, 1070, 686, + 1068, 1555, 896, 3498, 10458, -32, 12017, -737, + 650, -432, 404, 170, 10873, 1864, -1718, 11061, + -1556, -3766, 225, 6999, 1730, -6919, -1895, -2919, + 8250, 10050, -4631, -1488, -4801, -1504, -2736, -110, + -3630, -2752, -11162, 1128, -2580, 11692, -678, 1338, + 2175, -6030, 616, 1651, -7034, -3057, 2420, 1998, + 4383, -1721, -10762, -428, 2902, -906, -4298, 2141, + -1242, 5464, -607, 5389, -8946, -3890, 10884, 1544, + 628, -1969, 13902, -1570, -1080, -689, -4676, -3642, + 753, -11351, -110, -744, 4286, 1163, 3105, 9752, + 11143, 4296, -1698, 1012, 2284, -989, -958, -9481, + 738, 24, 426, 1638, 3898, 8885, 2938, -8826, + 2982, -1679, 8466, -651, 5144, 2736, 751, -84, + 7710, 3077, 2885, 146, -1102, -2569, -2039, 11059, + -9950, -1048, -1031, -33, -5118, -1096, -1986, 2306, + 2400, 9320, 6188, 500, 2090, 61, -11357, 118, + 1505, 1032, -1920, -164, -9744, -4670, -11029, -102, + -960, -1023, -2570, 4102, -3989, -11478, 772, -1515, + -1102, -2194, 1722, -1195, -8144, 746, -9534, 3250 +}, + +.cb4440l0 = { +-14497, -1982, 631, -984, -2115, -3252, 2755, 2017, + -2110, -8864, -792, -1291, -2761, -2365, 698, 1047, + 972, -14703, 10590, -3945, 663, 972, 1204, -2801, + 1295, -1296, 50, 1448, 888, -1879, 122, 78, + -183, -588, 16202, -388, -2240, 1136, 1266, -6445, + 2619, -1664, -6329, -2700, 1557, -497, 598, -110, + 1298, -334, 191, 29897, 387, 419, 76, 152, + 533, 78, 112, 101, 158, 136, -236, 88, + 43, 107, 84, 21, -6385, -1711, 1757, 1411, + 9152, -72, 1428, -1098, 10328, -506, -360, 285, + -36, -2816, 819, 88, 176, -481, -172, 2067, + 3268, 5479, 8605, 11272, -1880, 361, 1582, -4973, + -1379, 3835, 74, -3, 493, -431, 1390, 101, + -550, 59, 476, -469, -583, 568, 732, -1015, + -1104, -698, 23922, 1130, -1268, 280, 204, -59, + -9789, -317, 935, 2944, -10402, -2564, -4648, 1506, + 3834, -1002, 2805, -158, -409, 814, -150, -97, + -3573, -1550, 1356, 5350, -365, -2622, -3454, 310, + 1194, 911, -10928, 937, 7980, -5286, -554, 1999, + -1263, -562, 10, -321, 744, 44, 64, -274, +-30136, 340, -1051, 756, -30, -6, -269, -273, + 12, 95, 1565, -13194, -11810, -485, -1574, 414, + -240, -452, 564, 740, -476, 959, 1079, -1568, + -422, 37, -154, 10117, -68, 1412, 11862, -3420, + 4169, 5178, 527, -1027, -1030, -1985, 448, -716, + 1696, 1942, -254, 308, 1100, -790, 8102, 6630, + 3653, -1018, -587, -6990, -19, 1671, 1425, 8089, + 3708, -1182, 774, 659, 113, 437, 50, 835, + -532, -11209, 1682, -7490, -2592, 1234, -4689, -7301, + -143, 3361, 1121, 177, -473, 513, 136, 965, + -4020, 4639, -1212, 1271, 2905, -6865, 10499, -3800, + -3354, -5029, -3606, -950, 4490, 526, 1006, 2, + 1760, 5819, -55, -1098, -1843, 348, -2062, -9196, + 3712, -11466, -3218, -858, 2720, 589, 320, 861, + 59, 5357, 564, -380, 538, -142, 490, 212, + 1716, 670, 1904, -181, 2979, 943, 16916, 1271, + 988, -802, -1490, 9154, 643, 1725, 1347, -2827, + -4096, 485, -7091, -3180, -4747, -1604, 1576, -5724, + 6104, -139, 1726, 11715, 360, 7519, 2513, 5192, + -2208, -1993, 829, -387, -5724, 4418, 116, -2955, + -226, 249, 377, 2149, -2929, 5021, -3064, 800, + -1459, 11384, 8556, 1740, 368, -2839, -2049, 1438, + -1357, 4084, 1896, -528, 1621, -1760, 13741, 302, + -1018, -9774, -3521, 1302, 1374, 1139, 918, -1724, + -764, 858, 804, -1772, 372, -322, -526, 11924, +-11944, 4012, 1749, 1737, -1545, 68, 889, 280, + 690, -2200, 1068, -484, -171, 455, -44, -3178, + 2243, -590, 749, -792, -19876, 198, 236, 2695, + -3413, 652, 284, -820, -1134, -199, -112, -5650, + -418, 1047, 1090, 2260, -3297, -2164, 13524, 1720, + -326, 910, -1706, 3912, -1175, 1687, -2152, 50, + 35, 1718, 721, 9316, -2256, -4330, 6961, 4432, + -8043, 45, 1370, 3472, 2892, -3224, 1368, 1355, + -562, -694, 746, 198, 1188, 2819, 3131, -2371, + 6438, 847, 2111, -10187, -3451, -9826, -3502, 655, + 649, 1460, 270, 118, 45, 192, 188, -1139, + -258, 663, -84, -27519, -765, -905, 357, -4, + 89, -372, -24, 178, 1127, 209, 1177, -2762, + -587, 1488, 8989, 3217, -2550, 215, 9540, -7196, + 1259, -3716, 2767, -261, -216, 872, -3008, -2076, + 8682, 709, 3629, 87, -3114, -10624, 246, -1670, + -1738, 1229, 7624, -1120, 784, 305, 233, -185, + 280, -1466, -268, 198, 499, 308, -2187, -1149, + -388, -38, -338, -1084, -19424, 40, 1958, -2240, + -86, 264, -9876, -1287, 4086, 3742, 2502, -10078, + 4574, -1493, 1078, 3218, 2410, -364, 1049, 2638, + 35, -1295, 200, -2847, 10818, -12064, 2375, 348, + -353, 2788, -821, -3196, -511, 146, 2015, 235, + -1094, 2622, 2688, -79, 5176, -884, -11814, 794, + 2696, -6704, 3452, 1295, 3872, 2924, 4498, -166, + -598, -1213, 891, 5478, -266, -777, -5, -776, + 1003, -1837, -156, 17910, 453, -297, -1545, 857, + -288, -308, -6373, 2045, -1846, 3007, -2236, -1904, + 815, -2889, 4200, 8320, 9872, -614, -834, 3856, + 414, -234, 1559, -7451, 3641, -1230, 837, -127, + 2652, 411, -532, -12548, -1692, 1034, -2418, -968, + 558, -1564, -1952, 307, -1064, -6776, 1588, -2636, + 949, 8272, -12, -3468, 3481, 6588, 2580, 7393, + 272, 1528, 1818, -2206, -349, -396, -11704, 1487, + 9753, -4665, -24, 2084, -780, 5036, -647, 3668, + 561, 1099, -1094, 534, 1270, -99, 1006, -476, + -528, 12481, 1589, 1593, -1682, 7022, 2664, 8702, + -563, 1082, -206, 87, -1978, -144, 228, 1232, + 889, 14340, 65, -1061, 10510, -95, 649, 53, + -962, -383, 2479, 1322, -1798, 2840, -492, -419, + 90, -680, 79, 1026, -20912, 1593, -742, 1086, + 516, 699, 2393, -64, -2010, 46, -859, 111, + -440, 14281, 272, 797, -10141, -3734, 3126, -3050, + 1300, 73, -1754, -1278, 1890, -2710, 704, 1160, + 1, 269, -24, -622, 124, 138, -522, -510, + 95, -402, -27306, -470, -214, -159, 396, -201, + -372, 122, 136, -1005, 744, 1949, -810, -2648, + -726, -384, 955, 1232, 1354, -345, -19485, 1056, + -193, 1257, -263, 398, -752, 602, 98, 793, + 17, 20186, -189, -2615, -174, 166, 436, 411, + -1046, 374, -471, -253, 233, 8352, 1342, -1279, + 9305, 2190, -3239, -5262, -3454, 1844, 684, 303, + -4434, -6041, -3495, -2482, 389, 353, 159, -14, +-29179, -511, -158, 92, -401, -36, -297, 447, + -605, 269, 85, 212, 8, -118, -130, 207, + 13150, -8712, 2504, 1355, -3268, 1396, -4748, -2200, + -1560, 228, -162, 1179, 3024, 742, -860, 69, + 10, 30006, -538, -489, -125, -214, 364, -682, + -283, 532, -134, 227, -448, -20, -266, 70, + 2, 9310, 14858, 856, -493, -3357, 36, -248, + 214, 281, -73, 3268, 745, -245, -1007, 146, + 392, 36, 8042, 2953, -6603, -7697, 4425, -2498, + 571, -2194, 3388, -794, -561, -2763, 1912, -3030, + 225, 214, -27, 834, -10661, 437, -506, -535, + 8397, 1332, -2406, -8868, -2972, 1385, 296, 865, + 2318, 890, 244, -121, 226, 375, 896, -10381, + -2266, -3404, 983, 1255, 259, 11427, 455, -3041, + 307, -2446, 476, 723, 18, -10224, 510, 552, + -654, -876, -465, 628, -12572, 786, -393, -4162, + 938, -1327, -1695, -608, -1352, -131, -880, 830, + 1016, 21875, -408, -1560, -500, -1682, 453, -930, + 1316, -136, 434, -683, 412, 202, 233, 382, + -2002, -9267, -1034, 8710, 434, -8121, 3035, -3121, + 1792, 2712, -1537, -1082, 854, 1337, -1084, 91, + -4485, 2545, -4412, -1930, -12234, -4802, 4641, 437, + -928, 2163, -3154, 521, -665, -1200, 2654, 931, + -388, -118, -1144, 133, 5089, -1194, -1528, -967, + -795, 188, 1918, 897, -7046, -7617, 7118, 5755, + -2724, -7894, -472, -360, -591, 990, -3032, 7742, + 726, 5490, 9383, 479, -3032, -1904, 7158, 4706, + 2442, -1576, -58, -156, -3977, -2696, 4195, -166, + 3342, -1566, 3767, -4159, -5750, 5505, -7663, 4516, + -4073, -2612, 5136, -290, -666, 1282, 776, -566, + -602, -310, 1003, -648, 2928, -3159, 427, -1168, + -2702, -16990, -205, -343, -1196, -1980, 1653, -512, + -1820, -418, -3368, 3522, -1966, 4964, -5728, -5185, + -210, -1721, 10131, -7060, 3351, 334, -96, -3193, + -1713, -614, -2633, 147, -1552, -2363, -3724, -1731, + -7350, 5453, -2732, -2867, 12458, 416, 0, 4414, + 833, 590, 1617, 405, 73, 868, 232, 195, + 15, -196, -782, 749, -955, -84, 1176, -553 +}, + +.cb4440l1 = { +-12227, -3413, 12848, -1336, 20, 894, 254, -1001, + -1381, -406, -1157, -458, 300, -395, 825, -34, + 74, 382, -1018, -10266, 1338, 11091, 544, 797, + -4304, 1389, -747, 1924, -257, 2615, -37, -4375, + 782, 158, -378, 19, 652, -539, 1012, -4211, + 1263, -925, 96, -9226, 5921, -8209, -71, -1838, + -2201, -7441, -60, 393, -5626, -264, -1002, 85, + 1989, -1616, -216, -914, 9907, 8044, -578, -7830, + -1705, -3624, 2430, 59, 5813, 870, -317, -2545, + -4020, -1330, 1215, 9352, 5425, 324, -4803, -681, + -506, -4710, -6574, -4184, 65, 729, -1310, -1387, + 1385, 2364, 1672, 2493, -438, -1367, -907, 38, +-20220, -1644, 512, -413, 348, -112, -532, 785, + 1332, 7140, -1916, -1766, -11570, 1811, -9167, -76, + -1531, -175, -1739, -771, 2014, 519, 15, 576, + 8736, -979, -28, 1830, 329, -302, 12206, -1501, + 5195, -305, 1456, -581, 1488, 142, 235, -157, + 192, 1540, -922, 11056, 11823, -2964, -1488, 1712, + -2018, -880, -3282, -190, -198, 2436, -248, 222, + 22, 863, 1504, 2078, -2047, 216, -1270, -732, +-18252, 1186, 3178, -730, 432, 934, 1617, 873, + -491, -70, -768, 679, 1398, 537, -364, 172, + -541, -94, -24, -129, -26725, 201, -554, -357, + -71, 60, 96, -1665, 1425, 1244, 332, -1068, + 326, 834, -620, -1473, 1585, 1432, 928, 18782, + -1388, 2897, 448, 40, 1323, 1433, 787, 215, + 3297, 2586, -856, 451, -17700, 735, -43, 405, + -1252, 744, 1012, 677, 312, 206, -279, -432, + 6677, -87, -72, -10400, -106, 11224, 1152, -422, + 2024, 704, 2462, -1197, 232, -119, 4, -879, + 1600, -708, 3496, 279, -143, -1096, -555, 4594, + 1486, 161, 942, 2018, 2474, -16010, -380, -193, +-11415, 457, -276, -11220, -1604, -38, 813, -4044, + 1888, -4265, 1647, -882, 981, -734, -110, 140, + -3050, 1248, -549, -1167, -967, 3586, 688, -1380, + 424, -17959, 2022, 2274, -44, -1406, -432, 1335, + -659, 9555, -3581, 11045, 1870, 806, 599, -2065, + 156, -4420, 16, 2349, -609, -3058, -738, -60, + -548, -119, -49, 26, 1528, -1842, 6306, 14078, + -692, 5480, 321, 1996, 1376, -3086, 490, -54, + 1151, 932, 445, -9887, 15808, 3085, 866, -2020, + -1785, 2126, -920, 414, -290, 138, 244, 994, + -702, 1410, 330, 202, 675, -389, -241, 31306, + 380, 300, -53, 804, -109, 413, -44, 6, + 14, 486, -293, -112, 26, 11632, -836, -3948, + -518, -1364, 11360, 3558, -588, -2084, 490, 381, + -955, 2207, -2953, 1115, -265, 2, 65, 464, + -180, -111, -174, -152, -30508, 121, -207, -835, + 1126, -185, 91, -96, 222, -99, -93, -10138, + -430, -184, -372, -194, 953, -100, 382, -1422, + 13931, -1835, -1657, 821, 408, 808, -601, -463, + 7142, 5596, 3171, 2174, 2740, -11350, 1019, 1449, + -386, 1642, 3703, 4271, 1664, 2232, -674, 983, + 551, 8543, 154, -383, -2419, 1117, -520, -10966, + -4406, -3742, -79, -909, 1813, 5043, 412, 1099, + 1434, 173, 788, -92, -1004, 1288, -87, 931, + 10241, -855, 6, -405, 2580, 11455, 1150, -1916, + 3614, -262, 292, 897, 9673, -381, 1711, -2713, + -1111, 282, -2180, -2282, -2266, -724, -849, -11787, + 888, 3120, -1459, 495, -10812, -792, -274, -984, +-12223, -737, -2394, -299, -578, -2758, 1521, 774, + 1938, 857, -1935, 217, 654, 1452, -3695, 6734, + 804, 134, 946, -2156, 9495, -600, -1962, -5252, + -246, 1269, 8492, 1261, -2205, -106, -1314, 828, + 1013, -12059, 663, 436, -2648, 9863, -630, -2961, + 3004, 1015, -3153, -1475, -25, 399, -846, 430, + -1237, -156, -187, 1115, -502, -363, 386, -2820, + 942, -926, 727, 1130, -20388, -274, 1140, 198, + 199, 2548, 442, 157, -1546, 3693, 892, 460, + 6552, 4858, -2560, -8673, 1930, -8913, 3427, 686, + 61, -8830, -358, 1338, -74, 1180, 2871, -3822, + 104, 2414, -1742, 11425, -4522, 393, -3016, 972, + 34, 117, -16113, -6900, -6964, 1726, -843, -242, + -2141, 803, -1093, 442, 1776, 2429, -1000, 489, + 393, 635, 389, 1126, 12285, -1648, -11396, -2885, + -56, 3840, -174, 3177, -1708, 1189, 1914, 1514, + -189, -88, 276, -240, -120, -2929, 9823, 678, + 568, 26, 10080, -2575, -806, -64, 6406, -82, + -1171, 2169, -1804, -667, -37, 54, 4208, 10829, + 11920, -468, 1916, -809, -370, 144, 3616, -263, + -4352, -124, 300, -246, -440, -115, 447, -407, + 20869, -340, 54, -764, -807, -699, -283, 727, + -922, 1098, 577, -6, -809, -50, -115, -75, + 280, 156, 182, 225, -30432, -212, -417, -245, + 177, 94, 4, -627, 167, 47, 152, 148, + 1325, -2436, -10063, -696, -9966, 1032, -1024, -3702, + 3933, 400, 333, 692, -3858, 2599, -1215, -389, + 393, -666, 2135, 10280, -2443, 1972, 410, -392, + 590, 12322, -523, 1141, 52, -1468, 819, -213, + 162, 116, -614, -10630, -204, -1247, 535, 199, + -6058, 2538, 1644, -11539, -1562, 1462, -1493, -218, + -296, -605, 321, 607, -366, -257, -837, 4536, +-11683, 1266, -3805, 4496, 2854, 8, -8848, 124, + 656, -1041, 411, 144, 916, 445, -91, -260, + -149, -882, -433, -121, 345, 68, 349, 821, + 652, 251, -23053, 1015, 712, -73, 7038, -1520, + 5810, -12604, 2841, 425, 265, 1546, 938, 1851, + -1180, 2751, -498, 1289, -774, 327, 4047, -8132, + -2622, 5449, 3221, -2990, 10107, 1880, 173, -4006, + 399, -332, 642, 297, -4513, -1230, -330, -788, +-21881, 903, -1308, 547, -522, 1885, -1730, -63, + 973, 897, 670, -657, -232, 498, 92, -8, +-11010, 1072, -368, -1864, 11505, 3497, 730, 2158, + -1629, -1351, -1583, 2247, -1506, 2144, -902, 639, + 175, -6006, -986, -4246, -1510, 1785, -9792, -495, + 1995, -9189, -1414, -2550, 1578, 2390, -2989, 1673, + -1980, 21, -4054, 8552, 1155, -301, 1204, 3776, + 262, -1828, -1837, -1014, -9, 2711, 1467, 463, +-11605, 1743, -956, -1213, -3892, 1534, -10298, 22, + -902, -658, -1759, 2507, 1552, -12298, -1050, 623, + -3221, 1522, -36, -446, -5925, 2144, -2844, 15080, + -1984, 3631, 1931, 1894, 1193, -1694, -3172, -813, + -1336, 534, -365, 833, -293, 21759, -1266, -1216, + 996, -2, -393, -858, 759, 969, -230, -151, + 977, -874, 119, -896, 262, -118, 89, 95, + 94, -437, -30375, -462, 360, -588, -334, 86, + -1027, -208, 536, -196, 367, -467, 119, -32, + -2544, 6204, 8830, -264, -7847, 848, 2267, 3877, + -6378, -2249, 1420, -1868, -3443, 3747, -590, 58, + -274, -6065, -8472, 5906, 3109, 5834, 3905, 2086, + 1300, 3828, -518, -528, -3672, 1794, 4353, 408, + 566, -2577, -1137, 2749, -2662, -528, -7479, 5550, + 2932, -336, 3681, -2034, 212, -8733, 1017, 2258, + 8225, 387, 227, 877, 2752, -1375, 2636, 8131, + 3850, -6870, -1158, -3736, -8478, 228, -5809, 97, + -2555, -2956, -928, 678, 112, 1434, -1250, 1240, + -412, -4267, -3811, 4322, -3430, 7705, 5456, -6876, + -3452, 7329, 3142, 220, 662, 1531, -5492, -1388, + 6842, -3631, 362, 5029, 8052, -2367, -5346, 5724, + -358, 2469, 2196, -1426, -272, 534, -192, -531, + -705, -70, -259, 93, 335, -94, -145, -17, + 920, 1186, -818, -599, 343, -19859, 2968, 161, + 128, -4282, 598, 152, 1210, -1317, -1545, -229, + 181, -6488, 5699, 7270, 6271, 8809, 27, -4770, + -804, -168, -247, -680, -129, -470, -152, 915, + 176, -904, 622, 280, 2986, 1034, -1046, -482 +}, + +.cb4440s0 = { +-12085, 8192, -1802, 4587, 5947, -3183, -2629, 1837, + 2434, 252, -612, -4697, -576, 150, -704, -640, + 174, -126, -10309, 350, -3187, 4714, -2829, 12618, + -2172, 3502, 465, -159, -601, 1306, 1174, -448, + -292, -136, 242, 31, -9005, -6203, -10027, 25, + -209, -20, -1292, -1252, 4304, 3681, 4462, -4401, + 4412, 1240, -576, 3618, 595, -237, 2544, -6032, + -1511, 1523, -3668, -3472, 5552, -4901, -272, 5963, + 2740, -878, 13010, 191, -2017, 768, 455, -45, + -6873, -3664, 2639, -961, 3068, -4242, 1327, 2362, + -1909, -1114, 100, -5940, 220, 865, -12952, -76, + -1279, -591, 1092, -3502, 88, -2118, 13053, -10141, + -3024, -533, -1923, -4097, 135, 1672, -1661, 1646, + -370, -361, 644, -197, -6796, -10948, 11692, -974, + 488, 349, 3936, -1506, -149, 513, 1401, -1776, + -391, -210, 57, -56, -344, 1018, 7989, -4957, + 167, 987, -60, 62, 1622, 1207, -69, 338, +-16133, -46, 1018, -1460, -821, -646, 1316, 126, + -4631, -842, -1505, 15833, -6404, -4514, 2946, 2923, + 1198, -3141, -3109, -1613, 1853, -906, -436, -1110, + -282, -214, -3424, -3141, -3988, 284, 22262, 1269, + 1787, -1116, -1429, 1017, 371, -187, -825, 534, + 350, 1088, 26, 176, 8914, 6662, 935, 2074, + -7986, -4780, 2194, 1796, 697, -4040, 2486, 1700, + 9150, -37, -1560, 2449, -162, 128, -7469, -2690, + -281, -4698, 424, 535, 1416, 243, -575, -1160, + 326, -2417, 808, -15816, 994, -302, 26, 894, + -7376, 395, -586, 823, -1341, 972, 100, 241, + 743, 470, 267, -550, 474, 182, 18252, 178, + -182, -7, 3496, 2132, 863, -151, 741, -2158, + -763, -652, -503, -434, -736, 770, -156, -19071, + 443, -354, -243, 66, 4258, 6714, 3577, 17338, + 556, -3570, 1269, -1406, 1668, -349, -90, 781, + 82, 558, 936, -788, -1072, -21, -6472, -3022, + -475, -6997, -2816, -3774, 1683, -13950, 3482, -1872, + 2624, 1064, -318, 1300, -1214, 179, -11, -124, + 4560, -2827, -6314, -5736, 1159, 1309, -5462, -11652, + 4192, 151, -543, -3484, -2288, -119, 745, 1373, + -121, -629, 5204, 7650, -2062, -3370, -2894, -338, + -1361, 1080, -3674, 12852, -6119, -1578, -736, -241, + -1564, -109, -441, 335, 416, 1678, 4802, -3239, + 6182, 154, -3656, -1337, -17027, 1707, -381, -1704, + -377, 1022, -592, 983, -321, 37, -1846, -4500, + 2575, 14162, -560, 9385, 4179, -1340, -3466, 3235, + 1727, 1545, -23, 636, 280, -39, 871, 173, + -8915, -2427, 2146, -3698, -12153, -3773, -3873, 5042, + 112, 788, -1139, 245, 546, 278, -8, -1005, + 443, -76, -1256, 8255, 3841, 6116, 4226, 3705, + -1278, -6470, 5220, 5892, -3468, 2736, 5427, -3336, + -264, 1906, 294, -60, -7078, 7699, -9792, -7108, + -2030, 1055, -6962, 702, -2074, -232, 127, -430, + 658, -272, 757, 138, 159, -340, -4606, 1021, + 146, -7690, 6001, 5660, 3363, -367, 13222, -441, + 13, -874, 668, 2293, 875, 1238, 110, 778, + 1434, -976, 2151, -8169, 1421, 2622, 206, -795, + -816, -14443, -1583, 3356, 2971, -964, -321, -841, + -404, 111, -5595, 4248, -3819, 214, -2520, -712, + -1505, 849, 947, -876, 188, 3221, 863, 105, +-17336, 1818, 14, 17, -6349, 379, 4746, -12405, + -560, -3448, 3664, 8251, 845, 383, 1348, -739, + -780, 1695, 4828, -123, -647, 823, 9940, -183, + -1804, -7112, -161, 578, -619, 11534, 3214, 1586, + 4784, -2540, 1188, -304, -485, -648, -824, -595, + -8817, 4138, 927, -3259, -198, 4022, 2213, -1627, + 645, 14602, -1058, 1481, -1670, -113, 564, -710, + -451, -360, -1261, 2504, 247, 5566, -7262, 1344, + -5106, -1608, 1946, -4240, -7393, 10440, 3306, 1940, + -999, 155, 832, 55, 10218, 11475, -3252, -8295, + 1347, 2405, 3421, -2619, 2262, -2829, 754, -307, + 548, -2040, -1130, 317, 170, 292, 248, 2601, +-18930, -1942, 1417, 1678, 3310, -2578, -1969, 1550, + 3010, 70, 8, 3064, -848, 504, -172, 180, + 1787, -1133, 2427, 1002, -664, -40, 192, -23400, + -1004, 513, -818, -382, 360, 360, 268, 98, + -202, -192, -668, -12924, -11702, 7325, 797, 1937, + 674, -2458, -541, -1497, -1673, -955, -356, -486, + 182, 299, -46, 65, -4232, 1418, 6532, 2356, + -4894, 4870, 3369, -4585, 8743, 1497, -1451, 862, + -8612, -1718, 1716, -2389, 371, 592, 7397, -3188, + -649, 126, -1300, 1374, -1292, 645, -1494, 2736, + -1468, -1808, -17223, -352, 111, -222, -236, 171, + -198, -7994, -3822, 5324, -16856, -517, 119, 314, + -360, -515, 435, 520, -638, 1635, 420, 1191, + 830, 710, 6897, 2925, 3091, 510, 3268, -1702, +-16186, 718, -3127, -463, 763, -1035, 725, -122, + 646, 172, -164, -277, 5853, -7074, -10, -1770, + -2544, 5978, -874, -494, -232, 14465, 1815, -1902, + 987, -1533, 1216, 741, 620, 161, 4414, 4184, + -32, -2944, -4619, -462, 15701, -1026, -140, -2396, + -1747, -538, -1024, 219, 854, -351, 860, -226, + -4390, 732, -2003, -2430, -540, 592, 1622, 1180, + 385, -2052, 4050, 17401, -650, -243, 1709, 1261, + 95, -307, -5110, -666, -7094, -533, -1293, -17357, + 2929, 2389, -119, -413, 317, -962, 709, -1552, + 26, 175, 700, -570, 20120, 1107, 232, 169, + -889, -533, -1276, 22, 959, 866, -954, -792, + 873, -172, 1757, 195, 148, 423, 4490, 8782, + 631, 682, 1832, -3728, -1742, -11130, -1201, 1776, + 9268, -586, -1358, -646, 626, -866, 5, 263, + 3950, -760, -2914, -12751, -12669, 1513, -4, 631, + 1835, 312, -167, 1546, -532, 619, 1176, 1436, + -116, 312, 7054, 3120, 4075, -1320, 715, -206, + -1572, 1350, 17688, -1182, -1568, 680, 6, 207, + 1010, 600, -766, 554, -1483, 644, -8810, 624, + 148, -4015, -1536, -1863, 92, 730, -14806, 386, + -5174, -1420, -331, -254, -104, 275, -7268, 2563, + 11983, -65, 8043, -1623, -2589, -2610, 1328, 3154, + 1935, 3672, -1761, 4984, 661, 209, -1038, 122, + -1019, -28948, 55, 358, -539, 488, 55, 618, + 20, -314, 446, -1016, 618, -93, -94, -331, + -36, 194, -1706, 6628, 396, -146, -765, 10500, + 2619, -82, -10894, -3908, -888, -192, 620, 163, + 78, 774, -293, -104, -4826, -14066, -1883, -3258, + -4577, -1484, 5412, -4274, -4951, 3316, -907, 1948, + -1187, -404, 3654, 400, -70, 459, -3224, -3194, + 2338, 4390, -5, -3167, 3273, 116, -1026, -1668, + 3767, 272, -16662, 137, -1634, -1007, 220, -310, + 982, 8220, -16, -1251, -2644, -3344, 2236, -1573, + 8174, 612, 1142, -10799, 393, -707, 4804, 397, + 1232, -292, 5762, -15608, 2921, -6440, 3544, -2395, + -504, 1890, 172, -1010, 178, 380, -1163, 404, + -1230, 1034, -596, 105, -2038, 1991, 5613, -312, + -4156, -10205, 3092, -4704, -6101, -1620, -1037, -1130, + 1590, 8321, -797, 247, 954, -103, 3838, 2330, + 10064, 3197, -8508, 1300, -1012, -6607, -3861, 5651, + 31, -475, 1582, -1370, 1107, 2164, 743, -567, + 4842, -2930, 3191, -190, -2230, -47, 254, 2147, + 591, -512, 1312, 1159, 811, 1444, -1312, -257, + 16016, 789, -2562, 3983, -373, -9255, 302, -3655, + 5750, -3856, -6941, 3934, -2314, 5556, -4099, -265, + -479, -4843, -130, 20, -4859, 3083, 6482, -3738, + -3936, 590, -6368, -1784, 75, -3903, -6834, -4452, + -871, 764, -1118, 8731, 38, -148, -3368, -6330, + -370, 2234, 907, -2809, -1458, -2306, -402, 2679, + -1222, 1138, 192, -1317, 1012, 15514, 624, 279, + -4032, 2565, 6162, -938, 5760, 1685, 4350, 2939, + -825, -331, 1840, -556, 427, -4642, -23, 8346, + 7577, -467, 3848, 454, -3962, 373, -116, 2314, + 4868, -208, -1367, -1803, 2681, 806, -4279, 3348, + -528, 14027, -238, -457, -2764, 832, -4680, 4354, + 1219, -801, 2414, -5204, -3768, -6524, 5163, -10909, + 1656, 321, 3260, -1773, 214, -135, -4563, 5206, + -4794, 1486, 406, -1026, 281, 1799, -218, 320, + -908, 872, 1056, 2955, -208, -799, 15492, 334 +}, + +.cb4440s1 = { + 27498, -414, -266, 646, 229, 94, -15, 302, + -489, -401, 125, 752, -476, -200, -976, 195, + 4, -402, 2220, 1012, 1731, 2530, -652, -21380, + -679, -867, -195, -114, 1326, 2531, -348, -185, + -114, 178, -694, -298, 8752, 1735, 2640, -2374, + 6191, 1516, 5771, 6705, -253, -8502, 986, 2134, + -1854, 3490, -678, -48, 133, 844, -1635, 1630, + 6056, -756, -1109, 1563, -1445, -139, 580, -1448, +-18675, 846, -390, -259, 1548, -324, 281, 142, + 1792, 1211, 1328, -4308, -1032, -5412, 4742, -201, + -47, -297, -8403, 9715, 7268, -3756, 1573, 677, + -88, -145, 4877, 12946, 3264, 1809, 7230, -2583, + 1627, -1786, -7113, -1480, -2111, -508, 415, 1664, + -483, -538, -249, 80, 7005, -2562, -887, 3801, + 6411, 2222, 36, 875, -5089, 10897, 4014, 4948, + -1580, 1425, -1814, -391, -96, 322, -6484, 1896, + -7790, -950, -4235, -8362, 3118, 4843, 3754, 1070, + -1648, 7692, -1675, 3405, 918, 2270, 573, 193, + 6024, 8912, -4905, -1810, 985, 1877, 2158, -2150, + -386, 3908, 2030, 419, -12599, -570, -150, 1580, + 36, -152, 2, -538, -1565, 6809, -715, -6266, +-12725, -6718, 810, -603, 1547, 1001, 2250, 810, + 1773, -672, 327, 246, 6414, -7511, 916, -327, + 830, 11862, 4373, 1003, 6370, -1730, -2127, 613, + 1627, 626, 763, -864, 207, -233, 3738, -8644, + -1634, -2050, 3906, -451, 12986, -4828, -2973, -4714, + 545, 822, 735, -3539, -256, 65, -93, -94, + 2923, 7075, -3763, 6172, -9544, -2675, -3833, 930, + 418, -4496, 3790, 386, -7797, 234, -609, -259, + 454, 330, 1546, -7634, -1966, 515, -2496, 374, + 2633, -3014, 4126, 9920, -7103, 1441, -150, 7695, + 670, -48, -41, -512, -6849, -1785, 3755, 1860, + 2418, -2346, -1194, -1574, 15510, 444, -1515, 585, + 742, -199, -1115, -122, -11, 140, -7763, 1438, + -317, -444, -17149, -24, 2685, -856, -3166, 1109, + 308, 233, 30, 63, 530, 645, 84, 133, + 6139, -1183, -10673, -12790, -112, -1544, 4623, 576, + -804, 1023, -1646, 1192, 269, 2681, 44, -909, + -14, -414, 48, -4002, 4768, 3440, 3252, 1441, + 101, 372, 3166, -1398, 325, 16184, -711, 486, + 1328, 114, -450, -31, 1152, 2154, -69, -252, + 32, 922, 219, -2055, 421, -1377, 1006, -614, + 234, -40, -84, 204, 27171, 182, 1034, 1536, + 834, -8038, 1243, -3074, -7829, 11165, -1854, -1173, + -871, 4105, 3588, -3191, 188, -2102, 124, -166, + 8070, -11066, 6632, 2739, -7787, 184, -5872, 1360, + -1089, 1273, 84, -1683, -1584, 975, -206, 1160, + 180, 12, -6121, 5436, -14726, 5949, -6756, 834, + 1750, -3142, -878, 7, -220, -1933, -141, 160, + 26, 756, -800, 6, -8104, -6989, 3353, -3518, + 4510, -12430, 736, -2685, -1042, 32, 1184, -519, + -312, -1073, -402, 71, -422, -35, 1791, 12735, + -2281, 2623, -1502, -3878, 6727, 10541, -1110, 2308, + 870, 1124, 874, -1406, 123, 254, 405, 328, + 3828, -7541, 3096, -14145, -672, -1725, -423, -1918, + 4164, -411, 3094, -568, 3575, -2895, -378, -3065, + -232, 449, 8110, 2264, -1383, -557, -10683, -7628, + 4155, 754, -134, 6759, 1051, -2054, -900, -948, + 579, -1277, 151, 462, 11562, -310, -8260, 10238, + -1309, -3052, 345, -689, -1133, -588, 548, 980, + -1332, 881, 368, 776, -704, 422, 12433, 1314, + -1487, -4753, 2679, 3092, -939, 136, -586, 3504, + -1034, -6318, 3506, 420, 2326, 1034, -252, -398, + -6232, 4488, -6166, -1754, 908, 4884, -5188, -2985, + 10793, -116, 4674, 3980, -9, 805, 1568, -1620, + -88, -146, 3027, -16154, 2899, 7839, 5912, -427, + 270, -1467, -387, -351, 615, -322, -2, -1061, + -654, 56, -438, 132, 2388, 460, 2172, 1874, + -3028, 3302, 2035, -704, -1222, -19835, -472, -1858, + -1686, -286, 5, -748, 491, -350, -4344, 103, + 1473, 2440, 13575, -1350, 1456, 10377, 1962, 3036, + -1238, 1580, 607, 1352, 997, 1212, -489, 251, + 4075, -3457, 6186, 786, 300, -2532, -373, -2522, + 3108, -294, 4938, -2980, 1509, 12450, -695, -1128, + -96, 354, -3678, 8494, 2480, 2264, 5162, 11907, + 4721, 1111, 752, 2999, 3924, -1429, 321, 276, + 309, -603, 601, -62, 3337, -3570, 3273, 6618, + -2001, 950, 532, 972, 1619, 956, 65, -609, + -281, -14769, -438, 580, 230, -228, -10108, 12289, + 8904, 872, -3296, 1535, -384, 477, -913, -777, + 546, 445, -1004, -435, -716, -138, 572, 435, + 4626, -864, -5716, -2810, 1291, -4796, -241, 2527, + -2342, -1360, 4161, 1886, -128, -1521, 13726, 1818, + -554, -157, -9665, 2607, -1013, 579, 1122, 1571, + -2684, 11364, -6464, -184, -1542, -5670, -1091, -670, + 1273, -1051, -7, -278, -2551, -548, -10673, -1434, + -343, 317, -3108, -1615, -2239, -14132, 490, -454, + 2467, 1990, 470, -1072, 440, 290, 3006, -4420, + -2083, 3050, 2779, -2349, -590, -4941, 7464, -9000, + -2686, -2045, -8712, -3281, -2476, 648, -148, 408, + -1367, -1113, 27347, -1113, 739, 39, 1443, -208, + -686, 986, 735, -702, 76, 665, -194, -165, + 366, -606, -4908, -3932, -15941, -2810, 4572, 816, + -2092, 4213, -2492, 4006, 926, 210, -1110, -1635, + -270, -226, -362, -187, 1790, 3016, 2216, 3890, + 2018, -1325, 19784, -771, 356, 2118, -98, -688, + 1016, 978, 559, -39, 160, -310, 6622, -1754, +-11104, 204, -2212, 2370, -11610, 1119, 3216, 3102, + 524, 278, -829, 524, 28, 838, 374, -76, + -4593, -2933, 10697, -6510, -4970, -2025, -9383, -3428, + -4112, 2665, 1459, -1411, 421, 481, 842, -341, + 147, -158, 4108, 45, 4935, -21, -7905, 2058, + 1158, 15260, -567, -752, -992, -1094, -1059, 2370, + 820, 655, -261, 280, -3969, 6342, 8521, 3114, + 369, -12269, 1684, 4, 4686, 1985, -3668, -3040, + 677, -254, 57, -161, -989, -379, 7075, -580, + 2846, -3177, -2285, 958, -7096, -154, -515, -3345, + 13487, 3548, -1804, 290, -430, 726, 399, 54, + -2814, 10235, 1958, -3356, -1330, 536, 3218, -14194, + 200, -796, -862, -1480, 1811, -346, 604, -391, + -231, 513, -10495, -6029, -6492, -8746, -357, -221, + -1890, -2669, 8, -1756, -5812, -1048, 2258, 223, + -474, 1154, -226, 348, -1590, 2915, 158, -24059, + 875, -846, 1150, -1000, -844, -116, -246, -219, + -482, -367, 120, 517, -489, 442, 8148, 5040, + 3770, -1006, -51, -3175, -10278, -4468, 1188, 1497, + -6515, -5, -1628, -2387, -1297, -717, 1630, 232, + -3608, -6688, 2444, -792, -246, 411, 1464, 3661, + 3244, -1121, -1602, -15398, -443, 882, 1412, 926, + 16, -73, 2693, 7168, -9399, 528, 7916, -9270, + -1669, -2756, 1304, 3074, -1510, -2089, 1491, -1556, + -422, -414, 132, -192, 5988, 4500, 7572, -10978, + -4875, 3685, 1888, -660, -1750, -515, -2728, -3133, + -2742, 666, -2861, 626, 256, 243, 4587, -3567, + -288, 2314, 4765, -11036, 7322, 7581, 2651, 3264, + -394, -246, -891, -1464, -1717, 123, -517, -486, + -1019, 7215, 554, 722, -4253, 2393, 3053, 2881, + 1538, -2104, 573, 321, 673, 3902, -2855, 944, +-12816, 370, 3496, 952, -1435, 6379, 766, 2273, + -729, 80, -2432, -1150, 2408, -895, 15497, -1231, + -282, -3306, -435, -167, -3528, -5683, -6413, 2501, + -4825, 124, 3128, -425, -2800, -986, -2283, -495, + -3392, -1560, -2093, -11613, -37, 157, -438, -794, + 1988, -45, 1508, 20, 98, -458, -245, 1130, + 110, -525, -771, 1120, 710, -21758, 174, -210, + -4839, -2468, -648, -4388, -11, 2990, -181, -4790, + -4232, 3634, 6427, 2772, 166, -2996, -12005, 1630, + -249, 179, 856, -1250, -4216, 1993, 5164, 4757, + -5071, 4331, -3029, -1276, -11184, -2864, 1238, 6332, + -2431, 1276, -338, -476, -5659, -2410, 2510, 1853, + -4853, -3175, -1896, 10728, 3724, 960, 9963, 305, + -938, -646, -2760, 1436, 113, -74, -3098, -4090, + 2950, 2701, 992, 206, -1393, -2179, -10862, -2396, + -1008, 2639, -1547, -416, 9264, 1824, -360, 401 +}, + +.cb4440m0 = { +-25793, -238, 1193, -2635, -238, 1315, -2277, 1588, + -896, 512, -864, 611, -398, 1277, -212, -358, + 202, 13250, 16, -860, 1618, -1024, 310, 11560, + -746, -3876, 780, -4087, -475, 857, 1017, -1439, + -890, 155, 8556, 362, -1158, 2116, -291, -66, + -1272, 510, -1394, 2259, -4761, 808, -740, -937, + 13993, 191, 273, -7670, 6776, 846, -1907, 955, +-13206, -1956, 1697, 1670, -329, -244, 2395, 6119, + -802, -1007, 649, -974, 170, -2136, -10780, 1020, + 1270, 1954, 1118, 13348, 983, -1394, -594, -514, + -586, 1026, -1821, 548, -298, 3342, 837, -1395, + 13977, 1021, -7792, -2930, 1466, 5494, -843, 2432, + 1378, -68, 174, 407, 76, -877, 691, -9445, + 522, -3448, 2549, -412, -2358, 875, -5044, -952, +-10113, 6574, -6347, -2760, -662, 29, -227, 4884, + 1304, 411, -3320, 2434, 785, -14822, 4412, 2272, + -6407, 2172, -613, -1665, 296, 742, 624, 135, + 5316, -3191, -855, -2061, 485, -3188, 2998, 1382, + 2516, -2438, -3506, -238, 737, -629, 1001, 773, + 17540, 1478, -724, -764, -1231, -1254, -1582, -692, + -351, -1551, -171, 183, 38, -668, 756, -770, + 24344, -905, -7182, 502, -3766, -1690, 1588, 1522, + 1844, 1276, 1458, -777, 1731, 4856, -14860, -1097, + 36, -1310, 846, -1500, 521, -3669, -252, 4480, + -2602, -845, 597, -4512, 1062, -292, -18518, 1972, + -334, -80, -1256, -366, 3640, -436, -12, -1670, + -435, 1496, 1429, -11092, 1012, -936, -1224, -12240, + -3048, 210, 1905, -1197, -357, -9759, -2632, -332, + -3417, 15078, 1496, 2206, 1800, 205, 1384, 3546, + -1853, 755, 1016, 726, 58, -150, -13053, 10375, + -2589, -330, 1616, 3081, 2763, -2617, -1204, 324, + -53, 2968, 1485, 214, 124, -334, -237, 16784, + 2612, 1023, -4298, -2156, 4336, -4307, 4952, 1036, + 81, -762, 3416, 714, -187, -4100, -757, 1124, + 10224, 7059, 424, -316, 1281, -12262, 912, -1999, + 2, -731, -184, 879, -934, -202, -391, -1046, + -338, -101, -17511, -1712, -5580, -2327, -2478, 1770, + -5825, 1499, 578, -130, 1424, -1818, 110, 542, + 22, 988, -4227, 2836, -1447, 1170, 12335, 2179, +-11216, -2500, 64, -912, -954, 654, -802, -455, + -597, 234, -296, 811, 1083, 1848, 4148, 637, + -6608, -2362, -3382, -664, -13088, 2839, 3090, 3294, + -4554, 2518, -55, 837, 1392, 5905, 1287, -1484, + 965, 16533, -3507, -1903, -1562, 2408, 5037, -4816, + 1409, 361, -1890, 170, -610, -1755, -524, -867, + -6238, -20117, -745, -956, -176, 2998, 130, -668, + -843, -267, -364, -573, 495, 127, -66, 32767, + 271, -408, 654, -123, 1831, 151, 996, 82, + 628, -251, 144, 198, -88, 357, 37, 612, + 184, 238, -584, -52, -30025, -415, 404, -566, + 100, 659, -336, 877, 211, -730, -377, 184, + -5256, -1484, -1191, -2108, 24, -7821, 209, -2856, + -1844, 697, 5798, -1191, 427, 11858, 1000, -261, + 184, -686, 1182, -3142, -3138, 139, 144, 117, + 3658, -3566, -1562, 672, 2036, 15051, -5069, -551, + 529, 1696, -214, -2678, -5966, -3707, 2847, -2554, + -1760, -1196, 2088, 6372, 1778, 12935, 2189, 1992, + 1761, 578, -542, -753, -1182, 4321, 1871, 309, + 704, -1259, 884, 19136, -2665, 1096, 3048, -167, + 872, -344, -1092, 464, 3255, -86, 1608, -1062, + -1569, -1699, 4504, -274, 568, 1428, 20571, 1452, + -894, -791, 459, -882, -1048, -2944, -11095, -783, + -832, -2450, 650, 2784, 3156, 529, 457, 483, +-12553, 655, 686, -757, 929, 212, 1242, -201, + -1627, 4826, -1895, 997, -3225, 84, 80, 287, + -2136, 405, -188, -890, -18272, -511, -118, -3642, + -1018, 420, 12650, -474, -540, 6978, 6977, 4418, + 1162, -1332, -1112, -1765, 2640, 562, -1164, 1256, + 595, 567, -483, -31511, -960, -816, 756, 1505, + 12, -518, 234, 184, 679, 328, -600, -137, + 267, -440, 2540, 593, 1023, -11756, 626, -2034, + 5756, -9882, 3175, -1190, 1628, 3920, 3219, 1394, + 834, -140, 4036, 4722, -455, 3105, -1355, -3106, + 1000, 7806, -2227, 687, -1580, 3180, -12302, -1394, + -425, 488, -187, -36, 219, 158, 12006, 1683, + 2151, -2, -1110, -12250, -59, 672, 1844, 2084, + -2101, 1652, -783, 634, -13257, -339, 3932, 2260, +-12452, 152, 316, -688, 79, -912, -2081, 1384, + 188, 1942, -706, 204, 700, 1776, 13901, -13666, + -324, 472, 1055, -646, 82, -769, -877, -443, + -227, -900, 636, -870, 470, -112, -598, -4402, + -2726, 1775, -216, -43, -18675, -863, -4604, 3433, + 674, -155, 208, 1546, 294, -157, -616, 11070, + 1229, -528, 2124, 699, 3624, 54, -516, 194, +-13556, 1902, -506, -1317, 1916, 471, -342, 836, + 18, 906, 614, -8, -951, 1052, -97, 2212, + -924, 310, 6, -733, 122, 23731, 468, 345, + 1545, 1434, 611, 403, -3136, -2214, -54, 1023, + -1390, -5243, -3744, -258, 6871, -1778, 673, -2362, +-13007, -776, -974, -1077, 8386, -3978, -4325, 1236, + 4011, 1161, -263, 1224, -12957, -100, 2801, 1458, + -3081, 578, 17, 1037, -742, 5972, -632, 2904, +-12721, -6733, -478, 182, -1973, -820, -6911, -4904, + -942, -348, -353, -350, 7864, 34, 568, 1985, + 956, 3310, 118, -2067, 12600, 9063, 1609, -1261, + 296, -1248, -1656, -65, 1832, 1525, 1503, 5149, + 4370, -1638, -3868, 320, 1527, -424, 17676, 1780, + 1172, -1132, 1128, 1294, -322, -101, 462, -6668, + -3024, 7573, -11088, 1581, 13, -1398, 550, 4376, + 1623, 1727, 857, -5310, 2528, -529, -401, 539, + 6508, 4246, 4105, -5363, 96, -13407, -694, 5061, + 3445, -3283, -348, -1470, 1114, 602, -404, -129, + 642, 1547, 23110, -2255, 1969, 333, 1297, 116, + -1691, 364, -528, 758, -1239, -1826, -249, -395, + 684, -856, -638, -10000, -2773, -6151, -1244, -3138, + -9688, -1994, 7124, 1368, -1870, -312, 1863, -1006, + 963, 789, 743, -4158, -760, 1384, -7525, -959, + -262, 5752, 4005, -12037, -210, 886, -1961, 4895, + -251, -158, 212, 677, 518, 342, -226, -360, + 466, 17, 28392, -20, 246, -686, -258, 640, + -378, -120, -443, 1078, -2612, 2084, -1706, 4334, + -4675, -4634, 2336, -9998, 9975, -1285, 2778, 3292, + -1717, 138, 2114, -1120, -180, -1146, 11988, 829, + -2530, -8827, 6833, -1191, -1653, 2691, -4067, 1166, + 1971, 303, -544, -1459, -261, 1065, 3410, 2050, + 3163, -515, 5456, -4261, 5483, 1531, -2098, 2020, + 3773, 588, 915, 158, -11876, 282, -1180, 265, + 11036, -66, -1741, -1894, -4234, 3048, 218, -1030, + 2240, -12666, -2290, -1673, -1911, 1480, 287, -81, + 1182, 216, -10734, 2201, -58, -619, 8585, -574, + -4576, 1852, -468, -6759, -7667, 167, 995, -1114, + -1276, -2053, 2178, -8133, -1270, -7822, -10582, 5380, + 3037, 1071, 827, 4972, 1024, -129, -180, -3002, + -846, -736, 9587, 1890, 10287, -1954, 1042, 1558, + -950, 2406, -1852, 2275, 6694, -703, -910, 3854, + 812, 521, -1075, -761, 5357, -3911, 3892, 7944, + 4580, 5031, 1088, 7116, -1746, -5223, 2607, 3227, + 2296, 5603, 211, -731, 6450, -3312, -12378, -326, + 4245, 4168, -799, -3563, -505, 725, -5297, 2196, + 2221, -16, -3472, 315, 626, -6131, 71, 920, + -4383, -1340, -2675, -664, 7412, -1240, -1361, 997, + -3817, -2377, -11717, 1661, 22, 540, -5261, -950, + 7472, 3148, 7647, -4400, 4558, -4412, -869, -1528, + -2618, 8311, 2110, 534, -460, -223, -162, -828, + 274, 1844, 1861, -1583, 6899, 5222, -1772, -2880, + -6400, 4703, 2606, -3990, -1224, -4160, 9032, -299 +}, + +.cb4440m1 = { + 32767, 383, 857, -1579, -423, 1164, -1606, 1218, + -410, 777, -292, 122, 282, -74, -1394, 259, + -734, 102, -82, 32616, 427, -545, -146, -141, + 340, 506, -808, 171, -778, 900, -204, -277, + -228, -426, 566, -481, -1138, -907, 112, 2722, + 871, 115, -7202, 1953, -826, -1812, -396, -14722, + -840, 155, 1114, 5624, 1112, -147, -6383, 926, + 1505, 360, 937, -13391, 969, 7062, 2218, -3531, + 471, 458, 191, -465, 8664, -1168, 546, 2109, + -944, -74, 1644, -81, -760, -1920, 2659, 13330, + 1511, -1148, 1346, 796, -20, -15616, 1246, -1190, +-10882, -774, -70, 3643, -896, 1830, -192, 1018, + 1085, -95, -309, 659, 91, 727, -4486, 486, + -2078, 1235, -14415, -4053, -1619, -2589, -582, -4650, + 4076, -762, -1111, 277, 1448, -742, -314, -979, + 1889, 2679, -1972, 2480, 302, 2869, -9183, -445, + -1817, 12894, 106, 187, -1406, -615, -1174, 746, + -371, 382, 350, -1811, -527, 36, 500, -835, + -106, 1134, -2207, 1021, 348, 908, -21780, 448, + 688, -60, -1790, 1901, -22990, 1467, 596, -912, + -3190, 1484, 269, -409, -474, -1670, 1328, 152, + -402, 359, -734, -13208, 62, -4197, -6242, 5195, + -2841, 5030, 2794, 1264, -1130, 3821, 961, 729, + 1075, 49, -148, 7267, 2596, -5093, -8284, -6875, + -3059, 3909, -4635, 1402, -6334, -342, -3083, -861, + 490, 1257, -630, 128, 2240, 832, 1060, -1802, + -1652, 128, 7816, -14391, -6722, -3328, -2586, 3044, + 1088, 1577, 852, -142, -176, 1371, 1236, 976, + 12165, -1596, -199, -504, -11020, -582, 972, -1468, + -2402, -666, -3327, -2148, 1078, -194, 9675, -2102, + -1236, -70, -942, 291, 1364, 1403, -3362, 12963, + -375, -1728, 1615, -2354, 633, -506, -194, 13037, + 14172, 534, -1026, -425, 2488, -180, -678, -436, + 272, 1507, -334, 840, -1000, -1068, 1029, -306, + 24, -4435, -5994, -1307, 4251, 3968, 2527, -981, + -2626, -4400, -242, -1823, -679, 12831, -22, 51, + -381, 2422, -2376, -8156, -1477, -6974, 1102, -373, + 467, 11314, -554, -432, 824, 7277, 393, -178, + 179, -653, 11848, -1593, 14143, -731, -1036, -2322, + 261, -1992, -1152, -1430, -1354, -51, -285, -1637, + 144, -59, -2182, 5731, 538, -880, 397, 3010, + 707, -1822, -1006, 4686, -5096, 4246, -3096, -3997, + -254, -11025, 394, -345, 18780, -686, -517, -3422, + 104, -2173, 2439, -5400, -10, 1084, 1821, -602, + 1431, 405, 2143, 499, 405, 351, -62, -47, + 1954, -29915, 440, 1054, 559, -1210, 442, 928, + -1, 59, 279, -112, -110, -440, -396, 805, + 311, 858, -431, -1070, -30192, 135, 1246, -345, + 790, 498, 319, -302, -469, -10, 512, -829, + -526, -2052, 2456, 134, -19375, -1210, -1292, 640, + 3232, 2580, 973, -2412, 271, -282, 632, -523, + -847, -138, -990, 2501, 536, -166, 2100, -357, + 122, 466, -4, 2034, 20083, 1578, 444, -344, + -689, 5733, -456, -503, -592, -1350, -1038, 932, + -1916, 1098, -990, -22687, 1544, -442, -396, -570, + -683, -616, -1431, 118, 4113, -312, 2300, 2093, + -2344, -2955, 6343, 4306, -10078, 6286, -5794, -806, + 664, -217, 548, 5072, 4626, -1643, -11619, 779, + 1956, -2960, 614, 2087, 9104, -2418, 775, -4447, + 768, 1599, -1084, 999, 1652, 1090, 630, -1197, + -3495, -912, -9817, 648, 3278, 1828, 13605, 2757, + -831, -1191, -1846, -1441, -278, -8530, -455, -495, + 323, -911, 2500, 14100, 3635, 1016, -936, 5265, + -3092, 2125, -121, -64, -656, -337, 9438, -7600, + 1403, -11917, 2180, 2612, 1664, 1091, -318, -3300, + -427, 282, 1979, 894, -703, 514, 160, 1697, + 6508, 828, 187, -34, -1094, -2861, 240, -5013, + 6004, -4796, -991, 158, 11437, -1730, 354, 1195, + 3790, -10432, -3584, 13872, 336, 2043, 221, 604, + 2930, 1080, -1417, 1878, -878, -459, -419, 364, + -1037, 7764, 3100, 48, 11057, 1936, 2229, 9150, + -472, 1178, -129, 2876, -249, -258, -1181, -329, + -581, -1140, -1967, 347, -539, -394, 775, -1151, + -31, 1052, -1900, -213, -1552, 22484, 164, -113, + 135, -1294, 550, 7738, -7223, -739, 1362, 5518, + 193, -2170, -11861, -1357, 351, 2215, 165, 16, + -606, 727, -158, -772, -13420, -1248, 12422, -812, + 1768, -442, 1269, -1076, 899, 124, -249, -1110, + 653, -3064, -1632, 839, -230, 512, 642, 13230, + 13285, -552, -1113, -595, 864, 537, -1012, -539, + -615, -491, 1014, 800, -10, 534, -1227, -25011, + 1239, -26, 3834, 104, 762, 1259, 2112, -300, + -920, -812, 612, -1061, -378, -246, -7, 11042, +-18492, -1411, -77, 407, -556, 218, 1751, 1069, + -294, 1789, 904, 285, -76, 300, -160, -128, + -3398, -2001, 1689, 4946, -2750, 1427, -12632, -1873, + -1802, -1115, -2777, -4436, 2937, -6408, -467, 487, + 1043, 3914, -81, 1540, -11718, 1368, -12656, -583, + 1009, -416, 249, 1874, 1157, 994, -858, -154, + 294, 333, -26, 73, -1576, -20, -560, -1068, + 1325, -588, 26161, 1580, -411, -587, -1083, -79, + 762, 292, -622, 788, 284, 2014, 78, 554, + -516, 1340, 835, 300, -24827, 558, -705, -22, + 139, -159, -246, -585, 4318, 234, 1308, -198, + -3370, 5724, 2381, 13843, 4, 569, 8002, 1188, + -63, -1698, 4624, -405, -218, 4238, -888, -1180, + 3750, -4848, -9497, 293, -1087, -13274, -33, -2870, + 457, -618, 338, -34, 286, 345, -5321, 904, + -5656, -2082, 12644, -7423, 532, 958, -1997, -1483, + -2982, 3115, -1851, -2025, 1853, -918, -903, 1554, + 540, -16549, 1441, 2939, -1272, 3106, 2374, 3906, + -697, 1144, 750, -379, -6502, 980, 386, 36, + 1109, 1195, 6272, 4264, 1501, 5369, -1560, 3535, + 1084, 739, -1031, -4400, 8452, -430, -1787, -7669, + -231, -115, 4324, -1820, -2098, -786, 7478, -2709, +-14255, 5771, 115, -1700, -111, -1482, -1369, -112, + 122, -472, 233, 2427, 1816, 180, -481, 928, + 82, 84, -700, -448, -946, 1968, 1644, 168, + -167, 16164, 155, -10316, 941, -584, 488, 96, + 5205, 491, -1844, -13055, 1266, -352, -836, 558, + 1546, -1720, 313, 2033, 597, -14351, 4426, 3281, + -559, 2614, 3248, -2265, -10312, -1614, -288, 480, + 1419, -546, -485, 835, 960, 462, 923, 6518, + 834, -711, -12639, 8811, -207, 1806, 337, -1240, + -4796, 2383, 277, 1141, 969, 59, 197, 1365, + -614, -9144, 4824, -436, 4191, -2588, 4509, 391, + -5055, -3231, 6978, -6388, 51, 105, -863, 1050, + 13103, 12769, -420, -1562, -123, 2702, 292, 1061, + 123, 405, 1917, -275, 493, -95, -195, 130, + -2613, 9010, 196, -1382, 5903, 7281, 1585, 2557, + -876, 3166, 6910, 590, -3060, -559, 4722, 393, + 613, -392, -3022, 9892, 1808, 923, 8123, 9873, + -1665, 2349, 2894, 591, 2000, -3734, -917, 220, + 408, 296, -656, 2608, -1700, 400, -10734, 5434, + 6504, -1399, 2175, -1203, -6358, -1221, -5062, 45, + 970, -500, -1322, 1176, 5882, -11687, 6324, -2183, + 2327, 922, -5628, -3507, 2406, 874, 1399, 4518, + -343, 857, -224, 802, -725, -8561, 4432, 1974, + 1825, -2168, -451, -3408, 6587, 7589, 3361, -4711, + -1474, 3151, 1950, 1022, 1466, 9192, 4666, -822, + 1024, 2342, -2220, 1169, 10460, 2993, -988, -4407, + -6727, 902, 1659, 80, 106, 400, 34, 1746, + -6982, 10484, 6333, -845, -3333, 1764, 217, -4730, + -3306, -3664, -2830, 2254, -927, -55, 587, 1812, + 281, 4375, -3614, -1349, 1802, -6184, -2648, -4189, + -9381, -3243, -4147, 384, 2241, 5524, -478, -1534 +}, + +.cb4448l0 = { +-15402, -5156, -1798, -144, -4711, -4700, 2819, -389, + 148, -2600, 1706, -1906, -578, 495, 24, 829, + -383, -12581, 11667, -1039, 1395, 2670, -288, 23, + 628, -248, -512, 79, -326, -5428, -2830, -2476, + -1253, -915, 12042, -674, -110, 2950, 3885, -5799, + 983, 616, -652, -60, -372, 22, -141, -167, + 98, 125, -100, 27211, 133, -127, -271, -272, + -176, 1268, 173, -422, 2431, -3998, -2797, 2328, + 182, 6526, 3318, -6282, -10580, 3966, 8504, 527, + 9507, 6203, 990, -989, 6030, -136, 647, -1100, + -324, -2618, -2499, 500, -132, -842, 1237, 3599, + 2285, 2906, 10766, 11284, -2794, 242, 184, -1934, + 55, -839, -1181, 406, 855, 902, 10490, -327, + -1561, 5742, 428, 2218, 1523, 5229, 9130, -760, + 108, -140, 22229, 1132, 411, 720, 414, -356, + -745, -1276, -899, -562, 369, 5, -7770, 4101, + 3626, 126, -13, -4356, 728, -3197, 1930, -1470, + -6936, -410, 6720, 1897, -530, -4267, -2181, -876, + -472, -2540, -10234, 4008, 10217, -2561, -2021, 716, + -1378, -325, 427, -245, 314, -48, -118, -150, +-30295, -368, 256, 369, -656, -78, -246, -140, + -1250, -635, 1332, -13604, -10383, -1375, 353, 2417, + 2140, -349, 1460, -51, -309, 523, 509, 2352, + 1208, -377, -2023, 9708, 397, 1216, 10610, -4416, + 5520, 3902, -2119, -480, -420, 1170, 36, -3304, + 1550, -266, 1682, -808, 2420, 2700, 16239, 3910, + 572, -375, 85, -9775, -120, 2214, 2779, 11510, + 2628, -416, -1740, -1305, 1226, 78, 78, 635, + 422, -13892, 1302, -4117, -1218, 2681, -8436, -1723, + 2290, 2815, 1172, -181, -675, -475, -763, 2394, + -3639, 7903, -659, 2323, 4837, -6758, 9460, -1480, + -2403, -2783, 1496, 806, -458, -246, 12, -254, + 121, 1477, -633, -513, 791, 208, -390, -177, + -1292, -20471, -4401, -2678, 9026, 128, -265, 822, + 260, 11202, 3132, -1879, -3891, 1884, -842, -107, + 7516, 1208, -1552, -995, 1203, 2150, 11044, 1285, + 2282, 80, 1348, 5342, 2089, 924, 1472, -1454, + -8259, -226, -10259, -2335, -2442, 224, 3257, -1528, + 6685, 1630, 1969, 48, 4802, 6051, 987, 8662, + -2368, -4984, -1974, -4049, -5320, 5003, 299, -400, + 727, 208, -187, 2838, -4547, 9682, -2238, 1065, + -3206, 10091, 4915, 2945, -1635, -198, 1074, -698, + -716, -96, 1390, -2644, 1006, -4154, 10587, 1132, + 2912, -7399, -8350, 785, 156, -290, -142, -374, + -2161, 1066, 1358, -1798, 3050, -19, 452, 10470, +-10948, 4190, -984, -2089, -728, 1503, 4273, 812, + 4950, -3750, 844, -1231, -1582, -2517, 2385, -10537, + 5807, -4621, 332, -357, -12484, 1676, 160, 10762, + -1225, -1374, 14, -1389, -2900, -467, -1260, 459, + -861, 102, 1715, 4295, -7324, -7400, 10435, 287, + 1866, 765, 1730, 3430, -744, -2, -1773, -96, + 2001, 2165, 118, 9296, -4640, -4612, 7134, 5128, + -7967, 404, -433, -433, 2222, -8050, 2023, 2766, + -260, -2440, 1607, 2442, 7763, -486, 3766, 2355, + 7515, 230, 1248, -8873, -8224, -9135, -1402, -1812, + 1223, 152, -2316, -739, -405, -784, -598, 625, + 503, -175, -573, -31693, 502, -478, -554, -934, + 387, -80, -484, -701, -34, -51, -494, -1461, + 1005, 2920, 11532, 2667, -1674, -832, 8680, -5767, + 786, -1558, -2062, 1009, -392, 2099, -7277, -2587, + 6302, 3070, 4496, -1713, -4042, -8109, 1642, -1894, + 3450, 840, 3632, 160, 578, 149, 767, 754, + 208, -870, -672, 252, -30, -213, -482, 50, + -578, -2, -148, 246, -31918, -568, 130, 472, + 761, -27, -51, 454, 144, 124, 5844, -8354, + 9562, -3755, -262, 3286, 1120, 983, -628, -734, + -1732, -1424, 353, -403, 15877, -13552, -335, 337, + 519, 140, 297, 150, 725, -780, 876, -116, + -91, -128, 275, 2499, 9313, -768, -10469, 1148, + 2172, -6417, 3292, -2187, -1108, 3055, 1105, 625, + 794, 68, 337, 1384, -106, -516, 574, 868, + 849, -997, 81, 25796, 28, 206, -3556, -351, + 1058, 1126, -7826, 5310, -4102, 5352, -6835, -4032, + 1487, 230, 5617, 937, 10484, -71, 2653, 1203, + -1, 667, -1489, -10136, 7782, -763, 792, 1434, + -170, 367, 96, -21992, -252, 756, 145, -1476, + 1408, 1523, -819, -576, -476, -1068, -241, -39, + 1547, 9553, -622, -1799, 1861, 6115, -864, 10690, + -586, 470, 200, 1162, 586, 44, -11650, 3453, + 8734, -2754, -178, 236, -2650, 2654, 2699, 1180, + 5325, -458, -40, -218, -6, 126, 6794, 506, + 860, 11863, 652, 1665, -4213, 4863, 1424, 5712, + -663, -688, -10, -1421, -676, -1325, -378, -311, + -490, 19501, 1242, 268, 4581, 1587, -1153, 848, + -1378, -1159, 505, 63, 704, 1942, 2204, -2106, + 44, 479, -1098, 333, -21595, -617, -6444, 3547, + 1282, -1784, 4664, -1330, 2607, 1241, -3579, 247, + -875, 11359, -3013, -136, -12813, -14400, 1857, -998, + 1342, 1187, -338, 1263, 575, 1226, -995, 596, + 446, 293, 767, -356, 70, 786, 466, 202, + 149, 849, -28991, 652, 124, -209, -124, -406, + -5463, -1413, -1300, -5339, -1761, 4770, 2680, -10542, + 3486, 5601, 2932, 1581, 489, 521, -16583, 1, + -1529, 5942, 1234, 4714, -1647, 1150, 2802, 642, + 586, 3836, 240, 307, -490, 67, 771, 816, + -906, 1554, 1090, -2353, -629, 11291, 2941, -2982, + 9473, 1434, -4351, -8017, -5173, 8071, 1931, 1281, + -4055, -3224, -1918, -271, -204, 670, 3491, 107, +-31624, 227, 75, -91, 108, 171, -53, -201, + 373, 63, 118, 126, -104, 127, -88, 1810, + 11688, -10240, 550, 3692, -4978, -1619, 40, 911, + -1080, 580, -767, 333, 192, 403, 308, -904, + 142, 31169, 503, -1101, -146, -144, 35, 181, + -355, 54, 590, 499, 95, -1767, 444, -49, + 2160, 7176, 12032, 6478, -741, -5576, -644, -101, + -1251, -1268, 2365, 10029, 537, -1476, 307, 2108, + -2478, -944, 10725, 349, -4242, -135, 7577, -4492, + 1492, -2512, 7736, -5118, -6756, -2436, -1890, -2390, + 1620, 914, 1658, 47, -11692, -134, -1740, -196, + 9521, -136, -1376, -8682, -1136, 1096, 903, -1148, + -334, -228, -4, -675, -199, 1914, 2827, -11098, + -2129, -2559, -978, 175, 1832, 10075, -2358, -1888 +}, + +.cb4448l1 = { +-11514, -2858, 12392, -305, -206, 929, 473, -3120, + -2766, -1068, -1237, 420, -718, -21, -336, -45, + -478, -1517, 1830, -12644, 259, 11978, 257, 1494, + -1759, 247, -733, 112, -2242, 290, 234, -10260, + 1781, -1806, -4104, 1747, 38, -692, 4971, -9113, + -1925, -1580, -615, -9608, 3779, -11158, 469, -4736, + 299, -2815, 2108, 1910, -2356, 66, 523, -440, + 2298, -4219, -2512, -1110, 11192, 5932, -2629, -7985, + -992, 775, -1134, 3287, 900, -681, -39, -1206, + -1708, -6800, -361, 11024, 8496, -198, -3855, 1486, + -2547, 1773, 50, -276, -286, 785, -7884, 438, + 4590, 2794, 5333, 5476, 2108, 660, 3610, 2308, + -8538, 224, -132, 134, 731, 988, -1368, 3894, + 4318, 9911, -104, 320, -9506, 1721, -5690, 1712, + -8747, -1876, -5122, -1304, -162, 752, 3646, 1621, + 11089, 1117, -1971, 1058, 3070, 180, 23112, 175, + 483, -1028, -538, 497, 1053, 61, 788, -455, + 22, -55, -32, -326, 15956, -2045, 788, 9784, + -1170, -819, -3677, 647, -484, 578, -160, 286, + -421, 289, 8140, 3838, -578, -1866, -2074, 667, +-11951, 1684, 3439, 1280, 158, -1784, 1276, 638, + 562, 2045, -220, 852, -594, -2109, -2665, 2748, + 38, 91, 1377, -624, -18586, -498, -882, 36, + 536, -99, 62, -5275, 3051, 231, -6343, -1751, + 1206, -1646, -1347, -13590, 1431, -271, -442, 21934, + -143, -1824, -378, -463, 816, 379, 336, -291, + -652, 275, -758, 257, -14866, -1304, 7260, -3373, + 1249, -1992, 2734, -2565, -3064, -416, 2424, 279, + 10518, 206, -681, -14338, 666, 1843, -648, 526, + 1982, 366, 684, 1019, 192, 8, -482, -4785, + 2134, -1722, 10674, -1613, 33, 1148, -1566, 10226, + 3397, 667, -1100, -738, 2420, -14282, 451, 90, +-10346, 2673, 1175, -3639, 266, -566, 0, 1672, + 1082, 298, 359, -497, 1784, -570, -2538, 2522, + -3825, 6265, 99, -7927, 3160, 11079, 131, -2080, + 92, -29951, 268, -293, 240, 254, -182, -145, + 303, 12, 86, 596, 246, 136, 1020, -1521, + -1134, -10125, -5691, 6028, -3703, -4295, -3718, -5719, + -564, 660, -321, -1073, 83, -3068, 6167, 12788, + -762, 8057, -1215, 2379, 2142, -3625, -503, -1418, + -304, -649, -501, -12558, 12787, 3737, 1465, -3692, + -1321, 1106, -1136, -651, -50, 1608, 59, -583, + 82, 331, 443, 782, 93, 285, 310, 29149, + -698, -52, -909, -238, -222, -114, 4, 650, + -200, 235, 2541, 598, 378, 11000, 3101, -8228, + 1690, -4313, 6996, -11, -2620, -1458, -1428, 579, + -304, 20, -372, 897, 602, 432, -138, 690, + 593, -1485, 136, 191, -32147, 260, 199, 412, + -168, -41, -384, -362, -14, 242, 366, -318, + -304, 1544, 458, -7790, 3332, -5117, -1937, 868, + 12622, 906, 1941, 4763, 1698, 351, -234, -973, + 9166, 6726, 2686, 248, 3597, -9812, -400, 4155, + 2852, -415, 2218, 876, 1423, 3852, 2965, -410, + 1820, 8268, -1296, 686, 114, 3087, 3007, -9402, + -5751, -3459, -6674, 418, 4137, 4778, 56, -1399, + -1698, -2590, 8343, -2130, 2535, 6148, -134, -2393, + 11551, -338, 735, 630, -658, 13358, 949, -1136, + -217, -985, 182, -1014, 1459, 221, 7713, -1386, + -1427, 1326, 555, 66, 2694, -1535, -268, -13596, + 658, 305, 858, 548, -12748, -582, -1055, -659, +-12155, 940, -2164, -2518, -126, -132, -842, 641, + -483, -446, -5184, -186, -511, 1169, -6092, 6161, + 3082, -664, -2037, 847, 11032, -1306, -1673, -1219, + -36, 1862, 10053, 780, -282, -837, -263, 509, + -588, -12646, -769, -2164, -2219, 524, -3433, -6437, + 3890, -623, -7509, 241, 4042, 264, -1394, 3646, + -6925, -5184, 1218, -1476, -2240, 1882, 182, -3450, + -497, -148, 160, -1579, -19545, -80, 886, 913, + 708, 728, 393, -603, -778, 3414, -778, -1495, + 1205, 2342, 232, -3634, -76, -16792, -684, 1322, + 192, -13248, -658, 7650, 4731, -169, 5148, -1413, + 3026, 2480, -2190, 1004, -2082, 237, 171, -717, + -766, -525, -11802, -3776, -9914, 1374, -3250, 415, + -2787, -175, -1081, 792, 980, 11464, 834, 714, + -993, 150, 77, 2306, 11249, -3058, -3418, -1758, + -239, -119, -1408, 6083, -4276, 1827, 1660, 2287, + -2997, -576, 400, 2062, -3174, -6215, 10026, -1082, + 41, 249, 10026, -6199, -301, 280, 10120, 2249, + 527, -564, 1002, 622, 3341, 408, 2870, 12902, + 13307, 689, 336, -819, -43, 832, -1242, 657, + -106, 42, 1123, 149, -2072, 78, -303, 329, + 21745, -2172, -1204, 448, 1437, -560, -376, 311, + -73, 153, -785, -368, 54, -445, -92, 120, + -59, -377, 402, 567, -25820, 1284, 1288, 200, + -865, -1286, -41, -1862, 402, 179, -2338, -3876, + 4992, -1824, -10092, -3407, -8516, -3556, 130, -5695, + 5846, 2333, 2995, 2110, -6946, 5049, -2377, 1655, + -859, -4737, 1648, 7031, -7344, 4992, 1760, -711, + 3134, 14363, -907, 171, -1971, -3062, -1079, 600, + 603, -224, -440, -11328, -291, -663, 1878, -715, + -2724, 284, -456, -10970, -3225, -2240, 252, -977, + -360, 729, -572, 3981, 1615, -52, -5372, 6095, + -9888, 6873, -3830, 4916, 1834, -1581, -11268, -2316, + -398, 1361, 6151, 2736, -1968, 4624, -180, -260, + -1221, -5633, -1300, -1081, -1433, -509, 366, -388, + 1660, 340, -18997, 694, -1184, -813, 1324, 1261, + 735, -186, 5258, -583, -221, 1707, 149, 1022, + -835, 1089, 2939, 2025, 421, 411, 3609, -13797, + 464, 9214, 2462, -6257, 6032, 1911, 1282, -9673, + 974, -703, -128, 950, 369, 1160, -674, -312, +-13858, 1078, -7606, 8, 2786, 367, -6441, -824, + -195, 714, 484, 108, 475, 289, -1012, -1591, +-10880, -324, -647, -2199, 10378, 5781, 995, -416, + 871, -1240, -380, 70, -1893, 7632, 1727, -908, + -672, -10901, -962, -7322, 794, 1748, -5568, 1215, + 5845, -9575, -2413, -2159, 3077, 1359, -416, 6277, + -85, 1352, -3498, 6130, 1125, -236, 1950, 8481, + 716, -560, -1311, -228, 250, -440, -5320, -1941, + -9710, 4637, 1420, -102, -8222, 616, -2254, -528, + 196, -1315, -749, -97, -285, -15880, 1105, 630, + 368, -809, 29, -1688, -2314, 745, -1627, 19840, + -2380, 4108, 1670, 2763, 275, 530, 492, -589 +}, + +.cb4448s0 = { +-10720, 9997, -1313, 8849, 5152, -226, -2908, 303, + -842, -870, 165, -1372, -105, -154, 170, 2424, + -2476, -2126, -8329, 349, -4509, 5128, -92, 9086, + -7263, 416, -124, 341, -88, 239, 5172, 553, + 1526, 1728, 1955, -1489, -6595, -11237, -10224, -394, + -927, -932, 674, 743, 317, 4628, 8453, -3768, + 2545, 3506, -2406, 9108, 5643, 4660, 4116, -2452, + -1391, -154, -74, 180, 5270, -7922, 46, 11046, + 6076, 735, 7922, -196, -1080, 1445, -687, -2403, + -784, 742, -269, -498, 6010, -4045, 1053, 891, + -1538, 613, -84, -4254, -957, 4682, -14004, 2050, + -647, -718, 557, -2720, 2437, -7675, 11874, -9284, + -734, 775, -2231, 105, 366, 1360, -98, -126, + 508, 2647, 729, 762, -8806, -10413, 9008, -2093, + 1107, 201, 1421, 1181, -259, 1420, 828, 327, + -1956, -573, -874, 354, 2662, -1437, 10864, -9240, + -7648, 1670, 1598, 173, 438, -373, -566, 246, +-11999, 1817, -611, 1, -1652, 1876, 1354, 1270, + -789, 300, -321, 11577, -516, 329, 5723, 4732, + 1717, -6224, -5356, -6292, -370, -3644, -922, -50, + -14, -581, -1554, -1675, -20, -965, 28479, 658, + -498, -488, 504, -601, 437, -585, -245, -196, + 186, 281, -174, 159, 7469, 5890, -5112, 4918, + -9023, -360, 40, -2975, 4784, -437, 1609, 1032, + 2759, -297, 106, 5176, -4315, 568, -9536, -1297, + -6783, -10965, 1285, 264, 330, -508, -522, 624, + 662, 539, 7248, -13780, 40, 2140, -2188, 1925, + -8972, 1147, -1340, 870, 779, -4, -101, -374, + 781, 5733, -5712, -5777, 2080, 875, 13450, -1551, + -3229, -1818, -114, 1265, 501, 636, -576, -623, + -1269, 3006, 1023, 862, 1359, 1950, 588, -22648, + 218, -438, 1547, -408, -844, -263, -106, 14754, + -689, -9466, -978, -21, 1412, 43, 2012, 352, + 908, 277, -960, -747, -230, -1557, -7132, -5707, + 79, -2474, 2177, -5349, 2510, -12720, 2833, -2152, + -1693, 458, 197, -643, 735, -2728, -893, 2758, + 5196, -3566, -4294, -4914, -1222, 188, -8884, -6234, + 2391, -1518, 663, 572, -1465, 1147, 8486, 2037, + 2516, 941, 6092, 11602, -2559, -1702, -1848, -924, + -210, -108, -1052, 8360, -7567, -4588, -169, 3464, + -9206, 1842, -4329, -2499, -341, 592, 918, -102, + 340, 214, 1037, -324, -16289, 10308, -47, -29, + 1340, -603, -2763, -548, 392, 1489, -149, -769, + -67, 13270, -2233, 8257, 1582, 1034, -4270, 916, + 4486, 1191, -102, 159, 109, -536, -664, -987, + -8041, -1759, 4264, -5600, -13815, -1158, 1712, 2516, + -634, 504, 515, 732, -46, -685, -481, 1685, + -1782, 262, -3600, 14721, 6334, 7941, 101, 914, + -2141, -2, 182, 829, -215, -122, 6325, -3752, + -2812, 1618, 3512, -1591, -4276, 6994, -10349, -5675, + -1501, -1766, -1949, 436, 82, -5596, 2592, -1086, + -2804, 2540, 458, -550, -1834, -2401, -7563, 2340, + 1678, -7666, 4538, 27, 6337, 3642, 17068, 5310, + 1115, 1579, -142, -397, -670, 2010, 863, -504, + 845, 848, 770, -8821, 1963, 2782, 162, 1130, + 2597, -13699, -3996, 800, 2499, -1045, -1512, -186, + -59, -119, -5048, 6800, -8766, 784, -7091, -1002, + 335, 1993, -1045, 601, 1804, 166, 1343, 110, + -224, 2247, -344, -5, -4292, 5846, 8591, -11846, + -1303, -1027, 1759, -168, -194, -1281, 489, 378, + -5069, -3321, 11238, -375, -806, 3962, 9660, -2960, + -664, -1067, -627, 271, 1205, 1160, 261, 3725, + 7877, -679, 22, 598, -1086, -420, 2168, -46, +-15552, 420, 1220, 1332, -58, -156, 7777, -4657, + 352, 15316, -4760, -2140, -2577, -1321, 2037, -371, + -1254, -912, -1177, -1367, -103, 4572, -9482, -1599, + 294, 403, -272, -2331, -4365, 13467, 4585, -2554, + -1743, 545, 162, -369, 6074, 11273, -8856, -8175, + 2543, -7, 314, -2033, 2704, -1755, -1431, -791, + -276, 1085, 236, 6553, 1872, 387, 1056, -31, +-20610, -609, 608, 1007, 1604, -1501, -68, -527, + 204, 252, 2533, -721, 1468, 444, -72, 61, + -209, 512, -216, 42, 385, -490, -104, -29030, + -166, -4883, -2754, 788, -430, -867, 565, -1155, + 562, 1076, 1757, -2990, -14971, 8392, 902, 550, + 102, -6579, -6939, -319, 172, -863, 979, 2178, + 630, 160, 952, 946, -3955, 1515, 352, 2557, + -5339, 6166, 4588, -2040, 4031, -535, -2504, 2782, +-12136, 1338, -2758, 458, -671, 155, 6998, -2598, + -931, -396, -922, 2060, 447, -42, -649, -532, + -552, -1945, -16548, 815, -408, 3469, -4118, 875, + -1017, -11150, -511, 3846, -11349, -1928, -781, 2765, + -681, -713, 655, -218, -8032, -465, 295, 1591, + -383, -1889, 1627, 108, 1149, 2513, 388, -5702, +-15693, 24, 470, -4322, 3721, 1584, 1808, 350, + -1765, -620, -2953, 4354, 8512, -12533, -86, -2490, + -192, -507, 2024, 3942, -801, 13444, 738, -2086, + 162, 2013, 837, 56, -384, 3164, 5052, 1158, + -403, -6913, -4290, -2068, 16622, -2738, 856, -2884, + -2432, -410, -1179, -456, 504, -1359, 436, 352, + -6351, 327, -2196, -1502, 302, 338, -839, 235, + -520, 1283, 2710, 18814, 2256, -2, 400, 1300, + -1185, 1024, -3744, -3542, -4350, -763, 1902, -14737, + 5437, 48, -1589, -280, -67, 232, 2276, 1413, + 3284, -308, 1013, 610, 22787, -685, 724, 12, + -359, -1651, -1060, 569, 248, 3836, 605, -413, + 3380, -1360, -1120, -2933, -2368, -977, 10135, 12356, + 3739, -1571, -418, 580, -2662, -11460, -6128, 2867, + 11468, 825, -3201, -501, -138, -755, -554, 168, + 757, -564, 428, -12118, -15179, -1978, 432, -597, + 1528, 3038, -568, 1349, -3377, 914, 498, 928, + -91, -5, 9192, 3000, 2542, -1411, 626, 2705, + -763, 3247, 13736, 3034, 2170, -67, -852, -378, + 1264, -2771, -2415, -4236, 126, -1984, -13336, -1088, + -416, -1979, -520, 2506, -1505, 294, -2398, 218, + -8740, -3873, 2069, -1374, 86, -998, -3851, 1070, + 13357, 955, 3085, -536, 166, 926, 299, 6532, + 1324, -502, -1658, 1829, -1263, 445, -1902, 1452, + -2747, -16422, 1875, 1773, 452, 288, 5992, 1626, + 3659, -917, 2255, -1508, 356, 547, 158, 9, + -117, -1665, -595, 14392, -1013, 49, -4060, 12064, + 3666, -2903, -9145, -396, -4341, -953, 2758, -178, + -204, -462, 98, 222, -3622, -12200, -4484, -94, + -8642, -5694, 4034, -720, -1695, 751, -1668, -266, + -343, 296, -112, -900, -3750, -360, 1002, -7402, + 7758, 7370, 3332, -7517, -769, -1272, 412, -1451, + -89, -227, -11332, -472, -1108, -394, -339, -1981, + -3494, 12110, -564, -5958, -690, -1066, -130, 762, + -50, -1456, -1521, -8428, 994, -867, 2650, -2335, + 354, -2253, 4612, -12364, -2626, 1853, 577, -103 +}, + +.cb4448s1 = { + 25901, -239, 648, 167, -284, 198, -340, -1112, + -55, -242, -214, 528, 112, -259, -284, -250, + 23, 475, 780, -558, 111, 148, -2411, -19826, + -1158, 2799, -964, 44, -1204, 1187, -4036, 1872, + 3541, 768, 159, 1979, 3382, -113, 804, -1021, + 3708, -2577, 9697, 11527, -326, -7058, 4306, 1260, + 3782, 3370, 1595, 705, 2268, 2182, 1509, 1131, + 9877, -7260, -258, 49, 1686, -1472, -2556, -1973, +-22425, 338, 486, 963, 1069, -34, -1027, -90, + -881, -473, 554, -6326, -873, -9744, 10157, -1079, + 584, -1047, -1954, 6204, 2416, -899, 1452, 938, + -439, -664, 4231, 9370, 7800, 170, 9448, -4756, + 1967, 686, -1186, 636, -1719, -1244, -540, -728, + 306, -1778, -7980, -3418, 8318, -1828, 1556, 3487, + 10195, 3741, -510, 2077, -1496, 1241, 384, 477, + -1051, 7922, -4077, -2513, 849, -693, -9170, 4264, + -7940, -1703, 460, -2986, 586, 13, 377, 781, + -7047, 6852, -1350, 7537, -493, -1919, 379, 3108, + 4293, 8467, -3875, 63, 44, 493, 1496, -1577, + -5676, 3318, 6628, 5177, -11082, 1146, 3251, -1159, + -461, 442, 1250, 212, 176, 3586, 137, -9153, +-13772, -8211, 393, 1170, 1717, -671, 298, -233, + 883, -1533, 401, 254, 7700, -4827, 794, 377, + -376, 12240, 7298, 2445, 1168, -562, 1528, 563, + 421, -606, 0, 5792, -1069, 824, 3728, -2729, + 1005, -730, 4318, 644, 17336, -1588, 2100, -365, + 509, -415, 3684, -9128, -1096, -4278, 1549, -1247, + 5519, 11075, -2216, 6004, -3683, 409, -730, -414, + -263, -6623, 8194, 489, -9085, 334, -1104, -814, + 1412, 1522, -1657, -7029, -4142, -1274, -520, -40, + 650, -1886, 9701, 11456, -7567, 1176, 3268, 3016, + 1109, -117, -858, -155, -1249, -230, -216, 3945, + 9142, -2297, 134, -2563, 15131, 857, -1597, -618, + 150, -590, -166, -357, 388, -69, -8767, 2914, + 1087, 4673, -14373, 600, 382, -1893, 844, -242, + 544, -106, 568, -1141, 371, 2663, -1860, -725, + 8066, -1353, -8743, -10433, -1796, 427, -73, 178, + 96, 980, -478, 978, 1767, 6034, 633, 966, + 677, -65, -884, 417, 461, 62, -868, 93, + -100, 519, 16304, 2646, -1260, 12271, -140, 142, + 11138, -892, -2114, -629, 172, 744, -2056, -960, + 61, -980, 2082, -439, -3126, -2564, 1174, -78, + 254, -178, 1599, -436, 19023, 5335, -1686, -782, + 520, -8727, 256, -3588, -5694, 12323, -2091, 1511, + -656, 3872, 2370, -770, 282, 455, -573, -39, + 7845, -12566, 12690, -156, -442, -227, 575, -274, + -1717, 120, -40, 1866, 635, 161, 270, 1039, + 3256, -673, -3343, 4292, -14247, 7142, -4821, -591, + -418, 376, 21, 572, 551, 70, -5536, 79, + 2540, -505, -283, -350, -1279, -1630, 2234, -604, + 5246, -17580, -3022, -1052, -307, 6626, 2794, 1702, + 1875, -1876, 1011, -320, 1268, -282, 1072, 14370, + -8206, 1218, 630, 173, 7486, 15176, -6146, 4903, + -636, -1341, 1360, -1541, -1012, -778, 84, 426, + -124, -746, -252, -11085, 1783, -2833, 809, -744, + 2194, 3328, 7029, -5097, 4934, -3025, -641, 303, + -328, 258, 8674, 53, -3395, 975, -9944, -8550, + 3376, -714, 1078, 1186, 598, 808, -166, -752, + 484, -5088, 1484, -1278, 11394, -1876, -8236, 5159, + -1830, -1520, 2761, 592, -204, -1360, 454, 230, + -5038, -1582, -5617, 1346, -2045, 2306, 17764, 494, + 572, -1930, 339, 550, 784, 151, -753, 4708, + -3058, -8267, 3281, -1054, 870, -1201, -2005, -920, +-10115, 5395, -6423, -798, 367, -221, -5296, -2808, + 8313, -5077, 1655, -200, 114, 46, 350, -2374, + 868, -327, 377, -9570, 1231, 9258, 8752, 3074, + -4411, -308, 2315, 6824, -3303, -896, -1186, 579, + -2561, 2280, 586, -798, 4747, -3487, 1306, -1241, + -487, -90, -52, 3231, -555, -17702, -2681, 1649, + -17, -278, -647, -4225, 2740, -1248, -3826, 1356, + 3572, -1010, 16160, -422, 304, 3970, 1124, -317, + -554, 673, -1191, 3180, -4429, 1581, 1543, -2097, + 4208, -9363, 10146, 1896, 2904, -4112, -1428, -207, + 459, -35, 5395, -8960, 3141, 11004, 308, 3687, + 1540, -2156, -592, 1640, 1003, -280, 797, 204, + 6910, -824, 4724, 4729, 5553, -3165, 483, -12, + 33, -588, -379, 402, 3543, -9646, 74, 9603, + -465, 2872, -2367, -885, 2894, -133, 2758, -721, + 3473, -13322, 1506, -1344, 512, 1066, -8300, 11391, + 11976, -1201, 13, -612, 165, -1823, 154, -123, + 1234, -423, -367, -58, 384, 2687, 2536, 826, + 6223, 1750, -8589, 1126, 9772, -6646, 2043, 1826, + -1037, -2018, 692, -818, -3431, -467, 11006, 3407, + 880, -2047, -10303, 6168, 1428, -307, -18, 661, + -252, 754, 1207, -2797, -3057, -6235, 99, -931, + 1618, 692, 2790, -294, -1200, -5768, -11691, -5305, + -100, 390, -783, -11660, -4675, -13570, 2764, 1414, + -786, 385, 163, 718, 794, 1118, 827, -634, + -75, 6224, 3965, -2092, -1120, -6395, 5474, -12986, + -3985, 635, -544, -1877, -191, 0, 121, 379, + -3059, 132, 26320, -721, 1262, -706, 421, -85, + -38, 665, 590, -208, -196, 168, 10, 1271, + -218, -365, -5843, -5897, -12346, -3026, 5916, -115, + -2671, -1022, -203, 962, 995, -850, 527, -516, + -1641, 452, 68, 1204, 740, 385, 38, 752, + 150, -3088, 20608, -54, -39, 6109, 3224, -92, + -315, 4407, -306, 1317, -395, -1617, 9104, -3493, +-10724, -3059, 283, 81, -9791, -3210, 7307, 4459, + -639, -61, 1152, -184, 2290, 398, -2902, -2776, + -1624, 1153, 242, -8865, -3617, 309, -11933, -3847, + -5750, 3235, -153, -315, 382, 209, -923, 2072, + 458, 164, 3631, 3121, 3220, -828, -8644, 2215, + 3873, 12445, 533, -631, -53, -136, -728, -240, + 420, 2870, -4981, 906, -3272, 4735, 3613, 2412, + -3951, -10587, 7389, 564, 3266, -1348, 524, 1570, + 6611, 3354, -1042, 1862, 1860, -1187, 5761, -1722, + 8231, -7428, -5662, 1239, -2887, -218, 810, -1063, + 15078, 686, -2374, -293, -2031, -245, 4441, 5045, + 1100, 6722, 1787, -587, -380, 132, 5124, -12478, + 95, -1230, 1464, -1871, 929, 1430, 2666, -3768, + 2784, -3697, -8238, -247, 603, -8406, 1330, 1033, + -743, -2546, 2739, 856, -12698, -4970, 2290, -1104, + 34, -1048, -80, 634, -695, -84, 2374, -24793, + -1064, -1080, -254, -812, 252, -1582, -401, 765, + 847, 340, 479, -3163, 150, -187, 8432, 2607, + 2075, 1384, 423, -7361, -10262, -2254, 54, 1065, + 40, 857, 2014, -5076, 198, 657, 482, -422, + -2185, -850, -318, 164, -684, 2698, -1008, 17493, + -64, -6788, -5966, -14352, -2349, 2492, 266, 1077, + 1935, -99, 4270, 2319, -2391, 779, 187, -70 +}, + +.cb4448m0 = { +-20455, 663, -3140, 2540, -2110, -406, 1078, 1968, + -741, -2458, 490, -496, 338, 581, 1079, -616, + 154, 10097, 231, -228, 477, 20, 1372, 11492, + -1112, -3148, 547, 248, -676, 8197, 5902, -1299, + 519, -2808, 11529, -76, 1239, -1032, -542, 353, + -1071, 278, 274, 2781, -7741, 3260, 2711, 175, + 12340, 1110, -2348, -5303, 1440, 581, -70, 262, + -9902, -2375, 530, 1433, 1624, -1475, -947, 13450, + 1318, -1696, 207, 198, 1162, -944, -9329, -1046, + 195, -106, 682, 14624, -854, -2410, 1054, 242, + -348, 581, 463, 716, 760, 2714, 1356, -1359, + 13089, 2565, -10523, 1934, 637, 1218, 1160, 830, + 905, 272, 408, -581, -1426, 613, 2586, -8186, + 3748, -6663, 4372, -114, -4644, 2998, -9440, 685, + -8741, 3363, -5623, -4229, -7058, -1201, -822, 1806, + 8671, -856, -612, 1165, -426, 317, 6867, -80, + -7084, 1143, -1862, 2742, 669, 550, 22, 173, + 4301, -10406, 1042, -346, -1334, -2897, 647, 744, + 14, -1338, -1648, -1235, 3550, -455, 2125, 1188, + 17136, 1188, -6782, -849, 298, -1054, -9254, 409, + -1736, 1410, -7254, -1889, 457, -740, 22, 262, + 32242, 1657, -2308, 2688, -607, 609, 4, 150, + -264, 192, -140, 246, -393, -76, -15050, 390, + 969, 457, 1436, -649, 460, -12150, 1359, 1014, + -2103, -576, 55, -590, 113, -1410, -23431, 182, + -2386, -1568, 904, -218, -281, -188, -178, 63, + 211, 549, 687, -12069, -88, -654, -1070, -13155, + -124, -697, 438, 3174, 1700, 270, 234, -289, + -625, 15749, -2340, 8466, 397, -4460, -1030, 3206, + 1081, -1317, -1030, -72, 487, -1477, -8782, 6984, + -1221, 2395, 3198, 2995, 5862, -1195, -6075, -1020, + -934, 868, -470, -1024, 1202, -998, -1306, 22118, + 344, 540, -3137, -547, 2440, -28, 222, 372, + -424, -199, 1068, -917, -105, -4278, 52, -299, + 6933, 11715, -520, -2853, 58, -8575, 416, -1272, + 1128, -32, -1140, -1873, -495, 235, 2079, -314, + -1328, -2615, -20194, 848, -1553, 387, -6091, 906, +-10180, 8634, -506, 4078, 318, -2657, 1612, -126, + -1424, -4, -1745, -343, 302, 2439, 12190, 941, +-12534, -4756, -176, -90, -1295, 1041, 1875, -450, + 89, 212, 2098, 1708, 1876, 4065, 1682, 1972, + -4916, -951, -10683, 1443, -10978, 772, -1013, -235, + 59, 213, -230, 142, -576, 506, 101, 44, + -137, 26238, -47, -322, -289, 281, 2614, -4538, + 634, 1116, 1191, 2985, -759, -5527, 550, 2107, + -6018, -11013, -425, -221, 901, 217, 546, 213, + 2026, 695, 1074, -2132, -173, -1664, -783, 25065, + -326, 86, -632, 1398, 4708, -2911, 2376, 135, + -1471, -904, -2338, 987, 3216, -4564, 314, 15692, + -214, 1238, 230, -181, -30537, -294, 155, -607, + 218, -309, -180, -246, -102, -988, -644, 111, +-10517, -1604, -1180, -2748, 1191, -12959, -2, -1004, + 28, -196, 1974, -790, 809, 8802, -1204, 332, + 180, -3857, 1025, -5998, -9578, 94, -1069, -2398, + 185, 643, -1479, 322, 2544, 12584, -8308, -3856, + 1286, 1600, -2539, -2752, -2520, -367, -942, 417, + -309, -2162, 2044, 10886, 1764, 11028, 3810, 2955, + -1028, -1017, -1752, -487, -605, 48, 2312, -368, + -1758, -252, 371, 19882, -1994, 1675, 5494, -660, + -1669, 256, -54, -941, 4318, -306, 2143, 273, + -3367, -3088, 6509, -1884, -5400, -576, 11394, 875, + 455, 271, -218, 1401, -44, -5336, -12170, 4664, + -589, -3562, -1934, 5842, 1357, 3232, 1449, -402, +-11228, -96, -1509, 2073, -1751, 776, -439, 775, + -3302, 13521, -325, -118, -172, 411, -396, 6154, + -2455, -52, -4616, 783, -12488, -2085, 5817, -1278, + 635, -1713, 2888, -830, 649, 7482, 10134, 9147, + 3784, 1046, -1934, -2580, 102, -679, -124, 68, + 657, 417, -175, -32768, -80, 375, -941, 224, + 271, -232, 1519, -99, -680, 67, 66, -618, + 252, 1907, 5121, 2456, -2117, -9388, -1441, 636, + 7868, -8340, 1939, 1340, 1511, 711, 6530, -1748, + -183, 90, 2561, 5860, -364, 5117, -4101, -4028, + -944, 10526, -1028, 1047, 707, 12116, -12596, -4006, + 922, -1047, 348, -971, -272, -2388, 435, 246, + -1055, 148, -1852, -12418, -2531, 3524, 4103, -344, + 1667, 2818, -4576, -273, -8337, 183, 497, -144, + -9845, -292, -503, -1212, 4316, -1434, -11058, -3043, + -5817, -981, 813, 0, -718, -467, 10285, -19005, + -82, 776, 1192, 1030, 1560, 1080, -144, 729, + 606, -225, -389, -187, 552, -930, -444, -5959, + -1960, -1315, 2650, -1282, -18790, 1772, 263, 1410, + 812, -458, -476, 744, 2595, -426, -19, 9119, + 4529, -1502, 4673, 3675, 7430, 1084, -6966, -518, +-13552, 1054, 2474, -9499, 1041, 5114, 442, 2927, + 511, -1492, 217, -726, 398, -522, 35, 119, + -332, 106, 816, 437, -1223, 27612, 521, -29, + -462, 367, -966, 476, -2559, -3485, -160, 1487, + -272, -586, -6014, -232, 3679, -1864, 1244, 575, +-14591, -483, -1428, 20, 7874, -2948, -5965, 2383, + 3270, 490, 2750, -547, -9658, -1473, 943, 285, + -2388, -772, -1582, 3181, 3419, 2628, -197, 3376, +-13282, -7684, 3383, 70, -1174, -70, -6703, -7305, + -553, 3588, -826, -12, 7350, -3604, 345, 1098, + 3856, 918, 2038, -39, 11514, 15798, 1327, 1158, + 436, -918, 71, 953, 975, 1147, 174, 411, + 1467, 83, -4536, -1511, 5350, -3314, 13999, 18, + 4107, 1901, 834, 2614, 2356, -369, 943, -341, + -460, 4380, -10014, 3308, -3541, -3225, -621, 8449, + -1383, 4481, -1399, -3646, -936, 923, 221, 346, + 7828, 2406, 3021, -4993, 3012, -10903, -1925, 8153, + 382, -1453, 1238, 601, 1195, -2245, -2792, -4118, + 473, 4898, 12961, -6094, 5905, 1368, -2754, -303, + 768, -31, -1275, 1400, 596, -1326, 619, -1744, + 1145, -3977, 639, -10785, -1693, -11192, -541, -434, +-11384, -1017, 14361, 1398, 521, -3239, 1851, -491, + 237, -1024, 1002, -3002, -303, -33, -6532, 601, + -3726, 7832, 6090, -10107, 957, -1149, 689, 1327, + -51, 1945, 990, -106, 595, 234, 518, 1060, + 77, 837, 28880, -91, -395, -275, -265, -279, + -217, -300, 240, -1055, -406, 4314, -2139, 6349, + -2227, -5996, 963, -10386, 4629, -560, 1080, 134 +}, + +.cb4448m1 = { + 31577, -1322, 1533, -2224, 253, -1485, -92, 294, + 183, -580, 420, 172, -794, -206, -342, -338, + 53, -85, -920, 29517, 1073, -972, -1839, 1004, + 290, 46, 460, -71, -988, 1731, -362, -2070, + 3848, -2, -3842, 734, -1221, -8012, 1104, 6782, + 9673, 1082, -8561, -860, -2135, -1557, -1613, -13999, + 1664, 2268, -1570, -732, 1010, -402, -1139, -428, + 400, 1123, -2108, -11776, -345, 10608, 1245, -3142, + -3244, -1132, 1700, -308, 1573, 543, 678, 5160, + -3062, 433, 2703, -852, -4903, -1880, 1706, 13995, + 2465, -4844, -904, -148, 350, -11168, 1406, 312, +-11900, 397, 769, 5558, -1354, 187, -30, 231, + -1020, 202, 884, -198, -3151, -830, -8490, -670, + -2767, 1517, -12957, -3861, -2794, -1854, -180, 135, + 7140, 4103, -4427, 450, 494, -1033, -1110, -2857, + 11056, -711, -800, 3628, -180, -852, -10300, -2120, + -450, 14464, -511, 303, -1464, -542, -89, -204, + 500, -400, -318, 569, 216, 428, 350, 1973, + -137, -885, -1794, -974, 3977, 3382, -18624, -420, + -1947, 165, -449, 1395, -17313, -286, 2054, -447, + -2740, -1881, -550, -2166, 1360, -6021, -94, 148, + 676, -1619, -1737, -11977, -169, -1664, -7709, 6202, + -5954, 1681, 715, -263, 56, 369, 589, 564, + 1989, 1617, -1648, 9205, 1343, -11508, -7379, -3791, + -3136, 1049, -844, 24, -6714, -1736, -5734, -2907, + 5016, 2167, -5722, -1210, 6232, 428, 2467, -3334, + -1477, -711, 6728, -10274, -4930, -6224, -349, -710, + 1598, -713, -1708, -497, -254, 567, -884, 131, + 11520, -908, -1425, -1862, -13449, -1590, -669, 657, + 505, 236, -4, 21, 846, 100, 8248, -1847, + -131, -186, 181, -806, 3293, -1072, -1208, 14492, + 1555, 1527, 544, -120, -258, 6, -2401, 12455, + 10880, 1091, -2350, -939, -1252, -564, 150, -114, + 1419, 737, -1732, -440, -2303, -226, 536, -2492, + -1085, -10117, -11013, 3786, 5275, -10, 2479, 143, + -1647, -7945, 884, -1618, 2056, 12890, -424, 5986, + -1471, -666, -570, -1466, -499, 64, 566, -1738, + -639, 11380, -612, 1879, 1550, 12469, -299, -1501, + 2634, 1036, 3020, -13, 14974, -2066, -5786, -2667, + 5487, -6768, 468, -385, 778, -805, -536, -304, + 718, 386, 285, 7546, 643, 1462, 913, 4707, + 941, -3338, -194, 6669, -4493, 8869, -837, 400, + -877, -11113, 326, -2318, 13683, -1304, -1966, -933, + 312, 128, 470, -296, -322, 340, -1126, 1811, + 1999, 2885, 3201, 331, -2494, 3999, 660, -80, + -2063, -16771, -1337, 426, 4884, -6026, -40, 2093, + 342, -176, 83, 134, 796, -425, -8934, 2100, + 8550, 160, -221, -252, -32714, 1306, 1332, -609, + -109, 547, 848, 518, -40, 303, -246, -451, + -2177, -716, -750, 1, -21232, 1287, -1303, 2051, + 1659, 1501, -369, -1415, 274, 308, 260, 371, + -1409, -662, -7347, 7161, 3656, -1104, 8862, -5671, + 1370, 1122, 16, 1132, 17593, 6778, -993, 613, + -665, 3004, 3288, -1625, -1823, -1003, 740, -1002, + -888, -677, -1065, -25294, 997, -160, -180, -811, + 188, -333, -2483, -696, 1309, 120, 456, -116, + -2020, -896, 7216, 6328, -9170, 8407, -2986, -1684, + 680, 1752, -684, 613, 337, -629, -11750, -493, + -324, -907, -391, 1053, 14125, 142, 420, -1917, + -378, -1428, -90, -497, 1116, -464, 2170, 805, + -1572, -904, -9020, -534, 6450, -490, 10750, 279, + 765, 961, -3985, -2702, 2423, -4981, -1222, 1654, + -1089, -2157, 1940, 14331, -895, 1726, 1555, 122, + -3552, 1274, -598, -910, 3056, -1704, 6430, -10626, + 1014, -8773, 1009, 1936, -360, -468, -1029, -8841, + -625, 2212, 2234, 2720, 1190, -64, -2078, 4688, + 8690, 5150, -450, 744, -796, -5661, -332, -7938, + 2670, -4054, 1377, -1594, 11554, -4702, -3631, 745, + 742, -90, -1311, 12528, -4664, 834, -853, 1542, + 8560, 2209, 4091, 2876, 2117, -678, 1684, 785, + 304, 7980, 2126, -302, 8239, -2105, 1584, 11894, + -1055, -1391, 596, 2343, 86, 388, -1348, -1007, + 1428, 413, -9231, -10312, -7346, -1108, 1385, -1255, + -3954, 738, -1258, 410, 226, 15115, -1059, -4117, + -50, -504, -1726, 1425, -9974, -346, 688, 464, + 244, -586, -8880, 845, -659, 932, -1309, 290, + -29, -417, -2184, 1011, -9622, 1443, 9009, 1945, + 2698, -708, 10572, 2410, 1200, 4492, -2569, 1444, + 2735, -8604, 2274, -4057, 478, -199, 1285, 12695, + 12321, -2933, -1708, 1198, 675, -492, -560, -52, + -1261, 85, -480, -96, 696, -764, -1402, -31368, + -580, -675, -1678, -58, 600, -522, -292, 647, + -36, 154, -1148, 437, 1561, 588, 603, 7629, +-16973, 29, -828, -589, -919, -1372, -470, -445, + 428, 528, 5828, -353, -32, -1781, -702, -690, + -7196, -3253, 1942, 4600, -12102, -674, -10480, -2336, + 711, -2174, -7474, -1436, -451, -7133, 856, -2652, + 1892, 3464, -546, 676, -13296, -516, -13618, -997, + 938, 1686, 1006, 1358, -1371, 922, 534, -170, + 126, 255, -835, 50, 945, -1066, -1676, 3, + 1038, -437, 26030, 418, 27, -1092, -493, -428, + -606, -1097, -628, 298, 295, -806, 183, 146, + 1352, -84, -722, 833, -25667, 3176, 1001, -322, + -2339, 15, -475, -1257, 2116, 876, 637, -529, + -1108, 302, -2452, 19734, 58, 851, 9845, 1142, + 2168, 706, 11070, 1556, 544, 3002, 2238, -3974, + 2738, -48, -8324, -2186, -355, -14933, 2192, -2481, + 2700, 473, -486, 761, -208, 76, -78, 102, + -4896, 1378, 12377, -8269, 28, 1092, -5071, -1500, + -1190, -804, 1085, -766, 493, 22, -1041, 9136, + -1234, -12247, 967, 2672, -883, 4582, 4871, 1891, + -532, 329, 226, 446, -6710, 312, -914, 1416, + -1852, 3052, 6512, 8971, 5544, 6519, -579, 1021, + -241, 911, 782, -3456, 10158, -1865, 3941, -12300, + 8, 472, 882, -1580, -1799, -1025, -631, -127, +-15316, 8047, -200, -1860, 582, -4363, -1274, 1085, + -48, 2383, 638, 480, 369, -838, -1341, 414, + -114, 2757, 1222, -2194, -3394, 6469, 2418, 738, + -1656, 15594, -1090, 202, 727, -769, 484, 2462, + 4875, 1656, -3835, -16877, 5276, 239, 982, -1872, + -130, 901, 1352, -155, 4939, -8317, 9000, 2503, + 485, 1184, -548, -1356, -7482, -188, -1587, 496 +}, + +.fcb08l = { + -2539, -3275, -2699, -3345, -2843, 5501, 426, 7127, + -149, 3111, -2991, -2297, -2345, 2702, -969, -946, + 2837, 1114, 1800, 1271, 12249, -2282, -2309, 1566, + -2889, -3020, -2083, 3586, 8919, 2651, 4111, -1842, + -1588, -1428, 3251, -102, 156, -320, 722, 1711, + 20565, -3068, -2211, -3164, -3410, -3396, -2882, -2002, + 1730, 4077, -2696, -1694, -2839, 2948, -2739, -2380, + -2252, -1311, -269, 1900, -2796, -444, -2996, -2525, + 5194, 1459, 5042, -1089, 914, 4116, 7644, -3137, + -3156, 4028, -3435, -3240, -2585, 5542, 5119, 9885, + -2995, -3153, -3449, -3101, -3551, -3469, -2196, -1271, + 3869, 5413, -2800, -1990, 3371, -2286, -1022, 3190, + -550, 1723, 968, 1916, -2749, -1530, -2211, -2987, + -3357, -3262, -1042, 10277, 107, 2662, 9819, -2753, + 4269, -3277, 3125, -3131, -2974, -3251, 6466, 9484, + -2034, -2707, -2424, -3170, -2619, -2278, -143, -1641, + 11856, 5975, -1282, -2629, -2396, -2364, -2012, -1085, + -2576, -2422, -2206, 13731, -2261, 2751, -1768, 2482, + -1065, -347, -137, 31, 619, 385, -2257, -2215, + -1698, -2686, 4468, -2563, -1071, -1359, 7757, 3732, + -2856, 9018, -2046, -1494, -2234, -2209, -67, 1340, + 2433, 2965, -2722, -2151, -2966, -2780, -2732, -1509, + -2085, -1532, 6934, -1248, -1936, -2203, -787, -1781, + -895, -1990, 4693, -1818, -1569, 1954, -2283, -2403, + 10514, -3105, -1074, -2838, -1, 1192, 1113, 3309, + -2249, -2451, -1660, 2535, -1439, 3582, -1093, -594, + 1956, 758, 5349, -2524, -2320, -1903, -2055, 5075, + -941, -721, -536, 2197, -2309, -3027, -1460, -2911, + 11344, -2474, -1601, -1749, 3260, 2547, 3819, -1247, + -1449, 2835, -1118, -652, -516, -379, 531, 440, + -569, -2606, -2545, -2447, -1685, 8678, -1868, -2003, + -992, 5888, 8591, -1848, -2010, -2196, -2049, -658, + 3473, 214, 905, 317, -2050, -1083, -2593, 8754, + -2234, -2449, -1688, 2194, 2244, 2502, -1659, -2748, + 4584, -3011, 3702, -2307, -1887, -1960, -1068, 2889, + -3022, -2989, -2295, -2794, 3071, -1588, -43, 2627, + 1278, 2031, -2145, -2551, -2333, -3205, -3237, -2760, + 9082, -454, 4339, 1776, -2738, 4785, -2176, -1896, + 2148, 1350, 768, 249, 1001, 1499, 797, -2182, + -1443, -229, -32, 827, 401, 270, 581, 380, + -2370, -2376, -2679, -3099, -1742, -1149, 4666, -693, + 1109, 7547, -2496, -3063, -2818, -2621, -2016, 5722, + 4932, 1217, 2161, 2449, -2207, -2954, 3769, -2824, + -1809, -2946, -1693, -377, 1565, 4100, -2947, 3063, + -3062, -2919, -3093, -2520, -1712, 2383, 1305, 1867, + 10145, -2912, -3307, 7519, -3502, -1063, -2782, 8595, + -750, -1503, -3141, -2486, 2923, -2574, -1826, -1244, + 3537, 2494, 2583, 1560, -2722, 3284, 2245, -1258, + -658, -394, 483, 719, 1121, 1073, -2949, -1013, + -3048, 597, -3103, -2510, -1970, 7207, 8635, 1917, + -1772, -483, -2318, -1860, -2500, 2981, -1651, 550, + 696, 615, -2121, -2055, -1619, -2126, 3108, 3417, + -485, -47, 848, 1608, -2636, -1707, 3142, 3798, + 479, -1112, 597, -323, 1555, 1531, -2930, 2106, + -2398, -2314, -1835, 0, 2920, 896, 2356, 1259, + -2911, -3184, 593, -3570, -3389, -3263, 7340, 7640, + 6874, 6549, -1912, -1334, -1749, -568, -1718, -405, + -1375, 3456, -1024, -1903, 9384, -2721, -2485, -2377, + -3026, -899, -3133, -3032, -2452, 7715, 2492, -2450, + -1721, -2138, -1497, -55, 760, 2382, 1183, 1105, + -2782, 389, -1528, -927, 664, -531, 1405, 363, + 582, -292, -1678, -2718, -2763, -3140, -2799, -2178, + -2715, -2592, -972, -1226, 3278, -1173, 2916, -1548, + -446, -1241, -209, 379, 689, 538, 3110, 2857, + -1735, -1244, -589, -413, 65, 471, 522, 323, + -2043, -212, 1309, -471, -564, -16, 378, -320, + -437, 228, -2194, -2637, -2513, -2670, -1863, -954, + -2082, -2398, -2270, 5563, -2959, -2444, -2794, -1736, + -1631, -1324, 1482, -481, 2317, 1470, -2871, -2007, + 702, -1980, -491, -146, -695, -145, 2817, 1268, + -3395, -3456, -3069, -3433, -2874, -205, 806, 3038, + 3806, 2623, -2954, -1861, -712, 1017, -326, 44, + -93, 910, 775, 346, -2625, -2570, -2974, -2344, + -2712, -1930, -2213, 3521, -1341, 4327, -141, 835, + -1119, -1336, -1092, -1891, -860, -727, 315, 2562, + 4119, -2638, -2584, -1951, -2710, -2499, -1561, -952, + 2821, 2505, -2388, -1855, -2926, 1742, -2563, -2655, + -1802, 3082, 3063, 2456, -3304, -2670, -2147, -1504, + -309, 1421, 1661, 1546, 560, 615, -2590, -1593, + -1523, 2025, 3167, -841, -356, -648, 309, 1165 +}, + +.fcb08m = { + -2962, -2140, -2166, -1454, -1638, -1100, -835, 686, + 978, 550, -1630, -1021, -1424, -1867, -1118, -474, + 66, 6104, 904, 603, -829, -475, -1368, -1199, + 7255, -890, -465, 114, 118, 224, -2453, -1279, + 8192, -1289, -452, -47, 180, 324, 627, 209, + -2770, 11214, -857, -1720, -895, -531, -291, -264, + 232, -402, -2699, -2561, -2433, -2093, -1315, 86, + 2666, 1663, 1351, 2349, -2788, 4576, 3680, -1365, + -995, -513, 46, 44, 522, 142, -2739, -1654, + -1950, 4573, -659, -536, 285, 72, 875, 627, + 3142, 105, -941, 1245, -489, -495, -229, 44, + -236, -1083, -2336, -1193, -1620, -1859, -1339, -655, + 205, 1032, 5581, 1195, -2635, -1740, 2656, 1976, + -52, 784, -96, -165, 419, -486, 8850, -624, + -792, -1531, -765, -674, -730, -829, -150, -27, + 2255, -1177, 2727, -1430, 737, -902, -780, -729, + 169, 278, 3729, 3763, -32, -1581, -563, -573, + 77, -372, -64, -477, -2500, 526, -1682, 1464, + -830, -124, -548, 561, 202, 1115, -1682, -1552, + -2014, -2127, -1374, -749, -720, 64, 2097, 6944, + -2771, 4929, -1680, -2212, -1430, -801, 114, 891, + 1176, 855, 3571, -2187, -1566, -1694, 84, -46, + 932, 786, 765, 856, -1038, -498, -117, -1582, + -1379, -1162, 6293, -367, 594, 132, -2487, 2119, + -2153, -1749, 833, 1089, 507, 133, 337, 423, + -2777, 2507, 277, -1455, -1019, 1811, 639, -595, + 136, -1050, -2941, 4474, -176, 1095, 1113, -479, + 182, -295, -229, -605, -2035, -1649, -1171, 51, + 0, 125, 2844, -310, -82, -640, -2251, -2138, + -2270, -1567, 2260, 92, 368, 95, 1433, 1346, + 820, -2339, -1822, -895, -69, 158, 190, 911, + 1008, 764, 684, -1756, -1013, -1625, -1610, 6062, + -499, -1036, -139, 1129, 488, 524, -665, -870, + -347, -76, 123, 91, -12, 14, -2867, -2019, + 2858, -1903, -1165, 309, 287, 1250, 767, 776, + -2784, -2446, -1157, 460, 2589, 437, -285, 711, + -299, 402, -2683, -2271, -1714, -1535, -547, 4118, + 510, 1158, 700, 631, -2084, -1236, 509, -1009, + -510, -193, -1075, -793, 727, 2150, -2722, 968, + 1077, -1579, -1410, -894, 401, 1043, 427, 182 +}, + +.fcb08s = { + -2368, -2340, -1735, -1897, -1493, 984, 3062, 2826, + 1049, 164, 1181, -1990, -1833, -1720, -1360, 24, + 1485, 1923, 460, 511, 69, 78, -353, -3, + 3761, -480, -1538, -1063, 540, -64, -1546, -988, + 1514, -1167, -1354, -563, 1435, 880, 1123, 182, + -2243, -2109, -2378, -2201, -1491, -836, -124, 605, + 6159, 3636, -2770, -2959, -2956, -3019, -2154, -648, + 1805, 4698, 2929, 2078, -975, -360, -895, -623, + -593, -879, -345, 4333, 492, -56, -2102, -781, + -476, 1268, 606, -670, 1686, -105, 370, 461, + -221, -868, -1381, 297, 128, -578, -809, -938, + 3896, 490, 4032, 2675, -684, -1108, -1235, -915, + -874, -919, -802, -1040, -1324, -16, 2156, 1943, + -652, -666, -47, -1499, 168, -210, 4213, -1895, + -1734, -1767, -1412, -867, -71, 329, 855, 1294, + -1849, 4393, -1312, -1597, -564, 434, -454, 269, + 892, -31, -1170, 67, 370, -1144, -320, 3706, + -811, -190, -123, -166, -659, -1033, -789, -902, + -347, -280, -108, -313, 452, 3701, -1505, -2610, + -2758, -2550, -2034, -1361, -676, 713, 2263, 8286, + -2241, -2508, -2540, -1721, 182, 1947, 306, 1773, + 1220, 2909, -60, 73, -235, -1631, -1302, -692, + 4171, -830, 49, -188, -471, -2208, -2265, -1518, + -196, 2995, 2571, -579, -68, 805, -1294, 1274, + 4294, -1356, -702, -532, -465, -123, -400, -719, + 336, 3093, 1634, -906, -71, -502, -938, -982, + -742, -1187, -1757, 2890, -1591, 1303, 216, -311, + -404, -29, 501, -543, -1466, 1587, 309, -578, + -173, 34, 1116, 1286, -1184, -1174, -175, -732, + -619, 3508, -80, 191, -1059, -174, -429, -470, + 10000, -933, -1511, -1601, -1571, -1445, -1065, -1407, + -1053, -932, 1183, 7875, -460, -1609, -1618, -1398, + -1154, -1227, -1012, -1450, 20, 28, -235, -110, + 203, 105, 252, -154, -51, -58, 2940, -490, + 17, -51, 131, -106, -526, -566, -822, -1177, + -1335, 2749, 608, -1575, -1322, -1351, 111, 641, + 1441, -9, 733, -207, -273, -665, -630, -588, + -78, 254, 304, 762, -2661, -2677, -1238, -82, + 2569, 3001, 932, -1032, 211, -324, 40, 1395, + -836, -1119, -635, -1425, -1514, -1135, 1509, 2963 +}, + +.fcb11l = { + -3004, -2927, -2672, -2356, -735, 179, 950, 1734, + 1101, 1641, -1610, -1161, -1606, -179, -1634, 3383, + -610, 240, 73, 1128, 818, -1052, -1641, 724, + -1938, -1741, -1211, 3967, 1988, 1445, 3010, 2203, + -1685, -1698, -1838, -759, -144, 515, 999, 1215, + 3239, -1912, -2048, -1739, -1488, -148, 1590, 1370, + 1066, 1270, -2721, -1637, 99, -1964, 224, -946, + -1437, -954, 755, 1420, -2800, -2211, -2304, -2048, + 4853, -714, -383, 2159, 1823, 2328, -1619, -1584, + -1839, 5462, -1703, -802, -227, 485, 1017, 1695, + -2459, 2399, -1820, 2254, -1373, -767, 53, 705, + 1074, 1293, -1582, -2486, -2208, -2341, -2264, -2132, + -1578, -1043, 322, 7685, -2198, -1768, -2106, 16, + -2207, -1495, -1106, -961, -482, 1642, 6785, -1540, + -1540, -1449, -1177, -854, -307, 853, 1279, 1449, + 3253, -1427, 2314, -1473, -985, -1025, -321, 923, + 1140, 1166, -2704, 2664, -2444, -2717, 481, 3083, + -1449, 1225, 3168, 2389, -2124, -1981, -1342, -1939, + -1904, 4736, -885, -826, 3866, 2046, -290, -567, + -1986, -1880, 1966, -465, 1638, 683, 1005, 1099, + -2842, -2537, -2559, -2427, -1243, 4039, 1371, 3897, + 2529, 2400, -2586, -1328, 785, -1697, 1733, 2382, + -442, 190, 901, 1281, -2669, 2198, -1502, -1404, + 2593, -694, -186, 466, 1065, 1199, -1905, -1389, + 6171, -1817, -513, -989, -356, 246, 1619, 1883, + 36, -2178, -1602, 608, -1523, 23, 1265, 578, + 953, 1038, -483, -2278, -2138, -1740, 584, 244, + -54, -192, 915, 1097, -213, -1569, 1861, -1401, + 3686, -1625, -1234, -614, 860, 1311, -1397, 2315, + 1896, -1608, -1326, -1487, -99, 2241, 697, 1156, + 1711, -2099, -1507, -135, 1422, -695, -57, 1390, + 823, 937, -122, 479, 47, -2144, -1514, 955, + -1317, -726, 480, 1153, -2959, -2558, -2573, -1355, + -1879, -1446, 6435, 677, 3124, 3134, 1850, 1834, + -1396, -1417, 1290, -896, -561, 1428, 1007, 1105, + -2101, -2044, 1779, -1913, -1868, 1410, 916, 1232, + 1112, 1335, -2663, -104, -513, -96, -470, 480, + 1516, -150, 298, 714, -2558, 3076, 468, -745, + -945, -443, -849, -989, 341, 1102, 433, 588, + -1772, 462, -527, 670, -128, -108, 583, 701, + -2281, -2149, -2398, -2749, -2557, -1691, -1095, 1336, + 9088, 3844, -1799, -1861, -1908, -2242, -2184, 2313, + 3779, -809, 519, 2229, -1914, -1673, 1764, -634, + -1955, -1721, 405, -499, 243, 1632, -2377, 7289, + -1659, -1752, -1341, -948, -323, 841, 1703, 1774, + -2029, 2384, -1877, -1918, -1729, 1483, 483, 1916, + 576, 1258, -2310, -1796, 2208, -1579, 57, -1735, + -1161, 5177, 1674, 2468, -1907, -1499, 1868, 2275, + -620, -356, -228, 489, 1064, 849, -683, -1204, + -1761, -2211, -606, -764, -1056, 3888, 253, 1518, + -2555, -2075, 119, -1567, 971, -1178, 2683, 1476, + 978, 1419, -2947, -2418, -2164, 1178, 1582, 1470, + 896, 645, 1671, 1462, -2234, -1363, -1184, 1408, + 1042, -1091, -208, -49, 527, 917, 1266, -1444, + -2174, -2447, -2300, -1732, 3076, 5631, 248, 2195, + -2477, -1724, -2434, -2477, -2524, -1828, 2331, 845, + 1423, 1767, -2393, -1946, -857, -462, 344, 17, + -896, 2391, 892, 882, -828, -280, -752, -1136, + -1563, -1040, 1222, -1173, 1763, 1179, -1448, 1946, + -1815, -1588, -1638, -1282, 3302, 132, 509, 1408, + -2760, -2338, -1935, 1353, -1531, -1074, 1156, 3086, + 1374, 1667, 2302, -1623, -1897, -1991, -494, 2603, + -754, 524, 1265, 1304, 3062, -1359, -1365, 1987, + -1334, -916, -146, -40, 635, 1033, 1724, -1057, + 49, -1159, -774, 106, 1053, -153, 134, 691, + -119, -1226, 332, -363, -197, -69, -133, 573, + 190, 216, -2236, -294, 1288, -2110, -1537, -1005, + -1175, 56, 4227, 1623, -2440, -1894, -1623, -2377, + 2287, -1220, -1506, 177, 5689, 2849, -2857, -2166, + -2546, 2174, -2414, -2343, 559, -1020, 4650, 3514, + -2875, 1309, -2557, -2534, -2235, -1901, 1559, 4412, + 2301, 2204, -2969, -2018, -2399, -2834, -2431, 1316, + -1474, 1269, 2533, 3485, -2892, -2387, -2716, -2317, + -2031, -1992, -1311, 8071, 3933, 3807, -2139, 1909, + -2200, -2344, -2060, -1638, -1154, -210, 2781, 2139, + 1119, -1828, -2069, -2306, -1975, -1165, -444, 789, + 2409, 1551, -2929, -103, -1920, -2010, -904, 694, + -188, 4, 1051, 1190, -2649, -2454, -2205, -1651, + -1856, -1552, -1165, 352, 3351, 1266, -1719, 57, + -1828, -420, -938, -1251, -461, 1294, 1158, 893 +}, + +.fcb11m = { + -2704, -2459, -2349, -1535, 2807, 365, 1064, 892, + 830, 1222, -2190, -1542, -2285, 6443, -1607, -1362, + -605, 637, 883, 877, -2378, 2292, 3106, -1057, + 1776, -1094, -859, 249, 199, 256, -1537, 2098, + -1126, 2243, -1186, -193, -211, 211, 502, 308, + 3369, 3197, -1271, -1370, -355, -423, -537, 468, + -237, -99, -1439, -1748, -2185, -1972, -1357, -814, + -470, 815, 1306, 6390, 1983, -1169, -1749, -29, + -1368, 5929, -1539, -900, 576, 701, 1708, -1608, + -1148, 3522, -822, -120, -461, -158, -43, 39, + -2543, 8872, -1347, -1580, 222, -488, -162, 295, + 382, 291, 11143, -1223, -1270, -1399, -392, -563, + -500, -604, -544, -135, -1787, -1313, -1490, -1395, + -1100, -1278, -818, 6172, 768, 1597, -623, -681, + -1128, -1575, 7257, -665, -1021, -439, 932, 703, + -1496, -2168, -1945, -1454, -808, -1261, -354, 875, + 6706, 1956, -1773, -1503, -1536, -1162, -1386, -1885, + -1607, -318, -72, -7, -1932, -1349, 6150, -1852, + -345, -18, -81, 223, 339, 425, 362, -1623, + -1432, -1973, -1042, -1373, 7830, 38, -116, 1000, + 421, -2375, -1808, -1832, -1046, 2077, 955, 1576, + 581, 824, -2021, -1582, -1402, -1420, 69, 3549, + -513, 192, 262, 483, -2503, 4173, -11, -1532, + -893, 282, 187, 320, 176, 259, -2308, 2342, + -2385, -2147, -784, -375, 413, 833, 889, 1297, + 1415, -1085, -1009, -1501, -1246, -1298, 1553, 1384, + 332, 662, 2226, -2399, -1752, -857, 1899, 131, + 501, 209, 217, 346, 4294, -1811, -1694, -1080, + -752, -263, -228, 249, 628, 971, 2508, -1031, + 2871, -1054, 42, -202, -738, -170, -239, -290, + -2751, -2379, -2379, -1999, -1448, -380, 1594, 1279, + 1399, 1633, -2376, -1839, 1367, 1685, 356, -126, + -50, 143, 31, 33, 314, 160, -663, -687, + 25, 388, -267, -188, -188, -129, -2614, 1063, + -1835, -285, 2549, 205, -30, 370, 319, 297, + -87, -2208, -1164, -839, 894, -266, -410, 375, + 1263, 924, -2606, -2325, -1854, 1792, 407, 328, + -110, 575, 1090, 971, -2517, -1583, 1355, -1892, + -490, -203, 846, 724, 597, 779, -1650, -1281, + -1294, 549, -146, -548, 2947, -28, 265, 339 +}, + +.fcb11s = { + -1536, -2360, -2378, -2138, -1380, -346, 1575, 2779, + 3247, 1689, -340, -1788, -1839, 103, 31, 853, + -653, 3159, 365, 154, 404, -835, -716, -35, + 4309, -155, -1214, -1180, -750, -522, -753, 350, + -1660, -1603, -1159, -582, -489, 1067, 2615, 1747, + -1755, -2351, -2314, -1453, 922, 3458, 867, 439, + 493, 1212, -1584, -1655, 1300, 1783, 1641, 1442, + 816, -1283, -1456, -1417, 4998, 1923, -200, -1086, + -1060, -1016, -1074, -1217, -1285, -1245, 633, 390, + -1443, -1099, -507, 3041, 343, -163, -745, -667, + 2333, -2144, -2460, -2247, -2063, -1736, -742, 418, + 3124, 3504, 227, -735, 799, -1326, -20, -543, + 1900, 237, -671, -545, -1727, 121, -1750, 3700, + -485, -553, -77, -212, 942, 62, 1647, -688, + -1506, -1429, -619, -839, 172, 3209, -500, -371, + -1680, -1408, -1122, -563, 3627, -115, 510, 534, + -65, 199, 800, 5040, 631, -744, -612, -1023, + -1099, -1319, -1520, -1460, -1120, -274, -1220, 349, + 1848, -620, -1411, -616, 1771, 1024, -1223, -2195, + -2345, -2144, -1517, -1055, -385, 557, 1482, 6797, + -2274, 818, -460, -707, -274, 646, 654, 731, + 268, 347, 4583, -1289, -1452, -1193, -1072, -681, + -178, -131, -108, 547, -1521, -781, -1298, 239, + -486, -445, 3453, -226, 90, 653, -1237, 624, + 4692, -482, -798, -799, -766, -645, -890, -915, + 3748, -909, -1012, 85, 963, 375, -100, -1010, + -1269, -1508, 2106, -1194, 2632, 595, -826, -221, + -411, -1104, -1365, -1050, -2112, -863, 1943, -727, + -1079, -733, 78, 1990, 363, 953, 1325, 459, + -891, 3364, -410, -362, -547, -994, -1371, -1258, + 12270, -43, -1668, -1868, -2004, -2133, -1863, -1949, + -1805, -1288, -1640, 3783, -1414, -578, -505, -464, + -158, 252, 71, 76, 22, -20, -72, -13, + -19, -95, -14, 2, 23, -5, 1289, 630, + 291, -707, -794, -857, -715, -122, 551, 219, + -2358, -1905, -1397, 277, 572, 343, 789, 526, + 1629, 991, -980, 222, 740, 1199, 19, 1200, + -864, -467, -656, -138, 820, -2005, -924, 154, + 195, 393, 267, -183, 1024, 100, 1243, -872, + -705, -781, -422, -377, -910, -637, 89, 2849 +}, + +.fcb16l = { + -2676, -2246, -3119, -2904, -2707, -1946, 7718, 2292, + 2451, 4206, -1214, -362, 1116, -860, 30, -993, + -888, -1046, -3732, -2268, -2541, 6060, -2220, -1597, + -1650, -1320, 88, 1229, 2118, 2348, 1430, -1865, + -2190, -2122, -1844, -2069, -1746, 15, -1746, 1321, + -2671, -2993, -3247, -2811, -2141, -1360, 1886, 270, + -381, 5676, -2070, -444, -674, -1082, -1144, -346, + -823, 4630, -224, 1940, -2441, -2072, -2194, -295, + 2175, 1209, -734, 168, 923, 1359, -2667, 389, + -2585, -2279, -2195, -1141, -1016, -218, 109, 1926, + 5184, -2226, -1888, -1273, -1044, 25, 461, 886, + 1125, 1249, -2215, -2381, 3109, -1963, 3015, -2027, + -790, 1192, 1646, 2188, -2906, -2598, 484, -2372, + -1372, -1082, 1718, 664, 1391, 2396, -2518, 1937, + -2362, -2510, -1504, 2947, 446, 684, 1947, 2059, + -3263, -3001, -3240, -3034, -2598, 3367, 4407, 2327, + 2450, 2994, -2379, -1875, -1862, 6387, -1956, -1417, + -525, 1098, 1836, 2932, 1408, -1130, -1417, 1693, + -262, -645, -515, 443, 735, 619, -2834, -2246, + -2646, -2521, -811, 6608, -421, 1572, 2015, 3234, + -2086, -1435, 89, 1648, 838, -986, -1159, -1208, + -32, 1354, -2135, -2159, 7796, -2424, -949, -2040, + -1179, 228, 1187, 3008, -2963, -2500, -2074, -2025, + -1439, 1692, -378, -596, -62, 2419, -3522, -3132, + -2899, -3290, -2929, 2844, 49, 4307, 2754, 3897, + -2960, 1305, -1858, -831, -1379, -773, 3257, 979, + 975, 1513, -2849, -1610, 2483, 456, -1395, -634, + 847, 1320, 1116, 1175, 2497, -1554, 2176, -1697, + -997, -799, -120, 339, 996, 1379, 11359, -1557, + -2219, -2237, -1792, -2084, -1009, 781, 3341, 939, + 1954, -1860, -2347, -2117, -2000, -1394, 3825, 106, + 2595, 2162, -2938, -2488, -2112, 772, -1059, 1822, + 159, 1017, 2452, 1506, 1313, -2615, -2479, -2941, + -2220, -2510, -726, 4703, 1778, 3375, -3133, -2664, + -2821, -2771, 1559, -1000, -434, 1874, 4130, 2987, + -2998, -2692, -2326, 1580, -2231, -1347, 4166, 2021, + 1177, 2531, -2880, -2337, -2589, 1505, -2843, -2468, + -339, -1059, 3212, 4264, -3112, -2885, -2889, 975, + -2522, -2278, 721, 5057, 3989, 3373, -3098, -2947, + -1128, -2251, 1935, 2981, 3007, 975, 1983, 2048, + -2861, -2302, -2431, -1460, -1492, -1524, -944, 1556, + 1778, 1549, -2658, -2259, 2768, -2460, -1447, 2957, + 759, 324, 2533, 2477, -2935, -1687, -2554, -2647, + -1431, 118, -365, 10280, 1526, 3447, -2570, 2268, + -2351, -2115, 2588, -9, -834, 1115, 1878, 2365, + 79, 1132, -1619, -1406, -1568, -1766, -224, 825, + 2113, 1382, -548, -2669, -1797, -2691, -2139, -2495, + -210, 1276, 13623, 2315, 1965, -1713, -1610, -2187, + 2534, -1495, -1301, 622, 563, 2154, 2743, 3230, + -1784, -1774, -792, -493, -131, 156, 944, 1211, + -1886, 357, -1018, 225, -285, 1025, -134, 218, + 290, 153, 5869, -2407, -2856, -3051, -2540, -3238, + -2260, -370, -451, 6314, -500, -2554, -2110, -879, + -323, -537, 570, 1228, 1556, 1342, -2486, 3366, + 1838, -937, -959, -683, 63, 937, 652, 1212, + -2164, -1448, 166, -799, -550, -1317, 481, 299, + 5494, 1360, -3147, -2574, -989, 1550, 1952, -1502, + -96, 3517, 1304, 2311, -2931, -2146, -2174, -2052, + 579, 680, 896, 2697, 703, 1365, 4130, -2367, + -2627, -3125, -934, -3093, -2155, -955, 6025, 5024, + -3121, -3064, -2883, -2458, 1723, -842, 3032, 4391, + 2327, 2837, -2536, -2208, -1610, -2189, 6509, -1424, + -1116, 1427, 2830, 3370, 1084, -1562, -1655, -1628, + -491, 2260, -321, 421, 774, 1237, -3267, 977, + -3170, -3144, -2698, -1324, 1424, 3034, 3323, 3347, + -3021, -3061, 2027, -2345, 852, -2832, -1714, 5926, + 4517, 3839, -1490, -2416, -1726, -1268, -1458, -2137, + -1715, -580, 1403, 13408, -3005, -2706, -3063, -2745, + -2777, -2136, 2786, 202, 5141, 3407, -3104, -3001, + -3176, -3388, -3507, -2863, -2097, 2325, 2618, 6146, + -1997, -3152, -1036, -2694, -2587, -2986, -2750, -2219, + -1607, 5944, -2893, -2633, -2229, -2811, -2482, -2115, + -2219, -1180, 5246, 3252, -3111, -2052, -2693, -2934, + -1805, 2583, 353, 1262, 8588, 3900, -2468, -2726, + -1861, -2352, -2237, -2750, -2345, -1936, 9793, 8392, + -3490, -3124, -3596, -3630, -3154, -2390, 743, 6652, + 6366, 6143, -2852, -3547, -3124, -2718, -1094, -494, + 49, -1053, -3005, 32767, -1721, -1229, -1715, -1590, + 1587, -1233, 3384, -252, 312, 1120, -3287, -2926, + -3048, -2828, -2502, -1185, 2028, 3778, 487, 2083 +}, + +.fcb16m = { + 616, -1065, -1622, -1949, -1283, -863, 6819, 517, + 1135, 1282, 2631, -1447, -1477, -1004, 286, 1358, + -135, -340, 147, -130, 5435, -1609, -1916, -1758, + -1066, -1126, 478, 995, 1098, 1437, -1737, -1339, + -1864, -2009, -1038, -1004, -573, 810, 5974, 2840, + 349, -1559, -1496, -1151, -307, -82, 681, 827, + 550, 776, 1930, 166, -1100, -1489, -1185, -1182, + -1210, -326, 858, 1688, -2561, 3514, -736, 1555, + -59, -906, -123, 87, 102, 274, 1902, -459, + 3008, -984, -707, -334, -571, -317, -190, -371, + -2862, 607, 1346, -1517, -1220, -617, 2494, 697, + 190, 64, 3264, 3926, -1249, -1542, -933, -302, + -246, -248, 69, -283, -1766, -750, -1898, -1259, + 6841, -1546, -785, -64, 1208, 1294, -1522, -1742, + -1873, -1898, -1455, 7128, -752, 1718, 1398, 1123, + -2742, 4733, -1552, -2483, -2210, -495, 355, 864, + 830, 759, -2721, -2115, -1891, -1696, -1137, -1559, + -1265, -658, -591, 850, -699, 1262, -551, -1055, + 877, 96, -388, -192, -479, -1091, -2763, -1379, + 3290, 2331, -874, -307, -386, 615, 366, 133, + -2671, 5181, 4339, -894, -871, -634, -165, 409, + 91, -291, -2649, -411, 8039, -1947, -1156, 57, + 351, 1014, 472, -198, -1816, -590, 2887, -1702, + -1113, 3414, -556, 117, 483, -377, -1707, -1146, + -1155, 2518, 2014, -382, 3, -6, 206, -98, + 10770, 274, -1415, -1670, -1020, -1036, -786, -782, + -463, -552, -2500, 10460, -1624, -1787, -707, -1327, + -59, 375, 91, 22, -2776, -2343, -2104, 825, + -759, -823, 482, 1149, 1265, 570, -1676, -1826, + -1848, 6125, -1391, -820, -449, 844, 586, 535, + -2873, -2475, -2607, -2611, -1830, -487, 1643, 1680, + 2088, 2570, -2357, -993, 3189, -1473, 3506, -1203, + -793, 662, 464, 98, -2507, 1617, -1793, -1935, + -1307, -169, 9, 885, 728, 1178, -2010, -1346, + -1375, -187, -548, 2753, -464, -105, 799, 511, + -2170, -2428, -2177, -1497, 2072, 828, 441, 1020, + 873, 1000, -1297, -1531, -1863, -1967, -1516, -1088, + -758, -230, 1561, 6655, -2173, -1787, -1548, -1763, + -1366, -24, -645, 6836, 1480, 1923, -2728, -1859, + 1798, -2010, -1585, -677, -371, 1405, 1254, 1278 +}, + +.fcb16s = { + -2250, -2771, -2879, -2775, -2240, -1363, -272, 1233, + 6172, 5074, -2882, -2419, -2054, -2420, -1252, 347, + 1325, 1799, 1723, 4361, 774, 2066, 1874, 280, + -707, -605, -581, -662, -1104, -2038, 7111, -137, + -883, -1079, -1001, -54, -847, -1013, -1045, -832, + 4696, 3781, -624, -1485, -1360, -1359, -1307, -1219, + -866, -945, 5419, -1512, -2307, -2134, -2056, -1724, + -1653, -630, 157, 3399, -727, -860, -1381, -380, + -716, -1335, 3819, 78, -2, 277, -3185, -3118, + -2715, -3110, -1500, 1626, 3352, 3075, 1956, -539, + 16640, -1204, -2281, -2307, -2272, -2349, -2009, -2184, + -2777, -2375, -1015, 6208, -402, -1331, -1182, -763, + -730, -81, -591, -1184, -1927, 543, 4464, -1095, + -131, -542, -129, 486, -366, -1097, -1594, -554, + -15, -337, 3152, -723, 71, -40, 385, -309, + -769, 290, -853, -1058, -1196, -1557, -595, 3695, + 1129, 438, 1729, -1309, -971, -871, 90, 1418, + 1261, -23, -1382, -223, -1551, -713, -1044, 4495, + -160, -867, -1242, 1188, 159, 120, -1657, -951, + 1536, -159, -1310, 1101, -404, 155, 1717, -24, + -1607, 2347, 2056, -1943, -1313, -1297, -81, 34, + 1441, 354, -2110, -1873, -516, 1102, 2174, 2131, + 0, -946, -729, 61, 107, -14, -108, -50, + 42, -164, -177, -92, -29, 162, 1349, -2380, + -2099, -1692, -980, -49, -94, 331, 1317, 3819, + -482, -782, -775, -909, -640, -1099, -615, -225, + 1556, 2973, -630, 70, -186, -1599, -1076, 4440, + -890, 78, -76, -517, -855, -1886, -1521, -1206, + -1152, -900, 753, 1338, 1758, 2431, -2433, -1569, + -1294, -583, 552, 2040, -154, 250, 513, 2333, + -820, -1987, -2291, -2238, -1880, -1651, -1120, -262, + 2013, 9756, -2803, -2574, -2634, -2789, 356, -1838, + 325, 4584, 3584, 2486, -1524, 1874, -337, -1800, + -1659, 406, 2450, 1252, -245, -1030, 1985, -397, + -1565, -51, 148, 2039, -1212, -729, -700, -11, + 904, 649, 531, -2287, -1640, 766, -725, 171, + -1596, 1387, 3189, -672, -459, -794, -422, -714, + -195, -231, 185, 99, -952, -2248, -2170, -1190, + -457, 1458, 34, 1179, 2427, 1683, -1658, 3749, + -1816, -2000, 2823, -1243, -1415, 713, 875, 75 +}, + +.fcb22l_1 = { + 2198, -2215, -2251, -1966, -1540, -467, 403, 1647, + -2867, -2589, -34, -2314, -602, 2371, 2614, 2218, + -2494, 3659, 2708, -1076, -914, 233, 1149, 1425, + 319, -979, 1023, -682, 110, 239, 427, 703, + -2979, -2513, -2649, -2265, 7420, 526, 2174, 2932, + -2868, -2056, -2232, 1651, -1325, -856, -218, 2091, + 458, 1508, -1208, -845, 244, -441, 558, 752, + -700, -1370, -395, 980, -321, -232, -241, 293, + 10391, -1792, -1948, -1518, -1049, 43, 1524, 2033, + -2434, 303, 1730, -1205, -1432, -1183, -694, 1185, + -2531, -2656, -2751, -1756, -1321, -1100, 287, 8605, + -2868, -2554, 721, -2065, -1671, -771, 675, 2223, + -2690, -2501, -2313, 1829, 3189, 45, 1825, 2024, + -3153, -2824, -2729, -2308, 1686, -370, 482, 2606, + -2972, -2324, 2492, -1762, -1662, 28, 4976, 3214, + -2769, -316, -1146, -1954, 86, -60, -370, 1144, + 5519, -1785, -1538, -1044, -580, -89, 704, 1151, + -2586, -1094, 7473, -1220, -1076, -50, 1029, 1850, + 3546, 3279, -1806, -1191, -528, 682, 1160, 1341, + -2852, 1541, -2358, -1841, -2317, -1351, 993, 2417, + -2675, 2482, -2061, -2089, 3681, 626, 1619, 1818, + -2916, 2821, -2482, -2166, -1084, 1137, 5537, 2864, + -2499, -1782, 2156, 2558, -1117, 127, 1147, 1556, + -2572, 3865, -2008, -1805, -679, 119, 35, 1319, + -2704, -1872, -1756, 6843, -911, 322, 1641, 2461, + -2652, -1957, 1972, -1582, 3082, 84, 1086, 1487, + -2983, -2325, -2780, -2532, -1858, -279, 10092, 4519, + -2364, 2718, -1907, 2678, -1005, 246, 1499, 1679, + -2570, 8779, -2004, -1627, -844, 89, 1712, 2145, + 3316, -1763, -1642, 2819, -599, 9, 906, 1401, + -2289, -2224, 2462, -1580, -843, 2501, -24, 1310, + 3091, -1745, 2398, -1264, -731, 113, 831, 1328, + -2803, -2380, -2808, -2379, -2290, -1376, -234, 2242, + 3537, -2137, -2050, -1260, 2881, 177, 1158, 1424, + -3303, -3123, -3130, -2861, -2075, 2528, -43, 3890, + -3106, -2672, -2554, 1833, -826, 55, 4910, 3324, + 3993, -2176, -2446, -1848, -786, 3346, 1590, 2034, + -2725, -265, 303, 1076, -1985, 3661, 1556, 1983, + -3182, -2712, -2988, -2841, -1332, 4816, 6422, 4184, + -2230, -1248, -2176, -1806, -1617, -878, 3764, 1309, + -2280, 509, -211, 426, 773, 99, 513, 628, + 167, 196, -2256, -1802, -1157, 724, 1405, 1383, + 2384, -409, -672, -453, -205, -89, -12, 240, + 114, -2220, -807, -1302, -1612, -405, 1134, 1381, + 699, -1816, -2151, -1883, 2975, 928, 1527, 1565, + 775, -2141, -1981, -1532, -591, 3338, 683, 1763, + 466, -2028, -2086, 1448, -622, 589, 1294, 1150, + 145, -2382, -1093, -367, 986, 323, 404, 931, + -371, -2868, -2737, -2103, 129, 771, 1498, 1974, + -1481, -1060, -2398, -1125, 285, 2777, 2975, 1431, + -2720, 1748, -2375, -1847, -912, 3829, 808, 2034, + -2492, -2447, -1248, -991, 1449, 1304, 867, 1171, + -2999, -2556, -2763, -2298, 3359, 4277, 1991, 2850, + -2692, -2640, -2593, 1813, -458, 3068, 1012, 2049, + -3258, -2820, -2845, -2395, 2787, -45, 5457, 3568, + -2491, -2114, -1884, 6, -332, -232, 1680, 1139, + 2032, -2383, -2183, -1725, -914, 192, 4175, 2059, + -2922, -2972, -2920, -2210, -1143, 1850, 2468, 1871, + -3138, -99, -2651, -2510, -129, 631, 1677, 1925, + -3302, -3124, -3214, -3143, -2616, -761, 3978, 4234, + -1698, -824, -1975, -742, 2449, -610, 21, 998, + -3047, -2697, -2747, -1919, -1545, 7534, 1243, 3548, + -1863, -1257, 339, -1027, 122, -613, 1989, 953, + -2232, -1759, -1751, -969, -1591, 1917, -325, 889 +}, + +.fcb22m_1 = { + 13531, -1278, -2217, -1956, -1360, -892, -650, -866, + -255, 192, -1139, -1242, -2101, -1682, -1601, 2950, + 2340, 121, 662, 446, -2636, 1711, 615, -1864, + -1297, -1098, -296, 1070, 1284, 891, 7332, -2292, + -2334, -1889, -1170, 1884, -570, 52, 1146, 944, + -2083, -2192, -2420, -2165, -1542, -1474, -278, 4147, + 1506, 1666, 1014, -1657, -2225, -2261, 8568, -1445, + -523, -115, 999, 602, -2762, -2261, 271, -1797, + -1633, -790, 391, 907, 1302, 1076, -1907, -2219, + -2443, -1963, -1495, -1294, 4722, 935, 1691, 1370, + -2355, -1585, -2510, -2297, 2690, -1491, -647, 360, + 1460, 1479, -2041, 368, 10454, -1277, -716, -172, + -538, -287, 169, -232, 960, -1087, -2459, -2196, + -1189, -1967, -1586, -783, 5275, 2811, -1523, -1733, + -2373, -1946, -1586, -1280, -442, -205, 2330, 6319, + -2483, -2115, -2645, -2016, -1464, 89, 529, 1338, + 5291, 3186, 5770, -2311, -2696, -2420, -619, -2322, + 8434, -129, 1661, 1232, -1377, -1277, -1193, 406, + -1332, -1246, -999, -497, 1024, 1500, -2791, -1417, + -2173, 2419, -1492, -734, 2795, 559, 750, 519, + -2714, -509, 4622, 3679, -294, 73, -805, 602, + -99, 94, -2658, -1984, 6907, -1780, -1244, 272, + 874, 140, 1326, 693, -2679, -2274, -2551, 13351, + -2619, 4570, -1739, 2309, 1280, 1235, -1011, -2084, + -1968, -1404, 2568, 3147, -336, 270, 499, 506, + -1567, -2240, -2685, -1951, -2254, 2783, -1411, 8878, + 2321, 1691, -2567, -2450, -2572, -2286, -2038, -1803, + -1316, -315, 464, 1223, -1988, -927, -2035, 2165, + 3663, -919, -328, 229, -2, 217, -2773, -2160, + -2637, -2183, 5081, -1434, 1526, 2830, 1698, 1153, + -2810, -1132, 5408, -1992, 4267, -1357, 809, 563, + 9, -64, -2949, 7061, 4604, -1424, -1839, -610, + -251, 370, 901, 147, -2264, 3135, 3241, -1102, + -397, -1292, 39, 17, 380, 383, -1483, -1458, + 820, 2135, -646, -479, 173, 23, -274, -442, + -978, -1216, -1928, 7260, -1249, -956, -24, 250, + 438, 128, 4080, 152, 2677, -587, -667, -672, + -662, -492, -722, -688, -1907, -787, 3101, -1404, + -1234, -508, 3817, 424, 657, -86, -2179, -599, + 2141, -1446, -1847, 4341, -801, -26, -57, 216, + -1625, -802, 1752, -1301, 2617, -1545, -513, -401, + 234, 658, 1299, -1279, 874, -1408, -1135, -40, + -423, 394, 660, 684, 3341, -937, -1842, -1177, + 1945, -621, 19, -93, 141, -59, -2626, 3368, + -1588, -1959, -1506, 3729, -347, 218, 497, 585, + -2495, -2452, -2118, 578, -225, 378, 40, 1080, + 908, 761, -2070, -1607, 2534, -1535, 1493, 2664, + 215, 634, 317, -233, 4188, -1446, -2129, -1812, + -1428, -1579, -1038, 97, 989, 2038, 3671, -2707, + -2608, -2198, -1119, 1601, 1042, 1325, 1230, 1149, + -2566, -1054, 3659, -2173, -1772, -713, -1080, -101, + 987, 805, -1555, -749, -1510, 3443, -1402, 4172, + -696, 437, 276, 219, -2735, -2453, -2082, 3898, + -867, -582, -726, 1134, 1227, 1121, 2333, -963, + -1474, 2386, -959, -327, -138, 4, 268, 479, + -2889, -2896, -2701, -1975, -593, 1212, 1511, 1087, + 1482, 1612, -1703, 4874, 46, -1364, -1342, -544, + -879, -455, -488, -396, -2616, 849, -2424, -1976, + -1491, -739, 325, 1284, 1831, 1223, -48, -1457, + -2123, -1318, 1617, -1064, 2484, -467, 533, 707, + 351, 422, -525, -657, 202, -476, 133, -679, + -945, -832, 1906, -2981, -2605, -1911, -2541, 11553, + -1585, 1555, 2196, 1616, -2669, -2345, -2423, -1848, + -1756, 4918, -711, 1186, 1873, 1399, -672, -1401, + -1524, -1138, -674, 1285, 195, 884, -377, -1067, + -2125, 377, -1747, -1604, 837, -334, -115, -59, + 160, 483, -2220, 12861, -1633, -1616, -926, -1203, + -113, -90, 378, 148, 5740, 88, -2246, -1598, + -1546, -1694, 2790, -72, 590, 28, -2608, 4312, + -1068, 3091, -632, -651, 366, 63, 744, 375, + 1746, 2753, -2075, -1621, -1033, -471, 972, 199, + 575, 655, -2148, 2407, -2180, -1764, -1030, -1089, + 4083, -80, 417, 384, 1196, -2284, -2549, -1771, + -773, 213, 1188, 788, 1343, 1358, -2584, 7723, + -2171, -2301, -1497, -438, 1001, 110, 671, 939, + 6435, 5777, -1765, -1287, -1181, -1014, 87, -919, + -422, -444, -1930, 4906, -1660, -1558, 3617, -1177, + 261, 9, 261, -47, -2539, 2749, -2476, -2298, + -1047, -1319, -341, -604, 2111, 2779, -2935, 5011, + -1860, -2363, -1686, -1033, 800, 1774, 1700, 1478 +}, + +.fcb22s_1 = { + 11523, -796, -1488, -1897, -1888, -1691, -1767, -1794, + -1622, -1210, -2284, -2777, -2382, -1371, -238, 2997, + 3182, 588, 1129, 704, 248, 1703, -264, -1306, + -1147, -560, -1513, -956, 1667, 1340, 5220, -2276, + -2215, -2049, -1479, -1294, -774, 66, 1270, 2075, + -1435, -1981, -2322, -1896, -1321, -462, 138, 5022, + 2549, 1683, -100, -1744, -1528, -423, 6093, -61, + -288, -623, -650, -828, -1521, 134, 1240, -1399, + -1450, 612, -969, 2585, 945, -312, -1138, -2488, + -2513, -1988, -1607, -773, 3384, 1192, 2651, 2580, + -984, -2015, -1465, -1576, 2273, -1221, 91, 2615, + 840, 1299, -1069, -2151, -1899, -735, 440, 888, + -241, 502, 953, 3613, 1806, -1855, -2303, -1758, + -1318, -1484, -10, 597, 3723, 1992, -488, -2063, + -2284, -2172, -1905, -1547, -937, -18, 3276, 7184, + -1942, -2302, -2399, -1972, -1378, -635, 302, 1081, + 5454, 3358, -447, -807, 205, -1805, -1546, -446, + 6364, -916, 151, -377, -582, -856, -204, -731, + -884, -674, -257, -67, 1564, 2486, 1003, -1508, + -1692, 1515, -889, -622, 2366, 9, -17, -245, + 3733, -1057, -284, 3197, -31, -440, -1115, -1609, + -1834, -1930, 230, 262, 7344, -39, -1746, -562, + -1554, -1838, -1648, -1310, 2157, 80, -102, 238, + -823, -622, -720, -115, -274, 16, -1562, -1785, + -1535, -334, 2604, 3388, -410, -103, -348, -142, + 1676, -441, -2267, -1988, -1421, -680, 1302, 2682, + 383, -10, 1487, -1086, -251, -1134, 141, -84, + -1003, -898, 95, 2304, 802, -1549, -1562, 2650, + 2180, 64, -512, -832, -705, -429, 1826, -2283, + -1976, -1277, 2699, 504, 249, -9, 178, -33, + -1357, -1138, 3005, 293, 229, 1633, -197, -540, + -1245, -1617, -1269, 6639, 2437, -647, -1501, -1097, + -1051, -1150, -1183, -1461, 71, 1529, 2847, 1149, + -705, -1345, -1605, -629, -617, -60, -2081, -1435, + 938, 844, -1055, -841, 1179, 392, 1112, 946, + -1252, -1728, -266, 7063, -1335, -920, -1048, 206, + 48, -619, 4764, 274, 2394, -799, -798, -1003, + -1278, -1800, -1626, -1415, -498, 1439, 1643, -1978, + -1258, -1136, 1285, -9, 596, 141, -2211, 908, + 802, -470, -1125, 3216, -234, -412, 3, -980, + 15, -1047, 1530, 660, 1986, -480, -499, -550, + -733, -531, 1326, -1607, 787, -1136, -1002, -65, + 358, 743, 253, -294, 3498, -1033, -1270, -790, + 537, 1788, 309, -72, -1241, -1999, 609, 2981, + -1025, -1642, -958, 3845, -1221, -962, -965, -1612, + -1993, -33, -1136, 1086, -46, 1178, -229, 139, + 644, 718, -1696, 2411, 1019, -1056, 52, 224, + -487, -395, -40, 125, 3001, -1955, -1950, -784, + -1111, 897, -514, 159, 785, 1095, 2944, -2554, + -2407, -1975, -632, 1030, 1712, 366, 463, 125, + -2354, -796, 5663, -1055, -1151, -870, 348, -676, + 1447, 215, -1005, -1531, -910, 2249, -438, 2889, + 107, -404, -271, -534, -1022, -2117, -1738, 2261, + -257, -788, 32, 1747, 1196, 910, 33, 1, + -23, 28, -25, 19, 13, -29, -23, -48, + -907, -2113, -1978, -1426, -535, 1589, 1908, 2724, + 1646, -897, 758, 2326, 674, -1449, 111, 220, + 475, -162, -1465, -2036, -528, 1308, -2087, -2031, + -1308, 183, 35, 1097, 1008, 1864, -2116, -2303, + -1928, -261, 2342, -292, 1480, 268, 1582, 1079, + -1183, -1154, -777, 309, 1218, 683, 1314, 1677, + -758, -1745, 1422, -1331, -1638, -1100, -303, 5003, + -57, -379, -511, -756, -727, -2315, -1860, -1775, + -676, 3854, -67, -52, 2018, 1532, -160, -197, + -75, -1934, -1134, 2025, 1810, -491, 83, 646, + 390, -297, -441, -342, -479, -486, -296, -30, + 443, 1151, 3508, 6119, -493, -1427, -1393, -1273, + -1280, -1687, -1683, -1511, 5109, -1008, -1137, -638, + -649, -342, -590, -478, -577, -349, -579, 2548, + -463, 2107, -568, -678, -788, -454, -608, -452, + 1934, 1485, -1746, -1007, -1174, -573, 239, -119, + 679, -76, -1687, 1956, -898, -477, 456, -156, + 1460, 13, 92, -987, 554, -2772, -2578, -1694, + -235, 753, 1527, 1106, 1539, 1342, -1305, 6560, + -1526, -1765, -793, -600, 248, -542, -63, -421, + 4828, 1288, -1580, -1826, -1163, -1014, -221, -818, + -109, -61, 1265, 1939, -1265, -414, 1912, -190, + -1157, -675, -756, -935, 2529, 136, -1709, -1727, + -1819, -1504, -1232, -959, 1128, 4142, -1945, 2958, + -900, -1432, -1720, -1380, 381, 1473, 1235, 1062 +}, + +.fcb22l_2 = { + 2441, -2086, -2129, -2146, -1839, -1035, 295, 2465, + -2785, -2597, -81, -2162, -991, 3060, 3056, 2985, + -2415, 4009, 3058, -1165, -1281, -322, 629, 2232, + 481, -2255, 1165, -1455, -621, -29, 923, 1371, + -2822, -2421, -2596, -1908, 6338, 279, 1845, 3532, + -2955, -2571, -2554, 744, -1785, -909, 775, 3156, + 738, 1760, -458, -590, -73, 22, -91, 326, + -1098, -1511, -1000, 1741, -1024, -562, -399, 736, + 9669, -2109, -1872, -1539, -1208, -265, 994, 2364, + -2121, -98, 1523, -1427, -1450, -1157, -294, 1375, + -3007, -2669, -2847, -1777, -1196, -1257, 1065, 9128, + -2948, -2509, 470, -2521, -1947, -728, 503, 3810, + -2538, -2469, -2217, 1957, 2580, -229, 1212, 2263, + -3174, -2660, -2792, -2692, 1226, -512, 555, 3960, + -2979, -2426, 1978, -2182, -1868, -455, 4681, 4580, + -2514, -1642, -1029, -1712, 416, -838, -362, 1208, + 5211, -2128, -1867, -1337, -549, -70, 828, 1508, + -2272, -1611, 7307, -1612, -1244, -461, 749, 2510, + 3669, 3236, -1845, -1333, -866, 268, 850, 1686, + -2805, 1079, -2258, -2075, -2017, -1115, 214, 2735, + -2719, 2676, -2154, -1976, 2884, 393, 1247, 2382, + -3043, 2188, -2703, -2353, -1861, -208, 4419, 4511, + -2187, -1630, 2246, 2331, -1105, -198, 818, 1721, + -2180, 3571, -1841, -1738, -1020, 14, 407, 1028, + -2536, -2171, -2115, 6630, -968, -306, 1438, 3574, + -2411, -1857, 1911, -1546, 2709, 57, 910, 1727, + -3159, -2565, -2675, -2746, -2017, -534, 8461, 6103, + -2299, 2912, -1851, 2660, -1479, -97, 1148, 2204, + -2510, 8781, -2194, -1790, -1114, -110, 1140, 2885, + 3261, -1921, -1633, 2766, -788, -403, 610, 1651, + -2515, -2021, 2415, -1606, -1149, 2479, 297, 1693, + 3823, -1538, 2514, -1261, -904, -236, 550, 1581, + -2903, -2440, -2922, -2749, -2480, -1849, -423, 3613, + 3420, -1876, -1929, -1537, 2955, 58, 1014, 1950, + -3295, -3009, -3161, -2926, -2353, 2355, 351, 5502, + -3140, -2745, -2781, 1247, -1037, 538, 4939, 4382, + 3584, -2284, -2321, -1844, -743, 3156, 1546, 2358, + -562, -101, -497, -1196, -1023, 1972, 1255, 1374, + -3146, -2824, -3057, -2757, -1736, 3746, 5609, 5118, + -2155, -1665, -1701, -1780, -1975, -1127, 3185, 2036, + -2540, 324, -481, 311, 624, 719, 543, 1030, + 550, 513, -2430, -1817, -1129, 62, 1526, 1809, + 2172, -1314, -1035, -586, -292, 233, 209, 543, + -252, -2372, -1961, -1629, -1306, -408, 451, 1339, + 792, -2619, -2316, -1624, 1941, 678, 977, 1710, + 428, -2499, -2369, -2101, -1448, 2988, 874, 2497, + 451, -2263, -2204, 1403, -631, 694, 1424, 1658, + -243, -2104, -378, 355, 1446, 373, 377, 973, + -756, -2802, -2508, -2081, 177, 352, 2428, 2359, + -1533, -2710, -2544, -1102, 419, 3132, 1222, 1942, + -2756, 1844, -2429, -1854, -1283, 3960, 1633, 2917, + -2858, -2784, -2106, -1025, 1588, 905, 1092, 1657, + -3028, -2715, -2782, -2218, 2852, 4006, 2534, 3726, + -2783, -2355, -2146, 2113, -1201, 3361, 1178, 2670, + -3199, -2796, -2682, -2489, 1905, -471, 5097, 4436, + -2197, -1078, -2327, 420, -637, 10, 1647, 1362, + 1815, -2519, -2363, -2174, -1454, -31, 4125, 3446, + -3054, -2953, -2738, -2328, -1636, 1086, 2238, 2132, + -3089, -432, -2674, -2515, -168, 745, 2236, 2305, + -3214, -2953, -3159, -3086, -2748, -1200, 3346, 5127, + -1150, -501, -2109, -1662, 2301, -401, 651, 1320, + -3072, -2608, -2833, -2249, -1387, 7704, 1811, 4960, + -2474, -2589, 83, -499, -785, 194, 1312, 1442, + -2716, -1663, -2088, -1812, -1396, 1862, -369, 1397 +}, + +.fcb22m_2 = { + 8809, -2291, -2452, -1982, -1356, -423, 419, 588, + 897, 1086, 79, -2155, -1957, 367, 1080, 233, + 718, 441, 515, 642, 730, 2454, 774, -2299, + -1526, -784, -359, 96, 385, 482, 4905, -2501, + -2431, -2047, -1139, 131, 743, 999, 1243, 1294, + -2154, -433, -2461, -2201, -1552, -163, -200, 4009, + 1731, 1652, -2381, 5295, -1457, -895, 3480, -1230, + -94, 471, 554, 669, -2458, -1271, 278, -2238, + -1852, -813, 888, 1032, 801, 1008, -258, -538, + -1744, -2087, -1651, -1239, 2222, -4, 783, 882, + 478, 782, -1335, -1453, 1728, -627, -387, -205, + 221, 193, -2282, -518, 7464, -1808, -1134, -199, + 340, 321, 410, 617, 2278, -436, -2082, -1958, + -1493, -885, 628, 794, 855, 989, 232, -1115, + -2617, -2152, -1290, -1299, -458, 222, 3936, 3349, + -2240, -2787, -2689, -2255, -1241, 816, 2307, 1566, + 1685, 1723, 2960, -2134, -2532, -1798, -1128, -1073, + 5380, 1013, 1525, 1415, -1976, 456, -538, -1433, + -1347, 22, -496, 284, 387, 465, -2214, -1863, + -2261, 1049, -1487, -1222, 1610, 621, 1000, 1116, + -2393, -731, 4075, 2375, -1178, -908, -383, 327, + 543, 572, -2071, -2039, 3310, -1903, -1502, -72, + 123, 693, 721, 918, -1866, -1251, -1065, 5630, + -1574, -541, 1, 1014, 813, 887, -2145, -2421, + -2176, -1756, 1856, 408, -1, 759, 1109, 1276, + 3053, -2705, -2467, -2068, -1160, 1405, 459, 1167, + 1219, 1318, -2198, -2037, -2005, -2204, -2039, -1473, + -1529, 264, 1333, 1822, -2121, -1434, -472, 1901, + 2448, -589, -424, 248, 376, 602, -1571, -1032, + -1243, -1619, 5682, -1162, 362, 570, 865, 852, + -1875, -805, 4258, -1569, 2992, -1175, 51, 164, + 314, 648, -2083, 5574, 2553, -1866, -1156, -642, + -198, 330, 446, 602, -2365, 1601, 2873, -2043, + -1510, -1142, -20, 588, 535, 676, -2207, -1637, + 626, 745, -1548, -590, 745, 540, 505, 618, + 749, -1389, 857, 1387, -398, -606, -75, -86, + 11, 78, 3322, -1347, 1978, -1431, -745, -280, + -42, 135, 350, 376, -508, -1349, 2961, -1184, + -647, -1257, 3009, -374, 523, 616, -1848, -41, + 2652, -1609, -1603, 3284, -24, 502, 122, 448, + -2337, -1029, 734, -1533, 1523, -1312, -754, 335, + 510, 774, 769, -117, 139, -1254, -1468, -965, + -375, 2, 227, 518, 3187, -1524, -776, -1253, + 2977, -530, 319, -61, 244, 413, -2290, 3085, + -1763, -1480, -1374, 3272, -87, 323, 421, 652, + -2317, -2182, -1604, -1, -801, 1320, -156, 907, + 799, 918, -1494, -2205, 1137, 69, 1249, 3437, + 925, 29, 419, 448, 3574, -1564, -1713, 2374, + -941, -252, 123, 263, 366, 539, 1059, -1856, + -1753, 766, -1704, 106, 262, 596, 684, 820, + -2503, -1878, 1835, -594, -1024, -2105, -1567, 488, + 794, 883, -1626, -613, -1410, 2846, -1413, 3557, + -348, 460, 332, 577, -907, 700, -1680, 1130, + -1637, -793, -160, -38, 473, 630, 1487, 1872, + -1526, 1379, -806, 121, -383, 149, 259, 413, + 759, -2817, -2758, -2290, -1348, 460, 1782, 1536, + 1513, 1503, -2265, 3193, 117, -1704, -1367, -487, + 125, 365, 594, 651, -2287, 1272, -2537, -2038, + -1515, -578, 2994, 582, 941, 1058, -1556, -1583, + -720, -1584, 956, -1032, 1861, 146, 402, 429, + -2184, 1667, 1241, 289, 52, -232, -265, 210, + 248, 331, 1133, -1813, -1869, -1429, -1484, 5620, + -400, 1316, 1146, 1150, -1975, -818, -1921, -2054, + -1768, 2953, -544, 426, 856, 1107, 493, -2019, + 176, -1915, -1040, 717, -91, 728, 647, 776, + -2360, 739, -2136, 30, 636, -447, -116, 498, + 531, 775, -2250, 8607, -2075, -1928, -1072, -450, + 38, 439, 558, 778, 4484, 1056, -1830, -1716, + -988, -412, 260, 56, 425, 579, -2243, 4094, + -1267, 2172, -990, -562, 97, 304, 533, 609, + 790, 780, -2029, -1947, -1327, 1224, 255, 344, + 516, 660, -591, 1702, -118, -1402, 396, -1387, + 2268, -247, 177, 355, 1393, -2318, -1975, -1563, + 863, -939, -365, 411, 800, 1019, -2370, 4656, + -2301, -2111, -1679, -698, 458, 788, 1004, 1138, + 2285, 4924, -1940, -1955, -1159, -436, 237, 5, + 300, 364, -2492, 2165, -2021, -2072, 1504, -612, + -93, 249, 676, 799, -2411, 1952, -1752, -2418, + -2285, -1323, -621, 837, 1043, 1266, 76, 3160, + -2176, -2176, -1717, -1105, 1045, 410, 728, 940 +}, + +.fcb22s_2 = { + 6946, -1850, -1986, -1590, -1276, -1063, -1026, -1017, + -805, -346, 9, -2911, -2843, -1899, -198, 2193, + 3325, 1315, 37, -528, -371, 599, -751, -2157, + -1912, -855, 988, 1222, 1085, 953, 3212, -2793, + -2564, -1707, -657, 683, 1109, 683, 647, 446, + -1906, -2315, -2569, -2428, -1698, -600, 1100, 3790, + 3368, 2172, 2017, -895, -1354, -734, 2552, -403, + -68, -402, -752, -932, -1205, -1937, 572, -1434, + -500, -579, 291, 1723, 1312, 1695, -238, -1715, + -2029, -1525, -816, -363, 2816, 167, 2196, 1793, + 897, -1081, -262, -1338, 1052, -1231, -94, 1296, + 503, 184, 588, -2057, -911, -1933, -1769, 167, + 1013, 1774, 1414, 1289, 2406, -1906, -2055, -1952, + -1726, -1618, -451, 575, 3021, 2569, -776, -1649, + -2111, -1930, -1499, -1349, -595, 329, 3090, 5458, + -1954, -1309, -1554, -1159, -1132, 329, 714, 760, + 2529, 2417, 1046, -1025, -1114, -1325, -154, -1501, + 4160, -696, 230, 398, -2010, 385, -1344, 36, + -1269, -987, 1009, 1453, 1163, 1591, 916, -1534, + -508, 221, -1596, -1130, 1394, 539, 676, 676, + 1263, 2029, 284, 1592, 161, -124, -572, -1362, + -1946, -2148, -1488, -222, 4967, -1202, -939, -375, + -80, -593, -445, -418, -781, -1560, 31, 4757, + -1417, -954, -402, 193, -316, -278, -926, -895, + -1024, -436, 2673, 1991, 254, 28, -861, -1291, + 1475, -2708, -2689, -2118, -703, 290, 1841, 2048, + 1213, 594, 132, -2598, -2427, -988, -1111, -158, + 478, 2118, 2571, 830, -1430, -678, -773, 1340, + 2473, -798, -751, 215, 274, -65, 335, -1947, + -1796, -1436, 3862, -611, 105, -31, 775, 669, + 1439, -1266, 1670, -739, -1259, -572, -17, -107, + 176, 130, 3899, 3478, -548, -1429, -1176, -1104, + -1147, -1503, -1277, -1068, -258, 2645, 1753, -333, + -827, -1306, -827, -502, -306, -119, -1602, -1644, + 1922, 1127, -628, -1073, 348, 195, 616, 685, + 1750, -898, -1852, 1813, -700, 254, 598, -234, + -433, -1035, 2502, 94, 467, -1672, -905, 776, + 679, -11, -1071, -1845, -1083, -320, 690, 110, + -708, -1077, 2514, 70, -412, -300, -371, -717, + 1700, -1625, -1346, 1954, 14, -64, -121, 181, + -673, -909, 2274, -1389, 2058, -1503, 306, -187, + -209, -69, 1523, -632, -695, -1283, -988, -569, + -798, -521, 398, 2834, 1953, -2215, -1626, 106, + 6, -498, -57, 173, 731, 1002, -1706, 1701, + -328, -1745, -1398, 2176, -19, 311, 492, 667, + -1073, -1803, -1684, 703, -1316, 1803, 659, 913, + 906, 1033, -1982, -102, 945, -1620, 718, 555, + 613, 38, 394, 421, 2738, -1159, -2248, -1852, + -1568, 33, 363, 1490, 935, 561, 1464, -2466, + -1209, -1204, -692, 2009, 129, 354, 372, 380, + -2053, 1122, 2272, -824, -1355, -926, -122, 567, + 526, 923, -1320, 59, -226, 1674, -1512, 1498, + -631, 221, 26, -247, -40, -1615, -1597, 2111, + 34, -813, 200, 219, 758, 1000, 306, 394, + -430, -117, -409, -81, -207, 16, 36, 176, + -1737, -2898, -3005, -2214, -568, 2140, 4132, 2592, + 504, -521, -1509, 3610, 1070, -1890, -1319, -11, + 174, -148, -212, -347, -464, -1068, -2568, -2532, + -1973, -519, 2104, 3713, 1882, -145, -1319, -2375, + -1862, -843, 2061, -266, 1465, 866, 912, 1183, + -1784, 2072, 205, -375, 1112, -374, -534, -430, + -162, -204, 375, 82, -823, -1148, -752, 4681, + -339, -247, -790, -1088, -494, -2302, -2310, -1603, + 46, 3367, -50, 393, 1383, 1457, -1377, -2005, + 643, 326, 312, 1189, -225, 563, 261, -70, + -667, -1191, -2255, -470, 1000, 142, -525, 2285, + 756, 2061, -953, 5888, -1339, -1534, -1252, -16, + -116, -305, -375, -596, 3611, -889, -511, 43, + -809, -659, -737, -510, -258, -108, -1515, 2806, + -1555, 1025, -932, -601, 146, 164, 207, 71, + 1606, 93, -2420, -2311, -1641, -244, 1785, 804, + 1040, 427, -1510, 38, -2490, -1987, 44, 699, + 1407, 988, 1061, 411, 1162, -1382, -2669, -1635, + -905, 1503, 674, 1357, 869, 244, 411, 2612, + -1792, -2147, -1693, 1434, 281, 38, 228, 424, + 2291, 1354, -2128, -1377, -1014, -609, 131, -151, + 418, 602, 111, 2200, -1547, -1153, 1435, -1282, + 6, -111, -1, 92, 238, 613, -2271, -1181, + -1455, -919, -182, 1066, 1932, 1679, -1715, 2825, + -1764, -1759, -741, -829, 501, 746, 1056, 1416 +}, + +.fcb44l = { + 4868, -1851, -2031, -2019, -1751, -552, 756, 929, + 1389, 1590, -2090, -1202, -1317, 516, -1798, -1020, + -694, 4322, 1388, 1904, -2605, -1239, 1005, -757, + -1248, -358, 699, -201, 409, 1093, -2901, -2254, + -2605, -2595, -2104, -1681, 6854, 2692, 3155, 3446, + -2535, -1421, -1745, 898, -2046, -1457, -1044, -269, + 1748, 1873, -2268, -1098, 407, -1865, -2103, 1510, + -1217, -399, 1718, 2017, 3638, -1685, -1547, -1480, + 1637, -744, 580, 586, 1313, 1409, 617, -2020, + -1919, -2179, 932, -937, 559, 1795, 1528, 1596, + -2867, -2553, -2507, -2653, -2365, -1985, -170, 8679, + 4271, 4273, 2263, -1835, -1934, -1719, -1778, 2357, + 125, 1319, 1543, 1765, 3689, -1215, 2369, -1533, + -1611, -771, -123, 1005, 1297, 1465, -2491, 2631, + -1636, -1655, 1244, -1178, 386, 961, 1300, 1553, + -2357, -2404, -2305, -2177, -1714, -383, -98, 258, + 3902, 2475, -2923, -2580, -2685, -2803, -2678, -2428, + -1247, 450, 8174, 5035, -2302, -1629, -1495, 1832, + 1616, -577, 639, 872, 1122, 1437, 785, -1947, + -1976, 823, -1909, -1005, 430, 1244, 1713, 1664, + -2537, 8025, -1705, -2005, -2030, -1155, 64, 1106, + 1975, 2277, -2410, -2639, -2292, -1858, 162, 744, + 555, 1559, 1719, 1806, -2282, -1982, -1914, 1415, + -1785, 2197, 254, 763, 1338, 1741, -2509, -1991, + -2328, -1853, -2299, 5145, -34, 1495, 2913, 3018, + -2009, -1736, 2411, -1595, 1877, -1316, 693, 1042, + 1565, 1744, -2657, -2161, -2222, -2135, 4454, -1784, + 1331, 3208, 2852, 2955, 3738, -1338, -1425, 2090, + -1601, -279, -2, 712, 1220, 1436, -2385, -1265, + 7093, -1561, -1742, -1003, 283, 1009, 1843, 2055, + -2251, -2175, 2310, -1321, -1976, 1874, 164, 2781, + 2721, 2487, 2519, -1101, -1539, -1575, -1487, -724, + -25, 355, 643, 1011, -2296, -1799, -1895, -1700, + 2743, -924, -254, 32, 1504, 1910, -2811, 898, + -2363, -2518, -2408, -1737, -936, 221, 2588, 2527, + -2535, -2360, -2477, -1861, -1882, 1833, 3587, 1307, + 2141, 2274, -433, -1994, -1692, -1318, -1398, -350, + 1518, 1923, 835, 1262, -2246, 3383, 2458, -1464, + -1874, -983, -157, 531, 1490, 1729, 9543, -1713, + -2011, -2015, -1870, -969, -34, 1160, 1724, 1919, + -2530, 140, -1923, -1730, -1720, -605, 629, 1577, + 974, 1373, -2268, -1582, -933, 1124, -1624, -514, + 4156, -118, 1515, 1907, -2267, -574, -1311, -954, + -47, -1259, 15, 364, 854, 1009, -2221, 629, + 994, -1646, -1324, -1509, 2359, 3453, 1393, 1912, + 3586, -2286, -2537, -2560, -2415, -1748, -368, 3093, + 2881, 2611, -2556, 2792, -1558, 1117, -1681, -65, + -36, 516, 1233, 1514, 531, -1814, 998, -1795, + -1693, -871, 725, 868, 1504, 1465, 907, 300, + -2060, -2366, -2392, -1881, -596, 1754, 2169, 2104, + -2755, 2709, -2298, -2627, -2423, -1875, -733, 3886, + 2648, 2821, 623, -541, -163, -319, 85, 84, + 15, 716, 511, 572, 3948, 2773, -1504, -1746, + -1832, -934, -78, 988, 1277, 1518, -2678, 2216, + -2162, -2331, -2076, -968, 3445, 1070, 2077, 2206, + -2892, -2425, -2674, -2905, -2844, -2584, -1381, 3269, + 2696, 3281, -2090, -369, -1515, -1367, -200, 2089, + 739, 700, 866, 1169, -2276, -1057, 2851, 2589, + -1686, -515, -65, 579, 1278, 1593, -2837, -2458, + -2565, -2783, -2843, -2468, -1704, -1531, 1475, 4153, + -2209, -1857, -1873, -2177, 758, -1531, 3207, 1163, + 1506, 1851, -2383, -1683, -1839, 5772, -1815, -465, + 361, 1086, 1912, 2140, -2629, -1688, 1608, -2190, + -2419, -2064, -1253, 1397, 2099, 2306, 513, 1664, + -1683, -1629, -1682, -109, 269, 695, 1072, 1317, + 208, -1602, -1918, -1038, -813, 312, 24, 26, + 761, 990, -2288, -2225, -1948, -1932, -1832, -949, + -450, 920, 805, 1468, -2897, -2633, -2557, 464, + -2174, -1157, 1170, 2230, 2550, 2522, -2643, -1928, + -2255, -2578, 82, -2206, -63, 2663, 2007, 2292, + 226, -2541, -2687, -2753, -2229, -1556, 785, 3837, + 2331, 2492, -2496, -1740, -2465, -2295, -2151, 1142, + 363, 3967, 1943, 2432, -2619, -2400, 520, -2274, + -1900, -1486, 2135, 1407, 2300, 2288, -2811, -3066, + -3128, -3098, -2529, -1475, 2172, 3413, 3613, 3571, + 564, -2347, -2257, -2377, -1944, -1771, -582, 509, + 1683, 1975, -285, -2136, -2529, -2464, -2117, 278, + 1094, 1042, 2192, 1976, 1781, -1874, -2042, -2103, + -1744, -1044, 3373, 1252, 1861, 1873, -2688, -1849, + -2462, -2494, -2105, -1903, 2221, 250, 1653, 2233 +}, + +.fcb44m = { + 13151, -1763, -2583, -2518, -2181, -1036, -537, -112, + 214, 590, -608, -2270, -2228, -1301, -1018, 3687, + -471, -282, 909, 1665, -2426, 1713, -808, -1240, + -1366, -976, -140, 1730, 683, 191, 7253, -2076, + -2733, -2698, -2253, -1116, 376, 687, 1314, 1532, + -820, -1471, -2092, -2047, -1796, -1347, -732, 6348, + 2529, 1441, -1460, -1845, -1046, -1643, 8086, -928, + 90, 660, 428, -188, 604, -2022, 556, -1680, + -1641, -902, 834, 941, 1480, 1906, -2439, -2573, + -3091, -2853, -2419, -1606, 2312, 2624, 2659, 2659, + -1286, -2273, -2400, -1826, 2443, -1391, 685, 1822, + 1810, 1625, -1993, -731, 9737, -1476, -1183, -1244, + 34, -85, 0, 201, 4171, -2430, -2869, -2866, + -2488, -1154, -1253, 282, 2715, 3643, -2130, -2522, + -3259, -3051, -2977, -2204, -1264, 1103, 7113, 7948, + -1271, -1694, -2011, -1294, -1607, 247, -303, 715, + 4276, 1908, -2337, -2111, -2232, -2123, -1648, -1302, + 7686, 1213, 982, 984, -2594, -2127, -1981, -2104, + -2405, -1966, -936, -95, 326, 672, -2263, -893, + -1367, 1288, -1321, -1351, 2503, 747, 390, -247, + -2220, -860, 3641, 3766, -1724, -1487, -531, 239, + 134, -82, -2563, -1537, 3883, -1911, -2109, -1713, + 1056, 726, 977, 1091, -1874, -1366, -1628, 11069, + -1653, -696, 118, -78, 337, 29, 2449, -1438, + -601, -1533, -816, 1262, 540, 79, -460, -1403, + 3204, -1918, -1892, -1911, -1468, -976, -42, 2785, + 1088, 564, -236, -2267, -2324, -2130, -1880, -427, + -258, -543, 903, 5142, -1791, -1611, -1073, 2911, + 2993, -1295, -400, 229, 192, -85, 4461, -1711, + -1431, -1640, 3525, -1398, -101, -219, 327, 415, + -669, -1520, 6595, -1291, 5123, 155, -480, -518, + -552, -890, -2609, 7074, 3220, -1054, -1852, -1165, + -25, 89, -361, -140, -1610, 2214, 2903, -1737, + -1704, -1178, -708, -171, 177, 674, -1075, -890, + 82, 463, -1432, -1048, -703, -759, -247, 344, + 2448, -656, -1135, 4366, -583, -705, 40, -314, + -676, -1271, 4389, -952, 3249, -1606, -1524, -1172, + -490, 97, 128, -91, -66, -1293, 1696, -1114, + -1455, -519, 2620, 479, -257, -1512, -2037, -1281, + 1752, -1285, -1812, 2789, -52, 676, 409, 296, + -1977, -1043, 270, -1615, 2131, -1051, -161, -498, + 767, 1673, 1044, 27, -1107, -1730, -1856, -1264, + -275, -167, 893, 443, 3850, 97, -1244, -1691, + -1566, -1088, -1062, -837, -159, 1830, -1424, 2494, + -1878, -1532, -1991, 2919, 62, 399, 524, 381, + -1340, -2415, -2028, 218, -1342, 410, 815, 533, + 948, 1998, -1213, -1847, 3691, -2123, 1822, -1548, + 537, 987, 356, 123, 3876, -2476, -2021, -2195, + -1562, -737, 2250, 709, 797, 1102, 2065, -2258, + -2394, -1816, -1536, 1059, 4653, 1457, 456, -27, + -2226, -736, 765, -1879, -2188, -1793, -928, 892, + 1793, 2257, -1182, -1646, -1789, 6105, -1936, 4316, + -307, -143, 223, 236, -2213, -1862, -1823, 3326, + -1810, -1384, -453, 1007, 1331, 1405, 4135, -2298, + -1657, 1981, -1702, -853, -318, 298, 760, 1025, + -2537, -2782, -2985, -2687, -2839, 4493, -448, 4249, + 3048, 2678, 1045, 3227, -690, -1390, -976, -652, + 587, 194, -749, -1358, -730, 250, -2404, -2548, + -2157, -1027, 32, 2091, 1059, 1360, 262, -2135, + -2061, -1777, -1614, -246, 2004, 2605, 1516, -948, + -1060, -1076, -1643, -748, 144, 1595, 1730, 531, + -1086, -2182, -483, -2191, -2411, -1983, -2345, 10051, + -841, 1456, 924, 207, 4652, -1831, -2026, -1710, + -2235, 4036, -755, -70, 533, 887, -1899, -2326, + -2129, -2115, -1606, 1443, 2557, 941, 618, 527, + 949, -1547, -2067, -1785, 455, -60, 79, 202, + 912, 954, -2527, 14551, -1893, -2315, -2609, -1844, + 497, 287, -197, 626, 6839, -804, -1299, -1259, + -1109, -97, 976, 144, -343, -1375, -2334, 3740, + -1049, 2980, -1739, -474, 223, 137, 155, -171, + 2962, 1814, -2378, -2643, -2249, -1109, 858, 643, + 1630, 1399, -2098, 974, -1718, -2193, -2146, -1488, + 3353, -147, 1187, 1266, 1559, -2532, -2941, -2759, + -2101, -1098, 1562, 1049, 2045, 2159, -2298, 7439, + -2129, -2361, -2318, -1552, -422, 482, 985, 1111, + 6050, 5657, -1698, -2267, -2127, -1135, -140, -286, + -352, -124, -1230, 3492, -1370, -1221, 2958, -1239, + -472, -722, -169, -89, -2310, 2988, -2367, -2421, + -2589, -2034, -662, 421, 1863, 2736, -2612, 5429, + -2104, -2257, -2440, -1817, 4819, 883, 622, 636 +}, + +.fcb44s = { + 11239, -328, -2011, -1713, -1662, -1290, -1225, -1520, + -1541, -912, 400, -1103, -2698, -162, 263, -964, + 668, 405, 732, 2493, -2491, 1000, -2910, -793, + -1351, -515, 1051, 2002, 1757, 2150, -2010, -2021, + -2254, -1896, -1953, 664, 7067, 2632, 531, -1367, + -2228, 2113, -2019, 2309, -1458, -426, 1242, 338, + 205, -222, -1317, -1806, -2477, -2427, -2477, -1852, + -1472, -911, 2261, 10280, -2369, 382, 3180, -1210, + -1601, -748, -732, 504, 1440, 1142, -13, 610, + -2457, -739, -1318, -1013, -52, -470, 627, 4734, + 1248, 2947, -631, 1560, 2096, -833, -1173, -1475, + -2060, -2189, 967, -1451, -1544, -758, -538, -31, + 1395, 3550, -3, -1999, -1975, -1734, -2680, -2512, + -2037, -1306, -252, 1288, 6012, 4834, -1087, 3259, + 3115, -1369, -1136, -948, -264, -582, -677, -643, + -2500, 1284, -317, -1872, -1150, -1150, 310, 832, + 1597, 2842, 6295, 3806, -671, -1536, -1460, -1256, + -1223, -1504, -1672, -1471, 1358, 1004, -1893, 1114, + -1643, -103, -513, 189, 303, 140, -1618, -648, + -720, 7274, 573, -180, -731, -1226, -1564, -1742, + 151, 2103, -1562, -974, 94, 546, 3536, -205, + -1657, -2534, -2187, 2840, -1248, 451, 2615, 171, + 479, -305, -1299, -1708, -2144, -1593, -1289, 2766, + 2287, -400, 188, -51, 141, 105, -2128, 4976, + -1690, -1216, -1175, 297, 1454, 449, -478, -970, + -1914, -1459, 3036, 2668, -950, -634, -507, -374, + 4, 34, -1664, 2901, 847, 2817, -1154, -1651, + -1262, -1160, -624, 629, 1578, 765, -2002, -2121, + -1527, 1938, -272, 113, 287, 955, -1473, 60, + 8047, 137, -534, -841, -1077, -1504, -1788, -1758, + -1871, 119, 931, 1775, -704, 2792, 354, -501, + -1370, -2038, -1031, -1631, -1914, -879, 377, 7589, + 173, -196, -491, -1658, 3790, -773, -1731, 3028, + 49, -1013, -563, -1232, -953, -730, -2568, -1926, + -679, -267, -324, -962, 51, 461, 2728, 3631, + 3533, -1690, -2846, -2370, -1945, -917, -551, 276, + 2634, 3558, -2592, -1750, -2422, -1586, -1204, -1001, + 4603, 1802, 2673, 1685, 2710, -853, -2321, -1919, + -1603, -868, 3706, 290, 570, 338, -2245, -1704, + -1915, 545, -787, 1635, 1725, 526, 666, 1604, + 642, -1154, 3231, -1232, -1772, -623, 217, 27, + 3, 641, -2411, 1924, -967, -1583, -1499, 2316, + 1354, -115, 333, 559, -1721, 2475, -1942, -2114, + -1196, -571, 1769, 2350, 1315, -607, 4510, -1414, + -2228, -1312, 1439, 469, -248, -399, -270, -721, + -1517, -1247, -771, -36, 6488, 942, -279, -572, + -1041, -1908, -2388, -2281, -2595, -2275, -1529, 51, + 471, 4435, 3002, 2738, 4049, 1562, -2706, -1672, + -1649, -1204, -518, -280, 774, 1344, 6, -1950, + -1521, -1768, -972, 1420, 3011, -191, 644, 1478, + 3220, -313, 3030, -153, -841, -739, -378, -1013, + -1410, -1815, -2104, -1033, -2097, -1992, -943, 2391, + 424, 369, 1601, 3331, 1494, -2060, -2027, 1579, + -1407, 1120, -280, -197, 761, 1048, -710, 4094, + -1533, -1984, -1620, -1132, -515, -485, 971, 2644, + 3979, -661, -1891, -1120, -897, 2484, 1623, 21, + -1534, -2438, 3201, -1510, 858, -1459, -711, -1332, + -833, -240, 763, 1096, -1435, -29, 3174, -1773, + -19, 708, 1680, 403, -910, -2224, -2670, -619, + 1320, -751, -1323, -1022, 2875, 1080, 985, 1, + 191, 7823, -475, -604, -1126, -967, -1139, -1600, + -1767, -1161, -1342, -1960, -2112, -1793, -1596, 3103, + 535, 2001, 3235, 151, -2266, -807, -1977, -1661, + -1255, 2328, 2632, 3189, 621, -1130, -2183, -1127, + 2391, -884, 2173, -690, -354, -516, 352, 954, + 1847, -74, -1260, -1839, 2557, -1221, 228, -630, + -162, 386, 1462, -1889, -2596, -2216, -1869, -518, + 1281, 2329, 2653, 1117, -1535, -1038, -1752, -1862, + -1635, -1067, 994, 5212, 2719, -264, -2021, 1824, + -2110, -619, 1538, -397, -332, -153, 860, 1281, + 6568, -1790, -2459, -1707, -1708, -799, 294, 89, + 475, 992, -1668, -1819, -2010, -1623, 2079, 3255, + -388, 591, 1477, 581, -1544, 476, -1825, -959, + -1296, -1037, -453, 1146, 4693, 839, 2027, 3021, + -1731, -1746, -1964, -1115, 1197, 102, 164, -162, + -2301, -1281, -2022, 3983, -1122, -281, 85, 352, + 1042, 1599, 6463, -93, -2010, -1988, -2282, -2189, + -1915, -1721, 17, 4694, 424, -998, -111, -1995, + -1246, -1176, 78, -116, 1951, 3059, -1974, -1783, + -2243, -1238, 3935, -928, -15, 1265, 1536, 1907 +}, + +.shape08 = { + 5279, 1101, 12974, 5624, 2029, 3853, 5918, 1516, + -2905, -224, -92, -819, 803, 1091, 3091, -3355, + 152, -1214, -7317, -738, -8973, 546, 12035, -937, + 2216, 2113, 1214, -6577, 2006, -1661, -673, -5880, + 496, 454, 3400, 676, -322, 11388, 634, -1169, + 12556, -5804, -7724, 588, -6801, 1080, 354, -1681, + -942, 1926, -487, -580, 156, 79, 15253, 667, + 1155, 655, -719, 1999, -785, 214, 2822, 1020, + -1967, 73, -387, -137, -15225, -1552, -357, 2830, + 2140, 3070, -2552, 2410, 1230, 4131, 999, 248, + 531, -909, 3948, 12858, -8056, 2205, -2837, -171, + -1633, -129, -93, 1852, -1920, 157, 9647, -84, + -150, -1365, -1522, -13197, 6168, -3195, 5890, -1724, + -6407, -1340, -7435, -621, -5732, -2895, 145, 3974, + 728, 9840, -494, 7357, -394, -13614, -256, -1930, + 468, -266, 8001, -153, -365, 7652, 135, 1400, + -3869, 1091, -4935, -2884, 1259, 6819, 1025, -6667, + 1079, -9794, 6827, -4166, 1108, 1149, 18861, 593, + -177, -1067, -644, -2164, 4727, 85, -101, -10805, + -247, 8918, 2261, 5475, 756, 3018, -6535, 1941, + 359, -4229, 1206, 958, -878, 554, -18780, 2289, + 4906, -7412, -7685, 7932, 965, 2460, 4423, -563, + -3668, -3482, 3307, -1737, 971, -7480, 10742, 1978, + 2365, 20, -3625, 466, 2056, -6602, 9396, 3145, + 3162, 1857, -630, -6905, 1660, -3024, -2159, 1109, + 1282, 2767, 210, -2203, 3099, -7889, 1805, -13115, + 988, -6235, 1566, -1399, -9612, 1821, -519, -57, + 3428, -14024, 1141, -2542, -9396, -17, 440, -8591, + 2271, -7811, 1891, -935, -4330, -1303, 362, 426, + 319, 1176, 3176, 2202, -14308, -619, -2942, -2271, + -531, -652, 345, 17681, 1453, -1561, 341, -2077, + 933, 433, 1529, 463, -1095, 4912, -840, 16266, + 973, 1732, -718, 6702, -3659, 4037, -704, -2707, + 1423, 1291, 2300, 149, -933, -1338, 2019, 6173, + 481, 14937, -364, 3896, -443, 992, -896, 378, + -226, -1505, 268, -428, -2622, -289, -2069, 10472, + -3880, -5330, 385, 3053, -4642, 1525, -1557, 716, + 2504, 848, -450, -2018, -458, -705, -7120, -543, + -2138, 2548, -351, 737, 12906, -1012, 63, 15357, + 332, -837, -225, -1299, 2843, 1334, -669, 2083, + -707, 1171, 8219, 2190, 10567, 1370, -1376, -2919, + 2108, 10098, -388, 4442, 164, 490, 7580, 26, + -1848, -2919, 640, 4758, -108, 8194, -1325, -2314, + 447, 5178, -1095, 9902, -693, -3624, -223, 690, + 10495, 776, -919, -1621, 2046, 469, 1454, 3681, + -1090, -1776, 1457, 212, 2054, -994, 698, -496, + 22347, -623, 254, 960, -4073, 531, -2572, -14393, + -1022, 258, -3667, 994, 15242, 5078, -3618, 1925, + -1229, -1754, 1715, 4358, 1286, -2360, -4590, 1824, + 7864, 1423, -2146, -2763, -10635, 474, -829, 1159, + -157, -54, -158, -29, 202, -383, 285, -2, + 862, -364, 415, -123, -145, -9733, 1167, 10199, + -1408, -2992, 2131, -412, 4743, 2992, 3555, -617, + 9606, -2831, 2357, 5300, 625, -678, -500, -128, + -56, -6327, -1122, -2567, 1904, -1804, 709, 3194, + -148, -1371, -6534, -1748, -1490, 14159, 1466, 1395, + 1101, -2725, 503, 68, -1486, 0, 211, -1218, + -3, 20920, 1709, -208, -839, 4574, -6084, -6557, + -103, -984, -375, 8409, 1715, -2170, -5003, -3296, + 13482, 1211, -4159, 3496, 1040, 6925, 213, -1398, + 441, -1231, -814, 842, 1574, 1145, 1359, 437, + -1777, 20566, 259, -4573, -1412, -158, 10144, 1269, + 1405, -12631, -1104, -615, -15892, 355, -3795, -1158, + 3241, 252, 232, -179, -617, -2038, 285, -1014, + -1248, 1835, -1558, 1266, -10207, 629, -312, 11376, + 154, -288, 5915, -353, 60, 2695, -853, -103, + 15659, 2403, -1184, 3, 9236, -10953, 4434, 829, + 2563, -164, -848, -646, 7247, 895, 1726, -752, + -979, 1053, -971, 318, 2180, 927, 804, -262, + 446, 3261, -4926, -4523, 1247, 2039, 12770, -1191, + -1310, -5574, 4763, 657, -4139, 10821, -805, -1109, + -3189, -1721, 167, -10022, -1877, 2123, 328, -7048, + -2130, 2431, 1522, 3209, -8448, 1810, -5412, 9815, + -3677, 6575, -6237, -929, -434, -2375, -13586, 3497, + -1140, 1227, -6354, -507, 329, -1690, 1079, -880, + -3743, -4021, -4645, -6053, 958, 4594, -1122, -11628, + 1537, -3418, -1242, 133, -9335, 1611, -432, 10733, + -885, -468, -13466, 690, 214, 8968, 3441, 5451, + -219, 5492, -377, 409, 3812, 2450, 508, 6542, + 3824, -3705, -514, -8262, 1537, 7969, 946, -2869, + 8762, 417, 5094, 2104, 6694, -342, 1259, -4779, + -1445, -1519, 333, 4385, 652, -386, -580, -1892, + -873, 1862, 2704, 13837, -5415, -1975, 5881, 7150, + 8272, -6412, 704, 1854, 257, -3746, -9789, -9634, + -924, 1393, -3237, 259, -56, 4390, 4902, 1172, + 5114, -2616, -4409, -1180, 4691, 7400, -625, 8873, + 6846, -1224, -213, -5296, -3504, -147, 17828, -1347, + 3251, 1702, 1440, -2364, -491, -227, 1765, -446, + -9746, -2019, 11287, -195, -9559, -312, 888, 5789, + -1753, -11069, 2537, -265, -1762, -779, -8501, -308, + -89, 1973, 3640, 17344, 1326, -689, -398, -3820, + 2167, 229, -636, 2142, -6587, -751, 13243, 465, + -5946, -202, -968, -1060, -240, -10626, 3405, 1302, + -1263, 972, 11351, 100, 2266, -930, -2108, 5350, + -3186, 11130, 2073, -5616, 650, 2000, 1048, 5628, + -531, 674, 8453, 1030, 1152, 12095, 352, 409, + -1029, -1236, -190, -5724, -589, 3550, 1958, -14081, + -339, 1672, -1659, 4518, -75, -638, 5501, 277, + -578, -2185, 157, 2066, 8634, -2403, 1617, -12487, + -1881, 8273, 179, -2152, -1294, -512, -415, 456, + -141, -125, -405, 132, 49, -1978, -19085, -451, + -1480, 324, -5397, 235, -1217, 346, -1258, 3540, + 10075, 10291, 5060, -2057, 6156, -992, 9344, -3718, + 4296, 895, -8464, 341, 1426, 648, 1494, 2895, + -3760, 10139, 15531, -984, -1550, -1319, -1542, -119, + -517, -185, -3368, -9279, -3455, -4257, 1092, -10120, + 5072, 3099, 986, -2562, -12068, 1932, 6489, 950, + -2417, 1362, -567, 591, -715, -515, 3506, -726, + 6319, 214, -364, 3611, 1895, -2005, -273, 1513, + 2379, 475, -4855, -527, -11493, 27, 4343, -2394, + -639, -744, -2601, 10917, 1910, 2449, 1238, -2175, + 5322, -4054, -40, 4274, 684, 8152, 966, 10882, + -13, 4253, -287, -3192, 548, 2020, 189, -6894, + 797, 2160, 579, 4084, 1767, -4011, -640, 7697, + 791, 945, 1230, 6491, 1508, -3762, -433, 11340, + -129, -1131, -5121, 3148, 1544, -7648, 1866, 9660, + 2365, -2110, 782, -82, 3666, -701, 303, 298, + -1934, -125, -1427, -17589, -1188, 175, -7046, -488, + 1121, -6594, 489, -1551, 14349, 1499, -544, 17132, + 198, 2516, 2479, -978, -214, -3399, -1223, 2094, + 130, -1020, 1049, -710, 12801, -498, 297, -1365, + -187, -3169, -123, 9019, 958, 221, 14234, -590, + 961, 3092, 8, 255, -4586, 1789, 2522, -12577, + -91, -822, -805, -714, 5298, 1299, 3306, -1288, + 13176, 235, 1754, -67, 1912, -604, 3240, -2048, + -200, 772, -173, -996, 1368, 2380, 294, 763, + 19665, -196, 528, 182, -2394, 923, 749, -13578, + 855, 589, -9553, 0, 5737, 10399, 9147, -1655, + -3735, 1246, -2429, -1147, -2199, -2953, 614, -1404, + -449, -8524, -2271, 5001, -9517, 2940, -204, 3625, + -258, 32, 1521, -299, -1786, -2836, 1523, 2427, + -835, 3139, -197, 3351, -279, -14766, -1267, 5169, + -1039, -10967, 58, 641, -767, -1193, -591, -716, + -834, 8109, -915, -711, -10427, -1680, -638, 2643, + -850, -258, 10452, 362, -5394, -349, -14727, -655, + 1040, 1722, -10265, 551, -283, 9888, 408, -400, + 5980, 1878, 781, -923, -667, -789, -348, 624, + -260, 14515, -804, 1721, -2, 5356, 1802, 1218, + 498, 1871, -988, 16295, 4163, -2342, -4290, 3121, + 3269, 112, -3492, 1124, -1496, 1863, -1426, -1090, + 1598, -197, 1160, -1660, -1094, 477, -4104, -396, + 1605, 26134, 746, -12876, 2320, -1690, 8626, 39, + 1341, -1254, -1890, 2555, -13996, -1218, 3827, 1216, + -909, -180, 1720, -87, -143, 989, 340, -1426, + -4029, 3141, -9424, 466, -8227, 422, -7379, 2038, + 401, 98, 3602, -1223, -946, 2469, 1159, 727, + -268, 467, 203, -11079, 3850, -3469, -1965, -1857, + -1415, -2477, 3173, 7352, 9483, -5541, 6212, 1886, + -3868, 2728, 577, -5057, 321, 972, -77, 47, + 227, -38, -1037, -222, -347, -341, 1179, -948, + 592, -7485, 2218, -5955, 2698, 11798, 197, 6260, + 1711, 998, 8, -6223, -1184, 1145, -1781, 1376, + 1394, 388, -689, 2279, 6511, 2542, -4903, 3917, + -790, 535, -1903, -4448, 4216, -22, -6715, 5204, + 4807, 3193, -1064, 5403, 4503, -2434, -4296, 1383, + -1514, -4103, 747, 3928, 2987, 9513, 2492, -8691, + -993, -2667, -40, -170, -3116, 611, 2367, 16297, + -1256, -1404, -3462, 466, -524, 5464, 491, 706, + -7491, 2027, 373, -4086, 1620, -7789, 704, 5002, + 1706, 8325, -851, -9883, -3072, 4475, 2696, -8549 +}, + +.shape11 = { + 44, -10592, -832, -413, 612, 530, 379, 753, + 1442, -3006, -858, -1077, -12018, -196, -771, -1142, + -628, -2938, -439, -3323, 20, 12513, -2462, -1270, + -57, -8417, -690, 790, 276, 2349, -341, -1644, + 230, -2176, -202, -14725, 170, 1725, 3030, 683, + -231, 641, -242, -3252, 110, -1440, 2886, -1467, + -1155, 14395, 297, 52, 240, 3938, 9880, -7555, + -1214, 3351, 129, -1269, -168, 669, 13765, -1289, + -465, 10017, -632, -328, -276, -33, 31, 18883, + -148, -131, 525, 1669, 2288, -203, 868, -660, + 248, -409, -91, 295, -9174, -1484, 929, 2824, + 1097, -3205, -113, 2712, -1544, 527, 1419, -963, + -388, 691, -16791, -84, 72, -3802, -357, 1633, +-15182, 62, -6024, -742, -5396, 4470, -198, 1, + 1428, -1691, 18715, 1402, -2539, -375, -8455, -901, + -147, -3274, 9359, -277, -8941, 714, 2834, 2924, + -6326, 907, -123, 10487, -484, -4772, 877, 9840, + -505, -7562, 301, 671, 116, -371, 3740, 359, + 385, -5145, -908, 156, 9639, 3782, -9688, -4214, + -945, -7685, 334, 2185, -1342, 388, -1741, 278, + -231, -912, 905, -1039, 598, 2049, 662, -198, + 22378, 166, 116, -1699, 335, -8380, 1279, 1536, + 14955, 1254, 190, -2519, -608, 364, -561, 5748, + -1178, -923, 3183, -59, 13880, -2530, 241, -564, + -319, -7510, -9, -124, -20346, 305, -25, -400, + 222, -16943, -488, 802, -1685, 3323, -6198, 1000, + -903, -846, -387, 462, 847, 526, 10024, 2020, + 2090, -9563, 1416, 169, -12182, -428, 10388, 869, + 1068, 2201, -1041, -3180, 152, -646, 4, 4017, + -1069, 307, 5283, 3021, -13662, -493, 9, 542, + 152, -2617, -3870, -514, 13497, 1180, -603, 1255, + 2396, 7418, 8902, -11165, -2626, -5719, 1764, 858, + 1105, 1476, -1764, 1969, 977, -1738, -928, -13940, + 1444, -4157, 836, -12243, -369, -256, -15681, 5320, + -5170, -509, 353, -1581, -1455, 965, 716, 209, + -883, -317, -1961, 9128, -8197, 2173, -2434, -1126, + 4066, 1025, -16663, -7013, -147, 1617, -745, -3205, + 1496, 1822, -1199, -2999, 117, 619, -20002, -232, + 142, 3207, 561, -292, -1635, 1035, 37, 2712, + -243, -8269, 305, -2601, 495, 14516, 831, 260, + -54, 4217, 675, -1632, 4962, 793, 1066, 133, + -344, -12428, 95, 6164, -1298, -1860, 3622, -467, + -867, -1178, 11053, 118, -36, -6997, -763, 16019, + 16, 2459, 306, -820, -1135, 847, -709, 928, + -164, -293, -5736, 543, -11548, 5389, -2012, 300, + -228, -1043, 5107, -558, 1187, -140, -13034, -1571, + 740, -4967, -432, -6289, -1778, 3449, -337, -12607, + 344, -3790, -1598, -274, -346, -1494, -108, 325, + -1215, 819, 404, -568, -286, -21364, 15495, -2297, + 606, 117, 10, -193, -972, -292, -573, -1155, + -1289, -1025, 472, 1154, 843, 187, 586, 20569, + -5, -236, -1181, -1092, 700, 891, -603, -601, + 21648, -449, -193, -1103, -298, 2084, -251, 449, + -1414, 17168, -391, 104, -5465, 401, 8839, 781, + 1741, 201, -369, 466, 12358, -636, -945, 3928, + -605, -17445, 5020, -1289, 977, -6202, 1783, -507, + -76, 267, -31, -2731, -1560, -1225, 1348, 11176, + 1669, 754, 1671, -4038, 151, -371, 7283, 243, + 1387, 126, 1007, 1292, -15, 696, 282, -2623, + 1065, -1026, 191, -632, -132, -12957, -32, -1697, + -422, -240, 1352, 10252, 1067, 8296, -1244, -9, + -301, -3014, -249, -372, 10731, 535, 2147, -8959, + 346, -408, -8329, -1905, -48, -8176, 2782, 412, + 1425, -946, -748, 1095, -1370, 9086, -99, -143, + 68, -544, 264, 494, -377, 13, -618, 237, + 193, 3549, 317, -168, -7148, 2351, -244, -13240, + -3355, -2322, -533, 9554, 6906, 124, -694, -901, + -2762, 207, -915, -2520, -143, 8544, -678, -2788, + 12926, 791, 1296, 4861, -1470, 889, 3675, 806, + 290, -11146, 422, 9217, -31, 1608, 140, 3939, + -6903, -276, -704, 2353, -344, -1038, -230, -177, + 670, -617, -129, -857, -8231, 638, -411, -252, +-15709, -1218, 210, 288, 542, 533, -9087, -10493, + -624, 1175, 611, -230, 746, 1455, -590, 830, + 1756, -15800, 823, -1077, 788, 1071, 468, -1654, + 660, 983, -9697, -1300, 662, 2053, -281, 12949, + 389, -915, 197, -1742, -4587, 1746, 707, 1625, + 9021, 2204, 759, 1303, -428, -220, 41, -5499, +-16080, -193, 443, 443, -78, 889, -561, 5629, + -1073, 7019, 222, 1661, 1190, 1108, 94, 5624, + -3796, 407, -706, -122, 744, 363, 1648, -10896, + 595, 953, 85, -267, 195, 851, 17173, -636, + 243, 907, 2029, -700, 351, 1495, -157, -575, +-11664, 1252, 8341, -616, 3708, 5693, -6, -1753, + 1072, 863, -823, -4278, -12043, 750, 597, 3145, + 38, -8140, 3136, 290, 7, 11084, -876, 1842, + 175, 3458, 460, 1615, 11698, -827, 16, -12482, + 428, 411, 2625, -1352, 142, 529, 229, -48, + -965, -145, -592, 655, 499, 22095, 22141, 37, + -1875, 701, 45, 724, 1111, 1631, 262, -252, + -9092, 5325, 408, -637, -612, 647, 1268, 834, + -510, 603, 199, 816, -9904, 9533, -1580, 2669, + 1824, -2092, -701, -271, 7489, 46, -3295, -844, + -304, -226, -260, -692, -5, -527, 37, -49, + -1542, -69, -1087, 20519, 367, 1, 3487, 2535, + -5110, 642, 1223, -2130, -2894, 1752, -1618, 9732, + -1633, 6904, 137, 654, -358, 355, -21, -277, + -68, -188, 132, 530, 372, -315, -11498, 221, + 815, 2480, -1398, -123, 353, 3114, -12025, -1212, + -1111, 916, 6452, -1880, 1867, 307, -66, 1857, + 138, -980, -3088, -174, -41, -393, -656, 847, + 15824, -379, 358, 672, -389, 920, -21145, -393, + 350, -574, 1005, -2083, 26, 79, -203, -7967, + -3302, -5805, 772, -302, 2104, -1240, 13710, 6816, + 2282, -3709, -1512, -81, -2216, -3005, 444, -795, + 751, 2163, 20751, 780, 542, -480, 624, -425, + 769, 2474, -5903, 399, 10564, -112, 69, -1409, + 1885, 2339, 67, -620, 196, -2432, 6046, -1673, + 6512, 809, 7904, -516, 4278, 223, 359, 16512, + 1224, -480, -505, -735, -502, -593, -4565, 1914, + 122, -531, 1442, 464, 69, 292, 410, -581, +-19848, 1059, 132, 1392, 5917, 705, -7706, 2496, + -1487, -791, 11939, 185, -265, -2412, 630, -8028, + 1434, 10315, -1541, -3756, -2403, -1918, 1050, 8057, + 234, 13546, -92, -2172, -671, 11631, 103, 116, + -171, -4604, -267, -602, 15, 454, 6859, -2151, + -8707, -1664, 61, 2518, -969, 903, 1209, -1435, + 13531, 590, 236, -821, 598, 1186, -7690, 134, + -1005, -18177, -148, 519, 900, 951, 406, -3584, + 47, 9439, 1418, -797, -3353, -703, -1798, -1244, + 291, -2784, 14612, 2029, -161, 1040, -4130, 3064, + 1721, -2898, 269, 3367, 1379, 14359, -690, -655, + 2010, -4935, -681, -2606, 11651, 748, 101, 13593, + 629, 28, -540, -854, 1405, 558, -8785, -1016, +-13043, 121, -556, 4959, 1694, -720, -138, -3897, + 182, 1938, 844, 919, -683, 12042, -1101, -155, + -1375, -1509, 11, 220, 821, 21721, -367, -634, + -1468, -174, 1002, -1203, 318, 11672, -2114, 2472, + -1701, 5932, -661, 1094, 2500, -5609, 254, 437, + -911, -1611, -8005, 217, -1139, 1321, -10713, -2183, + 1163, -890, -622, 12820, 1021, -13578, 1040, 3216, + 592, 686, 737, -2881, -1693, 3995, -455, 4666, + -4124, -9316, 2061, 10645, 271, 264, -6829, 641, + 2061, -6683, -512, -747, -9131, 2445, 343, -9944, + -2888, 607, -10855, 871, 418, 504, 936, 1079, + 273, 400, -17752, -391, -1543, -6193, 1482, 737, + 2096, -982, 167, 972, 336, 1063, -1272, -1602, + -1907, 9, -191, -15207, -119, 4047, 1479, -1405, + 526, -18462, -627, -1996, -1022, -1544, 312, 7972, + -227, 797, -5204, -2160, 391, -423, 257, 3836, + 442, -1931, 22, 143, -203, 362, -73, 15679, + -289, -1445, 577, 858, 11408, -1970, -1022, 1550, + 882, -3699, -2697, 3978, 600, 86, 3858, 8683, + -7681, -4856, 4051, -1321, -587, 46, -499, -354, + -655, -15717, 67, 490, -2670, 474, -1374, 5601, + 60, -17615, -808, 87, 367, 579, 1057, 1020, + -394, 1181, -189, -10846, 763, 2635, 282, -3279, + -866, -15257, -449, 112, -15577, 227, 269, 13964, + -1273, 1513, -1487, 195, 319, 2527, -286, -5883, + -5360, -959, 2791, -3335, -945, -1985, -903, -11418, + 8525, 669, 6106, 153, -1169, -1198, -553, 7037, + 528, -4237, 717, -214, 1824, 10108, 961, 9077, + 1899, 10407, -207, -29, 355, -6794, 111, -13627, + 1361, -3577, 291, 4534, 2209, -1579, 109, 523, + 456, 10990, 31, -448, 385, 1481, 2, 15266, + 798, 5759, 860, -16424, -1315, 1631, -456, -977, + -180, -2593, 1191, 5959, -32, 8112, -506, -7766, + -1871, -15310, 662, 196, -20401, 925, 446, -2035, + -620, -686, -249, -2517, 423, 703, 633, 828, + -182, -37, -406, -149, 821, -22255, 652, 522 +}, + +.shape16 = { + -786, 193, -15441, 200, 1050, -16545, -41, 329, + -869, -170, -858, 2725, 217, 447, 2107, -23, + -387, -10280, -383, -320, 387, 16012, -79, -967, + 3528, -2123, -537, -636, -1761, 949, 100, -17, + -446, 261, 22527, 331, 26, -87, -206, -2292, + -1178, -164, 598, 147, 889, -14487, -2823, -1280, + -1892, 33, -1763, 993, 4807, -953, 2181, -588, + 59, -296, 218, 291, -104, 495, -1092, 2232, +-14904, -983, -2919, 795, -17207, -2045, 2988, 597, +-10312, -718, -2196, -5822, 847, 1304, -757, -4714, + -148, 831, -734, 806, 4348, -308, 244, 566, + 2706, 604, -748, -864, -568, -219, -128, -688, + -218, 110, -29289, 482, 76, -1447, -142, -417, + -253, 8124, -19775, 990, 4546, -1012, -8082, 133, + -1612, -2243, -3788, 1568, -2892, 852, -1642, -3479, + -23, 1300, -564, -1037, 249, -14533, -43, 321, + -680, 10, -417, 23426, 397, -108, 1843, 180, + 11976, -9613, 353, 3768, 130, -1035, 4340, 218, + 596, -224, -779, -1680, 1326, 152, -971, -9725, + -355, 5328, -459, 16242, -438, 926, 6210, 1912, + 769, 2621, -148, -1008, 517, 341, -3594, -965, + 11383, -874, -16949, 1167, -3371, -1655, 586, -132, + 3990, -770, 211, 246, 514, -166, -734, 30408, + -258, -521, -20, 339, 499, -2572, 2110, 272, + 1357, 123, 2841, -320, -31, -444, -501, 215, + -42, 595, 108, 484, -223, 937, 475, -72, + -319, 75, -205, -978, -9155, 145, 2020, -3, + 2438, 4046, -1281, -875, 1532, -598, 12288, 369, + -2046, 343, -778, 1769, -2589, -641, 17437, 1793, + -592, -1954, -1607, 6184, 3440, -512, -2710, -1330, + -127, 8765, 83, -243, -315, 709, 256, 1176, + -1198, -463, 970, -302, -568, -997, -1022, 159, + 11008, 27, 13074, 1523, -3239, 2330, -4808, 6115, + -9933, 1449, 2153, -3111, 1780, -731, 121, -881, +-14289, -265, 566, -611, -253, -2965, 250, -105, + -66, 2570, -1922, 2712, 1907, -2025, -454, 173, + 1463, -29, -31955, -113, -1751, -3353, 254, 1001, + 6781, -29, -639, -1289, 288, 498, -21505, 48, + 109, -2151, -223, 1360, -3430, 658, -4185, -1706, + 1244, 1899, 124, 12, -35, 289, 382, 433, + 261, -131, 54, -646, -280, 86, 180, 153, + -169, -20242, -95, 734, -524, 77, 102, 8468, + -421, 29, -3, 51, 1526, -600, -264, 355, + 1949, -985, -291, -86, 10212, -789, -393, -182, + -51, 946, -16716, -954, 1179, -2745, -509, -4774, + -587, -608, 7657, -509, -388, 987, 109, -218, +-17579, -524, -467, -1643, -444, 1430, 2541, -124, + 1785, 27, 7905, -73, -3135, -1241, -254, -2114, + 1175, 780, -50, 4055, 535, 438, 32, -113, + -260, 81, 1102, -59, 29188, -48, 212, -29, + -344, 559, 856, -483, 608, -40, -1498, 112, + 10374, 1198, -434, 4053, 1286, 236, 1823, 16046, + 592, 1583, 78, -5243, 1311, 456, -1342, -546, + -353, 13289, -333, -529, -20859, 183, -167, -1368, + -338, -690, 4248, -205, -666, -634, -1653, 1174, + 234, -18622, 891, 284, -2632, -1516, 289, 11242, + 727, 133, 284, -323, -1370, 908, -13169, -412, + 1155, 410, 610, -3072, -8220, -637, 242, -647, + -2072, 16041, 2292, -8009, 351, -3137, -3075, -1051, + 4569, 125, 23, 1281, 2487, 520, -209, -688, + 205, -1248, 246, -601, 533, -12209, -2298, 826, + -2762, 45, 15123, 721, 1128, 798, -676, 349, + -153, 263, 89, -854, -24, -350, -227, 157, + 587, -240, -185, 663, -32328, -148, -204, -2396, + -597, -344, 8104, -280, -375, 264, 648, 741, + -290, -321, 263, -569, -381, 167, 1757, -29636, + 30, 393, 398, 590, -242, 81, 1601, 3683, + 787, -336, 675, -1080, -713, 261, 18420, 1760, + 609, -4610, -551, 2790, 19807, 1347, -125, -9412, + -261, 548, 1056, 179, -917, -181, 12637, -267, + 621, -11908, 1366, 76, 5875, -742, 394, 155, + -370, 2481, 46, -15392, -344, -9750, -1353, -2242, + -1685, -1286, 2320, -2176, -1729, 705, -1582, 1590, + 1603, 21129, -3555, 2192, -883, 3438, 233, 1965, + -537, 399, -4818, -4085, 559, -292, 1290, -2700, + 10, -301, -1865, 226, 52, -1346, 306, 316, +-12281, -525, 285, 9631, -2, -849, 1620, 128, + 176, -1021, -473, 7929, -133, 2459, -33, -1517, +-22047, -2300, 98, -3513, 334, 4617, -193, -1309, + -1279, 738, -443, 95, 406, 660, -705, -54, + -39, 26396, -766, 249, -2423, 7759, -689, -3909, +-17404, 65, 1849, 945, 15907, 1386, -433, -831, + -6349, -3919, 1870, 8096, 311, 15043, 1709, -315, + 1288, 7522, -215, -5072, 1246, -1486, 3762, 4526, + 1517, -1936, -543, -263, 771, -10215, -425, -5098, + 59, -266, -1012, -380, -2131, 630, 405, 665, + -4550, 1403, 8, -46, -879, 398, -532, -185, + -286, 921, -65, 378, 669, 174, -15280, 91, + -776, 8480, 2463, 184, 2065, -666, -561, 4122, + 594, 732, 4007, -852, -71, 194, -126, 1765, + -1570, 968, -257, -288, 950, 27482, -333, 370, + -1429, 285, 558, 11245, -135, 565, 1296, -261, + -62, 600, 1455, 1457, 820, 357, -1203, 169, + 16611, -893, 359, 231, 418, -547, -95, 3866, + -511, -6344, -205, 923, -239, -16205, -1619, 217, + -3362, -6342, -1551, 649, -492, 264, -55, 170, + 16992, -91, 306, 43, -2770, 582, -1740, 77, + -882, 268, -515, -45, -6093, 24, -5596, 9034, + 284, 3211, 846, 1158, -1118, -604, -514, 1402, + -493, -938, -3892, 242, 643, 1421, -434, -406, + -102, -88, -11733, 161, 518, 978, 1508, 248, + -1036, 1407, -396, 293, 1154, -1435, 495, 8243, + 20, -845, -5373, 659, 2366, 29148, 145, 603, + 4088, -251, -2841, -2526, 20682, -1357, -2454, 660, + -125, 347, 11772, -113, -357, -2181, -1234, 1908, + -432, 16555, -248, 822, 15516, -158, -653, 1573, + 93, -2730, -1111, 958, -1550, -1153, 17, 610, + 781, -372, -1640, 144, -135, -1171, 22140, -427, + -26, 690, -800, -1497, -300, 5438, 390, 11304, + 9253, 1098, 5564, -9, 3856, 965, 2016, -12797, + 1687, 915, 3687, 539, 2496, 702, -1324, -71, +-12955, 7456, 4626, -848, -1815, 831, 2151, 7921, + -3000, 123, 1189, -1489, 222, 4973, 1936, 54, +-10527, -1238, -1157, 628, 14112, -2164, 1478, -985, + -4102, 635, 225, -311, -609, -1015, 301, 507, + -85, 443, 186, -552, -711, -16988, -1327, 220, + 565, -1673, -543, 18633, 331, 127, -342, 22, + -77, -360, -439, -501, -1848, -1147, -483, 1133, + -351, 41, 908, 502, -658, 474, -430, -11348, + -1, -531, 451, 709, 227, -978, 348, -265, + 269, -376, 2511, -188, -111, -387, 809, 1009, + 1570, -755, -11463, 667, -895, 446, 276, 145, + -513, -117, -462, -340, 1457, -963, 191, -788, + -150, -979, -507, -27540, 122, 368, -73, 10051, + -465, 642, 507, -6828, 241, -5025, 1598, -1174, + 2373, -2272, -1910, -108, 15, 166, 2, 10518, + 933, -12716, 510, 778, -424, 414, 4899, 759, + 862, -438, -886, 457, 304, 23639, 136, -203, + 478, -565, 244, -541, 2419, -773, 1107, -217, + 1579, -1037, 476, -97, 995, 17973, 161, 16466, + -178, -718, -1606, 947, 1991, 2266, 1249, 2708, + -611, 1424, -142, -53, 36, 509, 26159, -144, + 357, -37, -234, 587, 311, -509, -1639, -332, + -1618, -382, 302, -8657, -68, -30, 545, -12834, + 158, 158, 135, 621, -354, -871, 451, 1220, + -31, 2, -13414, 60, 3, -380, 541, -44, + 552, -366, 155, -462, 61, -232, -15426, 317, + 688, 1121, 2933, 7151, -168, -9167, -2521, 745, + 2792, -10448, 569, -3823, 630, -4626, -95, -416, + 828, 259, 72, 171, 635, -250, -128, -426, + -153, 260, -771, 314, 235, 26, 32281, -343, + 751, -1443, 324, -684, 1900, -1334, 2022, 30, + 1073, -2406, 2080, -485, -320, 15328, -860, -529, +-16444, -219, 1736, -149, -160, -828, 1089, 413, + 241, 3720, -90, 146, 1109, 243, -321, -256, + -68, 88, -50, 571, 1179, -25030, 104, 929, + 35, 529, 117, -13724, 734, -1344, 456, 5586, + 1566, -12573, -840, -1617, -2494, 1791, 1901, 3066, + -2159, -414, -3856, -9894, -1608, -657, 15355, -773, + -9217, -658, -972, 4730, -2986, -3478, -757, -1416, + -3702, 18089, 629, 7061, 124, 5843, 158, 19017, + -2204, -6976, 1629, -5657, 1101, -1859, -1425, -548, + -1132, -5043, 1074, -592, -196, 1902, 22705, -1228, + 214, -685, -2036, -2368, -315, -914, 533, 218, + 1091, -627, 2031, 13922, 104, -450, 4494, -498, + -361, 24734, 623, 1029, 2437, -1123, -5092, -6551, + 438, 16562, 375, -13102, -193, -2004, 3556, 179, + 1832, 2086, 798, -534, -195, -7105, 796, 3969, +-12269, 1570, 4273, -2692, 1240, -2901, -2045, -2453, + 372, 613, -548, -245, 687, 258, -8964, -1500, + -1519, -993, 17571, -357, 916, -1202, 1752, 2081, + -536, -3185, -1062, 19335, 721, -9958, 1052, -872, + 248, -3133, 456, 1641, 149, -11, 2955, 310, + -3178, -18823, 497, -971, -6587, -1380, 351, 106, + -43, 607, -4754, 213, 1030, 5377, -804, -2557, + 850, 1081, -706, 1325, -14922, -794, -14060, -1953, + 891, -3296, 329, -510, -1126, 1113, 1753, -411, + 1769, 429, -185, -1020, 194, -106, 11470, -591, + -272, 422, 337, 524, -150, 822, 51, -120, + 7193, 802, 640, -140, -42, 28125, -1020, 285, + -465, 3195, 69, 482, -953, 262, -7672, -373, + 5158, 5625, -3003, 550, 5371, 5619, -2200, 5392, + -804, 135, 1300, -3610, -23, -433, 13503, 224, + 911, -14421, -502, -2151, -1667, -1933, 2888, -277, + 547, -989, 3115, -32, -680, -164, 804, 412, + 62, -154, -190, 156, -10938, -360, -88, 843, + 328, -773, -267, -12668, 856, 1496, -243, -586, + 736, -2175, -677, -3069, 7480, -1764, -4024, -2569, + 1805, 194, -6814, -1135, -237, 2682, -156, -890, + 1285, 368, 1802, -683, -163, 1191, -13063, -496, + -335, 17482, 746, 818, 48, 21419, -598, -1753, + -1169, -2135, 40, -9114, 592, -3912, 1980, -264, + -304, 8138, -185, 286, -3024, 48, -1630, 909, + 661, -662, 18085, 240, -201, 69, 192, 305, +-22167, 692, -1135, -996, 398, -74, 18553, -958, + 1223, -5578, 508, -352, 1234, -450, 497, 780, + 79, 51, -221, 255, -26, 13352, -170, 231, + 590, 169, -733, -812, -65, -219, -20939, 200, + 35, -177, -454, 632, -267, -407, -120, 623, + -176, -664, 715, -23, 318, 148, 1125, 16, + 709, -21687, -230, -413, 1398, -1235, -283, 1615, + 175, -299, 349, 400, -112, 21762, -665, 364, + 1089, 1303, -54, 523, -381, -1312, 48, -886, + -1260, 408, 415, -8349, 7115, 180, -774, 3508, + -971, -255, -195, 81, -2674, -977, -355, -1500, + 178, -2081, -4432, -1014, 340, 5818, 138, -106, + 16917, 1203, 349, 3271, 961, 363, 6008, -6043, + 3736, -730, -4201, -514, -6131, -68, -14935, -1781, + -3898, -40, -18944, -461, -1694, -1269, -755, -81, + 2369, 484, 531, 14114, 85, 32, -10142, -142, + 600, -2374, 375, 675, -2663, 155, -947, 6427, + 11476, 1253, 5049, 1063, 2003, -1608, 2463, -2168, + -1128, 1079, 383, -996, 368, 1208, -3554, -959, + 4596, -1209, -4154, 1270, 9365, -2775, -1751, 998, +-20023, -347, 1505, 218, -142, 342, -128, -523, + -159, 75, -467, 257, -133, -142, 712, -621, + 428, -29584, 13, 402, -455, 119, -483, 1121, + -461, 960, 807, -46, 297, 14856, 221, -356, + 221, 15037, -4744, -2555, 447, -1418, 1464, 1391, + -1404, -5812, 512, -2321, 9882, 242, -2298, -137, + -849, -3182, 9394, 1412, 1052, 1369, -904, -494, + -231, 1113, 1087, -13317, 768, -1178, -3011, 24, + 229, 164, -10170, 328, 308, -591, 213, -543, + -82, -790, -875, 794, -558, -7651, -573, 1266, + -2084, 2275, -187, 97, 384, -11830, -185, -472, + 1365, 11636, -1405, 360, -487, -440, -1820, -349, + -293, 285, 25, -139, -415, -540, -108, 1136, + -673, 230, 19202, -545, -542, 919, 1221, -518, + 196, -21900, 795, 115, -16, 459, 3339, -347, + -346, -186, -695, -267, -714, 185, 266, -1218, + 120, -249, 233, -110, -30412, 285, 219, 2256, + 536, -442, 673, -1487, -477, -60, -1806, 183, + -7195, -577, 2230, -7594, -3230, 65, 22963, 111, + 390, 7134, -3716, -5123, -475, -32, -98, -466, + -118, -43, 74, -1071, -902, 1714, 4004, 26, + 97, 1680, 423, 252, 9667, 550, 354, -222, + 19, -224, -807, 365, 593, 363, -851, -28, + 553, 238, -481, 769, 279, 18367, -462, 286, + 4825, -141, 500, 20383, 1618, -31, -514, -2484, + -327, -8506, -705, -872, 530, -9997, -36, -431, + 2824, 3185, 1712, -318, 9513, -10065, 614, -503, + 389, 12830, -113, -15, -1007, -523, -1293, -2102, + -543, -1157, -583, 1228, 262, -674, -1847, -242, + 299, -12025, 547, -591, -9173, 275, 412, 2493, + 997, 1229, 1982, 27554, 245, 106, -1320, -153, + -423, -955, -449, 392, 824, 796, -1181, 1640, + -884, -70, 8789, 10021, -1806, 1019, 90, 1494, + 2071, -911, -1159, 212, 2207, -994, -2500, -497, + 92, -11544, -398, -774, 1474, 32, -671, -171, + -1250, -249, 1161, -654, -205, -36, 1733, 763 +}, + +.shape22_1 = { + 987, -6, -621, -220, -2438, -387, -535, -23, + -934, -68, -4985, 575, 483, 7243, -1075, 917, + 1739, -1832, -580, 1564, 131, -180, -1271, 3672, + 161, 1040, 1737, 2719, 1101, -185, -1410, 221, + -422, -8675, -753, -401, -5388, 13, 762, 1378, + 1113, 1768, -177, 3397, 2162, 267, 2261, -156, + 1708, -848, -79, -1819, -3159, -5548, -745, 7208, + -1039, 7555, -134, 2661, -2112, 2270, -1991, 441, + -6248, 246, 166, 2092, -1402, -242, -13600, -539, + 391, 2395, 11001, -981, 10906, -403, 823, 1647, + -294, 93, 504, -5448, 1213, -1849, -3077, 790, + -841, 12812, -11266, -1882, -805, -274, 1968, -49, + 1189, -80, -281, -40, 409, 2423, 581, -1362, + 207, -869, -589, 3294, -318, -4592, -476, 1014, + -135, -17999, -194, 807, -2946, -222, 44, -514, + -4407, -1201, 1155, -235, 98, 4432, -342, 2386, + 1402, -956, 3357, 1959, 4790, -139, -3494, -4280, + -589, -8422, 363, -746, 640, -360, -1007, -1100, + -7989, -12630, 1006, -1608, -864, -226, -915, -2032, + 1274, 596, 1864, 1067, 1597, 460, -2003, -5560, + -8020, 2354, 379, -3151, 44, 7024, -698, -2901, + 4976, 927, 1223, -93, 172, 189, 6639, -6082, + -726, -524, -3068, -3802, 16, -1039, -105, 2333, + -350, -306, -379, -832, 1282, 56, 3529, 562, + -603, 5954, 294, -1265, 8045, -3990, -169, -123, + -3267, 572, -879, 1562, -1185, 799, -9589, 407, + -590, 65, -2848, 433, -5547, -19, 7180, -7904, + -392, 323, -448, -4481, -3773, -5286, 1957, 226, + -2040, 3292, 2987, -1704, 2835, -149, 1435, 823, + 1775, -2769, 146, 234, -131, -15, 268, 37, + 139, 22, -196, 91, -3503, -5421, 24, -280, + 58, 370, 655, 1412, 113, 306, 16404, -234, + 315, -957, 72, -1129, 1993, -18719, -1415, 1349, + 2340, 541, 313, -1360, 31, 1441, -78, -9905, + -393, 367, -712, -2009, 372, -297, -123, 303, + -458, -323, 46, 8701, -1301, -8768, -43, 1818, + 212, -543, -5077, -8037, -2536, 702, 792, -381, + -272, 1941, 6320, -1871, -13938, -262, -2063, 108, + -861, 485, -440, 768, 5665, -302, 305, -13784, + 2889, -127, -94, 145, 1308, 7911, -8376, -643, + -596, 1357, -943, 1329, -84, -62, 1651, 391, + -2295, -5456, -357, -4611, 1361, 3961, -295, 642, + -698, 8614, 1613, -526, -120, -205, 17, -20171, + 1252, -261, 535, -1244, 92, -315, 878, 380, + 157, 3217, -493, -773, 513, -510, 11304, -899, + -27, 398, -6386, 659, -1001, -2737, -13295, 1219, + -1014, -193, 445, -2393, 344, -25, -599, -2848, + 884, 94, -11, -564, -36, 9939, -3530, 462, + -942, 10089, 824, 2994, -293, 71, 10167, -457, + 711, -964, -2128, 2530, 160, -2558, 2451, 1654, + -3828, 1560, 879, -1023, -8354, 851, -77, -112, + 19572, 2010, -1077, -1329, -1282, 1277, 252, -5622, + 4617, 58, -2315, -459, -1249, 92, 708, -737, + -3323, 182, 1557, -657, 546, -447, 19117, 1645, + -336, -26, -2041, 5926, 4746, -1866, 3922, 2798, + 5320, 7, 470, 842, 229, -567, 742, -3306, + 659, -871, -226, -2593, -1003, -1373, 595, -768, + 20658, 944, 1228, 279, -1531, -618, 361, -4019, + -343, -351, 7143, 293, 92, -2713, -269, -30, + -332, 4093, 216, 239, -563, 1943, -944, -2268, + 70, -209, 440, 1493, -446, 491, -362, 25, + -331, 433, -1585, 173, 1126, -3614, -234, -2649, + 1181, -641, -160, 3727, -841, -2134, -1396, -5758, + -14, 364, -4651, 1151, 194, -5234, 5878, -1348, + -1388, -233, 3810, -860, 9479, -24, -6616, 1387, + -455, 447, -224, -2997, 12, 3502, -73, 470, + -9170, 1677, -740, -592, -1638, 675, -93, -17842, + 1750, -847, 993, -2393, -49, -2029, 1940, 588, + 475, -3467, 55, 5087, 2989, 380, 915, -2782, + 2418, 11303, 1098, 1009, 1372, -5780, -303, 1451, + 972, -7433, -571, 1661, 64, 10265, 1541, -50, + -964, -738, -253, -3105, -695, -546, -775, -18971, + -3094, -2379, 738, 1625, 623, 1073, 782, 723, + -3417, -578, -189, 4108, 1115, -1222, -9102, -4736, + 347, 946, 322, -3699, 193, -15139, 367, 969, + -788, -694, -620, -26, -16, 4, -478, 20792, + -1175, -231, 2566, -1270, 162, 181, -1451, -5370, + -2429, -8910, -3794, -5807, -1655, 248, 4432, 1393, + -2451, -2706, -744, 687, 842, -1281, 2960, -2348, + 153, -1671, -1433, -1250, -1096, 2501, -5393, 4266, + -1098, 880, -1215, 817, -443, 10053, 705, -689, + -2679, -1205, -3302, -809, -918, -1005, 124, -329, + 108, -52, -5305, -419, 128, -8137, 1427, 387, + -235, -2582, 190, -173, -1031, 2672, -985, 3309, + -5927, 7327, -8463, -2, 6035, 743, 552, -14, + -580, -68, -11886, 476, 61, 1172, -529, -988, + 871, -776, -332, 20870, 384, 7795, -10830, 723, + 1690, -519, 962, 663, 1300, -465, 47, -3578, + 56, -8131, 2041, -8524, -1303, 6349, 1903, -6726, + 1156, -224, 1286, -2355, -3415, 985, -502, -2474, + 49, -2789, -3616, -1707, 3363, -140, 1702, -1919, +-11518, -404, 62, -6933, -1187, 10830, 132, 284, + -639, 1349, 2367, -311, -626, 745, 5660, -152, + -121, -5236, -481, 5889, -1263, -8443, -33, 936, + 423, -117, 111, -1055, -103, -321, 1286, -611, + 777, 827, 422, -162, -6767, -241, 289, -441, + -1344, 2706, -1260, -4649, -847, -16107, -263, -1826, + -521, -760, 942, 309, -2692, -4835, -853, -806, + -276, -322, 5647, 1219, -433, -346, -1171, -1028, + 191, -406, 444, 33, 272, 3502, 475, -2178, + 1915, -290, -1037, 833, -695, -121, 415, 556, + 1025, -2268, 334, 2847, -1768, -389, -14034, -3878, + 836, 4605, -1985, -359, 1478, -149, 823, -926, + -828, 135, 469, -645, -328, -94, -178, 2820, + 781, -2361, -5778, 1312, 3918, -1, -3654, -942, + -2495, 615, 210, -17006, -396, -445, 382, 563, + -1738, 95, -9107, 4869, 348, 527, 5688, -145, + -1195, -2367, -749, -187, 6697, 27, 347, 12571, + -64, -427, 3765, 824, -1216, -1126, 5997, 586, + 110, -294, -240, 1646, -186, 1360, 413, -6459, + -1535, -3208, -520, -621, 8613, 1098, -19, -199, +-11446, -657, -353, 906, 678, -19375, -126, 1688, + 644, 1231, -2151, -742, 320, -68, -12426, -2750, + 1483, -1603, -2639, 3028, 2662, -140, 5405, -917, + -407, 207, 9392, -569, 931, -124, -82, 6370, + 477, -12264, 1093, 3427, -732, -50, 232, -67, + 609, 1615, -463, 583, 1808, 1499, -509, -24431, + 231, -72, -192, -333, -7554, -342, -9036, -304, + 136, -15450, 1333, -1147, -1488, -1440, 75, 63, + 747, 297, -251, 30, -301, -1810, -86, 544, +-10446, 1300, 10468, 218, -2471, 1982, 423, 3046, + -1112, -657, -104, 10671, -46, -10953, -6205, -1275, + 1972, 937, -75, -330, -529, -2581, 1510, -1881, + -1372, -1725, 14541, -560, -884, 946, -307, -5031, + 7798, -190, 720, 1525, 29, 868, 1238, 372, + -462, 2467, -2661, 2721, -1514, 723, -2782, -494, + 240, -7147, 587, 751, 1613, 11054, 1074, 275, + 972, -970, 27, -75, 24, -9, 163, 88, + 21, 87, -78, -743, -128, -2336, -235, -743, + -3918, -333, 1088, -195, -166, 782, -119, -3263, + 604, 2155, -258, -1282, -129, 43, -5124, -472, + 685, -14243, -1294, -99, -1922, -284, -422, -1112, + -3194, -1977, 1448, -419, -7172, 20, -70, 2102, + 0, 278, 1882, -10005, 1612, 6020, 71, -141, + 1027, -43, -864, -448, -21257, -336, -2090, 5207, + 674, 722, 1030, 1367, 1963, 6057, 984, -1087, + -3690, 47, -61, 104, -81, 895, 22, 728, + -191, 3219, 5228, -27, -802, 1438, -9026, -1352, + -581, 912, -664, -23, -522, -912, 178, -603, + 571, 574, 406, 564, 175, -405, -2965, -1072, + 1749, -957, -402, 9431, 1649, -409, 291, 5765, + 808, 6754, 727, -37, -254, 1530, 213, 3253, + 357, 371, 45, -1276, -12432, 2799, -1924, -176, + -1107, -183, 198, 3662, 20, -1166, 2507, -3484 +}, + +.shape22_2 = { + 1688, -307, -590, 971, -3616, -1632, -218, 1861, + -1479, -367, -6584, 487, -951, 10808, -232, 444, + 89, -1216, -1577, 1283, 249, -3, -3646, 2205, + -1116, 2630, 2110, 3193, 270, -189, 78, -826, + 1010, -10520, -370, 1234, -5604, -262, 1277, 1440, + 2225, 2466, 305, 2469, -740, 120, 3184, 2125, + 1185, -3230, 1597, -1670, -8283, -9857, -129, 8932, + -1355, 8755, 707, -256, -135, 423, 1543, 1782, + -4875, 403, 373, 1570, -183, 782, -9617, -2539, + 1090, 523, 6929, -1226, 10329, -278, -999, -260, + -1810, 666, -463, -6100, 2040, 256, 532, -1475, + 383, 13137, -10953, -2226, -1243, 1584, -2348, -809, + 3602, -816, 194, 480, 84, 2297, 344, -5181, + -6243, -2616, 2093, 7112, -2373, -1346, 291, -372, + -863, -16911, -1878, 378, -826, 579, 737, -468, + -2288, 264, 634, 108, -254, 4717, -1286, 2885, + 986, -4944, -98, 2007, 991, -2252, -2887, -6141, + -605, -10474, 896, 6, 235, -407, -70, 478, + -8392, -10870, 575, -672, 103, 320, -179, -229, + 445, -380, 1124, 3271, -1327, -275, -239, -10381, + -9102, 1361, 96, -1255, -277, 9316, -415, -2258, + 8992, -117, 1625, -704, -980, 752, 9133, -8792, + -423, -272, -865, -2285, 443, -2014, -2592, 3180, + 1198, 2570, 3360, -7090, 3311, 697, 2229, 46, + -472, 6984, -140, -780, 10391, -1078, 48, -564, + -5073, 1576, -826, -483, 952, 1099, -11536, -652, + 375, 440, -7319, 2646, -2089, 2804, 3795, -6704, + 251, 811, -1224, -1976, -4943, -6671, 780, -2856, + -7907, 2447, 3755, -135, 1127, 328, 553, 3450, + 351, -5054, -5, 1077, 109, -254, -391, -511, + 404, -61, 510, 395, -6044, -7454, 364, -575, + 65, -410, -1921, -248, 128, 311, 17131, -2135, + -563, -884, 2356, -3951, -1176, -16695, -1534, 1977, + 626, 2478, 1554, -1070, 38, -551, 370, -11053, + -331, 1062, -1385, -1681, 1028, 3350, 239, -76, + -156, 49, 397, 7060, -2834, -6527, 22, 1920, + -951, 356, -7674, -8903, -120, 317, -303, 160, + 530, 4611, 1083, 514, -12207, -283, 1413, -848, + -645, -432, 0, -192, 4780, -3485, -1192, -10574, + 1274, -3057, 475, -188, 183, 7865, -11214, -268, + 491, 1422, -28, 149, 515, -1651, 670, -450, + -958, -4288, 567, -182, 668, 4069, -213, -1176, + 148, 8854, -151, 474, 599, 1297, 237, -19186, + 2993, -482, -591, -1322, 25, -628, -828, -203, + -1500, 5519, -84, 723, -1137, 1217, 13045, -707, + -372, -200, -4142, -790, 188, -6760, -8288, 766, + 366, 444, -517, -2679, -1470, -61, 161, -3734, + 3053, 2012, 439, 627, 524, 5538, 549, -473, + -2244, 8399, -6395, 5811, 851, 58, 11376, -6, + -337, -689, -1510, -690, -388, -3587, 2665, 3371, + -1850, -953, -513, 581, -10296, 548, 1092, 565, + 18045, 215, -1486, -1270, 450, -880, 407, -6547, + 8393, 206, -515, -1565, -219, -1872, 1479, 382, + -569, -5002, -1247, -45, -740, -1791, 17177, -1210, + 761, 132, -1627, 4970, 5563, 722, 5614, 430, + 5659, 139, 1193, 1513, 1144, -1319, 561, -5145, + 1010, 199, 656, -3958, 3544, -1758, 810, -1578, + 15976, -139, -1035, -416, -543, -418, 2824, -6541, + 94, -673, 11741, 426, -15, -5280, 780, 1795, + -4616, 8192, -297, -206, 883, 2369, -395, -4266, + -3120, -199, 985, 1240, 352, 232, -170, 176, + 413, -495, -1399, 754, 618, -6103, -179, -2546, + 965, -1362, -806, 838, -3912, -1346, -3135, -937, + 219, 307, -3509, 1210, 2381, -7923, 6358, -885, + 2902, 284, 2560, 1789, 6878, 6, -4418, -2206, + -1091, 1840, -118, -2659, 1008, 2192, 1651, 1363, + -7772, 1252, -1200, 133, -757, 501, -98, -17197, + 98, -543, 1743, 621, -809, -1950, -793, 1168, + -743, -7124, 166, 7875, -4466, 356, -1430, -467, + 8589, 9931, 520, -866, 1945, -599, -434, 113, + 589, -3456, 597, 6076, 1114, 9660, 1532, 2073, + -138, -721, -1030, -1309, 625, -4040, 1211, -18836, + -3963, -4468, 197, 600, -1004, -816, -560, -476, + -2160, -2, 26, 8162, 1057, -178, -11739, -1882, + 1000, -227, 109, -1852, -1163, -17143, 140, -718, + -1150, 33, 1397, -45, -205, 153, -1494, 20509, + -51, -904, -599, 1915, 884, 504, -1819, -4487, + 1252, -1259, -2200, -5601, -448, -686, 5778, 873, + -4282, -533, 295, -450, 1422, 2393, 3267, -3911, + 249, -3605, -3190, -1096, -2422, 274, -1918, 4070, + -206, -432, 1919, -645, -275, 12954, 311, 1479, + -2664, -852, -4809, 1102, -375, 20, 1659, -1179, + 1199, 44, -5590, -1112, -566, -11369, -125, -871, + 158, 1208, 265, -519, -405, 2439, -1129, 1827, + -9461, 8548, -1606, 380, 4924, 662, 1314, -391, + -2024, 827, -13381, -198, -142, 1600, 3329, 125, + -672, -220, 557, 18642, 60, 7296, -10472, -712, + 1188, 808, 64, 479, 555, 264, 394, -611, + -810, -7943, -235, -6889, -1575, 1320, -381, -7414, + 1740, -744, 369, -626, -6899, -2144, -593, 668, + -351, -3756, -5143, -1814, 806, -475, 588, -507, + -9088, -629, 154, -6945, -1105, 10658, -435, 384, + -757, 1183, 3806, -747, -378, 535, 10224, 626, + -866, -1931, -1484, 5818, -750, -9628, -250, 589, + -653, -198, 104, -934, 1207, 46, 960, -1032, + 4236, 4471, -2896, 1551, -7714, -1921, 746, -671, + 5114, 5482, -522, -3344, -1905, -9220, -663, -1355, + -611, 65, 1368, 628, -1276, -6780, -2623, -661, + -117, -437, 5507, 3205, 928, 537, -9487, 80, + -102, -538, -277, 863, -1421, 6054, 1227, 696, + 3582, -508, -1757, 145, -1705, -1201, 4157, -3314, + 2291, -834, 821, 552, -724, 513, -9730, -8944, + 1913, 501, -216, 716, 2766, -823, 2535, 314, + 1774, -3372, 235, 244, -1216, -710, 689, 6736, + -52, 218, -8382, -444, 920, 569, -4890, -2050, + -612, 1708, -481, -15500, -2878, -691, 538, -125, + -81, -862, -10094, 12050, -1392, -326, 133, 61, + -50, 715, -6662, -673, 10745, -596, 44, 3906, + 247, -745, 4950, -210, 497, -1875, 8197, 2141, + 1454, -23, -1480, 2184, -804, 5515, -1311, -8893, + -2880, -3606, -282, -116, 8084, 618, -403, 1106, +-14405, 1159, 229, 742, -184, -19445, -329, -747, + -1240, 1487, -1670, -839, -77, -882, -10986, -2851, + -24, -747, -3615, 1939, 1389, 132, 5367, 1355, + 408, -1272, 11388, 153, 2708, -1503, 169, 7357, + 51, -13586, -404, -304, 626, 163, -1814, -515, + 445, 589, -1194, 770, 555, 246, -165, -21192, + 184, -265, -1116, -485, -8107, -1992, -10805, -880, + -1455, -15154, 2312, -1712, -11, -1899, -400, -2, + 314, -318, -280, -658, -1066, -2584, 1027, 801, +-11960, 1519, 8873, 465, -3229, 1801, -348, 749, + 7, 1079, -2051, 11521, -831, -13425, -6315, -1135, + 1088, 1056, -46, -1006, 374, -5065, 1163, -402, + -50, -1459, 9586, 514, -1439, -638, -155, -5289, + 8043, -612, 739, 1084, -60, 891, 786, -6, + -1078, 2097, -5333, 3497, 23, -913, 1303, 957, + -35, -6418, -146, -971, 2738, 9695, -1722, -2002, + 905, -1749, -917, 122, 379, -325, -455, 230, + 825, -137, -335, -96, -160, 390, 731, -2621, + -5889, -3949, 5138, 839, -1190, -66, 961, -4600, + 2345, 1607, -2448, -6653, -592, -106, -7619, -794, + -1186, -12587, -11, -2224, -225, -2903, 534, 1355, + -7002, 314, 494, 1950, -8545, -2531, -2438, -77, + 886, -1851, 944, -10156, 3003, 1846, 1919, 2019, + 471, 451, -436, -1012, -20121, 275, 98, 1776, + 578, 96, -16, 1156, 3689, 7, -207, 920, + 105, -58, -175, 163, 697, -407, -61, 1261, + 1297, 5061, 5326, -1126, 516, 1208, -11108, 441, + 7, -899, -19, -368, 438, -1911, 602, 716, + 313, 853, 1448, -817, -1453, 1384, -4371, 1043, + 1884, 1619, 2196, 10075, -1548, -1201, -796, 5228, + 2657, 8244, -605, 422, -693, 3171, 657, 5438, + -171, 633, 1579, -1718, -12265, 1083, -976, -293, + -3802, -306, -668, 7818, -1340, -402, 2231, -4472 +}, + +.shape44 = { + -40, -282, 1366, -1173, -3484, 355, -1078, 3800, + 4386, -35, -4192, 523, 1291, 678, 156, 2272, + -1043, 1075, -1849, -314, -522, 392, 2098, -79, + 473, -275, 2, 6398, 451, 94, 173, -431, + 1115, -10788, 35, 1823, -3380, -97, -98, -350, + -23, -1264, -308, 8948, -695, -79, 3520, 308, + 340, -362, -547, 1207, -1182, -10392, -148, 3580, + 481, -425, 862, 4894, 736, -152, -626, 23, + -5853, 39, -143, 418, -103, -1457, -12826, -122, + 283, -225, 10561, -153, 8872, -806, -51, 93, + 420, -209, 345, -7661, -732, -48, 479, -225, + 276, 13385, -12578, -1440, -265, -274, 1105, -3376, + -691, -579, -972, 300, 349, 362, 722, -472, + 185, 814, 14, 4746, 761, -336, 1691, 888, + -1669, -18717, 827, -2605, 921, 155, 68, 112, + -3032, -287, 414, -86, -62, -213, -106, 807, + -619, 598, -178, 3104, -481, -1553, 1250, -8363, + -686, -9608, 116, -47, 321, -89, 939, -35, + -7995, -10159, -526, 145, 363, 2170, 1077, -1223, + -738, 120, -408, -390, -80, -404, -1607, -10187, + -6432, 961, 94, -1459, 489, 6641, 372, 1007, + 5958, -834, 222, 51, 282, -1005, 4473, -8841, + -73, -477, -557, 121, -165, -1195, 438, 139, + -190, -4205, -4278, -4617, -7592, 40, -422, -459, + 594, 7331, 164, 297, 2631, -9075, -78, 372, + -6213, -1053, 182, -71, -386, -604, -11720, 552, + -617, 413, 1292, 4, -485, 1162, 6051, -5168, + -181, 1024, -630, -275, -4067, -8627, 1386, 970, + -423, 2973, 2360, 363, -274, 410, 48, 768, + 2958, -427, 86, 64, -128, -273, -182, -292, + 868, 463, 73, -116, -6509, -5295, -37, 691, + 344, -120, 168, 419, 494, -1175, 18896, -135, + -376, -218, -453, -916, -1040, -22179, -846, -1005, + 264, 159, 597, -952, -825, 393, -328, -14694, + 371, -263, 740, 38, -1001, 1289, -668, 187, + -155, 143, 683, 7133, -563, -8383, -291, 176, + 75, 613, -6965, -11480, 324, -490, 586, 416, + 762, 5777, 64, -47, -4124, -1196, -113, 701, + -211, 2335, 130, 684, 7278, -158, -213, 297, + 10845, -1439, -465, 17, -792, 6499, -10187, -444, + -1416, 482, 636, 1472, 752, 157, -334, -3230, + -19, -6747, 660, -3082, 4057, 6801, -19, 635, + 19, 9807, 526, 126, 444, -190, -418, -26754, + -202, 243, 597, 10, 345, 814, -330, 160, + 344, 3986, 470, 459, 2387, -549, 11889, -1837, + -30, 2608, 615, 2301, -771, -1589, -6935, 1321, + 4287, 295, -558, -1503, -611, 2104, 411, -218, + 1145, -426, 58, -102, 13, 7499, 476, -4032, + -2237, -2658, -1943, 5268, 1039, 389, 7091, -22, + 156, -186, 2432, -878, 305, -1726, 3209, 361, + -1030, 505, 618, -262, -1877, 268, 757, 24, + 24306, 102, 973, 142, -953, -1199, 116, -255, + 5370, -347, -365, 937, -6939, -1189, -760, 531, + -1759, -705, -557, -620, 1151, 250, 21629, -1532, + -128, 1421, -211, 592, 5126, 197, -716, 1113, + 5844, -266, -12, -813, 85, 994, -2106, -3915, + 1402, 533, 521, -883, 87, -386, -2, -4350, + 19790, -180, -363, 60, 101, -1717, 119, -381, + 100, -565, 3264, 3052, 200, -7319, 26, 347, + -482, 10609, -766, 526, -623, 3495, 339, -4406, + -59, -213, 686, -603, 133, 99, 48, 1716, + -1214, 1397, -2396, -384, -901, -3750, -660, -4314, + 313, 192, 292, 259, -644, 176, 2099, 7961, + -29, 642, -2970, 1792, -61, -4348, 578, 1867, + -1868, 32, 5262, 137, 6109, 443, -176, 351, + 400, 1874, -175, -4065, 697, 292, -744, 121, + -5134, 6996, -198, 628, 1073, -599, -116, -17900, + 647, -1049, -663, 1427, -94, 721, 311, 337, + 1376, -2784, 3947, 1342, 1577, -406, -260, -10228, + 109, 2358, 2437, 346, 1261, -308, -2094, 1682, + 144, -675, 183, 428, -950, 1249, -1546, 33, + -254, 681, -1264, -964, -310, 838, 100, -21952, + -1484, -1564, 339, 298, 67, -338, 89, 709, + 53, 258, -359, 2803, 1553, -312, -7993, -1627, + 1189, 476, -123, 336, -767, -18522, 589, 942, + -645, -381, -1913, -582, 55, -876, -509, 25143, + 690, -787, -1136, 114, 162, 342, -231, -8742, + 99, -646, -474, -1384, -110, -98, 8634, -14, + -9676, -312, 358, 496, -676, -97, 1904, -2124, + -66, -1868, 502, -513, -3244, 2079, -1476, 5440, + -40, -381, 500, -238, -471, 12160, 248, -1005, + -2886, 173, -3369, -355, -256, -117, -474, -1282, + -355, 130, -4833, 31, -232, -12931, -826, 322, + 839, 1537, 73, 226, -1888, -483, -2848, -190, + 1271, 3597, -4514, -38, 6093, 347, -68, -415, + -105, -1664, -11461, -110, -399, 389, -511, 935, + -424, -1708, -1026, 23239, 298, 7363, -9206, -566, + 259, -412, -1213, 335, 614, 928, 972, -1919, + -407, 509, 303, -13762, -524, 10360, 1318, -2758, + 2350, -106, -119, -68, -6155, -255, -448, -34, + -64, -4382, 47, 635, -339, 406, -447, -445, +-10592, 233, 160, -5515, -1333, 6755, -952, 172, + -1260, -294, 3480, -352, -231, 415, 482, -498, + -191, -2034, 7934, 7997, -688, -9503, 376, -228, + -500, 222, -1021, -407, 261, 179, 622, 1217, + -443, -763, -508, -719, -4509, 91, 449, -283, + 91, -39, 961, -10148, 1596, -9161, -327, 221, + -470, 676, 12, 1416, 984, -10988, -5500, -189, + -727, 226, 4691, 688, 759, 930, -6444, -114, + -539, -526, -21, -1218, 650, 6088, 419, 6185, + -1200, 84, -1232, -34, -107, 60, 2248, 450, + 1187, 1264, -181, 857, 2235, -2859, -13483, -192, + -586, -207, -5569, 503, 3376, 1243, -700, 2119, + -2186, -296, 896, 299, 177, 184, 1375, 2498, + 161, 579, -3683, 443, -21, -186, -3474, 238, + 274, 277, -325, -8325, -223, 125, 191, 333, + -345, -1391, -7372, 11389, -1055, 4066, -1098, 87, + -203, 443, 363, -959, 15395, 4016, -254, 1611, + -168, -1070, 2709, -768, 506, -1245, 5821, 2499, + 1564, 27, 85, 1989, -1092, 150, -972, 660, + -33, 687, 545, -1564, 720, -196, -52, -1751, +-25380, -1246, -615, 391, -512, -23289, 460, 360, + -85, -723, -250, -163, -48, -921, -3988, 425, + -1268, -1695, 3233, -1093, -1166, 198, 7602, 21, + 354, 733, 12213, -347, 532, -427, 22, 2218, + -578, -3382, -474, -625, 78, -4546, 863, -53, + -357, -1529, 1014, 710, 1356, -430, -1633, -24823, + 95, 26, 590, -591, -7833, -1355, -9771, -502, + -907, -15433, 957, 463, 35, -496, 294, 2129, + 1274, -160, -83, 531, -767, 285, 232, 5983, + -6122, 1620, 4112, -239, -1733, -46, -1321, 467, + 613, -3747, -2284, 13991, 373, -17357, -219, -80, + -210, 1462, 37, -1692, 548, -5845, 420, 54, + -350, -285, 1981, 262, -874, 2844, -435, -6305, + 6449, 72, 631, -94, 96, -442, 1137, 89, + 364, 3392, -3512, -387, 1055, 318, -1111, -6971, + 344, -9105, -96, -9362, 190, -225, 370, 161, + -73, -1830, 174, 48, -518, -3486, 137, -235, + 810, 23, 80, -642, -35, -316, -269, -373, + -2413, -933, 2525, 267, -508, -200, 422, -3470, + -1273, 640, -1956, 139, 394, -1043, -11008, -158, + -1089, -2023, 202, -979, -744, -159, -392, -37, + -1679, 2183, 1365, -2883, -4752, -2255, 109, 1660, + -613, -511, 1284, -7331, 947, 7009, -2072, -321, + -936, -551, -875, 160, -27027, 654, 265, 164, + 376, 726, -149, 2813, -94, 5728, 702, -1118, + -2555, 217, -186, -107, 146, -83, -62, -196, + 708, 146, 3729, -416, 212, -163, -7861, 347, + 83, -1079, -994, 271, -1054, -1647, 139, -20, + 354, 1298, -3420, 1130, 161, 475, -3913, 468, + 23, 285, -1699, 8234, -947, 222, 260, 4276, + -341, 6387, 21, 490, -1908, -1654, -60, 2471, + 733, -135, 109, -1136, -14756, 4922, 1165, 149, + -3976, -66, -594, 6181, -110, 292, 1129, -591 +}, + +.lsp22_2 = { + 0.0712, 0.1830, 0.4167, 0.6669, 0.8738, 1.0696, 1.2555, 1.4426, + 1.6427, 1.8138, 1.9966, 2.1925, 2.3872, 2.5748, 2.7713, 2.9597, + 0.1894, 0.3942, 0.5418, 0.6747, 0.7517, 0.8763, 1.1189, 1.3072, + 1.5011, 1.6790, 1.8342, 2.0781, 2.2929, 2.4566, 2.6613, 2.9204, + 0.1767, 0.3403, 0.5173, 0.7055, 0.8899, 1.0696, 1.2302, 1.4111, + 1.5989, 1.7751, 1.9618, 2.1544, 2.3454, 2.5356, 2.7362, 2.9315, + 0.1240, 0.2361, 0.4423, 0.6326, 0.7729, 0.9387, 1.1142, 1.2847, + 1.4746, 1.7126, 1.9482, 2.1642, 2.3536, 2.5506, 2.7593, 2.9197, + 0.1213, 0.2782, 0.5011, 0.6910, 0.8564, 1.0462, 1.2315, 1.4232, + 1.6178, 1.8028, 1.9813, 2.1766, 2.3670, 2.5591, 2.7475, 2.9403, + 0.1382, 0.2995, 0.4693, 0.5874, 0.6929, 0.8102, 1.0094, 1.2960, + 1.5511, 1.7607, 1.9699, 2.1680, 2.3367, 2.5459, 2.7370, 2.9105, + 0.1428, 0.2690, 0.3713, 0.4757, 0.6664, 0.9019, 1.1276, 1.3674, + 1.5471, 1.6695, 1.8261, 2.0572, 2.2753, 2.4963, 2.7187, 2.9114, + 0.1669, 0.3085, 0.4489, 0.5724, 0.6934, 0.8465, 0.9680, 1.1641, + 1.4320, 1.6841, 1.8977, 2.1061, 2.3118, 2.5152, 2.7329, 2.9274, + 0.1128, 0.2709, 0.4803, 0.6878, 0.8673, 1.0693, 1.2749, 1.4657, + 1.6650, 1.8434, 2.0339, 2.2300, 2.4003, 2.5951, 2.7762, 2.9465, + 0.1201, 0.2345, 0.4021, 0.6379, 0.8651, 1.0256, 1.1630, 1.3250, + 1.5395, 1.7808, 2.0011, 2.1997, 2.3618, 2.5505, 2.7561, 2.9351, + 0.2575, 0.4163, 0.5081, 0.6484, 0.8570, 1.0832, 1.2732, 1.3933, + 1.5497, 1.7725, 1.9945, 2.2098, 2.3514, 2.5216, 2.7146, 2.8969, + 0.1367, 0.2656, 0.4470, 0.6398, 0.8146, 1.0125, 1.2142, 1.3960, + 1.5558, 1.7338, 1.9465, 2.1769, 2.4031, 2.5746, 2.7335, 2.9046, + 0.0868, 0.1723, 0.2785, 0.5071, 0.7732, 1.0024, 1.1924, 1.4220, + 1.6149, 1.8064, 1.9951, 2.1935, 2.3777, 2.5748, 2.7661, 2.9488, + 0.1428, 0.2592, 0.3875, 0.5810, 0.7513, 0.9334, 1.1096, 1.3565, + 1.5869, 1.7788, 1.9036, 2.0893, 2.3332, 2.5289, 2.7204, 2.9053, + 0.2313, 0.4066, 0.4960, 0.5853, 0.7799, 0.9201, 1.1365, 1.3499, + 1.5119, 1.7641, 1.9095, 2.0911, 2.2653, 2.4587, 2.7010, 2.8900, + 0.1927, 0.3424, 0.4682, 0.6035, 0.7330, 0.8492, 1.0477, 1.3083, + 1.5602, 1.6945, 1.7806, 2.0066, 2.2566, 2.4864, 2.7021, 2.9180, + 0.0962, 0.1933, 0.3968, 0.6077, 0.8083, 1.0224, 1.2307, 1.4344, + 1.6350, 1.8173, 2.0024, 2.1894, 2.3812, 2.5648, 2.7535, 2.9483, + 0.1469, 0.2679, 0.4272, 0.6080, 0.7949, 0.9247, 1.0741, 1.2722, + 1.5144, 1.7679, 2.0030, 2.1944, 2.3890, 2.5928, 2.8116, 2.9555, + 0.1618, 0.3917, 0.6111, 0.7511, 0.8325, 1.0010, 1.2397, 1.4147, + 1.5764, 1.7359, 1.9300, 2.1325, 2.3096, 2.5480, 2.7725, 2.9697, + 0.1561, 0.2634, 0.4062, 0.6139, 0.8059, 0.9618, 1.0948, 1.3179, + 1.5846, 1.7622, 1.9399, 2.1476, 2.3330, 2.5232, 2.7412, 2.9554, + 0.1076, 0.2320, 0.3977, 0.5798, 0.7707, 0.9975, 1.1884, 1.3793, + 1.6059, 1.8038, 1.9928, 2.1942, 2.3881, 2.5742, 2.7717, 2.9547, + 0.1360, 0.2493, 0.3827, 0.5644, 0.7384, 0.9087, 1.0865, 1.2902, + 1.5185, 1.7246, 1.9170, 2.1175, 2.3324, 2.5442, 2.7441, 2.9437, + 0.1684, 0.2990, 0.4406, 0.5834, 0.7305, 0.9028, 1.0801, 1.2756, + 1.4646, 1.6514, 1.8346, 2.0493, 2.2594, 2.4765, 2.6985, 2.9089, + 0.1145, 0.2295, 0.3421, 0.5032, 0.7007, 0.9057, 1.0830, 1.2733, + 1.4885, 1.6897, 1.8933, 2.1128, 2.3188, 2.5271, 2.7284, 2.9266, + 0.1705, 0.3815, 0.6120, 0.7964, 0.9342, 1.0926, 1.2741, 1.4645, + 1.6552, 1.8040, 1.9778, 2.1931, 2.3836, 2.5827, 2.7905, 2.9494, + 0.1284, 0.2622, 0.4714, 0.6559, 0.8004, 1.0005, 1.1416, 1.3163, + 1.5773, 1.8144, 1.9947, 2.2001, 2.3836, 2.5710, 2.7447, 2.9262, + 0.1164, 0.2882, 0.5349, 0.7310, 0.8483, 0.9729, 1.1331, 1.3350, + 1.5307, 1.7306, 1.9409, 2.1275, 2.3229, 2.5358, 2.7455, 2.9447, + 0.1159, 0.2646, 0.4677, 0.6375, 0.7771, 0.9557, 1.1398, 1.3514, + 1.5717, 1.7512, 1.9337, 2.1323, 2.3272, 2.5409, 2.7377, 2.9212, + 0.1080, 0.2143, 0.3475, 0.5307, 0.7358, 0.9681, 1.1489, 1.3289, + 1.5553, 1.7664, 1.9696, 2.1780, 2.3676, 2.5568, 2.7493, 2.9347, + 0.1331, 0.2430, 0.3879, 0.5092, 0.6324, 0.8119, 1.0327, 1.2657, + 1.4999, 1.7107, 1.9178, 2.1272, 2.3296, 2.5340, 2.7372, 2.9353, + 0.1557, 0.2873, 0.4558, 0.6548, 0.8472, 1.0106, 1.1480, 1.3281, + 1.5856, 1.7740, 1.9564, 2.1651, 2.3295, 2.5207, 2.7005, 2.9151, + 0.1397, 0.2761, 0.4533, 0.6374, 0.7510, 0.8767, 1.0408, 1.2909, + 1.5368, 1.7560, 1.9424, 2.1332, 2.3210, 2.5116, 2.6924, 2.8886, + 0.0945, 0.1653, 0.3601, 0.6129, 0.8378, 1.0333, 1.2417, 1.4539, + 1.6507, 1.8304, 2.0286, 2.2157, 2.3975, 2.5865, 2.7721, 2.9426, + 0.1892, 0.3863, 0.4896, 0.5909, 0.7294, 0.9483, 1.1575, 1.3542, + 1.4796, 1.6535, 1.9070, 2.1435, 2.3281, 2.4967, 2.7039, 2.9222, + 0.1614, 0.3129, 0.5086, 0.7048, 0.8730, 1.0239, 1.1905, 1.3799, + 1.5697, 1.7503, 1.9103, 2.1115, 2.3235, 2.5234, 2.6973, 2.8957, + 0.1199, 0.2590, 0.4273, 0.5935, 0.7542, 0.9625, 1.1225, 1.2998, + 1.5361, 1.7102, 1.9097, 2.1269, 2.3157, 2.5304, 2.7212, 2.9175, + 0.1087, 0.2373, 0.4261, 0.6277, 0.8092, 0.9884, 1.1954, 1.4077, + 1.6048, 1.7799, 1.9693, 2.1662, 2.3426, 2.5501, 2.7459, 2.9257, + 0.1262, 0.2216, 0.3857, 0.5799, 0.7148, 0.8610, 1.0752, 1.3306, + 1.5549, 1.7605, 1.9727, 2.1580, 2.3612, 2.5602, 2.7554, 2.9372, + 0.1445, 0.2832, 0.4469, 0.6283, 0.7991, 0.9796, 1.1504, 1.3323, + 1.5313, 1.7140, 1.8968, 2.0990, 2.2826, 2.4903, 2.7003, 2.9031, + 0.1647, 0.4068, 0.5428, 0.6539, 0.7682, 0.8479, 0.9372, 1.1691, + 1.4776, 1.7314, 1.9071, 2.0918, 2.2774, 2.5029, 2.7152, 2.9221, + 0.1274, 0.3052, 0.5238, 0.7280, 0.9229, 1.1211, 1.3071, 1.4784, + 1.6564, 1.8235, 2.0028, 2.1999, 2.3763, 2.5608, 2.7510, 2.9356, + 0.1076, 0.2195, 0.4815, 0.6873, 0.8241, 0.9443, 1.1066, 1.3687, + 1.6087, 1.8105, 1.9857, 2.1486, 2.3505, 2.5854, 2.7785, 2.9376, + 0.1755, 0.3089, 0.4695, 0.6648, 0.8315, 1.0202, 1.1774, 1.3554, + 1.5393, 1.7141, 1.9247, 2.1284, 2.2983, 2.4975, 2.7296, 2.9401, + 0.1636, 0.3166, 0.4594, 0.6199, 0.8161, 0.9879, 1.1738, 1.3642, + 1.5680, 1.7633, 1.9598, 2.1695, 2.3692, 2.5846, 2.7809, 2.9563, + 0.1219, 0.2662, 0.4620, 0.6491, 0.8353, 1.0150, 1.2065, 1.3944, + 1.5785, 1.7631, 1.9389, 2.1434, 2.3400, 2.5316, 2.7359, 2.9513, + 0.1072, 0.2258, 0.3968, 0.5642, 0.7222, 0.9367, 1.1458, 1.3347, + 1.5424, 1.7373, 1.9303, 2.1432, 2.3451, 2.5415, 2.7444, 2.9394, + 0.1393, 0.2950, 0.4724, 0.6407, 0.8034, 1.0031, 1.1712, 1.3552, + 1.5519, 1.7411, 1.9198, 2.1160, 2.3238, 2.5119, 2.7134, 2.9205, + 0.1358, 0.2613, 0.4239, 0.5991, 0.7643, 0.9379, 1.1213, 1.3115, + 1.5067, 1.7031, 1.8768, 2.0836, 2.3092, 2.5134, 2.7237, 2.9286, + 0.1267, 0.2695, 0.4524, 0.6591, 0.8396, 1.0173, 1.2183, 1.4205, + 1.6306, 1.8162, 2.0106, 2.2082, 2.3773, 2.5787, 2.7551, 2.9387, + 0.1314, 0.2529, 0.3837, 0.5494, 0.7446, 0.9097, 1.0489, 1.2385, + 1.4691, 1.7170, 1.9600, 2.1770, 2.3594, 2.5356, 2.7215, 2.9088, + 0.1538, 0.2931, 0.4449, 0.6041, 0.7959, 0.9666, 1.1355, 1.3214, + 1.5150, 1.7230, 1.9433, 2.1408, 2.3459, 2.5476, 2.7273, 2.9330, + 0.1771, 0.2834, 0.4136, 0.5856, 0.7516, 0.9363, 1.0596, 1.2462, + 1.4737, 1.6627, 1.8810, 2.1150, 2.3202, 2.5274, 2.7403, 2.9490, + 0.1248, 0.2494, 0.4397, 0.6352, 0.8226, 1.0015, 1.1799, 1.3458, + 1.5654, 1.8228, 2.0646, 2.2550, 2.4161, 2.5964, 2.7675, 2.9383, + 0.0933, 0.1993, 0.3105, 0.4371, 0.6417, 0.8935, 1.1244, 1.3508, + 1.5649, 1.7595, 1.9581, 2.1648, 2.3639, 2.5569, 2.7573, 2.9468, + 0.1794, 0.3229, 0.4758, 0.6238, 0.7821, 0.9640, 1.1205, 1.3116, + 1.5054, 1.6803, 1.8658, 2.0651, 2.2793, 2.4856, 2.6867, 2.9105, + 0.1252, 0.2397, 0.3844, 0.5398, 0.7044, 0.8799, 1.0526, 1.2270, + 1.4269, 1.6412, 1.8532, 2.0784, 2.2957, 2.5051, 2.7139, 2.9210, + 0.1391, 0.3494, 0.5738, 0.8024, 1.0098, 1.2094, 1.3830, 1.5509, + 1.7222, 1.8782, 2.0604, 2.2479, 2.4154, 2.5968, 2.7767, 2.9450, + 0.1122, 0.2180, 0.4175, 0.6074, 0.7559, 0.9465, 1.1513, 1.3340, + 1.5215, 1.7491, 1.9911, 2.1894, 2.3433, 2.5377, 2.7380, 2.9183, + 0.1595, 0.3029, 0.4842, 0.6324, 0.7874, 0.9814, 1.1992, 1.3554, + 1.5017, 1.7274, 1.9168, 2.0853, 2.2964, 2.5300, 2.7187, 2.9041, + 0.1350, 0.2747, 0.4791, 0.6638, 0.8050, 0.9644, 1.1238, 1.2987, + 1.4844, 1.6754, 1.8778, 2.0987, 2.3279, 2.5424, 2.7410, 2.9356, + 0.0914, 0.1727, 0.3143, 0.5124, 0.7123, 0.9323, 1.1706, 1.3821, + 1.5864, 1.7828, 1.9701, 2.1560, 2.3445, 2.5486, 2.7433, 2.9372, + 0.1222, 0.2359, 0.3931, 0.5912, 0.7776, 0.9505, 1.1623, 1.3723, + 1.5484, 1.7316, 1.9321, 2.1283, 2.3148, 2.5269, 2.7299, 2.9213, + 0.2089, 0.3872, 0.5090, 0.6413, 0.7967, 1.0226, 1.1897, 1.3908, + 1.5954, 1.7202, 1.8614, 2.1030, 2.2973, 2.5079, 2.7491, 2.8944, + 0.1288, 0.2423, 0.4108, 0.6062, 0.7688, 0.9188, 1.0876, 1.2866, + 1.4897, 1.6910, 1.9219, 2.1076, 2.2805, 2.5023, 2.7155, 2.9203, + 0.0192, 0.0462, 0.0128, 0.0054, -0.0156, -0.0118, -0.0135, 0.0030, +-0.0120, 0.0031, 0.0240, -0.0451, -0.0439, -0.0432, -0.0527, -0.0207, + 0.0253, 0.0084, -0.0305, -0.0144, 0.0046, -0.0378, -0.0467, -0.0102, + 0.0280, 0.0540, 0.0151, 0.0437, 0.0141, -0.0257, -0.0058, 0.0073, + 0.0107, 0.0054, 0.0371, -0.0105, 0.0165, -0.0143, 0.0148, 0.0382, +-0.0054, -0.0284, 0.0001, -0.0218, 0.0258, 0.0517, 0.0157, -0.0032, +-0.0190, 0.0343, 0.0576, 0.0346, 0.0392, -0.0158, -0.0323, -0.0578, +-0.0617, -0.0242, -0.0144, 0.0188, 0.0249, 0.0021, -0.0422, -0.0420, + 0.0750, 0.0762, 0.0325, -0.0066, 0.0332, 0.0376, 0.0388, 0.0630, + 0.0525, 0.0196, 0.0051, -0.0484, -0.0322, 0.0059, 0.0132, 0.0079, + 0.0237, 0.0774, 0.0697, 0.0184, -0.0321, -0.0327, 0.0274, 0.0284, + 0.0057, 0.0289, 0.0478, 0.0142, -0.0053, 0.0114, 0.0292, -0.0032, +-0.0111, -0.0389, 0.0282, 0.0613, 0.0200, -0.0006, 0.0111, 0.0048, + 0.0273, 0.0017, -0.0369, 0.0655, 0.0758, 0.0555, 0.0238, -0.0024, +-0.0100, -0.0419, -0.0696, -0.0158, -0.0479, -0.0744, -0.0356, -0.0245, +-0.0400, -0.0112, 0.0134, 0.0001, -0.0422, -0.0514, -0.0081, 0.0083, +-0.0151, 0.0323, -0.0001, -0.0444, -0.0406, -0.0214, -0.0050, -0.0235, +-0.0205, -0.0264, -0.0324, 0.0334, 0.0392, 0.0265, 0.0289, 0.0180, + 0.0493, 0.0227, 0.0194, 0.0365, 0.0544, 0.0674, 0.0559, 0.0732, + 0.0911, 0.0942, 0.0735, 0.0174, -0.0113, -0.0553, -0.0665, -0.0227, +-0.0259, -0.0266, -0.0239, -0.0379, 0.0329, 0.0173, -0.0210, -0.0114, +-0.0063, 0.0060, -0.0089, -0.0198, -0.0282, -0.0080, -0.0179, -0.0290, + 0.0046, -0.0126, -0.0066, 0.0350, 0.0532, 0.0235, 0.0198, 0.0212, + 0.0449, 0.0681, 0.0677, -0.0049, 0.0086, 0.0120, 0.0356, 0.0454, + 0.0592, 0.0449, -0.0271, -0.0510, -0.0110, 0.0234, 0.0203, 0.0243, + 0.0242, 0.0133, 0.0098, 0.0040, 0.0024, -0.0005, -0.0075, -0.0126, +-0.0393, -0.0052, 0.0165, 0.0016, -0.0193, 0.0239, 0.0336, 0.0029, +-0.0586, -0.0539, -0.0094, -0.0664, -0.0898, -0.0540, -0.0066, 0.0134, +-0.0074, 0.0067, -0.0521, -0.0431, 0.0104, 0.0690, 0.0663, 0.0197, +-0.0017, -0.0518, -0.0597, -0.0171, -0.0054, -0.0140, -0.0080, 0.0172, +-0.0362, -0.0713, -0.0310, 0.0096, 0.0243, 0.0381, -0.0062, -0.0392, +-0.0281, 0.0386, 0.0461, 0.0069, 0.0384, 0.0080, -0.0141, 0.0171, + 0.3368, 0.3128, 0.3304, 0.3392, 0.3185, 0.3037, 0.2789, 0.2692, + 0.2779, 0.2796, 0.2891, 0.2643, 0.2647, 0.2593, 0.2927, 0.3283, + 0.4978, 0.4988, 0.4969, 0.4997, 0.4957, 0.4985, 0.4970, 0.4978, + 0.4938, 0.4951, 0.4994, 0.4971, 0.4981, 0.4983, 0.4967, 0.4789 +}, + +}; + +static const uint8_t tab7[][35] = { + { 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, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 0 }, + { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 1, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 0 }, + { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0 }, + { 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, + 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, + 1, 0, 1 }, + { 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, 0, 0, 0, 0, 0, + 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0 } +}; + +static const uint8_t tab8[][5] = { + { 0, 0, 0, 1, 1 }, + { 0, 1, 0, 0, 1 }, + { 1, 1, 0, 0, 0 }, + { 1, 0, 0, 1, 0 }, + { 0, 0, 0, 1, 1 }, + { 0, 1, 0, 0, 1 }, + { 1, 1, 0, 0, 0 }, + { 1, 0, 0, 1, 0 }, + { 0, 0, 0, 1, 1 }, + { 0, 1, 0, 0, 1 }, + { 1, 1, 0, 0, 0 }, + { 0, 0, 0, 0, 0 }, + { 0, 1, 0, 1, 0 } +}; + +static const uint8_t tab9[][45] = { + { 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, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 1, 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, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, + 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; + +static const uint8_t tab10[][25] = { + { 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, + 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0 }, + { 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, + 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0 }, + { 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, + 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0 }, + { 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, + { 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, + 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1 }, + { 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, + 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1 }, + { 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, + 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0 }, + { 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, + 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1 } +}; + +static const uint8_t tab11[][55] = { + { 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, 1, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 0, 0, 0, 0, 0, }, + { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 1, 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, 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, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 0, 0, 0, 0, 0, }, + { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 1, 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, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }, + { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, } +}; + +static const uint8_t tab12[][15] = { + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0 }, + { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 }, + { 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0 }, + { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 }, + { 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0 }, + { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1 }, +}; + +static const struct { + int size; + const uint8_t *tab; +} tabs[] = { + { 0, NULL }, + { 5, &tab8[0][0] }, { 5, &tab8[0][0] }, { 15, &tab12[0][0] }, + { 5, &tab8[0][0] }, { 25, &tab10[0][0] }, { 15, &tab12[0][0] }, + { 35, &tab7[0][0] }, { 5, &tab8[0][0] }, { 45, &tab9[0][0] }, + { 25, &tab10[0][0] }, { 55, &tab11[0][0] }, { 15, &tab12[0][0] } +}; + +#endif /* AVCODEC_TWINVQ_DATA_H */ diff --git a/include/libavcodec/ulti_cb.h b/include/libavcodec/ulti_cb.h new file mode 100644 index 0000000..7061d83 --- /dev/null +++ b/include/libavcodec/ulti_cb.h @@ -0,0 +1,4124 @@ +/* + * IBM Ultimotion Video Decoder + * copyright (C) 2004 Konstantin Shishkov + * + * 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_ULTI_CB_H +#define AVCODEC_ULTI_CB_H + +static const unsigned char ulti_codebook[16384]={ + 0x00, 0x01, 0x01, 0x02, + 0x00, 0x01, 0x02, 0x03, + 0x00, 0x02, 0x03, 0x04, + 0x00, 0x01, 0x03, 0x04, + 0x00, 0x01, 0x02, 0x04, + 0x00, 0x02, 0x03, 0x05, + 0x00, 0x02, 0x04, 0x05, + 0x00, 0x01, 0x04, 0x05, + 0x00, 0x01, 0x03, 0x05, + 0x00, 0x02, 0x04, 0x06, + 0x00, 0x03, 0x05, 0x06, + 0x00, 0x01, 0x05, 0x06, + 0x00, 0x01, 0x03, 0x06, + 0x00, 0x06, 0x06, 0x06, + 0x00, 0x00, 0x06, 0x06, + 0x00, 0x00, 0x00, 0x06, + 0x00, 0x03, 0x04, 0x07, + 0x00, 0x03, 0x06, 0x07, + 0x00, 0x01, 0x06, 0x07, + 0x00, 0x01, 0x04, 0x07, + 0x00, 0x03, 0x05, 0x08, + 0x00, 0x04, 0x06, 0x08, + 0x00, 0x02, 0x06, 0x08, + 0x00, 0x02, 0x04, 0x08, + 0x00, 0x08, 0x08, 0x08, + 0x00, 0x00, 0x08, 0x08, + 0x00, 0x00, 0x00, 0x08, + 0x00, 0x04, 0x07, 0x0B, + 0x00, 0x05, 0x09, 0x0B, + 0x00, 0x02, 0x09, 0x0B, + 0x00, 0x02, 0x06, 0x0B, + 0x00, 0x0B, 0x0B, 0x0B, + 0x00, 0x00, 0x0B, 0x0B, + 0x00, 0x00, 0x00, 0x0B, + 0x00, 0x05, 0x09, 0x0E, + 0x00, 0x07, 0x0B, 0x0E, + 0x00, 0x03, 0x0B, 0x0E, + 0x00, 0x03, 0x07, 0x0E, + 0x00, 0x0E, 0x0E, 0x0E, + 0x00, 0x00, 0x0E, 0x0E, + 0x00, 0x00, 0x00, 0x0E, + 0x00, 0x06, 0x0B, 0x11, + 0x00, 0x08, 0x0D, 0x11, + 0x00, 0x04, 0x0D, 0x11, + 0x00, 0x04, 0x09, 0x11, + 0x00, 0x11, 0x11, 0x11, + 0x00, 0x00, 0x11, 0x11, + 0x00, 0x00, 0x00, 0x11, + 0x00, 0x07, 0x0D, 0x14, + 0x00, 0x0A, 0x0F, 0x14, + 0x00, 0x05, 0x0F, 0x14, + 0x00, 0x05, 0x0A, 0x14, + 0x00, 0x14, 0x14, 0x14, + 0x00, 0x00, 0x14, 0x14, + 0x00, 0x00, 0x00, 0x14, + 0x00, 0x0B, 0x12, 0x17, + 0x00, 0x05, 0x12, 0x17, + 0x00, 0x05, 0x0C, 0x17, + 0x00, 0x17, 0x17, 0x17, + 0x00, 0x00, 0x17, 0x17, + 0x00, 0x00, 0x00, 0x17, + 0x00, 0x0D, 0x14, 0x1A, + 0x00, 0x06, 0x14, 0x1A, + 0x00, 0x06, 0x0D, 0x1A, + 0x00, 0x1A, 0x1A, 0x1A, + 0x00, 0x00, 0x1A, 0x1A, + 0x00, 0x00, 0x00, 0x1A, + 0x00, 0x0E, 0x16, 0x1D, + 0x00, 0x07, 0x16, 0x1D, + 0x00, 0x07, 0x0F, 0x1D, + 0x00, 0x1D, 0x1D, 0x1D, + 0x00, 0x00, 0x1D, 0x1D, + 0x00, 0x00, 0x00, 0x1D, + 0x00, 0x10, 0x18, 0x20, + 0x00, 0x08, 0x18, 0x20, + 0x00, 0x08, 0x10, 0x20, + 0x00, 0x20, 0x20, 0x20, + 0x00, 0x00, 0x20, 0x20, + 0x00, 0x00, 0x00, 0x20, + 0x00, 0x23, 0x23, 0x23, + 0x00, 0x00, 0x23, 0x23, + 0x00, 0x00, 0x00, 0x23, + 0x00, 0x12, 0x1B, 0x24, + 0x00, 0x09, 0x1B, 0x24, + 0x00, 0x09, 0x12, 0x24, + 0x00, 0x28, 0x28, 0x28, + 0x00, 0x00, 0x28, 0x28, + 0x00, 0x00, 0x00, 0x28, + 0x00, 0x2E, 0x2E, 0x2E, + 0x00, 0x00, 0x2E, 0x2E, + 0x00, 0x00, 0x00, 0x2E, + 0x01, 0x02, 0x02, 0x03, + 0x01, 0x02, 0x03, 0x04, + 0x01, 0x03, 0x04, 0x05, + 0x01, 0x02, 0x04, 0x05, + 0x01, 0x02, 0x03, 0x05, + 0x01, 0x03, 0x04, 0x06, + 0x01, 0x03, 0x05, 0x06, + 0x01, 0x02, 0x05, 0x06, + 0x01, 0x02, 0x04, 0x06, + 0x01, 0x03, 0x05, 0x07, + 0x01, 0x04, 0x06, 0x07, + 0x01, 0x02, 0x06, 0x07, + 0x01, 0x02, 0x04, 0x07, + 0x01, 0x07, 0x07, 0x07, + 0x01, 0x01, 0x07, 0x07, + 0x01, 0x01, 0x01, 0x07, + 0x01, 0x04, 0x05, 0x08, + 0x01, 0x04, 0x07, 0x08, + 0x01, 0x02, 0x07, 0x08, + 0x01, 0x02, 0x05, 0x08, + 0x01, 0x04, 0x06, 0x09, + 0x01, 0x05, 0x07, 0x09, + 0x01, 0x03, 0x07, 0x09, + 0x01, 0x03, 0x05, 0x09, + 0x01, 0x09, 0x09, 0x09, + 0x01, 0x01, 0x09, 0x09, + 0x01, 0x01, 0x01, 0x09, + 0x01, 0x05, 0x08, 0x0C, + 0x01, 0x06, 0x0A, 0x0C, + 0x01, 0x03, 0x0A, 0x0C, + 0x01, 0x03, 0x07, 0x0C, + 0x01, 0x0C, 0x0C, 0x0C, + 0x01, 0x01, 0x0C, 0x0C, + 0x01, 0x01, 0x01, 0x0C, + 0x01, 0x06, 0x0A, 0x0F, + 0x01, 0x08, 0x0C, 0x0F, + 0x01, 0x04, 0x0C, 0x0F, + 0x01, 0x04, 0x08, 0x0F, + 0x01, 0x0F, 0x0F, 0x0F, + 0x01, 0x01, 0x0F, 0x0F, + 0x01, 0x01, 0x01, 0x0F, + 0x01, 0x07, 0x0C, 0x12, + 0x01, 0x09, 0x0E, 0x12, + 0x01, 0x05, 0x0E, 0x12, + 0x01, 0x05, 0x0A, 0x12, + 0x01, 0x12, 0x12, 0x12, + 0x01, 0x01, 0x12, 0x12, + 0x01, 0x01, 0x01, 0x12, + 0x01, 0x08, 0x0E, 0x15, + 0x01, 0x0B, 0x10, 0x15, + 0x01, 0x06, 0x10, 0x15, + 0x01, 0x06, 0x0B, 0x15, + 0x01, 0x15, 0x15, 0x15, + 0x01, 0x01, 0x15, 0x15, + 0x01, 0x01, 0x01, 0x15, + 0x01, 0x0C, 0x13, 0x18, + 0x01, 0x06, 0x13, 0x18, + 0x01, 0x06, 0x0D, 0x18, + 0x01, 0x18, 0x18, 0x18, + 0x01, 0x01, 0x18, 0x18, + 0x01, 0x01, 0x01, 0x18, + 0x01, 0x0E, 0x15, 0x1B, + 0x01, 0x07, 0x15, 0x1B, + 0x01, 0x07, 0x0E, 0x1B, + 0x01, 0x1B, 0x1B, 0x1B, + 0x01, 0x01, 0x1B, 0x1B, + 0x01, 0x01, 0x01, 0x1B, + 0x01, 0x0F, 0x17, 0x1E, + 0x01, 0x08, 0x17, 0x1E, + 0x01, 0x08, 0x10, 0x1E, + 0x01, 0x1E, 0x1E, 0x1E, + 0x01, 0x01, 0x1E, 0x1E, + 0x01, 0x01, 0x01, 0x1E, + 0x01, 0x11, 0x19, 0x21, + 0x01, 0x09, 0x19, 0x21, + 0x01, 0x09, 0x11, 0x21, + 0x01, 0x21, 0x21, 0x21, + 0x01, 0x01, 0x21, 0x21, + 0x01, 0x01, 0x01, 0x21, + 0x01, 0x24, 0x24, 0x24, + 0x01, 0x01, 0x24, 0x24, + 0x01, 0x01, 0x01, 0x24, + 0x01, 0x13, 0x1C, 0x25, + 0x01, 0x0A, 0x1C, 0x25, + 0x01, 0x0A, 0x13, 0x25, + 0x01, 0x29, 0x29, 0x29, + 0x01, 0x01, 0x29, 0x29, + 0x01, 0x01, 0x01, 0x29, + 0x01, 0x2F, 0x2F, 0x2F, + 0x01, 0x01, 0x2F, 0x2F, + 0x01, 0x01, 0x01, 0x2F, + 0x02, 0x03, 0x03, 0x04, + 0x02, 0x03, 0x04, 0x05, + 0x02, 0x04, 0x05, 0x06, + 0x02, 0x03, 0x05, 0x06, + 0x02, 0x03, 0x04, 0x06, + 0x02, 0x04, 0x05, 0x07, + 0x02, 0x04, 0x06, 0x07, + 0x02, 0x03, 0x06, 0x07, + 0x02, 0x03, 0x05, 0x07, + 0x02, 0x04, 0x06, 0x08, + 0x02, 0x05, 0x07, 0x08, + 0x02, 0x03, 0x07, 0x08, + 0x02, 0x03, 0x05, 0x08, + 0x02, 0x08, 0x08, 0x08, + 0x02, 0x02, 0x08, 0x08, + 0x02, 0x02, 0x02, 0x08, + 0x02, 0x05, 0x06, 0x09, + 0x02, 0x05, 0x08, 0x09, + 0x02, 0x03, 0x08, 0x09, + 0x02, 0x03, 0x06, 0x09, + 0x02, 0x05, 0x07, 0x0A, + 0x02, 0x06, 0x08, 0x0A, + 0x02, 0x04, 0x08, 0x0A, + 0x02, 0x04, 0x06, 0x0A, + 0x02, 0x0A, 0x0A, 0x0A, + 0x02, 0x02, 0x0A, 0x0A, + 0x02, 0x02, 0x02, 0x0A, + 0x02, 0x06, 0x09, 0x0D, + 0x02, 0x07, 0x0B, 0x0D, + 0x02, 0x04, 0x0B, 0x0D, + 0x02, 0x04, 0x08, 0x0D, + 0x02, 0x0D, 0x0D, 0x0D, + 0x02, 0x02, 0x0D, 0x0D, + 0x02, 0x02, 0x02, 0x0D, + 0x02, 0x07, 0x0B, 0x10, + 0x02, 0x09, 0x0D, 0x10, + 0x02, 0x05, 0x0D, 0x10, + 0x02, 0x05, 0x09, 0x10, + 0x02, 0x10, 0x10, 0x10, + 0x02, 0x02, 0x10, 0x10, + 0x02, 0x02, 0x02, 0x10, + 0x02, 0x08, 0x0D, 0x13, + 0x02, 0x0A, 0x0F, 0x13, + 0x02, 0x06, 0x0F, 0x13, + 0x02, 0x06, 0x0B, 0x13, + 0x02, 0x13, 0x13, 0x13, + 0x02, 0x02, 0x13, 0x13, + 0x02, 0x02, 0x02, 0x13, + 0x02, 0x09, 0x0F, 0x16, + 0x02, 0x0C, 0x11, 0x16, + 0x02, 0x07, 0x11, 0x16, + 0x02, 0x07, 0x0C, 0x16, + 0x02, 0x16, 0x16, 0x16, + 0x02, 0x02, 0x16, 0x16, + 0x02, 0x02, 0x02, 0x16, + 0x02, 0x0D, 0x14, 0x19, + 0x02, 0x07, 0x14, 0x19, + 0x02, 0x07, 0x0E, 0x19, + 0x02, 0x19, 0x19, 0x19, + 0x02, 0x02, 0x19, 0x19, + 0x02, 0x02, 0x02, 0x19, + 0x02, 0x0F, 0x16, 0x1C, + 0x02, 0x08, 0x16, 0x1C, + 0x02, 0x08, 0x0F, 0x1C, + 0x02, 0x1C, 0x1C, 0x1C, + 0x02, 0x02, 0x1C, 0x1C, + 0x02, 0x02, 0x02, 0x1C, + 0x02, 0x10, 0x18, 0x1F, + 0x02, 0x09, 0x18, 0x1F, + 0x02, 0x09, 0x11, 0x1F, + 0x02, 0x1F, 0x1F, 0x1F, + 0x02, 0x02, 0x1F, 0x1F, + 0x02, 0x02, 0x02, 0x1F, + 0x02, 0x12, 0x1A, 0x22, + 0x02, 0x0A, 0x1A, 0x22, + 0x02, 0x0A, 0x12, 0x22, + 0x02, 0x22, 0x22, 0x22, + 0x02, 0x02, 0x22, 0x22, + 0x02, 0x02, 0x02, 0x22, + 0x02, 0x25, 0x25, 0x25, + 0x02, 0x02, 0x25, 0x25, + 0x02, 0x02, 0x02, 0x25, + 0x02, 0x14, 0x1D, 0x26, + 0x02, 0x0B, 0x1D, 0x26, + 0x02, 0x0B, 0x14, 0x26, + 0x02, 0x2A, 0x2A, 0x2A, + 0x02, 0x02, 0x2A, 0x2A, + 0x02, 0x02, 0x02, 0x2A, + 0x02, 0x30, 0x30, 0x30, + 0x02, 0x02, 0x30, 0x30, + 0x02, 0x02, 0x02, 0x30, + 0x03, 0x04, 0x04, 0x05, + 0x03, 0x04, 0x05, 0x06, + 0x03, 0x05, 0x06, 0x07, + 0x03, 0x04, 0x06, 0x07, + 0x03, 0x04, 0x05, 0x07, + 0x03, 0x05, 0x06, 0x08, + 0x03, 0x05, 0x07, 0x08, + 0x03, 0x04, 0x07, 0x08, + 0x03, 0x04, 0x06, 0x08, + 0x03, 0x05, 0x07, 0x09, + 0x03, 0x06, 0x08, 0x09, + 0x03, 0x04, 0x08, 0x09, + 0x03, 0x04, 0x06, 0x09, + 0x03, 0x09, 0x09, 0x09, + 0x03, 0x03, 0x09, 0x09, + 0x03, 0x03, 0x03, 0x09, + 0x03, 0x06, 0x07, 0x0A, + 0x03, 0x06, 0x09, 0x0A, + 0x03, 0x04, 0x09, 0x0A, + 0x03, 0x04, 0x07, 0x0A, + 0x03, 0x06, 0x08, 0x0B, + 0x03, 0x07, 0x09, 0x0B, + 0x03, 0x05, 0x09, 0x0B, + 0x03, 0x05, 0x07, 0x0B, + 0x03, 0x0B, 0x0B, 0x0B, + 0x03, 0x03, 0x0B, 0x0B, + 0x03, 0x03, 0x03, 0x0B, + 0x03, 0x07, 0x0A, 0x0E, + 0x03, 0x08, 0x0C, 0x0E, + 0x03, 0x05, 0x0C, 0x0E, + 0x03, 0x05, 0x09, 0x0E, + 0x03, 0x0E, 0x0E, 0x0E, + 0x03, 0x03, 0x0E, 0x0E, + 0x03, 0x03, 0x03, 0x0E, + 0x03, 0x08, 0x0C, 0x11, + 0x03, 0x0A, 0x0E, 0x11, + 0x03, 0x06, 0x0E, 0x11, + 0x03, 0x06, 0x0A, 0x11, + 0x03, 0x11, 0x11, 0x11, + 0x03, 0x03, 0x11, 0x11, + 0x03, 0x03, 0x03, 0x11, + 0x03, 0x09, 0x0E, 0x14, + 0x03, 0x0B, 0x10, 0x14, + 0x03, 0x07, 0x10, 0x14, + 0x03, 0x07, 0x0C, 0x14, + 0x03, 0x14, 0x14, 0x14, + 0x03, 0x03, 0x14, 0x14, + 0x03, 0x03, 0x03, 0x14, + 0x03, 0x0A, 0x10, 0x17, + 0x03, 0x0D, 0x12, 0x17, + 0x03, 0x08, 0x12, 0x17, + 0x03, 0x08, 0x0D, 0x17, + 0x03, 0x17, 0x17, 0x17, + 0x03, 0x03, 0x17, 0x17, + 0x03, 0x03, 0x03, 0x17, + 0x03, 0x0E, 0x15, 0x1A, + 0x03, 0x08, 0x15, 0x1A, + 0x03, 0x08, 0x0F, 0x1A, + 0x03, 0x1A, 0x1A, 0x1A, + 0x03, 0x03, 0x1A, 0x1A, + 0x03, 0x03, 0x03, 0x1A, + 0x03, 0x10, 0x17, 0x1D, + 0x03, 0x09, 0x17, 0x1D, + 0x03, 0x09, 0x10, 0x1D, + 0x03, 0x1D, 0x1D, 0x1D, + 0x03, 0x03, 0x1D, 0x1D, + 0x03, 0x03, 0x03, 0x1D, + 0x03, 0x11, 0x19, 0x20, + 0x03, 0x0A, 0x19, 0x20, + 0x03, 0x0A, 0x12, 0x20, + 0x03, 0x20, 0x20, 0x20, + 0x03, 0x03, 0x20, 0x20, + 0x03, 0x03, 0x03, 0x20, + 0x03, 0x13, 0x1B, 0x23, + 0x03, 0x0B, 0x1B, 0x23, + 0x03, 0x0B, 0x13, 0x23, + 0x03, 0x23, 0x23, 0x23, + 0x03, 0x03, 0x23, 0x23, + 0x03, 0x03, 0x03, 0x23, + 0x03, 0x26, 0x26, 0x26, + 0x03, 0x03, 0x26, 0x26, + 0x03, 0x03, 0x03, 0x26, + 0x03, 0x15, 0x1E, 0x27, + 0x03, 0x0C, 0x1E, 0x27, + 0x03, 0x0C, 0x15, 0x27, + 0x03, 0x2B, 0x2B, 0x2B, + 0x03, 0x03, 0x2B, 0x2B, + 0x03, 0x03, 0x03, 0x2B, + 0x03, 0x31, 0x31, 0x31, + 0x03, 0x03, 0x31, 0x31, + 0x03, 0x03, 0x03, 0x31, + 0x04, 0x05, 0x05, 0x06, + 0x04, 0x05, 0x06, 0x07, + 0x04, 0x06, 0x07, 0x08, + 0x04, 0x05, 0x07, 0x08, + 0x04, 0x05, 0x06, 0x08, + 0x04, 0x06, 0x07, 0x09, + 0x04, 0x06, 0x08, 0x09, + 0x04, 0x05, 0x08, 0x09, + 0x04, 0x05, 0x07, 0x09, + 0x04, 0x06, 0x08, 0x0A, + 0x04, 0x07, 0x09, 0x0A, + 0x04, 0x05, 0x09, 0x0A, + 0x04, 0x05, 0x07, 0x0A, + 0x04, 0x0A, 0x0A, 0x0A, + 0x04, 0x04, 0x0A, 0x0A, + 0x04, 0x04, 0x04, 0x0A, + 0x04, 0x07, 0x08, 0x0B, + 0x04, 0x07, 0x0A, 0x0B, + 0x04, 0x05, 0x0A, 0x0B, + 0x04, 0x05, 0x08, 0x0B, + 0x04, 0x07, 0x09, 0x0C, + 0x04, 0x08, 0x0A, 0x0C, + 0x04, 0x06, 0x0A, 0x0C, + 0x04, 0x06, 0x08, 0x0C, + 0x04, 0x0C, 0x0C, 0x0C, + 0x04, 0x04, 0x0C, 0x0C, + 0x04, 0x04, 0x04, 0x0C, + 0x04, 0x08, 0x0B, 0x0F, + 0x04, 0x09, 0x0D, 0x0F, + 0x04, 0x06, 0x0D, 0x0F, + 0x04, 0x06, 0x0A, 0x0F, + 0x04, 0x0F, 0x0F, 0x0F, + 0x04, 0x04, 0x0F, 0x0F, + 0x04, 0x04, 0x04, 0x0F, + 0x04, 0x09, 0x0D, 0x12, + 0x04, 0x0B, 0x0F, 0x12, + 0x04, 0x07, 0x0F, 0x12, + 0x04, 0x07, 0x0B, 0x12, + 0x04, 0x12, 0x12, 0x12, + 0x04, 0x04, 0x12, 0x12, + 0x04, 0x04, 0x04, 0x12, + 0x04, 0x0A, 0x0F, 0x15, + 0x04, 0x0C, 0x11, 0x15, + 0x04, 0x08, 0x11, 0x15, + 0x04, 0x08, 0x0D, 0x15, + 0x04, 0x15, 0x15, 0x15, + 0x04, 0x04, 0x15, 0x15, + 0x04, 0x04, 0x04, 0x15, + 0x04, 0x0B, 0x11, 0x18, + 0x04, 0x0E, 0x13, 0x18, + 0x04, 0x09, 0x13, 0x18, + 0x04, 0x09, 0x0E, 0x18, + 0x04, 0x18, 0x18, 0x18, + 0x04, 0x04, 0x18, 0x18, + 0x04, 0x04, 0x04, 0x18, + 0x04, 0x0F, 0x16, 0x1B, + 0x04, 0x09, 0x16, 0x1B, + 0x04, 0x09, 0x10, 0x1B, + 0x04, 0x1B, 0x1B, 0x1B, + 0x04, 0x04, 0x1B, 0x1B, + 0x04, 0x04, 0x04, 0x1B, + 0x04, 0x11, 0x18, 0x1E, + 0x04, 0x0A, 0x18, 0x1E, + 0x04, 0x0A, 0x11, 0x1E, + 0x04, 0x1E, 0x1E, 0x1E, + 0x04, 0x04, 0x1E, 0x1E, + 0x04, 0x04, 0x04, 0x1E, + 0x04, 0x12, 0x1A, 0x21, + 0x04, 0x0B, 0x1A, 0x21, + 0x04, 0x0B, 0x13, 0x21, + 0x04, 0x21, 0x21, 0x21, + 0x04, 0x04, 0x21, 0x21, + 0x04, 0x04, 0x04, 0x21, + 0x04, 0x14, 0x1C, 0x24, + 0x04, 0x0C, 0x1C, 0x24, + 0x04, 0x0C, 0x14, 0x24, + 0x04, 0x24, 0x24, 0x24, + 0x04, 0x04, 0x24, 0x24, + 0x04, 0x04, 0x04, 0x24, + 0x04, 0x27, 0x27, 0x27, + 0x04, 0x04, 0x27, 0x27, + 0x04, 0x04, 0x04, 0x27, + 0x04, 0x16, 0x1F, 0x28, + 0x04, 0x0D, 0x1F, 0x28, + 0x04, 0x0D, 0x16, 0x28, + 0x04, 0x2C, 0x2C, 0x2C, + 0x04, 0x04, 0x2C, 0x2C, + 0x04, 0x04, 0x04, 0x2C, + 0x04, 0x32, 0x32, 0x32, + 0x04, 0x04, 0x32, 0x32, + 0x04, 0x04, 0x04, 0x32, + 0x05, 0x06, 0x06, 0x07, + 0x05, 0x06, 0x07, 0x08, + 0x05, 0x07, 0x08, 0x09, + 0x05, 0x06, 0x08, 0x09, + 0x05, 0x06, 0x07, 0x09, + 0x05, 0x07, 0x08, 0x0A, + 0x05, 0x07, 0x09, 0x0A, + 0x05, 0x06, 0x09, 0x0A, + 0x05, 0x06, 0x08, 0x0A, + 0x05, 0x07, 0x09, 0x0B, + 0x05, 0x08, 0x0A, 0x0B, + 0x05, 0x06, 0x0A, 0x0B, + 0x05, 0x06, 0x08, 0x0B, + 0x05, 0x0B, 0x0B, 0x0B, + 0x05, 0x05, 0x0B, 0x0B, + 0x05, 0x05, 0x05, 0x0B, + 0x05, 0x08, 0x09, 0x0C, + 0x05, 0x08, 0x0B, 0x0C, + 0x05, 0x06, 0x0B, 0x0C, + 0x05, 0x06, 0x09, 0x0C, + 0x05, 0x08, 0x0A, 0x0D, + 0x05, 0x09, 0x0B, 0x0D, + 0x05, 0x07, 0x0B, 0x0D, + 0x05, 0x07, 0x09, 0x0D, + 0x05, 0x0D, 0x0D, 0x0D, + 0x05, 0x05, 0x0D, 0x0D, + 0x05, 0x05, 0x05, 0x0D, + 0x05, 0x09, 0x0C, 0x10, + 0x05, 0x0A, 0x0E, 0x10, + 0x05, 0x07, 0x0E, 0x10, + 0x05, 0x07, 0x0B, 0x10, + 0x05, 0x10, 0x10, 0x10, + 0x05, 0x05, 0x10, 0x10, + 0x05, 0x05, 0x05, 0x10, + 0x05, 0x0A, 0x0E, 0x13, + 0x05, 0x0C, 0x10, 0x13, + 0x05, 0x08, 0x10, 0x13, + 0x05, 0x08, 0x0C, 0x13, + 0x05, 0x13, 0x13, 0x13, + 0x05, 0x05, 0x13, 0x13, + 0x05, 0x05, 0x05, 0x13, + 0x05, 0x0B, 0x10, 0x16, + 0x05, 0x0D, 0x12, 0x16, + 0x05, 0x09, 0x12, 0x16, + 0x05, 0x09, 0x0E, 0x16, + 0x05, 0x16, 0x16, 0x16, + 0x05, 0x05, 0x16, 0x16, + 0x05, 0x05, 0x05, 0x16, + 0x05, 0x0C, 0x12, 0x19, + 0x05, 0x0F, 0x14, 0x19, + 0x05, 0x0A, 0x14, 0x19, + 0x05, 0x0A, 0x0F, 0x19, + 0x05, 0x19, 0x19, 0x19, + 0x05, 0x05, 0x19, 0x19, + 0x05, 0x05, 0x05, 0x19, + 0x05, 0x10, 0x17, 0x1C, + 0x05, 0x0A, 0x17, 0x1C, + 0x05, 0x0A, 0x11, 0x1C, + 0x05, 0x1C, 0x1C, 0x1C, + 0x05, 0x05, 0x1C, 0x1C, + 0x05, 0x05, 0x05, 0x1C, + 0x05, 0x12, 0x19, 0x1F, + 0x05, 0x0B, 0x19, 0x1F, + 0x05, 0x0B, 0x12, 0x1F, + 0x05, 0x1F, 0x1F, 0x1F, + 0x05, 0x05, 0x1F, 0x1F, + 0x05, 0x05, 0x05, 0x1F, + 0x05, 0x13, 0x1B, 0x22, + 0x05, 0x0C, 0x1B, 0x22, + 0x05, 0x0C, 0x14, 0x22, + 0x05, 0x22, 0x22, 0x22, + 0x05, 0x05, 0x22, 0x22, + 0x05, 0x05, 0x05, 0x22, + 0x05, 0x15, 0x1D, 0x25, + 0x05, 0x0D, 0x1D, 0x25, + 0x05, 0x0D, 0x15, 0x25, + 0x05, 0x25, 0x25, 0x25, + 0x05, 0x05, 0x25, 0x25, + 0x05, 0x05, 0x05, 0x25, + 0x05, 0x28, 0x28, 0x28, + 0x05, 0x05, 0x28, 0x28, + 0x05, 0x05, 0x05, 0x28, + 0x05, 0x17, 0x20, 0x29, + 0x05, 0x0E, 0x20, 0x29, + 0x05, 0x0E, 0x17, 0x29, + 0x05, 0x2D, 0x2D, 0x2D, + 0x05, 0x05, 0x2D, 0x2D, + 0x05, 0x05, 0x05, 0x2D, + 0x05, 0x33, 0x33, 0x33, + 0x05, 0x05, 0x33, 0x33, + 0x05, 0x05, 0x05, 0x33, + 0x06, 0x07, 0x07, 0x08, + 0x06, 0x07, 0x08, 0x09, + 0x06, 0x08, 0x09, 0x0A, + 0x06, 0x07, 0x09, 0x0A, + 0x06, 0x07, 0x08, 0x0A, + 0x06, 0x08, 0x09, 0x0B, + 0x06, 0x08, 0x0A, 0x0B, + 0x06, 0x07, 0x0A, 0x0B, + 0x06, 0x07, 0x09, 0x0B, + 0x06, 0x08, 0x0A, 0x0C, + 0x06, 0x09, 0x0B, 0x0C, + 0x06, 0x07, 0x0B, 0x0C, + 0x06, 0x07, 0x09, 0x0C, + 0x06, 0x0C, 0x0C, 0x0C, + 0x06, 0x06, 0x0C, 0x0C, + 0x06, 0x06, 0x06, 0x0C, + 0x06, 0x09, 0x0A, 0x0D, + 0x06, 0x09, 0x0C, 0x0D, + 0x06, 0x07, 0x0C, 0x0D, + 0x06, 0x07, 0x0A, 0x0D, + 0x06, 0x09, 0x0B, 0x0E, + 0x06, 0x0A, 0x0C, 0x0E, + 0x06, 0x08, 0x0C, 0x0E, + 0x06, 0x08, 0x0A, 0x0E, + 0x06, 0x0E, 0x0E, 0x0E, + 0x06, 0x06, 0x0E, 0x0E, + 0x06, 0x06, 0x06, 0x0E, + 0x06, 0x0A, 0x0D, 0x11, + 0x06, 0x0B, 0x0F, 0x11, + 0x06, 0x08, 0x0F, 0x11, + 0x06, 0x08, 0x0C, 0x11, + 0x06, 0x11, 0x11, 0x11, + 0x06, 0x06, 0x11, 0x11, + 0x06, 0x06, 0x06, 0x11, + 0x06, 0x0B, 0x0F, 0x14, + 0x06, 0x0D, 0x11, 0x14, + 0x06, 0x09, 0x11, 0x14, + 0x06, 0x09, 0x0D, 0x14, + 0x06, 0x14, 0x14, 0x14, + 0x06, 0x06, 0x14, 0x14, + 0x06, 0x06, 0x06, 0x14, + 0x06, 0x0C, 0x11, 0x17, + 0x06, 0x0E, 0x13, 0x17, + 0x06, 0x0A, 0x13, 0x17, + 0x06, 0x0A, 0x0F, 0x17, + 0x06, 0x17, 0x17, 0x17, + 0x06, 0x06, 0x17, 0x17, + 0x06, 0x06, 0x06, 0x17, + 0x06, 0x0D, 0x13, 0x1A, + 0x06, 0x10, 0x15, 0x1A, + 0x06, 0x0B, 0x15, 0x1A, + 0x06, 0x0B, 0x10, 0x1A, + 0x06, 0x1A, 0x1A, 0x1A, + 0x06, 0x06, 0x1A, 0x1A, + 0x06, 0x06, 0x06, 0x1A, + 0x06, 0x11, 0x18, 0x1D, + 0x06, 0x0B, 0x18, 0x1D, + 0x06, 0x0B, 0x12, 0x1D, + 0x06, 0x1D, 0x1D, 0x1D, + 0x06, 0x06, 0x1D, 0x1D, + 0x06, 0x06, 0x06, 0x1D, + 0x06, 0x13, 0x1A, 0x20, + 0x06, 0x0C, 0x1A, 0x20, + 0x06, 0x0C, 0x13, 0x20, + 0x06, 0x20, 0x20, 0x20, + 0x06, 0x06, 0x20, 0x20, + 0x06, 0x06, 0x06, 0x20, + 0x06, 0x14, 0x1C, 0x23, + 0x06, 0x0D, 0x1C, 0x23, + 0x06, 0x0D, 0x15, 0x23, + 0x06, 0x23, 0x23, 0x23, + 0x06, 0x06, 0x23, 0x23, + 0x06, 0x06, 0x06, 0x23, + 0x06, 0x16, 0x1E, 0x26, + 0x06, 0x0E, 0x1E, 0x26, + 0x06, 0x0E, 0x16, 0x26, + 0x06, 0x26, 0x26, 0x26, + 0x06, 0x06, 0x26, 0x26, + 0x06, 0x06, 0x06, 0x26, + 0x06, 0x29, 0x29, 0x29, + 0x06, 0x06, 0x29, 0x29, + 0x06, 0x06, 0x06, 0x29, + 0x06, 0x18, 0x21, 0x2A, + 0x06, 0x0F, 0x21, 0x2A, + 0x06, 0x0F, 0x18, 0x2A, + 0x06, 0x2E, 0x2E, 0x2E, + 0x06, 0x06, 0x2E, 0x2E, + 0x06, 0x06, 0x06, 0x2E, + 0x06, 0x34, 0x34, 0x34, + 0x06, 0x06, 0x34, 0x34, + 0x06, 0x06, 0x06, 0x34, + 0x07, 0x08, 0x08, 0x09, + 0x07, 0x08, 0x09, 0x0A, + 0x07, 0x09, 0x0A, 0x0B, + 0x07, 0x08, 0x0A, 0x0B, + 0x07, 0x08, 0x09, 0x0B, + 0x07, 0x09, 0x0A, 0x0C, + 0x07, 0x09, 0x0B, 0x0C, + 0x07, 0x08, 0x0B, 0x0C, + 0x07, 0x08, 0x0A, 0x0C, + 0x07, 0x09, 0x0B, 0x0D, + 0x07, 0x0A, 0x0C, 0x0D, + 0x07, 0x08, 0x0C, 0x0D, + 0x07, 0x08, 0x0A, 0x0D, + 0x07, 0x0D, 0x0D, 0x0D, + 0x07, 0x07, 0x0D, 0x0D, + 0x07, 0x07, 0x07, 0x0D, + 0x07, 0x0A, 0x0B, 0x0E, + 0x07, 0x0A, 0x0D, 0x0E, + 0x07, 0x08, 0x0D, 0x0E, + 0x07, 0x08, 0x0B, 0x0E, + 0x07, 0x0A, 0x0C, 0x0F, + 0x07, 0x0B, 0x0D, 0x0F, + 0x07, 0x09, 0x0D, 0x0F, + 0x07, 0x09, 0x0B, 0x0F, + 0x07, 0x0F, 0x0F, 0x0F, + 0x07, 0x07, 0x0F, 0x0F, + 0x07, 0x07, 0x07, 0x0F, + 0x07, 0x0B, 0x0E, 0x12, + 0x07, 0x0C, 0x10, 0x12, + 0x07, 0x09, 0x10, 0x12, + 0x07, 0x09, 0x0D, 0x12, + 0x07, 0x12, 0x12, 0x12, + 0x07, 0x07, 0x12, 0x12, + 0x07, 0x07, 0x07, 0x12, + 0x07, 0x0C, 0x10, 0x15, + 0x07, 0x0E, 0x12, 0x15, + 0x07, 0x0A, 0x12, 0x15, + 0x07, 0x0A, 0x0E, 0x15, + 0x07, 0x15, 0x15, 0x15, + 0x07, 0x07, 0x15, 0x15, + 0x07, 0x07, 0x07, 0x15, + 0x07, 0x0D, 0x12, 0x18, + 0x07, 0x0F, 0x14, 0x18, + 0x07, 0x0B, 0x14, 0x18, + 0x07, 0x0B, 0x10, 0x18, + 0x07, 0x18, 0x18, 0x18, + 0x07, 0x07, 0x18, 0x18, + 0x07, 0x07, 0x07, 0x18, + 0x07, 0x0E, 0x14, 0x1B, + 0x07, 0x11, 0x16, 0x1B, + 0x07, 0x0C, 0x16, 0x1B, + 0x07, 0x0C, 0x11, 0x1B, + 0x07, 0x1B, 0x1B, 0x1B, + 0x07, 0x07, 0x1B, 0x1B, + 0x07, 0x07, 0x07, 0x1B, + 0x07, 0x12, 0x19, 0x1E, + 0x07, 0x0C, 0x19, 0x1E, + 0x07, 0x0C, 0x13, 0x1E, + 0x07, 0x1E, 0x1E, 0x1E, + 0x07, 0x07, 0x1E, 0x1E, + 0x07, 0x07, 0x07, 0x1E, + 0x07, 0x14, 0x1B, 0x21, + 0x07, 0x0D, 0x1B, 0x21, + 0x07, 0x0D, 0x14, 0x21, + 0x07, 0x21, 0x21, 0x21, + 0x07, 0x07, 0x21, 0x21, + 0x07, 0x07, 0x07, 0x21, + 0x07, 0x15, 0x1D, 0x24, + 0x07, 0x0E, 0x1D, 0x24, + 0x07, 0x0E, 0x16, 0x24, + 0x07, 0x24, 0x24, 0x24, + 0x07, 0x07, 0x24, 0x24, + 0x07, 0x07, 0x07, 0x24, + 0x07, 0x17, 0x1F, 0x27, + 0x07, 0x0F, 0x1F, 0x27, + 0x07, 0x0F, 0x17, 0x27, + 0x07, 0x27, 0x27, 0x27, + 0x07, 0x07, 0x27, 0x27, + 0x07, 0x07, 0x07, 0x27, + 0x07, 0x2A, 0x2A, 0x2A, + 0x07, 0x07, 0x2A, 0x2A, + 0x07, 0x07, 0x07, 0x2A, + 0x07, 0x19, 0x22, 0x2B, + 0x07, 0x10, 0x22, 0x2B, + 0x07, 0x10, 0x19, 0x2B, + 0x07, 0x2F, 0x2F, 0x2F, + 0x07, 0x07, 0x2F, 0x2F, + 0x07, 0x07, 0x07, 0x2F, + 0x07, 0x35, 0x35, 0x35, + 0x07, 0x07, 0x35, 0x35, + 0x07, 0x07, 0x07, 0x35, + 0x08, 0x09, 0x09, 0x0A, + 0x08, 0x09, 0x0A, 0x0B, + 0x08, 0x0A, 0x0B, 0x0C, + 0x08, 0x09, 0x0B, 0x0C, + 0x08, 0x09, 0x0A, 0x0C, + 0x08, 0x0A, 0x0B, 0x0D, + 0x08, 0x0A, 0x0C, 0x0D, + 0x08, 0x09, 0x0C, 0x0D, + 0x08, 0x09, 0x0B, 0x0D, + 0x08, 0x0A, 0x0C, 0x0E, + 0x08, 0x0B, 0x0D, 0x0E, + 0x08, 0x09, 0x0D, 0x0E, + 0x08, 0x09, 0x0B, 0x0E, + 0x08, 0x0E, 0x0E, 0x0E, + 0x08, 0x08, 0x0E, 0x0E, + 0x08, 0x08, 0x08, 0x0E, + 0x08, 0x0B, 0x0C, 0x0F, + 0x08, 0x0B, 0x0E, 0x0F, + 0x08, 0x09, 0x0E, 0x0F, + 0x08, 0x09, 0x0C, 0x0F, + 0x08, 0x0B, 0x0D, 0x10, + 0x08, 0x0C, 0x0E, 0x10, + 0x08, 0x0A, 0x0E, 0x10, + 0x08, 0x0A, 0x0C, 0x10, + 0x08, 0x10, 0x10, 0x10, + 0x08, 0x08, 0x10, 0x10, + 0x08, 0x08, 0x08, 0x10, + 0x08, 0x0C, 0x0F, 0x13, + 0x08, 0x0D, 0x11, 0x13, + 0x08, 0x0A, 0x11, 0x13, + 0x08, 0x0A, 0x0E, 0x13, + 0x08, 0x13, 0x13, 0x13, + 0x08, 0x08, 0x13, 0x13, + 0x08, 0x08, 0x08, 0x13, + 0x08, 0x0D, 0x11, 0x16, + 0x08, 0x0F, 0x13, 0x16, + 0x08, 0x0B, 0x13, 0x16, + 0x08, 0x0B, 0x0F, 0x16, + 0x08, 0x16, 0x16, 0x16, + 0x08, 0x08, 0x16, 0x16, + 0x08, 0x08, 0x08, 0x16, + 0x08, 0x0E, 0x13, 0x19, + 0x08, 0x10, 0x15, 0x19, + 0x08, 0x0C, 0x15, 0x19, + 0x08, 0x0C, 0x11, 0x19, + 0x08, 0x19, 0x19, 0x19, + 0x08, 0x08, 0x19, 0x19, + 0x08, 0x08, 0x08, 0x19, + 0x08, 0x0F, 0x15, 0x1C, + 0x08, 0x12, 0x17, 0x1C, + 0x08, 0x0D, 0x17, 0x1C, + 0x08, 0x0D, 0x12, 0x1C, + 0x08, 0x1C, 0x1C, 0x1C, + 0x08, 0x08, 0x1C, 0x1C, + 0x08, 0x08, 0x08, 0x1C, + 0x08, 0x13, 0x1A, 0x1F, + 0x08, 0x0D, 0x1A, 0x1F, + 0x08, 0x0D, 0x14, 0x1F, + 0x08, 0x1F, 0x1F, 0x1F, + 0x08, 0x08, 0x1F, 0x1F, + 0x08, 0x08, 0x08, 0x1F, + 0x08, 0x15, 0x1C, 0x22, + 0x08, 0x0E, 0x1C, 0x22, + 0x08, 0x0E, 0x15, 0x22, + 0x08, 0x22, 0x22, 0x22, + 0x08, 0x08, 0x22, 0x22, + 0x08, 0x08, 0x08, 0x22, + 0x08, 0x16, 0x1E, 0x25, + 0x08, 0x0F, 0x1E, 0x25, + 0x08, 0x0F, 0x17, 0x25, + 0x08, 0x25, 0x25, 0x25, + 0x08, 0x08, 0x25, 0x25, + 0x08, 0x08, 0x08, 0x25, + 0x08, 0x18, 0x20, 0x28, + 0x08, 0x10, 0x20, 0x28, + 0x08, 0x10, 0x18, 0x28, + 0x08, 0x28, 0x28, 0x28, + 0x08, 0x08, 0x28, 0x28, + 0x08, 0x08, 0x08, 0x28, + 0x08, 0x2B, 0x2B, 0x2B, + 0x08, 0x08, 0x2B, 0x2B, + 0x08, 0x08, 0x08, 0x2B, + 0x08, 0x1A, 0x23, 0x2C, + 0x08, 0x11, 0x23, 0x2C, + 0x08, 0x11, 0x1A, 0x2C, + 0x08, 0x30, 0x30, 0x30, + 0x08, 0x08, 0x30, 0x30, + 0x08, 0x08, 0x08, 0x30, + 0x08, 0x36, 0x36, 0x36, + 0x08, 0x08, 0x36, 0x36, + 0x08, 0x08, 0x08, 0x36, + 0x09, 0x0A, 0x0A, 0x0B, + 0x09, 0x0A, 0x0B, 0x0C, + 0x09, 0x0B, 0x0C, 0x0D, + 0x09, 0x0A, 0x0C, 0x0D, + 0x09, 0x0A, 0x0B, 0x0D, + 0x09, 0x0B, 0x0C, 0x0E, + 0x09, 0x0B, 0x0D, 0x0E, + 0x09, 0x0A, 0x0D, 0x0E, + 0x09, 0x0A, 0x0C, 0x0E, + 0x09, 0x0B, 0x0D, 0x0F, + 0x09, 0x0C, 0x0E, 0x0F, + 0x09, 0x0A, 0x0E, 0x0F, + 0x09, 0x0A, 0x0C, 0x0F, + 0x09, 0x0F, 0x0F, 0x0F, + 0x09, 0x09, 0x0F, 0x0F, + 0x09, 0x09, 0x09, 0x0F, + 0x09, 0x0C, 0x0D, 0x10, + 0x09, 0x0C, 0x0F, 0x10, + 0x09, 0x0A, 0x0F, 0x10, + 0x09, 0x0A, 0x0D, 0x10, + 0x09, 0x0C, 0x0E, 0x11, + 0x09, 0x0D, 0x0F, 0x11, + 0x09, 0x0B, 0x0F, 0x11, + 0x09, 0x0B, 0x0D, 0x11, + 0x09, 0x11, 0x11, 0x11, + 0x09, 0x09, 0x11, 0x11, + 0x09, 0x09, 0x09, 0x11, + 0x09, 0x0D, 0x10, 0x14, + 0x09, 0x0E, 0x12, 0x14, + 0x09, 0x0B, 0x12, 0x14, + 0x09, 0x0B, 0x0F, 0x14, + 0x09, 0x14, 0x14, 0x14, + 0x09, 0x09, 0x14, 0x14, + 0x09, 0x09, 0x09, 0x14, + 0x09, 0x0E, 0x12, 0x17, + 0x09, 0x10, 0x14, 0x17, + 0x09, 0x0C, 0x14, 0x17, + 0x09, 0x0C, 0x10, 0x17, + 0x09, 0x17, 0x17, 0x17, + 0x09, 0x09, 0x17, 0x17, + 0x09, 0x09, 0x09, 0x17, + 0x09, 0x0F, 0x14, 0x1A, + 0x09, 0x11, 0x16, 0x1A, + 0x09, 0x0D, 0x16, 0x1A, + 0x09, 0x0D, 0x12, 0x1A, + 0x09, 0x1A, 0x1A, 0x1A, + 0x09, 0x09, 0x1A, 0x1A, + 0x09, 0x09, 0x09, 0x1A, + 0x09, 0x10, 0x16, 0x1D, + 0x09, 0x13, 0x18, 0x1D, + 0x09, 0x0E, 0x18, 0x1D, + 0x09, 0x0E, 0x13, 0x1D, + 0x09, 0x1D, 0x1D, 0x1D, + 0x09, 0x09, 0x1D, 0x1D, + 0x09, 0x09, 0x09, 0x1D, + 0x09, 0x14, 0x1B, 0x20, + 0x09, 0x0E, 0x1B, 0x20, + 0x09, 0x0E, 0x15, 0x20, + 0x09, 0x20, 0x20, 0x20, + 0x09, 0x09, 0x20, 0x20, + 0x09, 0x09, 0x09, 0x20, + 0x09, 0x16, 0x1D, 0x23, + 0x09, 0x0F, 0x1D, 0x23, + 0x09, 0x0F, 0x16, 0x23, + 0x09, 0x23, 0x23, 0x23, + 0x09, 0x09, 0x23, 0x23, + 0x09, 0x09, 0x09, 0x23, + 0x09, 0x17, 0x1F, 0x26, + 0x09, 0x10, 0x1F, 0x26, + 0x09, 0x10, 0x18, 0x26, + 0x09, 0x26, 0x26, 0x26, + 0x09, 0x09, 0x26, 0x26, + 0x09, 0x09, 0x09, 0x26, + 0x09, 0x19, 0x21, 0x29, + 0x09, 0x11, 0x21, 0x29, + 0x09, 0x11, 0x19, 0x29, + 0x09, 0x29, 0x29, 0x29, + 0x09, 0x09, 0x29, 0x29, + 0x09, 0x09, 0x09, 0x29, + 0x09, 0x2C, 0x2C, 0x2C, + 0x09, 0x09, 0x2C, 0x2C, + 0x09, 0x09, 0x09, 0x2C, + 0x09, 0x1B, 0x24, 0x2D, + 0x09, 0x12, 0x24, 0x2D, + 0x09, 0x12, 0x1B, 0x2D, + 0x09, 0x31, 0x31, 0x31, + 0x09, 0x09, 0x31, 0x31, + 0x09, 0x09, 0x09, 0x31, + 0x09, 0x37, 0x37, 0x37, + 0x09, 0x09, 0x37, 0x37, + 0x09, 0x09, 0x09, 0x37, + 0x0A, 0x0B, 0x0B, 0x0C, + 0x0A, 0x0B, 0x0C, 0x0D, + 0x0A, 0x0C, 0x0D, 0x0E, + 0x0A, 0x0B, 0x0D, 0x0E, + 0x0A, 0x0B, 0x0C, 0x0E, + 0x0A, 0x0C, 0x0D, 0x0F, + 0x0A, 0x0C, 0x0E, 0x0F, + 0x0A, 0x0B, 0x0E, 0x0F, + 0x0A, 0x0B, 0x0D, 0x0F, + 0x0A, 0x0C, 0x0E, 0x10, + 0x0A, 0x0D, 0x0F, 0x10, + 0x0A, 0x0B, 0x0F, 0x10, + 0x0A, 0x0B, 0x0D, 0x10, + 0x0A, 0x10, 0x10, 0x10, + 0x0A, 0x0A, 0x10, 0x10, + 0x0A, 0x0A, 0x0A, 0x10, + 0x0A, 0x0D, 0x0E, 0x11, + 0x0A, 0x0D, 0x10, 0x11, + 0x0A, 0x0B, 0x10, 0x11, + 0x0A, 0x0B, 0x0E, 0x11, + 0x0A, 0x0D, 0x0F, 0x12, + 0x0A, 0x0E, 0x10, 0x12, + 0x0A, 0x0C, 0x10, 0x12, + 0x0A, 0x0C, 0x0E, 0x12, + 0x0A, 0x12, 0x12, 0x12, + 0x0A, 0x0A, 0x12, 0x12, + 0x0A, 0x0A, 0x0A, 0x12, + 0x0A, 0x0E, 0x11, 0x15, + 0x0A, 0x0F, 0x13, 0x15, + 0x0A, 0x0C, 0x13, 0x15, + 0x0A, 0x0C, 0x10, 0x15, + 0x0A, 0x15, 0x15, 0x15, + 0x0A, 0x0A, 0x15, 0x15, + 0x0A, 0x0A, 0x0A, 0x15, + 0x0A, 0x0F, 0x13, 0x18, + 0x0A, 0x11, 0x15, 0x18, + 0x0A, 0x0D, 0x15, 0x18, + 0x0A, 0x0D, 0x11, 0x18, + 0x0A, 0x18, 0x18, 0x18, + 0x0A, 0x0A, 0x18, 0x18, + 0x0A, 0x0A, 0x0A, 0x18, + 0x0A, 0x10, 0x15, 0x1B, + 0x0A, 0x12, 0x17, 0x1B, + 0x0A, 0x0E, 0x17, 0x1B, + 0x0A, 0x0E, 0x13, 0x1B, + 0x0A, 0x1B, 0x1B, 0x1B, + 0x0A, 0x0A, 0x1B, 0x1B, + 0x0A, 0x0A, 0x0A, 0x1B, + 0x0A, 0x11, 0x17, 0x1E, + 0x0A, 0x14, 0x19, 0x1E, + 0x0A, 0x0F, 0x19, 0x1E, + 0x0A, 0x0F, 0x14, 0x1E, + 0x0A, 0x1E, 0x1E, 0x1E, + 0x0A, 0x0A, 0x1E, 0x1E, + 0x0A, 0x0A, 0x0A, 0x1E, + 0x0A, 0x15, 0x1C, 0x21, + 0x0A, 0x0F, 0x1C, 0x21, + 0x0A, 0x0F, 0x16, 0x21, + 0x0A, 0x21, 0x21, 0x21, + 0x0A, 0x0A, 0x21, 0x21, + 0x0A, 0x0A, 0x0A, 0x21, + 0x0A, 0x17, 0x1E, 0x24, + 0x0A, 0x10, 0x1E, 0x24, + 0x0A, 0x10, 0x17, 0x24, + 0x0A, 0x24, 0x24, 0x24, + 0x0A, 0x0A, 0x24, 0x24, + 0x0A, 0x0A, 0x0A, 0x24, + 0x0A, 0x18, 0x20, 0x27, + 0x0A, 0x11, 0x20, 0x27, + 0x0A, 0x11, 0x19, 0x27, + 0x0A, 0x27, 0x27, 0x27, + 0x0A, 0x0A, 0x27, 0x27, + 0x0A, 0x0A, 0x0A, 0x27, + 0x0A, 0x1A, 0x22, 0x2A, + 0x0A, 0x12, 0x22, 0x2A, + 0x0A, 0x12, 0x1A, 0x2A, + 0x0A, 0x2A, 0x2A, 0x2A, + 0x0A, 0x0A, 0x2A, 0x2A, + 0x0A, 0x0A, 0x0A, 0x2A, + 0x0A, 0x2D, 0x2D, 0x2D, + 0x0A, 0x0A, 0x2D, 0x2D, + 0x0A, 0x0A, 0x0A, 0x2D, + 0x0A, 0x1C, 0x25, 0x2E, + 0x0A, 0x13, 0x25, 0x2E, + 0x0A, 0x13, 0x1C, 0x2E, + 0x0A, 0x32, 0x32, 0x32, + 0x0A, 0x0A, 0x32, 0x32, + 0x0A, 0x0A, 0x0A, 0x32, + 0x0A, 0x38, 0x38, 0x38, + 0x0A, 0x0A, 0x38, 0x38, + 0x0A, 0x0A, 0x0A, 0x38, + 0x0B, 0x0C, 0x0C, 0x0D, + 0x0B, 0x0C, 0x0D, 0x0E, + 0x0B, 0x0D, 0x0E, 0x0F, + 0x0B, 0x0C, 0x0E, 0x0F, + 0x0B, 0x0C, 0x0D, 0x0F, + 0x0B, 0x0D, 0x0E, 0x10, + 0x0B, 0x0D, 0x0F, 0x10, + 0x0B, 0x0C, 0x0F, 0x10, + 0x0B, 0x0C, 0x0E, 0x10, + 0x0B, 0x0D, 0x0F, 0x11, + 0x0B, 0x0E, 0x10, 0x11, + 0x0B, 0x0C, 0x10, 0x11, + 0x0B, 0x0C, 0x0E, 0x11, + 0x0B, 0x11, 0x11, 0x11, + 0x0B, 0x0B, 0x11, 0x11, + 0x0B, 0x0B, 0x0B, 0x11, + 0x0B, 0x0E, 0x0F, 0x12, + 0x0B, 0x0E, 0x11, 0x12, + 0x0B, 0x0C, 0x11, 0x12, + 0x0B, 0x0C, 0x0F, 0x12, + 0x0B, 0x0E, 0x10, 0x13, + 0x0B, 0x0F, 0x11, 0x13, + 0x0B, 0x0D, 0x11, 0x13, + 0x0B, 0x0D, 0x0F, 0x13, + 0x0B, 0x13, 0x13, 0x13, + 0x0B, 0x0B, 0x13, 0x13, + 0x0B, 0x0B, 0x0B, 0x13, + 0x0B, 0x0F, 0x12, 0x16, + 0x0B, 0x10, 0x14, 0x16, + 0x0B, 0x0D, 0x14, 0x16, + 0x0B, 0x0D, 0x11, 0x16, + 0x0B, 0x16, 0x16, 0x16, + 0x0B, 0x0B, 0x16, 0x16, + 0x0B, 0x0B, 0x0B, 0x16, + 0x0B, 0x10, 0x14, 0x19, + 0x0B, 0x12, 0x16, 0x19, + 0x0B, 0x0E, 0x16, 0x19, + 0x0B, 0x0E, 0x12, 0x19, + 0x0B, 0x19, 0x19, 0x19, + 0x0B, 0x0B, 0x19, 0x19, + 0x0B, 0x0B, 0x0B, 0x19, + 0x0B, 0x11, 0x16, 0x1C, + 0x0B, 0x13, 0x18, 0x1C, + 0x0B, 0x0F, 0x18, 0x1C, + 0x0B, 0x0F, 0x14, 0x1C, + 0x0B, 0x1C, 0x1C, 0x1C, + 0x0B, 0x0B, 0x1C, 0x1C, + 0x0B, 0x0B, 0x0B, 0x1C, + 0x0B, 0x12, 0x18, 0x1F, + 0x0B, 0x15, 0x1A, 0x1F, + 0x0B, 0x10, 0x1A, 0x1F, + 0x0B, 0x10, 0x15, 0x1F, + 0x0B, 0x1F, 0x1F, 0x1F, + 0x0B, 0x0B, 0x1F, 0x1F, + 0x0B, 0x0B, 0x0B, 0x1F, + 0x0B, 0x16, 0x1D, 0x22, + 0x0B, 0x10, 0x1D, 0x22, + 0x0B, 0x10, 0x17, 0x22, + 0x0B, 0x22, 0x22, 0x22, + 0x0B, 0x0B, 0x22, 0x22, + 0x0B, 0x0B, 0x0B, 0x22, + 0x0B, 0x18, 0x1F, 0x25, + 0x0B, 0x11, 0x1F, 0x25, + 0x0B, 0x11, 0x18, 0x25, + 0x0B, 0x25, 0x25, 0x25, + 0x0B, 0x0B, 0x25, 0x25, + 0x0B, 0x0B, 0x0B, 0x25, + 0x0B, 0x19, 0x21, 0x28, + 0x0B, 0x12, 0x21, 0x28, + 0x0B, 0x12, 0x1A, 0x28, + 0x0B, 0x28, 0x28, 0x28, + 0x0B, 0x0B, 0x28, 0x28, + 0x0B, 0x0B, 0x0B, 0x28, + 0x0B, 0x1B, 0x23, 0x2B, + 0x0B, 0x13, 0x23, 0x2B, + 0x0B, 0x13, 0x1B, 0x2B, + 0x0B, 0x2B, 0x2B, 0x2B, + 0x0B, 0x0B, 0x2B, 0x2B, + 0x0B, 0x0B, 0x0B, 0x2B, + 0x0B, 0x2E, 0x2E, 0x2E, + 0x0B, 0x0B, 0x2E, 0x2E, + 0x0B, 0x0B, 0x0B, 0x2E, + 0x0B, 0x1D, 0x26, 0x2F, + 0x0B, 0x14, 0x26, 0x2F, + 0x0B, 0x14, 0x1D, 0x2F, + 0x0B, 0x33, 0x33, 0x33, + 0x0B, 0x0B, 0x33, 0x33, + 0x0B, 0x0B, 0x0B, 0x33, + 0x0B, 0x39, 0x39, 0x39, + 0x0B, 0x0B, 0x39, 0x39, + 0x0B, 0x0B, 0x0B, 0x39, + 0x0C, 0x0D, 0x0D, 0x0E, + 0x0C, 0x0D, 0x0E, 0x0F, + 0x0C, 0x0E, 0x0F, 0x10, + 0x0C, 0x0D, 0x0F, 0x10, + 0x0C, 0x0D, 0x0E, 0x10, + 0x0C, 0x0E, 0x0F, 0x11, + 0x0C, 0x0E, 0x10, 0x11, + 0x0C, 0x0D, 0x10, 0x11, + 0x0C, 0x0D, 0x0F, 0x11, + 0x0C, 0x0E, 0x10, 0x12, + 0x0C, 0x0F, 0x11, 0x12, + 0x0C, 0x0D, 0x11, 0x12, + 0x0C, 0x0D, 0x0F, 0x12, + 0x0C, 0x12, 0x12, 0x12, + 0x0C, 0x0C, 0x12, 0x12, + 0x0C, 0x0C, 0x0C, 0x12, + 0x0C, 0x0F, 0x10, 0x13, + 0x0C, 0x0F, 0x12, 0x13, + 0x0C, 0x0D, 0x12, 0x13, + 0x0C, 0x0D, 0x10, 0x13, + 0x0C, 0x0F, 0x11, 0x14, + 0x0C, 0x10, 0x12, 0x14, + 0x0C, 0x0E, 0x12, 0x14, + 0x0C, 0x0E, 0x10, 0x14, + 0x0C, 0x14, 0x14, 0x14, + 0x0C, 0x0C, 0x14, 0x14, + 0x0C, 0x0C, 0x0C, 0x14, + 0x0C, 0x10, 0x13, 0x17, + 0x0C, 0x11, 0x15, 0x17, + 0x0C, 0x0E, 0x15, 0x17, + 0x0C, 0x0E, 0x12, 0x17, + 0x0C, 0x17, 0x17, 0x17, + 0x0C, 0x0C, 0x17, 0x17, + 0x0C, 0x0C, 0x0C, 0x17, + 0x0C, 0x11, 0x15, 0x1A, + 0x0C, 0x13, 0x17, 0x1A, + 0x0C, 0x0F, 0x17, 0x1A, + 0x0C, 0x0F, 0x13, 0x1A, + 0x0C, 0x1A, 0x1A, 0x1A, + 0x0C, 0x0C, 0x1A, 0x1A, + 0x0C, 0x0C, 0x0C, 0x1A, + 0x0C, 0x12, 0x17, 0x1D, + 0x0C, 0x14, 0x19, 0x1D, + 0x0C, 0x10, 0x19, 0x1D, + 0x0C, 0x10, 0x15, 0x1D, + 0x0C, 0x1D, 0x1D, 0x1D, + 0x0C, 0x0C, 0x1D, 0x1D, + 0x0C, 0x0C, 0x0C, 0x1D, + 0x0C, 0x13, 0x19, 0x20, + 0x0C, 0x16, 0x1B, 0x20, + 0x0C, 0x11, 0x1B, 0x20, + 0x0C, 0x11, 0x16, 0x20, + 0x0C, 0x20, 0x20, 0x20, + 0x0C, 0x0C, 0x20, 0x20, + 0x0C, 0x0C, 0x0C, 0x20, + 0x0C, 0x17, 0x1E, 0x23, + 0x0C, 0x11, 0x1E, 0x23, + 0x0C, 0x11, 0x18, 0x23, + 0x0C, 0x23, 0x23, 0x23, + 0x0C, 0x0C, 0x23, 0x23, + 0x0C, 0x0C, 0x0C, 0x23, + 0x0C, 0x19, 0x20, 0x26, + 0x0C, 0x12, 0x20, 0x26, + 0x0C, 0x12, 0x19, 0x26, + 0x0C, 0x26, 0x26, 0x26, + 0x0C, 0x0C, 0x26, 0x26, + 0x0C, 0x0C, 0x0C, 0x26, + 0x0C, 0x1A, 0x22, 0x29, + 0x0C, 0x13, 0x22, 0x29, + 0x0C, 0x13, 0x1B, 0x29, + 0x0C, 0x29, 0x29, 0x29, + 0x0C, 0x0C, 0x29, 0x29, + 0x0C, 0x0C, 0x0C, 0x29, + 0x0C, 0x1C, 0x24, 0x2C, + 0x0C, 0x14, 0x24, 0x2C, + 0x0C, 0x14, 0x1C, 0x2C, + 0x0C, 0x2C, 0x2C, 0x2C, + 0x0C, 0x0C, 0x2C, 0x2C, + 0x0C, 0x0C, 0x0C, 0x2C, + 0x0C, 0x2F, 0x2F, 0x2F, + 0x0C, 0x0C, 0x2F, 0x2F, + 0x0C, 0x0C, 0x0C, 0x2F, + 0x0C, 0x1E, 0x27, 0x30, + 0x0C, 0x15, 0x27, 0x30, + 0x0C, 0x15, 0x1E, 0x30, + 0x0C, 0x34, 0x34, 0x34, + 0x0C, 0x0C, 0x34, 0x34, + 0x0C, 0x0C, 0x0C, 0x34, + 0x0C, 0x3A, 0x3A, 0x3A, + 0x0C, 0x0C, 0x3A, 0x3A, + 0x0C, 0x0C, 0x0C, 0x3A, + 0x0D, 0x0E, 0x0E, 0x0F, + 0x0D, 0x0E, 0x0F, 0x10, + 0x0D, 0x0F, 0x10, 0x11, + 0x0D, 0x0E, 0x10, 0x11, + 0x0D, 0x0E, 0x0F, 0x11, + 0x0D, 0x0F, 0x10, 0x12, + 0x0D, 0x0F, 0x11, 0x12, + 0x0D, 0x0E, 0x11, 0x12, + 0x0D, 0x0E, 0x10, 0x12, + 0x0D, 0x0F, 0x11, 0x13, + 0x0D, 0x10, 0x12, 0x13, + 0x0D, 0x0E, 0x12, 0x13, + 0x0D, 0x0E, 0x10, 0x13, + 0x0D, 0x13, 0x13, 0x13, + 0x0D, 0x0D, 0x13, 0x13, + 0x0D, 0x0D, 0x0D, 0x13, + 0x0D, 0x10, 0x11, 0x14, + 0x0D, 0x10, 0x13, 0x14, + 0x0D, 0x0E, 0x13, 0x14, + 0x0D, 0x0E, 0x11, 0x14, + 0x0D, 0x10, 0x12, 0x15, + 0x0D, 0x11, 0x13, 0x15, + 0x0D, 0x0F, 0x13, 0x15, + 0x0D, 0x0F, 0x11, 0x15, + 0x0D, 0x15, 0x15, 0x15, + 0x0D, 0x0D, 0x15, 0x15, + 0x0D, 0x0D, 0x0D, 0x15, + 0x0D, 0x11, 0x14, 0x18, + 0x0D, 0x12, 0x16, 0x18, + 0x0D, 0x0F, 0x16, 0x18, + 0x0D, 0x0F, 0x13, 0x18, + 0x0D, 0x18, 0x18, 0x18, + 0x0D, 0x0D, 0x18, 0x18, + 0x0D, 0x0D, 0x0D, 0x18, + 0x0D, 0x12, 0x16, 0x1B, + 0x0D, 0x14, 0x18, 0x1B, + 0x0D, 0x10, 0x18, 0x1B, + 0x0D, 0x10, 0x14, 0x1B, + 0x0D, 0x1B, 0x1B, 0x1B, + 0x0D, 0x0D, 0x1B, 0x1B, + 0x0D, 0x0D, 0x0D, 0x1B, + 0x0D, 0x13, 0x18, 0x1E, + 0x0D, 0x15, 0x1A, 0x1E, + 0x0D, 0x11, 0x1A, 0x1E, + 0x0D, 0x11, 0x16, 0x1E, + 0x0D, 0x1E, 0x1E, 0x1E, + 0x0D, 0x0D, 0x1E, 0x1E, + 0x0D, 0x0D, 0x0D, 0x1E, + 0x0D, 0x14, 0x1A, 0x21, + 0x0D, 0x17, 0x1C, 0x21, + 0x0D, 0x12, 0x1C, 0x21, + 0x0D, 0x12, 0x17, 0x21, + 0x0D, 0x21, 0x21, 0x21, + 0x0D, 0x0D, 0x21, 0x21, + 0x0D, 0x0D, 0x0D, 0x21, + 0x0D, 0x18, 0x1F, 0x24, + 0x0D, 0x12, 0x1F, 0x24, + 0x0D, 0x12, 0x19, 0x24, + 0x0D, 0x24, 0x24, 0x24, + 0x0D, 0x0D, 0x24, 0x24, + 0x0D, 0x0D, 0x0D, 0x24, + 0x0D, 0x1A, 0x21, 0x27, + 0x0D, 0x13, 0x21, 0x27, + 0x0D, 0x13, 0x1A, 0x27, + 0x0D, 0x27, 0x27, 0x27, + 0x0D, 0x0D, 0x27, 0x27, + 0x0D, 0x0D, 0x0D, 0x27, + 0x0D, 0x1B, 0x23, 0x2A, + 0x0D, 0x14, 0x23, 0x2A, + 0x0D, 0x14, 0x1C, 0x2A, + 0x0D, 0x2A, 0x2A, 0x2A, + 0x0D, 0x0D, 0x2A, 0x2A, + 0x0D, 0x0D, 0x0D, 0x2A, + 0x0D, 0x1D, 0x25, 0x2D, + 0x0D, 0x15, 0x25, 0x2D, + 0x0D, 0x15, 0x1D, 0x2D, + 0x0D, 0x2D, 0x2D, 0x2D, + 0x0D, 0x0D, 0x2D, 0x2D, + 0x0D, 0x0D, 0x0D, 0x2D, + 0x0D, 0x30, 0x30, 0x30, + 0x0D, 0x0D, 0x30, 0x30, + 0x0D, 0x0D, 0x0D, 0x30, + 0x0D, 0x1F, 0x28, 0x31, + 0x0D, 0x16, 0x28, 0x31, + 0x0D, 0x16, 0x1F, 0x31, + 0x0D, 0x35, 0x35, 0x35, + 0x0D, 0x0D, 0x35, 0x35, + 0x0D, 0x0D, 0x0D, 0x35, + 0x0D, 0x3B, 0x3B, 0x3B, + 0x0D, 0x0D, 0x3B, 0x3B, + 0x0D, 0x0D, 0x0D, 0x3B, + 0x0E, 0x0F, 0x0F, 0x10, + 0x0E, 0x0F, 0x10, 0x11, + 0x0E, 0x10, 0x11, 0x12, + 0x0E, 0x0F, 0x11, 0x12, + 0x0E, 0x0F, 0x10, 0x12, + 0x0E, 0x10, 0x11, 0x13, + 0x0E, 0x10, 0x12, 0x13, + 0x0E, 0x0F, 0x12, 0x13, + 0x0E, 0x0F, 0x11, 0x13, + 0x0E, 0x10, 0x12, 0x14, + 0x0E, 0x11, 0x13, 0x14, + 0x0E, 0x0F, 0x13, 0x14, + 0x0E, 0x0F, 0x11, 0x14, + 0x0E, 0x14, 0x14, 0x14, + 0x0E, 0x0E, 0x14, 0x14, + 0x0E, 0x0E, 0x0E, 0x14, + 0x0E, 0x11, 0x12, 0x15, + 0x0E, 0x11, 0x14, 0x15, + 0x0E, 0x0F, 0x14, 0x15, + 0x0E, 0x0F, 0x12, 0x15, + 0x0E, 0x11, 0x13, 0x16, + 0x0E, 0x12, 0x14, 0x16, + 0x0E, 0x10, 0x14, 0x16, + 0x0E, 0x10, 0x12, 0x16, + 0x0E, 0x16, 0x16, 0x16, + 0x0E, 0x0E, 0x16, 0x16, + 0x0E, 0x0E, 0x0E, 0x16, + 0x0E, 0x12, 0x15, 0x19, + 0x0E, 0x13, 0x17, 0x19, + 0x0E, 0x10, 0x17, 0x19, + 0x0E, 0x10, 0x14, 0x19, + 0x0E, 0x19, 0x19, 0x19, + 0x0E, 0x0E, 0x19, 0x19, + 0x0E, 0x0E, 0x0E, 0x19, + 0x0E, 0x13, 0x17, 0x1C, + 0x0E, 0x15, 0x19, 0x1C, + 0x0E, 0x11, 0x19, 0x1C, + 0x0E, 0x11, 0x15, 0x1C, + 0x0E, 0x1C, 0x1C, 0x1C, + 0x0E, 0x0E, 0x1C, 0x1C, + 0x0E, 0x0E, 0x0E, 0x1C, + 0x0E, 0x14, 0x19, 0x1F, + 0x0E, 0x16, 0x1B, 0x1F, + 0x0E, 0x12, 0x1B, 0x1F, + 0x0E, 0x12, 0x17, 0x1F, + 0x0E, 0x1F, 0x1F, 0x1F, + 0x0E, 0x0E, 0x1F, 0x1F, + 0x0E, 0x0E, 0x0E, 0x1F, + 0x0E, 0x15, 0x1B, 0x22, + 0x0E, 0x18, 0x1D, 0x22, + 0x0E, 0x13, 0x1D, 0x22, + 0x0E, 0x13, 0x18, 0x22, + 0x0E, 0x22, 0x22, 0x22, + 0x0E, 0x0E, 0x22, 0x22, + 0x0E, 0x0E, 0x0E, 0x22, + 0x0E, 0x19, 0x20, 0x25, + 0x0E, 0x13, 0x20, 0x25, + 0x0E, 0x13, 0x1A, 0x25, + 0x0E, 0x25, 0x25, 0x25, + 0x0E, 0x0E, 0x25, 0x25, + 0x0E, 0x0E, 0x0E, 0x25, + 0x0E, 0x1B, 0x22, 0x28, + 0x0E, 0x14, 0x22, 0x28, + 0x0E, 0x14, 0x1B, 0x28, + 0x0E, 0x28, 0x28, 0x28, + 0x0E, 0x0E, 0x28, 0x28, + 0x0E, 0x0E, 0x0E, 0x28, + 0x0E, 0x1C, 0x24, 0x2B, + 0x0E, 0x15, 0x24, 0x2B, + 0x0E, 0x15, 0x1D, 0x2B, + 0x0E, 0x2B, 0x2B, 0x2B, + 0x0E, 0x0E, 0x2B, 0x2B, + 0x0E, 0x0E, 0x0E, 0x2B, + 0x0E, 0x1E, 0x26, 0x2E, + 0x0E, 0x16, 0x26, 0x2E, + 0x0E, 0x16, 0x1E, 0x2E, + 0x0E, 0x2E, 0x2E, 0x2E, + 0x0E, 0x0E, 0x2E, 0x2E, + 0x0E, 0x0E, 0x0E, 0x2E, + 0x0E, 0x31, 0x31, 0x31, + 0x0E, 0x0E, 0x31, 0x31, + 0x0E, 0x0E, 0x0E, 0x31, + 0x0E, 0x20, 0x29, 0x32, + 0x0E, 0x17, 0x29, 0x32, + 0x0E, 0x17, 0x20, 0x32, + 0x0E, 0x36, 0x36, 0x36, + 0x0E, 0x0E, 0x36, 0x36, + 0x0E, 0x0E, 0x0E, 0x36, + 0x0E, 0x3C, 0x3C, 0x3C, + 0x0E, 0x0E, 0x3C, 0x3C, + 0x0E, 0x0E, 0x0E, 0x3C, + 0x0F, 0x10, 0x10, 0x11, + 0x0F, 0x10, 0x11, 0x12, + 0x0F, 0x11, 0x12, 0x13, + 0x0F, 0x10, 0x12, 0x13, + 0x0F, 0x10, 0x11, 0x13, + 0x0F, 0x11, 0x12, 0x14, + 0x0F, 0x11, 0x13, 0x14, + 0x0F, 0x10, 0x13, 0x14, + 0x0F, 0x10, 0x12, 0x14, + 0x0F, 0x11, 0x13, 0x15, + 0x0F, 0x12, 0x14, 0x15, + 0x0F, 0x10, 0x14, 0x15, + 0x0F, 0x10, 0x12, 0x15, + 0x0F, 0x15, 0x15, 0x15, + 0x0F, 0x0F, 0x15, 0x15, + 0x0F, 0x0F, 0x0F, 0x15, + 0x0F, 0x12, 0x13, 0x16, + 0x0F, 0x12, 0x15, 0x16, + 0x0F, 0x10, 0x15, 0x16, + 0x0F, 0x10, 0x13, 0x16, + 0x0F, 0x12, 0x14, 0x17, + 0x0F, 0x13, 0x15, 0x17, + 0x0F, 0x11, 0x15, 0x17, + 0x0F, 0x11, 0x13, 0x17, + 0x0F, 0x17, 0x17, 0x17, + 0x0F, 0x0F, 0x17, 0x17, + 0x0F, 0x0F, 0x0F, 0x17, + 0x0F, 0x13, 0x16, 0x1A, + 0x0F, 0x14, 0x18, 0x1A, + 0x0F, 0x11, 0x18, 0x1A, + 0x0F, 0x11, 0x15, 0x1A, + 0x0F, 0x1A, 0x1A, 0x1A, + 0x0F, 0x0F, 0x1A, 0x1A, + 0x0F, 0x0F, 0x0F, 0x1A, + 0x0F, 0x14, 0x18, 0x1D, + 0x0F, 0x16, 0x1A, 0x1D, + 0x0F, 0x12, 0x1A, 0x1D, + 0x0F, 0x12, 0x16, 0x1D, + 0x0F, 0x1D, 0x1D, 0x1D, + 0x0F, 0x0F, 0x1D, 0x1D, + 0x0F, 0x0F, 0x0F, 0x1D, + 0x0F, 0x15, 0x1A, 0x20, + 0x0F, 0x17, 0x1C, 0x20, + 0x0F, 0x13, 0x1C, 0x20, + 0x0F, 0x13, 0x18, 0x20, + 0x0F, 0x20, 0x20, 0x20, + 0x0F, 0x0F, 0x20, 0x20, + 0x0F, 0x0F, 0x0F, 0x20, + 0x0F, 0x16, 0x1C, 0x23, + 0x0F, 0x19, 0x1E, 0x23, + 0x0F, 0x14, 0x1E, 0x23, + 0x0F, 0x14, 0x19, 0x23, + 0x0F, 0x23, 0x23, 0x23, + 0x0F, 0x0F, 0x23, 0x23, + 0x0F, 0x0F, 0x0F, 0x23, + 0x0F, 0x1A, 0x21, 0x26, + 0x0F, 0x14, 0x21, 0x26, + 0x0F, 0x14, 0x1B, 0x26, + 0x0F, 0x26, 0x26, 0x26, + 0x0F, 0x0F, 0x26, 0x26, + 0x0F, 0x0F, 0x0F, 0x26, + 0x0F, 0x1C, 0x23, 0x29, + 0x0F, 0x15, 0x23, 0x29, + 0x0F, 0x15, 0x1C, 0x29, + 0x0F, 0x29, 0x29, 0x29, + 0x0F, 0x0F, 0x29, 0x29, + 0x0F, 0x0F, 0x0F, 0x29, + 0x0F, 0x1D, 0x25, 0x2C, + 0x0F, 0x16, 0x25, 0x2C, + 0x0F, 0x16, 0x1E, 0x2C, + 0x0F, 0x2C, 0x2C, 0x2C, + 0x0F, 0x0F, 0x2C, 0x2C, + 0x0F, 0x0F, 0x0F, 0x2C, + 0x0F, 0x1F, 0x27, 0x2F, + 0x0F, 0x17, 0x27, 0x2F, + 0x0F, 0x17, 0x1F, 0x2F, + 0x0F, 0x2F, 0x2F, 0x2F, + 0x0F, 0x0F, 0x2F, 0x2F, + 0x0F, 0x0F, 0x0F, 0x2F, + 0x0F, 0x32, 0x32, 0x32, + 0x0F, 0x0F, 0x32, 0x32, + 0x0F, 0x0F, 0x0F, 0x32, + 0x0F, 0x21, 0x2A, 0x33, + 0x0F, 0x18, 0x2A, 0x33, + 0x0F, 0x18, 0x21, 0x33, + 0x0F, 0x37, 0x37, 0x37, + 0x0F, 0x0F, 0x37, 0x37, + 0x0F, 0x0F, 0x0F, 0x37, + 0x0F, 0x3D, 0x3D, 0x3D, + 0x0F, 0x0F, 0x3D, 0x3D, + 0x0F, 0x0F, 0x0F, 0x3D, + 0x10, 0x11, 0x11, 0x12, + 0x10, 0x11, 0x12, 0x13, + 0x10, 0x12, 0x13, 0x14, + 0x10, 0x11, 0x13, 0x14, + 0x10, 0x11, 0x12, 0x14, + 0x10, 0x12, 0x13, 0x15, + 0x10, 0x12, 0x14, 0x15, + 0x10, 0x11, 0x14, 0x15, + 0x10, 0x11, 0x13, 0x15, + 0x10, 0x12, 0x14, 0x16, + 0x10, 0x13, 0x15, 0x16, + 0x10, 0x11, 0x15, 0x16, + 0x10, 0x11, 0x13, 0x16, + 0x10, 0x16, 0x16, 0x16, + 0x10, 0x10, 0x16, 0x16, + 0x10, 0x10, 0x10, 0x16, + 0x10, 0x13, 0x14, 0x17, + 0x10, 0x13, 0x16, 0x17, + 0x10, 0x11, 0x16, 0x17, + 0x10, 0x11, 0x14, 0x17, + 0x10, 0x13, 0x15, 0x18, + 0x10, 0x14, 0x16, 0x18, + 0x10, 0x12, 0x16, 0x18, + 0x10, 0x12, 0x14, 0x18, + 0x10, 0x18, 0x18, 0x18, + 0x10, 0x10, 0x18, 0x18, + 0x10, 0x10, 0x10, 0x18, + 0x10, 0x14, 0x17, 0x1B, + 0x10, 0x15, 0x19, 0x1B, + 0x10, 0x12, 0x19, 0x1B, + 0x10, 0x12, 0x16, 0x1B, + 0x10, 0x1B, 0x1B, 0x1B, + 0x10, 0x10, 0x1B, 0x1B, + 0x10, 0x10, 0x10, 0x1B, + 0x10, 0x15, 0x19, 0x1E, + 0x10, 0x17, 0x1B, 0x1E, + 0x10, 0x13, 0x1B, 0x1E, + 0x10, 0x13, 0x17, 0x1E, + 0x10, 0x1E, 0x1E, 0x1E, + 0x10, 0x10, 0x1E, 0x1E, + 0x10, 0x10, 0x10, 0x1E, + 0x10, 0x16, 0x1B, 0x21, + 0x10, 0x18, 0x1D, 0x21, + 0x10, 0x14, 0x1D, 0x21, + 0x10, 0x14, 0x19, 0x21, + 0x10, 0x21, 0x21, 0x21, + 0x10, 0x10, 0x21, 0x21, + 0x10, 0x10, 0x10, 0x21, + 0x10, 0x17, 0x1D, 0x24, + 0x10, 0x1A, 0x1F, 0x24, + 0x10, 0x15, 0x1F, 0x24, + 0x10, 0x15, 0x1A, 0x24, + 0x10, 0x24, 0x24, 0x24, + 0x10, 0x10, 0x24, 0x24, + 0x10, 0x10, 0x10, 0x24, + 0x10, 0x1B, 0x22, 0x27, + 0x10, 0x15, 0x22, 0x27, + 0x10, 0x15, 0x1C, 0x27, + 0x10, 0x27, 0x27, 0x27, + 0x10, 0x10, 0x27, 0x27, + 0x10, 0x10, 0x10, 0x27, + 0x10, 0x1D, 0x24, 0x2A, + 0x10, 0x16, 0x24, 0x2A, + 0x10, 0x16, 0x1D, 0x2A, + 0x10, 0x2A, 0x2A, 0x2A, + 0x10, 0x10, 0x2A, 0x2A, + 0x10, 0x10, 0x10, 0x2A, + 0x10, 0x1E, 0x26, 0x2D, + 0x10, 0x17, 0x26, 0x2D, + 0x10, 0x17, 0x1F, 0x2D, + 0x10, 0x2D, 0x2D, 0x2D, + 0x10, 0x10, 0x2D, 0x2D, + 0x10, 0x10, 0x10, 0x2D, + 0x10, 0x20, 0x28, 0x30, + 0x10, 0x18, 0x28, 0x30, + 0x10, 0x18, 0x20, 0x30, + 0x10, 0x30, 0x30, 0x30, + 0x10, 0x10, 0x30, 0x30, + 0x10, 0x10, 0x10, 0x30, + 0x10, 0x33, 0x33, 0x33, + 0x10, 0x10, 0x33, 0x33, + 0x10, 0x10, 0x10, 0x33, + 0x10, 0x22, 0x2B, 0x34, + 0x10, 0x19, 0x2B, 0x34, + 0x10, 0x19, 0x22, 0x34, + 0x10, 0x38, 0x38, 0x38, + 0x10, 0x10, 0x38, 0x38, + 0x10, 0x10, 0x10, 0x38, + 0x10, 0x3E, 0x3E, 0x3E, + 0x10, 0x10, 0x3E, 0x3E, + 0x10, 0x10, 0x10, 0x3E, + 0x11, 0x12, 0x12, 0x13, + 0x11, 0x12, 0x13, 0x14, + 0x11, 0x13, 0x14, 0x15, + 0x11, 0x12, 0x14, 0x15, + 0x11, 0x12, 0x13, 0x15, + 0x11, 0x13, 0x14, 0x16, + 0x11, 0x13, 0x15, 0x16, + 0x11, 0x12, 0x15, 0x16, + 0x11, 0x12, 0x14, 0x16, + 0x11, 0x13, 0x15, 0x17, + 0x11, 0x14, 0x16, 0x17, + 0x11, 0x12, 0x16, 0x17, + 0x11, 0x12, 0x14, 0x17, + 0x11, 0x17, 0x17, 0x17, + 0x11, 0x11, 0x17, 0x17, + 0x11, 0x11, 0x11, 0x17, + 0x11, 0x14, 0x15, 0x18, + 0x11, 0x14, 0x17, 0x18, + 0x11, 0x12, 0x17, 0x18, + 0x11, 0x12, 0x15, 0x18, + 0x11, 0x14, 0x16, 0x19, + 0x11, 0x15, 0x17, 0x19, + 0x11, 0x13, 0x17, 0x19, + 0x11, 0x13, 0x15, 0x19, + 0x11, 0x19, 0x19, 0x19, + 0x11, 0x11, 0x19, 0x19, + 0x11, 0x11, 0x11, 0x19, + 0x11, 0x15, 0x18, 0x1C, + 0x11, 0x16, 0x1A, 0x1C, + 0x11, 0x13, 0x1A, 0x1C, + 0x11, 0x13, 0x17, 0x1C, + 0x11, 0x1C, 0x1C, 0x1C, + 0x11, 0x11, 0x1C, 0x1C, + 0x11, 0x11, 0x11, 0x1C, + 0x11, 0x16, 0x1A, 0x1F, + 0x11, 0x18, 0x1C, 0x1F, + 0x11, 0x14, 0x1C, 0x1F, + 0x11, 0x14, 0x18, 0x1F, + 0x11, 0x1F, 0x1F, 0x1F, + 0x11, 0x11, 0x1F, 0x1F, + 0x11, 0x11, 0x11, 0x1F, + 0x11, 0x17, 0x1C, 0x22, + 0x11, 0x19, 0x1E, 0x22, + 0x11, 0x15, 0x1E, 0x22, + 0x11, 0x15, 0x1A, 0x22, + 0x11, 0x22, 0x22, 0x22, + 0x11, 0x11, 0x22, 0x22, + 0x11, 0x11, 0x11, 0x22, + 0x11, 0x18, 0x1E, 0x25, + 0x11, 0x1B, 0x20, 0x25, + 0x11, 0x16, 0x20, 0x25, + 0x11, 0x16, 0x1B, 0x25, + 0x11, 0x25, 0x25, 0x25, + 0x11, 0x11, 0x25, 0x25, + 0x11, 0x11, 0x11, 0x25, + 0x11, 0x1C, 0x23, 0x28, + 0x11, 0x16, 0x23, 0x28, + 0x11, 0x16, 0x1D, 0x28, + 0x11, 0x28, 0x28, 0x28, + 0x11, 0x11, 0x28, 0x28, + 0x11, 0x11, 0x11, 0x28, + 0x11, 0x1E, 0x25, 0x2B, + 0x11, 0x17, 0x25, 0x2B, + 0x11, 0x17, 0x1E, 0x2B, + 0x11, 0x2B, 0x2B, 0x2B, + 0x11, 0x11, 0x2B, 0x2B, + 0x11, 0x11, 0x11, 0x2B, + 0x11, 0x1F, 0x27, 0x2E, + 0x11, 0x18, 0x27, 0x2E, + 0x11, 0x18, 0x20, 0x2E, + 0x11, 0x2E, 0x2E, 0x2E, + 0x11, 0x11, 0x2E, 0x2E, + 0x11, 0x11, 0x11, 0x2E, + 0x11, 0x21, 0x29, 0x31, + 0x11, 0x19, 0x29, 0x31, + 0x11, 0x19, 0x21, 0x31, + 0x11, 0x31, 0x31, 0x31, + 0x11, 0x11, 0x31, 0x31, + 0x11, 0x11, 0x11, 0x31, + 0x11, 0x34, 0x34, 0x34, + 0x11, 0x11, 0x34, 0x34, + 0x11, 0x11, 0x11, 0x34, + 0x11, 0x23, 0x2C, 0x35, + 0x11, 0x1A, 0x2C, 0x35, + 0x11, 0x1A, 0x23, 0x35, + 0x11, 0x39, 0x39, 0x39, + 0x11, 0x11, 0x39, 0x39, + 0x11, 0x11, 0x11, 0x39, + 0x11, 0x3F, 0x3F, 0x3F, + 0x11, 0x11, 0x3F, 0x3F, + 0x11, 0x11, 0x11, 0x3F, + 0x12, 0x13, 0x13, 0x14, + 0x12, 0x13, 0x14, 0x15, + 0x12, 0x14, 0x15, 0x16, + 0x12, 0x13, 0x15, 0x16, + 0x12, 0x13, 0x14, 0x16, + 0x12, 0x14, 0x15, 0x17, + 0x12, 0x14, 0x16, 0x17, + 0x12, 0x13, 0x16, 0x17, + 0x12, 0x13, 0x15, 0x17, + 0x12, 0x14, 0x16, 0x18, + 0x12, 0x15, 0x17, 0x18, + 0x12, 0x13, 0x17, 0x18, + 0x12, 0x13, 0x15, 0x18, + 0x12, 0x18, 0x18, 0x18, + 0x12, 0x12, 0x18, 0x18, + 0x12, 0x12, 0x12, 0x18, + 0x12, 0x15, 0x16, 0x19, + 0x12, 0x15, 0x18, 0x19, + 0x12, 0x13, 0x18, 0x19, + 0x12, 0x13, 0x16, 0x19, + 0x12, 0x15, 0x17, 0x1A, + 0x12, 0x16, 0x18, 0x1A, + 0x12, 0x14, 0x18, 0x1A, + 0x12, 0x14, 0x16, 0x1A, + 0x12, 0x1A, 0x1A, 0x1A, + 0x12, 0x12, 0x1A, 0x1A, + 0x12, 0x12, 0x12, 0x1A, + 0x12, 0x16, 0x19, 0x1D, + 0x12, 0x17, 0x1B, 0x1D, + 0x12, 0x14, 0x1B, 0x1D, + 0x12, 0x14, 0x18, 0x1D, + 0x12, 0x1D, 0x1D, 0x1D, + 0x12, 0x12, 0x1D, 0x1D, + 0x12, 0x12, 0x12, 0x1D, + 0x12, 0x17, 0x1B, 0x20, + 0x12, 0x19, 0x1D, 0x20, + 0x12, 0x15, 0x1D, 0x20, + 0x12, 0x15, 0x19, 0x20, + 0x12, 0x20, 0x20, 0x20, + 0x12, 0x12, 0x20, 0x20, + 0x12, 0x12, 0x12, 0x20, + 0x12, 0x18, 0x1D, 0x23, + 0x12, 0x1A, 0x1F, 0x23, + 0x12, 0x16, 0x1F, 0x23, + 0x12, 0x16, 0x1B, 0x23, + 0x12, 0x23, 0x23, 0x23, + 0x12, 0x12, 0x23, 0x23, + 0x12, 0x12, 0x12, 0x23, + 0x12, 0x19, 0x1F, 0x26, + 0x12, 0x1C, 0x21, 0x26, + 0x12, 0x17, 0x21, 0x26, + 0x12, 0x17, 0x1C, 0x26, + 0x12, 0x26, 0x26, 0x26, + 0x12, 0x12, 0x26, 0x26, + 0x12, 0x12, 0x12, 0x26, + 0x12, 0x1D, 0x24, 0x29, + 0x12, 0x17, 0x24, 0x29, + 0x12, 0x17, 0x1E, 0x29, + 0x12, 0x29, 0x29, 0x29, + 0x12, 0x12, 0x29, 0x29, + 0x12, 0x12, 0x12, 0x29, + 0x12, 0x1F, 0x26, 0x2C, + 0x12, 0x18, 0x26, 0x2C, + 0x12, 0x18, 0x1F, 0x2C, + 0x12, 0x2C, 0x2C, 0x2C, + 0x12, 0x12, 0x2C, 0x2C, + 0x12, 0x12, 0x12, 0x2C, + 0x12, 0x20, 0x28, 0x2F, + 0x12, 0x19, 0x28, 0x2F, + 0x12, 0x19, 0x21, 0x2F, + 0x12, 0x2F, 0x2F, 0x2F, + 0x12, 0x12, 0x2F, 0x2F, + 0x12, 0x12, 0x12, 0x2F, + 0x12, 0x22, 0x2A, 0x32, + 0x12, 0x1A, 0x2A, 0x32, + 0x12, 0x1A, 0x22, 0x32, + 0x12, 0x32, 0x32, 0x32, + 0x12, 0x12, 0x32, 0x32, + 0x12, 0x12, 0x12, 0x32, + 0x12, 0x35, 0x35, 0x35, + 0x12, 0x12, 0x35, 0x35, + 0x12, 0x12, 0x12, 0x35, + 0x12, 0x24, 0x2D, 0x36, + 0x12, 0x1B, 0x2D, 0x36, + 0x12, 0x1B, 0x24, 0x36, + 0x12, 0x3A, 0x3A, 0x3A, + 0x12, 0x12, 0x3A, 0x3A, + 0x12, 0x12, 0x12, 0x3A, + 0x13, 0x14, 0x14, 0x15, + 0x13, 0x14, 0x15, 0x16, + 0x13, 0x15, 0x16, 0x17, + 0x13, 0x14, 0x16, 0x17, + 0x13, 0x14, 0x15, 0x17, + 0x13, 0x15, 0x16, 0x18, + 0x13, 0x15, 0x17, 0x18, + 0x13, 0x14, 0x17, 0x18, + 0x13, 0x14, 0x16, 0x18, + 0x13, 0x15, 0x17, 0x19, + 0x13, 0x16, 0x18, 0x19, + 0x13, 0x14, 0x18, 0x19, + 0x13, 0x14, 0x16, 0x19, + 0x13, 0x19, 0x19, 0x19, + 0x13, 0x13, 0x19, 0x19, + 0x13, 0x13, 0x13, 0x19, + 0x13, 0x16, 0x17, 0x1A, + 0x13, 0x16, 0x19, 0x1A, + 0x13, 0x14, 0x19, 0x1A, + 0x13, 0x14, 0x17, 0x1A, + 0x13, 0x16, 0x18, 0x1B, + 0x13, 0x17, 0x19, 0x1B, + 0x13, 0x15, 0x19, 0x1B, + 0x13, 0x15, 0x17, 0x1B, + 0x13, 0x1B, 0x1B, 0x1B, + 0x13, 0x13, 0x1B, 0x1B, + 0x13, 0x13, 0x13, 0x1B, + 0x13, 0x17, 0x1A, 0x1E, + 0x13, 0x18, 0x1C, 0x1E, + 0x13, 0x15, 0x1C, 0x1E, + 0x13, 0x15, 0x19, 0x1E, + 0x13, 0x1E, 0x1E, 0x1E, + 0x13, 0x13, 0x1E, 0x1E, + 0x13, 0x13, 0x13, 0x1E, + 0x13, 0x18, 0x1C, 0x21, + 0x13, 0x1A, 0x1E, 0x21, + 0x13, 0x16, 0x1E, 0x21, + 0x13, 0x16, 0x1A, 0x21, + 0x13, 0x21, 0x21, 0x21, + 0x13, 0x13, 0x21, 0x21, + 0x13, 0x13, 0x13, 0x21, + 0x13, 0x19, 0x1E, 0x24, + 0x13, 0x1B, 0x20, 0x24, + 0x13, 0x17, 0x20, 0x24, + 0x13, 0x17, 0x1C, 0x24, + 0x13, 0x24, 0x24, 0x24, + 0x13, 0x13, 0x24, 0x24, + 0x13, 0x13, 0x13, 0x24, + 0x13, 0x1A, 0x20, 0x27, + 0x13, 0x1D, 0x22, 0x27, + 0x13, 0x18, 0x22, 0x27, + 0x13, 0x18, 0x1D, 0x27, + 0x13, 0x27, 0x27, 0x27, + 0x13, 0x13, 0x27, 0x27, + 0x13, 0x13, 0x13, 0x27, + 0x13, 0x1E, 0x25, 0x2A, + 0x13, 0x18, 0x25, 0x2A, + 0x13, 0x18, 0x1F, 0x2A, + 0x13, 0x2A, 0x2A, 0x2A, + 0x13, 0x13, 0x2A, 0x2A, + 0x13, 0x13, 0x13, 0x2A, + 0x13, 0x20, 0x27, 0x2D, + 0x13, 0x19, 0x27, 0x2D, + 0x13, 0x19, 0x20, 0x2D, + 0x13, 0x2D, 0x2D, 0x2D, + 0x13, 0x13, 0x2D, 0x2D, + 0x13, 0x13, 0x13, 0x2D, + 0x13, 0x21, 0x29, 0x30, + 0x13, 0x1A, 0x29, 0x30, + 0x13, 0x1A, 0x22, 0x30, + 0x13, 0x30, 0x30, 0x30, + 0x13, 0x13, 0x30, 0x30, + 0x13, 0x13, 0x13, 0x30, + 0x13, 0x23, 0x2B, 0x33, + 0x13, 0x1B, 0x2B, 0x33, + 0x13, 0x1B, 0x23, 0x33, + 0x13, 0x33, 0x33, 0x33, + 0x13, 0x13, 0x33, 0x33, + 0x13, 0x13, 0x13, 0x33, + 0x13, 0x36, 0x36, 0x36, + 0x13, 0x13, 0x36, 0x36, + 0x13, 0x13, 0x13, 0x36, + 0x13, 0x25, 0x2E, 0x37, + 0x13, 0x1C, 0x2E, 0x37, + 0x13, 0x1C, 0x25, 0x37, + 0x13, 0x3B, 0x3B, 0x3B, + 0x13, 0x13, 0x3B, 0x3B, + 0x13, 0x13, 0x13, 0x3B, + 0x14, 0x15, 0x15, 0x16, + 0x14, 0x15, 0x16, 0x17, + 0x14, 0x16, 0x17, 0x18, + 0x14, 0x15, 0x17, 0x18, + 0x14, 0x15, 0x16, 0x18, + 0x14, 0x16, 0x17, 0x19, + 0x14, 0x16, 0x18, 0x19, + 0x14, 0x15, 0x18, 0x19, + 0x14, 0x15, 0x17, 0x19, + 0x14, 0x16, 0x18, 0x1A, + 0x14, 0x17, 0x19, 0x1A, + 0x14, 0x15, 0x19, 0x1A, + 0x14, 0x15, 0x17, 0x1A, + 0x14, 0x1A, 0x1A, 0x1A, + 0x14, 0x14, 0x1A, 0x1A, + 0x14, 0x14, 0x14, 0x1A, + 0x14, 0x17, 0x18, 0x1B, + 0x14, 0x17, 0x1A, 0x1B, + 0x14, 0x15, 0x1A, 0x1B, + 0x14, 0x15, 0x18, 0x1B, + 0x14, 0x17, 0x19, 0x1C, + 0x14, 0x18, 0x1A, 0x1C, + 0x14, 0x16, 0x1A, 0x1C, + 0x14, 0x16, 0x18, 0x1C, + 0x14, 0x1C, 0x1C, 0x1C, + 0x14, 0x14, 0x1C, 0x1C, + 0x14, 0x14, 0x14, 0x1C, + 0x14, 0x18, 0x1B, 0x1F, + 0x14, 0x19, 0x1D, 0x1F, + 0x14, 0x16, 0x1D, 0x1F, + 0x14, 0x16, 0x1A, 0x1F, + 0x14, 0x1F, 0x1F, 0x1F, + 0x14, 0x14, 0x1F, 0x1F, + 0x14, 0x14, 0x14, 0x1F, + 0x14, 0x19, 0x1D, 0x22, + 0x14, 0x1B, 0x1F, 0x22, + 0x14, 0x17, 0x1F, 0x22, + 0x14, 0x17, 0x1B, 0x22, + 0x14, 0x22, 0x22, 0x22, + 0x14, 0x14, 0x22, 0x22, + 0x14, 0x14, 0x14, 0x22, + 0x14, 0x1A, 0x1F, 0x25, + 0x14, 0x1C, 0x21, 0x25, + 0x14, 0x18, 0x21, 0x25, + 0x14, 0x18, 0x1D, 0x25, + 0x14, 0x25, 0x25, 0x25, + 0x14, 0x14, 0x25, 0x25, + 0x14, 0x14, 0x14, 0x25, + 0x14, 0x1B, 0x21, 0x28, + 0x14, 0x1E, 0x23, 0x28, + 0x14, 0x19, 0x23, 0x28, + 0x14, 0x19, 0x1E, 0x28, + 0x14, 0x28, 0x28, 0x28, + 0x14, 0x14, 0x28, 0x28, + 0x14, 0x14, 0x14, 0x28, + 0x14, 0x1F, 0x26, 0x2B, + 0x14, 0x19, 0x26, 0x2B, + 0x14, 0x19, 0x20, 0x2B, + 0x14, 0x2B, 0x2B, 0x2B, + 0x14, 0x14, 0x2B, 0x2B, + 0x14, 0x14, 0x14, 0x2B, + 0x14, 0x21, 0x28, 0x2E, + 0x14, 0x1A, 0x28, 0x2E, + 0x14, 0x1A, 0x21, 0x2E, + 0x14, 0x2E, 0x2E, 0x2E, + 0x14, 0x14, 0x2E, 0x2E, + 0x14, 0x14, 0x14, 0x2E, + 0x14, 0x22, 0x2A, 0x31, + 0x14, 0x1B, 0x2A, 0x31, + 0x14, 0x1B, 0x23, 0x31, + 0x14, 0x31, 0x31, 0x31, + 0x14, 0x14, 0x31, 0x31, + 0x14, 0x14, 0x14, 0x31, + 0x14, 0x24, 0x2C, 0x34, + 0x14, 0x1C, 0x2C, 0x34, + 0x14, 0x1C, 0x24, 0x34, + 0x14, 0x34, 0x34, 0x34, + 0x14, 0x14, 0x34, 0x34, + 0x14, 0x14, 0x14, 0x34, + 0x14, 0x37, 0x37, 0x37, + 0x14, 0x14, 0x37, 0x37, + 0x14, 0x14, 0x14, 0x37, + 0x14, 0x26, 0x2F, 0x38, + 0x14, 0x1D, 0x2F, 0x38, + 0x14, 0x1D, 0x26, 0x38, + 0x14, 0x3C, 0x3C, 0x3C, + 0x14, 0x14, 0x3C, 0x3C, + 0x14, 0x14, 0x14, 0x3C, + 0x15, 0x16, 0x16, 0x17, + 0x15, 0x16, 0x17, 0x18, + 0x15, 0x17, 0x18, 0x19, + 0x15, 0x16, 0x18, 0x19, + 0x15, 0x16, 0x17, 0x19, + 0x15, 0x17, 0x18, 0x1A, + 0x15, 0x17, 0x19, 0x1A, + 0x15, 0x16, 0x19, 0x1A, + 0x15, 0x16, 0x18, 0x1A, + 0x15, 0x17, 0x19, 0x1B, + 0x15, 0x18, 0x1A, 0x1B, + 0x15, 0x16, 0x1A, 0x1B, + 0x15, 0x16, 0x18, 0x1B, + 0x15, 0x1B, 0x1B, 0x1B, + 0x15, 0x15, 0x1B, 0x1B, + 0x15, 0x15, 0x15, 0x1B, + 0x15, 0x18, 0x19, 0x1C, + 0x15, 0x18, 0x1B, 0x1C, + 0x15, 0x16, 0x1B, 0x1C, + 0x15, 0x16, 0x19, 0x1C, + 0x15, 0x18, 0x1A, 0x1D, + 0x15, 0x19, 0x1B, 0x1D, + 0x15, 0x17, 0x1B, 0x1D, + 0x15, 0x17, 0x19, 0x1D, + 0x15, 0x1D, 0x1D, 0x1D, + 0x15, 0x15, 0x1D, 0x1D, + 0x15, 0x15, 0x15, 0x1D, + 0x15, 0x19, 0x1C, 0x20, + 0x15, 0x1A, 0x1E, 0x20, + 0x15, 0x17, 0x1E, 0x20, + 0x15, 0x17, 0x1B, 0x20, + 0x15, 0x20, 0x20, 0x20, + 0x15, 0x15, 0x20, 0x20, + 0x15, 0x15, 0x15, 0x20, + 0x15, 0x1A, 0x1E, 0x23, + 0x15, 0x1C, 0x20, 0x23, + 0x15, 0x18, 0x20, 0x23, + 0x15, 0x18, 0x1C, 0x23, + 0x15, 0x23, 0x23, 0x23, + 0x15, 0x15, 0x23, 0x23, + 0x15, 0x15, 0x15, 0x23, + 0x15, 0x1B, 0x20, 0x26, + 0x15, 0x1D, 0x22, 0x26, + 0x15, 0x19, 0x22, 0x26, + 0x15, 0x19, 0x1E, 0x26, + 0x15, 0x26, 0x26, 0x26, + 0x15, 0x15, 0x26, 0x26, + 0x15, 0x15, 0x15, 0x26, + 0x15, 0x1C, 0x22, 0x29, + 0x15, 0x1F, 0x24, 0x29, + 0x15, 0x1A, 0x24, 0x29, + 0x15, 0x1A, 0x1F, 0x29, + 0x15, 0x29, 0x29, 0x29, + 0x15, 0x15, 0x29, 0x29, + 0x15, 0x15, 0x15, 0x29, + 0x15, 0x20, 0x27, 0x2C, + 0x15, 0x1A, 0x27, 0x2C, + 0x15, 0x1A, 0x21, 0x2C, + 0x15, 0x2C, 0x2C, 0x2C, + 0x15, 0x15, 0x2C, 0x2C, + 0x15, 0x15, 0x15, 0x2C, + 0x15, 0x22, 0x29, 0x2F, + 0x15, 0x1B, 0x29, 0x2F, + 0x15, 0x1B, 0x22, 0x2F, + 0x15, 0x2F, 0x2F, 0x2F, + 0x15, 0x15, 0x2F, 0x2F, + 0x15, 0x15, 0x15, 0x2F, + 0x15, 0x23, 0x2B, 0x32, + 0x15, 0x1C, 0x2B, 0x32, + 0x15, 0x1C, 0x24, 0x32, + 0x15, 0x32, 0x32, 0x32, + 0x15, 0x15, 0x32, 0x32, + 0x15, 0x15, 0x15, 0x32, + 0x15, 0x25, 0x2D, 0x35, + 0x15, 0x1D, 0x2D, 0x35, + 0x15, 0x1D, 0x25, 0x35, + 0x15, 0x35, 0x35, 0x35, + 0x15, 0x15, 0x35, 0x35, + 0x15, 0x15, 0x15, 0x35, + 0x15, 0x38, 0x38, 0x38, + 0x15, 0x15, 0x38, 0x38, + 0x15, 0x15, 0x15, 0x38, + 0x15, 0x27, 0x30, 0x39, + 0x15, 0x1E, 0x30, 0x39, + 0x15, 0x1E, 0x27, 0x39, + 0x15, 0x3D, 0x3D, 0x3D, + 0x15, 0x15, 0x3D, 0x3D, + 0x15, 0x15, 0x15, 0x3D, + 0x16, 0x17, 0x17, 0x18, + 0x16, 0x17, 0x18, 0x19, + 0x16, 0x18, 0x19, 0x1A, + 0x16, 0x17, 0x19, 0x1A, + 0x16, 0x17, 0x18, 0x1A, + 0x16, 0x18, 0x19, 0x1B, + 0x16, 0x18, 0x1A, 0x1B, + 0x16, 0x17, 0x1A, 0x1B, + 0x16, 0x17, 0x19, 0x1B, + 0x16, 0x18, 0x1A, 0x1C, + 0x16, 0x19, 0x1B, 0x1C, + 0x16, 0x17, 0x1B, 0x1C, + 0x16, 0x17, 0x19, 0x1C, + 0x16, 0x1C, 0x1C, 0x1C, + 0x16, 0x16, 0x1C, 0x1C, + 0x16, 0x16, 0x16, 0x1C, + 0x16, 0x19, 0x1A, 0x1D, + 0x16, 0x19, 0x1C, 0x1D, + 0x16, 0x17, 0x1C, 0x1D, + 0x16, 0x17, 0x1A, 0x1D, + 0x16, 0x19, 0x1B, 0x1E, + 0x16, 0x1A, 0x1C, 0x1E, + 0x16, 0x18, 0x1C, 0x1E, + 0x16, 0x18, 0x1A, 0x1E, + 0x16, 0x1E, 0x1E, 0x1E, + 0x16, 0x16, 0x1E, 0x1E, + 0x16, 0x16, 0x16, 0x1E, + 0x16, 0x1A, 0x1D, 0x21, + 0x16, 0x1B, 0x1F, 0x21, + 0x16, 0x18, 0x1F, 0x21, + 0x16, 0x18, 0x1C, 0x21, + 0x16, 0x21, 0x21, 0x21, + 0x16, 0x16, 0x21, 0x21, + 0x16, 0x16, 0x16, 0x21, + 0x16, 0x1B, 0x1F, 0x24, + 0x16, 0x1D, 0x21, 0x24, + 0x16, 0x19, 0x21, 0x24, + 0x16, 0x19, 0x1D, 0x24, + 0x16, 0x24, 0x24, 0x24, + 0x16, 0x16, 0x24, 0x24, + 0x16, 0x16, 0x16, 0x24, + 0x16, 0x1C, 0x21, 0x27, + 0x16, 0x1E, 0x23, 0x27, + 0x16, 0x1A, 0x23, 0x27, + 0x16, 0x1A, 0x1F, 0x27, + 0x16, 0x27, 0x27, 0x27, + 0x16, 0x16, 0x27, 0x27, + 0x16, 0x16, 0x16, 0x27, + 0x16, 0x1D, 0x23, 0x2A, + 0x16, 0x20, 0x25, 0x2A, + 0x16, 0x1B, 0x25, 0x2A, + 0x16, 0x1B, 0x20, 0x2A, + 0x16, 0x2A, 0x2A, 0x2A, + 0x16, 0x16, 0x2A, 0x2A, + 0x16, 0x16, 0x16, 0x2A, + 0x16, 0x21, 0x28, 0x2D, + 0x16, 0x1B, 0x28, 0x2D, + 0x16, 0x1B, 0x22, 0x2D, + 0x16, 0x2D, 0x2D, 0x2D, + 0x16, 0x16, 0x2D, 0x2D, + 0x16, 0x16, 0x16, 0x2D, + 0x16, 0x23, 0x2A, 0x30, + 0x16, 0x1C, 0x2A, 0x30, + 0x16, 0x1C, 0x23, 0x30, + 0x16, 0x30, 0x30, 0x30, + 0x16, 0x16, 0x30, 0x30, + 0x16, 0x16, 0x16, 0x30, + 0x16, 0x24, 0x2C, 0x33, + 0x16, 0x1D, 0x2C, 0x33, + 0x16, 0x1D, 0x25, 0x33, + 0x16, 0x33, 0x33, 0x33, + 0x16, 0x16, 0x33, 0x33, + 0x16, 0x16, 0x16, 0x33, + 0x16, 0x26, 0x2E, 0x36, + 0x16, 0x1E, 0x2E, 0x36, + 0x16, 0x1E, 0x26, 0x36, + 0x16, 0x36, 0x36, 0x36, + 0x16, 0x16, 0x36, 0x36, + 0x16, 0x16, 0x16, 0x36, + 0x16, 0x39, 0x39, 0x39, + 0x16, 0x16, 0x39, 0x39, + 0x16, 0x16, 0x16, 0x39, + 0x16, 0x28, 0x31, 0x3A, + 0x16, 0x1F, 0x31, 0x3A, + 0x16, 0x1F, 0x28, 0x3A, + 0x16, 0x3E, 0x3E, 0x3E, + 0x16, 0x16, 0x3E, 0x3E, + 0x16, 0x16, 0x16, 0x3E, + 0x17, 0x18, 0x18, 0x19, + 0x17, 0x18, 0x19, 0x1A, + 0x17, 0x19, 0x1A, 0x1B, + 0x17, 0x18, 0x1A, 0x1B, + 0x17, 0x18, 0x19, 0x1B, + 0x17, 0x19, 0x1A, 0x1C, + 0x17, 0x19, 0x1B, 0x1C, + 0x17, 0x18, 0x1B, 0x1C, + 0x17, 0x18, 0x1A, 0x1C, + 0x17, 0x19, 0x1B, 0x1D, + 0x17, 0x1A, 0x1C, 0x1D, + 0x17, 0x18, 0x1C, 0x1D, + 0x17, 0x18, 0x1A, 0x1D, + 0x17, 0x1D, 0x1D, 0x1D, + 0x17, 0x17, 0x1D, 0x1D, + 0x17, 0x17, 0x17, 0x1D, + 0x17, 0x1A, 0x1B, 0x1E, + 0x17, 0x1A, 0x1D, 0x1E, + 0x17, 0x18, 0x1D, 0x1E, + 0x17, 0x18, 0x1B, 0x1E, + 0x17, 0x1A, 0x1C, 0x1F, + 0x17, 0x1B, 0x1D, 0x1F, + 0x17, 0x19, 0x1D, 0x1F, + 0x17, 0x19, 0x1B, 0x1F, + 0x17, 0x1F, 0x1F, 0x1F, + 0x17, 0x17, 0x1F, 0x1F, + 0x17, 0x17, 0x17, 0x1F, + 0x17, 0x1B, 0x1E, 0x22, + 0x17, 0x1C, 0x20, 0x22, + 0x17, 0x19, 0x20, 0x22, + 0x17, 0x19, 0x1D, 0x22, + 0x17, 0x22, 0x22, 0x22, + 0x17, 0x17, 0x22, 0x22, + 0x17, 0x17, 0x17, 0x22, + 0x17, 0x1C, 0x20, 0x25, + 0x17, 0x1E, 0x22, 0x25, + 0x17, 0x1A, 0x22, 0x25, + 0x17, 0x1A, 0x1E, 0x25, + 0x17, 0x25, 0x25, 0x25, + 0x17, 0x17, 0x25, 0x25, + 0x17, 0x17, 0x17, 0x25, + 0x17, 0x1D, 0x22, 0x28, + 0x17, 0x1F, 0x24, 0x28, + 0x17, 0x1B, 0x24, 0x28, + 0x17, 0x1B, 0x20, 0x28, + 0x17, 0x28, 0x28, 0x28, + 0x17, 0x17, 0x28, 0x28, + 0x17, 0x17, 0x17, 0x28, + 0x17, 0x1E, 0x24, 0x2B, + 0x17, 0x21, 0x26, 0x2B, + 0x17, 0x1C, 0x26, 0x2B, + 0x17, 0x1C, 0x21, 0x2B, + 0x17, 0x2B, 0x2B, 0x2B, + 0x17, 0x17, 0x2B, 0x2B, + 0x17, 0x17, 0x17, 0x2B, + 0x17, 0x22, 0x29, 0x2E, + 0x17, 0x1C, 0x29, 0x2E, + 0x17, 0x1C, 0x23, 0x2E, + 0x17, 0x2E, 0x2E, 0x2E, + 0x17, 0x17, 0x2E, 0x2E, + 0x17, 0x17, 0x17, 0x2E, + 0x17, 0x24, 0x2B, 0x31, + 0x17, 0x1D, 0x2B, 0x31, + 0x17, 0x1D, 0x24, 0x31, + 0x17, 0x31, 0x31, 0x31, + 0x17, 0x17, 0x31, 0x31, + 0x17, 0x17, 0x17, 0x31, + 0x17, 0x25, 0x2D, 0x34, + 0x17, 0x1E, 0x2D, 0x34, + 0x17, 0x1E, 0x26, 0x34, + 0x17, 0x34, 0x34, 0x34, + 0x17, 0x17, 0x34, 0x34, + 0x17, 0x17, 0x17, 0x34, + 0x17, 0x27, 0x2F, 0x37, + 0x17, 0x1F, 0x2F, 0x37, + 0x17, 0x1F, 0x27, 0x37, + 0x17, 0x37, 0x37, 0x37, + 0x17, 0x17, 0x37, 0x37, + 0x17, 0x17, 0x17, 0x37, + 0x17, 0x3A, 0x3A, 0x3A, + 0x17, 0x17, 0x3A, 0x3A, + 0x17, 0x17, 0x17, 0x3A, + 0x17, 0x29, 0x32, 0x3B, + 0x17, 0x20, 0x32, 0x3B, + 0x17, 0x20, 0x29, 0x3B, + 0x17, 0x3F, 0x3F, 0x3F, + 0x17, 0x17, 0x3F, 0x3F, + 0x17, 0x17, 0x17, 0x3F, + 0x18, 0x19, 0x19, 0x1A, + 0x18, 0x19, 0x1A, 0x1B, + 0x18, 0x1A, 0x1B, 0x1C, + 0x18, 0x19, 0x1B, 0x1C, + 0x18, 0x19, 0x1A, 0x1C, + 0x18, 0x1A, 0x1B, 0x1D, + 0x18, 0x1A, 0x1C, 0x1D, + 0x18, 0x19, 0x1C, 0x1D, + 0x18, 0x19, 0x1B, 0x1D, + 0x18, 0x1A, 0x1C, 0x1E, + 0x18, 0x1B, 0x1D, 0x1E, + 0x18, 0x19, 0x1D, 0x1E, + 0x18, 0x19, 0x1B, 0x1E, + 0x18, 0x1E, 0x1E, 0x1E, + 0x18, 0x18, 0x1E, 0x1E, + 0x18, 0x18, 0x18, 0x1E, + 0x18, 0x1B, 0x1C, 0x1F, + 0x18, 0x1B, 0x1E, 0x1F, + 0x18, 0x19, 0x1E, 0x1F, + 0x18, 0x19, 0x1C, 0x1F, + 0x18, 0x1B, 0x1D, 0x20, + 0x18, 0x1C, 0x1E, 0x20, + 0x18, 0x1A, 0x1E, 0x20, + 0x18, 0x1A, 0x1C, 0x20, + 0x18, 0x20, 0x20, 0x20, + 0x18, 0x18, 0x20, 0x20, + 0x18, 0x18, 0x18, 0x20, + 0x18, 0x1C, 0x1F, 0x23, + 0x18, 0x1D, 0x21, 0x23, + 0x18, 0x1A, 0x21, 0x23, + 0x18, 0x1A, 0x1E, 0x23, + 0x18, 0x23, 0x23, 0x23, + 0x18, 0x18, 0x23, 0x23, + 0x18, 0x18, 0x18, 0x23, + 0x18, 0x1D, 0x21, 0x26, + 0x18, 0x1F, 0x23, 0x26, + 0x18, 0x1B, 0x23, 0x26, + 0x18, 0x1B, 0x1F, 0x26, + 0x18, 0x26, 0x26, 0x26, + 0x18, 0x18, 0x26, 0x26, + 0x18, 0x18, 0x18, 0x26, + 0x18, 0x1E, 0x23, 0x29, + 0x18, 0x20, 0x25, 0x29, + 0x18, 0x1C, 0x25, 0x29, + 0x18, 0x1C, 0x21, 0x29, + 0x18, 0x29, 0x29, 0x29, + 0x18, 0x18, 0x29, 0x29, + 0x18, 0x18, 0x18, 0x29, + 0x18, 0x1F, 0x25, 0x2C, + 0x18, 0x22, 0x27, 0x2C, + 0x18, 0x1D, 0x27, 0x2C, + 0x18, 0x1D, 0x22, 0x2C, + 0x18, 0x2C, 0x2C, 0x2C, + 0x18, 0x18, 0x2C, 0x2C, + 0x18, 0x18, 0x18, 0x2C, + 0x18, 0x23, 0x2A, 0x2F, + 0x18, 0x1D, 0x2A, 0x2F, + 0x18, 0x1D, 0x24, 0x2F, + 0x18, 0x2F, 0x2F, 0x2F, + 0x18, 0x18, 0x2F, 0x2F, + 0x18, 0x18, 0x18, 0x2F, + 0x18, 0x25, 0x2C, 0x32, + 0x18, 0x1E, 0x2C, 0x32, + 0x18, 0x1E, 0x25, 0x32, + 0x18, 0x32, 0x32, 0x32, + 0x18, 0x18, 0x32, 0x32, + 0x18, 0x18, 0x18, 0x32, + 0x18, 0x26, 0x2E, 0x35, + 0x18, 0x1F, 0x2E, 0x35, + 0x18, 0x1F, 0x27, 0x35, + 0x18, 0x35, 0x35, 0x35, + 0x18, 0x18, 0x35, 0x35, + 0x18, 0x18, 0x18, 0x35, + 0x18, 0x28, 0x30, 0x38, + 0x18, 0x20, 0x30, 0x38, + 0x18, 0x20, 0x28, 0x38, + 0x18, 0x38, 0x38, 0x38, + 0x18, 0x18, 0x38, 0x38, + 0x18, 0x18, 0x18, 0x38, + 0x18, 0x3B, 0x3B, 0x3B, + 0x18, 0x18, 0x3B, 0x3B, + 0x18, 0x18, 0x18, 0x3B, + 0x18, 0x2A, 0x33, 0x3C, + 0x18, 0x21, 0x33, 0x3C, + 0x18, 0x21, 0x2A, 0x3C, + 0x19, 0x1A, 0x1A, 0x1B, + 0x19, 0x1A, 0x1B, 0x1C, + 0x19, 0x1B, 0x1C, 0x1D, + 0x19, 0x1A, 0x1C, 0x1D, + 0x19, 0x1A, 0x1B, 0x1D, + 0x19, 0x1B, 0x1C, 0x1E, + 0x19, 0x1B, 0x1D, 0x1E, + 0x19, 0x1A, 0x1D, 0x1E, + 0x19, 0x1A, 0x1C, 0x1E, + 0x19, 0x1B, 0x1D, 0x1F, + 0x19, 0x1C, 0x1E, 0x1F, + 0x19, 0x1A, 0x1E, 0x1F, + 0x19, 0x1A, 0x1C, 0x1F, + 0x19, 0x1F, 0x1F, 0x1F, + 0x19, 0x19, 0x1F, 0x1F, + 0x19, 0x19, 0x19, 0x1F, + 0x19, 0x1C, 0x1D, 0x20, + 0x19, 0x1C, 0x1F, 0x20, + 0x19, 0x1A, 0x1F, 0x20, + 0x19, 0x1A, 0x1D, 0x20, + 0x19, 0x1C, 0x1E, 0x21, + 0x19, 0x1D, 0x1F, 0x21, + 0x19, 0x1B, 0x1F, 0x21, + 0x19, 0x1B, 0x1D, 0x21, + 0x19, 0x21, 0x21, 0x21, + 0x19, 0x19, 0x21, 0x21, + 0x19, 0x19, 0x19, 0x21, + 0x19, 0x1D, 0x20, 0x24, + 0x19, 0x1E, 0x22, 0x24, + 0x19, 0x1B, 0x22, 0x24, + 0x19, 0x1B, 0x1F, 0x24, + 0x19, 0x24, 0x24, 0x24, + 0x19, 0x19, 0x24, 0x24, + 0x19, 0x19, 0x19, 0x24, + 0x19, 0x1E, 0x22, 0x27, + 0x19, 0x20, 0x24, 0x27, + 0x19, 0x1C, 0x24, 0x27, + 0x19, 0x1C, 0x20, 0x27, + 0x19, 0x27, 0x27, 0x27, + 0x19, 0x19, 0x27, 0x27, + 0x19, 0x19, 0x19, 0x27, + 0x19, 0x1F, 0x24, 0x2A, + 0x19, 0x21, 0x26, 0x2A, + 0x19, 0x1D, 0x26, 0x2A, + 0x19, 0x1D, 0x22, 0x2A, + 0x19, 0x2A, 0x2A, 0x2A, + 0x19, 0x19, 0x2A, 0x2A, + 0x19, 0x19, 0x19, 0x2A, + 0x19, 0x20, 0x26, 0x2D, + 0x19, 0x23, 0x28, 0x2D, + 0x19, 0x1E, 0x28, 0x2D, + 0x19, 0x1E, 0x23, 0x2D, + 0x19, 0x2D, 0x2D, 0x2D, + 0x19, 0x19, 0x2D, 0x2D, + 0x19, 0x19, 0x19, 0x2D, + 0x19, 0x24, 0x2B, 0x30, + 0x19, 0x1E, 0x2B, 0x30, + 0x19, 0x1E, 0x25, 0x30, + 0x19, 0x30, 0x30, 0x30, + 0x19, 0x19, 0x30, 0x30, + 0x19, 0x19, 0x19, 0x30, + 0x19, 0x26, 0x2D, 0x33, + 0x19, 0x1F, 0x2D, 0x33, + 0x19, 0x1F, 0x26, 0x33, + 0x19, 0x33, 0x33, 0x33, + 0x19, 0x19, 0x33, 0x33, + 0x19, 0x19, 0x19, 0x33, + 0x19, 0x27, 0x2F, 0x36, + 0x19, 0x20, 0x2F, 0x36, + 0x19, 0x20, 0x28, 0x36, + 0x19, 0x36, 0x36, 0x36, + 0x19, 0x19, 0x36, 0x36, + 0x19, 0x19, 0x19, 0x36, + 0x19, 0x29, 0x31, 0x39, + 0x19, 0x21, 0x31, 0x39, + 0x19, 0x21, 0x29, 0x39, + 0x19, 0x39, 0x39, 0x39, + 0x19, 0x19, 0x39, 0x39, + 0x19, 0x19, 0x19, 0x39, + 0x19, 0x3C, 0x3C, 0x3C, + 0x19, 0x19, 0x3C, 0x3C, + 0x19, 0x19, 0x19, 0x3C, + 0x19, 0x2B, 0x34, 0x3D, + 0x19, 0x22, 0x34, 0x3D, + 0x19, 0x22, 0x2B, 0x3D, + 0x1A, 0x1B, 0x1B, 0x1C, + 0x1A, 0x1B, 0x1C, 0x1D, + 0x1A, 0x1C, 0x1D, 0x1E, + 0x1A, 0x1B, 0x1D, 0x1E, + 0x1A, 0x1B, 0x1C, 0x1E, + 0x1A, 0x1C, 0x1D, 0x1F, + 0x1A, 0x1C, 0x1E, 0x1F, + 0x1A, 0x1B, 0x1E, 0x1F, + 0x1A, 0x1B, 0x1D, 0x1F, + 0x1A, 0x1C, 0x1E, 0x20, + 0x1A, 0x1D, 0x1F, 0x20, + 0x1A, 0x1B, 0x1F, 0x20, + 0x1A, 0x1B, 0x1D, 0x20, + 0x1A, 0x20, 0x20, 0x20, + 0x1A, 0x1A, 0x20, 0x20, + 0x1A, 0x1A, 0x1A, 0x20, + 0x1A, 0x1D, 0x1E, 0x21, + 0x1A, 0x1D, 0x20, 0x21, + 0x1A, 0x1B, 0x20, 0x21, + 0x1A, 0x1B, 0x1E, 0x21, + 0x1A, 0x1D, 0x1F, 0x22, + 0x1A, 0x1E, 0x20, 0x22, + 0x1A, 0x1C, 0x20, 0x22, + 0x1A, 0x1C, 0x1E, 0x22, + 0x1A, 0x22, 0x22, 0x22, + 0x1A, 0x1A, 0x22, 0x22, + 0x1A, 0x1A, 0x1A, 0x22, + 0x1A, 0x1E, 0x21, 0x25, + 0x1A, 0x1F, 0x23, 0x25, + 0x1A, 0x1C, 0x23, 0x25, + 0x1A, 0x1C, 0x20, 0x25, + 0x1A, 0x25, 0x25, 0x25, + 0x1A, 0x1A, 0x25, 0x25, + 0x1A, 0x1A, 0x1A, 0x25, + 0x1A, 0x1F, 0x23, 0x28, + 0x1A, 0x21, 0x25, 0x28, + 0x1A, 0x1D, 0x25, 0x28, + 0x1A, 0x1D, 0x21, 0x28, + 0x1A, 0x28, 0x28, 0x28, + 0x1A, 0x1A, 0x28, 0x28, + 0x1A, 0x1A, 0x1A, 0x28, + 0x1A, 0x20, 0x25, 0x2B, + 0x1A, 0x22, 0x27, 0x2B, + 0x1A, 0x1E, 0x27, 0x2B, + 0x1A, 0x1E, 0x23, 0x2B, + 0x1A, 0x2B, 0x2B, 0x2B, + 0x1A, 0x1A, 0x2B, 0x2B, + 0x1A, 0x1A, 0x1A, 0x2B, + 0x1A, 0x21, 0x27, 0x2E, + 0x1A, 0x24, 0x29, 0x2E, + 0x1A, 0x1F, 0x29, 0x2E, + 0x1A, 0x1F, 0x24, 0x2E, + 0x1A, 0x2E, 0x2E, 0x2E, + 0x1A, 0x1A, 0x2E, 0x2E, + 0x1A, 0x1A, 0x1A, 0x2E, + 0x1A, 0x25, 0x2C, 0x31, + 0x1A, 0x1F, 0x2C, 0x31, + 0x1A, 0x1F, 0x26, 0x31, + 0x1A, 0x31, 0x31, 0x31, + 0x1A, 0x1A, 0x31, 0x31, + 0x1A, 0x1A, 0x1A, 0x31, + 0x1A, 0x27, 0x2E, 0x34, + 0x1A, 0x20, 0x2E, 0x34, + 0x1A, 0x20, 0x27, 0x34, + 0x1A, 0x34, 0x34, 0x34, + 0x1A, 0x1A, 0x34, 0x34, + 0x1A, 0x1A, 0x1A, 0x34, + 0x1A, 0x28, 0x30, 0x37, + 0x1A, 0x21, 0x30, 0x37, + 0x1A, 0x21, 0x29, 0x37, + 0x1A, 0x37, 0x37, 0x37, + 0x1A, 0x1A, 0x37, 0x37, + 0x1A, 0x1A, 0x1A, 0x37, + 0x1A, 0x2A, 0x32, 0x3A, + 0x1A, 0x22, 0x32, 0x3A, + 0x1A, 0x22, 0x2A, 0x3A, + 0x1A, 0x3A, 0x3A, 0x3A, + 0x1A, 0x1A, 0x3A, 0x3A, + 0x1A, 0x1A, 0x1A, 0x3A, + 0x1A, 0x3D, 0x3D, 0x3D, + 0x1A, 0x1A, 0x3D, 0x3D, + 0x1A, 0x1A, 0x1A, 0x3D, + 0x1A, 0x2C, 0x35, 0x3E, + 0x1A, 0x23, 0x35, 0x3E, + 0x1A, 0x23, 0x2C, 0x3E, + 0x1B, 0x1C, 0x1C, 0x1D, + 0x1B, 0x1C, 0x1D, 0x1E, + 0x1B, 0x1D, 0x1E, 0x1F, + 0x1B, 0x1C, 0x1E, 0x1F, + 0x1B, 0x1C, 0x1D, 0x1F, + 0x1B, 0x1D, 0x1E, 0x20, + 0x1B, 0x1D, 0x1F, 0x20, + 0x1B, 0x1C, 0x1F, 0x20, + 0x1B, 0x1C, 0x1E, 0x20, + 0x1B, 0x1D, 0x1F, 0x21, + 0x1B, 0x1E, 0x20, 0x21, + 0x1B, 0x1C, 0x20, 0x21, + 0x1B, 0x1C, 0x1E, 0x21, + 0x1B, 0x21, 0x21, 0x21, + 0x1B, 0x1B, 0x21, 0x21, + 0x1B, 0x1B, 0x1B, 0x21, + 0x1B, 0x1E, 0x1F, 0x22, + 0x1B, 0x1E, 0x21, 0x22, + 0x1B, 0x1C, 0x21, 0x22, + 0x1B, 0x1C, 0x1F, 0x22, + 0x1B, 0x1E, 0x20, 0x23, + 0x1B, 0x1F, 0x21, 0x23, + 0x1B, 0x1D, 0x21, 0x23, + 0x1B, 0x1D, 0x1F, 0x23, + 0x1B, 0x23, 0x23, 0x23, + 0x1B, 0x1B, 0x23, 0x23, + 0x1B, 0x1B, 0x1B, 0x23, + 0x1B, 0x1F, 0x22, 0x26, + 0x1B, 0x20, 0x24, 0x26, + 0x1B, 0x1D, 0x24, 0x26, + 0x1B, 0x1D, 0x21, 0x26, + 0x1B, 0x26, 0x26, 0x26, + 0x1B, 0x1B, 0x26, 0x26, + 0x1B, 0x1B, 0x1B, 0x26, + 0x1B, 0x20, 0x24, 0x29, + 0x1B, 0x22, 0x26, 0x29, + 0x1B, 0x1E, 0x26, 0x29, + 0x1B, 0x1E, 0x22, 0x29, + 0x1B, 0x29, 0x29, 0x29, + 0x1B, 0x1B, 0x29, 0x29, + 0x1B, 0x1B, 0x1B, 0x29, + 0x1B, 0x21, 0x26, 0x2C, + 0x1B, 0x23, 0x28, 0x2C, + 0x1B, 0x1F, 0x28, 0x2C, + 0x1B, 0x1F, 0x24, 0x2C, + 0x1B, 0x2C, 0x2C, 0x2C, + 0x1B, 0x1B, 0x2C, 0x2C, + 0x1B, 0x1B, 0x1B, 0x2C, + 0x1B, 0x22, 0x28, 0x2F, + 0x1B, 0x25, 0x2A, 0x2F, + 0x1B, 0x20, 0x2A, 0x2F, + 0x1B, 0x20, 0x25, 0x2F, + 0x1B, 0x2F, 0x2F, 0x2F, + 0x1B, 0x1B, 0x2F, 0x2F, + 0x1B, 0x1B, 0x1B, 0x2F, + 0x1B, 0x26, 0x2D, 0x32, + 0x1B, 0x20, 0x2D, 0x32, + 0x1B, 0x20, 0x27, 0x32, + 0x1B, 0x32, 0x32, 0x32, + 0x1B, 0x1B, 0x32, 0x32, + 0x1B, 0x1B, 0x1B, 0x32, + 0x1B, 0x28, 0x2F, 0x35, + 0x1B, 0x21, 0x2F, 0x35, + 0x1B, 0x21, 0x28, 0x35, + 0x1B, 0x35, 0x35, 0x35, + 0x1B, 0x1B, 0x35, 0x35, + 0x1B, 0x1B, 0x1B, 0x35, + 0x1B, 0x29, 0x31, 0x38, + 0x1B, 0x22, 0x31, 0x38, + 0x1B, 0x22, 0x2A, 0x38, + 0x1B, 0x38, 0x38, 0x38, + 0x1B, 0x1B, 0x38, 0x38, + 0x1B, 0x1B, 0x1B, 0x38, + 0x1B, 0x2B, 0x33, 0x3B, + 0x1B, 0x23, 0x33, 0x3B, + 0x1B, 0x23, 0x2B, 0x3B, + 0x1B, 0x3B, 0x3B, 0x3B, + 0x1B, 0x1B, 0x3B, 0x3B, + 0x1B, 0x1B, 0x1B, 0x3B, + 0x1B, 0x3E, 0x3E, 0x3E, + 0x1B, 0x1B, 0x3E, 0x3E, + 0x1B, 0x1B, 0x1B, 0x3E, + 0x1B, 0x2D, 0x36, 0x3F, + 0x1B, 0x24, 0x36, 0x3F, + 0x1B, 0x24, 0x2D, 0x3F, + 0x1C, 0x1D, 0x1D, 0x1E, + 0x1C, 0x1D, 0x1E, 0x1F, + 0x1C, 0x1E, 0x1F, 0x20, + 0x1C, 0x1D, 0x1F, 0x20, + 0x1C, 0x1D, 0x1E, 0x20, + 0x1C, 0x1E, 0x1F, 0x21, + 0x1C, 0x1E, 0x20, 0x21, + 0x1C, 0x1D, 0x20, 0x21, + 0x1C, 0x1D, 0x1F, 0x21, + 0x1C, 0x1E, 0x20, 0x22, + 0x1C, 0x1F, 0x21, 0x22, + 0x1C, 0x1D, 0x21, 0x22, + 0x1C, 0x1D, 0x1F, 0x22, + 0x1C, 0x22, 0x22, 0x22, + 0x1C, 0x1C, 0x22, 0x22, + 0x1C, 0x1C, 0x1C, 0x22, + 0x1C, 0x1F, 0x20, 0x23, + 0x1C, 0x1F, 0x22, 0x23, + 0x1C, 0x1D, 0x22, 0x23, + 0x1C, 0x1D, 0x20, 0x23, + 0x1C, 0x1F, 0x21, 0x24, + 0x1C, 0x20, 0x22, 0x24, + 0x1C, 0x1E, 0x22, 0x24, + 0x1C, 0x1E, 0x20, 0x24, + 0x1C, 0x24, 0x24, 0x24, + 0x1C, 0x1C, 0x24, 0x24, + 0x1C, 0x1C, 0x1C, 0x24, + 0x1C, 0x20, 0x23, 0x27, + 0x1C, 0x21, 0x25, 0x27, + 0x1C, 0x1E, 0x25, 0x27, + 0x1C, 0x1E, 0x22, 0x27, + 0x1C, 0x27, 0x27, 0x27, + 0x1C, 0x1C, 0x27, 0x27, + 0x1C, 0x1C, 0x1C, 0x27, + 0x1C, 0x21, 0x25, 0x2A, + 0x1C, 0x23, 0x27, 0x2A, + 0x1C, 0x1F, 0x27, 0x2A, + 0x1C, 0x1F, 0x23, 0x2A, + 0x1C, 0x2A, 0x2A, 0x2A, + 0x1C, 0x1C, 0x2A, 0x2A, + 0x1C, 0x1C, 0x1C, 0x2A, + 0x1C, 0x22, 0x27, 0x2D, + 0x1C, 0x24, 0x29, 0x2D, + 0x1C, 0x20, 0x29, 0x2D, + 0x1C, 0x20, 0x25, 0x2D, + 0x1C, 0x2D, 0x2D, 0x2D, + 0x1C, 0x1C, 0x2D, 0x2D, + 0x1C, 0x1C, 0x1C, 0x2D, + 0x1C, 0x23, 0x29, 0x30, + 0x1C, 0x26, 0x2B, 0x30, + 0x1C, 0x21, 0x2B, 0x30, + 0x1C, 0x21, 0x26, 0x30, + 0x1C, 0x30, 0x30, 0x30, + 0x1C, 0x1C, 0x30, 0x30, + 0x1C, 0x1C, 0x1C, 0x30, + 0x1C, 0x27, 0x2E, 0x33, + 0x1C, 0x21, 0x2E, 0x33, + 0x1C, 0x21, 0x28, 0x33, + 0x1C, 0x33, 0x33, 0x33, + 0x1C, 0x1C, 0x33, 0x33, + 0x1C, 0x1C, 0x1C, 0x33, + 0x1C, 0x29, 0x30, 0x36, + 0x1C, 0x22, 0x30, 0x36, + 0x1C, 0x22, 0x29, 0x36, + 0x1C, 0x36, 0x36, 0x36, + 0x1C, 0x1C, 0x36, 0x36, + 0x1C, 0x1C, 0x1C, 0x36, + 0x1C, 0x2A, 0x32, 0x39, + 0x1C, 0x23, 0x32, 0x39, + 0x1C, 0x23, 0x2B, 0x39, + 0x1C, 0x39, 0x39, 0x39, + 0x1C, 0x1C, 0x39, 0x39, + 0x1C, 0x1C, 0x1C, 0x39, + 0x1C, 0x2C, 0x34, 0x3C, + 0x1C, 0x24, 0x34, 0x3C, + 0x1C, 0x24, 0x2C, 0x3C, + 0x1C, 0x3C, 0x3C, 0x3C, + 0x1C, 0x1C, 0x3C, 0x3C, + 0x1C, 0x1C, 0x1C, 0x3C, + 0x1C, 0x3F, 0x3F, 0x3F, + 0x1C, 0x1C, 0x3F, 0x3F, + 0x1C, 0x1C, 0x1C, 0x3F, + 0x1D, 0x1E, 0x1E, 0x1F, + 0x1D, 0x1E, 0x1F, 0x20, + 0x1D, 0x1F, 0x20, 0x21, + 0x1D, 0x1E, 0x20, 0x21, + 0x1D, 0x1E, 0x1F, 0x21, + 0x1D, 0x1F, 0x20, 0x22, + 0x1D, 0x1F, 0x21, 0x22, + 0x1D, 0x1E, 0x21, 0x22, + 0x1D, 0x1E, 0x20, 0x22, + 0x1D, 0x1F, 0x21, 0x23, + 0x1D, 0x20, 0x22, 0x23, + 0x1D, 0x1E, 0x22, 0x23, + 0x1D, 0x1E, 0x20, 0x23, + 0x1D, 0x23, 0x23, 0x23, + 0x1D, 0x1D, 0x23, 0x23, + 0x1D, 0x1D, 0x1D, 0x23, + 0x1D, 0x20, 0x21, 0x24, + 0x1D, 0x20, 0x23, 0x24, + 0x1D, 0x1E, 0x23, 0x24, + 0x1D, 0x1E, 0x21, 0x24, + 0x1D, 0x20, 0x22, 0x25, + 0x1D, 0x21, 0x23, 0x25, + 0x1D, 0x1F, 0x23, 0x25, + 0x1D, 0x1F, 0x21, 0x25, + 0x1D, 0x25, 0x25, 0x25, + 0x1D, 0x1D, 0x25, 0x25, + 0x1D, 0x1D, 0x1D, 0x25, + 0x1D, 0x21, 0x24, 0x28, + 0x1D, 0x22, 0x26, 0x28, + 0x1D, 0x1F, 0x26, 0x28, + 0x1D, 0x1F, 0x23, 0x28, + 0x1D, 0x28, 0x28, 0x28, + 0x1D, 0x1D, 0x28, 0x28, + 0x1D, 0x1D, 0x1D, 0x28, + 0x1D, 0x22, 0x26, 0x2B, + 0x1D, 0x24, 0x28, 0x2B, + 0x1D, 0x20, 0x28, 0x2B, + 0x1D, 0x20, 0x24, 0x2B, + 0x1D, 0x2B, 0x2B, 0x2B, + 0x1D, 0x1D, 0x2B, 0x2B, + 0x1D, 0x1D, 0x1D, 0x2B, + 0x1D, 0x23, 0x28, 0x2E, + 0x1D, 0x25, 0x2A, 0x2E, + 0x1D, 0x21, 0x2A, 0x2E, + 0x1D, 0x21, 0x26, 0x2E, + 0x1D, 0x2E, 0x2E, 0x2E, + 0x1D, 0x1D, 0x2E, 0x2E, + 0x1D, 0x1D, 0x1D, 0x2E, + 0x1D, 0x24, 0x2A, 0x31, + 0x1D, 0x27, 0x2C, 0x31, + 0x1D, 0x22, 0x2C, 0x31, + 0x1D, 0x22, 0x27, 0x31, + 0x1D, 0x31, 0x31, 0x31, + 0x1D, 0x1D, 0x31, 0x31, + 0x1D, 0x1D, 0x1D, 0x31, + 0x1D, 0x28, 0x2F, 0x34, + 0x1D, 0x22, 0x2F, 0x34, + 0x1D, 0x22, 0x29, 0x34, + 0x1D, 0x34, 0x34, 0x34, + 0x1D, 0x1D, 0x34, 0x34, + 0x1D, 0x1D, 0x1D, 0x34, + 0x1D, 0x2A, 0x31, 0x37, + 0x1D, 0x23, 0x31, 0x37, + 0x1D, 0x23, 0x2A, 0x37, + 0x1D, 0x37, 0x37, 0x37, + 0x1D, 0x1D, 0x37, 0x37, + 0x1D, 0x1D, 0x1D, 0x37, + 0x1D, 0x2B, 0x33, 0x3A, + 0x1D, 0x24, 0x33, 0x3A, + 0x1D, 0x24, 0x2C, 0x3A, + 0x1D, 0x3A, 0x3A, 0x3A, + 0x1D, 0x1D, 0x3A, 0x3A, + 0x1D, 0x1D, 0x1D, 0x3A, + 0x1D, 0x2D, 0x35, 0x3D, + 0x1D, 0x25, 0x35, 0x3D, + 0x1D, 0x25, 0x2D, 0x3D, + 0x1D, 0x3D, 0x3D, 0x3D, + 0x1D, 0x1D, 0x3D, 0x3D, + 0x1D, 0x1D, 0x1D, 0x3D, + 0x1E, 0x1F, 0x1F, 0x20, + 0x1E, 0x1F, 0x20, 0x21, + 0x1E, 0x20, 0x21, 0x22, + 0x1E, 0x1F, 0x21, 0x22, + 0x1E, 0x1F, 0x20, 0x22, + 0x1E, 0x20, 0x21, 0x23, + 0x1E, 0x20, 0x22, 0x23, + 0x1E, 0x1F, 0x22, 0x23, + 0x1E, 0x1F, 0x21, 0x23, + 0x1E, 0x20, 0x22, 0x24, + 0x1E, 0x21, 0x23, 0x24, + 0x1E, 0x1F, 0x23, 0x24, + 0x1E, 0x1F, 0x21, 0x24, + 0x1E, 0x24, 0x24, 0x24, + 0x1E, 0x1E, 0x24, 0x24, + 0x1E, 0x1E, 0x1E, 0x24, + 0x1E, 0x21, 0x22, 0x25, + 0x1E, 0x21, 0x24, 0x25, + 0x1E, 0x1F, 0x24, 0x25, + 0x1E, 0x1F, 0x22, 0x25, + 0x1E, 0x21, 0x23, 0x26, + 0x1E, 0x22, 0x24, 0x26, + 0x1E, 0x20, 0x24, 0x26, + 0x1E, 0x20, 0x22, 0x26, + 0x1E, 0x26, 0x26, 0x26, + 0x1E, 0x1E, 0x26, 0x26, + 0x1E, 0x1E, 0x1E, 0x26, + 0x1E, 0x22, 0x25, 0x29, + 0x1E, 0x23, 0x27, 0x29, + 0x1E, 0x20, 0x27, 0x29, + 0x1E, 0x20, 0x24, 0x29, + 0x1E, 0x29, 0x29, 0x29, + 0x1E, 0x1E, 0x29, 0x29, + 0x1E, 0x1E, 0x1E, 0x29, + 0x1E, 0x23, 0x27, 0x2C, + 0x1E, 0x25, 0x29, 0x2C, + 0x1E, 0x21, 0x29, 0x2C, + 0x1E, 0x21, 0x25, 0x2C, + 0x1E, 0x2C, 0x2C, 0x2C, + 0x1E, 0x1E, 0x2C, 0x2C, + 0x1E, 0x1E, 0x1E, 0x2C, + 0x1E, 0x24, 0x29, 0x2F, + 0x1E, 0x26, 0x2B, 0x2F, + 0x1E, 0x22, 0x2B, 0x2F, + 0x1E, 0x22, 0x27, 0x2F, + 0x1E, 0x2F, 0x2F, 0x2F, + 0x1E, 0x1E, 0x2F, 0x2F, + 0x1E, 0x1E, 0x1E, 0x2F, + 0x1E, 0x25, 0x2B, 0x32, + 0x1E, 0x28, 0x2D, 0x32, + 0x1E, 0x23, 0x2D, 0x32, + 0x1E, 0x23, 0x28, 0x32, + 0x1E, 0x32, 0x32, 0x32, + 0x1E, 0x1E, 0x32, 0x32, + 0x1E, 0x1E, 0x1E, 0x32, + 0x1E, 0x29, 0x30, 0x35, + 0x1E, 0x23, 0x30, 0x35, + 0x1E, 0x23, 0x2A, 0x35, + 0x1E, 0x35, 0x35, 0x35, + 0x1E, 0x1E, 0x35, 0x35, + 0x1E, 0x1E, 0x1E, 0x35, + 0x1E, 0x2B, 0x32, 0x38, + 0x1E, 0x24, 0x32, 0x38, + 0x1E, 0x24, 0x2B, 0x38, + 0x1E, 0x38, 0x38, 0x38, + 0x1E, 0x1E, 0x38, 0x38, + 0x1E, 0x1E, 0x1E, 0x38, + 0x1E, 0x2C, 0x34, 0x3B, + 0x1E, 0x25, 0x34, 0x3B, + 0x1E, 0x25, 0x2D, 0x3B, + 0x1E, 0x3B, 0x3B, 0x3B, + 0x1E, 0x1E, 0x3B, 0x3B, + 0x1E, 0x1E, 0x1E, 0x3B, + 0x1E, 0x2E, 0x36, 0x3E, + 0x1E, 0x26, 0x36, 0x3E, + 0x1E, 0x26, 0x2E, 0x3E, + 0x1E, 0x3E, 0x3E, 0x3E, + 0x1E, 0x1E, 0x3E, 0x3E, + 0x1E, 0x1E, 0x1E, 0x3E, + 0x1F, 0x20, 0x20, 0x21, + 0x1F, 0x20, 0x21, 0x22, + 0x1F, 0x21, 0x22, 0x23, + 0x1F, 0x20, 0x22, 0x23, + 0x1F, 0x20, 0x21, 0x23, + 0x1F, 0x21, 0x22, 0x24, + 0x1F, 0x21, 0x23, 0x24, + 0x1F, 0x20, 0x23, 0x24, + 0x1F, 0x20, 0x22, 0x24, + 0x1F, 0x21, 0x23, 0x25, + 0x1F, 0x22, 0x24, 0x25, + 0x1F, 0x20, 0x24, 0x25, + 0x1F, 0x20, 0x22, 0x25, + 0x1F, 0x25, 0x25, 0x25, + 0x1F, 0x1F, 0x25, 0x25, + 0x1F, 0x1F, 0x1F, 0x25, + 0x1F, 0x22, 0x23, 0x26, + 0x1F, 0x22, 0x25, 0x26, + 0x1F, 0x20, 0x25, 0x26, + 0x1F, 0x20, 0x23, 0x26, + 0x1F, 0x22, 0x24, 0x27, + 0x1F, 0x23, 0x25, 0x27, + 0x1F, 0x21, 0x25, 0x27, + 0x1F, 0x21, 0x23, 0x27, + 0x1F, 0x27, 0x27, 0x27, + 0x1F, 0x1F, 0x27, 0x27, + 0x1F, 0x1F, 0x1F, 0x27, + 0x1F, 0x23, 0x26, 0x2A, + 0x1F, 0x24, 0x28, 0x2A, + 0x1F, 0x21, 0x28, 0x2A, + 0x1F, 0x21, 0x25, 0x2A, + 0x1F, 0x2A, 0x2A, 0x2A, + 0x1F, 0x1F, 0x2A, 0x2A, + 0x1F, 0x1F, 0x1F, 0x2A, + 0x1F, 0x24, 0x28, 0x2D, + 0x1F, 0x26, 0x2A, 0x2D, + 0x1F, 0x22, 0x2A, 0x2D, + 0x1F, 0x22, 0x26, 0x2D, + 0x1F, 0x2D, 0x2D, 0x2D, + 0x1F, 0x1F, 0x2D, 0x2D, + 0x1F, 0x1F, 0x1F, 0x2D, + 0x1F, 0x25, 0x2A, 0x30, + 0x1F, 0x27, 0x2C, 0x30, + 0x1F, 0x23, 0x2C, 0x30, + 0x1F, 0x23, 0x28, 0x30, + 0x1F, 0x30, 0x30, 0x30, + 0x1F, 0x1F, 0x30, 0x30, + 0x1F, 0x1F, 0x1F, 0x30, + 0x1F, 0x26, 0x2C, 0x33, + 0x1F, 0x29, 0x2E, 0x33, + 0x1F, 0x24, 0x2E, 0x33, + 0x1F, 0x24, 0x29, 0x33, + 0x1F, 0x33, 0x33, 0x33, + 0x1F, 0x1F, 0x33, 0x33, + 0x1F, 0x1F, 0x1F, 0x33, + 0x1F, 0x2A, 0x31, 0x36, + 0x1F, 0x24, 0x31, 0x36, + 0x1F, 0x24, 0x2B, 0x36, + 0x1F, 0x36, 0x36, 0x36, + 0x1F, 0x1F, 0x36, 0x36, + 0x1F, 0x1F, 0x1F, 0x36, + 0x1F, 0x2C, 0x33, 0x39, + 0x1F, 0x25, 0x33, 0x39, + 0x1F, 0x25, 0x2C, 0x39, + 0x1F, 0x39, 0x39, 0x39, + 0x1F, 0x1F, 0x39, 0x39, + 0x1F, 0x1F, 0x1F, 0x39, + 0x1F, 0x2D, 0x35, 0x3C, + 0x1F, 0x26, 0x35, 0x3C, + 0x1F, 0x26, 0x2E, 0x3C, + 0x1F, 0x3C, 0x3C, 0x3C, + 0x1F, 0x1F, 0x3C, 0x3C, + 0x1F, 0x1F, 0x1F, 0x3C, + 0x1F, 0x2F, 0x37, 0x3F, + 0x1F, 0x27, 0x37, 0x3F, + 0x1F, 0x27, 0x2F, 0x3F, + 0x1F, 0x3F, 0x3F, 0x3F, + 0x1F, 0x1F, 0x3F, 0x3F, + 0x1F, 0x1F, 0x1F, 0x3F, + 0x20, 0x21, 0x21, 0x22, + 0x20, 0x21, 0x22, 0x23, + 0x20, 0x22, 0x23, 0x24, + 0x20, 0x21, 0x23, 0x24, + 0x20, 0x21, 0x22, 0x24, + 0x20, 0x22, 0x23, 0x25, + 0x20, 0x22, 0x24, 0x25, + 0x20, 0x21, 0x24, 0x25, + 0x20, 0x21, 0x23, 0x25, + 0x20, 0x22, 0x24, 0x26, + 0x20, 0x23, 0x25, 0x26, + 0x20, 0x21, 0x25, 0x26, + 0x20, 0x21, 0x23, 0x26, + 0x20, 0x26, 0x26, 0x26, + 0x20, 0x20, 0x26, 0x26, + 0x20, 0x20, 0x20, 0x26, + 0x20, 0x23, 0x24, 0x27, + 0x20, 0x23, 0x26, 0x27, + 0x20, 0x21, 0x26, 0x27, + 0x20, 0x21, 0x24, 0x27, + 0x20, 0x23, 0x25, 0x28, + 0x20, 0x24, 0x26, 0x28, + 0x20, 0x22, 0x26, 0x28, + 0x20, 0x22, 0x24, 0x28, + 0x20, 0x28, 0x28, 0x28, + 0x20, 0x20, 0x28, 0x28, + 0x20, 0x20, 0x20, 0x28, + 0x20, 0x24, 0x27, 0x2B, + 0x20, 0x25, 0x29, 0x2B, + 0x20, 0x22, 0x29, 0x2B, + 0x20, 0x22, 0x26, 0x2B, + 0x20, 0x2B, 0x2B, 0x2B, + 0x20, 0x20, 0x2B, 0x2B, + 0x20, 0x20, 0x20, 0x2B, + 0x20, 0x25, 0x29, 0x2E, + 0x20, 0x27, 0x2B, 0x2E, + 0x20, 0x23, 0x2B, 0x2E, + 0x20, 0x23, 0x27, 0x2E, + 0x20, 0x2E, 0x2E, 0x2E, + 0x20, 0x20, 0x2E, 0x2E, + 0x20, 0x20, 0x20, 0x2E, + 0x20, 0x26, 0x2B, 0x31, + 0x20, 0x28, 0x2D, 0x31, + 0x20, 0x24, 0x2D, 0x31, + 0x20, 0x24, 0x29, 0x31, + 0x20, 0x31, 0x31, 0x31, + 0x20, 0x20, 0x31, 0x31, + 0x20, 0x20, 0x20, 0x31, + 0x20, 0x27, 0x2D, 0x34, + 0x20, 0x2A, 0x2F, 0x34, + 0x20, 0x25, 0x2F, 0x34, + 0x20, 0x25, 0x2A, 0x34, + 0x20, 0x34, 0x34, 0x34, + 0x20, 0x20, 0x34, 0x34, + 0x20, 0x20, 0x20, 0x34, + 0x20, 0x2B, 0x32, 0x37, + 0x20, 0x25, 0x32, 0x37, + 0x20, 0x25, 0x2C, 0x37, + 0x20, 0x37, 0x37, 0x37, + 0x20, 0x20, 0x37, 0x37, + 0x20, 0x20, 0x20, 0x37, + 0x20, 0x2D, 0x34, 0x3A, + 0x20, 0x26, 0x34, 0x3A, + 0x20, 0x26, 0x2D, 0x3A, + 0x20, 0x3A, 0x3A, 0x3A, + 0x20, 0x20, 0x3A, 0x3A, + 0x20, 0x20, 0x20, 0x3A, + 0x20, 0x2E, 0x36, 0x3D, + 0x20, 0x27, 0x36, 0x3D, + 0x20, 0x27, 0x2F, 0x3D, + 0x20, 0x3D, 0x3D, 0x3D, + 0x20, 0x20, 0x3D, 0x3D, + 0x20, 0x20, 0x20, 0x3D, + 0x21, 0x22, 0x22, 0x23, + 0x21, 0x22, 0x23, 0x24, + 0x21, 0x23, 0x24, 0x25, + 0x21, 0x22, 0x24, 0x25, + 0x21, 0x22, 0x23, 0x25, + 0x21, 0x23, 0x24, 0x26, + 0x21, 0x23, 0x25, 0x26, + 0x21, 0x22, 0x25, 0x26, + 0x21, 0x22, 0x24, 0x26, + 0x21, 0x23, 0x25, 0x27, + 0x21, 0x24, 0x26, 0x27, + 0x21, 0x22, 0x26, 0x27, + 0x21, 0x22, 0x24, 0x27, + 0x21, 0x27, 0x27, 0x27, + 0x21, 0x21, 0x27, 0x27, + 0x21, 0x21, 0x21, 0x27, + 0x21, 0x24, 0x25, 0x28, + 0x21, 0x24, 0x27, 0x28, + 0x21, 0x22, 0x27, 0x28, + 0x21, 0x22, 0x25, 0x28, + 0x21, 0x24, 0x26, 0x29, + 0x21, 0x25, 0x27, 0x29, + 0x21, 0x23, 0x27, 0x29, + 0x21, 0x23, 0x25, 0x29, + 0x21, 0x29, 0x29, 0x29, + 0x21, 0x21, 0x29, 0x29, + 0x21, 0x21, 0x21, 0x29, + 0x21, 0x25, 0x28, 0x2C, + 0x21, 0x26, 0x2A, 0x2C, + 0x21, 0x23, 0x2A, 0x2C, + 0x21, 0x23, 0x27, 0x2C, + 0x21, 0x2C, 0x2C, 0x2C, + 0x21, 0x21, 0x2C, 0x2C, + 0x21, 0x21, 0x21, 0x2C, + 0x21, 0x26, 0x2A, 0x2F, + 0x21, 0x28, 0x2C, 0x2F, + 0x21, 0x24, 0x2C, 0x2F, + 0x21, 0x24, 0x28, 0x2F, + 0x21, 0x2F, 0x2F, 0x2F, + 0x21, 0x21, 0x2F, 0x2F, + 0x21, 0x21, 0x21, 0x2F, + 0x21, 0x27, 0x2C, 0x32, + 0x21, 0x29, 0x2E, 0x32, + 0x21, 0x25, 0x2E, 0x32, + 0x21, 0x25, 0x2A, 0x32, + 0x21, 0x32, 0x32, 0x32, + 0x21, 0x21, 0x32, 0x32, + 0x21, 0x21, 0x21, 0x32, + 0x21, 0x28, 0x2E, 0x35, + 0x21, 0x2B, 0x30, 0x35, + 0x21, 0x26, 0x30, 0x35, + 0x21, 0x26, 0x2B, 0x35, + 0x21, 0x35, 0x35, 0x35, + 0x21, 0x21, 0x35, 0x35, + 0x21, 0x21, 0x21, 0x35, + 0x21, 0x2C, 0x33, 0x38, + 0x21, 0x26, 0x33, 0x38, + 0x21, 0x26, 0x2D, 0x38, + 0x21, 0x38, 0x38, 0x38, + 0x21, 0x21, 0x38, 0x38, + 0x21, 0x21, 0x21, 0x38, + 0x21, 0x2E, 0x35, 0x3B, + 0x21, 0x27, 0x35, 0x3B, + 0x21, 0x27, 0x2E, 0x3B, + 0x21, 0x3B, 0x3B, 0x3B, + 0x21, 0x21, 0x3B, 0x3B, + 0x21, 0x21, 0x21, 0x3B, + 0x21, 0x2F, 0x37, 0x3E, + 0x21, 0x28, 0x37, 0x3E, + 0x21, 0x28, 0x30, 0x3E, + 0x21, 0x3E, 0x3E, 0x3E, + 0x21, 0x21, 0x3E, 0x3E, + 0x21, 0x21, 0x21, 0x3E, + 0x22, 0x23, 0x23, 0x24, + 0x22, 0x23, 0x24, 0x25, + 0x22, 0x24, 0x25, 0x26, + 0x22, 0x23, 0x25, 0x26, + 0x22, 0x23, 0x24, 0x26, + 0x22, 0x24, 0x25, 0x27, + 0x22, 0x24, 0x26, 0x27, + 0x22, 0x23, 0x26, 0x27, + 0x22, 0x23, 0x25, 0x27, + 0x22, 0x24, 0x26, 0x28, + 0x22, 0x25, 0x27, 0x28, + 0x22, 0x23, 0x27, 0x28, + 0x22, 0x23, 0x25, 0x28, + 0x22, 0x28, 0x28, 0x28, + 0x22, 0x22, 0x28, 0x28, + 0x22, 0x22, 0x22, 0x28, + 0x22, 0x25, 0x26, 0x29, + 0x22, 0x25, 0x28, 0x29, + 0x22, 0x23, 0x28, 0x29, + 0x22, 0x23, 0x26, 0x29, + 0x22, 0x25, 0x27, 0x2A, + 0x22, 0x26, 0x28, 0x2A, + 0x22, 0x24, 0x28, 0x2A, + 0x22, 0x24, 0x26, 0x2A, + 0x22, 0x2A, 0x2A, 0x2A, + 0x22, 0x22, 0x2A, 0x2A, + 0x22, 0x22, 0x22, 0x2A, + 0x22, 0x26, 0x29, 0x2D, + 0x22, 0x27, 0x2B, 0x2D, + 0x22, 0x24, 0x2B, 0x2D, + 0x22, 0x24, 0x28, 0x2D, + 0x22, 0x2D, 0x2D, 0x2D, + 0x22, 0x22, 0x2D, 0x2D, + 0x22, 0x22, 0x22, 0x2D, + 0x22, 0x27, 0x2B, 0x30, + 0x22, 0x29, 0x2D, 0x30, + 0x22, 0x25, 0x2D, 0x30, + 0x22, 0x25, 0x29, 0x30, + 0x22, 0x30, 0x30, 0x30, + 0x22, 0x22, 0x30, 0x30, + 0x22, 0x22, 0x22, 0x30, + 0x22, 0x28, 0x2D, 0x33, + 0x22, 0x2A, 0x2F, 0x33, + 0x22, 0x26, 0x2F, 0x33, + 0x22, 0x26, 0x2B, 0x33, + 0x22, 0x33, 0x33, 0x33, + 0x22, 0x22, 0x33, 0x33, + 0x22, 0x22, 0x22, 0x33, + 0x22, 0x29, 0x2F, 0x36, + 0x22, 0x2C, 0x31, 0x36, + 0x22, 0x27, 0x31, 0x36, + 0x22, 0x27, 0x2C, 0x36, + 0x22, 0x36, 0x36, 0x36, + 0x22, 0x22, 0x36, 0x36, + 0x22, 0x22, 0x22, 0x36, + 0x22, 0x2D, 0x34, 0x39, + 0x22, 0x27, 0x34, 0x39, + 0x22, 0x27, 0x2E, 0x39, + 0x22, 0x39, 0x39, 0x39, + 0x22, 0x22, 0x39, 0x39, + 0x22, 0x22, 0x22, 0x39, + 0x22, 0x2F, 0x36, 0x3C, + 0x22, 0x28, 0x36, 0x3C, + 0x22, 0x28, 0x2F, 0x3C, + 0x22, 0x3C, 0x3C, 0x3C, + 0x22, 0x22, 0x3C, 0x3C, + 0x22, 0x22, 0x22, 0x3C, + 0x22, 0x30, 0x38, 0x3F, + 0x22, 0x29, 0x38, 0x3F, + 0x22, 0x29, 0x31, 0x3F, + 0x22, 0x3F, 0x3F, 0x3F, + 0x22, 0x22, 0x3F, 0x3F, + 0x22, 0x22, 0x22, 0x3F, + 0x23, 0x24, 0x24, 0x25, + 0x23, 0x24, 0x25, 0x26, + 0x23, 0x25, 0x26, 0x27, + 0x23, 0x24, 0x26, 0x27, + 0x23, 0x24, 0x25, 0x27, + 0x23, 0x25, 0x26, 0x28, + 0x23, 0x25, 0x27, 0x28, + 0x23, 0x24, 0x27, 0x28, + 0x23, 0x24, 0x26, 0x28, + 0x23, 0x25, 0x27, 0x29, + 0x23, 0x26, 0x28, 0x29, + 0x23, 0x24, 0x28, 0x29, + 0x23, 0x24, 0x26, 0x29, + 0x23, 0x29, 0x29, 0x29, + 0x23, 0x23, 0x29, 0x29, + 0x23, 0x23, 0x23, 0x29, + 0x23, 0x26, 0x27, 0x2A, + 0x23, 0x26, 0x29, 0x2A, + 0x23, 0x24, 0x29, 0x2A, + 0x23, 0x24, 0x27, 0x2A, + 0x23, 0x26, 0x28, 0x2B, + 0x23, 0x27, 0x29, 0x2B, + 0x23, 0x25, 0x29, 0x2B, + 0x23, 0x25, 0x27, 0x2B, + 0x23, 0x2B, 0x2B, 0x2B, + 0x23, 0x23, 0x2B, 0x2B, + 0x23, 0x23, 0x23, 0x2B, + 0x23, 0x27, 0x2A, 0x2E, + 0x23, 0x28, 0x2C, 0x2E, + 0x23, 0x25, 0x2C, 0x2E, + 0x23, 0x25, 0x29, 0x2E, + 0x23, 0x2E, 0x2E, 0x2E, + 0x23, 0x23, 0x2E, 0x2E, + 0x23, 0x23, 0x23, 0x2E, + 0x23, 0x28, 0x2C, 0x31, + 0x23, 0x2A, 0x2E, 0x31, + 0x23, 0x26, 0x2E, 0x31, + 0x23, 0x26, 0x2A, 0x31, + 0x23, 0x31, 0x31, 0x31, + 0x23, 0x23, 0x31, 0x31, + 0x23, 0x23, 0x23, 0x31, + 0x23, 0x29, 0x2E, 0x34, + 0x23, 0x2B, 0x30, 0x34, + 0x23, 0x27, 0x30, 0x34, + 0x23, 0x27, 0x2C, 0x34, + 0x23, 0x34, 0x34, 0x34, + 0x23, 0x23, 0x34, 0x34, + 0x23, 0x23, 0x23, 0x34, + 0x23, 0x2A, 0x30, 0x37, + 0x23, 0x2D, 0x32, 0x37, + 0x23, 0x28, 0x32, 0x37, + 0x23, 0x28, 0x2D, 0x37, + 0x23, 0x37, 0x37, 0x37, + 0x23, 0x23, 0x37, 0x37, + 0x23, 0x23, 0x23, 0x37, + 0x23, 0x2E, 0x35, 0x3A, + 0x23, 0x28, 0x35, 0x3A, + 0x23, 0x28, 0x2F, 0x3A, + 0x23, 0x3A, 0x3A, 0x3A, + 0x23, 0x23, 0x3A, 0x3A, + 0x23, 0x23, 0x23, 0x3A, + 0x23, 0x30, 0x37, 0x3D, + 0x23, 0x29, 0x37, 0x3D, + 0x23, 0x29, 0x30, 0x3D, + 0x23, 0x3D, 0x3D, 0x3D, + 0x23, 0x23, 0x3D, 0x3D, + 0x23, 0x23, 0x23, 0x3D, + 0x24, 0x25, 0x25, 0x26, + 0x24, 0x25, 0x26, 0x27, + 0x24, 0x26, 0x27, 0x28, + 0x24, 0x25, 0x27, 0x28, + 0x24, 0x25, 0x26, 0x28, + 0x24, 0x26, 0x27, 0x29, + 0x24, 0x26, 0x28, 0x29, + 0x24, 0x25, 0x28, 0x29, + 0x24, 0x25, 0x27, 0x29, + 0x24, 0x26, 0x28, 0x2A, + 0x24, 0x27, 0x29, 0x2A, + 0x24, 0x25, 0x29, 0x2A, + 0x24, 0x25, 0x27, 0x2A, + 0x24, 0x2A, 0x2A, 0x2A, + 0x24, 0x24, 0x2A, 0x2A, + 0x24, 0x24, 0x24, 0x2A, + 0x24, 0x27, 0x28, 0x2B, + 0x24, 0x27, 0x2A, 0x2B, + 0x24, 0x25, 0x2A, 0x2B, + 0x24, 0x25, 0x28, 0x2B, + 0x24, 0x27, 0x29, 0x2C, + 0x24, 0x28, 0x2A, 0x2C, + 0x24, 0x26, 0x2A, 0x2C, + 0x24, 0x26, 0x28, 0x2C, + 0x24, 0x2C, 0x2C, 0x2C, + 0x24, 0x24, 0x2C, 0x2C, + 0x24, 0x24, 0x24, 0x2C, + 0x24, 0x28, 0x2B, 0x2F, + 0x24, 0x29, 0x2D, 0x2F, + 0x24, 0x26, 0x2D, 0x2F, + 0x24, 0x26, 0x2A, 0x2F, + 0x24, 0x2F, 0x2F, 0x2F, + 0x24, 0x24, 0x2F, 0x2F, + 0x24, 0x24, 0x24, 0x2F, + 0x24, 0x29, 0x2D, 0x32, + 0x24, 0x2B, 0x2F, 0x32, + 0x24, 0x27, 0x2F, 0x32, + 0x24, 0x27, 0x2B, 0x32, + 0x24, 0x32, 0x32, 0x32, + 0x24, 0x24, 0x32, 0x32, + 0x24, 0x24, 0x24, 0x32, + 0x24, 0x2A, 0x2F, 0x35, + 0x24, 0x2C, 0x31, 0x35, + 0x24, 0x28, 0x31, 0x35, + 0x24, 0x28, 0x2D, 0x35, + 0x24, 0x35, 0x35, 0x35, + 0x24, 0x24, 0x35, 0x35, + 0x24, 0x24, 0x24, 0x35, + 0x24, 0x2B, 0x31, 0x38, + 0x24, 0x2E, 0x33, 0x38, + 0x24, 0x29, 0x33, 0x38, + 0x24, 0x29, 0x2E, 0x38, + 0x24, 0x38, 0x38, 0x38, + 0x24, 0x24, 0x38, 0x38, + 0x24, 0x24, 0x24, 0x38, + 0x24, 0x2F, 0x36, 0x3B, + 0x24, 0x29, 0x36, 0x3B, + 0x24, 0x29, 0x30, 0x3B, + 0x24, 0x3B, 0x3B, 0x3B, + 0x24, 0x24, 0x3B, 0x3B, + 0x24, 0x24, 0x24, 0x3B, + 0x24, 0x31, 0x38, 0x3E, + 0x24, 0x2A, 0x38, 0x3E, + 0x24, 0x2A, 0x31, 0x3E, + 0x24, 0x3E, 0x3E, 0x3E, + 0x24, 0x24, 0x3E, 0x3E, + 0x24, 0x24, 0x24, 0x3E, + 0x25, 0x26, 0x26, 0x27, + 0x25, 0x26, 0x27, 0x28, + 0x25, 0x27, 0x28, 0x29, + 0x25, 0x26, 0x28, 0x29, + 0x25, 0x26, 0x27, 0x29, + 0x25, 0x27, 0x28, 0x2A, + 0x25, 0x27, 0x29, 0x2A, + 0x25, 0x26, 0x29, 0x2A, + 0x25, 0x26, 0x28, 0x2A, + 0x25, 0x27, 0x29, 0x2B, + 0x25, 0x28, 0x2A, 0x2B, + 0x25, 0x26, 0x2A, 0x2B, + 0x25, 0x26, 0x28, 0x2B, + 0x25, 0x2B, 0x2B, 0x2B, + 0x25, 0x25, 0x2B, 0x2B, + 0x25, 0x25, 0x25, 0x2B, + 0x25, 0x28, 0x29, 0x2C, + 0x25, 0x28, 0x2B, 0x2C, + 0x25, 0x26, 0x2B, 0x2C, + 0x25, 0x26, 0x29, 0x2C, + 0x25, 0x28, 0x2A, 0x2D, + 0x25, 0x29, 0x2B, 0x2D, + 0x25, 0x27, 0x2B, 0x2D, + 0x25, 0x27, 0x29, 0x2D, + 0x25, 0x2D, 0x2D, 0x2D, + 0x25, 0x25, 0x2D, 0x2D, + 0x25, 0x25, 0x25, 0x2D, + 0x25, 0x29, 0x2C, 0x30, + 0x25, 0x2A, 0x2E, 0x30, + 0x25, 0x27, 0x2E, 0x30, + 0x25, 0x27, 0x2B, 0x30, + 0x25, 0x30, 0x30, 0x30, + 0x25, 0x25, 0x30, 0x30, + 0x25, 0x25, 0x25, 0x30, + 0x25, 0x2A, 0x2E, 0x33, + 0x25, 0x2C, 0x30, 0x33, + 0x25, 0x28, 0x30, 0x33, + 0x25, 0x28, 0x2C, 0x33, + 0x25, 0x33, 0x33, 0x33, + 0x25, 0x25, 0x33, 0x33, + 0x25, 0x25, 0x25, 0x33, + 0x25, 0x2B, 0x30, 0x36, + 0x25, 0x2D, 0x32, 0x36, + 0x25, 0x29, 0x32, 0x36, + 0x25, 0x29, 0x2E, 0x36, + 0x25, 0x36, 0x36, 0x36, + 0x25, 0x25, 0x36, 0x36, + 0x25, 0x25, 0x25, 0x36, + 0x25, 0x2C, 0x32, 0x39, + 0x25, 0x2F, 0x34, 0x39, + 0x25, 0x2A, 0x34, 0x39, + 0x25, 0x2A, 0x2F, 0x39, + 0x25, 0x39, 0x39, 0x39, + 0x25, 0x25, 0x39, 0x39, + 0x25, 0x25, 0x25, 0x39, + 0x25, 0x30, 0x37, 0x3C, + 0x25, 0x2A, 0x37, 0x3C, + 0x25, 0x2A, 0x31, 0x3C, + 0x25, 0x3C, 0x3C, 0x3C, + 0x25, 0x25, 0x3C, 0x3C, + 0x25, 0x25, 0x25, 0x3C, + 0x25, 0x32, 0x39, 0x3F, + 0x25, 0x2B, 0x39, 0x3F, + 0x25, 0x2B, 0x32, 0x3F, + 0x25, 0x3F, 0x3F, 0x3F, + 0x25, 0x25, 0x3F, 0x3F, + 0x25, 0x25, 0x25, 0x3F, + 0x26, 0x27, 0x27, 0x28, + 0x26, 0x27, 0x28, 0x29, + 0x26, 0x28, 0x29, 0x2A, + 0x26, 0x27, 0x29, 0x2A, + 0x26, 0x27, 0x28, 0x2A, + 0x26, 0x28, 0x29, 0x2B, + 0x26, 0x28, 0x2A, 0x2B, + 0x26, 0x27, 0x2A, 0x2B, + 0x26, 0x27, 0x29, 0x2B, + 0x26, 0x28, 0x2A, 0x2C, + 0x26, 0x29, 0x2B, 0x2C, + 0x26, 0x27, 0x2B, 0x2C, + 0x26, 0x27, 0x29, 0x2C, + 0x26, 0x2C, 0x2C, 0x2C, + 0x26, 0x26, 0x2C, 0x2C, + 0x26, 0x26, 0x26, 0x2C, + 0x26, 0x29, 0x2A, 0x2D, + 0x26, 0x29, 0x2C, 0x2D, + 0x26, 0x27, 0x2C, 0x2D, + 0x26, 0x27, 0x2A, 0x2D, + 0x26, 0x29, 0x2B, 0x2E, + 0x26, 0x2A, 0x2C, 0x2E, + 0x26, 0x28, 0x2C, 0x2E, + 0x26, 0x28, 0x2A, 0x2E, + 0x26, 0x2E, 0x2E, 0x2E, + 0x26, 0x26, 0x2E, 0x2E, + 0x26, 0x26, 0x26, 0x2E, + 0x26, 0x2A, 0x2D, 0x31, + 0x26, 0x2B, 0x2F, 0x31, + 0x26, 0x28, 0x2F, 0x31, + 0x26, 0x28, 0x2C, 0x31, + 0x26, 0x31, 0x31, 0x31, + 0x26, 0x26, 0x31, 0x31, + 0x26, 0x26, 0x26, 0x31, + 0x26, 0x2B, 0x2F, 0x34, + 0x26, 0x2D, 0x31, 0x34, + 0x26, 0x29, 0x31, 0x34, + 0x26, 0x29, 0x2D, 0x34, + 0x26, 0x34, 0x34, 0x34, + 0x26, 0x26, 0x34, 0x34, + 0x26, 0x26, 0x26, 0x34, + 0x26, 0x2C, 0x31, 0x37, + 0x26, 0x2E, 0x33, 0x37, + 0x26, 0x2A, 0x33, 0x37, + 0x26, 0x2A, 0x2F, 0x37, + 0x26, 0x37, 0x37, 0x37, + 0x26, 0x26, 0x37, 0x37, + 0x26, 0x26, 0x26, 0x37, + 0x26, 0x2D, 0x33, 0x3A, + 0x26, 0x30, 0x35, 0x3A, + 0x26, 0x2B, 0x35, 0x3A, + 0x26, 0x2B, 0x30, 0x3A, + 0x26, 0x3A, 0x3A, 0x3A, + 0x26, 0x26, 0x3A, 0x3A, + 0x26, 0x26, 0x26, 0x3A, + 0x26, 0x31, 0x38, 0x3D, + 0x26, 0x2B, 0x38, 0x3D, + 0x26, 0x2B, 0x32, 0x3D, + 0x26, 0x3D, 0x3D, 0x3D, + 0x26, 0x26, 0x3D, 0x3D, + 0x26, 0x26, 0x26, 0x3D, + 0x27, 0x28, 0x28, 0x29, + 0x27, 0x28, 0x29, 0x2A, + 0x27, 0x29, 0x2A, 0x2B, + 0x27, 0x28, 0x2A, 0x2B, + 0x27, 0x28, 0x29, 0x2B, + 0x27, 0x29, 0x2A, 0x2C, + 0x27, 0x29, 0x2B, 0x2C, + 0x27, 0x28, 0x2B, 0x2C, + 0x27, 0x28, 0x2A, 0x2C, + 0x27, 0x29, 0x2B, 0x2D, + 0x27, 0x2A, 0x2C, 0x2D, + 0x27, 0x28, 0x2C, 0x2D, + 0x27, 0x28, 0x2A, 0x2D, + 0x27, 0x2D, 0x2D, 0x2D, + 0x27, 0x27, 0x2D, 0x2D, + 0x27, 0x27, 0x27, 0x2D, + 0x27, 0x2A, 0x2B, 0x2E, + 0x27, 0x2A, 0x2D, 0x2E, + 0x27, 0x28, 0x2D, 0x2E, + 0x27, 0x28, 0x2B, 0x2E, + 0x27, 0x2A, 0x2C, 0x2F, + 0x27, 0x2B, 0x2D, 0x2F, + 0x27, 0x29, 0x2D, 0x2F, + 0x27, 0x29, 0x2B, 0x2F, + 0x27, 0x2F, 0x2F, 0x2F, + 0x27, 0x27, 0x2F, 0x2F, + 0x27, 0x27, 0x27, 0x2F, + 0x27, 0x2B, 0x2E, 0x32, + 0x27, 0x2C, 0x30, 0x32, + 0x27, 0x29, 0x30, 0x32, + 0x27, 0x29, 0x2D, 0x32, + 0x27, 0x32, 0x32, 0x32, + 0x27, 0x27, 0x32, 0x32, + 0x27, 0x27, 0x27, 0x32, + 0x27, 0x2C, 0x30, 0x35, + 0x27, 0x2E, 0x32, 0x35, + 0x27, 0x2A, 0x32, 0x35, + 0x27, 0x2A, 0x2E, 0x35, + 0x27, 0x35, 0x35, 0x35, + 0x27, 0x27, 0x35, 0x35, + 0x27, 0x27, 0x27, 0x35, + 0x27, 0x2D, 0x32, 0x38, + 0x27, 0x2F, 0x34, 0x38, + 0x27, 0x2B, 0x34, 0x38, + 0x27, 0x2B, 0x30, 0x38, + 0x27, 0x38, 0x38, 0x38, + 0x27, 0x27, 0x38, 0x38, + 0x27, 0x27, 0x27, 0x38, + 0x27, 0x2E, 0x34, 0x3B, + 0x27, 0x31, 0x36, 0x3B, + 0x27, 0x2C, 0x36, 0x3B, + 0x27, 0x2C, 0x31, 0x3B, + 0x27, 0x3B, 0x3B, 0x3B, + 0x27, 0x27, 0x3B, 0x3B, + 0x27, 0x27, 0x27, 0x3B, + 0x27, 0x32, 0x39, 0x3E, + 0x27, 0x2C, 0x39, 0x3E, + 0x27, 0x2C, 0x33, 0x3E, + 0x27, 0x3E, 0x3E, 0x3E, + 0x27, 0x27, 0x3E, 0x3E, + 0x27, 0x27, 0x27, 0x3E, + 0x28, 0x29, 0x29, 0x2A, + 0x28, 0x29, 0x2A, 0x2B, + 0x28, 0x2A, 0x2B, 0x2C, + 0x28, 0x29, 0x2B, 0x2C, + 0x28, 0x29, 0x2A, 0x2C, + 0x28, 0x2A, 0x2B, 0x2D, + 0x28, 0x2A, 0x2C, 0x2D, + 0x28, 0x29, 0x2C, 0x2D, + 0x28, 0x29, 0x2B, 0x2D, + 0x28, 0x2A, 0x2C, 0x2E, + 0x28, 0x2B, 0x2D, 0x2E, + 0x28, 0x29, 0x2D, 0x2E, + 0x28, 0x29, 0x2B, 0x2E, + 0x28, 0x2E, 0x2E, 0x2E, + 0x28, 0x28, 0x2E, 0x2E, + 0x28, 0x28, 0x28, 0x2E, + 0x28, 0x2B, 0x2C, 0x2F, + 0x28, 0x2B, 0x2E, 0x2F, + 0x28, 0x29, 0x2E, 0x2F, + 0x28, 0x29, 0x2C, 0x2F, + 0x28, 0x2B, 0x2D, 0x30, + 0x28, 0x2C, 0x2E, 0x30, + 0x28, 0x2A, 0x2E, 0x30, + 0x28, 0x2A, 0x2C, 0x30, + 0x28, 0x30, 0x30, 0x30, + 0x28, 0x28, 0x30, 0x30, + 0x28, 0x28, 0x28, 0x30, + 0x28, 0x2C, 0x2F, 0x33, + 0x28, 0x2D, 0x31, 0x33, + 0x28, 0x2A, 0x31, 0x33, + 0x28, 0x2A, 0x2E, 0x33, + 0x28, 0x33, 0x33, 0x33, + 0x28, 0x28, 0x33, 0x33, + 0x28, 0x28, 0x28, 0x33, + 0x28, 0x2D, 0x31, 0x36, + 0x28, 0x2F, 0x33, 0x36, + 0x28, 0x2B, 0x33, 0x36, + 0x28, 0x2B, 0x2F, 0x36, + 0x28, 0x36, 0x36, 0x36, + 0x28, 0x28, 0x36, 0x36, + 0x28, 0x28, 0x28, 0x36, + 0x28, 0x2E, 0x33, 0x39, + 0x28, 0x30, 0x35, 0x39, + 0x28, 0x2C, 0x35, 0x39, + 0x28, 0x2C, 0x31, 0x39, + 0x28, 0x39, 0x39, 0x39, + 0x28, 0x28, 0x39, 0x39, + 0x28, 0x28, 0x28, 0x39, + 0x28, 0x2F, 0x35, 0x3C, + 0x28, 0x32, 0x37, 0x3C, + 0x28, 0x2D, 0x37, 0x3C, + 0x28, 0x2D, 0x32, 0x3C, + 0x28, 0x3C, 0x3C, 0x3C, + 0x28, 0x28, 0x3C, 0x3C, + 0x28, 0x28, 0x28, 0x3C, + 0x28, 0x33, 0x3A, 0x3F, + 0x28, 0x2D, 0x3A, 0x3F, + 0x28, 0x2D, 0x34, 0x3F, + 0x28, 0x3F, 0x3F, 0x3F, + 0x28, 0x28, 0x3F, 0x3F, + 0x28, 0x28, 0x28, 0x3F, + 0x29, 0x2A, 0x2A, 0x2B, + 0x29, 0x2A, 0x2B, 0x2C, + 0x29, 0x2B, 0x2C, 0x2D, + 0x29, 0x2A, 0x2C, 0x2D, + 0x29, 0x2A, 0x2B, 0x2D, + 0x29, 0x2B, 0x2C, 0x2E, + 0x29, 0x2B, 0x2D, 0x2E, + 0x29, 0x2A, 0x2D, 0x2E, + 0x29, 0x2A, 0x2C, 0x2E, + 0x29, 0x2B, 0x2D, 0x2F, + 0x29, 0x2C, 0x2E, 0x2F, + 0x29, 0x2A, 0x2E, 0x2F, + 0x29, 0x2A, 0x2C, 0x2F, + 0x29, 0x2F, 0x2F, 0x2F, + 0x29, 0x29, 0x2F, 0x2F, + 0x29, 0x29, 0x29, 0x2F, + 0x29, 0x2C, 0x2D, 0x30, + 0x29, 0x2C, 0x2F, 0x30, + 0x29, 0x2A, 0x2F, 0x30, + 0x29, 0x2A, 0x2D, 0x30, + 0x29, 0x2C, 0x2E, 0x31, + 0x29, 0x2D, 0x2F, 0x31, + 0x29, 0x2B, 0x2F, 0x31, + 0x29, 0x2B, 0x2D, 0x31, + 0x29, 0x31, 0x31, 0x31, + 0x29, 0x29, 0x31, 0x31, + 0x29, 0x29, 0x29, 0x31, + 0x29, 0x2D, 0x30, 0x34, + 0x29, 0x2E, 0x32, 0x34, + 0x29, 0x2B, 0x32, 0x34, + 0x29, 0x2B, 0x2F, 0x34, + 0x29, 0x34, 0x34, 0x34, + 0x29, 0x29, 0x34, 0x34, + 0x29, 0x29, 0x29, 0x34, + 0x29, 0x2E, 0x32, 0x37, + 0x29, 0x30, 0x34, 0x37, + 0x29, 0x2C, 0x34, 0x37, + 0x29, 0x2C, 0x30, 0x37, + 0x29, 0x37, 0x37, 0x37, + 0x29, 0x29, 0x37, 0x37, + 0x29, 0x29, 0x29, 0x37, + 0x29, 0x2F, 0x34, 0x3A, + 0x29, 0x31, 0x36, 0x3A, + 0x29, 0x2D, 0x36, 0x3A, + 0x29, 0x2D, 0x32, 0x3A, + 0x29, 0x3A, 0x3A, 0x3A, + 0x29, 0x29, 0x3A, 0x3A, + 0x29, 0x29, 0x29, 0x3A, + 0x29, 0x30, 0x36, 0x3D, + 0x29, 0x33, 0x38, 0x3D, + 0x29, 0x2E, 0x38, 0x3D, + 0x29, 0x2E, 0x33, 0x3D, + 0x29, 0x3D, 0x3D, 0x3D, + 0x29, 0x29, 0x3D, 0x3D, + 0x29, 0x29, 0x29, 0x3D, + 0x2A, 0x2B, 0x2B, 0x2C, + 0x2A, 0x2B, 0x2C, 0x2D, + 0x2A, 0x2C, 0x2D, 0x2E, + 0x2A, 0x2B, 0x2D, 0x2E, + 0x2A, 0x2B, 0x2C, 0x2E, + 0x2A, 0x2C, 0x2D, 0x2F, + 0x2A, 0x2C, 0x2E, 0x2F, + 0x2A, 0x2B, 0x2E, 0x2F, + 0x2A, 0x2B, 0x2D, 0x2F, + 0x2A, 0x2C, 0x2E, 0x30, + 0x2A, 0x2D, 0x2F, 0x30, + 0x2A, 0x2B, 0x2F, 0x30, + 0x2A, 0x2B, 0x2D, 0x30, + 0x2A, 0x30, 0x30, 0x30, + 0x2A, 0x2A, 0x30, 0x30, + 0x2A, 0x2A, 0x2A, 0x30, + 0x2A, 0x2D, 0x2E, 0x31, + 0x2A, 0x2D, 0x30, 0x31, + 0x2A, 0x2B, 0x30, 0x31, + 0x2A, 0x2B, 0x2E, 0x31, + 0x2A, 0x2D, 0x2F, 0x32, + 0x2A, 0x2E, 0x30, 0x32, + 0x2A, 0x2C, 0x30, 0x32, + 0x2A, 0x2C, 0x2E, 0x32, + 0x2A, 0x32, 0x32, 0x32, + 0x2A, 0x2A, 0x32, 0x32, + 0x2A, 0x2A, 0x2A, 0x32, + 0x2A, 0x2E, 0x31, 0x35, + 0x2A, 0x2F, 0x33, 0x35, + 0x2A, 0x2C, 0x33, 0x35, + 0x2A, 0x2C, 0x30, 0x35, + 0x2A, 0x35, 0x35, 0x35, + 0x2A, 0x2A, 0x35, 0x35, + 0x2A, 0x2A, 0x2A, 0x35, + 0x2A, 0x2F, 0x33, 0x38, + 0x2A, 0x31, 0x35, 0x38, + 0x2A, 0x2D, 0x35, 0x38, + 0x2A, 0x2D, 0x31, 0x38, + 0x2A, 0x38, 0x38, 0x38, + 0x2A, 0x2A, 0x38, 0x38, + 0x2A, 0x2A, 0x2A, 0x38, + 0x2A, 0x30, 0x35, 0x3B, + 0x2A, 0x32, 0x37, 0x3B, + 0x2A, 0x2E, 0x37, 0x3B, + 0x2A, 0x2E, 0x33, 0x3B, + 0x2A, 0x3B, 0x3B, 0x3B, + 0x2A, 0x2A, 0x3B, 0x3B, + 0x2A, 0x2A, 0x2A, 0x3B, + 0x2A, 0x31, 0x37, 0x3E, + 0x2A, 0x34, 0x39, 0x3E, + 0x2A, 0x2F, 0x39, 0x3E, + 0x2A, 0x2F, 0x34, 0x3E, + 0x2A, 0x3E, 0x3E, 0x3E, + 0x2A, 0x2A, 0x3E, 0x3E, + 0x2A, 0x2A, 0x2A, 0x3E, + 0x2B, 0x2C, 0x2C, 0x2D, + 0x2B, 0x2C, 0x2D, 0x2E, + 0x2B, 0x2D, 0x2E, 0x2F, + 0x2B, 0x2C, 0x2E, 0x2F, + 0x2B, 0x2C, 0x2D, 0x2F, + 0x2B, 0x2D, 0x2E, 0x30, + 0x2B, 0x2D, 0x2F, 0x30, + 0x2B, 0x2C, 0x2F, 0x30, + 0x2B, 0x2C, 0x2E, 0x30, + 0x2B, 0x2D, 0x2F, 0x31, + 0x2B, 0x2E, 0x30, 0x31, + 0x2B, 0x2C, 0x30, 0x31, + 0x2B, 0x2C, 0x2E, 0x31, + 0x2B, 0x31, 0x31, 0x31, + 0x2B, 0x2B, 0x31, 0x31, + 0x2B, 0x2B, 0x2B, 0x31, + 0x2B, 0x2E, 0x2F, 0x32, + 0x2B, 0x2E, 0x31, 0x32, + 0x2B, 0x2C, 0x31, 0x32, + 0x2B, 0x2C, 0x2F, 0x32, + 0x2B, 0x2E, 0x30, 0x33, + 0x2B, 0x2F, 0x31, 0x33, + 0x2B, 0x2D, 0x31, 0x33, + 0x2B, 0x2D, 0x2F, 0x33, + 0x2B, 0x33, 0x33, 0x33, + 0x2B, 0x2B, 0x33, 0x33, + 0x2B, 0x2B, 0x2B, 0x33, + 0x2B, 0x2F, 0x32, 0x36, + 0x2B, 0x30, 0x34, 0x36, + 0x2B, 0x2D, 0x34, 0x36, + 0x2B, 0x2D, 0x31, 0x36, + 0x2B, 0x36, 0x36, 0x36, + 0x2B, 0x2B, 0x36, 0x36, + 0x2B, 0x2B, 0x2B, 0x36, + 0x2B, 0x30, 0x34, 0x39, + 0x2B, 0x32, 0x36, 0x39, + 0x2B, 0x2E, 0x36, 0x39, + 0x2B, 0x2E, 0x32, 0x39, + 0x2B, 0x39, 0x39, 0x39, + 0x2B, 0x2B, 0x39, 0x39, + 0x2B, 0x2B, 0x2B, 0x39, + 0x2B, 0x31, 0x36, 0x3C, + 0x2B, 0x33, 0x38, 0x3C, + 0x2B, 0x2F, 0x38, 0x3C, + 0x2B, 0x2F, 0x34, 0x3C, + 0x2B, 0x3C, 0x3C, 0x3C, + 0x2B, 0x2B, 0x3C, 0x3C, + 0x2B, 0x2B, 0x2B, 0x3C, + 0x2B, 0x32, 0x38, 0x3F, + 0x2B, 0x35, 0x3A, 0x3F, + 0x2B, 0x30, 0x3A, 0x3F, + 0x2B, 0x30, 0x35, 0x3F, + 0x2B, 0x3F, 0x3F, 0x3F, + 0x2B, 0x2B, 0x3F, 0x3F, + 0x2B, 0x2B, 0x2B, 0x3F, + 0x2C, 0x2D, 0x2D, 0x2E, + 0x2C, 0x2D, 0x2E, 0x2F, + 0x2C, 0x2E, 0x2F, 0x30, + 0x2C, 0x2D, 0x2F, 0x30, + 0x2C, 0x2D, 0x2E, 0x30, + 0x2C, 0x2E, 0x2F, 0x31, + 0x2C, 0x2E, 0x30, 0x31, + 0x2C, 0x2D, 0x30, 0x31, + 0x2C, 0x2D, 0x2F, 0x31, + 0x2C, 0x2E, 0x30, 0x32, + 0x2C, 0x2F, 0x31, 0x32, + 0x2C, 0x2D, 0x31, 0x32, + 0x2C, 0x2D, 0x2F, 0x32, + 0x2C, 0x32, 0x32, 0x32, + 0x2C, 0x2C, 0x32, 0x32, + 0x2C, 0x2C, 0x2C, 0x32, + 0x2C, 0x2F, 0x30, 0x33, + 0x2C, 0x2F, 0x32, 0x33, + 0x2C, 0x2D, 0x32, 0x33, + 0x2C, 0x2D, 0x30, 0x33, + 0x2C, 0x2F, 0x31, 0x34, + 0x2C, 0x30, 0x32, 0x34, + 0x2C, 0x2E, 0x32, 0x34, + 0x2C, 0x2E, 0x30, 0x34, + 0x2C, 0x34, 0x34, 0x34, + 0x2C, 0x2C, 0x34, 0x34, + 0x2C, 0x2C, 0x2C, 0x34, + 0x2C, 0x30, 0x33, 0x37, + 0x2C, 0x31, 0x35, 0x37, + 0x2C, 0x2E, 0x35, 0x37, + 0x2C, 0x2E, 0x32, 0x37, + 0x2C, 0x37, 0x37, 0x37, + 0x2C, 0x2C, 0x37, 0x37, + 0x2C, 0x2C, 0x2C, 0x37, + 0x2C, 0x31, 0x35, 0x3A, + 0x2C, 0x33, 0x37, 0x3A, + 0x2C, 0x2F, 0x37, 0x3A, + 0x2C, 0x2F, 0x33, 0x3A, + 0x2C, 0x3A, 0x3A, 0x3A, + 0x2C, 0x2C, 0x3A, 0x3A, + 0x2C, 0x2C, 0x2C, 0x3A, + 0x2C, 0x32, 0x37, 0x3D, + 0x2C, 0x34, 0x39, 0x3D, + 0x2C, 0x30, 0x39, 0x3D, + 0x2C, 0x30, 0x35, 0x3D, + 0x2C, 0x3D, 0x3D, 0x3D, + 0x2C, 0x2C, 0x3D, 0x3D, + 0x2C, 0x2C, 0x2C, 0x3D, + 0x2D, 0x2E, 0x2E, 0x2F, + 0x2D, 0x2E, 0x2F, 0x30, + 0x2D, 0x2F, 0x30, 0x31, + 0x2D, 0x2E, 0x30, 0x31, + 0x2D, 0x2E, 0x2F, 0x31, + 0x2D, 0x2F, 0x30, 0x32, + 0x2D, 0x2F, 0x31, 0x32, + 0x2D, 0x2E, 0x31, 0x32, + 0x2D, 0x2E, 0x30, 0x32, + 0x2D, 0x2F, 0x31, 0x33, + 0x2D, 0x30, 0x32, 0x33, + 0x2D, 0x2E, 0x32, 0x33, + 0x2D, 0x2E, 0x30, 0x33, + 0x2D, 0x33, 0x33, 0x33, + 0x2D, 0x2D, 0x33, 0x33, + 0x2D, 0x2D, 0x2D, 0x33, + 0x2D, 0x30, 0x31, 0x34, + 0x2D, 0x30, 0x33, 0x34, + 0x2D, 0x2E, 0x33, 0x34, + 0x2D, 0x2E, 0x31, 0x34, + 0x2D, 0x30, 0x32, 0x35, + 0x2D, 0x31, 0x33, 0x35, + 0x2D, 0x2F, 0x33, 0x35, + 0x2D, 0x2F, 0x31, 0x35, + 0x2D, 0x35, 0x35, 0x35, + 0x2D, 0x2D, 0x35, 0x35, + 0x2D, 0x2D, 0x2D, 0x35, + 0x2D, 0x31, 0x34, 0x38, + 0x2D, 0x32, 0x36, 0x38, + 0x2D, 0x2F, 0x36, 0x38, + 0x2D, 0x2F, 0x33, 0x38, + 0x2D, 0x38, 0x38, 0x38, + 0x2D, 0x2D, 0x38, 0x38, + 0x2D, 0x2D, 0x2D, 0x38, + 0x2D, 0x32, 0x36, 0x3B, + 0x2D, 0x34, 0x38, 0x3B, + 0x2D, 0x30, 0x38, 0x3B, + 0x2D, 0x30, 0x34, 0x3B, + 0x2D, 0x3B, 0x3B, 0x3B, + 0x2D, 0x2D, 0x3B, 0x3B, + 0x2D, 0x2D, 0x2D, 0x3B, + 0x2D, 0x33, 0x38, 0x3E, + 0x2D, 0x35, 0x3A, 0x3E, + 0x2D, 0x31, 0x3A, 0x3E, + 0x2D, 0x31, 0x36, 0x3E, + 0x2D, 0x3E, 0x3E, 0x3E, + 0x2D, 0x2D, 0x3E, 0x3E, + 0x2D, 0x2D, 0x2D, 0x3E, + 0x2E, 0x2F, 0x2F, 0x30, + 0x2E, 0x2F, 0x30, 0x31, + 0x2E, 0x30, 0x31, 0x32, + 0x2E, 0x2F, 0x31, 0x32, + 0x2E, 0x2F, 0x30, 0x32, + 0x2E, 0x30, 0x31, 0x33, + 0x2E, 0x30, 0x32, 0x33, + 0x2E, 0x2F, 0x32, 0x33, + 0x2E, 0x2F, 0x31, 0x33, + 0x2E, 0x30, 0x32, 0x34, + 0x2E, 0x31, 0x33, 0x34, + 0x2E, 0x2F, 0x33, 0x34, + 0x2E, 0x2F, 0x31, 0x34, + 0x2E, 0x34, 0x34, 0x34, + 0x2E, 0x2E, 0x34, 0x34, + 0x2E, 0x2E, 0x2E, 0x34, + 0x2E, 0x31, 0x32, 0x35, + 0x2E, 0x31, 0x34, 0x35, + 0x2E, 0x2F, 0x34, 0x35, + 0x2E, 0x2F, 0x32, 0x35, + 0x2E, 0x31, 0x33, 0x36, + 0x2E, 0x32, 0x34, 0x36, + 0x2E, 0x30, 0x34, 0x36, + 0x2E, 0x30, 0x32, 0x36, + 0x2E, 0x36, 0x36, 0x36, + 0x2E, 0x2E, 0x36, 0x36, + 0x2E, 0x2E, 0x2E, 0x36, + 0x2E, 0x32, 0x35, 0x39, + 0x2E, 0x33, 0x37, 0x39, + 0x2E, 0x30, 0x37, 0x39, + 0x2E, 0x30, 0x34, 0x39, + 0x2E, 0x39, 0x39, 0x39, + 0x2E, 0x2E, 0x39, 0x39, + 0x2E, 0x2E, 0x2E, 0x39, + 0x2E, 0x33, 0x37, 0x3C, + 0x2E, 0x35, 0x39, 0x3C, + 0x2E, 0x31, 0x39, 0x3C, + 0x2E, 0x31, 0x35, 0x3C, + 0x2E, 0x3C, 0x3C, 0x3C, + 0x2E, 0x2E, 0x3C, 0x3C, + 0x2E, 0x2E, 0x2E, 0x3C, + 0x2E, 0x34, 0x39, 0x3F, + 0x2E, 0x36, 0x3B, 0x3F, + 0x2E, 0x32, 0x3B, 0x3F, + 0x2E, 0x32, 0x37, 0x3F, + 0x2E, 0x3F, 0x3F, 0x3F, + 0x2E, 0x2E, 0x3F, 0x3F, + 0x2E, 0x2E, 0x2E, 0x3F, + 0x2F, 0x30, 0x30, 0x31, + 0x2F, 0x30, 0x31, 0x32, + 0x2F, 0x31, 0x32, 0x33, + 0x2F, 0x30, 0x32, 0x33, + 0x2F, 0x30, 0x31, 0x33, + 0x2F, 0x31, 0x32, 0x34, + 0x2F, 0x31, 0x33, 0x34, + 0x2F, 0x30, 0x33, 0x34, + 0x2F, 0x30, 0x32, 0x34, + 0x2F, 0x31, 0x33, 0x35, + 0x2F, 0x32, 0x34, 0x35, + 0x2F, 0x30, 0x34, 0x35, + 0x2F, 0x30, 0x32, 0x35, + 0x2F, 0x35, 0x35, 0x35, + 0x2F, 0x2F, 0x35, 0x35, + 0x2F, 0x2F, 0x2F, 0x35, + 0x2F, 0x32, 0x33, 0x36, + 0x2F, 0x32, 0x35, 0x36, + 0x2F, 0x30, 0x35, 0x36, + 0x2F, 0x30, 0x33, 0x36, + 0x2F, 0x32, 0x34, 0x37, + 0x2F, 0x33, 0x35, 0x37, + 0x2F, 0x31, 0x35, 0x37, + 0x2F, 0x31, 0x33, 0x37, + 0x2F, 0x37, 0x37, 0x37, + 0x2F, 0x2F, 0x37, 0x37, + 0x2F, 0x2F, 0x2F, 0x37, + 0x2F, 0x33, 0x36, 0x3A, + 0x2F, 0x34, 0x38, 0x3A, + 0x2F, 0x31, 0x38, 0x3A, + 0x2F, 0x31, 0x35, 0x3A, + 0x2F, 0x3A, 0x3A, 0x3A, + 0x2F, 0x2F, 0x3A, 0x3A, + 0x2F, 0x2F, 0x2F, 0x3A, + 0x2F, 0x34, 0x38, 0x3D, + 0x2F, 0x36, 0x3A, 0x3D, + 0x2F, 0x32, 0x3A, 0x3D, + 0x2F, 0x32, 0x36, 0x3D, + 0x2F, 0x3D, 0x3D, 0x3D, + 0x2F, 0x2F, 0x3D, 0x3D, + 0x2F, 0x2F, 0x2F, 0x3D, + 0x30, 0x31, 0x31, 0x32, + 0x30, 0x31, 0x32, 0x33, + 0x30, 0x32, 0x33, 0x34, + 0x30, 0x31, 0x33, 0x34, + 0x30, 0x31, 0x32, 0x34, + 0x30, 0x32, 0x33, 0x35, + 0x30, 0x32, 0x34, 0x35, + 0x30, 0x31, 0x34, 0x35, + 0x30, 0x31, 0x33, 0x35, + 0x30, 0x32, 0x34, 0x36, + 0x30, 0x33, 0x35, 0x36, + 0x30, 0x31, 0x35, 0x36, + 0x30, 0x31, 0x33, 0x36, + 0x30, 0x36, 0x36, 0x36, + 0x30, 0x30, 0x36, 0x36, + 0x30, 0x30, 0x30, 0x36, + 0x30, 0x33, 0x34, 0x37, + 0x30, 0x33, 0x36, 0x37, + 0x30, 0x31, 0x36, 0x37, + 0x30, 0x31, 0x34, 0x37, + 0x30, 0x33, 0x35, 0x38, + 0x30, 0x34, 0x36, 0x38, + 0x30, 0x32, 0x36, 0x38, + 0x30, 0x32, 0x34, 0x38, + 0x30, 0x38, 0x38, 0x38, + 0x30, 0x30, 0x38, 0x38, + 0x30, 0x30, 0x30, 0x38, + 0x30, 0x34, 0x37, 0x3B, + 0x30, 0x35, 0x39, 0x3B, + 0x30, 0x32, 0x39, 0x3B, + 0x30, 0x32, 0x36, 0x3B, + 0x30, 0x3B, 0x3B, 0x3B, + 0x30, 0x30, 0x3B, 0x3B, + 0x30, 0x30, 0x30, 0x3B, + 0x30, 0x35, 0x39, 0x3E, + 0x30, 0x37, 0x3B, 0x3E, + 0x30, 0x33, 0x3B, 0x3E, + 0x30, 0x33, 0x37, 0x3E, + 0x30, 0x3E, 0x3E, 0x3E, + 0x30, 0x30, 0x3E, 0x3E, + 0x30, 0x30, 0x30, 0x3E, + 0x31, 0x32, 0x32, 0x33, + 0x31, 0x32, 0x33, 0x34, + 0x31, 0x33, 0x34, 0x35, + 0x31, 0x32, 0x34, 0x35, + 0x31, 0x32, 0x33, 0x35, + 0x31, 0x33, 0x34, 0x36, + 0x31, 0x33, 0x35, 0x36, + 0x31, 0x32, 0x35, 0x36, + 0x31, 0x32, 0x34, 0x36, + 0x31, 0x33, 0x35, 0x37, + 0x31, 0x34, 0x36, 0x37, + 0x31, 0x32, 0x36, 0x37, + 0x31, 0x32, 0x34, 0x37, + 0x31, 0x37, 0x37, 0x37, + 0x31, 0x31, 0x37, 0x37, + 0x31, 0x31, 0x31, 0x37, + 0x31, 0x34, 0x35, 0x38, + 0x31, 0x34, 0x37, 0x38, + 0x31, 0x32, 0x37, 0x38, + 0x31, 0x32, 0x35, 0x38, + 0x31, 0x34, 0x36, 0x39, + 0x31, 0x35, 0x37, 0x39, + 0x31, 0x33, 0x37, 0x39, + 0x31, 0x33, 0x35, 0x39, + 0x31, 0x39, 0x39, 0x39, + 0x31, 0x31, 0x39, 0x39, + 0x31, 0x31, 0x31, 0x39, + 0x31, 0x35, 0x38, 0x3C, + 0x31, 0x36, 0x3A, 0x3C, + 0x31, 0x33, 0x3A, 0x3C, + 0x31, 0x33, 0x37, 0x3C, + 0x31, 0x3C, 0x3C, 0x3C, + 0x31, 0x31, 0x3C, 0x3C, + 0x31, 0x31, 0x31, 0x3C, + 0x31, 0x36, 0x3A, 0x3F, + 0x31, 0x38, 0x3C, 0x3F, + 0x31, 0x34, 0x3C, 0x3F, + 0x31, 0x34, 0x38, 0x3F, + 0x31, 0x3F, 0x3F, 0x3F, + 0x31, 0x31, 0x3F, 0x3F, + 0x31, 0x31, 0x31, 0x3F, + 0x32, 0x33, 0x33, 0x34, + 0x32, 0x33, 0x34, 0x35, + 0x32, 0x34, 0x35, 0x36, + 0x32, 0x33, 0x35, 0x36, + 0x32, 0x33, 0x34, 0x36, + 0x32, 0x34, 0x35, 0x37, + 0x32, 0x34, 0x36, 0x37, + 0x32, 0x33, 0x36, 0x37, + 0x32, 0x33, 0x35, 0x37, + 0x32, 0x34, 0x36, 0x38, + 0x32, 0x35, 0x37, 0x38, + 0x32, 0x33, 0x37, 0x38, + 0x32, 0x33, 0x35, 0x38, + 0x32, 0x38, 0x38, 0x38, + 0x32, 0x32, 0x38, 0x38, + 0x32, 0x32, 0x32, 0x38, + 0x32, 0x35, 0x36, 0x39, + 0x32, 0x35, 0x38, 0x39, + 0x32, 0x33, 0x38, 0x39, + 0x32, 0x33, 0x36, 0x39, + 0x32, 0x35, 0x37, 0x3A, + 0x32, 0x36, 0x38, 0x3A, + 0x32, 0x34, 0x38, 0x3A, + 0x32, 0x34, 0x36, 0x3A, + 0x32, 0x3A, 0x3A, 0x3A, + 0x32, 0x32, 0x3A, 0x3A, + 0x32, 0x32, 0x32, 0x3A, + 0x32, 0x36, 0x39, 0x3D, + 0x32, 0x37, 0x3B, 0x3D, + 0x32, 0x34, 0x3B, 0x3D, + 0x32, 0x34, 0x38, 0x3D, + 0x32, 0x3D, 0x3D, 0x3D, + 0x32, 0x32, 0x3D, 0x3D, + 0x32, 0x32, 0x32, 0x3D, + 0x33, 0x34, 0x34, 0x35, + 0x33, 0x34, 0x35, 0x36, + 0x33, 0x35, 0x36, 0x37, + 0x33, 0x34, 0x36, 0x37, + 0x33, 0x34, 0x35, 0x37, + 0x33, 0x35, 0x36, 0x38, + 0x33, 0x35, 0x37, 0x38, + 0x33, 0x34, 0x37, 0x38, + 0x33, 0x34, 0x36, 0x38, + 0x33, 0x35, 0x37, 0x39, + 0x33, 0x36, 0x38, 0x39, + 0x33, 0x34, 0x38, 0x39, + 0x33, 0x34, 0x36, 0x39, + 0x33, 0x39, 0x39, 0x39, + 0x33, 0x33, 0x39, 0x39, + 0x33, 0x33, 0x33, 0x39, + 0x33, 0x36, 0x37, 0x3A, + 0x33, 0x36, 0x39, 0x3A, + 0x33, 0x34, 0x39, 0x3A, + 0x33, 0x34, 0x37, 0x3A, + 0x33, 0x36, 0x38, 0x3B, + 0x33, 0x37, 0x39, 0x3B, + 0x33, 0x35, 0x39, 0x3B, + 0x33, 0x35, 0x37, 0x3B, + 0x33, 0x3B, 0x3B, 0x3B, + 0x33, 0x33, 0x3B, 0x3B, + 0x33, 0x33, 0x33, 0x3B, + 0x33, 0x37, 0x3A, 0x3E, + 0x33, 0x38, 0x3C, 0x3E, + 0x33, 0x35, 0x3C, 0x3E, + 0x33, 0x35, 0x39, 0x3E, + 0x33, 0x3E, 0x3E, 0x3E, + 0x33, 0x33, 0x3E, 0x3E, + 0x33, 0x33, 0x33, 0x3E, + 0x34, 0x35, 0x35, 0x36, + 0x34, 0x35, 0x36, 0x37, + 0x34, 0x36, 0x37, 0x38, + 0x34, 0x35, 0x37, 0x38, + 0x34, 0x35, 0x36, 0x38, + 0x34, 0x36, 0x37, 0x39, + 0x34, 0x36, 0x38, 0x39, + 0x34, 0x35, 0x38, 0x39, + 0x34, 0x35, 0x37, 0x39, + 0x34, 0x36, 0x38, 0x3A, + 0x34, 0x37, 0x39, 0x3A, + 0x34, 0x35, 0x39, 0x3A, + 0x34, 0x35, 0x37, 0x3A, + 0x34, 0x3A, 0x3A, 0x3A, + 0x34, 0x34, 0x3A, 0x3A, + 0x34, 0x34, 0x34, 0x3A, + 0x34, 0x37, 0x38, 0x3B, + 0x34, 0x37, 0x3A, 0x3B, + 0x34, 0x35, 0x3A, 0x3B, + 0x34, 0x35, 0x38, 0x3B, + 0x34, 0x37, 0x39, 0x3C, + 0x34, 0x38, 0x3A, 0x3C, + 0x34, 0x36, 0x3A, 0x3C, + 0x34, 0x36, 0x38, 0x3C, + 0x34, 0x3C, 0x3C, 0x3C, + 0x34, 0x34, 0x3C, 0x3C, + 0x34, 0x34, 0x34, 0x3C, + 0x34, 0x38, 0x3B, 0x3F, + 0x34, 0x39, 0x3D, 0x3F, + 0x34, 0x36, 0x3D, 0x3F, + 0x34, 0x36, 0x3A, 0x3F, + 0x34, 0x3F, 0x3F, 0x3F, + 0x34, 0x34, 0x3F, 0x3F, + 0x34, 0x34, 0x34, 0x3F, + 0x35, 0x36, 0x36, 0x37, + 0x35, 0x36, 0x37, 0x38, + 0x35, 0x37, 0x38, 0x39, + 0x35, 0x36, 0x38, 0x39, + 0x35, 0x36, 0x37, 0x39, + 0x35, 0x37, 0x38, 0x3A, + 0x35, 0x37, 0x39, 0x3A, + 0x35, 0x36, 0x39, 0x3A, + 0x35, 0x36, 0x38, 0x3A, + 0x35, 0x37, 0x39, 0x3B, + 0x35, 0x38, 0x3A, 0x3B, + 0x35, 0x36, 0x3A, 0x3B, + 0x35, 0x36, 0x38, 0x3B, + 0x35, 0x3B, 0x3B, 0x3B, + 0x35, 0x35, 0x3B, 0x3B, + 0x35, 0x35, 0x35, 0x3B, + 0x35, 0x38, 0x39, 0x3C, + 0x35, 0x38, 0x3B, 0x3C, + 0x35, 0x36, 0x3B, 0x3C, + 0x35, 0x36, 0x39, 0x3C, + 0x35, 0x38, 0x3A, 0x3D, + 0x35, 0x39, 0x3B, 0x3D, + 0x35, 0x37, 0x3B, 0x3D, + 0x35, 0x37, 0x39, 0x3D, + 0x35, 0x3D, 0x3D, 0x3D, + 0x35, 0x35, 0x3D, 0x3D, + 0x35, 0x35, 0x35, 0x3D, + 0x36, 0x37, 0x37, 0x38, + 0x36, 0x37, 0x38, 0x39, + 0x36, 0x38, 0x39, 0x3A, + 0x36, 0x37, 0x39, 0x3A, + 0x36, 0x37, 0x38, 0x3A, + 0x36, 0x38, 0x39, 0x3B, + 0x36, 0x38, 0x3A, 0x3B, + 0x36, 0x37, 0x3A, 0x3B, + 0x36, 0x37, 0x39, 0x3B, + 0x36, 0x38, 0x3A, 0x3C, + 0x36, 0x39, 0x3B, 0x3C, + 0x36, 0x37, 0x3B, 0x3C, + 0x36, 0x37, 0x39, 0x3C, + 0x36, 0x3C, 0x3C, 0x3C, + 0x36, 0x36, 0x3C, 0x3C, + 0x36, 0x36, 0x36, 0x3C, + 0x36, 0x39, 0x3A, 0x3D, + 0x36, 0x39, 0x3C, 0x3D, + 0x36, 0x37, 0x3C, 0x3D, + 0x36, 0x37, 0x3A, 0x3D, + 0x36, 0x39, 0x3B, 0x3E, + 0x36, 0x3A, 0x3C, 0x3E, + 0x36, 0x38, 0x3C, 0x3E, + 0x36, 0x38, 0x3A, 0x3E, + 0x36, 0x3E, 0x3E, 0x3E, + 0x36, 0x36, 0x3E, 0x3E, + 0x36, 0x36, 0x36, 0x3E, + 0x37, 0x38, 0x38, 0x39, + 0x37, 0x38, 0x39, 0x3A, + 0x37, 0x39, 0x3A, 0x3B, + 0x37, 0x38, 0x3A, 0x3B, + 0x37, 0x38, 0x39, 0x3B, + 0x37, 0x39, 0x3A, 0x3C, + 0x37, 0x39, 0x3B, 0x3C, + 0x37, 0x38, 0x3B, 0x3C, + 0x37, 0x38, 0x3A, 0x3C, + 0x37, 0x39, 0x3B, 0x3D, + 0x37, 0x3A, 0x3C, 0x3D, + 0x37, 0x38, 0x3C, 0x3D, + 0x37, 0x38, 0x3A, 0x3D, + 0x37, 0x3D, 0x3D, 0x3D, + 0x37, 0x37, 0x3D, 0x3D, + 0x37, 0x37, 0x37, 0x3D, + 0x37, 0x3A, 0x3B, 0x3E, + 0x37, 0x3A, 0x3D, 0x3E, + 0x37, 0x38, 0x3D, 0x3E, + 0x37, 0x38, 0x3B, 0x3E, + 0x37, 0x3A, 0x3C, 0x3F, + 0x37, 0x3B, 0x3D, 0x3F, + 0x37, 0x39, 0x3D, 0x3F, + 0x37, 0x39, 0x3B, 0x3F, + 0x37, 0x3F, 0x3F, 0x3F, + 0x37, 0x37, 0x3F, 0x3F, + 0x37, 0x37, 0x37, 0x3F, + 0x38, 0x39, 0x39, 0x3A, + 0x38, 0x39, 0x3A, 0x3B, + 0x38, 0x3A, 0x3B, 0x3C, + 0x38, 0x39, 0x3B, 0x3C, + 0x38, 0x39, 0x3A, 0x3C, + 0x38, 0x3A, 0x3B, 0x3D, + 0x38, 0x3A, 0x3C, 0x3D, + 0x38, 0x39, 0x3C, 0x3D, + 0x38, 0x39, 0x3B, 0x3D, + 0x38, 0x3A, 0x3C, 0x3E, + 0x38, 0x3B, 0x3D, 0x3E, + 0x38, 0x39, 0x3D, 0x3E, + 0x38, 0x39, 0x3B, 0x3E, + 0x38, 0x3E, 0x3E, 0x3E, + 0x38, 0x38, 0x3E, 0x3E, + 0x38, 0x38, 0x38, 0x3E, + 0x38, 0x3B, 0x3C, 0x3F, + 0x38, 0x3B, 0x3E, 0x3F, + 0x38, 0x39, 0x3E, 0x3F, + 0x38, 0x39, 0x3C, 0x3F, + 0x39, 0x3A, 0x3A, 0x3B, + 0x39, 0x3A, 0x3B, 0x3C, + 0x39, 0x3B, 0x3C, 0x3D, + 0x39, 0x3A, 0x3C, 0x3D, + 0x39, 0x3A, 0x3B, 0x3D, + 0x39, 0x3B, 0x3C, 0x3E, + 0x39, 0x3B, 0x3D, 0x3E, + 0x39, 0x3A, 0x3D, 0x3E, + 0x39, 0x3A, 0x3C, 0x3E, + 0x39, 0x3B, 0x3D, 0x3F, + 0x39, 0x3C, 0x3E, 0x3F, + 0x39, 0x3A, 0x3E, 0x3F, + 0x39, 0x3A, 0x3C, 0x3F, + 0x39, 0x3F, 0x3F, 0x3F, + 0x39, 0x39, 0x3F, 0x3F, + 0x39, 0x39, 0x39, 0x3F, + 0x3A, 0x3B, 0x3B, 0x3C, + 0x3A, 0x3B, 0x3C, 0x3D, + 0x3A, 0x3C, 0x3D, 0x3E, + 0x3A, 0x3B, 0x3D, 0x3E, + 0x3A, 0x3B, 0x3C, 0x3E, + 0x3A, 0x3C, 0x3D, 0x3F, + 0x3A, 0x3C, 0x3E, 0x3F, + 0x3A, 0x3B, 0x3E, 0x3F, + 0x3A, 0x3B, 0x3D, 0x3F, + 0x3B, 0x3C, 0x3C, 0x3D, + 0x3B, 0x3C, 0x3D, 0x3E, + 0x3B, 0x3D, 0x3E, 0x3F, + 0x3B, 0x3C, 0x3E, 0x3F, + 0x3B, 0x3C, 0x3D, 0x3F, + 0x3C, 0x3D, 0x3D, 0x3E, + 0x3C, 0x3D, 0x3E, 0x3F, + 0x3D, 0x3E, 0x3E, 0x3F +}; + +#endif /* AVCODEC_ULTI_CB_H */ diff --git a/include/libavcodec/unary.h b/include/libavcodec/unary.h new file mode 100644 index 0000000..d57f9f7 --- /dev/null +++ b/include/libavcodec/unary.h @@ -0,0 +1,69 @@ +/* + * copyright (c) 2004 Michael Niedermayer + * + * 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_UNARY_H +#define AVCODEC_UNARY_H + +#include "get_bits.h" + +/** + * Get unary code of limited length + * @param gb GetBitContext + * @param[in] stop The bitstop value (unary code of 1's or 0's) + * @param[in] len Maximum length + * @return unary 0 based code index. This is also the length in bits of the + * code excluding the stop bit. + * (in case len=1) + * 1 0 + * 0 1 + * (in case len=2) + * 1 0 + * 01 1 + * 00 2 + * (in case len=3) + * 1 0 + * 01 1 + * 001 2 + * 000 3 + */ +static inline int get_unary(GetBitContext *gb, int stop, int len) +{ + int i; + + for(i = 0; i < len && get_bits1(gb) != stop; i++); + return i; +} + +/** + * Get unary code terminated by a 0 with a maximum length of 33 + * @param gb GetBitContext + * @return Unary length/index + */ +static inline int get_unary_0_33(GetBitContext *gb) +{ + return get_unary(gb, 0, 33); +} + +static inline int get_unary_0_9(GetBitContext *gb) +{ + return get_unary(gb, 0, 9); +} + +#endif /* AVCODEC_UNARY_H */ diff --git a/include/libavcodec/utvideo.h b/include/libavcodec/utvideo.h new file mode 100644 index 0000000..b081b50 --- /dev/null +++ b/include/libavcodec/utvideo.h @@ -0,0 +1,59 @@ +/* + * Common Ut Video header + * Copyright (c) 2011 Konstantin Shishkov + * + * 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_UTVIDEO_H +#define AVCODEC_UTVIDEO_H + +/** + * @file + * Common Ut Video header + */ + +#include "libavutil/macros.h" + +enum { + PRED_NONE = 0, + PRED_LEFT, + PRED_GRADIENT, + PRED_MEDIAN, +}; + +enum { + COMP_NONE = 0, + COMP_HUFF, +}; + +/* + * "Original format" markers. + * Based on values gotten from the official VFW encoder. + * They are not used during decoding, but they do have + * an informative role on seeing what was input + * to the encoder. + */ +enum { + UTVIDEO_RGB = MKTAG(0x00, 0x00, 0x01, 0x18), + UTVIDEO_RGBA = MKTAG(0x00, 0x00, 0x02, 0x18), + UTVIDEO_420 = MKTAG('Y', 'V', '1', '2'), + UTVIDEO_422 = MKTAG('Y', 'U', 'Y', '2'), + UTVIDEO_444 = MKTAG('Y', 'V', '2', '4'), +}; + +#endif /* AVCODEC_UTVIDEO_H */ diff --git a/include/libavcodec/utvideodsp.h b/include/libavcodec/utvideodsp.h new file mode 100644 index 0000000..10961da --- /dev/null +++ b/include/libavcodec/utvideodsp.h @@ -0,0 +1,40 @@ +/* + * 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_UTVIDEODSP_H +#define AVCODEC_UTVIDEODSP_H + +#include +#include +#include "libavutil/pixfmt.h" +#include "config.h" + +typedef struct UTVideoDSPContext { + void (*restore_rgb_planes)(uint8_t *src_r, uint8_t *src_g, uint8_t *src_b, + ptrdiff_t linesize_r, ptrdiff_t linesize_g, + ptrdiff_t linesize_b, int width, int height); + void (*restore_rgb_planes10)(uint16_t *src_r, uint16_t *src_g, uint16_t *src_b, + ptrdiff_t linesize_r, ptrdiff_t linesize_g, + ptrdiff_t linesize_b, int width, int height); +} UTVideoDSPContext; + +void ff_utvideodsp_init(UTVideoDSPContext *c); +void ff_utvideodsp_init_riscv(UTVideoDSPContext *c); +void ff_utvideodsp_init_x86(UTVideoDSPContext *c); + +#endif /* AVCODEC_UTVIDEODSP_H */ diff --git a/include/libavcodec/v210dec.h b/include/libavcodec/v210dec.h new file mode 100644 index 0000000..87ba38e --- /dev/null +++ b/include/libavcodec/v210dec.h @@ -0,0 +1,37 @@ +/* + * 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_V210DEC_H +#define AVCODEC_V210DEC_H + +#include "libavutil/log.h" +#include "libavutil/opt.h" + + +typedef struct { + AVClass *av_class; + int custom_stride; + int aligned_input; + int thread_count; + int stride_warning_shown; + void (*unpack_frame)(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width); +} V210DecContext; + +void ff_v210_x86_init(V210DecContext *s); + +#endif /* AVCODEC_V210DEC_H */ diff --git a/include/libavcodec/v210dec_init.h b/include/libavcodec/v210dec_init.h new file mode 100644 index 0000000..c7a232f --- /dev/null +++ b/include/libavcodec/v210dec_init.h @@ -0,0 +1,62 @@ +/* + * V210 decoder DSP init + * + * Copyright (C) 2009 Michael Niedermayer + * Copyright (c) 2009 Baptiste Coudurier + * + * 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_V210DEC_INIT_H +#define AVCODEC_V210DEC_INIT_H + +#include + +#include "config.h" +#include "libavutil/attributes.h" +#include "libavutil/bswap.h" +#include "v210dec.h" + +#define READ_PIXELS(a, b, c) \ + do { \ + val = av_le2ne32(*src++); \ + *a++ = val & 0x3FF; \ + *b++ = (val >> 10) & 0x3FF; \ + *c++ = (val >> 20) & 0x3FF; \ + } while (0) + +static void v210_planar_unpack_c(const uint32_t *src, uint16_t *y, uint16_t *u, uint16_t *v, int width) +{ + uint32_t val; + + for (int i = 0; i < width - 5; i += 6) { + READ_PIXELS(u, y, v); + READ_PIXELS(y, u, y); + READ_PIXELS(v, y, u); + READ_PIXELS(y, v, y); + } +} + +static av_unused av_cold void ff_v210dec_init(V210DecContext *s) +{ + s->unpack_frame = v210_planar_unpack_c; +#if ARCH_X86 + ff_v210_x86_init(s); +#endif +} + +#endif /* AVCODEC_V210DEC_INIT_H */ diff --git a/include/libavcodec/v210enc.h b/include/libavcodec/v210enc.h new file mode 100644 index 0000000..b74fd33 --- /dev/null +++ b/include/libavcodec/v210enc.h @@ -0,0 +1,37 @@ +/* + * 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_V210ENC_H +#define AVCODEC_V210ENC_H + +#include "libavutil/log.h" +#include "libavutil/opt.h" +#include "libavutil/pixfmt.h" + +typedef struct V210EncContext { + void (*pack_line_8)(const uint8_t *y, const uint8_t *u, + const uint8_t *v, uint8_t *dst, ptrdiff_t width); + void (*pack_line_10)(const uint16_t *y, const uint16_t *u, + const uint16_t *v, uint8_t *dst, ptrdiff_t width); + int sample_factor_8; + int sample_factor_10; +} V210EncContext; + +void ff_v210enc_init_x86(V210EncContext *s); + +#endif /* AVCODEC_V210ENC_H */ diff --git a/include/libavcodec/v210enc_init.h b/include/libavcodec/v210enc_init.h new file mode 100644 index 0000000..a0e5622 --- /dev/null +++ b/include/libavcodec/v210enc_init.h @@ -0,0 +1,91 @@ +/* + * V210 encoder DSP init + * + * Copyright (C) 2009 Michael Niedermayer + * Copyright (c) 2009 Baptiste Coudurier + * + * 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_V210ENC_INIT_H +#define AVCODEC_V210ENC_INIT_H + +#include +#include + +#include "config.h" +#include "libavutil/attributes.h" +#include "libavutil/common.h" +#include "libavutil/intreadwrite.h" +#include "v210enc.h" + +#define CLIP(v, depth) av_clip(v, 1<<(depth-8), ((1<pack_line_8 = v210_planar_pack_8_c; + s->pack_line_10 = v210_planar_pack_10_c; + s->sample_factor_8 = 2; + s->sample_factor_10 = 1; + +#if ARCH_X86 + ff_v210enc_init_x86(s); +#endif +} + +#endif /* AVCODEC_V210ENC_INIT_H */ diff --git a/include/libavcodec/v4l2_buffers.h b/include/libavcodec/v4l2_buffers.h new file mode 100644 index 0000000..e35b161 --- /dev/null +++ b/include/libavcodec/v4l2_buffers.h @@ -0,0 +1,134 @@ +/* + * V4L2 buffer helper functions. + * + * Copyright (C) 2017 Alexis Ballier + * Copyright (C) 2017 Jorge Ramirez + * + * 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_V4L2_BUFFERS_H +#define AVCODEC_V4L2_BUFFERS_H + +#include +#include +#include + +#include "libavutil/frame.h" +#include "packet.h" + +enum V4L2Buffer_status { + V4L2BUF_AVAILABLE, + V4L2BUF_IN_DRIVER, + V4L2BUF_RET_USER, +}; + +/** + * V4L2Buffer (wrapper for v4l2_buffer management) + */ +typedef struct V4L2Buffer { + /* each buffer needs to have a reference to its context */ + struct V4L2Context *context; + + /* This object is refcounted per-plane, so we need to keep track + * of how many context-refs we are holding. + * This pointer is a RefStruct reference. */ + const struct V4L2m2mContext *context_ref; + atomic_uint context_refcount; + + /* keep track of the mmap address and mmap length */ + struct V4L2Plane_info { + int bytesperline; + void * mm_addr; + size_t length; + } plane_info[VIDEO_MAX_PLANES]; + + int num_planes; + + /* the v4l2_buffer buf.m.planes pointer uses the planes[] mem */ + struct v4l2_buffer buf; + struct v4l2_plane planes[VIDEO_MAX_PLANES]; + + int flags; + enum V4L2Buffer_status status; + +} V4L2Buffer; + +/** + * Extracts the data from a V4L2Buffer to an AVFrame + * + * @param[in] frame The AVFRame to push the information to + * @param[in] buf The V4L2Buffer to get the information from + * + * @returns 0 in case of success, AVERROR(EINVAL) if the number of planes is incorrect, + * AVERROR(ENOMEM) if the AVBufferRef can't be created. + */ +int ff_v4l2_buffer_buf_to_avframe(AVFrame *frame, V4L2Buffer *buf); + +/** + * Extracts the data from a V4L2Buffer to an AVPacket + * + * @param[in] pkt The AVPacket to push the information to + * @param[in] buf The V4L2Buffer to get the information from + * + * @returns 0 in case of success, AVERROR(EINVAL) if the number of planes is incorrect, + * AVERROR(ENOMEM) if the AVBufferRef can't be created. + * + */ +int ff_v4l2_buffer_buf_to_avpkt(AVPacket *pkt, V4L2Buffer *buf); + +/** + * Extracts the data from an AVPacket to a V4L2Buffer + * + * @param[in] frame AVPacket to get the data from + * @param[in] avbuf V4L2Bfuffer to push the information to + * + * @returns 0 in case of success, a negative AVERROR code otherwise + */ +int ff_v4l2_buffer_avpkt_to_buf(const AVPacket *pkt, V4L2Buffer *out); + +/** + * Extracts the data from an AVFrame to a V4L2Buffer + * + * @param[in] frame AVFrame to get the data from + * @param[in] avbuf V4L2Bfuffer to push the information to + * + * @returns 0 in case of success, a negative AVERROR code otherwise + */ +int ff_v4l2_buffer_avframe_to_buf(const AVFrame *frame, V4L2Buffer *out); + +/** + * Initializes a V4L2Buffer + * + * @param[in] avbuf V4L2Bfuffer to initialize + * @param[in] index v4l2 buffer id + * + * @returns 0 in case of success, a negative AVERROR code otherwise + */ +int ff_v4l2_buffer_initialize(V4L2Buffer* avbuf, int index); + +/** + * Enqueues a V4L2Buffer + * + * @param[in] avbuf V4L2Bfuffer to push to the driver + * + * @returns 0 in case of success, a negative AVERROR code otherwise + */ +int ff_v4l2_buffer_enqueue(V4L2Buffer* avbuf); + + +#endif // AVCODEC_V4L2_BUFFERS_H diff --git a/include/libavcodec/v4l2_context.h b/include/libavcodec/v4l2_context.h new file mode 100644 index 0000000..6f7460c --- /dev/null +++ b/include/libavcodec/v4l2_context.h @@ -0,0 +1,187 @@ +/* + * V4L2 context helper functions. + * + * Copyright (C) 2017 Alexis Ballier + * Copyright (C) 2017 Jorge Ramirez + * + * 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_V4L2_CONTEXT_H +#define AVCODEC_V4L2_CONTEXT_H + +#include +#include + +#include "libavutil/pixfmt.h" +#include "libavutil/frame.h" +#include "libavutil/rational.h" +#include "codec_id.h" +#include "packet.h" +#include "v4l2_buffers.h" + +typedef struct V4L2Context { + /** + * context name. + */ + const char* name; + + /** + * Type of this buffer context. + * See V4L2_BUF_TYPE_VIDEO_* in videodev2.h + * Readonly after init. + */ + enum v4l2_buf_type type; + + /** + * AVPixelFormat corresponding to this buffer context. + * AV_PIX_FMT_NONE means this is an encoded stream. + */ + enum AVPixelFormat av_pix_fmt; + + /** + * AVCodecID corresponding to this buffer context. + * AV_CODEC_ID_RAWVIDEO means this is a raw stream and av_pix_fmt must be set to a valid value. + */ + enum AVCodecID av_codec_id; + + /** + * Format returned by the driver after initializing the buffer context. + * Readonly after init. + */ + struct v4l2_format format; + + /** + * Width and height of the frames it produces (in case of a capture context, e.g. when decoding) + * or accepts (in case of an output context, e.g. when encoding). + */ + int width, height; + AVRational sample_aspect_ratio; + + /** + * Indexed array of V4L2Buffers + */ + V4L2Buffer *buffers; + + /** + * Readonly after init. + */ + int num_buffers; + + /** + * Whether the stream has been started (VIDIOC_STREAMON has been sent). + */ + int streamon; + + /** + * Either no more buffers available or an unrecoverable error was notified + * by the V4L2 kernel driver: once set the context has to be exited. + */ + int done; + +} V4L2Context; + +/** + * Initializes a V4L2Context. + * + * @param[in] ctx A pointer to a V4L2Context. See V4L2Context description for required variables. + * @return 0 in case of success, a negative value representing the error otherwise. + */ +int ff_v4l2_context_init(V4L2Context* ctx); + +/** + * Sets the V4L2Context format in the v4l2 driver. + * + * @param[in] ctx A pointer to a V4L2Context. See V4L2Context description for required variables. + * @return 0 in case of success, a negative value representing the error otherwise. + */ +int ff_v4l2_context_set_format(V4L2Context* ctx); + +/** + * Queries the driver for a valid v4l2 format and copies it to the context. + * + * @param[in] ctx A pointer to a V4L2Context. See V4L2Context description for required variables. + * @param[in] probe Probe only and ignore changes to the format. + * @return 0 in case of success, a negative value representing the error otherwise. + */ +int ff_v4l2_context_get_format(V4L2Context* ctx, int probe); + +/** + * Releases a V4L2Context. + * + * @param[in] ctx A pointer to a V4L2Context. + * The caller is reponsible for freeing it. + * It must not be used after calling this function. + */ +void ff_v4l2_context_release(V4L2Context* ctx); + +/** + * Sets the status of a V4L2Context. + * + * @param[in] ctx A pointer to a V4L2Context. + * @param[in] cmd The status to set (VIDIOC_STREAMON or VIDIOC_STREAMOFF). + * Warning: If VIDIOC_STREAMOFF is sent to a buffer context that still has some frames buffered, + * those frames will be dropped. + * @return 0 in case of success, a negative value representing the error otherwise. + */ +int ff_v4l2_context_set_status(V4L2Context* ctx, uint32_t cmd); + +/** + * Dequeues a buffer from a V4L2Context to an AVPacket. + * + * The pkt must be non NULL. + * @param[in] ctx The V4L2Context to dequeue from. + * @param[inout] pkt The AVPacket to dequeue to. + * @return 0 in case of success, AVERROR(EAGAIN) if no buffer was ready, another negative error in case of error. + */ +int ff_v4l2_context_dequeue_packet(V4L2Context* ctx, AVPacket* pkt); + +/** + * Dequeues a buffer from a V4L2Context to an AVFrame. + * + * The frame must be non NULL. + * @param[in] ctx The V4L2Context to dequeue from. + * @param[inout] f The AVFrame to dequeue to. + * @param[in] timeout The timeout for dequeue (-1 to block, 0 to return immediately, or milliseconds) + * @return 0 in case of success, AVERROR(EAGAIN) if no buffer was ready, another negative error in case of error. + */ +int ff_v4l2_context_dequeue_frame(V4L2Context* ctx, AVFrame* f, int timeout); + +/** + * Enqueues a buffer to a V4L2Context from an AVPacket + * + * The packet must be non NULL. + * When the size of the pkt is null, the buffer is not queued but a V4L2_DEC_CMD_STOP command is sent instead to the driver. + * + * @param[in] ctx The V4L2Context to enqueue to. + * @param[in] pkt A pointer to an AVPacket. + * @return 0 in case of success, a negative error otherwise. + */ +int ff_v4l2_context_enqueue_packet(V4L2Context* ctx, const AVPacket* pkt); + +/** + * Enqueues a buffer to a V4L2Context from an AVFrame + * + * The frame must be non NULL. + * + * @param[in] ctx The V4L2Context to enqueue to. + * @param[in] f A pointer to an AVFrame to enqueue. + * @return 0 in case of success, a negative error otherwise. + */ +int ff_v4l2_context_enqueue_frame(V4L2Context* ctx, const AVFrame* f); + +#endif // AVCODEC_V4L2_CONTEXT_H diff --git a/include/libavcodec/v4l2_fmt.h b/include/libavcodec/v4l2_fmt.h new file mode 100644 index 0000000..577e03a --- /dev/null +++ b/include/libavcodec/v4l2_fmt.h @@ -0,0 +1,35 @@ +/* + * V4L2 format helper functions + * + * Copyright (C) 2017 Alexis Ballier + * Copyright (C) 2017 Jorge Ramirez + * + * 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_V4L2_FMT_H +#define AVCODEC_V4L2_FMT_H + +#include +#include "libavutil/pixfmt.h" +#include "codec_id.h" + +enum AVPixelFormat ff_v4l2_format_v4l2_to_avfmt(uint32_t v4l2_fmt, enum AVCodecID avcodec); +uint32_t ff_v4l2_format_avcodec_to_v4l2(enum AVCodecID avcodec); +uint32_t ff_v4l2_format_avfmt_to_v4l2(enum AVPixelFormat avfmt); + +#endif /* AVCODEC_V4L2_FMT_H*/ diff --git a/include/libavcodec/v4l2_m2m.h b/include/libavcodec/v4l2_m2m.h new file mode 100644 index 0000000..4ba33dc --- /dev/null +++ b/include/libavcodec/v4l2_m2m.h @@ -0,0 +1,131 @@ +/* + * V4L2 mem2mem helper functions + * + * Copyright (C) 2017 Alexis Ballier + * Copyright (C) 2017 Jorge Ramirez + * + * 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_V4L2_M2M_H +#define AVCODEC_V4L2_M2M_H + +#include +#include +#include +#include + +#include "libavcodec/avcodec.h" +#include "v4l2_context.h" + +#define container_of(ptr, type, member) ({ \ + const __typeof__(((type *)0)->member ) *__mptr = (ptr); \ + (type *)((char *)__mptr - offsetof(type,member) );}) + +#define V4L_M2M_DEFAULT_OPTS \ + { "num_output_buffers", "Number of buffers in the output context",\ + OFFSET(num_output_buffers), AV_OPT_TYPE_INT, { .i64 = 16 }, 2, INT_MAX, FLAGS } + +typedef struct V4L2m2mContext { + char devname[PATH_MAX]; + int fd; + + /* the codec context queues */ + V4L2Context capture; + V4L2Context output; + + /* dynamic stream reconfig */ + AVCodecContext *avctx; + sem_t refsync; + atomic_uint refcount; + int reinit; + + /* null frame/packet received */ + int draining; + AVPacket buf_pkt; + + /* Reference to a frame. Only used during encoding */ + AVFrame *frame; + + /* Reference to self; only valid while codec is active. */ + struct V4L2m2mContext *self_ref; + + /* reference back to V4L2m2mPriv */ + void *priv; +} V4L2m2mContext; + +typedef struct V4L2m2mPriv { + AVClass *class; + + V4L2m2mContext *context; ///< RefStruct reference + + int num_output_buffers; + int num_capture_buffers; +} V4L2m2mPriv; + +/** + * Allocate a new context and references for a V4L2 M2M instance. + * + * @param[in] ctx The V4L2m2mPriv instantiated by the encoder/decoder. + * @param[out] ctx The V4L2m2mContext. + * + * @returns 0 in success, a negative error code otherwise. + */ +int ff_v4l2_m2m_create_context(V4L2m2mPriv *priv, V4L2m2mContext **s); + + +/** + * Probes the video nodes looking for the required codec capabilities. + * + * @param[in] ctx The V4L2m2mPriv instantiated by the encoder/decoder. + * + * @returns 0 if a driver is found, a negative number otherwise. + */ +int ff_v4l2_m2m_codec_init(V4L2m2mPriv *priv); + +/** + * Releases all the codec resources if all AVBufferRefs have been returned to the + * ctx. Otherwise keep the driver open. + * + * @param[in] The V4L2m2mPriv instantiated by the encoder/decoder. + * + * @returns 0 + * + */ +int ff_v4l2_m2m_codec_end(V4L2m2mPriv *priv); + +/** + * Reinitializes the V4L2m2mContext when the driver cannot continue processing + * with the capture parameters. + * + * @param[in] ctx The V4L2m2mContext instantiated by the encoder/decoder. + * + * @returns 0 in case of success, negative number otherwise + */ +int ff_v4l2_m2m_codec_reinit(V4L2m2mContext *ctx); + +/** + * Reinitializes the V4L2m2mContext when the driver cannot continue processing + * with the any of the current V4L2Contexts (ie, changes in output and capture). + * + * @param[in] ctx The V4L2m2mContext instantiated by the encoder/decoder. + * + * @returns 0 in case of success, negative number otherwise + */ +int ff_v4l2_m2m_codec_full_reinit(V4L2m2mContext *ctx); + +#endif /* AVCODEC_V4L2_M2M_H */ diff --git a/include/libavcodec/vaapi_decode.h b/include/libavcodec/vaapi_decode.h new file mode 100644 index 0000000..702171e --- /dev/null +++ b/include/libavcodec/vaapi_decode.h @@ -0,0 +1,92 @@ +/* + * 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_VAAPI_DECODE_H +#define AVCODEC_VAAPI_DECODE_H + +#include + +#include "libavutil/frame.h" +#include "libavutil/hwcontext.h" +#include "libavutil/hwcontext_vaapi.h" + +#include "avcodec.h" + +static inline VASurfaceID ff_vaapi_get_surface_id(AVFrame *pic) +{ + return (uintptr_t)pic->data[3]; +} + +enum { + MAX_PARAM_BUFFERS = 16, +}; + +typedef struct VAAPIDecodePicture { + VASurfaceID output_surface; + + int nb_param_buffers; + VABufferID param_buffers[MAX_PARAM_BUFFERS]; + + int nb_slices; + VABufferID *slice_buffers; + int slices_allocated; +} VAAPIDecodePicture; + +typedef struct VAAPIDecodeContext { + VAConfigID va_config; + VAContextID va_context; + + AVHWDeviceContext *device; + AVVAAPIDeviceContext *hwctx; + + AVHWFramesContext *frames; + AVVAAPIFramesContext *hwfc; + + enum AVPixelFormat surface_format; + int surface_count; + + VASurfaceAttrib pixel_format_attribute; +} VAAPIDecodeContext; + + +int ff_vaapi_decode_make_param_buffer(AVCodecContext *avctx, + VAAPIDecodePicture *pic, + int type, + const void *data, + size_t size); + +int ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx, + VAAPIDecodePicture *pic, + const void *params_data, + int nb_params, + size_t params_size, + const void *slice_data, + size_t slice_size); + +int ff_vaapi_decode_issue(AVCodecContext *avctx, + VAAPIDecodePicture *pic); +int ff_vaapi_decode_cancel(AVCodecContext *avctx, + VAAPIDecodePicture *pic); + +int ff_vaapi_decode_init(AVCodecContext *avctx); +int ff_vaapi_decode_uninit(AVCodecContext *avctx); + +int ff_vaapi_common_frame_params(AVCodecContext *avctx, + AVBufferRef *hw_frames_ctx); + +#endif /* AVCODEC_VAAPI_DECODE_H */ diff --git a/include/libavcodec/vaapi_encode.h b/include/libavcodec/vaapi_encode.h new file mode 100644 index 0000000..c4f8539 --- /dev/null +++ b/include/libavcodec/vaapi_encode.h @@ -0,0 +1,383 @@ +/* + * 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_VAAPI_ENCODE_H +#define AVCODEC_VAAPI_ENCODE_H + +#include + +#include + +#if VA_CHECK_VERSION(1, 0, 0) +#include +#endif + +#include "libavutil/hwcontext.h" +#include "libavutil/hwcontext_vaapi.h" + +#include "avcodec.h" +#include "hwconfig.h" +#include "hw_base_encode.h" + +struct VAAPIEncodeType; +struct VAAPIEncodePicture; + +// Codec output packet without timestamp delay, which means the +// output packet has same PTS and DTS. +#define FLAG_TIMESTAMP_NO_DELAY 1 << 6 + +enum { + MAX_CONFIG_ATTRIBUTES = 4, + MAX_GLOBAL_PARAMS = 4, + MAX_PARAM_BUFFER_SIZE = 1024, + // A.4.1: table A.6 allows at most 22 tile rows for any level. + MAX_TILE_ROWS = 22, + // A.4.1: table A.6 allows at most 20 tile columns for any level. + MAX_TILE_COLS = 20, +}; + +extern const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[]; + +typedef struct VAAPIEncodeSlice { + int index; + int row_start; + int row_size; + int block_start; + int block_size; + void *codec_slice_params; +} VAAPIEncodeSlice; + +typedef struct VAAPIEncodePicture { +#if VA_CHECK_VERSION(1, 0, 0) + // ROI regions. + VAEncROI *roi; +#else + void *roi; +#endif + + VASurfaceID input_surface; + VASurfaceID recon_surface; + + int nb_param_buffers; + VABufferID *param_buffers; + + /* Refcounted via the refstruct-API */ + VABufferID *output_buffer_ref; + VABufferID output_buffer; + + void *codec_picture_params; + + int nb_slices; + VAAPIEncodeSlice *slices; + + /** + * indicate if current frame is an independent frame that the coded data + * can be pushed to downstream directly. Coded of non-independent frame + * data will be concatenated into next independent frame. + */ + int non_independent_frame; + /** Tail data of current pic, used only for repeat header of AV1. */ + char tail_data[MAX_PARAM_BUFFER_SIZE]; + /** Byte length of tail_data. */ + size_t tail_size; +} VAAPIEncodePicture; + +typedef struct VAAPIEncodeProfile { + // lavc profile value (AV_PROFILE_*). + int av_profile; + // Supported bit depth. + int depth; + // Number of components. + int nb_components; + // Chroma subsampling in width dimension. + int log2_chroma_w; + // Chroma subsampling in height dimension. + int log2_chroma_h; + // VAAPI profile value. + VAProfile va_profile; +} VAAPIEncodeProfile; + +enum { + RC_MODE_AUTO, + RC_MODE_CQP, + RC_MODE_CBR, + RC_MODE_VBR, + RC_MODE_ICQ, + RC_MODE_QVBR, + RC_MODE_AVBR, + RC_MODE_MAX = RC_MODE_AVBR, +}; + +typedef struct VAAPIEncodeRCMode { + // Mode from above enum (RC_MODE_*). + int mode; + // Name. + const char *name; + // Supported in the compile-time VAAPI version. + int supported; + // VA mode value (VA_RC_*). + uint32_t va_mode; + // Uses bitrate parameters. + int bitrate; + // Supports maxrate distinct from bitrate. + int maxrate; + // Uses quality value. + int quality; + // Supports HRD/VBV parameters. + int hrd; +} VAAPIEncodeRCMode; + +typedef struct VAAPIEncodeContext { + // Base context. + FFHWBaseEncodeContext base; + + // Codec-specific hooks. + const struct VAAPIEncodeType *codec; + + // Use low power encoding mode. + int low_power; + + // Max Frame Size + int max_frame_size; + + // Explicitly set RC mode (otherwise attempt to pick from + // available modes). + int explicit_rc_mode; + + // Block Level based bitrate control. + int blbrc; + + // Explicitly-set QP, for use with the "qp" options. + // (Forces CQP mode when set, overriding everything else.) + int explicit_qp; + + // Desired packed headers. + unsigned int desired_packed_headers; + + // Everything above this point must be set before calling + // ff_vaapi_encode_init(). + + // Chosen encoding profile details. + const VAAPIEncodeProfile *profile; + + // Chosen rate control mode details. + const VAAPIEncodeRCMode *rc_mode; + // RC quality level - meaning depends on codec and RC mode. + // In CQP mode this sets the fixed quantiser value. + int rc_quality; + + // Encoding profile (VAProfile*). + VAProfile va_profile; + // Encoding entrypoint (VAEntryoint*). + VAEntrypoint va_entrypoint; + // Rate control mode. + unsigned int va_rc_mode; + // Bitrate for codec-specific encoder parameters. + unsigned int va_bit_rate; + // Packed headers which will actually be sent. + unsigned int va_packed_headers; + + // Configuration attributes to use when creating va_config. + VAConfigAttrib config_attributes[MAX_CONFIG_ATTRIBUTES]; + int nb_config_attributes; + + VAConfigID va_config; + VAContextID va_context; + + AVVAAPIDeviceContext *hwctx; + + // Pool of (reusable) bitstream output buffers. + struct FFRefStructPool *output_buffer_pool; + + // Global parameters which will be applied at the start of the + // sequence (includes rate control parameters below). + int global_params_type[MAX_GLOBAL_PARAMS]; + const void *global_params [MAX_GLOBAL_PARAMS]; + size_t global_params_size[MAX_GLOBAL_PARAMS]; + int nb_global_params; + + // Rate control parameters. + VAEncMiscParameterRateControl rc_params; + VAEncMiscParameterHRD hrd_params; + VAEncMiscParameterFrameRate fr_params; + VAEncMiscParameterBufferMaxFrameSize mfs_params; +#if VA_CHECK_VERSION(0, 36, 0) + VAEncMiscParameterBufferQualityLevel quality_params; +#endif + + // Per-sequence parameter structure (VAEncSequenceParameterBuffer*). + void *codec_sequence_params; + + // Per-sequence parameters found in the per-picture parameter + // structure (VAEncPictureParameterBuffer*). + void *codec_picture_params; + + // Slice structure. + int slice_block_rows; + int slice_block_cols; + int nb_slices; + int slice_size; + + // Tile encoding. + int tile_cols; + int tile_rows; + // Tile width of the i-th column. + int col_width[MAX_TILE_COLS]; + // Tile height of i-th row. + int row_height[MAX_TILE_ROWS]; + // Location of the i-th tile column boundary. + int col_bd[MAX_TILE_COLS + 1]; + // Location of the i-th tile row boundary. + int row_bd[MAX_TILE_ROWS + 1]; + + // Maximum number of regions supported by the driver. + int roi_max_regions; + // Quantisation range for offset calculations. Set by codec-specific + // code, as it may change based on parameters. + int roi_quant_range; + + /** Head data for current output pkt, used only for AV1. */ + //void *header_data; + //size_t header_data_size; + + /** + * Buffered coded data of a pic if it is an non-independent frame. + * This is a RefStruct reference. + */ + VABufferID *coded_buffer_ref; +} VAAPIEncodeContext; + +typedef struct VAAPIEncodeType { + // List of supported profiles and corresponding VAAPI profiles. + // (Must end with AV_PROFILE_UNKNOWN.) + const VAAPIEncodeProfile *profiles; + + // Codec feature flags. + int flags; + + // Default quality for this codec - used as quantiser or RC quality + // factor depending on RC mode. + int default_quality; + + // Determine encode parameters like block sizes for surface alignment + // and slices. This may need to query the profile and entrypoint, + // which will be available when this function is called. If not set, + // assume that all blocks are 16x16 and that surfaces should be + // aligned to match this. + int (*get_encoder_caps)(AVCodecContext *avctx); + + // Perform any extra codec-specific configuration after the + // codec context is initialised (set up the private data and + // add any necessary global parameters). + int (*configure)(AVCodecContext *avctx); + + // The size of any private data structure associated with each + // picture (can be zero if not required). + size_t picture_priv_data_size; + + // The size of the parameter structures: + // sizeof(VAEnc{type}ParameterBuffer{codec}). + size_t sequence_params_size; + size_t picture_params_size; + size_t slice_params_size; + + // Fill the parameter structures. + int (*init_sequence_params)(AVCodecContext *avctx); + int (*init_picture_params)(AVCodecContext *avctx, + FFHWBaseEncodePicture *pic); + int (*init_slice_params)(AVCodecContext *avctx, + FFHWBaseEncodePicture *pic, + VAAPIEncodeSlice *slice); + + // The type used by the packed header: this should look like + // VAEncPackedHeader{something}. + int sequence_header_type; + int picture_header_type; + int slice_header_type; + + // Write the packed header data to the provided buffer. + // The sequence header is also used to fill the codec extradata + // when the encoder is starting. + int (*write_sequence_header)(AVCodecContext *avctx, + char *data, size_t *data_len); + int (*write_picture_header)(AVCodecContext *avctx, + FFHWBaseEncodePicture *pic, + char *data, size_t *data_len); + int (*write_slice_header)(AVCodecContext *avctx, + VAAPIEncodePicture *pic, + VAAPIEncodeSlice *slice, + char *data, size_t *data_len); + + // Fill an extra parameter structure, which will then be + // passed to vaRenderPicture(). Will be called repeatedly + // with increasing index argument until AVERROR_EOF is + // returned. + int (*write_extra_buffer)(AVCodecContext *avctx, + FFHWBaseEncodePicture *pic, + int index, int *type, + char *data, size_t *data_len); + + // Write an extra packed header. Will be called repeatedly + // with increasing index argument until AVERROR_EOF is + // returned. + int (*write_extra_header)(AVCodecContext *avctx, + FFHWBaseEncodePicture *pic, + int index, int *type, + char *data, size_t *data_len); +} VAAPIEncodeType; + +int ff_vaapi_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt); + +int ff_vaapi_encode_init(AVCodecContext *avctx); +int ff_vaapi_encode_close(AVCodecContext *avctx); + + +#define VAAPI_ENCODE_COMMON_OPTIONS \ + { "low_power", \ + "Use low-power encoding mode (only available on some platforms; " \ + "may not support all encoding features)", \ + OFFSET(common.low_power), AV_OPT_TYPE_BOOL, \ + { .i64 = 0 }, 0, 1, FLAGS }, \ + { "max_frame_size", \ + "Maximum frame size (in bytes)",\ + OFFSET(common.max_frame_size), AV_OPT_TYPE_INT, \ + { .i64 = 0 }, 0, INT_MAX, FLAGS } + +#define VAAPI_ENCODE_RC_MODE(name, desc) \ + { #name, desc, 0, AV_OPT_TYPE_CONST, { .i64 = RC_MODE_ ## name }, \ + 0, 0, FLAGS, .unit = "rc_mode" } +#define VAAPI_ENCODE_RC_OPTIONS \ + { "rc_mode",\ + "Set rate control mode", \ + OFFSET(common.explicit_rc_mode), AV_OPT_TYPE_INT, \ + { .i64 = RC_MODE_AUTO }, RC_MODE_AUTO, RC_MODE_MAX, FLAGS, .unit = "rc_mode" }, \ + { "auto", "Choose mode automatically based on other parameters", \ + 0, AV_OPT_TYPE_CONST, { .i64 = RC_MODE_AUTO }, 0, 0, FLAGS, .unit = "rc_mode" }, \ + VAAPI_ENCODE_RC_MODE(CQP, "Constant-quality"), \ + VAAPI_ENCODE_RC_MODE(CBR, "Constant-bitrate"), \ + VAAPI_ENCODE_RC_MODE(VBR, "Variable-bitrate"), \ + VAAPI_ENCODE_RC_MODE(ICQ, "Intelligent constant-quality"), \ + VAAPI_ENCODE_RC_MODE(QVBR, "Quality-defined variable-bitrate"), \ + VAAPI_ENCODE_RC_MODE(AVBR, "Average variable-bitrate"), \ + { "blbrc", \ + "Block level based bitrate control",\ + OFFSET(common.blbrc), AV_OPT_TYPE_BOOL, \ + { .i64 = 0 }, 0, 1, FLAGS } + + +#endif /* AVCODEC_VAAPI_ENCODE_H */ diff --git a/include/libavcodec/vaapi_hevc.h b/include/libavcodec/vaapi_hevc.h new file mode 100644 index 0000000..449635d --- /dev/null +++ b/include/libavcodec/vaapi_hevc.h @@ -0,0 +1,27 @@ +/* + * 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_VAAPI_HEVC_H +#define AVCODEC_VAAPI_HEVC_H + +#include +#include "avcodec.h" + +VAProfile ff_vaapi_parse_hevc_rext_scc_profile(AVCodecContext *avctx); + +#endif /* AVCODEC_VAAPI_HEVC_H */ diff --git a/include/libavcodec/vbn.h b/include/libavcodec/vbn.h new file mode 100644 index 0000000..8660786 --- /dev/null +++ b/include/libavcodec/vbn.h @@ -0,0 +1,50 @@ +/* + * VBN format definitions + * + * 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 + */ + +/** + * @file + * VBN format definitions. + */ + +#ifndef AVCODEC_VBN_H +#define AVCODEC_VBN_H + +#define VBN_MAGIC 0x900df11e +#define VBN_MAJOR 3 +#define VBN_MINOR 4 + +#define VBN_HEADER_SIZE 192 + +#define VBN_FORMAT_RAW 0 +#define VBN_FORMAT_LZ 1 +#define VBN_FORMAT_DXT1 2 +#define VBN_FORMAT_DXT5 3 + +#define VBN_COMPRESSION_NONE 0 +#define VBN_COMPRESSION_LZW 0x100 + +#define VBN_PIX_ALPHA 0 +#define VBN_PIX_LUMINANCE 1 +#define VBN_PIX_LUMINANCE_ALPHA 2 +#define VBN_PIX_RGB 3 +#define VBN_PIX_RGBA 5 +#define VBN_PIX_INDEX 6 + +#endif /* AVCODEC_VBN_H */ diff --git a/include/libavcodec/vc1.h b/include/libavcodec/vc1.h new file mode 100644 index 0000000..1852366 --- /dev/null +++ b/include/libavcodec/vc1.h @@ -0,0 +1,436 @@ +/* + * VC-1 and WMV3 decoder + * Copyright (c) 2006-2007 Konstantin Shishkov + * Partly based on vc9.c (c) 2005 Anonymous, Alex Beregszaszi, Michael Niedermayer + * + * 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_VC1_H +#define AVCODEC_VC1_H + +#include "avcodec.h" +#include "h264chroma.h" +#include "mpegvideo.h" +#include "intrax8.h" +#include "vc1_common.h" +#include "vc1dsp.h" + +#define AC_VLC_BITS 9 + +/** Sequence quantizer mode */ +//@{ +enum QuantMode { + QUANT_FRAME_IMPLICIT, ///< Implicitly specified at frame level + QUANT_FRAME_EXPLICIT, ///< Explicitly specified at frame level + QUANT_NON_UNIFORM, ///< Non-uniform quant used for all frames + QUANT_UNIFORM ///< Uniform quant used for all frames +}; +//@} + +/** Where quant can be changed */ +//@{ +enum DQProfile { + DQPROFILE_FOUR_EDGES, + DQPROFILE_DOUBLE_EDGES, + DQPROFILE_SINGLE_EDGE, + DQPROFILE_ALL_MBS +}; +//@} + +/** @name Where quant can be changed + */ +//@{ +enum DQSingleEdge { + DQSINGLE_BEDGE_LEFT, + DQSINGLE_BEDGE_TOP, + DQSINGLE_BEDGE_RIGHT, + DQSINGLE_BEDGE_BOTTOM +}; +//@} + +/** Which pair of edges is quantized with ALTPQUANT */ +//@{ +enum DQDoubleEdge { + DQDOUBLE_BEDGE_TOPLEFT, + DQDOUBLE_BEDGE_TOPRIGHT, + DQDOUBLE_BEDGE_BOTTOMRIGHT, + DQDOUBLE_BEDGE_BOTTOMLEFT +}; +//@} + +/** MV modes for P-frames */ +//@{ +enum MVModes { + MV_PMODE_1MV_HPEL_BILIN, + MV_PMODE_1MV, + MV_PMODE_1MV_HPEL, + MV_PMODE_MIXED_MV, + MV_PMODE_INTENSITY_COMP +}; +//@} + +/** MBMODE for interlaced frame P-picture */ +//@{ +enum MBModesIntfr { + MV_PMODE_INTFR_1MV, + MV_PMODE_INTFR_2MV_FIELD, + MV_PMODE_INTFR_2MV, + MV_PMODE_INTFR_4MV_FIELD, + MV_PMODE_INTFR_4MV, + MV_PMODE_INTFR_INTRA, +}; +//@} + +/** @name MV types for B-frames */ +//@{ +enum BMVTypes { + BMV_TYPE_BACKWARD, + BMV_TYPE_FORWARD, + BMV_TYPE_INTERPOLATED, + BMV_TYPE_DIRECT +}; +//@} + +/** @name Block types for P/B-frames */ +//@{ +enum TransformTypes { + TT_8X8, + TT_8X4_BOTTOM, + TT_8X4_TOP, + TT_8X4, // both halves + TT_4X8_RIGHT, + TT_4X8_LEFT, + TT_4X8, // both halves + TT_4X4 +}; +//@} + +enum CodingSet { + CS_HIGH_MOT_INTRA = 0, + CS_HIGH_MOT_INTER, + CS_LOW_MOT_INTRA, + CS_LOW_MOT_INTER, + CS_MID_RATE_INTRA, + CS_MID_RATE_INTER, + CS_HIGH_RATE_INTRA, + CS_HIGH_RATE_INTER +}; + +/** @name Overlap conditions for Advanced Profile */ +//@{ +enum COTypes { + CONDOVER_NONE = 0, + CONDOVER_ALL, + CONDOVER_SELECT +}; +//@} + +/** + * FCM Frame Coding Mode + * @note some content might be marked interlaced + * but have fcm set to 0 as well (e.g. HD-DVD) + */ +enum FrameCodingMode { + PROGRESSIVE = 0, ///< in the bitstream is reported as 00b + ILACE_FRAME, ///< in the bitstream is reported as 10b + ILACE_FIELD ///< in the bitstream is reported as 11b +}; + +/** + * Imode types + * @{ + */ +enum Imode { + IMODE_RAW, + IMODE_NORM2, + IMODE_DIFF2, + IMODE_NORM6, + IMODE_DIFF6, + IMODE_ROWSKIP, + IMODE_COLSKIP +}; +/** @} */ //imode defines + +/** The VC1 Context + * @todo Change size wherever another size is more efficient + * Many members are only used for Advanced Profile + */ +typedef struct VC1Context{ + MpegEncContext s; + IntraX8Context x8; + H264ChromaContext h264chroma; + VC1DSPContext vc1dsp; + + /** Simple/Main Profile sequence header */ + //@{ + int res_sprite; ///< reserved, sprite mode + int res_y411; ///< reserved, old interlaced mode + int res_x8; ///< reserved + int multires; ///< frame-level RESPIC syntax element present + int res_fasttx; ///< reserved, always 1 + int res_transtab; ///< reserved, always 0 + int rangered; ///< RANGEREDFRM (range reduction) syntax element present + ///< at frame level + int res_rtm_flag; ///< reserved, set to 1 + int reserved; ///< reserved + //@} + + /** Advanced Profile */ + //@{ + int level; ///< 3 bits, for Advanced/Simple Profile, provided by TS layer + int chromaformat; ///< 2 bits, 2=4:2:0, only defined + int postprocflag; ///< Per-frame processing suggestion flag present + int broadcast; ///< TFF/RFF present + int interlace; ///< Progressive/interlaced (RPTFTM syntax element) + int tfcntrflag; ///< TFCNTR present + int panscanflag; ///< NUMPANSCANWIN, TOPLEFT{X,Y}, BOTRIGHT{X,Y} present + int refdist_flag; ///< REFDIST syntax element present in II, IP, PI or PP field picture headers + int extended_dmv; ///< Additional extended dmv range at P/B-frame-level + int color_prim; ///< 8 bits, chroma coordinates of the color primaries + int transfer_char; ///< 8 bits, Opto-electronic transfer characteristics + int matrix_coef; ///< 8 bits, Color primaries->YCbCr transform matrix + int hrd_param_flag; ///< Presence of Hypothetical Reference + ///< Decoder parameters + int psf; ///< Progressive Segmented Frame + //@} + + /** Sequence header data for all Profiles + * TODO: choose between ints, uint8_ts and monobit flags + */ + //@{ + int profile; ///< 2 bits, Profile + int frmrtq_postproc; ///< 3 bits, + int bitrtq_postproc; ///< 5 bits, quantized framerate-based postprocessing strength + int max_coded_width, max_coded_height; + int fastuvmc; ///< Rounding of qpel vector to hpel ? (not in Simple) + int extended_mv; ///< Ext MV in P/B (not in Simple) + int dquant; ///< How qscale varies with MBs, 2 bits (not in Simple) + int vstransform; ///< variable-size [48]x[48] transform type + info + int overlap; ///< overlapped transforms in use + int quantizer_mode; ///< 2 bits, quantizer mode used for sequence, see QUANT_* + int finterpflag; ///< INTERPFRM present + //@} + + /** Frame decoding info for all profiles */ + //@{ + uint8_t mv_mode; ///< MV coding mode + uint8_t mv_mode2; ///< Secondary MV coding mode (B-frames) + int k_x; ///< Number of bits for MVs (depends on MV range) + int k_y; ///< Number of bits for MVs (depends on MV range) + int range_x, range_y; ///< MV range + uint8_t pq, altpq; ///< Current/alternate frame quantizer scale + uint8_t zz_8x8[4][64]; ///< Zigzag table for TT_8x8, permuted for IDCT + int left_blk_sh, top_blk_sh; ///< Either 3 or 0, positions of l/t in blk[] + const uint8_t* zz_8x4; ///< Zigzag scan table for TT_8x4 coding mode + const uint8_t* zz_4x8; ///< Zigzag scan table for TT_4x8 coding mode + /** pquant parameters */ + //@{ + uint8_t dquantfrm; + uint8_t dqprofile; + uint8_t dqsbedge; + uint8_t dqbilevel; + //@} + /** AC coding set indexes + * @see 8.1.1.10, p(1)10 + */ + //@{ + int c_ac_table_index; ///< Chroma index from ACFRM element + int y_ac_table_index; ///< Luma index from AC2FRM element + //@} + int ttfrm; ///< Transform type info present at frame level + uint8_t ttmbf; ///< Transform type flag + int *ttblk_base, *ttblk; ///< Transform type at the block level + int codingset; ///< index of current table set from 11.8 to use for luma block decoding + int codingset2; ///< index of current table set from 11.8 to use for chroma block decoding + int pqindex; ///< raw pqindex used in coding set selection + int a_avail, c_avail; + uint8_t *mb_type_base, *mb_type[3]; + + + /** Luma compensation parameters */ + //@{ + uint8_t lumscale; + uint8_t lumshift; + //@} + int16_t bfraction; ///< Relative position % anchors=> how to scale MVs + uint8_t halfpq; ///< Uniform quant over image and qp+.5 + uint8_t respic; ///< Frame-level flag for resized images + int buffer_fullness; ///< HRD info + /** Ranges: + * -# 0 -> [-64n 63.f] x [-32, 31.f] + * -# 1 -> [-128, 127.f] x [-64, 63.f] + * -# 2 -> [-512, 511.f] x [-128, 127.f] + * -# 3 -> [-1024, 1023.f] x [-256, 255.f] + */ + uint8_t mvrange; ///< Extended MV range flag + uint8_t pquantizer; ///< Uniform (over sequence) quantizer in use + const VLCElem *cbpcy_vlc; ///< CBPCY VLC table + int tt_index; ///< Index for Transform Type tables (to decode TTMB) + uint8_t* mv_type_mb_plane; ///< bitplane for mv_type == (4MV) + uint8_t* direct_mb_plane; ///< bitplane for "direct" MBs + uint8_t* forward_mb_plane; ///< bitplane for "forward" MBs + int mv_type_is_raw; ///< mv type mb plane is not coded + int dmb_is_raw; ///< direct mb plane is raw + int fmb_is_raw; ///< forward mb plane is raw + int skip_is_raw; ///< skip mb plane is not coded + uint8_t last_luty[2][256], last_lutuv[2][256]; ///< lookup tables used for intensity compensation + uint8_t aux_luty[2][256], aux_lutuv[2][256]; ///< lookup tables used for intensity compensation + uint8_t next_luty[2][256], next_lutuv[2][256]; ///< lookup tables used for intensity compensation + uint8_t (*curr_luty)[256] ,(*curr_lutuv)[256]; + int last_use_ic, *curr_use_ic, next_use_ic, aux_use_ic; + int last_interlaced, next_interlaced; ///< whether last_pic, next_pic is interlaced + int rnd; ///< rounding control + int cbptab; + + /** Frame decoding info for S/M profiles only */ + //@{ + uint8_t rangeredfrm; ///< out_sample = CLIP((in_sample-128)*2+128) + uint8_t interpfrm; + //@} + + /** Frame decoding info for Advanced profile */ + //@{ + enum FrameCodingMode fcm; + uint8_t numpanscanwin; + uint8_t tfcntr; + uint8_t rptfrm, tff, rff; + uint16_t topleftx; + uint16_t toplefty; + uint16_t bottomrightx; + uint16_t bottomrighty; + uint8_t uvsamp; + uint8_t postproc; + int hrd_num_leaky_buckets; + uint8_t bit_rate_exponent; + uint8_t buffer_size_exponent; + uint8_t* acpred_plane; ///< AC prediction flags bitplane + int acpred_is_raw; + uint8_t* over_flags_plane; ///< Overflags bitplane + int overflg_is_raw; + uint8_t condover; + uint8_t range_mapy_flag; + uint8_t range_mapuv_flag; + uint8_t range_mapy; + uint8_t range_mapuv; + //@} + + /** Frame decoding info for interlaced picture */ + uint8_t dmvrange; ///< Extended differential MV range flag + int fourmvswitch; + int intcomp; + uint8_t lumscale2; ///< for interlaced field P picture + uint8_t lumshift2; + const VLCElem *mbmode_vlc; + const VLCElem *imv_vlc; + const VLCElem *twomvbp_vlc; + const VLCElem *fourmvbp_vlc; + uint8_t twomvbp; + uint8_t fourmvbp; + uint8_t* fieldtx_plane; + int fieldtx_is_raw; + uint8_t zzi_8x8[64]; + uint8_t *blk_mv_type_base, *blk_mv_type; ///< 0: frame MV, 1: field MV (interlaced frame) + uint8_t *mv_f_base, *mv_f[2]; ///< 0: MV obtained from same field, 1: opposite field + uint8_t *mv_f_next_base, *mv_f_next[2]; + int field_mode; ///< 1 for interlaced field pictures + int fptype; + int second_field; + int refdist; ///< distance of the current picture from reference + int numref; ///< number of past field pictures used as reference + // 0 corresponds to 1 and 1 corresponds to 2 references + int reffield; ///< if numref = 0 (1 reference) then reffield decides which + // field to use among the two fields from previous frame + int intcompfield; ///< which of the two fields to be intensity compensated + // 0: both fields, 1: bottom field, 2: top field + int cur_field_type; ///< 0: top, 1: bottom + int ref_field_type[2]; ///< forward and backward reference field type (top or bottom) + int blocks_off, mb_off; + int qs_last; ///< if qpel has been used in the previous (tr.) picture + int bmvtype; + int frfd, brfd; ///< reference frame distance (forward or backward) + int first_pic_header_flag; + int pic_header_flag; + int mbmodetab; + int icbptab; + int imvtab; + int twomvbptab; + int fourmvbptab; + + /** Frame decoding info for sprite modes */ + //@{ + int new_sprite; + int two_sprites; + AVFrame *sprite_output_frame; + int output_width, output_height, sprite_width, sprite_height; + uint8_t* sr_rows[2][2]; ///< Sprite resizer line cache + //@} + + int p_frame_skipped; + int bi_type; + int x8_type; + + int16_t (*block)[6][64]; + int n_allocated_blks, cur_blk_idx, left_blk_idx, topleft_blk_idx, top_blk_idx; + uint32_t *cbp_base, *cbp; + uint8_t *is_intra_base, *is_intra; + int16_t (*luma_mv_base)[2], (*luma_mv)[2]; + uint8_t bfraction_lut_index; ///< Index for BFRACTION value (see Table 40, reproduced into ff_vc1_bfraction_lut[]) + uint8_t broken_link; ///< Broken link flag (BROKEN_LINK syntax element) + uint8_t closed_entry; ///< Closed entry point flag (CLOSED_ENTRY syntax element) + + int end_mb_x; ///< Horizontal macroblock limit (used only by mss2) + + int parse_only; ///< Context is used within parser + int resync_marker; ///< could this stream contain resync markers +} VC1Context; + +/** + * Decode Simple/Main Profiles sequence header + * @see Figure 7-8, p16-17 + * @param avctx Codec context + * @param gb GetBit context initialized from Codec context extra_data + * @return Status + */ +int ff_vc1_decode_sequence_header(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb); + +int ff_vc1_decode_entry_point(AVCodecContext *avctx, VC1Context *v, GetBitContext *gb); + +int ff_vc1_parse_frame_header (VC1Context *v, GetBitContext *gb); +int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext *gb); +void ff_vc1_init_common(VC1Context *v); + +int ff_vc1_decode_init(AVCodecContext *avctx); +void ff_vc1_init_transposed_scantables(VC1Context *v); +int ff_vc1_decode_end(AVCodecContext *avctx); +void ff_vc1_decode_blocks(VC1Context *v); + +void ff_vc1_i_overlap_filter(VC1Context *v); +void ff_vc1_p_overlap_filter(VC1Context *v); +void ff_vc1_i_loop_filter(VC1Context *v); +void ff_vc1_p_loop_filter(VC1Context *v); +void ff_vc1_p_intfr_loop_filter(VC1Context *v); +void ff_vc1_b_intfi_loop_filter(VC1Context *v); + +void ff_vc1_mc_1mv(VC1Context *v, int dir); +void ff_vc1_mc_4mv_luma(VC1Context *v, int n, int dir, int avg); +void ff_vc1_mc_4mv_chroma(VC1Context *v, int dir); +void ff_vc1_mc_4mv_chroma4(VC1Context *v, int dir, int dir2, int avg); + +void ff_vc1_interp_mc(VC1Context *v); + +#endif /* AVCODEC_VC1_H */ diff --git a/include/libavcodec/vc1_common.h b/include/libavcodec/vc1_common.h new file mode 100644 index 0000000..c0f0c8c --- /dev/null +++ b/include/libavcodec/vc1_common.h @@ -0,0 +1,90 @@ +/* + * VC-1 and WMV3 decoder + * Copyright (c) 2006-2007 Konstantin Shishkov + * Partly based on vc9.c (c) 2005 Anonymous, Alex Beregszaszi, Michael Niedermayer + * + * 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_VC1_COMMON_H +#define AVCODEC_VC1_COMMON_H + +#include + +#include "libavutil/attributes.h" +#include "startcode.h" + +/** Markers used in VC-1 AP frame data */ +//@{ +enum VC1Code { + VC1_CODE_RES0 = 0x00000100, + VC1_CODE_ENDOFSEQ = 0x0000010A, + VC1_CODE_SLICE, + VC1_CODE_FIELD, + VC1_CODE_FRAME, + VC1_CODE_ENTRYPOINT, + VC1_CODE_SEQHDR, +}; +//@} + +#define IS_MARKER(x) (((x) & ~0xFF) == VC1_CODE_RES0) + +/** Available Profiles */ +//@{ +enum Profile { + PROFILE_SIMPLE, + PROFILE_MAIN, + PROFILE_COMPLEX, ///< TODO: WMV9 specific + PROFILE_ADVANCED +}; +//@} + +/** Find VC-1 marker in buffer + * @return position where next marker starts or end of buffer if no marker found + */ +static av_always_inline const uint8_t* find_next_marker(const uint8_t *src, const uint8_t *end) +{ + if (end - src >= 4) { + uint32_t mrk = 0xFFFFFFFF; + src = avpriv_find_start_code(src, end, &mrk); + if (IS_MARKER(mrk)) + return src - 4; + } + return end; +} + +static av_always_inline int vc1_unescape_buffer(const uint8_t *src, int size, uint8_t *dst) +{ + int dsize = 0, i; + + if (size < 4) { + for (dsize = 0; dsize < size; dsize++) + *dst++ = *src++; + return size; + } + for (i = 0; i < size; i++, src++) { + if (src[0] == 3 && i >= 2 && !src[-1] && !src[-2] && i < size-1 && src[1] < 4) { + dst[dsize++] = src[1]; + src++; + i++; + } else + dst[dsize++] = *src; + } + return dsize; +} + +#endif /* AVCODEC_VC1_COMMON_H */ diff --git a/include/libavcodec/vc1_pred.h b/include/libavcodec/vc1_pred.h new file mode 100644 index 0000000..ff894e0 --- /dev/null +++ b/include/libavcodec/vc1_pred.h @@ -0,0 +1,58 @@ +/* + * VC-1 and WMV3 decoder + * Copyright (c) 2006-2007 Konstantin Shishkov + * Partly based on vc9.c (c) 2005 Anonymous, Alex Beregszaszi, Michael Niedermayer + * + * 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_VC1_PRED_H +#define AVCODEC_VC1_PRED_H + +#include "vc1.h" +#include "vc1data.h" + +void ff_vc1_pred_mv(VC1Context *v, int n, int dmv_x, int dmv_y, + int mv1, int r_x, int r_y, uint8_t* is_intra, + int pred_flag, int dir); +void ff_vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y, + int mvn, int r_x, int r_y, int dir); +void ff_vc1_pred_b_mv(VC1Context *v, int dmv_x[2], int dmv_y[2], + int direct, int mvtype); +void ff_vc1_pred_b_mv_intfi(VC1Context *v, int n, int *dmv_x, int *dmv_y, + int mv1, int *pred_flag); + +static av_always_inline int scale_mv(int value, int bfrac, int inv, int qs) +{ + int n = bfrac; + +#if B_FRACTION_DEN==256 + if (inv) + n -= 256; + if (!qs) + return 2 * ((value * n + 255) >> 9); + return (value * n + 128) >> 8; +#else + if (inv) + n -= B_FRACTION_DEN; + if (!qs) + return 2 * ((value * n + B_FRACTION_DEN - 1) / (2 * B_FRACTION_DEN)); + return (value * n + B_FRACTION_DEN/2) / B_FRACTION_DEN; +#endif +} + +#endif /* AVCODEC_VC1_PRED_H */ diff --git a/include/libavcodec/vc1_vlc_data.h b/include/libavcodec/vc1_vlc_data.h new file mode 100644 index 0000000..2cd227b --- /dev/null +++ b/include/libavcodec/vc1_vlc_data.h @@ -0,0 +1,1063 @@ +/* + * VC-1 and WMV3 decoder VLC table data + * copyright (c) 2011 Mashiat Sarker Shakkhar + * copyright (c) 2006 Konstantin Shishkov + * (c) 2005 anonymous, Alex Beregszaszi, Michael Niedermayer + * + * 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 + */ + +/** + * @file + * VC-1 tables. + */ + +#ifndef AVCODEC_VC1_VLC_DATA_H +#define AVCODEC_VC1_VLC_DATA_H + +#include + +#include "vc1data.h" + +/* BitPlane IMODE - such a small table... */ +static const uint8_t vc1_imode_codes[7] = { + 0, 2, 1, 3, 1, 2, 3 +}; +static const uint8_t vc1_imode_bits[7] = { + 4, 2, 3, 2, 4, 3, 3 +}; + +/* Normal-2 imode */ +static const uint8_t vc1_norm2_codes[4] = { + 0, 4, 5, 3 +}; +static const uint8_t vc1_norm2_bits[4] = { + 1, 3, 3, 2 +}; + +static const uint16_t 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, +}; + +static const uint8_t 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, +}; + +/* 4MV Block pattern VLC tables */ +static const uint8_t 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 } +}; +static const uint8_t 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 } +}; + +/* 2MV Block pattern VLC tables */ +static const uint8_t vc1_2mv_block_pattern_codes[4][4] = { + { 2, 1, 0, 3 }, { 1, 0, 2, 3 }, { 2, 0, 3, 1 }, { 1, 3, 2, 0 } +}; + +static const uint8_t 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) */ +static const uint16_t 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 } +}; + +static const uint8_t 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) */ +static const uint8_t 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 } +}; + +static const uint8_t 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 field picture MBMODE VLC tables (p. 356 - 11.4.1, 11.4.2) */ +/* mixed-MV */ +static const uint8_t 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 } +}; +static const uint8_t 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 } +}; + +/* 1MV */ +static const uint8_t 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 } +}; +static const uint8_t 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 } +}; + +/* Interlaced frame/field picture MVDATA VLC tables */ + +/* 1-reference tables */ +static const uint32_t 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 + } +}; + +static const uint8_t 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 + } +}; + +/* 2-reference tables */ +static const uint32_t 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 + } +}; + +static const uint8_t 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 + } +}; + +/* P-Picture CBPCY VLC tables */ +// Looks like original tables are not conforming to standard at all. Are they used for old WMV? +static const uint16_t 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 + } +}; + +static const uint8_t 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 + } +}; + +/* Interlaced CBPCY VLC tables (Table 124 - Table 131) */ +static const uint16_t 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 + } +}; + +static const uint8_t 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 */ +static const uint16_t 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 + } +}; + +static const uint8_t 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 + } +}; + +/* TTBLK (Transform Type per Block) tables */ +static const uint8_t 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 } +}; +static const uint8_t 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 } +}; + +/* SUBBLKPAT tables, p93-94, reordered */ +static const uint8_t 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 } +}; +static const uint8_t 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} +}; + +/* MV differential tables, p265 */ +static const uint16_t 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 */ + } +}; +static const uint8_t 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 */ + } +}; + +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} +} +}; + +const int ff_vc1_ac_sizes[AC_MODES] = { + 186, 169, 133, 149, 103, 103, 163, 175 +}; + +#endif /* AVCODEC_VC1_VLC_DATA_H */ diff --git a/include/libavcodec/vc1acdata.h b/include/libavcodec/vc1acdata.h new file mode 100644 index 0000000..a70b44a --- /dev/null +++ b/include/libavcodec/vc1acdata.h @@ -0,0 +1,367 @@ +/* + * VC-1 and WMV3 decoder + * copyright (c) 2006 Konstantin Shishkov + * + * 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_VC1ACDATA_H +#define AVCODEC_VC1ACDATA_H + +#include + +#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, + 3, 3, 3, 3, 3, 3, 2, 2, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1 +}, +{ + 23, 11, 8, 7, 5, 5, 4, 4, 3, 3, + 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1 +}, +{ + 16, 11, 8, 7, 5, 4, 4, 3, 3, 3, + 3, 3, 3, 3, 2, 2, 1, 1, 1, 1, + 1 +}, +{ + 14, 9, 5, 4, 4, 4, 3, 3, 3, 3, + 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1 +}, +{ + 27, 10, 5, 4, 3, 3, 3, 3, 2, 2, + 1, 1, 1, 1, 1 +}, +{ + 12, 6, 4, 3, 3, 3, 3, 2, 2, 2, + 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1 +}, +{ + 56, 20, 10, 7, 6, 5, 4, 3, 3, 3, + 2, 2, 2, 2, 1 +}, +{ + 32, 13, 8, 6, 5, 4, 4, 3, 3, 3, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 1, 1 +} +}; + +static const uint8_t vc1_last_delta_level_table[AC_MODES][44] = { +{ + 6, 5, 4, 4, 3, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1 +}, +{ + 9, 5, 4, 4, 3, 3, 3, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1 +}, +{ + 4, 4, 3, 3, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1 +}, +{ + 5, 4, 3, 3, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1 +}, +{ + 8, 3, 2, 2, 2, 2, 2, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1 +}, +{ + 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1 +}, +{ + 4, 3, 3, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 1 +}, +{ + 4, 3, 3, 3, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, + 1 +} +}; + +static const uint8_t vc1_delta_run_table[AC_MODES][57] = { +{ + -1, 30, 17, 15, 9, 5, 4, 3, 3, 3, + 3, 3, 2, 1, 1, 1, 0, 0, 0, + 0 +}, +{ + -1, 26, 16, 11, 7, 5, 3, 3, 2, 1, + 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0 +}, +{ + -1, 20, 15, 13, 6, 4, 3, 3, 2, 1, + 1, 1, 0, 0, 0, 0, 0 +}, +{ + -1, 29, 15, 12, 5, 2, 1, 1, 1, 1, + 0, 0, 0, 0, 0 +}, +{ + -1, 14, 9, 7, 3, 2, 1, 1, 1, 1, + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 +}, +{ + -1, 26, 10, 6, 2, 1, 1, 0, 0, 0, + 0, 0, 0 +}, +{ + -1, 14, 13, 9, 6, 5, 4, 3, 2, 2, + 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 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 +}, +{ + -1, 24, 22, 9, 6, 4, 3, 2, 2, 1, + 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0 +} +}; + +static const uint8_t vc1_last_delta_run_table[AC_MODES][10] = { +{ + -1, 37, 15, 4, 3, 1, 0 +}, +{ + -1, 36, 14, 6, 3, 1, 0, 0, 0, + 0 +}, +{ + -1, 26, 13, 3, 1 +}, +{ + -1, 43, 15, 3, 1, 0 +}, +{ + -1, 20, 6, 1, 0, 0, 0, 0, 0 +}, +{ + -1, 40, 1, 0 +}, +{ + -1, 16, 14, 2, 0 +}, +{ + -1, 30, 28, 3, 0 +} +}; + +#endif /* AVCODEC_VC1ACDATA_H */ diff --git a/include/libavcodec/vc1data.h b/include/libavcodec/vc1data.h new file mode 100644 index 0000000..e71593d --- /dev/null +++ b/include/libavcodec/vc1data.h @@ -0,0 +1,134 @@ +/* + * VC-1 and WMV3 decoder + * copyright (c) 2006 Konstantin Shishkov + * (c) 2005 anonymous, Alex Beregszaszi, Michael Niedermayer + * + * 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 + */ + +/** + * @file + * VC-1 tables. + */ + +#ifndef AVCODEC_VC1DATA_H +#define AVCODEC_VC1DATA_H + +#include + +#include "libavutil/attributes_internal.h" +#include "libavutil/rational.h" + +#include "vlc.h" + +FF_VISIBILITY_PUSH_HIDDEN +/** 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 */ +extern const uint8_t ff_vc1_mv_pmode_table[2][5]; +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 + */ +//@{ +#define VC1_IMODE_VLC_BITS 4 +extern VLCElem ff_vc1_imode_vlc[1 << VC1_IMODE_VLC_BITS]; +#define VC1_NORM2_VLC_BITS 3 +extern VLCElem ff_vc1_norm2_vlc[1 << VC1_NORM2_VLC_BITS]; +#define VC1_NORM6_VLC_BITS 9 +extern VLCElem ff_vc1_norm6_vlc[556]; +/* Could be optimized, one table only needs 8 bits */ +#define VC1_TTMB_VLC_BITS 9 //12 +extern const VLCElem *ff_vc1_ttmb_vlc[3]; +#define VC1_MV_DIFF_VLC_BITS 9 //15 +extern const VLCElem *ff_vc1_mv_diff_vlc[4]; +#define VC1_CBPCY_P_VLC_BITS 9 //14 +extern const VLCElem *ff_vc1_cbpcy_p_vlc[4]; +#define VC1_ICBPCY_VLC_BITS 9 +extern const VLCElem *ff_vc1_icbpcy_vlc[8]; +#define VC1_4MV_BLOCK_PATTERN_VLC_BITS 6 +extern const VLCElem *ff_vc1_4mv_block_pattern_vlc[4]; +#define VC1_2MV_BLOCK_PATTERN_VLC_BITS 3 +extern const VLCElem *ff_vc1_2mv_block_pattern_vlc[4]; +#define VC1_TTBLK_VLC_BITS 5 +extern const VLCElem *ff_vc1_ttblk_vlc[3]; +#define VC1_SUBBLKPAT_VLC_BITS 6 +extern const VLCElem *ff_vc1_subblkpat_vlc[3]; +#define VC1_INTFR_4MV_MBMODE_VLC_BITS 9 +extern const VLCElem *ff_vc1_intfr_4mv_mbmode_vlc[4]; +#define VC1_INTFR_NON4MV_MBMODE_VLC_BITS 6 +extern const VLCElem *ff_vc1_intfr_non4mv_mbmode_vlc[4]; +#define VC1_IF_MMV_MBMODE_VLC_BITS 5 +extern const VLCElem *ff_vc1_if_mmv_mbmode_vlc[8]; +#define VC1_IF_1MV_MBMODE_VLC_BITS 5 +extern const VLCElem *ff_vc1_if_1mv_mbmode_vlc[8]; +#define VC1_1REF_MVDATA_VLC_BITS 9 +extern const VLCElem *ff_vc1_1ref_mvdata_vlc[4]; +#define VC1_2REF_MVDATA_VLC_BITS 9 +extern const VLCElem *ff_vc1_2ref_mvdata_vlc[8]; + +extern const VLCElem *ff_vc1_ac_coeff_table[8]; + +#define VC1_IF_MBMODE_VLC_BITS 5 // as a placeholder for VC1_IF_MMV_MBMODE_VLC_BITS + // or VC1_IF_1MV_MBMODE_VLC_BITS since they are the same +//@} + +#define B_FRACTION_DEN 256 + +/* pre-computed scales for all bfractions and base=256 */ +extern const int16_t ff_vc1_bfraction_lut[23]; + +//Same as H.264 +extern const AVRational ff_vc1_pixel_aspect[16]; + +extern const uint8_t ff_wmv3_dc_scale_table[32]; + +/* DC differentials low+hi-mo, p217 are the same as in msmpeg4data .h */ + +/* Scantables/ZZ scan are at 11.9 (p262) and 8.1.1.12 (p10) */ +extern const uint8_t ff_vc1_simple_progressive_4x4_zz [16]; +extern const uint8_t ff_vc1_adv_progressive_8x4_zz [32]; +extern const uint8_t ff_vc1_adv_progressive_4x8_zz [32]; +extern const uint8_t ff_vc1_adv_interlaced_8x8_zz [64]; +extern const uint8_t ff_vc1_adv_interlaced_8x4_zz [32]; +extern const uint8_t ff_vc1_adv_interlaced_4x8_zz [32]; +extern const uint8_t ff_vc1_adv_interlaced_4x4_zz [16]; + +/* DQScale as specified in 8.1.3.9 - almost identical to 0x40000/i */ +extern const int32_t ff_vc1_dqscale[63]; + +/* P Interlaced field picture MV predictor scaling values (Table 114) */ +extern const uint16_t ff_vc1_field_mvpred_scales[2][7][4]; +/* B Interlaced field picture backward MV predictor scaling values for first field (Table 115) */ +extern const uint16_t ff_vc1_b_field_mvpred_scales[7][4]; + +#define AC_MODES 8 + +extern const int ff_vc1_ac_sizes[AC_MODES]; +FF_VISIBILITY_POP_HIDDEN + +#endif /* AVCODEC_VC1DATA_H */ diff --git a/include/libavcodec/vc1dsp.h b/include/libavcodec/vc1dsp.h new file mode 100644 index 0000000..e3b90d2 --- /dev/null +++ b/include/libavcodec/vc1dsp.h @@ -0,0 +1,97 @@ +/* + * VC-1 and WMV3 decoder - DSP functions + * Copyright (c) 2006 Konstantin Shishkov + * + * 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 + */ + +/** + * @file + * VC-1 and WMV3 decoder + */ + +#ifndef AVCODEC_VC1DSP_H +#define AVCODEC_VC1DSP_H + +#include "hpeldsp.h" +#include "h264chroma.h" + +typedef void (*vc1op_pixels_func)(uint8_t *block/*align width (8 or 16)*/, const uint8_t *pixels/*align 1*/, ptrdiff_t line_size, int h); + +typedef struct VC1DSPContext { + /* vc1 functions */ + void (*vc1_inv_trans_8x8)(int16_t *b); + void (*vc1_inv_trans_8x4)(uint8_t *dest, ptrdiff_t stride, int16_t *block); + void (*vc1_inv_trans_4x8)(uint8_t *dest, ptrdiff_t stride, int16_t *block); + void (*vc1_inv_trans_4x4)(uint8_t *dest, ptrdiff_t stride, int16_t *block); + void (*vc1_inv_trans_8x8_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block); + void (*vc1_inv_trans_8x4_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block); + void (*vc1_inv_trans_4x8_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block); + void (*vc1_inv_trans_4x4_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block); + void (*vc1_v_overlap)(uint8_t *src, ptrdiff_t stride); + void (*vc1_h_overlap)(uint8_t *src, ptrdiff_t stride); + void (*vc1_v_s_overlap)(int16_t *top, int16_t *bottom); + void (*vc1_h_s_overlap)(int16_t *left, int16_t *right, ptrdiff_t left_stride, ptrdiff_t right_stride, int flags); + void (*vc1_v_loop_filter4)(uint8_t *src, ptrdiff_t stride, int pq); + void (*vc1_h_loop_filter4)(uint8_t *src, ptrdiff_t stride, int pq); + void (*vc1_v_loop_filter8)(uint8_t *src, ptrdiff_t stride, int pq); + void (*vc1_h_loop_filter8)(uint8_t *src, ptrdiff_t stride, int pq); + void (*vc1_v_loop_filter16)(uint8_t *src, ptrdiff_t stride, int pq); + void (*vc1_h_loop_filter16)(uint8_t *src, ptrdiff_t stride, int pq); + + /* put 8x8 block with bicubic interpolation and quarterpel precision + * last argument is actually round value instead of height + */ + vc1op_pixels_func put_vc1_mspel_pixels_tab[2][16]; + vc1op_pixels_func avg_vc1_mspel_pixels_tab[2][16]; + + /* This is really one func used in VC-1 decoding */ + h264_chroma_mc_func put_no_rnd_vc1_chroma_pixels_tab[3]; + h264_chroma_mc_func avg_no_rnd_vc1_chroma_pixels_tab[3]; + + /* Windows Media Image functions */ + void (*sprite_h)(uint8_t *dst, const uint8_t *src, int offset, int advance, int count); + void (*sprite_v_single)(uint8_t *dst, const uint8_t *src1a, const uint8_t *src1b, int offset, int width); + void (*sprite_v_double_noscale)(uint8_t *dst, const uint8_t *src1a, const uint8_t *src2a, int alpha, int width); + void (*sprite_v_double_onescale)(uint8_t *dst, const uint8_t *src1a, const uint8_t *src1b, int offset1, + const uint8_t *src2a, int alpha, int width); + void (*sprite_v_double_twoscale)(uint8_t *dst, const uint8_t *src1a, const uint8_t *src1b, int offset1, + const uint8_t *src2a, const uint8_t *src2b, int offset2, + int alpha, int width); + + /** + * Search buf from the start for up to size bytes. Return the index + * of a zero byte, or >= size if not found. Ideally, use lookahead + * to filter out any zero bytes that are known to not be followed by + * one or more further zero bytes and a one byte. + */ + int (*startcode_find_candidate)(const uint8_t *buf, int size); + + /* Copy a buffer, removing startcode emulation escape bytes as we go */ + int (*vc1_unescape_buffer)(const uint8_t *src, int size, uint8_t *dst); +} VC1DSPContext; + +void ff_vc1dsp_init(VC1DSPContext* c); +void ff_vc1dsp_init_aarch64(VC1DSPContext* dsp); +void ff_vc1dsp_init_arm(VC1DSPContext* dsp); +void ff_vc1dsp_init_ppc(VC1DSPContext *c); +void ff_vc1dsp_init_riscv(VC1DSPContext *c); +void ff_vc1dsp_init_x86(VC1DSPContext* dsp); +void ff_vc1dsp_init_mips(VC1DSPContext* dsp); +void ff_vc1dsp_init_loongarch(VC1DSPContext* dsp); + +#endif /* AVCODEC_VC1DSP_H */ diff --git a/include/libavcodec/vc2enc_dwt.h b/include/libavcodec/vc2enc_dwt.h new file mode 100644 index 0000000..a6932bc --- /dev/null +++ b/include/libavcodec/vc2enc_dwt.h @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2016 Open Broadcast Systems Ltd. + * Author 2016 Rostislav Pehlivanov + * + * 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_VC2ENC_DWT_H +#define AVCODEC_VC2ENC_DWT_H + +#include +#include + +typedef int32_t dwtcoef; + +enum VC2TransformType { + VC2_TRANSFORM_9_7 = 0, /* Deslauriers-Dubuc (9,7) */ + VC2_TRANSFORM_5_3 = 1, /* LeGall (5,3) */ + VC2_TRANSFORM_13_7 = 2, /* Deslauriers-Dubuc (13,7) */ + VC2_TRANSFORM_HAAR = 3, /* Haar without shift */ + VC2_TRANSFORM_HAAR_S = 4, /* Haar with 1 shift/lvl */ + VC2_TRANSFORM_FIDEL = 5, /* Fidelity filter */ + VC2_TRANSFORM_9_7_I = 6, /* Daubechies (9,7) */ + + VC2_TRANSFORMS_NB +}; + +typedef struct VC2TransformContext { + dwtcoef *buffer; + int padding; + void (*vc2_subband_dwt[VC2_TRANSFORMS_NB])(struct VC2TransformContext *t, + dwtcoef *data, ptrdiff_t stride, + int width, int height); +} VC2TransformContext; + +int ff_vc2enc_init_transforms(VC2TransformContext *t, int p_stride, int p_height, + int slice_w, int slice_h); +void ff_vc2enc_free_transforms(VC2TransformContext *t); + +#endif /* AVCODEC_VC2ENC_DWT_H */ diff --git a/include/libavcodec/vdpau.h b/include/libavcodec/vdpau.h index 3010094..8021c25 100755 --- a/include/libavcodec/vdpau.h +++ b/include/libavcodec/vdpau.h @@ -66,16 +66,14 @@ typedef int (*AVVDPAU_Render2)(struct AVCodecContext *, struct AVFrame *, /** * This structure is used to share data between the libavcodec library and * the client video application. - * The user shall allocate the structure via the av_alloc_vdpau_hwaccel - * function and make it available as - * AVCodecContext.hwaccel_context. Members can be set by the user once + * This structure will be allocated and stored in AVCodecContext.hwaccel_context + * by av_vdpau_bind_context(). Members can be set by the user once * during initialization or through each AVCodecContext.get_buffer() * function call. In any case, they must be valid prior to calling * decoding functions. * * The size of this structure is not a part of the public ABI and must not - * be used outside of libavcodec. Use av_vdpau_alloc_context() to allocate an - * AVVDPAUContext. + * be used outside of libavcodec. */ typedef struct AVVDPAUContext { /** @@ -95,15 +93,27 @@ typedef struct AVVDPAUContext { AVVDPAU_Render2 render2; } AVVDPAUContext; +#if FF_API_VDPAU_ALLOC_GET_SET /** * @brief allocation function for AVVDPAUContext * * Allows extending the struct without breaking API/ABI + * @deprecated use av_vdpau_bind_context() instead */ +attribute_deprecated AVVDPAUContext *av_alloc_vdpaucontext(void); +/** + * @deprecated render2 is public and can be accessed directly + */ +attribute_deprecated AVVDPAU_Render2 av_vdpau_hwaccel_get_render2(const AVVDPAUContext *); +/** + * @deprecated render2 is public and can be accessed directly + */ +attribute_deprecated void av_vdpau_hwaccel_set_render2(AVVDPAUContext *, AVVDPAU_Render2); +#endif /** * Associate a VDPAU device with a codec context for hardware acceleration. @@ -145,13 +155,17 @@ int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device, int av_vdpau_get_surface_parameters(AVCodecContext *avctx, VdpChromaType *type, uint32_t *width, uint32_t *height); +#if FF_API_VDPAU_ALLOC_GET_SET /** * Allocate an AVVDPAUContext. * * @return Newly-allocated AVVDPAUContext or NULL on failure. + * @deprecated use av_vdpau_bind_context() instead */ +attribute_deprecated AVVDPAUContext *av_vdpau_alloc_context(void); +#endif -/* @}*/ +/** @} */ #endif /* AVCODEC_VDPAU_H */ diff --git a/include/libavcodec/vdpau_internal.h b/include/libavcodec/vdpau_internal.h new file mode 100644 index 0000000..347576e --- /dev/null +++ b/include/libavcodec/vdpau_internal.h @@ -0,0 +1,134 @@ +/* + * Video Decode and Presentation API for UNIX (VDPAU) is used for + * HW decode acceleration for MPEG-1/2, H.264 and VC-1. + * + * Copyright (C) 2008 NVIDIA + * + * 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_VDPAU_INTERNAL_H +#define AVCODEC_VDPAU_INTERNAL_H + +#include +#include + +#include "libavutil/frame.h" +#include "libavutil/hwcontext.h" +#include "libavutil/hwcontext_vdpau.h" + +#include "avcodec.h" +#include "vdpau.h" + +/** Extract VdpVideoSurface from an AVFrame */ +static inline uintptr_t ff_vdpau_get_surface_id(AVFrame *pic) +{ + return (uintptr_t)pic->data[3]; +} + +union VDPAUPictureInfo { + VdpPictureInfoH264 h264; + VdpPictureInfoMPEG1Or2 mpeg; + VdpPictureInfoVC1 vc1; + VdpPictureInfoMPEG4Part2 mpeg4; +#ifdef VDP_DECODER_PROFILE_H264_HIGH_444_PREDICTIVE + VdpPictureInfoH264Predictive h264_predictive; +#endif +#ifdef VDP_DECODER_PROFILE_HEVC_MAIN + VdpPictureInfoHEVC hevc; +#endif +#ifdef VDP_YCBCR_FORMAT_Y_U_V_444 + VdpPictureInfoHEVC444 hevc_444; +#endif +#ifdef VDP_DECODER_PROFILE_VP9_PROFILE_0 + VdpPictureInfoVP9 vp9; +#endif +#ifdef VDP_DECODER_PROFILE_AV1_MAIN + VdpPictureInfoAV1 av1; +#endif +}; + +typedef struct VDPAUHWContext { + AVVDPAUContext context; + VdpDevice device; + VdpGetProcAddress *get_proc_address; + char reset; + unsigned char flags; +} VDPAUHWContext; + +typedef struct VDPAUContext { + /** + * VDPAU device handle + */ + VdpDevice device; + + /** + * VDPAU decoder handle + */ + VdpDecoder decoder; + + /** + * VDPAU device driver + */ + VdpGetProcAddress *get_proc_address; + + /** + * VDPAU decoder render callback + */ + VdpDecoderRender *render; + + uint32_t width; + uint32_t height; +} VDPAUContext; + +struct vdpau_picture_context { + /** + * VDPAU picture information. + */ + union VDPAUPictureInfo info; + + /** + * Allocated size of the bitstream_buffers table. + */ + int bitstream_buffers_allocated; + + /** + * Useful bitstream buffers in the bitstream buffers table. + */ + int bitstream_buffers_used; + + /** + * Table of bitstream buffers. + */ + VdpBitstreamBuffer *bitstream_buffers; +}; + +int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile, + int level); +int ff_vdpau_common_uninit(AVCodecContext *avctx); + +int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic, + const uint8_t *buffer, uint32_t size); +int ff_vdpau_common_end_frame(AVCodecContext *avctx, AVFrame *frame, + struct vdpau_picture_context *pic); +int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx); +int ff_vdpau_add_buffer(struct vdpau_picture_context *pic, const uint8_t *buf, + uint32_t buf_size); +int ff_vdpau_common_frame_params(AVCodecContext *avctx, + AVBufferRef *hw_frames_ctx); + +#endif /* AVCODEC_VDPAU_INTERNAL_H */ diff --git a/include/libavcodec/version.h b/include/libavcodec/version.h index 376388c..b6ca025 100755 --- a/include/libavcodec/version.h +++ b/include/libavcodec/version.h @@ -29,8 +29,8 @@ #include "version_major.h" -#define LIBAVCODEC_VERSION_MINOR 37 -#define LIBAVCODEC_VERSION_MICRO 100 +#define LIBAVCODEC_VERSION_MINOR 19 +#define LIBAVCODEC_VERSION_MICRO 101 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ diff --git a/include/libavcodec/version_major.h b/include/libavcodec/version_major.h index 1e23ed5..63df40e 100644 --- a/include/libavcodec/version_major.h +++ b/include/libavcodec/version_major.h @@ -25,7 +25,7 @@ * Libavcodec version macros. */ -#define LIBAVCODEC_VERSION_MAJOR 59 +#define LIBAVCODEC_VERSION_MAJOR 61 /** * FF_API_* defines may be placed below to indicate public API that will be @@ -37,18 +37,16 @@ * at once through the bump. This improves the git bisect-ability of the change. */ -#define FF_API_OPENH264_SLICE_MODE (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_OPENH264_CABAC (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_UNUSED_CODEC_CAPS (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_THREAD_SAFE_CALLBACKS (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_DEBUG_MV (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_GET_FRAME_CLASS (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_AUTO_THREADS (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_AVCTX_TIMEBASE (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_FLAG_TRUNCATED (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_SUB_TEXT_FORMAT (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_IDCT_NONE (LIBAVCODEC_VERSION_MAJOR < 60) -#define FF_API_SVTAV1_OPTS (LIBAVCODEC_VERSION_MAJOR < 60) +#define FF_API_INIT_PACKET (LIBAVCODEC_VERSION_MAJOR < 62) +#define FF_API_SUBFRAMES (LIBAVCODEC_VERSION_MAJOR < 62) +#define FF_API_TICKS_PER_FRAME (LIBAVCODEC_VERSION_MAJOR < 62) +#define FF_API_DROPCHANGED (LIBAVCODEC_VERSION_MAJOR < 62) + +#define FF_API_AVFFT (LIBAVCODEC_VERSION_MAJOR < 62) +#define FF_API_FF_PROFILE_LEVEL (LIBAVCODEC_VERSION_MAJOR < 62) +#define FF_API_AVCODEC_CLOSE (LIBAVCODEC_VERSION_MAJOR < 62) +#define FF_API_BUFFER_MIN_SIZE (LIBAVCODEC_VERSION_MAJOR < 62) +#define FF_API_VDPAU_ALLOC_GET_SET (LIBAVCODEC_VERSION_MAJOR < 62) +#define FF_API_QUALITY_FACTOR (LIBAVCODEC_VERSION_MAJOR < 62) #endif /* AVCODEC_VERSION_MAJOR_H */ diff --git a/include/libavcodec/videodsp.h b/include/libavcodec/videodsp.h new file mode 100644 index 0000000..1be3188 --- /dev/null +++ b/include/libavcodec/videodsp.h @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2012 Ronald S. Bultje + * + * 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 + */ + +/** + * @file + * Core video DSP helper functions + */ + +#ifndef AVCODEC_VIDEODSP_H +#define AVCODEC_VIDEODSP_H + +#include +#include + +#define EMULATED_EDGE(depth) \ +void ff_emulated_edge_mc_ ## depth(uint8_t *dst, const uint8_t *src, \ + ptrdiff_t dst_stride, ptrdiff_t src_stride, \ + int block_w, int block_h,\ + int src_x, int src_y, int w, int h); + +EMULATED_EDGE(8) + +typedef struct VideoDSPContext { + /** + * Copy a rectangular area of samples to a temporary buffer and replicate + * the border samples. + * + * @param dst destination buffer + * @param dst_stride number of bytes between 2 vertically adjacent samples + * in destination buffer + * @param src source buffer + * @param dst_linesize number of bytes between 2 vertically adjacent + * samples in the destination buffer + * @param src_linesize number of bytes between 2 vertically adjacent + * samples in both the source buffer + * @param block_w width of block + * @param block_h height of block + * @param src_x x coordinate of the top left sample of the block in the + * source buffer + * @param src_y y coordinate of the top left sample of the block in the + * source buffer + * @param w width of the source buffer + * @param h height of the source buffer + */ + void (*emulated_edge_mc)(uint8_t *dst, const uint8_t *src, + ptrdiff_t dst_linesize, + ptrdiff_t src_linesize, + int block_w, int block_h, + int src_x, int src_y, int w, int h); + + /** + * Prefetch memory into cache (if supported by hardware). + * + * @param buf pointer to buffer to prefetch memory from + * @param stride distance between two lines of buf (in bytes) + * @param h number of lines to prefetch + */ + void (*prefetch)(const uint8_t *buf, ptrdiff_t stride, int h); +} VideoDSPContext; + +void ff_videodsp_init(VideoDSPContext *ctx, int bpc); + +/* for internal use only (i.e. called by ff_videodsp_init() */ +void ff_videodsp_init_aarch64(VideoDSPContext *ctx, int bpc); +void ff_videodsp_init_arm(VideoDSPContext *ctx, int bpc); +void ff_videodsp_init_ppc(VideoDSPContext *ctx, int bpc); +void ff_videodsp_init_riscv(VideoDSPContext *ctx, int bpc); +void ff_videodsp_init_x86(VideoDSPContext *ctx, int bpc); +void ff_videodsp_init_mips(VideoDSPContext *ctx, int bpc); +void ff_videodsp_init_loongarch(VideoDSPContext *ctx, int bpc); + +#endif /* AVCODEC_VIDEODSP_H */ diff --git a/include/libavcodec/videotoolbox.h b/include/libavcodec/videotoolbox.h index af2db0d..d68d76e 100755 --- a/include/libavcodec/videotoolbox.h +++ b/include/libavcodec/videotoolbox.h @@ -29,6 +29,15 @@ * Public libavcodec Videotoolbox header. */ +/** + * @defgroup lavc_codec_hwaccel_videotoolbox VideoToolbox Decoder + * @ingroup lavc_codec_hwaccel + * + * Hardware accelerated decoding using VideoToolbox on Apple Platforms + * + * @{ + */ + #include #define Picture QuickdrawPicture @@ -37,6 +46,8 @@ #include "libavcodec/avcodec.h" +#include "libavutil/attributes.h" + /** * This struct holds all the information that needs to be passed * between the caller and libavcodec for initializing Videotoolbox decoding. @@ -46,16 +57,9 @@ typedef struct AVVideotoolboxContext { /** * Videotoolbox decompression session object. - * Created and freed the caller. */ VTDecompressionSessionRef session; - /** - * The output callback that must be passed to the session. - * Set by av_videottoolbox_default_init() - */ - VTDecompressionOutputCallback output_callback; - /** * CVPixelBuffer Format Type that Videotoolbox will use for decoded frames. * set by the caller. If this is set to 0, then no specific format is @@ -65,61 +69,15 @@ typedef struct AVVideotoolboxContext { /** * CoreMedia Format Description that Videotoolbox will use to create the decompression session. - * Set by the caller. */ CMVideoFormatDescriptionRef cm_fmt_desc; /** * CoreMedia codec type that Videotoolbox will use to create the decompression session. - * Set by the caller. */ int cm_codec_type; } AVVideotoolboxContext; -/** - * Allocate and initialize a Videotoolbox context. - * - * This function should be called from the get_format() callback when the caller - * selects the AV_PIX_FMT_VIDETOOLBOX format. The caller must then create - * the decoder object (using the output callback provided by libavcodec) that - * will be used for Videotoolbox-accelerated decoding. - * - * When decoding with Videotoolbox is finished, the caller must destroy the decoder - * object and free the Videotoolbox context using av_free(). - * - * @return the newly allocated context or NULL on failure - */ -AVVideotoolboxContext *av_videotoolbox_alloc_context(void); - -/** - * This is a convenience function that creates and sets up the Videotoolbox context using - * an internal implementation. - * - * @param avctx the corresponding codec context - * - * @return >= 0 on success, a negative AVERROR code on failure - */ -int av_videotoolbox_default_init(AVCodecContext *avctx); - -/** - * This is a convenience function that creates and sets up the Videotoolbox context using - * an internal implementation. - * - * @param avctx the corresponding codec context - * @param vtctx the Videotoolbox context to use - * - * @return >= 0 on success, a negative AVERROR code on failure - */ -int av_videotoolbox_default_init2(AVCodecContext *avctx, AVVideotoolboxContext *vtctx); - -/** - * This function must be called to free the Videotoolbox context initialized with - * av_videotoolbox_default_init(). - * - * @param avctx the corresponding codec context - */ -void av_videotoolbox_default_free(AVCodecContext *avctx); - /** * @} */ diff --git a/include/libavcodec/vlc.h b/include/libavcodec/vlc.h new file mode 100644 index 0000000..bf7b0e6 --- /dev/null +++ b/include/libavcodec/vlc.h @@ -0,0 +1,290 @@ +/* + * 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_VLC_H +#define AVCODEC_VLC_H + +#include +#include + +#include "libavutil/macros.h" + +#define VLC_MULTI_MAX_SYMBOLS 6 + +// When changing this, be sure to also update tableprint_vlc.h accordingly. +typedef int16_t VLCBaseType; + +typedef struct VLCElem { + VLCBaseType sym, len; +} VLCElem; + +typedef struct VLC { + int bits; + VLCElem *table; + int table_size, table_allocated; +} VLC; + +typedef struct VLC_MULTI_ELEM { + union { + uint8_t val8[VLC_MULTI_MAX_SYMBOLS]; + uint16_t val16[VLC_MULTI_MAX_SYMBOLS / 2]; + }; + int8_t len; // -31,32 + uint8_t num; +} VLC_MULTI_ELEM; + +typedef struct VLC_MULTI { + VLC_MULTI_ELEM *table; + int table_size, table_allocated; +} VLC_MULTI; + +typedef struct RL_VLC_ELEM { + int16_t level; + int8_t len; + uint8_t run; +} RL_VLC_ELEM; + +#define vlc_init(vlc, nb_bits, nb_codes, \ + bits, bits_wrap, bits_size, \ + codes, codes_wrap, codes_size, \ + flags) \ + ff_vlc_init_sparse(vlc, nb_bits, nb_codes, \ + bits, bits_wrap, bits_size, \ + codes, codes_wrap, codes_size, \ + NULL, 0, 0, flags) + +/** + * Build VLC decoding tables suitable for use with get_vlc2(). + * + * @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. + * Corresponds to the `bits` parameter of get_vlc2(). + * @param[in] nb_codes The number of provided bits, codes and (if supplied) + * symbol entries. + * @param[in] bits The lengths (in bits) of the codes. Entries > 0 + * correspond to valid codes; entries == 0 will be skipped. + * @param[in] bits_wrap Stride (in bytes) of the bits table. + * @param[in] codes_size Size of the bits. 1, 2 and 4 are supported. + * @param[in] codes Table which gives the bit pattern of of each vlc code. + * @param[in] codes_wrap Stride (in bytes) of the codes table. + * @param[in] codes_size Size of the codes. 1, 2 and 4 are supported. + * @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 table. + * @param[in] symbols_size Size of the symbols. 1 and 2 are supported. + * @param[in] flags A combination of the VLC_INIT_* flags. + * + * 'wrap' and 'size' make it possible to use any memory configuration and types + * (byte/word/int) to store the 'bits', 'codes', and 'symbols' tables. + */ +int ff_vlc_init_sparse(VLC *vlc, int nb_bits, int nb_codes, + const void *bits, int bits_wrap, int bits_size, + 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 VLC_INIT_* flags; notice that + * VLC_INIT_INPUT_LE is pointless and ignored. + */ +int ff_vlc_init_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); + +/** + * Build VLC decoding tables suitable for use with get_vlc_multi() + * + * 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,out] multi The VLC_MULTI 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_elems The max possible number of elements. + * @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 VLC_INIT_* flags; notice that + * VLC_INIT_INPUT_LE is pointless and ignored. + */ +int ff_vlc_init_multi_from_lengths(VLC *vlc, VLC_MULTI *multi, int nb_bits, int nb_elems, + 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_vlc_free_multi(VLC_MULTI *vlc); +void ff_vlc_free(VLC *vlc); + +#define VLC_INIT_USE_STATIC 1 +#define VLC_INIT_STATIC_OVERLONG (2 | VLC_INIT_USE_STATIC) +/* If VLC_INIT_INPUT_LE is set, the LSB bit of the codes used to + * initialize the VLC table is the first bit to be read. */ +#define VLC_INIT_INPUT_LE 4 +/* If set the VLC is intended for a little endian bitstream reader. */ +#define VLC_INIT_OUTPUT_LE 8 +#define VLC_INIT_LE (VLC_INIT_INPUT_LE | VLC_INIT_OUTPUT_LE) + +/** + * For static VLCs, the number of bits can often be hardcoded + * at each get_vlc2() callsite. Then using a full VLC would be uneconomical, + * because only VLC.table would ever be accessed after initialization. + * The following functions provide wrappers around the relevant ff_vlc_init_* + * functions suitable for said task. + * + * The ff_vlc_init_tables_* functions are intended to be used for initializing + * a series of VLCs. The user initializes a VLCInitState with the details + * about the underlying array of VLCElem; it is automatically updated by + * the ff_vlc_init_tables_* functions (i.e. table is incremented and size + * decremented by the number of elements of the current table). + * The VLC_INIT_STATIC_OVERLONG flag is also automatically added. + * These functions return a pointer to the table just initialized, + * potentially to be used in arrays of pointer to VLC tables. + * + * The ff_vlc_init_table_* functions are intended to be used for initializing + * a single VLC table, given by table and table_size. The VLC_INIT_USE_STATIC + * flag is automatically added. + */ + +typedef struct VLCInitState { + VLCElem *table; ///< points to where the next VLC table will be placed + unsigned size; ///< remaining number of elements in table +} VLCInitState; + +#define VLC_INIT_STATE(_table) { .table = (_table), .size = FF_ARRAY_ELEMS(_table) } + +void ff_vlc_init_table_from_lengths(VLCElem table[], int table_size, + 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); + +const VLCElem *ff_vlc_init_tables_from_lengths(VLCInitState *state, + 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 ff_vlc_init_table_sparse(VLCElem table[], int table_size, + int nb_bits, int nb_codes, + const void *bits, int bits_wrap, int bits_size, + const void *codes, int codes_wrap, int codes_size, + const void *symbols, int symbols_wrap, int symbols_size, + int flags); + +const VLCElem *ff_vlc_init_tables_sparse(VLCInitState *state, + int nb_bits, int nb_codes, + const void *bits, int bits_wrap, int bits_size, + const void *codes, int codes_wrap, int codes_size, + const void *symbols, int symbols_wrap, int symbols_size, + int flags); + +static inline +const VLCElem *ff_vlc_init_tables(VLCInitState *state, + int nb_bits, int nb_codes, + const void *bits, int bits_wrap, int bits_size, + const void *codes, int codes_wrap, int codes_size, + int flags) +{ + return ff_vlc_init_tables_sparse(state, nb_bits, nb_codes, + bits, bits_wrap, bits_size, + codes, codes_wrap, codes_size, + NULL, 0, 0, flags); +} + +#define VLC_INIT_STATIC_SPARSE_TABLE(vlc_table, nb_bits, nb_codes, \ + bits, bits_wrap, bits_size, \ + codes, codes_wrap, codes_size, \ + symbols, symbols_wrap, symbols_size, \ + flags) \ + ff_vlc_init_table_sparse(vlc_table, FF_ARRAY_ELEMS(vlc_table), \ + (nb_bits), (nb_codes), \ + (bits), (bits_wrap), (bits_size), \ + (codes), (codes_wrap), (codes_size), \ + (symbols), (symbols_wrap), (symbols_size), \ + (flags)) + +#define VLC_INIT_STATIC_TABLE(vlc_table, nb_bits, nb_codes, \ + bits, bits_wrap, bits_size, \ + codes, codes_wrap, codes_size, \ + flags) \ + ff_vlc_init_table_sparse(vlc_table, FF_ARRAY_ELEMS(vlc_table), \ + (nb_bits), (nb_codes), \ + (bits), (bits_wrap), (bits_size), \ + (codes), (codes_wrap), (codes_size), \ + NULL, 0, 0, (flags)) + +#define VLC_INIT_STATIC_TABLE_FROM_LENGTHS(vlc_table, nb_bits, nb_codes, \ + lens, lens_wrap, \ + syms, syms_wrap, syms_size, \ + offset, flags) \ + ff_vlc_init_table_from_lengths(vlc_table, FF_ARRAY_ELEMS(vlc_table), \ + (nb_bits), (nb_codes), \ + (lens), (lens_wrap), \ + (syms), (syms_wrap), (syms_size), \ + (offset), (flags)) + +#endif /* AVCODEC_VLC_H */ diff --git a/include/libavcodec/vorbis.h b/include/libavcodec/vorbis.h new file mode 100644 index 0000000..7190465 --- /dev/null +++ b/include/libavcodec/vorbis.h @@ -0,0 +1,43 @@ +/* + * copyright (c) 2006 Oded Shimon + * + * 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_VORBIS_H +#define AVCODEC_VORBIS_H + +#include + +typedef struct vorbis_floor1_entry { + uint16_t x; + uint16_t sort; + uint16_t low; + uint16_t high; +} vorbis_floor1_entry; + +int ff_vorbis_ready_floor1_list(void *logctx, + vorbis_floor1_entry *list, int values); +unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n); // x^(1/n) +int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num); +void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values, + uint16_t *y_list, int *flag, + int multiplier, float * out, int samples); + +#define ilog(i) av_log2(2*(i)) + +#endif /* AVCODEC_VORBIS_H */ diff --git a/include/libavcodec/vorbis_data.h b/include/libavcodec/vorbis_data.h new file mode 100644 index 0000000..327e5ab --- /dev/null +++ b/include/libavcodec/vorbis_data.h @@ -0,0 +1,34 @@ +/* + * 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_VORBIS_DATA_H +#define AVCODEC_VORBIS_DATA_H + +#include + +#include "libavutil/attributes_internal.h" +#include "libavutil/channel_layout.h" + +FF_VISIBILITY_PUSH_HIDDEN +extern const float ff_vorbis_floor1_inverse_db_table[256]; +extern const float * const ff_vorbis_vwin[8]; +extern const uint8_t ff_vorbis_channel_layout_offsets[8][8]; +extern const AVChannelLayout ff_vorbis_ch_layouts[9]; +FF_VISIBILITY_POP_HIDDEN + +#endif /* AVCODEC_VORBIS_DATA_H */ diff --git a/include/libavcodec/vorbis_enc_data.h b/include/libavcodec/vorbis_enc_data.h new file mode 100644 index 0000000..eab8adb --- /dev/null +++ b/include/libavcodec/vorbis_enc_data.h @@ -0,0 +1,476 @@ +/* + * copyright (c) 2006 Oded Shimon + * + * 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_VORBIS_ENC_DATA_H +#define AVCODEC_VORBIS_ENC_DATA_H + +#include + +static const uint8_t codebooks[] = { + /* Codebook 0 - 16 elements */ + 2, 10, 8, 14, 7, 12, 11, 14, 1, 5, 3, 7, 4, 9, 7, 13, + /* Codebook 1 - 8 elements */ + 1, 4, 2, 6, 3, 7, 5, 7, + /* Codebook 2 - 256 elements */ + 1, 5, 7, 21, 5, 8, 9, 21, 10, 9, 12, 20, 20, 16, 20, + 20, 4, 8, 9, 20, 6, 8, 9, 20, 11, 11, 13, 20, 20, 15, + 17, 20, 9, 11, 14, 20, 8, 10, 15, 20, 11, 13, 15, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 13, 20, 20, 20, 18, 18, 20, 20, + 20, 20, 20, 20, 3, 6, 8, 20, 6, 7, 9, 20, 10, 9, 12, + 20, 20, 20, 20, 20, 5, 7, 9, 20, 6, 6, 9, 20, 10, 9, + 12, 20, 20, 20, 20, 20, 8, 10, 13, 20, 8, 9, 12, 20, 11, + 10, 12, 20, 20, 20, 20, 20, 18, 20, 20, 20, 15, 17, 18, 20, + 18, 17, 18, 20, 20, 20, 20, 20, 7, 10, 12, 20, 8, 9, 11, + 20, 14, 13, 14, 20, 20, 20, 20, 20, 6, 9, 12, 20, 7, 8, + 11, 20, 12, 11, 13, 20, 20, 20, 20, 20, 9, 11, 15, 20, 8, + 10, 14, 20, 12, 11, 14, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 11, 16, 18, + 20, 15, 15, 17, 20, 20, 17, 20, 20, 20, 20, 20, 20, 9, 14, + 16, 20, 12, 12, 15, 20, 17, 15, 18, 20, 20, 20, 20, 20, 16, + 19, 18, 20, 15, 16, 20, 20, 17, 17, 20, 20, 20, 20, 20, 20, + 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, + 20, + /* Codebook 3 - 64 elements */ + 2, 3, 7, 13, 4, 4, 7, 15, 8, 6, 9, 17, 21, 16, 15, + 21, 2, 5, 7, 11, 5, 5, 7, 14, 9, 7, 10, 16, 17, 15, + 16, 21, 4, 7, 10, 17, 7, 7, 9, 15, 11, 9, 11, 16, 21, + 18, 15, 21, 18, 21, 21, 21, 15, 17, 17, 19, 21, 19, 18, 20, + 21, 21, 21, 20, + /* Codebook 4 - 128 elements */ + 5, 5, 5, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, 5, 6, + 5, 6, 5, 6, 5, 6, 5, 6, 5, 7, 5, 7, 5, 7, 5, + 7, 5, 8, 6, 8, 6, 8, 6, 9, 6, 9, 6, 10, 6, 10, + 6, 11, 6, 11, 7, 11, 7, 12, 7, 12, 7, 12, 7, 12, 7, + 12, 7, 12, 7, 12, 7, 12, 8, 13, 8, 12, 8, 12, 8, 13, + 8, 13, 9, 13, 9, 13, 9, 13, 9, 12, 10, 12, 10, 13, 10, + 14, 11, 14, 12, 14, 13, 14, 13, 14, 14, 15, 16, 15, 15, 15, + 14, 15, 17, 21, 22, 22, 21, 22, 22, 22, 22, 22, 22, 21, 21, + 21, 21, 21, 21, 21, 21, 21, 21, + /* Codebook 5 - 32 elements */ + 2, 5, 5, 4, 5, 4, 5, 4, 5, 4, 6, 5, 6, 5, 6, + 5, 6, 5, 7, 5, 7, 6, 8, 6, 8, 6, 8, 6, 9, 6, + 9, 6, + /* Codebook 6 - 96 elements */ + 8, 5, 8, 4, 9, 4, 9, 4, 9, 4, 9, 4, 9, 4, 9, + 4, 9, 4, 9, 4, 9, 4, 8, 4, 8, 4, 9, 5, 9, 5, + 9, 5, 9, 5, 9, 6, 10, 6, 10, 7, 10, 8, 11, 9, 11, + 11, 12, 13, 12, 14, 13, 15, 13, 15, 14, 16, 14, 17, 15, 17, + 15, 15, 16, 16, 15, 16, 16, 16, 15, 18, 16, 15, 17, 17, 19, + 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, + /* Codebook 7 - 32 elements */ + 1, 5, 5, 5, 5, 5, 5, 5, 6, 5, 6, 5, 6, 5, 6, + 5, 6, 6, 7, 7, 7, 7, 8, 7, 8, 8, 9, 8, 10, 9, + 10, 9, + /* Codebook 8 - 96 elements */ + 4, 3, 4, 3, 4, 4, 5, 4, 5, 4, 5, 5, 6, 5, 6, + 5, 7, 5, 7, 6, 7, 6, 8, 7, 8, 7, 8, 7, 9, 8, + 9, 9, 9, 9, 10, 10, 10, 11, 9, 12, 9, 12, 9, 15, 10, + 14, 9, 13, 10, 13, 10, 12, 10, 12, 10, 13, 10, 12, 11, 13, + 11, 14, 12, 13, 13, 14, 14, 13, 14, 15, 14, 16, 13, 13, 14, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 15, 15, + /* Codebook 9 - 17 elements */ + 4, 5, 4, 5, 3, 5, 3, 5, 3, 5, 4, 4, 4, 4, 5, + 5, 5, + /* Codebook 10 - 32 elements */ + 3, 3, 4, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 5, + 7, 5, 8, 6, 8, 6, 9, 7, 10, 7, 10, 8, 10, 8, 11, + 9, 11, + /* Codebook 11 - 78 elements */ + 3, 7, 3, 8, 3, 10, 3, 8, 3, 9, 3, 8, 4, 9, 4, + 9, 5, 9, 6, 10, 6, 9, 7, 11, 7, 12, 9, 13, 10, 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, + /* Codebook 12 - 17 elements */ + 4, 5, 4, 5, 4, 5, 4, 5, 3, 5, 3, 5, 3, 5, 4, + 5, 4, + /* Codebook 13 - 32 elements */ + 4, 2, 4, 2, 5, 3, 5, 4, 6, 6, 6, 7, 7, 8, 7, + 8, 7, 8, 7, 9, 8, 9, 8, 9, 8, 10, 8, 11, 9, 12, + 9, 12, + /* Codebook 14 - 78 elements */ + 2, 5, 2, 6, 3, 6, 4, 7, 4, 7, 5, 9, 5, 11, 6, + 11, 6, 11, 7, 11, 6, 11, 6, 11, 9, 11, 8, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 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, + /* Codebook 15 - 100 elements */ + 5, 6, 11, 11, 11, 11, 10, 10, 12, 11, 5, 2, 11, 5, 6, + 6, 7, 9, 11, 13, 13, 10, 7, 11, 6, 7, 8, 9, 10, 12, + 11, 5, 11, 6, 8, 7, 9, 11, 14, 15, 11, 6, 6, 8, 4, + 5, 7, 8, 10, 13, 10, 5, 7, 7, 5, 5, 6, 8, 10, 11, + 10, 7, 7, 8, 6, 5, 5, 7, 9, 9, 11, 8, 8, 11, 8, + 7, 6, 6, 7, 9, 12, 11, 10, 13, 9, 9, 7, 7, 7, 9, + 11, 13, 12, 15, 12, 11, 9, 8, 8, 8, + /* Codebook 16 - 1641 elements, real length 6561 */ + 2, 4, 4, 0, 0, 0, 0, 0, 0, 5, 6, 6, 0, 0, 0, + 0, 0, 0, 5, 6, 6, 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, 7, 0, 0, 0, 0, 0, 0, + 7, 8, 8, 0, 0, 0, 0, 0, 0, 6, 7, 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, 5, 7, 7, + 0, 0, 0, 0, 0, 0, 6, 8, 7, 0, 0, 0, 0, 0, 0, + 7, 8, 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, 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, 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, + 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, 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, 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, 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, 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, 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, 7, 0, 0, 0, + 0, 0, 0, 7, 8, 8, 0, 0, 0, 0, 0, 0, 7, 8, 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, + 7, 8, 8, 0, 0, 0, 0, 0, 0, 8, 8, 9, 0, 0, 0, + 0, 0, 0, 8, 9, 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, 6, 8, 8, 0, 0, 0, 0, 0, 0, + 7, 9, 8, 0, 0, 0, 0, 0, 0, 8, 9, 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, 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, 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, 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, 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, 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, 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, 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, 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, 7, 0, 0, 0, 0, 0, 0, 7, 8, 8, + 0, 0, 0, 0, 0, 0, 7, 8, 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, 6, 8, 8, 0, 0, 0, + 0, 0, 0, 8, 9, 9, 0, 0, 0, 0, 0, 0, 7, 8, 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, + 6, 8, 8, 0, 0, 0, 0, 0, 0, 8, 9, 9, 0, 0, 0, + 0, 0, 0, 8, 9, 8, + /* Codebook 17 - 443 elements, real length 625 */ + 2, 5, 5, 0, 0, 0, 5, 5, 0, 0, 0, 5, 5, 0, 0, + 0, 7, 8, 0, 0, 0, 0, 0, 0, 0, 5, 6, 6, 0, 0, + 0, 7, 7, 0, 0, 0, 7, 7, 0, 0, 0, 10, 10, 0, 0, + 0, 0, 0, 0, 0, 5, 6, 6, 0, 0, 0, 7, 7, 0, 0, + 0, 7, 7, 0, 0, 0, 10, 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, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 5, 7, 7, 0, 0, 0, 7, 7, 0, 0, 0, 7, 7, 0, 0, + 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, 5, 7, 7, 0, 0, + 0, 7, 7, 0, 0, 0, 7, 7, 0, 0, 0, 9, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 5, 7, 7, 0, 0, 0, 7, 7, 0, 0, + 0, 7, 7, 0, 0, 0, 9, 9, 0, 0, 0, 0, 0, 0, 0, + 5, 7, 7, 0, 0, 0, 7, 7, 0, 0, 0, 7, 7, 0, 0, + 0, 9, 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, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 10, 10, 0, 0, + 0, 9, 9, 0, 0, 0, 9, 9, 0, 0, 0, 10, 10, 0, 0, + 0, 0, 0, 0, 0, 8, 10, 10, 0, 0, 0, 9, 9, 0, 0, + 0, 9, 9, 0, 0, 0, 10, 10, + /* Codebook 18 - 105 elements, real length 625 */ + 2, 4, 3, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 6, 6, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 4, 4, 4, 6, 6, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 6, 6, 6, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 7, 9, 9, + /* Codebook 19 - 68 elements, real length 81 */ + 2, 3, 3, 6, 6, 0, 0, 0, 0, 0, 4, 4, 6, 6, 0, + 0, 0, 0, 0, 4, 4, 6, 6, 0, 0, 0, 0, 0, 5, 5, + 6, 6, 0, 0, 0, 0, 0, 0, 0, 6, 6, 0, 0, 0, 0, + 0, 0, 0, 7, 8, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, + 0, 0, 0, 0, 0, 0, 9, 9, + /* Codebook 20 - 81 elements */ + 1, 3, 4, 6, 6, 7, 7, 9, 9, 0, 5, 5, 7, 7, 7, + 8, 9, 9, 0, 5, 5, 7, 7, 8, 8, 9, 9, 0, 7, 7, + 8, 8, 8, 8, 10, 10, 0, 0, 0, 8, 8, 8, 8, 10, 10, + 0, 0, 0, 9, 9, 9, 9, 10, 10, 0, 0, 0, 9, 9, 9, + 9, 10, 10, 0, 0, 0, 10, 10, 10, 10, 11, 11, 0, 0, 0, + 0, 0, 10, 10, 11, 11, + /* Codebook 21 - 289 elements */ + 2, 3, 3, 6, 6, 7, 7, 8, 8, 8, 8, 9, 9, 10, 10, + 11, 10, 0, 5, 5, 7, 7, 8, 8, 9, 9, 9, 9, 10, 10, + 10, 10, 11, 11, 0, 5, 5, 7, 7, 8, 8, 9, 9, 9, 9, + 10, 10, 10, 10, 11, 11, 0, 6, 6, 7, 7, 8, 8, 9, 9, + 9, 9, 10, 10, 11, 11, 11, 11, 0, 0, 0, 7, 7, 8, 8, + 9, 9, 9, 9, 10, 10, 11, 11, 11, 12, 0, 0, 0, 8, 8, + 8, 8, 9, 9, 9, 9, 10, 10, 11, 11, 12, 12, 0, 0, 0, + 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 11, 11, 12, 12, 0, + 0, 0, 9, 9, 9, 9, 10, 10, 10, 10, 11, 10, 11, 11, 12, + 12, 0, 0, 0, 0, 0, 9, 9, 10, 10, 10, 10, 11, 11, 11, + 11, 12, 12, 0, 0, 0, 0, 0, 9, 8, 9, 9, 10, 10, 11, + 11, 12, 12, 12, 12, 0, 0, 0, 0, 0, 8, 8, 9, 9, 10, + 10, 11, 11, 12, 11, 12, 12, 0, 0, 0, 0, 0, 9, 10, 10, + 10, 11, 11, 11, 11, 12, 12, 13, 13, 0, 0, 0, 0, 0, 0, + 0, 10, 10, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0, 0, 0, + 0, 0, 0, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 0, 0, + 0, 0, 0, 0, 0, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, + 0, 0, 0, 0, 0, 0, 0, 11, 11, 12, 12, 12, 12, 13, 13, + 13, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, + 13, 13, 13, 13, + /* Codebook 22 - 81 elements */ + 1, 4, 4, 7, 6, 6, 7, 6, 6, 4, 7, 7, 10, 9, 9, + 11, 9, 9, 4, 7, 7, 10, 9, 9, 11, 9, 9, 7, 10, 10, + 11, 11, 10, 12, 11, 11, 6, 9, 9, 11, 10, 10, 11, 10, 10, + 6, 9, 9, 11, 10, 10, 11, 10, 10, 7, 11, 11, 11, 11, 11, + 12, 11, 11, 6, 9, 9, 11, 10, 10, 11, 10, 10, 6, 9, 9, + 11, 10, 10, 11, 10, 10, + /* Codebook 23 - 121 elements */ + 2, 4, 4, 6, 6, 7, 7, 7, 7, 8, 8, 10, 5, 5, 6, + 6, 7, 7, 8, 8, 8, 8, 10, 5, 5, 6, 6, 7, 7, 8, + 8, 8, 8, 10, 6, 6, 7, 7, 8, 8, 8, 8, 8, 8, 10, + 10, 10, 7, 7, 8, 7, 8, 8, 8, 8, 10, 10, 10, 8, 8, + 8, 8, 8, 8, 8, 8, 10, 10, 10, 7, 8, 8, 8, 8, 8, + 8, 8, 10, 10, 10, 8, 8, 8, 8, 8, 8, 8, 8, 10, 10, + 10, 10, 10, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10, 9, + 9, 8, 8, 9, 8, 10, 10, 10, 10, 10, 8, 8, 8, 8, 8, + 8, + /* Codebook 24 - 169 elements */ + 1, 4, 4, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 6, 5, + 5, 7, 7, 8, 8, 8, 8, 9, 9, 10, 10, 7, 5, 5, 7, + 7, 8, 8, 8, 8, 9, 9, 11, 10, 0, 8, 8, 8, 8, 9, + 9, 9, 9, 10, 10, 11, 11, 0, 8, 8, 8, 8, 9, 9, 9, + 9, 10, 10, 11, 11, 0, 12, 12, 9, 9, 10, 10, 10, 10, 11, + 11, 11, 12, 0, 13, 13, 9, 9, 10, 10, 10, 10, 11, 11, 12, + 12, 0, 0, 0, 10, 10, 10, 10, 11, 11, 12, 12, 12, 12, 0, + 0, 0, 10, 10, 10, 10, 11, 11, 12, 12, 12, 12, 0, 0, 0, + 14, 14, 11, 11, 11, 11, 12, 12, 13, 13, 0, 0, 0, 14, 14, + 11, 11, 11, 11, 12, 12, 13, 13, 0, 0, 0, 0, 0, 12, 12, + 12, 12, 13, 13, 14, 13, 0, 0, 0, 0, 0, 13, 13, 12, 12, + 13, 12, 14, 13, + /* Codebook 25 - 25 elements */ + 2, 4, 4, 5, 5, 6, 5, 5, 5, 5, 6, 4, 5, 5, 5, + 6, 5, 5, 5, 5, 6, 6, 6, 5, 5, + /* Codebook 26 - 169 elements */ + 1, 4, 4, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 4, 9, + 8, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 2, 9, 7, 12, + 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, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 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, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, + /* Codebook 27 - 225 elements */ + 1, 4, 4, 6, 6, 7, 7, 8, 7, 9, 9, 10, 10, 10, 10, + 6, 5, 5, 7, 7, 8, 8, 10, 8, 11, 10, 12, 12, 13, 13, + 6, 5, 5, 7, 7, 8, 8, 10, 9, 11, 11, 12, 12, 13, 12, + 18, 8, 8, 8, 8, 9, 9, 10, 9, 11, 10, 12, 12, 13, 13, + 18, 8, 8, 8, 8, 9, 9, 10, 10, 11, 11, 13, 12, 14, 13, + 18, 11, 11, 9, 9, 10, 10, 11, 11, 11, 12, 13, 12, 13, 14, + 18, 11, 11, 9, 8, 11, 10, 11, 11, 11, 11, 12, 12, 14, 13, + 18, 18, 18, 10, 11, 10, 11, 12, 12, 12, 12, 13, 12, 14, 13, + 18, 18, 18, 10, 11, 11, 9, 12, 11, 12, 12, 12, 13, 13, 13, + 18, 18, 17, 14, 14, 11, 11, 12, 12, 13, 12, 14, 12, 14, 13, + 18, 18, 18, 14, 14, 11, 10, 12, 9, 12, 13, 13, 13, 13, 13, + 18, 18, 17, 16, 18, 13, 13, 12, 12, 13, 11, 14, 12, 14, 14, + 17, 18, 18, 17, 18, 13, 12, 13, 10, 12, 11, 14, 14, 14, 14, + 17, 18, 18, 18, 18, 15, 16, 12, 12, 13, 10, 14, 12, 14, 15, + 18, 18, 18, 16, 17, 16, 14, 12, 11, 13, 10, 13, 13, 14, 15, + /* Codebook 28 - 289 elements */ + 2, 5, 5, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, + 8, 8, 10, 6, 6, 7, 7, 8, 7, 8, 8, 8, 8, 8, 9, + 9, 9, 9, 9, 10, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, + 9, 9, 9, 9, 9, 9, 10, 7, 7, 7, 7, 8, 8, 8, 8, + 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 7, 7, 8, 8, + 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 8, 8, + 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, + 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, + 10, 10, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, + 9, 10, 10, 10, 11, 11, 9, 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 9, 11, 10, 11, 11, 11, 9, 9, 9, 9, 9, 9, 10, + 10, 9, 9, 10, 9, 11, 10, 11, 11, 11, 9, 9, 9, 9, 9, + 9, 9, 9, 10, 10, 10, 9, 11, 11, 11, 11, 11, 9, 9, 9, + 9, 10, 10, 9, 9, 9, 9, 10, 9, 11, 11, 11, 11, 11, 11, + 11, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, + 11, 11, 11, 10, 9, 10, 10, 9, 10, 9, 9, 10, 9, 11, 10, + 10, 11, 11, 11, 11, 9, 10, 9, 9, 9, 9, 10, 10, 10, 10, + 11, 11, 11, 11, 11, 11, 10, 10, 10, 9, 9, 10, 9, 10, 9, + 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 9, 9, 9, 9, + 9, 10, 10, 10, +}; + +static const uint8_t quant_tables[] = { + /* Codebook 16 */ + 1, 0, 2, + /* Codebook 17 */ + 2, 1, 3, 0, 4, + /* Codebook 18 */ + 2, 1, 3, 0, 4, + /* Codebook 19 */ + 4, 3, 5, 2, 6, 1, 7, 0, 8, + /* Codebook 20 */ + 4, 3, 5, 2, 6, 1, 7, 0, 8, + /* Codebook 21 */ + 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15, 0, 16, + /* Codebook 22 */ + 1, 0, 2, + /* Codebook 23 */ + 5, 4, 6, 3, 7, 2, 8, 1, 9, 0, 10, + /* Codebook 24 */ + 6, 5, 7, 4, 8, 3, 9, 2, 10, 1, 11, 0, 12, + /* Codebook 25 */ + 2, 1, 3, 0, 4, + /* Codebook 26 */ + 6, 5, 7, 4, 8, 3, 9, 2, 10, 1, 11, 0, 12, + /* Codebook 27 */ + 7, 6, 8, 5, 9, 4, 10, 3, 11, 2, 12, 1, 13, 0, 14, + /* Codebook 28 */ + 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15, 0, 16, +}; + +static const struct { + int dim; + int len; + int real_len; + int lookup; + float min; + float delta; +} cvectors[] = { + { 2, 16, 16, 0 }, + { 2, 8, 8, 0 }, + { 2, 256, 256, 0 }, + { 2, 64, 64, 0 }, + { 2, 128, 128, 0 }, + { 2, 32, 32, 0 }, + { 2, 96, 96, 0 }, + { 2, 32, 32, 0 }, + { 2, 96, 96, 0 }, + { 2, 17, 17, 0 }, + { 2, 32, 32, 0 }, + { 2, 78, 78, 0 }, + { 2, 17, 17, 0 }, + { 2, 32, 32, 0 }, + { 2, 78, 78, 0 }, + { 2, 100, 100, 0 }, + { 8, 1641, 6561, 1, -1.0, 1.0 }, + { 4, 443, 625, 1, -2.0, 1.0 }, + { 4, 105, 625, 1, -2.0, 1.0 }, + { 2, 68, 81, 1, -4.0, 1.0 }, + { 2, 81, 81, 1, -4.0, 1.0 }, + { 2, 289, 289, 1, -8.0, 1.0 }, + { 4, 81, 81, 1, -11.0, 11.0 }, + { 2, 121, 121, 1, -5.0, 1.0 }, + { 2, 169, 169, 1, -30.0, 5.0 }, + { 2, 25, 25, 1, -2.0, 1.0 }, + { 2, 169, 169, 1, -1530.0, 255.0 }, + { 2, 225, 225, 1, -119.0, 17.0 }, + { 2, 289, 289, 1, -8.0, 1.0 }, +}; + +static const struct { + int dim; + int subclass; + int masterbook; + const int nbooks[4]; +} floor_classes[] = { + { 3, 0, 0, { 4 } }, + { 4, 1, 0, { 5, 6 } }, + { 3, 1, 1, { 7, 8 } }, + { 4, 2, 2, { -1, 9, 10, 11 } }, + { 3, 2, 3, { -1, 12, 13, 14 } }, +}; + +#endif /* AVCODEC_VORBIS_ENC_DATA_H */ diff --git a/include/libavcodec/vorbis_parser_internal.h b/include/libavcodec/vorbis_parser_internal.h new file mode 100644 index 0000000..691a842 --- /dev/null +++ b/include/libavcodec/vorbis_parser_internal.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2012 Justin Ruggles + * + * 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 + */ + +/** + * @file + * Vorbis audio parser + * + * Determines the duration for each packet. + */ + +#ifndef AVCODEC_VORBIS_PARSER_INTERNAL_H +#define AVCODEC_VORBIS_PARSER_INTERNAL_H + +#include "avcodec.h" +#include "vorbis_parser.h" + +struct AVVorbisParseContext { + const AVClass *class; + int extradata_parsed; ///< we have attempted to parse extradata + int valid_extradata; ///< extradata is valid, so we can calculate duration + int blocksize[2]; ///< short and long window sizes + int previous_blocksize; ///< previous window size + int mode_blocksize[64]; ///< window size mapping for each mode + int mode_count; ///< number of modes + int mode_mask; ///< bitmask used to get the mode in each packet + int prev_mask; ///< bitmask used to get the previous mode flag in each packet +}; + +#endif /* AVCODEC_VORBIS_PARSER_INTERNAL_H */ diff --git a/include/libavcodec/vorbisdsp.h b/include/libavcodec/vorbisdsp.h new file mode 100644 index 0000000..5c369ec --- /dev/null +++ b/include/libavcodec/vorbisdsp.h @@ -0,0 +1,39 @@ +/* + * 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_VORBISDSP_H +#define AVCODEC_VORBISDSP_H + +#include + +typedef struct VorbisDSPContext { + /* assume len is a multiple of 4, and arrays are 16-byte aligned */ + void (*vorbis_inverse_coupling)(float *mag, float *ang, + ptrdiff_t blocksize); +} VorbisDSPContext; + +void ff_vorbisdsp_init(VorbisDSPContext *dsp); + +/* for internal use only */ +void ff_vorbisdsp_init_aarch64(VorbisDSPContext *dsp); +void ff_vorbisdsp_init_x86(VorbisDSPContext *dsp); +void ff_vorbisdsp_init_arm(VorbisDSPContext *dsp); +void ff_vorbisdsp_init_ppc(VorbisDSPContext *dsp); +void ff_vorbisdsp_init_riscv(VorbisDSPContext *dsp); + +#endif /* AVCODEC_VORBISDSP_H */ diff --git a/include/libavcodec/vp3data.h b/include/libavcodec/vp3data.h new file mode 100644 index 0000000..a347f49 --- /dev/null +++ b/include/libavcodec/vp3data.h @@ -0,0 +1,1013 @@ +/* + * Copyright (C) 2003 The FFmpeg project + * + * 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_VP3DATA_H +#define AVCODEC_VP3DATA_H + +#include +#include + +/* these coefficients dequantize intraframe Y plane coefficients + * (note: almost the same as JPEG) */ +static const uint8_t vp31_intra_y_dequant[64] = { + 16, 11, 10, 16, 24, 40, 51, 61, + 12, 12, 14, 19, 26, 58, 60, 55, + 14, 13, 16, 24, 40, 57, 69, 56, + 14, 17, 22, 29, 51, 87, 80, 62, + 18, 22, 37, 58, 68, 109, 103, 77, + 24, 35, 55, 64, 81, 104, 113, 92, + 49, 64, 78, 87, 103, 121, 120, 101, + 72, 92, 95, 98, 112, 100, 103, 99 +}; + +/* these coefficients dequantize interframe coefficients (all planes) */ +static const uint8_t vp31_inter_dequant[64] = { + 16, 16, 16, 20, 24, 28, 32, 40, + 16, 16, 20, 24, 28, 32, 40, 48, + 16, 20, 24, 28, 32, 40, 48, 64, + 20, 24, 28, 32, 40, 48, 64, 64, + 24, 28, 32, 40, 48, 64, 64, 64, + 28, 32, 40, 48, 64, 64, 64, 96, + 32, 40, 48, 64, 64, 64, 96, 128, + 40, 48, 64, 64, 64, 96, 128, 128 +}; + +static const uint8_t vp31_dc_scale_factor[64] = { + 220, 200, 190, 180, 170, 170, 160, 160, + 150, 150, 140, 140, 130, 130, 120, 120, + 110, 110, 100, 100, 90, 90, 90, 80, + 80, 80, 70, 70, 70, 60, 60, 60, + 60, 50, 50, 50, 50, 40, 40, 40, + 40, 40, 30, 30, 30, 30, 30, 30, + 30, 20, 20, 20, 20, 20, 20, 20, + 20, 10, 10, 10, 10, 10, 10, 10 +}; + +static const uint16_t vp31_ac_scale_factor[64] = { + 500, 450, 400, 370, 340, 310, 285, 265, + 245, 225, 210, 195, 185, 180, 170, 160, + 150, 145, 135, 130, 125, 115, 110, 107, + 100, 96, 93, 89, 85, 82, 75, 74, + 70, 68, 64, 60, 57, 56, 52, 50, + 49, 45, 44, 43, 40, 38, 37, 35, + 33, 32, 30, 29, 28, 25, 24, 22, + 21, 19, 18, 17, 15, 13, 12, 10 +}; + +static const uint8_t vp31_filter_limit_values[64] = { + 30, 25, 20, 20, 15, 15, 14, 14, + 13, 13, 12, 12, 11, 11, 10, 10, + 9, 9, 8, 8, 7, 7, 7, 7, + 6, 6, 6, 6, 5, 5, 5, 5, + 4, 4, 4, 4, 3, 3, 3, 3, + 2, 2, 2, 2, 2, 2, 2, 2, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0 +}; + +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 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_len[8] = { + 1, 2, 3, 4, 5, 6, 7, 7, +}; + +static const uint8_t motion_vector_vlc_table[63][2] = { + { 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] = { + 0, 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 +}; + +/* only tokens 0..6 indicate eob runs */ +static const struct { + uint8_t base, bits; +} eob_run_table[7] = { + {1, 0}, {2, 0}, {3, 0}, {4, 2}, {8, 3}, {16, 4}, {0, 12} +}; + +static const uint8_t zero_run_base[32] = { + 0, 0, 0, 0, 0, 0, 0, /* 0..6 are never used */ + 0, 0, /* 7..8 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 9..22 */ + 1, 2, 3, 4, 5, /* 23..27 */ + 6, 10, 1, 2 /* 28..31 */ +}; +static const uint8_t zero_run_get_bits[32] = { + 0, 0, 0, 0, 0, 0, 0, /* 0..6 are never used */ + 3, 6, /* 7..8 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 9..22 */ + 0, 0, 0, 0, 0, /* 23..27 */ + 2, 3, 0, 1 /* 28..31 */ +}; + +static const uint8_t coeff_get_bits[32] = { + 0, 0, 0, 0, 0, 0, 0, /* 0..6 are never used */ + 0, 0, 0, 0, 0, 0, /* 7..12 use constant coeffs */ + 1, 1, 1, 1, /* 13..16 are constants but still need sign bit */ + 2, 3, 4, 5, 6,10, /* 17..22, for reading large coeffs */ + 1, 1, 1, 1, 1, 1, 1, /* 23..29 are constants but still need sign bit */ + 2, 2 /* 30..31 */ +}; + +static const int16_t coeff_table_token_7_8[1] = { 0 }; +static const int16_t coeff_table_token_9[1] = { 1 }; +static const int16_t coeff_table_token_10[1] = { -1 }; +static const int16_t coeff_table_token_11[1] = { 2 }; +static const int16_t coeff_table_token_12[1] = { -2 }; + +static const int16_t coeff_table_token_13[2] = { 3, -3 }; +static const int16_t coeff_table_token_14[2] = { 4, -4 }; +static const int16_t coeff_table_token_15[2] = { 5, -5 }; +static const int16_t coeff_table_token_16[2] = { 6, -6 }; + +static const int16_t coeff_table_token_23_24_25_26_27_28_29[2] = { 1, -1 }; +static const int16_t coeff_table_token_30_31[4] = { 2, 3, -2, -3 }; + +static const int16_t coeff_table_token_17[4] = { + 7, 8, -7, -8 +}; + +static const int16_t coeff_table_token_18[8] = { + 9, 10, 11, 12, -9, -10, -11, -12 +}; + +static const int16_t coeff_table_token_19[16] = { + 13, 14, 15, 16, 17, 18, 19, 20, -13, -14, -15, -16, -17, -18, -19, -20 +}; + +static const int16_t coeff_table_token_20[32] = { + 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, + -21, -22, -23, -24, -25, -26, -27, -28, + -29, -30, -31, -32, -33, -34, -35, -36 +}; + +static const int16_t coeff_table_token_21[64] = { + 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, 65, 66, 67, 68, + -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, -65, -66, -67, -68 +}; + +static const int16_t coeff_table_token_22[1024] = { + 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, 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, 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, 256, 257, 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, 287, 288, 289, 290, 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, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, + 333, 334, 335, 336, 337, 338, 339, 340, + 341, 342, 343, 344, 345, 346, 347, 348, + 349, 350, 351, 352, 353, 354, 355, 356, + 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 376, 377, 378, 379, 380, + 381, 382, 383, 384, 385, 386, 387, 388, + 389, 390, 391, 392, 393, 394, 395, 396, + 397, 398, 399, 400, 401, 402, 403, 404, + 405, 406, 407, 408, 409, 410, 411, 412, + 413, 414, 415, 416, 417, 418, 419, 420, + 421, 422, 423, 424, 425, 426, 427, 428, + 429, 430, 431, 432, 433, 434, 435, 436, + 437, 438, 439, 440, 441, 442, 443, 444, + 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 466, 467, 468, + 469, 470, 471, 472, 473, 474, 475, 476, + 477, 478, 479, 480, 481, 482, 483, 484, + 485, 486, 487, 488, 489, 490, 491, 492, + 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 507, 508, + 509, 510, 511, 512, 513, 514, 515, 516, + 517, 518, 519, 520, 521, 522, 523, 524, + 525, 526, 527, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, + 541, 542, 543, 544, 545, 546, 547, 548, + 549, 550, 551, 552, 553, 554, 555, 556, + 557, 558, 559, 560, 561, 562, 563, 564, + 565, 566, 567, 568, 569, 570, 571, 572, + 573, 574, 575, 576, 577, 578, 579, 580, + -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, -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, -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, -256, -257, -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, -287, -288, -289, -290, -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, -320, -321, -322, -323, -324, + -325, -326, -327, -328, -329, -330, -331, -332, + -333, -334, -335, -336, -337, -338, -339, -340, + -341, -342, -343, -344, -345, -346, -347, -348, + -349, -350, -351, -352, -353, -354, -355, -356, + -357, -358, -359, -360, -361, -362, -363, -364, + -365, -366, -367, -368, -369, -370, -371, -372, + -373, -374, -375, -376, -377, -378, -379, -380, + -381, -382, -383, -384, -385, -386, -387, -388, + -389, -390, -391, -392, -393, -394, -395, -396, + -397, -398, -399, -400, -401, -402, -403, -404, + -405, -406, -407, -408, -409, -410, -411, -412, + -413, -414, -415, -416, -417, -418, -419, -420, + -421, -422, -423, -424, -425, -426, -427, -428, + -429, -430, -431, -432, -433, -434, -435, -436, + -437, -438, -439, -440, -441, -442, -443, -444, + -445, -446, -447, -448, -449, -450, -451, -452, + -453, -454, -455, -456, -457, -458, -459, -460, + -461, -462, -463, -464, -465, -466, -467, -468, + -469, -470, -471, -472, -473, -474, -475, -476, + -477, -478, -479, -480, -481, -482, -483, -484, + -485, -486, -487, -488, -489, -490, -491, -492, + -493, -494, -495, -496, -497, -498, -499, -500, + -501, -502, -503, -504, -505, -506, -507, -508, + -509, -510, -511, -512, -513, -514, -515, -516, + -517, -518, -519, -520, -521, -522, -523, -524, + -525, -526, -527, -528, -529, -530, -531, -532, + -533, -534, -535, -536, -537, -538, -539, -540, + -541, -542, -543, -544, -545, -546, -547, -548, + -549, -550, -551, -552, -553, -554, -555, -556, + -557, -558, -559, -560, -561, -562, -563, -564, + -565, -566, -567, -568, -569, -570, -571, -572, + -573, -574, -575, -576, -577, -578, -579, -580 +}; + +static const int16_t *const coeff_tables[32] = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + coeff_table_token_7_8, + + coeff_table_token_7_8, + coeff_table_token_9, + coeff_table_token_10, + coeff_table_token_11, + coeff_table_token_12, + coeff_table_token_13, + coeff_table_token_14, + coeff_table_token_15, + + coeff_table_token_16, + coeff_table_token_17, + coeff_table_token_18, + coeff_table_token_19, + coeff_table_token_20, + coeff_table_token_21, + coeff_table_token_22, + coeff_table_token_23_24_25_26_27_28_29, + + coeff_table_token_23_24_25_26_27_28_29, + coeff_table_token_23_24_25_26_27_28_29, + coeff_table_token_23_24_25_26_27_28_29, + coeff_table_token_23_24_25_26_27_28_29, + coeff_table_token_23_24_25_26_27_28_29, + coeff_table_token_23_24_25_26_27_28_29, + coeff_table_token_30_31, + coeff_table_token_30_31 +}; + +static const uint8_t vp3_bias[5 * 16][32][2] = { + { /* DC bias table 0 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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/include/libavcodec/vp3dsp.h b/include/libavcodec/vp3dsp.h new file mode 100644 index 0000000..3b849ec --- /dev/null +++ b/include/libavcodec/vp3dsp.h @@ -0,0 +1,64 @@ +/* + * 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_VP3DSP_H +#define AVCODEC_VP3DSP_H + +#include +#include + +typedef struct VP3DSPContext { + /** + * Copy 8xH pixels from source to destination buffer using a bilinear + * filter with no rounding (i.e. *dst = (*a + *b) >> 1). + * + * @param dst destination buffer, aligned by 8 + * @param a first source buffer, no alignment + * @param b second source buffer, no alignment + * @param stride distance between two lines in source/dest buffers + * @param h height + */ + void (*put_no_rnd_pixels_l2)(uint8_t *dst, + const uint8_t *a, + const uint8_t *b, + ptrdiff_t stride, int h); + + void (*idct_put)(uint8_t *dest, ptrdiff_t stride, int16_t *block); + void (*idct_add)(uint8_t *dest, ptrdiff_t stride, int16_t *block); + void (*idct_dc_add)(uint8_t *dest, ptrdiff_t stride, int16_t *block); + void (*v_loop_filter)(uint8_t *src, ptrdiff_t stride, int *bounding_values); + void (*h_loop_filter)(uint8_t *src, ptrdiff_t stride, int *bounding_values); + void (*v_loop_filter_unaligned)(uint8_t *src, ptrdiff_t stride, int *bounding_values); + void (*h_loop_filter_unaligned)(uint8_t *src, ptrdiff_t stride, int *bounding_values); +} VP3DSPContext; + +void ff_vp3dsp_v_loop_filter_12(uint8_t *first_pixel, ptrdiff_t stride, int *bounding_values); +void ff_vp3dsp_h_loop_filter_12(uint8_t *first_pixel, ptrdiff_t stride, int *bounding_values); + +void ff_vp3dsp_idct10_put(uint8_t *dest, ptrdiff_t stride, int16_t *block); +void ff_vp3dsp_idct10_add(uint8_t *dest, ptrdiff_t stride, int16_t *block); + +void ff_vp3dsp_init(VP3DSPContext *c, int flags); +void ff_vp3dsp_init_arm(VP3DSPContext *c, int flags); +void ff_vp3dsp_init_ppc(VP3DSPContext *c, int flags); +void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags); +void ff_vp3dsp_init_mips(VP3DSPContext *c, int flags); + +void ff_vp3dsp_set_bounding_values(int * bound_values_array, int filter_limit); + +#endif /* AVCODEC_VP3DSP_H */ diff --git a/include/libavcodec/vp4data.h b/include/libavcodec/vp4data.h new file mode 100644 index 0000000..156cfd0 --- /dev/null +++ b/include/libavcodec/vp4data.h @@ -0,0 +1,972 @@ +/* + * Copyright (C) 2019 Peter Ross + * + * 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 + */ + +/** + * @file + * VP4 video decoder + */ + +#ifndef AVCODEC_VP4DATA_H +#define AVCODEC_VP4DATA_H + +#include + +static const uint8_t vp4_generic_dequant[64] = { + 16, 17, 18, 20, 22, 24, 26, 28, + 17, 18, 20, 22, 24, 26, 28, 32, + 18, 20, 22, 24, 26, 28, 32, 36, + 20, 22, 24, 26, 28, 32, 36, 40, + 22, 24, 26, 28, 32, 36, 40, 44, + 24, 26, 28, 32, 36, 40, 44, 48, + 26, 28, 32, 36, 40, 44, 48, 52, + 28, 32, 36, 40, 44, 48, 52, 56 +}; + +static const uint8_t vp4_y_dc_scale_factor[64] = { + 180, 180, 180, 180, 180, 180, 175, 170, + 165, 160, 157, 155, 152, 150, 147, 145, + 142, 140, 137, 135, 132, 130, 127, 125, + 122, 120, 117, 115, 112, 110, 107, 105, + 102, 100, 97, 95, 92, 90, 87, 85, + 82, 80, 77, 75, 72, 70, 67, 65, + 62, 60, 57, 55, 52, 50, 47, 45, + 42, 40, 37, 35, 32, 30, 27, 25 +}; + +static const uint8_t vp4_uv_dc_scale_factor[64] = { + 150, 150, 150, 150, 150, 150, 150, 150, + 150, 150, 150, 150, 150, 150, 147, 145, + 142, 140, 137, 135, 132, 130, 127, 125, + 122, 120, 117, 115, 112, 110, 107, 105, + 102, 100, 97, 95, 92, 90, 87, 85, + 82, 80, 77, 75, 72, 70, 67, 65, + 62, 60, 57, 55, 52, 50, 47, 45, + 42, 40, 37, 35, 32, 30, 27, 25 +}; + +static const uint16_t vp4_ac_scale_factor[64] = { + 500, 475, 450, 430, 410, 390, 370, 350, + 330, 315, 300, 285, 270, 260, 250, 240, + 230, 220, 210, 200, 190, 185, 180, 170, + 160, 150, 143, 135, 128, 120, 113, 106, + 100, 94, 90, 85, 80, 75, 70, 66, + 62, 57, 52, 49, 45, 41, 38, 35, + 33, 30, 27, 24, 22, 20, 18, 16, + 14, 12, 10, 9, 7, 6, 4, 1 +}; + +static const uint8_t vp4_filter_limit_values[64] = { + 30, 25, 20, 20, 15, 15, 14, 14, + 13, 13, 12, 12, 11, 11, 10, 10, + 9, 9, 8, 8, 7, 7, 7, 7, + 6, 6, 6, 6, 5, 5, 5, 5, + 4, 4, 4, 4, 3, 3, 3, 3, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, + 1, 1, 1, 1, 1, 1, 1, 1 +}; + +static const uint8_t vp4_block_pattern_table_selector[14] = { + 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 1 +}; + +static const uint8_t vp4_block_pattern_vlc[2][14][2] = { + { + { 0x0, 3 }, { 0xf, 4 }, { 0x9, 4 }, { 0x2, 3 }, + { 0xd, 4 }, { 0xe, 5 }, { 0xb, 4 }, { 0x1, 3 }, + { 0xf, 5 }, { 0x8, 4 }, { 0x6, 4 }, { 0xe, 4 }, + { 0xc, 4 }, { 0xa, 4 } + }, + { + { 0x7, 4 }, { 0xa, 4 }, { 0x9, 4 }, { 0xc, 4 }, + { 0x8, 4 }, { 0xd, 5 }, { 0x0, 3 }, { 0xe, 4 }, + { 0xc, 5 }, { 0xd, 4 }, { 0x1, 3 }, { 0xb, 4 }, + { 0xf, 4 }, { 0x2, 3 } + } +}; + +static const uint8_t vp4_mv_table_selector[32] = { + 0, 1, 2, 2, 3, 3, 3, 3, + 4, 4, 4, 4, 4, 4, 4, 4, + 5, 5, 5, 5, 5, 5, 5, 5, + 6, 6, 6, 6, 6, 6, 6, 6, +}; + +static const uint8_t vp4_mv_vlc[2][7][63][2] = { + { /* x-axis tables */ + { + { 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 }, + }, + { + { 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 }, + }, + { + { 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 }, + }, + { + { 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 }, + }, + { + { 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 }, + }, + { + { 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 }, + }, + { + { 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 */ + { + { 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 }, + }, + { + { 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 }, + }, + { + { 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 }, + }, + { + { 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 }, + }, + { + { 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 }, + }, + { + { 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 }, + }, + { + { 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 }, + }, + } +}; + +static const uint8_t vp4_bias[5 * 16][32][2] = { + { /* DC bias table 0 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ + { 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 */ diff --git a/include/libavcodec/vp56.h b/include/libavcodec/vp56.h new file mode 100644 index 0000000..9dc0b9c --- /dev/null +++ b/include/libavcodec/vp56.h @@ -0,0 +1,256 @@ +/* + * Copyright (C) 2006 Aurelien Jacobs + * + * 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 + */ + +/** + * @file + * VP5 and VP6 compatible video decoder (common features) + */ + +#ifndef AVCODEC_VP56_H +#define AVCODEC_VP56_H + +#include "libavutil/mem_internal.h" + +#include "avcodec.h" +#include "get_bits.h" +#include "hpeldsp.h" +#include "h264chroma.h" +#include "videodsp.h" +#include "vp3dsp.h" +#include "vp56dsp.h" +#include "vpx_rac.h" + +typedef struct vp56_context VP56Context; + +typedef enum { + VP56_FRAME_NONE =-1, + VP56_FRAME_CURRENT = 0, + VP56_FRAME_PREVIOUS = 1, + VP56_FRAME_GOLDEN = 2, +} VP56Frame; + +typedef enum { + VP56_MB_INTER_NOVEC_PF = 0, /**< Inter MB, no vector, from previous frame */ + VP56_MB_INTRA = 1, /**< Intra MB */ + VP56_MB_INTER_DELTA_PF = 2, /**< Inter MB, above/left vector + delta, from previous frame */ + VP56_MB_INTER_V1_PF = 3, /**< Inter MB, first vector, from previous frame */ + VP56_MB_INTER_V2_PF = 4, /**< Inter MB, second vector, from previous frame */ + VP56_MB_INTER_NOVEC_GF = 5, /**< Inter MB, no vector, from golden frame */ + VP56_MB_INTER_DELTA_GF = 6, /**< Inter MB, above/left vector + delta, from golden frame */ + VP56_MB_INTER_4V = 7, /**< Inter MB, 4 vectors, from previous frame */ + VP56_MB_INTER_V1_GF = 8, /**< Inter MB, first vector, from golden frame */ + VP56_MB_INTER_V2_GF = 9, /**< Inter MB, second vector, from golden frame */ +} VP56mb; + +typedef struct VP56Tree { + int8_t val; + int8_t prob_idx; +} VP56Tree; + +typedef struct VP56mv { + DECLARE_ALIGNED(4, int16_t, x); + int16_t y; +} VP56mv; + +#define VP56_SIZE_CHANGE 1 + +typedef void (*VP56ParseVectorAdjustment)(VP56Context *s, + VP56mv *vect); +typedef void (*VP56Filter)(VP56Context *s, uint8_t *dst, uint8_t *src, + int offset1, int offset2, ptrdiff_t stride, + VP56mv mv, int mask, int select, int luma); +typedef int (*VP56ParseCoeff)(VP56Context *s); +typedef void (*VP56DefaultModelsInit)(VP56Context *s); +typedef void (*VP56ParseVectorModels)(VP56Context *s); +typedef int (*VP56ParseCoeffModels)(VP56Context *s); +typedef int (*VP56ParseHeader)(VP56Context *s, const uint8_t *buf, + int buf_size); + +typedef struct VP56RefDc { + uint8_t not_null_dc; + VP56Frame ref_frame; + int16_t dc_coeff; +} VP56RefDc; + +typedef struct VP56Macroblock { + uint8_t type; + VP56mv mv; +} VP56Macroblock; + +typedef struct VP56Model { + uint8_t coeff_reorder[64]; /* used in vp6 only */ + uint8_t coeff_index_to_pos[64]; /* used in vp6 only */ + uint8_t coeff_index_to_idct_selector[64]; /* used in vp6 only */ + uint8_t vector_sig[2]; /* delta sign */ + uint8_t vector_dct[2]; /* delta coding types */ + uint8_t vector_pdi[2][2]; /* predefined delta init */ + uint8_t vector_pdv[2][7]; /* predefined delta values */ + uint8_t vector_fdv[2][8]; /* 8 bit delta value definition */ + uint8_t coeff_dccv[2][11]; /* DC coeff value */ + uint8_t coeff_ract[2][3][6][11]; /* Run/AC coding type and AC coeff value */ + uint8_t coeff_acct[2][3][3][6][5];/* vp5 only AC coding type for coding group < 3 */ + uint8_t coeff_dcct[2][36][5]; /* DC coeff coding type */ + uint8_t coeff_runv[2][14]; /* run value (vp6 only) */ + uint8_t mb_type[3][10][10]; /* model for decoding MB type */ + uint8_t mb_types_stats[3][10][2];/* contextual, next MB type stats */ +} VP56Model; + +struct vp56_context { + AVCodecContext *avctx; + H264ChromaContext h264chroma; + HpelDSPContext hdsp; + VideoDSPContext vdsp; + VP3DSPContext vp3dsp; + VP56DSPContext vp56dsp; + uint8_t idct_scantable[64]; + AVFrame *frames[4]; + uint8_t *edge_emu_buffer_alloc; + uint8_t *edge_emu_buffer; + VPXRangeCoder c; + VPXRangeCoder cc; + VPXRangeCoder *ccp; + int sub_version; + + /* frame info */ + int golden_frame; + int plane_width[4]; + int plane_height[4]; + int mb_width; /* number of horizontal MB */ + int mb_height; /* number of vertical MB */ + int block_offset[6]; + + int quantizer; + uint16_t dequant_dc; + uint16_t dequant_ac; + + /* DC predictors management */ + VP56RefDc *above_blocks; + VP56RefDc left_block[4]; + int above_block_idx[6]; + int16_t prev_dc[3][3]; /* [plan][ref_frame] */ + + /* blocks / macroblock */ + VP56mb mb_type; + VP56Macroblock *macroblocks; + DECLARE_ALIGNED(16, int16_t, block_coeff)[6][64]; + int idct_selector[6]; + + /* motion vectors */ + VP56mv mv[6]; /* vectors for each block in MB */ + VP56mv vector_candidate[2]; + int vector_candidate_pos; + + /* filtering hints */ + int filter_header; /* used in vp6 only */ + int deblock_filtering; + int filter_selection; + int filter_mode; + int max_vector_length; + int sample_variance_threshold; + DECLARE_ALIGNED(8, int, bounding_values_array)[256]; + + uint8_t coeff_ctx[4][64]; /* used in vp5 only */ + uint8_t coeff_ctx_last[4]; /* used in vp5 only */ + + int has_alpha; + + /* upside-down flipping hints */ + int flip; /* are we flipping ? */ + int frbi; /* first row block index in MB */ + int srbi; /* second row block index in MB */ + ptrdiff_t stride[4]; /* stride for each plan */ + + const uint8_t *vp56_coord_div; + VP56ParseVectorAdjustment parse_vector_adjustment; + VP56Filter filter; + VP56ParseCoeff parse_coeff; + VP56DefaultModelsInit default_models_init; + VP56ParseVectorModels parse_vector_models; + VP56ParseCoeffModels parse_coeff_models; + VP56ParseHeader parse_header; + + /* for "slice" parallelism between YUV and A */ + VP56Context *alpha_context; + + VP56Model *modelp; + VP56Model model; + + /* huffman decoding */ + int use_huffman; + GetBitContext gb; + VLC dccv_vlc[2]; + VLC runv_vlc[2]; + VLC ract_vlc[2][3][6]; + unsigned int nb_null[2][2]; /* number of consecutive NULL DC/AC */ + + int have_undamaged_frame; + int discard_frame; +}; + + +/** + * Initializes an VP56Context. Expects its caller to clean up + * in case of error. + */ +int ff_vp56_init_context(AVCodecContext *avctx, VP56Context *s, + int flip, int has_alpha); +int ff_vp56_free_context(VP56Context *s); +void ff_vp56_init_dequant(VP56Context *s, int quantizer); +int ff_vp56_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt); + + +/** + * vp56 specific range coder implementation + */ + +static int vp56_rac_gets(VPXRangeCoder *c, int bits) +{ + int value = 0; + + while (bits--) { + value = (value << 1) | vpx_rac_get(c); + } + + return value; +} + +// P(7) +static av_unused int vp56_rac_gets_nn(VPXRangeCoder *c, int bits) +{ + int v = vp56_rac_gets(c, 7) << 1; + return v + !v; +} + +static av_always_inline +int vp56_rac_get_tree(VPXRangeCoder *c, + const VP56Tree *tree, + const uint8_t *probs) +{ + while (tree->val > 0) { + if (vpx_rac_get_prob_branchy(c, probs[tree->prob_idx])) + tree += tree->val; + else + tree++; + } + return -tree->val; +} + +#endif /* AVCODEC_VP56_H */ diff --git a/include/libavcodec/vp56data.h b/include/libavcodec/vp56data.h new file mode 100644 index 0000000..aaca1fd --- /dev/null +++ b/include/libavcodec/vp56data.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2006 Aurelien Jacobs + * + * 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 + */ + +/** + * @file + * VP5 and VP6 compatible video decoder (common data) + */ + +#ifndef AVCODEC_VP56DATA_H +#define AVCODEC_VP56DATA_H + +#include +#include "vp56.h" + +extern const uint8_t ff_vp56_b2p[]; +extern const uint8_t ff_vp56_b6to4[]; +extern const uint8_t ff_vp56_coeff_parse_table[6][11]; +extern const uint8_t ff_vp56_def_mb_types_stats[3][10][2]; +extern const VP56Tree ff_vp56_pva_tree[]; +extern const VP56Tree ff_vp56_pc_tree[]; +extern const uint8_t ff_vp56_coeff_bias[]; +extern const uint8_t ff_vp56_coeff_bit_length[]; + +extern const VP56Frame ff_vp56_reference_frame[]; +extern const uint8_t ff_vp56_ac_dequant[64]; +extern const uint8_t ff_vp56_dc_dequant[64]; +extern const uint8_t ff_vp56_pre_def_mb_type_stats[16][3][10][2]; +extern const uint8_t ff_vp56_filter_threshold[]; +extern const uint8_t ff_vp56_mb_type_model_model[]; +extern const VP56Tree ff_vp56_pmbtm_tree[]; +extern const VP56Tree ff_vp56_pmbt_tree[]; +extern const int8_t ff_vp56_candidate_predictor_pos[12][2]; + +#endif /* AVCODEC_VP56DATA_H */ diff --git a/include/libavcodec/vp56dsp.h b/include/libavcodec/vp56dsp.h new file mode 100644 index 0000000..e35e232 --- /dev/null +++ b/include/libavcodec/vp56dsp.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2010 Mans Rullgard + * + * 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_VP56DSP_H +#define AVCODEC_VP56DSP_H + +#include +#include + +typedef struct VP56DSPContext { + void (*edge_filter_hor)(uint8_t *yuv, ptrdiff_t stride, int t); + void (*edge_filter_ver)(uint8_t *yuv, ptrdiff_t stride, int t); + + void (*vp6_filter_diag4)(uint8_t *dst, uint8_t *src, ptrdiff_t stride, + const int16_t *h_weights,const int16_t *v_weights); +} VP56DSPContext; + +void ff_vp6_filter_diag4_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride, + const int16_t *h_weights, const int16_t *v_weights); + +void ff_vp5dsp_init(VP56DSPContext *s); +void ff_vp6dsp_init(VP56DSPContext *s); + +void ff_vp6dsp_init_arm(VP56DSPContext *s); +void ff_vp6dsp_init_x86(VP56DSPContext *s); + +#endif /* AVCODEC_VP56DSP_H */ diff --git a/include/libavcodec/vp5data.h b/include/libavcodec/vp5data.h new file mode 100644 index 0000000..e16ff2d --- /dev/null +++ b/include/libavcodec/vp5data.h @@ -0,0 +1,177 @@ +/* + * Copyright (C) 2006 Aurelien Jacobs + * + * 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 + */ + +/** + * @file + * VP5 compatible video decoder + */ + +#ifndef AVCODEC_VP5DATA_H +#define AVCODEC_VP5DATA_H + +#include + +static const uint8_t vp5_coeff_groups[] = { + -1, 0, 1, 1, 2, 1, 1, 2, + 2, 1, 1, 2, 2, 2, 1, 2, + 2, 2, 2, 2, 1, 1, 2, 2, + 3, 3, 4, 3, 4, 4, 4, 3, + 3, 3, 3, 3, 4, 3, 3, 3, + 4, 4, 4, 4, 4, 3, 3, 4, + 4, 4, 3, 4, 4, 4, 4, 4, + 4, 4, 5, 5, 5, 5, 5, 5, +}; + +static const uint8_t vp5_vmc_pct[2][11] = { + { 243, 220, 251, 253, 237, 232, 241, 245, 247, 251, 253 }, + { 235, 211, 246, 249, 234, 231, 248, 249, 252, 252, 254 }, +}; + +static const uint8_t vp5_dccv_pct[2][11] = { + { 146, 197, 181, 207, 232, 243, 238, 251, 244, 250, 249 }, + { 179, 219, 214, 240, 250, 254, 244, 254, 254, 254, 254 }, +}; + +static const uint8_t vp5_ract_pct[3][2][6][11] = { + { { { 227, 246, 230, 247, 244, 254, 254, 254, 254, 254, 254 }, + { 202, 254, 209, 231, 231, 249, 249, 253, 254, 254, 254 }, + { 206, 254, 225, 242, 241, 251, 253, 254, 254, 254, 254 }, + { 235, 254, 241, 253, 252, 254, 254, 254, 254, 254, 254 }, + { 234, 254, 248, 254, 254, 254, 254, 254, 254, 254, 254 }, + { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 } }, + { { 240, 254, 248, 254, 254, 254, 254, 254, 254, 254, 254 }, + { 238, 254, 240, 253, 254, 254, 254, 254, 254, 254, 254 }, + { 244, 254, 251, 254, 254, 254, 254, 254, 254, 254, 254 }, + { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 }, + { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 }, + { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 } } }, + { { { 206, 203, 227, 239, 247, 254, 253, 254, 254, 254, 254 }, + { 207, 199, 220, 236, 243, 252, 252, 254, 254, 254, 254 }, + { 212, 219, 230, 243, 244, 253, 252, 254, 254, 254, 254 }, + { 236, 237, 247, 252, 253, 254, 254, 254, 254, 254, 254 }, + { 240, 240, 248, 254, 254, 254, 254, 254, 254, 254, 254 }, + { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 } }, + { { 230, 233, 249, 254, 254, 254, 254, 254, 254, 254, 254 }, + { 238, 238, 250, 254, 254, 254, 254, 254, 254, 254, 254 }, + { 248, 251, 254, 254, 254, 254, 254, 254, 254, 254, 254 }, + { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 }, + { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 }, + { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 } } }, + { { { 225, 239, 227, 231, 244, 253, 243, 254, 254, 253, 254 }, + { 232, 234, 224, 228, 242, 249, 242, 252, 251, 251, 254 }, + { 235, 249, 238, 240, 251, 254, 249, 254, 253, 253, 254 }, + { 249, 253, 251, 250, 254, 254, 254, 254, 254, 254, 254 }, + { 251, 250, 249, 254, 254, 254, 254, 254, 254, 254, 254 }, + { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 } }, + { { 243, 244, 250, 250, 254, 254, 254, 254, 254, 254, 254 }, + { 249, 248, 250, 253, 254, 254, 254, 254, 254, 254, 254 }, + { 253, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 }, + { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 }, + { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 }, + { 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254 } } }, +}; + +static const int16_t vp5_dccv_lc[5][36][2] = { + { {154, 61}, {141, 54}, { 90, 45}, { 54, 34}, { 54, 13}, {128, 109}, + {136, 54}, {148, 45}, { 92, 41}, { 54, 33}, { 51, 15}, { 87, 113}, + { 87, 44}, { 97, 40}, { 67, 36}, { 46, 29}, { 41, 15}, { 64, 80}, + { 59, 33}, { 61, 31}, { 51, 28}, { 44, 22}, { 33, 12}, { 49, 63}, + { 69, 12}, { 59, 16}, { 46, 14}, { 31, 13}, { 26, 6}, { 92, 26}, + {128, 108}, { 77, 119}, { 54, 84}, { 26, 71}, { 87, 19}, { 95, 155} }, + { {154, 4}, {182, 0}, {159, -8}, {128, -5}, {143, -5}, {187, 55}, + {182, 0}, {228, -3}, {187, -7}, {174, -9}, {189, -11}, {169, 79}, + {161, -9}, {192, -8}, {187, -9}, {169, -10}, {136, -9}, {184, 40}, + {164, -11}, {179, -10}, {174, -10}, {161, -10}, {115, -7}, {197, 20}, + {195, -11}, {195, -11}, {146, -10}, {110, -6}, { 95, -4}, {195, 39}, + {182, 55}, {172, 77}, {177, 37}, {169, 29}, {172, 52}, { 92, 162} }, + { {174, 80}, {164, 80}, { 95, 80}, { 46, 66}, { 56, 24}, { 36, 193}, + {164, 80}, {166, 77}, {105, 76}, { 49, 68}, { 46, 31}, { 49, 186}, + { 97, 78}, {110, 74}, { 72, 72}, { 44, 60}, { 33, 30}, { 69, 131}, + { 61, 61}, { 69, 63}, { 51, 57}, { 31, 48}, { 26, 27}, { 64, 89}, + { 67, 23}, { 51, 32}, { 36, 33}, { 26, 28}, { 20, 12}, { 44, 68}, + { 26, 197}, { 41, 189}, { 61, 129}, { 28, 103}, { 49, 52}, {-12, 245} }, + { {102, 141}, { 79, 166}, { 72, 162}, { 97, 125}, {179, 4}, {307, 0}, + { 72, 168}, { 69, 175}, { 84, 160}, {105, 127}, {148, 34}, {310, 0}, + { 84, 151}, { 82, 161}, { 87, 153}, { 87, 135}, {115, 51}, {317, 0}, + { 97, 125}, {102, 131}, {105, 125}, { 87, 122}, { 84, 64}, { 54, 184}, + {166, 18}, {146, 43}, {125, 51}, { 90, 64}, { 95, 7}, { 38, 154}, + {294, 0}, { 13, 225}, { 10, 225}, { 67, 168}, { 0, 167}, {161, 94} }, + { {172, 76}, {172, 75}, {136, 80}, { 64, 98}, { 74, 67}, {315, 0}, + {169, 76}, {207, 56}, {164, 66}, { 97, 80}, { 67, 72}, {328, 0}, + {136, 80}, {187, 53}, {154, 62}, { 72, 85}, { -2, 105}, {305, 0}, + { 74, 91}, {128, 64}, {113, 64}, { 61, 77}, { 41, 75}, {259, 0}, + { 46, 84}, { 51, 81}, { 28, 89}, { 31, 78}, { 23, 77}, {202, 0}, + {323, 0}, {323, 0}, {300, 0}, {236, 0}, {195, 0}, {328, 0} }, +}; + +static const int16_t vp5_ract_lc[3][3][5][6][2] = { + { { { {276, 0}, {238, 0}, {195, 0}, {156, 0}, {113, 0}, {274, 0} }, + { { 0, 1}, { 0, 1}, { 0, 1}, { 0, 1}, { 0, 1}, { 0, 1} }, + { {192, 59}, {182, 50}, {141, 48}, {110, 40}, { 92, 19}, {125,128} }, + { {169, 87}, {169, 83}, {184, 62}, {220, 16}, {184, 0}, {264, 0} }, + { {212, 40}, {212, 36}, {169, 49}, {174, 27}, { 8,120}, {182, 71} } }, + { { {259, 10}, {197, 19}, {143, 22}, {123, 16}, {110, 8}, {133, 88} }, + { { 0, 1}, {256, 0}, { 0, 1}, { 0, 1}, { 0, 1}, { 0, 1} }, + { {207, 46}, {187, 50}, { 97, 83}, { 23,100}, { 41, 56}, { 56,188} }, + { {166, 90}, {146,108}, {161, 88}, {136, 95}, {174, 0}, {266, 0} }, + { {264, 7}, {243, 18}, {184, 43}, {-14,154}, { 20,112}, { 20,199} } }, + { { {230, 26}, {197, 22}, {159, 20}, {146, 12}, {136, 4}, { 54,162} }, + { { 0, 1}, { 0, 1}, { 0, 1}, { 0, 1}, { 0, 1}, { 0, 1} }, + { {192, 59}, {156, 72}, { 84,101}, { 49,101}, { 79, 47}, { 79,167} }, + { {138,115}, {136,116}, {166, 80}, {238, 0}, {195, 0}, {261, 0} }, + { {225, 33}, {205, 42}, {159, 61}, { 79, 96}, { 92, 66}, { 28,195} } }, + }, { + { { {200, 37}, {197, 18}, {159, 13}, {143, 7}, {102, 5}, {123,126} }, + { {197, 3}, {220, -9}, {210,-12}, {187, -6}, {151, -2}, {174, 80} }, + { {200, 53}, {187, 47}, {159, 40}, {118, 38}, {100, 18}, {141,111} }, + { {179, 78}, {166, 86}, {197, 50}, {207, 27}, {187, 0}, {115,139} }, + { {218, 34}, {220, 29}, {174, 46}, {128, 61}, { 54, 89}, {187, 65} } }, + { { {238, 14}, {197, 18}, {125, 26}, { 90, 25}, { 82, 13}, {161, 86} }, + { {189, 1}, {205, -2}, {156, -4}, {143, -4}, {146, -4}, {172, 72} }, + { {230, 31}, {192, 45}, {102, 76}, { 38, 85}, { 56, 41}, { 64,173} }, + { {166, 91}, {141,111}, {128,116}, {118,109}, {177, 0}, { 23,222} }, + { {253, 14}, {236, 21}, {174, 49}, { 33,118}, { 44, 93}, { 23,187} } }, + { { {218, 28}, {179, 28}, {118, 35}, { 95, 30}, { 72, 24}, {128,108} }, + { {187, 1}, {174, -1}, {125, -1}, {110, -1}, {108, -1}, {202, 52} }, + { {197, 53}, {146, 75}, { 46,118}, { 33,103}, { 64, 50}, {118,126} }, + { {138,114}, {128,122}, {161, 86}, {243, -6}, {195, 0}, { 38,210} }, + { {215, 39}, {179, 58}, { 97,101}, { 95, 85}, { 87, 70}, { 69,152} } }, + }, { + { { {236, 24}, {205, 18}, {172, 12}, {154, 6}, {125, 1}, {169, 75} }, + { {187, 4}, {230, -2}, {228, -4}, {236, -4}, {241, -2}, {192, 66} }, + { {200, 46}, {187, 42}, {159, 34}, {136, 25}, {105, 10}, {179, 62} }, + { {207, 55}, {192, 63}, {192, 54}, {195, 36}, {177, 1}, {143, 98} }, + { {225, 27}, {207, 34}, {200, 30}, {131, 57}, { 97, 60}, {197, 45} } }, + { { {271, 8}, {218, 13}, {133, 19}, { 90, 19}, { 72, 7}, {182, 51} }, + { {179, 1}, {225, -1}, {154, -2}, {110, -1}, { 92, 0}, {195, 41} }, + { {241, 26}, {189, 40}, { 82, 64}, { 33, 60}, { 67, 17}, {120, 94} }, + { {192, 68}, {151, 94}, {146, 90}, {143, 72}, {161, 0}, {113,128} }, + { {256, 12}, {218, 29}, {166, 48}, { 44, 99}, { 31, 87}, {148, 78} } }, + { { {238, 20}, {184, 22}, {113, 27}, { 90, 22}, { 74, 9}, {192, 37} }, + { {184, 0}, {215, -1}, {141, -1}, { 97, 0}, { 49, 0}, {264, 13} }, + { {182, 51}, {138, 61}, { 95, 63}, { 54, 59}, { 64, 25}, {200, 45} }, + { {179, 75}, {156, 87}, {174, 65}, {177, 44}, {174, 0}, {164, 85} }, + { {195, 45}, {148, 65}, {105, 79}, { 95, 72}, { 87, 60}, {169, 63} } }, + } +}; + +static const uint8_t vp5_coord_div[] = { 2, 2, 2, 2, 4, 4 }; + +#endif /* AVCODEC_VP5DATA_H */ diff --git a/include/libavcodec/vp6data.h b/include/libavcodec/vp6data.h new file mode 100644 index 0000000..539e19a --- /dev/null +++ b/include/libavcodec/vp6data.h @@ -0,0 +1,312 @@ +/* + * Copyright (C) 2006 Aurelien Jacobs + * + * 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 + */ + +/** + * @file + * VP6 compatible video decoder + */ + +#ifndef AVCODEC_VP6DATA_H +#define AVCODEC_VP6DATA_H + +#include + +#include "vp56.h" + +static const uint8_t vp6_def_fdv_vector_model[2][8] = { + { 247, 210, 135, 68, 138, 220, 239, 246 }, + { 244, 184, 201, 44, 173, 221, 239, 253 }, +}; + +static const uint8_t vp6_def_pdv_vector_model[2][7] = { + { 225, 146, 172, 147, 214, 39, 156 }, + { 204, 170, 119, 235, 140, 230, 228 }, +}; + +static const uint8_t vp6_def_coeff_reorder[] = { + 0, 0, 1, 1, 1, 2, 2, 2, + 2, 2, 2, 3, 3, 4, 4, 4, + 5, 5, 5, 5, 6, 6, 7, 7, + 7, 7, 7, 8, 8, 9, 9, 9, + 9, 9, 9, 10, 10, 11, 11, 11, + 11, 11, 11, 12, 12, 12, 12, 12, + 12, 13, 13, 13, 13, 13, 14, 14, + 14, 14, 15, 15, 15, 15, 15, 15, +}; + +static const uint8_t vp6_def_runv_coeff_model[2][14] = { + { 198, 197, 196, 146, 198, 204, 169, 142, 130, 136, 149, 149, 191, 249 }, + { 135, 201, 181, 154, 98, 117, 132, 126, 146, 169, 184, 240, 246, 254 }, +}; + +static const uint8_t vp6_sig_dct_pct[2][2] = { + { 237, 246 }, + { 231, 243 }, +}; + +static const uint8_t vp6_pdv_pct[2][7] = { + { 253, 253, 254, 254, 254, 254, 254 }, + { 245, 253, 254, 254, 254, 254, 254 }, +}; + +static const uint8_t vp6_fdv_pct[2][8] = { + { 254, 254, 254, 254, 254, 250, 250, 252 }, + { 254, 254, 254, 254, 254, 251, 251, 254 }, +}; + +static const uint8_t vp6_dccv_pct[2][11] = { + { 146, 255, 181, 207, 232, 243, 238, 251, 244, 250, 249 }, + { 179, 255, 214, 240, 250, 255, 244, 255, 255, 255, 255 }, +}; + +static const uint8_t vp6_coeff_reorder_pct[] = { + 255, 132, 132, 159, 153, 151, 161, 170, + 164, 162, 136, 110, 103, 114, 129, 118, + 124, 125, 132, 136, 114, 110, 142, 135, + 134, 123, 143, 126, 153, 183, 166, 161, + 171, 180, 179, 164, 203, 218, 225, 217, + 215, 206, 203, 217, 229, 241, 248, 243, + 253, 255, 253, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, +}; + +static const uint8_t vp6_runv_pct[2][14] = { + { 219, 246, 238, 249, 232, 239, 249, 255, 248, 253, 239, 244, 241, 248 }, + { 198, 232, 251, 253, 219, 241, 253, 255, 248, 249, 244, 238, 251, 255 }, +}; + +static const uint8_t vp6_ract_pct[3][2][6][11] = { + { { { 227, 246, 230, 247, 244, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 209, 231, 231, 249, 249, 253, 255, 255, 255 }, + { 255, 255, 225, 242, 241, 251, 253, 255, 255, 255, 255 }, + { 255, 255, 241, 253, 252, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 248, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } }, + { { 240, 255, 248, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 240, 253, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } } }, + { { { 206, 203, 227, 239, 247, 255, 253, 255, 255, 255, 255 }, + { 207, 199, 220, 236, 243, 252, 252, 255, 255, 255, 255 }, + { 212, 219, 230, 243, 244, 253, 252, 255, 255, 255, 255 }, + { 236, 237, 247, 252, 253, 255, 255, 255, 255, 255, 255 }, + { 240, 240, 248, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } }, + { { 230, 233, 249, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 238, 238, 250, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 248, 251, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } } }, + { { { 225, 239, 227, 231, 244, 253, 243, 255, 255, 253, 255 }, + { 232, 234, 224, 228, 242, 249, 242, 252, 251, 251, 255 }, + { 235, 249, 238, 240, 251, 255, 249, 255, 253, 253, 255 }, + { 249, 253, 251, 250, 255, 255, 255, 255, 255, 255, 255 }, + { 251, 250, 249, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } }, + { { 243, 244, 250, 250, 255, 255, 255, 255, 255, 255, 255 }, + { 249, 248, 250, 253, 255, 255, 255, 255, 255, 255, 255 }, + { 253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }, + { 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 } } } +}; + +static const int vp6_dccv_lc[3][5][2] = { + { { 122, 133 }, { 0, 1 }, { 78, 171 }, { 139, 117 }, { 168, 79 } }, + { { 133, 51 }, { 0, 1 }, { 169, 71 }, { 214, 44 }, { 210, 38 } }, + { { 142, -16 }, { 0, 1 }, { 221, -30 }, { 246, -3 }, { 203, 17 } }, +}; + +static const uint8_t vp6_coeff_groups[] = { + 0, 0, 1, 1, 1, 2, 2, 2, + 2, 2, 2, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, +}; + +static const int16_t vp6_block_copy_filter[17][8][4] = { + { { 0, 128, 0, 0 }, /* 0 */ + { -3, 122, 9, 0 }, + { -4, 109, 24, -1 }, + { -5, 91, 45, -3 }, + { -4, 68, 68, -4 }, + { -3, 45, 91, -5 }, + { -1, 24, 109, -4 }, + { 0, 9, 122, -3 } }, + { { 0, 128, 0, 0 }, /* 1 */ + { -4, 124, 9, -1 }, + { -5, 110, 25, -2 }, + { -6, 91, 46, -3 }, + { -5, 69, 69, -5 }, + { -3, 46, 91, -6 }, + { -2, 25, 110, -5 }, + { -1, 9, 124, -4 } }, + { { 0, 128, 0, 0 }, /* 2 */ + { -4, 123, 10, -1 }, + { -6, 110, 26, -2 }, + { -7, 92, 47, -4 }, + { -6, 70, 70, -6 }, + { -4, 47, 92, -7 }, + { -2, 26, 110, -6 }, + { -1, 10, 123, -4 } }, + { { 0, 128, 0, 0 }, /* 3 */ + { -5, 124, 10, -1 }, + { -7, 110, 27, -2 }, + { -7, 91, 48, -4 }, + { -6, 70, 70, -6 }, + { -4, 48, 92, -8 }, + { -2, 27, 110, -7 }, + { -1, 10, 124, -5 } }, + { { 0, 128, 0, 0 }, /* 4 */ + { -6, 124, 11, -1 }, + { -8, 111, 28, -3 }, + { -8, 92, 49, -5 }, + { -7, 71, 71, -7 }, + { -5, 49, 92, -8 }, + { -3, 28, 111, -8 }, + { -1, 11, 124, -6 } }, + { { 0, 128, 0, 0 }, /* 5 */ + { -6, 123, 12, -1 }, + { -9, 111, 29, -3 }, + { -9, 93, 50, -6 }, + { -8, 72, 72, -8 }, + { -6, 50, 93, -9 }, + { -3, 29, 111, -9 }, + { -1, 12, 123, -6 } }, + { { 0, 128, 0, 0 }, /* 6 */ + { -7, 124, 12, -1 }, + { -10, 111, 30, -3 }, + { -10, 93, 51, -6 }, + { -9, 73, 73, -9 }, + { -6, 51, 93, -10 }, + { -3, 30, 111, -10 }, + { -1, 12, 124, -7 } }, + { { 0, 128, 0, 0 }, /* 7 */ + { -7, 123, 13, -1 }, + { -11, 112, 31, -4 }, + { -11, 94, 52, -7 }, + { -10, 74, 74, -10 }, + { -7, 52, 94, -11 }, + { -4, 31, 112, -11 }, + { -1, 13, 123, -7 } }, + { { 0, 128, 0, 0 }, /* 8 */ + { -8, 124, 13, -1 }, + { -12, 112, 32, -4 }, + { -12, 94, 53, -7 }, + { -10, 74, 74, -10 }, + { -7, 53, 94, -12 }, + { -4, 32, 112, -12 }, + { -1, 13, 124, -8 } }, + { { 0, 128, 0, 0 }, /* 9 */ + { -9, 124, 14, -1 }, + { -13, 112, 33, -4 }, + { -13, 95, 54, -8 }, + { -11, 75, 75, -11 }, + { -8, 54, 95, -13 }, + { -4, 33, 112, -13 }, + { -1, 14, 124, -9 } }, + { { 0, 128, 0, 0 }, /* 10 */ + { -9, 123, 15, -1 }, + { -14, 113, 34, -5 }, + { -14, 95, 55, -8 }, + { -12, 76, 76, -12 }, + { -8, 55, 95, -14 }, + { -5, 34, 112, -13 }, + { -1, 15, 123, -9 } }, + { { 0, 128, 0, 0 }, /* 11 */ + { -10, 124, 15, -1 }, + { -14, 113, 34, -5 }, + { -15, 96, 56, -9 }, + { -13, 77, 77, -13 }, + { -9, 56, 96, -15 }, + { -5, 34, 113, -14 }, + { -1, 15, 124, -10 } }, + { { 0, 128, 0, 0 }, /* 12 */ + { -10, 123, 16, -1 }, + { -15, 113, 35, -5 }, + { -16, 98, 56, -10 }, + { -14, 78, 78, -14 }, + { -10, 56, 98, -16 }, + { -5, 35, 113, -15 }, + { -1, 16, 123, -10 } }, + { { 0, 128, 0, 0 }, /* 13 */ + { -11, 124, 17, -2 }, + { -16, 113, 36, -5 }, + { -17, 98, 57, -10 }, + { -14, 78, 78, -14 }, + { -10, 57, 98, -17 }, + { -5, 36, 113, -16 }, + { -2, 17, 124, -11 } }, + { { 0, 128, 0, 0 }, /* 14 */ + { -12, 125, 17, -2 }, + { -17, 114, 37, -6 }, + { -18, 99, 58, -11 }, + { -15, 79, 79, -15 }, + { -11, 58, 99, -18 }, + { -6, 37, 114, -17 }, + { -2, 17, 125, -12 } }, + { { 0, 128, 0, 0 }, /* 15 */ + { -12, 124, 18, -2 }, + { -18, 114, 38, -6 }, + { -19, 99, 59, -11 }, + { -16, 80, 80, -16 }, + { -11, 59, 99, -19 }, + { -6, 38, 114, -18 }, + { -2, 18, 124, -12 } }, + { { 0, 128, 0, 0 }, /* 16 */ + { -4, 118, 16, -2 }, + { -7, 106, 34, -5 }, + { -8, 90, 53, -7 }, + { -8, 72, 72, -8 }, + { -7, 53, 90, -8 }, + { -5, 34, 106, -7 }, + { -2, 16, 118, -4 } }, +}; + +static const VP56Tree vp6_pcr_tree[] = { + { 8, 0}, + { 4, 1}, + { 2, 2}, {-1}, {-2}, + { 2, 3}, {-3}, {-4}, + { 8, 4}, + { 4, 5}, + { 2, 6}, {-5}, {-6}, + { 2, 7}, {-7}, {-8}, + {-0}, +}; + +static const uint8_t vp6_coord_div[] = { 4, 4, 4, 4, 8, 8 }; + +static const uint8_t vp6_huff_coeff_map[] = { + 13, 14, 11, 0, 1, 15, 16, 18, 2, 17, 3, 4, 19, 20, 5, 6, 21, 22, 7, 8, 9, 10 +}; + +static const uint8_t vp6_huff_run_map[] = { + 10, 13, 11, 12, 0, 1, 2, 3, 14, 8, 15, 16, 4, 5, 6, 7 +}; + +#endif /* AVCODEC_VP6DATA_H */ diff --git a/include/libavcodec/vp8.h b/include/libavcodec/vp8.h new file mode 100644 index 0000000..9bdef0a --- /dev/null +++ b/include/libavcodec/vp8.h @@ -0,0 +1,358 @@ +/* + * VP8 compatible video decoder + * + * Copyright (C) 2010 David Conrad + * Copyright (C) 2010 Ronald S. Bultje + * Copyright (C) 2010 Fiona Glaser + * Copyright (C) 2012 Daniel Kang + * + * 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_VP8_H +#define AVCODEC_VP8_H + +#include + +#include "libavutil/mem_internal.h" +#include "libavutil/thread.h" + +#include "avcodec.h" +#include "h264pred.h" +#include "progressframe.h" +#include "videodsp.h" +#include "vp8dsp.h" +#include "vpx_rac.h" + +#define VP8_MAX_QUANT 127 + +typedef enum { + VP8_FRAME_NONE = -1, + VP8_FRAME_CURRENT = 0, + VP8_FRAME_PREVIOUS = 1, + VP8_FRAME_GOLDEN = 2, + VP8_FRAME_ALTREF = 3, +} VP8FrameType; + +enum dct_token { + DCT_0, + DCT_1, + DCT_2, + DCT_3, + DCT_4, + DCT_CAT1, + DCT_CAT2, + DCT_CAT3, + DCT_CAT4, + DCT_CAT5, + DCT_CAT6, + DCT_EOB, + + NUM_DCT_TOKENS +}; + +// used to signal 4x4 intra pred in luma MBs +#define MODE_I4x4 4 + +enum inter_mvmode { + VP8_MVMODE_ZERO = MODE_I4x4 + 1, + VP8_MVMODE_MV, + VP8_MVMODE_SPLIT +}; + +enum inter_splitmvmode { + VP8_SPLITMVMODE_16x8 = 0, ///< 2 16x8 blocks (vertical) + VP8_SPLITMVMODE_8x16, ///< 2 8x16 blocks (horizontal) + VP8_SPLITMVMODE_8x8, ///< 2x2 blocks of 8x8px each + VP8_SPLITMVMODE_4x4, ///< 4x4 blocks of 4x4px each + VP8_SPLITMVMODE_NONE, ///< (only used in prediction) no split MVs +}; + +typedef struct VP8mv { + DECLARE_ALIGNED(4, int16_t, x); + int16_t y; +} VP8mv; + +typedef struct VP8FilterStrength { + uint8_t filter_level; + uint8_t inner_limit; + uint8_t inner_filter; +} VP8FilterStrength; + +typedef struct VP8Macroblock { + uint8_t skip; + // TODO: make it possible to check for at least (i4x4 or split_mv) + // in one op. are others needed? + uint8_t mode; + uint8_t ref_frame; + uint8_t partitioning; + uint8_t chroma_pred_mode; + uint8_t segment; + uint8_t intra4x4_pred_mode_mb[16]; + DECLARE_ALIGNED(4, uint8_t, intra4x4_pred_mode_top)[4]; + VP8mv mv; + VP8mv bmv[16]; +} VP8Macroblock; + +typedef struct VP8intmv { + int x; + int y; +} VP8intmv; + +typedef struct VP8mvbounds { + VP8intmv mv_min; + VP8intmv mv_max; +} VP8mvbounds; + +typedef struct VP8ThreadData { + DECLARE_ALIGNED(16, int16_t, block)[6][4][16]; + DECLARE_ALIGNED(16, int16_t, block_dc)[16]; + /** + * This is the index plus one of the last non-zero coeff + * for each of the blocks in the current macroblock. + * So, 0 -> no coeffs + * 1 -> dc-only (special transform) + * 2+-> full transform + */ + DECLARE_ALIGNED(16, uint8_t, non_zero_count_cache)[6][4]; + /** + * For coeff decode, we need to know whether the above block had non-zero + * coefficients. This means for each macroblock, we need data for 4 luma + * blocks, 2 u blocks, 2 v blocks, and the luma dc block, for a total of 9 + * per macroblock. We keep the last row in top_nnz. + */ + DECLARE_ALIGNED(8, uint8_t, left_nnz)[9]; + int thread_nr; +#if HAVE_THREADS + pthread_mutex_t lock; + pthread_cond_t cond; +#endif + atomic_int thread_mb_pos; // (mb_y << 16) | (mb_x & 0xFFFF) + atomic_int wait_mb_pos; // What the current thread is waiting on. + +#define EDGE_EMU_LINESIZE 32 + DECLARE_ALIGNED(16, uint8_t, edge_emu_buffer)[21 * EDGE_EMU_LINESIZE]; + VP8FilterStrength *filter_strength; + VP8mvbounds mv_bounds; +} VP8ThreadData; + +typedef struct VP8Frame { + ProgressFrame tf; + uint8_t *seg_map; ///< RefStruct reference + + void *hwaccel_picture_private; ///< RefStruct reference +} VP8Frame; + +#define MAX_THREADS 8 +typedef struct VP8Context { + VP8ThreadData *thread_data; + AVCodecContext *avctx; + enum AVPixelFormat pix_fmt; + int actually_webp; + + VP8Frame *framep[4]; + VP8Frame *next_framep[4]; + VP8Frame *curframe; + VP8Frame *prev_frame; + + uint16_t mb_width; /* number of horizontal MB */ + uint16_t mb_height; /* number of vertical MB */ + ptrdiff_t linesize; + ptrdiff_t uvlinesize; + + uint8_t keyframe; + uint8_t deblock_filter; + uint8_t mbskip_enabled; + uint8_t profile; + VP8mvbounds mv_bounds; + + int8_t sign_bias[4]; ///< one state [0, 1] per ref frame type + int ref_count[3]; + + /** + * Base parameters for segmentation, i.e. per-macroblock parameters. + * These must be kept unchanged even if segmentation is not used for + * a frame, since the values persist between interframes. + */ + struct { + uint8_t enabled; + uint8_t absolute_vals; + uint8_t update_map; + uint8_t update_feature_data; + int8_t base_quant[4]; + int8_t filter_level[4]; ///< base loop filter level + } segmentation; + + struct { + uint8_t simple; + uint8_t level; + uint8_t sharpness; + } filter; + + VP8Macroblock *macroblocks; + + uint8_t *intra4x4_pred_mode_top; + uint8_t intra4x4_pred_mode_left[4]; + + /** + * Macroblocks can have one of 4 different quants in a frame when + * segmentation is enabled. + * If segmentation is disabled, only the first segment's values are used. + */ + struct { + // [0] - DC qmul [1] - AC qmul + int16_t luma_qmul[2]; + int16_t luma_dc_qmul[2]; ///< luma dc-only block quant + int16_t chroma_qmul[2]; + } qmat[4]; + + // Raw quantisation values, which may be needed by hwaccel decode. + struct { + int yac_qi; + int ydc_delta; + int y2dc_delta; + int y2ac_delta; + int uvdc_delta; + int uvac_delta; + } quant; + + struct { + uint8_t enabled; ///< whether each mb can have a different strength based on mode/ref + uint8_t update; + + /** + * filter strength adjustment for the following macroblock modes: + * [0-3] - i16x16 (always zero) + * [4] - i4x4 + * [5] - zero mv + * [6] - inter modes except for zero or split mv + * [7] - split mv + * i16x16 modes never have any adjustment + */ + int8_t mode[VP8_MVMODE_SPLIT + 1]; + + /** + * filter strength adjustment for macroblocks that reference: + * [0] - intra / VP8_FRAME_CURRENT + * [1] - VP8_FRAME_PREVIOUS + * [2] - VP8_FRAME_GOLDEN + * [3] - altref / VP8_FRAME_ALTREF + */ + int8_t ref[4]; + } lf_delta; + + uint8_t (*top_border)[16 + 8 + 8]; + uint8_t (*top_nnz)[9]; + + VPXRangeCoder c; ///< header context, includes mb modes and motion vectors + + /* This contains the entropy coder state at the end of the header + * block, in the form specified by the standard. For use by + * hwaccels, so that a hardware decoder has the information to + * start decoding at the macroblock layer. + */ + struct { + const uint8_t *input; + uint32_t range; + uint32_t value; + int bit_count; + } coder_state_at_header_end; + + int header_partition_size; + + /** + * These are all of the updatable probabilities for binary decisions. + * They are only implicitly reset on keyframes, making it quite likely + * for an interframe to desync if a prior frame's header was corrupt + * or missing outright! + */ + struct { + uint8_t segmentid[3]; + uint8_t mbskip; + uint8_t intra; + uint8_t last; + uint8_t golden; + uint8_t pred16x16[4]; + uint8_t pred8x8c[3]; + uint8_t token[4][16][3][NUM_DCT_TOKENS - 1]; + uint8_t mvc[2][19]; + uint8_t scan[16]; + } prob[2]; + + VP8Macroblock *macroblocks_base; + int invisible; + int update_last; ///< update VP8_FRAME_PREVIOUS with the current one + int update_golden; ///< VP8_FRAME_NONE if not updated, or which frame to copy if so + int update_altref; + + /** + * If this flag is not set, all the probability updates + * are discarded after this frame is decoded. + */ + int update_probabilities; + + /** + * All coefficients are contained in separate arith coding contexts. + * There can be 1, 2, 4, or 8 of these after the header context. + */ + int num_coeff_partitions; + VPXRangeCoder coeff_partition[8]; + int coeff_partition_size[8]; + VideoDSPContext vdsp; + VP8DSPContext vp8dsp; + H264PredContext hpc; + vp8_mc_func put_pixels_tab[3][3][3]; + VP8Frame frames[5]; + + uint8_t colorspace; ///< 0 is the only value allowed (meaning bt601) + uint8_t fullrange; ///< whether we can skip clamping in dsp functions + + int num_jobs; + /** + * This describes the macroblock memory layout. + * 0 -> Only width+height*2+1 macroblocks allocated (frame/single thread). + * 1 -> Macroblocks for entire frame allocated (sliced thread). + */ + int mb_layout; + + int (*decode_mb_row_no_filter)(AVCodecContext *avctx, void *tdata, int jobnr, int threadnr); + void (*filter_mb_row)(AVCodecContext *avctx, void *tdata, int jobnr, int threadnr); + + /** + * Interframe DC prediction (VP7) + * [0] VP8_FRAME_PREVIOUS + * [1] VP8_FRAME_GOLDEN + */ + uint16_t inter_dc_pred[2][2]; + + /** + * Macroblock features (VP7) + */ + uint8_t feature_enabled[4]; + uint8_t feature_present_prob[4]; + uint8_t feature_index_prob[4][3]; + uint8_t feature_value[4][4]; +} VP8Context; + +int ff_vp8_decode_init(AVCodecContext *avctx); + +int ff_vp8_decode_frame(AVCodecContext *avctx, AVFrame *frame, + int *got_frame, AVPacket *avpkt); + +int ff_vp8_decode_free(AVCodecContext *avctx); + +#endif /* AVCODEC_VP8_H */ diff --git a/include/libavcodec/vp89_rac.h b/include/libavcodec/vp89_rac.h new file mode 100644 index 0000000..bc0924c --- /dev/null +++ b/include/libavcodec/vp89_rac.h @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2006 Aurelien Jacobs + * + * 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 + */ + +/** + * @file + * Range decoder functions common to VP8 and VP9 + */ + +#ifndef AVCODEC_VP89_RAC_H +#define AVCODEC_VP89_RAC_H + +#include + +#include "libavutil/attributes.h" + +#include "vpx_rac.h" + +// rounding is different than vpx_rac_get, is vpx_rac_get wrong? +static av_always_inline int vp89_rac_get(VPXRangeCoder *c) +{ + return vpx_rac_get_prob(c, 128); +} + +static av_unused int vp89_rac_get_uint(VPXRangeCoder *c, int bits) +{ + int value = 0; + + while (bits--) { + value = (value << 1) | vp89_rac_get(c); + } + + return value; +} + +// how probabilities are associated with decisions is different I think +// well, the new scheme fits in the old but this way has one fewer branches per decision +static av_always_inline int vp89_rac_get_tree(VPXRangeCoder *c, const int8_t (*tree)[2], + const uint8_t *probs) +{ + int i = 0; + + do { + i = tree[i][vpx_rac_get_prob(c, probs[i])]; + } while (i > 0); + + return -i; +} + +#endif /* AVCODEC_VP89_RAC_H */ diff --git a/include/libavcodec/vp8data.h b/include/libavcodec/vp8data.h new file mode 100644 index 0000000..c8e79fd --- /dev/null +++ b/include/libavcodec/vp8data.h @@ -0,0 +1,637 @@ +/* + * Copyright (C) 2010 David Conrad + * Copyright (C) 2010 Ronald S. Bultje + * + * 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 + */ + +/** + * @file + * VP8 compatible video decoder + */ + +#ifndef AVCODEC_VP8DATA_H +#define AVCODEC_VP8DATA_H + +#include "vp8.h" +#include "h264pred.h" + +static const uint8_t vp7_pred4x4_mode[] = { + [DC_PRED8x8] = DC_PRED, + [VERT_PRED8x8] = TM_VP8_PRED, + [HOR_PRED8x8] = TM_VP8_PRED, + [PLANE_PRED8x8] = TM_VP8_PRED, +}; + +static const uint8_t vp8_pred4x4_mode[] = { + [DC_PRED8x8] = DC_PRED, + [VERT_PRED8x8] = VERT_PRED, + [HOR_PRED8x8] = HOR_PRED, + [PLANE_PRED8x8] = TM_VP8_PRED, +}; + +static const int8_t vp8_pred16x16_tree_intra[4][2] = { + { -MODE_I4x4, 1 }, // '0' + { 2, 3 }, + { -DC_PRED8x8, -VERT_PRED8x8 }, // '100', '101' + { -HOR_PRED8x8, -PLANE_PRED8x8 }, // '110', '111' +}; + +static const int8_t vp8_pred16x16_tree_inter[4][2] = { + { -DC_PRED8x8, 1 }, // '0' + { 2, 3 }, + { -VERT_PRED8x8, -HOR_PRED8x8 }, // '100', '101' + { -PLANE_PRED8x8, -MODE_I4x4 }, // '110', '111' +}; + +typedef struct VP7MVPred { + int8_t yoffset; + int8_t xoffset; + uint8_t subblock; + uint8_t score; +} VP7MVPred; + +#define VP7_MV_PRED_COUNT 12 +static const VP7MVPred vp7_mv_pred[VP7_MV_PRED_COUNT] = { + { -1, 0, 12, 8 }, + { 0, -1, 3, 8 }, + { -1, -1, 15, 2 }, + { -1, 1, 12, 2 }, + { -2, 0, 12, 2 }, + { 0, -2, 3, 2 }, + { -1, -2, 15, 1 }, + { -2, -1, 15, 1 }, + { -2, 1, 12, 1 }, + { -1, 2, 12, 1 }, + { -2, -2, 15, 1 }, + { -2, 2, 12, 1 }, +}; + +static const int vp7_mode_contexts[31][4] = { + { 3, 3, 1, 246 }, + { 7, 89, 66, 239 }, + { 10, 90, 78, 238 }, + { 14, 118, 95, 241 }, + { 14, 123, 106, 238 }, + { 20, 140, 109, 240 }, + { 13, 155, 103, 238 }, + { 21, 158, 99, 240 }, + { 27, 82, 108, 232 }, + { 19, 99, 123, 217 }, + { 45, 139, 148, 236 }, + { 50, 117, 144, 235 }, + { 57, 128, 164, 238 }, + { 69, 139, 171, 239 }, + { 74, 154, 179, 238 }, + { 112, 165, 186, 242 }, + { 98, 143, 185, 245 }, + { 105, 153, 190, 250 }, + { 124, 167, 192, 245 }, + { 131, 186, 203, 246 }, + { 59, 184, 222, 224 }, + { 148, 215, 214, 213 }, + { 137, 211, 210, 219 }, + { 190, 227, 128, 228 }, + { 183, 228, 128, 228 }, + { 194, 234, 128, 228 }, + { 202, 236, 128, 228 }, + { 205, 240, 128, 228 }, + { 205, 244, 128, 228 }, + { 225, 246, 128, 228 }, + { 233, 251, 128, 228 }, +}; + +static const int vp8_mode_contexts[6][4] = { + { 7, 1, 1, 143 }, + { 14, 18, 14, 107 }, + { 135, 64, 57, 68 }, + { 60, 56, 128, 65 }, + { 159, 134, 128, 34 }, + { 234, 188, 128, 28 }, +}; + +static const uint8_t vp8_mbsplits[5][16] = { + { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1 }, + { 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1 }, + { 0, 0, 1, 1, 0, 0, 1, 1, 2, 2, 3, 3, 2, 2, 3, 3 }, + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } +}; + +static const uint8_t vp8_mbfirstidx[4][16] = { + { 0, 8 }, + { 0, 2 }, + { 0, 2, 8, 10 }, + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } +}; + +static const uint8_t vp8_mbsplit_count[4] = { + 2, 2, 4, 16 +}; +static const uint8_t vp8_mbsplit_prob[3] = { + 110, 111, 150 +}; + +static const uint8_t vp7_submv_prob[3] = { + 180, 162, 25 +}; + +static const uint8_t vp8_submv_prob[5][3] = { + { 147, 136, 18 }, + { 106, 145, 1 }, + { 179, 121, 1 }, + { 223, 1, 34 }, + { 208, 1, 1 } +}; + +static const uint8_t vp8_pred16x16_prob_intra[4] = { + 145, 156, 163, 128 +}; +static const uint8_t vp8_pred16x16_prob_inter[4] = { + 112, 86, 140, 37 +}; + +static const int8_t vp8_pred4x4_tree[9][2] = { + { -DC_PRED, 1 }, // '0' + { -TM_VP8_PRED, 2 }, // '10' + { -VERT_PRED, 3 }, // '110' + { 4, 6 }, + { -HOR_PRED, 5 }, // '11100' + { -DIAG_DOWN_RIGHT_PRED, -VERT_RIGHT_PRED }, // '111010', '111011' + { -DIAG_DOWN_LEFT_PRED, 7 }, // '11110' + { -VERT_LEFT_PRED, 8 }, // '111110' + { -HOR_DOWN_PRED, -HOR_UP_PRED }, // '1111110', '1111111' +}; + +static const int8_t vp8_pred8x8c_tree[3][2] = { + { -DC_PRED8x8, 1 }, // '0' + { -VERT_PRED8x8, 2 }, // '10 + { -HOR_PRED8x8, -PLANE_PRED8x8 }, // '110', '111' +}; + +static const uint8_t vp8_pred8x8c_prob_intra[3] = { + 142, 114, 183 +}; +static const uint8_t vp8_pred8x8c_prob_inter[3] = { + 162, 101, 204 +}; +static const uint8_t vp8_pred4x4_prob_inter[9] = { + 120, 90, 79, 133, 87, 85, 80, 111, 151 +}; + +static const uint8_t vp8_pred4x4_prob_intra[10][10][9] = { + { + { 39, 53, 200, 87, 26, 21, 43, 232, 171 }, + { 56, 34, 51, 104, 114, 102, 29, 93, 77 }, + { 88, 88, 147, 150, 42, 46, 45, 196, 205 }, + { 107, 54, 32, 26, 51, 1, 81, 43, 31 }, + { 39, 28, 85, 171, 58, 165, 90, 98, 64 }, + { 34, 22, 116, 206, 23, 34, 43, 166, 73 }, + { 34, 19, 21, 102, 132, 188, 16, 76, 124 }, + { 68, 25, 106, 22, 64, 171, 36, 225, 114 }, + { 62, 18, 78, 95, 85, 57, 50, 48, 51 }, + { 43, 97, 183, 117, 85, 38, 35, 179, 61 }, + }, + { + { 112, 113, 77, 85, 179, 255, 38, 120, 114 }, + { 40, 42, 1, 196, 245, 209, 10, 25, 109 }, + { 193, 101, 35, 159, 215, 111, 89, 46, 111 }, + { 100, 80, 8, 43, 154, 1, 51, 26, 71 }, + { 88, 43, 29, 140, 166, 213, 37, 43, 154 }, + { 61, 63, 30, 155, 67, 45, 68, 1, 209 }, + { 41, 40, 5, 102, 211, 183, 4, 1, 221 }, + { 142, 78, 78, 16, 255, 128, 34, 197, 171 }, + { 51, 50, 17, 168, 209, 192, 23, 25, 82 }, + { 60, 148, 31, 172, 219, 228, 21, 18, 111 }, + }, + { + { 175, 69, 143, 80, 85, 82, 72, 155, 103 }, + { 56, 58, 10, 171, 218, 189, 17, 13, 152 }, + { 231, 120, 48, 89, 115, 113, 120, 152, 112 }, + { 144, 71, 10, 38, 171, 213, 144, 34, 26 }, + { 114, 26, 17, 163, 44, 195, 21, 10, 173 }, + { 121, 24, 80, 195, 26, 62, 44, 64, 85 }, + { 63, 20, 8, 114, 114, 208, 12, 9, 226 }, + { 170, 46, 55, 19, 136, 160, 33, 206, 71 }, + { 81, 40, 11, 96, 182, 84, 29, 16, 36 }, + { 152, 179, 64, 126, 170, 118, 46, 70, 95 }, + }, + { + { 75, 79, 123, 47, 51, 128, 81, 171, 1 }, + { 57, 17, 5, 71, 102, 57, 53, 41, 49 }, + { 125, 98, 42, 88, 104, 85, 117, 175, 82 }, + { 115, 21, 2, 10, 102, 255, 166, 23, 6 }, + { 38, 33, 13, 121, 57, 73, 26, 1, 85 }, + { 41, 10, 67, 138, 77, 110, 90, 47, 114 }, + { 57, 18, 10, 102, 102, 213, 34, 20, 43 }, + { 101, 29, 16, 10, 85, 128, 101, 196, 26 }, + { 117, 20, 15, 36, 163, 128, 68, 1, 26 }, + { 95, 84, 53, 89, 128, 100, 113, 101, 45 }, + }, + { + { 63, 59, 90, 180, 59, 166, 93, 73, 154 }, + { 40, 40, 21, 116, 143, 209, 34, 39, 175 }, + { 138, 31, 36, 171, 27, 166, 38, 44, 229 }, + { 57, 46, 22, 24, 128, 1, 54, 17, 37 }, + { 47, 15, 16, 183, 34, 223, 49, 45, 183 }, + { 46, 17, 33, 183, 6, 98, 15, 32, 183 }, + { 40, 3, 9, 115, 51, 192, 18, 6, 223 }, + { 65, 32, 73, 115, 28, 128, 23, 128, 205 }, + { 87, 37, 9, 115, 59, 77, 64, 21, 47 }, + { 67, 87, 58, 169, 82, 115, 26, 59, 179 }, + }, + { + { 54, 57, 112, 184, 5, 41, 38, 166, 213 }, + { 30, 34, 26, 133, 152, 116, 10, 32, 134 }, + { 104, 55, 44, 218, 9, 54, 53, 130, 226 }, + { 75, 32, 12, 51, 192, 255, 160, 43, 51 }, + { 39, 19, 53, 221, 26, 114, 32, 73, 255 }, + { 31, 9, 65, 234, 2, 15, 1, 118, 73 }, + { 56, 21, 23, 111, 59, 205, 45, 37, 192 }, + { 88, 31, 35, 67, 102, 85, 55, 186, 85 }, + { 55, 38, 70, 124, 73, 102, 1, 34, 98 }, + { 64, 90, 70, 205, 40, 41, 23, 26, 57 }, + }, + { + { 86, 40, 64, 135, 148, 224, 45, 183, 128 }, + { 22, 26, 17, 131, 240, 154, 14, 1, 209 }, + { 164, 50, 31, 137, 154, 133, 25, 35, 218 }, + { 83, 12, 13, 54, 192, 255, 68, 47, 28 }, + { 45, 16, 21, 91, 64, 222, 7, 1, 197 }, + { 56, 21, 39, 155, 60, 138, 23, 102, 213 }, + { 18, 11, 7, 63, 144, 171, 4, 4, 246 }, + { 85, 26, 85, 85, 128, 128, 32, 146, 171 }, + { 35, 27, 10, 146, 174, 171, 12, 26, 128 }, + { 51, 103, 44, 131, 131, 123, 31, 6, 158 }, + }, + { + { 68, 45, 128, 34, 1, 47, 11, 245, 171 }, + { 62, 17, 19, 70, 146, 85, 55, 62, 70 }, + { 102, 61, 71, 37, 34, 53, 31, 243, 192 }, + { 75, 15, 9, 9, 64, 255, 184, 119, 16 }, + { 37, 43, 37, 154, 100, 163, 85, 160, 1 }, + { 63, 9, 92, 136, 28, 64, 32, 201, 85 }, + { 56, 8, 17, 132, 137, 255, 55, 116, 128 }, + { 86, 6, 28, 5, 64, 255, 25, 248, 1 }, + { 58, 15, 20, 82, 135, 57, 26, 121, 40 }, + { 69, 60, 71, 38, 73, 119, 28, 222, 37 }, + }, + { + { 101, 75, 128, 139, 118, 146, 116, 128, 85 }, + { 56, 41, 15, 176, 236, 85, 37, 9, 62 }, + { 190, 80, 35, 99, 180, 80, 126, 54, 45 }, + { 146, 36, 19, 30, 171, 255, 97, 27, 20 }, + { 71, 30, 17, 119, 118, 255, 17, 18, 138 }, + { 101, 38, 60, 138, 55, 70, 43, 26, 142 }, + { 32, 41, 20, 117, 151, 142, 20, 21, 163 }, + { 138, 45, 61, 62, 219, 1, 81, 188, 64 }, + { 112, 19, 12, 61, 195, 128, 48, 4, 24 }, + { 85, 126, 47, 87, 176, 51, 41, 20, 32 }, + }, + { + { 66, 102, 167, 99, 74, 62, 40, 234, 128 }, + { 41, 53, 9, 178, 241, 141, 26, 8, 107 }, + { 134, 183, 89, 137, 98, 101, 106, 165, 148 }, + { 104, 79, 12, 27, 217, 255, 87, 17, 7 }, + { 74, 43, 26, 146, 73, 166, 49, 23, 157 }, + { 65, 38, 105, 160, 51, 52, 31, 115, 128 }, + { 47, 41, 14, 110, 182, 183, 21, 17, 194 }, + { 87, 68, 71, 44, 114, 51, 15, 186, 23 }, + { 66, 45, 25, 102, 197, 189, 23, 18, 22 }, + { 72, 187, 100, 130, 157, 111, 32, 75, 80 }, + }, +}; + +static const uint8_t vp8_coeff_band[16] = { + 0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7 +}; + +/* Inverse of vp8_coeff_band: mappings of bands to coefficient indexes. + * Each list is -1-terminated. */ +static const int8_t vp8_coeff_band_indexes[8][10] = { + { 0, -1 }, + { 1, -1 }, + { 2, -1 }, + { 3, -1 }, + { 5, -1 }, + { 6, -1 }, + { 4, 7, 8, 9, 10, 11, 12, 13, 14, -1 }, + { 15, -1 } +}; + +static const uint8_t vp8_dct_cat1_prob[] = { + 159, 0 +}; +static const uint8_t vp8_dct_cat2_prob[] = { + 165, 145, 0 +}; + +extern const uint8_t *const ff_vp8_dct_cat_prob[]; + +static const uint8_t vp8_token_default_probs[4][8][3][NUM_DCT_TOKENS - 1] = { + { + { + { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + }, + { + { 253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128 }, + { 189, 129, 242, 255, 227, 213, 255, 219, 128, 128, 128 }, + { 106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128 }, + }, + { + { 1, 98, 248, 255, 236, 226, 255, 255, 128, 128, 128 }, + { 181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128 }, + { 78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128 }, + }, + { + { 1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128 }, + { 184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128 }, + { 77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128 }, + }, + { + { 1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128 }, + { 170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128 }, + { 37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128 }, + }, + { + { 1, 204, 254, 255, 245, 255, 128, 128, 128, 128, 128 }, + { 207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128 }, + { 102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128 }, + }, + { + { 1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128 }, + { 177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128 }, + { 80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128 }, + }, + { + { 1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 246, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + }, + }, + { + { + { 198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62 }, + { 131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1 }, + { 68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128 }, + }, + { + { 1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128 }, + { 184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128 }, + { 81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128 }, + }, + { + { 1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128 }, + { 99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128 }, + { 23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128 }, + }, + { + { 1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128 }, + { 109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128 }, + { 44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128 }, + }, + { + { 1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128 }, + { 94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128 }, + { 22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128 }, + }, + { + { 1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128 }, + { 124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128 }, + { 35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128 }, + }, + { + { 1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128 }, + { 121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128 }, + { 45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128 }, + }, + { + { 1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128 }, + { 203, 1, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, + { 137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128 }, + }, + }, + { + { + { 253, 9, 248, 251, 207, 208, 255, 192, 128, 128, 128 }, + { 175, 13, 224, 243, 193, 185, 249, 198, 255, 255, 128 }, + { 73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128 }, + }, + { + { 1, 95, 247, 253, 212, 183, 255, 255, 128, 128, 128 }, + { 239, 90, 244, 250, 211, 209, 255, 255, 128, 128, 128 }, + { 155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128 }, + }, + { + { 1, 24, 239, 251, 218, 219, 255, 205, 128, 128, 128 }, + { 201, 51, 219, 255, 196, 186, 128, 128, 128, 128, 128 }, + { 69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128 }, + }, + { + { 1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128 }, + { 223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128 }, + { 141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, + }, + { + { 1, 16, 248, 255, 255, 128, 128, 128, 128, 128, 128 }, + { 190, 36, 230, 255, 236, 255, 128, 128, 128, 128, 128 }, + { 149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + }, + { + { 1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + }, + { + { 1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128 }, + { 213, 62, 250, 255, 255, 128, 128, 128, 128, 128, 128 }, + { 55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + }, + { + { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128 }, + }, + }, + { + { + { 202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 255 }, + { 126, 38, 182, 232, 169, 184, 228, 174, 255, 187, 128 }, + { 61, 46, 138, 219, 151, 178, 240, 170, 255, 216, 128 }, + }, + { + { 1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128 }, + { 166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128 }, + { 39, 77, 162, 232, 172, 180, 245, 178, 255, 255, 128 }, + }, + { + { 1, 52, 220, 246, 198, 199, 249, 220, 255, 255, 128 }, + { 124, 74, 191, 243, 183, 193, 250, 221, 255, 255, 128 }, + { 24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128 }, + }, + { + { 1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128 }, + { 149, 150, 226, 252, 216, 205, 255, 171, 128, 128, 128 }, + { 28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128 }, + }, + { + { 1, 81, 230, 252, 204, 203, 255, 192, 128, 128, 128 }, + { 123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128 }, + { 20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128 }, + }, + { + { 1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128 }, + { 168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128 }, + { 47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128 }, + }, + { + { 1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128 }, + { 141, 84, 213, 252, 201, 202, 255, 219, 128, 128, 128 }, + { 42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128 }, + }, + { + { 1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 244, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + { 238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128 }, + }, + }, +}; + +extern const uint8_t ff_vp8_token_update_probs[4][8][3][11]; + +static const uint8_t vp8_dc_qlookup[VP8_MAX_QUANT + 1] = { + 4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 17, + 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 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, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 91, 93, 95, 96, 98, 100, 101, 102, 104, 106, 108, 110, 112, 114, 116, 118, + 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 143, 145, 148, 151, 154, 157, +}; + +static const uint16_t vp8_ac_qlookup[VP8_MAX_QUANT + 1] = { + 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, 60, 62, 64, 66, 68, 70, 72, 74, 76, + 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, + 110, 112, 114, 116, 119, 122, 125, 128, 131, 134, 137, 140, 143, 146, 149, 152, + 155, 158, 161, 164, 167, 170, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, + 213, 217, 221, 225, 229, 234, 239, 245, 249, 254, 259, 264, 269, 274, 279, 284, +}; + +static const uint8_t vp8_mv_update_prob[2][19] = { + { 237, + 246, + 253, 253, 254, 254, 254, 254, 254, + 254, 254, 254, 254, 254, 250, 250, 252, /* VP8 only: */ 254, 254 }, + { 231, + 243, + 245, 253, 254, 254, 254, 254, 254, + 254, 254, 254, 254, 254, 251, 251, 254, /* VP8 only: */ 254, 254 } +}; + +static const uint8_t vp7_mv_default_prob[2][17] = { + { 162, + 128, + 225, 146, 172, 147, 214, 39, 156, + 247, 210, 135, 68, 138, 220, 239, 246 }, + { 164, + 128, + 204, 170, 119, 235, 140, 230, 228, + 244, 184, 201, 44, 173, 221, 239, 253 } +}; + +static const uint8_t vp8_mv_default_prob[2][19] = { + { 162, + 128, + 225, 146, 172, 147, 214, 39, 156, + 128, 129, 132, 75, 145, 178, 206, 239, 254, 254 }, + { 164, + 128, + 204, 170, 119, 235, 140, 230, 228, + 128, 130, 130, 74, 148, 180, 203, 236, 254, 254 } +}; + +static const uint8_t vp7_feature_value_size[2][4] = { + { 7, 6, 0, 8 }, + { 7, 6, 0, 5 }, +}; + +static const int8_t vp7_feature_index_tree[4][2] = +{ + { 1, 2 }, + { -0, -1 }, // '00', '01' + { -2, -3 }, // '10', '11' +}; + +static const uint16_t vp7_ydc_qlookup[] = { + 4, 4, 5, 6, 6, 7, 8, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 33, 34, 35, 36, 36, 37, 38, 39, 39, 40, 41, + 41, 42, 43, 43, 44, 45, 45, 46, 47, 48, 48, 49, 50, 51, 52, + 53, 53, 54, 56, 57, 58, 59, 60, 62, 63, 65, 66, 68, 70, 72, + 74, 76, 79, 81, 84, 87, 90, 93, 96, 100, 104, 108, 112, 116, 121, + 126, 131, 136, 142, 148, 154, 160, 167, 174, 182, 189, 198, 206, 215, 224, + 234, 244, 254, 265, 277, 288, 301, 313, 327, 340, 355, 370, 385, 401, 417, + 434, 452, 470, 489, 509, 529, 550, 572, +}; + +static const uint16_t vp7_yac_qlookup[] = { + 4, 4, 5, 5, 6, 6, 7, 8, 9, 10, 11, 12, 13, 15, + 16, 17, 19, 20, 22, 23, 25, 26, 28, 29, 31, 32, 34, 35, + 37, 38, 40, 41, 42, 44, 45, 46, 48, 49, 50, 51, 53, 54, + 55, 56, 57, 58, 59, 61, 62, 63, 64, 65, 67, 68, 69, 70, + 72, 73, 75, 76, 78, 80, 82, 84, 86, 88, 91, 93, 96, 99, + 102, 105, 109, 112, 116, 121, 125, 130, 135, 140, 146, 152, 158, 165, + 172, 180, 188, 196, 205, 214, 224, 234, 245, 256, 268, 281, 294, 308, + 322, 337, 353, 369, 386, 404, 423, 443, 463, 484, 506, 529, 553, 578, + 604, 631, 659, 688, 718, 749, 781, 814, 849, 885, 922, 960, 1000, 1041, + 1083, 1127, +}; + +static const uint16_t vp7_y2dc_qlookup[] = { + 7, 9, 11, 13, 15, 17, 19, 21, 23, 26, 28, 30, 33, 35, + 37, 39, 42, 44, 46, 48, 51, 53, 55, 57, 59, 61, 63, 65, + 67, 69, 70, 72, 74, 75, 77, 78, 80, 81, 83, 84, 85, 87, + 88, 89, 90, 92, 93, 94, 95, 96, 97, 99, 100, 101, 102, 104, + 105, 106, 108, 109, 111, 113, 114, 116, 118, 120, 123, 125, 128, 131, + 134, 137, 140, 144, 148, 152, 156, 161, 166, 171, 176, 182, 188, 195, + 202, 209, 217, 225, 234, 243, 253, 263, 274, 285, 297, 309, 322, 336, + 350, 365, 381, 397, 414, 432, 450, 470, 490, 511, 533, 556, 579, 604, + 630, 656, 684, 713, 742, 773, 805, 838, 873, 908, 945, 983, 1022, 1063, + 1105, 1148, +}; + +static const uint16_t vp7_y2ac_qlookup[] = { + 7, 9, 11, 13, 16, 18, 21, 24, 26, 29, 32, 35, + 38, 41, 43, 46, 49, 52, 55, 58, 61, 64, 66, 69, + 72, 74, 77, 79, 82, 84, 86, 88, 91, 93, 95, 97, + 98, 100, 102, 104, 105, 107, 109, 110, 112, 113, 115, 116, + 117, 119, 120, 122, 123, 125, 127, 128, 130, 132, 134, 136, + 138, 141, 143, 146, 149, 152, 155, 158, 162, 166, 171, 175, + 180, 185, 191, 197, 204, 210, 218, 226, 234, 243, 252, 262, + 273, 284, 295, 308, 321, 335, 350, 365, 381, 398, 416, 435, + 455, 476, 497, 520, 544, 569, 595, 622, 650, 680, 711, 743, + 776, 811, 848, 885, 925, 965, 1008, 1052, 1097, 1144, 1193, 1244, + 1297, 1351, 1407, 1466, 1526, 1588, 1652, 1719, +}; + +#endif /* AVCODEC_VP8DATA_H */ diff --git a/include/libavcodec/vp8dsp.h b/include/libavcodec/vp8dsp.h new file mode 100644 index 0000000..e3de2e0 --- /dev/null +++ b/include/libavcodec/vp8dsp.h @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2010 David Conrad + * Copyright (C) 2010 Ronald S. Bultje + * + * 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 + */ + +/** + * @file + * VP8 compatible video decoder + */ + +#ifndef AVCODEC_VP8DSP_H +#define AVCODEC_VP8DSP_H + +#include +#include + +typedef void (*vp8_mc_func)(uint8_t *dst /* align 8 */, ptrdiff_t dstStride, + const uint8_t *src /* align 1 */, ptrdiff_t srcStride, + int h, int x, int y); + +typedef struct VP8DSPContext { + void (*vp8_luma_dc_wht)(int16_t block[4][4][16], int16_t dc[16]); + void (*vp8_luma_dc_wht_dc)(int16_t block[4][4][16], int16_t dc[16]); + void (*vp8_idct_add)(uint8_t *dst, int16_t block[16], ptrdiff_t stride); + void (*vp8_idct_dc_add)(uint8_t *dst, int16_t block[16], ptrdiff_t stride); + void (*vp8_idct_dc_add4y)(uint8_t *dst, int16_t block[4][16], + ptrdiff_t stride); + void (*vp8_idct_dc_add4uv)(uint8_t *dst, int16_t block[4][16], + ptrdiff_t stride); + + // loop filter applied to edges between macroblocks + void (*vp8_v_loop_filter16y)(uint8_t *dst, ptrdiff_t stride, + int flim_E, int flim_I, int hev_thresh); + void (*vp8_h_loop_filter16y)(uint8_t *dst, ptrdiff_t stride, + int flim_E, int flim_I, int hev_thresh); + void (*vp8_v_loop_filter8uv)(uint8_t *dstU, uint8_t *dstV, ptrdiff_t stride, + int flim_E, int flim_I, int hev_thresh); + void (*vp8_h_loop_filter8uv)(uint8_t *dstU, uint8_t *dstV, ptrdiff_t stride, + int flim_E, int flim_I, int hev_thresh); + + // loop filter applied to inner macroblock edges + void (*vp8_v_loop_filter16y_inner)(uint8_t *dst, ptrdiff_t stride, + int flim_E, int flim_I, int hev_thresh); + void (*vp8_h_loop_filter16y_inner)(uint8_t *dst, ptrdiff_t stride, + int flim_E, int flim_I, int hev_thresh); + void (*vp8_v_loop_filter8uv_inner)(uint8_t *dstU, uint8_t *dstV, + ptrdiff_t stride, + int flim_E, int flim_I, int hev_thresh); + void (*vp8_h_loop_filter8uv_inner)(uint8_t *dstU, uint8_t *dstV, + ptrdiff_t stride, + int flim_E, int flim_I, int hev_thresh); + + void (*vp8_v_loop_filter_simple)(uint8_t *dst, ptrdiff_t stride, int flim); + void (*vp8_h_loop_filter_simple)(uint8_t *dst, ptrdiff_t stride, int flim); + + /** + * first dimension: 4-log2(width) + * second dimension: 0 if no vertical interpolation is needed; + * 1 4-tap vertical interpolation filter (my & 1) + * 2 6-tap vertical interpolation filter (!(my & 1)) + * third dimension: same as second dimension, for horizontal interpolation + * so something like put_vp8_epel_pixels_tab[4-log2(width)][2*!!my-(my&1)][2*!!mx-(mx&1)](..., mx, my) + */ + vp8_mc_func put_vp8_epel_pixels_tab[3][3][3]; + vp8_mc_func put_vp8_bilinear_pixels_tab[3][3][3]; +} VP8DSPContext; + +void ff_vp7dsp_init(VP8DSPContext *c); + +void ff_vp78dsp_init(VP8DSPContext *c); +void ff_vp78dsp_init_aarch64(VP8DSPContext *c); +void ff_vp78dsp_init_arm(VP8DSPContext *c); +void ff_vp78dsp_init_ppc(VP8DSPContext *c); +void ff_vp78dsp_init_riscv(VP8DSPContext *c); +void ff_vp78dsp_init_x86(VP8DSPContext *c); + +void ff_vp7dsp_init_riscv(VP8DSPContext *c); + +void ff_vp8dsp_init(VP8DSPContext *c); +void ff_vp8dsp_init_aarch64(VP8DSPContext *c); +void ff_vp8dsp_init_arm(VP8DSPContext *c); +void ff_vp8dsp_init_riscv(VP8DSPContext *c); +void ff_vp8dsp_init_x86(VP8DSPContext *c); +void ff_vp8dsp_init_mips(VP8DSPContext *c); +void ff_vp8dsp_init_loongarch(VP8DSPContext *c); + +#define IS_VP7 1 +#define IS_VP8 0 + +#endif /* AVCODEC_VP8DSP_H */ diff --git a/include/libavcodec/vp9.h b/include/libavcodec/vp9.h new file mode 100644 index 0000000..c8d07ad --- /dev/null +++ b/include/libavcodec/vp9.h @@ -0,0 +1,73 @@ +/* + * VP9 compatible video decoder + * + * Copyright (C) 2013 Ronald S. Bultje + * Copyright (C) 2013 Clément Bœsch + * + * 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_VP9_H +#define AVCODEC_VP9_H + +enum TxfmMode { + TX_4X4, + TX_8X8, + TX_16X16, + TX_32X32, + N_TXFM_SIZES, + TX_SWITCHABLE = N_TXFM_SIZES, + N_TXFM_MODES +}; + +enum TxfmType { + DCT_DCT, + DCT_ADST, + ADST_DCT, + ADST_ADST, + N_TXFM_TYPES +}; + +enum IntraPredMode { + VERT_PRED, + HOR_PRED, + DC_PRED, + DIAG_DOWN_LEFT_PRED, + DIAG_DOWN_RIGHT_PRED, + VERT_RIGHT_PRED, + HOR_DOWN_PRED, + VERT_LEFT_PRED, + HOR_UP_PRED, + TM_VP8_PRED, + LEFT_DC_PRED, + TOP_DC_PRED, + DC_128_PRED, + DC_127_PRED, + DC_129_PRED, + N_INTRA_PRED_MODES +}; + +enum FilterMode { + FILTER_8TAP_SMOOTH, + FILTER_8TAP_REGULAR, + FILTER_8TAP_SHARP, + FILTER_BILINEAR, + N_FILTERS, + FILTER_SWITCHABLE = N_FILTERS, +}; + +#endif /* AVCODEC_VP9_H */ diff --git a/include/libavcodec/vp9data.h b/include/libavcodec/vp9data.h new file mode 100644 index 0000000..086dbde --- /dev/null +++ b/include/libavcodec/vp9data.h @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2013 Ronald S. Bultje + * Copyright (C) 2013 Clément Bœsch + * + * 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_VP9DATA_H +#define AVCODEC_VP9DATA_H + +#include + +#include "vp9dec.h" + +extern const uint8_t ff_vp9_bwh_tab[2][N_BS_SIZES][2]; +extern const int8_t ff_vp9_partition_tree[3][2]; +extern const uint8_t ff_vp9_default_kf_partition_probs[4][4][3]; +extern const int8_t ff_vp9_segmentation_tree[7][2]; +extern const int8_t ff_vp9_intramode_tree[9][2]; +extern const uint8_t ff_vp9_default_kf_ymode_probs[10][10][9]; +extern const uint8_t ff_vp9_default_kf_uvmode_probs[10][9]; +extern const int8_t ff_vp9_inter_mode_tree[3][2]; +extern const int8_t ff_vp9_filter_tree[2][2]; +extern const enum FilterMode ff_vp9_filter_lut[3]; +extern const int16_t ff_vp9_dc_qlookup[3][256]; +extern const int16_t ff_vp9_ac_qlookup[3][256]; +extern const enum TxfmType ff_vp9_intra_txfm_type[14]; +extern const int16_t ff_vp9_default_scan_4x4[16]; +extern const int16_t ff_vp9_col_scan_4x4[16]; +extern const int16_t ff_vp9_row_scan_4x4[16]; +extern const int16_t ff_vp9_default_scan_8x8[64]; +extern const int16_t ff_vp9_col_scan_8x8[64]; +extern const int16_t ff_vp9_row_scan_8x8[64]; +extern const int16_t ff_vp9_default_scan_16x16[256]; +extern const int16_t ff_vp9_col_scan_16x16[256]; +extern const int16_t ff_vp9_row_scan_16x16[256]; +extern const int16_t ff_vp9_default_scan_32x32[1024]; +extern const int16_t * const ff_vp9_scans[5][4]; +extern const int16_t ff_vp9_default_scan_4x4_nb[16][2]; +extern const int16_t ff_vp9_col_scan_4x4_nb[16][2]; +extern const int16_t ff_vp9_row_scan_4x4_nb[16][2]; +extern const int16_t ff_vp9_default_scan_8x8_nb[64][2]; +extern const int16_t ff_vp9_col_scan_8x8_nb[64][2]; +extern const int16_t ff_vp9_row_scan_8x8_nb[64][2]; +extern const int16_t ff_vp9_default_scan_16x16_nb[256][2]; +extern const int16_t ff_vp9_col_scan_16x16_nb[256][2]; +extern const int16_t ff_vp9_row_scan_16x16_nb[256][2]; +extern const int16_t ff_vp9_default_scan_32x32_nb[1024][2]; +extern const int16_t (* const ff_vp9_scans_nb[5][4])[2]; +extern const uint8_t ff_vp9_model_pareto8[256][8]; +extern const ProbContext ff_vp9_default_probs; +extern const uint8_t ff_vp9_default_coef_probs[4][2][2][6][6][3]; +extern const int8_t ff_vp9_mv_joint_tree[3][2]; +extern const int8_t ff_vp9_mv_class_tree[10][2]; +extern const int8_t ff_vp9_mv_fp_tree[3][2]; + +#endif /* AVCODEC_VP9DATA_H */ diff --git a/include/libavcodec/vp9dec.h b/include/libavcodec/vp9dec.h new file mode 100644 index 0000000..81dc801 --- /dev/null +++ b/include/libavcodec/vp9dec.h @@ -0,0 +1,258 @@ +/* + * VP9 compatible video decoder + * + * Copyright (C) 2013 Ronald S. Bultje + * Copyright (C) 2013 Clément Bœsch + * + * 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_VP9DEC_H +#define AVCODEC_VP9DEC_H + +#include +#include +#include + +#include "libavutil/mem_internal.h" +#include "libavutil/pixfmt.h" +#include "libavutil/thread.h" + +#include "get_bits.h" +#include "videodsp.h" +#include "vp9.h" +#include "vp9dsp.h" +#include "vp9shared.h" +#include "vpx_rac.h" + +#define REF_INVALID_SCALE 0xFFFF + +enum MVJoint { + MV_JOINT_ZERO, + MV_JOINT_H, + MV_JOINT_V, + MV_JOINT_HV, +}; + +typedef struct ProbContext { + uint8_t y_mode[4][9]; + uint8_t uv_mode[10][9]; + uint8_t filter[4][2]; + uint8_t mv_mode[7][3]; + uint8_t intra[4]; + uint8_t comp[5]; + uint8_t single_ref[5][2]; + uint8_t comp_ref[5]; + uint8_t tx32p[2][3]; + uint8_t tx16p[2][2]; + uint8_t tx8p[2]; + uint8_t skip[3]; + uint8_t mv_joint[3]; + struct { + uint8_t sign; + uint8_t classes[10]; + uint8_t class0; + uint8_t bits[10]; + uint8_t class0_fp[2][3]; + uint8_t fp[3]; + uint8_t class0_hp; + uint8_t hp; + } mv_comp[2]; + uint8_t partition[4][4][3]; +} ProbContext; + +typedef struct VP9Filter { + uint8_t level[8 * 8]; + uint8_t /* bit=col */ mask[2 /* 0=y, 1=uv */][2 /* 0=col, 1=row */] + [8 /* rows */][4 /* 0=16, 1=8, 2=4, 3=inner4 */]; +} VP9Filter; + +typedef struct VP9Block { + uint8_t seg_id, intra, comp, ref[2], mode[4], uvmode, skip; + enum FilterMode filter; + VP9mv mv[4 /* b_idx */][2 /* ref */]; + enum BlockSize bs; + enum TxfmMode tx, uvtx; + enum BlockLevel bl; + enum BlockPartition bp; +} VP9Block; + +typedef struct VP9TileData VP9TileData; + +typedef struct VP9Context { + VP9SharedContext s; + VP9TileData *td; + + VP9DSPContext dsp; + VideoDSPContext vdsp; + GetBitContext gb; + VPXRangeCoder c; + int pass, active_tile_cols; + +#if HAVE_THREADS + pthread_mutex_t progress_mutex; + pthread_cond_t progress_cond; + atomic_int *entries; + unsigned pthread_init_cnt; +#endif + + uint8_t ss_h, ss_v; + uint8_t last_bpp, bpp_index, bytesperpixel; + uint8_t last_keyframe; + // sb_cols/rows, rows/cols and last_fmt are used for allocating all internal + // arrays, and are thus per-thread. w/h and gf_fmt are synced between threads + // and are therefore per-stream. pix_fmt represents the value in the header + // of the currently processed frame. + int w, h; + enum AVPixelFormat pix_fmt, last_fmt, gf_fmt; + unsigned sb_cols, sb_rows, rows, cols; + ProgressFrame next_refs[8]; + + struct { + uint8_t lim_lut[64]; + uint8_t mblim_lut[64]; + } filter_lut; + struct { + ProbContext p; + uint8_t coef[4][2][2][6][6][3]; + } prob_ctx[4]; + struct { + ProbContext p; + uint8_t coef[4][2][2][6][6][11]; + } prob; + + // contextual (above) cache + uint8_t *above_partition_ctx; + uint8_t *above_mode_ctx; + // FIXME maybe merge some of the below in a flags field? + uint8_t *above_y_nnz_ctx; + uint8_t *above_uv_nnz_ctx[2]; + uint8_t *above_skip_ctx; // 1bit + uint8_t *above_txfm_ctx; // 2bit + uint8_t *above_segpred_ctx; // 1bit + uint8_t *above_intra_ctx; // 1bit + uint8_t *above_comp_ctx; // 1bit + uint8_t *above_ref_ctx; // 2bit + uint8_t *above_filter_ctx; + VP9mv (*above_mv_ctx)[2]; + + // whole-frame cache + uint8_t *intra_pred_data[3]; + VP9Filter *lflvl; + + // block reconstruction intermediates + int block_alloc_using_2pass; + uint16_t mvscale[3][2]; + uint8_t mvstep[3][2]; + + // frame specific buffer pools + struct FFRefStructPool *frame_extradata_pool; + int frame_extradata_pool_size; +} VP9Context; + +struct VP9TileData { + const VP9Context *s; + VPXRangeCoder *c_b; + VPXRangeCoder *c; + int row, row7, col, col7; + uint8_t *dst[3]; + ptrdiff_t y_stride, uv_stride; + VP9Block *b_base, *b; + unsigned tile_col_start; + + struct { + unsigned y_mode[4][10]; + unsigned uv_mode[10][10]; + unsigned filter[4][3]; + unsigned mv_mode[7][4]; + unsigned intra[4][2]; + unsigned comp[5][2]; + unsigned single_ref[5][2][2]; + unsigned comp_ref[5][2]; + unsigned tx32p[2][4]; + unsigned tx16p[2][3]; + unsigned tx8p[2][2]; + unsigned skip[3][2]; + unsigned mv_joint[4]; + struct { + unsigned sign[2]; + unsigned classes[11]; + unsigned class0[2]; + unsigned bits[10][2]; + unsigned class0_fp[2][4]; + unsigned fp[4]; + unsigned class0_hp[2]; + unsigned hp[2]; + } mv_comp[2]; + unsigned partition[4][4][4]; + unsigned coef[4][2][2][6][6][3]; + unsigned eob[4][2][2][6][6][2]; + } counts; + + // whole-frame cache + DECLARE_ALIGNED(32, uint8_t, edge_emu_buffer)[135 * 144 * 2]; + + // contextual (left) cache + DECLARE_ALIGNED(16, uint8_t, left_y_nnz_ctx)[16]; + DECLARE_ALIGNED(16, uint8_t, left_mode_ctx)[16]; + DECLARE_ALIGNED(16, VP9mv, left_mv_ctx)[16][2]; + DECLARE_ALIGNED(16, uint8_t, left_uv_nnz_ctx)[2][16]; + DECLARE_ALIGNED(8, uint8_t, left_partition_ctx)[8]; + DECLARE_ALIGNED(8, uint8_t, left_skip_ctx)[8]; + DECLARE_ALIGNED(8, uint8_t, left_txfm_ctx)[8]; + DECLARE_ALIGNED(8, uint8_t, left_segpred_ctx)[8]; + DECLARE_ALIGNED(8, uint8_t, left_intra_ctx)[8]; + DECLARE_ALIGNED(8, uint8_t, left_comp_ctx)[8]; + DECLARE_ALIGNED(8, uint8_t, left_ref_ctx)[8]; + DECLARE_ALIGNED(8, uint8_t, left_filter_ctx)[8]; + // block reconstruction intermediates + DECLARE_ALIGNED(32, uint8_t, tmp_y)[64 * 64 * 2]; + DECLARE_ALIGNED(32, uint8_t, tmp_uv)[2][64 * 64 * 2]; + struct { int x, y; } min_mv, max_mv; + int16_t *block_base, *block, *uvblock_base[2], *uvblock[2]; + uint8_t *eob_base, *uveob_base[2], *eob, *uveob[2]; + + // error message + int error_info; + struct { + unsigned int row:13; + unsigned int col:13; + unsigned int block_size_idx_x:2; + unsigned int block_size_idx_y:2; + } *block_structure; + unsigned int nb_block_structure; +}; + +void ff_vp9_fill_mv(VP9TileData *td, VP9mv *mv, int mode, int sb); + +void ff_vp9_adapt_probs(VP9Context *s); + +void ff_vp9_decode_block(VP9TileData *td, int row, int col, + VP9Filter *lflvl, ptrdiff_t yoff, ptrdiff_t uvoff, + enum BlockLevel bl, enum BlockPartition bp); + +void ff_vp9_loopfilter_sb(struct AVCodecContext *avctx, VP9Filter *lflvl, + int row, int col, ptrdiff_t yoff, ptrdiff_t uvoff); + +void ff_vp9_intra_recon_8bpp(VP9TileData *td, + ptrdiff_t y_off, ptrdiff_t uv_off); +void ff_vp9_intra_recon_16bpp(VP9TileData *td, + ptrdiff_t y_off, ptrdiff_t uv_off); +void ff_vp9_inter_recon_8bpp(VP9TileData *td); +void ff_vp9_inter_recon_16bpp(VP9TileData *td); + +#endif /* AVCODEC_VP9DEC_H */ diff --git a/include/libavcodec/vp9dsp.h b/include/libavcodec/vp9dsp.h new file mode 100644 index 0000000..772848e --- /dev/null +++ b/include/libavcodec/vp9dsp.h @@ -0,0 +1,139 @@ +/* + * VP9 compatible video decoder + * + * Copyright (C) 2013 Ronald S. Bultje + * Copyright (C) 2013 Clément Bœsch + * + * 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_VP9DSP_H +#define AVCODEC_VP9DSP_H + +#include +#include + +#include "libavcodec/vp9.h" +#include "libavutil/attributes_internal.h" + +typedef void (*vp9_mc_func)(uint8_t *dst, ptrdiff_t dst_stride, + const uint8_t *ref, ptrdiff_t ref_stride, + int h, int mx, int my); +typedef void (*vp9_scaled_mc_func)(uint8_t *dst, ptrdiff_t dst_stride, + const uint8_t *ref, ptrdiff_t ref_stride, + int h, int mx, int my, int dx, int dy); + +typedef struct VP9DSPContext { + /* + * dimension 1: 0=4x4, 1=8x8, 2=16x16, 3=32x32 + * dimension 2: intra prediction modes + * + * dst/left/top is aligned by transform-size (i.e. 4, 8, 16 or 32 pixels) + * stride is aligned by 16 pixels + * top[-1] is top/left; top[4,7] is top-right for 4x4 + */ + // FIXME(rbultje) maybe replace left/top pointers with HAVE_TOP/ + // HAVE_LEFT/HAVE_TOPRIGHT flags instead, and then handle it in-place? + // also needs to fit in with what H.264/VP8/etc do + void (*intra_pred[N_TXFM_SIZES][N_INTRA_PRED_MODES])(uint8_t *dst, + ptrdiff_t stride, + const uint8_t *left, + const uint8_t *top); + + /* + * dimension 1: 0=4x4, 1=8x8, 2=16x16, 3=32x32, 4=lossless (3-4=dct only) + * dimension 2: 0=dct/dct, 1=dct/adst, 2=adst/dct, 3=adst/adst + * + * dst is aligned by transform-size (i.e. 4, 8, 16 or 32 pixels) + * stride is aligned by 16 pixels + * block is 16-byte aligned + * eob indicates the position (+1) of the last non-zero coefficient, + * in scan-order. This can be used to write faster versions, e.g. a + * dc-only 4x4/8x8/16x16/32x32, or a 4x4-only (eob<10) 8x8/16x16/32x32, + * etc. + */ + // FIXME also write idct_add_block() versions for whole (inter) pred + // blocks, so we can do 2 4x4s at once + void (*itxfm_add[N_TXFM_SIZES + 1][N_TXFM_TYPES])(uint8_t *dst, + ptrdiff_t stride, + int16_t *block, int eob); + + /* + * dimension 1: width of filter (0=4, 1=8, 2=16) + * dimension 2: 0=col-edge filter (h), 1=row-edge filter (v) + * + * dst/stride are aligned by 8 + */ + void (*loop_filter_8[3][2])(uint8_t *dst, ptrdiff_t stride, + int mb_lim, int lim, int hev_thr); + + /* + * dimension 1: 0=col-edge filter (h), 1=row-edge filter (v) + * + * The width of filter is assumed to be 16; dst/stride are aligned by 16 + */ + void (*loop_filter_16[2])(uint8_t *dst, ptrdiff_t stride, + int mb_lim, int lim, int hev_thr); + + /* + * dimension 1/2: width of filter (0=4, 1=8) for each filter half + * dimension 3: 0=col-edge filter (h), 1=row-edge filter (v) + * + * dst/stride are aligned by operation size + * this basically calls loop_filter[d1][d3][0](), followed by + * loop_filter[d2][d3][0]() on the next 8 pixels + * mb_lim/lim/hev_thr contain two values in the lowest two bytes of the + * integer. + */ + // FIXME perhaps a mix4 that operates on 32px (for AVX2) + void (*loop_filter_mix2[2][2][2])(uint8_t *dst, ptrdiff_t stride, + int mb_lim, int lim, int hev_thr); + + /* + * dimension 1: hsize (0: 64, 1: 32, 2: 16, 3: 8, 4: 4) + * dimension 2: filter type (0: smooth, 1: regular, 2: sharp, 3: bilin) + * dimension 3: averaging type (0: put, 1: avg) + * dimension 4: x subpel interpolation (0: none, 1: 8tap/bilin) + * dimension 5: y subpel interpolation (0: none, 1: 8tap/bilin) + * + * dst/stride are aligned by hsize + */ + vp9_mc_func mc[5][N_FILTERS][2][2][2]; + + /* + * for scalable MC, first 3 dimensions identical to above, the other two + * don't exist since it changes per stepsize. + */ + vp9_scaled_mc_func smc[5][N_FILTERS][2]; +} VP9DSPContext; + +extern const int16_t attribute_visibility_hidden ff_vp9_subpel_filters[3][16][8]; + +void ff_vp9dsp_init(VP9DSPContext *dsp, int bpp, int bitexact); + +void ff_vp9dsp_init_8(VP9DSPContext *dsp); +void ff_vp9dsp_init_10(VP9DSPContext *dsp); +void ff_vp9dsp_init_12(VP9DSPContext *dsp); + +void ff_vp9dsp_init_aarch64(VP9DSPContext *dsp, int bpp); +void ff_vp9dsp_init_arm(VP9DSPContext *dsp, int bpp); +void ff_vp9dsp_init_riscv(VP9DSPContext *dsp, int bpp, int bitexact); +void ff_vp9dsp_init_x86(VP9DSPContext *dsp, int bpp, int bitexact); +void ff_vp9dsp_init_mips(VP9DSPContext *dsp, int bpp); +void ff_vp9dsp_init_loongarch(VP9DSPContext *dsp, int bpp); + +#endif /* AVCODEC_VP9DSP_H */ diff --git a/include/libavcodec/vp9shared.h b/include/libavcodec/vp9shared.h new file mode 100644 index 0000000..8a450c2 --- /dev/null +++ b/include/libavcodec/vp9shared.h @@ -0,0 +1,175 @@ +/* + * VP9 compatible video decoder + * + * Copyright (C) 2013 Ronald S. Bultje + * Copyright (C) 2013 Clément Bœsch + * + * 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_VP9SHARED_H +#define AVCODEC_VP9SHARED_H + +#include +#include + +#include "libavutil/mem_internal.h" + +#include "progressframe.h" +#include "vp9.h" + +enum BlockPartition { + PARTITION_NONE, // [ ] <-. + PARTITION_H, // [-] | + PARTITION_V, // [|] | + PARTITION_SPLIT, // [+] --' +}; + +enum InterPredMode { + NEARESTMV = 10, + NEARMV = 11, + ZEROMV = 12, + NEWMV = 13, +}; + +enum CompPredMode { + PRED_SINGLEREF, + PRED_COMPREF, + PRED_SWITCHABLE, +}; + +typedef struct VP9mv { + DECLARE_ALIGNED(4, int16_t, x); + int16_t y; +} VP9mv; + +typedef struct VP9mvrefPair { + VP9mv mv[2]; + int8_t ref[2]; +} VP9mvrefPair; + +typedef struct VP9Frame { + ProgressFrame tf; + void *extradata; ///< RefStruct reference + uint8_t *segmentation_map; + VP9mvrefPair *mv; + int uses_2pass; + + void *hwaccel_picture_private; ///< RefStruct reference +} VP9Frame; + +enum BlockLevel { + BL_64X64, + BL_32X32, + BL_16X16, + BL_8X8, +}; + +enum BlockSize { + BS_64x64, + BS_64x32, + BS_32x64, + BS_32x32, + BS_32x16, + BS_16x32, + BS_16x16, + BS_16x8, + BS_8x16, + BS_8x8, + BS_8x4, + BS_4x8, + BS_4x4, + N_BS_SIZES, +}; + +typedef struct VP9BitstreamHeader { + // bitstream header + uint8_t profile; + uint8_t bpp; + uint8_t keyframe; + uint8_t invisible; + uint8_t errorres; + uint8_t intraonly; + uint8_t resetctx; + uint8_t refreshrefmask; + uint8_t highprecisionmvs; + enum FilterMode filtermode; + uint8_t allowcompinter; + uint8_t refreshctx; + uint8_t parallelmode; + uint8_t framectxid; + uint8_t use_last_frame_mvs; + uint8_t refidx[3]; + uint8_t signbias[3]; + uint8_t fixcompref; + uint8_t varcompref[2]; + struct { + uint8_t level; + int8_t sharpness; + } filter; + struct { + uint8_t enabled; + uint8_t updated; + int8_t mode[2]; + int8_t ref[4]; + } lf_delta; + uint8_t yac_qi; + int8_t ydc_qdelta, uvdc_qdelta, uvac_qdelta; + uint8_t lossless; +#define MAX_SEGMENT 8 + struct { + uint8_t enabled; + uint8_t temporal; + uint8_t absolute_vals; + uint8_t update_map; + uint8_t prob[7]; + uint8_t pred_prob[3]; + struct { + uint8_t q_enabled; + uint8_t lf_enabled; + uint8_t ref_enabled; + uint8_t skip_enabled; + uint8_t ref_val; + int16_t q_val; + int8_t lf_val; + int16_t qmul[2][2]; + uint8_t lflvl[4][2]; + } feat[MAX_SEGMENT]; + } segmentation; + enum TxfmMode txfmmode; + enum CompPredMode comppredmode; + struct { + unsigned log2_tile_cols, log2_tile_rows; + unsigned tile_cols, tile_rows; + } tiling; + + int uncompressed_header_size; + int compressed_header_size; +} VP9BitstreamHeader; + +typedef struct VP9SharedContext { + VP9BitstreamHeader h; + + ProgressFrame refs[8]; +#define CUR_FRAME 0 +#define REF_FRAME_MVPAIR 1 +#define REF_FRAME_SEGMAP 2 +#define BLANK_FRAME 3 + VP9Frame frames[4]; +} VP9SharedContext; + +#endif /* AVCODEC_VP9SHARED_H */ diff --git a/include/libavcodec/vpx_rac.h b/include/libavcodec/vpx_rac.h new file mode 100644 index 0000000..b158cc0 --- /dev/null +++ b/include/libavcodec/vpx_rac.h @@ -0,0 +1,135 @@ +/* + * Copyright (C) 2006 Aurelien Jacobs + * + * 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 + */ + +/** + * @file + * Common VP5-VP9 range decoder stuff + */ + +#ifndef AVCODEC_VPX_RAC_H +#define AVCODEC_VPX_RAC_H + +#include + +#include "config.h" +#include "libavutil/attributes.h" +#include "bytestream.h" + +typedef struct VPXRangeCoder { + int high; + int bits; /* stored negated (i.e. negative "bits" is a positive number of + bits left) in order to eliminate a negate in cache refilling */ + const uint8_t *buffer; + const uint8_t *end; + unsigned int code_word; + int end_reached; +} VPXRangeCoder; + +extern const uint8_t ff_vpx_norm_shift[256]; +int ff_vpx_init_range_decoder(VPXRangeCoder *c, const uint8_t *buf, int buf_size); + +/** + * returns 1 if the end of the stream has been reached, 0 otherwise. + */ +static av_always_inline int vpx_rac_is_end(VPXRangeCoder *c) +{ + if (c->end <= c->buffer && c->bits >= 0) + c->end_reached ++; + return c->end_reached > 10; +} + +static av_always_inline unsigned int vpx_rac_renorm(VPXRangeCoder *c) +{ + int shift = ff_vpx_norm_shift[c->high]; + int bits = c->bits; + unsigned int code_word = c->code_word; + + c->high <<= shift; + code_word <<= shift; + bits += shift; + if(bits >= 0 && c->buffer < c->end) { + code_word |= bytestream_get_be16(&c->buffer) << bits; + bits -= 16; + } + c->bits = bits; + return code_word; +} + +#if ARCH_ARM +#include "arm/vpx_arith.h" +#elif ARCH_X86 +#include "x86/vpx_arith.h" +#endif + +#ifndef vpx_rac_get_prob +#define vpx_rac_get_prob vpx_rac_get_prob +static av_always_inline int vpx_rac_get_prob(VPXRangeCoder *c, uint8_t prob) +{ + unsigned int code_word = vpx_rac_renorm(c); + unsigned int low = 1 + (((c->high - 1) * prob) >> 8); + unsigned int low_shift = low << 16; + int bit = code_word >= low_shift; + + c->high = bit ? c->high - low : low; + c->code_word = bit ? code_word - low_shift : code_word; + + return bit; +} +#endif + +#ifndef vpx_rac_get_prob_branchy +// branchy variant, to be used where there's a branch based on the bit decoded +static av_always_inline int vpx_rac_get_prob_branchy(VPXRangeCoder *c, int prob) +{ + unsigned long code_word = vpx_rac_renorm(c); + unsigned low = 1 + (((c->high - 1) * prob) >> 8); + unsigned low_shift = low << 16; + + if (code_word >= low_shift) { + c->high -= low; + c->code_word = code_word - low_shift; + return 1; + } + + c->high = low; + c->code_word = code_word; + return 0; +} +#endif + +static av_always_inline int vpx_rac_get(VPXRangeCoder *c) +{ + unsigned int code_word = vpx_rac_renorm(c); + /* equiprobable */ + int low = (c->high + 1) >> 1; + unsigned int low_shift = low << 16; + int bit = code_word >= low_shift; + if (bit) { + c->high -= low; + code_word -= low_shift; + } else { + c->high = low; + } + + c->code_word = code_word; + return bit; +} + +#endif /* AVCODEC_VPX_RAC_H */ diff --git a/include/libavcodec/vt_internal.h b/include/libavcodec/vt_internal.h new file mode 100644 index 0000000..9502d7c --- /dev/null +++ b/include/libavcodec/vt_internal.h @@ -0,0 +1,71 @@ +/* + * 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_VT_INTERNAL_H +#define AVCODEC_VT_INTERNAL_H + +#include "avcodec.h" +#include "videotoolbox.h" + +typedef struct VTContext { + // The current bitstream buffer. + uint8_t *bitstream; + + // The current size of the bitstream. + int bitstream_size; + + // The reference size used for fast reallocation. + int allocated_size; + + // The core video buffer + CVImageBufferRef frame; + + // Current dummy frames context (depends on exact CVImageBufferRef params). + struct AVBufferRef *cached_hw_frames_ctx; + + // Non-NULL if the new hwaccel API is used. This is only a separate struct + // to ease compatibility with the old API. + struct AVVideotoolboxContext *vt_ctx; + + // Current H264 parameters (used to trigger decoder restart on SPS changes). + uint8_t sps[3]; + bool reconfig_needed; + + void *logctx; +} VTContext; + +int ff_videotoolbox_alloc_frame(AVCodecContext *avctx, AVFrame *frame); +int ff_videotoolbox_common_init(AVCodecContext *avctx); +int ff_videotoolbox_frame_params(AVCodecContext *avctx, + AVBufferRef *hw_frames_ctx); +int ff_videotoolbox_buffer_copy(VTContext *vtctx, + const uint8_t *buffer, + uint32_t size); +int ff_videotoolbox_uninit(AVCodecContext *avctx); +int ff_videotoolbox_h264_start_frame(AVCodecContext *avctx, + const uint8_t *buffer, + uint32_t size); +int ff_videotoolbox_h264_decode_slice(AVCodecContext *avctx, + const uint8_t *buffer, + uint32_t size); +int ff_videotoolbox_common_end_frame(AVCodecContext *avctx, AVFrame *frame); +CFDataRef ff_videotoolbox_avcc_extradata_create(AVCodecContext *avctx); +CFDataRef ff_videotoolbox_hvcc_extradata_create(AVCodecContext *avctx); +CFDataRef ff_videotoolbox_vpcc_extradata_create(AVCodecContext *avctx); + +#endif /* AVCODEC_VT_INTERNAL_H */ diff --git a/include/libavcodec/vulkan.h b/include/libavcodec/vulkan.h new file mode 100644 index 0000000..b15efd4 --- /dev/null +++ b/include/libavcodec/vulkan.h @@ -0,0 +1,24 @@ +/* + * 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_VULKAN_H +#define AVCODEC_VULKAN_H + +#include "libavutil/vulkan.h" + +#endif /* AVCODEC_VULKAN_H */ diff --git a/include/libavcodec/vulkan_decode.h b/include/libavcodec/vulkan_decode.h new file mode 100644 index 0000000..76e6083 --- /dev/null +++ b/include/libavcodec/vulkan_decode.h @@ -0,0 +1,184 @@ +/* + * 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_VULKAN_DECODE_H +#define AVCODEC_VULKAN_DECODE_H + +#include "codec_id.h" +#include "decode.h" +#include "hwaccel_internal.h" +#include "internal.h" + +#include "vulkan_video.h" + +typedef struct FFVulkanDecodeDescriptor { + enum AVCodecID codec_id; + FFVulkanExtensions decode_extension; + VkVideoCodecOperationFlagBitsKHR decode_op; + + VkExtensionProperties ext_props; +} FFVulkanDecodeDescriptor; + +typedef struct FFVulkanDecodeProfileData { + VkVideoDecodeH264ProfileInfoKHR h264_profile; + VkVideoDecodeH265ProfileInfoKHR h265_profile; + VkVideoDecodeAV1ProfileInfoKHR av1_profile; + VkVideoDecodeUsageInfoKHR usage; + VkVideoProfileInfoKHR profile; + VkVideoProfileListInfoKHR profile_list; +} FFVulkanDecodeProfileData; + +typedef struct FFVulkanDecodeShared { + FFVulkanContext s; + FFVkVideoCommon common; + FFVkQueueFamilyCtx qf; + + AVBufferPool *buf_pool; + + VkVideoCapabilitiesKHR caps; + VkVideoDecodeCapabilitiesKHR dec_caps; + + VkVideoSessionParametersKHR empty_session_params; +} FFVulkanDecodeShared; + +typedef struct FFVulkanDecodeContext { + FFVulkanDecodeShared *shared_ctx; + AVBufferRef *session_params; + FFVkExecPool exec_pool; + + int dedicated_dpb; /* Oddity #1 - separate DPB images */ + int external_fg; /* Oddity #2 - hardware can't apply film grain */ + uint32_t frame_id_alloc_mask; /* For AV1 only */ + + /* Workaround for NVIDIA drivers tested with CTS version 1.3.8 for AV1. + * The tests were incorrect as the OrderHints were offset by 1. */ + int quirk_av1_offset; + + /* Thread-local state below */ + struct HEVCHeaderSet *hevc_headers; + size_t hevc_headers_size; + + uint32_t *slice_off; + unsigned int slice_off_max; +} FFVulkanDecodeContext; + +typedef struct FFVulkanDecodePicture { + AVFrame *dpb_frame; /* Only used for out-of-place decoding. */ + + VkImageView img_view_ref; /* Image representation view (reference) */ + VkImageView img_view_out; /* Image representation view (output-only) */ + VkImageView img_view_dest; /* Set to img_view_out if no layered refs are used */ + VkImageAspectFlags img_aspect; /* Image plane mask bits */ + VkImageAspectFlags img_aspect_ref; /* Only used for out-of-place decoding */ + + VkSemaphore sem; + uint64_t sem_value; + + /* Current picture */ + VkVideoPictureResourceInfoKHR ref; + VkVideoReferenceSlotInfoKHR ref_slot; + + /* Picture refs. H264 has the maximum number of refs (36) of any supported codec. */ + VkVideoPictureResourceInfoKHR refs [36]; + VkVideoReferenceSlotInfoKHR ref_slots[36]; + + /* Main decoding struct */ + VkVideoDecodeInfoKHR decode_info; + + /* Slice data */ + AVBufferRef *slices_buf; + size_t slices_size; + + /* Vulkan functions needed for destruction, as no other context is guaranteed to exist */ + PFN_vkWaitSemaphores wait_semaphores; + PFN_vkDestroyImageView destroy_image_view; +} FFVulkanDecodePicture; + +/** + * Initialize decoder. + */ +int ff_vk_decode_init(AVCodecContext *avctx); + +/** + * Synchronize the contexts between 2 threads. + */ +int ff_vk_update_thread_context(AVCodecContext *dst, const AVCodecContext *src); + +/** + * Initialize hw_frames_ctx with the parameters needed to decode the stream + * using the parameters from avctx. + * + * NOTE: if avctx->internal->hwaccel_priv_data exists, will partially initialize + * the context. + */ +int ff_vk_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx); + +/** + * Removes current session parameters to recreate them + */ +int ff_vk_params_invalidate(AVCodecContext *avctx, int t, const uint8_t *b, uint32_t s); + +/** + * Prepare a frame, creates the image view, and sets up the dpb fields. + */ +int ff_vk_decode_prepare_frame(FFVulkanDecodeContext *dec, AVFrame *pic, + FFVulkanDecodePicture *vkpic, int is_current, + int alloc_dpb); + +/** + * Add slice data to frame. + */ +int ff_vk_decode_add_slice(AVCodecContext *avctx, FFVulkanDecodePicture *vp, + const uint8_t *data, size_t size, int add_startcode, + uint32_t *nb_slices, const uint32_t **offsets); + +/** + * Decode a frame. + */ +int ff_vk_decode_frame(AVCodecContext *avctx, + AVFrame *pic, FFVulkanDecodePicture *vp, + AVFrame *rpic[], FFVulkanDecodePicture *rvkp[]); + +/** + * Free a frame and its state. + */ +void ff_vk_decode_free_frame(AVHWDeviceContext *dev_ctx, FFVulkanDecodePicture *vp); + +/** + * Get an FFVkBuffer suitable for decoding from. + */ +int ff_vk_get_decode_buffer(FFVulkanDecodeContext *ctx, AVBufferRef **buf, + void *create_pNext, size_t size); + +/** + * Create VkVideoSessionParametersKHR wrapped in an AVBufferRef. + */ +int ff_vk_decode_create_params(AVBufferRef **par_ref, void *logctx, FFVulkanDecodeShared *ctx, + const VkVideoSessionParametersCreateInfoKHR *session_params_create); + +/** + * Flush decoder. + */ +void ff_vk_decode_flush(AVCodecContext *avctx); + +/** + * Free decoder. + */ +int ff_vk_decode_uninit(AVCodecContext *avctx); + +#endif /* AVCODEC_VULKAN_DECODE_H */ diff --git a/include/libavcodec/vulkan_encode.h b/include/libavcodec/vulkan_encode.h new file mode 100644 index 0000000..a7a02d5 --- /dev/null +++ b/include/libavcodec/vulkan_encode.h @@ -0,0 +1,259 @@ +/* + * 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_VULKAN_ENCODE_H +#define AVCODEC_VULKAN_ENCODE_H + +#include "codec_id.h" +#include "internal.h" + +#include "encode.h" +#include "hwconfig.h" + +#include "vulkan_video.h" +#include "hw_base_encode.h" + +typedef struct FFVulkanEncodeDescriptor { + enum AVCodecID codec_id; + FFVulkanExtensions encode_extension; + VkVideoCodecOperationFlagBitsKHR encode_op; + + VkExtensionProperties ext_props; +} FFVulkanEncodeDescriptor; + +typedef struct FFVulkanEncodePicture { + FFHWBaseEncodePicture base; + VkVideoPictureResourceInfoKHR dpb_res; + VkVideoReferenceSlotInfoKHR dpb_slot; + + struct { + VkImageView view; + VkImageAspectFlags aspect; + } in; + + struct { + VkImageView view; + VkImageAspectFlags aspect; + } dpb; + + void *codec_layer; + void *codec_rc_layer; + + FFVkExecContext *exec; + AVBufferRef *pkt_buf; + int slices_offset; +} FFVulkanEncodePicture; + +/** + * Callback for writing stream-level headers. + */ +typedef int (*vkenc_cb_write_stream_headers)(AVCodecContext *avctx, + uint8_t *data, size_t *data_len); + +/** + * Callback for initializing codec-specific picture headers. + */ +typedef int (*vkenc_cb_init_pic_headers)(AVCodecContext *avctx, + FFVulkanEncodePicture *pic); + +/** + * Callback for writing alignment data. + * Align is the value to align offset to. + */ +typedef int (*vkenc_cb_write_filler)(AVCodecContext *avctx, uint32_t filler, + uint8_t *data, size_t *data_len); + +/** + * Callback for writing any extra units requested. data_len must be set + * to the available size, and its value will be overwritten by the #bytes written + * to the output buffer. + */ +typedef int (*vkenc_cb_write_extra_headers)(AVCodecContext *avctx, + FFVulkanEncodePicture *pic, + uint8_t *data, size_t *data_len); + +typedef struct FFVulkanCodec { + /** + * Codec feature flags. + */ + int flags; +/* Codec output packet without timestamp delay, which means the + * output packet has same PTS and DTS. For AV1. */ +#define VK_ENC_FLAG_NO_DELAY 1 << 6 + + /** + * Size of the codec-specific picture struct. + */ + size_t picture_priv_data_size; + + /** + * Size of the filler header. + */ + size_t filler_header_size; + + /** + * Initialize codec-specific structs in a Vulkan profile. + */ + int (*init_profile)(AVCodecContext *avctx, VkVideoProfileInfoKHR *profile, + void *pnext); + + /** + * Initialize codec-specific rate control structures for a picture. + */ + int (*init_pic_rc)(AVCodecContext *avctx, FFHWBaseEncodePicture *pic, + VkVideoEncodeRateControlInfoKHR *rc_info, + VkVideoEncodeRateControlLayerInfoKHR *rc_layer); + + /** + * Initialize codec-specific picture parameters. + */ + int (*init_pic_params)(AVCodecContext *avctx, FFHWBaseEncodePicture *pic, + VkVideoEncodeInfoKHR *encode_info); + + /** + * Callback for writing stream headers. + */ + int (*write_sequence_headers)(AVCodecContext *avctx, + FFHWBaseEncodePicture *base_pic, + uint8_t *data, size_t *data_len); + + /** + * Callback for writing alignment data. + */ + int (*write_filler)(AVCodecContext *avctx, uint32_t filler, + uint8_t *data, size_t *data_len); + + /** + * Callback for writing any extra units requested. data_len must be set + * to the available size, and its value will be overwritten by the #bytes written + * to the output buffer. + */ + int (*write_extra_headers)(AVCodecContext *avctx, FFHWBaseEncodePicture *pic, + uint8_t *data, size_t *data_len); +} FFVulkanCodec; + +typedef struct FFVkEncodeCommonOptions { + int qp; + int quality; + int profile; + int level; + int tier; + int async_depth; + VkVideoEncodeUsageFlagBitsKHR usage; + VkVideoEncodeContentFlagBitsKHR content; + VkVideoEncodeTuningModeKHR tune; + + VkVideoEncodeRateControlModeFlagBitsKHR rc_mode; +#define FF_VK_RC_MODE_AUTO 0xFFFFFFFF +} FFVkEncodeCommonOptions; + +typedef struct FFVulkanEncodeContext { + FFVulkanContext s; + FFVkVideoCommon common; + FFHWBaseEncodeContext base; + const FFVulkanCodec *codec; + + int explicit_qp; + int session_reset; + + /* Session parameters object, initialized by each codec independently + * and set here. */ + VkVideoSessionParametersKHR session_params; + + AVBufferPool *buf_pool; + + VkFormat pic_format; + + FFVkEncodeCommonOptions opts; + + VkVideoProfileInfoKHR profile; + VkVideoProfileListInfoKHR profile_list; + VkVideoCapabilitiesKHR caps; + VkVideoEncodeQualityLevelPropertiesKHR quality_props; + VkVideoEncodeCapabilitiesKHR enc_caps; + VkVideoEncodeUsageInfoKHR usage_info; + + FFVkQueueFamilyCtx qf_enc; + FFVkExecPool enc_pool; + + FFHWBaseEncodePicture *slots[32]; +} FFVulkanEncodeContext; + +#define VULKAN_ENCODE_COMMON_OPTIONS \ + { "qp", "Use an explicit constant quantizer for the whole stream", OFFSET(common.opts.qp), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 255, FLAGS }, \ + { "quality", "Set encode quality (trades off against speed, higher is faster)", OFFSET(common.opts.quality), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS }, \ + { "rc_mode", "Select rate control type", OFFSET(common.opts.rc_mode), AV_OPT_TYPE_INT, { .i64 = FF_VK_RC_MODE_AUTO }, 0, FF_VK_RC_MODE_AUTO, FLAGS, "rc_mode" }, \ + { "auto", "Choose mode automatically based on parameters", 0, AV_OPT_TYPE_CONST, { .i64 = FF_VK_RC_MODE_AUTO }, INT_MIN, INT_MAX, FLAGS, "rc_mode" }, \ + { "driver", "Driver-specific rate control", 0, AV_OPT_TYPE_CONST, { .i64 = VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DEFAULT_KHR }, INT_MIN, INT_MAX, FLAGS, "rc_mode" }, \ + { "cqp", "Constant quantizer mode", 0, AV_OPT_TYPE_CONST, { .i64 = VK_VIDEO_ENCODE_RATE_CONTROL_MODE_DISABLED_BIT_KHR }, INT_MIN, INT_MAX, FLAGS, "rc_mode" }, \ + { "cbr", "Constant bitrate mode", 0, AV_OPT_TYPE_CONST, { .i64 = VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR }, INT_MIN, INT_MAX, FLAGS, "rc_mode" }, \ + { "vbr", "Variable bitrate mode", 0, AV_OPT_TYPE_CONST, { .i64 = VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR }, INT_MIN, INT_MAX, FLAGS, "rc_mode" }, \ + { "tune", "Select tuning type", OFFSET(common.opts.tune), AV_OPT_TYPE_INT, { .i64 = VK_VIDEO_ENCODE_TUNING_MODE_DEFAULT_KHR }, 0, INT_MAX, FLAGS, "tune" }, \ + { "default", "Default tuning", 0, AV_OPT_TYPE_CONST, { .i64 = VK_VIDEO_ENCODE_TUNING_MODE_DEFAULT_KHR }, INT_MIN, INT_MAX, FLAGS, "tune" }, \ + { "hq", "High quality tuning", 0, AV_OPT_TYPE_CONST, { .i64 = VK_VIDEO_ENCODE_TUNING_MODE_HIGH_QUALITY_KHR }, INT_MIN, INT_MAX, FLAGS, "tune" }, \ + { "ll", "Low-latency tuning", 0, AV_OPT_TYPE_CONST, { .i64 = VK_VIDEO_ENCODE_TUNING_MODE_LOW_LATENCY_KHR }, INT_MIN, INT_MAX, FLAGS, "tune" }, \ + { "ull", "Ultra low-latency tuning", 0, AV_OPT_TYPE_CONST, { .i64 = VK_VIDEO_ENCODE_TUNING_MODE_ULTRA_LOW_LATENCY_KHR }, INT_MIN, INT_MAX, FLAGS, "tune" }, \ + { "lossless", "Lossless mode tuning", 0, AV_OPT_TYPE_CONST, { .i64 = VK_VIDEO_ENCODE_TUNING_MODE_LOSSLESS_KHR }, INT_MIN, INT_MAX, FLAGS, "tune" }, \ + { "usage", "Select usage type", OFFSET(common.opts.usage), AV_OPT_TYPE_FLAGS, { .i64 = VK_VIDEO_ENCODE_USAGE_DEFAULT_KHR }, 0, INT_MAX, FLAGS, "usage" }, \ + { "default", "Default optimizations", 0, AV_OPT_TYPE_CONST, { .i64 = VK_VIDEO_ENCODE_USAGE_DEFAULT_KHR }, INT_MIN, INT_MAX, FLAGS, "usage" }, \ + { "transcode", "Optimize for transcoding", 0, AV_OPT_TYPE_CONST, { .i64 = VK_VIDEO_ENCODE_USAGE_TRANSCODING_BIT_KHR }, INT_MIN, INT_MAX, FLAGS, "usage" }, \ + { "stream", "Optimize for streaming", 0, AV_OPT_TYPE_CONST, { .i64 = VK_VIDEO_ENCODE_USAGE_STREAMING_BIT_KHR }, INT_MIN, INT_MAX, FLAGS, "usage" }, \ + { "record", "Optimize for offline recording", 0, AV_OPT_TYPE_CONST, { .i64 = VK_VIDEO_ENCODE_USAGE_RECORDING_BIT_KHR }, INT_MIN, INT_MAX, FLAGS, "usage" }, \ + { "conference", "Optimize for teleconferencing", 0, AV_OPT_TYPE_CONST, { .i64 = VK_VIDEO_ENCODE_USAGE_CONFERENCING_BIT_KHR }, INT_MIN, INT_MAX, FLAGS, "usage" }, \ + { "content", "Select content type", OFFSET(common.opts.content), AV_OPT_TYPE_FLAGS, { .i64 = VK_VIDEO_ENCODE_CONTENT_DEFAULT_KHR }, 0, INT_MAX, FLAGS, "content" }, \ + { "default", "Default content", 0, AV_OPT_TYPE_CONST, { .i64 = VK_VIDEO_ENCODE_CONTENT_DEFAULT_KHR }, INT_MIN, INT_MAX, FLAGS, "content" }, \ + { "camera", "Camera footage", 0, AV_OPT_TYPE_CONST, { .i64 = VK_VIDEO_ENCODE_CONTENT_CAMERA_BIT_KHR }, INT_MIN, INT_MAX, FLAGS, "content" }, \ + { "desktop", "Screen recording", 0, AV_OPT_TYPE_CONST, { .i64 = VK_VIDEO_ENCODE_CONTENT_DESKTOP_BIT_KHR }, INT_MIN, INT_MAX, FLAGS, "content" }, \ + { "rendered", "Game or 3D content", 0, AV_OPT_TYPE_CONST, { .i64 = VK_VIDEO_ENCODE_CONTENT_RENDERED_BIT_KHR }, INT_MIN, INT_MAX, FLAGS, "content" } + +/** + * Initialize encoder. + */ +av_cold int ff_vulkan_encode_init(AVCodecContext *avctx, FFVulkanEncodeContext *ctx, + const FFVulkanEncodeDescriptor *vk_desc, + const FFVulkanCodec *codec, + void *codec_caps, void *quality_pnext); + +/** + * Write out the extradata in case its needed. + */ +av_cold int ff_vulkan_write_global_header(AVCodecContext *avctx, + FFVulkanEncodeContext *ctx); + +/** + * Encode. + */ +int ff_vulkan_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt); + +/** + * Uninitialize encoder. + */ +void ff_vulkan_encode_uninit(FFVulkanEncodeContext *ctx); + +/** + * Create session parameters. + */ +int ff_vulkan_encode_create_session_params(AVCodecContext *avctx, FFVulkanEncodeContext *ctx, + void *codec_params_pnext); + +/** + * Paperwork. + */ +extern const AVCodecHWConfigInternal *const ff_vulkan_encode_hw_configs[]; + +#endif /* AVCODEC_VULKAN_ENCODE_H */ diff --git a/include/libavcodec/vulkan_video.h b/include/libavcodec/vulkan_video.h new file mode 100644 index 0000000..c205f7b --- /dev/null +++ b/include/libavcodec/vulkan_video.h @@ -0,0 +1,108 @@ +/* + * 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_VULKAN_VIDEO_H +#define AVCODEC_VULKAN_VIDEO_H + +#include "avcodec.h" +#include "vulkan.h" + +#include + +#define CODEC_VER_MAJ(ver) (ver >> 22) +#define CODEC_VER_MIN(ver) ((ver >> 12) & ((1 << 10) - 1)) +#define CODEC_VER_PAT(ver) (ver & ((1 << 12) - 1)) +#define CODEC_VER(ver) CODEC_VER_MAJ(ver), CODEC_VER_MIN(ver), CODEC_VER_PAT(ver) + +typedef struct FFVkVideoSession { + VkVideoSessionKHR session; + VkDeviceMemory *mem; + uint32_t nb_mem; + + VkSamplerYcbcrConversion yuv_sampler; + + AVBufferRef *dpb_hwfc_ref; + int layered_dpb; + AVFrame *layered_frame; + VkImageView layered_view; + VkImageAspectFlags layered_aspect; +} FFVkVideoCommon; + +/** + * Get pixfmt from a Vulkan format. + */ +enum AVPixelFormat ff_vk_pix_fmt_from_vkfmt(VkFormat vkf); + +/** + * Get aspect bits which include all planes from a VkFormat. + */ +VkImageAspectFlags ff_vk_aspect_bits_from_vkfmt(VkFormat vkf); + +/** + * Get Vulkan's chroma subsampling from a pixfmt descriptor. + */ +VkVideoChromaSubsamplingFlagBitsKHR ff_vk_subsampling_from_av_desc(const AVPixFmtDescriptor *desc); + +/** + * Get Vulkan's bit depth from an [8:12] integer. + */ +VkVideoComponentBitDepthFlagBitsKHR ff_vk_depth_from_av_depth(int depth); + +/** + * Chooses a QF and loads it into a context. + */ +int ff_vk_video_qf_init(FFVulkanContext *s, FFVkQueueFamilyCtx *qf, + VkQueueFlagBits family, VkVideoCodecOperationFlagBitsKHR caps); + +/** + * Convert level from Vulkan to AV. + */ +int ff_vk_h264_level_to_av(StdVideoH264LevelIdc level); +int ff_vk_h265_level_to_av(StdVideoH265LevelIdc level); + +StdVideoH264LevelIdc ff_vk_h264_level_to_vk(int level_idc); +StdVideoH265LevelIdc ff_vk_h265_level_to_vk(int level_idc); + +/** + * Convert profile from/to AV to Vulkan + */ +StdVideoH264ProfileIdc ff_vk_h264_profile_to_vk(int profile); +StdVideoH265ProfileIdc ff_vk_h265_profile_to_vk(int profile); +int ff_vk_h264_profile_to_av(StdVideoH264ProfileIdc profile); +int ff_vk_h265_profile_to_av(StdVideoH264ProfileIdc profile); + +/** + * Creates image views for video frames. + */ +int ff_vk_create_view(FFVulkanContext *s, FFVkVideoCommon *common, + VkImageView *view, VkImageAspectFlags *aspect, + AVVkFrame *src, VkFormat vkf, int is_dpb); + +/** + * Initialize video session, allocating and binding necessary memory. + */ +int ff_vk_video_common_init(AVCodecContext *avctx, FFVulkanContext *s, + FFVkVideoCommon *common, + VkVideoSessionCreateInfoKHR *session_create); + +/** + * Free video session and required resources. + */ +void ff_vk_video_common_uninit(FFVulkanContext *s, FFVkVideoCommon *common); + +#endif /* AVCODEC_VULKAN_VIDEO_H */ diff --git a/include/libavcodec/vvc.h b/include/libavcodec/vvc.h new file mode 100644 index 0000000..9263977 --- /dev/null +++ b/include/libavcodec/vvc.h @@ -0,0 +1,159 @@ +/* + * H.266 / VVC shared code + * + * 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_VVC_H +#define AVCODEC_VVC_H + +/** + * Table 5 – NAL unit type codes and NAL unit type classes + * in T-REC-H.266-202008 + */ +enum VVCNALUnitType { + VVC_TRAIL_NUT = 0, + VVC_STSA_NUT = 1, + VVC_RADL_NUT = 2, + VVC_RASL_NUT = 3, + VVC_RSV_VCL_4 = 4, + VVC_RSV_VCL_5 = 5, + VVC_RSV_VCL_6 = 6, + VVC_IDR_W_RADL = 7, + VVC_IDR_N_LP = 8, + VVC_CRA_NUT = 9, + VVC_GDR_NUT = 10, + VVC_RSV_IRAP_11 = 11, + VVC_OPI_NUT = 12, + VVC_DCI_NUT = 13, + VVC_VPS_NUT = 14, + VVC_SPS_NUT = 15, + VVC_PPS_NUT = 16, + VVC_PREFIX_APS_NUT = 17, + VVC_SUFFIX_APS_NUT = 18, + VVC_PH_NUT = 19, + VVC_AUD_NUT = 20, + VVC_EOS_NUT = 21, + VVC_EOB_NUT = 22, + VVC_PREFIX_SEI_NUT = 23, + VVC_SUFFIX_SEI_NUT = 24, + VVC_FD_NUT = 25, + VVC_RSV_NVCL_26 = 26, + VVC_RSV_NVCL_27 = 27, + VVC_UNSPEC_28 = 28, + VVC_UNSPEC_29 = 29, + VVC_UNSPEC_30 = 30, + VVC_UNSPEC_31 = 31, +}; + +enum VVCSliceType { + VVC_SLICE_TYPE_B = 0, + VVC_SLICE_TYPE_P = 1, + VVC_SLICE_TYPE_I = 2, +}; + +enum VVCAPSType { + VVC_ASP_TYPE_ALF = 0, + VVC_ASP_TYPE_LMCS = 1, + VVC_ASP_TYPE_SCALING = 2, +}; + +enum { + //6.2 we can have 3 sample arrays + VVC_MAX_SAMPLE_ARRAYS = 3, + + //7.4.3.3 vps_max_layers_minus1 is u(6) + VVC_MAX_LAYERS = 64, + + //7.4.3.3 The value of vps_max_sublayers_minus1 shall be in the range of 0 to 6, inclusive + VVC_MAX_SUBLAYERS = 7, + + //7.3.2.1 dci_num_ptls_minus1 is u(4) + VVC_MAX_DCI_PTLS = 16, + + //7.4.3.3 vps_num_ptls_minus1 is u(8) + VVC_MAX_PTLS = 256, + + //7.4.3.3 vps_num_output_layer_sets_minus2 is u(8) + VVC_MAX_TOTAL_NUM_OLSS = 257, + + // 7.3.2.3: vps_video_parameter_set_id is u(4). + VVC_MAX_VPS_COUNT = 16, + // 7.3.2.4: sps_seq_parameter_set_id is u(4) + VVC_MAX_SPS_COUNT = 16, + // 7.3.2.5: pps_pic_parameter_set_id is u(6) + VVC_MAX_PPS_COUNT = 64, + + // 7.4.4.1: ptl_num_sub_profiles is u(8) + VVC_MAX_SUB_PROFILES = 256, + + // 7.4.3.18: The variable NumAlfFilters specifying the number of different adaptive loop + // filters is set equal to 25. + VVC_NUM_ALF_FILTERS = 25, + + // A.4.2: according to (1577), MaxDpbSize is bounded above by 2 * maxDpbPicBuf(8) + VVC_MAX_DPB_SIZE = 16, + + //7.4.3.4 sps_num_ref_pic_lists in range [0, 64] + VVC_MAX_REF_PIC_LISTS = 64, + + //7.4.11 num_ref_entries in range [0, MaxDpbSize + 13] + VVC_MAX_REF_ENTRIES = VVC_MAX_DPB_SIZE + 13, + + //7.4.3.3 sps_num_points_in_qp_table_minus1[i] in range [0, 36 − sps_qp_table_start_minus26[i]], + //and sps_qp_table_start_minus26[i] in range [−26 − QpBdOffset, 36]. + //so sps_num_points_in_qp_table_minus1[i] should in range [0, 62 + QpBdOffset] + //since 16 bits QpBdOffset is 48, sps_num_points_in_qp_table_minus1[i] should range [0, 110] + VVC_MAX_POINTS_IN_QP_TABLE = 111, + + // 7.4.6.1: hrd_cpb_cnt_minus1 is in [0, 31]. + VVC_MAX_CPB_CNT = 32, + + // A.4.1: the highest level allows a MaxLumaPs of 80,216,064. + VVC_MAX_LUMA_PS = 80216064, + + // A.4.1: pic_width_in_luma_samples and pic_height_in_luma_samples are + // constrained to be not greater than sqrt(MaxLumaPs * 8). Hence height/ + // width are bounded above by sqrt(8 * 80216064) = 25332.4 samples. + VVC_MAX_WIDTH = 25332, + VVC_MAX_HEIGHT = 25332, + + // A.4.1: table A.2 allows at most 990 tiles per AU for any level. + VVC_MAX_TILES_PER_AU = 990, + // A.4.1: table A.2 did not define max tile rows. + // in worest a case, we can have 1x990 tiles picture. + VVC_MAX_TILE_ROWS = VVC_MAX_TILES_PER_AU, + // A.4.1: table A.2 allows at most 30 tile columns for any level. + VVC_MAX_TILE_COLUMNS = 30, + + // A.4.1 table A.2 allows at most 1000 slices for any level. + VVC_MAX_SLICES = 1000, + + // 7.4.8: in the worst case (!pps_no_pic_partition_flag and + // sps_entropy_coding_sync_enabled_flag are both true), entry points can be + // placed at the beginning of every Ctb row in every tile, giving an + // upper bound of (num_tile_columns_minus1 + 1) * PicHeightInCtbsY - 1. + // Only a stream with very high resolution and perverse parameters could + // get near that, though, so set a lower limit here with the maximum + // possible value for 8K video (at most 135 32x32 Ctb rows). + VVC_MAX_ENTRY_POINTS = VVC_MAX_TILE_COLUMNS * 135, + + // {sps, ph}_num_{ver, hor}_virtual_boundaries should in [0, 3] + VVC_MAX_VBS = 3, +}; + +#endif /* AVCODEC_VVC_H */ diff --git a/include/libavcodec/wavpack.h b/include/libavcodec/wavpack.h new file mode 100644 index 0000000..2efbb1f --- /dev/null +++ b/include/libavcodec/wavpack.h @@ -0,0 +1,167 @@ +/* + * WavPack decoder/encoder common code + * Copyright (c) 2006,2011 Konstantin Shishkov + * + * 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_WAVPACK_H +#define AVCODEC_WAVPACK_H + +#include +#include +#include "libavutil/attributes.h" +#include "libavutil/intmath.h" + +#define MAX_TERMS 16 +#define MAX_TERM 8 + +#define WV_HEADER_SIZE 32 + +#define WV_MONO 0x00000004 +#define WV_JOINT_STEREO 0x00000010 +#define WV_CROSS_DECORR 0x00000020 +#define WV_FLOAT_DATA 0x00000080 +#define WV_INT32_DATA 0x00000100 +#define WV_FALSE_STEREO 0x40000000 +#define WV_DSD_DATA 0x80000000 + +#define WV_HYBRID_MODE 0x00000008 +#define WV_HYBRID_SHAPE 0x00000008 +#define WV_HYBRID_BITRATE 0x00000200 +#define WV_HYBRID_BALANCE 0x00000400 +#define WV_INITIAL_BLOCK 0x00000800 +#define WV_FINAL_BLOCK 0x00001000 + +#define WV_MONO_DATA (WV_MONO | WV_FALSE_STEREO) + +#define WV_SINGLE_BLOCK (WV_INITIAL_BLOCK | WV_FINAL_BLOCK) + +#define WV_FLT_SHIFT_ONES 0x01 +#define WV_FLT_SHIFT_SAME 0x02 +#define WV_FLT_SHIFT_SENT 0x04 +#define WV_FLT_ZERO_SENT 0x08 +#define WV_FLT_ZERO_SIGN 0x10 + +#define WV_MAX_CHANNELS (1 << 12) +#define WV_MAX_SAMPLES 150000 + +enum WP_ID_Flags { + WP_IDF_MASK = 0x3F, + WP_IDF_IGNORE = 0x20, + WP_IDF_ODD = 0x40, + WP_IDF_LONG = 0x80 +}; + +enum WP_ID { + WP_ID_DUMMY = 0, + WP_ID_ENCINFO, + WP_ID_DECTERMS, + WP_ID_DECWEIGHTS, + WP_ID_DECSAMPLES, + WP_ID_ENTROPY, + WP_ID_HYBRID, + WP_ID_SHAPING, + WP_ID_FLOATINFO, + WP_ID_INT32INFO, + WP_ID_DATA, + WP_ID_CORR, + WP_ID_EXTRABITS, + WP_ID_CHANINFO, + WP_ID_DSD_DATA, + WP_ID_SAMPLE_RATE = 0x27, +}; + +typedef struct Decorr { + int delta; + int value; + int weightA; + int weightB; + int samplesA[MAX_TERM]; + int samplesB[MAX_TERM]; + int sumA; + int sumB; +} Decorr; + +typedef struct WvChannel { + int median[3]; + int slow_level, error_limit; + unsigned bitrate_acc, bitrate_delta; +} WvChannel; + +// macros for manipulating median values +#define GET_MED(n) ((c->median[n] >> 4) + 1) +#define DEC_MED(n) c->median[n] -= ((int)(c->median[n] + (128U >> (n)) - 2) / (128 >> (n))) * 2U +#define INC_MED(n) c->median[n] += ((int)(c->median[n] + (128U >> (n)) ) / (128 >> (n))) * 5U + +// macros for applying weight +#define UPDATE_WEIGHT_CLIP(weight, delta, samples, in) \ + if ((samples) && (in)) { \ + if (((samples) ^ (in)) < 0) { \ + (weight) -= (delta); \ + if ((weight) < -1024) \ + (weight) = -1024; \ + } else { \ + (weight) += (delta); \ + if ((weight) > 1024) \ + (weight) = 1024; \ + } \ + } + +static const int wv_rates[16] = { + 6000, 8000, 9600, 11025, 12000, 16000, 22050, 24000, + 32000, 44100, 48000, 64000, 88200, 96000, 192000, 0 +}; + +// exponent table copied from WavPack source +extern const uint8_t ff_wp_exp2_table[256]; +extern const uint8_t ff_wp_log2_table[256]; + +static av_always_inline int wp_exp2(int16_t val) +{ + int res, neg = 0; + + if (val < 0) { + val = -val; + neg = 1; + } + + res = ff_wp_exp2_table[val & 0xFF] | 0x100; + val >>= 8; + if (val > 31U) + return INT_MIN; + res = (val > 9) ? (res << (val - 9)) : (res >> (9 - val)); + return neg ? -res : res; +} + +static av_always_inline int wp_log2(uint32_t val) +{ + int bits; + + if (!val) + return 0; + if (val == 1) + return 256; + val += val >> 9; + bits = av_log2(val) + 1; + if (bits < 9) + return (bits << 8) + ff_wp_log2_table[(val << (9 - bits)) & 0xFF]; + else + return (bits << 8) + ff_wp_log2_table[(val >> (bits - 9)) & 0xFF]; +} + +#endif /* AVCODEC_WAVPACK_H */ diff --git a/include/libavcodec/wavpackenc.h b/include/libavcodec/wavpackenc.h new file mode 100644 index 0000000..b6d12e8 --- /dev/null +++ b/include/libavcodec/wavpackenc.h @@ -0,0 +1,655 @@ +/* + * WavPack lossless audio encoder + * + * 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_WAVPACKENC_H +#define AVCODEC_WAVPACKENC_H + +#include +#include "libavutil/macros.h" +#include "wavpack.h" + +typedef struct WavPackDecorrSpec { + int8_t joint_stereo, delta, terms[MAX_TERMS+1]; +} WavPackDecorrSpec; + +static const WavPackDecorrSpec fast_specs[] = { + { 1, 2, { 18,17 } }, { 1, 1, { 17,17 } }, { 0, 2, { 18,17 } }, + { 0, 1, { 17,17 } }, { 1, 3, { 1,18 } }, { 1, 1, { 17, 1 } }, + { 0, 1, { 1,17 } }, { 0, 1, { -2,17 } }, { 0, 2, { -1,17 } }, + { 1, 1, { 17, 2 } }, { 0, 3, { 18,18 } }, { 0, 1, { 17, 1 } }, + { 1, 6, { 1, 2 } }, { 1, 1, { 17, 3 } }, { 0, 1, { -2, 3 } }, + { 0, 1, { 2,17 } }, { 0, 1, { 18,-2 } }, { 0, 1, { -1,17 } }, + { 0, 1, { 18,17 } }, { 0, 1, { 17, 2 } }, { 1, 2, { 18,-2 } }, + { 1, 1, { 1,17 } }, { 0, 3, { 18, 2 } }, { 0, 1, { 17,-2 } }, + { 0, 1, { 18,-2 } }, { 1, 2, { 17,-3 } }, { 0, 1, { 18, 3 } }, + { 0, 1, { 18,18 } }, { 1, 1, { 1, 3 } }, { 1, 1, { 18, 3 } }, + { 1, 1, { 1, 3 } }, { 0, 2, { 18,17 } }, { 1, 1, { 1,17 } }, + { 1, 1, { 17, 3 } }, { 0, 3, { 18,17 } }, { 0, 1, { 18,18 } }, + { 1, 1, { 1, 3 } }, { 1, 1, { 1,18 } }, { 0, 1, { 18,-2 } }, + { 0, 2, { 18,17 } }, { 0, 1, { -1,18 } }, { 1, 1, { 17, 3 } }, + { 0, 1, { 17, 2 } }, { 0, 1, { 17, 3 } }, { 1, 1, { 18, 2 } }, + { 1, 1, { 17,-2 } }, { 0, 1, { 1,-2 } }, { 0, 2, { 18,17 } }, + { 0, 1, { 17,-2 } }, { 1, 1, { 17,-2 } }, { 0, 1, { 18, 3 } }, + { 0, 1, { 2,17 } }, { 1, 2, { 18,-3 } }, { 1, 2, { 1,18 } }, + { 1, 2, { 18, 2 } }, { 0, 1, { 17,-1 } }, { 0, 1, { 17,-2 } }, + { 1, 1, { 17,-2 } }, { 1, 1, { 1, 3 } }, { 0, 1, { 1,17 } }, + { 1, 2, { 18,-2 } }, { 1, 2, { 17,-3 } }, { 0, 2, { 18,17 } }, + { 0, 2, { 18,17 } }, { 1, 1, { 17, 2 } }, { 1, 2, { 18,18 } }, + { 0, 1, { 17, 2 } }, { 0, 1, { 18,17 } }, { 1, 1, { 1,17 } }, + { 1, 1, { 17, 2 } }, { 0, 2, { 18,18 } }, { 0, 2, { 18,17 } }, + { 1, 2, { 17,-3 } }, { 1, 6, { 1, 2 } }, { 0, 3, { 17,17 } }, + { 0, 1, { 1,18 } }, { 0, 1, { 1,-2 } }, { 1, 1, { 17, 2 } }, + { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, { 1, 1, { 18, 3 } }, + { 1, 2, { 17,-3 } }, { 0, 1, { 17, 2 } }, { 0, 1, { 17, 3 } }, + { 0, 1, { 18,-2 } }, { 1, 1, { 18,18 } }, { 1, 6, { 1, 2 } }, + { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, { 0, 1, { -1,17 } }, + { 1, 1, { 18, 3 } }, { 0, 1, { 17,18 } }, { 1, 1, { 17, 3 } }, + { 0, 1, { 18, 3 } }, { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, + { 1, 2, { 18, 2 } }, { 0, 1, { -2, 3 } }, { 0, 4, { 18,-1 } }, + { 0, 2, { 18,18 } }, { 0, 1, { -2, 3 } }, { 1, 1, { 17,-2 } }, + { 0, 1, { 17, 3 } }, { 0, 2, { 18,17 } }, { 0, 2, { -1,18 } }, + { 1, 1, { 2,17 } }, { 0, 2, { 17,-2 } }, { 0, 1, { 17, 2 } }, + { 1, 2, { 18,-3 } }, { 0, 1, { 17,-2 } }, { 0, 2, { 18,17 } }, + { 0, 2, { 18,17 } }, { 1, 1, { 17,-2 } }, { 1, 2, { 17,-3 } }, + { 1, 1, { 1, 3 } }, { 1, 1, { 2,17 } }, { 1, 2, { 18, 2 } }, + { 1, 1, { 2,17 } }, { 1, 1, { 18, 2 } }, { 0, 2, { 18,17 } }, + { 0, 2, { 18,17 } }, { 0, 1, { 17,-2 } }, { 0, 2, { 18,17 } }, + { 0, 2, { 17,-1 } }, { 0, 2, { 18,-2 } }, { 0, 2, { 18,17 } }, + { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, { 1, 1, { 1, 3 } }, + { 0, 2, { -2,17 } }, { 0, 2, { 18,-2 } }, { 0, 2, { 17,-2 } }, + { 1, 1, { 2,17 } }, { 1, 1, { 1, 3 } }, { 0, 1, { 2,17 } }, + { 0, 2, { 18,17 } }, { 0, 3, { -1,17 } }, { 1, 1, { 2,17 } }, + { 0, 2, { 18,18 } }, { 0, 1, { 17, 2 } }, { 1, 4, { 18,-3 } }, + { 1, 1, { 18, 1 } }, { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, + { 1, 2, { 18,-1 } }, { 0, 1, { -1,18 } }, { 1, 6, { 1, 2 } }, + { 1, 1, { 17, 2 } }, { 1, 4, { 18, 3 } }, { 0, 1, { 1,17 } }, + { 0, 1, { 18, 2 } }, { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, + { 1, 2, { 17, 2 } }, { 0, 2, { 18,-2 } }, { 0, 1, { 1,18 } }, + { 1, 2, { 18,-3 } }, { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, + { 0, 2, { 18,17 } }, { 1, 2, { 18,18 } }, { 1, 3, { 17,17 } }, + { 0, 1, { -2,17 } }, { 0, 1, { 17,18 } }, { 0, 1, { -1, 3 } }, + { 1, 1, { 2,17 } }, { 0, 2, { 18,-1 } }, { 0, 2, { 18,17 } }, + { 0, 2, { 18,17 } }, { 1, 1, { 17,-2 } }, { 1, 2, { 17, 2 } }, + { 1, 1, { 18, 3 } }, { 0, 1, { 18, 2 } }, { 1, 2, { 17,-3 } }, + { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, { 0, 1, { -2,17 } }, + { 0, 1, { 17,-1 } }, { 0, 1, { 18,-1 } }, { 0, 2, { 18,17 } }, + { 1, 2, { 17,-3 } }, { 1, 1, { 1,18 } }, { 1, 3, { 18, 2 } }, + { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, + { 0, 2, { 18,17 } }, { 0, 3, { 18,18 } }, { 0, 1, { 1,-2 } }, + { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, + { 1, 2, { 17,-3 } }, { 1, 1, { 18,18 } }, { 0, 2, { 18, 2 } }, + { 0, 1, { 17,18 } }, { 1, 2, { 18, 2 } }, { 1, 1, { 17,-2 } }, + { 0, 2, { 17,-1 } }, { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, + { 0, 2, { 18,17 } }, { 0, 1, { 1,-2 } }, { 0, 1, { 18, 1 } }, + { 1, 2, { 18,-2 } }, { 0, 1, { 17, 2 } }, { 0, 2, { 18,17 } }, + { 0, 2, { 18,17 } }, { 1, 1, { 17, 3 } }, { 0, 1, { 17,-1 } }, + { 0, 1, { 18, 2 } }, { 1, 1, { 17, 3 } }, { 1, 1, { 17,-2 } }, + { 0, 1, { 18,18 } }, { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, + { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, + { 1, 1, { 17,18 } }, { 0, 1, { -2, 3 } }, { 0, 2, { 18,17 } }, + { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, { 1, 2, { 18,-3 } }, + { 0, 2, { 18,17 } }, { 0, 3, { 18, 2 } }, { 0, 1, { 1,18 } }, + { 0, 2, { 18,17 } }, { 0, 1, { 17,-1 } }, { 0, 2, { 18,17 } }, + { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, { 0, 1, { -2, 3 } }, + { 0, 3, { 17,17 } }, { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, + { 1, 1, { 17, 2 } }, { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, + { 1, 1, { 17, 2 } }, { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, + { 0, 2, { 18,17 } }, { 0, 2, { 18, 2 } }, { 0, 2, { 18,17 } }, + { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, + { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, + { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, { 0, 2, { 18,17 } }, + { 0, 2, { 18,17 } }, +}; + +static const WavPackDecorrSpec default_specs[] = { + { 1, 2, { 18,18, 2,17, 3 } }, { 0, 2, { 18,17,-1, 3, 2 } }, + { 1, 1, { 17,18,18,-2, 2 } }, { 0, 2, { 18,17, 3,-2,17 } }, + { 1, 2, { 18,17, 2,17, 3 } }, { 0, 1, { 18,18,-1, 2,17 } }, + { 0, 1, { 17,17,-2, 2, 3 } }, { 0, 1, { 18,-2,18, 2,17 } }, + { 1, 2, { 18,18,-1, 2, 3 } }, { 0, 2, { 18,17, 3, 2, 5 } }, + { 1, 1, { 18,17,18, 2, 5 } }, { 0, 1, { 17,17,-2, 2, 3 } }, + { 0, 1, { 18,-2,18, 2, 5 } }, { 0, 1, { 17,-2,17, 2,-3 } }, + { 1, 1, { 17,-2,17, 1, 2 } }, { 0, 1, { 17,17,-2, 2, 3 } }, + { 1, 1, { 18, 3, 1, 5, 4 } }, { 1, 4, { 18,18, 2, 3,-2 } }, + { 0, 1, { 1,-1,-1, 2,17 } }, { 0, 2, { 18,17, 3, 2, 5 } }, + { 0, 1, { 18,18,18, 2,17 } }, { 0, 1, { 18,17,-1, 2,18 } }, + { 1, 1, { 17, 3, 2, 1, 7 } }, { 0, 2, { 18,-2,18, 2, 3 } }, + { 1, 3, { 18,-3,18, 2, 3 } }, { 0, 3, { 18,17, 2, 3,17 } }, + { 1, 1, { 17,17, 2, 1, 4 } }, { 0, 1, { 17,18,-2, 2,17 } }, + { 1, 1, { 18,18, 3, 5, 2 } }, { 0, 1, { 17,17, 2,18, 4 } }, + { 0, 1, { 18,17, 1, 4, 6 } }, { 1, 1, { 3,17,18, 2,17 } }, + { 1, 1, { 17, 3, 2, 1, 7 } }, { 0, 1, { 18,17,-1, 2, 3 } }, + { 1, 1, { 17,17, 2, 1, 4 } }, { 1, 2, { 18,17,-1,17, 3 } }, + { 1, 2, { 18,17, 2, 3,-1 } }, { 0, 2, { 18,18,-2, 2,17 } }, + { 0, 1, { 17,17, 2,18, 4 } }, { 0, 5, { -2,18,18,18, 2 } }, + { 1, 1, { 18,18,-1, 6, 3 } }, { 0, 1, { 17,17,-2, 2, 3 } }, + { 1, 1, { 18,17,18, 2,17 } }, { 0, 1, { 18,17, 4, 3, 1 } }, + { 0, 1, { -2,18, 2, 2,18 } }, { 1, 2, { 18,18,-2, 2,-1 } }, + { 1, 1, { 17,17, 2, 1, 4 } }, { 0, 1, { 17,18,-2, 2,17 } }, + { 1, 1, { 17, 3, 2, 1, 7 } }, { 1, 3, { 18,-3,18, 2, 3 } }, + { 1, 2, { 18,18,-2, 2,-1 } }, { 1, 1, { 18,18, 3, 5, 2 } }, + { 0, 2, { 18,18,-1, 2,17 } }, { 0, 1, { 18,-1,17,18, 2 } }, + { 0, 1, { 17,-1, 2, 3, 6 } }, { 0, 1, { 18,-2,18, 2, 5 } }, + { 1, 2, { 18,18,-2, 2,-1 } }, { 0, 3, { 18,18, 2, 3,17 } }, + { 0, 1, { 17,17, 2,18, 4 } }, { 1, 1, { 17,-2,17, 1, 2 } }, + { 0, 1, { -1, 3, 5, 4, 7 } }, { 0, 3, { 18,18, 3, 2, 5 } }, + { 0, 1, { 17,17, 2,18, 4 } }, { 0, 1, { 18,17,-2,18, 3 } }, + { 0, 2, { 18,18,-2, 2,17 } }, { 0, 3, { 18,17,-2, 2, 3 } }, + { 1, 1, { 18,18,-2, 2,17 } }, { 0, 1, { 18,17, 4, 3, 1 } }, + { 1, 2, { 3,18,17, 2,17 } }, { 1, 2, { 18,18, 2,-2,18 } }, + { 1, 2, { 18,18,-1,18, 2 } }, { 0, 2, { 18,18,-2, 2,17 } }, + { 1, 3, { 18,18, 2, 3,-2 } }, { 0, 3, { 18,18, 3, 2, 5 } }, + { 0, 1, { 18,-2,18, 2, 5 } }, { 1, 1, { 17, 3, 2, 1, 7 } }, + { 1, 3, { 18,18,-2, 2,18 } }, { 1, 1, { 17,18,18,-2, 2 } }, + { 0, 1, { 18,-2,18, 2, 5 } }, { 0, 2, { 18,-2,18, 2, 3 } }, + { 0, 1, { -1, 3, 4, 5, 7 } }, { 1, 1, { 17,17, 2,-1, 7 } }, + { 0, 1, { 18,-1,-1, 2,-2 } }, { 0, 2, { 18,17, 2, 3,17 } }, + { 0, 1, { 18,17, 2,18, 2 } }, { 0, 2, { 18,17,-1, 2,17 } }, + { 0, 1, { 1,18, 3, 2, 5 } }, { 0, 2, { 18,-2, 4,18, 2 } }, + { 1, 1, { 18, 3, 1, 5, 4 } }, { 0, 1, { 18,17,18, 2, 5 } }, + { 1, 1, { 18, 3, 1, 5, 4 } }, { 0, 4, { 18,18,-2, 2,18 } }, + { 1, 1, { 18,18, 3, 2, 5 } }, { 1, 1, { 17,17, 2, 1, 4 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 0, 2, { 18,18,-2,18, 2 } }, + { 1, 1, { 18,18, 2, 1, 3 } }, { 1, 1, { 17,17, 2, 1, 4 } }, + { 1, 2, { 17,17, 2,18, 3 } }, { 0, 1, { 18,17, 1, 4, 6 } }, + { 1, 2, { 18,18,-2, 2,-1 } }, { 0, 1, { 18,-2,18, 2, 5 } }, + { 1, 1, { 17, 2,18, 2,17 } }, { 0, 2, { 18,18,-2,18, 2 } }, + { 0, 1, { 18,18, 3, 6,-1 } }, { 0, 1, { 18,17, 2,18, 3 } }, + { 0, 1, { 18,17,-2, 2,17 } }, { 1, 1, { 3,17,18, 2,17 } }, + { 1, 3, { 18,-3,18, 2, 3 } }, { 1, 3, { 18,18,-3,18, 2 } }, + { 1, 1, { 18, 3, 1, 5, 4 } }, { 0, 1, { 17,-2,17, 2,-3 } }, + { 1, 1, { 18,18, 3, 5, 2 } }, { 1, 2, { 18,18,-2, 2,-1 } }, + { 0, 1, { 18,-1,-1, 2,-2 } }, { 1, 1, { 18, 3, 1, 5, 4 } }, + { 0, 3, { 18,17,-1, 2,17 } }, { 1, 3, { 18,17, 2,18,-2 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 1, 2, { 18,18,-2, 2,-1 } }, + { 1, 1, { 18, 3, 1, 5, 4 } }, { 0, 4, { 3,18,18, 2,17 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 1, 1, { 18,17,-1,18, 2 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 0, 2, { 18,18,-2,18, 2 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 0, 2, { 18,18,-2,18, 2 } }, + { 1, 1, { 18,18,18, 3, 2 } }, { 0, 1, { 17,-1, 2, 3, 6 } }, + { 0, 1, { 17,-1, 2, 3, 6 } }, { 0, 2, { 18,17,-2, 3, 2 } }, + { 1, 3, { 18,17, 2,-2,18 } }, { 0, 2, { 18,18, 2,17, 3 } }, + { 0, 1, { 18,18, 2,18,-2 } }, { 0, 2, { 18,-2, 4,18, 2 } }, + { 0, 1, { -2,18, 2, 2,18 } }, { 0, 2, { 18,17, 3, 6, 2 } }, + { 0, 1, { 18,17,18, 2, 5 } }, { 0, 3, { 18,18,-2, 3, 2 } }, + { 1, 1, { 18,18, 2,18, 5 } }, { 0, 1, { 17,-1, 2, 3, 6 } }, + { 1, 4, { 18,18, 2, 3,-2 } }, { 0, 2, { 18,17,18, 2,-2 } }, + { 0, 1, { 1,18, 3, 2, 5 } }, { 1, 4, { 18,-2,18, 2, 3 } }, + { 1, 2, { 18, 2,18, 3,-2 } }, { 0, 2, { 18,18,18, 2, 4 } }, + { 0, 2, { 3,17,18, 2,17 } }, { 1, 1, { 18,-1,18, 2,17 } }, + { 1, 2, { 17,17, 2,18, 3 } }, { 0, 2, { 18,17,-2, 3, 2 } }, + { 0, 1, { 1,-1,-1, 2,17 } }, { 0, 3, { 3,18,18, 2,17 } }, + { 0, 1, { 18,-1,17,18, 2 } }, { 0, 1, { 18,17, 2,18, 3 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 0, 1, { 18,17, 2,18, 2 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 0, 2, { 18,18,-2,18, 2 } }, + { 1, 2, { 17,17, 2,18, 3 } }, { 0, 1, { 18,17,-2, 2, 3 } }, + { 0, 1, { 18,-2,18, 2, 5 } }, { 1, 4, { 18,-2,18, 2, 3 } }, + { 1, 3, { 18,17, 2, 3, 6 } }, { 0, 2, { 18,18, 2,17, 3 } }, + { 0, 2, { 18,17, 2,18, 2 } }, { 0, 2, { 18,18,-2,18, 2 } }, + { 1, 1, { 18,18, 3, 5, 2 } }, { 0, 2, { 18,18,-2, 2, 3 } }, + { 1, 2, { 18,17, 2,17, 3 } }, { 0, 1, { 18,17, 2, 3,18 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 1, 4, { 18,18, 2, 3,-2 } }, + { 0, 1, { 17,-2,17, 2,-3 } }, { 0, 1, { 17,17, 2,18, 4 } }, + { 1, 1, { 18,18,18, 2, 4 } }, { 1, 2, { 18, 2,18, 3,-2 } }, + { 1, 1, { 18,18,-2, 2,17 } }, { 0, 2, { 18,18,-2,18, 2 } }, + { 0, 2, { 18,18, 2,17, 3 } }, { 0, 2, { 18,18,18, 2, 4 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 0, 2, { 18,17,-2, 3, 2 } }, + { 0, 1, { 1,-1,-1, 2,17 } }, { 1, 4, { 18,18, 2, 3,-2 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 0, 1, { 18,-2,18, 3, 2 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 0, 2, { 18,18,-2,18, 2 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 0, 2, { 18,18,-2,18, 2 } }, + { 0, 1, { 18,18,-2, 2,17 } }, { 0, 3, { 18,17, 2, 3,17 } }, + { 1, 2, { 18,18, 2,-2,18 } }, { 0, 1, { -1, 3, 5, 4, 7 } }, + { 1, 1, { 18, 3, 1, 5, 4 } }, { 1, 1, { 18,18,-2,18, 3 } }, + { 0, 2, { 18,17,18, 2,-2 } }, { 0, 2, { 18,18, 2,17, 3 } }, + { 1, 2, { 18, 2,18, 3,-2 } }, { 1, 4, { 18,18, 2, 3,-2 } }, + { 1, 3, { 18,17, 2, 3, 6 } }, { 0, 2, { 18,18,-2,18, 2 } }, + { 1, 2, { 18,17,-2,-1,17 } }, { 0, 1, { 17,-1, 2, 3, 6 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 0, 2, { 18,18,-2, 2, 3 } }, + { 1, 1, { 18,18,18, 2, 5 } }, { 0, 1, { 17,17,-2, 2, 3 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 0, 2, { 18,17, 3, 6, 2 } }, + { 0, 2, { 18,17,18, 2, 3 } }, { 0, 3, { 18,17,-3,18, 2 } }, + { 0, 1, { 18,18,18, 2, 3 } }, { 0, 1, { 18,-2,-3, 2, 6 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 1, 1, { 18,17,18, 2, 5 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 0, 2, { 18,18,-2,18, 2 } }, + { 1, 1, { 18,17,18, 2, 5 } }, { 0, 2, { 18,18,-2,18, 2 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 0, 2, { 18,18,-2,18, 2 } }, + { 0, 1, { 18,18,18, 2, 3 } }, { 1, 1, { 17,-2,17, 1, 2 } }, + { 1, 1, { 17,17, 2,-1, 7 } }, { 0, 1, { 18,17, 4, 3, 1 } }, + { 1, 3, { 18,-3,18, 2, 3 } }, { 0, 1, { 1,18, 3, 2, 5 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 0, 2, { 18,18,-2,18, 2 } }, + { 0, 1, { 18,18, 3, 6, 2 } }, { 0, 1, { 17,17, 2,18, 4 } }, + { 0, 1, { 17,17, 2,18, 4 } }, { 0, 2, { 18,18,-2,18, 2 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 0, 2, { 18,18,-2,18, 2 } }, + { 1, 2, { 18,-2,18, 3, 2 } }, { 1, 1, { 17,-2,17, 1, 2 } }, + { 1, 1, { 18,18, 3, 2, 5 } }, { 0, 1, { 18,18,-1, 2, 3 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 0, 2, { 18,18,-2,18, 2 } }, + { 0, 1, { 18,17,18, 2, 5 } }, { 0, 2, { 18,18,-2,18, 2 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 0, 2, { 18,18,-2,18, 2 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 0, 1, { 3,18,18, 2,17 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 0, 2, { 18,18,-2,18, 2 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 0, 2, { 18,18,-2,18, 2 } }, + { 0, 2, { 18,18,-2,18, 2 } }, { 0, 2, { 18,18,-2,18, 2 } }, +}; + +static const WavPackDecorrSpec high_specs[] = { + { 1, 2, { 18,18,18,-2, 2, 3, 5,-1,17, 4 } }, { 0, 1, { 18,17,-2, 2,18, 3, 7, 2, 5, 4 } }, + { 1, 2, { 1,18, 3, 6,-2,18, 2, 3, 4, 5 } }, { 0, 2, { 18,18,-2, 2,18, 3, 6, 2,17, 4 } }, + { 1, 2, { 18,18, 2,18, 3, 2,-1, 4,18, 5 } }, { 1, 1, { 7, 6, 5, 3, 4, 2, 5, 4, 3, 7 } }, + { 1, 1, { 17, 3,18, 7, 2, 6, 1, 4, 3, 5 } }, { 1, 1, { -2,18,18,18, 3,-2, 6, 5, 2, 1 } }, + { 1, 2, { 18,18,-1,18, 2, 3, 6,-2,17, 5 } }, { 0, 1, { 17,17,18, 3, 6, 4, 5, 2,18,-2 } }, + { 1, 2, { 1,18,-2, 3, 5, 2, 4,-1, 6, 1 } }, { 0, 2, { 18,18, 3, 6,18, 2, 4, 8, 5, 3 } }, + { 0, 1, { -2, 1,18, 2,-2, 7,18, 2,-1, 5 } }, { 1, 1, { 4, 3, 8, 1, 5, 2, 5, 6, 2, 8 } }, + { 1, 1, { 17,18, 2, 6, 3, 4,-1, 1, 8, 6 } }, { 0, 1, { 18,18, 3, 6, 3,-2, 2, 5,-1, 1 } }, + { 0, 1, { 18,18,17,-1, 2,-2,18, 3, 4, 5 } }, { 1, 2, { 18,17, 2,-2,18, 3, 5, 7, 2, 4 } }, + { 1, 2, { 18,18, 3, 6,-2,18, 2, 5, 8, 3 } }, { 0, 1, { 18,17, 2,18,18, 2, 6, 5,17, 7 } }, + { 1, 2, { 18,17, 2,18, 3, 2, 6,18,-1, 4 } }, { 1, 1, { 5, 3, 6, 5, 3, 4, 1, 2, 4, 7 } }, + { 1, 1, { 5, 3, 6, 5, 3, 4, 1, 2, 4, 7 } }, { 0, 1, { -2,18,18,18,-2, 3, 2, 4, 6, 5 } }, + { 1, 2, { 18,17,-3, 3,-1,18, 2, 3, 6, 5 } }, { 0, 1, { 17,18, 7, 3,-2, 7, 1, 2, 4, 5 } }, + { 1, 1, { 2,18,18,-2, 2, 4,-1,18, 3, 6 } }, { 0, 3, { 1,18, 4, 3, 5, 2, 4,18, 2, 3 } }, + { 0, 1, { -2,18, 2,18, 3, 7,18, 2, 6,-2 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 1, 1, { 18,18, 5, 4, 6, 4, 5, 1, 4, 3 } }, { 1, 1, { 18, 3, 6, 5, 7, 8, 2, 3, 1,-1 } }, + { 1, 1, { 18,18,18, 2,-2, 3, 5,18, 2, 8 } }, { 0, 2, { 18,17,-2, 2, 3,18,-3, 5, 2, 7 } }, + { 1, 1, { 1, 1,-1, 8,17, 3,-2, 2, 6,17 } }, { 0, 2, { 18,18,17, 2,-2, 3, 2, 4,18, 5 } }, + { 1, 1, { 17,18, 2,-1, 5, 7,18, 3, 4, 6 } }, { 1, 1, { 5, 4, 5,17, 3, 6, 3, 4, 7, 2 } }, + { 0, 1, { 17, 3, 1, 7, 4, 2, 5,-2,18, 6 } }, { 0, 1, { 17,18, 2,18, 4, 3, 5, 7,-3, 6 } }, + { 1, 2, { 17,17,-3,-2, 2, 8,18,-1, 3, 5 } }, { 0, 1, { 17,17,18, 2, 3, 6,-2, 8, 1, 7 } }, + { 1, 1, { 1, 2, 6,-2,18, 2, 5,-3, 7,-2 } }, { 0, 1, { 18,18, 3,18, 6, 8,-2, 2, 3, 5 } }, + { 0, 1, { 18,17, 2,18,-2, 3, 7, 6, 2, 4 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 1, 1, { 18,18, 2,-1, 3, 6, 1, 3, 4, 8 } }, { 0, 1, { 18,18, 3, 6, 5, 3,-2, 2,18,-1 } }, + { 0, 1, { 18,17,-3,18, 2, 4,-2, 3, 6,17 } }, { 1, 3, { 1, 2,17, 3,18, 7,-1, 5, 2, 4 } }, + { 1, 1, { 18, 3,18, 6, 8,18,-2, 5, 7, 2 } }, { 0, 1, { 17, 2,18, 6, 3, 2, 5, 4, 8, 1 } }, + { 0, 1, { 18,17,-1, 2, 3,18,18, 2, 3,17 } }, { 1, 1, { 18, 7, 6, 5, 5, 3, 1, 4, 2, 4 } }, + { 1, 1, { 6,17, 3, 8, 1, 5, 7,-1, 2, 1 } }, { 1, 1, { 18,-2,18, 3,-2, 2, 7, 4, 6,18 } }, + { 1, 3, { 18,-3,18, 2, 3,18,-1, 7, 2, 5 } }, { 0, 2, { 18,-2, 7, 1, 3, 2, 4, 6,-3, 7 } }, + { 1, 1, { 18,-2, 2,-3,18,-2,17,-1, 4, 2 } }, { 0, 3, { 17,17, 2, 5, 3, 7,18, 6, 4, 2 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 1, 1, { 18,17, 4, 6, 6, 4, 5, 3, 4, 1 } }, { 0, 1, { 18, 5, 3, 6, 2, 3, 8, 1, 3, 7 } }, + { 1, 2, { 18,17,-2, 2,18, 3, 5, 7,-1, 2 } }, { 0, 1, { 1,18,18, 3, 6,-1, 4, 8, 5, 2 } }, + { 1, 1, { 1, 5, 3, 4, 1, 1, 3, 5, 7, 3 } }, { 0, 1, { 3,18,18, 2,18,18,-1, 2, 3,18 } }, + { 1, 2, { 18,18,-1,18, 2, 3, 4, 6,18, 5 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 1, 1, { 18, 3, 1, 4, 5, 2, 7, 1, 3, 6 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 1, 2, { 18,18,-1,18, 2, 3, 5,-2, 6, 8 } }, { 1, 1, { 17,18, 4, 8, 3, 2, 5, 2, 7, 6 } }, + { 1, 4, { 1, 2, 5,18,-2, 2, 3, 7,-1, 4 } }, { 0, 2, { 18,17,-1, 3, 6,18, 2, 3, 7, 5 } }, + { 0, 1, { -2,18, 2,-3, 6,18, 4, 3,-2, 5 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 1, { 17,17, 6, 2, 4, 8, 3, 5,-1,17 } }, { 1, 1, { 18, 3,18, 6, 8,18,-2, 5, 7, 2 } }, + { 1, 2, { 17,17,-3, 2,18,-2, 8, 3, 6,-1 } }, { 1, 1, { 18,-2,17,18, 2, 3,-2, 6, 5, 4 } }, + { 1, 2, { 18,17,-1, 3,18, 2, 5, 3, 6,-3 } }, { 0, 1, { 18,17, 2,18, 7,18, 2, 4, 3,17 } }, + { 1, 3, { 18,18, 5, 6, 4, 3, 4,18, 6, 5 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 1, 1, { 7, 6, 5, 3, 4, 2, 5, 4, 3, 7 } }, { 0, 1, { -2,18,18,18, 3, 6, 4, 2, 5, 2 } }, + { 0, 3, { 18,17,-3,18, 3, 2, 5,-1,17, 3 } }, { 1, 1, { 17,18, 7, 3, 1, 7, 4, 2, 6, 5 } }, + { 1, 1, { 18, 2,-2,-1,18, 5, 3,-2, 1, 2 } }, { 0, 3, { 18,18,-1, 3, 2, 7, 5,18, 4, 3 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 1, 1, { 17,18, 2,-2, 4, 8,18, 3, 6, 5 } }, { 0, 2, { 18,17, 3, 5,-2, 7, 2,18, 3,-1 } }, + { 1, 1, { 18, 2,-2,-1,18, 5, 3,-2, 1, 2 } }, { 0, 2, { 3,17,18,18, 2, 5, 7, 6,18, 3 } }, + { 1, 1, { 17,18,18, 4, 3, 2,18, 7, 8,-1 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 1, { 17, 1, 2, 3, 5, 6, 1, 4, 8,17 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 2, { 18,17,-1,18,-3, 2, 8, 3, 6,17 } }, { 1, 1, { 17,17, 1, 2, 4, 5,-1, 2, 1, 6 } }, + { 1, 1, { 1, 2, 6,-2,18, 2,-3, 3,-2, 5 } }, { 0, 1, { 18, 3,18, 6,18, 5, 2, 4,-1, 8 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 1, 1, { 18,18,-1, 2,18, 3, 6, 4,-2, 7 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 2, { -1,18,18,18, 2,-2, 4, 7, 2, 3 } }, { 0, 3, { 3,17,-2, 5, 2, 7,18, 6, 4, 5 } }, + { 0, 1, { 17, 6,18, 3, 8, 4, 5, 3, 8,18 } }, { 0, 2, { 18, 2, 6, 2,18, 3, 2, 4, 5, 8 } }, + { 0, 1, { 3,18,18, 2,18,-1, 2,18, 2,17 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 1, { 3, 6,17,-2, 5, 1, 2, 7, 4, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 1, 3, { 3,18,17, 5, 6, 2, 7,-2, 8,18 } }, { 1, 1, { 18,-1, 3, 1, 7, 2,-1, 4, 6,17 } }, + { 1, 1, { 18, 2,-2,-1,18, 5, 3,-2, 1, 2 } }, { 0, 2, { 18, 1, 2,18, 3, 6, 5, 2, 4, 8 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 1, 1, { 17,-2, 2,18,18, 8, 5, 3, 2, 6 } }, { 0, 1, { 18,17, 2,18, 3, 2, 7,-2,18, 4 } }, + { 1, 2, { 1,18, 2, 3,-1, 5, 6, 4, 7,17 } }, { 0, 2, { 18,17, 3, 6,-2, 2, 3, 8, 5,17 } }, + { 0, 2, { 18,18, 3, 2,18,-1, 2, 4, 3,17 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 1, 2, { 17,-1,18, 2, 3,-2, 5,18, 2, 7 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 1, 2, { 18,-3,18, 2, 3,-2,18, 5, 6,-3 } }, { 0, 2, { 18,17, 3, 5,-2, 7, 2,18, 3,-1 } }, + { 1, 1, { 1,18,-1, 2, 3, 1,-2, 8, 2, 5 } }, { 0, 1, { 18,18, 3, 6,18, 2, 3, 4, 8, 5 } }, + { 0, 1, { -2, 1,18, 2,-2, 5, 7,18, 2,-1 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 1, 1, { 17,18,-1, 2, 8, 3, 4, 5, 1, 7 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 2, { 18,18,-1, 2,18, 3,-2, 5, 4, 2 } }, { 1, 1, { 18,17, 2,18, 3, 8, 5, 2, 7,17 } }, + { 0, 1, { 18,18, 3,18, 6, 8,-2, 2, 3, 5 } }, { 0, 1, { 18,18, 2,18, 2, 6,18, 2,17, 7 } }, + { 1, 3, { 18,17,18, 2, 8,18, 5,-1, 3, 6 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 1, 1, { 18, 7, 6, 5, 5, 3, 1, 4, 2, 4 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 1, 2, { 18,17,-1, 3, 6,18, 2, 5, 8, 3 } }, { 0, 1, { 17,18,18, 4, 7, 2, 3,-2,18, 5 } }, + { 1, 2, { 18, 1, 2, 6, 2, 5,18, 2, 4, 8 } }, { 0, 4, { 18, 4, 1, 2, 3, 5, 4, 1, 2, 6 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 2, { 18,17, 2,-1,18, 3,-3, 5, 2, 4 } }, + { 0, 1, { 17,17, 3, 6, 3, 5,-2, 2,18,-1 } }, { 0, 2, { 18,18, 3,-2,18, 2,-3, 5, 3, 6 } }, + { 1, 1, { 17,17, 2, 4, 1, 3, 5, 2, 6,-3 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 1, { 17, 1, 3, 2, 7, 1, 6, 3, 4, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 1, { 17,-1,18, 2, 1, 5, 3, 8,-1,-2 } }, { 1, 1, { 17,18,-1, 8, 2, 5, 3, 4, 1, 6 } }, + { 1, 2, { 1,18, 3,-1, 5, 1, 2, 4, 7, 6 } }, { 0, 1, { 18,18, 3, 6, 5, 3,-2, 2,18,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 1, { 1,18,-1, 3, 8, 5, 6, 1, 2, 3 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 2, { 18,18, 2, 3, 6,18,-1, 4, 2, 3 } }, { 1, 1, { 1, 3, 5,18, 2, 6, 7, 2, 3, 1 } }, + { 1, 1, { 1, 3, 8,18, 5, 2, 7, 1, 3,-2 } }, { 0, 2, { 17, 2,18, 3, 6, 2, 4, 5, 8, 3 } }, + { 0, 1, { 18,17, 2,18, 3, 2, 7,-2,18, 4 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 1, 2, { 18,-3,18,-1, 3,-2, 5, 7, 1, 2 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 3, { 18,18, 2, 6,18, 5,18, 2, 3,17 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 1, 3, { 1,-1, 1, 3,-2, 2, 5, 7,-3,18 } }, { 1, 2, { 18, 7, 3,-3, 2, 8, 2, 5, 4,17 } }, + { 1, 1, { 1, 4, 5, 1, 3, 4, 6, 7, 8, 3 } }, { 0, 1, { 18,17, 2,18,-1, 2, 3,18, 2, 4 } }, + { 0, 2, { 18,18,-2,18, 2, 3, 4, 7, 5,17 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 1, 1, { 17,18, 2, 1, 3, 2, 5, 1, 2, 3 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 2, { 18,18,-1, 2, 3, 5, 8, 6, 1,-2 } }, { 0, 1, { 17,18, 8, 3, 4, 6, 5, 2, 8, 7 } }, + { 1, 2, { 1, 3,-2,18, 2, 5, 1, 7,-1,-2 } }, { 0, 3, { 18,17,-1, 3,18, 2, 3, 6, 4,17 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 1, 2, { 18,18, 4,18, 6, 7, 8, 3,18, 2 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 2, { 17,-3,17, 2,-2, 8, 3,18, 4,-3 } }, { 1, 1, { 18,17, 3, 5, 6, 2, 8, 1, 3, 7 } }, + { 0, 1, { 18,18, 3, 6, 5, 3,-2, 2,18,-1 } }, { 0, 3, { 18,18, 2, 6,18, 5,18, 2, 3,17 } }, + { 1, 1, { 18,18, 5, 4, 6, 4, 5, 1, 4, 3 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 2, { 3,17,18,-3, 2, 5,18, 6,-1, 7 } }, { 1, 1, { 17,18, 3, 2, 5,-1, 6, 8, 4, 7 } }, + { 1, 1, { 18, 1,-2, 3, 2, 1, 7, 6, 3, 4 } }, { 0, 3, { 1, 2,17, 3,18, 2, 7, 5, 4,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 1, 1, { 17,-2, 2,18,18, 8, 5, 3, 2, 6 } }, { 0, 2, { 18, 5,18, 2, 3, 7,-2, 1, 6, 8 } }, + { 0, 1, { 2,-1,18,-1, 2, 4,-3, 5,18, 3 } }, { 0, 1, { 3,17,18, 5, 2,18, 7, 3, 6, 5 } }, + { 1, 4, { 1, 2, 5,18,-2, 2, 3, 7,-1, 4 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 1, { 1,18, 2, 1, 3, 4, 1, 5, 2, 7 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 1, { 17,17,18, 2, 4, 5,18,-2, 6, 3 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 2, { 18,18,-1, 3, 5, 6, 8,18, 2, 3 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 1, { 18,18, 4, 6, 8,18, 7, 3, 2, 5 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 2, { -1,18,18,18, 2, 4,-2, 2, 3, 6 } }, { 0, 2, { 18,-2, 7, 1, 3, 2, 4, 6,-3, 7 } }, + { 1, 1, { 17,18, 8, 3, 4, 6,-2, 5, 3, 8 } }, { 0, 2, { 18, 1, 2, 6, 2, 8, 3,18, 5, 4 } }, + { 1, 1, { 3,18,18, 2,18, 2,18, 3, 2,18 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 1, 1, { 3,17,18, 5, 2, 6, 7, 1, 4, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2, 8 } }, +}; + +static const WavPackDecorrSpec very_high_specs[] = { + { 1, 2, { 18,18, 2, 3,-2,18, 2, 4, 7, 5, 3, 6, 8,-1,18, 2 } }, + { 0, 1, { 18,18,-1,18, 2, 3, 4, 6, 5, 7,18,-3, 8, 2,-1, 3 } }, + { 1, 2, { 1,18,-2, 4,18, 2, 3, 6,-1, 7, 5,-2,18, 8, 2, 4 } }, + { 0, 1, { 17,17, 2, 3, 4,18,-1, 5, 6, 7,18, 2, 8,17, 3,-2 } }, + { 1, 1, { 18,18, 2,18, 3, 2,18, 4,-1, 3,18, 2, 6, 8,17, 5 } }, + { 0, 2, { 18,17, 2, 3,-2, 5,18,-3, 2, 4, 7, 3, 6, 8, 5,17 } }, + { 1, 1, { 18,-2, 2,-3,18, 5,-2,18, 2, 3, 6, 2,17, 4, 7,-1 } }, + { 1, 1, { 17, 8,18, 3,-2, 2, 5, 4,18, 6, 3, 8, 7, 2, 5, 4 } }, + { 0, 2, { 18,17,-2, 2,18, 3, 2, 5,-3, 4, 7,18, 3, 8, 6, 2 } }, + { 1, 1, { 3, 6, 5, 5, 1, 3, 7, 4, 2, 6, 4,18, 3, 7, 5, 6 } }, + { 1, 2, { 1,18, 3, 2,-2, 1, 5, 4, 6, 2, 7, 1, 8, 3,-1, 1 } }, + { 0, 1, { 18,18, 2, 3, 6, 3, 5,-2, 2, 4,18, 3,-2,-1, 6, 7 } }, + { 0, 1, { -2,18, 2,18, 7, 2, 6,-2, 3, 4,18,18, 2,-3, 8, 5 } }, + { 0, 2, { 18,18,18, 2, 4, 3,18, 5, 3, 6,-2, 2, 4,18, 8, 7 } }, + { 0, 1, { -2, 1,18, 2,-2,18,-1, 5, 7, 2, 3, 4,18, 2, 6, 2 } }, + { 1, 1, { 17,18, 3, 2, 1, 7,-1, 2, 4, 3, 5, 6,-2,18, 7, 8 } }, + { 1, 1, { 18,18, 2,18, 3, 4, 6,-2,18, 5, 8, 2, 3, 7, 4,-1 } }, + { 0, 1, { 18,18,18,-1, 2, 3, 4, 6, 8,18, 3, 5, 2, 6, 7, 4 } }, + { 1, 1, { 17,-2,18,18, 2, 5, 3, 8, 2,-1, 6, 1, 3, 4, 7, 5 } }, + { 0, 1, { 17,17,18, 2, 3, 6,-2, 8, 1, 7, 5, 2, 3, 1, 4, 8 } }, + { 1, 1, { 17,17, 3, 2, 7, 1, 4, 3, 6, 2, 5,-2, 8, 7,18, 6 } }, + { 0, 1, { 18,17,-2, 2,18, 3,-3, 7, 6, 5, 2, 4,-1, 8, 3,17 } }, + { 1, 1, { 2,18,18,-2, 2, 4,-1, 5,18, 3, 8, 6, 2, 7,17, 4 } }, + { 0, 1, { 17, 3, 6, 8, 5, 4, 3, 8, 1,18, 7, 2, 4, 5, 6, 3 } }, + { 1, 2, { 17,18, 4, 8, 3, 2, 5, 7, 6, 8, 2, 7,-2,18, 3, 4 } }, + { 1, 1, { 6, 5, 5, 3, 4, 7, 3, 2, 4, 6, 3, 7, 1, 5, 2, 4 } }, + { 1, 1, { 1,18,-1, 2, 1, 3, 8,-2, 2, 5, 6, 3, 8, 7,18, 4 } }, + { 0, 1, { 1,17,-1,18, 3, 2, 5, 4, 6, 7, 8, 3, 4, 2, 1,-2 } }, + { 0, 1, { 18, 2,18,18, 2,18, 6,-2,18, 7, 5, 4, 3, 2,18,-2 } }, + { 0, 3, { 1, 4,18, 3, 2, 4, 1, 5, 2, 3, 6,18, 8, 7, 2, 4 } }, + { 0, 1, { 17,-2, 1,-3, 2,18, 3,-2, 4,18, 3, 6, 7,-3, 2, 8 } }, + { 1, 1, { 17,18,18, 4, 2, 3, 7, 6,18, 8, 5,-1, 4, 2, 3,17 } }, + { 1, 2, { 18,-1,17,18, 2, 3,-2,18, 5, 8, 2, 4, 3, 7, 6,-1 } }, + { 1, 1, { 18,18,18,-2, 4, 2, 3,18, 5, 8, 2, 4, 6, 7,-2, 3 } }, + { 1, 2, { 18,18,-2,18,-1, 3, 2, 5,18,-2, 7, 2, 3, 4, 6, 8 } }, + { 0, 1, { 17,18,-1, 2, 4,18, 8, 3, 6, 5, 7,-3, 2, 4, 3,17 } }, + { 1, 1, { 18,18,17, 2,-1,18, 3, 2,18, 6, 5, 4,18, 7, 2,-1 } }, + { 0, 2, { 1,18,-1,18, 3, 2, 4, 6,-3, 7,-1, 5, 1, 2, 3, 8 } }, + { 1, 1, { 1,17,-2, 2,-3, 6, 3, 5, 1, 2, 7, 6, 8,-2, 4, 1 } }, + { 0, 1, { 17,-1, 5, 1, 4, 3, 6, 2,-2,18, 3, 2, 4, 5, 8,-1 } }, + { 0, 2, { 18,18,17, 2, 3,-2, 5,18, 2, 4, 7, 8, 6,17, 3, 5 } }, + { 1, 1, { 1, 5, 1, 3, 4, 3, 7, 5, 1, 3, 6, 1, 2, 4, 3, 8 } }, + { 1, 2, { 1,-1, 3, 2,18, 7,-2, 5, 2, 6, 4, 3,-1,18, 8, 7 } }, + { 0, 2, { 18,17, 3,18, 2, 5, 4, 3, 6, 2, 7, 8,18, 3, 4, 5 } }, + { 1, 1, { 3, 6,17, 8, 7, 5,18,-1, 1, 2, 3, 4, 2, 6, 8, 1 } }, + { 0, 2, { 18,18, 3,-3,18, 2, 6, 5, 3, 7,18, 4,-2, 8, 2, 3 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 1, 1, { 17, 1, 7, 2, 3,18,-2, 3, 6, 4, 2, 7, 8, 5, 3,17 } }, + { 1, 1, { 3, 6, 5, 5, 1, 3, 7, 4, 2, 6, 4,18, 3, 7, 5, 6 } }, + { 0, 1, { 18,18,18, 2, 4,-1,18, 8,-1, 2, 3, 4, 6,-2, 1, 7 } }, + { 1, 1, { 18,-2,17,18, 2, 6, 3,-2, 5, 4, 7, 1,-3, 8, 2, 6 } }, + { 0, 1, { 17,18,18, 4, 2, 7, 3, 6,-2,18, 8, 4, 5, 2, 7,17 } }, + { 1, 1, { 18,18, 5, 4, 6, 4, 1, 5, 4, 3, 2, 5, 6, 1, 4, 5 } }, + { 0, 1, { 18,18,-2,18, 2,-3, 3, 8, 5,18, 6, 4, 3,-1, 7, 2 } }, + { 1, 1, { 18, 2,-2,-3,18, 5, 2, 3,-2, 4, 6, 1,-3, 2, 7, 8 } }, + { 0, 1, { 18, 3, 5, 8, 2, 6, 7, 3, 1, 5, 2,-1, 8, 6, 7, 4 } }, + { 1, 1, { 4, 3, 8, 1, 5, 6, 2, 5, 8,-2, 2, 7, 3,18, 5, 4 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 1, 1, { 17, 3,18,18, 7, 2, 4,18, 6, 2, 3,-1, 8, 5,18,-3 } }, + { 0, 1, { 3,17,18, 2,18, 6, 7,-3,18, 2, 5, 6, 3, 8, 7,-1 } }, + { 1, 1, { 18,18, 2,18,18, 2,-1, 7, 3,18, 5, 2, 6, 4,-1,18 } }, + { 0, 3, { 18, 3, 4, 1, 5, 2,18, 4, 2, 3,18, 7, 6, 1, 2, 4 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 1, 1, { 17, 1,18, 2, 3, 6, 4, 5, 7,18, 3, 8, 2, 4,-2,17 } }, + { 1, 2, { 18,17, 2, 3, 5,18, 6,-2, 7, 3, 2, 4,18, 8,-1, 5 } }, + { 0, 2, { 1,18,-1,18, 3, 2, 4, 6,-3, 7,-1, 5, 1, 2, 3, 8 } }, + { 1, 1, { 1,18,-1, 8, 2, 6, 3,-2, 1, 2, 5, 4,-3, 8, 6, 3 } }, + { 0, 1, { 18,18, 2,18, 2,18, 7, 6,18, 2,-2, 3, 5, 4,18, 8 } }, + { 1, 2, { 18,17, 2, 3,18,-1, 2, 3, 6,18, 5, 4, 3, 7, 2, 8 } }, + { 1, 2, { 18,18, 3,-2, 4,18, 5, 7, 6, 2, 4,-3, 8, 5,18, 3 } }, + { 1, 1, { 17,-2,18,18, 2, 5, 3, 8, 2,-1, 6, 1, 3, 4, 7, 5 } }, + { 1, 1, { 3,17,18, 5, 7, 2, 4, 6, 1, 8,-1, 3, 7, 4, 1, 2 } }, + { 0, 2, { 1,-2, 2,18, 3, 5, 2, 4, 7,-1, 2, 3, 5,18,-2, 4 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 1, 1, { 1, 2,-2, 6,18,-3, 2, 7, 3,-2, 5, 6, 1, 8, 2, 4 } }, + { 0, 1, { 18,18,18, 3,-2, 6,18, 2, 4, 3, 5, 8, 7, 6, 2,-2 } }, + { 1, 1, { 1, 5, 1, 3, 4, 3, 7, 5, 1, 3, 6, 1, 2, 4, 3, 8 } }, + { 0, 1, { 3,17,18, 2, 5,18, 6, 7, 5,-2, 2, 4,18, 3, 6, 8 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 2, { 17,-1,18, 2, 4,-1, 8, 3,18, 7,-3, 4, 5, 1, 2,-2 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 8, 6, 4, 5, 7,-1 } }, + { 1, 1, { 18,18, 3, 6, 4, 8,-2, 2, 5, 3, 7,18, 6, 8, 4, 2 } }, + { 1, 1, { 17,18,18,-2, 5, 2, 3, 1, 4,-1, 8, 6, 5, 3, 2,18 } }, + { 1, 1, { 17,17, 1, 2, 4, 5, 2, 6,-1, 3, 1, 1,-2, 4, 2, 7 } }, + { 1, 1, { 17, 1, 7, 2, 3,18,-2, 3, 6, 4, 2, 7, 8, 5, 3,17 } }, + { 0, 1, { 18,17,-2,-3, 1, 2, 3, 2, 5, 4, 7,-3, 6,-2, 2, 1 } }, + { 1, 1, { 1, 3, 5,18, 1, 2, 7, 3, 6, 2, 5, 8,-1, 1, 4, 7 } }, + { 1, 1, { 17, 3, 6, 8, 1, 4, 5, 3,-2, 7, 2, 8, 5, 6,18, 3 } }, + { 1, 1, { 17,18, 2, 4, 8,-2, 3, 1, 5, 6, 7, 1, 2, 3, 4, 7 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 1, 1, { 3, 1, 8,18, 5, 2, 3,18, 6, 7,-2, 4, 3, 2, 8,18 } }, + { 0, 1, { 18,17, 2,18, 3, 4,-1,18, 7, 6, 2, 8, 4,18,18, 5 } }, + { 0, 1, { 18,18, 2,18,18, 2, 7,-2, 6, 5, 4, 3,18, 3, 2,17 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 1, 1, { 17, 8,18, 3, 2, 1, 5, 4, 6,-1, 3,-3, 8,18, 7, 2 } }, + { 1, 2, { 18,17,18, 2, 3, 5,-2,18, 6,-1, 2, 3, 7, 4, 8,17 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 8, 6, 4, 5, 7,-1 } }, + { 1, 2, { 18,18,-2,17, 2,18, 3, 4,18, 8, 7,-1, 2, 4, 5,17 } }, + { 0, 2, { 17,-3,17, 3, 2,-2,18, 8, 4,-3, 2,18, 5, 3,-2, 6 } }, + { 0, 1, { 18,18, 2,18,18, 2, 7,-2, 6, 5, 4, 3,18, 3, 2,17 } }, + { 0, 2, { 1,18,-1, 3, 5, 2,-3,18, 7, 3,-1, 6, 4, 2,17, 5 } }, + { 1, 1, { 17,-2,17, 2,-3, 1, 5,-1, 4, 6, 3, 2, 8, 7,-2, 5 } }, + { 1, 1, { 1,18, 1, 3, 5, 8, 6, 2, 3,-1, 7, 1, 4, 8, 5,-3 } }, + { 0, 2, { 3,18,18, 2,18,-2, 6, 5, 7, 2, 4,18, 3, 6,-3, 5 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 1, 1, { 3, 6,17, 8, 7, 5,18,-1, 1, 2, 3, 4, 2, 6, 8, 1 } }, + { 0, 4, { 18, 2,17, 3,18,-2, 2, 6,18, 2, 7, 3, 5, 4, 8,18 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { 18,18, 2, 3, 6, 3, 5,-2, 2, 4,18, 3,-2,-1, 6, 7 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 1, 1, { 17, 1, 2, 5, 3,-2, 1, 4, 3, 7, 6,-3, 2, 1, 1, 2 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 1, 1, { 18,18,-2,18,-2, 2, 3, 6,18, 4,-1, 2, 3, 8, 1, 4 } }, + { 1, 1, { 17,-2,17, 2,-3, 1, 5,-1, 4, 6, 3, 2, 8, 7,-2, 5 } }, + { 0, 1, { 17,17,18, 3, 2,18,18, 6, 8, 2,-2, 3, 5, 4,17,18 } }, + { 1, 1, { 1, 5, 1, 3, 4, 3, 7, 5, 1, 3, 6, 1, 2, 4, 3, 8 } }, + { 1, 1, { 1, 3,-3,18,18, 6, 5,18, 2,-1, 3, 8, 7,-3, 4,17 } }, + { 1, 1, { 18, 1, 2, 1, 3, 8, 7, 4, 1, 5, 2,-1,-3,18, 6, 2 } }, + { 0, 1, { 18, 3, 5, 2, 6, 8,18, 5, 7, 2, 3,-1, 6, 7, 8, 5 } }, + { 0, 2, { 18, 3,-2, 7, 8, 2, 5, 4,-3, 8, 3, 2,18, 5, 4, 6 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 1, 3, { 1, 1, 2, 5, 2, 7, 4, 3,-1,18,-2, 8, 2, 1, 6, 7 } }, + { 0, 1, { 3,17,18, 5, 2, 6, 7,18, 4, 5, 3, 6,18, 2, 7, 8 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { 1,18, 1, 2, 3, 5, 1, 2, 6, 7, 4, 3, 8, 1,17, 5 } }, + { 1, 2, { 17,-1,18,-2, 2, 3, 5,18, 2, 4, 6, 7, 3,-1, 5, 8 } }, + { 1, 1, { 18,18,-3,18,-2, 2, 3,-2,18, 6, 4, 5, 8, 3,17,-3 } }, + { 1, 1, { 18, 7, 6, 5, 5, 3, 1, 4, 2, 7, 3, 4,-3, 6,18, 8 } }, + { 0, 2, { 18,18, 2, 3, 5,18, 2, 4, 3, 6,18, 7, 8,-1, 5, 2 } }, + { 0, 1, { 18,17,-1, 2,18, 3, 2,18, 4, 3,18, 2, 6, 5, 8,17 } }, + { 0, 2, { 18,17, 2, 3,18, 5,-1, 6, 7, 8, 2, 3, 4, 5,18, 6 } }, + { 1, 2, { 18,-3,18, 2, 3,-2,-3, 5,18, 7, 6, 2, 4, 3, 8,-2 } }, + { 1, 1, { 17,18,18,-2, 2, 3, 5, 4, 8,18,-1, 5, 3, 6,-2, 7 } }, + { 1, 2, { 18,17, 2,-2,18, 3,-1, 4,18, 2, 7, 5, 3, 8, 6, 4 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 1, 1, { 1, 5, 1, 3, 4, 3, 7, 5, 1, 3, 6, 1, 2, 4, 3, 8 } }, + { 0, 2, { 18,18, 3, 3,-2, 2, 5,18, 6, 3,-1, 4, 7,-1, 1, 2 } }, + { 0, 1, { -2, 1,18, 2,-2, 5, 7,18, 3, 2, 6, 2,-1, 4,-2,17 } }, + { 0, 2, { 18,18,18, 2, 3,-2,18, 5, 4, 2, 6, 8, 3,-2, 4,18 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 1, 1, { 17,18,-1, 3, 2, 5, 1, 3, 2, 8, 4, 7, 6, 2,-1, 5 } }, + { 1, 1, { 17,18,18, 4, 2, 3, 7, 6,18, 8, 5,-1, 4, 2, 3,17 } }, + { 0, 1, { 18,18,-2,18, 2, 3, 4, 5, 6,18, 8, 2, 3, 7,-2, 4 } }, + { 0, 1, { 18,-2,18,18,-3,-2, 2, 3, 5, 8, 1, 2, 6, 4, 7,-1 } }, + { 0, 1, { 18,17, 2,18, 3,-2, 2, 7, 6, 4,18, 3, 8, 7, 4, 2 } }, + { 1, 1, { 17,18,18, 4, 2, 3, 7, 6,18, 8, 5,-1, 4, 2, 3,17 } }, + { 1, 1, { 18,17,18, 2, 5, 3,-2,18, 6, 2, 3, 4, 8, 7, 5,-1 } }, + { 0, 1, { 2,-1,18,-1, 2, 4,-3,18, 5, 3, 6,18, 2, 4, 7, 8 } }, + { 1, 1, { 17,18, 8, 3, 6, 4,-1, 5, 2, 7, 3, 8, 6, 5,18, 4 } }, + { 0, 2, { 18, 3,-2, 7, 8, 2, 5, 4,-3, 8, 3, 2,18, 5, 4, 6 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 1, 1, { 1,18,-1, 8, 2, 6, 3,-2, 1, 2, 5, 4,-3, 8, 6, 3 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { 17,18,18, 4, 2, 7, 3, 6,-2,18, 8, 4, 5, 2, 7,17 } }, + { 1, 2, { 18,-1,18, 3,-2,18, 2, 5, 3, 6, 7, 2,-1,18, 8, 4 } }, + { 1, 2, { 1,18,-2, 4,18, 2, 3, 6,-1, 7, 5,-2,18, 8, 2, 4 } }, + { 1, 2, { 1,18,-3, 2, 3,18,-1, 5, 6, 2, 8, 3, 4, 1,-2, 7 } }, + { 0, 1, { 1,17,-1,18, 3, 2, 5, 4, 6, 7, 8, 3, 4, 2, 1,-2 } }, + { 1, 1, { 18,17,18, 4, 3, 5, 1, 2, 6, 3, 4, 7, 1, 8, 5, 2 } }, + { 0, 1, { 18,-2, 7, 1, 3, 2,-3, 4, 6,-2, 7, 8, 1, 5, 4, 3 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 2, { 18,18,18,-2, 2, 5, 3, 7,18, 2, 4,-3, 5, 6, 3, 8 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 3, { 3,18,-1, 5, 2, 7,18, 6, 5, 2, 4, 3,-1, 7,18, 6 } }, + { 0, 2, { 18,18,18, 4, 3, 2, 6, 4, 8,18, 5, 3, 2, 7,-2, 6 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 2, { 18,18,18, 2, 3,-2,18, 5, 4, 2, 6, 8, 3,-2, 4,18 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 1, 1, { 17, 8,18, 3, 2, 1, 5, 4, 6,-1, 3,-3, 8,18, 7, 2 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18,18, 2, 4, 6,-2, 2, 8, 3, 4,18, 7,-1, 6 } }, + { 0, 1, { 18, 1,-2, 2, 4, 1, 3,-1, 2, 5, 7, 1, 6, 8,-2,17 } }, + { 0, 1, { 17,17,18, 2, 5, 4,18, 3, 8, 7, 4, 6, 8, 1, 5, 2 } }, + { 1, 2, { 18,18, 5, 4, 6, 3, 4,18, 8, 4,-1, 7, 5, 3, 6, 2 } }, + { 0, 1, { 18,18,-3,18, 3, 6, 2, 5, 7,18, 3, 8,-1, 4, 5, 2 } }, + { 1, 1, { 18, 2,-2,-3,18, 5, 2,-2, 4, 3, 6,18, 8,-1, 2, 7 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 1, 1, { 17, 1, 7, 2, 3,18,-2, 3, 6, 4, 2, 7, 8, 5, 3,17 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { 17,18, 3,18, 2, 5, 4, 7,-3, 6, 3, 2,18, 4, 7, 3 } }, + { 1, 1, { 1, 7, 4, 5, 3, 4, 5, 1, 3, 6, 3, 2, 4, 8,-2, 7 } }, + { 0, 1, { 1,18,-1,-2,18, 3, 2,-1, 6, 7, 4, 5, 3,18, 2,-3 } }, + { 1, 1, { 18,18,-1, 3, 6,18, 5, 4, 8, 2, 3, 6,18, 7, 4,-2 } }, + { 0, 2, { 18,18, 2, 6,18, 2,18, 5, 3,18, 2, 4, 7, 8, 3,18 } }, + { 1, 1, { 3,18,18, 5,18, 6, 2, 4, 7,-2,18, 5, 8, 6, 3, 2 } }, + { 0, 1, { 18,-2, 7, 1, 3, 2,-3, 4, 6,-2, 7, 8, 1, 5, 4, 3 } }, + { 1, 1, { 18,-2,18, 2, 5,18, 3,-2, 4, 7, 2,-1, 8, 6, 5, 1 } }, + { 1, 1, { 17,17, 5,18, 4, 1, 2, 8, 6, 4,-2, 3, 5,-1, 1, 8 } }, + { 0, 2, { 1, 2,17, 3, 7,18, 2,-1, 4, 5,18, 2, 7, 3, 6, 8 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 1, 1, { 3, 6,17, 8, 7, 5,18,-1, 1, 2, 3, 4, 2, 6, 8, 1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 2, { 18,18,18, 2,-2, 3, 6, 4, 8,18, 2, 5, 7, 4, 3, 6 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 1, 1, { 18, 1, 8, 3, 5, 6, 4,-1, 8, 3, 7,18, 2, 5, 8, 4 } }, + { 1, 1, { 17,18, 5, 2, 4, 3, 1, 6,-2, 1, 3, 2, 4, 5,-1,17 } }, + { 1, 1, { 18,17, 2,18, 3,-3, 7, 2, 6, 4, 3, 5,18, 8, 2,-2 } }, + { 1, 1, { 18,17,18, 4, 3, 5,-1,18, 2, 7, 8, 4, 6, 3,18, 5 } }, + { 0, 1, { 18,17,18,-2, 2,-3, 3, 4, 8, 5, 2,18, 6, 3, 7,-2 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 1, 1, { 17,18, 8, 3, 4, 6,18, 5,-2, 3, 8, 5, 2, 4, 7, 6 } }, + { 0, 1, { 18,-2, 3, 5, 1, 7, 3, 2, 6,-3, 4, 1, 5, 8, 3,-2 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 1, 1, { 3,17,18, 5,-1,18, 2, 6, 7,18, 5, 3,-3,-1, 6, 2 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 1, 3, { 18,17,-2, 3,-1,18, 2, 5, 3, 7, 6, 2, 4, 8,18, 5 } }, + { 0, 1, { 18,-1,18, 2,18, 3, 5,18, 2, 8,18, 5, 4,-1, 6, 2 } }, + { 1, 2, { 18,-2,18,18, 2, 3, 4,-3, 2, 5,18, 7, 4, 3, 8, 6 } }, + { 0, 2, { 17,-1,18, 2,-1, 1, 7, 3, 8, 5,-2, 4, 1, 2,-3, 6 } }, + { 0, 1, { 18,17, 2,18, 2,18, 6, 7, 4, 3,18, 5, 2,-2,17, 8 } }, + { 0, 3, { 18,17, 2, 3,-3,-1,18, 2, 4, 5,18, 7, 3, 2,-3, 6 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 2, { 3,18,18,18, 2, 6, 5,18, 7, 2, 4, 6,18, 5, 3, 8 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { 18,18, 3, 6, 3,-2, 2,18, 5,-1, 7, 3, 4,-2, 2, 6 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 1, 1, { 18,17,18,18,-2, 2, 3,-3,18, 6, 4, 2,-2, 8, 3, 7 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { 18,18,18, 4, 2, 7, 8,18, 3, 2,-2, 4, 7, 6,17, 5 } }, + { 1, 1, { 18,18,-1,-2, 8, 3,18, 6, 3, 5, 8, 2, 4, 7, 1, 6 } }, + { 1, 1, { 1,-3, 3,18,18, 2,-1, 3, 6, 5,18, 4, 7,-2, 8, 3 } }, + { 1, 1, { 1,18, 4, 2, 5,18, 1, 3,-1, 6, 1, 4, 8, 2, 5, 1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, + { 0, 1, { -1,18,18, 2,18, 3, 5,18, 2,18, 6, 8, 4, 5, 7,-1 } }, +}; + +static const WavPackDecorrSpec * const decorr_filters[] = { + &fast_specs[0], &default_specs[0], &high_specs[0], &very_high_specs[0], +}; + +static const uint16_t decorr_filter_sizes[] = { + FF_ARRAY_ELEMS(fast_specs), + FF_ARRAY_ELEMS(default_specs), + FF_ARRAY_ELEMS(high_specs), + FF_ARRAY_ELEMS(very_high_specs), +}; + +static const uint8_t decorr_filter_nterms[] = { 2, 5, 10, 16 }; + +#endif /* AVCODEC_WAVPACKENC_H */ diff --git a/include/libavcodec/wma.h b/include/libavcodec/wma.h new file mode 100644 index 0000000..3d0d872 --- /dev/null +++ b/include/libavcodec/wma.h @@ -0,0 +1,164 @@ +/* + * WMA compatible codec + * Copyright (c) 2002-2007 The FFmpeg Project + * + * 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_WMA_H +#define AVCODEC_WMA_H + +#include "libavutil/float_dsp.h" +#include "libavutil/mem_internal.h" +#include "libavutil/tx.h" + +#include "avcodec.h" +#include "get_bits.h" +#include "put_bits.h" + +/* size of blocks */ +#define BLOCK_MIN_BITS 7 +#define BLOCK_MAX_BITS 11 +#define BLOCK_MAX_SIZE (1 << BLOCK_MAX_BITS) + +#define BLOCK_NB_SIZES (BLOCK_MAX_BITS - BLOCK_MIN_BITS + 1) + +/* XXX: find exact max size */ +#define HIGH_BAND_MAX_SIZE 16 + +#define NB_LSP_COEFS 10 + +/* XXX: is it a suitable value ? */ +#define MAX_CODED_SUPERFRAME_SIZE 32768 + +#define MAX_CHANNELS 2 + +#define NOISE_TAB_SIZE 8192 + +#define LSP_POW_BITS 7 + +// FIXME should be in wmadec +#define VLCBITS 9 +#define VLCMAX ((22 + VLCBITS - 1) / VLCBITS) + +typedef float WMACoef; ///< type for decoded coefficients, int16_t would be enough for wma 1/2 + +typedef struct CoefVLCTable { + int n; ///< total number of codes + int max_level; + const uint32_t *huffcodes; ///< VLC bit values + const uint8_t *huffbits; ///< VLC bit size + const uint16_t *levels; ///< table to build run/level tables +} CoefVLCTable; + +typedef struct WMACodecContext { + AVCodecContext *avctx; + GetBitContext gb; + PutBitContext pb; + int version; ///< 1 = 0x160 (WMAV1), 2 = 0x161 (WMAV2) + int use_bit_reservoir; + int use_variable_block_len; + int use_exp_vlc; ///< exponent coding: 0 = lsp, 1 = vlc + delta + int use_noise_coding; ///< true if perceptual noise is added + int byte_offset_bits; + VLC exp_vlc; + int exponent_sizes[BLOCK_NB_SIZES]; + uint16_t exponent_bands[BLOCK_NB_SIZES][25]; + int high_band_start[BLOCK_NB_SIZES]; ///< index of first coef in high band + int coefs_start; ///< first coded coef + int coefs_end[BLOCK_NB_SIZES]; ///< max number of coded coefficients + int exponent_high_sizes[BLOCK_NB_SIZES]; + int exponent_high_bands[BLOCK_NB_SIZES][HIGH_BAND_MAX_SIZE]; + VLC hgain_vlc; + + /* coded values in high bands */ + int high_band_coded[MAX_CHANNELS][HIGH_BAND_MAX_SIZE]; + int high_band_values[MAX_CHANNELS][HIGH_BAND_MAX_SIZE]; + + /* there are two possible tables for spectral coefficients */ +// FIXME the following 3 tables should be shared between decoders + VLC coef_vlc[2]; + uint16_t *run_table[2]; + float *level_table[2]; + uint16_t *int_table[2]; + const CoefVLCTable *coef_vlcs[2]; + /* frame info */ + int frame_len; ///< frame length in samples + int frame_len_bits; ///< frame_len = 1 << frame_len_bits + int nb_block_sizes; ///< number of block sizes + /* block info */ + int reset_block_lengths; + int block_len_bits; ///< log2 of current block length + int next_block_len_bits; ///< log2 of next block length + int prev_block_len_bits; ///< log2 of prev block length + int block_len; ///< block length in samples + int block_num; ///< block number in current frame + int block_pos; ///< current position in frame + uint8_t ms_stereo; ///< true if mid/side stereo mode + uint8_t channel_coded[MAX_CHANNELS]; ///< true if channel is coded + int exponents_bsize[MAX_CHANNELS]; ///< log2 ratio frame/exp. length + DECLARE_ALIGNED(32, float, exponents)[MAX_CHANNELS][BLOCK_MAX_SIZE]; + float max_exponent[MAX_CHANNELS]; + WMACoef coefs1[MAX_CHANNELS][BLOCK_MAX_SIZE]; + DECLARE_ALIGNED(32, float, coefs)[MAX_CHANNELS][BLOCK_MAX_SIZE]; + DECLARE_ALIGNED(32, float, output)[BLOCK_MAX_SIZE * 2]; + AVTXContext *mdct_ctx[BLOCK_NB_SIZES]; + av_tx_fn mdct_fn[BLOCK_NB_SIZES]; + const float *windows[BLOCK_NB_SIZES]; + /* output buffer for one frame and the last for IMDCT windowing */ + DECLARE_ALIGNED(32, float, frame_out)[MAX_CHANNELS][BLOCK_MAX_SIZE * 2]; + /* last frame info */ + uint8_t last_superframe[MAX_CODED_SUPERFRAME_SIZE + AV_INPUT_BUFFER_PADDING_SIZE]; /* padding added */ + int last_bitoffset; + int last_superframe_len; + int exponents_initialized[MAX_CHANNELS]; + float noise_table[NOISE_TAB_SIZE]; + int noise_index; + float noise_mult; /* XXX: suppress that and integrate it in the noise array */ + /* lsp_to_curve tables */ + float lsp_cos_table[BLOCK_MAX_SIZE]; + float lsp_pow_e_table[256]; + float lsp_pow_m_table1[(1 << LSP_POW_BITS)]; + float lsp_pow_m_table2[(1 << LSP_POW_BITS)]; + AVFloatDSPContext *fdsp; + + int eof_done; /* decode flag to output remaining samples after EOF */ + +#ifdef TRACE + int frame_count; +#endif /* TRACE */ +} WMACodecContext; + +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]; + +av_warn_unused_result +int ff_wma_init(AVCodecContext *avctx, int flags2); + +int ff_wma_total_gain_to_bits(int total_gain); +int ff_wma_end(AVCodecContext *avctx); +unsigned int ff_wma_get_large_val(GetBitContext *gb); +int ff_wma_run_level_decode(AVCodecContext *avctx, GetBitContext *gb, + const VLCElem *vlc, const float *level_table, + const uint16_t *run_table, int version, + WMACoef *ptr, int offset, int num_coefs, + int block_len, int frame_len_bits, + int coef_nb_bits); + +#endif /* AVCODEC_WMA_H */ diff --git a/include/libavcodec/wma_common.h b/include/libavcodec/wma_common.h new file mode 100644 index 0000000..55404af --- /dev/null +++ b/include/libavcodec/wma_common.h @@ -0,0 +1,27 @@ +/* + * common code shared by all WMA variants + * + * 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_WMA_COMMON_H +#define AVCODEC_WMA_COMMON_H + +int ff_wma_get_frame_len_bits(int sample_rate, int version, + unsigned int decode_flags); + +#endif /* AVCODEC_WMA_COMMON_H */ diff --git a/include/libavcodec/wma_freqs.h b/include/libavcodec/wma_freqs.h new file mode 100644 index 0000000..6fd93e4 --- /dev/null +++ b/include/libavcodec/wma_freqs.h @@ -0,0 +1,26 @@ +/* + * 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_WMA_FREQS_H +#define AVCODEC_WMA_FREQS_H + +#include + +extern const uint16_t ff_wma_critical_freqs[25]; + +#endif /* AVCODEC_WMA_FREQS_H */ diff --git a/include/libavcodec/wmadata.h b/include/libavcodec/wmadata.h new file mode 100644 index 0000000..ca485a5 --- /dev/null +++ b/include/libavcodec/wmadata.h @@ -0,0 +1,1380 @@ +/* + * WMA compatible decoder + * copyright (c) 2002 The FFmpeg Project + * + * 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 + */ + +/** + * @file + * Various WMA tables. + */ + +#ifndef AVCODEC_WMADATA_H +#define AVCODEC_WMADATA_H + +#include + +#include "wma.h" + +/* first value is number of bands */ +static const uint8_t exponent_band_22050[3][25] = { + { 10, 4, 8, 4, 8, 8, 12, 20, 24, 24, 16, }, + { 14, 4, 8, 8, 4, 12, 12, 16, 24, 16, 20, 24, 32, 40, 36, }, + { 23, 4, 4, 4, 8, 4, 4, 8, 8, 8, 8, 8, 12, 12, 16, 16, + 24, 24, 32, 44, 48, 60, 84, 72, }, +}; + +static const uint8_t exponent_band_32000[3][25] = { + { 11, 4, 4, 8, 4, 4, 12, 16, 24, 20, 28, 4, }, + { 15, 4, 8, 4, 4, 8, 8, 16, 20, 12, 20, 20, 28, 40, 56, 8, }, + { 16, 8, 4, 8, 8, 12, 16, 20, 24, 40, 32, 32, 44, 56, 80, 112, 16, }, +}; + +static const uint8_t exponent_band_44100[3][25] = { + { 12, 4, 4, 4, 4, 4, 8, 8, 8, 12, 16, 20, 36, }, + { 15, 4, 8, 4, 8, 8, 4, 8, 8, 12, 12, 12, 24, 28, 40, 76, }, + { 17, 4, 8, 8, 4, 12, 12, 8, 8, 24, 16, 20, 24, 32, 40, 60, 80, 152, }, +}; + +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] = { + { 1.98732877, 1.97944528, 1.97179088, 1.96260549, 1.95038374, 1.93336114, 1.90719232, 1.86191415, }, + { 1.97260000, 1.96083160, 1.94982586, 1.93806164, 1.92516608, 1.91010199, 1.89232331, 1.87149812, + 1.84564818, 1.81358067, 1.77620070, 1.73265264, 1.67907855, 1.60959081, 1.50829650, 1.33120330, }, + { 1.90109110, 1.86482426, 1.83419671, 1.80168452, 1.76650116, 1.72816320, 1.68502700, 1.63738256, + 1.58501580, 1.51795181, 1.43679906, 1.33950585, 1.24176208, 1.12260729, 0.96749668, 0.74048265, }, + { 1.76943864, 1.67822463, 1.59946365, 1.53560582, 1.47470796, 1.41210167, 1.34509536, 1.27339507, + 1.19303814, 1.09765169, 0.98818722, 0.87239446, 0.74369172, 0.59768184, 0.43168630, 0.17977021, }, + { 1.43428349, 1.32038354, 1.21074086, 1.10577988, 1.00561746, 0.90335924, 0.80437489, 0.70709671, + 0.60427395, 0.49814048, 0.38509539, 0.27106800, 0.14407416, 0.00219910, -0.16725141, -0.36936085, }, + { 0.99895687, 0.84188166, 0.70753739, 0.57906595, 0.47055563, 0.36966965, 0.26826648, 0.17163380, + 0.07208392, -0.03062936, -1.40037388, -0.25128968, -0.37213937, -0.51075646, -0.64887512, -0.80308031, }, + { 0.26515280, 0.06313551, -0.08872080, -0.21103548, -0.31069678, -0.39680323, -0.47223474, -0.54167135, + -0.61444740, -0.68943343, -0.76580211, -0.85170082, -0.95289061, -1.06514703, -1.20510707, -1.37617746, }, + { -0.53940301, -0.73770929, -0.88424876, -1.01117930, -1.13389091, -1.26830073, -1.42041987, -1.62033919, + -1.10158808, -1.16512566, -1.23337128, -1.30414401, -1.37663312, -1.46853845, -1.57625798, -1.66893638, }, + { -0.38601997, -0.56009350, -0.66978483, -0.76028471, -0.83846064, -0.90868087, -0.97408881, -1.03694962, }, + { -1.56144989, -1.65944032, -1.72689685, -1.77857740, -1.82203011, -1.86220079, -1.90283983, -1.94820479, }, +}; + +static const uint32_t coef0_huffcodes[666] = { + 0x00258, 0x0003d, 0x00000, 0x00005, 0x00008, 0x00008, 0x0000c, 0x0001b, + 0x0001f, 0x00015, 0x00024, 0x00032, 0x0003a, 0x00026, 0x0002c, 0x0002f, + 0x0004a, 0x0004d, 0x00061, 0x00070, 0x00073, 0x00048, 0x00052, 0x0005a, + 0x0005d, 0x0006e, 0x00099, 0x0009e, 0x000c1, 0x000ce, 0x000e4, 0x000f0, + 0x00093, 0x0009e, 0x000a2, 0x000a1, 0x000b8, 0x000d2, 0x000d3, 0x0012e, + 0x00130, 0x000de, 0x0012d, 0x0019b, 0x001e4, 0x00139, 0x0013a, 0x0013f, + 0x0014f, 0x0016d, 0x001a2, 0x0027c, 0x0027e, 0x00332, 0x0033c, 0x0033f, + 0x0038b, 0x00396, 0x003c5, 0x00270, 0x0027c, 0x0025a, 0x00395, 0x00248, + 0x004bd, 0x004fb, 0x00662, 0x00661, 0x0071b, 0x004e6, 0x004ff, 0x00666, + 0x0071c, 0x0071a, 0x0071f, 0x00794, 0x00536, 0x004e2, 0x0078e, 0x004ee, + 0x00518, 0x00535, 0x004fb, 0x0078d, 0x00530, 0x00680, 0x0068f, 0x005cb, + 0x00965, 0x006a6, 0x00967, 0x0097f, 0x00682, 0x006ae, 0x00cd0, 0x00e28, + 0x00f13, 0x00f1f, 0x009f5, 0x00cd3, 0x00f11, 0x00926, 0x00964, 0x00f32, + 0x00f12, 0x00f30, 0x00966, 0x00d0b, 0x00a68, 0x00b91, 0x009c7, 0x00b73, + 0x012fa, 0x0131d, 0x013f9, 0x01ca0, 0x0199c, 0x01c7a, 0x0198c, 0x01248, + 0x01c74, 0x01c64, 0x0139e, 0x012fd, 0x00a77, 0x012fc, 0x01c7b, 0x012ca, + 0x014cc, 0x014d2, 0x014e3, 0x014dc, 0x012dc, 0x03344, 0x02598, 0x0263c, + 0x0333b, 0x025e6, 0x01a1c, 0x01e3c, 0x014e2, 0x033d4, 0x01a11, 0x03349, + 0x03cce, 0x014e1, 0x01a34, 0x0273e, 0x02627, 0x0273f, 0x038ee, 0x03971, + 0x03c67, 0x03c61, 0x0333d, 0x038c2, 0x0263f, 0x038cd, 0x02638, 0x02e41, + 0x0351f, 0x03348, 0x03c66, 0x03562, 0x02989, 0x027d5, 0x0333c, 0x02e4f, + 0x0343b, 0x02ddf, 0x04bc8, 0x029c0, 0x02e57, 0x04c72, 0x025b7, 0x03547, + 0x03540, 0x029d3, 0x04c45, 0x025bb, 0x06600, 0x04c73, 0x04bce, 0x0357b, + 0x029a6, 0x029d2, 0x0263e, 0x0298a, 0x07183, 0x06602, 0x07958, 0x04b66, + 0x0537d, 0x05375, 0x04fe9, 0x04b67, 0x0799f, 0x04bc9, 0x051fe, 0x06a3b, + 0x05bb6, 0x04fa8, 0x0728f, 0x05376, 0x0492c, 0x0537e, 0x0795a, 0x06a3c, + 0x0e515, 0x07887, 0x0683a, 0x051f9, 0x051fd, 0x0cc6a, 0x06a8a, 0x0cc6d, + 0x05bb3, 0x0683b, 0x051fc, 0x05378, 0x0728e, 0x07886, 0x05bb7, 0x0f2a4, + 0x0795b, 0x0683c, 0x09fc1, 0x0683d, 0x0b752, 0x09678, 0x0a3e8, 0x06ac7, + 0x051f0, 0x0b759, 0x06af3, 0x04b6b, 0x0f2a0, 0x0f2ad, 0x096c3, 0x0e518, + 0x0b75c, 0x0d458, 0x0cc6b, 0x0537c, 0x067aa, 0x04fea, 0x0343a, 0x0cc71, + 0x0967f, 0x09fc4, 0x096c2, 0x0e516, 0x0f2a1, 0x0d45c, 0x0d45d, 0x0d45e, + 0x12fb9, 0x0967e, 0x1982f, 0x09883, 0x096c4, 0x0b753, 0x12fb8, 0x0f2a8, + 0x1ca21, 0x096c5, 0x0e51a, 0x1ca27, 0x12f3c, 0x0d471, 0x0f2aa, 0x0b75b, + 0x12fbb, 0x0f2a9, 0x0f2ac, 0x0d45a, 0x0b74f, 0x096c8, 0x16e91, 0x096ca, + 0x12fbf, 0x0d0a7, 0x13103, 0x0d516, 0x16e99, 0x12cbd, 0x0a3ea, 0x19829, + 0x0b755, 0x29ba7, 0x1ca28, 0x29ba5, 0x16e93, 0x1982c, 0x19828, 0x25994, + 0x0a3eb, 0x1ca29, 0x16e90, 0x1ca25, 0x1982d, 0x1ca26, 0x16e9b, 0x0b756, + 0x0967c, 0x25997, 0x0b75f, 0x198d3, 0x0b757, 0x19a2a, 0x0d45b, 0x0e517, + 0x1ca24, 0x1ca23, 0x1ca22, 0x0b758, 0x16e97, 0x0cd14, 0x13100, 0x00007, + 0x0003b, 0x0006b, 0x00097, 0x00138, 0x00125, 0x00173, 0x00258, 0x00335, + 0x0028e, 0x004c6, 0x00715, 0x00729, 0x004ef, 0x00519, 0x004ed, 0x00532, + 0x0068c, 0x00686, 0x00978, 0x00e5d, 0x00e31, 0x009f4, 0x00b92, 0x012f8, + 0x00d06, 0x00a67, 0x00d44, 0x00a76, 0x00d59, 0x012cd, 0x01c78, 0x01c75, + 0x0199f, 0x0198f, 0x01c67, 0x014c6, 0x01c79, 0x01c76, 0x00b94, 0x00d1b, + 0x01e32, 0x01e31, 0x01ab0, 0x01a05, 0x01aa1, 0x0333a, 0x025e5, 0x02626, + 0x03541, 0x03544, 0x03421, 0x03546, 0x02e55, 0x02e56, 0x0492d, 0x02dde, + 0x0299b, 0x02ddc, 0x0357a, 0x0249c, 0x0668b, 0x1c77f, 0x1ca20, 0x0d45f, + 0x09886, 0x16e9a, 0x0f2a7, 0x0b751, 0x0a3ee, 0x0cf59, 0x0cf57, 0x0b754, + 0x0d0a6, 0x16e98, 0x0b760, 0x06ac6, 0x0a3f0, 0x12fbe, 0x13104, 0x0f2a5, + 0x0a3ef, 0x0d472, 0x12cba, 0x1982e, 0x16e9c, 0x1c77e, 0x198d0, 0x13105, + 0x16e92, 0x0b75d, 0x0d459, 0x0001a, 0x000c0, 0x0016c, 0x003cd, 0x00350, + 0x0067b, 0x0051e, 0x006a9, 0x009f4, 0x00b72, 0x00d09, 0x01249, 0x01e3d, + 0x01ca1, 0x01a1f, 0x01721, 0x01a8a, 0x016e8, 0x03347, 0x01a35, 0x0249d, + 0x0299a, 0x02596, 0x02e4e, 0x0298b, 0x07182, 0x04c46, 0x025ba, 0x02e40, + 0x027d6, 0x04fe8, 0x06607, 0x05310, 0x09884, 0x072e1, 0x06a3d, 0x04b6a, + 0x04c7a, 0x06603, 0x04c7b, 0x03428, 0x06605, 0x09664, 0x09fc0, 0x071de, + 0x06601, 0x05bb2, 0x09885, 0x0a3e2, 0x1c61f, 0x12cbb, 0x0b750, 0x0cf58, + 0x0967d, 0x25995, 0x668ad, 0x0b75a, 0x09fc2, 0x0537f, 0x0b75e, 0x13fae, + 0x12fbc, 0x00031, 0x001c4, 0x004c5, 0x005b8, 0x00cf4, 0x0096f, 0x00d46, + 0x01e57, 0x01a04, 0x02625, 0x03346, 0x028f9, 0x04c47, 0x072e0, 0x04b69, + 0x03420, 0x07957, 0x06639, 0x0799e, 0x07959, 0x07881, 0x04b68, 0x09fc3, + 0x09fd6, 0x0cc70, 0x0a3f1, 0x12cbe, 0x0e30e, 0x0e51b, 0x06af2, 0x12cbc, + 0x1c77d, 0x0f2ab, 0x12fbd, 0x1aa2f, 0x0a3ec, 0x0d473, 0x05377, 0x0a3e9, + 0x1982b, 0x0e300, 0x12f3f, 0x0cf5f, 0x096c0, 0x38c3c, 0x16e94, 0x16e95, + 0x12f3d, 0x29ba4, 0x29ba6, 0x1c77c, 0x6a8ba, 0x3545c, 0x33457, 0x668ac, + 0x6a8bb, 0x16e9d, 0x0e519, 0x25996, 0x12f3e, 0x00036, 0x0033e, 0x006ad, + 0x00d03, 0x012c8, 0x0124a, 0x03c42, 0x03ccd, 0x06606, 0x07880, 0x06852, + 0x06a3a, 0x05bb4, 0x0f2a2, 0x09fc7, 0x12cb9, 0x0cc6c, 0x0a6e8, 0x096c1, + 0x0004a, 0x00355, 0x012f9, 0x014e8, 0x01abe, 0x025b6, 0x0492e, 0x09fc6, + 0x051ff, 0x0cc6f, 0x096cb, 0x0d071, 0x198d1, 0x12cb8, 0x38c3d, 0x13faf, + 0x096c9, 0x0009d, 0x00539, 0x012ce, 0x0341f, 0x029c1, 0x04b33, 0x0a3e3, + 0x0d070, 0x16e96, 0x0b763, 0x000a0, 0x009ce, 0x038cc, 0x0343d, 0x051fa, + 0x09888, 0x12fba, 0x000df, 0x00a75, 0x029a7, 0x09fc5, 0x0e301, 0x0967b, + 0x001e7, 0x012c9, 0x051fb, 0x09889, 0x0f2a6, 0x0016f, 0x01cb9, 0x0cf5a, + 0x12cbf, 0x09679, 0x00272, 0x01a15, 0x0967a, 0x003cb, 0x025f6, 0x0b762, + 0x0028d, 0x03c60, 0x0cf5e, 0x00352, 0x03ccc, 0x0072f, 0x07186, 0x004ec, + 0x05379, 0x0068e, 0x09887, 0x006a7, 0x06af1, 0x00e29, 0x0cf5b, 0x00f31, + 0x0d470, 0x009c6, 0x013fb, 0x13102, 0x019a5, 0x13101, 0x01983, 0x01c65, + 0x0124f, 0x014c7, 0x01726, 0x01abf, 0x03304, 0x02624, 0x03c41, 0x027d7, + 0x02ddd, 0x02e54, 0x0343c, 0x06604, 0x07181, 0x0663a, 0x04fa9, 0x0663b, + 0x05311, 0x0537a, 0x06839, 0x05bb5, 0x0492f, 0x06af0, 0x096c7, 0x0cc6e, + 0x0537b, 0x0cf5c, 0x0cf56, 0x198d2, 0x0cf5d, 0x0a3ed, 0x0f2a3, 0x1982a, + 0x0b761, 0x096c6, +}; + +static const uint8_t coef0_huffbits[666] = { + 11, 6, 2, 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, 8, 8, 8, + 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, 11, 11, 11, 10, 11, + 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 12, 12, 11, 12, + 12, 12, 12, 11, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 13, 13, 12, + 12, 12, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 14, + 13, 13, 13, 13, 13, 13, 13, 14, + 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 13, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 15, + 15, 14, 14, 15, 15, 15, 14, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 14, 15, 15, 15, 15, 16, + 16, 16, 15, 16, 15, 15, 16, 16, + 16, 16, 15, 16, 16, 16, 15, 16, + 16, 15, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 15, 15, 16, 16, + 15, 16, 16, 16, 17, 17, 17, 16, + 16, 17, 16, 16, 16, 16, 17, 16, + 17, 17, 16, 16, 15, 15, 15, 16, + 17, 16, 17, 16, 16, 17, 17, 17, + 17, 17, 17, 16, 17, 17, 17, 16, + 17, 17, 16, 17, 17, 17, 16, 17, + 17, 16, 16, 17, 17, 17, 18, 17, + 17, 17, 17, 17, 18, 18, 17, 17, + 17, 19, 17, 19, 18, 17, 17, 18, + 17, 17, 18, 17, 17, 17, 18, 17, + 17, 18, 17, 17, 17, 17, 17, 16, + 17, 17, 17, 17, 18, 16, 17, 4, + 6, 8, 9, 9, 10, 10, 10, 10, + 11, 11, 11, 11, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 14, 13, 13, 13, 13, + 13, 13, 14, 14, 14, 14, 14, 14, + 15, 15, 15, 15, 15, 15, 16, 15, + 15, 15, 15, 15, 15, 17, 17, 17, + 16, 18, 16, 17, 17, 16, 16, 17, + 17, 18, 17, 16, 17, 17, 17, 16, + 17, 17, 18, 17, 18, 17, 17, 17, + 18, 17, 17, 5, 8, 10, 10, 11, + 11, 12, 12, 12, 13, 13, 14, 13, + 13, 14, 14, 14, 14, 14, 14, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 16, 16, 15, 16, 16, + 15, 15, 15, 15, 15, 16, 16, 15, + 15, 16, 16, 17, 17, 18, 17, 16, + 17, 18, 19, 17, 16, 16, 17, 17, + 17, 6, 9, 11, 12, 12, 13, 13, + 13, 14, 14, 14, 15, 15, 15, 16, + 15, 15, 15, 15, 15, 15, 16, 16, + 16, 16, 17, 18, 16, 16, 16, 18, + 17, 16, 17, 18, 17, 17, 16, 17, + 17, 16, 17, 16, 17, 18, 18, 18, + 17, 19, 19, 17, 20, 19, 18, 19, + 20, 18, 16, 18, 17, 7, 10, 12, + 13, 13, 14, 14, 14, 15, 15, 16, + 16, 16, 16, 16, 18, 16, 17, 17, + 8, 11, 13, 14, 14, 15, 16, 16, + 16, 16, 17, 17, 17, 18, 18, 17, + 17, 8, 12, 14, 15, 15, 15, 17, + 17, 18, 17, 9, 12, 14, 15, 16, + 16, 17, 9, 13, 15, 16, 16, 17, + 9, 13, 16, 16, 16, 10, 13, 16, + 18, 17, 10, 14, 17, 10, 14, 17, + 11, 14, 16, 11, 14, 11, 15, 12, + 16, 12, 16, 12, 16, 12, 16, 12, + 17, 13, 13, 17, 13, 17, 13, 13, + 14, 14, 14, 14, 14, 14, 14, 15, + 15, 15, 15, 15, 15, 15, 16, 15, + 16, 16, 16, 16, 16, 16, 17, 16, + 16, 16, 16, 17, 16, 17, 16, 17, + 17, 17, +}; + +static const uint32_t coef1_huffcodes[555] = { + 0x00115, 0x00002, 0x00001, 0x00000, 0x0000d, 0x00007, 0x00013, 0x0001d, + 0x00008, 0x0000c, 0x00023, 0x0002b, 0x0003f, 0x00017, 0x0001b, 0x00043, + 0x00049, 0x00050, 0x00055, 0x00054, 0x00067, 0x00064, 0x0007b, 0x0002d, + 0x00028, 0x0002a, 0x00085, 0x00089, 0x0002b, 0x00035, 0x00090, 0x00091, + 0x00094, 0x00088, 0x000c1, 0x000c6, 0x000f2, 0x000e3, 0x000c5, 0x000e2, + 0x00036, 0x000f0, 0x000a7, 0x000cd, 0x000fb, 0x00059, 0x00116, 0x00103, + 0x00108, 0x0012b, 0x0012d, 0x00188, 0x0012e, 0x0014c, 0x001c3, 0x00187, + 0x001e7, 0x0006f, 0x00094, 0x00069, 0x001e6, 0x001ca, 0x00147, 0x00195, + 0x000a7, 0x00213, 0x00209, 0x00303, 0x00295, 0x00289, 0x0028c, 0x0028d, + 0x00312, 0x00330, 0x0029b, 0x00308, 0x00328, 0x0029a, 0x0025e, 0x003c5, + 0x00384, 0x0039f, 0x00397, 0x00296, 0x0032e, 0x00332, 0x003c6, 0x003e6, + 0x0012d, 0x000d1, 0x00402, 0x000dd, 0x00161, 0x0012b, 0x00127, 0x0045d, + 0x00601, 0x004ab, 0x0045f, 0x00410, 0x004bf, 0x00528, 0x0045c, 0x00424, + 0x00400, 0x00511, 0x00618, 0x0073d, 0x0063a, 0x00614, 0x0073c, 0x007c0, + 0x007cf, 0x00802, 0x00966, 0x00964, 0x00951, 0x008a0, 0x00346, 0x00803, + 0x00a52, 0x0024a, 0x007c1, 0x0063f, 0x00126, 0x00406, 0x00789, 0x008a2, + 0x00960, 0x00967, 0x00c05, 0x00c70, 0x00c79, 0x00a5d, 0x00c26, 0x00c4d, + 0x00372, 0x008a5, 0x00c08, 0x002c5, 0x00f11, 0x00cc4, 0x00f8e, 0x00e16, + 0x00496, 0x00e77, 0x00f9c, 0x00c25, 0x00f1e, 0x00c27, 0x00f1f, 0x00e17, + 0x00ccd, 0x00355, 0x00c09, 0x00c78, 0x00f90, 0x00521, 0x00357, 0x00356, + 0x0068e, 0x00f9d, 0x00c04, 0x00e58, 0x00a20, 0x00a2c, 0x00c4c, 0x0052f, + 0x00f8d, 0x01178, 0x01053, 0x01097, 0x0180f, 0x0180d, 0x012fb, 0x012aa, + 0x0202a, 0x00a40, 0x018ed, 0x01ceb, 0x01455, 0x018e3, 0x012a1, 0x00354, + 0x00353, 0x00f1c, 0x00c7b, 0x00c37, 0x0101d, 0x012cb, 0x01142, 0x0197d, + 0x01095, 0x01e3b, 0x0186b, 0x00588, 0x01c2a, 0x014b8, 0x01e3a, 0x018ec, + 0x01f46, 0x012fa, 0x00a53, 0x01ce8, 0x00a55, 0x01c29, 0x0117b, 0x01052, + 0x012a0, 0x00589, 0x00950, 0x01c2b, 0x00a50, 0x0208b, 0x0180e, 0x02027, + 0x02556, 0x01e20, 0x006e7, 0x01c28, 0x0197a, 0x00684, 0x020a2, 0x01f22, + 0x03018, 0x039cf, 0x03e25, 0x02557, 0x0294c, 0x028a6, 0x00d11, 0x028a9, + 0x02979, 0x00d46, 0x00a56, 0x039ce, 0x030cc, 0x0329a, 0x0149d, 0x0510f, + 0x0451c, 0x02028, 0x03299, 0x01ced, 0x014b9, 0x00f85, 0x00c7a, 0x01800, + 0x00341, 0x012ca, 0x039c8, 0x0329d, 0x00d0d, 0x03e20, 0x05144, 0x00d45, + 0x030d0, 0x0186d, 0x030d5, 0x00d0f, 0x00d40, 0x04114, 0x020a1, 0x0297f, + 0x03e24, 0x032f1, 0x04047, 0x030d4, 0x028a8, 0x00d0e, 0x0451d, 0x04044, + 0x0297e, 0x04042, 0x030d2, 0x030cf, 0x03e21, 0x03e26, 0x028a5, 0x0451a, + 0x00d48, 0x01a16, 0x00d44, 0x04518, 0x0149b, 0x039ca, 0x01498, 0x0403d, + 0x0451b, 0x0149c, 0x032f3, 0x030cb, 0x08073, 0x03e22, 0x0529a, 0x020aa, + 0x039cc, 0x0738a, 0x06530, 0x07389, 0x06193, 0x08071, 0x04043, 0x030ce, + 0x05147, 0x07388, 0x05145, 0x08072, 0x04521, 0x00d47, 0x0297c, 0x030cd, + 0x030ca, 0x0000b, 0x0000c, 0x00083, 0x000e4, 0x00048, 0x00102, 0x001cc, + 0x001f5, 0x00097, 0x0020b, 0x00124, 0x00453, 0x00627, 0x00639, 0x00605, + 0x00517, 0x001b8, 0x00663, 0x00667, 0x007c3, 0x00823, 0x00961, 0x00963, + 0x00e5a, 0x00e59, 0x00a2b, 0x00cbf, 0x00292, 0x00a2d, 0x007d0, 0x00953, + 0x00cc5, 0x00f84, 0x004ab, 0x014a7, 0x0068a, 0x0117a, 0x0052e, 0x01442, + 0x0052c, 0x00c77, 0x00f8f, 0x004aa, 0x01094, 0x01801, 0x012c4, 0x0297b, + 0x00952, 0x01f19, 0x006a5, 0x01149, 0x012c5, 0x01803, 0x022f2, 0x0329b, + 0x04520, 0x0149e, 0x00d13, 0x01f16, 0x01ce9, 0x0101c, 0x006e6, 0x039c9, + 0x06191, 0x07c8e, 0x06192, 0x0ca63, 0x039cd, 0x06190, 0x06884, 0x06885, + 0x07382, 0x00d49, 0x00d41, 0x0450c, 0x0149a, 0x030d1, 0x08077, 0x03e23, + 0x01a15, 0x0e701, 0x0e702, 0x08079, 0x0822a, 0x0a218, 0x07887, 0x0403f, + 0x0520b, 0x0529b, 0x0e700, 0x04519, 0x00007, 0x000e0, 0x000d0, 0x0039b, + 0x003e5, 0x00163, 0x0063e, 0x007c9, 0x00806, 0x00954, 0x01044, 0x01f44, + 0x0197c, 0x01f45, 0x00a51, 0x01f47, 0x00951, 0x0052d, 0x02291, 0x0092f, + 0x00a54, 0x00d12, 0x0297d, 0x00d0c, 0x01499, 0x0329e, 0x032f0, 0x02025, + 0x039c6, 0x00a57, 0x03e46, 0x00d42, 0x0738b, 0x05146, 0x04046, 0x08078, + 0x0510e, 0x07886, 0x02904, 0x04156, 0x04157, 0x06032, 0x030d3, 0x08bce, + 0x04040, 0x0403e, 0x0a414, 0x10457, 0x08075, 0x06887, 0x07c8f, 0x039c7, + 0x07387, 0x08070, 0x08bcf, 0x1482a, 0x10456, 0x1482b, 0x01a17, 0x06886, + 0x0450d, 0x00013, 0x0006b, 0x00615, 0x0080b, 0x0082b, 0x00952, 0x00e5b, + 0x018e2, 0x0186c, 0x01f18, 0x0329f, 0x00d43, 0x03e29, 0x05140, 0x05141, + 0x0ca62, 0x06033, 0x03c42, 0x03e28, 0x0450f, 0x0a21a, 0x07384, 0x0a219, + 0x0e703, 0x0a21b, 0x01a14, 0x07383, 0x045e6, 0x0007a, 0x0012c, 0x00ccc, + 0x0068f, 0x01802, 0x00a52, 0x00953, 0x04045, 0x01a20, 0x0451f, 0x000a4, + 0x00735, 0x01cec, 0x02029, 0x020a3, 0x0451e, 0x00069, 0x00c24, 0x02024, + 0x032f2, 0x05142, 0x00196, 0x00523, 0x000a6, 0x0197b, 0x0030b, 0x0092e, + 0x003e9, 0x03e27, 0x00160, 0x05143, 0x00652, 0x04041, 0x00734, 0x028a7, + 0x0080f, 0x01483, 0x0097c, 0x00340, 0x0068b, 0x00522, 0x01054, 0x01096, + 0x01f17, 0x0202b, 0x01cea, 0x020a0, 0x02978, 0x02026, 0x0297a, 0x039cb, + 0x03e2b, 0x0149f, 0x0329c, 0x07385, 0x08074, 0x0450e, 0x03e2a, 0x05149, + 0x08076, 0x07386, 0x05148, +}; + +static const uint8_t coef1_huffbits[555] = { + 9, 5, 2, 4, 4, 5, 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, 8, 8, 8, 8, 8, + 9, 8, 8, 8, 8, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, + 9, 10, 10, 10, 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, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 11, 11, 11, 11, 11, 12, + 12, 12, 12, 12, 12, 12, 12, 12, + 13, 12, 12, 12, 12, 12, 12, 12, + 13, 12, 12, 12, 12, 12, 12, 12, + 12, 13, 12, 12, 12, 13, 13, 13, + 13, 12, 12, 12, 12, 12, 12, 13, + 12, 13, 13, 13, 13, 13, 13, 13, + 14, 14, 13, 13, 13, 13, 13, 13, + 13, 12, 12, 12, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 14, 13, 14, 13, 13, 13, + 13, 13, 14, 13, 14, 14, 13, 14, + 14, 13, 14, 13, 13, 14, 14, 13, + 14, 14, 14, 14, 14, 14, 14, 14, + 14, 15, 14, 14, 14, 14, 15, 15, + 15, 14, 14, 13, 13, 12, 12, 13, + 13, 13, 14, 14, 15, 14, 15, 15, + 14, 13, 14, 15, 15, 15, 14, 14, + 14, 14, 15, 14, 14, 15, 15, 15, + 14, 15, 14, 14, 14, 14, 14, 15, + 15, 16, 15, 15, 15, 14, 15, 15, + 15, 15, 14, 14, 16, 14, 15, 14, + 14, 15, 15, 15, 15, 16, 15, 14, + 15, 15, 15, 16, 15, 15, 14, 14, + 14, 4, 7, 8, 8, 9, 9, 9, + 9, 10, 10, 11, 11, 11, 11, 11, + 11, 12, 11, 11, 11, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 11, 12, + 12, 12, 13, 13, 13, 13, 13, 13, + 13, 12, 12, 13, 13, 13, 13, 14, + 14, 13, 14, 13, 13, 13, 14, 14, + 15, 15, 14, 13, 13, 13, 14, 14, + 15, 15, 15, 16, 14, 15, 17, 17, + 15, 15, 15, 15, 15, 14, 16, 14, + 16, 16, 16, 16, 16, 16, 15, 15, + 17, 15, 16, 15, 6, 8, 10, 10, + 10, 11, 11, 11, 12, 12, 13, 13, + 13, 13, 14, 13, 14, 13, 14, 14, + 14, 14, 14, 15, 15, 14, 14, 14, + 14, 14, 14, 15, 15, 15, 15, 16, + 15, 15, 16, 15, 15, 15, 14, 16, + 15, 15, 18, 17, 16, 17, 15, 14, + 15, 16, 16, 19, 17, 19, 16, 17, + 15, 7, 10, 11, 12, 12, 12, 12, + 13, 13, 13, 14, 15, 14, 15, 15, + 16, 15, 14, 14, 15, 16, 15, 16, + 16, 16, 16, 15, 15, 7, 11, 12, + 13, 13, 14, 14, 15, 15, 15, 8, + 11, 13, 14, 14, 15, 9, 12, 14, + 14, 15, 9, 13, 10, 13, 10, 14, + 10, 14, 11, 15, 11, 15, 11, 14, + 12, 15, 12, 13, 13, 13, 13, 13, + 13, 14, 13, 14, 14, 14, 14, 14, + 14, 15, 14, 15, 16, 15, 14, 15, + 16, 15, 15, +}; + +static const uint32_t coef2_huffcodes[1336] = { + 0x003e6, 0x000f6, 0x00000, 0x00002, 0x00006, 0x0000f, 0x0001b, 0x00028, + 0x00039, 0x0003f, 0x0006b, 0x00076, 0x000b7, 0x000e8, 0x000ef, 0x00169, + 0x001a7, 0x001d4, 0x001dc, 0x002c4, 0x00349, 0x00355, 0x00391, 0x003dc, + 0x00581, 0x005b2, 0x00698, 0x0070c, 0x00755, 0x0073a, 0x00774, 0x007cf, + 0x00b0a, 0x00b66, 0x00d2e, 0x00d5e, 0x00e1b, 0x00eac, 0x00e5a, 0x00f7e, + 0x00fa1, 0x0163e, 0x01a37, 0x01a52, 0x01c39, 0x01ab3, 0x01d5f, 0x01cb6, + 0x01f52, 0x01dd9, 0x02c04, 0x02c2e, 0x02c2d, 0x02c23, 0x03467, 0x034a3, + 0x0351b, 0x03501, 0x03a5d, 0x0351c, 0x03875, 0x03dea, 0x0397b, 0x039db, + 0x03df1, 0x039d8, 0x03bb4, 0x0580a, 0x0584d, 0x05842, 0x05b13, 0x058ea, + 0x0697d, 0x06a06, 0x068cc, 0x06ac7, 0x06a96, 0x072f4, 0x07543, 0x072b4, + 0x07d20, 0x0b003, 0x073b5, 0x07be6, 0x0d180, 0x07bd1, 0x07cb8, 0x07d06, + 0x07d25, 0x0d2f2, 0x0d19a, 0x0d334, 0x0e1dc, 0x0d529, 0x0d584, 0x0e1d2, + 0x0e5e3, 0x0eec4, 0x0e564, 0x0fa49, 0x16001, 0x0eedc, 0x0f7fa, 0x1a32c, + 0x16131, 0x16003, 0x0f9c8, 0x1ef80, 0x1d2a0, 0x1aa4b, 0x0f7ce, 0x1abfe, + 0x1aa50, 0x1a458, 0x1a816, 0x1cae4, 0x1d2fe, 0x1d52e, 0x1aa4c, 0x2c245, + 0x1d2a1, 0x1a35d, 0x1ca1b, 0x1d5d8, 0x1f531, 0x1ca1c, 0x1f389, 0x1f4af, + 0x3a5e7, 0x351fb, 0x2c24b, 0x34bce, 0x2c24d, 0x2c249, 0x2c24a, 0x72dfc, + 0x357ef, 0x35002, 0x3a5e6, 0x39431, 0x5843b, 0x34a77, 0x58431, 0x3a5f3, + 0x3a5dd, 0x3e5e5, 0x356bd, 0x3976e, 0x6a3d2, 0x3500d, 0x694c4, 0x580bd, + 0x3e5e8, 0x74b95, 0x34a6e, 0x3977c, 0x39432, 0x5b0d2, 0x6a3d8, 0x580b8, + 0x5b0cb, 0x5b0d7, 0x72dee, 0x72ded, 0x72dec, 0x74b9c, 0x3977f, 0x72dea, + 0x74b9e, 0x7be7d, 0x580bf, 0x5b0d5, 0x7cba8, 0x74b91, 0x3e5dd, 0xb6171, + 0xd46b3, 0xd46b9, 0x7cba1, 0x74b9f, 0x72de1, 0xe59f5, 0x3e5eb, 0x00004, + 0x00015, 0x00038, 0x00075, 0x000e8, 0x001d3, 0x00347, 0x0039c, 0x00690, + 0x0074a, 0x00b60, 0x00e93, 0x00f74, 0x0163d, 0x01a5a, 0x01d24, 0x01cbe, + 0x01f4b, 0x03468, 0x03562, 0x03947, 0x03e82, 0x05804, 0x05b12, 0x05803, + 0x0696d, 0x06a9e, 0x0697c, 0x06978, 0x06afb, 0x074b2, 0x072f5, 0x073c0, + 0x07541, 0x06944, 0x074b7, 0x070d3, 0x07ba9, 0x0b0b1, 0x0d1af, 0x0e1dd, + 0x0e5e2, 0x0e1a3, 0x0eec3, 0x1612f, 0x0e961, 0x0eeda, 0x0e78e, 0x0fa48, + 0x1612c, 0x0e511, 0x0e565, 0x0e953, 0x1aa4a, 0x0e59d, 0x1d52c, 0x1a811, + 0x1cae7, 0x1abfc, 0x1d52d, 0x1cacf, 0x1cf05, 0x2c254, 0x34a72, 0x1f4ac, + 0x3976b, 0x34a71, 0x2c6d9, 0x2d873, 0x34a6a, 0x357e7, 0x3464c, 0x3e5f5, + 0x58433, 0x1f53a, 0x3500a, 0x357ea, 0x34a73, 0x3942f, 0x357e5, 0x39775, + 0x694cd, 0x39772, 0x7cba5, 0x6a3ef, 0x35483, 0x74b98, 0x5b0c1, 0x39770, + 0x3a5d7, 0x39433, 0x39434, 0x694ce, 0x580be, 0x3e5ff, 0x6a3ec, 0xb616f, + 0xd46b1, 0x6a3d1, 0x72de5, 0x74b6e, 0x72de9, 0x3e700, 0xd46b6, 0x6a3e9, + 0x74b69, 0xe5675, 0xd46b8, 0x7cbaa, 0x3a5d1, 0x0000c, 0x0003c, 0x000eb, + 0x001f1, 0x003a4, 0x006a8, 0x007d5, 0x00d43, 0x00e77, 0x016c5, 0x01cb1, + 0x02c5d, 0x03a55, 0x03a56, 0x03e51, 0x03bb5, 0x05b0a, 0x06a9f, 0x074b8, + 0x07d28, 0x0d187, 0x0d40e, 0x0d52e, 0x0d425, 0x0eae3, 0x0e1d3, 0x1612e, + 0x0e59e, 0x0eec2, 0x0e578, 0x0e51a, 0x0e579, 0x0e515, 0x0e960, 0x0d183, + 0x0d220, 0x0d2cb, 0x0e512, 0x16c3e, 0x16002, 0x16c42, 0x1cae9, 0x3461a, + 0x1d2fa, 0x1a308, 0x1a849, 0x1cf07, 0x1f38f, 0x34b65, 0x2c253, 0x1ef9e, + 0x1cbc3, 0x1cbc1, 0x2c255, 0x1f384, 0x58435, 0x2c5cd, 0x3a5f7, 0x2c252, + 0x3959c, 0x2c6d8, 0x3a5d3, 0x6ad78, 0x6a3f2, 0x7cba9, 0xb6176, 0x72deb, + 0x39764, 0x3e5f6, 0x3a5d8, 0x74a8c, 0x6a3e6, 0x694d1, 0x6ad79, 0x1a4592, + 0xe59fb, 0x7cbb3, 0x5b0cd, 0x00017, 0x000b5, 0x002c3, 0x005b7, 0x00b1c, + 0x00e5c, 0x0163f, 0x01ab2, 0x01efa, 0x0348a, 0x0396e, 0x058da, 0x06963, + 0x06a30, 0x072cd, 0x073cf, 0x07ce7, 0x0d2ca, 0x0d2d8, 0x0e764, 0x0e794, + 0x16008, 0x16167, 0x1617e, 0x1aa49, 0x1a30b, 0x1a813, 0x2c6da, 0x1a580, + 0x1cbc2, 0x0f9ca, 0x1617f, 0x1d2fe, 0x0f7fc, 0x16c40, 0x0e513, 0x0eec5, + 0x0f7c3, 0x1d508, 0x1a81e, 0x1d2fd, 0x39430, 0x35486, 0x3e5fd, 0x2c24c, + 0x2c75a, 0x34a74, 0x3a5f4, 0x3464d, 0x694ca, 0x3a5f1, 0x1d509, 0x1d5c0, + 0x34648, 0x3464e, 0x6a3d5, 0x6a3e8, 0x6a3e7, 0x5b0c3, 0x2c248, 0x1f38a, + 0x3a5f2, 0x6a3e5, 0x00029, 0x00168, 0x0058c, 0x00b67, 0x00f9d, 0x01c3d, + 0x01cbf, 0x02c20, 0x0351d, 0x03df6, 0x06af9, 0x072b5, 0x0b1d7, 0x0b0b2, + 0x0d40a, 0x0d52b, 0x0e952, 0x0e797, 0x163c3, 0x1c3a0, 0x1f386, 0x1ca21, + 0x34655, 0x2c247, 0x1f53b, 0x2c250, 0x2c24f, 0x1f385, 0x1ef5d, 0x1cf15, + 0x1caea, 0x1ab0a, 0x1cf19, 0x1f53d, 0x1d5c2, 0x1d2fb, 0x1ef58, 0x34a78, + 0x357ec, 0x1f533, 0x3a5e1, 0x694d2, 0x58482, 0x3a5ee, 0x2c6dc, 0x357eb, + 0x5b0c4, 0x39778, 0x6a3e1, 0x7cbb4, 0x3a5e1, 0x74b68, 0x3a5ef, 0x3a5d2, + 0x39424, 0x72de2, 0xe59f6, 0xe59f7, 0x3e702, 0x3e5ec, 0x1f38b, 0x0003b, + 0x001f0, 0x00777, 0x00fa8, 0x01cb2, 0x02d84, 0x03a57, 0x03dd6, 0x06917, + 0x06a11, 0x07d07, 0x0eae2, 0x0e796, 0x0f9c9, 0x0f7fb, 0x16166, 0x16160, + 0x1ab1b, 0x1abfa, 0x2d87b, 0x1d2f7, 0x39768, 0x1f38c, 0x34653, 0x34651, + 0x6a3d9, 0x35001, 0x3abbd, 0x38742, 0x39426, 0x34a76, 0x3a5ec, 0x34a75, + 0x35000, 0x35488, 0x1cf10, 0x2c6db, 0x357ed, 0x357e8, 0x357e9, 0x3a5f0, + 0x694c2, 0xb6178, 0x72df5, 0x39425, 0x3942b, 0x74b6d, 0x74b6f, 0xb6177, + 0xb6179, 0x74b6a, 0xb6172, 0x58487, 0x3e5ee, 0x3e5ed, 0x72df2, 0x72df4, + 0x7cbae, 0x6a3ca, 0x70e86, 0x34bcf, 0x6a3c8, 0x00059, 0x00384, 0x00d5b, + 0x01c38, 0x03560, 0x0395b, 0x0584e, 0x06964, 0x073cd, 0x0b1e7, 0x0e798, + 0x0e78d, 0x0fa43, 0x1a848, 0x1a32f, 0x1aa4e, 0x3464a, 0x1f4ab, 0x1f38d, + 0x3a5eb, 0x3a5d4, 0x3548a, 0x6a3c7, 0x5b0d0, 0x6a3c5, 0x7cbb0, 0x694cb, + 0x3a5e5, 0x3e5e2, 0x3942c, 0x2d872, 0x1f4ae, 0x3a5d5, 0x694d3, 0x58481, + 0x35009, 0x39774, 0x58432, 0xb616c, 0x5b0db, 0x3548b, 0xb6174, 0x1d5d95, + 0xb004c, 0x7cbb2, 0x3a5e5, 0x74a8f, 0xe59f9, 0x72df6, 0xe59fd, 0x7cbad, + 0xd427d, 0x72cff, 0x3977a, 0x5b0d9, 0xb616d, 0xb616b, 0x1a4593, 0x7cbaf, + 0x5b0da, 0x00071, 0x003eb, 0x01603, 0x02c6c, 0x03961, 0x068c8, 0x06a31, + 0x072bd, 0x0d2c2, 0x0e51b, 0x0e5e6, 0x1abfb, 0x1d2ff, 0x1cae5, 0x1ef5c, + 0x1ef5e, 0x1cf13, 0x34a6d, 0x3976d, 0xb616a, 0x3e5f2, 0x6a3c4, 0xb6169, + 0x3e5dc, 0x580b9, 0x74b99, 0x75764, 0x58434, 0x3a5d9, 0x6945a, 0x69459, + 0x3548c, 0x3a5e9, 0x69457, 0x72df1, 0x6945e, 0x6a35e, 0x3e701, 0xb6168, + 0x5b0dd, 0x3a5de, 0x6a3c2, 0xd4278, 0x6a3cc, 0x72dfd, 0xb6165, 0x16009a, + 0x7cbb1, 0xd427c, 0xb6162, 0xe765e, 0x1cecbe, 0x7cbb6, 0x69454, 0xb6160, + 0xd427a, 0x1d5d96, 0xb1d6d, 0xe59f4, 0x72de8, 0x3a5db, 0x0007a, 0x006ae, + 0x01c3c, 0x03aba, 0x058e9, 0x072cc, 0x0d2dd, 0x0d22d, 0x0eec1, 0x0eedb, + 0x1d2a2, 0x1ef5b, 0x357e2, 0x3abbf, 0x1d2f9, 0x35004, 0x3a5dc, 0x351fc, + 0x3976c, 0x6a3c6, 0x6a3cb, 0x3e5ea, 0xe59f3, 0x6a3ce, 0x69452, 0xe59f0, + 0x74b90, 0xd4279, 0xd427b, 0x7cbb5, 0x5b0c5, 0x3a5e3, 0x3a5e2, 0x000d0, + 0x00775, 0x01efe, 0x03dd5, 0x0728c, 0x07cb9, 0x0e1a2, 0x0ea85, 0x0eed8, + 0x1a30a, 0x1aa4f, 0x3a5df, 0x35008, 0x3a5e0, 0x3e5f4, 0x3e5f7, 0xb1d6c, + 0x5843e, 0x34a70, 0x72df8, 0x74b6b, 0xd427f, 0x72df0, 0x5b0bf, 0x5b0c0, + 0xd46b0, 0x72def, 0xe59f8, 0x162e64, 0xb1d6f, 0x3a5e0, 0x39427, 0x69166, + 0x6a3e2, 0x6a3e3, 0x74a8d, 0xd427e, 0x1d5d97, 0xd46b4, 0x5b0d8, 0x6a3d3, + 0x000e0, 0x00b63, 0x034cc, 0x06a33, 0x073c9, 0x0e1a0, 0x0f7fd, 0x0f9cc, + 0x1617d, 0x1caeb, 0x1f4a9, 0x3abb3, 0x69450, 0x39420, 0x39777, 0x3e5e0, + 0x6a3d4, 0x6a3ed, 0xb6166, 0xe59f1, 0xb1d6e, 0xe5676, 0x6a3ea, 0xe5674, + 0xb6163, 0xd46b7, 0x7cba6, 0xd46ba, 0x1d5d94, 0xb6164, 0x6a3f1, 0x7cba2, + 0x69451, 0x72dfa, 0xd46bb, 0x72df7, 0x74b94, 0x1cecbf, 0xe59fa, 0x16009b, + 0x6a3e4, 0x000e6, 0x00e94, 0x03876, 0x070ef, 0x0d52a, 0x16015, 0x16014, + 0x1abf9, 0x1cf17, 0x34a79, 0x34650, 0x3e705, 0x6a3d0, 0x58430, 0x74b9d, + 0x7be7e, 0x5b0be, 0x39773, 0x6a3de, 0x000fb, 0x00f7b, 0x03dd7, 0x07bd0, + 0x0e59c, 0x0f9cd, 0x1cf18, 0x1d2ff, 0x34a7a, 0x39429, 0x3500c, 0x72de0, + 0x69456, 0x7be7c, 0xd46b5, 0xd46b2, 0x6a3dd, 0x001a2, 0x0163b, 0x06913, + 0x0b016, 0x0fa42, 0x1a32d, 0x1cf06, 0x34a7c, 0x34a7d, 0xb6161, 0x35481, + 0x3e5fa, 0x7cba0, 0x7be7f, 0x7cba3, 0x7cba7, 0x5b0d3, 0x72de6, 0x6a3dc, + 0x001a9, 0x01ab4, 0x06a34, 0x0d46a, 0x16130, 0x1ef5f, 0x1f532, 0x1f536, + 0x3942e, 0x58436, 0x6a3db, 0x6945b, 0x001c9, 0x01ca0, 0x0728b, 0x0eed9, + 0x1f539, 0x1ca1d, 0x39765, 0x39766, 0x58439, 0x6945d, 0x39767, 0x001d3, + 0x01f2c, 0x07bfc, 0x16161, 0x34652, 0x3a5ed, 0x3548d, 0x58438, 0x6a3da, + 0x002c1, 0x02c5e, 0x0d335, 0x1ab1a, 0x2d874, 0x35006, 0x35484, 0x5b0cc, + 0x74b9a, 0x72df3, 0x6a3d6, 0x002da, 0x034b3, 0x0d5ae, 0x1caee, 0x2d871, + 0x357e3, 0x74b97, 0x72df9, 0x580ba, 0x5b0d4, 0x0034d, 0x0354e, 0x0f750, + 0x1cbc0, 0x3a5e7, 0x3a5e4, 0x00385, 0x03a58, 0x16c41, 0x2c5cf, 0x3e5e1, + 0x74b6c, 0xe5677, 0x6a3df, 0x00390, 0x03e50, 0x163c2, 0x2d876, 0x35482, + 0x5b0d6, 0x5843a, 0x0039f, 0x0585e, 0x1a583, 0x3500f, 0x74b93, 0x39771, + 0x003e4, 0x06912, 0x16c43, 0x357e1, 0x0058a, 0x0696f, 0x1f538, 0x5b0c9, + 0x6a3cf, 0x005b6, 0x06af8, 0x1f534, 0x58483, 0x6a3e0, 0x00695, 0x07d02, + 0x1cae8, 0x58485, 0x006a2, 0x0754a, 0x357ee, 0x3977b, 0x00748, 0x074b2, + 0x34a7b, 0x00729, 0x0b1e0, 0x34649, 0x3e5e3, 0x0073d, 0x0d2c4, 0x3e5e6, + 0x007bb, 0x0b099, 0x39762, 0x5b0ce, 0x6945f, 0x007d1, 0x0d5ab, 0x39779, + 0x007d3, 0x0d52f, 0x39763, 0x6945c, 0x00b1a, 0x0d2c5, 0x35489, 0x00d23, + 0x0eaed, 0x3e5f8, 0x00d32, 0x16016, 0x3e5fb, 0x00d41, 0x0e768, 0x3a5ed, + 0x00e1f, 0x16017, 0x58027, 0x00ead, 0x0fa07, 0x69455, 0x00e54, 0x1612b, + 0x00e55, 0x1a581, 0x00f78, 0x1a32b, 0x580bc, 0x6a3ee, 0x00f79, 0x1abfd, + 0x00f95, 0x1ab18, 0x6a3f0, 0x01637, 0x1aa4d, 0x0162d, 0x1f53c, 0x6a3f3, + 0x01a31, 0x1a810, 0x39769, 0x01a50, 0x1caef, 0x01a36, 0x1a32e, 0x01a67, + 0x1f38e, 0x01a85, 0x1ef59, 0x01aa6, 0x1ef83, 0x01d51, 0x2c012, 0x01d53, + 0x2d879, 0x01d5e, 0x35005, 0x01cba, 0x1cf04, 0x69453, 0x01d2d, 0x351ff, + 0x01f2d, 0x2d86f, 0x01f29, 0x35007, 0x02c22, 0x351fa, 0x02c03, 0x3a5ec, + 0x02c5f, 0x3a5eb, 0x02c58, 0x34a6b, 0x03469, 0x356be, 0x02c59, 0x34a6c, + 0x0346a, 0x3a5ea, 0x034bd, 0x034bf, 0x356bf, 0x0386a, 0x03ab9, 0x5843f, + 0x0386b, 0x3a5f5, 0x03a4b, 0x39421, 0x03aa4, 0x3a5e9, 0x03a5a, 0x03960, + 0x3977e, 0x03de9, 0x03958, 0x03df7, 0x039e1, 0x3e5e4, 0x0395f, 0x69458, + 0x03e91, 0x03df2, 0x39428, 0x058f2, 0x03e80, 0x6a3c3, 0x03e93, 0x694c0, + 0x058b8, 0x5b0ca, 0x0584f, 0x694c1, 0x058f1, 0x068d6, 0x06a10, 0x06ac3, + 0x06a32, 0x070d2, 0x06911, 0x074b1, 0x07494, 0x06ad4, 0x06ad6, 0x072b8, + 0x06afa, 0x074b3, 0x07540, 0x073ce, 0x0b005, 0x074b3, 0x07495, 0x074b9, + 0x0d336, 0x07bff, 0x07763, 0x073c8, 0x07d29, 0x0b622, 0x0d221, 0x0d181, + 0x0b1d1, 0x074b8, 0x0b1d0, 0x0d19b, 0x0d2c3, 0x0b172, 0x0d2dc, 0x0b623, + 0x0d5aa, 0x0d426, 0x0d182, 0x0e795, 0x0e1d1, 0x0d337, 0x0e96c, 0x0e5e4, + 0x0e514, 0x0eaee, 0x16000, 0x0e767, 0x0e1a1, 0x0e78f, 0x16004, 0x0f7c2, + 0x0e799, 0x0e5e7, 0x0e566, 0x0e769, 0x0f751, 0x0eede, 0x0fa06, 0x16005, + 0x0fa9f, 0x1a5e6, 0x0e766, 0x1636f, 0x0eedd, 0x0eec0, 0x1a309, 0x1ceca, + 0x163cd, 0x0f9cb, 0x0eedf, 0x1a582, 0x1612d, 0x0e5e5, 0x1abf8, 0x1a30c, + 0x1ca1f, 0x163cc, 0x1a35c, 0x1ca1e, 0x1aa51, 0x163ac, 0x1a84e, 0x1a53f, + 0x1cf16, 0x1d2fc, 0x1a5b3, 0x1ab19, 0x1a81f, 0x1d5c3, 0x16c3f, 0x1d5c1, + 0x1d2fc, 0x1f4aa, 0x1a812, 0x1f535, 0x1cf12, 0x1a817, 0x1617c, 0x1ab0b, + 0x1d2f8, 0x1ef82, 0x2d87a, 0x1d52f, 0x1f530, 0x1aa48, 0x35487, 0x1d2fd, + 0x1f4ad, 0x1cf11, 0x3461b, 0x35485, 0x1ca20, 0x1caed, 0x1cae6, 0x1abff, + 0x3464f, 0x34a6f, 0x1ef81, 0x3464b, 0x39d96, 0x1f383, 0x1f537, 0x1cf14, + 0x2c5ce, 0x3500e, 0x2c251, 0x1caec, 0x1f387, 0x34654, 0x357e4, 0x2d878, + 0x3500b, 0x35480, 0x3a5e8, 0x3548e, 0x34b64, 0x1f4a8, 0x35003, 0x3e5df, + 0x2d870, 0x357e6, 0x3e5f0, 0x1ef5a, 0x3a5ea, 0x1f388, 0x3e703, 0x2c24e, + 0x3a5e2, 0x351fd, 0x2c6dd, 0x3e704, 0x351fe, 0x2d875, 0x5b0c7, 0x3976a, + 0x3a5e6, 0x39423, 0x58480, 0x2c246, 0x3a5e3, 0x2d877, 0x3e5f1, 0x3abbe, + 0x58489, 0x3e5f9, 0x357e0, 0x3abbc, 0x5b0c6, 0x69167, 0x69165, 0x3e5e9, + 0x39422, 0x3976f, 0x3977d, 0x3e5de, 0x6a3c9, 0x58b98, 0x3a5f6, 0x3a5d0, + 0x58486, 0x6a3c1, 0x3e5fc, 0x5b0dc, 0x3548f, 0x3942d, 0x694c9, 0x58484, + 0x3a5e8, 0x74b9b, 0x74b96, 0x694d0, 0x58488, 0x3a5e4, 0x3942a, 0x72ec2, + 0x39776, 0x5b0d1, 0x5b0cf, 0x3a5d6, 0xe59fc, 0x5b0c8, 0x3e5e7, 0x7cbb7, + 0x70e87, 0x7cbab, 0x5b0c2, 0x694c3, 0x74a8e, 0x3e5f3, 0x6a3cd, 0x72dfe, + 0x73b2e, 0x72ec0, 0x694c5, 0x58437, 0x694c8, 0x72dff, 0x39435, 0x5843d, + 0x6a3d7, 0x72ec1, 0xd22c8, 0x694cf, 0xb6173, 0x3e5fe, 0x580bb, 0xe59f2, + 0xb616e, 0xb6175, 0x3a5da, 0x5b0bd, 0x694cc, 0x5843c, 0x694c7, 0x74b92, + 0x72ec3, 0x694c6, 0xb6170, 0x7cbac, 0xb1733, 0x7cba4, 0xb6167, 0x72de7, + 0x72de4, 0x6a3c0, 0x3e5ef, 0x162e65, 0x72de3, 0x72dfb, 0x6a35f, 0x6a3eb, +}; + +static const uint8_t coef2_huffbits[1336] = { + 11, 9, 2, 3, 4, 4, 5, 6, + 6, 7, 7, 8, 8, 8, 9, 9, + 9, 9, 10, 10, 10, 10, 11, 11, + 11, 11, 11, 11, 11, 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, 14, 14, + 14, 14, 14, 14, 14, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 16, 15, 16, + 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, + 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 18, 17, 17, 17, 17, + 17, 17, 17, 18, 18, 17, 17, 18, + 17, 17, 18, 17, 18, 18, 18, 18, + 19, 18, 18, 18, 18, 18, 18, 20, + 18, 18, 18, 19, 19, 18, 19, 18, + 19, 19, 18, 19, 19, 18, 19, 19, + 19, 19, 18, 19, 19, 19, 19, 19, + 19, 19, 20, 20, 20, 19, 19, 20, + 19, 20, 19, 19, 20, 19, 19, 20, + 20, 20, 20, 19, 20, 21, 19, 3, + 5, 7, 8, 9, 9, 10, 11, 11, + 12, 12, 12, 13, 13, 13, 13, 14, + 14, 14, 14, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 16, 16, + 15, 15, 15, 15, 16, 16, 16, 16, + 17, 16, 17, 17, 16, 17, 17, 17, + 17, 17, 17, 16, 17, 17, 17, 17, + 18, 17, 17, 18, 18, 18, 18, 18, + 19, 18, 18, 18, 18, 18, 18, 19, + 19, 18, 18, 18, 18, 19, 18, 19, + 19, 19, 20, 19, 18, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 20, + 20, 19, 20, 19, 20, 19, 20, 19, + 19, 21, 20, 20, 19, 4, 7, 8, + 10, 11, 11, 12, 12, 13, 13, 14, + 14, 14, 14, 15, 15, 15, 15, 15, + 16, 16, 16, 16, 16, 16, 16, 17, + 17, 17, 17, 17, 17, 17, 16, 16, + 16, 16, 17, 17, 17, 17, 18, 18, + 18, 17, 17, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 19, 18, 18, 18, + 19, 18, 19, 19, 19, 20, 20, 20, + 19, 19, 19, 19, 19, 19, 19, 21, + 21, 20, 19, 5, 8, 10, 11, 12, + 13, 13, 13, 14, 14, 15, 15, 15, + 15, 16, 16, 16, 16, 16, 17, 17, + 17, 17, 17, 17, 17, 17, 18, 17, + 18, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 19, 18, 19, 18, + 18, 18, 18, 18, 19, 18, 17, 17, + 18, 18, 19, 19, 19, 19, 18, 18, + 18, 19, 6, 9, 11, 12, 13, 13, + 14, 14, 14, 15, 15, 16, 16, 16, + 16, 16, 16, 17, 17, 17, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, + 18, 17, 18, 18, 17, 18, 18, 18, + 18, 18, 18, 19, 19, 18, 18, 18, + 19, 19, 19, 20, 19, 19, 18, 19, + 19, 20, 21, 21, 19, 19, 18, 6, + 10, 12, 13, 14, 14, 14, 15, 15, + 15, 16, 16, 17, 17, 17, 17, 17, + 17, 17, 18, 18, 19, 18, 18, 18, + 19, 18, 18, 18, 19, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, + 19, 20, 20, 19, 19, 19, 19, 20, + 20, 19, 20, 19, 19, 19, 20, 20, + 20, 19, 19, 18, 19, 7, 10, 12, + 13, 14, 15, 15, 15, 16, 16, 17, + 17, 17, 17, 17, 17, 18, 18, 18, + 18, 19, 18, 19, 19, 19, 20, 19, + 18, 19, 19, 18, 18, 19, 19, 19, + 18, 19, 19, 20, 19, 18, 20, 21, + 20, 20, 19, 19, 21, 20, 21, 20, + 20, 20, 19, 19, 20, 20, 21, 20, + 19, 7, 11, 13, 14, 15, 15, 15, + 16, 16, 17, 17, 17, 17, 18, 18, + 18, 18, 18, 19, 20, 19, 19, 20, + 19, 19, 19, 19, 19, 19, 19, 19, + 18, 18, 19, 20, 19, 19, 19, 20, + 19, 19, 19, 20, 19, 20, 20, 21, + 20, 20, 20, 21, 22, 20, 19, 20, + 20, 21, 20, 21, 20, 19, 8, 11, + 13, 14, 15, 16, 16, 16, 17, 17, + 17, 18, 18, 18, 18, 18, 19, 18, + 19, 19, 19, 19, 21, 19, 19, 21, + 19, 20, 20, 20, 19, 18, 18, 8, + 12, 14, 15, 16, 16, 16, 16, 17, + 17, 17, 19, 18, 18, 19, 19, 20, + 19, 18, 20, 19, 20, 20, 19, 19, + 20, 20, 21, 21, 20, 19, 19, 19, + 19, 19, 19, 20, 21, 20, 19, 19, + 8, 12, 14, 15, 16, 16, 17, 17, + 17, 18, 18, 18, 19, 19, 19, 19, + 19, 19, 20, 21, 20, 21, 19, 21, + 20, 20, 20, 20, 21, 20, 19, 20, + 19, 20, 20, 20, 19, 22, 21, 21, + 19, 9, 12, 14, 15, 16, 17, 17, + 17, 18, 18, 18, 19, 19, 19, 19, + 20, 19, 19, 19, 9, 13, 15, 16, + 17, 17, 18, 18, 18, 19, 18, 20, + 19, 20, 20, 20, 19, 9, 13, 15, + 16, 17, 17, 18, 18, 18, 20, 18, + 19, 20, 20, 20, 20, 19, 20, 19, + 9, 13, 15, 16, 17, 18, 18, 18, + 19, 19, 19, 19, 10, 14, 16, 17, + 18, 18, 19, 19, 19, 19, 19, 10, + 14, 16, 17, 18, 18, 18, 19, 19, + 10, 14, 16, 17, 18, 18, 18, 19, + 19, 20, 19, 10, 14, 16, 18, 18, + 18, 19, 20, 19, 19, 10, 14, 17, + 18, 18, 18, 10, 15, 17, 18, 19, + 19, 21, 19, 11, 15, 17, 18, 18, + 19, 19, 11, 15, 17, 18, 19, 19, + 11, 15, 17, 18, 11, 15, 18, 19, + 19, 11, 15, 18, 19, 19, 11, 16, + 18, 19, 11, 15, 18, 19, 11, 16, + 18, 12, 16, 18, 19, 12, 16, 19, + 12, 16, 19, 19, 19, 12, 16, 19, + 12, 16, 19, 19, 12, 16, 18, 12, + 16, 19, 12, 17, 19, 12, 17, 19, + 12, 17, 19, 12, 17, 19, 13, 17, + 13, 17, 13, 17, 19, 19, 13, 17, + 13, 17, 19, 13, 17, 13, 18, 19, + 13, 17, 19, 13, 18, 13, 17, 13, + 18, 13, 18, 13, 18, 13, 18, 13, + 18, 13, 18, 14, 18, 19, 14, 18, + 14, 18, 14, 18, 14, 18, 14, 19, + 14, 19, 14, 18, 14, 18, 14, 18, + 14, 19, 14, 14, 18, 14, 14, 19, + 14, 18, 14, 19, 14, 19, 14, 15, + 19, 15, 15, 15, 15, 19, 15, 19, + 15, 15, 19, 15, 15, 19, 15, 19, + 15, 19, 15, 19, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 16, + 15, 15, 15, 16, 16, 16, 15, 16, + 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 17, 16, 16, 16, 17, + 17, 16, 17, 17, 16, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 18, + 17, 17, 17, 17, 17, 17, 17, 17, + 18, 17, 17, 18, 17, 17, 17, 17, + 18, 18, 17, 17, 17, 17, 17, 17, + 17, 18, 17, 18, 18, 17, 17, 17, + 18, 18, 18, 17, 18, 17, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 17, + 18, 18, 18, 18, 19, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 18, 18, 18, 18, 18, 19, + 18, 18, 19, 18, 18, 18, 19, 18, + 19, 18, 18, 19, 18, 18, 19, 19, + 19, 19, 19, 18, 19, 18, 19, 18, + 19, 19, 18, 18, 19, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 18, 19, + 19, 19, 19, 19, 18, 19, 19, 19, + 19, 19, 19, 19, 19, 19, 19, 20, + 19, 19, 19, 19, 21, 19, 19, 20, + 19, 20, 19, 19, 19, 19, 19, 20, + 20, 20, 19, 19, 19, 20, 19, 19, + 19, 20, 20, 19, 20, 19, 19, 21, + 20, 20, 19, 19, 19, 19, 19, 19, + 20, 19, 20, 20, 20, 20, 20, 20, + 20, 19, 19, 21, 20, 20, 19, 19, +}; + +static const uint32_t coef3_huffcodes[1072] = { + 0x001b2, 0x00069, 0x00000, 0x00004, 0x00006, 0x0000e, 0x00014, 0x00019, + 0x00016, 0x0002b, 0x00030, 0x0003d, 0x0003c, 0x0005a, 0x0005f, 0x0006d, + 0x0007e, 0x0005f, 0x0007f, 0x000b6, 0x000bc, 0x000d8, 0x000f2, 0x000fe, + 0x000bc, 0x000fc, 0x00161, 0x0016e, 0x00174, 0x00176, 0x001a2, 0x001e3, + 0x001f3, 0x00174, 0x0017a, 0x001ea, 0x002a8, 0x002c4, 0x002e6, 0x00314, + 0x00346, 0x00367, 0x003e9, 0x002e5, 0x002ee, 0x003d6, 0x00555, 0x00554, + 0x00557, 0x005c3, 0x005d6, 0x006e0, 0x0062f, 0x006e2, 0x00799, 0x00789, + 0x007fa, 0x005ce, 0x007fe, 0x005ec, 0x007cc, 0x007af, 0x00aa7, 0x00b19, + 0x00b94, 0x00b85, 0x00b9f, 0x00c48, 0x00c45, 0x00dd8, 0x00c4c, 0x00c4b, + 0x00d99, 0x00d1f, 0x00dc2, 0x00f95, 0x00fa2, 0x00bb5, 0x00b9f, 0x00f5d, + 0x00bbf, 0x00f47, 0x0154a, 0x00fd5, 0x00f45, 0x00f7f, 0x0160d, 0x01889, + 0x01757, 0x01722, 0x018b3, 0x0172d, 0x01a39, 0x01a18, 0x01bb3, 0x01b30, + 0x01e63, 0x0173c, 0x01b35, 0x01723, 0x01e80, 0x01fee, 0x01761, 0x01ffc, + 0x01f7f, 0x02c7c, 0x01fa1, 0x0177b, 0x01755, 0x0175a, 0x01fa6, 0x02eab, + 0x0310a, 0x02c69, 0x03669, 0x03127, 0x03103, 0x02e43, 0x03662, 0x03165, + 0x03124, 0x0313b, 0x03111, 0x03668, 0x0343b, 0x03c52, 0x03efc, 0x02e6c, + 0x03fda, 0x03ef8, 0x02e7b, 0x03ee2, 0x03cc5, 0x03d72, 0x058c0, 0x03df8, + 0x02ea9, 0x03e7e, 0x0556d, 0x05c82, 0x03d71, 0x03e7b, 0x03c42, 0x058d7, + 0x03f4e, 0x06200, 0x03d70, 0x05cb2, 0x05c96, 0x05cb0, 0x03f45, 0x05cb1, + 0x02e6d, 0x03110, 0x02f68, 0x05c90, 0x07ca6, 0x07c88, 0x06204, 0x062c8, + 0x078a6, 0x07986, 0x079d5, 0x0b1ad, 0x07989, 0x0b079, 0x05cdd, 0x0aad4, + 0x05de8, 0x07dcd, 0x07987, 0x05d67, 0x05d99, 0x0b91d, 0x07cf1, 0x05d9b, + 0x079d7, 0x0b07b, 0x05c85, 0x05d9a, 0x07dcc, 0x07ebf, 0x07dce, 0x07dfb, + 0x07ec0, 0x07d1a, 0x07a07, 0x05c84, 0x0c471, 0x07cf2, 0x0baef, 0x0b9d2, + 0x05deb, 0x07bd6, 0x0b845, 0x05d98, 0x0b91a, 0x0bae8, 0x0c4e0, 0x0dc31, + 0x0f93d, 0x0bbce, 0x0d1d2, 0x0f7a9, 0x0d9b9, 0x0bbcb, 0x0b900, 0x0aad7, + 0x0babd, 0x0c4e1, 0x0f46f, 0x0c588, 0x0c58b, 0x160e6, 0x0bbcf, 0x0bac3, + 0x0f945, 0x0f7a3, 0x0d1c1, 0x0fb8e, 0x0f7a4, 0x0fb8c, 0x0f40c, 0x0c473, + 0x0fd72, 0x0bbcd, 0x0fffa, 0x0f940, 0x0bbc9, 0x0f7a8, 0x1a1ed, 0x0bbc5, + 0x1f26f, 0x163fd, 0x160c7, 0x1a1f5, 0x0f947, 0x163fc, 0x154b3, 0x0fff6, + 0x163f6, 0x160e9, 0x1a1f0, 0x0bab9, 0x0baba, 0x17086, 0x0b903, 0x0fd75, + 0x0f308, 0x176f3, 0x163ff, 0x0fd7d, 0x1bb78, 0x163fb, 0x188db, 0x1a1f7, + 0x154b2, 0x172fd, 0x163f4, 0x1bb73, 0x172ff, 0x0babc, 0x0f97d, 0x1a1f3, + 0x1bb6d, 0x1ffd5, 0x1a1f4, 0x1f272, 0x17380, 0x17382, 0x1ffe7, 0x0bac8, + 0x0bbc4, 0x188d3, 0x160e0, 0x0fd7b, 0x1725f, 0x172f5, 0x1bb79, 0x1fad9, + 0x1f269, 0x188d0, 0x0bac4, 0x0bac5, 0x31185, 0x188d2, 0x188cc, 0x31187, + 0x3e7fe, 0x188d1, 0x1bb6c, 0x1f268, 0x1fad2, 0x1ffd9, 0x1a1ea, 0x1bb68, + 0x1facb, 0x3fdb2, 0x1e81a, 0x188ce, 0x172fb, 0x1a1ef, 0x1face, 0x1bb70, + 0x0bac1, 0x1bb6b, 0x172f8, 0x1bb66, 0x1ffdf, 0x1bb6a, 0x1ffd7, 0x1f266, + 0x176f8, 0x37653, 0x1fa7e, 0x31182, 0x1fac8, 0x2c7e3, 0x370ee, 0x176ec, + 0x176e9, 0x2e4bc, 0x160c5, 0x3765a, 0x3ce9c, 0x17373, 0x176e8, 0x188d4, + 0x176f1, 0x176ef, 0x37659, 0x1bb7c, 0x1ffde, 0x176f2, 0x3118b, 0x2c7d4, + 0x37651, 0x5ce9f, 0x37650, 0x31191, 0x3f4f6, 0x3f4f5, 0x7a06c, 0x1fac1, + 0x5c97b, 0x2c7e0, 0x79d3a, 0x3e7fd, 0x2c7df, 0x3f4f0, 0x7a06d, 0x376c1, + 0x79d3b, 0x00004, 0x00014, 0x00059, 0x000ab, 0x000b8, 0x00177, 0x001f5, + 0x001f2, 0x00315, 0x003fc, 0x005bd, 0x0062d, 0x006e8, 0x007dd, 0x00b04, + 0x007cd, 0x00b1e, 0x00d1e, 0x00f15, 0x00f3b, 0x00f41, 0x01548, 0x018b0, + 0x0173b, 0x01884, 0x01a1c, 0x01bb4, 0x01f25, 0x017b5, 0x0176d, 0x01ef8, + 0x02e73, 0x03107, 0x03125, 0x03105, 0x02e49, 0x03ce8, 0x03ef9, 0x03e5e, + 0x02e72, 0x03471, 0x03fd9, 0x0623f, 0x078a0, 0x06867, 0x05cb3, 0x06272, + 0x068ec, 0x06e9a, 0x079d4, 0x06e98, 0x0b1aa, 0x06e1a, 0x07985, 0x068ee, + 0x06e9b, 0x05c88, 0x0b1ac, 0x07dfa, 0x05d65, 0x07cf0, 0x07cbf, 0x0c475, + 0x160eb, 0x1bb7e, 0x0f7a6, 0x1fedd, 0x160e3, 0x0fffb, 0x0fb8d, 0x0fff9, + 0x0d1c0, 0x0c58c, 0x1a1e9, 0x0bab8, 0x0f5cf, 0x0fff5, 0x376c5, 0x1a1ec, + 0x160ed, 0x1fede, 0x1fac9, 0x1a1eb, 0x1f224, 0x176ee, 0x0fd79, 0x17080, + 0x17387, 0x1bb7a, 0x1ffe9, 0x176f7, 0x17385, 0x17781, 0x2c7d5, 0x17785, + 0x1ffe3, 0x163f5, 0x1fac2, 0x3e7f9, 0x3118d, 0x3fdb1, 0x1ffe2, 0x1f226, + 0x3118a, 0x2c7d9, 0x31190, 0x3118c, 0x3f4f3, 0x1bb7f, 0x1bb72, 0x31184, + 0xb92f4, 0x3e7fb, 0x6e1d9, 0x1faca, 0x62300, 0x3fdb8, 0x3d037, 0x3e7fc, + 0x62301, 0x3f4f2, 0x1f26a, 0x0000e, 0x00063, 0x000f8, 0x001ee, 0x00377, + 0x003f7, 0x006e3, 0x005cc, 0x00b05, 0x00dd2, 0x00fd4, 0x0172e, 0x0172a, + 0x01e23, 0x01f2d, 0x01763, 0x01769, 0x0176c, 0x02e75, 0x03104, 0x02ec1, + 0x03e58, 0x0583f, 0x03f62, 0x03f44, 0x058c5, 0x0623c, 0x05cf4, 0x07bd7, + 0x05d9d, 0x0aad2, 0x05d66, 0x0b1a9, 0x0b078, 0x07cfe, 0x0b918, 0x0c46f, + 0x0b919, 0x0b847, 0x06e1b, 0x0b84b, 0x0aad8, 0x0fd74, 0x172f4, 0x17081, + 0x0f97c, 0x1f273, 0x0f7a0, 0x0fd7c, 0x172f7, 0x0fd7a, 0x1bb77, 0x172fe, + 0x1f270, 0x0fd73, 0x1bb7b, 0x1a1bc, 0x1bb7d, 0x0bbc3, 0x172f6, 0x0baeb, + 0x0fb8f, 0x3f4f4, 0x3fdb4, 0x376c8, 0x3e7fa, 0x1ffd0, 0x62303, 0xb92f5, + 0x1f261, 0x31189, 0x3fdb5, 0x2c7db, 0x376c9, 0x1fad6, 0x1fad1, 0x00015, + 0x000f0, 0x002e0, 0x0058e, 0x005d7, 0x00c4d, 0x00fa1, 0x00bdb, 0x01756, + 0x01f70, 0x02c19, 0x0313c, 0x0370f, 0x03cc0, 0x02ea8, 0x058c6, 0x058c7, + 0x02eb7, 0x058d0, 0x07d18, 0x0aa58, 0x0b848, 0x05d9e, 0x05d6c, 0x0b84c, + 0x0c589, 0x0b901, 0x163f8, 0x0bac9, 0x0b9c5, 0x0f93c, 0x188d8, 0x0bbc7, + 0x160ec, 0x0fd6f, 0x188d9, 0x160ea, 0x0f7a7, 0x0f944, 0x0baab, 0x0dc3a, + 0x188cf, 0x176fb, 0x2c7d8, 0x2c7d7, 0x1bb75, 0x5ce9e, 0x62302, 0x370ed, + 0x176f4, 0x1ffd1, 0x370ef, 0x3f4f8, 0x376c7, 0x1ffe1, 0x376c6, 0x176ff, + 0x6e1d8, 0x176f6, 0x17087, 0x0f5cd, 0x00035, 0x001a0, 0x0058b, 0x00aac, + 0x00b9a, 0x0175f, 0x01e22, 0x01e8c, 0x01fb2, 0x0310b, 0x058d1, 0x0552e, + 0x05c27, 0x0686e, 0x07ca7, 0x0c474, 0x0dc33, 0x07bf2, 0x05de9, 0x07a35, + 0x0baaa, 0x0b9eb, 0x0fb95, 0x0b9b8, 0x17381, 0x1f262, 0x188cd, 0x17088, + 0x172fa, 0x0f7a2, 0x1fad3, 0x0bac0, 0x3765c, 0x1fedf, 0x1f225, 0x1fad4, + 0x2c7da, 0x5ce9d, 0x3e7f8, 0x1e203, 0x188d7, 0x00054, 0x002c0, 0x007a1, + 0x00f78, 0x01b36, 0x01fa3, 0x0313a, 0x03436, 0x0343a, 0x07d1d, 0x07bd8, + 0x05cdf, 0x0b846, 0x0b189, 0x0d9b8, 0x0fff8, 0x0d9be, 0x0c58a, 0x05dea, + 0x0d1d3, 0x160e4, 0x1f26b, 0x188da, 0x1e202, 0x2c7d2, 0x163fe, 0x31193, + 0x17782, 0x376c2, 0x2c7d1, 0x3fdb0, 0x3765d, 0x2c7d0, 0x1fad0, 0x1e201, + 0x188dd, 0x2c7e2, 0x37657, 0x37655, 0x376c4, 0x376c0, 0x176ea, 0x0006f, + 0x003cf, 0x00dd5, 0x01f23, 0x02c61, 0x02ed0, 0x05d54, 0x0552d, 0x07883, + 0x0b1a8, 0x0b91c, 0x0babf, 0x0b902, 0x0f7aa, 0x0f7a5, 0x1a1e8, 0x1ffd6, + 0x0babe, 0x1a1bf, 0x163f3, 0x1ffd8, 0x1fad7, 0x1f275, 0x1ffdc, 0x0007d, + 0x005bc, 0x01549, 0x02a99, 0x03def, 0x06273, 0x079d6, 0x07d1b, 0x0aad3, + 0x0d0fc, 0x2c7dd, 0x188d6, 0x0bac2, 0x2c7e1, 0x1bb76, 0x1a1bd, 0x31186, + 0x0fd78, 0x1a1be, 0x31183, 0x3fdb6, 0x3f4f1, 0x37652, 0x1fad5, 0x3f4f9, + 0x3e7ff, 0x5ce9c, 0x3765b, 0x31188, 0x17372, 0x000bd, 0x0078b, 0x01f21, + 0x03c43, 0x03ded, 0x0aad6, 0x07ec1, 0x0f942, 0x05c86, 0x17089, 0x0babb, + 0x1ffe8, 0x2c7de, 0x1f26e, 0x1fac4, 0x3f4f7, 0x37656, 0x1fa7d, 0x376c3, + 0x3fdb3, 0x3118f, 0x1fac6, 0x000f8, 0x007ed, 0x01efd, 0x03e7a, 0x05c91, + 0x0aad9, 0x0baec, 0x0dc32, 0x0f46e, 0x1e200, 0x176fa, 0x3765e, 0x3fdb7, + 0x2c7d6, 0x3fdb9, 0x37654, 0x37658, 0x3118e, 0x1ffdb, 0x000f6, 0x00c43, + 0x03106, 0x068ef, 0x0b84d, 0x0b188, 0x0bbcc, 0x1f264, 0x1bb69, 0x17386, + 0x1fac0, 0x00171, 0x00f39, 0x03e41, 0x068ed, 0x0d9bc, 0x0f7a1, 0x1bb67, + 0x1ffdd, 0x176f9, 0x001b9, 0x00f7d, 0x03f63, 0x0d0fd, 0x0b9ea, 0x188dc, + 0x1fac3, 0x1a1f2, 0x31192, 0x1ffe4, 0x001f6, 0x01754, 0x06865, 0x0f309, + 0x160e5, 0x176f5, 0x3765f, 0x1facc, 0x001e9, 0x01a1a, 0x06201, 0x0f105, + 0x176f0, 0x002df, 0x01756, 0x05d6d, 0x163fa, 0x176ed, 0x00342, 0x02e40, + 0x0d0ff, 0x17082, 0x003cd, 0x02a98, 0x0fffc, 0x2c7dc, 0x1fa7f, 0x003fe, + 0x03764, 0x0fffd, 0x176fc, 0x1fac5, 0x002f7, 0x02ed1, 0x0fb97, 0x0058a, + 0x02edc, 0x0bbc8, 0x005d4, 0x0623d, 0x160e8, 0x0062e, 0x05830, 0x163f9, + 0x006eb, 0x06205, 0x1f274, 0x007de, 0x062c9, 0x1f265, 0x005c9, 0x05cde, + 0x1ffd3, 0x005d4, 0x07988, 0x007ce, 0x0b849, 0x00b1b, 0x05c89, 0x1fac7, + 0x00b93, 0x05c83, 0x00b9e, 0x0f14f, 0x00c4a, 0x0b9c7, 0x00dd4, 0x0c470, + 0x1f271, 0x00f38, 0x0fb96, 0x176eb, 0x00fa0, 0x163f7, 0x00bb2, 0x0b91b, + 0x00bbe, 0x0f102, 0x00f44, 0x0f946, 0x1facd, 0x00f79, 0x0d9bd, 0x0154d, + 0x0bbc6, 0x00fd2, 0x160e7, 0x0172b, 0x188cb, 0x0175e, 0x0fd76, 0x0175c, + 0x1bb71, 0x0189f, 0x1a1ee, 0x01f24, 0x1a1f6, 0x01ba7, 0x0bbca, 0x01f7d, + 0x0ffff, 0x01f2e, 0x1bb65, 0x01bb5, 0x172f9, 0x01fef, 0x1f26c, 0x01f3e, + 0x0fd77, 0x01762, 0x1bb6e, 0x01ef9, 0x172fc, 0x01fa0, 0x02ab7, 0x02e4a, + 0x1f267, 0x01fb3, 0x1ffda, 0x02e42, 0x03101, 0x17780, 0x0313d, 0x03475, + 0x17784, 0x03126, 0x1facf, 0x03c51, 0x17783, 0x03e40, 0x1ffe5, 0x03663, + 0x1ffe0, 0x03e8f, 0x1f26d, 0x0343c, 0x03cc1, 0x176fd, 0x03e45, 0x02ec0, + 0x03f61, 0x03dee, 0x03fd8, 0x0583e, 0x02e45, 0x03e59, 0x03d02, 0x05ce8, + 0x05568, 0x176fe, 0x02f69, 0x1fad8, 0x058c1, 0x05c83, 0x1ffe6, 0x06271, + 0x06e1c, 0x062c7, 0x068e1, 0x0552f, 0x06864, 0x06866, 0x06e99, 0x05cbc, + 0x07ca5, 0x078a1, 0x05c82, 0x07dcf, 0x0623b, 0x0623e, 0x068e8, 0x07a36, + 0x05d9c, 0x0b077, 0x07cf3, 0x07a34, 0x07ca4, 0x07d19, 0x079d2, 0x07d1c, + 0x07bd9, 0x0b84a, 0x0fb94, 0x0aad5, 0x0dc30, 0x07bf3, 0x0baee, 0x0b07a, + 0x0c472, 0x0b91e, 0x0d9ba, 0x05d9f, 0x0d0fe, 0x0b9c6, 0x05c87, 0x0f14e, + 0x0baed, 0x0b92e, 0x0f103, 0x0b9c4, 0x0fb91, 0x0d9bb, 0x0b1ab, 0x0c58d, + 0x0fffe, 0x0f93b, 0x0f941, 0x0baea, 0x0b91f, 0x0f5cc, 0x0d9bf, 0x0f943, + 0x0f104, 0x1f260, 0x0fb92, 0x0f93f, 0x0f3a6, 0x0bac7, 0x0f7ab, 0x0bac6, + 0x17383, 0x0fd6d, 0x0bae9, 0x0fd6e, 0x1e74f, 0x188ca, 0x1f227, 0x0fb93, + 0x0fb90, 0x0fff7, 0x17085, 0x17083, 0x160e1, 0x17084, 0x0f93e, 0x160e2, + 0x160c6, 0x1a1f1, 0x1bb6f, 0x17384, 0x0fd70, 0x1f263, 0x188d5, 0x173a6, + 0x0f5ce, 0x163f2, 0x0fd71, 0x1ffd2, 0x160c4, 0x1ffd4, 0x2c7d3, 0x1bb74, +}; + +static const uint8_t coef3_huffbits[1072] = { + 9, 7, 2, 3, 4, 4, 5, 5, + 6, 6, 6, 6, 7, 7, 7, 7, + 7, 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, 10, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, + 11, 12, 11, 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, 14, 13, 14, 14, 13, 14, 13, + 13, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 15, + 14, 14, 15, 14, 14, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 14, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 14, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 16, 15, 16, 16, 16, + 16, 15, 15, 16, 16, 16, 16, 16, + 15, 16, 16, 16, 15, 16, 15, 15, + 16, 15, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, + 16, 17, 16, 17, 16, 17, 17, 16, + 17, 16, 17, 16, 16, 17, 17, 17, + 16, 17, 16, 16, 17, 16, 17, 16, + 17, 17, 16, 16, 17, 17, 17, 17, + 17, 17, 17, 17, 16, 17, 17, 16, + 17, 17, 17, 17, 17, 17, 17, 17, + 16, 18, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 16, 17, + 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 18, + 17, 17, 17, 17, 18, 17, 17, 18, + 19, 17, 17, 17, 18, 17, 17, 17, + 18, 18, 18, 17, 17, 17, 18, 17, + 17, 17, 17, 17, 17, 17, 17, 17, + 18, 18, 18, 18, 18, 18, 18, 18, + 18, 18, 17, 18, 18, 18, 18, 17, + 18, 18, 18, 17, 17, 18, 18, 18, + 18, 19, 18, 18, 19, 19, 20, 18, + 19, 18, 19, 19, 18, 19, 20, 18, + 19, 4, 6, 7, 8, 9, 9, 9, + 10, 10, 10, 11, 11, 11, 11, 12, + 12, 12, 12, 12, 12, 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, 16, 15, 15, 15, + 15, 16, 16, 15, 16, 16, 15, 16, + 17, 17, 17, 17, 17, 16, 16, 16, + 16, 16, 17, 17, 17, 16, 18, 17, + 17, 17, 18, 17, 17, 18, 17, 17, + 17, 17, 17, 18, 17, 18, 18, 18, + 17, 17, 18, 19, 18, 18, 17, 17, + 18, 18, 18, 18, 19, 17, 17, 18, + 20, 19, 19, 18, 19, 18, 19, 19, + 19, 19, 17, 5, 7, 9, 10, 10, + 11, 11, 12, 12, 12, 13, 13, 13, + 13, 13, 14, 14, 14, 14, 14, 15, + 14, 15, 15, 15, 15, 15, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 15, 16, 16, 17, 17, 17, + 16, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 16, + 16, 19, 18, 18, 19, 17, 19, 20, + 17, 18, 18, 18, 18, 18, 18, 6, + 8, 10, 11, 12, 12, 12, 13, 13, + 13, 14, 14, 14, 14, 15, 15, 15, + 15, 15, 15, 16, 16, 16, 16, 16, + 16, 17, 17, 17, 16, 16, 17, 17, + 17, 17, 17, 17, 17, 16, 16, 16, + 17, 18, 18, 18, 17, 19, 19, 18, + 18, 17, 18, 19, 18, 17, 18, 18, + 19, 18, 17, 17, 6, 9, 11, 12, + 13, 13, 13, 14, 14, 14, 15, 15, + 15, 15, 15, 16, 16, 16, 16, 16, + 16, 17, 16, 17, 17, 17, 17, 17, + 17, 17, 18, 17, 18, 17, 17, 18, + 18, 19, 19, 17, 17, 7, 10, 12, + 13, 13, 14, 14, 14, 14, 15, 16, + 16, 16, 16, 16, 16, 16, 16, 16, + 16, 17, 17, 17, 17, 18, 17, 18, + 18, 18, 18, 18, 18, 18, 18, 17, + 17, 18, 18, 18, 18, 18, 18, 7, + 10, 12, 13, 14, 15, 15, 15, 15, + 16, 16, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 18, 17, 17, 8, + 11, 13, 14, 15, 15, 15, 15, 16, + 16, 18, 17, 17, 18, 17, 17, 18, + 17, 17, 18, 18, 19, 18, 18, 19, + 19, 19, 18, 18, 18, 8, 11, 13, + 14, 15, 16, 16, 16, 16, 17, 17, + 17, 18, 17, 18, 19, 18, 18, 18, + 18, 18, 18, 8, 12, 14, 15, 15, + 16, 16, 16, 17, 17, 18, 18, 18, + 18, 18, 18, 18, 18, 17, 9, 12, + 14, 15, 16, 16, 17, 17, 17, 17, + 18, 9, 12, 14, 15, 16, 17, 17, + 17, 18, 9, 13, 15, 16, 17, 17, + 18, 17, 18, 17, 9, 13, 15, 16, + 17, 18, 18, 18, 10, 13, 15, 16, + 18, 10, 14, 16, 17, 18, 10, 14, + 16, 17, 10, 14, 16, 18, 18, 10, + 14, 16, 18, 18, 11, 15, 16, 11, + 15, 17, 11, 15, 17, 11, 15, 17, + 11, 15, 17, 11, 15, 17, 12, 16, + 17, 12, 15, 12, 16, 12, 16, 18, + 12, 16, 12, 16, 12, 16, 12, 16, + 17, 12, 16, 18, 12, 17, 13, 16, + 13, 16, 13, 16, 18, 13, 16, 13, + 17, 13, 17, 13, 17, 13, 17, 13, + 17, 13, 17, 13, 17, 13, 17, 13, + 16, 13, 17, 13, 17, 13, 17, 14, + 17, 14, 17, 14, 17, 14, 14, 14, + 17, 14, 17, 14, 14, 18, 14, 14, + 18, 14, 18, 14, 18, 14, 17, 14, + 17, 14, 17, 14, 14, 18, 14, 15, + 15, 15, 14, 15, 15, 14, 15, 15, + 15, 18, 15, 18, 15, 15, 17, 15, + 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 16, 15, 15, 15, 15, 16, + 16, 16, 16, 16, 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, 17, 16, 16, + 16, 17, 16, 16, 16, 17, 17, 17, + 17, 17, 16, 17, 17, 17, 17, 16, + 16, 16, 17, 17, 17, 17, 16, 17, + 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 18, 17, +}; + +static const uint32_t coef4_huffcodes[476] = { + 0x00f01, 0x0001e, 0x00000, 0x00004, 0x00006, 0x0000d, 0x0000a, 0x00017, + 0x0001d, 0x00017, 0x0002c, 0x00031, 0x00039, 0x0003e, 0x00039, 0x0005a, + 0x00066, 0x00070, 0x0007b, 0x00070, 0x00077, 0x000af, 0x000c9, 0x000f2, + 0x000f4, 0x000b2, 0x000e3, 0x0015b, 0x0015d, 0x00181, 0x0019d, 0x001e3, + 0x001c5, 0x002b5, 0x002db, 0x00338, 0x003c3, 0x003cc, 0x003f0, 0x002cd, + 0x003fa, 0x003a1, 0x005b4, 0x00657, 0x007ab, 0x0074d, 0x0074c, 0x00ac1, + 0x00ac5, 0x0076b, 0x00ca8, 0x00f04, 0x00f00, 0x00fe3, 0x00f3c, 0x00f10, + 0x00f39, 0x00fe6, 0x00e26, 0x00e90, 0x016c5, 0x01827, 0x01954, 0x015c5, + 0x01958, 0x01f8a, 0x01c4a, 0x02b0f, 0x02b41, 0x02b0e, 0x033c6, 0x03050, + 0x01c4f, 0x02d88, 0x0305c, 0x03c18, 0x02b4f, 0x02cc2, 0x03a47, 0x05680, + 0x0569d, 0x06442, 0x06443, 0x06446, 0x0656e, 0x06444, 0x07120, 0x0748a, + 0x0c1ba, 0x07e22, 0x07aa6, 0x07f25, 0x07aa7, 0x07e20, 0x0c11b, 0x0c118, + 0x07aa5, 0x0ad0a, 0x0f389, 0x19ebb, 0x0caad, 0x0fe42, 0x0fe40, 0x16c34, + 0x2b4e5, 0x33d65, 0x16c30, 0x1e7ae, 0x1e25c, 0x18370, 0x1e703, 0x19eba, + 0x16c37, 0x0e234, 0x16c6e, 0x00004, 0x0002a, 0x00061, 0x00075, 0x000cb, + 0x000ff, 0x00190, 0x001eb, 0x001d1, 0x002b9, 0x00307, 0x00339, 0x0033f, + 0x003fb, 0x003b4, 0x0060c, 0x00679, 0x00645, 0x0067d, 0x0078a, 0x007e3, + 0x00749, 0x00ac4, 0x00ad2, 0x00ae3, 0x00c10, 0x00c16, 0x00ad1, 0x00cf4, + 0x00fe2, 0x01586, 0x00e9d, 0x019f1, 0x01664, 0x01e26, 0x01d38, 0x02b4d, + 0x033c5, 0x01fc2, 0x01fc3, 0x01d28, 0x03c1d, 0x0598e, 0x0f094, 0x07aa4, + 0x0ad38, 0x0ac0c, 0x0c11a, 0x079ea, 0x0c881, 0x0fe44, 0x0b635, 0x0ac0d, + 0x0b61e, 0x05987, 0x07121, 0x0f382, 0x0f387, 0x0e237, 0x0fe47, 0x0f383, + 0x0f091, 0x0f385, 0x0e233, 0x182ee, 0x19eb8, 0x1663e, 0x0f093, 0x00014, + 0x00058, 0x00159, 0x00167, 0x00300, 0x003d4, 0x005b5, 0x0079d, 0x0076a, + 0x00b67, 0x00b60, 0x00f05, 0x00cf0, 0x00f17, 0x00e95, 0x01822, 0x01913, + 0x016c2, 0x0182f, 0x01959, 0x01fcb, 0x01e27, 0x01c40, 0x033c7, 0x01e7b, + 0x01c49, 0x02d89, 0x01e23, 0x01660, 0x03f12, 0x02cc6, 0x033e1, 0x05b34, + 0x0609a, 0x06569, 0x07488, 0x07e21, 0x0cf5f, 0x0712c, 0x0389d, 0x067cf, + 0x07f28, 0x1663f, 0x33d67, 0x1663d, 0x1e25d, 0x3c1ab, 0x15c44, 0x16c36, + 0x0001f, 0x000ec, 0x00323, 0x005b2, 0x0079f, 0x00ac2, 0x00f16, 0x00e9e, + 0x01956, 0x01e0f, 0x019ea, 0x01666, 0x02b89, 0x02b02, 0x02d8c, 0x03c1b, + 0x03c19, 0x032b5, 0x03f9c, 0x02ccf, 0x03897, 0x05b35, 0x0ad02, 0x07f29, + 0x06441, 0x03884, 0x07888, 0x0784e, 0x06568, 0x0c1bb, 0x05986, 0x067cc, + 0x0fe49, 0x0fe48, 0x0c1bc, 0x0fe41, 0x18371, 0x1663c, 0x0e231, 0x0711e, + 0x0ad09, 0x0f092, 0x0002d, 0x001db, 0x00781, 0x00c1a, 0x00f55, 0x01580, + 0x01ea8, 0x02d9b, 0x032af, 0x03f16, 0x03c1c, 0x07834, 0x03c45, 0x0389c, + 0x067ce, 0x06445, 0x0c1b9, 0x07889, 0x07f3a, 0x0784f, 0x07f2b, 0x0ad0b, + 0x0f090, 0x0c11d, 0x0e94e, 0x0711f, 0x0e9f1, 0x0f38e, 0x079e9, 0x0ad03, + 0x0f09b, 0x0caae, 0x0fe46, 0x2b4e6, 0x0e9f0, 0x19eb6, 0x67ac1, 0x67ac0, + 0x33d66, 0x0f388, 0x00071, 0x003a0, 0x00ca9, 0x01829, 0x01d39, 0x02b43, + 0x02cc4, 0x06554, 0x0f09a, 0x0b61f, 0x067cd, 0x0711c, 0x0b636, 0x07f2a, + 0x0b634, 0x0c11f, 0x0cf5e, 0x0b61d, 0x0f06b, 0x0caab, 0x0c1be, 0x0e94c, + 0x0f099, 0x182ed, 0x0e94f, 0x0c119, 0x0e232, 0x2b4e4, 0x0f38a, 0x19eb4, + 0x1e25f, 0x0e94d, 0x000b7, 0x00785, 0x016cc, 0x03051, 0x033c4, 0x0656f, + 0x03891, 0x0711d, 0x0caaf, 0x0f097, 0x07489, 0x0f098, 0x0c880, 0x0caaa, + 0x0f386, 0x19eb7, 0x16c6f, 0x0f384, 0x182e8, 0x182e9, 0x0e230, 0x1e700, + 0x33d62, 0x33d63, 0x33d64, 0x16c33, 0x0e216, 0x000fd, 0x00c15, 0x01665, + 0x03c4a, 0x07f3b, 0x07896, 0x0c11c, 0x0e215, 0x16c32, 0x0f38b, 0x0f38d, + 0x182ea, 0x1e701, 0x712df, 0x15c46, 0x00194, 0x00fe0, 0x03f13, 0x0748b, + 0x0f096, 0x0cf80, 0x1e25e, 0xe25bd, 0x33d61, 0x16c31, 0x001f9, 0x01912, + 0x05710, 0x0f3d0, 0x0c1bf, 0x00301, 0x01e24, 0x0ad08, 0x003cd, 0x01c41, + 0x0c1bd, 0x00563, 0x03a52, 0x0f3d1, 0x00570, 0x02cce, 0x0e217, 0x0067b, + 0x0655d, 0x0074b, 0x06447, 0x00c12, 0x074fb, 0x00f08, 0x0b61c, 0x00e22, + 0x0fe43, 0x016c7, 0x01836, 0x019f2, 0x01c43, 0x01d3f, 0x01fcf, 0x02b4c, + 0x0304c, 0x032b6, 0x03a46, 0x05607, 0x03f17, 0x02cc5, 0x0609b, 0x0655c, + 0x07e23, 0x067c1, 0x07f26, 0x07f27, 0x0f095, 0x0e9f3, 0x0cf81, 0x0c11e, + 0x0caac, 0x0f38f, 0x0e9f2, 0x074fa, 0x0e236, 0x0fe45, 0x1c428, 0x0e235, + 0x182ef, 0x19eb5, 0x0f3d6, 0x182ec, 0x16c35, 0x0f38c, 0x2b4e7, 0x15c47, + 0xe25bc, 0x1e702, 0x1c4b6, 0x0e25a, 0x3c1aa, 0x15c45, 0x1c429, 0x19eb9, + 0x1e7af, 0x182eb, 0x1e0d4, 0x3896e, +}; + +static const uint8_t coef4_huffbits[476] = { + 12, 6, 2, 3, 4, 4, 5, 5, + 5, 6, 6, 6, 6, 6, 7, 7, + 7, 7, 7, 8, 8, 8, 8, 8, + 8, 9, 9, 9, 9, 9, 9, 9, + 10, 10, 10, 10, 10, 10, 10, 11, + 10, 11, 11, 11, 11, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 13, 13, 13, 13, 13, 13, + 13, 13, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 16, 16, + 16, 15, 15, 15, 15, 15, 16, 16, + 15, 16, 16, 17, 16, 16, 16, 17, + 18, 18, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 4, 6, 7, 8, 8, + 8, 9, 9, 10, 10, 10, 10, 10, + 10, 11, 11, 11, 11, 11, 11, 11, + 12, 12, 12, 12, 12, 12, 12, 12, + 12, 13, 13, 13, 14, 13, 14, 14, + 14, 13, 13, 14, 14, 16, 16, 15, + 16, 16, 16, 15, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 17, 16, 16, + 16, 16, 17, 17, 17, 18, 16, 5, + 8, 9, 10, 10, 10, 11, 11, 12, + 12, 12, 12, 12, 12, 13, 13, 13, + 13, 13, 13, 13, 13, 14, 14, 13, + 14, 14, 13, 14, 14, 15, 14, 15, + 15, 15, 16, 15, 16, 16, 15, 15, + 15, 18, 18, 18, 17, 18, 17, 17, + 6, 9, 10, 11, 11, 12, 12, 13, + 13, 13, 13, 14, 14, 14, 14, 14, + 14, 14, 14, 15, 15, 15, 16, 15, + 15, 15, 15, 15, 15, 16, 16, 15, + 16, 16, 16, 16, 17, 18, 17, 16, + 16, 16, 7, 10, 11, 12, 12, 13, + 13, 14, 14, 14, 14, 15, 14, 15, + 15, 15, 16, 15, 15, 15, 15, 16, + 16, 16, 17, 16, 17, 16, 15, 16, + 16, 16, 16, 18, 17, 17, 19, 19, + 18, 16, 7, 11, 12, 13, 14, 14, + 15, 15, 16, 16, 15, 16, 16, 15, + 16, 16, 16, 16, 16, 16, 16, 17, + 16, 17, 17, 16, 17, 18, 16, 17, + 17, 17, 8, 11, 13, 14, 14, 15, + 15, 16, 16, 16, 16, 16, 16, 16, + 16, 17, 17, 16, 17, 17, 17, 17, + 18, 18, 18, 17, 17, 8, 12, 14, + 14, 15, 15, 16, 17, 17, 16, 16, + 17, 17, 20, 17, 9, 12, 14, 16, + 16, 16, 17, 21, 18, 17, 9, 13, + 15, 16, 16, 10, 13, 16, 10, 14, + 16, 11, 15, 16, 11, 15, 17, 11, + 15, 12, 15, 12, 16, 12, 16, 13, + 16, 13, 13, 13, 14, 14, 13, 14, + 14, 14, 15, 15, 14, 15, 15, 15, + 15, 15, 15, 15, 16, 17, 16, 16, + 16, 16, 17, 16, 17, 16, 18, 17, + 17, 17, 16, 17, 17, 16, 18, 17, + 21, 17, 18, 17, 18, 17, 18, 17, + 17, 17, 17, 19, +}; + +static const uint32_t coef5_huffcodes[435] = { + 0x00347, 0x0000b, 0x00001, 0x00001, 0x0000c, 0x00004, 0x00010, 0x00015, + 0x0001f, 0x0000b, 0x00023, 0x00026, 0x00029, 0x00035, 0x00037, 0x00001, + 0x00015, 0x0001a, 0x0001d, 0x0001c, 0x0001e, 0x0004e, 0x00049, 0x00051, + 0x00078, 0x00004, 0x00000, 0x00008, 0x0000d, 0x0007b, 0x00005, 0x00032, + 0x00095, 0x00091, 0x00096, 0x000a1, 0x000d9, 0x00003, 0x00019, 0x00061, + 0x00066, 0x00060, 0x00017, 0x0000e, 0x00063, 0x001a0, 0x001b7, 0x001e6, + 0x001e7, 0x001b6, 0x00018, 0x001e8, 0x00038, 0x00031, 0x00005, 0x0003d, + 0x00027, 0x001ea, 0x0001a, 0x000c5, 0x000f9, 0x000ff, 0x000db, 0x00250, + 0x000fc, 0x0025c, 0x00008, 0x00075, 0x003d7, 0x003d3, 0x001b0, 0x0007c, + 0x003ca, 0x00036, 0x00189, 0x004a6, 0x004a2, 0x004fb, 0x000c0, 0x0007f, + 0x0009a, 0x00311, 0x0006e, 0x0009b, 0x0068c, 0x006c0, 0x00484, 0x00012, + 0x000c3, 0x0094f, 0x00979, 0x009f9, 0x00d09, 0x00da6, 0x00da8, 0x00901, + 0x000c1, 0x00373, 0x00d08, 0x009fa, 0x00d8b, 0x00d85, 0x00d86, 0x000df, + 0x006e2, 0x000ce, 0x00f24, 0x009fe, 0x001f7, 0x007c1, 0x000cf, 0x009fc, + 0x009ff, 0x00d89, 0x00da9, 0x009fd, 0x001f8, 0x01a36, 0x0128c, 0x0129d, + 0x01a37, 0x00196, 0x003ea, 0x00f8b, 0x00d93, 0x01e45, 0x01e58, 0x01e4b, + 0x01e59, 0x013f1, 0x00309, 0x00265, 0x00308, 0x0243a, 0x027e1, 0x00f89, + 0x00324, 0x03cbc, 0x03c86, 0x03695, 0x0243c, 0x0243b, 0x0243e, 0x01e4a, + 0x003a5, 0x03468, 0x03428, 0x03c84, 0x027e0, 0x025e2, 0x01880, 0x00197, + 0x00325, 0x03cb7, 0x0791e, 0x007ec, 0x06c75, 0x004c8, 0x04bc7, 0x004c6, + 0x00983, 0x0481e, 0x01b53, 0x0251b, 0x01b58, 0x00984, 0x04fa8, 0x03cbb, + 0x00f8a, 0x00322, 0x0346a, 0x0243d, 0x00326, 0x03469, 0x0481f, 0x0481d, + 0x00746, 0x09032, 0x01b50, 0x01d13, 0x0d8e4, 0x0481b, 0x06c74, 0x0796b, + 0x07969, 0x00985, 0x0d8e3, 0x00986, 0x00fa2, 0x01301, 0x06c7c, 0x00987, + 0x03cb8, 0x0f4af, 0x00e88, 0x1b1c0, 0x00fce, 0x033eb, 0x03f6a, 0x03f69, + 0x00fcf, 0x0791f, 0x004c9, 0x04871, 0x00fcd, 0x00982, 0x00fcc, 0x00fa3, + 0x01d12, 0x0796c, 0x01b47, 0x00321, 0x0796a, 0x0d8e2, 0x04872, 0x04873, + 0x0000e, 0x00014, 0x0000a, 0x000a0, 0x00012, 0x0007d, 0x001a2, 0x0003b, + 0x0025f, 0x000dd, 0x0027c, 0x00343, 0x00368, 0x0036b, 0x0003e, 0x001fa, + 0x00485, 0x001b3, 0x0007f, 0x001b1, 0x0019e, 0x004ba, 0x007ad, 0x00339, + 0x00066, 0x007a4, 0x00793, 0x006c6, 0x0007e, 0x000f1, 0x00372, 0x009fb, + 0x00d83, 0x00d8a, 0x00947, 0x009f4, 0x001d0, 0x01b09, 0x01b4b, 0x007ec, + 0x003e1, 0x000ca, 0x003ec, 0x02539, 0x04fa9, 0x01b57, 0x03429, 0x03d2a, + 0x00d97, 0x003a7, 0x00dc0, 0x00d96, 0x00dc1, 0x007eb, 0x03cba, 0x00c43, + 0x00c41, 0x01b52, 0x007ef, 0x00323, 0x03cb9, 0x03c83, 0x007d0, 0x007ed, + 0x06c7f, 0x09033, 0x03f6c, 0x36383, 0x1e95d, 0x06c78, 0x00747, 0x01b51, + 0x00022, 0x00016, 0x00039, 0x00252, 0x00079, 0x00486, 0x00338, 0x00369, + 0x00d88, 0x00026, 0x00d87, 0x00f4b, 0x00d82, 0x00027, 0x001e1, 0x01a15, + 0x007c7, 0x012f0, 0x001e0, 0x006d0, 0x01a16, 0x01e44, 0x01e5f, 0x03690, + 0x00d90, 0x00c42, 0x00daf, 0x00d92, 0x00f80, 0x00cfb, 0x0342f, 0x0487f, + 0x01b46, 0x07968, 0x00d95, 0x00d91, 0x01b55, 0x03f68, 0x04bc6, 0x03cbd, + 0x00f81, 0x00320, 0x00069, 0x000fe, 0x006d5, 0x0033f, 0x000de, 0x007c6, + 0x01e40, 0x00d94, 0x00f88, 0x03c8e, 0x03694, 0x00dae, 0x00dad, 0x00267, + 0x003a6, 0x00327, 0x0487e, 0x007ee, 0x00749, 0x004c7, 0x03692, 0x01b56, + 0x00fd1, 0x07a56, 0x06c77, 0x09031, 0x00748, 0x06c7a, 0x0796d, 0x033ea, + 0x06c76, 0x00fd0, 0x36382, 0x1e417, 0x00745, 0x04faf, 0x0d8e1, 0x03f6b, + 0x1e95c, 0x04fad, 0x0009e, 0x004bd, 0x0067c, 0x01b08, 0x003eb, 0x01b45, + 0x03691, 0x0d8e5, 0x07904, 0x00981, 0x007ea, 0x019f4, 0x06c7d, 0x04fab, + 0x04fac, 0x06c7e, 0x01300, 0x06c7b, 0x0006f, 0x003f7, 0x03c85, 0x004c4, + 0x0001e, 0x006e1, 0x03693, 0x01b44, 0x00241, 0x01e46, 0x0019d, 0x00266, + 0x004bb, 0x02538, 0x007ac, 0x01b54, 0x00902, 0x04870, 0x00da7, 0x00900, + 0x00185, 0x06c79, 0x006e3, 0x003e9, 0x01e94, 0x003ed, 0x003f2, 0x0342e, + 0x0346b, 0x0251a, 0x004c5, 0x01881, 0x0481c, 0x01b59, 0x03c87, 0x04fae, + 0x007e9, 0x03f6d, 0x0f20a, 0x09030, 0x04faa, 0x0d8e6, 0x03f6f, 0x0481a, + 0x03f6e, 0x1e416, 0x0d8e7, +}; + +static const uint8_t coef5_huffbits[435] = { + 10, 4, 2, 4, 4, 5, 5, 5, + 5, 6, 6, 6, 6, 6, 6, 7, + 7, 7, 7, 7, 7, 7, 7, 7, + 7, 8, 8, 8, 8, 7, 8, 8, + 8, 8, 8, 8, 8, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 9, 9, + 9, 9, 10, 9, 10, 10, 10, 10, + 10, 9, 10, 10, 10, 10, 10, 10, + 10, 10, 11, 11, 10, 10, 11, 11, + 10, 11, 11, 11, 11, 11, 12, 12, + 12, 12, 12, 12, 11, 11, 11, 12, + 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 13, + 13, 13, 12, 12, 13, 13, 13, 12, + 12, 12, 12, 12, 13, 13, 13, 13, + 13, 14, 14, 14, 14, 13, 13, 13, + 13, 13, 14, 14, 14, 14, 14, 14, + 15, 14, 14, 14, 14, 14, 14, 13, + 14, 14, 14, 14, 14, 14, 15, 14, + 15, 14, 15, 15, 15, 15, 15, 15, + 16, 15, 15, 14, 15, 16, 15, 14, + 14, 15, 14, 14, 15, 14, 15, 15, + 15, 16, 15, 17, 16, 15, 15, 15, + 15, 16, 16, 16, 16, 17, 15, 16, + 14, 16, 16, 17, 16, 16, 16, 16, + 16, 15, 15, 15, 16, 16, 16, 16, + 17, 15, 15, 15, 15, 16, 15, 15, + 4, 7, 8, 8, 9, 9, 9, 10, + 10, 10, 10, 10, 10, 10, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 12, + 12, 11, 11, 11, 12, 12, 12, 12, + 12, 12, 12, 12, 13, 13, 13, 13, + 12, 13, 14, 14, 15, 15, 14, 14, + 14, 14, 14, 14, 14, 15, 14, 14, + 14, 15, 15, 15, 14, 14, 15, 15, + 15, 16, 16, 18, 17, 15, 15, 15, + 6, 9, 10, 10, 11, 11, 12, 12, + 12, 13, 12, 12, 12, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 14, + 14, 14, 14, 14, 14, 14, 14, 15, + 15, 15, 14, 14, 15, 16, 15, 14, + 14, 15, 7, 10, 11, 12, 13, 13, + 13, 14, 14, 14, 14, 14, 14, 14, + 14, 15, 15, 15, 15, 15, 14, 15, + 16, 15, 15, 16, 15, 15, 15, 16, + 15, 16, 18, 17, 15, 15, 16, 16, + 17, 15, 8, 11, 13, 13, 14, 15, + 14, 16, 15, 16, 15, 15, 15, 15, + 15, 15, 17, 15, 9, 12, 14, 15, + 10, 13, 14, 15, 10, 13, 11, 14, + 11, 14, 11, 15, 12, 15, 12, 12, + 13, 15, 13, 14, 13, 14, 14, 14, + 14, 14, 15, 15, 15, 15, 14, 15, + 15, 16, 16, 16, 15, 16, 16, 15, + 16, 17, 16, +}; + +static const uint16_t levels0[60] = { + 317, 92, 62, 60, 19, 17, 10, 7, + 6, 5, 5, 3, 3, 3, 2, 2, + 2, 2, 2, 2, 2, 1, 2, 2, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, +}; + +static const uint16_t levels1[40] = { + 311, 91, 61, 28, 10, 6, 5, 2, + 2, 2, 2, 2, 2, 2, 2, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, +}; + +static const uint16_t levels2[340] = { + 181, 110, 78, 63, 61, 62, 60, 61, + 33, 41, 41, 19, 17, 19, 12, 11, + 9, 11, 10, 6, 8, 7, 6, 4, + 5, 5, 4, 4, 3, 4, 3, 5, + 3, 4, 3, 3, 3, 3, 3, 3, + 2, 2, 4, 2, 3, 2, 3, 3, + 2, 2, 2, 2, 2, 2, 2, 2, + 3, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 1, 2, 1, 2, 2, + 2, 2, 1, 2, 1, 1, 1, 2, + 2, 1, 2, 1, 2, 2, 2, 2, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, +}; + +static const uint16_t levels3[180] = { + 351, 122, 76, 61, 41, 42, 24, 30, + 22, 19, 11, 9, 10, 8, 5, 5, + 4, 5, 5, 3, 3, 3, 3, 3, + 3, 3, 2, 2, 3, 2, 2, 2, + 3, 3, 2, 2, 2, 3, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 1, + 2, 2, 1, 2, 1, 2, 2, 2, + 2, 2, 2, 1, 2, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 2, + 2, 1, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, +}; + +static const uint16_t levels4[70] = { + 113, 68, 49, 42, 40, 32, 27, 15, + 10, 5, 3, 3, 3, 3, 2, 2, + 2, 2, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, +}; + +static const uint16_t levels5[40] = { + 214, 72, 42, 40, 18, 4, 4, 2, + 2, 2, 2, 2, 1, 1, 2, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, +}; + +static const CoefVLCTable coef_vlcs[6] = { + { sizeof(coef0_huffbits), sizeof(levels0) / 2, coef0_huffcodes, coef0_huffbits, levels0, }, + { sizeof(coef1_huffbits), sizeof(levels1) / 2, coef1_huffcodes, coef1_huffbits, levels1, }, + { sizeof(coef2_huffbits), sizeof(levels2) / 2, coef2_huffcodes, coef2_huffbits, levels2, }, + { sizeof(coef3_huffbits), sizeof(levels3) / 2, coef3_huffcodes, coef3_huffbits, levels3, }, + { sizeof(coef4_huffbits), sizeof(levels4) / 2, coef4_huffcodes, coef4_huffbits, levels4, }, + { sizeof(coef5_huffbits), sizeof(levels5) / 2, coef5_huffcodes, coef5_huffbits, levels5, }, +}; + +#endif /* AVCODEC_WMADATA_H */ diff --git a/include/libavcodec/wmaprodata.h b/include/libavcodec/wmaprodata.h new file mode 100644 index 0000000..057ce1d --- /dev/null +++ b/include/libavcodec/wmaprodata.h @@ -0,0 +1,458 @@ +/* + * WMA 9/3/PRO compatible decoder + * Copyright (c) 2007 Baptiste Coudurier, Benjamin Larsson, Ulion + * Copyright (c) 2008 - 2009 Sascha Sommer + * + * 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 + */ + +/** + * @file + * @brief tables for wmapro decoding + */ + +#ifndef AVCODEC_WMAPRODATA_H +#define AVCODEC_WMAPRODATA_H + +#include +#include + +/** + * @brief frequencies to divide the frequency spectrum into scale factor bands + */ +static const uint16_t critical_freq[] = { + 100, 200, 300, 400, 510, 630, 770, + 920, 1080, 1270, 1480, 1720, 2000, 2320, + 2700, 3150, 3700, 4400, 5300, 6400, 7700, + 9500, 12000, 15500, 20675, 28575, 41375, 63875, +}; + + +/** + * @name Huffman tables for DPCM-coded scale factors + * @{ + */ +#define HUFF_SCALE_SIZE 121 +#define HUFF_SCALE_MAXBITS 19 +static const uint8_t scale_table[HUFF_SCALE_SIZE][2] = { + { 58, 5 }, { 64, 6 }, { 66, 7 }, { 65, 7 }, { 62, 5 }, + { 63, 6 }, { 68, 9 }, { 69, 10 }, { 54, 15 }, { 19, 19 }, + { 20, 19 }, { 21, 19 }, { 22, 19 }, { 23, 19 }, { 24, 19 }, + { 25, 19 }, { 26, 19 }, { 27, 19 }, { 28, 19 }, { 29, 19 }, + { 30, 19 }, { 31, 19 }, { 32, 19 }, { 33, 19 }, { 34, 19 }, + { 17, 19 }, { 36, 19 }, { 37, 19 }, { 38, 19 }, { 39, 19 }, + { 40, 19 }, { 41, 19 }, { 42, 19 }, { 43, 19 }, { 44, 19 }, + { 45, 19 }, { 46, 19 }, { 47, 19 }, { 48, 19 }, { 49, 19 }, + { 50, 19 }, { 51, 19 }, { 52, 19 }, { 15, 19 }, { 16, 19 }, + { 14, 19 }, { 13, 19 }, { 12, 19 }, { 11, 19 }, { 10, 19 }, + { 0, 19 }, { 9, 19 }, { 8, 19 }, { 7, 19 }, { 6, 19 }, + { 5, 19 }, { 4, 19 }, { 55, 13 }, { 70, 13 }, { 3, 19 }, + { 2, 19 }, { 1, 19 }, { 35, 19 }, { 71, 19 }, { 72, 19 }, + { 73, 19 }, { 74, 19 }, { 75, 19 }, { 76, 19 }, { 77, 19 }, + { 78, 19 }, { 79, 19 }, { 80, 19 }, { 81, 19 }, { 82, 19 }, + { 83, 19 }, { 84, 19 }, { 85, 19 }, { 86, 19 }, { 87, 19 }, + { 88, 19 }, { 89, 19 }, { 90, 19 }, { 91, 19 }, { 92, 19 }, + { 93, 19 }, { 94, 19 }, { 95, 19 }, { 96, 19 }, { 97, 19 }, + { 98, 19 }, { 99, 19 }, { 100, 19 }, { 101, 19 }, { 102, 19 }, + { 103, 19 }, { 104, 19 }, { 105, 19 }, { 106, 19 }, { 107, 19 }, + { 108, 19 }, { 109, 19 }, { 110, 19 }, { 111, 19 }, { 112, 19 }, + { 113, 19 }, { 114, 19 }, { 115, 19 }, { 116, 19 }, { 117, 19 }, + { 118, 19 }, { 119, 19 }, { 120, 19 }, { 18, 18 }, { 53, 16 }, + { 56, 11 }, { 57, 8 }, { 67, 7 }, { 61, 3 }, { 59, 2 }, + { 60, 1 }, +}; +/** @} */ + + +/** + * @name Huffman, run and level tables for runlevel-coded scale factors + * @{ + */ +#define HUFF_SCALE_RL_SIZE 120 +#define HUFF_SCALE_RL_MAXBITS 21 +static const uint8_t scale_rl_table[HUFF_SCALE_RL_SIZE][2] = { + { 103, 7 }, { 80, 11 }, { 60, 11 }, { 18, 10 }, { 56, 10 }, + { 21, 12 }, { 90, 12 }, { 58, 11 }, { 27, 11 }, { 69, 12 }, + { 84, 15 }, { 48, 15 }, { 86, 14 }, { 47, 13 }, { 19, 10 }, + { 32, 9 }, { 78, 6 }, { 5, 5 }, { 28, 4 }, { 53, 5 }, + { 9, 7 }, { 31, 8 }, { 38, 8 }, { 10, 7 }, { 88, 11 }, + { 25, 12 }, { 105, 12 }, { 118, 11 }, { 23, 12 }, { 82, 14 }, + { 98, 16 }, { 110, 16 }, { 108, 15 }, { 93, 13 }, { 68, 10 }, + { 72, 12 }, { 97, 12 }, { 81, 12 }, { 42, 12 }, { 64, 8 }, + { 4, 4 }, { 1, 2 }, { 7, 6 }, { 14, 7 }, { 0, 9 }, + { 55, 9 }, { 61, 9 }, { 117, 10 }, { 24, 12 }, { 44, 12 }, + { 67, 12 }, { 70, 16 }, { 99, 18 }, { 96, 21 }, { 95, 21 }, + { 2, 21 }, { 77, 21 }, { 52, 21 }, { 111, 21 }, { 102, 20 }, + { 101, 17 }, { 46, 15 }, { 73, 15 }, { 109, 15 }, { 51, 14 }, + { 92, 14 }, { 30, 7 }, { 11, 7 }, { 66, 7 }, { 15, 8 }, + { 16, 8 }, { 116, 9 }, { 65, 9 }, { 57, 10 }, { 59, 10 }, + { 115, 9 }, { 12, 7 }, { 35, 9 }, { 17, 9 }, { 41, 9 }, + { 20, 11 }, { 91, 11 }, { 26, 12 }, { 75, 15 }, { 45, 15 }, + { 107, 14 }, { 83, 14 }, { 100, 15 }, { 89, 15 }, { 43, 11 }, + { 62, 9 }, { 37, 9 }, { 104, 8 }, { 6, 5 }, { 39, 8 }, + { 40, 9 }, { 34, 9 }, { 79, 7 }, { 8, 6 }, { 63, 6 }, + { 87, 12 }, { 94, 14 }, { 49, 14 }, { 50, 13 }, { 22, 11 }, + { 119, 10 }, { 33, 9 }, { 36, 9 }, { 113, 11 }, { 106, 12 }, + { 112, 13 }, { 71, 15 }, { 85, 15 }, { 74, 14 }, { 76, 10 }, + { 114, 7 }, { 29, 5 }, { 54, 6 }, { 13, 6 }, { 3, 2 }, +}; + + +static const uint8_t scale_rl_run[HUFF_SCALE_RL_SIZE] = { + 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 0, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 0, 1, 0, 1, 0, 1, +}; + +static const uint8_t scale_rl_level[HUFF_SCALE_RL_SIZE] = { + 0, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 5, 5, 5, 5, 5, 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, 6, 6, 6, 6, + 7, 7, 8, 8, 9, 9, +}; +/** @} */ + + +/** + * @name Huffman, run and level codes for runlevel-coded coefficients + * @{ + */ +#define HUFF_COEF0_SIZE 272 +#define HUFF_COEF0_MAXBITS 21 +static const uint8_t coef0_lens[HUFF_COEF0_SIZE] = { + 2, 9, 14, 14, 13, 12, 13, 14, 15, 15, 12, 10, 10, 10, 13, 14, 15, 15, 12, + 11, 13, 14, 14, 13, 15, 15, 14, 12, 12, 8, 10, 10, 15, 15, 14, 13, 14, 14, + 13, 15, 20, 20, 19, 21, 21, 20, 19, 17, 17, 18, 18, 15, 15, 13, 12, 14, 15, + 15, 14, 15, 15, 12, 11, 6, 7, 8, 9, 13, 13, 13, 14, 14, 11, 10, 7, 8, + 14, 14, 14, 14, 12, 13, 13, 12, 12, 12, 11, 9, 13, 14, 14, 12, 11, 11, 11, + 9, 8, 7, 14, 15, 15, 14, 14, 12, 13, 15, 16, 17, 17, 14, 12, 12, 12, 15, + 15, 14, 14, 14, 13, 13, 9, 9, 11, 11, 10, 7, 6, 13, 15, 15, 14, 14, 14, + 13, 14, 15, 15, 13, 14, 14, 14, 14, 10, 9, 10, 10, 11, 11, 10, 8, 9, 13, + 14, 14, 12, 11, 14, 15, 15, 13, 12, 14, 14, 14, 14, 13, 14, 14, 3, 5, 8, + 10, 10, 15, 15, 14, 14, 16, 16, 15, 12, 11, 11, 11, 7, 8, 8, 9, 12, 13, + 13, 12, 14, 15, 15, 13, 10, 11, 11, 13, 14, 14, 13, 14, 14, 11, 10, 13, 15, + 15, 14, 12, 11, 4, 6, 6, 8, 12, 12, 12, 13, 13, 12, 13, 13, 14, 14, 13, + 13, 13, 9, 7, 9, 11, 14, 14, 13, 14, 14, 13, 10, 8, 7, 5, 9, 12, 13, + 14, 15, 15, 12, 12, 10, 14, 14, 13, 12, 13, 14, 14, 12, 13, 13, 12, 12, 12, + 9, 7, 6, 3, 4, 4, +}; + +static const uint16_t coef0_syms[HUFF_COEF0_SIZE] = { + 2, 25, 111, 94, 69, 58, 87, 93, 136, 135, 59, 37, 34, 36, 82, + 182, 120, 138, 195, 45, 168, 216, 178, 86, 140, 219, 186, 162, 239, 18, + 156, 35, 127, 236, 109, 85, 180, 253, 88, 147, 268, 264, 256, 266, 270, + 262, 260, 248, 246, 252, 258, 137, 189, 230, 64, 179, 146, 208, 101, 118, + 238, 163, 46, 9, 153, 0, 26, 247, 169, 76, 202, 131, 194, 38, 13, + 19, 132, 106, 191, 97, 65, 198, 77, 62, 66, 164, 48, 27, 81, 183, + 102, 60, 47, 49, 159, 227, 20, 14, 112, 263, 144, 217, 104, 63, 79, + 209, 269, 250, 254, 203, 241, 196, 61, 220, 148, 124, 185, 100, 80, 78, + 193, 28, 50, 235, 41, 1, 10, 171, 226, 150, 103, 114, 115, 170, 105, + 211, 149, 249, 108, 188, 107, 255, 231, 155, 42, 40, 55, 160, 39, 21, + 29, 215, 234, 184, 228, 51, 116, 142, 145, 172, 165, 181, 130, 113, 117, + 89, 128, 204, 3, 7, 154, 157, 43, 141, 265, 133, 225, 271, 244, 221, + 74, 54, 56, 52, 15, 222, 22, 30, 83, 199, 173, 73, 123, 210, 143, + 175, 44, 53, 237, 174, 139, 134, 110, 218, 129, 161, 213, 177, 267, 151, + 125, 67, 223, 5, 11, 192, 23, 214, 243, 166, 200, 176, 68, 224, 187, + 257, 261, 232, 96, 251, 31, 16, 32, 57, 207, 121, 91, 126, 119, 99, + 158, 24, 212, 8, 33, 70, 92, 205, 240, 242, 75, 197, 233, 259, 190, + 98, 71, 201, 122, 206, 72, 90, 95, 84, 167, 245, 229, 17, 12, 4, + 152, 6, +}; + + +#define HUFF_COEF1_SIZE 244 +#define HUFF_COEF1_MAXBITS 22 +static const uint8_t coef1_table[HUFF_COEF1_SIZE][2] = { + { 2, 2 }, { 3, 3 }, { 102, 3 }, { 4, 4 }, { 148, 6 }, + { 134, 9 }, { 171, 10 }, { 18, 10 }, { 11, 8 }, { 159, 8 }, + { 14, 9 }, { 156, 14 }, { 235, 15 }, { 61, 15 }, { 38, 13 }, + { 153, 13 }, { 48, 14 }, { 49, 14 }, { 23, 11 }, { 203, 13 }, + { 208, 19 }, { 204, 19 }, { 129, 18 }, { 94, 17 }, { 87, 16 }, + { 62, 15 }, { 174, 15 }, { 147, 15 }, { 29, 12 }, { 191, 12 }, + { 64, 15 }, { 65, 15 }, { 146, 14 }, { 164, 13 }, { 142, 5 }, + { 132, 4 }, { 103, 5 }, { 154, 7 }, { 165, 9 }, { 181, 11 }, + { 109, 12 }, { 30, 12 }, { 86, 16 }, { 92, 16 }, { 239, 15 }, + { 138, 14 }, { 39, 13 }, { 50, 14 }, { 115, 15 }, { 238, 21 }, + { 228, 21 }, { 236, 21 }, { 222, 21 }, { 216, 20 }, { 226, 20 }, + { 196, 18 }, { 192, 17 }, { 120, 16 }, { 221, 14 }, { 51, 14 }, + { 24, 11 }, { 143, 8 }, { 7, 6 }, { 9, 7 }, { 152, 10 }, + { 136, 12 }, { 160, 12 }, { 241, 15 }, { 66, 15 }, { 168, 14 }, + { 219, 14 }, { 113, 14 }, { 193, 12 }, { 19, 10 }, { 173, 10 }, + { 105, 8 }, { 149, 9 }, { 15, 9 }, { 205, 13 }, { 207, 13 }, + { 125, 17 }, { 190, 17 }, { 182, 16 }, { 68, 15 }, { 70, 15 }, + { 67, 15 }, { 137, 13 }, { 31, 12 }, { 223, 14 }, { 116, 15 }, + { 210, 19 }, { 220, 19 }, { 198, 18 }, { 126, 17 }, { 88, 16 }, + { 41, 13 }, { 25, 11 }, { 40, 13 }, { 73, 15 }, { 243, 15 }, + { 53, 14 }, { 195, 12 }, { 183, 11 }, { 225, 14 }, { 52, 14 }, + { 71, 15 }, { 121, 16 }, { 89, 16 }, { 170, 14 }, { 55, 14 }, + { 69, 15 }, { 83, 15 }, { 209, 13 }, { 108, 11 }, { 32, 12 }, + { 54, 14 }, { 122, 16 }, { 184, 16 }, { 176, 15 }, { 42, 13 }, + { 12, 8 }, { 161, 8 }, { 6, 5 }, { 167, 9 }, { 106, 9 }, + { 20, 10 }, { 145, 12 }, { 111, 13 }, { 43, 13 }, { 26, 11 }, + { 175, 10 }, { 107, 10 }, { 34, 12 }, { 33, 12 }, { 197, 12 }, + { 74, 15 }, { 128, 17 }, { 232, 20 }, { 212, 20 }, { 224, 19 }, + { 202, 18 }, { 90, 16 }, { 57, 14 }, { 227, 14 }, { 97, 16 }, + { 93, 16 }, { 140, 15 }, { 185, 11 }, { 27, 11 }, { 16, 9 }, + { 158, 11 }, { 211, 13 }, { 56, 14 }, { 117, 15 }, { 72, 15 }, + { 166, 13 }, { 91, 16 }, { 95, 16 }, { 80, 15 }, { 101, 16 }, + { 194, 17 }, { 127, 17 }, { 82, 15 }, { 21, 10 }, { 144, 10 }, + { 177, 10 }, { 151, 6 }, { 10, 7 }, { 157, 7 }, { 8, 6 }, + { 5, 4 }, { 13, 8 }, { 0, 9 }, { 213, 13 }, { 46, 13 }, + { 199, 12 }, { 35, 12 }, { 162, 12 }, { 135, 10 }, { 169, 9 }, + { 45, 13 }, { 59, 14 }, { 114, 14 }, { 44, 13 }, { 188, 16 }, + { 186, 16 }, { 75, 15 }, { 79, 15 }, { 118, 15 }, { 187, 11 }, + { 112, 13 }, { 139, 14 }, { 178, 15 }, { 81, 15 }, { 110, 12 }, + { 28, 11 }, { 163, 8 }, { 133, 6 }, { 104, 6 }, { 17, 9 }, + { 22, 10 }, { 229, 14 }, { 172, 14 }, { 217, 13 }, { 201, 12 }, + { 36, 12 }, { 218, 20 }, { 242, 22 }, { 240, 22 }, { 234, 21 }, + { 230, 19 }, { 206, 18 }, { 200, 18 }, { 214, 18 }, { 130, 17 }, + { 131, 17 }, { 141, 15 }, { 84, 15 }, { 76, 15 }, { 215, 13 }, + { 58, 14 }, { 231, 14 }, { 233, 14 }, { 180, 15 }, { 77, 15 }, + { 37, 12 }, { 189, 11 }, { 179, 10 }, { 155, 10 }, { 47, 13 }, + { 96, 16 }, { 99, 16 }, { 119, 15 }, { 63, 14 }, { 237, 14 }, + { 78, 15 }, { 85, 15 }, { 60, 14 }, { 98, 16 }, { 100, 16 }, + { 124, 16 }, { 123, 16 }, { 150, 11 }, { 1, 7 }, +}; + + +static const uint16_t coef0_run[HUFF_COEF0_SIZE] = { + 0, 0, 0, 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, 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, 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, 0, 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, 0, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, + 2, 3, 4, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, +}; + +static const float coef0_level[HUFF_COEF0_SIZE] = { + 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, + 5, 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, +}; + + +static const uint16_t coef1_run[HUFF_COEF1_SIZE] = { + 0, 0, 0, 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, 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, 0, 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, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, + 2, 3, 4, 5, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, +}; + +static const float coef1_level[HUFF_COEF1_SIZE] = { + 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, + 4, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 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, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, + 37, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, + 46, 47, 47, 48, 48, 49, 49, 50, 51, 52, +}; +/** @} */ + + +/** + * @name Huffman and vector lookup tables for vector-coded coefficients + * @{ + */ +#define HUFF_VEC4_SIZE 127 +#define HUFF_VEC4_MAXBITS 14 +static const uint8_t vec4_lens[HUFF_VEC4_SIZE] = { + 1, 6, 8, 10, 10, 10, 10, 8, 8, 10, 10, 9, 8, 8, 9, 12, 12, 11, + 12, 12, 11, 9, 9, 8, 8, 9, 9, 8, 8, 9, 9, 12, 12, 12, 14, 14, + 13, 11, 11, 9, 8, 9, 9, 11, 11, 10, 9, 8, 6, 6, 6, 6, 6, 6, + 11, 11, 10, 11, 11, 10, 10, 11, 11, 9, 7, 6, 7, 7, 6, 6, 6, 5, + 7, 11, 11, 10, 9, 8, 6, 9, 9, 10, 10, 9, 8, 8, 6, 6, 6, 8, + 8, 9, 12, 12, 11, 10, 8, 8, 8, 10, 10, 10, 10, 9, 9, 8, 10, 11, + 11, 9, 8, 8, 8, 9, 9, 10, 11, 12, 12, 9, 9, 9, 8, 8, 7, 7, + 7, +}; + +/* The entry in the following table with symbol zero indicates + * that four further entries are coded explicitly; all other + * entries encode four numbers in the 0..15 range via + * the four nibbles of (symbol - 1). */ +static const uint16_t vec4_syms[HUFF_VEC4_SIZE] = { + 0, 4370, 275, 8195, 4146, 12545, 8225, 290, 4625, 515, + 20, 8706, 8210, 4355, 4131, 16385, 5121, 8961, 321, 1041, + 51, 4641, 546, 4610, 530, 513, 8451, 4385, 4130, 33, + 8211, 5, 66, 4161, 1281, 81, 6, 801, 8196, 8481, + 8449, 4611, 531, 561, 769, 12290, 8226, 19, 4097, 2, + 4369, 274, 4354, 4114, 12291, 16641, 12305, 49, 12321, 260, + 4100, 516, 21, 12546, 8466, 4353, 4371, 4626, 257, 18, + 17, 1, 4386, 8241, 771, 4865, 8705, 8194, 4098, 12561, + 276, 50, 785, 4116, 8209, 4099, 273, 4113, 258, 259, + 4609, 35, 1026, 1025, 16401, 305, 34, 529, 289, 770, + 12289, 4, 4145, 4356, 12306, 8193, 12801, 261, 16386, 4881, + 3, 514, 4129, 545, 306, 36, 4101, 65, 20481, 786, + 4401, 4866, 8721, 291, 8450, 8465, 4115, +}; + + +#define HUFF_VEC2_SIZE 137 +#define HUFF_VEC2_MAXBITS 12 +/* The entry in the following table with symbol zero indicates + * that two further entries are coded explicitly; all other + * entries encode two numbers in the 0..15 range via + * (symbol - 1) & 0xF and (symbol - 1) >> 4. */ +static const uint8_t vec2_table[HUFF_VEC2_SIZE][2] = { + { 19, 5 }, { 165, 10 }, { 211, 11 }, { 46, 11 }, { 75, 10 }, + { 177, 11 }, { 12, 11 }, { 86, 8 }, { 83, 7 }, { 38, 7 }, + { 133, 9 }, { 178, 10 }, { 28, 10 }, { 104, 9 }, { 73, 9 }, + { 35, 5 }, { 52, 6 }, { 113, 9 }, { 8, 9 }, { 101, 8 }, + { 69, 7 }, { 0, 3 }, { 71, 8 }, { 119, 9 }, { 91, 10 }, + { 179, 10 }, { 114, 8 }, { 166, 10 }, { 10, 10 }, { 44, 10 }, + { 145, 10 }, { 66, 6 }, { 21, 6 }, { 24, 8 }, { 146, 9 }, + { 26, 9 }, { 65, 7 }, { 5, 7 }, { 226, 11 }, { 225, 12 }, + { 15, 12 }, { 180, 10 }, { 147, 9 }, { 115, 8 }, { 40, 8 }, + { 89, 9 }, { 134, 9 }, { 84, 7 }, { 54, 7 }, { 42, 9 }, + { 60, 10 }, { 31, 11 }, { 193, 11 }, { 181, 10 }, { 76, 10 }, + { 148, 9 }, { 37, 6 }, { 67, 6 }, { 33, 6 }, { 3, 6 }, + { 17, 6 }, { 2, 6 }, { 102, 8 }, { 87, 8 }, { 116, 8 }, + { 56, 8 }, { 50, 5 }, { 20, 5 }, { 120, 9 }, { 58, 9 }, + { 29, 10 }, { 194, 10 }, { 135, 9 }, { 97, 8 }, { 7, 8 }, + { 105, 9 }, { 13, 11 }, { 241, 12 }, { 16, 12 }, { 45, 10 }, + { 149, 9 }, { 74, 9 }, { 98, 7 }, { 23, 7 }, { 85, 7 }, + { 70, 7 }, { 195, 10 }, { 161, 10 }, { 129, 9 }, { 72, 8 }, + { 51, 5 }, { 36, 5 }, { 117, 8 }, { 61, 10 }, { 11, 10 }, + { 162, 9 }, { 1, 7 }, { 4, 6 }, { 49, 6 }, { 68, 6 }, + { 9, 9 }, { 27, 9 }, { 130, 8 }, { 39, 7 }, { 53, 6 }, + { 99, 7 }, { 25, 8 }, { 150, 9 }, { 90, 9 }, { 103, 8 }, + { 163, 9 }, { 196, 10 }, { 210, 10 }, { 136, 9 }, { 121, 9 }, + { 41, 8 }, { 131, 8 }, { 43, 9 }, { 164, 9 }, { 118, 8 }, + { 88, 8 }, { 81, 7 }, { 6, 7 }, { 55, 7 }, { 59, 9 }, + { 30, 10 }, { 209, 11 }, { 14, 11 }, { 151, 9 }, { 106, 9 }, + { 82, 6 }, { 22, 6 }, { 100, 7 }, { 132, 8 }, { 57, 8 }, + { 18, 4 }, { 34, 4 }, +}; + + +#define HUFF_VEC1_SIZE 101 +#define HUFF_VEC1_MAXBITS 11 +static const uint8_t vec1_table[HUFF_VEC1_SIZE][2] = { + { 7, 5 }, { 32, 8 }, { 59, 10 }, { 60, 10 }, { 83, 11 }, + { 82, 11 }, { 62, 10 }, { 33, 8 }, { 45, 9 }, { 61, 10 }, + { 84, 11 }, { 85, 11 }, { 1, 6 }, { 13, 5 }, { 19, 6 }, + { 25, 7 }, { 34, 8 }, { 46, 9 }, { 47, 9 }, { 14, 5 }, + { 6, 5 }, { 64, 10 }, { 87, 11 }, { 86, 11 }, { 63, 10 }, + { 88, 11 }, { 90, 11 }, { 35, 8 }, { 26, 7 }, { 0, 7 }, + { 48, 9 }, { 65, 10 }, { 66, 10 }, { 36, 8 }, { 15, 5 }, + { 20, 6 }, { 91, 11 }, { 89, 11 }, { 67, 10 }, { 49, 9 }, + { 50, 9 }, { 69, 10 }, { 92, 11 }, { 93, 11 }, { 27, 7 }, + { 5, 5 }, { 37, 8 }, { 68, 10 }, { 71, 10 }, { 51, 9 }, + { 52, 9 }, { 70, 10 }, { 94, 11 }, { 96, 11 }, { 38, 8 }, + { 21, 6 }, { 16, 5 }, { 4, 5 }, { 28, 7 }, { 53, 9 }, + { 95, 11 }, { 97, 11 }, { 73, 10 }, { 39, 8 }, { 29, 7 }, + { 72, 10 }, { 98, 11 }, { 99, 11 }, { 54, 9 }, { 40, 8 }, + { 22, 6 }, { 30, 7 }, { 55, 9 }, { 74, 10 }, { 76, 10 }, + { 56, 9 }, { 75, 10 }, { 77, 10 }, { 17, 5 }, { 3, 5 }, + { 23, 6 }, { 41, 8 }, { 57, 9 }, { 78, 10 }, { 79, 10 }, + { 31, 7 }, { 10, 4 }, { 9, 4 }, { 100, 5 }, { 2, 5 }, + { 11, 4 }, { 8, 4 }, { 18, 5 }, { 42, 8 }, { 58, 9 }, + { 80, 10 }, { 81, 10 }, { 43, 8 }, { 44, 8 }, { 24, 6 }, + { 12, 4 }, +}; +/** @} */ + + +/** + * @brief decorrelation matrix for multichannel streams + **/ +static const float default_decorrelation_matrices[] = { + 1.000000, 0.707031, -0.707031, 0.707031, 0.707031, 0.578125, 0.707031, + 0.410156, 0.578125, -0.707031, 0.410156, 0.578125, 0.000000, -0.816406, + 0.500000, 0.652344, 0.500000, 0.269531, 0.500000, 0.269531, -0.500000, + -0.652344, 0.500000, -0.269531, -0.500000, 0.652344, 0.500000, -0.652344, + 0.500000, -0.269531, 0.445312, 0.601562, 0.511719, 0.371094, 0.195312, + 0.445312, 0.371094, -0.195312, -0.601562, -0.511719, 0.445312, 0.000000, + -0.632812, 0.000000, 0.632812, 0.445312, -0.371094, -0.195312, 0.601562, + -0.511719, 0.445312, -0.601562, 0.511719, -0.371094, 0.195312, 0.410156, + 0.558594, 0.500000, 0.410156, 0.289062, 0.148438, 0.410156, 0.410156, + 0.000000, -0.410156, -0.578125, -0.410156, 0.410156, 0.148438, -0.500000, + -0.410156, 0.289062, 0.558594, 0.410156, -0.148438, -0.500000, 0.410156, + 0.289062, -0.558594, 0.410156, -0.410156, 0.000000, 0.410156, -0.578125, + 0.410156, 0.410156, -0.558594, 0.500000, -0.410156, 0.289062, -0.148438, +}; + +/** + * @brief default decorrelation matrix offsets + */ +static const float * const default_decorrelation[] = { + NULL, + &default_decorrelation_matrices[0], + &default_decorrelation_matrices[1], + &default_decorrelation_matrices[5], + &default_decorrelation_matrices[14], + &default_decorrelation_matrices[30], + &default_decorrelation_matrices[55] +}; + +#endif /* AVCODEC_WMAPRODATA_H */ diff --git a/include/libavcodec/wmavoice_data.h b/include/libavcodec/wmavoice_data.h new file mode 100644 index 0000000..cbf65b0 --- /dev/null +++ b/include/libavcodec/wmavoice_data.h @@ -0,0 +1,3259 @@ +/* + * Windows Media Voice (WMAVoice) tables. + * Copyright (c) 2009 Ronald S. Bultje + * + * 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 + */ + +/** + * @file + * @brief Windows Media Voice (WMAVoice) tables + * @author Ronald S. Bultje + */ + +#ifndef AVCODEC_WMAVOICE_DATA_H +#define AVCODEC_WMAVOICE_DATA_H + +#include + +static const uint8_t wmavoice_dq_lsp10i[0xf00] = { + 125, 109, 84, 55, 34, 51, 109, 112, 118, 132, + 122, 102, 78, 80, 132, 119, 132, 132, 125, 131, + 109, 91, 131, 131, 136, 136, 137, 137, 140, 145, + 140, 143, 117, 136, 122, 106, 109, 91, 115, 119, + 133, 117, 103, 80, 55, 117, 123, 102, 93, 80, + 139, 116, 70, 39, 95, 89, 103, 113, 112, 122, + 135, 244, 229, 215, 199, 181, 163, 150, 146, 144, + 143, 173, 171, 154, 155, 154, 151, 148, 145, 143, + 132, 138, 116, 85, 117, 94, 108, 117, 107, 116, + 132, 118, 123, 119, 88, 67, 49, 95, 84, 95, + 121, 103, 74, 70, 179, 164, 141, 126, 107, 112, + 119, 95, 103, 149, 139, 148, 144, 147, 148, 141, + 151, 133, 142, 129, 111, 131, 108, 128, 122, 108, + 121, 96, 115, 138, 116, 93, 105, 115, 115, 123, + 129, 106, 136, 180, 147, 130, 108, 141, 131, 118, + 136, 155, 176, 156, 135, 129, 140, 146, 142, 134, + 141, 130, 109, 80, 52, 38, 18, 47, 118, 134, + 155, 141, 100, 78, 72, 89, 79, 96, 92, 98, + 133, 111, 83, 91, 72, 58, 105, 115, 112, 120, + 145, 127, 135, 113, 113, 105, 105, 85, 69, 61, + 115, 96, 116, 145, 159, 170, 175, 175, 168, 155, + 140, 120, 84, 52, 80, 145, 125, 127, 116, 126, + 128, 108, 101, 198, 227, 200, 178, 159, 147, 148, + 121, 88, 46, 109, 124, 126, 126, 137, 147, 147, + 129, 107, 164, 148, 127, 117, 134, 120, 111, 116, + 120, 103, 98, 73, 66, 61, 70, 115, 116, 125, + 126, 100, 77, 188, 162, 140, 114, 128, 139, 123, + 145, 165, 164, 134, 109, 100, 108, 118, 127, 130, + 156, 182, 190, 173, 167, 165, 162, 157, 152, 147, + 150, 164, 179, 183, 173, 155, 140, 136, 134, 135, + 122, 92, 69, 140, 132, 118, 108, 128, 138, 132, + 123, 127, 148, 137, 150, 149, 139, 127, 124, 130, + 136, 138, 112, 70, 41, 37, 132, 140, 129, 125, + 130, 111, 78, 33, 51, 161, 141, 136, 120, 122, + 126, 110, 87, 106, 85, 68, 48, 81, 112, 113, + 135, 125, 98, 85, 102, 80, 100, 87, 86, 116, + 142, 133, 110, 66, 48, 152, 139, 135, 136, 123, + 128, 116, 89, 102, 128, 99, 83, 61, 105, 124, + 120, 94, 73, 83, 78, 100, 122, 124, 128, 132, + 144, 137, 116, 102, 75, 144, 136, 127, 140, 127, + 154, 144, 118, 99, 90, 90, 89, 75, 68, 83, + 123, 103, 89, 198, 180, 154, 138, 122, 136, 120, + 138, 118, 121, 136, 110, 105, 85, 111, 101, 104, + 121, 126, 139, 115, 99, 101, 107, 110, 123, 126, + 127, 115, 88, 109, 164, 134, 138, 138, 120, 121, + 130, 202, 195, 202, 199, 201, 181, 164, 159, 148, + 120, 116, 194, 199, 186, 171, 154, 142, 137, 133, + 137, 129, 112, 149, 134, 112, 149, 138, 120, 134, + 119, 102, 107, 83, 79, 114, 119, 127, 128, 128, + 144, 148, 165, 155, 161, 150, 135, 122, 116, 115, + 120, 99, 80, 120, 123, 124, 111, 89, 70, 108, + 118, 95, 66, 53, 105, 126, 125, 105, 83, 111, + 129, 197, 191, 197, 206, 213, 216, 208, 196, 169, + 133, 109, 127, 164, 134, 121, 99, 92, 82, 71, + 131, 121, 93, 91, 136, 105, 115, 140, 120, 110, + 150, 164, 139, 108, 87, 81, 93, 92, 104, 116, + 133, 114, 125, 126, 111, 136, 110, 156, 147, 133, + 113, 94, 118, 120, 115, 125, 124, 126, 127, 134, + 116, 131, 161, 158, 166, 157, 150, 150, 144, 141, + 125, 185, 169, 142, 140, 143, 139, 131, 134, 138, + 179, 188, 170, 150, 134, 140, 144, 133, 127, 127, + 150, 177, 204, 184, 192, 194, 190, 193, 177, 158, + 114, 113, 138, 116, 137, 135, 132, 131, 127, 134, + 120, 147, 163, 135, 133, 137, 136, 136, 133, 135, + 137, 120, 95, 73, 46, 48, 111, 97, 97, 123, + 139, 130, 109, 76, 52, 72, 61, 61, 125, 127, + 132, 119, 119, 90, 66, 41, 64, 156, 143, 129, + 131, 106, 58, 25, 99, 115, 122, 136, 129, 132, + 134, 123, 97, 53, 27, 114, 125, 114, 120, 123, + 122, 107, 93, 57, 47, 133, 128, 138, 141, 131, + 145, 132, 122, 110, 79, 57, 30, 73, 153, 144, + 150, 132, 85, 59, 133, 125, 130, 115, 100, 96, + 148, 127, 111, 86, 61, 38, 110, 121, 108, 99, + 157, 143, 105, 77, 116, 118, 115, 131, 122, 122, + 133, 119, 134, 108, 86, 61, 129, 165, 143, 127, + 125, 105, 89, 111, 97, 85, 113, 99, 98, 117, + 149, 131, 101, 106, 88, 95, 79, 119, 123, 120, + 125, 109, 81, 100, 201, 183, 156, 138, 115, 116, + 141, 119, 129, 105, 76, 60, 110, 99, 92, 82, + 150, 156, 129, 95, 69, 115, 115, 113, 134, 125, + 118, 97, 67, 96, 203, 197, 171, 151, 133, 125, + 143, 131, 120, 134, 105, 80, 51, 60, 139, 134, + 129, 160, 223, 219, 219, 212, 197, 173, 157, 146, + 132, 112, 164, 144, 119, 102, 92, 76, 73, 94, + 132, 112, 124, 114, 93, 92, 83, 73, 69, 99, + 129, 103, 188, 163, 142, 132, 127, 101, 82, 59, + 140, 141, 111, 74, 46, 105, 113, 99, 127, 122, + 125, 94, 63, 112, 116, 101, 81, 120, 136, 134, + 133, 190, 224, 193, 179, 158, 146, 143, 140, 136, + 152, 161, 132, 120, 112, 94, 114, 102, 92, 116, + 129, 194, 196, 202, 211, 212, 210, 190, 169, 152, + 166, 166, 145, 111, 91, 132, 133, 128, 136, 130, + 118, 94, 72, 74, 92, 86, 89, 92, 106, 123, + 126, 100, 86, 137, 117, 92, 76, 104, 106, 114, + 133, 109, 204, 192, 166, 148, 138, 128, 111, 81, + 118, 99, 79, 146, 169, 141, 123, 102, 131, 120, + 127, 105, 136, 204, 170, 154, 131, 145, 135, 119, + 117, 95, 64, 83, 141, 136, 118, 96, 99, 126, + 115, 93, 98, 102, 95, 105, 106, 114, 119, 128, + 131, 121, 98, 139, 149, 119, 109, 86, 105, 129, + 134, 119, 104, 169, 185, 155, 141, 122, 107, 127, + 136, 115, 85, 108, 87, 126, 102, 128, 136, 129, + 125, 99, 126, 158, 133, 139, 132, 113, 91, 107, + 141, 122, 128, 161, 130, 127, 105, 120, 118, 106, + 122, 140, 161, 168, 187, 184, 176, 158, 144, 140, + 127, 111, 89, 130, 132, 105, 134, 121, 100, 122, + 129, 110, 128, 115, 129, 116, 132, 118, 114, 119, + 138, 133, 132, 188, 183, 159, 161, 147, 134, 140, + 132, 113, 84, 167, 147, 132, 124, 109, 133, 121, + 132, 128, 116, 121, 98, 101, 145, 129, 128, 129, + 124, 112, 152, 158, 136, 161, 139, 165, 158, 142, + 139, 138, 110, 127, 148, 117, 126, 118, 101, 116, + 155, 168, 154, 128, 120, 152, 150, 141, 140, 135, + 127, 111, 109, 134, 104, 133, 110, 112, 132, 114, + 111, 87, 68, 89, 107, 121, 121, 126, 126, 129, + 120, 148, 169, 163, 173, 178, 185, 188, 178, 163, + 122, 97, 86, 117, 101, 138, 118, 142, 155, 139, + 125, 114, 131, 138, 153, 149, 163, 150, 143, 141, + 157, 161, 138, 152, 134, 121, 122, 109, 110, 124, + 151, 171, 196, 168, 145, 139, 147, 151, 146, 139, + 134, 169, 179, 170, 175, 178, 177, 173, 165, 154, + 120, 151, 118, 107, 125, 129, 133, 133, 136, 139, + 119, 141, 159, 151, 160, 165, 168, 169, 162, 152, + 115, 111, 119, 94, 117, 121, 127, 127, 132, 136, + 134, 153, 147, 142, 142, 147, 159, 159, 154, 147, + 110, 106, 139, 135, 143, 142, 147, 146, 147, 147, + 115, 133, 151, 133, 141, 142, 151, 152, 147, 144, + 115, 132, 144, 131, 125, 126, 128, 130, 131, 136, + 138, 118, 96, 71, 48, 26, 43, 130, 125, 125, + 134, 122, 98, 54, 28, 84, 77, 73, 109, 125, + 133, 112, 67, 48, 141, 129, 126, 113, 112, 118, + 143, 123, 89, 54, 71, 73, 75, 131, 123, 123, + 126, 109, 81, 31, 15, 94, 110, 109, 119, 128, + 132, 122, 97, 92, 73, 50, 27, 22, 104, 133, + 133, 119, 94, 48, 34, 168, 160, 154, 151, 130, + 147, 133, 90, 54, 71, 123, 106, 105, 93, 117, + 143, 132, 107, 69, 45, 78, 178, 169, 150, 139, + 138, 123, 116, 96, 69, 49, 32, 113, 103, 112, + 154, 151, 125, 79, 60, 152, 160, 154, 155, 137, + 142, 151, 124, 88, 66, 59, 94, 87, 95, 119, + 166, 154, 122, 92, 138, 132, 124, 114, 97, 97, + 122, 99, 98, 219, 191, 176, 165, 159, 153, 131, + 130, 119, 91, 51, 24, 41, 144, 156, 147, 139, + 139, 122, 81, 65, 124, 111, 104, 90, 94, 98, + 138, 120, 112, 91, 63, 65, 89, 75, 78, 106, + 126, 107, 91, 85, 69, 95, 90, 84, 108, 120, + 155, 139, 100, 78, 120, 110, 109, 91, 77, 73, + 144, 130, 135, 112, 88, 65, 62, 142, 129, 126, + 170, 154, 150, 131, 121, 116, 100, 92, 83, 86, + 131, 122, 98, 107, 102, 75, 54, 38, 117, 130, + 146, 139, 117, 107, 86, 66, 44, 30, 97, 128, + 129, 116, 100, 59, 108, 127, 119, 139, 129, 129, + 124, 106, 79, 49, 154, 190, 166, 152, 133, 123, + 141, 149, 123, 89, 61, 70, 143, 132, 125, 126, + 136, 113, 177, 166, 141, 123, 109, 108, 105, 93, + 137, 117, 147, 123, 99, 85, 109, 98, 91, 75, + 129, 121, 102, 78, 53, 90, 149, 136, 134, 135, + 144, 136, 126, 90, 114, 152, 137, 152, 138, 128, + 133, 115, 107, 129, 99, 78, 60, 129, 125, 118, + 147, 141, 119, 124, 110, 91, 79, 64, 106, 117, + 134, 111, 164, 143, 123, 113, 116, 95, 76, 56, + 147, 159, 140, 109, 83, 84, 140, 135, 127, 129, + 123, 104, 116, 99, 91, 87, 80, 110, 113, 121, + 124, 106, 174, 174, 152, 141, 132, 134, 126, 124, + 140, 190, 240, 215, 212, 189, 173, 158, 144, 137, + 123, 97, 79, 102, 110, 111, 90, 75, 126, 124, + 134, 121, 104, 145, 127, 100, 77, 65, 120, 118, + 123, 106, 87, 41, 68, 119, 106, 115, 109, 119, + 137, 232, 241, 225, 217, 202, 183, 169, 156, 145, + 161, 146, 127, 110, 97, 107, 88, 114, 108, 106, + 141, 244, 216, 192, 172, 163, 148, 143, 144, 144, + 128, 127, 109, 89, 77, 68, 124, 120, 121, 125, + 125, 94, 48, 71, 116, 113, 104, 120, 142, 137, + 133, 129, 115, 82, 68, 120, 99, 133, 134, 124, + 130, 106, 108, 160, 130, 111, 89, 129, 124, 119, + 134, 120, 149, 143, 116, 95, 87, 142, 132, 122, + 126, 114, 108, 107, 80, 141, 133, 123, 137, 124, + 117, 95, 69, 43, 62, 98, 114, 116, 112, 120, + 122, 99, 87, 164, 145, 123, 99, 95, 118, 105, + 126, 101, 102, 120, 113, 110, 92, 139, 134, 126, + 148, 194, 241, 219, 221, 215, 200, 193, 174, 151, + 127, 104, 122, 136, 113, 106, 110, 95, 78, 106, + 131, 163, 217, 199, 194, 175, 164, 155, 142, 138, + 139, 124, 88, 57, 161, 161, 145, 139, 124, 116, + 127, 110, 91, 98, 126, 104, 113, 98, 94, 94, + 145, 138, 114, 90, 75, 130, 117, 107, 99, 90, + 119, 98, 86, 101, 148, 133, 103, 83, 124, 131, + 143, 168, 169, 133, 110, 117, 139, 149, 147, 137, + 124, 106, 80, 138, 194, 163, 142, 119, 106, 130, + 136, 125, 105, 114, 87, 113, 101, 89, 108, 102, + 114, 90, 53, 46, 105, 116, 126, 122, 118, 122, + 124, 102, 92, 195, 167, 160, 144, 154, 154, 132, + 118, 97, 88, 72, 98, 120, 112, 98, 79, 117, + 114, 107, 185, 191, 191, 188, 175, 165, 153, 143, + 119, 97, 90, 89, 120, 151, 136, 113, 99, 112, + 141, 121, 144, 122, 125, 113, 133, 111, 92, 69, + 120, 98, 78, 109, 151, 145, 157, 157, 151, 143, + 130, 110, 120, 188, 159, 141, 119, 112, 109, 98, + 126, 112, 83, 110, 169, 139, 127, 105, 93, 123, + 141, 145, 117, 106, 91, 78, 123, 107, 101, 125, + 117, 95, 71, 147, 176, 153, 148, 133, 135, 127, + 124, 106, 79, 64, 115, 96, 108, 115, 106, 105, + 127, 115, 90, 98, 105, 81, 144, 135, 117, 125, + 126, 104, 98, 165, 138, 136, 112, 149, 148, 131, + 119, 144, 186, 185, 204, 202, 209, 200, 182, 161, + 123, 153, 190, 189, 199, 194, 191, 176, 157, 147, + 121, 103, 119, 98, 100, 120, 106, 97, 95, 126, + 137, 130, 102, 117, 117, 92, 126, 114, 101, 118, + 131, 219, 190, 167, 153, 151, 144, 140, 142, 143, + 114, 102, 151, 152, 132, 120, 112, 120, 127, 131, + 138, 122, 91, 143, 118, 120, 114, 104, 124, 117, + 148, 142, 117, 126, 97, 125, 108, 116, 142, 125, + 126, 106, 91, 169, 208, 178, 158, 138, 127, 135, + 133, 126, 101, 83, 147, 130, 125, 117, 114, 117, + 120, 103, 94, 149, 136, 129, 139, 118, 133, 133, + 147, 152, 126, 132, 119, 97, 132, 129, 114, 126, + 112, 107, 148, 125, 112, 114, 124, 125, 129, 135, + 139, 121, 157, 151, 131, 140, 118, 147, 136, 121, + 115, 105, 159, 167, 185, 191, 196, 190, 176, 160, + 124, 106, 104, 122, 130, 114, 152, 144, 134, 136, + 136, 152, 159, 153, 131, 114, 116, 126, 129, 129, + 124, 109, 87, 131, 107, 115, 130, 107, 144, 131, + 126, 162, 176, 175, 180, 176, 160, 141, 134, 134, + 136, 127, 108, 161, 162, 133, 141, 124, 112, 128, + 130, 115, 110, 140, 107, 155, 134, 131, 156, 137, + 122, 106, 116, 127, 118, 161, 150, 170, 167, 152, + 139, 177, 203, 176, 155, 139, 130, 128, 129, 132, + 137, 119, 125, 103, 110, 123, 107, 120, 108, 101, + 113, 107, 160, 154, 160, 166, 169, 176, 168, 156, + 115, 90, 65, 115, 115, 104, 120, 112, 109, 124, + 131, 123, 100, 109, 185, 158, 141, 132, 116, 119, + 139, 130, 119, 156, 124, 138, 127, 116, 141, 128, + 133, 118, 115, 180, 149, 151, 135, 130, 147, 129, + 117, 90, 80, 119, 124, 128, 132, 130, 128, 135, + 112, 97, 142, 161, 167, 165, 154, 142, 136, 135, + 118, 141, 193, 172, 157, 152, 148, 145, 146, 141, + 125, 147, 165, 166, 149, 133, 123, 122, 128, 131, + 128, 193, 177, 174, 182, 186, 197, 193, 191, 173, + 124, 144, 162, 133, 113, 113, 123, 128, 129, 130, + 117, 98, 121, 122, 137, 132, 110, 97, 111, 130, + 128, 176, 151, 125, 126, 134, 130, 121, 127, 130, + 122, 151, 142, 111, 106, 121, 126, 126, 130, 134, + 148, 167, 186, 153, 129, 122, 124, 128, 130, 128, + 148, 172, 206, 178, 171, 182, 169, 180, 172, 156, + 133, 164, 174, 160, 155, 163, 163, 172, 169, 158, + 132, 150, 147, 142, 152, 140, 140, 140, 134, 135, + 137, 158, 167, 172, 163, 153, 169, 158, 146, 147, + 150, 161, 162, 172, 153, 133, 140, 144, 136, 135, + 109, 84, 101, 120, 129, 134, 133, 136, 137, 143, + 112, 114, 157, 147, 141, 136, 135, 133, 135, 138, + 121, 154, 161, 150, 149, 154, 151, 144, 146, 144, + 111, 117, 125, 125, 130, 131, 135, 137, 143, 148, + 121, 141, 146, 131, 138, 126, 118, 111, 119, 130, + 120, 135, 145, 121, 140, 134, 138, 137, 131, 134, + 115, 137, 132, 137, 139, 138, 138, 139, 145, 149, + 131, 149, 147, 133, 132, 126, 131, 134, 130, 133, + 110, 98, 84, 141, 107, 169, 169, 123, 125, 126, + 118, 210, 98, 126, 132, 138, 128, 139, 156, 157, + 140, 142, 129, 95, 192, 178, 182, 186, 183, 159, + 135, 134, 144, 124, 100, 228, 203, 161, 122, 104, + 139, 159, 134, 161, 121, 126, 192, 152, 218, 180, + 132, 132, 119, 99, 96, 97, 80, 53, 134, 143, + 102, 114, 133, 114, 127, 83, 77, 126, 85, 107, + 110, 114, 194, 186, 139, 116, 147, 104, 129, 138, + 126, 133, 109, 144, 115, 45, 130, 97, 159, 155, + 157, 162, 189, 185, 168, 163, 151, 151, 142, 135, + 144, 147, 120, 74, 192, 186, 149, 118, 71, 84, + 143, 156, 133, 178, 168, 107, 119, 149, 105, 112, + 182, 184, 158, 118, 118, 148, 128, 177, 171, 152, + 139, 135, 126, 209, 171, 150, 123, 100, 190, 158, + 166, 97, 136, 123, 136, 139, 128, 138, 126, 121, + 132, 131, 128, 95, 60, 168, 127, 140, 208, 161, + 109, 102, 119, 162, 150, 137, 107, 200, 156, 136, + 136, 128, 103, 95, 74, 91, 220, 173, 152, 138, + 139, 129, 140, 136, 122, 82, 180, 115, 53, 90, + 121, 107, 99, 148, 116, 139, 100, 63, 191, 155, + 130, 129, 163, 155, 98, 175, 95, 151, 127, 107, + 124, 124, 116, 88, 71, 164, 148, 96, 57, 89, + 125, 117, 77, 63, 162, 144, 113, 109, 137, 134, + 134, 130, 149, 174, 158, 158, 130, 81, 28, 67, + 142, 139, 129, 100, 194, 134, 68, 175, 131, 103, + 136, 132, 122, 96, 119, 82, 115, 249, 215, 168, + 125, 139, 199, 96, 146, 123, 136, 179, 142, 137, + 181, 166, 106, 86, 122, 106, 123, 131, 106, 119, + 129, 189, 188, 147, 126, 110, 101, 114, 147, 136, + 132, 106, 72, 175, 148, 99, 130, 153, 125, 136, + 123, 119, 147, 170, 157, 126, 209, 188, 158, 152, + 101, 89, 142, 131, 161, 150, 148, 124, 89, 119, + 141, 137, 131, 103, 81, 85, 64, 175, 129, 121, + 137, 144, 142, 145, 119, 205, 148, 80, 165, 138, + 143, 137, 167, 165, 148, 149, 110, 234, 217, 170, + 167, 152, 75, 140, 155, 155, 175, 129, 136, 134, + 136, 152, 161, 131, 140, 121, 91, 79, 255, 209, + 132, 147, 120, 114, 177, 128, 110, 61, 89, 131, + 125, 127, 93, 87, 167, 115, 186, 162, 107, 106, + 134, 162, 151, 100, 79, 67, 151, 116, 130, 142, + 162, 153, 155, 143, 122, 85, 202, 187, 135, 125, + 158, 155, 103, 129, 74, 149, 130, 98, 129, 126, + 148, 152, 153, 133, 118, 94, 80, 70, 47, 90, + 124, 118, 143, 184, 158, 126, 70, 82, 111, 113, + 126, 135, 175, 141, 203, 166, 123, 123, 134, 133, + 113, 111, 128, 76, 128, 177, 151, 178, 134, 125, + 120, 120, 193, 106, 98, 134, 101, 86, 101, 114, + 136, 127, 134, 196, 86, 105, 145, 128, 119, 137, + 138, 126, 230, 161, 141, 128, 129, 136, 88, 83, + 103, 118, 178, 123, 89, 101, 161, 173, 165, 147, + 130, 123, 171, 158, 131, 81, 50, 177, 162, 136, + 125, 115, 82, 173, 195, 168, 130, 112, 112, 121, + 152, 148, 167, 87, 82, 161, 142, 147, 98, 89, + 168, 138, 97, 157, 132, 114, 74, 126, 161, 141, + 135, 123, 68, 137, 124, 118, 112, 92, 65, 96, + 191, 181, 161, 151, 141, 145, 129, 102, 97, 111, + 144, 128, 55, 128, 115, 155, 129, 184, 167, 147, + 131, 141, 125, 33, 127, 111, 127, 131, 125, 130, + 137, 130, 121, 195, 172, 177, 176, 149, 98, 97, + 126, 106, 168, 159, 144, 185, 156, 151, 182, 158, + 123, 93, 110, 116, 98, 99, 125, 136, 139, 148, + 79, 112, 149, 128, 147, 136, 118, 105, 166, 152, + 117, 115, 92, 128, 148, 132, 170, 143, 226, 190, + 122, 192, 165, 121, 143, 144, 174, 124, 113, 124, + 122, 135, 34, 93, 118, 111, 111, 136, 123, 116, + 99, 195, 139, 99, 114, 102, 96, 108, 111, 112, + 113, 129, 172, 137, 105, 139, 154, 86, 113, 108, + 132, 79, 63, 120, 93, 162, 90, 103, 94, 95, + 117, 127, 104, 100, 142, 129, 93, 27, 196, 153, + 113, 91, 101, 90, 84, 68, 138, 38, 118, 148, + 87, 103, 125, 109, 96, 152, 100, 56, 31, 62, + 176, 129, 124, 115, 103, 92, 100, 121, 130, 125, + 128, 71, 82, 71, 152, 85, 107, 116, 138, 133, + 103, 116, 139, 144, 72, 37, 118, 141, 109, 95, + 86, 92, 121, 167, 156, 104, 92, 91, 122, 114, + 89, 61, 172, 128, 95, 103, 84, 101, 88, 84, + 116, 125, 108, 62, 74, 108, 160, 143, 189, 164, + 91, 115, 144, 43, 116, 79, 106, 108, 74, 83, + 87, 90, 61, 71, 76, 76, 95, 130, 89, 94, + 114, 107, 101, 145, 161, 147, 143, 163, 147, 129, + 101, 73, 111, 108, 93, 104, 186, 141, 99, 89, + 112, 126, 111, 113, 152, 41, 159, 115, 131, 124, + 117, 101, 115, 130, 124, 87, 59, 177, 63, 85, + 109, 116, 103, 68, 145, 132, 29, 119, 96, 89, + 117, 90, 181, 103, 101, 111, 97, 96, 199, 171, + 113, 120, 93, 119, 101, 64, 56, 55, 63, 90, + 105, 101, 86, 45, 136, 179, 142, 102, 115, 114, + 113, 108, 121, 84, 23, 125, 76, 102, 119, 107, + 120, 104, 73, 177, 83, 114, 128, 85, 152, 126, + 137, 115, 149, 109, 163, 133, 110, 98, 54, 61, + 95, 111, 135, 103, 88, 164, 115, 187, 122, 98, + 129, 132, 95, 86, 71, 119, 146, 111, 38, 67, + 102, 100, 66, 148, 137, 103, 145, 95, 35, 85, + 44, 136, 102, 111, 108, 115, 136, 105, 120, 110, + 108, 147, 112, 169, 116, 146, 81, 120, 94, 84, + 93, 97, 90, 119, 102, 91, 48, 147, 204, 151, + 148, 160, 144, 131, 144, 175, 158, 133, 212, 163, + 172, 152, 151, 112, 148, 151, 145, 179, 160, 124, + 164, 164, 167, 161, 141, 120, 131, 141, 198, 177, + 169, 156, 146, 156, 124, 185, 164, 195, 181, 193, + 201, 147, 148, 168, 165, 159, 162, 148, 150, 148, + 146, 157, 158, 149, 164, 129, 160, 214, 174, 166, + 154, 176, 146, 141, 155, 140, 140, 169, 106, 155, + 166, 162, 134, 193, 157, 155, 146, 196, 171, 107, + 177, 174, 163, 155, 147, 203, 162, 146, 150, 83, + 157, 170, 180, 178, 159, 157, 151, 117, 115, 183, + 170, 180, 174, 150, 177, 173, 136, 181, 196, 184, + 164, 168, 165, 148, 175, 168, 209, 189, 159, 114, + 157, 158, 141, 168, 170, 139, 175, 128, 151, 39, + 128, 154, 159, 161, 148, 180, 131, 165, 159, 131, + 163, 150, 174, 178, 178, 198, 172, 138, 184, 191, + 143, 164, 161, 163, 210, 171, 155, 168, 150, 116, + 182, 170, 145, 152, 141, 139, 191, 149, 160, 202, + 145, 169, 145, 181, 148, 183, 197, 165, 146, 171, + 161, 153, 157, 170, 164, 149, 183, 167, 246, 235, + 162, 144, 170, 152, 173, 150, 113, 135, 156, 154, + 158, 148, 178, 159, 161, 114, 180, 156, 116, 163, + 164, 161, 122, 164, 164, 183, 135, 135, 144, 182, + 160, 147, 163, 152, 169, 185, 159, 177, 99, 211, + 168, 167, 215, 170, 150, 157, 154, 176, 154, 143, + 163, 117, 178, 160, 163, 165, 164, 166, 174, 136, + 159, 169, 152, 123, 199, 149, 169, 140, 159, 208, + 155, 161, 186, 122, 134, 167, 171, 145, 148, 176, + 148, 137, 114, 160, 166, 153, 162, 156, 164, 172, + 155, 148, 155, 182, 114, 150, 157, 154, 140, 159, + 166, 160, 169, 206, 182, 145, 157, 165, 147, 202, + 131, 154, 193, 162, 162, 149, 167, 157, 191, 188, + 149, 205, 147, 166, 150, 150, 159, 153, 171, 160 +}; + +static const uint8_t wmavoice_dq_lsp16i1[0x640] = { + 142, 121, 141, 112, 99, 119, 92, 122, 183, 155, + 122, 98, 75, 78, 85, 101, 108, 134, 128, 123, + 115, 90, 79, 58, 73, 127, 106, 60, 97, 107, + 141, 163, 130, 123, 136, 156, 201, 189, 204, 206, + 140, 116, 69, 60, 117, 123, 106, 124, 91, 63, + 150, 144, 110, 80, 63, 112, 80, 70, 76, 63, + 114, 86, 147, 165, 137, 125, 120, 140, 115, 101, + 101, 99, 166, 158, 158, 104, 126, 131, 134, 143, + 121, 102, 73, 36, 83, 132, 113, 76, 38, 20, + 132, 111, 78, 73, 51, 131, 108, 131, 105, 80, + 148, 138, 101, 65, 47, 115, 86, 50, 124, 129, + 116, 89, 85, 87, 64, 111, 74, 39, 115, 113, + 112, 83, 75, 122, 127, 114, 91, 106, 125, 130, + 131, 108, 79, 136, 112, 110, 147, 164, 144, 124, + 121, 236, 218, 190, 168, 106, 101, 160, 172, 191, + 113, 138, 102, 91, 109, 100, 71, 85, 112, 119, + 121, 96, 51, 64, 126, 135, 114, 76, 34, 104, + 145, 127, 90, 56, 131, 142, 131, 92, 123, 102, + 128, 105, 63, 24, 95, 115, 87, 49, 156, 174, + 123, 105, 88, 58, 55, 141, 119, 99, 75, 81, + 137, 117, 114, 80, 56, 119, 91, 106, 166, 135, + 114, 84, 38, 93, 116, 129, 103, 97, 87, 97, + 115, 184, 193, 173, 157, 117, 88, 114, 151, 121, + 126, 111, 75, 129, 133, 130, 107, 71, 115, 92, + 128, 108, 120, 100, 97, 111, 80, 119, 122, 91, + 114, 94, 149, 129, 136, 114, 88, 132, 110, 85, + 116, 99, 101, 71, 71, 110, 140, 142, 131, 110, + 122, 98, 83, 127, 100, 106, 130, 123, 114, 103, + 113, 87, 140, 116, 113, 140, 161, 171, 145, 129, + 115, 178, 158, 161, 160, 118, 195, 209, 221, 228, + 99, 83, 140, 134, 140, 127, 186, 168, 187, 187, + 107, 114, 100, 111, 111, 104, 130, 131, 116, 128, + 128, 104, 64, 18, 49, 126, 107, 69, 56, 153, + 154, 142, 110, 113, 89, 120, 93, 73, 190, 172, + 119, 96, 57, 21, 60, 126, 122, 81, 99, 117, + 159, 141, 108, 88, 120, 144, 125, 89, 44, 94, + 147, 131, 93, 81, 61, 133, 113, 85, 47, 62, + 123, 121, 87, 53, 90, 120, 94, 76, 70, 48, + 125, 103, 93, 64, 35, 140, 129, 88, 47, 30, + 127, 104, 58, 51, 103, 124, 100, 102, 76, 47, + 115, 87, 54, 46, 77, 182, 218, 174, 163, 145, + 140, 126, 89, 105, 82, 125, 119, 101, 69, 58, + 125, 107, 172, 145, 128, 138, 113, 109, 92, 90, + 117, 93, 83, 93, 132, 125, 102, 67, 148, 161, + 131, 110, 96, 99, 74, 119, 92, 54, 84, 81, + 110, 152, 120, 106, 131, 108, 74, 68, 99, 107, + 121, 97, 120, 101, 78, 132, 110, 127, 164, 134, + 111, 159, 204, 189, 178, 158, 183, 146, 144, 137, + 123, 106, 136, 108, 135, 117, 91, 163, 135, 113, + 119, 177, 134, 122, 121, 132, 109, 157, 131, 113, + 115, 87, 87, 100, 92, 120, 95, 59, 146, 139, + 129, 101, 135, 122, 101, 119, 100, 112, 88, 99, + 118, 90, 123, 125, 107, 121, 98, 73, 104, 80, + 112, 79, 86, 122, 96, 104, 81, 107, 90, 93, + 112, 150, 140, 109, 115, 113, 86, 73, 76, 112, + 130, 111, 101, 112, 84, 123, 97, 63, 134, 115, + 109, 77, 128, 141, 119, 125, 101, 108, 147, 119, + 134, 149, 150, 127, 115, 136, 244, 220, 210, 189, + 105, 138, 171, 156, 174, 117, 162, 133, 146, 141, + 115, 93, 119, 98, 122, 114, 106, 154, 145, 162, + 107, 131, 189, 165, 152, 101, 107, 129, 114, 139, + 116, 186, 186, 161, 180, 100, 89, 137, 116, 116, + 106, 130, 194, 196, 207, 110, 156, 157, 138, 149, + 102, 93, 159, 138, 120, 109, 132, 105, 122, 135, + 148, 128, 85, 76, 102, 168, 154, 141, 117, 100, + 125, 106, 62, 101, 146, 124, 102, 65, 25, 15, + 120, 94, 46, 21, 94, 149, 128, 115, 85, 92, + 119, 93, 70, 52, 30, 162, 151, 123, 91, 80, + 126, 112, 84, 47, 33, 138, 114, 73, 60, 87, + 126, 211, 174, 158, 143, 129, 106, 65, 31, 133, + 119, 95, 52, 99, 173, 123, 96, 119, 206, 178, + 127, 104, 60, 61, 67, 152, 136, 104, 63, 83, + 133, 130, 92, 64, 45, 120, 96, 53, 30, 130, + 128, 103, 74, 59, 35, 135, 114, 77, 30, 57, + 108, 130, 123, 90, 87, 143, 125, 93, 54, 60, + 133, 118, 79, 87, 95, 115, 89, 111, 88, 65, + 124, 102, 70, 40, 47, 148, 131, 123, 130, 104, + 127, 109, 87, 56, 121, 147, 123, 121, 107, 85, + 178, 237, 200, 193, 170, 139, 118, 100, 75, 110, + 133, 121, 81, 73, 68, 120, 195, 157, 141, 131, + 127, 102, 107, 88, 60, 136, 113, 100, 69, 45, + 128, 105, 93, 77, 67, 131, 116, 149, 184, 156, + 115, 85, 35, 45, 112, 128, 108, 68, 73, 111, + 118, 93, 187, 162, 139, 136, 115, 84, 57, 37, + 131, 133, 125, 98, 85, 138, 115, 92, 86, 61, + 116, 96, 70, 52, 110, 115, 109, 135, 104, 88, + 136, 159, 122, 109, 115, 122, 110, 98, 70, 95, + 112, 81, 68, 85, 90, 124, 101, 87, 56, 89, + 109, 82, 98, 100, 115, 124, 102, 76, 88, 63, + 111, 78, 42, 78, 102, 110, 71, 64, 131, 111, + 125, 104, 107, 87, 123, 129, 131, 99, 85, 68, + 147, 137, 102, 99, 75, 120, 155, 142, 109, 91, + 132, 109, 131, 141, 113, 136, 119, 94, 152, 128, + 127, 102, 79, 159, 134, 111, 78, 98, 109, 80, + 115, 86, 51, 63, 103, 116, 86, 170, 149, 123, + 135, 178, 159, 125, 114, 113, 189, 226, 203, 202, + 140, 117, 116, 94, 70, 128, 103, 94, 174, 149, + 118, 98, 83, 84, 106, 115, 157, 120, 94, 95, + 131, 112, 75, 96, 74, 121, 97, 144, 117, 95, + 120, 90, 140, 138, 110, 119, 93, 55, 92, 114, + 114, 87, 151, 125, 100, 111, 82, 83, 160, 139, + 114, 86, 56, 90, 138, 104, 109, 101, 77, 118, + 140, 142, 143, 148, 126, 121, 102, 129, 107, 111, + 113, 79, 58, 111, 91, 120, 94, 63, 115, 98, + 121, 94, 99, 97, 78, 120, 92, 68, 173, 148, + 122, 114, 109, 87, 82, 132, 229, 192, 176, 155, + 137, 116, 123, 97, 115, 132, 115, 86, 120, 95, + 135, 116, 101, 136, 108, 109, 74, 100, 125, 115, + 112, 158, 144, 124, 134, 114, 83, 73, 147, 120, + 120, 104, 150, 122, 116, 110, 104, 192, 183, 174, + 134, 112, 116, 120, 93, 121, 101, 93, 110, 90, + 121, 93, 147, 152, 122, 115, 153, 171, 161, 142, + 123, 95, 116, 114, 93, 113, 89, 96, 77, 93, + 113, 174, 180, 143, 138, 116, 86, 100, 135, 106, + 103, 121, 149, 115, 103, 121, 95, 82, 149, 121, + 117, 92, 93, 111, 114, 123, 209, 196, 193, 183, + 125, 102, 107, 130, 104, 115, 91, 113, 103, 99, + 114, 86, 68, 108, 110, 111, 159, 162, 125, 113, + 125, 235, 234, 225, 214, 99, 74, 118, 121, 127, + 104, 123, 158, 128, 127, 113, 96, 116, 136, 158, + 100, 80, 138, 155, 166, 118, 143, 115, 125, 114, + 119, 137, 133, 136, 139, 151, 188, 172, 174, 173, + 138, 161, 158, 158, 155, 121, 198, 194, 211, 202, + 100, 90, 112, 110, 122, 100, 91, 122, 128, 135, + 101, 109, 127, 101, 114, 105, 126, 160, 147, 143, + 109, 138, 142, 158, 163, 113, 174, 185, 188, 206, + 112, 154, 166, 176, 183, 101, 108, 140, 140, 143, + 106, 135, 130, 137, 126, 103, 114, 115, 128, 126, + 107, 86, 21, 115, 75, 117, 139, 97, 65, 105, + 64, 191, 101, 106, 139, 107, 98, 218, 132, 104, + 73, 136, 165, 84, 118, 150, 111, 58, 130, 107, + 99, 136, 132, 56, 52, 102, 136, 69, 78, 163, + 85, 173, 148, 138, 85, 69, 106, 128, 133, 155, + 104, 91, 149, 56, 104, 103, 101, 172, 96, 57, + 104, 97, 125, 197, 166, 107, 169, 47, 120, 103, + 150, 89, 99, 139, 162, 101, 69, 137, 158, 126, + 191, 173, 127, 79, 155, 51, 131, 112, 86, 74, + 135, 61, 114, 81, 125, 117, 112, 72, 175, 72, + 127, 123, 142, 132, 78, 116, 158, 111, 121, 143, + 108, 102, 89, 20, 194, 81, 99, 107, 65, 150, + 103, 78, 91, 69, 96, 104, 116, 116, 103, 105, + 107, 117, 110, 130, 28, 88, 103, 62, 72, 85, + 125, 126, 141, 126, 178, 121, 102, 57, 46, 124, + 97, 91, 89, 138, 95, 98, 143, 99, 169, 123, + 140, 119, 113, 82, 140, 118, 112, 91, 92, 241, + 134, 89, 95, 112, 78, 167, 140, 145, 121, 100, + 109, 205, 144, 91, 100, 113, 103, 142, 175, 95, + 117, 121, 35, 121, 127, 159, 129, 85, 64, 75, + 116, 98, 103, 127, 129, 66, 68, 110, 96, 86, + 79, 100, 156, 133, 92, 135, 96, 164, 132, 121, + 93, 163, 134, 91, 208, 104, 77, 126, 116, 58, + 136, 118, 132, 81, 61, 73, 115, 66, 129, 123, + 111, 85, 42, 178, 134, 108, 132, 159, 45, 157, + 105, 164, 100, 94, 60, 96, 57, 154, 105, 102, + 103, 114, 96, 12, 91, 119, 115, 67, 92, 64, + 94, 61, 106, 106, 165, 105, 94, 98, 68, 30, + 146, 130, 107, 173, 140, 102, 90, 163, 106, 184, + 100, 53, 68, 131, 92, 105, 111, 68, 153, 186, + 101, 82, 48, 99, 147, 122, 136, 176, 96, 96, + 104, 132, 167, 149, 136, 138, 144, 97, 120, 92 +}; + +static const uint8_t wmavoice_dq_lsp16i2[0x3c0] = { + 23, 12, 107, 119, 110, 205, 214, 212, 208, 201, + 102, 95, 69, 117, 107, 118, 123, 118, 123, 121, + 82, 58, 83, 95, 84, 139, 145, 153, 161, 169, + 102, 100, 138, 121, 101, 129, 130, 138, 150, 139, + 76, 104, 86, 112, 133, 113, 91, 63, 73, 129, + 199, 193, 182, 181, 172, 119, 101, 83, 94, 76, + 161, 157, 152, 157, 158, 110, 90, 121, 96, 79, + 124, 107, 114, 88, 73, 152, 137, 121, 107, 99, + 57, 50, 100, 81, 74, 115, 96, 72, 49, 69, + 83, 68, 40, 53, 103, 36, 131, 107, 84, 64, + 236, 245, 242, 231, 213, 95, 109, 88, 69, 110, + 228, 221, 204, 182, 170, 129, 110, 97, 118, 104, + 98, 76, 98, 75, 61, 93, 77, 113, 91, 72, + 116, 94, 106, 134, 118, 177, 188, 169, 162, 153, + 163, 149, 131, 131, 132, 177, 163, 173, 168, 158, + 113, 131, 107, 113, 100, 132, 143, 131, 134, 142, + 45, 36, 121, 113, 102, 43, 95, 84, 67, 56, + 76, 82, 68, 48, 33, 55, 58, 59, 43, 65, + 66, 85, 66, 81, 94, 102, 82, 54, 33, 94, + 113, 111, 89, 60, 34, 138, 120, 101, 101, 86, + 88, 73, 55, 114, 115, 92, 74, 93, 77, 123, + 90, 117, 99, 79, 59, 97, 75, 97, 122, 104, + 233, 237, 227, 208, 190, 209, 230, 233, 240, 241, + 195, 197, 188, 167, 147, 204, 185, 168, 162, 157, + 142, 124, 119, 123, 106, 117, 110, 81, 121, 123, + 74, 116, 124, 119, 120, 178, 168, 146, 132, 125, + 102, 104, 105, 110, 114, 104, 82, 78, 100, 86, + 120, 102, 105, 93, 143, 127, 108, 128, 106, 88, + 177, 189, 203, 207, 215, 101, 131, 119, 95, 73, + 149, 139, 135, 147, 153, 160, 167, 165, 174, 177, + 120, 109, 134, 140, 145, 131, 130, 142, 139, 161, + 143, 158, 148, 145, 145, 123, 142, 132, 116, 102, + 40, 23, 79, 82, 84, 26, 83, 141, 130, 122, + 65, 46, 43, 89, 86, 28, 75, 80, 79, 98, + 84, 65, 47, 26, 44, 49, 112, 101, 100, 94, + 88, 76, 75, 48, 82, 104, 100, 75, 45, 15, + 99, 83, 63, 34, 30, 66, 55, 94, 118, 113, + 122, 106, 91, 68, 60, 135, 122, 104, 77, 59, + 82, 102, 84, 62, 46, 92, 74, 55, 82, 71, + 145, 134, 118, 93, 75, 79, 62, 83, 65, 55, + 91, 94, 64, 70, 98, 89, 117, 110, 87, 97, + 210, 223, 225, 223, 213, 83, 103, 86, 101, 85, + 126, 106, 81, 79, 105, 216, 219, 217, 199, 179, + 86, 78, 115, 138, 135, 102, 84, 87, 59, 46, + 219, 206, 184, 167, 158, 201, 188, 165, 145, 135, + 87, 113, 142, 152, 155, 190, 170, 153, 149, 146, + 205, 208, 201, 185, 167, 84, 73, 124, 104, 96, + 76, 88, 99, 74, 80, 110, 125, 122, 99, 112, + 108, 84, 70, 130, 137, 161, 152, 136, 119, 105, + 110, 91, 101, 74, 96, 111, 101, 93, 153, 149, + 133, 124, 102, 97, 120, 101, 93, 75, 81, 64, + 111, 94, 107, 79, 58, 188, 206, 215, 221, 232, + 163, 175, 165, 150, 136, 103, 106, 123, 133, 132, + 168, 184, 191, 183, 170, 110, 117, 90, 98, 93, + 104, 87, 122, 98, 127, 129, 110, 127, 113, 125, + 134, 118, 102, 140, 132, 186, 199, 202, 198, 188, + 149, 147, 175, 185, 186, 117, 93, 99, 112, 93, + 107, 138, 138, 129, 128, 96, 129, 104, 118, 134, + 145, 136, 115, 121, 129, 138, 155, 148, 134, 120, + 170, 151, 150, 145, 138, 168, 173, 185, 194, 200, + 144, 159, 172, 168, 156, 121, 121, 138, 173, 168, + 126, 111, 140, 139, 117, 149, 133, 142, 137, 130, + 143, 139, 158, 158, 146, 119, 128, 121, 132, 145, + 122, 136, 159, 153, 141, 133, 133, 130, 129, 126, + 120, 76, 50, 149, 109, 92, 155, 118, 90, 66, + 132, 117, 87, 156, 117, 119, 102, 44, 83, 91, + 109, 73, 106, 84, 29, 55, 130, 112, 81, 241, + 75, 40, 91, 89, 67, 112, 90, 149, 81, 72, + 128, 90, 71, 28, 160, 73, 157, 123, 143, 108, + 63, 88, 70, 81, 97, 75, 111, 149, 113, 96, + 78, 104, 83, 179, 95, 105, 106, 65, 130, 66, + 51, 118, 92, 53, 68, 105, 75, 176, 151, 115, + 94, 75, 68, 95, 220, 103, 125, 105, 43, 95, + 39, 114, 65, 145, 135, 33, 142, 138, 103, 52, + 82, 85, 117, 110, 67, 102, 74, 42, 62, 118, + 144, 121, 82, 57, 102, 67, 75, 44, 129, 96, + 75, 63, 88, 48, 116, 135, 94, 85, 102, 66, + 122, 77, 105, 122, 152, 120, 56, 90, 83, 100, + 90, 128, 63, 80, 103, 126, 117, 103, 80, 193, + 42, 73, 117, 93, 91, 95, 128, 100, 128, 162, + 70, 120, 126, 73, 123, 99, 99, 91, 75, 135, + 81, 125, 111, 77, 13, 94, 78, 85, 187, 157, + 11, 143, 109, 99, 119, 53, 141, 82, 122, 68, + 132, 89, 136, 119, 88, 75, 49, 174, 119, 70, + 138, 121, 108, 78, 52, 104, 90, 96, 93, 93, + 114, 90, 78, 46, 58, 62, 114, 69, 44, 162, + 103, 58, 98, 141, 83, 137, 95, 119, 73, 111, + 81, 46, 126, 111, 123, 107, 117, 122, 121, 54, + 106, 104, 59, 110, 148, 97, 155, 97, 83, 133, + 97, 71, 57, 91, 58, 52, 79, 127, 152, 109, + 96, 92, 145, 107, 149, 102, 61, 125, 61, 170, + 56, 89, 77, 106, 38, 147, 96, 77, 105, 123, + 85, 83, 117, 63, 69, 126, 133, 93, 107, 92, + 77, 115, 95, 111, 103, 61, 87, 103, 98, 155, + 94, 111, 80, 78, 54, 117, 128, 130, 99, 109, + 106, 99, 113, 133, 115, 89, 65, 74, 112, 127 +}; + +static const uint8_t wmavoice_dq_lsp16i3[0x300] = { + 70, 100, 121, 129, 132, 132, 201, 188, 165, 145, 144, 136, + 112, 127, 116, 125, 130, 129, 124, 135, 135, 146, 129, 128, + 162, 158, 144, 151, 135, 129, 103, 86, 111, 113, 112, 122, + 90, 139, 129, 117, 126, 129, 142, 145, 167, 147, 124, 124, + 230, 209, 189, 175, 156, 141, 64, 80, 86, 108, 121, 129, + 44, 79, 115, 113, 115, 128, 133, 106, 79, 109, 125, 127, + 171, 156, 132, 109, 103, 115, 106, 70, 93, 145, 141, 128, + 148, 125, 122, 107, 110, 117, 146, 145, 128, 110, 98, 111, + 237, 212, 185, 156, 139, 133, 84, 55, 26, 77, 114, 127, + 172, 170, 171, 168, 162, 143, 82, 82, 76, 70, 104, 126, + 17, 95, 109, 111, 120, 132, 81, 74, 57, 126, 141, 131, + 110, 127, 162, 148, 129, 123, 177, 172, 155, 151, 145, 134, + 144, 123, 90, 66, 109, 130, 82, 127, 103, 123, 132, 131, + 127, 97, 97, 142, 140, 128, 159, 134, 136, 123, 113, 117, + 131, 140, 154, 169, 158, 134, 96, 109, 150, 122, 105, 120, + 120, 150, 152, 122, 119, 125, 123, 126, 124, 107, 100, 113, + 248, 233, 216, 189, 160, 142, 58, 24, 13, 77, 111, 127, + 183, 189, 182, 157, 140, 131, 96, 83, 59, 43, 73, 119, + 222, 196, 171, 146, 129, 128, 32, 13, 53, 101, 114, 127, + 119, 101, 70, 70, 110, 127, 77, 86, 161, 148, 130, 118, + 199, 183, 170, 167, 156, 141, 30, 115, 142, 133, 131, 130, + 101, 103, 181, 176, 152, 126, 66, 44, 73, 94, 111, 128, + 150, 122, 100, 101, 104, 118, 61, 110, 87, 76, 93, 125, + 190, 170, 150, 134, 135, 129, 112, 89, 63, 123, 141, 132, + 175, 154, 136, 142, 140, 132, 117, 143, 129, 128, 136, 132, + 168, 142, 112, 113, 128, 128, 155, 169, 159, 144, 139, 131, + 61, 136, 144, 124, 112, 123, 86, 81, 104, 121, 129, 130, + 160, 127, 118, 150, 151, 134, 126, 115, 121, 132, 134, 131, + 137, 148, 144, 139, 140, 134, 106, 102, 105, 90, 87, 113, + 134, 129, 128, 121, 121, 123, 153, 151, 129, 139, 142, 134, + 150, 142, 141, 148, 149, 141, 100, 121, 133, 147, 150, 134, + 163, 158, 147, 132, 141, 132, 142, 127, 141, 136, 136, 132, + 232, 218, 205, 189, 169, 146, 243, 224, 201, 171, 147, 138, + 224, 196, 169, 162, 154, 140, 51, 20, 59, 111, 121, 128, + 203, 197, 193, 177, 162, 145, 75, 40, 47, 122, 130, 129, + 102, 77, 47, 83, 121, 129, 111, 108, 84, 56, 63, 114, + 211, 181, 154, 137, 126, 125, 213, 198, 186, 162, 144, 138, + 41, 45, 90, 110, 118, 130, 83, 63, 130, 164, 153, 128, + 195, 167, 142, 123, 113, 119, 19, 42, 105, 113, 120, 132, + 50, 63, 49, 64, 112, 128, 114, 90, 132, 171, 162, 134, + 129, 128, 107, 83, 74, 110, 50, 116, 109, 120, 128, 132, + 94, 59, 73, 111, 117, 126, 197, 170, 166, 153, 138, 132, + 65, 48, 109, 133, 131, 128, 170, 163, 172, 158, 138, 130, + 66, 126, 147, 160, 151, 132, 42, 129, 117, 95, 91, 120, + 97, 165, 164, 142, 133, 125, 163, 142, 114, 88, 97, 122, + 104, 77, 142, 143, 128, 120, 136, 160, 188, 169, 149, 130, + 113, 83, 85, 102, 114, 125, 164, 169, 142, 120, 122, 124, + 98, 152, 132, 105, 92, 117, 42, 71, 125, 155, 151, 137, + 94, 105, 81, 107, 118, 126, 84, 56, 123, 117, 108, 122, + 174, 179, 166, 137, 118, 121, 130, 103, 147, 152, 134, 124, + 148, 127, 94, 117, 144, 134, 129, 106, 102, 95, 106, 118, + 147, 157, 153, 125, 103, 117, 155, 128, 113, 132, 120, 122, + 181, 151, 136, 126, 122, 122, 110, 111, 109, 108, 120, 124, + 97, 130, 103, 89, 107, 124, 179, 158, 158, 142, 131, 128, + 142, 111, 115, 122, 126, 125, 145, 145, 134, 115, 129, 128, + 130, 139, 112, 99, 121, 125, 79, 104, 119, 102, 105, 123, + 116, 121, 136, 125, 126, 127, 124, 100, 122, 119, 111, 119, + 159, 140, 139, 128, 138, 131, 105, 100, 116, 128, 135, 132, + 159, 142, 156, 147, 140, 134, 130, 150, 129, 126, 114, 120, + 138, 124, 146, 131, 109, 119, 93, 115, 125, 131, 125, 129, + 125, 121, 101, 119, 114, 120, 163, 154, 151, 153, 153, 139, + 166, 153, 150, 133, 119, 121, 159, 151, 128, 130, 122, 123, + 147, 154, 144, 133, 128, 127, 129, 131, 134, 140, 148, 138, + 138, 136, 120, 131, 135, 131, 150, 140, 137, 144, 129, 129 +}; + +static const uint8_t wmavoice_dq_lsp10r[0x1400] = { + 128, 128, 129, 129, 130, 130, 131, 130, 129, 129, + 134, 133, 127, 125, 136, 135, 135, 134, 173, 172, + 133, 139, 136, 165, 133, 176, 137, 159, 135, 152, + 147, 161, 147, 152, 149, 156, 146, 146, 140, 136, + 134, 135, 136, 140, 139, 155, 123, 133, 132, 142, + 132, 148, 143, 177, 124, 143, 123, 136, 126, 134, + 126, 125, 125, 124, 129, 128, 123, 123, 133, 133, + 116, 116, 121, 121, 121, 120, 129, 128, 131, 131, + 132, 133, 132, 129, 138, 124, 138, 124, 132, 100, + 135, 94, 149, 111, 152, 115, 150, 128, 141, 133, + 129, 129, 130, 129, 147, 145, 136, 137, 120, 122, + 120, 122, 127, 129, 104, 108, 113, 115, 124, 124, + 140, 139, 147, 145, 132, 130, 184, 177, 201, 196, + 170, 171, 160, 161, 145, 147, 137, 145, 131, 131, + 130, 130, 130, 130, 130, 130, 132, 134, 131, 132, + 131, 133, 141, 144, 142, 149, 84, 93, 103, 104, + 139, 139, 142, 140, 147, 147, 172, 165, 122, 121, + 98, 100, 101, 106, 112, 117, 122, 124, 124, 124, + 134, 133, 133, 133, 146, 142, 147, 145, 156, 156, + 143, 146, 119, 124, 129, 132, 151, 149, 136, 135, + 147, 148, 181, 180, 199, 188, 190, 173, 166, 161, + 147, 142, 153, 149, 154, 146, 150, 146, 138, 134, + 131, 135, 96, 136, 48, 138, 56, 131, 63, 124, + 85, 128, 103, 132, 117, 134, 120, 132, 125, 129, + 131, 130, 129, 128, 129, 128, 163, 168, 117, 120, + 121, 121, 136, 138, 131, 132, 135, 136, 131, 133, + 133, 133, 133, 134, 117, 118, 105, 109, 142, 151, + 144, 159, 131, 138, 121, 126, 123, 123, 121, 124, + 131, 131, 129, 129, 141, 140, 142, 134, 87, 90, + 109, 109, 130, 127, 139, 143, 133, 131, 127, 126, + 134, 135, 134, 136, 97, 98, 130, 132, 134, 137, + 115, 119, 125, 130, 107, 109, 119, 118, 126, 127, + 134, 135, 127, 132, 172, 203, 160, 196, 152, 179, + 152, 172, 148, 168, 153, 172, 145, 156, 137, 140, + 102, 116, 42, 56, 74, 61, 82, 70, 86, 78, + 101, 97, 104, 100, 115, 108, 116, 108, 123, 118, + 149, 143, 166, 129, 168, 96, 142, 95, 135, 98, + 117, 86, 116, 93, 121, 108, 119, 107, 121, 117, + 135, 135, 127, 138, 72, 132, 99, 136, 112, 147, + 120, 152, 136, 155, 138, 146, 140, 142, 134, 139, + 163, 145, 192, 130, 147, 124, 147, 125, 133, 125, + 127, 124, 128, 123, 129, 122, 130, 122, 130, 125, + 130, 137, 135, 180, 124, 133, 130, 129, 132, 133, + 124, 124, 131, 130, 132, 136, 126, 124, 127, 125, + 132, 132, 133, 133, 144, 140, 143, 142, 137, 135, + 143, 138, 152, 149, 221, 219, 158, 161, 143, 141, + 130, 129, 140, 135, 170, 145, 193, 156, 186, 152, + 167, 139, 151, 131, 142, 127, 134, 120, 131, 125, + 135, 133, 141, 125, 199, 109, 137, 126, 134, 123, + 130, 129, 132, 123, 128, 125, 122, 126, 125, 125, + 130, 128, 91, 89, 138, 135, 139, 134, 133, 129, + 132, 130, 125, 128, 136, 135, 129, 127, 126, 126, + 132, 131, 133, 131, 128, 120, 132, 126, 126, 119, + 134, 130, 131, 123, 104, 95, 140, 141, 136, 137, + 133, 133, 133, 134, 117, 98, 74, 49, 112, 111, + 123, 122, 126, 127, 131, 131, 127, 126, 128, 129, + 130, 131, 124, 127, 101, 107, 108, 109, 115, 115, + 100, 99, 130, 128, 134, 136, 125, 127, 128, 130, + 136, 137, 145, 150, 149, 164, 136, 151, 114, 111, + 124, 125, 143, 150, 162, 174, 158, 169, 136, 137, + 131, 131, 131, 131, 132, 133, 111, 110, 122, 121, + 136, 136, 134, 133, 131, 132, 127, 127, 125, 125, + 128, 129, 129, 130, 125, 127, 140, 140, 148, 149, + 133, 136, 146, 153, 110, 118, 127, 129, 128, 129, + 131, 133, 127, 131, 140, 161, 167, 224, 131, 139, + 136, 143, 135, 139, 138, 143, 149, 155, 141, 143, + 134, 132, 120, 111, 83, 83, 121, 126, 102, 107, + 112, 115, 97, 104, 120, 115, 129, 123, 122, 122, + 134, 135, 122, 131, 102, 124, 114, 119, 93, 103, + 78, 79, 67, 72, 66, 73, 78, 82, 103, 102, + 144, 135, 165, 139, 165, 129, 160, 126, 153, 127, + 161, 134, 160, 142, 160, 143, 148, 140, 138, 135, + 138, 95, 147, 54, 143, 78, 140, 112, 142, 113, + 140, 121, 135, 117, 135, 122, 136, 131, 131, 132, + 147, 159, 140, 156, 127, 81, 142, 128, 146, 127, + 144, 125, 146, 128, 149, 130, 144, 135, 133, 128, + 130, 131, 131, 131, 134, 139, 126, 134, 141, 154, + 168, 205, 153, 176, 148, 163, 147, 158, 141, 143, + 131, 135, 126, 146, 108, 157, 107, 156, 119, 146, + 100, 138, 104, 125, 119, 134, 101, 122, 113, 122, + 95, 133, 52, 140, 83, 136, 110, 133, 114, 131, + 123, 131, 133, 131, 138, 135, 132, 132, 127, 127, + 129, 128, 124, 122, 128, 126, 145, 170, 143, 172, + 141, 163, 143, 176, 138, 164, 139, 155, 135, 145, + 135, 136, 136, 127, 132, 76, 128, 76, 127, 63, + 125, 66, 123, 67, 120, 71, 124, 92, 122, 111, + 133, 133, 135, 136, 139, 140, 147, 147, 150, 144, + 156, 147, 150, 145, 154, 146, 120, 123, 123, 124, + 137, 133, 170, 141, 124, 124, 135, 134, 134, 135, + 132, 132, 129, 129, 130, 130, 136, 136, 130, 132, + 147, 159, 135, 158, 115, 146, 120, 148, 117, 136, + 115, 137, 113, 132, 133, 142, 140, 144, 132, 134, + 134, 135, 134, 137, 137, 147, 162, 178, 136, 147, + 134, 144, 123, 132, 111, 113, 113, 113, 124, 124, + 132, 131, 126, 126, 117, 114, 100, 95, 130, 125, + 157, 145, 164, 156, 163, 158, 145, 145, 133, 134, + 134, 134, 127, 126, 113, 102, 136, 130, 124, 122, + 143, 145, 127, 131, 135, 143, 133, 137, 132, 132, + 92, 94, 122, 125, 128, 129, 131, 130, 134, 135, + 132, 128, 129, 127, 132, 132, 131, 129, 127, 127, + 129, 129, 132, 131, 139, 131, 137, 132, 216, 178, + 146, 134, 147, 137, 151, 142, 148, 139, 144, 138, + 128, 127, 129, 129, 123, 131, 71, 91, 126, 128, + 130, 134, 117, 123, 125, 125, 135, 140, 129, 132, + 132, 132, 133, 134, 124, 130, 127, 133, 133, 138, + 142, 149, 135, 141, 145, 149, 154, 164, 135, 138, + 135, 135, 141, 142, 138, 137, 116, 96, 105, 86, + 127, 118, 128, 120, 124, 117, 125, 117, 125, 121, + 131, 131, 132, 134, 144, 145, 112, 112, 121, 123, + 113, 116, 121, 123, 139, 138, 128, 128, 131, 131, + 134, 132, 132, 132, 125, 128, 127, 130, 125, 131, + 120, 128, 90, 119, 68, 98, 99, 112, 115, 124, + 135, 135, 134, 134, 128, 129, 137, 137, 137, 138, + 110, 114, 129, 130, 144, 145, 123, 125, 129, 129, + 132, 133, 129, 130, 168, 187, 140, 149, 137, 144, + 129, 130, 129, 134, 133, 138, 118, 118, 122, 120, + 131, 130, 129, 128, 133, 133, 125, 125, 124, 123, + 181, 179, 129, 129, 131, 127, 139, 136, 130, 128, + 133, 133, 132, 132, 121, 120, 122, 119, 132, 129, + 129, 125, 107, 96, 136, 137, 150, 146, 135, 134, + 131, 131, 130, 130, 126, 123, 126, 123, 128, 125, + 130, 123, 134, 127, 183, 159, 143, 135, 137, 134, + 129, 129, 128, 128, 134, 133, 139, 138, 133, 132, + 129, 127, 154, 151, 150, 144, 146, 146, 141, 142, + 132, 132, 131, 131, 130, 130, 132, 133, 114, 115, + 132, 132, 122, 122, 132, 131, 115, 117, 120, 120, + 129, 129, 130, 130, 130, 129, 130, 131, 129, 131, + 130, 130, 129, 129, 133, 132, 143, 144, 91, 91, + 137, 136, 118, 107, 60, 45, 56, 49, 57, 52, + 60, 56, 71, 75, 77, 80, 92, 97, 106, 106, + 112, 131, 58, 121, 19, 65, 84, 101, 108, 122, + 121, 127, 112, 117, 106, 112, 117, 124, 126, 127, + 130, 129, 138, 133, 166, 155, 192, 179, 192, 177, + 208, 191, 204, 192, 186, 179, 163, 163, 138, 142, + 134, 134, 144, 142, 243, 236, 148, 146, 141, 137, + 145, 141, 151, 144, 147, 143, 135, 139, 134, 133, + 134, 128, 138, 88, 142, 10, 127, 76, 130, 96, + 129, 102, 128, 108, 123, 111, 127, 119, 127, 124, + 136, 136, 139, 139, 142, 140, 246, 241, 158, 167, + 143, 145, 146, 149, 143, 145, 148, 152, 133, 134, + 139, 135, 135, 136, 99, 137, 95, 133, 75, 138, + 67, 135, 73, 128, 83, 132, 96, 126, 115, 127, + 130, 132, 137, 136, 140, 135, 134, 130, 137, 131, + 159, 151, 215, 197, 181, 170, 160, 149, 150, 143, + 145, 148, 186, 207, 141, 147, 135, 137, 122, 122, + 126, 125, 128, 126, 127, 127, 134, 126, 131, 123, + 133, 133, 126, 122, 128, 122, 99, 93, 59, 60, + 82, 82, 106, 107, 119, 123, 124, 128, 128, 129, + 134, 137, 133, 139, 133, 136, 141, 132, 139, 122, + 142, 97, 130, 81, 128, 89, 129, 101, 125, 112, + 137, 140, 129, 148, 101, 159, 118, 180, 122, 178, + 120, 178, 116, 168, 118, 153, 127, 151, 126, 136, + 132, 134, 125, 126, 118, 105, 156, 124, 180, 132, + 163, 124, 148, 121, 131, 112, 127, 115, 125, 122, + 129, 131, 128, 129, 136, 134, 142, 141, 165, 158, + 203, 182, 141, 136, 132, 130, 135, 135, 130, 130, + 133, 133, 132, 132, 127, 126, 106, 105, 112, 110, + 106, 105, 80, 84, 100, 101, 122, 125, 126, 128, + 101, 109, 46, 59, 114, 112, 119, 119, 126, 121, + 129, 124, 128, 125, 125, 122, 123, 120, 125, 122, + 135, 134, 121, 134, 56, 139, 131, 145, 135, 138, + 136, 139, 126, 130, 122, 132, 126, 129, 124, 129, + 153, 169, 146, 179, 138, 139, 151, 143, 148, 138, + 153, 137, 142, 129, 144, 126, 140, 128, 133, 126, + 136, 134, 154, 149, 173, 157, 152, 144, 149, 141, + 137, 136, 127, 121, 123, 121, 121, 126, 120, 123, + 157, 143, 166, 135, 120, 122, 112, 118, 102, 118, + 111, 124, 134, 131, 141, 138, 135, 134, 126, 129, + 140, 123, 152, 76, 131, 116, 138, 136, 126, 134, + 130, 142, 126, 136, 120, 132, 126, 128, 124, 127, + 131, 138, 80, 147, 126, 138, 130, 140, 129, 134, + 133, 135, 131, 132, 126, 127, 127, 125, 125, 123, + 132, 132, 130, 132, 123, 130, 102, 102, 107, 110, + 116, 127, 132, 152, 142, 160, 143, 151, 142, 146, + 132, 132, 132, 132, 125, 126, 132, 140, 158, 199, + 135, 149, 134, 140, 135, 131, 129, 120, 127, 121, + 129, 130, 122, 123, 125, 124, 138, 138, 138, 135, + 140, 141, 101, 94, 105, 98, 121, 122, 127, 128, + 126, 127, 119, 121, 133, 156, 132, 159, 130, 148, + 137, 164, 127, 138, 130, 137, 135, 140, 126, 126, + 128, 129, 129, 129, 126, 124, 130, 128, 143, 138, + 149, 143, 185, 170, 129, 127, 138, 133, 138, 135, + 132, 134, 137, 144, 139, 183, 131, 145, 127, 128, + 128, 127, 128, 122, 129, 125, 145, 139, 135, 131, + 132, 133, 132, 130, 152, 96, 159, 85, 150, 105, + 154, 115, 143, 120, 138, 126, 134, 124, 130, 126, + 128, 127, 121, 123, 122, 123, 116, 125, 84, 87, + 133, 135, 129, 131, 123, 126, 133, 135, 131, 130, + 136, 134, 129, 119, 79, 63, 116, 116, 136, 133, + 133, 130, 140, 143, 127, 127, 124, 125, 127, 128, + 128, 126, 124, 120, 139, 128, 153, 134, 151, 134, + 174, 145, 159, 136, 165, 144, 171, 149, 143, 135, + 134, 134, 133, 133, 121, 119, 177, 162, 166, 154, + 127, 130, 132, 132, 136, 137, 142, 143, 138, 137, + 167, 151, 162, 142, 128, 136, 142, 148, 128, 143, + 145, 153, 140, 149, 132, 141, 128, 139, 127, 133, + 156, 169, 131, 129, 126, 120, 127, 125, 129, 120, + 131, 126, 126, 123, 124, 121, 122, 121, 123, 123, + 138, 140, 149, 156, 145, 152, 105, 102, 131, 126, + 151, 146, 147, 139, 144, 137, 143, 133, 135, 130, + 132, 130, 131, 129, 126, 130, 126, 129, 110, 135, + 115, 139, 108, 146, 105, 147, 121, 134, 124, 133, + 137, 137, 135, 134, 143, 142, 146, 146, 120, 121, + 139, 137, 133, 129, 149, 145, 139, 133, 130, 127, + 134, 134, 134, 134, 125, 124, 117, 119, 120, 113, + 84, 80, 122, 125, 108, 112, 97, 102, 118, 120, + 124, 123, 115, 116, 110, 111, 98, 97, 127, 124, + 129, 127, 120, 117, 114, 109, 106, 104, 116, 116, + 138, 138, 139, 141, 142, 146, 127, 125, 133, 130, + 134, 128, 134, 127, 116, 91, 105, 84, 114, 106, + 128, 128, 126, 126, 131, 137, 126, 129, 133, 139, + 134, 145, 132, 143, 150, 192, 131, 142, 138, 141, + 132, 130, 132, 130, 149, 138, 196, 152, 137, 125, + 134, 125, 139, 128, 133, 125, 141, 134, 134, 135, + 134, 135, 134, 135, 131, 130, 136, 133, 110, 106, + 142, 144, 153, 162, 131, 129, 134, 132, 131, 130, + 126, 125, 132, 130, 168, 153, 126, 124, 130, 126, + 140, 135, 140, 134, 138, 133, 145, 137, 135, 134, + 130, 130, 132, 131, 133, 132, 129, 129, 125, 128, + 128, 130, 133, 139, 143, 152, 193, 215, 152, 160, + 130, 131, 129, 131, 130, 131, 135, 136, 136, 141, + 83, 81, 121, 120, 136, 130, 150, 145, 147, 145, + 134, 133, 135, 133, 146, 142, 135, 131, 127, 128, + 134, 135, 93, 102, 126, 132, 131, 133, 127, 129, + 124, 125, 120, 122, 103, 106, 128, 129, 139, 138, + 127, 128, 134, 134, 143, 138, 139, 134, 135, 133, + 131, 130, 133, 131, 139, 134, 138, 136, 166, 156, + 119, 116, 121, 122, 126, 124, 116, 117, 123, 124, + 131, 131, 129, 129, 130, 128, 141, 138, 135, 132, + 154, 145, 137, 129, 131, 125, 146, 137, 138, 135, + 131, 131, 131, 132, 129, 130, 134, 138, 111, 116, + 113, 118, 123, 125, 122, 124, 143, 147, 138, 140, + 116, 113, 114, 112, 130, 126, 117, 115, 127, 126, + 139, 137, 141, 139, 131, 132, 143, 144, 139, 140, + 130, 130, 129, 128, 136, 134, 119, 117, 152, 143, + 155, 143, 120, 119, 142, 139, 124, 130, 126, 128, + 112, 110, 112, 109, 136, 132, 125, 118, 121, 115, + 103, 101, 109, 100, 125, 120, 121, 117, 122, 121, + 128, 128, 127, 127, 124, 124, 128, 127, 131, 129, + 142, 138, 147, 141, 115, 108, 113, 109, 122, 119, + 136, 133, 150, 139, 142, 131, 119, 111, 151, 137, + 121, 116, 146, 134, 137, 129, 121, 123, 127, 129, + 130, 130, 130, 130, 136, 137, 126, 126, 136, 136, + 133, 133, 139, 139, 142, 143, 119, 120, 134, 134, + 132, 132, 133, 133, 135, 138, 129, 131, 133, 134, + 135, 138, 126, 130, 117, 118, 131, 132, 135, 135, + 129, 129, 128, 128, 126, 129, 127, 129, 123, 125, + 115, 117, 156, 157, 127, 131, 129, 129, 128, 129, + 129, 130, 131, 131, 126, 127, 135, 134, 136, 135, + 140, 136, 117, 113, 132, 128, 104, 97, 109, 106, + 131, 131, 131, 131, 121, 123, 124, 125, 126, 127, + 127, 127, 135, 135, 128, 128, 130, 130, 141, 140, + 129, 129, 129, 129, 129, 127, 127, 125, 149, 146, + 125, 123, 134, 133, 134, 132, 152, 150, 138, 138, + 128, 128, 126, 125, 132, 133, 141, 143, 136, 136, + 126, 127, 126, 127, 129, 131, 128, 129, 135, 134, + 176, 139, 192, 135, 145, 122, 149, 117, 155, 134, + 169, 133, 157, 139, 142, 136, 151, 152, 142, 147, + 166, 174, 103, 107, 141, 134, 140, 136, 144, 135, + 147, 135, 156, 131, 153, 127, 133, 126, 130, 124, + 127, 130, 123, 124, 114, 105, 195, 193, 156, 157, + 165, 158, 126, 122, 149, 141, 174, 173, 152, 147, + 136, 139, 131, 138, 163, 169, 103, 124, 80, 102, + 153, 186, 121, 151, 134, 161, 156, 190, 141, 151, + 121, 123, 124, 127, 119, 127, 133, 134, 157, 156, + 81, 69, 136, 134, 160, 169, 118, 114, 135, 128, + 114, 116, 97, 97, 117, 122, 152, 161, 115, 121, + 106, 122, 135, 137, 111, 113, 125, 135, 141, 145, + 143, 146, 143, 150, 132, 136, 142, 150, 151, 167, + 101, 107, 155, 173, 112, 124, 105, 100, 128, 126, + 127, 130, 133, 134, 142, 121, 131, 116, 176, 145, + 161, 120, 209, 150, 196, 133, 147, 115, 149, 130, + 144, 145, 144, 145, 120, 119, 163, 160, 117, 118, + 123, 117, 154, 119, 193, 98, 149, 101, 137, 116, + 133, 135, 140, 143, 144, 156, 131, 146, 186, 201, + 140, 139, 123, 125, 158, 169, 157, 166, 142, 143, + 130, 131, 132, 132, 128, 128, 141, 142, 147, 149, + 145, 148, 137, 139, 129, 129, 107, 108, 157, 157, + 120, 121, 119, 119, 140, 132, 137, 131, 118, 113, + 143, 136, 134, 135, 164, 158, 133, 125, 127, 124, + 148, 122, 197, 130, 173, 145, 110, 139, 123, 165, + 83, 158, 90, 167, 93, 142, 136, 169, 134, 152, + 130, 126, 154, 138, 227, 150, 156, 114, 147, 114, + 142, 109, 135, 110, 166, 135, 176, 150, 152, 142, + 132, 132, 136, 136, 130, 135, 143, 152, 136, 144, + 152, 160, 177, 185, 112, 112, 165, 166, 160, 161, + 145, 145, 138, 139, 116, 118, 127, 131, 66, 80, + 132, 142, 119, 127, 101, 108, 120, 130, 126, 130, + 135, 135, 142, 139, 153, 137, 55, 30, 142, 139, + 139, 143, 135, 133, 129, 133, 109, 108, 129, 129, + 136, 135, 134, 131, 129, 132, 132, 134, 135, 149, + 79, 206, 123, 137, 135, 143, 130, 140, 131, 134, + 100, 99, 165, 164, 142, 123, 148, 133, 133, 122, + 142, 133, 138, 125, 119, 111, 129, 123, 137, 130, + 131, 132, 123, 129, 174, 185, 196, 181, 127, 111, + 156, 141, 132, 114, 129, 106, 132, 107, 126, 117, + 134, 140, 131, 136, 119, 146, 92, 246, 128, 132, + 125, 129, 132, 140, 128, 141, 126, 145, 137, 142, + 130, 130, 110, 115, 124, 139, 127, 151, 118, 152, + 98, 146, 36, 108, 126, 158, 112, 146, 112, 130, + 138, 136, 145, 138, 153, 145, 116, 125, 90, 103, + 137, 138, 189, 185, 141, 151, 86, 93, 111, 111, + 133, 171, 125, 209, 140, 132, 130, 134, 129, 101, + 142, 120, 142, 132, 135, 126, 141, 140, 140, 134, + 128, 123, 131, 123, 138, 118, 163, 133, 240, 197, + 176, 151, 126, 123, 81, 94, 109, 118, 124, 133, + 135, 133, 137, 134, 154, 135, 140, 155, 69, 190, + 119, 149, 141, 151, 142, 123, 135, 125, 129, 130, + 127, 125, 132, 127, 107, 80, 123, 103, 145, 131, + 133, 107, 140, 103, 135, 106, 170, 145, 159, 143, + 136, 137, 127, 130, 105, 119, 129, 134, 141, 151, + 116, 127, 119, 140, 75, 119, 152, 162, 149, 152, + 72, 138, 9, 143, 118, 160, 126, 134, 141, 147, + 135, 131, 129, 129, 135, 129, 136, 126, 133, 125, + 137, 135, 146, 141, 145, 139, 141, 140, 133, 130, + 213, 208, 139, 130, 139, 136, 117, 117, 126, 125, + 133, 130, 138, 131, 141, 100, 145, 93, 159, 121, + 144, 132, 117, 160, 102, 187, 99, 162, 117, 144, + 132, 132, 134, 134, 140, 141, 127, 126, 128, 131, + 116, 116, 121, 127, 119, 126, 114, 114, 99, 100, + 141, 144, 148, 159, 179, 224, 95, 131, 100, 125, + 87, 110, 112, 132, 134, 147, 111, 125, 122, 122, + 137, 140, 141, 129, 169, 12, 144, 132, 133, 144, + 141, 146, 137, 147, 136, 122, 133, 130, 131, 128, + 141, 142, 128, 139, 15, 69, 160, 159, 142, 130, + 137, 126, 159, 141, 145, 143, 128, 125, 134, 128, + 131, 130, 127, 127, 114, 104, 119, 98, 83, 68, + 139, 120, 173, 142, 199, 154, 191, 153, 158, 145, + 128, 130, 127, 127, 148, 150, 110, 99, 119, 109, + 120, 113, 163, 154, 110, 90, 138, 129, 149, 144, + 131, 134, 124, 142, 76, 217, 130, 129, 140, 138, + 133, 135, 145, 150, 136, 138, 127, 130, 130, 134, + 144, 119, 178, 70, 143, 130, 115, 136, 139, 138, + 129, 109, 136, 116, 147, 122, 126, 112, 126, 123, + 132, 139, 128, 144, 107, 156, 75, 163, 120, 164, + 151, 136, 151, 99, 160, 112, 159, 126, 143, 126, + 140, 138, 137, 135, 152, 108, 251, 85, 138, 116, + 137, 118, 141, 119, 136, 121, 150, 134, 138, 131, + 137, 137, 143, 144, 150, 153, 148, 154, 152, 151, + 117, 104, 124, 96, 93, 67, 146, 138, 149, 148, + 149, 153, 172, 193, 108, 114, 125, 128, 145, 165, + 149, 160, 121, 130, 115, 120, 110, 112, 121, 118, + 145, 146, 141, 142, 127, 127, 103, 95, 138, 143, + 114, 126, 109, 115, 143, 136, 153, 149, 144, 142, + 140, 138, 150, 144, 128, 116, 142, 136, 135, 122, + 93, 88, 164, 163, 141, 142, 171, 182, 154, 160, + 124, 125, 122, 123, 158, 155, 111, 97, 138, 130, + 157, 134, 101, 65, 129, 118, 121, 114, 124, 119, + 131, 133, 125, 129, 136, 147, 135, 152, 131, 133, + 110, 115, 118, 114, 161, 159, 233, 218, 172, 166, + 140, 107, 125, 0, 140, 103, 140, 115, 125, 113, + 132, 135, 128, 133, 138, 146, 131, 145, 127, 133, + 131, 131, 122, 122, 135, 132, 126, 124, 132, 133, + 164, 167, 121, 127, 117, 120, 167, 162, 145, 143, + 135, 134, 136, 134, 156, 146, 195, 177, 127, 139, + 108, 140, 141, 173, 141, 178, 131, 155, 129, 141, + 134, 134, 119, 114, 184, 184, 127, 126, 147, 151, + 130, 140, 146, 159, 134, 145, 131, 136, 137, 142, + 135, 137, 128, 136, 83, 108, 97, 98, 152, 119, + 207, 144, 142, 121, 144, 129, 131, 127, 130, 132, + 124, 125, 108, 107, 94, 116, 81, 114, 139, 173, + 131, 158, 145, 177, 141, 163, 136, 140, 143, 144, + 135, 141, 132, 136, 134, 142, 142, 136, 173, 50, + 143, 106, 142, 127, 134, 139, 127, 133, 125, 125, + 129, 130, 131, 133, 132, 148, 110, 138, 113, 135, + 138, 175, 108, 151, 55, 119, 51, 100, 93, 116, + 121, 121, 146, 151, 99, 120, 127, 137, 107, 122, + 125, 139, 110, 132, 135, 156, 141, 156, 148, 157, + 137, 137, 141, 140, 139, 137, 130, 128, 138, 136, + 132, 134, 115, 110, 177, 179, 81, 86, 100, 98, + 84, 83, 121, 121, 148, 157, 127, 133, 146, 156, + 127, 136, 143, 151, 135, 139, 138, 142, 136, 136, + 201, 164, 151, 129, 123, 136, 147, 148, 127, 142, + 128, 143, 101, 126, 119, 133, 114, 131, 116, 126, + 132, 133, 140, 140, 126, 125, 156, 153, 142, 129, + 140, 130, 77, 69, 134, 132, 146, 148, 135, 136, + 133, 132, 123, 116, 116, 103, 150, 135, 144, 127, + 130, 117, 136, 122, 122, 106, 48, 38, 81, 78, + 145, 146, 135, 136, 123, 122, 126, 133, 133, 138, + 145, 145, 144, 150, 160, 181, 142, 139, 150, 150, + 136, 136, 139, 139, 133, 133, 139, 135, 134, 129, + 140, 137, 153, 145, 132, 131, 151, 144, 68, 66, + 137, 137, 139, 139, 146, 146, 142, 139, 129, 128, + 131, 129, 133, 132, 135, 134, 135, 134, 201, 200, + 137, 136, 146, 143, 155, 153, 157, 158, 131, 138, + 140, 139, 143, 144, 128, 123, 216, 192, 159, 150, + 137, 138, 136, 142, 145, 148, 126, 162, 140, 170, + 186, 95, 131, 140, 143, 148, 133, 128, 130, 133, + 141, 139, 153, 150, 122, 122, 134, 144, 124, 130, + 159, 166, 133, 139, 151, 150, 138, 139, 131, 134, + 121, 121, 131, 129, 148, 180, 121, 135, 118, 131, + 124, 148, 119, 119, 129, 126, 150, 156, 155, 160, + 40, 154, 115, 157, 133, 129, 140, 133, 143, 133, + 143, 132, 144, 130, 141, 131, 134, 130, 137, 133, + 134, 136, 141, 140, 145, 137, 152, 124, 183, 91, + 118, 154, 123, 158, 136, 134, 140, 142, 138, 142, + 138, 135, 131, 131, 138, 129, 121, 128, 146, 219, + 124, 123, 125, 135, 120, 126, 127, 141, 133, 136, + 127, 124, 120, 107, 152, 125, 149, 108, 158, 144, + 196, 185, 174, 164, 151, 149, 138, 131, 140, 137, + 149, 148, 144, 145, 143, 145, 140, 143, 141, 147, + 112, 125, 113, 113, 149, 155, 143, 149, 146, 151, + 138, 138, 141, 138, 144, 129, 134, 125, 143, 140, + 153, 154, 142, 123, 162, 42, 154, 106, 153, 130, + 153, 153, 137, 137, 144, 144, 142, 140, 165, 151, + 161, 140, 144, 134, 156, 124, 167, 143, 166, 155, + 132, 132, 137, 138, 137, 132, 124, 127, 140, 144, + 134, 140, 162, 180, 127, 131, 152, 169, 145, 156, + 133, 134, 131, 133, 130, 132, 147, 149, 125, 117, + 127, 118, 159, 155, 147, 142, 122, 117, 145, 144, + 138, 137, 130, 133, 113, 149, 168, 224, 166, 201, + 129, 151, 147, 154, 136, 135, 140, 136, 152, 141, + 120, 112, 140, 127, 161, 100, 132, 115, 118, 125, + 115, 133, 115, 157, 144, 146, 114, 135, 127, 139, + 138, 141, 135, 135, 137, 136, 147, 142, 143, 144, + 139, 152, 142, 136, 147, 143, 177, 39, 125, 71, + 147, 143, 66, 88, 132, 158, 123, 126, 116, 135, + 119, 124, 128, 135, 133, 140, 137, 126, 137, 130, + 155, 38, 149, 103, 130, 135, 139, 143, 127, 137, + 135, 141, 138, 148, 131, 148, 136, 147, 132, 139, + 136, 140, 115, 129, 115, 151, 136, 160, 87, 131, + 157, 176, 150, 164, 140, 141, 135, 119, 137, 133, + 141, 140, 140, 139, 134, 134, 142, 144, 131, 132, + 131, 134, 131, 132, 116, 114, 129, 133, 205, 207, + 130, 133, 160, 170, 137, 127, 124, 112, 158, 146, + 155, 137, 134, 136, 137, 142, 177, 184, 149, 152, + 135, 134, 133, 132, 135, 129, 144, 136, 139, 134, + 161, 155, 126, 109, 215, 186, 177, 153, 160, 149, + 139, 139, 136, 140, 140, 142, 186, 71, 129, 144, + 131, 165, 142, 152, 140, 151, 141, 143, 137, 139, + 144, 138, 150, 135, 133, 126, 136, 143, 99, 152, + 139, 131, 190, 118, 122, 147, 134, 155, 136, 143, + 138, 135, 137, 132, 147, 144, 150, 144, 138, 134, + 129, 133, 130, 138, 56, 175, 129, 166, 147, 165, + 140, 138, 144, 137, 141, 133, 150, 139, 129, 135, + 40, 83, 126, 130, 110, 120, 100, 110, 126, 128, + 141, 142, 217, 175, 172, 151, 146, 153, 125, 132, + 128, 137, 141, 141, 145, 145, 140, 133, 132, 131, + 129, 144, 128, 177, 133, 195, 147, 120, 138, 131, + 161, 114, 166, 134, 162, 118, 161, 115, 155, 129, + 137, 136, 141, 129, 141, 132, 55, 168, 121, 126, + 136, 139, 120, 133, 149, 147, 132, 141, 131, 136, + 147, 150, 151, 132, 101, 31, 117, 101, 129, 132, + 122, 138, 128, 137, 140, 170, 131, 143, 131, 134, + 149, 192, 122, 158, 136, 146, 133, 166, 143, 141, + 141, 136, 141, 129, 125, 155, 140, 138, 137, 131, + 111, 112, 131, 132, 120, 127, 149, 148, 151, 141, + 156, 148, 133, 129, 127, 124, 144, 137, 142, 139, + 134, 133, 141, 138, 133, 135, 124, 96, 226, 152, + 116, 108, 128, 105, 155, 130, 153, 138, 144, 139, + 142, 141, 137, 135, 142, 143, 156, 162, 136, 89, + 188, 145, 181, 152, 138, 146, 146, 154, 145, 149, + 152, 133, 158, 133, 42, 153, 117, 144, 149, 139, + 125, 139, 134, 128, 150, 128, 143, 125, 135, 132, + 143, 141, 143, 141, 164, 173, 141, 142, 156, 155, + 154, 154, 169, 170, 77, 80, 112, 105, 135, 134, + 126, 143, 120, 172, 111, 144, 120, 154, 107, 153, + 95, 134, 104, 134, 128, 116, 163, 131, 151, 136, + 135, 133, 142, 143, 152, 204, 149, 112, 156, 128, + 150, 126, 127, 129, 139, 175, 143, 141, 138, 135, + 168, 148, 152, 105, 164, 121, 134, 122, 119, 109, + 122, 148, 136, 143, 153, 132, 158, 148, 149, 150, + 133, 131, 142, 141, 150, 149, 156, 173, 138, 155, + 129, 144, 111, 107, 130, 129, 96, 89, 106, 104, + 135, 135, 144, 146, 131, 153, 134, 154, 146, 166, + 117, 138, 163, 187, 190, 216, 149, 156, 149, 152, + 142, 142, 153, 154, 109, 145, 40, 102, 116, 126, + 137, 139, 149, 157, 108, 124, 139, 146, 142, 147, + 130, 126, 120, 111, 172, 146, 169, 136, 150, 135, + 126, 96, 159, 143, 150, 122, 162, 129, 156, 142, + 135, 142, 144, 138, 222, 109, 137, 145, 144, 142, + 141, 143, 138, 136, 124, 150, 133, 144, 137, 145, + 141, 144, 139, 144, 134, 154, 114, 136, 145, 173, + 151, 215, 110, 115, 127, 134, 145, 150, 145, 144, + 144, 142, 139, 131, 147, 132, 141, 119, 143, 106, + 165, 41, 147, 129, 129, 144, 138, 135, 138, 140, + 128, 150, 89, 163, 154, 115, 141, 127, 132, 145, + 135, 157, 143, 145, 140, 141, 127, 135, 127, 129, + 142, 147, 116, 147, 104, 162, 153, 143, 146, 130, + 144, 110, 133, 123, 130, 137, 118, 198, 126, 152, + 154, 146, 139, 127, 147, 112, 207, 151, 156, 136, + 162, 137, 108, 121, 130, 135, 125, 131, 131, 134, + 134, 134, 141, 144, 107, 143, 137, 144, 124, 136, + 115, 147, 130, 157, 119, 167, 71, 144, 97, 128, + 134, 138, 132, 133, 138, 138, 146, 146, 147, 131, + 141, 138, 185, 65, 145, 123, 139, 130, 142, 128, + 139, 136, 157, 147, 124, 119, 164, 148, 170, 154, + 133, 130, 157, 148, 140, 141, 130, 135, 134, 137, + 136, 137, 143, 144, 144, 144, 178, 186, 71, 73, + 120, 118, 127, 124, 152, 151, 155, 146, 141, 138, + 142, 143, 139, 143, 133, 134, 139, 140, 138, 135, + 146, 141, 78, 198, 129, 139, 141, 141, 134, 141, + 137, 136, 120, 120, 124, 118, 143, 148, 148, 152, + 131, 143, 129, 137, 152, 158, 157, 160, 175, 178, + 137, 139, 131, 133, 146, 152, 121, 147, 142, 143, + 129, 136, 149, 145, 197, 114, 103, 141, 124, 140, + 141, 140, 129, 129, 127, 130, 131, 124, 123, 117, + 150, 139, 120, 109, 119, 120, 163, 163, 117, 121, + 139, 139, 136, 136, 94, 74, 150, 145, 126, 127, + 147, 150, 158, 162, 84, 74, 136, 129, 140, 132, + 136, 135, 146, 145, 124, 116, 129, 120, 130, 129, + 130, 109, 122, 111, 160, 141, 135, 113, 131, 121, + 136, 135, 135, 135, 147, 147, 140, 140, 144, 145, + 139, 142, 131, 137, 145, 145, 143, 153, 48, 49, + 145, 143, 151, 147, 158, 146, 135, 124, 124, 116, + 159, 140, 131, 126, 123, 120, 103, 117, 113, 119, + 148, 146, 128, 124, 123, 126, 123, 120, 158, 141, + 148, 137, 146, 143, 125, 143, 89, 107, 116, 123, + 149, 147, 141, 139, 149, 153, 118, 121, 139, 138, + 105, 119, 168, 147, 139, 141, 143, 138, 133, 130, + 126, 126, 143, 142, 146, 144, 124, 123, 143, 145, + 149, 148, 147, 141, 151, 143, 118, 113, 175, 171 +}; + +static const uint8_t wmavoice_dq_lsp16r1[0x500] = { + 147, 145, 193, 168, 188, 156, 141, 145, 141, 139, + 148, 149, 148, 149, 153, 157, 144, 144, 152, 152, + 141, 145, 153, 143, 243, 134, 151, 133, 166, 135, + 150, 149, 135, 132, 32, 39, 110, 111, 109, 114, + 126, 127, 147, 146, 177, 169, 162, 156, 210, 187, + 141, 147, 95, 150, 127, 155, 108, 133, 139, 148, + 138, 138, 140, 140, 147, 146, 134, 130, 136, 134, + 147, 146, 142, 150, 62, 174, 126, 151, 122, 156, + 154, 156, 179, 184, 115, 107, 105, 99, 127, 124, + 146, 131, 140, 44, 132, 125, 156, 146, 153, 153, + 136, 137, 145, 144, 141, 139, 158, 152, 138, 132, + 145, 145, 147, 145, 146, 141, 144, 140, 110, 97, + 140, 141, 143, 142, 130, 123, 127, 117, 126, 120, + 147, 146, 161, 155, 169, 135, 122, 117, 166, 155, + 144, 144, 142, 142, 125, 122, 137, 128, 194, 172, + 127, 85, 148, 143, 153, 141, 147, 147, 140, 143, + 118, 140, 0, 69, 51, 60, 111, 123, 137, 135, + 146, 146, 164, 165, 207, 214, 145, 143, 149, 147, + 178, 168, 197, 170, 134, 154, 148, 159, 115, 140, + 103, 118, 13, 38, 139, 138, 135, 138, 140, 141, + 144, 144, 140, 140, 150, 150, 156, 157, 164, 171, + 143, 143, 140, 142, 118, 120, 172, 172, 160, 163, + 146, 147, 150, 151, 176, 176, 230, 237, 153, 153, + 168, 156, 173, 149, 164, 148, 162, 146, 178, 158, + 147, 145, 143, 145, 111, 126, 111, 130, 89, 118, + 153, 158, 122, 120, 142, 125, 124, 105, 148, 138, + 145, 144, 156, 151, 193, 154, 146, 147, 119, 135, + 142, 141, 145, 145, 152, 147, 142, 141, 146, 146, + 139, 138, 154, 154, 148, 150, 147, 149, 144, 145, + 134, 134, 141, 140, 135, 134, 145, 147, 160, 163, + 144, 145, 149, 146, 115, 67, 127, 119, 141, 135, + 145, 141, 130, 124, 143, 144, 151, 165, 141, 144, + 154, 152, 160, 136, 115, 82, 64, 71, 64, 65, + 143, 143, 151, 149, 240, 251, 165, 173, 173, 179, + 148, 134, 156, 55, 160, 105, 133, 91, 129, 96, + 149, 149, 145, 144, 160, 154, 171, 159, 140, 142, + 154, 163, 178, 244, 147, 140, 153, 150, 137, 121, + 145, 144, 145, 146, 138, 139, 149, 152, 189, 198, + 148, 148, 156, 158, 168, 182, 165, 182, 172, 201, + 143, 142, 99, 92, 152, 152, 143, 143, 127, 127, + 165, 148, 173, 124, 113, 122, 134, 142, 127, 142, + 124, 126, 137, 137, 131, 132, 144, 142, 141, 138, + 172, 176, 138, 111, 152, 136, 167, 154, 156, 137, + 140, 150, 78, 145, 158, 157, 161, 154, 155, 147, + 153, 164, 156, 191, 129, 109, 153, 146, 153, 141, + 138, 137, 141, 138, 115, 94, 144, 141, 155, 147, + 144, 142, 144, 137, 168, 113, 141, 134, 145, 137, + 146, 144, 150, 148, 140, 155, 103, 178, 137, 149, + 145, 147, 148, 153, 175, 201, 138, 146, 110, 108, + 143, 146, 124, 134, 124, 127, 164, 158, 127, 135, + 145, 146, 150, 150, 145, 147, 95, 80, 150, 151, + 149, 149, 162, 162, 144, 152, 170, 169, 145, 154, + 145, 149, 143, 146, 142, 145, 152, 146, 160, 98, + 141, 141, 153, 153, 140, 137, 131, 131, 145, 146, + 133, 132, 127, 124, 158, 150, 173, 164, 178, 167, + 146, 146, 154, 155, 117, 127, 143, 147, 147, 156, + 142, 143, 144, 145, 146, 152, 170, 199, 151, 165, + 146, 147, 139, 140, 147, 149, 132, 134, 147, 149, + 138, 139, 142, 143, 162, 188, 145, 149, 160, 164, + 150, 150, 139, 139, 143, 142, 146, 146, 137, 138, + 142, 142, 141, 140, 152, 153, 164, 171, 110, 112, + 139, 139, 143, 143, 138, 138, 142, 142, 143, 143, + 137, 140, 142, 142, 145, 141, 149, 141, 182, 135, + 146, 146, 150, 150, 144, 145, 150, 151, 135, 137, + 137, 145, 51, 62, 68, 54, 69, 57, 62, 41, + 137, 139, 139, 144, 135, 150, 225, 232, 208, 197, + 136, 135, 141, 143, 145, 150, 160, 169, 213, 247, + 142, 137, 72, 54, 110, 107, 105, 107, 127, 130, + 145, 143, 169, 155, 219, 174, 195, 164, 183, 157, + 155, 157, 239, 232, 169, 164, 170, 172, 156, 159, + 142, 143, 136, 144, 59, 100, 139, 142, 130, 138, + 147, 146, 150, 161, 128, 235, 143, 155, 146, 167, + 154, 149, 128, 151, 42, 149, 55, 136, 59, 127, + 128, 126, 74, 92, 143, 153, 140, 150, 166, 176, + 146, 152, 150, 145, 140, 100, 140, 105, 124, 59, + 195, 191, 146, 148, 144, 136, 136, 133, 129, 122, + 133, 148, 40, 147, 102, 140, 123, 148, 118, 136, + 143, 143, 150, 148, 184, 153, 160, 147, 166, 149, + 58, 68, 127, 135, 141, 145, 143, 147, 150, 151, + 140, 143, 137, 137, 120, 114, 71, 65, 125, 123, + 153, 148, 215, 159, 136, 135, 150, 146, 150, 150, + 148, 138, 166, 94, 150, 145, 145, 139, 147, 145, + 146, 147, 150, 139, 171, 63, 158, 142, 153, 133, + 147, 148, 143, 143, 76, 72, 155, 159, 164, 176, + 149, 149, 173, 195, 145, 165, 138, 144, 150, 167, + 180, 169, 146, 151, 146, 166, 147, 166, 149, 171, + 157, 156, 168, 166, 147, 149, 121, 122, 116, 124, + 145, 145, 147, 148, 172, 189, 168, 180, 144, 146, + 139, 145, 141, 150, 115, 172, 141, 146, 143, 148, + 145, 145, 142, 143, 145, 147, 138, 143, 58, 73, + 141, 142, 146, 145, 163, 149, 218, 161, 147, 132, + 152, 147, 146, 147, 140, 150, 141, 152, 89, 150, + 78, 134, 135, 137, 139, 142, 140, 137, 137, 130, + 144, 144, 152, 151, 145, 140, 181, 170, 191, 168, + 164, 166, 136, 148, 112, 124, 139, 144, 146, 149, + 142, 151, 113, 182, 137, 150, 143, 156, 138, 147, + 154, 156, 108, 102, 118, 119, 133, 139, 113, 111, + 145, 144, 150, 147, 175, 151, 104, 106, 116, 114, + 143, 144, 151, 157, 151, 191, 135, 113, 138, 123, + 146, 146, 155, 157, 106, 145, 132, 127, 140, 125, + 161, 165, 146, 150, 151, 154, 139, 140, 142, 143, + 144, 148, 145, 149, 147, 138, 168, 104, 146, 136, + 138, 140, 91, 108, 111, 110, 145, 140, 158, 154, + 130, 112, 122, 118, 136, 135, 119, 118, 141, 140, + 147, 146, 146, 145, 138, 138, 182, 188, 132, 132, + 144, 144, 156, 155, 168, 172, 123, 128, 144, 151, + 142, 140, 145, 145, 137, 144, 141, 152, 128, 188, + 149, 149, 160, 161, 160, 160, 166, 163, 130, 107, + 143, 143, 142, 142, 149, 149, 132, 132, 170, 174, + 148, 148, 154, 153, 118, 111, 157, 155, 114, 109, + 140, 139, 138, 137, 205, 187, 137, 133, 147, 144, + 144, 145, 147, 149, 105, 125, 108, 117, 155, 162, + 146, 146, 162, 157, 144, 122, 154, 143, 161, 139, + 141, 142, 130, 131, 144, 144, 142, 141, 144, 142, + 132, 132, 141, 141, 150, 151, 139, 141, 151, 153, + 142, 142, 154, 154, 150, 150, 148, 148, 166, 165, + 143, 142, 144, 144, 132, 132, 142, 144, 130, 128, + 142, 142, 143, 143, 153, 153, 147, 142, 129, 125, + 142, 141, 143, 142, 143, 147, 105, 122, 135, 140, + 141, 140, 140, 140, 151, 151, 156, 155, 146, 146, + 133, 134, 140, 142, 142, 145, 141, 146, 112, 133, + 142, 142, 145, 145, 137, 138, 155, 157, 149, 150, + 144, 144, 139, 138, 130, 128, 132, 131, 147, 147, + 139, 140, 142, 143, 115, 121, 141, 143, 137, 141, + 146, 146, 150, 150, 145, 144, 133, 133, 133, 135, + 143, 144, 144, 144, 166, 167, 139, 142, 139, 140, + 150, 149, 138, 138, 142, 140, 148, 147, 160, 155, + 146, 146, 147, 147, 138, 137, 143, 142, 151, 150 +}; + +static const uint8_t wmavoice_dq_lsp16r2[0x500] = { + 98, 98, 119, 121, 109, 112, 128, 135, 115, 121, + 159, 113, 113, 106, 127, 114, 101, 102, 105, 111, + 161, 162, 137, 138, 161, 159, 152, 150, 150, 148, + 128, 79, 131, 102, 142, 120, 133, 119, 130, 117, + 121, 115, 142, 133, 186, 155, 179, 144, 169, 135, + 107, 103, 106, 106, 122, 122, 111, 112, 112, 115, + 127, 123, 118, 115, 128, 125, 123, 119, 115, 109, + 124, 130, 117, 126, 121, 133, 84, 144, 99, 114, + 122, 125, 123, 131, 124, 135, 176, 200, 158, 176, + 68, 74, 86, 87, 117, 115, 119, 116, 135, 128, + 115, 116, 102, 104, 119, 123, 133, 148, 102, 109, + 71, 121, 106, 117, 107, 127, 106, 122, 100, 110, + 117, 115, 129, 128, 87, 84, 116, 116, 151, 157, + 116, 128, 110, 117, 119, 134, 100, 114, 120, 129, + 142, 141, 146, 151, 94, 91, 114, 114, 118, 118, + 114, 112, 112, 109, 115, 112, 123, 123, 147, 148, + 110, 164, 106, 152, 110, 158, 106, 151, 105, 135, + 85, 51, 71, 27, 71, 34, 74, 45, 85, 53, + 145, 134, 140, 130, 136, 134, 118, 122, 118, 126, + 117, 84, 121, 81, 106, 80, 109, 106, 121, 127, + 95, 94, 112, 110, 90, 94, 109, 107, 114, 109, + 117, 118, 118, 123, 107, 107, 86, 93, 29, 31, + 125, 112, 104, 60, 121, 111, 127, 116, 133, 130, + 118, 117, 148, 145, 122, 126, 124, 127, 90, 91, + 113, 110, 119, 118, 152, 147, 115, 112, 132, 131, + 129, 140, 98, 112, 73, 85, 109, 115, 122, 126, + 123, 122, 122, 122, 126, 125, 137, 140, 203, 210, + 164, 176, 114, 114, 125, 122, 119, 112, 125, 120, + 124, 122, 118, 115, 95, 96, 141, 144, 132, 131, + 127, 130, 132, 134, 116, 114, 122, 123, 137, 134, + 111, 111, 112, 116, 106, 118, 77, 101, 104, 115, + 111, 111, 125, 126, 118, 121, 113, 115, 113, 113, + 171, 170, 202, 199, 221, 206, 199, 184, 177, 167, + 73, 90, 61, 93, 43, 74, 51, 71, 51, 72, + 130, 130, 140, 137, 134, 132, 164, 160, 118, 111, + 123, 136, 133, 154, 130, 158, 106, 110, 110, 114, + 97, 97, 91, 94, 70, 69, 125, 123, 141, 140, + 119, 100, 116, 77, 111, 67, 105, 52, 95, 34, + 100, 122, 90, 124, 68, 120, 43, 117, 50, 112, + 130, 129, 192, 188, 123, 118, 124, 117, 121, 115, + 122, 111, 129, 111, 157, 85, 125, 109, 125, 119, + 143, 152, 119, 128, 114, 116, 129, 136, 148, 157, + 119, 117, 115, 115, 150, 148, 163, 154, 109, 102, + 120, 126, 73, 119, 106, 121, 102, 122, 96, 113, + 84, 83, 117, 115, 122, 117, 154, 143, 159, 142, + 118, 122, 114, 117, 115, 122, 114, 130, 99, 156, + 123, 120, 122, 116, 100, 81, 99, 91, 121, 112, + 139, 131, 164, 142, 132, 119, 145, 133, 157, 141, + 112, 109, 118, 116, 142, 134, 108, 110, 96, 99, + 111, 110, 113, 112, 111, 104, 98, 94, 131, 131, + 115, 114, 121, 118, 120, 115, 173, 148, 123, 117, + 121, 124, 122, 124, 140, 146, 78, 82, 96, 93, + 86, 90, 124, 125, 121, 123, 105, 106, 134, 135, + 107, 109, 132, 141, 100, 95, 113, 114, 102, 105, + 113, 130, 98, 145, 116, 115, 124, 117, 115, 105, + 120, 123, 89, 87, 109, 108, 102, 101, 117, 117, + 113, 122, 132, 138, 77, 116, 86, 99, 118, 126, + 123, 120, 117, 111, 124, 119, 129, 118, 63, 58, + 141, 135, 108, 106, 109, 111, 108, 110, 135, 138, + 117, 114, 134, 127, 139, 129, 138, 130, 126, 122, + 121, 118, 124, 121, 133, 130, 98, 85, 130, 123, + 147, 129, 118, 112, 148, 130, 136, 123, 148, 131, + 113, 112, 123, 118, 123, 115, 147, 95, 117, 110, + 118, 119, 112, 113, 112, 113, 119, 119, 120, 120, + 158, 133, 198, 145, 188, 129, 197, 137, 195, 133, + 132, 140, 140, 139, 158, 156, 223, 217, 233, 233, + 48, 56, 34, 37, 82, 84, 102, 102, 108, 110, + 120, 142, 136, 169, 146, 195, 136, 186, 140, 182, + 196, 186, 158, 155, 142, 134, 132, 125, 120, 119, + 97, 105, 72, 75, 82, 85, 81, 84, 107, 109, + 67, 121, 43, 119, 69, 124, 87, 129, 88, 128, + 53, 57, 93, 98, 91, 94, 93, 98, 104, 104, + 124, 123, 133, 133, 182, 181, 119, 121, 114, 116, + 128, 105, 134, 112, 131, 72, 119, 59, 111, 84, + 132, 142, 145, 180, 124, 132, 131, 143, 122, 134, + 88, 85, 103, 103, 136, 140, 131, 143, 114, 132, + 116, 57, 113, 57, 121, 76, 126, 80, 118, 86, + 127, 112, 127, 97, 131, 100, 149, 91, 163, 86, + 122, 119, 128, 121, 128, 116, 142, 127, 173, 139, + 162, 116, 166, 107, 149, 103, 152, 107, 141, 108, + 114, 113, 118, 116, 56, 43, 90, 90, 105, 105, + 132, 134, 110, 107, 106, 105, 82, 84, 84, 84, + 102, 106, 79, 89, 99, 99, 127, 129, 114, 118, + 139, 157, 116, 123, 116, 123, 87, 89, 110, 113, + 119, 126, 97, 97, 155, 163, 142, 153, 143, 146, + 117, 114, 66, 67, 125, 126, 127, 128, 114, 113, + 111, 114, 127, 133, 123, 132, 143, 162, 133, 148, + 105, 108, 114, 114, 110, 109, 57, 48, 109, 106, + 113, 130, 104, 131, 88, 139, 102, 169, 100, 172, + 129, 114, 150, 97, 114, 112, 117, 119, 109, 116, + 92, 107, 96, 116, 90, 125, 101, 122, 125, 140, + 125, 133, 122, 129, 136, 153, 125, 135, 131, 139, + 84, 71, 129, 123, 135, 120, 114, 103, 112, 101, + 108, 121, 115, 156, 106, 123, 116, 131, 127, 139, + 137, 147, 109, 117, 119, 126, 135, 144, 117, 119, + 120, 127, 76, 105, 111, 116, 120, 125, 141, 138, + 107, 104, 162, 155, 135, 130, 127, 123, 127, 121, + 102, 104, 84, 87, 112, 115, 97, 102, 78, 82, + 119, 118, 120, 123, 91, 105, 114, 119, 119, 126, + 130, 126, 134, 126, 158, 134, 133, 99, 116, 100, + 125, 122, 145, 143, 126, 117, 98, 96, 121, 120, + 152, 148, 131, 126, 130, 129, 126, 119, 87, 87, + 131, 131, 139, 137, 101, 102, 104, 105, 86, 83, + 92, 89, 111, 105, 121, 115, 137, 124, 96, 84, + 100, 96, 122, 119, 107, 108, 93, 96, 79, 82, + 128, 123, 108, 106, 123, 120, 150, 150, 143, 140, + 121, 120, 97, 99, 79, 80, 116, 116, 88, 90, + 128, 131, 101, 97, 140, 140, 117, 116, 116, 118, + 137, 135, 100, 91, 115, 112, 134, 121, 107, 99, + 120, 122, 122, 125, 124, 126, 136, 141, 89, 95, + 103, 119, 103, 116, 122, 139, 125, 137, 152, 170, + 121, 122, 124, 124, 98, 97, 137, 140, 96, 92, + 115, 113, 136, 136, 128, 132, 122, 124, 151, 158, + 100, 107, 121, 131, 131, 158, 119, 130, 113, 114, + 114, 109, 148, 130, 103, 95, 127, 116, 137, 120, + 103, 108, 97, 97, 133, 128, 113, 109, 136, 128, + 125, 124, 118, 118, 122, 121, 101, 99, 157, 152, + 138, 134, 124, 115, 113, 101, 123, 112, 124, 110, + 116, 113, 128, 121, 119, 110, 124, 113, 128, 67, + 114, 118, 114, 123, 109, 121, 102, 123, 56, 116, + 117, 111, 112, 99, 124, 114, 112, 79, 114, 88, + 112, 113, 115, 117, 126, 127, 130, 132, 123, 122, + 111, 104, 111, 102, 112, 102, 129, 118, 129, 115, + 123, 124, 130, 133, 114, 117, 125, 127, 112, 117, + 124, 125, 119, 120, 117, 116, 105, 104, 110, 110, + 125, 124, 118, 116, 124, 123, 124, 121, 133, 132, + 111, 111, 124, 124, 120, 119, 116, 116, 134, 130, + 114, 116, 112, 113, 109, 111, 116, 118, 95, 98 +}; + +static const uint8_t wmavoice_dq_lsp16r3[0x600] = { + 84, 82, 95, 94, 125, 131, 98, 102, 94, 93, 104, 104, + 127, 113, 87, 77, 125, 114, 109, 94, 94, 91, 106, 105, + 168, 125, 163, 120, 128, 100, 119, 99, 108, 97, 108, 106, + 86, 85, 128, 125, 79, 73, 103, 102, 123, 123, 116, 117, + 84, 76, 135, 131, 133, 133, 129, 130, 125, 123, 115, 114, + 94, 97, 79, 81, 115, 115, 94, 93, 128, 127, 126, 125, + 124, 111, 105, 114, 104, 117, 109, 110, 124, 125, 118, 117, + 107, 110, 106, 110, 93, 93, 149, 148, 118, 119, 111, 110, + 147, 157, 143, 156, 134, 136, 118, 121, 106, 107, 105, 105, + 114, 83, 114, 46, 106, 53, 110, 83, 107, 94, 105, 103, + 92, 90, 109, 106, 172, 160, 114, 110, 109, 110, 110, 109, + 90, 98, 98, 109, 102, 98, 97, 92, 100, 100, 101, 102, + 123, 117, 124, 98, 82, 80, 117, 115, 112, 110, 109, 108, + 107, 111, 100, 115, 105, 120, 104, 105, 83, 82, 95, 96, + 109, 120, 72, 71, 97, 104, 69, 74, 99, 102, 118, 117, + 137, 133, 142, 135, 105, 110, 121, 121, 125, 122, 114, 112, + 151, 186, 115, 132, 103, 111, 100, 104, 99, 101, 104, 105, + 18, 38, 56, 65, 76, 83, 85, 91, 101, 103, 108, 110, + 144, 135, 126, 121, 115, 113, 79, 80, 118, 117, 117, 117, + 117, 124, 115, 115, 126, 113, 130, 116, 112, 106, 108, 105, + 77, 76, 76, 80, 109, 109, 125, 129, 130, 133, 116, 118, + 96, 86, 109, 99, 102, 69, 84, 69, 107, 103, 114, 113, + 78, 118, 82, 114, 84, 129, 69, 112, 78, 98, 96, 103, + 89, 137, 96, 111, 105, 97, 93, 93, 101, 105, 105, 105, + 141, 123, 102, 93, 91, 79, 87, 81, 102, 99, 109, 108, + 94, 92, 124, 123, 130, 134, 100, 107, 71, 75, 92, 91, + 94, 104, 107, 83, 106, 101, 113, 114, 122, 122, 114, 114, + 118, 124, 103, 106, 95, 116, 90, 93, 107, 104, 109, 107, + 116, 118, 76, 72, 88, 88, 132, 132, 140, 141, 116, 116, + 90, 81, 111, 95, 139, 97, 123, 96, 112, 100, 110, 108, + 112, 116, 133, 140, 112, 120, 80, 85, 55, 55, 85, 84, + 125, 94, 111, 104, 116, 103, 112, 86, 93, 84, 99, 98, + 180, 179, 197, 197, 169, 163, 149, 146, 130, 124, 116, 115, + 76, 47, 36, 11, 43, 28, 66, 53, 82, 80, 102, 99, + 119, 123, 176, 201, 113, 120, 112, 111, 103, 105, 106, 110, + 145, 114, 112, 89, 120, 93, 123, 104, 131, 123, 113, 111, + 97, 109, 82, 106, 75, 104, 103, 115, 120, 124, 111, 114, + 114, 111, 113, 105, 34, 33, 63, 63, 105, 106, 122, 122, + 51, 41, 96, 92, 125, 125, 118, 118, 118, 119, 113, 113, + 111, 180, 108, 178, 107, 171, 110, 160, 105, 136, 102, 117, + 76, 79, 90, 92, 80, 88, 88, 93, 123, 124, 122, 122, + 131, 128, 123, 122, 151, 158, 108, 107, 129, 128, 119, 119, + 97, 99, 114, 120, 121, 125, 151, 157, 82, 89, 95, 96, + 128, 94, 130, 95, 149, 113, 149, 120, 127, 115, 113, 109, + 167, 171, 83, 80, 84, 79, 106, 106, 112, 110, 107, 108, + 130, 139, 81, 88, 107, 106, 112, 112, 119, 118, 114, 112, + 108, 105, 100, 98, 120, 116, 122, 117, 38, 37, 72, 73, + 118, 125, 110, 120, 114, 126, 135, 142, 139, 142, 118, 119, + 119, 119, 156, 145, 78, 75, 94, 94, 112, 110, 113, 113, + 101, 108, 98, 104, 103, 109, 117, 118, 167, 167, 132, 132, + 116, 108, 118, 111, 149, 136, 85, 74, 95, 92, 113, 112, + 74, 69, 104, 107, 96, 100, 117, 121, 103, 105, 103, 103, + 110, 106, 111, 101, 82, 72, 96, 92, 132, 130, 120, 121, + 116, 113, 138, 139, 104, 103, 131, 131, 68, 69, 92, 92, + 97, 97, 146, 151, 122, 132, 97, 95, 117, 116, 115, 116, + 139, 134, 110, 110, 124, 129, 100, 110, 86, 91, 100, 102, + 116, 136, 88, 90, 137, 139, 103, 114, 114, 117, 111, 110, + 82, 83, 104, 102, 97, 99, 97, 97, 58, 56, 84, 84, + 83, 122, 76, 105, 112, 126, 120, 134, 112, 120, 108, 110, + 114, 128, 73, 90, 72, 76, 98, 100, 95, 96, 101, 102, + 101, 108, 118, 126, 94, 102, 81, 83, 138, 140, 131, 130, + 88, 100, 112, 124, 105, 106, 122, 123, 121, 121, 114, 114, + 76, 108, 73, 83, 93, 95, 110, 111, 98, 99, 103, 103, + 105, 112, 98, 108, 114, 95, 117, 98, 120, 116, 116, 115, + 231, 238, 150, 146, 124, 126, 115, 122, 117, 121, 112, 112, + 74, 73, 72, 74, 60, 61, 62, 61, 85, 85, 101, 101, + 67, 69, 50, 51, 83, 83, 110, 110, 118, 113, 112, 111, + 199, 124, 184, 115, 176, 117, 165, 120, 138, 115, 116, 114, + 52, 116, 36, 107, 49, 99, 72, 106, 91, 107, 104, 105, + 140, 138, 141, 135, 154, 147, 166, 159, 139, 136, 116, 115, + 130, 119, 180, 157, 183, 149, 136, 121, 119, 114, 111, 110, + 104, 129, 113, 154, 111, 148, 108, 132, 105, 117, 106, 111, + 114, 35, 99, 65, 113, 94, 110, 98, 111, 107, 107, 106, + 106, 110, 128, 135, 162, 175, 143, 155, 115, 116, 109, 109, + 168, 155, 112, 109, 125, 125, 126, 122, 126, 124, 111, 112, + 128, 96, 160, 77, 151, 77, 121, 80, 114, 94, 107, 103, + 97, 104, 101, 116, 56, 79, 74, 83, 92, 95, 104, 106, + 63, 68, 76, 77, 110, 107, 96, 90, 85, 83, 97, 96, + 116, 110, 46, 42, 103, 100, 122, 120, 102, 101, 104, 104, + 106, 101, 109, 98, 96, 61, 67, 35, 72, 61, 96, 93, + 88, 80, 81, 76, 113, 110, 144, 143, 88, 89, 93, 94, + 95, 96, 100, 101, 136, 132, 166, 160, 148, 147, 115, 116, + 80, 78, 130, 129, 120, 108, 91, 85, 95, 91, 104, 102, + 151, 147, 106, 109, 110, 110, 64, 69, 68, 67, 96, 96, + 90, 166, 97, 128, 99, 120, 104, 121, 109, 118, 105, 109, + 122, 138, 110, 143, 75, 97, 83, 94, 89, 94, 102, 103, + 136, 142, 103, 110, 83, 89, 99, 101, 138, 138, 120, 122, + 168, 88, 105, 90, 109, 107, 110, 111, 106, 105, 103, 102, + 68, 72, 102, 104, 92, 102, 65, 75, 89, 94, 106, 106, + 83, 74, 93, 85, 73, 66, 106, 102, 100, 92, 99, 97, + 93, 99, 101, 96, 116, 112, 125, 120, 88, 88, 96, 96, + 44, 98, 93, 115, 104, 116, 103, 107, 112, 113, 107, 107, + 93, 83, 105, 99, 93, 84, 127, 125, 141, 143, 117, 118, + 106, 103, 126, 121, 137, 123, 123, 114, 147, 142, 127, 123, + 103, 110, 89, 91, 121, 124, 66, 71, 68, 69, 96, 97, + 114, 105, 68, 65, 69, 67, 96, 94, 131, 130, 123, 121, + 111, 104, 130, 121, 95, 95, 72, 74, 88, 88, 105, 104, + 135, 124, 110, 98, 114, 111, 159, 158, 111, 113, 104, 106, + 103, 108, 94, 107, 55, 57, 115, 118, 121, 122, 111, 111, + 97, 99, 106, 111, 119, 126, 59, 62, 111, 112, 124, 125, + 86, 93, 100, 110, 118, 145, 113, 132, 120, 125, 112, 112, + 101, 115, 78, 149, 81, 114, 111, 121, 108, 112, 107, 108, + 104, 104, 94, 96, 84, 83, 135, 132, 71, 69, 88, 86, + 100, 98, 62, 60, 81, 80, 90, 89, 63, 66, 89, 90, + 123, 116, 108, 99, 90, 86, 91, 92, 65, 65, 88, 88, + 84, 79, 115, 109, 123, 111, 99, 99, 134, 136, 121, 123, + 127, 137, 84, 88, 104, 107, 128, 130, 74, 69, 89, 89, + 118, 112, 143, 132, 141, 131, 113, 113, 99, 102, 104, 105, + 117, 115, 100, 99, 131, 126, 90, 88, 145, 144, 128, 127, + 112, 114, 131, 133, 85, 84, 118, 119, 151, 152, 117, 117, + 110, 105, 162, 140, 116, 107, 140, 134, 124, 122, 113, 113, + 107, 110, 124, 133, 98, 103, 99, 107, 109, 113, 112, 112, + 115, 105, 82, 77, 125, 122, 133, 132, 118, 120, 113, 113, + 101, 88, 84, 80, 97, 99, 91, 91, 94, 94, 101, 100, + 121, 86, 139, 108, 106, 93, 103, 99, 112, 108, 108, 107, + 113, 83, 105, 102, 125, 125, 114, 115, 110, 112, 108, 109, + 93, 112, 113, 121, 125, 131, 101, 101, 107, 109, 111, 111, + 98, 102, 117, 126, 80, 84, 107, 109, 83, 84, 96, 97, + 132, 136, 112, 118, 94, 93, 121, 118, 99, 98, 102, 103, + 122, 127, 128, 133, 118, 104, 102, 88, 100, 94, 104, 102, + 115, 116, 102, 105, 140, 142, 135, 130, 90, 88, 100, 101, + 94, 86, 112, 112, 89, 121, 92, 101, 109, 108, 110, 112, + 99, 93, 129, 114, 109, 99, 131, 119, 102, 97, 103, 103, + 103, 116, 124, 101, 115, 95, 105, 101, 94, 91, 100, 100, + 113, 90, 94, 86, 92, 92, 117, 111, 106, 103, 106, 105, + 115, 99, 110, 91, 107, 104, 81, 90, 108, 113, 112, 113, + 113, 114, 93, 101, 101, 102, 101, 126, 93, 103, 104, 105, + 117, 106, 124, 107, 104, 119, 108, 133, 104, 111, 104, 106 +}; + +static const float wmavoice_lsp10_intercoeff_a[32][2][10] = { + { { 0.5108627081, 0.0480548441, -1.5099149644, 0.6736935377, + 0.7536551058, 0.7651474178, 0.8510628343, 0.6667704582, + 0.7576012611, 0.7091397047 }, + { 0.1351471841, -0.1965375543, -1.6313457787, 0.3218626380, + 0.4132472873, 0.4663473070, 0.5805781186, 0.3962165117, + 0.4818550050, 0.4907165468 } }, + { { 0.8556320667, 0.7774704993, -0.0175759494, -0.1882298589, + 0.1892164350, 0.4850396216, 0.6270319819, 0.6327089071, + 0.6513319910, 0.6075088978 }, + { 0.4374088347, 0.3505934179, -0.0762144327, -0.2830760479, + -0.0626451969, 0.1500318050, 0.2602472305, 0.2781780064, + 0.3167395592, 0.3596626520 } }, + { { 0.1899779737, 0.0650856197, 0.1699010432, 0.9122628570, + 0.9097705483, 0.7433397174, 0.6304935217, 0.5164704025, + 0.4174703658, 0.5215242505 }, + { 0.0704856217, 0.0169009864, 0.0188394487, 0.5587704182, + 0.5194473267, 0.3539164960, 0.2426626086, 0.1721164286, + 0.1371548772, 0.2594856918 } }, + { { 0.8858859241, 0.9100474715, 0.8921859264, 0.9332397878, + 1.0225475132, 1.0555013716, 1.0983552337, 1.1290244758, + 1.0363244414, 0.9277705550 }, + { 0.4810934663, 0.5782935023, 0.6835935414, 0.7650781870, + 0.9018090069, 0.9996321201, 1.0219936669, 1.0474705994, + 0.9109474719, 0.7774704993 } }, + { { 0.4359549880, 0.2275702953, 0.0993548632, 0.1763395071, + 0.1055856347, 0.1018471718, 0.1170087159, 0.1221317947, + 0.1834010482, 0.2988780141 }, + { 0.1573702693, 0.1041317880, 0.0506856143, 0.0781702399, + 0.0058932900, -0.0026913285, -0.0031067133, 0.0070702136, + 0.0116394460, 0.0566394627 } }, + { { 0.8528628349, 0.8028782010, 0.4680088460, 0.9055474699, + 1.3742399514, 1.1093629301, 0.4122780561, 0.4003703594, + 0.6360319853, 0.6415704489 }, + { 0.4252934456, 0.3823703527, 0.1676856577, 0.5241550207, + 1.1995706558, 0.9088013172, 0.1224087179, 0.0730471611, + 0.3071857095, 0.3772472739 } }, + { { 0.5508781075, 0.2829549313, -0.0022067130, 0.1042702496, + 1.0318244398, 1.3258476257, 1.3550630212, 0.9931936562, + 0.7195243239, 0.6807550788 }, + { 0.2679318488, 0.0960317850, -0.1357529163, -0.1291759908, + 0.6451012194, 0.9968628883, 0.9510321021, 0.6608166099, + 0.3799472749, 0.3735780418 } }, + { { 0.9967244267, 1.0255244374, 0.9800398052, 0.7939474285, + 0.8288397491, 0.8390166759, 0.8660166860, 0.9247936308, + 0.9127474725, 0.8684397638 }, + { 0.7921474278, 0.9416859448, 0.8547320664, 0.5348165631, + 0.6231550574, 0.6703012288, 0.6987550855, 0.8147858977, + 0.7406397164, 0.6496012211 } }, + { { 0.1439394951, -0.3193529844, -0.2024914026, -0.1854606271, + 0.0877240896, 0.1617318094, 0.3087087870, 0.3777318895, + 0.3910242021, 0.4797780812 }, + { -0.0157067180, -0.1778452396, -0.1554836929, -0.1759760082, + -0.0607759655, -0.0161221027, 0.0393317640, 0.0758856237, + 0.1163856387, 0.1947548985 } }, + { { 1.1021629274, 0.9958244264, 0.4658626914, 0.3089164793, + 0.3740626574, 0.2962472439, 0.3170857131, 0.2420395315, + 0.2649549246, 0.2936857045 }, + { 0.4700857699, 0.1809087396, 0.0311625302, 0.0106009841, + 0.0311625302, 0.0266625285, 0.0221625268, 0.0156548321, + 0.0551163852, 0.1010164022 } }, + { { 0.2925087810, 0.3418011069, 0.7339243293, 0.7322627902, + 0.7288704813, 0.7924935818, 0.7724166512, 0.7819012702, + 0.8325782120, 0.7954705060 }, + { 0.0559471548, -0.0456144214, -0.0462374985, -0.1005144417, + -0.0511528850, -0.0455451906, -0.0044220984, 0.0451471508, + 0.1232394874, 0.2085318267 } }, + { { 0.2230702937, -0.9052532017, 1.2441552877, 1.0825706124, + 0.9088705480, 0.8797243834, 0.8648397624, 0.8091089725, + 0.7633474171, 0.7468704879 }, + { -0.2030452490, -1.4167303145, 1.3542322516, 0.8369397521, + 0.6148473620, 0.5560704172, 0.5450627208, 0.4978473186, + 0.4200319052, 0.4904396236 } }, + { { 0.6088242829, 0.5965704322, 0.6547242999, 0.8554936051, + -0.2989298999, 0.2404472232, 0.3573780358, 0.7499166429, + 0.7691628039, 0.6824858487 }, + { 0.2582395375, 0.2721549273, 0.3462318778, 0.4820626974, + -0.4780299664, -0.0712990463, 0.0200163722, 0.4246703684, + 0.4660011530, 0.4172626734 } }, + { { 1.1749937236, 1.0773090720, 1.0566782951, 1.0249013603, + 0.9947167337, 0.9626628757, 0.9562244117, 0.9072782397, + 0.7654243410, 0.6448935270 }, + { 1.1595552564, 0.9340013266, 0.3959395885, 0.3693549633, + 0.3915780485, 0.3104395568, 0.3499011099, 0.2236933708, + 0.1638087332, 0.1811856627 } }, + { { 0.9572628736, 0.9389859438, 0.6619243026, 0.6849089265, + 0.7276935577, 0.7839781940, 0.7987243533, 0.7748397291, + 0.7101089358, 0.7277627885 }, + { 0.5809935033, 0.5575934947, 0.3544703424, 0.3636780381, + 0.3736472726, 0.4486242235, 0.4684934616, 0.4481396079, + 0.3456780314, 0.4478626847 } }, + { { 0.1259394884, 1.3096476197, 1.0794552267, 1.0009475052, + 0.9061013162, 0.9216782451, 0.8954397738, 0.9160013199, + 0.8575012982, 0.7479089499 }, + { -0.3689222336, 1.5293861628, 0.7323320210, 0.4102703631, + 0.3825780451, 0.2828164697, 0.2644010782, 0.2455010712, + 0.2482010722, 0.2335241437 } }, + { { 0.5380704105, 0.1600702703, -0.0657605827, -0.2390452623, + -0.3885837793, -0.4150299430, -0.3001760542, -0.1451683044, + 0.1312010288, 0.2798395455 }, + { 0.2074933648, 0.0560163856, -0.0956682861, -0.2893068194, + -0.3889991641, -0.3918376267, -0.3550068438, -0.2649375796, + -0.0554451942, 0.1167317927 } }, + { { 0.6092396677, 0.5101011693, 0.4012011290, 0.5416011810, + 0.5715781152, 0.6476627588, 0.6988243163, 0.7306012511, + 0.7531704903, 0.6534781456 }, + { 0.2060395181, 0.1409625709, 0.1024702489, 0.1834010482, + 0.1946856678, 0.2547779977, 0.3134857118, 0.3283011019, + 0.3837549686, 0.3501780331 } }, + { { 0.4516011477, 0.5351627171, 0.8068243563, 0.7049858570, + 0.7165473998, 0.6005858183, 0.4870473146, 0.2500010729, + 0.3132087886, 0.4462703764 }, + { 0.1053087115, 0.1348702610, 0.4457857609, 0.3499703407, + 0.3537780344, 0.2628780007, 0.1665087342, 0.0200856030, + 0.0329625309, 0.1525241137 } }, + { { 0.7058166265, 0.7305320203, 1.1684860289, 1.4524707496, + 1.3212091625, 1.2613245249, 1.1712552607, 1.1154552400, + 1.0487167537, 0.9153782427 }, + { 0.2286087573, 0.2851703167, 1.2016475797, 1.5154707730, + 1.2726091444, 1.1459167898, 0.9801090360, 0.9296397865, + 0.8490551412, 0.6772243083 } }, + { { 0.6686396897, 0.5728935003, 0.4734780788, 0.6970243156, + 0.5852165818, -0.0762836635, -0.2054683268, -0.1380375326, + 0.1282933354, 0.3467164934 }, + { 0.2925087810, 0.2344933748, 0.1677548885, 0.2747856975, + 0.2097087502, -0.2795452774, -0.3761222363, -0.3183837533, + -0.0834836662, 0.1482318044 } }, + { { 0.6559704542, 0.7737320364, 0.9867551923, 0.9912551939, + 0.9508936405, 0.9114320874, 0.8336859047, 0.7905551195, + 0.7672935724, 0.7532397211 }, + { 0.1843702793, 0.2565087676, 0.7571858764, 0.7545551062, + 0.6793704629, 0.5981627405, 0.5078165531, 0.4282011390, + 0.3948318958, 0.4502165318 } }, + { { 0.4430857599, 0.6102781296, 0.8485012949, 0.8573628366, + 0.9078320861, 0.9979705811, 1.0411013663, 1.0524552166, + 1.0194321275, 0.9023628533 }, + { 0.0070009828, 0.0084548295, 0.1613856554, 0.3484472632, + 0.4385857582, 0.5895088911, 0.6367935240, 0.6736935377, + 0.7026320100, 0.5924165845 } }, + { { 1.0532859862, 1.1059706211, 1.1311013997, 1.1250783205, + 1.0425552130, 0.9993551970, 0.9673013389, 0.9386397898, + 0.8836013079, 0.8336859047 }, + { 0.9791398048, 1.1481321752, 1.1275706291, 1.0082167387, + 0.8809705377, 0.8031551242, 0.7287320197, 0.6496704519, + 0.5211088657, 0.4734088480 } }, + { { -0.0251221061, -0.0443682671, 0.1282241046, 0.3850703537, + 0.4252934456, 0.4547857642, 0.4690473080, 0.4873242378, + 0.6001012027, 0.5882627368 }, + { -0.0562759638, -0.0246374905, 0.0070009828, 0.0971394777, + 0.1232394874, 0.1278779507, 0.1302317977, 0.1462241113, + 0.2073549032, 0.2446010709 } }, + { { 1.1749244928, 1.1155937016, 0.9236167073, 0.6288319826, + 0.6515396833, 0.5391781032, 0.5398011804, 0.4997165501, + 0.4066703618, 0.3998857439 }, + { 0.9403013289, 0.7346166372, 0.1841625869, 0.1319625676, + 0.1395087242, 0.0857856274, 0.0952702463, 0.0860625505, + 0.0829471648, 0.1132010221 } }, + { { 0.9047167003, 0.9840551913, 0.9933321178, 0.9360090196, + 0.9164859354, 0.9213320911, 0.8701705337, 0.8815936148, + 0.8414397538, 0.8188012838 }, + { 0.0961010158, -0.0147374868, 0.0202240646, 0.1002548635, + 0.1407548785, 0.1837472022, 0.1858241260, 0.2064549029, + 0.2228626013, 0.2859318554 } }, + { { 0.4034165144, 0.1918472052, 2.1959402561, 0.4763165414, + 0.6577012241, 0.7036704719, 0.6626858413, 0.7650089562, + 0.7702704966, 0.6543781459 }, + { 0.0940933228, -0.1222529113, 2.3491480052, 0.1385394931, + 0.3052472472, 0.3665857315, 0.3350857198, 0.4722319245, + 0.4313857555, 0.3846549690 } }, + { { 0.8215012848, 0.8613782227, 1.0399936736, 1.4082322717, + 0.4075011313, 0.4091626704, 0.5230473280, 0.6101396680, + 0.7510243356, 0.7237474024 }, + { 0.4810934663, 0.5670088828, 0.9207782447, 1.3007860780, + 0.0453548431, 0.0858548582, 0.1803548932, 0.2790087759, + 0.3974626660, 0.4581780732 } }, + { { 1.5921784937, 1.4987169206, 1.1321398616, 0.8235089779, + 0.6888550818, 0.6621319950, 0.6192089021, 0.6533396840, + 0.7196627855, 0.6549319923 }, + { 1.5911400318, 1.4768399894, 0.9358705580, 0.4674549997, + 0.3522549570, 0.3144549429, 0.2985318601, 0.3559241891, + 0.4061857462, 0.3958703578 } }, + { { 0.7975474298, 0.8712782264, 0.8974474669, 0.3008164763, + 0.5562088788, 0.6655935347, 0.8921166956, 1.0918475389, + 0.9544936419, 0.8554936051 }, + { 0.3769703507, 0.4930703938, 0.6619243026, -0.0382759571, + 0.1766856611, 0.3015780151, 0.5952550471, 0.8903859258, + 0.7395320237, 0.6205935180 } }, + { { 0.2206472158, 2.4467634261, 1.2920629978, 1.0239321291, + 0.9014628530, 0.8552166820, 0.8219859004, 0.9005628526, + 0.7614781857, 0.7763628066 }, + { -0.2722068131, 2.8967635930, 1.3039706945, 0.7695089579, + 0.6132550538, 0.5701242685, 0.5737935007, 0.6533396840, + 0.5422934890, 0.5150857866 } }, +}; + +static const float wmavoice_lsp10_intercoeff_b[32][2][10] = { + { { 0.4881048799, -0.1998192370, -0.3872502148, 0.0109423101, + 0.0406953394, 0.1788437665, 0.1673750877, 0.3409781158, + 0.4061202109, 0.5221177042 }, + { 0.1492218077, -0.1372330189, -0.2683691680, -0.0621950924, + -0.0624572337, -0.0068177581, -0.0076041818, 0.0680235624, + 0.1055752933, 0.1199930608 } }, + { { 0.7934338748, 0.0012430847, 0.4239458144, 0.5521328747, + 0.6497149467, 0.6423749924, 0.7170197070, 0.7169541717, + 0.7778364718, 0.8397018015 }, + { 0.2768190503, -0.0491535664, -0.0325731337, 0.0261465013, + 0.0469867289, 0.0649434030, 0.0781815350, 0.1031504869, + 0.1194687784, 0.2451654971 } }, + { { 0.7212139666, 0.1658677757, 0.0101558864, 0.5636015534, + 1.3175852597, 1.1911676526, 1.1266809106, 0.8230558336, + 0.8604109585, 0.8094900250 }, + { 0.3658815324, 0.0816549063, -0.2092563212, 0.1946377754, + 1.0856558084, 0.9491457641, 0.8461242616, 0.5193652213, + 0.5975488424, 0.5293265879 } }, + { { 0.9507186115, 0.9078585207, 0.8773190677, 0.8677509129, + 0.8024122119, 0.8127667904, 0.8246286809, 0.8779088855, + 0.9454102516, 0.9863698184 }, + { 0.6883807778, 0.6900191605, 0.7059442401, 0.6552854478, + 0.5843107104, 0.5553441048, 0.5887671113, 0.6494528055, + 0.7725936472, 0.7792782485 } }, + { { 0.2399882078, 0.1938513517, 0.4441962242, 0.4475385249, + 0.3055235147, 0.1745184362, 0.1174371839, 0.0679580271, + 0.0782470703, 0.1695377529 }, + { 0.0170370936, 0.0253600776, 0.2072205544, 0.1907711923, + 0.1096384823, 0.0327000320, -0.0134368241, -0.0461389422, + -0.0372916758, -0.0243156850 } }, + { { 0.5457104146, 0.3774812818, 0.5235594809, 0.2994287312, + 0.2394639254, 0.5731041729, 0.9971176088, 1.1646913886, + 0.9028123021, 0.7777709365 }, + { 0.2288472056, 0.1181580722, 0.2074171603, 0.0355180502, + -0.0024924278, 0.2596487999, 0.7474936247, 0.9103488624, + 0.5927647650, 0.4772915542 } }, + { { 0.6541713476, 0.6412608922, 0.7625012100, 0.7826205492, + 0.4839106202, 0.3311478198, 0.4577620327, 0.8572652638, + 0.9442306161, 0.8282986581 }, + { 0.2852075696, 0.2614837885, 0.4221763611, 0.4314823747, + 0.1434547007, 0.0435788929, 0.1397191882, 0.5525916219, + 0.6752081811, 0.5487250388 } }, + { { 0.6742251515, 1.0610800683, 1.0500701368, 0.9570100009, + 0.9325653315, 0.9243078828, 0.9148707986, 0.8317720294, + 0.7696445584, 0.6784849465 }, + { 0.2283884585, 0.9739181101, 0.5336519182, 0.4974764287, + 0.3998288214, 0.3674543798, 0.2719694376, 0.2608939707, + 0.2087934017, 0.1675716937 } }, + { { 0.3736146986, -1.5457833707, 0.9216864705, 0.7959242165, + 0.7358283401, 0.7233110964, 0.7271121442, 0.6852350831, + 0.6891672015, 0.6589554250 }, + { 0.1246460676, -1.7167649865, 0.7037160397, 0.4803061783, + 0.4694928527, 0.4654951990, 0.5208069980, 0.5305717587, + 0.5288023055, 0.5278192759 } }, + { { 1.0116009116, 0.9882703424, 0.8393741250, 0.8889843524, + 0.8934407532, 0.8906227350, 0.9222107530, 0.8973073363, + 0.9257496595, 0.9306648076 }, + { 0.5097970665, -0.0106843412, 0.1419473886, 0.2804890275, + 0.3719763160, 0.3694859743, 0.4640534222, 0.5034401417, + 0.5592106879, 0.6652468145 } }, + { { 0.9718209803, 0.7615181804, 0.2172474563, 0.4920369983, + 0.4310891628, 0.5038333535, 0.4668059051, 0.5339140594, + 0.4453758597, 0.4050061107 }, + { 0.6543679535, 0.1205173433, -0.0050483048, 0.1580035388, + 0.1308719218, 0.1700620353, 0.1740596890, 0.2179683447, + 0.1967349052, 0.1703897119 } }, + { { 0.7663022578, 0.4025157690, 1.3811545074, 1.1642981768, + 1.0709758997, 0.9812580645, 1.0092416406, 0.9089070857, + 0.7776398659, 0.8189926445 }, + { 0.3471384346, 0.0602248609, 1.3968829811, 1.0841484964, + 0.8940305710, 0.7313719392, 0.7345176339, 0.5304406881, + 0.4076275229, 0.4535677731 } }, + { { 0.1300854981, 0.1323136985, 0.7564064264, 0.7335346043, + 0.7924508452, 0.6039057672, 0.6896914840, 0.3694859743, + 0.2825861573, 0.3179096878 }, + { -0.0208423138, -0.0530856848, 0.3449102342, 0.3819376826, + 0.4466865659, 0.2807511687, 0.3842969537, 0.1144880950, + 0.0617321730, 0.0767397583 } }, + { { 0.7559476793, 0.8462553322, 0.6452585459, 1.1308751702, + 1.0606868565, 0.9498666525, 0.7425129414, 0.6221901178, + 0.6574481130, 0.6976212561 }, + { 0.3420922160, 0.4310236275, 0.2800958157, 0.9317133725, + 0.8210897744, 0.6144569516, 0.3227593005, 0.2464762032, + 0.2769501209, 0.3521846533 } }, + { { 0.7609938979, 0.6943444908, 1.1490939856, 0.4350868165, + 0.6101971567, 0.6246149242, 0.7370079756, 0.6522052884, + 0.6966382265, 0.7565374970 }, + { 0.3939306438, 0.3449102342, 0.9874839187, 0.0910919905, + 0.2804234922, 0.2888775468, 0.4060546756, 0.3284608722, + 0.3483836055, 0.4819445610 } }, + { { 0.7828826904, 1.1833034158, 1.9916158915, 0.8667678833, + 0.9218830764, 0.8856420517, 0.9373494089, 0.7415299118, + 0.7450032830, 0.7074515522 }, + { 0.4685098231, 1.1713104546, 1.9853245020, 0.6206828058, + 0.6664264500, 0.6033814847, 0.6089519858, 0.3784643114, + 0.4212588668, 0.3441893458 } }, + { { 0.4671335816, 0.4177199602, 0.0804097354, -0.1836975515, + -0.1802241802, -0.0775958896, -0.0250365734, 0.0884050429, + 0.2136430144, 0.3472039700 }, + { 0.1187478900, 0.1122598946, -0.0381436348, -0.2284581661, + -0.2302276194, -0.1738672554, -0.1350048184, -0.0547896028, + 0.0000634491, 0.0545888245 } }, + { { 0.5545576811, 0.4791920781, 0.8204999566, 0.8462553322, + 0.9212277234, 0.8946203887, 0.9659883380, 0.9137566984, + 0.9225384295, 0.9207034409 }, + { 0.1176993251, -0.0429277122, -0.0330318809, 0.0566859543, + 0.0983008742, 0.1593797803, 0.1732077301, 0.2320584357, + 0.2739354968, 0.3753186166 } }, + { { 0.7157745361, 0.6367389560, -1.2036890686, 0.7107283175, + 0.6885118484, 0.7332724631, 0.7436270416, 0.7113181353, + 0.5935511887, 0.6023984551 }, + { 0.3664058149, 0.3280676603, -1.3082178831, 0.3909815550, + 0.3641776145, 0.3926854730, 0.3898674548, 0.4086760879, + 0.3127979338, 0.3949792087 } }, + { { 1.0267395675, 1.0621941686, 1.0415505469, 0.9971176088, + 0.9764739871, 0.9904330075, 0.9591071308, 0.9338760376, + 0.9026156962, 0.9073997736 }, + { 0.9855833948, 1.0548542142, 0.9787021875, 0.8573307991, + 0.8360973597, 0.8193203211, 0.7386463583, 0.7038471103, + 0.6333966553, 0.6434235573 } }, + { { 0.6235008240, 0.7635497749, 0.8094900250, 0.7227212787, + -0.0610809922, -0.1357912421, -0.2359291911, 0.0800165236, + 0.3972729445, 0.5078965425 }, + { 0.2983146310, 0.4983939230, 0.4145742655, 0.3284608722, + -0.3203386664, -0.3495018780, -0.4734291434, -0.1808139980, + 0.1211071610, 0.2001427412 } }, + { { 0.8925887942, 0.8804647624, 0.6153089106, 0.6760601401, + 0.7887153327, 1.0065546930, 1.0829033256, 1.0347348750, + 0.9800128937, 0.9125770628 }, + { 0.5955827832, 0.6195687056, 0.2924164534, 0.3553958833, + 0.5417127609, 0.8713553548, 0.9977729619, 0.8817754686, + 0.7645328045, 0.6604627371 } }, + { { 1.1581378579, 1.0359145105, 0.7731179297, 0.6839243770, + 0.6839899123, 0.6664264500, 0.6910677254, 0.6579068601, + 0.6779606640, 0.6243527830 }, + { 1.1508634388, 0.8400294781, 0.2358594835, 0.2542749047, + 0.2484422624, 0.2620736063, 0.2676441073, 0.2713796198, + 0.3068997562, 0.3223005533 } }, + { { 0.1376220584, 1.2572927773, 0.8593623936, 0.6218624413, + 0.5128116906, 0.5393534899, 0.4436064065, 0.4334484339, + 0.4494390488, 0.4002220333 }, + { -0.1159995794, 1.2433337569, 0.4805027843, 0.2632532418, + 0.1769432425, 0.1868390739, 0.1555131972, 0.1530228555, + 0.1490252018, 0.1559064090 } }, + { { 0.1817273200, -0.0085216761, 0.0739872754, 0.1808098257, + 0.2770811915, 0.3344901204, 0.4292541742, 0.5404020548, + 0.5780193210, 0.5707449019 }, + { -0.0035409927, -0.0188107193, -0.0057691932, 0.0132360458, + 0.0560961366, 0.0534747243, 0.1002013981, 0.1737320125, + 0.1706518531, 0.1637706459 } }, + { { 0.9648087025, 1.0030813217, 0.9501943290, 0.8381944895, + 0.7545059025, 0.7621735334, 0.7121700943, 0.7328792512, + 0.7534573376, 0.7414643764 }, + { 0.1872322857, -0.0081939995, 0.0663851798, 0.0963348150, + 0.0509188473, 0.0565548837, 0.0471833348, 0.0809340179, + 0.1049199402, 0.1751082540 } }, + { { 0.6792713702, 0.9521603882, 0.5296542645, 0.3657504618, + 0.3905883431, 0.3121425807, 0.2726903260, 0.3156159520, + 0.2859284580, 0.3179096878 }, + { 0.2307477295, 0.3771536052, 0.0743804872, 0.0260154307, + 0.0477731526, 0.0391880274, 0.0228042006, 0.0572757721, + 0.0337485969, 0.0492149293 } }, + { { 0.8649328947, 0.9505875409, 1.0443030298, 1.1704584956, + 1.2709241211, 1.3232212961, 1.2477901578, 1.1513877213, + 1.0346038043, 0.9695272446 }, + { 0.4620873630, 0.5685822368, 0.8975039423, 1.0476453304, + 1.2278674245, 1.2290470600, 1.1962138712, 1.0051129162, + 0.8706344664, 0.7477557659 } }, + { { 0.4188340604, 0.6011532843, 0.4726385474, 0.6389671564, + 0.6753392518, 0.7842589319, 0.6147846282, 0.6708828509, + 0.6406055391, 0.5398777723 }, + { 0.1012499630, 0.2312064767, 0.1773364544, 0.2800302804, + 0.3348177969, 0.4343003929, 0.2822584808, 0.3293128312, + 0.3024433553, 0.2401848137 } }, + { { 0.5049474537, 0.7943513691, 0.9536021650, 0.9407572448, + 0.9823721647, 0.9747045338, 1.0145500004, 0.9629737139, + 0.9526191354, 0.9283710718 }, + { 0.0566204190, 0.0973178446, 0.5812305510, 0.5687133074, + 0.6834000945, 0.6616423726, 0.7611905038, 0.6683925092, + 0.6463071108, 0.6118355393 } }, + { { 0.8969141245, 0.9359731674, 0.8756151497, 0.8419300020, + 0.8353109360, 0.6807131469, 0.3358008265, 0.3386188447, + 0.3524467945, 0.4495045841 }, + { 0.5298508704, 0.4606455863, 0.4934132397, 0.4415748119, + 0.4015327394, 0.2052544951, -0.0329663455, -0.0154684186, + 0.0418094397, 0.1631152928 } }, + { { 0.6345762908, 2.5209445655, 1.0373562872, 0.9166402519, + 0.8865595460, 0.8907538056, 0.8522190452, 0.7290782034, + 0.7385808229, 0.6345107555 }, + { 0.2641707361, 2.5696372986, 0.8539884984, 0.6532538533, + 0.6087553799, 0.5851626694, 0.5276226699, 0.4330552220, + 0.3971418738, 0.3599833548 } }, +}; + +static const float wmavoice_lsp16_intercoeff_a[32][2][16] = { + { { 0.5337238312, 0.4810695648, -0.3766536713, -0.1204767227, + -0.0898437500, -0.0070896149, 0.1134738922, 0.1337728500, + 0.3739156723, 0.3849058151, 0.4220180511, 0.5404901505, + 0.5224876404, 0.5502910614, 0.5313453674, 0.4405946732 }, + { 0.1775283813, 0.1679325104, -0.2702789307, -0.1359367371, + -0.1452455521, -0.0888595581, -0.0256662369, -0.0023736954, + 0.1074047089, 0.1431636810, 0.1357412338, 0.2045526505, + 0.2686481476, 0.3404531479, 0.3209333420, 0.1493968964 } }, + { { 0.7402400970, 0.0838251114, 0.6486282349, 0.6145095825, + 0.7331047058, 0.7183008194, 0.7436847687, 0.7627944946, + 0.7653779984, 0.7795667648, 0.8399305344, 0.8393154144, + 0.8219690323, 0.7474164963, 0.6681070328, 0.6490793228 }, + { 0.2850513458, -0.0544128418, -0.0300130844, 0.0204677582, + 0.0328931808, 0.0589332581, 0.0796422958, 0.1187639236, + 0.1320505142, 0.1539077759, 0.2189874649, 0.2865276337, + 0.2973947525, 0.2614307404, 0.2416648865, 0.2428951263 } }, + { { 0.6129922867, 0.7300701141, 0.2073822021, 0.5005893707, + 0.5713691711, 0.5374965668, 0.6293134689, 0.5639057159, + 0.7402811050, 0.6982889175, 0.4668397903, 0.6698703766, + 0.8758535385, 0.8678569794, 0.8678569794, 0.7810840607 }, + { 0.2986249924, 0.3269615173, 0.0096416473, 0.1800708771, + 0.2474060059, 0.2203407288, 0.3007984161, 0.2674179077, + 0.4424810410, 0.4046306610, 0.2063980103, 0.4230022430, + 0.6222190857, 0.6574449539, 0.6776618958, 0.6604385376 } }, + { { 0.7258052826, 0.5073966980, -0.3947381973, 0.5254812241, + 1.0561246872, 0.9706230164, 0.9727144241, 0.9185838699, + 0.8184833527, 0.9093980789, 0.8645353317, 0.7870302200, + 0.6347675323, 0.5123996735, 0.2846002579, 0.3252801895 }, + { 0.4306297302, 0.2182903290, -0.4902458191, 0.1783485413, + 0.7783365250, 0.7152252197, 0.7404451370, 0.6012639999, + 0.5421304703, 0.6619558334, 0.6316919327, 0.5596818924, + 0.3952398300, 0.3567333221, 0.1505041122, 0.1290159225 } }, + { { 0.3077287674, 0.2543363571, 0.2834520340, 0.5282287598, + 0.5350360870, 0.4943971634, 0.4521999359, 0.3086309433, + 0.2372770309, 0.0819387436, -0.1385612488, -0.0848407745, + -0.0380916595, 0.1192150116, 0.3228197098, 0.3012905121 }, + { 0.0567188263, 0.0196886063, 0.0682420731, 0.2102527618, + 0.2452325821, 0.2060699463, 0.1620273590, 0.0784120560, + 0.0418329239, -0.0508041382, -0.2193880081, -0.1644783020, + -0.1361827850, -0.0307512283, 0.1486587524, 0.2356367111 } }, + { { 0.4387903214, 0.5723943710, 0.6147556305, 0.9973602295, + 1.1645498276, 1.1898927689, 1.0326681137, 0.6939010620, + 0.6064310074, 0.4686441422, 0.4646663666, 0.4895582199, + 0.5654230118, 0.6004848480, 0.6179132462, 0.6439123154 }, + { 0.1324195862, 0.2426080704, 0.3132238388, 0.7359752655, + 0.9749288559, 0.9535636902, 0.8105278015, 0.4118890762, + 0.3013315201, 0.2006158829, 0.2331352234, 0.2535161972, + 0.3375005722, 0.4103307724, 0.4102897644, 0.4529380798 } }, + { { 0.7335557938, 0.9203472137, 0.4852113724, 0.8646993637, + 0.7304391861, 0.7503690720, 0.6289854050, 0.6900463104, + 0.6421079636, 0.5184278488, 0.4444904327, 0.2660236359, + 0.2143125534, 0.2406396866, 0.4836940765, 0.5597229004 }, + { 0.3689947128, 0.4967346191, 0.1176567078, 0.5127687454, + 0.3235168457, 0.3426265717, 0.2417469025, 0.3310623169, + 0.2629890442, 0.2130823135, 0.1329116821, 0.0468769073, + -0.0081968307, 0.0146446228, 0.2440433502, 0.3408632278 } }, + { { 0.9425325394, 0.9597969055, 0.6160678864, 0.7050962448, + 0.8063859940, 0.9063224792, 0.9890356064, 1.0038805008, + 1.0338163376, 0.9453620911, 0.9634056091, 0.8068370819, + 0.6859455109, 0.8909034729, 0.9990415573, 1.0122871399 }, + { 0.6895952225, 0.6451835632, 0.3169965744, 0.4268569946, + 0.5666122437, 0.7722673416, 0.8845882416, 0.9061584473, + 0.9550399780, 0.8118810654, 0.8601064682, 0.6129922867, + 0.5069866180, 0.7065315247, 0.7862920761, 0.7766551971 } }, + { { 0.5641517639, -0.0941905975, 0.0412998199, 0.1810550690, + 0.3459482193, 0.4213209152, 0.4401025772, 0.5397109985, + 0.5607891083, 0.6348905563, 0.6861915588, 0.7280607224, + 0.7267074585, 0.6447324753, 0.5948257446, 0.5475025177 }, + { 0.1906919479, -0.0519113541, -0.0608100891, -0.0018815994, + 0.0383062363, 0.0362558365, 0.0529870987, 0.0692672729, + 0.0953073502, 0.1327886581, 0.1390628815, 0.1904459000, + 0.2362518311, 0.2063980103, 0.2311668396, 0.2291574478 } }, + { { 0.9901428223, 0.9589767456, 0.9012374878, 0.8017930984, + 0.8929538727, 0.8512077332, 0.8790111542, 0.8832759857, + 0.8949632645, 0.9159183502, 0.9293279648, 0.9152622223, + 0.9247350693, 0.8753614426, 0.8730239868, 0.8066730499 }, + { 0.4230432510, -0.0464572906, 0.0182533264, 0.1159753799, + 0.2349395752, 0.2740612030, 0.2987070084, 0.3620643616, + 0.3923282623, 0.4694643021, 0.5202322006, 0.5356512070, + 0.5564012527, 0.5362663269, 0.4791831970, 0.5046901703 } }, + { { 0.9785375595, 0.8820457458, 0.3965110779, 0.4790191650, + 0.3907699585, 0.4195575714, 0.2938270569, 0.4091415405, + 0.3659191132, 0.4030723572, 0.4168510437, 0.5030908585, + 0.5023117065, 0.5511522293, 0.5354051590, 0.5563192368 }, + { 0.6592903137, 0.2933759689, 0.0562677383, 0.1286878586, + 0.0758285522, 0.1192560196, 0.0508956909, 0.1175336838, + 0.0684061050, 0.0988750458, 0.0923957825, 0.1819572449, + 0.1965150833, 0.2257537842, 0.3049812317, 0.2993221283 } }, + { { 0.7120265961, 0.7847747803, 0.6065950394, 0.7235908508, + 0.6740531921, 0.6535081863, 0.3734235764, 0.4788551331, + 0.4410867691, 0.6927528381, 1.0758495331, 1.1148891449, + 1.0708875656, 0.8896322250, 0.6401805878, 0.5057153702 }, + { 0.4210338593, 0.4763126373, 0.3229017258, 0.4079113007, + 0.3922462463, 0.3529195786, 0.1258993149, 0.2168960571, + 0.2207508087, 0.4605655670, 0.8759355545, 0.9526205063, + 0.8843832016, 0.7001342773, 0.4503545761, 0.3484086990 } }, + { { 0.5254402161, 0.5349540710, 0.7036199570, 0.6240234375, + 0.6464548111, 0.7537727356, 0.8311548233, 0.7334327698, + 0.3484907150, 0.1846637726, 0.0894021988, 0.3977823257, + 0.7672233582, 0.9224796295, 0.8818407059, 0.7453250885 }, + { 0.2587652206, 0.2524499893, 0.4135704041, 0.3129367828, + 0.3403711319, 0.4473199844, 0.5330266953, 0.4227561951, + 0.1080198288, -0.0044651031, -0.0727024078, 0.1583776474, + 0.5302381516, 0.7313823700, 0.6735610962, 0.5630855560 } }, + { { 0.7936325073, 0.8551034927, 0.9755849838, 0.8953323364, + 0.9345769882, 0.7202281952, 0.8388233185, 0.7941656113, + 0.7550849915, 0.7894906998, 0.8590402603, 0.7813711166, + 0.8483371735, 0.8652324677, 0.8586711884, 0.9584846497 }, + { 0.4781579971, 0.4731960297, 0.8289403915, 0.6175031662, + 0.7262973785, 0.3638277054, 0.5544328690, 0.4761896133, + 0.4388723373, 0.5021476746, 0.5630445480, 0.4562187195, + 0.5190429688, 0.5937595367, 0.6121721268, 0.6973457336 } }, + { { 1.0724458694, 1.0449705124, 0.8594503403, 0.7604160309, + 0.7837905884, 0.8136444092, 0.7623023987, 0.6098756790, + 0.6432561874, 0.6395244598, 0.6853713989, 0.7401580811, + 0.7399530411, 0.7652549744, 0.7675104141, 0.7393789291 }, + { 0.9382266998, 0.8419809341, 0.3087539673, 0.3620233536, + 0.3547649384, 0.4241094589, 0.2857894897, 0.2123851776, + 0.2355957031, 0.2794332504, 0.3219995499, 0.3898267746, + 0.3937635422, 0.4058198929, 0.4228382111, 0.4181222916 } }, + { { 1.0275421143, 1.0940570831, 1.0164289474, 0.9097671509, + 0.9400720596, 0.8976287842, 0.9175586700, 0.8900833130, + 0.9154262543, 0.9492578506, 1.0011329651, 1.0361537933, + 1.0359487534, 0.9320344925, 0.8974237442, 0.8811845779 }, + { 1.0046186447, 1.0860195160, 0.9442958832, 0.7473344803, + 0.7876043320, 0.7410602570, 0.7422084808, 0.6844692230, + 0.7256412506, 0.8455486298, 0.8969316483, 0.9362173080, + 0.9092340469, 0.8227071762, 0.7481546402, 0.7088689804 } }, + { { 0.2205047607, -0.0129537582, 0.0972347260, 0.1154832840, + 0.0951843262, 0.1532516479, 0.1288108826, 0.1749858856, + 0.1591157913, 0.2134923935, 0.2477340698, 0.2634811401, + 0.3032999039, 0.3272485733, 0.3170785904, 0.3172016144 }, + { 0.0032854080, -0.0446119308, 0.0284643173, 0.0155467987, + -0.0063104630, 0.0226001740, 0.0086984634, 0.0262088776, + 0.0173921585, 0.0360507965, 0.0366659164, 0.0215339661, + 0.0412178040, 0.1047391891, 0.1258172989, 0.0609836578 } }, + { { 0.1495609283, 0.3275766373, 0.8598194122, 0.6847562790, + 0.7550849915, 0.5662431717, 0.6930398941, 0.7526245117, + 0.7300291061, 0.7284708023, 0.6608896255, 0.5224056244, + 0.4273900986, 0.5757160187, 0.4625749588, 0.5123586655 }, + { -0.0352210999, -0.0428895950, 0.3110914230, 0.2699604034, + 0.3307752609, 0.2059469223, 0.2332172394, 0.3204412460, + 0.2846412659, 0.3354911804, 0.2448635101, 0.1514062881, + 0.1062564850, 0.2613077164, 0.2123441696, 0.3000602722 } }, + { { 0.6218910217, 0.6033554077, 0.4551525116, 0.3161764145, + 0.2864866257, 0.6195125580, 0.7577505112, 1.0062179565, + 0.8485012054, 0.6777849197, 0.7455301285, 0.3630485535, + 0.2327661514, 0.5563192368, 0.4448595047, 0.3806819916 }, + { 0.2624969482, 0.2679510117, 0.1839666367, 0.0335903168, + 0.0294075012, 0.2902593613, 0.4959144592, 0.7905979156, + 0.5748548508, 0.3753919601, 0.4855394363, 0.1089630127, + 0.0362968445, 0.3632535934, 0.2681150436, 0.2735691071 } }, + { { 0.7064495087, 0.4431781769, 0.7628355026, 0.7271585464, + 0.7812070847, 0.7806739807, 0.8909854889, 0.8958654404, + 0.9126787186, 0.9038209915, 0.9246120453, 0.9624624252, + 0.9732475281, 0.7420034409, 0.5060844421, 0.5189199448 }, + { 0.3457021713, -0.0149221420, 0.3174476624, 0.3580865860, + 0.4243965149, 0.4275541306, 0.5887155533, 0.6478490829, + 0.6320610046, 0.6627349854, 0.6868886948, 0.7396659851, + 0.7551259995, 0.5275316238, 0.3075237274, 0.3806819916 } }, + { { 0.4376831055, 0.4904603958, 0.6262788773, 0.5901098251, + 0.4176712036, 0.0221490860, -0.1612796783, -0.2236118317, + -0.1087894440, -0.0022506714, 0.1051902771, 0.3307752609, + 0.4167690277, 0.4997692108, 0.4645843506, 0.5228567123 }, + { 0.1228237152, 0.1671123505, 0.2931299210, 0.2549924850, + 0.1435737610, -0.1124801636, -0.2181987762, -0.2723293304, + -0.1573429108, -0.0837745667, -0.0325555801, 0.1024427414, + 0.1938495636, 0.2825498581, 0.2247285843, 0.2879629135 } }, + { { 0.6100807190, 0.7900238037, 0.9581155777, 0.8999662399, + 0.9277286530, 0.9720993042, 0.9966220856, 0.9630365372, + 0.9571723938, 0.8992280960, 0.8370189667, 0.7417984009, + 0.7174396515, 0.6122951508, 0.6746683121, 0.7030458450 }, + { 0.0859165192, 0.0914115906, 0.6077432632, 0.5471334457, + 0.5943746567, 0.6805324554, 0.6680250168, 0.6033554077, + 0.6302976608, 0.4874258041, 0.3647298813, 0.2770137787, + 0.2544183731, 0.2608156204, 0.3331537247, 0.4950942993 } }, + { { 0.4051227570, 1.1022176743, 0.8262338638, 0.6573219299, + 0.5948667526, 0.5426225662, 0.4987850189, 0.4370269775, + 0.4421119690, 0.3837165833, 0.3728494644, 0.3706760406, + 0.4169740677, 0.3559951782, 0.2994041443, 0.3896217346 }, + { 0.0716867447, 0.9253911972, 0.2780799866, 0.2460117340, + 0.1675224304, 0.1527595520, 0.1278266907, 0.1226596832, + 0.1165084839, 0.0982189178, 0.0952253342, 0.1113414764, + 0.1498889923, 0.0940361023, 0.0802984238, 0.1560811996 } }, + { { 0.7024717331, 0.7363853455, 0.9629545212, 0.9635286331, + 1.0819597244, 1.1529855728, 1.2984409332, 1.2693252563, + 1.2848672867, 1.2877378464, 1.2133083344, 1.0696573257, + 1.0864706039, 0.9851808548, 0.8312368393, 0.8047866821 }, + { 0.3001422882, 0.2273120880, 0.6279602051, 0.6936140060, + 0.8097076416, 0.9440498352, 1.1028738022, 1.1766471863, + 1.1199741364, 1.1608181000, 1.0665817261, 0.8872537613, + 0.9082908630, 0.7602519989, 0.6542053223, 0.7317514420 } }, + { { 0.0643463135, -0.6808919907, 0.2889881134, 0.6142225266, + 0.6356697083, 0.6825828552, 0.6259508133, 0.4945611954, + 0.5866651535, 0.6357517242, 0.5208883286, 0.4207878113, + 0.5125637054, 0.3758020401, 0.5424175262, 0.6172571182 }, + { -0.0636806488, -0.7585611343, 0.0850553513, 0.2996912003, + 0.3620643616, 0.4444084167, 0.4597454071, 0.3120756149, + 0.4016780853, 0.5026807785, 0.4111919403, 0.3183498383, + 0.3666572571, 0.1829824448, 0.3269205093, 0.4095926285 } }, + { { 0.9277286530, 0.9651279449, 0.9602069855, 0.9327726364, + 0.9208393097, 0.8868436813, 0.9011554718, 0.8569488525, + 0.9015245438, 0.8969726562, 0.9367094040, 0.9445009232, + 0.8617057800, 0.8215589523, 0.8333692551, 0.7939195633 }, + { 0.1719102859, 0.1142530441, 0.1245460510, 0.1646108627, + 0.1408672333, 0.0949792862, 0.0271930695, 0.0265779495, + -0.0064334869, -0.0109033585, 0.0152187347, 0.0252656937, + 0.0166950226, 0.0736141205, 0.1205682755, 0.1895437241 } }, + { { 0.5964250565, 0.6065130234, 0.7228116989, 0.7348270416, + 0.0718097687, 0.2369899750, 0.2456426620, 0.4961194992, + 0.6410417557, 0.6765956879, 0.6771287918, 0.7285938263, + 0.6706905365, 0.5105543137, 0.5068635941, 0.5430326462 }, + { 0.2782440186, 0.2620048523, 0.4424400330, 0.4124631882, + -0.1158838272, 0.0186223984, 0.0059919357, 0.1853609085, + 0.3568563461, 0.3791646957, 0.4100847244, 0.4654865265, + 0.4614677429, 0.3209743500, 0.3199081421, 0.3836755753 } }, + { { 0.8051557541, 0.8506336212, 0.9544658661, 0.5584516525, + 0.5874032974, 0.5727224350, 0.6177902222, 0.7659521103, + 0.9526205063, 1.0424280167, 1.0705595016, 1.0042905807, + 0.6005258560, 0.3886785507, 0.4739751816, 0.6542463303 }, + { 0.4775428772, 0.5541868210, 0.7128057480, 0.2146816254, + 0.2502765656, 0.2488822937, 0.3009214401, 0.4667987823, + 0.6929988861, 0.8599834442, 0.8784780502, 0.7463912964, + 0.3217535019, 0.1274986267, 0.2767267227, 0.5119485855 } }, + { { 0.5978193283, 0.5092830658, 1.0738401413, 0.7688636780, + 0.8214769363, 0.7682075500, 0.4970626831, 0.2783260345, + 0.2652854919, 0.3625154495, 0.5700569153, 0.5044031143, + 0.4003248215, 0.5162544250, 0.5727634430, 0.5538587570 }, + { 0.2752094269, 0.1747808456, 0.8557186127, 0.4280872345, + 0.5143680573, 0.4139804840, 0.1810960770, 0.0109539032, + 0.0317039490, 0.0842351913, 0.3129367828, 0.2614717484, + 0.1564092636, 0.2352676392, 0.3249931335, 0.3505821228 } }, + { { 0.7093610764, 0.7587757111, 1.8517618179, 1.0092525482, + 0.8078622818, 0.8792982101, 0.8210668564, 0.8600654602, + 0.6913585663, 0.6436662674, 0.6216859818, 0.6123771667, + 0.5940465927, 0.5910940170, 0.6505966187, 0.5801038742 }, + { 0.3370904922, 0.4681930542, 1.9236078262, 0.8053607941, + 0.5321245193, 0.6342344284, 0.5054693222, 0.5788326263, + 0.4400615692, 0.4086904526, 0.3924102783, 0.4220180511, + 0.3835115433, 0.4230432510, 0.5190839767, 0.3990535736 } }, + { { 0.6277141571, 1.1122236252, 1.0259838104, 0.9486427307, + 0.9184608459, 0.9059944153, 0.9080038071, 0.8282022476, + 0.8440313339, 0.7887935638, 0.7468013763, 0.6746683121, + 0.6319379807, 0.6246795654, 0.7263793945, 0.7349090576 }, + { 0.2427721024, 1.0851583481, 0.6180362701, 0.5837125778, + 0.4324750900, 0.4684801102, 0.3745307922, 0.3027257919, + 0.3646888733, 0.2409267426, 0.2158298492, 0.2052907944, + 0.2100887299, 0.2276401520, 0.3409452438, 0.4045896530 } }, + { { 0.8391513824, 0.8713426590, 1.1366233826, 1.1440868378, + 1.1443738937, 1.0877418518, 1.0516138077, 1.0099496841, + 0.9216184616, 0.8990640640, 0.9001302719, 0.8993101120, + 0.8055248260, 0.8150796890, 0.7272815704, 0.7196130753 }, + { 0.4634771347, 0.5807189941, 1.1287908554, 1.1066875458, + 1.0765056610, 0.9287538528, 0.8956193924, 0.8026132584, + 0.6725769043, 0.5856809616, 0.5527515411, 0.5183868408, + 0.4529380798, 0.5074377060, 0.4632720947, 0.5554990768 } }, +}; + +static const float wmavoice_lsp16_intercoeff_b[32][2][16] = { + { { 0.5431776047, -0.1212130189, -0.2471650839, 0.0683670044, + 0.1418520808, 0.2518971562, 0.3708084226, 0.4141484499, + 0.5712364912, 0.5852659345, 0.5670641661, 0.6401320100, + 0.6447737217, 0.6726239920, 0.4994724989, 0.5574678183 }, + { 0.2040718794, -0.1271064281, -0.2266163826, -0.0406349897, + -0.0145058036, 0.0283126831, 0.0851084590, 0.0913147926, + 0.1307432652, 0.1926501393, 0.2310355306, 0.2828245163, + 0.3171940446, 0.4424681067, 0.2960716486, 0.3510941863 } }, + { { 0.8073900938, 0.0403081179, 0.5392660499, 0.6928597689, + 0.6499369740, 0.7328097820, 0.7755761147, 0.7766191959, + 0.8820225596, 0.8423333168, 0.8898978233, 0.8488525748, + 0.8654375672, 0.6728326082, 0.6169234514, 0.6755967736 }, + { 0.3653843999, -0.0846008658, -0.0224332213, 0.1120721102, + 0.1020585299, 0.1741876006, 0.2129902244, 0.2160151601, + 0.3619422317, 0.4185815454, 0.5455245376, 0.5363975763, + 0.5429168344, 0.3505726457, 0.3296067119, 0.3620986938 } }, + { { 0.1843576431, 0.0179861784, 0.3122915626, 0.3600125313, + 0.2466817498, 0.2172668576, 0.1975526214, 0.1177569032, + 0.1196866035, 0.0849519968, 0.0962694287, 0.1591672301, + 0.2300446033, 0.3082756996, 0.4047607183, 0.3925045133 }, + { -0.0275964737, -0.0794897676, 0.1168181300, 0.1591150761, + 0.0915755630, 0.0460972190, 0.0562151074, 0.0084419847, + -0.0095511675, -0.0408957601, -0.0376100540, -0.0166962743, + 0.0656028390, 0.1226072311, 0.2293144464, 0.2142419219 } }, + { { 0.4781936407, -1.2478972673, 0.4884679914, 0.7755239606, + 0.6785174012, 0.6590117812, 0.6177057624, 0.6427918673, + 0.5402048230, 0.5512614846, 0.6424267888, 0.4229103327, + 0.5106334686, 0.5136062503, 0.4490395188, 0.4753251672 }, + { 0.2852236032, -1.3815159798, 0.1904075146, 0.4874770641, + 0.4593138695, 0.4182686210, 0.4174863100, 0.4604612589, + 0.4089330435, 0.3891666532, 0.4700576067, 0.2383370996, + 0.2801646590, 0.3398289084, 0.2766703367, 0.3374298215 } }, + { { 0.5925153494, 0.3858809471, 1.0754098296, 0.5752002001, + 0.5516265631, 0.4853909016, 0.4719351530, 0.5018194318, + 0.3037382960, 0.5154316425, 0.8809794784, 0.7755761147, + 0.5941321254, 0.3974069953, 0.5925675035, 0.6097261906 }, + { 0.3008176684, 0.0706617832, 0.8484353423, 0.2574254870, + 0.2815728188, 0.1930673718, 0.2523665428, 0.2691601515, + 0.1271967888, 0.2653007507, 0.6473292708, 0.5275835395, + 0.3928174376, 0.2405275702, 0.4008491635, 0.4556109309 } }, + { { 0.7339050174, 0.4290645123, 0.6859754324, 0.6349166036, + 0.8034263849, 0.8509387374, 0.8591269255, 1.1049811840, + 1.3928194642, 1.3423343301, 1.0849018693, 0.8943830729, + 0.8579795361, 0.6920774579, 0.5613272190, 0.4303162098 }, + { 0.4534726143, 0.0901674032, 0.3465046287, 0.3470261693, + 0.5217422843, 0.5874564052, 0.6014336944, 0.9161834717, + 1.2823571563, 1.2193550467, 0.8868207335, 0.6514494419, + 0.6249030232, 0.4453887343, 0.3665317893, 0.2242033482 } }, + { { 0.4293252826, 0.3303368688, 0.6181751490, 0.9884168506, + 0.9915460944, 0.7939864993, 0.3019129038, 0.2443348169, + 0.4543070793, 0.5617444515, 0.4895110726, 0.6600027084, + 0.6290231943, 0.5580936670, 0.5459417701, 0.4647378922 }, + { 0.1409133077, -0.0050137639, 0.2551307082, 0.6764833927, + 0.7112701535, 0.4648943543, 0.0301380754, -0.0235806108, + 0.1018499136, 0.2422486544, 0.2406318784, 0.4000146985, + 0.3713299632, 0.3259559274, 0.3820737004, 0.2888743877 } }, + { { 0.7733334899, 0.8321111202, 1.3098945022, 1.0331128836, + 1.0380675197, 0.9479974508, 0.9740223289, 0.9442945123, + 0.8926619887, 0.8719046712, 0.8640815616, 0.8404036164, + 0.8359183669, 0.7675965428, 0.6895219088, 0.7266034484 }, + { 0.3655408621, 0.4643206596, 1.2171645761, 0.8341451287, + 0.8387868404, 0.6713201404, 0.6814901829, 0.6294404268, + 0.5172048807, 0.5205948949, 0.5408828259, 0.5298783183, + 0.5781729817, 0.5000983477, 0.4727174640, 0.4326109886 } }, + { { 0.8902629018, 0.4598354101, 0.6392975450, 0.4483093619, + 0.6220867038, 0.6323089004, 0.7063676715, 0.3717993498, + 0.6718416810, 0.7876758575, 0.2807383537, 0.3118221760, + 0.6703813672, 0.7662405372, 0.7122610807, 0.7851724625 }, + { 0.6301705837, 0.1221378446, 0.3532846570, 0.1412783861, + 0.3471826315, 0.3435318470, 0.4466925859, 0.1390357614, + 0.4092981219, 0.5406742096, 0.0690450072, 0.0829179883, + 0.4625995755, 0.5700891018, 0.5542864203, 0.6545265317 } }, + { { -0.1100520492, 0.3803526163, 0.8075987101, 0.6903563738, + 0.8012359142, 0.7835035324, 0.8195941448, 0.8381088376, + 0.8033220768, 0.7511680126, 0.6393496990, 0.6096218824, + 0.6934856176, 0.6690253615, 0.6401841640, 0.5600233674 }, + { -0.1776958704, -0.0293175578, 0.1520742774, 0.1746048331, + 0.2222214937, 0.3052507639, 0.2977927327, 0.3797789216, + 0.3395681381, 0.2976884246, 0.2516885400, 0.2403711081, + 0.3567789793, 0.3302847147, 0.3368039727, 0.3310148716 } }, + { { 0.5587195158, 0.4676063657, 0.1392965317, -0.0990996957, + -0.0816280842, -0.1146416068, -0.0116894841, 0.0521992445, + 0.1626615524, 0.2923687100, 0.4029874802, 0.4528989196, + 0.4694839120, 0.5058352947, 0.5369191170, 0.5105291605 }, + { 0.2193530202, 0.1211469173, 0.0179861784, -0.2022604346, + -0.1409794092, -0.2121175528, -0.1152674556, -0.0594626069, + -0.0122110248, 0.0274260640, 0.1414870024, 0.2044369578, + 0.2167974710, 0.2615978122, 0.3348221183, 0.3707562685 } }, + { { 0.5948622823, 0.7065241337, 0.9414781928, 0.9340723157, + 0.8835350275, 0.9730835557, 0.8503650427, 0.8902629018, + 0.8746688366, 0.6910865307, 0.6404449344, 0.6976057887, + 0.5916287303, 0.6022160053, 0.7729684114, 0.6096740365 }, + { 0.1262058616, 0.1300652623, 0.6594290137, 0.6535877585, + 0.5639349222, 0.6982316375, 0.4828875065, 0.5577285886, + 0.4591052532, 0.2964367270, 0.2695252299, 0.3324751854, + 0.2860580683, 0.2902825475, 0.4623388052, 0.3369604349 } }, + { { 0.8821268678, 0.8539636731, 0.2898653150, 0.7478301525, + 0.5109463930, 0.8577187657, 0.4884679914, 0.7846509218, + 0.7684310079, 0.7032384276, 0.6691296697, 0.8593355417, + 0.9383489490, 0.9808023572, 0.6804992557, 0.6403927803 }, + { 0.5590324402, 0.4209806323, 0.0259135962, 0.4318808317, + 0.2104346752, 0.5453680754, 0.1783599257, 0.4467447400, + 0.4352708459, 0.4089330435, 0.3994410038, 0.5984609127, + 0.6872792840, 0.7321317792, 0.4408513308, 0.4542027712 } }, + { { 0.6371070743, 0.6311093569, 0.7152860165, 0.6929640770, + 0.2292101383, 0.3234525323, 0.9644259810, 0.9881039262, + 0.8722697496, 0.4370440841, 0.4051779509, 0.4944135547, + 0.5392660499, 0.5969484448, 0.4268740416, 0.4990552664 }, + { 0.4233797193, 0.3647063971, 0.4345406890, 0.4180078506, + -0.0006328225, 0.0586141944, 0.7620160580, 0.8152132034, + 0.6707985997, 0.2095480561, 0.2178405523, 0.2776612639, + 0.3142212629, 0.3808741570, 0.2676998377, 0.2804775834 } }, + { { 0.4509170651, 0.9490405321, 0.8557890654, 0.8271043301, + 0.6915559173, 0.7321839333, 0.6257896423, 0.6274064183, + 0.5238284469, 0.5194996595, 0.4116972089, 0.3382642865, + 0.3755022883, 0.4867990613, 0.5686287880, 0.5106856227 }, + { 0.0989292860, 0.6244857907, 0.4700576067, 0.3905226588, + 0.2630059719, 0.3009741306, 0.2150763869, 0.2067838907, + 0.1533781290, 0.1815934777, 0.1023714542, 0.0373874903, + 0.0897501707, 0.1849313378, 0.2852757573, 0.2625887394 } }, + { { 0.9954054952, 0.9554033279, 0.8237664700, 0.9780903459, + 0.7261862159, 0.7884581685, 0.7933084965, 0.7393290401, + 0.8783196211, 1.0409359932, 1.0217954516, 0.9159227014, + 0.8698185086, 0.7057939768, 0.7662926912, 0.7339571714 }, + { 0.7913266420, 0.6739278436, 0.5061482191, 0.7058982849, + 0.3480692506, 0.4338105321, 0.4428853393, 0.3758152127, + 0.5962182879, 0.7925261855, 0.7968549728, 0.6629754901, + 0.6325175166, 0.4598354101, 0.5310778618, 0.5518873334 } }, + { { 0.4638512731, 0.0604917407, 0.1897295117, 0.3403504491, + 0.4708399177, 0.5241413713, 0.6061275601, 0.6446694136, + 0.7313494682, 0.7208143473, 0.6268848777, 0.6081094146, + 0.4913364649, 0.3529717326, 0.4954566360, 0.5767126679 }, + { 0.1353849769, -0.0274400115, 0.0002537966, 0.0272174478, + 0.0555371046, 0.0652899146, 0.1010676026, 0.1073260903, + 0.1568724513, 0.2207611799, 0.1434167027, 0.2262373567, + 0.1177047491, 0.0162650943, 0.2529402375, 0.4087765813 } }, + { { 0.9700064659, 0.9917025566, 0.9159227014, 0.9309430718, + 0.8991290927, 0.9314124584, 0.9059612751, 0.9473194480, + 0.9604622722, 0.9377752542, 0.9197821021, 0.8869771957, + 0.8506779671, 0.8594920039, 0.8320589662, 0.8739908338 }, + { 0.2892394662, 0.0551198721, 0.0892807841, 0.1158793569, + 0.0905846357, 0.0738953352, 0.0395258069, 0.0240360498, + 0.0477139950, 0.0751470327, 0.1171310544, 0.1555164456, + 0.1384620667, 0.1818542480, 0.2104868293, 0.1288135648 } }, + { { 0.4101847410, 0.3326316476, 0.4666675925, 0.5077128410, + 0.5892296433, 0.4272912741, 0.0603352785, -0.8668596745, + -1.1103670001, -0.0900248885, 0.1626615524, 0.1487885714, + 0.4130010605, 0.5119373202, 0.5820323825, 0.5486016273 }, + { 0.0383262634, 0.1300652623, 0.2295230627, 0.2706204653, + 0.3722165823, 0.1698066592, -0.0934670568, -0.8677462935, + -1.0724509954, -0.2164463401, -0.0056917667, -0.0301520228, + 0.1299088001, 0.2579991817, 0.3482257128, 0.2469425201 } }, + { { 0.6031547785, 0.5515222549, 0.4292209744, 0.5027582049, + 0.8167778254, 1.0925685167, 0.9878953099, 0.7019345760, + 0.2509583831, 0.2475162148, 0.5660732388, 0.5145971775, + 0.4824181199, 0.5970005989, 0.5996604562, 0.5384315848 }, + { 0.3677313328, 0.2650399804, 0.1585935354, 0.2213348746, + 0.5566333532, 0.8425940871, 0.7604514360, 0.4523773789, + 0.0681062341, 0.0737388730, 0.3169854283, 0.2868403792, + 0.2661873698, 0.3635068536, 0.4300554395, 0.3743027449 } }, + { { 0.5017672777, 0.6634970307, 0.6869142056, 0.7066284418, + 0.5669598579, 0.0621085167, 0.0634645224, 0.2321307659, + 0.8322675824, 0.9855483770, 0.8296598792, 0.6140028238, + 0.5462546945, 0.6730412245, 0.6856103539, 0.5975221395 }, + { 0.2680649161, 0.3324230313, 0.3688787222, 0.3886451125, + 0.2774004936, -0.1695076823, -0.1353467703, 0.0159000158, + 0.5895425677, 0.7586781979, 0.5639870763, 0.3687744141, + 0.3401418328, 0.4477356672, 0.4782979488, 0.4034568667 } }, + { { 0.8838479519, 0.9025712609, 0.7326533198, 0.8124490380, + 0.8956347704, 1.1007045507, 1.2731780410, 1.2029786706, + 1.0839109421, 0.9664078355, 0.7356782556, 0.6942157745, + 0.6917645335, 0.6383587718, 0.6503020525, 0.5989302993 }, + { 0.5576764345, 0.4596789479, 0.3790487647, 0.5514179468, + 0.7333834767, 0.9612445831, 1.1976589561, 1.1094664335, + 0.8868207335, 0.6789346337, 0.4643206596, 0.4029353261, + 0.4384522438, 0.3871847987, 0.4326109886, 0.3691916466 } }, + { { 0.8520861268, 0.8413423896, 0.7238392830, 0.9103943706, + 0.7072542906, 0.6479029655, 0.4557673931, 0.1908247471, + -0.0569070578, -0.1013423204, 0.2517406940, 0.4854952097, + 0.5820845366, 0.5886037946, 0.6177579165, 0.6226603985 }, + { 0.6160889864, 0.4592095613, 0.4752208591, 0.6685559750, + 0.4326109886, 0.4077335000, 0.2314006090, 0.0173603296, + -0.2208272815, -0.3014574647, 0.0321199298, 0.2559130192, + 0.3603254557, 0.3466089368, 0.4072119594, 0.4776199460 } }, + { { 0.7083495259, 0.9001721740, 0.6795083284, 1.2743254304, + 1.3672639728, 1.2563322783, 0.8557369113, 0.8287732601, + 0.7942472696, 0.8006622195, 0.7034991980, 0.5479236245, + 0.6391932368, 0.6248508692, 0.5495925546, 0.4719351530 }, + { 0.4000146985, 0.6493632793, 0.4583229423, 1.1484255195, + 1.2521599531, 1.1232351065, 0.6150459051, 0.5347808003, + 0.4726653099, 0.5269576907, 0.4278128147, 0.2745841742, + 0.3868718743, 0.4183729291, 0.3474434018, 0.3150035739 } }, + { { 0.9070043564, 0.7648323774, 0.4281778932, 0.5475063920, + 0.4134704471, 0.4706834555, 0.4549329281, 0.4648422003, + 0.4572798610, 0.4823138118, 0.4666154385, 0.4841913581, + 0.4018922448, 0.4297946692, 0.4646857381, 0.6091003418 }, + { 0.4925360084, 0.2065231204, 0.0948612690, 0.1716842055, + 0.0992422104, 0.1332988143, 0.1255800128, 0.1257364750, + 0.0955392718, 0.1118634939, 0.1372103691, 0.1525958180, + 0.0902717113, 0.1591672301, 0.2335910797, 0.3767018318 } }, + { { 0.3185500503, 0.8677845001, 0.7776622772, 0.8160476685, + 0.8624126315, 0.8057211637, 0.8852561116, 0.8471314907, + 0.9145145416, 0.8945916891, 0.8638729453, 0.8531292081, + 0.7425104380, 0.6215651631, 0.6501455903, 0.6341864467 }, + { -0.0499705672, 0.0687842369, 0.3051464558, 0.3368039727, + 0.4942049384, 0.3823344707, 0.5683158636, 0.5044271350, + 0.6278236508, 0.5777035952, 0.5745221972, 0.5502184033, + 0.4244228005, 0.3163595796, 0.3525545001, 0.3582914472 } }, + { { 0.3200625181, 0.9415303469, 0.6067534089, 0.3568832874, + 0.1600538492, 0.2938811779, 0.2037589550, 0.3017564416, + 0.2572168708, 0.4796018004, 0.6938506961, 0.6847758889, + 0.7232134342, 0.6111343503, 0.5159531832, 0.4856516719 }, + { 0.0680540800, 0.6285016537, 0.2514277697, 0.0790064335, + -0.0687981844, 0.0521992445, -0.0055874586, 0.0537117124, + 0.0188206434, 0.1883213520, 0.4493002892, 0.4300554395, + 0.4750122428, 0.3658016324, 0.3119786382, 0.2818335891 } }, + { { 0.6864969730, 1.0815640092, 0.9838794470, 0.8845259547, + 0.9438772798, 0.8888025880, 0.8178730607, 0.8581881523, + 0.7128347754, 0.7120524645, 0.7345308661, 0.7945601940, + 0.7854853868, 0.8261655569, 0.6941114664, 0.6646444201 }, + { 0.2847542167, 0.9535257816, 0.6691818237, 0.5026538968, + 0.5945493579, 0.4125838280, 0.3886451125, 0.3740941286, + 0.2453778982, 0.2928902507, 0.3219922185, 0.4065861106, + 0.3838469386, 0.4289602041, 0.3910441995, 0.3821780086 } }, + { { 1.1335094571, 1.0390062928, 0.7019867301, 0.6203134656, + 0.6951545477, 0.4863818288, 0.6171320677, 0.6247465611, + 0.5907421112, 0.6711115241, 0.7322882414, 0.7042293549, + 0.5635698438, 0.6174449921, 0.6727283001, 0.6431047916 }, + { 1.0146503448, 0.7762541175, 0.2200310230, 0.2459515929, + 0.2703596950, 0.1376276016, 0.2522100806, 0.2622758150, + 0.2389107943, 0.2956544161, 0.3799875379, 0.3653843999, + 0.2561216354, 0.2842326760, 0.4034568667, 0.3700782657 } }, + { { 0.6342907548, 0.9627570510, 0.5214815140, -0.0226939917, + 0.5616401434, 0.7231091261, 0.7417802811, 0.9092991352, + 0.9739701748, 0.7804785967, 0.6771092415, 0.6352295280, + 0.4660417438, 0.5869870186, 0.6692339778, 0.5986173749 }, + { 0.3988673091, 0.6997441053, 0.2316613793, -0.2566571236, + 0.2685343027, 0.4484136701, 0.4490395188, 0.6886874437, + 0.7703085542, 0.5847443938, 0.4539941549, 0.4098196626, + 0.2579991817, 0.3376384377, 0.4754816294, 0.5095382333 } }, + { { 0.4443456531, 2.0296727419, 0.6569256186, 0.6439914107, + 0.6436263323, 0.5507399440, 0.6095175743, 0.6066491008, + 0.5347808003, 0.2529402375, 0.4443978071, 0.7000570297, + 0.8259569407, 0.5927761197, 0.5078171492, 0.4418422580 }, + { 0.2430831194, 1.9133691788, 0.3723730445, 0.3764410615, + 0.3874977231, 0.3212099075, 0.3832210898, 0.4474227428, + 0.3644977808, 0.0814055204, 0.2752621770, 0.4647378922, + 0.6619845629, 0.4304205179, 0.3143777251, 0.2705683112 } }, + { { 0.9740744829, 1.0730628967, 0.9743352532, 0.9098728299, + 0.9453375936, 0.9661470652, 0.9270836711, 0.9643738270, + 0.9989519715, 0.9627048969, 0.9348546267, 0.9865393043, + 0.9399657249, 0.9752218723, 0.8440544009, 0.8819182515 }, + { 0.9258319736, 1.0357205868, 0.8463491797, 0.8108844161, + 0.8391519189, 0.8566235304, 0.8305986524, 0.8880724311, + 0.9181653261, 0.8670021892, 0.8305986524, 0.8995984793, + 0.8300249577, 0.8711223602, 0.7195626497, 0.8138571978 } }, +}; + +static const double wmavoice_mean_lsf10[2][10] = { + { 0.2235394066, 0.4097484909, 0.7025292732, 1.1077160169, + 1.3939179044, 1.6741291716, 1.9552949226, 2.2199793918, + 2.5103400247, 2.7829212906 }, + { 0.1493683393, 0.3714357373, 0.7702730245, 1.0609411394, + 1.3270362536, 1.5806033119, 1.8398507524, 2.1116740248, + 2.3823505771, 2.6865718527 } +}; + +static const double wmavoice_mean_lsf16[2][16] = { + { 0.0999206754, 0.2345933590, 0.4621011210, 0.6772546160, + 0.8346396060, 1.0067495130, 1.1571691668, 1.3292508688, + 1.4941465650, 1.6600755584, 1.8461284908, 2.0529487333, + 2.2690810112, 2.4949894820, 2.7172752965, 2.9164840903 }, + { 0.0918298402, 0.2475621892, 0.4782937721, 0.6284774045, + 0.7861951264, 0.9303736000, 1.0940441024, 1.2521029300, + 1.4434732098, 1.6551410742, 1.8917962963, 2.0967280403, + 2.2981430375, 2.4826173497, 2.6827972461, 2.8811350800 } +}; + +static const float wmavoice_std_codebook[1000] = { + -0.185013, -0.150405, -0.707267, -0.284100, 0.882898, + -0.788627, 0.061005, 0.374431, 0.053843, -0.909826, + 0.543602, 0.219326, 0.285698, 0.154709, -0.455005, + 0.426276, -0.868852, -0.952324, -0.550001, 0.813814, + -0.352815, 0.242122, 0.820495, -0.189574, -0.449538, + 0.499132, -0.247783, 0.598159, 0.732040, -0.564406, + -0.631788, -0.452973, 0.285189, -0.339055, 0.262927, + 0.168087, -0.127682, -0.676067, -0.457481, 0.926161, + -0.585893, -0.913880, 0.145487, 0.699804, 0.240829, + 0.690482, 0.126081, 0.371977, 0.738158, 0.576080, + 0.185791, -0.614657, -0.181799, 0.006285, 0.195768, + 0.368663, -0.494583, 0.947985, -0.033178, -0.762543, + -0.616421, 0.335034, -0.215516, 0.668769, 0.995979, + -0.952588, -0.163144, -0.131704, -0.628655, 0.379374, + -0.205543, -0.214549, 0.465494, 0.939944, -0.514744, + -0.293676, 0.630426, 0.611336, -0.921699, 0.368584, + 0.187416, 0.264092, 0.753927, -0.994382, -0.729623, + -0.050304, 0.374280, -0.224205, -0.102319, -0.658897, + 0.013252, 0.281260, 0.676137, 0.797736, -0.049971, + 0.672115, 0.845148, 0.786885, -0.459588, -0.783507, + 0.166259, 0.334869, 0.001944, -0.368247, 0.274813, + 0.487200, 0.338077, -0.094761, 0.098536, 0.416378, + -0.726176, -0.714048, -0.319530, -0.972249, -0.708430, + -0.049153, -0.022553, 0.665850, 0.726642, 0.875127, + -0.993047, -0.260106, 0.156387, 0.683090, -0.462370, + -0.893584, 0.355205, -0.617222, 0.893301, 0.895617, + -0.400729, 0.059559, 0.230486, 0.601215, 0.691313, + -0.494701, 0.088415, 0.029390, 0.410539, -0.813049, + -0.554232, 0.684362, -0.527097, 0.126238, 0.712113, + -0.235528, -0.922915, -0.310440, -0.569678, 0.803727, + -0.435313, -0.562725, -0.456380, 0.721075, -0.879635, + 0.081250, 0.827491, 0.475570, 0.464029, 0.720792, + 0.371187, -0.936700, -0.219649, -0.398327, 0.664515, + -0.528336, 0.106972, -0.247070, 0.501053, -0.482490, + -0.060119, 0.946821, -0.798127, 0.412784, 0.073058, + 0.913986, -0.822744, 0.150143, -0.396453, -0.392421, + -0.046130, 0.168234, 0.044854, 0.497490, -0.110691, + 0.165219, -0.421259, -0.283200, -0.359212, -0.957231, + -0.562409, -0.988025, -0.893931, 0.217942, -0.386352, + 0.770585, 0.689606, 0.720620, -0.476485, 0.190659, + -0.761870, 0.463395, 0.137480, -0.559997, -0.123821, + -0.789461, -0.646011, 0.053435, 0.360682, -0.042464, + 0.661014, -0.685448, -0.874230, -0.294133, 0.812042, + 0.015078, 0.871086, -0.609218, 0.731878, -0.488126, + -0.566448, -0.830530, -0.476150, -0.460379, 0.387412, + 0.137497, -0.689794, 0.077018, -0.141883, -0.166280, + -0.732322, 0.096247, -0.702884, 0.405158, 0.536250, + 0.173295, 0.615696, 0.890239, -0.773270, -0.023622, + -0.152226, 0.887744, 0.290930, -0.026456, -0.406389, + 0.102972, 0.988622, -0.535303, 0.493754, 0.720500, + -0.023428, 0.927306, 0.889970, 0.500421, -0.533073, + 0.277382, -0.362081, -0.222867, -0.645599, 0.496035, + 0.610853, -0.377922, -0.407718, 0.907969, -0.972764, + -0.871468, 0.081264, 0.642933, -0.981230, 0.307994, + -0.380689, -0.133456, 0.195738, 0.910241, 0.840088, + 0.789349, 0.013213, 0.828710, -0.745954, -0.493033, + 0.549210, 0.230618, -0.565727, 0.439180, -0.268961, + -0.098800, -0.283438, 0.368958, 0.678333, 0.070963, + -0.135007, 0.289186, 0.693041, 0.457275, 0.197155, + 0.720277, 0.585807, -0.721581, 0.363210, 0.604577, + 0.586413, 0.982521, -0.528878, -0.217849, 0.892762, + -0.688791, -0.428500, -0.094025, -0.860081, -0.174454, + 0.412942, 0.689129, -0.943836, 0.847215, 0.128309, + -0.212797, -0.251585, 0.844871, -0.843839, -0.573252, + -0.084167, 0.021154, 0.715935, -0.391126, -0.521570, + -0.086910, -0.670848, -0.935763, 0.191509, 0.692361, + 0.668814, -0.222078, 0.674882, -0.860064, 0.560073, + 0.567644, -0.548855, -0.868427, -0.526382, -0.408936, + -0.042881, 0.886560, -0.719807, 0.013283, 0.733775, + 0.408502, 0.800487, -0.517810, 0.253372, 0.956648, + -0.091062, -0.830794, -0.022198, -0.375127, -0.221920, + 0.456232, 0.537963, 0.107232, 0.520469, -0.270529, + -0.200406, 0.189284, 0.507393, -0.525524, 0.329220, + 0.067466, -0.957881, 0.780365, 0.199039, -0.484262, + -0.628570, -0.843843, -0.597703, -0.348377, 0.169441, + -0.863928, -0.939875, -0.030073, -0.381738, 0.313497, + -0.073425, 0.527200, 0.482703, 0.904377, -0.847927, + -0.739217, 0.360609, 0.690035, 0.368015, -0.118921, + -0.580493, -0.832391, -0.929638, 0.926900, -0.357915, + 0.399582, -0.005634, -0.315796, 0.179947, -0.806596, + 0.393360, 0.732931, -0.415833, -0.724526, 0.957347, + -0.892887, 0.475366, 0.173583, -0.418554, -0.302536, + 0.627315, 0.782000, 0.497542, 0.139082, 0.570111, + 0.732375, -0.454643, 0.302218, -0.019505, 0.881778, + -0.057606, 0.273041, 0.414170, -0.503501, -0.079602, + -0.083941, 0.007178, -0.171925, 0.506856, 0.520953, + 0.631684, -0.099784, 0.253885, -0.784149, 0.175691, + 0.211231, -0.677036, -0.348943, -0.615186, -0.095591, + 0.348521, -0.987871, -0.313590, -0.153938, 0.151210, + -0.743479, -0.421562, 0.696567, 0.558739, 0.558933, + 0.578346, -0.498867, -0.168026, -0.007485, -0.002368, + 0.752372, 0.908575, -0.995190, -0.419553, 0.415430, + 0.525763, -0.787869, -0.684353, -0.220353, -0.572018, + 0.491337, 0.990879, -0.249054, -0.857606, -0.624307, + 0.655355, 0.490915, -0.612178, -0.658235, -0.663023, + 0.539032, -0.401714, -0.084585, 0.235599, -0.842975, + -0.525653, -0.186055, -0.341841, 0.306321, 0.806460, + 0.655791, 0.058693, 0.715035, 0.660601, 0.639140, + 0.130465, 0.186363, 0.851271, 0.446112, 0.966011, + -0.720746, -0.062551, 0.956890, 0.030200, 0.079843, + -0.667418, -0.314445, -0.429243, -0.279596, 0.027320, + -0.092266, -0.740564, 0.625606, 0.823149, 0.495035, + 0.782632, -0.702504, -0.691020, -0.559209, 0.603818, + -0.884560, -0.903419, -0.337489, 0.830475, 0.757182, + -0.698349, -0.039060, -0.056455, -0.847078, -0.592948, + -0.090444, -0.567824, 0.344501, -0.133554, 0.462375, + -0.575656, 0.199028, -0.852070, -0.004899, 0.919432, + 0.175251, 0.902835, -0.821132, -0.199143, 0.725984, + 0.673903, -0.416511, -0.976519, 0.982883, 0.024279, + 0.627298, -0.901677, 0.120861, -0.710191, 0.928798, + -0.121958, -0.408540, -0.110261, 0.821588, -0.255618, + 0.296790, -0.268856, 0.176557, -0.358709, 0.597589, + -0.361067, 0.065635, -0.203382, -0.213137, -0.939264, + -0.283951, 0.962113, 0.963571, -0.105083, -0.237030, + 0.689556, -0.431180, 0.346459, 0.713037, -0.448297, + -0.629262, 0.340335, -0.349973, 0.491599, 0.630144, + -0.421175, -0.630359, -0.778396, 0.468564, -0.808771, + -0.034014, -0.234646, -0.077627, -0.857457, 0.406645, + -0.480038, -0.218524, -0.527720, 0.316580, 0.568338, + -0.466984, -0.967371, 0.530452, -0.503413, -0.072454, + -0.706578, -0.813857, 0.496366, 0.639881, 0.899179, + -0.951931, -0.989381, 0.239514, -0.301904, 0.502218, + -0.130341, 0.276921, 0.871860, 0.091262, -0.254515, + -0.936911, -0.942752, 0.510839, -0.014539, -0.800209, + -0.082516, 0.505423, -0.018733, 0.389763, -0.177997, + -0.450395, 0.922779, -0.145368, -0.919943, -0.580634, + 0.782178, -0.626521, -0.394491, 0.278545, -0.986640, + -0.495312, 0.326614, -0.976021, 0.744203, -0.975290, + 0.526197, -0.386139, 0.301631, 0.398057, 0.705124, + -0.952884, 0.461146, 0.762372, 0.557954, -0.553393, + 0.962163, -0.524562, 0.952030, -0.056570, 0.865202, + -0.225967, 0.493035, 0.787981, 0.628665, 0.573093, + -0.792653, 0.410844, 0.946571, -0.187144, -0.310612, + 0.959931, 0.317544, -0.983998, 0.983911, 0.061747, + -0.959287, 0.510108, 0.675608, 0.342344, -0.091835, + 0.380731, 0.389460, -0.630689, 0.143103, -0.052586, + -0.184083, 0.105266, 0.422852, -0.232052, -0.951303, + 0.288054, 0.541981, 0.541732, 0.076035, 0.170646, + 0.114825, 0.283382, -0.418510, 0.061396, -0.903763, + 0.270879, 0.021327, 0.413782, 0.286881, 0.005238, + -0.524472, 0.327594, -0.484654, -0.848864, -0.330063, + 0.423511, 0.531868, -0.940603, 0.792822, -0.325029, + 0.006811, -0.391261, 0.780237, -0.570337, 0.376687, + 0.828934, 0.717717, -0.081333, 0.370666, -0.206248, + -0.910686, -0.514510, -0.922867, -0.329196, 0.546886, + -0.826629, 0.941683, -0.431786, 0.587152, 0.228564, + 0.573452, -0.937320, -0.443843, -0.911202, -0.786184, + 0.226094, 0.512309, 0.745684, 0.285491, 0.305131, + -0.579345, -0.707698, 0.913870, -0.799108, -0.278035, + 0.290556, -0.970174, -0.560318, -0.790776, 0.400492, + 0.233434, -0.701462, 0.885982, 0.310567, -0.030658, + 0.432868, 0.483938, -0.088976, -0.998918, 0.071090, + -0.860412, 0.574534, 0.133770, -0.304255, 0.663332, + 0.347586, 0.921839, 0.175641, 0.093270, 0.207330, + -0.519228, 0.513925, 0.499633, -0.605358, 0.714817, + -0.778402, 0.685198, 0.744643, -0.338720, 0.894422, + 0.145135, 0.894714, -0.807041, 0.031117, 0.205281, + 0.162301, -0.536015, -0.310781, -0.926675, -0.534932, + 0.760308, -0.787088, -0.960398, -0.105922, -0.091343, + 0.702934, -0.758336, -0.169504, -0.121425, 0.334935, + -0.962173, 0.359347, -0.151140, 0.537460, 0.753989, + -0.436323, 0.759058, 0.439187, -0.691680, -0.579662, + 0.333608, 0.453454, -0.684948, 0.526567, -0.515429, + 0.520333, -0.311132, -0.051443, -0.790448, -0.237807, + 0.413625, 0.969861, -0.024895, 0.453226, -0.136061, + 0.883762, 0.156160, 0.105603, -0.285741, -0.965264, + -0.559462, -0.247914, 0.394083, 0.289398, -0.710455, + 0.148072, 0.853074, -0.951397, -0.412742, -0.838606, + -0.531059, 0.920866, 0.614848, -0.216007, 0.447434, + -0.900580, -0.695673, -0.863698, 0.047977, -0.486121, + -0.101505, -0.538399, -0.516261, 0.873600, 0.914828, + 0.347678, 0.757362, 0.070988, -0.546718, -0.528380, + 0.105724, -0.106180, 0.223706, -0.500194, -0.816782, + 0.513251, 0.647878, -0.963708, 0.561854, -0.764864, + -0.802314, -0.969205, -0.843997, 0.812534, -0.185212, + 0.603436, 0.911954, 0.119114, 0.739738, -0.040069, + 0.632993, -0.361767, 0.421532, -0.883268, -0.488168, + 0.336360, 0.464411, -0.730806, -0.592652, 0.917693, + -0.259186, 0.513071, -0.188487, 0.964520, -0.987122, + -0.005270, 0.477771, 0.660756, 0.031023, 0.039625, + 0.895892, 0.228709, 0.070419, -0.948105, 0.041243, + 0.885207, 0.655331, -0.046803, 0.004321, 0.395069, + 0.913128, -0.362686, -0.966698, 0.334661, -0.245954, + -0.454865, -0.328980, -0.781543, -0.185671, 0.078368, + -0.863850, 0.555143, -0.408560, -0.052338, 0.519663, + -0.395683, 0.942393, -0.002565, -0.734927, -0.026585, + -0.962941, -0.839035, -0.797876, 0.107479, -0.787140, + 0.243367, -0.007314, 0.868191, -0.803435, 0.997007, + 0.263261, -0.890307, -0.365679, 0.296563, 0.444354, + 0.388367, 0.841698, -0.884626, 0.606824, -0.343973, + 0.193743, 0.742974, -0.788830, 0.785182, -0.309364, + 0.730833, -0.610500, -0.366971, -0.271732, -0.345427, + 0.606444, -0.234673, -0.184462, 0.808568, 0.872806, + 0.028398, 0.051936, -0.134508, -0.103410, 0.248500, + -0.137501, -0.840150, 0.358194, 0.496819, 0.456413, + -0.197453, -0.114814, 0.298111, -0.082078, -0.507990, + 0.954138, -0.888336, -0.765016, -0.834692, 0.896847, + -0.074380, 0.896141, -0.713654, 0.558649, -0.375591, + -0.059081, 0.165093, 0.389736, 0.756458, -0.026339, + 0.262542, -0.215144, -0.974403, -0.871966, 0.681446 +}; + +static const float wmavoice_gain_silence[256] = { + 0.0000188351, 0.0000249147, 0.0000294447, 0.0000365973, + 0.0000423193, 0.0000464916, 0.0000498295, 0.0000525713, + 0.0000550747, 0.0000574589, 0.0000596046, 0.0000615120, + 0.0000634193, 0.0000649691, 0.0000665188, 0.0000679493, + 0.0000692606, 0.0000704527, 0.0000716448, 0.0000728369, + 0.0000737906, 0.0000747442, 0.0000755787, 0.0000762939, + 0.0000770092, 0.0000778437, 0.0000785589, 0.0000792742, + 0.0000799894, 0.0000807047, 0.0000814199, 0.0000822544, + 0.0000829697, 0.0000838041, 0.0000845194, 0.0000854731, + 0.0000865459, 0.0000876188, 0.0000889301, 0.0000904799, + 0.0000923872, 0.0000950098, 0.0000988245, 0.0001032352, + 0.0001088381, 0.0001147985, 0.0001225471, 0.0001319647, + 0.0001431704, 0.0001568794, 0.0001744032, 0.0001952648, + 0.0002206564, 0.0002535582, 0.0002965927, 0.0003464222, + 0.0004109144, 0.0004891157, 0.0005909204, 0.0007261038, + 0.0008867979, 0.0010721684, 0.0012696981, 0.0015079975, + 0.0017461777, 0.0019979477, 0.0022052526, 0.0023679733, + 0.0025173426, 0.0026556253, 0.0027927160, 0.0029264688, + 0.0030447245, 0.0031807423, 0.0033060312, 0.0034313202, + 0.0035454035, 0.0036598444, 0.0037686825, 0.0038731098, + 0.0039769411, 0.0040702820, 0.0041661263, 0.0042562485, + 0.0043400526, 0.0044249296, 0.0045082569, 0.0045900345, + 0.0046693087, 0.0047430992, 0.0048171282, 0.0048881769, + 0.0049589872, 0.0050252676, 0.0050880909, 0.0051497221, + 0.0052082539, 0.0052671432, 0.0053246021, 0.0053800344, + 0.0054348707, 0.0054861307, 0.0055367947, 0.0055862665, + 0.0056355000, 0.0056805611, 0.0057252645, 0.0057705641, + 0.0058110952, 0.0058538914, 0.0058966875, 0.0059366226, + 0.0059723854, 0.0060091019, 0.0060437918, 0.0060794353, + 0.0061159134, 0.0061485767, 0.0061824322, 0.0062153339, + 0.0062497854, 0.0062820911, 0.0063197613, 0.0063550472, + 0.0063927174, 0.0064336061, 0.0064769983, 0.0065194368, + 0.0065603256, 0.0066006184, 0.0066410303, 0.0066826344, + 0.0067234039, 0.0067654848, 0.0068060160, 0.0068466663, + 0.0068866014, 0.0069231987, 0.0069609880, 0.0069983006, + 0.0070366859, 0.0070750713, 0.0071122646, 0.0071535110, + 0.0071973801, 0.0072410107, 0.0072846413, 0.0073343515, + 0.0073832273, 0.0074360371, 0.0074878931, 0.0075426102, + 0.0076007843, 0.0076560974, 0.0077134371, 0.0077683926, + 0.0078265667, 0.0078855753, 0.0079488754, 0.0080170631, + 0.0080827475, 0.0081528425, 0.0082212687, 0.0082877874, + 0.0083510876, 0.0084129572, 0.0084775686, 0.0085455179, + 0.0086110830, 0.0086781979, 0.0087503195, 0.0088242292, + 0.0089002848, 0.0089734793, 0.0090423822, 0.0091133118, + 0.0091816187, 0.0092473030, 0.0093164444, 0.0093911886, + 0.0094678402, 0.0095427036, 0.0096175671, 0.0096931458, + 0.0097666979, 0.0098397732, 0.0099166632, 0.0099946260, + 0.0100749731, 0.0101612806, 0.0102528334, 0.0103493929, + 0.0104434490, 0.0105448961, 0.0106583834, 0.0107737780, + 0.0108981133, 0.0110142231, 0.0111318827, 0.0112472773, + 0.0113576651, 0.0114786625, 0.0116028786, 0.0117331743, + 0.0118676424, 0.0120122433, 0.0121580362, 0.0123010874, + 0.0124633312, 0.0126402378, 0.0128232241, 0.0130140781, + 0.0132108927, 0.0134289265, 0.0136625767, 0.0138912201, + 0.0141364336, 0.0144006014, 0.0146615505, 0.0149335861, + 0.0152134895, 0.0155050755, 0.0158376694, 0.0162067413, + 0.0165973902, 0.0169926882, 0.0174319744, 0.0179271698, + 0.0184448957, 0.0190744400, 0.0197248459, 0.0204203129, + 0.0212460756, 0.0221523046, 0.0231562853, 0.0243031979, + 0.0256397724, 0.0271918774, 0.0289602280, 0.0310072899, + 0.0333702564, 0.0363805294, 0.0401413441, 0.0443998575, + 0.0498176813, 0.0562580824, 0.0640066862, 0.0732775927, + 0.0836604834, 0.0962959528, 0.1122496128, 0.1335854530, + 0.1608980894, 0.1990102530, 0.2616490126, 0.3926030397 +}; + +static const float wmavoice_gain_universal[64] = { + 0.0000000000, 0.0000000000, 0.0000015497, 0.0000015497, + 0.0000095367, 0.0000164509, 0.0000379086, 0.0000494719, + 0.0000799894, 0.0001058578, 0.0001349449, 0.0001627207, + 0.0001972914, 0.0002325773, 0.0002671480, 0.0003106594, + 0.0003589392, 0.0004127026, 0.0004582405, 0.0005071163, + 0.0005759001, 0.0006588697, 0.0007554293, 0.0008602142, + 0.0009772778, 0.0011068583, 0.0012603998, 0.0013889074, + 0.0015437603, 0.0016924143, 0.0018980503, 0.0021264553, + 0.0023632050, 0.0025693178, 0.0028522015, 0.0031896830, + 0.0034654140, 0.0037885904, 0.0041683912, 0.0046081543, + 0.0050576925, 0.0055632591, 0.0061818361, 0.0068151951, + 0.0073953867, 0.0081818104, 0.0091186762, 0.0102789402, + 0.0119919777, 0.0134155750, 0.0154829025, 0.0173798800, + 0.0199711323, 0.0229473114, 0.0268185139, 0.0319474936, + 0.0393068790, 0.0460114479, 0.0523469448, 0.0637906790, + 0.0845471621, 0.1105458736, 0.1499300003, 0.2219169140 +}; + +static const float wmavoice_gain_codebook_acb[128] = { + 0.05, 0.14, 0.16, 0.05, 0.17, 0.25, 0.07, 0.21, + 0.12, 0.22, 0.23, 0.13, 0.24, 0.32, 0.14, 0.29, + 0.31, 0.41, 0.43, 0.32, 0.43, 0.51, 0.34, 0.48, + 0.38, 0.47, 0.49, 0.38, 0.49, 0.57, 0.40, 0.54, + 0.49, 0.59, 0.61, 0.50, 0.61, 0.69, 0.52, 0.66, + 0.56, 0.65, 0.67, 0.56, 0.67, 0.75, 0.58, 0.72, + 0.65, 0.74, 0.76, 0.65, 0.76, 0.84, 0.67, 0.81, + 0.71, 0.80, 0.82, 0.71, 0.82, 0.90, 0.73, 0.87, + 0.81, 0.90, 0.92, 0.81, 0.93, 1.01, 0.83, 0.97, + 0.87, 0.96, 0.98, 0.87, 0.98, 1.06, 0.89, 1.03, + 0.92, 1.02, 1.04, 0.93, 1.04, 1.12, 0.95, 1.09, + 0.93, 1.02, 1.04, 0.93, 1.04, 1.12, 0.95, 1.09, + 0.94, 1.04, 1.05, 0.10, 1.06, 1.14, 0.96, 1.11, + 0.98, 1.08, 1.10, 0.99, 1.10, 1.18, 1.01, 1.15, + 1.06, 1.15, 1.17, 1.06, 1.17, 1.25, 1.08, 1.22, + 1.16, 1.25, 1.27, 1.16, 1.28, 1.36, 1.18, 1.32 +}; + +static const float wmavoice_gain_codebook_fcb[128] = { + -0.8439700703 /* log(0.430) */, -0.6143360001 /* log(0.541) */, + -0.1531511795 /* log(0.858) */, -0.0998203353 /* log(0.905) */, + 0.3213585988 /* log(1.379) */, 0.3777512695 /* log(1.459) */, + 0.7158866675 /* log(2.046) */, 1.2700414043 /* log(3.561) */, + -1.6873994539 /* log(0.185) */, -1.2173958247 /* log(0.296) */, + -0.4893903430 /* log(0.613) */, -0.4155154440 /* log(0.660) */, + 0.1257512053 /* log(1.134) */, 0.1947440768 /* log(1.215) */, + 0.5883420662 /* log(1.801) */, 1.1987592373 /* log(3.316) */, + -1.3586791941 /* log(0.257) */, -0.9996723408 /* log(0.368) */, + -0.3768776513 /* log(0.686) */, -0.3119747650 /* log(0.732) */, + 0.1881379421 /* log(1.207) */, 0.2523139286 /* log(1.287) */, + 0.6280751838 /* log(1.874) */, 1.2202397768 /* log(3.388) */, + -0.7381445465 /* log(0.478) */, -0.5310283311 /* log(0.588) */, + -0.0987159729 /* log(0.906) */, -0.0491902442 /* log(0.952) */, + 0.3555743385 /* log(1.427) */, 0.4101209196 /* log(1.507) */, + 0.7390761124 /* log(2.094) */, 1.2831536022 /* log(3.608) */, + -0.2497442331 /* log(0.779) */, -0.1165338163 /* log(0.890) */, + 0.1881379421 /* log(1.207) */, 0.2255406759 /* log(1.253) */, + 0.5469646704 /* log(1.728) */, 0.5922212620 /* log(1.808) */, + 0.8733832309 /* log(2.395) */, 1.3632815868 /* log(3.909) */, + -1.3903023825 /* log(0.249) */, -1.0216512475 /* log(0.360) */, + -0.3900840061 /* log(0.677) */, -0.3229638866 /* log(0.724) */, + 0.1806534997 /* log(1.198) */, 0.2460785226 /* log(1.279) */, + 0.6232610531 /* log(1.865) */, 1.2178757095 /* log(3.380) */, + -0.6033064766 /* log(0.547) */, -0.4185503477 /* log(0.658) */, + -0.0253178080 /* log(0.975) */, 0.0217614918 /* log(1.022) */, + 0.4027948796 /* log(1.496) */, 0.4555243080 /* log(1.577) */, + 0.7714961470 /* log(2.163) */, 1.3023691262 /* log(3.678) */, + -1.1056369036 /* log(0.331) */, -0.8164453969 /* log(0.442) */, + -0.2757535016 /* log(0.759) */, -0.2156715365 /* log(0.806) */, + 0.2468600779 /* log(1.280) */, 0.3082197237 /* log(1.361) */, + 0.6662897264 /* log(1.947) */, 1.2418464568 /* log(3.462) */, + -0.5395680926 /* log(0.583) */, -0.3652833185 /* log(0.694) */, + 0.0109399400 /* log(1.011) */, 0.0554347069 /* log(1.057) */, + 0.4265740713 /* log(1.532) */, 0.4774756441 /* log(1.612) */, + 0.7880027116 /* log(2.199) */, 1.3118401752 /* log(3.713) */, + -0.9571127264 /* log(0.384) */, -0.7031975164 /* log(0.495) */, + -0.2082549388 /* log(0.812) */, -0.1519863570 /* log(0.859) */, + 0.2874320412 /* log(1.333) */, 0.3464225675 /* log(1.414) */, + 0.6931471806 /* log(2.000) */, 1.2570395253 /* log(3.515) */, + -0.2420715612 /* log(0.785) */, -0.1098148660 /* log(0.896) */, + 0.1930966300 /* log(1.213) */, 0.2311117210 /* log(1.260) */, + 0.5504308784 /* log(1.734) */, 0.5960854677 /* log(1.815) */, + 0.8758853172 /* log(2.401) */, 1.3650707247 /* log(3.916) */, + 0.6564831962 /* log(1.928) */, 0.7124594916 /* log(2.039) */, + 0.8569652658 /* log(2.356) */, 0.8767179568 /* log(2.403) */, + 1.0567480846 /* log(2.877) */, 1.0841752409 /* log(2.957) */, + 1.2652560327 /* log(3.544) */, 1.6211688353 /* log(5.059) */, + -1.5417792640 /* log(0.214) */, -1.1239300967 /* log(0.325) */, + -0.4431669753 /* log(0.642) */, -5.2983173665 /* log(0.005) */, + 0.1510028735 /* log(1.163) */, 0.2183319943 /* log(1.244) */, + 0.6043159669 /* log(1.830) */, 1.2074666936 /* log(3.345) */, + -0.5124936809 /* log(0.599) */, -0.3424903089 /* log(0.710) */, + 0.0266419309 /* log(1.027) */, 0.0713899961 /* log(1.074) */, + 0.4369637752 /* log(1.548) */, 0.4879663296 /* log(1.629) */, + 0.7952524035 /* log(2.215) */, 1.3164082337 /* log(3.730) */, + -0.8867319296 /* log(0.412) */, -0.6481738149 /* log(0.523) */, + -0.1743533871 /* log(0.840) */, -0.1199102967 /* log(0.887) */, + 0.3089542077 /* log(1.362) */, 0.3660310389 /* log(1.442) */, + 0.7075430608 /* log(2.029) */, 1.2649738259 /* log(3.543) */, + -0.0943106795 /* log(0.910) */, 0.0207825392 /* log(1.021) */, + 0.2911759617 /* log(1.338) */, 0.3249778572 /* log(1.384) */, + 0.6200387087 /* log(1.859) */, 0.6621723763 /* log(1.939) */, + 0.9266370239 /* log(2.526) */, 1.3962446920 /* log(4.040) */ +}; + +static const float wmavoice_ipol1_coeffs[17*9] = { + 0, + 0.6308171151, 0.7613050340, 0.8632577061, 0.9280143976, + 0.9499985575, 0.9273047447, 0.8618999123, 0.7594153284, + -0.1791058179, -0.1351341452, -0.0589959878, 0.0472882274, + 0.1784339990, 0.3262237605, 0.4801855979, 0.6285545824, + 0, + -0.1921342459, -0.1786532696, -0.1341681625, -0.0575229186, + 0.0492091286, 0.1806929555, 0.3286687729, 0.4826357064, + 0.0807464118, 0.0506337392, 0.0080115446, -0.0428523305, + -0.0958572026, -0.1436148431, -0.1782128509, -0.1921164688, + 0, + 0.0960653644, 0.0803771760, 0.0500416081, 0.0072485465, + -0.0437018941, -0.0966834794, -0.1442930843, -0.1786170151, + -0.0391932014, -0.0189622506, 0.0070230183, 0.0356589290, + 0.0630142610, 0.0847979258, 0.0969368290, 0.0961942221, + 0, + -0.0515680681, -0.0389267015, -0.0185848991, 0.0074699190, + 0.0361179407, 0.0634181346, 0.0850781347, 0.0970333587, + 0.0178811825, 0.0048708571, -0.0108041526, -0.0271167825, + -0.0416534986, -0.0519338618, -0.0557823736, -0.0517020743, + 0, + 0.0267091128, 0.0177022810, 0.0046363524, -0.0110662053, + -0.0273700613, -0.0418578978, -0.0520511451, -0.0557823028, + -0.0069270437, 0.0008217385, 0.0097293532, 0.0185749526, + 0.0259542684, 0.0304777338, 0.0309953480, 0.0268154419, + 0, + -0.0125539196, -0.0068173436, 0.0009580161, 0.0098749646, + 0.0187084037, 0.0260526291, 0.0305201071, 0.0309665180, + 0.0019149571, -0.0022503408, -0.0068592466, -0.0112465904, + -0.0146595868, -0.0163685936, -0.0157934162, -0.0126258885, + 0, + 0.0050976076, 0.0018546581, -0.0023221741, -0.0069331308, + -0.0113109085, -0.0147021576, -0.0163786146, -0.0157635096, + -0.0001162733, 0.0019313511, 0.0040823850, 0.0060192454, + 0.0073876535, 0.0078486321, 0.0071403184, 0.0051400312, + 0, + -0.0017920607, -0.0000857157, 0.0019657183, 0.0041159806, + 0.0060465694, 0.0074030068, 0.0078470460, 0.0071185785, + -0.0004100171, -0.0015364708, -0.0025490071, -0.0033188616, + -0.0037196307, -0.0036417283, -0.0030119629, -0.0018155784, + 0, + 0.0006907531, -0.0004282868, -0.0015539061, -0.0025635813, + -0.0033285026, -0.0037224069, -0.0036361245, -0.0029972247, + 0, 0, 0, 0, 0, 0, 0, 0 +}; + +/** + * Hamming-window sinc function (num = 32, x = [ 0, 31 ]): + * (0.54 + 0.46 * cos(2 * M_PI * x / (num - 1))) * + * sin(x * M_PI / 4) / (x * M_PI / 4) + */ +static const float wmavoice_ipol2_coeffs[32] = { + 1, 0.8563459515, 0.5888634918, 0.2648358640, + 0, -0.1360490318, -0.1434589471, -0.0758505310, + 0, 0.0410402636, 0.0412485781, 0.0200064587, + 0, -0.0081391358, -0.0068223253, -0.0029313546, + 0, 0.0025864919, 0.0053062555, 0.0055688801, + 0, -0.0104795941, -0.0187493577, -0.0160592399, + 0, 0.0212381664, 0.0331059131, 0.0251942366, + 0, -0.0273968070, -0.0392575669, -0.0276240534 +}; + +/** + * LUT for 1.071575641632 * pow(1.0331663, n - 127) + */ +static const float wmavoice_energy_table[128] = { + 0.0169982178, 0.0175619858, 0.0181444519, 0.0187462362, + 0.0193679795, 0.0200103437, 0.0206740128, 0.0213596933, + 0.0220681153, 0.0228000330, 0.0235562258, 0.0243374986, + 0.0251446834, 0.0259786395, 0.0268402549, 0.0277304468, + 0.0286501631, 0.0296003830, 0.0305821182, 0.0315964139, + 0.0326443501, 0.0337270424, 0.0348456436, 0.0360013446, + 0.0371953760, 0.0384290090, 0.0397035571, 0.0410203772, + 0.0423808713, 0.0437864880, 0.0452387238, 0.0467391249, + 0.0482892887, 0.0498908657, 0.0515455612, 0.0532551367, + 0.0550214125, 0.0568462692, 0.0587316496, 0.0606795611, + 0.0626920777, 0.0647713419, 0.0669195677, 0.0691390421, + 0.0714321284, 0.0738012678, 0.0762489827, 0.0787778794, + 0.0813906502, 0.0840900769, 0.0868790336, 0.0897604897, + 0.0927375130, 0.0958132732, 0.0989910450, 0.1022742117, + 0.1056662688, 0.1091708280, 0.1127916204, 0.1165325012, + 0.1203974531, 0.1243905911, 0.1285161668, 0.1327785725, + 0.1371823465, 0.1417321773, 0.1464329093, 0.1512895470, + 0.1563072616, 0.1614913951, 0.1668474671, 0.1723811803, + 0.1780984262, 0.1840052921, 0.1901080668, 0.1964132480, + 0.2029275487, 0.2096579046, 0.2166114816, 0.2237956830, + 0.2312181577, 0.2388868085, 0.2468098001, 0.2549955679, + 0.2634528274, 0.2721905830, 0.2812181375, 0.2905451026, + 0.3001814086, 0.3101373153, 0.3204234225, 0.3310506819, + 0.3420304081, 0.3533742912, 0.3650944090, 0.3772032397, + 0.3897136755, 0.4026390362, 0.4159930832, 0.4297900346, + 0.4440445799, 0.4587718956, 0.4739876619, 0.4897080789, + 0.5059498840, 0.5227303696, 0.5400674019, 0.5579794393, + 0.5764855528, 0.5956054456, 0.6153594745, 0.6357686714, + 0.6568547659, 0.6786402082, 0.7011481929, 0.7244026842, + 0.7484284410, 0.7732510432, 0.7988969192, 0.8253933741, + 0.8527686184, 0.8810517982, 0.9102730265, 0.9404634147, + 0.9716551065, 1.0038813113, 1.0371763400, 1.0715756416 +}; + +/** + * LUT for f(x,y) = pow((y + 6.9) / 64, 0.025 * (x + 1)). + */ +static const float wmavoice_denoise_power_table[12][64] = { + { 0.9458379339, 0.9490436287, 0.9518757236, 0.9544130754, + 0.9567118717, 0.9588135761, 0.9607496688, 0.9625446194, + 0.9642178285, 0.9657849396, 0.9672587526, 0.9686498743, + 0.9699671937, 0.9712182343, 0.9724094211, 0.9735462842, + 0.9746336187, 0.9756756090, 0.9766759291, 0.9776378218, + 0.9785641645, 0.9794575217, 0.9803201890, 0.9811542296, + 0.9819615045, 0.9827436985, 0.9835023412, 0.9842388263, + 0.9849544265, 0.9856503078, 0.9863275406, 0.9869871101, + 0.9876299254, 0.9882568267, 0.9888685922, 0.9894659445, + 0.9900495551, 0.9906200497, 0.9911780119, 0.9917239872, + 0.9922584859, 0.9927819864, 0.9932949377, 0.9937977618, + 0.9942908555, 0.9947745929, 0.9952493267, 0.9957153901, + 0.9961730980, 0.9966227482, 0.9970646231, 0.9974989903, + 0.9979261037, 0.9983462046, 0.9987595223, 0.9991662752, + 0.9995666709, 0.9999609077, 1.0003491745, 1.0007316515, + 1.0011085110, 1.0014799178, 1.0018460292, 1.0022069960 }, + { 0.8946093973, 0.9006838092, 0.9060673931, 0.9109043185, + 0.9152976055, 0.9193234737, 0.9230399260, 0.9264921443, + 0.9297160207, 0.9327405496, 0.9355894944, 0.9382825789, + 0.9408363568, 0.9432648587, 0.9455800822, 0.9477923675, + 0.9499106907, 0.9519428941, 0.9538958704, 0.9557757107, + 0.9575878241, 0.9593370368, 0.9610276730, 0.9626636222, + 0.9642483964, 0.9657851769, 0.9672768552, 0.9687260672, + 0.9701352224, 0.9715065293, 0.9728420173, 0.9741435556, + 0.9754128696, 0.9766515555, 0.9778610927, 0.9790428553, + 0.9801981216, 0.9813280829, 0.9824338513, 0.9835164667, + 0.9845769028, 0.9856160726, 0.9866348334, 0.9876339913, + 0.9886143053, 0.9895764906, 0.9905212223, 0.9914491381, + 0.9923608411, 0.9932569022, 0.9941378627, 0.9950042356, + 0.9958565084, 0.9966951442, 0.9975205834, 0.9983332454, + 0.9991335296, 0.9999218170, 1.0006984708, 1.0014638383, + 1.0022182509, 1.0029620257, 1.0036954662, 1.0044188628 }, + { 0.8461555040, 0.8547882305, 0.8624635555, 0.8693789920, + 0.8756760853, 0.8814598273, 0.8868103032, 0.8917900284, + 0.8964487626, 0.9008267754, 0.9049571273, 0.9088673021, + 0.9125804007, 0.9161160306, 0.9194909803, 0.9227197376, + 0.9258148939, 0.9287874629, 0.9316471355, 0.9344024839, + 0.9370611291, 0.9396298766, 0.9421148300, 0.9445214846, + 0.9468548060, 0.9491192967, 0.9513190517, 0.9534578074, + 0.9555389816, 0.9575657096, 0.9595408742, 0.9614671327, + 0.9633469396, 0.9651825670, 0.9669761222, 0.9687295635, + 0.9704447142, 0.9721232742, 0.9737668316, 0.9753768718, + 0.9769547868, 0.9785018824, 0.9800193854, 0.9815084500, + 0.9829701633, 0.9844055505, 0.9858155796, 0.9872011653, + 0.9885631734, 0.9899024236, 0.9912196934, 0.9925157203, + 0.9937912053, 0.9950468143, 0.9962831814, 0.9975009102, + 0.9987005760, 0.9998827277, 1.0010478892, 1.0021965608, + 1.0033292209, 1.0044463270, 1.0055483173, 1.0066356112 }, + { 0.8003259737, 0.8112313241, 0.8209581209, 0.8297466775, + 0.8377697066, 0.8451556492, 0.8520027051, 0.8583876935, + 0.8643718792, 0.8700049328, 0.8753277020, 0.8803741979, + 0.8851730502, 0.8897485937, 0.8941216918, 0.8983103719, + 0.9023303202, 0.9061952736, 0.9099173316, 0.9135072091, + 0.9169744409, 0.9203275502, 0.9235741882, 0.9267212496, + 0.9297749699, 0.9327410079, 0.9356245146, 0.9384301933, + 0.9411623497, 0.9438249364, 0.9464215906, 0.9489556668, + 0.9514302661, 0.9538482608, 0.9562123167, 0.9585249126, + 0.9607883576, 0.9630048062, 0.9651762722, 0.9673046403, + 0.9693916775, 0.9714390425, 0.9734482944, 0.9754209007, + 0.9773582446, 0.9792616307, 0.9811322918, 0.9829713934, + 0.9847800389, 0.9865592739, 0.9883100900, 0.9900334289, + 0.9917301853, 0.9934012104, 0.9950473143, 0.9966692689, + 0.9982678100, 0.9998436400, 1.0013974295, 1.0029298194, + 1.0044414224, 1.0059328250, 1.0074045889, 1.0088572520 }, + { 0.7569786654, 0.7698939195, 0.7814501054, 0.7919210783, + 0.8015042240, 0.8103467104, 0.8185613167, 0.8262364557, + 0.8334427763, 0.8402376615, 0.8466683811, 0.8527743561, + 0.8585888194, 0.8641400582, 0.8694523567, 0.8745467247, + 0.8794414652, 0.8841526254, 0.8886943552, 0.8930791981, + 0.8973183276, 0.9014217415, 0.9053984227, 0.9092564737, + 0.9130032283, 0.9166453478, 0.9201889007, 0.9236394320, + 0.9270020224, 0.9302813390, 0.9334816797, 0.9366070112, + 0.9396610028, 0.9426470554, 0.9455683275, 0.9484277579, + 0.9512280860, 0.9539718690, 0.9566614986, 0.9592992147, + 0.9618871182, 0.9644271823, 0.9669212630, 0.9693711079, + 0.9717783651, 0.9741445900, 0.9764712529, 0.9787597445, + 0.9810113822, 0.9832274148, 0.9854090274, 0.9875573457, + 0.9896734398, 0.9917583281, 0.9938129803, 0.9958383209, + 0.9978352315, 0.9998045539, 1.0017470919, 1.0036636145, + 1.0055548568, 1.0074215229, 1.0092642871, 1.0110837959 }, + { 0.7159791370, 0.7306629191, 0.7438433845, 0.7558198318, + 0.7668086064, 0.7769714272, 0.7864325139, 0.7952894548, + 0.8036203840, 0.8114888792, 0.8189474022, 0.8260397728, + 0.8328029877, 0.8392685815, 0.8454636629, 0.8514117142, + 0.8571332177, 0.8626461513, 0.8679663850, 0.8731080020, + 0.8780835596, 0.8829043049, 0.8875803529, 0.8921208349, + 0.8965340237, 0.9008274393, 0.9050079382, 0.9090817905, + 0.9130547454, 0.9169320882, 0.9207186893, 0.9244190474, + 0.9280373261, 0.9315773876, 0.9350428208, 0.9384369673, + 0.9417629433, 0.9450236603, 0.9482218422, 0.9513600421, + 0.9544406555, 0.9574659338, 0.9604379957, 0.9633588374, + 0.9662303420, 0.9690542879, 0.9718323569, 0.9745661408, + 0.9772571477, 0.9799068082, 0.9825164805, 0.9850874551, + 0.9876209597, 0.9901181627, 0.9925801775, 0.9950080658, + 0.9974028405, 0.9997654692, 1.0020968764, 1.0043979464, + 1.0066695255, 1.0089124239, 1.0111274185, 1.0133152537 }, + { 0.6772002277, 0.6934309881, 0.7080464599, 0.7213643301, + 0.7336148970, 0.7449707526, 0.7555647772, 0.7655015856, + 0.7748651015, 0.7837237382, 0.7921340426, 0.8001433220, + 0.8077915768, 0.8151129499, 0.8221368310, 0.8288887107, + 0.8353908496, 0.8416628090, 0.8477218755, 0.8535834053, + 0.8592611049, 0.8647672624, 0.8701129393, 0.8753081305, + 0.8803618988, 0.8852824894, 0.8900774261, 0.8947535945, + 0.8993173131, 0.9037743949, 0.9081302004, 0.9123896841, + 0.9165574352, 0.9206377129, 0.9246344779, 0.9285514202, + 0.9323919830, 0.9361593853, 0.9398566405, 0.9434865742, + 0.9470518396, 0.9505549317, 0.9539981992, 0.9573838564, + 0.9607139933, 0.9639905847, 0.9672154989, 0.9703905051, + 0.9735172803, 0.9765974162, 0.9796324243, 0.9826237418, + 0.9855727362, 0.9884807098, 0.9913489039, 0.9941785028, + 0.9969706369, 0.9997263861, 1.0024467831, 1.0051328157, + 1.0077854297, 1.0104055314, 1.0129939892, 1.0155516364 }, + { 0.6405216642, 0.6580962612, 0.6739722363, 0.6884795488, + 0.7018580813, 0.7142880714, 0.7259086094, 0.7368294324, + 0.7471387455, 0.7569085832, 0.7661985859, 0.7750587283, + 0.7835313288, 0.7916525600, 0.7994535998, 0.8069615243, + 0.8142000068, 0.8211898738, 0.8279495504, 0.8344954211, + 0.8408421252, 0.8470027997, 0.8529892811, 0.8588122744, + 0.8644814947, 0.8700057878, 0.8753932324, 0.8806512276, + 0.8857865684, 0.8908055105, 0.8957138271, 0.9005168576, + 0.9052195513, 0.9098265046, 0.9143419945, 0.9187700080, + 0.9231142680, 0.9273782568, 0.9315652364, 0.9356782672, + 0.9397202245, 0.9436938133, 0.9476015819, 0.9514459336, + 0.9552291382, 0.9589533414, 0.9626205741, 0.9662327603, + 0.9697917251, 0.9732992008, 0.9767568340, 0.9801661903, + 0.9835287605, 0.9868459649, 0.9901191578, 0.9933496315, + 0.9965386205, 0.9996873045, 1.0027968119, 1.0058682226, + 1.0089025710, 1.0119008485, 1.0148640056, 1.0177929548 }, + { 0.6058296875, 0.6245620637, 0.6415378101, 0.6570938835, + 0.6714759586, 0.6848691001, 0.6974164561, 0.7092312055, + 0.7204044988, 0.7310109103, 0.7411122884, 0.7507605397, + 0.7599996842, 0.7688674015, 0.7773962122, 0.7856143935, + 0.7935466990, 0.8012149303, 0.8086383963, 0.8158342858, + 0.8228179717, 0.8296032631, 0.8362026133, 0.8426272954, + 0.8488875492, 0.8549927056, 0.8609512936, 0.8667711307, + 0.8724594015, 0.8780227256, 0.8834672161, 0.8887985309, + 0.8940219180, 0.8991422543, 0.9041640810, 0.9090916337, + 0.9139288704, 0.9186794948, 0.9233469789, 0.9279345818, + 0.9324453671, 0.9368822185, 0.9412478543, 0.9455448393, + 0.9497755970, 0.9539424198, 0.9580474782, 0.9620928299, + 0.9660804271, 0.9700121244, 0.9738896845, 0.9777147851, + 0.9814890239, 0.9852139236, 0.9888909370, 0.9925214512, + 0.9961067913, 0.9996482244, 1.0031469629, 1.0066041676, + 1.0100209506, 1.0133983785, 1.0167374742, 1.0200392198 }, + { 0.5730166999, 0.5927366473, 0.6106642672, 0.6271389942, + 0.6424090212, 0.6566617910, 0.6700426292, 0.6826666808, + 0.6946268614, 0.7059993279, 0.7168473476, 0.7272241023, + 0.7371747608, 0.7467380401, 0.7559474006, 0.7648319736, + 0.7734172908, 0.7817258650, 0.7897776570, 0.7975904541, + 0.8051801811, 0.8125611560, 0.8197463039, 0.8267473349, + 0.8335748949, 0.8402386937, 0.8467476129, 0.8531098003, + 0.8593327495, 0.8654233698, 0.8713880464, 0.8772326935, + 0.8829628002, 0.8885834710, 0.8940994619, 0.8995152120, + 0.9048348715, 0.9100623268, 0.9152012229, 0.9202549833, + 0.9252268281, 0.9301197899, 0.9349367288, 0.9396803449, + 0.9443531909, 0.9489576823, 0.9534961076, 0.9579706374, + 0.9623833320, 0.9667361492, 0.9710309512, 0.9752695109, + 0.9794535174, 0.9835845813, 0.9876642399, 0.9916939614, + 0.9956751493, 0.9996091459, 1.0034972362, 1.0073406510, + 1.0111405700, 1.0148981248, 1.0186144013, 1.0222904422 }, + { 0.5419809316, 0.5625329386, 0.5812764912, 0.5985496562, + 0.6146003370, 0.6296162401, 0.6437432340, 0.6570971404, + 0.6697716039, 0.6818435182, 0.6933768712, 0.7044255353, + 0.7150353340, 0.7252456009, 0.7350903742, 0.7445993259, + 0.7537984929, 0.7627108595, 0.7713568269, 0.7797545943, + 0.7879204712, 0.7958691361, 0.8036138516, 0.8111666444, + 0.8185384580, 0.8257392814, 0.8327782597, 0.8396637886, + 0.8464035955, 0.8530048108, 0.8594740287, 0.8658173611, + 0.8720404845, 0.8781486812, 0.8841468762, 0.8900396688, + 0.8958313620, 0.9015259874, 0.9071273286, 0.9126389413, + 0.9180641715, 0.9234061727, 0.9286679198, 0.9338522236, + 0.9389617420, 0.9439989920, 0.9489663591, 0.9538661069, + 0.9587003852, 0.9634712378, 0.9681806094, 0.9728303524, + 0.9774222323, 0.9819579336, 0.9864390644, 0.9908671615, + 0.9952436943, 0.9995700689, 1.0038476318, 1.0080776733, + 1.0122614305, 1.0164000906, 1.0204947932, 1.0245466331 }, + { 0.5126261246, 0.5338683013, 0.5533029807, 0.5712636181, + 0.5879954388, 0.6036845987, 0.6184760989, 0.6324853169, + 0.6458057215, 0.6585142011, 0.6706748475, 0.6823417062, + 0.6935608163, 0.7043717519, 0.7148088052, 0.7249019070, + 0.7346773529, 0.7441583823, 0.7533656456, 0.7623175831, + 0.7710307376, 0.7795200117, 0.7877988829, 0.7958795841, + 0.8037732557, 0.8114900754, 0.8190393682, 0.8264297018, + 0.8336689680, 0.8407644543, 0.8477229049, 0.8545505751, + 0.8612532786, 0.8678364291, 0.8743050768, 0.8806639416, + 0.8869174414, 0.8930697184, 0.8991246621, 0.9050859297, + 0.9109569648, 0.9167410144, 0.9224411436, 0.9280602496, + 0.9336010737, 0.9390662129, 0.9444581300, 0.9497791628, + 0.9550315328, 0.9602173528, 0.9653386345, 0.9703972943, + 0.9753951600, 0.9803339761, 0.9852154088, 0.9900410510, + 0.9948124263, 0.9995309934, 1.0041981497, 1.0088152348, + 1.0133835335, 1.0179042791, 1.0223786564, 1.0268078035 }, +}; + +#endif /* AVCODEC_WMAVOICE_DATA_H */ diff --git a/include/libavcodec/wmv2.h b/include/libavcodec/wmv2.h new file mode 100644 index 0000000..6fc9704 --- /dev/null +++ b/include/libavcodec/wmv2.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2002 The FFmpeg Project + * + * 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_WMV2_H +#define AVCODEC_WMV2_H + +#include "mpegvideo.h" +#include "wmv2dsp.h" + +#define SKIP_TYPE_NONE 0 +#define SKIP_TYPE_MPEG 1 +#define SKIP_TYPE_ROW 2 +#define SKIP_TYPE_COL 3 + + +typedef struct WMV2Context { + WMV2DSPContext wdsp; + int hshift; +} WMV2Context; + +void ff_wmv2_common_init(MpegEncContext *s); + +void ff_mspel_motion(MpegEncContext *s, + uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, + uint8_t *const *ref_picture, + const op_pixels_func (*pix_op)[4], + int motion_x, int motion_y, int h); + + +static av_always_inline int wmv2_get_cbp_table_index(MpegEncContext *s, int cbp_index) +{ + static const uint8_t map[3][3] = { + { 0, 2, 1 }, + { 1, 0, 2 }, + { 2, 1, 0 }, + }; + + return map[(s->qscale > 10) + (s->qscale > 20)][cbp_index]; +} + +#endif /* AVCODEC_WMV2_H */ diff --git a/include/libavcodec/wmv2data.h b/include/libavcodec/wmv2data.h new file mode 100644 index 0000000..178346a --- /dev/null +++ b/include/libavcodec/wmv2data.h @@ -0,0 +1,27 @@ +/* + * 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_WMV2DATA_H +#define AVCODEC_WMV2DATA_H + +#include + +extern const uint8_t ff_wmv2_scantableA[64]; +extern const uint8_t ff_wmv2_scantableB[64]; + +#endif /* AVCODEC_WMV2DATA_H */ diff --git a/include/libavcodec/wmv2dec.h b/include/libavcodec/wmv2dec.h new file mode 100644 index 0000000..bc8745b --- /dev/null +++ b/include/libavcodec/wmv2dec.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2002 The FFmpeg Project + * + * 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_WMV2DEC_H +#define AVCODEC_WMV2DEC_H + +#include "mpegvideo.h" + +int ff_wmv2_decode_picture_header(MpegEncContext * s); +int ff_wmv2_decode_secondary_picture_header(MpegEncContext * s); +void ff_wmv2_add_mb(MpegEncContext *s, int16_t block[6][64], + uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr); + +#endif diff --git a/include/libavcodec/wmv2dsp.h b/include/libavcodec/wmv2dsp.h new file mode 100644 index 0000000..5e40b30 --- /dev/null +++ b/include/libavcodec/wmv2dsp.h @@ -0,0 +1,38 @@ +/* + * 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_WMV2DSP_H +#define AVCODEC_WMV2DSP_H + +#include + +#include "qpeldsp.h" + +typedef struct WMV2DSPContext { + void (*idct_add)(uint8_t *dest, ptrdiff_t line_size, int16_t *block); + void (*idct_put)(uint8_t *dest, ptrdiff_t line_size, int16_t *block); + + qpel_mc_func put_mspel_pixels_tab[8]; + + int idct_perm; +} WMV2DSPContext; + +void ff_wmv2dsp_init(WMV2DSPContext *c); +void ff_wmv2dsp_init_mips(WMV2DSPContext *c); + +#endif /* AVCODEC_WMV2DSP_H */ diff --git a/include/libavcodec/wmv2enc.h b/include/libavcodec/wmv2enc.h new file mode 100644 index 0000000..263265a --- /dev/null +++ b/include/libavcodec/wmv2enc.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2002 The FFmpeg Project + * + * 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_WMV2ENC_H +#define AVCODEC_WMV2ENC_H + +#include "mpegvideo.h" + +int ff_wmv2_encode_picture_header(MpegEncContext * s); +void ff_wmv2_encode_mb(MpegEncContext * s, int16_t block[6][64], + int motion_x, int motion_y); + + +#endif diff --git a/include/libavcodec/xface.h b/include/libavcodec/xface.h new file mode 100644 index 0000000..d366fdb --- /dev/null +++ b/include/libavcodec/xface.h @@ -0,0 +1,101 @@ +/* + * Copyright (c) 1990 James Ashton - Sydney University + * Copyright (c) 2012 Stefano Sabatini + * + * 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 + */ + +/** + * @file + * X-Face common definitions. + */ + +#ifndef AVCODEC_XFACE_H +#define AVCODEC_XFACE_H + +#include + +/* define the face size - 48x48x1 */ +#define XFACE_WIDTH 48 +#define XFACE_HEIGHT 48 +#define XFACE_PIXELS (XFACE_WIDTH * XFACE_HEIGHT) + +/* compressed output uses the full range of printable characters. + * In ASCII these are in a contiguous block so we just need to know + * the first and last. The total number of printables is needed too. */ +#define XFACE_FIRST_PRINT '!' +#define XFACE_LAST_PRINT '~' +#define XFACE_PRINTS (XFACE_LAST_PRINT - XFACE_FIRST_PRINT + 1) + +/* + * Image is encoded as a big integer, using characters from '~' to + * '!', for a total of 94 symbols. In order to express + * 48x48 pixels with the worst case encoding 666 symbols should + * be sufficient. + */ +#define XFACE_MAX_DIGITS 666 + +#define XFACE_BITSPERWORD 8 +#define XFACE_WORDCARRY (1 << XFACE_BITSPERWORD) +#define XFACE_WORDMASK (XFACE_WORDCARRY - 1) + +// This must be larger or equal to log256(94^XFACE_MAX_DIGITS) +#define XFACE_MAX_WORDS 546 + +/* Portable, very large unsigned integer arithmetic is needed. + * Implementation uses arrays of WORDs. */ +typedef struct { + int nb_words; + uint8_t words[XFACE_MAX_WORDS]; +} BigInt; + +/** + * Add a to b storing the result in b. + */ +void ff_big_add(BigInt *b, uint8_t a); + +/** + * Divide b by a storing the result in b and the remainder in the word + * pointed to by r. + */ +void ff_big_div(BigInt *b, uint8_t a, uint8_t *r); + +/** + * Multiply a by b storing the result in b. + */ +void ff_big_mul(BigInt *b, uint8_t a); + +/* Each face is encoded using 9 octrees of 16x16 each. Each level of the + * trees has varying probabilities of being white, grey or black. + * The table below is based on sampling many faces */ +enum XFaceColor { XFACE_COLOR_BLACK = 0, XFACE_COLOR_GREY, XFACE_COLOR_WHITE }; + +/* Data of varying probabilities are encoded by a value in the range 0 - 255. + * The probability of the data determines the range of possible encodings. + * Offset gives the first possible encoding of the range. */ +typedef struct { + uint8_t range; + uint8_t offset; +} ProbRange; + +extern const ProbRange ff_xface_probranges_per_level[4][3]; + +extern const ProbRange ff_xface_probranges_2x2[16]; + +void ff_xface_generate_face(uint8_t *dst, uint8_t * const src); + +#endif /* AVCODEC_XFACE_H */ diff --git a/include/libavcodec/xiph.h b/include/libavcodec/xiph.h new file mode 100644 index 0000000..4ab2469 --- /dev/null +++ b/include/libavcodec/xiph.h @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2007 The FFmpeg Project + * + * 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_XIPH_H +#define AVCODEC_XIPH_H + +#include + +/** + * Split a single extradata buffer into the three headers that most + * Xiph codecs use. (e.g. Theora and Vorbis) + * Works both with Matroska's packing and lavc's packing. + * + * @param[in] extradata The single chunk that combines all three headers + * @param[in] extradata_size The size of the extradata buffer + * @param[in] first_header_size The size of the first header, used to + * differentiate between the Matroska packing and lavc packing. + * @param[out] header_start Pointers to the start of the three separate headers. + * @param[out] header_len The sizes of each of the three headers. + * @return On error a negative value is returned, on success zero. + */ +int avpriv_split_xiph_headers(const uint8_t *extradata, int extradata_size, + int first_header_size, const uint8_t *header_start[3], + int header_len[3]); + +#endif /* AVCODEC_XIPH_H */ diff --git a/include/libavcodec/xvididct.h b/include/libavcodec/xvididct.h new file mode 100644 index 0000000..e0bc1a2 --- /dev/null +++ b/include/libavcodec/xvididct.h @@ -0,0 +1,36 @@ +/* + * 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_XVIDIDCT_H +#define AVCODEC_XVIDIDCT_H + +#include + +#include "avcodec.h" +#include "idctdsp.h" + +void ff_xvid_idct(int16_t *const in); + +void ff_xvid_idct_init(IDCTDSPContext *c, AVCodecContext *avctx); + +void ff_xvid_idct_init_x86(IDCTDSPContext *c, AVCodecContext *avctx, + unsigned high_bit_depth); +void ff_xvid_idct_init_mips(IDCTDSPContext *c, AVCodecContext *avctx, + unsigned high_bit_depth); + +#endif /* AVCODEC_XVIDIDCT_H */ diff --git a/include/libavcodec/xwd.h b/include/libavcodec/xwd.h new file mode 100644 index 0000000..d046046 --- /dev/null +++ b/include/libavcodec/xwd.h @@ -0,0 +1,41 @@ +/* + * XWD image format + * + * Copyright (c) 2012 Paul B Mahol + * + * 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_XWD_H +#define AVCODEC_XWD_H + +#define XWD_VERSION 7 +#define XWD_HEADER_SIZE 100 +#define XWD_CMAP_SIZE 12 + +#define XWD_XY_BITMAP 0 +#define XWD_XY_PIXMAP 1 +#define XWD_Z_PIXMAP 2 + +#define XWD_STATIC_GRAY 0 +#define XWD_GRAY_SCALE 1 +#define XWD_STATIC_COLOR 2 +#define XWD_PSEUDO_COLOR 3 +#define XWD_TRUE_COLOR 4 +#define XWD_DIRECT_COLOR 5 + +#endif /* AVCODEC_XWD_H */ diff --git a/include/libavcodec/zlib_wrapper.h b/include/libavcodec/zlib_wrapper.h new file mode 100644 index 0000000..fa8ee65 --- /dev/null +++ b/include/libavcodec/zlib_wrapper.h @@ -0,0 +1,61 @@ +/* + * Wrappers for zlib + * Copyright (C) 2022 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_ZLIB_WRAPPER_H +#define AVCODEC_ZLIB_WRAPPER_H + +#include + +typedef struct FFZStream { + z_stream zstream; + int inited; +} FFZStream; + +/** + * Wrapper around inflateInit(). It initializes the fields that zlib + * requires to be initialized before inflateInit(). + * In case of error it also returns an error message to the provided logctx; + * in any case, it sets zstream->inited to indicate whether inflateInit() + * succeeded. + * @return Returns 0 on success or a negative error code on failure + */ +int ff_inflate_init(FFZStream *zstream, void *logctx); + +/** + * Wrapper around inflateEnd(). It calls inflateEnd() iff + * zstream->inited is set and resets zstream->inited. + * It is therefore safe to be called even if + * ff_inflate_init() has never been called on it (or errored out) + * provided that the FFZStream (or just FFZStream.inited) has been zeroed. + */ +void ff_inflate_end(FFZStream *zstream); + +/** + * Wrapper around deflateInit(). It works analogously to ff_inflate_init(). + */ +int ff_deflate_init(FFZStream *zstream, int level, void *logctx); + +/** + * Wrapper around deflateEnd(). It works analogously to ff_inflate_end(). + */ +void ff_deflate_end(FFZStream *zstream); + +#endif /* AVCODEC_ZLIB_WRAPPER_H */ diff --git a/include/libavdevice/alsa.h b/include/libavdevice/alsa.h new file mode 100644 index 0000000..07783c9 --- /dev/null +++ b/include/libavdevice/alsa.h @@ -0,0 +1,109 @@ +/* + * ALSA input and output + * Copyright (c) 2007 Luca Abeni ( lucabe72 email it ) + * Copyright (c) 2007 Benoit Fouet ( benoit fouet free fr ) + * + * 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 + */ + +/** + * @file + * ALSA input and output: definitions and structures + * @author Luca Abeni ( lucabe72 email it ) + * @author Benoit Fouet ( benoit fouet free fr ) + */ + +#ifndef AVDEVICE_ALSA_H +#define AVDEVICE_ALSA_H + +#include +#include "config.h" +#include "libavutil/log.h" +#include "timefilter.h" +#include "avdevice.h" + +/* XXX: we make the assumption that the soundcard accepts this format */ +/* XXX: find better solution with "preinit" method, needed also in + other formats */ +#define DEFAULT_CODEC_ID AV_NE(AV_CODEC_ID_PCM_S16BE, AV_CODEC_ID_PCM_S16LE) + +typedef void (*ff_reorder_func)(const void *, void *, int); + +#define ALSA_BUFFER_SIZE_MAX 131072 + +typedef struct AlsaData { + AVClass *class; + snd_pcm_t *h; + int frame_size; ///< bytes per sample * channels + int period_size; ///< preferred size for reads and writes, in frames + int sample_rate; ///< sample rate set by user + int channels; ///< number of channels set by user + int last_period; + TimeFilter *timefilter; + void (*reorder_func)(const void *, void *, int); + void *reorder_buf; + int reorder_buf_size; ///< in frames + int64_t timestamp; ///< current timestamp, without latency applied. + AVPacket *pkt; +} AlsaData; + +/** + * Open an ALSA PCM. + * + * @param s media file handle + * @param mode either SND_PCM_STREAM_CAPTURE or SND_PCM_STREAM_PLAYBACK + * @param sample_rate in: requested sample rate; + * out: actually selected sample rate + * @param channels number of channels + * @param codec_id in: requested AVCodecID or AV_CODEC_ID_NONE; + * out: actually selected AVCodecID, changed only if + * AV_CODEC_ID_NONE was requested + * + * @return 0 if OK, AVERROR_xxx on error + */ +av_warn_unused_result +int ff_alsa_open(AVFormatContext *s, snd_pcm_stream_t mode, + unsigned int *sample_rate, + int channels, enum AVCodecID *codec_id); + +/** + * Close the ALSA PCM. + * + * @param s1 media file handle + * + * @return 0 + */ +int ff_alsa_close(AVFormatContext *s1); + +/** + * Try to recover from ALSA buffer underrun. + * + * @param s1 media file handle + * @param err error code reported by the previous ALSA call + * + * @return 0 if OK, AVERROR_xxx on error + */ +av_warn_unused_result +int ff_alsa_xrun_recover(AVFormatContext *s1, int err); + +av_warn_unused_result +int ff_alsa_extend_reorder_buf(AlsaData *s, int size); + +av_warn_unused_result +int ff_alsa_get_device_list(AVDeviceInfoList *device_list, snd_pcm_stream_t stream_type); + +#endif /* AVDEVICE_ALSA_H */ diff --git a/include/libavdevice/avdevice.h b/include/libavdevice/avdevice.h index 0b32e59..887fd5e 100644 --- a/include/libavdevice/avdevice.h +++ b/include/libavdevice/avdevice.h @@ -327,136 +327,6 @@ int avdevice_dev_to_app_control_message(struct AVFormatContext *s, enum AVDevToAppMessageType type, void *data, size_t data_size); -#if FF_API_DEVICE_CAPABILITIES -/** - * Following API allows user to probe device capabilities (supported codecs, - * pixel formats, sample formats, resolutions, channel counts, etc). - * It is build on top op AVOption API. - * Queried capabilities make it possible to set up converters of video or audio - * parameters that fit to the device. - * - * List of capabilities that can be queried: - * - Capabilities valid for both audio and video devices: - * - codec: supported audio/video codecs. - * type: AV_OPT_TYPE_INT (AVCodecID value) - * - Capabilities valid for audio devices: - * - sample_format: supported sample formats. - * type: AV_OPT_TYPE_INT (AVSampleFormat value) - * - sample_rate: supported sample rates. - * type: AV_OPT_TYPE_INT - * - channels: supported number of channels. - * type: AV_OPT_TYPE_INT - * - channel_layout: supported channel layouts. - * type: AV_OPT_TYPE_INT64 - * - Capabilities valid for video devices: - * - pixel_format: supported pixel formats. - * type: AV_OPT_TYPE_INT (AVPixelFormat value) - * - window_size: supported window sizes (describes size of the window size presented to the user). - * type: AV_OPT_TYPE_IMAGE_SIZE - * - frame_size: supported frame sizes (describes size of provided video frames). - * type: AV_OPT_TYPE_IMAGE_SIZE - * - fps: supported fps values - * type: AV_OPT_TYPE_RATIONAL - * - * Value of the capability may be set by user using av_opt_set() function - * and AVDeviceCapabilitiesQuery object. Following queries will - * limit results to the values matching already set capabilities. - * For example, setting a codec may impact number of formats or fps values - * returned during next query. Setting invalid value may limit results to zero. - * - * Example of the usage basing on opengl output device: - * - * @code - * AVFormatContext *oc = NULL; - * AVDeviceCapabilitiesQuery *caps = NULL; - * AVOptionRanges *ranges; - * int ret; - * - * if ((ret = avformat_alloc_output_context2(&oc, NULL, "opengl", NULL)) < 0) - * goto fail; - * if (avdevice_capabilities_create(&caps, oc, NULL) < 0) - * goto fail; - * - * //query codecs - * if (av_opt_query_ranges(&ranges, caps, "codec", AV_OPT_MULTI_COMPONENT_RANGE)) < 0) - * goto fail; - * //pick codec here and set it - * av_opt_set(caps, "codec", AV_CODEC_ID_RAWVIDEO, 0); - * - * //query format - * if (av_opt_query_ranges(&ranges, caps, "pixel_format", AV_OPT_MULTI_COMPONENT_RANGE)) < 0) - * goto fail; - * //pick format here and set it - * av_opt_set(caps, "pixel_format", AV_PIX_FMT_YUV420P, 0); - * - * //query and set more capabilities - * - * fail: - * //clean up code - * avdevice_capabilities_free(&query, oc); - * avformat_free_context(oc); - * @endcode - */ - -/** - * Structure describes device capabilities. - * - * It is used by devices in conjunction with av_device_capabilities AVOption table - * to implement capabilities probing API based on AVOption API. Should not be used directly. - */ -typedef struct AVDeviceCapabilitiesQuery { - const AVClass *av_class; - AVFormatContext *device_context; - enum AVCodecID codec; - enum AVSampleFormat sample_format; - enum AVPixelFormat pixel_format; - int sample_rate; - int channels; - int64_t channel_layout; - int window_width; - int window_height; - int frame_width; - int frame_height; - AVRational fps; -} AVDeviceCapabilitiesQuery; - -/** - * AVOption table used by devices to implement device capabilities API. Should not be used by a user. - */ -attribute_deprecated -extern const AVOption av_device_capabilities[]; - -/** - * Initialize capabilities probing API based on AVOption API. - * - * avdevice_capabilities_free() must be called when query capabilities API is - * not used anymore. - * - * @param[out] caps Device capabilities data. Pointer to a NULL pointer must be passed. - * @param s Context of the device. - * @param device_options An AVDictionary filled with device-private options. - * On return this parameter will be destroyed and replaced with a dict - * containing options that were not found. May be NULL. - * The same options must be passed later to avformat_write_header() for output - * devices or avformat_open_input() for input devices, or at any other place - * that affects device-private options. - * - * @return >= 0 on success, negative otherwise. - */ -attribute_deprecated -int avdevice_capabilities_create(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s, - AVDictionary **device_options); - -/** - * Free resources created by avdevice_capabilities_create() - * - * @param caps Device capabilities data to be freed. - * @param s Context of the device. - */ -attribute_deprecated -void avdevice_capabilities_free(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s); -#endif - /** * Structure describes basic parameters of the device. */ @@ -494,7 +364,7 @@ int avdevice_list_devices(struct AVFormatContext *s, AVDeviceInfoList **device_l /** * Convenient function to free result of avdevice_list_devices(). * - * @param devices device list to be freed. + * @param device_list device list to be freed. */ void avdevice_free_list_devices(AVDeviceInfoList **device_list); diff --git a/include/libavdevice/decklink_common.h b/include/libavdevice/decklink_common.h new file mode 100644 index 0000000..6b32dc2 --- /dev/null +++ b/include/libavdevice/decklink_common.h @@ -0,0 +1,251 @@ +/* + * Blackmagic DeckLink common code + * Copyright (c) 2013-2014 Ramiro Polla, Luca Barbato, Deti Fliegl + * Copyright (c) 2017 Akamai Technologies, Inc. + * + * 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 AVDEVICE_DECKLINK_COMMON_H +#define AVDEVICE_DECKLINK_COMMON_H + +#include +#if BLACKMAGIC_DECKLINK_API_VERSION < 0x0b000000 +#define IID_IDeckLinkProfileAttributes IID_IDeckLinkAttributes +#define IDeckLinkProfileAttributes IDeckLinkAttributes +#endif + +extern "C" { +#include "libavutil/mem.h" +#include "libavcodec/packet_internal.h" +#include "libavfilter/ccfifo.h" +} +#include "libavutil/thread.h" +#include "decklink_common_c.h" +#if CONFIG_LIBKLVANC +#include "libklvanc/vanc.h" +#endif + +#ifdef _WIN32 +#define DECKLINK_BOOL BOOL +#else +#define DECKLINK_BOOL bool +#endif + +#ifdef _WIN32 +static char *dup_wchar_to_utf8(wchar_t *w) +{ + char *s = NULL; + int l = WideCharToMultiByte(CP_UTF8, 0, w, -1, 0, 0, 0, 0); + s = (char *) av_malloc(l); + if (s) + WideCharToMultiByte(CP_UTF8, 0, w, -1, s, l, 0, 0); + return s; +} +#define DECKLINK_STR OLECHAR * +#define DECKLINK_STRDUP dup_wchar_to_utf8 +#define DECKLINK_FREE(s) SysFreeString(s) +#elif defined(__APPLE__) +static char *dup_cfstring_to_utf8(CFStringRef w) +{ + char s[256]; + CFStringGetCString(w, s, 255, kCFStringEncodingUTF8); + return av_strdup(s); +} +#define DECKLINK_STR const __CFString * +#define DECKLINK_STRDUP dup_cfstring_to_utf8 +#define DECKLINK_FREE(s) CFRelease(s) +#else +#define DECKLINK_STR const char * +#define DECKLINK_STRDUP av_strdup +/* free() is needed for a string returned by the DeckLink SDL. */ +#define DECKLINK_FREE(s) free((void *) s) +#endif + +class decklink_output_callback; +class decklink_input_callback; + +typedef struct DecklinkPacketQueue { + PacketList pkt_list; + int nb_packets; + unsigned long long size; + int abort_request; + pthread_mutex_t mutex; + pthread_cond_t cond; + AVFormatContext *avctx; + int64_t max_q_size; +} DecklinkPacketQueue; + +struct decklink_ctx { + /* DeckLink SDK interfaces */ + IDeckLink *dl; + IDeckLinkOutput *dlo; + IDeckLinkInput *dli; + IDeckLinkConfiguration *cfg; + IDeckLinkProfileAttributes *attr; + decklink_output_callback *output_callback; + + /* DeckLink mode information */ + BMDTimeValue bmd_tb_den; + BMDTimeValue bmd_tb_num; + BMDDisplayMode bmd_mode; + BMDVideoConnection video_input; + BMDAudioConnection audio_input; + BMDTimecodeFormat tc_format; + int bmd_width; + int bmd_height; + int bmd_field_dominance; + int supports_vanc; + + /* Capture buffer queue */ + DecklinkPacketQueue queue; + + CCFifo cc_fifo; ///< closed captions + + /* Output VANC queue */ + DecklinkPacketQueue vanc_queue; + + /* Streams present */ + int audio; + int video; + + /* Status */ + int playback_started; + int64_t first_pts; + int64_t last_pts; + unsigned long frameCount; + unsigned int dropped; + AVStream *audio_st; + AVStream *video_st; + AVStream *klv_st; + AVStream *teletext_st; + uint16_t cdp_sequence_num; + + /* Options */ + int list_devices; + int list_formats; + int enable_klv; + int64_t teletext_lines; + double preroll; + int duplex_mode; + BMDLinkConfiguration link; + DecklinkPtsSource audio_pts_source; + DecklinkPtsSource video_pts_source; + int draw_bars; + BMDPixelFormat raw_format; + DecklinkSignalLossAction signal_loss_action; + + int frames_preroll; + int frames_buffer; + + pthread_mutex_t mutex; + pthread_cond_t cond; + int frames_buffer_available_spots; + int autodetect; + +#if CONFIG_LIBKLVANC + struct klvanc_context_s *vanc_ctx; +#endif + + int channels; + int audio_depth; + unsigned long tc_seen; // used with option wait_for_tc +}; + +typedef enum { DIRECTION_IN, DIRECTION_OUT} decklink_direction_t; + +static const BMDPixelFormat decklink_raw_format_map[] = { + (BMDPixelFormat)0, + bmdFormat8BitYUV, + bmdFormat10BitYUV, + bmdFormat8BitARGB, + bmdFormat8BitBGRA, + bmdFormat10BitRGB, +}; + +static const BMDAudioConnection decklink_audio_connection_map[] = { + (BMDAudioConnection)0, + bmdAudioConnectionEmbedded, + bmdAudioConnectionAESEBU, + bmdAudioConnectionAnalog, + bmdAudioConnectionAnalogXLR, + bmdAudioConnectionAnalogRCA, + bmdAudioConnectionMicrophone, +}; + +static const BMDVideoConnection decklink_video_connection_map[] = { + (BMDVideoConnection)0, + bmdVideoConnectionSDI, + bmdVideoConnectionHDMI, + bmdVideoConnectionOpticalSDI, + bmdVideoConnectionComponent, + bmdVideoConnectionComposite, + bmdVideoConnectionSVideo, +}; + +static const BMDTimecodeFormat decklink_timecode_format_map[] = { + (BMDTimecodeFormat)0, + bmdTimecodeRP188VITC1, + bmdTimecodeRP188VITC2, + bmdTimecodeRP188LTC, + bmdTimecodeRP188Any, + bmdTimecodeVITC, + bmdTimecodeVITCField2, + bmdTimecodeSerial, +#if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000 + bmdTimecodeRP188HighFrameRate, +#else + (BMDTimecodeFormat)0, +#endif +}; + +static const BMDLinkConfiguration decklink_link_conf_map[] = { + (BMDLinkConfiguration)0, + bmdLinkConfigurationSingleLink, + bmdLinkConfigurationDualLink, + bmdLinkConfigurationQuadLink +}; + +#if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000 +static const BMDProfileID decklink_profile_id_map[] = { + (BMDProfileID)0, + bmdProfileTwoSubDevicesHalfDuplex, + bmdProfileOneSubDeviceFullDuplex, + bmdProfileOneSubDeviceHalfDuplex, + bmdProfileTwoSubDevicesFullDuplex, + bmdProfileFourSubDevicesHalfDuplex, +}; +#endif + +int ff_decklink_set_configs(AVFormatContext *avctx, decklink_direction_t direction); +int ff_decklink_set_format(AVFormatContext *avctx, int width, int height, int tb_num, int tb_den, enum AVFieldOrder field_order, decklink_direction_t direction = DIRECTION_OUT); +int ff_decklink_set_format(AVFormatContext *avctx, decklink_direction_t direction); +int ff_decklink_list_devices(AVFormatContext *avctx, struct AVDeviceInfoList *device_list, int show_inputs, int show_outputs); +void ff_decklink_list_devices_legacy(AVFormatContext *avctx, int show_inputs, int show_outputs); +int ff_decklink_list_formats(AVFormatContext *avctx, decklink_direction_t direction = DIRECTION_OUT); +void ff_decklink_cleanup(AVFormatContext *avctx); +int ff_decklink_init_device(AVFormatContext *avctx, const char* name); + +void ff_decklink_packet_queue_init(AVFormatContext *avctx, DecklinkPacketQueue *q, int64_t queue_size); +void ff_decklink_packet_queue_flush(DecklinkPacketQueue *q); +void ff_decklink_packet_queue_end(DecklinkPacketQueue *q); +unsigned long long ff_decklink_packet_queue_size(DecklinkPacketQueue *q); +int ff_decklink_packet_queue_put(DecklinkPacketQueue *q, AVPacket *pkt); +int ff_decklink_packet_queue_get(DecklinkPacketQueue *q, AVPacket *pkt, int block); +int64_t ff_decklink_packet_queue_peekpts(DecklinkPacketQueue *q); + +#endif /* AVDEVICE_DECKLINK_COMMON_H */ diff --git a/include/libavdevice/decklink_common_c.h b/include/libavdevice/decklink_common_c.h new file mode 100644 index 0000000..53d2c58 --- /dev/null +++ b/include/libavdevice/decklink_common_c.h @@ -0,0 +1,80 @@ +/* + * Blackmagic DeckLink common code + * Copyright (c) 2013-2014 Ramiro Polla + * Copyright (c) 2017 Akamai Technologies, Inc. + * + * 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 AVDEVICE_DECKLINK_COMMON_C_H +#define AVDEVICE_DECKLINK_COMMON_C_H + +#include +#include + +#include "libavutil/log.h" + +typedef enum DecklinkPtsSource { + PTS_SRC_AUDIO = 1, + PTS_SRC_VIDEO = 2, + PTS_SRC_REFERENCE = 3, + PTS_SRC_WALLCLOCK = 4, + PTS_SRC_ABS_WALLCLOCK = 5, + PTS_SRC_NB +} DecklinkPtsSource; + +typedef enum DecklinkSignalLossAction { + SIGNAL_LOSS_NONE = 1, + SIGNAL_LOSS_REPEAT = 2, + SIGNAL_LOSS_BARS = 3 +} DecklinkSignalLossAction; + +struct decklink_cctx { + const AVClass *cclass; + + void *ctx; + + /* Options */ + int list_devices; + int list_formats; + int enable_klv; + int64_t teletext_lines; + double preroll; + int audio_channels; + int audio_depth; + int duplex_mode; + int link; + int sqd; + int level_a; + DecklinkPtsSource audio_pts_source; + DecklinkPtsSource video_pts_source; + int audio_input; + int video_input; + int tc_format; + int draw_bars; + char *format_code; + int raw_format; + int64_t queue_size; + int64_t vanc_queue_size; + int copyts; + int64_t timestamp_align; + int timing_offset; + int wait_for_tc; + DecklinkSignalLossAction signal_loss_action; +}; + +#endif /* AVDEVICE_DECKLINK_COMMON_C_H */ diff --git a/include/libavdevice/decklink_dec.h b/include/libavdevice/decklink_dec.h new file mode 100644 index 0000000..19757be --- /dev/null +++ b/include/libavdevice/decklink_dec.h @@ -0,0 +1,40 @@ +/* + * Blackmagic DeckLink input + * Copyright (c) 2013-2014 Ramiro Polla + * + * 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 AVDEVICE_DECKLINK_DEC_H +#define AVDEVICE_DECKLINK_DEC_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "libavformat/avformat.h" + +int ff_decklink_read_header(AVFormatContext *avctx); +int ff_decklink_read_packet(AVFormatContext *avctx, AVPacket *pkt); +int ff_decklink_read_close(AVFormatContext *avctx); +int ff_decklink_list_input_devices(AVFormatContext *avctx, struct AVDeviceInfoList *device_list); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* AVDEVICE_DECKLINK_DEC_H */ diff --git a/include/libavdevice/decklink_enc.h b/include/libavdevice/decklink_enc.h new file mode 100644 index 0000000..5798f19 --- /dev/null +++ b/include/libavdevice/decklink_enc.h @@ -0,0 +1,40 @@ +/* + * Blackmagic DeckLink output + * Copyright (c) 2013-2014 Ramiro Polla + * + * 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 AVDEVICE_DECKLINK_ENC_H +#define AVDEVICE_DECKLINK_ENC_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "libavformat/avformat.h" + +int ff_decklink_write_header(AVFormatContext *avctx); +int ff_decklink_write_packet(AVFormatContext *avctx, AVPacket *pkt); +int ff_decklink_write_trailer(AVFormatContext *avctx); +int ff_decklink_list_output_devices(AVFormatContext *avctx, struct AVDeviceInfoList *device_list); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif /* AVDEVICE_DECKLINK_ENC_H */ diff --git a/include/libavdevice/dshow_capture.h b/include/libavdevice/dshow_capture.h new file mode 100644 index 0000000..bb39d49 --- /dev/null +++ b/include/libavdevice/dshow_capture.h @@ -0,0 +1,356 @@ +/* + * DirectShow capture interface + * Copyright (c) 2010 Ramiro Polla + * + * 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 AVDEVICE_DSHOW_CAPTURE_H +#define AVDEVICE_DSHOW_CAPTURE_H + +#define DSHOWDEBUG 0 + +#include "avdevice.h" + +#define COBJMACROS +#include +#define NO_DSHOW_STRSAFE +#include +#include + +#include "libavcodec/internal.h" +#include "libavcodec/packet_internal.h" + +/* EC_DEVICE_LOST is not defined in MinGW dshow headers. */ +#ifndef EC_DEVICE_LOST +#define EC_DEVICE_LOST 0x1f +#endif + +long ff_copy_dshow_media_type(AM_MEDIA_TYPE *dst, const AM_MEDIA_TYPE *src); +void ff_print_VIDEO_STREAM_CONFIG_CAPS(const VIDEO_STREAM_CONFIG_CAPS *caps); +void ff_print_AUDIO_STREAM_CONFIG_CAPS(const AUDIO_STREAM_CONFIG_CAPS *caps); +void ff_print_AM_MEDIA_TYPE(const AM_MEDIA_TYPE *type); +void ff_printGUID(const GUID *g); + +extern const AVClass *ff_dshow_context_class_ptr; +#define dshowdebug(...) ff_dlog(&ff_dshow_context_class_ptr, __VA_ARGS__) + +static inline void nothing(void *foo) +{ +} + +struct GUIDoffset { + const GUID *iid; + int offset; +}; + +enum dshowDeviceType { + VideoDevice = 0, + AudioDevice = 1, +}; + +enum dshowSourceFilterType { + VideoSourceDevice = 0, + AudioSourceDevice = 1, +}; + +#define DECLARE_QUERYINTERFACE(prefix, class, ...) \ +long WINAPI \ +ff_dshow_##prefix##_QueryInterface(class *this, const GUID *riid, void **ppvObject) \ +{ \ + struct GUIDoffset ifaces[] = __VA_ARGS__; \ + int i; \ + dshowdebug("ff_dshow_"AV_STRINGIFY(prefix)"_QueryInterface(%p, %p, %p)\n", this, riid, ppvObject); \ + ff_printGUID(riid); \ + if (!ppvObject) \ + return E_POINTER; \ + for (i = 0; i < sizeof(ifaces)/sizeof(ifaces[0]); i++) { \ + if (IsEqualGUID(riid, ifaces[i].iid)) { \ + void *obj = (void *) ((uint8_t *) this + ifaces[i].offset); \ + ff_dshow_##prefix##_AddRef(this); \ + dshowdebug("\tfound %d with offset %d\n", i, ifaces[i].offset); \ + *ppvObject = (void *) obj; \ + return S_OK; \ + } \ + } \ + dshowdebug("\tE_NOINTERFACE\n"); \ + *ppvObject = NULL; \ + return E_NOINTERFACE; \ +} +#define DECLARE_ADDREF(prefix, class) \ +unsigned long WINAPI \ +ff_dshow_##prefix##_AddRef(class *this) \ +{ \ + dshowdebug("ff_dshow_"AV_STRINGIFY(prefix)"_AddRef(%p)\t%ld\n", this, this->ref+1); \ + return InterlockedIncrement(&this->ref); \ +} +#define DECLARE_RELEASE(prefix, class) \ +unsigned long WINAPI \ +ff_dshow_##prefix##_Release(class *this) \ +{ \ + long ref = InterlockedDecrement(&this->ref); \ + dshowdebug("ff_dshow_"AV_STRINGIFY(prefix)"_Release(%p)\t%ld\n", this, ref); \ + if (!ref) \ + ff_dshow_##prefix##_Destroy(this); \ + return ref; \ +} + +#define DECLARE_DESTROY(prefix, class, func) \ +void ff_dshow_##prefix##_Destroy(class *this) \ +{ \ + dshowdebug("ff_dshow_"AV_STRINGIFY(prefix)"_Destroy(%p)\n", this); \ + func(this); \ + if (this) { \ + if (this->vtbl) \ + CoTaskMemFree(this->vtbl); \ + CoTaskMemFree(this); \ + } \ +} +#define DECLARE_CREATE(prefix, class, setup, ...) \ +class *ff_dshow_##prefix##_Create(__VA_ARGS__) \ +{ \ + class *this = CoTaskMemAlloc(sizeof(class)); \ + dshowdebug("ff_dshow_"AV_STRINGIFY(prefix)"_Create(%p)\n", this); \ + if (!this) \ + goto fail; \ + ZeroMemory(this, sizeof(class)); \ + this->vtbl = CoTaskMemAlloc(sizeof(*this->vtbl)); \ + if (!this->vtbl) \ + goto fail; \ + ZeroMemory(this->vtbl, sizeof(*this->vtbl)); \ + this->ref = 1; \ + if (!setup) \ + goto fail; \ + dshowdebug("created ff_dshow_"AV_STRINGIFY(prefix)" %p\n", this); \ + return this; \ +fail: \ + ff_dshow_##prefix##_Destroy(this); \ + dshowdebug("could not create ff_dshow_"AV_STRINGIFY(prefix)"\n"); \ + return NULL; \ +} + +#define SETVTBL(vtbl, prefix, fn) \ + do { (vtbl)->fn = (void *) ff_dshow_##prefix##_##fn; } while(0) + +/***************************************************************************** + * Forward Declarations + ****************************************************************************/ +typedef struct DShowPin DShowPin; +typedef struct DShowMemInputPin DShowMemInputPin; +typedef struct DShowEnumPins DShowEnumPins; +typedef struct DShowEnumMediaTypes DShowEnumMediaTypes; +typedef struct DShowFilter DShowFilter; + +/***************************************************************************** + * DShowPin + ****************************************************************************/ +struct DShowPin { + IPinVtbl *vtbl; + long ref; + DShowFilter *filter; + IPin *connectedto; + AM_MEDIA_TYPE type; + IMemInputPinVtbl *imemvtbl; +}; + +long WINAPI ff_dshow_pin_QueryInterface (DShowPin *, const GUID *, void **); +unsigned long WINAPI ff_dshow_pin_AddRef (DShowPin *); +unsigned long WINAPI ff_dshow_pin_Release (DShowPin *); +long WINAPI ff_dshow_pin_Connect (DShowPin *, IPin *, const AM_MEDIA_TYPE *); +long WINAPI ff_dshow_pin_ReceiveConnection (DShowPin *, IPin *, const AM_MEDIA_TYPE *); +long WINAPI ff_dshow_pin_Disconnect (DShowPin *); +long WINAPI ff_dshow_pin_ConnectedTo (DShowPin *, IPin **); +long WINAPI ff_dshow_pin_ConnectionMediaType (DShowPin *, AM_MEDIA_TYPE *); +long WINAPI ff_dshow_pin_QueryPinInfo (DShowPin *, PIN_INFO *); +long WINAPI ff_dshow_pin_QueryDirection (DShowPin *, PIN_DIRECTION *); +long WINAPI ff_dshow_pin_QueryId (DShowPin *, wchar_t **); +long WINAPI ff_dshow_pin_QueryAccept (DShowPin *, const AM_MEDIA_TYPE *); +long WINAPI ff_dshow_pin_EnumMediaTypes (DShowPin *, IEnumMediaTypes **); +long WINAPI ff_dshow_pin_QueryInternalConnections(DShowPin *, IPin **, unsigned long *); +long WINAPI ff_dshow_pin_EndOfStream (DShowPin *); +long WINAPI ff_dshow_pin_BeginFlush (DShowPin *); +long WINAPI ff_dshow_pin_EndFlush (DShowPin *); +long WINAPI ff_dshow_pin_NewSegment (DShowPin *, REFERENCE_TIME, REFERENCE_TIME, double); + +long WINAPI ff_dshow_meminputpin_QueryInterface (DShowMemInputPin *, const GUID *, void **); +unsigned long WINAPI ff_dshow_meminputpin_AddRef (DShowMemInputPin *); +unsigned long WINAPI ff_dshow_meminputpin_Release (DShowMemInputPin *); +long WINAPI ff_dshow_meminputpin_GetAllocator (DShowMemInputPin *, IMemAllocator **); +long WINAPI ff_dshow_meminputpin_NotifyAllocator (DShowMemInputPin *, IMemAllocator *, BOOL); +long WINAPI ff_dshow_meminputpin_GetAllocatorRequirements(DShowMemInputPin *, ALLOCATOR_PROPERTIES *); +long WINAPI ff_dshow_meminputpin_Receive (DShowMemInputPin *, IMediaSample *); +long WINAPI ff_dshow_meminputpin_ReceiveMultiple (DShowMemInputPin *, IMediaSample **, long, long *); +long WINAPI ff_dshow_meminputpin_ReceiveCanBlock (DShowMemInputPin *); + +void ff_dshow_pin_Destroy(DShowPin *); +DShowPin *ff_dshow_pin_Create (DShowFilter *filter); + +void ff_dshow_meminputpin_Destroy(DShowMemInputPin *); + +/***************************************************************************** + * DShowEnumPins + ****************************************************************************/ +struct DShowEnumPins { + IEnumPinsVtbl *vtbl; + long ref; + int pos; + DShowPin *pin; + DShowFilter *filter; +}; + +long WINAPI ff_dshow_enumpins_QueryInterface(DShowEnumPins *, const GUID *, void **); +unsigned long WINAPI ff_dshow_enumpins_AddRef (DShowEnumPins *); +unsigned long WINAPI ff_dshow_enumpins_Release (DShowEnumPins *); +long WINAPI ff_dshow_enumpins_Next (DShowEnumPins *, unsigned long, IPin **, unsigned long *); +long WINAPI ff_dshow_enumpins_Skip (DShowEnumPins *, unsigned long); +long WINAPI ff_dshow_enumpins_Reset (DShowEnumPins *); +long WINAPI ff_dshow_enumpins_Clone (DShowEnumPins *, DShowEnumPins **); + +void ff_dshow_enumpins_Destroy(DShowEnumPins *); +DShowEnumPins *ff_dshow_enumpins_Create (DShowPin *pin, DShowFilter *filter); + +/***************************************************************************** + * DShowEnumMediaTypes + ****************************************************************************/ +struct DShowEnumMediaTypes { + IEnumMediaTypesVtbl *vtbl; + long ref; + int pos; + AM_MEDIA_TYPE type; +}; + +long WINAPI ff_dshow_enummediatypes_QueryInterface(DShowEnumMediaTypes *, const GUID *, void **); +unsigned long WINAPI ff_dshow_enummediatypes_AddRef (DShowEnumMediaTypes *); +unsigned long WINAPI ff_dshow_enummediatypes_Release (DShowEnumMediaTypes *); +long WINAPI ff_dshow_enummediatypes_Next (DShowEnumMediaTypes *, unsigned long, AM_MEDIA_TYPE **, unsigned long *); +long WINAPI ff_dshow_enummediatypes_Skip (DShowEnumMediaTypes *, unsigned long); +long WINAPI ff_dshow_enummediatypes_Reset (DShowEnumMediaTypes *); +long WINAPI ff_dshow_enummediatypes_Clone (DShowEnumMediaTypes *, DShowEnumMediaTypes **); + +void ff_dshow_enummediatypes_Destroy(DShowEnumMediaTypes *); +DShowEnumMediaTypes *ff_dshow_enummediatypes_Create(const AM_MEDIA_TYPE *type); + +/***************************************************************************** + * DShowFilter + ****************************************************************************/ +struct DShowFilter { + IBaseFilterVtbl *vtbl; + long ref; + const wchar_t *name; + DShowPin *pin; + FILTER_INFO info; + FILTER_STATE state; + IReferenceClock *clock; + enum dshowDeviceType type; + void *priv_data; + int stream_index; + int64_t start_time; + void (*callback)(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time, enum dshowDeviceType type); +}; + +long WINAPI ff_dshow_filter_QueryInterface (DShowFilter *, const GUID *, void **); +unsigned long WINAPI ff_dshow_filter_AddRef (DShowFilter *); +unsigned long WINAPI ff_dshow_filter_Release (DShowFilter *); +long WINAPI ff_dshow_filter_GetClassID (DShowFilter *, CLSID *); +long WINAPI ff_dshow_filter_Stop (DShowFilter *); +long WINAPI ff_dshow_filter_Pause (DShowFilter *); +long WINAPI ff_dshow_filter_Run (DShowFilter *, REFERENCE_TIME); +long WINAPI ff_dshow_filter_GetState (DShowFilter *, DWORD, FILTER_STATE *); +long WINAPI ff_dshow_filter_SetSyncSource (DShowFilter *, IReferenceClock *); +long WINAPI ff_dshow_filter_GetSyncSource (DShowFilter *, IReferenceClock **); +long WINAPI ff_dshow_filter_EnumPins (DShowFilter *, IEnumPins **); +long WINAPI ff_dshow_filter_FindPin (DShowFilter *, const wchar_t *, IPin **); +long WINAPI ff_dshow_filter_QueryFilterInfo(DShowFilter *, FILTER_INFO *); +long WINAPI ff_dshow_filter_JoinFilterGraph(DShowFilter *, IFilterGraph *, const wchar_t *); +long WINAPI ff_dshow_filter_QueryVendorInfo(DShowFilter *, wchar_t **); + +void ff_dshow_filter_Destroy(DShowFilter *); +DShowFilter *ff_dshow_filter_Create (void *, void *, enum dshowDeviceType); + +/***************************************************************************** + * dshow_ctx + ****************************************************************************/ +struct dshow_ctx { + const AVClass *class; + + IGraphBuilder *graph; + + char *device_name[2]; + char *device_unique_name[2]; + + int video_device_number; + int audio_device_number; + + int list_options; + int list_devices; + int audio_buffer_size; + int crossbar_video_input_pin_number; + int crossbar_audio_input_pin_number; + char *video_pin_name; + char *audio_pin_name; + int show_video_device_dialog; + int show_audio_device_dialog; + int show_video_crossbar_connection_dialog; + int show_audio_crossbar_connection_dialog; + int show_analog_tv_tuner_dialog; + int show_analog_tv_tuner_audio_dialog; + char *audio_filter_load_file; + char *audio_filter_save_file; + char *video_filter_load_file; + char *video_filter_save_file; + int use_video_device_timestamps; + + IBaseFilter *device_filter[2]; + IPin *device_pin[2]; + DShowFilter *capture_filter[2]; + DShowPin *capture_pin[2]; + + HANDLE mutex; + HANDLE event[2]; /* event[0] is set by DirectShow + * event[1] is set by callback() */ + PacketListEntry *pktl; + + int eof; + + int64_t curbufsize[2]; + unsigned int video_frame_num; + + IMediaControl *control; + IMediaEvent *media_event; + + enum AVPixelFormat pixel_format; + enum AVCodecID video_codec_id; + char *framerate; + + int requested_width; + int requested_height; + AVRational requested_framerate; + + int sample_rate; + int sample_size; + int channels; +}; + +/***************************************************************************** + * CrossBar + ****************************************************************************/ +HRESULT ff_dshow_try_setup_crossbar_options(ICaptureGraphBuilder2 *graph_builder2, + IBaseFilter *device_filter, enum dshowDeviceType devtype, AVFormatContext *avctx); + +void ff_dshow_show_filter_properties(IBaseFilter *pFilter, AVFormatContext *avctx); + +#endif /* AVDEVICE_DSHOW_CAPTURE_H */ diff --git a/include/libavdevice/fbdev_common.h b/include/libavdevice/fbdev_common.h new file mode 100644 index 0000000..7b81a8d --- /dev/null +++ b/include/libavdevice/fbdev_common.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2011 Stefano Sabatini + * Copyright (c) 2009 Giliard B. de Freitas + * Copyright (C) 2002 Gunnar Monell + * + * 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 AVDEVICE_FBDEV_COMMON_H +#define AVDEVICE_FBDEV_COMMON_H + +#include +#include +#include "libavutil/pixfmt.h" + +struct AVDeviceInfoList; + +enum AVPixelFormat ff_get_pixfmt_from_fb_varinfo(struct fb_var_screeninfo *varinfo); + +const char* ff_fbdev_default_device(void); + +int ff_fbdev_get_device_list(struct AVDeviceInfoList *device_list); + +#endif /* AVDEVICE_FBDEV_COMMON_H */ diff --git a/include/libavdevice/internal.h b/include/libavdevice/internal.h new file mode 100644 index 0000000..67c90e1 --- /dev/null +++ b/include/libavdevice/internal.h @@ -0,0 +1,28 @@ +/* + * 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 AVDEVICE_INTERNAL_H +#define AVDEVICE_INTERNAL_H + +#include "libavformat/avformat.h" + +av_warn_unused_result +int ff_alloc_input_device_context(struct AVFormatContext **avctx, const AVInputFormat *iformat, + const char *format); + +#endif diff --git a/include/libavdevice/opengl_enc_shaders.h b/include/libavdevice/opengl_enc_shaders.h new file mode 100644 index 0000000..67ee0ae --- /dev/null +++ b/include/libavdevice/opengl_enc_shaders.h @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2014 Lukasz Marek + * + * 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 AVDEVICE_OPENGL_ENC_SHADERS_H +#define AVDEVICE_OPENGL_ENC_SHADERS_H + +#include "libavutil/pixfmt.h" + +static const char * const FF_OPENGL_VERTEX_SHADER = + "uniform mat4 u_projectionMatrix;" + "uniform mat4 u_modelViewMatrix;" + + "attribute vec4 a_position;" + "attribute vec2 a_textureCoords;" + + "varying vec2 texture_coordinate;" + + "void main()" + "{" + "gl_Position = u_projectionMatrix * (a_position * u_modelViewMatrix);" + "texture_coordinate = a_textureCoords;" + "}"; + +/** + * Fragment shader for packet RGBA formats. + */ +static const char * const FF_OPENGL_FRAGMENT_SHADER_RGBA_PACKET = +#if defined(GL_ES_VERSION_2_0) + "precision mediump float;" +#endif + "uniform sampler2D u_texture0;" + "uniform mat4 u_colorMap;" + + "varying vec2 texture_coordinate;" + + "void main()" + "{" + "gl_FragColor = texture2D(u_texture0, texture_coordinate) * u_colorMap;" + "}"; + +/** + * Fragment shader for packet RGB formats. + */ +static const char * const FF_OPENGL_FRAGMENT_SHADER_RGB_PACKET = +#if defined(GL_ES_VERSION_2_0) + "precision mediump float;" +#endif + "uniform sampler2D u_texture0;" + "uniform mat4 u_colorMap;" + + "varying vec2 texture_coordinate;" + + "void main()" + "{" + "gl_FragColor = vec4((texture2D(u_texture0, texture_coordinate) * u_colorMap).rgb, 1.0);" + "}"; + +/** + * Fragment shader for planar RGBA formats. + */ +static const char * const FF_OPENGL_FRAGMENT_SHADER_RGBA_PLANAR = +#if defined(GL_ES_VERSION_2_0) + "precision mediump float;" +#endif + "uniform sampler2D u_texture0;" + "uniform sampler2D u_texture1;" + "uniform sampler2D u_texture2;" + "uniform sampler2D u_texture3;" + + "varying vec2 texture_coordinate;" + + "void main()" + "{" + "gl_FragColor = vec4(texture2D(u_texture0, texture_coordinate).r," + "texture2D(u_texture1, texture_coordinate).r," + "texture2D(u_texture2, texture_coordinate).r," + "texture2D(u_texture3, texture_coordinate).r);" + "}"; + +/** + * Fragment shader for planar RGB formats. + */ +static const char * const FF_OPENGL_FRAGMENT_SHADER_RGB_PLANAR = +#if defined(GL_ES_VERSION_2_0) + "precision mediump float;" +#endif + "uniform sampler2D u_texture0;" + "uniform sampler2D u_texture1;" + "uniform sampler2D u_texture2;" + + "varying vec2 texture_coordinate;" + + "void main()" + "{" + "gl_FragColor = vec4(texture2D(u_texture0, texture_coordinate).r," + "texture2D(u_texture1, texture_coordinate).r," + "texture2D(u_texture2, texture_coordinate).r," + "1.0);" + "}"; + +/** + * Fragment shader for planar YUV formats. + */ +static const char * const FF_OPENGL_FRAGMENT_SHADER_YUV_PLANAR = +#if defined(GL_ES_VERSION_2_0) + "precision mediump float;" +#endif + "uniform sampler2D u_texture0;" + "uniform sampler2D u_texture1;" + "uniform sampler2D u_texture2;" + "uniform float u_chroma_div_w;" + "uniform float u_chroma_div_h;" + + "varying vec2 texture_coordinate;" + + "void main()" + "{" + "vec3 yuv;" + + "yuv.r = texture2D(u_texture0, texture_coordinate).r - 0.0625;" + "yuv.g = texture2D(u_texture1, vec2(texture_coordinate.x / u_chroma_div_w, texture_coordinate.y / u_chroma_div_h)).r - 0.5;" + "yuv.b = texture2D(u_texture2, vec2(texture_coordinate.x / u_chroma_div_w, texture_coordinate.y / u_chroma_div_h)).r - 0.5;" + + "gl_FragColor = clamp(vec4(mat3(1.1643, 1.16430, 1.1643," + "0.0, -0.39173, 2.0170," + "1.5958, -0.81290, 0.0) * yuv, 1.0), 0.0, 1.0);" + + "}"; + +/** + * Fragment shader for planar YUVA formats. + */ +static const char * const FF_OPENGL_FRAGMENT_SHADER_YUVA_PLANAR = +#if defined(GL_ES_VERSION_2_0) + "precision mediump float;" +#endif + "uniform sampler2D u_texture0;" + "uniform sampler2D u_texture1;" + "uniform sampler2D u_texture2;" + "uniform sampler2D u_texture3;" + "uniform float u_chroma_div_w;" + "uniform float u_chroma_div_h;" + + "varying vec2 texture_coordinate;" + + "void main()" + "{" + "vec3 yuv;" + + "yuv.r = texture2D(u_texture0, texture_coordinate).r - 0.0625;" + "yuv.g = texture2D(u_texture1, vec2(texture_coordinate.x / u_chroma_div_w, texture_coordinate.y / u_chroma_div_h)).r - 0.5;" + "yuv.b = texture2D(u_texture2, vec2(texture_coordinate.x / u_chroma_div_w, texture_coordinate.y / u_chroma_div_h)).r - 0.5;" + + "gl_FragColor = clamp(vec4(mat3(1.1643, 1.16430, 1.1643," + "0.0, -0.39173, 2.0170," + "1.5958, -0.81290, 0.0) * yuv, texture2D(u_texture3, texture_coordinate).r), 0.0, 1.0);" + "}"; + +static const char * const FF_OPENGL_FRAGMENT_SHADER_GRAY = +#if defined(GL_ES_VERSION_2_0) + "precision mediump float;" +#endif + "uniform sampler2D u_texture0;" + "varying vec2 texture_coordinate;" + "void main()" + "{" + "float c = texture2D(u_texture0, texture_coordinate).r;" + "gl_FragColor = vec4(c, c, c, 1.0);" + "}"; + +#endif /* AVDEVICE_OPENGL_ENC_SHADERS_H */ diff --git a/include/libavdevice/oss.h b/include/libavdevice/oss.h new file mode 100644 index 0000000..f1da2b1 --- /dev/null +++ b/include/libavdevice/oss.h @@ -0,0 +1,47 @@ +/* + * 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 AVDEVICE_OSS_H +#define AVDEVICE_OSS_H + +#include +#include "libavutil/log.h" +#include "libavcodec/codec_id.h" +#include "libavformat/avformat.h" + +#define OSS_AUDIO_BLOCK_SIZE 4096 + +typedef struct OSSAudioData { + AVClass *class; + int fd; + int sample_rate; + int sample_size; /* in bytes ! */ + int channels; + int frame_size; /* in bytes ! */ + enum AVCodecID codec_id; + unsigned int flip_left : 1; + uint8_t buffer[OSS_AUDIO_BLOCK_SIZE]; + int buffer_ptr; +} OSSAudioData; + +int ff_oss_audio_open(AVFormatContext *s1, int is_output, + const char *audio_device); + +int ff_oss_audio_close(OSSAudioData *s); + +#endif /* AVDEVICE_OSS_H */ diff --git a/include/libavdevice/pulse_audio_common.h b/include/libavdevice/pulse_audio_common.h new file mode 100644 index 0000000..9def3cb --- /dev/null +++ b/include/libavdevice/pulse_audio_common.h @@ -0,0 +1,40 @@ +/* + * Pulseaudio input + * Copyright (c) 2011 Luca Barbato + * + * 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 AVDEVICE_PULSE_AUDIO_COMMON_H +#define AVDEVICE_PULSE_AUDIO_COMMON_H + +#include +#include "libavcodec/codec_id.h" +#include "avdevice.h" + +pa_sample_format_t ff_codec_id_to_pulse_format(enum AVCodecID codec_id); + +av_warn_unused_result +int ff_pulse_audio_get_devices(AVDeviceInfoList *devices, const char *server, int output); + +av_warn_unused_result +int ff_pulse_audio_connect_context(pa_mainloop **pa_ml, pa_context **pa_ctx, + const char *server, const char *description); + +void ff_pulse_audio_disconnect_context(pa_mainloop **pa_ml, pa_context **pa_ctx); + +#endif /* AVDEVICE_PULSE_AUDIO_COMMON_H */ diff --git a/include/libavdevice/sndio.h b/include/libavdevice/sndio.h new file mode 100644 index 0000000..54a5ec3 --- /dev/null +++ b/include/libavdevice/sndio.h @@ -0,0 +1,48 @@ +/* + * sndio play and grab interface + * Copyright (c) 2010 Jacob Meuser + * + * 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 AVDEVICE_SNDIO_H +#define AVDEVICE_SNDIO_H + +#include +#include + +#include "libavutil/log.h" +#include "avdevice.h" + +typedef struct SndioData { + AVClass *class; + struct sio_hdl *hdl; + enum AVCodecID codec_id; + int64_t hwpos; + int64_t softpos; + uint8_t *buffer; + int bps; + int buffer_size; + int buffer_offset; + int channels; + int sample_rate; +} SndioData; + +int ff_sndio_open(AVFormatContext *s1, int is_output, const char *audio_device); +int ff_sndio_close(SndioData *s); + +#endif /* AVDEVICE_SNDIO_H */ diff --git a/include/libavdevice/timefilter.h b/include/libavdevice/timefilter.h new file mode 100644 index 0000000..de70945 --- /dev/null +++ b/include/libavdevice/timefilter.h @@ -0,0 +1,97 @@ +/* + * Delay Locked Loop based time filter prototypes and declarations + * Copyright (c) 2009 Samalyse + * Copyright (c) 2009 Michael Niedermayer + * Author: Olivier Guilyardi + * Michael Niedermayer + * + * 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 AVDEVICE_TIMEFILTER_H +#define AVDEVICE_TIMEFILTER_H + +/** + * Opaque type representing a time filter state + * + * The purpose of this filter is to provide a way to compute accurate time + * stamps that can be compared to wall clock time, especially when dealing + * with two clocks: the system clock and a hardware device clock, such as + * a soundcard. + */ +typedef struct TimeFilter TimeFilter; + + +/** + * Create a new Delay Locked Loop time filter + * + * Where bandwidth is up to you to choose. Smaller values will filter out more + * of the jitter, but also take a longer time for the loop to settle. A good + * starting point is something between 0.3 and 3 Hz. + * + * @param time_base period of the hardware clock in seconds + * (for example 1.0/44100) + * @param period expected update interval, in input units + * @param brandwidth filtering bandwidth, in Hz + * + * @return a pointer to a TimeFilter struct, or NULL on error + */ +TimeFilter * ff_timefilter_new(double time_base, double period, double bandwidth); + +/** + * Update the filter + * + * This function must be called in real time, at each process cycle. + * + * @param period the device cycle duration in clock_periods. For example, at + * 44.1kHz and a buffer size of 512 frames, period = 512 when clock_period + * was 1.0/44100, or 512/44100 if clock_period was 1. + * + * system_time, in seconds, should be the value of the system clock time, + * at (or as close as possible to) the moment the device hardware interrupt + * occurred (or any other event the device clock raises at the beginning of a + * cycle). + * + * @return the filtered time, in seconds + */ +double ff_timefilter_update(TimeFilter *self, double system_time, double period); + +/** + * Evaluate the filter at a specified time + * + * @param delta difference between the requested time and the current time + * (last call to ff_timefilter_update). + * @return the filtered time + */ +double ff_timefilter_eval(TimeFilter *self, double delta); + +/** + * Reset the filter + * + * This function should mainly be called in case of XRUN. + * + * Warning: after calling this, the filter is in an undetermined state until + * the next call to ff_timefilter_update() + */ +void ff_timefilter_reset(TimeFilter *); + +/** + * Free all resources associated with the filter + */ +void ff_timefilter_destroy(TimeFilter *); + +#endif /* AVDEVICE_TIMEFILTER_H */ diff --git a/include/libavdevice/v4l2-common.h b/include/libavdevice/v4l2-common.h new file mode 100644 index 0000000..4fbd15d --- /dev/null +++ b/include/libavdevice/v4l2-common.h @@ -0,0 +1,53 @@ +/* + * 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 AVDEVICE_V4L2_COMMON_H +#define AVDEVICE_V4L2_COMMON_H + +#undef __STRICT_ANSI__ //workaround due to broken kernel headers +#include "config.h" +#include +#include +#include +#include +#include +#include +#if HAVE_SYS_VIDEOIO_H +#include +#else +#if HAVE_ASM_TYPES_H +#include +#endif +#include +#endif +#include "libavutil/pixfmt.h" +#include "libavcodec/codec_id.h" + +struct fmt_map { + enum AVPixelFormat ff_fmt; + enum AVCodecID codec_id; + uint32_t v4l2_fmt; +}; + +extern const struct fmt_map ff_fmt_conversion_table[]; + +uint32_t ff_fmt_ff2v4l(enum AVPixelFormat pix_fmt, enum AVCodecID codec_id); +enum AVPixelFormat ff_fmt_v4l2ff(uint32_t v4l2_fmt, enum AVCodecID codec_id); +enum AVCodecID ff_fmt_v4l2codec(uint32_t v4l2_fmt); + +#endif /* AVDEVICE_V4L2_COMMON_H */ diff --git a/include/libavdevice/version.h b/include/libavdevice/version.h index a458e0f..7608a86 100644 --- a/include/libavdevice/version.h +++ b/include/libavdevice/version.h @@ -29,7 +29,7 @@ #include "version_major.h" -#define LIBAVDEVICE_VERSION_MINOR 7 +#define LIBAVDEVICE_VERSION_MINOR 3 #define LIBAVDEVICE_VERSION_MICRO 100 #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \ diff --git a/include/libavdevice/version_major.h b/include/libavdevice/version_major.h index d255ff6..f16abb6 100644 --- a/include/libavdevice/version_major.h +++ b/include/libavdevice/version_major.h @@ -25,13 +25,19 @@ * Libavdevice version macros */ -#define LIBAVDEVICE_VERSION_MAJOR 59 +#define LIBAVDEVICE_VERSION_MAJOR 61 /** * FF_API_* defines may be placed below to indicate public API that will be * dropped at a future version bump. The defines themselves are not part of * the public API and may change, break or disappear at any time. */ -#define FF_API_DEVICE_CAPABILITIES (LIBAVDEVICE_VERSION_MAJOR < 60) + +// reminder to remove the bktr device on next major bump +#define FF_API_BKTR_DEVICE (LIBAVDEVICE_VERSION_MAJOR < 62) +// reminder to remove the opengl device on next major bump +#define FF_API_OPENGL_DEVICE (LIBAVDEVICE_VERSION_MAJOR < 62) +// reminder to remove the sdl2 device on next major bump +#define FF_API_SDL2_DEVICE (LIBAVDEVICE_VERSION_MAJOR < 62) #endif /* AVDEVICE_VERSION_MAJOR_H */ diff --git a/include/libavfilter/af_afirdsp.h b/include/libavfilter/af_afirdsp.h new file mode 100644 index 0000000..827e067 --- /dev/null +++ b/include/libavfilter/af_afirdsp.h @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2017 Paul B Mahol + * + * 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 AVFILTER_AFIRDSP_H +#define AVFILTER_AFIRDSP_H + +#include + +#include "config.h" +#include "libavutil/attributes.h" + +typedef struct AudioFIRDSPContext { + void (*fcmul_add)(float *sum, const float *t, const float *c, + ptrdiff_t len); + void (*dcmul_add)(double *sum, const double *t, const double *c, + ptrdiff_t len); +} AudioFIRDSPContext; + +void ff_afir_init_riscv(AudioFIRDSPContext *s); +void ff_afir_init_x86(AudioFIRDSPContext *s); + +static void fcmul_add_c(float *sum, const float *t, const float *c, ptrdiff_t len) +{ + int n; + + for (n = 0; n < len; n++) { + const float cre = c[2 * n ]; + const float cim = c[2 * n + 1]; + const float tre = t[2 * n ]; + const float tim = t[2 * n + 1]; + + sum[2 * n ] += tre * cre - tim * cim; + sum[2 * n + 1] += tre * cim + tim * cre; + } + + sum[2 * n] += t[2 * n] * c[2 * n]; +} + +static void dcmul_add_c(double *sum, const double *t, const double *c, ptrdiff_t len) +{ + int n; + + for (n = 0; n < len; n++) { + const double cre = c[2 * n ]; + const double cim = c[2 * n + 1]; + const double tre = t[2 * n ]; + const double tim = t[2 * n + 1]; + + sum[2 * n ] += tre * cre - tim * cim; + sum[2 * n + 1] += tre * cim + tim * cre; + } + + sum[2 * n] += t[2 * n] * c[2 * n]; +} + +static av_unused void ff_afir_init(AudioFIRDSPContext *dsp) +{ + dsp->fcmul_add = fcmul_add_c; + dsp->dcmul_add = dcmul_add_c; + +#if ARCH_RISCV + ff_afir_init_riscv(dsp); +#elif ARCH_X86 + ff_afir_init_x86(dsp); +#endif +} + +#endif /* AVFILTER_AFIRDSP_H */ diff --git a/include/libavfilter/af_anlmdndsp.h b/include/libavfilter/af_anlmdndsp.h new file mode 100644 index 0000000..4b4c3d8 --- /dev/null +++ b/include/libavfilter/af_anlmdndsp.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2019 Paul B Mahol + * + * 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 AVFILTER_ANLMDNDSP_H +#define AVFILTER_ANLMDNDSP_H + +#include "libavutil/common.h" + +#include "audio.h" +#include "avfilter.h" +#include "formats.h" + +typedef struct AudioNLMDNDSPContext { + float (*compute_distance_ssd)(const float *f1, const float *f2, ptrdiff_t K); + void (*compute_cache)(float *cache, const float *f, ptrdiff_t S, ptrdiff_t K, + ptrdiff_t i, ptrdiff_t jj); +} AudioNLMDNDSPContext; + +void ff_anlmdn_init(AudioNLMDNDSPContext *s); +void ff_anlmdn_init_x86(AudioNLMDNDSPContext *s); + +#endif /* AVFILTER_ANLMDNDSP_H */ diff --git a/include/libavfilter/af_volume.h b/include/libavfilter/af_volume.h new file mode 100644 index 0000000..c3756ee --- /dev/null +++ b/include/libavfilter/af_volume.h @@ -0,0 +1,95 @@ +/* + * 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 + */ + +/** + * @file + * audio volume filter + */ + +#ifndef AVFILTER_VOLUME_H +#define AVFILTER_VOLUME_H + +#include +#include "libavutil/eval.h" +#include "libavutil/float_dsp.h" +#include "libavutil/log.h" +#include "libavutil/samplefmt.h" + +enum PrecisionType { + PRECISION_FIXED = 0, + PRECISION_FLOAT, + PRECISION_DOUBLE, +}; + +enum EvalMode { + EVAL_MODE_ONCE, + EVAL_MODE_FRAME, + EVAL_MODE_NB +}; + +enum VolumeVarName { + VAR_N, + VAR_NB_CHANNELS, + VAR_NB_CONSUMED_SAMPLES, + VAR_NB_SAMPLES, +#if FF_API_FRAME_PKT + VAR_POS, +#endif + VAR_PTS, + VAR_SAMPLE_RATE, + VAR_STARTPTS, + VAR_STARTT, + VAR_T, + VAR_TB, + VAR_VOLUME, + VAR_VARS_NB +}; + +enum ReplayGainType { + REPLAYGAIN_DROP, + REPLAYGAIN_IGNORE, + REPLAYGAIN_TRACK, + REPLAYGAIN_ALBUM, +}; + +typedef struct VolumeContext { + const AVClass *class; + AVFloatDSPContext *fdsp; + int precision; + int eval_mode; + const char *volume_expr; + AVExpr *volume_pexpr; + double var_values[VAR_VARS_NB]; + + int replaygain; + double replaygain_preamp; + int replaygain_noclip; + double volume; + int volume_i; + int channels; + int planes; + enum AVSampleFormat sample_fmt; + + void (*scale_samples)(uint8_t *dst, const uint8_t *src, int nb_samples, + int volume); + int samples_align; +} VolumeContext; + +void ff_volume_init_x86(VolumeContext *vol); + +#endif /* AVFILTER_VOLUME_H */ diff --git a/include/libavfilter/atadenoise.h b/include/libavfilter/atadenoise.h new file mode 100644 index 0000000..7d92ece --- /dev/null +++ b/include/libavfilter/atadenoise.h @@ -0,0 +1,42 @@ + /* + * Copyright (c) 2019 Paul B Mahol + * + * 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 AVFILTER_ATADENOISE_H +#define AVFILTER_ATADENOISE_H + +#include +#include + +enum ATAAlgorithm { + PARALLEL, + SERIAL, + NB_ATAA +}; + +typedef struct ATADenoiseDSPContext { + void (*filter_row[4])(const uint8_t *src, uint8_t *dst, + const uint8_t **srcf, + int w, int mid, int size, + int thra, int thrb, const float *weight); +} ATADenoiseDSPContext; + +void ff_atadenoise_init_x86(ATADenoiseDSPContext *dsp, int depth, int algorithm, const float *sigma); + +#endif /* AVFILTER_ATADENOISE_H */ diff --git a/include/libavfilter/audio.h b/include/libavfilter/audio.h new file mode 100644 index 0000000..881df0c --- /dev/null +++ b/include/libavfilter/audio.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) Stefano Sabatini | stefasab at gmail.com + * Copyright (c) S.N. Hemanth Meenakshisundaram | smeenaks at ucsd.edu + * + * 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 AVFILTER_AUDIO_H +#define AVFILTER_AUDIO_H + +#include "avfilter.h" +#include "filters.h" + +/** + * An AVFilterPad array whose only entry has name "default" + * and is of type AVMEDIA_TYPE_AUDIO. + */ +extern const AVFilterPad ff_audio_default_filterpad[1]; + +/** default handler for get_audio_buffer() for audio inputs */ +AVFrame *ff_default_get_audio_buffer(AVFilterLink *link, int nb_samples); + +/** get_audio_buffer() handler for filters which simply pass audio along */ +AVFrame *ff_null_get_audio_buffer(AVFilterLink *link, int nb_samples); + +/** + * Request an audio samples buffer with a specific set of permissions. + * + * @param link the output link to the filter from which the buffer will + * be requested + * @param nb_samples the number of samples per channel + * @return on success an AVFrame owned by the caller, NULL on error + */ +AVFrame *ff_get_audio_buffer(AVFilterLink *link, int nb_samples); + +/** + * Parse a sample rate. + * + * @param ret unsigned integer pointer to where the value should be written + * @param arg string to parse + * @param log_ctx log context + * @return >= 0 in case of success, a negative AVERROR code on error + */ +av_warn_unused_result +int ff_parse_sample_rate(int *ret, const char *arg, void *log_ctx); + +/** + * Parse a channel layout or a corresponding integer representation. + * + * @param ret 64bit integer pointer to where the value should be written. + * @param nret integer pointer to the number of channels; + * if not NULL, then unknown channel layouts are accepted + * @param arg string to parse + * @param log_ctx log context + * @return >= 0 in case of success, a negative AVERROR code on error + */ +av_warn_unused_result +int ff_parse_channel_layout(AVChannelLayout *ret, int *nret, const char *arg, + void *log_ctx); + +#endif /* AVFILTER_AUDIO_H */ diff --git a/include/libavfilter/avf_showcqt.h b/include/libavfilter/avf_showcqt.h new file mode 100644 index 0000000..186215c --- /dev/null +++ b/include/libavfilter/avf_showcqt.h @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2015 Muhammad Faiz + * + * 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 AVFILTER_SHOWCQT_H +#define AVFILTER_SHOWCQT_H + +#include "libavutil/tx.h" +#include "avfilter.h" + +typedef struct Coeffs { + float *val; + int start, len; +} Coeffs; + +typedef struct RGBFloat { + float r, g, b; +} RGBFloat; + +typedef struct YUVFloat { + float y, u, v; +} YUVFloat; + +typedef union { + RGBFloat rgb; + YUVFloat yuv; +} ColorFloat; + +typedef struct ShowCQTContext { + const AVClass *class; + AVFilterContext *ctx; + AVFrame *axis_frame; + AVFrame *sono_frame; + enum AVPixelFormat format; + int sono_idx; + int sono_count; + int step; + AVRational step_frac; + int remaining_frac; + int remaining_fill; + int remaining_fill_max; + int64_t next_pts; + double *freq; + AVTXContext *fft_ctx; + av_tx_fn tx_fn; + Coeffs *coeffs; + AVComplexFloat *fft_data; + AVComplexFloat *fft_input; + AVComplexFloat *fft_result; + AVComplexFloat *cqt_result; + float *attack_data; + int fft_bits; + int fft_len; + int cqt_len; + int cqt_align; + ColorFloat *c_buf; + float *h_buf; + float *rcp_h_buf; + float *sono_v_buf; + float *bar_v_buf; + float cmatrix[3][3]; + float cscheme_v[6]; + /* callback */ + void (*cqt_calc)(AVComplexFloat *dst, const AVComplexFloat *src, const Coeffs *coeffs, + int len, int fft_len); + void (*permute_coeffs)(float *v, int len); + void (*draw_bar)(AVFrame *out, const float *h, const float *rcp_h, + const ColorFloat *c, int bar_h, float bar_t); + void (*draw_axis)(AVFrame *out, AVFrame *axis, const ColorFloat *c, int off); + void (*draw_sono)(AVFrame *out, AVFrame *sono, int off, int idx); + void (*update_sono)(AVFrame *sono, const ColorFloat *c, int idx); + /* performance debugging */ + int64_t fft_time; + int64_t cqt_time; + int64_t process_cqt_time; + int64_t update_sono_time; + int64_t alloc_time; + int64_t bar_time; + int64_t axis_time; + int64_t sono_time; + /* option */ + int width, height; + AVRational rate; + int bar_h; + int axis_h; + int sono_h; + int fullhd; /* deprecated */ + char *sono_v; + char *bar_v; + float sono_g; + float bar_g; + float bar_t; + double timeclamp; + double attack; + double basefreq; + double endfreq; + float coeffclamp; /* deprecated - ignored */ + char *tlength; + int count; + int fcount; + char *fontfile; + char *font; + char *fontcolor; + char *axisfile; + int axis; + int csp; + char *cscheme; +} ShowCQTContext; + +void ff_showcqt_init_x86(ShowCQTContext *s); + +#endif diff --git a/include/libavfilter/avfilter.h b/include/libavfilter/avfilter.h index 2e8197c..1401577 100644 --- a/include/libavfilter/avfilter.h +++ b/include/libavfilter/avfilter.h @@ -76,16 +76,6 @@ typedef struct AVFilterPad AVFilterPad; typedef struct AVFilterFormats AVFilterFormats; typedef struct AVFilterChannelLayouts AVFilterChannelLayouts; -#if FF_API_PAD_COUNT -/** - * Get the number of elements in an AVFilter's inputs or outputs array. - * - * @deprecated Use avfilter_filter_pad_count() instead. - */ -attribute_deprecated -int avfilter_pad_count(const AVFilterPad *pads); -#endif - /** * Get the name of an AVFilterPad. * @@ -108,6 +98,41 @@ const char *avfilter_pad_get_name(const AVFilterPad *pads, int pad_idx); */ enum AVMediaType avfilter_pad_get_type(const AVFilterPad *pads, int pad_idx); +/** + * Lists of formats / etc. supported by an end of a link. + * + * This structure is directly part of AVFilterLink, in two copies: + * one for the source filter, one for the destination filter. + + * These lists are used for negotiating the format to actually be used, + * which will be loaded into the format and channel_layout members of + * AVFilterLink, when chosen. + */ +typedef struct AVFilterFormatsConfig { + + /** + * List of supported formats (pixel or sample). + */ + AVFilterFormats *formats; + + /** + * Lists of supported sample rates, only for audio. + */ + AVFilterFormats *samplerates; + + /** + * Lists of supported channel layouts, only for audio. + */ + AVFilterChannelLayouts *channel_layouts; + + /** + * Lists of supported YUV color metadata, only for YUV video. + */ + AVFilterFormats *color_spaces; ///< AVColorSpace + AVFilterFormats *color_ranges; ///< AVColorRange + +} AVFilterFormatsConfig; + /** * The number of the filter inputs is not determined just by AVFilter.inputs. * The filter might add additional inputs during initialization depending on the @@ -141,6 +166,11 @@ enum AVMediaType avfilter_pad_get_type(const AVFilterPad *pads, int pad_idx); * received by the filter on one of its inputs. */ #define AVFILTER_FLAG_METADATA_ONLY (1 << 3) + +/** + * The filter can create hardware frames using AVFilterContext.hw_device_ctx. + */ +#define AVFILTER_FLAG_HWDEVICE (1 << 4) /** * Some filters support a generic "enable" expression option that can be used * to enable or disable a filter in the timeline. Filters supporting this @@ -276,19 +306,6 @@ typedef struct AVFilter { */ int (*init)(AVFilterContext *ctx); - /** - * Should be set instead of @ref AVFilter.init "init" by the filters that - * want to pass a dictionary of AVOptions to nested contexts that are - * allocated during init. - * - * On return, the options dict should be freed and replaced with one that - * contains all the options which could not be processed by this filter (or - * with NULL if all the options were processed). - * - * Otherwise the semantics is the same as for @ref AVFilter.init "init". - */ - int (*init_dict)(AVFilterContext *ctx, AVDictionary **options); - /** * Filter uninitialization function. * @@ -313,13 +330,28 @@ typedef struct AVFilter { * and outputs are fixed), shortly before the format negotiation. This * callback may be called more than once. * - * This callback must set AVFilterLink.outcfg.formats on every input link - * and AVFilterLink.incfg.formats on every output link to a list of - * pixel/sample formats that the filter supports on that link. For audio - * links, this filter must also set @ref AVFilterLink.incfg.samplerates - * "in_samplerates" / @ref AVFilterLink.outcfg.samplerates "out_samplerates" - * and @ref AVFilterLink.incfg.channel_layouts "in_channel_layouts" / - * @ref AVFilterLink.outcfg.channel_layouts "out_channel_layouts" analogously. + * This callback must set ::AVFilterLink's + * @ref AVFilterFormatsConfig.formats "outcfg.formats" + * on every input link and + * @ref AVFilterFormatsConfig.formats "incfg.formats" + * on every output link to a list of pixel/sample formats that the filter + * supports on that link. + * For video links, this filter may also set + * @ref AVFilterFormatsConfig.color_spaces "incfg.color_spaces" + * / + * @ref AVFilterFormatsConfig.color_spaces "outcfg.color_spaces" + * and @ref AVFilterFormatsConfig.color_ranges "incfg.color_ranges" + * / + * @ref AVFilterFormatsConfig.color_ranges "outcfg.color_ranges" + * analogously. + * For audio links, this filter must also set + * @ref AVFilterFormatsConfig.samplerates "incfg.samplerates" + * / + * @ref AVFilterFormatsConfig.samplerates "outcfg.samplerates" + * and @ref AVFilterFormatsConfig.channel_layouts "incfg.channel_layouts" + * / + * @ref AVFilterFormatsConfig.channel_layouts "outcfg.channel_layouts" + * analogously. * * This callback must never be NULL if the union is in this state. * @@ -327,12 +359,31 @@ typedef struct AVFilter { * AVERROR code otherwise */ int (*query_func)(AVFilterContext *); + + /** + * Same as query_func(), except this function writes the results into + * provided arrays. + * + * @param cfg_in array of input format configurations with as many + * members as the filters has inputs (NULL when there are + * no inputs); + * @param cfg_out array of output format configurations with as many + * members as the filters has outputs (NULL when there + * are no outputs); + */ + int (*query_func2)(const AVFilterContext *, + struct AVFilterFormatsConfig **cfg_in, + struct AVFilterFormatsConfig **cfg_out); /** * A pointer to an array of admissible pixel formats delimited * by AV_PIX_FMT_NONE. The generic code will use this list * to indicate that this filter supports each of these pixel formats, * provided that all inputs and outputs use the same pixel format. * + * In addition to that the generic code will mark all inputs + * and all outputs as supporting all color spaces and ranges, as + * long as all inputs and outputs use the same color space/range. + * * This list must never be NULL if the union is in this state. * The type of all inputs and outputs of filters using this must * be AVMEDIA_TYPE_VIDEO. @@ -402,8 +453,6 @@ unsigned avfilter_filter_pad_count(const AVFilter *filter, int is_output); */ #define AVFILTER_THREAD_SLICE (1 << 0) -typedef struct AVFilterInternal AVFilterInternal; - /** An instance of a filter */ struct AVFilterContext { const AVClass *av_class; ///< needed for av_log() and filters common options @@ -443,9 +492,11 @@ struct AVFilterContext { int thread_type; /** - * An opaque struct for libavfilter internal use. + * Max number of threads allowed in this filter instance. + * If <= 0, its value is ignored. + * Overrides global number of threads set per filter graph. */ - AVFilterInternal *internal; + int nb_threads; struct AVFilterCommand *command_queue; @@ -460,16 +511,13 @@ struct AVFilterContext { * in particular, a filter which consumes or processes hardware frames will * instead use the hw_frames_ctx field in AVFilterLink to carry the * hardware context information. + * + * May be set by the caller on filters flagged with AVFILTER_FLAG_HWDEVICE + * before initializing the filter with avfilter_init_str() or + * avfilter_init_dict(). */ AVBufferRef *hw_device_ctx; - /** - * Max number of threads allowed in this filter instance. - * If <= 0, its value is ignored. - * Overrides global number of threads set per filter graph. - */ - int nb_threads; - /** * Ready status of the filter. * A non-0 value means that the filter needs activating; @@ -494,35 +542,6 @@ struct AVFilterContext { int extra_hw_frames; }; -/** - * Lists of formats / etc. supported by an end of a link. - * - * This structure is directly part of AVFilterLink, in two copies: - * one for the source filter, one for the destination filter. - - * These lists are used for negotiating the format to actually be used, - * which will be loaded into the format and channel_layout members of - * AVFilterLink, when chosen. - */ -typedef struct AVFilterFormatsConfig { - - /** - * List of supported formats (pixel or sample). - */ - AVFilterFormats *formats; - - /** - * Lists of supported sample rates, only for audio. - */ - AVFilterFormats *samplerates; - - /** - * Lists of supported channel layouts, only for audio. - */ - AVFilterChannelLayouts *channel_layouts; - -} AVFilterFormatsConfig; - /** * A link between two filters. This contains pointers to the source and * destination filters between which this link exists, and the indexes of @@ -544,22 +563,25 @@ struct AVFilterLink { enum AVMediaType type; ///< filter media type + int format; ///< agreed upon media format + /* These parameters apply only to video */ int w; ///< agreed upon image width int h; ///< agreed upon image height AVRational sample_aspect_ratio; ///< agreed upon sample aspect ratio - /* These parameters apply only to audio */ -#if FF_API_OLD_CHANNEL_LAYOUT /** - * channel layout of current buffer (see libavutil/channel_layout.h) - * @deprecated use ch_layout + * For non-YUV links, these are respectively set to fallback values (as + * appropriate for that colorspace). + * + * Note: This includes grayscale formats, as these are currently treated + * as forced full range always. */ - attribute_deprecated - uint64_t channel_layout; -#endif - int sample_rate; ///< samples per second + enum AVColorSpace colorspace; ///< agreed upon YUV color space + enum AVColorRange color_range; ///< agreed upon YUV color range - int format; ///< agreed upon media format + /* These parameters apply only to audio */ + int sample_rate; ///< samples per second + AVChannelLayout ch_layout; ///< channel layout of current buffer (see libavutil/channel_layout.h) /** * Define the time base used by the PTS of the frames/samples @@ -570,8 +592,6 @@ struct AVFilterLink { */ AVRational time_base; - AVChannelLayout ch_layout; ///< channel layout of current buffer (see libavutil/channel_layout.h) - /***************************************************************** * All fields below this line are not part of the public API. They * may not be used outside of libavfilter and can be changed and @@ -589,136 +609,6 @@ struct AVFilterLink { * Lists of supported formats / etc. supported by the output filter. */ AVFilterFormatsConfig outcfg; - - /** stage of the initialization of the link properties (dimensions, etc) */ - enum { - AVLINK_UNINIT = 0, ///< not started - AVLINK_STARTINIT, ///< started, but incomplete - AVLINK_INIT ///< complete - } init_state; - - /** - * Graph the filter belongs to. - */ - struct AVFilterGraph *graph; - - /** - * Current timestamp of the link, as defined by the most recent - * frame(s), in link time_base units. - */ - int64_t current_pts; - - /** - * Current timestamp of the link, as defined by the most recent - * frame(s), in AV_TIME_BASE units. - */ - int64_t current_pts_us; - - /** - * Index in the age array. - */ - int age_index; - - /** - * Frame rate of the stream on the link, or 1/0 if unknown or variable; - * if left to 0/0, will be automatically copied from the first input - * of the source filter if it exists. - * - * Sources should set it to the best estimation of the real frame rate. - * If the source frame rate is unknown or variable, set this to 1/0. - * Filters should update it if necessary depending on their function. - * Sinks can use it to set a default output frame rate. - * It is similar to the r_frame_rate field in AVStream. - */ - AVRational frame_rate; - - /** - * Minimum number of samples to filter at once. If filter_frame() is - * called with fewer samples, it will accumulate them in fifo. - * This field and the related ones must not be changed after filtering - * has started. - * If 0, all related fields are ignored. - */ - int min_samples; - - /** - * Maximum number of samples to filter at once. If filter_frame() is - * called with more samples, it will split them. - */ - int max_samples; - - /** - * Number of past frames sent through the link. - */ - int64_t frame_count_in, frame_count_out; - - /** - * Number of past samples sent through the link. - */ - int64_t sample_count_in, sample_count_out; - - /** - * A pointer to a FFFramePool struct. - */ - void *frame_pool; - - /** - * True if a frame is currently wanted on the output of this filter. - * Set when ff_request_frame() is called by the output, - * cleared when a frame is filtered. - */ - int frame_wanted_out; - - /** - * For hwaccel pixel formats, this should be a reference to the - * AVHWFramesContext describing the frames. - */ - AVBufferRef *hw_frames_ctx; - -#ifndef FF_INTERNAL_FIELDS - - /** - * Internal structure members. - * The fields below this limit are internal for libavfilter's use - * and must in no way be accessed by applications. - */ - char reserved[0xF000]; - -#else /* FF_INTERNAL_FIELDS */ - - /** - * Queue of frames waiting to be filtered. - */ - FFFrameQueue fifo; - - /** - * If set, the source filter can not generate a frame as is. - * The goal is to avoid repeatedly calling the request_frame() method on - * the same link. - */ - int frame_blocked_in; - - /** - * Link input status. - * If not zero, all attempts of filter_frame will fail with the - * corresponding code. - */ - int status_in; - - /** - * Timestamp of the input status change. - */ - int64_t status_in_pts; - - /** - * Link output status. - * If not zero, all attempts of request_frame will fail with the - * corresponding code. - */ - int status_out; - -#endif /* FF_INTERNAL_FIELDS */ - }; /** @@ -733,18 +623,19 @@ struct AVFilterLink { int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad); +#if FF_API_LINK_PUBLIC /** - * Free the link in *link, and set its pointer to NULL. + * @deprecated this function should never be called by users */ +attribute_deprecated void avfilter_link_free(AVFilterLink **link); /** - * Negotiate the media format, dimensions, etc of all inputs to a filter. - * - * @param filter the filter to negotiate the properties for its inputs - * @return zero on successful negotiation + * @deprecated this function should never be called by users */ +attribute_deprecated int avfilter_config_links(AVFilterContext *filter); +#endif #define AVFILTER_CMD_FLAG_ONE 1 ///< Stop once a filter understood the command (for target=all for example), fast filters are favored automatically #define AVFILTER_CMD_FLAG_FAST 2 ///< Only execute command when its fast (like a video out that supports contrast adjustment in hw) @@ -837,8 +728,6 @@ int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, */ const AVClass *avfilter_get_class(void); -typedef struct AVFilterGraphInternal AVFilterGraphInternal; - /** * A function pointer passed to the @ref AVFilterGraph.execute callback to be * executed multiple times, possibly in parallel. @@ -896,11 +785,6 @@ typedef struct AVFilterGraph { */ int nb_threads; - /** - * Opaque object for libavfilter internal use. - */ - AVFilterGraphInternal *internal; - /** * Opaque user data. May be set by the caller to an arbitrary value, e.g. to * be used from callbacks like @ref AVFilterGraph.execute. @@ -923,18 +807,6 @@ typedef struct AVFilterGraph { avfilter_execute_func *execute; char *aresample_swr_opts; ///< swr options to use for the auto-inserted aresample filters, Access ONLY through AVOptions - - /** - * Private fields - * - * The following fields are for internal use only. - * Their type, offset, number and semantic can change without notice. - */ - - AVFilterLink **sink_links; - int sink_links_count; - - unsigned disable_auto_convert; } AVFilterGraph; /** @@ -1124,6 +996,317 @@ int avfilter_graph_parse2(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs); +/** + * Parameters of a filter's input or output pad. + * + * Created as a child of AVFilterParams by avfilter_graph_segment_parse(). + * Freed in avfilter_graph_segment_free(). + */ +typedef struct AVFilterPadParams { + /** + * An av_malloc()'ed string containing the pad label. + * + * May be av_free()'d and set to NULL by the caller, in which case this pad + * will be treated as unlabeled for linking. + * May also be replaced by another av_malloc()'ed string. + */ + char *label; +} AVFilterPadParams; + +/** + * Parameters describing a filter to be created in a filtergraph. + * + * Created as a child of AVFilterGraphSegment by avfilter_graph_segment_parse(). + * Freed in avfilter_graph_segment_free(). + */ +typedef struct AVFilterParams { + /** + * The filter context. + * + * Created by avfilter_graph_segment_create_filters() based on + * AVFilterParams.filter_name and instance_name. + * + * Callers may also create the filter context manually, then they should + * av_free() filter_name and set it to NULL. Such AVFilterParams instances + * are then skipped by avfilter_graph_segment_create_filters(). + */ + AVFilterContext *filter; + + /** + * Name of the AVFilter to be used. + * + * An av_malloc()'ed string, set by avfilter_graph_segment_parse(). Will be + * passed to avfilter_get_by_name() by + * avfilter_graph_segment_create_filters(). + * + * Callers may av_free() this string and replace it with another one or + * NULL. If the caller creates the filter instance manually, this string + * MUST be set to NULL. + * + * When both AVFilterParams.filter an AVFilterParams.filter_name are NULL, + * this AVFilterParams instance is skipped by avfilter_graph_segment_*() + * functions. + */ + char *filter_name; + /** + * Name to be used for this filter instance. + * + * An av_malloc()'ed string, may be set by avfilter_graph_segment_parse() or + * left NULL. The caller may av_free() this string and replace with another + * one or NULL. + * + * Will be used by avfilter_graph_segment_create_filters() - passed as the + * third argument to avfilter_graph_alloc_filter(), then freed and set to + * NULL. + */ + char *instance_name; + + /** + * Options to be apllied to the filter. + * + * Filled by avfilter_graph_segment_parse(). Afterwards may be freely + * modified by the caller. + * + * Will be applied to the filter by avfilter_graph_segment_apply_opts() + * with an equivalent of av_opt_set_dict2(filter, &opts, AV_OPT_SEARCH_CHILDREN), + * i.e. any unapplied options will be left in this dictionary. + */ + AVDictionary *opts; + + AVFilterPadParams **inputs; + unsigned nb_inputs; + + AVFilterPadParams **outputs; + unsigned nb_outputs; +} AVFilterParams; + +/** + * A filterchain is a list of filter specifications. + * + * Created as a child of AVFilterGraphSegment by avfilter_graph_segment_parse(). + * Freed in avfilter_graph_segment_free(). + */ +typedef struct AVFilterChain { + AVFilterParams **filters; + size_t nb_filters; +} AVFilterChain; + +/** + * A parsed representation of a filtergraph segment. + * + * A filtergraph segment is conceptually a list of filterchains, with some + * supplementary information (e.g. format conversion flags). + * + * Created by avfilter_graph_segment_parse(). Must be freed with + * avfilter_graph_segment_free(). + */ +typedef struct AVFilterGraphSegment { + /** + * The filtergraph this segment is associated with. + * Set by avfilter_graph_segment_parse(). + */ + AVFilterGraph *graph; + + /** + * A list of filter chain contained in this segment. + * Set in avfilter_graph_segment_parse(). + */ + AVFilterChain **chains; + size_t nb_chains; + + /** + * A string containing a colon-separated list of key=value options applied + * to all scale filters in this segment. + * + * May be set by avfilter_graph_segment_parse(). + * The caller may free this string with av_free() and replace it with a + * different av_malloc()'ed string. + */ + char *scale_sws_opts; +} AVFilterGraphSegment; + +/** + * Parse a textual filtergraph description into an intermediate form. + * + * This intermediate representation is intended to be modified by the caller as + * described in the documentation of AVFilterGraphSegment and its children, and + * then applied to the graph either manually or with other + * avfilter_graph_segment_*() functions. See the documentation for + * avfilter_graph_segment_apply() for the canonical way to apply + * AVFilterGraphSegment. + * + * @param graph Filter graph the parsed segment is associated with. Will only be + * used for logging and similar auxiliary purposes. The graph will + * not be actually modified by this function - the parsing results + * are instead stored in seg for further processing. + * @param graph_str a string describing the filtergraph segment + * @param flags reserved for future use, caller must set to 0 for now + * @param seg A pointer to the newly-created AVFilterGraphSegment is written + * here on success. The graph segment is owned by the caller and must + * be freed with avfilter_graph_segment_free() before graph itself is + * freed. + * + * @retval "non-negative number" success + * @retval "negative error code" failure + */ +int avfilter_graph_segment_parse(AVFilterGraph *graph, const char *graph_str, + int flags, AVFilterGraphSegment **seg); + +/** + * Create filters specified in a graph segment. + * + * Walk through the creation-pending AVFilterParams in the segment and create + * new filter instances for them. + * Creation-pending params are those where AVFilterParams.filter_name is + * non-NULL (and hence AVFilterParams.filter is NULL). All other AVFilterParams + * instances are ignored. + * + * For any filter created by this function, the corresponding + * AVFilterParams.filter is set to the newly-created filter context, + * AVFilterParams.filter_name and AVFilterParams.instance_name are freed and set + * to NULL. + * + * @param seg the filtergraph segment to process + * @param flags reserved for future use, caller must set to 0 for now + * + * @retval "non-negative number" Success, all creation-pending filters were + * successfully created + * @retval AVERROR_FILTER_NOT_FOUND some filter's name did not correspond to a + * known filter + * @retval "another negative error code" other failures + * + * @note Calling this function multiple times is safe, as it is idempotent. + */ +int avfilter_graph_segment_create_filters(AVFilterGraphSegment *seg, int flags); + +/** + * Apply parsed options to filter instances in a graph segment. + * + * Walk through all filter instances in the graph segment that have option + * dictionaries associated with them and apply those options with + * av_opt_set_dict2(..., AV_OPT_SEARCH_CHILDREN). AVFilterParams.opts is + * replaced by the dictionary output by av_opt_set_dict2(), which should be + * empty (NULL) if all options were successfully applied. + * + * If any options could not be found, this function will continue processing all + * other filters and finally return AVERROR_OPTION_NOT_FOUND (unless another + * error happens). The calling program may then deal with unapplied options as + * it wishes. + * + * Any creation-pending filters (see avfilter_graph_segment_create_filters()) + * present in the segment will cause this function to fail. AVFilterParams with + * no associated filter context are simply skipped. + * + * @param seg the filtergraph segment to process + * @param flags reserved for future use, caller must set to 0 for now + * + * @retval "non-negative number" Success, all options were successfully applied. + * @retval AVERROR_OPTION_NOT_FOUND some options were not found in a filter + * @retval "another negative error code" other failures + * + * @note Calling this function multiple times is safe, as it is idempotent. + */ +int avfilter_graph_segment_apply_opts(AVFilterGraphSegment *seg, int flags); + +/** + * Initialize all filter instances in a graph segment. + * + * Walk through all filter instances in the graph segment and call + * avfilter_init_dict(..., NULL) on those that have not been initialized yet. + * + * Any creation-pending filters (see avfilter_graph_segment_create_filters()) + * present in the segment will cause this function to fail. AVFilterParams with + * no associated filter context or whose filter context is already initialized, + * are simply skipped. + * + * @param seg the filtergraph segment to process + * @param flags reserved for future use, caller must set to 0 for now + * + * @retval "non-negative number" Success, all filter instances were successfully + * initialized + * @retval "negative error code" failure + * + * @note Calling this function multiple times is safe, as it is idempotent. + */ +int avfilter_graph_segment_init(AVFilterGraphSegment *seg, int flags); + +/** + * Link filters in a graph segment. + * + * Walk through all filter instances in the graph segment and try to link all + * unlinked input and output pads. Any creation-pending filters (see + * avfilter_graph_segment_create_filters()) present in the segment will cause + * this function to fail. Disabled filters and already linked pads are skipped. + * + * Every filter output pad that has a corresponding AVFilterPadParams with a + * non-NULL label is + * - linked to the input with the matching label, if one exists; + * - exported in the outputs linked list otherwise, with the label preserved. + * Unlabeled outputs are + * - linked to the first unlinked unlabeled input in the next non-disabled + * filter in the chain, if one exists + * - exported in the ouputs linked list otherwise, with NULL label + * + * Similarly, unlinked input pads are exported in the inputs linked list. + * + * @param seg the filtergraph segment to process + * @param flags reserved for future use, caller must set to 0 for now + * @param[out] inputs a linked list of all free (unlinked) inputs of the + * filters in this graph segment will be returned here. It + * is to be freed by the caller using avfilter_inout_free(). + * @param[out] outputs a linked list of all free (unlinked) outputs of the + * filters in this graph segment will be returned here. It + * is to be freed by the caller using avfilter_inout_free(). + * + * @retval "non-negative number" success + * @retval "negative error code" failure + * + * @note Calling this function multiple times is safe, as it is idempotent. + */ +int avfilter_graph_segment_link(AVFilterGraphSegment *seg, int flags, + AVFilterInOut **inputs, + AVFilterInOut **outputs); + +/** + * Apply all filter/link descriptions from a graph segment to the associated filtergraph. + * + * This functions is currently equivalent to calling the following in sequence: + * - avfilter_graph_segment_create_filters(); + * - avfilter_graph_segment_apply_opts(); + * - avfilter_graph_segment_init(); + * - avfilter_graph_segment_link(); + * failing if any of them fails. This list may be extended in the future. + * + * Since the above functions are idempotent, the caller may call some of them + * manually, then do some custom processing on the filtergraph, then call this + * function to do the rest. + * + * @param seg the filtergraph segment to process + * @param flags reserved for future use, caller must set to 0 for now + * @param[out] inputs passed to avfilter_graph_segment_link() + * @param[out] outputs passed to avfilter_graph_segment_link() + * + * @retval "non-negative number" success + * @retval "negative error code" failure + * + * @note Calling this function multiple times is safe, as it is idempotent. + */ +int avfilter_graph_segment_apply(AVFilterGraphSegment *seg, int flags, + AVFilterInOut **inputs, + AVFilterInOut **outputs); + +/** + * Free the provided AVFilterGraphSegment and everything associated with it. + * + * @param seg double pointer to the AVFilterGraphSegment to be freed. NULL will + * be written to this pointer on exit from this function. + * + * @note + * The filter contexts (AVFilterParams.filter) are owned by AVFilterGraph rather + * than AVFilterGraphSegment, so they are not freed. + */ +void avfilter_graph_segment_free(AVFilterGraphSegment **seg); + /** * Send a command to one or more filter instances. * diff --git a/include/libavfilter/avfilter_internal.h b/include/libavfilter/avfilter_internal.h new file mode 100644 index 0000000..ec3933b --- /dev/null +++ b/include/libavfilter/avfilter_internal.h @@ -0,0 +1,220 @@ +/* + * 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 + */ + +/* + * APIs internal to the generic filter(graph) layer. + * + * MUST NOT be included by individual filters. + */ + +#ifndef AVFILTER_AVFILTER_INTERNAL_H +#define AVFILTER_AVFILTER_INTERNAL_H + +#include + +#include "avfilter.h" +#include "filters.h" +#include "framequeue.h" + +typedef struct FilterLinkInternal { + FilterLink l; + + struct FFFramePool *frame_pool; + + /** + * Queue of frames waiting to be filtered. + */ + FFFrameQueue fifo; + + /** + * If set, the source filter can not generate a frame as is. + * The goal is to avoid repeatedly calling the request_frame() method on + * the same link. + */ + int frame_blocked_in; + + /** + * Link input status. + * If not zero, all attempts of filter_frame will fail with the + * corresponding code. + */ + int status_in; + + /** + * Timestamp of the input status change. + */ + int64_t status_in_pts; + + /** + * Link output status. + * If not zero, all attempts of request_frame will fail with the + * corresponding code. + */ + int status_out; + + /** + * True if a frame is currently wanted on the output of this filter. + * Set when ff_request_frame() is called by the output, + * cleared when a frame is filtered. + */ + int frame_wanted_out; + + /** + * Index in the age array. + */ + int age_index; + + /** stage of the initialization of the link properties (dimensions, etc) */ + enum { + AVLINK_UNINIT = 0, ///< not started + AVLINK_STARTINIT, ///< started, but incomplete + AVLINK_INIT ///< complete + } init_state; +} FilterLinkInternal; + +static inline FilterLinkInternal *ff_link_internal(AVFilterLink *link) +{ + return (FilterLinkInternal*)link; +} + +typedef struct FFFilterContext { + /** + * The public AVFilterContext. See avfilter.h for it. + */ + AVFilterContext p; + + avfilter_execute_func *execute; + + // 1 when avfilter_init_*() was successfully called on this filter + // 0 otherwise + int initialized; +} FFFilterContext; + +static inline FFFilterContext *fffilterctx(AVFilterContext *ctx) +{ + return (FFFilterContext*)ctx; +} + +typedef struct AVFilterCommand { + double time; ///< time expressed in seconds + char *command; ///< command + char *arg; ///< optional argument for the command + int flags; + struct AVFilterCommand *next; +} AVFilterCommand; + +typedef struct FFFilterGraph { + /** + * The public AVFilterGraph. See avfilter.h for it. + */ + AVFilterGraph p; + + struct FilterLinkInternal **sink_links; + int sink_links_count; + + unsigned disable_auto_convert; + + void *thread; + avfilter_execute_func *thread_execute; + FFFrameQueueGlobal frame_queues; +} FFFilterGraph; + +static inline FFFilterGraph *fffiltergraph(AVFilterGraph *graph) +{ + return (FFFilterGraph*)graph; +} + +/** + * Update the position of a link in the age heap. + */ +void ff_avfilter_graph_update_heap(AVFilterGraph *graph, + struct FilterLinkInternal *li); + +/** + * Allocate a new filter context and return it. + * + * @param filter what filter to create an instance of + * @param inst_name name to give to the new filter context + * + * @return newly created filter context or NULL on failure + */ +AVFilterContext *ff_filter_alloc(const AVFilter *filter, const char *inst_name); + +/** + * Remove a filter from a graph; + */ +void ff_filter_graph_remove_filter(AVFilterGraph *graph, AVFilterContext *filter); + +int ff_filter_activate(AVFilterContext *filter); + +/** + * Parse filter options into a dictionary. + * + * @param logctx context for logging + * @param priv_class a filter's private class for shorthand options or NULL + * @param options dictionary to store parsed options in + * @param args options string to parse + * + * @return a non-negative number on success, a negative error code on failure + */ +int ff_filter_opt_parse(void *logctx, const AVClass *priv_class, + AVDictionary **options, const char *args); + +int ff_graph_thread_init(FFFilterGraph *graph); + +void ff_graph_thread_free(FFFilterGraph *graph); + +/** + * Negotiate the media format, dimensions, etc of all inputs to a filter. + * + * @param filter the filter to negotiate the properties for its inputs + * @return zero on successful negotiation + */ +int ff_filter_config_links(AVFilterContext *filter); + +/* misc trace functions */ + +#define FF_TPRINTF_START(ctx, func) ff_tlog(NULL, "%-16s: ", #func) + +#ifdef TRACE +void ff_tlog_link(void *ctx, AVFilterLink *link, int end); +#else +#define ff_tlog_link(ctx, link, end) do { } while(0) +#endif + +/** + * Run one round of processing on a filter graph. + */ +int ff_filter_graph_run_once(AVFilterGraph *graph); + +/** + * Process the commands queued in the link up to the time of the frame. + * Commands will trigger the process_command() callback. + * @return >= 0 or AVERROR code. + */ +int ff_inlink_process_commands(AVFilterLink *link, const AVFrame *frame); + +/** + * Evaluate the timeline expression of the link for the time and properties + * of the frame. + * @return >0 if enabled, 0 if disabled + * @note It does not update link->dst->is_disabled. + */ +int ff_inlink_evaluate_timeline_at_frame(AVFilterLink *link, const AVFrame *frame); + +#endif /* AVFILTER_AVFILTER_INTERNAL_H */ diff --git a/include/libavfilter/bbox.h b/include/libavfilter/bbox.h new file mode 100644 index 0000000..116158d --- /dev/null +++ b/include/libavfilter/bbox.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2005 Robert Edele + * + * 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 AVFILTER_BBOX_H +#define AVFILTER_BBOX_H + +#include + +typedef struct FFBoundingBox { + int x1, x2, y1, y2; +} FFBoundingBox; + +/** + * Calculate the smallest rectangle that will encompass the + * region with values > min_val. + * + * @param bbox bounding box structure which is updated with the found values. + * If no pixels could be found with value > min_val, the + * structure is not modified. + * @return 1 in case at least one pixel with value > min_val was found, + * 0 otherwise + */ +int ff_calculate_bounding_box(FFBoundingBox *bbox, + const uint8_t *data, int linesize, + int w, int h, int min_val, int depth); + +#endif /* AVFILTER_BBOX_H */ diff --git a/include/libavfilter/blend.h b/include/libavfilter/blend.h new file mode 100644 index 0000000..e663683 --- /dev/null +++ b/include/libavfilter/blend.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2013 Paul B Mahol + * + * 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 AVFILTER_BLEND_H +#define AVFILTER_BLEND_H + +#include "libavutil/eval.h" +#include "avfilter.h" + +enum BlendMode { + BLEND_UNSET = -1, + BLEND_NORMAL, + BLEND_ADDITION, + BLEND_AND, + BLEND_AVERAGE, + BLEND_BURN, + BLEND_DARKEN, + BLEND_DIFFERENCE, + BLEND_GRAINEXTRACT, + BLEND_DIVIDE, + BLEND_DODGE, + BLEND_EXCLUSION, + BLEND_HARDLIGHT, + BLEND_LIGHTEN, + BLEND_MULTIPLY, + BLEND_NEGATION, + BLEND_OR, + BLEND_OVERLAY, + BLEND_PHOENIX, + BLEND_PINLIGHT, + BLEND_REFLECT, + BLEND_SCREEN, + BLEND_SOFTLIGHT, + BLEND_SUBTRACT, + BLEND_VIVIDLIGHT, + BLEND_XOR, + BLEND_HARDMIX, + BLEND_LINEARLIGHT, + BLEND_GLOW, + BLEND_GRAINMERGE, + BLEND_MULTIPLY128, + BLEND_HEAT, + BLEND_FREEZE, + BLEND_EXTREMITY, + BLEND_SOFTDIFFERENCE, + BLEND_GEOMETRIC, + BLEND_HARMONIC, + BLEND_BLEACH, + BLEND_STAIN, + BLEND_INTERPOLATE, + BLEND_HARDOVERLAY, + BLEND_NB +}; + +typedef struct SliceParams { + double *values; + int starty; + AVExpr *e; +} SliceParams; + +typedef struct FilterParams { + enum BlendMode mode; + double opacity; + AVExpr **e; + char *expr_str; + void (*blend)(const uint8_t *top, ptrdiff_t top_linesize, + const uint8_t *bottom, ptrdiff_t bottom_linesize, + uint8_t *dst, ptrdiff_t dst_linesize, + ptrdiff_t width, ptrdiff_t height, + struct FilterParams *param, SliceParams *sliceparam); +} FilterParams; + +void ff_blend_init_x86(FilterParams *param, int depth); + +#endif /* AVFILTER_BLEND_H */ diff --git a/include/libavfilter/boxblur.h b/include/libavfilter/boxblur.h new file mode 100644 index 0000000..214d4e0 --- /dev/null +++ b/include/libavfilter/boxblur.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2002 Michael Niedermayer + * Copyright (c) 2011 Stefano Sabatini + * Copyright (c) 2018 Danil Iashchenko + * + * 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 AVFILTER_BOXBLUR_H +#define AVFILTER_BOXBLUR_H + +#include "libavutil/eval.h" +#include "libavutil/pixdesc.h" + +#include "avfilter.h" + +typedef struct FilterParam { + int radius; + int power; + char *radius_expr; +} FilterParam; + +#define Y 0 +#define U 1 +#define V 2 +#define A 3 + +int ff_boxblur_eval_filter_params(AVFilterLink *inlink, + FilterParam *luma_param, + FilterParam *chroma_param, + FilterParam *alpha_param); + +#endif // AVFILTER_BOXBLUR_H diff --git a/include/libavfilter/bufferqueue.h b/include/libavfilter/bufferqueue.h new file mode 100644 index 0000000..f5e5df2 --- /dev/null +++ b/include/libavfilter/bufferqueue.h @@ -0,0 +1,121 @@ +/* + * Generic buffer queue + * Copyright (c) 2012 Nicolas George + * + * 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 AVFILTER_BUFFERQUEUE_H +#define AVFILTER_BUFFERQUEUE_H + +/** + * FFBufQueue: simple AVFrame queue API + * + * Note: this API is not thread-safe. Concurrent access to the same queue + * must be protected by a mutex or any synchronization mechanism. + */ + +/** + * Maximum size of the queue. + * + * This value can be overridden by definying it before including this + * header. + * Powers of 2 are recommended. + */ +#ifndef FF_BUFQUEUE_SIZE +#define FF_BUFQUEUE_SIZE 64 +#endif + +#include "avfilter.h" +#include "libavutil/avassert.h" + +/** + * Structure holding the queue + */ +struct FFBufQueue { + AVFrame *queue[FF_BUFQUEUE_SIZE]; + unsigned short head; + unsigned short available; /**< number of available buffers */ +}; + +#define BUCKET(i) queue->queue[(queue->head + (i)) % FF_BUFQUEUE_SIZE] + +/** + * Test if a buffer queue is full. + */ +static inline int ff_bufqueue_is_full(struct FFBufQueue *queue) +{ + return queue->available == FF_BUFQUEUE_SIZE; +} + +/** + * Add a buffer to the queue. + * + * If the queue is already full, then the current last buffer is dropped + * (and unrefed) with a warning before adding the new buffer. + */ +static inline void ff_bufqueue_add(void *log, struct FFBufQueue *queue, + AVFrame *buf) +{ + if (ff_bufqueue_is_full(queue)) { + av_log(log, AV_LOG_WARNING, "Buffer queue overflow, dropping.\n"); + av_frame_free(&BUCKET(--queue->available)); + } + BUCKET(queue->available++) = buf; +} + +/** + * Get a buffer from the queue without altering it. + * + * Buffer with index 0 is the first buffer in the queue. + * Return NULL if the queue has not enough buffers. + */ +static inline AVFrame *ff_bufqueue_peek(struct FFBufQueue *queue, + unsigned index) +{ + return index < queue->available ? BUCKET(index) : NULL; +} + +/** + * Get the first buffer from the queue and remove it. + * + * Do not use on an empty queue. + */ +static inline AVFrame *ff_bufqueue_get(struct FFBufQueue *queue) +{ + AVFrame *ret = queue->queue[queue->head]; + av_assert0(queue->available); + queue->available--; + queue->queue[queue->head] = NULL; + queue->head = (queue->head + 1) % FF_BUFQUEUE_SIZE; + return ret; +} + +/** + * Unref and remove all buffers from the queue. + */ +static inline void ff_bufqueue_discard_all(struct FFBufQueue *queue) +{ + while (queue->available) { + AVFrame *buf = ff_bufqueue_get(queue); + av_frame_free(&buf); + } +} + +#undef BUCKET + +#endif /* AVFILTER_BUFFERQUEUE_H */ diff --git a/include/libavfilter/buffersink.h b/include/libavfilter/buffersink.h index 01e7c74..361d603 100644 --- a/include/libavfilter/buffersink.h +++ b/include/libavfilter/buffersink.h @@ -55,6 +55,8 @@ * The format can be constrained by setting options, using av_opt_set() and * related functions with the AV_OPT_SEARCH_CHILDREN flag. * - pix_fmts (int list), + * - color_spaces (int list), + * - color_ranges (int list), * - sample_fmts (int list), * - sample_rates (int list), * - ch_layouts (string), @@ -94,42 +96,6 @@ int av_buffersink_get_frame_flags(AVFilterContext *ctx, AVFrame *frame, int flag */ #define AV_BUFFERSINK_FLAG_NO_REQUEST 2 -#if FF_API_BUFFERSINK_ALLOC -/** - * Deprecated and unused struct to use for initializing a buffersink context. - */ -typedef struct AVBufferSinkParams { - const enum AVPixelFormat *pixel_fmts; ///< list of allowed pixel formats, terminated by AV_PIX_FMT_NONE -} AVBufferSinkParams; - -/** - * Create an AVBufferSinkParams structure. - * - * Must be freed with av_free(). - */ -attribute_deprecated -AVBufferSinkParams *av_buffersink_params_alloc(void); - -/** - * Deprecated and unused struct to use for initializing an abuffersink context. - */ -typedef struct AVABufferSinkParams { - const enum AVSampleFormat *sample_fmts; ///< list of allowed sample formats, terminated by AV_SAMPLE_FMT_NONE - const int64_t *channel_layouts; ///< list of allowed channel layouts, terminated by -1 - const int *channel_counts; ///< list of allowed channel counts, terminated by -1 - int all_channel_counts; ///< if not 0, accept any channel count or layout - int *sample_rates; ///< list of allowed sample rates, terminated by -1 -} AVABufferSinkParams; - -/** - * Create an AVABufferSinkParams structure. - * - * Must be freed with av_free(). - */ -attribute_deprecated -AVABufferSinkParams *av_abuffersink_params_alloc(void); -#endif - /** * Set the frame size for an audio buffer sink. * @@ -153,12 +119,10 @@ AVRational av_buffersink_get_frame_rate (const AVFilterContext *c int av_buffersink_get_w (const AVFilterContext *ctx); int av_buffersink_get_h (const AVFilterContext *ctx); AVRational av_buffersink_get_sample_aspect_ratio (const AVFilterContext *ctx); +enum AVColorSpace av_buffersink_get_colorspace (const AVFilterContext *ctx); +enum AVColorRange av_buffersink_get_color_range (const AVFilterContext *ctx); int av_buffersink_get_channels (const AVFilterContext *ctx); -#if FF_API_OLD_CHANNEL_LAYOUT -attribute_deprecated -uint64_t av_buffersink_get_channel_layout (const AVFilterContext *ctx); -#endif int av_buffersink_get_ch_layout (const AVFilterContext *ctx, AVChannelLayout *ch_layout); int av_buffersink_get_sample_rate (const AVFilterContext *ctx); diff --git a/include/libavfilter/buffersrc.h b/include/libavfilter/buffersrc.h index 3b248b3..6f3344f 100644 --- a/include/libavfilter/buffersrc.h +++ b/include/libavfilter/buffersrc.h @@ -110,19 +110,16 @@ typedef struct AVBufferSrcParameters { */ int sample_rate; -#if FF_API_OLD_CHANNEL_LAYOUT - /** - * Audio only, the audio channel layout - * @deprecated use ch_layout - */ - attribute_deprecated - uint64_t channel_layout; -#endif - /** * Audio only, the audio channel layout */ AVChannelLayout ch_layout; + + /** + * Video only, the YUV colorspace and range. + */ + enum AVColorSpace color_space; + enum AVColorRange color_range; } AVBufferSrcParameters; /** diff --git a/include/libavfilter/bwdifdsp.h b/include/libavfilter/bwdifdsp.h new file mode 100644 index 0000000..4a350e5 --- /dev/null +++ b/include/libavfilter/bwdifdsp.h @@ -0,0 +1,85 @@ +/* + * 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 AVFILTER_BWDIFDSP_H +#define AVFILTER_BWDIFDSP_H + +#include +#include + +typedef struct BWDIFDSPContext { + void (*filter_intra)(void *dst1, const void *cur1, int w, int prefs, int mrefs, + int prefs3, int mrefs3, int parity, int clip_max); + void (*filter_line)(void *dst, const void *prev, const void *cur, const void *next, + int w, int prefs, int mrefs, int prefs2, int mrefs2, + int prefs3, int mrefs3, int prefs4, int mrefs4, + int parity, int clip_max); + void (*filter_edge)(void *dst, const void *prev, const void *cur, const void *next, + int w, int prefs, int mrefs, int prefs2, int mrefs2, + int parity, int clip_max, int spat); + void (*filter_line3)(void *dst, int dstride, + const void *prev, const void *cur, const void *next, int prefs, + int w, int parity, int clip_max); +} BWDIFDSPContext; + +void ff_bwdif_init_filter_line(BWDIFDSPContext *bwdif, int bit_depth); +void ff_bwdif_init_x86(BWDIFDSPContext *bwdif, int bit_depth); +void ff_bwdif_init_aarch64(BWDIFDSPContext *bwdif, int bit_depth); + +void ff_bwdif_filter_edge_c(void *dst1, const void *prev1, const void *cur1, const void *next1, + int w, int prefs, int mrefs, int prefs2, int mrefs2, + int parity, int clip_max, int spat); + +void ff_bwdif_filter_intra_c(void *dst1, const void *cur1, int w, int prefs, int mrefs, + int prefs3, int mrefs3, int parity, int clip_max); + +void ff_bwdif_filter_line_c(void *dst1, const void *prev1, const void *cur1, const void *next1, + int w, int prefs, int mrefs, int prefs2, int mrefs2, + int prefs3, int mrefs3, int prefs4, int mrefs4, + int parity, int clip_max); + +static inline +void ff_bwdif_filter_line3_c(void * dst1, int d_stride, + const void * prev1, const void * cur1, const void * next1, int s_stride, + int w, int parity, int clip_max) +{ + const int prefs = s_stride; + uint8_t * dst = dst1; + const uint8_t * prev = prev1; + const uint8_t * cur = cur1; + const uint8_t * next = next1; + + ff_bwdif_filter_line_c(dst, prev, cur, next, w, + prefs, -prefs, prefs * 2, - prefs * 2, prefs * 3, -prefs * 3, prefs * 4, -prefs * 4, parity, clip_max); +#define NEXT_LINE()\ + dst += d_stride; \ + prev += prefs; \ + cur += prefs; \ + next += prefs; + + NEXT_LINE(); + memcpy(dst, cur, w); + NEXT_LINE(); +#undef NEXT_LINE + ff_bwdif_filter_line_c(dst, prev, cur, next, w, + prefs, -prefs, prefs * 2, - prefs * 2, prefs * 3, -prefs * 3, prefs * 4, -prefs * 4, parity, clip_max); +} + + + +#endif /* AVFILTER_BWDIFDSP_H */ diff --git a/include/libavfilter/ccfifo.h b/include/libavfilter/ccfifo.h new file mode 100644 index 0000000..d3f8a52 --- /dev/null +++ b/include/libavfilter/ccfifo.h @@ -0,0 +1,129 @@ +/* + * CEA-708 Closed Captioning FIFO + * Copyright (c) 2023 LTN Global Communications + * + * Author: Devin Heitmueller + * + * 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 + */ + +/** + * @file + * CC FIFO Buffer + */ + +#ifndef AVFILTER_CCFIFO_H +#define AVFILTER_CCFIFO_H + +#include +#include + +#include "libavutil/frame.h" +#include "libavutil/rational.h" + +#define CC_BYTES_PER_ENTRY 3 + +typedef struct CCFifo { + struct AVFifo *cc_608_fifo; + struct AVFifo *cc_708_fifo; + AVRational framerate; + int expected_cc_count; + int expected_608; + int cc_detected; + int passthrough; + int passthrough_warning; + void *log_ctx; +} CCFifo; + +/** + * Initialize a CCFifo. + * + * @param framerate output framerate + * @param log_ctx used for any av_log() calls + * @return Zero on success, or negative AVERROR code on failure. + */ +int ff_ccfifo_init(CCFifo *ccf, AVRational framerate, void *log_ctx); + +/** + * Free all memory allocated in a CCFifo and clear the context. + * + * @param ccf Pointer to the CCFifo which should be uninitialized + */ +void ff_ccfifo_uninit(CCFifo *ccf); + +/** + * Extract CC data from an AVFrame + * + * Extract CC bytes from the AVFrame, insert them into our queue, and + * remove the side data from the AVFrame. The side data is removed + * as it will be re-inserted at the appropriate rate later in the + * filter. + * + * @param af CCFifo to write to + * @param frame AVFrame with the video frame to operate on + * @return Zero on success, or negative AVERROR + * code on failure. + */ +int ff_ccfifo_extract(CCFifo *ccf, AVFrame *frame); + +/** + *Just like ff_ccfifo_extract(), but takes the raw bytes instead of an AVFrame + */ +int ff_ccfifo_extractbytes(CCFifo *ccf, uint8_t *data, size_t len); + +/** + * Provide the size in bytes of an output buffer to allocate + * + * Ask for how many bytes the output will contain, so the caller can allocate + * an appropriately sized buffer and pass it to ff_ccfifo_injectbytes() + * + */ +static inline int ff_ccfifo_getoutputsize(const CCFifo *ccf) +{ + return ccf->expected_cc_count * CC_BYTES_PER_ENTRY; +} + + +/** + * Insert CC data from the FIFO into an AVFrame (as side data) + * + * Dequeue the appropriate number of CC tuples based on the + * frame rate, and insert them into the AVFrame + * + * @param af CCFifo to read from + * @param frame AVFrame with the video frame to operate on + * @return Zero on success, or negative AVERROR + * code on failure. + */ +int ff_ccfifo_inject(CCFifo *ccf, AVFrame *frame); + +/** + * Just like ff_ccfifo_inject(), but takes the raw bytes to insert the CC data + * int rather than an AVFrame + */ +int ff_ccfifo_injectbytes(CCFifo *ccf, uint8_t *data, size_t len); + +/** + * Returns 1 if captions have been found as a prior call + * to ff_ccfifo_extract() or ff_ccfifo_extractbytes() + */ +static inline int ff_ccfifo_ccdetected(const CCFifo *ccf) +{ + return ccf->cc_detected; +} + +#endif /* AVFILTER_CCFIFO_H */ diff --git a/include/libavfilter/colorspace.h b/include/libavfilter/colorspace.h new file mode 100644 index 0000000..4d98b1d --- /dev/null +++ b/include/libavfilter/colorspace.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2016 Ronald S. Bultje + * 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 AVFILTER_COLORSPACE_H +#define AVFILTER_COLORSPACE_H + +#include "libavutil/csp.h" +#include "libavutil/frame.h" +#include "libavutil/pixfmt.h" + +#define REFERENCE_WHITE 100.0f + +void ff_matrix_invert_3x3(const double in[3][3], double out[3][3]); +void ff_matrix_mul_3x3(double dst[3][3], + const double src1[3][3], const double src2[3][3]); +void ff_matrix_mul_3x3_vec(double dst[3], const double vec[3], const double mat[3][3]); +void ff_fill_rgb2xyz_table(const AVPrimaryCoefficients *coeffs, + const AVWhitepointCoefficients *wp, + double rgb2xyz[3][3]); +void ff_fill_rgb2yuv_table(const AVLumaCoefficients *coeffs, + double rgb2yuv[3][3]); +double ff_determine_signal_peak(AVFrame *in); +void ff_update_hdr_metadata(AVFrame *in, double peak); + +#endif diff --git a/include/libavfilter/colorspacedsp.h b/include/libavfilter/colorspacedsp.h new file mode 100644 index 0000000..a81e4f0 --- /dev/null +++ b/include/libavfilter/colorspacedsp.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2016 Ronald S. Bultje + * + * 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 AVFILTER_COLORSPACEDSP_H +#define AVFILTER_COLORSPACEDSP_H + +#include +#include + +typedef void (*yuv2rgb_fn)(int16_t *rgb[3], ptrdiff_t rgb_stride, + uint8_t *yuv[3], const ptrdiff_t yuv_stride[3], + int w, int h, const int16_t yuv2rgb_coeffs[3][3][8], + const int16_t yuv_offset[8]); +typedef void (*rgb2yuv_fn)(uint8_t *yuv[3], const ptrdiff_t yuv_stride[3], + int16_t *rgb[3], ptrdiff_t rgb_stride, + int w, int h, const int16_t rgb2yuv_coeffs[3][3][8], + const int16_t yuv_offset[8]); +typedef void (*rgb2yuv_fsb_fn)(uint8_t *yuv[3], const ptrdiff_t yuv_stride[3], + int16_t *rgb[3], ptrdiff_t rgb_stride, + int w, int h, const int16_t rgb2yuv_coeffs[3][3][8], + const int16_t yuv_offset[8], + int *rnd[3][2]); +typedef void (*yuv2yuv_fn)(uint8_t *yuv_out[3], const ptrdiff_t yuv_out_stride[3], + uint8_t *yuv_in[3], const ptrdiff_t yuv_in_stride[3], + int w, int h, const int16_t yuv2yuv_coeffs[3][3][8], + const int16_t yuv_offset[2][8]); + +enum BitDepthIndex { + BPP_8, + BPP_10, + BPP_12, + NB_BPP, +}; + +enum ChromaSubsamplingIndex { + SS_444, + SS_422, + SS_420, + NB_SS, +}; + +typedef struct ColorSpaceDSPContext { + /* Convert input YUV pixel buffer from a user into an internal, 15bpp array + * of intermediate RGB data. */ + yuv2rgb_fn yuv2rgb[NB_BPP][NB_SS]; + /* Convert intermediate RGB data (15bpp, internal format) into YUV data and + * store into user-provided output buffer */ + rgb2yuv_fn rgb2yuv[NB_BPP][NB_SS]; + /* Same as rgb2yuv(), but use floyd-steinberg dithering */ + rgb2yuv_fsb_fn rgb2yuv_fsb[NB_BPP][NB_SS]; + /* Direct yuv-to-yuv conversion (input and output are both user-provided + * buffers) */ + yuv2yuv_fn yuv2yuv[NB_BPP /* in */][NB_BPP /* out */][NB_SS]; + + /* In-place 3x3 matrix multiplication. Input and output are both 15bpp + * (our internal data format) */ + void (*multiply3x3)(int16_t *data[3], ptrdiff_t stride, + int w, int h, const int16_t m[3][3][8]); +} ColorSpaceDSPContext; + +void ff_colorspacedsp_init(ColorSpaceDSPContext *dsp); + +/* internal */ +void ff_colorspacedsp_x86_init(ColorSpaceDSPContext *dsp); + +#endif /* AVFILTER_COLORSPACEDSP_H */ diff --git a/include/libavfilter/convolution.h b/include/libavfilter/convolution.h new file mode 100644 index 0000000..1196c1f --- /dev/null +++ b/include/libavfilter/convolution.h @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2012-2013 Oka Motofumi (chikuzen.mo at gmail dot com) + * Copyright (c) 2015 Paul B Mahol + * + * 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 AVFILTER_CONVOLUTION_H +#define AVFILTER_CONVOLUTION_H +#include "avfilter.h" +#include "libavutil/intreadwrite.h" + +enum MatrixMode { + MATRIX_SQUARE, + MATRIX_ROW, + MATRIX_COLUMN, + MATRIX_NBMODES, +}; + +typedef struct ConvolutionContext { + const AVClass *class; + + char *matrix_str[4]; + float user_rdiv[4]; + float bias[4]; + int mode[4]; + float scale; + float delta; + int planes; + + float rdiv[4]; + int size[4]; + int depth; + int max; + int bpc; + int nb_planes; + int nb_threads; + int planewidth[4]; + int planeheight[4]; + int matrix[4][49]; + int matrix_length[4]; + int copy[4]; + + void (*setup[4])(int radius, const uint8_t *c[], const uint8_t *src, int stride, + int x, int width, int y, int height, int bpc); + void (*filter[4])(uint8_t *dst, int width, + float rdiv, float bias, const int *const matrix, + const uint8_t *c[], int peak, int radius, + int dstride, int stride, int size); +} ConvolutionContext; + +void ff_convolution_init_x86(ConvolutionContext *s); +void ff_sobel_init_x86(ConvolutionContext *s, int depth, int nb_planes); + +static void setup_3x3(int radius, const uint8_t *c[], const uint8_t *src, int stride, + int x, int w, int y, int h, int bpc) +{ + int i; + + for (i = 0; i < 9; i++) { + int xoff = FFABS(x + ((i % 3) - 1)); + int yoff = FFABS(y + (i / 3) - 1); + + xoff = xoff >= w ? 2 * w - 1 - xoff : xoff; + yoff = yoff >= h ? 2 * h - 1 - yoff : yoff; + + c[i] = src + xoff * bpc + yoff * stride; + } +} + +static void filter_sobel(uint8_t *dst, int width, + float scale, float delta, const int *const matrix, + const uint8_t *c[], int peak, int radius, + int dstride, int stride, int size) +{ + const uint8_t *c0 = c[0], *c1 = c[1], *c2 = c[2]; + const uint8_t *c3 = c[3], *c5 = c[5]; + const uint8_t *c6 = c[6], *c7 = c[7], *c8 = c[8]; + int x; + + for (x = 0; x < width; x++) { + float suma = c0[x] * -1 + c1[x] * -2 + c2[x] * -1 + + c6[x] * 1 + c7[x] * 2 + c8[x] * 1; + float sumb = c0[x] * -1 + c2[x] * 1 + c3[x] * -2 + + c5[x] * 2 + c6[x] * -1 + c8[x] * 1; + + dst[x] = av_clip_uint8(sqrtf(suma*suma + sumb*sumb) * scale + delta); + } +} + +static void filter16_sobel(uint8_t *dstp, int width, + float scale, float delta, const int *const matrix, + const uint8_t *c[], int peak, int radius, + int dstride, int stride, int size) +{ + uint16_t *dst = (uint16_t *)dstp; + int x; + + for (x = 0; x < width; x++) { + float suma = AV_RN16A(&c[0][2 * x]) * -1 + AV_RN16A(&c[1][2 * x]) * -2 + AV_RN16A(&c[2][2 * x]) * -1 + + AV_RN16A(&c[6][2 * x]) * 1 + AV_RN16A(&c[7][2 * x]) * 2 + AV_RN16A(&c[8][2 * x]) * 1; + float sumb = AV_RN16A(&c[0][2 * x]) * -1 + AV_RN16A(&c[2][2 * x]) * 1 + AV_RN16A(&c[3][2 * x]) * -2 + + AV_RN16A(&c[5][2 * x]) * 2 + AV_RN16A(&c[6][2 * x]) * -1 + AV_RN16A(&c[8][2 * x]) * 1; + + dst[x] = av_clip(sqrtf(suma*suma + sumb*sumb) * scale + delta, 0, peak); + } +} + +static inline void ff_sobel_init(ConvolutionContext *s, int depth, int nb_planes) +{ + for (int i = 0; i < 4; i++) { + s->filter[i] = filter_sobel; + s->copy[i] = !((1 << i) & s->planes); + s->size[i] = 3; + s->setup[i] = setup_3x3; + s->rdiv[i] = s->scale; + s->bias[i] = s->delta; + } + if (s->depth > 8) + for (int i = 0; i < 4; i++) + s->filter[i] = filter16_sobel; +#if ARCH_X86_64 + ff_sobel_init_x86(s, depth, nb_planes); +#endif +} +#endif diff --git a/include/libavfilter/dnn_filter_common.h b/include/libavfilter/dnn_filter_common.h new file mode 100644 index 0000000..42a4719 --- /dev/null +++ b/include/libavfilter/dnn_filter_common.h @@ -0,0 +1,66 @@ +/* + * 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 + */ + +/** + * @file + * common functions for the dnn based filters + */ + +#ifndef AVFILTER_DNN_FILTER_COMMON_H +#define AVFILTER_DNN_FILTER_COMMON_H + +#include "dnn_interface.h" + +#define DNN_FILTER_CHILD_CLASS_ITERATE(name, backend_mask) \ + static const AVClass *name##_child_class_iterate(void **iter) \ + { \ + return ff_dnn_child_class_iterate_with_mask(iter, (backend_mask)); \ + } + +#define AVFILTER_DNN_DEFINE_CLASS_EXT(name, desc, options) \ + static const AVClass name##_class = { \ + .class_name = desc, \ + .item_name = av_default_item_name, \ + .option = options, \ + .version = LIBAVUTIL_VERSION_INT, \ + .category = AV_CLASS_CATEGORY_FILTER, \ + .child_next = ff_dnn_filter_child_next, \ + .child_class_iterate = name##_child_class_iterate, \ + } + +#define AVFILTER_DNN_DEFINE_CLASS(fname, backend_mask) \ + DNN_FILTER_CHILD_CLASS_ITERATE(fname, backend_mask) \ + AVFILTER_DNN_DEFINE_CLASS_EXT(fname, #fname, fname##_options) + +void *ff_dnn_filter_child_next(void *obj, void *prev); + +int ff_dnn_filter_init_child_class(AVFilterContext *filter); + +int ff_dnn_init(DnnContext *ctx, DNNFunctionType func_type, AVFilterContext *filter_ctx); +int ff_dnn_set_frame_proc(DnnContext *ctx, FramePrePostProc pre_proc, FramePrePostProc post_proc); +int ff_dnn_set_detect_post_proc(DnnContext *ctx, DetectPostProc post_proc); +int ff_dnn_set_classify_post_proc(DnnContext *ctx, ClassifyPostProc post_proc); +int ff_dnn_get_input(DnnContext *ctx, DNNData *input); +int ff_dnn_get_output(DnnContext *ctx, int input_width, int input_height, int *output_width, int *output_height); +int ff_dnn_execute_model(DnnContext *ctx, AVFrame *in_frame, AVFrame *out_frame); +int ff_dnn_execute_model_classification(DnnContext *ctx, AVFrame *in_frame, AVFrame *out_frame, const char *target); +DNNAsyncStatusType ff_dnn_get_result(DnnContext *ctx, AVFrame **in_frame, AVFrame **out_frame); +int ff_dnn_flush(DnnContext *ctx); +void ff_dnn_uninit(DnnContext *ctx); + +#endif diff --git a/include/libavfilter/dnn_interface.h b/include/libavfilter/dnn_interface.h new file mode 100644 index 0000000..6608640 --- /dev/null +++ b/include/libavfilter/dnn_interface.h @@ -0,0 +1,212 @@ +/* + * Copyright (c) 2018 Sergey Lavrushkin + * + * 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 + */ + +/** + * @file + * DNN inference engine interface. + */ + +#ifndef AVFILTER_DNN_INTERFACE_H +#define AVFILTER_DNN_INTERFACE_H + +#include +#include "libavutil/frame.h" +#include "avfilter.h" + +#define DNN_GENERIC_ERROR FFERRTAG('D','N','N','!') + +typedef enum { + DNN_TF = 1, + DNN_OV = 1 << 1, + DNN_TH = 1 << 2 +} DNNBackendType; + +typedef enum {DNN_FLOAT = 1, DNN_UINT8 = 4} DNNDataType; + +typedef enum { + DCO_NONE, + DCO_BGR, + DCO_RGB, +} DNNColorOrder; + +typedef enum { + DAST_FAIL, // something wrong + DAST_EMPTY_QUEUE, // no more inference result to get + DAST_NOT_READY, // all queued inferences are not finished + DAST_SUCCESS // got a result frame successfully +} DNNAsyncStatusType; + +typedef enum { + DFT_NONE, + DFT_PROCESS_FRAME, // process the whole frame + DFT_ANALYTICS_DETECT, // detect from the whole frame + DFT_ANALYTICS_CLASSIFY, // classify for each bounding box +}DNNFunctionType; + +typedef enum { + DL_NONE, + DL_NCHW, + DL_NHWC, +} DNNLayout; + +typedef struct DNNData{ + void *data; + int dims[4]; + // dt and order together decide the color format + DNNDataType dt; + DNNColorOrder order; + DNNLayout layout; + float scale; + float mean; +} DNNData; + +typedef struct DNNExecBaseParams { + const char *input_name; + const char **output_names; + uint32_t nb_output; + AVFrame *in_frame; + AVFrame *out_frame; +} DNNExecBaseParams; + +typedef struct DNNExecClassificationParams { + DNNExecBaseParams base; + const char *target; +} DNNExecClassificationParams; + +typedef int (*FramePrePostProc)(AVFrame *frame, DNNData *model, AVFilterContext *filter_ctx); +typedef int (*DetectPostProc)(AVFrame *frame, DNNData *output, uint32_t nb, AVFilterContext *filter_ctx); +typedef int (*ClassifyPostProc)(AVFrame *frame, DNNData *output, uint32_t bbox_index, AVFilterContext *filter_ctx); + +typedef struct DNNModel{ + // Stores FilterContext used for the interaction between AVFrame and DNNData + AVFilterContext *filter_ctx; + // Stores function type of the model + DNNFunctionType func_type; + // Gets model input information + // Just reuse struct DNNData here, actually the DNNData.data field is not needed. + int (*get_input)(struct DNNModel *model, DNNData *input, const char *input_name); + // Gets model output width/height with given input w/h + int (*get_output)(struct DNNModel *model, const char *input_name, int input_width, int input_height, + const char *output_name, int *output_width, int *output_height); + // set the pre process to transfer data from AVFrame to DNNData + // the default implementation within DNN is used if it is not provided by the filter + FramePrePostProc frame_pre_proc; + // set the post process to transfer data from DNNData to AVFrame + // the default implementation within DNN is used if it is not provided by the filter + FramePrePostProc frame_post_proc; + // set the post process to interpret detect result from DNNData + DetectPostProc detect_post_proc; + // set the post process to interpret classify result from DNNData + ClassifyPostProc classify_post_proc; +} DNNModel; + +typedef struct TFOptions{ + const AVClass *clazz; + + char *sess_config; +} TFOptions; + +typedef struct OVOptions { + const AVClass *clazz; + + int batch_size; + int input_resizable; + DNNLayout layout; + float scale; + float mean; +} OVOptions; + +typedef struct THOptions { + const AVClass *clazz; + int optimize; +} THOptions; + +typedef struct DNNModule DNNModule; + +typedef struct DnnContext { + const AVClass *clazz; + + DNNModel *model; + + char *model_filename; + DNNBackendType backend_type; + char *model_inputname; + char *model_outputnames_string; + char *backend_options; + int async; + + char **model_outputnames; + uint32_t nb_outputs; + const DNNModule *dnn_module; + + int nireq; + char *device; + +#if CONFIG_LIBTENSORFLOW + TFOptions tf_option; +#endif + +#if CONFIG_LIBOPENVINO + OVOptions ov_option; +#endif +#if CONFIG_LIBTORCH + THOptions torch_option; +#endif +} DnnContext; + +// Stores pointers to functions for loading, executing, freeing DNN models for one of the backends. +struct DNNModule { + const AVClass clazz; + DNNBackendType type; + // Loads model and parameters from given file. Returns NULL if it is not possible. + DNNModel *(*load_model)(DnnContext *ctx, DNNFunctionType func_type, AVFilterContext *filter_ctx); + // Executes model with specified input and output. Returns the error code otherwise. + int (*execute_model)(const DNNModel *model, DNNExecBaseParams *exec_params); + // Retrieve inference result. + DNNAsyncStatusType (*get_result)(const DNNModel *model, AVFrame **in, AVFrame **out); + // Flush all the pending tasks. + int (*flush)(const DNNModel *model); + // Frees memory allocated for model. + void (*free_model)(DNNModel **model); +}; + +// Initializes DNNModule depending on chosen backend. +const DNNModule *ff_get_dnn_module(DNNBackendType backend_type, void *log_ctx); + +void ff_dnn_init_child_class(DnnContext *ctx); +void *ff_dnn_child_next(DnnContext *obj, void *prev); +const AVClass *ff_dnn_child_class_iterate_with_mask(void **iter, uint32_t backend_mask); + +static inline int dnn_get_width_idx_by_layout(DNNLayout layout) +{ + return layout == DL_NHWC ? 2 : 3; +} + +static inline int dnn_get_height_idx_by_layout(DNNLayout layout) +{ + return layout == DL_NHWC ? 1 : 2; +} + +static inline int dnn_get_channel_idx_by_layout(DNNLayout layout) +{ + return layout == DL_NHWC ? 3 : 1; +} + +#endif diff --git a/include/libavfilter/drawutils.h b/include/libavfilter/drawutils.h new file mode 100644 index 0000000..90df551 --- /dev/null +++ b/include/libavfilter/drawutils.h @@ -0,0 +1,166 @@ +/* + * 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 AVFILTER_DRAWUTILS_H +#define AVFILTER_DRAWUTILS_H + +/** + * @file + * misc drawing utilities + */ + +#include +#include "avfilter.h" +#include "libavutil/pixfmt.h" + +int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt); + +#define MAX_PLANES 4 + +typedef struct FFDrawContext { + const struct AVPixFmtDescriptor *desc; + enum AVPixelFormat format; + unsigned nb_planes; + int pixelstep[MAX_PLANES]; /*< offset between pixels */ + uint8_t hsub[MAX_PLANES]; /*< horizontal subsampling */ + uint8_t vsub[MAX_PLANES]; /*< vertical subsampling */ + uint8_t hsub_max; + uint8_t vsub_max; + enum AVColorRange range; + unsigned flags; + enum AVColorSpace csp; + double rgb2yuv[3][3]; +} FFDrawContext; + +typedef struct FFDrawColor { + uint8_t rgba[4]; + union { + uint32_t u32[4]; + uint16_t u16[8]; + uint8_t u8[16]; + } comp[MAX_PLANES]; +} FFDrawColor; + +/** + * Process alpha pixel component. + */ +#define FF_DRAW_PROCESS_ALPHA 1 + +/** + * Init a draw context. + * + * Only a limited number of pixel formats are supported, if format is not + * supported the function will return an error. + * @param format pixel format of the frames that will be drawn onto + * @param csp color space of the frames that will be drawn onto, + * defaulting to BT601 or RGB depending on the specified format + * when AVCOL_SPC_UNSPECIFIED is passed. + * @param range sample value range of the frames that will be drawn onto, + * defaulting to TV-range unless using a legacy J format + * when AVCOL_RANGE_UNSPECIFIED is passed. + * @param flags combination of FF_DRAW_* flags. + * @return 0 for success, < 0 for error + */ +int ff_draw_init2(FFDrawContext *draw, enum AVPixelFormat format, enum AVColorSpace csp, + enum AVColorRange range, unsigned flags); + +/* + * Legacy wrapper for ff_draw_init2. + */ +int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags); + + + +/** + * Prepare a color. The rgba value passed is always 8-bit full-range in the RGB space + * corresponding to the space set at initialization. + */ +void ff_draw_color(FFDrawContext *draw, FFDrawColor *color, const uint8_t rgba[4]); + +/** + * Copy a rectangle from an image to another. + * + * The coordinates must be as even as the subsampling requires. + */ +void ff_copy_rectangle2(FFDrawContext *draw, + uint8_t *dst[], int dst_linesize[], + uint8_t *src[], int src_linesize[], + int dst_x, int dst_y, int src_x, int src_y, + int w, int h); + +/** + * Fill a rectangle with an uniform color. + * + * The coordinates must be as even as the subsampling requires. + * The color needs to be inited with ff_draw_color. + */ +void ff_fill_rectangle(FFDrawContext *draw, FFDrawColor *color, + uint8_t *dst[], int dst_linesize[], + int dst_x, int dst_y, int w, int h); + +/** + * Blend a rectangle with an uniform color. + */ +void ff_blend_rectangle(FFDrawContext *draw, FFDrawColor *color, + uint8_t *dst[], int dst_linesize[], + int dst_w, int dst_h, + int x0, int y0, int w, int h); + +/** + * Blend an alpha mask with an uniform color. + * + * @param draw draw context + * @param color color for the overlay; + * @param dst destination image + * @param dst_linesize line stride of the destination + * @param dst_w width of the destination image + * @param dst_h height of the destination image + * @param mask mask + * @param mask_linesize line stride of the mask + * @param mask_w width of the mask + * @param mask_h height of the mask + * @param l2depth log2 of depth of the mask (0 for 1bpp, 3 for 8bpp) + * @param endianness bit order of the mask (0: MSB to the left) + * @param x0 horizontal position of the overlay + * @param y0 vertical position of the overlay + */ +void ff_blend_mask(FFDrawContext *draw, FFDrawColor *color, + uint8_t *dst[], int dst_linesize[], int dst_w, int dst_h, + const uint8_t *mask, int mask_linesize, int mask_w, int mask_h, + int l2depth, unsigned endianness, int x0, int y0); + +/** + * Round a dimension according to subsampling. + * + * @param draw draw context + * @param sub_dir 0 for horizontal, 1 for vertical + * @param round_dir 0 nearest, -1 round down, +1 round up + * @param value value to round + * @return the rounded value + */ +int ff_draw_round_to_sub(FFDrawContext *draw, int sub_dir, int round_dir, + int value); + +/** + * Return the list of pixel formats supported by the draw functions. + * + * The flags are the same as ff_draw_init, i.e., none currently. + */ +AVFilterFormats *ff_draw_supported_pixel_formats(unsigned flags); + +#endif /* AVFILTER_DRAWUTILS_H */ diff --git a/include/libavfilter/ebur128.h b/include/libavfilter/ebur128.h new file mode 100644 index 0000000..8e7385e --- /dev/null +++ b/include/libavfilter/ebur128.h @@ -0,0 +1,229 @@ +/* + * Copyright (c) 2011 Jan Kokemüller + * + * 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 + * + * This file is based on libebur128 which is available at + * https://github.com/jiixyj/libebur128/ + * +*/ + +#ifndef AVFILTER_EBUR128_H +#define AVFILTER_EBUR128_H + +/** \file ebur128.h + * \brief libebur128 - a library for loudness measurement according to + * the EBU R128 standard. + */ + +#include /* for size_t */ + +/** \enum channel + * Use these values when setting the channel map with ebur128_set_channel(). + * See definitions in ITU R-REC-BS 1770-4 + */ +enum channel { + FF_EBUR128_UNUSED = 0, /**< unused channel (for example LFE channel) */ + FF_EBUR128_LEFT, + FF_EBUR128_Mp030 = 1, /**< itu M+030 */ + FF_EBUR128_RIGHT, + FF_EBUR128_Mm030 = 2, /**< itu M-030 */ + FF_EBUR128_CENTER, + FF_EBUR128_Mp000 = 3, /**< itu M+000 */ + FF_EBUR128_LEFT_SURROUND, + FF_EBUR128_Mp110 = 4, /**< itu M+110 */ + FF_EBUR128_RIGHT_SURROUND, + FF_EBUR128_Mm110 = 5, /**< itu M-110 */ + FF_EBUR128_DUAL_MONO, /**< a channel that is counted twice */ + FF_EBUR128_MpSC, /**< itu M+SC */ + FF_EBUR128_MmSC, /**< itu M-SC */ + FF_EBUR128_Mp060, /**< itu M+060 */ + FF_EBUR128_Mm060, /**< itu M-060 */ + FF_EBUR128_Mp090, /**< itu M+090 */ + FF_EBUR128_Mm090, /**< itu M-090 */ + FF_EBUR128_Mp135, /**< itu M+135 */ + FF_EBUR128_Mm135, /**< itu M-135 */ + FF_EBUR128_Mp180, /**< itu M+180 */ + FF_EBUR128_Up000, /**< itu U+000 */ + FF_EBUR128_Up030, /**< itu U+030 */ + FF_EBUR128_Um030, /**< itu U-030 */ + FF_EBUR128_Up045, /**< itu U+045 */ + FF_EBUR128_Um045, /**< itu U-030 */ + FF_EBUR128_Up090, /**< itu U+090 */ + FF_EBUR128_Um090, /**< itu U-090 */ + FF_EBUR128_Up110, /**< itu U+110 */ + FF_EBUR128_Um110, /**< itu U-110 */ + FF_EBUR128_Up135, /**< itu U+135 */ + FF_EBUR128_Um135, /**< itu U-135 */ + FF_EBUR128_Up180, /**< itu U+180 */ + FF_EBUR128_Tp000, /**< itu T+000 */ + FF_EBUR128_Bp000, /**< itu B+000 */ + FF_EBUR128_Bp045, /**< itu B+045 */ + FF_EBUR128_Bm045 /**< itu B-045 */ +}; + +/** \enum mode + * Use these values in ebur128_init (or'ed). Try to use the lowest possible + * modes that suit your needs, as performance will be better. + */ +enum mode { + /** can resurrrect and call ff_ebur128_loudness_momentary */ + FF_EBUR128_MODE_M = (1 << 0), + /** can call ff_ebur128_loudness_shortterm */ + FF_EBUR128_MODE_S = (1 << 1) | FF_EBUR128_MODE_M, + /** can call ff_ebur128_loudness_global_* and ff_ebur128_relative_threshold */ + FF_EBUR128_MODE_I = (1 << 2) | FF_EBUR128_MODE_M, + /** can call ff_ebur128_loudness_range */ + FF_EBUR128_MODE_LRA = (1 << 3) | FF_EBUR128_MODE_S, + /** can call ff_ebur128_sample_peak */ + FF_EBUR128_MODE_SAMPLE_PEAK = (1 << 4) | FF_EBUR128_MODE_M, +}; + +/** forward declaration of FFEBUR128StateInternal */ +struct FFEBUR128StateInternal; + +/** \brief Contains information about the state of a loudness measurement. + * + * You should not need to modify this struct directly. + */ +typedef struct FFEBUR128State { + int mode; /**< The current mode. */ + unsigned int channels; /**< The number of channels. */ + unsigned long samplerate; /**< The sample rate. */ + struct FFEBUR128StateInternal *d; /**< Internal state. */ +} FFEBUR128State; + +/** \brief Initialize library state. + * + * @param channels the number of channels. + * @param samplerate the sample rate. + * @param window set the maximum window size in ms, set to 0 for auto. + * @param mode see the mode enum for possible values. + * @return an initialized library state. + */ +FFEBUR128State *ff_ebur128_init(unsigned int channels, + unsigned long samplerate, + unsigned long window, int mode); + +/** \brief Destroy library state. + * + * @param st pointer to a library state. + */ +void ff_ebur128_destroy(FFEBUR128State ** st); + +/** \brief Set channel type. + * + * The default is: + * - 0 -> FF_EBUR128_LEFT + * - 1 -> FF_EBUR128_RIGHT + * - 2 -> FF_EBUR128_CENTER + * - 3 -> FF_EBUR128_UNUSED + * - 4 -> FF_EBUR128_LEFT_SURROUND + * - 5 -> FF_EBUR128_RIGHT_SURROUND + * + * @param st library state. + * @param channel_number zero based channel index. + * @param value channel type from the "channel" enum. + * @return + * - 0 on success. + * - AVERROR(EINVAL) if invalid channel index. + */ +int ff_ebur128_set_channel(FFEBUR128State * st, + unsigned int channel_number, int value); + +/** \brief Add frames to be processed. + * + * @param st library state. + * @param src array of source frames. Channels must be interleaved. + * @param frames number of frames. Not number of samples! + */ +void ff_ebur128_add_frames_double(FFEBUR128State * st, + const double *src, size_t frames); + +/** \brief Get global integrated loudness in LUFS. + * + * @param st library state. + * @param out integrated loudness in LUFS. -HUGE_VAL if result is negative + * infinity. + * @return + * - 0 on success. + * - AVERROR(EINVAL) if mode "FF_EBUR128_MODE_I" has not been set. + */ +int ff_ebur128_loudness_global(FFEBUR128State * st, double *out); + +/** \brief Get short-term loudness (last 3s) in LUFS. + * + * @param st library state. + * @param out short-term loudness in LUFS. -HUGE_VAL if result is negative + * infinity. + * @return + * - 0 on success. + * - AVERROR(EINVAL) if mode "FF_EBUR128_MODE_S" has not been set. + */ +int ff_ebur128_loudness_shortterm(FFEBUR128State * st, double *out); + +/** \brief Get loudness range (LRA) of programme in LU. + * + * Calculates loudness range according to EBU 3342. + * + * @param st library state. + * @param out loudness range (LRA) in LU. Will not be changed in case of + * error. AVERROR(EINVAL) will be returned in this case. + * @return + * - 0 on success. + * - AVERROR(EINVAL) if mode "FF_EBUR128_MODE_LRA" has not been set. + */ +int ff_ebur128_loudness_range(FFEBUR128State * st, double *out); +/** \brief Get loudness range (LRA) in LU across multiple instances. + * + * Calculates loudness range according to EBU 3342. + * + * @param sts array of library states. + * @param size length of sts + * @param out loudness range (LRA) in LU. Will not be changed in case of + * error. AVERROR(EINVAL) will be returned in this case. + * @return + * - 0 on success. + * - AVERROR(EINVAL) if mode "FF_EBUR128_MODE_LRA" has not been set. + */ +int ff_ebur128_loudness_range_multiple(FFEBUR128State ** sts, + size_t size, double *out); + +/** \brief Get maximum sample peak of selected channel in float format. + * + * @param st library state + * @param channel_number channel to analyse + * @param out maximum sample peak in float format (1.0 is 0 dBFS) + * @return + * - 0 on success. + * - AVERROR(EINVAL) if mode "FF_EBUR128_MODE_SAMPLE_PEAK" has not been set. + * - AVERROR(EINVAL) if invalid channel index. + */ +int ff_ebur128_sample_peak(FFEBUR128State * st, + unsigned int channel_number, double *out); + +/** \brief Get relative threshold in LUFS. + * + * @param st library state + * @param out relative threshold in LUFS. + * @return + * - 0 on success. + * - AVERROR(EINVAL) if mode "FF_EBUR128_MODE_I" has not been set. + */ +int ff_ebur128_relative_threshold(FFEBUR128State * st, double *out); + +#endif /* AVFILTER_EBUR128_H */ diff --git a/include/libavfilter/edge_common.h b/include/libavfilter/edge_common.h new file mode 100644 index 0000000..cff4feb --- /dev/null +++ b/include/libavfilter/edge_common.h @@ -0,0 +1,115 @@ +/* + * 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 + */ + +/** + * @file + * common functions for edge detection + */ + +#ifndef AVFILTER_EDGE_COMMON_H +#define AVFILTER_EDGE_COMMON_H + +#include "avfilter.h" + +/** + * @brief Rounded directions used in av_image_sobel() + */ +enum AVRoundedDirection { + DIRECTION_45UP, + DIRECTION_45DOWN, + DIRECTION_HORIZONTAL, + DIRECTION_VERTICAL, +}; + +/** + * Simple sobel operator to get rounded gradients + * + * @param w the width of the image in pixels + * @param h the height of the image in pixels + * @param dst data pointers to magnitude image + * @param dst_linesize linesizes for the magnitude image + * @param dir data pointers to direction image + * @param dir_linesize linesizes for the direction image + * @param src data pointers to source image + * @param src_linesize linesizes for the source image + */ +#define PROTO_SOBEL(depth) \ +void ff_sobel_##depth(int w, int h, \ + uint16_t *dst, int dst_linesize, \ + int8_t *dir, int dir_linesize, \ + const uint8_t *src, int src_linesize, int src_stride); + +PROTO_SOBEL(8) +PROTO_SOBEL(16) + +/** + * Filters rounded gradients to drop all non-maxima pixels in the magnitude image + * Expects gradients generated by av_image_sobel() + * Expects zero's in the destination buffer dst + * + * @param w the width of the image in pixels + * @param h the height of the image in pixels + * @param dst data pointers to magnitude image + * @param dst_linesize linesizes for the magnitude image + * @param dir data pointers to direction image + * @param dir_linesize linesizes for the direction image + * @param src data pointers to source image + * @param src_linesize linesizes for the source image + */ +void ff_non_maximum_suppression(int w, int h, + uint8_t *dst, int dst_linesize, + const int8_t *dir, int dir_linesize, + const uint16_t *src, int src_linesize); + +/** + * Filters all pixels in src to keep all pixels > high, + * and keep all pixels > low where all surrounding pixels > high + * + * @param low the low threshold value + * @param high the hegh threshold value + * @param w the width of the image in pixels + * @param h the height of the image in pixels + * @param dst data pointers to destination image + * @param dst_linesize linesizes for the destination image + * @param src data pointers to source image + * @param src_linesize linesizes for the source image + */ +void ff_double_threshold(int low, int high, int w, int h, + uint8_t *dst, int dst_linesize, + const uint8_t *src, int src_linesize); + +/** + * Applies gaussian blur. + * 5x5 kernels, sigma = 1.4 + * + * @param w the width of the image in pixels + * @param h the height of the image in pixels + * @param dst data pointers to destination image + * @param dst_linesize linesizes for the destination image + * @param src data pointers to source image + * @param src_linesize linesizes for the source image + */ +#define PROTO_GAUSSIAN_BLUR(depth) \ +void ff_gaussian_blur_##depth(int w, int h, \ + uint8_t *dst, int dst_linesize, \ + const uint8_t *src, int src_linesize, int src_stride); + +PROTO_GAUSSIAN_BLUR(8) +PROTO_GAUSSIAN_BLUR(16) + +#endif diff --git a/include/libavfilter/fflcms2.h b/include/libavfilter/fflcms2.h new file mode 100644 index 0000000..1ac29e3 --- /dev/null +++ b/include/libavfilter/fflcms2.h @@ -0,0 +1,24 @@ +/* + * 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 AVFILTER_FFLCMS2_H +#define AVFILTER_FFLCMS2_H + +#include "libavcodec/fflcms2.h" + +#endif /* AVFILTER_FFLCMS2_H */ diff --git a/include/libavfilter/filters.h b/include/libavfilter/filters.h new file mode 100644 index 0000000..fdc7a95 --- /dev/null +++ b/include/libavfilter/filters.h @@ -0,0 +1,606 @@ +/* + * Filters implementation helper functions + * + * 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 AVFILTER_FILTERS_H +#define AVFILTER_FILTERS_H + +/** + * Filters implementation helper functions + */ + +#include "avfilter.h" + +/** + * Special return code when activate() did not do anything. + */ +#define FFERROR_NOT_READY FFERRTAG('N','R','D','Y') + +/** + * A filter pad used for either input or output. + */ +struct AVFilterPad { + /** + * Pad name. The name is unique among inputs and among outputs, but an + * input may have the same name as an output. This may be NULL if this + * pad has no need to ever be referenced by name. + */ + const char *name; + + /** + * AVFilterPad type. + */ + enum AVMediaType type; + + /** + * The filter expects writable frames from its input link, + * duplicating data buffers if needed. + * + * input pads only. + */ +#define AVFILTERPAD_FLAG_NEEDS_WRITABLE (1 << 0) + + /** + * The pad's name is allocated and should be freed generically. + */ +#define AVFILTERPAD_FLAG_FREE_NAME (1 << 1) + + /** + * A combination of AVFILTERPAD_FLAG_* flags. + */ + int flags; + + /** + * Callback functions to get a video/audio buffers. If NULL, + * the filter system will use ff_default_get_video_buffer() for video + * and ff_default_get_audio_buffer() for audio. + * + * The state of the union is determined by type. + * + * Input pads only. + */ + union { + AVFrame *(*video)(AVFilterLink *link, int w, int h); + AVFrame *(*audio)(AVFilterLink *link, int nb_samples); + } get_buffer; + + /** + * Filtering callback. This is where a filter receives a frame with + * audio/video data and should do its processing. + * + * Input pads only. + * + * @return >= 0 on success, a negative AVERROR on error. This function + * must ensure that frame is properly unreferenced on error if it + * hasn't been passed on to another filter. + */ + int (*filter_frame)(AVFilterLink *link, AVFrame *frame); + + /** + * Frame request callback. A call to this should result in some progress + * towards producing output over the given link. This should return zero + * on success, and another value on error. + * + * Output pads only. + */ + int (*request_frame)(AVFilterLink *link); + + /** + * Link configuration callback. + * + * For output pads, this should set the link properties such as + * width/height. This should NOT set the format property - that is + * negotiated between filters by the filter system using the + * query_formats() callback before this function is called. + * + * For input pads, this should check the properties of the link, and update + * the filter's internal state as necessary. + * + * For both input and output filters, this should return zero on success, + * and another value on error. + */ + int (*config_props)(AVFilterLink *link); +}; + +/** + * Link properties exposed to filter code, but not external callers. + * + * Cf. AVFilterLink for public properties, FilterLinkInternal for + * properties private to the generic layer. + */ +typedef struct FilterLink { + AVFilterLink pub; + + /** + * Graph the filter belongs to. + */ + struct AVFilterGraph *graph; + + /** + * Current timestamp of the link, as defined by the most recent + * frame(s), in link time_base units. + */ + int64_t current_pts; + + /** + * Current timestamp of the link, as defined by the most recent + * frame(s), in AV_TIME_BASE units. + */ + int64_t current_pts_us; + + /** + * Minimum number of samples to filter at once. + * + * May be set by the link destination filter in its config_props(). + * If 0, all related fields are ignored. + */ + int min_samples; + + /** + * Maximum number of samples to filter at once. If filter_frame() is + * called with more samples, it will split them. + * + * May be set by the link destination filter in its config_props(). + */ + int max_samples; + + /** + * Number of past frames sent through the link. + */ + int64_t frame_count_in, frame_count_out; + + /** + * Number of past samples sent through the link. + */ + int64_t sample_count_in, sample_count_out; + + /** + * Frame rate of the stream on the link, or 1/0 if unknown or variable. + * + * May be set by the link source filter in its config_props(); if left to + * 0/0, will be automatically copied from the first input of the source + * filter if it exists. + * + * Sources should set it to the best estimation of the real frame rate. + * If the source frame rate is unknown or variable, set this to 1/0. + * Filters should update it if necessary depending on their function. + * Sinks can use it to set a default output frame rate. + * It is similar to the r_frame_rate field in AVStream. + */ + AVRational frame_rate; + + /** + * For hwaccel pixel formats, this should be a reference to the + * AVHWFramesContext describing the frames. + * + * May be set by the link source filter in its config_props(). + */ + AVBufferRef *hw_frames_ctx; +} FilterLink; + +static inline FilterLink* ff_filter_link(AVFilterLink *link) +{ + return (FilterLink*)link; +} + +/** + * The filter is aware of hardware frames, and any hardware frame context + * should not be automatically propagated through it. + */ +#define FF_FILTER_FLAG_HWFRAME_AWARE (1 << 0) + +/** + * Find the index of a link. + * + * I.e. find i such that link == ctx->(in|out)puts[i] + */ +#define FF_INLINK_IDX(link) ((int)((link)->dstpad - (link)->dst->input_pads)) +#define FF_OUTLINK_IDX(link) ((int)((link)->srcpad - (link)->src->output_pads)) + +enum FilterFormatsState { + /** + * The default value meaning that this filter supports all formats + * and (for audio) sample rates and channel layouts/counts as long + * as these properties agree for all inputs and outputs. + * This state is only allowed in case all inputs and outputs actually + * have the same type. + * The union is unused in this state. + * + * This value must always be zero (for default static initialization). + */ + FF_FILTER_FORMATS_PASSTHROUGH = 0, + FF_FILTER_FORMATS_QUERY_FUNC, ///< formats.query active. + FF_FILTER_FORMATS_QUERY_FUNC2, ///< formats.query_func2 active. + FF_FILTER_FORMATS_PIXFMT_LIST, ///< formats.pixels_list active. + FF_FILTER_FORMATS_SAMPLEFMTS_LIST, ///< formats.samples_list active. + FF_FILTER_FORMATS_SINGLE_PIXFMT, ///< formats.pix_fmt active + FF_FILTER_FORMATS_SINGLE_SAMPLEFMT, ///< formats.sample_fmt active. +}; + +#define FILTER_QUERY_FUNC(func) \ + .formats.query_func = func, \ + .formats_state = FF_FILTER_FORMATS_QUERY_FUNC +#define FILTER_QUERY_FUNC2(func) \ + .formats.query_func2 = func, \ + .formats_state = FF_FILTER_FORMATS_QUERY_FUNC2 +#define FILTER_PIXFMTS_ARRAY(array) \ + .formats.pixels_list = array, \ + .formats_state = FF_FILTER_FORMATS_PIXFMT_LIST +#define FILTER_SAMPLEFMTS_ARRAY(array) \ + .formats.samples_list = array, \ + .formats_state = FF_FILTER_FORMATS_SAMPLEFMTS_LIST +#define FILTER_PIXFMTS(...) \ + FILTER_PIXFMTS_ARRAY(((const enum AVPixelFormat []) { __VA_ARGS__, AV_PIX_FMT_NONE })) +#define FILTER_SAMPLEFMTS(...) \ + FILTER_SAMPLEFMTS_ARRAY(((const enum AVSampleFormat[]) { __VA_ARGS__, AV_SAMPLE_FMT_NONE })) +#define FILTER_SINGLE_PIXFMT(pix_fmt_) \ + .formats.pix_fmt = pix_fmt_, \ + .formats_state = FF_FILTER_FORMATS_SINGLE_PIXFMT +#define FILTER_SINGLE_SAMPLEFMT(sample_fmt_) \ + .formats.sample_fmt = sample_fmt_, \ + .formats_state = FF_FILTER_FORMATS_SINGLE_SAMPLEFMT + +#define FILTER_INOUTPADS(inout, array) \ + .inout = array, \ + .nb_ ## inout = FF_ARRAY_ELEMS(array) +#define FILTER_INPUTS(array) FILTER_INOUTPADS(inputs, (array)) +#define FILTER_OUTPUTS(array) FILTER_INOUTPADS(outputs, (array)) + +#define AVFILTER_DEFINE_CLASS_EXT(name, desc, options) \ + static const AVClass name##_class = { \ + .class_name = desc, \ + .item_name = av_default_item_name, \ + .option = options, \ + .version = LIBAVUTIL_VERSION_INT, \ + .category = AV_CLASS_CATEGORY_FILTER, \ + } +#define AVFILTER_DEFINE_CLASS(fname) \ + AVFILTER_DEFINE_CLASS_EXT(fname, #fname, fname##_options) + +#define D2TS(d) (isnan(d) ? AV_NOPTS_VALUE : (int64_t)(d)) +#define TS2D(ts) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts)) +#define TS2T(ts, tb) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts) * av_q2d(tb)) + +/** + * Mark a filter ready and schedule it for activation. + * + * This is automatically done when something happens to the filter (queued + * frame, status change, request on output). + * Filters implementing the activate callback can call it directly to + * perform one more round of processing later. + * It is also useful for filters reacting to external or asynchronous + * events. + */ +void ff_filter_set_ready(AVFilterContext *filter, unsigned priority); + +/** + * Get the number of frames available on the link. + * @return the number of frames available in the link fifo. + */ +size_t ff_inlink_queued_frames(AVFilterLink *link); + +/** + * Test if a frame is available on the link. + * @return >0 if a frame is available + */ +int ff_inlink_check_available_frame(AVFilterLink *link); + + +/*** + * Get the number of samples available on the link. + * @return the numer of samples available on the link. + */ +int ff_inlink_queued_samples(AVFilterLink *link); + +/** + * Test if enough samples are available on the link. + * @return >0 if enough samples are available + * @note on EOF and error, min becomes 1 + */ +int ff_inlink_check_available_samples(AVFilterLink *link, unsigned min); + +/** + * Take a frame from the link's FIFO and update the link's stats. + * + * If ff_inlink_check_available_frame() was previously called, the + * preferred way of expressing it is "av_assert1(ret);" immediately after + * ff_inlink_consume_frame(). Negative error codes must still be checked. + * + * @note May trigger process_command() and/or update is_disabled. + * @return >0 if a frame is available, + * 0 and set rframe to NULL if no frame available, + * or AVERROR code + */ +int ff_inlink_consume_frame(AVFilterLink *link, AVFrame **rframe); + +/** + * Take samples from the link's FIFO and update the link's stats. + * + * If ff_inlink_check_available_samples() was previously called, the + * preferred way of expressing it is "av_assert1(ret);" immediately after + * ff_inlink_consume_samples(). Negative error codes must still be checked. + * + * @note May trigger process_command() and/or update is_disabled. + * @return >0 if a frame is available, + * 0 and set rframe to NULL if no frame available, + * or AVERROR code + */ +int ff_inlink_consume_samples(AVFilterLink *link, unsigned min, unsigned max, + AVFrame **rframe); + +/** + * Access a frame in the link fifo without consuming it. + * The first frame is numbered 0; the designated frame must exist. + * @return the frame at idx position in the link fifo. + */ +AVFrame *ff_inlink_peek_frame(AVFilterLink *link, size_t idx); + +/** + * Make sure a frame is writable. + * This is similar to av_frame_make_writable() except it uses the link's + * buffer allocation callback, and therefore allows direct rendering. + */ +int ff_inlink_make_frame_writable(AVFilterLink *link, AVFrame **rframe); + +/** + * Test and acknowledge the change of status on the link. + * + * Status means EOF or an error condition; a change from the normal (0) + * status to a non-zero status can be queued in a filter's input link, it + * becomes relevant after the frames queued in the link's FIFO are + * processed. This function tests if frames are still queued and if a queued + * status change has not yet been processed. In that case it performs basic + * treatment (updating the link's timestamp) and returns a positive value to + * let the filter do its own treatments (flushing...). + * + * Filters implementing the activate callback should call this function when + * they think it might succeed (usually after checking unsuccessfully for a + * queued frame). + * Filters implementing the filter_frame and request_frame callbacks do not + * need to call that since the same treatment happens in ff_filter_frame(). + * + * @param[out] rstatus new or current status + * @param[out] rpts current timestamp of the link in link time base + * @return >0 if status changed, <0 if status already acked, 0 otherwise + */ +int ff_inlink_acknowledge_status(AVFilterLink *link, int *rstatus, int64_t *rpts); + +/** + * Mark that a frame is wanted on the link. + * Unlike ff_filter_frame(), it must not be called when the link has a + * non-zero status, and thus does not acknowledge it. + * Also it cannot fail. + */ +void ff_inlink_request_frame(AVFilterLink *link); + +/** + * Set the status on an input link. + * Also discard all frames in the link's FIFO. + */ +void ff_inlink_set_status(AVFilterLink *link, int status); + +/** + * Test if a frame is wanted on an output link. + */ +int ff_outlink_frame_wanted(AVFilterLink *link); + +/** + * Get the status on an output link. + */ +int ff_outlink_get_status(AVFilterLink *link); + +/** + * Set the status field of a link from the source filter. + * The pts should reflect the timestamp of the status change, + * in link time base and relative to the frames timeline. + * In particular, for AVERROR_EOF, it should reflect the + * end time of the last frame. + */ +void ff_avfilter_link_set_in_status(AVFilterLink *link, int status, int64_t pts); + +/** + * Set the status field of a link from the source filter. + * The pts should reflect the timestamp of the status change, + * in link time base and relative to the frames timeline. + * In particular, for AVERROR_EOF, it should reflect the + * end time of the last frame. + */ +static inline void ff_outlink_set_status(AVFilterLink *link, int status, int64_t pts) +{ + ff_avfilter_link_set_in_status(link, status, pts); +} + +/** + * Forward the status on an output link to an input link. + * If the status is set, it will discard all queued frames and this macro + * will return immediately. + */ +#define FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink) do { \ + int ret = ff_outlink_get_status(outlink); \ + if (ret) { \ + ff_inlink_set_status(inlink, ret); \ + return 0; \ + } \ +} while (0) + +/** + * Forward the status on an output link to all input links. + * If the status is set, it will discard all queued frames and this macro + * will return immediately. + */ +#define FF_FILTER_FORWARD_STATUS_BACK_ALL(outlink, filter) do { \ + int ret = ff_outlink_get_status(outlink); \ + if (ret) { \ + unsigned i; \ + for (i = 0; i < filter->nb_inputs; i++) \ + ff_inlink_set_status(filter->inputs[i], ret); \ + return 0; \ + } \ +} while (0) + +/** + * Acknowledge the status on an input link and forward it to an output link. + * If the status is set, this macro will return immediately. + */ +#define FF_FILTER_FORWARD_STATUS(inlink, outlink) do { \ + int status; \ + int64_t pts; \ + if (ff_inlink_acknowledge_status(inlink, &status, &pts)) { \ + ff_outlink_set_status(outlink, status, pts); \ + return 0; \ + } \ +} while (0) + +/** + * Acknowledge the status on an input link and forward it to an output link. + * If the status is set, this macro will return immediately. + */ +#define FF_FILTER_FORWARD_STATUS_ALL(inlink, filter) do { \ + int status; \ + int64_t pts; \ + if (ff_inlink_acknowledge_status(inlink, &status, &pts)) { \ + unsigned i; \ + for (i = 0; i < filter->nb_outputs; i++) \ + ff_outlink_set_status(filter->outputs[i], status, pts); \ + return 0; \ + } \ +} while (0) + +/** + * Forward the frame_wanted_out flag from an output link to an input link. + * If the flag is set, this macro will return immediately. + */ +#define FF_FILTER_FORWARD_WANTED(outlink, inlink) do { \ + if (ff_outlink_frame_wanted(outlink)) { \ + ff_inlink_request_frame(inlink); \ + return 0; \ + } \ +} while (0) + +/** + * Check for flow control between input and output. + * This is necessary for filters that may produce several output frames for + * a single input event, otherwise they may produce them all at once, + * causing excessive memory consumption. + */ +int ff_inoutlink_check_flow(AVFilterLink *inlink, AVFilterLink *outlink); + +/** + * Perform any additional setup required for hardware frames. + * + * link->hw_frames_ctx must be set before calling this function. + * Inside link->hw_frames_ctx, the fields format, sw_format, width and + * height must be set. If dynamically allocated pools are not supported, + * then initial_pool_size must also be set, to the minimum hardware frame + * pool size necessary for the filter to work (taking into account any + * frames which need to stored for use in operations as appropriate). If + * default_pool_size is nonzero, then it will be used as the pool size if + * no other modification takes place (this can be used to preserve + * compatibility). + */ +int ff_filter_init_hw_frames(AVFilterContext *avctx, AVFilterLink *link, + int default_pool_size); + +/** + * Generic processing of user supplied commands that are set + * in the same way as the filter options. + * NOTE: 'enable' option is handled separately, and not by + * this function. + */ +int ff_filter_process_command(AVFilterContext *ctx, const char *cmd, + const char *arg, char *res, int res_len, int flags); + +/** + * Get number of threads for current filter instance. + * This number is always same or less than graph->nb_threads. + */ +int ff_filter_get_nb_threads(AVFilterContext *ctx) av_pure; + +/** + * Send a frame of data to the next filter. + * + * @param link the output link over which the data is being sent + * @param frame a reference to the buffer of data being sent. The + * receiving filter will free this reference when it no longer + * needs it or pass it on to the next filter. + * + * @return >= 0 on success, a negative AVERROR on error. The receiving filter + * is responsible for unreferencing frame in case of error. + */ +int ff_filter_frame(AVFilterLink *link, AVFrame *frame); + +/** + * Request an input frame from the filter at the other end of the link. + * + * This function must not be used by filters using the activate callback, + * use ff_link_set_frame_wanted() instead. + * + * The input filter may pass the request on to its inputs, fulfill the + * request from an internal buffer or any other means specific to its function. + * + * When the end of a stream is reached AVERROR_EOF is returned and no further + * frames are returned after that. + * + * When a filter is unable to output a frame for example due to its sources + * being unable to do so or because it depends on external means pushing data + * into it then AVERROR(EAGAIN) is returned. + * It is important that a AVERROR(EAGAIN) return is returned all the way to the + * caller (generally eventually a user application) as this step may (but does + * not have to be) necessary to provide the input with the next frame. + * + * If a request is successful then some progress has been made towards + * providing a frame on the link (through ff_filter_frame()). A filter that + * needs several frames to produce one is allowed to return success if one + * more frame has been processed but no output has been produced yet. A + * filter is also allowed to simply forward a success return value. + * + * @param link the input link + * @return zero on success + * AVERROR_EOF on end of file + * AVERROR(EAGAIN) if the previous filter cannot output a frame + * currently and can neither guarantee that EOF has been reached. + */ +int ff_request_frame(AVFilterLink *link); + +/** + * Append a new input/output pad to the filter's list of such pads. + * + * The *_free_name versions will set the AVFILTERPAD_FLAG_FREE_NAME flag + * ensuring that the name will be freed generically (even on insertion error). + */ +int ff_append_inpad (AVFilterContext *f, AVFilterPad *p); +int ff_append_outpad(AVFilterContext *f, AVFilterPad *p); +int ff_append_inpad_free_name (AVFilterContext *f, AVFilterPad *p); +int ff_append_outpad_free_name(AVFilterContext *f, AVFilterPad *p); + +/** + * Tell if an integer is contained in the provided -1-terminated list of integers. + * This is useful for determining (for instance) if an AVPixelFormat is in an + * array of supported formats. + * + * @param fmt provided format + * @param fmts -1-terminated list of formats + * @return 1 if present, 0 if absent + */ +int ff_fmt_is_in(int fmt, const int *fmts); + +int ff_filter_execute(AVFilterContext *ctx, avfilter_action_func *func, + void *arg, int *ret, int nb_jobs); + +#endif /* AVFILTER_FILTERS_H */ diff --git a/include/libavfilter/formats.h b/include/libavfilter/formats.h new file mode 100644 index 0000000..380e9df --- /dev/null +++ b/include/libavfilter/formats.h @@ -0,0 +1,569 @@ +/* + * 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 AVFILTER_FORMATS_H +#define AVFILTER_FORMATS_H + +#include "avfilter.h" + +/** + * A list of supported formats for one end of a filter link. This is used + * during the format negotiation process to try to pick the best format to + * use to minimize the number of necessary conversions. Each filter gives a + * list of the formats supported by each input and output pad. The list + * given for each pad need not be distinct - they may be references to the + * same list of formats, as is often the case when a filter supports multiple + * formats, but will always output the same format as it is given in input. + * + * In this way, a list of possible input formats and a list of possible + * output formats are associated with each link. When a set of formats is + * negotiated over a link, the input and output lists are merged to form a + * new list containing only the common elements of each list. In the case + * that there were no common elements, a format conversion is necessary. + * Otherwise, the lists are merged, and all other links which reference + * either of the format lists involved in the merge are also affected. + * + * For example, consider the filter chain: + * filter (a) --> (b) filter (b) --> (c) filter + * + * where the letters in parenthesis indicate a list of formats supported on + * the input or output of the link. Suppose the lists are as follows: + * (a) = {A, B} + * (b) = {A, B, C} + * (c) = {B, C} + * + * First, the first link's lists are merged, yielding: + * filter (a) --> (a) filter (a) --> (c) filter + * + * Notice that format list (b) now refers to the same list as filter list (a). + * Next, the lists for the second link are merged, yielding: + * filter (a) --> (a) filter (a) --> (a) filter + * + * where (a) = {B}. + * + * Unfortunately, when the format lists at the two ends of a link are merged, + * we must ensure that all links which reference either pre-merge format list + * get updated as well. Therefore, we have the format list structure store a + * pointer to each of the pointers to itself. + */ +struct AVFilterFormats { + unsigned nb_formats; ///< number of formats + int *formats; ///< list of media formats + + unsigned refcount; ///< number of references to this list + struct AVFilterFormats ***refs; ///< references to this list +}; + +/** + * A list of supported channel layouts. + * + * The list works the same as AVFilterFormats, except for the following + * differences: + * - A list with all_layouts = 1 means all channel layouts with a known + * disposition; nb_channel_layouts must then be 0. + * - A list with all_counts = 1 means all channel counts, with a known or + * unknown disposition; nb_channel_layouts must then be 0 and all_layouts 1. + * - The list must not contain a layout with a known disposition and a + * channel count with unknown disposition with the same number of channels + * (e.g. AV_CH_LAYOUT_STEREO and FF_COUNT2LAYOUT(2). + */ +struct AVFilterChannelLayouts { + AVChannelLayout *channel_layouts; ///< list of channel layouts + int nb_channel_layouts; ///< number of channel layouts + char all_layouts; ///< accept any known channel layout + char all_counts; ///< accept any channel layout or count + + unsigned refcount; ///< number of references to this list + struct AVFilterChannelLayouts ***refs; ///< references to this list +}; + +/** + * Encode a channel count as a channel layout. + * FF_COUNT2LAYOUT(c) means any channel layout with c channels, with a known + * or unknown disposition. + * The result is only valid inside AVFilterChannelLayouts and immediately + * related functions. + */ +#define FF_COUNT2LAYOUT(c) ((AVChannelLayout) { .order = AV_CHANNEL_ORDER_UNSPEC, .nb_channels = c }) + +/** + * Decode a channel count encoded as a channel layout. + * Return 0 if the channel layout was a real one. + */ +#define FF_LAYOUT2COUNT(l) (((l)->order == AV_CHANNEL_ORDER_UNSPEC) ? \ + (l)->nb_channels : 0) + +#define KNOWN(l) (!FF_LAYOUT2COUNT(l)) /* for readability */ + +/** + * Construct an empty AVFilterChannelLayouts/AVFilterFormats struct -- + * representing any channel layout (with known disposition)/sample rate. + */ +av_warn_unused_result +AVFilterChannelLayouts *ff_all_channel_layouts(void); + +av_warn_unused_result +AVFilterFormats *ff_all_samplerates(void); + +/** + * Construct an AVFilterChannelLayouts coding for any channel layout, with + * known or unknown disposition. + */ +av_warn_unused_result +AVFilterChannelLayouts *ff_all_channel_counts(void); + +av_warn_unused_result +AVFilterChannelLayouts *ff_make_channel_layout_list(const AVChannelLayout *fmts); + +/** + * Construct an AVFilterFormats representing all possible color spaces. + * + * Note: This list does not include AVCOL_SPC_RESERVED. + */ +av_warn_unused_result +AVFilterFormats *ff_all_color_spaces(void); + +/** + * Construct an AVFilterFormats representing all possible color ranges. + */ +av_warn_unused_result +AVFilterFormats *ff_all_color_ranges(void); + +/** + * Helpers for query_formats() which set all free audio links to the same list + * of channel layouts/sample rates. If there are no links hooked to this list, + * the list is freed. + */ +av_warn_unused_result +int ff_set_common_channel_layouts(AVFilterContext *ctx, + AVFilterChannelLayouts *layouts); +/** + * Equivalent to ff_set_common_channel_layouts(ctx, ff_make_channel_layout_list(fmts)) + */ +av_warn_unused_result +int ff_set_common_channel_layouts_from_list(AVFilterContext *ctx, + const AVChannelLayout *fmts); +/** + * Equivalent to ff_set_common_channel_layouts(ctx, ff_all_channel_counts()) + */ +av_warn_unused_result +int ff_set_common_all_channel_counts(AVFilterContext *ctx); + +av_warn_unused_result +int ff_set_common_samplerates(AVFilterContext *ctx, + AVFilterFormats *samplerates); +/** + * Equivalent to ff_set_common_samplerates(ctx, ff_make_format_list(samplerates)) + */ +av_warn_unused_result +int ff_set_common_samplerates_from_list(AVFilterContext *ctx, + const int *samplerates); +/** + * Equivalent to ff_set_common_samplerates(ctx, ff_all_samplerates()) + */ +av_warn_unused_result +int ff_set_common_all_samplerates(AVFilterContext *ctx); + +av_warn_unused_result +int ff_set_common_color_spaces(AVFilterContext *ctx, + AVFilterFormats *color_spaces); +/** + * Equivalent to ff_set_common_color_spaces(ctx, ff_make_format_list(color_spaces)) + */ +av_warn_unused_result +int ff_set_common_color_spaces_from_list(AVFilterContext *ctx, + const int *color_spaces); + +/** + * Equivalent to ff_set_common_color_spaces(ctx, ff_all_color_spaces()) + */ +av_warn_unused_result +int ff_set_common_all_color_spaces(AVFilterContext *ctx); + +av_warn_unused_result +int ff_set_common_color_ranges(AVFilterContext *ctx, + AVFilterFormats *color_ranges); +/** + * Equivalent to ff_set_common_color_ranges(ctx, ff_make_format_list(color_ranges)) + */ +av_warn_unused_result +int ff_set_common_color_ranges_from_list(AVFilterContext *ctx, + const int *color_ranges); + +/** + * Equivalent to ff_set_common_color_ranges(ctx, ff_all_color_ranges()) + */ +av_warn_unused_result +int ff_set_common_all_color_ranges(AVFilterContext *ctx); + +/** + * A helper for query_formats() which sets all links to the same list of + * formats. If there are no links hooked to this filter, the list of formats is + * freed. + */ +av_warn_unused_result +int ff_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats); + +/** + * Equivalent to ff_set_common_formats(ctx, ff_make_format_list(fmts)) + */ +av_warn_unused_result +int ff_set_common_formats_from_list(AVFilterContext *ctx, const int *fmts); + +/** + * Helpers for query_formats2() which set all free audio links to the same list + * of channel layouts/sample rates. If there are no links hooked to this list, + * the list is freed. + */ +av_warn_unused_result +int ff_set_common_channel_layouts2(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out, + AVFilterChannelLayouts *channel_layouts); + +av_warn_unused_result +int ff_set_common_channel_layouts_from_list2(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out, + const AVChannelLayout *fmts); +av_warn_unused_result +int ff_set_common_all_channel_counts2(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out); + +av_warn_unused_result +int ff_set_common_samplerates2(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out, + AVFilterFormats *samplerates); + +av_warn_unused_result +int ff_set_common_samplerates_from_list2(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out, + const int *samplerates); + +av_warn_unused_result +int ff_set_common_all_samplerates2(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out); + +av_warn_unused_result +int ff_set_common_color_spaces2(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out, + AVFilterFormats *color_spaces); + +av_warn_unused_result +int ff_set_common_color_spaces_from_list2(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out, + const int *color_ranges); + +av_warn_unused_result +int ff_set_common_all_color_spaces2(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out); + +av_warn_unused_result +int ff_set_common_color_ranges2(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out, + AVFilterFormats *color_ranges); + +av_warn_unused_result +int ff_set_common_color_ranges_from_list2(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out, + const int *color_ranges); + +av_warn_unused_result +int ff_set_common_all_color_ranges2(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out); + +av_warn_unused_result +int ff_set_common_formats2(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out, + AVFilterFormats *formats); + +av_warn_unused_result +int ff_set_common_formats_from_list2(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out, + const int *fmts); + +av_warn_unused_result +int ff_add_channel_layout(AVFilterChannelLayouts **l, + const AVChannelLayout *channel_layout); + +/** + * Add *ref as a new reference to f. + */ +av_warn_unused_result +int ff_channel_layouts_ref(AVFilterChannelLayouts *f, + AVFilterChannelLayouts **ref); + +/** + * Remove a reference to a channel layouts list. + */ +void ff_channel_layouts_unref(AVFilterChannelLayouts **ref); + +void ff_channel_layouts_changeref(AVFilterChannelLayouts **oldref, + AVFilterChannelLayouts **newref); + +/** + * Sets all remaining unset filter lists for all inputs/outputs to their + * corresponding `ff_all_*()` lists. + */ +av_warn_unused_result +int ff_default_query_formats(AVFilterContext *ctx); + +/** + * Create a list of supported formats. This is intended for use in + * AVFilter->query_formats(). + * + * @param fmts list of media formats, terminated by -1 + * @return the format list, with no existing references + */ +av_warn_unused_result +AVFilterFormats *ff_make_format_list(const int *fmts); + +/** + * Equivalent to ff_make_format_list({const int[]}{ fmt, -1 }) + */ +av_warn_unused_result +AVFilterFormats *ff_make_formats_list_singleton(int fmt); + +/** + * Add fmt to the list of media formats contained in *avff. + * If *avff is NULL the function allocates the filter formats struct + * and puts its pointer in *avff. + * + * @return a non negative value in case of success, or a negative + * value corresponding to an AVERROR code in case of error + */ +av_warn_unused_result +int ff_add_format(AVFilterFormats **avff, int64_t fmt); + +/** + * Return a list of all formats supported by FFmpeg for the given media type. + */ +av_warn_unused_result +AVFilterFormats *ff_all_formats(enum AVMediaType type); + +/** + * Construct a formats list containing all pixel formats with certain + * properties + */ +av_warn_unused_result +AVFilterFormats *ff_formats_pixdesc_filter(unsigned want, unsigned rej); + +//* format is software, non-planar with sub-sampling +#define FF_PIX_FMT_FLAG_SW_FLAT_SUB (1 << 24) + +/** + * Construct a formats list containing all planar sample formats. + */ +av_warn_unused_result +AVFilterFormats *ff_planar_sample_fmts(void); + +/** + * Add *ref as a new reference to formats. + * That is the pointers will point like in the ascii art below: + * ________ + * |formats |<--------. + * | ____ | ____|___________________ + * | |refs| | | __|_ + * | |* * | | | | | | AVFilterLink + * | |* *--------->|*ref| + * | |____| | | |____| + * |________| |________________________ + */ +av_warn_unused_result +int ff_formats_ref(AVFilterFormats *formats, AVFilterFormats **ref); + +/** + * If *ref is non-NULL, remove *ref as a reference to the format list + * it currently points to, deallocates that list if this was the last + * reference, and sets *ref to NULL. + * + * Before After + * ________ ________ NULL + * |formats |<--------. |formats | ^ + * | ____ | ____|________________ | ____ | ____|________________ + * | |refs| | | __|_ | |refs| | | __|_ + * | |* * | | | | | | AVFilterLink | |* * | | | | | | AVFilterLink + * | |* *--------->|*ref| | |* | | | |*ref| + * | |____| | | |____| | |____| | | |____| + * |________| |_____________________ |________| |_____________________ + */ +void ff_formats_unref(AVFilterFormats **ref); + +/** + * Before After + * ________ ________ + * |formats |<---------. |formats |<---------. + * | ____ | ___|___ | ____ | ___|___ + * | |refs| | | | | | |refs| | | | | NULL + * | |* *--------->|*oldref| | |* *--------->|*newref| ^ + * | |* * | | |_______| | |* * | | |_______| ___|___ + * | |____| | | |____| | | | | + * |________| |________| |*oldref| + * |_______| + */ +void ff_formats_changeref(AVFilterFormats **oldref, AVFilterFormats **newref); + +/** + * Check that fmts is a valid pixel formats list. + * + * In particular, check for duplicates. + */ +int ff_formats_check_pixel_formats(void *log, const AVFilterFormats *fmts); + +/** + * Check that fmts is a valid sample formats list. + * + * In particular, check for duplicates. + */ +int ff_formats_check_sample_formats(void *log, const AVFilterFormats *fmts); + +/** + * Check that fmts is a valid sample rates list. + * + * In particular, check for duplicates. + */ +int ff_formats_check_sample_rates(void *log, const AVFilterFormats *fmts); + +/** + * Check that fmts is a valid channel layouts list. + * + * In particular, check for duplicates. + */ +int ff_formats_check_channel_layouts(void *log, const AVFilterChannelLayouts *fmts); + +/** + * Check that fmts is a valid formats list for YUV colorspace metadata. + * + * In particular, check for duplicates. + */ +int ff_formats_check_color_spaces(void *log, const AVFilterFormats *fmts); +int ff_formats_check_color_ranges(void *log, const AVFilterFormats *fmts); + +typedef struct AVFilterFormatMerger { + unsigned offset; + int (*merge)(void *a, void *b); + int (*can_merge)(const void *a, const void *b); +} AVFilterFormatsMerger; + +/** + * Callbacks and properties to describe the steps of a format negotiation. + * + * The steps are: + * + * 1. query_formats(): call the callbacks on all filter to set lists of + * supported formats. + * When links on a filter must eventually have the same + * format, the lists of supported formats are the same + * object in memory. + * See: + * http://www.normalesup.org/~george/articles/format_negotiation_in_libavfilter/#12 + * + * + * 2. query_formats(): merge lists of supported formats or insert automatic + * conversion filters. + * Compute the intersection of the lists of supported + * formats on the ends of links. If it succeeds, replace + * both objects with the intersection everywhere they + * are referenced. + * If the intersection is empty, insert an automatic + * conversion filter. + * If several formats are negotiated at once (format, + * rate, layout), only merge if all three can be, since + * the conversion filter can convert all three at once. + * This process goes on as long as progress is made. + * See: + * http://www.normalesup.org/~george/articles/format_negotiation_in_libavfilter/#14 + * http://www.normalesup.org/~george/articles/format_negotiation_in_libavfilter/#29 + * + * 3. reduce_formats(): try to reduce format conversion within filters. + * For each link where there is only one supported + * formats on output, for each output of the connected + * filter, if the media type is the same and said + * format is supported, keep only this one. + * This process goes on as long as progress is made. + * Rationale: conversion filters will set a large list + * of supported formats on outputs but users will + * expect the output to be as close as possible as the + * input (examples: scale without changing the pixel + * format, resample without changint the layout). + * FIXME: this can probably be done by merging the + * input and output lists instead of re-implementing + * the logic. + * + * 4. swap_sample_fmts(): + * swap_samplerates(): + * swap_channel_layouts(): For each filter with an input with only one + * supported format, when outputs have several + * supported formats, put the best one with + * reference to the input at the beginning of the + * list, to prepare it for being picked up by + * pick_formats(). + * The best format is the one that is most + * similar to the input while not losing too much + * information. + * This process need to run only once. + * FIXME: reduce_formats() operates on all inputs + * with a single format, swap_*() operates on the + * first one only: check if the difference makes + * sense. + * TODO: the swapping done for one filter can + * override the swapping done for another filter + * connected to the same list of formats, maybe + * it would be better to compute a total score + * for all connected filters and use the score to + * pick the format instead of just swapping. + * TODO: make the similarity logic available as + * public functions in libavutil. + * + * 5. pick_formats(): Choose one format from the lists of supported formats, + * use it for the link and reduce the list to a single + * element to force other filters connected to the same + * list to use it. + * First process all links where there is a single format + * and the output links of all filters with an input, + * trying to preserve similarity between input and + * outputs. + * Repeat as long as process is made. + * Then do a final run for the remaining filters. + * FIXME: the similarity logic (the ref argument to + * pick_format()) added in FFmpeg duplicates and + * overrides the swapping logic added in libav. Better + * merge them into a score system. + */ +typedef struct AVFilterNegotiation { + unsigned nb_mergers; + const AVFilterFormatsMerger *mergers; + const char *conversion_filter; + unsigned conversion_opts_offset; +} AVFilterNegotiation; + +const AVFilterNegotiation *ff_filter_get_negotiation(AVFilterLink *link); + +#endif /* AVFILTER_FORMATS_H */ diff --git a/include/libavfilter/framepool.h b/include/libavfilter/framepool.h new file mode 100644 index 0000000..daab88e --- /dev/null +++ b/include/libavfilter/framepool.h @@ -0,0 +1,119 @@ +/* + * This file is part of FFmpeg. + * + * Copyright (c) 2015 Matthieu Bouron + * + * 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 AVFILTER_FRAMEPOOL_H +#define AVFILTER_FRAMEPOOL_H + +#include "libavutil/buffer.h" +#include "libavutil/frame.h" +#include "libavutil/internal.h" + +/** + * Frame pool. This structure is opaque and not meant to be accessed + * directly. It is allocated with ff_frame_pool_init() and freed with + * ff_frame_pool_uninit(). + */ +typedef struct FFFramePool FFFramePool; + +/** + * Allocate and initialize a video frame pool. + * + * @param alloc a function that will be used to allocate new frame buffers when + * the pool is empty. May be NULL, then the default allocator will be used + * (av_buffer_alloc()). + * @param width width of each frame in this pool + * @param height height of each frame in this pool + * @param format format of each frame in this pool + * @param align buffers alignement of each frame in this pool + * @return newly created video frame pool on success, NULL on error. + */ +FFFramePool *ff_frame_pool_video_init(AVBufferRef* (*alloc)(size_t size), + int width, + int height, + enum AVPixelFormat format, + int align); + +/** + * Allocate and initialize an audio frame pool. + * + * @param alloc a function that will be used to allocate new frame buffers when + * the pool is empty. May be NULL, then the default allocator will be used + * (av_buffer_alloc()). + * @param channels channels of each frame in this pool + * @param nb_samples number of samples of each frame in this pool + * @param format format of each frame in this pool + * @param align buffers alignement of each frame in this pool + * @return newly created audio frame pool on success, NULL on error. + */ +FFFramePool *ff_frame_pool_audio_init(AVBufferRef* (*alloc)(size_t size), + int channels, + int samples, + enum AVSampleFormat format, + int align); + +/** + * Deallocate the frame pool. It is safe to call this function while + * some of the allocated frame are still in use. + * + * @param pool pointer to the frame pool to be freed. It will be set to NULL. + */ +void ff_frame_pool_uninit(FFFramePool **pool); + +/** + * Get the video frame pool configuration. + * + * @param width width of each frame in this pool + * @param height height of each frame in this pool + * @param format format of each frame in this pool + * @param align buffers alignement of each frame in this pool + * @return 0 on success, a negative AVERROR otherwise. + */ +int ff_frame_pool_get_video_config(FFFramePool *pool, + int *width, + int *height, + enum AVPixelFormat *format, + int *align); + +/** + * Get the audio frame pool configuration. + * + * @param channels channels of each frame in this pool + * @param nb_samples number of samples of each frame in this pool + * @param format format of each frame in this pool + * @param align buffers alignement of each frame in this pool + * @return 0 on success, a negative AVERROR otherwise. + */ +int ff_frame_pool_get_audio_config(FFFramePool *pool, + int *channels, + int *nb_samples, + enum AVSampleFormat *format, + int *align); + + +/** + * Allocate a new AVFrame, reussing old buffers from the pool when available. + * This function may be called simultaneously from multiple threads. + * + * @return a new AVFrame on success, NULL on error. + */ +AVFrame *ff_frame_pool_get(FFFramePool *pool); + + +#endif /* AVFILTER_FRAMEPOOL_H */ diff --git a/include/libavfilter/framequeue.h b/include/libavfilter/framequeue.h new file mode 100644 index 0000000..c49d872 --- /dev/null +++ b/include/libavfilter/framequeue.h @@ -0,0 +1,178 @@ +/* + * Generic frame queue + * Copyright (c) 2016 Nicolas George + * + * 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 AVFILTER_FRAMEQUEUE_H +#define AVFILTER_FRAMEQUEUE_H + +/** + * FFFrameQueue: simple AVFrame queue API + * + * Note: this API is not thread-safe. Concurrent access to the same queue + * must be protected by a mutex or any synchronization mechanism. + */ + +#include "libavutil/frame.h" + +typedef struct FFFrameBucket { + AVFrame *frame; +} FFFrameBucket; + +/** + * Structure to hold global options and statistics for frame queues. + * + * This structure is intended to allow implementing global control of the + * frame queues, including memory consumption caps. + * + * It is currently empty. + */ +typedef struct FFFrameQueueGlobal { + char dummy; /* C does not allow empty structs */ +} FFFrameQueueGlobal; + +/** + * Queue of AVFrame pointers. + */ +typedef struct FFFrameQueue { + + /** + * Array of allocated buckets, used as a circular buffer. + */ + FFFrameBucket *queue; + + /** + * Size of the array of buckets. + */ + size_t allocated; + + /** + * Tail of the queue. + * It is the index in the array of the next frame to take. + */ + size_t tail; + + /** + * Number of currently queued frames. + */ + size_t queued; + + /** + * Pre-allocated bucket for queues of size 1. + */ + FFFrameBucket first_bucket; + + /** + * Total number of frames entered in the queue. + */ + uint64_t total_frames_head; + + /** + * Total number of frames dequeued from the queue. + * queued = total_frames_head - total_frames_tail + */ + uint64_t total_frames_tail; + + /** + * Total number of samples entered in the queue. + */ + uint64_t total_samples_head; + + /** + * Total number of samples dequeued from the queue. + * queued_samples = total_samples_head - total_samples_tail + */ + uint64_t total_samples_tail; + + /** + * Indicate that samples are skipped + */ + int samples_skipped; + +} FFFrameQueue; + +/** + * Init a global structure. + */ +void ff_framequeue_global_init(FFFrameQueueGlobal *fqg); + +/** + * Init a frame queue and attach it to a global structure. + */ +void ff_framequeue_init(FFFrameQueue *fq, FFFrameQueueGlobal *fqg); + +/** + * Free the queue and all queued frames. + */ +void ff_framequeue_free(FFFrameQueue *fq); + +/** + * Add a frame. + * @return >=0 or an AVERROR code. + */ +int ff_framequeue_add(FFFrameQueue *fq, AVFrame *frame); + +/** + * Take the first frame in the queue. + * Must not be used with empty queues. + */ +AVFrame *ff_framequeue_take(FFFrameQueue *fq); + +/** + * Access a frame in the queue, without removing it. + * The first frame is numbered 0; the designated frame must exist. + */ +AVFrame *ff_framequeue_peek(FFFrameQueue *fq, size_t idx); + +/** + * Get the number of queued frames. + */ +static inline size_t ff_framequeue_queued_frames(const FFFrameQueue *fq) +{ + return fq->queued; +} + +/** + * Get the number of queued samples. + */ +static inline uint64_t ff_framequeue_queued_samples(const FFFrameQueue *fq) +{ + return fq->total_samples_head - fq->total_samples_tail; +} + +/** + * Update the statistics after a frame accessed using ff_framequeue_peek() + * was modified. + * Currently used only as a marker. + */ +static inline void ff_framequeue_update_peeked(FFFrameQueue *fq, size_t idx) +{ +} + +/** + * Skip samples from the first frame in the queue. + * + * This function must be used when the first frame was accessed using + * ff_framequeue_peek() and samples were consumed from it. + * It adapts the data pointers and timestamps of the head frame to account + * for the skipped samples. + */ +void ff_framequeue_skip_samples(FFFrameQueue *fq, size_t samples, AVRational time_base); + +#endif /* AVFILTER_FRAMEQUEUE_H */ diff --git a/include/libavfilter/framerate.h b/include/libavfilter/framerate.h new file mode 100644 index 0000000..d255635 --- /dev/null +++ b/include/libavfilter/framerate.h @@ -0,0 +1,74 @@ +/* + * 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 AVFILTER_FRAMERATE_H +#define AVFILTER_FRAMERATE_H + +#include "scene_sad.h" +#include "avfilter.h" + +#define BLEND_FUNC_PARAMS const uint8_t *src1, ptrdiff_t src1_linesize, \ + const uint8_t *src2, ptrdiff_t src2_linesize, \ + uint8_t *dst, ptrdiff_t dst_linesize, \ + ptrdiff_t width, ptrdiff_t height, \ + int factor1, int factor2, int half + +#define BLEND_FACTOR_DEPTH(n) (n-1) + +typedef void (*blend_func)(BLEND_FUNC_PARAMS); + +typedef struct FrameRateContext { + const AVClass *class; + // parameters + AVRational dest_frame_rate; ///< output frames per second + int flags; ///< flags affecting frame rate conversion algorithm + double scene_score; ///< score that denotes a scene change has happened + int interp_start; ///< start of range to apply linear interpolation + int interp_end; ///< end of range to apply linear interpolation + + int line_size[4]; ///< bytes of pixel data per line for each plane + int height[4]; ///< height of each plane + int vsub; + + AVRational srce_time_base; ///< timebase of source + AVRational dest_time_base; ///< timebase of destination + + ff_scene_sad_fn sad; ///< Sum of the absolute difference function (scene detect only) + double prev_mafd; ///< previous MAFD (scene detect only) + + int blend_factor_max; + int bitdepth; + AVFrame *work; + + AVFrame *f0; ///< last frame + AVFrame *f1; ///< current frame + int64_t pts0; ///< last frame pts in dest_time_base + int64_t pts1; ///< current frame pts in dest_time_base + int64_t delta; ///< pts1 to pts0 delta + double score; ///< scene change score (f0 to f1) + int flush; ///< 1 if the filter is being flushed + int64_t start_pts; ///< pts of the first output frame + int64_t n; ///< output frame counter + + blend_func blend; +} FrameRateContext; + +void ff_framerate_init(FrameRateContext *s); +void ff_framerate_init_x86(FrameRateContext *s); + +#endif /* AVFILTER_FRAMERATE_H */ diff --git a/include/libavfilter/framesync.h b/include/libavfilter/framesync.h new file mode 100644 index 0000000..130d067 --- /dev/null +++ b/include/libavfilter/framesync.h @@ -0,0 +1,355 @@ +/* + * Copyright (c) 2013 Nicolas George + * + * 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 AVFILTER_FRAMESYNC_H +#define AVFILTER_FRAMESYNC_H + +#include "bufferqueue.h" + +enum EOFAction { + EOF_ACTION_REPEAT, + EOF_ACTION_ENDALL, + EOF_ACTION_PASS +}; + +/* + * TODO + * Export convenient options. + */ + +/** + * This API is intended as a helper for filters that have several video + * input and need to combine them somehow. If the inputs have different or + * variable frame rate, getting the input frames to match requires a rather + * complex logic and a few user-tunable options. + * + * In this API, when a set of synchronized input frames is ready to be + * procesed is called a frame event. Frame event can be generated in + * response to input frames on any or all inputs and the handling of + * situations where some stream extend beyond the beginning or the end of + * others can be configured. + * + * The basic working of this API is the following: set the on_event + * callback, then call ff_framesync_activate() from the filter's activate + * callback. + */ + +/** + * Stream extrapolation mode + * + * Describe how the frames of a stream are extrapolated before the first one + * and after EOF to keep sync with possibly longer other streams. + */ +enum FFFrameSyncExtMode { + + /** + * Completely stop all streams with this one. + */ + EXT_STOP, + + /** + * Ignore this stream and continue processing the other ones. + */ + EXT_NULL, + + /** + * Extend the frame to infinity. + */ + EXT_INFINITY, +}; + +/** + * Timestamp syncronization mode + * + * Describe how the frames of a stream are syncronized based on timestamp + * distance. + */ +enum FFFrameTSSyncMode { + + /** + * Sync to frames from secondary input with the nearest, lower or equal + * timestamp to the frame event one. + */ + TS_DEFAULT, + + /** + * Sync to frames from secondary input with the absolute nearest timestamp + * to the frame event one. + */ + TS_NEAREST, +}; + +/** + * Input stream structure + */ +typedef struct FFFrameSyncIn { + + /** + * Extrapolation mode for timestamps before the first frame + */ + enum FFFrameSyncExtMode before; + + /** + * Extrapolation mode for timestamps after the last frame + */ + enum FFFrameSyncExtMode after; + + /** + * Time base for the incoming frames + */ + AVRational time_base; + + /** + * Current frame, may be NULL before the first one or after EOF + */ + AVFrame *frame; + + /** + * Next frame, for internal use + */ + AVFrame *frame_next; + + /** + * PTS of the current frame + */ + int64_t pts; + + /** + * PTS of the next frame, for internal use + */ + int64_t pts_next; + + /** + * Boolean flagging the next frame, for internal use + */ + uint8_t have_next; + + /** + * State: before first, in stream or after EOF, for internal use + */ + uint8_t state; + + /** + * Synchronization level: frames on input at the highest sync level will + * generate output frame events. + * + * For example, if inputs #0 and #1 have sync level 2 and input #2 has + * sync level 1, then a frame on either input #0 or #1 will generate a + * frame event, but not a frame on input #2 until both inputs #0 and #1 + * have reached EOF. + * + * If sync is 0, no frame event will be generated. + */ + unsigned sync; + + enum FFFrameTSSyncMode ts_mode; +} FFFrameSyncIn; + +/** + * Frame sync structure. + */ +typedef struct FFFrameSync { + const AVClass *class; + + /** + * Parent filter context. + */ + AVFilterContext *parent; + + /** + * Number of input streams + */ + unsigned nb_in; + + /** + * Time base for the output events + */ + AVRational time_base; + + /** + * Timestamp of the current event + */ + int64_t pts; + + /** + * Callback called when a frame event is ready + */ + int (*on_event)(struct FFFrameSync *fs); + + /** + * Opaque pointer, not used by the API + */ + void *opaque; + + /** + * Index of the input that requires a request + */ + unsigned in_request; + + /** + * Synchronization level: only inputs with the same sync level are sync + * sources. + */ + unsigned sync_level; + + /** + * Flag indicating that a frame event is ready + */ + uint8_t frame_ready; + + /** + * Flag indicating that output has reached EOF. + */ + uint8_t eof; + + /** + * Pointer to array of inputs. + */ + FFFrameSyncIn *in; + + int opt_repeatlast; + int opt_shortest; + int opt_eof_action; + int opt_ts_sync_mode; + +} FFFrameSync; + +/** + * Pre-initialize a frame sync structure. + * + * It sets the class pointer and inits the options to their default values. + * The entire structure is expected to be already set to 0. + * This step is optional, but necessary to use the options. + */ +void ff_framesync_preinit(FFFrameSync *fs); + +/** + * Initialize a frame sync structure. + * + * The entire structure is expected to be already set to 0 or preinited. + * + * @param fs frame sync structure to initialize + * @param parent parent AVFilterContext object + * @param nb_in number of inputs + * @return >= 0 for success or a negative error code + */ +int ff_framesync_init(FFFrameSync *fs, AVFilterContext *parent, unsigned nb_in); + +/** + * Configure a frame sync structure. + * + * Must be called after all options are set but before all use. + * + * @return >= 0 for success or a negative error code + */ +int ff_framesync_configure(FFFrameSync *fs); + +/** + * Free all memory currently allocated. + */ +void ff_framesync_uninit(FFFrameSync *fs); + +/** + * Get the current frame in an input. + * + * @param fs frame sync structure + * @param in index of the input + * @param rframe used to return the current frame (or NULL) + * @param get if not zero, the calling code needs to get ownership of + * the returned frame; the current frame will either be + * duplicated or removed from the framesync structure + */ +int ff_framesync_get_frame(FFFrameSync *fs, unsigned in, AVFrame **rframe, + unsigned get); + +/** + * Examine the frames in the filter's input and try to produce output. + * + * This function can be the complete implementation of the activate + * method of a filter using framesync. + */ +int ff_framesync_activate(FFFrameSync *fs); + +/** + * Initialize a frame sync structure for dualinput. + * + * Compared to generic framesync, dualinput assumes the first input is the + * main one and the filtering is performed on it. The first input will be + * the only one with sync set and generic timeline support will just pass it + * unchanged when disabled. + * + * Equivalent to ff_framesync_init(fs, parent, 2) then setting the time + * base, sync and ext modes on the inputs. + */ +int ff_framesync_init_dualinput(FFFrameSync *fs, AVFilterContext *parent); + +/** + * @param f0 used to return the main frame + * @param f1 used to return the second frame, or NULL if disabled + * @return >=0 for success or AVERROR code + * @note The frame returned in f0 belongs to the caller (get = 1 in + * ff_framesync_get_frame()) while the frame returned in f1 is still owned + * by the framesync structure. + */ +int ff_framesync_dualinput_get(FFFrameSync *fs, AVFrame **f0, AVFrame **f1); + +/** + * Same as ff_framesync_dualinput_get(), but make sure that f0 is writable. + */ +int ff_framesync_dualinput_get_writable(FFFrameSync *fs, AVFrame **f0, AVFrame **f1); + +const AVClass *ff_framesync_child_class_iterate(void **iter); +extern const AVClass ff_framesync_class; + +#define FRAMESYNC_DEFINE_PURE_CLASS(name, desc, func_prefix, options) \ +static const AVClass name##_class = { \ + .class_name = desc, \ + .item_name = av_default_item_name, \ + .option = options, \ + .version = LIBAVUTIL_VERSION_INT, \ + .category = AV_CLASS_CATEGORY_FILTER, \ + .child_class_iterate = ff_framesync_child_class_iterate, \ + .child_next = func_prefix##_child_next, \ +} + +/* A filter that uses the *_child_next-function from this macro + * is required to initialize the FFFrameSync structure in AVFilter.preinit + * via the *_framesync_preinit function defined alongside it. */ +#define FRAMESYNC_AUXILIARY_FUNCS(func_prefix, context, field) \ +static int func_prefix##_framesync_preinit(AVFilterContext *ctx) \ +{ \ + context *s = ctx->priv; \ + ff_framesync_preinit(&s->field); \ + return 0; \ +} \ +static void *func_prefix##_child_next(void *obj, void *prev) \ +{ \ + context *s = obj; \ + return prev ? NULL : &s->field; \ +} + +#define FRAMESYNC_DEFINE_CLASS_EXT(name, context, field, options) \ +FRAMESYNC_AUXILIARY_FUNCS(name, context, field) \ +FRAMESYNC_DEFINE_PURE_CLASS(name, #name, name, options) + +#define FRAMESYNC_DEFINE_CLASS(name, context, field) \ +FRAMESYNC_DEFINE_CLASS_EXT(name, context, field, name##_options) + +#endif /* AVFILTER_FRAMESYNC_H */ diff --git a/include/libavfilter/gblur.h b/include/libavfilter/gblur.h new file mode 100644 index 0000000..83f43c2 --- /dev/null +++ b/include/libavfilter/gblur.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2011 Pascal Getreuer + * Copyright (c) 2016 Paul B Mahol + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef AVFILTER_GBLUR_H +#define AVFILTER_GBLUR_H +#include "avfilter.h" + +typedef struct GBlurContext { + const AVClass *class; + + float sigma; + float sigmaV; + int steps; + int planes; + + int flt; + int depth; + int stride; + int planewidth[4]; + int planeheight[4]; + float *buffer; + float *localbuf; ///< temporary buffer for horiz_slice. NULL if not used + float boundaryscale; + float boundaryscaleV; + float postscale; + float postscaleV; + float nu; + float nuV; + int nb_planes; + void (*horiz_slice)(float *buffer, int width, int height, int steps, float nu, float bscale, float *localbuf); + void (*verti_slice)(float *buffer, int width, int height, int slice_start, int slice_end, int steps, + float nu, float bscale); + void (*postscale_slice)(float *buffer, int length, float postscale, float min, float max); +} GBlurContext; + +void ff_gblur_init_x86(GBlurContext *s); +#endif diff --git a/include/libavfilter/generate_wave_table.h b/include/libavfilter/generate_wave_table.h new file mode 100644 index 0000000..5fe297e --- /dev/null +++ b/include/libavfilter/generate_wave_table.h @@ -0,0 +1,35 @@ +/* + * 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 AVFILTER_GENERATE_WAVE_TABLE_H +#define AVFILTER_GENERATE_WAVE_TABLE_H + +#include "libavutil/samplefmt.h" + +enum WaveType { + WAVE_SIN, + WAVE_TRI, + WAVE_NB, +}; + +void ff_generate_wave_table(enum WaveType wave_type, + enum AVSampleFormat sample_fmt, + void *table, int table_size, + double min, double max, double phase); + +#endif /* AVFILTER_GENERATE_WAVE_TABLE_H */ diff --git a/include/libavfilter/gradfun.h b/include/libavfilter/gradfun.h new file mode 100644 index 0000000..eb1f1eb --- /dev/null +++ b/include/libavfilter/gradfun.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2010 Nolan Lum + * Copyright (c) 2009 Loren Merritt + * + * 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 AVFILTER_GRADFUN_H +#define AVFILTER_GRADFUN_H + +#include "avfilter.h" + +/// Holds instance-specific information for gradfun. +typedef struct GradFunContext { + const AVClass *class; + float strength; + int thresh; ///< threshold for gradient algorithm + int radius; ///< blur radius + int chroma_w; ///< width of the chroma planes + int chroma_h; ///< weight of the chroma planes + int chroma_r; ///< blur radius for the chroma planes + uint16_t *buf; ///< holds image data for blur algorithm passed into filter. + /// DSP functions. + void (*filter_line) (uint8_t *dst, const uint8_t *src, const uint16_t *dc, int width, int thresh, const uint16_t *dithers); + void (*blur_line) (uint16_t *dc, uint16_t *buf, const uint16_t *buf1, const uint8_t *src, int src_linesize, int width); +} GradFunContext; + +void ff_gradfun_init_x86(GradFunContext *gf); + +void ff_gradfun_filter_line_c(uint8_t *dst, const uint8_t *src, const uint16_t *dc, int width, int thresh, const uint16_t *dithers); +void ff_gradfun_blur_line_c(uint16_t *dc, uint16_t *buf, const uint16_t *buf1, const uint8_t *src, int src_linesize, int width); + +#endif /* AVFILTER_GRADFUN_H */ diff --git a/include/libavfilter/hermite.h b/include/libavfilter/hermite.h new file mode 100644 index 0000000..fc1c0c6 --- /dev/null +++ b/include/libavfilter/hermite.h @@ -0,0 +1,45 @@ +/* + * 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 AVFILTER_HERMITE_H +#define AVFILTER_HERMITE_H + +static inline double hermite_interpolation(double x, double x0, double x1, + double p0, double p1, + double m0, double m1) +{ + double width = x1 - x0; + double t = (x - x0) / width; + double t2, t3; + double ct0, ct1, ct2, ct3; + + m0 *= width; + m1 *= width; + + t2 = t*t; + t3 = t2*t; + ct0 = p0; + ct1 = m0; + + ct2 = -3 * p0 - 2 * m0 + 3 * p1 - m1; + ct3 = 2 * p0 + m0 - 2 * p1 + m1; + + return ct3 * t3 + ct2 * t2 + ct1 * t + ct0; +} + +#endif /* AVFILTER_HERMITE_H */ diff --git a/include/libavfilter/hflip.h b/include/libavfilter/hflip.h new file mode 100644 index 0000000..0d8b102 --- /dev/null +++ b/include/libavfilter/hflip.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2007 Benoit Fouet + * Copyright (c) 2010 Stefano Sabatini + * + * 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 AVFILTER_HFLIP_H +#define AVFILTER_HFLIP_H + +#include + +typedef struct FlipContext { + int max_step[4]; ///< max pixel step for each plane, expressed as a number of bytes + int bayer_plus1; ///< 1 .. not a Bayer input format, 2 .. Bayer input format + int planewidth[4]; ///< width of each plane + int planeheight[4]; ///< height of each plane + + void (*flip_line[4])(const uint8_t *src, uint8_t *dst, int w); +} FlipContext; + +void ff_hflip_init_x86(FlipContext *s, int step[4], int nb_planes); + +#endif /* AVFILTER_HFLIP_H */ diff --git a/include/libavfilter/lavfutils.h b/include/libavfilter/lavfutils.h new file mode 100644 index 0000000..96738ce --- /dev/null +++ b/include/libavfilter/lavfutils.h @@ -0,0 +1,44 @@ +/* + * 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 + */ + +/** + * @file + * Miscellaneous utilities which make use of the libavformat library + */ + +#ifndef AVFILTER_LAVFUTILS_H +#define AVFILTER_LAVFUTILS_H + +#include +#include "libavutil/pixfmt.h" + +/** + * Load image from filename and put the resulting image in data. + * + * @param w pointer to the width of the loaded image + * @param h pointer to the height of the loaded image + * @param pix_fmt pointer to the pixel format of the loaded image + * @param filename the name of the image file to load + * @param log_ctx log context + * @return >= 0 in case of success, a negative error code otherwise. + */ +int ff_load_image(uint8_t *data[4], int linesize[4], + int *w, int *h, enum AVPixelFormat *pix_fmt, + const char *filename, void *log_ctx); + +#endif /* AVFILTER_LAVFUTILS_H */ diff --git a/include/libavfilter/limiter.h b/include/libavfilter/limiter.h new file mode 100644 index 0000000..54d423d --- /dev/null +++ b/include/libavfilter/limiter.h @@ -0,0 +1,33 @@ +/* + * 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 AVFILTER_LIMITER_H +#define AVFILTER_LIMITER_H + +#include +#include + +typedef struct LimiterDSPContext { + void (*limiter)(const uint8_t *src, uint8_t *dst, + ptrdiff_t slinesize, ptrdiff_t dlinesize, + int w, int h, int min, int max); +} LimiterDSPContext; + +void ff_limiter_init_x86(LimiterDSPContext *dsp, int bpp); + +#endif /* AVFILTER_LIMITER_H */ diff --git a/include/libavfilter/lswsutils.h b/include/libavfilter/lswsutils.h new file mode 100644 index 0000000..f5f5320 --- /dev/null +++ b/include/libavfilter/lswsutils.h @@ -0,0 +1,38 @@ +/* + * 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 + */ + +/** + * @file + * Miscellaneous utilities which make use of the libswscale library + */ + +#ifndef AVFILTER_LSWSUTILS_H +#define AVFILTER_LSWSUTILS_H + +#include "libswscale/swscale.h" + +/** + * Scale image using libswscale. + */ +int ff_scale_image(uint8_t *dst_data[4], int dst_linesize[4], + int dst_w, int dst_h, enum AVPixelFormat dst_pix_fmt, + uint8_t *const src_data[4], int src_linesize[4], + int src_w, int src_h, enum AVPixelFormat src_pix_fmt, + void *log_ctx); + +#endif /* AVFILTER_LSWSUTILS_H */ diff --git a/include/libavfilter/lut3d.h b/include/libavfilter/lut3d.h new file mode 100644 index 0000000..14e3c7f --- /dev/null +++ b/include/libavfilter/lut3d.h @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2013 Clément Bœsch + * Copyright (c) 2018 Paul B Mahol + * + * 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 AVFILTER_LUT3D_H +#define AVFILTER_LUT3D_H + +#include "config_components.h" + +#include "libavutil/pixdesc.h" +#include "framesync.h" +#include "avfilter.h" + +enum interp_mode { + INTERPOLATE_NEAREST, + INTERPOLATE_TRILINEAR, + INTERPOLATE_TETRAHEDRAL, + INTERPOLATE_PYRAMID, + INTERPOLATE_PRISM, + NB_INTERP_MODE +}; + +struct rgbvec { + float r, g, b; +}; + +/* 3D LUT don't often go up to level 32, but it is common to have a Hald CLUT + * of 512x512 (64x64x64) */ +#define MAX_LEVEL 256 +#define PRELUT_SIZE 65536 + +typedef struct Lut3DPreLut { + int size; + float min[3]; + float max[3]; + float scale[3]; + float* lut[3]; +} Lut3DPreLut; + +typedef struct LUT3DContext { + const AVClass *class; + struct rgbvec *lut; + int lutsize; + int lutsize2; + struct rgbvec scale; + int interpolation; /// +#include + +typedef struct MaskedClampDSPContext { + void (*maskedclamp)(const uint8_t *bsrc, uint8_t *dst, + const uint8_t *darksrc, const uint8_t *brightsrc, + int w, int undershoot, int overshoot); +} MaskedClampDSPContext; + +void ff_maskedclamp_init_x86(MaskedClampDSPContext *dsp, int depth); + +#endif /* AVFILTER_MASKEDCLAMP_H */ diff --git a/include/libavfilter/maskedmerge.h b/include/libavfilter/maskedmerge.h new file mode 100644 index 0000000..c1cf802 --- /dev/null +++ b/include/libavfilter/maskedmerge.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2015 Paul B Mahol + * + * 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 AVFILTER_MASKEDMERGE_H +#define AVFILTER_MASKEDMERGE_H + +#include "avfilter.h" +#include "framesync.h" + +typedef struct MaskedMergeContext { + const AVClass *class; + int width[4], height[4]; + int linesize[4]; + int nb_planes; + int planes; + int half, depth, max; + FFFrameSync fs; + + void (*maskedmerge)(const uint8_t *bsrc, const uint8_t *osrc, + const uint8_t *msrc, uint8_t *dst, + ptrdiff_t blinesize, ptrdiff_t olinesize, + ptrdiff_t mlinesize, ptrdiff_t dlinesize, + int w, int h, + int half, int shift); +} MaskedMergeContext; + +void ff_maskedmerge_init_x86(MaskedMergeContext *s); + +#endif /* AVFILTER_MASKEDMERGE_H */ diff --git a/include/libavfilter/median.h b/include/libavfilter/median.h new file mode 100644 index 0000000..672607c --- /dev/null +++ b/include/libavfilter/median.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2019 Paul B Mahol + * + * 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 + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + */ + +#ifndef AVFILTER_MEDIAN_H +#define AVFILTER_MEDIAN_H + +#include "avfilter.h" + +typedef struct MedianContext { + const AVClass *class; + + int planes; + int radius; + int radiusV; + float percentile; + + int planewidth[4]; + int planeheight[4]; + int depth; + int nb_planes; + int nb_threads; + + uint16_t **coarse, **fine; + int coarse_size, fine_size; + int bins; + int t; + + void (*hadd)(uint16_t *dst, const uint16_t *src, int bins); + void (*hsub)(uint16_t *dst, const uint16_t *src, int bins); + void (*hmuladd)(uint16_t *dst, const uint16_t *src, int f, int bins); + + void (*filter_plane)(AVFilterContext *ctx, const uint8_t *ssrc, int src_linesize, + uint8_t *ddst, int dst_linesize, int width, int height, + int slice_h_start, int slice_h_end, int jobnr); +} MedianContext; + +#endif diff --git a/include/libavfilter/motion_estimation.h b/include/libavfilter/motion_estimation.h new file mode 100644 index 0000000..be627ec --- /dev/null +++ b/include/libavfilter/motion_estimation.h @@ -0,0 +1,87 @@ +/** + * Copyright (c) 2016 Davinder Singh (DSM_) + * + * 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 AVFILTER_MOTION_ESTIMATION_H +#define AVFILTER_MOTION_ESTIMATION_H + +#include + +#define AV_ME_METHOD_ESA 1 +#define AV_ME_METHOD_TSS 2 +#define AV_ME_METHOD_TDLS 3 +#define AV_ME_METHOD_NTSS 4 +#define AV_ME_METHOD_FSS 5 +#define AV_ME_METHOD_DS 6 +#define AV_ME_METHOD_HEXBS 7 +#define AV_ME_METHOD_EPZS 8 +#define AV_ME_METHOD_UMH 9 + +typedef struct AVMotionEstPredictor { + int mvs[10][2]; + int nb; +} AVMotionEstPredictor; + +typedef struct AVMotionEstContext { + uint8_t *data_cur, *data_ref; + int linesize; + + int mb_size; + int search_param; + + int width; + int height; + + int x_min; + int x_max; + int y_min; + int y_max; + + int pred_x; ///< median predictor x + int pred_y; ///< median predictor y + AVMotionEstPredictor preds[2]; + + uint64_t (*get_cost)(struct AVMotionEstContext *me_ctx, int x_mb, int y_mb, + int mv_x, int mv_y); +} AVMotionEstContext; + +void ff_me_init_context(AVMotionEstContext *me_ctx, int mb_size, int search_param, + int width, int height, int x_min, int x_max, int y_min, int y_max); + +uint64_t ff_me_cmp_sad(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int x_mv, int y_mv); + +uint64_t ff_me_search_esa(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv); + +uint64_t ff_me_search_tss(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv); + +uint64_t ff_me_search_tdls(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv); + +uint64_t ff_me_search_ntss(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv); + +uint64_t ff_me_search_fss(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv); + +uint64_t ff_me_search_ds(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv); + +uint64_t ff_me_search_hexbs(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv); + +uint64_t ff_me_search_epzs(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv); + +uint64_t ff_me_search_umh(AVMotionEstContext *me_ctx, int x_mb, int y_mb, int *mv); + +#endif /* AVFILTER_MOTION_ESTIMATION_H */ diff --git a/include/libavfilter/opencl.h b/include/libavfilter/opencl.h new file mode 100644 index 0000000..dec3767 --- /dev/null +++ b/include/libavfilter/opencl.h @@ -0,0 +1,299 @@ +/* + * 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 AVFILTER_OPENCL_H +#define AVFILTER_OPENCL_H + +// The intended target is OpenCL 1.2, so disable warnings for APIs +// deprecated after that. This primarily applies to clCreateCommandQueue(), +// we can't use the replacement clCreateCommandQueueWithProperties() because +// it was introduced in OpenCL 2.0. +#define CL_USE_DEPRECATED_OPENCL_1_2_APIS + +#include "libavutil/bprint.h" +#include "libavutil/buffer.h" +#include "libavutil/hwcontext.h" +#include "libavutil/hwcontext_opencl.h" +#include "libavutil/pixfmt.h" + +#include "avfilter.h" + +typedef struct OpenCLFilterContext { + const AVClass *class; + + AVBufferRef *device_ref; + AVHWDeviceContext *device; + AVOpenCLDeviceContext *hwctx; + + cl_program program; + + enum AVPixelFormat output_format; + int output_width; + int output_height; +} OpenCLFilterContext; + +// Groups together information about a kernel argument +typedef struct OpenCLKernelArg { + size_t arg_size; + const void *arg_val; +} OpenCLKernelArg; + +/** + * set argument to specific Kernel. + * This macro relies on usage of local label "fail" and variables: + * avctx, cle and err. + */ +#define CL_SET_KERNEL_ARG(kernel, arg_num, type, arg) \ + cle = clSetKernelArg(kernel, arg_num, sizeof(type), arg); \ + if (cle != CL_SUCCESS) { \ + av_log(avctx, AV_LOG_ERROR, "Failed to set kernel " \ + "argument %d: error %d.\n", arg_num, cle); \ + err = AVERROR(EIO); \ + goto fail; \ + } + +/** + * A helper macro to handle OpenCL errors. It will assign errcode to + * variable err, log error msg, and jump to fail label on error. + */ +#define CL_FAIL_ON_ERROR(errcode, ...) do { \ + if (cle != CL_SUCCESS) { \ + av_log(avctx, AV_LOG_ERROR, __VA_ARGS__); \ + err = errcode; \ + goto fail; \ + } \ + } while(0) + +/** + * Create a kernel with the given name. + * + * The kernel variable in the context structure must have a name of the form + * kernel_. + * + * The OpenCLFilterContext variable in the context structure must be named ocf. + * + * Requires the presence of a local cl_int variable named cle and a fail label for error + * handling. + */ +#define CL_CREATE_KERNEL(ctx, kernel_name) do { \ + ctx->kernel_ ## kernel_name = clCreateKernel(ctx->ocf.program, #kernel_name, &cle); \ + CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to create %s kernel: %d.\n", #kernel_name, cle); \ +} while(0) + +/** + * release an OpenCL Kernel + */ +#define CL_RELEASE_KERNEL(k) \ +do { \ + if (k) { \ + cle = clReleaseKernel(k); \ + if (cle != CL_SUCCESS) \ + av_log(avctx, AV_LOG_ERROR, "Failed to release " \ + "OpenCL kernel: %d.\n", cle); \ + } \ +} while(0) + +/** + * release an OpenCL Memory Object + */ +#define CL_RELEASE_MEMORY(m) \ +do { \ + if (m) { \ + cle = clReleaseMemObject(m); \ + if (cle != CL_SUCCESS) \ + av_log(avctx, AV_LOG_ERROR, "Failed to release " \ + "OpenCL memory: %d.\n", cle); \ + } \ +} while(0) + +/** + * release an OpenCL Command Queue + */ +#define CL_RELEASE_QUEUE(q) \ +do { \ + if (q) { \ + cle = clReleaseCommandQueue(q); \ + if (cle != CL_SUCCESS) \ + av_log(avctx, AV_LOG_ERROR, "Failed to release " \ + "OpenCL command queue: %d.\n", cle); \ + } \ +} while(0) + +/** + * Enqueue a kernel with the given information. + * + * Kernel arguments are provided as KernelArg structures and are set in the order + * that they are passed. + * + * Requires the presence of a local cl_int variable named cle and a fail label for error + * handling. + */ +#define CL_ENQUEUE_KERNEL_WITH_ARGS(queue, kernel, global_work_size, local_work_size, event, ...) \ +do { \ + OpenCLKernelArg args[] = {__VA_ARGS__}; \ + for (int i = 0; i < FF_ARRAY_ELEMS(args); i++) { \ + cle = clSetKernelArg(kernel, i, args[i].arg_size, args[i].arg_val); \ + if (cle != CL_SUCCESS) { \ + av_log(avctx, AV_LOG_ERROR, "Failed to set kernel " \ + "argument %d: error %d.\n", i, cle); \ + err = AVERROR(EIO); \ + goto fail; \ + } \ + } \ + \ + cle = clEnqueueNDRangeKernel( \ + queue, \ + kernel, \ + FF_ARRAY_ELEMS(global_work_size), \ + NULL, \ + global_work_size, \ + local_work_size, \ + 0, \ + NULL, \ + event \ + ); \ + CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to enqueue kernel: %d.\n", cle); \ +} while (0) + +/** + * Uses the above macro to enqueue the given kernel and then additionally runs it to + * completion via clFinish. + * + * Requires the presence of a local cl_int variable named cle and a fail label for error + * handling. + */ +#define CL_RUN_KERNEL_WITH_ARGS(queue, kernel, global_work_size, local_work_size, event, ...) do { \ + CL_ENQUEUE_KERNEL_WITH_ARGS( \ + queue, kernel, global_work_size, local_work_size, event, __VA_ARGS__ \ + ); \ + \ + cle = clFinish(queue); \ + CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to finish command queue: %d.\n", cle); \ +} while (0) + +/** + * Create a buffer with the given information. + * + * The buffer variable in the context structure must be named . + * + * Requires the presence of a local cl_int variable named cle and a fail label for error + * handling. + */ +#define CL_CREATE_BUFFER_FLAGS(ctx, buffer_name, flags, size, host_ptr) do { \ + ctx->buffer_name = clCreateBuffer( \ + ctx->ocf.hwctx->context, \ + flags, \ + size, \ + host_ptr, \ + &cle \ + ); \ + CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to create buffer %s: %d.\n", #buffer_name, cle); \ +} while(0) + +/** + * Perform a blocking write to a buffer. + * + * Requires the presence of a local cl_int variable named cle and a fail label for error + * handling. + */ +#define CL_BLOCKING_WRITE_BUFFER(queue, buffer, size, host_ptr, event) do { \ + cle = clEnqueueWriteBuffer( \ + queue, \ + buffer, \ + CL_TRUE, \ + 0, \ + size, \ + host_ptr, \ + 0, \ + NULL, \ + event \ + ); \ + CL_FAIL_ON_ERROR(AVERROR(EIO), "Failed to write buffer to device: %d.\n", cle); \ +} while(0) + +/** + * Create a buffer with the given information. + * + * The buffer variable in the context structure must be named . + * + * Requires the presence of a local cl_int variable named cle and a fail label for error + * handling. + */ +#define CL_CREATE_BUFFER(ctx, buffer_name, size) CL_CREATE_BUFFER_FLAGS(ctx, buffer_name, 0, size, NULL) + +/** + * Check that the input link contains a suitable hardware frames + * context and extract the device from it. + */ +int ff_opencl_filter_config_input(AVFilterLink *inlink); + +/** + * Create a suitable hardware frames context for the output. + */ +int ff_opencl_filter_config_output(AVFilterLink *outlink); + +/** + * Initialise an OpenCL filter context. + */ +int ff_opencl_filter_init(AVFilterContext *avctx); + +/** + * Uninitialise an OpenCL filter context. + */ +void ff_opencl_filter_uninit(AVFilterContext *avctx); + +/** + * Load a new OpenCL program from strings in memory. + * + * Creates a new program and compiles it for the current device. + * Will log any build errors if compilation fails. + */ +int ff_opencl_filter_load_program(AVFilterContext *avctx, + const char **program_source_array, + int nb_strings); + +/** + * Load a new OpenCL program from a file. + * + * Same as ff_opencl_filter_load_program(), but from a file. + */ +int ff_opencl_filter_load_program_from_file(AVFilterContext *avctx, + const char *filename); + +/** + * Find the work size needed needed for a given plane of an image. + */ +int ff_opencl_filter_work_size_from_image(AVFilterContext *avctx, + size_t *work_size, + AVFrame *frame, int plane, + int block_alignment); +/** + * Print a 3x3 matrix into a buffer as __constant array, which could + * be included in an OpenCL program. +*/ + +void ff_opencl_print_const_matrix_3x3(AVBPrint *buf, const char *name_str, + double mat[3][3]); + +/** + * Gets the command start and end times for the given event and returns the + * difference (the time that the event took). + */ +cl_ulong ff_opencl_get_event_time(cl_event event); + +#endif /* AVFILTER_OPENCL_H */ diff --git a/include/libavfilter/opencl_source.h b/include/libavfilter/opencl_source.h new file mode 100644 index 0000000..b6930fb --- /dev/null +++ b/include/libavfilter/opencl_source.h @@ -0,0 +1,37 @@ +/* + * 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 AVFILTER_OPENCL_SOURCE_H +#define AVFILTER_OPENCL_SOURCE_H + +extern const char *ff_source_avgblur_cl; +extern const char *ff_source_colorkey_cl; +extern const char *ff_source_colorspace_common_cl; +extern const char *ff_source_convolution_cl; +extern const char *ff_source_deshake_cl; +extern const char *ff_source_neighbor_cl; +extern const char *ff_source_nlmeans_cl; +extern const char *ff_source_overlay_cl; +extern const char *ff_source_pad_cl; +extern const char *ff_source_remap_cl; +extern const char *ff_source_tonemap_cl; +extern const char *ff_source_transpose_cl; +extern const char *ff_source_unsharp_cl; +extern const char *ff_source_xfade_cl; + +#endif /* AVFILTER_OPENCL_SOURCE_H */ diff --git a/include/libavfilter/palette.h b/include/libavfilter/palette.h new file mode 100644 index 0000000..d3acc85 --- /dev/null +++ b/include/libavfilter/palette.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2020 Björn Ottosson + * Copyright (c) 2022 Clément Bœsch + * + * 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 AVFILTER_PALETTE_H +#define AVFILTER_PALETTE_H + +#include +#include + +#include "libavutil/attributes.h" + +struct Lab { + int32_t L, a, b; +}; + +/** + * Map sRGB 8-bit color component to a 16-bit linear value (gamma + * expand from electrical to optical value). + */ +int32_t ff_srgb_u8_to_linear_int(uint8_t x); + +/** + * Map a 16-bit linear value to a sRGB 8-bit color component (gamma + * compressed from optical to electrical value). + */ +uint8_t ff_linear_int_to_srgb_u8(int32_t x); + +/** + * sRGB (non-linear) to OkLab conversion + * @see https://bottosson.github.io/posts/oklab/ + */ +struct Lab ff_srgb_u8_to_oklab_int(uint32_t srgb); + +/** + * OkLab to sRGB (non-linear) conversion + * @see https://bottosson.github.io/posts/oklab/ + */ +uint32_t ff_oklab_int_to_srgb_u8(struct Lab c); + +/* + * lowbias32 hashing from https://nullprogram.com/blog/2018/07/31/ + */ +uint32_t ff_lowbias32(uint32_t x); + +#endif /* AVFILTER_PALETTE_H */ diff --git a/include/libavfilter/perlin.h b/include/libavfilter/perlin.h new file mode 100644 index 0000000..200c494 --- /dev/null +++ b/include/libavfilter/perlin.h @@ -0,0 +1,101 @@ +/* + * Perlin noise generator + * + * 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 + */ + +/** + * @file + * Perlin Noise generator + */ + +#ifndef AVFILTER_PERLIN_H +#define AVFILTER_PERLIN_H + +#include + +enum FFPerlinRandomMode { + FF_PERLIN_RANDOM_MODE_RANDOM, + FF_PERLIN_RANDOM_MODE_KEN, + FF_PERLIN_RANDOM_MODE_SEED, + FF_PERLIN_RANDOM_MODE_NB +}; + +/** + * Perlin generator context. This needs to be initialized with the + * parameters used to generate the Perlin noise. + */ +typedef struct FFPerlin { + /** + * spatial repeat period, if negative it is ignored + */ + double period; + + /** + * total number of components making up the noise, each one with + * doubled frequency + */ + int octaves; + + /** + * ratio used to compute the amplitude of the next octave + * component with respect to the previous component + */ + double persistence; + + /** + * permutations array used to compute the Perlin noise hash + */ + uint8_t permutations[512]; + + /** + * define how to compute the permutations array + */ + enum FFPerlinRandomMode random_mode; + + /** + * when random_mode is set FF_PERLIN_RANDOM_MODE_RANDOM, set random + * seed used to compute the permutations array + */ + unsigned int random_seed; +} FFPerlin; + +/** + * Initialize the Perlin noise generator with parameters. + * + * @param perlin Perlin noise generator context + * @param period spatial repeat period, if negative it is ignored + * @param octaves total number of components making up the noise, each one with doubled frequency + * @param persistence define ratio used to compute the amplitude of the next octave + * component with respect to the previous component + * @param random_mode define how to compute the permutations array + * @param random_seed when random_mode is set to FF_PERLIN_RANDOM_MODE_RANDOM, set random + * seed used to compute the permutations array + * @return a negative AVERROR code in case of error, a non negative value otherwise + */ +int ff_perlin_init(FFPerlin *perlin, double period, int octaves, double persistence, + enum FFPerlinRandomMode random_mode, unsigned int random_seed); + +/** + * Compute Perlin noise given the x, y, z coordinates. + * + * @param perlin Perlin noise generator context + * @return normalized value for the perlin noise, in the range [0, 1] + */ +double ff_perlin_get(FFPerlin *perlin, double x, double y, double z); + +#endif /* AVFILTER_PERLIN_H */ diff --git a/include/libavfilter/preserve_color.h b/include/libavfilter/preserve_color.h new file mode 100644 index 0000000..158ee22 --- /dev/null +++ b/include/libavfilter/preserve_color.h @@ -0,0 +1,87 @@ +/* + * 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 AVFILTER_PRESERVE_COLOR_H +#define AVFILTER_PRESERVE_COLOR_H + +#include + +#include "libavutil/macros.h" + +enum { + P_NONE, + P_LUM, + P_MAX, + P_AVG, + P_SUM, + P_NRM, + P_PWR, + NB_PRESERVE +}; + +static inline float normalize(float r, float g, float b, float max) +{ + r /= max; + g /= max; + b /= max; + return sqrtf(r * r + g * g + b * b); +} + +static inline float power(float r, float g, float b, float max) +{ + r /= max; + g /= max; + b /= max; + return cbrtf(r * r * r + g * g * g + b * b * b); +} + +static inline void preserve_color(int preserve_color, + float ir, float ig, float ib, + float r, float g, float b, + float max, + float *icolor, float *ocolor) +{ + switch (preserve_color) { + case P_LUM: + *icolor = FFMAX3(ir, ig, ib) + FFMIN3(ir, ig, ib); + *ocolor = FFMAX3( r, g, b) + FFMIN3( r, g, b); + break; + case P_MAX: + *icolor = FFMAX3(ir, ig, ib); + *ocolor = FFMAX3( r, g, b); + break; + case P_AVG: + *icolor = (ir + ig + ib + 1.f) / 3.f; + *ocolor = ( r + g + b + 1.f) / 3.f; + break; + case P_SUM: + *icolor = ir + ig + ib; + *ocolor = r + g + b; + break; + case P_NRM: + *icolor = normalize(ir, ig, ib, max); + *ocolor = normalize( r, g, b, max); + break; + case P_PWR: + *icolor = power(ir, ig, ib, max); + *ocolor = power( r, g, b, max); + break; + } +} + +#endif /* AVFILTER_PRESERVE_COLOR_H */ diff --git a/include/libavfilter/psnr.h b/include/libavfilter/psnr.h new file mode 100644 index 0000000..bbc4541 --- /dev/null +++ b/include/libavfilter/psnr.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2015 Ronald S. Bultje + * + * 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 AVFILTER_PSNR_H +#define AVFILTER_PSNR_H + +#include +#include + +typedef struct PSNRDSPContext { + uint64_t (*sse_line)(const uint8_t *buf, const uint8_t *ref, int w); +} PSNRDSPContext; + +void ff_psnr_init_x86(PSNRDSPContext *dsp, int bpp); + +#endif /* AVFILTER_PSNR_H */ diff --git a/include/libavfilter/qp_table.h b/include/libavfilter/qp_table.h new file mode 100644 index 0000000..4407bac --- /dev/null +++ b/include/libavfilter/qp_table.h @@ -0,0 +1,47 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 General Public License for more details. + * + * You should have received a copy of the GNU 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 AVFILTER_QP_TABLE_H +#define AVFILTER_QP_TABLE_H + +#include + +#include "libavutil/frame.h" +#include "libavutil/video_enc_params.h" + +/** + * Extract a libpostproc-compatible QP table - an 8-bit QP value per 16x16 + * macroblock, stored in raster order - from AVVideoEncParams side data. + */ +int ff_qp_table_extract(AVFrame *frame, int8_t **table, int *table_w, int *table_h, + enum AVVideoEncParamsType *qscale_type); + +/** + * Normalize the qscale factor + * FIXME Add support for other values of enum AVVideoEncParamsType + * besides AV_VIDEO_ENC_PARAMS_MPEG2. + */ +static inline int ff_norm_qscale(int qscale, enum AVVideoEncParamsType type) +{ + switch (type) { + case AV_VIDEO_ENC_PARAMS_MPEG2: return qscale >> 1; + } + return qscale; +} + +#endif // AVFILTER_QP_TABLE_H diff --git a/include/libavfilter/qsvvpp.h b/include/libavfilter/qsvvpp.h new file mode 100644 index 0000000..3b9192b --- /dev/null +++ b/include/libavfilter/qsvvpp.h @@ -0,0 +1,149 @@ +/* + * 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 + */ + +/** + * @file + * Intel Quick Sync Video VPP base function + */ + +#ifndef AVFILTER_QSVVPP_H +#define AVFILTER_QSVVPP_H + +#include + +#include "avfilter.h" +#include "libavutil/fifo.h" +#include "libavutil/hwcontext.h" +#include "libavutil/hwcontext_qsv.h" + +#define FF_INLINK_IDX(link) ((int)((link)->dstpad - (link)->dst->input_pads)) +#define FF_OUTLINK_IDX(link) ((int)((link)->srcpad - (link)->src->output_pads)) + +#define QSV_VERSION_ATLEAST(MAJOR, MINOR) \ + (MFX_VERSION_MAJOR > (MAJOR) || \ + MFX_VERSION_MAJOR == (MAJOR) && MFX_VERSION_MINOR >= (MINOR)) + +#define QSV_RUNTIME_VERSION_ATLEAST(MFX_VERSION, MAJOR, MINOR) \ + ((MFX_VERSION.Major > (MAJOR)) || \ + (MFX_VERSION.Major == (MAJOR) && MFX_VERSION.Minor >= (MINOR))) + +#define QSV_ONEVPL QSV_VERSION_ATLEAST(2, 0) +#define QSV_HAVE_OPAQUE !QSV_ONEVPL + +typedef struct QSVFrame { + AVFrame *frame; + mfxFrameSurface1 surface; + struct QSVFrame *next; + int queued; +} QSVFrame; + +#define QSVVPP_MAX_FRAME_EXTBUFS 8 + +typedef struct QSVVPPFrameParam { + /* To fill with MFX enhanced filter configurations */ + int num_ext_buf; + mfxExtBuffer **ext_buf; +} QSVVPPFrameParam; + +typedef struct QSVVPPContext { + const AVClass *class; + + mfxSession session; + int (*filter_frame) (AVFilterLink *outlink, AVFrame *frame); /**< callback */ + int (*set_frame_ext_params)(AVFilterContext *ctx, const AVFrame *in, AVFrame *out, QSVVPPFrameParam *fp); /**< callbak */ + enum AVPixelFormat out_sw_format; /**< Real output format */ + mfxVideoParam vpp_param; + mfxFrameInfo *frame_infos; /**< frame info for each input */ + + /** members related to the input/output surface */ + int in_mem_mode; + int out_mem_mode; + QSVFrame *in_frame_list; + QSVFrame *out_frame_list; + int nb_surface_ptrs_in; + int nb_surface_ptrs_out; + mfxFrameSurface1 **surface_ptrs_in; + mfxFrameSurface1 **surface_ptrs_out; + +#if QSV_HAVE_OPAQUE + /** MFXVPP extern parameters */ + mfxExtOpaqueSurfaceAlloc opaque_alloc; +#endif + /** store sequence parameters */ + mfxExtBuffer **seq_buffers; + int nb_seq_buffers; + + /** store all parameters for vpp execution, including parameters per frame */ + mfxExtBuffer **ext_buffers; + int nb_ext_buffers; + + int got_frame; + int async_depth; + int eof; + /** order with frame_out, sync */ + AVFifo *async_fifo; + + mfxVersion ver; + int vpp_initted; +} QSVVPPContext; + +typedef struct QSVVPPCrop { + int in_idx; ///< Input index + int x, y, w, h; ///< Crop rectangle +} QSVVPPCrop; + +typedef struct QSVVPPParam { + /* default is ff_filter_frame */ + int (*filter_frame)(AVFilterLink *outlink, AVFrame *frame); + int (*set_frame_ext_params)(AVFilterContext *ctx, const AVFrame *in, AVFrame *out, QSVVPPFrameParam *fp); /**< callbak */ + + /* To fill with MFX enhanced filter configurations */ + int num_ext_buf; + mfxExtBuffer **ext_buf; + + /* Real output format */ + enum AVPixelFormat out_sw_format; + + /* Crop information for each input, if needed */ + int num_crop; + QSVVPPCrop *crop; +} QSVVPPParam; + +/* create and initialize the QSV session */ +int ff_qsvvpp_init(AVFilterContext *avctx, QSVVPPParam *param); + +/* release the resources (eg.surfaces) */ +int ff_qsvvpp_close(AVFilterContext *avctx); + +/* vpp filter frame and call the cb if needed */ +int ff_qsvvpp_filter_frame(QSVVPPContext *vpp, AVFilterLink *inlink, AVFrame *frame, AVFrame *propref); + +int ff_qsvvpp_print_iopattern(void *log_ctx, int mfx_iopattern, + const char *extra_string); + +int ff_qsvvpp_print_error(void *log_ctx, mfxStatus err, + const char *error_string); + +int ff_qsvvpp_print_warning(void *log_ctx, mfxStatus err, + const char *warning_string); + +int ff_qsvvpp_create_mfx_session(void *ctx, void *loader, mfxIMPL implementation, + mfxVersion *pver, mfxSession *psession); + +AVFrame *ff_qsvvpp_get_video_buffer(AVFilterLink *inlink, int w, int h); +#endif /* AVFILTER_QSVVPP_H */ diff --git a/include/libavfilter/removegrain.h b/include/libavfilter/removegrain.h new file mode 100644 index 0000000..f3f1028 --- /dev/null +++ b/include/libavfilter/removegrain.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2015 Paul B Mahol + * Copyright (c) 2015 James Darnley + * + * 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 AVFILTER_REMOVEGRAIN_H +#define AVFILTER_REMOVEGRAIN_H + +#include "avfilter.h" + +typedef struct RemoveGrainContext { + const AVClass *class; + + int mode[4]; + + int nb_planes; + int planewidth[4]; + int planeheight[4]; + int skip_even; + int skip_odd; + + int (*rg[4])(int c, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8); + + void (*fl[4])(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int pixels); +} RemoveGrainContext; + +void ff_removegrain_init_x86(RemoveGrainContext *rg); + +#endif /* AVFILTER_REMOVEGRAIN_H */ diff --git a/include/libavfilter/scale_eval.h b/include/libavfilter/scale_eval.h new file mode 100644 index 0000000..b489528 --- /dev/null +++ b/include/libavfilter/scale_eval.h @@ -0,0 +1,49 @@ +/* + * 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 AVFILTER_SCALE_EVAL_H +#define AVFILTER_SCALE_EVAL_H + +#include "avfilter.h" + +/** + * Parse and evaluate string expressions for width and height. Upon success, + * ff_scale_adjust_dimensions must be called with evaluated width and height + * to obtain actual target dimensions. + * + * Returns 0 upon success, negative value if one of the expressions could + * not be parsed or if NaN was the result of their evaluation. + */ +int ff_scale_eval_dimensions(void *ctx, + const char *w_expr, const char *h_expr, + AVFilterLink *inlink, AVFilterLink *outlink, + int *ret_w, int *ret_h); + +/** + * Transform evaluated width and height obtained from ff_scale_eval_dimensions + * into actual target width and height for scaling. Adjustment can occur if one + * or both of the evaluated values are of the form '-n' or if + * force_original_aspect_ratio is set. force_divisible_by is used only when + * force_original_aspect_ratio is set and must be at least 1. + * + * Returns negative error code on error or non negative on success + */ +int ff_scale_adjust_dimensions(AVFilterLink *inlink, + int *ret_w, int *ret_h, + int force_original_aspect_ratio, int force_divisible_by); +#endif diff --git a/include/libavfilter/scene_sad.h b/include/libavfilter/scene_sad.h new file mode 100644 index 0000000..173a051 --- /dev/null +++ b/include/libavfilter/scene_sad.h @@ -0,0 +1,44 @@ +/* + * 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 + */ + +/** + * @file + * Scene SAD functions + */ + +#ifndef AVFILTER_SCENE_SAD_H +#define AVFILTER_SCENE_SAD_H + +#include "avfilter.h" + +#define SCENE_SAD_PARAMS const uint8_t *src1, ptrdiff_t stride1, \ + const uint8_t *src2, ptrdiff_t stride2, \ + ptrdiff_t width, ptrdiff_t height, \ + uint64_t *sum + +typedef void (*ff_scene_sad_fn)(SCENE_SAD_PARAMS); + +void ff_scene_sad_c(SCENE_SAD_PARAMS); + +void ff_scene_sad16_c(SCENE_SAD_PARAMS); + +ff_scene_sad_fn ff_scene_sad_get_fn_x86(int depth); + +ff_scene_sad_fn ff_scene_sad_get_fn(int depth); + +#endif /* AVFILTER_SCENE_SAD_H */ diff --git a/include/libavfilter/signature.h b/include/libavfilter/signature.h new file mode 100644 index 0000000..c6b57cc --- /dev/null +++ b/include/libavfilter/signature.h @@ -0,0 +1,568 @@ +/* + * Copyright (c) 2017 Gerion Entrup + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 General Public License for more details. + * + * You should have received a copy of the GNU 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. + */ + +/** + * @file + * MPEG-7 video signature calculation and lookup filter + */ + +#ifndef AVFILTER_SIGNATURE_H +#define AVFILTER_SIGNATURE_H + +#include +#include "libavutil/common.h" +#include "libavutil/opt.h" +#include "libavutil/timestamp.h" +#include "avfilter.h" + +#define ELEMENT_COUNT 10 +#define SIGELEM_SIZE 380 +#define DIFFELEM_SIZE 348 /* SIGELEM_SIZE - elem_a1 - elem_a2 */ +#define COARSE_SIZE 90 + +enum lookup_mode { + MODE_OFF, + MODE_FULL, + MODE_FAST, + NB_LOOKUP_MODE +}; + +enum formats { + FORMAT_BINARY, + FORMAT_XML, + NB_FORMATS +}; + +typedef struct Point { + uint8_t x; + uint8_t y; +} Point; + +typedef struct Block { + Point up; + Point to; +} Block; + +typedef struct ElemCat { + int av_elem; /* average element category */ + short left_count; /* count of blocks that will be added together */ + short block_count; /* count of blocks per element */ + short elem_count; + const Block* blocks; +} ElemCat; + +typedef struct FineSignature { + struct FineSignature* next; + struct FineSignature* prev; + uint64_t pts; + uint32_t index; /* needed for xmlexport */ + uint8_t confidence; + uint8_t words[5]; + uint8_t framesig[SIGELEM_SIZE/5]; +} FineSignature; + +typedef struct CoarseSignature { + uint8_t data[5][31]; /* 5 words with min. 243 bit */ + struct FineSignature* first; /* associated Finesignatures */ + struct FineSignature* last; + struct CoarseSignature* next; +} CoarseSignature; + +/* lookup types */ +typedef struct MatchingInfo { + double meandist; + double framerateratio; /* second/first */ + int score; + int offset; + int matchframes; /* number of matching frames */ + int whole; + struct FineSignature* first; + struct FineSignature* second; + struct MatchingInfo* next; +} MatchingInfo; + +typedef struct StreamContext { + AVRational time_base; + /* needed for xml_export */ + int w; /* height */ + int h; /* width */ + + /* overflow protection */ + int divide; + + FineSignature* finesiglist; + FineSignature* curfinesig; + + CoarseSignature* coarsesiglist; + CoarseSignature* coarseend; /* needed for xml export */ + /* helpers to store the alternating signatures */ + CoarseSignature* curcoarsesig1; + CoarseSignature* curcoarsesig2; + + int coarsecount; /* counter from 0 to 89 */ + int midcoarse; /* whether it is a coarsesignature beginning from 45 + i * 90 */ + uint32_t lastindex; /* helper to store amount of frames */ + + int exported; /* boolean whether stream already exported */ +} StreamContext; + +typedef struct SignatureContext { + const AVClass *class; + /* input parameters */ + int mode; + int nb_inputs; + char *filename; + int format; + int thworddist; + int thcomposdist; + int thl1; + int thdi; + int thit; + /* end input parameters */ + + uint8_t l1distlut[243*242/2]; /* 243 + 242 + 241 ... */ + StreamContext* streamcontexts; +} SignatureContext; + + +static const Block elem_a1_data[] = { + {{ 0, 0},{ 7, 7}}, + {{ 8, 0},{15, 7}}, + {{ 0, 8},{ 7,15}}, + {{ 8, 8},{15,15}}, + {{16, 0},{23, 7}}, + {{24, 0},{31, 7}}, + {{16, 8},{23,15}}, + {{24, 8},{31,15}}, + {{ 0,16},{ 7,23}}, + {{ 8,16},{15,23}}, + {{ 0,24},{ 7,31}}, + {{ 8,24},{15,31}}, + {{16,16},{23,23}}, + {{24,16},{31,23}}, + {{16,24},{23,31}}, + {{24,24},{31,31}}, + {{ 0, 0},{15,15}}, + {{16, 0},{31,15}}, + {{ 0,16},{15,31}}, + {{16,16},{31,31}} +}; +static const ElemCat elem_a1 = { 1, 1, 1, 20, elem_a1_data }; + +static const Block elem_a2_data[] = { + {{ 2, 2},{ 9, 9}}, + {{12, 2},{19, 9}}, + {{22, 2},{29, 9}}, + {{ 2,12},{ 9,19}}, + {{12,12},{19,19}}, + {{22,12},{29,19}}, + {{ 2,22},{ 9,29}}, + {{12,22},{19,29}}, + {{22,22},{29,29}}, + {{ 9, 9},{22,22}}, + {{ 6, 6},{25,25}}, + {{ 3, 3},{28,28}} +}; +static const ElemCat elem_a2 = { 1, 1, 1, 12, elem_a2_data }; + +static const Block elem_d1_data[] = { + {{ 0, 0},{ 1, 3}},{{ 2, 0},{ 3, 3}}, + {{ 4, 0},{ 7, 1}},{{ 4, 2},{ 7, 3}}, + {{ 0, 6},{ 3, 7}},{{ 0, 4},{ 3, 5}}, + {{ 6, 4},{ 7, 7}},{{ 4, 4},{ 5, 7}}, + {{ 8, 0},{ 9, 3}},{{10, 0},{11, 3}}, + {{12, 0},{15, 1}},{{12, 2},{15, 3}}, + {{ 8, 6},{11, 7}},{{ 8, 4},{11, 5}}, + {{14, 4},{15, 7}},{{12, 4},{13, 7}}, + {{ 0, 8},{ 1,11}},{{ 2, 8},{ 3,11}}, + {{ 4, 8},{ 7, 9}},{{ 4,10},{ 7,11}}, + {{ 0,14},{ 3,15}},{{ 0,12},{ 3,13}}, + {{ 6,12},{ 7,15}},{{ 4,12},{ 5,15}}, + {{ 8, 8},{ 9,11}},{{10, 8},{11,11}}, + {{12, 8},{15, 9}},{{12,10},{15,11}}, + {{ 8,14},{11,15}},{{ 8,12},{11,13}}, + {{14,12},{15,15}},{{12,12},{13,15}}, + {{16, 0},{19, 1}},{{16, 2},{19, 3}}, + {{22, 0},{23, 3}},{{20, 0},{21, 3}}, + {{16, 4},{17, 7}},{{18, 4},{19, 7}}, + {{20, 6},{23, 7}},{{20, 4},{23, 5}}, + {{24, 0},{27, 1}},{{24, 2},{27, 3}}, + {{30, 0},{31, 3}},{{28, 0},{29, 3}}, + {{24, 4},{25, 7}},{{26, 4},{27, 7}}, + {{28, 6},{31, 7}},{{28, 4},{31, 5}}, + {{16, 8},{19, 9}},{{16,10},{19,11}}, + {{22, 8},{23,11}},{{20, 8},{21,11}}, + {{16,12},{17,15}},{{18,12},{19,15}}, + {{20,14},{23,15}},{{20,12},{23,13}}, + {{24, 8},{27, 9}},{{24,10},{27,11}}, + {{30, 8},{31,11}},{{28, 8},{29,11}}, + {{24,12},{25,15}},{{26,12},{27,15}}, + {{28,14},{31,15}},{{28,12},{31,13}}, + {{ 0,16},{ 3,17}},{{ 0,18},{ 3,19}}, + {{ 6,16},{ 7,19}},{{ 4,16},{ 5,19}}, + {{ 0,20},{ 1,23}},{{ 2,20},{ 3,23}}, + {{ 4,22},{ 7,23}},{{ 4,20},{ 7,21}}, + {{ 8,16},{11,17}},{{ 8,18},{11,19}}, + {{14,16},{15,19}},{{12,16},{13,19}}, + {{ 8,20},{ 9,23}},{{10,20},{11,23}}, + {{12,22},{15,23}},{{12,20},{15,21}}, + {{ 0,24},{ 3,25}},{{ 0,26},{ 3,27}}, + {{ 6,24},{ 7,27}},{{ 4,24},{ 5,27}}, + {{ 0,28},{ 1,31}},{{ 2,28},{ 3,31}}, + {{ 4,30},{ 7,31}},{{ 4,28},{ 7,29}}, + {{ 8,24},{11,25}},{{ 8,26},{11,27}}, + {{14,24},{15,27}},{{12,24},{13,27}}, + {{ 8,28},{ 9,31}},{{10,28},{11,31}}, + {{12,30},{15,31}},{{12,28},{15,29}}, + {{16,16},{17,19}},{{18,16},{19,19}}, + {{20,16},{23,17}},{{20,18},{23,19}}, + {{16,22},{19,23}},{{16,20},{19,21}}, + {{22,20},{23,23}},{{20,20},{21,23}}, + {{24,16},{25,19}},{{26,16},{27,19}}, + {{28,16},{31,17}},{{28,18},{31,19}}, + {{24,22},{27,23}},{{24,20},{27,21}}, + {{30,20},{31,23}},{{28,20},{29,23}}, + {{16,24},{17,27}},{{18,24},{19,27}}, + {{20,24},{23,25}},{{20,26},{23,27}}, + {{16,30},{19,31}},{{16,28},{19,29}}, + {{22,28},{23,31}},{{20,28},{21,31}}, + {{24,24},{25,27}},{{26,24},{27,27}}, + {{28,24},{31,25}},{{28,26},{31,27}}, + {{24,30},{27,31}},{{24,28},{27,29}}, + {{30,28},{31,31}},{{28,28},{29,31}}, + {{ 2, 2},{ 3, 5}},{{ 4, 2},{ 5, 5}}, + {{ 6, 2},{ 9, 3}},{{ 6, 4},{ 9, 5}}, + {{ 2, 8},{ 5, 9}},{{ 2, 6},{ 5, 7}}, + {{ 8, 6},{ 9, 9}},{{ 6, 6},{ 7, 9}}, + {{12, 2},{13, 5}},{{14, 2},{15, 5}}, + {{16, 2},{19, 3}},{{16, 4},{19, 5}}, + {{12, 8},{15, 9}},{{12, 6},{15, 7}}, + {{18, 6},{19, 9}},{{16, 6},{17, 9}}, + {{22, 2},{23, 5}},{{24, 2},{25, 5}}, + {{26, 2},{29, 3}},{{26, 4},{29, 5}}, + {{22, 8},{25, 9}},{{22, 6},{25, 7}}, + {{28, 6},{29, 9}},{{26, 6},{27, 9}}, + {{ 2,12},{ 3,15}},{{ 4,12},{ 5,15}}, + {{ 6,12},{ 9,13}},{{ 6,14},{ 9,15}}, + {{ 2,18},{ 5,19}},{{ 2,16},{ 5,17}}, + {{ 8,16},{ 9,19}},{{ 6,16},{ 7,19}}, + {{12,12},{15,13}},{{12,14},{15,15}}, + {{16,12},{19,13}},{{16,14},{19,15}}, + {{12,18},{15,19}},{{12,16},{15,17}}, + {{16,18},{19,19}},{{16,16},{19,17}}, + {{22,12},{23,15}},{{24,12},{25,15}}, + {{26,12},{29,13}},{{26,14},{29,15}}, + {{22,18},{25,19}},{{22,16},{25,17}}, + {{28,16},{29,19}},{{26,16},{27,19}}, + {{ 2,22},{ 3,25}},{{ 4,22},{ 5,25}}, + {{ 6,22},{ 9,23}},{{ 6,24},{ 9,25}}, + {{ 2,28},{ 5,29}},{{ 2,26},{ 5,27}}, + {{ 8,26},{ 9,29}},{{ 6,26},{ 7,29}}, + {{12,22},{13,25}},{{14,22},{15,25}}, + {{16,22},{19,23}},{{16,24},{19,25}}, + {{12,28},{15,29}},{{12,26},{15,27}}, + {{18,26},{19,29}},{{16,26},{17,29}}, + {{22,22},{23,25}},{{24,22},{25,25}}, + {{26,22},{29,23}},{{26,24},{29,25}}, + {{22,28},{25,29}},{{22,26},{25,27}}, + {{28,26},{29,29}},{{26,26},{27,29}}, + {{ 7, 7},{10, 8}},{{ 7, 9},{10,10}}, + {{11, 7},{12,10}},{{13, 7},{14,10}}, + {{ 7,11},{ 8,14}},{{ 9,11},{10,14}}, + {{11,11},{14,12}},{{11,13},{14,14}}, + {{17, 7},{20, 8}},{{17, 9},{20,10}}, + {{21, 7},{22,10}},{{23, 7},{24,10}}, + {{17,11},{18,14}},{{19,11},{20,14}}, + {{21,11},{24,12}},{{21,13},{24,14}}, + {{ 7,17},{10,18}},{{ 7,19},{10,20}}, + {{11,17},{12,20}},{{13,17},{14,20}}, + {{ 7,21},{ 8,24}},{{ 9,21},{10,24}}, + {{11,21},{14,22}},{{11,23},{14,24}}, + {{17,17},{20,18}},{{17,19},{20,20}}, + {{21,17},{22,20}},{{23,17},{24,20}}, + {{17,21},{18,24}},{{19,21},{20,24}}, + {{21,21},{24,22}},{{21,23},{24,24}} +}; +static const ElemCat elem_d1 = { 0, 1, 2, 116, elem_d1_data }; + +static const Block elem_d2_data[] = { + {{ 0, 0},{ 3, 3}},{{ 4, 4},{ 7, 7}},{{ 4, 0},{ 7, 3}},{{ 0, 4},{ 3, 7}}, + {{ 8, 0},{11, 3}},{{12, 4},{15, 7}},{{12, 0},{15, 3}},{{ 8, 4},{11, 7}}, + {{16, 0},{19, 3}},{{20, 4},{23, 7}},{{20, 0},{23, 3}},{{16, 4},{19, 7}}, + {{24, 0},{27, 3}},{{28, 4},{31, 7}},{{28, 0},{31, 3}},{{24, 4},{27, 7}}, + {{ 0, 8},{ 3,11}},{{ 4,12},{ 7,15}},{{ 4, 8},{ 7,11}},{{ 0,12},{ 3,15}}, + {{ 8, 8},{11,11}},{{12,12},{15,15}},{{12, 8},{15,11}},{{ 8,12},{11,15}}, + {{16, 8},{19,11}},{{20,12},{23,15}},{{20, 8},{23,11}},{{16,12},{19,15}}, + {{24, 8},{27,11}},{{28,12},{31,15}},{{28, 8},{31,11}},{{24,12},{27,15}}, + {{ 0,16},{ 3,19}},{{ 4,20},{ 7,23}},{{ 4,16},{ 7,19}},{{ 0,20},{ 3,23}}, + {{ 8,16},{11,19}},{{12,20},{15,23}},{{12,16},{15,19}},{{ 8,20},{11,23}}, + {{16,16},{19,19}},{{20,20},{23,23}},{{20,16},{23,19}},{{16,20},{19,23}}, + {{24,16},{27,19}},{{28,20},{31,23}},{{28,16},{31,19}},{{24,20},{27,23}}, + {{ 0,24},{ 3,27}},{{ 4,28},{ 7,31}},{{ 4,24},{ 7,27}},{{ 0,28},{ 3,31}}, + {{ 8,24},{11,27}},{{12,28},{15,31}},{{12,24},{15,27}},{{ 8,28},{11,31}}, + {{16,24},{19,27}},{{20,28},{23,31}},{{20,24},{23,27}},{{16,28},{19,31}}, + {{24,24},{27,27}},{{28,28},{31,31}},{{28,24},{31,27}},{{24,28},{27,31}}, + {{ 4, 4},{ 7, 7}},{{ 8, 8},{11,11}},{{ 8, 4},{11, 7}},{{ 4, 8},{ 7,11}}, + {{12, 4},{15, 7}},{{16, 8},{19,11}},{{16, 4},{19, 7}},{{12, 8},{15,11}}, + {{20, 4},{23, 7}},{{24, 8},{27,11}},{{24, 4},{27, 7}},{{20, 8},{23,11}}, + {{ 4,12},{ 7,15}},{{ 8,16},{11,19}},{{ 8,12},{11,15}},{{ 4,16},{ 7,19}}, + {{12,12},{15,15}},{{16,16},{19,19}},{{16,12},{19,15}},{{12,16},{15,19}}, + {{20,12},{23,15}},{{24,16},{27,19}},{{24,12},{27,15}},{{20,16},{23,19}}, + {{ 4,20},{ 7,23}},{{ 8,24},{11,27}},{{ 8,20},{11,23}},{{ 4,24},{ 7,27}}, + {{12,20},{15,23}},{{16,24},{19,27}},{{16,20},{19,23}},{{12,24},{15,27}}, + {{20,20},{23,23}},{{24,24},{27,27}},{{24,20},{27,23}},{{20,24},{23,27}} +}; +static const ElemCat elem_d2 = { 0, 2, 4, 25, elem_d2_data }; + +static const Block elem_d3_data[] = { + {{ 1, 1},{10,10}},{{11, 1},{20,10}}, + {{ 1, 1},{10,10}},{{21, 1},{30,10}}, + {{ 1, 1},{10,10}},{{ 1,11},{10,20}}, + {{ 1, 1},{10,10}},{{11,11},{20,20}}, + {{ 1, 1},{10,10}},{{21,11},{30,20}}, + {{ 1, 1},{10,10}},{{ 1,21},{10,30}}, + {{ 1, 1},{10,10}},{{11,21},{20,30}}, + {{ 1, 1},{10,10}},{{21,21},{30,30}}, + {{11, 1},{20,10}},{{21, 1},{30,10}}, + {{11, 1},{20,10}},{{ 1,11},{10,20}}, + {{11, 1},{20,10}},{{11,11},{20,20}}, + {{11, 1},{20,10}},{{21,11},{30,20}}, + {{11, 1},{20,10}},{{ 1,21},{10,30}}, + {{11, 1},{20,10}},{{11,21},{20,30}}, + {{11, 1},{20,10}},{{21,21},{30,30}}, + {{21, 1},{30,10}},{{ 1,11},{10,20}}, + {{21, 1},{30,10}},{{11,11},{20,20}}, + {{21, 1},{30,10}},{{21,11},{30,20}}, + {{21, 1},{30,10}},{{ 1,21},{10,30}}, + {{21, 1},{30,10}},{{11,21},{20,30}}, + {{21, 1},{30,10}},{{21,21},{30,30}}, + {{ 1,11},{10,20}},{{11,11},{20,20}}, + {{ 1,11},{10,20}},{{21,11},{30,20}}, + {{ 1,11},{10,20}},{{ 1,21},{10,30}}, + {{ 1,11},{10,20}},{{11,21},{20,30}}, + {{ 1,11},{10,20}},{{21,21},{30,30}}, + {{11,11},{20,20}},{{21,11},{30,20}}, + {{11,11},{20,20}},{{ 1,21},{10,30}}, + {{11,11},{20,20}},{{11,21},{20,30}}, + {{11,11},{20,20}},{{21,21},{30,30}}, + {{21,11},{30,20}},{{ 1,21},{10,30}}, + {{21,11},{30,20}},{{11,21},{20,30}}, + {{21,11},{30,20}},{{21,21},{30,30}}, + {{ 1,21},{10,30}},{{11,21},{20,30}}, + {{ 1,21},{10,30}},{{21,21},{30,30}}, + {{11,21},{20,30}},{{21,21},{30,30}} +}; +static const ElemCat elem_d3 = { 0, 1, 2, 36, elem_d3_data }; + +static const Block elem_d4_data[] = { + {{ 7,13},{12,18}},{{19,13},{24,18}}, + {{13, 7},{18,12}},{{13,19},{18,24}}, + {{ 7, 7},{12,12}},{{19,19},{24,24}}, + {{19, 7},{24,12}},{{ 7,19},{12,24}}, + {{13, 7},{18,12}},{{19,13},{24,18}}, + {{19,13},{24,18}},{{13,19},{18,24}}, + {{13,19},{18,24}},{{ 7,13},{12,18}}, + {{ 7,13},{12,18}},{{13, 7},{18,12}}, + {{ 7, 7},{12,12}},{{19, 7},{24,12}}, + {{19, 7},{24,12}},{{19,19},{24,24}}, + {{19,19},{24,24}},{{ 7,19},{12,24}}, + {{ 7,19},{12,24}},{{ 7, 7},{12,12}}, + {{13,13},{18,18}},{{13, 1},{18, 6}}, + {{13,13},{18,18}},{{25,13},{30,18}}, + {{13,13},{18,18}},{{13,25},{18,30}}, + {{13,13},{18,18}},{{ 1,13},{ 6,18}}, + {{13, 1},{18, 6}},{{13,25},{18,30}}, + {{ 1,13},{ 6,18}},{{25,13},{30,18}}, + {{ 7, 1},{12, 6}},{{19, 1},{24, 6}}, + {{ 7,25},{12,30}},{{19,25},{24,30}}, + {{ 1, 7},{ 6,12}},{{ 1,19},{ 6,24}}, + {{25, 7},{30,12}},{{25,19},{30,24}}, + {{ 7, 1},{12, 6}},{{ 1, 7},{ 6,12}}, + {{19, 1},{24, 6}},{{25, 7},{30,12}}, + {{25,19},{30,24}},{{19,25},{24,30}}, + {{ 1,19},{ 6,24}},{{ 7,25},{12,30}}, + {{ 1, 1},{ 6, 6}},{{25, 1},{30, 6}}, + {{25, 1},{30, 6}},{{25,25},{30,30}}, + {{25,25},{30,30}},{{ 1,25},{ 6,30}}, + {{ 1,25},{ 6,30}},{{ 1, 1},{ 6, 6}} +}; +static const ElemCat elem_d4 = { 0, 1, 2, 30, elem_d4_data }; + +static const Block elem_d5_data[] = { + {{ 1, 1},{10, 3}},{{ 1, 4},{ 3, 7}},{{ 8, 4},{10, 7}},{{ 1, 8},{10,10}},{{ 4, 4},{ 7, 7}}, + {{11, 1},{20, 3}},{{11, 4},{13, 7}},{{18, 4},{20, 7}},{{11, 8},{20,10}},{{14, 4},{17, 7}}, + {{21, 1},{30, 3}},{{21, 4},{23, 7}},{{28, 4},{30, 7}},{{21, 8},{30,10}},{{24, 4},{27, 7}}, + {{ 1,11},{10,13}},{{ 1,14},{ 3,17}},{{ 8,14},{10,17}},{{ 1,18},{10,20}},{{ 4,14},{ 7,17}}, + {{11,11},{20,13}},{{11,14},{13,17}},{{18,14},{20,17}},{{11,18},{20,20}},{{14,14},{17,17}}, + {{21,11},{30,13}},{{21,14},{23,17}},{{28,14},{30,17}},{{21,18},{30,20}},{{24,14},{27,17}}, + {{ 1,21},{10,23}},{{ 1,24},{ 3,27}},{{ 8,24},{10,27}},{{ 1,28},{10,30}},{{ 4,24},{ 7,27}}, + {{11,21},{20,23}},{{11,24},{13,27}},{{18,24},{20,27}},{{11,28},{20,30}},{{14,24},{17,27}}, + {{21,21},{30,23}},{{21,24},{23,27}},{{28,24},{30,27}},{{21,28},{30,30}},{{24,24},{27,27}}, + {{ 6, 6},{15, 8}},{{ 6, 9},{ 8,12}},{{13, 9},{15,12}},{{ 6,13},{15,15}},{{ 9, 9},{12,12}}, + {{16, 6},{25, 8}},{{16, 9},{18,12}},{{23, 9},{25,12}},{{16,13},{25,15}},{{19, 9},{22,12}}, + {{ 6,16},{15,18}},{{ 6,19},{ 8,22}},{{13,19},{15,22}},{{ 6,23},{15,25}},{{ 9,19},{12,22}}, + {{16,16},{25,18}},{{16,19},{18,22}},{{23,19},{25,22}},{{16,23},{25,25}},{{19,19},{22,22}}, + {{ 6, 1},{15, 3}},{{ 6, 4},{ 8, 7}},{{13, 4},{15, 7}},{{ 6, 8},{15,10}},{{ 9, 4},{12, 7}}, + {{16, 1},{25, 3}},{{16, 4},{18, 7}},{{23, 4},{25, 7}},{{16, 8},{25,10}},{{19, 4},{22, 7}}, + {{ 1, 6},{10, 8}},{{ 1, 9},{ 3,12}},{{ 8, 9},{10,12}},{{ 1,13},{10,15}},{{ 4, 9},{ 7,12}}, + {{11, 6},{20, 8}},{{11, 9},{13,12}},{{18, 9},{20,12}},{{11,13},{20,15}},{{14, 9},{17,12}}, + {{21, 6},{30, 8}},{{21, 9},{23,12}},{{28, 9},{30,12}},{{21,13},{30,15}},{{24, 9},{27,12}}, + {{ 6,11},{15,13}},{{ 6,14},{ 8,17}},{{13,14},{15,17}},{{ 6,18},{15,20}},{{ 9,14},{12,17}}, + {{16,11},{25,13}},{{16,14},{18,17}},{{23,14},{25,17}},{{16,18},{25,20}},{{19,14},{22,17}}, + {{ 1,16},{10,18}},{{ 1,19},{ 3,22}},{{ 8,19},{10,22}},{{ 1,23},{10,25}},{{ 4,19},{ 7,22}}, + {{11,16},{20,18}},{{11,19},{13,22}},{{18,19},{20,22}},{{11,23},{20,25}},{{14,19},{17,22}}, + {{21,16},{30,18}},{{21,19},{23,22}},{{28,19},{30,22}},{{21,23},{30,25}},{{24,19},{27,22}}, + {{ 6,21},{15,23}},{{ 6,24},{ 8,27}},{{13,24},{15,27}},{{ 6,28},{15,30}},{{ 9,24},{12,27}}, + {{16,21},{25,23}},{{16,24},{18,27}},{{23,24},{25,27}},{{16,28},{25,30}},{{19,24},{22,27}}, + {{ 2, 2},{14, 6}},{{ 2, 7},{ 6, 9}},{{10, 7},{14, 9}},{{ 2,10},{14,14}},{{ 7, 7},{ 9, 9}}, + {{ 7, 2},{19, 6}},{{ 7, 7},{11, 9}},{{15, 7},{19, 9}},{{ 7,10},{19,14}},{{12, 7},{14, 9}}, + {{12, 2},{24, 6}},{{12, 7},{16, 9}},{{20, 7},{24, 9}},{{12,10},{24,14}},{{17, 7},{19, 9}}, + {{17, 2},{29, 6}},{{17, 7},{21, 9}},{{25, 7},{29, 9}},{{17,10},{29,14}},{{22, 7},{24, 9}}, + {{ 2, 7},{14,11}},{{ 2,12},{ 6,14}},{{10,12},{14,14}},{{ 2,15},{14,19}},{{ 7,12},{ 9,14}}, + {{ 7, 7},{19,11}},{{ 7,12},{11,14}},{{15,12},{19,14}},{{ 7,15},{19,19}},{{12,12},{14,14}}, + {{12, 7},{24,11}},{{12,12},{16,14}},{{20,12},{24,14}},{{12,15},{24,19}},{{17,12},{19,14}}, + {{17, 7},{29,11}},{{17,12},{21,14}},{{25,12},{29,14}},{{17,15},{29,19}},{{22,12},{24,14}}, + {{ 2,12},{14,16}},{{ 2,17},{ 6,19}},{{10,17},{14,19}},{{ 2,20},{14,24}},{{ 7,17},{ 9,19}}, + {{ 7,12},{19,16}},{{ 7,17},{11,19}},{{15,17},{19,19}},{{ 7,20},{19,24}},{{12,17},{14,19}}, + {{12,12},{24,16}},{{12,17},{16,19}},{{20,17},{24,19}},{{12,20},{24,24}},{{17,17},{19,19}}, + {{17,12},{29,16}},{{17,17},{21,19}},{{25,17},{29,19}},{{17,20},{29,24}},{{22,17},{24,19}}, + {{ 2,17},{14,21}},{{ 2,22},{ 6,24}},{{10,22},{14,24}},{{ 2,25},{14,29}},{{ 7,22},{ 9,24}}, + {{ 7,17},{19,21}},{{ 7,22},{11,24}},{{15,22},{19,24}},{{ 7,25},{19,29}},{{12,22},{14,24}}, + {{12,17},{24,21}},{{12,22},{16,24}},{{20,22},{24,24}},{{12,25},{24,29}},{{17,22},{19,24}}, + {{17,17},{29,21}},{{17,22},{21,24}},{{25,22},{29,24}},{{17,25},{29,29}},{{22,22},{24,24}}, + {{ 8, 3},{13, 4}},{{ 8, 5},{ 9, 6}},{{12, 5},{13, 6}},{{ 8, 7},{13, 8}},{{10, 5},{11, 6}}, + {{13, 3},{18, 4}},{{13, 5},{14, 6}},{{17, 5},{18, 6}},{{13, 7},{18, 8}},{{15, 5},{16, 6}}, + {{18, 3},{23, 4}},{{18, 5},{19, 6}},{{22, 5},{23, 6}},{{18, 7},{23, 8}},{{20, 5},{21, 6}}, + {{ 3, 8},{ 8, 9}},{{ 3,10},{ 4,11}},{{ 7,10},{ 8,11}},{{ 3,12},{ 8,13}},{{ 5,10},{ 6,11}}, + {{ 8, 8},{13, 9}},{{ 8,10},{ 9,11}},{{12,10},{13,11}},{{ 8,12},{13,13}},{{10,10},{11,11}}, + {{13, 8},{18, 9}},{{13,10},{14,11}},{{17,10},{18,11}},{{13,12},{18,13}},{{15,10},{16,11}}, + {{18, 8},{23, 9}},{{18,10},{19,11}},{{22,10},{23,11}},{{18,12},{23,13}},{{20,10},{21,11}}, + {{23, 8},{28, 9}},{{23,10},{24,11}},{{27,10},{28,11}},{{23,12},{28,13}},{{25,10},{26,11}}, + {{ 3,13},{ 8,14}},{{ 3,15},{ 4,16}},{{ 7,15},{ 8,16}},{{ 3,17},{ 8,18}},{{ 5,15},{ 6,16}}, + {{ 8,13},{13,14}},{{ 8,15},{ 9,16}},{{12,15},{13,16}},{{ 8,17},{13,18}},{{10,15},{11,16}}, + {{13,13},{18,14}},{{13,15},{14,16}},{{17,15},{18,16}},{{13,17},{18,18}},{{15,15},{16,16}}, + {{18,13},{23,14}},{{18,15},{19,16}},{{22,15},{23,16}},{{18,17},{23,18}},{{20,15},{21,16}}, + {{23,13},{28,14}},{{23,15},{24,16}},{{27,15},{28,16}},{{23,17},{28,18}},{{25,15},{26,16}}, + {{ 3,18},{ 8,19}},{{ 3,20},{ 4,21}},{{ 7,20},{ 8,21}},{{ 3,22},{ 8,23}},{{ 5,20},{ 6,21}}, + {{ 8,18},{13,19}},{{ 8,20},{ 9,21}},{{12,20},{13,21}},{{ 8,22},{13,23}},{{10,20},{11,21}}, + {{13,18},{18,19}},{{13,20},{14,21}},{{17,20},{18,21}},{{13,22},{18,23}},{{15,20},{16,21}}, + {{18,18},{23,19}},{{18,20},{19,21}},{{22,20},{23,21}},{{18,22},{23,23}},{{20,20},{21,21}}, + {{23,18},{28,19}},{{23,20},{24,21}},{{27,20},{28,21}},{{23,22},{28,23}},{{25,20},{26,21}}, + {{ 8,23},{13,24}},{{ 8,25},{ 9,26}},{{12,25},{13,26}},{{ 8,27},{13,28}},{{10,25},{11,26}}, + {{13,23},{18,24}},{{13,25},{14,26}},{{17,25},{18,26}},{{13,27},{18,28}},{{15,25},{16,26}}, + {{18,23},{23,24}},{{18,25},{19,26}},{{22,25},{23,26}},{{18,27},{23,28}},{{20,25},{21,26}} +}; +static const ElemCat elem_d5 = { 0, 4, 5, 62, elem_d5_data }; + +static const Block elem_d6_data[] = { + {{ 3, 5},{12,10}},{{ 5, 3},{10,12}}, + {{11, 5},{20,10}},{{13, 3},{18,12}}, + {{19, 5},{28,10}},{{21, 3},{26,12}}, + {{ 3,13},{12,18}},{{ 5,11},{10,20}}, + {{11,13},{20,18}},{{13,11},{18,20}}, + {{19,13},{28,18}},{{21,11},{26,20}}, + {{ 3,21},{12,26}},{{ 5,19},{10,28}}, + {{11,21},{20,26}},{{13,19},{18,28}}, + {{19,21},{28,26}},{{21,19},{26,28}} +}; +static const ElemCat elem_d6 = { 0, 1, 2, 9, elem_d6_data }; + +static const Block elem_d7_data[] = { + {{ 0, 4},{ 3, 7}},{{ 8, 4},{11, 7}},{{ 4, 4},{ 7, 7}}, + {{ 4, 0},{ 7, 3}},{{ 4, 8},{ 7,11}},{{ 4, 4},{ 7, 7}}, + {{ 5, 4},{ 8, 7}},{{13, 4},{16, 7}},{{ 9, 4},{12, 7}}, + {{ 9, 0},{12, 3}},{{ 9, 8},{12,11}},{{ 9, 4},{12, 7}}, + {{10, 4},{13, 7}},{{18, 4},{21, 7}},{{14, 4},{17, 7}}, + {{14, 0},{17, 3}},{{14, 8},{17,11}},{{14, 4},{17, 7}}, + {{15, 4},{18, 7}},{{23, 4},{26, 7}},{{19, 4},{22, 7}}, + {{19, 0},{22, 3}},{{19, 8},{22,11}},{{19, 4},{22, 7}}, + {{20, 4},{23, 7}},{{28, 4},{31, 7}},{{24, 4},{27, 7}}, + {{24, 0},{27, 3}},{{24, 8},{27,11}},{{24, 4},{27, 7}}, + {{ 0, 9},{ 3,12}},{{ 8, 9},{11,12}},{{ 4, 9},{ 7,12}}, + {{ 4, 5},{ 7, 8}},{{ 4,13},{ 7,16}},{{ 4, 9},{ 7,12}}, + {{ 5, 9},{ 8,12}},{{13, 9},{16,12}},{{ 9, 9},{12,12}}, + {{ 9, 5},{12, 8}},{{ 9,13},{12,16}},{{ 9, 9},{12,12}}, + {{10, 9},{13,12}},{{18, 9},{21,12}},{{14, 9},{17,12}}, + {{14, 5},{17, 8}},{{14,13},{17,16}},{{14, 9},{17,12}}, + {{15, 9},{18,12}},{{23, 9},{26,12}},{{19, 9},{22,12}}, + {{19, 5},{22, 8}},{{19,13},{22,16}},{{19, 9},{22,12}}, + {{20, 9},{23,12}},{{28, 9},{31,12}},{{24, 9},{27,12}}, + {{24, 5},{27, 8}},{{24,13},{27,16}},{{24, 9},{27,12}}, + {{ 0,14},{ 3,17}},{{ 8,14},{11,17}},{{ 4,14},{ 7,17}}, + {{ 4,10},{ 7,13}},{{ 4,18},{ 7,21}},{{ 4,14},{ 7,17}}, + {{ 5,14},{ 8,17}},{{13,14},{16,17}},{{ 9,14},{12,17}}, + {{ 9,10},{12,13}},{{ 9,18},{12,21}},{{ 9,14},{12,17}}, + {{10,14},{13,17}},{{18,14},{21,17}},{{14,14},{17,17}}, + {{14,10},{17,13}},{{14,18},{17,21}},{{14,14},{17,17}}, + {{15,14},{18,17}},{{23,14},{26,17}},{{19,14},{22,17}}, + {{19,10},{22,13}},{{19,18},{22,21}},{{19,14},{22,17}}, + {{20,14},{23,17}},{{28,14},{31,17}},{{24,14},{27,17}}, + {{24,10},{27,13}},{{24,18},{27,21}},{{24,14},{27,17}}, + {{ 0,19},{ 3,22}},{{ 8,19},{11,22}},{{ 4,19},{ 7,22}}, + {{ 4,15},{ 7,18}},{{ 4,23},{ 7,26}},{{ 4,19},{ 7,22}}, + {{ 5,19},{ 8,22}},{{13,19},{16,22}},{{ 9,19},{12,22}}, + {{ 9,15},{12,18}},{{ 9,23},{12,26}},{{ 9,19},{12,22}}, + {{10,19},{13,22}},{{18,19},{21,22}},{{14,19},{17,22}}, + {{14,15},{17,18}},{{14,23},{17,26}},{{14,19},{17,22}}, + {{15,19},{18,22}},{{23,19},{26,22}},{{19,19},{22,22}}, + {{19,15},{22,18}},{{19,23},{22,26}},{{19,19},{22,22}}, + {{20,19},{23,22}},{{28,19},{31,22}},{{24,19},{27,22}}, + {{24,15},{27,18}},{{24,23},{27,26}},{{24,19},{27,22}}, + {{ 0,24},{ 3,27}},{{ 8,24},{11,27}},{{ 4,24},{ 7,27}}, + {{ 4,20},{ 7,23}},{{ 4,28},{ 7,31}},{{ 4,24},{ 7,27}}, + {{ 5,24},{ 8,27}},{{13,24},{16,27}},{{ 9,24},{12,27}}, + {{ 9,20},{12,23}},{{ 9,28},{12,31}},{{ 9,24},{12,27}}, + {{10,24},{13,27}},{{18,24},{21,27}},{{14,24},{17,27}}, + {{14,20},{17,23}},{{14,28},{17,31}},{{14,24},{17,27}}, + {{15,24},{18,27}},{{23,24},{26,27}},{{19,24},{22,27}}, + {{19,20},{22,23}},{{19,28},{22,31}},{{19,24},{22,27}}, + {{20,24},{23,27}},{{28,24},{31,27}},{{24,24},{27,27}}, + {{24,20},{27,23}},{{24,28},{27,31}},{{24,24},{27,27}} +}; +static const ElemCat elem_d7 = { 0, 2, 3, 50, elem_d7_data }; + +static const Block elem_d8_data[] = { + {{ 0, 0},{ 7, 3}},{{ 0, 4},{ 7, 7}}, + {{ 8, 0},{11, 7}},{{12, 0},{15, 7}}, + {{ 0, 8},{ 3,15}},{{ 4, 8},{ 7,15}}, + {{ 8, 8},{15,11}},{{ 8,12},{15,15}}, + {{16, 0},{19, 7}},{{20, 0},{23, 7}}, + {{24, 0},{31, 3}},{{24, 4},{31, 7}}, + {{16, 8},{23,11}},{{16,12},{23,15}}, + {{24, 8},{27,15}},{{28, 8},{31,15}}, + {{ 0,16},{ 3,23}},{{ 4,16},{ 7,23}}, + {{ 8,16},{15,19}},{{ 8,20},{15,23}}, + {{ 0,24},{ 7,27}},{{ 0,28},{ 7,31}}, + {{ 8,24},{11,31}},{{12,24},{15,31}}, + {{16,16},{23,19}},{{16,20},{23,23}}, + {{24,16},{27,23}},{{28,16},{31,23}}, + {{16,24},{19,31}},{{20,24},{23,31}}, + {{24,24},{31,27}},{{24,28},{31,31}}, + {{ 0, 0},{ 7,15}},{{ 8, 0},{15,15}}, + {{16, 0},{31, 7}},{{16, 8},{31,15}}, + {{ 0,16},{15,23}},{{ 0,24},{15,31}}, + {{16,16},{23,31}},{{24,16},{31,31}} +}; +static const ElemCat elem_d8 = { 0, 1, 2, 20, elem_d8_data }; + +static const ElemCat* elements[ELEMENT_COUNT] = { &elem_a1, &elem_a2, + &elem_d1, &elem_d2, &elem_d3, &elem_d4, + &elem_d5, &elem_d6, &elem_d7, &elem_d8 }; +#endif /* AVFILTER_SIGNATURE_H */ diff --git a/include/libavfilter/ssim.h b/include/libavfilter/ssim.h new file mode 100644 index 0000000..a6a41aa --- /dev/null +++ b/include/libavfilter/ssim.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2015 Ronald S. Bultje + * + * 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 AVFILTER_SSIM_H +#define AVFILTER_SSIM_H + +#include +#include + +typedef struct SSIMDSPContext { + void (*ssim_4x4_line)(const uint8_t *buf, ptrdiff_t buf_stride, + const uint8_t *ref, ptrdiff_t ref_stride, + int (*sums)[4], int w); + double (*ssim_end_line)(const int (*sum0)[4], const int (*sum1)[4], int w); +} SSIMDSPContext; + +void ff_ssim_init_x86(SSIMDSPContext *dsp); + +#endif /* AVFILTER_SSIM_H */ diff --git a/include/libavfilter/stack_internal.h b/include/libavfilter/stack_internal.h new file mode 100644 index 0000000..ace8886 --- /dev/null +++ b/include/libavfilter/stack_internal.h @@ -0,0 +1,60 @@ +/* + * 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 AVFILTER_STACK_INTERNAL_H +#define AVFILTER_STACK_INTERNAL_H + +enum { + STACK_H = 0, + STACK_V = 1, + STACK_X = 2 +}; + +typedef struct StackItemRegion { + int x; + int y; + int width; + int height; +} StackItemRegion; + +typedef struct StackBaseContext { + HWContext hwctx; /**< must be the first field */ + + FFFrameSync fs; + int mode; + uint8_t fillcolor[4]; + int fillcolor_enable; + StackItemRegion *regions; + + /* Options */ + int nb_inputs; + int shortest; + int tile_width; + int tile_height; + int nb_grid_columns; + int nb_grid_rows; + char *layout; + char *fillcolor_str; +} StackBaseContext; + +static int config_comm_output(AVFilterLink *outlink); +static int stack_init(AVFilterContext *avctx); +static av_cold void stack_uninit(AVFilterContext *avctx); +static int stack_activate(AVFilterContext *avctx); + +#endif /* AVFILTER_STACK_INTERNAL_H */ diff --git a/include/libavfilter/stereo3d.h b/include/libavfilter/stereo3d.h new file mode 100644 index 0000000..54611d1 --- /dev/null +++ b/include/libavfilter/stereo3d.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2015 Paul B Mahol + * + * 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 AVFILTER_STEREO3D_H +#define AVFILTER_STEREO3D_H + +#include +#include + +typedef struct Stereo3DDSPContext { + void (*anaglyph)(uint8_t *dst, uint8_t *lsrc, uint8_t *rsrc, + ptrdiff_t dst_linesize, ptrdiff_t l_linesize, ptrdiff_t r_linesize, + int width, int height, + const int *ana_matrix_r, const int *ana_matrix_g, const int *ana_matrix_b); +} Stereo3DDSPContext; + +void ff_stereo3d_init_x86(Stereo3DDSPContext *dsp); + +#endif /* AVFILTER_STEREO3D_H */ diff --git a/include/libavfilter/textutils.h b/include/libavfilter/textutils.h new file mode 100644 index 0000000..8c2399d --- /dev/null +++ b/include/libavfilter/textutils.h @@ -0,0 +1,229 @@ +/* + * 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 + */ + +/** + * @file + * text utilities + */ + +#ifndef AVFILTER_TEXTUTILS_H +#define AVFILTER_TEXTUTILS_H + +#include "libavutil/bprint.h" +#include "libavutil/eval.h" +#include "libavutil/log.h" +#include "libavutil/parseutils.h" + +/** + * Function used to expand a template sequence in the format + * %{FUNCTION_NAME[:PARAMS]}, defined in the TextExpander object. + */ +typedef struct FFExpandTextFunction { + /** + * name of the function + */ + const char *name; + + /** + * minimum and maximum number of arguments accepted by the + * function in the PARAMS + */ + unsigned argc_min, argc_max; + + /** + * actual function used to perform the expansion + */ + int (*func)(void *ctx, AVBPrint *bp, const char *function_name, unsigned argc, char **args); +} FFExpandTextFunction; + +/** + * Text expander context, used to encapsulate the logic to expand a + * given text template. + * + * A backslash character @samp{\} in a text template, followed by any + * character, always expands to the second character. + * Sequences of the form %{FUNCTION_NAME[:PARAMS]} are expanded using a + * function defined in the object. The text between the braces is a + * function name, possibly followed by arguments separated by ':'. If + * the arguments contain special characters or delimiters (':' or + * '}'), they should be escaped. + */ +typedef struct FFExpandTextContext { + /** + * log context to pass to the function, used for logging and for + * accessing the context for the function + */ + void *log_ctx; + + /** + * list of functions to use to expand sequences in the format + * FUNCTION_NAME{PARAMS} + */ + const FFExpandTextFunction *functions; + + /** + * number of functions + */ + unsigned int functions_nb; +} FFExpandTextContext; + +/** + * Expand text template. + * + * Expand text template defined in text using the logic defined in a text + * expander object. + * + * @param expand_text text expansion context used to expand the text + * @param text template text to expand + * @param bp BPrint object where the expanded text is written to + * @return negative value corresponding to an AVERROR error code in case of + * errors, a non-negative value otherwise + */ +int ff_expand_text(FFExpandTextContext *expand_text, const char *text, AVBPrint *bp); + +/** + * Print PTS representation to an AVBPrint object. + * + * @param log_ctx pointer to av_log object + * @param bp AVBPrint object where the PTS textual representation is written to + * @param pts PTS value expressed as a double to represent + * @param delta delta time parsed by av_parse_time(), added to the PTS + * @param fmt string representing the format to use for printing, can be + * "flt" - use a float representation with 6 decimal digits, + * "hms" - use HH:MM:SS.MMM format, + * "hms24hh" - same as "hms" but wraps the hours in 24hh format + * (so that it is expressed in the range 00-23), + * "localtime" or "gmtime" - expand the PTS according to the + * @code{strftime()} function rules, using either the corresponding + * @code{localtime()} or @code{gmtime()} time + * @param strftime_fmt: @code{strftime()} format to use to represent the PTS in + * case the format "localtime" or "gmtime" was selected, if not specified + * defaults to "%Y-%m-%d %H:%M:%S" + * @return negative value corresponding to an AVERROR error code in case of + * errors, a non-negative value otherwise + */ +int ff_print_pts(void *log_ctx, AVBPrint *bp, double pts, const char *delta, + const char *fmt, const char *strftime_fmt); + +/** + * Print time representation to an AVBPrint object. + * + * @param log_ctx pointer to av_log object + * @param bp AVBPrint object where the time textual representation is written to + * @param strftime_fmt: strftime() format to use to represent the time in case + * if not specified defaults to "%Y-%m-%d %H:%M:%S". The format string is + * extended to support the %[1-6]N after %S which prints fractions of the + * second with optionally specified number of digits, if not specified + * defaults to 3. + * @param localtime use local time to compute the time if non-zero, otherwise + * use UTC + * @return negative value corresponding to an AVERROR error code in case of + * errors, a non-negative value otherwise + */ +int ff_print_time(void *log_ctx, AVBPrint *bp, const char *strftime_fmt, char localtime); + +typedef double (*ff_eval_func2)(void *, double a, double b); + +/** + * Evaluate and print expression to an AVBprint object. + * The output is written as a double representation. + * + * This is a wrapper around av_expr_parse_and_eval() and following the + * same rules. + * + * @param log_ctx pointer to av_log object + * @param bp AVBPrint object where the evaluated expression is written to + * @param expr the expression to be evaluated + * @param fun_names names of the ff_eval_func2 functions used to evaluate the expression + * @param fun_values values of the ff_eval_func2 functions used to evaluate the expression + * @param var_names names of the variables used in the expression + * @param var_values values of the variables used in the expression + * @param eval_ctx evaluation context to be passed to some functions + * + * @return negative value corresponding to an AVERROR error code in case of + * errors, a non-negative value otherwise + */ +int ff_print_eval_expr(void *log_ctx, AVBPrint *bp, + const char *expr, + const char * const *fun_names, const ff_eval_func2 *fun_values, + const char * const *var_names, const double *var_values, + void *eval_ctx); + +/** + * Evaluate and print expression to an AVBprint object, using the + * specified format. + * + * This is a wrapper around av_expr_parse_and_eval() and following the + * same rules. + * + * The format is specified as a printf format character, optionally + * preceded by the positions numbers for zero-padding. + * + * The following formats are accepted: + * - x: use lowercase hexadecimal representation + * - X: use uppercase hexadecimal representation + * - d: use decimal representation + * - u: use unsigned decimal representation + * + * @param log_ctx pointer to av_log object + * @param bp AVBPrint object where the evaluated expression is written to + * @param expr the expression to be evaluated + * @param fun_names names of the ff_eval_func2 functions used to evaluate the expression + * @param fun_values values of the ff_eval_func2 functions used to evaluate the expression + * @param var_names names of the variables used in the expression + * @param var_values values of the variables used in the expression + * @param eval_ctx evaluation context to be passed to some functions + * @param format a character representing the format, to be chosen in xXdu + * @param positions final size of the value representation with 0-padding + * @return negative value corresponding to an AVERROR error code in case of + * errors, a non-negative value otherwise + */ +int ff_print_formatted_eval_expr(void *log_ctx, AVBPrint *bp, + const char *expr, + const char * const *fun_names, const ff_eval_func2 *fun_values, + const char * const *var_names, const double *var_values, + void *eval_ctx, + const char format, int positions); + +/** + * Check if the character is a newline. + * + * @param c character to check + * @return non-negative value in case c is a newline, 0 otherwise + */ +static inline int ff_is_newline(uint32_t c) +{ + return c == '\n' || c == '\r' || c == '\f' || c == '\v'; +} + +/** + * Load text file into the buffer pointed by text. + * + * @param log_ctx pointer to av_log object + * @param textfile filename containing the text to load + * @param text pointer to the text buffer where the loaded text will be + * loaded + * @param text_size pointer to the value to set with the loaded text data, + * including the terminating 0 character + * @return negative value corresponding to an AVERROR error code in case of + * errors, a non-negative value otherwise + */ +int ff_load_textfile(void *log_ctx, const char *textfile, + unsigned char **text, size_t *text_size); + +#endif /* AVFILTER_TEXTUTILS__H */ diff --git a/include/libavfilter/threshold.h b/include/libavfilter/threshold.h new file mode 100644 index 0000000..8b55ad6 --- /dev/null +++ b/include/libavfilter/threshold.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2016 Paul B Mahol + * + * 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 AVFILTER_THRESHOLD_H +#define AVFILTER_THRESHOLD_H + +#include "avfilter.h" +#include "framesync.h" + +typedef struct ThresholdContext { + const AVClass *class; + + int depth; + int planes; + int bpc; + + int nb_planes; + int width[4], height[4]; + + void (*threshold)(const uint8_t *in, const uint8_t *threshold, + const uint8_t *min, const uint8_t *max, + uint8_t *out, + ptrdiff_t ilinesize, ptrdiff_t tlinesize, + ptrdiff_t flinesize, ptrdiff_t slinesize, + ptrdiff_t olinesize, + int w, int h); + + AVFrame *frames[4]; + FFFrameSync fs; +} ThresholdContext; + +void ff_threshold_init_x86(ThresholdContext *s); + +#endif /* AVFILTER_THRESHOLD_H */ diff --git a/include/libavfilter/tinterlace.h b/include/libavfilter/tinterlace.h new file mode 100644 index 0000000..f9b3e63 --- /dev/null +++ b/include/libavfilter/tinterlace.h @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2011 Stefano Sabatini + * Copyright (c) 2010 Baptiste Coudurier + * Copyright (c) 2003 Michael Zucchi + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 General Public License for more details. + * + * You should have received a copy of the GNU 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. + */ + +/** + * @file + * temporal field interlace filter, ported from MPlayer/libmpcodecs + */ +#ifndef AVFILTER_TINTERLACE_H +#define AVFILTER_TINTERLACE_H + +#include "libavutil/bswap.h" +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" +#include "drawutils.h" +#include "avfilter.h" +#include "ccfifo.h" + +#define TINTERLACE_FLAG_VLPF 01 +#define TINTERLACE_FLAG_CVLPF 2 +#define TINTERLACE_FLAG_EXACT_TB 4 +#define TINTERLACE_FLAG_BYPASS_IL 8 + +enum VLPFilter { + VLPF_OFF = 0, + VLPF_LIN = 1, + VLPF_CMP = 2, +}; + +enum TInterlaceMode { + MODE_MERGE = 0, + MODE_DROP_EVEN, + MODE_DROP_ODD, + MODE_PAD, + MODE_INTERLEAVE_TOP, + MODE_INTERLEAVE_BOTTOM, + MODE_INTERLACEX2, + MODE_MERGEX2, + MODE_NB, +}; + +enum InterlaceScanMode { + MODE_TFF = 0, + MODE_BFF, +}; + +typedef struct TInterlaceContext { + const AVClass *class; + int mode; ///< TInterlaceMode, interlace mode selected + AVRational preout_time_base; + int flags; ///< flags affecting interlacing algorithm + int lowpass; ///< legacy interlace filter lowpass mode + int vsub; ///< chroma vertical subsampling + AVFrame *cur; + AVFrame *next; + uint8_t *black_data[2][4]; ///< buffer used to fill padded lines (limited/full) + int black_linesize[4]; + FFDrawContext draw; + FFDrawColor color; + const AVPixFmtDescriptor *csp; + void (*lowpass_line)(uint8_t *dstp, ptrdiff_t width, const uint8_t *srcp, + ptrdiff_t mref, ptrdiff_t pref, int clip_max); + CCFifo cc_fifo; +} TInterlaceContext; + +void ff_tinterlace_init_x86(TInterlaceContext *interlace); + +#endif /* AVFILTER_TINTERLACE_H */ diff --git a/include/libavfilter/transform.h b/include/libavfilter/transform.h new file mode 100644 index 0000000..0344f9c --- /dev/null +++ b/include/libavfilter/transform.h @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2010 Georg Martius + * Copyright (C) 2010 Daniel G. Taylor + * + * 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 AVFILTER_TRANSFORM_H +#define AVFILTER_TRANSFORM_H + +#include + +/** + * @file + * transform input video + * + * All matrices are defined as a single 9-item block of contiguous memory. For + * example, the identity matrix would be: + * + * float *matrix = {1, 0, 0, + * 0, 1, 0, + * 0, 0, 1}; + */ + +enum InterpolateMethod { + INTERPOLATE_NEAREST, //< Nearest-neighbor (fast) + INTERPOLATE_BILINEAR, //< Bilinear + INTERPOLATE_BIQUADRATIC, //< Biquadratic (best) + INTERPOLATE_COUNT, //< Number of interpolation methods +}; + +// Shortcuts for the fastest and best interpolation methods +#define INTERPOLATE_DEFAULT INTERPOLATE_BILINEAR +#define INTERPOLATE_FAST INTERPOLATE_NEAREST +#define INTERPOLATE_BEST INTERPOLATE_BIQUADRATIC + +enum FillMethod { + FILL_BLANK, //< Fill zeroes at blank locations + FILL_ORIGINAL, //< Original image at blank locations + FILL_CLAMP, //< Extruded edge value at blank locations + FILL_MIRROR, //< Mirrored edge at blank locations + FILL_COUNT, //< Number of edge fill methods +}; + +// Shortcuts for fill methods +#define FILL_DEFAULT FILL_ORIGINAL + +/** + * Get an affine transformation matrix from given translation, rotation, and + * zoom factors. The matrix will look like: + * + * [ scale_x * cos(angle), -sin(angle), x_shift, + * sin(angle), scale_y * cos(angle), y_shift, + * 0, 0, 1 ] + * + * @param x_shift horizontal translation + * @param y_shift vertical translation + * @param angle rotation in radians + * @param scale_x x scale percent (1.0 = 100%) + * @param scale_y y scale percent (1.0 = 100%) + * @param matrix 9-item affine transformation matrix + */ +void ff_get_matrix( + float x_shift, + float y_shift, + float angle, + float scale_x, + float scale_y, + float *matrix +); + +/** + * Do an affine transformation with the given interpolation method. This + * multiplies each vector [x,y,1] by the matrix and then interpolates to + * get the final value. + * + * @param src source image + * @param dst destination image + * @param src_stride source image line size in bytes + * @param dst_stride destination image line size in bytes + * @param width image width in pixels + * @param height image height in pixels + * @param matrix 9-item affine transformation matrix + * @param interpolate pixel interpolation method + * @param fill edge fill method + * @return negative on error + */ +int ff_affine_transform(const uint8_t *src, uint8_t *dst, + int src_stride, int dst_stride, + int width, int height, const float *matrix, + enum InterpolateMethod interpolate, + enum FillMethod fill); + +#endif /* AVFILTER_TRANSFORM_H */ diff --git a/include/libavfilter/transpose.h b/include/libavfilter/transpose.h new file mode 100644 index 0000000..4e850ef --- /dev/null +++ b/include/libavfilter/transpose.h @@ -0,0 +1,50 @@ +/* + * 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 AVFILTER_TRANSPOSE_H +#define AVFILTER_TRANSPOSE_H + +#include +#include + +enum PassthroughType { + TRANSPOSE_PT_TYPE_NONE, + TRANSPOSE_PT_TYPE_LANDSCAPE, + TRANSPOSE_PT_TYPE_PORTRAIT, +}; + +enum TransposeDir { + TRANSPOSE_CCLOCK_FLIP, + TRANSPOSE_CLOCK, + TRANSPOSE_CCLOCK, + TRANSPOSE_CLOCK_FLIP, + TRANSPOSE_REVERSAL, // rotate by half-turn + TRANSPOSE_HFLIP, + TRANSPOSE_VFLIP, +}; + +typedef struct TransVtable { + void (*transpose_8x8)(uint8_t *src, ptrdiff_t src_linesize, + uint8_t *dst, ptrdiff_t dst_linesize); + void (*transpose_block)(uint8_t *src, ptrdiff_t src_linesize, + uint8_t *dst, ptrdiff_t dst_linesize, + int w, int h); +} TransVtable; + +void ff_transpose_init_x86(TransVtable *v, int pixstep); + +#endif diff --git a/include/libavfilter/v360.h b/include/libavfilter/v360.h new file mode 100644 index 0000000..b3660c2 --- /dev/null +++ b/include/libavfilter/v360.h @@ -0,0 +1,201 @@ +/* + * Copyright (c) 2019 Eugene Lyapustin + * + * 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 AVFILTER_V360_H +#define AVFILTER_V360_H +#include "avfilter.h" + +enum StereoFormats { + STEREO_2D, + STEREO_SBS, + STEREO_TB, + NB_STEREO_FMTS, +}; + +enum Projections { + EQUIRECTANGULAR, + CUBEMAP_3_2, + CUBEMAP_6_1, + EQUIANGULAR, + FLAT, + DUAL_FISHEYE, + BARREL, + CUBEMAP_1_6, + STEREOGRAPHIC, + MERCATOR, + BALL, + HAMMER, + SINUSOIDAL, + FISHEYE, + PANNINI, + CYLINDRICAL, + PERSPECTIVE, + TETRAHEDRON, + BARREL_SPLIT, + TSPYRAMID, + HEQUIRECTANGULAR, + EQUISOLID, + ORTHOGRAPHIC, + OCTAHEDRON, + CYLINDRICALEA, + NB_PROJECTIONS, +}; + +enum InterpMethod { + NEAREST, + BILINEAR, + LAGRANGE9, + BICUBIC, + LANCZOS, + SPLINE16, + GAUSSIAN, + MITCHELL, + NB_INTERP_METHODS, +}; + +enum Faces { + TOP_LEFT, + TOP_MIDDLE, + TOP_RIGHT, + BOTTOM_LEFT, + BOTTOM_MIDDLE, + BOTTOM_RIGHT, + NB_FACES, +}; + +enum Direction { + RIGHT, ///< Axis +X + LEFT, ///< Axis -X + UP, ///< Axis +Y + DOWN, ///< Axis -Y + FRONT, ///< Axis -Z + BACK, ///< Axis +Z + NB_DIRECTIONS, +}; + +enum Rotation { + ROT_0, + ROT_90, + ROT_180, + ROT_270, + NB_ROTATIONS, +}; + +enum RotationOrder { + YAW, + PITCH, + ROLL, + NB_RORDERS, +}; + +typedef struct XYRemap { + int16_t u[4][4]; + int16_t v[4][4]; + float ker[4][4]; +} XYRemap; + +typedef struct SliceXYRemap { + int16_t *u[2], *v[2]; + int16_t *ker[2]; + uint8_t *mask; +} SliceXYRemap; + +typedef struct V360Context { + const AVClass *class; + int in, out; + int interp; + int alpha; + int reset_rot; + int width, height; + char *in_forder; + char *out_forder; + char *in_frot; + char *out_frot; + char *rorder; + + int in_cubemap_face_order[6]; + int out_cubemap_direction_order[6]; + int in_cubemap_face_rotation[6]; + int out_cubemap_face_rotation[6]; + int rotation_order[3]; + + int in_stereo, out_stereo; + + float in_pad, out_pad; + int fin_pad, fout_pad; + + float yaw, pitch, roll; + float h_offset, v_offset; + + int ih_flip, iv_flip; + int h_flip, v_flip, d_flip; + int in_transpose, out_transpose; + + float h_fov, v_fov, d_fov; + float ih_fov, iv_fov, id_fov; + float flat_range[2]; + float iflat_range[2]; + + float rot_quaternion[2][4]; + + float output_mirror_modifier[3]; + + int in_width, in_height; + int out_width, out_height; + + int pr_width[AV_VIDEO_MAX_PLANES], pr_height[AV_VIDEO_MAX_PLANES]; + + int in_offset_w[AV_VIDEO_MAX_PLANES], in_offset_h[AV_VIDEO_MAX_PLANES]; + int out_offset_w[AV_VIDEO_MAX_PLANES], out_offset_h[AV_VIDEO_MAX_PLANES]; + + int planewidth[AV_VIDEO_MAX_PLANES], planeheight[AV_VIDEO_MAX_PLANES]; + int inplanewidth[AV_VIDEO_MAX_PLANES], inplaneheight[AV_VIDEO_MAX_PLANES]; + int uv_linesize[AV_VIDEO_MAX_PLANES]; + int nb_planes; + int nb_allocated; + int elements; + int mask_size; + int max_value; + int nb_threads; + + SliceXYRemap *slice_remap; + unsigned map[AV_VIDEO_MAX_PLANES]; + + int (*in_transform)(const struct V360Context *s, + const float *vec, int width, int height, + int16_t us[4][4], int16_t vs[4][4], float *du, float *dv); + + int (*out_transform)(const struct V360Context *s, + int i, int j, int width, int height, + float *vec); + + void (*calculate_kernel)(float du, float dv, const XYRemap *rmap, + int16_t *u, int16_t *v, int16_t *ker); + + int (*remap_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs); + + void (*remap_line)(uint8_t *dst, int width, const uint8_t *const src, ptrdiff_t in_linesize, + const int16_t *const u, const int16_t *const v, const int16_t *const ker); +} V360Context; + +void ff_v360_init(V360Context *s, int depth); +void ff_v360_init_x86(V360Context *s, int depth); + +#endif /* AVFILTER_V360_H */ diff --git a/include/libavfilter/vaapi_vpp.h b/include/libavfilter/vaapi_vpp.h new file mode 100644 index 0000000..6764ab0 --- /dev/null +++ b/include/libavfilter/vaapi_vpp.h @@ -0,0 +1,98 @@ +/* + * 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 AVFILTER_VAAPI_VPP_H +#define AVFILTER_VAAPI_VPP_H + +#include +#include + +#include "libavutil/hwcontext.h" +#include "libavutil/hwcontext_vaapi.h" + +#include "avfilter.h" + +static inline VASurfaceID ff_vaapi_vpp_get_surface_id(const AVFrame *frame) +{ + return (uintptr_t)frame->data[3]; +} + +// ARGB black, for VAProcPipelineParameterBuffer.output_background_color. +#define VAAPI_VPP_BACKGROUND_BLACK 0xff000000 + +typedef struct VAAPIVPPContext { + const AVClass *class; + + AVVAAPIDeviceContext *hwctx; + AVBufferRef *device_ref; + + int valid_ids; + VAConfigID va_config; + VAContextID va_context; + + AVBufferRef *input_frames_ref; + AVHWFramesContext *input_frames; + VARectangle input_region; + + enum AVPixelFormat output_format; + int output_width; // computed width + int output_height; // computed height + + VABufferID filter_buffers[VAProcFilterCount]; + int nb_filter_buffers; + + int passthrough; + + int (*build_filter_params)(AVFilterContext *avctx); + + void (*pipeline_uninit)(AVFilterContext *avctx); +} VAAPIVPPContext; + +void ff_vaapi_vpp_ctx_init(AVFilterContext *avctx); + +void ff_vaapi_vpp_ctx_uninit(AVFilterContext *avctx); + +int ff_vaapi_vpp_query_formats(AVFilterContext *avctx); + +void ff_vaapi_vpp_pipeline_uninit(AVFilterContext *avctx); + +int ff_vaapi_vpp_config_input(AVFilterLink *inlink); + +int ff_vaapi_vpp_config_output(AVFilterLink *outlink); + +int ff_vaapi_vpp_init_params(AVFilterContext *avctx, + VAProcPipelineParameterBuffer *params, + const AVFrame *input_frame, + AVFrame *output_frame); + +int ff_vaapi_vpp_make_param_buffers(AVFilterContext *avctx, + int type, + const void *data, + size_t size, + int count); + +int ff_vaapi_vpp_render_picture(AVFilterContext *avctx, + VAProcPipelineParameterBuffer *params, + AVFrame *output_frame); + +int ff_vaapi_vpp_render_pictures(AVFilterContext *avctx, + VAProcPipelineParameterBuffer *params_list, + int count, + AVFrame *output_frame); + +#endif /* AVFILTER_VAAPI_VPP_H */ diff --git a/include/libavfilter/version.h b/include/libavfilter/version.h index ceead91..4d8f28e 100644 --- a/include/libavfilter/version.h +++ b/include/libavfilter/version.h @@ -31,7 +31,7 @@ #include "version_major.h" -#define LIBAVFILTER_VERSION_MINOR 44 +#define LIBAVFILTER_VERSION_MINOR 4 #define LIBAVFILTER_VERSION_MICRO 100 diff --git a/include/libavfilter/version_major.h b/include/libavfilter/version_major.h index de0cf6e..c5e660e 100644 --- a/include/libavfilter/version_major.h +++ b/include/libavfilter/version_major.h @@ -27,7 +27,7 @@ * Libavfilter version macros */ -#define LIBAVFILTER_VERSION_MAJOR 8 +#define LIBAVFILTER_VERSION_MAJOR 10 /** * FF_API_* defines may be placed below to indicate public API that will be @@ -35,8 +35,6 @@ * the public API and may change, break or disappear at any time. */ -#define FF_API_SWS_PARAM_OPTION (LIBAVFILTER_VERSION_MAJOR < 9) -#define FF_API_BUFFERSINK_ALLOC (LIBAVFILTER_VERSION_MAJOR < 9) -#define FF_API_PAD_COUNT (LIBAVFILTER_VERSION_MAJOR < 9) +#define FF_API_LINK_PUBLIC (LIBAVFILTER_VERSION_MAJOR < 11) #endif /* AVFILTER_VERSION_MAJOR_H */ diff --git a/include/libavfilter/vf_blend_init.h b/include/libavfilter/vf_blend_init.h new file mode 100644 index 0000000..956e1cb --- /dev/null +++ b/include/libavfilter/vf_blend_init.h @@ -0,0 +1,202 @@ +/* + * Copyright (c) 2013 Paul B Mahol + * + * 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 AVFILTER_BLEND_INIT_H +#define AVFILTER_BLEND_INIT_H + +#include "config.h" +#include "libavutil/attributes.h" +#include "libavutil/imgutils.h" +#include "blend.h" + +#define DEPTH 8 +#include "blend_modes.c" + +#undef DEPTH +#define DEPTH 9 +#include "blend_modes.c" + +#undef DEPTH +#define DEPTH 10 +#include "blend_modes.c" + +#undef DEPTH +#define DEPTH 12 +#include "blend_modes.c" + +#undef DEPTH +#define DEPTH 14 +#include "blend_modes.c" + +#undef DEPTH +#define DEPTH 16 +#include "blend_modes.c" + +#undef DEPTH +#define DEPTH 32 +#include "blend_modes.c" + +#define COPY(src, depth) \ +static void blend_copy ## src##_##depth(const uint8_t *top, ptrdiff_t top_linesize, \ + const uint8_t *bottom, ptrdiff_t bottom_linesize,\ + uint8_t *dst, ptrdiff_t dst_linesize, \ + ptrdiff_t width, ptrdiff_t height, \ + FilterParams *param, SliceParams *sliceparam) \ +{ \ + av_image_copy_plane(dst, dst_linesize, src, src ## _linesize, \ + width * depth / 8, height); \ +} + +COPY(top, 8) +COPY(bottom, 8) + +COPY(top, 16) +COPY(bottom, 16) + +COPY(top, 32) +COPY(bottom, 32) + +#undef COPY + +#define BLEND_NORMAL(name, type) \ +static void blend_normal_##name(const uint8_t *_top, ptrdiff_t top_linesize, \ + const uint8_t *_bottom, ptrdiff_t bottom_linesize,\ + uint8_t *_dst, ptrdiff_t dst_linesize, \ + ptrdiff_t width, ptrdiff_t height, \ + FilterParams *param, SliceParams *sliceparam) \ +{ \ + const type *top = (const type*)_top; \ + const type *bottom = (const type*)_bottom; \ + type *dst = (type*)_dst; \ + const float opacity = param->opacity; \ + \ + dst_linesize /= sizeof(type); \ + top_linesize /= sizeof(type); \ + bottom_linesize /= sizeof(type); \ + \ + for (int i = 0; i < height; i++) { \ + for (int j = 0; j < width; j++) { \ + dst[j] = top[j] * opacity + bottom[j] * (1.f - opacity); \ + } \ + dst += dst_linesize; \ + top += top_linesize; \ + bottom += bottom_linesize; \ + } \ +} + +BLEND_NORMAL(8bit, uint8_t) +BLEND_NORMAL(16bit, uint16_t) +BLEND_NORMAL(32bit, float) + +#define DEFINE_INIT_BLEND_FUNC(depth, nbits) \ +static av_cold void init_blend_func_##depth##_##nbits##bit(FilterParams *param) \ +{ \ + switch (param->mode) { \ + case BLEND_ADDITION: param->blend = blend_addition_##depth##bit; break; \ + case BLEND_GRAINMERGE: param->blend = blend_grainmerge_##depth##bit; break; \ + case BLEND_AND: param->blend = blend_and_##depth##bit; break; \ + case BLEND_AVERAGE: param->blend = blend_average_##depth##bit; break; \ + case BLEND_BURN: param->blend = blend_burn_##depth##bit; break; \ + case BLEND_DARKEN: param->blend = blend_darken_##depth##bit; break; \ + case BLEND_DIFFERENCE: param->blend = blend_difference_##depth##bit; break; \ + case BLEND_GRAINEXTRACT: param->blend = blend_grainextract_##depth##bit; break; \ + case BLEND_DIVIDE: param->blend = blend_divide_##depth##bit; break; \ + case BLEND_DODGE: param->blend = blend_dodge_##depth##bit; break; \ + case BLEND_EXCLUSION: param->blend = blend_exclusion_##depth##bit; break; \ + case BLEND_EXTREMITY: param->blend = blend_extremity_##depth##bit; break; \ + case BLEND_FREEZE: param->blend = blend_freeze_##depth##bit; break; \ + case BLEND_GLOW: param->blend = blend_glow_##depth##bit; break; \ + case BLEND_HARDLIGHT: param->blend = blend_hardlight_##depth##bit; break; \ + case BLEND_HARDMIX: param->blend = blend_hardmix_##depth##bit; break; \ + case BLEND_HEAT: param->blend = blend_heat_##depth##bit; break; \ + case BLEND_LIGHTEN: param->blend = blend_lighten_##depth##bit; break; \ + case BLEND_LINEARLIGHT: param->blend = blend_linearlight_##depth##bit; break; \ + case BLEND_MULTIPLY: param->blend = blend_multiply_##depth##bit; break; \ + case BLEND_MULTIPLY128: param->blend = blend_multiply128_##depth##bit; break; \ + case BLEND_NEGATION: param->blend = blend_negation_##depth##bit; break; \ + case BLEND_NORMAL: param->blend = blend_normal_##nbits##bit; break; \ + case BLEND_OR: param->blend = blend_or_##depth##bit; break; \ + case BLEND_OVERLAY: param->blend = blend_overlay_##depth##bit; break; \ + case BLEND_PHOENIX: param->blend = blend_phoenix_##depth##bit; break; \ + case BLEND_PINLIGHT: param->blend = blend_pinlight_##depth##bit; break; \ + case BLEND_REFLECT: param->blend = blend_reflect_##depth##bit; break; \ + case BLEND_SCREEN: param->blend = blend_screen_##depth##bit; break; \ + case BLEND_SOFTLIGHT: param->blend = blend_softlight_##depth##bit; break; \ + case BLEND_SUBTRACT: param->blend = blend_subtract_##depth##bit; break; \ + case BLEND_VIVIDLIGHT: param->blend = blend_vividlight_##depth##bit; break; \ + case BLEND_XOR: param->blend = blend_xor_##depth##bit; break; \ + case BLEND_SOFTDIFFERENCE:param->blend=blend_softdifference_##depth##bit;break; \ + case BLEND_GEOMETRIC: param->blend = blend_geometric_##depth##bit; break; \ + case BLEND_HARMONIC: param->blend = blend_harmonic_##depth##bit; break; \ + case BLEND_BLEACH: param->blend = blend_bleach_##depth##bit; break; \ + case BLEND_STAIN: param->blend = blend_stain_##depth##bit; break; \ + case BLEND_INTERPOLATE: param->blend = blend_interpolate_##depth##bit; break; \ + case BLEND_HARDOVERLAY: param->blend = blend_hardoverlay_##depth##bit; break; \ + } \ +} +DEFINE_INIT_BLEND_FUNC(8, 8) +DEFINE_INIT_BLEND_FUNC(9, 16) +DEFINE_INIT_BLEND_FUNC(10, 16) +DEFINE_INIT_BLEND_FUNC(12, 16) +DEFINE_INIT_BLEND_FUNC(14, 16) +DEFINE_INIT_BLEND_FUNC(16, 16) +DEFINE_INIT_BLEND_FUNC(32, 32) + +static av_unused void ff_blend_init(FilterParams *param, int depth) +{ + switch (depth) { + case 8: + init_blend_func_8_8bit(param); + break; + case 9: + init_blend_func_9_16bit(param); + break; + case 10: + init_blend_func_10_16bit(param); + break; + case 12: + init_blend_func_12_16bit(param); + break; + case 14: + init_blend_func_14_16bit(param); + break; + case 16: + init_blend_func_16_16bit(param); + break; + case 32: + init_blend_func_32_32bit(param); + break; + } + + if (param->opacity == 0 && param->mode != BLEND_NORMAL) { + param->blend = depth > 8 ? depth > 16 ? blend_copytop_32 : blend_copytop_16 : blend_copytop_8; + } else if (param->mode == BLEND_NORMAL) { + if (param->opacity == 1) + param->blend = depth > 8 ? depth > 16 ? blend_copytop_32 : blend_copytop_16 : blend_copytop_8; + else if (param->opacity == 0) + param->blend = depth > 8 ? depth > 16 ? blend_copybottom_32 : blend_copybottom_16 : blend_copybottom_8; + } + +#if ARCH_X86 + ff_blend_init_x86(param, depth); +#endif +} + +#endif /* AVFILTER_BLEND_INIT_H */ diff --git a/include/libavfilter/vf_eq.h b/include/libavfilter/vf_eq.h new file mode 100644 index 0000000..50850ea --- /dev/null +++ b/include/libavfilter/vf_eq.h @@ -0,0 +1,135 @@ +/* + * Original MPlayer filters by Richard Felker, Hampa Hug, Daniel Moreno, + * and Michael Niedermeyer. + * + * Copyright (c) 2014 James Darnley + * Copyright (c) 2015 Arwa Arif + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 General Public License for more details. + * + * You should have received a copy of the GNU 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 AVFILTER_EQ_H +#define AVFILTER_EQ_H + +#include "avfilter.h" +#include "libavutil/eval.h" + +static const char *const var_names[] = { + "n", // frame count +#if FF_API_FRAME_PKT + "pos", // frame position +#endif + "r", // frame rate + "t", // timestamp expressed in seconds + NULL +}; + +enum var_name { + VAR_N, +#if FF_API_FRAME_PKT + VAR_POS, +#endif + VAR_R, + VAR_T, + VAR_NB +}; + +typedef struct EQParameters { + void (*adjust)(struct EQParameters *eq, uint8_t *dst, int dst_stride, + const uint8_t *src, int src_stride, int w, int h); + + uint8_t lut[256]; + + double brightness, contrast, gamma, gamma_weight; + int lut_clean; + +} EQParameters; + +typedef struct EQContext { + const AVClass *class; + + EQParameters param[3]; + + char *contrast_expr; + AVExpr *contrast_pexpr; + double contrast; + + char *brightness_expr; + AVExpr *brightness_pexpr; + double brightness; + + char *saturation_expr; + AVExpr *saturation_pexpr; + double saturation; + + char *gamma_expr; + AVExpr *gamma_pexpr; + double gamma; + + char *gamma_weight_expr; + AVExpr *gamma_weight_pexpr; + double gamma_weight; + + char *gamma_r_expr; + AVExpr *gamma_r_pexpr; + double gamma_r; + + char *gamma_g_expr; + AVExpr *gamma_g_pexpr; + double gamma_g; + + char *gamma_b_expr; + AVExpr *gamma_b_pexpr; + double gamma_b; + + double var_values[VAR_NB]; + + void (*process)(struct EQParameters *par, uint8_t *dst, int dst_stride, + const uint8_t *src, int src_stride, int w, int h); + + enum EvalMode { EVAL_MODE_INIT, EVAL_MODE_FRAME, EVAL_MODE_NB } eval_mode; +} EQContext; + +static void process_c(EQParameters *param, uint8_t *dst, int dst_stride, + const uint8_t *src, int src_stride, int w, int h) +{ + int contrast = (int) (param->contrast * 256 * 16); + int brightness = ((int) (100.0 * param->brightness + 100.0) * 511) / 200 - 128 - contrast / 32; + + for (int y = 0; y < h; y++) { + for (int x = 0; x < w; x++) { + int pel = ((src[y * src_stride + x] * contrast) >> 12) + brightness; + + if (pel & ~255) + pel = (-pel) >> 31; + + dst[y * dst_stride + x] = pel; + } + } +} + +void ff_eq_init_x86(EQContext *eq); + +static av_unused void ff_eq_init(EQContext *eq) +{ + eq->process = process_c; +#if ARCH_X86 + ff_eq_init_x86(eq); +#endif +} + +#endif /* AVFILTER_EQ_H */ diff --git a/include/libavfilter/vf_fspp.h b/include/libavfilter/vf_fspp.h new file mode 100644 index 0000000..ee7de3f --- /dev/null +++ b/include/libavfilter/vf_fspp.h @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2003 Michael Niedermayer + * Copyright (C) 2005 Nikolaj Poroshin + * Copyright (c) 2014 Arwa Arif + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 General Public License for more details. + * + * You should have received a copy of the GNU 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 AVFILTER_FSPP_H +#define AVFILTER_FSPP_H + +#include "libavutil/video_enc_params.h" +#include "avfilter.h" + +#define BLOCKSZ 12 +#define MAX_LEVEL 5 + +#define DCTSIZE 8 +#define DCTSIZE_S "8" + +#define FIX(x,s) ((x) * (1 << s) + 0.5) + +#define MULTIPLY16H(x,k) (((x) * (k)) >> 16) +#define THRESHOLD(r,x,t) \ + if(((unsigned)((x) + t)) > t * 2) r = (x); \ + else r = 0; +#define DESCALE(x,n) (((x) + (1 << ((n) - 1))) >> n) + +typedef int32_t int_simd16_t; +static const int16_t FIX_0_382683433 = FIX(0.382683433, 14); +static const int16_t FIX_0_541196100 = FIX(0.541196100, 14); +static const int16_t FIX_0_707106781 = FIX(M_SQRT1_2 , 14); +static const int16_t FIX_1_306562965 = FIX(1.306562965, 14); +static const int16_t FIX_1_414213562_A = FIX(M_SQRT2 , 14); +static const int16_t FIX_1_847759065 = FIX(1.847759065, 13); +static const int16_t FIX_2_613125930 = FIX(-2.613125930, 13); +static const int16_t FIX_1_414213562 = FIX(M_SQRT2 , 13); +static const int16_t FIX_1_082392200 = FIX(1.082392200, 13); + +typedef struct FSPPContext { + AVClass *class; + uint64_t threshold_mtx_noq[8 * 2]; + uint64_t threshold_mtx[8 * 2]; //used in both C & MMX (& later SSE2) versions + + int log2_count; + int strength; + int hsub; + int vsub; + int temp_stride; + int qp; + enum AVVideoEncParamsType qscale_type; + int prev_q; + uint8_t *src; + int16_t *temp; + int8_t *non_b_qp_table; + int non_b_qp_stride; + int use_bframe_qp; + + void (*store_slice)(uint8_t *dst, int16_t *src, + ptrdiff_t dst_stride, ptrdiff_t src_stride, + ptrdiff_t width, ptrdiff_t height, ptrdiff_t log2_scale); + + void (*store_slice2)(uint8_t *dst, int16_t *src, + ptrdiff_t dst_stride, ptrdiff_t src_stride, + ptrdiff_t width, ptrdiff_t height, ptrdiff_t log2_scale); + + void (*mul_thrmat)(int16_t *thr_adr_noq, int16_t *thr_adr, int q); + + void (*column_fidct)(int16_t *thr_adr, int16_t *data, + int16_t *output, int cnt); + + void (*row_idct)(int16_t *workspace, int16_t *output_adr, + ptrdiff_t output_stride, int cnt); + + void (*row_fdct)(int16_t *data, const uint8_t *pixels, + ptrdiff_t line_size, int cnt); + +} FSPPContext; + +void ff_fspp_init_x86(FSPPContext *fspp); + +#endif /* AVFILTER_FSPP_H */ diff --git a/include/libavfilter/vf_gblur_init.h b/include/libavfilter/vf_gblur_init.h new file mode 100644 index 0000000..212db9f --- /dev/null +++ b/include/libavfilter/vf_gblur_init.h @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2011 Pascal Getreuer + * Copyright (c) 2016 Paul B Mahol + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef AVFILTER_GBLUR_INIT_H +#define AVFILTER_GBLUR_INIT_H + +#include "config.h" +#include "libavutil/attributes.h" +#include "libavutil/common.h" +#include "gblur.h" + +static void postscale_c(float *buffer, int length, + float postscale, float min, float max) +{ + for (int i = 0; i < length; i++) { + buffer[i] *= postscale; + buffer[i] = av_clipf(buffer[i], min, max); + } +} + +static void horiz_slice_c(float *buffer, int width, int height, int steps, + float nu, float bscale, float *localbuf) +{ + int x; + for (int y = 0; y < height; y++) { + for (int step = 0; step < steps; step++) { + float *ptr = buffer + width * y; + ptr[0] *= bscale; + + /* Filter rightwards */ + for (x = 1; x < width; x++) + ptr[x] += nu * ptr[x - 1]; + ptr[x = width - 1] *= bscale; + + /* Filter leftwards */ + for (; x > 0; x--) + ptr[x - 1] += nu * ptr[x]; + } + } +} + +static void do_vertical_columns(float *buffer, int width, int height, + int column_begin, int column_end, int steps, + float nu, float boundaryscale, int column_step) +{ + const int numpixels = width * height; + int i; + for (int x = column_begin; x < column_end;) { + for (int step = 0; step < steps; step++) { + float *ptr = buffer + x; + for (int k = 0; k < column_step; k++) { + ptr[k] *= boundaryscale; + } + /* Filter downwards */ + for (i = width; i < numpixels; i += width) { + for (int k = 0; k < column_step; k++) { + ptr[i + k] += nu * ptr[i - width + k]; + } + } + i = numpixels - width; + + for (int k = 0; k < column_step; k++) + ptr[i + k] *= boundaryscale; + + /* Filter upwards */ + for (; i > 0; i -= width) { + for (int k = 0; k < column_step; k++) + ptr[i - width + k] += nu * ptr[i + k]; + } + } + x += column_step; + } +} + +static void verti_slice_c(float *buffer, int width, int height, + int slice_start, int slice_end, int steps, + float nu, float boundaryscale) +{ + int aligned_end = slice_start + (((slice_end - slice_start) >> 3) << 3); + /* Filter vertically along columns (process 8 columns in each step) */ + do_vertical_columns(buffer, width, height, slice_start, aligned_end, + steps, nu, boundaryscale, 8); + /* Filter un-aligned columns one by one */ + do_vertical_columns(buffer, width, height, aligned_end, slice_end, + steps, nu, boundaryscale, 1); +} + +static av_unused void ff_gblur_init(GBlurContext *s) +{ + s->localbuf = NULL; + s->horiz_slice = horiz_slice_c; + s->verti_slice = verti_slice_c; + s->postscale_slice = postscale_c; +#if ARCH_X86 + ff_gblur_init_x86(s); +#endif +} + +#endif /* AVFILTER_GBLUR_INIT_H */ diff --git a/include/libavfilter/vf_hflip_init.h b/include/libavfilter/vf_hflip_init.h new file mode 100644 index 0000000..5c1d69b --- /dev/null +++ b/include/libavfilter/vf_hflip_init.h @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2007 Benoit Fouet + * Copyright (c) 2010 Stefano Sabatini + * + * 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 AVFILTER_HFLIP_INIT_H +#define AVFILTER_HFLIP_INIT_H + +#include + +#include "config.h" +#include "libavutil/attributes.h" +#include "libavutil/error.h" +#include "libavutil/intreadwrite.h" +#include "hflip.h" + +static void hflip_byte_c(const uint8_t *src, uint8_t *dst, int w) +{ + for (int j = 0; j < w; j++) + dst[j] = src[-j]; +} + +static void hflip_short_c(const uint8_t *ssrc, uint8_t *ddst, int w) +{ + const uint16_t *src = (const uint16_t *)ssrc; + uint16_t *dst = (uint16_t *)ddst; + + for (int j = 0; j < w; j++) + dst[j] = src[-j]; +} + +static void hflip_dword_c(const uint8_t *ssrc, uint8_t *ddst, int w) +{ + const uint32_t *src = (const uint32_t *)ssrc; + uint32_t *dst = (uint32_t *)ddst; + + for (int j = 0; j < w; j++) + dst[j] = src[-j]; +} + +static void hflip_b24_c(const uint8_t *src, uint8_t *dst, int w) +{ + const uint8_t *in = src; + uint8_t *out = dst; + + for (int j = 0; j < w; j++, out += 3, in -= 3) { + int32_t v = AV_RB24(in); + + AV_WB24(out, v); + } +} + +static void hflip_b48_c(const uint8_t *src, uint8_t *dst, int w) +{ + const uint8_t *in = src; + uint8_t *out = dst; + + for (int j = 0; j < w; j++, out += 6, in -= 6) { + int64_t v = AV_RB48(in); + + AV_WB48(out, v); + } +} + +static void hflip_qword_c(const uint8_t *ssrc, uint8_t *ddst, int w) +{ + const uint64_t *src = (const uint64_t *)ssrc; + uint64_t *dst = (uint64_t *)ddst; + + for (int j = 0; j < w; j++) + dst[j] = src[-j]; +} + +static av_unused int ff_hflip_init(FlipContext *s, int step[4], int nb_planes) +{ + for (int i = 0; i < nb_planes; i++) { + step[i] *= s->bayer_plus1; + switch (step[i]) { + case 1: s->flip_line[i] = hflip_byte_c; break; + case 2: s->flip_line[i] = hflip_short_c; break; + case 3: s->flip_line[i] = hflip_b24_c; break; + case 4: s->flip_line[i] = hflip_dword_c; break; + case 6: s->flip_line[i] = hflip_b48_c; break; + case 8: s->flip_line[i] = hflip_qword_c; break; + default: + return AVERROR_BUG; + } + } +#if ARCH_X86 + ff_hflip_init_x86(s, step, nb_planes); +#endif + + return 0; +} + +#endif /* AVFILTER_HFLIP_INIT_H */ diff --git a/include/libavfilter/vf_hqdn3d.h b/include/libavfilter/vf_hqdn3d.h new file mode 100644 index 0000000..3279bbc --- /dev/null +++ b/include/libavfilter/vf_hqdn3d.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2003 Daniel Moreno + * Copyright (c) 2010 Baptiste Coudurier + * Copyright (c) 2012 Loren Merritt + * + * This file is part of FFmpeg, ported from MPlayer. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 General Public License for more details. + * + * You should have received a copy of the GNU 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 AVFILTER_HQDN3D_H +#define AVFILTER_HQDN3D_H + +#include +#include + +#include "libavutil/opt.h" + +typedef struct HQDN3DContext { + const AVClass *class; + int16_t *coefs[4]; + uint16_t *line[3]; + uint16_t *frame_prev[3]; + double strength[4]; + int hsub, vsub; + int depth; + void (*denoise_row[17])(uint8_t *src, uint8_t *dst, uint16_t *line_ant, uint16_t *frame_ant, ptrdiff_t w, int16_t *spatial, int16_t *temporal); +} HQDN3DContext; + +#define LUMA_SPATIAL 0 +#define LUMA_TMP 1 +#define CHROMA_SPATIAL 2 +#define CHROMA_TMP 3 + +void ff_hqdn3d_init_x86(HQDN3DContext *hqdn3d); + +#endif /* AVFILTER_HQDN3D_H */ diff --git a/include/libavfilter/vf_idet.h b/include/libavfilter/vf_idet.h new file mode 100644 index 0000000..afd8947 --- /dev/null +++ b/include/libavfilter/vf_idet.h @@ -0,0 +1,80 @@ +/* + * 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 AVFILTER_IDET_H +#define AVFILTER_IDET_H + +#include "libavutil/pixdesc.h" +#include "avfilter.h" + +#define HIST_SIZE 4 + +typedef int (*ff_idet_filter_func)(const uint8_t *a, const uint8_t *b, const uint8_t *c, int w); + +typedef enum { + TFF, + BFF, + PROGRESSIVE, + UNDETERMINED, +} Type; + +typedef enum { + REPEAT_NONE, + REPEAT_TOP, + REPEAT_BOTTOM, +} RepeatedField; + +typedef struct IDETContext { + const AVClass *class; + float interlace_threshold; + float progressive_threshold; + float repeat_threshold; + float half_life; + uint64_t decay_coefficient; + + Type last_type; + + uint64_t repeats[3]; + uint64_t prestat[4]; + uint64_t poststat[4]; + uint64_t total_repeats[3]; + uint64_t total_prestat[4]; + uint64_t total_poststat[4]; + + uint8_t history[HIST_SIZE]; + + AVFrame *cur; + AVFrame *next; + AVFrame *prev; + ff_idet_filter_func filter_line; + + int interlaced_flag_accuracy; + int analyze_interlaced_flag; + int analyze_interlaced_flag_done; + + const AVPixFmtDescriptor *csp; + int eof; +} IDETContext; + +void ff_idet_init_x86(IDETContext *idet, int for_16b); + +/* main fall-back for left-over */ +int ff_idet_filter_line_c(const uint8_t *a, const uint8_t *b, const uint8_t *c, int w); +int ff_idet_filter_line_c_16bit(const uint16_t *a, const uint16_t *b, const uint16_t *c, int w); + +#endif diff --git a/include/libavfilter/vf_nlmeans.h b/include/libavfilter/vf_nlmeans.h new file mode 100644 index 0000000..61377f8 --- /dev/null +++ b/include/libavfilter/vf_nlmeans.h @@ -0,0 +1,45 @@ +/* + * 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 AVFILTER_NLMEANS_H +#define AVFILTER_NLMEANS_H + +#include +#include + +typedef struct NLMeansDSPContext { + void (*compute_safe_ssd_integral_image)(uint32_t *dst, ptrdiff_t dst_linesize_32, + const uint8_t *s1, ptrdiff_t linesize1, + const uint8_t *s2, ptrdiff_t linesize2, + int w, int h); + void (*compute_weights_line)(const uint32_t *const iia, + const uint32_t *const iib, + const uint32_t *const iid, + const uint32_t *const iie, + const uint8_t *const src, + float *total_weight, + float *sum, + const float *const weight_lut, + int max_meaningful_diff, + int startx, int endx); +} NLMeansDSPContext; + +void ff_nlmeans_init_aarch64(NLMeansDSPContext *dsp); +void ff_nlmeans_init_x86(NLMeansDSPContext *dsp); + +#endif /* AVFILTER_NLMEANS_H */ diff --git a/include/libavfilter/vf_nlmeans_init.h b/include/libavfilter/vf_nlmeans_init.h new file mode 100644 index 0000000..06e9329 --- /dev/null +++ b/include/libavfilter/vf_nlmeans_init.h @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2016 Clément Bœsch + * + * 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 AVFILTER_NLMEANS_INIT_H +#define AVFILTER_NLMEANS_INIT_H + +#include +#include + +#include "config.h" +#include "libavutil/avassert.h" +#include "libavutil/macros.h" +#include "vf_nlmeans.h" + +/** + * Compute squared difference of the safe area (the zone where s1 and s2 + * overlap). It is likely the largest integral zone, so it is interesting to do + * as little checks as possible; contrary to the unsafe version of this + * function, we do not need any clipping here. + * + * The line above dst and the column to its left are always readable. + */ +static void compute_safe_ssd_integral_image_c(uint32_t *dst, ptrdiff_t dst_linesize_32, + const uint8_t *s1, ptrdiff_t linesize1, + const uint8_t *s2, ptrdiff_t linesize2, + int w, int h) +{ + const uint32_t *dst_top = dst - dst_linesize_32; + + /* SIMD-friendly assumptions allowed here */ + av_assert2(!(w & 0xf) && w >= 16 && h >= 1); + + for (int y = 0; y < h; y++) { + for (int x = 0; x < w; x += 4) { + const int d0 = s1[x ] - s2[x ]; + const int d1 = s1[x + 1] - s2[x + 1]; + const int d2 = s1[x + 2] - s2[x + 2]; + const int d3 = s1[x + 3] - s2[x + 3]; + + dst[x ] = dst_top[x ] - dst_top[x - 1] + d0*d0; + dst[x + 1] = dst_top[x + 1] - dst_top[x ] + d1*d1; + dst[x + 2] = dst_top[x + 2] - dst_top[x + 1] + d2*d2; + dst[x + 3] = dst_top[x + 3] - dst_top[x + 2] + d3*d3; + + dst[x ] += dst[x - 1]; + dst[x + 1] += dst[x ]; + dst[x + 2] += dst[x + 1]; + dst[x + 3] += dst[x + 2]; + } + s1 += linesize1; + s2 += linesize2; + dst += dst_linesize_32; + dst_top += dst_linesize_32; + } +} + +static void compute_weights_line_c(const uint32_t *const iia, + const uint32_t *const iib, + const uint32_t *const iid, + const uint32_t *const iie, + const uint8_t *const src, + float *total_weight, + float *sum, + const float *const weight_lut, + int max_meaningful_diff, + int startx, int endx) +{ + for (int x = startx; x < endx; x++) { + /* + * M is a discrete map where every entry contains the sum of all the entries + * in the rectangle from the top-left origin of M to its coordinate. In the + * following schema, "i" contains the sum of the whole map: + * + * M = +----------+-----------------+----+ + * | | | | + * | | | | + * | a| b| c| + * +----------+-----------------+----+ + * | | | | + * | | | | + * | | X | | + * | | | | + * | d| e| f| + * +----------+-----------------+----+ + * | | | | + * | g| h| i| + * +----------+-----------------+----+ + * + * The sum of the X box can be calculated with: + * X = e-d-b+a + * + * See https://en.wikipedia.org/wiki/Summed_area_table + * + * The compute*_ssd functions compute the integral image M where every entry + * contains the sum of the squared difference of every corresponding pixels of + * two input planes of the same size as M. + */ + const uint32_t a = iia[x]; + const uint32_t b = iib[x]; + const uint32_t d = iid[x]; + const uint32_t e = iie[x]; + const uint32_t patch_diff_sq = FFMIN(e - d - b + a, max_meaningful_diff); + const float weight = weight_lut[patch_diff_sq]; // exp(-patch_diff_sq * s->pdiff_scale) + + total_weight[x] += weight; + sum[x] += weight * src[x]; + } +} + +static av_unused void ff_nlmeans_init(NLMeansDSPContext *dsp) +{ + dsp->compute_safe_ssd_integral_image = compute_safe_ssd_integral_image_c; + dsp->compute_weights_line = compute_weights_line_c; + +#if ARCH_AARCH64 + ff_nlmeans_init_aarch64(dsp); +#elif ARCH_X86 + ff_nlmeans_init_x86(dsp); +#endif +} + +#endif /* AVFILTER_NLMEANS_INIT_H */ diff --git a/include/libavfilter/vf_noise.h b/include/libavfilter/vf_noise.h new file mode 100644 index 0000000..92998e5 --- /dev/null +++ b/include/libavfilter/vf_noise.h @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2002 Michael Niedermayer + * Copyright (c) 2013 Paul B Mahol + * + * 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 AVFILTER_NOISE_H +#define AVFILTER_NOISE_H + +#include "libavutil/lfg.h" +#include "avfilter.h" + +#define MAX_NOISE 5120 +#define MAX_SHIFT 1024 +#define MAX_RES (MAX_NOISE-MAX_SHIFT) + +#define NOISE_UNIFORM 1 +#define NOISE_TEMPORAL 2 +#define NOISE_AVERAGED 8 +#define NOISE_PATTERN 16 + +typedef struct FilterParams { + int strength; + unsigned flags; + AVLFG lfg; + int seed; + int8_t *noise; + int8_t *prev_shift[MAX_RES][3]; + int rand_shift[MAX_RES]; + int rand_shift_init; +} FilterParams; + +typedef struct NoiseContext { + const AVClass *class; + int nb_planes; + int bytewidth[4]; + int height[4]; + FilterParams all; + FilterParams param[4]; + void (*line_noise)(uint8_t *dst, const uint8_t *src, const int8_t *noise, int len, int shift); + void (*line_noise_avg)(uint8_t *dst, const uint8_t *src, int len, const int8_t * const *shift); +} NoiseContext; + +void ff_line_noise_c(uint8_t *dst, const uint8_t *src, const int8_t *noise, int len, int shift); +void ff_line_noise_avg_c(uint8_t *dst, const uint8_t *src, int len, const int8_t * const *shift); + +void ff_noise_init_x86(NoiseContext *n); + +#endif /* AVFILTER_NOISE_H */ diff --git a/include/libavfilter/vf_overlay.h b/include/libavfilter/vf_overlay.h new file mode 100644 index 0000000..5974964 --- /dev/null +++ b/include/libavfilter/vf_overlay.h @@ -0,0 +1,91 @@ +/* + * 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 AVFILTER_OVERLAY_H +#define AVFILTER_OVERLAY_H + +#include "libavutil/eval.h" +#include "libavutil/pixdesc.h" +#include "framesync.h" +#include "avfilter.h" + +enum var_name { + VAR_MAIN_W, VAR_MW, + VAR_MAIN_H, VAR_MH, + VAR_OVERLAY_W, VAR_OW, + VAR_OVERLAY_H, VAR_OH, + VAR_HSUB, + VAR_VSUB, + VAR_X, + VAR_Y, + VAR_N, +#if FF_API_FRAME_PKT + VAR_POS, +#endif + VAR_T, + VAR_VARS_NB +}; + +enum OverlayFormat { + OVERLAY_FORMAT_YUV420, + OVERLAY_FORMAT_YUV420P10, + OVERLAY_FORMAT_YUV422, + OVERLAY_FORMAT_YUV422P10, + OVERLAY_FORMAT_YUV444, + OVERLAY_FORMAT_YUV444P10, + OVERLAY_FORMAT_RGB, + OVERLAY_FORMAT_GBRP, + OVERLAY_FORMAT_AUTO, + OVERLAY_FORMAT_NB +}; + +typedef struct OverlayContext { + const AVClass *class; + int x, y; ///< position of overlaid picture + + uint8_t main_is_packed_rgb; + uint8_t main_rgba_map[4]; + uint8_t main_has_alpha; + uint8_t overlay_is_packed_rgb; + uint8_t overlay_rgba_map[4]; + uint8_t overlay_has_alpha; + int format; ///< OverlayFormat + int alpha_format; + int eval_mode; ///< EvalMode + + FFFrameSync fs; + + int main_pix_step[4]; ///< steps per pixel for each plane of the main output + int overlay_pix_step[4]; ///< steps per pixel for each plane of the overlay + int hsub, vsub; ///< chroma subsampling values + const AVPixFmtDescriptor *main_desc; ///< format descriptor for main input + + double var_values[VAR_VARS_NB]; + char *x_expr, *y_expr; + + AVExpr *x_pexpr, *y_pexpr; + + int (*blend_row[4])(uint8_t *d, uint8_t *da, uint8_t *s, uint8_t *a, int w, + ptrdiff_t alinesize); + int (*blend_slice)(AVFilterContext *ctx, void *arg, int jobnr, int nb_jobs); +} OverlayContext; + +void ff_overlay_init_x86(OverlayContext *s, int format, int pix_format, + int alpha_format, int main_has_alpha); + +#endif /* AVFILTER_OVERLAY_H */ diff --git a/include/libavfilter/vf_pp7.h b/include/libavfilter/vf_pp7.h new file mode 100644 index 0000000..b7cbb02 --- /dev/null +++ b/include/libavfilter/vf_pp7.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2005 Michael Niedermayer + * Copyright (c) 2014 Arwa Arif + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 General Public License for more details. + * + * You should have received a copy of the GNU 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 AVFILTER_PP7_H +#define AVFILTER_PP7_H + +#include "libavutil/video_enc_params.h" +#include "avfilter.h" + +typedef struct PP7Context { + AVClass *class; + int thres2[99][16]; + + int qp; + int mode; + enum AVVideoEncParamsType qscale_type; + int hsub; + int vsub; + int temp_stride; + uint8_t *src; + + int (*requantize)(struct PP7Context *p, int16_t *src, int qp); + void (*dctB)(int16_t *dst, int16_t *src); + +} PP7Context; + +void ff_pp7_init_x86(PP7Context *pp7); + +#endif /* AVFILTER_PP7_H */ diff --git a/include/libavfilter/vf_pullup.h b/include/libavfilter/vf_pullup.h new file mode 100644 index 0000000..8f59335 --- /dev/null +++ b/include/libavfilter/vf_pullup.h @@ -0,0 +1,71 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 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 General Public License for more details. + * + * You should have received a copy of the GNU 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 AVFILTER_PULLUP_H +#define AVFILTER_PULLUP_H + +#include "avfilter.h" + +typedef struct PullupBuffer { + int lock[2]; + uint8_t *planes[4]; +} PullupBuffer; + +typedef struct PullupField { + int parity; + PullupBuffer *buffer; + unsigned flags; + int breaks; + int affinity; + int *diffs; + int *combs; + int *vars; + struct PullupField *prev, *next; +} PullupField; + +typedef struct PullupFrame { + int lock; + int length; + int parity; + PullupBuffer *ifields[4], *ofields[2]; + PullupBuffer *buffer; +} PullupFrame; + +typedef struct PullupContext { + const AVClass *class; + int junk_left, junk_right, junk_top, junk_bottom; + int metric_plane; + int strict_breaks; + int strict_pairs; + int metric_w, metric_h, metric_length; + int metric_offset; + int nb_planes; + int planewidth[4]; + int planeheight[4]; + PullupField *first, *last, *head; + PullupBuffer buffers[10]; + PullupFrame frame; + + int (*diff)(const uint8_t *a, const uint8_t *b, ptrdiff_t s); + int (*comb)(const uint8_t *a, const uint8_t *b, ptrdiff_t s); + int (*var )(const uint8_t *a, const uint8_t *b, ptrdiff_t s); +} PullupContext; + +void ff_pullup_init_x86(PullupContext *s); + +#endif /* AVFILTER_PULLUP_H */ diff --git a/include/libavfilter/vf_scale_cuda.h b/include/libavfilter/vf_scale_cuda.h new file mode 100644 index 0000000..40d5b9c --- /dev/null +++ b/include/libavfilter/vf_scale_cuda.h @@ -0,0 +1,28 @@ +/* + * This file is part of FFmpeg. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef AVFILTER_SCALE_CUDA_H +#define AVFILTER_SCALE_CUDA_H + +#define SCALE_CUDA_PARAM_DEFAULT 999999.0f + +#endif diff --git a/include/libavfilter/vf_spp.h b/include/libavfilter/vf_spp.h new file mode 100644 index 0000000..0a8b2b5 --- /dev/null +++ b/include/libavfilter/vf_spp.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2003 Michael Niedermayer + * Copyright (c) 2013 Clément Bœsch + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 General Public License for more details. + * + * You should have received a copy of the GNU 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 AVFILTER_SPP_H +#define AVFILTER_SPP_H + +#include "libavutil/video_enc_params.h" +#include "libavcodec/avdct.h" +#include "avfilter.h" + +#define MAX_LEVEL 6 /* quality levels */ + +typedef struct SPPContext { + const AVClass *av_class; + + int log2_count; + int qp; + int mode; + enum AVVideoEncParamsType qscale_type; + int temp_linesize; + uint8_t *src; + uint16_t *temp; + AVDCT *dct; + int8_t *non_b_qp_table; + int non_b_qp_stride; + int use_bframe_qp; + int hsub, vsub; + + void (*store_slice)(uint8_t *dst, const int16_t *src, + int dst_stride, int src_stride, + int width, int height, int log2_scale, + const uint8_t dither[8][8]); + + void (*requantize)(int16_t dst[64], const int16_t src[64], + int qp, const uint8_t *permutation); +} SPPContext; + +void ff_spp_init_x86(SPPContext *s); + +#endif /* AVFILTER_SPP_H */ diff --git a/include/libavfilter/vf_threshold_init.h b/include/libavfilter/vf_threshold_init.h new file mode 100644 index 0000000..64a0a86 --- /dev/null +++ b/include/libavfilter/vf_threshold_init.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2016 Paul B Mahol + * + * 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 AVFILTER_THRESHOLD_INIT_H +#define AVFILTER_THRESHOLD_INIT_H + +#include +#include + +#include "config.h" +#include "libavutil/attributes.h" +#include "threshold.h" + +static void threshold8(const uint8_t *in, const uint8_t *threshold, + const uint8_t *min, const uint8_t *max, + uint8_t *out, + ptrdiff_t ilinesize, ptrdiff_t tlinesize, + ptrdiff_t flinesize, ptrdiff_t slinesize, + ptrdiff_t olinesize, + int w, int h) +{ + for (int y = 0; y < h; y++) { + for (int x = 0; x < w; x++) + out[x] = in[x] <= threshold[x] ? min[x] : max[x]; + + in += ilinesize; + threshold += tlinesize; + min += flinesize; + max += slinesize; + out += olinesize; + } +} + +static void threshold16(const uint8_t *iin, const uint8_t *tthreshold, + const uint8_t *ffirst, const uint8_t *ssecond, + uint8_t *oout, + ptrdiff_t ilinesize, ptrdiff_t tlinesize, + ptrdiff_t flinesize, ptrdiff_t slinesize, + ptrdiff_t olinesize, + int w, int h) +{ + const uint16_t *in = (const uint16_t *)iin; + const uint16_t *threshold = (const uint16_t *)tthreshold; + const uint16_t *min = (const uint16_t *)ffirst; + const uint16_t *max = (const uint16_t *)ssecond; + uint16_t *out = (uint16_t *)oout; + + for (int y = 0; y < h; y++) { + for (int x = 0; x < w; x++) + out[x] = in[x] <= threshold[x] ? min[x] : max[x]; + + in += ilinesize / 2; + threshold += tlinesize / 2; + min += flinesize / 2; + max += slinesize / 2; + out += olinesize / 2; + } +} + +static av_unused void ff_threshold_init(ThresholdContext *s) +{ + if (s->depth == 8) { + s->threshold = threshold8; + s->bpc = 1; + } else { + s->threshold = threshold16; + s->bpc = 2; + } + +#if ARCH_X86 + ff_threshold_init_x86(s); +#endif +} + +#endif /* AVFILTER_THRESHOLD_INIT_H */ diff --git a/include/libavfilter/video.h b/include/libavfilter/video.h new file mode 100644 index 0000000..f44d344 --- /dev/null +++ b/include/libavfilter/video.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2007 Bobby Bingham + * + * 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 AVFILTER_VIDEO_H +#define AVFILTER_VIDEO_H + +#include "avfilter.h" +#include "filters.h" + +/** + * An AVFilterPad array whose only entry has name "default" + * and is of type AVMEDIA_TYPE_VIDEO. + */ +extern const AVFilterPad ff_video_default_filterpad[1]; + +AVFrame *ff_default_get_video_buffer(AVFilterLink *link, int w, int h); +AVFrame *ff_default_get_video_buffer2(AVFilterLink *link, int w, int h, int align); +AVFrame *ff_null_get_video_buffer(AVFilterLink *link, int w, int h); + +/** + * Request a picture buffer with a specific set of permissions. + * + * @param link the output link to the filter from which the buffer will + * be requested + * @param w the minimum width of the buffer to allocate + * @param h the minimum height of the buffer to allocate + * @return on success, an AVFrame owned by the caller, NULL on error + */ +AVFrame *ff_get_video_buffer(AVFilterLink *link, int w, int h); + +/** + * Returns true if a pixel format is "regular YUV", which includes all pixel + * formats that are affected by YUV colorspace negotiation. + */ +int ff_fmt_is_regular_yuv(enum AVPixelFormat fmt); + +/** + * Returns true if a YUV pixel format is forced full range (i.e. YUVJ). + */ +int ff_fmt_is_forced_full_range(enum AVPixelFormat fmt); + +#endif /* AVFILTER_VIDEO_H */ diff --git a/include/libavfilter/vidstabutils.h b/include/libavfilter/vidstabutils.h new file mode 100644 index 0000000..17e1668 --- /dev/null +++ b/include/libavfilter/vidstabutils.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2013 Georg Martius + * + * 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 AVFILTER_VIDSTABUTILS_H +#define AVFILTER_VIDSTABUTILS_H + +#include + +#include "avfilter.h" + +extern const enum AVPixelFormat ff_vidstab_pix_fmts[]; + +/* Conversion routines between libav* and vid.stab */ + +/** + * Converts an AVPixelFormat to a VSPixelFormat. + * + * @param[in] ctx AVFilterContext used for logging + * @param[in] pf AVPixelFormat + * @return a corresponding VSPixelFormat + */ +VSPixelFormat ff_av2vs_pixfmt(AVFilterContext *ctx, enum AVPixelFormat pf); + +/** + * Initialize libvidstab + * + * Sets the memory allocation functions and logging constants to corresponding + * av* versions. + */ +void ff_vs_init(void); + +#endif diff --git a/include/libavfilter/vmaf_motion.h b/include/libavfilter/vmaf_motion.h new file mode 100644 index 0000000..0998450 --- /dev/null +++ b/include/libavfilter/vmaf_motion.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2017 Ronald S. Bultje + * Copyright (c) 2017 Ashish Pratap Singh + * + * 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 AVFILTER_VMAF_MOTION_H +#define AVFILTER_VMAF_MOTION_H + +#include +#include +#include "video.h" + +typedef struct VMAFMotionDSPContext { + uint64_t (*sad)(const uint16_t *img1, const uint16_t *img2, int w, int h, + ptrdiff_t img1_stride, ptrdiff_t img2_stride); + void (*convolution_x)(const uint16_t *filter, int filt_w, const uint16_t *src, + uint16_t *dst, int w, int h, ptrdiff_t src_stride, + ptrdiff_t dst_stride); + void (*convolution_y)(const uint16_t *filter, int filt_w, const uint8_t *src, + uint16_t *dst, int w, int h, ptrdiff_t src_stride, + ptrdiff_t dst_stride); +} VMAFMotionDSPContext; + +void ff_vmafmotion_init_x86(VMAFMotionDSPContext *dsp); + +typedef struct VMAFMotionData { + uint16_t filter[5]; + int width; + int height; + ptrdiff_t stride; + uint16_t *blur_data[2 /* cur, prev */]; + uint16_t *temp_data; + double motion_sum; + uint64_t nb_frames; + VMAFMotionDSPContext vmafdsp; +} VMAFMotionData; + +int ff_vmafmotion_init(VMAFMotionData *data, int w, int h, enum AVPixelFormat fmt); +double ff_vmafmotion_process(VMAFMotionData *data, AVFrame *frame); +double ff_vmafmotion_uninit(VMAFMotionData *data); + +#endif /* AVFILTER_VMAF_MOTION_H */ diff --git a/include/libavfilter/vsrc_ddagrab_shaders.h b/include/libavfilter/vsrc_ddagrab_shaders.h new file mode 100644 index 0000000..894cba8 --- /dev/null +++ b/include/libavfilter/vsrc_ddagrab_shaders.h @@ -0,0 +1,122 @@ +/* + * 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 AVFILTER_VSRC_DDAGRAB_SHADERS_H +#define AVFILTER_VSRC_DDAGRAB_SHADERS_H + +#include + +#if 0 + +cbuffer PARAMS : register ( b0 ) +{ + float2 Dimensions; +}; + +struct VS_INPUT +{ + float3 Pos : POSITION; + float2 Tex : TEXCOORD; +}; + +struct VS_OUTPUT +{ + float4 Pos : SV_POSITION; + float2 Tex : TEXCOORD; +}; + +VS_OUTPUT VS(VS_INPUT input) +{ + VS_OUTPUT output; + float2 center = Dimensions / 2; + output.Pos = float4((input.Pos.xy - center) / center, input.Pos.z, 1.0f); + output.Pos.y *= -1; + output.Tex = input.Tex; + return output; +} + +Texture2D tx : register( t0 ); +SamplerState samLinear : register( s0 ); + +float4 PS(VS_OUTPUT input) : SV_Target +{ + return tx.Sample(samLinear, input.Tex); +} + +#endif + +static const uint8_t vertex_shader_bytes[] = +{ + 68, 88, 66, 67, 207, 194, 142, 193, 255, 85, 32, 72, 116, 77, 242, 140, 26, 229, 67, 69, 1, 0, 0, 0, + 40, 3, 0, 0, 4, 0, 0, 0, 48, 0, 0, 0, 56, 1, 0, 0, 124, 2, 0, 0, 208, 2, 0, 0, + 65, 111, 110, 57, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 254, 255, 204, 0, 0, 0, 52, 0, 0, 0, + 1, 0, 36, 0, 0, 0, 48, 0, 0, 0, 48, 0, 0, 0, 36, 0, 1, 0, 48, 0, 0, 0, 0, 0, + 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 254, 255, 81, 0, 0, 5, 2, 0, 15, 160, + 0, 0, 0, 63, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 31, 0, 0, 2, 5, 0, 0, 128, + 0, 0, 15, 144, 31, 0, 0, 2, 5, 0, 1, 128, 1, 0, 15, 144, 1, 0, 0, 2, 0, 0, 1, 128, + 2, 0, 0, 160, 4, 0, 0, 4, 0, 0, 6, 128, 1, 0, 208, 160, 0, 0, 0, 129, 0, 0, 208, 144, + 5, 0, 0, 3, 0, 0, 9, 128, 0, 0, 0, 128, 1, 0, 100, 160, 6, 0, 0, 2, 1, 0, 1, 128, + 0, 0, 0, 128, 6, 0, 0, 2, 1, 0, 2, 128, 0, 0, 255, 128, 5, 0, 0, 3, 0, 0, 3, 128, + 0, 0, 233, 128, 1, 0, 228, 128, 1, 0, 0, 2, 0, 0, 4, 128, 0, 0, 85, 129, 2, 0, 0, 3, + 0, 0, 3, 192, 0, 0, 232, 128, 0, 0, 228, 160, 4, 0, 0, 4, 0, 0, 12, 192, 0, 0, 170, 144, + 2, 0, 148, 160, 2, 0, 100, 160, 1, 0, 0, 2, 0, 0, 3, 224, 1, 0, 228, 144, 255, 255, 0, 0, + 83, 72, 68, 82, 60, 1, 0, 0, 64, 0, 1, 0, 79, 0, 0, 0, 89, 0, 0, 4, 70, 142, 32, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 95, 0, 0, 3, 114, 16, 16, 0, 0, 0, 0, 0, 95, 0, 0, 3, + 50, 16, 16, 0, 1, 0, 0, 0, 103, 0, 0, 4, 242, 32, 16, 0, 0, 0, 0, 0, 1, 0, 0, 0, + 101, 0, 0, 3, 50, 32, 16, 0, 1, 0, 0, 0, 104, 0, 0, 2, 1, 0, 0, 0, 56, 0, 0, 11, + 50, 0, 16, 0, 0, 0, 0, 0, 70, 128, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 64, 0, 0, + 0, 0, 0, 63, 0, 0, 0, 63, 0, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 14, 194, 0, 16, 0, + 0, 0, 0, 0, 6, 132, 32, 128, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 63, 0, 0, 0, 63, 6, 20, 16, 0, 0, 0, 0, 0, + 14, 0, 0, 7, 50, 0, 16, 0, 0, 0, 0, 0, 230, 10, 16, 0, 0, 0, 0, 0, 70, 0, 16, 0, + 0, 0, 0, 0, 56, 0, 0, 10, 50, 32, 16, 0, 0, 0, 0, 0, 70, 0, 16, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 5, + 66, 32, 16, 0, 0, 0, 0, 0, 42, 16, 16, 0, 0, 0, 0, 0, 54, 0, 0, 5, 130, 32, 16, 0, + 0, 0, 0, 0, 1, 64, 0, 0, 0, 0, 128, 63, 54, 0, 0, 5, 50, 32, 16, 0, 1, 0, 0, 0, + 70, 16, 16, 0, 1, 0, 0, 0, 62, 0, 0, 1, 73, 83, 71, 78, 76, 0, 0, 0, 2, 0, 0, 0, + 8, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, + 7, 7, 0, 0, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, + 3, 3, 0, 0, 80, 79, 83, 73, 84, 73, 79, 78, 0, 84, 69, 88, 67, 79, 79, 82, 68, 0, 171, 171, + 79, 83, 71, 78, 80, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 3, 12, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, + 73, 79, 78, 0, 84, 69, 88, 67, 79, 79, 82, 68, 0, 171, 171, 171 +}; + +static const uint8_t pixel_shader_bytes[] = +{ + 68, 88, 66, 67, 0, 95, 83, 169, 90, 60, 208, 75, 219, 179, 108, 203, 8, 232, 255, 27, 1, 0, 0, 0, + 148, 1, 0, 0, 4, 0, 0, 0, 48, 0, 0, 0, 156, 0, 0, 0, 8, 1, 0, 0, 96, 1, 0, 0, + 65, 111, 110, 57, 100, 0, 0, 0, 100, 0, 0, 0, 0, 2, 255, 255, 60, 0, 0, 0, 40, 0, 0, 0, + 0, 0, 40, 0, 0, 0, 40, 0, 0, 0, 40, 0, 1, 0, 36, 0, 0, 0, 40, 0, 0, 0, 0, 0, + 0, 2, 255, 255, 31, 0, 0, 2, 0, 0, 0, 128, 0, 0, 3, 176, 31, 0, 0, 2, 0, 0, 0, 144, + 0, 8, 15, 160, 66, 0, 0, 3, 0, 0, 15, 128, 0, 0, 228, 176, 0, 8, 228, 160, 1, 0, 0, 2, + 0, 8, 15, 128, 0, 0, 228, 128, 255, 255, 0, 0, 83, 72, 68, 82, 100, 0, 0, 0, 64, 0, 0, 0, + 25, 0, 0, 0, 90, 0, 0, 3, 0, 96, 16, 0, 0, 0, 0, 0, 88, 24, 0, 4, 0, 112, 16, 0, + 0, 0, 0, 0, 85, 85, 0, 0, 98, 16, 0, 3, 50, 16, 16, 0, 1, 0, 0, 0, 101, 0, 0, 3, + 242, 32, 16, 0, 0, 0, 0, 0, 69, 0, 0, 9, 242, 32, 16, 0, 0, 0, 0, 0, 70, 16, 16, 0, + 1, 0, 0, 0, 70, 126, 16, 0, 0, 0, 0, 0, 0, 96, 16, 0, 0, 0, 0, 0, 62, 0, 0, 1, + 73, 83, 71, 78, 80, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 3, 3, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, + 73, 79, 78, 0, 84, 69, 88, 67, 79, 79, 82, 68, 0, 171, 171, 171, 79, 83, 71, 78, 44, 0, 0, 0, + 1, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 84, 97, 114, 103, 101, 116, 0, 171, 171 +}; + +#endif diff --git a/include/libavfilter/vulkan.h b/include/libavfilter/vulkan.h new file mode 100644 index 0000000..928b2e2 --- /dev/null +++ b/include/libavfilter/vulkan.h @@ -0,0 +1,24 @@ +/* + * 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 AVFILTER_VULKAN_H +#define AVFILTER_VULKAN_H + +#include "libavutil/vulkan.h" + +#endif /* AVFILTER_VULKAN_H */ diff --git a/include/libavfilter/vulkan_filter.h b/include/libavfilter/vulkan_filter.h new file mode 100644 index 0000000..d2c1460 --- /dev/null +++ b/include/libavfilter/vulkan_filter.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) Lynne + * + * 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 AVFILTER_VULKAN_FILTER_H +#define AVFILTER_VULKAN_FILTER_H + +#include "avfilter.h" + +#include "vulkan.h" + +/** + * General lavfi IO functions + */ +int ff_vk_filter_init (AVFilterContext *avctx); +int ff_vk_filter_config_input (AVFilterLink *inlink); +int ff_vk_filter_config_output(AVFilterLink *outlink); + +/** + * Can be called manually, if not using ff_vk_filter_config_output. + */ +int ff_vk_filter_init_context(AVFilterContext *avctx, FFVulkanContext *s, + AVBufferRef *frames_ref, + int width, int height, enum AVPixelFormat sw_format); + +/** + * Submit a compute shader with a zero/one input and single out for execution. + */ +int ff_vk_filter_process_simple(FFVulkanContext *vkctx, FFVkExecPool *e, + FFVulkanPipeline *pl, AVFrame *out_f, AVFrame *in_f, + VkSampler sampler, void *push_src, size_t push_size); + +/** + * Submit a compute shader with a single in and single out with 2 stages. + */ +int ff_vk_filter_process_2pass(FFVulkanContext *vkctx, FFVkExecPool *e, + FFVulkanPipeline *pls[2], + AVFrame *out, AVFrame *tmp, AVFrame *in, + VkSampler sampler, void *push_src, size_t push_size); + +/** + * Up to 16 inputs, one output + */ +int ff_vk_filter_process_Nin(FFVulkanContext *vkctx, FFVkExecPool *e, + FFVulkanPipeline *pl, + AVFrame *out, AVFrame *in[], int nb_in, + VkSampler sampler, void *push_src, size_t push_size); + +#endif /* AVFILTER_VULKAN_FILTER_H */ diff --git a/include/libavfilter/vulkan_spirv.h b/include/libavfilter/vulkan_spirv.h new file mode 100644 index 0000000..5638cd9 --- /dev/null +++ b/include/libavfilter/vulkan_spirv.h @@ -0,0 +1,45 @@ +/* + * 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 AVFILTER_VULKAN_SPIRV_H +#define AVFILTER_VULKAN_SPIRV_H + +#include "libavutil/vulkan.h" + +#include "vulkan.h" +#include "config.h" + +typedef struct FFVkSPIRVCompiler { + void *priv; + int (*compile_shader)(struct FFVkSPIRVCompiler *ctx, void *avctx, + struct FFVkSPIRVShader *shd, uint8_t **data, + size_t *size, const char *entrypoint, void **opaque); + void (*free_shader)(struct FFVkSPIRVCompiler *ctx, void **opaque); + void (*uninit)(struct FFVkSPIRVCompiler **ctx); +} FFVkSPIRVCompiler; + +#if CONFIG_LIBGLSLANG +FFVkSPIRVCompiler *ff_vk_glslang_init(void); +#define ff_vk_spirv_init ff_vk_glslang_init +#endif +#if CONFIG_LIBSHADERC +FFVkSPIRVCompiler *ff_vk_shaderc_init(void); +#define ff_vk_spirv_init ff_vk_shaderc_init +#endif + +#endif /* AVFILTER_VULKAN_H */ diff --git a/include/libavfilter/w3fdif.h b/include/libavfilter/w3fdif.h new file mode 100644 index 0000000..9c0b723 --- /dev/null +++ b/include/libavfilter/w3fdif.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2015 Paul B Mahol + * + * 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 AVFILTER_W3FDIF_H +#define AVFILTER_W3FDIF_H + +#include +#include + +typedef struct W3FDIFDSPContext { + void (*filter_simple_low)(int32_t *work_line, + uint8_t *in_lines_cur[2], + const int16_t *coef, int linesize); + void (*filter_complex_low)(int32_t *work_line, + uint8_t *in_lines_cur[4], + const int16_t *coef, int linesize); + void (*filter_simple_high)(int32_t *work_line, + uint8_t *in_lines_cur[3], + uint8_t *in_lines_adj[3], + const int16_t *coef, int linesize); + void (*filter_complex_high)(int32_t *work_line, + uint8_t *in_lines_cur[5], + uint8_t *in_lines_adj[5], + const int16_t *coef, int linesize); + void (*filter_scale)(uint8_t *out_pixel, const int32_t *work_pixel, + int linesize, int max); +} W3FDIFDSPContext; + +void ff_w3fdif_init_x86(W3FDIFDSPContext *dsp, int depth); + +#endif /* AVFILTER_W3FDIF_H */ diff --git a/include/libavfilter/window_func.h b/include/libavfilter/window_func.h new file mode 100644 index 0000000..d4e39c3 --- /dev/null +++ b/include/libavfilter/window_func.h @@ -0,0 +1,236 @@ +/* + * Copyright (c) 2015 Paul B Mahol + * + * 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 AVFILTER_WINDOW_FUNC_H +#define AVFILTER_WINDOW_FUNC_H + +#include +#include "libavutil/avassert.h" +#include "libavutil/common.h" + +enum WindowFunc { WFUNC_RECT, WFUNC_HANNING, WFUNC_HAMMING, WFUNC_BLACKMAN, + WFUNC_BARTLETT, WFUNC_WELCH, WFUNC_FLATTOP, + WFUNC_BHARRIS, WFUNC_BNUTTALL, WFUNC_SINE, WFUNC_NUTTALL, + WFUNC_BHANN, WFUNC_LANCZOS, WFUNC_GAUSS, WFUNC_TUKEY, + WFUNC_DOLPH, WFUNC_CAUCHY, WFUNC_PARZEN, WFUNC_POISSON, + WFUNC_BOHMAN, WFUNC_KAISER, + NB_WFUNC }; + +#define WIN_FUNC_OPTION(win_func_opt_name, win_func_offset, flag, default_window_func) \ + { win_func_opt_name, "set window function", win_func_offset, AV_OPT_TYPE_INT, {.i64 = default_window_func}, 0, NB_WFUNC-1, flag, .unit = "win_func" }, \ + { "rect", "Rectangular", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_RECT}, 0, 0, flag, .unit = "win_func" }, \ + { "bartlett", "Bartlett", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BARTLETT}, 0, 0, flag, .unit = "win_func" }, \ + { "hann", "Hann", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_HANNING}, 0, 0, flag, .unit = "win_func" }, \ + { "hanning", "Hanning", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_HANNING}, 0, 0, flag, .unit = "win_func" }, \ + { "hamming", "Hamming", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_HAMMING}, 0, 0, flag, .unit = "win_func" }, \ + { "blackman", "Blackman", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BLACKMAN}, 0, 0, flag, .unit = "win_func" }, \ + { "welch", "Welch", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_WELCH}, 0, 0, flag, .unit = "win_func" }, \ + { "flattop", "Flat-top", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_FLATTOP}, 0, 0, flag, .unit = "win_func" }, \ + { "bharris", "Blackman-Harris", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BHARRIS}, 0, 0, flag, .unit = "win_func" }, \ + { "bnuttall", "Blackman-Nuttall", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BNUTTALL}, 0, 0, flag, .unit = "win_func" }, \ + { "bhann", "Bartlett-Hann", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BHANN}, 0, 0, flag, .unit = "win_func" }, \ + { "sine", "Sine", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_SINE}, 0, 0, flag, .unit = "win_func" }, \ + { "nuttall", "Nuttall", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_NUTTALL}, 0, 0, flag, .unit = "win_func" }, \ + { "lanczos", "Lanczos", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_LANCZOS}, 0, 0, flag, .unit = "win_func" }, \ + { "gauss", "Gauss", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_GAUSS}, 0, 0, flag, .unit = "win_func" }, \ + { "tukey", "Tukey", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_TUKEY}, 0, 0, flag, .unit = "win_func" }, \ + { "dolph", "Dolph-Chebyshev", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_DOLPH}, 0, 0, flag, .unit = "win_func" }, \ + { "cauchy", "Cauchy", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_CAUCHY}, 0, 0, flag, .unit = "win_func" }, \ + { "parzen", "Parzen", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_PARZEN}, 0, 0, flag, .unit = "win_func" }, \ + { "poisson", "Poisson", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_POISSON}, 0, 0, flag, .unit = "win_func" }, \ + { "bohman", "Bohman", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_BOHMAN}, 0, 0, flag, .unit = "win_func" }, \ + { "kaiser", "Kaiser", 0, AV_OPT_TYPE_CONST, {.i64=WFUNC_KAISER}, 0, 0, flag, .unit = "win_func" } + + +static inline void generate_window_func(float *lut, int N, int win_func, + float *overlap) +{ + int n; + + switch (win_func) { + case WFUNC_RECT: + for (n = 0; n < N; n++) + lut[n] = 1.; + *overlap = 0.; + break; + case WFUNC_BARTLETT: + for (n = 0; n < N; n++) + lut[n] = 1.-fabs((n-(N-1)/2.)/((N-1)/2.)); + *overlap = 0.5; + break; + case WFUNC_HANNING: + for (n = 0; n < N; n++) + lut[n] = .5*(1-cos(2*M_PI*n/(N-1))); + *overlap = 0.5; + break; + case WFUNC_HAMMING: + for (n = 0; n < N; n++) + lut[n] = .54-.46*cos(2*M_PI*n/(N-1)); + *overlap = 0.5; + break; + case WFUNC_BLACKMAN: + for (n = 0; n < N; n++) + lut[n] = .42659-.49656*cos(2*M_PI*n/(N-1))+.076849*cos(4*M_PI*n/(N-1)); + *overlap = 0.661; + break; + case WFUNC_WELCH: + for (n = 0; n < N; n++) + lut[n] = 1.-(n-(N-1)/2.)/((N-1)/2.)*(n-(N-1)/2.)/((N-1)/2.); + *overlap = 0.293; + break; + case WFUNC_FLATTOP: + for (n = 0; n < N; n++) + lut[n] = 1.-1.985844164102*cos( 2*M_PI*n/(N-1))+1.791176438506*cos( 4*M_PI*n/(N-1))- + 1.282075284005*cos( 6*M_PI*n/(N-1))+0.667777530266*cos( 8*M_PI*n/(N-1))- + 0.240160796576*cos(10*M_PI*n/(N-1))+0.056656381764*cos(12*M_PI*n/(N-1))- + 0.008134974479*cos(14*M_PI*n/(N-1))+0.000624544650*cos(16*M_PI*n/(N-1))- + 0.000019808998*cos(18*M_PI*n/(N-1))+0.000000132974*cos(20*M_PI*n/(N-1)); + *overlap = 0.841; + break; + case WFUNC_BHARRIS: + for (n = 0; n < N; n++) + lut[n] = 0.35875-0.48829*cos(2*M_PI*n/(N-1))+0.14128*cos(4*M_PI*n/(N-1))-0.01168*cos(6*M_PI*n/(N-1)); + *overlap = 0.661; + break; + case WFUNC_BNUTTALL: + for (n = 0; n < N; n++) + lut[n] = 0.3635819-0.4891775*cos(2*M_PI*n/(N-1))+0.1365995*cos(4*M_PI*n/(N-1))-0.0106411*cos(6*M_PI*n/(N-1)); + *overlap = 0.661; + break; + case WFUNC_BHANN: + for (n = 0; n < N; n++) + lut[n] = 0.62-0.48*fabs(n/(double)(N-1)-.5)-0.38*cos(2*M_PI*n/(N-1)); + *overlap = 0.5; + break; + case WFUNC_SINE: + for (n = 0; n < N; n++) + lut[n] = sin(M_PI*n/(N-1)); + *overlap = 0.75; + break; + case WFUNC_NUTTALL: + for (n = 0; n < N; n++) + lut[n] = 0.355768-0.487396*cos(2*M_PI*n/(N-1))+0.144232*cos(4*M_PI*n/(N-1))-0.012604*cos(6*M_PI*n/(N-1)); + *overlap = 0.663; + break; + case WFUNC_LANCZOS: + #define SINC(x) (!(x)) ? 1 : sin(M_PI * (x))/(M_PI * (x)); + for (n = 0; n < N; n++) + lut[n] = SINC((2.*n)/(N-1)-1); + *overlap = 0.75; + break; + case WFUNC_GAUSS: + #define SQR(x) ((x)*(x)) + for (n = 0; n < N; n++) + lut[n] = exp(-0.5 * SQR((n-(N-1)/2)/(0.4*(N-1)/2.f))); + *overlap = 0.75; + break; + case WFUNC_TUKEY: + for (n = 0; n < N; n++) { + float M = (N-1)/2.; + + if (FFABS(n - M) >= 0.3 * M) { + lut[n] = 0.5 * (1 + cos((M_PI*(FFABS(n - M) - 0.3 * M))/((1 - 0.3) * M))); + } else { + lut[n] = 1; + } + } + *overlap = 0.33; + break; + case WFUNC_DOLPH: { + double b = cosh(7.6009022095419887 / (N-1)), sum, t, c, norm = 0; + int j; + for (c = 1 - 1 / (b*b), n = (N-1) / 2; n >= 0; --n) { + for (sum = !n, b = t = j = 1; j <= n && sum != t; b *= (n-j) * (1./j), ++j) + t = sum, sum += (b *= c * (N - n - j) * (1./j)); + sum /= (N - 1 - n), norm = norm ? norm : sum, sum /= norm; + lut[n] = sum; + lut[N - 1 - n] = sum; + } + *overlap = 0.5;} + break; + case WFUNC_CAUCHY: + for (n = 0; n < N; n++) { + double x = 2 * ((n / (double)(N - 1)) - .5); + + if (x <= -.5 || x >= .5) { + lut[n] = 0; + } else { + lut[n] = FFMIN(1, fabs(1/(1+4*16*x*x))); + } + } + *overlap = 0.75; + break; + case WFUNC_PARZEN: + for (n = 0; n < N; n++) { + double x = 2 * ((n / (double)(N - 1)) - .5); + + if (x > 0.25 && x <= 0.5) { + lut[n] = -2 * powf(-1 + 2 * x, 3); + } else if (x >= -.5 && x < -.25) { + lut[n] = 2 * powf(1 + 2 * x, 3); + } else if (x >= -.25 && x < 0) { + lut[n] = 1 - 24 * x * x - 48 * x * x * x; + } else if (x >= 0 && x <= .25) { + lut[n] = 1 - 24 * x * x + 48 * x * x * x; + } else { + lut[n] = 0; + } + } + *overlap = 0.75; + break; + case WFUNC_POISSON: + for (n = 0; n < N; n++) { + double x = 2 * ((n / (double)(N - 1)) - .5); + + if (x >= 0 && x <= .5) { + lut[n] = exp(-6*x); + } else if (x < 0 && x >= -.5) { + lut[n] = exp(6*x); + } else { + lut[n] = 0; + } + } + *overlap = 0.75; + break; + case WFUNC_BOHMAN: + for (n = 0; n < N; n++) { + double x = 2 * ((n / (double)(N - 1))) - 1.; + + lut[n] = (1 - fabs(x)) * cos(M_PI*fabs(x)) + 1./M_PI*sin(M_PI*fabs(x)); + } + *overlap = 0.75; + break; + case WFUNC_KAISER: + { + double scale = 1.0 / av_bessel_i0(12.); + for (n = 0; n < N; n++) { + double x = 2.0 / (double)(N - 1); + lut[n] = av_bessel_i0(12. * sqrt(1. - SQR(n * x - 1.))) * scale; + } + *overlap = 0.75; + break; + } + default: + av_assert0(0); + } +} + +#endif /* AVFILTER_WINDOW_FUNC_H */ diff --git a/include/libavfilter/xpsnr.h b/include/libavfilter/xpsnr.h new file mode 100644 index 0000000..eb14e16 --- /dev/null +++ b/include/libavfilter/xpsnr.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2024 Christian R. Helmrich + * Copyright (c) 2024 Christian Lehmann + * Copyright (c) 2024 Christian Stoffers + * + * 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 + */ + +/** + * @file + * Public declaration of DSP context structure of XPSNR measurement filter for FFmpeg. + * + * Authors: Christian Helmrich, Lehmann, and Stoffers, Fraunhofer HHI, Berlin, Germany + */ + +#ifndef AVFILTER_XPSNR_H +#define AVFILTER_XPSNR_H + +#include +#include +#include "libavutil/x86/cpu.h" + +/* public XPSNR DSP structure definition */ + +typedef struct XPSNRDSPContext { + uint64_t (*sse_line) (const uint8_t *buf, const uint8_t *ref, const int w); + uint64_t (*highds_func) (const int x_act, const int y_act, const int w_act, const int h_act, const int16_t *o_m0, const int o); + uint64_t (*diff1st_func)(const uint32_t w_act, const uint32_t h_act, const int16_t *o_m0, int16_t *o_m1, const int o); + uint64_t (*diff2nd_func)(const uint32_t w_act, const uint32_t h_act, const int16_t *o_m0, int16_t *o_m1, int16_t *o_m2, const int o); +} PSNRDSPContext; + +void ff_xpsnr_init_x86(PSNRDSPContext *dsp, const int bpp); + +#endif /* AVFILTER_XPSNR_H */ diff --git a/include/libavfilter/yadif.h b/include/libavfilter/yadif.h new file mode 100644 index 0000000..888ba12 --- /dev/null +++ b/include/libavfilter/yadif.h @@ -0,0 +1,105 @@ +/* + * 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 AVFILTER_YADIF_H +#define AVFILTER_YADIF_H + +#include "libavutil/opt.h" +#include "libavutil/pixdesc.h" +#include "avfilter.h" +#include "ccfifo.h" + +enum YADIFMode { + YADIF_MODE_SEND_FRAME = 0, ///< send 1 frame for each frame + YADIF_MODE_SEND_FIELD = 1, ///< send 1 frame for each field + YADIF_MODE_SEND_FRAME_NOSPATIAL = 2, ///< send 1 frame for each frame but skips spatial interlacing check + YADIF_MODE_SEND_FIELD_NOSPATIAL = 3, ///< send 1 frame for each field but skips spatial interlacing check +}; + +enum YADIFParity { + YADIF_PARITY_TFF = 0, ///< top field first + YADIF_PARITY_BFF = 1, ///< bottom field first + YADIF_PARITY_AUTO = -1, ///< auto detection +}; + +enum YADIFDeint { + YADIF_DEINT_ALL = 0, ///< deinterlace all frames + YADIF_DEINT_INTERLACED = 1, ///< only deinterlace frames marked as interlaced +}; + +enum YADIFCurrentField { + YADIF_FIELD_BACK_END = -1, ///< The last frame in a sequence + YADIF_FIELD_END = 0, ///< The first or last field in a sequence + YADIF_FIELD_NORMAL = 1, ///< A normal field in the middle of a sequence +}; + +typedef struct YADIFContext { + const AVClass *class; + + int mode; ///< YADIFMode + int parity; ///< YADIFParity + int deint; ///< YADIFDeint + + int frame_pending; + + AVFrame *cur; + AVFrame *next; + AVFrame *prev; + AVFrame *out; + + void (*filter)(AVFilterContext *ctx, AVFrame *dstpic, int parity, int tff); + + /** + * Required alignment for filter_line + */ + void (*filter_line)(void *dst, + void *prev, void *cur, void *next, + int w, int prefs, int mrefs, int parity, int mode); + void (*filter_edges)(void *dst, void *prev, void *cur, void *next, + int w, int prefs, int mrefs, int parity, int mode); + + const AVPixFmtDescriptor *csp; + int eof; + uint8_t *temp_line; + int temp_line_size; + CCFifo cc_fifo; + + /* + * An algorithm that treats first and/or last fields in a sequence + * differently can use this to detect those cases. It is the algorithm's + * responsibility to set the value to YADIF_FIELD_NORMAL after processing + * the first field. + */ + int current_field; ///< YADIFCurrentField + + int pts_multiplier; +} YADIFContext; + +void ff_yadif_init_x86(YADIFContext *yadif); + +int ff_yadif_filter_frame(AVFilterLink *link, AVFrame *frame); + +int ff_yadif_request_frame(AVFilterLink *link); + +int ff_yadif_config_output_common(AVFilterLink *outlink); + +void ff_yadif_uninit(AVFilterContext *ctx); + +extern const AVOption ff_yadif_options[]; + +#endif /* AVFILTER_YADIF_H */ diff --git a/include/libavformat/aiff.h b/include/libavformat/aiff.h new file mode 100644 index 0000000..7c7c55c --- /dev/null +++ b/include/libavformat/aiff.h @@ -0,0 +1,35 @@ +/* + * AIFF/AIFF-C muxer/demuxer common header + * Copyright (c) 2006 Patrick Guimond + * + * 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 + */ + +/** + * @file + * common header for AIFF muxer and demuxer + */ + +#ifndef AVFORMAT_AIFF_H +#define AVFORMAT_AIFF_H + +#include "internal.h" + +extern const AVCodecTag ff_codec_aiff_tags[]; +extern const AVCodecTag *const ff_aiff_codec_tags_list[]; + +#endif /* AVFORMAT_AIFF_H */ diff --git a/include/libavformat/apetag.h b/include/libavformat/apetag.h new file mode 100644 index 0000000..49cd10e --- /dev/null +++ b/include/libavformat/apetag.h @@ -0,0 +1,45 @@ +/* + * APE tag handling + * Copyright (c) 2007 Benjamin Zores + * based upon libdemac from Dave Chapman. + * + * 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 AVFORMAT_APETAG_H +#define AVFORMAT_APETAG_H + +#include "avformat.h" + +#define APE_TAG_PREAMBLE "APETAGEX" +#define APE_TAG_VERSION 2000 +#define APE_TAG_FOOTER_BYTES 32 +#define APE_TAG_HEADER_BYTES 32 + +/** + * Read and parse an APE tag + * + * @return offset of the tag start in the file + */ +int64_t ff_ape_parse_tag(AVFormatContext *s); + +/** + * Write an APE tag into a file. + */ +int ff_ape_write_tag(AVFormatContext *s); + +#endif /* AVFORMAT_APETAG_H */ diff --git a/include/libavformat/argo_asf.h b/include/libavformat/argo_asf.h new file mode 100644 index 0000000..948459d --- /dev/null +++ b/include/libavformat/argo_asf.h @@ -0,0 +1,72 @@ +/* + * Argonaut Games ASF (de)muxer + * + * Copyright (C) 2020 Zane van Iperen (zane@zanevaniperen.com) + * + * 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 AVFORMAT_ARGO_ASF_H +#define AVFORMAT_ARGO_ASF_H + +#include +#include "libavutil/macros.h" + +#include "avformat.h" + +#define ASF_TAG MKTAG('A', 'S', 'F', '\0') +#define ASF_FILE_HEADER_SIZE 24 +#define ASF_CHUNK_HEADER_SIZE 20 +#define ASF_SAMPLE_COUNT 32 +#define ASF_MIN_BUFFER_SIZE FFMAX(ASF_FILE_HEADER_SIZE, ASF_CHUNK_HEADER_SIZE) +#define ASF_NAME_SIZE 8 + +typedef struct ArgoASFFileHeader { + uint32_t magic; /*< Magic Number, {'A', 'S', 'F', '\0'} */ + uint16_t version_major; /*< File Major Version. */ + uint16_t version_minor; /*< File Minor Version. */ + uint32_t num_chunks; /*< No. chunks in the file. */ + uint32_t chunk_offset; /*< Offset to the first chunk from the start of the file. */ + char name[ASF_NAME_SIZE + 1]; /*< Name, +1 for NULL-terminator. */ +} ArgoASFFileHeader; + +typedef struct ArgoASFChunkHeader { + uint32_t num_blocks; /*< No. blocks in the chunk. */ + uint32_t num_samples; /*< No. samples per channel in a block. Always 32. */ + uint32_t unk1; /*< Unknown */ + uint16_t sample_rate; /*< Sample rate. */ + uint16_t unk2; /*< Unknown. */ + uint32_t flags; /*< Stream flags. */ +} ArgoASFChunkHeader; + +enum { + ASF_CF_BITS_PER_SAMPLE = (1 << 0), /*< 16-bit if set, 8 otherwise. */ + ASF_CF_STEREO = (1 << 1), /*< Stereo if set, mono otherwise. */ + ASF_CF_ALWAYS1_1 = (1 << 2), /*< Unknown, always seems to be set. */ + ASF_CF_ALWAYS1_2 = (1 << 3), /*< Unknown, always seems to be set. */ + + ASF_CF_ALWAYS1 = ASF_CF_ALWAYS1_1 | ASF_CF_ALWAYS1_2, + ASF_CF_ALWAYS0 = ~(ASF_CF_BITS_PER_SAMPLE | ASF_CF_STEREO | ASF_CF_ALWAYS1) +}; + +void ff_argo_asf_parse_file_header(ArgoASFFileHeader *hdr, const uint8_t *buf); +int ff_argo_asf_validate_file_header(AVFormatContext *s, const ArgoASFFileHeader *hdr); +void ff_argo_asf_parse_chunk_header(ArgoASFChunkHeader *hdr, const uint8_t *buf); +int ff_argo_asf_fill_stream(AVFormatContext *s, AVStream *st, const ArgoASFFileHeader *fhdr, + const ArgoASFChunkHeader *ckhdr); + +#endif /* AVFORMAT_ARGO_ASF_H */ diff --git a/include/libavformat/asf.h b/include/libavformat/asf.h new file mode 100644 index 0000000..01cc4f7 --- /dev/null +++ b/include/libavformat/asf.h @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2000, 2001 Fabrice Bellard + * + * 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 AVFORMAT_ASF_H +#define AVFORMAT_ASF_H + +#include +#include "avformat.h" +#include "metadata.h" +#include "riff.h" + +typedef enum ASFDataType { + ASF_UNICODE = 0, + ASF_BYTE_ARRAY = 1, + ASF_BOOL = 2, + ASF_DWORD = 3, + ASF_QWORD = 4, + ASF_WORD = 5, + ASF_GUID = 6, +}ASFDataType; + +typedef struct ASFMainHeader { + ff_asf_guid guid; ///< generated by client computer + uint64_t file_size; /**< in bytes + * invalid if broadcasting */ + uint64_t create_time; /**< time of creation, in 100-nanosecond units since 1.1.1601 + * invalid if broadcasting */ + uint64_t play_time; /**< play time, in 100-nanosecond units + * invalid if broadcasting */ + uint64_t send_time; /**< time to send file, in 100-nanosecond units + * invalid if broadcasting (could be ignored) */ + uint32_t preroll; /**< timestamp of the first packet, in milliseconds + * if nonzero - subtract from time */ + uint32_t ignore; ///< preroll is 64 bits - but let's just ignore it + uint32_t flags; /**< 0x01 - broadcast + * 0x02 - seekable + * rest is reserved should be 0 */ + uint32_t min_pktsize; /**< size of a data packet + * invalid if broadcasting */ + uint32_t max_pktsize; /**< shall be the same as for min_pktsize + * invalid if broadcasting */ + uint32_t max_bitrate; /**< bandwidth of stream in bps + * should be the sum of bitrates of the + * individual media streams */ +} ASFMainHeader; + + +typedef struct ASFIndex { + uint32_t packet_number; + uint16_t packet_count; + uint64_t send_time; + uint64_t offset; +} ASFIndex; + +extern const ff_asf_guid ff_asf_header; +extern const ff_asf_guid ff_asf_file_header; +extern const ff_asf_guid ff_asf_stream_header; +extern const ff_asf_guid ff_asf_ext_stream_header; +extern const ff_asf_guid ff_asf_audio_stream; +extern const ff_asf_guid ff_asf_audio_conceal_spread; +extern const ff_asf_guid ff_asf_video_stream; +extern const ff_asf_guid ff_asf_jfif_media; +extern const ff_asf_guid ff_asf_video_conceal_none; +extern const ff_asf_guid ff_asf_command_stream; +extern const ff_asf_guid ff_asf_comment_header; +extern const ff_asf_guid ff_asf_codec_comment_header; +extern const ff_asf_guid ff_asf_codec_comment1_header; +extern const ff_asf_guid ff_asf_data_header; +extern const ff_asf_guid ff_asf_head1_guid; +extern const ff_asf_guid ff_asf_head2_guid; +extern const ff_asf_guid ff_asf_extended_content_header; +extern const ff_asf_guid ff_asf_simple_index_header; +extern const ff_asf_guid ff_asf_ext_stream_embed_stream_header; +extern const ff_asf_guid ff_asf_ext_stream_audio_stream; +extern const ff_asf_guid ff_asf_metadata_header; +extern const ff_asf_guid ff_asf_metadata_library_header; +extern const ff_asf_guid ff_asf_marker_header; +extern const ff_asf_guid ff_asf_reserved_4; +extern const ff_asf_guid ff_asf_my_guid; +extern const ff_asf_guid ff_asf_language_guid; +extern const ff_asf_guid ff_asf_content_encryption; +extern const ff_asf_guid ff_asf_ext_content_encryption; +extern const ff_asf_guid ff_asf_digital_signature; +extern const ff_asf_guid ff_asf_extended_stream_properties_object; +extern const ff_asf_guid ff_asf_group_mutual_exclusion_object; +extern const ff_asf_guid ff_asf_mutex_language; + +extern const AVMetadataConv ff_asf_metadata_conv[]; + +/** + * Handles both attached pictures as well as id3 tags. + * + * @return Returns < 0 on error, 1 if the type of the byte array + * is unsupported by this function and 0 otherwise. + */ +int ff_asf_handle_byte_array(AVFormatContext *s, const char *name, + int val_len); + + +#define ASF_PACKET_FLAG_ERROR_CORRECTION_PRESENT 0x80 //1000 0000 + + +// ASF data packet structure +// ========================= +// +// +// ----------------------------------- +// | Error Correction Data | Optional +// ----------------------------------- +// | Payload Parsing Information (PPI) | +// ----------------------------------- +// | Payload Data | +// ----------------------------------- +// | Padding Data | +// ----------------------------------- + + +// PPI_FLAG - Payload parsing information flags +#define ASF_PPI_FLAG_MULTIPLE_PAYLOADS_PRESENT 1 + +#define ASF_PPI_FLAG_SEQUENCE_FIELD_IS_BYTE 0x02 //0000 0010 +#define ASF_PPI_FLAG_SEQUENCE_FIELD_IS_WORD 0x04 //0000 0100 +#define ASF_PPI_FLAG_SEQUENCE_FIELD_IS_DWORD 0x06 //0000 0110 +#define ASF_PPI_MASK_SEQUENCE_FIELD_SIZE 0x06 //0000 0110 + +#define ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_BYTE 0x08 //0000 1000 +#define ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_WORD 0x10 //0001 0000 +#define ASF_PPI_FLAG_PADDING_LENGTH_FIELD_IS_DWORD 0x18 //0001 1000 +#define ASF_PPI_MASK_PADDING_LENGTH_FIELD_SIZE 0x18 //0001 1000 + +#define ASF_PPI_FLAG_PACKET_LENGTH_FIELD_IS_BYTE 0x20 //0010 0000 +#define ASF_PPI_FLAG_PACKET_LENGTH_FIELD_IS_WORD 0x40 //0100 0000 +#define ASF_PPI_FLAG_PACKET_LENGTH_FIELD_IS_DWORD 0x60 //0110 0000 +#define ASF_PPI_MASK_PACKET_LENGTH_FIELD_SIZE 0x60 //0110 0000 + +// PL_FLAG - Payload flags +#define ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_BYTE 0x01 //0000 0001 +#define ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_WORD 0x02 //0000 0010 +#define ASF_PL_FLAG_REPLICATED_DATA_LENGTH_FIELD_IS_DWORD 0x03 //0000 0011 +#define ASF_PL_MASK_REPLICATED_DATA_LENGTH_FIELD_SIZE 0x03 //0000 0011 + +#define ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_BYTE 0x04 //0000 0100 +#define ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_WORD 0x08 //0000 1000 +#define ASF_PL_FLAG_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_IS_DWORD 0x0c //0000 1100 +#define ASF_PL_MASK_OFFSET_INTO_MEDIA_OBJECT_LENGTH_FIELD_SIZE 0x0c //0000 1100 + +#define ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_BYTE 0x10 //0001 0000 +#define ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_WORD 0x20 //0010 0000 +#define ASF_PL_FLAG_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_IS_DWORD 0x30 //0011 0000 +#define ASF_PL_MASK_MEDIA_OBJECT_NUMBER_LENGTH_FIELD_SIZE 0x30 //0011 0000 + +#define ASF_PL_FLAG_STREAM_NUMBER_LENGTH_FIELD_IS_BYTE 0x40 //0100 0000 +#define ASF_PL_MASK_STREAM_NUMBER_LENGTH_FIELD_SIZE 0xc0 //1100 0000 + +#define ASF_PL_FLAG_PAYLOAD_LENGTH_FIELD_IS_BYTE 0x40 //0100 0000 +#define ASF_PL_FLAG_PAYLOAD_LENGTH_FIELD_IS_WORD 0x80 //1000 0000 +#define ASF_PL_MASK_PAYLOAD_LENGTH_FIELD_SIZE 0xc0 //1100 0000 + +#define ASF_PL_FLAG_KEY_FRAME 0x80 //1000 0000 + +#endif /* AVFORMAT_ASF_H */ diff --git a/include/libavformat/asfcrypt.h b/include/libavformat/asfcrypt.h new file mode 100644 index 0000000..8b80d63 --- /dev/null +++ b/include/libavformat/asfcrypt.h @@ -0,0 +1,29 @@ +/* + * ASF decryption + * Copyright (c) 2007 Reimar Doeffinger + * + * 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 AVFORMAT_ASFCRYPT_H +#define AVFORMAT_ASFCRYPT_H + +#include + +void ff_asfcrypt_dec(const uint8_t key[20], uint8_t *data, int len); + +#endif /* AVFORMAT_ASFCRYPT_H */ diff --git a/include/libavformat/ast.h b/include/libavformat/ast.h new file mode 100644 index 0000000..b629f7e --- /dev/null +++ b/include/libavformat/ast.h @@ -0,0 +1,31 @@ +/* + * AST common code + * Copyright (c) 2012 James Almer + * + * 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 AVFORMAT_AST_H +#define AVFORMAT_AST_H + +#include "avformat.h" +#include "internal.h" + +extern const AVCodecTag ff_codec_ast_tags[]; +extern const AVCodecTag *const ff_ast_codec_tags_list[]; + +#endif /* AVFORMAT_AST_H */ diff --git a/include/libavformat/av1.h b/include/libavformat/av1.h new file mode 100644 index 0000000..a393fbb --- /dev/null +++ b/include/libavformat/av1.h @@ -0,0 +1,106 @@ +/* + * AV1 helper functions for muxers + * + * 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 AVFORMAT_AV1_H +#define AVFORMAT_AV1_H + +#include + +#include "avio.h" + +typedef struct AV1SequenceParameters { + uint8_t profile; + uint8_t level; + uint8_t tier; + uint8_t bitdepth; + uint8_t monochrome; + uint8_t chroma_subsampling_x; + uint8_t chroma_subsampling_y; + uint8_t chroma_sample_position; + uint8_t color_description_present_flag; + uint8_t color_primaries; + uint8_t transfer_characteristics; + uint8_t matrix_coefficients; + uint8_t color_range; +} AV1SequenceParameters; + +/** + * Filter out AV1 OBUs not meant to be present in ISOBMFF sample data and write + * the resulting bitstream to the provided AVIOContext. + * + * @param pb pointer to the AVIOContext where the filtered bitstream shall be + * written; may be NULL, in which case nothing is written. + * @param buf input data buffer + * @param size size of the input data buffer + * + * @return the amount of bytes written (or would have been written in case + * pb had been supplied) in case of success, a negative AVERROR + * code in case of failure + * @note One can use NULL for pb to just get the output size. + */ +int ff_av1_filter_obus(AVIOContext *pb, const uint8_t *buf, int size); + +/** + * Filter out AV1 OBUs not meant to be present in ISOBMFF sample data and return + * the result in a data buffer, avoiding allocations and copies if possible. + * + * @param in input data buffer + * @param out pointer to pointer for the returned buffer. In case of success, + * it is independently allocated if and only if `*out` differs from in. + * @param size size of the input data buffer. The size of the resulting output + * data buffer will be written here + * @param offset offset of the returned data inside `*out`: It runs from + * `*out + offset` (inclusive) to `*out + offset + size` + * (exclusive); is zero if `*out` is independently allocated. + * + * @return 0 in case of success, a negative AVERROR code in case of failure. + * On failure, *out and *size are unchanged + * @note *out will be treated as unintialized on input and will not be freed. + */ +int ff_av1_filter_obus_buf(const uint8_t *in, uint8_t **out, + int *size, int *offset); + +/** + * Parses a Sequence Header from the the provided buffer. + * + * @param seq pointer to the AV1SequenceParameters where the parsed values will + * be written + * @param buf input data buffer + * @param size size in bytes of the input data buffer + * + * @return >= 0 in case of success, a negative AVERROR code in case of failure + */ +int ff_av1_parse_seq_header(AV1SequenceParameters *seq, const uint8_t *buf, int size); + +/** + * Writes AV1 extradata (Sequence Header and Metadata OBUs) to the provided + * AVIOContext. + * + * @param pb pointer to the AVIOContext where the av1C box shall be written + * @param buf input data buffer + * @param size size in bytes of the input data buffer + * @param write_seq_header If 1, Sequence Header OBU will be written inside the + * av1C box. Otherwise, Sequence Header OBU will be omitted. + * + * @return >= 0 in case of success, a negative AVERROR code in case of failure + */ +int ff_isom_write_av1c(AVIOContext *pb, const uint8_t *buf, int size, int write_seq_header); + +#endif /* AVFORMAT_AV1_H */ diff --git a/include/libavformat/avc.h b/include/libavformat/avc.h new file mode 100644 index 0000000..e36108a --- /dev/null +++ b/include/libavformat/avc.h @@ -0,0 +1,46 @@ +/* + * AVC helper functions for muxers + * Copyright (c) 2008 Aurelien Jacobs + * + * 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 AVFORMAT_AVC_H +#define AVFORMAT_AVC_H + +#include +#include "libavutil/rational.h" +#include "avio.h" + +int ff_isom_write_avcc(AVIOContext *pb, const uint8_t *data, int len); +int ff_avc_write_annexb_extradata(const uint8_t *in, uint8_t **buf, int *size); + +typedef struct { + uint8_t id; + uint8_t profile_idc; + uint8_t level_idc; + uint8_t constraint_set_flags; + uint8_t chroma_format_idc; + uint8_t bit_depth_luma; + uint8_t bit_depth_chroma; + uint8_t frame_mbs_only_flag; + AVRational sar; +} H264SPS; + +int ff_avc_decode_sps(H264SPS *sps, const uint8_t *buf, int buf_size); + +#endif /* AVFORMAT_AVC_H */ diff --git a/include/libavformat/avformat.h b/include/libavformat/avformat.h index f12fa7d..56c1c80 100755 --- a/include/libavformat/avformat.h +++ b/include/libavformat/avformat.h @@ -307,10 +307,8 @@ * @} */ -#include #include /* FILE */ -#include "libavcodec/codec.h" #include "libavcodec/codec_par.h" #include "libavcodec/defs.h" #include "libavcodec/packet.h" @@ -325,13 +323,13 @@ * to avoid unnecessary rebuilds. When included externally, keep including * the full version information. */ #include "libavformat/version.h" + +#include "libavutil/frame.h" +#include "libavcodec/codec.h" #endif struct AVFormatContext; -struct AVStream; - -struct AVDeviceInfoList; -struct AVDeviceCapabilitiesQuery; +struct AVFrame; /** * @defgroup metadata_api Public Metadata API @@ -487,7 +485,9 @@ typedef struct AVProbeData { #define AVFMT_NOBINSEARCH 0x2000 /**< Format does not allow to fall back on binary search via read_timestamp */ #define AVFMT_NOGENSEARCH 0x4000 /**< Format does not allow to fall back on generic search */ #define AVFMT_NO_BYTE_SEEK 0x8000 /**< Format does not allow seeking by bytes */ -#define AVFMT_ALLOW_FLUSH 0x10000 /**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. */ +#if FF_API_ALLOW_FLUSH +#define AVFMT_ALLOW_FLUSH 0x10000 /**< @deprecated: Just send a NULL packet if you want to flush a muxer. */ +#endif #define AVFMT_TS_NONSTRICT 0x20000 /**< Format does not require strictly increasing timestamps, but they must still be monotonic */ @@ -523,7 +523,7 @@ typedef struct AVOutputFormat { /** * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, - * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH, + * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, * AVFMT_TS_NONSTRICT, AVFMT_TS_NEGATIVE */ int flags; @@ -536,114 +536,6 @@ typedef struct AVOutputFormat { const AVClass *priv_class; ///< AVClass for the private context - - /***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - */ - /** - * size of private data so that it can be allocated in the wrapper - */ - int priv_data_size; - - /** - * Internal flags. See FF_FMT_FLAG_* in internal.h. - */ - int flags_internal; - - int (*write_header)(struct AVFormatContext *); - /** - * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags, - * pkt can be NULL in order to flush data buffered in the muxer. - * When flushing, return 0 if there still is more data to flush, - * or 1 if everything was flushed and there is no more buffered - * data. - */ - int (*write_packet)(struct AVFormatContext *, AVPacket *pkt); - int (*write_trailer)(struct AVFormatContext *); - /** - * A format-specific function for interleavement. - * If unset, packets will be interleaved by dts. - * - * @param s An AVFormatContext for output. pkt will be added to - * resp. taken from its packet buffer. - * @param[in,out] pkt A packet to be interleaved if has_packet is set; - * also used to return packets. If no packet is returned - * (e.g. on error), pkt is blank on return. - * @param flush 1 if no further packets are available as input and - * all remaining packets should be output. - * @param has_packet If set, pkt contains a packet to be interleaved - * on input; otherwise pkt is blank on input. - * @return 1 if a packet was output, 0 if no packet could be output, - * < 0 if an error occurred - */ - int (*interleave_packet)(struct AVFormatContext *s, AVPacket *pkt, - int flush, int has_packet); - /** - * Test if the given codec can be stored in this container. - * - * @return 1 if the codec is supported, 0 if it is not. - * A negative number if unknown. - * MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC - */ - int (*query_codec)(enum AVCodecID id, int std_compliance); - - void (*get_output_timestamp)(struct AVFormatContext *s, int stream, - int64_t *dts, int64_t *wall); - /** - * Allows sending messages from application to device. - */ - int (*control_message)(struct AVFormatContext *s, int type, - void *data, size_t data_size); - - /** - * Write an uncoded AVFrame. - * - * See av_write_uncoded_frame() for details. - * - * The library will free *frame afterwards, but the muxer can prevent it - * by setting the pointer to NULL. - */ - int (*write_uncoded_frame)(struct AVFormatContext *, int stream_index, - AVFrame **frame, unsigned flags); - /** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - */ - int (*get_device_list)(struct AVFormatContext *s, struct AVDeviceInfoList *device_list); - enum AVCodecID data_codec; /**< default data codec */ - /** - * Initialize format. May allocate data here, and set any AVFormatContext or - * AVStream parameters that need to be set before packets are sent. - * This method must not write output. - * - * Return 0 if streams were fully configured, 1 if not, negative AVERROR on failure - * - * Any allocations made here must be freed in deinit(). - */ - int (*init)(struct AVFormatContext *); - /** - * Deinitialize format. If present, this is called whenever the muxer is being - * destroyed, regardless of whether or not the header has been written. - * - * If a trailer is being written, this is called after write_trailer(). - * - * This is called if init() fails as well. - */ - void (*deinit)(struct AVFormatContext *); - /** - * Set up any necessary bitstream filtering and extract any extra data needed - * for the global header. - * - * @note pkt might have been directly forwarded by a meta-muxer; therefore - * pkt->stream_index as well as the pkt's timebase might be invalid. - * Return 0 if more packets from this stream must be checked; 1 if not. - */ - int (*check_bitstream)(struct AVFormatContext *s, struct AVStream *st, - const AVPacket *pkt); } AVOutputFormat; /** * @} @@ -691,103 +583,6 @@ typedef struct AVInputFormat { * @see av_probe_input_format2 */ const char *mime_type; - - /***************************************************************** - * No fields below this line are part of the public API. They - * may not be used outside of libavformat and can be changed and - * removed at will. - * New public fields should be added right above. - ***************************************************************** - */ - /** - * Raw demuxers store their codec ID here. - */ - int raw_codec_id; - - /** - * Size of private data so that it can be allocated in the wrapper. - */ - int priv_data_size; - - /** - * Internal flags. See FF_FMT_FLAG_* in internal.h. - */ - int flags_internal; - - /** - * Tell if a given file has a chance of being parsed as this format. - * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes - * big so you do not have to check for that unless you need more. - */ - int (*read_probe)(const AVProbeData *); - - /** - * Read the format header and initialize the AVFormatContext - * structure. Return 0 if OK. 'avformat_new_stream' should be - * called to create new streams. - */ - int (*read_header)(struct AVFormatContext *); - - /** - * Read one packet and put it in 'pkt'. pts and flags are also - * set. 'avformat_new_stream' can be called only if the flag - * AVFMTCTX_NOHEADER is used and only in the calling thread (not in a - * background thread). - * @return 0 on success, < 0 on error. - * Upon returning an error, pkt must be unreferenced by the caller. - */ - int (*read_packet)(struct AVFormatContext *, AVPacket *pkt); - - /** - * Close the stream. The AVFormatContext and AVStreams are not - * freed by this function - */ - int (*read_close)(struct AVFormatContext *); - - /** - * Seek to a given timestamp relative to the frames in - * stream component stream_index. - * @param stream_index Must not be -1. - * @param flags Selects which direction should be preferred if no exact - * match is available. - * @return >= 0 on success (but not necessarily the new offset) - */ - int (*read_seek)(struct AVFormatContext *, - int stream_index, int64_t timestamp, int flags); - - /** - * Get the next timestamp in stream[stream_index].time_base units. - * @return the timestamp or AV_NOPTS_VALUE if an error occurred - */ - int64_t (*read_timestamp)(struct AVFormatContext *s, int stream_index, - int64_t *pos, int64_t pos_limit); - - /** - * Start/resume playing - only meaningful if using a network-based format - * (RTSP). - */ - int (*read_play)(struct AVFormatContext *); - - /** - * Pause playing - only meaningful if using a network-based format - * (RTSP). - */ - int (*read_pause)(struct AVFormatContext *); - - /** - * Seek to timestamp ts. - * Seeking will be done so that the point from which all active streams - * can be presented successfully will be closest to ts and within min/max_ts. - * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. - */ - int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags); - - /** - * Returns device list with it properties. - * @see avdevice_list_devices() for more details. - */ - int (*get_device_list)(struct AVFormatContext *s, struct AVDeviceInfoList *device_list); - } AVInputFormat; /** * @} @@ -909,15 +704,20 @@ typedef struct AVIndexEntry { */ #define AV_DISPOSITION_METADATA (1 << 18) /** - * The audio stream is intended to be mixed with another stream before - * presentation. - * Corresponds to mix_type=0 in mpegts. + * The stream is intended to be mixed with another stream before presentation. + * Used for example to signal the stream contains an image part of a HEIF grid, + * or for mix_type=0 in mpegts. */ #define AV_DISPOSITION_DEPENDENT (1 << 19) /** * The video stream contains still images. */ #define AV_DISPOSITION_STILL_IMAGE (1 << 20) +/** + * The video stream contains multiple layers, e.g. stereoscopic views (cf. H.264 + * Annex G/H, or HEVC Annex F). + */ +#define AV_DISPOSITION_MULTILAYER (1 << 21) /** * @return The AV_DISPOSITION_* flag corresponding to disp or a negative error @@ -948,12 +748,10 @@ const char *av_disposition_to_string(int disposition); * sizeof(AVStream) must not be used outside libav*. */ typedef struct AVStream { -#if FF_API_AVSTREAM_CLASS /** * A class for @ref avoptions. Set on stream creation. */ const AVClass *av_class; -#endif int index; /**< stream index in AVFormatContext */ /** @@ -963,6 +761,17 @@ typedef struct AVStream { */ int id; + /** + * Codec parameters associated with this stream. Allocated and freed by + * libavformat in avformat_new_stream() and avformat_free_context() + * respectively. + * + * - demuxing: filled by libavformat on stream creation or in + * avformat_find_stream_info() + * - muxing: filled by the caller before avformat_write_header() + */ + AVCodecParameters *codecpar; + void *priv_data; /** @@ -1038,6 +847,7 @@ typedef struct AVStream { */ AVPacket attached_pic; +#if FF_API_AVSTREAM_SIDE_DATA /** * An array of side data that applies to the whole stream (i.e. the * container does not allow it to change between packets). @@ -1054,13 +864,20 @@ typedef struct AVStream { * * Freed by libavformat in avformat_free_context(). * - * @see av_format_inject_global_side_data() + * @deprecated use AVStream's @ref AVCodecParameters.coded_side_data + * "codecpar side data". */ + attribute_deprecated AVPacketSideData *side_data; /** * The number of elements in the AVStream.side_data array. + * + * @deprecated use AVStream's @ref AVCodecParameters.nb_coded_side_data + * "codecpar side data". */ + attribute_deprecated int nb_side_data; +#endif /** * Flags indicating events happening on the stream, a combination of @@ -1098,17 +915,6 @@ typedef struct AVStream { */ AVRational r_frame_rate; - /** - * Codec parameters associated with this stream. Allocated and freed by - * libavformat in avformat_new_stream() and avformat_free_context() - * respectively. - * - * - demuxing: filled by libavformat on stream creation or in - * avformat_find_stream_info() - * - muxing: filled by the caller before avformat_write_header() - */ - AVCodecParameters *codecpar; - /** * Number of bits in timestamps. Used for wrapping control. * @@ -1119,14 +925,282 @@ typedef struct AVStream { int pts_wrap_bits; } AVStream; -struct AVCodecParserContext *av_stream_get_parser(const AVStream *s); +/** + * AVStreamGroupTileGrid holds information on how to combine several + * independent images on a single canvas for presentation. + * + * The output should be a @ref AVStreamGroupTileGrid.background "background" + * colored @ref AVStreamGroupTileGrid.coded_width "coded_width" x + * @ref AVStreamGroupTileGrid.coded_height "coded_height" canvas where a + * @ref AVStreamGroupTileGrid.nb_tiles "nb_tiles" amount of tiles are placed in + * the order they appear in the @ref AVStreamGroupTileGrid.offsets "offsets" + * array, at the exact offset described for them. In particular, if two or more + * tiles overlap, the image with higher index in the + * @ref AVStreamGroupTileGrid.offsets "offsets" array takes priority. + * Note that a single image may be used multiple times, i.e. multiple entries + * in @ref AVStreamGroupTileGrid.offsets "offsets" may have the same value of + * idx. + * + * The following is an example of a simple grid with 3 rows and 4 columns: + * + * +---+---+---+---+ + * | 0 | 1 | 2 | 3 | + * +---+---+---+---+ + * | 4 | 5 | 6 | 7 | + * +---+---+---+---+ + * | 8 | 9 |10 |11 | + * +---+---+---+---+ + * + * Assuming all tiles have a dimension of 512x512, the + * @ref AVStreamGroupTileGrid.offsets "offset" of the topleft pixel of + * the first @ref AVStreamGroup.streams "stream" in the group is "0,0", the + * @ref AVStreamGroupTileGrid.offsets "offset" of the topleft pixel of + * the second @ref AVStreamGroup.streams "stream" in the group is "512,0", the + * @ref AVStreamGroupTileGrid.offsets "offset" of the topleft pixel of + * the fifth @ref AVStreamGroup.streams "stream" in the group is "0,512", the + * @ref AVStreamGroupTileGrid.offsets "offset", of the topleft pixel of + * the sixth @ref AVStreamGroup.streams "stream" in the group is "512,512", + * etc. + * + * The following is an example of a canvas with overlaping tiles: + * + * +-----------+ + * | %%%%% | + * |***%%3%%@@@| + * |**0%%%%%2@@| + * |***##1@@@@@| + * | ##### | + * +-----------+ + * + * Assuming a canvas with size 1024x1024 and all tiles with a dimension of + * 512x512, a possible @ref AVStreamGroupTileGrid.offsets "offset" for the + * topleft pixel of the first @ref AVStreamGroup.streams "stream" in the group + * would be 0x256, the @ref AVStreamGroupTileGrid.offsets "offset" for the + * topleft pixel of the second @ref AVStreamGroup.streams "stream" in the group + * would be 256x512, the @ref AVStreamGroupTileGrid.offsets "offset" for the + * topleft pixel of the third @ref AVStreamGroup.streams "stream" in the group + * would be 512x256, and the @ref AVStreamGroupTileGrid.offsets "offset" for + * the topleft pixel of the fourth @ref AVStreamGroup.streams "stream" in the + * group would be 256x0. + * + * sizeof(AVStreamGroupTileGrid) is not a part of the ABI and may only be + * allocated by avformat_stream_group_create(). + */ +typedef struct AVStreamGroupTileGrid { + const AVClass *av_class; + + /** + * Amount of tiles in the grid. + * + * Must be > 0. + */ + unsigned int nb_tiles; + + /** + * Width of the canvas. + * + * Must be > 0. + */ + int coded_width; + /** + * Width of the canvas. + * + * Must be > 0. + */ + int coded_height; + + /** + * An @ref nb_tiles sized array of offsets in pixels from the topleft edge + * of the canvas, indicating where each stream should be placed. + * It must be allocated with the av_malloc() family of functions. + * + * - demuxing: set by libavformat, must not be modified by the caller. + * - muxing: set by the caller before avformat_write_header(). + * + * Freed by libavformat in avformat_free_context(). + */ + struct { + /** + * Index of the stream in the group this tile references. + * + * Must be < @ref AVStreamGroup.nb_streams "nb_streams". + */ + unsigned int idx; + /** + * Offset in pixels from the left edge of the canvas where the tile + * should be placed. + */ + int horizontal; + /** + * Offset in pixels from the top edge of the canvas where the tile + * should be placed. + */ + int vertical; + } *offsets; + + /** + * The pixel value per channel in RGBA format used if no pixel of any tile + * is located at a particular pixel location. + * + * @see av_image_fill_color(). + * @see av_parse_color(). + */ + uint8_t background[4]; + + /** + * Offset in pixels from the left edge of the canvas where the actual image + * meant for presentation starts. + * + * This field must be >= 0 and < @ref coded_width. + */ + int horizontal_offset; + /** + * Offset in pixels from the top edge of the canvas where the actual image + * meant for presentation starts. + * + * This field must be >= 0 and < @ref coded_height. + */ + int vertical_offset; + + /** + * Width of the final image for presentation. + * + * Must be > 0 and <= (@ref coded_width - @ref horizontal_offset). + * When it's not equal to (@ref coded_width - @ref horizontal_offset), the + * result of (@ref coded_width - width - @ref horizontal_offset) is the + * amount amount of pixels to be cropped from the right edge of the + * final image before presentation. + */ + int width; + /** + * Height of the final image for presentation. + * + * Must be > 0 and <= (@ref coded_height - @ref vertical_offset). + * When it's not equal to (@ref coded_height - @ref vertical_offset), the + * result of (@ref coded_height - height - @ref vertical_offset) is the + * amount amount of pixels to be cropped from the bottom edge of the + * final image before presentation. + */ + int height; +} AVStreamGroupTileGrid; /** - * Returns the pts of the last muxed packet + its duration + * AVStreamGroupLCEVC is meant to define the relation between video streams + * and a data stream containing LCEVC enhancement layer NALUs. * - * the retuned value is undefined when used with a demuxer. + * No more than one stream of @ref AVCodecParameters.codec_type "codec_type" + * AVMEDIA_TYPE_DATA shall be present, and it must be of + * @ref AVCodecParameters.codec_id "codec_id" AV_CODEC_ID_LCEVC. */ -int64_t av_stream_get_end_pts(const AVStream *st); +typedef struct AVStreamGroupLCEVC { + const AVClass *av_class; + + /** + * Index of the LCEVC data stream in AVStreamGroup. + */ + unsigned int lcevc_index; + /** + * Width of the final stream for presentation. + */ + int width; + /** + * Height of the final image for presentation. + */ + int height; +} AVStreamGroupLCEVC; + +enum AVStreamGroupParamsType { + AV_STREAM_GROUP_PARAMS_NONE, + AV_STREAM_GROUP_PARAMS_IAMF_AUDIO_ELEMENT, + AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION, + AV_STREAM_GROUP_PARAMS_TILE_GRID, + AV_STREAM_GROUP_PARAMS_LCEVC, +}; + +struct AVIAMFAudioElement; +struct AVIAMFMixPresentation; + +typedef struct AVStreamGroup { + /** + * A class for @ref avoptions. Set by avformat_stream_group_create(). + */ + const AVClass *av_class; + + void *priv_data; + + /** + * Group index in AVFormatContext. + */ + unsigned int index; + + /** + * Group type-specific group ID. + * + * decoding: set by libavformat + * encoding: may set by the user + */ + int64_t id; + + /** + * Group type + * + * decoding: set by libavformat on group creation + * encoding: set by avformat_stream_group_create() + */ + enum AVStreamGroupParamsType type; + + /** + * Group type-specific parameters + */ + union { + struct AVIAMFAudioElement *iamf_audio_element; + struct AVIAMFMixPresentation *iamf_mix_presentation; + struct AVStreamGroupTileGrid *tile_grid; + struct AVStreamGroupLCEVC *lcevc; + } params; + + /** + * Metadata that applies to the whole group. + * + * - demuxing: set by libavformat on group creation + * - muxing: may be set by the caller before avformat_write_header() + * + * Freed by libavformat in avformat_free_context(). + */ + AVDictionary *metadata; + + /** + * Number of elements in AVStreamGroup.streams. + * + * Set by avformat_stream_group_add_stream() must not be modified by any other code. + */ + unsigned int nb_streams; + + /** + * A list of streams in the group. New entries are created with + * avformat_stream_group_add_stream(). + * + * - demuxing: entries are created by libavformat on group creation. + * If AVFMTCTX_NOHEADER is set in ctx_flags, then new entries may also + * appear in av_read_frame(). + * - muxing: entries are created by the user before avformat_write_header(). + * + * Freed by libavformat in avformat_free_context(). + */ + AVStream **streams; + + /** + * Stream group disposition - a combination of AV_DISPOSITION_* flags. + * This field currently applies to all defined AVStreamGroupParamsType. + * + * - demuxing: set by libavformat when creating the group or in + * avformat_find_stream_info(). + * - muxing: may be set by the caller before avformat_write_header(). + */ + int disposition; +} AVStreamGroup; + +struct AVCodecParserContext *av_stream_get_parser(const AVStream *s); #define AV_PROGRAM_RUNNING 1 @@ -1282,6 +1356,39 @@ typedef struct AVFormatContext { */ AVStream **streams; + /** + * Number of elements in AVFormatContext.stream_groups. + * + * Set by avformat_stream_group_create(), must not be modified by any other code. + */ + unsigned int nb_stream_groups; + /** + * A list of all stream groups in the file. New groups are created with + * avformat_stream_group_create(), and filled with avformat_stream_group_add_stream(). + * + * - demuxing: groups may be created by libavformat in avformat_open_input(). + * If AVFMTCTX_NOHEADER is set in ctx_flags, then new groups may also + * appear in av_read_frame(). + * - muxing: groups may be created by the user before avformat_write_header(). + * + * Freed by libavformat in avformat_free_context(). + */ + AVStreamGroup **stream_groups; + + /** + * Number of chapters in AVChapter array. + * When muxing, chapters are normally written in the file header, + * so nb_chapters should normally be initialized before write_header + * is called. Some muxers (e.g. mov and mkv) can also write chapters + * in the trailer. To write chapters in the trailer, nb_chapters + * must be zero when write_header is called and non-zero when + * write_trailer is called. + * - muxing: set by user + * - demuxing: set by libavformat + */ + unsigned int nb_chapters; + AVChapter **chapters; + /** * input or output URL. Unlike the old filename field, this field has no * length restriction. @@ -1349,11 +1456,10 @@ typedef struct AVFormatContext { */ #define AVFMT_FLAG_BITEXACT 0x0400 #define AVFMT_FLAG_SORT_DTS 0x10000 ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) -#if FF_API_LAVF_PRIV_OPT -#define AVFMT_FLAG_PRIV_OPT 0x20000 ///< Enable use of private options by delaying codec open (deprecated, does nothing) -#endif #define AVFMT_FLAG_FAST_SEEK 0x80000 ///< Enable fast, but inaccurate seeks for some formats +#if FF_API_LAVF_SHORTEST #define AVFMT_FLAG_SHORTEST 0x100000 ///< Stop muxing when the shortest stream stops. +#endif #define AVFMT_FLAG_AUTO_BSF 0x200000 ///< Add bitstream filters as requested by the muxer /** @@ -1365,7 +1471,7 @@ typedef struct AVFormatContext { * * @note this is \e not used for determining the \ref AVInputFormat * "input format" - * @sa format_probesize + * @see format_probesize */ int64_t probesize; @@ -1402,36 +1508,10 @@ typedef struct AVFormatContext { enum AVCodecID subtitle_codec_id; /** - * Maximum amount of memory in bytes to use for the index of each stream. - * If the index exceeds this size, entries will be discarded as - * needed to maintain a smaller size. This can lead to slower or less - * accurate seeking (depends on demuxer). - * Demuxers for which a full in-memory index is mandatory will ignore - * this. - * - muxing: unused - * - demuxing: set by user + * Forced Data codec_id. + * Demuxing: Set by user. */ - unsigned int max_index_size; - - /** - * Maximum amount of memory in bytes to use for buffering frames - * obtained from realtime capture devices. - */ - unsigned int max_picture_buffer; - - /** - * Number of chapters in AVChapter array. - * When muxing, chapters are normally written in the file header, - * so nb_chapters should normally be initialized before write_header - * is called. Some muxers (e.g. mov and mkv) can also write chapters - * in the trailer. To write chapters in the trailer, nb_chapters - * must be zero when write_header is called and non-zero when - * write_trailer is called. - * - muxing: set by user - * - demuxing: set by libavformat - */ - unsigned int nb_chapters; - AVChapter **chapters; + enum AVCodecID data_codec_id; /** * Metadata that applies to the whole file. @@ -1487,6 +1567,31 @@ typedef struct AVFormatContext { int debug; #define FF_FDEBUG_TS 0x0001 + /** + * The maximum number of streams. + * - encoding: unused + * - decoding: set by user + */ + int max_streams; + + /** + * Maximum amount of memory in bytes to use for the index of each stream. + * If the index exceeds this size, entries will be discarded as + * needed to maintain a smaller size. This can lead to slower or less + * accurate seeking (depends on demuxer). + * Demuxers for which a full in-memory index is mandatory will ignore + * this. + * - muxing: unused + * - demuxing: set by user + */ + unsigned int max_index_size; + + /** + * Maximum amount of memory in bytes to use for buffering frames + * obtained from realtime capture devices. + */ + unsigned int max_picture_buffer; + /** * Maximum buffering duration for interleaving. * @@ -1505,6 +1610,35 @@ typedef struct AVFormatContext { */ int64_t max_interleave_delta; + /** + * Maximum number of packets to read while waiting for the first timestamp. + * Decoding only. + */ + int max_ts_probe; + + /** + * Max chunk time in microseconds. + * Note, not all formats support this and unpredictable things may happen if it is used when not supported. + * - encoding: Set by user + * - decoding: unused + */ + int max_chunk_duration; + + /** + * Max chunk size in bytes + * Note, not all formats support this and unpredictable things may happen if it is used when not supported. + * - encoding: Set by user + * - decoding: unused + */ + int max_chunk_size; + + /** + * Maximum number of packets that can be probed + * - encoding: unused + * - decoding: set by user + */ + int max_probe_packets; + /** * Allow non-standard and experimental extension * @see AVCodecContext.strict_std_compliance @@ -1531,11 +1665,6 @@ typedef struct AVFormatContext { */ #define AVFMT_EVENT_FLAG_METADATA_UPDATED 0x0001 - /** - * Maximum number of packets to read while waiting for the first timestamp. - * Decoding only. - */ - int max_ts_probe; /** * Avoid negative timestamps during muxing. @@ -1550,12 +1679,6 @@ typedef struct AVFormatContext { #define AVFMT_AVOID_NEG_TS_MAKE_NON_NEGATIVE 1 ///< Shift timestamps so they are non negative #define AVFMT_AVOID_NEG_TS_MAKE_ZERO 2 ///< Shift timestamps so that they start at 0 - /** - * Transport stream id. - * This will be moved into demuxer private options. Thus no API/ABI compatibility - */ - int ts_id; - /** * Audio preload in microseconds. * Note, not all formats support this and unpredictable things may happen if it is used when not supported. @@ -1564,22 +1687,6 @@ typedef struct AVFormatContext { */ int audio_preload; - /** - * Max chunk time in microseconds. - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user - * - decoding: unused - */ - int max_chunk_duration; - - /** - * Max chunk size in bytes - * Note, not all formats support this and unpredictable things may happen if it is used when not supported. - * - encoding: Set by user - * - decoding: unused - */ - int max_chunk_size; - /** * forces the use of wallclock timestamps as pts/dts of packets * This has undefined results in the presence of B frames. @@ -1588,6 +1695,15 @@ typedef struct AVFormatContext { */ int use_wallclock_as_timestamps; + /** + * Skip duration calcuation in estimate_timings_from_pts. + * - encoding: unused + * - decoding: set by user + * + * @see duration_probesize + */ + int skip_estimate_duration_from_pts; + /** * avio flags, used to force AVIO_FLAG_DIRECT. * - encoding: unused @@ -1647,7 +1763,7 @@ typedef struct AVFormatContext { * * Demuxing only, set by the caller before avformat_open_input(). * - * @sa probesize + * @see probesize */ int format_probesize; @@ -1667,6 +1783,20 @@ typedef struct AVFormatContext { */ char *format_whitelist; + /** + * ',' separated list of allowed protocols. + * - encoding: unused + * - decoding: set by user + */ + char *protocol_whitelist; + + /** + * ',' separated list of disallowed protocols. + * - encoding: unused + * - decoding: set by user + */ + char *protocol_blacklist; + /** * IO repositioned flag. * This is set by avformat when the underlaying IO context read pointer @@ -1681,7 +1811,7 @@ typedef struct AVFormatContext { * the same codec_id. * Demuxing: Set by user */ - const AVCodec *video_codec; + const struct AVCodec *video_codec; /** * Forced audio codec. @@ -1689,7 +1819,7 @@ typedef struct AVFormatContext { * the same codec_id. * Demuxing: Set by user */ - const AVCodec *audio_codec; + const struct AVCodec *audio_codec; /** * Forced subtitle codec. @@ -1697,7 +1827,7 @@ typedef struct AVFormatContext { * the same codec_id. * Demuxing: Set by user */ - const AVCodec *subtitle_codec; + const struct AVCodec *subtitle_codec; /** * Forced data codec. @@ -1705,12 +1835,12 @@ typedef struct AVFormatContext { * the same codec_id. * Demuxing: Set by user */ - const AVCodec *data_codec; + const struct AVCodec *data_codec; /** * Number of bytes to be written as padding in a metadata header. * Demuxing: Unused. - * Muxing: Set by user via av_format_set_metadata_header_padding. + * Muxing: Set by user. */ int metadata_header_padding; @@ -1739,19 +1869,6 @@ typedef struct AVFormatContext { */ uint8_t *dump_separator; - /** - * Forced Data codec_id. - * Demuxing: Set by user. - */ - enum AVCodecID data_codec_id; - - /** - * ',' separated list of allowed protocols. - * - encoding: unused - * - decoding: set by user - */ - char *protocol_whitelist; - /** * A callback for opening new IO streams. * @@ -1775,39 +1892,6 @@ typedef struct AVFormatContext { int (*io_open)(struct AVFormatContext *s, AVIOContext **pb, const char *url, int flags, AVDictionary **options); - /** - * A callback for closing the streams opened with AVFormatContext.io_open(). - */ - void (*io_close)(struct AVFormatContext *s, AVIOContext *pb); - - /** - * ',' separated list of disallowed protocols. - * - encoding: unused - * - decoding: set by user - */ - char *protocol_blacklist; - - /** - * The maximum number of streams. - * - encoding: unused - * - decoding: set by user - */ - int max_streams; - - /** - * Skip duration calcuation in estimate_timings_from_pts. - * - encoding: unused - * - decoding: set by user - */ - int skip_estimate_duration_from_pts; - - /** - * Maximum number of packets that can be probed - * - encoding: unused - * - decoding: set by user - */ - int max_probe_packets; - /** * A callback for closing the streams opened with AVFormatContext.io_open(). * @@ -1820,20 +1904,40 @@ typedef struct AVFormatContext { * @return 0 on success, a negative AVERROR code on failure */ int (*io_close2)(struct AVFormatContext *s, AVIOContext *pb); + + /** + * Maximum number of bytes read from input in order to determine stream durations + * when using estimate_timings_from_pts in avformat_find_stream_info(). + * Demuxing only, set by the caller before avformat_find_stream_info(). + * Can be set to 0 to let avformat choose using a heuristic. + * + * @see skip_estimate_duration_from_pts + */ + int64_t duration_probesize; } AVFormatContext; /** * This function will cause global side data to be injected in the next packet * of each stream as well as after any subsequent seek. + * + * @note global side data is always available in every AVStream's + * @ref AVCodecParameters.coded_side_data "codecpar side data" array, and + * in a @ref AVCodecContext.coded_side_data "decoder's side data" array if + * initialized with said stream's codecpar. + * @see av_packet_side_data_get() */ void av_format_inject_global_side_data(AVFormatContext *s); +#if FF_API_GET_DUR_ESTIMATE_METHOD /** * Returns the method used to set ctx->duration. * * @return AVFMT_DURATION_FROM_PTS, AVFMT_DURATION_FROM_STREAM, or AVFMT_DURATION_FROM_BITRATE. + * @deprecated duration_estimation_method is public and can be read directly. */ +attribute_deprecated enum AVDurationEstimationMethod av_fmt_ctx_get_duration_estimation_method(const AVFormatContext* ctx); +#endif /** * @defgroup lavf_core Core functions @@ -1895,8 +1999,8 @@ const AVOutputFormat *av_muxer_iterate(void **opaque); /** * Iterate over all registered demuxers. * - * @param opaque a pointer where libavformat will store the iteration state. Must - * point to NULL to start the iteration. + * @param opaque a pointer where libavformat will store the iteration state. + * Must point to NULL to start the iteration. * * @return the next registered demuxer or NULL when the iteration is * finished @@ -1932,6 +2036,42 @@ const AVClass *avformat_get_class(void); */ const AVClass *av_stream_get_class(void); +/** + * Get the AVClass for AVStreamGroup. It can be used in combination with + * AV_OPT_SEARCH_FAKE_OBJ for examining options. + * + * @see av_opt_find(). + */ +const AVClass *av_stream_group_get_class(void); + +/** + * @return a string identifying the stream group type, or NULL if unknown + */ +const char *avformat_stream_group_name(enum AVStreamGroupParamsType type); + +/** + * Add a new empty stream group to a media file. + * + * When demuxing, it may be called by the demuxer in read_header(). If the + * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also + * be called in read_packet(). + * + * When muxing, may be called by the user before avformat_write_header(). + * + * User is required to call avformat_free_context() to clean up the allocation + * by avformat_stream_group_create(). + * + * New streams can be added to the group with avformat_stream_group_add_stream(). + * + * @param s media file handle + * + * @return newly created group or NULL on error. + * @see avformat_new_stream, avformat_stream_group_add_stream. + */ +AVStreamGroup *avformat_stream_group_create(AVFormatContext *s, + enum AVStreamGroupParamsType type, + AVDictionary **options); + /** * Add a new stream to a media file. * @@ -1949,20 +2089,50 @@ const AVClass *av_stream_get_class(void); * * @return newly created stream or NULL on error. */ -AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c); +AVStream *avformat_new_stream(AVFormatContext *s, const struct AVCodec *c); +/** + * Add an already allocated stream to a stream group. + * + * When demuxing, it may be called by the demuxer in read_header(). If the + * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also + * be called in read_packet(). + * + * When muxing, may be called by the user before avformat_write_header() after + * having allocated a new group with avformat_stream_group_create() and stream with + * avformat_new_stream(). + * + * User is required to call avformat_free_context() to clean up the allocation + * by avformat_stream_group_add_stream(). + * + * @param stg stream group belonging to a media file. + * @param st stream in the media file to add to the group. + * + * @retval 0 success + * @retval AVERROR(EEXIST) the stream was already in the group + * @retval "another negative error code" legitimate errors + * + * @see avformat_new_stream, avformat_stream_group_create. + */ +int avformat_stream_group_add_stream(AVStreamGroup *stg, AVStream *st); + +#if FF_API_AVSTREAM_SIDE_DATA /** * Wrap an existing array as stream side data. * - * @param st stream + * @param st stream * @param type side information type * @param data the side data array. It must be allocated with the av_malloc() * family of functions. The ownership of the data is transferred to * st. * @param size side information size + * * @return zero on success, a negative AVERROR code on failure. On failure, * the stream is unchanged and the data remains owned by the caller. + * @deprecated use av_packet_side_data_add() with the stream's + * @ref AVCodecParameters.coded_side_data "codecpar side data" */ +attribute_deprecated int av_stream_add_side_data(AVStream *st, enum AVPacketSideDataType type, uint8_t *data, size_t size); @@ -1970,23 +2140,32 @@ int av_stream_add_side_data(AVStream *st, enum AVPacketSideDataType type, * Allocate new information from stream. * * @param stream stream - * @param type desired side information type - * @param size side information size + * @param type desired side information type + * @param size side information size + * * @return pointer to fresh allocated data or NULL otherwise + * @deprecated use av_packet_side_data_new() with the stream's + * @ref AVCodecParameters.coded_side_data "codecpar side data" */ +attribute_deprecated uint8_t *av_stream_new_side_data(AVStream *stream, enum AVPacketSideDataType type, size_t size); /** * Get side information from stream. * * @param stream stream - * @param type desired side information type - * @param size If supplied, *size will be set to the size of the side data - * or to zero if the desired side data is not present. + * @param type desired side information type + * @param size If supplied, *size will be set to the size of the side data + * or to zero if the desired side data is not present. + * * @return pointer to data if present or NULL otherwise + * @deprecated use av_packet_side_data_get() with the stream's + * @ref AVCodecParameters.coded_side_data "codecpar side data" */ +attribute_deprecated uint8_t *av_stream_get_side_data(const AVStream *stream, enum AVPacketSideDataType type, size_t *size); +#endif AVProgram *av_new_program(AVFormatContext *s, int id); @@ -2000,16 +2179,17 @@ AVProgram *av_new_program(AVFormatContext *s, int id); * avformat_free_context() can be used to free the context and * everything allocated by the framework within it. * - * @param *ctx is set to the created format context, or to NULL in - * case of failure - * @param oformat format to use for allocating the context, if NULL - * format_name and filename are used instead - * @param format_name the name of output format to use for allocating the - * context, if NULL filename is used instead - * @param filename the name of the filename to use for allocating the - * context, may be NULL - * @return >= 0 in case of success, a negative AVERROR code in case of - * failure + * @param ctx pointee is set to the created format context, + * or to NULL in case of failure + * @param oformat format to use for allocating the context, if NULL + * format_name and filename are used instead + * @param format_name the name of output format to use for allocating the + * context, if NULL filename is used instead + * @param filename the name of the filename to use for allocating the + * context, may be NULL + * + * @return >= 0 in case of success, a negative AVERROR code in case of + * failure */ int avformat_alloc_output_context2(AVFormatContext **ctx, const AVOutputFormat *oformat, const char *format_name, const char *filename); @@ -2064,15 +2244,16 @@ const AVInputFormat *av_probe_input_format3(const AVProbeData *pd, * attempt is made. When the maximum probe size is reached, the input format * with the highest score is returned. * - * @param pb the bytestream to probe - * @param fmt the input format is put here - * @param url the url of the stream - * @param logctx the log context - * @param offset the offset within the bytestream to probe from + * @param pb the bytestream to probe + * @param fmt the input format is put here + * @param url the url of the stream + * @param logctx the log context + * @param offset the offset within the bytestream to probe from * @param max_probe_size the maximum probe buffer size (zero for default) + * * @return the score in case of success, a negative value corresponding to an * the maximal score is AVPROBE_SCORE_MAX - * AVERROR code otherwise + * AVERROR code otherwise */ int av_probe_input_buffer2(AVIOContext *pb, const AVInputFormat **fmt, const char *url, void *logctx, @@ -2089,16 +2270,19 @@ int av_probe_input_buffer(AVIOContext *pb, const AVInputFormat **fmt, * Open an input stream and read the header. The codecs are not opened. * The stream must be closed with avformat_close_input(). * - * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context). - * May be a pointer to NULL, in which case an AVFormatContext is allocated by this - * function and written into ps. - * Note that a user-supplied AVFormatContext will be freed on failure. - * @param url URL of the stream to open. - * @param fmt If non-NULL, this parameter forces a specific input format. - * Otherwise the format is autodetected. - * @param options A dictionary filled with AVFormatContext and demuxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. + * @param ps Pointer to user-supplied AVFormatContext (allocated by + * avformat_alloc_context). May be a pointer to NULL, in + * which case an AVFormatContext is allocated by this + * function and written into ps. + * Note that a user-supplied AVFormatContext will be freed + * on failure. + * @param url URL of the stream to open. + * @param fmt If non-NULL, this parameter forces a specific input format. + * Otherwise the format is autodetected. + * @param options A dictionary filled with AVFormatContext and demuxer-private + * options. + * On return this parameter will be destroyed and replaced with + * a dict containing options that were not found. May be NULL. * * @return 0 on success, a negative AVERROR on failure. * @@ -2137,6 +2321,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options); * @param last the last found program, the search will start after this * program, or from the beginning if it is NULL * @param s stream index + * * @return the next program which belongs to s, NULL if no program is found or * the last program is not among the programs of ic. */ @@ -2161,10 +2346,12 @@ void av_program_add_stream_index(AVFormatContext *ac, int progid, unsigned int i * @param decoder_ret if non-NULL, returns the decoder for the * selected stream * @param flags flags; none are currently defined + * * @return the non-negative stream number in case of success, * AVERROR_STREAM_NOT_FOUND if no stream with the requested type * could be found, * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder + * * @note If av_find_best_stream returns successfully and decoder_ret is not * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. */ @@ -2172,7 +2359,7 @@ int av_find_best_stream(AVFormatContext *ic, enum AVMediaType type, int wanted_stream_nb, int related_stream, - const AVCodec **decoder_ret, + const struct AVCodec **decoder_ret, int flags); /** @@ -2208,13 +2395,14 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt); * Seek to the keyframe at timestamp. * 'timestamp' in 'stream_index'. * - * @param s media file handle - * @param stream_index If stream_index is (-1), a default - * stream is selected, and timestamp is automatically converted - * from AV_TIME_BASE units to the stream specific time_base. - * @param timestamp Timestamp in AVStream.time_base units - * or, if no stream is specified, in AV_TIME_BASE units. - * @param flags flags which select direction and seeking mode + * @param s media file handle + * @param stream_index If stream_index is (-1), a default stream is selected, + * and timestamp is automatically converted from + * AV_TIME_BASE units to the stream specific time_base. + * @param timestamp Timestamp in AVStream.time_base units or, if no stream + * is specified, in AV_TIME_BASE units. + * @param flags flags which select direction and seeking mode + * * @return >= 0 on success */ int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, @@ -2236,12 +2424,12 @@ int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, * keyframes (this may not be supported by all demuxers). * If flags contain AVSEEK_FLAG_BACKWARD, it is ignored. * - * @param s media file handle + * @param s media file handle * @param stream_index index of the stream which is used as time base reference - * @param min_ts smallest acceptable timestamp - * @param ts target timestamp - * @param max_ts largest acceptable timestamp - * @param flags flags + * @param min_ts smallest acceptable timestamp + * @param ts target timestamp + * @param max_ts largest acceptable timestamp + * @param flags flags * @return >=0 on success, error code otherwise * * @note This is part of the new seek API which is still under construction. @@ -2305,16 +2493,22 @@ void avformat_close_input(AVFormatContext **s); * Allocate the stream private data and write the stream header to * an output media file. * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already opened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. + * @param s Media file handle, must be allocated with + * avformat_alloc_context(). + * Its \ref AVFormatContext.oformat "oformat" field must be set + * to the desired output format; + * Its \ref AVFormatContext.pb "pb" field must be set to an + * already opened ::AVIOContext. + * @param options An ::AVDictionary filled with AVFormatContext and + * muxer-private options. + * On return this parameter will be destroyed and replaced with + * a dict containing options that were not found. May be NULL. * - * @return AVSTREAM_INIT_IN_WRITE_HEADER on success if the codec had not already been fully initialized in avformat_init, - * AVSTREAM_INIT_IN_INIT_OUTPUT on success if the codec had already been fully initialized in avformat_init, - * negative AVERROR on failure. + * @retval AVSTREAM_INIT_IN_WRITE_HEADER On success, if the codec had not already been + * fully initialized in avformat_init_output(). + * @retval AVSTREAM_INIT_IN_INIT_OUTPUT On success, if the codec had already been fully + * initialized in avformat_init_output(). + * @retval AVERROR A negative AVERROR on failure. * * @see av_opt_find, av_dict_set, avio_open, av_oformat_next, avformat_init_output. */ @@ -2323,20 +2517,26 @@ int avformat_write_header(AVFormatContext *s, AVDictionary **options); /** * Allocate the stream private data and initialize the codec, but do not write the header. - * May optionally be used before avformat_write_header to initialize stream parameters + * May optionally be used before avformat_write_header() to initialize stream parameters * before actually writing the header. - * If using this function, do not pass the same options to avformat_write_header. + * If using this function, do not pass the same options to avformat_write_header(). * - * @param s Media file handle, must be allocated with avformat_alloc_context(). - * Its oformat field must be set to the desired output format; - * Its pb field must be set to an already opened AVIOContext. - * @param options An AVDictionary filled with AVFormatContext and muxer-private options. - * On return this parameter will be destroyed and replaced with a dict containing - * options that were not found. May be NULL. + * @param s Media file handle, must be allocated with + * avformat_alloc_context(). + * Its \ref AVFormatContext.oformat "oformat" field must be set + * to the desired output format; + * Its \ref AVFormatContext.pb "pb" field must be set to an + * already opened ::AVIOContext. + * @param options An ::AVDictionary filled with AVFormatContext and + * muxer-private options. + * On return this parameter will be destroyed and replaced with + * a dict containing options that were not found. May be NULL. * - * @return AVSTREAM_INIT_IN_WRITE_HEADER on success if the codec requires avformat_write_header to fully initialize, - * AVSTREAM_INIT_IN_INIT_OUTPUT on success if the codec has been fully initialized, - * negative AVERROR on failure. + * @retval AVSTREAM_INIT_IN_WRITE_HEADER On success, if the codec requires + * avformat_write_header to fully initialize. + * @retval AVSTREAM_INIT_IN_INIT_OUTPUT On success, if the codec has been fully + * initialized. + * @retval AVERROR Anegative AVERROR on failure. * * @see av_opt_find, av_dict_set, avio_open, av_oformat_next, avformat_write_header. */ @@ -2435,7 +2635,7 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt); * See av_interleaved_write_uncoded_frame() for details. */ int av_write_uncoded_frame(AVFormatContext *s, int stream_index, - AVFrame *frame); + struct AVFrame *frame); /** * Write an uncoded frame to an output media file. @@ -2454,7 +2654,7 @@ int av_write_uncoded_frame(AVFormatContext *s, int stream_index, * @return >=0 for success, a negative code on error */ int av_interleaved_write_uncoded_frame(AVFormatContext *s, int stream_index, - AVFrame *frame); + struct AVFrame *frame); /** * Test whether a muxer supports uncoded frame. @@ -2481,11 +2681,11 @@ int av_write_trailer(AVFormatContext *s); * there is no match. * * @param short_name if non-NULL checks if short_name matches with the - * names of the registered formats - * @param filename if non-NULL checks if filename terminates with the - * extensions of the registered formats - * @param mime_type if non-NULL checks if mime_type matches with the - * MIME type of the registered formats + * names of the registered formats + * @param filename if non-NULL checks if filename terminates with the + * extensions of the registered formats + * @param mime_type if non-NULL checks if mime_type matches with the + * MIME type of the registered formats */ const AVOutputFormat *av_guess_format(const char *short_name, const char *filename, @@ -2509,9 +2709,11 @@ enum AVCodecID av_guess_codec(const AVOutputFormat *fmt, const char *short_name, * time_base units * @param[out] wall absolute time when that packet whas output, * in microsecond - * @return 0 if OK, AVERROR(ENOSYS) if the format does not support it - * Note: some formats or devices may not allow to measure dts and wall - * atomically. + * @retval 0 Success + * @retval AVERROR(ENOSYS) The format does not support it + * + * @note Some formats or devices may not allow to measure dts and wall + * atomically. */ int av_get_output_timestamp(struct AVFormatContext *s, int stream, int64_t *dts, int64_t *wall); @@ -2653,7 +2855,7 @@ const AVIndexEntry *avformat_index_get_entry(AVStream *st, int idx); * Get the AVIndexEntry corresponding to the given timestamp. * * @param st Stream containing the requested AVIndexEntry. - * @param timestamp Timestamp to retrieve the index entry for. + * @param wanted_timestamp Timestamp to retrieve the index entry for. * @param flags If AVSEEK_FLAG_BACKWARD then the returned entry will correspond * to the timestamp which is <= the requested one, if backward * is 0, then it will be >= @@ -2840,7 +3042,8 @@ const struct AVCodecTag *avformat_get_mov_audio_tags(void); * @param frame the frame with the aspect ratio to be determined * @return the guessed (valid) sample_aspect_ratio, 0/1 if no idea */ -AVRational av_guess_sample_aspect_ratio(AVFormatContext *format, AVStream *stream, AVFrame *frame); +AVRational av_guess_sample_aspect_ratio(AVFormatContext *format, AVStream *stream, + struct AVFrame *frame); /** * Guess the frame rate, based on both the container and codec information. @@ -2850,7 +3053,8 @@ AVRational av_guess_sample_aspect_ratio(AVFormatContext *format, AVStream *strea * @param frame the frame for which the frame rate should be determined, may be NULL * @return the guessed (valid) frame rate, 0/1 if no idea */ -AVRational av_guess_frame_rate(AVFormatContext *ctx, AVStream *stream, AVFrame *frame); +AVRational av_guess_frame_rate(AVFormatContext *ctx, AVStream *stream, + struct AVFrame *frame); /** * Check if the stream st contained in s is matched by the stream specifier @@ -2870,6 +3074,7 @@ int avformat_match_stream_specifier(AVFormatContext *s, AVStream *st, int avformat_queue_attached_pictures(AVFormatContext *s); +#if FF_API_INTERNAL_TIMING enum AVTimebaseSource { AVFMT_TBCF_AUTO = -1, AVFMT_TBCF_DECODER, @@ -2880,25 +3085,20 @@ enum AVTimebaseSource { }; /** - * Transfer internal timing information from one stream to another. - * - * This function is useful when doing stream copy. - * - * @param ofmt target output format for ost - * @param ost output stream which needs timings copy and adjustments - * @param ist reference input stream to copy timings from - * @param copy_tb define from where the stream codec timebase needs to be imported + * @deprecated do not call this function */ +attribute_deprecated int avformat_transfer_internal_stream_timing_info(const AVOutputFormat *ofmt, AVStream *ost, const AVStream *ist, enum AVTimebaseSource copy_tb); /** - * Get the internal codec timebase from a stream. - * - * @param st input stream to extract the timebase from + * @deprecated do not call this function */ +attribute_deprecated AVRational av_stream_get_codec_timebase(const AVStream *st); +#endif + /** * @} diff --git a/include/libavformat/avi.h b/include/libavformat/avi.h new file mode 100644 index 0000000..b1711f0 --- /dev/null +++ b/include/libavformat/avi.h @@ -0,0 +1,41 @@ +/* + * copyright (c) 2001 Fabrice Bellard + * + * 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 AVFORMAT_AVI_H +#define AVFORMAT_AVI_H + +#define AVIF_HASINDEX 0x00000010 // Index at end of file? +#define AVIF_MUSTUSEINDEX 0x00000020 +#define AVIF_ISINTERLEAVED 0x00000100 +#define AVIF_TRUSTCKTYPE 0x00000800 // Use CKType to find key frames? +#define AVIF_WASCAPTUREFILE 0x00010000 +#define AVIF_COPYRIGHTED 0x00020000 + +#define AVI_MAX_RIFF_SIZE 0x40000000LL +#define AVI_MAX_STREAM_COUNT 100 + +/* stream header flags */ +#define AVISF_VIDEO_PALCHANGES 0x00010000 + +/* index flags */ +#define AVIIF_INDEX 0x00000010 +#define AVIIF_NO_TIME 0x00000100 + +#endif /* AVFORMAT_AVI_H */ diff --git a/include/libavformat/avio.h b/include/libavformat/avio.h index 36c3d7b..ebf6111 100755 --- a/include/libavformat/avio.h +++ b/include/libavformat/avio.h @@ -101,9 +101,7 @@ typedef struct AVIODirEntry { int64_t filemode; /**< Unix file mode, -1 if unknown. */ } AVIODirEntry; -typedef struct AVIODirContext { - struct URLContext *url_context; -} AVIODirContext; +typedef struct AVIODirContext AVIODirContext; /** * Different data types that can be returned via the AVIO @@ -234,7 +232,7 @@ typedef struct AVIOContext { void *opaque; /**< A private pointer, passed to the read/write/seek/... functions. */ int (*read_packet)(void *opaque, uint8_t *buf, int buf_size); - int (*write_packet)(void *opaque, uint8_t *buf, int buf_size); + int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size); int64_t (*seek)(void *opaque, int64_t offset, int whence); int64_t pos; /**< position in the file of the current buffer */ int eof_reached; /**< true if was unable to read due to error or eof */ @@ -282,7 +280,7 @@ typedef struct AVIOContext { /** * A callback that is used instead of write_packet. */ - int (*write_data_type)(void *opaque, uint8_t *buf, int buf_size, + int (*write_data_type)(void *opaque, const uint8_t *buf, int buf_size, enum AVIODataMarkerType type, int64_t time); /** * If set, don't call write_data_type separately for AVIO_DATA_MARKER_BOUNDARY_POINT, @@ -291,16 +289,6 @@ typedef struct AVIOContext { */ int ignore_boundary_point; -#if FF_API_AVIOCONTEXT_WRITTEN - /** - * @deprecated field utilized privately by libavformat. For a public - * statistic of how many bytes were written out, see - * AVIOContext::bytes_written. - */ - attribute_deprecated - int64_t written; -#endif - /** * Maximum reached position before a backward seek in the write buffer, * used keeping track of already written data for a later flush. @@ -413,7 +401,7 @@ AVIOContext *avio_alloc_context( int write_flag, void *opaque, int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), - int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), + int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size), int64_t (*seek)(void *opaque, int64_t offset, int whence)); /** @@ -464,6 +452,7 @@ int avio_put_str16be(AVIOContext *s, const char *str); * * Zero-length ranges are omitted from the output. * + * @param s the AVIOContext * @param time the stream time the current bytestream pos corresponds to * (in AV_TIME_BASE units), or AV_NOPTS_VALUE if unknown or not * applicable @@ -536,7 +525,7 @@ int avio_printf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3); * Usually you don't need to use this function directly but its macro wrapper, * avio_print. */ -void avio_print_string_array(AVIOContext *s, const char *strings[]); +void avio_print_string_array(AVIOContext *s, const char * const strings[]); /** * Write strings (const char *) to the context. diff --git a/include/libavformat/avio_internal.h b/include/libavformat/avio_internal.h new file mode 100644 index 0000000..7d4756d --- /dev/null +++ b/include/libavformat/avio_internal.h @@ -0,0 +1,313 @@ +/* + * 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 AVFORMAT_AVIO_INTERNAL_H +#define AVFORMAT_AVIO_INTERNAL_H + +#include "avio.h" + +#include "libavutil/log.h" + +extern const AVClass ff_avio_class; + +typedef struct FFIOContext { + AVIOContext pub; + /** + * A callback that is used instead of short_seek_threshold. + */ + int (*short_seek_get)(void *opaque); + + /** + * Threshold to favor readahead over seek. + */ + int short_seek_threshold; + + enum AVIODataMarkerType current_type; + int64_t last_time; + + /** + * max filesize, used to limit allocations + */ + int64_t maxsize; + + /** + * Bytes read statistic + */ + int64_t bytes_read; + + /** + * Bytes written statistic + */ + int64_t bytes_written; + + /** + * seek statistic + */ + int seek_count; + + /** + * writeout statistic + */ + int writeout_count; + + /** + * Original buffer size + * used after probing to ensure seekback and to reset the buffer size + */ + int orig_buffer_size; + + /** + * Written output size + * is updated each time a successful writeout ends up further position-wise + */ + int64_t written_output_size; +} FFIOContext; + +static av_always_inline FFIOContext *ffiocontext(AVIOContext *ctx) +{ + return (FFIOContext*)ctx; +} + +void ffio_init_context(FFIOContext *s, + unsigned char *buffer, + int buffer_size, + int write_flag, + void *opaque, + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), + int (*write_packet)(void *opaque, const uint8_t *buf, int buf_size), + int64_t (*seek)(void *opaque, int64_t offset, int whence)); + +/** + * Wrap a buffer in an AVIOContext for reading. + */ +void ffio_init_read_context(FFIOContext *s, const uint8_t *buffer, int buffer_size); + +/** + * Wrap a buffer in an AVIOContext for writing. + */ +void ffio_init_write_context(FFIOContext *s, uint8_t *buffer, int buffer_size); + +/** + * Read size bytes from AVIOContext, returning a pointer. + * Note that the data pointed at by the returned pointer is only + * valid until the next call that references the same IO context. + * @param s IO context + * @param buf pointer to buffer into which to assemble the requested + * data if it is not available in contiguous addresses in the + * underlying buffer + * @param size number of bytes requested + * @param data address at which to store pointer: this will be a + * a direct pointer into the underlying buffer if the requested + * number of bytes are available at contiguous addresses, otherwise + * will be a copy of buf + * @return number of bytes read or AVERROR + */ +int ffio_read_indirect(AVIOContext *s, unsigned char *buf, int size, const unsigned char **data); + +void ffio_fill(AVIOContext *s, int b, int64_t count); + +static av_always_inline void ffio_wfourcc(AVIOContext *pb, const uint8_t *s) +{ + avio_wl32(pb, MKTAG(s[0], s[1], s[2], s[3])); +} + +/** + * Rewind the AVIOContext using the specified buffer containing the first buf_size bytes of the file. + * Used after probing to avoid seeking. + * Joins buf and s->buffer, taking any overlap into consideration. + * @note s->buffer must overlap with buf or they can't be joined and the function fails + * + * @param s The read-only AVIOContext to rewind + * @param buf The probe buffer containing the first buf_size bytes of the file + * @param buf_size The size of buf + * @return >= 0 in case of success, a negative value corresponding to an + * AVERROR code in case of failure + */ +int ffio_rewind_with_probe_data(AVIOContext *s, unsigned char **buf, int buf_size); + +uint64_t ffio_read_varlen(AVIOContext *bc); + +/** + * Read a unsigned integer coded as a variable number of up to eight + * little-endian bytes, where the MSB in a byte signals another byte + * must be read. + * All coded bytes are read, but values > UINT_MAX are truncated. + */ +unsigned int ffio_read_leb(AVIOContext *s); + +void ffio_write_leb(AVIOContext *s, unsigned val); + +/** + * Write a sequence of text lines, converting line endings. + * All input line endings (LF, CRLF, CR) are converted to the configured line ending. + * @param s The AVIOContext to write to + * @param buf The buffer to write + * @param size The size of the buffer, or <0 to use the full length of a null-terminated string + * @param ending The line ending sequence to convert to, or NULL for \n + */ +void ffio_write_lines(AVIOContext *s, const unsigned char *buf, int size, + const unsigned char *ending); + +/** + * Read size bytes from AVIOContext into buf. + * Check that exactly size bytes have been read. + * @return number of bytes read or AVERROR + */ +int ffio_read_size(AVIOContext *s, unsigned char *buf, int size); + +/** + * Reallocate a given buffer for AVIOContext. + * + * @param s the AVIOContext to realloc. + * @param buf_size required new buffer size. + * @return 0 on success, a negative AVERROR on failure. + */ +int ffio_realloc_buf(AVIOContext *s, int buf_size); + +/** + * Ensures that the requested seekback buffer size will be available + * + * Will ensure that when reading sequentially up to buf_size, seeking + * within the current pos and pos+buf_size is possible. + * Once the stream position moves outside this window or another + * ffio_ensure_seekback call requests a buffer outside this window this + * guarantee is lost. + */ +int ffio_ensure_seekback(AVIOContext *s, int64_t buf_size); + +int ffio_limit(AVIOContext *s, int size); + +void ffio_init_checksum(AVIOContext *s, + unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len), + unsigned long checksum); +unsigned long ffio_get_checksum(AVIOContext *s); +unsigned long ff_crc04C11DB7_update(unsigned long checksum, const uint8_t *buf, + unsigned int len); +unsigned long ff_crcEDB88320_update(unsigned long checksum, const uint8_t *buf, + unsigned int len); +unsigned long ff_crcA001_update(unsigned long checksum, const uint8_t *buf, + unsigned int len); + +/** + * Open a write only packetized memory stream with a maximum packet + * size of 'max_packet_size'. The stream is stored in a memory buffer + * with a big-endian 4 byte header giving the packet size in bytes. + * + * @param s new IO context + * @param max_packet_size maximum packet size (must be > 0) + * @return zero if no error. + */ +int ffio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size); + +/** + * Return the URLContext associated with the AVIOContext + * + * @param s IO context + * @return pointer to URLContext or NULL. + */ +struct URLContext *ffio_geturlcontext(AVIOContext *s); + +/** + * Create and initialize a AVIOContext for accessing the + * resource referenced by the URLContext h. + * @note When the URLContext h has been opened in read+write mode, the + * AVIOContext can be used only for writing. + * + * @param s Used to return the pointer to the created AVIOContext. + * In case of failure the pointed to value is set to NULL. + * @return >= 0 in case of success, a negative value corresponding to an + * AVERROR code in case of failure + */ +int ffio_fdopen(AVIOContext **s, struct URLContext *h); + + +/** + * Read url related dictionary options from the AVIOContext and write to the given dictionary + */ +int ffio_copy_url_options(AVIOContext* pb, AVDictionary** avio_opts); + +/** + * Open a write-only fake memory stream. The written data is not stored + * anywhere - this is only used for measuring the amount of data + * written. + * + * @param s new IO context + * @return zero if no error. + */ +int ffio_open_null_buf(AVIOContext **s); + +int ffio_open_whitelist(AVIOContext **s, const char *url, int flags, + const AVIOInterruptCB *int_cb, AVDictionary **options, + const char *whitelist, const char *blacklist); + +/** + * Close a null buffer. + * + * @param s an IO context opened by ffio_open_null_buf + * @return the number of bytes written to the null buffer + */ +int ffio_close_null_buf(AVIOContext *s); + +/** + * Reset a dynamic buffer. + * + * Resets everything, but keeps the allocated buffer for later use. + */ +void ffio_reset_dyn_buf(AVIOContext *s); + +/** + * Free a dynamic buffer. + * + * @param s a pointer to an IO context opened by avio_open_dyn_buf() + */ +void ffio_free_dyn_buf(AVIOContext **s); + +struct AVBPrint; +/** + * Read a whole line of text from AVIOContext to an AVBPrint buffer overwriting + * its contents. Stop reading after reaching a \\r, a \\n, a \\r\\n, a \\0 or + * EOF. The line ending characters are NOT included in the buffer, but they + * are skipped on the input. + * + * @param s the read-only AVIOContext + * @param bp the AVBPrint buffer + * @return the length of the read line not including the line endings, + * negative on error, or if the buffer becomes truncated. + */ +int64_t ff_read_line_to_bprint_overwrite(AVIOContext *s, struct AVBPrint *bp); + +/** + * Read a whole null-terminated string of text from AVIOContext to an AVBPrint + * buffer overwriting its contents. Stop reading after reaching the maximum + * length, a \\0 or EOF. + * + * @param s the read-only AVIOContext + * @param bp the AVBPrint buffer + * @param max_len the maximum length to be read from the AVIOContext. + * Negative (< 0) values signal that there is no known maximum + * length applicable. A maximum length of zero means that the + * AVIOContext is not touched, and the function returns + * with a read length of zero. In all cases the AVBprint + * is cleared. + * @return the length of the read string not including the terminating null, + * negative on error, or if the buffer becomes truncated. + */ +int64_t ff_read_string_to_bprint_overwrite(AVIOContext *s, struct AVBPrint *bp, + int64_t max_len); + +#endif /* AVFORMAT_AVIO_INTERNAL_H */ diff --git a/include/libavformat/avlanguage.h b/include/libavformat/avlanguage.h new file mode 100644 index 0000000..1901e78 --- /dev/null +++ b/include/libavformat/avlanguage.h @@ -0,0 +1,39 @@ +/* + * Cyril Comparon, Larbi Joubala, Resonate-MP4 2009 + * + * 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 AVFORMAT_AVLANGUAGE_H +#define AVFORMAT_AVLANGUAGE_H + +/** + * Known language codespaces + */ +enum AVLangCodespace { + AV_LANG_ISO639_2_BIBL, /** 3-char bibliographic language codes as per ISO-IEC 639-2 */ + AV_LANG_ISO639_2_TERM, /** 3-char terminological language codes as per ISO-IEC 639-2 */ + AV_LANG_ISO639_1 /** 2-char code of language as per ISO/IEC 639-1 */ +}; + +/** + * Convert a language code to a target codespace. The source codespace is guessed. + * @return NULL if the provided lang is null or invalid. + */ +const char *ff_convert_lang_to(const char *lang, enum AVLangCodespace target_codespace); + +#endif /* AVFORMAT_AVLANGUAGE_H */ diff --git a/include/libavformat/caf.h b/include/libavformat/caf.h new file mode 100644 index 0000000..ed0392b --- /dev/null +++ b/include/libavformat/caf.h @@ -0,0 +1,35 @@ +/* + * CAF common code + * Copyright (c) 2007 Justin Ruggles + * + * 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 + */ + +/** + * @file + * CAF common code + */ + +#ifndef AVFORMAT_CAF_H +#define AVFORMAT_CAF_H + +#include "internal.h" + +extern const AVCodecTag ff_codec_caf_tags[]; +extern const AVCodecTag *const ff_caf_codec_tags_list[]; + +#endif /* AVFORMAT_CAF_H */ diff --git a/include/libavformat/dash.h b/include/libavformat/dash.h new file mode 100644 index 0000000..c6d9d2c --- /dev/null +++ b/include/libavformat/dash.h @@ -0,0 +1,39 @@ +/* + * MPEG-DASH ISO BMFF segmenter + * Copyright (c) 2014 Martin Storsjo + * + * 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 AVFORMAT_DASH_H +#define AVFORMAT_DASH_H +#include "avformat.h" + +// See ISO/IEC 23009-1:2014 5.3.9.4.4 +typedef enum { + DASH_TMPL_ID_UNDEFINED = -1, + DASH_TMPL_ID_ESCAPE, + DASH_TMPL_ID_REP_ID, + DASH_TMPL_ID_NUMBER, + DASH_TMPL_ID_BANDWIDTH, + DASH_TMPL_ID_TIME, +} DASHTmplId; + + +void ff_dash_fill_tmpl_params(char *dst, size_t buffer_size, const char *template, int rep_id, int number, int bit_rate, int64_t time); + +#endif /* AVFORMAT_DASH_H */ diff --git a/include/libavformat/demux.h b/include/libavformat/demux.h new file mode 100644 index 0000000..9c76095 --- /dev/null +++ b/include/libavformat/demux.h @@ -0,0 +1,352 @@ +/* + * copyright (c) 2001 Fabrice Bellard + * + * 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 AVFORMAT_DEMUX_H +#define AVFORMAT_DEMUX_H + +#include +#include "libavutil/rational.h" +#include "libavcodec/packet.h" +#include "avformat.h" + +struct AVDeviceInfoList; + +/** + * For an FFInputFormat with this flag set read_close() needs to be called + * by the caller upon read_header() failure. + */ +#define FF_INFMT_FLAG_INIT_CLEANUP (1 << 0) + +typedef struct FFInputFormat { + /** + * The public AVInputFormat. See avformat.h for it. + */ + AVInputFormat p; + + /** + * Raw demuxers store their codec ID here. + */ + enum AVCodecID raw_codec_id; + + /** + * Size of private data so that it can be allocated in the wrapper. + */ + int priv_data_size; + + /** + * Internal flags. See FF_INFMT_FLAG_* above and FF_FMT_FLAG_* in internal.h. + */ + int flags_internal; + + /** + * Tell if a given file has a chance of being parsed as this format. + * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes + * big so you do not have to check for that unless you need more. + */ + int (*read_probe)(const AVProbeData *); + + /** + * Read the format header and initialize the AVFormatContext + * structure. Return 0 if OK. 'avformat_new_stream' should be + * called to create new streams. + */ + int (*read_header)(struct AVFormatContext *); + + /** + * Read one packet and put it in 'pkt'. pts and flags are also + * set. 'avformat_new_stream' can be called only if the flag + * AVFMTCTX_NOHEADER is used and only in the calling thread (not in a + * background thread). + * @return 0 on success, < 0 on error. + * Upon returning an error, pkt must be unreferenced by the caller. + */ + int (*read_packet)(struct AVFormatContext *, AVPacket *pkt); + + /** + * Close the stream. The AVFormatContext and AVStreams are not + * freed by this function + */ + int (*read_close)(struct AVFormatContext *); + + /** + * Seek to a given timestamp relative to the frames in + * stream component stream_index. + * @param stream_index Must not be -1. + * @param flags Selects which direction should be preferred if no exact + * match is available. + * @return >= 0 on success (but not necessarily the new offset) + */ + int (*read_seek)(struct AVFormatContext *, + int stream_index, int64_t timestamp, int flags); + + /** + * Get the next timestamp in stream[stream_index].time_base units. + * @return the timestamp or AV_NOPTS_VALUE if an error occurred + */ + int64_t (*read_timestamp)(struct AVFormatContext *s, int stream_index, + int64_t *pos, int64_t pos_limit); + + /** + * Start/resume playing - only meaningful if using a network-based format + * (RTSP). + */ + int (*read_play)(struct AVFormatContext *); + + /** + * Pause playing - only meaningful if using a network-based format + * (RTSP). + */ + int (*read_pause)(struct AVFormatContext *); + + /** + * Seek to timestamp ts. + * Seeking will be done so that the point from which all active streams + * can be presented successfully will be closest to ts and within min/max_ts. + * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. + */ + int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags); + + /** + * Returns device list with it properties. + * @see avdevice_list_devices() for more details. + */ + int (*get_device_list)(struct AVFormatContext *s, struct AVDeviceInfoList *device_list); +} FFInputFormat; + +static inline const FFInputFormat *ffifmt(const AVInputFormat *fmt) +{ + return (const FFInputFormat*)fmt; +} + +#define MAX_STD_TIMEBASES (30*12+30+3+6) +typedef struct FFStreamInfo { + int64_t last_dts; + int64_t duration_gcd; + int duration_count; + int64_t rfps_duration_sum; + double (*duration_error)[2][MAX_STD_TIMEBASES]; + int64_t codec_info_duration; + int64_t codec_info_duration_fields; + int frame_delay_evidence; + + /** + * 0 -> decoder has not been searched for yet. + * >0 -> decoder found + * <0 -> decoder with codec_id == -found_decoder has not been found + */ + int found_decoder; + + int64_t last_duration; + + /** + * Those are used for average framerate estimation. + */ + int64_t fps_first_dts; + int fps_first_dts_idx; + int64_t fps_last_dts; + int fps_last_dts_idx; +} FFStreamInfo; + +/** + * Returned by demuxers to indicate that data was consumed but discarded + * (ignored streams or junk data). The framework will re-call the demuxer. + */ +#define FFERROR_REDO FFERRTAG('R','E','D','O') + +#define RELATIVE_TS_BASE (INT64_MAX - (1LL << 48)) + +static av_always_inline int is_relative(int64_t ts) +{ + return ts > (RELATIVE_TS_BASE - (1LL << 48)); +} + +/** + * Wrap a given time stamp, if there is an indication for an overflow + * + * @param st stream + * @param timestamp the time stamp to wrap + * @return resulting time stamp + */ +int64_t ff_wrap_timestamp(const AVStream *st, int64_t timestamp); + +/** + * Read a transport packet from a media file. + * + * @param s media file handle + * @param pkt is filled + * @return 0 if OK, AVERROR_xxx on error + */ +int ff_read_packet(AVFormatContext *s, AVPacket *pkt); + +void ff_read_frame_flush(AVFormatContext *s); + +/** + * Perform a binary search using av_index_search_timestamp() and + * FFInputFormat.read_timestamp(). + * + * @param target_ts target timestamp in the time base of the given stream + * @param stream_index stream number + */ +int ff_seek_frame_binary(AVFormatContext *s, int stream_index, + int64_t target_ts, int flags); + +/** + * Update cur_dts of all streams based on the given timestamp and AVStream. + * + * Stream ref_st unchanged, others set cur_dts in their native time base. + * Only needed for timestamp wrapping or if (dts not set and pts!=dts). + * @param timestamp new dts expressed in time_base of param ref_st + * @param ref_st reference stream giving time_base of param timestamp + */ +void avpriv_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp); + +int ff_find_last_ts(AVFormatContext *s, int stream_index, int64_t *ts, int64_t *pos, + int64_t (*read_timestamp)(struct AVFormatContext *, int , int64_t *, int64_t )); + +/** + * Perform a binary search using read_timestamp(). + * + * @param target_ts target timestamp in the time base of the given stream + * @param stream_index stream number + */ +int64_t ff_gen_search(AVFormatContext *s, int stream_index, + int64_t target_ts, int64_t pos_min, + int64_t pos_max, int64_t pos_limit, + int64_t ts_min, int64_t ts_max, + int flags, int64_t *ts_ret, + int64_t (*read_timestamp)(struct AVFormatContext *, int , int64_t *, int64_t )); + +/** + * Internal version of av_index_search_timestamp + */ +int ff_index_search_timestamp(const AVIndexEntry *entries, int nb_entries, + int64_t wanted_timestamp, int flags); + +/** + * Internal version of av_add_index_entry + */ +int ff_add_index_entry(AVIndexEntry **index_entries, + int *nb_index_entries, + unsigned int *index_entries_allocated_size, + int64_t pos, int64_t timestamp, int size, int distance, int flags); + +void ff_configure_buffers_for_index(AVFormatContext *s, int64_t time_tolerance); + +/** + * Ensure the index uses less memory than the maximum specified in + * AVFormatContext.max_index_size by discarding entries if it grows + * too large. + */ +void ff_reduce_index(AVFormatContext *s, int stream_index); + +/** + * add frame for rfps calculation. + * + * @param dts timestamp of the i-th frame + * @return 0 if OK, AVERROR_xxx on error + */ +int ff_rfps_add_frame(AVFormatContext *ic, AVStream *st, int64_t dts); + +void ff_rfps_calculate(AVFormatContext *ic); + +/** + * Rescales a timestamp and the endpoints of an interval to which the temstamp + * belongs, from a timebase `tb_in` to a timebase `tb_out`. + * + * The upper (lower) bound of the output interval is rounded up (down) such that + * the output interval always falls within the intput interval. The timestamp is + * rounded to the nearest integer and halfway cases away from zero, and can + * therefore fall outside of the output interval. + * + * Useful to simplify the rescaling of the arguments of FFInputFormat::read_seek2() + * + * @param[in] tb_in Timebase of the input `min_ts`, `ts` and `max_ts` + * @param[in] tb_out Timebase of the output `min_ts`, `ts` and `max_ts` + * @param[in,out] min_ts Lower bound of the interval + * @param[in,out] ts Timestamp + * @param[in,out] max_ts Upper bound of the interval + */ +void ff_rescale_interval(AVRational tb_in, AVRational tb_out, + int64_t *min_ts, int64_t *ts, int64_t *max_ts); + +void avpriv_stream_set_need_parsing(AVStream *st, enum AVStreamParseType type); + +/** + * Add a new chapter. + * + * @param s media file handle + * @param id unique ID for this chapter + * @param start chapter start time in time_base units + * @param end chapter end time in time_base units + * @param title chapter title + * + * @return AVChapter or NULL on error + */ +AVChapter *avpriv_new_chapter(AVFormatContext *s, int64_t id, AVRational time_base, + int64_t start, int64_t end, const char *title); + +/** + * Add an attached pic to an AVStream. + * + * @param st if set, the stream to add the attached pic to; + * if unset, a new stream will be added to s. + * @param pb AVIOContext to read data from if buf is unset. + * @param buf if set, it contains the data and size information to be used + * for the attached pic; if unset, data is read from pb. + * @param size the size of the data to read if buf is unset. + * + * @return 0 on success, < 0 on error. On error, this function removes + * the stream it has added (if any). + */ +int ff_add_attached_pic(AVFormatContext *s, AVStream *st, AVIOContext *pb, + AVBufferRef **buf, int size); + +/** + * Add side data to a packet for changing parameters to the given values. + * Parameters set to 0 aren't included in the change. + */ +int ff_add_param_change(AVPacket *pkt, int32_t channels, + uint64_t channel_layout, int32_t sample_rate, + int32_t width, int32_t height); + +/** + * Generate standard extradata for AVC-Intra based on width/height and field + * order. + */ +int ff_generate_avci_extradata(AVStream *st); + +/** + * Allocate extradata with additional AV_INPUT_BUFFER_PADDING_SIZE at end + * which is always set to 0 and fill it from pb. + * + * @param size size of extradata + * @return >= 0 if OK, AVERROR_xxx on error + */ +int ff_get_extradata(void *logctx, AVCodecParameters *par, AVIOContext *pb, int size); + +/** + * Find stream index based on format-specific stream ID + * @return stream index, or < 0 on error + */ +int ff_find_stream_index(const AVFormatContext *s, int id); + +int ff_buffer_packet(AVFormatContext *s, AVPacket *pkt); + +#endif /* AVFORMAT_DEMUX_H */ diff --git a/include/libavformat/dovi_isom.h b/include/libavformat/dovi_isom.h new file mode 100644 index 0000000..1221a52 --- /dev/null +++ b/include/libavformat/dovi_isom.h @@ -0,0 +1,36 @@ +/* + * DOVI ISO Media common code + * Copyright (c) 2021 quietvoid + * + * 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 AVFORMAT_DOVI_ISOM_H +#define AVFORMAT_DOVI_ISOM_H + +#include "libavutil/dovi_meta.h" + +#include "avformat.h" + +#define ISOM_DVCC_DVVC_SIZE 24 + +int ff_isom_parse_dvcc_dvvc(void *logctx, AVStream *st, + const uint8_t *buf_ptr, uint64_t size); +void ff_isom_put_dvcc_dvvc(void *logctx, uint8_t out[ISOM_DVCC_DVVC_SIZE], + const AVDOVIDecoderConfigurationRecord *dovi); + +#endif /* AVFORMAT_DOVI_ISOM_H */ diff --git a/include/libavformat/dv.h b/include/libavformat/dv.h new file mode 100644 index 0000000..d21ea19 --- /dev/null +++ b/include/libavformat/dv.h @@ -0,0 +1,39 @@ +/* + * General DV demuxer + * Copyright (c) 2003 Roman Shaposhnik + * + * Many thanks to Dan Dennedy for providing wealth + * of DV technical info. + * + * Raw DV format + * Copyright (c) 2002 Fabrice Bellard + * + * 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 AVFORMAT_DV_H +#define AVFORMAT_DV_H + +#include "avformat.h" + +typedef struct DVDemuxContext DVDemuxContext; +DVDemuxContext* avpriv_dv_init_demux(AVFormatContext* s); +int avpriv_dv_get_packet(DVDemuxContext*, AVPacket *); +int avpriv_dv_produce_packet(DVDemuxContext*, AVPacket*, uint8_t*, int, int64_t); +void ff_dv_ts_reset(DVDemuxContext *c, int64_t ts_video); + +#endif /* AVFORMAT_DV_H */ diff --git a/include/libavformat/dvdclut.h b/include/libavformat/dvdclut.h new file mode 100644 index 0000000..41cea7e --- /dev/null +++ b/include/libavformat/dvdclut.h @@ -0,0 +1,37 @@ +/* + * DVD-Video subpicture CLUT (Color Lookup Table) utilities + * + * 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 AVFORMAT_DVDCLUT_H +#define AVFORMAT_DVDCLUT_H + +#include "libavcodec/codec_par.h" + +/* ("palette: ") + ("rrggbb, "*15) + ("rrggbb") + \n + \0 */ +#define FF_DVDCLUT_EXTRADATA_SIZE (9 + (8 * 15) + 6 + 1 + 1) +#define FF_DVDCLUT_CLUT_LEN 16 +#define FF_DVDCLUT_CLUT_SIZE FF_DVDCLUT_CLUT_LEN * sizeof(uint32_t) + +int ff_dvdclut_palette_extradata_cat(const uint32_t *clut, + const size_t clut_size, + AVCodecParameters *par); + +int ff_dvdclut_yuv_to_rgb(uint32_t *clut, const size_t clut_size); + +#endif /* AVFORMAT_DVDCLUT_H */ diff --git a/include/libavformat/evc.h b/include/libavformat/evc.h new file mode 100644 index 0000000..f308312 --- /dev/null +++ b/include/libavformat/evc.h @@ -0,0 +1,69 @@ +/* + * EVC helper functions for muxers + * Copyright (c) 2022 Dawid Kozinski + * + * 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 AVFORMAT_EVC_H +#define AVFORMAT_EVC_H + +#include + +#include "libavutil/intreadwrite.h" +#include "libavutil/rational.h" +#include "libavcodec/evc.h" +#include "avio.h" + +static inline int evc_get_nalu_type(const uint8_t *p, int bits_size) +{ + int unit_type_plus1 = 0; + + if (bits_size >= EVC_NALU_HEADER_SIZE) { + // forbidden_zero_bit + if ((p[0] & 0x80) != 0) // Cannot get bitstream information. Malformed bitstream. + return -1; + + // nal_unit_type + unit_type_plus1 = (p[0] >> 1) & 0x3F; + } + + return unit_type_plus1 - 1; +} + +static inline uint32_t evc_read_nal_unit_length(const uint8_t *bits, int bits_size) +{ + if (bits_size >= EVC_NALU_LENGTH_PREFIX_SIZE) + return AV_RB32(bits); + + return 0; +} + +/** + * Writes EVC sample metadata to the provided AVIOContext. + * + * @param pb pointer to the AVIOContext where the evc sample metadata shall be written + * @param buf input data buffer + * @param size size in bytes of the input data buffer + * @param ps_array_completeness @see ISO/IEC 14496-15:2021 Coding of audio-visual objects - Part 15: section 12.3.3.3 + * + * @return 0 in case of success, a negative error code in case of failure + */ +int ff_isom_write_evcc(AVIOContext *pb, const uint8_t *data, + int size, int ps_array_completeness); + +#endif // AVFORMAT_EVC_H diff --git a/include/libavformat/ffmeta.h b/include/libavformat/ffmeta.h new file mode 100644 index 0000000..ae8778d --- /dev/null +++ b/include/libavformat/ffmeta.h @@ -0,0 +1,29 @@ +/* + * Common data for metadata muxer/demuxer + * Copyright (c) 2010 Anton Khirnov + * + * 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 AVFORMAT_FFMETA_H +#define AVFORMAT_FFMETA_H + +#define ID_STRING ";FFMETADATA" +#define ID_CHAPTER "[CHAPTER]" +#define ID_STREAM "[STREAM]" + +#endif /* AVFORMAT_FFMETA_H */ diff --git a/include/libavformat/flac_picture.h b/include/libavformat/flac_picture.h new file mode 100644 index 0000000..db074e5 --- /dev/null +++ b/include/libavformat/flac_picture.h @@ -0,0 +1,43 @@ +/* + * Raw FLAC picture parser + * Copyright (c) 2001 Fabrice Bellard + * + * 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 AVFORMAT_FLAC_PICTURE_H +#define AVFORMAT_FLAC_PICTURE_H + +#include "avformat.h" + +#define RETURN_ERROR(code) do { ret = (code); goto fail; } while (0) + +/** + * Parse a FLAC METADATA_BLOCK_PICTURE + * + * @param s AVFormatContext for logging and the attached picture stream. + * @param buf `*buf` points to the actual data which must be padded by + * AV_INPUT_BUFFER_PADDING_SIZE bytes not counted in buf_size. + * This function may take ownership of `*buf` and reset it. + * @param buf_size size of `*buf` (excluding padding) + * @param truncate_workaround If set, additional data may be read from s->pb if + * truncation has been detected. + */ +int ff_flac_parse_picture(AVFormatContext *s, uint8_t **buf, int buf_size, + int truncate_workaround); + +#endif /* AVFORMAT_FLAC_PICTURE_H */ diff --git a/include/libavformat/flacenc.h b/include/libavformat/flacenc.h new file mode 100644 index 0000000..02937b2 --- /dev/null +++ b/include/libavformat/flacenc.h @@ -0,0 +1,33 @@ +/* + * raw FLAC muxer + * Copyright (C) 2009 Justin Ruggles + * + * 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 AVFORMAT_FLACENC_H +#define AVFORMAT_FLACENC_H + +#include +#include "avio.h" + +int ff_flac_write_header(AVIOContext *pb, const uint8_t *extradata, + int extradata_size, int last_block); + +int ff_flac_is_native_layout(uint64_t channel_layout); + +#endif /* AVFORMAT_FLACENC_H */ diff --git a/include/libavformat/flv.h b/include/libavformat/flv.h new file mode 100644 index 0000000..f710963 --- /dev/null +++ b/include/libavformat/flv.h @@ -0,0 +1,154 @@ +/* + * FLV common header + * + * Copyright (c) 2006 The FFmpeg Project + * + * 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 + */ + +/** + * @file + * FLV common header + */ + +#ifndef AVFORMAT_FLV_H +#define AVFORMAT_FLV_H + +/* offsets for packed values */ +#define FLV_AUDIO_SAMPLESSIZE_OFFSET 1 +#define FLV_AUDIO_SAMPLERATE_OFFSET 2 +#define FLV_AUDIO_CODECID_OFFSET 4 + +#define FLV_VIDEO_FRAMETYPE_OFFSET 4 + +/* Extended VideoTagHeader + * defined in reference link: + * https://github.com/veovera/enhanced-rtmp/blob/main/enhanced-rtmp-v1.pdf + * */ +#define FLV_IS_EX_HEADER 0x80 + +/* bitmasks to isolate specific values */ +#define FLV_AUDIO_CHANNEL_MASK 0x01 +#define FLV_AUDIO_SAMPLESIZE_MASK 0x02 +#define FLV_AUDIO_SAMPLERATE_MASK 0x0c +#define FLV_AUDIO_CODECID_MASK 0xf0 + +#define FLV_VIDEO_CODECID_MASK 0x0f +#define FLV_VIDEO_FRAMETYPE_MASK 0x70 + +#define AMF_END_OF_OBJECT 0x09 + +#define KEYFRAMES_TAG "keyframes" +#define KEYFRAMES_TIMESTAMP_TAG "times" +#define KEYFRAMES_BYTEOFFSET_TAG "filepositions" + + +enum { + FLV_HEADER_FLAG_HASVIDEO = 1, + FLV_HEADER_FLAG_HASAUDIO = 4, +}; + +enum FlvTagType { + FLV_TAG_TYPE_AUDIO = 0x08, + FLV_TAG_TYPE_VIDEO = 0x09, + FLV_TAG_TYPE_META = 0x12, +}; + +enum { + FLV_STREAM_TYPE_VIDEO, + FLV_STREAM_TYPE_AUDIO, + FLV_STREAM_TYPE_SUBTITLE, + FLV_STREAM_TYPE_DATA, + FLV_STREAM_TYPE_NB, +}; + +enum { + FLV_MONO = 0, + FLV_STEREO = 1, +}; + +enum { + FLV_SAMPLESSIZE_8BIT = 0, + FLV_SAMPLESSIZE_16BIT = 1 << FLV_AUDIO_SAMPLESSIZE_OFFSET, +}; + +enum { + FLV_SAMPLERATE_SPECIAL = 0, /**< signifies 5512Hz and 8000Hz in the case of NELLYMOSER */ + FLV_SAMPLERATE_11025HZ = 1 << FLV_AUDIO_SAMPLERATE_OFFSET, + FLV_SAMPLERATE_22050HZ = 2 << FLV_AUDIO_SAMPLERATE_OFFSET, + FLV_SAMPLERATE_44100HZ = 3 << FLV_AUDIO_SAMPLERATE_OFFSET, +}; + +enum { + FLV_CODECID_PCM = 0, + FLV_CODECID_ADPCM = 1 << FLV_AUDIO_CODECID_OFFSET, + FLV_CODECID_MP3 = 2 << FLV_AUDIO_CODECID_OFFSET, + FLV_CODECID_PCM_LE = 3 << FLV_AUDIO_CODECID_OFFSET, + FLV_CODECID_NELLYMOSER_16KHZ_MONO = 4 << FLV_AUDIO_CODECID_OFFSET, + FLV_CODECID_NELLYMOSER_8KHZ_MONO = 5 << FLV_AUDIO_CODECID_OFFSET, + FLV_CODECID_NELLYMOSER = 6 << FLV_AUDIO_CODECID_OFFSET, + FLV_CODECID_PCM_ALAW = 7 << FLV_AUDIO_CODECID_OFFSET, + FLV_CODECID_PCM_MULAW = 8 << FLV_AUDIO_CODECID_OFFSET, + FLV_CODECID_AAC = 10<< FLV_AUDIO_CODECID_OFFSET, + FLV_CODECID_SPEEX = 11<< FLV_AUDIO_CODECID_OFFSET, +}; + +enum { + FLV_CODECID_H263 = 2, + FLV_CODECID_SCREEN = 3, + FLV_CODECID_VP6 = 4, + FLV_CODECID_VP6A = 5, + FLV_CODECID_SCREEN2 = 6, + FLV_CODECID_H264 = 7, + FLV_CODECID_REALH263= 8, + FLV_CODECID_MPEG4 = 9, +}; + +enum { + PacketTypeSequenceStart = 0, + PacketTypeCodedFrames = 1, + PacketTypeSequenceEnd = 2, + PacketTypeCodedFramesX = 3, + PacketTypeMetadata = 4, + PacketTypeMPEG2TSSequenceStart = 5, +}; + +enum { + FLV_FRAME_KEY = 1 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< key frame (for AVC, a seekable frame) + FLV_FRAME_INTER = 2 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< inter frame (for AVC, a non-seekable frame) + FLV_FRAME_DISP_INTER = 3 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< disposable inter frame (H.263 only) + FLV_FRAME_GENERATED_KEY = 4 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< generated key frame (reserved for server use only) + FLV_FRAME_VIDEO_INFO_CMD = 5 << FLV_VIDEO_FRAMETYPE_OFFSET, ///< video info/command frame +}; + +typedef enum { + AMF_DATA_TYPE_NUMBER = 0x00, + AMF_DATA_TYPE_BOOL = 0x01, + AMF_DATA_TYPE_STRING = 0x02, + AMF_DATA_TYPE_OBJECT = 0x03, + AMF_DATA_TYPE_NULL = 0x05, + AMF_DATA_TYPE_UNDEFINED = 0x06, + AMF_DATA_TYPE_REFERENCE = 0x07, + AMF_DATA_TYPE_MIXEDARRAY = 0x08, + AMF_DATA_TYPE_OBJECT_END = 0x09, + AMF_DATA_TYPE_ARRAY = 0x0a, + AMF_DATA_TYPE_DATE = 0x0b, + AMF_DATA_TYPE_LONG_STRING = 0x0c, + AMF_DATA_TYPE_UNSUPPORTED = 0x0d, +} AMFDataType; + +#endif /* AVFORMAT_FLV_H */ diff --git a/include/libavformat/gxf.h b/include/libavformat/gxf.h new file mode 100644 index 0000000..dcdcdef --- /dev/null +++ b/include/libavformat/gxf.h @@ -0,0 +1,52 @@ +/* + * GXF demuxer + * copyright (c) 2006 Reimar Doeffinger + * + * 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 AVFORMAT_GXF_H +#define AVFORMAT_GXF_H + +typedef enum { + PKT_MAP = 0xbc, + PKT_MEDIA = 0xbf, + PKT_EOS = 0xfb, + PKT_FLT = 0xfc, + PKT_UMF = 0xfd, +} GXFPktType; + +typedef enum { + MAT_NAME = 0x40, + MAT_FIRST_FIELD = 0x41, + MAT_LAST_FIELD = 0x42, + MAT_MARK_IN = 0x43, + MAT_MARK_OUT = 0x44, + MAT_SIZE = 0x45, +} GXFMatTag; + +typedef enum { + TRACK_NAME = 0x4c, + TRACK_AUX = 0x4d, + TRACK_VER = 0x4e, + TRACK_MPG_AUX = 0x4f, + TRACK_FPS = 0x50, + TRACK_LINES = 0x51, + TRACK_FPF = 0x52, +} GXFTrackTag; + +#endif /* AVFORMAT_GXF_H */ diff --git a/include/libavformat/hevc.h b/include/libavformat/hevc.h new file mode 100644 index 0000000..12000b2 --- /dev/null +++ b/include/libavformat/hevc.h @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2014 Tim Walker + * + * 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 + */ + +/** + * @file + * internal header for HEVC (de)muxer utilities + */ + +#ifndef AVFORMAT_HEVC_H +#define AVFORMAT_HEVC_H + +#include +#include "avio.h" + +/** + * Writes Annex B formatted HEVC NAL units to the provided AVIOContext. + * + * The NAL units are converted to an MP4-compatible format (start code prefixes + * are replaced by 4-byte size fields, as per ISO/IEC 14496-15). + * + * If filter_ps is non-zero, any HEVC parameter sets found in the input will be + * discarded, and *ps_count will be set to the number of discarded PS NAL units. + * + * @param pb address of the AVIOContext where the data shall be written + * @param buf_in address of the buffer holding the input data + * @param size size (in bytes) of the input buffer + * @param filter_ps whether to write parameter set NAL units to the output (0) + * or to discard them (non-zero) + * @param ps_count address of the variable where the number of discarded + * parameter set NAL units shall be written, may be NULL + * @return the amount (in bytes) of data written in case of success, a negative + * value corresponding to an AVERROR code in case of failure + */ +int ff_hevc_annexb2mp4(AVIOContext *pb, const uint8_t *buf_in, + int size, int filter_ps, int *ps_count); + +/** + * Writes Annex B formatted HEVC NAL units to a data buffer. + * + * The NAL units are converted to an MP4-compatible format (start code prefixes + * are replaced by 4-byte size fields, as per ISO/IEC 14496-15). + * + * If filter_ps is non-zero, any HEVC parameter sets found in the input will be + * discarded, and *ps_count will be set to the number of discarded PS NAL units. + * + * On success, *size holds the size (in bytes) of the output data buffer. + * + * @param buf_in address of the buffer holding the input data + * @param size address of the variable holding the size (in bytes) of the input + * buffer (on input) and of the output buffer (on success) + * @param buf_out on success, address of the variable holding the address of + * the output buffer + * @param filter_ps whether to write parameter set NAL units to the output (0) + * or to discard them (non-zero) + * @param ps_count address of the variable where the number of discarded + * parameter set NAL units shall be written, may be NULL + * @return 0 in case of success, a negative value corresponding to an AVERROR + * code in case of failure + * @note *buf_out will be treated as uninitialized on input and won't be freed. + */ +int ff_hevc_annexb2mp4_buf(const uint8_t *buf_in, uint8_t **buf_out, + int *size, int filter_ps, int *ps_count); + +/** + * Writes HEVC extradata (parameter sets and declarative SEI NAL units with + * nuh_layer_id == 0, as a HEVCDecoderConfigurationRecord) to the + * provided AVIOContext. + * + * If the extradata is Annex B format, it gets converted to hvcC format before + * writing. + * + * @param pb address of the AVIOContext where the hvcC shall be written + * @param data address of the buffer holding the data needed to write the hvcC + * @param size size (in bytes) of the data buffer + * @param ps_array_completeness whether all parameter sets are in the hvcC (1) + * or there may be additional parameter sets in the bitstream (0) + * @return >=0 in case of success, a negative value corresponding to an AVERROR + * code in case of failure + */ +int ff_isom_write_hvcc(AVIOContext *pb, const uint8_t *data, + int size, int ps_array_completeness); + +/** + * Writes L-HEVC extradata (parameter sets with nuh_layer_id > 0, as a + * LHEVCDecoderConfigurationRecord) to the provided AVIOContext. + * + * If the extradata is Annex B format, it gets converted to lhvC format before + * writing. Otherwise, hvcC formated extradata is expected, not lhvC. + * + * @param pb address of the AVIOContext where the lhvC shall be written + * @param data address of the buffer holding the data needed to write the lhvC + * @param size size (in bytes) of the data buffer + * @param ps_array_completeness whether all parameter sets are in the lhvC (1) + * or there may be additional parameter sets in the bitstream (0) + * @return >=0 in case of success, a negative value corresponding to an AVERROR + * code in case of failure + */ +int ff_isom_write_lhvc(AVIOContext *pb, const uint8_t *data, + int size, int ps_array_completeness); +#endif /* AVFORMAT_HEVC_H */ diff --git a/include/libavformat/hls_sample_encryption.h b/include/libavformat/hls_sample_encryption.h new file mode 100644 index 0000000..d86eccb --- /dev/null +++ b/include/libavformat/hls_sample_encryption.h @@ -0,0 +1,66 @@ +/* + * Apple HTTP Live Streaming Sample Encryption/Decryption + * + * Copyright (c) 2021 Nachiket Tarate + * + * 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 + */ + +/** + * @file + * Apple HTTP Live Streaming Sample Encryption + * https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/HLS_Sample_Encryption + */ + +#ifndef AVFORMAT_HLS_SAMPLE_ENCRYPTION_H +#define AVFORMAT_HLS_SAMPLE_ENCRYPTION_H + +#include +#include + +#include "libavcodec/codec_id.h" +#include "libavcodec/packet.h" +#include "avformat.h" + + +#define HLS_MAX_ID3_TAGS_DATA_LEN 138 +#define HLS_MAX_AUDIO_SETUP_DATA_LEN 10 + +typedef struct HLSCryptoContext { + struct AVAES *aes_ctx; + uint8_t key[16]; + uint8_t iv[16]; +} HLSCryptoContext; + +typedef struct HLSAudioSetupInfo { + enum AVCodecID codec_id; + uint32_t codec_tag; + uint16_t priming; + uint8_t version; + uint8_t setup_data_length; + uint8_t setup_data[HLS_MAX_AUDIO_SETUP_DATA_LEN]; +} HLSAudioSetupInfo; + + +void ff_hls_senc_read_audio_setup_info(HLSAudioSetupInfo *info, const uint8_t *buf, size_t size); + +int ff_hls_senc_parse_audio_setup_info(AVStream *st, HLSAudioSetupInfo *info); + +int ff_hls_senc_decrypt_frame(enum AVCodecID codec_id, HLSCryptoContext *crypto_ctx, AVPacket *pkt); + +#endif /* AVFORMAT_HLS_SAMPLE_ENCRYPTION_H */ + diff --git a/include/libavformat/hlsplaylist.h b/include/libavformat/hlsplaylist.h new file mode 100644 index 0000000..d7aa44d --- /dev/null +++ b/include/libavformat/hlsplaylist.h @@ -0,0 +1,65 @@ +/* + * Apple HTTP Live Streaming segmenter + * Copyright (c) 2012, Luca Barbato + * Copyright (c) 2017 Akamai Technologies, Inc. + * + * 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 AVFORMAT_HLSPLAYLIST_H +#define AVFORMAT_HLSPLAYLIST_H + +#include + +#include "avformat.h" +#include "avio.h" + +typedef enum { + PLAYLIST_TYPE_NONE, + PLAYLIST_TYPE_EVENT, + PLAYLIST_TYPE_VOD, + PLAYLIST_TYPE_NB, +} PlaylistType; + +void ff_hls_write_playlist_version(AVIOContext *out, int version); +void ff_hls_write_audio_rendition(AVIOContext *out, const char *agroup, + const char *filename, const char *language, + int name_id, int is_default, int nb_channels); +void ff_hls_write_subtitle_rendition(AVIOContext *out, const char *sgroup, + const char *filename, const char *language, + int name_id, int is_default); +void ff_hls_write_stream_info(AVStream *st, AVIOContext *out, int bandwidth, + int avg_bandwidth, + const char *filename, const char *agroup, + const char *codecs, const char *ccgroup, + const char *sgroup); +void ff_hls_write_playlist_header(AVIOContext *out, int version, int allowcache, + int target_duration, int64_t sequence, + uint32_t playlist_type, int iframe_mode); +void ff_hls_write_init_file(AVIOContext *out, const char *filename, + int byterange_mode, int64_t size, int64_t pos); +int ff_hls_write_file_entry(AVIOContext *out, int insert_discont, + int byterange_mode, double duration, + int round_duration, int64_t size, + int64_t pos /* Used only if HLS_SINGLE_FILE flag is set */, + const char *baseurl /* Ignored if NULL */, + const char *filename, double *prog_date_time, + int64_t video_keyframe_size, int64_t video_keyframe_pos, + int iframe_mode); +void ff_hls_write_end_list (AVIOContext *out); + +#endif /* AVFORMAT_HLSPLAYLIST_H_ */ diff --git a/include/libavformat/http.h b/include/libavformat/http.h new file mode 100644 index 0000000..5f650ef --- /dev/null +++ b/include/libavformat/http.h @@ -0,0 +1,65 @@ +/* + * HTTP definitions + * Copyright (c) 2010 Josh Allmann + * + * 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 AVFORMAT_HTTP_H +#define AVFORMAT_HTTP_H + +#include "url.h" + +#define HTTP_HEADERS_SIZE 4096 + +/** + * Initialize the authentication state based on another HTTP URLContext. + * This can be used to pre-initialize the authentication parameters if + * they are known beforehand, to avoid having to do an initial failing + * request just to get the parameters. + * + * @param dest URL context whose authentication state gets updated + * @param src URL context whose authentication state gets copied + */ +void ff_http_init_auth_state(URLContext *dest, const URLContext *src); + +/** + * Send a new HTTP request, reusing the old connection. + * + * @param h pointer to the resource + * @param uri uri used to perform the request + * @return a negative value if an error condition occurred, 0 + * otherwise + */ +int ff_http_do_new_request(URLContext *h, const char *uri); + +/** + * Send a new HTTP request, reusing the old connection. + * + * @param h pointer to the resource + * @param uri uri used to perform the request + * @param options A dictionary filled with HTTP options. On return + * this parameter will be destroyed and replaced with a dict containing options + * that were not found. May be NULL. + * @return a negative value if an error condition occurred, 0 + * otherwise + */ +int ff_http_do_new_request2(URLContext *h, const char *uri, AVDictionary **options); + +int ff_http_averror(int status_code, int default_averror); + +#endif /* AVFORMAT_HTTP_H */ diff --git a/include/libavformat/httpauth.h b/include/libavformat/httpauth.h new file mode 100644 index 0000000..0e70859 --- /dev/null +++ b/include/libavformat/httpauth.h @@ -0,0 +1,79 @@ +/* + * HTTP authentication + * Copyright (c) 2010 Martin Storsjo + * + * 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 AVFORMAT_HTTPAUTH_H +#define AVFORMAT_HTTPAUTH_H + +/** + * Authentication types, ordered from weakest to strongest. + */ +typedef enum HTTPAuthType { + HTTP_AUTH_NONE = 0, /**< No authentication specified */ + HTTP_AUTH_BASIC, /**< HTTP 1.0 Basic auth from RFC 1945 + * (also in RFC 2617) */ + HTTP_AUTH_DIGEST, /**< HTTP 1.1 Digest auth from RFC 2617 */ +} HTTPAuthType; + +typedef struct DigestParams { + char nonce[300]; /**< Server specified nonce */ + char algorithm[10]; /**< Server specified digest algorithm */ + char qop[30]; /**< Quality of protection, containing the one + * that we've chosen to use, from the + * alternatives that the server offered. */ + char opaque[300]; /**< A server-specified string that should be + * included in authentication responses, not + * included in the actual digest calculation. */ + char stale[10]; /**< The server indicated that the auth was ok, + * but needs to be redone with a new, non-stale + * nonce. */ + int nc; /**< Nonce count, the number of earlier replies + * where this particular nonce has been used. */ +} DigestParams; + +/** + * HTTP Authentication state structure. Must be zero-initialized + * before used with the functions below. + */ +typedef struct HTTPAuthState { + /** + * The currently chosen auth type. + */ + int auth_type; + /** + * Authentication realm + */ + char realm[200]; + /** + * The parameters specific to digest authentication. + */ + DigestParams digest_params; + /** + * Auth ok, but needs to be resent with a new nonce. + */ + int stale; +} HTTPAuthState; + +void ff_http_auth_handle_header(HTTPAuthState *state, const char *key, + const char *value); +char *ff_http_auth_create_response(HTTPAuthState *state, const char *auth, + const char *path, const char *method); + +#endif /* AVFORMAT_HTTPAUTH_H */ diff --git a/include/libavformat/iamf.h b/include/libavformat/iamf.h new file mode 100644 index 0000000..fd8b57a --- /dev/null +++ b/include/libavformat/iamf.h @@ -0,0 +1,202 @@ +/* + * Immersive Audio Model and Formats common helpers and structs + * Copyright (c) 2023 James Almer + * + * 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 AVFORMAT_IAMF_H +#define AVFORMAT_IAMF_H + +#include +#include + +#include "libavutil/attributes_internal.h" +#include "libavutil/channel_layout.h" +#include "libavutil/iamf.h" +#include "libavcodec/codec_id.h" +#include "libavcodec/codec_par.h" + +#define MAX_IAMF_OBU_HEADER_SIZE (1 + 8 * 3) + +// OBU types (section 3.2). +enum IAMF_OBU_Type { + IAMF_OBU_IA_CODEC_CONFIG = 0, + IAMF_OBU_IA_AUDIO_ELEMENT = 1, + IAMF_OBU_IA_MIX_PRESENTATION = 2, + IAMF_OBU_IA_PARAMETER_BLOCK = 3, + IAMF_OBU_IA_TEMPORAL_DELIMITER = 4, + IAMF_OBU_IA_AUDIO_FRAME = 5, + IAMF_OBU_IA_AUDIO_FRAME_ID0 = 6, + IAMF_OBU_IA_AUDIO_FRAME_ID1 = 7, + IAMF_OBU_IA_AUDIO_FRAME_ID2 = 8, + IAMF_OBU_IA_AUDIO_FRAME_ID3 = 9, + IAMF_OBU_IA_AUDIO_FRAME_ID4 = 10, + IAMF_OBU_IA_AUDIO_FRAME_ID5 = 11, + IAMF_OBU_IA_AUDIO_FRAME_ID6 = 12, + IAMF_OBU_IA_AUDIO_FRAME_ID7 = 13, + IAMF_OBU_IA_AUDIO_FRAME_ID8 = 14, + IAMF_OBU_IA_AUDIO_FRAME_ID9 = 15, + IAMF_OBU_IA_AUDIO_FRAME_ID10 = 16, + IAMF_OBU_IA_AUDIO_FRAME_ID11 = 17, + IAMF_OBU_IA_AUDIO_FRAME_ID12 = 18, + IAMF_OBU_IA_AUDIO_FRAME_ID13 = 19, + IAMF_OBU_IA_AUDIO_FRAME_ID14 = 20, + IAMF_OBU_IA_AUDIO_FRAME_ID15 = 21, + IAMF_OBU_IA_AUDIO_FRAME_ID16 = 22, + IAMF_OBU_IA_AUDIO_FRAME_ID17 = 23, + // 24~30 reserved. + IAMF_OBU_IA_SEQUENCE_HEADER = 31, +}; + +typedef struct IAMFCodecConfig { + unsigned codec_config_id; + enum AVCodecID codec_id; + uint32_t codec_tag; + unsigned nb_samples; + int audio_roll_distance; + int sample_rate; + int extradata_size; + uint8_t *extradata; +} IAMFCodecConfig; + +typedef struct IAMFLayer { + unsigned int substream_count; + unsigned int coupled_substream_count; +} IAMFLayer; + +typedef struct IAMFSubStream { + unsigned int audio_substream_id; + + // demux + AVCodecParameters *codecpar; +} IAMFSubStream; + +typedef struct IAMFAudioElement { + const AVIAMFAudioElement *celement; + /** + * element backs celement iff the AVIAMFAudioElement + * is owned by this structure. + */ + AVIAMFAudioElement *element; + unsigned int audio_element_id; + + IAMFSubStream *substreams; + unsigned int nb_substreams; + + unsigned int codec_config_id; + + IAMFLayer *layers; + unsigned int nb_layers; +} IAMFAudioElement; + +typedef struct IAMFMixPresentation { + const AVIAMFMixPresentation *cmix; + /** + * mix backs cmix iff the AVIAMFMixPresentation + * is owned by this structure. + */ + AVIAMFMixPresentation *mix; + unsigned int mix_presentation_id; + + // demux + unsigned int count_label; + char **language_label; +} IAMFMixPresentation; + +typedef struct IAMFParamDefinition { + const IAMFAudioElement *audio_element; + AVIAMFParamDefinition *param; + int mode; + size_t param_size; +} IAMFParamDefinition; + +typedef struct IAMFContext { + IAMFCodecConfig **codec_configs; + int nb_codec_configs; + IAMFAudioElement **audio_elements; + int nb_audio_elements; + IAMFMixPresentation **mix_presentations; + int nb_mix_presentations; + IAMFParamDefinition **param_definitions; + int nb_param_definitions; +} IAMFContext; + +enum IAMF_Anchor_Element { + IAMF_ANCHOR_ELEMENT_UNKNWONW, + IAMF_ANCHOR_ELEMENT_DIALOGUE, + IAMF_ANCHOR_ELEMENT_ALBUM, +}; + +enum IAMF_Sound_System { + SOUND_SYSTEM_A_0_2_0 = 0, // "Loudspeaker configuration for Sound System A" + SOUND_SYSTEM_B_0_5_0 = 1, // "Loudspeaker configuration for Sound System B" + SOUND_SYSTEM_C_2_5_0 = 2, // "Loudspeaker configuration for Sound System C" + SOUND_SYSTEM_D_4_5_0 = 3, // "Loudspeaker configuration for Sound System D" + SOUND_SYSTEM_E_4_5_1 = 4, // "Loudspeaker configuration for Sound System E" + SOUND_SYSTEM_F_3_7_0 = 5, // "Loudspeaker configuration for Sound System F" + SOUND_SYSTEM_G_4_9_0 = 6, // "Loudspeaker configuration for Sound System G" + SOUND_SYSTEM_H_9_10_3 = 7, // "Loudspeaker configuration for Sound System H" + SOUND_SYSTEM_I_0_7_0 = 8, // "Loudspeaker configuration for Sound System I" + SOUND_SYSTEM_J_4_7_0 = 9, // "Loudspeaker configuration for Sound System J" + SOUND_SYSTEM_10_2_7_0 = 10, // "Loudspeaker configuration for Sound System I" + Ltf + Rtf + SOUND_SYSTEM_11_2_3_0 = 11, // Front subset of "Loudspeaker configuration for Sound System J" + SOUND_SYSTEM_12_0_1_0 = 12, // Mono +}; + +struct IAMFSoundSystemMap { + enum IAMF_Sound_System id; + AVChannelLayout layout; +}; + +FF_VISIBILITY_PUSH_HIDDEN +extern const AVChannelLayout ff_iamf_scalable_ch_layouts[10]; +extern const struct IAMFSoundSystemMap ff_iamf_sound_system_map[13]; + +static inline IAMFCodecConfig *ff_iamf_get_codec_config(const IAMFContext *c, + unsigned int codec_config_id) +{ + IAMFCodecConfig *codec_config = NULL; + + for (int i = 0; i < c->nb_codec_configs; i++) { + if (c->codec_configs[i]->codec_config_id == codec_config_id) + codec_config = c->codec_configs[i]; + } + + return codec_config; +} + +static inline IAMFParamDefinition *ff_iamf_get_param_definition(const IAMFContext *iamf, + unsigned int parameter_id) +{ + IAMFParamDefinition *param_definition = NULL; + + for (int i = 0; i < iamf->nb_param_definitions; i++) + if (iamf->param_definitions[i]->param->parameter_id == parameter_id) { + param_definition = iamf->param_definitions[i]; + break; + } + + return param_definition; +} + +void ff_iamf_free_audio_element(IAMFAudioElement **paudio_element); +void ff_iamf_free_mix_presentation(IAMFMixPresentation **pmix_presentation); +void ff_iamf_uninit_context(IAMFContext *c); +FF_VISIBILITY_POP_HIDDEN + +#endif /* AVFORMAT_IAMF_H */ diff --git a/include/libavformat/iamf_parse.h b/include/libavformat/iamf_parse.h new file mode 100644 index 0000000..bb50648 --- /dev/null +++ b/include/libavformat/iamf_parse.h @@ -0,0 +1,37 @@ +/* + * Immersive Audio Model and Formats parsing + * Copyright (c) 2023 James Almer + * + * 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 AVFORMAT_IAMF_PARSE_H +#define AVFORMAT_IAMF_PARSE_H + +#include + +#include "avio.h" +#include "iamf.h" + +int ff_iamf_parse_obu_header(const uint8_t *buf, int buf_size, + unsigned *obu_size, int *start_pos, enum IAMF_OBU_Type *type, + unsigned *skip_samples, unsigned *discard_padding); + +int ff_iamfdec_read_descriptors(IAMFContext *c, AVIOContext *pb, + int size, void *log_ctx); + +#endif /* AVFORMAT_IAMF_PARSE_H */ diff --git a/include/libavformat/iamf_reader.h b/include/libavformat/iamf_reader.h new file mode 100644 index 0000000..ecb92d4 --- /dev/null +++ b/include/libavformat/iamf_reader.h @@ -0,0 +1,49 @@ +/* + * Immersive Audio Model and Formats demuxing utils + * Copyright (c) 2024 James Almer + * + * 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 AVFORMAT_IAMF_READER_H +#define AVFORMAT_IAMF_READER_H + +#include + +#include "libavcodec/packet.h" +#include "avformat.h" +#include "avio.h" +#include "iamf.h" + +typedef struct IAMFDemuxContext { + IAMFContext iamf; + + // Packet side data + AVIAMFParamDefinition *mix; + size_t mix_size; + AVIAMFParamDefinition *demix; + size_t demix_size; + AVIAMFParamDefinition *recon; + size_t recon_size; +} IAMFDemuxContext; + +int ff_iamf_read_packet(AVFormatContext *s, IAMFDemuxContext *c, + AVIOContext *pb, int max_size, AVPacket *pkt); + +void ff_iamf_read_deinit(IAMFDemuxContext *c); + +#endif /* AVFORMAT_IAMF_READER_H */ diff --git a/include/libavformat/iamf_writer.h b/include/libavformat/iamf_writer.h new file mode 100644 index 0000000..05f3d32 --- /dev/null +++ b/include/libavformat/iamf_writer.h @@ -0,0 +1,42 @@ +/* + * Immersive Audio Model and Formats muxing helpers and structs + * Copyright (c) 2023 James Almer + * + * 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 AVFORMAT_IAMF_WRITER_H +#define AVFORMAT_IAMF_WRITER_H + +#include + +#include "libavcodec/packet.h" +#include "avformat.h" +#include "avio.h" +#include "iamf.h" + +int ff_iamf_add_audio_element(IAMFContext *iamf, const AVStreamGroup *stg, void *log_ctx); +int ff_iamf_add_mix_presentation(IAMFContext *iamf, const AVStreamGroup *stg, void *log_ctx); + +int ff_iamf_write_descriptors(const IAMFContext *iamf, AVIOContext *pb, void *log_ctx); + +int ff_iamf_write_parameter_blocks(const IAMFContext *iamf, AVIOContext *pb, + const AVPacket *pkt, void *log_ctx); +int ff_iamf_write_audio_frame(const IAMFContext *iamf, AVIOContext *pb, + unsigned audio_substream_id, const AVPacket *pkt); + +#endif /* AVFORMAT_IAMF_WRITER_H */ diff --git a/include/libavformat/id3v1.h b/include/libavformat/id3v1.h new file mode 100644 index 0000000..b3ad16d --- /dev/null +++ b/include/libavformat/id3v1.h @@ -0,0 +1,41 @@ +/* + * ID3v1 header parser + * Copyright (c) 2003 Fabrice Bellard + * + * 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 AVFORMAT_ID3V1_H +#define AVFORMAT_ID3V1_H + +#include "avformat.h" + +#define ID3v1_TAG_SIZE 128 + +#define ID3v1_GENRE_MAX 191 + +/** + * ID3v1 genres + */ +extern const char * const ff_id3v1_genre_str[ID3v1_GENRE_MAX + 1]; + +/** + * Read an ID3v1 tag + */ +void ff_id3v1_read(AVFormatContext *s); + +#endif /* AVFORMAT_ID3V1_H */ diff --git a/include/libavformat/id3v2.h b/include/libavformat/id3v2.h new file mode 100644 index 0000000..9afa5a2 --- /dev/null +++ b/include/libavformat/id3v2.h @@ -0,0 +1,214 @@ +/* + * ID3v2 header parser + * Copyright (c) 2003 Fabrice Bellard + * + * 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 AVFORMAT_ID3V2_H +#define AVFORMAT_ID3V2_H + +#include +#include "avformat.h" +#include "internal.h" +#include "metadata.h" + +#define ID3v2_HEADER_SIZE 10 + +/** + * Default magic bytes for ID3v2 header: "ID3" + */ +#define ID3v2_DEFAULT_MAGIC "ID3" + +#define ID3v2_FLAG_DATALEN 0x0001 +#define ID3v2_FLAG_UNSYNCH 0x0002 +#define ID3v2_FLAG_ENCRYPTION 0x0004 +#define ID3v2_FLAG_COMPRESSION 0x0008 + +#define ID3v2_PRIV_METADATA_PREFIX "id3v2_priv." + +enum ID3v2Encoding { + ID3v2_ENCODING_ISO8859 = 0, + ID3v2_ENCODING_UTF16BOM = 1, + ID3v2_ENCODING_UTF16BE = 2, + ID3v2_ENCODING_UTF8 = 3, +}; + +typedef struct ID3v2EncContext { + int version; ///< ID3v2 minor version, either 3 or 4 + int64_t size_pos; ///< offset of the tag total size + int len; ///< size of the tag written so far +} ID3v2EncContext; + +typedef struct ID3v2ExtraMetaGEOB { + uint32_t datasize; + uint8_t *mime_type; + uint8_t *file_name; + uint8_t *description; + uint8_t *data; +} ID3v2ExtraMetaGEOB; + +typedef struct ID3v2ExtraMetaAPIC { + AVBufferRef *buf; + const char *type; + uint8_t *description; + enum AVCodecID id; +} ID3v2ExtraMetaAPIC; + +typedef struct ID3v2ExtraMetaPRIV { + uint8_t *owner; + uint8_t *data; + uint32_t datasize; +} ID3v2ExtraMetaPRIV; + +typedef struct ID3v2ExtraMetaCHAP { + uint8_t *element_id; + uint32_t start, end; + AVDictionary *meta; +} ID3v2ExtraMetaCHAP; + +typedef struct ID3v2ExtraMeta { + const char *tag; + struct ID3v2ExtraMeta *next; + union { + ID3v2ExtraMetaAPIC apic; + ID3v2ExtraMetaCHAP chap; + ID3v2ExtraMetaGEOB geob; + ID3v2ExtraMetaPRIV priv; + } data; +} ID3v2ExtraMeta; + +/** + * Detect ID3v2 Header. + * @param buf must be ID3v2_HEADER_SIZE byte long + * @param magic magic bytes to identify the header. + * If in doubt, use ID3v2_DEFAULT_MAGIC. + */ +int ff_id3v2_match(const uint8_t *buf, const char *magic); + +/** + * Get the length of an ID3v2 tag. + * @param buf must be ID3v2_HEADER_SIZE bytes long and point to the start of an + * already detected ID3v2 tag + */ +int ff_id3v2_tag_len(const uint8_t *buf); + +/** + * Read an ID3v2 tag into specified dictionary and retrieve supported extra metadata. + * + * @param metadata Parsed metadata is stored here + * @param[out] extra_meta If not NULL, extra metadata is parsed into a list of + * ID3v2ExtraMeta structs and *extra_meta points to the head of the list + */ +void ff_id3v2_read_dict(AVIOContext *pb, AVDictionary **metadata, const char *magic, ID3v2ExtraMeta **extra_meta); + +/** + * Read an ID3v2 tag, including supported extra metadata. + * + * Data is read from and stored to AVFormatContext. + * + * @param[out] extra_meta If not NULL, extra metadata is parsed into a list of + * ID3v2ExtraMeta structs and *extra_meta points to the head of the list + * @param[opt] max_search_search restrict ID3 magic number search (bytes from start) + */ +void ff_id3v2_read(AVFormatContext *s, const char *magic, ID3v2ExtraMeta **extra_meta, + unsigned int max_search_size); + +/** + * Initialize an ID3v2 tag. + */ +void ff_id3v2_start(ID3v2EncContext *id3, AVIOContext *pb, int id3v2_version, + const char *magic); + +/** + * Convert and write all global metadata from s into an ID3v2 tag. + */ +int ff_id3v2_write_metadata(AVFormatContext *s, ID3v2EncContext *id3); + +/** + * Write an attached picture from pkt into an ID3v2 tag. + */ +int ff_id3v2_write_apic(AVFormatContext *s, ID3v2EncContext *id3, AVPacket *pkt); + +/** + * Finalize an opened ID3v2 tag. + */ +void ff_id3v2_finish(ID3v2EncContext *id3, AVIOContext *pb, int padding_bytes); + +/** + * Write an ID3v2 tag containing all global metadata from s. + * @param id3v2_version Subversion of ID3v2; supported values are 3 and 4 + * @param magic magic bytes to identify the header + * If in doubt, use ID3v2_DEFAULT_MAGIC. + */ +int ff_id3v2_write_simple(struct AVFormatContext *s, int id3v2_version, const char *magic); + +/** + * Free memory allocated parsing special (non-text) metadata. + * @param extra_meta Pointer to a pointer to the head of a ID3v2ExtraMeta list, *extra_meta is set to NULL. + */ +void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta); + +/** + * Create a stream for each APIC (attached picture) extracted from the + * ID3v2 header. + */ +int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta *extra_meta); + +/** + * Create chapters for all CHAP tags found in the ID3v2 header. + */ +int ff_id3v2_parse_chapters(AVFormatContext *s, ID3v2ExtraMeta *extra_meta); + +/** + * Parse PRIV tags into a dictionary. The PRIV owner is the metadata key. The + * PRIV data is the value, with non-printable characters escaped. + */ +int ff_id3v2_parse_priv_dict(AVDictionary **d, ID3v2ExtraMeta *extra_meta); + +/** + * Add metadata for all PRIV tags in the ID3v2 header. The PRIV owner is the + * metadata key. The PRIV data is the value, with non-printable characters + * escaped. + */ +int ff_id3v2_parse_priv(AVFormatContext *s, ID3v2ExtraMeta *extra_meta); + +extern const AVMetadataConv ff_id3v2_34_metadata_conv[]; +extern const AVMetadataConv ff_id3v2_4_metadata_conv[]; + +/** + * A list of text information frames allowed in both ID3 v2.3 and v2.4 + * http://www.id3.org/id3v2.4.0-frames + * http://www.id3.org/id3v2.4.0-changes + */ +extern const char ff_id3v2_tags[][4]; + +/** + * ID3v2.4-only text information frames. + */ +extern const char ff_id3v2_4_tags[][4]; + +/** + * ID3v2.3-only text information frames. + */ +extern const char ff_id3v2_3_tags[][4]; + +extern const CodecMime ff_id3v2_mime_tags[]; + +extern const char * const ff_id3v2_picture_types[21]; + +#endif /* AVFORMAT_ID3V2_H */ diff --git a/include/libavformat/imf.h b/include/libavformat/imf.h new file mode 100644 index 0000000..ef124bf --- /dev/null +++ b/include/libavformat/imf.h @@ -0,0 +1,203 @@ +/* + * 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 + */ + +/* + * + * Copyright (c) Sandflow Consulting LLC + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * Public header file for the processing of Interoperable Master Format (IMF) + * packages. + * + * @author Pierre-Anthony Lemieux + * @author Valentin Noel + * @file + * @ingroup lavu_imf + */ + +#ifndef AVFORMAT_IMF_H +#define AVFORMAT_IMF_H + +#include "avformat.h" +#include "libavformat/avio.h" +#include "libavutil/rational.h" +#include "libavutil/uuid.h" +#include "libavutil/timecode.h" +#include + +/** + * IMF Composition Playlist Base Resource + */ +typedef struct FFIMFBaseResource { + AVRational edit_rate; /**< BaseResourceType/EditRate */ + uint32_t entry_point; /**< BaseResourceType/EntryPoint */ + uint32_t duration; /**< BaseResourceType/Duration */ + uint32_t repeat_count; /**< BaseResourceType/RepeatCount */ +} FFIMFBaseResource; + +/** + * IMF Composition Playlist Track File Resource + */ +typedef struct FFIMFTrackFileResource { + FFIMFBaseResource base; + AVUUID track_file_uuid; /**< TrackFileResourceType/TrackFileId */ +} FFIMFTrackFileResource; + +/** + * IMF Marker + */ +typedef struct FFIMFMarker { + xmlChar *label_utf8; /**< Marker/Label */ + xmlChar *scope_utf8; /**< Marker/Label/\@scope */ + uint32_t offset; /**< Marker/Offset */ +} FFIMFMarker; + +/** + * IMF Composition Playlist Marker Resource + */ +typedef struct FFIMFMarkerResource { + FFIMFBaseResource base; + uint32_t marker_count; /**< Number of Marker elements */ + FFIMFMarker *markers; /**< Marker elements */ +} FFIMFMarkerResource; + +/** + * IMF Composition Playlist Virtual Track + */ +typedef struct FFIMFBaseVirtualTrack { + AVUUID id_uuid; /**< TrackId associated with the Virtual Track */ +} FFIMFBaseVirtualTrack; + +/** + * IMF Composition Playlist Virtual Track that consists of Track File Resources + */ +typedef struct FFIMFTrackFileVirtualTrack { + FFIMFBaseVirtualTrack base; + uint32_t resource_count; /**< Number of Resource elements present in the Virtual Track */ + FFIMFTrackFileResource *resources; /**< Resource elements of the Virtual Track */ + unsigned int resources_alloc_sz; /**< Size of the resources buffer */ +} FFIMFTrackFileVirtualTrack; + +/** + * IMF Composition Playlist Virtual Track that consists of Marker Resources + */ +typedef struct FFIMFMarkerVirtualTrack { + FFIMFBaseVirtualTrack base; + uint32_t resource_count; /**< Number of Resource elements present in the Virtual Track */ + FFIMFMarkerResource *resources; /**< Resource elements of the Virtual Track */ +} FFIMFMarkerVirtualTrack; + +/** + * IMF Composition Playlist + */ +typedef struct FFIMFCPL { + AVUUID id_uuid; /**< CompositionPlaylist/Id element */ + xmlChar *content_title_utf8; /**< CompositionPlaylist/ContentTitle element */ + AVRational edit_rate; /**< CompositionPlaylist/EditRate element */ + AVTimecode *tc; /**< CompositionPlaylist/CompositionTimecode element */ + FFIMFMarkerVirtualTrack *main_markers_track; /**< Main Marker Virtual Track */ + FFIMFTrackFileVirtualTrack *main_image_2d_track; /**< Main Image Virtual Track */ + uint32_t main_audio_track_count; /**< Number of Main Audio Virtual Tracks */ + FFIMFTrackFileVirtualTrack *main_audio_tracks; /**< Main Audio Virtual Tracks */ +} FFIMFCPL; + +/** + * Parse an IMF CompositionPlaylist element into the FFIMFCPL data structure. + * @param[in] log_ctx Logging context (points to an instance of AVClass). May be NULL. + * @param[in] doc An XML document from which the CPL is read. + * @param[out] cpl Pointer to a memory area (allocated by the client), where the + * function writes a pointer to the newly constructed FFIMFCPL structure (or + * NULL if the CPL could not be parsed). The client is responsible for freeing + * the FFIMFCPL structure using ff_imf_cpl_free(). + * @return A non-zero value in case of an error. + */ +int ff_imf_parse_cpl_from_xml_dom(void *log_ctx, xmlDocPtr doc, FFIMFCPL **cpl); + +/** + * Parse an IMF Composition Playlist document into the FFIMFCPL data structure. + * @param[in] log_ctx Logging context (points to an instance of AVClass). May be NULL. + * @param[in] in The context from which the CPL is read. + * @param[out] cpl Pointer to a memory area (allocated by the client), where the + * function writes a pointer to the newly constructed FFIMFCPL structure (or + * NULL if the CPL could not be parsed). The client is responsible for freeing + * the FFIMFCPL structure using ff_imf_cpl_free(). + * @return A non-zero value in case of an error. + */ +int ff_imf_parse_cpl(void *log_ctx, AVIOContext *in, FFIMFCPL **cpl); + +/** + * Allocates and initializes an FFIMFCPL data structure. + * @return A pointer to the newly constructed FFIMFCPL structure (or NULL if the + * structure could not be constructed). The client is responsible for freeing + * the FFIMFCPL structure using ff_imf_cpl_free(). + */ +FFIMFCPL *ff_imf_cpl_alloc(void); + +/** + * Deletes an FFIMFCPL data structure previously instantiated with ff_imf_cpl_alloc(). + * @param[in] cpl The FFIMFCPL structure to delete. + */ +void ff_imf_cpl_free(FFIMFCPL *cpl); + +/** + * Reads an unsigned 32-bit integer from an XML element + * @return 0 on success, < 0 AVERROR code on error. + */ +int ff_imf_xml_read_uint32(xmlNodePtr element, uint32_t *number); + +/** + * Reads an AVRational from an XML element + * @return 0 on success, < 0 AVERROR code on error. + */ +int ff_imf_xml_read_rational(xmlNodePtr element, AVRational *rational); + +/** + * Reads a UUID from an XML element + * @return 0 on success, < 0 AVERROR code on error. + */ +int ff_imf_xml_read_uuid(xmlNodePtr element, AVUUID uuid); + +/** + * Returns the first child element with the specified local name + * @return A pointer to the child element, or NULL if no such child element exists. + */ +xmlNodePtr ff_imf_xml_get_child_element_by_name(xmlNodePtr parent, const char *name_utf8); + +#endif diff --git a/include/libavformat/img2.h b/include/libavformat/img2.h new file mode 100644 index 0000000..e98902c --- /dev/null +++ b/include/libavformat/img2.h @@ -0,0 +1,79 @@ +/* + * Image format + * Copyright (c) 2014 Michael Niedermayer + * + * 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 AVFORMAT_IMG2_H +#define AVFORMAT_IMG2_H + +#include +#include "avformat.h" +#include "libavutil/opt.h" + +#if HAVE_GLOB +#include +#endif + +enum PatternType { + PT_GLOB_SEQUENCE, + PT_GLOB, + PT_SEQUENCE, + PT_NONE, + PT_DEFAULT +}; + +typedef struct VideoDemuxData { + const AVClass *class; /**< Class for private options. */ + int img_first; + int img_last; + int img_number; + int64_t pts; + int img_count; + int is_pipe; + int split_planes; /**< use independent file for each Y, U, V plane */ + char path[1024]; + char *pixel_format; /**< Set by a private option. */ + int width, height; /**< Set by a private option. */ + AVRational framerate; /**< Set by a private option. */ + int loop; + int pattern_type; /**< PatternType */ + int use_glob; +#if HAVE_GLOB + glob_t globstate; +#endif + int start_number; + int start_number_range; + int frame_size; + int ts_from_file; + int export_path_metadata; /**< enabled when set to 1. */ +} VideoDemuxData; + +typedef struct IdStrMap { + enum AVCodecID id; + char str[12]; +} IdStrMap; + +extern const IdStrMap ff_img_tags[]; + +extern const AVOption ff_img_options[]; + +int ff_img_read_header(AVFormatContext *s1); + +int ff_img_read_packet(AVFormatContext *s1, AVPacket *pkt); +#endif diff --git a/include/libavformat/internal.h b/include/libavformat/internal.h new file mode 100644 index 0000000..6c026f0 --- /dev/null +++ b/include/libavformat/internal.h @@ -0,0 +1,769 @@ +/* + * copyright (c) 2001 Fabrice Bellard + * + * 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 AVFORMAT_INTERNAL_H +#define AVFORMAT_INTERNAL_H + +#include + +#include "libavcodec/packet_internal.h" + +#include "avformat.h" + +#define MAX_URL_SIZE 4096 + +/** size of probe buffer, for guessing file type from file contents */ +#define PROBE_BUF_MIN 2048 +#define PROBE_BUF_MAX (1 << 20) + +#ifdef DEBUG +# define hex_dump_debug(class, buf, size) av_hex_dump_log(class, AV_LOG_DEBUG, buf, size) +#else +# define hex_dump_debug(class, buf, size) do { if (0) av_hex_dump_log(class, AV_LOG_DEBUG, buf, size); } while(0) +#endif + +typedef struct AVCodecTag { + enum AVCodecID id; + unsigned int tag; +} AVCodecTag; + +typedef struct CodecMime{ + char str[32]; + enum AVCodecID id; +} CodecMime; + +/*************************************************/ +/* fractional numbers for exact pts handling */ + +/** + * The exact value of the fractional number is: 'val + num / den'. + * num is assumed to be 0 <= num < den. + */ +typedef struct FFFrac { + int64_t val, num, den; +} FFFrac; + + +typedef struct FFFormatContext { + /** + * The public context. + */ + AVFormatContext pub; + + /** + * Number of streams relevant for interleaving. + * Muxing only. + */ + int nb_interleaved_streams; + + /** + * Whether the timestamp shift offset has already been determined. + * -1: disabled, 0: not yet determined, 1: determined. + */ + enum { + AVOID_NEGATIVE_TS_DISABLED = -1, + AVOID_NEGATIVE_TS_UNKNOWN = 0, + AVOID_NEGATIVE_TS_KNOWN = 1, + } avoid_negative_ts_status; +#define AVOID_NEGATIVE_TS_ENABLED(status) ((status) >= 0) + + /** + * The interleavement function in use. Always set for muxers. + */ + int (*interleave_packet)(struct AVFormatContext *s, AVPacket *pkt, + int flush, int has_packet); + + /** + * This buffer is only needed when packets were already buffered but + * not decoded, for example to get the codec parameters in MPEG + * streams. + */ + PacketList packet_buffer; + + /* av_seek_frame() support */ + int64_t data_offset; /**< offset of the first packet */ + + /** + * Raw packets from the demuxer, prior to parsing and decoding. + * This buffer is used for buffering packets until the codec can + * be identified, as parsing cannot be done without knowing the + * codec. + */ + PacketList raw_packet_buffer; + /** + * Packets split by the parser get queued here. + */ + PacketList parse_queue; + /** + * The generic code uses this as a temporary packet + * to parse packets or for muxing, especially flushing. + * For demuxers, it may also be used for other means + * for short periods that are guaranteed not to overlap + * with calls to av_read_frame() (or ff_read_packet()) + * or with each other. + * It may be used by demuxers as a replacement for + * stack packets (unless they call one of the aforementioned + * functions with their own AVFormatContext). + * Every user has to ensure that this packet is blank + * after using it. + */ + AVPacket *parse_pkt; + + /** + * Used to hold temporary packets for the generic demuxing code. + * When muxing, it may be used by muxers to hold packets (even + * permanent ones). + */ + AVPacket *pkt; + /** + * Sum of the size of packets in raw_packet_buffer, in bytes. + */ + int raw_packet_buffer_size; + +#if FF_API_COMPUTE_PKT_FIELDS2 + int missing_ts_warning; +#endif + +#if FF_API_AVSTREAM_SIDE_DATA + int inject_global_side_data; +#endif + + int avoid_negative_ts_use_pts; + +#if FF_API_LAVF_SHORTEST + /** + * Timestamp of the end of the shortest stream. + */ + int64_t shortest_end; +#endif + + /** + * Whether or not avformat_init_output has already been called + */ + int initialized; + + /** + * Whether or not avformat_init_output fully initialized streams + */ + int streams_initialized; + + /** + * ID3v2 tag useful for MP3 demuxing + */ + AVDictionary *id3v2_meta; + + /* + * Prefer the codec framerate for avg_frame_rate computation. + */ + int prefer_codec_framerate; + + /** + * Set if chapter ids are strictly monotonic. + */ + int chapter_ids_monotonic; + + /** + * Contexts and child contexts do not contain a metadata option + */ + int metafree; +} FFFormatContext; + +static av_always_inline FFFormatContext *ffformatcontext(AVFormatContext *s) +{ + return (FFFormatContext*)s; +} + +typedef struct FFStream { + /** + * The public context. + */ + AVStream pub; + + AVFormatContext *fmtctx; + /** + * Set to 1 if the codec allows reordering, so pts can be different + * from dts. + */ + int reorder; + + /** + * bitstream filter to run on stream + * - encoding: Set by muxer using ff_stream_add_bitstream_filter + * - decoding: unused + */ + struct AVBSFContext *bsfc; + + /** + * Whether or not check_bitstream should still be run on each packet + */ + int bitstream_checked; + + /** + * The codec context used by avformat_find_stream_info, the parser, etc. + */ + struct AVCodecContext *avctx; + /** + * 1 if avctx has been initialized with the values from the codec parameters + */ + int avctx_inited; + + /* the context for extracting extradata in find_stream_info() + * inited=1/bsf=NULL signals that extracting is not possible (codec not + * supported) */ + struct { + struct AVBSFContext *bsf; + int inited; + } extract_extradata; + + /** + * Whether the internal avctx needs to be updated from codecpar (after a late change to codecpar) + */ + int need_context_update; + + int is_intra_only; + + FFFrac priv_pts; + + /** + * Stream information used internally by avformat_find_stream_info() + */ + struct FFStreamInfo *info; + + AVIndexEntry *index_entries; /**< Only used if the format does not + support seeking natively. */ + int nb_index_entries; + unsigned int index_entries_allocated_size; + + int64_t interleaver_chunk_size; + int64_t interleaver_chunk_duration; + + /** + * stream probing state + * -1 -> probing finished + * 0 -> no probing requested + * rest -> perform probing with request_probe being the minimum score to accept. + */ + int request_probe; + /** + * Indicates that everything up to the next keyframe + * should be discarded. + */ + int skip_to_keyframe; + + /** + * Number of samples to skip at the start of the frame decoded from the next packet. + */ + int skip_samples; + + /** + * If not 0, the number of samples that should be skipped from the start of + * the stream (the samples are removed from packets with pts==0, which also + * assumes negative timestamps do not happen). + * Intended for use with formats such as mp3 with ad-hoc gapless audio + * support. + */ + int64_t start_skip_samples; + + /** + * If not 0, the first audio sample that should be discarded from the stream. + * This is broken by design (needs global sample count), but can't be + * avoided for broken by design formats such as mp3 with ad-hoc gapless + * audio support. + */ + int64_t first_discard_sample; + + /** + * The sample after last sample that is intended to be discarded after + * first_discard_sample. Works on frame boundaries only. Used to prevent + * early EOF if the gapless info is broken (considered concatenated mp3s). + */ + int64_t last_discard_sample; + + /** + * Number of internally decoded frames, used internally in libavformat, do not access + * its lifetime differs from info which is why it is not in that structure. + */ + int nb_decoded_frames; + + /** + * Timestamp offset added to timestamps before muxing + */ + int64_t mux_ts_offset; + + /** + * This is the lowest ts allowed in this track; it may be set by the muxer + * during init or write_header and influences the automatic timestamp + * shifting code. + */ + int64_t lowest_ts_allowed; + + /** + * Internal data to check for wrapping of the time stamp + */ + int64_t pts_wrap_reference; + + /** + * Options for behavior, when a wrap is detected. + * + * Defined by AV_PTS_WRAP_ values. + * + * If correction is enabled, there are two possibilities: + * If the first time stamp is near the wrap point, the wrap offset + * will be subtracted, which will create negative time stamps. + * Otherwise the offset will be added. + */ + int pts_wrap_behavior; + + /** + * Internal data to prevent doing update_initial_durations() twice + */ + int update_initial_durations_done; + +#define MAX_REORDER_DELAY 16 + + /** + * Internal data to generate dts from pts + */ + int64_t pts_reorder_error[MAX_REORDER_DELAY+1]; + uint8_t pts_reorder_error_count[MAX_REORDER_DELAY+1]; + + int64_t pts_buffer[MAX_REORDER_DELAY+1]; + + /** + * Internal data to analyze DTS and detect faulty mpeg streams + */ + int64_t last_dts_for_order_check; + uint8_t dts_ordered; + uint8_t dts_misordered; + +#if FF_API_AVSTREAM_SIDE_DATA + /** + * Internal data to inject global side data + */ + int inject_global_side_data; +#endif + + /** + * display aspect ratio (0 if unknown) + * - encoding: unused + * - decoding: Set by libavformat to calculate sample_aspect_ratio internally + */ + AVRational display_aspect_ratio; + + AVProbeData probe_data; + + /** + * last packet in packet_buffer for this stream when muxing. + */ + PacketListEntry *last_in_packet_buffer; + + int64_t last_IP_pts; + int last_IP_duration; + + /** + * Number of packets to buffer for codec probing + */ + int probe_packets; + + /* av_read_frame() support */ + enum AVStreamParseType need_parsing; + struct AVCodecParserContext *parser; + + /** + * Number of frames that have been demuxed during avformat_find_stream_info() + */ + int codec_info_nb_frames; + + /** + * Stream Identifier + * This is the MPEG-TS stream identifier +1 + * 0 means unknown + */ + int stream_identifier; + + // Timestamp generation support: + /** + * Timestamp corresponding to the last dts sync point. + * + * Initialized when AVCodecParserContext.dts_sync_point >= 0 and + * a DTS is received from the underlying container. Otherwise set to + * AV_NOPTS_VALUE by default. + */ + int64_t first_dts; + int64_t cur_dts; + + const struct AVCodecDescriptor *codec_desc; + +#if FF_API_INTERNAL_TIMING + AVRational transferred_mux_tb; +#endif +} FFStream; + +static av_always_inline FFStream *ffstream(AVStream *st) +{ + return (FFStream*)st; +} + +static av_always_inline const FFStream *cffstream(const AVStream *st) +{ + return (const FFStream*)st; +} + +typedef struct FFStreamGroup { + /** + * The public context. + */ + AVStreamGroup pub; + + AVFormatContext *fmtctx; +} FFStreamGroup; + + +static av_always_inline FFStreamGroup *ffstreamgroup(AVStreamGroup *stg) +{ + return (FFStreamGroup*)stg; +} + +static av_always_inline const FFStreamGroup *cffstreamgroup(const AVStreamGroup *stg) +{ + return (const FFStreamGroup*)stg; +} + +#ifdef __GNUC__ +#define dynarray_add(tab, nb_ptr, elem)\ +do {\ + __typeof__(tab) _tab = (tab);\ + __typeof__(elem) _elem = (elem);\ + (void)sizeof(**_tab == _elem); /* check that types are compatible */\ + av_dynarray_add(_tab, nb_ptr, _elem);\ +} while(0) +#else +#define dynarray_add(tab, nb_ptr, elem)\ +do {\ + av_dynarray_add((tab), nb_ptr, (elem));\ +} while(0) +#endif + + +void ff_flush_packet_queue(AVFormatContext *s); + +/** + * Automatically create sub-directories + * + * @param path will create sub-directories by path + * @return 0, or < 0 on error + */ +int ff_mkdir_p(const char *path); + +/** + * Write hexadecimal string corresponding to given binary data. The string + * is zero-terminated. + * + * @param buf the output string is written here; + * needs to be at least 2 * size + 1 bytes long. + * @param src the input data to be transformed. + * @param size the size (in byte) of src. + * @param lowercase determines whether to use the range [0-9a-f] or [0-9A-F]. + * @return buf. + */ +char *ff_data_to_hex(char *buf, const uint8_t *src, int size, int lowercase); + +/** + * Parse a string of hexadecimal strings. Any space between the hexadecimal + * digits is ignored. + * + * @param data if non-null, the parsed data is written to this pointer + * @param p the string to parse + * @return the number of bytes written (or to be written, if data is null) + */ +int ff_hex_to_data(uint8_t *data, const char *p); + +#define NTP_OFFSET 2208988800ULL +#define NTP_OFFSET_US (NTP_OFFSET * 1000000ULL) + +/** Get the current time since NTP epoch in microseconds. */ +uint64_t ff_ntp_time(void); + +/** + * Get the NTP time stamp formatted as per the RFC-5905. + * + * @param ntp_time NTP time in micro seconds (since NTP epoch) + * @return the formatted NTP time stamp + */ +uint64_t ff_get_formatted_ntp_time(uint64_t ntp_time_us); + +/** + * Parse the NTP time in micro seconds (since NTP epoch). + * + * @param ntp_ts NTP time stamp formatted as per the RFC-5905. + * @return the time in micro seconds (since NTP epoch) + */ +uint64_t ff_parse_ntp_time(uint64_t ntp_ts); + +/** + * Append the media-specific SDP fragment for the media stream c + * to the buffer buff. + * + * Note, the buffer needs to be initialized, since it is appended to + * existing content. + * + * @param buff the buffer to append the SDP fragment to + * @param size the size of the buff buffer + * @param st the AVStream of the media to describe + * @param idx the global stream index + * @param dest_addr the destination address of the media stream, may be NULL + * @param dest_type the destination address type, may be NULL + * @param port the destination port of the media stream, 0 if unknown + * @param ttl the time to live of the stream, 0 if not multicast + * @param fmt the AVFormatContext, which might contain options modifying + * the generated SDP + * @return 0 on success, a negative error code on failure + */ +int ff_sdp_write_media(char *buff, int size, const AVStream *st, int idx, + const char *dest_addr, const char *dest_type, + int port, int ttl, AVFormatContext *fmt); + +/** + * Read a whole line of text from AVIOContext. Stop reading after reaching + * either a \\n, a \\0 or EOF. The returned string is always \\0-terminated, + * and may be truncated if the buffer is too small. + * + * @param s the read-only AVIOContext + * @param buf buffer to store the read line + * @param maxlen size of the buffer + * @return the length of the string written in the buffer, not including the + * final \\0 + */ +int ff_get_line(AVIOContext *s, char *buf, int maxlen); + +/** + * Same as ff_get_line but strip the white-space characters in the text tail + * + * @param s the read-only AVIOContext + * @param buf buffer to store the read line + * @param maxlen size of the buffer + * @return the length of the string written in the buffer + */ +int ff_get_chomp_line(AVIOContext *s, char *buf, int maxlen); + +#define SPACE_CHARS " \t\r\n" + +/** + * Callback function type for ff_parse_key_value. + * + * @param key a pointer to the key + * @param key_len the number of bytes that belong to the key, including the '=' + * char + * @param dest return the destination pointer for the value in *dest, may + * be null to ignore the value + * @param dest_len the length of the *dest buffer + */ +typedef void (*ff_parse_key_val_cb)(void *context, const char *key, + int key_len, char **dest, int *dest_len); +/** + * Parse a string with comma-separated key=value pairs. The value strings + * may be quoted and may contain escaped characters within quoted strings. + * + * @param str the string to parse + * @param callback_get_buf function that returns where to store the + * unescaped value string. + * @param context the opaque context pointer to pass to callback_get_buf + */ +void ff_parse_key_value(const char *str, ff_parse_key_val_cb callback_get_buf, + void *context); + +enum AVCodecID ff_guess_image2_codec(const char *filename); + +const struct AVCodec *ff_find_decoder(AVFormatContext *s, const AVStream *st, + enum AVCodecID codec_id); + +/** + * Set the time base and wrapping info for a given stream. This will be used + * to interpret the stream's timestamps. If the new time base is invalid + * (numerator or denominator are non-positive), it leaves the stream + * unchanged. + * + * @param st stream + * @param pts_wrap_bits number of bits effectively used by the pts + * (used for wrap control) + * @param pts_num time base numerator + * @param pts_den time base denominator + */ +void avpriv_set_pts_info(AVStream *st, int pts_wrap_bits, + unsigned int pts_num, unsigned int pts_den); + +/** + * Set the timebase for each stream from the corresponding codec timebase and + * print it. + */ +int ff_framehash_write_header(AVFormatContext *s); + +/** + * Frees a stream without modifying the corresponding AVFormatContext. + * Must only be called if the latter doesn't matter or if the stream + * is not yet attached to an AVFormatContext. + */ +void ff_free_stream(AVStream **st); +/** + * Remove a stream from its AVFormatContext and free it. + * The stream must be the last stream of the AVFormatContext. + */ +void ff_remove_stream(AVFormatContext *s, AVStream *st); + +/** + * Frees a stream group without modifying the corresponding AVFormatContext. + * Must only be called if the latter doesn't matter or if the stream + * is not yet attached to an AVFormatContext. + */ +void ff_free_stream_group(AVStreamGroup **pstg); +/** + * Remove a stream group from its AVFormatContext and free it. + * The stream group must be the last stream group of the AVFormatContext. + */ +void ff_remove_stream_group(AVFormatContext *s, AVStreamGroup *stg); + +unsigned int ff_codec_get_tag(const AVCodecTag *tags, enum AVCodecID id); + +enum AVCodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag); + +int ff_is_intra_only(enum AVCodecID id); + +/** + * Select a PCM codec based on the given parameters. + * + * @param bps bits-per-sample + * @param flt floating-point + * @param be big-endian + * @param sflags signed flags. each bit corresponds to one byte of bit depth. + * e.g. the 1st bit indicates if 8-bit should be signed or + * unsigned, the 2nd bit indicates if 16-bit should be signed or + * unsigned, etc... This is useful for formats such as WAVE where + * only 8-bit is unsigned and all other bit depths are signed. + * @return a PCM codec id or AV_CODEC_ID_NONE + */ +enum AVCodecID ff_get_pcm_codec_id(int bps, int flt, int be, int sflags); + +/** + * Copy side data from source to destination stream + * + * @param dst pointer to destination AVStream + * @param src pointer to source AVStream + * @return >=0 on success, AVERROR code on error + */ +int ff_stream_side_data_copy(AVStream *dst, const AVStream *src); + +/** + * Create a new stream and copy to it all parameters from a source stream, with + * the exception of the index field, which is set when the new stream is + * created. + * + * @param dst_ctx pointer to the context in which the new stream is created + * @param src pointer to source AVStream + * @return pointer to the new stream or NULL on error + */ +AVStream *ff_stream_clone(AVFormatContext *dst_ctx, const AVStream *src); + +/** + * Wrap ffurl_move() and log if error happens. + * + * @param url_src source path + * @param url_dst destination path + * @return 0 or AVERROR on failure + */ +int ff_rename(const char *url_src, const char *url_dst, void *logctx); + +/** + * Allocate extradata with additional AV_INPUT_BUFFER_PADDING_SIZE at end + * which is always set to 0. + * + * Previously allocated extradata in par will be freed. + * + * @param size size of extradata + * @return 0 if OK, AVERROR_xxx on error + */ +int ff_alloc_extradata(AVCodecParameters *par, int size); + +/** + * Copies the whilelists from one context to the other + */ +int ff_copy_whiteblacklists(AVFormatContext *dst, const AVFormatContext *src); + +/* + * A wrapper around AVFormatContext.io_close that should be used + * instead of calling the pointer directly. + * + * @param s AVFormatContext + * @param *pb the AVIOContext to be closed and freed. Can be NULL. + * @return >=0 on success, negative AVERROR in case of failure + */ +int ff_format_io_close(AVFormatContext *s, AVIOContext **pb); + +/** + * Utility function to check if the file uses http or https protocol + * + * @param s AVFormatContext + * @param filename URL or file name to open for writing + */ +int ff_is_http_proto(const char *filename); + +struct AVBPrint; +/** + * Finalize buf into extradata and set its size appropriately. + */ +int ff_bprint_to_codecpar_extradata(AVCodecParameters *par, struct AVBPrint *buf); + +/** + * Set AVFormatContext url field to the provided pointer. The pointer must + * point to a valid string. The existing url field is freed if necessary. Also + * set the legacy filename field to the same string which was provided in url. + */ +void ff_format_set_url(AVFormatContext *s, char *url); + +/** + * Return a positive value if the given url has one of the given + * extensions, negative AVERROR on error, 0 otherwise. + * + * @param url url to check against the given extensions + * @param extensions a comma-separated list of filename extensions + */ +int ff_match_url_ext(const char *url, const char *extensions); + +/** + * Return in 'buf' the path with '%d' replaced by a number. + * + * Also handles the '%0nd' format where 'n' is the total number + * of digits and '%%'. + * + * @param buf destination buffer + * @param buf_size destination buffer size + * @param path path with substitution template + * @param number the number to substitute + * @param flags AV_FRAME_FILENAME_FLAGS_* + * @return 0 if OK, -1 on format error + */ +int ff_get_frame_filename(char *buf, int buf_size, const char *path, + int64_t number, int flags); + +struct FFOutputFormat; +struct FFInputFormat; +void avpriv_register_devices(const struct FFOutputFormat * const o[], + const struct FFInputFormat * const i[]); + +#endif /* AVFORMAT_INTERNAL_H */ diff --git a/include/libavformat/ip.h b/include/libavformat/ip.h new file mode 100644 index 0000000..b76cdab --- /dev/null +++ b/include/libavformat/ip.h @@ -0,0 +1,72 @@ +/* + * IP common code + * + * 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 AVFORMAT_IP_H +#define AVFORMAT_IP_H + +#include "network.h" + +/** + * Structure for storing IP (UDP) source filters or block lists. + */ +typedef struct IPSourceFilters { + int nb_include_addrs; + int nb_exclude_addrs; + struct sockaddr_storage *include_addrs; + struct sockaddr_storage *exclude_addrs; +} IPSourceFilters; + +/** + * Checks the source address against a given IP source filter. + * @return 0 if packet should be processed based on the filter, 1 if the packet + * can be dropped. + */ +int ff_ip_check_source_lists(struct sockaddr_storage *source_addr_ptr, IPSourceFilters *s); + +/** + * Resolves hostname into an addrinfo structure. + * @return addrinfo structure which should be freed by the user, NULL in case + * of error. + */ +struct addrinfo *ff_ip_resolve_host(void *log_ctx, + const char *hostname, int port, + int type, int family, int flags); + +/** + * Parses the address[,address] source list in buf and adds it to the filters + * in the IPSourceFilters structure. + * @return 0 on success, < 0 AVERROR code on error. + */ +int ff_ip_parse_sources(void *log_ctx, const char *buf, IPSourceFilters *filters); + +/** + * Parses the address[,address] source block list in buf and adds it to the + * filters in the IPSourceFilters structure. + * @return 0 on success, < 0 AVERROR code on error. + */ +int ff_ip_parse_blocks(void *log_ctx, const char *buf, IPSourceFilters *filters); + +/** + * Resets the IP filter list and frees the internal fields of an + * IPSourceFilters structure. + */ +void ff_ip_reset_filters(IPSourceFilters *filters); + +#endif /* AVFORMAT_IP_H */ diff --git a/include/libavformat/ircam.h b/include/libavformat/ircam.h new file mode 100644 index 0000000..f7f9c84 --- /dev/null +++ b/include/libavformat/ircam.h @@ -0,0 +1,30 @@ +/* + * IRCAM common code + * Copyright (c) 2012 Paul B Mahol + * + * 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 AVFORMAT_IRCAM_H +#define AVFORMAT_IRCAM_H + +#include "internal.h" + +extern const AVCodecTag ff_codec_ircam_be_tags[]; +extern const AVCodecTag ff_codec_ircam_le_tags[]; + +#endif /* AVFORMAT_IRCAM_H */ diff --git a/include/libavformat/isom.h b/include/libavformat/isom.h new file mode 100644 index 0000000..ffabc01 --- /dev/null +++ b/include/libavformat/isom.h @@ -0,0 +1,472 @@ +/* + * ISO Media common code + * copyright (c) 2001 Fabrice Bellard + * copyright (c) 2002 Francois Revol + * copyright (c) 2006 Baptiste Coudurier + * + * 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 AVFORMAT_ISOM_H +#define AVFORMAT_ISOM_H + +#include +#include + +#include "libavutil/encryption_info.h" +#include "libavutil/mastering_display_metadata.h" +#include "libavutil/ambient_viewing_environment.h" +#include "libavutil/spherical.h" +#include "libavutil/stereo3d.h" + +#include "avio.h" +#include "internal.h" +#include "dv.h" + +/* isom.c */ +extern const AVCodecTag ff_mp4_obj_type[]; +extern const AVCodecTag ff_codec_movvideo_tags[]; +extern const AVCodecTag ff_codec_movaudio_tags[]; +extern const AVCodecTag ff_codec_movsubtitle_tags[]; +extern const AVCodecTag ff_codec_movdata_tags[]; + +int ff_mov_iso639_to_lang(const char lang[4], int mp4); +int ff_mov_lang_to_iso639(unsigned code, char to[4]); + +struct AVAESCTR; + +/* the QuickTime file format is quite convoluted... + * it has lots of index tables, each indexing something in another one... + * Here we just use what is needed to read the chunks + */ + +typedef struct MOVStts { + unsigned int count; + unsigned int duration; +} MOVStts; + +typedef struct MOVCtts { + unsigned int count; + int duration; +} MOVCtts; + +typedef struct MOVStsc { + int first; + int count; + int id; +} MOVStsc; + +typedef struct MOVElst { + int64_t duration; + int64_t time; + float rate; +} MOVElst; + +typedef struct MOVDref { + uint32_t type; + char *path; + char *dir; + char volume[28]; + char filename[64]; + int16_t nlvl_to, nlvl_from; +} MOVDref; + +typedef struct MOVAtom { + uint32_t type; + int64_t size; /* total size (excluding the size and type fields) */ +} MOVAtom; + +struct MOVParseTableEntry; + +typedef struct MOVFragment { + int found_tfhd; + unsigned track_id; + uint64_t base_data_offset; + uint64_t moof_offset; + uint64_t implicit_offset; + unsigned stsd_id; + unsigned duration; + unsigned size; + unsigned flags; +} MOVFragment; + +typedef struct MOVTrackExt { + unsigned track_id; + unsigned stsd_id; + unsigned duration; + unsigned size; + unsigned flags; +} MOVTrackExt; + +typedef struct MOVSbgp { + unsigned int count; + unsigned int index; +} MOVSbgp; + +typedef struct MOVEncryptionIndex { + // Individual encrypted samples. If there are no elements, then the default + // settings will be used. + unsigned int nb_encrypted_samples; + AVEncryptionInfo **encrypted_samples; + + uint8_t* auxiliary_info_sizes; + size_t auxiliary_info_sample_count; + uint8_t auxiliary_info_default_size; + uint64_t* auxiliary_offsets; ///< Absolute seek position + size_t auxiliary_offsets_count; +} MOVEncryptionIndex; + +typedef struct MOVFragmentStreamInfo { + int id; + int64_t sidx_pts; + int64_t first_tfra_pts; + int64_t tfdt_dts; + int64_t next_trun_dts; + // Index of the first sample/trun in the fragment. + int index_base; + int index_entry; + MOVEncryptionIndex *encryption_index; + int stsd_id; // current fragment stsd_id +} MOVFragmentStreamInfo; + +typedef struct MOVFragmentIndexItem { + int64_t moof_offset; + int headers_read; + int current; + int nb_stream_info; + MOVFragmentStreamInfo * stream_info; +} MOVFragmentIndexItem; + +typedef struct MOVFragmentIndex { + int allocated_size; + int complete; + int current; + int nb_items; + MOVFragmentIndexItem * item; +} MOVFragmentIndex; + +typedef struct MOVIndexRange { + int64_t start; + int64_t end; +} MOVIndexRange; + +typedef struct MOVStreamContext { + AVIOContext *pb; + int refcount; + int pb_is_copied; + int id; ///< AVStream id + int ffindex; ///< AVStream index + int next_chunk; + unsigned int chunk_count; + int64_t *chunk_offsets; + unsigned int stts_count; + MOVStts *stts_data; + unsigned int sdtp_count; + uint8_t *sdtp_data; + unsigned int ctts_count; + unsigned int ctts_allocated_size; + MOVCtts *ctts_data; + unsigned int stsc_count; + MOVStsc *stsc_data; + unsigned int stsc_index; + int stsc_sample; + unsigned int stps_count; + unsigned *stps_data; ///< partial sync sample for mpeg-2 open gop + MOVElst *elst_data; + unsigned int elst_count; + int ctts_index; + int ctts_sample; + unsigned int sample_size; ///< may contain value calculated from stsd or value from stsz atom + unsigned int stsz_sample_size; ///< always contains sample size from stsz atom + unsigned int sample_count; + unsigned int *sample_sizes; + int keyframe_absent; + unsigned int keyframe_count; + int *keyframes; + int time_scale; + int64_t time_offset; ///< time offset of the edit list entries + int64_t min_corrected_pts; ///< minimum Composition time shown by the edits excluding empty edits. + int current_sample; + int64_t current_index; + MOVIndexRange* index_ranges; + MOVIndexRange* current_index_range; + unsigned int bytes_per_frame; + unsigned int samples_per_frame; + int dv_audio_container; + int pseudo_stream_id; ///< -1 means demux all ids + int16_t audio_cid; ///< stsd audio compression id + unsigned drefs_count; + MOVDref *drefs; + int dref_id; + unsigned tref_flags; + int tref_id; + int timecode_track; + int width; ///< tkhd width + int height; ///< tkhd height + int h_spacing; ///< pasp hSpacing + int v_spacing; ///< pasp vSpacing + int dts_shift; ///< dts shift when ctts is negative + uint32_t palette[256]; + int has_palette; + int64_t data_size; + uint32_t tmcd_flags; ///< tmcd track flags + uint8_t tmcd_nb_frames; ///< tmcd number of frames per tick / second + int64_t track_end; ///< used for dts generation in fragmented movie files + int start_pad; ///< amount of samples to skip due to enc-dec delay + unsigned int rap_group_count; + MOVSbgp *rap_group; + unsigned int sync_group_count; + MOVSbgp *sync_group; + uint8_t *sgpd_sync; + uint32_t sgpd_sync_count; + int32_t *sample_offsets; + int sample_offsets_count; + int *open_key_samples; + int open_key_samples_count; + uint32_t min_sample_duration; + + int nb_frames_for_fps; + int64_t duration_for_fps; + + /** extradata array (and size) for multiple stsd */ + uint8_t **extradata; + int *extradata_size; + int last_stsd_index; + int stsd_count; + int stsd_version; + + int32_t *display_matrix; + AVStereo3D *stereo3d; + size_t stereo3d_size; + AVSphericalMapping *spherical; + size_t spherical_size; + AVMasteringDisplayMetadata *mastering; + size_t mastering_size; + AVContentLightMetadata *coll; + size_t coll_size; + AVAmbientViewingEnvironment *ambient; + size_t ambient_size; + + uint32_t format; + + int has_sidx; // If there is an sidx entry for this stream. + struct { + struct AVAESCTR* aes_ctr; + struct AVAES *aes_ctx; + unsigned int per_sample_iv_size; // Either 0, 8, or 16. + AVEncryptionInfo *default_encrypted_sample; + MOVEncryptionIndex *encryption_index; + } cenc; + + struct IAMFDemuxContext *iamf; +} MOVStreamContext; + +typedef struct HEIFItem { + AVStream *st; + char *name; + int item_id; + int64_t extent_length; + int64_t extent_offset; + int width; + int height; + int type; + int is_idat_relative; +} HEIFItem; + +typedef struct HEIFGrid { + HEIFItem *item; + HEIFItem **tile_item_list; + int16_t *tile_id_list; + int nb_tiles; +} HEIFGrid; + +typedef struct MOVContext { + const AVClass *class; ///< class for private options + AVFormatContext *fc; + int time_scale; + int64_t duration; ///< duration of the longest track + int found_moov; ///< 'moov' atom has been found + int found_iloc; ///< 'iloc' atom has been found + int found_iinf; ///< 'iinf' atom has been found + int found_mdat; ///< 'mdat' atom has been found + int found_hdlr_mdta; ///< 'hdlr' atom with type 'mdta' has been found + int trak_index; ///< Index of the current 'trak' + char **meta_keys; + unsigned meta_keys_count; + DVDemuxContext *dv_demux; + AVFormatContext *dv_fctx; + int isom; ///< 1 if file is ISO Media (mp4/3gp) + MOVFragment fragment; ///< current fragment in moof atom + MOVTrackExt *trex_data; + unsigned trex_count; + int itunes_metadata; ///< metadata are itunes style + int handbrake_version; + int *chapter_tracks; + unsigned int nb_chapter_tracks; + int use_absolute_path; + int ignore_editlist; + int advanced_editlist; + int advanced_editlist_autodisabled; + int ignore_chapters; + int seek_individually; + int64_t next_root_atom; ///< offset of the next root atom + int export_all; + int export_xmp; + int *bitrates; ///< bitrates read before streams creation + int bitrates_count; + int moov_retry; + int use_mfra_for; + int has_looked_for_mfra; + int use_tfdt; + MOVFragmentIndex frag_index; + int atom_depth; + unsigned int aax_mode; ///< 'aax' file has been detected + uint8_t file_key[20]; + uint8_t file_iv[20]; + void *activation_bytes; + int activation_bytes_size; + void *audible_fixed_key; + int audible_fixed_key_size; + void *audible_key; + int audible_key_size; + void *audible_iv; + int audible_iv_size; + struct AVAES *aes_decrypt; + uint8_t *decryption_key; + int decryption_key_len; + int enable_drefs; + int32_t movie_display_matrix[3][3]; ///< display matrix from mvhd + int have_read_mfra_size; + uint32_t mfra_size; + uint32_t max_stts_delta; + int primary_item_id; + int cur_item_id; + HEIFItem **heif_item; + int nb_heif_item; + HEIFGrid *heif_grid; + int nb_heif_grid; + int thmb_item_id; + int64_t idat_offset; + int interleaved_read; +} MOVContext; + +int ff_mp4_read_descr_len(AVIOContext *pb); +int ff_mp4_read_descr(void *logctx, AVIOContext *pb, int *tag); +int ff_mp4_read_dec_config_descr(void *logctx, AVStream *st, AVIOContext *pb); +void ff_mp4_parse_es_descr(AVIOContext *pb, int *es_id); + +#define MP4ODescrTag 0x01 +#define MP4IODescrTag 0x02 +#define MP4ESDescrTag 0x03 +#define MP4DecConfigDescrTag 0x04 +#define MP4DecSpecificDescrTag 0x05 +#define MP4SLDescrTag 0x06 + +#define MOV_TFHD_BASE_DATA_OFFSET 0x01 +#define MOV_TFHD_STSD_ID 0x02 +#define MOV_TFHD_DEFAULT_DURATION 0x08 +#define MOV_TFHD_DEFAULT_SIZE 0x10 +#define MOV_TFHD_DEFAULT_FLAGS 0x20 +#define MOV_TFHD_DURATION_IS_EMPTY 0x010000 +#define MOV_TFHD_DEFAULT_BASE_IS_MOOF 0x020000 + +#define MOV_TRUN_DATA_OFFSET 0x01 +#define MOV_TRUN_FIRST_SAMPLE_FLAGS 0x04 +#define MOV_TRUN_SAMPLE_DURATION 0x100 +#define MOV_TRUN_SAMPLE_SIZE 0x200 +#define MOV_TRUN_SAMPLE_FLAGS 0x400 +#define MOV_TRUN_SAMPLE_CTS 0x800 + +#define MOV_FRAG_SAMPLE_FLAG_DEGRADATION_PRIORITY_MASK 0x0000ffff +#define MOV_FRAG_SAMPLE_FLAG_IS_NON_SYNC 0x00010000 +#define MOV_FRAG_SAMPLE_FLAG_PADDING_MASK 0x000e0000 +#define MOV_FRAG_SAMPLE_FLAG_REDUNDANCY_MASK 0x00300000 +#define MOV_FRAG_SAMPLE_FLAG_DEPENDED_MASK 0x00c00000 +#define MOV_FRAG_SAMPLE_FLAG_DEPENDS_MASK 0x03000000 + +#define MOV_FRAG_SAMPLE_FLAG_DEPENDS_NO 0x02000000 +#define MOV_FRAG_SAMPLE_FLAG_DEPENDS_YES 0x01000000 + +#define MOV_TKHD_FLAG_ENABLED 0x0001 +#define MOV_TKHD_FLAG_IN_MOVIE 0x0002 +#define MOV_TKHD_FLAG_IN_PREVIEW 0x0004 +#define MOV_TKHD_FLAG_IN_POSTER 0x0008 + +#define MOV_SAMPLE_DEPENDENCY_UNKNOWN 0x0 +#define MOV_SAMPLE_DEPENDENCY_YES 0x1 +#define MOV_SAMPLE_DEPENDENCY_NO 0x2 + +#define MOV_TREF_FLAG_ENHANCEMENT 0x1 + +#define TAG_IS_AVCI(tag) \ + ((tag) == MKTAG('a', 'i', '5', 'p') || \ + (tag) == MKTAG('a', 'i', '5', 'q') || \ + (tag) == MKTAG('a', 'i', '5', '2') || \ + (tag) == MKTAG('a', 'i', '5', '3') || \ + (tag) == MKTAG('a', 'i', '5', '5') || \ + (tag) == MKTAG('a', 'i', '5', '6') || \ + (tag) == MKTAG('a', 'i', '1', 'p') || \ + (tag) == MKTAG('a', 'i', '1', 'q') || \ + (tag) == MKTAG('a', 'i', '1', '2') || \ + (tag) == MKTAG('a', 'i', '1', '3') || \ + (tag) == MKTAG('a', 'i', '1', '5') || \ + (tag) == MKTAG('a', 'i', '1', '6') || \ + (tag) == MKTAG('a', 'i', 'v', 'x') || \ + (tag) == MKTAG('A', 'V', 'i', 'n')) + + +int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb); + +int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries); +void ff_mov_write_chan(AVIOContext *pb, int64_t channel_layout); + +#define FF_MOV_FLAG_MFRA_AUTO -1 +#define FF_MOV_FLAG_MFRA_DTS 1 +#define FF_MOV_FLAG_MFRA_PTS 2 + +/** + * Compute codec id for 'lpcm' tag. + * See CoreAudioTypes and AudioStreamBasicDescription at Apple. + */ +static inline enum AVCodecID ff_mov_get_lpcm_codec_id(int bps, int flags) +{ + /* lpcm flags: + * 0x1 = float + * 0x2 = big-endian + * 0x4 = signed + */ + return ff_get_pcm_codec_id(bps, flags & 1, flags & 2, flags & 4 ? -1 : 0); +} + +#define MOV_ISMV_TTML_TAG MKTAG('d', 'f', 'x', 'p') +#define MOV_MP4_TTML_TAG MKTAG('s', 't', 'p', 'p') +#define MOV_MP4_FPCM_TAG MKTAG('f', 'p', 'c', 'm') +#define MOV_MP4_IPCM_TAG MKTAG('i', 'p', 'c', 'm') + +struct MP4TrackKindValueMapping { + int disposition; + const char *value; +}; + +struct MP4TrackKindMapping { + const char *scheme_uri; + const struct MP4TrackKindValueMapping *value_maps; +}; + +extern const struct MP4TrackKindMapping ff_mov_track_kind_table[]; + +#endif /* AVFORMAT_ISOM_H */ diff --git a/include/libavformat/lrc.h b/include/libavformat/lrc.h new file mode 100644 index 0000000..0297bc1 --- /dev/null +++ b/include/libavformat/lrc.h @@ -0,0 +1,29 @@ +/* + * LRC lyrics file format decoder + * Copyright (c) 2014 StarBrilliant + * + * 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 AVFORMAT_LRC_H +#define AVFORMAT_LRC_H + +#include "metadata.h" + +extern const AVMetadataConv ff_lrc_metadata_conv[]; + +#endif diff --git a/include/libavformat/matroska.h b/include/libavformat/matroska.h new file mode 100644 index 0000000..719f2ef --- /dev/null +++ b/include/libavformat/matroska.h @@ -0,0 +1,441 @@ +/* + * Matroska constants + * Copyright (c) 2003-2004 The FFmpeg project + * + * 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 AVFORMAT_MATROSKA_H +#define AVFORMAT_MATROSKA_H + +#include "libavcodec/codec_id.h" +#include "metadata.h" + +/* EBML version supported */ +#define EBML_VERSION 1 + +/* top-level master-IDs */ +#define EBML_ID_HEADER 0x1A45DFA3 + +/* IDs in the HEADER master */ +#define EBML_ID_EBMLVERSION 0x4286 +#define EBML_ID_EBMLREADVERSION 0x42F7 +#define EBML_ID_EBMLMAXIDLENGTH 0x42F2 +#define EBML_ID_EBMLMAXSIZELENGTH 0x42F3 +#define EBML_ID_DOCTYPE 0x4282 +#define EBML_ID_DOCTYPEVERSION 0x4287 +#define EBML_ID_DOCTYPEREADVERSION 0x4285 + +/* general EBML types */ +#define EBML_ID_VOID 0xEC +#define EBML_ID_CRC32 0xBF + +/* + * Matroska element IDs, max. 32 bits + */ + +/* toplevel segment */ +#define MATROSKA_ID_SEGMENT 0x18538067 + +/* Matroska top-level master IDs */ +#define MATROSKA_ID_INFO 0x1549A966 +#define MATROSKA_ID_TRACKS 0x1654AE6B +#define MATROSKA_ID_CUES 0x1C53BB6B +#define MATROSKA_ID_TAGS 0x1254C367 +#define MATROSKA_ID_SEEKHEAD 0x114D9B74 +#define MATROSKA_ID_ATTACHMENTS 0x1941A469 +#define MATROSKA_ID_CLUSTER 0x1F43B675 +#define MATROSKA_ID_CHAPTERS 0x1043A770 + +/* IDs in the info master */ +#define MATROSKA_ID_TIMECODESCALE 0x2AD7B1 +#define MATROSKA_ID_DURATION 0x4489 +#define MATROSKA_ID_TITLE 0x7BA9 +#define MATROSKA_ID_WRITINGAPP 0x5741 +#define MATROSKA_ID_MUXINGAPP 0x4D80 +#define MATROSKA_ID_DATEUTC 0x4461 +#define MATROSKA_ID_SEGMENTUID 0x73A4 + +/* ID in the tracks master */ +#define MATROSKA_ID_TRACKENTRY 0xAE + +/* IDs in the trackentry master */ +#define MATROSKA_ID_TRACKNUMBER 0xD7 +#define MATROSKA_ID_TRACKUID 0x73C5 +#define MATROSKA_ID_TRACKTYPE 0x83 +#define MATROSKA_ID_TRACKVIDEO 0xE0 +#define MATROSKA_ID_TRACKAUDIO 0xE1 +#define MATROSKA_ID_TRACKOPERATION 0xE2 +#define MATROSKA_ID_TRACKCOMBINEPLANES 0xE3 +#define MATROSKA_ID_TRACKPLANE 0xE4 +#define MATROSKA_ID_TRACKPLANEUID 0xE5 +#define MATROSKA_ID_TRACKPLANETYPE 0xE6 +#define MATROSKA_ID_CODECID 0x86 +#define MATROSKA_ID_CODECPRIVATE 0x63A2 +#define MATROSKA_ID_CODECNAME 0x258688 +#define MATROSKA_ID_CODECINFOURL 0x3B4040 +#define MATROSKA_ID_CODECDOWNLOADURL 0x26B240 +#define MATROSKA_ID_CODECDECODEALL 0xAA +#define MATROSKA_ID_CODECDELAY 0x56AA +#define MATROSKA_ID_SEEKPREROLL 0x56BB +#define MATROSKA_ID_TRACKNAME 0x536E +#define MATROSKA_ID_TRACKLANGUAGE 0x22B59C +#define MATROSKA_ID_TRACKFLAGENABLED 0xB9 +#define MATROSKA_ID_TRACKFLAGDEFAULT 0x88 +#define MATROSKA_ID_TRACKFLAGFORCED 0x55AA +#define MATROSKA_ID_TRACKFLAGHEARINGIMPAIRED 0x55AB +#define MATROSKA_ID_TRACKFLAGVISUALIMPAIRED 0x55AC +#define MATROSKA_ID_TRACKFLAGTEXTDESCRIPTIONS 0x55AD +#define MATROSKA_ID_TRACKFLAGORIGINAL 0x55AE +#define MATROSKA_ID_TRACKFLAGCOMMENTARY 0x55AF +#define MATROSKA_ID_TRACKFLAGLACING 0x9C +#define MATROSKA_ID_TRACKMINCACHE 0x6DE7 +#define MATROSKA_ID_TRACKMAXCACHE 0x6DF8 +#define MATROSKA_ID_TRACKDEFAULTDURATION 0x23E383 +#define MATROSKA_ID_TRACKCONTENTENCODINGS 0x6D80 +#define MATROSKA_ID_TRACKCONTENTENCODING 0x6240 +#define MATROSKA_ID_TRACKTIMECODESCALE 0x23314F +#define MATROSKA_ID_TRACKMAXBLKADDID 0x55EE +#define MATROSKA_ID_TRACKBLKADDMAPPING 0x41E4 + +/* IDs in the trackvideo master */ +#define MATROSKA_ID_VIDEOFRAMERATE 0x2383E3 +#define MATROSKA_ID_VIDEODISPLAYWIDTH 0x54B0 +#define MATROSKA_ID_VIDEODISPLAYHEIGHT 0x54BA +#define MATROSKA_ID_VIDEOPIXELWIDTH 0xB0 +#define MATROSKA_ID_VIDEOPIXELHEIGHT 0xBA +#define MATROSKA_ID_VIDEOPIXELCROPB 0x54AA +#define MATROSKA_ID_VIDEOPIXELCROPT 0x54BB +#define MATROSKA_ID_VIDEOPIXELCROPL 0x54CC +#define MATROSKA_ID_VIDEOPIXELCROPR 0x54DD +#define MATROSKA_ID_VIDEODISPLAYUNIT 0x54B2 +#define MATROSKA_ID_VIDEOFLAGINTERLACED 0x9A +#define MATROSKA_ID_VIDEOFIELDORDER 0x9D +#define MATROSKA_ID_VIDEOSTEREOMODE 0x53B8 +#define MATROSKA_ID_VIDEOALPHAMODE 0x53C0 +#define MATROSKA_ID_VIDEOASPECTRATIO 0x54B3 +#define MATROSKA_ID_VIDEOCOLORSPACE 0x2EB524 +#define MATROSKA_ID_VIDEOCOLOR 0x55B0 + +#define MATROSKA_ID_VIDEOCOLORMATRIXCOEFF 0x55B1 +#define MATROSKA_ID_VIDEOCOLORBITSPERCHANNEL 0x55B2 +#define MATROSKA_ID_VIDEOCOLORCHROMASUBHORZ 0x55B3 +#define MATROSKA_ID_VIDEOCOLORCHROMASUBVERT 0x55B4 +#define MATROSKA_ID_VIDEOCOLORCBSUBHORZ 0x55B5 +#define MATROSKA_ID_VIDEOCOLORCBSUBVERT 0x55B6 +#define MATROSKA_ID_VIDEOCOLORCHROMASITINGHORZ 0x55B7 +#define MATROSKA_ID_VIDEOCOLORCHROMASITINGVERT 0x55B8 +#define MATROSKA_ID_VIDEOCOLORRANGE 0x55B9 +#define MATROSKA_ID_VIDEOCOLORTRANSFERCHARACTERISTICS 0x55BA + +#define MATROSKA_ID_VIDEOCOLORPRIMARIES 0x55BB +#define MATROSKA_ID_VIDEOCOLORMAXCLL 0x55BC +#define MATROSKA_ID_VIDEOCOLORMAXFALL 0x55BD + +#define MATROSKA_ID_VIDEOCOLORMASTERINGMETA 0x55D0 +#define MATROSKA_ID_VIDEOCOLOR_RX 0x55D1 +#define MATROSKA_ID_VIDEOCOLOR_RY 0x55D2 +#define MATROSKA_ID_VIDEOCOLOR_GX 0x55D3 +#define MATROSKA_ID_VIDEOCOLOR_GY 0x55D4 +#define MATROSKA_ID_VIDEOCOLOR_BX 0x55D5 +#define MATROSKA_ID_VIDEOCOLOR_BY 0x55D6 +#define MATROSKA_ID_VIDEOCOLOR_WHITEX 0x55D7 +#define MATROSKA_ID_VIDEOCOLOR_WHITEY 0x55D8 +#define MATROSKA_ID_VIDEOCOLOR_LUMINANCEMAX 0x55D9 +#define MATROSKA_ID_VIDEOCOLOR_LUMINANCEMIN 0x55DA + +#define MATROSKA_ID_VIDEOPROJECTION 0x7670 +#define MATROSKA_ID_VIDEOPROJECTIONTYPE 0x7671 +#define MATROSKA_ID_VIDEOPROJECTIONPRIVATE 0x7672 +#define MATROSKA_ID_VIDEOPROJECTIONPOSEYAW 0x7673 +#define MATROSKA_ID_VIDEOPROJECTIONPOSEPITCH 0x7674 +#define MATROSKA_ID_VIDEOPROJECTIONPOSEROLL 0x7675 + +/* IDs in the trackaudio master */ +#define MATROSKA_ID_AUDIOSAMPLINGFREQ 0xB5 +#define MATROSKA_ID_AUDIOOUTSAMPLINGFREQ 0x78B5 + +#define MATROSKA_ID_AUDIOBITDEPTH 0x6264 +#define MATROSKA_ID_AUDIOCHANNELS 0x9F + +/* IDs in the content encoding master */ +#define MATROSKA_ID_ENCODINGORDER 0x5031 +#define MATROSKA_ID_ENCODINGSCOPE 0x5032 +#define MATROSKA_ID_ENCODINGTYPE 0x5033 +#define MATROSKA_ID_ENCODINGCOMPRESSION 0x5034 +#define MATROSKA_ID_ENCODINGCOMPALGO 0x4254 +#define MATROSKA_ID_ENCODINGCOMPSETTINGS 0x4255 + +#define MATROSKA_ID_ENCODINGENCRYPTION 0x5035 +#define MATROSKA_ID_ENCODINGENCAESSETTINGS 0x47E7 +#define MATROSKA_ID_ENCODINGENCALGO 0x47E1 +#define MATROSKA_ID_ENCODINGENCKEYID 0x47E2 +#define MATROSKA_ID_ENCODINGSIGALGO 0x47E5 +#define MATROSKA_ID_ENCODINGSIGHASHALGO 0x47E6 +#define MATROSKA_ID_ENCODINGSIGKEYID 0x47E4 +#define MATROSKA_ID_ENCODINGSIGNATURE 0x47E3 + +/* IDs in the block addition mapping master */ +#define MATROSKA_ID_BLKADDIDVALUE 0x41F0 +#define MATROSKA_ID_BLKADDIDNAME 0x41A4 +#define MATROSKA_ID_BLKADDIDTYPE 0x41E7 +#define MATROSKA_ID_BLKADDIDEXTRADATA 0x41ED + +/* ID in the cues master */ +#define MATROSKA_ID_POINTENTRY 0xBB + +/* IDs in the pointentry master */ +#define MATROSKA_ID_CUETIME 0xB3 +#define MATROSKA_ID_CUETRACKPOSITION 0xB7 + +/* IDs in the cuetrackposition master */ +#define MATROSKA_ID_CUETRACK 0xF7 +#define MATROSKA_ID_CUECLUSTERPOSITION 0xF1 +#define MATROSKA_ID_CUERELATIVEPOSITION 0xF0 +#define MATROSKA_ID_CUEDURATION 0xB2 +#define MATROSKA_ID_CUEBLOCKNUMBER 0x5378 + +/* IDs in the tags master */ +#define MATROSKA_ID_TAG 0x7373 +#define MATROSKA_ID_SIMPLETAG 0x67C8 +#define MATROSKA_ID_TAGNAME 0x45A3 +#define MATROSKA_ID_TAGSTRING 0x4487 +#define MATROSKA_ID_TAGLANG 0x447A +#define MATROSKA_ID_TAGDEFAULT 0x4484 +#define MATROSKA_ID_TAGDEFAULT_BUG 0x44B4 +#define MATROSKA_ID_TAGTARGETS 0x63C0 +#define MATROSKA_ID_TAGTARGETS_TYPE 0x63CA +#define MATROSKA_ID_TAGTARGETS_TYPEVALUE 0x68CA +#define MATROSKA_ID_TAGTARGETS_TRACKUID 0x63C5 +#define MATROSKA_ID_TAGTARGETS_CHAPTERUID 0x63C4 +#define MATROSKA_ID_TAGTARGETS_ATTACHUID 0x63C6 + +/* IDs in the seekhead master */ +#define MATROSKA_ID_SEEKENTRY 0x4DBB + +/* IDs in the seekpoint master */ +#define MATROSKA_ID_SEEKID 0x53AB +#define MATROSKA_ID_SEEKPOSITION 0x53AC + +/* IDs in the cluster master */ +#define MATROSKA_ID_CLUSTERTIMECODE 0xE7 +#define MATROSKA_ID_CLUSTERPOSITION 0xA7 +#define MATROSKA_ID_CLUSTERPREVSIZE 0xAB +#define MATROSKA_ID_BLOCKGROUP 0xA0 +#define MATROSKA_ID_BLOCKADDITIONS 0x75A1 +#define MATROSKA_ID_BLOCKMORE 0xA6 +#define MATROSKA_ID_BLOCKADDID 0xEE +#define MATROSKA_ID_BLOCKADDITIONAL 0xA5 +#define MATROSKA_ID_SIMPLEBLOCK 0xA3 + +/* IDs in the blockgroup master */ +#define MATROSKA_ID_BLOCK 0xA1 +#define MATROSKA_ID_BLOCKDURATION 0x9B +#define MATROSKA_ID_BLOCKREFERENCE 0xFB +#define MATROSKA_ID_CODECSTATE 0xA4 +#define MATROSKA_ID_DISCARDPADDING 0x75A2 + +/* IDs in the attachments master */ +#define MATROSKA_ID_ATTACHEDFILE 0x61A7 +#define MATROSKA_ID_FILEDESC 0x467E +#define MATROSKA_ID_FILENAME 0x466E +#define MATROSKA_ID_FILEMIMETYPE 0x4660 +#define MATROSKA_ID_FILEDATA 0x465C +#define MATROSKA_ID_FILEUID 0x46AE + +/* IDs in the chapters master */ +#define MATROSKA_ID_EDITIONENTRY 0x45B9 +#define MATROSKA_ID_CHAPTERATOM 0xB6 +#define MATROSKA_ID_CHAPTERTIMESTART 0x91 +#define MATROSKA_ID_CHAPTERTIMEEND 0x92 +#define MATROSKA_ID_CHAPTERDISPLAY 0x80 +#define MATROSKA_ID_CHAPSTRING 0x85 +#define MATROSKA_ID_CHAPLANG 0x437C +#define MATROSKA_ID_CHAPCOUNTRY 0x437E +#define MATROSKA_ID_EDITIONUID 0x45BC +#define MATROSKA_ID_EDITIONFLAGHIDDEN 0x45BD +#define MATROSKA_ID_EDITIONFLAGDEFAULT 0x45DB +#define MATROSKA_ID_EDITIONFLAGORDERED 0x45DD +#define MATROSKA_ID_CHAPTERUID 0x73C4 +#define MATROSKA_ID_CHAPTERFLAGHIDDEN 0x98 +#define MATROSKA_ID_CHAPTERFLAGENABLED 0x4598 +#define MATROSKA_ID_CHAPTERPHYSEQUIV 0x63C3 + +typedef enum { + MATROSKA_TRACK_TYPE_NONE = 0x0, + MATROSKA_TRACK_TYPE_VIDEO = 0x1, + MATROSKA_TRACK_TYPE_AUDIO = 0x2, + MATROSKA_TRACK_TYPE_COMPLEX = 0x3, + MATROSKA_TRACK_TYPE_LOGO = 0x10, + MATROSKA_TRACK_TYPE_SUBTITLE = 0x11, + MATROSKA_TRACK_TYPE_BUTTONS = 0x12, + MATROSKA_TRACK_TYPE_CONTROL = 0x20, + MATROSKA_TRACK_TYPE_METADATA = 0x21, +} MatroskaTrackType; + +typedef enum { + MATROSKA_TRACK_ENCODING_COMP_ZLIB = 0, + MATROSKA_TRACK_ENCODING_COMP_BZLIB = 1, + MATROSKA_TRACK_ENCODING_COMP_LZO = 2, + MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP = 3, +} MatroskaTrackEncodingCompAlgo; + +typedef enum { + MATROSKA_VIDEO_INTERLACE_FLAG_UNDETERMINED = 0, + MATROSKA_VIDEO_INTERLACE_FLAG_INTERLACED = 1, + MATROSKA_VIDEO_INTERLACE_FLAG_PROGRESSIVE = 2, +} MatroskaVideoInterlaceFlag; + +typedef enum { + MATROSKA_VIDEO_FIELDORDER_PROGRESSIVE = 0, + MATROSKA_VIDEO_FIELDORDER_TT = 1, + MATROSKA_VIDEO_FIELDORDER_UNDETERMINED = 2, + MATROSKA_VIDEO_FIELDORDER_BB = 6, + MATROSKA_VIDEO_FIELDORDER_TB = 9, + MATROSKA_VIDEO_FIELDORDER_BT = 14, +} MatroskaVideoFieldOrder; + +typedef enum { + MATROSKA_VIDEO_STEREOMODE_TYPE_MONO = 0, + MATROSKA_VIDEO_STEREOMODE_TYPE_LEFT_RIGHT = 1, + MATROSKA_VIDEO_STEREOMODE_TYPE_BOTTOM_TOP = 2, + MATROSKA_VIDEO_STEREOMODE_TYPE_TOP_BOTTOM = 3, + MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_RL = 4, + MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_LR = 5, + MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_RL = 6, + MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_LR = 7, + MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_RL = 8, + MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_LR = 9, + MATROSKA_VIDEO_STEREOMODE_TYPE_ANAGLYPH_CYAN_RED = 10, + MATROSKA_VIDEO_STEREOMODE_TYPE_RIGHT_LEFT = 11, + MATROSKA_VIDEO_STEREOMODE_TYPE_ANAGLYPH_GREEN_MAG = 12, + MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_LR = 13, + MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_RL = 14, + MATROSKA_VIDEO_STEREOMODE_TYPE_NB, +} MatroskaVideoStereoModeType; + +typedef enum { + MATROSKA_VIDEO_DISPLAYUNIT_PIXELS = 0, + MATROSKA_VIDEO_DISPLAYUNIT_CENTIMETERS = 1, + MATROSKA_VIDEO_DISPLAYUNIT_INCHES = 2, + MATROSKA_VIDEO_DISPLAYUNIT_DAR = 3, + MATROSKA_VIDEO_DISPLAYUNIT_UNKNOWN = 4, +} MatroskaVideoDisplayUnit; + +typedef enum { + MATROSKA_COLOUR_CHROMASITINGHORZ_UNDETERMINED = 0, + MATROSKA_COLOUR_CHROMASITINGHORZ_LEFT = 1, + MATROSKA_COLOUR_CHROMASITINGHORZ_HALF = 2, + MATROSKA_COLOUR_CHROMASITINGHORZ_NB +} MatroskaColourChromaSitingHorz; + +typedef enum { + MATROSKA_COLOUR_CHROMASITINGVERT_UNDETERMINED = 0, + MATROSKA_COLOUR_CHROMASITINGVERT_TOP = 1, + MATROSKA_COLOUR_CHROMASITINGVERT_HALF = 2, + MATROSKA_COLOUR_CHROMASITINGVERT_NB +} MatroskaColourChromaSitingVert; + +typedef enum { + MATROSKA_VIDEO_PROJECTION_TYPE_RECTANGULAR = 0, + MATROSKA_VIDEO_PROJECTION_TYPE_EQUIRECTANGULAR = 1, + MATROSKA_VIDEO_PROJECTION_TYPE_CUBEMAP = 2, + MATROSKA_VIDEO_PROJECTION_TYPE_MESH = 3, +} MatroskaVideoProjectionType; + +typedef enum { + MATROSKA_BLOCK_ADD_ID_TYPE_DEFAULT = 0, + MATROSKA_BLOCK_ADD_ID_TYPE_OPAQUE = 1, + MATROSKA_BLOCK_ADD_ID_TYPE_ITU_T_T35 = 4, + MATROSKA_BLOCK_ADD_ID_TYPE_DVCC = 0x64766343, // MKBETAG('d','v','c','C') + MATROSKA_BLOCK_ADD_ID_TYPE_DVVC = 0x64767643, // MKBETAG('d','v','v','C') +} MatroskaBlockAddIDType; + +#define MATROSKA_BLOCK_ADD_ID_OPAQUE 1 +#define MATROSKA_BLOCK_ADD_ID_ITU_T_T35 4 + +/* + * Matroska Codec IDs, strings + */ + +typedef struct CodecTags{ + char str[22]; + enum AVCodecID id; +}CodecTags; + +/* max. depth in the EBML tree structure */ +#define EBML_MAX_DEPTH 16 + +#define MATROSKA_VIDEO_STEREO_PLANE_COUNT 3 + +extern const CodecTags ff_mkv_codec_tags[]; +extern const CodecTags ff_webm_codec_tags[]; +extern const AVMetadataConv ff_mkv_metadata_conv[]; + +/* The following macro contains all the information about which + * MATROSKA_VIDEO_STEREOMODE_TYPE_* correspond to which AVStereo3D + * structures and also the relevant horizontal/vertical divisors + * as well as WebM compatibility. + * + * MAP and MKV_ONLY are macros to be provided by the user. + * MAP(MatroskaVideoStereoModeType, AVStereo3DType, AV_STEREO3D_FLAG_*, + * HALF_WIDTH, HALF_HEIGHT, WebM-compatibility) + * is for the stereo modes that have a Stereo3D counterpart. + * MKV_ONLY(MatroskaVideoStereoModeType, HALF_WIDTH, HALF_HEIGHT, WebM) + * is for those that don't have a Stereo3D counterpart. + * */ +#define STEREOMODE_STEREO3D_MAPPING(MAP, MKV_ONLY) \ + MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_MONO, AV_STEREO3D_2D, 0, 0, 0, 1) \ + MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_LEFT_RIGHT, AV_STEREO3D_SIDEBYSIDE, 0, 1, 0, 1) \ + MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_BOTTOM_TOP, AV_STEREO3D_TOPBOTTOM, \ + AV_STEREO3D_FLAG_INVERT, 0, 1, 1) \ + MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_TOP_BOTTOM, AV_STEREO3D_TOPBOTTOM, 0, 0, 1, 1) \ + MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_RL, AV_STEREO3D_CHECKERBOARD, \ + AV_STEREO3D_FLAG_INVERT, 0, 0, 0) \ + MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_CHECKERBOARD_LR, AV_STEREO3D_CHECKERBOARD, 0, 0, 0, 0) \ + MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_RL, AV_STEREO3D_LINES, \ + AV_STEREO3D_FLAG_INVERT, 0, 1, 0) \ + MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_ROW_INTERLEAVED_LR, AV_STEREO3D_LINES, 0, 0, 1, 0) \ + MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_RL, AV_STEREO3D_COLUMNS, \ + AV_STEREO3D_FLAG_INVERT, 1, 0, 0) \ + MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_COL_INTERLEAVED_LR, AV_STEREO3D_COLUMNS, 0, 1, 0, 0) \ + MKV_ONLY(MATROSKA_VIDEO_STEREOMODE_TYPE_ANAGLYPH_CYAN_RED, 0, 0, 0) \ + MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_RIGHT_LEFT, AV_STEREO3D_SIDEBYSIDE, \ + AV_STEREO3D_FLAG_INVERT, 1, 0, 1) \ + MKV_ONLY(MATROSKA_VIDEO_STEREOMODE_TYPE_ANAGLYPH_GREEN_MAG, 0, 0, 0) \ + MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_LR, AV_STEREO3D_FRAMESEQUENCE, \ + 0, 0, 0, 0) \ + MAP(MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_RL, AV_STEREO3D_FRAMESEQUENCE, \ + AV_STEREO3D_FLAG_INVERT, 0, 0, 0) + +extern const char * const ff_matroska_video_stereo_mode[MATROSKA_VIDEO_STEREOMODE_TYPE_NB]; + +/* AVStream Metadata tag keys for WebM Dash Manifest */ +#define INITIALIZATION_RANGE "webm_dash_manifest_initialization_range" +#define CUES_START "webm_dash_manifest_cues_start" +#define CUES_END "webm_dash_manifest_cues_end" +#define FILENAME "webm_dash_manifest_file_name" +#define BANDWIDTH "webm_dash_manifest_bandwidth" +#define DURATION "webm_dash_manifest_duration" +#define CLUSTER_KEYFRAME "webm_dash_manifest_cluster_keyframe" +#define CUE_TIMESTAMPS "webm_dash_manifest_cue_timestamps" +#define TRACK_NUMBER "webm_dash_manifest_track_number" +#define CODEC_PRIVATE_SIZE "webm_dash_manifest_codec_priv_size" + +#define DVCC_DVVC_BLOCK_TYPE_NAME "Dolby Vision configuration" + +#endif /* AVFORMAT_MATROSKA_H */ diff --git a/include/libavformat/metadata.h b/include/libavformat/metadata.h new file mode 100644 index 0000000..6586094 --- /dev/null +++ b/include/libavformat/metadata.h @@ -0,0 +1,44 @@ +/* + * copyright (c) 2009 Michael Niedermayer + * + * 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 AVFORMAT_METADATA_H +#define AVFORMAT_METADATA_H + +/** + * @file + * internal metadata API header + * see avformat.h or the public API! + */ + + +#include "avformat.h" +#include "libavutil/dict.h" + +typedef struct AVMetadataConv { + const char *native; + const char *generic; +} AVMetadataConv; + +void ff_metadata_conv(AVDictionary **pm, const AVMetadataConv *d_conv, + const AVMetadataConv *s_conv); +void ff_metadata_conv_ctx(AVFormatContext *ctx, const AVMetadataConv *d_conv, + const AVMetadataConv *s_conv); + +#endif /* AVFORMAT_METADATA_H */ diff --git a/include/libavformat/mms.h b/include/libavformat/mms.h new file mode 100644 index 0000000..57e3d7e --- /dev/null +++ b/include/libavformat/mms.h @@ -0,0 +1,64 @@ +/* + * MMS protocol common definitions. + * Copyright (c) 2010 Zhentan Feng + * + * 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 AVFORMAT_MMS_H +#define AVFORMAT_MMS_H + +#include "url.h" + +typedef struct MMSStream { + int id; +}MMSStream; + +typedef struct MMSContext { + URLContext *mms_hd; ///< TCP connection handle + MMSStream *streams; + + /** Buffer for outgoing packets. */ + /*@{*/ + uint8_t *write_out_ptr; ///< Pointer for writing the buffer. + uint8_t out_buffer[512]; ///< Buffer for outgoing packet. + /*@}*/ + + /** Buffer for incoming packets. */ + /*@{*/ + uint8_t in_buffer[65536]; ///< Buffer for incoming packets. + uint8_t *read_in_ptr; ///< Pointer for reading from incoming buffer. + int remaining_in_len; ///< Reading length from incoming buffer. + /*@}*/ + + /** Internal handling of the ASF header */ + /*@{*/ + uint8_t *asf_header; ///< Stored ASF header. + int asf_header_size; ///< Size of stored ASF header. + int header_parsed; ///< The header has been received and parsed. + int asf_packet_len; + int asf_header_read_size; + /*@}*/ + + int stream_num; ///< stream numbers. + unsigned int nb_streams_allocated; ///< allocated size of streams +} MMSContext; + +int ff_mms_asf_header_parser(MMSContext * mms); +int ff_mms_read_data(MMSContext *mms, uint8_t *buf, const int size); +int ff_mms_read_header(MMSContext * mms, uint8_t * buf, const int size); + +#endif /* AVFORMAT_MMS_H */ diff --git a/include/libavformat/mov_chan.h b/include/libavformat/mov_chan.h new file mode 100644 index 0000000..ea8be47 --- /dev/null +++ b/include/libavformat/mov_chan.h @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2011 Justin Ruggles + * + * 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 + */ + +/** + * mov 'chan' tag reading/writing. + * @author Justin Ruggles + */ + +#ifndef AVFORMAT_MOV_CHAN_H +#define AVFORMAT_MOV_CHAN_H + +#include + +#include "libavutil/channel_layout.h" +#include "libavcodec/codec_id.h" +#include "libavcodec/codec_par.h" +#include "avformat.h" + +/** + * Channel Layout Tag + * This tells which channels are present in the audio stream and the order in + * which they appear. + * + * @note We're using the channel layout tag to indicate channel order + * when the value is greater than 0x10000. The Apple documentation has + * some contradictions as to how this is actually supposed to be handled. + * + * Core Audio File Format Spec: + * "The high 16 bits indicates a specific ordering of the channels." + * Core Audio Data Types Reference: + * "These identifiers specify the channels included in a layout but + * do not specify a particular ordering of those channels." + */ +enum MovChannelLayoutTag { +#define MOV_CH_LAYOUT_UNKNOWN 0xFFFF0000 + MOV_CH_LAYOUT_USE_DESCRIPTIONS = ( 0 << 16) | 0, + MOV_CH_LAYOUT_USE_BITMAP = ( 1 << 16) | 0, + MOV_CH_LAYOUT_DISCRETEINORDER = (147 << 16) | 0, + MOV_CH_LAYOUT_MONO = (100 << 16) | 1, + MOV_CH_LAYOUT_STEREO = (101 << 16) | 2, + MOV_CH_LAYOUT_STEREOHEADPHONES = (102 << 16) | 2, + MOV_CH_LAYOUT_MATRIXSTEREO = (103 << 16) | 2, + MOV_CH_LAYOUT_MIDSIDE = (104 << 16) | 2, + MOV_CH_LAYOUT_XY = (105 << 16) | 2, + MOV_CH_LAYOUT_BINAURAL = (106 << 16) | 2, + MOV_CH_LAYOUT_AMBISONIC_B_FORMAT = (107 << 16) | 4, + MOV_CH_LAYOUT_QUADRAPHONIC = (108 << 16) | 4, + MOV_CH_LAYOUT_PENTAGONAL = (109 << 16) | 5, + MOV_CH_LAYOUT_HEXAGONAL = (110 << 16) | 6, + MOV_CH_LAYOUT_OCTAGONAL = (111 << 16) | 8, + MOV_CH_LAYOUT_CUBE = (112 << 16) | 8, + MOV_CH_LAYOUT_MPEG_3_0_A = (113 << 16) | 3, + MOV_CH_LAYOUT_MPEG_3_0_B = (114 << 16) | 3, + MOV_CH_LAYOUT_MPEG_4_0_A = (115 << 16) | 4, + MOV_CH_LAYOUT_MPEG_4_0_B = (116 << 16) | 4, + MOV_CH_LAYOUT_MPEG_5_0_A = (117 << 16) | 5, + MOV_CH_LAYOUT_MPEG_5_0_B = (118 << 16) | 5, + MOV_CH_LAYOUT_MPEG_5_0_C = (119 << 16) | 5, + MOV_CH_LAYOUT_MPEG_5_0_D = (120 << 16) | 5, + MOV_CH_LAYOUT_MPEG_5_1_A = (121 << 16) | 6, + MOV_CH_LAYOUT_MPEG_5_1_B = (122 << 16) | 6, + MOV_CH_LAYOUT_MPEG_5_1_C = (123 << 16) | 6, + MOV_CH_LAYOUT_MPEG_5_1_D = (124 << 16) | 6, + MOV_CH_LAYOUT_MPEG_6_1_A = (125 << 16) | 7, + MOV_CH_LAYOUT_MPEG_7_1_A = (126 << 16) | 8, + MOV_CH_LAYOUT_MPEG_7_1_B = (127 << 16) | 8, + MOV_CH_LAYOUT_MPEG_7_1_C = (128 << 16) | 8, + MOV_CH_LAYOUT_EMAGIC_DEFAULT_7_1 = (129 << 16) | 8, + MOV_CH_LAYOUT_SMPTE_DTV = (130 << 16) | 8, + MOV_CH_LAYOUT_ITU_2_1 = (131 << 16) | 3, + MOV_CH_LAYOUT_ITU_2_2 = (132 << 16) | 4, + MOV_CH_LAYOUT_DVD_4 = (133 << 16) | 3, + MOV_CH_LAYOUT_DVD_5 = (134 << 16) | 4, + MOV_CH_LAYOUT_DVD_6 = (135 << 16) | 5, + MOV_CH_LAYOUT_DVD_10 = (136 << 16) | 4, + MOV_CH_LAYOUT_DVD_11 = (137 << 16) | 5, + MOV_CH_LAYOUT_DVD_18 = (138 << 16) | 5, + MOV_CH_LAYOUT_AUDIOUNIT_6_0 = (139 << 16) | 6, + MOV_CH_LAYOUT_AUDIOUNIT_7_0 = (140 << 16) | 7, + MOV_CH_LAYOUT_AUDIOUNIT_7_0_FRONT = (148 << 16) | 7, + MOV_CH_LAYOUT_AAC_6_0 = (141 << 16) | 6, + MOV_CH_LAYOUT_AAC_6_1 = (142 << 16) | 7, + MOV_CH_LAYOUT_AAC_7_0 = (143 << 16) | 7, + MOV_CH_LAYOUT_AAC_OCTAGONAL = (144 << 16) | 8, + MOV_CH_LAYOUT_TMH_10_2_STD = (145 << 16) | 16, + MOV_CH_LAYOUT_TMH_10_2_FULL = (146 << 16) | 21, + MOV_CH_LAYOUT_AC3_1_0_1 = (149 << 16) | 2, + MOV_CH_LAYOUT_AC3_3_0 = (150 << 16) | 3, + MOV_CH_LAYOUT_AC3_3_1 = (151 << 16) | 4, + MOV_CH_LAYOUT_AC3_3_0_1 = (152 << 16) | 4, + MOV_CH_LAYOUT_AC3_2_1_1 = (153 << 16) | 4, + MOV_CH_LAYOUT_AC3_3_1_1 = (154 << 16) | 5, + MOV_CH_LAYOUT_EAC3_6_0_A = (155 << 16) | 6, + MOV_CH_LAYOUT_EAC3_7_0_A = (156 << 16) | 7, + MOV_CH_LAYOUT_EAC3_6_1_A = (157 << 16) | 7, + MOV_CH_LAYOUT_EAC3_6_1_B = (158 << 16) | 7, + MOV_CH_LAYOUT_EAC3_6_1_C = (159 << 16) | 7, + MOV_CH_LAYOUT_EAC3_7_1_A = (160 << 16) | 8, + MOV_CH_LAYOUT_EAC3_7_1_B = (161 << 16) | 8, + MOV_CH_LAYOUT_EAC3_7_1_C = (162 << 16) | 8, + MOV_CH_LAYOUT_EAC3_7_1_D = (163 << 16) | 8, + MOV_CH_LAYOUT_EAC3_7_1_E = (164 << 16) | 8, + MOV_CH_LAYOUT_EAC3_7_1_F = (165 << 16) | 8, + MOV_CH_LAYOUT_EAC3_7_1_G = (166 << 16) | 8, + MOV_CH_LAYOUT_EAC3_7_1_H = (167 << 16) | 8, + MOV_CH_LAYOUT_DTS_3_1 = (168 << 16) | 4, + MOV_CH_LAYOUT_DTS_4_1 = (169 << 16) | 5, + MOV_CH_LAYOUT_DTS_6_0_A = (170 << 16) | 6, + MOV_CH_LAYOUT_DTS_6_0_B = (171 << 16) | 6, + MOV_CH_LAYOUT_DTS_6_0_C = (172 << 16) | 6, + MOV_CH_LAYOUT_DTS_6_1_A = (173 << 16) | 7, + MOV_CH_LAYOUT_DTS_6_1_B = (174 << 16) | 7, + MOV_CH_LAYOUT_DTS_6_1_C = (175 << 16) | 7, + MOV_CH_LAYOUT_DTS_6_1_D = (182 << 16) | 7, + MOV_CH_LAYOUT_DTS_7_0 = (176 << 16) | 7, + MOV_CH_LAYOUT_DTS_7_1 = (177 << 16) | 8, + MOV_CH_LAYOUT_DTS_8_0_A = (178 << 16) | 8, + MOV_CH_LAYOUT_DTS_8_0_B = (179 << 16) | 8, + MOV_CH_LAYOUT_DTS_8_1_A = (180 << 16) | 9, + MOV_CH_LAYOUT_DTS_8_1_B = (181 << 16) | 9, +}; + +/** + * Get the channel layout tag for the specified codec id and channel layout. + * If the layout tag was not found, use a channel bitmap if possible. + * + * @param[in] codec_id codec id + * @param[in] channel_layout channel layout + * @param[out] bitmap channel bitmap + * @return channel layout tag + */ +int ff_mov_get_channel_layout_tag(const AVCodecParameters *par, + uint32_t *layout, + uint32_t *bitmap, + uint32_t **pchannel_desc); + +/** + * Read 'chan' tag from the input stream. + * + * @param s AVFormatContext + * @param pb AVIOContext + * @param st The stream to set codec values for + * @param size Remaining size in the 'chan' tag + * @return 0 if ok, or negative AVERROR code on failure + */ +int ff_mov_read_chan(AVFormatContext *s, AVIOContext *pb, AVStream *st, + int64_t size); + +/** + * Get ISO/IEC 23001-8 ChannelConfiguration from AVChannelLayout. + * + */ +int ff_mov_get_channel_config_from_layout(const AVChannelLayout *layout, int *config); + +/** + * Get AVChannelLayout from ISO/IEC 23001-8 ChannelConfiguration. + * + * @return 1 if the config was unknown, layout is untouched in this case + * 0 if the config was found + * <0 on error + */ +int ff_mov_get_channel_layout_from_config(int config, AVChannelLayout *layout, uint64_t omitted_channel_map); + +/** + * Get ISO/IEC 23001-8 OutputChannelPosition from AVChannelLayout. + */ +int ff_mov_get_channel_positions_from_layout(const AVChannelLayout *layout, + uint8_t *position, int position_num); + +/** + * Read 'chnl' tag from the input stream. + * + * @param s AVFormatContext + * @param pb AVIOContext + * @param st The stream to set codec values for + * @return 0 if ok, or negative AVERROR code on failure + */ +int ff_mov_read_chnl(AVFormatContext *s, AVIOContext *pb, AVStream *st); + +#endif /* AVFORMAT_MOV_CHAN_H */ diff --git a/include/libavformat/movenc.h b/include/libavformat/movenc.h new file mode 100644 index 0000000..d73f7f3 --- /dev/null +++ b/include/libavformat/movenc.h @@ -0,0 +1,296 @@ +/* + * MOV, 3GP, MP4 muxer + * Copyright (c) 2003 Thomas Raivio + * Copyright (c) 2004 Gildas Bazin + * Copyright (c) 2009 Baptiste Coudurier + * + * 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 AVFORMAT_MOVENC_H +#define AVFORMAT_MOVENC_H + +#include "avformat.h" +#include "movenccenc.h" +#include "libavcodec/packet_internal.h" + +#define MOV_FRAG_INFO_ALLOC_INCREMENT 64 +#define MOV_INDEX_CLUSTER_SIZE 1024 +#define MOV_TIMESCALE 1000 + +#define RTP_MAX_PACKET_SIZE 1450 + +#define MODE_MP4 0x01 +#define MODE_MOV 0x02 +#define MODE_3GP 0x04 +#define MODE_PSP 0x08 // example working PSP command line: +// ffmpeg -i testinput.avi -f psp -r 14.985 -s 320x240 -b 768 -ar 24000 -ab 32 M4V00001.MP4 +#define MODE_3G2 0x10 +#define MODE_IPOD 0x20 +#define MODE_ISM 0x40 +#define MODE_F4V 0x80 +#define MODE_AVIF 0x100 + +typedef struct MOVIentry { + uint64_t pos; + int64_t dts; + int64_t pts; + unsigned int size; + unsigned int samples_in_chunk; + unsigned int chunkNum; ///< Chunk number if the current entry is a chunk start otherwise 0 + unsigned int entries; + int cts; +#define MOV_SYNC_SAMPLE 0x0001 +#define MOV_PARTIAL_SYNC_SAMPLE 0x0002 +#define MOV_DISPOSABLE_SAMPLE 0x0004 + uint32_t flags; + AVProducerReferenceTime prft; +} MOVIentry; + +typedef struct HintSample { + const uint8_t *data; + int size; + int sample_number; + int offset; + int own_data; +} HintSample; + +typedef struct HintSampleQueue { + int size; + int len; + HintSample *samples; +} HintSampleQueue; + +typedef struct MOVFragmentInfo { + int64_t offset; + int64_t time; + int64_t duration; + int64_t tfrf_offset; + int size; +} MOVFragmentInfo; + +typedef struct MOVTrack { + int mode; + int entry, entry_written; + unsigned timescale; + uint64_t time; + int64_t track_duration; + int last_sample_is_subtitle_end; + long sample_count; + long sample_size; + long chunkCount; + int has_keyframes; + int has_disposable; +#define MOV_TRACK_CTTS 0x0001 +#define MOV_TRACK_STPS 0x0002 +#define MOV_TRACK_ENABLED 0x0004 + uint32_t flags; +#define MOV_TIMECODE_FLAG_DROPFRAME 0x0001 +#define MOV_TIMECODE_FLAG_24HOURSMAX 0x0002 +#define MOV_TIMECODE_FLAG_ALLOWNEGATIVE 0x0004 + uint32_t timecode_flags; + int language; + int track_id; + int tag; ///< stsd fourcc + AVStream *st; + AVCodecParameters *par; + int mono_as_fc; + int multichannel_as_mono; + + int vos_len; + uint8_t *vos_data; + MOVIentry *cluster; + MOVIentry *cluster_written; + unsigned cluster_capacity; + int audio_vbr; + int height; ///< active picture (w/o VBI) height for D-10/IMX + uint32_t tref_tag; + int tref_id; ///< trackID of the referenced track + int64_t start_dts; + int64_t start_cts; + int64_t end_pts; + int end_reliable; + int64_t dts_shift; + + int hint_track; ///< the track that hints this track, -1 if no hint track is set + int src_track; ///< the track that this hint (or tmcd) track describes + AVFormatContext *rtp_ctx; ///< the format context for the hinting rtp muxer + uint32_t prev_rtp_ts; + int64_t cur_rtp_ts_unwrapped; + uint32_t max_packet_size; + + int64_t default_duration; + uint32_t default_sample_flags; + uint32_t default_size; + + HintSampleQueue sample_queue; + AVPacket *cover_image; + + AVIOContext *mdat_buf; + int64_t data_offset; + int frag_discont; + int entries_flushed; + + int nb_frag_info; + MOVFragmentInfo *frag_info; + unsigned frag_info_capacity; + + struct { + int first_packet_seq; + int first_packet_entry; + int first_packet_seen; + int first_frag_written; + int packet_seq; + int packet_entry; + int slices; + } vc1_info; + + void *eac3_priv; + + MOVMuxCencContext cenc; + + uint32_t palette[AVPALETTE_COUNT]; + int pal_done; + + int is_unaligned_qt_rgb; + + unsigned int squash_fragment_samples_to_one; //< flag to note formats where all samples for a fragment are to be squashed + + PacketList squashed_packet_queue; + + struct IAMFContext *iamf; + int first_iamf_idx; + int last_iamf_idx; + AVIOContext *iamf_buf; +} MOVTrack; + +typedef enum { + MOV_ENC_NONE = 0, + MOV_ENC_CENC_AES_CTR, +} MOVEncryptionScheme; + +typedef enum { + MOV_PRFT_NONE = 0, + MOV_PRFT_SRC_WALLCLOCK, + MOV_PRFT_SRC_PTS, + MOV_PRFT_NB +} MOVPrftBox; + +typedef struct MOVMuxContext { + const AVClass *av_class; + int mode; + int64_t time; + int nb_streams; + int nb_tracks; + int nb_meta_tmcd; ///< number of new created tmcd track based on metadata (aka not data copy) + int chapter_track; ///< qt chapter track number + int64_t mdat_pos; + uint64_t mdat_size; + MOVTrack *tracks; + + int flags; + int rtp_flags; + + int iods_skip; + int iods_video_profile; + int iods_audio_profile; + + int moov_written; + int fragments; + int max_fragment_duration; + int min_fragment_duration; + int max_fragment_size; + int ism_lookahead; + AVIOContext *mdat_buf; + int first_trun; + + int video_track_timescale; + + int reserved_moov_size; ///< 0 for disabled, -1 for automatic, size otherwise + int64_t reserved_header_pos; + + char *major_brand; + + int per_stream_grouping; + AVFormatContext *fc; + + AVPacket *pkt; + + int use_editlist; + float gamma; + + int frag_interleave; + int missing_duration_warned; + + char *encryption_scheme_str; + MOVEncryptionScheme encryption_scheme; + uint8_t *encryption_key; + int encryption_key_len; + uint8_t *encryption_kid; + int encryption_kid_len; + + int need_rewrite_extradata; + + int use_stream_ids_as_track_ids; + int track_ids_ok; + int write_btrt; + int write_tmcd; + MOVPrftBox write_prft; + int empty_hdlr_name; + int movie_timescale; + + int64_t avif_extent_pos[2]; // index 0 is YUV and 1 is Alpha. + int avif_extent_length[2]; // index 0 is YUV and 1 is Alpha. + int is_animated_avif; + int avif_loop_count; +} MOVMuxContext; + +#define FF_MOV_FLAG_RTP_HINT (1 << 0) +#define FF_MOV_FLAG_FRAGMENT (1 << 1) +#define FF_MOV_FLAG_EMPTY_MOOV (1 << 2) +#define FF_MOV_FLAG_FRAG_KEYFRAME (1 << 3) +#define FF_MOV_FLAG_SEPARATE_MOOF (1 << 4) +#define FF_MOV_FLAG_FRAG_CUSTOM (1 << 5) +#define FF_MOV_FLAG_ISML (1 << 6) +#define FF_MOV_FLAG_FASTSTART (1 << 7) +#define FF_MOV_FLAG_OMIT_TFHD_OFFSET (1 << 8) +#define FF_MOV_FLAG_DISABLE_CHPL (1 << 9) +#define FF_MOV_FLAG_DEFAULT_BASE_MOOF (1 << 10) +#define FF_MOV_FLAG_DASH (1 << 11) +#define FF_MOV_FLAG_FRAG_DISCONT (1 << 12) +#define FF_MOV_FLAG_DELAY_MOOV (1 << 13) +#define FF_MOV_FLAG_GLOBAL_SIDX (1 << 14) +#define FF_MOV_FLAG_WRITE_COLR (1 << 15) +#define FF_MOV_FLAG_WRITE_GAMA (1 << 16) +#define FF_MOV_FLAG_USE_MDTA (1 << 17) +#define FF_MOV_FLAG_SKIP_TRAILER (1 << 18) +#define FF_MOV_FLAG_NEGATIVE_CTS_OFFSETS (1 << 19) +#define FF_MOV_FLAG_FRAG_EVERY_FRAME (1 << 20) +#define FF_MOV_FLAG_SKIP_SIDX (1 << 21) +#define FF_MOV_FLAG_CMAF (1 << 22) +#define FF_MOV_FLAG_PREFER_ICC (1 << 23) +#define FF_MOV_FLAG_HYBRID_FRAGMENTED (1 << 24) + +int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt); + +int ff_mov_init_hinting(AVFormatContext *s, int index, int src_index); +int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt, + int track_index, int sample, + uint8_t *sample_data, int sample_size); +void ff_mov_close_hinting(MOVTrack *track); + +#endif /* AVFORMAT_MOVENC_H */ diff --git a/include/libavformat/movenc_ttml.h b/include/libavformat/movenc_ttml.h new file mode 100644 index 0000000..c71ecd0 --- /dev/null +++ b/include/libavformat/movenc_ttml.h @@ -0,0 +1,31 @@ +/* + * MP4, ISMV Muxer TTML helpers + * Copyright (c) 2021 24i + * + * 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 AVFORMAT_MOVENC_TTML_H +#define AVFORMAT_MOVENC_TTML_H + +#include "avformat.h" +#include "movenc.h" + +int ff_mov_generate_squashed_ttml_packet(AVFormatContext *s, + MOVTrack *track, AVPacket *pkt); + +#endif /* AVFORMAT_MOVENC_TTML_H */ diff --git a/include/libavformat/movenccenc.h b/include/libavformat/movenccenc.h new file mode 100644 index 0000000..6f9e70e --- /dev/null +++ b/include/libavformat/movenccenc.h @@ -0,0 +1,86 @@ +/* + * MOV CENC (Common Encryption) writer + * Copyright (c) 2015 Eran Kornblau + * + * 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 AVFORMAT_MOVENCCENC_H +#define AVFORMAT_MOVENCCENC_H + +#include "libavutil/aes_ctr.h" +#include "avformat.h" +#include "avio.h" + +#define CENC_KID_SIZE (16) + +struct MOVTrack; + +typedef struct { + struct AVAESCTR* aes_ctr; + uint8_t* auxiliary_info; + size_t auxiliary_info_size; + size_t auxiliary_info_alloc_size; + uint32_t auxiliary_info_entries; + + /* subsample support */ + int use_subsamples; + uint16_t subsample_count; + size_t auxiliary_info_subsample_start; + uint8_t* auxiliary_info_sizes; + size_t auxiliary_info_sizes_alloc_size; +} MOVMuxCencContext; + +/** + * Initialize a CENC context + * @param key encryption key, must have a length of AES_CTR_KEY_SIZE + * @param use_subsamples when enabled parts of a packet can be encrypted, otherwise the whole packet is encrypted + */ +int ff_mov_cenc_init(MOVMuxCencContext* ctx, uint8_t* encryption_key, int use_subsamples, int bitexact); + +/** + * Free a CENC context + */ +void ff_mov_cenc_free(MOVMuxCencContext* ctx); + +/** + * Write a fully encrypted packet + */ +int ff_mov_cenc_write_packet(MOVMuxCencContext* ctx, AVIOContext *pb, const uint8_t *buf_in, int size); + +/** + * Parse AVC NAL units from annex B format, the nal size and type are written in the clear while the body is encrypted + */ +int ff_mov_cenc_avc_parse_nal_units(MOVMuxCencContext* ctx, AVIOContext *pb, const uint8_t *buf_in, int size); + +/** + * Write AVC NAL units that are in MP4 format, the nal size and type are written in the clear while the body is encrypted + */ +int ff_mov_cenc_avc_write_nal_units(AVFormatContext *s, MOVMuxCencContext* ctx, int nal_length_size, + AVIOContext *pb, const uint8_t *buf_in, int size); + +/** + * Write the cenc atoms that should reside inside stbl + */ +void ff_mov_cenc_write_stbl_atoms(MOVMuxCencContext* ctx, AVIOContext *pb); + +/** + * Write the sinf atom, contained inside stsd + */ +int ff_mov_cenc_write_sinf_tag(struct MOVTrack* track, AVIOContext *pb, uint8_t* kid); + +#endif /* AVFORMAT_MOVENCCENC_H */ diff --git a/include/libavformat/mpeg.h b/include/libavformat/mpeg.h new file mode 100644 index 0000000..20592eb --- /dev/null +++ b/include/libavformat/mpeg.h @@ -0,0 +1,75 @@ +/* + * MPEG-1/2 muxer and demuxer common defines + * Copyright (c) 2000, 2001, 2002 Fabrice Bellard + * + * 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 AVFORMAT_MPEG_H +#define AVFORMAT_MPEG_H + +#include +#include "libavutil/intreadwrite.h" + +#define PACK_START_CODE ((unsigned int)0x000001ba) +#define SYSTEM_HEADER_START_CODE ((unsigned int)0x000001bb) +#define SEQUENCE_END_CODE ((unsigned int)0x000001b7) +#define PACKET_START_CODE_MASK ((unsigned int)0xffffff00) +#define PACKET_START_CODE_PREFIX ((unsigned int)0x00000100) +#define ISO_11172_END_CODE ((unsigned int)0x000001b9) + +/* mpeg2 */ +#define PROGRAM_STREAM_MAP 0x1bc +#define PRIVATE_STREAM_1 0x1bd +#define PADDING_STREAM 0x1be +#define PRIVATE_STREAM_2 0x1bf + +#define AUDIO_ID 0xc0 +#define VIDEO_ID 0xe0 +#define H264_ID 0xe2 +#define AC3_ID 0x80 +#define DTS_ID 0x88 +#define LPCM_ID 0xa0 +#define SUB_ID 0x20 + +#define STREAM_TYPE_VIDEO_MPEG1 0x01 +#define STREAM_TYPE_VIDEO_MPEG2 0x02 +#define STREAM_TYPE_AUDIO_MPEG1 0x03 +#define STREAM_TYPE_AUDIO_MPEG2 0x04 +#define STREAM_TYPE_PRIVATE_SECTION 0x05 +#define STREAM_TYPE_PRIVATE_DATA 0x06 +#define STREAM_TYPE_AUDIO_AAC 0x0f +#define STREAM_TYPE_VIDEO_MPEG4 0x10 +#define STREAM_TYPE_VIDEO_H264 0x1b +#define STREAM_TYPE_VIDEO_HEVC 0x24 +#define STREAM_TYPE_VIDEO_VVC 0x33 +#define STREAM_TYPE_VIDEO_CAVS 0x42 + +#define STREAM_TYPE_AUDIO_AC3 0x81 + +static const int lpcm_freq_tab[4] = { 48000, 96000, 44100, 32000 }; + +/** + * Parse MPEG-PES five-byte timestamp + */ +static inline int64_t ff_parse_pes_pts(const uint8_t *buf) { + return (int64_t)(*buf & 0x0e) << 29 | + (AV_RB16(buf+1) >> 1) << 15 | + AV_RB16(buf+3) >> 1; +} + +#endif /* AVFORMAT_MPEG_H */ diff --git a/include/libavformat/mpegts.h b/include/libavformat/mpegts.h new file mode 100644 index 0000000..14ae312 --- /dev/null +++ b/include/libavformat/mpegts.h @@ -0,0 +1,235 @@ +/* + * MPEG-2 transport stream defines + * Copyright (c) 2003 Fabrice Bellard + * + * 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 AVFORMAT_MPEGTS_H +#define AVFORMAT_MPEGTS_H + +#include "avformat.h" + +#define TS_FEC_PACKET_SIZE 204 +#define TS_DVHS_PACKET_SIZE 192 +#define TS_PACKET_SIZE 188 +#define TS_MAX_PACKET_SIZE 204 + +#define NB_PID_MAX 8192 +#define USUAL_SECTION_SIZE 1024 /* except EIT which is limited to 4096 */ +#define MAX_SECTION_SIZE 4096 + +/* pids */ +#define PAT_PID 0x0000 /* Program Association Table */ +#define CAT_PID 0x0001 /* Conditional Access Table */ +#define TSDT_PID 0x0002 /* Transport Stream Description Table */ +#define IPMP_PID 0x0003 +/* PID from 0x0004 to 0x000F are reserved */ +#define NIT_PID 0x0010 /* Network Information Table */ +#define SDT_PID 0x0011 /* Service Description Table */ +#define BAT_PID 0x0011 /* Bouquet Association Table */ +#define EIT_PID 0x0012 /* Event Information Table */ +#define RST_PID 0x0013 /* Running Status Table */ +#define TDT_PID 0x0014 /* Time and Date Table */ +#define TOT_PID 0x0014 +#define NET_SYNC_PID 0x0015 +#define RNT_PID 0x0016 /* RAR Notification Table */ +/* PID from 0x0017 to 0x001B are reserved for future use */ +/* PID value 0x001C allocated to link-local inband signalling shall not be + * used on any broadcast signals. It shall only be used between devices in a + * controlled environment. */ +#define LINK_LOCAL_PID 0x001C +#define MEASUREMENT_PID 0x001D +#define DIT_PID 0x001E /* Discontinuity Information Table */ +#define SIT_PID 0x001F /* Selection Information Table */ +/* PID from 0x0020 to 0x1FFA may be assigned as needed to PMT, elementary + * streams and other data tables */ +#define FIRST_OTHER_PID 0x0020 +#define LAST_OTHER_PID 0x1FFA +/* PID 0x1FFB is used by DigiCipher 2/ATSC MGT metadata */ +/* PID from 0x1FFC to 0x1FFE may be assigned as needed to PMT, elementary + * streams and other data tables */ +#define NULL_PID 0x1FFF /* Null packet (used for fixed bandwidth padding) */ + +/* m2ts pids */ +#define M2TS_PMT_PID 0x0100 +#define M2TS_PCR_PID 0x1001 +#define M2TS_VIDEO_PID 0x1011 +#define M2TS_AUDIO_START_PID 0x1100 +#define M2TS_PGSSUB_START_PID 0x1200 +#define M2TS_TEXTSUB_PID 0x1800 +#define M2TS_SECONDARY_AUDIO_START_PID 0x1A00 +#define M2TS_SECONDARY_VIDEO_START_PID 0x1B00 + +/* table ids */ +#define PAT_TID 0x00 /* Program Association section */ +#define CAT_TID 0x01 /* Conditional Access section */ +#define PMT_TID 0x02 /* Program Map section */ +#define TSDT_TID 0x03 /* Transport Stream Description section */ +/* TID from 0x04 to 0x3F are reserved */ +#define M4OD_TID 0x05 +#define NIT_TID 0x40 /* Network Information section - actual network */ +#define ONIT_TID 0x41 /* Network Information section - other network */ +#define SDT_TID 0x42 /* Service Description section - actual TS */ +/* TID from 0x43 to 0x45 are reserved for future use */ +#define OSDT_TID 0x46 /* Service Descrition section - other TS */ +/* TID from 0x47 to 0x49 are reserved for future use */ +#define BAT_TID 0x4A /* Bouquet Association section */ +#define UNT_TID 0x4B /* Update Notification Table section */ +#define DFI_TID 0x4C /* Downloadable Font Info section */ +/* TID 0x4D is reserved for future use */ +#define EIT_TID 0x4E /* Event Information section - actual TS */ +#define OEIT_TID 0x4F /* Event Information section - other TS */ +#define EITS_START_TID 0x50 /* Event Information section schedule - actual TS */ +#define EITS_END_TID 0x5F /* Event Information section schedule - actual TS */ +#define OEITS_START_TID 0x60 /* Event Information section schedule - other TS */ +#define OEITS_END_TID 0x6F /* Event Information section schedule - other TS */ +#define TDT_TID 0x70 /* Time Date section */ +#define RST_TID 0x71 /* Running Status section */ +#define ST_TID 0x72 /* Stuffing section */ +#define TOT_TID 0x73 /* Time Offset section */ +#define AIT_TID 0x74 /* Application Inforamtion section */ +#define CT_TID 0x75 /* Container section */ +#define RCT_TID 0x76 /* Related Content section */ +#define CIT_TID 0x77 /* Content Identifier section */ +#define MPE_FEC_TID 0x78 /* MPE-FEC section */ +#define RPNT_TID 0x79 /* Resolution Provider Notification section */ +#define MPE_IFEC_TID 0x7A /* MPE-IFEC section */ +#define PROTMT_TID 0x7B /* Protection Message section */ +/* TID from 0x7C to 0x7D are reserved for future use */ +#define DIT_TID 0x7E /* Discontinuity Information section */ +#define SIT_TID 0x7F /* Selection Information section */ +/* TID from 0x80 to 0xFE are user defined */ +/* TID 0xFF is reserved */ + +#define STREAM_TYPE_VIDEO_MPEG1 0x01 +#define STREAM_TYPE_VIDEO_MPEG2 0x02 +#define STREAM_TYPE_AUDIO_MPEG1 0x03 +#define STREAM_TYPE_AUDIO_MPEG2 0x04 +#define STREAM_TYPE_PRIVATE_SECTION 0x05 +#define STREAM_TYPE_PRIVATE_DATA 0x06 +#define STREAM_TYPE_AUDIO_AAC 0x0f +#define STREAM_TYPE_AUDIO_AAC_LATM 0x11 +#define STREAM_TYPE_VIDEO_MPEG4 0x10 +#define STREAM_TYPE_METADATA 0x15 +#define STREAM_TYPE_VIDEO_H264 0x1b +#define STREAM_TYPE_VIDEO_HEVC 0x24 +#define STREAM_TYPE_VIDEO_VVC 0x33 +#define STREAM_TYPE_VIDEO_CAVS 0x42 +#define STREAM_TYPE_VIDEO_AVS2 0xd2 +#define STREAM_TYPE_VIDEO_AVS3 0xd4 +#define STREAM_TYPE_VIDEO_VC1 0xea +#define STREAM_TYPE_VIDEO_DIRAC 0xd1 + +#define STREAM_TYPE_AUDIO_AC3 0x81 +#define STREAM_TYPE_AUDIO_DTS 0x82 +#define STREAM_TYPE_AUDIO_TRUEHD 0x83 +#define STREAM_TYPE_AUDIO_EAC3 0x87 + +/* ISO/IEC 13818-1 Table 2-22 */ +#define STREAM_ID_PROGRAM_STREAM_MAP 0xbc +#define STREAM_ID_PRIVATE_STREAM_1 0xbd +#define STREAM_ID_PADDING_STREAM 0xbe +#define STREAM_ID_PRIVATE_STREAM_2 0xbf +#define STREAM_ID_AUDIO_STREAM_0 0xc0 +#define STREAM_ID_VIDEO_STREAM_0 0xe0 +#define STREAM_ID_ECM_STREAM 0xf0 +#define STREAM_ID_EMM_STREAM 0xf1 +#define STREAM_ID_DSMCC_STREAM 0xf2 +#define STREAM_ID_TYPE_E_STREAM 0xf8 +#define STREAM_ID_METADATA_STREAM 0xfc +#define STREAM_ID_EXTENDED_STREAM_ID 0xfd +#define STREAM_ID_PROGRAM_STREAM_DIRECTORY 0xff + +/* ISO/IEC 13818-1 Table 2-45 */ +#define VIDEO_STREAM_DESCRIPTOR 0x02 +#define REGISTRATION_DESCRIPTOR 0x05 +#define ISO_639_LANGUAGE_DESCRIPTOR 0x0a +#define IOD_DESCRIPTOR 0x1d +#define SL_DESCRIPTOR 0x1e +#define FMC_DESCRIPTOR 0x1f +#define METADATA_DESCRIPTOR 0x26 +#define METADATA_STD_DESCRIPTOR 0x27 + +typedef struct MpegTSContext MpegTSContext; + +MpegTSContext *avpriv_mpegts_parse_open(AVFormatContext *s); +int avpriv_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt, + const uint8_t *buf, int len); +void avpriv_mpegts_parse_close(MpegTSContext *ts); + +typedef struct SLConfigDescr { + int use_au_start; + int use_au_end; + int use_rand_acc_pt; + int use_padding; + int use_timestamps; + int use_idle; + int timestamp_res; + int timestamp_len; + int ocr_len; + int au_len; + int inst_bitrate_len; + int degr_prior_len; + int au_seq_num_len; + int packet_seq_num_len; +} SLConfigDescr; + +typedef struct Mp4Descr { + int es_id; + int dec_config_descr_len; + uint8_t *dec_config_descr; + SLConfigDescr sl; +} Mp4Descr; + +/* + * ETSI 300 468 descriptor 0x6A(AC-3) + * Refer to: ETSI EN 300 468 V1.11.1 (2010-04) (SI in DVB systems) + */ +typedef struct DVBAC3Descriptor { + uint8_t component_type_flag; + uint8_t bsid_flag; + uint8_t mainid_flag; + uint8_t asvc_flag; + uint8_t reserved_flags; + uint8_t component_type; + uint8_t bsid; + uint8_t mainid; + uint8_t asvc; +} DVBAC3Descriptor; + +/** + * Parse an MPEG-2 descriptor + * @param[in] fc Format context (used for logging only) + * @param st Stream + * @param stream_type STREAM_TYPE_xxx + * @param pp Descriptor buffer pointer + * @param desc_list_end End of buffer + * @return <0 to stop processing + */ +int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type, + const uint8_t **pp, const uint8_t *desc_list_end, + Mp4Descr *mp4_descr, int mp4_descr_count, int pid, + MpegTSContext *ts); + +/** + * Check presence of H264 startcode + * @return <0 to stop processing + */ +int ff_check_h264_startcode(AVFormatContext *s, const AVStream *st, const AVPacket *pkt); + +#endif /* AVFORMAT_MPEGTS_H */ diff --git a/include/libavformat/mux.h b/include/libavformat/mux.h new file mode 100644 index 0000000..0b69109 --- /dev/null +++ b/include/libavformat/mux.h @@ -0,0 +1,280 @@ +/* + * copyright (c) 2001 Fabrice Bellard + * + * 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 AVFORMAT_MUX_H +#define AVFORMAT_MUX_H + +#include +#include "libavcodec/packet.h" +#include "avformat.h" + +struct AVDeviceInfoList; + +/** + * This flag indicates that the muxer stores data internally + * and supports flushing it. Flushing is signalled by sending + * a NULL packet to the muxer's write_packet callback; + * without this flag, a muxer never receives NULL packets. + * So the documentation of write_packet below for the semantics + * of the return value in case of flushing. + */ +#define FF_OFMT_FLAG_ALLOW_FLUSH (1 << 1) +/** + * If this flag is set, it indicates that for each codec type + * whose corresponding default codec (i.e. AVOutputFormat.audio_codec, + * AVOutputFormat.video_codec and AVOutputFormat.subtitle_codec) + * is set (i.e. != AV_CODEC_ID_NONE) only one stream of this type + * can be muxed. It furthermore indicates that no stream with + * a codec type that has no default codec or whose default codec + * is AV_CODEC_ID_NONE can be muxed. + * Both of these restrictions are checked generically before + * the actual muxer's init/write_header callbacks. + */ +#define FF_OFMT_FLAG_MAX_ONE_OF_EACH (1 << 2) +/** + * If this flag is set, then the only permitted audio/video/subtitle + * codec ids are AVOutputFormat.audio/video/subtitle_codec; + * if any of the latter is unset (i.e. equal to AV_CODEC_ID_NONE), + * then no stream of the corresponding type is supported. + * In addition, codec types without default codec field + * are disallowed. + */ +#define FF_OFMT_FLAG_ONLY_DEFAULT_CODECS (1 << 3) + +typedef struct FFOutputFormat { + /** + * The public AVOutputFormat. See avformat.h for it. + */ + AVOutputFormat p; + /** + * size of private data so that it can be allocated in the wrapper + */ + int priv_data_size; + + /** + * Internal flags. See FF_OFMT_FLAG_* above and FF_FMT_FLAG_* in internal.h. + */ + int flags_internal; + + int (*write_header)(AVFormatContext *); + /** + * Write a packet. If FF_OFMT_FLAG_ALLOW_FLUSH is set in flags_internal, + * pkt can be NULL in order to flush data buffered in the muxer. + * When flushing, return 0 if there still is more data to flush, + * or 1 if everything was flushed and there is no more buffered + * data. + */ + int (*write_packet)(AVFormatContext *, AVPacket *pkt); + int (*write_trailer)(AVFormatContext *); + /** + * A format-specific function for interleavement. + * If unset, packets will be interleaved by dts. + * + * @param s An AVFormatContext for output. pkt will be added to + * resp. taken from its packet buffer. + * @param[in,out] pkt A packet to be interleaved if has_packet is set; + * also used to return packets. If no packet is returned + * (e.g. on error), pkt is blank on return. + * @param flush 1 if no further packets are available as input and + * all remaining packets should be output. + * @param has_packet If set, pkt contains a packet to be interleaved + * on input; otherwise pkt is blank on input. + * @return 1 if a packet was output, 0 if no packet could be output, + * < 0 if an error occurred + */ + int (*interleave_packet)(AVFormatContext *s, AVPacket *pkt, + int flush, int has_packet); + /** + * Test if the given codec can be stored in this container. + * + * @return 1 if the codec is supported, 0 if it is not. + * A negative number if unknown. + * MKTAG('A', 'P', 'I', 'C') if the codec is only supported as AV_DISPOSITION_ATTACHED_PIC + */ + int (*query_codec)(enum AVCodecID id, int std_compliance); + + void (*get_output_timestamp)(AVFormatContext *s, int stream, + int64_t *dts, int64_t *wall); + /** + * Allows sending messages from application to device. + */ + int (*control_message)(AVFormatContext *s, int type, + void *data, size_t data_size); + + /** + * Write an uncoded AVFrame. + * + * See av_write_uncoded_frame() for details. + * + * The library will free *frame afterwards, but the muxer can prevent it + * by setting the pointer to NULL. + */ + int (*write_uncoded_frame)(AVFormatContext *, int stream_index, + struct AVFrame **frame, unsigned flags); + /** + * Returns device list with it properties. + * @see avdevice_list_devices() for more details. + */ + int (*get_device_list)(AVFormatContext *s, struct AVDeviceInfoList *device_list); + /** + * Initialize format. May allocate data here, and set any AVFormatContext or + * AVStream parameters that need to be set before packets are sent. + * This method must not write output. + * + * Return 0 if streams were fully configured, 1 if not, negative AVERROR on failure + * + * Any allocations made here must be freed in deinit(). + */ + int (*init)(AVFormatContext *); + /** + * Deinitialize format. If present, this is called whenever the muxer is being + * destroyed, regardless of whether or not the header has been written. + * + * If a trailer is being written, this is called after write_trailer(). + * + * This is called if init() fails as well. + */ + void (*deinit)(AVFormatContext *); + /** + * Set up any necessary bitstream filtering and extract any extra data needed + * for the global header. + * + * @note pkt might have been directly forwarded by a meta-muxer; therefore + * pkt->stream_index as well as the pkt's timebase might be invalid. + * Return 0 if more packets from this stream must be checked; 1 if not. + */ + int (*check_bitstream)(AVFormatContext *s, AVStream *st, + const AVPacket *pkt); +} FFOutputFormat; + +static inline const FFOutputFormat *ffofmt(const AVOutputFormat *fmt) +{ + return (const FFOutputFormat*)fmt; +} + +/** + * Add packet to an AVFormatContext's packet_buffer list, determining its + * interleaved position using compare() function argument. + * @return 0 on success, < 0 on error. pkt will always be blank on return. + */ +int ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt, + int (*compare)(AVFormatContext *, const AVPacket *, const AVPacket *)); + +/** + * Interleave an AVPacket per dts so it can be muxed. + * See the documentation of AVOutputFormat.interleave_packet for details. + */ +int ff_interleave_packet_per_dts(AVFormatContext *s, AVPacket *pkt, + int flush, int has_packet); + +/** + * Interleave packets directly in the order in which they arrive + * without any sort of buffering. + */ +int ff_interleave_packet_passthrough(AVFormatContext *s, AVPacket *pkt, + int flush, int has_packet); + +/** + * Find the next packet in the interleaving queue for the given stream. + * + * @return a pointer to a packet if one was found, NULL otherwise. + */ +const AVPacket *ff_interleaved_peek(AVFormatContext *s, int stream); + +int ff_get_muxer_ts_offset(AVFormatContext *s, int stream_index, int64_t *offset); + +/** + * Add a bitstream filter to a stream. + * + * @param st output stream to add a filter to + * @param name the name of the filter to add + * @param args filter-specific argument string + * @return >0 on success; + * AVERROR code on failure + */ +int ff_stream_add_bitstream_filter(AVStream *st, const char *name, const char *args); + +/** + * Write a packet to another muxer than the one the user originally + * intended. Useful when chaining muxers, where one muxer internally + * writes a received packet to another muxer. + * + * @param dst the muxer to write the packet to + * @param dst_stream the stream index within dst to write the packet to + * @param pkt the packet to be written. It will be returned blank when + * av_interleaved_write_frame() is used, unchanged otherwise. + * @param src the muxer the packet originally was intended for + * @param interleave 0->use av_write_frame, 1->av_interleaved_write_frame + * @return the value av_write_frame returned + */ +int ff_write_chained(AVFormatContext *dst, int dst_stream, AVPacket *pkt, + AVFormatContext *src, int interleave); + +/** + * Flags for AVFormatContext.write_uncoded_frame() + */ +enum AVWriteUncodedFrameFlags { + + /** + * Query whether the feature is possible on this stream. + * The frame argument is ignored. + */ + AV_WRITE_UNCODED_FRAME_QUERY = 0x0001, + +}; + +/** + * Make shift_size amount of space at read_start by shifting data in the output + * at read_start until the current IO position. The underlying IO context must + * be seekable. + */ +int ff_format_shift_data(AVFormatContext *s, int64_t read_start, int shift_size); + +/** + * Utility function to open IO stream of output format. + * + * @param s AVFormatContext + * @param url URL or file name to open for writing + * @options optional options which will be passed to io_open callback + * @return >=0 on success, negative AVERROR in case of failure + */ +int ff_format_output_open(AVFormatContext *s, const char *url, AVDictionary **options); + +/** + * Parse creation_time in AVFormatContext metadata if exists and warn if the + * parsing fails. + * + * @param s AVFormatContext + * @param timestamp parsed timestamp in microseconds, only set on successful parsing + * @param return_seconds set this to get the number of seconds in timestamp instead of microseconds + * @return 1 if OK, 0 if the metadata was not present, AVERROR(EINVAL) on parse error + */ +int ff_parse_creation_time_metadata(AVFormatContext *s, int64_t *timestamp, int return_seconds); + +/** + * Standardize creation_time metadata in AVFormatContext to an ISO-8601 + * timestamp string. + * + * @param s AVFormatContext + * @return <0 on error + */ +int ff_standardize_creation_time(AVFormatContext *s); + +#endif /* AVFORMAT_MUX_H */ diff --git a/include/libavformat/mxf.h b/include/libavformat/mxf.h new file mode 100644 index 0000000..673703f --- /dev/null +++ b/include/libavformat/mxf.h @@ -0,0 +1,166 @@ +/* + * MXF + * Copyright (c) 2006 SmartJog S.A., Baptiste Coudurier + * + * 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 AVFORMAT_MXF_H +#define AVFORMAT_MXF_H + +#include +#include "libavutil/log.h" +#include "libavutil/pixfmt.h" +#include "libavutil/rational.h" +#include "libavutil/uuid.h" + +typedef AVUUID UID; + +enum MXFMetadataSetType { + MaterialPackage = 1, + SourcePackage, + SourceClip, + TimecodeComponent, + PulldownComponent, + Sequence, + MultipleDescriptor, + Descriptor, + Track, + CryptoContext, + Preface, + Identification, + ContentStorage, + SubDescriptor, + IndexTableSegment, + EssenceContainerData, + EssenceGroup, + TaggedValue, + TapeDescriptor, + AVCSubDescriptor, + AudioChannelLabelSubDescriptor, + SoundfieldGroupLabelSubDescriptor, + GroupOfSoundfieldGroupsLabelSubDescriptor, + FFV1SubDescriptor, + JPEG2000SubDescriptor, + MetadataSetTypeNB +}; + +enum MXFFrameLayout { + FullFrame = 0, + SeparateFields, + OneField, + MixedFields, + SegmentedFrame, +}; + +typedef struct MXFContentPackageRate { + int rate; + AVRational tb; +} MXFContentPackageRate; + +typedef struct KLVPacket { + UID key; + int64_t offset; + uint64_t length; + int64_t next_klv; +} KLVPacket; + +typedef enum { + NormalWrap = 0, + D10D11Wrap, + RawAWrap, + RawVWrap, + J2KWrap +} MXFWrappingIndicatorType; + +typedef struct MXFLocalTagPair { + int local_tag; + UID uid; +} MXFLocalTagPair; + +extern const uint8_t ff_mxf_random_index_pack_key[16]; + +#define FF_MXF_MasteringDisplay_PREFIX 0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x0e,0x04,0x20,0x04,0x01,0x01 +#define FF_MXF_MasteringDisplayPrimaries { FF_MXF_MasteringDisplay_PREFIX,0x01,0x00,0x00 } +#define FF_MXF_MasteringDisplayWhitePointChromaticity { FF_MXF_MasteringDisplay_PREFIX,0x02,0x00,0x00 } +#define FF_MXF_MasteringDisplayMaximumLuminance { FF_MXF_MasteringDisplay_PREFIX,0x03,0x00,0x00 } +#define FF_MXF_MasteringDisplayMinimumLuminance { FF_MXF_MasteringDisplay_PREFIX,0x04,0x00,0x00 } + +#define FF_MXF_MASTERING_CHROMA_DEN 50000 +#define FF_MXF_MASTERING_LUMA_DEN 10000 + +typedef struct MXFCodecUL { + UID uid; + unsigned matching_len; + int id; + const char *desc; + unsigned wrapping_indicator_pos; + MXFWrappingIndicatorType wrapping_indicator_type; +} MXFCodecUL; + +extern const MXFCodecUL ff_mxf_data_definition_uls[]; +extern const MXFCodecUL ff_mxf_codec_uls[]; +extern const MXFCodecUL ff_mxf_pixel_format_uls[]; +extern const MXFCodecUL ff_mxf_codec_tag_uls[]; +extern const MXFCodecUL ff_mxf_color_primaries_uls[]; +extern const MXFCodecUL ff_mxf_color_trc_uls[]; +extern const MXFCodecUL ff_mxf_color_space_uls[]; + +int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum AVPixelFormat *pix_fmt); +int ff_mxf_get_content_package_rate(AVRational time_base); + + +#define PRIxUID \ + "%02x.%02x.%02x.%02x." \ + "%02x.%02x.%02x.%02x." \ + "%02x.%02x.%02x.%02x." \ + "%02x.%02x.%02x.%02x" + +#define UID_ARG(x) \ + (x)[0], (x)[1], (x)[2], (x)[3], \ + (x)[4], (x)[5], (x)[6], (x)[7], \ + (x)[8], (x)[9], (x)[10], (x)[11], \ + (x)[12], (x)[13], (x)[14], (x)[15] \ + +#ifdef DEBUG +#define PRINT_KEY(pc, s, x) \ + av_log(pc, AV_LOG_VERBOSE, \ + "%s " \ + "0x%02x,0x%02x,0x%02x,0x%02x," \ + "0x%02x,0x%02x,0x%02x,0x%02x," \ + "0x%02x,0x%02x,0x%02x,0x%02x," \ + "0x%02x,0x%02x,0x%02x,0x%02x ", \ + s, UID_ARG(x)); \ + av_log(pc, AV_LOG_INFO, \ + "%s " \ + "%02x.%02x.%02x.%02x." \ + "%02x.%02x.%02x.%02x." \ + "%02x.%02x.%02x.%02x." \ + "%02x.%02x.%02x.%02x\n", \ + s, UID_ARG(x)) +#else +#define PRINT_KEY(pc, s, x) do { if(0) \ + av_log(pc, AV_LOG_VERBOSE, \ + "%s " \ + "0x%02x,0x%02x,0x%02x,0x%02x," \ + "0x%02x,0x%02x,0x%02x,0x%02x," \ + "0x%02x,0x%02x,0x%02x,0x%02x," \ + "0x%02x,0x%02x,0x%02x,0x%02x ", \ + s, UID_ARG(x)); \ + }while(0) +#endif + +#endif /* AVFORMAT_MXF_H */ diff --git a/include/libavformat/nal.h b/include/libavformat/nal.h new file mode 100644 index 0000000..587276d --- /dev/null +++ b/include/libavformat/nal.h @@ -0,0 +1,67 @@ +/* + * NAL helper functions for muxers + * + * 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 AVFORMAT_NAL_H +#define AVFORMAT_NAL_H + +#include +#include "avio.h" + +typedef struct NALU { + int offset; + uint32_t size; +} NALU; + +typedef struct NALUList { + NALU *nalus; + unsigned nalus_array_size; + unsigned nb_nalus; ///< valid entries in nalus +} NALUList; + +/* This function will parse the given annex B buffer and create + * a NALUList from it. This list can be passed to ff_nal_units_write_list() + * to write the access unit reformatted to mp4. + * + * @param list A NALUList. The list->nalus and list->nalus_array_size + * must be valid when calling this function and may be updated. + * nb_nalus is set by this function on success. + * @param buf buffer containing annex B H.264 or H.265. Must be padded. + * @param size size of buf, excluding padding. + * @return < 0 on error, the size of the mp4-style packet on success. + */ +int ff_nal_units_create_list(NALUList *list, const uint8_t *buf, int size); + +/* Writes a NALUList to the specified AVIOContext. The list must originate + * from ff_nal_units_create_list() with the same buf. */ +void ff_nal_units_write_list(const NALUList *list, AVIOContext *pb, + const uint8_t *buf); + +const uint8_t *ff_nal_find_startcode(const uint8_t *p, const uint8_t *end); +const uint8_t *ff_nal_mp4_find_startcode(const uint8_t *start, + const uint8_t *end, + int nal_length_size); + +int ff_nal_parse_units(AVIOContext *s, const uint8_t *buf, int size); +int ff_nal_parse_units_buf(const uint8_t *buf_in, uint8_t **buf, int *size); + +uint8_t *ff_nal_unit_extract_rbsp(const uint8_t *src, uint32_t src_len, + uint32_t *dst_len, int header_len); + +#endif /* AVFORMAT_NAL_H */ diff --git a/include/libavformat/network.h b/include/libavformat/network.h new file mode 100644 index 0000000..ca21408 --- /dev/null +++ b/include/libavformat/network.h @@ -0,0 +1,341 @@ +/* + * Copyright (c) 2007 The FFmpeg Project + * + * 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 AVFORMAT_NETWORK_H +#define AVFORMAT_NETWORK_H + +#include +#include + +#include "config.h" +#include "libavutil/error.h" +#include "os_support.h" +#include "avio.h" +#include "url.h" + +#if HAVE_UNISTD_H +#include +#endif + +#if HAVE_WINSOCK2_H +#include +#include + +#ifndef EPROTONOSUPPORT +#define EPROTONOSUPPORT WSAEPROTONOSUPPORT +#endif +#ifndef ETIMEDOUT +#define ETIMEDOUT WSAETIMEDOUT +#endif +#ifndef ECONNREFUSED +#define ECONNREFUSED WSAECONNREFUSED +#endif +#ifndef EINPROGRESS +#define EINPROGRESS WSAEINPROGRESS +#endif +#ifndef ENOTCONN +#define ENOTCONN WSAENOTCONN +#endif + +#define getsockopt(a, b, c, d, e) getsockopt(a, b, c, (char*) d, e) +#define setsockopt(a, b, c, d, e) setsockopt(a, b, c, (const char*) d, e) + +int ff_neterrno(void); +#else +#include +#include +#include +#include +#include + +#define ff_neterrno() AVERROR(errno) +#endif /* HAVE_WINSOCK2_H */ + +#if HAVE_ARPA_INET_H +#include +#endif + +#if HAVE_POLL_H +#include +#endif + +int ff_socket_nonblock(int socket, int enable); + +int ff_network_init(void); +void ff_network_close(void); + +int ff_tls_init(void); +void ff_tls_deinit(void); + +int ff_network_wait_fd(int fd, int write); + +/** + * This works similarly to ff_network_wait_fd, but waits up to 'timeout' microseconds + * Uses ff_network_wait_fd in a loop + * + * @param fd Socket descriptor + * @param write Set 1 to wait for socket able to be read, 0 to be written + * @param timeout Timeout interval, in microseconds. Actual precision is 100000 mcs, due to ff_network_wait_fd usage + * @param int_cb Interrupt callback, is checked before each ff_network_wait_fd call + * @return 0 if data can be read/written, AVERROR(ETIMEDOUT) if timeout expired, or negative error code + */ +int ff_network_wait_fd_timeout(int fd, int write, int64_t timeout, AVIOInterruptCB *int_cb); + +/** + * Waits for up to 'timeout' microseconds. If the usert's int_cb is set and + * triggered, return before that. + * @param timeout Timeout in microseconds. Maybe have lower actual precision. + * @param int_cb Interrupt callback, is checked regularly. + * @return AVERROR(ETIMEDOUT) if timeout expirted, AVERROR_EXIT if interrupted by int_cb + */ +int ff_network_sleep_interruptible(int64_t timeout, AVIOInterruptCB *int_cb); + +#if !HAVE_STRUCT_SOCKADDR_STORAGE +struct sockaddr_storage { +#if HAVE_STRUCT_SOCKADDR_SA_LEN + uint8_t ss_len; + uint8_t ss_family; +#else + uint16_t ss_family; +#endif /* HAVE_STRUCT_SOCKADDR_SA_LEN */ + char ss_pad1[6]; + int64_t ss_align; + char ss_pad2[112]; +}; +#endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */ + +typedef union sockaddr_union { + struct sockaddr_storage storage; + struct sockaddr_in in; +#if HAVE_STRUCT_SOCKADDR_IN6 + struct sockaddr_in6 in6; +#endif +} sockaddr_union; + +#ifndef MSG_NOSIGNAL +#define MSG_NOSIGNAL 0 +#endif + +#if !HAVE_STRUCT_ADDRINFO +struct addrinfo { + int ai_flags; + int ai_family; + int ai_socktype; + int ai_protocol; + int ai_addrlen; + struct sockaddr *ai_addr; + char *ai_canonname; + struct addrinfo *ai_next; +}; +#endif /* !HAVE_STRUCT_ADDRINFO */ + +/* getaddrinfo constants */ +#ifndef EAI_AGAIN +#define EAI_AGAIN 2 +#endif +#ifndef EAI_BADFLAGS +#define EAI_BADFLAGS 3 +#endif +#ifndef EAI_FAIL +#define EAI_FAIL 4 +#endif +#ifndef EAI_FAMILY +#define EAI_FAMILY 5 +#endif +#ifndef EAI_MEMORY +#define EAI_MEMORY 6 +#endif +#ifndef EAI_NODATA +#define EAI_NODATA 7 +#endif +#ifndef EAI_NONAME +#define EAI_NONAME 8 +#endif +#ifndef EAI_SERVICE +#define EAI_SERVICE 9 +#endif +#ifndef EAI_SOCKTYPE +#define EAI_SOCKTYPE 10 +#endif + +#ifndef AI_PASSIVE +#define AI_PASSIVE 1 +#endif + +#ifndef AI_CANONNAME +#define AI_CANONNAME 2 +#endif + +#ifndef AI_NUMERICHOST +#define AI_NUMERICHOST 4 +#endif + +#ifndef NI_NOFQDN +#define NI_NOFQDN 1 +#endif + +#ifndef NI_NUMERICHOST +#define NI_NUMERICHOST 2 +#endif + +#ifndef NI_NAMERQD +#define NI_NAMERQD 4 +#endif + +#ifndef NI_NUMERICSERV +#define NI_NUMERICSERV 8 +#endif + +#ifndef NI_DGRAM +#define NI_DGRAM 16 +#endif + +#if !HAVE_GETADDRINFO +int ff_getaddrinfo(const char *node, const char *service, + const struct addrinfo *hints, struct addrinfo **res); +void ff_freeaddrinfo(struct addrinfo *res); +int ff_getnameinfo(const struct sockaddr *sa, int salen, + char *host, int hostlen, + char *serv, int servlen, int flags); +#define getaddrinfo ff_getaddrinfo +#define freeaddrinfo ff_freeaddrinfo +#define getnameinfo ff_getnameinfo +#endif /* !HAVE_GETADDRINFO */ + +#if !HAVE_GETADDRINFO || HAVE_WINSOCK2_H +const char *ff_gai_strerror(int ecode); +#undef gai_strerror +#define gai_strerror ff_gai_strerror +#endif /* !HAVE_GETADDRINFO || HAVE_WINSOCK2_H */ + +#ifndef INADDR_LOOPBACK +#define INADDR_LOOPBACK 0x7f000001 +#endif + +#ifndef INET_ADDRSTRLEN +#define INET_ADDRSTRLEN 16 +#endif + +#ifndef INET6_ADDRSTRLEN +#define INET6_ADDRSTRLEN INET_ADDRSTRLEN +#endif + +#ifndef IN_MULTICAST +#define IN_MULTICAST(a) ((((uint32_t)(a)) & 0xf0000000) == 0xe0000000) +#endif +#ifndef IN6_IS_ADDR_MULTICAST +#define IN6_IS_ADDR_MULTICAST(a) (((uint8_t *) (a))[0] == 0xff) +#endif + +int ff_is_multicast_address(struct sockaddr *addr); + +#define POLLING_TIME 100 /// Time in milliseconds between interrupt check + +/** + * Bind to a file descriptor and poll for a connection. + * + * @param fd First argument of bind(). + * @param addr Second argument of bind(). + * @param addrlen Third argument of bind(). + * @param timeout Polling timeout in milliseconds. + * @param h URLContext providing interrupt check + * callback and logging context. + * @return A non-blocking file descriptor on success + * or an AVERROR on failure. + */ +int ff_listen_bind(int fd, const struct sockaddr *addr, + socklen_t addrlen, int timeout, + URLContext *h); + +/** + * Bind to a file descriptor to an address without accepting connections. + * @param fd First argument of bind(). + * @param addr Second argument of bind(). + * @param addrlen Third argument of bind(). + * @return 0 on success or an AVERROR on failure. + */ +int ff_listen(int fd, const struct sockaddr *addr, socklen_t addrlen, + void *logctx); + +/** + * Poll for a single connection on the passed file descriptor. + * @param fd The listening socket file descriptor. + * @param timeout Polling timeout in milliseconds. + * @param h URLContext providing interrupt check + * callback and logging context. + * @return A non-blocking file descriptor on success + * or an AVERROR on failure. + */ +int ff_accept(int fd, int timeout, URLContext *h); + +/** + * Connect to a file descriptor and poll for result. + * + * @param fd First argument of connect(), + * will be set as non-blocking. + * @param addr Second argument of connect(). + * @param addrlen Third argument of connect(). + * @param timeout Polling timeout in milliseconds. + * @param h URLContext providing interrupt check + * callback and logging context. + * @param will_try_next Whether the caller will try to connect to another + * address for the same host name, affecting the form of + * logged errors. + * @return 0 on success, AVERROR on failure. + */ +int ff_listen_connect(int fd, const struct sockaddr *addr, + socklen_t addrlen, int timeout, + URLContext *h, int will_try_next); + +int ff_http_match_no_proxy(const char *no_proxy, const char *hostname); + +int ff_socket(int domain, int type, int protocol, void *logctx); + +void ff_log_net_error(void *ctx, int level, const char* prefix); + +/** + * Connect to any of the given addrinfo addresses, with multiple attempts + * running in parallel. + * + * @param addrs The list of addresses to try to connect to. + * This list will be mutated internally, but the list head + * will remain as such, so this doesn't affect the caller + * freeing the list afterwards. + * @param timeout_ms_per_address The number of milliseconds to wait for each + * connection attempt. Since multiple addresses are tried, + * some of them in parallel, the total run time will at most + * be timeout_ms_per_address*ceil(nb_addrs/parallel) + + * (parallel - 1) * NEXT_ATTEMPT_DELAY_MS. + * @param parallel The maximum number of connections to attempt in parallel. + * This is limited to an internal maximum capacity. + * @param h URLContext providing interrupt check + * callback and logging context. + * @param fd If successful, the connected socket is returned here. + * @param customize_fd Function that will be called for each socket created, + * to allow the caller to set socket options before calling + * connect() on it, may be NULL. + * @param customize_ctx Context parameter passed to customize_fd. + * @return 0 on success, AVERROR on failure. + */ +int ff_connect_parallel(struct addrinfo *addrs, int timeout_ms_per_address, + int parallel, URLContext *h, int *fd, + int (*customize_fd)(void *, int, int), void *customize_ctx); + +#endif /* AVFORMAT_NETWORK_H */ diff --git a/include/libavformat/nut.h b/include/libavformat/nut.h new file mode 100644 index 0000000..a4409ee --- /dev/null +++ b/include/libavformat/nut.h @@ -0,0 +1,144 @@ +/* + * "NUT" Container Format (de)muxer + * Copyright (c) 2006 Michael Niedermayer + * + * 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 AVFORMAT_NUT_H +#define AVFORMAT_NUT_H + +#include "avformat.h" +#include "internal.h" +#include "metadata.h" + +#define MAIN_STARTCODE (0x7A561F5F04ADULL + (((uint64_t)('N'<<8) + 'M')<<48)) +#define STREAM_STARTCODE (0x11405BF2F9DBULL + (((uint64_t)('N'<<8) + 'S')<<48)) +#define SYNCPOINT_STARTCODE (0xE4ADEECA4569ULL + (((uint64_t)('N'<<8) + 'K')<<48)) +#define INDEX_STARTCODE (0xDD672F23E64EULL + (((uint64_t)('N'<<8) + 'X')<<48)) +#define INFO_STARTCODE (0xAB68B596BA78ULL + (((uint64_t)('N'<<8) + 'I')<<48)) + +#define ID_STRING "nut/multimedia container\0" + +#define MAX_DISTANCE (1024*32-1) + +#define NUT_MAX_VERSION 4 +#define NUT_STABLE_VERSION 3 +#define NUT_MIN_VERSION 2 + +typedef enum{ + FLAG_KEY = 1, // if set, frame is keyframe + FLAG_EOR = 2, // if set, stream has no relevance on presentation. (EOR) + FLAG_CODED_PTS = 8, // if set, coded_pts is in the frame header + FLAG_STREAM_ID = 16, // if set, stream_id is coded in the frame header + FLAG_SIZE_MSB = 32, // if set, data_size_msb is at frame header, otherwise data_size_msb is 0 + FLAG_CHECKSUM = 64, // if set, the frame header contains a checksum + FLAG_RESERVED = 128, // if set, reserved_count is coded in the frame header + FLAG_SM_DATA = 256, // if set, side / meta data is stored in the frame header. + FLAG_HEADER_IDX =1024, // If set, header_idx is coded in the frame header. + FLAG_MATCH_TIME =2048, // If set, match_time_delta is coded in the frame header + FLAG_CODED =4096, // if set, coded_flags are stored in the frame header + FLAG_INVALID =8192, // if set, frame_code is invalid +} Flag; + +typedef struct Syncpoint { + uint64_t pos; + uint64_t back_ptr; +// uint64_t global_key_pts; + int64_t ts; +} Syncpoint; + +typedef struct FrameCode { + uint16_t flags; + uint8_t stream_id; + uint16_t size_mul; + uint16_t size_lsb; + int16_t pts_delta; + uint8_t reserved_count; + uint8_t header_idx; +} FrameCode; + +typedef struct StreamContext { + int last_flags; + int skip_until_key_frame; + int64_t last_pts; + int time_base_id; + AVRational *time_base; + int msb_pts_shift; + int max_pts_distance; + int decode_delay; //FIXME duplicate of has_b_frames + int64_t *keyframe_pts; +} StreamContext; + +typedef struct ChapterContext { + AVRational *time_base; +} ChapterContext; + +typedef struct NUTContext { + const AVClass *av_class; + AVFormatContext *avf; +// int written_packet_size; +// int64_t packet_start; + FrameCode frame_code[256]; + uint8_t header_len[128]; + const uint8_t *header[128]; + uint64_t next_startcode; // stores the next startcode if it has already been parsed but the stream is not seekable + StreamContext *stream; + ChapterContext *chapter; + unsigned int max_distance; + unsigned int time_base_count; + int64_t last_syncpoint_pos; + int64_t last_resync_pos; + int header_count; + AVRational *time_base; + struct AVTreeNode *syncpoints; + int sp_count; + int write_index; + int64_t max_pts; + AVRational *max_pts_tb; +#define NUT_BROADCAST 1 // use extended syncpoints +#define NUT_PIPE 2 // do not write syncpoints + int flags; + int version; // version currently in use + int minor_version; +} NUTContext; + +extern const AVCodecTag ff_nut_subtitle_tags[]; +extern const AVCodecTag ff_nut_video_tags[]; +extern const AVCodecTag ff_nut_audio_tags[]; +extern const AVCodecTag ff_nut_audio_extra_tags[]; +extern const AVCodecTag ff_nut_data_tags[]; + +extern const AVCodecTag * const ff_nut_codec_tags[]; + +typedef struct Dispositions { + char str[9]; + int flag; +} Dispositions; + +void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val); +int64_t ff_lsb2full(StreamContext *stream, int64_t lsb); +int ff_nut_sp_pos_cmp(const void *a, const void *b); +int ff_nut_sp_pts_cmp(const void *a, const void *b); +int ff_nut_add_sp(NUTContext *nut, int64_t pos, int64_t back_ptr, int64_t ts); +void ff_nut_free_sp(NUTContext *nut); + +extern const Dispositions ff_nut_dispositions[]; + +extern const AVMetadataConv ff_nut_metadata_conv[]; + +#endif /* AVFORMAT_NUT_H */ diff --git a/include/libavformat/oggdec.h b/include/libavformat/oggdec.h new file mode 100644 index 0000000..43df23f --- /dev/null +++ b/include/libavformat/oggdec.h @@ -0,0 +1,189 @@ +/** + Copyright (C) 2005 Michael Ahlberg, Måns Rullgård + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, copy, + modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +**/ + +#ifndef AVFORMAT_OGGDEC_H +#define AVFORMAT_OGGDEC_H + +#include "avformat.h" + +struct ogg_codec { + const int8_t *magic; + uint8_t magicsize; + const int8_t *name; + /** + * Attempt to process a packet as a header + * @return 1 if the packet was a valid header, + * 0 if the packet was not a header (was a data packet) + * -1 if an error occurred or for unsupported stream + */ + int (*header)(AVFormatContext *, int); + int (*packet)(AVFormatContext *, int); + /** + * Translate a granule into a timestamp. + * Will set dts if non-null and known. + * @return pts + */ + uint64_t (*gptopts)(AVFormatContext *, int, uint64_t, int64_t *dts); + /** + * 1 if granule is the start time of the associated packet. + * 0 if granule is the end time of the associated packet. + */ + int granule_is_start; + /** + * Number of expected headers + */ + int nb_header; + void (*cleanup)(AVFormatContext *s, int idx); +}; + +struct ogg_stream { + uint8_t *buf; + unsigned int bufsize; + unsigned int bufpos; + unsigned int pstart; + unsigned int psize; + unsigned int pflags; + unsigned int pduration; + uint32_t serial; + uint64_t granule; + uint64_t start_granule; + int64_t lastpts; + int64_t lastdts; + int64_t sync_pos; ///< file offset of the first page needed to reconstruct the current packet + int64_t page_pos; ///< file offset of the current page + int flags; + const struct ogg_codec *codec; + int header; + int nsegs, segp; + uint8_t segments[255]; + int incomplete; ///< whether we're expecting a continuation in the next page + int page_end; ///< current packet is the last one completed in the page + int keyframe_seek; + int got_start; + int got_data; ///< 1 if the stream got some data (non-initial packets), 0 otherwise + int nb_header; ///< set to the number of parsed headers + int start_trimming; ///< set the number of packets to drop from the start + int end_trimming; ///< set the number of packets to drop from the end + uint8_t *new_metadata; + size_t new_metadata_size; + void *private; +}; + +struct ogg_state { + uint64_t pos; + int curidx; + struct ogg_state *next; + int nstreams; + struct ogg_stream streams[1]; +}; + +struct ogg { + struct ogg_stream *streams; + int nstreams; + int headers; + int curidx; + int64_t page_pos; ///< file offset of the current page + struct ogg_state *state; +}; + +#define OGG_FLAG_CONT 1 +#define OGG_FLAG_BOS 2 +#define OGG_FLAG_EOS 4 + +#define OGG_NOGRANULE_VALUE (-1ull) + +extern const struct ogg_codec ff_celt_codec; +extern const struct ogg_codec ff_dirac_codec; +extern const struct ogg_codec ff_flac_codec; +extern const struct ogg_codec ff_ogm_audio_codec; +extern const struct ogg_codec ff_ogm_old_codec; +extern const struct ogg_codec ff_ogm_text_codec; +extern const struct ogg_codec ff_ogm_video_codec; +extern const struct ogg_codec ff_old_dirac_codec; +extern const struct ogg_codec ff_old_flac_codec; +extern const struct ogg_codec ff_opus_codec; +extern const struct ogg_codec ff_skeleton_codec; +extern const struct ogg_codec ff_speex_codec; +extern const struct ogg_codec ff_theora_codec; +extern const struct ogg_codec ff_vorbis_codec; +extern const struct ogg_codec ff_vp8_codec; + +/** + * Parse Vorbis comments + * + * @note The buffer will be temporarily modifed by this function, + * so it needs to be writable. Furthermore it must be padded + * by a single byte (not counted in size). + * All changes will have been reverted upon return. + */ +int ff_vorbis_comment(AVFormatContext *ms, AVDictionary **m, + const uint8_t *buf, int size, int parse_picture); + +/** + * Parse Vorbis comments and add metadata to an AVStream + * + * @note The buffer will be temporarily modifed by this function, + * so it needs to be writable. Furthermore it must be padded + * by a single byte (not counted in size). + * All changes will have been reverted upon return. + */ +int ff_vorbis_stream_comment(AVFormatContext *as, AVStream *st, + const uint8_t *buf, int size); + +static inline int +ogg_find_stream (struct ogg * ogg, int serial) +{ + int i; + + for (i = 0; i < ogg->nstreams; i++) + if (ogg->streams[i].serial == serial) + return i; + + return -1; +} + +static inline uint64_t +ogg_gptopts (AVFormatContext * s, int i, uint64_t gp, int64_t *dts) +{ + struct ogg *ogg = s->priv_data; + struct ogg_stream *os = ogg->streams + i; + uint64_t pts = AV_NOPTS_VALUE; + + if(os->codec && os->codec->gptopts){ + pts = os->codec->gptopts(s, i, gp, dts); + } else { + pts = gp; + if (dts) + *dts = pts; + } + if (pts > INT64_MAX && pts != AV_NOPTS_VALUE) { + // The return type is unsigned, we thus cannot return negative pts + av_log(s, AV_LOG_ERROR, "invalid pts %"PRId64"\n", pts); + pts = AV_NOPTS_VALUE; + } + + return pts; +} + +#endif /* AVFORMAT_OGGDEC_H */ diff --git a/include/libavformat/oma.h b/include/libavformat/oma.h new file mode 100644 index 0000000..1a8e16f --- /dev/null +++ b/include/libavformat/oma.h @@ -0,0 +1,49 @@ +/* + * Sony OpenMG (OMA) common data + * + * 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 AVFORMAT_OMA_H +#define AVFORMAT_OMA_H + +#include + +#include "libavutil/channel_layout.h" + +#include "internal.h" + +#define EA3_HEADER_SIZE 96 +#define ID3v2_EA3_MAGIC "ea3" +#define OMA_ENC_HEADER_SIZE 16 + +enum { + OMA_CODECID_ATRAC3 = 0, + OMA_CODECID_ATRAC3P = 1, + OMA_CODECID_MP3 = 3, + OMA_CODECID_LPCM = 4, + OMA_CODECID_WMA = 5, + OMA_CODECID_ATRAC3PAL = 33, + OMA_CODECID_ATRAC3AL = 34, +}; + +extern const uint16_t ff_oma_srate_tab[8]; + +extern const AVCodecTag ff_oma_codec_tags[]; +extern const AVCodecTag *const ff_oma_codec_tags_list[]; + +#endif /* AVFORMAT_OMA_H */ diff --git a/include/libavformat/options_table.h b/include/libavformat/options_table.h new file mode 100644 index 0000000..311880d --- /dev/null +++ b/include/libavformat/options_table.h @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2000, 2001, 2002 Fabrice Bellard + * + * 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 AVFORMAT_OPTIONS_TABLE_H +#define AVFORMAT_OPTIONS_TABLE_H + +#include + +#include "libavutil/opt.h" +#include "avformat.h" +#include "internal.h" + +#define OFFSET(x) offsetof(AVFormatContext,x) +#define DEFAULT 0 //should be NAN but it does not work as it is not a constant in glibc as required by ANSI/ISO C +//these names are too long to be readable +#define E AV_OPT_FLAG_ENCODING_PARAM +#define D AV_OPT_FLAG_DECODING_PARAM + +static const AVOption avformat_options[] = { +{"avioflags", NULL, OFFSET(avio_flags), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT }, INT_MIN, INT_MAX, D|E, .unit = "avioflags"}, +{"direct", "reduce buffering", 0, AV_OPT_TYPE_CONST, {.i64 = AVIO_FLAG_DIRECT }, INT_MIN, INT_MAX, D|E, .unit = "avioflags"}, +{"probesize", "set probing size", OFFSET(probesize), AV_OPT_TYPE_INT64, {.i64 = 5000000 }, 32, INT64_MAX, D}, +{"formatprobesize", "number of bytes to probe file format", OFFSET(format_probesize), AV_OPT_TYPE_INT, {.i64 = PROBE_BUF_MAX}, 0, INT_MAX-1, D}, +{"packetsize", "set packet size", OFFSET(packet_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, E}, +{"fflags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.i64 = AVFMT_FLAG_AUTO_BSF }, INT_MIN, INT_MAX, D|E, .unit = "fflags"}, +{"flush_packets", "reduce the latency by flushing out packets immediately", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_FLUSH_PACKETS }, INT_MIN, INT_MAX, E, .unit = "fflags"}, +{"ignidx", "ignore index", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_IGNIDX }, INT_MIN, INT_MAX, D, .unit = "fflags"}, +{"genpts", "generate pts", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_GENPTS }, INT_MIN, INT_MAX, D, .unit = "fflags"}, +{"nofillin", "do not fill in missing values that can be exactly calculated", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_NOFILLIN }, INT_MIN, INT_MAX, D, .unit = "fflags"}, +{"noparse", "disable AVParsers, this needs nofillin too", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_NOPARSE }, INT_MIN, INT_MAX, D, .unit = "fflags"}, +{"igndts", "ignore dts", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_IGNDTS }, INT_MIN, INT_MAX, D, .unit = "fflags"}, +{"discardcorrupt", "discard corrupted frames", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_DISCARD_CORRUPT }, INT_MIN, INT_MAX, D, .unit = "fflags"}, +{"sortdts", "try to interleave outputted packets by dts", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_SORT_DTS }, INT_MIN, INT_MAX, D, .unit = "fflags"}, +{"fastseek", "fast but inaccurate seeks", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_FAST_SEEK }, INT_MIN, INT_MAX, D, .unit = "fflags"}, +{"nobuffer", "reduce the latency introduced by optional buffering", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_FLAG_NOBUFFER }, 0, INT_MAX, D, .unit = "fflags"}, +{"bitexact", "do not write random/volatile data", 0, AV_OPT_TYPE_CONST, { .i64 = AVFMT_FLAG_BITEXACT }, 0, 0, E, .unit = "fflags" }, +#if FF_API_LAVF_SHORTEST +{"shortest", "stop muxing with the shortest stream", 0, AV_OPT_TYPE_CONST, { .i64 = AVFMT_FLAG_SHORTEST }, 0, 0, E | AV_OPT_FLAG_DEPRECATED, .unit = "fflags" }, +#endif +{"autobsf", "add needed bsfs automatically", 0, AV_OPT_TYPE_CONST, { .i64 = AVFMT_FLAG_AUTO_BSF }, 0, 0, E, .unit = "fflags" }, +{"seek2any", "allow seeking to non-keyframes on demuxer level when supported", OFFSET(seek2any), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, D}, +{"analyzeduration", "specify how many microseconds are analyzed to probe the input", OFFSET(max_analyze_duration), AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, INT64_MAX, D}, +{"cryptokey", "decryption key", OFFSET(key), AV_OPT_TYPE_BINARY, {.dbl = 0}, 0, 0, D}, +{"indexmem", "max memory used for timestamp index (per stream)", OFFSET(max_index_size), AV_OPT_TYPE_INT, {.i64 = 1<<20 }, 0, INT_MAX, D}, +{"rtbufsize", "max memory used for buffering real-time frames", OFFSET(max_picture_buffer), AV_OPT_TYPE_INT, {.i64 = 3041280 }, 0, INT_MAX, D}, /* defaults to 1s of 15fps 352x288 YUYV422 video */ +{"fdebug", "print specific debug info", OFFSET(debug), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT }, 0, INT_MAX, E|D, .unit = "fdebug"}, +{"ts", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_FDEBUG_TS }, INT_MIN, INT_MAX, E|D, .unit = "fdebug"}, +{"max_delay", "maximum muxing or demuxing delay in microseconds", OFFSET(max_delay), AV_OPT_TYPE_INT, {.i64 = -1 }, -1, INT_MAX, E|D}, +{"start_time_realtime", "wall-clock time when stream begins (PTS==0)", OFFSET(start_time_realtime), AV_OPT_TYPE_INT64, {.i64 = AV_NOPTS_VALUE}, INT64_MIN, INT64_MAX, E}, +{"fpsprobesize", "number of frames used to probe fps", OFFSET(fps_probe_size), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX-1, D}, +{"audio_preload", "microseconds by which audio packets should be interleaved earlier", OFFSET(audio_preload), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX-1, E}, +{"chunk_duration", "microseconds for each chunk", OFFSET(max_chunk_duration), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX-1, E}, +{"chunk_size", "size in bytes for each chunk", OFFSET(max_chunk_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX-1, E}, +/* this is a crutch for avconv, since it cannot deal with identically named options in different contexts. + * to be removed when avconv is fixed */ +{"f_err_detect", "set error detection flags (deprecated; use err_detect, save via avconv)", OFFSET(error_recognition), AV_OPT_TYPE_FLAGS, {.i64 = AV_EF_CRCCHECK }, INT_MIN, INT_MAX, D, .unit = "err_detect"}, +{"err_detect", "set error detection flags", OFFSET(error_recognition), AV_OPT_TYPE_FLAGS, {.i64 = AV_EF_CRCCHECK }, INT_MIN, INT_MAX, D, .unit = "err_detect"}, +{"crccheck", "verify embedded CRCs", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_CRCCHECK }, INT_MIN, INT_MAX, D, .unit = "err_detect"}, +{"bitstream", "detect bitstream specification deviations", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_BITSTREAM }, INT_MIN, INT_MAX, D, .unit = "err_detect"}, +{"buffer", "detect improper bitstream length", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_BUFFER }, INT_MIN, INT_MAX, D, .unit = "err_detect"}, +{"explode", "abort decoding on minor error detection", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_EXPLODE }, INT_MIN, INT_MAX, D, .unit = "err_detect"}, +{"ignore_err", "ignore errors", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_IGNORE_ERR }, INT_MIN, INT_MAX, D, .unit = "err_detect"}, +{"careful", "consider things that violate the spec, are fast to check and have not been seen in the wild as errors", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_CAREFUL }, INT_MIN, INT_MAX, D, .unit = "err_detect"}, +{"compliant", "consider all spec non compliancies as errors", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_COMPLIANT | AV_EF_CAREFUL }, INT_MIN, INT_MAX, D, .unit = "err_detect"}, +{"aggressive", "consider things that a sane encoder shouldn't do as an error", 0, AV_OPT_TYPE_CONST, {.i64 = AV_EF_AGGRESSIVE | AV_EF_COMPLIANT | AV_EF_CAREFUL}, INT_MIN, INT_MAX, D, .unit = "err_detect"}, +{"use_wallclock_as_timestamps", "use wallclock as timestamps", OFFSET(use_wallclock_as_timestamps), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, D}, +{"skip_initial_bytes", "set number of bytes to skip before reading header and frames", OFFSET(skip_initial_bytes), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX-1, D}, +{"correct_ts_overflow", "correct single timestamp overflows", OFFSET(correct_ts_overflow), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, D}, +{"flush_packets", "enable flushing of the I/O context after each packet", OFFSET(flush_packets), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 1, E}, +{"metadata_header_padding", "set number of bytes to be written as padding in a metadata header", OFFSET(metadata_header_padding), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, E}, +{"output_ts_offset", "set output timestamp offset", OFFSET(output_ts_offset), AV_OPT_TYPE_DURATION, {.i64 = 0}, -INT64_MAX, INT64_MAX, E}, +{"max_interleave_delta", "maximum buffering duration for interleaving", OFFSET(max_interleave_delta), AV_OPT_TYPE_INT64, { .i64 = 10000000 }, 0, INT64_MAX, E }, +{"f_strict", "how strictly to follow the standards (deprecated; use strict, save via avconv)", OFFSET(strict_std_compliance), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, D|E, .unit = "strict"}, +{"strict", "how strictly to follow the standards", OFFSET(strict_std_compliance), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, D|E, .unit = "strict"}, +{"very", "strictly conform to a older more strict version of the spec or reference software", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_VERY_STRICT }, INT_MIN, INT_MAX, D|E, .unit = "strict"}, +{"strict", "strictly conform to all the things in the spec no matter what the consequences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_STRICT }, INT_MIN, INT_MAX, D|E, .unit = "strict"}, +{"normal", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_NORMAL }, INT_MIN, INT_MAX, D|E, .unit = "strict"}, +{"unofficial", "allow unofficial extensions", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_UNOFFICIAL }, INT_MIN, INT_MAX, D|E, .unit = "strict"}, +{"experimental", "allow non-standardized experimental variants", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_EXPERIMENTAL }, INT_MIN, INT_MAX, D|E, .unit = "strict"}, +{"max_ts_probe", "maximum number of packets to read while waiting for the first timestamp", OFFSET(max_ts_probe), AV_OPT_TYPE_INT, { .i64 = 50 }, 0, INT_MAX, D }, +{"avoid_negative_ts", "shift timestamps so they start at 0", OFFSET(avoid_negative_ts), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 2, E, .unit = "avoid_negative_ts"}, +{"auto", "enabled when required by target format", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_AVOID_NEG_TS_AUTO }, INT_MIN, INT_MAX, E, .unit = "avoid_negative_ts"}, +{"disabled", "do not change timestamps", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_AVOID_NEG_TS_DISABLED }, INT_MIN, INT_MAX, E, .unit = "avoid_negative_ts"}, +{"make_non_negative", "shift timestamps so they are non negative", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_AVOID_NEG_TS_MAKE_NON_NEGATIVE }, INT_MIN, INT_MAX, E, .unit = "avoid_negative_ts"}, +{"make_zero", "shift timestamps so they start at 0", 0, AV_OPT_TYPE_CONST, {.i64 = AVFMT_AVOID_NEG_TS_MAKE_ZERO }, INT_MIN, INT_MAX, E, .unit = "avoid_negative_ts"}, +{"dump_separator", "set information dump field separator", OFFSET(dump_separator), AV_OPT_TYPE_STRING, {.str = ", "}, 0, 0, D|E}, +{"codec_whitelist", "List of decoders that are allowed to be used", OFFSET(codec_whitelist), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, D }, +{"format_whitelist", "List of demuxers that are allowed to be used", OFFSET(format_whitelist), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, D }, +{"protocol_whitelist", "List of protocols that are allowed to be used", OFFSET(protocol_whitelist), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, D }, +{"protocol_blacklist", "List of protocols that are not allowed to be used", OFFSET(protocol_blacklist), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, D }, +{"max_streams", "maximum number of streams", OFFSET(max_streams), AV_OPT_TYPE_INT, { .i64 = 1000 }, 0, INT_MAX, D }, +{"skip_estimate_duration_from_pts", "skip duration calculation in estimate_timings_from_pts", OFFSET(skip_estimate_duration_from_pts), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, D}, +{"max_probe_packets", "Maximum number of packets to probe a codec", OFFSET(max_probe_packets), AV_OPT_TYPE_INT, { .i64 = 2500 }, 0, INT_MAX, D }, +{"duration_probesize", "Maximum number of bytes to probe the durations of the streams in estimate_timings_from_pts", OFFSET(duration_probesize), AV_OPT_TYPE_INT64, {.i64 = 0 }, 0, INT64_MAX, D}, +{NULL}, +}; + +#undef E +#undef D +#undef DEFAULT +#undef OFFSET + +#endif /* AVFORMAT_OPTIONS_TABLE_H */ diff --git a/include/libavformat/os_support.h b/include/libavformat/os_support.h new file mode 100644 index 0000000..8479163 --- /dev/null +++ b/include/libavformat/os_support.h @@ -0,0 +1,318 @@ +/* + * various OS-feature replacement utilities + * copyright (c) 2000, 2001, 2002 Fabrice Bellard + * + * 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 AVFORMAT_OS_SUPPORT_H +#define AVFORMAT_OS_SUPPORT_H + +/** + * @file + * miscellaneous OS support macros and functions. + */ + +#include "config.h" + +#include + +#ifdef _WIN32 +#if HAVE_DIRECT_H +#include +#endif +#if HAVE_IO_H +#include +#endif +#endif + +#ifdef _WIN32 +# include +# include +# ifdef lseek +# undef lseek +# endif +# define lseek(f,p,w) _lseeki64((f), (p), (w)) +# ifdef stat +# undef stat +# endif + +# define stat win32_stat + + /* + * The POSIX definition for the stat() function uses a struct of the + * same name (struct stat), that why it takes this extra effort for + * redirecting/replacing the stat() function with our own one which + * is capable to handle long path names on Windows. + * The struct below roughly follows the POSIX definition. Time values + * are 64bit, but in cases when _USE_32BIT_TIME_T is defined, they + * will be set to values no larger than INT32_MAX which corresponds + * to file times up to the year 2038. + */ + struct win32_stat + { + _dev_t st_dev; /* ID of device containing file */ + _ino_t st_ino; /* inode number */ + unsigned short st_mode; /* protection */ + short st_nlink; /* number of hard links */ + short st_uid; /* user ID of owner */ + short st_gid; /* group ID of owner */ + _dev_t st_rdev; /* device ID (if special file) */ + int64_t st_size; /* total size, in bytes */ + int64_t st_atime; /* time of last access */ + int64_t st_mtime; /* time of last modification */ + int64_t st_ctime; /* time of last status change */ + }; + +# ifdef fstat +# undef fstat +# endif +# define fstat win32_fstat +#endif /* defined(_WIN32) */ + + +#ifdef __ANDROID__ +# if HAVE_UNISTD_H +# include +# endif +# ifdef lseek +# undef lseek +# endif +# define lseek(f,p,w) lseek64((f), (p), (w)) +#endif + +static inline int is_dos_path(const char *path) +{ +#if HAVE_DOS_PATHS + if (path[0] && path[1] == ':') + return 1; +#endif + return 0; +} + +#if defined(_WIN32) +#ifndef S_IRUSR +#define S_IRUSR S_IREAD +#endif +#ifndef S_IWUSR +#define S_IWUSR S_IWRITE +#endif +#endif + +#if CONFIG_NETWORK +#if defined(_WIN32) +#define SHUT_RD SD_RECEIVE +#define SHUT_WR SD_SEND +#define SHUT_RDWR SD_BOTH +#else +#include +#if !defined(SHUT_RD) /* OS/2, DJGPP */ +#define SHUT_RD 0 +#define SHUT_WR 1 +#define SHUT_RDWR 2 +#endif +#endif + +#if !HAVE_SOCKLEN_T +typedef int socklen_t; +#endif + +/* most of the time closing a socket is just closing an fd */ +#if !HAVE_CLOSESOCKET +#define closesocket close +#endif + +#if !HAVE_POLL_H +typedef unsigned long nfds_t; + +#if HAVE_WINSOCK2_H +#include +#endif +#if !HAVE_STRUCT_POLLFD +struct pollfd { + int fd; + short events; /* events to look for */ + short revents; /* events that occurred */ +}; + +/* events & revents */ +#define POLLIN 0x0001 /* any readable data available */ +#define POLLOUT 0x0002 /* file descriptor is writeable */ +#define POLLRDNORM POLLIN +#define POLLWRNORM POLLOUT +#define POLLRDBAND 0x0008 /* priority readable data */ +#define POLLWRBAND 0x0010 /* priority data can be written */ +#define POLLPRI 0x0020 /* high priority readable data */ + +/* revents only */ +#define POLLERR 0x0004 /* errors pending */ +#define POLLHUP 0x0080 /* disconnected */ +#define POLLNVAL 0x1000 /* invalid file descriptor */ +#endif + + +int ff_poll(struct pollfd *fds, nfds_t numfds, int timeout); +#define poll ff_poll +#endif /* HAVE_POLL_H */ +#endif /* CONFIG_NETWORK */ + +#ifdef _WIN32 +#include +#include +#include "libavutil/mem.h" +#include "libavutil/wchar_filename.h" + +#define DEF_FS_FUNCTION(name, wfunc, afunc) \ +static inline int win32_##name(const char *filename_utf8) \ +{ \ + wchar_t *filename_w; \ + int ret; \ + \ + if (get_extended_win32_path(filename_utf8, &filename_w)) \ + return -1; \ + if (!filename_w) \ + goto fallback; \ + \ + ret = wfunc(filename_w); \ + av_free(filename_w); \ + return ret; \ + \ +fallback: \ + /* filename may be be in CP_ACP */ \ + return afunc(filename_utf8); \ +} + +DEF_FS_FUNCTION(unlink, _wunlink, _unlink) +DEF_FS_FUNCTION(mkdir, _wmkdir, _mkdir) +DEF_FS_FUNCTION(rmdir, _wrmdir , _rmdir) + +static inline int win32_access(const char *filename_utf8, int mode) +{ + wchar_t *filename_w; + int ret; + if (get_extended_win32_path(filename_utf8, &filename_w)) + return -1; + if (!filename_w) + goto fallback; + ret = _waccess(filename_w, mode); + av_free(filename_w); + return ret; +fallback: + return _access(filename_utf8, mode); +} + +static inline void copy_stat(struct _stat64 *crtstat, struct win32_stat *buf) +{ + buf->st_dev = crtstat->st_dev; + buf->st_ino = crtstat->st_ino; + buf->st_mode = crtstat->st_mode; + buf->st_nlink = crtstat->st_nlink; + buf->st_uid = crtstat->st_uid; + buf->st_gid = crtstat->st_gid; + buf->st_rdev = crtstat->st_rdev; + buf->st_size = crtstat->st_size; + buf->st_atime = crtstat->st_atime; + buf->st_mtime = crtstat->st_mtime; + buf->st_ctime = crtstat->st_ctime; +} + +static inline int win32_stat(const char *filename_utf8, struct win32_stat *buf) +{ + struct _stat64 crtstat = { 0 }; + wchar_t *filename_w; + int ret; + + if (get_extended_win32_path(filename_utf8, &filename_w)) + return -1; + + if (filename_w) { + ret = _wstat64(filename_w, &crtstat); + av_free(filename_w); + } else + ret = _stat64(filename_utf8, &crtstat); + + copy_stat(&crtstat, buf); + + return ret; +} + +static inline int win32_fstat(int fd, struct win32_stat *buf) +{ + struct _stat64 crtstat = { 0 }; + int ret; + + ret = _fstat64(fd, &crtstat); + + copy_stat(&crtstat, buf); + + return ret; +} + +static inline int win32_rename(const char *src_utf8, const char *dest_utf8) +{ + wchar_t *src_w, *dest_w; + int ret; + + if (get_extended_win32_path(src_utf8, &src_w)) + return -1; + if (get_extended_win32_path(dest_utf8, &dest_w)) { + av_free(src_w); + return -1; + } + if (!src_w || !dest_w) { + av_free(src_w); + av_free(dest_w); + goto fallback; + } + + ret = MoveFileExW(src_w, dest_w, MOVEFILE_REPLACE_EXISTING); + av_free(src_w); + av_free(dest_w); + // Lacking proper mapping from GetLastError() error codes to errno codes + if (ret) + errno = EPERM; + return ret; + +fallback: + /* filename may be be in CP_ACP */ +#if !HAVE_UWP + ret = MoveFileExA(src_utf8, dest_utf8, MOVEFILE_REPLACE_EXISTING); + if (ret) + errno = EPERM; +#else + /* Windows Phone doesn't have MoveFileExA, and for Windows Store apps, + * it is available but not allowed by the app certification kit. However, + * it's unlikely that anybody would input filenames in CP_ACP there, so this + * fallback is kept mostly for completeness. Alternatively we could + * do MultiByteToWideChar(CP_ACP) and use MoveFileExW, but doing + * explicit conversions with CP_ACP is allegedly forbidden in windows + * store apps (or windows phone), and the notion of a native code page + * doesn't make much sense there. */ + ret = rename(src_utf8, dest_utf8); +#endif + return ret; +} + +#define mkdir(a, b) win32_mkdir(a) +#define rename win32_rename +#define rmdir win32_rmdir +#define unlink win32_unlink +#define access win32_access + +#endif + +#endif /* AVFORMAT_OS_SUPPORT_H */ diff --git a/include/libavformat/pcm.h b/include/libavformat/pcm.h new file mode 100644 index 0000000..1928497 --- /dev/null +++ b/include/libavformat/pcm.h @@ -0,0 +1,32 @@ +/* + * PCM common functions + * Copyright (C) 2007 Aurelien Jacobs + * + * 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 AVFORMAT_PCM_H +#define AVFORMAT_PCM_H + +#include "avformat.h" + +int ff_pcm_default_packet_size(AVCodecParameters *par); +int ff_pcm_read_packet(AVFormatContext *s, AVPacket *pkt); +int ff_pcm_read_seek(AVFormatContext *s, + int stream_index, int64_t timestamp, int flags); + +#endif /* AVFORMAT_PCM_H */ diff --git a/include/libavformat/qtpalette.h b/include/libavformat/qtpalette.h new file mode 100644 index 0000000..18a108e --- /dev/null +++ b/include/libavformat/qtpalette.h @@ -0,0 +1,40 @@ +/* + * Default Palettes for Quicktime Files + * Automatically generated from a utility derived from XAnim: + * http://xanim.va.pubnix.com/home.html + * + * 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 AVFORMAT_QTPALETTE_H +#define AVFORMAT_QTPALETTE_H + +#include +#include "avio.h" + +/** + * Retrieve the palette (or "color table" in QuickTime terms), either + * from the video sample description, or from the default Macintosh + * palette. + * + * The file offset of the AVIOContext pointed to by the 'pb' variable + * should be the start of the video sample description (the sample + * description size and the data format). + */ +int ff_get_qtpalette(int codec_id, AVIOContext *pb, uint32_t *palette); + +#endif /* AVFORMAT_QTPALETTE_H */ diff --git a/include/libavformat/rawdec.h b/include/libavformat/rawdec.h new file mode 100644 index 0000000..2773b1a --- /dev/null +++ b/include/libavformat/rawdec.h @@ -0,0 +1,84 @@ +/* + * RAW demuxers + * Copyright (C) 2007 Aurelien Jacobs + * + * 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 AVFORMAT_RAWDEC_H +#define AVFORMAT_RAWDEC_H + +#include "avformat.h" +#include "demux.h" +#include "libavutil/log.h" + +typedef struct FFRawVideoDemuxerContext { + const AVClass *class; /**< Class for private options. */ + int raw_packet_size; + char *video_size; /**< String describing video size, set by a private option. */ + char *pixel_format; /**< Set by a private option. */ + AVRational framerate; /**< AVRational describing framerate, set by a private option. */ +} FFRawVideoDemuxerContext; + +typedef struct FFRawDemuxerContext { + const AVClass *class; /**< Class for private options. */ + int raw_packet_size; +} FFRawDemuxerContext; + +extern const AVClass ff_rawvideo_demuxer_class; +extern const AVClass ff_raw_demuxer_class; + +int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt); + +int ff_raw_audio_read_header(AVFormatContext *s); + +int ff_raw_video_read_header(AVFormatContext *s); + +int ff_raw_subtitle_read_header(AVFormatContext *s); + +#define FF_DEF_RAWVIDEO_DEMUXER2(shortname, longname, probe, ext, id, flag)\ +const FFInputFormat ff_ ## shortname ## _demuxer = {\ + .p.name = #shortname,\ + .p.long_name = NULL_IF_CONFIG_SMALL(longname),\ + .p.extensions = ext,\ + .p.flags = flag | AVFMT_NOTIMESTAMPS,\ + .p.priv_class = &ff_rawvideo_demuxer_class,\ + .read_probe = probe,\ + .read_header = ff_raw_video_read_header,\ + .read_packet = ff_raw_read_partial_packet,\ + .raw_codec_id = id,\ + .priv_data_size = sizeof(FFRawVideoDemuxerContext),\ +}; + +#define FF_DEF_RAWVIDEO_DEMUXER(shortname, longname, probe, ext, id)\ +FF_DEF_RAWVIDEO_DEMUXER2(shortname, longname, probe, ext, id, AVFMT_GENERIC_INDEX) + +#define FF_DEF_RAWSUB_DEMUXER(shortname, longname, probe, ext, id, flag)\ +const FFInputFormat ff_ ## shortname ## _demuxer = {\ + .p.name = #shortname,\ + .p.long_name = NULL_IF_CONFIG_SMALL(longname),\ + .p.extensions = ext,\ + .p.flags = flag,\ + .p.priv_class = &ff_raw_demuxer_class,\ + .read_probe = probe,\ + .read_header = ff_raw_subtitle_read_header,\ + .read_packet = ff_raw_read_partial_packet,\ + .raw_codec_id = id,\ + .priv_data_size = sizeof(FFRawDemuxerContext),\ +}; + +#endif /* AVFORMAT_RAWDEC_H */ diff --git a/include/libavformat/rawenc.h b/include/libavformat/rawenc.h new file mode 100644 index 0000000..b552309 --- /dev/null +++ b/include/libavformat/rawenc.h @@ -0,0 +1,29 @@ +/* + * RAW muxers + * Copyright (C) 2007 Aurelien Jacobs + * + * 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 AVFORMAT_RAWENC_H +#define AVFORMAT_RAWENC_H + +#include "avformat.h" + +int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt); + +#endif /* AVFORMAT_RAWENC_H */ diff --git a/include/libavformat/rawutils.h b/include/libavformat/rawutils.h new file mode 100644 index 0000000..a911234 --- /dev/null +++ b/include/libavformat/rawutils.h @@ -0,0 +1,56 @@ +/* + * copyright (c) 2001 Fabrice Bellard + * + * 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 AVFORMAT_RAWUTILS_H +#define AVFORMAT_RAWUTILS_H + +#include +#include "libavcodec/codec_par.h" +#include "libavcodec/packet.h" +#include "avformat.h" + +#define CONTAINS_PAL 2 +/** + * Reshuffles the lines to use the user specified stride. + * + * @param ppkt input and output packet + * @return negative error code or + * 0 if no new packet was allocated + * non-zero if a new packet was allocated and ppkt has to be freed + * CONTAINS_PAL if in addition to a new packet the old contained a palette + */ +int ff_reshuffle_raw_rgb(AVFormatContext *s, AVPacket **ppkt, AVCodecParameters *par, int expected_stride); + +/** + * Retrieves the palette from a packet, either from side data, or + * appended to the video data in the packet itself (raw video only). + * It is commonly used after a call to ff_reshuffle_raw_rgb(). + * + * Use 0 for the ret parameter to check for side data only. + * + * @param pkt pointer to packet before calling ff_reshuffle_raw_rgb() + * @param ret return value from ff_reshuffle_raw_rgb(), or 0 + * @param palette pointer to palette buffer + * @return negative error code or + * 1 if the packet has a palette, else 0 + */ +int ff_get_packet_palette(AVFormatContext *s, AVPacket *pkt, int ret, uint32_t *palette); + +#endif /* AVFORMAT_RAWUTILS_H */ diff --git a/include/libavformat/rdt.h b/include/libavformat/rdt.h new file mode 100644 index 0000000..67fb308 --- /dev/null +++ b/include/libavformat/rdt.h @@ -0,0 +1,107 @@ +/* + * Realmedia RTSP (RDT) definitions + * Copyright (c) 2007 Ronald S. Bultje + * + * 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 AVFORMAT_RDT_H +#define AVFORMAT_RDT_H + +#include +#include "avformat.h" +#include "rtpdec.h" + +typedef struct RDTDemuxContext RDTDemuxContext; + +/** + * Allocate and init the RDT parsing context. + * @param ic the containing RTSP demuxer context + * @param first_stream_of_set_idx index to the first AVStream in the RTSP + * demuxer context's ic->streams array that is part of this + * particular stream's set of streams (with identical content) + * @param priv_data private data of the payload data handler context + * @param handler pointer to the parse_packet() payload parsing function + * @return a newly allocated RDTDemuxContext. Free with ff_rdt_parse_close(). + */ +RDTDemuxContext *ff_rdt_parse_open(AVFormatContext *ic, + int first_stream_of_set_idx, + void *priv_data, + const RTPDynamicProtocolHandler *handler); +void ff_rdt_parse_close(RDTDemuxContext *s); + +/** + * Calculate the response (RealChallenge2 in the RTSP header) to the + * challenge (RealChallenge1 in the RTSP header from the Real/Helix + * server), which is used as some sort of client validation. + * + * @param response pointer to response buffer, it should be at least 41 bytes + * (40 data + 1 zero) bytes long. + * @param chksum pointer to buffer containing a checksum of the response, + * it should be at least 9 (8 data + 1 zero) bytes long. + * @param challenge pointer to the RealChallenge1 value provided by the + * server. + */ +void ff_rdt_calc_response_and_checksum(char response[41], char chksum[9], + const char *challenge); + +/** + * Add subscription information to Subscribe parameter string. + * + * @param cmd string to write the subscription information into. + * @param size size of cmd. + * @param stream_nr stream number. + * @param rule_nr rule number to conform to. + */ +void ff_rdt_subscribe_rule(char *cmd, int size, + int stream_nr, int rule_nr); + +/** + * Parse RDT-style packet header. + * + * @param buf input buffer + * @param len length of input buffer + * @param pset_id will be set to the set ID this packet belongs to + * @param pseq_no will be set to the sequence number of the packet + * @param pstream_id will be set to the stream ID this packet belongs to + * @param pis_keyframe will be whether this packet belongs to a keyframe + * @param ptimestamp will be set to the timestamp of the packet + * @return the amount of bytes consumed, or negative on error + */ +int ff_rdt_parse_header(const uint8_t *buf, int len, + int *pset_id, int *pseq_no, int *pstream_id, + int *pis_keyframe, uint32_t *ptimestamp); + +/** + * Parse RDT-style packet data (header + media data). + * Usage similar to rtp_parse_packet(). + */ +int ff_rdt_parse_packet(RDTDemuxContext *s, AVPacket *pkt, + uint8_t **buf, int len); + +/** + * Parse a server-related SDP line. + * + * @param s the RTSP AVFormatContext + * @param stream_index the index of the first stream in the set represented + * by the SDP m= line (in s->streams) + * @param buf the SDP line + */ +void ff_real_parse_sdp_a_line(AVFormatContext *s, int stream_index, + const char *buf); + +#endif /* AVFORMAT_RDT_H */ diff --git a/include/libavformat/replaygain.h b/include/libavformat/replaygain.h new file mode 100644 index 0000000..ceacb21 --- /dev/null +++ b/include/libavformat/replaygain.h @@ -0,0 +1,38 @@ +/* + * 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 AVFORMAT_REPLAYGAIN_H +#define AVFORMAT_REPLAYGAIN_H + +#include "libavutil/dict.h" + +#include "avformat.h" + +/** + * Parse replaygain tags and export them as per-stream side data. + */ +int ff_replaygain_export(AVStream *st, AVDictionary *metadata); + + +/** + * Export already decoded replaygain values as per-stream side data. + */ +int ff_replaygain_export_raw(AVStream *st, int32_t tg, uint32_t tp, + int32_t ag, uint32_t ap); + +#endif /* AVFORMAT_REPLAYGAIN_H */ diff --git a/include/libavformat/riff.h b/include/libavformat/riff.h new file mode 100644 index 0000000..a93eadf --- /dev/null +++ b/include/libavformat/riff.h @@ -0,0 +1,133 @@ +/* + * RIFF common functions and data + * copyright (c) 2000 Fabrice Bellard + * + * 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 + */ + +/** + * @file + * internal header for RIFF based (de)muxers + * do NOT include this in end user applications + */ + +#ifndef AVFORMAT_RIFF_H +#define AVFORMAT_RIFF_H + +#include "avio.h" +#include "internal.h" +#include "metadata.h" + +extern const AVMetadataConv ff_riff_info_conv[]; + +int64_t ff_start_tag(AVIOContext *pb, const char *tag); +void ff_end_tag(AVIOContext *pb, int64_t start); + +/** + * Read BITMAPINFOHEADER structure and set AVStream codec width, height and + * bits_per_encoded_sample fields. Does not read extradata. + * Writes the size of the BMP file to *size. + * @return codec tag + */ +int ff_get_bmp_header(AVIOContext *pb, AVStream *st, uint32_t *size); + +void ff_put_bmp_header(AVIOContext *pb, AVCodecParameters *par, int for_asf, int ignore_extradata, int rgb_frame_is_flipped); + +/** + * Tell ff_put_wav_header() to use WAVEFORMATEX even for PCM codecs. + */ +#define FF_PUT_WAV_HEADER_FORCE_WAVEFORMATEX 0x00000001 + +/** + * Tell ff_put_wav_header() to write an empty channel mask. + */ +#define FF_PUT_WAV_HEADER_SKIP_CHANNELMASK 0x00000002 + +/** + * Write WAVEFORMAT header structure. + * + * @param flags a combination of FF_PUT_WAV_HEADER_* constants + * + * @return the size or -1 on error + */ +int ff_put_wav_header(AVFormatContext *s, AVIOContext *pb, AVCodecParameters *par, int flags); + +enum AVCodecID ff_wav_codec_get_id(unsigned int tag, int bps); +int ff_get_wav_header(void *logctx, AVIOContext *pb, AVCodecParameters *par, + int size, int big_endian); + +extern const AVCodecTag ff_codec_bmp_tags[]; // exposed through avformat_get_riff_video_tags() +extern const AVCodecTag ff_codec_wav_tags[]; +/* The following list contains both ff_codec_bmp_tags and ff_codec_wav_tags. */ +extern const AVCodecTag *const ff_riff_codec_tags_list[]; +/* The following list contains only ff_codec_wav_tags. */ +extern const AVCodecTag *const ff_wav_codec_tags_list[]; + +extern const AVCodecTag ff_codec_bmp_tags_unofficial[]; + +void ff_parse_specific_params(AVStream *st, int *au_rate, int *au_ssize, int *au_scale); + +int ff_read_riff_info(AVFormatContext *s, int64_t size); + +/** + * Write all recognized RIFF tags from s->metadata + */ +void ff_riff_write_info(AVFormatContext *s); + +/** + * Write a single RIFF info tag + */ +void ff_riff_write_info_tag(AVIOContext *pb, const char *tag, const char *str); + +typedef uint8_t ff_asf_guid[16]; + +typedef struct AVCodecGuid { + enum AVCodecID id; + ff_asf_guid guid; +} AVCodecGuid; + +extern const AVCodecGuid ff_codec_wav_guids[]; + +#define FF_PRI_GUID \ + "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x " \ + "{%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x}" + +#define FF_ARG_GUID(g) \ + g[0], g[1], g[2], g[3], g[4], g[5], g[6], g[7], \ + g[8], g[9], g[10], g[11], g[12], g[13], g[14], g[15],\ + g[3], g[2], g[1], g[0], g[5], g[4], g[7], g[6], \ + g[8], g[9], g[10], g[11], g[12], g[13], g[14], g[15] + +#define FF_MEDIASUBTYPE_BASE_GUID \ + 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 +#define FF_AMBISONIC_BASE_GUID \ + 0x21, 0x07, 0xD3, 0x11, 0x86, 0x44, 0xC8, 0xC1, 0xCA, 0x00, 0x00, 0x00 +#define FF_BROKEN_BASE_GUID \ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA + +static av_always_inline int ff_guidcmp(const void *g1, const void *g2) +{ + return memcmp(g1, g2, sizeof(ff_asf_guid)); +} + +int ff_get_guid(AVIOContext *s, ff_asf_guid *g); +void ff_put_guid(AVIOContext *s, const ff_asf_guid *g); +const ff_asf_guid *ff_get_codec_guid(enum AVCodecID id, const AVCodecGuid *av_guid); + +enum AVCodecID ff_codec_guid_get_id(const AVCodecGuid *guids, ff_asf_guid guid); + +#endif /* AVFORMAT_RIFF_H */ diff --git a/include/libavformat/rm.h b/include/libavformat/rm.h new file mode 100644 index 0000000..91007f5 --- /dev/null +++ b/include/libavformat/rm.h @@ -0,0 +1,95 @@ +/* + * "Real" compatible muxer and demuxer. + * Copyright (c) 2000, 2001 Fabrice Bellard + * + * 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 AVFORMAT_RM_H +#define AVFORMAT_RM_H + +#include "avformat.h" +#include "internal.h" + +extern const char * const ff_rm_metadata[4]; +extern const AVCodecTag ff_rm_codec_tags[]; + +typedef struct RMStream RMStream; + +RMStream *ff_rm_alloc_rmstream (void); +void ff_rm_free_rmstream (RMStream *rms); + +/*< input format for Realmedia-style RTSP streams */ +extern const struct FFInputFormat ff_rdt_demuxer; + +/** + * Read the MDPR chunk, which contains stream-specific codec initialization + * parameters. + * + * @param s context containing RMContext and AVIOContext for stream reading + * @param pb context to read the data from + * @param st the stream that the MDPR chunk belongs to and where to store the + * parameters read from the chunk into + * @param rst real-specific stream information + * @param codec_data_size size of the MDPR chunk + * @return 0 on success, errno codes on error + */ +int ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb, + AVStream *st, RMStream *rst, + unsigned int codec_data_size, const uint8_t *mime); + +/** + * Parse one rm-stream packet from the input bytestream. + * + * @param s context containing RMContext and AVIOContext for stream reading + * @param pb context to read the data from + * @param st stream to which the packet to be read belongs + * @param rst Real-specific stream information + * @param len packet length to read from the input + * @param pkt packet location to store the parsed packet data + * @param seq pointer to an integer containing the sequence number, may be + * updated + * @param flags the packet flags + * @param ts timestamp of the current packet + * @return <0 on error, 0 if a packet was placed in the pkt pointer. A + * value >0 means that no data was placed in pkt, but that cached + * data is available by calling ff_rm_retrieve_cache(). + */ +int ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb, + AVStream *st, RMStream *rst, int len, + AVPacket *pkt, int *seq, int flags, int64_t ts); + +/** + * Retrieve one cached packet from the rm-context. The real container can + * store several packets (as interpreted by the codec) in a single container + * packet, which means the demuxer holds some back when the first container + * packet is parsed and returned. The result is that rm->audio_pkt_cnt is + * a positive number, the amount of cached packets. Using this function, each + * of those packets can be retrieved sequentially. + * + * @param s context containing RMContext and AVIOContext for stream reading + * @param pb context to read the data from + * @param st stream that this packet belongs to + * @param rst Real-specific stream information + * @param pkt location to store the packet data + * @return the number of samples left for subsequent calls to this same + * function, or 0 if all samples have been retrieved. + */ +int ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb, + AVStream *st, RMStream *rst, AVPacket *pkt); + +#endif /* AVFORMAT_RM_H */ diff --git a/include/libavformat/rmsipr.h b/include/libavformat/rmsipr.h new file mode 100644 index 0000000..2837336 --- /dev/null +++ b/include/libavformat/rmsipr.h @@ -0,0 +1,35 @@ +/* + * tables and functions for demuxing SIPR audio muxed RealMedia style + * + * 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 AVFORMAT_RMSIPR_H +#define AVFORMAT_RMSIPR_H + +#include + +extern const unsigned char ff_sipr_subpk_size[4]; + +/** + * Perform 4-bit block reordering for SIPR data. + * + * @param buf SIPR data + */ +void ff_rm_reorder_sipr_data(uint8_t *buf, int sub_packet_h, int framesize); + +#endif /* AVFORMAT_RMSIPR_H */ diff --git a/include/libavformat/rso.h b/include/libavformat/rso.h new file mode 100644 index 0000000..4f78b40 --- /dev/null +++ b/include/libavformat/rso.h @@ -0,0 +1,33 @@ +/* + * RSO format common data + * Copyright (c) 2010 Rafael Carre + * + * 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 AVFORMAT_RSO_H +#define AVFORMAT_RSO_H + +#include "internal.h" + +#define RSO_HEADER_SIZE 8 + +/* The libavcodec codecs we support, and the IDs they have in the file */ +extern const AVCodecTag ff_codec_rso_tags[]; +extern const AVCodecTag *const ff_rso_codec_tags_list[]; + +#endif /* AVFORMAT_RSO_H */ diff --git a/include/libavformat/rtmp.h b/include/libavformat/rtmp.h new file mode 100644 index 0000000..6600da7 --- /dev/null +++ b/include/libavformat/rtmp.h @@ -0,0 +1,68 @@ +/* + * RTMP definitions + * Copyright (c) 2009 Konstantin Shishkov + * + * 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 AVFORMAT_RTMP_H +#define AVFORMAT_RTMP_H + +#include "avformat.h" + +#define RTMP_DEFAULT_PORT 1935 +#define RTMPS_DEFAULT_PORT 443 + +#define RTMP_HANDSHAKE_PACKET_SIZE 1536 + +/** + * emulated Flash client version - 9.0.124.2 on Linux + * @{ + */ +#define RTMP_CLIENT_PLATFORM "LNX" +#define RTMP_CLIENT_VER1 9 +#define RTMP_CLIENT_VER2 0 +#define RTMP_CLIENT_VER3 124 +#define RTMP_CLIENT_VER4 2 +/** @} */ //version defines + +/** + * Calculate HMAC-SHA2 digest for RTMP handshake packets. + * + * @param src input buffer + * @param len input buffer length (should be 1536) + * @param gap offset in buffer where 32 bytes should not be taken into account + * when calculating digest (since it will be used to store that digest) + * @param key digest key + * @param keylen digest key length + * @param dst buffer where calculated digest will be stored (32 bytes) + */ +int ff_rtmp_calc_digest(const uint8_t *src, int len, int gap, + const uint8_t *key, int keylen, uint8_t *dst); + +/** + * Calculate digest position for RTMP handshake packets. + * + * @param buf input buffer (should be 1536 bytes) + * @param off offset in buffer where to start calculating digest position + * @param mod_val value used for computing modulo + * @param add_val value added at the end (after computing modulo) + */ +int ff_rtmp_calc_digest_pos(const uint8_t *buf, int off, int mod_val, + int add_val); + +#endif /* AVFORMAT_RTMP_H */ diff --git a/include/libavformat/rtmpcrypt.h b/include/libavformat/rtmpcrypt.h new file mode 100644 index 0000000..590a8c8 --- /dev/null +++ b/include/libavformat/rtmpcrypt.h @@ -0,0 +1,69 @@ +/* + * RTMPE encryption utilities + * Copyright (c) 2012 Samuel Pitoiset + * + * 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 AVFORMAT_RTMPCRYPT_H +#define AVFORMAT_RTMPCRYPT_H + +#include + +#include "url.h" + +/** + * Initialize the Diffie-Hellmann context and generate the public key. + * + * @param h an URLContext + * @param buf handshake data (1536 bytes) + * @return zero on success, negative value otherwise + */ +int ff_rtmpe_gen_pub_key(URLContext *h, uint8_t *buf); + +/** + * Compute the shared secret key and initialize the RC4 encryption. + * + * @param h an URLContext + * @param serverdata server data (1536 bytes) + * @param clientdata client data (1536 bytes) + * @param type the position of the server digest + * @return zero on success, negative value otherwise + */ +int ff_rtmpe_compute_secret_key(URLContext *h, const uint8_t *serverdata, + const uint8_t *clientdata, int type); + +/** + * Encrypt the signature. + * + * @param h an URLContext + * @param signature the signature to encrypt + * @param digest the digest used for finding the encryption key + * @param type type of encryption (8 for XTEA, 9 for Blowfish) + */ +void ff_rtmpe_encrypt_sig(URLContext *h, uint8_t *signature, + const uint8_t *digest, int type); + +/** + * Update the keystream and set RC4 keys for encryption. + * + * @param h an URLContext + * @return zero on success, negative value otherwise + */ +int ff_rtmpe_update_keystream(URLContext *h); + +#endif /* AVFORMAT_RTMPCRYPT_H */ diff --git a/include/libavformat/rtmpdh.h b/include/libavformat/rtmpdh.h new file mode 100644 index 0000000..8cc1a42 --- /dev/null +++ b/include/libavformat/rtmpdh.h @@ -0,0 +1,107 @@ +/* + * RTMP Diffie-Hellmann utilities + * Copyright (c) 2012 Samuel Pitoiset + * + * 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 AVFORMAT_RTMPDH_H +#define AVFORMAT_RTMPDH_H + +#include + +#include "config.h" + +#if CONFIG_GMP +#include + +typedef mpz_ptr FFBigNum; +#elif CONFIG_GCRYPT +#include + +typedef gcry_mpi_t FFBigNum; + +#elif CONFIG_OPENSSL +#include +#include + +typedef BIGNUM *FFBigNum; +#elif CONFIG_MBEDTLS +#include + +typedef mbedtls_mpi *FFBigNum; + +#endif + +typedef struct FF_DH { + FFBigNum p; + FFBigNum g; + FFBigNum pub_key; + FFBigNum priv_key; + long length; +} FF_DH; + + +/** + * Initialize a Diffie-Hellmann context. + * + * @param key_len length of the key + * @return a new Diffie-Hellmann context on success, NULL otherwise + */ +FF_DH *ff_dh_init(int key_len); + +/** + * Free a Diffie-Hellmann context. + * + * @param dh a Diffie-Hellmann context to free + */ +void ff_dh_free(FF_DH *dh); + +/** + * Generate a public key. + * + * @param dh a Diffie-Hellmann context + * @return zero on success, negative value otherwise + */ +int ff_dh_generate_public_key(FF_DH *dh); + +/** + * Write the public key into the given buffer. + * + * @param dh a Diffie-Hellmann context, containing the public key to write + * @param pub_key the buffer where the public key is written + * @param pub_key_len the length of the buffer + * @return zero on success, negative value otherwise + */ +int ff_dh_write_public_key(FF_DH *dh, uint8_t *pub_key, int pub_key_len); + +/** + * Compute the shared secret key from the private FF_DH value and the + * other party's public value. + * + * @param dh a Diffie-Hellmann context, containing the private key + * @param pub_key the buffer containing the public key + * @param pub_key_len the length of the public key buffer + * @param secret_key the buffer where the secret key is written + * @param secret_key_len the length of the secret key buffer + * @return length of the shared secret key on success, negative value otherwise + */ +int ff_dh_compute_shared_secret_key(FF_DH *dh, const uint8_t *pub_key, + int pub_key_len, uint8_t *secret_key, + int secret_key_len); + +#endif /* AVFORMAT_RTMPDH_H */ diff --git a/include/libavformat/rtmppkt.h b/include/libavformat/rtmppkt.h new file mode 100644 index 0000000..7c580f2 --- /dev/null +++ b/include/libavformat/rtmppkt.h @@ -0,0 +1,329 @@ +/* + * RTMP packet utilities + * Copyright (c) 2009 Konstantin Shishkov + * + * 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 AVFORMAT_RTMPPKT_H +#define AVFORMAT_RTMPPKT_H + +#include "libavcodec/bytestream.h" +#include "avformat.h" +#include "url.h" + +/** maximum possible number of different RTMP channels */ +#define RTMP_CHANNELS 65599 + +/** + * channels used to for RTMP packets with different purposes (i.e. data, network + * control, remote procedure calls, etc.) + */ +enum RTMPChannel { + RTMP_NETWORK_CHANNEL = 2, ///< channel for network-related messages (bandwidth report, ping, etc) + RTMP_SYSTEM_CHANNEL, ///< channel for sending server control messages + RTMP_AUDIO_CHANNEL, ///< channel for audio data + RTMP_VIDEO_CHANNEL = 6, ///< channel for video data + RTMP_SOURCE_CHANNEL = 8, ///< channel for a/v invokes +}; + +/** + * known RTMP packet types + */ +typedef enum RTMPPacketType { + RTMP_PT_CHUNK_SIZE = 1, ///< chunk size change + RTMP_PT_BYTES_READ = 3, ///< number of bytes read + RTMP_PT_USER_CONTROL, ///< user control + RTMP_PT_WINDOW_ACK_SIZE, ///< window acknowledgement size + RTMP_PT_SET_PEER_BW, ///< peer bandwidth + RTMP_PT_AUDIO = 8, ///< audio packet + RTMP_PT_VIDEO, ///< video packet + RTMP_PT_FLEX_STREAM = 15, ///< Flex shared stream + RTMP_PT_FLEX_OBJECT, ///< Flex shared object + RTMP_PT_FLEX_MESSAGE, ///< Flex shared message + RTMP_PT_NOTIFY, ///< some notification + RTMP_PT_SHARED_OBJ, ///< shared object + RTMP_PT_INVOKE, ///< invoke some stream action + RTMP_PT_METADATA = 22, ///< FLV metadata +} RTMPPacketType; + +/** + * possible RTMP packet header sizes + */ +enum RTMPPacketSize { + RTMP_PS_TWELVEBYTES = 0, ///< packet has 12-byte header + RTMP_PS_EIGHTBYTES, ///< packet has 8-byte header + RTMP_PS_FOURBYTES, ///< packet has 4-byte header + RTMP_PS_ONEBYTE ///< packet is really a next chunk of a packet +}; + +/** + * structure for holding RTMP packets + */ +typedef struct RTMPPacket { + int channel_id; ///< RTMP channel ID (nothing to do with audio/video channels though) + RTMPPacketType type; ///< packet payload type + uint32_t timestamp; ///< packet full timestamp + uint32_t ts_field; ///< 24-bit timestamp or increment to the previous one, in milliseconds (latter only for media packets). Clipped to a maximum of 0xFFFFFF, indicating an extended timestamp field. + uint32_t extra; ///< probably an additional channel ID used during streaming data + uint8_t *data; ///< packet payload + int size; ///< packet payload size + int offset; ///< amount of data read so far + int read; ///< amount read, including headers +} RTMPPacket; + +/** + * Create new RTMP packet with given attributes. + * + * @param pkt packet + * @param channel_id packet channel ID + * @param type packet type + * @param timestamp packet timestamp + * @param size packet size + * @return zero on success, negative value otherwise + */ +int ff_rtmp_packet_create(RTMPPacket *pkt, int channel_id, RTMPPacketType type, + int timestamp, int size); + +/** + * Free RTMP packet. + * + * @param pkt packet + */ +void ff_rtmp_packet_destroy(RTMPPacket *pkt); + +/** + * Read RTMP packet sent by the server. + * + * @param h reader context + * @param p packet + * @param chunk_size current chunk size + * @param prev_pkt previously read packet headers for all channels + * (may be needed for restoring incomplete packet header) + * @param nb_prev_pkt number of allocated elements in prev_pkt + * @return number of bytes read on success, negative value otherwise + */ +int ff_rtmp_packet_read(URLContext *h, RTMPPacket *p, + int chunk_size, RTMPPacket **prev_pkt, + int *nb_prev_pkt); +/** + * Read internal RTMP packet sent by the server. + * + * @param h reader context + * @param p packet + * @param chunk_size current chunk size + * @param prev_pkt previously read packet headers for all channels + * (may be needed for restoring incomplete packet header) + * @param nb_prev_pkt number of allocated elements in prev_pkt + * @param c the first byte already read + * @return number of bytes read on success, negative value otherwise + */ +int ff_rtmp_packet_read_internal(URLContext *h, RTMPPacket *p, int chunk_size, + RTMPPacket **prev_pkt, int *nb_prev_pkt, + uint8_t c); + +/** + * Send RTMP packet to the server. + * + * @param h reader context + * @param p packet to send + * @param chunk_size current chunk size + * @param prev_pkt previously sent packet headers for all channels + * (may be used for packet header compressing) + * @param nb_prev_pkt number of allocated elements in prev_pkt + * @return number of bytes written on success, negative value otherwise + */ +int ff_rtmp_packet_write(URLContext *h, RTMPPacket *p, + int chunk_size, RTMPPacket **prev_pkt, + int *nb_prev_pkt); + +/** + * Print information and contents of RTMP packet. + * + * @param ctx output context + * @param p packet to dump + */ +void ff_rtmp_packet_dump(void *ctx, RTMPPacket *p); + +/** + * Enlarge the prev_pkt array to fit the given channel + * + * @param prev_pkt array with previously sent packet headers + * @param nb_prev_pkt number of allocated elements in prev_pkt + * @param channel the channel number that needs to be allocated + */ +int ff_rtmp_check_alloc_array(RTMPPacket **prev_pkt, int *nb_prev_pkt, + int channel); + +/** + * @name Functions used to work with the AMF format (which is also used in .flv) + * @see amf_* funcs in libavformat/flvdec.c + * @{ + */ + +/** + * Calculate number of bytes taken by first AMF entry in data. + * + * @param data input data + * @param data_end input buffer end + * @return number of bytes used by first AMF entry + */ +int ff_amf_tag_size(const uint8_t *data, const uint8_t *data_end); + +/** + * Retrieve value of given AMF object field in string form. + * + * @param data AMF object data + * @param data_end input buffer end + * @param name name of field to retrieve + * @param dst buffer for storing result + * @param dst_size output buffer size + * @return 0 if search and retrieval succeeded, negative value otherwise + */ +int ff_amf_get_field_value(const uint8_t *data, const uint8_t *data_end, + const uint8_t *name, uint8_t *dst, int dst_size); + +/** + * Write boolean value in AMF format to buffer. + * + * @param dst pointer to the input buffer (will be modified) + * @param val value to write + */ +void ff_amf_write_bool(uint8_t **dst, int val); + +/** + * Write number in AMF format to buffer. + * + * @param dst pointer to the input buffer (will be modified) + * @param num value to write + */ +void ff_amf_write_number(uint8_t **dst, double num); + +/** + * Write string in AMF format to buffer. + * + * @param dst pointer to the input buffer (will be modified) + * @param str string to write + */ +void ff_amf_write_string(uint8_t **dst, const char *str); + +/** + * Write a string consisting of two parts in AMF format to a buffer. + * + * @param dst pointer to the input buffer (will be modified) + * @param str1 first string to write, may be null + * @param str2 second string to write, may be null + */ +void ff_amf_write_string2(uint8_t **dst, const char *str1, const char *str2); + +/** + * Write AMF NULL value to buffer. + * + * @param dst pointer to the input buffer (will be modified) + */ +void ff_amf_write_null(uint8_t **dst); + +/** + * Write marker for AMF object to buffer. + * + * @param dst pointer to the input buffer (will be modified) + */ +void ff_amf_write_object_start(uint8_t **dst); + +/** + * Write marker and length for AMF array to buffer. + * + * @param dst pointer to the input buffer (will be modified) + * @param length value to write + */ +void ff_amf_write_array_start(uint8_t **dst, uint32_t length); + +/** + * Write string used as field name in AMF object to buffer. + * + * @param dst pointer to the input buffer (will be modified) + * @param str string to write + */ +void ff_amf_write_field_name(uint8_t **dst, const char *str); + +/** + * Write marker for end of AMF object to buffer. + * + * @param dst pointer to the input buffer (will be modified) + */ +void ff_amf_write_object_end(uint8_t **dst); + +/** + * Read AMF number value. + * + *@param[in,out] gbc GetByteContext initialized with AMF-formatted data + *@param[out] val read value + *@return 0 on success or an AVERROR code on failure +*/ +int ff_amf_read_number(GetByteContext *gbc, double *val); + +/** + * Get AMF string value. + * + * This function behaves the same as ff_amf_read_string except that + * it does not expect the AMF type prepended to the actual data. + * Appends a trailing null byte to output string in order to + * ease later parsing. + * + *@param[in,out] gbc GetByteContext initialized with AMF-formatted data + *@param[out] str read string + *@param[in] strsize buffer size available to store the read string + *@param[out] length read string length + *@return 0 on success or an AVERROR code on failure +*/ +int ff_amf_get_string(GetByteContext *bc, uint8_t *str, + int strsize, int *length); + +/** + * Read AMF string value. + * + * Appends a trailing null byte to output string in order to + * ease later parsing. + * + *@param[in,out] gbc GetByteContext initialized with AMF-formatted data + *@param[out] str read string + *@param[in] strsize buffer size available to store the read string + *@param[out] length read string length + *@return 0 on success or an AVERROR code on failure +*/ +int ff_amf_read_string(GetByteContext *gbc, uint8_t *str, + int strsize, int *length); + +/** + * Read AMF NULL value. + * + *@param[in,out] gbc GetByteContext initialized with AMF-formatted data + *@return 0 on success or an AVERROR code on failure +*/ +int ff_amf_read_null(GetByteContext *gbc); + +/** + * Match AMF string with a NULL-terminated string. + * + * @return 0 if the strings do not match. + */ + +int ff_amf_match_string(const uint8_t *data, int size, const char *str); + +/** @} */ // AMF funcs + +#endif /* AVFORMAT_RTMPPKT_H */ diff --git a/include/libavformat/rtp.h b/include/libavformat/rtp.h new file mode 100644 index 0000000..0c0e608 --- /dev/null +++ b/include/libavformat/rtp.h @@ -0,0 +1,117 @@ +/* + * RTP definitions + * Copyright (c) 2002 Fabrice Bellard + * + * 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 AVFORMAT_RTP_H +#define AVFORMAT_RTP_H + +#include +#include "libavutil/avutil.h" +#include "libavcodec/codec_id.h" +#include "libavcodec/codec_par.h" +#include "libavformat/avformat.h" + +/** + * Return the payload type for a given stream used in the given format context. + * Static payload types are derived from the codec. + * Dynamic payload type are derived from the id field in AVStream. + * The format context private option payload_type overrides both. + * + * @param fmt The context of the format + * @param par The codec parameters + * @param idx The stream index + * @return The payload type (the 'PT' field in the RTP header). + */ +int ff_rtp_get_payload_type(const AVFormatContext *fmt, + const AVCodecParameters *par, int idx); + +/** + * Initialize a codec context based on the payload type. + * + * Fill the codec_type and codec_id fields of a codec context with + * information depending on the payload type; for audio codecs, the + * channels and sample_rate fields are also filled. + * + * @param par The codec parameters + * @param payload_type The payload type (the 'PT' field in the RTP header) + * @return In case of unknown payload type or dynamic payload type, a + * negative value is returned; otherwise, 0 is returned + */ +int ff_rtp_get_codec_info(AVCodecParameters *par, int payload_type); + +/** + * Return the encoding name (as defined in + * http://www.iana.org/assignments/rtp-parameters) for a given payload type. + * + * @param payload_type The payload type (the 'PT' field in the RTP header) + * @return In case of unknown payload type or dynamic payload type, a pointer + * to an empty string is returned; otherwise, a pointer to a string containing + * the encoding name is returned + */ +const char *ff_rtp_enc_name(int payload_type); + +/** + * Return the codec id for the given encoding name and codec type. + * + * @param buf A pointer to the string containing the encoding name + * @param codec_type The codec type + * @return In case of unknown encoding name, AV_CODEC_ID_NONE is returned; + * otherwise, the codec id is returned + */ +enum AVCodecID ff_rtp_codec_id(const char *buf, enum AVMediaType codec_type); + +#define RTP_PT_PRIVATE 96 +#define RTP_VERSION 2 +#define RTP_MAX_SDES 256 /**< maximum text length for SDES */ + +/* RTCP packets use 0.5% of the bandwidth */ +#define RTCP_TX_RATIO_NUM 5 +#define RTCP_TX_RATIO_DEN 1000 + +/* An arbitrary id value for RTP Xiph streams - only relevant to indicate + * that the configuration has changed within a stream (by changing the + * ident value sent). + */ +#define RTP_XIPH_IDENT 0xfecdba + +/* RTCP packet types */ +enum RTCPType { + RTCP_FIR = 192, + RTCP_NACK, // 193 + RTCP_SMPTETC,// 194 + RTCP_IJ, // 195 + RTCP_SR = 200, + RTCP_RR, // 201 + RTCP_SDES, // 202 + RTCP_BYE, // 203 + RTCP_APP, // 204 + RTCP_RTPFB,// 205 + RTCP_PSFB, // 206 + RTCP_XR, // 207 + RTCP_AVB, // 208 + RTCP_RSI, // 209 + RTCP_TOKEN,// 210 +}; + +#define RTP_PT_IS_RTCP(x) (((x) >= RTCP_FIR && (x) <= RTCP_IJ) || \ + ((x) >= RTCP_SR && (x) <= RTCP_TOKEN)) + +#define NTP_TO_RTP_FORMAT(x) av_rescale((x), INT64_C(1) << 32, 1000000) + +#endif /* AVFORMAT_RTP_H */ diff --git a/include/libavformat/rtpdec.h b/include/libavformat/rtpdec.h new file mode 100644 index 0000000..5a02e72 --- /dev/null +++ b/include/libavformat/rtpdec.h @@ -0,0 +1,226 @@ +/* + * RTP demuxer definitions + * Copyright (c) 2002 Fabrice Bellard + * Copyright (c) 2006 Ryan Martell + * + * 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 AVFORMAT_RTPDEC_H +#define AVFORMAT_RTPDEC_H + +#include "libavcodec/codec_id.h" +#include "libavcodec/packet.h" +#include "avformat.h" +#include "rtp.h" +#include "url.h" +#include "srtp.h" + +typedef struct PayloadContext PayloadContext; +typedef struct RTPDynamicProtocolHandler RTPDynamicProtocolHandler; + +#define RTP_MIN_PACKET_LENGTH 12 +#define RTP_MAX_PACKET_LENGTH 8192 + +#define RTP_REORDER_QUEUE_DEFAULT_SIZE 500 + +#define RTP_NOTS_VALUE ((uint32_t)-1) + +typedef struct RTPDemuxContext RTPDemuxContext; +RTPDemuxContext *ff_rtp_parse_open(AVFormatContext *s1, AVStream *st, + int payload_type, int queue_size); +void ff_rtp_parse_set_dynamic_protocol(RTPDemuxContext *s, PayloadContext *ctx, + const RTPDynamicProtocolHandler *handler); +void ff_rtp_parse_set_crypto(RTPDemuxContext *s, const char *suite, + const char *params); +int ff_rtp_parse_packet(RTPDemuxContext *s, AVPacket *pkt, + uint8_t **buf, int len); +void ff_rtp_parse_close(RTPDemuxContext *s); +int64_t ff_rtp_queued_packet_time(RTPDemuxContext *s); +void ff_rtp_reset_packet_queue(RTPDemuxContext *s); + +/** + * Send a dummy packet on both port pairs to set up the connection + * state in potential NAT routers, so that we're able to receive + * packets. + * + * Note, this only works if the NAT router doesn't remap ports. This + * isn't a standardized procedure, but it works in many cases in practice. + * + * The same routine is used with RDT too, even if RDT doesn't use normal + * RTP packets otherwise. + */ +void ff_rtp_send_punch_packets(URLContext* rtp_handle); + +/** + * some rtp servers assume client is dead if they don't hear from them... + * so we send a Receiver Report to the provided URLContext or AVIOContext + * (we don't have access to the rtcp handle from here) + */ +int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, URLContext *fd, + AVIOContext *avio, int count); +int ff_rtp_send_rtcp_feedback(RTPDemuxContext *s, URLContext *fd, + AVIOContext *avio); + +// these statistics are used for rtcp receiver reports... +typedef struct RTPStatistics { + uint16_t max_seq; ///< highest sequence number seen + uint32_t cycles; ///< shifted count of sequence number cycles + uint32_t base_seq; ///< base sequence number + uint32_t bad_seq; ///< last bad sequence number + 1 + int probation; ///< sequence packets till source is valid + uint32_t received; ///< packets received + uint32_t expected_prior; ///< packets expected in last interval + uint32_t received_prior; ///< packets received in last interval + uint32_t transit; ///< relative transit time for previous packet + uint32_t jitter; ///< estimated jitter. +} RTPStatistics; + +#define RTP_FLAG_KEY 0x1 ///< RTP packet contains a keyframe +#define RTP_FLAG_MARKER 0x2 ///< RTP marker bit was set for this packet +/** + * Packet parsing for "private" payloads in the RTP specs. + * + * @param ctx RTSP demuxer context + * @param s stream context + * @param st stream that this packet belongs to + * @param pkt packet in which to write the parsed data + * @param timestamp pointer to the RTP timestamp of the input data, can be + * updated by the function if returning older, buffered data + * @param buf pointer to raw RTP packet data + * @param len length of buf + * @param seq RTP sequence number of the packet + * @param flags flags from the RTP packet header (RTP_FLAG_*) + */ +typedef int (*DynamicPayloadPacketHandlerProc)(AVFormatContext *ctx, + PayloadContext *s, + AVStream *st, AVPacket *pkt, + uint32_t *timestamp, + const uint8_t * buf, + int len, uint16_t seq, int flags); + +struct RTPDynamicProtocolHandler { + const char *enc_name; + enum AVMediaType codec_type; + enum AVCodecID codec_id; + enum AVStreamParseType need_parsing; + int static_payload_id; /* 0 means no payload id is set. 0 is a valid + * payload ID (PCMU), too, but that format doesn't + * require any custom depacketization code. */ + int priv_data_size; + + /** Initialize dynamic protocol handler, called after the full rtpmap line is parsed, may be null */ + int (*init)(AVFormatContext *s, int st_index, PayloadContext *priv_data); + /** Parse the a= line from the sdp field */ + int (*parse_sdp_a_line)(AVFormatContext *s, int st_index, + PayloadContext *priv_data, const char *line); + /** Free any data needed by the rtp parsing for this dynamic data. + * Don't free the protocol_data pointer itself, that is freed by the + * caller. This is called even if the init method failed. */ + void (*close)(PayloadContext *protocol_data); + /** Parse handler for this dynamic packet */ + DynamicPayloadPacketHandlerProc parse_packet; + int (*need_keyframe)(PayloadContext *context); +}; + +typedef struct RTPPacket { + uint16_t seq; + uint8_t *buf; + int len; + int64_t recvtime; + struct RTPPacket *next; +} RTPPacket; + +struct RTPDemuxContext { + AVFormatContext *ic; + AVStream *st; + int payload_type; + uint32_t ssrc; + uint16_t seq; + uint32_t timestamp; + uint32_t base_timestamp; + int64_t unwrapped_timestamp; + int64_t range_start_offset; + int max_payload_size; + /* used to send back RTCP RR */ + char hostname[256]; + + int srtp_enabled; + struct SRTPContext srtp; + + /** Statistics for this stream (used by RTCP receiver reports) */ + RTPStatistics statistics; + + /** Fields for packet reordering @{ */ + int prev_ret; ///< The return value of the actual parsing of the previous packet + RTPPacket* queue; ///< A sorted queue of buffered packets not yet returned + int queue_len; ///< The number of packets in queue + int queue_size; ///< The size of queue, or 0 if reordering is disabled + /*@}*/ + + /* rtcp sender statistics receive */ + uint64_t last_rtcp_ntp_time; + int64_t last_rtcp_reception_time; + uint64_t first_rtcp_ntp_time; + uint32_t last_rtcp_timestamp; + int64_t rtcp_ts_offset; + + /* rtcp sender statistics */ + unsigned int packet_count; + unsigned int octet_count; + unsigned int last_octet_count; + int64_t last_feedback_time; + + /* dynamic payload stuff */ + const RTPDynamicProtocolHandler *handler; + PayloadContext *dynamic_protocol_context; +}; + +/** + * Find a registered rtp dynamic protocol handler with the specified name. + * + * @param name name of the requested rtp dynamic protocol handler + * @return A rtp dynamic protocol handler if one was found, NULL otherwise. + */ +const RTPDynamicProtocolHandler *ff_rtp_handler_find_by_name(const char *name, + enum AVMediaType codec_type); +/** + * Find a registered rtp dynamic protocol handler with a matching codec ID. + * + * @param id AVCodecID of the requested rtp dynamic protocol handler. + * @return A rtp dynamic protocol handler if one was found, NULL otherwise. + */ +const RTPDynamicProtocolHandler *ff_rtp_handler_find_by_id(int id, + enum AVMediaType codec_type); + +/* from rtsp.c, but used by rtp dynamic protocol handlers. */ +int ff_rtsp_next_attr_and_value(const char **p, char *attr, int attr_size, + char *value, int value_size); + +int ff_parse_fmtp(AVFormatContext *s, + AVStream *stream, PayloadContext *data, const char *p, + int (*parse_fmtp)(AVFormatContext *s, + AVStream *stream, + PayloadContext *data, + const char *attr, const char *value)); + +/** + * Close the dynamic buffer and make a packet from it. + */ +int ff_rtp_finalize_packet(AVPacket *pkt, AVIOContext **dyn_buf, int stream_idx); + +#endif /* AVFORMAT_RTPDEC_H */ diff --git a/include/libavformat/rtpdec_formats.h b/include/libavformat/rtpdec_formats.h new file mode 100644 index 0000000..dad2b8a --- /dev/null +++ b/include/libavformat/rtpdec_formats.h @@ -0,0 +1,93 @@ +/* + * RTP depacketizer declarations + * Copyright (c) 2010 Martin Storsjo + * + * 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 AVFORMAT_RTPDEC_FORMATS_H +#define AVFORMAT_RTPDEC_FORMATS_H + +#include "rtpdec.h" + +/** + * Parse a Windows Media Server-specific SDP line + * + * @param s RTSP demux context + */ +int ff_wms_parse_sdp_a_line(AVFormatContext *s, const char *p); + +int ff_h263_handle_packet(AVFormatContext *ctx, PayloadContext *data, + AVStream *st, AVPacket *pkt, uint32_t *timestamp, + const uint8_t *buf, int len, uint16_t seq, int flags); + +int ff_h264_parse_sprop_parameter_sets(AVFormatContext *s, + uint8_t **data_ptr, int *size_ptr, + const char *value); +int ff_h264_handle_aggregated_packet(AVFormatContext *ctx, PayloadContext *data, AVPacket *pkt, + const uint8_t *buf, int len, + int start_skip, int *nal_counters, + int nal_mask); +int ff_h264_handle_frag_packet(AVPacket *pkt, const uint8_t *buf, int len, + int start_bit, const uint8_t *nal_header, + int nal_header_len); +void ff_h264_parse_framesize(AVCodecParameters *par, const char *p); + +extern const RTPDynamicProtocolHandler ff_ac3_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_amr_nb_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_amr_wb_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_dv_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_g726_16_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_g726_24_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_g726_32_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_g726_40_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_g726le_16_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_g726le_24_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_g726le_32_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_g726le_40_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_h261_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_h263_1998_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_h263_2000_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_h263_rfc2190_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_h264_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_hevc_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_ilbc_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_jpeg_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_mp4a_latm_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_mp4v_es_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_mpeg_audio_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_mpeg_audio_robust_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_mpeg_video_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_mpeg4_generic_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_mpegts_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_ms_rtp_asf_pfa_handler; +extern const RTPDynamicProtocolHandler ff_ms_rtp_asf_pfv_handler; +extern const RTPDynamicProtocolHandler ff_qcelp_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_qdm2_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_qt_rtp_aud_handler; +extern const RTPDynamicProtocolHandler ff_qt_rtp_vid_handler; +extern const RTPDynamicProtocolHandler ff_quicktime_rtp_aud_handler; +extern const RTPDynamicProtocolHandler ff_quicktime_rtp_vid_handler; +extern const RTPDynamicProtocolHandler ff_rfc4175_rtp_handler; +extern const RTPDynamicProtocolHandler ff_svq3_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_theora_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_vc2hq_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_vorbis_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_vp8_dynamic_handler; +extern const RTPDynamicProtocolHandler ff_vp9_dynamic_handler; + +#endif /* AVFORMAT_RTPDEC_FORMATS_H */ diff --git a/include/libavformat/rtpenc.h b/include/libavformat/rtpenc.h new file mode 100644 index 0000000..854bf07 --- /dev/null +++ b/include/libavformat/rtpenc.h @@ -0,0 +1,103 @@ +/* + * RTP muxer definitions + * Copyright (c) 2002 Fabrice Bellard + * + * 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 AVFORMAT_RTPENC_H +#define AVFORMAT_RTPENC_H + +#include "avformat.h" +#include "rtp.h" + +struct RTPMuxContext { + const AVClass *av_class; + AVFormatContext *ic; + AVStream *st; + int payload_type; + uint32_t ssrc; + const char *cname; + int seq; + uint32_t timestamp; + uint32_t base_timestamp; + uint32_t cur_timestamp; + int max_payload_size; + int num_frames; + + /* rtcp sender statistics */ + int64_t last_rtcp_ntp_time; + int64_t first_rtcp_ntp_time; + unsigned int packet_count; + unsigned int octet_count; + unsigned int last_octet_count; + int first_packet; + /* buffer for output */ + uint8_t *buf; + uint8_t *buf_ptr; + + int max_frames_per_packet; + + /** + * Number of bytes used for H.264 NAL length, if the MP4 syntax is used + * (1, 2 or 4) + */ + int nal_length_size; + int buffered_nals; + + int flags; + + unsigned int frame_count; +}; + +typedef struct RTPMuxContext RTPMuxContext; + +#define FF_RTP_FLAG_MP4A_LATM 1 +#define FF_RTP_FLAG_RFC2190 2 +#define FF_RTP_FLAG_SKIP_RTCP 4 +#define FF_RTP_FLAG_H264_MODE0 8 +#define FF_RTP_FLAG_SEND_BYE 16 + +#define FF_RTP_FLAG_OPTS(ctx, fieldname) \ + { "rtpflags", "RTP muxer flags", offsetof(ctx, fieldname), AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, .unit = "rtpflags" }, \ + { "latm", "Use MP4A-LATM packetization instead of MPEG4-GENERIC for AAC", 0, AV_OPT_TYPE_CONST, {.i64 = FF_RTP_FLAG_MP4A_LATM}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, .unit = "rtpflags" }, \ + { "rfc2190", "Use RFC 2190 packetization instead of RFC 4629 for H.263", 0, AV_OPT_TYPE_CONST, {.i64 = FF_RTP_FLAG_RFC2190}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, .unit = "rtpflags" }, \ + { "skip_rtcp", "Don't send RTCP sender reports", 0, AV_OPT_TYPE_CONST, {.i64 = FF_RTP_FLAG_SKIP_RTCP}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, .unit = "rtpflags" }, \ + { "h264_mode0", "Use mode 0 for H.264 in RTP", 0, AV_OPT_TYPE_CONST, {.i64 = FF_RTP_FLAG_H264_MODE0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, .unit = "rtpflags" }, \ + { "send_bye", "Send RTCP BYE packets when finishing", 0, AV_OPT_TYPE_CONST, {.i64 = FF_RTP_FLAG_SEND_BYE}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, .unit = "rtpflags" } \ + +void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m); + +void ff_rtp_send_h264_hevc(AVFormatContext *s1, const uint8_t *buf1, int size); +void ff_rtp_send_h261(AVFormatContext *s1, const uint8_t *buf1, int size); +void ff_rtp_send_h263(AVFormatContext *s1, const uint8_t *buf1, int size); +void ff_rtp_send_h263_rfc2190(AVFormatContext *s1, const uint8_t *buf1, int size, + const uint8_t *mb_info, int mb_info_size); +void ff_rtp_send_aac(AVFormatContext *s1, const uint8_t *buff, int size); +void ff_rtp_send_latm(AVFormatContext *s1, const uint8_t *buff, int size); +void ff_rtp_send_amr(AVFormatContext *s1, const uint8_t *buff, int size); +void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size); +void ff_rtp_send_xiph(AVFormatContext *s1, const uint8_t *buff, int size); +void ff_rtp_send_vc2hq(AVFormatContext *s1, const uint8_t *buf, int size, int interlaced); +void ff_rtp_send_vp8(AVFormatContext *s1, const uint8_t *buff, int size); +void ff_rtp_send_vp9(AVFormatContext *s1, const uint8_t *buff, int size); +void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buff, int size); +void ff_rtp_send_raw_rfc4175(AVFormatContext *s1, const uint8_t *buf, int size, int interlaced, int field); + +const uint8_t *ff_h263_find_resync_marker_reverse(const uint8_t *restrict start, + const uint8_t *restrict end); + +#endif /* AVFORMAT_RTPENC_H */ diff --git a/include/libavformat/rtpenc_chain.h b/include/libavformat/rtpenc_chain.h new file mode 100644 index 0000000..21c27c1 --- /dev/null +++ b/include/libavformat/rtpenc_chain.h @@ -0,0 +1,32 @@ +/* + * RTP muxer chaining code + * Copyright (c) 2010 Martin Storsjo + * + * 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 AVFORMAT_RTPENC_CHAIN_H +#define AVFORMAT_RTPENC_CHAIN_H + +#include "avformat.h" +#include "url.h" + +int ff_rtp_chain_mux_open(AVFormatContext **out, AVFormatContext *s, + AVStream *st, URLContext *handle, int packet_size, + int id); + +#endif /* AVFORMAT_RTPENC_CHAIN_H */ diff --git a/include/libavformat/rtpproto.h b/include/libavformat/rtpproto.h new file mode 100644 index 0000000..131aac5 --- /dev/null +++ b/include/libavformat/rtpproto.h @@ -0,0 +1,30 @@ +/* + * RTP network protocol + * + * 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 AVFORMAT_RTPPROTO_H +#define AVFORMAT_RTPPROTO_H + +#include "url.h" + +int ff_rtp_set_remote_url(URLContext *h, const char *uri); + +int ff_rtp_get_local_rtp_port(URLContext *h); + +#endif /* AVFORMAT_RTPPROTO_H */ diff --git a/include/libavformat/rtsp.h b/include/libavformat/rtsp.h new file mode 100644 index 0000000..83b2e3f --- /dev/null +++ b/include/libavformat/rtsp.h @@ -0,0 +1,655 @@ +/* + * RTSP definitions + * Copyright (c) 2002 Fabrice Bellard + * + * 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 AVFORMAT_RTSP_H +#define AVFORMAT_RTSP_H + +#include +#include "avformat.h" +#include "rtspcodes.h" +#include "rtpdec.h" +#include "network.h" +#include "httpauth.h" +#include "internal.h" +#include "os_support.h" + +#include "libavutil/log.h" +#include "libavutil/opt.h" + +/** + * Network layer over which RTP/etc packet data will be transported. + */ +enum RTSPLowerTransport { + RTSP_LOWER_TRANSPORT_UDP = 0, /**< UDP/unicast */ + RTSP_LOWER_TRANSPORT_TCP = 1, /**< TCP; interleaved in RTSP */ + RTSP_LOWER_TRANSPORT_UDP_MULTICAST = 2, /**< UDP/multicast */ + RTSP_LOWER_TRANSPORT_NB, + RTSP_LOWER_TRANSPORT_HTTP = 8, /**< HTTP tunneled - not a proper + transport mode as such, + only for use via AVOptions */ + RTSP_LOWER_TRANSPORT_HTTPS, /**< HTTPS tunneled */ + RTSP_LOWER_TRANSPORT_CUSTOM = 16, /**< Custom IO - not a public + option for lower_transport_mask, + but set in the SDP demuxer based + on a flag. */ +}; + +/** + * Packet profile of the data that we will be receiving. Real servers + * commonly send RDT (although they can sometimes send RTP as well), + * whereas most others will send RTP. + */ +enum RTSPTransport { + RTSP_TRANSPORT_RTP, /**< Standards-compliant RTP */ + RTSP_TRANSPORT_RDT, /**< Realmedia Data Transport */ + RTSP_TRANSPORT_RAW, /**< Raw data (over UDP) */ + RTSP_TRANSPORT_NB +}; + +/** + * Transport mode for the RTSP data. This may be plain, or + * tunneled, which is done over HTTP. + */ +enum RTSPControlTransport { + RTSP_MODE_PLAIN, /**< Normal RTSP */ + RTSP_MODE_TUNNEL /**< RTSP over HTTP (tunneling) */ +}; + +#define RTSP_DEFAULT_PORT 554 +#define RTSPS_DEFAULT_PORT 322 +#define RTSP_MAX_TRANSPORTS 8 +#define RTSP_DEFAULT_AUDIO_SAMPLERATE 44100 +#define RTSP_RTP_PORT_MIN 5000 +#define RTSP_RTP_PORT_MAX 65000 +#define SDP_MAX_SIZE 16384 + +/** + * This describes a single item in the "Transport:" line of one stream as + * negotiated by the SETUP RTSP command. Multiple transports are comma- + * separated ("Transport: x-read-rdt/tcp;interleaved=0-1,rtp/avp/udp; + * client_port=1000-1001;server_port=1800-1801") and described in separate + * RTSPTransportFields. + */ +typedef struct RTSPTransportField { + /** interleave ids, if TCP transport; each TCP/RTSP data packet starts + * with a '$', stream length and stream ID. If the stream ID is within + * the range of this interleaved_min-max, then the packet belongs to + * this stream. */ + int interleaved_min, interleaved_max; + + /** UDP multicast port range; the ports to which we should connect to + * receive multicast UDP data. */ + int port_min, port_max; + + /** UDP client ports; these should be the local ports of the UDP RTP + * (and RTCP) sockets over which we receive RTP/RTCP data. */ + int client_port_min, client_port_max; + + /** UDP unicast server port range; the ports to which we should connect + * to receive unicast UDP RTP/RTCP data. */ + int server_port_min, server_port_max; + + /** time-to-live value (required for multicast); the amount of HOPs that + * packets will be allowed to make before being discarded. */ + int ttl; + + /** transport set to record data */ + int mode_record; + + struct sockaddr_storage destination; /**< destination IP address */ + char source[INET6_ADDRSTRLEN + 1]; /**< source IP address */ + + /** data/packet transport protocol; e.g. RTP or RDT */ + enum RTSPTransport transport; + + /** network layer transport protocol; e.g. TCP or UDP uni-/multicast */ + enum RTSPLowerTransport lower_transport; +} RTSPTransportField; + +/** + * This describes the server response to each RTSP command. + */ +typedef struct RTSPMessageHeader { + /** length of the data following this header */ + int content_length; + + enum RTSPStatusCode status_code; /**< response code from server */ + + /** number of items in the 'transports' variable below */ + int nb_transports; + + /** Time range of the streams that the server will stream. In + * AV_TIME_BASE unit, AV_NOPTS_VALUE if not used */ + int64_t range_start, range_end; + + /** describes the complete "Transport:" line of the server in response + * to a SETUP RTSP command by the client */ + RTSPTransportField transports[RTSP_MAX_TRANSPORTS]; + + int seq; /**< sequence number */ + + /** the "Session:" field. This value is initially set by the server and + * should be re-transmitted by the client in every RTSP command. */ + char session_id[512]; + + /** the "Location:" field. This value is used to handle redirection. + */ + char location[4096]; + + /** the "RealChallenge1:" field from the server */ + char real_challenge[64]; + + /** the "Server: field, which can be used to identify some special-case + * servers that are not 100% standards-compliant. We use this to identify + * Windows Media Server, which has a value "WMServer/v.e.r.sion", where + * version is a sequence of digits (e.g. 9.0.0.3372). Helix/Real servers + * use something like "Helix [..] Server Version v.e.r.sion (platform) + * (RealServer compatible)" or "RealServer Version v.e.r.sion (platform)", + * where platform is the output of $uname -msr | sed 's/ /-/g'. */ + char server[64]; + + /** The "timeout" comes as part of the server response to the "SETUP" + * command, in the "Session: [;timeout=]" line. It is the + * time, in seconds, that the server will go without traffic over the + * RTSP/TCP connection before it closes the connection. To prevent + * this, sent dummy requests (e.g. OPTIONS) with intervals smaller + * than this value. */ + int timeout; + + /** The "Notice" or "X-Notice" field value. See + * http://tools.ietf.org/html/draft-stiemerling-rtsp-announce-00 + * for a complete list of supported values. */ + int notice; + + /** The "reason" is meant to specify better the meaning of the error code + * returned + */ + char reason[256]; + + /** + * Content type header + */ + char content_type[64]; + + /** + * SAT>IP com.ses.streamID header + */ + char stream_id[64]; +} RTSPMessageHeader; + +/** + * Client state, i.e. whether we are currently receiving data (PLAYING) or + * setup-but-not-receiving (PAUSED). State can be changed in applications + * by calling av_read_play/pause(). + */ +enum RTSPClientState { + RTSP_STATE_IDLE, /**< not initialized */ + RTSP_STATE_STREAMING, /**< initialized and sending/receiving data */ + RTSP_STATE_PAUSED, /**< initialized, but not receiving data */ + RTSP_STATE_SEEKING, /**< initialized, requesting a seek */ +}; + +/** + * Identify particular servers that require special handling, such as + * standards-incompliant "Transport:" lines in the SETUP request. + */ +enum RTSPServerType { + RTSP_SERVER_RTP, /**< Standards-compliant RTP-server */ + RTSP_SERVER_REAL, /**< Realmedia-style server */ + RTSP_SERVER_WMS, /**< Windows Media server */ + RTSP_SERVER_SATIP,/**< SAT>IP server */ + RTSP_SERVER_NB +}; + +/** + * Private data for the RTSP demuxer. + * + * @todo Use AVIOContext instead of URLContext + */ +typedef struct RTSPState { + const AVClass *class; /**< Class for private options. */ + URLContext *rtsp_hd; /* RTSP TCP connection handle */ + + /** number of items in the 'rtsp_streams' variable */ + int nb_rtsp_streams; + + struct RTSPStream **rtsp_streams; /**< streams in this session */ + + /** indicator of whether we are currently receiving data from the + * server. Basically this isn't more than a simple cache of the + * last PLAY/PAUSE command sent to the server, to make sure we don't + * send 2x the same unexpectedly or commands in the wrong state. */ + enum RTSPClientState state; + + /** the seek value requested when calling av_seek_frame(). This value + * is subsequently used as part of the "Range" parameter when emitting + * the RTSP PLAY command. If we are currently playing, this command is + * called instantly. If we are currently paused, this command is called + * whenever we resume playback. Either way, the value is only used once, + * see rtsp_read_play() and rtsp_read_seek(). */ + int64_t seek_timestamp; + + int seq; /**< RTSP command sequence number */ + + /** copy of RTSPMessageHeader->session_id, i.e. the server-provided session + * identifier that the client should re-transmit in each RTSP command */ + char session_id[512]; + + /** copy of RTSPMessageHeader->timeout, i.e. the time (in seconds) that + * the server will go without traffic on the RTSP/TCP line before it + * closes the connection. */ + int timeout; + + /** timestamp of the last RTSP command that we sent to the RTSP server. + * This is used to calculate when to send dummy commands to keep the + * connection alive, in conjunction with timeout. */ + int64_t last_cmd_time; + + /** the negotiated data/packet transport protocol; e.g. RTP or RDT */ + enum RTSPTransport transport; + + /** the negotiated network layer transport protocol; e.g. TCP or UDP + * uni-/multicast */ + enum RTSPLowerTransport lower_transport; + + /** brand of server that we're talking to; e.g. WMS, REAL or other. + * Detected based on the value of RTSPMessageHeader->server or the presence + * of RTSPMessageHeader->real_challenge */ + enum RTSPServerType server_type; + + /** the "RealChallenge1:" field from the server */ + char real_challenge[64]; + + /** plaintext authorization line (username:password) */ + char auth[128]; + + /** authentication state */ + HTTPAuthState auth_state; + + /** The last reply of the server to a RTSP command */ + char last_reply[2048]; /* XXX: allocate ? */ + + /** RTSPStream->transport_priv of the last stream that we read a + * packet from */ + void *cur_transport_priv; + + /** The following are used for Real stream selection */ + //@{ + /** whether we need to send a "SET_PARAMETER Subscribe:" command */ + int need_subscription; + + /** stream setup during the last frame read. This is used to detect if + * we need to subscribe or unsubscribe to any new streams. */ + enum AVDiscard *real_setup_cache; + + /** current stream setup. This is a temporary buffer used to compare + * current setup to previous frame setup. */ + enum AVDiscard *real_setup; + + /** the last value of the "SET_PARAMETER Subscribe:" RTSP command. + * this is used to send the same "Unsubscribe:" if stream setup changed, + * before sending a new "Subscribe:" command. */ + char last_subscription[1024]; + //@} + + /** The following are used for RTP/ASF streams */ + //@{ + /** ASF demuxer context for the embedded ASF stream from WMS servers */ + AVFormatContext *asf_ctx; + + /** cache for position of the asf demuxer, since we load a new + * data packet in the bytecontext for each incoming RTSP packet. */ + uint64_t asf_pb_pos; + //@} + + /** some MS RTSP streams contain a URL in the SDP that we need to use + * for all subsequent RTSP requests, rather than the input URI; in + * other cases, this is a copy of AVFormatContext->filename. */ + char control_uri[MAX_URL_SIZE]; + + /** The following are used for parsing raw mpegts in udp */ + //@{ + struct MpegTSContext *ts; + int recvbuf_pos; + int recvbuf_len; + //@} + + /** Additional output handle, used when input and output are done + * separately, eg for HTTP tunneling. */ + URLContext *rtsp_hd_out; + + /** RTSP transport mode, such as plain or tunneled. */ + enum RTSPControlTransport control_transport; + + /* Number of RTCP BYE packets the RTSP session has received. + * An EOF is propagated back if nb_byes == nb_streams. + * This is reset after a seek. */ + int nb_byes; + + /** Reusable buffer for receiving packets */ + uint8_t* recvbuf; + + /** + * A mask with all requested transport methods + */ + int lower_transport_mask; + + /** + * The number of returned packets + */ + uint64_t packets; + + /** + * Polling array for udp + */ + struct pollfd *p; + int max_p; + + /** + * Whether the server supports the GET_PARAMETER method. + */ + int get_parameter_supported; + + /** + * Do not begin to play the stream immediately. + */ + int initial_pause; + + /** + * Option flags for the chained RTP muxer. + */ + int rtp_muxer_flags; + + /** Whether the server accepts the x-Dynamic-Rate header */ + int accept_dynamic_rate; + + /** + * Various option flags for the RTSP muxer/demuxer. + */ + int rtsp_flags; + + /** + * Mask of all requested media types + */ + int media_type_mask; + + /** + * Minimum and maximum local UDP ports. + */ + int rtp_port_min, rtp_port_max; + + /** + * Timeout to wait for incoming connections. + */ + int initial_timeout; + + /** + * timeout of socket i/o operations. + */ + int64_t stimeout; + + /** + * Size of RTP packet reordering queue. + */ + int reordering_queue_size; + + /** + * User-Agent string + */ + char *user_agent; + + char default_lang[4]; + int buffer_size; + int pkt_size; + char *localaddr; +} RTSPState; + +#define RTSP_FLAG_FILTER_SRC 0x1 /**< Filter incoming UDP packets - + receive packets only from the right + source address and port. */ +#define RTSP_FLAG_LISTEN 0x2 /**< Wait for incoming connections. */ +#define RTSP_FLAG_CUSTOM_IO 0x4 /**< Do all IO via the AVIOContext. */ +#define RTSP_FLAG_RTCP_TO_SOURCE 0x8 /**< Send RTCP packets to the source + address of received packets. */ +#define RTSP_FLAG_PREFER_TCP 0x10 /**< Try RTP via TCP first if possible. */ +#define RTSP_FLAG_SATIP_RAW 0x20 /**< Export SAT>IP stream as raw MPEG-TS */ + +typedef struct RTSPSource { + char addr[128]; /**< Source-specific multicast include source IP address (from SDP content) */ +} RTSPSource; + +/** + * Describe a single stream, as identified by a single m= line block in the + * SDP content. In the case of RDT, one RTSPStream can represent multiple + * AVStreams. In this case, each AVStream in this set has similar content + * (but different codec/bitrate). + */ +typedef struct RTSPStream { + URLContext *rtp_handle; /**< RTP stream handle (if UDP) */ + void *transport_priv; /**< RTP/RDT parse context if input, RTP AVFormatContext if output */ + + /** corresponding stream index, if any. -1 if none (MPEG2TS case) */ + int stream_index; + + /** interleave IDs; copies of RTSPTransportField->interleaved_min/max + * for the selected transport. Only used for TCP. */ + int interleaved_min, interleaved_max; + + char control_url[MAX_URL_SIZE]; /**< url for this stream (from SDP) */ + + /** The following are used only in SDP, not RTSP */ + //@{ + int sdp_port; /**< port (from SDP content) */ + struct sockaddr_storage sdp_ip; /**< IP address (from SDP content) */ + int nb_include_source_addrs; /**< Number of source-specific multicast include source IP addresses (from SDP content) */ + struct RTSPSource **include_source_addrs; /**< Source-specific multicast include source IP addresses (from SDP content) */ + int nb_exclude_source_addrs; /**< Number of source-specific multicast exclude source IP addresses (from SDP content) */ + struct RTSPSource **exclude_source_addrs; /**< Source-specific multicast exclude source IP addresses (from SDP content) */ + int sdp_ttl; /**< IP Time-To-Live (from SDP content) */ + int sdp_payload_type; /**< payload type */ + //@} + + /** The following are used for dynamic protocols (rtpdec_*.c/rdt.c) */ + //@{ + /** handler structure */ + const RTPDynamicProtocolHandler *dynamic_handler; + + /** private data associated with the dynamic protocol */ + PayloadContext *dynamic_protocol_context; + //@} + + /** Enable sending RTCP feedback messages according to RFC 4585 */ + int feedback; + + /** SSRC for this stream, to allow identifying RTCP packets before the first RTP packet */ + uint32_t ssrc; + + char crypto_suite[40]; + char crypto_params[100]; +} RTSPStream; + +void ff_rtsp_parse_line(AVFormatContext *s, + RTSPMessageHeader *reply, const char *buf, + RTSPState *rt, const char *method); + +/** + * Send a command to the RTSP server without waiting for the reply. + * + * @see rtsp_send_cmd_with_content_async + */ +int ff_rtsp_send_cmd_async(AVFormatContext *s, const char *method, + const char *url, const char *headers); + +/** + * Send a command to the RTSP server and wait for the reply. + * + * @param s RTSP (de)muxer context + * @param method the method for the request + * @param url the target url for the request + * @param headers extra header lines to include in the request + * @param reply pointer where the RTSP message header will be stored + * @param content_ptr pointer where the RTSP message body, if any, will + * be stored (length is in reply) + * @param send_content if non-null, the data to send as request body content + * @param send_content_length the length of the send_content data, or 0 if + * send_content is null + * + * @return zero if success, nonzero otherwise + */ +int ff_rtsp_send_cmd_with_content(AVFormatContext *s, + const char *method, const char *url, + const char *headers, + RTSPMessageHeader *reply, + unsigned char **content_ptr, + const unsigned char *send_content, + int send_content_length); + +/** + * Send a command to the RTSP server and wait for the reply. + * + * @see rtsp_send_cmd_with_content + */ +int ff_rtsp_send_cmd(AVFormatContext *s, const char *method, + const char *url, const char *headers, + RTSPMessageHeader *reply, unsigned char **content_ptr); + +/** + * Read a RTSP message from the server, or prepare to read data + * packets if we're reading data interleaved over the TCP/RTSP + * connection as well. + * + * @param s RTSP (de)muxer context + * @param reply pointer where the RTSP message header will be stored + * @param content_ptr pointer where the RTSP message body, if any, will + * be stored (length is in reply) + * @param return_on_interleaved_data whether the function may return if we + * encounter a data marker ('$'), which precedes data + * packets over interleaved TCP/RTSP connections. If this + * is set, this function will return 1 after encountering + * a '$'. If it is not set, the function will skip any + * data packets (if they are encountered), until a reply + * has been fully parsed. If no more data is available + * without parsing a reply, it will return an error. + * @param method the RTSP method this is a reply to. This affects how + * some response headers are acted upon. May be NULL. + * + * @return 1 if a data packets is ready to be received, -1 on error, + * and 0 on success. + */ +int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply, + unsigned char **content_ptr, + int return_on_interleaved_data, const char *method); + +/** + * Skip a RTP/TCP interleaved packet. + * + * @return 0 on success, < 0 on failure. + */ +int ff_rtsp_skip_packet(AVFormatContext *s); + +/** + * Connect to the RTSP server and set up the individual media streams. + * This can be used for both muxers and demuxers. + * + * @param s RTSP (de)muxer context + * + * @return 0 on success, < 0 on error. Cleans up all allocations done + * within the function on error. + */ +int ff_rtsp_connect(AVFormatContext *s); + +/** + * Close and free all streams within the RTSP (de)muxer + * + * @param s RTSP (de)muxer context + */ +void ff_rtsp_close_streams(AVFormatContext *s); + +/** + * Close all connection handles within the RTSP (de)muxer + * + * @param s RTSP (de)muxer context + */ +void ff_rtsp_close_connections(AVFormatContext *s); + +/** + * Get the description of the stream and set up the RTSPStream child + * objects. + */ +int ff_rtsp_setup_input_streams(AVFormatContext *s, RTSPMessageHeader *reply); + +/** + * Announce the stream to the server and set up the RTSPStream child + * objects for each media stream. + */ +int ff_rtsp_setup_output_streams(AVFormatContext *s, const char *addr); + +/** + * Parse RTSP commands (OPTIONS, PAUSE and TEARDOWN) during streaming in + * listen mode. + */ +int ff_rtsp_parse_streaming_commands(AVFormatContext *s); + +/** + * Parse an SDP description of streams by populating an RTSPState struct + * within the AVFormatContext; also allocate the RTP streams and the + * pollfd array used for UDP streams. + */ +int ff_sdp_parse(AVFormatContext *s, const char *content); + +/** + * Receive one RTP packet from an TCP interleaved RTSP stream. + */ +int ff_rtsp_tcp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st, + uint8_t *buf, int buf_size); + +/** + * Send buffered packets over TCP. + */ +int ff_rtsp_tcp_write_packet(AVFormatContext *s, RTSPStream *rtsp_st); + +/** + * Receive one packet from the RTSPStreams set up in the AVFormatContext + * (which should contain a RTSPState struct as priv_data). + */ +int ff_rtsp_fetch_packet(AVFormatContext *s, AVPacket *pkt); + +/** + * Do the SETUP requests for each stream for the chosen + * lower transport mode. + * @return 0 on success, <0 on error, 1 if protocol is unavailable + */ +int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port, + int lower_transport, const char *real_challenge); + +/** + * Undo the effect of ff_rtsp_make_setup_request, close the + * transport_priv and rtp_handle fields. + */ +void ff_rtsp_undo_setup(AVFormatContext *s, int send_packets); + +/** + * Open RTSP transport context. + */ +int ff_rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st); + +extern const AVOption ff_rtsp_options[]; + +#endif /* AVFORMAT_RTSP_H */ diff --git a/include/libavformat/rtspcodes.h b/include/libavformat/rtspcodes.h new file mode 100644 index 0000000..0ae490a --- /dev/null +++ b/include/libavformat/rtspcodes.h @@ -0,0 +1,149 @@ +/* + * RTSP definitions + * copyright (c) 2002 Fabrice Bellard + * copyright (c) 2014 Samsung Electronics. All rights reserved. + * @Author: Reynaldo H. Verdejo Pinochet + * + * 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 AVFORMAT_RTSPCODES_H +#define AVFORMAT_RTSPCODES_H + +#include "libavutil/common.h" +#include "libavformat/http.h" + +/** RTSP handling */ +enum RTSPStatusCode { +RTSP_STATUS_CONTINUE =100, +RTSP_STATUS_OK =200, +RTSP_STATUS_CREATED =201, +RTSP_STATUS_LOW_ON_STORAGE_SPACE =250, +RTSP_STATUS_MULTIPLE_CHOICES =300, +RTSP_STATUS_MOVED_PERMANENTLY =301, +RTSP_STATUS_MOVED_TEMPORARILY =302, +RTSP_STATUS_SEE_OTHER =303, +RTSP_STATUS_NOT_MODIFIED =304, +RTSP_STATUS_USE_PROXY =305, +RTSP_STATUS_BAD_REQUEST =400, +RTSP_STATUS_UNAUTHORIZED =401, +RTSP_STATUS_PAYMENT_REQUIRED =402, +RTSP_STATUS_FORBIDDEN =403, +RTSP_STATUS_NOT_FOUND =404, +RTSP_STATUS_METHOD =405, +RTSP_STATUS_NOT_ACCEPTABLE =406, +RTSP_STATUS_PROXY_AUTH_REQUIRED =407, +RTSP_STATUS_REQ_TIME_OUT =408, +RTSP_STATUS_GONE =410, +RTSP_STATUS_LENGTH_REQUIRED =411, +RTSP_STATUS_PRECONDITION_FAILED =412, +RTSP_STATUS_REQ_ENTITY_2LARGE =413, +RTSP_STATUS_REQ_URI_2LARGE =414, +RTSP_STATUS_UNSUPPORTED_MTYPE =415, +RTSP_STATUS_PARAM_NOT_UNDERSTOOD =451, +RTSP_STATUS_CONFERENCE_NOT_FOUND =452, +RTSP_STATUS_BANDWIDTH =453, +RTSP_STATUS_SESSION =454, +RTSP_STATUS_STATE =455, +RTSP_STATUS_INVALID_HEADER_FIELD =456, +RTSP_STATUS_INVALID_RANGE =457, +RTSP_STATUS_RONLY_PARAMETER =458, +RTSP_STATUS_AGGREGATE =459, +RTSP_STATUS_ONLY_AGGREGATE =460, +RTSP_STATUS_TRANSPORT =461, +RTSP_STATUS_UNREACHABLE =462, +RTSP_STATUS_INTERNAL =500, +RTSP_STATUS_NOT_IMPLEMENTED =501, +RTSP_STATUS_BAD_GATEWAY =502, +RTSP_STATUS_SERVICE =503, +RTSP_STATUS_GATEWAY_TIME_OUT =504, +RTSP_STATUS_VERSION =505, +RTSP_STATUS_UNSUPPORTED_OPTION =551, +}; + +static const av_unused char * const rtsp_status_strings[] = { +[RTSP_STATUS_CONTINUE] ="Continue", +[RTSP_STATUS_OK] ="OK", +[RTSP_STATUS_CREATED] ="Created", +[RTSP_STATUS_LOW_ON_STORAGE_SPACE] ="Low on Storage Space", +[RTSP_STATUS_MULTIPLE_CHOICES] ="Multiple Choices", +[RTSP_STATUS_MOVED_PERMANENTLY] ="Moved Permanently", +[RTSP_STATUS_MOVED_TEMPORARILY] ="Moved Temporarily", +[RTSP_STATUS_SEE_OTHER] ="See Other", +[RTSP_STATUS_NOT_MODIFIED] ="Not Modified", +[RTSP_STATUS_USE_PROXY] ="Use Proxy", +[RTSP_STATUS_BAD_REQUEST] ="Bad Request", +[RTSP_STATUS_UNAUTHORIZED] ="Unauthorized", +[RTSP_STATUS_PAYMENT_REQUIRED] ="Payment Required", +[RTSP_STATUS_FORBIDDEN] ="Forbidden", +[RTSP_STATUS_NOT_FOUND] ="Not Found", +[RTSP_STATUS_METHOD] ="Method Not Allowed", +[RTSP_STATUS_NOT_ACCEPTABLE] ="Not Acceptable", +[RTSP_STATUS_PROXY_AUTH_REQUIRED] ="Proxy Authentication Required", +[RTSP_STATUS_REQ_TIME_OUT] ="Request Time-out", +[RTSP_STATUS_GONE] ="Gone", +[RTSP_STATUS_LENGTH_REQUIRED] ="Length Required", +[RTSP_STATUS_PRECONDITION_FAILED] ="Precondition Failed", +[RTSP_STATUS_REQ_ENTITY_2LARGE] ="Request Entity Too Large", +[RTSP_STATUS_REQ_URI_2LARGE] ="Request URI Too Large", +[RTSP_STATUS_UNSUPPORTED_MTYPE] ="Unsupported Media Type", +[RTSP_STATUS_PARAM_NOT_UNDERSTOOD] ="Parameter Not Understood", +[RTSP_STATUS_CONFERENCE_NOT_FOUND] ="Conference Not Found", +[RTSP_STATUS_BANDWIDTH] ="Not Enough Bandwidth", +[RTSP_STATUS_SESSION] ="Session Not Found", +[RTSP_STATUS_STATE] ="Method Not Valid in This State", +[RTSP_STATUS_INVALID_HEADER_FIELD] ="Header Field Not Valid for Resource", +[RTSP_STATUS_INVALID_RANGE] ="Invalid Range", +[RTSP_STATUS_RONLY_PARAMETER] ="Parameter Is Read-Only", +[RTSP_STATUS_AGGREGATE] ="Aggregate Operation no Allowed", +[RTSP_STATUS_ONLY_AGGREGATE] ="Only Aggregate Operation Allowed", +[RTSP_STATUS_TRANSPORT] ="Unsupported Transport", +[RTSP_STATUS_UNREACHABLE] ="Destination Unreachable", +[RTSP_STATUS_INTERNAL] ="Internal Server Error", +[RTSP_STATUS_NOT_IMPLEMENTED] ="Not Implemented", +[RTSP_STATUS_BAD_GATEWAY] ="Bad Gateway", +[RTSP_STATUS_SERVICE] ="Service Unavailable", +[RTSP_STATUS_GATEWAY_TIME_OUT] ="Gateway Time-out", +[RTSP_STATUS_VERSION] ="RTSP Version not Supported", +[RTSP_STATUS_UNSUPPORTED_OPTION] ="Option not supported", +}; + +#define RTSP_STATUS_CODE2STRING(x) (\ +x >= 100 && x < FF_ARRAY_ELEMS(rtsp_status_strings) && rtsp_status_strings[x] \ +)? rtsp_status_strings[x] : NULL + +enum RTSPMethod { + DESCRIBE, + ANNOUNCE, + OPTIONS, + SETUP, + PLAY, + PAUSE, + TEARDOWN, + GET_PARAMETER, + SET_PARAMETER, + REDIRECT, + RECORD, + UNKNOWN = -1, +}; + +static inline int ff_rtsp_averror(enum RTSPStatusCode status_code, int default_averror) +{ + return ff_http_averror(status_code, default_averror); +} + +#endif /* AVFORMAT_RTSPCODES_H */ diff --git a/include/libavformat/sauce.h b/include/libavformat/sauce.h new file mode 100644 index 0000000..0ba9ae5 --- /dev/null +++ b/include/libavformat/sauce.h @@ -0,0 +1,40 @@ +/* + * SAUCE header parser + * Copyright (c) 2010 Peter Ross + * + * 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 + */ + +/** + * @file + * SAUCE header parser + */ + +#ifndef AVFORMAT_SAUCE_H +#define AVFORMAT_SAUCE_H + +#include "avformat.h" + +/** + * @param avctx AVFormatContext + * @param[out] fsize return length of file, less SAUCE header + * @param[out] got_width set to non-zero if SAUCE header reported height + * @param get_height Tell SAUCE header to parse height + */ +int ff_sauce_read(AVFormatContext *avctx, uint64_t *fsize, int *got_width, int get_height); + +#endif /* AVFORMAT_SAUCE_H */ diff --git a/include/libavformat/smjpeg.h b/include/libavformat/smjpeg.h new file mode 100644 index 0000000..995ddf2 --- /dev/null +++ b/include/libavformat/smjpeg.h @@ -0,0 +1,45 @@ +/* + * SMJPEG common code + * Copyright (c) 2011-2012 Paul B Mahol + * + * 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 + */ + +/** + * @file + * SMJPEG common code + */ + +#ifndef AVFORMAT_SMJPEG_H +#define AVFORMAT_SMJPEG_H + +#include "internal.h" + +#define SMJPEG_MAGIC "\x0\xaSMJPEG" + +#define SMJPEG_DONE MKTAG('D', 'O', 'N', 'E') +#define SMJPEG_HEND MKTAG('H', 'E', 'N', 'D') +#define SMJPEG_SND MKTAG('_', 'S', 'N', 'D') +#define SMJPEG_SNDD MKTAG('s', 'n', 'd', 'D') +#define SMJPEG_TXT MKTAG('_', 'T', 'X', 'T') +#define SMJPEG_VID MKTAG('_', 'V', 'I', 'D') +#define SMJPEG_VIDD MKTAG('v', 'i', 'd', 'D') + +extern const AVCodecTag ff_codec_smjpeg_video_tags[]; +extern const AVCodecTag ff_codec_smjpeg_audio_tags[]; + +#endif /* AVFORMAT_SMJPEG_H */ diff --git a/include/libavformat/sox.h b/include/libavformat/sox.h new file mode 100644 index 0000000..f4a12e9 --- /dev/null +++ b/include/libavformat/sox.h @@ -0,0 +1,29 @@ +/* + * SoX native format common data + * Copyright (c) 2009 Daniel Verkamp + * + * 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 AVFORMAT_SOX_H +#define AVFORMAT_SOX_H + +#define SOX_FIXED_HDR (4 + 8 + 8 + 4 + 4) /**< Size of fixed header without magic */ + +#define SOX_TAG MKTAG('.', 'S', 'o', 'X') + +#endif /* AVFORMAT_SOX_H */ diff --git a/include/libavformat/spdif.h b/include/libavformat/spdif.h new file mode 100644 index 0000000..0039fcf --- /dev/null +++ b/include/libavformat/spdif.h @@ -0,0 +1,65 @@ +/* + * IEC 61937 common header + * Copyright (c) 2009 Bartlomiej Wolowiec + * + * 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 AVFORMAT_SPDIF_H +#define AVFORMAT_SPDIF_H + +#include +#include "avformat.h" + +#define SYNCWORD1 0xF872 +#define SYNCWORD2 0x4E1F +#define BURST_HEADER_SIZE 0x8 + +enum IEC61937DataType { + IEC61937_AC3 = 0x01, ///< AC-3 data + IEC61937_MPEG1_LAYER1 = 0x04, ///< MPEG-1 layer 1 + IEC61937_MPEG1_LAYER23 = 0x05, ///< MPEG-1 layer 2 or 3 data or MPEG-2 without extension + IEC61937_MPEG2_EXT = 0x06, ///< MPEG-2 data with extension + IEC61937_MPEG2_AAC = 0x07, ///< MPEG-2 AAC ADTS + IEC61937_MPEG2_LAYER1_LSF = 0x08, ///< MPEG-2, layer-1 low sampling frequency + IEC61937_MPEG2_LAYER2_LSF = 0x09, ///< MPEG-2, layer-2 low sampling frequency + IEC61937_MPEG2_LAYER3_LSF = 0x0A, ///< MPEG-2, layer-3 low sampling frequency + IEC61937_DTS1 = 0x0B, ///< DTS type I (512 samples) + IEC61937_DTS2 = 0x0C, ///< DTS type II (1024 samples) + IEC61937_DTS3 = 0x0D, ///< DTS type III (2048 samples) + IEC61937_ATRAC = 0x0E, ///< ATRAC data + IEC61937_ATRAC3 = 0x0F, ///< ATRAC3 data + IEC61937_ATRACX = 0x10, ///< ATRAC3+ data + IEC61937_DTSHD = 0x11, ///< DTS HD data + IEC61937_WMAPRO = 0x12, ///< WMA 9 Professional data + IEC61937_MPEG2_AAC_LSF_2048 = 0x13, ///< MPEG-2 AAC ADTS half-rate low sampling frequency + IEC61937_MPEG2_AAC_LSF_4096 = 0x13 | 0x20, ///< MPEG-2 AAC ADTS quarter-rate low sampling frequency + IEC61937_EAC3 = 0x15, ///< E-AC-3 data + IEC61937_TRUEHD = 0x16, ///< TrueHD data +}; + +static const uint16_t spdif_mpeg_pkt_offset[2][3] = { + //LAYER1 LAYER2 LAYER3 + { 3072, 9216, 4608 }, // MPEG-2 LSF + { 1536, 4608, 4608 }, // MPEG-1 +}; + +void ff_spdif_bswap_buf16(uint16_t *dst, const uint16_t *src, int w); +int ff_spdif_read_packet(AVFormatContext *s, AVPacket *pkt); +int ff_spdif_probe(const uint8_t *p_buf, int buf_size, enum AVCodecID *codec); + +#endif /* AVFORMAT_SPDIF_H */ diff --git a/include/libavformat/srtp.h b/include/libavformat/srtp.h new file mode 100644 index 0000000..3189f8f --- /dev/null +++ b/include/libavformat/srtp.h @@ -0,0 +1,52 @@ +/* + * SRTP encryption/decryption + * Copyright (c) 2012 Martin Storsjo + * + * 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 AVFORMAT_SRTP_H +#define AVFORMAT_SRTP_H + +#include + +struct AVAES; +struct AVHMAC; + +struct SRTPContext { + struct AVAES *aes; + struct AVHMAC *hmac; + int rtp_hmac_size, rtcp_hmac_size; + uint8_t master_key[16]; + uint8_t master_salt[14]; + uint8_t rtp_key[16], rtcp_key[16]; + uint8_t rtp_salt[14], rtcp_salt[14]; + uint8_t rtp_auth[20], rtcp_auth[20]; + int seq_largest, seq_initialized; + uint32_t roc; + + uint32_t rtcp_index; +}; + +int ff_srtp_set_crypto(struct SRTPContext *s, const char *suite, + const char *params); +void ff_srtp_free(struct SRTPContext *s); +int ff_srtp_decrypt(struct SRTPContext *s, uint8_t *buf, int *lenptr); +int ff_srtp_encrypt(struct SRTPContext *s, const uint8_t *in, int len, + uint8_t *out, int outlen); + +#endif /* AVFORMAT_SRTP_H */ diff --git a/include/libavformat/subtitles.h b/include/libavformat/subtitles.h new file mode 100644 index 0000000..ad6b96c --- /dev/null +++ b/include/libavformat/subtitles.h @@ -0,0 +1,230 @@ +/* + * Copyright (c) 2012 Clément Bœsch + * + * 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 AVFORMAT_SUBTITLES_H +#define AVFORMAT_SUBTITLES_H + +#include +#include +#include "avformat.h" +#include "libavutil/bprint.h" +#include "avio_internal.h" + +enum sub_sort { + SUB_SORT_TS_POS = 0, ///< sort by timestamps, then position + SUB_SORT_POS_TS, ///< sort by position, then timestamps +}; + +enum ff_utf_type { + FF_UTF_8, // or other 8 bit encodings + FF_UTF16LE, + FF_UTF16BE, +}; + +typedef struct { + int type; + AVIOContext *pb; + unsigned char buf[8]; + int buf_pos, buf_len; + FFIOContext buf_pb; +} FFTextReader; + +/** + * Initialize the FFTextReader from the given AVIOContext. This function will + * read some bytes from pb, and test for UTF-8 or UTF-16 BOMs. Further accesses + * to FFTextReader will read more data from pb. + * If s is not NULL, the user will be warned if a UTF-16 conversion takes place. + * + * The purpose of FFTextReader is to transparently convert read data to UTF-8 + * if the stream had a UTF-16 BOM. + * + * @param s Pointer to provide av_log context + * @param r object which will be initialized + * @param pb stream to read from (referenced as long as FFTextReader is in use) + */ +void ff_text_init_avio(void *s, FFTextReader *r, AVIOContext *pb); + +/** + * Similar to ff_text_init_avio(), but sets it up to read from a bounded buffer. + * + * @param r object which will be initialized + * @param buf buffer to read from (referenced as long as FFTextReader is in use) + * @param size size of buf + */ +void ff_text_init_buf(FFTextReader *r, const void *buf, size_t size); + +/** + * Return the byte position of the next byte returned by ff_text_r8(). For + * UTF-16 source streams, this will return the original position, but it will + * be incorrect if a codepoint was only partially read with ff_text_r8(). + */ +int64_t ff_text_pos(FFTextReader *r); + +/** + * Return the next byte. The return value is always 0 - 255. Returns 0 on EOF. + * If the source stream is UTF-16, this reads from the stream converted to + * UTF-8. On invalid UTF-16, 0 is returned. + */ +int ff_text_r8(FFTextReader *r); + +/** + * Return non-zero if EOF was reached. + */ +int ff_text_eof(FFTextReader *r); + +/** + * Like ff_text_r8(), but don't remove the byte from the buffer. + */ +int ff_text_peek_r8(FFTextReader *r); + +/** + * Read the given number of bytes (in UTF-8). On error or EOF, \0 bytes are + * written. + */ +void ff_text_read(FFTextReader *r, char *buf, size_t size); + +typedef struct { + AVPacket **subs; ///< array of subtitles packets + int nb_subs; ///< number of subtitles packets + int allocated_size; ///< allocated size for subs + int current_sub_idx; ///< current position for the read packet callback + enum sub_sort sort; ///< sort method to use when finalizing subtitles + int keep_duplicates; ///< set to 1 to keep duplicated subtitle events +} FFDemuxSubtitlesQueue; + +/** + * Insert a new subtitle event. + * + * @param event the subtitle line (not zero terminated) or NULL on not yet available event + * @param len the length of the event (in strlen() sense, so without '\0') + * @param merge set to 1 if the current event should be concatenated with the + * previous one instead of adding a new entry, 0 otherwise + */ +AVPacket *ff_subtitles_queue_insert(FFDemuxSubtitlesQueue *q, + const uint8_t *event, size_t len, int merge); + +/** + * Same as ff_subtitles_queue_insert but takes an AVBPrint input. + * Avoids common errors like handling incomplete AVBPrint. + */ +AVPacket *ff_subtitles_queue_insert_bprint(FFDemuxSubtitlesQueue *q, + const AVBPrint *event, int merge); +/** + * Set missing durations, sort subtitles by PTS (and then byte position), and + * drop duplicated events. + */ +void ff_subtitles_queue_finalize(void *log_ctx, FFDemuxSubtitlesQueue *q); + +/** + * Generic read_packet() callback for subtitles demuxers using this queue + * system. + */ +int ff_subtitles_queue_read_packet(FFDemuxSubtitlesQueue *q, AVPacket *pkt); + +/** + * Update current_sub_idx to emulate a seek. Except the first parameter, it + * matches FFInputFormat->read_seek2 prototypes. + */ +int ff_subtitles_queue_seek(FFDemuxSubtitlesQueue *q, AVFormatContext *s, int stream_index, + int64_t min_ts, int64_t ts, int64_t max_ts, int flags); + +/** + * Remove and destroy all the subtitles packets. + */ +void ff_subtitles_queue_clean(FFDemuxSubtitlesQueue *q); + +int ff_subtitles_read_packet(AVFormatContext *s, AVPacket *pkt); + +int ff_subtitles_read_seek(AVFormatContext *s, int stream_index, + int64_t min_ts, int64_t ts, int64_t max_ts, int flags); + +int ff_subtitles_read_close(AVFormatContext *s); + +/** + * SMIL helper to load next chunk ("<...>" or untagged content) in buf. + * + * @param c cached character, to avoid a backward seek + * @return size of chunk or error, e.g. AVERROR(ENOMEM) on incomplete buf + */ +int ff_smil_extract_next_text_chunk(FFTextReader *tr, AVBPrint *buf, char *c); + +/** + * SMIL helper to point on the value of an attribute in the given tag. + * + * @param s SMIL tag ("<...>") + * @param attr the attribute to look for + */ +const char *ff_smil_get_attr_ptr(const char *s, const char *attr); + +/** + * @brief Same as ff_subtitles_read_text_chunk(), but read from an AVIOContext. + */ +av_warn_unused_result +int ff_subtitles_read_chunk(AVIOContext *pb, AVBPrint *buf); + +/** + * @brief Read a subtitles chunk from FFTextReader. + * + * A chunk is defined by a multiline "event", ending with a second line break. + * The trailing line breaks are trimmed. CRLF are supported. + * Example: "foo\r\nbar\r\n\r\nnext" will print "foo\r\nbar" into buf, and pb + * will focus on the 'n' of the "next" string. + * + * @param tr I/O context + * @param buf an initialized buf where the chunk is written + * @return 0 on success, error value otherwise, e.g. AVERROR(ENOMEM) if buf is incomplete + * + * @note buf is cleared before writing into it. + */ +av_warn_unused_result +int ff_subtitles_read_text_chunk(FFTextReader *tr, AVBPrint *buf); + +/** + * Get the number of characters to increment to jump to the next line, or to + * the end of the string. + * The function handles the following line breaks schemes: + * LF, CRLF (MS), or standalone CR (old MacOS). + */ +static av_always_inline int ff_subtitles_next_line(const char *ptr) +{ + int n = strcspn(ptr, "\r\n"); + ptr += n; + while (*ptr == '\r') { + ptr++; + n++; + } + if (*ptr == '\n') + n++; + return n; +} + +/** + * Read a line of text. Discards line ending characters. + * The function handles the following line breaks schemes: + * LF, CRLF (MS), or standalone CR (old MacOS). + * + * Returns the number of bytes written to buf. Always writes a terminating 0, + * similar as with snprintf. + * + * @note returns a negative error code if a \0 byte is found + */ +ptrdiff_t ff_subtitles_read_line(FFTextReader *tr, char *buf, size_t size); + +#endif /* AVFORMAT_SUBTITLES_H */ diff --git a/include/libavformat/swf.h b/include/libavformat/swf.h new file mode 100644 index 0000000..b66420c --- /dev/null +++ b/include/libavformat/swf.h @@ -0,0 +1,114 @@ +/* + * Flash Compatible Streaming Format common header. + * Copyright (c) 2000 Fabrice Bellard + * Copyright (c) 2003 Tinic Uro + * + * 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 AVFORMAT_SWF_H +#define AVFORMAT_SWF_H + +#include "internal.h" + +/* should have a generic way to indicate probable size */ +#define DUMMY_FILE_SIZE (100 * 1024 * 1024) +#define DUMMY_DURATION 600 /* in seconds */ + +enum { + TAG_END = 0, + TAG_SHOWFRAME = 1, + TAG_DEFINESHAPE = 2, + TAG_FREECHARACTER = 3, + TAG_PLACEOBJECT = 4, + TAG_REMOVEOBJECT = 5, + TAG_DEFINEBITS = 6, + TAG_DEFINEBUTTON = 7, + TAG_JPEGTABLES = 8, + TAG_SETBACKGROUNDCOLOR = 9, + TAG_DEFINEFONT = 10, + TAG_DEFINETEXT = 11, + TAG_DOACTION = 12, + TAG_DEFINEFONTINFO = 13, + TAG_DEFINESOUND = 14, + TAG_STARTSOUND = 15, + TAG_DEFINEBUTTONSOUND = 17, + TAG_STREAMHEAD = 18, + TAG_STREAMBLOCK = 19, + TAG_DEFINEBITSLOSSLESS = 20, + TAG_JPEG2 = 21, + TAG_DEFINESHAPE2 = 22, + TAG_DEFINEBUTTONCXFORM = 23, + TAG_PROTECT = 24, + TAG_PLACEOBJECT2 = 26, + TAG_REMOVEOBJECT2 = 28, + TAG_DEFINESHAPE3 = 32, + TAG_DEFINETEXT2 = 33, + TAG_DEFINEBUTTON2 = 34, + TAG_DEFINEBITSJPEG3 = 35, + TAG_DEFINEBITSLOSSLESS2 = 36, + TAG_DEFINEEDITTEXT = 37, + TAG_DEFINESPRITE = 39, + TAG_FRAMELABEL = 43, + TAG_STREAMHEAD2 = 45, + TAG_DEFINEMORPHSHAPE = 46, + TAG_DEFINEFONT2 = 48, + TAG_EXPORTASSETS = 56, + TAG_IMPORTASSETS = 57, + TAG_ENABLEDEBUGGER = 58, + TAG_DOINITACTION = 59, + TAG_VIDEOSTREAM = 60, + TAG_VIDEOFRAME = 61, + TAG_DEFINEFONTINFO2 = 62, + TAG_ENABLEDEBUGGER2 = 64, + TAG_SCRIPTLIMITS = 65, + TAG_SETTABINDEX = 66, + TAG_FILEATTRIBUTES = 69, + TAG_PLACEOBJECT3 = 70, + TAG_IMPORTASSETS2 = 71, + TAG_DEFINEFONTALIGNZONES = 73, + TAG_CSMTEXTSETTINGS = 74, + TAG_DEFINEFONT3 = 75, + TAG_SYMBOLCLASS = 76, + TAG_METADATA = 77, + TAG_DEFINESCALINGGRID = 78, + TAG_DOABC = 82, + TAG_DEFINESHAPE4 = 83, + TAG_DEFINEMORPHSHAPE2 = 84, + TAG_DEFINESCENEANDFRAMELABELDATA = 86, + TAG_DEFINEBINARYDATA = 87, + TAG_DEFINEFONTNAME = 88, + TAG_STARTSOUND2 = 89, + TAG_DEFINEBITSJPEG4 = 90, + TAG_DEFINEFONT4 = 91, +}; + +#define TAG_LONG 0x100 + +/* flags for shape definition */ +#define FLAG_MOVETO 0x01 +#define FLAG_SETFILL0 0x02 +#define FLAG_SETFILL1 0x04 + +/* character id used */ +#define BITMAP_ID 0 +#define VIDEO_ID 0 +#define SHAPE_ID 1 + +extern const AVCodecTag ff_swf_codec_tags[]; + +#endif /* AVFORMAT_SWF_H */ diff --git a/include/libavformat/tee_common.h b/include/libavformat/tee_common.h new file mode 100644 index 0000000..dcd7f63 --- /dev/null +++ b/include/libavformat/tee_common.h @@ -0,0 +1,30 @@ +/* + * Tee common code + * Copyright (c) 2016 Michael Niedermayer + * + * 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 AVFORMAT_TEE_COMMON_H +#define AVFORMAT_TEE_COMMON_H + +#include "libavutil/dict.h" + +int ff_tee_parse_slave_options(void *log, char *slave, + AVDictionary **options, char **filename); + +#endif diff --git a/include/libavformat/tls.h b/include/libavformat/tls.h new file mode 100644 index 0000000..6c6aa01 --- /dev/null +++ b/include/libavformat/tls.h @@ -0,0 +1,64 @@ +/* + * TLS/SSL Protocol + * Copyright (c) 2011 Martin Storsjo + * + * 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 AVFORMAT_TLS_H +#define AVFORMAT_TLS_H + +#include "libavutil/opt.h" + +#include "url.h" + +typedef struct TLSShared { + char *ca_file; + int verify; + char *cert_file; + char *key_file; + int listen; + + char *host; + char *http_proxy; + + char underlying_host[200]; + int numerichost; + + URLContext *tcp; +} TLSShared; + +#define TLS_OPTFL (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_ENCODING_PARAM) +#define TLS_COMMON_OPTIONS(pstruct, options_field) \ + {"ca_file", "Certificate Authority database file", offsetof(pstruct, options_field . ca_file), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL }, \ + {"cafile", "Certificate Authority database file", offsetof(pstruct, options_field . ca_file), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL }, \ + {"tls_verify", "Verify the peer certificate", offsetof(pstruct, options_field . verify), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, .flags = TLS_OPTFL }, \ + {"cert_file", "Certificate file", offsetof(pstruct, options_field . cert_file), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL }, \ + {"key_file", "Private key file", offsetof(pstruct, options_field . key_file), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL }, \ + {"listen", "Listen for incoming connections", offsetof(pstruct, options_field . listen), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, .flags = TLS_OPTFL }, \ + {"verifyhost", "Verify against a specific hostname", offsetof(pstruct, options_field . host), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL }, \ + {"http_proxy", "Set proxy to tunnel through", offsetof(pstruct, options_field . http_proxy), AV_OPT_TYPE_STRING, .flags = TLS_OPTFL } + +int ff_tls_open_underlying(TLSShared *c, URLContext *parent, const char *uri, AVDictionary **options); + +void ff_gnutls_init(void); +void ff_gnutls_deinit(void); + +int ff_openssl_init(void); +void ff_openssl_deinit(void); + +#endif /* AVFORMAT_TLS_H */ diff --git a/include/libavformat/ttmlenc.h b/include/libavformat/ttmlenc.h new file mode 100644 index 0000000..5a6954f --- /dev/null +++ b/include/libavformat/ttmlenc.h @@ -0,0 +1,39 @@ +/* + * Generic TTML helpers + * Copyright (c) 2021 24i + * + * 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 AVFORMAT_TTMLENC_H +#define AVFORMAT_TTMLENC_H + +#include "libavcodec/codec_par.h" +#include "libavcodec/ttmlenc.h" + +static inline unsigned int ff_is_ttml_stream_paragraph_based(const AVCodecParameters *codecpar) +{ + // Not perfect, but decide whether the packet is a document or not + // by the existence of the lavc ttmlenc extradata. + return (codecpar->extradata && + codecpar->extradata_size >= TTMLENC_EXTRADATA_SIGNATURE_SIZE && + !memcmp(codecpar->extradata, + TTMLENC_EXTRADATA_SIGNATURE, + TTMLENC_EXTRADATA_SIGNATURE_SIZE)); +} + +#endif /* AVFORMAT_TTMLENC_H */ diff --git a/include/libavformat/url.h b/include/libavformat/url.h new file mode 100644 index 0000000..0784d77 --- /dev/null +++ b/include/libavformat/url.h @@ -0,0 +1,419 @@ +/* + * 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 + */ + +/** + * @file + * unbuffered private I/O API + */ + +#ifndef AVFORMAT_URL_H +#define AVFORMAT_URL_H + +#include "avio.h" + +#include "libavutil/dict.h" +#include "libavutil/log.h" + +#define URL_PROTOCOL_FLAG_NESTED_SCHEME 1 /*< The protocol name can be the first part of a nested protocol scheme */ +#define URL_PROTOCOL_FLAG_NETWORK 2 /*< The protocol uses network */ + +typedef struct URLContext { + const AVClass *av_class; /**< information for av_log(). Set by url_open(). */ + const struct URLProtocol *prot; + void *priv_data; + char *filename; /**< specified URL */ + int flags; + int max_packet_size; /**< if non zero, the stream is packetized with this max packet size */ + int is_streamed; /**< true if streamed (no seek possible), default = false */ + int is_connected; + AVIOInterruptCB interrupt_callback; + int64_t rw_timeout; /**< maximum time to wait for (network) read/write operation completion, in mcs */ + const char *protocol_whitelist; + const char *protocol_blacklist; + int min_packet_size; /**< if non zero, the stream is packetized with this min packet size */ +} URLContext; + +typedef struct URLProtocol { + const char *name; + int (*url_open)( URLContext *h, const char *url, int flags); + /** + * This callback is to be used by protocols which open further nested + * protocols. options are then to be passed to ffurl_open_whitelist() + * or ffurl_connect() for those nested protocols. + */ + int (*url_open2)(URLContext *h, const char *url, int flags, AVDictionary **options); + int (*url_accept)(URLContext *s, URLContext **c); + int (*url_handshake)(URLContext *c); + + /** + * Read data from the protocol. + * If data is immediately available (even less than size), EOF is + * reached or an error occurs (including EINTR), return immediately. + * Otherwise: + * In non-blocking mode, return AVERROR(EAGAIN) immediately. + * In blocking mode, wait for data/EOF/error with a short timeout (0.1s), + * and return AVERROR(EAGAIN) on timeout. + * Checking interrupt_callback, looping on EINTR and EAGAIN and until + * enough data has been read is left to the calling function; see + * retry_transfer_wrapper in avio.c. + */ + int (*url_read)( URLContext *h, unsigned char *buf, int size); + int (*url_write)(URLContext *h, const unsigned char *buf, int size); + int64_t (*url_seek)( URLContext *h, int64_t pos, int whence); + int (*url_close)(URLContext *h); + int (*url_read_pause)(void *urlcontext, int pause); + int64_t (*url_read_seek)(void *urlcontext, int stream_index, + int64_t timestamp, int flags); + int (*url_get_file_handle)(URLContext *h); + int (*url_get_multi_file_handle)(URLContext *h, int **handles, + int *numhandles); + int (*url_get_short_seek)(URLContext *h); + int (*url_shutdown)(URLContext *h, int flags); + const AVClass *priv_data_class; + int priv_data_size; + int flags; + int (*url_check)(URLContext *h, int mask); + int (*url_open_dir)(URLContext *h); + int (*url_read_dir)(URLContext *h, AVIODirEntry **next); + int (*url_close_dir)(URLContext *h); + int (*url_delete)(URLContext *h); + int (*url_move)(URLContext *h_src, URLContext *h_dst); + const char *default_whitelist; +} URLProtocol; + +/** + * Create a URLContext for accessing to the resource indicated by + * url, but do not initiate the connection yet. + * + * @param puc pointer to the location where, in case of success, the + * function puts the pointer to the created URLContext + * @param flags flags which control how the resource indicated by url + * is to be opened + * @param int_cb interrupt callback to use for the URLContext, may be + * NULL + * @return >= 0 in case of success, a negative value corresponding to an + * AVERROR code in case of failure + */ +int ffurl_alloc(URLContext **puc, const char *filename, int flags, + const AVIOInterruptCB *int_cb); + +/** + * Connect an URLContext that has been allocated by ffurl_alloc + * + * @param options A dictionary filled with options for nested protocols, + * i.e. it will be passed to url_open2() for protocols implementing it. + * This parameter will be destroyed and replaced with a dict containing options + * that were not found. May be NULL. + */ +int ffurl_connect(URLContext *uc, AVDictionary **options); + +/** + * Create an URLContext for accessing to the resource indicated by + * url, and open it. + * + * @param puc pointer to the location where, in case of success, the + * function puts the pointer to the created URLContext + * @param flags flags which control how the resource indicated by url + * is to be opened + * @param int_cb interrupt callback to use for the URLContext, may be + * NULL + * @param options A dictionary filled with protocol-private options. On return + * this parameter will be destroyed and replaced with a dict containing options + * that were not found. May be NULL. + * @param parent An enclosing URLContext, whose generic options should + * be applied to this URLContext as well. + * @return >= 0 in case of success, a negative value corresponding to an + * AVERROR code in case of failure + */ +int ffurl_open_whitelist(URLContext **puc, const char *filename, int flags, + const AVIOInterruptCB *int_cb, AVDictionary **options, + const char *whitelist, const char* blacklist, + URLContext *parent); + +/** + * Accept an URLContext c on an URLContext s + * + * @param s server context + * @param c client context, must be unallocated. + * @return >= 0 on success, ff_neterrno() on failure. + */ +int ffurl_accept(URLContext *s, URLContext **c); + +/** + * Perform one step of the protocol handshake to accept a new client. + * See avio_handshake() for details. + * Implementations should try to return decreasing values. + * If the protocol uses an underlying protocol, the underlying handshake is + * usually the first step, and the return value can be: + * (largest value for this protocol) + (return value from other protocol) + * + * @param c the client context + * @return >= 0 on success or a negative value corresponding + * to an AVERROR code on failure + */ +int ffurl_handshake(URLContext *c); + +int ffurl_read2(void *urlcontext, uint8_t *buf, int size); +/** + * Read up to size bytes from the resource accessed by h, and store + * the read bytes in buf. + * + * @return The number of bytes actually read, or a negative value + * corresponding to an AVERROR code in case of error. A value of zero + * indicates that it is not possible to read more from the accessed + * resource (except if the value of the size argument is also zero). + */ +static inline int ffurl_read(URLContext *h, uint8_t *buf, int size) +{ + return ffurl_read2(h, buf, size); +} + +/** + * Read as many bytes as possible (up to size), calling the + * read function multiple times if necessary. + * This makes special short-read handling in applications + * unnecessary, if the return value is < size then it is + * certain there was either an error or the end of file was reached. + */ +int ffurl_read_complete(URLContext *h, unsigned char *buf, int size); + +int ffurl_write2(void *urlcontext, const uint8_t *buf, int size); +/** + * Write size bytes from buf to the resource accessed by h. + * + * @return the number of bytes actually written, or a negative value + * corresponding to an AVERROR code in case of failure + */ +static inline int ffurl_write(URLContext *h, const uint8_t *buf, int size) +{ + return ffurl_write2(h, buf, size); +} + +int64_t ffurl_seek2(void *urlcontext, int64_t pos, int whence); +/** + * Change the position that will be used by the next read/write + * operation on the resource accessed by h. + * + * @param pos specifies the new position to set + * @param whence specifies how pos should be interpreted, it must be + * one of SEEK_SET (seek from the beginning), SEEK_CUR (seek from the + * current position), SEEK_END (seek from the end), or AVSEEK_SIZE + * (return the filesize of the requested resource, pos is ignored). + * @return a negative value corresponding to an AVERROR code in case + * of failure, or the resulting file position, measured in bytes from + * the beginning of the file. You can use this feature together with + * SEEK_CUR to read the current file position. + */ +static inline int64_t ffurl_seek(URLContext *h, int64_t pos, int whence) +{ + return ffurl_seek2(h, pos, whence); +} + +/** + * Close the resource accessed by the URLContext h, and free the + * memory used by it. Also set the URLContext pointer to NULL. + * + * @return a negative value if an error condition occurred, 0 + * otherwise + */ +int ffurl_closep(URLContext **h); +int ffurl_close(URLContext *h); + +/** + * Return the filesize of the resource accessed by h, AVERROR(ENOSYS) + * if the operation is not supported by h, or another negative value + * corresponding to an AVERROR error code in case of failure. + */ +int64_t ffurl_size(URLContext *h); + +/** + * Return the file descriptor associated with this URL. For RTP, this + * will return only the RTP file descriptor, not the RTCP file descriptor. + * + * @return the file descriptor associated with this URL, or <0 on error. + */ +int ffurl_get_file_handle(URLContext *h); + +/** + * Return the file descriptors associated with this URL. + * + * @return 0 on success or <0 on error. + */ +int ffurl_get_multi_file_handle(URLContext *h, int **handles, int *numhandles); + +/** + * Return the current short seek threshold value for this URL. + * + * @return threshold (>0) on success or <=0 on error. + */ +int ffurl_get_short_seek(void *urlcontext); + +/** + * Signal the URLContext that we are done reading or writing the stream. + * + * @param h pointer to the resource + * @param flags flags which control how the resource indicated by url + * is to be shutdown + * + * @return a negative value if an error condition occurred, 0 + * otherwise + */ +int ffurl_shutdown(URLContext *h, int flags); + +/** + * Check if the user has requested to interrupt a blocking function + * associated with cb. + */ +int ff_check_interrupt(AVIOInterruptCB *cb); + +/* udp.c */ +int ff_udp_set_remote_url(URLContext *h, const char *uri); +int ff_udp_get_local_port(URLContext *h); + +/** + * Assemble a URL string from components. This is the reverse operation + * of av_url_split. + * + * Note, this requires networking to be initialized, so the caller must + * ensure ff_network_init has been called. + * + * @see av_url_split + * + * @param str the buffer to fill with the url + * @param size the size of the str buffer + * @param proto the protocol identifier, if null, the separator + * after the identifier is left out, too + * @param authorization an optional authorization string, may be null. + * An empty string is treated the same as a null string. + * @param hostname the host name string + * @param port the port number, left out from the string if negative + * @param fmt a generic format string for everything to add after the + * host/port, may be null + * @return the number of characters written to the destination buffer + */ +int ff_url_join(char *str, int size, const char *proto, + const char *authorization, const char *hostname, + int port, const char *fmt, ...) av_printf_format(7, 8); + +/** + * Convert a relative url into an absolute url, given a base url. + * + * @param buf the buffer where output absolute url is written + * @param size the size of buf + * @param base the base url, may be equal to buf. + * @param rel the new url, which is interpreted relative to base + * @param handle_dos_paths handle DOS paths for file or unspecified protocol + */ +int ff_make_absolute_url2(char *buf, int size, const char *base, + const char *rel, int handle_dos_paths); + +/** + * Convert a relative url into an absolute url, given a base url. + * + * Same as ff_make_absolute_url2 with handle_dos_paths being equal to + * HAVE_DOS_PATHS config variable. + */ +int ff_make_absolute_url(char *buf, int size, const char *base, + const char *rel); + +/** + * Allocate directory entry with default values. + * + * @return entry or NULL on error + */ +AVIODirEntry *ff_alloc_dir_entry(void); + +const AVClass *ff_urlcontext_child_class_iterate(void **iter); + +/** + * Construct a list of protocols matching a given whitelist and/or blacklist. + * + * @param whitelist a comma-separated list of allowed protocol names or NULL. If + * this is a non-empty string, only protocols in this list will + * be included. + * @param blacklist a comma-separated list of forbidden protocol names or NULL. + * If this is a non-empty string, all protocols in this list + * will be excluded. + * + * @return a NULL-terminated array of matching protocols. The array must be + * freed by the caller. + */ +const URLProtocol **ffurl_get_protocols(const char *whitelist, + const char *blacklist); + +typedef struct URLComponents { + const char *url; /**< whole URL, for reference */ + const char *scheme; /**< possibly including lavf-specific options */ + const char *authority; /**< "//" if it is a real URL */ + const char *userinfo; /**< including final '@' if present */ + const char *host; + const char *port; /**< including initial ':' if present */ + const char *path; + const char *query; /**< including initial '?' if present */ + const char *fragment; /**< including initial '#' if present */ + const char *end; +} URLComponents; + +#define url_component_end_scheme authority +#define url_component_end_authority userinfo +#define url_component_end_userinfo host +#define url_component_end_host port +#define url_component_end_port path +#define url_component_end_path query +#define url_component_end_query fragment +#define url_component_end_fragment end +#define url_component_end_authority_full path + +#define URL_COMPONENT_HAVE(uc, component) \ + ((uc).url_component_end_##component > (uc).component) + +/** + * Parse an URL to find the components. + * + * Each component runs until the start of the next component, + * possibly including a mandatory delimiter. + * + * @param uc structure to fill with pointers to the components. + * @param url URL to parse. + * @param end end of the URL, or NULL to parse to the end of string. + * + * @return >= 0 for success or an AVERROR code, especially if the URL is + * malformed. + */ +int ff_url_decompose(URLComponents *uc, const char *url, const char *end); + +/** + * Move or rename a resource. + * + * @note url_src and url_dst should share the same protocol and authority. + * + * @param url_src url to resource to be moved + * @param url_dst new url to resource if the operation succeeded + * @return >=0 on success or negative on error. + */ +int ffurl_move(const char *url_src, const char *url_dst); + +/** + * Delete a resource. + * + * @param url resource to be deleted. + * @return >=0 on success or negative on error. + */ +int ffurl_delete(const char *url); + +#endif /* AVFORMAT_URL_H */ diff --git a/include/libavformat/urldecode.h b/include/libavformat/urldecode.h new file mode 100644 index 0000000..80b11c3 --- /dev/null +++ b/include/libavformat/urldecode.h @@ -0,0 +1,36 @@ +/* + * 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 AVFORMAT_URLDECODE_H +#define AVFORMAT_URLDECODE_H + +/** + * Decodes an URL from its percent-encoded form back into normal + * representation. This function returns the decoded URL in a string. + * The URL to be decoded does not necessarily have to be encoded but + * in that case the original string is duplicated. + * + * @param url a string to be decoded. + * @param decode_plus_sign if nonzero plus sign is decoded to space + * @return new string with the URL decoded or NULL if decoding failed. + * Note that the returned string should be explicitly freed when not + * used anymore. + */ +char *ff_urldecode(const char *url, int decode_plus_sign); + +#endif /* AVFORMAT_URLDECODE_H */ diff --git a/include/libavformat/version.h b/include/libavformat/version.h index b234218..70c554c 100755 --- a/include/libavformat/version.h +++ b/include/libavformat/version.h @@ -31,7 +31,7 @@ #include "version_major.h" -#define LIBAVFORMAT_VERSION_MINOR 27 +#define LIBAVFORMAT_VERSION_MINOR 7 #define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ diff --git a/include/libavformat/version_major.h b/include/libavformat/version_major.h index 5f71298..7a9b067 100644 --- a/include/libavformat/version_major.h +++ b/include/libavformat/version_major.h @@ -29,7 +29,7 @@ // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium) // Also please add any ticket numbers that you believe might be affected here -#define LIBAVFORMAT_VERSION_MAJOR 59 +#define LIBAVFORMAT_VERSION_MAJOR 61 /** * FF_API_* defines may be placed below to indicate public API that will be @@ -41,12 +41,13 @@ * at once through the bump. This improves the git bisect-ability of the change. * */ -#define FF_API_LAVF_PRIV_OPT (LIBAVFORMAT_VERSION_MAJOR < 60) -#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 60) -#define FF_API_AVIOCONTEXT_WRITTEN (LIBAVFORMAT_VERSION_MAJOR < 60) -#define FF_HLS_TS_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 60) -#define FF_API_AVSTREAM_CLASS (LIBAVFORMAT_VERSION_MAJOR > 59) +#define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 62) +#define FF_API_LAVF_SHORTEST (LIBAVFORMAT_VERSION_MAJOR < 62) +#define FF_API_ALLOW_FLUSH (LIBAVFORMAT_VERSION_MAJOR < 62) +#define FF_API_AVSTREAM_SIDE_DATA (LIBAVFORMAT_VERSION_MAJOR < 62) +#define FF_API_GET_DUR_ESTIMATE_METHOD (LIBAVFORMAT_VERSION_MAJOR < 62) +#define FF_API_INTERNAL_TIMING (LIBAVFORMAT_VERSION_MAJOR < 62) #define FF_API_R_FRAME_RATE 1 diff --git a/include/libavformat/voc.h b/include/libavformat/voc.h new file mode 100644 index 0000000..1fc6bb4 --- /dev/null +++ b/include/libavformat/voc.h @@ -0,0 +1,53 @@ +/* + * Creative Voice File demuxer. + * Copyright (c) 2006 Aurelien Jacobs + * + * 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 AVFORMAT_VOC_H +#define AVFORMAT_VOC_H + +#include "avformat.h" +#include "internal.h" + +typedef struct voc_dec_context { + int64_t remaining_size; + int64_t pts; +} VocDecContext; + +typedef enum voc_type { + VOC_TYPE_EOF = 0x00, + VOC_TYPE_VOICE_DATA = 0x01, + VOC_TYPE_VOICE_DATA_CONT = 0x02, + VOC_TYPE_SILENCE = 0x03, + VOC_TYPE_MARKER = 0x04, + VOC_TYPE_ASCII = 0x05, + VOC_TYPE_REPETITION_START = 0x06, + VOC_TYPE_REPETITION_END = 0x07, + VOC_TYPE_EXTENDED = 0x08, + VOC_TYPE_NEW_VOICE_DATA = 0x09, +} VocType; + +extern const unsigned char ff_voc_magic[21]; +extern const AVCodecTag ff_voc_codec_tags[]; +extern const AVCodecTag *const ff_voc_codec_tags_list[]; + +int ff_voc_get_packet(AVFormatContext *s, AVPacket *pkt, + AVStream *st, int max_size); + +#endif /* AVFORMAT_VOC_H */ diff --git a/include/libavformat/vorbiscomment.h b/include/libavformat/vorbiscomment.h new file mode 100644 index 0000000..7cacd0b --- /dev/null +++ b/include/libavformat/vorbiscomment.h @@ -0,0 +1,57 @@ +/* + * VorbisComment writer + * Copyright (c) 2009 James Darnley + * + * 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 AVFORMAT_VORBISCOMMENT_H +#define AVFORMAT_VORBISCOMMENT_H + +#include "avformat.h" +#include "metadata.h" + +/** + * Calculate the length in bytes of a VorbisComment. This is the minimum + * size required by ff_vorbiscomment_write(). + * + * @param m The metadata structure to be parsed. For no metadata, set to NULL. + * @param vendor_string The vendor string to be added into the VorbisComment. + * For no string, set to an empty string. + * @return The length in bytes. + */ +int64_t ff_vorbiscomment_length(const AVDictionary *m, const char *vendor_string, + AVChapter **chapters, unsigned int nb_chapters); + +/** + * Write a VorbisComment into an AVIOContext. The output size can be obtained + * in advance by passing the same chapters, AVDictionary and vendor_string to + * ff_vorbiscomment_length() + * + * @param pb The AVIOContext to write the output. + * @param m The metadata struct to write. + * @param vendor_string The vendor string to write. + * @param chapters The chapters to write. + * @param nb_chapters The number of chapters to write. + */ +int ff_vorbiscomment_write(AVIOContext *pb, const AVDictionary *m, + const char *vendor_string, + AVChapter **chapters, unsigned int nb_chapters); + +extern const AVMetadataConv ff_vorbiscomment_metadata_conv[]; + +#endif /* AVFORMAT_VORBISCOMMENT_H */ diff --git a/include/libavformat/vpcc.h b/include/libavformat/vpcc.h new file mode 100644 index 0000000..bad38c5 --- /dev/null +++ b/include/libavformat/vpcc.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2016 Google Inc. + * Copyright (c) 2016 KongQun Yang (kqyang@google.com) + * + * 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 + */ + +/** + * @file + * internal header for VPx codec configuration utilities. + */ + +#ifndef AVFORMAT_VPCC_H +#define AVFORMAT_VPCC_H + +#include "libavutil/rational.h" +#include "libavcodec/codec_par.h" +#include "avio.h" +#include "avformat.h" + +typedef struct VPCC { + int profile; + int level; + int bitdepth; + int chroma_subsampling; + int full_range_flag; +} VPCC; + +/** + * Writes VP codec configuration to the provided AVIOContext. + * + * @param s address of the AVFormatContext for the logging context. + * @param pb address of the AVIOContext where the vpcC shall be written. + * @param data address of a data array which contains coded bitstream data from + * which codec information can be extracted. May be NULL. + * @param len length of the data array. + * @param par address of the AVCodecParameters which contains codec information. + * @return >=0 in case of success, a negative value corresponding to an AVERROR + * code in case of failure + */ +int ff_isom_write_vpcc(AVFormatContext *s, AVIOContext *pb, + const uint8_t *data, int len, + AVCodecParameters *par); + +int ff_isom_get_vpcc_features(AVFormatContext *s, AVCodecParameters *par, + const uint8_t *data, int len, + AVRational *frame_rate, VPCC *vpcc); + +#endif /* AVFORMAT_VPCC_H */ diff --git a/include/libavformat/vvc.h b/include/libavformat/vvc.h new file mode 100644 index 0000000..11c7005 --- /dev/null +++ b/include/libavformat/vvc.h @@ -0,0 +1,99 @@ +/* + * H.266 / VVC helper functions for muxers + * + * 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 + */ + +/** + * @file + * internal header for H.266/VVC (de)muxer utilities + */ + +#ifndef AVFORMAT_VVC_H +#define AVFORMAT_VVC_H + +#include +#include "avio.h" + +/** + * Writes Annex B formatted H.266/VVC NAL units to the provided AVIOContext. + * + * The NAL units are converted to an MP4-compatible format (start code prefixes + * are replaced by 4-byte size fields, as per ISO/IEC 14496-15). + * + * If filter_ps is non-zero, any VVC parameter sets found in the input will be + * discarded, and *ps_count will be set to the number of discarded PS NAL units. + * + * @param pb address of the AVIOContext where the data shall be written + * @param buf_in address of the buffer holding the input data + * @param size size (in bytes) of the input buffer + * @param filter_ps whether to write parameter set NAL units to the output (0) + * or to discard them (non-zero) + * @param ps_count address of the variable where the number of discarded + * parameter set NAL units shall be written, may be NULL + * @return the amount (in bytes) of data written in case of success, a negative + * value corresponding to an AVERROR code in case of failure + */ +int ff_vvc_annexb2mp4(AVIOContext *pb, const uint8_t *buf_in, + int size, int filter_ps, int *ps_count); + +/** + * Writes Annex B formatted H.266/VVC NAL units to a data buffer. + * + * The NAL units are converted to an MP4-compatible format (start code prefixes + * are replaced by 4-byte size fields, as per ISO/IEC 14496-15). + * + * If filter_ps is non-zero, any VVC parameter sets found in the input will be + * discarded, and *ps_count will be set to the number of discarded PS NAL units. + * + * On success, *size holds the size (in bytes) of the output data buffer. + * + * @param buf_in address of the buffer holding the input data + * @param size address of the variable holding the size (in bytes) of the input + * buffer (on input) and of the output buffer (on success) + * @param buf_out on success, address of the variable holding the address of + * the output buffer + * @param filter_ps whether to write parameter set NAL units to the output (0) + * or to discard them (non-zero) + * @param ps_count address of the variable where the number of discarded + * parameter set NAL units shall be written, may be NULL + * @return 0 in case of success, a negative value corresponding to an AVERROR + * code in case of failure + * @note *buf_out will be treated as uninitialized on input and won't be freed. + */ +int ff_vvc_annexb2mp4_buf(const uint8_t *buf_in, uint8_t **buf_out, + int *size, int filter_ps, int *ps_count); + +/** + * Writes H.266/VVC extradata (parameter sets, declarative SEI NAL units) to + * the provided AVIOContext. + * + * If the extradata is Annex B format, it gets converted to vvcC format before + * writing. + * + * @param pb address of the AVIOContext where the vvcC shall be written + * @param data address of the buffer holding the data needed to write the vvcC + * @param size size (in bytes) of the data buffer + * @param ps_array_completeness whether all parameter sets are in the vvcC (1) + * or there may be additional parameter sets in the bitstream (0) + * @return >=0 in case of success, a negative value corresponding to an AVERROR + * code in case of failure + */ +int ff_isom_write_vvcc(AVIOContext *pb, const uint8_t *data, + int size, int ps_array_completeness); + +#endif /* AVFORMAT_VVC_H */ diff --git a/include/libavformat/w64.h b/include/libavformat/w64.h new file mode 100644 index 0000000..0ec3fa9 --- /dev/null +++ b/include/libavformat/w64.h @@ -0,0 +1,31 @@ +/* + * 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 AVFORMAT_W64_H +#define AVFORMAT_W64_H + +#include + +extern const uint8_t ff_w64_guid_riff[16]; +extern const uint8_t ff_w64_guid_wave[16]; +extern const uint8_t ff_w64_guid_fmt [16]; +extern const uint8_t ff_w64_guid_fact[16]; +extern const uint8_t ff_w64_guid_data[16]; +extern const uint8_t ff_w64_guid_summarylist[16]; + +#endif /* AVFORMAT_W64_H */ diff --git a/include/libavformat/wtv.h b/include/libavformat/wtv.h new file mode 100644 index 0000000..f26ad5e --- /dev/null +++ b/include/libavformat/wtv.h @@ -0,0 +1,60 @@ +/* + * Windows Television (WTV) + * Copyright (c) 2010-2011 Peter Ross + * + * 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 AVFORMAT_WTV_H +#define AVFORMAT_WTV_H + +#include "riff.h" +#include "asf.h" + +#define WTV_SECTOR_BITS 12 +#define WTV_SECTOR_SIZE (1 << WTV_SECTOR_BITS) +#define WTV_BIGSECTOR_BITS 18 +#define WTV_PAD8(x) (((x) + 7) & ~7) + +extern const uint8_t ff_timeline_le16[16]; +extern const uint8_t ff_timeline_table_0_entries_Events_le16[62]; +extern const uint8_t ff_table_0_entries_legacy_attrib_le16[58]; +extern const uint8_t ff_table_0_entries_time_le16[40]; + +extern const ff_asf_guid ff_dir_entry_guid; +extern const ff_asf_guid ff_wtv_guid; +extern const ff_asf_guid ff_timestamp_guid; +extern const ff_asf_guid ff_data_guid; +extern const ff_asf_guid ff_SBE2_STREAM_DESC_EVENT; +extern const ff_asf_guid ff_stream1_guid; +extern const ff_asf_guid ff_sync_guid; +extern const ff_asf_guid ff_index_guid; +extern const ff_asf_guid ff_mediatype_audio; +extern const ff_asf_guid ff_mediatype_video; +extern const ff_asf_guid ff_format_none; +extern const AVCodecGuid ff_video_guids[]; + +extern const ff_asf_guid ff_DSATTRIB_TRANSPORT_PROPERTIES; +extern const ff_asf_guid ff_metadata_guid; +extern const ff_asf_guid ff_stream2_guid; +extern const ff_asf_guid ff_mediasubtype_cpfilters_processed; +extern const ff_asf_guid ff_format_cpfilters_processed; +extern const ff_asf_guid ff_format_waveformatex; +extern const ff_asf_guid ff_format_mpeg2_video; +extern const ff_asf_guid ff_format_videoinfo2; + +#endif /* AVFORMAT_WTV_H */ diff --git a/include/libavformat/wv.h b/include/libavformat/wv.h new file mode 100644 index 0000000..07d2e1b --- /dev/null +++ b/include/libavformat/wv.h @@ -0,0 +1,56 @@ +/* + * WavPack shared functions + * + * 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 AVFORMAT_WV_H +#define AVFORMAT_WV_H + +#include + +#define WV_HEADER_SIZE 32 + +#define WV_FLAG_INITIAL_BLOCK (1 << 11) +#define WV_FLAG_FINAL_BLOCK (1 << 12) + +// specs say that maximum block size is 1Mb +#define WV_BLOCK_LIMIT 1048576 + +typedef struct WvHeader { + uint32_t blocksize; //< size of the block data (excluding the header) + uint16_t version; //< bitstream version + uint32_t total_samples; //< total number of samples in the stream + uint32_t block_idx; //< index of the first sample in this block + uint32_t samples; //< number of samples in this block + uint32_t flags; + uint32_t crc; + + int initial, final; +} WvHeader; + +/** + * Parse a WavPack block header. + * + * @param wv this struct will be filled with parse header information + * @param data header data, must be WV_HEADER_SIZE bytes long + * + * @return 0 on success, a negative AVERROR code on failure + */ +int ff_wv_parse_header(WvHeader *wv, const uint8_t *data); + +#endif /* AVFORMAT_WV_H */ diff --git a/include/libavformat/yuv4mpeg.h b/include/libavformat/yuv4mpeg.h new file mode 100644 index 0000000..eba7337 --- /dev/null +++ b/include/libavformat/yuv4mpeg.h @@ -0,0 +1,28 @@ +/* + * YUV4MPEG common definitions + * + * 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 AVFORMAT_YUV4MPEG_H +#define AVFORMAT_YUV4MPEG_H + +#define Y4M_MAGIC "YUV4MPEG2" +#define Y4M_FRAME_MAGIC "FRAME" +#define Y4M_FRAME_MAGIC_LEN 6 + +#endif /* AVFORMAT_YUV4MPEG_H */ diff --git a/include/libavutil/aes.h b/include/libavutil/aes.h index d243286..4e73473 100755 --- a/include/libavutil/aes.h +++ b/include/libavutil/aes.h @@ -42,6 +42,9 @@ struct AVAES *av_aes_alloc(void); /** * Initialize an AVAES context. + * + * @param a The AVAES context + * @param key Pointer to the key * @param key_bits 128, 192 or 256 * @param decrypt 0 for encryption, 1 for decryption */ @@ -49,9 +52,11 @@ int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt); /** * Encrypt or decrypt a buffer using a previously initialized context. - * @param count number of 16 byte blocks + * + * @param a The AVAES context * @param dst destination array, can be equal to src * @param src source array, can be equal to dst + * @param count number of 16 byte blocks * @param iv initialization vector for CBC mode, if NULL then ECB will be used * @param decrypt 0 for encryption, 1 for decryption */ diff --git a/include/libavutil/aes_ctr.h b/include/libavutil/aes_ctr.h index 4e9fda7..d98c071 100755 --- a/include/libavutil/aes_ctr.h +++ b/include/libavutil/aes_ctr.h @@ -22,6 +22,12 @@ #ifndef AVUTIL_AES_CTR_H #define AVUTIL_AES_CTR_H +/** + * @defgroup lavu_aes_ctr AES-CTR + * @ingroup lavu_crypto + * @{ + */ + #include #include "attributes.h" @@ -38,17 +44,23 @@ struct AVAESCTR *av_aes_ctr_alloc(void); /** * Initialize an AVAESCTR context. + * + * @param a The AVAESCTR context to initialize * @param key encryption key, must have a length of AES_CTR_KEY_SIZE */ int av_aes_ctr_init(struct AVAESCTR *a, const uint8_t *key); /** * Release an AVAESCTR context. + * + * @param a The AVAESCTR context */ void av_aes_ctr_free(struct AVAESCTR *a); /** * Process a buffer using a previously initialized context. + * + * @param a The AVAESCTR context * @param dst destination array, can be equal to src * @param src source array, can be equal to dst * @param size the size of src and dst diff --git a/include/libavutil/aes_internal.h b/include/libavutil/aes_internal.h new file mode 100644 index 0000000..c9d6c24 --- /dev/null +++ b/include/libavutil/aes_internal.h @@ -0,0 +1,43 @@ +/* + * copyright (c) 2015 rcombs + * + * 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 AVUTIL_AES_INTERNAL_H +#define AVUTIL_AES_INTERNAL_H + +#include "mem_internal.h" +#include + +typedef union { + uint64_t u64[2]; + uint32_t u32[4]; + uint8_t u8x4[4][4]; + uint8_t u8[16]; +} av_aes_block; + +typedef struct AVAES { + // Note: round_key[16] is accessed in the init code, but this only + // overwrites state, which does not matter (see also commit ba554c0). + DECLARE_ALIGNED(16, av_aes_block, round_key)[15]; + DECLARE_ALIGNED(16, av_aes_block, state)[2]; + int rounds; + void (*crypt)(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int rounds); +} AVAES; + +#endif /* AVUTIL_AES_INTERNAL_H */ diff --git a/include/libavutil/ambient_viewing_environment.h b/include/libavutil/ambient_viewing_environment.h new file mode 100644 index 0000000..e5e4ac2 --- /dev/null +++ b/include/libavutil/ambient_viewing_environment.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2023 Jan Ekström + * + * 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 AVUTIL_AMBIENT_VIEWING_ENVIRONMENT_H +#define AVUTIL_AMBIENT_VIEWING_ENVIRONMENT_H + +#include +#include "frame.h" +#include "rational.h" + +/** + * Ambient viewing environment metadata as defined by H.274. The values are + * saved in AVRationals so that they keep their exactness, while allowing for + * easy access to a double value with f.ex. av_q2d. + * + * @note sizeof(AVAmbientViewingEnvironment) is not part of the public ABI, and + * it must be allocated using av_ambient_viewing_environment_alloc. + */ +typedef struct AVAmbientViewingEnvironment { + /** + * Environmental illuminance of the ambient viewing environment in lux. + */ + AVRational ambient_illuminance; + + /** + * Normalized x chromaticity coordinate of the environmental ambient light + * in the nominal viewing environment according to the CIE 1931 definition + * of x and y as specified in ISO/CIE 11664-1. + */ + AVRational ambient_light_x; + + /** + * Normalized y chromaticity coordinate of the environmental ambient light + * in the nominal viewing environment according to the CIE 1931 definition + * of x and y as specified in ISO/CIE 11664-1. + */ + AVRational ambient_light_y; +} AVAmbientViewingEnvironment; + +/** + * Allocate an AVAmbientViewingEnvironment structure. + * + * @return the newly allocated struct or NULL on failure + */ +AVAmbientViewingEnvironment *av_ambient_viewing_environment_alloc(size_t *size); + +/** + * Allocate and add an AVAmbientViewingEnvironment structure to an existing + * AVFrame as side data. + * + * @return the newly allocated struct, or NULL on failure + */ +AVAmbientViewingEnvironment *av_ambient_viewing_environment_create_side_data(AVFrame *frame); + +#endif /* AVUTIL_AMBIENT_VIEWING_ENVIRONMENT_H */ diff --git a/include/libavutil/attributes_internal.h b/include/libavutil/attributes_internal.h new file mode 100644 index 0000000..3df1ee6 --- /dev/null +++ b/include/libavutil/attributes_internal.h @@ -0,0 +1,34 @@ +/* + * 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 AVUTIL_ATTRIBUTES_INTERNAL_H +#define AVUTIL_ATTRIBUTES_INTERNAL_H + +#include "attributes.h" + +#if (AV_GCC_VERSION_AT_LEAST(4,0) || defined(__clang__)) && (defined(__ELF__) || defined(__MACH__)) +# define attribute_visibility_hidden __attribute__((visibility("hidden"))) +# define FF_VISIBILITY_PUSH_HIDDEN _Pragma("GCC visibility push(hidden)") +# define FF_VISIBILITY_POP_HIDDEN _Pragma("GCC visibility pop") +#else +# define attribute_visibility_hidden +# define FF_VISIBILITY_PUSH_HIDDEN +# define FF_VISIBILITY_POP_HIDDEN +#endif + +#endif /* AVUTIL_ATTRIBUTES_INTERNAL_H */ diff --git a/include/libavutil/audio_fifo.h b/include/libavutil/audio_fifo.h index d1e4c85..fa5f59a 100755 --- a/include/libavutil/audio_fifo.h +++ b/include/libavutil/audio_fifo.h @@ -91,7 +91,7 @@ int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples); * code on failure. If successful, the number of samples * actually written will always be nb_samples. */ -int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples); +int av_audio_fifo_write(AVAudioFifo *af, void * const *data, int nb_samples); /** * Peek data from an AVAudioFifo. @@ -107,7 +107,7 @@ int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples); * be greater than nb_samples, and will only be less than * nb_samples if av_audio_fifo_size is less than nb_samples. */ -int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples); +int av_audio_fifo_peek(const AVAudioFifo *af, void * const *data, int nb_samples); /** * Peek data from an AVAudioFifo. @@ -124,7 +124,8 @@ int av_audio_fifo_peek(AVAudioFifo *af, void **data, int nb_samples); * be greater than nb_samples, and will only be less than * nb_samples if av_audio_fifo_size is less than nb_samples. */ -int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offset); +int av_audio_fifo_peek_at(const AVAudioFifo *af, void * const *data, + int nb_samples, int offset); /** * Read data from an AVAudioFifo. @@ -140,7 +141,7 @@ int av_audio_fifo_peek_at(AVAudioFifo *af, void **data, int nb_samples, int offs * be greater than nb_samples, and will only be less than * nb_samples if av_audio_fifo_size is less than nb_samples. */ -int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples); +int av_audio_fifo_read(AVAudioFifo *af, void * const *data, int nb_samples); /** * Drain data from an AVAudioFifo. diff --git a/include/libavutil/avassert.h b/include/libavutil/avassert.h index 51e462b..1895fb7 100755 --- a/include/libavutil/avassert.h +++ b/include/libavutil/avassert.h @@ -28,6 +28,9 @@ #define AVUTIL_AVASSERT_H #include +#ifdef HAVE_AV_CONFIG_H +# include "config.h" +#endif #include "log.h" #include "macros.h" diff --git a/include/libavutil/avstring.h b/include/libavutil/avstring.h index fae446c..fc09534 100755 --- a/include/libavutil/avstring.h +++ b/include/libavutil/avstring.h @@ -24,7 +24,6 @@ #include #include #include "attributes.h" -#include "version.h" /** * @addtogroup lavu_string @@ -135,6 +134,7 @@ size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...) av_printf_forma /** * Get the count of continuous non zero chars starting from the beginning. * + * @param s the string whose length to count * @param len maximum number of characters to check in the string, that * is the maximum value which is returned by the function */ @@ -156,15 +156,6 @@ static inline size_t av_strnlen(const char *s, size_t len) */ char *av_asprintf(const char *fmt, ...) av_printf_format(1, 2); -#if FF_API_D2STR -/** - * Convert a number to an av_malloced string. - * @deprecated use av_asprintf() with "%f" or a more specific format - */ -attribute_deprecated -char *av_d2str(double d); -#endif - /** * Unescape the given string until a non escaped terminating char, * and return the token corresponding to the unescaped string. @@ -273,7 +264,7 @@ int av_strncasecmp(const char *a, const char *b, size_t n); /** * Locale-independent strings replace. - * @note This means only ASCII-range characters are replace + * @note This means only ASCII-range characters are replaced. */ char *av_strireplace(const char *str, const char *from, const char *to); diff --git a/include/libavutil/avutil.h b/include/libavutil/avutil.h index 64b68bd..d2900dc 100755 --- a/include/libavutil/avutil.h +++ b/include/libavutil/avutil.h @@ -257,7 +257,12 @@ const char *av_get_media_type_string(enum AVMediaType media_type); * Internal time base represented as fractional value */ +#ifdef __cplusplus +/* ISO C++ forbids compound-literals. */ +#define AV_TIME_BASE_Q av_make_q(1, AV_TIME_BASE) +#else #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE} +#endif /** * @} @@ -294,7 +299,6 @@ char av_get_picture_type_char(enum AVPictureType pict_type); */ #include "common.h" -#include "error.h" #include "rational.h" #include "version.h" #include "macros.h" @@ -331,19 +335,6 @@ unsigned av_int_list_length_for_size(unsigned elsize, #define av_int_list_length(list, term) \ av_int_list_length_for_size(sizeof(*(list)), list, term) -#if FF_API_AV_FOPEN_UTF8 -/** - * Open a file using a UTF-8 filename. - * The API of this function matches POSIX fopen(), errors are returned through - * errno. - * @deprecated Avoid using it, as on Windows, the FILE* allocated by this - * function may be allocated with a different CRT than the caller - * who uses the FILE*. No replacement provided in public API. - */ -attribute_deprecated -FILE *av_fopen_utf8(const char *path, const char *mode); -#endif - /** * Return the fractional representation of the internal time base. */ diff --git a/include/libavutil/bprint.h b/include/libavutil/bprint.h index c09b1ac..4ac8570 100755 --- a/include/libavutil/bprint.h +++ b/include/libavutil/bprint.h @@ -18,6 +18,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +/** + * @file + * @ingroup lavu_avbprint + * AVBPrint public header + */ + #ifndef AVUTIL_BPRINT_H #define AVUTIL_BPRINT_H @@ -26,6 +32,14 @@ #include "attributes.h" #include "avstring.h" +/** + * @defgroup lavu_avbprint AVBPrint + * @ingroup lavu_data + * + * A buffer to print data progressively + * @{ + */ + /** * Define a structure with extra padding to a fixed size * This helps ensuring binary compatibility with future versions. @@ -48,14 +62,14 @@ typedef struct name { \ * Small buffers are kept in the structure itself, and thus require no * memory allocation at all (unless the contents of the buffer is needed * after the structure goes out of scope). This is almost as lightweight as - * declaring a local "char buf[512]". + * declaring a local `char buf[512]`. * * The length of the string can go beyond the allocated size: the buffer is * then truncated, but the functions still keep account of the actual total * length. * - * In other words, buf->len can be greater than buf->size and records the - * total length of what would have been to the buffer if there had been + * In other words, AVBPrint.len can be greater than AVBPrint.size and records + * the total length of what would have been to the buffer if there had been * enough memory. * * Append operations do not need to be tested for failure: if a memory @@ -63,20 +77,17 @@ typedef struct name { \ * is still updated. This situation can be tested with * av_bprint_is_complete(). * - * The size_max field determines several possible behaviours: - * - * size_max = -1 (= UINT_MAX) or any large value will let the buffer be - * reallocated as necessary, with an amortized linear cost. - * - * size_max = 0 prevents writing anything to the buffer: only the total - * length is computed. The write operations can then possibly be repeated in - * a buffer with exactly the necessary size - * (using size_init = size_max = len + 1). - * - * size_max = 1 is automatically replaced by the exact size available in the - * structure itself, thus ensuring no dynamic memory allocation. The - * internal buffer is large enough to hold a reasonable paragraph of text, - * such as the current paragraph. + * The AVBPrint.size_max field determines several possible behaviours: + * - `size_max = -1` (= `UINT_MAX`) or any large value will let the buffer be + * reallocated as necessary, with an amortized linear cost. + * - `size_max = 0` prevents writing anything to the buffer: only the total + * length is computed. The write operations can then possibly be repeated in + * a buffer with exactly the necessary size + * (using `size_init = size_max = len + 1`). + * - `size_max = 1` is automatically replaced by the exact size available in the + * structure itself, thus ensuring no dynamic memory allocation. The + * internal buffer is large enough to hold a reasonable paragraph of text, + * such as the current paragraph. */ FF_PAD_STRUCTURE(AVBPrint, 1024, @@ -88,12 +99,31 @@ FF_PAD_STRUCTURE(AVBPrint, 1024, ) /** + * @name Max size special values * Convenience macros for special values for av_bprint_init() size_max * parameter. + * @{ + */ + +/** + * Buffer will be reallocated as necessary, with an amortized linear cost. */ #define AV_BPRINT_SIZE_UNLIMITED ((unsigned)-1) +/** + * Use the exact size available in the AVBPrint structure itself. + * + * Thus ensuring no dynamic memory allocation. The internal buffer is large + * enough to hold a reasonable paragraph of text, such as the current paragraph. + */ #define AV_BPRINT_SIZE_AUTOMATIC 1 +/** + * Do not write anything to the buffer, only calculate the total length. + * + * The write operations can then possibly be repeated in a buffer with + * exactly the necessary size (using `size_init = size_max = AVBPrint.len + 1`). + */ #define AV_BPRINT_SIZE_COUNT_ONLY 0 +/** @} */ /** * Init a print buffer. @@ -101,12 +131,12 @@ FF_PAD_STRUCTURE(AVBPrint, 1024, * @param buf buffer to init * @param size_init initial size (including the final 0) * @param size_max maximum size; - * 0 means do not write anything, just count the length; - * 1 is replaced by the maximum value for automatic storage; - * any large value means that the internal buffer will be - * reallocated as needed up to that limit; -1 is converted to - * UINT_MAX, the largest limit possible. - * Check also AV_BPRINT_SIZE_* macros. + * - `0` means do not write anything, just count the length + * - `1` is replaced by the maximum value for automatic storage + * any large value means that the internal buffer will be + * reallocated as needed up to that limit + * - `-1` is converted to `UINT_MAX`, the largest limit possible. + * Check also `AV_BPRINT_SIZE_*` macros. */ void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max); @@ -114,6 +144,9 @@ void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max); * Init a print buffer using a pre-existing buffer. * * The buffer will not be reallocated. + * In case size equals zero, the AVBPrint will be initialized to use + * the internal buffer as if using AV_BPRINT_SIZE_COUNT_ONLY with + * av_bprint_init(). * * @param buf buffer structure to init * @param buffer byte buffer to use for the string data @@ -139,9 +172,9 @@ void av_bprint_chars(AVBPrint *buf, char c, unsigned n); /** * Append data to a print buffer. * - * param buf bprint buffer to use - * param data pointer to data - * param size size of data + * @param buf bprint buffer to use + * @param data pointer to data + * @param size size of data */ void av_bprint_append_data(AVBPrint *buf, const char *data, unsigned size); @@ -149,9 +182,9 @@ struct tm; /** * Append a formatted date and time to a print buffer. * - * param buf bprint buffer to use - * param fmt date and time format string, see strftime() - * param tm broken-down time structure to translate + * @param buf bprint buffer to use + * @param fmt date and time format string, see strftime() + * @param tm broken-down time structure to translate * * @note due to poor design of the standard strftime function, it may * produce poor results if the format string expands to a very long text and @@ -216,4 +249,6 @@ int av_bprint_finalize(AVBPrint *buf, char **ret_str); void av_bprint_escape(AVBPrint *dstbuf, const char *src, const char *special_chars, enum AVEscapeMode mode, int flags); +/** @} */ + #endif /* AVUTIL_BPRINT_H */ diff --git a/include/libavutil/bswap.h b/include/libavutil/bswap.h index 91cb795..f53e576 100755 --- a/include/libavutil/bswap.h +++ b/include/libavutil/bswap.h @@ -34,14 +34,10 @@ #include "config.h" -#if ARCH_AARCH64 -# include "aarch64/bswap.h" -#elif ARCH_ARM +#if ARCH_ARM # include "arm/bswap.h" -#elif ARCH_AVR32 -# include "avr32/bswap.h" -#elif ARCH_SH4 -# include "sh4/bswap.h" +#elif ARCH_RISCV +# include "riscv/bswap.h" #elif ARCH_X86 # include "x86/bswap.h" #endif diff --git a/include/libavutil/buffer_internal.h b/include/libavutil/buffer_internal.h new file mode 100644 index 0000000..adb916a --- /dev/null +++ b/include/libavutil/buffer_internal.h @@ -0,0 +1,110 @@ +/* + * 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 AVUTIL_BUFFER_INTERNAL_H +#define AVUTIL_BUFFER_INTERNAL_H + +#include +#include + +#include "buffer.h" +#include "thread.h" + +/** + * The buffer was av_realloc()ed, so it is reallocatable. + */ +#define BUFFER_FLAG_REALLOCATABLE (1 << 0) +/** + * The AVBuffer structure is part of a larger structure + * and should not be freed. + */ +#define BUFFER_FLAG_NO_FREE (1 << 1) + +struct AVBuffer { + uint8_t *data; /**< data described by this buffer */ + size_t size; /**< size of data in bytes */ + + /** + * number of existing AVBufferRef instances referring to this buffer + */ + atomic_uint refcount; + + /** + * a callback for freeing the data + */ + void (*free)(void *opaque, uint8_t *data); + + /** + * an opaque pointer, to be used by the freeing callback + */ + void *opaque; + + /** + * A combination of AV_BUFFER_FLAG_* + */ + int flags; + + /** + * A combination of BUFFER_FLAG_* + */ + int flags_internal; +}; + +typedef struct BufferPoolEntry { + uint8_t *data; + + /* + * Backups of the original opaque/free of the AVBuffer corresponding to + * data. They will be used to free the buffer when the pool is freed. + */ + void *opaque; + void (*free)(void *opaque, uint8_t *data); + + AVBufferPool *pool; + struct BufferPoolEntry *next; + + /* + * An AVBuffer structure to (re)use as AVBuffer for subsequent uses + * of this BufferPoolEntry. + */ + AVBuffer buffer; +} BufferPoolEntry; + +struct AVBufferPool { + AVMutex mutex; + BufferPoolEntry *pool; + + /* + * This is used to track when the pool is to be freed. + * The pointer to the pool itself held by the caller is considered to + * be one reference. Each buffer requested by the caller increases refcount + * by one, returning the buffer to the pool decreases it by one. + * refcount reaches zero when the buffer has been uninited AND all the + * buffers have been released, then it's safe to free the pool and all + * the buffers in it. + */ + atomic_uint refcount; + + size_t size; + void *opaque; + AVBufferRef* (*alloc)(size_t size); + AVBufferRef* (*alloc2)(void *opaque, size_t size); + void (*pool_free)(void *opaque); +}; + +#endif /* AVUTIL_BUFFER_INTERNAL_H */ diff --git a/include/libavutil/camellia.h b/include/libavutil/camellia.h index e674c9b..9678710 100755 --- a/include/libavutil/camellia.h +++ b/include/libavutil/camellia.h @@ -59,7 +59,7 @@ int av_camellia_init(struct AVCAMELLIA *ctx, const uint8_t *key, int key_bits); * @param dst destination array, can be equal to src * @param src source array, can be equal to dst * @param count number of 16 byte blocks - * @paran iv initialization vector for CBC mode, NULL for ECB mode + * @param iv initialization vector for CBC mode, NULL for ECB mode * @param decrypt 0 for encryption, 1 for decryption */ void av_camellia_crypt(struct AVCAMELLIA *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt); diff --git a/include/libavutil/channel_layout.h b/include/libavutil/channel_layout.h index 4dd6614..3a96c2d 100755 --- a/include/libavutil/channel_layout.h +++ b/include/libavutil/channel_layout.h @@ -30,11 +30,17 @@ /** * @file - * audio channel layout utility functions + * @ingroup lavu_audio_channels + * Public libavutil channel layout APIs header. */ + /** - * @addtogroup lavu_audio + * @defgroup lavu_audio_channels Audio channels + * @ingroup lavu_audio + * + * Audio channel layout utility functions + * * @{ */ @@ -73,6 +79,10 @@ enum AVChannel { AV_CHAN_BOTTOM_FRONT_CENTER, AV_CHAN_BOTTOM_FRONT_LEFT, AV_CHAN_BOTTOM_FRONT_RIGHT, + AV_CHAN_SIDE_SURROUND_LEFT, ///< +90 degrees, Lss, SiL + AV_CHAN_SIDE_SURROUND_RIGHT, ///< -90 degrees, Rss, SiR + AV_CHAN_TOP_SURROUND_LEFT, ///< +110 degrees, Lvs, TpLS + AV_CHAN_TOP_SURROUND_RIGHT, ///< -110 degrees, Rvs, TpRS /** Channel is empty can be safely skipped. */ AV_CHAN_UNUSED = 0x200, @@ -84,9 +94,9 @@ enum AVChannel { * Range of channels between AV_CHAN_AMBISONIC_BASE and * AV_CHAN_AMBISONIC_END represent Ambisonic components using the ACN system. * - * Given a channel id between AV_CHAN_AMBISONIC_BASE and - * AV_CHAN_AMBISONIC_END (inclusive), the ACN index of the channel is - * = - AV_CHAN_AMBISONIC_BASE. + * Given a channel id `` between AV_CHAN_AMBISONIC_BASE and + * AV_CHAN_AMBISONIC_END (inclusive), the ACN index of the channel `` is + * ` = - AV_CHAN_AMBISONIC_BASE`. * * @note these values are only used for AV_CHANNEL_ORDER_CUSTOM channel * orderings, the AV_CHANNEL_ORDER_AMBISONIC ordering orders the channels @@ -113,7 +123,7 @@ enum AVChannelOrder { /** * The channel order does not correspond to any other predefined order and * is stored as an explicit map. For example, this could be used to support - * layouts with 64 or more channels, or with empty/skipped (AV_CHAN_SILENCE) + * layouts with 64 or more channels, or with empty/skipped (AV_CHAN_UNUSED) * channels at arbitrary positions. */ AV_CHANNEL_ORDER_CUSTOM, @@ -140,6 +150,10 @@ enum AVChannelOrder { * as defined in AmbiX format $ 2.1. */ AV_CHANNEL_ORDER_AMBISONIC, + /** + * Number of channel orders, not part of ABI/API + */ + FF_CHANNEL_ORDER_NB }; @@ -185,16 +199,10 @@ enum AVChannelOrder { #define AV_CH_BOTTOM_FRONT_CENTER (1ULL << AV_CHAN_BOTTOM_FRONT_CENTER ) #define AV_CH_BOTTOM_FRONT_LEFT (1ULL << AV_CHAN_BOTTOM_FRONT_LEFT ) #define AV_CH_BOTTOM_FRONT_RIGHT (1ULL << AV_CHAN_BOTTOM_FRONT_RIGHT ) - -#if FF_API_OLD_CHANNEL_LAYOUT -/** Channel mask value used for AVCodecContext.request_channel_layout - to indicate that the user requests the channel order of the decoder output - to be the native codec channel order. - @deprecated channel order is now indicated in a special field in - AVChannelLayout - */ -#define AV_CH_LAYOUT_NATIVE 0x8000000000000000ULL -#endif +#define AV_CH_SIDE_SURROUND_LEFT (1ULL << AV_CHAN_SIDE_SURROUND_LEFT ) +#define AV_CH_SIDE_SURROUND_RIGHT (1ULL << AV_CHAN_SIDE_SURROUND_RIGHT ) +#define AV_CH_TOP_SURROUND_LEFT (1ULL << AV_CHAN_TOP_SURROUND_LEFT ) +#define AV_CH_TOP_SURROUND_RIGHT (1ULL << AV_CHAN_TOP_SURROUND_RIGHT ) /** * @} @@ -218,6 +226,7 @@ enum AVChannelOrder { #define AV_CH_LAYOUT_6POINT0 (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_CENTER) #define AV_CH_LAYOUT_6POINT0_FRONT (AV_CH_LAYOUT_2_2|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) #define AV_CH_LAYOUT_HEXAGONAL (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_BACK_CENTER) +#define AV_CH_LAYOUT_3POINT1POINT2 (AV_CH_LAYOUT_3POINT1|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT) #define AV_CH_LAYOUT_6POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER) #define AV_CH_LAYOUT_6POINT1_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_BACK_CENTER) #define AV_CH_LAYOUT_6POINT1_FRONT (AV_CH_LAYOUT_6POINT0_FRONT|AV_CH_LOW_FREQUENCY) @@ -226,10 +235,19 @@ enum AVChannelOrder { #define AV_CH_LAYOUT_7POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT) #define AV_CH_LAYOUT_7POINT1_WIDE (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) #define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) +#define AV_CH_LAYOUT_5POINT1POINT2_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT) #define AV_CH_LAYOUT_OCTAGONAL (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT) +#define AV_CH_LAYOUT_CUBE (AV_CH_LAYOUT_QUAD|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT) +#define AV_CH_LAYOUT_5POINT1POINT4_BACK (AV_CH_LAYOUT_5POINT1POINT2_BACK|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT) +#define AV_CH_LAYOUT_7POINT1POINT2 (AV_CH_LAYOUT_7POINT1|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT) +#define AV_CH_LAYOUT_7POINT1POINT4_BACK (AV_CH_LAYOUT_7POINT1POINT2|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT) +#define AV_CH_LAYOUT_7POINT2POINT3 (AV_CH_LAYOUT_7POINT1POINT2|AV_CH_TOP_BACK_CENTER|AV_CH_LOW_FREQUENCY_2) +#define AV_CH_LAYOUT_9POINT1POINT4_BACK (AV_CH_LAYOUT_7POINT1POINT4_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) #define AV_CH_LAYOUT_HEXADECAGONAL (AV_CH_LAYOUT_OCTAGONAL|AV_CH_WIDE_LEFT|AV_CH_WIDE_RIGHT|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT) #define AV_CH_LAYOUT_STEREO_DOWNMIX (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT) -#define AV_CH_LAYOUT_22POINT2 (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER|AV_CH_BACK_CENTER|AV_CH_LOW_FREQUENCY_2|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT|AV_CH_TOP_FRONT_LEFT|AV_CH_TOP_FRONT_RIGHT|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_CENTER|AV_CH_TOP_BACK_LEFT|AV_CH_TOP_BACK_RIGHT|AV_CH_TOP_SIDE_LEFT|AV_CH_TOP_SIDE_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_BOTTOM_FRONT_CENTER|AV_CH_BOTTOM_FRONT_LEFT|AV_CH_BOTTOM_FRONT_RIGHT) +#define AV_CH_LAYOUT_22POINT2 (AV_CH_LAYOUT_7POINT1POINT4_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER|AV_CH_BACK_CENTER|AV_CH_LOW_FREQUENCY_2|AV_CH_TOP_FRONT_CENTER|AV_CH_TOP_CENTER|AV_CH_TOP_SIDE_LEFT|AV_CH_TOP_SIDE_RIGHT|AV_CH_TOP_BACK_CENTER|AV_CH_BOTTOM_FRONT_CENTER|AV_CH_BOTTOM_FRONT_LEFT|AV_CH_BOTTOM_FRONT_RIGHT) + +#define AV_CH_LAYOUT_7POINT1_TOP_BACK AV_CH_LAYOUT_5POINT1POINT2_BACK enum AVMatrixEncoding { AV_MATRIX_ENCODING_NONE, @@ -266,8 +284,11 @@ typedef struct AVChannelCustom { * A channel layout here is defined as a set of channels ordered in a specific * way (unless the channel order is AV_CHANNEL_ORDER_UNSPEC, in which case an * AVChannelLayout carries only the channel count). + * All orders may be treated as if they were AV_CHANNEL_ORDER_UNSPEC by + * ignoring everything but the channel count, as long as av_channel_layout_check() + * considers they are valid. * - * Unlike most structures in Libav, sizeof(AVChannelLayout) is a part of the + * Unlike most structures in FFmpeg, sizeof(AVChannelLayout) is a part of the * public ABI and may be used by the caller. E.g. it may be allocated on stack * or embedded in caller-defined structs. * @@ -347,9 +368,21 @@ typedef struct AVChannelLayout { void *opaque; } AVChannelLayout; +/** + * Macro to define native channel layouts + * + * @note This doesn't use designated initializers for compatibility with C++ 17 and older. + */ #define AV_CHANNEL_LAYOUT_MASK(nb, m) \ - { .order = AV_CHANNEL_ORDER_NATIVE, .nb_channels = (nb), .u = { .mask = (m) }} + { /* .order */ AV_CHANNEL_ORDER_NATIVE, \ + /* .nb_channels */ (nb), \ + /* .u.mask */ { m }, \ + /* .opaque */ NULL } +/** + * @name Common pre-defined channel layouts + * @{ + */ #define AV_CHANNEL_LAYOUT_MONO AV_CHANNEL_LAYOUT_MASK(1, AV_CH_LAYOUT_MONO) #define AV_CHANNEL_LAYOUT_STEREO AV_CHANNEL_LAYOUT_MASK(2, AV_CH_LAYOUT_STEREO) #define AV_CHANNEL_LAYOUT_2POINT1 AV_CHANNEL_LAYOUT_MASK(3, AV_CH_LAYOUT_2POINT1) @@ -366,6 +399,7 @@ typedef struct AVChannelLayout { #define AV_CHANNEL_LAYOUT_5POINT1_BACK AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_5POINT1_BACK) #define AV_CHANNEL_LAYOUT_6POINT0 AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_6POINT0) #define AV_CHANNEL_LAYOUT_6POINT0_FRONT AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_6POINT0_FRONT) +#define AV_CHANNEL_LAYOUT_3POINT1POINT2 AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_3POINT1POINT2) #define AV_CHANNEL_LAYOUT_HEXAGONAL AV_CHANNEL_LAYOUT_MASK(6, AV_CH_LAYOUT_HEXAGONAL) #define AV_CHANNEL_LAYOUT_6POINT1 AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_6POINT1) #define AV_CHANNEL_LAYOUT_6POINT1_BACK AV_CHANNEL_LAYOUT_MASK(7, AV_CH_LAYOUT_6POINT1_BACK) @@ -375,150 +409,36 @@ typedef struct AVChannelLayout { #define AV_CHANNEL_LAYOUT_7POINT1 AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1) #define AV_CHANNEL_LAYOUT_7POINT1_WIDE AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1_WIDE) #define AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_7POINT1_WIDE_BACK) +#define AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_5POINT1POINT2_BACK) #define AV_CHANNEL_LAYOUT_OCTAGONAL AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_OCTAGONAL) +#define AV_CHANNEL_LAYOUT_CUBE AV_CHANNEL_LAYOUT_MASK(8, AV_CH_LAYOUT_CUBE) +#define AV_CHANNEL_LAYOUT_5POINT1POINT4_BACK AV_CHANNEL_LAYOUT_MASK(10, AV_CH_LAYOUT_5POINT1POINT4_BACK) +#define AV_CHANNEL_LAYOUT_7POINT1POINT2 AV_CHANNEL_LAYOUT_MASK(10, AV_CH_LAYOUT_7POINT1POINT2) +#define AV_CHANNEL_LAYOUT_7POINT1POINT4_BACK AV_CHANNEL_LAYOUT_MASK(12, AV_CH_LAYOUT_7POINT1POINT4_BACK) +#define AV_CHANNEL_LAYOUT_7POINT2POINT3 AV_CHANNEL_LAYOUT_MASK(12, AV_CH_LAYOUT_7POINT2POINT3) +#define AV_CHANNEL_LAYOUT_9POINT1POINT4_BACK AV_CHANNEL_LAYOUT_MASK(14, AV_CH_LAYOUT_9POINT1POINT4_BACK) #define AV_CHANNEL_LAYOUT_HEXADECAGONAL AV_CHANNEL_LAYOUT_MASK(16, AV_CH_LAYOUT_HEXADECAGONAL) #define AV_CHANNEL_LAYOUT_STEREO_DOWNMIX AV_CHANNEL_LAYOUT_MASK(2, AV_CH_LAYOUT_STEREO_DOWNMIX) #define AV_CHANNEL_LAYOUT_22POINT2 AV_CHANNEL_LAYOUT_MASK(24, AV_CH_LAYOUT_22POINT2) + +#define AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK + #define AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER \ - { .order = AV_CHANNEL_ORDER_AMBISONIC, .nb_channels = 4, .u = { .mask = 0 }} + { /* .order */ AV_CHANNEL_ORDER_AMBISONIC, \ + /* .nb_channels */ 4, \ + /* .u.mask */ { 0 }, \ + /* .opaque */ NULL } +/** @} */ struct AVBPrint; -#if FF_API_OLD_CHANNEL_LAYOUT -/** - * Return a channel layout id that matches name, or 0 if no match is found. - * - * name can be one or several of the following notations, - * separated by '+' or '|': - * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0, - * 5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix); - * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC, - * SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR); - * - a number of channels, in decimal, followed by 'c', yielding - * the default channel layout for that number of channels (@see - * av_get_default_channel_layout); - * - a channel layout mask, in hexadecimal starting with "0x" (see the - * AV_CH_* macros). - * - * Example: "stereo+FC" = "2c+FC" = "2c+1c" = "0x7" - * - * @deprecated use av_channel_layout_from_string() - */ -attribute_deprecated -uint64_t av_get_channel_layout(const char *name); - -/** - * Return a channel layout and the number of channels based on the specified name. - * - * This function is similar to (@see av_get_channel_layout), but can also parse - * unknown channel layout specifications. - * - * @param[in] name channel layout specification string - * @param[out] channel_layout parsed channel layout (0 if unknown) - * @param[out] nb_channels number of channels - * - * @return 0 on success, AVERROR(EINVAL) if the parsing fails. - * @deprecated use av_channel_layout_from_string() - */ -attribute_deprecated -int av_get_extended_channel_layout(const char *name, uint64_t* channel_layout, int* nb_channels); - -/** - * Return a description of a channel layout. - * If nb_channels is <= 0, it is guessed from the channel_layout. - * - * @param buf put here the string containing the channel layout - * @param buf_size size in bytes of the buffer - * @deprecated use av_channel_layout_describe() - */ -attribute_deprecated -void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout); - -/** - * Append a description of a channel layout to a bprint buffer. - * @deprecated use av_channel_layout_describe() - */ -attribute_deprecated -void av_bprint_channel_layout(struct AVBPrint *bp, int nb_channels, uint64_t channel_layout); - -/** - * Return the number of channels in the channel layout. - * @deprecated use AVChannelLayout.nb_channels - */ -attribute_deprecated -int av_get_channel_layout_nb_channels(uint64_t channel_layout); - -/** - * Return default channel layout for a given number of channels. - * - * @deprecated use av_channel_layout_default() - */ -attribute_deprecated -int64_t av_get_default_channel_layout(int nb_channels); - -/** - * Get the index of a channel in channel_layout. - * - * @param channel a channel layout describing exactly one channel which must be - * present in channel_layout. - * - * @return index of channel in channel_layout on success, a negative AVERROR - * on error. - * - * @deprecated use av_channel_layout_index_from_channel() - */ -attribute_deprecated -int av_get_channel_layout_channel_index(uint64_t channel_layout, - uint64_t channel); - -/** - * Get the channel with the given index in channel_layout. - * @deprecated use av_channel_layout_channel_from_index() - */ -attribute_deprecated -uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index); - -/** - * Get the name of a given channel. - * - * @return channel name on success, NULL on error. - * - * @deprecated use av_channel_name() - */ -attribute_deprecated -const char *av_get_channel_name(uint64_t channel); - -/** - * Get the description of a given channel. - * - * @param channel a channel layout with a single channel - * @return channel description on success, NULL on error - * @deprecated use av_channel_description() - */ -attribute_deprecated -const char *av_get_channel_description(uint64_t channel); - -/** - * Get the value and name of a standard channel layout. - * - * @param[in] index index in an internal list, starting at 0 - * @param[out] layout channel layout mask - * @param[out] name name of the layout - * @return 0 if the layout exists, - * <0 if index is beyond the limits - * @deprecated use av_channel_layout_standard() - */ -attribute_deprecated -int av_get_standard_channel_layout(unsigned index, uint64_t *layout, - const char **name); -#endif - /** * Get a human readable string in an abbreviated form describing a given channel. * This is the inverse function of @ref av_channel_from_string(). * * @param buf pre-allocated buffer where to put the generated string * @param buf_size size in bytes of the buffer. + * @param channel the AVChannel whose name to get * @return amount of bytes needed to hold the output string, or a negative AVERROR * on failure. If the returned value is bigger than buf_size, then the * string was truncated. @@ -537,6 +457,7 @@ void av_channel_name_bprint(struct AVBPrint *bp, enum AVChannel channel_id); * * @param buf pre-allocated buffer where to put the generated string * @param buf_size size in bytes of the buffer. + * @param channel the AVChannel whose description to get * @return amount of bytes needed to hold the output string, or a negative AVERROR * on failure. If the returned value is bigger than buf_size, then the * string was truncated. @@ -558,6 +479,23 @@ void av_channel_description_bprint(struct AVBPrint *bp, enum AVChannel channel_i */ enum AVChannel av_channel_from_string(const char *name); +/** + * Initialize a custom channel layout with the specified number of channels. + * The channel map will be allocated and the designation of all channels will + * be set to AV_CHAN_UNKNOWN. + * + * This is only a convenience helper function, a custom channel layout can also + * be constructed without using this. + * + * @param channel_layout the layout structure to be initialized + * @param nb_channels the number of channels + * + * @return 0 on success + * AVERROR(EINVAL) if the number of channels <= 0 + * AVERROR(ENOMEM) if the channel map could not be allocated + */ +int av_channel_layout_custom_init(AVChannelLayout *channel_layout, int nb_channels); + /** * Initialize a native channel layout from a bitmask indicating which channels * are present. @@ -582,10 +520,14 @@ int av_channel_layout_from_mask(AVChannelLayout *channel_layout, uint64_t mask); * - the number of unordered channels (eg. "4C" or "4 channels") * - the ambisonic order followed by optional non-diegetic channels (eg. * "ambisonic 2+stereo") + * On error, the channel layout will remain uninitialized, but not necessarily + * untouched. * - * @param channel_layout input channel layout + * @param channel_layout uninitialized channel layout for the result * @param str string describing the channel layout - * @return 0 channel layout was detected, AVERROR_INVALIDATATA otherwise + * @return 0 on success parsing the channel layout + * AVERROR(EINVAL) if an invalid channel layout string was provided + * AVERROR(ENOMEM) if there was not enough memory */ int av_channel_layout_from_string(AVChannelLayout *channel_layout, const char *str); @@ -593,7 +535,7 @@ int av_channel_layout_from_string(AVChannelLayout *channel_layout, /** * Get the default channel layout for a given number of channels. * - * @param channel_layout the layout structure to be initialized + * @param ch_layout the layout structure to be initialized * @param nb_channels number of channels */ void av_channel_layout_default(AVChannelLayout *ch_layout, int nb_channels); @@ -658,6 +600,7 @@ int av_channel_layout_describe_bprint(const AVChannelLayout *channel_layout, * Get the channel with the given index in a channel layout. * * @param channel_layout input channel layout + * @param idx index of the channel * @return channel with the index idx in channel_layout on success or * AV_CHAN_NONE on failure (if idx is not valid or the channel order is * unspecified) @@ -670,6 +613,7 @@ av_channel_layout_channel_from_index(const AVChannelLayout *channel_layout, unsi * channels are found, only the first match will be returned. * * @param channel_layout input channel layout + * @param channel the channel whose index to obtain * @return index of channel in channel_layout on success or a negative number if * channel is not present in channel_layout. */ @@ -684,6 +628,7 @@ int av_channel_layout_index_from_channel(const AVChannelLayout *channel_layout, * @ref av_channel_from_string(). * * @param channel_layout input channel layout + * @param name string describing the channel whose index to obtain * @return a channel index described by the given string, or a negative AVERROR * value. */ @@ -697,6 +642,7 @@ int av_channel_layout_index_from_string(const AVChannelLayout *channel_layout, * @ref av_channel_from_string(). * * @param channel_layout input channel layout + * @param name string describing the channel to obtain * @return a channel described by the given string in channel_layout on success * or AV_CHAN_NONE on failure (if the string is not valid or the channel * order is unspecified) @@ -742,7 +688,63 @@ int av_channel_layout_check(const AVChannelLayout *channel_layout); int av_channel_layout_compare(const AVChannelLayout *chl, const AVChannelLayout *chl1); /** - * @} + * Return the order if the layout is n-th order standard-order ambisonic. + * The presence of optional extra non-diegetic channels at the end is not taken + * into account. + * + * @param channel_layout input channel layout + * @return the order of the layout, a negative error code otherwise. + */ +int av_channel_layout_ambisonic_order(const AVChannelLayout *channel_layout); + +/** + * The conversion must be lossless. + */ +#define AV_CHANNEL_LAYOUT_RETYPE_FLAG_LOSSLESS (1 << 0) + +/** + * The specified retype target order is ignored and the simplest possible + * (canonical) order is used for which the input layout can be losslessy + * represented. + */ +#define AV_CHANNEL_LAYOUT_RETYPE_FLAG_CANONICAL (1 << 1) + +/** + * Change the AVChannelOrder of a channel layout. + * + * Change of AVChannelOrder can be either lossless or lossy. In case of a + * lossless conversion all the channel designations and the associated channel + * names (if any) are kept. On a lossy conversion the channel names and channel + * designations might be lost depending on the capabilities of the desired + * AVChannelOrder. Note that some conversions are simply not possible in which + * case this function returns AVERROR(ENOSYS). + * + * The following conversions are supported: + * + * Any -> Custom : Always possible, always lossless. + * Any -> Unspecified: Always possible, lossless if channel designations + * are all unknown and channel names are not used, lossy otherwise. + * Custom -> Ambisonic : Possible if it contains ambisonic channels with + * optional non-diegetic channels in the end. Lossy if the channels have + * custom names, lossless otherwise. + * Custom -> Native : Possible if it contains native channels in native + * order. Lossy if the channels have custom names, lossless otherwise. + * + * On error this function keeps the original channel layout untouched. + * + * @param channel_layout channel layout which will be changed + * @param order the desired channel layout order + * @param flags a combination of AV_CHANNEL_LAYOUT_RETYPE_FLAG_* constants + * @return 0 if the conversion was successful and lossless or if the channel + * layout was already in the desired order + * >0 if the conversion was successful but lossy + * AVERROR(ENOSYS) if the conversion was not possible (or would be + * lossy and AV_CHANNEL_LAYOUT_RETYPE_FLAG_LOSSLESS was specified) + * AVERROR(EINVAL), AVERROR(ENOMEM) on error + */ +int av_channel_layout_retype(AVChannelLayout *channel_layout, enum AVChannelOrder order, int flags); + +/** * @} */ diff --git a/include/libavutil/colorspace.h b/include/libavutil/colorspace.h new file mode 100644 index 0000000..ef6f610 --- /dev/null +++ b/include/libavutil/colorspace.h @@ -0,0 +1,150 @@ +/* + * Colorspace conversion defines + * Copyright (c) 2001, 2002, 2003 Fabrice Bellard + * + * 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 + */ + +/** + * @file + * Various defines for YUV<->RGB conversion + */ + +#ifndef AVUTIL_COLORSPACE_H +#define AVUTIL_COLORSPACE_H + +#define SCALEBITS 10 +#define ONE_HALF (1 << (SCALEBITS - 1)) +#define FIX(x) ((int) ((x) * (1<> SCALEBITS];\ + g = cm[(y + g_add) >> SCALEBITS];\ + b = cm[(y + b_add) >> SCALEBITS];\ +} + +#define YUV_TO_RGB1(cb1, cr1)\ +{\ + cb = (cb1) - 128;\ + cr = (cr1) - 128;\ + r_add = FIX(1.40200) * cr + ONE_HALF;\ + g_add = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF;\ + b_add = FIX(1.77200) * cb + ONE_HALF;\ +} + +#define YUV_TO_RGB2(r, g, b, y1)\ +{\ + y = (y1) << SCALEBITS;\ + r = cm[(y + r_add) >> SCALEBITS];\ + g = cm[(y + g_add) >> SCALEBITS];\ + b = cm[(y + b_add) >> SCALEBITS];\ +} + +#define Y_CCIR_TO_JPEG(y)\ + cm[((y) * FIX(255.0/219.0) + (ONE_HALF - 16 * FIX(255.0/219.0))) >> SCALEBITS] + +#define Y_JPEG_TO_CCIR(y)\ + (((y) * FIX(219.0/255.0) + (ONE_HALF + (16 << SCALEBITS))) >> SCALEBITS) + +#define C_CCIR_TO_JPEG(y)\ + cm[(((y) - 128) * FIX(127.0/112.0) + (ONE_HALF + (128 << SCALEBITS))) >> SCALEBITS] + +/* NOTE: the clamp is really necessary! */ +static inline int C_JPEG_TO_CCIR(int y) { + y = (((y - 128) * FIX(112.0/127.0) + (ONE_HALF + (128 << SCALEBITS))) >> SCALEBITS); + if (y < 16) + y = 16; + return y; +} + + +#define RGB_TO_Y_CCIR(r, g, b) \ +((FIX(0.29900*219.0/255.0) * (r) + FIX(0.58700*219.0/255.0) * (g) + \ + FIX(0.11400*219.0/255.0) * (b) + (ONE_HALF + (16 << SCALEBITS))) >> SCALEBITS) + +#define RGB_TO_U_CCIR(r1, g1, b1, shift)\ +(((- FIX(0.16874*224.0/255.0) * r1 - FIX(0.33126*224.0/255.0) * g1 + \ + FIX(0.50000*224.0/255.0) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128) + +#define RGB_TO_V_CCIR(r1, g1, b1, shift)\ +(((FIX(0.50000*224.0/255.0) * r1 - FIX(0.41869*224.0/255.0) * g1 - \ + FIX(0.08131*224.0/255.0) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128) + +#define RGB_TO_Y_JPEG(r, g, b) \ +(FFMIN((FIX(0.29900) * (r) + FIX(0.58700) * (g) + \ + FIX(0.11400) * (b) + (ONE_HALF)) >> SCALEBITS, 255)) + +#define RGB_TO_U_JPEG(r1, g1, b1)\ +(((- FIX(0.16874) * r1 - FIX(0.33126) * g1 + \ + FIX(0.50000) * b1 + (ONE_HALF) - 1) >> (SCALEBITS)) + 128) + +#define RGB_TO_V_JPEG(r1, g1, b1)\ +(((FIX(0.50000) * r1 - FIX(0.41869) * g1 - \ + FIX(0.08131) * b1 + (ONE_HALF) - 1) >> (SCALEBITS)) + 128) + +// Conversion macros for 8-bit RGB to YUV +// Derived from ITU-R BT.709-6 (06/2015) Item 3.5 +// https://www.itu.int/rec/R-REC-BT.709-6-201506-I/en + +#define RGB_TO_Y_BT709(r, g, b) \ +((FIX(0.21260*219.0/255.0) * (r) + FIX(0.71520*219.0/255.0) * (g) + \ + FIX(0.07220*219.0/255.0) * (b) + (ONE_HALF + (16 << SCALEBITS))) >> SCALEBITS) + +#define RGB_TO_U_BT709(r1, g1, b1, shift)\ +(((- FIX(0.11457*224.0/255.0) * r1 - FIX(0.38543*224.0/255.0) * g1 + \ + FIX(0.50000*224.0/255.0) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128) + +#define RGB_TO_V_BT709(r1, g1, b1, shift)\ +(((FIX(0.50000*224.0/255.0) * r1 - FIX(0.45415*224.0/255.0) * g1 - \ + FIX(0.04585*224.0/255.0) * b1 + (ONE_HALF << shift) - 1) >> (SCALEBITS + shift)) + 128) + +#define RGB_TO_Y_BT709_FULL(r, g, b) \ +(FFMIN((FIX(0.21260) * (r) + FIX(0.71520) * (g) + \ + FIX(0.07220) * (b) + (ONE_HALF)) >> SCALEBITS, 255)) + +#define RGB_TO_U_BT709_FULL(r1, g1, b1)\ +(((- FIX(0.11457) * r1 - FIX(0.38543) * g1 + \ + FIX(0.50000) * b1 + (ONE_HALF) - 1) >> (SCALEBITS)) + 128) + +#define RGB_TO_V_BT709_FULL(r1, g1, b1)\ +(((FIX(0.50000) * r1 - FIX(0.45415) * g1 - \ + FIX(0.04585) * b1 + (ONE_HALF) - 1) >> (SCALEBITS)) + 128) + +#endif /* AVUTIL_COLORSPACE_H */ diff --git a/include/libavutil/common.h b/include/libavutil/common.h index fd1404b..3b830da 100755 --- a/include/libavutil/common.h +++ b/include/libavutil/common.h @@ -40,7 +40,17 @@ #include #include "attributes.h" +#include "error.h" #include "macros.h" +#include "version.h" + +#ifdef HAVE_AV_CONFIG_H +# include "config.h" +# include "intmath.h" +# include "internal.h" +#else +# include "mem.h" +#endif /* HAVE_AV_CONFIG_H */ //rounded division & shift #define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b)) @@ -83,11 +93,6 @@ /* misc math functions */ -#ifdef HAVE_AV_CONFIG_H -# include "config.h" -# include "intmath.h" -#endif - #ifndef av_ceil_log2 # define av_ceil_log2 av_ceil_log2_c #endif @@ -118,9 +123,6 @@ #ifndef av_clip_uintp2 # define av_clip_uintp2 av_clip_uintp2_c #endif -#ifndef av_mod_uintp2 -# define av_mod_uintp2 av_mod_uintp2_c -#endif #ifndef av_sat_add32 # define av_sat_add32 av_sat_add32_c #endif @@ -145,6 +147,9 @@ #ifndef av_clipd # define av_clipd av_clipd_c #endif +#ifndef av_zero_extend +# define av_zero_extend av_zero_extend_c +#endif #ifndef av_popcount # define av_popcount av_popcount_c #endif @@ -248,8 +253,8 @@ static av_always_inline av_const int16_t av_clip_int16_c(int a) */ static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a) { - if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (int32_t)((a>>63) ^ 0x7FFFFFFF); - else return (int32_t)a; + if ((a+UINT64_C(0x80000000)) & ~UINT64_C(0xFFFFFFFF)) return (int32_t)((a>>63) ^ 0x7FFFFFFF); + else return (int32_t)a; } /** @@ -260,7 +265,7 @@ static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a) */ static av_always_inline av_const int av_clip_intp2_c(int a, int p) { - if (((unsigned)a + (1 << p)) & ~((2 << p) - 1)) + if (((unsigned)a + (1U << p)) & ~((2U << p) - 1)) return (a >> 31) ^ ((1 << p) - 1); else return a; @@ -274,21 +279,35 @@ static av_always_inline av_const int av_clip_intp2_c(int a, int p) */ static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p) { - if (a & ~((1<> 31 & ((1<> 31 & ((1U<= 2 + if (p > 31) abort(); +#endif return a & ((1U << p) - 1); } +#if FF_API_MOD_UINTP2 +#ifndef av_mod_uintp2 +# define av_mod_uintp2 av_mod_uintp2_c +#endif +attribute_deprecated +static av_always_inline av_const unsigned av_mod_uintp2_c(unsigned a, unsigned p) +{ + return av_zero_extend_c(a, p); +} +#endif + /** * Add two signed 32-bit values with saturation. * @@ -567,12 +586,4 @@ static av_always_inline av_const int av_parity_c(uint32_t v) }\ }\ - - -#include "mem.h" - -#ifdef HAVE_AV_CONFIG_H -# include "internal.h" -#endif /* HAVE_AV_CONFIG_H */ - #endif /* AVUTIL_COMMON_H */ diff --git a/include/libavutil/cpu.h b/include/libavutil/cpu.h index 9711e57..ba6c234 100755 --- a/include/libavutil/cpu.h +++ b/include/libavutil/cpu.h @@ -22,6 +22,7 @@ #define AVUTIL_CPU_H #include +#include "version.h" #define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */ @@ -69,6 +70,8 @@ #define AV_CPU_FLAG_NEON (1 << 5) #define AV_CPU_FLAG_ARMV8 (1 << 6) #define AV_CPU_FLAG_VFP_VM (1 << 7) ///< VFPv2 vector mode, deprecated in ARMv7-A and unavailable in various CPUs implementations +#define AV_CPU_FLAG_DOTPROD (1 << 8) +#define AV_CPU_FLAG_I8MM (1 << 9) #define AV_CPU_FLAG_SETEND (1 <<16) #define AV_CPU_FLAG_MMI (1 << 0) @@ -78,6 +81,24 @@ #define AV_CPU_FLAG_LSX (1 << 0) #define AV_CPU_FLAG_LASX (1 << 1) +// RISC-V extensions +#define AV_CPU_FLAG_RVI (1 << 0) ///< I (full GPR bank) +#if FF_API_RISCV_FD_ZBA +#define AV_CPU_FLAG_RVF (1 << 1) ///< F (single precision FP) +#define AV_CPU_FLAG_RVD (1 << 2) ///< D (double precision FP) +#endif +#define AV_CPU_FLAG_RVV_I32 (1 << 3) ///< Vectors of 8/16/32-bit int's */ +#define AV_CPU_FLAG_RVV_F32 (1 << 4) ///< Vectors of float's */ +#define AV_CPU_FLAG_RVV_I64 (1 << 5) ///< Vectors of 64-bit int's */ +#define AV_CPU_FLAG_RVV_F64 (1 << 6) ///< Vectors of double's +#define AV_CPU_FLAG_RVB_BASIC (1 << 7) ///< Basic bit-manipulations +#if FF_API_RISCV_FD_ZBA +#define AV_CPU_FLAG_RVB_ADDR (1 << 8) ///< Address bit-manipulations +#endif +#define AV_CPU_FLAG_RV_ZVBB (1 << 9) ///< Vector basic bit-manipulations +#define AV_CPU_FLAG_RV_MISALIGNED (1 <<10) ///< Fast misaligned accesses +#define AV_CPU_FLAG_RVB (1 <<11) ///< B (bit manipulations) + /** * Return the flags which specify extensions supported by the CPU. * The returned value is affected by av_force_cpu_flags() if that was used diff --git a/include/libavutil/cpu_internal.h b/include/libavutil/cpu_internal.h new file mode 100644 index 0000000..585a115 --- /dev/null +++ b/include/libavutil/cpu_internal.h @@ -0,0 +1,64 @@ +/* + * 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 AVUTIL_CPU_INTERNAL_H +#define AVUTIL_CPU_INTERNAL_H + +#include "config.h" + +#include "cpu.h" + +#define CPUEXT_SUFFIX(flags, suffix, cpuext) \ + (HAVE_ ## cpuext ## suffix && ((flags) & AV_CPU_FLAG_ ## cpuext)) + +#define CPUEXT_SUFFIX_FAST2(flags, suffix, cpuext, slow_cpuext) \ + (HAVE_ ## cpuext ## suffix && ((flags) & AV_CPU_FLAG_ ## cpuext) && \ + !((flags) & AV_CPU_FLAG_ ## slow_cpuext ## SLOW)) + +#define CPUEXT_SUFFIX_SLOW(flags, suffix, cpuext) \ + (HAVE_ ## cpuext ## suffix && \ + ((flags) & (AV_CPU_FLAG_ ## cpuext | AV_CPU_FLAG_ ## cpuext ## SLOW))) + +#define CPUEXT_SUFFIX_SLOW2(flags, suffix, cpuext, slow_cpuext) \ + (HAVE_ ## cpuext ## suffix && ((flags) & AV_CPU_FLAG_ ## cpuext) && \ + ((flags) & (AV_CPU_FLAG_ ## slow_cpuext | AV_CPU_FLAG_ ## slow_cpuext ## SLOW))) + +#define CPUEXT_SUFFIX_FAST(flags, suffix, cpuext) CPUEXT_SUFFIX_FAST2(flags, suffix, cpuext, cpuext) + +#define CPUEXT(flags, cpuext) CPUEXT_SUFFIX(flags, , cpuext) +#define CPUEXT_FAST(flags, cpuext) CPUEXT_SUFFIX_FAST(flags, , cpuext) +#define CPUEXT_SLOW(flags, cpuext) CPUEXT_SUFFIX_SLOW(flags, , cpuext) + +int ff_get_cpu_flags_mips(void); +int ff_get_cpu_flags_aarch64(void); +int ff_get_cpu_flags_arm(void); +int ff_get_cpu_flags_ppc(void); +int ff_get_cpu_flags_riscv(void); +int ff_get_cpu_flags_x86(void); +int ff_get_cpu_flags_loongarch(void); + +size_t ff_get_cpu_max_align_mips(void); +size_t ff_get_cpu_max_align_aarch64(void); +size_t ff_get_cpu_max_align_arm(void); +size_t ff_get_cpu_max_align_ppc(void); +size_t ff_get_cpu_max_align_x86(void); +size_t ff_get_cpu_max_align_loongarch(void); + +unsigned long ff_getauxval(unsigned long type); + +#endif /* AVUTIL_CPU_INTERNAL_H */ diff --git a/include/libavutil/crc.h b/include/libavutil/crc.h index 24a2e3c..7f59812 100755 --- a/include/libavutil/crc.h +++ b/include/libavutil/crc.h @@ -84,7 +84,10 @@ const AVCRC *av_crc_get_table(AVCRCId crc_id); /** * Calculate the CRC of a block. + * @param ctx initialized AVCRC array (see av_crc_init()) * @param crc CRC of previous blocks if any or initial value for CRC + * @param buffer buffer whose CRC to calculate + * @param length length of the buffer * @return CRC updated with the data from the given block * * @see av_crc_init() "le" parameter diff --git a/include/libavutil/csp.h b/include/libavutil/csp.h index 3754444..73bce52 100644 --- a/include/libavutil/csp.h +++ b/include/libavutil/csp.h @@ -1,5 +1,8 @@ /* + * Copyright (c) 2015 Kevin Wheatley * Copyright (c) 2016 Ronald S. Bultje + * Copyright (c) 2023 Leo Izen + * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or @@ -24,9 +27,15 @@ #include "rational.h" /** - * @file Colorspace value utility functions for libavutil. + * @file + * Colorspace value utility functions for libavutil. + * @ingroup lavu_math_csp * @author Ronald S. Bultje * @author Leo Izen + * @author Kevin Wheatley + */ + +/** * @defgroup lavu_math_csp Colorspace Utility * @ingroup lavu_math * @{ @@ -71,6 +80,12 @@ typedef struct AVColorPrimariesDesc { AVPrimaryCoefficients prim; } AVColorPrimariesDesc; +/** + * Function pointer representing a double -> double transfer function that performs + * an EOTF transfer inversion. This function outputs linear light. + */ +typedef double (*av_csp_trc_function)(double); + /** * Retrieves the Luma coefficients necessary to construct a conversion matrix * from an enum constant describing the colorspace. @@ -99,6 +114,35 @@ const AVColorPrimariesDesc *av_csp_primaries_desc_from_id(enum AVColorPrimaries */ enum AVColorPrimaries av_csp_primaries_id_from_desc(const AVColorPrimariesDesc *prm); +/** + * Determine a suitable 'gamma' value to match the supplied + * AVColorTransferCharacteristic. + * + * See Apple Technical Note TN2257 (https://developer.apple.com/library/mac/technotes/tn2257/_index.html) + * + * This function returns the gamma exponent for the OETF. For example, sRGB is approximated + * by gamma 2.2, not by gamma 0.45455. + * + * @return Will return an approximation to the simple gamma function matching + * the supplied Transfer Characteristic, Will return 0.0 for any + * we cannot reasonably match against. + */ +double av_csp_approximate_trc_gamma(enum AVColorTransferCharacteristic trc); + +/** + * Determine the function needed to apply the given + * AVColorTransferCharacteristic to linear input. + * + * The function returned should expect a nominal domain and range of [0.0-1.0] + * values outside of this range maybe valid depending on the chosen + * characteristic function. + * + * @return Will return pointer to the function matching the + * supplied Transfer Characteristic. If unspecified will + * return NULL: + */ +av_csp_trc_function av_csp_trc_func_from_id(enum AVColorTransferCharacteristic trc); + /** * @} */ diff --git a/include/libavutil/cuda_check.h b/include/libavutil/cuda_check.h new file mode 100644 index 0000000..f5a9234 --- /dev/null +++ b/include/libavutil/cuda_check.h @@ -0,0 +1,67 @@ +/* + * 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 AVUTIL_CUDA_CHECK_H +#define AVUTIL_CUDA_CHECK_H + +#include "compat/cuda/dynlink_loader.h" +#include "error.h" + +typedef CUresult CUDAAPI cuda_check_GetErrorName(CUresult error, const char** pstr); +typedef CUresult CUDAAPI cuda_check_GetErrorString(CUresult error, const char** pstr); + +/** + * Wrap a CUDA function call and print error information if it fails. + */ +static inline int ff_cuda_check(void *avctx, + void *cuGetErrorName_fn, void *cuGetErrorString_fn, + CUresult err, const char *func) +{ + const char *err_name; + const char *err_string; + + av_log(avctx, AV_LOG_TRACE, "Calling %s\n", func); + + if (err == CUDA_SUCCESS) + return 0; + + ((cuda_check_GetErrorName *)cuGetErrorName_fn)(err, &err_name); + ((cuda_check_GetErrorString *)cuGetErrorString_fn)(err, &err_string); + + av_log(avctx, AV_LOG_ERROR, "%s failed", func); + if (err_name && err_string) + av_log(avctx, AV_LOG_ERROR, " -> %s: %s", err_name, err_string); + av_log(avctx, AV_LOG_ERROR, "\n"); + + return AVERROR_EXTERNAL; +} + +/** + * Convenience wrapper for ff_cuda_check when directly linking libcuda. + */ + +#define FF_CUDA_CHECK(avclass, x) ff_cuda_check(avclass, cuGetErrorName, cuGetErrorString, (x), #x) + +/** + * Convenience wrapper for ff_cuda_check when dynamically loading cuda symbols. + */ + +#define FF_CUDA_CHECK_DL(avclass, cudl, x) ff_cuda_check(avclass, cudl->cuGetErrorName, cudl->cuGetErrorString, (x), #x) + +#endif /* AVUTIL_CUDA_CHECK_H */ diff --git a/include/libavutil/des.h b/include/libavutil/des.h index 4cf11f5..3a3e6fa 100755 --- a/include/libavutil/des.h +++ b/include/libavutil/des.h @@ -43,6 +43,8 @@ AVDES *av_des_alloc(void); /** * @brief Initializes an AVDES context. * + * @param d pointer to a AVDES structure to initialize + * @param key pointer to the key to use * @param key_bits must be 64 or 192 * @param decrypt 0 for encryption/CBC-MAC, 1 for decryption * @return zero on success, negative value otherwise @@ -52,9 +54,10 @@ int av_des_init(struct AVDES *d, const uint8_t *key, int key_bits, int decrypt); /** * @brief Encrypts / decrypts using the DES algorithm. * - * @param count number of 8 byte blocks + * @param d pointer to the AVDES structure * @param dst destination array, can be equal to src, must be 8-byte aligned * @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL + * @param count number of 8 byte blocks * @param iv initialization vector for CBC mode, if NULL then ECB will be used, * must be 8-byte aligned * @param decrypt 0 for encryption, 1 for decryption @@ -64,9 +67,10 @@ void av_des_crypt(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count, /** * @brief Calculates CBC-MAC using the DES algorithm. * - * @param count number of 8 byte blocks + * @param d pointer to the AVDES structure * @param dst destination array, can be equal to src, must be 8-byte aligned * @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL + * @param count number of 8 byte blocks */ void av_des_mac(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count); diff --git a/include/libavutil/detection_bbox.h b/include/libavutil/detection_bbox.h index c20c204..0119880 100644 --- a/include/libavutil/detection_bbox.h +++ b/include/libavutil/detection_bbox.h @@ -93,6 +93,7 @@ av_get_detection_bbox(const AVDetectionBBoxHeader *header, unsigned int idx) * AVDetectionBBox, and initializes the variables. * Can be freed with a normal av_free() call. * + * @param nb_bboxes number of AVDetectionBBox structures to allocate * @param out_size if non-NULL, the size in bytes of the resulting data array is * written here. */ diff --git a/include/libavutil/dict.h b/include/libavutil/dict.h index 0d1afc6..713c9e3 100755 --- a/include/libavutil/dict.h +++ b/include/libavutil/dict.h @@ -39,13 +39,15 @@ * @brief Simple key:value store * * @{ - * Dictionaries are used for storing key:value pairs. To create - * an AVDictionary, simply pass an address of a NULL pointer to - * av_dict_set(). NULL can be used as an empty dictionary wherever - * a pointer to an AVDictionary is required. - * Use av_dict_get() to retrieve an entry or iterate over all - * entries and finally av_dict_free() to free the dictionary - * and all its contents. + * Dictionaries are used for storing key-value pairs. + * + * - To **create an AVDictionary**, simply pass an address of a NULL + * pointer to av_dict_set(). NULL can be used as an empty dictionary + * wherever a pointer to an AVDictionary is required. + * - To **insert an entry**, use av_dict_set(). + * - Use av_dict_get() to **retrieve an entry**. + * - To **iterate over all entries**, use av_dict_iterate(). + * - In order to **free the dictionary and all its contents**, use av_dict_free(). * @code AVDictionary *d = NULL; // "create" an empty dictionary @@ -57,13 +59,18 @@ char *v = av_strdup("value"); // you can avoid copying them like this av_dict_set(&d, k, v, AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL); - while (t = av_dict_get(d, "", t, AV_DICT_IGNORE_SUFFIX)) { - <....> // iterate over all entries in d + while ((t = av_dict_iterate(d, t))) { + <....> // iterate over all entries in d } av_dict_free(&d); @endcode */ +/** + * @name AVDictionary Flags + * Flags that influence behavior of the matching of keys or insertion to the dictionary. + * @{ + */ #define AV_DICT_MATCH_CASE 1 /**< Only get an entry with exact-case key match. Only relevant in av_dict_get(). */ #define AV_DICT_IGNORE_SUFFIX 2 /**< Return first entry in a dictionary whose first part corresponds to the search key, ignoring the suffix of the found key string. Only relevant in av_dict_get(). */ @@ -71,10 +78,13 @@ allocated with av_malloc() or another memory allocation function. */ #define AV_DICT_DONT_STRDUP_VAL 8 /**< Take ownership of a value that's been allocated with av_malloc() or another memory allocation function. */ -#define AV_DICT_DONT_OVERWRITE 16 ///< Don't overwrite existing entries. +#define AV_DICT_DONT_OVERWRITE 16 /**< Don't overwrite existing entries. */ #define AV_DICT_APPEND 32 /**< If the entry already exists, append to it. Note that no - delimiter is added, the strings are simply concatenated. */ + delimiter is added, the strings are simply concatenated. */ #define AV_DICT_MULTIKEY 64 /**< Allow to store several equal keys in the dictionary */ +/** + * @} + */ typedef struct AVDictionaryEntry { char *key; @@ -89,18 +99,44 @@ typedef struct AVDictionary AVDictionary; * The returned entry key or value must not be changed, or it will * cause undefined behavior. * - * To iterate through all the dictionary entries, you can set the matching key - * to the null string "" and set the AV_DICT_IGNORE_SUFFIX flag. + * @param prev Set to the previous matching element to find the next. + * If set to NULL the first matching element is returned. + * @param key Matching key + * @param flags A collection of AV_DICT_* flags controlling how the + * entry is retrieved * - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param key matching key - * @param flags a collection of AV_DICT_* flags controlling how the entry is retrieved - * @return found entry or NULL in case no matching entry was found in the dictionary + * @return Found entry or NULL in case no matching entry was found in the dictionary */ AVDictionaryEntry *av_dict_get(const AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags); +/** + * Iterate over a dictionary + * + * Iterates through all entries in the dictionary. + * + * @warning The returned AVDictionaryEntry key/value must not be changed. + * + * @warning As av_dict_set() invalidates all previous entries returned + * by this function, it must not be called while iterating over the dict. + * + * Typical usage: + * @code + * const AVDictionaryEntry *e = NULL; + * while ((e = av_dict_iterate(m, e))) { + * // ... + * } + * @endcode + * + * @param m The dictionary to iterate over + * @param prev Pointer to the previous AVDictionaryEntry, NULL initially + * + * @retval AVDictionaryEntry* The next element in the dictionary + * @retval NULL No more elements in the dictionary + */ +const AVDictionaryEntry *av_dict_iterate(const AVDictionary *m, + const AVDictionaryEntry *prev); + /** * Get number of entries in dictionary. * @@ -115,23 +151,24 @@ int av_dict_count(const AVDictionary *m); * Note: If AV_DICT_DONT_STRDUP_KEY or AV_DICT_DONT_STRDUP_VAL is set, * these arguments will be freed on error. * - * Warning: Adding a new entry to a dictionary invalidates all existing entries - * previously returned with av_dict_get. + * @warning Adding a new entry to a dictionary invalidates all existing entries + * previously returned with av_dict_get() or av_dict_iterate(). * - * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL - * a dictionary struct is allocated and put in *pm. - * @param key entry key to add to *pm (will either be av_strduped or added as a new key depending on flags) - * @param value entry value to add to *pm (will be av_strduped or added as a new key depending on flags). - * Passing a NULL value will cause an existing entry to be deleted. - * @return >= 0 on success otherwise an error code <0 + * @param pm Pointer to a pointer to a dictionary struct. If *pm is NULL + * a dictionary struct is allocated and put in *pm. + * @param key Entry key to add to *pm (will either be av_strduped or added as a new key depending on flags) + * @param value Entry value to add to *pm (will be av_strduped or added as a new key depending on flags). + * Passing a NULL value will cause an existing entry to be deleted. + * + * @return >= 0 on success otherwise an error code <0 */ int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags); /** - * Convenience wrapper for av_dict_set that converts the value to a string + * Convenience wrapper for av_dict_set() that converts the value to a string * and stores it. * - * Note: If AV_DICT_DONT_STRDUP_KEY is set, key will be freed on error. + * Note: If ::AV_DICT_DONT_STRDUP_KEY is set, key will be freed on error. */ int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags); @@ -141,14 +178,15 @@ int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags * In case of failure, all the successfully set entries are stored in * *pm. You may need to manually free the created dictionary. * - * @param key_val_sep a 0-terminated list of characters used to separate + * @param key_val_sep A 0-terminated list of characters used to separate * key from value - * @param pairs_sep a 0-terminated list of characters used to separate + * @param pairs_sep A 0-terminated list of characters used to separate * two pairs from each other - * @param flags flags to use when adding to dictionary. - * AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL + * @param flags Flags to use when adding to the dictionary. + * ::AV_DICT_DONT_STRDUP_KEY and ::AV_DICT_DONT_STRDUP_VAL * are ignored since the key/value tokens will always * be duplicated. + * * @return 0 on success, negative AVERROR code on failure */ int av_dict_parse_string(AVDictionary **pm, const char *str, @@ -157,11 +195,14 @@ int av_dict_parse_string(AVDictionary **pm, const char *str, /** * Copy entries from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting entries in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag + * + * @note Metadata is read using the ::AV_DICT_IGNORE_SUFFIX flag + * + * @param dst Pointer to a pointer to a AVDictionary struct to copy into. If *dst is NULL, + * this function will allocate a struct for you and put it in *dst + * @param src Pointer to the source AVDictionary struct to copy items from. + * @param flags Flags to use when setting entries in *dst + * * @return 0 on success, negative AVERROR code on failure. If dst was allocated * by this function, callers should free the associated memory. */ @@ -180,13 +221,15 @@ void av_dict_free(AVDictionary **m); * Such string may be passed back to av_dict_parse_string(). * @note String is escaped with backslashes ('\'). * - * @param[in] m dictionary + * @warning Separators cannot be neither '\\' nor '\0'. They also cannot be the same. + * + * @param[in] m The dictionary * @param[out] buffer Pointer to buffer that will be allocated with string containg entries. * Buffer must be freed by the caller when is no longer needed. - * @param[in] key_val_sep character used to separate key from value - * @param[in] pairs_sep character used to separate two pairs from each other + * @param[in] key_val_sep Character used to separate key from value + * @param[in] pairs_sep Character used to separate two pairs from each other + * * @return >= 0 on success, negative on error - * @warning Separators cannot be neither '\\' nor '\0'. They also cannot be the same. */ int av_dict_get_string(const AVDictionary *m, char **buffer, const char key_val_sep, const char pairs_sep); diff --git a/include/libavutil/dict_internal.h b/include/libavutil/dict_internal.h new file mode 100644 index 0000000..6d5b0dc --- /dev/null +++ b/include/libavutil/dict_internal.h @@ -0,0 +1,37 @@ +/* + * 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 AVUTIL_DICT_INTERNAL_H +#define AVUTIL_DICT_INTERNAL_H + +#include + +#include "dict.h" + +/** + * Set a dictionary value to an ISO-8601 compliant timestamp string. + * + * @param dict pointer to a pointer to a dictionary struct. If *dict is NULL + * a dictionary struct is allocated and put in *dict. + * @param key metadata key + * @param timestamp unix timestamp in microseconds + * @return <0 on error + */ +int avpriv_dict_set_timestamp(AVDictionary **dict, const char *key, int64_t timestamp); + +#endif /* AVUTIL_DICT_INTERNAL_H */ diff --git a/include/libavutil/display.h b/include/libavutil/display.h index 31d8bef..50f2b44 100755 --- a/include/libavutil/display.h +++ b/include/libavutil/display.h @@ -20,6 +20,7 @@ /** * @file + * @ingroup lavu_video_display * Display matrix */ @@ -29,15 +30,9 @@ #include /** - * @addtogroup lavu_video - * @{ - * * @defgroup lavu_video_display Display transformation matrix functions - * @{ - */ - -/** - * @addtogroup lavu_video_display + * @ingroup lavu_video + * * The display transformation matrix specifies an affine transformation that * should be applied to video frames for correct presentation. It is compatible * with the matrices stored in the ISO/IEC 14496-12 container format. @@ -71,6 +66,8 @@ * q' = (b * p + d * q + y) / z; * z = u * p + v * q + w * @endcode + * + * @{ */ /** @@ -90,8 +87,8 @@ double av_display_rotation_get(const int32_t matrix[9]); * Initialize a transformation matrix describing a pure clockwise * rotation by the specified angle (in degrees). * - * @param matrix an allocated transformation matrix (will be fully overwritten - * by this function) + * @param[out] matrix a transformation matrix (will be fully overwritten + * by this function) * @param angle rotation angle in degrees. */ void av_display_rotation_set(int32_t matrix[9], double angle); @@ -99,14 +96,13 @@ void av_display_rotation_set(int32_t matrix[9], double angle); /** * Flip the input matrix horizontally and/or vertically. * - * @param matrix an allocated transformation matrix + * @param[in,out] matrix a transformation matrix * @param hflip whether the matrix should be flipped horizontally * @param vflip whether the matrix should be flipped vertically */ void av_display_matrix_flip(int32_t matrix[9], int hflip, int vflip); /** - * @} * @} */ diff --git a/include/libavutil/dovi_meta.h b/include/libavutil/dovi_meta.h index 3d11e02..5e8a1e4 100644 --- a/include/libavutil/dovi_meta.h +++ b/include/libavutil/dovi_meta.h @@ -29,7 +29,9 @@ #include #include + #include "rational.h" +#include "csp.h" /* * DOVI configuration @@ -44,6 +46,7 @@ * uint8_t el_present_flag * uint8_t bl_present_flag * uint8_t dv_bl_signal_compatibility_id + * uint8_t dv_md_compression, the compression method in use * @endcode * * @note The struct must be allocated with av_dovi_alloc() and @@ -58,8 +61,16 @@ typedef struct AVDOVIDecoderConfigurationRecord { uint8_t el_present_flag; uint8_t bl_present_flag; uint8_t dv_bl_signal_compatibility_id; + uint8_t dv_md_compression; } AVDOVIDecoderConfigurationRecord; +enum AVDOVICompression { + AV_DOVI_COMPRESSION_NONE = 0, + AV_DOVI_COMPRESSION_LIMITED = 1, + AV_DOVI_COMPRESSION_RESERVED = 2, + AV_DOVI_COMPRESSION_EXTENDED = 3, +}; + /** * Allocate a AVDOVIDecoderConfigurationRecord structure and initialize its * fields to default values. @@ -89,6 +100,8 @@ typedef struct AVDOVIRpuDataHeader { uint8_t spatial_resampling_filter_flag; uint8_t el_spatial_resampling_filter_flag; uint8_t disable_residual_flag; + uint8_t ext_mapping_idc_0_4; /* extended base layer inverse mapping indicator */ + uint8_t ext_mapping_idc_5_7; /* reserved */ } AVDOVIRpuDataHeader; enum AVDOVIMappingMethod { @@ -147,6 +160,7 @@ typedef struct AVDOVIDataMapping { uint32_t num_x_partitions; uint32_t num_y_partitions; AVDOVINLQParams nlq[3]; /* per component */ + uint16_t nlq_pivots[2]; } AVDOVIDataMapping; /** @@ -186,6 +200,132 @@ typedef struct AVDOVIColorMetadata { uint16_t source_diagonal; } AVDOVIColorMetadata; +typedef struct AVDOVIDmLevel1 { + /* Per-frame brightness metadata */ + uint16_t min_pq; + uint16_t max_pq; + uint16_t avg_pq; +} AVDOVIDmLevel1; + +typedef struct AVDOVIDmLevel2 { + /* Usually derived from level 8 (at different levels) */ + uint16_t target_max_pq; + uint16_t trim_slope; + uint16_t trim_offset; + uint16_t trim_power; + uint16_t trim_chroma_weight; + uint16_t trim_saturation_gain; + int16_t ms_weight; +} AVDOVIDmLevel2; + +typedef struct AVDOVIDmLevel3 { + uint16_t min_pq_offset; + uint16_t max_pq_offset; + uint16_t avg_pq_offset; +} AVDOVIDmLevel3; + +typedef struct AVDOVIDmLevel4 { + uint16_t anchor_pq; + uint16_t anchor_power; +} AVDOVIDmLevel4; + +typedef struct AVDOVIDmLevel5 { + /* Active area definition */ + uint16_t left_offset; + uint16_t right_offset; + uint16_t top_offset; + uint16_t bottom_offset; +} AVDOVIDmLevel5; + +typedef struct AVDOVIDmLevel6 { + /* Static HDR10 metadata */ + uint16_t max_luminance; + uint16_t min_luminance; + uint16_t max_cll; + uint16_t max_fall; +} AVDOVIDmLevel6; + +typedef struct AVDOVIDmLevel8 { + /* Extended version of level 2 */ + uint8_t target_display_index; + uint16_t trim_slope; + uint16_t trim_offset; + uint16_t trim_power; + uint16_t trim_chroma_weight; + uint16_t trim_saturation_gain; + uint16_t ms_weight; + uint16_t target_mid_contrast; + uint16_t clip_trim; + uint8_t saturation_vector_field[6]; + uint8_t hue_vector_field[6]; +} AVDOVIDmLevel8; + +typedef struct AVDOVIDmLevel9 { + /* Source display characteristics */ + uint8_t source_primary_index; + AVColorPrimariesDesc source_display_primaries; +} AVDOVIDmLevel9; + +typedef struct AVDOVIDmLevel10 { + /* Target display characteristics */ + uint8_t target_display_index; + uint16_t target_max_pq; + uint16_t target_min_pq; + uint8_t target_primary_index; + AVColorPrimariesDesc target_display_primaries; +} AVDOVIDmLevel10; + +typedef struct AVDOVIDmLevel11 { + uint8_t content_type; + uint8_t whitepoint; + uint8_t reference_mode_flag; + uint8_t sharpness; + uint8_t noise_reduction; + uint8_t mpeg_noise_reduction; + uint8_t frame_rate_conversion; + uint8_t brightness; + uint8_t color; +} AVDOVIDmLevel11; + +typedef struct AVDOVIDmLevel254 { + /* DMv2 info block, always present in samples with DMv2 metadata */ + uint8_t dm_mode; + uint8_t dm_version_index; +} AVDOVIDmLevel254; + +typedef struct AVDOVIDmLevel255 { + /* Debug block, not really used in samples */ + uint8_t dm_run_mode; + uint8_t dm_run_version; + uint8_t dm_debug[4]; +} AVDOVIDmLevel255; + +/** + * Dolby Vision metadata extension block. Dynamic extension blocks may change + * from frame to frame, while static blocks are constant throughout the entire + * sequence. + * + * @note sizeof(AVDOVIDmData) is not part of the public API. + */ +typedef struct AVDOVIDmData { + uint8_t level; /* [1, 255] */ + union { + AVDOVIDmLevel1 l1; /* dynamic */ + AVDOVIDmLevel2 l2; /* dynamic, may appear multiple times */ + AVDOVIDmLevel3 l3; /* dynamic */ + AVDOVIDmLevel4 l4; /* dynamic */ + AVDOVIDmLevel5 l5; /* dynamic */ + AVDOVIDmLevel6 l6; /* static */ + /* level 7 is currently unused */ + AVDOVIDmLevel8 l8; /* dynamic, may appear multiple times */ + AVDOVIDmLevel9 l9; /* dynamic */ + AVDOVIDmLevel10 l10; /* static, may appear multiple times */ + AVDOVIDmLevel11 l11; /* dynamic */ + AVDOVIDmLevel254 l254; /* static */ + AVDOVIDmLevel255 l255; /* static */ + }; +} AVDOVIDmData; + /** * Combined struct representing a combination of header, mapping and color * metadata, for attaching to frames as side data. @@ -202,6 +342,13 @@ typedef struct AVDOVIMetadata { size_t header_offset; /* AVDOVIRpuDataHeader */ size_t mapping_offset; /* AVDOVIDataMapping */ size_t color_offset; /* AVDOVIColorMetadata */ + + size_t ext_block_offset; /* offset to start of ext blocks array */ + size_t ext_block_size; /* size per element */ + int num_ext_blocks; /* number of extension blocks */ + + /* static limit on num_ext_blocks, derived from bitstream limitations */ +#define AV_DOVI_MAX_EXT_BLOCKS 32 } AVDOVIMetadata; static av_always_inline AVDOVIRpuDataHeader * @@ -222,6 +369,19 @@ av_dovi_get_color(const AVDOVIMetadata *data) return (AVDOVIColorMetadata *)((uint8_t *) data + data->color_offset); } +static av_always_inline AVDOVIDmData * +av_dovi_get_ext(const AVDOVIMetadata *data, int index) +{ + return (AVDOVIDmData *)((uint8_t *) data + data->ext_block_offset + + data->ext_block_size * index); +} + +/** + * Find an extension block with a given level, or NULL. In the case of + * multiple extension blocks, only the first is returned. + */ +AVDOVIDmData *av_dovi_find_level(const AVDOVIMetadata *data, uint8_t level); + /** * Allocate an AVDOVIMetadata structure and initialize its * fields to default values. diff --git a/include/libavutil/dynarray.h b/include/libavutil/dynarray.h new file mode 100644 index 0000000..3a7e146 --- /dev/null +++ b/include/libavutil/dynarray.h @@ -0,0 +1,70 @@ +/* + * 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 AVUTIL_DYNARRAY_H +#define AVUTIL_DYNARRAY_H + +#include "log.h" +#include "mem.h" + +/** + * Add an element to a dynamic array. + * + * The array is reallocated when its number of elements reaches powers of 2. + * Therefore, the amortized cost of adding an element is constant. + * + * In case of success, the pointer to the array is updated in order to + * point to the new grown array, and the size is incremented. + * + * @param av_size_max maximum size of the array, usually the MAX macro of + * the type of the size + * @param av_elt_size size of the elements in the array, in bytes + * @param av_array pointer to the array, must be a lvalue + * @param av_size size of the array, must be an integer lvalue + * @param av_success statement to execute on success; at this point, the + * size variable is not yet incremented + * @param av_failure statement to execute on failure; if this happens, the + * array and size are not changed; the statement can end + * with a return or a goto + */ +#define FF_DYNARRAY_ADD(av_size_max, av_elt_size, av_array, av_size, \ + av_success, av_failure) \ + do { \ + size_t av_size_new = (av_size); \ + if (!((av_size) & ((av_size) - 1))) { \ + av_size_new = (av_size) ? (av_size) << 1 : 1; \ + if (av_size_new > (av_size_max) / (av_elt_size)) { \ + av_size_new = 0; \ + } else { \ + void *av_array_new = \ + av_realloc((av_array), av_size_new * (av_elt_size)); \ + if (!av_array_new) \ + av_size_new = 0; \ + else \ + (av_array) = av_array_new; \ + } \ + } \ + if (av_size_new) { \ + { av_success } \ + (av_size)++; \ + } else { \ + av_failure \ + } \ + } while (0) + +#endif /* AVUTIL_DYNARRAY_H */ diff --git a/include/libavutil/emms.h b/include/libavutil/emms.h new file mode 100644 index 0000000..4ec0127 --- /dev/null +++ b/include/libavutil/emms.h @@ -0,0 +1,66 @@ +/* + * 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 AVUTIL_EMMS_H +#define AVUTIL_EMMS_H + +#include "config.h" +#include "libavutil/attributes.h" + +#if ARCH_X86 + +void avpriv_emms_asm(void); + +#if HAVE_MMX_INLINE +#ifndef __MMX__ +#include "libavutil/cpu.h" +#endif + +# define emms_c emms_c +/** + * Empty mmx state. + * this must be called between any dsp function and float/double code. + * for example sin(); dsp->idct_put(); emms_c(); cos() + * Note, *alloc() and *free() also use float code in some libc implementations + * thus this also applies to them or any function using them. + */ +static av_always_inline void emms_c(void) +{ +/* Some inlined functions may also use mmx instructions regardless of + * runtime cpuflags. With that in mind, we unconditionally empty the + * mmx state if the target cpu chosen at configure time supports it. + */ +#if !defined(__MMX__) + if(av_get_cpu_flags() & AV_CPU_FLAG_MMX) +#endif + __asm__ volatile ("emms" ::: "memory"); +} +#elif HAVE_MMX && HAVE_MM_EMPTY +# include +# define emms_c _mm_empty +#elif HAVE_MMX_EXTERNAL +# define emms_c avpriv_emms_asm +#endif /* HAVE_MMX_INLINE */ + +#endif /* ARCH_X86 */ + +#ifndef emms_c +# define emms_c() do {} while(0) +#endif + +#endif /* AVUTIL_EMMS_H */ diff --git a/include/libavutil/error.h b/include/libavutil/error.h index 0d3269a..1efa86c 100755 --- a/include/libavutil/error.h +++ b/include/libavutil/error.h @@ -79,6 +79,7 @@ #define AVERROR_HTTP_UNAUTHORIZED FFERRTAG(0xF8,'4','0','1') #define AVERROR_HTTP_FORBIDDEN FFERRTAG(0xF8,'4','0','3') #define AVERROR_HTTP_NOT_FOUND FFERRTAG(0xF8,'4','0','4') +#define AVERROR_HTTP_TOO_MANY_REQUESTS FFERRTAG(0xF8,'4','2','9') #define AVERROR_HTTP_OTHER_4XX FFERRTAG(0xF8,'4','X','X') #define AVERROR_HTTP_SERVER_ERROR FFERRTAG(0xF8,'5','X','X') diff --git a/include/libavutil/eval.h b/include/libavutil/eval.h index 57afc2d..0d3eaeb 100755 --- a/include/libavutil/eval.h +++ b/include/libavutil/eval.h @@ -42,6 +42,7 @@ typedef struct AVExpr AVExpr; * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2 + * @param log_offset log level offset, can be used to silence error messages * @param log_ctx parent logging context * @return >= 0 in case of success, a negative value corresponding to an * AVERROR code otherwise @@ -65,6 +66,7 @@ int av_expr_parse_and_eval(double *res, const char *s, * @param funcs1 NULL terminated array of function pointers for functions which take 1 argument * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments + * @param log_offset log level offset, can be used to silence error messages * @param log_ctx parent logging context * @return >= 0 in case of success, a negative value corresponding to an * AVERROR code otherwise @@ -78,6 +80,7 @@ int av_expr_parse(AVExpr **expr, const char *s, /** * Evaluate a previously parsed expression. * + * @param e the AVExpr to evaluate * @param const_values a zero terminated array of values for the identifiers from av_expr_parse() const_names * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2 * @return the value of the expression @@ -87,6 +90,7 @@ double av_expr_eval(AVExpr *e, const double *const_values, void *opaque); /** * Track the presence of variables and their number of occurrences in a parsed expression * + * @param e the AVExpr to track variables in * @param counter a zero-initialized array where the count of each variable will be stored * @param size size of array * @return 0 on success, a negative value indicates that no expression or array was passed @@ -98,9 +102,10 @@ int av_expr_count_vars(AVExpr *e, unsigned *counter, int size); * Track the presence of user provided functions and their number of occurrences * in a parsed expression. * + * @param e the AVExpr to track user provided functions in * @param counter a zero-initialized array where the count of each function will be stored * if you passed 5 functions with 2 arguments to av_expr_parse() - * then for arg=2 this will use upto 5 entries. + * then for arg=2 this will use up to 5 entries. * @param size size of array * @param arg number of arguments the counted functions have * @return 0 on success, a negative value indicates that no expression or array was passed diff --git a/include/libavutil/executor.h b/include/libavutil/executor.h new file mode 100644 index 0000000..0eb21c1 --- /dev/null +++ b/include/libavutil/executor.h @@ -0,0 +1,67 @@ +/* + * Copyright (C) 2023 Nuo Mi + * + * 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 AVUTIL_EXECUTOR_H +#define AVUTIL_EXECUTOR_H + +typedef struct AVExecutor AVExecutor; +typedef struct AVTask AVTask; + +struct AVTask { + AVTask *next; +}; + +typedef struct AVTaskCallbacks { + void *user_data; + + int local_context_size; + + // return 1 if a's priority > b's priority + int (*priority_higher)(const AVTask *a, const AVTask *b); + + // task is ready for run + int (*ready)(const AVTask *t, void *user_data); + + // run the task + int (*run)(AVTask *t, void *local_context, void *user_data); +} AVTaskCallbacks; + +/** + * Alloc executor + * @param callbacks callback structure for executor + * @param thread_count worker thread number, 0 for run on caller's thread directly + * @return return the executor + */ +AVExecutor* av_executor_alloc(const AVTaskCallbacks *callbacks, int thread_count); + +/** + * Free executor + * @param e pointer to executor + */ +void av_executor_free(AVExecutor **e); + +/** + * Add task to executor + * @param e pointer to executor + * @param t pointer to task. If NULL, it will wakeup one work thread + */ +void av_executor_execute(AVExecutor *e, AVTask *t); + +#endif //AVUTIL_EXECUTOR_H diff --git a/include/libavutil/ffmath.h b/include/libavutil/ffmath.h new file mode 100644 index 0000000..aad1347 --- /dev/null +++ b/include/libavutil/ffmath.h @@ -0,0 +1,67 @@ +/* + * copyright (c) 2016 Ganesh Ajjanagadde + * + * 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 + */ + +/** + * @file + * internal math functions header + */ + +#ifndef AVUTIL_FFMATH_H +#define AVUTIL_FFMATH_H + +#include "attributes.h" +#include "libm.h" + +/** + * Compute 10^x for floating point values. Note: this function is by no means + * "correctly rounded", and is meant as a fast, reasonably accurate approximation. + * For instance, maximum relative error for the double precision variant is + * ~ 1e-13 for very small and very large values. + * This is ~2x faster than GNU libm's approach, which is still off by 2ulp on + * some inputs. + * @param x exponent + * @return 10^x + */ +static av_always_inline double ff_exp10(double x) +{ + return exp2(M_LOG2_10 * x); +} + +static av_always_inline float ff_exp10f(float x) +{ + return exp2f(M_LOG2_10 * x); +} + +/** + * Compute x^y for floating point x, y. Note: this function is faster than the + * libm variant due to mainly 2 reasons: + * 1. It does not handle any edge cases. In particular, this is only guaranteed + * to work correctly for x > 0. + * 2. It is not as accurate as a standard nearly "correctly rounded" libm variant. + * @param x base + * @param y exponent + * @return x^y + */ +static av_always_inline float ff_fast_powf(float x, float y) +{ + return expf(logf(x) * y); +} + +#endif /* AVUTIL_FFMATH_H */ diff --git a/include/libavutil/fifo.h b/include/libavutil/fifo.h index 4eed364..f2206c3 100755 --- a/include/libavutil/fifo.h +++ b/include/libavutil/fifo.h @@ -18,17 +18,22 @@ /** * @file - * a very simple circular buffer FIFO implementation + * @ingroup lavu_fifo + * A generic FIFO API */ #ifndef AVUTIL_FIFO_H #define AVUTIL_FIFO_H #include -#include -#include "attributes.h" -#include "version.h" +/** + * @defgroup lavu_fifo AVFifo + * @ingroup lavu_data + * + * @{ + * A generic FIFO API + */ typedef struct AVFifo AVFifo; @@ -88,7 +93,13 @@ void av_fifo_auto_grow_limit(AVFifo *f, size_t max_elems); size_t av_fifo_can_read(const AVFifo *f); /** - * @return number of elements that can be written into the given FIFO. + * @return Number of elements that can be written into the given FIFO without + * growing it. + * + * In other words, this number of elements or less is guaranteed to fit + * into the FIFO. More data may be written when the + * AV_FIFO_FLAG_AUTO_GROW flag was specified at FIFO creation, but this + * may involve memory allocation, which can fail. */ size_t av_fifo_can_write(const AVFifo *f); @@ -109,9 +120,12 @@ int av_fifo_grow2(AVFifo *f, size_t inc); /** * Write data into a FIFO. * - * In case nb_elems > av_fifo_can_write(f), nothing is written and an error + * In case nb_elems > av_fifo_can_write(f) and the AV_FIFO_FLAG_AUTO_GROW flag + * was not specified at FIFO creation, nothing is written and an error * is returned. * + * Calling function is guaranteed to succeed if nb_elems <= av_fifo_can_write(f). + * * @param f the FIFO buffer * @param buf Data to be written. nb_elems * av_fifo_elem_size(f) bytes will be * read from buf on success. @@ -182,7 +196,7 @@ int av_fifo_read_to_cb(AVFifo *f, AVFifoCB write_cb, * * @return a non-negative number on success, a negative error code on failure */ -int av_fifo_peek(AVFifo *f, void *buf, size_t nb_elems, size_t offset); +int av_fifo_peek(const AVFifo *f, void *buf, size_t nb_elems, size_t offset); /** * Feed data from a FIFO into a user-provided callback. @@ -199,7 +213,7 @@ int av_fifo_peek(AVFifo *f, void *buf, size_t nb_elems, size_t offset); * * @return a non-negative number on success, a negative error code on failure */ -int av_fifo_peek_to_cb(AVFifo *f, AVFifoCB write_cb, void *opaque, +int av_fifo_peek_to_cb(const AVFifo *f, AVFifoCB write_cb, void *opaque, size_t *nb_elems, size_t offset); /** @@ -221,206 +235,8 @@ void av_fifo_reset2(AVFifo *f); */ void av_fifo_freep2(AVFifo **f); - -#if FF_API_FIFO_OLD_API -typedef struct AVFifoBuffer { - uint8_t *buffer; - uint8_t *rptr, *wptr, *end; - uint32_t rndx, wndx; -} AVFifoBuffer; - /** - * Initialize an AVFifoBuffer. - * @param size of FIFO - * @return AVFifoBuffer or NULL in case of memory allocation failure - * @deprecated use av_fifo_alloc2() + * @} */ -attribute_deprecated -AVFifoBuffer *av_fifo_alloc(unsigned int size); - -/** - * Initialize an AVFifoBuffer. - * @param nmemb number of elements - * @param size size of the single element - * @return AVFifoBuffer or NULL in case of memory allocation failure - * @deprecated use av_fifo_alloc2() - */ -attribute_deprecated -AVFifoBuffer *av_fifo_alloc_array(size_t nmemb, size_t size); - -/** - * Free an AVFifoBuffer. - * @param f AVFifoBuffer to free - * @deprecated use the AVFifo API with av_fifo_freep2() - */ -attribute_deprecated -void av_fifo_free(AVFifoBuffer *f); - -/** - * Free an AVFifoBuffer and reset pointer to NULL. - * @param f AVFifoBuffer to free - * @deprecated use the AVFifo API with av_fifo_freep2() - */ -attribute_deprecated -void av_fifo_freep(AVFifoBuffer **f); - -/** - * Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied. - * @param f AVFifoBuffer to reset - * @deprecated use av_fifo_reset2() with the new AVFifo-API - */ -attribute_deprecated -void av_fifo_reset(AVFifoBuffer *f); - -/** - * Return the amount of data in bytes in the AVFifoBuffer, that is the - * amount of data you can read from it. - * @param f AVFifoBuffer to read from - * @return size - * @deprecated use av_fifo_can_read() with the new AVFifo-API - */ -attribute_deprecated -int av_fifo_size(const AVFifoBuffer *f); - -/** - * Return the amount of space in bytes in the AVFifoBuffer, that is the - * amount of data you can write into it. - * @param f AVFifoBuffer to write into - * @return size - * @deprecated use av_fifo_can_write() with the new AVFifo-API - */ -attribute_deprecated -int av_fifo_space(const AVFifoBuffer *f); - -/** - * Feed data at specific position from an AVFifoBuffer to a user-supplied callback. - * Similar as av_fifo_gereric_read but without discarding data. - * @param f AVFifoBuffer to read from - * @param offset offset from current read position - * @param buf_size number of bytes to read - * @param func generic read function - * @param dest data destination - * - * @return a non-negative number on success, a negative error code on failure - * - * @deprecated use the new AVFifo-API with av_fifo_peek() when func == NULL, - * av_fifo_peek_to_cb() otherwise - */ -attribute_deprecated -int av_fifo_generic_peek_at(AVFifoBuffer *f, void *dest, int offset, int buf_size, void (*func)(void*, void*, int)); - -/** - * Feed data from an AVFifoBuffer to a user-supplied callback. - * Similar as av_fifo_gereric_read but without discarding data. - * @param f AVFifoBuffer to read from - * @param buf_size number of bytes to read - * @param func generic read function - * @param dest data destination - * - * @return a non-negative number on success, a negative error code on failure - * - * @deprecated use the new AVFifo-API with av_fifo_peek() when func == NULL, - * av_fifo_peek_to_cb() otherwise - */ -attribute_deprecated -int av_fifo_generic_peek(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int)); - -/** - * Feed data from an AVFifoBuffer to a user-supplied callback. - * @param f AVFifoBuffer to read from - * @param buf_size number of bytes to read - * @param func generic read function - * @param dest data destination - * - * @return a non-negative number on success, a negative error code on failure - * - * @deprecated use the new AVFifo-API with av_fifo_read() when func == NULL, - * av_fifo_read_to_cb() otherwise - */ -attribute_deprecated -int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int)); - -/** - * Feed data from a user-supplied callback to an AVFifoBuffer. - * @param f AVFifoBuffer to write to - * @param src data source; non-const since it may be used as a - * modifiable context by the function defined in func - * @param size number of bytes to write - * @param func generic write function; the first parameter is src, - * the second is dest_buf, the third is dest_buf_size. - * func must return the number of bytes written to dest_buf, or <= 0 to - * indicate no more data available to write. - * If func is NULL, src is interpreted as a simple byte array for source data. - * @return the number of bytes written to the FIFO or a negative error code on failure - * - * @deprecated use the new AVFifo-API with av_fifo_write() when func == NULL, - * av_fifo_write_from_cb() otherwise - */ -attribute_deprecated -int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int)); - -/** - * Resize an AVFifoBuffer. - * In case of reallocation failure, the old FIFO is kept unchanged. - * - * @param f AVFifoBuffer to resize - * @param size new AVFifoBuffer size in bytes - * @return <0 for failure, >=0 otherwise - * - * @deprecated use the new AVFifo-API with av_fifo_grow2() to increase FIFO size, - * decreasing FIFO size is not supported - */ -attribute_deprecated -int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size); - -/** - * Enlarge an AVFifoBuffer. - * In case of reallocation failure, the old FIFO is kept unchanged. - * The new fifo size may be larger than the requested size. - * - * @param f AVFifoBuffer to resize - * @param additional_space the amount of space in bytes to allocate in addition to av_fifo_size() - * @return <0 for failure, >=0 otherwise - * - * @deprecated use the new AVFifo-API with av_fifo_grow2(); note that unlike - * this function it adds to the allocated size, rather than to the used size - */ -attribute_deprecated -int av_fifo_grow(AVFifoBuffer *f, unsigned int additional_space); - -/** - * Read and discard the specified amount of data from an AVFifoBuffer. - * @param f AVFifoBuffer to read from - * @param size amount of data to read in bytes - * - * @deprecated use the new AVFifo-API with av_fifo_drain2() - */ -attribute_deprecated -void av_fifo_drain(AVFifoBuffer *f, int size); - -#if FF_API_FIFO_PEEK2 -/** - * Return a pointer to the data stored in a FIFO buffer at a certain offset. - * The FIFO buffer is not modified. - * - * @param f AVFifoBuffer to peek at, f must be non-NULL - * @param offs an offset in bytes, its absolute value must be less - * than the used buffer size or the returned pointer will - * point outside to the buffer data. - * The used buffer size can be checked with av_fifo_size(). - * @deprecated use the new AVFifo-API with av_fifo_peek() or av_fifo_peek_to_cb() - */ -attribute_deprecated -static inline uint8_t *av_fifo_peek2(const AVFifoBuffer *f, int offs) -{ - uint8_t *ptr = f->rptr + offs; - if (ptr >= f->end) - ptr = f->buffer + (ptr - f->end); - else if (ptr < f->buffer) - ptr = f->end - (f->buffer - ptr); - return ptr; -} -#endif -#endif #endif /* AVUTIL_FIFO_H */ diff --git a/include/libavutil/file.h b/include/libavutil/file.h index 8ec210e..fced170 100755 --- a/include/libavutil/file.h +++ b/include/libavutil/file.h @@ -38,6 +38,9 @@ * case *bufptr will be set to NULL and *size will be set to 0. * The returned buffer must be released with av_file_unmap(). * + * @param filename path to the file + * @param[out] bufptr pointee is set to the mapped or allocated buffer + * @param[out] size pointee is set to the size in bytes of the buffer * @param log_offset loglevel offset used for logging * @param log_ctx context used for logging * @return a non negative number in case of success, a negative value @@ -50,23 +53,10 @@ int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, /** * Unmap or free the buffer bufptr created by av_file_map(). * + * @param bufptr the buffer previously created with av_file_map() * @param size size in bytes of bufptr, must be the same as returned * by av_file_map() */ void av_file_unmap(uint8_t *bufptr, size_t size); -/** - * Wrapper to work around the lack of mkstemp() on mingw. - * Also, tries to create file in /tmp first, if possible. - * *prefix can be a character constant; *filename will be allocated internally. - * @return file descriptor of opened file (or negative value corresponding to an - * AVERROR code on error) - * and opened file name in **filename. - * @note On very old libcs it is necessary to set a secure umask before - * calling this, av_tempfile() can't call umask itself as it is used in - * libraries and could interfere with the calling application. - * @deprecated as fd numbers cannot be passed saftely between libs on some platforms - */ -int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx); - #endif /* AVUTIL_FILE_H */ diff --git a/include/libavutil/file_open.h b/include/libavutil/file_open.h new file mode 100644 index 0000000..6a00004 --- /dev/null +++ b/include/libavutil/file_open.h @@ -0,0 +1,57 @@ +/* + * 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 AVUTIL_FILE_OPEN_H +#define AVUTIL_FILE_OPEN_H + +#include + +#include "config.h" +#include "attributes.h" + +#if HAVE_LIBC_MSVCRT +#define avpriv_fopen_utf8 ff_fopen_utf8 +#define avpriv_open ff_open +#define avpriv_tempfile ff_tempfile +#endif + + /** + * A wrapper for open() setting O_CLOEXEC. + */ +av_warn_unused_result +int avpriv_open(const char *filename, int flags, ...); + +/** + * Open a file using a UTF-8 filename. + */ +FILE *avpriv_fopen_utf8(const char *path, const char *mode); + +/** + * Wrapper to work around the lack of mkstemp() on mingw. + * Also, tries to create file in /tmp first, if possible. + * *prefix can be a character constant; *filename will be allocated internally. + * @return file descriptor of opened file (or negative value corresponding to an + * AVERROR code on error) + * and opened file name in **filename. + * @note On very old libcs it is necessary to set a secure umask before + * calling this, av_tempfile() can't call umask itself as it is used in + * libraries and could interfere with the calling application. + */ +int avpriv_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx); + +#endif /* AVUTIL_FILE_OPEN_H */ diff --git a/include/libavutil/film_grain_params.h b/include/libavutil/film_grain_params.h index f3bd0a4..ccacab8 100644 --- a/include/libavutil/film_grain_params.h +++ b/include/libavutil/film_grain_params.h @@ -136,20 +136,42 @@ typedef struct AVFilmGrainH274Params { */ int model_id; - /** - * Specifies the bit depth used for the luma component. - */ +#if FF_API_H274_FILM_GRAIN_VCS + /** + * TODO: On this ABI bump, please also re-order the fields in + * AVFilmGrainParams (see below) + */ + + /** + * Specifies the bit depth used for the luma component. + * + * @deprecated use AVFilmGrainParams.bit_depth_luma. + */ + attribute_deprecated int bit_depth_luma; /** * Specifies the bit depth used for the chroma components. + * + * @deprecated use AVFilmGrainParams.bit_depth_chroma. */ + attribute_deprecated int bit_depth_chroma; + /** + * Specifies the video signal characteristics. + * + * @deprecated use AVFilmGrainParams.color_{range,primaries,trc,space}. + */ + attribute_deprecated enum AVColorRange color_range; + attribute_deprecated enum AVColorPrimaries color_primaries; + attribute_deprecated enum AVColorTransferCharacteristic color_trc; + attribute_deprecated enum AVColorSpace color_space; +#endif /** * Specifies the blending mode used to blend the simulated film grain @@ -231,11 +253,40 @@ typedef struct AVFilmGrainParams { * Additional fields may be added both here and in any structure included. * If a codec's film grain structure differs slightly over another * codec's, fields within may change meaning depending on the type. + * + * TODO: Move this to the end of the structure, at the next ABI bump. */ union { AVFilmGrainAOMParams aom; AVFilmGrainH274Params h274; } codec; + + /** + * Intended display resolution. May be 0 if the codec does not specify + * any restrictions. + */ + + int width, height; + + /** + * Intended subsampling ratio, or 0 for luma-only streams. + */ + int subsampling_x, subsampling_y; + + /** + * Intended video signal characteristics. + */ + enum AVColorRange color_range; + enum AVColorPrimaries color_primaries; + enum AVColorTransferCharacteristic color_trc; + enum AVColorSpace color_space; + + /** + * Intended bit depth, or 0 for unknown/unspecified. + */ + int bit_depth_luma; + int bit_depth_chroma; + } AVFilmGrainParams; /** @@ -257,4 +308,15 @@ AVFilmGrainParams *av_film_grain_params_alloc(size_t *size); */ AVFilmGrainParams *av_film_grain_params_create_side_data(AVFrame *frame); +/** + * Select the most appropriate film grain parameters set for the frame, + * taking into account the frame's format, resolution and video signal + * characteristics. + * + * @note, for H.274, this may select a film grain parameter set with + * greater chroma resolution than the frame. Users should take care to + * correctly adjust the chroma grain frequency to the frame. + */ +const AVFilmGrainParams *av_film_grain_params_select(const AVFrame *frame); + #endif /* AVUTIL_FILM_GRAIN_PARAMS_H */ diff --git a/include/libavutil/fixed_dsp.h b/include/libavutil/fixed_dsp.h new file mode 100644 index 0000000..9b566af --- /dev/null +++ b/include/libavutil/fixed_dsp.h @@ -0,0 +1,205 @@ +/* + * Copyright (c) 2012 + * MIPS Technologies, Inc., California. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the MIPS Technologies, Inc., nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Author: Nedeljko Babic (nbabic@mips.com) + * + * 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 AVUTIL_FIXED_DSP_H +#define AVUTIL_FIXED_DSP_H + +#include +#include "attributes.h" +#include "libavcodec/mathops.h" + +typedef struct AVFixedDSPContext { + /* Assume len is a multiple of 16, and arrays are 32-byte aligned */ + /* Results of multiplications are scaled down by 31 bit (and rounded) if not + * stated otherwise */ + + /** + * Overlap/add with window function. + * Result is scaled down by "bits" bits. + * Used primarily by MDCT-based audio codecs. + * Source and destination vectors must overlap exactly or not at all. + * + * @param dst result vector + * constraints: 16-byte aligned + * @param src0 first source vector + * constraints: 16-byte aligned + * @param src1 second source vector + * constraints: 16-byte aligned + * @param win half-window vector + * constraints: 16-byte aligned + * @param len length of vector + * constraints: multiple of 4 + * @param bits scaling parameter + * + */ + void (*vector_fmul_window_scaled)(int16_t *dst, const int32_t *src0, const int32_t *src1, const int32_t *win, int len, uint8_t bits); + + /** + * Overlap/add with window function. + * Used primarily by MDCT-based audio codecs. + * Source and destination vectors must overlap exactly or not at all. + * + * @param dst result vector + * constraints: 32-byte aligned + * @param src0 first source vector + * constraints: 16-byte aligned + * @param src1 second source vector + * constraints: 16-byte aligned + * @param win half-window vector + * constraints: 16-byte aligned + * @param len length of vector + * constraints: multiple of 4 + */ + void (*vector_fmul_window)(int32_t *dst, const int32_t *src0, const int32_t *src1, const int32_t *win, int len); + + /** + * Fixed-point multiplication that calculates the entry wise product of two + * vectors of integers and stores the result in a vector of integers. + * + * @param dst output vector + * constraints: 32-byte aligned + * @param src0 first input vector + * constraints: 32-byte aligned + * @param src1 second input vector + * constraints: 32-byte aligned + * @param len number of elements in the input + * constraints: multiple of 16 + */ + void (*vector_fmul)(int *dst, const int *src0, const int *src1, + int len); + + void (*vector_fmul_reverse)(int *dst, const int *src0, const int *src1, int len); + /** + * Calculate the entry wise product of two vectors of integers, add a third vector of + * integers and store the result in a vector of integers. + * + * @param dst output vector + * constraints: 32-byte aligned + * @param src0 first input vector + * constraints: 32-byte aligned + * @param src1 second input vector + * constraints: 32-byte aligned + * @param src2 third input vector + * constraints: 32-byte aligned + * @param len number of elements in the input + * constraints: multiple of 16 + */ + void (*vector_fmul_add)(int *dst, const int *src0, const int *src1, + const int *src2, int len); + + /** + * Calculate the scalar product of two vectors of integers. + * + * @param v1 first vector, 16-byte aligned + * @param v2 second vector, 16-byte aligned + * @param len length of vectors, multiple of 4 + * + * @return sum of elementwise products + */ + int (*scalarproduct_fixed)(const int *v1, const int *v2, int len); + + /** + * Calculate the sum and difference of two vectors of integers. + * + * @param v1 first input vector, sum output, 16-byte aligned + * @param v2 second input vector, difference output, 16-byte aligned + * @param len length of vectors, multiple of 4 + */ + void (*butterflies_fixed)(int *restrict v1, int *restrict v2, int len); +} AVFixedDSPContext; + +/** + * Allocate and initialize a fixed DSP context. + * note: should be freed with a av_free call when no longer needed. + * + * @param strict setting to non-zero avoids using functions which may not be IEEE-754 compliant + */ +AVFixedDSPContext * avpriv_alloc_fixed_dsp(int strict); + +void ff_fixed_dsp_init_riscv(AVFixedDSPContext *fdsp); +void ff_fixed_dsp_init_x86(AVFixedDSPContext *fdsp); + +/** + * Calculate the square root + * + * @param x input fixed point number + * + * @param bits format of fixed point number (32 - bits).bits + * + * note: input is normalized to (0, 1) fixed point value + */ + +static av_always_inline int fixed_sqrt(int x, int bits) +{ + int retval, bit_mask, guess, square, i; + int64_t accu; + int shift1 = 30 - bits; + int shift2 = bits - 15; + + if (shift1 > 0) retval = ff_sqrt(x << shift1); + else retval = ff_sqrt(x >> -shift1); + + if (shift2 > 0) { + retval = retval << shift2; + bit_mask = (1 << (shift2 - 1)); + + for (i=0; i> bits); + if (x >= square) + retval += bit_mask; + bit_mask >>= 1; + } + + } + else retval >>= (-shift2); + + return retval; +} + +#endif /* AVUTIL_FIXED_DSP_H */ diff --git a/include/libavutil/float2half.h b/include/libavutil/float2half.h new file mode 100644 index 0000000..e619046 --- /dev/null +++ b/include/libavutil/float2half.h @@ -0,0 +1,56 @@ +/* + * 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 AVUTIL_FLOAT2HALF_H +#define AVUTIL_FLOAT2HALF_H + +#include +#include "intfloat.h" + +#include "config.h" + +typedef struct Float2HalfTables { +#if HAVE_FAST_FLOAT16 + uint8_t dummy; +#else + uint16_t basetable[512]; + uint8_t shifttable[512]; +#endif +} Float2HalfTables; + +void ff_init_float2half_tables(Float2HalfTables *t); + +static inline uint16_t float2half(uint32_t f, const Float2HalfTables *t) +{ +#if HAVE_FAST_FLOAT16 + union { + _Float16 f; + uint16_t i; + } u; + u.f = av_int2float(f); + return u.i; +#else + uint16_t h; + + h = t->basetable[(f >> 23) & 0x1ff] + ((f & 0x007fffff) >> t->shifttable[(f >> 23) & 0x1ff]); + + return h; +#endif +} + +#endif /* AVUTIL_FLOAT2HALF_H */ diff --git a/include/libavutil/float_dsp.h b/include/libavutil/float_dsp.h new file mode 100644 index 0000000..a99edc3 --- /dev/null +++ b/include/libavutil/float_dsp.h @@ -0,0 +1,246 @@ +/* + * 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 AVUTIL_FLOAT_DSP_H +#define AVUTIL_FLOAT_DSP_H + +#include + +typedef struct AVFloatDSPContext { + /** + * Calculate the entry wise product of two vectors of floats and store the result in + * a vector of floats. + * + * @param dst output vector + * constraints: 32-byte aligned + * @param src0 first input vector + * constraints: 32-byte aligned + * @param src1 second input vector + * constraints: 32-byte aligned + * @param len number of elements in the input + * constraints: multiple of 16 + */ + void (*vector_fmul)(float *dst, const float *src0, const float *src1, + int len); + + /** + * Multiply a vector of floats by a scalar float and add to + * destination vector. Source and destination vectors must + * overlap exactly or not at all. + * + * @param dst result vector + * constraints: 32-byte aligned + * @param src input vector + * constraints: 32-byte aligned + * @param mul scalar value + * @param len length of vector + * constraints: multiple of 16 + */ + void (*vector_fmac_scalar)(float *dst, const float *src, float mul, + int len); + + /** + * Multiply a vector of doubles by a scalar double and add to + * destination vector. Source and destination vectors must + * overlap exactly or not at all. + * + * @param dst result vector + * constraints: 32-byte aligned + * @param src input vector + * constraints: 32-byte aligned + * @param mul scalar value + * @param len length of vector + * constraints: multiple of 16 + */ + void (*vector_dmac_scalar)(double *dst, const double *src, double mul, + int len); + + /** + * Multiply a vector of floats by a scalar float. Source and + * destination vectors must overlap exactly or not at all. + * + * @param dst result vector + * constraints: 16-byte aligned + * @param src input vector + * constraints: 16-byte aligned + * @param mul scalar value + * @param len length of vector + * constraints: multiple of 4 + */ + void (*vector_fmul_scalar)(float *dst, const float *src, float mul, + int len); + + /** + * Multiply a vector of double by a scalar double. Source and + * destination vectors must overlap exactly or not at all. + * + * @param dst result vector + * constraints: 32-byte aligned + * @param src input vector + * constraints: 32-byte aligned + * @param mul scalar value + * @param len length of vector + * constraints: multiple of 8 + */ + void (*vector_dmul_scalar)(double *dst, const double *src, double mul, + int len); + + /** + * Overlap/add with window function. + * Used primarily by MDCT-based audio codecs. + * Source and destination vectors must overlap exactly or not at all. + * + * @param dst result vector + * constraints: 16-byte aligned + * @param src0 first source vector + * constraints: 16-byte aligned + * @param src1 second source vector + * constraints: 16-byte aligned + * @param win half-window vector + * constraints: 16-byte aligned + * @param len length of vector + * constraints: multiple of 4 + */ + void (*vector_fmul_window)(float *dst, const float *src0, + const float *src1, const float *win, int len); + + /** + * Calculate the entry wise product of two vectors of floats, add a third vector of + * floats and store the result in a vector of floats. + * + * @param dst output vector + * constraints: 32-byte aligned + * @param src0 first input vector + * constraints: 32-byte aligned + * @param src1 second input vector + * constraints: 32-byte aligned + * @param src2 third input vector + * constraints: 32-byte aligned + * @param len number of elements in the input + * constraints: multiple of 16 + */ + void (*vector_fmul_add)(float *dst, const float *src0, const float *src1, + const float *src2, int len); + + /** + * Calculate the entry wise product of two vectors of floats, and store the result + * in a vector of floats. The second vector of floats is iterated over + * in reverse order. + * + * @param dst output vector + * constraints: 32-byte aligned + * @param src0 first input vector + * constraints: 32-byte aligned + * @param src1 second input vector + * constraints: 32-byte aligned + * @param len number of elements in the input + * constraints: multiple of 16 + */ + void (*vector_fmul_reverse)(float *dst, const float *src0, + const float *src1, int len); + + /** + * Calculate the sum and difference of two vectors of floats. + * + * @param v1 first input vector, sum output, 16-byte aligned + * @param v2 second input vector, difference output, 16-byte aligned + * @param len length of vectors, multiple of 4 + */ + void (*butterflies_float)(float *restrict v1, float *restrict v2, int len); + + /** + * Calculate the scalar product of two vectors of floats. + * + * @param v1 first vector, 16-byte aligned + * @param v2 second vector, 16-byte aligned + * @param len length of vectors, multiple of 4 + * + * @return sum of elementwise products + */ + float (*scalarproduct_float)(const float *v1, const float *v2, int len); + + /** + * Calculate the entry wise product of two vectors of doubles and store the result in + * a vector of doubles. + * + * @param dst output vector + * constraints: 32-byte aligned + * @param src0 first input vector + * constraints: 32-byte aligned + * @param src1 second input vector + * constraints: 32-byte aligned + * @param len number of elements in the input + * constraints: multiple of 16 + */ + void (*vector_dmul)(double *dst, const double *src0, const double *src1, + int len); + + /** + * Calculate the scalar product of two vectors of doubles. + * + * @param v1 first vector + * constraints: 32-byte aligned + * @param v2 second vector + * constraints: 32-byte aligned + * @param len length of vectors + * constraints: multiple of 16 + * + * @return inner product of the vectors + */ + double (*scalarproduct_double)(const double *v1, const double *v2, + size_t len); +} AVFloatDSPContext; + +/** + * Return the scalar product of two vectors of floats. + * + * @param v1 first input vector + * @param v2 first input vector + * @param len number of elements + * + * @return sum of elementwise products + */ +float avpriv_scalarproduct_float_c(const float *v1, const float *v2, int len); + +/** + * Return the scalar product of two vectors of doubles. + * + * @param v1 first input vector + * @param v2 first input vector + * @param len number of elements + * + * @return inner product of the vectors + */ +double ff_scalarproduct_double_c(const double *v1, const double *v2, + size_t len); + +void ff_float_dsp_init_aarch64(AVFloatDSPContext *fdsp); +void ff_float_dsp_init_arm(AVFloatDSPContext *fdsp); +void ff_float_dsp_init_ppc(AVFloatDSPContext *fdsp, int strict); +void ff_float_dsp_init_riscv(AVFloatDSPContext *fdsp); +void ff_float_dsp_init_x86(AVFloatDSPContext *fdsp); +void ff_float_dsp_init_mips(AVFloatDSPContext *fdsp); + +/** + * Allocate a float DSP context. + * + * @param strict setting to non-zero avoids using functions which may not be IEEE-754 compliant + */ +AVFloatDSPContext *avpriv_float_dsp_alloc(int strict); + +#endif /* AVUTIL_FLOAT_DSP_H */ diff --git a/include/libavutil/frame.h b/include/libavutil/frame.h index 33fac20..f780656 100755 --- a/include/libavutil/frame.h +++ b/include/libavutil/frame.h @@ -180,6 +180,10 @@ enum AVFrameSideDataType { /** * Film grain parameters for a frame, described by AVFilmGrainParams. * Must be present for every frame which should have film grain applied. + * + * May be present multiple times, for example when there are multiple + * alternative parameter sets for different video signal characteristics. + * The user should select the most appropriate set for the application. */ AV_FRAME_DATA_FILM_GRAIN_PARAMS, @@ -209,6 +213,36 @@ enum AVFrameSideDataType { * volume transform - CUVA 005.1-2021. */ AV_FRAME_DATA_DYNAMIC_HDR_VIVID, + + /** + * Ambient viewing environment metadata, as defined by H.274. + */ + AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT, + + /** + * Provide encoder-specific hinting information about changed/unchanged + * portions of a frame. It can be used to pass information about which + * macroblocks can be skipped because they didn't change from the + * corresponding ones in the previous frame. This could be useful for + * applications which know this information in advance to speed up + * encoding. + */ + AV_FRAME_DATA_VIDEO_HINT, + + /** + * Raw LCEVC payload data, as a uint8_t array, with NAL emulation + * bytes intact. + */ + AV_FRAME_DATA_LCEVC, + + /** + * This side data must be associated with a video frame. + * The presence of this side data indicates that the video stream is + * composed of multiple views (e.g. stereoscopic 3D content, + * cf. H.264 Annex H or H.265 Annex G). + * The data is an int storing the view ID. + */ + AV_FRAME_DATA_VIEW_ID, }; enum AVActiveFormatDescription { @@ -236,6 +270,37 @@ typedef struct AVFrameSideData { AVBufferRef *buf; } AVFrameSideData; +enum AVSideDataProps { + /** + * The side data type can be used in stream-global structures. + * Side data types without this property are only meaningful on per-frame + * basis. + */ + AV_SIDE_DATA_PROP_GLOBAL = (1 << 0), + + /** + * Multiple instances of this side data type can be meaningfully present in + * a single side data array. + */ + AV_SIDE_DATA_PROP_MULTI = (1 << 1), +}; + +/** + * This struct describes the properties of a side data type. Its instance + * corresponding to a given type can be obtained from av_frame_side_data_desc(). + */ +typedef struct AVSideDataDescriptor { + /** + * Human-readable side data description. + */ + const char *name; + + /** + * Side data property flags, a combination of AVSideDataProps values. + */ + unsigned props; +} AVSideDataDescriptor; + /** * Structure describing a single Region Of Interest. * @@ -319,8 +384,7 @@ typedef struct AVRegionOfInterest { * to the end with a minor bump. * * Fields can be accessed through AVOptions, the name string used, matches the - * C structure field name for fields accessible through AVOptions. The AVClass - * for AVFrame can be obtained from avcodec_get_frame_class() + * C structure field name for fields accessible through AVOptions. */ typedef struct AVFrame { #define AV_NUM_DATA_POINTERS 8 @@ -411,10 +475,15 @@ typedef struct AVFrame { */ int format; +#if FF_API_FRAME_KEY /** * 1 -> keyframe, 0-> not + * + * @deprecated Use AV_FRAME_FLAG_KEY instead */ + attribute_deprecated int key_frame; +#endif /** * Picture type of the frame. @@ -446,70 +515,78 @@ typedef struct AVFrame { */ AVRational time_base; - /** - * picture number in bitstream order - */ - int coded_picture_number; - /** - * picture number in display order - */ - int display_picture_number; - /** * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) */ int quality; /** - * for some private data of the user + * Frame owner's private data. + * + * This field may be set by the code that allocates/owns the frame data. + * It is then not touched by any library functions, except: + * - it is copied to other references by av_frame_copy_props() (and hence by + * av_frame_ref()); + * - it is set to NULL when the frame is cleared by av_frame_unref() + * - on the caller's explicit request. E.g. libavcodec encoders/decoders + * will copy this field to/from @ref AVPacket "AVPackets" if the caller sets + * @ref AV_CODEC_FLAG_COPY_OPAQUE. + * + * @see opaque_ref the reference-counted analogue */ void *opaque; /** - * When decoding, this signals how much the picture must be delayed. - * extra_delay = repeat_pict / (2*fps) + * Number of fields in this frame which should be repeated, i.e. the total + * duration of this frame should be repeat_pict + 2 normal field durations. + * + * For interlaced frames this field may be set to 1, which signals that this + * frame should be presented as 3 fields: beginning with the first field (as + * determined by AV_FRAME_FLAG_TOP_FIELD_FIRST being set or not), followed + * by the second field, and then the first field again. + * + * For progressive frames this field may be set to a multiple of 2, which + * signals that this frame's duration should be (repeat_pict + 2) / 2 + * normal frame durations. + * + * @note This field is computed from MPEG2 repeat_first_field flag and its + * associated flags, H.264 pic_struct from picture timing SEI, and + * their analogues in other codecs. Typically it should only be used when + * higher-layer timing information is not available. */ int repeat_pict; +#if FF_API_INTERLACED_FRAME /** * The content of the picture is interlaced. + * + * @deprecated Use AV_FRAME_FLAG_INTERLACED instead */ + attribute_deprecated int interlaced_frame; /** * If the content is interlaced, is top field displayed first. + * + * @deprecated Use AV_FRAME_FLAG_TOP_FIELD_FIRST instead */ + attribute_deprecated int top_field_first; +#endif +#if FF_API_PALETTE_HAS_CHANGED /** * Tell user application that palette has changed from previous frame. */ + attribute_deprecated int palette_has_changed; - - /** - * reordered opaque 64 bits (generally an integer or a double precision float - * PTS but can be anything). - * The user sets AVCodecContext.reordered_opaque to represent the input at - * that time, - * the decoder reorders values as needed and sets AVFrame.reordered_opaque - * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque - */ - int64_t reordered_opaque; +#endif /** * Sample rate of the audio data. */ int sample_rate; -#if FF_API_OLD_CHANNEL_LAYOUT - /** - * Channel layout of the audio data. - * @deprecated use ch_layout instead - */ - attribute_deprecated - uint64_t channel_layout; -#endif - /** * AVBuffer references backing the data for this frame. All the pointers in * data and extended_data must point inside one of the buffers in buf or @@ -557,10 +634,23 @@ typedef struct AVFrame { * The frame data may be corrupted, e.g. due to decoding errors. */ #define AV_FRAME_FLAG_CORRUPT (1 << 0) +/** + * A flag to mark frames that are keyframes. + */ +#define AV_FRAME_FLAG_KEY (1 << 1) /** * A flag to mark the frames which need to be decoded, but shouldn't be output. */ #define AV_FRAME_FLAG_DISCARD (1 << 2) +/** + * A flag to mark frames whose content is interlaced. + */ +#define AV_FRAME_FLAG_INTERLACED (1 << 3) +/** + * A flag to mark frames where the top field is displayed first if the content + * is interlaced. + */ +#define AV_FRAME_FLAG_TOP_FIELD_FIRST (1 << 4) /** * @} */ @@ -597,20 +687,17 @@ typedef struct AVFrame { */ int64_t best_effort_timestamp; +#if FF_API_FRAME_PKT /** * reordered pos from the last AVPacket that has been input into the decoder * - encoding: unused * - decoding: Read by user. + * @deprecated use AV_CODEC_FLAG_COPY_OPAQUE to pass through arbitrary user + * data from packets to frames */ + attribute_deprecated int64_t pkt_pos; - - /** - * duration of the corresponding packet, expressed in - * AVStream->time_base units, 0 if unknown. - * - encoding: unused - * - decoding: Read by user. - */ - int64_t pkt_duration; +#endif /** * metadata. @@ -632,25 +719,19 @@ typedef struct AVFrame { #define FF_DECODE_ERROR_CONCEALMENT_ACTIVE 4 #define FF_DECODE_ERROR_DECODE_SLICES 8 -#if FF_API_OLD_CHANNEL_LAYOUT - /** - * number of audio channels, only used for audio. - * - encoding: unused - * - decoding: Read by user. - * @deprecated use ch_layout instead - */ - attribute_deprecated - int channels; -#endif - +#if FF_API_FRAME_PKT /** * size of the corresponding packet containing the compressed * frame. * It is set to a negative value if unknown. * - encoding: unused * - decoding: set by libavcodec, read by user. + * @deprecated use AV_CODEC_FLAG_COPY_OPAQUE to pass through arbitrary user + * data from packets to frames */ + attribute_deprecated int pkt_size; +#endif /** * For hwaccel-format frames, this should be a reference to the @@ -659,13 +740,18 @@ typedef struct AVFrame { AVBufferRef *hw_frames_ctx; /** - * AVBufferRef for free use by the API user. FFmpeg will never check the - * contents of the buffer ref. FFmpeg calls av_buffer_unref() on it when - * the frame is unreferenced. av_frame_copy_props() calls create a new - * reference with av_buffer_ref() for the target frame's opaque_ref field. + * Frame owner's private data. * - * This is unrelated to the opaque field, although it serves a similar - * purpose. + * This field may be set by the code that allocates/owns the frame data. + * It is then not touched by any library functions, except: + * - a new reference to the underlying buffer is propagated by + * av_frame_copy_props() (and hence by av_frame_ref()); + * - it is unreferenced in av_frame_unref(); + * - on the caller's explicit request. E.g. libavcodec encoders/decoders + * will propagate a new reference to/from @ref AVPacket "AVPackets" if the + * caller sets @ref AV_CODEC_FLAG_COPY_OPAQUE. + * + * @see opaque the plain pointer analogue */ AVBufferRef *opaque_ref; @@ -702,18 +788,14 @@ typedef struct AVFrame { * Channel layout of the audio data. */ AVChannelLayout ch_layout; + + /** + * Duration of the frame, in the same units as pts. 0 if unknown. + */ + int64_t duration; } AVFrame; -#if FF_API_COLORSPACE_NAME -/** - * Get the name of a colorspace. - * @return a static string identifying the colorspace; can be NULL. - * @deprecated use av_color_space_name() - */ -attribute_deprecated -const char *av_get_colorspace_name(enum AVColorSpace val); -#endif /** * Allocate an AVFrame and set its fields to default values. The resulting * struct must be freed using av_frame_free(). @@ -752,6 +834,19 @@ void av_frame_free(AVFrame **frame); */ int av_frame_ref(AVFrame *dst, const AVFrame *src); +/** + * Ensure the destination frame refers to the same data described by the source + * frame, either by creating a new reference for each AVBufferRef from src if + * they differ from those in dst, by allocating new buffers and copying data if + * src is not reference counted, or by unrefencing it if src is empty. + * + * Frame properties on dst will be replaced by those from src. + * + * @return 0 on success, a negative AVERROR on error. On error, dst is + * unreferenced. + */ +int av_frame_replace(AVFrame *dst, const AVFrame *src); + /** * Create a new frame that references the same data as src. * @@ -818,7 +913,8 @@ int av_frame_is_writable(AVFrame *frame); * Ensure that the frame data is writable, avoiding data copy if possible. * * Do nothing if the frame is writable, allocate new buffers and copy the data - * if it is not. + * if it is not. Non-refcounted frames behave as non-writable, i.e. a copy + * is always made. * * @return 0 on success, a negative AVERROR on error. * @@ -853,12 +949,13 @@ int av_frame_copy_props(AVFrame *dst, const AVFrame *src); /** * Get the buffer reference a given data plane is stored in. * + * @param frame the frame to get the plane's buffer from * @param plane index of the data plane of interest in frame->extended_data. * * @return the buffer reference that contains the plane or NULL if the input * frame is not valid. */ -AVBufferRef *av_frame_get_plane_buffer(AVFrame *frame, int plane); +AVBufferRef *av_frame_get_plane_buffer(const AVFrame *frame, int plane); /** * Add a new side data to a frame. @@ -940,6 +1037,137 @@ int av_frame_apply_cropping(AVFrame *frame, int flags); */ const char *av_frame_side_data_name(enum AVFrameSideDataType type); +/** + * @return side data descriptor corresponding to a given side data type, NULL + * when not available. + */ +const AVSideDataDescriptor *av_frame_side_data_desc(enum AVFrameSideDataType type); + +/** + * Free all side data entries and their contents, then zeroes out the + * values which the pointers are pointing to. + * + * @param sd pointer to array of side data to free. Will be set to NULL + * upon return. + * @param nb_sd pointer to an integer containing the number of entries in + * the array. Will be set to 0 upon return. + */ +void av_frame_side_data_free(AVFrameSideData ***sd, int *nb_sd); + +/** + * Remove existing entries before adding new ones. + */ +#define AV_FRAME_SIDE_DATA_FLAG_UNIQUE (1 << 0) +/** + * Don't add a new entry if another of the same type exists. + * Applies only for side data types without the AV_SIDE_DATA_PROP_MULTI prop. + */ +#define AV_FRAME_SIDE_DATA_FLAG_REPLACE (1 << 1) + +/** + * Add new side data entry to an array. + * + * @param sd pointer to array of side data to which to add another entry, + * or to NULL in order to start a new array. + * @param nb_sd pointer to an integer containing the number of entries in + * the array. + * @param type type of the added side data + * @param size size of the side data + * @param flags Some combination of AV_FRAME_SIDE_DATA_FLAG_* flags, or 0. + * + * @return newly added side data on success, NULL on error. + * @note In case of AV_FRAME_SIDE_DATA_FLAG_UNIQUE being set, entries of + * matching AVFrameSideDataType will be removed before the addition + * is attempted. + * @note In case of AV_FRAME_SIDE_DATA_FLAG_REPLACE being set, if an + * entry of the same type already exists, it will be replaced instead. + */ +AVFrameSideData *av_frame_side_data_new(AVFrameSideData ***sd, int *nb_sd, + enum AVFrameSideDataType type, + size_t size, unsigned int flags); + +/** + * Add a new side data entry to an array from an existing AVBufferRef. + * + * @param sd pointer to array of side data to which to add another entry, + * or to NULL in order to start a new array. + * @param nb_sd pointer to an integer containing the number of entries in + * the array. + * @param type type of the added side data + * @param buf Pointer to AVBufferRef to add to the array. On success, + * the function takes ownership of the AVBufferRef and *buf is + * set to NULL, unless AV_FRAME_SIDE_DATA_FLAG_NEW_REF is set + * in which case the ownership will remain with the caller. + * @param flags Some combination of AV_FRAME_SIDE_DATA_FLAG_* flags, or 0. + * + * @return newly added side data on success, NULL on error. + * @note In case of AV_FRAME_SIDE_DATA_FLAG_UNIQUE being set, entries of + * matching AVFrameSideDataType will be removed before the addition + * is attempted. + * @note In case of AV_FRAME_SIDE_DATA_FLAG_REPLACE being set, if an + * entry of the same type already exists, it will be replaced instead. + * + */ +AVFrameSideData *av_frame_side_data_add(AVFrameSideData ***sd, int *nb_sd, + enum AVFrameSideDataType type, + AVBufferRef **buf, unsigned int flags); + +/** + * Add a new side data entry to an array based on existing side data, taking + * a reference towards the contained AVBufferRef. + * + * @param sd pointer to array of side data to which to add another entry, + * or to NULL in order to start a new array. + * @param nb_sd pointer to an integer containing the number of entries in + * the array. + * @param src side data to be cloned, with a new reference utilized + * for the buffer. + * @param flags Some combination of AV_FRAME_SIDE_DATA_FLAG_* flags, or 0. + * + * @return negative error code on failure, >=0 on success. + * @note In case of AV_FRAME_SIDE_DATA_FLAG_UNIQUE being set, entries of + * matching AVFrameSideDataType will be removed before the addition + * is attempted. + * @note In case of AV_FRAME_SIDE_DATA_FLAG_REPLACE being set, if an + * entry of the same type already exists, it will be replaced instead. + */ +int av_frame_side_data_clone(AVFrameSideData ***sd, int *nb_sd, + const AVFrameSideData *src, unsigned int flags); + +/** + * Get a side data entry of a specific type from an array. + * + * @param sd array of side data. + * @param nb_sd integer containing the number of entries in the array. + * @param type type of side data to be queried + * + * @return a pointer to the side data of a given type on success, NULL if there + * is no side data with such type in this set. + */ +const AVFrameSideData *av_frame_side_data_get_c(const AVFrameSideData * const *sd, + const int nb_sd, + enum AVFrameSideDataType type); + +/** + * Wrapper around av_frame_side_data_get_c() to workaround the limitation + * that for any type T the conversion from T * const * to const T * const * + * is not performed automatically in C. + * @see av_frame_side_data_get_c() + */ +static inline +const AVFrameSideData *av_frame_side_data_get(AVFrameSideData * const *sd, + const int nb_sd, + enum AVFrameSideDataType type) +{ + return av_frame_side_data_get_c((const AVFrameSideData * const *)sd, + nb_sd, type); +} + +/** + * Remove and free all side data instances of the given type from an array. + */ +void av_frame_side_data_remove(AVFrameSideData ***sd, int *nb_sd, + enum AVFrameSideDataType type); /** * @} */ diff --git a/include/libavutil/getenv_utf8.h b/include/libavutil/getenv_utf8.h new file mode 100644 index 0000000..c10291a --- /dev/null +++ b/include/libavutil/getenv_utf8.h @@ -0,0 +1,86 @@ +/* + * 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 AVUTIL_GETENV_UTF8_H +#define AVUTIL_GETENV_UTF8_H + +#include + +#include "config.h" +#include "mem.h" + +#if HAVE_GETENV && defined(_WIN32) + +#include "libavutil/wchar_filename.h" + +static inline char *getenv_utf8(const char *varname) +{ + wchar_t *varname_w, *var_w; + char *var; + + if (utf8towchar(varname, &varname_w)) + return NULL; + if (!varname_w) + return NULL; + + var_w = _wgetenv(varname_w); + av_free(varname_w); + + if (!var_w) + return NULL; + if (wchartoutf8(var_w, &var)) + return NULL; + + return var; + + // No CP_ACP fallback compared to other *_utf8() functions: + // non UTF-8 strings must not be returned. +} + +static inline void freeenv_utf8(char *var) +{ + av_free(var); +} + +static inline char *getenv_dup(const char *varname) +{ + return getenv_utf8(varname); +} + +#else + +static inline char *getenv_utf8(const char *varname) +{ + return getenv(varname); +} + +static inline void freeenv_utf8(char *var) +{ +} + +static inline char *getenv_dup(const char *varname) +{ + char *var = getenv(varname); + if (!var) + return NULL; + return av_strdup(var); +} + +#endif // HAVE_GETENV && defined(_WIN32) + +#endif // AVUTIL_GETENV_UTF8_H diff --git a/include/libavutil/half2float.h b/include/libavutil/half2float.h new file mode 100644 index 0000000..dbd5e71 --- /dev/null +++ b/include/libavutil/half2float.h @@ -0,0 +1,57 @@ +/* + * 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 AVUTIL_HALF2FLOAT_H +#define AVUTIL_HALF2FLOAT_H + +#include +#include "intfloat.h" + +#include "config.h" + +typedef struct Half2FloatTables { +#if HAVE_FAST_FLOAT16 + uint8_t dummy; +#else + uint32_t mantissatable[3072]; + uint32_t exponenttable[64]; + uint16_t offsettable[64]; +#endif +} Half2FloatTables; + +void ff_init_half2float_tables(Half2FloatTables *t); + +static inline uint32_t half2float(uint16_t h, const Half2FloatTables *t) +{ +#if HAVE_FAST_FLOAT16 + union { + _Float16 f; + uint16_t i; + } u; + u.i = h; + return av_float2int(u.f); +#else + uint32_t f; + + f = t->mantissatable[t->offsettable[h >> 10] + (h & 0x3ff)] + t->exponenttable[h >> 10]; + + return f; +#endif +} + +#endif /* AVUTIL_HALF2FLOAT_H */ diff --git a/include/libavutil/hdr_dynamic_metadata.h b/include/libavutil/hdr_dynamic_metadata.h index 2d72de5..5100ed6 100644 --- a/include/libavutil/hdr_dynamic_metadata.h +++ b/include/libavutil/hdr_dynamic_metadata.h @@ -340,4 +340,37 @@ AVDynamicHDRPlus *av_dynamic_hdr_plus_alloc(size_t *size); */ AVDynamicHDRPlus *av_dynamic_hdr_plus_create_side_data(AVFrame *frame); +/** + * Parse the user data registered ITU-T T.35 to AVbuffer (AVDynamicHDRPlus). + * The T.35 buffer must begin with the application mode, skipping the + * country code, terminal provider codes, and application identifier. + * @param s A pointer containing the decoded AVDynamicHDRPlus structure. + * @param data The byte array containing the raw ITU-T T.35 data. + * @param size Size of the data array in bytes. + * + * @return >= 0 on success. Otherwise, returns the appropriate AVERROR. + */ +int av_dynamic_hdr_plus_from_t35(AVDynamicHDRPlus *s, const uint8_t *data, + size_t size); + +#define AV_HDR_PLUS_MAX_PAYLOAD_SIZE 907 + +/** + * Serialize dynamic HDR10+ metadata to a user data registered ITU-T T.35 buffer, + * excluding the first 48 bytes of the header, and beginning with the application mode. + * @param s A pointer containing the decoded AVDynamicHDRPlus structure. + * @param[in,out] data A pointer to pointer to a byte buffer to be filled with the + * serialized metadata. + * If *data is NULL, a buffer be will be allocated and a pointer to + * it stored in its place. The caller assumes ownership of the buffer. + * May be NULL, in which case the function will only store the + * required buffer size in *size. + * @param[in,out] size A pointer to a size to be set to the returned buffer's size. + * If *data is not NULL, *size must contain the size of the input + * buffer. May be NULL only if *data is NULL. + * + * @return >= 0 on success. Otherwise, returns the appropriate AVERROR. + */ +int av_dynamic_hdr_plus_to_t35(const AVDynamicHDRPlus *s, uint8_t **data, size_t *size); + #endif /* AVUTIL_HDR_DYNAMIC_METADATA_H */ diff --git a/include/libavutil/hdr_dynamic_vivid_metadata.h b/include/libavutil/hdr_dynamic_vivid_metadata.h index a34f830..4524a81 100644 --- a/include/libavutil/hdr_dynamic_vivid_metadata.h +++ b/include/libavutil/hdr_dynamic_vivid_metadata.h @@ -24,6 +24,52 @@ #include "frame.h" #include "rational.h" +/** + * HDR Vivid three spline params. + */ +typedef struct AVHDRVivid3SplineParams { + /** + * The mode of three Spline. the value shall be in the range + * of 0 to 3, inclusive. + */ + int th_mode; + + /** + * three_Spline_TH_enable_MB is in the range of 0.0 to 1.0, inclusive + * and in multiples of 1.0/255. + * + */ + AVRational th_enable_mb; + + /** + * 3Spline_TH_enable of three Spline. + * The value shall be in the range of 0.0 to 1.0, inclusive. + * and in multiples of 1.0/4095. + */ + AVRational th_enable; + + /** + * 3Spline_TH_Delta1 of three Spline. + * The value shall be in the range of 0.0 to 0.25, inclusive, + * and in multiples of 0.25/1023. + */ + AVRational th_delta1; + + /** + * 3Spline_TH_Delta2 of three Spline. + * The value shall be in the range of 0.0 to 0.25, inclusive, + * and in multiples of 0.25/1023. + */ + AVRational th_delta2; + + /** + * 3Spline_enable_Strength of three Spline. + * The value shall be in the range of 0.0 to 1.0, inclusive, + * and in multiples of 1.0/255. + */ + AVRational enable_strength; +} AVHDRVivid3SplineParams; + /** * Color tone mapping parameters at a processing window in a dynamic metadata for * CUVA 005.1:2021. @@ -122,46 +168,61 @@ typedef struct AVHDRVividColorToneMappingParams { */ int three_Spline_num; +#if FF_API_HDR_VIVID_THREE_SPLINE /** * The mode of three Spline. the value shall be in the range * of 0 to 3, inclusive. + * @deprecated Use three_spline instead */ + attribute_deprecated int three_Spline_TH_mode; /** * three_Spline_TH_enable_MB is in the range of 0.0 to 1.0, inclusive * and in multiples of 1.0/255. - * + * @deprecated Use three_spline instead */ + attribute_deprecated AVRational three_Spline_TH_enable_MB; /** * 3Spline_TH_enable of three Spline. * The value shall be in the range of 0.0 to 1.0, inclusive. * and in multiples of 1.0/4095. + * @deprecated Use three_spline instead */ + attribute_deprecated AVRational three_Spline_TH_enable; /** * 3Spline_TH_Delta1 of three Spline. * The value shall be in the range of 0.0 to 0.25, inclusive, * and in multiples of 0.25/1023. + * @deprecated Use three_spline instead */ + attribute_deprecated AVRational three_Spline_TH_Delta1; /** * 3Spline_TH_Delta2 of three Spline. * The value shall be in the range of 0.0 to 0.25, inclusive, * and in multiples of 0.25/1023. + * @deprecated Use three_spline instead */ + attribute_deprecated AVRational three_Spline_TH_Delta2; /** * 3Spline_enable_Strength of three Spline. * The value shall be in the range of 0.0 to 1.0, inclusive, * and in multiples of 1.0/255. + * @deprecated Use three_spline instead */ + attribute_deprecated AVRational three_Spline_enable_Strength; +#endif + + AVHDRVivid3SplineParams three_spline[2]; } AVHDRVividColorToneMappingParams; diff --git a/include/libavutil/hwcontext.h b/include/libavutil/hwcontext.h index c18b7e1..bac30de 100755 --- a/include/libavutil/hwcontext.h +++ b/include/libavutil/hwcontext.h @@ -37,10 +37,9 @@ enum AVHWDeviceType { AV_HWDEVICE_TYPE_OPENCL, AV_HWDEVICE_TYPE_MEDIACODEC, AV_HWDEVICE_TYPE_VULKAN, + AV_HWDEVICE_TYPE_D3D12VA, }; -typedef struct AVHWDeviceInternal AVHWDeviceInternal; - /** * This struct aggregates all the (hardware/vendor-specific) "high-level" state, * i.e. state that is not tied to a concrete processing configuration. @@ -64,12 +63,6 @@ typedef struct AVHWDeviceContext { */ const AVClass *av_class; - /** - * Private data used internally by libavutil. Must not be accessed in any - * way by the caller. - */ - AVHWDeviceInternal *internal; - /** * This field identifies the underlying API used for hardware access. * @@ -109,8 +102,6 @@ typedef struct AVHWDeviceContext { void *user_opaque; } AVHWDeviceContext; -typedef struct AVHWFramesInternal AVHWFramesInternal; - /** * This struct describes a set or pool of "hardware" frames (i.e. those with * data not located in normal system memory). All the frames in the pool are @@ -127,12 +118,6 @@ typedef struct AVHWFramesContext { */ const AVClass *av_class; - /** - * Private data used internally by libavutil. Must not be accessed in any - * way by the caller. - */ - AVHWFramesInternal *internal; - /** * A reference to the parent AVHWDeviceContext. This reference is owned and * managed by the enclosing AVHWFramesContext, but the caller may derive @@ -152,9 +137,12 @@ typedef struct AVHWFramesContext { * The format-specific data, allocated and freed automatically along with * this context. * - * Should be cast by the user to the format-specific context defined in the - * corresponding header (hwframe_*.h) and filled as described in the - * documentation before calling av_hwframe_ctx_init(). + * The user shall ignore this field if the corresponding format-specific + * header (hwcontext_*.h) does not define a context to be used as + * AVHWFramesContext.hwctx. + * + * Otherwise, it should be cast by the user to said context and filled + * as described in the documentation before calling av_hwframe_ctx_init(). * * After any frames using this context are created, the contents of this * struct should not be modified by the caller. @@ -249,7 +237,7 @@ const char *av_hwdevice_get_type_name(enum AVHWDeviceType type); /** * Iterate over supported device types. * - * @param type AV_HWDEVICE_TYPE_NONE initially, then the previous type + * @param prev AV_HWDEVICE_TYPE_NONE initially, then the previous type * returned by this function in subsequent iterations. * @return The next usable device type from enum AVHWDeviceType, or * AV_HWDEVICE_TYPE_NONE if there are no more. @@ -591,6 +579,7 @@ int av_hwframe_map(AVFrame *dst, const AVFrame *src, int flags); * * @param derived_frame_ctx On success, a reference to the newly created * AVHWFramesContext. + * @param format The AVPixelFormat for the derived context. * @param derived_device_ctx A reference to the device to create the new * AVHWFramesContext on. * @param source_frame_ctx A reference to an existing AVHWFramesContext diff --git a/include/libavutil/hwcontext_cuda.h b/include/libavutil/hwcontext_cuda.h index cefbe0c..cbad434 100644 --- a/include/libavutil/hwcontext_cuda.h +++ b/include/libavutil/hwcontext_cuda.h @@ -62,6 +62,11 @@ typedef struct AVCUDADeviceContext { */ #define AV_CUDA_USE_PRIMARY_CONTEXT (1 << 0) +/** + * Use current device context instead of creating a new one. + */ +#define AV_CUDA_USE_CURRENT_CONTEXT (1 << 1) + /** * @} */ diff --git a/include/libavutil/hwcontext_cuda_internal.h b/include/libavutil/hwcontext_cuda_internal.h new file mode 100644 index 0000000..d5633c5 --- /dev/null +++ b/include/libavutil/hwcontext_cuda_internal.h @@ -0,0 +1,39 @@ +/* + * 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 AVUTIL_HWCONTEXT_CUDA_INTERNAL_H +#define AVUTIL_HWCONTEXT_CUDA_INTERNAL_H + +#include "compat/cuda/dynlink_loader.h" +#include "hwcontext_cuda.h" + +/** + * @file + * FFmpeg internal API for CUDA. + */ + +struct AVCUDADeviceContextInternal { + CudaFunctions *cuda_dl; + int is_allocated; + CUdevice cuda_device; + int flags; +}; + +#endif /* AVUTIL_HWCONTEXT_CUDA_INTERNAL_H */ + diff --git a/include/libavutil/hwcontext_d3d12va.h b/include/libavutil/hwcontext_d3d12va.h new file mode 100644 index 0000000..212a6a6 --- /dev/null +++ b/include/libavutil/hwcontext_d3d12va.h @@ -0,0 +1,142 @@ +/* + * Direct3D 12 HW acceleration. + * + * copyright (c) 2022-2023 Wu Jianhua + * + * 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 AVUTIL_HWCONTEXT_D3D12VA_H +#define AVUTIL_HWCONTEXT_D3D12VA_H + +/** + * @file + * An API-specific header for AV_HWDEVICE_TYPE_D3D12VA. + * + * AVHWFramesContext.pool must contain AVBufferRefs whose + * data pointer points to an AVD3D12VAFrame struct. + */ +#include +#include +#include +#include +#include + +/** + * @brief This struct is allocated as AVHWDeviceContext.hwctx + * + */ +typedef struct AVD3D12VADeviceContext { + /** + * Device used for objects creation and access. This can also be + * used to set the libavcodec decoding device. + * + * Can be set by the user. This is the only mandatory field - the other + * device context fields are set from this and are available for convenience. + * + * Deallocating the AVHWDeviceContext will always release this interface, + * and it does not matter whether it was user-allocated. + */ + ID3D12Device *device; + + /** + * If unset, this will be set from the device field on init. + * + * Deallocating the AVHWDeviceContext will always release this interface, + * and it does not matter whether it was user-allocated. + */ + ID3D12VideoDevice *video_device; + + /** + * Callbacks for locking. They protect access to the internal staging + * texture (for av_hwframe_transfer_data() calls). They do NOT protect + * access to hwcontext or decoder state in general. + * + * If unset on init, the hwcontext implementation will set them to use an + * internal mutex. + * + * The underlying lock must be recursive. lock_ctx is for free use by the + * locking implementation. + */ + void (*lock)(void *lock_ctx); + void (*unlock)(void *lock_ctx); + void *lock_ctx; +} AVD3D12VADeviceContext; + +/** + * @brief This struct is used to sync d3d12 execution + * + */ +typedef struct AVD3D12VASyncContext { + /** + * D3D12 fence object + */ + ID3D12Fence *fence; + + /** + * A handle to the event object that's raised when the fence + * reaches a certain value. + */ + HANDLE event; + + /** + * The fence value used for sync + */ + uint64_t fence_value; +} AVD3D12VASyncContext; + +/** + * @brief D3D12VA frame descriptor for pool allocation. + * + */ +typedef struct AVD3D12VAFrame { + /** + * The texture in which the frame is located. The reference count is + * managed by the AVBufferRef, and destroying the reference will release + * the interface. + */ + ID3D12Resource *texture; + + /** + * The sync context for the texture + * + * @see: https://learn.microsoft.com/en-us/windows/win32/medfound/direct3d-12-video-overview#directx-12-fences + */ + AVD3D12VASyncContext sync_ctx; +} AVD3D12VAFrame; + +/** + * @brief This struct is allocated as AVHWFramesContext.hwctx + * + */ +typedef struct AVD3D12VAFramesContext { + /** + * DXGI_FORMAT format. MUST be compatible with the pixel format. + * If unset, will be automatically set. + */ + DXGI_FORMAT format; + + /** + * Options for working with resources. + * If unset, this will be D3D12_RESOURCE_FLAG_NONE. + * + * @see https://learn.microsoft.com/en-us/windows/win32/api/d3d12/ne-d3d12-d3d12_resource_flags + */ + D3D12_RESOURCE_FLAGS flags; +} AVD3D12VAFramesContext; + +#endif /* AVUTIL_HWCONTEXT_D3D12VA_H */ diff --git a/include/libavutil/hwcontext_d3d12va_internal.h b/include/libavutil/hwcontext_d3d12va_internal.h new file mode 100644 index 0000000..f343033 --- /dev/null +++ b/include/libavutil/hwcontext_d3d12va_internal.h @@ -0,0 +1,59 @@ +/* + * Direct3D 12 HW acceleration. + * + * copyright (c) 2022-2023 Wu Jianhua + * + * 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 AVUTIL_HWCONTEXT_D3D12VA_INTERNAL_H +#define AVUTIL_HWCONTEXT_D3D12VA_INTERNAL_H + +/** + * @def COBJMACROS + * + * @brief Enable C style interface for D3D12 + */ +#ifndef COBJMACROS +#define COBJMACROS +#endif + +/** + * @def DX_CHECK + * + * @brief A check macro used by D3D12 functions highly frequently + */ +#define DX_CHECK(hr) \ + do { \ + if (FAILED(hr)) \ + goto fail; \ + } while (0) + +/** + * @def D3D12_OBJECT_RELEASE + * + * @brief A release macro used by D3D12 objects highly frequently + */ +#define D3D12_OBJECT_RELEASE(pInterface) \ + do { \ + if (pInterface) { \ + IUnknown_Release((IUnknown *)pInterface); \ + pInterface = NULL; \ + } \ + } while (0) + +#endif /* AVUTIL_HWCONTEXT_D3D12VA_INTERNAL_H */ diff --git a/include/libavutil/hwcontext_internal.h b/include/libavutil/hwcontext_internal.h new file mode 100644 index 0000000..e32b786 --- /dev/null +++ b/include/libavutil/hwcontext_internal.h @@ -0,0 +1,167 @@ +/* + * 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 AVUTIL_HWCONTEXT_INTERNAL_H +#define AVUTIL_HWCONTEXT_INTERNAL_H + +#include + +#include "buffer.h" +#include "hwcontext.h" +#include "frame.h" +#include "pixfmt.h" + +typedef struct HWContextType { + enum AVHWDeviceType type; + const char *name; + + /** + * An array of pixel formats supported by the AVHWFramesContext instances + * Terminated by AV_PIX_FMT_NONE. + */ + const enum AVPixelFormat *pix_fmts; + + /** + * size of the public hardware-specific context, + * i.e. AVHWDeviceContext.hwctx + */ + size_t device_hwctx_size; + + /** + * Size of the hardware-specific device configuration. + * (Used to query hwframe constraints.) + */ + size_t device_hwconfig_size; + + /** + * size of the public frame pool hardware-specific context, + * i.e. AVHWFramesContext.hwctx + */ + size_t frames_hwctx_size; + + int (*device_create)(AVHWDeviceContext *ctx, const char *device, + AVDictionary *opts, int flags); + int (*device_derive)(AVHWDeviceContext *dst_ctx, + AVHWDeviceContext *src_ctx, + AVDictionary *opts, int flags); + + int (*device_init)(AVHWDeviceContext *ctx); + void (*device_uninit)(AVHWDeviceContext *ctx); + + int (*frames_get_constraints)(AVHWDeviceContext *ctx, + const void *hwconfig, + AVHWFramesConstraints *constraints); + + int (*frames_init)(AVHWFramesContext *ctx); + void (*frames_uninit)(AVHWFramesContext *ctx); + + int (*frames_get_buffer)(AVHWFramesContext *ctx, AVFrame *frame); + int (*transfer_get_formats)(AVHWFramesContext *ctx, + enum AVHWFrameTransferDirection dir, + enum AVPixelFormat **formats); + int (*transfer_data_to)(AVHWFramesContext *ctx, AVFrame *dst, + const AVFrame *src); + int (*transfer_data_from)(AVHWFramesContext *ctx, AVFrame *dst, + const AVFrame *src); + + int (*map_to)(AVHWFramesContext *ctx, AVFrame *dst, + const AVFrame *src, int flags); + int (*map_from)(AVHWFramesContext *ctx, AVFrame *dst, + const AVFrame *src, int flags); + + int (*frames_derive_to)(AVHWFramesContext *dst_ctx, + AVHWFramesContext *src_ctx, int flags); + int (*frames_derive_from)(AVHWFramesContext *dst_ctx, + AVHWFramesContext *src_ctx, int flags); +} HWContextType; + +typedef struct FFHWFramesContext { + /** + * The public AVHWFramesContext. See hwcontext.h for it. + */ + AVHWFramesContext p; + + const HWContextType *hw_type; + + AVBufferPool *pool_internal; + + /** + * For a derived context, a reference to the original frames + * context it was derived from. + */ + AVBufferRef *source_frames; + /** + * Flags to apply to the mapping from the source to the derived + * frame context when trying to allocate in the derived context. + */ + int source_allocation_map_flags; +} FFHWFramesContext; + +static inline FFHWFramesContext *ffhwframesctx(AVHWFramesContext *ctx) +{ + return (FFHWFramesContext*)ctx; +} + +typedef struct HWMapDescriptor { + /** + * A reference to the original source of the mapping. + */ + AVFrame *source; + /** + * A reference to the hardware frames context in which this + * mapping was made. May be the same as source->hw_frames_ctx, + * but need not be. + */ + AVBufferRef *hw_frames_ctx; + /** + * Unmap function. + */ + void (*unmap)(AVHWFramesContext *ctx, + struct HWMapDescriptor *hwmap); + /** + * Hardware-specific private data associated with the mapping. + */ + void *priv; +} HWMapDescriptor; + +int ff_hwframe_map_create(AVBufferRef *hwframe_ref, + AVFrame *dst, const AVFrame *src, + void (*unmap)(AVHWFramesContext *ctx, + HWMapDescriptor *hwmap), + void *priv); + +/** + * Replace the current hwmap of dst with the one from src, used for indirect + * mappings like VAAPI->(DRM)->OpenCL/Vulkan where a direct interop is missing + */ +int ff_hwframe_map_replace(AVFrame *dst, const AVFrame *src); + +extern const HWContextType ff_hwcontext_type_cuda; +extern const HWContextType ff_hwcontext_type_d3d11va; +extern const HWContextType ff_hwcontext_type_d3d12va; +extern const HWContextType ff_hwcontext_type_drm; +extern const HWContextType ff_hwcontext_type_dxva2; +extern const HWContextType ff_hwcontext_type_opencl; +extern const HWContextType ff_hwcontext_type_qsv; +extern const HWContextType ff_hwcontext_type_vaapi; +extern const HWContextType ff_hwcontext_type_vdpau; +extern const HWContextType ff_hwcontext_type_videotoolbox; +extern const HWContextType ff_hwcontext_type_mediacodec; +extern const HWContextType ff_hwcontext_type_vulkan; + +#endif /* AVUTIL_HWCONTEXT_INTERNAL_H */ diff --git a/include/libavutil/hwcontext_mediacodec.h b/include/libavutil/hwcontext_mediacodec.h index 101a980..fc0263c 100644 --- a/include/libavutil/hwcontext_mediacodec.h +++ b/include/libavutil/hwcontext_mediacodec.h @@ -31,6 +31,31 @@ typedef struct AVMediaCodecDeviceContext { * This is the default surface used by decoders on this device. */ void *surface; + + /** + * Pointer to ANativeWindow. + * + * It both surface and native_window is NULL, try to create it + * automatically if create_window is true and OS support + * createPersistentInputSurface. + * + * It can be used as output surface for decoder and input surface for + * encoder. + */ + void *native_window; + + /** + * Enable createPersistentInputSurface automatically. + * + * Disabled by default. + * + * It can be enabled by setting this flag directly, or by setting + * AVDictionary of av_hwdevice_ctx_create(), with "create_window" as key. + * The second method is useful for ffmpeg cmdline, e.g., we can enable it + * via: + * -init_hw_device mediacodec=mediacodec,create_window=1 + */ + int create_window; } AVMediaCodecDeviceContext; #endif /* AVUTIL_HWCONTEXT_MEDIACODEC_H */ diff --git a/include/libavutil/hwcontext_qsv.h b/include/libavutil/hwcontext_qsv.h index b98d611..35530e4 100644 --- a/include/libavutil/hwcontext_qsv.h +++ b/include/libavutil/hwcontext_qsv.h @@ -19,14 +19,14 @@ #ifndef AVUTIL_HWCONTEXT_QSV_H #define AVUTIL_HWCONTEXT_QSV_H -#include +#include /** * @file * An API-specific header for AV_HWDEVICE_TYPE_QSV. * - * This API does not support dynamic frame pools. AVHWFramesContext.pool must - * contain AVBufferRefs whose data pointer points to an mfxFrameSurface1 struct. + * AVHWFramesContext.pool must contain AVBufferRefs whose data pointer points + * to a mfxFrameSurface1 struct. */ /** @@ -34,19 +34,53 @@ */ typedef struct AVQSVDeviceContext { mfxSession session; + /** + * The mfxLoader handle used for mfxSession creation + * + * This field is only available for oneVPL user. For non-oneVPL user, this + * field must be set to NULL. + * + * Filled by the user before calling av_hwdevice_ctx_init() and should be + * cast to mfxLoader handle. Deallocating the AVHWDeviceContext will always + * release this interface. + */ + void *loader; } AVQSVDeviceContext; /** * This struct is allocated as AVHWFramesContext.hwctx */ typedef struct AVQSVFramesContext { + /** + * A pointer to a mfxFrameSurface1 struct + * + * It is available when nb_surfaces is non-zero. + */ mfxFrameSurface1 *surfaces; + + /** + * Number of frames in the pool + * + * It is 0 for dynamic frame pools or AVHWFramesContext.initial_pool_size + * for fixed frame pools. + * + * Note only oneVPL GPU runtime 2.9+ can support dynamic frame pools + * on d3d11va or vaapi + */ int nb_surfaces; /** * A combination of MFX_MEMTYPE_* describing the frame pool. */ int frame_type; + + /** + * A pointer to a mfxFrameInfo struct + * + * It is available when nb_surfaces is 0, all buffers allocated from the + * pool have the same mfxFrameInfo. + */ + mfxFrameInfo *info; } AVQSVFramesContext; #endif /* AVUTIL_HWCONTEXT_QSV_H */ diff --git a/include/libavutil/hwcontext_videotoolbox.h b/include/libavutil/hwcontext_videotoolbox.h index b6bdcf2..d35cfbb 100644 --- a/include/libavutil/hwcontext_videotoolbox.h +++ b/include/libavutil/hwcontext_videotoolbox.h @@ -23,6 +23,7 @@ #include +#include "frame.h" #include "pixfmt.h" /** @@ -38,10 +39,13 @@ * depending on application usage, so it is preferable to let CoreVideo manage * the pool using the default implementation. * - * Currently AVHWDeviceContext.hwctx and AVHWFramesContext.hwctx are always - * NULL. + * Currently AVHWDeviceContext.hwctx are always NULL. */ +typedef struct AVVTFramesContext { + enum AVColorRange color_range; +} AVVTFramesContext; + /** * Convert a VideoToolbox (actually CoreVideo) format to AVPixelFormat. * Returns AV_PIX_FMT_NONE if no known equivalent was found. @@ -86,8 +90,15 @@ CFStringRef av_map_videotoolbox_color_primaries_from_av(enum AVColorPrimaries pr CFStringRef av_map_videotoolbox_color_trc_from_av(enum AVColorTransferCharacteristic trc); /** - * Update a CVPixelBufferRef's metadata to based on an AVFrame. - * Returns 0 if no known equivalent was found. + * Set CVPixelBufferRef's metadata based on an AVFrame. + * + * Sets/unsets the CVPixelBuffer attachments to match as closely as possible the + * AVFrame metadata. To prevent inconsistent attachments, the attachments for properties + * that could not be matched or are unspecified in the given AVFrame are unset. So if + * any attachments already covered by AVFrame metadata need to be set to a specific + * value, this should happen after calling this function. + * + * Returns < 0 in case of an error. */ int av_vt_pixbuf_set_attachments(void *log_ctx, CVPixelBufferRef pixbuf, const struct AVFrame *src); diff --git a/include/libavutil/hwcontext_vulkan.h b/include/libavutil/hwcontext_vulkan.h index df86c85..2688a47 100644 --- a/include/libavutil/hwcontext_vulkan.h +++ b/include/libavutil/hwcontext_vulkan.h @@ -26,6 +26,23 @@ #include "pixfmt.h" #include "frame.h" +#include "hwcontext.h" + +typedef struct AVVkFrame AVVkFrame; + +typedef struct AVVulkanDeviceQueueFamily { + /* Queue family index */ + int idx; + /* Number of queues in the queue family in use */ + int num; + /* Queue family capabilities. Must be non-zero. + * Flags may be removed to indicate the queue family may not be used + * for a given purpose. */ + VkQueueFlagBits flags; + /* Vulkan implementations are allowed to list multiple video queues + * which differ in what they can encode or decode. */ + VkVideoCodecOperationFlagBitsKHR video_caps; +} AVVulkanDeviceQueueFamily; /** * @file @@ -46,14 +63,13 @@ typedef struct AVVulkanDeviceContext { const VkAllocationCallbacks *alloc; /** - * Pointer to the instance-provided vkGetInstanceProcAddr loading function. - * If NULL, will pick either libvulkan or libvolk, depending on libavutil's - * compilation settings, and set this field. + * Pointer to a vkGetInstanceProcAddr loading function. + * If unset, will dynamically load and use libvulkan. */ PFN_vkGetInstanceProcAddr get_proc_addr; /** - * Vulkan instance. Must be at least version 1.2. + * Vulkan instance. Must be at least version 1.3. */ VkInstance inst; @@ -96,6 +112,7 @@ typedef struct AVVulkanDeviceContext { const char * const *enabled_dev_extensions; int nb_enabled_dev_extensions; +#if FF_API_VULKAN_FIXED_QUEUES /** * Queue family index for graphics operations, and the number of queues * enabled for it. If unavaiable, will be set to -1. Not required. @@ -103,21 +120,27 @@ typedef struct AVVulkanDeviceContext { * queue family, or pick the one with the least unrelated flags set. * Queue indices here may overlap if a queue has to share capabilities. */ + attribute_deprecated int queue_family_index; + attribute_deprecated int nb_graphics_queues; /** * Queue family index for transfer operations and the number of queues * enabled. Required. */ + attribute_deprecated int queue_family_tx_index; + attribute_deprecated int nb_tx_queues; /** * Queue family index for compute operations and the number of queues * enabled. Required. */ + attribute_deprecated int queue_family_comp_index; + attribute_deprecated int nb_comp_queues; /** @@ -125,7 +148,9 @@ typedef struct AVVulkanDeviceContext { * If the device doesn't support such, queue_family_encode_index will be -1. * Not required. */ + attribute_deprecated int queue_family_encode_index; + attribute_deprecated int nb_encode_queues; /** @@ -133,8 +158,35 @@ typedef struct AVVulkanDeviceContext { * If the device doesn't support such, queue_family_decode_index will be -1. * Not required. */ + attribute_deprecated int queue_family_decode_index; + attribute_deprecated int nb_decode_queues; +#endif + + /** + * Locks a queue, preventing other threads from submitting any command + * buffers to this queue. + * If set to NULL, will be set to lavu-internal functions that utilize a + * mutex. + */ + void (*lock_queue)(struct AVHWDeviceContext *ctx, uint32_t queue_family, uint32_t index); + + /** + * Similar to lock_queue(), unlocks a queue. Must only be called after locking. + */ + void (*unlock_queue)(struct AVHWDeviceContext *ctx, uint32_t queue_family, uint32_t index); + + /** + * Queue families used. Must be preferentially ordered. List may contain + * duplicates. + * + * For compatibility reasons, all the enabled queue families listed above + * (queue_family_(tx/comp/encode/decode)_index) must also be included in + * this list until they're removed after deprecation. + */ + AVVulkanDeviceQueueFamily qf[64]; + int nb_qf; } AVVulkanDeviceContext; /** @@ -145,10 +197,14 @@ typedef enum AVVkFrameFlags { * device and tiling during av_hwframe_ctx_init(). */ AV_VK_FRAME_FLAG_NONE = (1ULL << 0), - /* Image planes will be allocated in a single VkDeviceMemory, rather - * than as per-plane VkDeviceMemory allocations. Required for exporting - * to VAAPI on Intel devices. */ +#if FF_API_VULKAN_CONTIGUOUS_MEMORY + /* DEPRECATED: does nothing. Replaced by multiplane images. */ AV_VK_FRAME_FLAG_CONTIGUOUS_MEMORY = (1ULL << 1), +#endif + + /* Disables multiplane images. + * This is required to export/import images from CUDA. */ + AV_VK_FRAME_FLAG_DISABLE_MULTIPLANE = (1ULL << 2), } AVVkFrameFlags; /** @@ -156,26 +212,32 @@ typedef enum AVVkFrameFlags { */ typedef struct AVVulkanFramesContext { /** - * Controls the tiling of allocated frames. If left as optimal tiling, - * then during av_hwframe_ctx_init() will decide based on whether the device - * supports DRM modifiers, or if the linear_images flag is set, otherwise - * will allocate optimally-tiled images. + * Controls the tiling of allocated frames. + * If left as VK_IMAGE_TILING_OPTIMAL (0), will use optimal tiling. + * Can be set to VK_IMAGE_TILING_LINEAR to force linear images, + * or VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT to force DMABUF-backed + * images. + * @note Imported frames from other APIs ignore this. */ VkImageTiling tiling; /** - * Defines extra usage of output frames. If left as 0, the following bits - * are set: TRANSFER_SRC, TRANSFER_DST. SAMPLED and STORAGE. + * Defines extra usage of output frames. If non-zero, all flags MUST be + * supported by the VkFormat. Otherwise, will use supported flags amongst: + * - VK_IMAGE_USAGE_SAMPLED_BIT + * - VK_IMAGE_USAGE_STORAGE_BIT + * - VK_IMAGE_USAGE_TRANSFER_SRC_BIT + * - VK_IMAGE_USAGE_TRANSFER_DST_BIT */ VkImageUsageFlagBits usage; /** * Extension data for image creation. - * If VkImageDrmFormatModifierListCreateInfoEXT is present in the chain, - * and the device supports DRM modifiers, then images will be allocated - * with the specific requested DRM modifiers. + * If DRM tiling is used, a VkImageDrmFormatModifierListCreateInfoEXT structure + * can be added to specify the exact modifier to use. + * * Additional structures may be added at av_hwframe_ctx_init() time, - * which will be freed automatically on uninit(), so users need only free + * which will be freed automatically on uninit(), so users must only free * any structures they've allocated themselves. */ void *create_pnext; @@ -195,36 +257,65 @@ typedef struct AVVulkanFramesContext { * av_hwframe_ctx_init(). */ AVVkFrameFlags flags; + + /** + * Flags to set during image creation. If unset, defaults to + * VK_IMAGE_CREATE_ALIAS_BIT. + */ + VkImageCreateFlags img_flags; + + /** + * Vulkan format for each image. MUST be compatible with the pixel format. + * If unset, will be automatically set. + * There are at most two compatible formats for a frame - a multiplane + * format, and a single-plane multi-image format. + */ + VkFormat format[AV_NUM_DATA_POINTERS]; + + /** + * Number of layers each image will have. + */ + int nb_layers; + + /** + * Locks a frame, preventing other threads from changing frame properties. + * Users SHOULD only ever lock just before command submission in order + * to get accurate frame properties, and unlock immediately after command + * submission without waiting for it to finish. + * + * If unset, will be set to lavu-internal functions that utilize a mutex. + */ + void (*lock_frame)(struct AVHWFramesContext *fc, AVVkFrame *vkf); + + /** + * Similar to lock_frame(), unlocks a frame. Must only be called after locking. + */ + void (*unlock_frame)(struct AVHWFramesContext *fc, AVVkFrame *vkf); } AVVulkanFramesContext; /* - * Frame structure, the VkFormat of the image will always match - * the pool's sw_format. - * All frames, imported or allocated, will be created with the - * VK_IMAGE_CREATE_ALIAS_BIT flag set, so the memory may be aliased if needed. - * - * If all queue family indices in the device context are the same, - * images will be created with the EXCLUSIVE sharing mode. Otherwise, all images - * will be created using the CONCURRENT sharing mode. + * Frame structure. * * @note the size of this structure is not part of the ABI, to allocate * you must use @av_vk_frame_alloc(). */ -typedef struct AVVkFrame { +struct AVVkFrame { /** * Vulkan images to which the memory is bound to. + * May be one for multiplane formats, or multiple. */ VkImage img[AV_NUM_DATA_POINTERS]; /** - * The same tiling must be used for all images in the frame. + * Tiling for the frame. */ VkImageTiling tiling; /** - * Memory backing the images. Could be less than the amount of planes, - * in which case the offset value will indicate the binding offset of - * each plane in the memory. + * Memory backing the images. Either one, or as many as there are planes + * in the sw_format. + * In case of having multiple VkImages, but one memory, the offset field + * will indicate the bound offset for each image. */ VkDeviceMemory mem[AV_NUM_DATA_POINTERS]; size_t size[AV_NUM_DATA_POINTERS]; @@ -235,13 +326,13 @@ typedef struct AVVkFrame { VkMemoryPropertyFlagBits flags; /** - * Updated after every barrier + * Updated after every barrier. One per VkImage. */ VkAccessFlagBits access[AV_NUM_DATA_POINTERS]; VkImageLayout layout[AV_NUM_DATA_POINTERS]; /** - * Synchronization timeline semaphores, one for each sw_format plane. + * Synchronization timeline semaphores, one for each VkImage. * Must not be freed manually. Must be waited on at every submission using * the value in sem_value, and must be signalled at every submission, * using an incremented value. @@ -250,6 +341,7 @@ typedef struct AVVkFrame { /** * Up to date semaphore value at which each image becomes accessible. + * One per VkImage. * Clients must wait on this value when submitting a command queue, * and increment it when signalling. */ @@ -261,10 +353,18 @@ typedef struct AVVkFrame { struct AVVkFrameInternal *internal; /** - * Describes the binding offset of each plane to the VkDeviceMemory. + * Describes the binding offset of each image to the VkDeviceMemory. + * One per VkImage. */ ptrdiff_t offset[AV_NUM_DATA_POINTERS]; -} AVVkFrame; + + /** + * Queue family of the images. Must be VK_QUEUE_FAMILY_IGNORED if + * the image was allocated with the CONCURRENT concurrency option. + * One per VkImage. + */ + uint32_t queue_family[AV_NUM_DATA_POINTERS]; +}; /** * Allocates a single AVVkFrame and initializes everything as 0. @@ -273,7 +373,8 @@ typedef struct AVVkFrame { AVVkFrame *av_vk_frame_alloc(void); /** - * Returns the format of each image up to the number of planes for a given sw_format. + * Returns the optimal per-plane Vulkan format for a given sw_format, + * one for each plane. * Returns NULL on unsupported formats. */ const VkFormat *av_vkfmt_from_pixfmt(enum AVPixelFormat p); diff --git a/include/libavutil/iamf.h b/include/libavutil/iamf.h new file mode 100644 index 0000000..1fa7389 --- /dev/null +++ b/include/libavutil/iamf.h @@ -0,0 +1,690 @@ +/* + * Immersive Audio Model and Formats helper functions and defines + * + * 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 AVUTIL_IAMF_H +#define AVUTIL_IAMF_H + +/** + * @file + * Immersive Audio Model and Formats API header + * @see Immersive Audio Model and Formats + */ + +#include +#include + +#include "attributes.h" +#include "avassert.h" +#include "channel_layout.h" +#include "dict.h" +#include "rational.h" + +/** + * @defgroup lavu_iamf Immersive Audio Model and Formats + * @ingroup lavu_audio + * + * Immersive Audio Model and Formats related functions and defines + * + * @defgroup lavu_iamf_params Parameter Definition + * @ingroup lavu_iamf + * @{ + * Parameters as defined in section 3.6.1 and 3.8 of IAMF. + * @} + * + * @defgroup lavu_iamf_audio Audio Element + * @ingroup lavu_iamf + * @{ + * Audio Elements as defined in section 3.6 of IAMF. + * @} + * + * @defgroup lavu_iamf_mix Mix Presentation + * @ingroup lavu_iamf + * @{ + * Mix Presentations as defined in section 3.7 of IAMF. + * @} + * + * @addtogroup lavu_iamf_params + * @{ + */ +enum AVIAMFAnimationType { + AV_IAMF_ANIMATION_TYPE_STEP, + AV_IAMF_ANIMATION_TYPE_LINEAR, + AV_IAMF_ANIMATION_TYPE_BEZIER, +}; + +/** + * Mix Gain Parameter Data as defined in section 3.8.1 of IAMF. + * + * @note This struct's size is not a part of the public ABI. + */ +typedef struct AVIAMFMixGain { + const AVClass *av_class; + + /** + * Duration for the given subblock, in units of + * 1 / @ref AVIAMFParamDefinition.parameter_rate "parameter_rate". + * It must not be 0. + */ + unsigned int subblock_duration; + /** + * The type of animation applied to the parameter values. + */ + enum AVIAMFAnimationType animation_type; + /** + * Parameter value that is applied at the start of the subblock. + * Applies to all defined Animation Types. + * + * Valid range of values is -128.0 to 128.0 + */ + AVRational start_point_value; + /** + * Parameter value that is applied at the end of the subblock. + * Applies only to AV_IAMF_ANIMATION_TYPE_LINEAR and + * AV_IAMF_ANIMATION_TYPE_BEZIER Animation Types. + * + * Valid range of values is -128.0 to 128.0 + */ + AVRational end_point_value; + /** + * Parameter value of the middle control point of a quadratic Bezier + * curve, i.e., its y-axis value. + * Applies only to AV_IAMF_ANIMATION_TYPE_BEZIER Animation Type. + * + * Valid range of values is -128.0 to 128.0 + */ + AVRational control_point_value; + /** + * Parameter value of the time of the middle control point of a + * quadratic Bezier curve, i.e., its x-axis value. + * Applies only to AV_IAMF_ANIMATION_TYPE_BEZIER Animation Type. + * + * Valid range of values is 0.0 to 1.0 + */ + AVRational control_point_relative_time; +} AVIAMFMixGain; + +/** + * Demixing Info Parameter Data as defined in section 3.8.2 of IAMF. + * + * @note This struct's size is not a part of the public ABI. + */ +typedef struct AVIAMFDemixingInfo { + const AVClass *av_class; + + /** + * Duration for the given subblock, in units of + * 1 / @ref AVIAMFParamDefinition.parameter_rate "parameter_rate". + * It must not be 0. + */ + unsigned int subblock_duration; + /** + * Pre-defined combination of demixing parameters. + */ + unsigned int dmixp_mode; +} AVIAMFDemixingInfo; + +/** + * Recon Gain Info Parameter Data as defined in section 3.8.3 of IAMF. + * + * @note This struct's size is not a part of the public ABI. + */ +typedef struct AVIAMFReconGain { + const AVClass *av_class; + + /** + * Duration for the given subblock, in units of + * 1 / @ref AVIAMFParamDefinition.parameter_rate "parameter_rate". + * It must not be 0. + */ + unsigned int subblock_duration; + + /** + * Array of gain values to be applied to each channel for each layer + * defined in the Audio Element referencing the parent Parameter Definition. + * Values for layers where the AV_IAMF_LAYER_FLAG_RECON_GAIN flag is not set + * are undefined. + * + * Channel order is: FL, C, FR, SL, SR, TFL, TFR, BL, BR, TBL, TBR, LFE + */ + uint8_t recon_gain[6][12]; +} AVIAMFReconGain; + +enum AVIAMFParamDefinitionType { + /** + * Subblocks are of struct type AVIAMFMixGain + */ + AV_IAMF_PARAMETER_DEFINITION_MIX_GAIN, + /** + * Subblocks are of struct type AVIAMFDemixingInfo + */ + AV_IAMF_PARAMETER_DEFINITION_DEMIXING, + /** + * Subblocks are of struct type AVIAMFReconGain + */ + AV_IAMF_PARAMETER_DEFINITION_RECON_GAIN, +}; + +/** + * Parameters as defined in section 3.6.1 of IAMF. + * + * The struct is allocated by av_iamf_param_definition_alloc() along with an + * array of subblocks, its type depending on the value of type. + * This array is placed subblocks_offset bytes after the start of this struct. + * + * @note This struct's size is not a part of the public ABI. + */ +typedef struct AVIAMFParamDefinition { + const AVClass *av_class; + + /** + * Offset in bytes from the start of this struct, at which the subblocks + * array is located. + */ + size_t subblocks_offset; + /** + * Size in bytes of each element in the subblocks array. + */ + size_t subblock_size; + /** + * Number of subblocks in the array. + */ + unsigned int nb_subblocks; + + /** + * Parameters type. Determines the type of the subblock elements. + */ + enum AVIAMFParamDefinitionType type; + + /** + * Identifier for the paremeter substream. + */ + unsigned int parameter_id; + /** + * Sample rate for the paremeter substream. It must not be 0. + */ + unsigned int parameter_rate; + + /** + * The accumulated duration of all blocks in this parameter definition, + * in units of 1 / @ref parameter_rate. + * + * May be 0, in which case all duration values should be specified in + * another parameter definition referencing the same parameter_id. + */ + unsigned int duration; + /** + * The duration of every subblock in the case where all subblocks, with + * the optional exception of the last subblock, have equal durations. + * + * Must be 0 if subblocks have different durations. + */ + unsigned int constant_subblock_duration; +} AVIAMFParamDefinition; + +const AVClass *av_iamf_param_definition_get_class(void); + +/** + * Allocates memory for AVIAMFParamDefinition, plus an array of {@code nb_subblocks} + * amount of subblocks of the given type and initializes the variables. Can be + * freed with a normal av_free() call. + * + * @param size if non-NULL, the size in bytes of the resulting data array is written here. + */ +AVIAMFParamDefinition *av_iamf_param_definition_alloc(enum AVIAMFParamDefinitionType type, + unsigned int nb_subblocks, size_t *size); + +/** + * Get the subblock at the specified {@code idx}. Must be between 0 and nb_subblocks - 1. + * + * The @ref AVIAMFParamDefinition.type "param definition type" defines + * the struct type of the returned pointer. + */ +static av_always_inline void* +av_iamf_param_definition_get_subblock(const AVIAMFParamDefinition *par, unsigned int idx) +{ + av_assert0(idx < par->nb_subblocks); + return (void *)((uint8_t *)par + par->subblocks_offset + idx * par->subblock_size); +} + +/** + * @} + * @addtogroup lavu_iamf_audio + * @{ + */ + +enum AVIAMFAmbisonicsMode { + AV_IAMF_AMBISONICS_MODE_MONO, + AV_IAMF_AMBISONICS_MODE_PROJECTION, +}; + +/** + * Recon gain information for the layer is present in AVIAMFReconGain + */ +#define AV_IAMF_LAYER_FLAG_RECON_GAIN (1 << 0) + +/** + * A layer defining a Channel Layout in the Audio Element. + * + * When @ref AVIAMFAudioElement.audio_element_type "the parent's Audio Element type" + * is AV_IAMF_AUDIO_ELEMENT_TYPE_CHANNEL, this corresponds to an Scalable Channel + * Layout layer as defined in section 3.6.2 of IAMF. + * For AV_IAMF_AUDIO_ELEMENT_TYPE_SCENE, it is an Ambisonics channel + * layout as defined in section 3.6.3 of IAMF. + * + * @note The struct should be allocated with av_iamf_audio_element_add_layer() + * and its size is not a part of the public ABI. + */ +typedef struct AVIAMFLayer { + const AVClass *av_class; + + AVChannelLayout ch_layout; + + /** + * A bitmask which may contain a combination of AV_IAMF_LAYER_FLAG_* flags. + */ + unsigned int flags; + /** + * Output gain channel flags as defined in section 3.6.2 of IAMF. + * + * This field is defined only if @ref AVIAMFAudioElement.audio_element_type + * "the parent's Audio Element type" is AV_IAMF_AUDIO_ELEMENT_TYPE_CHANNEL, + * must be 0 otherwise. + */ + unsigned int output_gain_flags; + /** + * Output gain as defined in section 3.6.2 of IAMF. + * + * Must be 0 if @ref output_gain_flags is 0. + */ + AVRational output_gain; + /** + * Ambisonics mode as defined in section 3.6.3 of IAMF. + * + * This field is defined only if @ref AVIAMFAudioElement.audio_element_type + * "the parent's Audio Element type" is AV_IAMF_AUDIO_ELEMENT_TYPE_SCENE. + * + * If AV_IAMF_AMBISONICS_MODE_MONO, channel_mapping is defined implicitly + * (Ambisonic Order) or explicitly (Custom Order with ambi channels) in + * @ref ch_layout. + * If AV_IAMF_AMBISONICS_MODE_PROJECTION, @ref demixing_matrix must be set. + */ + enum AVIAMFAmbisonicsMode ambisonics_mode; + + /** + * Demixing matrix as defined in section 3.6.3 of IAMF. + * + * The length of the array is ch_layout.nb_channels multiplied by the sum of + * the amount of streams in the group plus the amount of streams in the group + * that are stereo. + * + * May be set only if @ref ambisonics_mode == AV_IAMF_AMBISONICS_MODE_PROJECTION, + * must be NULL otherwise. + */ + AVRational *demixing_matrix; +} AVIAMFLayer; + + +enum AVIAMFAudioElementType { + AV_IAMF_AUDIO_ELEMENT_TYPE_CHANNEL, + AV_IAMF_AUDIO_ELEMENT_TYPE_SCENE, +}; + +/** + * Information on how to combine one or more audio streams, as defined in + * section 3.6 of IAMF. + * + * @note The struct should be allocated with av_iamf_audio_element_alloc() + * and its size is not a part of the public ABI. + */ +typedef struct AVIAMFAudioElement { + const AVClass *av_class; + + AVIAMFLayer **layers; + /** + * Number of layers, or channel groups, in the Audio Element. + * There may be 6 layers at most, and for @ref audio_element_type + * AV_IAMF_AUDIO_ELEMENT_TYPE_SCENE, there may be exactly 1. + * + * Set by av_iamf_audio_element_add_layer(), must not be + * modified by any other code. + */ + unsigned int nb_layers; + + /** + * Demixing information used to reconstruct a scalable channel audio + * representation. + * The @ref AVIAMFParamDefinition.type "type" must be + * AV_IAMF_PARAMETER_DEFINITION_DEMIXING. + */ + AVIAMFParamDefinition *demixing_info; + /** + * Recon gain information used to reconstruct a scalable channel audio + * representation. + * The @ref AVIAMFParamDefinition.type "type" must be + * AV_IAMF_PARAMETER_DEFINITION_RECON_GAIN. + */ + AVIAMFParamDefinition *recon_gain_info; + + /** + * Audio element type as defined in section 3.6 of IAMF. + */ + enum AVIAMFAudioElementType audio_element_type; + + /** + * Default weight value as defined in section 3.6 of IAMF. + */ + unsigned int default_w; +} AVIAMFAudioElement; + +const AVClass *av_iamf_audio_element_get_class(void); + +/** + * Allocates a AVIAMFAudioElement, and initializes its fields with default values. + * No layers are allocated. Must be freed with av_iamf_audio_element_free(). + * + * @see av_iamf_audio_element_add_layer() + */ +AVIAMFAudioElement *av_iamf_audio_element_alloc(void); + +/** + * Allocate a layer and add it to a given AVIAMFAudioElement. + * It is freed by av_iamf_audio_element_free() alongside the rest of the parent + * AVIAMFAudioElement. + * + * @return a pointer to the allocated layer. + */ +AVIAMFLayer *av_iamf_audio_element_add_layer(AVIAMFAudioElement *audio_element); + +/** + * Free an AVIAMFAudioElement and all its contents. + * + * @param audio_element pointer to pointer to an allocated AVIAMFAudioElement. + * upon return, *audio_element will be set to NULL. + */ +void av_iamf_audio_element_free(AVIAMFAudioElement **audio_element); + +/** + * @} + * @addtogroup lavu_iamf_mix + * @{ + */ + +enum AVIAMFHeadphonesMode { + /** + * The referenced Audio Element shall be rendered to stereo loudspeakers. + */ + AV_IAMF_HEADPHONES_MODE_STEREO, + /** + * The referenced Audio Element shall be rendered with a binaural renderer. + */ + AV_IAMF_HEADPHONES_MODE_BINAURAL, +}; + +/** + * Submix element as defined in section 3.7 of IAMF. + * + * @note The struct should be allocated with av_iamf_submix_add_element() + * and its size is not a part of the public ABI. + */ +typedef struct AVIAMFSubmixElement { + const AVClass *av_class; + + /** + * The id of the Audio Element this submix element references. + */ + unsigned int audio_element_id; + + /** + * Information required required for applying any processing to the + * referenced and rendered Audio Element before being summed with other + * processed Audio Elements. + * The @ref AVIAMFParamDefinition.type "type" must be + * AV_IAMF_PARAMETER_DEFINITION_MIX_GAIN. + */ + AVIAMFParamDefinition *element_mix_config; + + /** + * Default mix gain value to apply when there are no AVIAMFParamDefinition + * with @ref element_mix_config "element_mix_config's" + * @ref AVIAMFParamDefinition.parameter_id "parameter_id" available for a + * given audio frame. + */ + AVRational default_mix_gain; + + /** + * A value that indicates whether the referenced channel-based Audio Element + * shall be rendered to stereo loudspeakers or spatialized with a binaural + * renderer when played back on headphones. + * If the Audio Element is not of @ref AVIAMFAudioElement.audio_element_type + * "type" AV_IAMF_AUDIO_ELEMENT_TYPE_CHANNEL, then this field is undefined. + */ + enum AVIAMFHeadphonesMode headphones_rendering_mode; + + /** + * A dictionary of strings describing the submix in different languages. + * Must have the same amount of entries as + * @ref AVIAMFMixPresentation.annotations "the mix's annotations", stored + * in the same order, and with the same key strings. + * + * @ref AVDictionaryEntry.key "key" is a string conforming to BCP-47 that + * specifies the language for the string stored in + * @ref AVDictionaryEntry.value "value". + */ + AVDictionary *annotations; +} AVIAMFSubmixElement; + +enum AVIAMFSubmixLayoutType { + /** + * The layout follows the loudspeaker sound system convention of ITU-2051-3. + */ + AV_IAMF_SUBMIX_LAYOUT_TYPE_LOUDSPEAKERS = 2, + /** + * The layout is binaural. + */ + AV_IAMF_SUBMIX_LAYOUT_TYPE_BINAURAL = 3, +}; + +/** + * Submix layout as defined in section 3.7.6 of IAMF. + * + * @note The struct should be allocated with av_iamf_submix_add_layout() + * and its size is not a part of the public ABI. + */ +typedef struct AVIAMFSubmixLayout { + const AVClass *av_class; + + enum AVIAMFSubmixLayoutType layout_type; + + /** + * Channel layout matching one of Sound Systems A to J of ITU-2051-3, plus + * 7.1.2ch and 3.1.2ch + * If layout_type is not AV_IAMF_SUBMIX_LAYOUT_TYPE_LOUDSPEAKERS, this field + * is undefined. + */ + AVChannelLayout sound_system; + /** + * The program integrated loudness information, as defined in + * ITU-1770-4. + */ + AVRational integrated_loudness; + /** + * The digital (sampled) peak value of the audio signal, as defined + * in ITU-1770-4. + */ + AVRational digital_peak; + /** + * The true peak of the audio signal, as defined in ITU-1770-4. + */ + AVRational true_peak; + /** + * The Dialogue loudness information, as defined in ITU-1770-4. + */ + AVRational dialogue_anchored_loudness; + /** + * The Album loudness information, as defined in ITU-1770-4. + */ + AVRational album_anchored_loudness; +} AVIAMFSubmixLayout; + +/** + * Submix layout as defined in section 3.7 of IAMF. + * + * @note The struct should be allocated with av_iamf_mix_presentation_add_submix() + * and its size is not a part of the public ABI. + */ +typedef struct AVIAMFSubmix { + const AVClass *av_class; + + /** + * Array of submix elements. + * + * Set by av_iamf_submix_add_element(), must not be modified by any + * other code. + */ + AVIAMFSubmixElement **elements; + /** + * Number of elements in the submix. + * + * Set by av_iamf_submix_add_element(), must not be modified by any + * other code. + */ + unsigned int nb_elements; + + /** + * Array of submix layouts. + * + * Set by av_iamf_submix_add_layout(), must not be modified by any + * other code. + */ + AVIAMFSubmixLayout **layouts; + /** + * Number of layouts in the submix. + * + * Set by av_iamf_submix_add_layout(), must not be modified by any + * other code. + */ + unsigned int nb_layouts; + + /** + * Information required for post-processing the mixed audio signal to + * generate the audio signal for playback. + * The @ref AVIAMFParamDefinition.type "type" must be + * AV_IAMF_PARAMETER_DEFINITION_MIX_GAIN. + */ + AVIAMFParamDefinition *output_mix_config; + + /** + * Default mix gain value to apply when there are no AVIAMFParamDefinition + * with @ref output_mix_config "output_mix_config's" + * @ref AVIAMFParamDefinition.parameter_id "parameter_id" available for a + * given audio frame. + */ + AVRational default_mix_gain; +} AVIAMFSubmix; + +/** + * Information on how to render and mix one or more AVIAMFAudioElement to generate + * the final audio output, as defined in section 3.7 of IAMF. + * + * @note The struct should be allocated with av_iamf_mix_presentation_alloc() + * and its size is not a part of the public ABI. + */ +typedef struct AVIAMFMixPresentation { + const AVClass *av_class; + + /** + * Array of submixes. + * + * Set by av_iamf_mix_presentation_add_submix(), must not be modified + * by any other code. + */ + AVIAMFSubmix **submixes; + /** + * Number of submixes in the presentation. + * + * Set by av_iamf_mix_presentation_add_submix(), must not be modified + * by any other code. + */ + unsigned int nb_submixes; + + /** + * A dictionary of strings describing the mix in different languages. + * Must have the same amount of entries as every + * @ref AVIAMFSubmixElement.annotations "Submix element annotations", + * stored in the same order, and with the same key strings. + * + * @ref AVDictionaryEntry.key "key" is a string conforming to BCP-47 + * that specifies the language for the string stored in + * @ref AVDictionaryEntry.value "value". + */ + AVDictionary *annotations; +} AVIAMFMixPresentation; + +const AVClass *av_iamf_mix_presentation_get_class(void); + +/** + * Allocates a AVIAMFMixPresentation, and initializes its fields with default + * values. No submixes are allocated. + * Must be freed with av_iamf_mix_presentation_free(). + * + * @see av_iamf_mix_presentation_add_submix() + */ +AVIAMFMixPresentation *av_iamf_mix_presentation_alloc(void); + +/** + * Allocate a submix and add it to a given AVIAMFMixPresentation. + * It is freed by av_iamf_mix_presentation_free() alongside the rest of the + * parent AVIAMFMixPresentation. + * + * @return a pointer to the allocated submix. + */ +AVIAMFSubmix *av_iamf_mix_presentation_add_submix(AVIAMFMixPresentation *mix_presentation); + +/** + * Allocate a submix element and add it to a given AVIAMFSubmix. + * It is freed by av_iamf_mix_presentation_free() alongside the rest of the + * parent AVIAMFSubmix. + * + * @return a pointer to the allocated submix. + */ +AVIAMFSubmixElement *av_iamf_submix_add_element(AVIAMFSubmix *submix); + +/** + * Allocate a submix layout and add it to a given AVIAMFSubmix. + * It is freed by av_iamf_mix_presentation_free() alongside the rest of the + * parent AVIAMFSubmix. + * + * @return a pointer to the allocated submix. + */ +AVIAMFSubmixLayout *av_iamf_submix_add_layout(AVIAMFSubmix *submix); + +/** + * Free an AVIAMFMixPresentation and all its contents. + * + * @param mix_presentation pointer to pointer to an allocated AVIAMFMixPresentation. + * upon return, *mix_presentation will be set to NULL. + */ +void av_iamf_mix_presentation_free(AVIAMFMixPresentation **mix_presentation); + +/** + * @} + */ + +#endif /* AVUTIL_IAMF_H */ diff --git a/include/libavutil/imgutils.h b/include/libavutil/imgutils.h index be53335..123a9e5 100755 --- a/include/libavutil/imgutils.h +++ b/include/libavutil/imgutils.h @@ -48,6 +48,7 @@ * component in the plane with the max pixel step. * @param max_pixstep_comps an array which is filled with the component * for each plane which has the max pixel step. May be NULL. + * @param pixdesc the AVPixFmtDescriptor for the image, describing its format */ void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4], const AVPixFmtDescriptor *pixdesc); @@ -65,6 +66,8 @@ int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane); * width width. * * @param linesizes array to be filled with the linesize for each plane + * @param pix_fmt the AVPixelFormat of the image + * @param width width of the image in pixels * @return >= 0 in case of success, a negative error code otherwise */ int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width); @@ -73,6 +76,8 @@ int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int wi * Fill plane sizes for an image with pixel format pix_fmt and height height. * * @param size the array to be filled with the size of each image plane + * @param pix_fmt the AVPixelFormat of the image + * @param height height of the image in pixels * @param linesizes the array containing the linesize for each * plane, should be filled by av_image_fill_linesizes() * @return >= 0 in case of success, a negative error code otherwise @@ -88,6 +93,8 @@ int av_image_fill_plane_sizes(size_t size[4], enum AVPixelFormat pix_fmt, * height height. * * @param data pointers array to be filled with the pointer for each image plane + * @param pix_fmt the AVPixelFormat of the image + * @param height height of the image in pixels * @param ptr the pointer to a buffer which will contain the image * @param linesizes the array containing the linesize for each * plane, should be filled by av_image_fill_linesizes() @@ -103,6 +110,11 @@ int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int hei * The allocated image buffer has to be freed by using * av_freep(&pointers[0]). * + * @param pointers array to be filled with the pointer for each image plane + * @param linesizes the array filled with the linesize for each plane + * @param w width of the image in pixels + * @param h height of the image in pixels + * @param pix_fmt the AVPixelFormat of the image * @param align the value to use for buffer size alignment * @return the size in bytes required for the image buffer, a negative * error code in case of failure @@ -119,8 +131,11 @@ int av_image_alloc(uint8_t *pointers[4], int linesizes[4], * bytewidth must be contained by both absolute values of dst_linesize * and src_linesize, otherwise the function behavior is undefined. * + * @param dst destination plane to copy to * @param dst_linesize linesize for the image plane in dst + * @param src source plane to copy from * @param src_linesize linesize for the image plane in src + * @param height height (number of lines) of the plane */ void av_image_copy_plane(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, @@ -147,13 +162,34 @@ void av_image_copy_plane_uc_from(uint8_t *dst, ptrdiff_t dst_linesize, /** * Copy image in src_data to dst_data. * + * @param dst_data destination image data buffer to copy to * @param dst_linesizes linesizes for the image in dst_data + * @param src_data source image data buffer to copy from * @param src_linesizes linesizes for the image in src_data + * @param pix_fmt the AVPixelFormat of the image + * @param width width of the image in pixels + * @param height height of the image in pixels */ -void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], - const uint8_t *src_data[4], const int src_linesizes[4], +void av_image_copy(uint8_t * const dst_data[4], const int dst_linesizes[4], + const uint8_t * const src_data[4], const int src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height); +/** + * Wrapper around av_image_copy() to workaround the limitation + * that the conversion from uint8_t * const * to const uint8_t * const * + * is not performed automatically in C. + * @see av_image_copy() + */ +static inline +void av_image_copy2(uint8_t * const dst_data[4], const int dst_linesizes[4], + uint8_t * const src_data[4], const int src_linesizes[4], + enum AVPixelFormat pix_fmt, int width, int height) +{ + av_image_copy(dst_data, dst_linesizes, + (const uint8_t * const *)src_data, src_linesizes, + pix_fmt, width, height); +} + /** * Copy image data located in uncacheable (e.g. GPU mapped) memory. Where * available, this function will use special functionality for reading from such @@ -168,8 +204,8 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], * @note On x86, the linesizes currently need to be aligned to the cacheline * size (i.e. 64) to get improved performance. */ -void av_image_copy_uc_from(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4], - const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4], +void av_image_copy_uc_from(uint8_t * const dst_data[4], const ptrdiff_t dst_linesizes[4], + const uint8_t * const src_data[4], const ptrdiff_t src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height); /** @@ -299,10 +335,40 @@ int av_image_check_sar(unsigned int w, unsigned int h, AVRational sar); * @param height the height of the image in pixels * @return 0 if the image data was cleared, a negative AVERROR code otherwise */ -int av_image_fill_black(uint8_t *dst_data[4], const ptrdiff_t dst_linesize[4], +int av_image_fill_black(uint8_t * const dst_data[4], const ptrdiff_t dst_linesize[4], enum AVPixelFormat pix_fmt, enum AVColorRange range, int width, int height); +/** + * Overwrite the image data with a color. This is suitable for filling a + * sub-rectangle of an image, meaning the padding between the right most pixel + * and the left most pixel on the next line will not be overwritten. For some + * formats, the image size might be rounded up due to inherent alignment. + * + * If the pixel format has alpha, it is also replaced. Color component values + * are interpreted as native integers (or intfloats) regardless of actual pixel + * format endianness. + * + * This can return an error if the pixel format is not supported. Normally, all + * non-hwaccel pixel formats should be supported. + * + * Passing NULL for dst_data is allowed. Then the function returns whether the + * operation would have succeeded. (It can return an error if the pix_fmt is + * not supported.) + * + * @param dst_data data pointers to destination image + * @param dst_linesize linesizes for the destination image + * @param pix_fmt the pixel format of the image + * @param color the color components to be used for the fill + * @param width the width of the image in pixels + * @param height the height of the image in pixels + * @param flags currently unused + * @return 0 if the image data was filled, a negative AVERROR code otherwise + */ +int av_image_fill_color(uint8_t * const dst_data[4], const ptrdiff_t dst_linesize[4], + enum AVPixelFormat pix_fmt, const uint32_t color[4], + int width, int height, int flags); + /** * @} */ diff --git a/include/libavutil/imgutils_internal.h b/include/libavutil/imgutils_internal.h new file mode 100644 index 0000000..3e47731 --- /dev/null +++ b/include/libavutil/imgutils_internal.h @@ -0,0 +1,34 @@ +/* + * 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 AVUTIL_IMGUTILS_INTERNAL_H +#define AVUTIL_IMGUTILS_INTERNAL_H + +#include +#include + +#include "pixfmt.h" + +int avpriv_set_systematic_pal2(uint32_t pal[256], enum AVPixelFormat pix_fmt); + +int ff_image_copy_plane_uc_from_x86(uint8_t *dst, ptrdiff_t dst_linesize, + const uint8_t *src, ptrdiff_t src_linesize, + ptrdiff_t bytewidth, int height); + + +#endif /* AVUTIL_IMGUTILS_INTERNAL_H */ diff --git a/include/libavutil/integer.h b/include/libavutil/integer.h new file mode 100644 index 0000000..2d9b5bb --- /dev/null +++ b/include/libavutil/integer.h @@ -0,0 +1,86 @@ +/* + * arbitrary precision integers + * Copyright (c) 2004 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * arbitrary precision integers + * @author Michael Niedermayer + */ + +#ifndef AVUTIL_INTEGER_H +#define AVUTIL_INTEGER_H + +#include +#include "attributes.h" + +#define AV_INTEGER_SIZE 8 + +typedef struct AVInteger{ + uint16_t v[AV_INTEGER_SIZE]; +} AVInteger; + +AVInteger av_add_i(AVInteger a, AVInteger b) av_const; +AVInteger av_sub_i(AVInteger a, AVInteger b) av_const; + +/** + * Return the rounded-down value of the base 2 logarithm of the given + * AVInteger. This is simply the index of the most significant bit + * which is 1, or 0 if all bits are 0. + */ +int av_log2_i(AVInteger a) av_const; +AVInteger av_mul_i(AVInteger a, AVInteger b) av_const; + +/** + * Return 0 if a==b, 1 if a>b and -1 if a + * + * 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 + */ + +/** + * @file + * common internal API header + */ + +#ifndef AVUTIL_INTERNAL_H +#define AVUTIL_INTERNAL_H + +#if !defined(DEBUG) && !defined(NDEBUG) +# define NDEBUG +#endif + +// This can be enabled to allow detection of additional integer overflows with ubsan +//#define CHECKED + +#include +#include +#include +#include +#include +#include "config.h" +#include "attributes.h" +#include "libm.h" +#include "macros.h" + +#ifndef attribute_align_arg +#if ARCH_X86_32 && AV_GCC_VERSION_AT_LEAST(4,2) +# define attribute_align_arg __attribute__((force_align_arg_pointer)) +#else +# define attribute_align_arg +#endif +#endif + +#if defined(_WIN32) && CONFIG_SHARED && !defined(BUILDING_avutil) +# define av_export_avutil __declspec(dllimport) +#else +# define av_export_avutil +#endif + +#if HAVE_PRAGMA_DEPRECATED +# if defined(__ICL) || defined (__INTEL_COMPILER) +# define FF_DISABLE_DEPRECATION_WARNINGS __pragma(warning(push)) __pragma(warning(disable:1478)) +# define FF_ENABLE_DEPRECATION_WARNINGS __pragma(warning(pop)) +# elif defined(_MSC_VER) +# define FF_DISABLE_DEPRECATION_WARNINGS __pragma(warning(push)) __pragma(warning(disable:4996)) +# define FF_ENABLE_DEPRECATION_WARNINGS __pragma(warning(pop)) +# else +# define FF_DISABLE_DEPRECATION_WARNINGS _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") +# define FF_ENABLE_DEPRECATION_WARNINGS _Pragma("GCC diagnostic pop") +# endif +#else +# define FF_DISABLE_DEPRECATION_WARNINGS +# define FF_ENABLE_DEPRECATION_WARNINGS +#endif + + +#define FF_ALLOC_TYPED_ARRAY(p, nelem) (p = av_malloc_array(nelem, sizeof(*p))) +#define FF_ALLOCZ_TYPED_ARRAY(p, nelem) (p = av_calloc(nelem, sizeof(*p))) + +#define FF_PTR_ADD(ptr, off) ((off) ? (ptr) + (off) : (ptr)) + +/** + * Access a field in a structure by its offset. + */ +#define FF_FIELD_AT(type, off, obj) (*(type *)((char *)&(obj) + (off))) + +/** + * Return NULL if CONFIG_SMALL is true, otherwise the argument + * without modification. Used to disable the definition of strings. + */ +#if CONFIG_SMALL +# define NULL_IF_CONFIG_SMALL(x) NULL +#else +# define NULL_IF_CONFIG_SMALL(x) x +#endif + +/** + * Log a generic warning message about a missing feature. + * + * @param[in] avc a pointer to an arbitrary struct of which the first + * field is a pointer to an AVClass struct + * @param[in] msg string containing the name of the missing feature + */ +void avpriv_report_missing_feature(void *avc, + const char *msg, ...) av_printf_format(2, 3); + +/** + * Log a generic warning message about a missing feature. + * Additionally request that a sample showcasing the feature be uploaded. + * + * @param[in] avc a pointer to an arbitrary struct of which the first field is + * a pointer to an AVClass struct + * @param[in] msg string containing the name of the missing feature + */ +void avpriv_request_sample(void *avc, + const char *msg, ...) av_printf_format(2, 3); + +#if HAVE_LIBC_MSVCRT +#include +#if defined(_VC_CRT_MAJOR_VERSION) && _VC_CRT_MAJOR_VERSION < 14 +#pragma comment(linker, "/include:" EXTERN_PREFIX "avpriv_strtod") +#pragma comment(linker, "/include:" EXTERN_PREFIX "avpriv_snprintf") +#endif + +#define PTRDIFF_SPECIFIER "Id" +#define SIZE_SPECIFIER "Iu" +#else +#define PTRDIFF_SPECIFIER "td" +#define SIZE_SPECIFIER "zu" +#endif + +#ifdef DEBUG +# define ff_dlog(ctx, ...) av_log(ctx, AV_LOG_DEBUG, __VA_ARGS__) +#else +# define ff_dlog(ctx, ...) do { if (0) av_log(ctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) +#endif + +#ifdef TRACE +# define ff_tlog(ctx, ...) av_log(ctx, AV_LOG_TRACE, __VA_ARGS__) +#else +# define ff_tlog(ctx, ...) do { } while(0) +#endif + +// For debuging we use signed operations so overflows can be detected (by ubsan) +// For production we use unsigned so there are no undefined operations +#ifdef CHECKED +#define SUINT int +#define SUINT32 int32_t +#else +#define SUINT unsigned +#define SUINT32 uint32_t +#endif + +static av_always_inline av_const int avpriv_mirror(int x, int w) +{ + if (!w) + return 0; + + while ((unsigned)x > (unsigned)w) { + x = -x; + if (x < 0) + x += 2 * w; + } + return x; +} + +#endif /* AVUTIL_INTERNAL_H */ diff --git a/include/libavutil/intmath.h b/include/libavutil/intmath.h new file mode 100644 index 0000000..52e11a8 --- /dev/null +++ b/include/libavutil/intmath.h @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2010 Mans Rullgard + * + * 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 AVUTIL_INTMATH_H +#define AVUTIL_INTMATH_H + +#include + +#include "config.h" +#include "attributes.h" + +#if ARCH_ARM +# include "arm/intmath.h" +#elif ARCH_RISCV +# include "riscv/intmath.h" +#elif ARCH_X86 +# include "x86/intmath.h" +#endif + +#if HAVE_FAST_CLZ +#if AV_GCC_VERSION_AT_LEAST(3,4) +#ifndef ff_log2 +# define ff_log2(x) (31 - __builtin_clz((x)|1)) +# ifndef ff_log2_16bit +# define ff_log2_16bit av_log2 +# endif +#endif /* ff_log2 */ +#endif /* AV_GCC_VERSION_AT_LEAST(3,4) */ +#endif + +extern const uint8_t ff_log2_tab[256]; + +#ifndef ff_log2 +#define ff_log2 ff_log2_c +static av_always_inline av_const int ff_log2_c(unsigned int v) +{ + int n = 0; + if (v & 0xffff0000) { + v >>= 16; + n += 16; + } + if (v & 0xff00) { + v >>= 8; + n += 8; + } + n += ff_log2_tab[v]; + + return n; +} +#endif + +#ifndef ff_log2_16bit +#define ff_log2_16bit ff_log2_16bit_c +static av_always_inline av_const int ff_log2_16bit_c(unsigned int v) +{ + int n = 0; + if (v & 0xff00) { + v >>= 8; + n += 8; + } + n += ff_log2_tab[v]; + + return n; +} +#endif + +#define av_log2 ff_log2 +#define av_log2_16bit ff_log2_16bit + +/** + * @addtogroup lavu_math + * @{ + */ + +#if HAVE_FAST_CLZ +#if AV_GCC_VERSION_AT_LEAST(3,4) +#ifndef ff_ctz +#define ff_ctz(v) __builtin_ctz(v) +#endif +#ifndef ff_ctzll +#define ff_ctzll(v) __builtin_ctzll(v) +#endif +#ifndef ff_clz +#define ff_clz(v) __builtin_clz(v) +#endif +#endif +#endif + +#ifndef ff_ctz +#define ff_ctz ff_ctz_c +/** + * Trailing zero bit count. + * + * @param v input value. If v is 0, the result is undefined. + * @return the number of trailing 0-bits + */ +/* We use the De-Bruijn method outlined in: + * http://supertech.csail.mit.edu/papers/debruijn.pdf. */ +static av_always_inline av_const int ff_ctz_c(int v) +{ + static const uint8_t debruijn_ctz32[32] = { + 0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, + 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9 + }; + return debruijn_ctz32[(uint32_t)((v & -(uint32_t)v) * 0x077CB531U) >> 27]; +} +#endif + +#ifndef ff_ctzll +#define ff_ctzll ff_ctzll_c +/* We use the De-Bruijn method outlined in: + * http://supertech.csail.mit.edu/papers/debruijn.pdf. */ +static av_always_inline av_const int ff_ctzll_c(long long v) +{ + static const uint8_t debruijn_ctz64[64] = { + 0, 1, 2, 53, 3, 7, 54, 27, 4, 38, 41, 8, 34, 55, 48, 28, + 62, 5, 39, 46, 44, 42, 22, 9, 24, 35, 59, 56, 49, 18, 29, 11, + 63, 52, 6, 26, 37, 40, 33, 47, 61, 45, 43, 21, 23, 58, 17, 10, + 51, 25, 36, 32, 60, 20, 57, 16, 50, 31, 19, 15, 30, 14, 13, 12 + }; + return debruijn_ctz64[(uint64_t)((v & -(uint64_t)v) * 0x022FDD63CC95386DU) >> 58]; +} +#endif + +#ifndef ff_clz +#define ff_clz ff_clz_c +static av_always_inline av_const unsigned ff_clz_c(unsigned x) +{ + unsigned i = sizeof(x) * 8; + + while (x) { + x >>= 1; + i--; + } + + return i; +} +#endif + +#if AV_GCC_VERSION_AT_LEAST(3,4) +#ifndef av_parity +#define av_parity __builtin_parity +#endif +#endif + +/** + * @} + */ +#endif /* AVUTIL_INTMATH_H */ diff --git a/include/libavutil/intreadwrite.h b/include/libavutil/intreadwrite.h index 4c8413a..ffd15a1 100755 --- a/include/libavutil/intreadwrite.h +++ b/include/libavutil/intreadwrite.h @@ -64,16 +64,12 @@ typedef union { #include "config.h" -#if ARCH_ARM -# include "arm/intreadwrite.h" -#elif ARCH_AVR32 -# include "avr32/intreadwrite.h" +#if ARCH_AARCH64 +# include "aarch64/intreadwrite.h" #elif ARCH_MIPS # include "mips/intreadwrite.h" #elif ARCH_PPC # include "ppc/intreadwrite.h" -#elif ARCH_TOMI -# include "tomi/intreadwrite.h" #elif ARCH_X86 # include "x86/intreadwrite.h" #endif @@ -215,7 +211,7 @@ typedef union { * by per-arch headers. */ -#if defined(__GNUC__) +#if defined(__GNUC__) || defined(__clang__) union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias; union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias; @@ -545,9 +541,41 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias; #if AV_HAVE_BIGENDIAN # define AV_RLA(s, p) av_bswap##s(AV_RN##s##A(p)) # define AV_WLA(s, p, v) AV_WN##s##A(p, av_bswap##s(v)) +# define AV_RBA(s, p) AV_RN##s##A(p) +# define AV_WBA(s, p, v) AV_WN##s##A(p, v) #else # define AV_RLA(s, p) AV_RN##s##A(p) # define AV_WLA(s, p, v) AV_WN##s##A(p, v) +# define AV_RBA(s, p) av_bswap##s(AV_RN##s##A(p)) +# define AV_WBA(s, p, v) AV_WN##s##A(p, av_bswap##s(v)) +#endif + +#ifndef AV_RL16A +# define AV_RL16A(p) AV_RLA(16, p) +#endif +#ifndef AV_WL16A +# define AV_WL16A(p, v) AV_WLA(16, p, v) +#endif + +#ifndef AV_RB16A +# define AV_RB16A(p) AV_RBA(16, p) +#endif +#ifndef AV_WB16A +# define AV_WB16A(p, v) AV_WBA(16, p, v) +#endif + +#ifndef AV_RL32A +# define AV_RL32A(p) AV_RLA(32, p) +#endif +#ifndef AV_WL32A +# define AV_WL32A(p, v) AV_WLA(32, p, v) +#endif + +#ifndef AV_RB32A +# define AV_RB32A(p) AV_RBA(32, p) +#endif +#ifndef AV_WB32A +# define AV_WB32A(p, v) AV_WBA(32, p, v) #endif #ifndef AV_RL64A @@ -557,6 +585,13 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias; # define AV_WL64A(p, v) AV_WLA(64, p, v) #endif +#ifndef AV_RB64A +# define AV_RB64A(p) AV_RBA(64, p) +#endif +#ifndef AV_WB64A +# define AV_WB64A(p, v) AV_WBA(64, p, v) +#endif + /* * The AV_COPYxxU macros are suitable for copying data to/from unaligned * memory locations. @@ -585,9 +620,7 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias; #endif /* Parameters for AV_COPY*, AV_SWAP*, AV_ZERO* must be - * naturally aligned. They may be implemented using MMX, - * so emms_c() must be called before using any float code - * afterwards. + * naturally aligned. */ #define AV_COPY(n, d, s) \ diff --git a/include/libavutil/lfg.h b/include/libavutil/lfg.h index 2b66920..e75a986 100755 --- a/include/libavutil/lfg.h +++ b/include/libavutil/lfg.h @@ -27,7 +27,7 @@ /** * Context structure for the Lagged Fibonacci PRNG. * The exact layout, types and content of this struct may change and should - * not be accessed directly. Only its sizeof() is guranteed to stay the same + * not be accessed directly. Only its `sizeof()` is guaranteed to stay the same * to allow easy instanciation. */ typedef struct AVLFG { @@ -40,7 +40,7 @@ void av_lfg_init(AVLFG *c, unsigned int seed); /** * Seed the state of the ALFG using binary data. * - * Return value: 0 on success, negative value (AVERROR) on failure. + * @return 0 on success, negative value (AVERROR) on failure. */ int av_lfg_init_from_data(AVLFG *c, const uint8_t *data, unsigned int length); @@ -73,6 +73,7 @@ static inline unsigned int av_mlfg_get(AVLFG *c){ * Get the next two numbers generated by a Box-Muller Gaussian * generator using the random numbers issued by lfg. * + * @param lfg pointer to the contex structure * @param out array where the two generated numbers are placed */ void av_bmg_get(AVLFG *lfg, double out[2]); diff --git a/include/libavutil/libm.h b/include/libavutil/libm.h new file mode 100644 index 0000000..a819962 --- /dev/null +++ b/include/libavutil/libm.h @@ -0,0 +1,471 @@ +/* + * erf function: Copyright (c) 2006 John Maddock + * 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 + */ + +/** + * @file + * Replacements for frequently missing libm functions + */ + +#ifndef AVUTIL_LIBM_H +#define AVUTIL_LIBM_H + +#include +#include "config.h" +#include "attributes.h" +#include "intfloat.h" +#include "mathematics.h" + +#if HAVE_MIPSFPU && HAVE_INLINE_ASM +#include "libavutil/mips/libm_mips.h" +#endif /* HAVE_MIPSFPU && HAVE_INLINE_ASM*/ + +#if !HAVE_ATANF +#undef atanf +#define atanf(x) ((float)atan(x)) +#endif /* HAVE_ATANF */ + +#if !HAVE_ATAN2F +#undef atan2f +#define atan2f(y, x) ((float)atan2(y, x)) +#endif /* HAVE_ATAN2F */ + +#if !HAVE_POWF +#undef powf +#define powf(x, y) ((float)pow(x, y)) +#endif /* HAVE_POWF */ + +#if !HAVE_CBRT +static av_always_inline double cbrt(double x) +{ + return x < 0 ? -pow(-x, 1.0 / 3.0) : pow(x, 1.0 / 3.0); +} +#endif /* HAVE_CBRT */ + +#if !HAVE_CBRTF +static av_always_inline float cbrtf(float x) +{ + return x < 0 ? -powf(-x, 1.0 / 3.0) : powf(x, 1.0 / 3.0); +} +#endif /* HAVE_CBRTF */ + +#if !HAVE_COPYSIGN +static av_always_inline double copysign(double x, double y) +{ + uint64_t vx = av_double2int(x); + uint64_t vy = av_double2int(y); + return av_int2double((vx & UINT64_C(0x7fffffffffffffff)) | (vy & UINT64_C(0x8000000000000000))); +} +#endif /* HAVE_COPYSIGN */ + +#if !HAVE_COSF +#undef cosf +#define cosf(x) ((float)cos(x)) +#endif /* HAVE_COSF */ + +#if !HAVE_ERF +static inline double ff_eval_poly(const double *coeff, int size, double x) { + double sum = coeff[size-1]; + int i; + for (i = size-2; i >= 0; --i) { + sum *= x; + sum += coeff[i]; + } + return sum; +} + +/** + * erf function + * Algorithm taken from the Boost project, source: + * http://www.boost.org/doc/libs/1_46_1/boost/math/special_functions/erf.hpp + * Use, modification and distribution are subject to the + * Boost Software License, Version 1.0 (see notice below). + * Boost Software License - Version 1.0 - August 17th, 2003 +Permission is hereby granted, free of charge, to any person or organization +obtaining a copy of the software and accompanying documentation covered by +this license (the "Software") to use, reproduce, display, distribute, +execute, and transmit the Software, and to prepare derivative works of the +Software, and to permit third-parties to whom the Software is furnished to +do so, all subject to the following: + +The copyright notices in the Software and this entire statement, including +the above license grant, this restriction and the following disclaimer, +must be included in all copies of the Software, in whole or in part, and +all derivative works of the Software, unless such copies or derivative +works are solely in the form of machine-executable object code generated by +a source language processor. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT +SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE +FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + */ +static inline double erf(double z) +{ +#ifndef FF_ARRAY_ELEMS +#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0])) +#endif + double result; + + /* handle the symmetry: erf(-x) = -erf(x) */ + if (z < 0) + return -erf(-z); + + /* branch based on range of z, and pick appropriate approximation */ + if (z == 0) + return 0; + else if (z < 1e-10) + return z * 1.125 + z * 0.003379167095512573896158903121545171688; + else if (z < 0.5) { + // Maximum Deviation Found: 1.561e-17 + // Expected Error Term: 1.561e-17 + // Maximum Relative Change in Control Points: 1.155e-04 + // Max Error found at double precision = 2.961182e-17 + + static const double y = 1.044948577880859375; + static const double p[] = { + 0.0834305892146531832907, + -0.338165134459360935041, + -0.0509990735146777432841, + -0.00772758345802133288487, + -0.000322780120964605683831, + }; + static const double q[] = { + 1, + 0.455004033050794024546, + 0.0875222600142252549554, + 0.00858571925074406212772, + 0.000370900071787748000569, + }; + double zz = z * z; + return z * (y + ff_eval_poly(p, FF_ARRAY_ELEMS(p), zz) / ff_eval_poly(q, FF_ARRAY_ELEMS(q), zz)); + } + /* here onwards compute erfc */ + else if (z < 1.5) { + // Maximum Deviation Found: 3.702e-17 + // Expected Error Term: 3.702e-17 + // Maximum Relative Change in Control Points: 2.845e-04 + // Max Error found at double precision = 4.841816e-17 + static const double y = 0.405935764312744140625; + static const double p[] = { + -0.098090592216281240205, + 0.178114665841120341155, + 0.191003695796775433986, + 0.0888900368967884466578, + 0.0195049001251218801359, + 0.00180424538297014223957, + }; + static const double q[] = { + 1, + 1.84759070983002217845, + 1.42628004845511324508, + 0.578052804889902404909, + 0.12385097467900864233, + 0.0113385233577001411017, + 0.337511472483094676155e-5, + }; + result = y + ff_eval_poly(p, FF_ARRAY_ELEMS(p), z - 0.5) / ff_eval_poly(q, FF_ARRAY_ELEMS(q), z - 0.5); + result *= exp(-z * z) / z; + return 1 - result; + } + else if (z < 2.5) { + // Max Error found at double precision = 6.599585e-18 + // Maximum Deviation Found: 3.909e-18 + // Expected Error Term: 3.909e-18 + // Maximum Relative Change in Control Points: 9.886e-05 + static const double y = 0.50672817230224609375; + static const double p[] = { + -0.0243500476207698441272, + 0.0386540375035707201728, + 0.04394818964209516296, + 0.0175679436311802092299, + 0.00323962406290842133584, + 0.000235839115596880717416, + }; + static const double q[] = { + 1, + 1.53991494948552447182, + 0.982403709157920235114, + 0.325732924782444448493, + 0.0563921837420478160373, + 0.00410369723978904575884, + }; + result = y + ff_eval_poly(p, FF_ARRAY_ELEMS(p), z - 1.5) / ff_eval_poly(q, FF_ARRAY_ELEMS(q), z - 1.5); + result *= exp(-z * z) / z; + return 1 - result; + } + else if (z < 4.5) { + // Maximum Deviation Found: 1.512e-17 + // Expected Error Term: 1.512e-17 + // Maximum Relative Change in Control Points: 2.222e-04 + // Max Error found at double precision = 2.062515e-17 + static const double y = 0.5405750274658203125; + static const double p[] = { + 0.00295276716530971662634, + 0.0137384425896355332126, + 0.00840807615555585383007, + 0.00212825620914618649141, + 0.000250269961544794627958, + 0.113212406648847561139e-4, + }; + static const double q[] = { + 1, + 1.04217814166938418171, + 0.442597659481563127003, + 0.0958492726301061423444, + 0.0105982906484876531489, + 0.000479411269521714493907, + }; + result = y + ff_eval_poly(p, FF_ARRAY_ELEMS(p), z - 3.5) / ff_eval_poly(q, FF_ARRAY_ELEMS(q), z - 3.5); + result *= exp(-z * z) / z; + return 1 - result; + } + /* differ from Boost here, the claim of underflow of erfc(x) past 5.8 is + * slightly incorrect, change to 5.92 + * (really somewhere between 5.9125 and 5.925 is when it saturates) */ + else if (z < 5.92) { + // Max Error found at double precision = 2.997958e-17 + // Maximum Deviation Found: 2.860e-17 + // Expected Error Term: 2.859e-17 + // Maximum Relative Change in Control Points: 1.357e-05 + static const double y = 0.5579090118408203125; + static const double p[] = { + 0.00628057170626964891937, + 0.0175389834052493308818, + -0.212652252872804219852, + -0.687717681153649930619, + -2.5518551727311523996, + -3.22729451764143718517, + -2.8175401114513378771, + }; + static const double q[] = { + 1, + 2.79257750980575282228, + 11.0567237927800161565, + 15.930646027911794143, + 22.9367376522880577224, + 13.5064170191802889145, + 5.48409182238641741584, + }; + result = y + ff_eval_poly(p, FF_ARRAY_ELEMS(p), 1 / z) / ff_eval_poly(q, FF_ARRAY_ELEMS(q), 1 / z); + result *= exp(-z * z) / z; + return 1 - result; + } + /* handle the nan case, but don't use isnan for max portability */ + else if (z != z) + return z; + /* finally return saturated result */ + else + return 1; +} +#endif /* HAVE_ERF */ + +#if !HAVE_EXPF +#undef expf +#define expf(x) ((float)exp(x)) +#endif /* HAVE_EXPF */ + +#if !HAVE_EXP2 +#undef exp2 +#define exp2(x) exp((x) * M_LN2) +#endif /* HAVE_EXP2 */ + +#if !HAVE_EXP2F +#undef exp2f +#define exp2f(x) ((float)exp2(x)) +#endif /* HAVE_EXP2F */ + +#if !HAVE_ISINF +#undef isinf +/* Note: these do not follow the BSD/Apple/GNU convention of returning -1 for +-Inf, +1 for Inf, 0 otherwise, but merely follow the POSIX/ISO mandated spec of +returning a non-zero value for +/-Inf, 0 otherwise. */ +static av_always_inline av_const int avpriv_isinff(float x) +{ + uint32_t v = av_float2int(x); + if ((v & 0x7f800000) != 0x7f800000) + return 0; + return !(v & 0x007fffff); +} + +static av_always_inline av_const int avpriv_isinf(double x) +{ + uint64_t v = av_double2int(x); + if ((v & 0x7ff0000000000000) != 0x7ff0000000000000) + return 0; + return !(v & 0x000fffffffffffff); +} + +#define isinf(x) \ + (sizeof(x) == sizeof(float) \ + ? avpriv_isinff(x) \ + : avpriv_isinf(x)) +#endif /* HAVE_ISINF */ + +#if !HAVE_ISNAN +static av_always_inline av_const int avpriv_isnanf(float x) +{ + uint32_t v = av_float2int(x); + if ((v & 0x7f800000) != 0x7f800000) + return 0; + return v & 0x007fffff; +} + +static av_always_inline av_const int avpriv_isnan(double x) +{ + uint64_t v = av_double2int(x); + if ((v & 0x7ff0000000000000) != 0x7ff0000000000000) + return 0; + return (v & 0x000fffffffffffff) && 1; +} + +#define isnan(x) \ + (sizeof(x) == sizeof(float) \ + ? avpriv_isnanf(x) \ + : avpriv_isnan(x)) +#endif /* HAVE_ISNAN */ + +#if !HAVE_ISFINITE +static av_always_inline av_const int avpriv_isfinitef(float x) +{ + uint32_t v = av_float2int(x); + return (v & 0x7f800000) != 0x7f800000; +} + +static av_always_inline av_const int avpriv_isfinite(double x) +{ + uint64_t v = av_double2int(x); + return (v & 0x7ff0000000000000) != 0x7ff0000000000000; +} + +#define isfinite(x) \ + (sizeof(x) == sizeof(float) \ + ? avpriv_isfinitef(x) \ + : avpriv_isfinite(x)) +#endif /* HAVE_ISFINITE */ + +#if !HAVE_HYPOT +static inline av_const double hypot(double x, double y) +{ + double ret, temp; + x = fabs(x); + y = fabs(y); + + if (isinf(x) || isinf(y)) + return av_int2double(0x7ff0000000000000); + if (x == 0 || y == 0) + return x + y; + if (x < y) { + temp = x; + x = y; + y = temp; + } + + y = y/x; + return x*sqrt(1 + y*y); +} +#endif /* HAVE_HYPOT */ + +#if !HAVE_LDEXPF +#undef ldexpf +#define ldexpf(x, exp) ((float)ldexp(x, exp)) +#endif /* HAVE_LDEXPF */ + +#if !HAVE_LLRINT +#undef llrint +#define llrint(x) ((long long)rint(x)) +#endif /* HAVE_LLRINT */ + +#if !HAVE_LLRINTF +#undef llrintf +#define llrintf(x) ((long long)rint(x)) +#endif /* HAVE_LLRINT */ + +#if !HAVE_LOG2 +#undef log2 +#define log2(x) (log(x) * 1.44269504088896340736) +#endif /* HAVE_LOG2 */ + +#if !HAVE_LOG2F +#undef log2f +#define log2f(x) ((float)log2(x)) +#endif /* HAVE_LOG2F */ + +#if !HAVE_LOG10F +#undef log10f +#define log10f(x) ((float)log10(x)) +#endif /* HAVE_LOG10F */ + +#if !HAVE_SINF +#undef sinf +#define sinf(x) ((float)sin(x)) +#endif /* HAVE_SINF */ + +#if !HAVE_RINT +static inline double rint(double x) +{ + return x >= 0 ? floor(x + 0.5) : ceil(x - 0.5); +} +#endif /* HAVE_RINT */ + +#if !HAVE_LRINT +static av_always_inline av_const long int lrint(double x) +{ + return rint(x); +} +#endif /* HAVE_LRINT */ + +#if !HAVE_LRINTF +static av_always_inline av_const long int lrintf(float x) +{ + return (int)(rint(x)); +} +#endif /* HAVE_LRINTF */ + +#if !HAVE_ROUND +static av_always_inline av_const double round(double x) +{ + return (x > 0) ? floor(x + 0.5) : ceil(x - 0.5); +} +#endif /* HAVE_ROUND */ + +#if !HAVE_ROUNDF +static av_always_inline av_const float roundf(float x) +{ + return (x > 0) ? floor(x + 0.5) : ceil(x - 0.5); +} +#endif /* HAVE_ROUNDF */ + +#if !HAVE_TRUNC +static av_always_inline av_const double trunc(double x) +{ + return (x > 0) ? floor(x) : ceil(x); +} +#endif /* HAVE_TRUNC */ + +#if !HAVE_TRUNCF +static av_always_inline av_const float truncf(float x) +{ + return (x > 0) ? floor(x) : ceil(x); +} +#endif /* HAVE_TRUNCF */ + +#endif /* AVUTIL_LIBM_H */ diff --git a/include/libavutil/lls.h b/include/libavutil/lls.h new file mode 100644 index 0000000..7acef4e --- /dev/null +++ b/include/libavutil/lls.h @@ -0,0 +1,64 @@ +/* + * linear least squares model + * + * Copyright (c) 2006 Michael Niedermayer + * + * 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 AVUTIL_LLS_H +#define AVUTIL_LLS_H + +#include "macros.h" +#include "mem_internal.h" + +#define MAX_VARS 32 +#define MAX_VARS_ALIGN FFALIGN(MAX_VARS+1,4) + +//FIXME avoid direct access to LLSModel from outside + +/** + * Linear least squares model. + */ +typedef struct LLSModel { + DECLARE_ALIGNED(32, double, covariance[MAX_VARS_ALIGN][MAX_VARS_ALIGN]); + DECLARE_ALIGNED(32, double, coeff[MAX_VARS][MAX_VARS]); + double variance[MAX_VARS]; + int indep_count; + /** + * Take the outer-product of var[] with itself, and add to the covariance matrix. + * @param m this context + * @param var training samples, starting with the value to be predicted + * 32-byte aligned, and any padding elements must be initialized + * (i.e not denormal/nan). + */ + void (*update_lls)(struct LLSModel *m, const double *var); + /** + * Inner product of var[] and the LPC coefs. + * @param m this context + * @param var training samples, excluding the value to be predicted. unaligned. + * @param order lpc order + */ + double (*evaluate_lls)(struct LLSModel *m, const double *var, int order); +} LLSModel; + +void avpriv_init_lls(LLSModel *m, int indep_count); +void ff_init_lls_riscv(LLSModel *m); +void ff_init_lls_x86(LLSModel *m); +void avpriv_solve_lls(LLSModel *m, double threshold, unsigned short min_order); + +#endif /* AVUTIL_LLS_H */ diff --git a/include/libavutil/macos_kperf.h b/include/libavutil/macos_kperf.h new file mode 100644 index 0000000..d039691 --- /dev/null +++ b/include/libavutil/macos_kperf.h @@ -0,0 +1,27 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 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 General Public License for more details. + * + * You should have received a copy of the GNU 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 AVUTIL_MACOS_KPERF_H +#define AVUTIL_MACOS_KPERF_H + +#include + +void ff_kperf_init(void); +uint64_t ff_kperf_cycles(void); + +#endif /* AVUTIL_MACOS_KPERF_H */ diff --git a/include/libavutil/mastering_display_metadata.h b/include/libavutil/mastering_display_metadata.h index c23b07c..52fcef9 100755 --- a/include/libavutil/mastering_display_metadata.h +++ b/include/libavutil/mastering_display_metadata.h @@ -77,6 +77,15 @@ typedef struct AVMasteringDisplayMetadata { */ AVMasteringDisplayMetadata *av_mastering_display_metadata_alloc(void); +/** + * Allocate an AVMasteringDisplayMetadata structure and set its fields to + * default values. The resulting struct can be freed using av_freep(). + * + * @return An AVMasteringDisplayMetadata filled with default values or NULL + * on failure. + */ +AVMasteringDisplayMetadata *av_mastering_display_metadata_alloc_size(size_t *size); + /** * Allocate a complete AVMasteringDisplayMetadata and add it to the frame. * diff --git a/include/libavutil/mathematics.h b/include/libavutil/mathematics.h index 64d4137..e213bab 100755 --- a/include/libavutil/mathematics.h +++ b/include/libavutil/mathematics.h @@ -36,30 +36,81 @@ #ifndef M_E #define M_E 2.7182818284590452354 /* e */ #endif +#ifndef M_Ef +#define M_Ef 2.7182818284590452354f /* e */ +#endif #ifndef M_LN2 #define M_LN2 0.69314718055994530942 /* log_e 2 */ #endif +#ifndef M_LN2f +#define M_LN2f 0.69314718055994530942f /* log_e 2 */ +#endif #ifndef M_LN10 #define M_LN10 2.30258509299404568402 /* log_e 10 */ #endif +#ifndef M_LN10f +#define M_LN10f 2.30258509299404568402f /* log_e 10 */ +#endif #ifndef M_LOG2_10 #define M_LOG2_10 3.32192809488736234787 /* log_2 10 */ #endif +#ifndef M_LOG2_10f +#define M_LOG2_10f 3.32192809488736234787f /* log_2 10 */ +#endif #ifndef M_PHI #define M_PHI 1.61803398874989484820 /* phi / golden ratio */ #endif +#ifndef M_PHIf +#define M_PHIf 1.61803398874989484820f /* phi / golden ratio */ +#endif #ifndef M_PI #define M_PI 3.14159265358979323846 /* pi */ #endif +#ifndef M_PIf +#define M_PIf 3.14159265358979323846f /* pi */ +#endif #ifndef M_PI_2 #define M_PI_2 1.57079632679489661923 /* pi/2 */ #endif +#ifndef M_PI_2f +#define M_PI_2f 1.57079632679489661923f /* pi/2 */ +#endif +#ifndef M_PI_4 +#define M_PI_4 0.78539816339744830962 /* pi/4 */ +#endif +#ifndef M_PI_4f +#define M_PI_4f 0.78539816339744830962f /* pi/4 */ +#endif +#ifndef M_1_PI +#define M_1_PI 0.31830988618379067154 /* 1/pi */ +#endif +#ifndef M_1_PIf +#define M_1_PIf 0.31830988618379067154f /* 1/pi */ +#endif +#ifndef M_2_PI +#define M_2_PI 0.63661977236758134308 /* 2/pi */ +#endif +#ifndef M_2_PIf +#define M_2_PIf 0.63661977236758134308f /* 2/pi */ +#endif +#ifndef M_2_SQRTPI +#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */ +#endif +#ifndef M_2_SQRTPIf +#define M_2_SQRTPIf 1.12837916709551257390f /* 2/sqrt(pi) */ +#endif #ifndef M_SQRT1_2 #define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ #endif +#ifndef M_SQRT1_2f +#define M_SQRT1_2f 0.70710678118654752440f /* 1/sqrt(2) */ +#endif #ifndef M_SQRT2 #define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ #endif +#ifndef M_SQRT2f +#define M_SQRT2f 1.41421356237309504880f /* sqrt(2) */ +#endif #ifndef NAN #define NAN av_int2float(0x7fc00000) #endif @@ -111,7 +162,8 @@ enum AVRounding { /** * Compute the greatest common divisor of two integer operands. * - * @param a,b Operands + * @param a Operand + * @param b Operand * @return GCD of a and b up to sign; if a >= 0 and b >= 0, return value is >= 0; * if a == 0 and b == 0, returns 0. */ @@ -186,7 +238,8 @@ int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b); * av_compare_mod(0x11, 0x02, 0x20) > 0 // since 0x11 % 0x20 (0x11) > 0x02 % 0x20 (0x02) * @endcode * - * @param a,b Operands + * @param a Operand + * @param b Operand * @param mod Divisor; must be a power of 2 * @return * - a negative value if `a % mod < b % mod` @@ -235,6 +288,10 @@ int64_t av_rescale_delta(AVRational in_tb, int64_t in_ts, AVRational fs_tb, int */ int64_t av_add_stable(AVRational ts_tb, int64_t ts, AVRational inc_tb, int64_t inc); +/** + * 0th order modified bessel function of the first kind. + */ +double av_bessel_i0(double x); /** * @} diff --git a/include/libavutil/mem.h b/include/libavutil/mem.h index d911741..ab7648a 100755 --- a/include/libavutil/mem.h +++ b/include/libavutil/mem.h @@ -27,12 +27,10 @@ #ifndef AVUTIL_MEM_H #define AVUTIL_MEM_H -#include +#include #include #include "attributes.h" -#include "avutil.h" -#include "version.h" /** * @addtogroup lavu_mem @@ -51,86 +49,6 @@ * @{ */ -#if FF_API_DECLARE_ALIGNED -/** - * - * @defgroup lavu_mem_macros Alignment Macros - * Helper macros for declaring aligned variables. - * @{ - */ - -/** - * @def DECLARE_ALIGNED(n,t,v) - * Declare a variable that is aligned in memory. - * - * @code{.c} - * DECLARE_ALIGNED(16, uint16_t, aligned_int) = 42; - * DECLARE_ALIGNED(32, uint8_t, aligned_array)[128]; - * - * // The default-alignment equivalent would be - * uint16_t aligned_int = 42; - * uint8_t aligned_array[128]; - * @endcode - * - * @param n Minimum alignment in bytes - * @param t Type of the variable (or array element) - * @param v Name of the variable - */ - -/** - * @def DECLARE_ASM_ALIGNED(n,t,v) - * Declare an aligned variable appropriate for use in inline assembly code. - * - * @code{.c} - * DECLARE_ASM_ALIGNED(16, uint64_t, pw_08) = UINT64_C(0x0008000800080008); - * @endcode - * - * @param n Minimum alignment in bytes - * @param t Type of the variable (or array element) - * @param v Name of the variable - */ - -/** - * @def DECLARE_ASM_CONST(n,t,v) - * Declare a static constant aligned variable appropriate for use in inline - * assembly code. - * - * @code{.c} - * DECLARE_ASM_CONST(16, uint64_t, pw_08) = UINT64_C(0x0008000800080008); - * @endcode - * - * @param n Minimum alignment in bytes - * @param t Type of the variable (or array element) - * @param v Name of the variable - */ - -#if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || defined(__SUNPRO_C) - #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v - #define DECLARE_ASM_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v - #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v -#elif defined(__DJGPP__) - #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (FFMIN(n, 16)))) v - #define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v - #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v -#elif defined(__GNUC__) || defined(__clang__) - #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v - #define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (n))) v - #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v -#elif defined(_MSC_VER) - #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v - #define DECLARE_ASM_ALIGNED(n,t,v) __declspec(align(n)) t v - #define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v -#else - #define DECLARE_ALIGNED(n,t,v) t v - #define DECLARE_ASM_ALIGNED(n,t,v) t v - #define DECLARE_ASM_CONST(n,t,v) static const t v -#endif - -/** - * @} - */ -#endif - /** * @defgroup lavu_mem_attrs Function Attributes * Function attributes applicable to memory handling functions. @@ -239,14 +157,6 @@ av_alloc_size(1, 2) void *av_malloc_array(size_t nmemb, size_t size); */ void *av_calloc(size_t nmemb, size_t size) av_malloc_attrib av_alloc_size(1, 2); -#if FF_API_AV_MALLOCZ_ARRAY -/** - * @deprecated use av_calloc() - */ -attribute_deprecated -void *av_mallocz_array(size_t nmemb, size_t size) av_malloc_attrib av_alloc_size(1, 2); -#endif - /** * Allocate, reallocate, or free a block of memory. * @@ -667,7 +577,8 @@ void *av_dynarray2_add(void **tab_ptr, int *nb_ptr, size_t elem_size, /** * Multiply two `size_t` values checking for overflow. * - * @param[in] a,b Operands of multiplication + * @param[in] a Operand of multiplication + * @param[in] b Operand of multiplication * @param[out] r Pointer to the result of the operation * @return 0 on success, AVERROR(EINVAL) on overflow */ diff --git a/include/libavutil/mem_internal.h b/include/libavutil/mem_internal.h new file mode 100644 index 0000000..20f9b3e --- /dev/null +++ b/include/libavutil/mem_internal.h @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2002 Fabrice Bellard + * + * 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 AVUTIL_MEM_INTERNAL_H +#define AVUTIL_MEM_INTERNAL_H + +#include "config.h" + +#include + +#include "attributes.h" +#include "macros.h" + +/** + * @def DECLARE_ALIGNED(n,t,v) + * Declare a variable that is aligned in memory. + * + * @code{.c} + * DECLARE_ALIGNED(16, uint16_t, aligned_int) = 42; + * DECLARE_ALIGNED(32, uint8_t, aligned_array)[128]; + * + * // The default-alignment equivalent would be + * uint16_t aligned_int = 42; + * uint8_t aligned_array[128]; + * @endcode + * + * @param n Minimum alignment in bytes + * @param t Type of the variable (or array element) + * @param v Name of the variable + */ + +/** + * @def DECLARE_ASM_ALIGNED(n,t,v) + * Declare an aligned variable appropriate for use in inline assembly code. + * + * @code{.c} + * DECLARE_ASM_ALIGNED(16, uint64_t, pw_08) = UINT64_C(0x0008000800080008); + * @endcode + * + * @param n Minimum alignment in bytes + * @param t Type of the variable (or array element) + * @param v Name of the variable + */ + +/** + * @def DECLARE_ASM_CONST(n,t,v) + * Declare a static constant aligned variable appropriate for use in inline + * assembly code. + * + * @code{.c} + * DECLARE_ASM_CONST(16, uint64_t, pw_08) = UINT64_C(0x0008000800080008); + * @endcode + * + * @param n Minimum alignment in bytes + * @param t Type of the variable (or array element) + * @param v Name of the variable + */ + +#if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || defined(__SUNPRO_C) + #define DECLARE_ALIGNED_T(n,t,v) t __attribute__ ((aligned (n))) v + #define DECLARE_ASM_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v + #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v +#elif defined(__DJGPP__) + #define DECLARE_ALIGNED_T(n,t,v) t __attribute__ ((aligned (FFMIN(n, 16)))) v + #define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v + #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (FFMIN(n, 16)))) v +#elif defined(__GNUC__) || defined(__clang__) + #define DECLARE_ALIGNED_T(n,t,v) t __attribute__ ((aligned (n))) v + #define DECLARE_ASM_ALIGNED(n,t,v) t av_used __attribute__ ((aligned (n))) v + #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v +#elif defined(_MSC_VER) + #define DECLARE_ALIGNED_T(n,t,v) __declspec(align(n)) t v + #define DECLARE_ASM_ALIGNED(n,t,v) __declspec(align(n)) t v + #define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v +#else + #define DECLARE_ALIGNED_T(n,t,v) t v + #define DECLARE_ASM_ALIGNED(n,t,v) t v + #define DECLARE_ASM_CONST(n,t,v) static const t v +#endif + +#if HAVE_SIMD_ALIGN_64 + #define ALIGN_64 64 + #define ALIGN_32 32 +#elif HAVE_SIMD_ALIGN_32 + #define ALIGN_64 32 + #define ALIGN_32 32 +#else + #define ALIGN_64 16 + #define ALIGN_32 16 +#endif + +#define DECLARE_ALIGNED(n,t,v) DECLARE_ALIGNED_V(n,t,v) + +// Macro needs to be double-wrapped in order to expand +// possible other macros being passed for n. +#define DECLARE_ALIGNED_V(n,t,v) DECLARE_ALIGNED_##n(t,v) + +#define DECLARE_ALIGNED_4(t,v) DECLARE_ALIGNED_T( 4, t, v) +#define DECLARE_ALIGNED_8(t,v) DECLARE_ALIGNED_T( 8, t, v) +#define DECLARE_ALIGNED_16(t,v) DECLARE_ALIGNED_T( 16, t, v) +#define DECLARE_ALIGNED_32(t,v) DECLARE_ALIGNED_T(ALIGN_32, t, v) +#define DECLARE_ALIGNED_64(t,v) DECLARE_ALIGNED_T(ALIGN_64, t, v) + +// Some broken preprocessors need a second expansion +// to be forced to tokenize __VA_ARGS__ +#define E1(x) x + +#define LOCAL_ALIGNED_A(a, t, v, s, o, ...) \ + uint8_t la_##v[sizeof(t s o) + (a)]; \ + t (*v) o = (void *)FFALIGN((uintptr_t)la_##v, a) + +#define LOCAL_ALIGNED_D(a, t, v, s, o, ...) \ + DECLARE_ALIGNED(a, t, la_##v) s o; \ + t (*v) o = la_##v + +#define LOCAL_ALIGNED(a, t, v, ...) LOCAL_ALIGNED_##a(t, v, __VA_ARGS__) + +#if HAVE_LOCAL_ALIGNED +# define LOCAL_ALIGNED_4(t, v, ...) E1(LOCAL_ALIGNED_D(4, t, v, __VA_ARGS__,,)) +#else +# define LOCAL_ALIGNED_4(t, v, ...) E1(LOCAL_ALIGNED_A(4, t, v, __VA_ARGS__,,)) +#endif + +#if HAVE_LOCAL_ALIGNED +# define LOCAL_ALIGNED_8(t, v, ...) E1(LOCAL_ALIGNED_D(8, t, v, __VA_ARGS__,,)) +#else +# define LOCAL_ALIGNED_8(t, v, ...) E1(LOCAL_ALIGNED_A(8, t, v, __VA_ARGS__,,)) +#endif + +#if HAVE_LOCAL_ALIGNED +# define LOCAL_ALIGNED_16(t, v, ...) E1(LOCAL_ALIGNED_D(16, t, v, __VA_ARGS__,,)) +#else +# define LOCAL_ALIGNED_16(t, v, ...) E1(LOCAL_ALIGNED_A(16, t, v, __VA_ARGS__,,)) +#endif + +#if HAVE_LOCAL_ALIGNED +# define LOCAL_ALIGNED_32(t, v, ...) E1(LOCAL_ALIGNED_D(32, t, v, __VA_ARGS__,,)) +#else +# define LOCAL_ALIGNED_32(t, v, ...) E1(LOCAL_ALIGNED_A(32, t, v, __VA_ARGS__,,)) +#endif + +#endif /* AVUTIL_MEM_INTERNAL_H */ diff --git a/include/libavutil/objc.h b/include/libavutil/objc.h new file mode 100644 index 0000000..0db993f --- /dev/null +++ b/include/libavutil/objc.h @@ -0,0 +1,32 @@ +/* + * 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 AVUTIL_OBJC_H +#define AVUTIL_OBJC_H + +#include + +static inline void ff_objc_release(NSObject **obj) +{ + if (*obj) { + [*obj release]; + *obj = nil; + } +} + +#endif /* AVUTIL_OBJC_H */ diff --git a/include/libavutil/opt.h b/include/libavutil/opt.h index 461b5d3..be189f7 100755 --- a/include/libavutil/opt.h +++ b/include/libavutil/opt.h @@ -43,6 +43,26 @@ * ("objects"). An option can have a help text, a type and a range of possible * values. Options may then be enumerated, read and written to. * + * There are two modes of access to members of AVOption and its child structs. + * One is called 'native access', and refers to access from the code that + * declares the AVOption in question. The other is 'foreign access', and refers + * to access from other code. + * + * Certain struct members in this header are documented as 'native access only' + * or similar - it means that only the code that declared the AVOption in + * question is allowed to access the field. This allows us to extend the + * semantics of those fields without breaking API compatibility. + * + * @section avoptions_scope Scope of AVOptions + * + * AVOptions is designed to support any set of multimedia configuration options + * that can be defined at compile-time. Although it is mainly used to expose + * FFmpeg options, you are welcome to adapt it to your own use case. + * + * No single approach can ever fully solve the problem of configuration, + * but please submit a patch if you believe you have found a problem + * that is best solved by extending AVOptions. + * * @section avoptions_implement Implementing AVOptions * This section describes how to add AVOptions capabilities to a struct. * @@ -220,31 +240,189 @@ * before the file is actually opened. */ +/** + * An option type determines: + * - for native access, the underlying C type of the field that an AVOption + * refers to; + * - for foreign access, the semantics of accessing the option through this API, + * e.g. which av_opt_get_*() and av_opt_set_*() functions can be called, or + * what format will av_opt_get()/av_opt_set() expect/produce. + */ enum AVOptionType{ - AV_OPT_TYPE_FLAGS, + /** + * Underlying C type is unsigned int. + */ + AV_OPT_TYPE_FLAGS = 1, + /** + * Underlying C type is int. + */ AV_OPT_TYPE_INT, + /** + * Underlying C type is int64_t. + */ AV_OPT_TYPE_INT64, + /** + * Underlying C type is double. + */ AV_OPT_TYPE_DOUBLE, + /** + * Underlying C type is float. + */ AV_OPT_TYPE_FLOAT, + /** + * Underlying C type is a uint8_t* that is either NULL or points to a C + * string allocated with the av_malloc() family of functions. + */ AV_OPT_TYPE_STRING, + /** + * Underlying C type is AVRational. + */ AV_OPT_TYPE_RATIONAL, - AV_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length + /** + * Underlying C type is a uint8_t* that is either NULL or points to an array + * allocated with the av_malloc() family of functions. The pointer is + * immediately followed by an int containing the array length in bytes. + */ + AV_OPT_TYPE_BINARY, + /** + * Underlying C type is AVDictionary*. + */ AV_OPT_TYPE_DICT, + /** + * Underlying C type is uint64_t. + */ AV_OPT_TYPE_UINT64, + /** + * Special option type for declaring named constants. Does not correspond to + * an actual field in the object, offset must be 0. + */ AV_OPT_TYPE_CONST, - AV_OPT_TYPE_IMAGE_SIZE, ///< offset must point to two consecutive integers + /** + * Underlying C type is two consecutive integers. + */ + AV_OPT_TYPE_IMAGE_SIZE, + /** + * Underlying C type is enum AVPixelFormat. + */ AV_OPT_TYPE_PIXEL_FMT, + /** + * Underlying C type is enum AVSampleFormat. + */ AV_OPT_TYPE_SAMPLE_FMT, - AV_OPT_TYPE_VIDEO_RATE, ///< offset must point to AVRational + /** + * Underlying C type is AVRational. + */ + AV_OPT_TYPE_VIDEO_RATE, + /** + * Underlying C type is int64_t. + */ AV_OPT_TYPE_DURATION, + /** + * Underlying C type is uint8_t[4]. + */ AV_OPT_TYPE_COLOR, -#if FF_API_OLD_CHANNEL_LAYOUT - AV_OPT_TYPE_CHANNEL_LAYOUT, -#endif + /** + * Underlying C type is int. + */ AV_OPT_TYPE_BOOL, + /** + * Underlying C type is AVChannelLayout. + */ AV_OPT_TYPE_CHLAYOUT, + /** + * Underlying C type is unsigned int. + */ + AV_OPT_TYPE_UINT, + + /** + * May be combined with another regular option type to declare an array + * option. + * + * For array options, @ref AVOption.offset should refer to a pointer + * corresponding to the option type. The pointer should be immediately + * followed by an unsigned int that will store the number of elements in the + * array. + */ + AV_OPT_TYPE_FLAG_ARRAY = (1 << 16), }; +/** + * A generic parameter which can be set by the user for muxing or encoding. + */ +#define AV_OPT_FLAG_ENCODING_PARAM (1 << 0) +/** + * A generic parameter which can be set by the user for demuxing or decoding. + */ +#define AV_OPT_FLAG_DECODING_PARAM (1 << 1) +#define AV_OPT_FLAG_AUDIO_PARAM (1 << 3) +#define AV_OPT_FLAG_VIDEO_PARAM (1 << 4) +#define AV_OPT_FLAG_SUBTITLE_PARAM (1 << 5) +/** + * The option is intended for exporting values to the caller. + */ +#define AV_OPT_FLAG_EXPORT (1 << 6) +/** + * The option may not be set through the AVOptions API, only read. + * This flag only makes sense when AV_OPT_FLAG_EXPORT is also set. + */ +#define AV_OPT_FLAG_READONLY (1 << 7) +/** + * A generic parameter which can be set by the user for bit stream filtering. + */ +#define AV_OPT_FLAG_BSF_PARAM (1 << 8) + +/** + * A generic parameter which can be set by the user at runtime. + */ +#define AV_OPT_FLAG_RUNTIME_PARAM (1 << 15) +/** + * A generic parameter which can be set by the user for filtering. + */ +#define AV_OPT_FLAG_FILTERING_PARAM (1 << 16) +/** + * Set if option is deprecated, users should refer to AVOption.help text for + * more information. + */ +#define AV_OPT_FLAG_DEPRECATED (1 << 17) +/** + * Set if option constants can also reside in child objects. + */ +#define AV_OPT_FLAG_CHILD_CONSTS (1 << 18) + +/** + * May be set as default_val for AV_OPT_TYPE_FLAG_ARRAY options. + */ +typedef struct AVOptionArrayDef { + /** + * Native access only. + * + * Default value of the option, as would be serialized by av_opt_get() (i.e. + * using the value of sep as the separator). + */ + const char *def; + + /** + * Minimum number of elements in the array. When this field is non-zero, def + * must be non-NULL and contain at least this number of elements. + */ + unsigned size_min; + /** + * Maximum number of elements in the array, 0 when unlimited. + */ + unsigned size_max; + + /** + * Separator between array elements in string representations of this + * option, used by av_opt_set() and av_opt_get(). It must be a printable + * ASCII character, excluding alphanumeric and the backslash. A comma is + * used when sep=0. + * + * The separator and the backslash must be backslash-escaped in order to + * appear in string representations of the option value. + */ + char sep; +} AVOptionArrayDef; + /** * AVOption */ @@ -258,6 +436,8 @@ typedef struct AVOption { const char *help; /** + * Native access only. + * * The offset relative to the context structure where the option * value is stored. It should be 0 for named constants. */ @@ -265,6 +445,7 @@ typedef struct AVOption { enum AVOptionType type; /** + * Native access only, except when documented otherwise. * the default value for scalar options */ union { @@ -273,31 +454,22 @@ typedef struct AVOption { const char *str; /* TODO those are unused now */ AVRational q; + + /** + * Used for AV_OPT_TYPE_FLAG_ARRAY options. May be NULL. + * + * Foreign access to some members allowed, as noted in AVOptionArrayDef + * documentation. + */ + const AVOptionArrayDef *arr; } default_val; double min; ///< minimum valid value for the option double max; ///< maximum valid value for the option + /** + * A combination of AV_OPT_FLAG_*. + */ int flags; -#define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding -#define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding -#define AV_OPT_FLAG_AUDIO_PARAM 8 -#define AV_OPT_FLAG_VIDEO_PARAM 16 -#define AV_OPT_FLAG_SUBTITLE_PARAM 32 -/** - * The option is intended for exporting values to the caller. - */ -#define AV_OPT_FLAG_EXPORT 64 -/** - * The option may not be set through the AVOptions API, only read. - * This flag only makes sense when AV_OPT_FLAG_EXPORT is also set. - */ -#define AV_OPT_FLAG_READONLY 128 -#define AV_OPT_FLAG_BSF_PARAM (1<<8) ///< a generic parameter which can be set by the user for bit stream filtering -#define AV_OPT_FLAG_RUNTIME_PARAM (1<<15) ///< a generic parameter which can be set by the user at runtime -#define AV_OPT_FLAG_FILTERING_PARAM (1<<16) ///< a generic parameter which can be set by the user for filtering -#define AV_OPT_FLAG_DEPRECATED (1<<17) ///< set if option is deprecated, users should refer to AVOption.help text for more information -#define AV_OPT_FLAG_CHILD_CONSTS (1<<18) ///< set if option constants can also reside in child objects -//FIXME think about enc-audio, ... style flags /** * The logical unit to which the option belongs. Non-constant @@ -376,15 +548,9 @@ typedef struct AVOptionRanges { } AVOptionRanges; /** - * Show the obj options. - * - * @param req_flags requested flags for the options to show. Show only the - * options for which it is opt->flags & req_flags. - * @param rej_flags rejected flags for the options to show. Show only the - * options for which it is !(opt->flags & req_flags). - * @param av_log_obj log context to use for showing the options + * @defgroup opt_mng AVOption (un)initialization and inspection. + * @{ */ -int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags); /** * Set the values of all AVOption fields to their default values. @@ -404,161 +570,37 @@ void av_opt_set_defaults(void *s); */ void av_opt_set_defaults2(void *s, int mask, int flags); -/** - * Parse the key/value pairs list in opts. For each key/value pair - * found, stores the value in the field in ctx that is named like the - * key. ctx must be an AVClass context, storing is done using - * AVOptions. - * - * @param opts options string to parse, may be NULL - * @param key_val_sep a 0-terminated list of characters used to - * separate key from value - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other - * @return the number of successfully set key/value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_opt_set() if a key/value pair - * cannot be set - */ -int av_set_options_string(void *ctx, const char *opts, - const char *key_val_sep, const char *pairs_sep); - -/** - * Parse the key-value pairs list in opts. For each key=value pair found, - * set the value of the corresponding option in ctx. - * - * @param ctx the AVClass object to set options on - * @param opts the options string, key-value pairs separated by a - * delimiter - * @param shorthand a NULL-terminated array of options names for shorthand - * notation: if the first field in opts has no key part, - * the key is taken from the first element of shorthand; - * then again for the second, etc., until either opts is - * finished, shorthand is finished or a named option is - * found; after that, all options must be named - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @return the number of successfully set key=value pairs, or a negative - * value corresponding to an AVERROR code in case of error: - * AVERROR(EINVAL) if opts cannot be parsed, - * the error code issued by av_set_string3() if a key/value pair - * cannot be set - * - * Options names must use only the following characters: a-z A-Z 0-9 - . / _ - * Separators must use characters distinct from option names and from each - * other. - */ -int av_opt_set_from_string(void *ctx, const char *opts, - const char *const *shorthand, - const char *key_val_sep, const char *pairs_sep); /** * Free all allocated objects in obj. */ void av_opt_free(void *obj); /** - * Check whether a particular flag is set in a flags field. + * Iterate over all AVOptions belonging to obj. * - * @param field_name the name of the flag field option - * @param flag_name the name of the flag to check - * @return non-zero if the flag is set, zero if the flag isn't set, - * isn't of the right type, or the flags field doesn't exist. + * @param obj an AVOptions-enabled struct or a double pointer to an + * AVClass describing it. + * @param prev result of the previous call to av_opt_next() on this object + * or NULL + * @return next AVOption or NULL */ -int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name); +const AVOption *av_opt_next(const void *obj, const AVOption *prev); /** - * Set all the options from a given dictionary on an object. + * Iterate over AVOptions-enabled children of obj. * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() + * @param prev result of a previous call to this function or NULL + * @return next AVOptions-enabled child or NULL */ -int av_opt_set_dict(void *obj, struct AVDictionary **options); - +void *av_opt_child_next(void *obj, void *prev); /** - * Set all the options from a given dictionary on an object. + * Iterate over potential AVOptions-enabled children of parent. * - * @param obj a struct whose first element is a pointer to AVClass - * @param options options to process. This dictionary will be freed and replaced - * by a new one containing all options not found in obj. - * Of course this new dictionary needs to be freed by caller - * with av_dict_free(). - * @param search_flags A combination of AV_OPT_SEARCH_*. - * - * @return 0 on success, a negative AVERROR if some option was found in obj, - * but could not be set. - * - * @see av_dict_copy() - */ -int av_opt_set_dict2(void *obj, struct AVDictionary **options, int search_flags); - -/** - * Extract a key-value pair from the beginning of a string. - * - * @param ropts pointer to the options string, will be updated to - * point to the rest of the string (one of the pairs_sep - * or the final NUL) - * @param key_val_sep a 0-terminated list of characters used to separate - * key from value, for example '=' - * @param pairs_sep a 0-terminated list of characters used to separate - * two pairs from each other, for example ':' or ',' - * @param flags flags; see the AV_OPT_FLAG_* values below - * @param rkey parsed key; must be freed using av_free() - * @param rval parsed value; must be freed using av_free() - * - * @return >=0 for success, or a negative value corresponding to an - * AVERROR code in case of error; in particular: - * AVERROR(EINVAL) if no key is present - * - */ -int av_opt_get_key_value(const char **ropts, - const char *key_val_sep, const char *pairs_sep, - unsigned flags, - char **rkey, char **rval); - -enum { - - /** - * Accept to parse a value without a key; the key will then be returned - * as NULL. - */ - AV_OPT_FLAG_IMPLICIT_KEY = 1, -}; - -/** - * @defgroup opt_eval_funcs Evaluating option strings - * @{ - * This group of functions can be used to evaluate option strings - * and get numbers out of them. They do the same thing as av_opt_set(), - * except the result is written into the caller-supplied pointer. - * - * @param obj a struct whose first element is a pointer to AVClass. - * @param o an option for which the string is to be evaluated. - * @param val string to be evaluated. - * @param *_out value of the string will be written here. - * - * @return 0 on success, a negative number on failure. - */ -int av_opt_eval_flags (void *obj, const AVOption *o, const char *val, int *flags_out); -int av_opt_eval_int (void *obj, const AVOption *o, const char *val, int *int_out); -int av_opt_eval_int64 (void *obj, const AVOption *o, const char *val, int64_t *int64_out); -int av_opt_eval_float (void *obj, const AVOption *o, const char *val, float *float_out); -int av_opt_eval_double(void *obj, const AVOption *o, const char *val, double *double_out); -int av_opt_eval_q (void *obj, const AVOption *o, const char *val, AVRational *q_out); -/** - * @} + * @param iter a pointer where iteration state is stored. + * @return AVClass corresponding to next potential child or NULL */ +const AVClass *av_opt_child_class_iterate(const AVClass *parent, void **iter); #define AV_OPT_SEARCH_CHILDREN (1 << 0) /**< Search in possible children of the given object first. */ @@ -576,6 +618,12 @@ int av_opt_eval_q (void *obj, const AVOption *o, const char *val, AVRational */ #define AV_OPT_ALLOW_NULL (1 << 2) +/** + * May be used with av_opt_set_array() to signal that new elements should + * replace the existing ones in the indicated range. + */ +#define AV_OPT_ARRAY_REPLACE (1 << 3) + /** * Allows av_opt_query_ranges and av_opt_query_ranges_default to return more than * one component for certain option types. @@ -633,31 +681,161 @@ const AVOption *av_opt_find2(void *obj, const char *name, const char *unit, int opt_flags, int search_flags, void **target_obj); /** - * Iterate over all AVOptions belonging to obj. + * Show the obj options. * - * @param obj an AVOptions-enabled struct or a double pointer to an - * AVClass describing it. - * @param prev result of the previous call to av_opt_next() on this object - * or NULL - * @return next AVOption or NULL + * @param req_flags requested flags for the options to show. Show only the + * options for which it is opt->flags & req_flags. + * @param rej_flags rejected flags for the options to show. Show only the + * options for which it is !(opt->flags & req_flags). + * @param av_log_obj log context to use for showing the options */ -const AVOption *av_opt_next(const void *obj, const AVOption *prev); +int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags); /** - * Iterate over AVOptions-enabled children of obj. + * Extract a key-value pair from the beginning of a string. + * + * @param ropts pointer to the options string, will be updated to + * point to the rest of the string (one of the pairs_sep + * or the final NUL) + * @param key_val_sep a 0-terminated list of characters used to separate + * key from value, for example '=' + * @param pairs_sep a 0-terminated list of characters used to separate + * two pairs from each other, for example ':' or ',' + * @param flags flags; see the AV_OPT_FLAG_* values below + * @param rkey parsed key; must be freed using av_free() + * @param rval parsed value; must be freed using av_free() + * + * @return >=0 for success, or a negative value corresponding to an + * AVERROR code in case of error; in particular: + * AVERROR(EINVAL) if no key is present * - * @param prev result of a previous call to this function or NULL - * @return next AVOptions-enabled child or NULL */ -void *av_opt_child_next(void *obj, void *prev); +int av_opt_get_key_value(const char **ropts, + const char *key_val_sep, const char *pairs_sep, + unsigned flags, + char **rkey, char **rval); + +enum { + + /** + * Accept to parse a value without a key; the key will then be returned + * as NULL. + */ + AV_OPT_FLAG_IMPLICIT_KEY = 1, +}; /** - * Iterate over potential AVOptions-enabled children of parent. - * - * @param iter a pointer where iteration state is stored. - * @return AVClass corresponding to next potential child or NULL + * @} */ -const AVClass *av_opt_child_class_iterate(const AVClass *parent, void **iter); + +/** + * @defgroup opt_write Setting and modifying option values + * @{ + */ + +/** + * Parse the key/value pairs list in opts. For each key/value pair + * found, stores the value in the field in ctx that is named like the + * key. ctx must be an AVClass context, storing is done using + * AVOptions. + * + * @param opts options string to parse, may be NULL + * @param key_val_sep a 0-terminated list of characters used to + * separate key from value + * @param pairs_sep a 0-terminated list of characters used to separate + * two pairs from each other + * @return the number of successfully set key/value pairs, or a negative + * value corresponding to an AVERROR code in case of error: + * AVERROR(EINVAL) if opts cannot be parsed, + * the error code issued by av_opt_set() if a key/value pair + * cannot be set + */ +int av_set_options_string(void *ctx, const char *opts, + const char *key_val_sep, const char *pairs_sep); + +/** + * Parse the key-value pairs list in opts. For each key=value pair found, + * set the value of the corresponding option in ctx. + * + * @param ctx the AVClass object to set options on + * @param opts the options string, key-value pairs separated by a + * delimiter + * @param shorthand a NULL-terminated array of options names for shorthand + * notation: if the first field in opts has no key part, + * the key is taken from the first element of shorthand; + * then again for the second, etc., until either opts is + * finished, shorthand is finished or a named option is + * found; after that, all options must be named + * @param key_val_sep a 0-terminated list of characters used to separate + * key from value, for example '=' + * @param pairs_sep a 0-terminated list of characters used to separate + * two pairs from each other, for example ':' or ',' + * @return the number of successfully set key=value pairs, or a negative + * value corresponding to an AVERROR code in case of error: + * AVERROR(EINVAL) if opts cannot be parsed, + * the error code issued by av_set_string3() if a key/value pair + * cannot be set + * + * Options names must use only the following characters: a-z A-Z 0-9 - . / _ + * Separators must use characters distinct from option names and from each + * other. + */ +int av_opt_set_from_string(void *ctx, const char *opts, + const char *const *shorthand, + const char *key_val_sep, const char *pairs_sep); + +/** + * Set all the options from a given dictionary on an object. + * + * @param obj a struct whose first element is a pointer to AVClass + * @param options options to process. This dictionary will be freed and replaced + * by a new one containing all options not found in obj. + * Of course this new dictionary needs to be freed by caller + * with av_dict_free(). + * + * @return 0 on success, a negative AVERROR if some option was found in obj, + * but could not be set. + * + * @see av_dict_copy() + */ +int av_opt_set_dict(void *obj, struct AVDictionary **options); + + +/** + * Set all the options from a given dictionary on an object. + * + * @param obj a struct whose first element is a pointer to AVClass + * @param options options to process. This dictionary will be freed and replaced + * by a new one containing all options not found in obj. + * Of course this new dictionary needs to be freed by caller + * with av_dict_free(). + * @param search_flags A combination of AV_OPT_SEARCH_*. + * + * @return 0 on success, a negative AVERROR if some option was found in obj, + * but could not be set. + * + * @see av_dict_copy() + */ +int av_opt_set_dict2(void *obj, struct AVDictionary **options, int search_flags); + +/** + * Copy options from src object into dest object. + * + * The underlying AVClass of both src and dest must coincide. The guarantee + * below does not apply if this is not fulfilled. + * + * Options that require memory allocation (e.g. string or binary) are malloc'ed in dest object. + * Original memory allocated for such options is freed unless both src and dest options points to the same memory. + * + * Even on error it is guaranteed that allocated options from src and dest + * no longer alias each other afterwards; in particular calling av_opt_free() + * on both src and dest is safe afterwards if dest has been memdup'ed from src. + * + * @param dest Object to copy from + * @param src Object to copy into + * @return 0 on success, negative on error + */ +int av_opt_copy(void *dest, const void *src); /** * @defgroup opt_set_funcs Option setting functions @@ -697,10 +875,10 @@ int av_opt_set_image_size(void *obj, const char *name, int w, int h, int search_ int av_opt_set_pixel_fmt (void *obj, const char *name, enum AVPixelFormat fmt, int search_flags); int av_opt_set_sample_fmt(void *obj, const char *name, enum AVSampleFormat fmt, int search_flags); int av_opt_set_video_rate(void *obj, const char *name, AVRational val, int search_flags); -#if FF_API_OLD_CHANNEL_LAYOUT -attribute_deprecated -int av_opt_set_channel_layout(void *obj, const char *name, int64_t ch_layout, int search_flags); -#endif +/** + * @note Any old chlayout present is discarded and replaced with a copy of the new one. The + * caller still owns layout and is responsible for uninitializing it. + */ int av_opt_set_chlayout(void *obj, const char *name, const AVChannelLayout *layout, int search_flags); /** * @note Any old dictionary present is discarded and replaced with a copy of the new one. The @@ -724,8 +902,64 @@ int av_opt_set_dict_val(void *obj, const char *name, const AVDictionary *val, in av_opt_set_bin(obj, name, (const uint8_t *)(val), \ av_int_list_length(val, term) * sizeof(*(val)), flags)) +/** + * Add, replace, or remove elements for an array option. Which of these + * operations is performed depends on the values of val and search_flags. + * + * @param start_elem Index of the first array element to modify; must not be + * larger than array size as returned by + * av_opt_get_array_size(). + * @param nb_elems number of array elements to modify; when val is NULL, + * start_elem+nb_elems must not be larger than array size as + * returned by av_opt_get_array_size() + * + * @param val_type Option type corresponding to the type of val, ignored when val is + * NULL. + * + * The effect of this function will will be as if av_opt_setX() + * was called for each element, where X is specified by type. + * E.g. AV_OPT_TYPE_STRING corresponds to av_opt_set(). + * + * Typically this should be the same as the scalarized type of + * the AVOption being set, but certain conversions are also + * possible - the same as those done by the corresponding + * av_opt_set*() function. E.g. any option type can be set from + * a string, numeric types can be set from int64, double, or + * rational, etc. + * + * @param val Array with nb_elems elements or NULL. + * + * When NULL, nb_elems array elements starting at start_elem are + * removed from the array. Any array elements remaining at the end + * are shifted by nb_elems towards the first element in order to keep + * the array contiguous. + * + * Otherwise (val is non-NULL), the type of val must match the + * underlying C type as documented for val_type. + * + * When AV_OPT_ARRAY_REPLACE is not set in search_flags, the array is + * enlarged by nb_elems, and the contents of val are inserted at + * start_elem. Previously existing array elements from start_elem + * onwards (if present) are shifted by nb_elems away from the first + * element in order to make space for the new elements. + * + * When AV_OPT_ARRAY_REPLACE is set in search_flags, the contents + * of val replace existing array elements from start_elem to + * start_elem+nb_elems (if present). New array size is + * max(start_elem + nb_elems, old array size). + */ +int av_opt_set_array(void *obj, const char *name, int search_flags, + unsigned int start_elem, unsigned int nb_elems, + enum AVOptionType val_type, const void *val); + /** * @} + * @} + */ + +/** + * @defgroup opt_read Reading option values + * @{ */ /** @@ -756,19 +990,85 @@ int av_opt_get_image_size(void *obj, const char *name, int search_flags, int *w_ int av_opt_get_pixel_fmt (void *obj, const char *name, int search_flags, enum AVPixelFormat *out_fmt); int av_opt_get_sample_fmt(void *obj, const char *name, int search_flags, enum AVSampleFormat *out_fmt); int av_opt_get_video_rate(void *obj, const char *name, int search_flags, AVRational *out_val); -#if FF_API_OLD_CHANNEL_LAYOUT -attribute_deprecated -int av_opt_get_channel_layout(void *obj, const char *name, int search_flags, int64_t *ch_layout); -#endif +/** + * @param[out] layout The returned layout is a copy of the actual value and must + * be freed with av_channel_layout_uninit() by the caller + */ int av_opt_get_chlayout(void *obj, const char *name, int search_flags, AVChannelLayout *layout); /** * @param[out] out_val The returned dictionary is a copy of the actual value and must * be freed with av_dict_free() by the caller */ int av_opt_get_dict_val(void *obj, const char *name, int search_flags, AVDictionary **out_val); + +/** + * For an array-type option, get the number of elements in the array. + */ +int av_opt_get_array_size(void *obj, const char *name, int search_flags, + unsigned int *out_val); + +/** + * For an array-type option, retrieve the values of one or more array elements. + * + * @param start_elem index of the first array element to retrieve + * @param nb_elems number of array elements to retrieve; start_elem+nb_elems + * must not be larger than array size as returned by + * av_opt_get_array_size() + * + * @param out_type Option type corresponding to the desired output. + * + * The array elements produced by this function will + * will be as if av_opt_getX() was called for each element, + * where X is specified by out_type. E.g. AV_OPT_TYPE_STRING + * corresponds to av_opt_get(). + * + * Typically this should be the same as the scalarized type of + * the AVOption being retrieved, but certain conversions are + * also possible - the same as those done by the corresponding + * av_opt_get*() function. E.g. any option type can be retrieved + * as a string, numeric types can be retrieved as int64, double, + * or rational, etc. + * + * @param out_val Array with nb_elems members into which the output will be + * written. The array type must match the underlying C type as + * documented for out_type, and be zeroed on entry to this + * function. + * + * For dynamically allocated types (strings, binary, dicts, + * etc.), the result is owned and freed by the caller. + */ +int av_opt_get_array(void *obj, const char *name, int search_flags, + unsigned int start_elem, unsigned int nb_elems, + enum AVOptionType out_type, void *out_val); /** * @} */ + +/** + * @defgroup opt_eval_funcs Evaluating option strings + * @{ + * This group of functions can be used to evaluate option strings + * and get numbers out of them. They do the same thing as av_opt_set(), + * except the result is written into the caller-supplied pointer. + * + * @param obj a struct whose first element is a pointer to AVClass. + * @param o an option for which the string is to be evaluated. + * @param val string to be evaluated. + * @param *_out value of the string will be written here. + * + * @return 0 on success, a negative number on failure. + */ +int av_opt_eval_flags (void *obj, const AVOption *o, const char *val, int *flags_out); +int av_opt_eval_int (void *obj, const AVOption *o, const char *val, int *int_out); +int av_opt_eval_uint (void *obj, const AVOption *o, const char *val, unsigned *uint_out); +int av_opt_eval_int64 (void *obj, const AVOption *o, const char *val, int64_t *int64_out); +int av_opt_eval_float (void *obj, const AVOption *o, const char *val, float *float_out); +int av_opt_eval_double(void *obj, const AVOption *o, const char *val, double *double_out); +int av_opt_eval_q (void *obj, const AVOption *o, const char *val, AVRational *q_out); +/** + * @} + */ + /** * Gets a pointer to the requested field in a struct. * This function allows accessing a struct even when its fields are moved or @@ -779,61 +1079,6 @@ int av_opt_get_dict_val(void *obj, const char *name, int search_flags, AVDiction */ void *av_opt_ptr(const AVClass *avclass, void *obj, const char *name); -/** - * Free an AVOptionRanges struct and set it to NULL. - */ -void av_opt_freep_ranges(AVOptionRanges **ranges); - -/** - * Get a list of allowed ranges for the given option. - * - * The returned list may depend on other fields in obj like for example profile. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges - * - * The result must be freed with av_opt_freep_ranges. - * - * @return number of compontents returned on success, a negative errro code otherwise - */ -int av_opt_query_ranges(AVOptionRanges **, void *obj, const char *key, int flags); - -/** - * Copy options from src object into dest object. - * - * The underlying AVClass of both src and dest must coincide. The guarantee - * below does not apply if this is not fulfilled. - * - * Options that require memory allocation (e.g. string or binary) are malloc'ed in dest object. - * Original memory allocated for such options is freed unless both src and dest options points to the same memory. - * - * Even on error it is guaranteed that allocated options from src and dest - * no longer alias each other afterwards; in particular calling av_opt_free() - * on both src and dest is safe afterwards if dest has been memdup'ed from src. - * - * @param dest Object to copy from - * @param src Object to copy into - * @return 0 on success, negative on error - */ -int av_opt_copy(void *dest, const void *src); - -/** - * Get a default list of allowed ranges for the given option. - * - * This list is constructed without using the AVClass.query_ranges() callback - * and can be used as fallback from within the callback. - * - * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored - * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance - * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges - * - * The result must be freed with av_opt_free_ranges. - * - * @return number of compontents returned on success, a negative errro code otherwise - */ -int av_opt_query_ranges_default(AVOptionRanges **, void *obj, const char *key, int flags); - /** * Check if given option is set to its default value. * @@ -860,9 +1105,19 @@ int av_opt_is_set_to_default(void *obj, const AVOption *o); */ int av_opt_is_set_to_default_by_name(void *obj, const char *name, int search_flags); +/** + * Check whether a particular flag is set in a flags field. + * + * @param field_name the name of the flag field option + * @param flag_name the name of the flag to check + * @return non-zero if the flag is set, zero if the flag isn't set, + * isn't of the right type, or the flags field doesn't exist. + */ +int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name); #define AV_OPT_SERIALIZE_SKIP_DEFAULTS 0x00000001 ///< Serialize options that are not set to default values only. #define AV_OPT_SERIALIZE_OPT_FLAGS_EXACT 0x00000002 ///< Serialize options that exactly match opt_flags only. +#define AV_OPT_SERIALIZE_SEARCH_CHILDREN 0x00000004 ///< Serialize options in possible children of the given object. /** * Serialize object's options. @@ -884,6 +1139,47 @@ int av_opt_is_set_to_default_by_name(void *obj, const char *name, int search_fla */ int av_opt_serialize(void *obj, int opt_flags, int flags, char **buffer, const char key_val_sep, const char pairs_sep); + +/** + * @} + */ + +/** + * Free an AVOptionRanges struct and set it to NULL. + */ +void av_opt_freep_ranges(AVOptionRanges **ranges); + +/** + * Get a list of allowed ranges for the given option. + * + * The returned list may depend on other fields in obj like for example profile. + * + * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored + * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance + * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges + * + * The result must be freed with av_opt_freep_ranges. + * + * @return number of compontents returned on success, a negative errro code otherwise + */ +int av_opt_query_ranges(AVOptionRanges **, void *obj, const char *key, int flags); + +/** + * Get a default list of allowed ranges for the given option. + * + * This list is constructed without using the AVClass.query_ranges() callback + * and can be used as fallback from within the callback. + * + * @param flags is a bitmask of flags, undefined flags should not be set and should be ignored + * AV_OPT_SEARCH_FAKE_OBJ indicates that the obj is a double pointer to a AVClass instead of a full instance + * AV_OPT_MULTI_COMPONENT_RANGE indicates that function may return more than one component, @see AVOptionRanges + * + * The result must be freed with av_opt_free_ranges. + * + * @return number of compontents returned on success, a negative errro code otherwise + */ +int av_opt_query_ranges_default(AVOptionRanges **, void *obj, const char *key, int flags); + /** * @} */ diff --git a/include/libavutil/parseutils.h b/include/libavutil/parseutils.h index e66d24b..dad5c27 100755 --- a/include/libavutil/parseutils.h +++ b/include/libavutil/parseutils.h @@ -79,6 +79,8 @@ int av_parse_video_rate(AVRational *rate, const char *str); /** * Put the RGBA values that correspond to color_string in rgba_color. * + * @param rgba_color 4-elements array of uint8_t values, where the respective + * red, green, blue and alpha component values are written. * @param color_string a string specifying a color. It can be the name of * a color (case insensitive match) or a [0x|#]RRGGBB[AA] sequence, * possibly followed by "@" and a string representing the alpha @@ -92,6 +94,8 @@ int av_parse_video_rate(AVRational *rate, const char *str); * @param slen length of the initial part of color_string containing the * color. It can be set to -1 if color_string is a null terminated string * containing nothing else than the color. + * @param log_ctx a pointer to an arbitrary struct of which the first field + * is a pointer to an AVClass struct (used for av_log()). Can be NULL. * @return >= 0 in case of success, a negative value in case of * failure (for example if color_string cannot be parsed). */ @@ -106,7 +110,7 @@ int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen, * av_parse_color(). * * @param color_idx index of the requested color, starting from 0 - * @param rgbp if not NULL, will point to a 3-elements array with the color value in RGB + * @param rgb if not NULL, will point to a 3-elements array with the color value in RGB * @return the color name string or NULL if color_idx is not in the array */ const char *av_get_known_color_name(int color_idx, const uint8_t **rgb); @@ -162,19 +166,19 @@ int av_find_info_tag(char *arg, int arg_size, const char *tag1, const char *info * by the standard strptime(). * * The supported input field descriptors are listed below. - * - %H: the hour as a decimal number, using a 24-hour clock, in the + * - `%%H`: the hour as a decimal number, using a 24-hour clock, in the * range '00' through '23' - * - %J: hours as a decimal number, in the range '0' through INT_MAX - * - %M: the minute as a decimal number, using a 24-hour clock, in the + * - `%%J`: hours as a decimal number, in the range '0' through INT_MAX + * - `%%M`: the minute as a decimal number, using a 24-hour clock, in the * range '00' through '59' - * - %S: the second as a decimal number, using a 24-hour clock, in the + * - `%%S`: the second as a decimal number, using a 24-hour clock, in the * range '00' through '59' - * - %Y: the year as a decimal number, using the Gregorian calendar - * - %m: the month as a decimal number, in the range '1' through '12' - * - %d: the day of the month as a decimal number, in the range '1' + * - `%%Y`: the year as a decimal number, using the Gregorian calendar + * - `%%m`: the month as a decimal number, in the range '1' through '12' + * - `%%d`: the day of the month as a decimal number, in the range '1' * through '31' - * - %T: alias for '%H:%M:%S' - * - %%: a literal '%' + * - `%%T`: alias for `%%H:%%M:%%S` + * - `%%`: a literal `%` * * @return a pointer to the first character not processed in this function * call. In case the input string contains more characters than diff --git a/include/libavutil/pca.h b/include/libavutil/pca.h new file mode 100644 index 0000000..992bb2e --- /dev/null +++ b/include/libavutil/pca.h @@ -0,0 +1,35 @@ +/* + * principal component analysis (PCA) + * Copyright (c) 2004 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * principal component analysis (PCA) + */ + +#ifndef AVUTIL_PCA_H +#define AVUTIL_PCA_H + +struct PCA *ff_pca_init(int n); +void ff_pca_free(struct PCA *pca); +void ff_pca_add(struct PCA *pca, const double *v); +int ff_pca(struct PCA *pca, double *eigenvector, double *eigenvalue); + +#endif /* AVUTIL_PCA_H */ diff --git a/include/libavutil/pixdesc.h b/include/libavutil/pixdesc.h index f8a195f..ba2f632 100755 --- a/include/libavutil/pixdesc.h +++ b/include/libavutil/pixdesc.h @@ -157,6 +157,11 @@ typedef struct AVPixFmtDescriptor { */ #define AV_PIX_FMT_FLAG_FLOAT (1 << 9) +/** + * The pixel format contains XYZ-like data (as opposed to YUV/RGB/grayscale). + */ +#define AV_PIX_FMT_FLAG_XYZ (1 << 10) + /** * Return the number of bits per pixel used by the pixel format * described by pixdesc. Note that this is not the same as the number @@ -264,6 +269,28 @@ const char *av_chroma_location_name(enum AVChromaLocation location); */ int av_chroma_location_from_name(const char *name); +/** + * Converts AVChromaLocation to swscale x/y chroma position. + * + * The positions represent the chroma (0,0) position in a coordinates system + * with luma (0,0) representing the origin and luma(1,1) representing 256,256 + * + * @param xpos horizontal chroma sample position + * @param ypos vertical chroma sample position + */ +int av_chroma_location_enum_to_pos(int *xpos, int *ypos, enum AVChromaLocation pos); + +/** + * Converts swscale x/y chroma position to AVChromaLocation. + * + * The positions represent the chroma (0,0) position in a coordinates system + * with luma (0,0) representing the origin and luma(1,1) representing 256,256 + * + * @param xpos horizontal chroma sample position + * @param ypos vertical chroma sample position + */ +enum AVChromaLocation av_chroma_location_pos_to_enum(int xpos, int ypos); + /** * Return the pixel format corresponding to name. * @@ -357,12 +384,15 @@ void av_write_image_line(const uint16_t *src, uint8_t *data[4], */ enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt); -#define FF_LOSS_RESOLUTION 0x0001 /**< loss due to resolution change */ -#define FF_LOSS_DEPTH 0x0002 /**< loss due to color depth change */ -#define FF_LOSS_COLORSPACE 0x0004 /**< loss due to color space conversion */ -#define FF_LOSS_ALPHA 0x0008 /**< loss of alpha bits */ -#define FF_LOSS_COLORQUANT 0x0010 /**< loss due to color quantization */ -#define FF_LOSS_CHROMA 0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */ +#define FF_LOSS_RESOLUTION 0x0001 /**< loss due to resolution change */ +#define FF_LOSS_DEPTH 0x0002 /**< loss due to color depth change */ +#define FF_LOSS_COLORSPACE 0x0004 /**< loss due to color space conversion */ +#define FF_LOSS_ALPHA 0x0008 /**< loss of alpha bits */ +#define FF_LOSS_COLORQUANT 0x0010 /**< loss due to color quantization */ +#define FF_LOSS_CHROMA 0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */ +#define FF_LOSS_EXCESS_RESOLUTION 0x0040 /**< loss due to unneeded extra resolution */ +#define FF_LOSS_EXCESS_DEPTH 0x0080 /**< loss due to unneeded extra color depth */ + /** * Compute what kind of losses will occur when converting from one specific diff --git a/include/libavutil/pixfmt.h b/include/libavutil/pixfmt.h index 2d3927c..a7f50e1 100755 --- a/include/libavutil/pixfmt.h +++ b/include/libavutil/pixfmt.h @@ -32,6 +32,13 @@ #define AVPALETTE_SIZE 1024 #define AVPALETTE_COUNT 256 +/** + * Maximum number of planes in any pixel format. + * This should be used when a maximum is needed, but code should not + * be written to require a maximum for no good reason. + */ +#define AV_VIDEO_MAX_PLANES 4 + /** * Pixel format. * @@ -83,7 +90,7 @@ enum AVPixelFormat { AV_PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) AV_PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) - AV_PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) + AV_PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)3R 3G 2B(lsb) AV_PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) AV_PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) @@ -206,8 +213,36 @@ enum AVPixelFormat { AV_PIX_FMT_GBRAP16BE, ///< planar GBRA 4:4:4:4 64bpp, big-endian AV_PIX_FMT_GBRAP16LE, ///< planar GBRA 4:4:4:4 64bpp, little-endian /** - * HW acceleration through QSV, data[3] contains a pointer to the - * mfxFrameSurface1 structure. + * HW acceleration through QSV, data[3] contains a pointer to the + * mfxFrameSurface1 structure. + * + * Before FFmpeg 5.0: + * mfxFrameSurface1.Data.MemId contains a pointer when importing + * the following frames as QSV frames: + * + * VAAPI: + * mfxFrameSurface1.Data.MemId contains a pointer to VASurfaceID + * + * DXVA2: + * mfxFrameSurface1.Data.MemId contains a pointer to IDirect3DSurface9 + * + * FFmpeg 5.0 and above: + * mfxFrameSurface1.Data.MemId contains a pointer to the mfxHDLPair + * structure when importing the following frames as QSV frames: + * + * VAAPI: + * mfxHDLPair.first contains a VASurfaceID pointer. + * mfxHDLPair.second is always MFX_INFINITE. + * + * DXVA2: + * mfxHDLPair.first contains IDirect3DSurface9 pointer. + * mfxHDLPair.second is always MFX_INFINITE. + * + * D3D11: + * mfxHDLPair.first contains a ID3D11Texture2D pointer. + * mfxHDLPair.second contains the texture array index of the frame if the + * ID3D11Texture2D is an array texture, or always MFX_INFINITE if it is a + * normal texture. */ AV_PIX_FMT_QSV, /** @@ -260,10 +295,6 @@ enum AVPixelFormat { AV_PIX_FMT_BAYER_GRBG16LE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian AV_PIX_FMT_BAYER_GRBG16BE, ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian -#if FF_API_XVMC - AV_PIX_FMT_XVMC,///< XVideo Motion Acceleration via common packet passing -#endif - AV_PIX_FMT_YUV440P10LE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian AV_PIX_FMT_YUV440P10BE, ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian AV_PIX_FMT_YUV440P12LE, ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian @@ -367,6 +398,47 @@ enum AVPixelFormat { AV_PIX_FMT_P416BE, ///< interleaved chroma YUV 4:4:4, 48bpp, big-endian AV_PIX_FMT_P416LE, ///< interleaved chroma YUV 4:4:4, 48bpp, little-endian + AV_PIX_FMT_VUYA, ///< packed VUYA 4:4:4, 32bpp, VUYAVUYA... + + AV_PIX_FMT_RGBAF16BE, ///< IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., big-endian + AV_PIX_FMT_RGBAF16LE, ///< IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., little-endian + + AV_PIX_FMT_VUYX, ///< packed VUYX 4:4:4, 32bpp, Variant of VUYA where alpha channel is left undefined + + AV_PIX_FMT_P012LE, ///< like NV12, with 12bpp per component, data in the high bits, zeros in the low bits, little-endian + AV_PIX_FMT_P012BE, ///< like NV12, with 12bpp per component, data in the high bits, zeros in the low bits, big-endian + + AV_PIX_FMT_Y212BE, ///< packed YUV 4:2:2 like YUYV422, 24bpp, data in the high bits, zeros in the low bits, big-endian + AV_PIX_FMT_Y212LE, ///< packed YUV 4:2:2 like YUYV422, 24bpp, data in the high bits, zeros in the low bits, little-endian + + AV_PIX_FMT_XV30BE, ///< packed XVYU 4:4:4, 32bpp, (msb)2X 10V 10Y 10U(lsb), big-endian, variant of Y410 where alpha channel is left undefined + AV_PIX_FMT_XV30LE, ///< packed XVYU 4:4:4, 32bpp, (msb)2X 10V 10Y 10U(lsb), little-endian, variant of Y410 where alpha channel is left undefined + + AV_PIX_FMT_XV36BE, ///< packed XVYU 4:4:4, 48bpp, data in the high bits, zeros in the low bits, big-endian, variant of Y412 where alpha channel is left undefined + AV_PIX_FMT_XV36LE, ///< packed XVYU 4:4:4, 48bpp, data in the high bits, zeros in the low bits, little-endian, variant of Y412 where alpha channel is left undefined + + AV_PIX_FMT_RGBF32BE, ///< IEEE-754 single precision packed RGB 32:32:32, 96bpp, RGBRGB..., big-endian + AV_PIX_FMT_RGBF32LE, ///< IEEE-754 single precision packed RGB 32:32:32, 96bpp, RGBRGB..., little-endian + + AV_PIX_FMT_RGBAF32BE, ///< IEEE-754 single precision packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., big-endian + AV_PIX_FMT_RGBAF32LE, ///< IEEE-754 single precision packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., little-endian + + AV_PIX_FMT_P212BE, ///< interleaved chroma YUV 4:2:2, 24bpp, data in the high bits, big-endian + AV_PIX_FMT_P212LE, ///< interleaved chroma YUV 4:2:2, 24bpp, data in the high bits, little-endian + + AV_PIX_FMT_P412BE, ///< interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, big-endian + AV_PIX_FMT_P412LE, ///< interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, little-endian + + AV_PIX_FMT_GBRAP14BE, ///< planar GBR 4:4:4:4 56bpp, big-endian + AV_PIX_FMT_GBRAP14LE, ///< planar GBR 4:4:4:4 56bpp, little-endian + + /** + * Hardware surfaces for Direct3D 12. + * + * data[0] points to an AVD3D12VAFrame + */ + AV_PIX_FMT_D3D12, + AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions }; @@ -425,6 +497,7 @@ enum AVPixelFormat { #define AV_PIX_FMT_GBRP16 AV_PIX_FMT_NE(GBRP16BE, GBRP16LE) #define AV_PIX_FMT_GBRAP10 AV_PIX_FMT_NE(GBRAP10BE, GBRAP10LE) #define AV_PIX_FMT_GBRAP12 AV_PIX_FMT_NE(GBRAP12BE, GBRAP12LE) +#define AV_PIX_FMT_GBRAP14 AV_PIX_FMT_NE(GBRAP14BE, GBRAP14LE) #define AV_PIX_FMT_GBRAP16 AV_PIX_FMT_NE(GBRAP16BE, GBRAP16LE) #define AV_PIX_FMT_BAYER_BGGR16 AV_PIX_FMT_NE(BAYER_BGGR16BE, BAYER_BGGR16LE) @@ -453,17 +526,28 @@ enum AVPixelFormat { #define AV_PIX_FMT_NV20 AV_PIX_FMT_NE(NV20BE, NV20LE) #define AV_PIX_FMT_AYUV64 AV_PIX_FMT_NE(AYUV64BE, AYUV64LE) #define AV_PIX_FMT_P010 AV_PIX_FMT_NE(P010BE, P010LE) +#define AV_PIX_FMT_P012 AV_PIX_FMT_NE(P012BE, P012LE) #define AV_PIX_FMT_P016 AV_PIX_FMT_NE(P016BE, P016LE) #define AV_PIX_FMT_Y210 AV_PIX_FMT_NE(Y210BE, Y210LE) +#define AV_PIX_FMT_Y212 AV_PIX_FMT_NE(Y212BE, Y212LE) +#define AV_PIX_FMT_XV30 AV_PIX_FMT_NE(XV30BE, XV30LE) +#define AV_PIX_FMT_XV36 AV_PIX_FMT_NE(XV36BE, XV36LE) #define AV_PIX_FMT_X2RGB10 AV_PIX_FMT_NE(X2RGB10BE, X2RGB10LE) #define AV_PIX_FMT_X2BGR10 AV_PIX_FMT_NE(X2BGR10BE, X2BGR10LE) #define AV_PIX_FMT_P210 AV_PIX_FMT_NE(P210BE, P210LE) #define AV_PIX_FMT_P410 AV_PIX_FMT_NE(P410BE, P410LE) +#define AV_PIX_FMT_P212 AV_PIX_FMT_NE(P212BE, P212LE) +#define AV_PIX_FMT_P412 AV_PIX_FMT_NE(P412BE, P412LE) #define AV_PIX_FMT_P216 AV_PIX_FMT_NE(P216BE, P216LE) #define AV_PIX_FMT_P416 AV_PIX_FMT_NE(P416BE, P416LE) +#define AV_PIX_FMT_RGBAF16 AV_PIX_FMT_NE(RGBAF16BE, RGBAF16LE) + +#define AV_PIX_FMT_RGBF32 AV_PIX_FMT_NE(RGBF32BE, RGBF32LE) +#define AV_PIX_FMT_RGBAF32 AV_PIX_FMT_NE(RGBAF32BE, RGBAF32LE) + /** * Chromaticity coordinates of the source primaries. * These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.1 and ITU-T H.273. @@ -539,6 +623,9 @@ enum AVColorSpace { AVCOL_SPC_CHROMA_DERIVED_NCL = 12, ///< Chromaticity-derived non-constant luminance system AVCOL_SPC_CHROMA_DERIVED_CL = 13, ///< Chromaticity-derived constant luminance system AVCOL_SPC_ICTCP = 14, ///< ITU-R BT.2100-0, ICtCp + AVCOL_SPC_IPT_C2 = 15, ///< SMPTE ST 2128, IPT-C2 + AVCOL_SPC_YCGCO_RE = 16, ///< YCgCo-R, even addition of bits + AVCOL_SPC_YCGCO_RO = 17, ///< YCgCo-R, odd addition of bits AVCOL_SPC_NB ///< Not part of ABI }; diff --git a/include/libavutil/qsort.h b/include/libavutil/qsort.h new file mode 100644 index 0000000..6014f88 --- /dev/null +++ b/include/libavutil/qsort.h @@ -0,0 +1,122 @@ +/* + * copyright (c) 2012 Michael Niedermayer + * + * 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 AVUTIL_QSORT_H +#define AVUTIL_QSORT_H + +#include "macros.h" + + +/** + * Quicksort + * This sort is fast, and fully inplace but not stable and it is possible + * to construct input that requires O(n^2) time but this is very unlikely to + * happen with non constructed input. + */ +#define AV_QSORT(p, num, type, cmp) do {\ + void *stack[64][2];\ + int sp= 1;\ + stack[0][0] = p;\ + stack[0][1] = (p)+(num)-1;\ + while(sp){\ + type *start= stack[--sp][0];\ + type *end = stack[ sp][1];\ + while(start < end){\ + if(start < end-1) {\ + int checksort=0;\ + type *right = end-2;\ + type *left = start+1;\ + type *mid = start + ((end-start)>>1);\ + if(cmp(start, end) > 0) {\ + if(cmp( end, mid) > 0) FFSWAP(type, *start, *mid);\ + else FFSWAP(type, *start, *end);\ + }else{\ + if(cmp(start, mid) > 0) FFSWAP(type, *start, *mid);\ + else checksort= 1;\ + }\ + if(cmp(mid, end) > 0){ \ + FFSWAP(type, *mid, *end);\ + checksort=0;\ + }\ + if(start == end-2) break;\ + FFSWAP(type, end[-1], *mid);\ + while(left <= right){\ + while(left<=right && cmp(left, end-1) < 0)\ + left++;\ + while(left<=right && cmp(right, end-1) > 0)\ + right--;\ + if(left <= right){\ + FFSWAP(type, *left, *right);\ + left++;\ + right--;\ + }\ + }\ + FFSWAP(type, end[-1], *left);\ + if(checksort && (mid == left-1 || mid == left)){\ + mid= start;\ + while(mid 0)\ + FFSWAP(type, *start, *end);\ + break;\ + }\ + }\ + }\ +} while (0) + +/** + * Merge sort, this sort requires a temporary buffer and is stable, its worst + * case time is O(n log n) + * @param p must be a lvalue pointer, this function may exchange it with tmp + * @param tmp must be a lvalue pointer, this function may exchange it with p + */ +#define AV_MSORT(p, tmp, num, type, cmp) do {\ + unsigned i, j, step;\ + for(step=1; step<(num); step+=step){\ + for(i=0; i<(num); i+=2*step){\ + unsigned a[2] = {i, i+step};\ + unsigned end = FFMIN(i+2*step, (num));\ + for(j=i; a[0] 0;\ + tmp[j] = p[ a[idx]++ ];\ + }\ + if(a[0]>=i+step) a[0] = a[1];\ + for(; j #include /** * @addtogroup lavu_crypto @@ -36,6 +37,19 @@ */ uint32_t av_get_random_seed(void); +/** + * Generate cryptographically secure random data, i.e. suitable for use as + * encryption keys and similar. + * + * @param buf buffer into which the random data will be written + * @param len size of buf in bytes + * + * @retval 0 success, len bytes of random data was written + * into buf + * @retval "a negative AVERROR code" random data could not be generated + */ +int av_random_bytes(uint8_t *buf, size_t len); + /** * @} */ diff --git a/include/libavutil/rational.h b/include/libavutil/rational.h index cbb08a0..849f47f 100755 --- a/include/libavutil/rational.h +++ b/include/libavutil/rational.h @@ -168,6 +168,10 @@ static av_always_inline AVRational av_inv_q(AVRational q) * In case of infinity, the returned value is expressed as `{1, 0}` or * `{-1, 0}` depending on the sign. * + * In general rational numbers with |num| <= 1<<26 && |den| <= 1<<26 + * can be recovered exactly from their double representation. + * (no exceptions were found within 1B random ones) + * * @param d `double` to convert * @param max Maximum allowed numerator and denominator * @return `d` in AVRational form @@ -179,7 +183,8 @@ AVRational av_d2q(double d, int max) av_const; * Find which of the two rationals is closer to another rational. * * @param q Rational to be compared against - * @param q1,q2 Rationals to be tested + * @param q1 Rational to be tested + * @param q2 Rational to be tested * @return One of the following values: * - 1 if `q1` is nearer to `q` than `q2` * - -1 if `q2` is nearer to `q` than `q1` diff --git a/include/libavutil/rc4.h b/include/libavutil/rc4.h index 029cd2a..bf0ca6e 100755 --- a/include/libavutil/rc4.h +++ b/include/libavutil/rc4.h @@ -42,6 +42,8 @@ AVRC4 *av_rc4_alloc(void); /** * @brief Initializes an AVRC4 context. * + * @param d pointer to the AVRC4 context + * @param key buffer containig the key * @param key_bits must be a multiple of 8 * @param decrypt 0 for encryption, 1 for decryption, currently has no effect * @return zero on success, negative value otherwise @@ -51,6 +53,7 @@ int av_rc4_init(struct AVRC4 *d, const uint8_t *key, int key_bits, int decrypt); /** * @brief Encrypts / decrypts using the RC4 algorithm. * + * @param d pointer to the AVRC4 context * @param count number of bytes * @param dst destination array, can be equal to src * @param src source array, can be equal to dst, may be NULL diff --git a/include/libavutil/reverse.h b/include/libavutil/reverse.h new file mode 100644 index 0000000..4eb6123 --- /dev/null +++ b/include/libavutil/reverse.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2002-2004 Michael Niedermayer + * + * 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 AVUTIL_REVERSE_H +#define AVUTIL_REVERSE_H + +#include + +extern const uint8_t ff_reverse[256]; + +#endif /* AVUTIL_REVERSE_H */ diff --git a/include/libavutil/samplefmt.h b/include/libavutil/samplefmt.h index 1999c9b..43a57a4 100755 --- a/include/libavutil/samplefmt.h +++ b/include/libavutil/samplefmt.h @@ -213,6 +213,7 @@ int av_samples_fill_arrays(uint8_t **audio_data, int *linesize, * @param[out] linesize aligned size for audio buffer(s), may be NULL * @param nb_channels number of audio channels * @param nb_samples number of samples per channel + * @param sample_fmt the sample format * @param align buffer size alignment (0 = default, 1 = no alignment) * @return >=0 on success or a negative error code on failure * @todo return the size of the allocated buffer in case of success at the next bump @@ -245,7 +246,7 @@ int av_samples_alloc_array_and_samples(uint8_t ***audio_data, int *linesize, int * @param nb_channels number of audio channels * @param sample_fmt audio sample format */ -int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset, +int av_samples_copy(uint8_t * const *dst, uint8_t * const *src, int dst_offset, int src_offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt); @@ -258,7 +259,7 @@ int av_samples_copy(uint8_t **dst, uint8_t * const *src, int dst_offset, * @param nb_channels number of audio channels * @param sample_fmt audio sample format */ -int av_samples_set_silence(uint8_t **audio_data, int offset, int nb_samples, +int av_samples_set_silence(uint8_t * const *audio_data, int offset, int nb_samples, int nb_channels, enum AVSampleFormat sample_fmt); /** diff --git a/include/libavutil/sfc64.h b/include/libavutil/sfc64.h new file mode 100644 index 0000000..a1593a0 --- /dev/null +++ b/include/libavutil/sfc64.h @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2024 Michael Niedermayer + * + * 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 + * + */ + +/** + * @file + * simple Pseudo Random Number Generator + * + * This is a implementation of SFC64, a 64-bit PRNG by Chris Doty-Humphrey. + * + * This Generator is much faster (0m1.872s) than 64bit KISS (0m3.823s) and PCG-XSH-RR-64/32 (0m2.700s) + * And passes testu01 and practrand test suits. + */ + +#ifndef AVUTIL_SFC64_H +#define AVUTIL_SFC64_H + +#include + +typedef struct FFSFC64 { + uint64_t a,b,c,counter; +} FFSFC64; + +static inline uint64_t ff_sfc64_get(FFSFC64 *s) { + uint64_t tmp = s->a + s->b + s->counter++; + s->a = s->b ^ (s->b >> 11); + s->b = s->c + (s->c << 3); // This is a multiply by 9 + s->c = (s->c << 24 | s->c >> 40) + tmp; + return tmp; +} + +/** + * Return the previous random value, and step the generator backward. + * + * It is safe to take values before the first, but such values can be highly + * correlated to the seeds. + */ +static inline uint64_t ff_sfc64_reverse_get(FFSFC64 *s) { + uint64_t prev_c = s->b * 0x8E38E38E38E38E39; + uint64_t tmp = s->c - (prev_c << 24 | prev_c >> 40); + s->b = s->a ^ (s->a >> 11); + s->b ^= s->b >> 22; + s->b ^= s->b >> 44; + + s->a = tmp - s->b - --s->counter; + s->c = prev_c; + + return tmp; +} + +/** + * Initialize sfc64 with up to 3 seeds. + * + * @param rounds number of rounds mixing up state during init. Generally 8-18, larger numbers will help with bad quality seeds. + * 12 is a good choice if all 3 seeds are equal + * + */ +static inline void ff_sfc64_init(FFSFC64 *s, uint64_t seeda, uint64_t seedb, uint64_t seedc, int rounds) { + s->a = seeda; + s->b = seedb; + s->c = seedc; + s->counter = 1; + while (rounds--) + ff_sfc64_get(s); +} + +#endif // AVUTIL_SFC64_H diff --git a/include/libavutil/slicethread.h b/include/libavutil/slicethread.h new file mode 100644 index 0000000..f6f6f30 --- /dev/null +++ b/include/libavutil/slicethread.h @@ -0,0 +1,52 @@ +/* + * 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 AVUTIL_SLICETHREAD_H +#define AVUTIL_SLICETHREAD_H + +typedef struct AVSliceThread AVSliceThread; + +/** + * Create slice threading context. + * @param pctx slice threading context returned here + * @param priv private pointer to be passed to callback function + * @param worker_func callback function to be executed + * @param main_func special callback function, called from main thread, may be NULL + * @param nb_threads number of threads, 0 for automatic, must be >= 0 + * @return return number of threads or negative AVERROR on failure + */ +int avpriv_slicethread_create(AVSliceThread **pctx, void *priv, + void (*worker_func)(void *priv, int jobnr, int threadnr, int nb_jobs, int nb_threads), + void (*main_func)(void *priv), + int nb_threads); + +/** + * Execute slice threading. + * @param ctx slice threading context + * @param nb_jobs number of jobs, must be > 0 + * @param execute_main also execute main_func + */ +void avpriv_slicethread_execute(AVSliceThread *ctx, int nb_jobs, int execute_main); + +/** + * Destroy slice threading context. + * @param pctx pointer to context + */ +void avpriv_slicethread_free(AVSliceThread **pctx); + +#endif diff --git a/include/libavutil/softfloat.h b/include/libavutil/softfloat.h new file mode 100644 index 0000000..399ca6d --- /dev/null +++ b/include/libavutil/softfloat.h @@ -0,0 +1,293 @@ +/* + * Copyright (c) 2006 Michael Niedermayer + * + * 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 AVUTIL_SOFTFLOAT_H +#define AVUTIL_SOFTFLOAT_H + +#include +#include "common.h" + +#include "avassert.h" +#include "softfloat_tables.h" + +#define MIN_EXP -149 +#define MAX_EXP 126 +#define ONE_BITS 29 + +typedef struct SoftFloat{ + int32_t mant; + int32_t exp; +}SoftFloat; + +static const SoftFloat FLOAT_0 = { 0, MIN_EXP}; ///< 0.0 +static const SoftFloat FLOAT_05 = { 0x20000000, 0}; ///< 0.5 +static const SoftFloat FLOAT_1 = { 0x20000000, 1}; ///< 1.0 +static const SoftFloat FLOAT_EPSILON = { 0x29F16B12, -16}; ///< A small value +static const SoftFloat FLOAT_1584893192 = { 0x32B771ED, 1}; ///< 1.584893192 (10^.2) +static const SoftFloat FLOAT_100000 = { 0x30D40000, 17}; ///< 100000 +static const SoftFloat FLOAT_0999999 = { 0x3FFFFBCE, 0}; ///< 0.999999 +static const SoftFloat FLOAT_MIN = { 0x20000000, MIN_EXP}; + + +/** + * Convert a SoftFloat to a double precision float. + */ +static inline av_const double av_sf2double(SoftFloat v) { + v.exp -= ONE_BITS +1; + return ldexp(v.mant, v.exp); +} + +static av_const SoftFloat av_normalize_sf(SoftFloat a){ + if(a.mant){ +#if 1 + while((a.mant + 0x1FFFFFFFU)<0x3FFFFFFFU){ + a.mant += a.mant; + a.exp -= 1; + } +#else + int s=ONE_BITS - av_log2(FFABS(a.mant)); + a.exp -= s; + a.mant <<= s; +#endif + if(a.exp < MIN_EXP){ + a.exp = MIN_EXP; + a.mant= 0; + } + }else{ + a.exp= MIN_EXP; + } + return a; +} + +static inline av_const SoftFloat av_normalize1_sf(SoftFloat a){ +#if 1 + if((int32_t)(a.mant + 0x40000000U) <= 0){ + a.exp++; + a.mant>>=1; + } + av_assert2(a.mant < 0x40000000 && a.mant > -0x40000000); + av_assert2(a.exp <= MAX_EXP); + return a; +#elif 1 + int t= a.mant + 0x40000000 < 0; + return (SoftFloat){ a.mant>>t, a.exp+t}; +#else + int t= (a.mant + 0x3FFFFFFFU)>>31; + return (SoftFloat){a.mant>>t, a.exp+t}; +#endif +} + +/** + * @return Will not be more denormalized than a*b. So if either input is + * normalized, then the output will not be worse then the other input. + * If both are normalized, then the output will be normalized. + */ +static inline av_const SoftFloat av_mul_sf(SoftFloat a, SoftFloat b){ + a.exp += b.exp; + av_assert2((int32_t)((a.mant * (int64_t)b.mant) >> ONE_BITS) == (a.mant * (int64_t)b.mant) >> ONE_BITS); + a.mant = (a.mant * (int64_t)b.mant) >> ONE_BITS; + a = av_normalize1_sf((SoftFloat){a.mant, a.exp - 1}); + if (!a.mant || a.exp < MIN_EXP) + return FLOAT_0; + return a; +} + +/** + * b has to be normalized and not zero. + * @return Will not be more denormalized than a. + */ +static inline av_const SoftFloat av_div_sf(SoftFloat a, SoftFloat b){ + int64_t temp = (int64_t)a.mant * (1<<(ONE_BITS+1)); + temp /= b.mant; + a.exp -= b.exp; + a.mant = temp; + while (a.mant != temp) { + temp /= 2; + a.exp--; + a.mant = temp; + } + a = av_normalize1_sf(a); + if (!a.mant || a.exp < MIN_EXP) + return FLOAT_0; + return a; +} + +/** + * Compares two SoftFloats. + * @returns < 0 if the first is less + * > 0 if the first is greater + * 0 if they are equal + */ +static inline av_const int av_cmp_sf(SoftFloat a, SoftFloat b){ + int t= a.exp - b.exp; + if (t <-31) return - b.mant ; + else if (t < 0) return (a.mant >> (-t)) - b.mant ; + else if (t < 32) return a.mant - (b.mant >> t); + else return a.mant ; +} + +/** + * Compares two SoftFloats. + * @returns 1 if a is greater than b, 0 otherwise + */ +static inline av_const int av_gt_sf(SoftFloat a, SoftFloat b) +{ + int t= a.exp - b.exp; + if (t <-31) return 0 > b.mant ; + else if (t < 0) return (a.mant >> (-t)) > b.mant ; + else if (t < 32) return a.mant > (b.mant >> t); + else return a.mant > 0 ; +} + +/** + * @returns the sum of 2 SoftFloats. + */ +static inline av_const SoftFloat av_add_sf(SoftFloat a, SoftFloat b){ + int t= a.exp - b.exp; + if (t <-31) return b; + else if (t < 0) return av_normalize_sf(av_normalize1_sf((SoftFloat){ b.mant + (a.mant >> (-t)), b.exp})); + else if (t < 32) return av_normalize_sf(av_normalize1_sf((SoftFloat){ a.mant + (b.mant >> t ), a.exp})); + else return a; +} + +/** + * @returns the difference of 2 SoftFloats. + */ +static inline av_const SoftFloat av_sub_sf(SoftFloat a, SoftFloat b){ + return av_add_sf(a, (SoftFloat){ -b.mant, b.exp}); +} + +//FIXME log, exp, pow + +/** + * Converts a mantisse and exponent to a SoftFloat. + * This converts a fixed point value v with frac_bits fractional bits to a + * SoftFloat. + * @returns a SoftFloat with value v * 2^-frac_bits + */ +static inline av_const SoftFloat av_int2sf(int v, int frac_bits){ + int exp_offset = 0; + if(v <= INT_MIN + 1){ + exp_offset = 1; + v>>=1; + } + return av_normalize_sf(av_normalize1_sf((SoftFloat){v, ONE_BITS + 1 - frac_bits + exp_offset})); +} + +/** + * Converts a SoftFloat to an integer. + * Rounding is to -inf. + */ +static inline av_const int av_sf2int(SoftFloat v, int frac_bits){ + v.exp += frac_bits - (ONE_BITS + 1); + if(v.exp >= 0) return v.mant << v.exp ; + else return v.mant >>(-v.exp); +} + +/** + * Rounding-to-nearest used. + */ +static av_always_inline SoftFloat av_sqrt_sf(SoftFloat val) +{ + int tabIndex, rem; + + if (val.mant == 0) + val.exp = MIN_EXP; + else if (val.mant < 0) + abort(); + else + { + tabIndex = (val.mant - 0x20000000) >> 20; + + rem = val.mant & 0xFFFFF; + val.mant = (int)(((int64_t)av_sqrttbl_sf[tabIndex] * (0x100000 - rem) + + (int64_t)av_sqrttbl_sf[tabIndex + 1] * rem + + 0x80000) >> 20); + val.mant = (int)(((int64_t)av_sqr_exp_multbl_sf[val.exp & 1] * val.mant + + 0x10000000) >> 29); + + if (val.mant < 0x40000000) + val.exp -= 2; + else + val.mant >>= 1; + + val.exp = (val.exp >> 1) + 1; + } + + return val; +} + +/** + * Rounding-to-nearest used. + * + * @param a angle in units of (1ULL<<30)/M_PI radians + * @param s pointer to where sine in units of (1<<30) is returned + * @param c pointer to where cosine in units of (1<<30) is returned + */ +static av_unused void av_sincos_sf(int a, int *s, int *c) +{ + int idx, sign; + int sv, cv; + int st, ct; + + idx = a >> 26; + sign = (int32_t)((unsigned)idx << 27) >> 31; + cv = av_costbl_1_sf[idx & 0xf]; + cv = (cv ^ sign) - sign; + + idx -= 8; + sign = (int32_t)((unsigned)idx << 27) >> 31; + sv = av_costbl_1_sf[idx & 0xf]; + sv = (sv ^ sign) - sign; + + idx = a >> 21; + ct = av_costbl_2_sf[idx & 0x1f]; + st = av_sintbl_2_sf[idx & 0x1f]; + + idx = (int)(((int64_t)cv * ct - (int64_t)sv * st + 0x20000000) >> 30); + + sv = (int)(((int64_t)cv * st + (int64_t)sv * ct + 0x20000000) >> 30); + + cv = idx; + + idx = a >> 16; + ct = av_costbl_3_sf[idx & 0x1f]; + st = av_sintbl_3_sf[idx & 0x1f]; + + idx = (int)(((int64_t)cv * ct - (int64_t)sv * st + 0x20000000) >> 30); + + sv = (int)(((int64_t)cv * st + (int64_t)sv * ct + 0x20000000) >> 30); + cv = idx; + + idx = a >> 11; + + ct = (int)(((int64_t)av_costbl_4_sf[idx & 0x1f] * (0x800 - (a & 0x7ff)) + + (int64_t)av_costbl_4_sf[(idx & 0x1f)+1]*(a & 0x7ff) + + 0x400) >> 11); + st = (int)(((int64_t)av_sintbl_4_sf[idx & 0x1f] * (0x800 - (a & 0x7ff)) + + (int64_t)av_sintbl_4_sf[(idx & 0x1f) + 1] * (a & 0x7ff) + + 0x400) >> 11); + + *c = (int)(((int64_t)cv * ct - (int64_t)sv * st + 0x20000000) >> 30); + + *s = (int)(((int64_t)cv * st + (int64_t)sv * ct + 0x20000000) >> 30); +} + +#endif /* AVUTIL_SOFTFLOAT_H */ diff --git a/include/libavutil/softfloat_ieee754.h b/include/libavutil/softfloat_ieee754.h new file mode 100644 index 0000000..3398aa1 --- /dev/null +++ b/include/libavutil/softfloat_ieee754.h @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2016 Umair Khan + * + * 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 AVUTIL_SOFTFLOAT_IEEE754_H +#define AVUTIL_SOFTFLOAT_IEEE754_H + +#include + +#define EXP_BIAS 127 +#define MANT_BITS 23 + +typedef struct SoftFloat_IEEE754 { + int32_t sign; + uint64_t mant; + int32_t exp; +} SoftFloat_IEEE754; + +static const SoftFloat_IEEE754 FLOAT_0 = {0, 0, -126}; +static const SoftFloat_IEEE754 FLOAT_1 = {0, 0, 0}; + +/** Normalize the softfloat as defined by IEEE 754 single-recision floating + * point specification + */ +static inline SoftFloat_IEEE754 av_normalize_sf_ieee754(SoftFloat_IEEE754 sf) { + while( sf.mant >= 0x1000000UL ) { + sf.exp++; + sf.mant >>= 1; + } + sf.mant &= 0x007fffffUL; + return sf; +} + +/** Convert integer to softfloat. + * @return softfloat with value n * 2^e + */ +static inline SoftFloat_IEEE754 av_int2sf_ieee754(int64_t n, int e) { + int sign = 0; + + if (n < 0) { + sign = 1; + n *= -1; + } + return av_normalize_sf_ieee754((SoftFloat_IEEE754) {sign, n << MANT_BITS, 0 + e}); +} + +/** Make a softfloat out of the bitstream. Assumes the bits are in the form as defined + * by the IEEE 754 spec. + */ +static inline SoftFloat_IEEE754 av_bits2sf_ieee754(uint32_t n) { + return ((SoftFloat_IEEE754) { (n & 0x80000000UL) >> 31, (n & 0x7FFFFFUL), (int8_t)((n & 0x7F800000UL) >> 23)}); +} + +/** Convert the softfloat to integer + */ +static inline int av_sf2int_ieee754(SoftFloat_IEEE754 a) { + if(a.exp >= 0) return a.mant << a.exp ; + else return a.mant >>(-a.exp); +} + +/** Divide a by b. b should not be zero. + * @return normalized result + */ +static inline SoftFloat_IEEE754 av_div_sf_ieee754(SoftFloat_IEEE754 a, SoftFloat_IEEE754 b) { + int32_t mant, exp, sign; + a = av_normalize_sf_ieee754(a); + b = av_normalize_sf_ieee754(b); + sign = a.sign ^ b.sign; + mant = ((((uint64_t) (a.mant | 0x00800000UL)) << MANT_BITS) / (b.mant| 0x00800000UL)); + exp = a.exp - b.exp; + return av_normalize_sf_ieee754((SoftFloat_IEEE754) {sign, mant, exp}); +} + +/** Multiply a with b + * #return normalized result + */ +static inline SoftFloat_IEEE754 av_mul_sf_ieee754(SoftFloat_IEEE754 a, SoftFloat_IEEE754 b) { + int32_t sign, mant, exp; + a = av_normalize_sf_ieee754(a); + b = av_normalize_sf_ieee754(b); + sign = a.sign ^ b.sign; + mant = (((uint64_t)(a.mant|0x00800000UL) * (uint64_t)(b.mant|0x00800000UL))>>MANT_BITS); + exp = a.exp + b.exp; + return av_normalize_sf_ieee754((SoftFloat_IEEE754) {sign, mant, exp}); +} + +/** Compare a with b strictly + * @returns 1 if the a and b are equal, 0 otherwise. + */ +static inline int av_cmp_sf_ieee754(SoftFloat_IEEE754 a, SoftFloat_IEEE754 b) { + a = av_normalize_sf_ieee754(a); + b = av_normalize_sf_ieee754(b); + if (a.sign != b.sign) return 0; + if (a.mant != b.mant) return 0; + if (a.exp != b.exp ) return 0; + return 1; +} + +#endif /*AVUTIL_SOFTFLOAT_IEEE754_H*/ diff --git a/include/libavutil/softfloat_tables.h b/include/libavutil/softfloat_tables.h new file mode 100644 index 0000000..461f2b2 --- /dev/null +++ b/include/libavutil/softfloat_tables.h @@ -0,0 +1,262 @@ +/* + * Copyright (c) 2012 + * MIPS Technologies, Inc., California. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the MIPS Technologies, Inc., nor the names of is + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE MIPS TECHNOLOGIES, INC. BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * Author: Stanislav Ocovaj (stanislav.ocovaj imgtec com) + * + * 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 AVUTIL_SOFTFLOAT_TABLES_H +#define AVUTIL_SOFTFLOAT_TABLES_H + +#include + +static const int32_t av_sqrttbl_sf[512+1] = { /* sqrt(x), 0.5<=x<1 */ + 0x2d413ccd,0x2d4c8bb3,0x2d57d7c6,0x2d63210a, + 0x2d6e677f,0x2d79ab2a,0x2d84ec0b,0x2d902a23, + 0x2d9b6578,0x2da69e08,0x2db1d3d6,0x2dbd06e6, + 0x2dc83738,0x2dd364ce,0x2dde8fac,0x2de9b7d2, + 0x2df4dd43,0x2e000000,0x2e0b200c,0x2e163d68, + 0x2e215816,0x2e2c701a,0x2e378573,0x2e429824, + 0x2e4da830,0x2e58b598,0x2e63c05d,0x2e6ec883, + 0x2e79ce0a,0x2e84d0f5,0x2e8fd144,0x2e9acefb, + 0x2ea5ca1b,0x2eb0c2a7,0x2ebbb89e,0x2ec6ac04, + 0x2ed19cda,0x2edc8b23,0x2ee776df,0x2ef26012, + 0x2efd46bb,0x2f082add,0x2f130c7b,0x2f1deb95, + 0x2f28c82e,0x2f33a246,0x2f3e79e1,0x2f494eff, + 0x2f5421a3,0x2f5ef1ce,0x2f69bf81,0x2f748abe, + 0x2f7f5388,0x2f8a19e0,0x2f94ddc7,0x2f9f9f3e, + 0x2faa5e48,0x2fb51ae8,0x2fbfd51c,0x2fca8ce9, + 0x2fd5424e,0x2fdff54e,0x2feaa5eb,0x2ff55426, + 0x30000000,0x300aa97b,0x3015509a,0x301ff55c, + 0x302a97c5,0x303537d5,0x303fd58e,0x304a70f2, + 0x30550a01,0x305fa0be,0x306a352a,0x3074c747, + 0x307f5716,0x3089e499,0x30946fd2,0x309ef8c0, + 0x30a97f67,0x30b403c7,0x30be85e2,0x30c905bb, + 0x30d38351,0x30ddfea6,0x30e877bc,0x30f2ee96, + 0x30fd6332,0x3107d594,0x311245bc,0x311cb3ad, + 0x31271f67,0x313188ec,0x313bf03d,0x3146555c, + 0x3150b84a,0x315b1909,0x31657798,0x316fd3fc, + 0x317a2e34,0x31848642,0x318edc28,0x31992fe5, + 0x31a3817d,0x31add0f0,0x31b81e40,0x31c2696e, + 0x31ccb27b,0x31d6f969,0x31e13e38,0x31eb80eb, + 0x31f5c182,0x32000000,0x320a3c65,0x321476b1, + 0x321eaee8,0x3228e50a,0x32331917,0x323d4b13, + 0x32477afc,0x3251a8d6,0x325bd4a2,0x3265fe5f, + 0x32702611,0x327a4bb8,0x32846f55,0x328e90e9, + 0x3298b076,0x32a2cdfd,0x32ace97e,0x32b702fd, + 0x32c11a79,0x32cb2ff3,0x32d5436d,0x32df54e9, + 0x32e96466,0x32f371e8,0x32fd7d6d,0x330786f9, + 0x33118e8c,0x331b9426,0x332597cb,0x332f9979, + 0x33399933,0x334396fa,0x334d92cf,0x33578cb2, + 0x336184a6,0x336b7aab,0x33756ec3,0x337f60ed, + 0x3389512d,0x33933f83,0x339d2bef,0x33a71672, + 0x33b0ff10,0x33bae5c7,0x33c4ca99,0x33cead88, + 0x33d88e95,0x33e26dbf,0x33ec4b09,0x33f62673, + 0x34000000,0x3409d7af,0x3413ad82,0x341d817a, + 0x34275397,0x343123db,0x343af248,0x3444bedd, + 0x344e899d,0x34585288,0x3462199f,0x346bdee3, + 0x3475a254,0x347f63f5,0x348923c6,0x3492e1c9, + 0x349c9dfe,0x34a65865,0x34b01101,0x34b9c7d2, + 0x34c37cda,0x34cd3018,0x34d6e18f,0x34e0913f, + 0x34ea3f29,0x34f3eb4d,0x34fd95ae,0x35073e4c, + 0x3510e528,0x351a8a43,0x35242d9d,0x352dcf39, + 0x35376f16,0x35410d36,0x354aa99a,0x35544442, + 0x355ddd2f,0x35677463,0x357109df,0x357a9da2, + 0x35842fb0,0x358dc007,0x35974ea9,0x35a0db98, + 0x35aa66d3,0x35b3f05c,0x35bd7833,0x35c6fe5a, + 0x35d082d3,0x35da059c,0x35e386b7,0x35ed0626, + 0x35f683e8,0x36000000,0x36097a6e,0x3612f331, + 0x361c6a4d,0x3625dfc1,0x362f538f,0x3638c5b7, + 0x36423639,0x364ba518,0x36551252,0x365e7deb, + 0x3667e7e2,0x36715039,0x367ab6f0,0x36841c07, + 0x368d7f81,0x3696e15d,0x36a0419d,0x36a9a040, + 0x36b2fd49,0x36bc58b8,0x36c5b28e,0x36cf0acb, + 0x36d86170,0x36e1b680,0x36eb09f8,0x36f45bdc, + 0x36fdac2b,0x3706fae7,0x37104810,0x371993a7, + 0x3722ddad,0x372c2622,0x37356d08,0x373eb25f, + 0x3747f629,0x37513865,0x375a7914,0x3763b838, + 0x376cf5d0,0x377631e0,0x377f6c64,0x3788a561, + 0x3791dcd6,0x379b12c4,0x37a4472c,0x37ad7a0e, + 0x37b6ab6a,0x37bfdb44,0x37c90999,0x37d2366d, + 0x37db61be,0x37e48b8e,0x37edb3de,0x37f6daae, + 0x38000000,0x380923d3,0x3812462a,0x381b6703, + 0x38248660,0x382da442,0x3836c0aa,0x383fdb97, + 0x3848f50c,0x38520d09,0x385b238d,0x3864389b, + 0x386d4c33,0x38765e55,0x387f6f01,0x38887e3b, + 0x38918c00,0x389a9853,0x38a3a334,0x38acaca3, + 0x38b5b4a3,0x38bebb32,0x38c7c051,0x38d0c402, + 0x38d9c645,0x38e2c71b,0x38ebc685,0x38f4c482, + 0x38fdc114,0x3906bc3c,0x390fb5fa,0x3918ae4f, + 0x3921a53a,0x392a9abe,0x39338edb,0x393c8192, + 0x394572e2,0x394e62ce,0x39575155,0x39603e77, + 0x39692a36,0x39721494,0x397afd8f,0x3983e527, + 0x398ccb60,0x3995b039,0x399e93b2,0x39a775cc, + 0x39b05689,0x39b935e8,0x39c213e9,0x39caf08e, + 0x39d3cbd9,0x39dca5c7,0x39e57e5b,0x39ee5596, + 0x39f72b77,0x3a000000,0x3a08d331,0x3a11a50a, + 0x3a1a758d,0x3a2344ba,0x3a2c1291,0x3a34df13, + 0x3a3daa41,0x3a46741b,0x3a4f3ca3,0x3a5803d7, + 0x3a60c9ba,0x3a698e4b,0x3a72518b,0x3a7b137c, + 0x3a83d41d,0x3a8c936f,0x3a955173,0x3a9e0e29, + 0x3aa6c992,0x3aaf83ae,0x3ab83c7e,0x3ac0f403, + 0x3ac9aa3c,0x3ad25f2c,0x3adb12d1,0x3ae3c52d, + 0x3aec7642,0x3af5260e,0x3afdd492,0x3b0681d0, + 0x3b0f2dc6,0x3b17d878,0x3b2081e4,0x3b292a0c, + 0x3b31d0f0,0x3b3a7690,0x3b431aec,0x3b4bbe06, + 0x3b545fdf,0x3b5d0077,0x3b659fcd,0x3b6e3de4, + 0x3b76daba,0x3b7f7651,0x3b8810aa,0x3b90a9c4, + 0x3b9941a1,0x3ba1d842,0x3baa6da5,0x3bb301cd, + 0x3bbb94b9,0x3bc4266a,0x3bccb6e2,0x3bd5461f, + 0x3bddd423,0x3be660ee,0x3beeec81,0x3bf776dc, + 0x3c000000,0x3c0887ed,0x3c110ea4,0x3c199426, + 0x3c221872,0x3c2a9b8a,0x3c331d6e,0x3c3b9e1d, + 0x3c441d9a,0x3c4c9be5,0x3c5518fd,0x3c5d94e3, + 0x3c660f98,0x3c6e891d,0x3c770172,0x3c7f7898, + 0x3c87ee8e,0x3c906356,0x3c98d6ef,0x3ca1495b, + 0x3ca9ba9a,0x3cb22aac,0x3cba9992,0x3cc3074c, + 0x3ccb73dc,0x3cd3df41,0x3cdc497b,0x3ce4b28c, + 0x3ced1a73,0x3cf58132,0x3cfde6c8,0x3d064b37, + 0x3d0eae7f,0x3d17109f,0x3d1f719a,0x3d27d16e, + 0x3d30301d,0x3d388da8,0x3d40ea0d,0x3d49454f, + 0x3d519f6d,0x3d59f867,0x3d625040,0x3d6aa6f6, + 0x3d72fc8b,0x3d7b50fe,0x3d83a451,0x3d8bf683, + 0x3d944796,0x3d9c9788,0x3da4e65c,0x3dad3412, + 0x3db580a9,0x3dbdcc24,0x3dc61680,0x3dce5fc0, + 0x3dd6a7e4,0x3ddeeeed,0x3de734d9,0x3def79ab, + 0x3df7bd62,0x3e000000,0x3e084184,0x3e1081ee, + 0x3e18c140,0x3e20ff7a,0x3e293c9c,0x3e3178a7, + 0x3e39b39a,0x3e41ed77,0x3e4a263d,0x3e525def, + 0x3e5a948b,0x3e62ca12,0x3e6afe85,0x3e7331e4, + 0x3e7b642f,0x3e839567,0x3e8bc58c,0x3e93f49f, + 0x3e9c22a1,0x3ea44f91,0x3eac7b6f,0x3eb4a63e, + 0x3ebccffb,0x3ec4f8aa,0x3ecd2049,0x3ed546d9, + 0x3edd6c5a,0x3ee590cd,0x3eedb433,0x3ef5d68c, + 0x3efdf7d7,0x3f061816,0x3f0e3749,0x3f165570, + 0x3f1e728c,0x3f268e9d,0x3f2ea9a4,0x3f36c3a0, + 0x3f3edc93,0x3f46f47c,0x3f4f0b5d,0x3f572135, + 0x3f5f3606,0x3f6749cf,0x3f6f5c90,0x3f776e4a, + 0x3f7f7efe,0x3f878eab,0x3f8f9d53,0x3f97aaf6, + 0x3f9fb793,0x3fa7c32c,0x3fafcdc1,0x3fb7d752, + 0x3fbfdfe0,0x3fc7e76b,0x3fcfedf3,0x3fd7f378, + 0x3fdff7fc,0x3fe7fb7f,0x3feffe00,0x3ff7ff80, + 0x3fffffff, +}; + +static const int32_t av_sqr_exp_multbl_sf[2] = { + 0x20000000,0x2d413ccd, +}; + +static const int32_t av_costbl_1_sf[16] = { + 0x40000000,0x3ec52fa0,0x3b20d79e,0x3536cc52, + 0x2d413ccd,0x238e7673,0x187de2a7,0x0c7c5c1e, + 0x00000000,0xf383a3e3,0xe7821d5a,0xdc71898e, + 0xd2bec334,0xcac933af,0xc4df2863,0xc13ad061, +}; + +static const int32_t av_costbl_2_sf[32] = { + 0x40000000,0x3fffb10b,0x3ffec42d,0x3ffd3969, + 0x3ffb10c1,0x3ff84a3c,0x3ff4e5e0,0x3ff0e3b6, + 0x3fec43c7,0x3fe7061f,0x3fe12acb,0x3fdab1d9, + 0x3fd39b5a,0x3fcbe75e,0x3fc395f9,0x3fbaa740, + 0x3fb11b48,0x3fa6f228,0x3f9c2bfb,0x3f90c8da, + 0x3f84c8e2,0x3f782c30,0x3f6af2e3,0x3f5d1d1d, + 0x3f4eaafe,0x3f3f9cab,0x3f2ff24a,0x3f1fabff, + 0x3f0ec9f5,0x3efd4c54,0x3eeb3347,0x3ed87efc, +}; + +static const int32_t av_sintbl_2_sf[32] = { + 0x00000000,0x006487c4,0x00c90e90,0x012d936c, + 0x0192155f,0x01f69373,0x025b0caf,0x02bf801a, + 0x0323ecbe,0x038851a2,0x03ecadcf,0x0451004d, + 0x04b54825,0x0519845e,0x057db403,0x05e1d61b, + 0x0645e9af,0x06a9edc9,0x070de172,0x0771c3b3, + 0x07d59396,0x08395024,0x089cf867,0x09008b6a, + 0x09640837,0x09c76dd8,0x0a2abb59,0x0a8defc3, + 0x0af10a22,0x0b540982,0x0bb6ecef,0x0c19b374, +}; + +static const int32_t av_costbl_3_sf[32] = { + 0x40000000,0x3fffffec,0x3fffffb1,0x3fffff4e, + 0x3ffffec4,0x3ffffe13,0x3ffffd39,0x3ffffc39, + 0x3ffffb11,0x3ffff9c1,0x3ffff84a,0x3ffff6ac, + 0x3ffff4e6,0x3ffff2f8,0x3ffff0e3,0x3fffeea7, + 0x3fffec43,0x3fffe9b7,0x3fffe705,0x3fffe42a, + 0x3fffe128,0x3fffddff,0x3fffdaae,0x3fffd736, + 0x3fffd396,0x3fffcfcf,0x3fffcbe0,0x3fffc7ca, + 0x3fffc38c,0x3fffbf27,0x3fffba9b,0x3fffb5e7, +}; + +static const int32_t av_sintbl_3_sf[32] = { + 0x00000000,0x0003243f,0x0006487f,0x00096cbe, + 0x000c90fe,0x000fb53d,0x0012d97c,0x0015fdbb, + 0x001921fb,0x001c463a,0x001f6a79,0x00228eb8, + 0x0025b2f7,0x0028d736,0x002bfb74,0x002f1fb3, + 0x003243f1,0x00356830,0x00388c6e,0x003bb0ac, + 0x003ed4ea,0x0041f928,0x00451d66,0x004841a3, + 0x004b65e1,0x004e8a1e,0x0051ae5b,0x0054d297, + 0x0057f6d4,0x005b1b10,0x005e3f4c,0x00616388, +}; + +static const int32_t av_costbl_4_sf[33] = { + 0x40000000,0x40000000,0x40000000,0x40000000, + 0x40000000,0x40000000,0x3fffffff,0x3fffffff, + 0x3fffffff,0x3ffffffe,0x3ffffffe,0x3ffffffe, + 0x3ffffffd,0x3ffffffd,0x3ffffffc,0x3ffffffc, + 0x3ffffffb,0x3ffffffa,0x3ffffffa,0x3ffffff9, + 0x3ffffff8,0x3ffffff7,0x3ffffff7,0x3ffffff6, + 0x3ffffff5,0x3ffffff4,0x3ffffff3,0x3ffffff2, + 0x3ffffff1,0x3ffffff0,0x3fffffef,0x3fffffed, + 0x3fffffec, +}; + +static const int32_t av_sintbl_4_sf[33] = { + 0x00000000,0x00001922,0x00003244,0x00004b66, + 0x00006488,0x00007daa,0x000096cc,0x0000afee, + 0x0000c910,0x0000e232,0x0000fb54,0x00011476, + 0x00012d98,0x000146ba,0x00015fdc,0x000178fe, + 0x00019220,0x0001ab42,0x0001c464,0x0001dd86, + 0x0001f6a8,0x00020fca,0x000228ec,0x0002420e, + 0x00025b30,0x00027452,0x00028d74,0x0002a696, + 0x0002bfb7,0x0002d8d9,0x0002f1fb,0x00030b1d, + 0x0003243f, +}; +#endif /* AVUTIL_SOFTFLOAT_TABLES_H */ diff --git a/include/libavutil/spherical.h b/include/libavutil/spherical.h index cef759c..2e90f77 100644 --- a/include/libavutil/spherical.h +++ b/include/libavutil/spherical.h @@ -20,6 +20,7 @@ /** * @file + * @ingroup lavu_video_spherical * Spherical video */ @@ -30,19 +31,14 @@ #include /** - * @addtogroup lavu_video - * @{ - * * @defgroup lavu_video_spherical Spherical video mapping - * @{ - */ - -/** - * @addtogroup lavu_video_spherical + * @ingroup lavu_video + * * A spherical video file contains surfaces that need to be mapped onto a * sphere. Depending on how the frame was converted, a different distortion * transformation or surface recomposition function needs to be applied before * the video should be mapped and displayed. + * @{ */ /** @@ -70,6 +66,22 @@ enum AVSphericalProjection { * the position of the current video in a larger surface. */ AV_SPHERICAL_EQUIRECTANGULAR_TILE, + + /** + * Video frame displays as a 180 degree equirectangular projection. + */ + AV_SPHERICAL_HALF_EQUIRECTANGULAR, + + /** + * Video frame displays on a flat, rectangular 2D surface. + */ + AV_SPHERICAL_RECTILINEAR, + + /** + * Fisheye projection (Apple). + * See: https://developer.apple.com/documentation/coremedia/cmprojectiontype/fisheye + */ + AV_SPHERICAL_FISHEYE, }; /** @@ -225,7 +237,6 @@ const char *av_spherical_projection_name(enum AVSphericalProjection projection); */ int av_spherical_from_name(const char *name); /** - * @} * @} */ diff --git a/include/libavutil/stereo3d.h b/include/libavutil/stereo3d.h index d421aac..c0a4ab3 100755 --- a/include/libavutil/stereo3d.h +++ b/include/libavutil/stereo3d.h @@ -20,6 +20,7 @@ /** * @file + * @ingroup lavu_video_stereo3d * Stereoscopic video */ @@ -31,19 +32,15 @@ #include "frame.h" /** - * @addtogroup lavu_video - * @{ - * * @defgroup lavu_video_stereo3d Stereo3D types and functions - * @{ - */ - -/** - * @addtogroup lavu_video_stereo3d + * @ingroup lavu_video + * * A stereoscopic video file consists in multiple views embedded in a single * frame, usually describing two views of a scene. This file describes all * possible codec-independent view arrangements. - * */ + * + * @{ + */ /** * List of possible 3D Types @@ -139,6 +136,11 @@ enum AVStereo3DType { * @endcode */ AV_STEREO3D_COLUMNS, + + /** + * Video is stereoscopic but the packing is unspecified. + */ + AV_STEREO3D_UNSPEC, }; /** @@ -159,6 +161,31 @@ enum AVStereo3DView { * Frame contains only the right view. */ AV_STEREO3D_VIEW_RIGHT, + + /** + * Content is unspecified. + */ + AV_STEREO3D_VIEW_UNSPEC, +}; + +/** + * List of possible primary eyes. + */ +enum AVStereo3DPrimaryEye { + /** + * Neither eye. + */ + AV_PRIMARY_EYE_NONE, + + /** + * Left eye. + */ + AV_PRIMARY_EYE_LEFT, + + /** + * Right eye + */ + AV_PRIMARY_EYE_RIGHT, }; /** @@ -188,6 +215,28 @@ typedef struct AVStereo3D { * Determines which views are packed. */ enum AVStereo3DView view; + + /** + * Which eye is the primary eye when rendering in 2D. + */ + enum AVStereo3DPrimaryEye primary_eye; + + /** + * The distance between the centres of the lenses of the camera system, + * in micrometers. Zero if unset. + */ + uint32_t baseline; + + /** + * Relative shift of the left and right images, which changes the zero parallax plane. + * Range is -1.0 to 1.0. Zero if unset. + */ + AVRational horizontal_disparity_adjustment; + + /** + * Horizontal field of view, in degrees. Zero if unset. + */ + AVRational horizontal_field_of_view; } AVStereo3D; /** @@ -198,6 +247,14 @@ typedef struct AVStereo3D { */ AVStereo3D *av_stereo3d_alloc(void); +/** + * Allocate an AVStereo3D structure and set its fields to default values. + * The resulting struct can be freed using av_freep(). + * + * @return An AVStereo3D filled with default values or NULL on failure. + */ +AVStereo3D *av_stereo3d_alloc_size(size_t *size); + /** * Allocate a complete AVFrameSideData and add it to the frame. * @@ -226,7 +283,42 @@ const char *av_stereo3d_type_name(unsigned int type); int av_stereo3d_from_name(const char *name); /** - * @} + * Provide a human-readable name of a given stereo3d view. + * + * @param type The input stereo3d view value. + * + * @return The name of the stereo3d view value, or "unknown". + */ +const char *av_stereo3d_view_name(unsigned int view); + +/** + * Get the AVStereo3DView form a human-readable name. + * + * @param name The input string. + * + * @return The AVStereo3DView value, or -1 if not found. + */ +int av_stereo3d_view_from_name(const char *name); + +/** + * Provide a human-readable name of a given stereo3d primary eye. + * + * @param type The input stereo3d primary eye value. + * + * @return The name of the stereo3d primary eye value, or "unknown". + */ +const char *av_stereo3d_primary_eye_name(unsigned int eye); + +/** + * Get the AVStereo3DPrimaryEye form a human-readable name. + * + * @param name The input string. + * + * @return The AVStereo3DPrimaryEye value, or -1 if not found. + */ +int av_stereo3d_primary_eye_from_name(const char *name); + +/** * @} */ diff --git a/include/libavutil/tablegen.h b/include/libavutil/tablegen.h new file mode 100644 index 0000000..02acdd6 --- /dev/null +++ b/include/libavutil/tablegen.h @@ -0,0 +1,55 @@ +/* + * 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 + */ + +/** + * @file + * Compatibility libm for table generation files + */ + +#ifndef AVUTIL_TABLEGEN_H +#define AVUTIL_TABLEGEN_H + +#include + +// we lack some functions on all host platforms, and we don't care about +// performance and/or strict ISO C semantics as it's performed at build time +static inline double ff_cbrt(double x) +{ + return x < 0 ? -pow(-x, 1.0 / 3.0) : pow(x, 1.0 / 3.0); +} +#define cbrt ff_cbrt + +static inline double ff_rint(double x) +{ + return x >= 0 ? floor(x + 0.5) : ceil(x - 0.5); +} +#define rint ff_rint + +static inline long long ff_llrint(double x) +{ + return rint(x); +} +#define llrint ff_llrint + +static inline long ff_lrint(double x) +{ + return rint(x); +} +#define lrint ff_lrint + +#endif /* AVUTIL_TABLEGEN_H */ diff --git a/include/libavutil/thread.h b/include/libavutil/thread.h new file mode 100644 index 0000000..2c00c7c --- /dev/null +++ b/include/libavutil/thread.h @@ -0,0 +1,239 @@ +/* + * 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 + */ + +// This header should only be used to simplify code where +// threading is optional, not as a generic threading abstraction. + +#ifndef AVUTIL_THREAD_H +#define AVUTIL_THREAD_H + +#include "config.h" + +#if HAVE_PRCTL +#include +#elif (HAVE_PTHREAD_SETNAME_NP || HAVE_PTHREAD_SET_NAME_NP) && HAVE_PTHREAD_NP_H +#include +#endif + +#include "error.h" + +#if HAVE_PTHREADS || HAVE_W32THREADS || HAVE_OS2THREADS + +#if HAVE_PTHREADS +#include + +#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1 + +#include + +#include "log.h" +#include "macros.h" + +#define ASSERT_PTHREAD_ABORT(func, ret) do { \ + char errbuf[AV_ERROR_MAX_STRING_SIZE] = ""; \ + av_log(NULL, AV_LOG_FATAL, AV_STRINGIFY(func) \ + " failed with error: %s\n", \ + av_make_error_string(errbuf, AV_ERROR_MAX_STRING_SIZE, \ + AVERROR(ret))); \ + abort(); \ +} while (0) + +#define ASSERT_PTHREAD_NORET(func, ...) do { \ + int ret = func(__VA_ARGS__); \ + if (ret) \ + ASSERT_PTHREAD_ABORT(func, ret); \ +} while (0) + +#define ASSERT_PTHREAD(func, ...) do { \ + ASSERT_PTHREAD_NORET(func, __VA_ARGS__); \ + return 0; \ +} while (0) + +static inline int strict_pthread_join(pthread_t thread, void **value_ptr) +{ + ASSERT_PTHREAD(pthread_join, thread, value_ptr); +} + +static inline int strict_pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr) +{ + if (attr) { + ASSERT_PTHREAD_NORET(pthread_mutex_init, mutex, attr); + } else { + pthread_mutexattr_t local_attr; + ASSERT_PTHREAD_NORET(pthread_mutexattr_init, &local_attr); + ASSERT_PTHREAD_NORET(pthread_mutexattr_settype, &local_attr, PTHREAD_MUTEX_ERRORCHECK); + ASSERT_PTHREAD_NORET(pthread_mutex_init, mutex, &local_attr); + ASSERT_PTHREAD_NORET(pthread_mutexattr_destroy, &local_attr); + } + return 0; +} + +static inline int strict_pthread_mutex_destroy(pthread_mutex_t *mutex) +{ + ASSERT_PTHREAD(pthread_mutex_destroy, mutex); +} + +static inline int strict_pthread_mutex_lock(pthread_mutex_t *mutex) +{ + ASSERT_PTHREAD(pthread_mutex_lock, mutex); +} + +static inline int strict_pthread_mutex_unlock(pthread_mutex_t *mutex) +{ + ASSERT_PTHREAD(pthread_mutex_unlock, mutex); +} + +static inline int strict_pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr) +{ + ASSERT_PTHREAD(pthread_cond_init, cond, attr); +} + +static inline int strict_pthread_cond_destroy(pthread_cond_t *cond) +{ + ASSERT_PTHREAD(pthread_cond_destroy, cond); +} + +static inline int strict_pthread_cond_signal(pthread_cond_t *cond) +{ + ASSERT_PTHREAD(pthread_cond_signal, cond); +} + +static inline int strict_pthread_cond_broadcast(pthread_cond_t *cond) +{ + ASSERT_PTHREAD(pthread_cond_broadcast, cond); +} + +static inline int strict_pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) +{ + ASSERT_PTHREAD(pthread_cond_wait, cond, mutex); +} + +static inline int strict_pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, + const struct timespec *abstime) +{ + int ret = pthread_cond_timedwait(cond, mutex, abstime); + if (ret && ret != ETIMEDOUT) + ASSERT_PTHREAD_ABORT(pthread_cond_timedwait, ret); + return ret; +} + +static inline int strict_pthread_once(pthread_once_t *once_control, void (*init_routine)(void)) +{ + ASSERT_PTHREAD(pthread_once, once_control, init_routine); +} + +#define pthread_join strict_pthread_join +#define pthread_mutex_init strict_pthread_mutex_init +#define pthread_mutex_destroy strict_pthread_mutex_destroy +#define pthread_mutex_lock strict_pthread_mutex_lock +#define pthread_mutex_unlock strict_pthread_mutex_unlock +#define pthread_cond_init strict_pthread_cond_init +#define pthread_cond_destroy strict_pthread_cond_destroy +#define pthread_cond_signal strict_pthread_cond_signal +#define pthread_cond_broadcast strict_pthread_cond_broadcast +#define pthread_cond_wait strict_pthread_cond_wait +#define pthread_cond_timedwait strict_pthread_cond_timedwait +#define pthread_once strict_pthread_once +#endif + +#elif HAVE_OS2THREADS +#include "compat/os2threads.h" +#else +#include "compat/w32pthreads.h" +#endif + +#define AVMutex pthread_mutex_t +#define AV_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER + +#define ff_mutex_init pthread_mutex_init +#define ff_mutex_lock pthread_mutex_lock +#define ff_mutex_unlock pthread_mutex_unlock +#define ff_mutex_destroy pthread_mutex_destroy + +#define AVCond pthread_cond_t + +#define ff_cond_init pthread_cond_init +#define ff_cond_destroy pthread_cond_destroy +#define ff_cond_signal pthread_cond_signal +#define ff_cond_broadcast pthread_cond_broadcast +#define ff_cond_wait pthread_cond_wait +#define ff_cond_timedwait pthread_cond_timedwait + +#define AVOnce pthread_once_t +#define AV_ONCE_INIT PTHREAD_ONCE_INIT + +#define ff_thread_once(control, routine) pthread_once(control, routine) + +#else + +#define AVMutex char +#define AV_MUTEX_INITIALIZER 0 + +static inline int ff_mutex_init(AVMutex *mutex, const void *attr){ return 0; } +static inline int ff_mutex_lock(AVMutex *mutex){ return 0; } +static inline int ff_mutex_unlock(AVMutex *mutex){ return 0; } +static inline int ff_mutex_destroy(AVMutex *mutex){ return 0; } + +#define AVCond char + +static inline int ff_cond_init(AVCond *cond, const void *attr){ return 0; } +static inline int ff_cond_destroy(AVCond *cond){ return 0; } +static inline int ff_cond_signal(AVCond *cond){ return 0; } +static inline int ff_cond_broadcast(AVCond *cond){ return 0; } +static inline int ff_cond_wait(AVCond *cond, AVMutex *mutex){ return 0; } +static inline int ff_cond_timedwait(AVCond *cond, AVMutex *mutex, + const void *abstime){ return 0; } + +#define AVOnce char +#define AV_ONCE_INIT 0 + +static inline int ff_thread_once(char *control, void (*routine)(void)) +{ + if (!*control) { + routine(); + *control = 1; + } + return 0; +} + +#endif + +static inline int ff_thread_setname(const char *name) +{ + int ret = 0; + +#if HAVE_PRCTL + ret = AVERROR(prctl(PR_SET_NAME, name)); +#elif HAVE_PTHREAD_SETNAME_NP +#if defined(__APPLE__) + ret = AVERROR(pthread_setname_np(name)); +#elif defined(__NetBSD__) + ret = AVERROR(pthread_setname_np(pthread_self(), "%s", name)); +#else + ret = AVERROR(pthread_setname_np(pthread_self(), name)); +#endif +#elif HAVE_PTHREAD_SET_NAME_NP + pthread_set_name_np(pthread_self(), name); +#else + ret = AVERROR(ENOSYS); +#endif + + return ret; +} + +#endif /* AVUTIL_THREAD_H */ diff --git a/include/libavutil/time_internal.h b/include/libavutil/time_internal.h new file mode 100644 index 0000000..d0f007a --- /dev/null +++ b/include/libavutil/time_internal.h @@ -0,0 +1,49 @@ +/* + * 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 AVUTIL_TIME_INTERNAL_H +#define AVUTIL_TIME_INTERNAL_H + +#include +#include "config.h" + +#if !HAVE_GMTIME_R && !defined(gmtime_r) +static inline struct tm *ff_gmtime_r(const time_t* clock, struct tm *result) +{ + struct tm *ptr = gmtime(clock); + if (!ptr) + return NULL; + *result = *ptr; + return result; +} +#define gmtime_r ff_gmtime_r +#endif + +#if !HAVE_LOCALTIME_R && !defined(localtime_r) +static inline struct tm *ff_localtime_r(const time_t* clock, struct tm *result) +{ + struct tm *ptr = localtime(clock); + if (!ptr) + return NULL; + *result = *ptr; + return result; +} +#define localtime_r ff_localtime_r +#endif + +#endif /* AVUTIL_TIME_INTERNAL_H */ diff --git a/include/libavutil/timecode.h b/include/libavutil/timecode.h index 060574a..fe0fc83 100755 --- a/include/libavutil/timecode.h +++ b/include/libavutil/timecode.h @@ -98,8 +98,8 @@ uint32_t av_timecode_get_smpte(AVRational rate, int drop, int hh, int mm, int ss /** * Load timecode string in buf. * - * @param buf destination buffer, must be at least AV_TIMECODE_STR_SIZE long * @param tc timecode data correctly initialized + * @param buf destination buffer, must be at least AV_TIMECODE_STR_SIZE long * @param framenum frame number * @return the buf parameter * @@ -149,13 +149,13 @@ char *av_timecode_make_mpeg_tc_string(char *buf, uint32_t tc25bit); /** * Init a timecode struct with the passed parameters. * - * @param log_ctx a pointer to an arbitrary struct of which the first field - * is a pointer to an AVClass struct (used for av_log) * @param tc pointer to an allocated AVTimecode * @param rate frame rate in rational form * @param flags miscellaneous flags such as drop frame, +24 hours, ... * (see AVTimecodeFlag) * @param frame_start the first frame number + * @param log_ctx a pointer to an arbitrary struct of which the first field + * is a pointer to an AVClass struct (used for av_log) * @return 0 on success, AVERROR otherwise */ int av_timecode_init(AVTimecode *tc, AVRational rate, int flags, int frame_start, void *log_ctx); @@ -163,8 +163,6 @@ int av_timecode_init(AVTimecode *tc, AVRational rate, int flags, int frame_start /** * Init a timecode struct from the passed timecode components. * - * @param log_ctx a pointer to an arbitrary struct of which the first field - * is a pointer to an AVClass struct (used for av_log) * @param tc pointer to an allocated AVTimecode * @param rate frame rate in rational form * @param flags miscellaneous flags such as drop frame, +24 hours, ... @@ -173,6 +171,8 @@ int av_timecode_init(AVTimecode *tc, AVRational rate, int flags, int frame_start * @param mm minutes * @param ss seconds * @param ff frames + * @param log_ctx a pointer to an arbitrary struct of which the first field + * is a pointer to an AVClass struct (used for av_log) * @return 0 on success, AVERROR otherwise */ int av_timecode_init_from_components(AVTimecode *tc, AVRational rate, int flags, int hh, int mm, int ss, int ff, void *log_ctx); @@ -180,11 +180,11 @@ int av_timecode_init_from_components(AVTimecode *tc, AVRational rate, int flags, /** * Parse timecode representation (hh:mm:ss[:;.]ff). * - * @param log_ctx a pointer to an arbitrary struct of which the first field is a - * pointer to an AVClass struct (used for av_log). * @param tc pointer to an allocated AVTimecode * @param rate frame rate in rational form * @param str timecode string which will determine the frame start + * @param log_ctx a pointer to an arbitrary struct of which the first field is a + * pointer to an AVClass struct (used for av_log). * @return 0 on success, AVERROR otherwise */ int av_timecode_init_from_string(AVTimecode *tc, AVRational rate, const char *str, void *log_ctx); diff --git a/include/libavutil/timer.h b/include/libavutil/timer.h new file mode 100644 index 0000000..03706b0 --- /dev/null +++ b/include/libavutil/timer.h @@ -0,0 +1,169 @@ +/* + * copyright (c) 2006 Michael Niedermayer + * + * 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 + */ + +/** + * @file + * high precision timer, useful to profile code + */ + +#ifndef AVUTIL_TIMER_H +#define AVUTIL_TIMER_H + +#include "config.h" + +#if CONFIG_LINUX_PERF +# ifndef _GNU_SOURCE +# define _GNU_SOURCE +# endif +# include // read(3) +# include +# include +# include +#endif + +#include +#include +#include + +#if CONFIG_MACOS_KPERF +#include "macos_kperf.h" +#endif + +#if HAVE_MACH_ABSOLUTE_TIME +#include +#elif HAVE_CLOCK_GETTIME +#include +#endif + +#include "common.h" +#include "log.h" + +#if ARCH_AARCH64 +# include "aarch64/timer.h" +#elif ARCH_ARM +# include "arm/timer.h" +#elif ARCH_PPC +# include "ppc/timer.h" +#elif ARCH_X86 +# include "x86/timer.h" +#elif ARCH_LOONGARCH +# include "loongarch/timer.h" +#endif + +#if !defined(AV_READ_TIME) +# if HAVE_GETHRTIME +# define AV_READ_TIME gethrtime +# elif HAVE_MACH_ABSOLUTE_TIME +# define AV_READ_TIME mach_absolute_time +# elif HAVE_CLOCK_GETTIME && defined(CLOCK_MONOTONIC) + static inline int64_t ff_read_time(void) + { + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + return ts.tv_sec * INT64_C(1000000000) + ts.tv_nsec; + } +# define AV_READ_TIME ff_read_time +# define FF_TIMER_UNITS "ns" +# endif +#endif + +#ifndef FF_TIMER_UNITS +# define FF_TIMER_UNITS "UNITS" +#endif + +#define TIMER_REPORT(id, tdiff) \ + { \ + static uint64_t tsum = 0; \ + static int tcount = 0; \ + static int tskip_count = 0; \ + static int thistogram[32] = {0}; \ + thistogram[av_log2(tdiff)]++; \ + if (tcount < 2 || \ + (tdiff) < 8 * tsum / tcount || \ + (tdiff) < 2000) { \ + tsum += (tdiff); \ + tcount++; \ + } else \ + tskip_count++; \ + if (((tcount + tskip_count) & (tcount + tskip_count - 1)) == 0) { \ + int i; \ + av_log(NULL, AV_LOG_ERROR, \ + "%7" PRIu64 " " FF_TIMER_UNITS " in %s,%8d runs,%7d skips",\ + tsum * 10 / tcount, id, tcount, tskip_count); \ + for (i = 0; i < 32; i++) \ + av_log(NULL, AV_LOG_VERBOSE, " %2d", av_log2(2*thistogram[i]));\ + av_log(NULL, AV_LOG_ERROR, "\n"); \ + } \ + } + +#if CONFIG_LINUX_PERF + +#define START_TIMER \ + static int linux_perf_fd = -1; \ + uint64_t tperf; \ + if (linux_perf_fd == -1) { \ + struct perf_event_attr attr = { \ + .type = PERF_TYPE_HARDWARE, \ + .size = sizeof(struct perf_event_attr), \ + .config = PERF_COUNT_HW_CPU_CYCLES, \ + .disabled = 1, \ + .exclude_kernel = 1, \ + .exclude_hv = 1, \ + }; \ + linux_perf_fd = syscall(__NR_perf_event_open, &attr, \ + 0, -1, -1, 0); \ + } \ + if (linux_perf_fd == -1) { \ + av_log(NULL, AV_LOG_ERROR, "perf_event_open failed: %s\n", \ + av_err2str(AVERROR(errno))); \ + } else { \ + ioctl(linux_perf_fd, PERF_EVENT_IOC_RESET, 0); \ + ioctl(linux_perf_fd, PERF_EVENT_IOC_ENABLE, 0); \ + } + +#define STOP_TIMER(id) \ + ioctl(linux_perf_fd, PERF_EVENT_IOC_DISABLE, 0); \ + read(linux_perf_fd, &tperf, sizeof(tperf)); \ + TIMER_REPORT(id, tperf) + +#elif CONFIG_MACOS_KPERF + +#define START_TIMER \ + uint64_t tperf; \ + ff_kperf_init(); \ + tperf = ff_kperf_cycles(); + +#define STOP_TIMER(id) \ + TIMER_REPORT(id, ff_kperf_cycles() - tperf); + +#elif defined(AV_READ_TIME) +#define START_TIMER \ + uint64_t tend; \ + uint64_t tstart = AV_READ_TIME(); \ + +#define STOP_TIMER(id) \ + tend = AV_READ_TIME(); \ + TIMER_REPORT(id, tend - tstart) +#else +#define START_TIMER +#define STOP_TIMER(id) { } +#endif + +#endif /* AVUTIL_TIMER_H */ diff --git a/include/libavutil/timestamp.h b/include/libavutil/timestamp.h index e082f01..fa53a46 100755 --- a/include/libavutil/timestamp.h +++ b/include/libavutil/timestamp.h @@ -24,7 +24,7 @@ #ifndef AVUTIL_TIMESTAMP_H #define AVUTIL_TIMESTAMP_H -#include "common.h" +#include "avutil.h" #if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS) && !defined(PRId64) #error missing -D__STDC_FORMAT_MACROS / #define __STDC_FORMAT_MACROS @@ -62,11 +62,18 @@ static inline char *av_ts_make_string(char *buf, int64_t ts) * @param tb the timebase of the timestamp * @return the buffer in input */ -static inline char *av_ts_make_time_string(char *buf, int64_t ts, AVRational *tb) +char *av_ts_make_time_string2(char *buf, int64_t ts, AVRational tb); + +/** + * Fill the provided buffer with a string containing a timestamp + * representation. + * + * @see av_ts_make_time_string2 + */ +static inline char *av_ts_make_time_string(char *buf, int64_t ts, + const AVRational *tb) { - if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS"); - else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.6g", av_q2d(*tb) * ts); - return buf; + return av_ts_make_time_string2(buf, ts, *tb); } /** diff --git a/include/libavutil/twofish.h b/include/libavutil/twofish.h index 813cfec..67f359e 100755 --- a/include/libavutil/twofish.h +++ b/include/libavutil/twofish.h @@ -59,7 +59,7 @@ int av_twofish_init(struct AVTWOFISH *ctx, const uint8_t *key, int key_bits); * @param dst destination array, can be equal to src * @param src source array, can be equal to dst * @param count number of 16 byte blocks - * @paran iv initialization vector for CBC mode, NULL for ECB mode + * @param iv initialization vector for CBC mode, NULL for ECB mode * @param decrypt 0 for encryption, 1 for decryption */ void av_twofish_crypt(struct AVTWOFISH *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt); diff --git a/include/libavutil/tx.h b/include/libavutil/tx.h index 3de2f72..4696988 100644 --- a/include/libavutil/tx.h +++ b/include/libavutil/tx.h @@ -75,7 +75,9 @@ enum AVTXType { * the double variant, it's a 'double'. If scale is NULL, 1.0 will be used * as a default. * - * The stride parameter must be set to the size of a single sample in bytes. + * For forward transforms (R2C), stride must be the spacing between two + * samples in bytes. For inverse transforms, the stride must be set + * to the spacing between two complex values in bytes. * * The forward transform performs a real-to-complex DFT of N samples to * N/2+1 complex values. @@ -89,6 +91,44 @@ enum AVTXType { AV_TX_DOUBLE_RDFT = 7, AV_TX_INT32_RDFT = 8, + /** + * Real to real (DCT) transforms. + * + * The forward transform is a DCT-II. + * The inverse transform is a DCT-III. + * + * The input array is always overwritten. DCT-III requires that the + * input be padded with 2 extra samples. Stride must be set to the + * spacing between two samples in bytes. + */ + AV_TX_FLOAT_DCT = 9, + AV_TX_DOUBLE_DCT = 10, + AV_TX_INT32_DCT = 11, + + /** + * Discrete Cosine Transform I + * + * The forward transform is a DCT-I. + * The inverse transform is a DCT-I multiplied by 2/(N + 1). + * + * The input array is always overwritten. + */ + AV_TX_FLOAT_DCT_I = 12, + AV_TX_DOUBLE_DCT_I = 13, + AV_TX_INT32_DCT_I = 14, + + /** + * Discrete Sine Transform I + * + * The forward transform is a DST-I. + * The inverse transform is a DST-I multiplied by 2/(N + 1). + * + * The input array is always overwritten. + */ + AV_TX_FLOAT_DST_I = 15, + AV_TX_DOUBLE_DST_I = 16, + AV_TX_INT32_DST_I = 17, + /* Not part of the API, do not use */ AV_TX_NB, }; @@ -115,9 +155,8 @@ typedef void (*av_tx_fn)(AVTXContext *s, void *out, void *in, ptrdiff_t stride); */ enum AVTXFlags { /** - * Performs an in-place transformation on the input. The output argument - * of av_tn_fn() MUST match the input. May be unsupported or slower for some - * transform types. + * Allows for in-place transformations, where input == output. + * May be unsupported or slower for some transform types. */ AV_TX_INPLACE = 1ULL << 0, @@ -134,6 +173,16 @@ enum AVTXFlags { * Ignored for all transforms but inverse MDCTs. */ AV_TX_FULL_IMDCT = 1ULL << 2, + + /** + * Perform a real to half-complex RDFT. + * Only the real, or imaginary coefficients will + * be output, depending on the flag used. Only available for forward RDFTs. + * Output array must have enough space to hold N complex values + * (regular size for a real to complex transform). + */ + AV_TX_REAL_TO_REAL = 1ULL << 3, + AV_TX_REAL_TO_IMAGINARY = 1ULL << 4, }; /** diff --git a/include/libavutil/tx_priv.h b/include/libavutil/tx_priv.h new file mode 100644 index 0000000..d3fcdbf --- /dev/null +++ b/include/libavutil/tx_priv.h @@ -0,0 +1,392 @@ +/* + * 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 AVUTIL_TX_PRIV_H +#define AVUTIL_TX_PRIV_H + +#include "tx.h" +#include "thread.h" +#include "mem_internal.h" +#include "common.h" +#include "attributes.h" + +#ifdef TX_FLOAT +#define TX_TAB(x) x ## _float +#define TX_NAME(x) x ## _float_c +#define TX_NAME_STR(x) NULL_IF_CONFIG_SMALL(x "_float_c") +#define TX_TYPE(x) AV_TX_FLOAT_ ## x +#define TX_FN_NAME(fn, suffix) ff_tx_ ## fn ## _float_ ## suffix +#define TX_FN_NAME_STR(fn, suffix) NULL_IF_CONFIG_SMALL(#fn "_float_" #suffix) +#define MULT(x, m) ((x) * (m)) +#define SCALE_TYPE float +typedef float TXSample; +typedef float TXUSample; +typedef AVComplexFloat TXComplex; +#elif defined(TX_DOUBLE) +#define TX_TAB(x) x ## _double +#define TX_NAME(x) x ## _double_c +#define TX_NAME_STR(x) NULL_IF_CONFIG_SMALL(x "_double_c") +#define TX_TYPE(x) AV_TX_DOUBLE_ ## x +#define TX_FN_NAME(fn, suffix) ff_tx_ ## fn ## _double_ ## suffix +#define TX_FN_NAME_STR(fn, suffix) NULL_IF_CONFIG_SMALL(#fn "_double_" #suffix) +#define MULT(x, m) ((x) * (m)) +#define SCALE_TYPE double +typedef double TXSample; +typedef double TXUSample; +typedef AVComplexDouble TXComplex; +#elif defined(TX_INT32) +#define TX_TAB(x) x ## _int32 +#define TX_NAME(x) x ## _int32_c +#define TX_NAME_STR(x) NULL_IF_CONFIG_SMALL(x "_int32_c") +#define TX_TYPE(x) AV_TX_INT32_ ## x +#define TX_FN_NAME(fn, suffix) ff_tx_ ## fn ## _int32_ ## suffix +#define TX_FN_NAME_STR(fn, suffix) NULL_IF_CONFIG_SMALL(#fn "_int32_" #suffix) +#define MULT(x, m) (((((int64_t)(x)) * (int64_t)(m)) + 0x40000000) >> 31) +#define SCALE_TYPE float +typedef int32_t TXSample; +typedef uint32_t TXUSample; +typedef AVComplexInt32 TXComplex; +#else +typedef void TXComplex; +#endif + +#define TX_DECL_FN(fn, suffix) \ + void TX_FN_NAME(fn, suffix)(AVTXContext *s, void *o, void *i, ptrdiff_t st); + +#define TX_DEF(fn, tx_type, len_min, len_max, f1, f2, \ + p, init_fn, suffix, cf, cd_flags, cf2) \ + &(const FFTXCodelet){ \ + .name = TX_FN_NAME_STR(fn, suffix), \ + .function = TX_FN_NAME(fn, suffix), \ + .type = TX_TYPE(tx_type), \ + .flags = FF_TX_ALIGNED | FF_TX_OUT_OF_PLACE | cd_flags, \ + .factors = { (f1), (f2) }, \ + .nb_factors = !!(f1) + !!(f2), \ + .min_len = len_min, \ + .max_len = len_max, \ + .init = init_fn, \ + .cpu_flags = cf2 | AV_CPU_FLAG_ ## cf, \ + .prio = p, \ + } + +#if defined(TX_FLOAT) || defined(TX_DOUBLE) + +#define CMUL(dre, dim, are, aim, bre, bim) \ + do { \ + (dre) = (are) * (bre) - (aim) * (bim); \ + (dim) = (are) * (bim) + (aim) * (bre); \ + } while (0) + +#define SMUL(dre, dim, are, aim, bre, bim) \ + do { \ + (dre) = (are) * (bre) - (aim) * (bim); \ + (dim) = (are) * (bim) - (aim) * (bre); \ + } while (0) + +#define UNSCALE(x) (x) +#define RESCALE(x) (x) + +#define FOLD(a, b) ((a) + (b)) + +#define BF(x, y, a, b) \ + do { \ + x = (a) - (b); \ + y = (a) + (b); \ + } while (0) + +#elif defined(TX_INT32) + +/* Properly rounds the result */ +#define CMUL(dre, dim, are, aim, bre, bim) \ + do { \ + int64_t accu; \ + (accu) = (int64_t)(bre) * (are); \ + (accu) -= (int64_t)(bim) * (aim); \ + (dre) = (int)(((accu) + 0x40000000) >> 31); \ + (accu) = (int64_t)(bim) * (are); \ + (accu) += (int64_t)(bre) * (aim); \ + (dim) = (int)(((accu) + 0x40000000) >> 31); \ + } while (0) + +#define SMUL(dre, dim, are, aim, bre, bim) \ + do { \ + int64_t accu; \ + (accu) = (int64_t)(bre) * (are); \ + (accu) -= (int64_t)(bim) * (aim); \ + (dre) = (int)(((accu) + 0x40000000) >> 31); \ + (accu) = (int64_t)(bim) * (are); \ + (accu) -= (int64_t)(bre) * (aim); \ + (dim) = (int)(((accu) + 0x40000000) >> 31); \ + } while (0) + +#define UNSCALE(x) ((double)(x)/2147483648.0) +#define RESCALE(x) (av_clip64(llrintf((x) * 2147483648.0), INT32_MIN, INT32_MAX)) + +#define FOLD(x, y) ((int32_t)((x) + (unsigned)(y) + 32) >> 6) + +#define BF(x, y, a, b) \ + do { \ + x = (a) - (unsigned)(b); \ + y = (a) + (unsigned)(b); \ + } while (0) + +#endif /* TX_INT32 */ + +#define CMUL3(c, a, b) CMUL((c).re, (c).im, (a).re, (a).im, (b).re, (b).im) + +/* Codelet flags, used to pick codelets. Must be a superset of enum AVTXFlags, + * but if it runs out of bits, it can be made separate. */ +#define FF_TX_OUT_OF_PLACE (1ULL << 63) /* Can be OR'd with AV_TX_INPLACE */ +#define FF_TX_ALIGNED (1ULL << 62) /* Cannot be OR'd with AV_TX_UNALIGNED */ +#define FF_TX_PRESHUFFLE (1ULL << 61) /* Codelet expects permuted coeffs */ +#define FF_TX_INVERSE_ONLY (1ULL << 60) /* For non-orthogonal inverse-only transforms */ +#define FF_TX_FORWARD_ONLY (1ULL << 59) /* For non-orthogonal forward-only transforms */ +#define FF_TX_ASM_CALL (1ULL << 58) /* For asm->asm functions only */ + +typedef enum FFTXCodeletPriority { + FF_TX_PRIO_BASE = 0, /* Baseline priority */ + + /* For SIMD, set base prio to the register size in bits and increment in + * steps of 64 depending on faster/slower features, like FMA. */ + + FF_TX_PRIO_MIN = -131072, /* For naive implementations */ + FF_TX_PRIO_MAX = 32768, /* For custom implementations/ASICs */ +} FFTXCodeletPriority; + +typedef enum FFTXMapDirection { + /* No map. Make a map up. */ + FF_TX_MAP_NONE = 0, + + /* Lookup table must be applied via dst[i] = src[lut[i]]; */ + FF_TX_MAP_GATHER, + + /* Lookup table must be applied via dst[lut[i]] = src[i]; */ + FF_TX_MAP_SCATTER, +} FFTXMapDirection; + +/* Codelet options */ +typedef struct FFTXCodeletOptions { + /* Request a specific lookup table direction. Codelets MUST put the + * direction in AVTXContext. If the codelet does not respect this, a + * conversion will be performed. */ + FFTXMapDirection map_dir; +} FFTXCodeletOptions; + +/* Maximum number of factors a codelet may have. Arbitrary. */ +#define TX_MAX_FACTORS 16 + +/* Maximum amount of subtransform functions, subtransforms and factors. Arbitrary. */ +#define TX_MAX_SUB 4 + +/* Maximum number of returned results for ff_tx_decompose_length. Arbitrary. */ +#define TX_MAX_DECOMPOSITIONS 512 + +typedef struct FFTXCodelet { + const char *name; /* Codelet name, for debugging */ + av_tx_fn function; /* Codelet function, != NULL */ + enum AVTXType type; /* Type of codelet transform */ +#define TX_TYPE_ANY INT32_MAX /* Special type to allow all types */ + + uint64_t flags; /* A combination of AVTXFlags and codelet + * flags that describe its properties. */ + + int factors[TX_MAX_FACTORS]; /* Length factors. MUST be coprime. */ +#define TX_FACTOR_ANY -1 /* When used alone, signals that the codelet + * supports all factors. Otherwise, if other + * factors are present, it signals that whatever + * remains will be supported, as long as the + * other factors are a component of the length */ + + int nb_factors; /* Minimum number of factors that have to + * be a modulo of the length. Must not be 0. */ + + int min_len; /* Minimum length of transform, must be >= 1 */ + int max_len; /* Maximum length of transform */ +#define TX_LEN_UNLIMITED -1 /* Special length value to permit all lengths */ + + int (*init)(AVTXContext *s, /* Optional callback for current context initialization. */ + const struct FFTXCodelet *cd, + uint64_t flags, + FFTXCodeletOptions *opts, + int len, int inv, + const void *scale); + + int (*uninit)(AVTXContext *s); /* Optional callback for uninitialization. */ + + int cpu_flags; /* CPU flags. If any negative flags like + * SLOW are present, will avoid picking. + * 0x0 to signal it's a C codelet */ +#define FF_TX_CPU_FLAGS_ALL 0x0 /* Special CPU flag for C */ + + int prio; /* < 0 = least, 0 = no pref, > 0 = prefer */ +} FFTXCodelet; + +struct AVTXContext { + /* Fields the root transform and subtransforms use or may use. + * NOTE: This section is used by assembly, do not reorder or change */ + int len; /* Length of the transform */ + int inv; /* If transform is inverse */ + int *map; /* Lookup table(s) */ + TXComplex *exp; /* Any non-pre-baked multiplication factors, + * or extra temporary buffer */ + TXComplex *tmp; /* Temporary buffer, if needed */ + + AVTXContext *sub; /* Subtransform context(s), if needed */ + av_tx_fn fn[TX_MAX_SUB]; /* Function(s) for the subtransforms */ + int nb_sub; /* Number of subtransforms. + * The reason all of these are set here + * rather than in each separate context + * is to eliminate extra pointer + * dereferences. */ + + /* Fields mainly useul/applicable for the root transform or initialization. + * Fields below are not used by assembly code. */ + const FFTXCodelet *cd[TX_MAX_SUB]; /* Subtransform codelets */ + const FFTXCodelet *cd_self; /* Codelet for the current context */ + enum AVTXType type; /* Type of transform */ + uint64_t flags; /* A combination of AVTXFlags and + * codelet flags used when creating */ + FFTXMapDirection map_dir; /* Direction of AVTXContext->map */ + float scale_f; + double scale_d; + void *opaque; /* Free to use by implementations */ +}; + +/* This function embeds a Ruritanian PFA input map into an existing lookup table + * to avoid double permutation. This allows for compound factors to be + * synthesized as fast PFA FFTs and embedded into either other or standalone + * transforms. + * The output CRT map must still be pre-baked into the transform. */ +#define TX_EMBED_INPUT_PFA_MAP(map, tot_len, d1, d2) \ + do { \ + int mtmp[(d1)*(d2)]; \ + for (int k = 0; k < tot_len; k += (d1)*(d2)) { \ + memcpy(mtmp, &map[k], (d1)*(d2)*sizeof(*mtmp)); \ + for (int m = 0; m < (d2); m++) \ + for (int n = 0; n < (d1); n++) \ + map[k + m*(d1) + n] = mtmp[(m*(d1) + n*(d2)) % ((d1)*(d2))]; \ + } \ + } while (0) + +/* This function generates a Ruritanian PFA input map into s->map. */ +int ff_tx_gen_pfa_input_map(AVTXContext *s, FFTXCodeletOptions *opts, + int d1, int d2); + +/* Create a subtransform in the current context with the given parameters. + * The flags parameter from FFTXCodelet.init() should be preserved as much + * as that's possible. + * MUST be called during the sub() callback of each codelet. */ +int ff_tx_init_subtx(AVTXContext *s, enum AVTXType type, + uint64_t flags, FFTXCodeletOptions *opts, + int len, int inv, const void *scale); + +/* Clear the context by freeing all tables, maps and subtransforms. */ +void ff_tx_clear_ctx(AVTXContext *s); + +/* Attempt to factorize a length into 2 integers such that + * len / dst1 == dst2, where dst1 and dst2 are coprime. */ +int ff_tx_decompose_length(int dst[TX_MAX_DECOMPOSITIONS], enum AVTXType type, + int len, int inv); + +/* Generate a default map (0->len or 0, (len-1)->1 for inverse transforms) + * for a context. */ +int ff_tx_gen_default_map(AVTXContext *s, FFTXCodeletOptions *opts); + +/* + * Generates the PFA permutation table into AVTXContext->pfatab. The end table + * is appended to the start table. + * The `inv` flag should only be enabled if the lookup tables of subtransforms + * won't get flattened. + */ +int ff_tx_gen_compound_mapping(AVTXContext *s, FFTXCodeletOptions *opts, + int inv, int n, int m); + +/* + * Generates a standard-ish (slightly modified) Split-Radix revtab into + * AVTXContext->map. Invert lookup changes how the mapping needs to be applied. + * If it's set to 0, it has to be applied like out[map[i]] = in[i], otherwise + * if it's set to 1, has to be applied as out[i] = in[map[i]] + */ +int ff_tx_gen_ptwo_revtab(AVTXContext *s, FFTXCodeletOptions *opts); + +/* + * Generates an index into AVTXContext->inplace_idx that if followed in the + * specific order, allows the revtab to be done in-place. The sub-transform + * and its map should already be initialized. + */ +int ff_tx_gen_inplace_map(AVTXContext *s, int len); + +/* + * This generates a parity-based revtab of length len and direction inv. + * + * Parity means even and odd complex numbers will be split, e.g. the even + * coefficients will come first, after which the odd coefficients will be + * placed. For example, a 4-point transform's coefficients after reordering: + * z[0].re, z[0].im, z[2].re, z[2].im, z[1].re, z[1].im, z[3].re, z[3].im + * + * The basis argument is the length of the largest non-composite transform + * supported, and also implies that the basis/2 transform is supported as well, + * as the split-radix algorithm requires it to be. + * + * The dual_stride argument indicates that both the basis, as well as the + * basis/2 transforms support doing two transforms at once, and the coefficients + * will be interleaved between each pair in a split-radix like so (stride == 2): + * tx1[0], tx1[2], tx2[0], tx2[2], tx1[1], tx1[3], tx2[1], tx2[3] + * A non-zero number switches this on, with the value indicating the stride + * (how many values of 1 transform to put first before switching to the other). + * Must be a power of two or 0. Must be less than the basis. + * Value will be clipped to the transform size, so for a basis of 16 and a + * dual_stride of 8, dual 8-point transforms will be laid out as if dual_stride + * was set to 4. + * Usually you'll set this to half the complex numbers that fit in a single + * register or 0. This allows to reuse SSE functions as dual-transform + * functions in AVX mode. + * + * If length is smaller than basis/2 this function will not do anything. + * + * If inv_lookup is set to 1, it will flip the lookup from out[map[i]] = src[i] + * to out[i] = src[map[i]]. + */ +int ff_tx_gen_split_radix_parity_revtab(AVTXContext *s, int len, int inv, + FFTXCodeletOptions *opts, + int basis, int dual_stride); + +/* Typed init function to initialize shared tables. Will initialize all tables + * for all factors of a length. */ +void ff_tx_init_tabs_float (int len); +void ff_tx_init_tabs_double(int len); +void ff_tx_init_tabs_int32 (int len); + +/* Typed init function to initialize an MDCT exptab in a context. + * If pre_tab is set, duplicates the entire table, with the first + * copy being shuffled according to pre_tab, and the second copy + * being the original. */ +int ff_tx_mdct_gen_exp_float (AVTXContext *s, int *pre_tab); +int ff_tx_mdct_gen_exp_double(AVTXContext *s, int *pre_tab); +int ff_tx_mdct_gen_exp_int32 (AVTXContext *s, int *pre_tab); + +/* Lists of codelets */ +extern const FFTXCodelet * const ff_tx_codelet_list_float_c []; +extern const FFTXCodelet * const ff_tx_codelet_list_float_x86 []; +extern const FFTXCodelet * const ff_tx_codelet_list_float_aarch64 []; + +extern const FFTXCodelet * const ff_tx_codelet_list_double_c []; + +extern const FFTXCodelet * const ff_tx_codelet_list_int32_c []; + +#endif /* AVUTIL_TX_PRIV_H */ diff --git a/include/libavutil/uuid.h b/include/libavutil/uuid.h index 4b50889..748b7ed 100644 --- a/include/libavutil/uuid.h +++ b/include/libavutil/uuid.h @@ -106,7 +106,6 @@ int av_uuid_parse_range(const char *in_start, const char *in_end, AVUUID uu); * * @param[in] uu AVUUID * @param[out] out Pointer to an array of no less than 37 characters. - * @return A non-zero value in case of an error. */ void av_uuid_unparse(const AVUUID uu, char *out); diff --git a/include/libavutil/version.h b/include/libavutil/version.h index 87178e9..753f85b 100755 --- a/include/libavutil/version.h +++ b/include/libavutil/version.h @@ -78,8 +78,8 @@ * @{ */ -#define LIBAVUTIL_VERSION_MAJOR 57 -#define LIBAVUTIL_VERSION_MINOR 28 +#define LIBAVUTIL_VERSION_MAJOR 59 +#define LIBAVUTIL_VERSION_MINOR 39 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ @@ -105,15 +105,16 @@ * @{ */ -#define FF_API_D2STR (LIBAVUTIL_VERSION_MAJOR < 58) -#define FF_API_DECLARE_ALIGNED (LIBAVUTIL_VERSION_MAJOR < 58) -#define FF_API_COLORSPACE_NAME (LIBAVUTIL_VERSION_MAJOR < 58) -#define FF_API_AV_MALLOCZ_ARRAY (LIBAVUTIL_VERSION_MAJOR < 58) -#define FF_API_FIFO_PEEK2 (LIBAVUTIL_VERSION_MAJOR < 58) -#define FF_API_FIFO_OLD_API (LIBAVUTIL_VERSION_MAJOR < 58) -#define FF_API_XVMC (LIBAVUTIL_VERSION_MAJOR < 58) -#define FF_API_OLD_CHANNEL_LAYOUT (LIBAVUTIL_VERSION_MAJOR < 58) -#define FF_API_AV_FOPEN_UTF8 (LIBAVUTIL_VERSION_MAJOR < 58) +#define FF_API_HDR_VIVID_THREE_SPLINE (LIBAVUTIL_VERSION_MAJOR < 60) +#define FF_API_FRAME_PKT (LIBAVUTIL_VERSION_MAJOR < 60) +#define FF_API_INTERLACED_FRAME (LIBAVUTIL_VERSION_MAJOR < 60) +#define FF_API_FRAME_KEY (LIBAVUTIL_VERSION_MAJOR < 60) +#define FF_API_PALETTE_HAS_CHANGED (LIBAVUTIL_VERSION_MAJOR < 60) +#define FF_API_VULKAN_CONTIGUOUS_MEMORY (LIBAVUTIL_VERSION_MAJOR < 60) +#define FF_API_H274_FILM_GRAIN_VCS (LIBAVUTIL_VERSION_MAJOR < 60) +#define FF_API_MOD_UINTP2 (LIBAVUTIL_VERSION_MAJOR < 60) +#define FF_API_RISCV_FD_ZBA (LIBAVUTIL_VERSION_MAJOR < 60) +#define FF_API_VULKAN_FIXED_QUEUES (LIBAVUTIL_VERSION_MAJOR < 60) /** * @} diff --git a/include/libavutil/version_major.h b/include/libavutil/version_major.h new file mode 100644 index 0000000..e4db2e3 --- /dev/null +++ b/include/libavutil/version_major.h @@ -0,0 +1,25 @@ +/* + * 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 AVUTIL_VERSION_MAJOR_H +#define AVUTIL_VERSION_MAJOR_H + +/* This file is intentionally empty; it's only kept to fulfill make + * dependencies for ffbuild/libversion.sh. It is not installed. */ + +#endif /* AVUTIL_VERSION_MAJOR_H */ diff --git a/include/libavutil/video_enc_params.h b/include/libavutil/video_enc_params.h index fc0c3bc..62265a5 100644 --- a/include/libavutil/video_enc_params.h +++ b/include/libavutil/video_enc_params.h @@ -136,8 +136,8 @@ typedef struct AVVideoBlockParams { int32_t delta_qp; } AVVideoBlockParams; -/* - * Get the block at the specified {@code idx}. Must be between 0 and nb_blocks. +/** + * Get the block at the specified {@code idx}. Must be between 0 and nb_blocks - 1. */ static av_always_inline AVVideoBlockParams* av_video_enc_params_block(AVVideoEncParams *par, unsigned int idx) diff --git a/include/libavutil/video_hint.h b/include/libavutil/video_hint.h new file mode 100644 index 0000000..1b21960 --- /dev/null +++ b/include/libavutil/video_hint.h @@ -0,0 +1,107 @@ +/** + * Copyright 2023 Elias Carotti + * + * 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 AVUTIL_VIDEO_HINT_H +#define AVUTIL_VIDEO_HINT_H + +#include +#include +#include "libavutil/avassert.h" +#include "libavutil/frame.h" + +typedef struct AVVideoRect { + uint32_t x, y; + uint32_t width, height; +} AVVideoRect; + +typedef enum AVVideoHintType { + /* rectangled delimit the constant areas (unchanged), default is changed */ + AV_VIDEO_HINT_TYPE_CONSTANT, + + /* rectangled delimit the constant areas (changed), default is not changed */ + AV_VIDEO_HINT_TYPE_CHANGED, +} AVVideoHintType; + +typedef struct AVVideoHint { + /** + * Number of AVVideoRect present. + * + * May be 0, in which case no per-rectangle information is present. In this + * case the values of rect_offset / rect_size are unspecified and should + * not be accessed. + */ + size_t nb_rects; + + /** + * Offset in bytes from the beginning of this structure at which the array + * of AVVideoRect starts. + */ + size_t rect_offset; + + /** + * Size in bytes of AVVideoRect. + */ + size_t rect_size; + + AVVideoHintType type; +} AVVideoHint; + +static av_always_inline AVVideoRect * +av_video_hint_rects(const AVVideoHint *hints) { + return (AVVideoRect *)((uint8_t *)hints + hints->rect_offset); +} + +static av_always_inline AVVideoRect * +av_video_hint_get_rect(const AVVideoHint *hints, size_t idx) { + return (AVVideoRect *)((uint8_t *)hints + hints->rect_offset + idx * hints->rect_size); +} + +/** + * Allocate memory for the AVVideoHint struct along with an nb_rects-sized + * arrays of AVVideoRect. + * + * The side data contains a list of rectangles for the portions of the frame + * which changed from the last encoded one (and the remainder are assumed to be + * changed), or, alternately (depending on the type parameter) the unchanged + * ones (and the remanining ones are those which changed). + * Macroblocks will thus be hinted either to be P_SKIP-ped or go through the + * regular encoding procedure. + * + * It's responsibility of the caller to fill the AVRects accordingly, and to set + * the proper AVVideoHintType field. + * + * @param out_size if non-NULL, the size in bytes of the resulting data array is + * written here + * + * @return newly allocated AVVideoHint struct (must be freed by the caller using + * av_free()) on success, NULL on memory allocation failure + */ +AVVideoHint *av_video_hint_alloc(size_t nb_rects, + size_t *out_size); + +/** + * Same as av_video_hint_alloc(), except newly-allocated AVVideoHint is attached + * as side data of type AV_FRAME_DATA_VIDEO_HINT_INFO to frame. + */ +AVVideoHint *av_video_hint_create_side_data(AVFrame *frame, + size_t nb_rects); + + +#endif /* AVUTIL_VIDEO_HINT_H */ diff --git a/include/libavutil/vulkan.h b/include/libavutil/vulkan.h new file mode 100644 index 0000000..e03fd70 --- /dev/null +++ b/include/libavutil/vulkan.h @@ -0,0 +1,534 @@ +/* + * 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 AVUTIL_VULKAN_H +#define AVUTIL_VULKAN_H + +#define VK_NO_PROTOTYPES + +#include + +#include "thread.h" +#include "pixdesc.h" +#include "bprint.h" +#include "hwcontext.h" +#include "vulkan_functions.h" +#include "hwcontext_vulkan.h" + +/* GLSL management macros */ +#define INDENT(N) INDENT_##N +#define INDENT_0 +#define INDENT_1 INDENT_0 " " +#define INDENT_2 INDENT_1 INDENT_1 +#define INDENT_3 INDENT_2 INDENT_1 +#define INDENT_4 INDENT_3 INDENT_1 +#define INDENT_5 INDENT_4 INDENT_1 +#define INDENT_6 INDENT_5 INDENT_1 +#define C(N, S) INDENT(N) #S "\n" + +#define GLSLC(N, S) \ + do { \ + av_bprintf(&shd->src, C(N, S)); \ + } while (0) + +#define GLSLA(...) \ + do { \ + av_bprintf(&shd->src, __VA_ARGS__); \ + } while (0) + +#define GLSLF(N, S, ...) \ + do { \ + av_bprintf(&shd->src, C(N, S), __VA_ARGS__); \ + } while (0) + +#define GLSLD(D) \ + do { \ + av_bprintf(&shd->src, "\n"); \ + av_bprint_append_data(&shd->src, D, strlen(D)); \ + av_bprintf(&shd->src, "\n"); \ + } while (0) + +/* Helper, pretty much every Vulkan return value needs to be checked */ +#define RET(x) \ + do { \ + if ((err = (x)) < 0) \ + goto fail; \ + } while (0) + +#define DUP_SAMPLER(x) { x, x, x, x } + +typedef struct FFVkSPIRVShader { + const char *name; /* Name for id/debugging purposes */ + AVBPrint src; + int local_size[3]; /* Compute shader workgroup sizes */ + VkPipelineShaderStageCreateInfo shader; + VkPipelineShaderStageRequiredSubgroupSizeCreateInfo subgroup_info; +} FFVkSPIRVShader; + +typedef struct FFVulkanDescriptorSetBinding { + const char *name; + VkDescriptorType type; + const char *mem_layout; /* Storage images (rgba8, etc.) and buffers (std430, etc.) */ + const char *mem_quali; /* readonly, writeonly, etc. */ + const char *buf_content; /* For buffers */ + uint32_t dimensions; /* Needed for e.g. sampler%iD */ + uint32_t elems; /* 0 - scalar, 1 or more - vector */ + VkShaderStageFlags stages; + VkSampler samplers[4]; /* Sampler to use for all elems */ +} FFVulkanDescriptorSetBinding; + +typedef struct FFVkBuffer { + VkBuffer buf; + VkDeviceMemory mem; + VkMemoryPropertyFlagBits flags; + size_t size; + VkDeviceAddress address; + + /* Local use only */ + VkPipelineStageFlags2 stage; + VkAccessFlags2 access; + + /* Only valid when allocated via ff_vk_get_pooled_buffer with HOST_VISIBLE */ + uint8_t *mapped_mem; +} FFVkBuffer; + +typedef struct FFVkQueueFamilyCtx { + int queue_family; + int nb_queues; +} FFVkQueueFamilyCtx; + +typedef struct FFVkExecContext { + uint32_t idx; + const struct FFVkExecPool *parent; + pthread_mutex_t lock; + int had_submission; + + /* Queue for the execution context */ + VkQueue queue; + int qf; + int qi; + + /* Command buffer for the context */ + VkCommandBuffer buf; + + /* Fence for the command buffer */ + VkFence fence; + + void *query_data; + int query_idx; + + /* Buffer dependencies */ + AVBufferRef **buf_deps; + int nb_buf_deps; + unsigned int buf_deps_alloc_size; + + /* Frame dependencies */ + AVFrame **frame_deps; + unsigned int frame_deps_alloc_size; + int nb_frame_deps; + + VkSemaphoreSubmitInfo *sem_wait; + unsigned int sem_wait_alloc; + int sem_wait_cnt; + + VkSemaphoreSubmitInfo *sem_sig; + unsigned int sem_sig_alloc; + int sem_sig_cnt; + + uint64_t **sem_sig_val_dst; + unsigned int sem_sig_val_dst_alloc; + int sem_sig_val_dst_cnt; + + uint8_t *frame_locked; + unsigned int frame_locked_alloc_size; + + VkAccessFlagBits *access_dst; + unsigned int access_dst_alloc; + + VkImageLayout *layout_dst; + unsigned int layout_dst_alloc; + + uint32_t *queue_family_dst; + unsigned int queue_family_dst_alloc; + + uint8_t *frame_update; + unsigned int frame_update_alloc_size; +} FFVkExecContext; + +typedef struct FFVkExecPool { + FFVkExecContext *contexts; + atomic_int_least64_t idx; + + VkCommandPool cmd_buf_pool; + VkCommandBuffer *cmd_bufs; + int pool_size; + + VkQueryPool query_pool; + void *query_data; + int query_results; + int query_statuses; + int query_64bit; + int query_status_stride; + int nb_queries; + size_t qd_size; +} FFVkExecPool; + +typedef struct FFVulkanDescriptorSet { + FFVkBuffer buf; + uint8_t *desc_mem; + VkDeviceSize layout_size; + VkDeviceSize aligned_size; /* descriptorBufferOffsetAlignment */ + VkDeviceSize total_size; /* Once registered to an exec context */ + VkBufferUsageFlags usage; + + VkDescriptorSetLayoutBinding *binding; + VkDeviceSize *binding_offset; + int nb_bindings; + + /* Descriptor set is shared between all submissions */ + int singular; +} FFVulkanDescriptorSet; + +typedef struct FFVulkanPipeline { + VkPipelineBindPoint bind_point; + + /* Contexts */ + VkPipelineLayout pipeline_layout; + VkPipeline pipeline; + + /* Push consts */ + VkPushConstantRange *push_consts; + int push_consts_num; + + /* Workgroup */ + int wg_size[3]; + + /* Descriptor buffer */ + VkDescriptorSetLayout *desc_layout; + FFVulkanDescriptorSet *desc_set; + VkDescriptorBufferBindingInfoEXT *desc_bind; + uint32_t *bound_buffer_indices; + int nb_descriptor_sets; + + /* Descriptor pool */ + int use_push; + VkDescriptorSet *desc_sets; + VkDescriptorPool desc_pool; + VkDescriptorPoolSize *desc_pool_size; + int nb_desc_pool_size; + int total_desc_sets; + FFVkExecPool *assoc_pool; +} FFVulkanPipeline; + +typedef struct FFVulkanContext { + const AVClass *class; + void *log_parent; + + FFVulkanFunctions vkfn; + FFVulkanExtensions extensions; + VkPhysicalDeviceProperties2 props; + VkPhysicalDeviceDriverProperties driver_props; + VkPhysicalDeviceMemoryProperties mprops; + VkPhysicalDeviceExternalMemoryHostPropertiesEXT hprops; + VkPhysicalDeviceDescriptorBufferPropertiesEXT desc_buf_props; + VkPhysicalDeviceSubgroupSizeControlProperties subgroup_props; + VkPhysicalDeviceCooperativeMatrixPropertiesKHR coop_matrix_props; + VkPhysicalDeviceOpticalFlowPropertiesNV optical_flow_props; + VkQueueFamilyQueryResultStatusPropertiesKHR *query_props; + VkQueueFamilyVideoPropertiesKHR *video_props; + VkQueueFamilyProperties2 *qf_props; + int tot_nb_qfs; + + VkCooperativeMatrixPropertiesKHR *coop_mat_props; + uint32_t coop_mat_props_nb; + + VkPhysicalDeviceShaderAtomicFloatFeaturesEXT atomic_float_feats; + VkPhysicalDeviceVulkan12Features feats_12; + VkPhysicalDeviceFeatures2 feats; + + AVBufferRef *device_ref; + AVHWDeviceContext *device; + AVVulkanDeviceContext *hwctx; + + AVBufferRef *input_frames_ref; + AVBufferRef *frames_ref; + AVHWFramesContext *frames; + AVVulkanFramesContext *hwfc; + + uint32_t qfs[64]; + int nb_qfs; + + /* Properties */ + int output_width; + int output_height; + enum AVPixelFormat output_format; + enum AVPixelFormat input_format; +} FFVulkanContext; + +static inline int ff_vk_count_images(AVVkFrame *f) +{ + int cnt = 0; + while (cnt < FF_ARRAY_ELEMS(f->img) && f->img[cnt]) + cnt++; + + return cnt; +} + +static inline const void *ff_vk_find_struct(const void *chain, VkStructureType stype) +{ + const VkBaseInStructure *in = chain; + while (in) { + if (in->sType == stype) + return in; + + in = in->pNext; + } + + return NULL; +} + +static inline void ff_vk_link_struct(void *chain, const void *in) +{ + VkBaseOutStructure *out = chain; + while (out->pNext) + out = out->pNext; + + out->pNext = (void *)in; +} + +/* Identity mapping - r = r, b = b, g = g, a = a */ +extern const VkComponentMapping ff_comp_identity_map; + +/** + * Initializes the AVClass, in case this context is not used + * as the main user's context. + * May use either a frames context reference, or a device context reference. + */ +int ff_vk_init(FFVulkanContext *s, void *log_parent, + AVBufferRef *device_ref, AVBufferRef *frames_ref); + +/** + * Converts Vulkan return values to strings + */ +const char *ff_vk_ret2str(VkResult res); + +/** + * Returns 1 if pixfmt is a usable RGB format. + */ +int ff_vk_mt_is_np_rgb(enum AVPixelFormat pix_fmt); + +/** + * Returns the format to use for images in shaders. + */ +const char *ff_vk_shader_rep_fmt(enum AVPixelFormat pixfmt); + +/** + * Loads props/mprops/driver_props + */ +int ff_vk_load_props(FFVulkanContext *s); + +/** + * Chooses a QF and loads it into a context. + */ +int ff_vk_qf_init(FFVulkanContext *s, FFVkQueueFamilyCtx *qf, + VkQueueFlagBits dev_family); + +/** + * Allocates/frees an execution pool. + * ff_vk_exec_pool_init_desc() MUST be called if ff_vk_exec_descriptor_set_add() + * has been called. + */ +int ff_vk_exec_pool_init(FFVulkanContext *s, FFVkQueueFamilyCtx *qf, + FFVkExecPool *pool, int nb_contexts, + int nb_queries, VkQueryType query_type, int query_64bit, + const void *query_create_pnext); +void ff_vk_exec_pool_free(FFVulkanContext *s, FFVkExecPool *pool); + +/** + * Retrieve an execution pool. Threadsafe. + */ +FFVkExecContext *ff_vk_exec_get(FFVkExecPool *pool); + +/** + * Performs nb_queries queries and returns their results and statuses. + * 64_BIT and WITH_STATUS flags are ignored as 64_BIT must be specified via + * query_64bit in ff_vk_exec_pool_init() and WITH_STATUS is always enabled. + */ +VkResult ff_vk_exec_get_query(FFVulkanContext *s, FFVkExecContext *e, + void **data, VkQueryResultFlagBits flags); + +/** + * Start/submit/wait an execution. + * ff_vk_exec_start() always waits on a submission, so using ff_vk_exec_wait() + * is not necessary (unless using it is just better). + */ +int ff_vk_exec_start(FFVulkanContext *s, FFVkExecContext *e); +int ff_vk_exec_submit(FFVulkanContext *s, FFVkExecContext *e); +void ff_vk_exec_wait(FFVulkanContext *s, FFVkExecContext *e); + +/** + * Execution dependency management. + * Can attach buffers to executions that will only be unref'd once the + * buffer has finished executing. + * Adding a frame dep will *lock the frame*, until either the dependencies + * are discarded, the execution is submitted, or a failure happens. + * update_frame will update the frame's properties before it is unlocked, + * only if submission was successful. + */ +int ff_vk_exec_add_dep_buf(FFVulkanContext *s, FFVkExecContext *e, + AVBufferRef **deps, int nb_deps, int ref); +int ff_vk_exec_add_dep_bool_sem(FFVulkanContext *s, FFVkExecContext *e, + VkSemaphore *sem, int nb, + VkPipelineStageFlagBits2 stage, + int wait); /* Ownership transferred if !wait */ +int ff_vk_exec_add_dep_frame(FFVulkanContext *s, FFVkExecContext *e, AVFrame *f, + VkPipelineStageFlagBits2 wait_stage, + VkPipelineStageFlagBits2 signal_stage); +void ff_vk_exec_update_frame(FFVulkanContext *s, FFVkExecContext *e, AVFrame *f, + VkImageMemoryBarrier2 *bar, uint32_t *nb_img_bar); +int ff_vk_exec_mirror_sem_value(FFVulkanContext *s, FFVkExecContext *e, + VkSemaphore *dst, uint64_t *dst_val, + AVFrame *f); +void ff_vk_exec_discard_deps(FFVulkanContext *s, FFVkExecContext *e); + +/** + * Create an imageview and add it as a dependency to an execution. + */ +int ff_vk_create_imageviews(FFVulkanContext *s, FFVkExecContext *e, + VkImageView views[AV_NUM_DATA_POINTERS], + AVFrame *f); + +void ff_vk_frame_barrier(FFVulkanContext *s, FFVkExecContext *e, + AVFrame *pic, VkImageMemoryBarrier2 *bar, int *nb_bar, + VkPipelineStageFlags src_stage, + VkPipelineStageFlags dst_stage, + VkAccessFlagBits new_access, + VkImageLayout new_layout, + uint32_t new_qf); + +/** + * Memory/buffer/image allocation helpers. + */ +int ff_vk_alloc_mem(FFVulkanContext *s, VkMemoryRequirements *req, + VkMemoryPropertyFlagBits req_flags, void *alloc_extension, + VkMemoryPropertyFlagBits *mem_flags, VkDeviceMemory *mem); +int ff_vk_create_buf(FFVulkanContext *s, FFVkBuffer *buf, size_t size, + void *pNext, void *alloc_pNext, + VkBufferUsageFlags usage, VkMemoryPropertyFlagBits flags); +int ff_vk_create_avbuf(FFVulkanContext *s, AVBufferRef **ref, size_t size, + void *pNext, void *alloc_pNext, + VkBufferUsageFlags usage, VkMemoryPropertyFlagBits flags); + +/** + * Buffer management code. + */ +int ff_vk_map_buffers(FFVulkanContext *s, FFVkBuffer **buf, uint8_t *mem[], + int nb_buffers, int invalidate); +int ff_vk_unmap_buffers(FFVulkanContext *s, FFVkBuffer **buf, int nb_buffers, + int flush); + +static inline int ff_vk_map_buffer(FFVulkanContext *s, FFVkBuffer *buf, uint8_t **mem, + int invalidate) +{ + return ff_vk_map_buffers(s, (FFVkBuffer *[]){ buf }, mem, + 1, invalidate); +} + +static inline int ff_vk_unmap_buffer(FFVulkanContext *s, FFVkBuffer *buf, int flush) +{ + return ff_vk_unmap_buffers(s, (FFVkBuffer *[]){ buf }, 1, flush); +} + +void ff_vk_free_buf(FFVulkanContext *s, FFVkBuffer *buf); + +/** Initialize a pool and create AVBufferRefs containing FFVkBuffer. + * Threadsafe to use. Buffers are automatically mapped on creation if + * VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT is set in mem_props. Users should + * synchronize access themselvesd. Mainly meant for device-local buffers. */ +int ff_vk_get_pooled_buffer(FFVulkanContext *ctx, AVBufferPool **buf_pool, + AVBufferRef **buf, VkBufferUsageFlags usage, + void *create_pNext, size_t size, + VkMemoryPropertyFlagBits mem_props); + +/** + * Create a sampler. + */ +int ff_vk_init_sampler(FFVulkanContext *s, VkSampler *sampler, + int unnorm_coords, VkFilter filt); + +/** + * Shader management. + */ +int ff_vk_shader_init(FFVulkanPipeline *pl, FFVkSPIRVShader *shd, const char *name, + VkShaderStageFlags stage, uint32_t required_subgroup_size); +void ff_vk_shader_set_compute_sizes(FFVkSPIRVShader *shd, int x, int y, int z); +void ff_vk_shader_print(void *ctx, FFVkSPIRVShader *shd, int prio); +int ff_vk_shader_create(FFVulkanContext *s, FFVkSPIRVShader *shd, + uint8_t *spirv, size_t spirv_size, const char *entrypoint); +void ff_vk_shader_free(FFVulkanContext *s, FFVkSPIRVShader *shd); + +/** + * Add/update push constants for execution. + */ +int ff_vk_add_push_constant(FFVulkanPipeline *pl, int offset, int size, + VkShaderStageFlagBits stage); +void ff_vk_update_push_exec(FFVulkanContext *s, FFVkExecContext *e, + FFVulkanPipeline *pl, + VkShaderStageFlagBits stage, + int offset, size_t size, void *src); + +/** + * Add descriptor to a pipeline. Must be called before pipeline init. + */ +int ff_vk_pipeline_descriptor_set_add(FFVulkanContext *s, FFVulkanPipeline *pl, + FFVkSPIRVShader *shd, + FFVulkanDescriptorSetBinding *desc, int nb, + int singular, int print_to_shader_only); + +/* Initialize/free a pipeline. */ +int ff_vk_init_compute_pipeline(FFVulkanContext *s, FFVulkanPipeline *pl, + FFVkSPIRVShader *shd); +void ff_vk_pipeline_free(FFVulkanContext *s, FFVulkanPipeline *pl); + +/** + * Register a pipeline with an exec pool. + * Pool may be NULL if all descriptor sets are read-only. + */ +int ff_vk_exec_pipeline_register(FFVulkanContext *s, FFVkExecPool *pool, + FFVulkanPipeline *pl); + +/* Bind pipeline */ +void ff_vk_exec_bind_pipeline(FFVulkanContext *s, FFVkExecContext *e, + FFVulkanPipeline *pl); + +int ff_vk_set_descriptor_buffer(FFVulkanContext *s, FFVulkanPipeline *pl, + FFVkExecContext *e, int set, int bind, int elem, + FFVkBuffer *buf, VkDeviceSize offset, VkDeviceSize len, + VkFormat fmt); + +void ff_vk_update_descriptor_img_array(FFVulkanContext *s, FFVulkanPipeline *pl, + FFVkExecContext *e, AVFrame *f, + VkImageView *views, int set, int binding, + VkImageLayout layout, VkSampler sampler); + +/** + * Frees main context. + */ +void ff_vk_uninit(FFVulkanContext *s); + +#endif /* AVUTIL_VULKAN_H */ diff --git a/include/libavutil/vulkan_functions.h b/include/libavutil/vulkan_functions.h new file mode 100644 index 0000000..91dd8b9 --- /dev/null +++ b/include/libavutil/vulkan_functions.h @@ -0,0 +1,262 @@ +/* + * 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 AVUTIL_VULKAN_FUNCTIONS_H +#define AVUTIL_VULKAN_FUNCTIONS_H + +#define VK_NO_PROTOTYPES +#define VK_ENABLE_BETA_EXTENSIONS + +#include "hwcontext.h" +#include "hwcontext_vulkan.h" + +/* An enum of bitflags for every optional extension we need */ +typedef enum FFVulkanExtensions { + FF_VK_EXT_EXTERNAL_DMABUF_MEMORY = 1ULL << 0, /* VK_EXT_external_memory_dma_buf */ + FF_VK_EXT_DRM_MODIFIER_FLAGS = 1ULL << 1, /* VK_EXT_image_drm_format_modifier */ + FF_VK_EXT_EXTERNAL_FD_MEMORY = 1ULL << 2, /* VK_KHR_external_memory_fd */ + FF_VK_EXT_EXTERNAL_FD_SEM = 1ULL << 3, /* VK_KHR_external_semaphore_fd */ + FF_VK_EXT_EXTERNAL_HOST_MEMORY = 1ULL << 4, /* VK_EXT_external_memory_host */ + FF_VK_EXT_DEBUG_UTILS = 1ULL << 5, /* VK_EXT_debug_utils */ +#ifdef _WIN32 + FF_VK_EXT_EXTERNAL_WIN32_MEMORY = 1ULL << 6, /* VK_KHR_external_memory_win32 */ + FF_VK_EXT_EXTERNAL_WIN32_SEM = 1ULL << 7, /* VK_KHR_external_semaphore_win32 */ +#endif + FF_VK_EXT_DESCRIPTOR_BUFFER = 1ULL << 8, /* VK_EXT_descriptor_buffer */ + FF_VK_EXT_DEVICE_DRM = 1ULL << 9, /* VK_EXT_physical_device_drm */ + FF_VK_EXT_VIDEO_QUEUE = 1ULL << 10, /* VK_KHR_video_queue */ + FF_VK_EXT_VIDEO_DECODE_QUEUE = 1ULL << 11, /* VK_KHR_video_decode_queue */ + FF_VK_EXT_VIDEO_DECODE_H264 = 1ULL << 12, /* VK_EXT_video_decode_h264 */ + FF_VK_EXT_VIDEO_DECODE_H265 = 1ULL << 13, /* VK_EXT_video_decode_h265 */ + FF_VK_EXT_VIDEO_DECODE_AV1 = 1ULL << 14, /* VK_KHR_video_decode_av1 */ + FF_VK_EXT_ATOMIC_FLOAT = 1ULL << 15, /* VK_EXT_shader_atomic_float */ + FF_VK_EXT_COOP_MATRIX = 1ULL << 16, /* VK_KHR_cooperative_matrix */ + FF_VK_EXT_OPTICAL_FLOW = 1ULL << 17, /* VK_NV_optical_flow */ + FF_VK_EXT_SHADER_OBJECT = 1ULL << 18, /* VK_EXT_shader_object */ + FF_VK_EXT_PUSH_DESCRIPTOR = 1ULL << 19, /* VK_KHR_push_descriptor */ + + FF_VK_EXT_VIDEO_MAINTENANCE_1 = 1ULL << 27, /* VK_KHR_video_maintenance1 */ + FF_VK_EXT_VIDEO_ENCODE_QUEUE = 1ULL << 28, /* VK_KHR_video_encode_queue */ + FF_VK_EXT_VIDEO_ENCODE_H264 = 1ULL << 29, /* VK_KHR_video_encode_h264 */ + FF_VK_EXT_VIDEO_ENCODE_H265 = 1ULL << 30, /* VK_KHR_video_encode_h265 */ + + FF_VK_EXT_NO_FLAG = 1ULL << 31, +} FFVulkanExtensions; + +/* Macro containing every function that we utilize in our codebase */ +#define FN_LIST(MACRO) \ + /* Instance */ \ + MACRO(0, 0, FF_VK_EXT_NO_FLAG, EnumerateInstanceExtensionProperties) \ + MACRO(0, 0, FF_VK_EXT_NO_FLAG, EnumerateInstanceLayerProperties) \ + MACRO(0, 0, FF_VK_EXT_NO_FLAG, CreateInstance) \ + MACRO(1, 0, FF_VK_EXT_NO_FLAG, DestroyInstance) \ + \ + /* Debug */ \ + MACRO(1, 0, FF_VK_EXT_NO_FLAG, CreateDebugUtilsMessengerEXT) \ + MACRO(1, 0, FF_VK_EXT_NO_FLAG, DestroyDebugUtilsMessengerEXT) \ + \ + /* Device */ \ + MACRO(1, 0, FF_VK_EXT_NO_FLAG, GetDeviceProcAddr) \ + MACRO(1, 0, FF_VK_EXT_NO_FLAG, CreateDevice) \ + MACRO(1, 0, FF_VK_EXT_NO_FLAG, GetPhysicalDeviceFeatures2) \ + MACRO(1, 0, FF_VK_EXT_NO_FLAG, GetPhysicalDeviceProperties) \ + MACRO(1, 0, FF_VK_EXT_VIDEO_QUEUE, GetPhysicalDeviceVideoCapabilitiesKHR) \ + MACRO(1, 0, FF_VK_EXT_VIDEO_QUEUE, GetPhysicalDeviceVideoFormatPropertiesKHR) \ + MACRO(1, 0, FF_VK_EXT_NO_FLAG, DeviceWaitIdle) \ + MACRO(1, 0, FF_VK_EXT_NO_FLAG, DestroyDevice) \ + \ + MACRO(1, 0, FF_VK_EXT_NO_FLAG, EnumeratePhysicalDevices) \ + MACRO(1, 0, FF_VK_EXT_NO_FLAG, EnumerateDeviceExtensionProperties) \ + \ + MACRO(1, 0, FF_VK_EXT_NO_FLAG, GetPhysicalDeviceProperties2) \ + MACRO(1, 0, FF_VK_EXT_NO_FLAG, GetPhysicalDeviceMemoryProperties) \ + MACRO(1, 0, FF_VK_EXT_NO_FLAG, GetPhysicalDeviceFormatProperties2) \ + MACRO(1, 0, FF_VK_EXT_NO_FLAG, GetPhysicalDeviceImageFormatProperties2) \ + MACRO(1, 0, FF_VK_EXT_NO_FLAG, GetPhysicalDeviceQueueFamilyProperties) \ + MACRO(1, 0, FF_VK_EXT_NO_FLAG, GetPhysicalDeviceQueueFamilyProperties2) \ + MACRO(1, 0, FF_VK_EXT_COOP_MATRIX, GetPhysicalDeviceCooperativeMatrixPropertiesKHR) \ + \ + /* Command pool */ \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CreateCommandPool) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, DestroyCommandPool) \ + \ + /* Command buffer */ \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, AllocateCommandBuffers) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, BeginCommandBuffer) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, EndCommandBuffer) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, FreeCommandBuffers) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CmdDispatch) \ + \ + /* Queue */ \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, GetDeviceQueue) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, QueueSubmit) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, QueueSubmit2) \ + \ + /* Fences */ \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CreateFence) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, WaitForFences) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, ResetFences) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, DestroyFence) \ + \ + /* Semaphores */ \ + MACRO(1, 1, FF_VK_EXT_EXTERNAL_FD_SEM, GetSemaphoreFdKHR) \ + MACRO(1, 1, FF_VK_EXT_EXTERNAL_FD_SEM, ImportSemaphoreFdKHR) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CreateSemaphore) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, WaitSemaphores) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, DestroySemaphore) \ + \ + /* Memory */ \ + MACRO(1, 1, FF_VK_EXT_EXTERNAL_FD_MEMORY, GetMemoryFdKHR) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, GetMemoryFdPropertiesKHR) \ + MACRO(1, 1, FF_VK_EXT_EXTERNAL_HOST_MEMORY, GetMemoryHostPointerPropertiesEXT) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, AllocateMemory) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, MapMemory) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, FlushMappedMemoryRanges) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, InvalidateMappedMemoryRanges) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, UnmapMemory) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, FreeMemory) \ + \ + /* Commands */ \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CmdBindDescriptorSets) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CmdPushConstants) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CmdBindPipeline) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CmdPipelineBarrier) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CmdCopyBufferToImage) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CmdCopyImageToBuffer) \ + \ + /* Buffer */ \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, GetBufferMemoryRequirements2) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CreateBuffer) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, BindBufferMemory) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, GetBufferDeviceAddress) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CmdFillBuffer) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, DestroyBuffer) \ + \ + /* Image */ \ + MACRO(1, 1, FF_VK_EXT_DRM_MODIFIER_FLAGS, GetImageDrmFormatModifierPropertiesEXT) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, GetImageMemoryRequirements2) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CreateImage) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, BindImageMemory2) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, GetImageSubresourceLayout) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, DestroyImage) \ + \ + /* ImageView */ \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CreateImageView) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, DestroyImageView) \ + \ + /* DescriptorSet */ \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CreateDescriptorSetLayout) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, AllocateDescriptorSets) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CreateDescriptorPool) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, DestroyDescriptorPool) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, DestroyDescriptorSetLayout) \ + \ + /* Descriptor buffers */ \ + MACRO(1, 1, FF_VK_EXT_DESCRIPTOR_BUFFER, GetDescriptorSetLayoutSizeEXT) \ + MACRO(1, 1, FF_VK_EXT_DESCRIPTOR_BUFFER, GetDescriptorSetLayoutBindingOffsetEXT) \ + MACRO(1, 1, FF_VK_EXT_DESCRIPTOR_BUFFER, GetDescriptorEXT) \ + MACRO(1, 1, FF_VK_EXT_DESCRIPTOR_BUFFER, CmdBindDescriptorBuffersEXT) \ + MACRO(1, 1, FF_VK_EXT_DESCRIPTOR_BUFFER, CmdSetDescriptorBufferOffsetsEXT) \ + \ + /* DescriptorUpdateTemplate */ \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, UpdateDescriptorSetWithTemplate) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CreateDescriptorUpdateTemplate) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, DestroyDescriptorUpdateTemplate) \ + \ + /* Descriptors */ \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, UpdateDescriptorSets) \ + MACRO(1, 1, FF_VK_EXT_PUSH_DESCRIPTOR, CmdPushDescriptorSetKHR) \ + \ + /* Queries */ \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CreateQueryPool) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, GetQueryPoolResults) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, ResetQueryPool) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CmdBeginQuery) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CmdEndQuery) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CmdResetQueryPool) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, DestroyQueryPool) \ + \ + /* sync2 */ \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CmdPipelineBarrier2) \ + \ + /* Video queue */ \ + MACRO(1, 1, FF_VK_EXT_VIDEO_QUEUE, CreateVideoSessionKHR) \ + MACRO(1, 1, FF_VK_EXT_VIDEO_QUEUE, CreateVideoSessionParametersKHR) \ + MACRO(1, 1, FF_VK_EXT_VIDEO_QUEUE, GetVideoSessionMemoryRequirementsKHR) \ + MACRO(1, 1, FF_VK_EXT_VIDEO_QUEUE, BindVideoSessionMemoryKHR) \ + MACRO(1, 1, FF_VK_EXT_VIDEO_QUEUE, CmdBeginVideoCodingKHR) \ + MACRO(1, 1, FF_VK_EXT_VIDEO_QUEUE, CmdControlVideoCodingKHR) \ + MACRO(1, 1, FF_VK_EXT_VIDEO_QUEUE, CmdEndVideoCodingKHR) \ + MACRO(1, 1, FF_VK_EXT_VIDEO_QUEUE, DestroyVideoSessionParametersKHR) \ + MACRO(1, 1, FF_VK_EXT_VIDEO_QUEUE, DestroyVideoSessionKHR) \ + \ + /* Video decoding */ \ + MACRO(1, 1, FF_VK_EXT_VIDEO_DECODE_QUEUE, CmdDecodeVideoKHR) \ + \ + /* Video encoding */ \ + MACRO(1, 1, FF_VK_EXT_VIDEO_ENCODE_QUEUE, CmdEncodeVideoKHR) \ + MACRO(1, 1, FF_VK_EXT_VIDEO_ENCODE_QUEUE, GetEncodedVideoSessionParametersKHR) \ + MACRO(1, 0, FF_VK_EXT_VIDEO_ENCODE_QUEUE, GetPhysicalDeviceVideoEncodeQualityLevelPropertiesKHR) \ + \ + /* Pipeline */ \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CreatePipelineLayout) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, DestroyPipelineLayout) \ + \ + /* PipelineLayout */ \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CreateComputePipelines) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, DestroyPipeline) \ + \ + /* Sampler */ \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CreateSamplerYcbcrConversion) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, DestroySamplerYcbcrConversion) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CreateSampler) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, DestroySampler) \ + \ + /* Optical flow */ \ + MACRO(1, 1, FF_VK_EXT_OPTICAL_FLOW, BindOpticalFlowSessionImageNV) \ + MACRO(1, 1, FF_VK_EXT_OPTICAL_FLOW, CmdOpticalFlowExecuteNV) \ + MACRO(1, 1, FF_VK_EXT_OPTICAL_FLOW, CreateOpticalFlowSessionNV) \ + MACRO(1, 1, FF_VK_EXT_OPTICAL_FLOW, DestroyOpticalFlowSessionNV) \ + MACRO(1, 0, FF_VK_EXT_OPTICAL_FLOW, GetPhysicalDeviceOpticalFlowImageFormatsNV)\ + \ + /* Shaders */ \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, CreateShaderModule) \ + MACRO(1, 1, FF_VK_EXT_NO_FLAG, DestroyShaderModule) \ + MACRO(1, 1, FF_VK_EXT_SHADER_OBJECT, CmdBindShadersEXT) \ + MACRO(1, 1, FF_VK_EXT_SHADER_OBJECT, CreateShadersEXT) \ + MACRO(1, 1, FF_VK_EXT_SHADER_OBJECT, DestroyShaderEXT) \ + MACRO(1, 1, FF_VK_EXT_SHADER_OBJECT, GetShaderBinaryDataEXT) + +/* Macro containing every win32 specific function that we utilize in our codebase */ +#define FN_LIST_WIN32(MACRO) \ + MACRO(1, 1, FF_VK_EXT_EXTERNAL_WIN32_SEM, GetSemaphoreWin32HandleKHR) \ + MACRO(1, 1, FF_VK_EXT_EXTERNAL_WIN32_MEMORY, GetMemoryWin32HandleKHR) + +/* Macro to turn a function name into a definition */ +#define PFN_DEF(req_inst, req_dev, ext_flag, name) \ + PFN_vk##name name; + +/* Structure with the definition of all listed functions */ +typedef struct FFVulkanFunctions { + FN_LIST(PFN_DEF) +#ifdef _WIN32 + FN_LIST_WIN32(PFN_DEF) +#endif +} FFVulkanFunctions; + +#endif /* AVUTIL_VULKAN_FUNCTIONS_H */ diff --git a/include/libavutil/vulkan_loader.h b/include/libavutil/vulkan_loader.h new file mode 100644 index 0000000..2022eb3 --- /dev/null +++ b/include/libavutil/vulkan_loader.h @@ -0,0 +1,168 @@ +/* + * 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 AVUTIL_VULKAN_LOADER_H +#define AVUTIL_VULKAN_LOADER_H + +#include + +#include "avassert.h" +#include "vulkan_functions.h" + +/* Macro to turn a function name into a loader struct */ +#define PFN_LOAD_INFO(req_inst, req_dev, ext_flag, name) \ + { \ + req_inst, \ + req_dev, \ + offsetof(FFVulkanFunctions, name), \ + ext_flag, \ + }, + +static inline uint64_t ff_vk_extensions_to_mask(const char * const *extensions, + int nb_extensions) +{ + static const struct ExtensionMap { + const char *name; + FFVulkanExtensions flag; + } extension_map[] = { + { VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_DMABUF_MEMORY }, + { VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME, FF_VK_EXT_DRM_MODIFIER_FLAGS }, + { VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_FD_MEMORY }, + { VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_FD_SEM }, + { VK_EXT_EXTERNAL_MEMORY_HOST_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_HOST_MEMORY }, + { VK_EXT_DEBUG_UTILS_EXTENSION_NAME, FF_VK_EXT_DEBUG_UTILS }, + { VK_EXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME, FF_VK_EXT_DEVICE_DRM }, + { VK_EXT_SHADER_ATOMIC_FLOAT_EXTENSION_NAME, FF_VK_EXT_ATOMIC_FLOAT }, + { VK_KHR_COOPERATIVE_MATRIX_EXTENSION_NAME, FF_VK_EXT_COOP_MATRIX }, + { VK_NV_OPTICAL_FLOW_EXTENSION_NAME, FF_VK_EXT_OPTICAL_FLOW }, + { VK_EXT_SHADER_OBJECT_EXTENSION_NAME, FF_VK_EXT_SHADER_OBJECT }, + { VK_KHR_VIDEO_MAINTENANCE_1_EXTENSION_NAME, FF_VK_EXT_VIDEO_MAINTENANCE_1 }, +#ifdef _WIN32 + { VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_WIN32_MEMORY }, + { VK_KHR_EXTERNAL_SEMAPHORE_WIN32_EXTENSION_NAME, FF_VK_EXT_EXTERNAL_WIN32_SEM }, +#endif + { VK_EXT_DESCRIPTOR_BUFFER_EXTENSION_NAME, FF_VK_EXT_DESCRIPTOR_BUFFER, }, + { VK_KHR_VIDEO_QUEUE_EXTENSION_NAME, FF_VK_EXT_VIDEO_QUEUE }, + { VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME, FF_VK_EXT_VIDEO_ENCODE_QUEUE }, + { VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME, FF_VK_EXT_VIDEO_DECODE_QUEUE }, + { VK_KHR_VIDEO_ENCODE_H264_EXTENSION_NAME, FF_VK_EXT_VIDEO_ENCODE_H264 }, + { VK_KHR_VIDEO_DECODE_H264_EXTENSION_NAME, FF_VK_EXT_VIDEO_DECODE_H264 }, + { VK_KHR_VIDEO_ENCODE_H265_EXTENSION_NAME, FF_VK_EXT_VIDEO_ENCODE_H265 }, + { VK_KHR_VIDEO_DECODE_H265_EXTENSION_NAME, FF_VK_EXT_VIDEO_DECODE_H265 }, + { VK_KHR_VIDEO_DECODE_AV1_EXTENSION_NAME, FF_VK_EXT_VIDEO_DECODE_AV1 }, + { VK_KHR_PUSH_DESCRIPTOR_EXTENSION_NAME, FF_VK_EXT_PUSH_DESCRIPTOR }, + }; + + FFVulkanExtensions mask = 0x0; + + for (int i = 0; i < nb_extensions; i++) { + for (int j = 0; j < FF_ARRAY_ELEMS(extension_map); j++) { + if (!strcmp(extensions[i], extension_map[j].name)) { + mask |= extension_map[j].flag; + continue; + } + } + } + + return mask; +} + +/** + * Function loader. + * Vulkan function from scratch loading happens in 3 stages - the first one + * is before any initialization has happened, and you have neither an instance + * structure nor a device structure. At this stage, you can only get the bare + * minimals to initialize an instance. + * The second stage is when you have an instance. At this stage, you can + * initialize a VkDevice, and have an idea of what extensions each device + * supports. + * Finally, in the third stage, you can proceed and load all core functions, + * plus you can be sure that any extensions you've enabled during device + * initialization will be available. + */ +static inline int ff_vk_load_functions(AVHWDeviceContext *ctx, + FFVulkanFunctions *vk, + uint64_t extensions_mask, + int has_inst, int has_dev) +{ + AVVulkanDeviceContext *hwctx = ctx->hwctx; + + static const struct FunctionLoadInfo { + char req_inst; + char req_dev; + uint16_t struct_offset; + FFVulkanExtensions ext_flag; + } vk_load_info[] = { + FN_LIST(PFN_LOAD_INFO) +#ifdef _WIN32 + FN_LIST_WIN32(PFN_LOAD_INFO) +#endif + }; + // Concatenate the names to avoid relocations. The resulting string + // will end with \0\0 +#define FUNC_NAME(req_inst, req_dev, ext_flag, name) "vk"#name"\0" + const char *name = + FN_LIST(FUNC_NAME) +#ifdef _WIN32 + FN_LIST_WIN32(FUNC_NAME) +#endif + ; +#undef FUNC_NAME + + for (int i = 0; i < FF_ARRAY_ELEMS(vk_load_info); name += strlen(name) + 1, i++) { + const struct FunctionLoadInfo *load = &vk_load_info[i]; + static const char extensions[][4] = { "", "EXT", "KHR" }; + PFN_vkVoidFunction fn; + + if (load->req_dev && !has_dev) + continue; + if (load->req_inst && !has_inst) + continue; + + for (int j = 0; j < FF_ARRAY_ELEMS(extensions); j++) { + char ext_name[128]; + av_unused int n; + + n = snprintf(ext_name, sizeof(ext_name), "%s%s", name, extensions[j]); + av_assert1(n < sizeof(ext_name)); + + if (load->req_dev) + fn = vk->GetDeviceProcAddr(hwctx->act_dev, ext_name); + else if (load->req_inst) + fn = hwctx->get_proc_addr(hwctx->inst, ext_name); + else + fn = hwctx->get_proc_addr(NULL, ext_name); + + if (fn) + break; + } + + if (!fn && ((extensions_mask &~ FF_VK_EXT_NO_FLAG) & load->ext_flag)) { + av_log(ctx, AV_LOG_ERROR, "Loader error, function \"%s\" indicated " + "as supported, but got NULL function pointer!\n", name); + return AVERROR_EXTERNAL; + } + + *(PFN_vkVoidFunction *)((uint8_t *)vk + load->struct_offset) = fn; + } + av_assert1(*name == '\0'); + + return 0; +} + +#endif /* AVUTIL_VULKAN_LOADER_H */ diff --git a/include/libavutil/wchar_filename.h b/include/libavutil/wchar_filename.h new file mode 100644 index 0000000..1370a08 --- /dev/null +++ b/include/libavutil/wchar_filename.h @@ -0,0 +1,281 @@ +/* + * 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 AVUTIL_WCHAR_FILENAME_H +#define AVUTIL_WCHAR_FILENAME_H + +#ifdef _WIN32 + +#include +#include +#include +#include "mem.h" + +av_warn_unused_result +static inline int utf8towchar(const char *filename_utf8, wchar_t **filename_w) +{ + int num_chars; + num_chars = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, filename_utf8, -1, NULL, 0); + if (num_chars <= 0) { + *filename_w = NULL; + errno = EINVAL; + return -1; + } + *filename_w = (wchar_t *)av_calloc(num_chars, sizeof(wchar_t)); + if (!*filename_w) { + errno = ENOMEM; + return -1; + } + MultiByteToWideChar(CP_UTF8, 0, filename_utf8, -1, *filename_w, num_chars); + return 0; +} + +av_warn_unused_result +static inline int wchartocp(unsigned int code_page, const wchar_t *filename_w, + char **filename) +{ + DWORD flags = code_page == CP_UTF8 ? WC_ERR_INVALID_CHARS : 0; + int num_chars = WideCharToMultiByte(code_page, flags, filename_w, -1, + NULL, 0, NULL, NULL); + if (num_chars <= 0) { + *filename = NULL; + errno = EINVAL; + return -1; + } + *filename = (char *)av_malloc_array(num_chars, sizeof **filename); + if (!*filename) { + errno = ENOMEM; + return -1; + } + WideCharToMultiByte(code_page, flags, filename_w, -1, + *filename, num_chars, NULL, NULL); + return 0; +} + +av_warn_unused_result +static inline int wchartoutf8(const wchar_t *filename_w, char **filename) +{ + return wchartocp(CP_UTF8, filename_w, filename); +} + +av_warn_unused_result +static inline int wchartoansi(const wchar_t *filename_w, char **filename) +{ + return wchartocp(CP_ACP, filename_w, filename); +} + +av_warn_unused_result +static inline int utf8toansi(const char *filename_utf8, char **filename) +{ + wchar_t *filename_w = NULL; + int ret = -1; + if (utf8towchar(filename_utf8, &filename_w)) + return -1; + + if (!filename_w) { + *filename = NULL; + return 0; + } + + ret = wchartoansi(filename_w, filename); + av_free(filename_w); + return ret; +} + +/** + * Checks for extended path prefixes for which normalization needs to be skipped. + * see .NET6: PathInternal.IsExtended() + * https://github.com/dotnet/runtime/blob/9260c249140ef90b4299d0fe1aa3037e25228518/src/libraries/Common/src/System/IO/PathInternal.Windows.cs#L165 + */ +static inline int path_is_extended(const wchar_t *path) +{ + if (path[0] == L'\\' && (path[1] == L'\\' || path[1] == L'?') && path[2] == L'?' && path[3] == L'\\') + return 1; + + return 0; +} + +/** + * Checks for a device path prefix. + * see .NET6: PathInternal.IsDevice() + * we don't check forward slashes and extended paths (as already done) + * https://github.com/dotnet/runtime/blob/9260c249140ef90b4299d0fe1aa3037e25228518/src/libraries/Common/src/System/IO/PathInternal.Windows.cs#L132 + */ +static inline int path_is_device_path(const wchar_t *path) +{ + if (path[0] == L'\\' && path[1] == L'\\' && path[2] == L'.' && path[3] == L'\\') + return 1; + + return 0; +} + +/** + * Performs path normalization by calling GetFullPathNameW(). + * see .NET6: PathHelper.GetFullPathName() + * https://github.com/dotnet/runtime/blob/2a99e18eedabcf1add064c099da59d9301ce45e0/src/libraries/System.Private.CoreLib/src/System/IO/PathHelper.Windows.cs#L70 + */ +static inline int get_full_path_name(wchar_t **ppath_w) +{ + int num_chars; + wchar_t *temp_w; + + num_chars = GetFullPathNameW(*ppath_w, 0, NULL, NULL); + if (num_chars <= 0) { + errno = EINVAL; + return -1; + } + + temp_w = (wchar_t *)av_calloc(num_chars, sizeof(wchar_t)); + if (!temp_w) { + errno = ENOMEM; + return -1; + } + + num_chars = GetFullPathNameW(*ppath_w, num_chars, temp_w, NULL); + if (num_chars <= 0) { + av_free(temp_w); + errno = EINVAL; + return -1; + } + + av_freep(ppath_w); + *ppath_w = temp_w; + + return 0; +} + +/** + * Normalizes a Windows file or folder path. + * Expansion of short paths (with 8.3 path components) is currently omitted + * as it is not required for accessing long paths. + * see .NET6: PathHelper.Normalize() + * https://github.com/dotnet/runtime/blob/2a99e18eedabcf1add064c099da59d9301ce45e0/src/libraries/System.Private.CoreLib/src/System/IO/PathHelper.Windows.cs#L25 + */ +static inline int path_normalize(wchar_t **ppath_w) +{ + int ret; + + if ((ret = get_full_path_name(ppath_w)) < 0) + return ret; + + /* What .NET does at this point is to call PathHelper.TryExpandShortFileName() + * in case the path contains a '~' character. + * We don't need to do this as we don't need to normalize the file name + * for presentation, and the extended path prefix works with 8.3 path + * components as well + */ + return 0; +} + +/** + * Adds an extended path or UNC prefix to longs paths or paths ending + * with a space or a dot. (' ' or '.'). + * This function expects that the path has been normalized before by + * calling path_normalize() and it doesn't check whether the path is + * actually long (> MAX_PATH). + * see .NET6: PathInternal.EnsureExtendedPrefix() + * https://github.com/dotnet/runtime/blob/9260c249140ef90b4299d0fe1aa3037e25228518/src/libraries/Common/src/System/IO/PathInternal.Windows.cs#L107 + */ +static inline int add_extended_prefix(wchar_t **ppath_w) +{ + const wchar_t *unc_prefix = L"\\\\?\\UNC\\"; + const wchar_t *extended_path_prefix = L"\\\\?\\"; + const wchar_t *path_w = *ppath_w; + const size_t len = wcslen(path_w); + wchar_t *temp_w; + + /* We're skipping the check IsPartiallyQualified() because + * we expect to have called GetFullPathNameW() already. */ + if (len < 2 || path_is_extended(*ppath_w) || path_is_device_path(*ppath_w)) { + return 0; + } + + if (path_w[0] == L'\\' && path_w[1] == L'\\') { + /* unc_prefix length is 8 plus 1 for terminating zeros, + * we subtract 2 for the leading '\\' of the original path */ + temp_w = (wchar_t *)av_calloc(len - 2 + 8 + 1, sizeof(wchar_t)); + if (!temp_w) { + errno = ENOMEM; + return -1; + } + wcscpy(temp_w, unc_prefix); + wcscat(temp_w, path_w + 2); + } else { + // The length of extended_path_prefix is 4 plus 1 for terminating zeros + temp_w = (wchar_t *)av_calloc(len + 4 + 1, sizeof(wchar_t)); + if (!temp_w) { + errno = ENOMEM; + return -1; + } + wcscpy(temp_w, extended_path_prefix); + wcscat(temp_w, path_w); + } + + av_freep(ppath_w); + *ppath_w = temp_w; + + return 0; +} + +/** + * Converts a file or folder path to wchar_t for use with Windows file + * APIs. Paths with extended path prefix (either '\\?\' or \??\') are + * left unchanged. + * All other paths are normalized and converted to absolute paths. + * Longs paths (>= MAX_PATH) are prefixed with the extended path or extended + * UNC path prefix. + * see .NET6: Path.GetFullPath() and Path.GetFullPathInternal() + * https://github.com/dotnet/runtime/blob/2a99e18eedabcf1add064c099da59d9301ce45e0/src/libraries/System.Private.CoreLib/src/System/IO/Path.Windows.cs#L126 + */ +static inline int get_extended_win32_path(const char *path, wchar_t **ppath_w) +{ + int ret; + size_t len; + + if ((ret = utf8towchar(path, ppath_w)) < 0) + return ret; + + if (path_is_extended(*ppath_w)) { + /* Paths prefixed with '\\?\' or \??\' are considered normalized by definition. + * Windows doesn't normalize those paths and neither should we. + */ + return 0; + } + + if ((ret = path_normalize(ppath_w)) < 0) { + av_freep(ppath_w); + return ret; + } + + /* see .NET6: PathInternal.EnsureExtendedPrefixIfNeeded() + * https://github.com/dotnet/runtime/blob/9260c249140ef90b4299d0fe1aa3037e25228518/src/libraries/Common/src/System/IO/PathInternal.Windows.cs#L92 + */ + len = wcslen(*ppath_w); + if (len >= MAX_PATH) { + if ((ret = add_extended_prefix(ppath_w)) < 0) { + av_freep(ppath_w); + return ret; + } + } + + return 0; +} + +#endif + +#endif /* AVUTIL_WCHAR_FILENAME_H */ diff --git a/include/libavutil/xga_font_data.h b/include/libavutil/xga_font_data.h new file mode 100644 index 0000000..69dc337 --- /dev/null +++ b/include/libavutil/xga_font_data.h @@ -0,0 +1,35 @@ +/* + * CGA/EGA/VGA ROM font data + * + * 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 + */ + +/** + * @file + * CGA/EGA/VGA ROM font data + */ + +#ifndef AVUTIL_XGA_FONT_DATA_H +#define AVUTIL_XGA_FONT_DATA_H + +#include +#include "internal.h" + +extern av_export_avutil const uint8_t avpriv_cga_font[2048]; +extern av_export_avutil const uint8_t avpriv_vga16_font[4096]; + +#endif /* AVUTIL_XGA_FONT_DATA_H */ diff --git a/include/libswresample/audioconvert.h b/include/libswresample/audioconvert.h new file mode 100644 index 0000000..bb143a8 --- /dev/null +++ b/include/libswresample/audioconvert.h @@ -0,0 +1,77 @@ +/* + * audio conversion + * Copyright (c) 2006 Michael Niedermayer + * Copyright (c) 2008 Peter Ross + * + * 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 SWRESAMPLE_AUDIOCONVERT_H +#define SWRESAMPLE_AUDIOCONVERT_H + +/** + * @file + * Audio format conversion routines + */ + + +#include "swresample_internal.h" + + +typedef void (conv_func_type)(uint8_t *po, const uint8_t *pi, int is, int os, uint8_t *end); +typedef void (simd_func_type)(uint8_t **dst, const uint8_t **src, int len); + +typedef struct AudioConvert { + int channels; + int in_simd_align_mask; + int out_simd_align_mask; + conv_func_type *conv_f; + simd_func_type *simd_f; + const int *ch_map; + uint8_t silence[8]; ///< silence input sample +}AudioConvert; + +/** + * Create an audio sample format converter context + * @param out_fmt Output sample format + * @param in_fmt Input sample format + * @param channels Number of channels + * @param flags See AV_CPU_FLAG_xx + * @param ch_map list of the channels id to pick from the source stream, NULL + * if all channels must be selected + * @return NULL on error + */ +AudioConvert *swri_audio_convert_alloc(enum AVSampleFormat out_fmt, + enum AVSampleFormat in_fmt, + int channels, const int *ch_map, + int flags); + +/** + * Free audio sample format converter context. + * and set the pointer to NULL + */ +void swri_audio_convert_free(AudioConvert **ctx); + +/** + * Convert between audio sample formats + * @param[in] out array of output buffers for each channel. set to NULL to ignore processing of the given channel. + * @param[in] in array of input buffers for each channel + * @param len length of audio frame size (measured in samples) + */ +int swri_audio_convert(AudioConvert *ctx, AudioData *out, AudioData *in, int len); + +#endif /* SWRESAMPLE_AUDIOCONVERT_H */ diff --git a/include/libswresample/resample.h b/include/libswresample/resample.h new file mode 100644 index 0000000..1731dad --- /dev/null +++ b/include/libswresample/resample.h @@ -0,0 +1,68 @@ +/* + * audio resampling + * Copyright (c) 2004-2012 Michael Niedermayer + * + * 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 SWRESAMPLE_RESAMPLE_H +#define SWRESAMPLE_RESAMPLE_H + +#include "libavutil/log.h" +#include "libavutil/samplefmt.h" + +#include "swresample_internal.h" + +typedef struct ResampleContext { + const AVClass *av_class; + uint8_t *filter_bank; + int filter_length; + int filter_alloc; + int ideal_dst_incr; + int dst_incr; + int dst_incr_div; + int dst_incr_mod; + int index; + int frac; + int src_incr; + int compensation_distance; + int phase_count; + int linear; + enum SwrFilterType filter_type; + double kaiser_beta; + double factor; + enum AVSampleFormat format; + int felem_size; + int filter_shift; + int phase_count_compensation; /* desired phase_count when compensation is enabled */ + + struct { + void (*resample_one)(void *dst, const void *src, + int n, int64_t index, int64_t incr); + int (*resample_common)(struct ResampleContext *c, void *dst, + const void *src, int n, int update_ctx); + int (*resample_linear)(struct ResampleContext *c, void *dst, + const void *src, int n, int update_ctx); + } dsp; +} ResampleContext; + +void swri_resample_dsp_init(ResampleContext *c); +void swri_resample_dsp_x86_init(ResampleContext *c); +void swri_resample_dsp_arm_init(ResampleContext *c); +void swri_resample_dsp_aarch64_init(ResampleContext *c); + +#endif /* SWRESAMPLE_RESAMPLE_H */ diff --git a/include/libswresample/swresample.h b/include/libswresample/swresample.h index 26d42fa..0e1929b 100644 --- a/include/libswresample/swresample.h +++ b/include/libswresample/swresample.h @@ -49,8 +49,8 @@ * matrix). This is using the swr_alloc() function. * @code * SwrContext *swr = swr_alloc(); - * av_opt_set_channel_layout(swr, "in_channel_layout", AV_CH_LAYOUT_5POINT1, 0); - * av_opt_set_channel_layout(swr, "out_channel_layout", AV_CH_LAYOUT_STEREO, 0); + * av_opt_set_chlayout(swr, "in_chlayout", &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1, 0); + * av_opt_set_chlayout(swr, "out_chlayout", &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO, 0); * av_opt_set_int(swr, "in_sample_rate", 48000, 0); * av_opt_set_int(swr, "out_sample_rate", 44100, 0); * av_opt_set_sample_fmt(swr, "in_sample_fmt", AV_SAMPLE_FMT_FLTP, 0); @@ -73,7 +73,7 @@ * * Once all values have been set, it must be initialized with swr_init(). If * you need to change the conversion parameters, you can change the parameters - * using @ref AVOptions, as described above in the first example; or by using + * using @ref avoptions, as described above in the first example; or by using * swr_alloc_set_opts2(), but with the first argument the allocated context. * You must then call swr_init() again. * @@ -234,35 +234,6 @@ int swr_init(struct SwrContext *s); */ int swr_is_initialized(struct SwrContext *s); -#if FF_API_OLD_CHANNEL_LAYOUT -/** - * Allocate SwrContext if needed and set/reset common parameters. - * - * This function does not require s to be allocated with swr_alloc(). On the - * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters - * on the allocated context. - * - * @param s existing Swr context if available, or NULL if not - * @param out_ch_layout output channel layout (AV_CH_LAYOUT_*) - * @param out_sample_fmt output sample format (AV_SAMPLE_FMT_*). - * @param out_sample_rate output sample rate (frequency in Hz) - * @param in_ch_layout input channel layout (AV_CH_LAYOUT_*) - * @param in_sample_fmt input sample format (AV_SAMPLE_FMT_*). - * @param in_sample_rate input sample rate (frequency in Hz) - * @param log_offset logging level offset - * @param log_ctx parent logging context, can be NULL - * - * @see swr_init(), swr_free() - * @return NULL on error, allocated context otherwise - * @deprecated use @ref swr_alloc_set_opts2() - */ -attribute_deprecated -struct SwrContext *swr_alloc_set_opts(struct SwrContext *s, - int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, - int64_t in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate, - int log_offset, void *log_ctx); -#endif - /** * Allocate SwrContext if needed and set/reset common parameters. * @@ -286,8 +257,8 @@ struct SwrContext *swr_alloc_set_opts(struct SwrContext *s, * On error, the Swr context is freed and *ps set to NULL. */ int swr_alloc_set_opts2(struct SwrContext **ps, - AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, - AVChannelLayout *in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate, + const AVChannelLayout *out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate, + const AVChannelLayout *in_ch_layout, enum AVSampleFormat in_sample_fmt, int in_sample_rate, int log_offset, void *log_ctx); /** * @} @@ -340,8 +311,8 @@ void swr_close(struct SwrContext *s); * * @return number of samples output per channel, negative value on error */ -int swr_convert(struct SwrContext *s, uint8_t **out, int out_count, - const uint8_t **in , int in_count); +int swr_convert(struct SwrContext *s, uint8_t * const *out, int out_count, + const uint8_t * const *in , int in_count); /** * Convert the next timestamp from input to output @@ -354,8 +325,8 @@ int swr_convert(struct SwrContext *s, uint8_t **out, int out_count, * in this case the output timestamps will match output sample numbers. * See ffmpeg-resampler(1) for the two modes of compensation. * - * @param s[in] initialized Swr context - * @param pts[in] timestamp for the next input sample, INT64_MIN if unknown + * @param[in] s initialized Swr context + * @param[in] pts timestamp for the next input sample, INT64_MIN if unknown * @see swr_set_compensation(), swr_drop_output(), and swr_inject_silence() are * function used internally for timestamp compensation. * @return the output timestamp for the next output sample @@ -399,40 +370,6 @@ int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensatio */ int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map); -#if FF_API_OLD_CHANNEL_LAYOUT -/** - * Generate a channel mixing matrix. - * - * This function is the one used internally by libswresample for building the - * default mixing matrix. It is made public just as a utility function for - * building custom matrices. - * - * @param in_layout input channel layout - * @param out_layout output channel layout - * @param center_mix_level mix level for the center channel - * @param surround_mix_level mix level for the surround channel(s) - * @param lfe_mix_level mix level for the low-frequency effects channel - * @param rematrix_maxval if 1.0, coefficients will be normalized to prevent - * overflow. if INT_MAX, coefficients will not be - * normalized. - * @param[out] matrix mixing coefficients; matrix[i + stride * o] is - * the weight of input channel i in output channel o. - * @param stride distance between adjacent input channels in the - * matrix array - * @param matrix_encoding matrixed stereo downmix mode (e.g. dplii) - * @param log_ctx parent logging context, can be NULL - * @return 0 on success, negative AVERROR code on failure - * @deprecated use @ref swr_build_matrix2() - */ -attribute_deprecated -int swr_build_matrix(uint64_t in_layout, uint64_t out_layout, - double center_mix_level, double surround_mix_level, - double lfe_mix_level, double rematrix_maxval, - double rematrix_volume, double *matrix, - int stride, enum AVMatrixEncoding matrix_encoding, - void *log_ctx); -#endif - /** * Generate a channel mixing matrix. * @@ -636,8 +573,8 @@ int swr_convert_frame(SwrContext *swr, * @see swr_close(); * * @param swr audio resample context - * @param output output AVFrame - * @param input input AVFrame + * @param out output AVFrame + * @param in input AVFrame * @return 0 on success, AVERROR on failure. */ int swr_config_frame(SwrContext *swr, const AVFrame *out, const AVFrame *in); diff --git a/include/libswresample/swresample_internal.h b/include/libswresample/swresample_internal.h new file mode 100644 index 0000000..7e46b16 --- /dev/null +++ b/include/libswresample/swresample_internal.h @@ -0,0 +1,220 @@ +/* + * Copyright (C) 2011-2013 Michael Niedermayer (michaelni@gmx.at) + * + * This file is part of libswresample + * + * libswresample 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. + * + * libswresample 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 libswresample; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef SWRESAMPLE_SWRESAMPLE_INTERNAL_H +#define SWRESAMPLE_SWRESAMPLE_INTERNAL_H + +#include "swresample.h" +#include "libavutil/channel_layout.h" +#include "config.h" + +#define SWR_CH_MAX 64 + +#define SQRT3_2 1.22474487139158904909 /* sqrt(3/2) */ + +#define NS_TAPS 20 + +#if ARCH_X86_64 +typedef int64_t integer; +#else +typedef int integer; +#endif + +typedef void (mix_1_1_func_type)(void *out, const void *in, void *coeffp, integer index, integer len); +typedef void (mix_2_1_func_type)(void *out, const void *in1, const void *in2, void *coeffp, integer index1, integer index2, integer len); + +typedef void (mix_any_func_type)(uint8_t **out, const uint8_t **in1, void *coeffp, integer len); + +typedef struct AudioData{ + uint8_t *ch[SWR_CH_MAX]; ///< samples buffer per channel + uint8_t *data; ///< samples buffer + int ch_count; ///< number of channels + int bps; ///< bytes per sample + int count; ///< number of samples + int planar; ///< 1 if planar audio, 0 otherwise + enum AVSampleFormat fmt; ///< sample format +} AudioData; + +struct DitherContext { + int method; + int noise_pos; + float scale; + float noise_scale; ///< Noise scale + int ns_taps; ///< Noise shaping dither taps + float ns_scale; ///< Noise shaping dither scale + float ns_scale_1; ///< Noise shaping dither scale^-1 + int ns_pos; ///< Noise shaping dither position + float ns_coeffs[NS_TAPS]; ///< Noise shaping filter coefficients + float ns_errors[SWR_CH_MAX][2*NS_TAPS]; + AudioData noise; ///< noise used for dithering + AudioData temp; ///< temporary storage when writing into the input buffer isn't possible + int output_sample_bits; ///< the number of used output bits, needed to scale dither correctly +}; + +typedef struct ResampleContext * (* resample_init_func)(struct ResampleContext *c, int out_rate, int in_rate, int filter_size, int phase_shift, int linear, + double cutoff, enum AVSampleFormat format, enum SwrFilterType filter_type, double kaiser_beta, double precision, int cheby, int exact_rational); +typedef void (* resample_free_func)(struct ResampleContext **c); +typedef int (* multiple_resample_func)(struct ResampleContext *c, AudioData *dst, int dst_size, AudioData *src, int src_size, int *consumed); +typedef int (* resample_flush_func)(struct SwrContext *c); +typedef int (* set_compensation_func)(struct ResampleContext *c, int sample_delta, int compensation_distance); +typedef int64_t (* get_delay_func)(struct SwrContext *s, int64_t base); +typedef int (* invert_initial_buffer_func)(struct ResampleContext *c, AudioData *dst, const AudioData *src, int src_size, int *dst_idx, int *dst_count); +typedef int64_t (* get_out_samples_func)(struct SwrContext *s, int in_samples); + +struct Resampler { + resample_init_func init; + resample_free_func free; + multiple_resample_func multiple_resample; + resample_flush_func flush; + set_compensation_func set_compensation; + get_delay_func get_delay; + invert_initial_buffer_func invert_initial_buffer; + get_out_samples_func get_out_samples; +}; + +extern struct Resampler const swri_resampler; +extern struct Resampler const swri_soxr_resampler; + +struct SwrContext { + const AVClass *av_class; ///< AVClass used for AVOption and av_log() + int log_level_offset; ///< logging level offset + void *log_ctx; ///< parent logging context + enum AVSampleFormat in_sample_fmt; ///< input sample format + enum AVSampleFormat int_sample_fmt; ///< internal sample format (AV_SAMPLE_FMT_FLTP or AV_SAMPLE_FMT_S16P) + enum AVSampleFormat out_sample_fmt; ///< output sample format + AVChannelLayout used_ch_layout; ///< number of used input channels (mapped channel count if channel_map, otherwise in.ch_count) + AVChannelLayout in_ch_layout; ///< input channel layout + AVChannelLayout out_ch_layout; ///< output channel layout + int in_sample_rate; ///< input sample rate + int out_sample_rate; ///< output sample rate + int flags; ///< miscellaneous flags such as SWR_FLAG_RESAMPLE + float slev; ///< surround mixing level + float clev; ///< center mixing level + float lfe_mix_level; ///< LFE mixing level + float rematrix_volume; ///< rematrixing volume coefficient + float rematrix_maxval; ///< maximum value for rematrixing output + int matrix_encoding; /**< matrixed stereo encoding */ + const int *channel_map; ///< channel index (or -1 if muted channel) map + int engine; + + AVChannelLayout user_used_chlayout; ///< User set used channel layout + AVChannelLayout user_in_chlayout; ///< User set input channel layout + AVChannelLayout user_out_chlayout; ///< User set output channel layout + enum AVSampleFormat user_int_sample_fmt; ///< User set internal sample format + int user_dither_method; ///< User set dither method + + struct DitherContext dither; + + int filter_size; /**< length of each FIR filter in the resampling filterbank relative to the cutoff frequency */ + int phase_shift; /**< log2 of the number of entries in the resampling polyphase filterbank */ + int linear_interp; /**< if 1 then the resampling FIR filter will be linearly interpolated */ + int exact_rational; /**< if 1 then enable non power of 2 phase_count */ + double cutoff; /**< resampling cutoff frequency (swr: 6dB point; soxr: 0dB point). 1.0 corresponds to half the output sample rate */ + int filter_type; /**< swr resampling filter type */ + double kaiser_beta; /**< swr beta value for Kaiser window (only applicable if filter_type == AV_FILTER_TYPE_KAISER) */ + double precision; /**< soxr resampling precision (in bits) */ + int cheby; /**< soxr: if 1 then passband rolloff will be none (Chebyshev) & irrational ratio approximation precision will be higher */ + + float min_compensation; ///< swr minimum below which no compensation will happen + float min_hard_compensation; ///< swr minimum below which no silence inject / sample drop will happen + float soft_compensation_duration; ///< swr duration over which soft compensation is applied + float max_soft_compensation; ///< swr maximum soft compensation in seconds over soft_compensation_duration + float async; ///< swr simple 1 parameter async, similar to ffmpegs -async + int64_t firstpts_in_samples; ///< swr first pts in samples + + int resample_first; ///< 1 if resampling must come first, 0 if rematrixing + int rematrix; ///< flag to indicate if rematrixing is needed (basically if input and output layouts mismatch) + int rematrix_custom; ///< flag to indicate that a custom matrix has been defined + + AudioData in; ///< input audio data + AudioData postin; ///< post-input audio data: used for rematrix/resample + AudioData midbuf; ///< intermediate audio data (postin/preout) + AudioData preout; ///< pre-output audio data: used for rematrix/resample + AudioData out; ///< converted output audio data + AudioData in_buffer; ///< cached audio data (convert and resample purpose) + AudioData silence; ///< temporary with silence + AudioData drop_temp; ///< temporary used to discard output + int in_buffer_index; ///< cached buffer position + int in_buffer_count; ///< cached buffer length + int resample_in_constraint; ///< 1 if the input end was reach before the output end, 0 otherwise + int flushed; ///< 1 if data is to be flushed and no further input is expected + int64_t outpts; ///< output PTS + int64_t firstpts; ///< first PTS + int drop_output; ///< number of output samples to drop + double delayed_samples_fixup; ///< soxr 0.1.1: needed to fixup delayed_samples after flush has been called. + + struct AudioConvert *in_convert; ///< input conversion context + struct AudioConvert *out_convert; ///< output conversion context + struct AudioConvert *full_convert; ///< full conversion context (single conversion for input and output) + struct ResampleContext *resample; ///< resampling context + struct Resampler const *resampler; ///< resampler virtual function table + + double matrix[SWR_CH_MAX][SWR_CH_MAX]; ///< floating point rematrixing coefficients + float matrix_flt[SWR_CH_MAX][SWR_CH_MAX]; ///< single precision floating point rematrixing coefficients + uint8_t *native_matrix; + uint8_t *native_one; + uint8_t *native_simd_one; + uint8_t *native_simd_matrix; + int32_t matrix32[SWR_CH_MAX][SWR_CH_MAX]; ///< 17.15 fixed point rematrixing coefficients + uint8_t matrix_ch[SWR_CH_MAX][SWR_CH_MAX+1]; ///< Lists of input channels per output channel that have non zero rematrixing coefficients + mix_1_1_func_type *mix_1_1_f; + mix_1_1_func_type *mix_1_1_simd; + + mix_2_1_func_type *mix_2_1_f; + mix_2_1_func_type *mix_2_1_simd; + + mix_any_func_type *mix_any_f; + + /* TODO: callbacks for ASM optimizations */ +}; + +av_warn_unused_result +int swri_realloc_audio(AudioData *a, int count); + +void swri_noise_shaping_int16 (SwrContext *s, AudioData *dsts, const AudioData *srcs, const AudioData *noises, int count); +void swri_noise_shaping_int32 (SwrContext *s, AudioData *dsts, const AudioData *srcs, const AudioData *noises, int count); +void swri_noise_shaping_float (SwrContext *s, AudioData *dsts, const AudioData *srcs, const AudioData *noises, int count); +void swri_noise_shaping_double(SwrContext *s, AudioData *dsts, const AudioData *srcs, const AudioData *noises, int count); + +av_warn_unused_result +int swri_rematrix_init(SwrContext *s); +void swri_rematrix_free(SwrContext *s); +int swri_rematrix(SwrContext *s, AudioData *out, AudioData *in, int len, int mustcopy); +int swri_rematrix_init_x86(struct SwrContext *s); + +av_warn_unused_result +int swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum AVSampleFormat noise_fmt); +av_warn_unused_result +int swri_dither_init(SwrContext *s, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt); + +void swri_audio_convert_init_aarch64(struct AudioConvert *ac, + enum AVSampleFormat out_fmt, + enum AVSampleFormat in_fmt, + int channels); +void swri_audio_convert_init_arm(struct AudioConvert *ac, + enum AVSampleFormat out_fmt, + enum AVSampleFormat in_fmt, + int channels); +void swri_audio_convert_init_x86(struct AudioConvert *ac, + enum AVSampleFormat out_fmt, + enum AVSampleFormat in_fmt, + int channels); + +#endif diff --git a/include/libswresample/version.h b/include/libswresample/version.h index 7e5c58e..d1795b5 100644 --- a/include/libswresample/version.h +++ b/include/libswresample/version.h @@ -30,7 +30,7 @@ #include "version_major.h" -#define LIBSWRESAMPLE_VERSION_MINOR 7 +#define LIBSWRESAMPLE_VERSION_MINOR 3 #define LIBSWRESAMPLE_VERSION_MICRO 100 #define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \ diff --git a/include/libswresample/version_major.h b/include/libswresample/version_major.h index 7f265c2..dd13f2b 100644 --- a/include/libswresample/version_major.h +++ b/include/libswresample/version_major.h @@ -26,6 +26,6 @@ * Libswresample version macros */ -#define LIBSWRESAMPLE_VERSION_MAJOR 4 +#define LIBSWRESAMPLE_VERSION_MAJOR 5 #endif /* SWRESAMPLE_VERSION_MAJOR_H */ diff --git a/include/libswscale/rgb2rgb.h b/include/libswscale/rgb2rgb.h new file mode 100644 index 0000000..e3b0883 --- /dev/null +++ b/include/libswscale/rgb2rgb.h @@ -0,0 +1,172 @@ +/* + * software RGB to RGB converter + * pluralize by Software PAL8 to RGB converter + * Software YUV to YUV converter + * Software YUV to RGB converter + * Written by Nick Kurshev. + * YUV & runtime CPU stuff by Michael (michaelni@gmx.at) + * + * 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 SWSCALE_RGB2RGB_H +#define SWSCALE_RGB2RGB_H + +#include + +/* A full collection of RGB to RGB(BGR) converters */ +extern void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*rgb32tobgr24)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*rgb32to16)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*rgb32to15)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*rgb15to16)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*rgb15tobgr24)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*rgb15to32)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*rgb16to15)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*rgb16tobgr24)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*rgb16to32)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*rgb24tobgr24)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*rgb24to16)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*rgb24to15)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*rgb32tobgr16)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*rgb32tobgr15)(const uint8_t *src, uint8_t *dst, int src_size); + +extern void (*shuffle_bytes_0321)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*shuffle_bytes_1230)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*shuffle_bytes_3012)(const uint8_t *src, uint8_t *dst, int src_size); +extern void (*shuffle_bytes_3210)(const uint8_t *src, uint8_t *dst, int src_size); + +void rgb64tobgr48_nobswap(const uint8_t *src, uint8_t *dst, int src_size); +void rgb64tobgr48_bswap(const uint8_t *src, uint8_t *dst, int src_size); +void rgb48tobgr48_nobswap(const uint8_t *src, uint8_t *dst, int src_size); +void rgb48tobgr48_bswap(const uint8_t *src, uint8_t *dst, int src_size); +void rgb64to48_nobswap(const uint8_t *src, uint8_t *dst, int src_size); +void rgb64to48_bswap(const uint8_t *src, uint8_t *dst, int src_size); +void rgb48tobgr64_nobswap(const uint8_t *src, uint8_t *dst, int src_size); +void rgb48tobgr64_bswap(const uint8_t *src, uint8_t *dst, int src_size); +void rgb48to64_nobswap(const uint8_t *src, uint8_t *dst, int src_size); +void rgb48to64_bswap(const uint8_t *src, uint8_t *dst, int src_size); +void rgb24to32(const uint8_t *src, uint8_t *dst, int src_size); +void rgb32to24(const uint8_t *src, uint8_t *dst, int src_size); +void rgb16tobgr32(const uint8_t *src, uint8_t *dst, int src_size); +void rgb16to24(const uint8_t *src, uint8_t *dst, int src_size); +void rgb16tobgr16(const uint8_t *src, uint8_t *dst, int src_size); +void rgb16tobgr15(const uint8_t *src, uint8_t *dst, int src_size); +void rgb15tobgr32(const uint8_t *src, uint8_t *dst, int src_size); +void rgb15to24(const uint8_t *src, uint8_t *dst, int src_size); +void rgb15tobgr16(const uint8_t *src, uint8_t *dst, int src_size); +void rgb15tobgr15(const uint8_t *src, uint8_t *dst, int src_size); +void rgb12tobgr12(const uint8_t *src, uint8_t *dst, int src_size); +void rgb12to15(const uint8_t *src, uint8_t *dst, int src_size); + +void ff_rgb24toyv12_c(const uint8_t *src, uint8_t *ydst, uint8_t *udst, + uint8_t *vdst, int width, int height, int lumStride, + int chromStride, int srcStride, int32_t *rgb2yuv); + +/** + * Height should be a multiple of 2 and width should be a multiple of 16. + * (If this is a problem for anyone then tell me, and I will fix it.) + */ +extern void (*yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, + int width, int height, + int lumStride, int chromStride, int dstStride); + +/** + * Width should be a multiple of 16. + */ +extern void (*yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, + int width, int height, + int lumStride, int chromStride, int dstStride); + +/** + * Height should be a multiple of 2 and width should be a multiple of 16. + * (If this is a problem for anyone then tell me, and I will fix it.) + */ +extern void (*yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, + int width, int height, + int lumStride, int chromStride, int srcStride); + +/** + * Height should be a multiple of 2 and width should be a multiple of 16. + * (If this is a problem for anyone then tell me, and I will fix it.) + */ +extern void (*yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, + int width, int height, + int lumStride, int chromStride, int dstStride); + +/** + * Width should be a multiple of 16. + */ +extern void (*yuv422ptouyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, + int width, int height, + int lumStride, int chromStride, int dstStride); + +/** + * Height should be a multiple of 2 and width should be a multiple of 2. + * (If this is a problem for anyone then tell me, and I will fix it.) + */ +extern void (*ff_rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, + int width, int height, + int lumStride, int chromStride, int srcStride, + int32_t *rgb2yuv); +extern void (*planar2x)(const uint8_t *src, uint8_t *dst, int width, int height, + int srcStride, int dstStride); + +extern void (*interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst, + int width, int height, int src1Stride, + int src2Stride, int dstStride); + +extern void (*deinterleaveBytes)(const uint8_t *src, uint8_t *dst1, uint8_t *dst2, + int width, int height, int srcStride, + int dst1Stride, int dst2Stride); + +extern void (*vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2, + uint8_t *dst1, uint8_t *dst2, + int width, int height, + int srcStride1, int srcStride2, + int dstStride1, int dstStride2); + +extern void (*yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, + uint8_t *dst, + int width, int height, + int srcStride1, int srcStride2, + int srcStride3, int dstStride); + +extern void (*uyvytoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, + int width, int height, + int lumStride, int chromStride, int srcStride); +extern void (*uyvytoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, + int width, int height, + int lumStride, int chromStride, int srcStride); +extern void (*yuyvtoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, + int width, int height, + int lumStride, int chromStride, int srcStride); +extern void (*yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src, + int width, int height, + int lumStride, int chromStride, int srcStride); + +void ff_sws_rgb2rgb_init(void); + +void rgb2rgb_init_aarch64(void); +void rgb2rgb_init_riscv(void); +void rgb2rgb_init_x86(void); +void rgb2rgb_init_loongarch(void); + +#endif /* SWSCALE_RGB2RGB_H */ diff --git a/include/libswscale/swscale.h b/include/libswscale/swscale.h index 3ebf7c6..e575695 100644 --- a/include/libswscale/swscale.h +++ b/include/libswscale/swscale.h @@ -82,11 +82,35 @@ const char *swscale_license(void); #define SWS_PRINT_INFO 0x1000 //the following 3 flags are not completely implemented -//internal chrominance subsampling info + +/** + * Perform full chroma upsampling when upscaling to RGB. + * + * For example, when converting 50x50 yuv420p to 100x100 rgba, setting this flag + * will scale the chroma plane from 25x25 to 100x100 (4:4:4), and then convert + * the 100x100 yuv444p image to rgba in the final output step. + * + * Without this flag, the chroma plane is instead scaled to 50x100 (4:2:2), + * with a single chroma sample being re-used for both of the horizontally + * adjacent RGBA output pixels. + */ #define SWS_FULL_CHR_H_INT 0x2000 -//input subsampling info + +/** + * Perform full chroma interpolation when downscaling RGB sources. + * + * For example, when converting a 100x100 rgba source to 50x50 yuv444p, setting + * this flag will generate a 100x100 (4:4:4) chroma plane, which is then + * downscaled to the required 50x50. + * + * Without this flag, the chroma plane is instead generated at 50x100 (dropping + * every other pixel), before then being downscaled to the required 50x50 + * resolution. + */ #define SWS_FULL_CHR_H_INP 0x4000 + #define SWS_DIRECT_BGR 0x8000 + #define SWS_ACCURATE_RND 0x40000 #define SWS_BITEXACT 0x80000 #define SWS_ERROR_DIFFUSION 0x800000 @@ -234,6 +258,7 @@ int sws_scale(struct SwsContext *c, const uint8_t *const srcSlice[], * - sws_receive_slice(0, dst->height) * - sws_frame_end() * + * @param c The scaling context * @param dst The destination frame. See documentation for sws_frame_start() for * more details. * @param src The source frame. @@ -249,6 +274,7 @@ int sws_scale_frame(struct SwsContext *c, AVFrame *dst, const AVFrame *src); * This function will retain references to src and dst, so they must both use * refcounted buffers (if allocated by the caller, in case of dst). * + * @param c The scaling context * @param dst The destination frame. * * The data buffers may either be already allocated by the caller or @@ -273,6 +299,8 @@ int sws_frame_start(struct SwsContext *c, AVFrame *dst, const AVFrame *src); * submitted with sws_frame_start(). Must be called after all sws_send_slice() * and sws_receive_slice() calls are done, before any new sws_frame_start() * calls. + * + * @param c The scaling context */ void sws_frame_end(struct SwsContext *c); @@ -282,6 +310,7 @@ void sws_frame_end(struct SwsContext *c); * any order, but may not overlap. For vertically subsampled pixel formats, the * slices must be aligned according to subsampling. * + * @param c The scaling context * @param slice_start first row of the slice * @param slice_height number of rows in the slice * @@ -294,6 +323,7 @@ int sws_send_slice(struct SwsContext *c, unsigned int slice_start, * Request a horizontal slice of the output data to be written into the frame * previously provided to sws_frame_start(). * + * @param c The scaling context * @param slice_start first row of the slice; must be a multiple of * sws_receive_slice_alignment() * @param slice_height number of rows in the slice; must be a multiple of @@ -310,6 +340,9 @@ int sws_receive_slice(struct SwsContext *c, unsigned int slice_start, unsigned int slice_height); /** + * Get the alignment required for slices + * + * @param c The scaling context * @return alignment required for output slices requested with sws_receive_slice(). * Slice offsets and sizes passed to sws_receive_slice() must be * multiples of the value returned from this function. @@ -317,6 +350,7 @@ int sws_receive_slice(struct SwsContext *c, unsigned int slice_start, unsigned int sws_receive_slice_alignment(const struct SwsContext *c); /** + * @param c the scaling context * @param dstRange flag indicating the while-black range of the output (1=jpeg / 0=mpeg) * @param srcRange flag indicating the while-black range of the input (1=jpeg / 0=mpeg) * @param table the yuv2rgb coefficients describing the output yuv space, normally ff_yuv2rgb_coeffs[x] @@ -324,22 +358,17 @@ unsigned int sws_receive_slice_alignment(const struct SwsContext *c); * @param brightness 16.16 fixed point brightness correction * @param contrast 16.16 fixed point contrast correction * @param saturation 16.16 fixed point saturation correction -#if LIBSWSCALE_VERSION_MAJOR > 6 - * @return negative error code on error, non negative otherwise -#else - * @return -1 if not supported -#endif + * + * @return A negative error code on error, non negative otherwise. + * If `LIBSWSCALE_VERSION_MAJOR < 7`, returns -1 if not supported. */ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation); /** -#if LIBSWSCALE_VERSION_MAJOR > 6 - * @return negative error code on error, non negative otherwise -#else - * @return -1 if not supported -#endif + * @return A negative error code on error, non negative otherwise. + * If `LIBSWSCALE_VERSION_MAJOR < 7`, returns -1 if not supported. */ int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table, int *srcRange, int **table, int *dstRange, diff --git a/include/libswscale/swscale_internal.h b/include/libswscale/swscale_internal.h new file mode 100644 index 0000000..50127d2 --- /dev/null +++ b/include/libswscale/swscale_internal.h @@ -0,0 +1,1146 @@ +/* + * Copyright (C) 2001-2011 Michael Niedermayer + * + * 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 SWSCALE_SWSCALE_INTERNAL_H +#define SWSCALE_SWSCALE_INTERNAL_H + +#include + +#include "config.h" + +#include "libavutil/avassert.h" +#include "libavutil/common.h" +#include "libavutil/frame.h" +#include "libavutil/intreadwrite.h" +#include "libavutil/log.h" +#include "libavutil/mem_internal.h" +#include "libavutil/pixfmt.h" +#include "libavutil/pixdesc.h" +#include "libavutil/slicethread.h" +#if HAVE_ALTIVEC +#include "libavutil/ppc/util_altivec.h" +#endif +#include "libavutil/half2float.h" + +#define STR(s) AV_TOSTRING(s) // AV_STRINGIFY is too long + +#define YUVRGB_TABLE_HEADROOM 512 +#define YUVRGB_TABLE_LUMA_HEADROOM 512 + +#define MAX_FILTER_SIZE SWS_MAX_FILTER_SIZE + +#if HAVE_BIGENDIAN +#define ALT32_CORR (-1) +#else +#define ALT32_CORR 1 +#endif + +#if ARCH_X86_64 +# define APCK_PTR2 8 +# define APCK_COEF 16 +# define APCK_SIZE 24 +#else +# define APCK_PTR2 4 +# define APCK_COEF 8 +# define APCK_SIZE 16 +#endif + +#define RETCODE_USE_CASCADE -12345 + +struct SwsContext; + +typedef enum SwsDither { + SWS_DITHER_NONE = 0, + SWS_DITHER_AUTO, + SWS_DITHER_BAYER, + SWS_DITHER_ED, + SWS_DITHER_A_DITHER, + SWS_DITHER_X_DITHER, + NB_SWS_DITHER, +} SwsDither; + +typedef enum SwsAlphaBlend { + SWS_ALPHA_BLEND_NONE = 0, + SWS_ALPHA_BLEND_UNIFORM, + SWS_ALPHA_BLEND_CHECKERBOARD, + SWS_ALPHA_BLEND_NB, +} SwsAlphaBlend; + +typedef struct Range { + unsigned int start; + unsigned int len; +} Range; + +typedef struct RangeList { + Range *ranges; + unsigned int nb_ranges; + int ranges_allocated; +} RangeList; + +int ff_range_add(RangeList *r, unsigned int start, unsigned int len); + +typedef int (*SwsFunc)(struct SwsContext *context, const uint8_t *src[], + int srcStride[], int srcSliceY, int srcSliceH, + uint8_t *dst[], int dstStride[]); + +/** + * Write one line of horizontally scaled data to planar output + * without any additional vertical scaling (or point-scaling). + * + * @param src scaled source data, 15 bits for 8-10-bit output, + * 19 bits for 16-bit output (in int32_t) + * @param dest pointer to the output plane. For >8-bit + * output, this is in uint16_t + * @param dstW width of destination in pixels + * @param dither ordered dither array of type int16_t and size 8 + * @param offset Dither offset + */ +typedef void (*yuv2planar1_fn)(const int16_t *src, uint8_t *dest, int dstW, + const uint8_t *dither, int offset); + +/** + * Write one line of horizontally scaled data to planar output + * with multi-point vertical scaling between input pixels. + * + * @param filter vertical luma/alpha scaling coefficients, 12 bits [0,4096] + * @param src scaled luma (Y) or alpha (A) source data, 15 bits for + * 8-10-bit output, 19 bits for 16-bit output (in int32_t) + * @param filterSize number of vertical input lines to scale + * @param dest pointer to output plane. For >8-bit + * output, this is in uint16_t + * @param dstW width of destination pixels + * @param offset Dither offset + */ +typedef void (*yuv2planarX_fn)(const int16_t *filter, int filterSize, + const int16_t **src, uint8_t *dest, int dstW, + const uint8_t *dither, int offset); + +/** + * Write one line of horizontally scaled chroma to interleaved output + * with multi-point vertical scaling between input pixels. + * + * @param dstFormat destination pixel format + * @param chrDither ordered dither array of type uint8_t and size 8 + * @param chrFilter vertical chroma scaling coefficients, 12 bits [0,4096] + * @param chrUSrc scaled chroma (U) source data, 15 bits for 8-10-bit + * output, 19 bits for 16-bit output (in int32_t) + * @param chrVSrc scaled chroma (V) source data, 15 bits for 8-10-bit + * output, 19 bits for 16-bit output (in int32_t) + * @param chrFilterSize number of vertical chroma input lines to scale + * @param dest pointer to the output plane. For >8-bit + * output, this is in uint16_t + * @param dstW width of chroma planes + */ +typedef void (*yuv2interleavedX_fn)(enum AVPixelFormat dstFormat, + const uint8_t *chrDither, + const int16_t *chrFilter, + int chrFilterSize, + const int16_t **chrUSrc, + const int16_t **chrVSrc, + uint8_t *dest, int dstW); + +/** + * Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB + * output without any additional vertical scaling (or point-scaling). Note + * that this function may do chroma scaling, see the "uvalpha" argument. + * + * @param c SWS scaling context + * @param lumSrc scaled luma (Y) source data, 15 bits for 8-10-bit output, + * 19 bits for 16-bit output (in int32_t) + * @param chrUSrc scaled chroma (U) source data, 15 bits for 8-10-bit output, + * 19 bits for 16-bit output (in int32_t) + * @param chrVSrc scaled chroma (V) source data, 15 bits for 8-10-bit output, + * 19 bits for 16-bit output (in int32_t) + * @param alpSrc scaled alpha (A) source data, 15 bits for 8-10-bit output, + * 19 bits for 16-bit output (in int32_t) + * @param dest pointer to the output plane. For 16-bit output, this is + * uint16_t + * @param dstW width of lumSrc and alpSrc in pixels, number of pixels + * to write into dest[] + * @param uvalpha chroma scaling coefficient for the second line of chroma + * pixels, either 2048 or 0. If 0, one chroma input is used + * for 2 output pixels (or if the SWS_FLAG_FULL_CHR_INT flag + * is set, it generates 1 output pixel). If 2048, two chroma + * input pixels should be averaged for 2 output pixels (this + * only happens if SWS_FLAG_FULL_CHR_INT is not set) + * @param y vertical line number for this output. This does not need + * to be used to calculate the offset in the destination, + * but can be used to generate comfort noise using dithering + * for some output formats. + */ +typedef void (*yuv2packed1_fn)(struct SwsContext *c, const int16_t *lumSrc, + const int16_t *chrUSrc[2], + const int16_t *chrVSrc[2], + const int16_t *alpSrc, uint8_t *dest, + int dstW, int uvalpha, int y); +/** + * Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB + * output by doing bilinear scaling between two input lines. + * + * @param c SWS scaling context + * @param lumSrc scaled luma (Y) source data, 15 bits for 8-10-bit output, + * 19 bits for 16-bit output (in int32_t) + * @param chrUSrc scaled chroma (U) source data, 15 bits for 8-10-bit output, + * 19 bits for 16-bit output (in int32_t) + * @param chrVSrc scaled chroma (V) source data, 15 bits for 8-10-bit output, + * 19 bits for 16-bit output (in int32_t) + * @param alpSrc scaled alpha (A) source data, 15 bits for 8-10-bit output, + * 19 bits for 16-bit output (in int32_t) + * @param dest pointer to the output plane. For 16-bit output, this is + * uint16_t + * @param dstW width of lumSrc and alpSrc in pixels, number of pixels + * to write into dest[] + * @param yalpha luma/alpha scaling coefficients for the second input line. + * The first line's coefficients can be calculated by using + * 4096 - yalpha + * @param uvalpha chroma scaling coefficient for the second input line. The + * first line's coefficients can be calculated by using + * 4096 - uvalpha + * @param y vertical line number for this output. This does not need + * to be used to calculate the offset in the destination, + * but can be used to generate comfort noise using dithering + * for some output formats. + */ +typedef void (*yuv2packed2_fn)(struct SwsContext *c, const int16_t *lumSrc[2], + const int16_t *chrUSrc[2], + const int16_t *chrVSrc[2], + const int16_t *alpSrc[2], + uint8_t *dest, + int dstW, int yalpha, int uvalpha, int y); +/** + * Write one line of horizontally scaled Y/U/V/A to packed-pixel YUV/RGB + * output by doing multi-point vertical scaling between input pixels. + * + * @param c SWS scaling context + * @param lumFilter vertical luma/alpha scaling coefficients, 12 bits [0,4096] + * @param lumSrc scaled luma (Y) source data, 15 bits for 8-10-bit output, + * 19 bits for 16-bit output (in int32_t) + * @param lumFilterSize number of vertical luma/alpha input lines to scale + * @param chrFilter vertical chroma scaling coefficients, 12 bits [0,4096] + * @param chrUSrc scaled chroma (U) source data, 15 bits for 8-10-bit output, + * 19 bits for 16-bit output (in int32_t) + * @param chrVSrc scaled chroma (V) source data, 15 bits for 8-10-bit output, + * 19 bits for 16-bit output (in int32_t) + * @param chrFilterSize number of vertical chroma input lines to scale + * @param alpSrc scaled alpha (A) source data, 15 bits for 8-10-bit output, + * 19 bits for 16-bit output (in int32_t) + * @param dest pointer to the output plane. For 16-bit output, this is + * uint16_t + * @param dstW width of lumSrc and alpSrc in pixels, number of pixels + * to write into dest[] + * @param y vertical line number for this output. This does not need + * to be used to calculate the offset in the destination, + * but can be used to generate comfort noise using dithering + * or some output formats. + */ +typedef void (*yuv2packedX_fn)(struct SwsContext *c, const int16_t *lumFilter, + const int16_t **lumSrc, int lumFilterSize, + const int16_t *chrFilter, + const int16_t **chrUSrc, + const int16_t **chrVSrc, int chrFilterSize, + const int16_t **alpSrc, uint8_t *dest, + int dstW, int y); + +/** + * Write one line of horizontally scaled Y/U/V/A to YUV/RGB + * output by doing multi-point vertical scaling between input pixels. + * + * @param c SWS scaling context + * @param lumFilter vertical luma/alpha scaling coefficients, 12 bits [0,4096] + * @param lumSrc scaled luma (Y) source data, 15 bits for 8-10-bit output, + * 19 bits for 16-bit output (in int32_t) + * @param lumFilterSize number of vertical luma/alpha input lines to scale + * @param chrFilter vertical chroma scaling coefficients, 12 bits [0,4096] + * @param chrUSrc scaled chroma (U) source data, 15 bits for 8-10-bit output, + * 19 bits for 16-bit output (in int32_t) + * @param chrVSrc scaled chroma (V) source data, 15 bits for 8-10-bit output, + * 19 bits for 16-bit output (in int32_t) + * @param chrFilterSize number of vertical chroma input lines to scale + * @param alpSrc scaled alpha (A) source data, 15 bits for 8-10-bit output, + * 19 bits for 16-bit output (in int32_t) + * @param dest pointer to the output planes. For 16-bit output, this is + * uint16_t + * @param dstW width of lumSrc and alpSrc in pixels, number of pixels + * to write into dest[] + * @param y vertical line number for this output. This does not need + * to be used to calculate the offset in the destination, + * but can be used to generate comfort noise using dithering + * or some output formats. + */ +typedef void (*yuv2anyX_fn)(struct SwsContext *c, const int16_t *lumFilter, + const int16_t **lumSrc, int lumFilterSize, + const int16_t *chrFilter, + const int16_t **chrUSrc, + const int16_t **chrVSrc, int chrFilterSize, + const int16_t **alpSrc, uint8_t **dest, + int dstW, int y); + +struct SwsSlice; +struct SwsFilterDescriptor; + +/* This struct should be aligned on at least a 32-byte boundary. */ +typedef struct SwsContext { + /** + * info on struct for av_log + */ + const AVClass *av_class; + + struct SwsContext *parent; + + AVSliceThread *slicethread; + struct SwsContext **slice_ctx; + int *slice_err; + int nb_slice_ctx; + + // values passed to current sws_receive_slice() call + int dst_slice_start; + int dst_slice_height; + + /** + * Note that src, dst, srcStride, dstStride will be copied in the + * sws_scale() wrapper so they can be freely modified here. + */ + SwsFunc convert_unscaled; + int srcW; ///< Width of source luma/alpha planes. + int srcH; ///< Height of source luma/alpha planes. + int dstH; ///< Height of destination luma/alpha planes. + int chrSrcW; ///< Width of source chroma planes. + int chrSrcH; ///< Height of source chroma planes. + int chrDstW; ///< Width of destination chroma planes. + int chrDstH; ///< Height of destination chroma planes. + int lumXInc, chrXInc; + int lumYInc, chrYInc; + enum AVPixelFormat dstFormat; ///< Destination pixel format. + enum AVPixelFormat srcFormat; ///< Source pixel format. + int dstFormatBpp; ///< Number of bits per pixel of the destination pixel format. + int srcFormatBpp; ///< Number of bits per pixel of the source pixel format. + int dstBpc, srcBpc; + int chrSrcHSubSample; ///< Binary logarithm of horizontal subsampling factor between luma/alpha and chroma planes in source image. + int chrSrcVSubSample; ///< Binary logarithm of vertical subsampling factor between luma/alpha and chroma planes in source image. + int chrDstHSubSample; ///< Binary logarithm of horizontal subsampling factor between luma/alpha and chroma planes in destination image. + int chrDstVSubSample; ///< Binary logarithm of vertical subsampling factor between luma/alpha and chroma planes in destination image. + int vChrDrop; ///< Binary logarithm of extra vertical subsampling factor in source image chroma planes specified by user. + int sliceDir; ///< Direction that slices are fed to the scaler (1 = top-to-bottom, -1 = bottom-to-top). + int nb_threads; ///< Number of threads used for scaling + double param[2]; ///< Input parameters for scaling algorithms that need them. + + AVFrame *frame_src; + AVFrame *frame_dst; + + RangeList src_ranges; + + /* The cascaded_* fields allow spliting a scaler task into multiple + * sequential steps, this is for example used to limit the maximum + * downscaling factor that needs to be supported in one scaler. + */ + struct SwsContext *cascaded_context[3]; + int cascaded_tmpStride[4]; + uint8_t *cascaded_tmp[4]; + int cascaded1_tmpStride[4]; + uint8_t *cascaded1_tmp[4]; + int cascaded_mainindex; + + double gamma_value; + int gamma_flag; + int is_internal_gamma; + uint16_t *gamma; + uint16_t *inv_gamma; + + int numDesc; + int descIndex[2]; + int numSlice; + struct SwsSlice *slice; + struct SwsFilterDescriptor *desc; + + uint32_t pal_yuv[256]; + uint32_t pal_rgb[256]; + + float uint2float_lut[256]; + + /** + * @name Scaled horizontal lines ring buffer. + * The horizontal scaler keeps just enough scaled lines in a ring buffer + * so they may be passed to the vertical scaler. The pointers to the + * allocated buffers for each line are duplicated in sequence in the ring + * buffer to simplify indexing and avoid wrapping around between lines + * inside the vertical scaler code. The wrapping is done before the + * vertical scaler is called. + */ + //@{ + int lastInLumBuf; ///< Last scaled horizontal luma/alpha line from source in the ring buffer. + int lastInChrBuf; ///< Last scaled horizontal chroma line from source in the ring buffer. + //@} + + uint8_t *formatConvBuffer; + int needAlpha; + + /** + * @name Horizontal and vertical filters. + * To better understand the following fields, here is a pseudo-code of + * their usage in filtering a horizontal line: + * @code + * for (i = 0; i < width; i++) { + * dst[i] = 0; + * for (j = 0; j < filterSize; j++) + * dst[i] += src[ filterPos[i] + j ] * filter[ filterSize * i + j ]; + * dst[i] >>= FRAC_BITS; // The actual implementation is fixed-point. + * } + * @endcode + */ + //@{ + int16_t *hLumFilter; ///< Array of horizontal filter coefficients for luma/alpha planes. + int16_t *hChrFilter; ///< Array of horizontal filter coefficients for chroma planes. + int16_t *vLumFilter; ///< Array of vertical filter coefficients for luma/alpha planes. + int16_t *vChrFilter; ///< Array of vertical filter coefficients for chroma planes. + int32_t *hLumFilterPos; ///< Array of horizontal filter starting positions for each dst[i] for luma/alpha planes. + int32_t *hChrFilterPos; ///< Array of horizontal filter starting positions for each dst[i] for chroma planes. + int32_t *vLumFilterPos; ///< Array of vertical filter starting positions for each dst[i] for luma/alpha planes. + int32_t *vChrFilterPos; ///< Array of vertical filter starting positions for each dst[i] for chroma planes. + int hLumFilterSize; ///< Horizontal filter size for luma/alpha pixels. + int hChrFilterSize; ///< Horizontal filter size for chroma pixels. + int vLumFilterSize; ///< Vertical filter size for luma/alpha pixels. + int vChrFilterSize; ///< Vertical filter size for chroma pixels. + //@} + + int lumMmxextFilterCodeSize; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code size for luma/alpha planes. + int chrMmxextFilterCodeSize; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code size for chroma planes. + uint8_t *lumMmxextFilterCode; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code for luma/alpha planes. + uint8_t *chrMmxextFilterCode; ///< Runtime-generated MMXEXT horizontal fast bilinear scaler code for chroma planes. + + int canMMXEXTBeUsed; + int warned_unuseable_bilinear; + + int dstY; ///< Last destination vertical line output from last slice. + int flags; ///< Flags passed by the user to select scaler algorithm, optimizations, subsampling, etc... + void *yuvTable; // pointer to the yuv->rgb table start so it can be freed() + // alignment ensures the offset can be added in a single + // instruction on e.g. ARM + DECLARE_ALIGNED(16, int, table_gV)[256 + 2*YUVRGB_TABLE_HEADROOM]; + uint8_t *table_rV[256 + 2*YUVRGB_TABLE_HEADROOM]; + uint8_t *table_gU[256 + 2*YUVRGB_TABLE_HEADROOM]; + uint8_t *table_bU[256 + 2*YUVRGB_TABLE_HEADROOM]; + DECLARE_ALIGNED(16, int32_t, input_rgb2yuv_table)[16+40*4]; // This table can contain both C and SIMD formatted values, the C vales are always at the XY_IDX points +#define RY_IDX 0 +#define GY_IDX 1 +#define BY_IDX 2 +#define RU_IDX 3 +#define GU_IDX 4 +#define BU_IDX 5 +#define RV_IDX 6 +#define GV_IDX 7 +#define BV_IDX 8 +#define RGB2YUV_SHIFT 15 + + int *dither_error[4]; + + //Colorspace stuff + int contrast, brightness, saturation; // for sws_getColorspaceDetails + int srcColorspaceTable[4]; + int dstColorspaceTable[4]; + int srcRange; ///< 0 = MPG YUV range, 1 = JPG YUV range (source image). + int dstRange; ///< 0 = MPG YUV range, 1 = JPG YUV range (destination image). + int src0Alpha; + int dst0Alpha; + int srcXYZ; + int dstXYZ; + int src_h_chr_pos; + int dst_h_chr_pos; + int src_v_chr_pos; + int dst_v_chr_pos; + int yuv2rgb_y_offset; + int yuv2rgb_y_coeff; + int yuv2rgb_v2r_coeff; + int yuv2rgb_v2g_coeff; + int yuv2rgb_u2g_coeff; + int yuv2rgb_u2b_coeff; + +#define RED_DITHER "0*8" +#define GREEN_DITHER "1*8" +#define BLUE_DITHER "2*8" +#define Y_COEFF "3*8" +#define VR_COEFF "4*8" +#define UB_COEFF "5*8" +#define VG_COEFF "6*8" +#define UG_COEFF "7*8" +#define Y_OFFSET "8*8" +#define U_OFFSET "9*8" +#define V_OFFSET "10*8" +#define LUM_MMX_FILTER_OFFSET "11*8" +#define CHR_MMX_FILTER_OFFSET "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE) +#define DSTW_OFFSET "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2" +#define ESP_OFFSET "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+8" +#define VROUNDER_OFFSET "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+16" +#define U_TEMP "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+24" +#define V_TEMP "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+32" +#define Y_TEMP "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+40" +#define ALP_MMX_FILTER_OFFSET "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*2+48" +#define UV_OFF_PX "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*3+48" +#define UV_OFF_BYTE "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*3+56" +#define DITHER16 "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*3+64" +#define DITHER32 "11*8+4*4*"AV_STRINGIFY(MAX_FILTER_SIZE)"*3+80" +#define DITHER32_INT (11*8+4*4*MAX_FILTER_SIZE*3+80) // value equal to above, used for checking that the struct hasn't been changed by mistake + + DECLARE_ALIGNED(8, uint64_t, redDither); + DECLARE_ALIGNED(8, uint64_t, greenDither); + DECLARE_ALIGNED(8, uint64_t, blueDither); + + DECLARE_ALIGNED(8, uint64_t, yCoeff); + DECLARE_ALIGNED(8, uint64_t, vrCoeff); + DECLARE_ALIGNED(8, uint64_t, ubCoeff); + DECLARE_ALIGNED(8, uint64_t, vgCoeff); + DECLARE_ALIGNED(8, uint64_t, ugCoeff); + DECLARE_ALIGNED(8, uint64_t, yOffset); + DECLARE_ALIGNED(8, uint64_t, uOffset); + DECLARE_ALIGNED(8, uint64_t, vOffset); + int32_t lumMmxFilter[4 * MAX_FILTER_SIZE]; + int32_t chrMmxFilter[4 * MAX_FILTER_SIZE]; + int dstW; ///< Width of destination luma/alpha planes. + DECLARE_ALIGNED(8, uint64_t, esp); + DECLARE_ALIGNED(8, uint64_t, vRounder); + DECLARE_ALIGNED(8, uint64_t, u_temp); + DECLARE_ALIGNED(8, uint64_t, v_temp); + DECLARE_ALIGNED(8, uint64_t, y_temp); + int32_t alpMmxFilter[4 * MAX_FILTER_SIZE]; + // alignment of these values is not necessary, but merely here + // to maintain the same offset across x8632 and x86-64. Once we + // use proper offset macros in the asm, they can be removed. + DECLARE_ALIGNED(8, ptrdiff_t, uv_off); ///< offset (in pixels) between u and v planes + DECLARE_ALIGNED(8, ptrdiff_t, uv_offx2); ///< offset (in bytes) between u and v planes + DECLARE_ALIGNED(8, uint16_t, dither16)[8]; + DECLARE_ALIGNED(8, uint32_t, dither32)[8]; + + const uint8_t *chrDither8, *lumDither8; + +#if HAVE_ALTIVEC + vector signed short CY; + vector signed short CRV; + vector signed short CBU; + vector signed short CGU; + vector signed short CGV; + vector signed short OY; + vector unsigned short CSHIFT; + vector signed short *vYCoeffsBank, *vCCoeffsBank; +#endif + + int use_mmx_vfilter; + +/* pre defined color-spaces gamma */ +#define XYZ_GAMMA (2.6f) +#define RGB_GAMMA (2.2f) + int16_t *xyzgamma; + int16_t *rgbgamma; + int16_t *xyzgammainv; + int16_t *rgbgammainv; + int16_t xyz2rgb_matrix[3][4]; + int16_t rgb2xyz_matrix[3][4]; + + /* function pointers for swscale() */ + yuv2planar1_fn yuv2plane1; + yuv2planarX_fn yuv2planeX; + yuv2interleavedX_fn yuv2nv12cX; + yuv2packed1_fn yuv2packed1; + yuv2packed2_fn yuv2packed2; + yuv2packedX_fn yuv2packedX; + yuv2anyX_fn yuv2anyX; + + /// Opaque data pointer passed to all input functions. + void *input_opaque; + + /// Unscaled conversion of luma plane to YV12 for horizontal scaler. + void (*lumToYV12)(uint8_t *dst, const uint8_t *src, const uint8_t *src2, const uint8_t *src3, + int width, uint32_t *pal, void *opq); + /// Unscaled conversion of alpha plane to YV12 for horizontal scaler. + void (*alpToYV12)(uint8_t *dst, const uint8_t *src, const uint8_t *src2, const uint8_t *src3, + int width, uint32_t *pal, void *opq); + /// Unscaled conversion of chroma planes to YV12 for horizontal scaler. + void (*chrToYV12)(uint8_t *dstU, uint8_t *dstV, + const uint8_t *src1, const uint8_t *src2, const uint8_t *src3, + int width, uint32_t *pal, void *opq); + + /** + * Functions to read planar input, such as planar RGB, and convert + * internally to Y/UV/A. + */ + /** @{ */ + void (*readLumPlanar)(uint8_t *dst, const uint8_t *src[4], int width, int32_t *rgb2yuv, + void *opq); + void (*readChrPlanar)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src[4], + int width, int32_t *rgb2yuv, void *opq); + void (*readAlpPlanar)(uint8_t *dst, const uint8_t *src[4], int width, int32_t *rgb2yuv, + void *opq); + /** @} */ + + /** + * Scale one horizontal line of input data using a bilinear filter + * to produce one line of output data. Compared to SwsContext->hScale(), + * please take note of the following caveats when using these: + * - Scaling is done using only 7 bits instead of 14-bit coefficients. + * - You can use no more than 5 input pixels to produce 4 output + * pixels. Therefore, this filter should not be used for downscaling + * by more than ~20% in width (because that equals more than 5/4th + * downscaling and thus more than 5 pixels input per 4 pixels output). + * - In general, bilinear filters create artifacts during downscaling + * (even when <20%), because one output pixel will span more than one + * input pixel, and thus some pixels will need edges of both neighbor + * pixels to interpolate the output pixel. Since you can use at most + * two input pixels per output pixel in bilinear scaling, this is + * impossible and thus downscaling by any size will create artifacts. + * To enable this type of scaling, set SWS_FLAG_FAST_BILINEAR + * in SwsContext->flags. + */ + /** @{ */ + void (*hyscale_fast)(struct SwsContext *c, + int16_t *dst, int dstWidth, + const uint8_t *src, int srcW, int xInc); + void (*hcscale_fast)(struct SwsContext *c, + int16_t *dst1, int16_t *dst2, int dstWidth, + const uint8_t *src1, const uint8_t *src2, + int srcW, int xInc); + /** @} */ + + /** + * Scale one horizontal line of input data using a filter over the input + * lines, to produce one (differently sized) line of output data. + * + * @param dst pointer to destination buffer for horizontally scaled + * data. If the number of bits per component of one + * destination pixel (SwsContext->dstBpc) is <= 10, data + * will be 15 bpc in 16 bits (int16_t) width. Else (i.e. + * SwsContext->dstBpc == 16), data will be 19bpc in + * 32 bits (int32_t) width. + * @param dstW width of destination image + * @param src pointer to source data to be scaled. If the number of + * bits per component of a source pixel (SwsContext->srcBpc) + * is 8, this is 8bpc in 8 bits (uint8_t) width. Else + * (i.e. SwsContext->dstBpc > 8), this is native depth + * in 16 bits (uint16_t) width. In other words, for 9-bit + * YUV input, this is 9bpc, for 10-bit YUV input, this is + * 10bpc, and for 16-bit RGB or YUV, this is 16bpc. + * @param filter filter coefficients to be used per output pixel for + * scaling. This contains 14bpp filtering coefficients. + * Guaranteed to contain dstW * filterSize entries. + * @param filterPos position of the first input pixel to be used for + * each output pixel during scaling. Guaranteed to + * contain dstW entries. + * @param filterSize the number of input coefficients to be used (and + * thus the number of input pixels to be used) for + * creating a single output pixel. Is aligned to 4 + * (and input coefficients thus padded with zeroes) + * to simplify creating SIMD code. + */ + /** @{ */ + void (*hyScale)(struct SwsContext *c, int16_t *dst, int dstW, + const uint8_t *src, const int16_t *filter, + const int32_t *filterPos, int filterSize); + void (*hcScale)(struct SwsContext *c, int16_t *dst, int dstW, + const uint8_t *src, const int16_t *filter, + const int32_t *filterPos, int filterSize); + /** @} */ + + /// Color range conversion function for luma plane if needed. + void (*lumConvertRange)(int16_t *dst, int width); + /// Color range conversion function for chroma planes if needed. + void (*chrConvertRange)(int16_t *dst1, int16_t *dst2, int width); + + int needs_hcscale; ///< Set if there are chroma planes to be converted. + + SwsDither dither; + + SwsAlphaBlend alphablend; + + // scratch buffer for converting packed rgb0 sources + // filled with a copy of the input frame + fully opaque alpha, + // then passed as input to further conversion + uint8_t *rgb0_scratch; + unsigned int rgb0_scratch_allocated; + + // scratch buffer for converting XYZ sources + // filled with the input converted to rgb48 + // then passed as input to further conversion + uint8_t *xyz_scratch; + unsigned int xyz_scratch_allocated; + + unsigned int dst_slice_align; + atomic_int stride_unaligned_warned; + atomic_int data_unaligned_warned; + + Half2FloatTables *h2f_tables; +} SwsContext; +//FIXME check init (where 0) + +SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c); +int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], + int fullRange, int brightness, + int contrast, int saturation); +void ff_yuv2rgb_init_tables_ppc(SwsContext *c, const int inv_table[4], + int brightness, int contrast, int saturation); + +void ff_updateMMXDitherTables(SwsContext *c, int dstY); + +av_cold void ff_sws_init_range_convert(SwsContext *c); +av_cold void ff_sws_init_range_convert_aarch64(SwsContext *c); +av_cold void ff_sws_init_range_convert_loongarch(SwsContext *c); +av_cold void ff_sws_init_range_convert_x86(SwsContext *c); + +SwsFunc ff_yuv2rgb_init_x86(SwsContext *c); +SwsFunc ff_yuv2rgb_init_ppc(SwsContext *c); +SwsFunc ff_yuv2rgb_init_loongarch(SwsContext *c); + +static av_always_inline int is16BPS(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + return desc->comp[0].depth == 16; +} + +static av_always_inline int is32BPS(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + return desc->comp[0].depth == 32; +} + +static av_always_inline int isNBPS(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + return desc->comp[0].depth >= 9 && desc->comp[0].depth <= 14; +} + +static av_always_inline int isBE(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + return desc->flags & AV_PIX_FMT_FLAG_BE; +} + +static av_always_inline int isYUV(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + return !(desc->flags & AV_PIX_FMT_FLAG_RGB) && desc->nb_components >= 2; +} + +static av_always_inline int isPlanarYUV(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + return ((desc->flags & AV_PIX_FMT_FLAG_PLANAR) && isYUV(pix_fmt)); +} + +/* + * Identity semi-planar YUV formats. Specifically, those are YUV formats + * where the second and third components (U & V) are on the same plane. + */ +static av_always_inline int isSemiPlanarYUV(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + return (isPlanarYUV(pix_fmt) && desc->comp[1].plane == desc->comp[2].plane); +} + +static av_always_inline int isRGB(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + return (desc->flags & AV_PIX_FMT_FLAG_RGB); +} + +static av_always_inline int isGray(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + return !(desc->flags & AV_PIX_FMT_FLAG_PAL) && + !(desc->flags & AV_PIX_FMT_FLAG_HWACCEL) && + desc->nb_components <= 2 && + pix_fmt != AV_PIX_FMT_MONOBLACK && + pix_fmt != AV_PIX_FMT_MONOWHITE; +} + +static av_always_inline int isRGBinInt(enum AVPixelFormat pix_fmt) +{ + return pix_fmt == AV_PIX_FMT_RGB48BE || + pix_fmt == AV_PIX_FMT_RGB48LE || + pix_fmt == AV_PIX_FMT_RGB32 || + pix_fmt == AV_PIX_FMT_RGB32_1 || + pix_fmt == AV_PIX_FMT_RGB24 || + pix_fmt == AV_PIX_FMT_RGB565BE || + pix_fmt == AV_PIX_FMT_RGB565LE || + pix_fmt == AV_PIX_FMT_RGB555BE || + pix_fmt == AV_PIX_FMT_RGB555LE || + pix_fmt == AV_PIX_FMT_RGB444BE || + pix_fmt == AV_PIX_FMT_RGB444LE || + pix_fmt == AV_PIX_FMT_RGB8 || + pix_fmt == AV_PIX_FMT_RGB4 || + pix_fmt == AV_PIX_FMT_RGB4_BYTE || + pix_fmt == AV_PIX_FMT_RGBA64BE || + pix_fmt == AV_PIX_FMT_RGBA64LE || + pix_fmt == AV_PIX_FMT_MONOBLACK || + pix_fmt == AV_PIX_FMT_MONOWHITE; +} + +static av_always_inline int isBGRinInt(enum AVPixelFormat pix_fmt) +{ + return pix_fmt == AV_PIX_FMT_BGR48BE || + pix_fmt == AV_PIX_FMT_BGR48LE || + pix_fmt == AV_PIX_FMT_BGR32 || + pix_fmt == AV_PIX_FMT_BGR32_1 || + pix_fmt == AV_PIX_FMT_BGR24 || + pix_fmt == AV_PIX_FMT_BGR565BE || + pix_fmt == AV_PIX_FMT_BGR565LE || + pix_fmt == AV_PIX_FMT_BGR555BE || + pix_fmt == AV_PIX_FMT_BGR555LE || + pix_fmt == AV_PIX_FMT_BGR444BE || + pix_fmt == AV_PIX_FMT_BGR444LE || + pix_fmt == AV_PIX_FMT_BGR8 || + pix_fmt == AV_PIX_FMT_BGR4 || + pix_fmt == AV_PIX_FMT_BGR4_BYTE || + pix_fmt == AV_PIX_FMT_BGRA64BE || + pix_fmt == AV_PIX_FMT_BGRA64LE || + pix_fmt == AV_PIX_FMT_MONOBLACK || + pix_fmt == AV_PIX_FMT_MONOWHITE; +} + +static av_always_inline int isBayer(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + return !!(desc->flags & AV_PIX_FMT_FLAG_BAYER); +} + +static av_always_inline int isBayer16BPS(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + return desc->comp[1].depth == 8; +} + +static av_always_inline int isAnyRGB(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + return (desc->flags & AV_PIX_FMT_FLAG_RGB) || + pix_fmt == AV_PIX_FMT_MONOBLACK || pix_fmt == AV_PIX_FMT_MONOWHITE; +} + +static av_always_inline int isFloat(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + return desc->flags & AV_PIX_FMT_FLAG_FLOAT; +} + +static av_always_inline int isFloat16(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + return (desc->flags & AV_PIX_FMT_FLAG_FLOAT) && desc->comp[0].depth == 16; +} + +static av_always_inline int isALPHA(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + if (pix_fmt == AV_PIX_FMT_PAL8) + return 1; + return desc->flags & AV_PIX_FMT_FLAG_ALPHA; +} + +static av_always_inline int isPacked(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + return (desc->nb_components >= 2 && !(desc->flags & AV_PIX_FMT_FLAG_PLANAR)) || + pix_fmt == AV_PIX_FMT_PAL8 || + pix_fmt == AV_PIX_FMT_MONOBLACK || pix_fmt == AV_PIX_FMT_MONOWHITE; +} + +static av_always_inline int isPlanar(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + return (desc->nb_components >= 2 && (desc->flags & AV_PIX_FMT_FLAG_PLANAR)); +} + +static av_always_inline int isPackedRGB(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + return ((desc->flags & (AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB)) == AV_PIX_FMT_FLAG_RGB); +} + +static av_always_inline int isPlanarRGB(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + return ((desc->flags & (AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB)) == + (AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB)); +} + +static av_always_inline int usePal(enum AVPixelFormat pix_fmt) +{ + switch (pix_fmt) { + case AV_PIX_FMT_PAL8: + case AV_PIX_FMT_BGR4_BYTE: + case AV_PIX_FMT_BGR8: + case AV_PIX_FMT_GRAY8: + case AV_PIX_FMT_RGB4_BYTE: + case AV_PIX_FMT_RGB8: + return 1; + default: + return 0; + } +} + +/* + * Identity formats where the data is in the high bits, and the low bits are shifted away. + */ +static av_always_inline int isDataInHighBits(enum AVPixelFormat pix_fmt) +{ + int i; + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + if (desc->flags & (AV_PIX_FMT_FLAG_BITSTREAM | AV_PIX_FMT_FLAG_HWACCEL)) + return 0; + for (i = 0; i < desc->nb_components; i++) { + if (!desc->comp[i].shift) + return 0; + if ((desc->comp[i].shift + desc->comp[i].depth) & 0x7) + return 0; + } + return 1; +} + +/* + * Identity formats where the chroma planes are swapped (CrCb order). + */ +static av_always_inline int isSwappedChroma(enum AVPixelFormat pix_fmt) +{ + const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); + av_assert0(desc); + if (!isYUV(pix_fmt)) + return 0; + if ((desc->flags & AV_PIX_FMT_FLAG_ALPHA) && desc->nb_components < 4) + return 0; + if (desc->nb_components < 3) + return 0; + if (!isPlanarYUV(pix_fmt) || isSemiPlanarYUV(pix_fmt)) + return desc->comp[1].offset > desc->comp[2].offset; + else + return desc->comp[1].plane > desc->comp[2].plane; +} + +extern const uint64_t ff_dither4[2]; +extern const uint64_t ff_dither8[2]; + +extern const uint8_t ff_dither_2x2_4[3][8]; +extern const uint8_t ff_dither_2x2_8[3][8]; +extern const uint8_t ff_dither_4x4_16[5][8]; +extern const uint8_t ff_dither_8x8_32[9][8]; +extern const uint8_t ff_dither_8x8_73[9][8]; +extern const uint8_t ff_dither_8x8_128[9][8]; +extern const uint8_t ff_dither_8x8_220[9][8]; + +extern const int32_t ff_yuv2rgb_coeffs[11][4]; + +extern const AVClass ff_sws_context_class; + +/** + * Set c->convert_unscaled to an unscaled converter if one exists for the + * specific source and destination formats, bit depths, flags, etc. + */ +void ff_get_unscaled_swscale(SwsContext *c); +void ff_get_unscaled_swscale_ppc(SwsContext *c); +void ff_get_unscaled_swscale_arm(SwsContext *c); +void ff_get_unscaled_swscale_aarch64(SwsContext *c); + +void ff_sws_init_scale(SwsContext *c); + +void ff_sws_init_input_funcs(SwsContext *c); +void ff_sws_init_output_funcs(SwsContext *c, + yuv2planar1_fn *yuv2plane1, + yuv2planarX_fn *yuv2planeX, + yuv2interleavedX_fn *yuv2nv12cX, + yuv2packed1_fn *yuv2packed1, + yuv2packed2_fn *yuv2packed2, + yuv2packedX_fn *yuv2packedX, + yuv2anyX_fn *yuv2anyX); +void ff_sws_init_swscale_ppc(SwsContext *c); +void ff_sws_init_swscale_vsx(SwsContext *c); +void ff_sws_init_swscale_x86(SwsContext *c); +void ff_sws_init_swscale_aarch64(SwsContext *c); +void ff_sws_init_swscale_arm(SwsContext *c); +void ff_sws_init_swscale_loongarch(SwsContext *c); +void ff_sws_init_swscale_riscv(SwsContext *c); + +void ff_hyscale_fast_c(SwsContext *c, int16_t *dst, int dstWidth, + const uint8_t *src, int srcW, int xInc); +void ff_hcscale_fast_c(SwsContext *c, int16_t *dst1, int16_t *dst2, + int dstWidth, const uint8_t *src1, + const uint8_t *src2, int srcW, int xInc); +int ff_init_hscaler_mmxext(int dstW, int xInc, uint8_t *filterCode, + int16_t *filter, int32_t *filterPos, + int numSplits); +void ff_hyscale_fast_mmxext(SwsContext *c, int16_t *dst, + int dstWidth, const uint8_t *src, + int srcW, int xInc); +void ff_hcscale_fast_mmxext(SwsContext *c, int16_t *dst1, int16_t *dst2, + int dstWidth, const uint8_t *src1, + const uint8_t *src2, int srcW, int xInc); + +int ff_sws_alphablendaway(SwsContext *c, const uint8_t *src[], + int srcStride[], int srcSliceY, int srcSliceH, + uint8_t *dst[], int dstStride[]); + +void ff_copyPlane(const uint8_t *src, int srcStride, + int srcSliceY, int srcSliceH, int width, + uint8_t *dst, int dstStride); + +static inline void fillPlane16(uint8_t *plane, int stride, int width, int height, int y, + int alpha, int bits, const int big_endian) +{ + uint8_t *ptr = plane + stride * y; + int v = alpha ? 0xFFFF>>(16-bits) : (1<<(bits-1)); + if (big_endian != HAVE_BIGENDIAN) + v = av_bswap16(v); + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) + AV_WN16(ptr + 2 * j, v); + ptr += stride; + } +} + +static inline void fillPlane32(uint8_t *plane, int stride, int width, int height, int y, + int alpha, int bits, const int big_endian, int is_float) +{ + uint8_t *ptr = plane + stride * y; + uint32_t v; + uint32_t onef32 = 0x3f800000; + if (is_float) + v = alpha ? onef32 : 0; + else + v = alpha ? 0xFFFFFFFF>>(32-bits) : (1<<(bits-1)); + if (big_endian != HAVE_BIGENDIAN) + v = av_bswap32(v); + + for (int i = 0; i < height; i++) { + for (int j = 0; j < width; j++) + AV_WN32(ptr + 4 * j, v); + ptr += stride; + } +} + + +#define MAX_SLICE_PLANES 4 + +/// Slice plane +typedef struct SwsPlane +{ + int available_lines; ///< max number of lines that can be hold by this plane + int sliceY; ///< index of first line + int sliceH; ///< number of lines + uint8_t **line; ///< line buffer + uint8_t **tmp; ///< Tmp line buffer used by mmx code +} SwsPlane; + +/** + * Struct which defines a slice of an image to be scaled or an output for + * a scaled slice. + * A slice can also be used as intermediate ring buffer for scaling steps. + */ +typedef struct SwsSlice +{ + int width; ///< Slice line width + int h_chr_sub_sample; ///< horizontal chroma subsampling factor + int v_chr_sub_sample; ///< vertical chroma subsampling factor + int is_ring; ///< flag to identify if this slice is a ring buffer + int should_free_lines; ///< flag to identify if there are dynamic allocated lines + enum AVPixelFormat fmt; ///< planes pixel format + SwsPlane plane[MAX_SLICE_PLANES]; ///< color planes +} SwsSlice; + +/** + * Struct which holds all necessary data for processing a slice. + * A processing step can be a color conversion or horizontal/vertical scaling. + */ +typedef struct SwsFilterDescriptor +{ + SwsSlice *src; ///< Source slice + SwsSlice *dst; ///< Output slice + + int alpha; ///< Flag for processing alpha channel + void *instance; ///< Filter instance data + + /// Function for processing input slice sliceH lines starting from line sliceY + int (*process)(SwsContext *c, struct SwsFilterDescriptor *desc, int sliceY, int sliceH); +} SwsFilterDescriptor; + +// warp input lines in the form (src + width*i + j) to slice format (line[i][j]) +// relative=true means first line src[x][0] otherwise first line is src[x][lum/crh Y] +int ff_init_slice_from_src(SwsSlice * s, uint8_t *src[4], int stride[4], int srcW, int lumY, int lumH, int chrY, int chrH, int relative); + +// Initialize scaler filter descriptor chain +int ff_init_filters(SwsContext *c); + +// Free all filter data +int ff_free_filters(SwsContext *c); + +/* + function for applying ring buffer logic into slice s + It checks if the slice can hold more @lum lines, if yes + do nothing otherwise remove @lum least used lines. + It applies the same procedure for @chr lines. +*/ +int ff_rotate_slice(SwsSlice *s, int lum, int chr); + +/// initializes gamma conversion descriptor +int ff_init_gamma_convert(SwsFilterDescriptor *desc, SwsSlice * src, uint16_t *table); + +/// initializes lum pixel format conversion descriptor +int ff_init_desc_fmt_convert(SwsFilterDescriptor *desc, SwsSlice * src, SwsSlice *dst, uint32_t *pal); + +/// initializes lum horizontal scaling descriptor +int ff_init_desc_hscale(SwsFilterDescriptor *desc, SwsSlice *src, SwsSlice *dst, uint16_t *filter, int * filter_pos, int filter_size, int xInc); + +/// initializes chr pixel format conversion descriptor +int ff_init_desc_cfmt_convert(SwsFilterDescriptor *desc, SwsSlice * src, SwsSlice *dst, uint32_t *pal); + +/// initializes chr horizontal scaling descriptor +int ff_init_desc_chscale(SwsFilterDescriptor *desc, SwsSlice *src, SwsSlice *dst, uint16_t *filter, int * filter_pos, int filter_size, int xInc); + +int ff_init_desc_no_chr(SwsFilterDescriptor *desc, SwsSlice * src, SwsSlice *dst); + +/// initializes vertical scaling descriptors +int ff_init_vscale(SwsContext *c, SwsFilterDescriptor *desc, SwsSlice *src, SwsSlice *dst); + +/// setup vertical scaler functions +void ff_init_vscale_pfn(SwsContext *c, yuv2planar1_fn yuv2plane1, yuv2planarX_fn yuv2planeX, + yuv2interleavedX_fn yuv2nv12cX, yuv2packed1_fn yuv2packed1, yuv2packed2_fn yuv2packed2, + yuv2packedX_fn yuv2packedX, yuv2anyX_fn yuv2anyX, int use_mmx); + +void ff_sws_slice_worker(void *priv, int jobnr, int threadnr, + int nb_jobs, int nb_threads); + +//number of extra lines to process +#define MAX_LINES_AHEAD 4 + +//shuffle filter and filterPos for hyScale and hcScale filters in avx2 +int ff_shuffle_filter_coefficients(SwsContext *c, int* filterPos, int filterSize, int16_t *filter, int dstW); +#endif /* SWSCALE_SWSCALE_INTERNAL_H */ diff --git a/include/libswscale/version.h b/include/libswscale/version.h index 4c6af26..51eb013 100644 --- a/include/libswscale/version.h +++ b/include/libswscale/version.h @@ -28,7 +28,7 @@ #include "version_major.h" -#define LIBSWSCALE_VERSION_MINOR 7 +#define LIBSWSCALE_VERSION_MINOR 3 #define LIBSWSCALE_VERSION_MICRO 100 #define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \ diff --git a/include/libswscale/version_major.h b/include/libswscale/version_major.h index 2f84187..fd259f9 100644 --- a/include/libswscale/version_major.h +++ b/include/libswscale/version_major.h @@ -24,7 +24,7 @@ * swscale version macros */ -#define LIBSWSCALE_VERSION_MAJOR 6 +#define LIBSWSCALE_VERSION_MAJOR 8 /** * FF_API_* defines may be placed below to indicate public API that will be